summaryrefslogtreecommitdiffstats
path: root/import-layers
diff options
context:
space:
mode:
authorPatrick Williams <patrick@stwcx.xyz>2016-08-17 14:31:25 -0500
committerPatrick Williams <patrick@stwcx.xyz>2016-08-22 16:43:26 +0000
commit60f9d69e016b11c468c98ea75ba0a60c44afbbc4 (patch)
treeecb49581a9e41a37943c22cd9ef3f63451b20ee7 /import-layers
parente18c61205e0234b03697129c20cc69c9b3940efc (diff)
downloadtalos-openbmc-60f9d69e016b11c468c98ea75ba0a60c44afbbc4.tar.gz
talos-openbmc-60f9d69e016b11c468c98ea75ba0a60c44afbbc4.zip
yocto-poky: Move to import-layers subdir
We are going to import additional layers, so create a subdir to hold all of the layers that we import with git-subtree. Change-Id: I6f732153a22be8ca663035c518837e3cc5ec0799 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Diffstat (limited to 'import-layers')
-rw-r--r--import-layers/yocto-poky/.gitignore27
-rw-r--r--import-layers/yocto-poky/.templateconf2
-rw-r--r--import-layers/yocto-poky/LICENSE14
-rw-r--r--import-layers/yocto-poky/README58
-rw-r--r--import-layers/yocto-poky/README.hardware500
-rw-r--r--import-layers/yocto-poky/bitbake/AUTHORS10
-rw-r--r--import-layers/yocto-poky/bitbake/COPYING339
-rw-r--r--import-layers/yocto-poky/bitbake/ChangeLog317
-rw-r--r--import-layers/yocto-poky/bitbake/HEADER19
-rw-r--r--import-layers/yocto-poky/bitbake/LICENSE12
-rwxr-xr-ximport-layers/yocto-poky/bitbake/bin/bitbake53
-rwxr-xr-ximport-layers/yocto-poky/bitbake/bin/bitbake-diffsigs138
-rwxr-xr-ximport-layers/yocto-poky/bitbake/bin/bitbake-dumpsig65
-rwxr-xr-ximport-layers/yocto-poky/bitbake/bin/bitbake-layers1072
-rwxr-xr-ximport-layers/yocto-poky/bitbake/bin/bitbake-prserv55
-rwxr-xr-ximport-layers/yocto-poky/bitbake/bin/bitbake-selftest55
-rwxr-xr-ximport-layers/yocto-poky/bitbake/bin/bitbake-worker447
-rwxr-xr-ximport-layers/yocto-poky/bitbake/bin/bitdoc531
-rwxr-xr-ximport-layers/yocto-poky/bitbake/bin/image-writer122
-rwxr-xr-ximport-layers/yocto-poky/bitbake/bin/toaster276
-rwxr-xr-ximport-layers/yocto-poky/bitbake/bin/toaster-eventreplay174
-rw-r--r--import-layers/yocto-poky/bitbake/contrib/README1
-rw-r--r--import-layers/yocto-poky/bitbake/contrib/bbdev.sh31
-rwxr-xr-ximport-layers/yocto-poky/bitbake/contrib/dump_cache.py68
-rw-r--r--import-layers/yocto-poky/bitbake/contrib/vim/ftdetect/bitbake.vim24
-rw-r--r--import-layers/yocto-poky/bitbake/contrib/vim/ftplugin/bitbake.vim2
-rwxr-xr-ximport-layers/yocto-poky/bitbake/contrib/vim/plugin/newbb.vim84
-rw-r--r--import-layers/yocto-poky/bitbake/contrib/vim/syntax/bitbake.vim126
-rw-r--r--import-layers/yocto-poky/bitbake/doc/COPYING.GPL339
-rw-r--r--import-layers/yocto-poky/bitbake/doc/COPYING.MIT17
-rw-r--r--import-layers/yocto-poky/bitbake/doc/Makefile91
-rw-r--r--import-layers/yocto-poky/bitbake/doc/README39
-rw-r--r--import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-customization.xsl29
-rw-r--r--import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.xml931
-rw-r--r--import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.xml765
-rw-r--r--import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-hello.xml505
-rw-r--r--import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-intro.xml691
-rw-r--r--import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml1918
-rw-r--r--import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.xml2319
-rw-r--r--import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-style.css984
-rw-r--r--import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual.xml88
-rw-r--r--import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/figures/bitbake-title.pngbin0 -> 5086 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/html.css281
-rw-r--r--import-layers/yocto-poky/bitbake/doc/bitbake.1142
-rw-r--r--import-layers/yocto-poky/bitbake/doc/poky.ent59
-rw-r--r--import-layers/yocto-poky/bitbake/doc/template/Vera.ttfbin0 -> 65932 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/doc/template/Vera.xml1
-rw-r--r--import-layers/yocto-poky/bitbake/doc/template/VeraMoBd.ttfbin0 -> 49052 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/doc/template/VeraMoBd.xml1
-rw-r--r--import-layers/yocto-poky/bitbake/doc/template/VeraMono.ttfbin0 -> 49224 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/doc/template/VeraMono.xml1
-rw-r--r--import-layers/yocto-poky/bitbake/doc/template/component.title.xsl39
-rw-r--r--import-layers/yocto-poky/bitbake/doc/template/db-pdf.xsl64
-rw-r--r--import-layers/yocto-poky/bitbake/doc/template/division.title.xsl25
-rw-r--r--import-layers/yocto-poky/bitbake/doc/template/draft.pngbin0 -> 24847 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/doc/template/fop-config.xml58
-rw-r--r--import-layers/yocto-poky/bitbake/doc/template/formal.object.heading.xsl21
-rw-r--r--import-layers/yocto-poky/bitbake/doc/template/gloss-permalinks.xsl14
-rw-r--r--import-layers/yocto-poky/bitbake/doc/template/permalinks.xsl25
-rw-r--r--import-layers/yocto-poky/bitbake/doc/template/section.title.xsl55
-rw-r--r--import-layers/yocto-poky/bitbake/doc/template/titlepage.templates.xml1259
-rwxr-xr-ximport-layers/yocto-poky/bitbake/doc/tools/docbook-to-pdf51
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/COW.py323
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/__init__.py144
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/build.py784
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/cache.py849
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/cache_extra.py75
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/checksum.py139
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/codeparser.py436
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/command.py474
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/compat.py6
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/cooker.py2196
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/cookerdata.py345
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/daemonize.py193
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/data.py448
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/data_smart.py969
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/event.py679
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/exceptions.py91
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/fetch2/__init__.py1773
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/fetch2/bzr.py143
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/fetch2/clearcase.py263
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/fetch2/cvs.py171
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/fetch2/git.py435
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/fetch2/gitannex.py76
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/fetch2/gitsm.py134
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/fetch2/hg.py278
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/fetch2/local.py129
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/fetch2/npm.py284
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/fetch2/osc.py135
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/fetch2/perforce.py187
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/fetch2/repo.py98
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/fetch2/sftp.py129
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/fetch2/ssh.py128
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/fetch2/svn.py197
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/fetch2/wget.py565
-rwxr-xr-ximport-layers/yocto-poky/bitbake/lib/bb/main.py440
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/methodpool.py40
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/monitordisk.py263
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/msg.py199
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/namedtuple_with_abc.py255
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/parse/__init__.py170
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/parse/ast.py476
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/parse/parse_py/BBHandler.py254
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/parse/parse_py/ConfHandler.py193
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/parse/parse_py/__init__.py33
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/persist_data.py218
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/process.py156
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/providers.py428
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/pysh/__init__.py0
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/pysh/builtin.py710
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/pysh/interp.py1367
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/pysh/lsprof.py116
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/pysh/pysh.py167
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/pysh/pyshlex.py888
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/pysh/pyshyacc.py779
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/pysh/sherrors.py41
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/pysh/subprocess_fix.py77
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/runqueue.py2285
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/server/__init__.py99
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/server/process.py268
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/server/xmlrpc.py390
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/shell.py820
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/siggen.py601
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/taskdata.py690
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/tests/__init__.py0
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/tests/codeparser.py380
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/tests/cow.py136
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/tests/data.py446
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/tests/fetch.py812
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/tests/parse.py147
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/tests/utils.py603
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/tinfoil.py105
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/__init__.py17
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/buildinfohelper.py1521
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/__init__.py17
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/__init__.py0
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/crumbsdialog.py44
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/crumbsmessagedialog.py70
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/deployimagedialog.py219
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/imageselectiondialog.py172
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/layerselectiondialog.py298
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/propertydialog.py437
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/settingsuihelper.py122
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hobcolor.py38
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hobwidget.py904
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/persistenttooltip.py186
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/progress.py23
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/progressbar.py59
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/puccho.glade606
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/runningbuild.py551
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/utils.py34
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/depexp.py333
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/goggle.py121
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/icons/images/images_display.pngbin0 -> 6898 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/icons/images/images_hover.pngbin0 -> 7051 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/add-hover.pngbin0 -> 1212 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/add.pngbin0 -> 1176 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/alert.pngbin0 -> 3954 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/confirmation.pngbin0 -> 5789 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/denied.pngbin0 -> 3955 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/error.pngbin0 -> 6482 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/info.pngbin0 -> 3311 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/issues.pngbin0 -> 4549 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/refresh.pngbin0 -> 5250 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/remove-hover.pngbin0 -> 2809 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/remove.pngbin0 -> 1971 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/tick.pngbin0 -> 4563 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/icons/info/info_display.pngbin0 -> 4117 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/icons/info/info_hover.pngbin0 -> 4167 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/icons/layers/layers_display.pngbin0 -> 4840 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/icons/layers/layers_hover.pngbin0 -> 5257 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/icons/packages/packages_display.pngbin0 -> 7011 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/icons/packages/packages_hover.pngbin0 -> 7121 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/icons/recipe/recipe_display.pngbin0 -> 4723 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/icons/recipe/recipe_hover.pngbin0 -> 4866 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/icons/settings/settings_display.pngbin0 -> 6076 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/icons/settings/settings_hover.pngbin0 -> 6269 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/icons/templates/templates_display.pngbin0 -> 5651 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/icons/templates/templates_hover.pngbin0 -> 5791 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/knotty.py594
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/ncurses.py373
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/toasterui.py465
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/uievent.py161
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/ui/uihelper.py59
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bb/utils.py1453
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bs4/AUTHORS.txt43
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bs4/COPYING.txt26
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bs4/NEWS.txt1066
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bs4/__init__.py406
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bs4/builder/__init__.py321
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bs4/builder/_html5lib.py285
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bs4/builder/_htmlparser.py258
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bs4/builder/_lxml.py233
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bs4/dammit.py829
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bs4/diagnose.py204
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bs4/element.py1611
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bs4/testing.py592
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bs4/tests/__init__.py1
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bs4/tests/test_builder_registry.py141
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bs4/tests/test_docs.py36
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bs4/tests/test_html5lib.py85
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bs4/tests/test_htmlparser.py19
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bs4/tests/test_lxml.py91
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bs4/tests/test_soup.py434
-rw-r--r--import-layers/yocto-poky/bitbake/lib/bs4/tests/test_tree.py1829
-rw-r--r--import-layers/yocto-poky/bitbake/lib/codegen.py570
-rw-r--r--import-layers/yocto-poky/bitbake/lib/ply/__init__.py4
-rw-r--r--import-layers/yocto-poky/bitbake/lib/ply/lex.py1058
-rw-r--r--import-layers/yocto-poky/bitbake/lib/ply/yacc.py3276
-rw-r--r--import-layers/yocto-poky/bitbake/lib/progressbar.py384
-rw-r--r--import-layers/yocto-poky/bitbake/lib/prserv/__init__.py14
-rw-r--r--import-layers/yocto-poky/bitbake/lib/prserv/db.py276
-rw-r--r--import-layers/yocto-poky/bitbake/lib/prserv/serv.py471
-rw-r--r--import-layers/yocto-poky/bitbake/lib/pyinotify.py2416
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/__init__.py0
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/bldcollector/__init__.py0
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/bldcollector/admin.py33
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/bldcollector/urls.py25
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/bldcollector/views.py62
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/__init__.py0
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/admin.py8
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/bbcontroller.py142
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py332
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/management/__init__.py0
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/management/commands/__init__.py0
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py161
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py183
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py179
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/migrations/0001_initial.py113
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/migrations/0002_auto_20160120_1250.py19
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/migrations/0003_add_cancelling_state.py19
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/migrations/__init__.py0
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/models.py160
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/tests.py160
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/views.py1
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/contrib/README6
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/README41
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/TODO9
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/config.py98
-rwxr-xr-ximport-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/launcher.py101
-rwxr-xr-ximport-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/recv.py56
-rwxr-xr-ximport-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/runner.py222
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/settings.json5
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/shellutils.py141
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/tests.py115
-rwxr-xr-ximport-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/toasteruitest/run_toastertests.py155
-rwxr-xr-ximport-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/toasteruitest/toaster_automation_test.py2376
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/toasteruitest/toaster_test.cfg25
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/urlcheck.py53
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/urllist.py39
-rwxr-xr-ximport-layers/yocto-poky/bitbake/lib/toaster/manage.py10
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/orm/__init__.py0
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/orm/management/__init__.py0
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/orm/management/commands/__init__.py0
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/orm/management/commands/lsupdates.py12
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/orm/migrations/0001_initial.py504
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/orm/migrations/0002_customimagerecipe.py24
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/orm/migrations/0003_customimagepackage.py24
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/orm/migrations/0004_provides.py27
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/orm/migrations/0005_task_field_separation.py48
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/orm/migrations/0006_add_cancelled_state.py19
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/orm/migrations/__init__.py0
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/orm/models.py1722
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/orm/tests.py180
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/tests/__init__.py0
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/README41
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/__init__.py0
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/selenium_helpers.py204
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_all_builds_page.py143
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_all_projects_page.py214
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_builddashboard_page.py251
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_js_unit_tests.py57
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_landing_page.py108
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_new_custom_image_page.py160
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_project_builds_page.py168
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_project_page.py59
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_sample.py41
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/tests/toaster-tests-requirements.txt1
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/__init__.py0
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/api.py110
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/fixtures/toastergui-unittest-data.xml446
-rwxr-xr-ximport-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/bootstrap-responsive.min.css9
-rwxr-xr-ximport-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/bootstrap.min.css9
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/default.css343
-rwxr-xr-ximport-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/font-awesome.min.css33
-rwxr-xr-ximport-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_diagonals-thick_18_b81900_40x40.pngbin0 -> 418 bytes
-rwxr-xr-ximport-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_diagonals-thick_20_666666_40x40.pngbin0 -> 312 bytes
-rwxr-xr-ximport-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_flat_10_000000_40x100.pngbin0 -> 205 bytes
-rwxr-xr-ximport-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_glass_100_f6f6f6_1x400.pngbin0 -> 262 bytes
-rwxr-xr-ximport-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_glass_100_fdf5ce_1x400.pngbin0 -> 348 bytes
-rwxr-xr-ximport-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_glass_65_ffffff_1x400.pngbin0 -> 207 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_gloss-wave_35_f6a828_500x100.pngbin0 -> 5815 bytes
-rwxr-xr-ximport-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.pngbin0 -> 278 bytes
-rwxr-xr-ximport-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.pngbin0 -> 328 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_222222_256x240.pngbin0 -> 6922 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_228ef1_256x240.pngbin0 -> 4549 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_ef8c08_256x240.pngbin0 -> 4549 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_ffd27a_256x240.pngbin0 -> 4549 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_ffffff_256x240.pngbin0 -> 6299 bytes
-rwxr-xr-ximport-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/jquery-ui.min.css7
-rwxr-xr-ximport-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/jquery-ui.structure.min.css5
-rwxr-xr-ximport-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/jquery-ui.theme.min.css5
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/jquery.treetable.css28
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/jquery.treetable.theme.default.css64
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/jquery.treetable.theme.toaster.css38
-rwxr-xr-ximport-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/prettify.css1
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/qunit-1.18.0.css1
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/screen.css28
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/FontAwesome.otfbin0 -> 48748 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.eotbin0 -> 25395 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.svg284
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.ttfbin0 -> 55096 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.woffbin0 -> 29380 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.eotbin0 -> 20290 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.svg229
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.ttfbin0 -> 41236 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.woffbin0 -> 23292 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/html/layer_deps_modal.html17
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/img/glyphicons-halflings-white.pngbin0 -> 8777 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/img/glyphicons-halflings.pngbin0 -> 12799 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/img/logo.pngbin0 -> 3020 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/img/toaster_bw.pngbin0 -> 140514 bytes
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/jquery-treetable-license/GPL-LICENSE.txt278
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/jquery-treetable-license/MIT-LICENSE.txt20
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/jquery-treetable-license/README.md20
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/jquery.treetable.theme.toaster.css66
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/.jshintrc11
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/bootstrap.min.js6
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/customrecipe.js284
-rwxr-xr-ximport-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/filtersnippet.js94
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/importlayer.js303
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/jquery-2.0.3.min.js6
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/jquery-2.0.3.min.map1
-rwxr-xr-ximport-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/jquery-ui.min.js7
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/jquery.cookie.js117
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/jquery.treetable.js620
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/layerBtn.js83
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/layerDepsModal.js90
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/layerdetails.js395
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/libtoaster.js623
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/mrbsection.js95
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js148
-rwxr-xr-ximport-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/prettify.js28
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/projectpage.js446
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/projecttopbar.js90
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/qunit-1.18.0.js347
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/recipedetails.js51
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/table.js793
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/tests/test.js175
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/ui-bootstrap-tpls-0.11.0.js10
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/ui-bootstrap-tpls-0.11.0.min.js10
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/tablefilter.py292
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/tables.py1503
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/base.html126
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/basebuilddetailpage.html32
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/basebuildpage.html157
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/baseprojectbuildspage.html15
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/baseprojectpage.html45
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/basetable_bottom.html94
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/basetable_top.html239
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/basetable_top_layers.html5
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/bfile.html24
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/bpackage.html108
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/brtargets.html20
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/builddashboard.html278
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/buildrequestdetails.html64
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/builds-toastertable.html48
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/buildtime.html4
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/configuration.html72
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/configvars.html133
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/cpuusage.html4
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/customise_btn.html15
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/customrecipe.html223
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/detail_pagination_bottom.html55
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/detail_search_header.html68
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/detail_sorted_header.html25
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/dirinfo.html241
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/diskio.html4
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/editcustomimage_modal.html71
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/filtersnippet.html57
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/generic-toastertable-page.html17
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/importlayer.html139
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/js-unit-tests.html47
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/landing.html62
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/landing_not_managed.html34
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/layer_btn.html17
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/layerdetails.html275
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/machine_btn.html16
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/mrb_section.html178
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/newcustomimage.html14
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/newcustomimage_modal.html48
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/newproject.html133
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/package_built_dependencies.html99
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/package_built_detail.html65
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/package_detail_base.html149
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/package_included_dependencies.html110
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/package_included_detail.html44
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/package_included_reverse_dependencies.html50
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/package_included_tabs.html33
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/pkg_add_rm_btn.html34
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/project.html140
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/projectbuilds-toastertable.html56
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/projectbuilds.html118
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/projectconf.html950
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/projects-toastertable.html36
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/projecttopbar.html78
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/recipe.html267
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/recipe_btn.html16
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/recipe_packages.html123
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/recipedetails.html177
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/recipes.html113
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/snippets/pkg_dependencies_popover.html14
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html14
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/tablesort.html38
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/target.html163
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/task.html277
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/tasks.html143
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/toastertable-filter.html20
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/toastertable-simple.html94
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/toastertable.html105
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/unavailable_artifact.html16
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templatetags/__init__.py0
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templatetags/objects_to_dictionaries_filter.py35
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templatetags/project_url_tag.py34
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templatetags/projecttags.py299
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/tests.py494
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/typeaheads.py146
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/urls.py190
-rwxr-xr-ximport-layers/yocto-poky/bitbake/lib/toaster/toastergui/views.py2982
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastergui/widgets.py421
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastermain/__init__.py0
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastermain/management/__init__.py0
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastermain/management/commands/__init__.py0
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastermain/management/commands/builddelete.py54
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastermain/management/commands/buildslist.py13
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastermain/management/commands/checksocket.py69
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastermain/management/commands/get-dburl.py9
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastermain/management/commands/perf.py58
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastermain/settings.py396
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastermain/urls.py90
-rw-r--r--import-layers/yocto-poky/bitbake/lib/toaster/toastermain/wsgi.py35
-rw-r--r--import-layers/yocto-poky/bitbake/toaster-requirements.txt4
-rw-r--r--import-layers/yocto-poky/documentation/Makefile467
-rw-r--r--import-layers/yocto-poky/documentation/README93
-rw-r--r--import-layers/yocto-poky/documentation/adt-manual/adt-command.xml265
-rw-r--r--import-layers/yocto-poky/documentation/adt-manual/adt-intro.xml180
-rw-r--r--import-layers/yocto-poky/documentation/adt-manual/adt-manual-customization.xsl27
-rw-r--r--import-layers/yocto-poky/documentation/adt-manual/adt-manual-eclipse-customization.xsl35
-rw-r--r--import-layers/yocto-poky/documentation/adt-manual/adt-manual-intro.xml33
-rw-r--r--import-layers/yocto-poky/documentation/adt-manual/adt-manual.xml140
-rw-r--r--import-layers/yocto-poky/documentation/adt-manual/adt-package.xml102
-rw-r--r--import-layers/yocto-poky/documentation/adt-manual/adt-prepare.xml999
-rw-r--r--import-layers/yocto-poky/documentation/adt-manual/adt-style.css984
-rw-r--r--import-layers/yocto-poky/documentation/adt-manual/figures/adt-title.pngbin0 -> 13498 bytes
-rw-r--r--import-layers/yocto-poky/documentation/adt-manual/figures/using-a-pre-built-image.pngbin0 -> 12733 bytes
-rw-r--r--import-layers/yocto-poky/documentation/bsp-guide/bsp-guide-customization.xsl27
-rw-r--r--import-layers/yocto-poky/documentation/bsp-guide/bsp-guide-eclipse-customization.xsl35
-rw-r--r--import-layers/yocto-poky/documentation/bsp-guide/bsp-guide.xml143
-rw-r--r--import-layers/yocto-poky/documentation/bsp-guide/bsp-style.css984
-rw-r--r--import-layers/yocto-poky/documentation/bsp-guide/bsp.xml1697
-rw-r--r--import-layers/yocto-poky/documentation/bsp-guide/figures/bsp-title.pngbin0 -> 17388 bytes
-rw-r--r--import-layers/yocto-poky/documentation/dev-manual/dev-manual-common-tasks.xml10370
-rw-r--r--import-layers/yocto-poky/documentation/dev-manual/dev-manual-customization.xsl27
-rw-r--r--import-layers/yocto-poky/documentation/dev-manual/dev-manual-eclipse-customization.xsl35
-rw-r--r--import-layers/yocto-poky/documentation/dev-manual/dev-manual-intro.xml247
-rw-r--r--import-layers/yocto-poky/documentation/dev-manual/dev-manual-model.xml2195
-rw-r--r--import-layers/yocto-poky/documentation/dev-manual/dev-manual-newbie.xml1710
-rw-r--r--import-layers/yocto-poky/documentation/dev-manual/dev-manual-qemu.xml433
-rw-r--r--import-layers/yocto-poky/documentation/dev-manual/dev-manual-start.xml435
-rw-r--r--import-layers/yocto-poky/documentation/dev-manual/dev-manual.xml129
-rw-r--r--import-layers/yocto-poky/documentation/dev-manual/dev-style.css988
-rw-r--r--import-layers/yocto-poky/documentation/dev-manual/figures/bsp-dev-flow.pngbin0 -> 42751 bytes
-rw-r--r--import-layers/yocto-poky/documentation/dev-manual/figures/build-workspace-directory.pngbin0 -> 29627 bytes
-rw-r--r--import-layers/yocto-poky/documentation/dev-manual/figures/dev-title.pngbin0 -> 11813 bytes
-rw-r--r--import-layers/yocto-poky/documentation/dev-manual/figures/devtool-add-flow.pngbin0 -> 179361 bytes
-rw-r--r--import-layers/yocto-poky/documentation/dev-manual/figures/devtool-modify-flow.pngbin0 -> 152662 bytes
-rw-r--r--import-layers/yocto-poky/documentation/dev-manual/figures/devtool-upgrade-flow.pngbin0 -> 140597 bytes
-rw-r--r--import-layers/yocto-poky/documentation/dev-manual/figures/git-workflow.pngbin0 -> 26586 bytes
-rw-r--r--import-layers/yocto-poky/documentation/dev-manual/figures/index-downloads.pngbin0 -> 100374 bytes
-rw-r--r--import-layers/yocto-poky/documentation/dev-manual/figures/kernel-dev-flow.pngbin0 -> 35561 bytes
-rw-r--r--import-layers/yocto-poky/documentation/dev-manual/figures/kernel-overview-1.pngbin0 -> 35839 bytes
-rw-r--r--import-layers/yocto-poky/documentation/dev-manual/figures/kernel-overview-2-generic.pngbin0 -> 39910 bytes
-rw-r--r--import-layers/yocto-poky/documentation/dev-manual/figures/recipe-workflow.pngbin0 -> 48276 bytes
-rw-r--r--import-layers/yocto-poky/documentation/dev-manual/figures/source-repos.pngbin0 -> 188986 bytes
-rw-r--r--import-layers/yocto-poky/documentation/dev-manual/figures/yp-download.pngbin0 -> 230971 bytes
-rwxr-xr-ximport-layers/yocto-poky/documentation/kernel-dev/figures/kernel-architecture-overview.pngbin0 -> 40748 bytes
-rw-r--r--import-layers/yocto-poky/documentation/kernel-dev/figures/kernel-dev-title.pngbin0 -> 13453 bytes
-rw-r--r--import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-advanced.xml1101
-rw-r--r--import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-common.xml1159
-rw-r--r--import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-concepts-appx.xml253
-rw-r--r--import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-customization.xsl26
-rw-r--r--import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-eclipse-customization.xsl35
-rw-r--r--import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-examples.xml918
-rw-r--r--import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-faq.xml140
-rw-r--r--import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-intro.xml149
-rw-r--r--import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-maint-appx.xml220
-rw-r--r--import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-style.css984
-rw-r--r--import-layers/yocto-poky/documentation/kernel-dev/kernel-dev.xml120
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/add-variable.pngbin0 -> 110712 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/analysis-for-package-splitting.pngbin0 -> 63291 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/bash-oecore.pngbin0 -> 138198 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/bsp-dev-flow.pngbin0 -> 42751 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/bsp-title.pngbin0 -> 17388 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/build-workspace-directory.pngbin0 -> 29627 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/buildhistory-web.pngbin0 -> 49966 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/buildhistory.pngbin0 -> 44900 bytes
-rwxr-xr-ximport-layers/yocto-poky/documentation/mega-manual/figures/building-an-image.pngbin0 -> 14891 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/compatible-layers.pngbin0 -> 163081 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/configuration-compile-autoreconf.pngbin0 -> 46080 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/cross-development-toolchains.pngbin0 -> 59275 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/define-generic.pngbin0 -> 623 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/dev-title.pngbin0 -> 11813 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/devtool-add-flow.pngbin0 -> 179361 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/devtool-modify-flow.pngbin0 -> 152662 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/devtool-upgrade-flow.pngbin0 -> 140597 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/git-workflow.pngbin0 -> 26586 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/hosted-service.pngbin0 -> 13552 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/image-generation.pngbin0 -> 112991 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/images.pngbin0 -> 22926 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/import-layer.pngbin0 -> 139108 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/index-downloads.pngbin0 -> 58263 bytes
-rwxr-xr-ximport-layers/yocto-poky/documentation/mega-manual/figures/kernel-architecture-overview.pngbin0 -> 40748 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/kernel-dev-flow.pngbin0 -> 35561 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/kernel-dev-title.pngbin0 -> 13453 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/kernel-overview-1.pngbin0 -> 35839 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/kernel-overview-2-generic.pngbin0 -> 39910 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/kernel-title.pngbin0 -> 13970 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/kernelshark-all.pngbin0 -> 89316 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/kernelshark-choose-events.pngbin0 -> 57372 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/kernelshark-i915-display.pngbin0 -> 98765 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/kernelshark-output-display.pngbin0 -> 204454 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/layer-input.pngbin0 -> 45856 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/lttngmain0.pngbin0 -> 120581 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/mega-title.pngbin0 -> 10536 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/new-project.pngbin0 -> 73760 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/oprofileui-busybox.pngbin0 -> 98334 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/oprofileui-copy-to-user.pngbin0 -> 105661 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/oprofileui-downloading.pngbin0 -> 37301 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/oprofileui-processes.pngbin0 -> 95741 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/package-feeds.pngbin0 -> 30112 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/patching.pngbin0 -> 42523 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/perf-probe-do_fork-profile.pngbin0 -> 59078 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/perf-report-cycles-u.pngbin0 -> 171368 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/perf-systemwide-libc.pngbin0 -> 136826 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/perf-systemwide.pngbin0 -> 140616 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-busybox-annotate-menu.pngbin0 -> 22364 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-busybox-annotate-udhcpc.pngbin0 -> 171529 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-busybox-debuginfo.pngbin0 -> 174971 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-busybox-dso-zoom-menu.pngbin0 -> 23735 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-busybox-dso-zoom.pngbin0 -> 101685 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-busybox-expanded-stripped.pngbin0 -> 95140 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-flat-stripped.pngbin0 -> 178919 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-g-copy-from-user-expanded-stripped.pngbin0 -> 138550 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-debuginfo.pngbin0 -> 102790 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.pngbin0 -> 110101 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-stripped.pngbin0 -> 102812 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/poky-title.pngbin0 -> 11592 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/profile-title.pngbin0 -> 12799 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/pybootchartgui-linux-yocto.pngbin0 -> 36366 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/pychart-linux-yocto-rpm-nostrip.pngbin0 -> 98053 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/pychart-linux-yocto-rpm.pngbin0 -> 81053 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/recipe-workflow.pngbin0 -> 48276 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/sched-wakeup-profile.pngbin0 -> 123810 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/sdk-devtool-add-flow.pngbin0 -> 179361 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/sdk-devtool-modify-flow.pngbin0 -> 146467 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/sdk-eclipse-dev-flow.pngbin0 -> 62626 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/sdk-environment.pngbin0 -> 42098 bytes
-rwxr-xr-ximport-layers/yocto-poky/documentation/mega-manual/figures/sdk-generation.pngbin0 -> 115643 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/sdk-installed-extensible-sdk-directory.pngbin0 -> 42892 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/sdk-installed-standard-sdk-directory.pngbin0 -> 56096 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/sdk-title.pngbin0 -> 52702 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/sdk.pngbin0 -> 67478 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/set-variable.pngbin0 -> 111430 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/simple-configuration.pngbin0 -> 10789 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/source-fetching.pngbin0 -> 38860 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/source-input.pngbin0 -> 39872 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/source-repos.pngbin0 -> 188986 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/sysprof-callers.pngbin0 -> 145043 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/sysprof-copy-from-user.pngbin0 -> 132976 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/sysprof-copy-to-user.pngbin0 -> 132074 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/toaster-title.pngbin0 -> 9277 bytes
-rwxr-xr-ximport-layers/yocto-poky/documentation/mega-manual/figures/user-configuration.pngbin0 -> 74109 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/using-a-pre-built-image.pngbin0 -> 12733 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/variable-added.pngbin0 -> 112163 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/yocto-environment-ref.pngbin0 -> 83206 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/yocto-environment.pngbin0 -> 73095 bytes
-rwxr-xr-ximport-layers/yocto-poky/documentation/mega-manual/figures/yocto-project-transp.pngbin0 -> 8626 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/figures/yp-download.pngbin0 -> 230971 bytes
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/mega-manual-customization.xsl42
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/mega-manual.xml236
-rw-r--r--import-layers/yocto-poky/documentation/mega-manual/mega-style.css984
-rw-r--r--import-layers/yocto-poky/documentation/poky.ent73
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/kernelshark-all.pngbin0 -> 89316 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/kernelshark-choose-events.pngbin0 -> 57372 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/kernelshark-i915-display.pngbin0 -> 98765 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/kernelshark-output-display.pngbin0 -> 204454 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/lttngmain0.pngbin0 -> 120581 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/oprofileui-busybox.pngbin0 -> 98334 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/oprofileui-copy-to-user.pngbin0 -> 105661 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/oprofileui-downloading.pngbin0 -> 37301 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/oprofileui-processes.pngbin0 -> 95741 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/perf-probe-do_fork-profile.pngbin0 -> 59078 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/perf-report-cycles-u.pngbin0 -> 171368 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/perf-systemwide-libc.pngbin0 -> 136826 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/perf-systemwide.pngbin0 -> 140616 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-busybox-annotate-menu.pngbin0 -> 22364 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-busybox-annotate-udhcpc.pngbin0 -> 171529 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-busybox-debuginfo.pngbin0 -> 174971 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-busybox-dso-zoom-menu.pngbin0 -> 23735 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-busybox-dso-zoom.pngbin0 -> 101685 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-busybox-expanded-stripped.pngbin0 -> 95140 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-flat-stripped.pngbin0 -> 178919 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-g-copy-from-user-expanded-stripped.pngbin0 -> 138550 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-debuginfo.pngbin0 -> 102790 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.pngbin0 -> 110101 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-stripped.pngbin0 -> 102812 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/profile-title.pngbin0 -> 12799 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/pybootchartgui-linux-yocto.pngbin0 -> 36366 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/pychart-linux-yocto-rpm-nostrip.pngbin0 -> 98053 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/pychart-linux-yocto-rpm.pngbin0 -> 81053 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/sched-wakeup-profile.pngbin0 -> 123810 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/sysprof-callers.pngbin0 -> 145043 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/sysprof-copy-from-user.pngbin0 -> 132976 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/figures/sysprof-copy-to-user.pngbin0 -> 132074 bytes
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/profile-manual-arch.xml45
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/profile-manual-customization.xsl27
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/profile-manual-eclipse-customization.xsl35
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/profile-manual-examples.xml39
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/profile-manual-intro.xml102
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/profile-manual-style.css984
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/profile-manual-usage.xml3160
-rw-r--r--import-layers/yocto-poky/documentation/profile-manual/profile-manual.xml110
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/TODO11
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/closer-look.xml1426
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/examples/hello-autotools/hello_2.3.bb8
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/examples/hello-single/files/helloworld.c8
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/examples/hello-single/hello.bb17
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/examples/libxpm/libxpm_3.5.6.bb14
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/examples/mtd-makefile/mtd-utils_1.0.0.bb15
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/faq.xml836
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/figures/analysis-for-package-splitting.pngbin0 -> 63291 bytes
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/figures/buildhistory-web.pngbin0 -> 49966 bytes
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/figures/buildhistory.pngbin0 -> 44900 bytes
-rwxr-xr-ximport-layers/yocto-poky/documentation/ref-manual/figures/building-an-image.pngbin0 -> 14891 bytes
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/figures/configuration-compile-autoreconf.pngbin0 -> 46080 bytes
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/figures/cross-development-toolchains.pngbin0 -> 59275 bytes
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/figures/define-generic.pngbin0 -> 623 bytes
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/figures/image-generation.pngbin0 -> 112991 bytes
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/figures/images.pngbin0 -> 22926 bytes
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/figures/layer-input.pngbin0 -> 45856 bytes
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/figures/package-feeds.pngbin0 -> 30112 bytes
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/figures/patching.pngbin0 -> 42523 bytes
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/figures/poky-title.pngbin0 -> 11592 bytes
-rwxr-xr-ximport-layers/yocto-poky/documentation/ref-manual/figures/sdk-generation.pngbin0 -> 115643 bytes
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/figures/sdk.pngbin0 -> 67478 bytes
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/figures/source-fetching.pngbin0 -> 38860 bytes
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/figures/source-input.pngbin0 -> 39872 bytes
-rwxr-xr-ximport-layers/yocto-poky/documentation/ref-manual/figures/user-configuration.pngbin0 -> 74109 bytes
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/figures/yocto-environment-ref.pngbin0 -> 83206 bytes
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/introduction.xml624
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/migration.xml3286
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/ref-bitbake.xml472
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/ref-classes.xml3715
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/ref-features.xml438
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/ref-images.xml167
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/ref-manual-customization.xsl29
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/ref-manual-eclipse-customization.xsl35
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/ref-manual.xml165
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/ref-qa-checks.xml1237
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/ref-structure.xml1142
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/ref-style.css1028
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/ref-tasks.xml835
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/ref-variables.xml14736
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/ref-varlocality.xml196
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/resources.xml123
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/technical-details.xml1460
-rw-r--r--import-layers/yocto-poky/documentation/ref-manual/usingpoky.xml1132
-rw-r--r--import-layers/yocto-poky/documentation/sdk-manual/figures/sdk-devtool-add-flow.pngbin0 -> 179361 bytes
-rw-r--r--import-layers/yocto-poky/documentation/sdk-manual/figures/sdk-devtool-modify-flow.pngbin0 -> 146467 bytes
-rw-r--r--import-layers/yocto-poky/documentation/sdk-manual/figures/sdk-eclipse-dev-flow.pngbin0 -> 62626 bytes
-rw-r--r--import-layers/yocto-poky/documentation/sdk-manual/figures/sdk-environment.pngbin0 -> 42098 bytes
-rw-r--r--import-layers/yocto-poky/documentation/sdk-manual/figures/sdk-installed-extensible-sdk-directory.pngbin0 -> 42892 bytes
-rw-r--r--import-layers/yocto-poky/documentation/sdk-manual/figures/sdk-installed-standard-sdk-directory.pngbin0 -> 56096 bytes
-rw-r--r--import-layers/yocto-poky/documentation/sdk-manual/figures/sdk-title.pngbin0 -> 52702 bytes
-rw-r--r--import-layers/yocto-poky/documentation/sdk-manual/sdk-appendix-customizing.xml388
-rw-r--r--import-layers/yocto-poky/documentation/sdk-manual/sdk-appendix-obtain.xml252
-rw-r--r--import-layers/yocto-poky/documentation/sdk-manual/sdk-extensible.xml1304
-rw-r--r--import-layers/yocto-poky/documentation/sdk-manual/sdk-intro.xml338
-rw-r--r--import-layers/yocto-poky/documentation/sdk-manual/sdk-manual-customization.xsl27
-rw-r--r--import-layers/yocto-poky/documentation/sdk-manual/sdk-manual-eclipse-customization.xsl37
-rw-r--r--import-layers/yocto-poky/documentation/sdk-manual/sdk-manual.xml80
-rw-r--r--import-layers/yocto-poky/documentation/sdk-manual/sdk-style.css988
-rw-r--r--import-layers/yocto-poky/documentation/sdk-manual/sdk-using.xml1466
-rw-r--r--import-layers/yocto-poky/documentation/template/Vera.ttfbin0 -> 65932 bytes
-rw-r--r--import-layers/yocto-poky/documentation/template/Vera.xml1
-rw-r--r--import-layers/yocto-poky/documentation/template/VeraMoBd.ttfbin0 -> 49052 bytes
-rw-r--r--import-layers/yocto-poky/documentation/template/VeraMoBd.xml1
-rw-r--r--import-layers/yocto-poky/documentation/template/VeraMono.ttfbin0 -> 49224 bytes
-rw-r--r--import-layers/yocto-poky/documentation/template/VeraMono.xml1
-rw-r--r--import-layers/yocto-poky/documentation/template/component.title.xsl39
-rw-r--r--import-layers/yocto-poky/documentation/template/division.title.xsl24
-rw-r--r--import-layers/yocto-poky/documentation/template/draft.pngbin0 -> 24847 bytes
-rw-r--r--import-layers/yocto-poky/documentation/template/embedded_video.xsl22
-rw-r--r--import-layers/yocto-poky/documentation/template/fop-config.xml58
-rw-r--r--import-layers/yocto-poky/documentation/template/formal.object.heading.xsl21
-rw-r--r--import-layers/yocto-poky/documentation/template/gloss-permalinks.xsl14
-rw-r--r--import-layers/yocto-poky/documentation/template/ohand-color.svg150
-rw-r--r--import-layers/yocto-poky/documentation/template/permalinks.xsl25
-rw-r--r--import-layers/yocto-poky/documentation/template/poky-db-pdf.xsl64
-rw-r--r--import-layers/yocto-poky/documentation/template/poky-ref-manual.pngbin0 -> 32145 bytes
-rw-r--r--import-layers/yocto-poky/documentation/template/poky.svg163
-rw-r--r--import-layers/yocto-poky/documentation/template/qa-code-permalinks.xsl23
-rw-r--r--import-layers/yocto-poky/documentation/template/section.title.xsl55
-rw-r--r--import-layers/yocto-poky/documentation/template/titlepage.templates.xml1227
-rw-r--r--import-layers/yocto-poky/documentation/template/yocto-project-qs.pngbin0 -> 17829 bytes
-rw-r--r--import-layers/yocto-poky/documentation/toaster-manual/figures/add-variable.pngbin0 -> 110712 bytes
-rw-r--r--import-layers/yocto-poky/documentation/toaster-manual/figures/bash-oecore.pngbin0 -> 138198 bytes
-rw-r--r--import-layers/yocto-poky/documentation/toaster-manual/figures/compatible-layers.pngbin0 -> 163081 bytes
-rw-r--r--import-layers/yocto-poky/documentation/toaster-manual/figures/hosted-service.pngbin0 -> 13552 bytes
-rw-r--r--import-layers/yocto-poky/documentation/toaster-manual/figures/import-layer.pngbin0 -> 139108 bytes
-rw-r--r--import-layers/yocto-poky/documentation/toaster-manual/figures/new-project.pngbin0 -> 73760 bytes
-rw-r--r--import-layers/yocto-poky/documentation/toaster-manual/figures/set-variable.pngbin0 -> 111430 bytes
-rw-r--r--import-layers/yocto-poky/documentation/toaster-manual/figures/simple-configuration.pngbin0 -> 10789 bytes
-rw-r--r--import-layers/yocto-poky/documentation/toaster-manual/figures/toaster-title.pngbin0 -> 9277 bytes
-rw-r--r--import-layers/yocto-poky/documentation/toaster-manual/figures/variable-added.pngbin0 -> 112163 bytes
-rw-r--r--import-layers/yocto-poky/documentation/toaster-manual/toaster-manual-customization.xsl28
-rw-r--r--import-layers/yocto-poky/documentation/toaster-manual/toaster-manual-intro.xml157
-rw-r--r--import-layers/yocto-poky/documentation/toaster-manual/toaster-manual-reference.xml1052
-rw-r--r--import-layers/yocto-poky/documentation/toaster-manual/toaster-manual-setup-and-use.xml677
-rw-r--r--import-layers/yocto-poky/documentation/toaster-manual/toaster-manual-start.xml147
-rw-r--r--import-layers/yocto-poky/documentation/toaster-manual/toaster-manual-style.css984
-rw-r--r--import-layers/yocto-poky/documentation/toaster-manual/toaster-manual.xml83
-rw-r--r--import-layers/yocto-poky/documentation/tools/eclipse-help.sed18
-rw-r--r--import-layers/yocto-poky/documentation/tools/mega-manual.sed33
-rwxr-xr-ximport-layers/yocto-poky/documentation/tools/poky-docbook-to-pdf51
-rw-r--r--import-layers/yocto-poky/documentation/tools/update-documentation-conf168
-rw-r--r--import-layers/yocto-poky/documentation/yocto-project-qs/figures/yocto-environment.pngbin0 -> 73095 bytes
-rwxr-xr-ximport-layers/yocto-poky/documentation/yocto-project-qs/figures/yocto-project-transp.pngbin0 -> 8626 bytes
-rw-r--r--import-layers/yocto-poky/documentation/yocto-project-qs/qs-style.css983
-rw-r--r--import-layers/yocto-poky/documentation/yocto-project-qs/yocto-project-qs-customization.xsl24
-rw-r--r--import-layers/yocto-poky/documentation/yocto-project-qs/yocto-project-qs-eclipse-customization.xsl34
-rw-r--r--import-layers/yocto-poky/documentation/yocto-project-qs/yocto-project-qs-titlepage.xsl3820
-rw-r--r--import-layers/yocto-poky/documentation/yocto-project-qs/yocto-project-qs.xml848
-rw-r--r--import-layers/yocto-poky/meta-poky/classes/poky-sanity.bbclass46
-rw-r--r--import-layers/yocto-poky/meta-poky/conf/bblayers.conf.sample12
-rw-r--r--import-layers/yocto-poky/meta-poky/conf/conf-notes.txt7
-rw-r--r--import-layers/yocto-poky/meta-poky/conf/distro/include/maintainers.inc749
-rw-r--r--import-layers/yocto-poky/meta-poky/conf/distro/include/poky-floating-revisions.inc59
-rw-r--r--import-layers/yocto-poky/meta-poky/conf/distro/include/poky-world-exclude.inc6
-rw-r--r--import-layers/yocto-poky/meta-poky/conf/distro/poky-bleeding.conf11
-rw-r--r--import-layers/yocto-poky/meta-poky/conf/distro/poky-lsb.conf15
-rw-r--r--import-layers/yocto-poky/meta-poky/conf/distro/poky-tiny.conf128
-rw-r--r--import-layers/yocto-poky/meta-poky/conf/distro/poky.conf110
-rw-r--r--import-layers/yocto-poky/meta-poky/conf/layer.conf18
-rw-r--r--import-layers/yocto-poky/meta-poky/conf/local.conf.sample238
-rw-r--r--import-layers/yocto-poky/meta-poky/conf/local.conf.sample.extended400
-rw-r--r--import-layers/yocto-poky/meta-poky/conf/site.conf.sample31
-rw-r--r--import-layers/yocto-poky/meta-poky/conf/toasterconf.json120
-rw-r--r--import-layers/yocto-poky/meta-poky/recipes-core/busybox/busybox/poky-tiny/defconfig1009
-rw-r--r--import-layers/yocto-poky/meta-poky/recipes-core/busybox/busybox_%.bbappend2
-rw-r--r--import-layers/yocto-poky/meta-poky/recipes-core/psplash/files/psplash-poky-img.h914
-rw-r--r--import-layers/yocto-poky/meta-poky/recipes-core/psplash/psplash_git.bbappend2
-rw-r--r--import-layers/yocto-poky/meta-poky/recipes-core/tiny-init/files/init26
-rw-r--r--import-layers/yocto-poky/meta-poky/recipes-core/tiny-init/files/rc.local.sample23
-rw-r--r--import-layers/yocto-poky/meta-poky/recipes-core/tiny-init/tiny-init.bb30
-rw-r--r--import-layers/yocto-poky/meta-selftest/COPYING.MIT17
-rw-r--r--import-layers/yocto-poky/meta-selftest/README3
-rw-r--r--import-layers/yocto-poky/meta-selftest/classes/test_events.bbclass16
-rw-r--r--import-layers/yocto-poky/meta-selftest/conf/layer.conf10
-rw-r--r--import-layers/yocto-poky/meta-selftest/conf/machine/qemux86copy.conf3
-rw-r--r--import-layers/yocto-poky/meta-selftest/files/signing/key.pub30
-rw-r--r--import-layers/yocto-poky/meta-selftest/files/signing/key.secret59
-rw-r--r--import-layers/yocto-poky/meta-selftest/lib/devtool/__init__.py0
-rw-r--r--import-layers/yocto-poky/meta-selftest/lib/devtool/test.py11
-rw-r--r--import-layers/yocto-poky/meta-selftest/recipes-test/aspell/aspell_0.0.0.1.bb30
-rw-r--r--import-layers/yocto-poky/meta-selftest/recipes-test/aspell/aspell_0.60.6.1.bbappend2
-rw-r--r--import-layers/yocto-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--import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb16
-rw-r--r--import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb.upgraded14
-rw-r--r--import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb18
-rw-r--r--import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb.upgraded17
-rw-r--r--import-layers/yocto-poky/meta-selftest/recipes-test/emptytest/emptytest.bb7
-rw-r--r--import-layers/yocto-poky/meta-selftest/recipes-test/error/error.bb11
-rw-r--r--import-layers/yocto-poky/meta-selftest/recipes-test/images/error-image.bb8
-rw-r--r--import-layers/yocto-poky/meta-selftest/recipes-test/images/oe-selftest-image.bb9
-rw-r--r--import-layers/yocto-poky/meta-selftest/recipes-test/images/test-empty-image.bb6
-rw-r--r--import-layers/yocto-poky/meta-selftest/recipes-test/images/wic-image-minimal.bb18
-rw-r--r--import-layers/yocto-poky/meta-selftest/recipes-test/images/wic-image-minimal.wks10
-rw-r--r--import-layers/yocto-poky/meta-selftest/recipes-test/m4/m4_1.4.17.bbappend2
-rw-r--r--import-layers/yocto-poky/meta-selftest/recipes-test/man/man/man-1.5h1-make.patch16
-rw-r--r--import-layers/yocto-poky/meta-selftest/recipes-test/man/man_1.6g.bbappend2
-rw-r--r--import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/add-file.patch8
-rw-r--r--import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/file12
-rw-r--r--import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/installscript.sh3
-rw-r--r--import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-inst-func1
-rw-r--r--import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-inst-globfile1
-rw-r--r--import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-inst-todir-globfile1
-rw-r--r--import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-orig1
-rw-r--r--import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-src-globfile1
-rw-r--r--import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-todir1
-rw-r--r--import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/subdir/fileinsubdir1
-rw-r--r--import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/selftest-recipetool-appendfile.bb42
-rw-r--r--import-layers/yocto-poky/meta-selftest/recipes-test/xcursor-transparent-theme/xcursor-transparent-theme_%.bbappend2
-rw-r--r--import-layers/yocto-poky/meta-skeleton/COPYING.MIT17
-rw-r--r--import-layers/yocto-poky/meta-skeleton/conf/layer.conf15
-rw-r--r--import-layers/yocto-poky/meta-skeleton/conf/multilib-example.conf13
-rw-r--r--import-layers/yocto-poky/meta-skeleton/conf/multilib-example2.conf13
-rw-r--r--import-layers/yocto-poky/meta-skeleton/recipes-core/busybox/busybox/no_rfkill.cfg1
-rw-r--r--import-layers/yocto-poky/meta-skeleton/recipes-core/busybox/busybox_%.bbappend12
-rw-r--r--import-layers/yocto-poky/meta-skeleton/recipes-kernel/hello-mod/files/COPYING340
-rw-r--r--import-layers/yocto-poky/meta-skeleton/recipes-kernel/hello-mod/files/Makefile14
-rw-r--r--import-layers/yocto-poky/meta-skeleton/recipes-kernel/hello-mod/files/hello.c33
-rw-r--r--import-layers/yocto-poky/meta-skeleton/recipes-kernel/hello-mod/hello-mod_0.1.bb15
-rw-r--r--import-layers/yocto-poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb71
-rw-r--r--import-layers/yocto-poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/0001-linux-version-tweak.patch29
-rw-r--r--import-layers/yocto-poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/feature.scc1
-rw-r--r--import-layers/yocto-poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/smp.cfg1
-rw-r--r--import-layers/yocto-poky/meta-skeleton/recipes-multilib/images/core-image-multilib-example.bb13
-rw-r--r--import-layers/yocto-poky/meta-skeleton/recipes-skeleton/service/service/COPYRIGHT15
-rw-r--r--import-layers/yocto-poky/meta-skeleton/recipes-skeleton/service/service/skeleton193
-rw-r--r--import-layers/yocto-poky/meta-skeleton/recipes-skeleton/service/service/skeleton_test.c12
-rw-r--r--import-layers/yocto-poky/meta-skeleton/recipes-skeleton/service/service_0.1.bb31
-rw-r--r--import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example.bb76
-rw-r--r--import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file10
-rw-r--r--import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file20
-rw-r--r--import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file30
-rw-r--r--import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file40
-rw-r--r--import-layers/yocto-poky/meta-yocto-bsp/conf/layer.conf11
-rw-r--r--import-layers/yocto-poky/meta-yocto-bsp/conf/machine/beaglebone.conf39
-rw-r--r--import-layers/yocto-poky/meta-yocto-bsp/conf/machine/edgerouter.conf22
-rw-r--r--import-layers/yocto-poky/meta-yocto-bsp/conf/machine/genericx86-64.conf8
-rw-r--r--import-layers/yocto-poky/meta-yocto-bsp/conf/machine/genericx86.conf10
-rw-r--r--import-layers/yocto-poky/meta-yocto-bsp/conf/machine/include/genericx86-common.inc20
-rw-r--r--import-layers/yocto-poky/meta-yocto-bsp/conf/machine/mpc8315e-rdb.conf33
-rw-r--r--import-layers/yocto-poky/meta-yocto-bsp/lib/oeqa/controllers/__init__.py0
-rw-r--r--import-layers/yocto-poky/meta-yocto-bsp/lib/oeqa/controllers/beaglebonetarget.py98
-rw-r--r--import-layers/yocto-poky/meta-yocto-bsp/lib/oeqa/controllers/edgeroutertarget.py90
-rw-r--r--import-layers/yocto-poky/meta-yocto-bsp/lib/oeqa/controllers/grubtarget.py71
-rw-r--r--import-layers/yocto-poky/meta-yocto-bsp/lib/oeqa/selftest/__init__.py0
-rw-r--r--import-layers/yocto-poky/meta-yocto-bsp/lib/oeqa/selftest/gummiboot.py83
-rw-r--r--import-layers/yocto-poky/meta-yocto-bsp/lib/oeqa/yoctobsp.py39
-rw-r--r--import-layers/yocto-poky/meta-yocto-bsp/recipes-bsp/formfactor/formfactor/beaglebone/machconfig3
-rw-r--r--import-layers/yocto-poky/meta-yocto-bsp/recipes-bsp/formfactor/formfactor/genericx86-64/machconfig6
-rw-r--r--import-layers/yocto-poky/meta-yocto-bsp/recipes-bsp/formfactor/formfactor/genericx86/machconfig6
-rw-r--r--import-layers/yocto-poky/meta-yocto-bsp/recipes-bsp/formfactor/formfactor_0.0.bbappend1
-rw-r--r--import-layers/yocto-poky/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check/gma500-gfx-check.conf2
-rw-r--r--import-layers/yocto-poky/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check/gma500-gfx-check.sh15
-rw-r--r--import-layers/yocto-poky/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check_1.0.bb18
-rw-r--r--import-layers/yocto-poky/meta-yocto-bsp/recipes-core/packagegroups/packagegroup-core-tools-profile.bbappend2
-rw-r--r--import-layers/yocto-poky/meta-yocto-bsp/recipes-core/uclibc/uclibc/genericx86-64/uClibc.machine69
-rw-r--r--import-layers/yocto-poky/meta-yocto-bsp/recipes-core/uclibc/uclibc/genericx86/uClibc.machine69
-rw-r--r--import-layers/yocto-poky/meta-yocto-bsp/recipes-core/uclibc/uclibc_git.bbappend1
-rw-r--r--import-layers/yocto-poky/meta-yocto-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config/genericx86-64/xorg.conf0
-rw-r--r--import-layers/yocto-poky/meta-yocto-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config/genericx86/xorg.conf0
-rw-r--r--import-layers/yocto-poky/meta-yocto-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend1
-rw-r--r--import-layers/yocto-poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.1.bbappend23
-rw-r--r--import-layers/yocto-poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.4.bbappend23
-rw-r--r--import-layers/yocto-poky/meta-yocto/conf/layer.conf2
-rw-r--r--import-layers/yocto-poky/meta/COPYING.GPLv2339
-rw-r--r--import-layers/yocto-poky/meta/COPYING.MIT17
-rw-r--r--import-layers/yocto-poky/meta/classes/allarch.bbclass47
-rw-r--r--import-layers/yocto-poky/meta/classes/archiver.bbclass395
-rw-r--r--import-layers/yocto-poky/meta/classes/autotools-brokensep.bbclass5
-rw-r--r--import-layers/yocto-poky/meta/classes/autotools.bbclass322
-rw-r--r--import-layers/yocto-poky/meta/classes/base.bbclass667
-rw-r--r--import-layers/yocto-poky/meta/classes/bash-completion.bbclass5
-rw-r--r--import-layers/yocto-poky/meta/classes/bin_package.bbclass36
-rw-r--r--import-layers/yocto-poky/meta/classes/binconfig-disabled.bbclass29
-rw-r--r--import-layers/yocto-poky/meta/classes/binconfig.bbclass63
-rw-r--r--import-layers/yocto-poky/meta/classes/blacklist.bbclass45
-rw-r--r--import-layers/yocto-poky/meta/classes/bluetooth.bbclass14
-rw-r--r--import-layers/yocto-poky/meta/classes/bugzilla.bbclass187
-rw-r--r--import-layers/yocto-poky/meta/classes/buildhistory.bbclass856
-rw-r--r--import-layers/yocto-poky/meta/classes/buildstats-summary.bbclass36
-rw-r--r--import-layers/yocto-poky/meta/classes/buildstats.bbclass185
-rw-r--r--import-layers/yocto-poky/meta/classes/ccache.bbclass8
-rw-r--r--import-layers/yocto-poky/meta/classes/chrpath.bbclass117
-rw-r--r--import-layers/yocto-poky/meta/classes/clutter.bbclass22
-rw-r--r--import-layers/yocto-poky/meta/classes/cmake.bbclass137
-rw-r--r--import-layers/yocto-poky/meta/classes/cml1.bbclass76
-rw-r--r--import-layers/yocto-poky/meta/classes/compress_doc.bbclass260
-rw-r--r--import-layers/yocto-poky/meta/classes/copyleft_compliance.bbclass64
-rw-r--r--import-layers/yocto-poky/meta/classes/copyleft_filter.bbclass79
-rw-r--r--import-layers/yocto-poky/meta/classes/core-image.bbclass71
-rw-r--r--import-layers/yocto-poky/meta/classes/cpan-base.bbclass40
-rw-r--r--import-layers/yocto-poky/meta/classes/cpan.bbclass55
-rw-r--r--import-layers/yocto-poky/meta/classes/cpan_build.bbclass40
-rw-r--r--import-layers/yocto-poky/meta/classes/cross-canadian.bbclass182
-rw-r--r--import-layers/yocto-poky/meta/classes/cross.bbclass71
-rw-r--r--import-layers/yocto-poky/meta/classes/crosssdk.bbclass36
-rw-r--r--import-layers/yocto-poky/meta/classes/debian.bbclass141
-rw-r--r--import-layers/yocto-poky/meta/classes/deploy.bbclass11
-rw-r--r--import-layers/yocto-poky/meta/classes/devshell.bbclass156
-rw-r--r--import-layers/yocto-poky/meta/classes/distro_features_check.bbclass37
-rw-r--r--import-layers/yocto-poky/meta/classes/distrodata.bbclass480
-rw-r--r--import-layers/yocto-poky/meta/classes/distutils-base.bbclass4
-rw-r--r--import-layers/yocto-poky/meta/classes/distutils-common-base.bbclass17
-rw-r--r--import-layers/yocto-poky/meta/classes/distutils-native-base.bbclass3
-rw-r--r--import-layers/yocto-poky/meta/classes/distutils-tools.bbclass77
-rw-r--r--import-layers/yocto-poky/meta/classes/distutils.bbclass86
-rw-r--r--import-layers/yocto-poky/meta/classes/distutils3-base.bbclass8
-rw-r--r--import-layers/yocto-poky/meta/classes/distutils3-native-base.bbclass4
-rw-r--r--import-layers/yocto-poky/meta/classes/distutils3.bbclass100
-rw-r--r--import-layers/yocto-poky/meta/classes/externalsrc.bbclass154
-rw-r--r--import-layers/yocto-poky/meta/classes/extrausers.bbclass65
-rw-r--r--import-layers/yocto-poky/meta/classes/fontcache.bbclass56
-rw-r--r--import-layers/yocto-poky/meta/classes/fs-uuid.bbclass24
-rw-r--r--import-layers/yocto-poky/meta/classes/gconf.bbclass70
-rw-r--r--import-layers/yocto-poky/meta/classes/gettext.bbclass19
-rw-r--r--import-layers/yocto-poky/meta/classes/gio-module-cache.bbclass37
-rw-r--r--import-layers/yocto-poky/meta/classes/gnome.bbclass1
-rw-r--r--import-layers/yocto-poky/meta/classes/gnomebase.bbclass30
-rw-r--r--import-layers/yocto-poky/meta/classes/gobject-introspection-data.bbclass9
-rw-r--r--import-layers/yocto-poky/meta/classes/gobject-introspection.bbclass37
-rw-r--r--import-layers/yocto-poky/meta/classes/grub-efi.bbclass156
-rw-r--r--import-layers/yocto-poky/meta/classes/gsettings.bbclass37
-rw-r--r--import-layers/yocto-poky/meta/classes/gtk-doc.bbclass25
-rw-r--r--import-layers/yocto-poky/meta/classes/gtk-icon-cache.bbclass64
-rw-r--r--import-layers/yocto-poky/meta/classes/gtk-immodules-cache.bbclass87
-rw-r--r--import-layers/yocto-poky/meta/classes/gummiboot.bbclass119
-rw-r--r--import-layers/yocto-poky/meta/classes/gzipnative.bbclass5
-rw-r--r--import-layers/yocto-poky/meta/classes/icecc.bbclass333
-rw-r--r--import-layers/yocto-poky/meta/classes/image-buildinfo.bbclass78
-rw-r--r--import-layers/yocto-poky/meta/classes/image-live.bbclass284
-rw-r--r--import-layers/yocto-poky/meta/classes/image-mklibs.bbclass56
-rw-r--r--import-layers/yocto-poky/meta/classes/image-prelink.bbclass54
-rw-r--r--import-layers/yocto-poky/meta/classes/image-swab.bbclass94
-rw-r--r--import-layers/yocto-poky/meta/classes/image-vm.bbclass175
-rw-r--r--import-layers/yocto-poky/meta/classes/image.bbclass547
-rw-r--r--import-layers/yocto-poky/meta/classes/image_types.bbclass299
-rw-r--r--import-layers/yocto-poky/meta/classes/image_types_uboot.bbclass26
-rw-r--r--import-layers/yocto-poky/meta/classes/insane.bbclass1319
-rw-r--r--import-layers/yocto-poky/meta/classes/kernel-arch.bbclass60
-rw-r--r--import-layers/yocto-poky/meta/classes/kernel-fitimage.bbclass235
-rw-r--r--import-layers/yocto-poky/meta/classes/kernel-grub.bbclass91
-rw-r--r--import-layers/yocto-poky/meta/classes/kernel-module-split.bbclass203
-rw-r--r--import-layers/yocto-poky/meta/classes/kernel-uboot.bbclass20
-rw-r--r--import-layers/yocto-poky/meta/classes/kernel-uimage.bbclass36
-rw-r--r--import-layers/yocto-poky/meta/classes/kernel-yocto.bbclass376
-rw-r--r--import-layers/yocto-poky/meta/classes/kernel.bbclass512
-rw-r--r--import-layers/yocto-poky/meta/classes/kernelsrc.bbclass10
-rw-r--r--import-layers/yocto-poky/meta/classes/lib_package.bbclass7
-rw-r--r--import-layers/yocto-poky/meta/classes/libc-common.bbclass43
-rw-r--r--import-layers/yocto-poky/meta/classes/libc-package.bbclass391
-rw-r--r--import-layers/yocto-poky/meta/classes/license.bbclass664
-rw-r--r--import-layers/yocto-poky/meta/classes/linux-kernel-base.bbclass41
-rw-r--r--import-layers/yocto-poky/meta/classes/linuxloader.bbclass24
-rw-r--r--import-layers/yocto-poky/meta/classes/live-vm-common.bbclass58
-rw-r--r--import-layers/yocto-poky/meta/classes/logging.bbclass101
-rw-r--r--import-layers/yocto-poky/meta/classes/meta.bbclass4
-rw-r--r--import-layers/yocto-poky/meta/classes/metadata_scm.bbclass83
-rw-r--r--import-layers/yocto-poky/meta/classes/migrate_localcount.bbclass46
-rw-r--r--import-layers/yocto-poky/meta/classes/mime.bbclass56
-rw-r--r--import-layers/yocto-poky/meta/classes/mirrors.bbclass70
-rw-r--r--import-layers/yocto-poky/meta/classes/module-base.bbclass27
-rw-r--r--import-layers/yocto-poky/meta/classes/module.bbclass34
-rw-r--r--import-layers/yocto-poky/meta/classes/multilib.bbclass148
-rw-r--r--import-layers/yocto-poky/meta/classes/multilib_global.bbclass180
-rw-r--r--import-layers/yocto-poky/meta/classes/multilib_header.bbclass54
-rw-r--r--import-layers/yocto-poky/meta/classes/native.bbclass179
-rw-r--r--import-layers/yocto-poky/meta/classes/nativesdk.bbclass97
-rw-r--r--import-layers/yocto-poky/meta/classes/nopackages.bbclass6
-rw-r--r--import-layers/yocto-poky/meta/classes/npm.bbclass49
-rw-r--r--import-layers/yocto-poky/meta/classes/oelint.bbclass84
-rw-r--r--import-layers/yocto-poky/meta/classes/own-mirrors.bbclass13
-rw-r--r--import-layers/yocto-poky/meta/classes/package.bbclass2131
-rw-r--r--import-layers/yocto-poky/meta/classes/package_deb.bbclass359
-rw-r--r--import-layers/yocto-poky/meta/classes/package_ipk.bbclass294
-rw-r--r--import-layers/yocto-poky/meta/classes/package_rpm.bbclass774
-rw-r--r--import-layers/yocto-poky/meta/classes/package_tar.bbclass69
-rw-r--r--import-layers/yocto-poky/meta/classes/packagedata.bbclass34
-rw-r--r--import-layers/yocto-poky/meta/classes/packagegroup.bbclass54
-rw-r--r--import-layers/yocto-poky/meta/classes/patch.bbclass187
-rw-r--r--import-layers/yocto-poky/meta/classes/perlnative.bbclass3
-rw-r--r--import-layers/yocto-poky/meta/classes/pixbufcache.bbclass67
-rw-r--r--import-layers/yocto-poky/meta/classes/pkgconfig.bbclass2
-rw-r--r--import-layers/yocto-poky/meta/classes/populate_sdk.bbclass7
-rw-r--r--import-layers/yocto-poky/meta/classes/populate_sdk_base.bbclass267
-rw-r--r--import-layers/yocto-poky/meta/classes/populate_sdk_ext.bbclass487
-rw-r--r--import-layers/yocto-poky/meta/classes/prexport.bbclass59
-rw-r--r--import-layers/yocto-poky/meta/classes/primport.bbclass21
-rw-r--r--import-layers/yocto-poky/meta/classes/ptest-gnome.bbclass8
-rw-r--r--import-layers/yocto-poky/meta/classes/ptest.bbclass67
-rw-r--r--import-layers/yocto-poky/meta/classes/python-dir.bbclass5
-rw-r--r--import-layers/yocto-poky/meta/classes/python3native.bbclass7
-rw-r--r--import-layers/yocto-poky/meta/classes/pythonnative.bbclass8
-rw-r--r--import-layers/yocto-poky/meta/classes/qemu.bbclass59
-rw-r--r--import-layers/yocto-poky/meta/classes/recipe_sanity.bbclass166
-rw-r--r--import-layers/yocto-poky/meta/classes/relocatable.bbclass7
-rw-r--r--import-layers/yocto-poky/meta/classes/remove-libtool.bbclass11
-rw-r--r--import-layers/yocto-poky/meta/classes/report-error.bbclass95
-rw-r--r--import-layers/yocto-poky/meta/classes/rm_work.bbclass128
-rw-r--r--import-layers/yocto-poky/meta/classes/rootfs-postcommands.bbclass277
-rw-r--r--import-layers/yocto-poky/meta/classes/rootfs_deb.bbclass38
-rw-r--r--import-layers/yocto-poky/meta/classes/rootfs_ipk.bbclass38
-rw-r--r--import-layers/yocto-poky/meta/classes/rootfs_rpm.bbclass46
-rw-r--r--import-layers/yocto-poky/meta/classes/rootfsdebugfiles.bbclass36
-rw-r--r--import-layers/yocto-poky/meta/classes/sanity.bbclass1015
-rw-r--r--import-layers/yocto-poky/meta/classes/scons.bbclass17
-rw-r--r--import-layers/yocto-poky/meta/classes/sdl.bbclass6
-rw-r--r--import-layers/yocto-poky/meta/classes/setuptools.bbclass8
-rw-r--r--import-layers/yocto-poky/meta/classes/setuptools3.bbclass8
-rw-r--r--import-layers/yocto-poky/meta/classes/sign_ipk.bbclass52
-rw-r--r--import-layers/yocto-poky/meta/classes/sign_package_feed.bbclass43
-rw-r--r--import-layers/yocto-poky/meta/classes/sign_rpm.bbclass53
-rw-r--r--import-layers/yocto-poky/meta/classes/sip.bbclass61
-rw-r--r--import-layers/yocto-poky/meta/classes/siteconfig.bbclass33
-rw-r--r--import-layers/yocto-poky/meta/classes/siteinfo.bbclass175
-rw-r--r--import-layers/yocto-poky/meta/classes/spdx.bbclass365
-rw-r--r--import-layers/yocto-poky/meta/classes/sstate.bbclass993
-rw-r--r--import-layers/yocto-poky/meta/classes/staging.bbclass221
-rw-r--r--import-layers/yocto-poky/meta/classes/syslinux.bbclass192
-rw-r--r--import-layers/yocto-poky/meta/classes/systemd.bbclass207
-rw-r--r--import-layers/yocto-poky/meta/classes/terminal.bbclass96
-rw-r--r--import-layers/yocto-poky/meta/classes/testimage-auto.bbclass23
-rw-r--r--import-layers/yocto-poky/meta/classes/testimage.bbclass263
-rw-r--r--import-layers/yocto-poky/meta/classes/testsdk.bbclass142
-rw-r--r--import-layers/yocto-poky/meta/classes/texinfo.bbclass15
-rw-r--r--import-layers/yocto-poky/meta/classes/tinderclient.bbclass368
-rw-r--r--import-layers/yocto-poky/meta/classes/toaster.bbclass397
-rw-r--r--import-layers/yocto-poky/meta/classes/toolchain-scripts.bbclass157
-rw-r--r--import-layers/yocto-poky/meta/classes/typecheck.bbclass12
-rw-r--r--import-layers/yocto-poky/meta/classes/uboot-config.bbclass49
-rw-r--r--import-layers/yocto-poky/meta/classes/uninative.bbclass140
-rw-r--r--import-layers/yocto-poky/meta/classes/update-alternatives.bbclass267
-rw-r--r--import-layers/yocto-poky/meta/classes/update-rc.d.bbclass133
-rw-r--r--import-layers/yocto-poky/meta/classes/upstream-version-is-even.bbclass5
-rw-r--r--import-layers/yocto-poky/meta/classes/useradd-staticids.bbclass302
-rw-r--r--import-layers/yocto-poky/meta/classes/useradd.bbclass252
-rw-r--r--import-layers/yocto-poky/meta/classes/useradd_base.bbclass151
-rw-r--r--import-layers/yocto-poky/meta/classes/utility-tasks.bbclass66
-rw-r--r--import-layers/yocto-poky/meta/classes/utils.bbclass380
-rw-r--r--import-layers/yocto-poky/meta/classes/vala.bbclass24
-rw-r--r--import-layers/yocto-poky/meta/classes/waf.bbclass38
-rw-r--r--import-layers/yocto-poky/meta/conf/abi_version.conf7
-rw-r--r--import-layers/yocto-poky/meta/conf/bitbake.conf820
-rw-r--r--import-layers/yocto-poky/meta/conf/conf-notes.txt7
-rw-r--r--import-layers/yocto-poky/meta/conf/distro/defaultsetup.conf23
-rw-r--r--import-layers/yocto-poky/meta/conf/distro/include/as-needed.inc14
-rw-r--r--import-layers/yocto-poky/meta/conf/distro/include/default-distrovars.inc48
-rw-r--r--import-layers/yocto-poky/meta/conf/distro/include/default-providers.inc56
-rw-r--r--import-layers/yocto-poky/meta/conf/distro/include/default-versions.inc15
-rw-r--r--import-layers/yocto-poky/meta/conf/distro/include/distro_alias.inc464
-rw-r--r--import-layers/yocto-poky/meta/conf/distro/include/no-static-libs.inc35
-rw-r--r--import-layers/yocto-poky/meta/conf/distro/include/package_regex.inc22
-rw-r--r--import-layers/yocto-poky/meta/conf/distro/include/security_flags.inc113
-rw-r--r--import-layers/yocto-poky/meta/conf/distro/include/tclibc-baremetal.inc32
-rw-r--r--import-layers/yocto-poky/meta/conf/distro/include/tclibc-glibc.inc40
-rw-r--r--import-layers/yocto-poky/meta/conf/distro/include/tclibc-musl.inc31
-rw-r--r--import-layers/yocto-poky/meta/conf/distro/include/tclibc-uclibc.inc28
-rw-r--r--import-layers/yocto-poky/meta/conf/distro/include/tcmode-default.inc75
-rw-r--r--import-layers/yocto-poky/meta/conf/distro/include/upstream_tracking.inc24
-rw-r--r--import-layers/yocto-poky/meta/conf/distro/include/world-broken.inc49
-rw-r--r--import-layers/yocto-poky/meta/conf/distro/include/yocto-uninative.inc11
-rw-r--r--import-layers/yocto-poky/meta/conf/documentation.conf460
-rw-r--r--import-layers/yocto-poky/meta/conf/layer.conf61
-rw-r--r--import-layers/yocto-poky/meta/conf/licenses.conf189
-rw-r--r--import-layers/yocto-poky/meta/conf/machine-sdk/i586.conf3
-rw-r--r--import-layers/yocto-poky/meta/conf/machine-sdk/i686.conf2
-rw-r--r--import-layers/yocto-poky/meta/conf/machine-sdk/x86_64.conf1
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/README100
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/arm/README40
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/arm/arch-arm.inc16
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/arm/arch-arm64.inc36
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv4.inc34
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv5-dsp.inc52
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv5.inc57
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv6.inc50
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv7a.inc141
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv7ve.inc141
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv8.inc1
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/arm/feature-arm-neon.inc18
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/arm/feature-arm-thumb.inc33
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/arm/feature-arm-vfp.inc14
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/mips/README36
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/mips/arch-mips.inc102
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/powerpc/README17
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/powerpc/arch-powerpc.inc34
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/powerpc/arch-powerpc64.inc14
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/qemu.inc31
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/sh/README11
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/sh/arch-sh.inc9
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/soc-family.inc3
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-arm1136jf-s.inc11
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-arm920t.inc11
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-arm926ejs.inc11
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-arm9tdmi.inc11
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-atom.inc2
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-c3.inc12
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-core2.inc38
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-corei7.inc39
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa15.inc48
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa17.inc48
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa5.inc36
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa7.inc48
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa8.inc36
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa9.inc51
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-ep9312.inc12
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-i586-nlp.inc19
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-i586.inc14
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-iwmmxt.inc14
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-mips32.inc25
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-mips32r2.inc17
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-mips64.inc3
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-octeon.inc32
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-power5.inc21
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-power6.inc21
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-power7.inc21
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-ppc476.inc14
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-ppc603e.inc14
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-ppc7400.inc14
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-ppce300c2.inc11
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-ppce300c3.inc23
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-ppce500.inc20
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-ppce500mc.inc14
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-ppce500v2.inc20
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-ppce5500.inc20
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-ppce6500.inc21
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-sh3.inc17
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-sh4.inc34
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-strongarm1100.inc11
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-supersparc.inc4
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-thunderx.inc19
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/tune-xscale.inc16
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/x86-base.inc52
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/x86/README24
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/include/x86/arch-x86.inc53
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/qemuarm.conf12
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/qemuarm64.conf10
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/qemumips.conf13
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/qemumips64.conf13
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/qemuppc.conf13
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/qemux86-64.conf29
-rw-r--r--import-layers/yocto-poky/meta/conf/machine/qemux86.conf28
-rw-r--r--import-layers/yocto-poky/meta/conf/migrate_localcount.conf1
-rw-r--r--import-layers/yocto-poky/meta/conf/multilib.conf27
-rw-r--r--import-layers/yocto-poky/meta/conf/prexport.conf1
-rw-r--r--import-layers/yocto-poky/meta/conf/primport.conf1
-rw-r--r--import-layers/yocto-poky/meta/conf/sanity.conf16
-rw-r--r--import-layers/yocto-poky/meta/conf/swabber/Ubuntu-10.04.1-64/blacklist6
-rw-r--r--import-layers/yocto-poky/meta/conf/swabber/Ubuntu-10.04.1-64/filters7
-rw-r--r--import-layers/yocto-poky/meta/conf/swabber/Ubuntu-10.04.1-64/whitelist23
-rw-r--r--import-layers/yocto-poky/meta/conf/swabber/generic/blacklist2
-rw-r--r--import-layers/yocto-poky/meta/conf/swabber/generic/filters10
-rw-r--r--import-layers/yocto-poky/meta/conf/swabber/generic/whitelist15
-rw-r--r--import-layers/yocto-poky/meta/conf/toasterconf.json107
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/AAL51
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/AFL-1.2123
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/AFL-2.048
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/AFL-2.150
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/AFL-3.027
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/AGPL-3.0661
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/ANTLR-PD32
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/APL-1.0218
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/APSL-1.0372
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/APSL-1.1374
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/APSL-1.2105
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/APSL-2.0102
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/Adobe14
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/Apache-1.061
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/Apache-1.160
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/Apache-2.0204
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/Artistic-1.050
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/Artistic-2.0203
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/BSD26
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/BSD-0-Clause12
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/BSD-2-Clause13
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/BSD-3-Clause11
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/BSD-4-Clause29
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/BSL-1.025
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/BitstreamVera160
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CATOSL-1.1116
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CC-BY-1.060
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CC-BY-2.063
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CC-BY-2.563
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CC-BY-3.070
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-1.063
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-2.066
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-2.566
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-3.072
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-ND-1.05
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-ND-2.063
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-ND-2.563
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-ND-3.069
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-SA-1.064
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-SA-2.068
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-SA-2.568
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-SA-3.074
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CC-BY-ND-1.059
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CC-BY-ND-2.062
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CC-BY-ND-2.562
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CC-BY-ND-3.068
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CC-BY-SA-1.063
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CC-BY-SA-2.067
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CC-BY-SA-2.567
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CC-BY-SA-3.074
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CC0-1.032
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CDDL-1.0131
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CECILL-1.0242
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CECILL-2.0243
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CECILL-B247
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CECILL-C241
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CPAL-1.0109
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CPL-1.0215
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/CUA-OPL-1.0471
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/ClArtistic138
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/DSSSL49
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/ECL-1.055
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/ECL-2.099
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/EDL-1.013
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/EFL-1.025
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/EFL-2.012
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/EPL-1.072
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/EUDatagrid29
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/EUPL-1.0184
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/EUPL-1.1204
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/Elfutils-Exception12
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/Entessa20
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/ErlPL-1.1288
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/FSF-Unlimited4
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/Fair11
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/Frameworx-1.069
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/FreeType170
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/GFDL-1.1355
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/GFDL-1.2399
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/GFDL-1.3453
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/GPL-1.0252
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/GPL-2-with-bison-exception7
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/GPL-2.0132
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/GPL-2.0-with-GCC-exception17
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/GPL-2.0-with-OpenSSL-exception285
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/GPL-2.0-with-autoconf-exception6
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/GPL-2.0-with-classpath-exception7
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/GPL-2.0-with-font-exception18
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/GPL-3.0225
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/GPL-3.0-with-GCC-exception27
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/GPL-3.0-with-autoconf-exception28
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/HPND11
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/ICU13
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/IPA95
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/IPL-1.0213
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/ISC10
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/LGPL-2.0342
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/LGPL-2.1176
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/LGPL-3.065
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/LPL-1.0276
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/LPPL-1.0213
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/LPPL-1.1316
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/LPPL-1.2320
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/LPPL-1.3c418
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/Libpng112
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/MIT23
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/MPL-1.0109
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/MPL-1.1185
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/MPL-2.0373
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/MS-PL19
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/MS-RL23
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/MirOS58
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/Motosoto422
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/Multics40
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/NASA-1.379
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/NCSA34
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/NGPL45
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/NPOSL-3.061
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/NTP7
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/Nauman50
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/Nokia423
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/OASIS13
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/OCLC-2.078
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/ODbL-1.0543
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/OFL-1.188
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/OGTSL120
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/OLDAP-2.849
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/OSL-1.0164
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/OSL-2.048
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/OSL-3.027
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/OpenSSL107
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/PD1
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/PHP-3.070
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/ParaTypeFFL-1.344
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/PostgreSQL14
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/Proprietary1
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/Python-2.0192
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/QPL-1.048
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/RHeCos-1401
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/RHeCos-1.1151
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/RPL-1.5546
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/RPSL-1.0182
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/RSCPL193
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/Ruby60
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/SAX-PD33
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/SGI-136
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/SMAIL_GPL164
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/SPL-1.0507
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/Simple-2.027
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/Sleepycat90
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/SugarCRM-1431
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/SugarCRM-1.1.3160
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/UCB26
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/VSL-1.049
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/W3C17
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/WXwindows55
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/Watcom-1.0140
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/XFree86-1.022
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/XFree86-1.118
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/XSL48
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/Xnet27
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/YPL-1.130
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/ZPL-1.128
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/ZPL-2.061
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/ZPL-2.118
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/Zimbra-1.330
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/Zlib21
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/bzip241
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/eCos-2.018
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/gSOAP-1380
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/gSOAP-1.3b157
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/tcl40
-rw-r--r--import-layers/yocto-poky/meta/files/common-licenses/unfs324
-rw-r--r--import-layers/yocto-poky/meta/files/deploydir_readme.txt8
-rw-r--r--import-layers/yocto-poky/meta/files/device_table-minimal.txt35
-rw-r--r--import-layers/yocto-poky/meta/files/ext-sdk-prepare.py103
-rw-r--r--import-layers/yocto-poky/meta/files/fs-perms.txt70
-rw-r--r--import-layers/yocto-poky/meta/files/toolchain-shar-extract.sh227
-rw-r--r--import-layers/yocto-poky/meta/files/toolchain-shar-relocate.sh61
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/__init__.py2
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/buildhistory_analysis.py456
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/cachedpath.py233
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/classextend.py120
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/classutils.py43
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/copy_buildsystem.py217
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/data.py17
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/distro_check.py399
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/gpg_sign.py116
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/license.py217
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/lsb.py88
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/maketype.py99
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/manifest.py345
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/package.py157
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/package_manager.py2061
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/packagedata.py95
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/packagegroup.py36
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/patch.py704
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/path.py243
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/prservice.py126
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/qa.py151
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/recipeutils.py849
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/rootfs.py986
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/sdk.py367
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/sstatesig.py356
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/terminal.py275
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/tests/__init__.py0
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/tests/test_license.py68
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/tests/test_path.py89
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/tests/test_types.py62
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/tests/test_utils.py51
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/types.py153
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/utils.py306
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/__init__.py0
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/controllers/__init__.py3
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/controllers/masterimage.py201
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/controllers/testtargetloader.py70
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/oetest.py447
-rwxr-xr-ximport-layers/yocto-poky/meta/lib/oeqa/runexported.py145
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/__init__.py3
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/_ptest.py125
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/_qemutiny.py9
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/buildcvs.py31
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/buildiptables.py31
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/buildsudoku.py28
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/connman.py31
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/date.py31
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/df.py12
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/files/hellomod.c19
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/files/hellomod_makefile8
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/files/test.c26
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/files/test.cpp3
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/files/test.pl2
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/files/test.py6
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/files/testmakefile5
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/files/testsdkmakefile5
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/gcc.py47
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/kernelmodule.py34
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/ldd.py21
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/logrotate.py28
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/multilib.py42
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/pam.py25
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/parselogs.py277
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/perl.py30
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/ping.py22
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/python.py35
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/rpm.py101
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/scanelf.py28
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/scp.py22
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/skeletoninit.py29
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/smart.py175
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/ssh.py19
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/syslog.py45
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/systemd.py178
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/x32lib.py18
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/runtime/xorg.py16
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/sdk/__init__.py3
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/sdk/buildcvs.py25
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/sdk/buildiptables.py26
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/sdk/buildsudoku.py26
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/sdk/gcc.py36
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/sdk/perl.py28
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/sdk/python.py32
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/sdkext/__init__.py3
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/sdkext/devtool.py32
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/sdkext/files/myapp/Makefile10
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/sdkext/files/myapp/myapp.c9
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/sdkext/sdk_update.py39
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/selftest/__init__.py2
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/selftest/_sstatetests_noauto.py95
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/selftest/_toaster.py320
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/selftest/archiver.py50
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/selftest/base.py205
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/selftest/bblayers.py104
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/selftest/bbtests.py272
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/selftest/buildhistory.py46
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/selftest/buildoptions.py287
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/selftest/devtool.py1190
-rwxr-xr-ximport-layers/yocto-poky/meta/lib/oeqa/selftest/esdk_prepare.py75
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/selftest/imagefeatures.py100
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/selftest/layerappend.py99
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/selftest/lic-checksum.py31
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/selftest/manifest.py165
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/selftest/oescripts.py54
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/selftest/pkgdata.py226
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/selftest/prservice.py132
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/selftest/recipetool.py605
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/selftest/signing.py186
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/selftest/sstate.py53
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/selftest/sstatetests.py461
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/selftest/wic.py278
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/targetcontrol.py242
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/utils/__init__.py38
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/utils/commands.py239
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/utils/decorators.py262
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/utils/dump.py98
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/utils/ftools.py46
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/utils/httpserver.py35
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/utils/logparser.py125
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/utils/network.py8
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/utils/qemurunner.py536
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/utils/qemutinyrunner.py170
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/utils/sshcontrol.py153
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/utils/targetbuild.py137
-rw-r--r--import-layers/yocto-poky/meta/lib/oeqa/utils/testexport.py263
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/acpid/acpid.inc30
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/acpid/acpid/0001-Fix-out-of-source-build.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/acpid/acpid/acpid.service10
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-bsp/acpid/acpid/init31
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/acpid/acpid_2.0.26.bb9
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/alsa-state/alsa-state.bb67
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-bsp/alsa-state/alsa-state/alsa-state-init39
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/alsa-state/alsa-state/asound.conf1
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/alsa-state/alsa-state/asound.state1
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd/apmd.service7
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd/apmd_proxy91
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd/apmd_proxy.conf16
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd/default8
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-bsp/apmd/apmd/init51
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd/legacy.patch133
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd/libtool.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd/linkage.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd/unlinux.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd/wexitcode.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd_3.2.2-15.bb84
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/eee-acpi-scripts/eee-acpi-scripts_git.bb39
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/eee-acpi-scripts/files/policy-funcs8
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/eee-acpi-scripts/files/powerbtn.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/eee-acpi-scripts/files/remove-doc-check.patch60
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-bsp/formfactor/files/config50
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-bsp/formfactor/files/machconfig0
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-bsp/formfactor/files/qemuarm/machconfig10
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-bsp/formfactor/files/qemuarmv6/machconfig10
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-bsp/formfactor/files/qemuarmv7/machconfig10
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-bsp/formfactor/files/qemumips/machconfig10
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-bsp/formfactor/files/qemumips64/machconfig10
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-bsp/formfactor/files/qemuppc/machconfig10
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-bsp/formfactor/files/qemux86-64/machconfig10
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-bsp/formfactor/files/qemux86/machconfig10
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/formfactor/formfactor_0.0.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi/gcc46-compatibility.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi/gnu-efi-Make-setjmp.S-portable-to-ARM.patch50
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi/lib-Makefile-fix-parallel-issue.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi/parallel-make-archives.patch48
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.3.bb46
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/files/0001-Fix-CVE-2015-8370-Grub2-user-pass-vulnerability.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/files/0001-Remove-direct-_llseek-code-and-require-long-filesyst.patch81
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/files/0001-Unset-need_charset_alias-when-building-for-musl.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/files/0001-parse_dhcp_vendor-Add-missing-const-qualifiers.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/files/cfg2
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/files/check-if-liblzma-is-disabled.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/files/fix-endianness-problem.patch44
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/files/fix-issue-with-flex-2.5.37.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/files/fix-texinfo.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub-2.00-add-oe-kernel.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub-2.00-fix-enable_execute_stack-check.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub-2.00-fpmath-sse-387-fix.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub-efi-allow-a-compilation-without-mcmodel-large.patch131
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub-efi-fix-with-glibc-2.20.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub-install.in.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub-no-unused-result.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub2-fix-initrd-size-bug.patch48
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub2-remove-sparc64-setup-from-x86-builds.patch104
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/files/remove-gets.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/autohell.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/grub-support-256byte-inode.patch101
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/grub_fix_for_automake-1.12.patch74
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/no-reorder-functions.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/objcopy-absolute.patch40
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/grub-efi_2.00.bb69
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/grub-git/0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/grub-git/0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/grub/autogen.sh-exclude-pc.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/grub2.inc69
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/grub_0.97.bb35
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/grub_2.00.bb16
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/grub/grub_git.bb52
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/gummiboot/gummiboot/0001-console-Fix-C-syntax-errors-for-function-declaration.patch74
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/gummiboot/gummiboot/fix-objcopy.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/gummiboot/gummiboot_git.bb37
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/hostap/files/COPYING.patch346
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/hostap/files/hostap-fw-load.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/hostap/files/hostap_cs.conf193
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/hostap/files/hostap_cs.conf-upstream191
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/hostap/files/hostap_cs.modalias28
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/hostap/hostap-conf_1.0.bb23
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/hostap/hostap-utils-0.4.7/0001-Define-_u32-__s32-__u16-__s16-__u8-in-terms-of-c99-t.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/hostap/hostap-utils-0.4.7/ldflags.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/hostap/hostap-utils.inc28
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/hostap/hostap-utils_0.4.7.bb5
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/keymaps/files/GPLv2.patch347
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-bsp/keymaps/files/keymap.sh16
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/keymaps/keymaps_1.0.bb50
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/libacpi/files/ldflags.patch41
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/libacpi/files/libacpi_fix_for_x32.patch47
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/libacpi/files/makefile-fix.patch47
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/libacpi/files/use_correct_strip_in_cross_environment.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/libacpi/libacpi_0.2.bb32
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/acdefine.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/autotools.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/gettext.patch21884
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/lrzsz-check-locale.h.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/lrzsz_fix_for_automake-1.12.patch49
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/makefile.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/lrzsz/lrzsz_0.12.20.bb48
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/pciutils/pciutils/configure.patch104
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/pciutils/pciutils/guess-fix.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/pciutils/pciutils/makefile.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/pciutils/pciutils_3.4.1.bb60
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/pcmciautils/pcmciautils-018/lex_sys_types.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/pcmciautils/pcmciautils-018/makefile_fix.patch101
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/pcmciautils/pcmciautils-018/makefile_race.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/pcmciautils/pcmciautils.inc32
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/pcmciautils/pcmciautils_018.bb13
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/pm-utils/pm-utils_1.4.1.bb25
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/COPYING2
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/pointercal0
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/qemuarm/pointercal1
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/qemuarmv6/pointercal1
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/qemuarmv7/pointercal1
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/qemumips/pointercal1
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/qemuppc/pointercalbin0 -> 36 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/qemux86-64/pointercal1
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/qemux86/pointercal1
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal_0.0.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/setserial/setserial/add_stdlib.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/setserial/setserial/ldflags.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/setserial/setserial_2.17.bb29
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2016.03.bb49
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-mkimage_2016.03.bb32
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot.inc289
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot_2016.03.bb10
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/usbinit/usbinit.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/usbinit/usbinit/COPYING.GPL339
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-bsp/usbinit/usbinit/usb-gether23
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/usbutils/usbutils/Fix-NULL-pointer-crash.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/usbutils/usbutils/iconv.patch41
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/usbutils/usbutils/usb-devices-avoid-dependency-on-bash.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/usbutils/usbutils_008.bb25
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/v86d/v86d/Update-x86emu-from-X.org.patch21766
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/v86d/v86d/ar-from-env.patch33
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-bsp/v86d/v86d/fbsetup3
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/v86d/v86d/uvesafb.conf2
-rw-r--r--import-layers/yocto-poky/meta/recipes-bsp/v86d/v86d_0.1.10.bb69
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/avahi/avahi-ui_0.6.32.bb70
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/avahi/avahi.inc161
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/avahi/avahi_0.6.32.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/avahi/files/00avahi-autoipd10
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/avahi/files/99avahi-autoipd10
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/avahi/files/initscript.patch41
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/0001-build-use-pkg-config-to-find-libxml2.patch50
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/0001-gen.c-extend-DIRNAMESIZE-from-256-to-512.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/0001-lib-dns-gen.c-fix-too-long-error.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/CVE-2016-1285.patch154
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/CVE-2016-1286_1.patch79
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/CVE-2016-1286_2.patch314
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/CVE-2016-2088.patch247
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/bind-confgen-build-unix.o-once.patch44
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/bind-ensure-searching-for-json-headers-searches-sysr.patch49
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/bind92
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/conf.patch330
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/dont-test-on-host.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/generate-rndc-key.sh7
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/init.d-add-support-for-read-only-rootfs.patch65
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/make-etc-initd-bind-stop-work.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/mips1-not-support-opcode.diff104
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/named.service22
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/bind/bind_9.10.3-P3.bb109
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5.inc112
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch63
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5/0001-tests-add-a-target-for-building-tests-without-runnin.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5/init68
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5/run-ptest31
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5_5.37.bb55
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-conf.bb36
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-connection.service10
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-setup16
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired.config9
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome/0001-Removed-icon-from-connman-gnome-about-applet.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome/connman-gnome-fix-dbus-interface-name.patch187
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-01.pngbin0 -> 490 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-02.pngbin0 -> 496 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-03.pngbin0 -> 492 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-04.pngbin0 -> 470 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-05.pngbin0 -> 419 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome/null_check_for_ipv4_config.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome_0.7.bb29
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/connman/connman.inc210
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0001-Detect-backtrace-API-availability-before-using-it.patch55
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0001-iptables-Add-missing-function-item-of-xtables-to-mat.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0001-plugin.h-Change-visibility-to-default-for-debug-symb.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0002-resolve-musl-does-not-implement-res_ninit.patch77
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0003-Fix-header-inclusions-for-musl.patch118
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/connman83
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/connman/connman_1.31.bb15
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp.inc127
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/0001-site.h-enable-gentle-shutdown.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/CVE-2015-8605.patch99
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/CVE-2016-2774.patch65
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/define-macro-_PATH_DHCPD_CONF-and-_PATH_DHCLIENT_CON.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/dhclient-script-drop-resolv.conf.dhclient.patch70
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/dhcp-3.0.3-dhclient-dbus.patch86
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/fix-external-bind.patch115
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/fixsepbuild.patch89
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/link-with-lcrypto.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/replace-ifconfig-route.patch176
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/search-for-libxml2.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp_4.3.3.bb15
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/dhcp/files/default-relay12
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/dhcp/files/default-server7
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/dhcp/files/dhclient.conf50
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/dhcp/files/dhcpd.conf108
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/dhcp/files/dhcpd.service15
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/dhcp/files/dhcpd6.service15
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/dhcp/files/dhcrelay.service9
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/dhcp/files/init-relay44
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/dhcp/files/init-server44
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2.inc48
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2/0001-iproute2-de-bash-scripts.patch64
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2/configure-cross.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2/iproute2-4.3.0-musl.patch97
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2/iproute2-fix-building-with-musl.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2_4.4.0.bb14
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/init78
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/ldflags.patch75
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/musl.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/irda-utils/irda-utils_0.9.18.bb51
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/iw/iw/0001-iw-version.sh-don-t-use-git-describe-for-versioning.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/iw/iw/separate-objdir.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/iw/iw_4.3.bb33
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/libnss-mdns/libnss-mdns/0001-check-for-nss.h.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/libnss-mdns/libnss-mdns_0.10.bb40
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap.inc40
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap/aclocal.patch167
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap/libpcap-pkgconfig-support.patch71
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap_1.7.4.bb26
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/mobile-broadband-provider-info/mobile-broadband-provider-info_git.bb12
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/neard/neard/Makefile.am-do-not-ship-version.h.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/neard/neard/Makefile.am-fix-parallel-issue.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/neard/neard/neard.in54
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/neard/neard_0.15.bb60
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/files/bugfix-adjust-statd-service-name.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/files/nfs-utils-debianize-start-statd.patch41
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/libnfsidmap/0001-include-sys-types.h-for-getting-u_-typedefs.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/libnfsidmap/Set_nobody_user_group.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/libnfsidmap/fix-ac-prereq.patch13
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/libnfsidmap_0.25.bb27
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-configure-Allow-to-explicitly-disable-nfsidmap.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-nfs-utils-statd-fix-a-segfault-caused-by-improper-us.patch113
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service11
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service18
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service12
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-sm-notify-res_init.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils.conf35
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon63
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver130
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount8
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.3.bb143
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/ofono/ofono.inc37
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/ofono/ofono/Revert-test-Convert-to-Python-3.patch1270
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/ofono/ofono/ofono42
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/ofono/ofono_1.17.bb11
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/ofono/ofono_git.bb14
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/CVE-2016-1907_2.patch65
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/CVE-2016-1907_3.patch329
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/CVE-2016-1907_upstream_commit.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/add-test-support-for-busybox.patch69
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/init115
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/run-ptest44
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/ssh_config48
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/sshd10
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/sshd.socket10
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/sshd@.service13
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/sshd_config133
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/sshdgenkeys.service22
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/volatiles.99_sshd2
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh_7.1p2.bb161
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl.inc211
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/Makefiles-ptest.patch77
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/configure-musl-target.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/configure-targets.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/crypto_use_bigint_in_x86-64_perl.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian/c_rehash-compat.patch71
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian/ca.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian/debian-targets.patch73
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian/man-dir.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian/man-section.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian/no-rpath.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian/no-symbolic.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian/pic.patch177
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian/version-script.patch4663
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian1.0.2/block_digicert_malaysia.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian1.0.2/block_diginotar.patch68
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian1.0.2/version-script.patch4656
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/engines-install-in-libdir-ssl.patch64
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/find.pl54
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/fix-cipher-des-ede3-cfb1.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/oe-ldflags.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/openssl-1.0.2a-x32-asm.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/openssl-avoid-NULL-pointer-dereference-in-EVP_DigestInit_ex.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/openssl-fix-des.pod-error.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/openssl_fix_for_x32.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/parallel.patch326
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/ptest-deps.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/ptest_makefile_deps.patch248
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/run-ptest2
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/shared-libs.patch41
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl_1.0.2g.bb58
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/portmap/portmap.inc17
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/portmap/portmap/destdir-no-strip.patch46
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-connectivity/portmap/portmap/portmap.init67
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/portmap/portmap/portmap.service10
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/portmap/portmap/tcpd-config.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/portmap/portmap_6.0.bb35
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/ppp-dialin/files/host-peer11
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/ppp-dialin/files/ppp-dialin3
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/ppp-dialin/ppp-dialin_0.1.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/0001-Fix-build-with-musl.patch163
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/0001-ppp-Fix-compilation-errors-in-Makefile.patch75
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/08setupdns12
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/92removedns5
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/cifdefroute.patch292
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/copts.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/fix-CVE-2015-3310.patch30
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/init57
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/ip-down43
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/ip-up44
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/makefile-remove-hard-usr-reference.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/makefile.patch95
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/pap22
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/poff26
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/pon9
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/ppp@.service9
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/ppp_on_boot21
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/pppd-resolv-varrun.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/provider35
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp_2.4.7.bb99
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/resolvconf/resolvconf/99_resolvconf4
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/resolvconf/resolvconf/fix-path-for-busybox.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/resolvconf/resolvconf_1.78.bb67
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/socat/socat/0001-Access-c_ispeed-and-c_ospeed-via-APIs.patch52
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/socat/socat/0001-define-NETDB_INTERNAL-to-1-if-not-available.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/socat/socat/Makefile.in-fix-for-parallel-build.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/socat/socat_1.7.3.1.bb40
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/wireless-tools/wireless-tools/avoid_strip.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/wireless-tools/wireless-tools/ldflags.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/wireless-tools/wireless-tools/man.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/wireless-tools/wireless-tools/remove.ldconfig.call.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/wireless-tools/wireless-tools_30.pre9.bb50
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/99_wpa_supplicant1
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/defconfig552
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa-supplicant.sh85
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa_supplicant.conf690
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa_supplicant.conf-sane7
-rw-r--r--import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.5.bb108
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/base-files/base-files/filesystems8
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/base-files/base-files/fstab11
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/base-files/base-files/host.conf2
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/base-files/base-files/issue0
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/base-files/base-files/issue.net0
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/base-files/base-files/licenses/GPL-2340
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/base-files/base-files/motd0
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/base-files/base-files/nsswitch.conf19
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/base-files/base-files/profile36
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/base-files/base-files/rotation1
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/base-files/base-files/share/dot.bashrc16
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/base-files/base-files/share/dot.profile10
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/base-files/base-files/shells2
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/base-files/base-files/usbd0
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/base-files/base-files_3.0.14.bb180
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/base-passwd/base-passwd/add_shutdown.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/base-passwd/base-passwd/disable-docs.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/base-passwd/base-passwd/input.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/base-passwd/base-passwd/nobash.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/base-passwd/base-passwd/noshadow.patch14
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb108
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/bsd-headers/bsd-headers.bb31
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/bsd-headers/bsd-headers/sys-cdefs.h26
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/bsd-headers/bsd-headers/sys-queue.h846
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/bsd-headers/bsd-headers/sys-tree.h761
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/busybox.inc429
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/busybox/0001-Use-CC-when-linking-instead-of-LD-and-use-CFLAGS-and.patch114
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/busybox/busybox-1.24.1-truncate-open-mode.patch81
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/busybox/busybox-1.24.1-unzip-regression.patch143
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/busybox/busybox-1.24.1-unzip.patch118
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/busybox/busybox-cross-menuconfig.patch71
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch137
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/busybox/defconfig1069
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/busybox/fail_on_no_media.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/busybox/getopts.cfg3
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/busybox/init.cfg3
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/busybox/login-utilities.cfg13
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/busybox/mdev.cfg11
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/busybox/mount-via-label.cfg9
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/busybox/musl.cfg12
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/busybox/recognize_connmand.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/busybox/resize.cfg2
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/busybox/sha1sum.cfg1
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/busybox/sha256sum.cfg1
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/busybox_1.24.1.bb50
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/busybox_git.bb52
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/busybox/files/busybox-cron39
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/busybox/files/busybox-httpd44
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/files/busybox-klogd.service.in8
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/files/busybox-syslog.default25
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/files/busybox-syslog.service.in13
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/busybox/files/busybox-udhcpd43
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/files/default.script4
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/files/find-touchscreen.sh6
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/files/hwclock.sh83
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/files/inetd33
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/files/inetd.conf20
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/files/inittab24
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/busybox/files/mdev19
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/files/mdev-mount.sh63
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/files/mdev.conf42
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/busybox/files/mount.busybox3
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/files/rcK26
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/files/rcS27
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/files/run-ptest7
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/files/runlevel11
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/files/simple.script88
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/files/syslog77
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/files/syslog-startup.conf13
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/busybox/files/syslog.conf1
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/busybox/files/umount.busybox3
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/0001-Cover-the-else-with-__GLIBC__.patch51
-rw-r--r--import-layers/yocto-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--import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/Makevars41
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/codepage.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/compile.patch12
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/configure.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/fix-libconsole-linking.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/kbdrate.patch75
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/lcmessage.m424
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/no-dep-on-libfl.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/nodocs.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/uclibc-fileno.patch49
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools_0.3.2.bb44
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-6.9-cp-i-u.patch120
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-install.patch101
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-texinfo.patch375
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-i18n.patch4051
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-ls-x.patch117
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-overflow.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils_fix_for_automake-1.12.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/fix_for_manpage_building.patch85
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/futimens.patch63
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/gnulib_m4.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/loadavg.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/man-touch.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/0001-Unset-need_charset_alias-when-building-for-musl.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/0001-uname-report-processor-and-hardware-correctly.patch64
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/fix-selinux-flask.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/man-decouple-manpages-from-build.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/remove-usr-local-lib-from-m4.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils_6.9.bb103
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils_8.25.bb134
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/dbus-wait/dbus-wait_git.bb17
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/dbus/dbus-glib.inc39
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/dbus/dbus-glib/no-examples.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/dbus/dbus-glib/test-install-makefile.patch57
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/dbus/dbus-glib_0.106.bb4
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/dbus/dbus-test_1.10.6.bb61
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/dbus/dbus/0001-configure.ac-support-large-file-for-stat64.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/dbus/dbus/clear-guid_from_server-if-send_negotiate_unix_f.patch104
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/dbus/dbus/dbus-1.init123
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/dbus/dbus/os-test.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/dbus/dbus/python-config.patch34
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/dbus/dbus/run-ptest10
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/dbus/dbus/tmpdir.patch44
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/dbus/dbus_1.10.6.bb181
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear.inc103
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/0003-configure.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/0004-fix-2kb-keys.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/0007-dropbear-fix-for-x32-abi.patch140
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/dropbear4
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/dropbear.socket10
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/dropbear@.service12
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/dropbearkey.service13
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/init113
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear_2015.71.bb5
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/expat/expat-2.1.0/autotools.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/expat/expat-2.1.0/expat-CVE-2015-1283.patch62
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/expat/expat.inc22
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/expat/expat_2.1.0.bb5
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/fts/fts.bb45
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/fts/fts/fts-header-correctness.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/fts/fts/fts-uclibc.patch50
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/fts/fts/gcc5.patch1368
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/fts/fts/remove_cdefs.patch69
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/fts/fts/stdint.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/disable_java.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/fix_aclocal_version.patch110
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/fix_gnu_source_circular.patch348
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/gettext-autoconf-lib-link-no-L.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/gettext-vpath.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/hardcode_macro_version.patch51
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/linklib_from_0.17.patch720
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.19.6/add-with-bisonlocaledir.patch58
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.19.6/parallel.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/gettext/gettext-minimal-0.19.4/0001-PATCH-Disable-the-test-to-convert-euc-jp.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/gettext/gettext-minimal-0.19.4/COPYING4
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/gettext/gettext-minimal-0.19.4/Makefile.in.in465
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/gettext/gettext-minimal-0.19.4/aclocal.tgzbin0 -> 39744 bytes
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/gettext/gettext-minimal-0.19.4/config.rpath684
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/gettext/gettext-minimal-0.19.4/remove-potcdate.sin19
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/gettext/gettext-minimal-native_0.19.4.bb32
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/gettext/gettext_0.16.1.bb112
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/gettext/gettext_0.19.6.bb115
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Install-gio-querymodules-as-libexec_PROGRAM.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/0001-configure.ac-Do-not-use-readlink-when-cross-compilin.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/Enable-more-tests-while-cross-compiling.patch81
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/allow-run-media-sdX-drive-mount-if-username-root.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/configure-libtool.patch66
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/fix-conflicting-rand.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/gi-exclude.patch59
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/glib-2.0-configure-readlink.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/glib-gettextize-dir.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/ptest-paths.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/relocate-modules.patch49
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/run-ptest5
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/uclibc_musl_translation.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0_2.46.2.bb26
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib.inc130
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glib-networking/glib-networking_2.46.1.bb29
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/cross-localedef-native/fix_for_centos_5.8.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/cross-localedef-native_2.23.bb58
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc-collateral.inc22
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc-common.inc9
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc-initial.inc78
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc-initial_2.23.bb9
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc-ld.inc57
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc-locale.inc95
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc-locale_2.23.bb1
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc-mtrace.inc13
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc-mtrace_2.23.bb1
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc-package.inc214
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc-scripts.inc16
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc-scripts_2.23.bb1
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc-testing.inc95
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc.inc80
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0001-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch69
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0002-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch50
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch136
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0004-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0005-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch1584
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0006-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0007-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch208
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0008-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch387
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0009-Quote-from-bug-1443-which-explains-what-the-patch-do.patch62
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0010-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch61
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0012-Make-ld-version-output-matching-grok-gold-s-output.patch44
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0013-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0014-Add-unused-attribute.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0015-yes-within-the-path-sets-wrong-config-variables.patch263
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0016-timezone-re-written-tzselect-as-posix-sh.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0017-Remove-bash-dependency-for-nscd-init-script.patch73
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0018-eglibc-Cross-building-and-testing-instructions.patch619
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0019-eglibc-Help-bootstrap-cross-toolchain.patch100
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0020-eglibc-cherry-picked-from.patch66
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0021-eglibc-Clear-cache-lines-on-ppc8xx.patch83
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0022-eglibc-Resolve-__fpscr_values-on-SH4.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0023-eglibc-Install-PIC-archives.patch123
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0025-eglibc-Forward-port-cross-locale-generation-support.patch566
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0026-When-disabling-SSE-make-sure-fpmath-is-not-set-to-us.patch48
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc/etc/ld.so.conf0
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc/generate-supported.mk11
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/glibc_2.23.bb133
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/32and64bit.patch331
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/README8
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/add-64-bit-flag-for-ELF64-entries.patch116
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling.patch454
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling_fix.patch47
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endianess-header.patch113
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/flag_fix.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-default-to-all-multilib-dirs.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2bin0 -> 21491 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig.patch471
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native_2.12.1.bb34
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/site_config/funcs474
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/site_config/headers156
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/glibc/site_config/types21
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/ifupdown/files/99_network1
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/ifupdown/files/defn2-c-man-don-t-rely-on-dpkg-architecture-to-set-a.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/ifupdown/files/inet-6-.defn-fix-inverted-checks-for-loopback.patch103
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/ifupdown/ifupdown_0.8.2.bb51
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Guest_Additions.txt75
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmx46
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmxf8
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/images/build-appliance-image_14.0.0.bb120
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/images/core-image-base.bb8
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/images/core-image-minimal-dev.bb7
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/images/core-image-minimal-initramfs.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/images/core-image-minimal-mtdutils.bb7
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/images/core-image-minimal.bb12
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/copyright11
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/init90
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces31
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot39
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm/interfaces5
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm64/interfaces5
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv6/interfaces5
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv7/interfaces5
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips/interfaces8
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips64/interfaces8
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuppc/interfaces8
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemush4/interfaces8
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86-64/interfaces8
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86/interfaces8
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb41
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-boot.sh10
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh199
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-install-efi.sh255
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-install-testfs.sh220
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-install.sh272
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-live.sh230
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-boot_1.0.bb16
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-framework/debug82
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-framework/e2fs28
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-framework/finish60
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-framework/init145
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-framework/mdev30
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-framework/udev46
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb66
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-live-install-efi-testfs_1.0.bb16
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bb24
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-live-install-testfs_1.0.bb16
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb24
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/GPLv2.patch347
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/arm/alignment.sh13
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/banner.sh24
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh81
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/checkfs.sh50
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh148
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/devpts5
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/devpts.sh28
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh17
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/functions91
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/halt29
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/hostname.sh22
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/logrotate-dmesg.conf9
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/mountall.sh39
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh88
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh232
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh38
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/reboot15
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/rmnologin.sh20
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh13
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/sendsigs21
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/single24
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/sushell5
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh27
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/umountfs24
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/umountnfs.sh33
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/urandom49
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/volatiles36
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts_1.0.bb182
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/kbd/kbd_2.0.3.bb35
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch235
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/libcgroup/libcgroup_0.41.bb43
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/ansidecl.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/configure.ac-fix-cross-compiling-warning.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/libxml-64bit.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/libxml-m4-use-pkgconfig.patch204
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/python-sitepackages-dir.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/run-ptest3
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/runtest.patch820
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/libxml/libxml2_2.9.3.bb74
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/meta/buildtools-tarball.bb72
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/meta/meta-environment-extsdk.bb12
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/meta/meta-environment.bb75
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/meta/meta-ide-support.bb16
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/meta/meta-toolchain.bb9
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/meta/meta-world-pkgdata.bb50
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb27
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/meta/package-index.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/meta/signing-keys.bb77
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/meta/uninative-tarball.bb56
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/musl/musl.inc26
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/musl/musl_git.bb61
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/ncurses/files/config.cache4
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/ncurses/files/tic-hang.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/ncurses/ncurses.inc310
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/ncurses/ncurses_6.0+20160213.bb10
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/ncurses/site_config/headers5
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/netbase/netbase/hosts8
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/netbase/netbase/netbase-add-rpcbind-as-an-alias-to-sunrpc.patch44
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/netbase/netbase_5.3.bb24
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/os-release/os-release.bb48
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb33
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-base.bb369
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-boot.bb47
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb29
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-eclipse-debug.bb10
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-nfs.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb85
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-ssh-dropbear.bb7
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-ssh-openssh.bb7
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bb15
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-tools-debug.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-tools-profile.bb82
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb53
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb200
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/psplash/files/psplash-init29
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/psplash/files/psplash-poky-img.h1259
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/psplash/psplash_git.bb121
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/readline/files/config-dirent-symbols.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/readline/files/inputrc61
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/readline/readline-5.2/configure-fix.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/readline/readline-5.2/fix-redundant-rpath.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/readline/readline-6.3/configure-fix.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/readline/readline-6.3/norpath.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/readline/readline.inc42
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/readline/readline_5.2.bb84
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/readline/readline_6.3.bb34
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/obsolete_automake_macros.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/separatebuild.patch65
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/sysfsutils-2.0.0-class-dup.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/sysfsutils/sysfsutils_2.1.0.bb33
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd-compat-units.bb43
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd-serialgetty.bb51
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service37
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd-systemctl-native.bb17
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/systemd/systemd-systemctl/systemctl195
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd/00-create-volatile.conf7
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0001-core-device.c-Change-the-default-device-timeout-to-2.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0002-units-Prefer-getty-to-agetty-in-console-setup-system.patch44
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0003-define-exp10-if-missing.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0004-Use-getenv-when-secure-versions-are-not-available.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0005-binfmt-Don-t-install-dependency-links-at-install-tim.patch74
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0006-configure-Check-for-additional-features-that-uclibc-.patch48
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0007-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch61
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0008-nspawn-Use-execvpe-only-when-libc-supports-it.patch41
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0009-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0010-implment-systemd-sysv-install-for-OE.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0011-nss-mymachines-Build-conditionally-when-HAVE_MYHOSTN.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0012-rules-whitelist-hd-devices.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0013-sysv-generator-add-support-for-executing-scripts-und.patch133
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0014-Make-root-s-home-directory-configurable.patch184
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0015-systemd-user-avoid-using-system-auth.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0016-Revert-rules-remove-firmware-loading-rules.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0017-Revert-udev-remove-userspace-firmware-loading-suppor.patch361
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0018-make-test-dir-configurable.patch64
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0019-remove-duplicate-include-uchar.h.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0020-check-for-uchar.h-in-configure.patch44
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0021-include-missing.h-for-getting-secure_getenv-definiti.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0022-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0023-build-sys-fix-build-with-libgrcypt-disabled.patch122
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd/init104
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd/run-ptest6
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd/touchscreen.rules18
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/systemd/systemd_229.bb579
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/crypt-lib.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/install.patch83
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/pidof-add-m-option.patch189
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit-inittab/inittab30
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty5
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb86
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit/0001-This-fixes-an-issue-that-clang-reports-about-mutlipl.patch52
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit/01_bootlogd1
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit/bootlogd.init98
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit/rc182
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit/rcS34
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit/rcS-default29
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit/realpath.patch78
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb112
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/uclibc/site_config/funcs474
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/uclibc/site_config/headers156
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/uclibc/site_config/types21
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-config.inc143
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-git.inc17
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-git/0001-Disable-lrount_tes-function.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-git/locale.cfg3
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-git/obstack.cfg1
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-git/uClibc.distro195
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-git/uClibc.machine14
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-initial_git.bb36
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-package.inc36
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc.inc168
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc_git.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/udev/eudev/devfs-udev.rules108
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/udev/eudev/init142
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/udev/eudev/links.conf21
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/udev/eudev/local.rules19
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/udev/eudev/permissions.rules131
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/udev/eudev/run.rules14
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/udev/eudev/udev-cache75
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/udev/eudev/udev-cache.default5
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/udev/eudev/udev.rules116
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/udev/eudev_3.1.5.bb107
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/udev/udev-extraconf/automount.rules19
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/udev/udev-extraconf/autonet.rules19
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/udev/udev-extraconf/localextra.rules23
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/udev/udev-extraconf/mount.blacklist5
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/udev/udev-extraconf/mount.sh90
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/udev/udev-extraconf/network.sh54
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/udev/udev-extraconf_1.1.bb42
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/update-rc.d/update-rc.d/add-verbose.patch49
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/update-rc.d/update-rc.d/check-if-symlinks-are-valid.patch59
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/update-rc.d/update-rc.d/fix-to-handle-priority-numbers-correctly.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/update-rc.d/update-rc.d_0.7.bb31
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux.inc311
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/avoid_unsupported_grep_opts.patch57
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/configure-sbindir.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/ptest.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/run-ptest25
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/runuser-l.pamd3
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/runuser.pamd4
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/util-linux-native.patch57
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/util-linux-ng-2.16-mount_lock_path.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/uuid-test-error-api.patch92
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux_2.27.1.bb36
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/volatile-binds/files/COPYING.MIT17
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-core/volatile-binds/files/mount-copybind34
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/volatile-binds/files/volatile-binds.service.in19
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/volatile-binds/volatile-binds.bb71
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/zlib/site_config/headers1
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.8/Makefile-runtests.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.8/ldflags-tests.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.8/remove.ldconfig.call.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.8/run-ptest2
-rw-r--r--import-layers/yocto-poky/meta/recipes-core/zlib/zlib_1.2.8.bb59
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt-native.inc70
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt-native_1.0.10.1.bb4
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt-package.inc78
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt.inc31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch378
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt/0001-environment.mak-musl-based-systems-can-generate-shar.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt/0001-fix-the-gcc-version-check.patch160
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt/0001-remove-Wsuggest-attribute-from-CFLAGS.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt/disable-configure-in-makefile.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt/disable-test.patch58
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt/fix-gcc-4.6-null-not-defined.patch12
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt/makerace.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt/no-nls-dpkg.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt/noconfigure.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt/nodoc.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt/truncate-filename.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt/use-host.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt_1.0.10.1.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/files/apt.conf42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/files/db_linking_hack.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/files/environment.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/files/no-curl.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf.inc44
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/add_musl_config.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autoreconf-exclude.patch139
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autoreconf-gnuconfigize.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autoreconf-include.patch14
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autotest-automake-result-format.patch136
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/check-automake-cross-warning.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/config_site.patch40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/fix_path_xtra.patch120
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/performance.patch60
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/preferbash.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/program_prefix.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/remove-usr-local-lib-from-m4.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf_2.69.bb27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen-native_5.18.6.bb36
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen/increase-timeout-limit.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen/mk-tpl-config.sh-force-exit-value-to-be-0-in-subproc.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen/redirect-output-dir.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/automake/automake.inc21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/automake/automake/buildtest.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/automake/automake/new_rt_path_for_test-driver.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/automake/automake/performance.patch73
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/automake/automake/python-libdir.patch65
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/automake/automake_1.15.bb35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-2.26.inc42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross-canadian.inc29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross-canadian_2.26.bb3
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross.inc30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross_2.26.bb3
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-crosssdk_2.26.bb13
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils.inc162
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0001-Generate-relocatable-SDKs.patch62
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0002-configure-widen-the-regexp-for-SH-architectures.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0003-Point-scripts-location-to-libdir.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0004-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch41
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0005-Explicitly-link-with-libm-on-uclibc.patch52
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0006-Use-libtool-2.4.patch21295
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0007-Add-the-armv5e-architecture-to-binutils.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0008-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0009-warn-for-uses-of-system-directories-when-cross-linki.patch273
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch52
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0011-Change-default-emulation-for-mips64-linux.patch59
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0012-Add-support-for-Netlogic-XLP.patch413
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0013-Fix-GOT-address-computations-in-initial-PLT-entries-.patch72
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0014-Correct-nios2-_gp-address-computation.patch106
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils_2.26.bb40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/bison/bison/0001-Unset-need_charset_alias-when-building-for-musl.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/bison/bison/0001-src-local.mk-fix-parallel-issue.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/bison/bison/add-with-bisonlocaledir.patch58
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/bison/bison/bison-2.3_m4.patch591
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/bison/bison/dont-depend-on-help2man.patch.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/bison/bison/m4.patch414
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/bison/bison_2.3.bb26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/bison/bison_3.0.4.bb40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/bootchart2/bootchart2/bootchartd_stop.sh18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/bootchart2/bootchart2_0.14.8.bb155
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/btrfs-tools/btrfs-tools/fix-parallel.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/btrfs-tools/btrfs-tools/fix-symlink-creation-multiple-times.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.4.bb34
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/build-compare/build-compare_git.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/build-compare/files/0001-Add-support-for-deb-and-ipk-packaging.patch64
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/build-compare/files/Ignore-DWARF-sections.patch40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/build-compare/files/Rename-rpm-check.sh-to-pkg-diff.sh.patch1599
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/ccache/ccache.inc18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/ccache/ccache_3.2.4.bb10
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/ccache/files/0002-dev.mk.in-fix-file-name-too-long.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/cdrtools/cdrtools-native_3.01.bb26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/chrpath/chrpath/standarddoc.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/chrpath/chrpath_0.16.bb27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake-native_3.4.3.bb16
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake.inc55
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/0001-Add-NIOS2-CPU-support.patch50
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/cmlibarchive-disable-ext2fs.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/environment.d-cmake.sh1
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/qt4-fail-silent.patch77
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/support-oe-qt4-tools-names.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake_3.4.3.bb53
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/desktop-file-utils/desktop-file-utils-native_0.22.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/devel-config/distcc-config.bb23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/devel-config/distcc-config/distcc.sh4
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/devel-config/nfs-export-root.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/devel-config/nfs-export-root/exports1
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/diffstat/diffstat/run-ptest5
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/diffstat/diffstat_1.61.bb32
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/distcc/distcc_3.1.bb74
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/distcc/files/0001-zeroconf-Include-fcntl.h.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/distcc/files/default24
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-devtools/distcc/files/distcc119
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/distcc/files/distcc.service11
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/distcc/files/distccmon-gnome.desktop12
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/distcc/files/separatebuilddir.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dmidecode/dmidecode_3.0.bb23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-dsssl-stylesheets/docbook-dsssl-stylesheets-native_1.79.bb71
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-3.1-native_3.1.bb26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-4.1-native_4.1.bb26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-4.5-native.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-native.inc70
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/files/LICENSE-OASIS16
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-utils/docbook-utils-0.6.14/re.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-utils/docbook-utils-native_0.6.14.bb63
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/LICENSE-OASIS16
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/docbook-xml-update-catalog.xml.patch515
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/docbook-xml.xml68
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4_4.5.bb64
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets/docbook-xsl-stylesheets-no-bashism-in-docbook-xsl-up.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets/docbook-xsl.xml6
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets_1.78.1.bb74
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/0001-Include-fcntl.h-for-getting-loff_t-definition.patch41
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/0001-mkfs.fat-fix-incorrect-int-type.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/alignment_hack.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/dosfstools-msdos_fs-types.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/fix_populated_dosfs_creation.patch489
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/include-linux-types.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/largefile.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-bootcode.patch241
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-dir.patch639
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/msdos_fat12_undefined.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/nofat32_autoselect.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools_2.11.bb34
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools_3.0.28.bb31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg.inc79
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0001-When-running-do_package_write_deb-we-have-trees-of-h.patch71
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0002-Adapt-to-linux-wrs-kernel-version-which-has-characte.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch60
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0004-The-lutimes-function-doesn-t-work-properly-for-all-s.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0005-dpkg-compiler.m4-remove-Wvla.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0006-add-musleabi-to-known-target-tripets.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/add_armeb_triplet_entry.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/arch_pm.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/dpkg-configure.service17
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/fix-abs-redefine.patch40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/glibc2.5-sync_file_range.patch86
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/noman.patch14
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/remove-tar-no-timestamp.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg_1.18.4.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs.inc27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/acinclude.m4135
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/mkdir.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/ptest.patch67
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/quiet-debugfs.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/remove.ldconfig.call.patch44
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/run-ptest11
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/xattr_ordering.patch219
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs_git.bb111
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/arm_backend.diff449
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elf_additions.diff71
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elf_begin.c-CVE-2014-9447-fix.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elfutils-ar-c-fix-num-passed-to-memset.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elfutils-fsize.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/fix-build-gcc-4.8.patch57
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/fix_for_gcc-4.7.patch73
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/hppa_backend.diff801
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/i386_dis.h1657
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/m68k_backend.diff309
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/mips_backend.diff713
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/nm-Fix-size-passed-to-snprintf-for-invalid-sh_name-case.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/redhat-portability.diff756
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/redhat-robustify.diff1709
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/remove-unused.patch154
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/testsuite-ignore-elflint.diff21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/uclibc-support-for-elfutils-0.148.patch91
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/x86_64_dis.h1632
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-Ignore-differences-between-mips-machine-identifiers.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-build-Provide-alternatives-for-glibc-assumptions-hel.patch1163
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-fix-a-stack-usage-warning.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-remove-the-unneed-checking.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch168
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0003-Add-mips-n64-relocation-format-hack.patch226
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/aarch64_uio.patch47
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/arm_backend.diff600
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/fixheadercheck.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/hppa_backend.diff799
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/kfreebsd_path.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/m68k_backend.diff492
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/mips_backend.diff711
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/mips_readelf_w.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/shadow.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/testsuite-ignore-elflint.diff39
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/uclibc-support.patch129
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils/Fix_elf_cvt_gunhash.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils/dso-link-change.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.148.bb90
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.164.bb89
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/expect/expect/0001-configure.in.patch108
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/expect/expect/0001-expect-install-scripts-without-using-the-fixline1-tc.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/expect/expect/0002-tcl.m4.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/expect/expect/01-example-shebang.patch144
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/expect/expect_5.45.bb64
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/fdisk/gptfdisk_1.0.1.bb26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/file/file/0001-Add-P-prompt-into-Usage-info.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/file/file/debian-742262.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/file/file/host-file.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/file/file_5.25.bb47
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/flex/flex/0001-tests-add-a-target-for-building-tests-without-runnin.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/flex/flex/disable-tests.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/flex/flex/do_not_create_pdf_doc.patch17
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-devtools/flex/flex/run-ptest5
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/flex/flex_2.6.0.bb55
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9.inc139
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0002-uclibc-conf.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0003-gcc-uclibc-locale-ctype_touplow_t.patch87
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0004-uclibc-locale.patch2862
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0005-uclibc-locale-no__x.patch257
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0006-uclibc-locale-wchar_fix.patch68
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0007-uclibc-locale-update.patch542
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0008-missing-execinfo_h.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0009-c99-snprintf.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0010-c99-complex-ugly-hack.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0011-index_macro.patch44
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0013-libstdc-namespace.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0014-sh-pr24836.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch47
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0016-gcc-poison-system-directories.patch190
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0017-gcc-poison-dir-extend.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch73
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0019-64-bit-multilib-hack.patch82
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0020-optional-libstdc.patch98
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch59
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0022-COLLECT_GCC_OPTIONS.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch96
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0025-fortran-cross-compile-hack.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0026-libgcc-sjlj-check.patch74
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0027-cpp-honor-sysroot.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0028-MIPS64-Default-to-N64-ABI.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch228
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0030-gcc-Fix-argument-list-too-long-error.patch40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0031-Disable-sdt.patch113
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0032-libtool.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch102
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0040-fix-g++-sysroot.patch40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0041-libtool-avoid-libdir.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0043-cpp.patch40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0044-gengtypes.patch97
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0046-libatomic-deptracking.patch41
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0047-repomembug.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0050-Revert-Use-dbx_reg_number-for-spanning-registers.patch80
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0051-eabispe.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0052-Add-target-hook-to-override-DWARF2-frame-register-si.patch138
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch66
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch61
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0055-dwarf-reg-processing-helper.patch148
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0056-define-default-cfa-register-mapping.patch75
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0057-aarch64-config.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0058-gcc-r212171.patch113
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0059-gcc-PR-rtl-optimization-63348.patch59
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch55
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0061-target-gcc-includedir.patch81
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0062-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0063-nativesdk-gcc-support.patch198
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0064-handle-target-sysroot-multilib.patch88
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0065-gcc-483-universal-initializer-no-warning.patch107
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0066-cxxflags-for-build.patch123
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0067-fix-arm-thumb.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0067-gcc-musl-support.patch267
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0068-musl-dynamic-linker.patch205
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0069-musl-no-fixincludes.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0070-libstdc-musl.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0071-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0072-support-ffile-prefix-map.patch284
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0073-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0074-fdebug-prefix-map-support-to-remap-relative-path.patch51
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3.inc143
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0002-uclibc-conf.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0003-gcc-uclibc-locale-ctype_touplow_t.patch87
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0004-uclibc-locale.patch2862
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0005-uclibc-locale-no__x.patch257
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0006-uclibc-locale-wchar_fix.patch68
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0007-uclibc-locale-update.patch542
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0008-missing-execinfo_h.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0009-c99-snprintf.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0010-gcc-poison-system-directories.patch192
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0011-gcc-poison-dir-extend.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0012-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch73
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0013-64-bit-multilib-hack.patch85
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0014-optional-libstdc.patch101
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0015-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch59
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0016-COLLECT_GCC_OPTIONS.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0017-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch96
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0018-fortran-cross-compile-hack.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0019-libgcc-sjlj-check.patch74
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0020-cpp-honor-sysroot.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0021-MIPS64-Default-to-N64-ABI.patch57
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0022-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch216
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0023-gcc-Fix-argument-list-too-long-error.patch40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0024-Disable-sdt.patch113
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0025-libtool.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0026-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0027-Use-the-multilib-config-files-from-B-instead-of-usin.patch102
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0028-Avoid-using-libdir-from-.la-which-usually-points-to-.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0029-export-CPP.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0030-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch52
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0031-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0032-Ensure-target-gcc-headers-can-be-included.patch98
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0033-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0034-Don-t-search-host-directory-during-relink-if-inst_pr.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0035-Dont-link-the-plugins-with-libgomp-explicitly.patch83
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0036-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0037-aarch64-Add-support-for-musl-ldso.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0038-fix-g-sysroot.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0039-libcc1-fix-libcc1-s-install-path-and-rpath.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0040-handle-sysroot-support-for-nativesdk-gcc.patch213
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0041-Search-target-sysroot-gcc-version-specific-dirs-with.patch102
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0042-Fix-various-_FOR_BUILD-and-related-variables.patch137
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0043-libstdc-Support-musl.patch44
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0044-Adding-mmusl-as-a-musl-libc-specifier-and-the-necess.patch270
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0045-Support-for-arm-linux-musl.patch216
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0046-Get-rid-of-ever-broken-fixincludes-on-musl.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0047-nios2-Define-MUSL_DYNAMIC_LINKER.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0048-ssp_nonshared.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0049-Disable-the-weak-reference-logic-in-gthr.h-for-os-ge.patch78
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0050-powerpc-pass-secure-plt-to-the-linker.patch66
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0051-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0052-nios2-use-ret-with-r31.patch103
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0053-expr.c-PR-target-65358-Avoid-clobbering-partial-argu.patch307
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0054-support-ffile-prefix-map.patch284
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0055-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0056-Enable-libc-provide-ssp-and-gcc_cv_target_dl_iterate.patch85
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0057-unwind-fix-for-musl.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0058-fdebug-prefix-map-support-to-remap-relative-path.patch51
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-common.inc105
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-configure-common.inc122
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-canadian.inc172
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-canadian_4.9.bb5
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-canadian_5.3.bb5
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-initial.inc100
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-initial_4.9.bb2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-initial_5.3.bb2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross.inc197
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross_4.9.bb3
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross_5.3.bb3
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial.inc10
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.9.bb3
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial_5.3.bb3
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk.inc12
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk_4.9.bb2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk_5.3.bb2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-multilib-config.inc235
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-runtime.inc196
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-runtime_4.9.bb3
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-runtime_5.3.bb7
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-sanitizers.inc110
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-sanitizers_4.9.bb2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-sanitizers_5.3.bb2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-shared-source.inc11
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-source.inc32
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-source_4.9.bb4
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-source_5.3.bb4
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-target.inc210
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc_4.9.bb13
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc_5.3.bb15
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-common.inc145
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-initial.inc19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-initial_4.9.bb2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc.inc32
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc_4.9.bb2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc_5.3.bb2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran.inc75
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran_4.9.bb3
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran_5.3.bb3
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-7.10.1.inc9
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-common.inc72
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian.inc42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian_7.10.1.bb3
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross.inc29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross_7.10.1.bb4
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb.inc18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-Use-exported-definitions-of-SIGRTMIN.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-include-sys-types.h-for-mode_t.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-make-man-install-relative-to-DESTDIR.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-mips-linux-nat-Define-_ABIO32-if-not-defined.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-use-asm-sgidefs.h.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0002-Change-order-of-CFLAGS.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0003-Add-support-for-Renesas-SH-sh4-architecture.patch921
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/force-readline-static.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb_7.10.1.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/git/git.inc127
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/git/git_2.7.4.bb11
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config/config-guess-uclibc.patch170
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config/gnu-configize.in267
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config/musl-support.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config/uclibc.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config_20120814.bb41
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config_git.bb40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guile/files/0001-libguile-Check-for-strtol_l-during-configure.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guile/files/0002-Recognize-nios2-as-compilation-target.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guile/files/arm_aarch64.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guile/files/arm_endianness.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guile/files/debian/0002-Mark-Unused-modules-are-removed-gc-test-as-unresolve.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guile/files/debian/0003-Mark-mutex-with-owner-not-retained-threads-test-as-u.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guile/files/guile_2.0.6_fix_sed_error.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guile/files/libguile-Makefile.am-hook.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guile/files/libguile-VM-ASM_MUL-for-ARM-Add-earlyclobber.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guile/files/opensuse/guile-64bit.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guile/files/opensuse/guile-turn-off-gc-test.patch49
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guile/files/remove_strcase_l_funcs.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guile/files/workaround-ice-ssa-corruption.patch60
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guile/guile_2.0.11.bb128
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guilt/files/guilt-bash.patch288
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guilt/guilt-native_git.bb23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/help2man/help2man-native_1.47.3.bb25
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/i2c-tools/files/Module.mk72
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/i2c-tools/i2c-tools_3.1.2.bb33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb36
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-devtools/icecc-create-env/icecc-create-env/icecc-create-env192
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/icon-naming-utils/icon-naming-utils_0.8.90.bb30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool.inc30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/intltool-nowarn.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/noperlcheck.patch40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/perl-522-deprecations.patch55
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/remove-xml-check.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/use-nativeperl.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool_0.51.0.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/json-c/json-c/0001-json_tokener-requires-INF-and-NAN.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/json-c/json-c_0.12.bb29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/kconfig-frontends/kconfig-frontends_3.12.0.0.bb38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool-2.4.6.inc48
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool-cross_2.4.6.bb45
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool-native_2.4.6.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/0001-libtool-Fix-support-for-NIOS2-processor.patch68
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/dont-depend-on-help2man.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/fix-final-rpath.patch50
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/fix-resolve-lt-sysroot.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/fix-rpath.patch65
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/fixinstall.patch102
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/nohardcodepaths.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/norm-rpath.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/prefix.patch98
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/rename-with-sysroot.patch166
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/trailingslash.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/unwind-opt-parsing.patch179
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/use-sysroot-in-libpath.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool_2.4.6.bb27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/nativesdk-libtool_2.4.6.bb31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools-native_0.9.69.bb25
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_dvips_doc.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_sgml2rtf.patch64
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_tex_doc.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_txt_doc.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/m4/m4-1.4.17.inc18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/m4/m4-1.4.9.inc13
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/m4/m4-native_1.4.17.bb13
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/m4/m4.inc10
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/m4/m4/0001-Unset-need_charset_alias-when-building-for-musl.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/m4/m4/ac_config_links.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/m4/m4/fix_for_circular_dependency.patch77
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/m4/m4/remove-gets.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/m4/m4_1.4.17.bb3
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/m4/m4_1.4.9.bb3
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/make/make-3.81/make_fix_for_automake-1.12.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/make/make-3.81/makeinfo.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/make/make-4.1/0001-main.c-main-SV-43434-Handle-NULL-returns-from-ttynam.patch63
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/make/make.inc12
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/make/make_3.81.bb15
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/make/make_4.1.bb14
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/makedevs/makedevs/COPYING.patch346
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/makedevs/makedevs/makedevs.c589
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/makedevs/makedevs_1.0.1.bb26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mkelfimage/mkelfimage/cross-compile.patch71
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mkelfimage/mkelfimage/fix-makefile-to-find-libz.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mkelfimage/mkelfimage_git.bb38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/ac_init_fix.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/avoid-failure-on-symbol-provided-by-application.patch102
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/fix_STT_GNU_IFUNC.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/fix_cross_compile.patch81
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/show-GNU-unique-symbols-as-provided-symbols.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/sysrooted-ldso.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mklibs/mklibs-native_0.1.40.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mmc/mmc-utils_git.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git-2.patch103
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch44
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch137
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils_git.bb46
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/fix-broken-lz.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/mtools-makeinfo.patch65
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/mtools.patch129
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/no-x11.gplv3.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/no-x11.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools_3.9.9.bb53
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools_4.0.18.bb50
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/nasm/nasm_2.11.08.bb30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/fix-regex.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/makefile.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/msggen.pl.patch44
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/no-libtool.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/reautoconf.patch83
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/user-declared-default-constructor.patch92
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-native_1.3.2.bb121
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opensp/opensp-1.5.2/obsolete_automake_macros.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opensp/opensp_1.5.2.bb59
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-opkg-build-re-do-find-ls-code-to-not-fail-on-filenam.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/opkg-build-Exit-when-fail-to-list-files.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch47
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb48
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg-arch-config_1.0.bb35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg-keyrings_1.0.bb48
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-configure.ac-use-pkg-config-for-libsolv.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-libsolv_solver_set_arch_policy-use-correct-logic-dur.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/opkg-configure.service17
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/opkg.conf28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg_0.3.1.bb75
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/orc/orc_0.4.24.bb27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0001-Change-library-name.patch119
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0002-uuid-preserve-m-option-status-in-v-option-handling.patch62
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0003-Fix-whatis-entries.patch58
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0004-fix-data-uuid-from-string.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/install-pc.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/ldflags.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/uuid-libtool.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/uuid-nostrip.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid_1.6.2.bb63
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/packagegroups/packagegroup-core-device-devel.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/patch/patch.inc14
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/patch/patch/0001-Unset-need_charset_alias-when-building-for-musl.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/patch/patch/debian.patch10426
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/patch/patch/global-reject-file.diff203
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/patch/patch/install.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/patch/patch/unified-reject-files.diff307
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/patch/patch_2.5.9.bb12
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/patch/patch_2.7.5.bb15
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/patchelf/patchelf/maxsize.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/patchelf/patchelf_0.8.bb13
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/pax-utils/pax-utils_1.1.5.bb35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/liberror-perl_0.17024.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/liburi-perl_1.60.bb29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/libxml-parser-perl_2.44.bb35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/libxml-perl_0.08.bb27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/libxml-simple-perl_2.22.bb24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl-native_5.22.1.bb127
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl-ptest.inc37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl-rdepends_5.22.1.inc2562
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl.inc10
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/Configure-multilib.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/MM_Unix.pm.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/Makefile.SH.patch375
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/Makefile.patch58
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh1221
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-3238
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-32-be1
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-32-le1
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-6438
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-64-be1
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-64-le1
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/cross-generate_uudmap.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/cpan-missing-site-dirs.diff62
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/cpan_definstalldirs.diff37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/db_file_ver.diff34
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/deprecate-with-apt.diff56
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/doc_info.diff35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/enc2xs_inc.diff70
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/errno_ver.diff35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/extutils_set_libperl_path.diff37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fakeroot.diff42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/find_html2text.diff35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/document_makemaker_ccflags.diff31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/memoize_storable_nstore.diff110
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/net_smtp_docs.diff25
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/perl-Cnn.diff73
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/pod_man_reproducible_date.diff170
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-empty-date.diff51
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-pipe.diff109
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-utc-docs.diff86
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-utc.diff33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/respect_umask.diff153
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/instmodsh_doc.diff27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/ld_run_path.diff24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/libnet_config_path.diff37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/libperl_embed_doc.diff26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/locale-robustness.diff52
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/makemaker-pasthru.diff30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/makemaker_customized.diff42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/mod_paths.diff99
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/no_packlist_perllocal.diff92
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/patchlevel.diff30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/perl5db-x-terminal-emulator.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/perlivp.diff39
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/pod2man-customized.diff23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/prefix_changes.diff118
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/prune_libs.diff38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/regen-skip.diff27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/skip-kfreebsd-crash.diff40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/skip-upstream-git-tests.diff28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/squelch-locale-warnings.diff56
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/writable_site_dirs.diff36
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/dynaloaderhack.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/ext-ODBM_File-hints-linux.pl-link-libgdbm_compat.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/ext-ODBM_File-t-odbm.t-fix-the-path-of-dbmt_common.p.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/fix_bad_rpath.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/generate-sh.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/installperl.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/letgcc-find-errno.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/make_ext.pl-fix-regenerate-makefile-failed-while-cc-.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/native-nopacklist.patch91
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/native-perlinc.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-PathTools-don-t-filter-out-blib-from-INC.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-archlib-exp.patch40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-configpm-switch.patch47
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-configure.sh43
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-dynloader.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-enable-gdbm.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-errno-generation-gcc5.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-moreconfig.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/run-ptest2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/t-run-switches.t-perl5-perl.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/test/dist-threads-t-join.t-adjust-ps-option.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/test/ext-DynaLoader-t-DynaLoader.t-fix-calling-dl_findfil.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl_5.22.1.bb367
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/pkgconfig/pkgconfig/fix-glib-configure-libtool-usage.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/pkgconfig/pkgconfig/pkg-config-native.in7
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb53
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/postinst-intercept/nativesdk-postinst-intercept_1.0.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink/macros.prelink5
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink/prelink.conf18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink/prelink.cron.daily40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink/prelink.default22
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink_git.bb81
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0001-configure-Prune-PIE-flags.patch44
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/fallback-group2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/fallback-passwd1
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/handle-remove-xattr.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/moreretries.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo.inc134
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.6.7.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.7.5.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_git.bb11
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-2.7-manifest.inc288
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-3.5-manifest.inc264
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-async_0.6.2.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-dbus_1.2.0.bb29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-docutils_0.12.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-git_1.0.2.bb26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-gitdb_0.6.4.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging/0001-python-imaging-setup.py-force-paths-for-zlib-freetyp.patch55
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging/allow.to.disable.some.features.patch65
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging/fix-freetype-includes.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging_1.1.7.bb45
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-mako_1.0.3.bb24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch65
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-native/avoid_parallel_make_races_on_pgen.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-native/debug.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-native/multilib.patch235
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-native/nohostlibs.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-native/revert_use_of_sysconfigdata.patch86
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-native/unixccompiler.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-native_2.7.11.bb63
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-nose_1.3.7.bb24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch78
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/aarch64/_numpyconfig.h31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/aarch64/config.h139
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/add-glibc-check.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/arm/config.h21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/arm/numpyconfig.h17
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/armeb/config.h21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/armeb/numpyconfig.h17
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips/_numpyconfig.h31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips/config.h139
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips64/_numpyconfig.h31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips64/config.h139
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips64n32/_numpyconfig.h31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips64n32/config.h139
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mipsel/config.h21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mipsel/numpyconfig.h17
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/powerpc/_numpyconfig.h31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/powerpc/config.h139
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/powerpc64/_numpyconfig.h31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/powerpc64/config.h139
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/remove-build-path-in-comments.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/x86-64/_numpyconfig.h32
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/x86-64/config.h139
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/x86/config.h108
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/x86/numpyconfig.h24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy_1.10.4.bb102
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-pexpect_4.0.1.bb25
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-pycairo_1.10.0.bb41
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-pycurl/no-static-link.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-pycurl_7.21.5.bb33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-pygobject/0001-configure.ac-add-sysroot-path-to-GI_DATADIR-don-t-se.patch41
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-pygobject_3.18.2.bb25
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-pyrex-native_0.9.9.bb5
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-pyrex/pyrex-fix-optimized-mode.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-pyrex_0.9.9.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-scons-native_2.4.1.bb8
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-scons_2.4.1.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-setuptools.inc21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-setuptools_19.4.bb38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-add-for-rpm-ignoresize-check.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-already-installed-message.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-attempt-fix.patch158
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-attempt.patch177
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-cache.py-getPackages-matches-name-version.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-channelsdir.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-improve-error-reporting.patch91
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-recommends.patch381
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-set-noprogress-for-pycurl.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smartpm-rpm5-nodig.patch59
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm_git.bb137
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-smmap_0.9.0.bb23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python.inc32
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch97
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/03-fix-tkinter-detection.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/05-enable-ctypes-cross-build.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/add-md5module-support.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/avoid_parallel_make_races_on_pgen.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/builddir.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/cgi_py.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch57
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch77
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/host_include_contamination.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/multilib.patch296
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/parallel-makeinst-create-bindir.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/python-2.7.3-remove-bsdb-rpath.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/run-ptest5
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/setuptweaks.patch57
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/sitecustomize.py45
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/use_sysroot_ncurses_instead_of_host.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3-native_3.5.1.bb79
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3-pip_8.0.0.bb48
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3-setuptools_19.4.bb37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/000-cross-compile.patch85
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch48
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch92
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/110-enable-zlib.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch88
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/130-readline-setup.patch55
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/150-fix-setupterm.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/cgi_py.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/configure.ac-fix-LIBPL.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/host_include_contamination.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/python-3.3-multilib.patch312
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/python-config.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/python3-setup.py-no-host-headers-libs.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/setup.py-check-cross_compiling-when-get-FLAGS.patch50
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/setup.py-find-libraries-in-staging-dirs.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/setuptweaks.patch57
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/sitecustomize.py37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/sysconfig.py-add-_PYTHON_PROJECT_SRC.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/sysroot-include-headers.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/tweak-MULTIARCH-for-powerpc-linux-gnuspe.patch52
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/unixccompiler.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/use_packed_importlib.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3_3.5.1.bb226
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python_2.7.11.bb173
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/nativesdk-qemu-helper_1.0.bb47
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-helper-native_1.0.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-helper/raw2flash.c370
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-helper/tunctl.c156
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-targets.inc22
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu.inc135
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-1568.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-2197.patch59
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-2198.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/Qemu-Arm-versatilepb-Add-memory-size-checking.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/add-ptest-in-makefile.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/configure-fix-Darwin-target-detection.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/cpus.c-qemu_cpu_kick_thread_debugging.patch76
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/disable-grabs.patch72
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/exclude-some-arm-EABI-obsolete-syscalls.patch93
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/fix-libcap-header-issue-on-some-distro.patch84
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/no-valgrind.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/pathlimit.patch137
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/powerpc_rom.binbin0 -> 4096 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/qemu-enlarge-env-entry-size.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/run-ptest8
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/wacom.patch130
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu_2.5.0.bb24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb50
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt-native.inc18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt-native_0.64.bb2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt.inc64
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/Makefile13
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/aclocal.patch128
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/gnu_patch_test_fix_target.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/install.patch13
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/run-ptest8
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/test.sh1
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt_0.64.bb16
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/remake/remake.inc16
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/remake/remake/version-remake.texi.patch16
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/remake/remake_4.1+dbg-1.1.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-Disable-__sync_add_and_fetch_8-on-nios2.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-define-EM_AARCH64.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-rpm-Fix-build-on-musl.patch294
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch49
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/configure.ac-check-for-both-gpg2-and-gpg.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/dbconvert.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/debugedit-segv.patch100
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/debugedit-valid-file-to-fix-segment-fault.patch65
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/header-include-fix.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/makefile-am-exec-hook.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/no-ldflags-in-pkgconfig.patch14
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/perfile_rpmdeps.sh50
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/popt-disable-auto-stack-protector.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/python-rpm-rpmsense.patch31
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/pythondeps.sh16
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-atomic-ops.patch73
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-autogen-force.patch78
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-autogen.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch136
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-check-rootpath-reasonableness.patch96
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db-reduce.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db5-or-db6.patch174
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db60.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db_buffer_small.patch77
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-debug-platform.patch65
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-disable-auto-stack-protector.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-disable-blaketest.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fileclass.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fix-logio-cp.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fix-lua-tests-compilation-failure.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fix-parseEmbedded.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-gnu-atomic.patch64
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-hardlink-segfault-fix.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-keccak-sse-intrin.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-lib-transaction.c-fix-file-conflicts-for-mips64-N32.patch52
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-libsql-fix.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-log-auto-rm.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-lsb-compatibility.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-lua.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-macros.in-disable-external-key-server.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-macros.patch64
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-mongodb-sasl.patch69
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-no-loopmsg.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-no-perl-urpm.patch47
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-opendb-before-verifyscript-to-avoid-null-point.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-ossp-uuid.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-packageorigin.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-payload-use-hashed-inode.patch126
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-pkgconfigdeps.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-platform-file-fix.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-platform.patch137
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch105
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-py-init.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-python-AddErase.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-python-restore-origin.patch49
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-python-tagname.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-realpath.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-reloc-macros.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-resolvedep.patch40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmdb-grammar.patch124
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmfc.c-fix-for-N32-MIPS64.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmio-headers.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmpgp-popt.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-scriptletexechelper.patch159
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-showrc.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-syck-fix-gram.patch1081
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-tag-generate-endian-conversion-fix.patch50
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-tagname-type.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-tools-mtree-LDFLAGS.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-uuid-include.patch40
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm2cpio39
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmatch.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmdb-more-verbose-error-logging-in-rpmTempFile.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmdeps-oecore.patch194
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmqv.c-check-_gpg_passphrase-before-ask-for-input.patch70
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmqv_cc_b_gone.patch50
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/uclibc-support.patch63
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm_5.4+cvs.bb730
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm_5.4.16.bb740
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpmresolve/rpmresolve.c426
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpmresolve_1.0.bb29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rsync/files/makefile-no-rebuild.patch69
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rsync/files/rsyncd.conf15
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync-2.6.9/rsync-2.6.9-fname-obo.patch71
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync-2.6.9/rsyncd.conf15
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync.inc23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync_2.6.9.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync_3.1.2.bb26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby.inc38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby/extmk.patch13
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby_2.2.2.bb46
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts92
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.init3
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.service16
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts_1.0.bb45
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common-0.6.3/autohell.patch61
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common-0.6.3/license.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common-native_0.6.3.bb71
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common_0.6.3.bb68
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/sgmlspl/sgmlspl-native_git.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/squashfs-tools/squashfs-tools/0001-mksquashfs.c-get-inline-functions-work-with-C99.patch154
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/squashfs-tools/squashfs-tools/fix-compat.patch63
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb39
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-Move-gcc-compat-macros-to-gcc_compat.h.patch176
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-arc-metag-nios2-or1k-tile-fix-build.patch117
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-scm_rights-fd.test-rewrite-without-fork.patch198
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-tests-introduce-libtests.patch306
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-tests-scm_rights.c-use-libtests.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace/Makefile-ptest.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace/disable-git-version-gen.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace/more-robust-test-for-m32-mx32-compile-support.patch46
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-devtools/strace/strace/run-ptest2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace/update-gawk-paths.patch118
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace/use-asm-sgidefs.h.patch51
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace_4.11.bb51
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/0001-Fix-libtool-name-in-configure.ac.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/disable_macos.patch68
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/serf.m4-Regex-modified-to-allow-D-in-paths.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion_1.9.3.bb53
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/swabber/swabber-native_git.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/swig/swig.inc63
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/swig/swig/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch69
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/swig/swig/0001-configure-use-pkg-config-for-pcre-detection.patch64
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/swig/swig_3.0.8.bb8
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0001-linux-syslinux-support-ext2-3-4-device.patch84
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0002-linux-syslinux-implement-open_ext2_fs.patch141
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0003-linux-syslinux-implement-install_to_ext2.patch116
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0004-linux-syslinux-add-ext_file_read-and-ext_file_write.patch91
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0005-linux-syslinux-implement-handle_adv_on_ext.patch127
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0006-linux-syslinux-implement-write_to_ext-and-add-syslin.patch215
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0007-linux-syslinux-implement-ext_construct_sectmap_fs.patch84
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0008-libinstaller-syslinuxext-implement-syslinux_patch_bo.patch427
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0009-linux-syslinux-implement-install_bootblock.patch50
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0010-gcc46-compatibility.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0011-mk-MMD-does-not-take-any-arguments.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/syslinux-fix-parallel-building-issue.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/syslinux-libupload-depend-lib.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/syslinux-remove-clean-script.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux_6.03.bb89
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/0001-canonicalize_file_name-is-specific-to-glibc.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/fix_ranlib.patch14
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/ldflags.patch28
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init75
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service10
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent_git.bb52
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/alter-includedir.patch76
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/fix_issue_with_old_distro_glibc.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/fix_non_native_build_issue.patch64
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/no_packages.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/run-ptest8
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/tcl-add-soname.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/tcl-remove-hardcoded-install-path.patch47
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl_8.6.4.bb102
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/alternate_rpc_ports.patch158
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/fix_compile_warning.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/fix_pid_race_parent_writes_child_pid.patch61
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/relative_max_socket_path_len.patch74
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/rename_fh_cache.patch64
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/tcp_no_delay.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/unfs3_parallel_build.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3_0.9.22.r497.bb38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/unifdef/unifdef_2.11.bb17
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/vala/vala.inc51
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/vala/vala/0001-git-version-gen-don-t-append-dirty-if-we-re-not-in-g.patch55
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/vala/vala/0001-vapigen.m4-use-PKG_CONFIG_SYSROOT_DIR.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/vala/vala_0.30.1.bb8
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0001-Remove-tests-that-fail-to-build-on-some-PPC32-config.patch51
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0001-fix-build-for-musl-targets.patch69
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0002-remove-rpath.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0004-Fix-out-of-tree-builds.patch175
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch252
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/11_mips-link-tool.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch96
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/avoid-neon-for-targets-which-don-t-support-it.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/fixed-perl-path.patch53
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/run-ptest12
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch44
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind_3.11.0.bb118
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/xmlto/files/catalog.xml19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/xmlto/xmlto-0.0.28/configure.in-drop-the-test-of-xmllint-and-xsltproc.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/xmlto/xmlto_0.0.28.bb38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/yasm/yasm_1.3.0.bb14
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/zisofs-tools/zisofs-tools-native_1.0.8.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/at/at/0001-remove-glibc-assumption.patch57
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/at/at/atd.init45
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/at/at/atd.service9
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/at/at/configure-add-enable-pam.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/at/at/configure-fix-with-without-selinux.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/at/at/file_replacement_with_gplv2.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/at/at/fix_parallel_build_error.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/at/at/makefile-fix-parallel.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/at/at/pam.conf.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/at/at/posixtm.c328
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/at/at/posixtm.h37
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/at/at_3.1.18.bb70
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/augeas/augeas.inc30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/augeas/augeas/0001-Unset-need_charset_alias-when-building-for-musl.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/augeas/augeas/add-missing-argz-conditional.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/augeas/augeas/sepbuildfix.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/augeas/augeas_1.4.0.bb4
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/build-tests.patch44
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/dont-include-target-CFLAGS-in-host-LDFLAGS.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/mkbuiltins_have_stringize.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/run-ptest2
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/test-output.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash.inc65
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash/build-tests.patch55
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash/execute_cmd.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash/fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch169
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash/run-ptest2
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash/test-output.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash_3.2.48.bb46
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash_4.3.30.bb47
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bc/bc_1.06.bb26
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bc/files/fix-segment-fault.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/blktool/blktool/0001-fix-typos-in-manpage.patch40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/blktool/blktool/0002-fix-string-error.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/blktool/blktool/0003-Fix-3-d-argument-for-BLKROSET-it-must-be-const-int.patch78
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/blktool/blktool_4-7.bb27
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/byacc/byacc.inc21
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/byacc/byacc/byacc-open.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/byacc/byacc_20150711.bb11
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2-1.0.6/Makefile.am72
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2-1.0.6/configure.ac11
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2-1.0.6/fix-bunzip2-qt-returns-0-for-corrupt-archives.patch55
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2-1.0.6/run-ptest2
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2_1.0.6.bb43
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/chkconfig/chkconfig-alternatives-native_1.3.59.bb44
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/chkconfig/chkconfig/replace_caddr_t.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/chkconfig/chkconfig_1.3.58.bb67
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.12/0001-Fix-CVE-2015-1197.patch178
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.12/0001-Unset-need_charset_alias-when-building-for-musl.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/avoid_heap_overflow.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/fix-memory-overrun.patch217
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/m4extensions.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/statdef.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_2.12.bb12
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_2.8.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_v2.inc41
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cracklib/cracklib/0001-packlib.c-support-dictionary-byte-order-dependent.patch339
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cracklib/cracklib/0002-craklib-fix-testnum-and-teststr-failed.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cracklib/cracklib_2.9.5.bb47
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-extended/cronie/cronie/crond.init58
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cronie/cronie/crond.service11
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cronie/cronie/crond_pam_config.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cronie/cronie/crontab14
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cronie/cronie_1.5.0.bb81
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cups/cups.inc116
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cups/cups/0001-don-t-try-to-run-generated-binaries.patch69
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cups/cups/cups_serverbin.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cups/cups/use_echo_only_in_init.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cups/cups_2.1.3.bb6
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cwautomacros/cwautomacros_20110201.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-2.8.1/diffutils_fix_for_automake-1.12.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-3.3/0001-Unset-need_charset_alias-when-building-for-musl.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-3.3/run-ptest3
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils.inc18
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils_2.8.1.bb16
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils_3.3.bb37
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ed/ed_0.5.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ed/ed_1.9.bb33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ethtool/ethtool/avoid_parallel_tests.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ethtool/ethtool/run-ptest2
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ethtool/ethtool_4.2.bb30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/findutils-fix-doc-build-error.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/findutils_fix_for_automake-1.12.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/gnulib-extension.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/findutils/findutils.inc23
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/findutils/findutils/0001-Unset-need_charset_alias-when-building-for-musl.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/findutils/findutils_4.2.31.bb14
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/findutils/findutils_4.6.0.bb17
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/foomatic/foomatic-filters_4.0.17.bb39
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/gawk/gawk-3.1.5/gawk-3.1.5_fix_for_automake-1.12.patch41
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/gawk/gawk-4.1.3/run-ptest10
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/gawk/gawk_3.1.5.bb41
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/gawk/gawk_4.1.3.bb46
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/files/0001-Bug-696497-Fix-support-for-building-with-no-jbig2-de.patch81
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/files/0002-Bug-696497-part-2-fix-support-for-building-with-a-JP.patch48
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/files/do-not-check-local-libpng-source.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/aarch64/objarch.h40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/arm/objarch.h40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/armeb/objarch.h40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/base-genht.c-add-a-preprocessor-define-to-allow-fope.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/cups-no-gcrypt.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-genarch.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-prevent_recompiling.patch100
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.15-parallel-make.patch40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.16-Werror-return-type.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-native-fix-disable-system-libtiff.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/i586/objarch.h41
l---------import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/i6861
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/microblazeeb/objarch.h40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/microblazeel/objarch.h40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips/objarch.h40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64/objarch.h40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64el/objarch.h40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64eln32/objarch.h40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64n32/objarch.h40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mipsel/objarch.h40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/nios2/objarch.h40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/png_mak.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/powerpc/objarch.h40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/powerpc64/objarch.h40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/x86-64/objarch.h40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript_9.18.bb107
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/gperf/gperf.inc22
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/gperf/gperf_3.0.3.bb10
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/gperf/gperf_3.0.4.bb5
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/Makevars25
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/fix-for-texinfo-5.1.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/fix64-int-to-pointer.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/gettext.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep-CVE-2012-5667.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep-egrep-fgrep-Fix-LSB-NG-cases.patch1342
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep_fix_for_automake-1.12.patch52
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/uclibc-fix.patch55
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/grep/grep/0001-Unset-need_charset_alias-when-building-for-musl.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/grep/grep_2.23.bb43
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/grep/grep_2.5.1a.bb56
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/groff-1.18.1.4-fix-bindir.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/groff-1.18.1.4-remove-mom.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/man-local.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/mdoc-local.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.22.3/0001-Unset-need_charset_alias-when-building-for-musl.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.22.3/groff-1.22.2-correct-man.local-install-path.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/groff/groff_1.18.1.4.bb49
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/groff/groff_1.22.3.bb70
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/gzip/gzip-1.3.12/dup-def-fix.patch48
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/gzip/gzip-1.3.12/m4-extensions-fix.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/gzip/gzip-1.6/wrong-path-fix.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/gzip/gzip.inc38
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/gzip/gzip_1.3.12.bb15
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/gzip/gzip_1.6.bb17
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/hdparm/hdparm_9.48.bb36
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/images/core-image-full-cmdline.bb12
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/images/core-image-kernel-dev.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/images/core-image-lsb-dev.bb7
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/images/core-image-lsb-sdk.bb9
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/images/core-image-lsb.bb14
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/images/core-image-testmaster-initramfs.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/images/core-image-testmaster.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0001-configure-Add-option-to-enable-disable-libnfnetlink.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0001-fix-build-with-musl.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/types.h-add-defines-that-are-required-for-if_packet.patch49
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/iptables/iptables_1.6.0.bb50
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/iputils/files/0001-Fix-header-inclusion-for-musl.patch92
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/iputils/files/0001-Intialize-struct-elements-by-name.patch52
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/iputils/files/debian/targets.diff15
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/iputils/files/debian/use_gethostbyname2.diff31
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/iputils/files/nsgmls-path-fix.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/iputils/iputils_s20151218.bb76
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/less/less_481.bb42
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/00_arches.patch607
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/destdir.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/generic-arch-dectection-for-padding-defines.patch65
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/libaio_fix_for_mips_syscalls.patch62
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/libaio_fix_for_x32.patch61
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/system-linkage.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libaio/libaio_0.3.110.bb24
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/0001-Set-xattrs-after-setting-times.patch59
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/libarchive-CVE-2013-0211.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/libarchive-CVE-2015-2304.patch152
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/mkdir.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/pkgconfig.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive_3.1.2.bb71
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libidn/libidn/avoid_AM_PROG_MKDIR_P_warning_error_with_automake_1.12.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libidn/libidn/dont-depend-on-help2man.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libidn/libidn/libidn_fix_for_automake-1.12.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libidn/libidn_0.6.14.bb36
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libidn/libidn_1.32.bb37
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libsolv/libsolv/0001-CMakeLists.txt-fix-MAN_INSTALL_DIR.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libsolv/libsolv_git.bb30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/0001-Add-missing-rwlock_unlocks-in-xprt_register.patch62
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/Use-netbsd-queue.h.patch878
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/libtirpc-0.2.1-fortify.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/remove-des-functionality.patch144
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc_1.0.1.bb40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libuser/libuser/0001-Check-for-issetugid.patch62
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libuser/libuser/0002-remove-unused-execinfo.h.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libuser/libuser_0.62.bb31
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/index.html.lighttpd1
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd34
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd.conf331
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd.service12
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/pkgconfig.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd_1.4.39.bb76
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch147
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate/update-the-manual.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate_3.9.1.bb63
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-extended/lsb/lsb/init-functions44
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-extended/lsb/lsb/lsb_killproc6
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-extended/lsb/lsb/lsb_log_message27
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-extended/lsb/lsb/lsb_pidofproc6
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-extended/lsb/lsb/lsb_start_daemon45
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/lsb/lsb_4.1.bb132
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/lsb/lsbinitscripts/0001-functions-avoid-exit-1-which-causes-init-scripts-to-.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/lsb/lsbinitscripts/functions.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/lsb/lsbinitscripts_9.64.bb33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest/LSB_Test.sh526
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest/packages_list50
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest/session194
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest_1.0.bb49
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/lsof/lsof_4.89.bb60
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0001-ltp-Don-t-link-against-libfl.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0002-Add-knob-to-control-whether-numa-support-should-be-c.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0003-Add-knob-to-control-tirpc-support.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch147
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0006-sendfile-Use-off64_t-instead-of-__off64_t.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0007-replace-SIGCLD-with-SIGCHLD.patch394
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch285
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0009-Guard-error.h-with-__GLIBC__.patch270
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch73
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0011-Rename-sigset-variable-to-sigset1.patch136
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0012-fsstress.c-Replace-__int64_t-with-int64_t.patch351
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0013-include-fcntl.h-for-getting-O_-definitions.patch67
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0014-hyperthreading-Include-sys-types.h-for-pid_t-definit.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0015-mincore01-Rename-PAGESIZE-to-pagesize.patch64
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0016-ustat-Change-header-from-ustat.h-to-sys-ustat.h.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0017-replace-sigval_t-with-union-sigval.patch88
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0018-guard-mallocopt-with-__GLIBC__.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0019-tomoyo-Replace-canonicalize_file_name-with-realpath.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch48
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch71
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0022-include-sys-types.h.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch48
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch68
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0025-mc_gethost-include-sys-types.h.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0026-crash01-Define-_GNU_SOURCE.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0029-trace_shed-Fix-build-with-musl.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0031-vma03-fix-page-size-offset-as-per-page-size-alignmen.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0032-regen.sh-Include-asm-unistd.h-explicitly.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0033-shmat1-Cover-GNU-specific-code-under-__USE_GNU.patch41
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0034-periodic_output.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp_20160126.bb109
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mailx/files/0001-Don-t-reuse-weak-symbol-optopt-to-fix-FTBFS-on-mips.patch59
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mailx/files/0002-Patched-out-SSL2-support-since-it-is-no-longer-suppo.patch41
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mailx/files/0003-Fixed-Lintian-warning-warning-macro-N-not-defined.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mailx/files/0011-outof-Introduce-expandaddr-flag.patch71
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mailx/files/0012-unpack-Disable-option-processing-for-email-addresses.patch79
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mailx/files/0013-fio.c-Unconditionally-require-wordexp-support.patch113
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mailx/files/0014-globname-Invoke-wordexp-with-WRDE_NOCMD.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mailx/files/0015-usr-sbin-sendmail.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mailx/files/explicitly.disable.krb5.support.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mailx/mailx_12.5-5.bb52
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man-pages/man-pages_4.04.bb31
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/configure_sed.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5g-nonrootbuild.patch16
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5h1-gencat.patch14
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5h1-make.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5i2-initial.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5i2-newline.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5i2-overflow.patch16
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5j-i18n.patch16
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5j-nocache.patch16
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5j-utf8.patch61
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5k-confpath.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5k-nonascii.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5k-sofix.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-bug11621.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-buildroot.patch52
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-no-color-for-printing.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-sigpipe.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-i18n_whatis.patch145
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-mandirs.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-new_sections.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-ro_usr.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-security.patch62
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-use_i18n_vars_in_a_std_way.patch160
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-whatis2.patch59
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-compile-warnings.patch105
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-configure.patch68
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-parallel.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-whatis3.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man.1.gzbin0 -> 12323 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man.7.gzbin0 -> 6192 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man.conf141
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/manpath.5.gzbin0 -> 2133 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man_1.6g.bb86
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mc/mc/mc-CTRL.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mc/mc_4.7.5.2.bb47
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mc/mc_4.8.15.bb49
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-some-type-comparison-problems.patch50
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-typo-in-comparision.patch86
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-mdadm.h-bswap-is-already-defined-in-uclibc.patch55
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-util.c-include-poll.h-instead-of-sys-poll.h.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/files/gcc-4.9.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-3.2.2_fix_for_x32.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/files/run-ptest10
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/mdadm_3.4.bb75
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mingetty/mingetty_1.08.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/minicom/minicom/0001-Fix-build-issus-surfaced-due-to-musl.patch47
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/minicom/minicom/0001-fix-minicom-h-v-return-value-is-not-0.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/minicom/minicom/allow.to.disable.lockdev.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/minicom/minicom_2.7.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mktemp/files/disable-strip.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mktemp/files/fix-parallel-make.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mktemp/mktemp_1.7.bb34
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/msmtp/msmtp_1.6.3.bb30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/musl-fixes.patch100
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp1.patch638
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp2-quiet.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp3-addrs.patch363
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-config.h75
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-config.make36
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools_1.60-26.bb109
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/newt/files/Makefile.in-Add-tinfo-library-to-the-linking-librari.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/newt/files/cross_ar.patch58
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/newt/files/fix_SHAREDDIR.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/newt/files/pie-flags.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/newt/files/remove_slang_include.patch16
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/newt/libnewt-python_0.52.18.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/newt/libnewt_0.52.18.bb59
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/packagegroups/packagegroup-core-full-cmdline.bb162
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb283
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/0001-Add-support-for-defining-missing-funcitonality.patch68
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/99_pam1
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/crypt_configure.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/fixsepbuild.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/include_paths_header.patch59
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/libpam-xtests-remove-bash-dependency.patch226
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/libpam-xtests.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam-no-innetgr.patch97
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam-security-abstract-securetty-handling.patch200
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam-unix-nullok-secure.patch240
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-account25
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-auth18
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-password26
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-session19
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-session-noninteractive19
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/other24
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/use-utmpx.patch233
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam_1.2.1.bb171
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/parted/files/0001-Include-fcntl.h-in-platform_defs.h.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/parted/files/0001-Unset-need_charset_alias-when-building-for-musl.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/parted/files/Makefile285
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/parted/files/fix-compile-failure-while-dis.patch57
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/parted/files/fix-doc-mandir.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/parted/files/no_check.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/parted/files/run-ptest3
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/parted/files/syscalls.patch55
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/parted/parted_3.2.bb47
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pax/pax/0001-Fix-build-with-musl.patch1287
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pax/pax/0001-use-strtoll-instead-of-strtoq.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pax/pax/fix_for_compile_with_gcc-4.6.0.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pax/pax/pax-3.4_fix_for_x32.patch185
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pax/pax_3.4.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pbzip2/pbzip2_1.1.13.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/perl/libconvert-asn1-perl_0.27.bb17
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/perl/libtimedate-perl_2.30.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/perl/libxml-namespacesupport-perl_1.11.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/perl/libxml-sax-base-perl_1.08.bb23
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/perl/libxml-sax-perl_0.99.bb27
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pigz/pigz.inc41
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pigz/pigz/link-order.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pigz/pigz_2.3.3.bb12
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pixz/pixz/0001-configure-Detect-headers-before-using-them.patch51
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pixz/pixz/0002-endian-Use-macro-bswap_64-instead-of-__bswap_64.patch47
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pixz/pixz/936d8068ae19d95260d3058f41dd6cf718101cd6.patch68
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pixz/pixz_1.0.6.bb24
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/procps/procps/sysctl.conf64
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/procps/procps_3.3.11.bb66
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/psmisc/files/0001-Typo-in-fuser-makes-M-on-all-the-time.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/psmisc/files/0002-Include-limits.h-for-PATH_MAX.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/psmisc/psmisc.inc44
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/psmisc/psmisc/0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch51
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/psmisc/psmisc_22.21.bb12
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/quota/quota/0001-Do-not-accidentaly-override-commandline-passed-CFLAG.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/quota/quota/0001-Fix-build-with-disabled-ldap.patch93
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/quota/quota/fcntl.patch113
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/quota/quota/remove_non_posix_types.patch198
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/quota/quota/replace_getrpcbynumber_r.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/quota/quota_4.03.bb38
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/0001-Avoid-use-of-glibc-sys-cdefs.h-header.patch221
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/0001-handle_reply-Don-t-use-the-xp_auth-pointer-directly.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/cve-2015-7236.patch84
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/init.d87
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/musl-sunrpc.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/remove-sys-queue.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.conf3
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.service12
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.socket8
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind_0.2.3.bb73
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/screen/screen/0001-Fix-stack-overflow-due-to-too-deep-recursion.patch58
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/screen/screen/0001-fix-for-multijob-build.patch58
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/screen/screen/0002-comm.h-now-depends-on-term.h.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/screen/screen/Avoid-mis-identifying-systems-as-SVR4.patch57
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/screen/screen/Provide-cross-compile-alternatives-for-AC_TRY_RUN.patch137
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/screen/screen/Remove-redundant-compiler-sanity-checks.patch65
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/screen/screen/Skip-host-file-system-checks-when-cross-compiling.patch135
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/screen/screen/fix-parallel-make.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/screen/screen/screen.pam2
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/screen/screen_4.3.1.bb53
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/Makevars25
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/fix_return_type.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/sed-4.1.2_fix_for_automake-1.12.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.2.2/0001-Unset-need_charset_alias-when-building-for-musl.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.2.2/run-ptest3
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.2.2/sed-add-ptest.patch66
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sed/sed_4.1.2.bb35
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sed/sed_4.2.2.bb46
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-Disable-use-of-syslog-for-sysroot.patch124
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-Do-not-read-login.defs-before-doing-chroot.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch109
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/allow-for-setting-password-in-clear-text.patch201
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/check_size_of_uid_t_and_gid_t_using_AC_CHECK_SIZEOF.patch41
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/fix-installation-failure-with-subids-disabled.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/login.defs_shadow-sysroot386
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/login_defs_pam.sed32
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/chfn14
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/chpasswd4
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/chsh19
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/login81
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/newusers4
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/passwd5
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/su57
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/securetty238
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/shadow-4.1.3-dots-in-usernames.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/shadow-update-pam-conf.patch91
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/usermod-fix-compilation-failure-with-subids-disabled.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/shadow-securetty_4.2.1.bb38
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/shadow-sysroot_4.2.1.bb34
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/shadow.inc196
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/shadow_4.2.1.bb10
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/slang/slang/0001-Fix-error-conflicting-types-for-posix_close.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/slang/slang/change-char-type-to-signed-char-in-macros.patch218
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/slang/slang/fix-check-pcre.patch108
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/slang/slang/rpathfix.patch70
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/slang/slang/slang-fix-the-iconv-existence-checking.patch116
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/slang/slang/sprintf-bug-concerning-8-bit-characters.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/slang/slang_2.2.4.bb54
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/stat/stat-3.3/fix-error-return.patch16
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/stat/stat_3.3.bb33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/stress/files/texinfo.patch79
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/stress/stress_1.0.4.bb15
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sudo/files/sudo.pam6
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sudo/sudo.inc40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sudo/sudo/0001-Include-sys-types.h-for-id_t-definition.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sudo/sudo_1.8.15.bb36
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/0001-Fix-build-with-musl.patch132
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/no-strip-install.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/no-vectorization.patch20
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-extended/sysklogd/files/sysklogd151
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/syslog.conf71
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sysklogd/sysklogd.inc66
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sysklogd/sysklogd_1.5.1.bb4
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat.inc57
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat/0001-Include-needed-headers-explicitly.patch62
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat/99_sysstat1
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat/sysstat.service12
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat_11.2.0.bb8
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/avoid_heap_overflow.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/gcc43build.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/m4extensions.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tar/tar.inc52
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tar/tar/musl_dirent.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tar/tar/remove-gets.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tar/tar_1.17.bb14
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tar/tar_1.28.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/00_man_quoting.diff77
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/01_man_portability.patch250
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/05_wildcard_matching.patch105
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/06_fix_gethostbyname.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/10_usagi-ipv6.patch1255
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_tcpd_blacklist.patch153
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_usagi_fix.patch47
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/12_makefile_config.patch83
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/13_shlib_weaksym.patch255
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/14_cidr_support.patch68
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/15_match_clarify.patch14
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/expand_remote_port.patch73
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/have_strerror.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/ldflags.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/makefile-fix-parallel.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/man_fromhost.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/musl-decls.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rename_strings_variable.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/restore_sigalarm.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rfc931.diff41
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.834
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/sig_fix.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/siglongjmp.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/socklen_t.patch59
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/tcpdchk_libwrapped.patch41
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/try-from.828
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb132
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/texi2html/texi2html_5.0.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy-native.bb30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/COPYING19
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/template.py122
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/check-locale-h.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/do-compile-native-tools.patch49
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/using-native-makeinfo.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/0001-Unset-need_charset_alias-when-building-for-musl.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/disable-native-tools.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/dont-depend-on-help2man.patch64
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/link-zip.patch16
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/texinfo-4.12-zlib.patch233
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/use_host_makedoc.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo_4.8.bb55
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo_6.0.bb82
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/time/time-1.7/debian.patch1301
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/time/time.inc12
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/time/time_1.7.bb11
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tzcode/tzcode-native_2016c.bb25
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tzdata/tzdata_2016c.bb212
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/06-unzip60-alt-iconv-utf8_CVE-2015-1315.patch403
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/09-cve-2014-8139-crc-overflow.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/10-cve-2014-8140-test-compr-eb.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/11-cve-2014-8141-getzip64data.patch145
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/CVE-2015-7696.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/CVE-2015-7697.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/avoid-strip.patch50
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/cve-2014-9636.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/define-ldflags.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/unzip/unzip_6.0.bb57
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/0001-Fix-build-issues-found-with-non-glibc-C-libraries.patch99
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/fix-ping-failure.patch79
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/fixsepbuild.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/watchdog-conf.patch14
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/watchdog-init.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog_5.14.bb40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/wget/wget.inc29
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/wget/wget/0001-Unset-need_charset_alias-when-building-for-musl.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/wget/wget_1.17.1.bb8
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/which/which-2.18/automake-foreign.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/which/which-2.18/fix_name_conflict_group_member.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/which/which-2.21/automake.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/which/which_2.18.bb34
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/which/which_2.21.bb32
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/xdg-utils/xdg-utils/0001-Don-t-build-the-in-script-manual.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/xdg-utils/xdg-utils/0001-Reinstate-xdg-terminal.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/xdg-utils/xdg-utils_1.1.1.bb36
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/0001-configure-Use-HAVE_SYS_RESOURCE_H-to-guard-sys-resou.patch100
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/Disable-services-from-inetd.conf-if-a-service-with-t.patch86
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/Various-fixes-from-the-previous-maintainer.patch79
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd-CVE-2013-4342.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd-should-be-able-to-listen-on-IPv6-even-in-ine.patch112
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd.conf11
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd.default12
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd.init64
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd.service13
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd_2.3.15.bb77
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/xz/xz_5.2.2.bb36
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/zip/zip.inc26
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/zip/zip_3.0.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/epiphany/epiphany_3.18.4.bb26
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/epiphany/files/0001-yelp.m4-drop-the-check-for-itstool.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gcr/gcr_3.18.0.bb41
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/extending-libinstall-dependencies.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/fatal-loader.patch79
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/hardcoded_libtool.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/run-ptest3
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.32.3.bb102
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gnome-desktop/gnome-desktop3_3.18.2.bb24
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gnome/adwaita-icon-theme_3.18.0.bb37
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gnome/gconf/remove_plus_from_invalid_characters_list.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gnome/gconf/unable-connect-dbus.patch95
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gnome/gconf_3.2.6.bb54
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gnome/gnome-common_3.18.0.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gnome/gnome-doc-utils.inc30
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gnome/gnome-doc-utils/sysrooted-pkg-config.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gnome/gnome-doc-utils/use-usr-bin-env-for-python-in-xml2po.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gnome/gnome-doc-utils/xsltproc_nonet.patch95
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gnome/gnome-doc-utils_0.20.10.bb11
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gnome/libart-lgpl/libart_lgpl-2.3.21-crosscompile.patch84
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gnome/libart-lgpl_2.3.21.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-Prefix-pkg-config-paths-with-PKG_CONFIG_SYSROOT_DIR-.patch97
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-configure.ac-add-host-gi-gi-cross-wrapper-and-gi-ldd.patch204
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-giscanner-add-a-use-ldd-wrapper-option.patch48
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-giscanner-add-use-binary-wrapper-option.patch52
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.46.0.bb163
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas_3.19.3.bb14
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+.inc97
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+/doc-fixes.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+/hardcoded_libtool.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+/strict-prototypes.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+/toggle-font.diff102
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+/xsettings.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3.inc113
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/Do-not-try-to-initialize-GL-without-libGL.patch60
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/Dont-force-csd.patch118
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/hardcoded_libtool.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3_3.18.8.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+_2.24.29.bb34
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.18.8.bb60
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk-icon-utils/Remove-Gdk-dependency-from-gtk-encode-symbolic-svg.patch102
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gtk-doc-stub/files/0001-Revert-Import-introspection-stub-machinery-too.patch305
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gtk-doc-stub/gtk-doc-stub_git.bb33
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gtk-engines/gtk-engines-2.20.2/glib-2.32.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gtk-engines/gtk-engines-2.20.2/substitute-tests.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/gtk-engines/gtk-engines_2.20.2.bb55
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/hicolor-icon-theme/hicolor-icon-theme_0.15.bb14
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/json-glib/json-glib_1.0.4.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/libglade/libglade-2.6.4/glade-cruft.patch102
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/libglade/libglade-2.6.4/no-xml2.patch501
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/libglade/libglade-2.6.4/python_environment.patch14
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/libglade/libglade_2.6.4.bb31
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/libgudev/libgudev_230.bb14
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/libnotify/libnotify_0.7.6.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/librsvg/librsvg/gtk-option.patch60
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/librsvg/librsvg_2.40.13.bb45
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/libsecret/libsecret_0.18.4.bb25
-rw-r--r--import-layers/yocto-poky/meta/recipes-gnome/libwnck/libwnck3_3.14.1.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/builder/builder_0.1.bb31
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/builder/files/builder_session.sh33
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/cairo/cairo-fpu.inc6
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/cairo/cairo.inc46
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/cairo/cairo_1.14.6.bb45
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/cantarell-fonts/cantarell-fonts_git.bb24
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-1.0.inc46
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-1.0/0001-build-Use-AC_COMPILE_IFELSE.patch105
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-1.0/install-examples.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-1.0/run-installed-tests-with-tap-output.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-1.0/run-ptest3
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-1.0_1.24.2.bb10
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-gst-3.0.inc17
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-gst-3.0/0001-Install-example-binary-needed-for-core-image-clutter.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-gst-3.0_3.0.16.bb7
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-gtk-1.0.inc15
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-gtk-1.0_1.6.6.bb6
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/cogl/cogl-1.0.inc75
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/cogl/cogl-1.0/test-backface-culling.c-fix-may-be-used-uninitialize.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/cogl/cogl-1.0_1.22.0.bb7
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb-examples/configure.in-Fix-string-argument-syntax.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb-examples_1.7.0.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb.inc79
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/0001-gfx-direct-Aboid-usng-VLAs-and-printf-formats.patch61
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/bashism.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/compar_fn_t.patch62
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/configurefix.patch60
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/fusion.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/union-sigval.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/use-PTHREAD_MUTEX_RECURSIVE.patch116
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb_1.7.7.bb8
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/drm/libdrm/fix_O_CLOEXEC_undeclared.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/drm/libdrm/installtests.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/drm/libdrm_2.4.67.bb45
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/eglinfo/eglinfo-fb_1.0.0.bb6
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/eglinfo/eglinfo-x11_1.0.0.bb12
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/eglinfo/eglinfo.inc31
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/eglinfo/files/0001-Add-STAGING_INCDIR-to-searchpath-for-egl-headers.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/fontconfig/fontconfig/0001-Revert-changes-made-to-FcConfigAppFontAddDir-recentl.patch132
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/fontconfig/fontconfig/revert-static-pkgconfig.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/fontconfig/fontconfig_2.11.94.bb50
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/freetype/freetype/use-right-libtool.patch14
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/freetype/freetype_2.6.3.bb46
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/fstests/fstests_git.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/glew/glew/no-strip.patch12
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/glew/glew_1.13.0.bb40
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/harfbuzz/harfbuzz_1.2.3.bb39
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/images/core-image-clutter.bb13
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/images/core-image-directfb.bb17
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/images/core-image-weston.bb11
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/images/core-image-x11.bb9
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/jpeg/libjpeg-turbo_8d+1.4.2.bb41
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy/0001-select-platforms-based-on-configuration-results.patch128
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy/0002-add-an-option-to-disable-glx-support.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy/no-need-for-python3.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy_git.bb27
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/libfakekey/libfakekey_git.bb23
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/libmatchbox/libmatchbox/libpng.patch69
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/libmatchbox/libmatchbox_1.11.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/libsdl/libsdl-1.2.15/libsdl-1.2.15-xdata32.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/libsdl/libsdl-1.2.15/pkgconfig.patch187
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/libsdl/libsdl_1.2.15.bb70
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/libsdl2/libsdl2/linkage.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/libsdl2/libsdl2_2.0.4.bb66
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/libxsettings-client/libxsettings-client/MIT-style-license22
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/libxsettings-client/libxsettings-client/link-x11.patch13
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/libxsettings-client/libxsettings-client/obsolete_automake_macros.patch14
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/libxsettings-client/libxsettings-client_0.10.bb40
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/matchbox-session/matchbox-session/matchbox-session24
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/matchbox-session/matchbox-session_0.1.bb25
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/matchbox-wm/matchbox-wm/kbdconfig42
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/matchbox-wm/matchbox-wm_git.bb40
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/menu-cache/menu-cache_1.0.1.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/mesa/files/replace_glibc_check_with_linux.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/mesa/libglu_9.0.0.bb30
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0001-mesa-demos-Add-missing-data-files.patch624
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0002-Correctly-implement-with-AC_WITH-glut-so-that-withou.patch57
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch424
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch234
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0005-Fix-build-when-EGL_MESA_screen_surface-extension-isn.patch267
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0006-Query-display-for-EGL_MESA_screen_surface-extension-.patch41
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0007-Install-few-more-test-programs.patch74
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch101
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch73
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0010-sharedtex_mt-fix-rendering-thread-hang.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos_8.2.0.bb60
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-gl_11.1.1.bb13
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa.inc188
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa_11.1.1.bb16
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa_git.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/mini-x-session/files/mini-x-session39
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/mini-x-session/mini-x-session_0.1.bb27
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/mx/mx-1.0/fix-build-dir.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/mx/mx-1.0/fix-test-includes.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/mx/mx-1.0_1.4.7.bb17
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/mx/mx.inc22
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/packagegroups/packagegroup-core-clutter.bb23
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/packagegroups/packagegroup-core-directfb.bb16
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11-base.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11-xserver.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11.bb34
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/pango/pango/0001-Drop-introspection-macros-from-acinclude.m4.patch121
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/pango/pango/run-ptest3
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/pango/pango_1.38.1.bb52
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/piglit/piglit/0001-tests-Fix-missing-include-of-Xutil.h.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/piglit/piglit_git.bb43
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/pong-clock/pong-clock/pong-clock-no-flicker.c410
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/pong-clock/pong-clock_1.0.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/startup-notification/startup-notification-0.12/obsolete_automake_macros.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/startup-notification/startup-notification_0.12.bb29
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/tslib/tslib/ts.conf25
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/tslib/tslib/tslib.sh8
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/tslib/tslib_1.1.bb53
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/ttf-fonts/liberation-fonts/30-liberation-aliases.conf17
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/ttf-fonts/liberation-fonts_1.04.bb40
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/ttf-fonts/ttf-bitstream-vera_1.10.bb38
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/waffle/waffle/0001-third_party-threads-Use-PTHREAD_MUTEX_RECURSIVE-by-d.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/waffle/waffle_1.5.2.bb37
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/wayland/libinput/touchpad-serial-synaptics-need-to-fake-new-touches-on-TRIPLETAP.patch72
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/wayland/libinput_1.1.4.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/wayland/mtdev_1.1.5.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/wayland/wayland_1.9.0.bb41
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/wayland/weston-init.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/wayland/weston-init/init60
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/wayland/weston-init/weston.service15
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/0001-make-error-portable.patch80
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/explicit-enable-disable-systemd.patch70
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/libsystemd.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/make-lcms-explicitly-configurable.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/make-libwebp-explicitly-configurable.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/weston.desktop9
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/weston.pngbin0 -> 2383 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/wayland/weston_1.9.0.bb103
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/Xserver.in12
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xdefaults3
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession38
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/12keymap.sh4
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/13xdgbasedirs.sh13
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/89xdgautostart.sh7
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/90XWindowManager.sh7
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/default.xmodmap260
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/gplv2-license.patch355
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common_0.1.bb30
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init.bb52
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/Xusername1
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/gplv2-license.patch355
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm65
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf1
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.service10
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xcursor-transparent-theme/xcursor-transparent-theme_git.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xinput-calibrator/pointercal-xinput/pointercal.xinput1
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xinput-calibrator/pointercal-xinput_0.0.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/30xinput_calibrate.sh7
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/Allow-xinput_calibrator_pointercal.sh-to-be-run-as-n.patch66
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/add-geometry-input-when-calibrating.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator_git.bb38
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-app/mkfontdir_1.0.7.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-app/mkfontscale_1.1.2.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-app/rgb_1.0.6.bb16
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-app/x11perf_1.6.0.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xauth_1.0.9.bb12
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xdpyinfo/disable-xkb.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xdpyinfo_1.3.2.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xev/diet-x11.patch82
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xev_1.2.2.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xeyes_1.1.1.bb14
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xhost_1.0.7.bb17
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xinit_1.3.4.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xinput_1.6.2.bb12
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xkbcomp_1.3.1.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xmodmap_1.0.9.bb17
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xorg-app-common.inc17
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xprop_1.2.2.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xrandr_1.4.3.bb15
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xset/disable-xkb.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xset_1.2.3.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xvinfo_1.1.3.bb14
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xwininfo_1.1.3.bb15
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-evdev_2.10.1.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-keyboard_1.8.1.bb13
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-keyboard_git.bb16
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-libinput_0.16.0.bb11
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-mouse/unbreak.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-mouse_1.9.1.bb15
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-mouse_git.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-synaptics_1.8.3.bb16
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-synaptics_git.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-vmmouse_13.1.0.bb26
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-cirrus_1.5.3.bb13
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-fbdev_0.4.4.bb9
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/0001-gen8-Fix-the-YUV-RGB-shader.patch65
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/0001-uxa-fix-the-call-to-PixmapSyncDirtyHelper-broken-by-.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/always_include_xorg_server.h.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/disable-x11-dri3.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/sna-Protect-against-ABI-breakage-in-recent-versions-.patch70
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/udev-fstat.patch59
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-intel_2.99.917.bb42
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omap_0.4.4.bb41
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0001-Prevents-omapfb-from-from-crashing-when-pixelclock-o.patch35
-rw-r--r--import-layers/yocto-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--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0002-Revert-Set-virtual-size-when-configuring-framebuffer.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0003-force-plain-mode.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0004-blacklist-tv-out.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0005-Attempt-to-fix-VRFB.patch325
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0006-omapfb-port-to-new-xserver-video-API.patch272
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0007-always_include_xorg_server.h.patch48
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb_git.bb37
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-vesa_2.3.4.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-vmware/0002-add-option-for-vmwgfx.patch98
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-vmware_13.1.0.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xorg-driver-common.inc40
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xorg-driver-input.inc12
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xorg-driver-video.inc8
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/encodings/nocompiler.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/encodings_1.0.4.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/font-alias-1.0.3/nocompiler.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/font-alias_1.0.3.bb24
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/font-util_1.3.1.bb25
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-font-common.inc42
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts.bb32
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-1.pcf.gzbin0 -> 4637 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-10.pcf.gzbin0 -> 4551 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-11.pcf.gzbin0 -> 4409 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-13.pcf.gzbin0 -> 4689 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-14.pcf.gzbin0 -> 4502 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-15.pcf.gzbin0 -> 4614 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-16.pcf.gzbin0 -> 4547 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-2.pcf.gzbin0 -> 4519 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-3.pcf.gzbin0 -> 4418 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-4.pcf.gzbin0 -> 4572 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-5.pcf.gzbin0 -> 4541 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-7.pcf.gzbin0 -> 4550 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-8.pcf.gzbin0 -> 4035 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-9.pcf.gzbin0 -> 4645 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-KOI8-R.pcf.gzbin0 -> 5057 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13.pcf.gzbin0 -> 76746 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-1.pcf.gzbin0 -> 4643 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-10.pcf.gzbin0 -> 4569 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-13.pcf.gzbin0 -> 4700 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-14.pcf.gzbin0 -> 4494 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-15.pcf.gzbin0 -> 4638 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-16.pcf.gzbin0 -> 4539 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-2.pcf.gzbin0 -> 4498 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-3.pcf.gzbin0 -> 4362 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-4.pcf.gzbin0 -> 4584 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-5.pcf.gzbin0 -> 4500 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-7.pcf.gzbin0 -> 4529 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-8.pcf.gzbin0 -> 4008 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-9.pcf.gzbin0 -> 4653 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B.pcf.gzbin0 -> 23787 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-1.pcf.gzbin0 -> 4219 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-10.pcf.gzbin0 -> 4152 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-13.pcf.gzbin0 -> 4275 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-14.pcf.gzbin0 -> 4083 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-15.pcf.gzbin0 -> 4209 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-16.pcf.gzbin0 -> 4111 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-2.pcf.gzbin0 -> 4115 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-3.pcf.gzbin0 -> 3959 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-4.pcf.gzbin0 -> 4154 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-5.pcf.gzbin0 -> 4075 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-7.pcf.gzbin0 -> 4124 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-9.pcf.gzbin0 -> 4206 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O.pcf.gzbin0 -> 15495 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/cursor.pcf.gzbin0 -> 5225 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/fonts.dir410
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libdmx_1.1.3.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libfontenc_1.1.3.bb17
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libice_1.0.9.bb27
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libpciaccess/0001-Include-config.h-before-anything-else-in-.c.patch187
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libpciaccess/0002-Fix-quoting-issue.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libpciaccess/0003-linux_sysfs.c-Include-limits.h-for-PATH_MAX.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libpciaccess/0004-Don-t-include-sys-io.h-on-arm.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libpciaccess_0.13.4.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libpthread-stubs_0.3.bb25
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libsm_1.2.2.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11-diet_1.6.3.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11.inc41
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11/X18NCMSstubs.diff520
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11/disable_tests.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11/fix-disable-xlocale.diff17
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11/fix-utf8-wrong-define.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11/libX11-Add-missing-NULL-check.patch72
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11_1.6.3.bb11
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxau_1.0.8.bb24
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxcalibrate/fix-xcb.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxcalibrate_git.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxcb/disable-check.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxcb/gcc-mips-pr68302-mips-workaround.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxcb/xcbincludedir.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxcb_1.11.1.bb36
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxcomposite/change-include-order.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxcomposite_0.4.4.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxcursor_1.1.14.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxdamage_1.1.4.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxdmcp_1.1.2.bb29
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxext_1.3.3.bb26
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxext_git.bb24
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxfixes_5.0.1.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxfont_1.5.1.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxft_2.3.2.bb33
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxi_1.7.6.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxinerama_1.1.3.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxkbcommon_0.5.0.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxkbfile_1.0.9.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxmu_1.1.2.bb32
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxpm_3.5.11.bb27
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxrandr_1.5.0.bb23
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxrender_0.9.9.bb23
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxres_1.0.7.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxscrnsaver_1.2.2.bb23
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxshmfence_1.2.bb17
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxt/libxt_fix_for_x32.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxt_1.1.5.bb33
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxtst_1.2.2.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxv_1.0.10.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxvmc_1.0.9.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxxf86dga_1.1.4.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxxf86misc_1.0.3.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxxf86vm_1.1.4.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/pixman/0001-ARM-qemu-related-workarounds-in-cpu-features-detecti.patch144
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/pixman/0001-v3-test-add-a-check-for-FE_DIVBYZERO.patch65
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/pixman/asm_include.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/pixman/mips-export-revert.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/pixman_0.32.8.bb42
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xcb-util-image/clang.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xcb-util-image_0.4.0.bb13
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xcb-util-keysyms_0.4.0.bb9
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xcb-util-renderutil_0.3.9.bb10
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xcb-util-wm_0.4.1.bb11
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xcb-util.inc23
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xcb-util_0.4.0.bb8
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xkeyboard-config_2.16.bb31
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xorg-lib-common.inc27
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xtrans_1.3.5.bb24
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/bigreqsproto_1.1.2.bb16
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/calibrateproto/fix.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/calibrateproto_git.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/compositeproto_0.4.2.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/damageproto_1.2.1.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/dmxproto_2.3.1.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/dri2proto_2.8.bb15
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/dri2proto_git.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/dri3proto_1.0.bb14
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/fixesproto_5.0.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/fontsproto_2.1.3.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/glproto_1.4.17.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/inputproto_2.3.1.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/inputproto_git.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/kbproto_1.0.7.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/presentproto_git.bb24
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/randrproto_1.5.0.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/recordproto_1.14.2.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/renderproto_0.11.1.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/resourceproto_1.2.0.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/scrnsaverproto_1.2.2.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/videoproto_2.3.2.bb14
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xcb-proto.inc26
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xcb-proto/no-python-native.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xcb-proto_1.11.bb9
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xcb-proto_git.bb9
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xcmiscproto_1.2.2.bb17
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xextproto_7.3.0.bb24
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xf86dgaproto_2.1.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xf86driproto_2.1.1.bb17
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xf86miscproto_0.9.3.bb17
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xf86vidmodeproto_2.3.1.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xineramaproto_1.2.1.bb17
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xorg-proto-common.inc26
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xproto/xproto_fix_for_x32.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xproto_7.0.28.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-util/gccmakedep_1.0.3.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-util/makedepend_1.0.5.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-util/util-macros_1.19.0.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-util/xorg-util-common.inc13
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/10-preload-modules.conf9
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuarm/xorg.conf69
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemumips/xorg.conf70
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemumips64/xorg.conf69
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuppc/xorg.conf69
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemush4/xorg.conf69
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemux86-64/xorg.conf64
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemux86/xorg.conf64
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/xorg.conf0
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bb31
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc177
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/configure.ac-Use-libsystemd-in-REQUIRED_LIBS-check.patch50
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/macro_tweak.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/modesetting_libdrm_requirements.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/musl-arm-inb-outb.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.18.0.bb30
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xrestop/xrestop_0.4.bb24
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xtscal/xtscal/30xTs_Calibrate.sh13
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xtscal/xtscal/change-cross.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xtscal/xtscal/cleanup.patch621
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xtscal/xtscal/dso_linking_change_build_fix.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xtscal/xtscal_0.6.3.bb33
-rw-r--r--import-layers/yocto-poky/meta/recipes-graphics/xvideo-tests/xvideo-tests_git.bb17
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/blktrace/blktrace/0001-include-sys-types.h-for-dev_t-definition.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/blktrace/blktrace/ldflags.patch106
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/blktrace/blktrace_git.bb41
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/cryptodev/cryptodev-linux_1.8.bb13
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/cryptodev/cryptodev-module_1.8.bb17
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/cryptodev/cryptodev-tests_1.8.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/cryptodev/cryptodev.inc13
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/cryptodev/files/0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch66
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/cryptodev/files/0001-Disable-installing-header-file-provided-by-another-p.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/dtc/dtc.inc22
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/dtc/dtc/make_install.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/dtc/dtc_git.bb11
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb23
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools.inc33
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0001-purgatory-Pass-r-directly-to-linker.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0001-vmcore-dmesg-Define-_GNU_SOURCE.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0002-powerpc-change-the-memory-size-limit.patch35
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/kdump163
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/kdump.conf18
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/kexec-aarch64.patch801
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/kexec-tools-Refine-kdump-device_tree-sort.patch48
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/kexec-x32.patch88
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools_2.0.11.bb37
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb50
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod-native_git.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod.inc43
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod/depmod-search.conf6
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod/ptest.patch25
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-kernel/kmod/kmod/run-ptest5
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod_git.bb62
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/latencytop/latencytop-0.5/0001-Rectify-the-function-signatures-to-fix-prototype-mis.patch64
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-fsync.patch49
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-makefile.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/latencytop/latencytop_0.5.bb30
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/libpfm/files/0001-Makefile-Add-LDFLAGS-variable-to-SLDFLAGS.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/libpfm/libpfm4_4.6.0.bb32
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb556
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc78
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch89
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch59
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.4.bb9
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/linux/kernel-devsrc.bb76
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/linux/linux-dtb.inc74
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/linux/linux-dummy.bb54
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/linux/linux-dummy/COPYING.GPL339
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-dev.bb51
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-rt_4.1.bb27
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb27
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.1.bb23
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.4.bb23
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto.inc57
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto_4.1.bb42
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto_4.4.bb42
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/lttng/babeltrace/0001-Fix-invalid-pointer-free-with-trace-collection.patch44
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/lttng/babeltrace/0001-lttng-live-Include-sys-param.h-for-MAXNAMLEN-definti.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/lttng/babeltrace_1.3.1.bb24
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-modules_git.bb33
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools/Revert-Build-look-for-python-3.0-when-building-pytho.patch30
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools/run-ptest4
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools/runtest-2.4.0.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools/stop-using-SIGUNUSED.patch51
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools_git.bb82
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-add-support-for-aarch64_be.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-doc-examples-disable.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-ust_git.bb34
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/modutils-initscripts/files/PD.patch8
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-kernel/modutils-initscripts/files/modutils.sh52
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/modutils-initscripts/modutils-initscripts.bb33
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile.inc61
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile/0001-Add-rmb-definition-for-NIOS2-architecture.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile/acinclude.m4581
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile/automake-foreign.patch12
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile/musl.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile/oprofile-cross-compile-tests.patch98
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile/root-home-dir.patch44
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile/run-ptest19
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile_1.1.0.bb10
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofileui-server/init37
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofileui-server/oprofileui-server.service6
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofileui-server_git.bb34
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofileui.inc16
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofileui_git.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/perf/perf-features.inc22
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/perf/perf.bb220
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/powertop/powertop/0001-include-rquired-headers-for-typedefs.patch47
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/powertop/powertop_2.8.bb36
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/sysprof/files/define-NT_GNU_BUILD_ID.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/sysprof/files/gui-argument.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/sysprof/files/rmb-arm.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/sysprof/files/rmb-mips.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/sysprof/sysprof_git.bb31
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb42
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/configure-allow-to-disable-libvirt.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/docproc-build-fix.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/obsolete_automake_macros.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/system_map_location.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/x32_abi_time.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap_git.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap_git.inc24
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/trace-cmd/kernelshark_git.bb32
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/trace-cmd/trace-cmd.inc12
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/trace-cmd/trace-cmd/blktrace-api-compatibility.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/trace-cmd/trace-cmd_git.bb33
-rw-r--r--import-layers/yocto-poky/meta/recipes-lsb4/libpng/libpng12_1.2.56.bb36
-rw-r--r--import-layers/yocto-poky/meta/recipes-lsb4/perl/libclass-isa-perl_0.36.bb31
-rw-r--r--import-layers/yocto-poky/meta/recipes-lsb4/perl/libdumpvalue-perl_1.17.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-lsb4/perl/libenv-perl_1.04.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-lsb4/perl/libfile-checktree-perl_4.41.bb32
-rw-r--r--import-layers/yocto-poky/meta/recipes-lsb4/perl/libi18n-collate-perl_1.02.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-lsb4/perl/libpod-plainer-perl_1.04.bb23
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-fpu.inc6
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-lib/0001-topology-Add-missing-include-sys-stat.h.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-lib/Check-if-wordexp-function-is-supported.patch51
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-lib/avoid-including-sys-poll.h-directly.patch183
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-lib_1.1.0.bb51
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-plugins/0001-pph-include-config.h-from-rate_speexrate.c.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-plugins_1.1.0.bb105
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-tools/0001-as10k1-Make-output_tram_line-static-inline.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-tools/autotools.patch32
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-tools/gitcompile_hdajacksensetest13
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-tools/makefile_no_gtk.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-tools_1.1.0.bb42
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-utils-scripts_1.1.0.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-utils/0001-alsabat-rename-to-avoid-naming-conflict.patch153
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-utils/0001-alsactl-don-t-let-systemd-unit-restore-the-volume-wh.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-utils_1.1.0.bb102
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/ffmpeg/ffmpeg_3.0.bb139
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/flac/flac_1.3.1.bb42
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/files/0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/Add-error-signal-emission-for-missing-plugins.patch252
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/Fix-pause-play.patch107
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/filechooser.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/gst-player.desktop10
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/gtk2.patch71
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player_git.bb39
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-plugins-package.inc56
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav.inc46
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-Disable-yasm-for-libav-when-disable-yasm.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/workaround-to-build-gst-libav-for-i586-with-gcc.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.6.3.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_git.bb38
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-meta-base.bb68
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx.inc43
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx/0001-omx-fixed-type-error-in-printf-call.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.2.0.bb11
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_git.bb25
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad.inc148
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch57
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-glimagesink-Downrank-to-marginal.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-gstreamer-gl.pc.in-don-t-append-GL_CFLAGS-to-CFLAGS.patch27
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-glplugin-glwindow-fix-memory-leak-of-navigation-thre.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/avoid-including-sys-poll.h-directly.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/configure-allow-to-disable-libssh2.patch64
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/ensure-valid-sentinels-for-gst_structure_get-etc.patch86
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/fix-maybe-uninitialized-warnings-when-compiling-with-Os.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.6.3.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_git.bb65
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base.inc50
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch168
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-Makefile.am-prefix-calls-to-pkg-config-with-PKG_CONF.patch298
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-riff-add-missing-include-directories-when-calling-in.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-ssaparse-enhance-SSA-text-lines-parsing.patch225
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0004-rtsp-drop-incorrect-reference-to-gstreamer-sdp-in-Ma.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0004-subparse-set-need_segment-after-sink-pad-received-GS.patch69
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0005-convertframe-Support-video-crop-when-convert-frame.patch143
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/encodebin-Need-more-buffers-in-output-queue-for-bett.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/get-caps-from-src-pad-when-query-caps.patch44
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/make-gio_unix_2_0-dependency-configurable.patch47
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.6.3.bb25
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_git.bb27
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good.inc53
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-gstrtpmp4gpay-set-dafault-value-for-MPEG4-without-co.patch62
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/avoid-including-sys-poll.h-directly.patch44
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/ensure-valid-sentinel-for-gst_structure_get.patch40
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.6.3.bb15
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_git.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly.inc31
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.6.3.bb13
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_git.bb41
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins.inc40
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server.inc24
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server/0001-Don-t-hardcode-libtool-name-when-using-introspection.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.6.2.bb6
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0.inc58
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-Fix-crash-with-gst-inspect.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.6.3.bb14
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0_git.bb30
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/lame/lame/lame-3.99.5_fix_for_automake-1.12.x.patch59
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/lame/lame/no-gtk1.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/lame/lame_3.99.5.bb30
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/liba52/liba52/buildcleanup.patch89
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/liba52/liba52_0.7.4.bb26
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/libid3tag/libid3tag/addpkgconfig.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/libid3tag/libid3tag/obsolete_automake_macros.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/libid3tag/libid3tag_0.15.1b.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/libmad/libmad/add-pkgconfig.patch70
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/libmad/libmad/automake-foreign.patch12
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/libmad/libmad/fix_for_mips_with_gcc-4.5.0.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/libmad/libmad/no-force-mem.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/libmad/libmad/obsolete_automake_macros.patch14
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/libmad/libmad_0.15.1b.bb36
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/libogg/libogg_1.3.2.bb17
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/configure-fix.patch58
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/disable-so-versioning.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/dynamicloader-linking.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/makefile-docdir-fix.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/parallel-make.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/libomxil/libomxil_0.9.3.bb37
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/libpng/libpng_1.6.21.bb25
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/libsamplerate/libsamplerate0_0.1.8.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/libsndfile/libsndfile1_1.0.26.bb26
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/libtheora/libtheora-1.1.1/no-docs.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/libtheora/libtheora_1.1.1.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/libtool2.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/libtiff/tiff_4.0.6.bb47
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/libvorbis/libvorbis_1.3.5.bb17
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/mpeg2dec/mpeg2dec-0.4.1/altivec_h_needed.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/mpeg2dec/mpeg2dec_0.4.1.bb40
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio.inc200
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-Revert-module-switch-on-port-available-Route-to-pref.patch268
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-card-add-pa_card_profile.ports.patch218
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-client-conf-Add-allow-autospawn-for-root.patch97
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-padsp-Make-it-compile-on-musl.patch70
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0002-alsa-bluetooth-fail-if-user-requested-profile-doesn-.patch65
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0003-card-move-profile-selection-after-pa_card_new.patch366
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0004-alsa-set-availability-for-some-unavailable-profiles.patch83
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/volatiles.04_pulse2
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio_8.0.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/sbc/sbc_1.3.bb16
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/speex/speex_1.2rc2.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/speex/speexdsp/0001-Don-t-rely-on-HAVE_STDINT_H-et-al.-being-defined.patch63
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/speex/speexdsp_1.2rc3.bb39
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/tremor/tremor/obsolete_automake_macros.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/tremor/tremor/tremor-arm-thumb2.patch104
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/tremor/tremor_20150107.bb27
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/webp/libwebp_0.5.0.bb49
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/x264/x264/don-t-default-to-cortex-a9-with-neon.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-multimedia/x264/x264_git.bb55
-rw-r--r--import-layers/yocto-poky/meta/recipes-rt/README13
-rw-r--r--import-layers/yocto-poky/meta/recipes-rt/images/core-image-rt-sdk.bb12
-rw-r--r--import-layers/yocto-poky/meta/recipes-rt/images/core-image-rt.bb9
-rw-r--r--import-layers/yocto-poky/meta/recipes-rt/rt-tests/files/0001-Makefile-Set-CC-AR-variable-only-if-it-doesn-t-have-.patch30
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-rt/rt-tests/files/rt_bmark.py412
-rw-r--r--import-layers/yocto-poky/meta/recipes-rt/rt-tests/files/run-ptest3
-rw-r--r--import-layers/yocto-poky/meta/recipes-rt/rt-tests/hwlatdetect_0.96.bb23
-rw-r--r--import-layers/yocto-poky/meta/recipes-rt/rt-tests/rt-tests.inc13
-rw-r--r--import-layers/yocto-poky/meta/recipes-rt/rt-tests/rt-tests_0.96.bb33
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/gtk-engines/gtk-sato-engine.inc25
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/gtk-engines/gtk-sato-engine_git.bb14
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/images/core-image-sato-dev.bb7
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/images/core-image-sato-sdk-ptest.bb6
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/images/core-image-sato-sdk.bb11
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/images/core-image-sato.bb11
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/leafpad/files/leafpad.desktop10
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/leafpad/files/owl-menu.patch63
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/leafpad/leafpad_0.8.18.1.bb35
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/libowl/libowl_git.bb23
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/matchbox-config-gtk/files/no-handed.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/matchbox-config-gtk/matchbox-config-gtk_git.bb23
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/matchbox-desktop-sato/matchbox-desktop-sato_git.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/matchbox-desktop/files/0001-Do-nothing-on-delete-event-when-not-STANDALONE.patch60
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/matchbox-desktop/matchbox-desktop_git.bb27
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/matchbox-keyboard/files/0001-desktop-file-Hide-the-keyboard-from-app-list.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/matchbox-keyboard/files/80matchboxkeyboard.sh21
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/matchbox-keyboard/matchbox-keyboard_git.bb54
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/matchbox-panel-2/files/0001-showdesktop-Make-sure-active-state-is-initialized.patch50
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/matchbox-panel-2/files/silence-warnings.patch64
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/matchbox-panel-2/matchbox-panel-2_git.bb39
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/matchbox-sato/matchbox-session-sato/session33
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/matchbox-sato/matchbox-session-sato_0.1.bb51
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/matchbox-terminal/matchbox-terminal_git.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/matchbox-theme-sato/matchbox-theme-sato.inc16
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/matchbox-theme-sato/matchbox-theme-sato_0.1.bb8
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/matchbox-theme-sato/matchbox-theme-sato_git.bb12
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/packagegroups/packagegroup-core-x11-sato.bb62
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/pcmanfm/files/emblem-symbolic-link.pngbin0 -> 999 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/pcmanfm/files/gnome-fs-directory.pngbin0 -> 2044 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/pcmanfm/files/gnome-fs-regular.pngbin0 -> 3220 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/pcmanfm/files/gnome-mime-text-plain.pngbin0 -> 2855 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/pcmanfm/files/no-desktop.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/pcmanfm/pcmanfm_1.2.4.bb42
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/pulseaudio-sato/pulseaudio-client-conf-sato/50-sato.conf7
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/pulseaudio-sato/pulseaudio-client-conf-sato_1.bb17
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/puzzles/files/0001-Use-labs-instead-of-abs.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch72
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/puzzles/files/0001-rect-Fix-compiler-errors-about-uninitialized-use-of-.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/puzzles/files/oh-puzzles-owl-menu.patch203
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/puzzles/oh-puzzles_git.bb73
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/puzzles/puzzles_git.bb66
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode.inc58
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode/rxvt.desktop9
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode/rxvt.pngbin0 -> 2847 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode/xwc.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode_9.20.bb8
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode_9.22.bb8
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/sato-icon-theme/sato-icon-theme/0001-Inherit-the-GNOME-icon-theme.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/sato-icon-theme/sato-icon-theme_0.4.1.bb40
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/sato-screenshot/sato-screenshot_git.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/settings-daemon/files/70settings-daemon.sh1
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/settings-daemon/files/addsoundkeys.patch49
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/settings-daemon/files/dso_linking_change_build_fix.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/settings-daemon/settings-daemon_git.bb30
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/shutdown-desktop/shutdown-desktop.bb25
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/shutdown-desktop/shutdown-desktop/shutdown.desktop10
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/webkit/files/0001-FindGObjectIntrospection.cmake-prefix-variables-obta.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/webkit/files/0001-OptionsGTK.cmake-drop-the-hardcoded-introspection-gt.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/webkit/files/0001-When-building-introspection-files-add-CMAKE_C_FLAGS-.patch40
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/0001-Enable-backtrace-on-linux-when-using-glibc.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/0001-Fix-build-with-non-glibc-libraries-on-linux.patch61
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/clang.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk_2.10.7.bb88
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/apr/apr-util/configfix.patch51
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/apr/apr-util/configure_fixes.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/apr/apr-util/run-ptest6
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/apr/apr-util_1.5.4.bb95
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/apr/apr/Fix-packet-discards-HTTP-redirect.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/apr/apr/cleanup.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/apr/apr/configfix.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/apr/apr/configure.in-fix-LTFLAGS-to-make-it-work-with-ccache.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/apr/apr/configure_fixes.patch68
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/apr/apr/run-ptest6
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/apr/apr/upgrade-and-fix-1.5.1.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/apr/apr_1.5.2.bb109
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/argp-standalone/argp-standalone_1.3.bb29
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/argp-standalone/files/0001-throw-in-funcdef.patch84
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/argp-standalone/files/0002-isprint.patch51
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/argp-standalone/files/out_of_tree_build.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/aspell/aspell_0.60.6.1.bb29
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/atk/at-spi2-atk_2.18.1.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/atk/at-spi2-core/0001-nls.m4-Take-it-from-gettext-0.15.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/atk/at-spi2-core_2.18.3.bb23
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/atk/atk_2.18.0.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/attr/acl.inc41
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/attr/acl/acl-fix-the-order-of-expected-output-of-getfacl.patch198
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/attr/acl/add-missing-configure.ac.patch59
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/attr/acl/run-ptest7
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/attr/acl/test-fix-insufficient-quoting-of.patch108
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/attr/acl/test-fixups-on-SELinux-machines-for-root-testcases.patch84
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/attr/acl_2.2.52.bb9
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/attr/attr.inc39
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/attr/attr_2.4.47.bb12
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/attr/ea-acl.inc52
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/attr/files/attr-Missing-configure.ac.patch63
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/attr/files/dont-use-decl-macros.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/attr/files/relative-libdir.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/attr/files/run-ptest5
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/bash-completion/bash-completion_2.1.bb42
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/bdwgc/bdwgc/0001-configure.ac-add-check-for-NO_GETCONTEXT-definition.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/bdwgc/bdwgc/0001-fix-build-with-musl.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/bdwgc/bdwgc/0002-Altera-NIOS2-support.patch71
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/bdwgc/bdwgc_7.4.2.bb43
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/beecrypt/beecrypt/add-option-dev-dsp.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/beecrypt/beecrypt/beecrypt-enable-ptest-support.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/beecrypt/beecrypt/disable-icu-check.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/beecrypt/beecrypt/fix-for-gcc-4.7.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/beecrypt/beecrypt/fix-security.patch47
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/beecrypt/beecrypt/run-ptest5
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/beecrypt/beecrypt_4.2.1.bb48
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/boost/bjam-native_1.60.0.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/boost/boost-1.60.0.inc19
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/boost/boost.inc195
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/boost/boost/0001-Do-not-qualify-fenv.h-names-that-might-be-macros.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/boost/boost/arm-intrinsics.patch55
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/boost/boost/consider-hardfp.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/boost/boost_1.60.0.bb8
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/boost/files/bjam-native-build-bjam.debug.patch50
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/ca-certificates/ca-certificates/0001-update-ca-certificates-don-t-use-Debianisms-in-run-p.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/ca-certificates/ca-certificates/0001-update-ca-certificates-remove-c-rehash.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/ca-certificates/ca-certificates/0002-update-ca-certificates-use-SYSROOT.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/ca-certificates/ca-certificates/default-sysroot.patch50
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/ca-certificates/ca-certificates/sbindir.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/ca-certificates/ca-certificates/update-ca-certificates-support-Toybox.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/ca-certificates/ca-certificates_20160104.bb80
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/consolekit/consolekit/add-polkit-configure-argument.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/consolekit/consolekit/sepbuildfix.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/consolekit/consolekit_0.4.6.bb50
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/createrepo-dbpath.patch61
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/createrepo-rpm549.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/dumpMetadata-disable-signature-validation.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/fix-native-install.patch163
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/fixstat.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/python-scripts-should-use-interpreter-from-env.patch47
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/recommends.patch71
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/rpm-createsolvedb.py64
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo_0.4.11.bb51
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/curl/curl/configure_ac.patch13
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/curl/curl_7.47.1.bb68
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/db/db/Makefile-let-libdb-6.0.la-depend-os_map.l.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/db/db/Makefile-let-libso_target-depend-on-bt_rec.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/db/db/arm-thumb-mutex_db5.patch48
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/db/db/fix-parallel-build.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/db/db_5.3.28.bb117
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/db/db_6.0.30.bb124
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/debianutils/debianutils_4.7.bb48
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/enchant/enchant_1.6.0.bb32
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gdbm/files/ptest.patch36
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-support/gdbm/files/run-ptest7
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm-1.8.3/ldflags.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm-1.8.3/libtool-mode.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm-1.8.3/makefile.patch60
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm_1.11.bb43
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm_1.8.3.bb30
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/Use-__gnu_inline__-attribute.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/avoid-h-asm-constraint-for-MIPS.patch57
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/gmp_fix_for_automake-1.12.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.0/0001-Append-the-user-provided-flags-to-the-auto-detected-.patch61
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.0/amd64.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.0/use-includedir.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gmp/gmp.inc12
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gmp/gmp_4.2.1.bb17
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gmp/gmp_6.1.0.bb33
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gnome-desktop-testing/gnome-desktop-testing/0001-gsystem-subprocess.c-Enable-GNU-extensions-in-system.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gnome-desktop-testing/gnome-desktop-testing/update-output-syntax.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gnome-desktop-testing/gnome-desktop-testing_2014.1.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4242.patch63
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4351.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4576.patch154
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/GnuPG1-CVE-2012-6085.patch64
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/configure.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/curl_typeof_fix_backport.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/long-long-thumb.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/mips_gcc4.4.patch50
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg/autogen.sh-fix-find-version-for-beta-checking.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg/dirmngr-uses-libgpg-error.patch16
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg/pkgconfig.patch90
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg/use-pkgconfig-instead-of-npth-config.patch72
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg_1.4.7.bb104
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg_2.1.11.bb45
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls.inc57
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls/0001-configure.ac-fix-sed-command.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls/correct_rpl_gettimeofday_signature.patch67
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls/use-pkg-config-to-locate-zlib.patch67
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls_3.4.9.bb8
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1/dont-depend-on-help2man.patch14
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1_4.7.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme/gpgme.pc10
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme/pkgconfig.patch279
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme_1.6.0.bb40
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/icu/icu.inc51
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/icu/icu/0001-Disable-LDFLAGSICUDT-for-Linux.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/icu/icu/fix-install-manx.patch48
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/icu/icu/icu-pkgdata-large-cmd.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/icu/icu/icu-release-56-1-flagparser-fix.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/icu/icu_56.1.bb29
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/iso-codes/iso-codes_3.65.bb15
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libassuan/libassuan/libassuan-add-pkgconfig-support.patch158
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libassuan/libassuan_2.4.2.bb30
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libatomic-ops/libatomic-ops/0001-Add-initial-nios2-architecture-support.patch70
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libatomic-ops/libatomic-ops_7.4.2.bb32
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libbsd/libbsd_0.8.2.bb43
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libcap-ng/libcap-ng/python.patch58
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libcap-ng/libcap-ng_0.7.7.bb38
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libcap/libcap_2.24.bb76
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libcheck/libcheck_0.10.0.bb24
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libcroco/libcroco_0.6.11.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libdaemon/libdaemon/fix-includes.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libdaemon/libdaemon_0.14.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libevdev/libevdev_1.4.6.bb14
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libevent/libevent/run-ptest18
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libevent/libevent_2.0.22.bb41
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libexif/libexif_0.6.21.bb17
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libffi/libffi/0001-mips-Use-compiler-internal-define-for-linux.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libffi/libffi/not-win32.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libffi/libffi_3.2.1.bb26
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libfm/libfm-extra/0001-nls.m4-Take-it-from-gettext-0.15.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libfm/libfm-extra_1.2.4.bb23
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libfm/libfm_1.2.4.bb36
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libgcrypt/files/add-pkgconfig-support.patch151
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libgcrypt/files/fix-ICE-failure-on-mips-with-option-O-and-g.patch71
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libgcrypt/files/libgcrypt-fix-building-error-with-O2-in-sysroot-path.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libgcrypt/libgcrypt.inc47
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libgcrypt/libgcrypt_1.6.5.bb4
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libgpg-error/libgpg-error/0001-libgpg-error-Add-nios2-support.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libgpg-error/libgpg-error/pkgconfig.patch150
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libgpg-error/libgpg-error_1.21.bb53
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libical/libical/Remove-cmake-check-for-Perl.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libical/libical_2.0.0.bb27
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv-1.11.1/autoconf.patch50
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv-1.11.1/shared_preloadable_libiconv_linux.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv-1.14/add-relocatable-module.patch5008
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv-1.14/autoconf.patch50
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv_1.11.1.bb47
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv_1.14.bb51
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libksba/libksba/ksba-add-pkgconfig-support.patch152
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libksba/libksba_1.3.3.bb25
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libmpc/libmpc.inc7
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libmpc/libmpc_1.0.3.bb15
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libnl/libnl/fix-pc-file.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libnl/libnl/fix-pktloc_syntax_h-race.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libnl/libnl_3.2.25.bb42
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libpcre/libpcre/Makefile183
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libpcre/libpcre/fix-pcre-name-collision.patch41
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libpcre/libpcre/pcre-cross.patch48
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libpcre/libpcre/run-ptest3
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libpcre/libpcre_8.38.bb79
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libproxy/libproxy/0001-test-Include-sys-select.h-for-select.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libproxy/libproxy_0.4.11.bb36
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libsoup/libsoup-2.4_2.52.2.bb34
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libunistring/libunistring/0001-Unset-need_charset_alias-when-building-for-musl.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libunistring/libunistring/iconv-m4-remove-the-test-to-convert-euc-jp.patch40
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libunistring/libunistring_0.9.6.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/0001-Fix-build-on-mips-musl.patch90
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/0001-Invalid-dwarf-opcodes-can-cause-references-beyond-th.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/0001-backtrace-Use-only-with-glibc-and-uclibc.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/0001-disable-tests.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/0001-x86-Stub-out-x86_local_resume.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/AArch64-port.patch2529
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch62
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/Fix-test-case-link-failure-on-PowerPC-systems-with-Altivec.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/Link-libunwind-to-libgcc_s-rather-than-libgcc.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/Support-building-with-older-compilers.patch72
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind.inc32
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind_1.1.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/liburcu/liburcu/0001-Support-for-NIOS2-architecture.patch144
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/liburcu/liburcu/0002-Support-for-aarch64_be.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/liburcu/liburcu_0.9.1.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libusb/libusb-compat/0001-usb.h-Include-sys-types.h.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libusb/libusb-compat_0.1.5.bb42
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libusb/libusb1/no-dll.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libusb/libusb1_1.0.20.bb35
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libxslt/libxslt/CVE-2015-7995.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libxslt/libxslt/pkgconfig.patch118
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libxslt/libxslt/pkgconfig_fix.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libxslt/libxslt_1.1.28.bb50
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libyaml/files/libyaml-CVE-2014-9130.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/libyaml/libyaml_0.1.6.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/lz4/lz4.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/lzo/lzo/0001-Use-memcpy-instead-of-reinventing-it.patch70
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/lzo/lzo/acinclude.m4358
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/lzo/lzo/run-ptest8
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/lzo/lzo_2.09.bb35
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/lzop/lzop/0001-use-static-inlines-as-the-external-inline-definition.patch100
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/lzop/lzop/acinclude.m4390
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/lzop/lzop/x32_abi_miniacc_h.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/lzop/lzop_1.03.bb29
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/mpfr/mpfr-3.1.3/long-long-thumb.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/mpfr/mpfr.inc6
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/mpfr/mpfr_3.1.3.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/neon/neon/gnutls_4.3_fixup.patch68
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/neon/neon/pkgconfig.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/neon/neon_0.30.1.bb38
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/nettle/files/Add-target-to-only-build-tests-not-run-them.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/nettle/files/run-ptest36
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/nettle/nettle-2.7.1/CVE-2015-8803_8805.patch71
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/nettle/nettle-2.7.1/CVE-2015-8804.patch272
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/nettle/nettle.inc37
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/nettle/nettle_2.7.1.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/nettle/nettle_3.2.bb11
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/npth/npth/pkgconfig.patch49
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/npth/npth_1.2.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/nspr/nspr/0002-Add-nios2-support.patch105
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/nspr/nspr/fix-build-on-x86_64.patch52
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/nspr/nspr/nspr.pc.in11
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/nspr/nspr/remove-rpath-from-tests.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/nspr/nspr/remove-srcdir-from-configure-in.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/nspr/nspr_4.12.bb181
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/nss-myhostname/nss-myhostname/0001-nss-myhostname-Check-for-nss.h-presense-before-use.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/nss-myhostname/nss-myhostname_0.3.bb31
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/nss/nss/0001-Fix-build-failure-on-opensuse-13.1.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/nss/nss/nss-fix-incorrect-shebang-of-perl.patch110
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/nss/nss/nss-fix-nsinstall-build.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/nss/nss/nss-fix-support-cross-compiling.patch71
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/nss/nss/nss-no-rpath-for-cross-compiling.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/nss/nss/nss.pc.in11
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/nss/nss/signlibs.sh20
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/nss/nss_3.21.bb240
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/p11-kit/p11-kit_0.22.1.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/pinentry/pinentry_0.9.2.bb33
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/popt/popt/disable_tests.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/popt/popt/pkgconfig_fix.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/popt/popt/popt_fix_for_automake-1.12.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/popt/popt_1.16.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/ptest-runner/ptest-runner_2.0.bb26
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/0001-If-the-libc-is-lacking-argp-use-libargp.patch60
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/0002-Add-argument-to-control-the-libargp-dependency.patch92
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/default3
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/init49
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/uclibc-libuargp-configure.patch63
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/underquote.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools_5.bb46
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/serf/serf/env.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/serf/serf/norpath.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/serf/serf_1.3.8.bb26
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/shared-mime-info/shared-mime-info.inc36
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/shared-mime-info/shared-mime-info/install-data-hook.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/shared-mime-info/shared-mime-info/parallelmake.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/shared-mime-info/shared-mime-info_1.6.bb7
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/sqlite/sqlite3.inc53
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/sqlite/sqlite3/fix-disable-static-shell.patch61
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/sqlite/sqlite3_3.11.0.bb11
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/taglib/taglib_1.9.1.bb32
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/user-creation/files/system-xuser.conf11
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/user-creation/xuser-account_0.1.bb29
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/vte/vte-0.28.2/cve-2012-2738.patch136
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/vte/vte-0.28.2/obsolete_automake_macros.patch14
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/vte/vte.inc15
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/vte/vte_0.28.2.bb16
-rw-r--r--import-layers/yocto-poky/meta/recipes.txt14
-rw-r--r--import-layers/yocto-poky/meta/site/arm-3247
-rw-r--r--import-layers/yocto-poky/meta/site/arm-6446
-rw-r--r--import-layers/yocto-poky/meta/site/arm-common154
-rw-r--r--import-layers/yocto-poky/meta/site/arm-darwin11
-rw-r--r--import-layers/yocto-poky/meta/site/arm-darwin811
-rw-r--r--import-layers/yocto-poky/meta/site/arm-linux159
-rw-r--r--import-layers/yocto-poky/meta/site/arm-linux-uclibc105
-rw-r--r--import-layers/yocto-poky/meta/site/armeb-linux43
-rw-r--r--import-layers/yocto-poky/meta/site/armeb-linux-uclibc38
-rw-r--r--import-layers/yocto-poky/meta/site/common21
-rw-r--r--import-layers/yocto-poky/meta/site/common-darwin2
-rw-r--r--import-layers/yocto-poky/meta/site/common-glibc86
-rw-r--r--import-layers/yocto-poky/meta/site/common-linux63
-rw-r--r--import-layers/yocto-poky/meta/site/common-mingw2
-rw-r--r--import-layers/yocto-poky/meta/site/common-musl52
-rw-r--r--import-layers/yocto-poky/meta/site/common-uclibc52
-rw-r--r--import-layers/yocto-poky/meta/site/endian-big8
-rw-r--r--import-layers/yocto-poky/meta/site/endian-little8
-rw-r--r--import-layers/yocto-poky/meta/site/ix86-common227
-rw-r--r--import-layers/yocto-poky/meta/site/mips-common53
-rw-r--r--import-layers/yocto-poky/meta/site/mips-linux79
-rw-r--r--import-layers/yocto-poky/meta/site/mips-linux-uclibc80
-rw-r--r--import-layers/yocto-poky/meta/site/mips64-linux83
-rw-r--r--import-layers/yocto-poky/meta/site/mips64-linux-uclibc83
-rw-r--r--import-layers/yocto-poky/meta/site/mips64el-linux82
-rw-r--r--import-layers/yocto-poky/meta/site/mips64el-linux-uclibc108
-rw-r--r--import-layers/yocto-poky/meta/site/mipsel-linux79
-rw-r--r--import-layers/yocto-poky/meta/site/mipsel-linux-uclibc100
-rw-r--r--import-layers/yocto-poky/meta/site/native1
-rw-r--r--import-layers/yocto-poky/meta/site/nios2-linux391
-rw-r--r--import-layers/yocto-poky/meta/site/powerpc-common14
-rw-r--r--import-layers/yocto-poky/meta/site/powerpc-darwin7
-rw-r--r--import-layers/yocto-poky/meta/site/powerpc-linux16
-rw-r--r--import-layers/yocto-poky/meta/site/powerpc32-linux272
-rw-r--r--import-layers/yocto-poky/meta/site/powerpc64-linux39
-rw-r--r--import-layers/yocto-poky/meta/site/sh-common235
-rw-r--r--import-layers/yocto-poky/meta/site/sparc-linux48
-rw-r--r--import-layers/yocto-poky/meta/site/x32-linux9
-rw-r--r--import-layers/yocto-poky/meta/site/x86_64-linux135
-rw-r--r--import-layers/yocto-poky/meta/site/x86_64-linux-uclibc91
-rwxr-xr-ximport-layers/yocto-poky/oe-init-build-env67
-rwxr-xr-ximport-layers/yocto-poky/oe-init-build-env-memres90
-rw-r--r--import-layers/yocto-poky/scripts/README1
-rwxr-xr-ximport-layers/yocto-poky/scripts/bitbake-prserv-tool112
-rwxr-xr-ximport-layers/yocto-poky/scripts/bitbake-whatchanged339
-rwxr-xr-ximport-layers/yocto-poky/scripts/buildhistory-collect-srcrevs117
-rwxr-xr-ximport-layers/yocto-poky/scripts/buildhistory-diff100
-rwxr-xr-ximport-layers/yocto-poky/scripts/cleanup-workdir198
-rwxr-xr-ximport-layers/yocto-poky/scripts/combo-layer924
-rwxr-xr-ximport-layers/yocto-poky/scripts/combo-layer-hook-default.sh20
-rw-r--r--import-layers/yocto-poky/scripts/combo-layer.conf.example93
-rwxr-xr-ximport-layers/yocto-poky/scripts/contrib/bb-perf/bb-matrix-plot.sh137
-rwxr-xr-ximport-layers/yocto-poky/scripts/contrib/bb-perf/bb-matrix.sh79
-rwxr-xr-ximport-layers/yocto-poky/scripts/contrib/bb-perf/buildstats.sh90
-rwxr-xr-ximport-layers/yocto-poky/scripts/contrib/bbvars.py186
-rwxr-xr-ximport-layers/yocto-poky/scripts/contrib/build-perf-test.sh400
-rwxr-xr-ximport-layers/yocto-poky/scripts/contrib/ddimage104
-rwxr-xr-ximport-layers/yocto-poky/scripts/contrib/devtool-stress.py242
-rwxr-xr-ximport-layers/yocto-poky/scripts/contrib/dialog-power-control53
-rwxr-xr-ximport-layers/yocto-poky/scripts/contrib/documentation-audit.sh94
-rwxr-xr-ximport-layers/yocto-poky/scripts/contrib/graph-tool92
-rwxr-xr-ximport-layers/yocto-poky/scripts/contrib/list-packageconfig-flags.py179
-rwxr-xr-ximport-layers/yocto-poky/scripts/contrib/mkefidisk.sh459
-rwxr-xr-ximport-layers/yocto-poky/scripts/contrib/python/generate-manifest-2.7.py397
-rwxr-xr-ximport-layers/yocto-poky/scripts/contrib/python/generate-manifest-3.5.py384
-rwxr-xr-ximport-layers/yocto-poky/scripts/contrib/serdevtry60
-rwxr-xr-ximport-layers/yocto-poky/scripts/contrib/test_build_time.sh237
-rwxr-xr-ximport-layers/yocto-poky/scripts/contrib/test_build_time_worker.sh37
-rwxr-xr-ximport-layers/yocto-poky/scripts/contrib/verify-homepage.py62
-rwxr-xr-ximport-layers/yocto-poky/scripts/cp-noerror52
-rwxr-xr-ximport-layers/yocto-poky/scripts/create-pull-request276
-rwxr-xr-ximport-layers/yocto-poky/scripts/crosstap148
-rwxr-xr-ximport-layers/yocto-poky/scripts/devtool342
-rwxr-xr-ximport-layers/yocto-poky/scripts/gen-lockedsig-cache57
-rwxr-xr-ximport-layers/yocto-poky/scripts/gen-site-config53
-rw-r--r--import-layers/yocto-poky/scripts/lib/argparse_oe.py129
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/__init__.py22
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/engine.py1947
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/help.py1046
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/kernel.py1071
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/.gitignore0
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/conf/machine/machine.conf102
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf34
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend2
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files.noinstall1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-non_hardware.cfg31
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-preempt-rt.scc15
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-standard.scc15
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-tiny.scc11
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-user-config.cfg1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-user-features.scc1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-user-patches.scc1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine.cfg321
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine.scc8
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/kernel-list.noinstall5
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-dev.bbappend25
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend33
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend33
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_4.1.bbappend32
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_4.4.bbappend32
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/COPYING.MIT17
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/README118
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/README.sources17
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/binary/.gitignore0
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/conf/layer.conf10
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor/machine.noinstall1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor/machine/machconfig5
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor_0.0.bbappend2
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/kernel-list.noinstall26
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom.bb57
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom.noinstall1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/defconfig5
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine-user-config.cfg9
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine-user-patches.scc9
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine.cfg4
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine.scc18
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/conf/machine/machine.conf77
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend2
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files.noinstall1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-preempt-rt.scc17
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-standard.scc17
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-tiny.scc11
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-user-config.cfg1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-user-features.scc1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-user-patches.scc1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine.cfg55
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine.scc21
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/kernel-list.noinstall5
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-dev.bbappend25
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend33
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend33
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_4.1.bbappend32
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_4.4.bbappend32
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/COPYING.MIT17
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/README64
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/conf/layer.conf10
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/layer-questions.noinstall14
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend.noinstall1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend/example-bbappend/example-bbappend-version.bbappend9
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend/example-bbappend/example-bbappend-version.noinstall1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend/example-bbappend/example-bbappend-version/example.patch12
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example.noinstall1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1.bb23
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1.noinstall1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1/example.patch12
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1/helloworld.c8
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/.gitignore0
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/conf/machine/machine.conf39
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files.noinstall1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-preempt-rt.scc11
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-standard.scc11
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-tiny.scc11
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-user-config.cfg1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-user-features.scc1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-user-patches.scc1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine.cfg2
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine.scc8
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/kernel-list.noinstall5
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-dev.bbappend25
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend33
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend33
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_4.1.bbappend32
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_4.4.bbappend32
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/.gitignore0
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/conf/machine/machine.conf39
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files.noinstall1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-preempt-rt.scc11
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-standard.scc11
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-tiny.scc11
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-user-config.cfg1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-user-features.scc1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-user-patches.scc1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine.cfg66
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine.scc8
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/kernel-list.noinstall5
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-dev.bbappend25
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend33
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend33
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_4.1.bbappend32
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_4.4.bbappend32
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/.gitignore0
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/machine.conf87
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files.noinstall1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-preempt-rt.scc11
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-standard.scc11
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-tiny.scc11
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-user-config.cfg1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-user-features.scc1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-user-patches.scc1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine.cfg164
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine.scc10
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/kernel-list.noinstall5
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-dev.bbappend25
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend33
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend33
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_4.1.bbappend32
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_4.4.bbappend32
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/machine.conf74
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-core/init-ifupdown/init-ifupdown/machine.noinstall1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-core/init-ifupdown/init-ifupdown/machine/interfaces5
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf77
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files.noinstall1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-preempt-rt.scc11
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-standard.scc20
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-tiny.scc11
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-user-config.cfg1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-user-features.scc1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-user-patches.scc1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine.cfg1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine.scc5
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/kernel-list.noinstall5
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-dev.bbappend55
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend62
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend62
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_4.1.bbappend61
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_4.4.bbappend61
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/.gitignore0
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/conf/machine/machine.conf65
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend2
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files.noinstall1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-preempt-rt.scc17
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-standard.scc17
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-tiny.scc11
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-user-config.cfg1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-user-features.scc1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-user-patches.scc1
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine.cfg48
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine.scc14
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/kernel-list.noinstall5
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-dev.bbappend25
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend33
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend33
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.1.bbappend32
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.4.bbappend32
-rw-r--r--import-layers/yocto-poky/scripts/lib/bsp/tags.py49
-rw-r--r--import-layers/yocto-poky/scripts/lib/devtool/__init__.py257
-rw-r--r--import-layers/yocto-poky/scripts/lib/devtool/build.py86
-rw-r--r--import-layers/yocto-poky/scripts/lib/devtool/build_image.py154
-rw-r--r--import-layers/yocto-poky/scripts/lib/devtool/build_sdk.py65
-rw-r--r--import-layers/yocto-poky/scripts/lib/devtool/deploy.py304
-rw-r--r--import-layers/yocto-poky/scripts/lib/devtool/package.py62
-rw-r--r--import-layers/yocto-poky/scripts/lib/devtool/runqemu.py65
-rw-r--r--import-layers/yocto-poky/scripts/lib/devtool/sdk.py366
-rw-r--r--import-layers/yocto-poky/scripts/lib/devtool/search.py88
-rw-r--r--import-layers/yocto-poky/scripts/lib/devtool/standard.py1454
-rw-r--r--import-layers/yocto-poky/scripts/lib/devtool/upgrade.py382
-rw-r--r--import-layers/yocto-poky/scripts/lib/devtool/utilcmds.py233
-rw-r--r--import-layers/yocto-poky/scripts/lib/recipetool/__init__.py0
-rw-r--r--import-layers/yocto-poky/scripts/lib/recipetool/append.py471
-rw-r--r--import-layers/yocto-poky/scripts/lib/recipetool/create.py963
-rw-r--r--import-layers/yocto-poky/scripts/lib/recipetool/create_buildsys.py859
-rw-r--r--import-layers/yocto-poky/scripts/lib/recipetool/create_buildsys_python.py719
-rw-r--r--import-layers/yocto-poky/scripts/lib/recipetool/create_kernel.py99
-rw-r--r--import-layers/yocto-poky/scripts/lib/recipetool/create_kmod.py152
-rw-r--r--import-layers/yocto-poky/scripts/lib/recipetool/create_npm.py156
-rw-r--r--import-layers/yocto-poky/scripts/lib/recipetool/newappend.py112
-rw-r--r--import-layers/yocto-poky/scripts/lib/recipetool/setvar.py75
-rw-r--r--import-layers/yocto-poky/scripts/lib/scriptpath.py42
-rw-r--r--import-layers/yocto-poky/scripts/lib/scriptutils.py118
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/__init__.py4
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/__version__.py1
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/canned-wks/common.wks.inc3
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/canned-wks/directdisk-bootloader-config.cfg11
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/canned-wks/directdisk-bootloader-config.wks8
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/canned-wks/directdisk-gpt.wks10
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/canned-wks/directdisk-multi-rootfs.wks23
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/canned-wks/directdisk.wks8
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/canned-wks/mkefidisk.wks11
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/canned-wks/mkgummidisk.wks11
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/canned-wks/mkhybridiso.wks7
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/canned-wks/qemux86-directdisk.wks8
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/canned-wks/sdimage-bootpart.wks6
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/conf.py103
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/config/wic.conf6
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/creator.py124
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/engine.py220
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/help.py777
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/imager/__init__.py0
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/imager/baseimager.py192
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/imager/direct.py380
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/ksparser.py169
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/msger.py309
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/partition.py414
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/plugin.py150
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/pluginbase.py108
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/plugins/imager/direct_plugin.py102
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/plugins/source/bootimg-efi.py237
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/plugins/source/bootimg-partition.py140
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/plugins/source/bootimg-pcbios.py210
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/plugins/source/fsimage.py73
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/plugins/source/isoimage-isohybrid.py539
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/plugins/source/rawcopy.py88
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/plugins/source/rootfs.py83
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py177
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/test1
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/utils/__init__.py0
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/utils/errors.py29
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/utils/fs_related.py84
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/utils/misc.py95
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/utils/oe/__init__.py22
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/utils/oe/misc.py250
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/utils/partitionedfs.py360
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/utils/runner.py110
-rw-r--r--import-layers/yocto-poky/scripts/lib/wic/utils/syslinux.py58
-rwxr-xr-ximport-layers/yocto-poky/scripts/lnr21
-rw-r--r--import-layers/yocto-poky/scripts/multilib_header_wrapper.h55
-rwxr-xr-ximport-layers/yocto-poky/scripts/native-intercept/chown2
-rwxr-xr-ximport-layers/yocto-poky/scripts/oe-buildenv-internal121
-rwxr-xr-ximport-layers/yocto-poky/scripts/oe-find-native-sysroot81
-rwxr-xr-ximport-layers/yocto-poky/scripts/oe-git-proxy159
-rwxr-xr-ximport-layers/yocto-poky/scripts/oe-pkgdata-util525
-rwxr-xr-ximport-layers/yocto-poky/scripts/oe-publish-sdk155
-rwxr-xr-ximport-layers/yocto-poky/scripts/oe-selftest636
-rwxr-xr-ximport-layers/yocto-poky/scripts/oe-setup-builddir139
-rwxr-xr-ximport-layers/yocto-poky/scripts/oe-setup-rpmrepo97
-rwxr-xr-ximport-layers/yocto-poky/scripts/oe-trim-schemas49
-rwxr-xr-ximport-layers/yocto-poky/scripts/oepydevshell-internal.py92
-rwxr-xr-ximport-layers/yocto-poky/scripts/opkg-query-helper.py85
-rwxr-xr-ximport-layers/yocto-poky/scripts/postinst-intercepts/postinst_intercept56
-rw-r--r--import-layers/yocto-poky/scripts/postinst-intercepts/update_font_cache7
-rw-r--r--import-layers/yocto-poky/scripts/postinst-intercepts/update_gio_module_cache7
-rw-r--r--import-layers/yocto-poky/scripts/postinst-intercepts/update_icon_cache13
-rw-r--r--import-layers/yocto-poky/scripts/postinst-intercepts/update_pixbuf_cache11
-rw-r--r--import-layers/yocto-poky/scripts/pybootchartgui/AUTHORS11
-rw-r--r--import-layers/yocto-poky/scripts/pybootchartgui/COPYING340
-rw-r--r--import-layers/yocto-poky/scripts/pybootchartgui/MAINTAINERS3
-rw-r--r--import-layers/yocto-poky/scripts/pybootchartgui/NEWS204
-rw-r--r--import-layers/yocto-poky/scripts/pybootchartgui/README.pybootchart37
-rwxr-xr-ximport-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui.py23
-rw-r--r--import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/__init__.py0
-rw-r--r--import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/batch.py46
-rw-r--r--import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/draw.py894
-rw-r--r--import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/gui.py350
l---------import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/main.py1
-rw-r--r--import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/main.py.in187
-rw-r--r--import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/parsing.py740
-rw-r--r--import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/process_tree.py292
-rw-r--r--import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/samples.py151
-rw-r--r--import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/tests/parser_test.py105
-rw-r--r--import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/tests/process_tree_test.py92
-rwxr-xr-ximport-layers/yocto-poky/scripts/pythondeps250
-rwxr-xr-ximport-layers/yocto-poky/scripts/recipetool121
-rwxr-xr-ximport-layers/yocto-poky/scripts/relocate_sdk.py264
-rw-r--r--import-layers/yocto-poky/scripts/rootfs_rpm-extract-postinst.awk11
-rwxr-xr-ximport-layers/yocto-poky/scripts/rpm2cpio.sh53
-rwxr-xr-ximport-layers/yocto-poky/scripts/runqemu546
-rwxr-xr-ximport-layers/yocto-poky/scripts/runqemu-addptable2image51
-rwxr-xr-ximport-layers/yocto-poky/scripts/runqemu-export-rootfs163
-rwxr-xr-ximport-layers/yocto-poky/scripts/runqemu-extract-sdk104
-rwxr-xr-ximport-layers/yocto-poky/scripts/runqemu-gen-tapdevs100
-rwxr-xr-ximport-layers/yocto-poky/scripts/runqemu-ifdown66
-rwxr-xr-ximport-layers/yocto-poky/scripts/runqemu-ifup121
-rwxr-xr-ximport-layers/yocto-poky/scripts/runqemu-internal717
-rw-r--r--import-layers/yocto-poky/scripts/runqemu.README42
-rwxr-xr-ximport-layers/yocto-poky/scripts/send-error-report200
-rwxr-xr-ximport-layers/yocto-poky/scripts/send-pull-request179
-rwxr-xr-ximport-layers/yocto-poky/scripts/sstate-cache-management.sh469
-rwxr-xr-ximport-layers/yocto-poky/scripts/sstate-diff-machines.sh172
-rwxr-xr-ximport-layers/yocto-poky/scripts/sstate-sysroot-cruft.sh185
-rwxr-xr-ximport-layers/yocto-poky/scripts/swabber-strace-attach31
-rwxr-xr-ximport-layers/yocto-poky/scripts/sysroot-relativelinks.py31
-rwxr-xr-ximport-layers/yocto-poky/scripts/test-dependencies.sh286
-rwxr-xr-ximport-layers/yocto-poky/scripts/test-reexec123
-rwxr-xr-ximport-layers/yocto-poky/scripts/test-remote-image361
-rwxr-xr-ximport-layers/yocto-poky/scripts/tiny/dirsize.py93
-rwxr-xr-ximport-layers/yocto-poky/scripts/tiny/ksize.py165
-rwxr-xr-ximport-layers/yocto-poky/scripts/wic323
-rwxr-xr-ximport-layers/yocto-poky/scripts/wipe-sysroot54
-rwxr-xr-ximport-layers/yocto-poky/scripts/yocto-bsp156
-rwxr-xr-ximport-layers/yocto-poky/scripts/yocto-kernel399
-rwxr-xr-ximport-layers/yocto-poky/scripts/yocto-layer151
5308 files changed, 632856 insertions, 0 deletions
diff --git a/import-layers/yocto-poky/.gitignore b/import-layers/yocto-poky/.gitignore
new file mode 100644
index 000000000..94894d498
--- /dev/null
+++ b/import-layers/yocto-poky/.gitignore
@@ -0,0 +1,27 @@
+*.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/user-manual/user-manual.html
+documentation/user-manual/user-manual.pdf
+documentation/user-manual/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/import-layers/yocto-poky/.templateconf b/import-layers/yocto-poky/.templateconf
new file mode 100644
index 000000000..0fe6f8250
--- /dev/null
+++ b/import-layers/yocto-poky/.templateconf
@@ -0,0 +1,2 @@
+# Template settings
+TEMPLATECONF=${TEMPLATECONF:-meta-poky/conf}
diff --git a/import-layers/yocto-poky/LICENSE b/import-layers/yocto-poky/LICENSE
new file mode 100644
index 000000000..21fa6e6bd
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/README b/import-layers/yocto-poky/README
new file mode 100644
index 000000000..9a526779b
--- /dev/null
+++ b/import-layers/yocto-poky/README
@@ -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.
diff --git a/import-layers/yocto-poky/README.hardware b/import-layers/yocto-poky/README.hardware
new file mode 100644
index 000000000..9c74c5d3c
--- /dev/null
+++ b/import-layers/yocto-poky/README.hardware
@@ -0,0 +1,500 @@
+ Poky Hardware README
+ ====================
+
+This file gives details about using Poky with the reference machines
+supported out of the box. A full list of supported reference target machines
+can be found by looking in the following directories:
+
+ meta/conf/machine/
+ meta-yocto-bsp/conf/machine/
+
+If you are in doubt about using Poky/OpenEmbedded with your hardware, consult
+the documentation for your board/device.
+
+Support for additional devices is normally added by creating BSP layers - 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
+
+Support for physical reference hardware has now been split out into a
+meta-yocto-bsp layer which can be removed separately from other layers if not
+needed.
+
+
+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:
+
+ * ARM (qemuarm)
+ * x86 (qemux86)
+ * x86-64 (qemux86-64)
+ * PowerPC (qemuppc)
+ * MIPS (qemumips)
+
+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.
+
+
+Hardware Reference Boards
+=========================
+
+The following boards are supported by the meta-yocto-bsp layer:
+
+ * Texas Instruments Beaglebone (beaglebone)
+ * Freescale MPC8315E-RDB (mpc8315e-rdb)
+
+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 MACHINE is tested on the following platforms:
+
+Intel Xeon/Core i-Series:
+ + Intel Romley Server: Sandy Bridge Xeon processor, C600 PCH (Patsburg), (Canoe Pass CRB)
+ + Intel Romley Server: Ivy Bridge Xeon processor, C600 PCH (Patsburg), (Intel SDP S2R3)
+ + Intel Crystal Forest Server: Sandy Bridge Xeon processor, DH89xx PCH (Cave Creek), (Stargo CRB)
+ + Intel Chief River Mobile: Ivy Bridge Mobile processor, QM77 PCH (Panther Point-M), (Emerald Lake II CRB, Sabino Canyon CRB)
+ + Intel Huron River Mobile: Sandy Bridge processor, QM67 PCH (Cougar Point), (Emerald Lake CRB, EVOC EC7-1817LNAR board)
+ + Intel Calpella Platform: Core i7 processor, QM57 PCH (Ibex Peak-M), (Red Fort CRB, Emerson MATXM CORE-411-B)
+ + Intel Nehalem/Westmere-EP Server: Xeon 56xx/55xx processors, 5520 chipset, ICH10R IOH (82801), (Hanlan Creek CRB)
+ + Intel Nehalem Workstation: Xeon 56xx/55xx processors, System SC5650SCWS (Greencity CRB)
+ + Intel Picket Post Server: Xeon 56xx/55xx processors (Jasper Forest), 3420 chipset (Ibex Peak), (Osage CRB)
+ + Intel Storage Platform: Sandy Bridge Xeon processor, C600 PCH (Patsburg), (Oak Creek Canyon CRB)
+ + Intel Shark Bay Client Platform: Haswell processor, LynxPoint PCH, (Walnut Canyon CRB, Lava Canyon CRB, Basking Ridge CRB, Flathead Creek CRB)
+ + Intel Shark Bay Ultrabook Platform: Haswell ULT processor, Lynx Point-LP PCH, (WhiteTip Mountain 1 CRB)
+
+Intel Atom platforms:
+ + Intel embedded Menlow: Intel Atom Z510/530 CPU, System Controller Hub US15W (Portwell NANO-8044)
+ + Intel Luna Pier: Intel Atom N4xx/D5xx series CPU (aka: Pineview-D & -M), 82801HM I/O Hub (ICH8M), (Advantech AIMB-212, Moon Creek CRB)
+ + Intel Queens Bay platform: Intel Atom E6xx CPU (aka: Tunnel Creek), Topcliff EG20T I/O Hub (Emerson NITX-315, Crown Bay CRB, Minnow Board)
+ + Intel Fish River Island platform: Intel Atom E6xx CPU (aka: Tunnel Creek), Topcliff EG20T I/O Hub (Kontron KM2M806)
+ + Intel Cedar Trail platform: Intel Atom N2000 & D2000 series CPU (aka: Cedarview), NM10 Express Chipset (Norco kit BIS-6630, Cedar Rock CRB)
+
+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. Without such an option, the BIOS generally boots the device in USB-ZIP
+ mode. To write an image to a USB device that will be bootable in
+ USB-ZIP mode, carry out the following actions:
+
+ a. Determine the geometry of your USB device using fdisk:
+
+ # fdisk /dev/sdb
+ Command (m for help): p
+
+ Disk /dev/sdb: 4011 MB, 4011491328 bytes
+ 124 heads, 62 sectors/track, 1019 cylinders, total 7834944 sectors
+ ...
+
+ Command (m for help): q
+
+ b. Configure the USB device for USB-ZIP mode:
+
+ # mkdiskimage -4 /dev/sdb 1019 124 62
+
+ Where 1019, 124 and 62 are the cylinder, head and sectors/track counts
+ as reported by fdisk (substitute the values reported for your device).
+ When the operation has finished and the access LED (if any) on the
+ device stops flashing, remove and reinsert the device to allow the
+ kernel to detect the new partition layout.
+
+ c. Copy the contents of the image to the USB-ZIP mode device:
+
+ # mkdir /tmp/image
+ # mkdir /tmp/usbkey
+ # mount -o loop core-image-minimal-genericx86.hddimg /tmp/image
+ # mount /dev/sdb4 /tmp/usbkey
+ # cp -rf /tmp/image/* /tmp/usbkey
+
+ d. Install the syslinux boot loader:
+
+ # syslinux /dev/sdb4
+
+ e. Unmount everything:
+
+ # umount /tmp/image
+ # umount /tmp/usbkey
+
+ Install the boot device in the target board and configure the BIOS to boot
+ from it.
+
+ For more details on the USB-ZIP scenario, see the syslinux documentation:
+ http://git.kernel.org/?p=boot/syslinux/syslinux.git;a=blob_plain;f=doc/usbkey.txt;hb=HEAD
+
+
+Texas Instruments Beaglebone (beaglebone)
+=========================================
+
+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
+as root, replacing mmcblk0* with the SD card device on your machine (such as sdc
+if used via a usb card reader):
+
+ 1. Partition and format an SD card:
+ # fdisk -lu /dev/mmcblk0
+
+ Disk /dev/mmcblk0: 3951 MB, 3951034368 bytes
+ 255 heads, 63 sectors/track, 480 cylinders, total 7716864 sectors
+ Units = sectors of 1 * 512 = 512 bytes
+
+ Device Boot Start End Blocks Id System
+ /dev/mmcblk0p1 * 63 144584 72261 c Win95 FAT32 (LBA)
+ /dev/mmcblk0p2 144585 465884 160650 83 Linux
+
+ # mkfs.vfat -F 16 -n "boot" /dev/mmcblk0p1
+ # mke2fs -j -L "root" /dev/mmcblk0p2
+
+ The following assumes the SD card partitions 1 and 2 are mounted at
+ /media/boot and /media/root respectively. Removing the card and reinserting
+ it will do just that on most modern Linux desktop environments.
+
+ The files referenced below are made available after the build in
+ build/tmp/deploy/images.
+
+ 2. Install the boot loaders
+ # cp MLO-beaglebone /media/boot/MLO
+ # cp u-boot-beaglebone.img /media/boot/u-boot.img
+
+ 3. Install the root filesystem
+ # tar x -C /media/root -f core-image-$IMAGE_TYPE-beaglebone.tar.bz2
+
+ 4. If using core-image-base or core-image-sato images, the SD card is ready
+ and rootfs already contains the kernel, modules and device tree (DTB)
+ files necessary to be booted with U-boot's default configuration, so
+ skip directly to step 8.
+ For core-image-minimal, proceed through next steps.
+
+ 5. If using core-image-minimal rootfs, install the modules
+ # tar x -C /media/root -f modules-beaglebone.tgz
+
+ 6. If using core-image-minimal rootfs, install the kernel zImage into /boot
+ directory of rootfs
+ # cp zImage-beaglebone.bin /media/root/boot/zImage
+
+ 7. If using core-image-minimal rootfs, also install device tree (DTB) files
+ into /boot directory of rootfs
+ # cp zImage-am335x-bone.dtb /media/root/boot/am335x-bone.dtb
+ # cp zImage-am335x-boneblack.dtb /media/root/boot/am335x-boneblack.dtb
+
+ 8. Unmount the SD partitions, insert the SD card into the Beaglebone, and
+ boot the Beaglebone
+
+
+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.
+
+--- 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 root ---
+
+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: Mounted USB disk
+------------------------
+
+To boot from the USB disk there are two available partitions on the factory
+USB storage. The rest of this guide assumes that these partitions are left
+intact. If you change the partition scheme, you must update your boot method
+appropriately.
+
+The standard partitions are:
+
+ - 1: vfat partition containing factory kernels
+ - 2: ext3 partition for the root filesystem.
+
+You can place the kernel on either partition 1, or partition 2, but the roofs
+must go on partition 2 (due to its size).
+
+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.
+
+Steps:
+
+ 1. Remove the USB disk from the edgerouter and insert it into a computer
+ that has access to your build artifacts.
+
+ 2. Copy the kernel image to the USB storage (assuming discovered as 'sdb' on
+ the development machine):
+
+ 2a) if booting from vfat
+
+ # mount /dev/sdb1 /mnt
+ # cp tmp/deploy/images/edgerouter/vmlinux /mnt
+ # umount /mnt
+
+ 2b) if booting from ext3
+
+ # mkfs.ext3 -I 128 /dev/sdb2
+ # mount /dev/sdb2 /mnt
+ # mkdir /mnt/boot
+ # cp tmp/deploy/images/edgerouter/vmlinux /mnt/boot
+ # umount /mnt
+
+ 3. Extract the rootfs to the USB storage ext3 partition
+
+ # mount /dev/sdb2 /mnt
+ # tar -xvjpf core-image-minimal-XXX.tar.bz2 -C /mnt
+ # umount /mnt
+
+ 4. Reboot the board and press a key on the terminal when prompted to get to the U-Boot
+ command line:
+
+ 5. Load the kernel and boot:
+
+ 5a) vfat boot
+
+ => fatload usb 0:1 $loadaddr vmlinux
+
+ 5b) ext3 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)
+
+
+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/import-layers/yocto-poky/bitbake/AUTHORS b/import-layers/yocto-poky/bitbake/AUTHORS
new file mode 100644
index 000000000..91fd78fd2
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/COPYING b/import-layers/yocto-poky/bitbake/COPYING
new file mode 100644
index 000000000..d511905c1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/ChangeLog b/import-layers/yocto-poky/bitbake/ChangeLog
new file mode 100644
index 000000000..4ac2a6446
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/HEADER b/import-layers/yocto-poky/bitbake/HEADER
new file mode 100644
index 000000000..9859255df
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/LICENSE b/import-layers/yocto-poky/bitbake/LICENSE
new file mode 100644
index 000000000..a57f9a419
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/LICENSE
@@ -0,0 +1,12 @@
+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 Apache License 2.0.
+
+* jQuery is redistributed under the MIT license.
+
+* QUnit is redistributed under the MIT license.
diff --git a/import-layers/yocto-poky/bitbake/bin/bitbake b/import-layers/yocto-poky/bitbake/bin/bitbake
new file mode 100755
index 000000000..b03683e12
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/bin/bitbake
@@ -0,0 +1,53 @@
+#!/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
+
+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
+
+__version__ = "1.30.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/import-layers/yocto-poky/bitbake/bin/bitbake-diffsigs b/import-layers/yocto-poky/bitbake/bin/bitbake-diffsigs
new file mode 100755
index 000000000..196f0b73e
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/bin/bitbake-diffsigs
@@ -0,0 +1,138 @@
+#!/usr/bin/env python
+
+# bitbake-diffsigs
+# BitBake task signature data comparison utility
+#
+# Copyright (C) 2012-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 fnmatch
+import optparse
+import logging
+
+sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib'))
+
+import bb.tinfoil
+import bb.siggen
+
+def logger_create(name, output=sys.stderr):
+ logger = logging.getLogger(name)
+ console = logging.StreamHandler(output)
+ format = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
+ if output.isatty():
+ format.enable_color()
+ console.setFormatter(format)
+ logger.addHandler(console)
+ logger.setLevel(logging.INFO)
+ return logger
+
+logger = logger_create('bitbake-diffsigs')
+
+def find_compare_task(bbhandler, pn, taskname):
+ """ Find the most recent signature files for the specified PN/task and compare them """
+
+ def get_hashval(siginfo):
+ if siginfo.endswith('.siginfo'):
+ return siginfo.rpartition(':')[2].partition('_')[0]
+ else:
+ return siginfo.rpartition('.')[2]
+
+ 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])[-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)
+ else:
+ # It's possible that latestfiles contain 3 elements and the first two have the same hash value.
+ # In this case, we delete the second element.
+ # The above case is actually the most common one. Because we may have sigdata file and siginfo
+ # file having the same hash value. Comparing such two files makes no sense.
+ if len(latestfiles) == 3:
+ hash0 = get_hashval(latestfiles[0])
+ hash1 = get_hashval(latestfiles[1])
+ if hash0 == hash1:
+ latestfiles.pop(1)
+
+ # Define recursion callback
+ def recursecb(key, hash1, hash2):
+ hashes = [hash1, hash2]
+ hashfiles = bb.siggen.find_siginfo(key, None, hashes, bbhandler.config_data)
+
+ 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
+
+ # Recurse into signature comparison
+ output = bb.siggen.compare_sigfiles(latestfiles[0], latestfiles[1], recursecb)
+ if output:
+ print '\n'.join(output)
+ sys.exit(0)
+
+
+
+parser = optparse.OptionParser(
+ description = "Compares siginfo/sigdata files written out by BitBake",
+ usage = """
+ %prog -t recipename taskname
+ %prog sigdatafile1 sigdatafile2
+ %prog sigdatafile1""")
+
+parser.add_option("-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')
+
+options, args = parser.parse_args(sys.argv)
+
+if options.taskargs:
+ tinfoil = bb.tinfoil.Tinfoil()
+ tinfoil.prepare(config_only = True)
+ find_compare_task(tinfoil, options.taskargs[0], options.taskargs[1])
+else:
+ if len(args) == 1:
+ parser.print_help()
+ else:
+ import cPickle
+ try:
+ if len(args) == 2:
+ output = bb.siggen.dump_sigfile(sys.argv[1])
+ else:
+ output = bb.siggen.compare_sigfiles(sys.argv[1], sys.argv[2])
+ except IOError as e:
+ logger.error(str(e))
+ sys.exit(1)
+ except cPickle.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/import-layers/yocto-poky/bitbake/bin/bitbake-dumpsig b/import-layers/yocto-poky/bitbake/bin/bitbake-dumpsig
new file mode 100755
index 000000000..656d93a5a
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/bin/bitbake-dumpsig
@@ -0,0 +1,65 @@
+#!/usr/bin/env python
+
+# 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
+
+sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib'))
+
+import bb.siggen
+
+def logger_create(name, output=sys.stderr):
+ logger = logging.getLogger(name)
+ console = logging.StreamHandler(output)
+ format = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
+ if output.isatty():
+ format.enable_color()
+ console.setFormatter(format)
+ logger.addHandler(console)
+ logger.setLevel(logging.INFO)
+ return logger
+
+logger = logger_create('bitbake-dumpsig')
+
+parser = optparse.OptionParser(
+ description = "Dumps siginfo/sigdata files written out by BitBake",
+ usage = """
+ %prog sigdatafile""")
+
+options, args = parser.parse_args(sys.argv)
+
+if len(args) == 1:
+ parser.print_help()
+else:
+ import cPickle
+ try:
+ output = bb.siggen.dump_sigfile(args[1])
+ except IOError as e:
+ logger.error(str(e))
+ sys.exit(1)
+ except cPickle.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/import-layers/yocto-poky/bitbake/bin/bitbake-layers b/import-layers/yocto-poky/bitbake/bin/bitbake-layers
new file mode 100755
index 000000000..d47a6690e
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/bin/bitbake-layers
@@ -0,0 +1,1072 @@
+#!/usr/bin/env python
+
+# 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 fnmatch
+from collections import defaultdict
+import argparse
+import re
+import httplib, urlparse, json
+import subprocess
+
+bindir = os.path.dirname(__file__)
+topdir = os.path.dirname(bindir)
+sys.path[0:0] = [os.path.join(topdir, 'lib')]
+
+import bb.cache
+import bb.cooker
+import bb.providers
+import bb.utils
+import bb.tinfoil
+
+
+def logger_create(name, output=sys.stderr):
+ logger = logging.getLogger(name)
+ console = logging.StreamHandler(output)
+ format = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
+ if output.isatty():
+ format.enable_color()
+ console.setFormatter(format)
+ logger.addHandler(console)
+ logger.setLevel(logging.INFO)
+ return logger
+
+logger = logger_create('bitbake-layers', sys.stdout)
+
+class UserError(Exception):
+ pass
+
+class Commands():
+ def __init__(self):
+ self.bbhandler = None
+ self.bblayers = []
+
+ def init_bbhandler(self, config_only = False):
+ if not self.bbhandler:
+ self.bbhandler = bb.tinfoil.Tinfoil(tracking=True)
+ self.bblayers = (self.bbhandler.config_data.getVar('BBLAYERS', True) or "").split()
+ self.bbhandler.prepare(config_only)
+ layerconfs = self.bbhandler.config_data.varhistory.get_variable_items_files('BBFILE_COLLECTIONS', self.bbhandler.config_data)
+ self.bbfile_collections = {layer: os.path.dirname(os.path.dirname(path)) for layer, path in layerconfs.iteritems()}
+
+
+ def do_show_layers(self, args):
+ """show current configured layers"""
+ self.init_bbhandler(config_only = True)
+ logger.plain("%s %s %s" % ("layer".ljust(20), "path".ljust(40), "priority"))
+ logger.plain('=' * 74)
+ for layer, _, regex, pri in self.bbhandler.cooker.recipecache.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 do_add_layer(self, args):
+ """Add a layer to bblayers.conf
+
+Adds the specified layer to bblayers.conf
+"""
+ layerdir = os.path.abspath(args.layerdir)
+ if not os.path.exists(layerdir):
+ sys.stderr.write("Specified layer directory doesn't exist\n")
+ return 1
+
+ layer_conf = os.path.join(layerdir, 'conf', 'layer.conf')
+ if not os.path.exists(layer_conf):
+ sys.stderr.write("Specified layer directory doesn't contain a conf/layer.conf file\n")
+ 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
+
+ (notadded, _) = bb.utils.edit_bblayers_conf(bblayers_conf, layerdir, None)
+ if notadded:
+ for item in notadded:
+ sys.stderr.write("Specified layer %s is already in BBLAYERS\n" % item)
+
+
+ def do_remove_layer(self, args):
+ """Remove a layer from bblayers.conf
+
+Removes the specified layer 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
+
+ if args.layerdir.startswith('*'):
+ layerdir = args.layerdir
+ elif not '/' in args.layerdir:
+ layerdir = '*/%s' % args.layerdir
+ else:
+ layerdir = os.path.abspath(args.layerdir)
+ (_, notremoved) = bb.utils.edit_bblayers_conf(bblayers_conf, None, layerdir)
+ if notremoved:
+ for item in notremoved:
+ sys.stderr.write("No layers matching %s found in BBLAYERS\n" % item)
+ return 1
+
+
+ def get_json_data(self, apiurl):
+ proxy_settings = os.environ.get("http_proxy", None)
+ conn = None
+ _parsedurl = urlparse.urlparse(apiurl)
+ path = _parsedurl.path
+ query = _parsedurl.query
+ def parse_url(url):
+ parsedurl = urlparse.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 = httplib.HTTPConnection(host, port)
+ conn.request("GET", path + "?" + query)
+ else:
+ host, port = parse_url(proxy_settings)
+ conn = httplib.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())
+
+
+ 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.
+"""
+ self.init_bbhandler(config_only = True)
+ apiurl = self.bbhandler.config_data.getVar('BBLAYERS_LAYERINDEX_URL', True)
+ 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.bbhandler.config_data.getVar('BBFILE_COLLECTIONS', True).split():
+ lname = self.bbhandler.config_data.getVar('BBLAYERS_LAYERINDEX_NAME_%s' % collection, True)
+ 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.bbhandler.config_data.getVar('BBLAYERS_FETCH_DIR', True)
+ 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
+ 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 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.
+"""
+ self.init_bbhandler()
+
+ items_listed = self.list_recipes('Overlayed recipes', None, True, args.same_version, args.filenames, True, None)
+
+ # Check for overlayed .bbclass files
+ classes = 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.bbhandler.config_data.getVar('BBPATH', True))
+ 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.
+"""
+ self.init_bbhandler()
+
+ 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.bbhandler.config_data.getVar('BBPATH', True))
+ for classname in inherits:
+ classfile = 'classes/%s.bbclass' % classname
+ if not bb.utils.which(bbpath, classfile, history=False):
+ raise UserError('No class named %s found in BBPATH' % classfile)
+
+ pkg_pn = self.bbhandler.cooker.recipecache.pkg_pn
+ (latest_versions, preferred_versions) = bb.providers.findProviders(self.bbhandler.config_data, self.bbhandler.cooker.recipecache, pkg_pn)
+ allproviders = bb.providers.allProviders(self.bbhandler.cooker.recipecache)
+
+ # 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 = self.bbhandler.cooker.skiplist.keys()
+ skiplist.sort( key=lambda fileitem: self.bbhandler.cooker.collection.calc_bbfile_priority(fileitem) )
+ skiplist.reverse()
+ 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.bbhandler.config_data.getVar('INHERIT', True) or "").split()
+ cls_re = re.compile('classes/')
+
+ preffiles = []
+ items_listed = False
+ for p in sorted(pkg_pn):
+ if pnspec:
+ if not fnmatch.fnmatch(p, pnspec):
+ continue
+
+ if len(allproviders[p]) > 1 or not show_multi_provider_only:
+ pref = preferred_versions[p]
+ realfn = bb.cache.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.bbhandler.cooker.recipecache.pkg_fn:
+ continue
+
+ if inherits:
+ matchcount = 0
+ recipe_inherits = self.bbhandler.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.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 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
+
+ self.init_bbhandler()
+ 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.bbhandler.cooker.collection.overlayed.iterkeys():
+ for of in self.bbhandler.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):
+ 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.warn('Overwriting file %s', fdest)
+ bb.utils.copyfile(f1full, fdest)
+ if ext == '.bb':
+ for append in self.bbhandler.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.bbhandler.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.bbhandler.cooker.recipecache.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.bbhandler.config_data.getVar('BBFILES', True)).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.bbhandler.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 get_layer_name(self, layerdir):
+ return os.path.basename(layerdir.rstrip(os.sep))
+
+ 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 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.
+"""
+ self.init_bbhandler()
+
+ logger.plain('=== Appended recipes ===')
+
+ pnlist = list(self.bbhandler.cooker_data.pkg_pn.keys())
+ pnlist.sort()
+ appends = False
+ for pn in pnlist:
+ if self.show_appends_for_pn(pn):
+ appends = True
+
+ if 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.bbhandler.cooker_data.pkg_pn[pn]
+
+ best = bb.providers.findBestProvider(pn,
+ self.bbhandler.config_data,
+ self.bbhandler.cooker_data,
+ self.bbhandler.cooker_data.pkg_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.bbhandler.cooker.skiplist.iterkeys()]
+ 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.warn('%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.Cache.virtualfn2realfn(filename)
+ if cls:
+ continue
+
+ basename = os.path.basename(filename)
+ appends = self.bbhandler.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(',')
+
+ self.init_bbhandler()
+
+ pkg_fn = self.bbhandler.cooker_data.pkg_fn
+ bbpath = str(self.bbhandler.config_data.getVar('BBPATH', True))
+ 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.bbhandler.config_data.getVar('INHERIT', True) or "").split()
+
+ # The bb's DEPENDS and RDEPENDS
+ for f in pkg_fn:
+ f = bb.cache.Cache.virtualfn2realfn(f)[0]
+ # Get the layername that the file is in
+ layername = self.get_file_layer(f)
+
+ # The DEPENDS
+ deps = self.bbhandler.cooker_data.deps[f]
+ for pn in deps:
+ if pn in self.bbhandler.cooker_data.pkg_pn:
+ best = bb.providers.findBestProvider(pn,
+ self.bbhandler.config_data,
+ self.bbhandler.cooker_data,
+ self.bbhandler.cooker_data.pkg_pn)
+ self.check_cross_depends("DEPENDS", layername, f, best[3], args.filenames, ignore_layers)
+
+ # The RDPENDS
+ all_rdeps = self.bbhandler.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 = bb.providers.getRuntimeProviders(self.bbhandler.cooker_data, rdep)
+ if all_p:
+ if f in all_p:
+ # The recipe provides this one itself, ignore
+ continue
+ best = bb.providers.filterProvidersRunTime(all_p, rdep,
+ self.bbhandler.config_data,
+ self.bbhandler.cooker_data)[0][0]
+ self.check_cross_depends("RDEPENDS", layername, f, best, args.filenames, ignore_layers)
+
+ # The RRECOMMENDS
+ all_rrecs = self.bbhandler.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 = bb.providers.getRuntimeProviders(self.bbhandler.cooker_data, rrec)
+ if all_p:
+ if f in all_p:
+ # The recipe provides this one itself, ignore
+ continue
+ best = bb.providers.filterProvidersRunTime(all_p, rrec,
+ self.bbhandler.config_data,
+ self.bbhandler.cooker_data)[0][0]
+ self.check_cross_depends("RRECOMMENDS", layername, f, best, args.filenames, ignore_layers)
+
+ # The inherit class
+ cls_re = re.compile('classes/')
+ if f in self.bbhandler.cooker_data.inherits:
+ inherits = self.bbhandler.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.bbhandler.cooker_data.pkg_pepvpr:
+ pv = self.bbhandler.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.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 main():
+
+ cmds = Commands()
+
+ def add_command(cmdname, function, *args, **kwargs):
+ # Convert docstring for function to help (one-liner shown in main --help) and description (shown in subcommand --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)
+ return subparser
+
+ parser = argparse.ArgumentParser(description="BitBake layers utility",
+ 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')
+ subparsers = parser.add_subparsers(title='subcommands', metavar='<subcommand>')
+
+ parser_show_layers = add_command('show-layers', cmds.do_show_layers)
+
+ parser_add_layer = add_command('add-layer', cmds.do_add_layer)
+ parser_add_layer.add_argument('layerdir', help='Layer directory to add')
+
+ parser_remove_layer = add_command('remove-layer', cmds.do_remove_layer)
+ parser_remove_layer.add_argument('layerdir', help='Layer directory to remove (wildcards allowed, enclose in quotes to avoid shell expansion)')
+ parser_remove_layer.set_defaults(func=cmds.do_remove_layer)
+
+ parser_show_overlayed = add_command('show-overlayed', cmds.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 = add_command('show-recipes', cmds.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', 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 = add_command('show-appends', cmds.do_show_appends)
+
+ parser_flatten = add_command('flatten', cmds.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')
+
+ parser_show_cross_depends = add_command('show-cross-depends', cmds.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')
+
+ parser_layerindex_fetch = add_command('layerindex-fetch', cmds.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 = add_command('layerindex-show-depends', cmds.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')
+
+ args = parser.parse_args()
+
+ if args.debug:
+ logger.setLevel(logging.DEBUG)
+ elif args.quiet:
+ logger.setLevel(logging.ERROR)
+
+ try:
+ ret = args.func(args)
+ except UserError as err:
+ logger.error(str(err))
+ 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/import-layers/yocto-poky/bitbake/bin/bitbake-prserv b/import-layers/yocto-poky/bitbake/bin/bitbake-prserv
new file mode 100755
index 000000000..03821446b
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/bin/bitbake-prserv
@@ -0,0 +1,55 @@
+#!/usr/bin/env python
+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/import-layers/yocto-poky/bitbake/bin/bitbake-selftest b/import-layers/yocto-poky/bitbake/bin/bitbake-selftest
new file mode 100755
index 000000000..462eb1b2b
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/bin/bitbake-selftest
@@ -0,0 +1,55 @@
+#!/usr/bin/env python
+#
+# 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))
+
+def usage():
+ print('usage: [BB_SKIP_NETTESTS=yes] %s [-v] [testname1 [testname2]...]' % os.path.basename(sys.argv[0]))
+
+verbosity = 1
+
+tests = sys.argv[1:]
+if '-v' in sys.argv:
+ tests.remove('-v')
+ verbosity = 2
+
+if tests:
+ if '--help' in sys.argv[1:]:
+ usage()
+ sys.exit(0)
+else:
+ tests = ["bb.tests.codeparser",
+ "bb.tests.cow",
+ "bb.tests.data",
+ "bb.tests.fetch",
+ "bb.tests.parse",
+ "bb.tests.utils"]
+
+for t in tests:
+ t = '.'.join(t.split('.')[:3])
+ __import__(t)
+
+unittest.main(argv=["bitbake-selftest"] + tests, verbosity=verbosity)
+
diff --git a/import-layers/yocto-poky/bitbake/bin/bitbake-worker b/import-layers/yocto-poky/bitbake/bin/bitbake-worker
new file mode 100755
index 000000000..767a1c033
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/bin/bitbake-worker
@@ -0,0 +1,447 @@
+#!/usr/bin/env python
+
+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
+from multiprocessing import Lock
+
+# 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>':
+ sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
+except:
+ pass
+
+logger = logging.getLogger("BitBake")
+
+try:
+ import cPickle as pickle
+except ImportError:
+ import pickle
+ bb.msg.note(1, bb.msg.domain.Cache, "Importing cPickle failed. Falling back to a very slow implementation.")
+
+
+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 = ""
+
+def worker_fire(event, d):
+ data = "<event>" + pickle.dumps(event) + "</event>"
+ worker_fire_prepickled(data)
+
+def worker_fire_prepickled(event):
+ global worker_queue
+
+ worker_queue = worker_queue + event
+ worker_flush()
+
+def worker_flush():
+ global worker_queue, worker_pipe
+
+ if not worker_queue:
+ return
+
+ try:
+ written = os.write(worker_pipe, worker_queue)
+ worker_queue = worker_queue[written:]
+ except (IOError, OSError) as e:
+ if e.errno != errno.EAGAIN and e.errno != errno.EPIPE:
+ raise
+
+def worker_child_fire(event, d):
+ global worker_pipe
+ global worker_pipe_lock
+
+ data = "<event>" + pickle.dumps(event) + "</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, workerdata, fn, task, taskname, appends, taskdepdata, quieterrors=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]
+
+ # 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 cfg.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:
+ bb.msg.fatal("RunQueue", "fork failed: %d (%s)" % (e.errno, e.strerror))
+
+ 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)
+
+ data.setVar("BB_WORKERCONTEXT", "1")
+ data.setVar("BB_TASKDEPDATA", taskdepdata)
+ data.setVar("BUILDNAME", workerdata["buildname"])
+ data.setVar("DATE", workerdata["date"])
+ data.setVar("TIME", workerdata["time"])
+ bb.parse.siggen.set_taskdata(workerdata["sigdata"])
+ ret = 0
+ try:
+ the_data = bb.cache.Cache.loadDataFull(fn, appends, data)
+ the_data.setVar('BB_TASKHASH', workerdata["runq_hash"][task])
+
+ bb.utils.set_process_name("%s:%s" % (the_data.getVar("PN", True), 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")
+
+ if quieterrors:
+ the_data.setVarFlag(taskname, "quieterrors", "1")
+
+ except Exception as exc:
+ if not quieterrors:
+ logger.critical(str(exc))
+ os._exit(1)
+ try:
+ if cfg.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 envbackup.iteritems():
+ 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 = ""
+
+ def read(self):
+ start = len(self.queue)
+ try:
+ self.queue = self.queue + self.input.read(102400)
+ except (OSError, IOError) as e:
+ if e.errno != errno.EAGAIN:
+ raise
+
+ end = len(self.queue)
+ index = self.queue.find("</event>")
+ while index != -1:
+ worker_fire_prepickled(self.queue[:index+8])
+ self.queue = self.queue[index+8:]
+ index = self.queue.find("</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 = ""
+ self.cookercfg = None
+ self.databuilder = None
+ self.data = 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("cookerconfig", self.handle_cookercfg)
+ self.handle_item("workerdata", self.handle_workerdata)
+ self.handle_item("runtask", self.handle_runtask)
+ self.handle_item("finishnow", self.handle_finishnow)
+ self.handle_item("ping", self.handle_ping)
+ self.handle_item("quit", self.handle_quit)
+
+ for pipe in self.build_pipes:
+ self.build_pipes[pipe].read()
+ if len(self.build_pids):
+ self.process_waitpid()
+ worker_flush()
+
+
+ def handle_item(self, item, func):
+ if self.queue.startswith("<" + item + ">"):
+ index = self.queue.find("</" + item + ">")
+ while index != -1:
+ func(self.queue[(len(item) + 2):index])
+ self.queue = self.queue[(index + len(item) + 3):]
+ index = self.queue.find("</" + item + ">")
+
+ 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_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"]
+ self.data.setVar("PRSERV_HOST", self.workerdata["prhost"])
+
+ def handle_ping(self, _):
+ workerlog_write("Handling ping\n")
+
+ logger.warn("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 = 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.workerdata, fn, task, taskname, appends, taskdepdata, quieterrors)
+
+ 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 None
+ except OSError:
+ return None
+
+ 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("<exitcode>" + pickle.dumps((task, status)) + "</exitcode>")
+
+ def handle_finishnow(self, _):
+ if self.build_pids:
+ logger.info("Sending SIGTERM to remaining %s tasks", len(self.build_pids))
+ for k, v in self.build_pids.iteritems():
+ 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(sys.stdin)
+ 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))
+while len(worker_queue):
+ worker_flush()
+workerlog_write("exitting")
+sys.exit(0)
+
diff --git a/import-layers/yocto-poky/bitbake/bin/bitdoc b/import-layers/yocto-poky/bitbake/bin/bitdoc
new file mode 100755
index 000000000..defb3dd37
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/bin/bitdoc
@@ -0,0 +1,531 @@
+#!/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) 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/import-layers/yocto-poky/bitbake/bin/image-writer b/import-layers/yocto-poky/bitbake/bin/image-writer
new file mode 100755
index 000000000..e30ab45e3
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/bin/image-writer
@@ -0,0 +1,122 @@
+#!/usr/bin/env python
+
+# 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
+
+import os
+import sys
+sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname( \
+ os.path.abspath(__file__))), 'lib'))
+try:
+ import bb
+except RuntimeError as exc:
+ sys.exit(str(exc))
+
+import gtk
+import optparse
+import pygtk
+
+from bb.ui.crumbs.hobwidget import HobAltButton, HobButton
+from bb.ui.crumbs.hig.crumbsmessagedialog import CrumbsMessageDialog
+from bb.ui.crumbs.hig.deployimagedialog import DeployImageDialog
+from bb.ui.crumbs.hig.imageselectiondialog import ImageSelectionDialog
+
+# I put all the fs bitbake supported here. Need more test.
+DEPLOYABLE_IMAGE_TYPES = ["jffs2", "cramfs", "ext2", "ext3", "ext4", "btrfs", "squashfs", "ubi", "vmdk"]
+Title = "USB Image Writer"
+
+class DeployWindow(gtk.Window):
+ def __init__(self, image_path=''):
+ super(DeployWindow, self).__init__()
+
+ if len(image_path) > 0:
+ valid = True
+ if not os.path.exists(image_path):
+ valid = False
+ lbl = "<b>Invalid image file path: %s.</b>\nPress <b>Select Image</b> to select an image." % image_path
+ else:
+ image_path = os.path.abspath(image_path)
+ extend_name = os.path.splitext(image_path)[1][1:]
+ if extend_name not in DEPLOYABLE_IMAGE_TYPES:
+ valid = False
+ lbl = "<b>Undeployable imge type: %s</b>\nPress <b>Select Image</b> to select an image." % extend_name
+
+ if not valid:
+ image_path = ''
+ crumbs_dialog = CrumbsMessageDialog(self, lbl, gtk.STOCK_DIALOG_INFO)
+ button = crumbs_dialog.add_button("Close", gtk.RESPONSE_OK)
+ HobButton.style_button(button)
+ crumbs_dialog.run()
+ crumbs_dialog.destroy()
+
+ self.deploy_dialog = DeployImageDialog(Title, image_path, self,
+ gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT
+ | gtk.DIALOG_NO_SEPARATOR, None, standalone=True)
+ close_button = self.deploy_dialog.add_button("Close", gtk.RESPONSE_NO)
+ HobAltButton.style_button(close_button)
+ close_button.connect('clicked', gtk.main_quit)
+
+ write_button = self.deploy_dialog.add_button("Write USB image", gtk.RESPONSE_YES)
+ HobAltButton.style_button(write_button)
+
+ self.deploy_dialog.connect('select_image_clicked', self.select_image_clicked_cb)
+ self.deploy_dialog.connect('destroy', gtk.main_quit)
+ response = self.deploy_dialog.show()
+
+ def select_image_clicked_cb(self, dialog):
+ cwd = os.getcwd()
+ dialog = ImageSelectionDialog(cwd, DEPLOYABLE_IMAGE_TYPES, Title, self, gtk.FILE_CHOOSER_ACTION_SAVE )
+ button = dialog.add_button("Cancel", gtk.RESPONSE_NO)
+ HobAltButton.style_button(button)
+ button = dialog.add_button("Open", gtk.RESPONSE_YES)
+ HobAltButton.style_button(button)
+ response = dialog.run()
+
+ if response == gtk.RESPONSE_YES:
+ if not dialog.image_names:
+ lbl = "<b>No selections made</b>\nClicked the radio button to select a image."
+ crumbs_dialog = CrumbsMessageDialog(self, lbl, gtk.STOCK_DIALOG_INFO)
+ button = crumbs_dialog.add_button("Close", gtk.RESPONSE_OK)
+ HobButton.style_button(button)
+ crumbs_dialog.run()
+ crumbs_dialog.destroy()
+ dialog.destroy()
+ return
+
+ # get the full path of image
+ image_path = os.path.join(dialog.image_folder, dialog.image_names[0])
+ self.deploy_dialog.set_image_text_buffer(image_path)
+ self.deploy_dialog.set_image_path(image_path)
+
+ dialog.destroy()
+
+def main():
+ parser = optparse.OptionParser(
+ usage = """%prog [-h] [image_file]
+
+%prog writes bootable images to USB devices. You can
+provide the image file on the command line or select it using the GUI.""")
+
+ options, args = parser.parse_args(sys.argv)
+ image_file = args[1] if len(args) > 1 else ''
+ dw = DeployWindow(image_file)
+
+if __name__ == '__main__':
+ try:
+ main()
+ gtk.main()
+ except Exception:
+ import traceback
+ traceback.print_exc()
diff --git a/import-layers/yocto-poky/bitbake/bin/toaster b/import-layers/yocto-poky/bitbake/bin/toaster
new file mode 100755
index 000000000..70c66d2c2
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/bin/toaster
@@ -0,0 +1,276 @@
+#!/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/.
+
+# Usage: source toaster [start|stop]
+# [webport=<port>] [noui] [noweb]
+
+# Helper function to kill a background toaster development server
+
+webserverKillAll()
+{
+ local pidfile
+ 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
+ # Kill processes if they are still running - may happen
+ # in interactive shells
+ ps fux | grep "python.*manage.py runserver" | awk '{print $2}' | xargs kill
+ 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
+ # 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
+
+ $MANAGE checksettings --traceback || retval=1
+
+ if [ $retval -eq 1 ]; then
+ printf "\nError while checking settings; aborting\n"
+ return $retval
+ fi
+
+ echo "Starting webserver..."
+
+ $MANAGE runserver "0.0.0.0:$WEB_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 "Webserver address: http://0.0.0.0:$WEB_PORT/"
+ fi
+
+ return $retval
+}
+
+INSTOPSYSTEM=0
+
+# define the stop command
+stop_system()
+{
+ # prevent reentry
+ if [ $INSTOPSYSTEM -eq 1 ]; then return; fi
+ INSTOPSYSTEM=1
+ if [ -f ${BUILDDIR}/.toasterui.pid ]; then
+ kill `cat ${BUILDDIR}/.toasterui.pid` 2>/dev/null
+ rm ${BUILDDIR}/.toasterui.pid
+ fi
+ webserverKillAll
+ # unset exported variables
+ unset DATABASE_URL
+ unset TOASTER_CONF
+ unset TOASTER_DIR
+ unset BITBAKE_UI
+ unset BBBASEDIR
+ trap - SIGHUP
+ #trap - SIGCHLD
+ INSTOPSYSTEM=0
+}
+
+verify_prereq() {
+ # Verify Django version
+ reqfile=$(python -c "import os; print os.path.realpath('$BBBASEDIR/toaster-requirements.txt')")
+ exp='s/Django\([><=]\+\)\([^,]\+\),\([><=]\+\)\(.\+\)/'
+ exp=$exp'import sys,django;version=django.get_version().split(".");'
+ exp=$exp'sys.exit(not (version \1 "\2".split(".") and version \3 "\4".split(".")))/p'
+ if ! sed -n "$exp" $reqfile | python - ; then
+ req=`grep ^Django $reqfile`
+ echo "This program needs $req"
+ echo "Please install with pip 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=$BBBASEDIR/lib/toaster/manage.py
+OEROOT=`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.
+
+. $OEROOT/.templateconf
+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' must be a directory containing toasterconf.json"
+ return 1
+ fi
+ fi
+fi
+
+if [ "$TOASTER_CONF" = "" ]; then
+ TOASTER_CONF="$TEMPLATECONF/toasterconf.json"
+ export TOASTER_CONF=$(python -c "import os; print os.path.realpath('$TOASTER_CONF')")
+fi
+
+if [ ! -f $TOASTER_CONF ]; then
+ echo "$TOASTER_CONF configuration file not found. Set TOASTER_CONF to specify file or fix .templateconf"
+ return 1
+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
+# note: for future. in order to make this an arbitrary directory, we need to
+# make sure that the toaster.sqlite file doesn't default to `pwd` like it currently does.
+export TOASTER_DIR=`pwd`
+
+WEBSERVER=1
+WEB_PORT="8000"
+unset CMD
+for param in $*; do
+ case $param in
+ noweb )
+ WEBSERVER=0
+ ;;
+ start )
+ CMD=$param
+ ;;
+ stop )
+ CMD=$param
+ ;;
+ webport=*)
+ WEB_PORT="${param#*=}"
+ 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
+# note: for future. in order to make this an arbitrary directory, we need to
+# make sure that the toaster.sqlite file doesn't default to `pwd`
+# like it currently does.
+export TOASTER_DIR=`dirname $BUILDDIR`
+
+# 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
+ if [ -z "$BBSERVER" ]; then
+ CMD="start"
+ else
+ CMD="stop"
+ fi
+fi
+
+echo "The system will $CMD."
+
+# Execute the commands
+
+case $CMD in
+ start )
+ # check if addr:port is not in use
+ if [ "$CMD" == 'start' ]; then
+ $MANAGE checksocket "0.0.0.0:$WEB_PORT" || return 1
+ fi
+
+ # kill Toaster web server if it's alive
+ if [ -e $BUILDDIR/.toastermain.pid ] && kill -0 `cat $BUILDDIR/.toastermain.pid`; then
+ echo "Warning: bitbake appears to be dead, but the Toaster web server is running." 1>&2
+ echo " Something fishy is going on." 1>&2
+ echo "Cleaning up the web server to start from a clean slate."
+ webserverKillAll
+ fi
+
+ # Create configuration file
+ conf=${BUILDDIR}/conf/local.conf
+ line='INHERIT+="toaster buildhistory"'
+ grep -q "$line" $conf || echo $line >> $conf
+
+ if [ $WEBSERVER -gt 0 ] && ! webserverStartAll; then
+ echo "Failed ${CMD}."
+ return 4
+ fi
+ export BITBAKE_UI='toasterui'
+ export DATABASE_URL=`$MANAGE get-dburl`
+ $MANAGE runbuilds & echo $! >${BUILDDIR}/.runbuilds.pid
+ # set fail safe stop system on terminal exit
+ trap stop_system SIGHUP
+ echo "Successful ${CMD}."
+ return 0
+ ;;
+ stop )
+ stop_system
+ echo "Successful ${CMD}."
+ ;;
+esac
diff --git a/import-layers/yocto-poky/bitbake/bin/toaster-eventreplay b/import-layers/yocto-poky/bitbake/bin/toaster-eventreplay
new file mode 100755
index 000000000..615a7aed1
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/bin/toaster-eventreplay
@@ -0,0 +1,174 @@
+#!/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) 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
+
+from __future__ import print_function
+import os
+import sys, logging
+
+# mangle syspath to allow easy import of modules
+sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
+ 'lib'))
+
+
+import bb.cooker
+from bb.ui import toasterui
+import sys
+import logging
+
+import json, pickle
+
+
+class FileReadEventsServerConnection():
+ """ Emulates a connection to a bitbake server that feeds
+ events coming actually read from a saved log file.
+ """
+
+ class MockConnection():
+ """ fill-in for the proxy to the server. we just return generic data
+ """
+ def __init__(self, sc):
+ self._sc = sc
+
+ def runCommand(self, commandArray):
+ """ emulates running a command on the server; only read-only commands are accepted """
+ command_name = commandArray[0]
+
+ if command_name == "getVariable":
+ if commandArray[1] in self._sc._variables:
+ return (self._sc._variables[commandArray[1]]['v'], None)
+ return (None, "Missing variable")
+
+ elif command_name == "getAllKeysWithFlags":
+ dump = {}
+ flaglist = commandArray[1]
+ for k in self._sc._variables.keys():
+ try:
+ if not k.startswith("__"):
+ v = self._sc._variables[k]['v']
+ dump[k] = {
+ 'v' : v ,
+ 'history' : self._sc._variables[k]['history'],
+ }
+ for d in flaglist:
+ dump[k][d] = self._sc._variables[k][d]
+ except Exception as e:
+ print(e)
+ return (dump, None)
+ else:
+ raise Exception("Command %s not implemented" % commandArray[0])
+
+ def terminateServer(self):
+ """ do not do anything """
+ pass
+
+
+
+ class EventReader():
+ def __init__(self, sc):
+ self._sc = sc
+ self.firstraise = 0
+
+ def _create_event(self, line):
+ def _import_class(name):
+ assert len(name) > 0
+ assert "." in name, name
+
+ components = name.strip().split(".")
+ modulename = ".".join(components[:-1])
+ moduleklass = components[-1]
+
+ module = __import__(modulename, fromlist=[str(moduleklass)])
+ return getattr(module, moduleklass)
+
+ # we build a toaster event out of current event log line
+ try:
+ event_data = json.loads(line.strip())
+ event_class = _import_class(event_data['class'])
+ event_object = pickle.loads(json.loads(event_data['vars']))
+ except ValueError as e:
+ print("Failed loading ", line)
+ raise e
+
+ if not isinstance(event_object, event_class):
+ raise Exception("Error loading objects %s class %s ", event_object, event_class)
+
+ return event_object
+
+ def waitEvent(self, timeout):
+
+ nextline = self._sc._eventfile.readline()
+ if len(nextline) == 0:
+ # the build data ended, while toasterui still waits for events.
+ # this happens when the server was abruptly stopped, so we simulate this
+ self.firstraise += 1
+ if self.firstraise == 1:
+ raise KeyboardInterrupt()
+ else:
+ return None
+ else:
+ self._sc.lineno += 1
+ return self._create_event(nextline)
+
+
+ def _readVariables(self, variableline):
+ self._variables = json.loads(variableline.strip())['allvariables']
+
+
+ def __init__(self, file_name):
+ self.connection = FileReadEventsServerConnection.MockConnection(self)
+ self._eventfile = open(file_name, "r")
+
+ # we expect to have the variable dump at the start of the file
+ self.lineno = 1
+ self._readVariables(self._eventfile.readline())
+
+ self.events = FileReadEventsServerConnection.EventReader(self)
+
+
+
+
+
+class MockConfigParameters():
+ """ stand-in for cookerdata.ConfigParameters; as we don't really config a cooker, this
+ serves just to supply needed interfaces for the toaster ui to work """
+ def __init__(self):
+ self.observe_only = True # we can only read files
+
+
+# run toaster ui on our mock bitbake class
+if __name__ == "__main__":
+ if len(sys.argv) < 2:
+ print("Usage: %s event.log " % sys.argv[0])
+ sys.exit(1)
+
+ file_name = sys.argv[-1]
+ mock_connection = FileReadEventsServerConnection(file_name)
+ configParams = MockConfigParameters()
+
+ # run the main program and set exit code to the returned value
+ sys.exit(toasterui.main(mock_connection.connection, mock_connection.events, configParams))
diff --git a/import-layers/yocto-poky/bitbake/contrib/README b/import-layers/yocto-poky/bitbake/contrib/README
new file mode 100644
index 000000000..25e515661
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/contrib/README
@@ -0,0 +1 @@
+This directory is for additional contributed files which may be useful.
diff --git a/import-layers/yocto-poky/bitbake/contrib/bbdev.sh b/import-layers/yocto-poky/bitbake/contrib/bbdev.sh
new file mode 100644
index 000000000..33a78531e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/contrib/dump_cache.py b/import-layers/yocto-poky/bitbake/contrib/dump_cache.py
new file mode 100755
index 000000000..e1f23090b
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/contrib/dump_cache.py
@@ -0,0 +1,68 @@
+#!/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 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.
+
+#
+# This is used for dumping the bb_cache.dat, the output format is:
+# recipe_path PN PV PACKAGES
+#
+import os
+import sys
+import warnings
+
+# 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 cPickle as pickle
+
+def main(argv=None):
+ """
+ Get the mapping for the target recipe.
+ """
+ if len(argv) != 1:
+ print >>sys.stderr, "Error, need one argument!"
+ return 2
+
+ cachefile = argv[0]
+
+ with open(cachefile, "rb") as cachefile:
+ pickled = pickle.Unpickler(cachefile)
+ while cachefile:
+ try:
+ key = pickled.load()
+ val = pickled.load()
+ except Exception:
+ break
+ if isinstance(val, CoreRecipeInfo) and (not val.skipped):
+ pn = val.pn
+ # Filter out the native recipes.
+ if key.startswith('virtual:native:') or pn.endswith("-native"):
+ continue
+
+ # 1.0 is the default version for a no PV recipe.
+ if val.__dict__.has_key("pv"):
+ pv = val.pv
+ else:
+ pv = "1.0"
+
+ print("%s %s %s %s" % (key, pn, pv, ' '.join(val.packages)))
+
+if __name__ == "__main__":
+ sys.exit(main(sys.argv[1:]))
+
diff --git a/import-layers/yocto-poky/bitbake/contrib/vim/ftdetect/bitbake.vim b/import-layers/yocto-poky/bitbake/contrib/vim/ftdetect/bitbake.vim
new file mode 100644
index 000000000..200f8ae49
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/contrib/vim/ftplugin/bitbake.vim b/import-layers/yocto-poky/bitbake/contrib/vim/ftplugin/bitbake.vim
new file mode 100644
index 000000000..db0d75319
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/contrib/vim/ftplugin/bitbake.vim
@@ -0,0 +1,2 @@
+set sts=4 sw=4 et
+set cms=#%s
diff --git a/import-layers/yocto-poky/bitbake/contrib/vim/plugin/newbb.vim b/import-layers/yocto-poky/bitbake/contrib/vim/plugin/newbb.vim
new file mode 100755
index 000000000..874e33805
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/contrib/vim/syntax/bitbake.vim b/import-layers/yocto-poky/bitbake/contrib/vim/syntax/bitbake.vim
new file mode 100644
index 000000000..fb55f9102
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/doc/COPYING.GPL b/import-layers/yocto-poky/bitbake/doc/COPYING.GPL
new file mode 100644
index 000000000..d511905c1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/doc/COPYING.MIT b/import-layers/yocto-poky/bitbake/doc/COPYING.MIT
new file mode 100644
index 000000000..7e7d57413
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/doc/Makefile b/import-layers/yocto-poky/bitbake/doc/Makefile
new file mode 100644
index 000000000..3c28f4b22
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/doc/README b/import-layers/yocto-poky/bitbake/doc/README
new file mode 100644
index 000000000..303cf8eec
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-customization.xsl b/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-customization.xsl
new file mode 100644
index 000000000..5985ea783
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.xml b/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.xml
new file mode 100644
index 000000000..b1b72e0aa
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.xml
@@ -0,0 +1,931 @@
+<!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 "stamp-extra-info" 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 "prefuncs" and "postfuncs" 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>STAMP_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_FUNCTION'><filename>BB_SETSCENE_VERIFY_FUNCTION</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/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.xml b/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.xml
new file mode 100644
index 000000000..f168cfa68
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.xml
@@ -0,0 +1,765 @@
+<!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', True) 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', True)
+ 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.
+ Failing that,
+ <link linkend='var-FILESDIR'><filename>FILESDIR</filename></link>
+ is used to find the appropriate relative file.
+ <note>
+ <filename>FILESDIR</filename> is deprecated and can
+ be replaced with <filename>FILESPATH</filename>.
+ Because <filename>FILESDIR</filename> is likely to be
+ removed, you should not use this variable in any new code.
+ </note>
+ 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>"protocol":</emphasis>
+ The protocol to use, which defaults to "svn".
+ Other options are "svn+ssh" and "rsh".
+ For "rsh", the "rsh" parameter is also used.
+ </para></listitem>
+ <listitem><para><emphasis>"rev":</emphasis>
+ The revision of the source code to checkout.
+ </para></listitem>
+ <listitem><para><emphasis>"date":</emphasis>
+ The date of the source code to checkout.
+ Specific revisions are generally much safer to checkout
+ rather than by date as they do not involve timezones
+ (e.g. they are much more deterministic).
+ </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>"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 two examples using svn:
+ <literallayout class='monospaced'>
+ SRC_URI = "svn://svn.oe.handhelds.org/svn;module=vip;proto=http;rev=667"
+ SRC_URI = "svn://svn.oe.handhelds.org/svn/;module=opie;proto=svn+ssh;date=20060126"
+ </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.
+ </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='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>
+ Perforce (<filename>p4://</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>
+ Repo (<filename>repo://</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/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-hello.xml b/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-hello.xml
new file mode 100644
index 000000000..f6d82b4f3
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-hello.xml
@@ -0,0 +1,505 @@
+<!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 these sources:
+ <itemizedlist>
+ <listitem><para>
+ <ulink url="http://www.mail-archive.com/yocto@yoctoproject.org/msg09379.html">Mailing List post - The BitBake equivalent of "Hello, World!"</ulink>
+ </para></listitem>
+ <listitem><para>
+ <ulink url="http://hambedded.org/blog/2012/11/24/from-bitbake-hello-world-to-an-image/">Hambedded Linux blog post - From Bitbake Hello World to an Image</ulink>
+ </para></listitem>
+ </itemizedlist>
+ </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>,
+ see
+ <ulink url='http://hambedded.org/blog/2012/11/24/from-bitbake-hello-world-to-an-image/#an-overview-of-bitbakeconf'></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'>
+ TMPDIR = "${<link linkend='var-TOPDIR'>TOPDIR</link>}/tmp"
+ <link linkend='var-CACHE'>CACHE</link> = "${TMPDIR}/cache"
+ <link linkend='var-STAMP'>STAMP</link> = "${TMPDIR}/stamps"
+ <link linkend='var-T'>T</link> = "${TMPDIR}/work"
+ <link linkend='var-B'>B</link> = "${TMPDIR}"
+ </literallayout>
+ 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.
+ For more information on the <filename>base.bbclass</filename> file,
+ you can look at
+ <ulink url='http://hambedded.org/blog/2012/11/24/from-bitbake-hello-world-to-an-image/#tasks'></ulink>.
+ </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 adding a layer at
+ <ulink url='http://hambedded.org/blog/2012/11/24/from-bitbake-hello-world-to-an-image/#adding-an-example-layer'></ulink>.
+ </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}/"
+ </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/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-intro.xml b/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-intro.xml
new file mode 100644
index 000000000..7a37edd50
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-intro.xml
@@ -0,0 +1,691 @@
+<!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 or Yocto Project.
+ 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.
+ -a, --tryaltconfigs Continue with builds by trying to use alternative
+ providers where possible.
+ -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 Output more log message data to the terminal.
+ -D, --debug Increase the debug level. 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 (depexp, goggle, hob, knotty
+ or ncurses - default knotty).
+ -t SERVERTYPE, --servertype=SERVERTYPE
+ Choose which server type to use (process or xmlrpc -
+ default process).
+ --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 server to bind to.
+ --no-setscene Do not run any setscene tasks. sstate will be ignored
+ and everything needed, built.
+ --remote-server=REMOTE_SERVER
+ Connect to the specified server.
+ -m, --kill-server Terminate the remote 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.
+ </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='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 four files
+ to the current working directory:
+ <itemizedlist>
+ <listitem><para><emphasis><filename>package-depends.dot</filename>:</emphasis>
+ Shows BitBake's knowledge of dependencies between
+ runtime targets.
+ </para></listitem>
+ <listitem><para><emphasis><filename>pn-depends.dot</filename>:</emphasis>
+ Shows dependencies between build-time targets
+ (i.e. recipes).
+ </para></listitem>
+ <listitem><para><emphasis><filename>task-depends.dot</filename>:</emphasis>
+ Shows dependencies between tasks.
+ </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/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml b/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml
new file mode 100644
index 000000000..6329cd6e4
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml
@@ -0,0 +1,1918 @@
+<!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>
+ </section>
+
+ <section id='variable-expansion'>
+ <title>Variable Expansion</title>
+
+ <para>
+ BitBake supports variables referencing one another's
+ contents using a syntax that is similar to shell scripting.
+ Following is an example that results in <filename>A</filename>
+ containing "aval" and <filename>B</filename> evaluating to
+ "preavalpost" based on that current value of
+ <filename>A</filename>.
+ <literallayout class='monospaced'>
+ A = "aval"
+ B = "pre${A}post"
+ </literallayout>
+ You should realize that whenever <filename>B</filename> is
+ referenced, its evaluation will depend on the state of
+ <filename>A</filename> at that time.
+ Thus, later evaluations of <filename>B</filename> in the
+ previous example could result in different values
+ depending on the value of <filename>A</filename>.
+ </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>
+ </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>
+ </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. <filename>_prepend</filename>, <filename>_append</filename>,
+ and <filename>_remove</filename>).
+ </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>
+ </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='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>
+ </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 "Z X".
+ Finally, applying the override for "foo" results in the conditional
+ variable <filename>A</filename> becoming "Z X" (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
+ <filename>_append</filename> 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 what classes of functionality 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 that can be used by your recipe.
+ </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>
+ </para>
+
+ <para>
+ If necessary, it is possible to inherit a class
+ conditionally 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>
+ 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>
+ 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 <filename>INHERIT</filename> 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>
+ </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", True)
+ }
+ </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.
+ </para>
+
+ <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", True)</filename>.
+ Or, for more complicated expressions, use
+ <filename>d.expand()</filename>.
+ </note>
+ </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', True):
+ 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='anonymous-python-functions'>
+ <title>Anonymous Python Functions</title>
+
+ <para>
+ Sometimes it is useful to run some code during
+ parsing to set variables or to perform other operations
+ programmatically.
+ To do this, you can define an anonymous Python function.
+ Here is an example that conditionally sets a
+ variable based on the value of another variable:
+ <literallayout class='monospaced'>
+ python __anonymous () {
+ if d.getVar('SOMEVAR', True) == 'value':
+ d.setVar('ANOTHERVAR', 'value2')
+ }
+ </literallayout>
+ The "__anonymous" function name is optional, so the
+ following example is functionally equivalent to the above:
+ <literallayout class='monospaced'>
+ python () {
+ if d.getVar('SOMEVAR', True) == 'value':
+ d.setVar('ANOTHERVAR', 'value2')
+ }
+ </literallayout>
+ Because unlike other Python functions anonymous
+ Python functions are executed during parsing, the
+ "d" variable within an anonymous Python function represents
+ the datastore for the entire recipe.
+ Consequently, you can set variable values here and
+ those values can be picked up by other functions.
+ </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 originate as
+ functions and make up the steps that BitBake needs to run
+ for given recipe.
+ Tasks are only supported in recipe (<filename>.bb</filename>
+ or <filename>.inc</filename>) and class
+ (<filename>.bbclass</filename>) files.
+ By convention, task names begin with the string "do_".
+ </para>
+
+ <para>
+ Here is an example of a task that prints out the date:
+ <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>
+ </para>
+
+ <section id='promoting-a-function-to-a-task'>
+ <title>Promoting a Function to a Task</title>
+
+ <para>
+ Any function can be promoted to a task by applying the
+ <filename>addtask</filename> command.
+ The <filename>addtask</filename> command also describes
+ inter-task dependencies.
+ Here is the function from the previous section but with the
+ <filename>addtask</filename> command promoting it to a task
+ and defining 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>
+ In the example, the function is defined and then promoted
+ as a task.
+ The <filename>do_printdate</filename> task becomes a dependency of
+ the <filename>do_build</filename> task, which is the default
+ task.
+ And, the <filename>do_printdate</filename> task is dependent upon
+ the <filename>do_fetch</filename> task.
+ Execution of the <filename>do_build</filename> task results
+ in the <filename>do_printdate</filename> task running first.
+ </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>cleandirs:</emphasis>
+ Empty directories that should created before the task runs.
+ </para></listitem>
+ <listitem><para><emphasis>depends:</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>deptask:</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>dirs:</emphasis>
+ Directories that should be created before the task runs.
+ The last directory listed will be used as the work directory
+ for the task.
+ </para></listitem>
+ <listitem><para><emphasis>lockfiles:</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>noexec:</emphasis>
+ Marks the tasks as being empty and no execution required.
+ The <filename>noexec</filename> flag can be used 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>nostamp:</emphasis>
+ Tells BitBake to not generate a stamp file for a task,
+ which implies the task should always be executed.
+ </para></listitem>
+ <listitem><para><emphasis>postfuncs:</emphasis>
+ List of functions to call after the completion of the task.
+ </para></listitem>
+ <listitem><para><emphasis>prefuncs:</emphasis>
+ List of functions to call before the task executes.
+ </para></listitem>
+ <listitem><para><emphasis>rdepends:</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>rdeptask:</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>recideptask:</emphasis>
+ When set in conjunction with
+ <filename>recrdeptask</filename>, specifies a task that
+ should be inspected for additional dependencies.
+ </para></listitem>
+ <listitem><para><emphasis>recrdeptask:</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>stamp-extra-info:</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>umask:</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>vardeps:</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>vardepsexclude:</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>vardepvalue:</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>vardepvalueexclude:</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 an operation against a given recipe
+ (<filename>*.bb</filename> file), the start of a given task,
+ task failure, task success, and so forth.
+ The intent is to make it easy to do things like email
+ notification on build failure.
+ </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
+ from bb import data
+ print("The name of the Event is %s" % getName(e))
+ print("The file we run for is %s" % data.getVar('FILE', e.data, True))
+ }
+ </literallayout>
+ This event handler gets called every time an event is
+ triggered.
+ A global variable "<filename>e</filename>" is defined and
+ "<filename>e.data</filename>" contains an instance of
+ "<filename>bb.data</filename>".
+ With the <filename>getName(e)</filename> method, one can get
+ the name of the triggered event.
+ </para>
+
+ <para>
+ Because you probably are only interested in a subset of events,
+ you would likely use the <filename>[eventmask]</filename> flag
+ for your event handler to be sure that only certain events
+ trigger the handler.
+ Given the previous example, suppose you only wanted the
+ <filename>bb.build.TaskFailed</filename> event to trigger that
+ event handler.
+ Use the flag as follows:
+ <literallayout class='monospaced'>
+ addhandler myclass_eventhandler
+ myclass_eventhandler[eventmask] = "bb.build.TaskFailed"
+ python myclass_eventhandler() {
+ from bb.event import getName
+ from bb import data
+ print("The name of the Event is %s" % getName(e))
+ print("The file we run for is %s" % data.getVar('FILE', e.data, True))
+ }
+ </literallayout>
+ </para>
+
+ <para>
+ During a standard build, the following common events might occur:
+ <itemizedlist>
+ <listitem><para>
+ <filename>bb.event.ConfigParsed()</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.event.ParseStarted()</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.event.ParseProgress()</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.event.ParseCompleted()</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.event.BuildStarted()</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.build.TaskStarted()</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.build.TaskInvalid()</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.build.TaskFailedSilent()</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.build.TaskFailed()</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.build.TaskSucceeded()</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.event.BuildCompleted()</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.cooker.CookerExit()</filename>
+ </para></listitem>
+ </itemizedlist>
+ Here is a list of other events that occur based on specific requests
+ to the server:
+ <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 operation given multiple processes
+ executing in parallel, BitBake handles dependencies at
+ the task level.
+ BitBake supports a robust method to handle these dependencies.
+ </para>
+
+ <para>
+ This section describes several types of dependency mechanisms.
+ </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>printdate</filename> task is
+ depends on the completion of the <filename>do_fetch</filename>
+ task.
+ And, the <filename>do_build</filename> depends on the completion
+ of the <filename>printdate</filename> task.
+ </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 "deptask" 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 "rdeptask" 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 "recrdeptask" 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>
+ 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 "depends" 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 "rdepends" 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='accessing-datastore-variables-using-python'>
+ <title>Accessing Datastore Variables Using Python</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=False)</filename></entry>
+ <entry align="left">Returns the value of variable "X".
+ Using "expand=True" expands the value.</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".</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".</entry>
+ </row>
+ <row>
+ <entry align="left"><filename>d.delVar("X")</filename></entry>
+ <entry align="left">Deletes the variable "X" from the datastore.</entry>
+ </row>
+ <row>
+ <entry align="left"><filename>d.renameVar("X", "Y")</filename></entry>
+ <entry align="left">Renames the variable "X" to "Y".</entry>
+ </row>
+ <row>
+ <entry align="left"><filename>d.getVarFlag("X", flag, expand=False)</filename></entry>
+ <entry align="left">Gets then named flag from the variable "X".
+ Using "expand=True" expands the named flag.</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".</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".</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".</entry>
+ </row>
+ <row>
+ <entry align="left"><filename>d.delVarFlags("X")</filename></entry>
+ <entry align="left">Deletes all the flags for the variable "X".</entry>
+ </row>
+ <row>
+ <entry align="left"><filename>d.expand(expression)</filename></entry>
+ <entry align="left">Expands variable references in the specified string expression.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ </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>
+ This list is a place holder of content existed from previous work
+ on the manual.
+ Some or all of it probably needs integrated into the subsections
+ that make up this section.
+ For now, I have just provided a short glossary-like description
+ for each variable.
+ Ultimately, this list goes away.
+ <itemizedlist>
+ <listitem><para><filename>STAMP</filename>:
+ The base path to create stamp files.</para></listitem>
+ <listitem><para><filename>STAMPCLEAN</filename>
+ Again, the base path to create stamp files but can use wildcards
+ for matching a range of files for clean operations.
+ </para></listitem>
+ <listitem><para><filename>BB_STAMP_WHITELIST</filename>
+ Lists stamp files that are looked at when the stamp policy
+ is "whitelist".
+ </para></listitem>
+ <listitem><para><filename>BB_STAMP_POLICY</filename>
+ Defines the mode for comparing timestamps of stamp files.
+ </para></listitem>
+ <listitem><para><filename>BB_HASHCHECK_FUNCTION</filename>
+ 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><filename>BB_SETSCENE_VERIFY_FUNCTION</filename>
+ Specifies a function to call that verifies the list of
+ planned task execution before the main task execution
+ happens.
+ </para></listitem>
+ <listitem><para><filename>BB_SETSCENE_DEPVALID</filename>
+ Specifies a function BitBake calls that determines
+ whether BitBake requires a setscene dependency to
+ be met.
+ </para></listitem>
+ <listitem><para><filename>BB_TASKHASH</filename>
+ Within an executing task, this variable holds the hash
+ of the task as returned by the currently enabled
+ signature generator.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+</chapter>
diff --git a/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.xml b/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.xml
new file mode 100644
index 000000000..ae7e4cee8
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.xml
@@ -0,0 +1,2319 @@
+<!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-PACKAGES'>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_FUNCTION'><glossterm>BB_SETSCENE_VERIFY_FUNCTION</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>
+ </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.
+ By default, this location is set to
+ <filename>${COREBASE}</filename>.
+ 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-FILESDIR'><glossterm>FILESDIR</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 if the file
+ was not found using
+ <link linkend='var-FILESPATH'><filename>FILESPATH</filename></link>.
+ <note>
+ The <filename>FILESDIR</filename> variable is
+ deprecated and you should use
+ <filename>FILESPATH</filename> in all new code.
+ </note>
+ </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 to be inherited at
+ this point during parsing.
+ The variable is only valid in configuration files.
+ </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-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-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 = "3.10%"
+ </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>
+ </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-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/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-style.css b/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-style.css
new file mode 100644
index 000000000..65da2a4e3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual.xml b/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual.xml
new file mode 100644
index 000000000..4aef4e72f
--- /dev/null
+++ b/import-layers/yocto-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-2016</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/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/figures/bitbake-title.png b/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/figures/bitbake-title.png
new file mode 100644
index 000000000..cb290154d
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/figures/bitbake-title.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/html.css b/import-layers/yocto-poky/bitbake/doc/bitbake-user-manual/html.css
new file mode 100644
index 000000000..6eedfd318
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/doc/bitbake.1 b/import-layers/yocto-poky/bitbake/doc/bitbake.1
new file mode 100644
index 000000000..a6c8d9727
--- /dev/null
+++ b/import-layers/yocto-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, hob, depexp, goggle 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/import-layers/yocto-poky/bitbake/doc/poky.ent b/import-layers/yocto-poky/bitbake/doc/poky.ent
new file mode 100644
index 000000000..c032e1418
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/doc/template/Vera.ttf b/import-layers/yocto-poky/bitbake/doc/template/Vera.ttf
new file mode 100644
index 000000000..58cd6b5e6
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/doc/template/Vera.ttf
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/doc/template/Vera.xml b/import-layers/yocto-poky/bitbake/doc/template/Vera.xml
new file mode 100644
index 000000000..3c82043e3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/doc/template/VeraMoBd.ttf b/import-layers/yocto-poky/bitbake/doc/template/VeraMoBd.ttf
new file mode 100644
index 000000000..9be6547ed
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/doc/template/VeraMoBd.ttf
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/doc/template/VeraMoBd.xml b/import-layers/yocto-poky/bitbake/doc/template/VeraMoBd.xml
new file mode 100644
index 000000000..9b33107a4
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/doc/template/VeraMono.ttf b/import-layers/yocto-poky/bitbake/doc/template/VeraMono.ttf
new file mode 100644
index 000000000..139f0b431
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/doc/template/VeraMono.ttf
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/doc/template/VeraMono.xml b/import-layers/yocto-poky/bitbake/doc/template/VeraMono.xml
new file mode 100644
index 000000000..3a0a86659
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/doc/template/component.title.xsl b/import-layers/yocto-poky/bitbake/doc/template/component.title.xsl
new file mode 100644
index 000000000..faef04326
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/doc/template/db-pdf.xsl b/import-layers/yocto-poky/bitbake/doc/template/db-pdf.xsl
new file mode 100644
index 000000000..3dd065a57
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/doc/template/division.title.xsl b/import-layers/yocto-poky/bitbake/doc/template/division.title.xsl
new file mode 100644
index 000000000..9c843bc7c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/doc/template/draft.png b/import-layers/yocto-poky/bitbake/doc/template/draft.png
new file mode 100644
index 000000000..53051a9dd
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/doc/template/draft.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/doc/template/fop-config.xml b/import-layers/yocto-poky/bitbake/doc/template/fop-config.xml
new file mode 100644
index 000000000..09cc5ca0f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/doc/template/formal.object.heading.xsl b/import-layers/yocto-poky/bitbake/doc/template/formal.object.heading.xsl
new file mode 100644
index 000000000..4f3900d16
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/doc/template/gloss-permalinks.xsl b/import-layers/yocto-poky/bitbake/doc/template/gloss-permalinks.xsl
new file mode 100644
index 000000000..6bf58116f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/doc/template/permalinks.xsl b/import-layers/yocto-poky/bitbake/doc/template/permalinks.xsl
new file mode 100644
index 000000000..d2a1c1452
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/doc/template/section.title.xsl b/import-layers/yocto-poky/bitbake/doc/template/section.title.xsl
new file mode 100644
index 000000000..5c6ff9a96
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/doc/template/titlepage.templates.xml b/import-layers/yocto-poky/bitbake/doc/template/titlepage.templates.xml
new file mode 100644
index 000000000..38ec11a4c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/doc/tools/docbook-to-pdf b/import-layers/yocto-poky/bitbake/doc/tools/docbook-to-pdf
new file mode 100755
index 000000000..558ded9e0
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/bb/COW.py b/import-layers/yocto-poky/bitbake/lib/bb/COW.py
new file mode 100644
index 000000000..6917ec378
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/COW.py
@@ -0,0 +1,323 @@
+# 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 Amsell
+#
+# 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.
+#
+
+from __future__ import print_function
+import copy
+import types
+ImmutableTypes = (
+ types.NoneType,
+ bool,
+ complex,
+ float,
+ int,
+ long,
+ tuple,
+ frozenset,
+ basestring
+)
+
+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 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 not cls.__dict__.has_key(key):
+ 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 COWDictMeta.has_key(repr(hash(value)))
+
+ 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.has_key('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/import-layers/yocto-poky/bitbake/lib/bb/__init__.py b/import-layers/yocto-poky/bitbake/lib/bb/__init__.py
new file mode 100644
index 000000000..502ad839e
--- /dev/null
+++ b/import-layers/yocto-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.30.0"
+
+import sys
+if sys.version_info < (2, 7, 3):
+ raise RuntimeError("Sorry, python 2.7.3 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, basestring):
+ mainlogger.warn("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.warn(''.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/import-layers/yocto-poky/bitbake/lib/bb/build.py b/import-layers/yocto-poky/bitbake/lib/bb/build.py
new file mode 100644
index 000000000..db5072cb4
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/build.py
@@ -0,0 +1,784 @@
+# 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
+from contextlib import nested
+from bb import 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.
+__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", True)
+ self.taskfile = d.getVar("FILE", True)
+ 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", True), 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 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'"""
+
+ body = d.getVar(func, False)
+ if not body:
+ if body is None:
+ logger.warn("Function %s doesn't exist", func)
+ return
+
+ flags = d.getVarFlags(func)
+ cleandirs = flags.get('cleandirs')
+ if cleandirs:
+ for cdir in d.expand(cleandirs).split():
+ bb.utils.remove(cdir, True)
+ bb.utils.mkdirhier(cdir)
+
+ if 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 = d.getVar('B', True)
+ bb.utils.mkdirhier(adir)
+
+ 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', True)
+
+ # or func allows items to be executed outside of the normal
+ # task set, such as buildhistory
+ task = d.getVar('BB_RUNTASK', True) or func
+ if task == func:
+ taskfunc = task
+ else:
+ taskfunc = "%s.%s" % (task, func)
+
+ runfmt = d.getVar('BB_RUNFMT', True) 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)
+
+_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:
+ 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:
+ pass
+
+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, 0775)
+
+ cmd = runfile
+ if d.getVarFlag(func, 'fakeroot', False):
+ fakerootcmd = d.getVar('FAKEROOT', True)
+ if fakerootcmd:
+ cmd = [fakerootcmd, runfile]
+
+ if bb.msg.loggerDefaultVerbose:
+ logfile = LogTee(logger, sys.stdout)
+ else:
+ logfile = sys.stdout
+
+ def readfifo(data):
+ lines = data.split('\0')
+ for line in lines:
+ splitval = line.split(' ', 1)
+ cmd = splitval[0]
+ if len(splitval) > 1:
+ value = splitval[1]
+ 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)
+
+ tempdir = d.getVar('T', True)
+ fifopath = os.path.join(tempdir, 'fifo.%s' % os.getpid())
+ if os.path.exists(fifopath):
+ os.unlink(fifopath)
+ os.mkfifo(fifopath)
+ with open(fifopath, 'r+') 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', True)
+ 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', True)
+ 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", True)
+ 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", True)
+ 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', True) 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)
+
+ flags = localdata.getVarFlags(task)
+
+ event.fire(TaskStarted(task, logfn, flags, localdata), localdata)
+ 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
+ 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", True) + "-" + 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):
+ """
+ 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', True)
+ file_name = d.getVar('BB_FILENAME', True)
+ extrainfo = d.getVarFlag(taskflagname, 'stamp-extra-info', True) or ""
+
+ if baseonly:
+ return stamp
+
+ 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', True)
+ file_name = d.getVar('BB_FILENAME', True)
+ extrainfo = d.getVarFlag(taskflagname, 'stamp-extra-info', True) 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:
+ 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', True)
+ 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', True) + '.' + 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):
+ """
+ Return the stamp for a given task
+ (d can be a data dict or dataCache)
+ """
+ return stamp_internal(taskname, d, file_name)
+
+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.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)
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/cache.py b/import-layers/yocto-poky/bitbake/lib/bb/cache.py
new file mode 100644
index 000000000..af5b9fbc6
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/cache.py
@@ -0,0 +1,849 @@
+# 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 logging
+from collections import defaultdict
+import bb.utils
+
+logger = logging.getLogger("BitBake.Cache")
+
+try:
+ import cPickle as pickle
+except ImportError:
+ import pickle
+ logger.info("Importing cPickle failed. "
+ "Falling back to a very slow implementation.")
+
+__cache_version__ = "149"
+
+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, True))
+ for var in varlist)
+ if squash:
+ return dict((k,v) for (k,v) in out_dict.iteritems() 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.pn in 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 + [self.pn]:
+ 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.iteritems():
+ 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
+
+
+
+class Cache(object):
+ """
+ BitBake Cache implementation
+ """
+
+ def __init__(self, data, data_hash, caches_array):
+ # 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", True)
+ self.clean = set()
+ self.checked = set()
+ self.depends_cache = {}
+ self.data = None
+ 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, "Using cache in '%s'", self.cachedir)
+ bb.utils.mkdirhier(self.cachedir)
+
+ cache_ok = True
+ if self.caches_array:
+ for cache_class in self.caches_array:
+ if type(cache_class) is type and issubclass(cache_class, RecipeInfoCommon):
+ 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...")
+
+ def load_cachefile(self):
+ # Firstly, using core cache file information for
+ # valid checking
+ with open(self.cachefile, "rb") as cachefile:
+ pickled = pickle.Unpickler(cachefile)
+ 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
+
+
+ cachesize = 0
+ previous_progress = 0
+ previous_percent = 0
+
+ # Calculate the correct cachesize of all those cache files
+ for cache_class in self.caches_array:
+ if type(cache_class) is type and issubclass(cache_class, RecipeInfoCommon):
+ 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:
+ if type(cache_class) is type and issubclass(cache_class, RecipeInfoCommon):
+ cachefile = getCacheFile(self.cachedir, cache_class.cachefile, self.data_hash)
+ with open(cachefile, "rb") as cachefile:
+ pickled = pickle.Unpickler(cachefile)
+ while cachefile:
+ try:
+ key = pickled.load()
+ value = pickled.load()
+ except Exception:
+ break
+ if self.depends_cache.has_key(key):
+ 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
+ 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)
+
+
+ @staticmethod
+ def virtualfn2realfn(virtualfn):
+ """
+ Convert a virtual file name to a real one + the associated subclass keyword
+ """
+
+ fn = virtualfn
+ cls = ""
+ if virtualfn.startswith('virtual:'):
+ elems = virtualfn.split(':')
+ cls = ":".join(elems[1:-1])
+ fn = elems[-1]
+ return (fn, cls)
+
+ @staticmethod
+ def realfn2virtual(realfn, cls):
+ """
+ Convert a real filename + the associated subclass keyword to a virtual filename
+ """
+ if cls == "":
+ return realfn
+ return "virtual:" + cls + ":" + realfn
+
+ @classmethod
+ def loadDataFull(cls, virtualfn, appends, cfgData):
+ """
+ Return a complete set of data for fn.
+ To do this, we need to parse the file.
+ """
+
+ (fn, virtual) = cls.virtualfn2realfn(virtualfn)
+
+ logger.debug(1, "Parsing %s (full)", fn)
+
+ cfgData.setVar("__ONLYFINALISE", virtual or "default")
+ bb_data = cls.load_bbfile(fn, appends, cfgData)
+ return bb_data[virtual]
+
+ @classmethod
+ def parse(cls, filename, appends, configdata, caches_array):
+ """Parse the specified filename, returning the recipe information"""
+ infos = []
+ datastores = cls.load_bbfile(filename, appends, configdata)
+ depends = []
+ for variant, data in sorted(datastores.iteritems(),
+ key=lambda i: i[0],
+ reverse=True):
+ virtualfn = cls.realfn2virtual(filename, variant)
+ depends = depends + (data.getVar("__depends", False) or [])
+ if depends and not variant:
+ data.setVar("__depends", depends)
+
+ info_array = []
+ for cache_class in caches_array:
+ if type(cache_class) is type and issubclass(cache_class, RecipeInfoCommon):
+ info = cache_class(filename, data)
+ info_array.append(info)
+ infos.append((virtualfn, info_array))
+
+ return infos
+
+ def load(self, filename, appends, configdata):
+ """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 = self.realfn2virtual(filename, variant)
+ infos.append((virtualfn, self.depends_cache[virtualfn]))
+ else:
+ logger.debug(1, "Parsing %s", filename)
+ return self.parse(filename, appends, configdata, self.caches_array)
+
+ return cached, infos
+
+ def loadData(self, fn, appends, cfgData, 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, cfgData)
+ 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 = self.realfn2virtual(fn, cls)
+ self.clean.add(virtualfn)
+ if virtualfn not in self.depends_cache:
+ logger.debug(2, "Cache: %s is not cached", 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 = self.realfn2virtual(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
+
+ file_dict = {}
+ pickler_dict = {}
+ for cache_class in self.caches_array:
+ if type(cache_class) is type and issubclass(cache_class, RecipeInfoCommon):
+ cache_class_name = cache_class.__name__
+ cachefile = getCacheFile(self.cachedir, cache_class.cachefile, self.data_hash)
+ file_dict[cache_class_name] = open(cachefile, "wb")
+ pickler_dict[cache_class_name] = pickle.Pickler(file_dict[cache_class_name], pickle.HIGHEST_PROTOCOL)
+
+ pickler_dict['CoreRecipeInfo'].dump(__cache_version__)
+ pickler_dict['CoreRecipeInfo'].dump(bb.__version__)
+
+ try:
+ for key, info_array in self.depends_cache.iteritems():
+ for info in info_array:
+ if isinstance(info, RecipeInfoCommon):
+ cache_class_name = info.__class__.__name__
+ pickler_dict[cache_class_name].dump(key)
+ pickler_dict[cache_class_name].dump(info)
+ finally:
+ for cache_class in self.caches_array:
+ if type(cache_class) is type and issubclass(cache_class, RecipeInfoCommon):
+ cache_class_name = cache_class.__name__
+ file_dict[cache_class_name].close()
+
+ 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 = self.virtualfn2realfn(file_name)[0]
+
+ info_array = []
+ for cache_class in self.caches_array:
+ if type(cache_class) is type and issubclass(cache_class, RecipeInfoCommon):
+ info_array.append(cache_class(realfn, data))
+ self.add_info(file_name, info_array, cacheData, parsed)
+
+ @staticmethod
+ def load_bbfile(bbfile, appends, config):
+ """
+ Load and parse one .bb build file
+ Return the data and whether parsing resulted in the file being skipped
+ """
+ chdir_back = False
+
+ from bb import parse
+
+ # expand tmpdir to include this topdir
+ config.setVar('TMPDIR', config.getVar('TMPDIR', True) or "")
+ bbfile_loc = os.path.abspath(os.path.dirname(bbfile))
+ oldpath = os.path.abspath(os.getcwd())
+ parse.cached_mtime_noerror(bbfile_loc)
+ bb_data = config.createCopy()
+ # 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 = parse.handle(bbfile, bb_data)
+ if chdir_back:
+ os.chdir(oldpath)
+ return bb_data
+ except:
+ if chdir_back:
+ os.chdir(oldpath)
+ raise
+
+
+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 type(cache_class) is type and issubclass(cache_class, RecipeInfoCommon):
+ 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", True) or
+ d.getVar("CACHE", True))
+ 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/import-layers/yocto-poky/bitbake/lib/bb/cache_extra.py b/import-layers/yocto-poky/bitbake/lib/bb/cache_extra.py
new file mode 100644
index 000000000..83f4959d6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/bb/checksum.py b/import-layers/yocto-poky/bitbake/lib/bb/checksum.py
new file mode 100644
index 000000000..2ec964d73
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/checksum.py
@@ -0,0 +1,139 @@
+# 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 bb.utils
+import logging
+from bb.cache import MultiProcessCache
+
+logger = logging.getLogger("BitBake.Cache")
+
+try:
+ import cPickle as pickle
+except ImportError:
+ import pickle
+ logger.info("Importing cPickle failed. "
+ "Falling back to a very slow implementation.")
+
+
+# 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)
+ 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)
+ checksums.append((pth, checksum))
+
+ checksums.sort(key=operator.itemgetter(1))
+ return checksums
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/codeparser.py b/import-layers/yocto-poky/bitbake/lib/bb/codeparser.py
new file mode 100644
index 000000000..3ee4d5622
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/codeparser.py
@@ -0,0 +1,436 @@
+import ast
+import codegen
+import logging
+import os.path
+import bb.utils, bb.data
+from itertools import chain
+from pysh import pyshyacc, pyshlex, sherrors
+from bb.cache import MultiProcessCache
+
+
+logger = logging.getLogger('BitBake.CodeParser')
+
+try:
+ import cPickle as pickle
+except ImportError:
+ import pickle
+ logger.info('Importing cPickle failed. Falling back to a very slow implementation.')
+
+
+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(intern(i))
+ s = frozenset(new)
+ if hash(s) in self.setcache:
+ return self.setcache[hash(s)]
+ self.setcache[hash(s)] = 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"
+ CACHE_VERSION = 7
+
+ 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:
+ self.target.handle(record)
+ self.buffer = []
+
+class PythonParser():
+ getvars = (".getVar", ".appendVar", ".prependVar")
+ containsfuncs = ("bb.utils.contains", "base_contains", "bb.utils.contains_any")
+ 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 in self.containsfuncs:
+ 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)
+ else:
+ self.references.add(node.args[0].s)
+ 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 = hash(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 = hash(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")
+
+ for token in tokens:
+ self.process_tokens(token)
+
+ 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,
+ }
+
+ for token in tokens:
+ 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)
+
+ 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/import-layers/yocto-poky/bitbake/lib/bb/command.py b/import-layers/yocto-poky/bitbake/lib/bb/command.py
new file mode 100644
index 000000000..0559ffc07
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/command.py
@@ -0,0 +1,474 @@
+"""
+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
+"""
+
+import bb.event
+import bb.cooker
+
+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)
+
+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()
+
+ # 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:
+ if getattr(command_method, 'needconfig', False):
+ 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:
+ 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, basestring):
+ 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.expanded_data)
+ elif code:
+ bb.event.fire(CommandExit(code), self.cooker.expanded_data)
+ else:
+ bb.event.fire(CommandCompleted(), self.cooker.expanded_data)
+ self.currentAsyncCommand = None
+ self.cooker.finishcommand()
+
+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.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 getCpuCount(self, command, params):
+ """
+ Get the CPU count on the bitbake server
+ """
+ return bb.utils.cpu_count()
+ getCpuCount.readonly = True
+ getCpuCount.needconfig = False
+
+ def matchFile(self, command, params):
+ fMatch = params[0]
+ return command.cooker.matchFile(fMatch)
+ matchFile.needconfig = False
+
+ def generateNewImage(self, command, params):
+ image = params[0]
+ base_image = params[1]
+ package_queue = params[2]
+ timestamp = params[3]
+ description = params[4]
+ return command.cooker.generateNewImage(image, base_image,
+ package_queue, timestamp, description)
+
+ def ensureDir(self, command, params):
+ directory = params[0]
+ bb.utils.mkdirhier(directory)
+ ensureDir.needconfig = False
+
+ def setVarFile(self, command, params):
+ """
+ Save a variable in a file; used for saving in a configuration file
+ """
+ var = params[0]
+ val = params[1]
+ default_file = params[2]
+ op = params[3]
+ command.cooker.modifyConfigurationVar(var, val, default_file, op)
+ setVarFile.needconfig = False
+
+ def removeVarFile(self, command, params):
+ """
+ Remove a variable declaration from a file
+ """
+ var = params[0]
+ command.cooker.removeConfigurationVar(var)
+ removeVarFile.needconfig = False
+
+ def createConfigFile(self, command, params):
+ """
+ Create an extra configuration file
+ """
+ name = params[0]
+ command.cooker.createConfigFile(name)
+ createConfigFile.needconfig = False
+
+ 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]
+ command.cooker.updateConfigOpts(options, environment)
+ updateConfig.needconfig = False
+
+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]
+
+ 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 findCoreBaseFiles(self, command, params):
+ """
+ Find certain files in COREBASE directory. i.e. Layers
+ """
+ subdir = params[0]
+ filename = params[1]
+
+ command.cooker.findCoreBaseFiles(subdir, filename)
+ command.finishAsyncCommand()
+ findCoreBaseFiles.needcache = False
+
+ 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
+
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/compat.py b/import-layers/yocto-poky/bitbake/lib/bb/compat.py
new file mode 100644
index 000000000..de1923d28
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/bb/cooker.py b/import-layers/yocto-poky/bitbake/lib/bb/cooker.py
new file mode 100644
index 000000000..9b565fc37
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/cooker.py
@@ -0,0 +1,2196 @@
+#!/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.
+
+from __future__ import print_function
+import sys, os, glob, os.path, re, time
+import atexit
+import itertools
+import logging
+import multiprocessing
+import sre_constants
+import threading
+from cStringIO import StringIO
+from contextlib import closing
+from functools import wraps
+from collections import defaultdict
+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
+
+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 = 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, SEND_DEPENDS_TREE, BASEDATASTORE_TRACKING, SEND_SANITYEVENTS] = range(4)
+
+ 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 self._features.next()
+
+
+#============================================================================#
+# BBCooker
+#============================================================================#
+class BBCooker:
+ """
+ Manages one bitbake build run
+ """
+
+ def __init__(self, configuration, featureSet=None):
+ self.recipecache = 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.__mtime_cache = {}
+ bb.parse.BBHandler.cached_statements = {}
+
+ self.initConfigurationData()
+
+ self.inotify_modified_files = []
+
+ def _process_inotify_updates(server, notifier_list, abort):
+ for n in notifier_list:
+ if n.check_events(timeout=0):
+ # read notified events and enqeue them
+ n.read_events()
+ n.process_events()
+ return 1.0
+
+ self.configuration.server_register_idlecallback(_process_inotify_updates, [self.confignotifier, self.notifier])
+
+ self.baseconfig_valid = True
+ self.parsecache_valid = False
+
+ # Take a lock so only one copy of bitbake can run against a given build
+ # directory at a time
+ if not self.lockBitbake():
+ bb.fatal("Only one copy of bitbake should be run against a build directory")
+ try:
+ self.lock.seek(0)
+ self.lock.truncate()
+ if len(configuration.interface) >= 2:
+ self.lock.write("%s:%s\n" % (configuration.interface[0], configuration.interface[1]));
+ self.lock.flush()
+ except:
+ pass
+
+ # TOSTOP must not be set or our children will hang when they output
+ 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)
+
+ 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 config_notifications(self, event):
+ 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 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):
+ if not watcher:
+ watcher = self.watcher
+ for i in deps:
+ watcher.bbwatchedfiles.append(i[0])
+ 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", True)
+
+ 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
+
+ if consolelog:
+ self.data.setVar("BB_CONSOLELOG", consolelog)
+
+ # we log all events to a file if so directed
+ if self.configuration.writeeventlog:
+ import json, pickle
+ DEFAULT_EVENTFILE = self.configuration.writeeventlog
+ class EventLogWriteHandler():
+
+ class EventWriter():
+ def __init__(self, cooker):
+ self.file_inited = None
+ self.cooker = cooker
+ self.event_queue = []
+
+ def init_file(self):
+ try:
+ # delete the old log
+ os.remove(DEFAULT_EVENTFILE)
+ except:
+ pass
+
+ # write current configuration data
+ with open(DEFAULT_EVENTFILE, "w") as f:
+ f.write("%s\n" % json.dumps({ "allvariables" : self.cooker.getAllKeysWithFlags(["doc", "func"])}))
+
+ def write_event(self, event):
+ with open(DEFAULT_EVENTFILE, "a") as f:
+ try:
+ f.write("%s\n" % json.dumps({"class":event.__module__ + "." + event.__class__.__name__, "vars":json.dumps(pickle.dumps(event)) }))
+ except Exception as e:
+ import traceback
+ print(e, traceback.format_exc(e))
+
+
+ def send(self, event):
+ event_class = event.__module__ + "." + event.__class__.__name__
+
+ # init on bb.event.BuildStarted
+ if self.file_inited is None:
+ if event_class == "bb.event.BuildStarted":
+ self.init_file()
+ self.file_inited = True
+
+ # write pending events
+ for e in self.event_queue:
+ self.write_event(e)
+
+ # also write the current event
+ self.write_event(event)
+
+ else:
+ # queue all events until the file is inited
+ self.event_queue.append(event)
+
+ else:
+ # we have the file, just write the event
+ self.write_event(event)
+
+ # set our handler's event processor
+ event = EventWriter(self) # self is the cooker here
+
+
+ # set up cooker features for this mock UI handler
+
+ # we need to write the dependency tree in the log
+ self.featureset.setFeature(CookerFeatures.SEND_DEPENDS_TREE)
+ # register the log file writer as UI Handler
+ bb.event.register_UIHhandler(EventLogWriteHandler())
+
+
+ #
+ # Copy of the data store which has been expanded.
+ # Used for firing events and accessing variables where expansion needs to be accounted for
+ #
+ self.expanded_data = bb.data.createCopy(self.data)
+ bb.data.update_data(self.expanded_data)
+ bb.parse.init_parser(self.expanded_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)
+
+
+ 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 modifyConfigurationVar(self, var, val, default_file, op):
+ if op == "append":
+ self.appendConfigurationVar(var, val, default_file)
+ elif op == "set":
+ self.saveConfigurationVar(var, val, default_file, "=")
+ elif op == "earlyAssign":
+ self.saveConfigurationVar(var, val, default_file, "?=")
+
+
+ def appendConfigurationVar(self, var, val, default_file):
+ #add append var operation to the end of default_file
+ default_file = bb.cookerdata.findConfigFile(default_file, self.data)
+
+ total = "#added by hob"
+ total += "\n%s += \"%s\"\n" % (var, val)
+
+ with open(default_file, 'a') as f:
+ f.write(total)
+
+ #add to history
+ loginfo = {"op":"append", "file":default_file, "line":total.count("\n")}
+ self.data.appendVar(var, val, **loginfo)
+
+ def saveConfigurationVar(self, var, val, default_file, op):
+
+ replaced = False
+ #do not save if nothing changed
+ if str(val) == self.data.getVar(var, False):
+ return
+
+ conf_files = self.data.varhistory.get_variable_files(var)
+
+ #format the value when it is a list
+ if isinstance(val, list):
+ listval = ""
+ for value in val:
+ listval += "%s " % value
+ val = listval
+
+ topdir = self.data.getVar("TOPDIR", False)
+
+ #comment or replace operations made on var
+ for conf_file in conf_files:
+ if topdir in conf_file:
+ with open(conf_file, 'r') as f:
+ contents = f.readlines()
+
+ lines = self.data.varhistory.get_variable_lines(var, conf_file)
+ for line in lines:
+ total = ""
+ i = 0
+ for c in contents:
+ total += c
+ i = i + 1
+ if i==int(line):
+ end_index = len(total)
+ index = total.rfind(var, 0, end_index)
+
+ begin_line = total.count("\n",0,index)
+ end_line = int(line)
+
+ #check if the variable was saved before in the same way
+ #if true it replace the place where the variable was declared
+ #else it comments it
+ if contents[begin_line-1]== "#added by hob\n":
+ contents[begin_line] = "%s %s \"%s\"\n" % (var, op, val)
+ replaced = True
+ else:
+ for ii in range(begin_line, end_line):
+ contents[ii] = "#" + contents[ii]
+
+ with open(conf_file, 'w') as f:
+ f.writelines(contents)
+
+ if replaced == False:
+ #remove var from history
+ self.data.varhistory.del_var_history(var)
+
+ #add var to the end of default_file
+ default_file = bb.cookerdata.findConfigFile(default_file, self.data)
+
+ #add the variable on a single line, to be easy to replace the second time
+ total = "\n#added by hob"
+ total += "\n%s %s \"%s\"\n" % (var, op, val)
+
+ with open(default_file, 'a') as f:
+ f.write(total)
+
+ #add to history
+ loginfo = {"op":"set", "file":default_file, "line":total.count("\n")}
+ self.data.setVar(var, val, **loginfo)
+
+ def removeConfigurationVar(self, var):
+ conf_files = self.data.varhistory.get_variable_files(var)
+ topdir = self.data.getVar("TOPDIR", False)
+
+ for conf_file in conf_files:
+ if topdir in conf_file:
+ with open(conf_file, 'r') as f:
+ contents = f.readlines()
+
+ lines = self.data.varhistory.get_variable_lines(var, conf_file)
+ for line in lines:
+ total = ""
+ i = 0
+ for c in contents:
+ total += c
+ i = i + 1
+ if i==int(line):
+ end_index = len(total)
+ index = total.rfind(var, 0, end_index)
+
+ begin_line = total.count("\n",0,index)
+
+ #check if the variable was saved before in the same way
+ if contents[begin_line-1]== "#added by hob\n":
+ contents[begin_line-1] = contents[begin_line] = "\n"
+ else:
+ contents[begin_line] = "\n"
+ #remove var from history
+ self.data.varhistory.del_var_history(var, conf_file, line)
+ #remove variable
+ self.data.delVar(var)
+
+ with open(conf_file, 'w') as f:
+ f.writelines(contents)
+
+ def createConfigFile(self, name):
+ path = os.getcwd()
+ confpath = os.path.join(path, "conf", name)
+ open(confpath, 'w').close()
+
+ 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", True)
+ if nice:
+ curnice = os.nice(0)
+ nice = int(nice) - curnice
+ buildlog.verbose("Renice to %s " % os.nice(nice))
+
+ if self.recipecache:
+ del self.recipecache
+ self.recipecache = bb.cache.CacheData(self.caches_array)
+
+ self.handleCollections( self.data.getVar("BBFILE_COLLECTIONS", True) )
+
+ def updateConfigOpts(self, options, environment):
+ clean = True
+ for o in options:
+ if o in ['prefile', 'postfile']:
+ clean = False
+ server_val = getattr(self.configuration, "%s_server" % o)
+ if not options[o] and server_val:
+ # restore value provided on server start
+ setattr(self.configuration, o, server_val)
+ continue
+ 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 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 to %s" % (k, environment[k]))
+ self.configuration.env[k] = environment[k]
+ clean = False
+ if not clean:
+ logger.debug(1, "Base environment change, triggering reparse")
+ self.baseconfig_valid = False
+ 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):
+
+ pkg_pn = self.recipecache.pkg_pn
+ (latest_versions, preferred_versions) = bb.providers.findProviders(self.data, self.recipecache, pkg_pn)
+
+ logger.plain("%-35s %25s %25s", "Recipe Name", "Latest Version", "Preferred Version")
+ logger.plain("%-35s %25s %25s\n", "===========", "==============", "=================")
+
+ for p in sorted(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 = []
+
+ 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 = bb.cache.Cache.virtualfn2realfn(buildfile)
+ fn = self.matchFile(fn)
+ fn = bb.cache.Cache.realfn2virtual(fn, cls)
+ elif len(pkgs_to_build) == 1:
+ ignore = self.expanded_data.getVar("ASSUME_PROVIDED", True) or ""
+ if pkgs_to_build[0] in set(ignore.split()):
+ bb.fatal("%s is in ASSUME_PROVIDED" % pkgs_to_build[0])
+
+ taskdata, runlist, pkgs_to_build = self.buildTaskData(pkgs_to_build, None, self.configuration.abort, allowincomplete=True)
+
+ targetid = taskdata.getbuild_id(pkgs_to_build[0])
+ fnid = taskdata.build_targets[targetid][0]
+ fn = taskdata.fn_index[fnid]
+ else:
+ envdata = self.data
+
+ if fn:
+ try:
+ envdata = bb.cache.Cache.loadDataFull(fn, self.collection.get_file_appends(fn), self.data)
+ 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
+ data.update_data(envdata)
+ with closing(StringIO()) as env:
+ data.emit_env(env, envdata, True)
+ logger.plain(env.getvalue())
+
+ # emit the metadata which isnt valid shell
+ data.expandKeys(envdata)
+ for e in envdata.keys():
+ if data.getVarFlag( e, 'python', envdata ):
+ logger.plain("\npython %s () {\n%s}\n", e, envdata.getVar(e, False))
+
+
+ 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
+
+ fulltargetlist = self.checkPackages(pkgs_to_build)
+
+ localdata = data.createCopy(self.data)
+ bb.data.update_data(localdata)
+ bb.data.expandKeys(localdata)
+ taskdata = bb.taskdata.TaskData(abort, skiplist=self.skiplist, allowincomplete=allowincomplete)
+
+ current = 0
+ runlist = []
+ for k in fulltargetlist:
+ ktask = task
+ if ":do_" in k:
+ k2 = k.split(":do_")
+ k = k2[0]
+ ktask = k2[1]
+ taskdata.add_provider(localdata, self.recipecache, k)
+ current += 1
+ if not ktask.startswith("do_"):
+ ktask = "do_%s" % ktask
+ runlist.append([k, ktask])
+ bb.event.fire(bb.event.TreeDataPreparationProgress(current, len(fulltargetlist)), self.data)
+ taskdata.add_unresolved(localdata, self.recipecache)
+ bb.event.fire(bb.event.TreeDataPreparationCompleted(len(fulltargetlist)), self.data)
+ return taskdata, runlist, fulltargetlist
+
+ 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, pkgs_to_build = 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.
+ """
+ runlist, taskdata = self.prepareTreeData(pkgs_to_build, task)
+ rq = bb.runqueue.RunQueue(self, self.data, self.recipecache, taskdata, runlist)
+ rq.rqdata.prepare()
+ return self.buildDependTree(rq, taskdata)
+
+
+ def buildDependTree(self, rq, taskdata):
+ seen_fnids = []
+ 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.recipecache.bbfile_config_priorities
+
+ for name, fn in taskdata.get_providermap().iteritems():
+ pn = self.recipecache.pkg_fn[fn]
+ if name != pn:
+ version = "%s:%s-%s" % self.recipecache.pkg_pepvpr[fn]
+ depend_tree['providermap'][name] = (pn, version)
+
+ for task in xrange(len(rq.rqdata.runq_fnid)):
+ taskname = rq.rqdata.runq_task[task]
+ fnid = rq.rqdata.runq_fnid[task]
+ fn = taskdata.fn_index[fnid]
+ pn = self.recipecache.pkg_fn[fn]
+ version = "%s:%s-%s" % self.recipecache.pkg_pepvpr[fn]
+ if pn not in depend_tree["pn"]:
+ depend_tree["pn"][pn] = {}
+ depend_tree["pn"][pn]["filename"] = fn
+ depend_tree["pn"][pn]["version"] = version
+ depend_tree["pn"][pn]["inherits"] = self.recipecache.inherits.get(fn, 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.recipecache)[ei][fn]
+
+
+ for dep in rq.rqdata.runq_depends[task]:
+ depfn = taskdata.fn_index[rq.rqdata.runq_fnid[dep]]
+ deppn = self.recipecache.pkg_fn[depfn]
+ dotname = "%s.%s" % (pn, rq.rqdata.runq_task[task])
+ if not dotname in depend_tree["tdepends"]:
+ depend_tree["tdepends"][dotname] = []
+ depend_tree["tdepends"][dotname].append("%s.%s" % (deppn, rq.rqdata.runq_task[dep]))
+ if fnid not in seen_fnids:
+ seen_fnids.append(fnid)
+ packages = []
+
+ depend_tree["depends"][pn] = []
+ for dep in taskdata.depids[fnid]:
+ depend_tree["depends"][pn].append(taskdata.build_names_index[dep])
+
+ depend_tree["rdepends-pn"][pn] = []
+ for rdep in taskdata.rdepids[fnid]:
+ depend_tree["rdepends-pn"][pn].append(taskdata.run_names_index[rdep])
+
+ rdepends = self.recipecache.rundeps[fn]
+ 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.recipecache.runrecs[fn]
+ 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"] = fn
+ 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.
+ """
+ _, taskdata = self.prepareTreeData(pkgs_to_build, task)
+ tasks_fnid = []
+ if len(taskdata.tasks_name) != 0:
+ for task in xrange(len(taskdata.tasks_name)):
+ tasks_fnid.append(taskdata.tasks_fnid[task])
+
+ seen_fnids = []
+ 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
+
+ for task in xrange(len(tasks_fnid)):
+ fnid = tasks_fnid[task]
+ fn = taskdata.fn_index[fnid]
+ pn = self.recipecache.pkg_fn[fn]
+
+ if pn not in depend_tree["pn"]:
+ depend_tree["pn"][pn] = {}
+ depend_tree["pn"][pn]["filename"] = fn
+ version = "%s:%s-%s" % self.recipecache.pkg_pepvpr[fn]
+ depend_tree["pn"][pn]["version"] = version
+ rdepends = self.recipecache.rundeps[fn]
+ rrecs = self.recipecache.runrecs[fn]
+ depend_tree["pn"][pn]["inherits"] = self.recipecache.inherits.get(fn, None)
+
+ # for all extra attributes stored, add them to the dependency tree
+ for ei in extra_info:
+ depend_tree["pn"][pn][ei] = vars(self.recipecache)[ei][fn]
+
+ if fnid not in seen_fnids:
+ seen_fnids.append(fnid)
+
+ depend_tree["depends"][pn] = []
+ for dep in taskdata.depids[fnid]:
+ item = taskdata.build_names_index[dep]
+ pn_provider = ""
+ targetid = taskdata.getbuild_id(item)
+ if targetid in taskdata.build_targets and taskdata.build_targets[targetid]:
+ id = taskdata.build_targets[targetid][0]
+ fn_provider = taskdata.fn_index[id]
+ pn_provider = self.recipecache.pkg_fn[fn_provider]
+ else:
+ pn_provider = item
+ depend_tree["depends"][pn].append(pn_provider)
+
+ depend_tree["rdepends-pn"][pn] = []
+ for rdep in taskdata.rdepids[fnid]:
+ item = taskdata.run_names_index[rdep]
+ pn_rprovider = ""
+ targetid = taskdata.getrun_id(item)
+ if targetid in taskdata.run_targets and taskdata.run_targets[targetid]:
+ id = taskdata.run_targets[targetid][0]
+ fn_rprovider = taskdata.fn_index[id]
+ pn_rprovider = self.recipecache.pkg_fn[fn_rprovider]
+ else:
+ pn_rprovider = item
+ 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)
+
+ # Prints a flattened form of package-depends below where subpackages of a package are merged into the main pn
+ depends_file = file('pn-depends.dot', 'w' )
+ buildlist_file = file('pn-buildlist', 'w' )
+ print("digraph depends {", file=depends_file)
+ for pn in depgraph["pn"]:
+ fn = depgraph["pn"][pn]["filename"]
+ version = depgraph["pn"][pn]["version"]
+ print('"%s" [label="%s %s\\n%s"]' % (pn, pn, version, fn), file=depends_file)
+ print("%s" % pn, file=buildlist_file)
+ buildlist_file.close()
+ logger.info("PN build list saved to 'pn-buildlist'")
+ for pn in depgraph["depends"]:
+ for depend in depgraph["depends"][pn]:
+ print('"%s" -> "%s" [style=solid]' % (pn, depend), file=depends_file)
+ for pn in depgraph["rdepends-pn"]:
+ for rdepend in depgraph["rdepends-pn"][pn]:
+ print('"%s" -> "%s" [style=dashed]' % (pn, rdepend), file=depends_file)
+ print("}", file=depends_file)
+ logger.info("PN dependencies saved to 'pn-depends.dot'")
+
+ depends_file = file('package-depends.dot', 'w' )
+ print("digraph depends {", file=depends_file)
+ for package in depgraph["packages"]:
+ pn = depgraph["packages"][package]["pn"]
+ fn = depgraph["packages"][package]["filename"]
+ version = depgraph["packages"][package]["version"]
+ if package == pn:
+ print('"%s" [label="%s %s\\n%s"]' % (pn, pn, version, fn), file=depends_file)
+ else:
+ print('"%s" [label="%s(%s) %s\\n%s"]' % (package, package, pn, version, fn), file=depends_file)
+ for depend in depgraph["depends"][pn]:
+ print('"%s" -> "%s" [style=solid]' % (package, depend), file=depends_file)
+ for package in depgraph["rdepends-pkg"]:
+ for rdepend in depgraph["rdepends-pkg"][package]:
+ print('"%s" -> "%s" [style=dashed]' % (package, rdepend), file=depends_file)
+ for package in depgraph["rrecs-pkg"]:
+ for rdepend in depgraph["rrecs-pkg"][package]:
+ print('"%s" -> "%s" [style=dotted]' % (package, rdepend), file=depends_file)
+ print("}", file=depends_file)
+ logger.info("Package dependencies saved to 'package-depends.dot'")
+
+ tdepends_file = file('task-depends.dot', 'w' )
+ print("digraph depends {", file=tdepends_file)
+ for task in depgraph["tdepends"]:
+ (pn, taskname) = task.rsplit(".", 1)
+ fn = depgraph["pn"][pn]["filename"]
+ version = depgraph["pn"][pn]["version"]
+ print('"%s.%s" [label="%s %s\\n%s\\n%s"]' % (pn, taskname, pn, taskname, version, fn), file=tdepends_file)
+ for dep in depgraph["tdepends"][task]:
+ print('"%s" -> "%s"' % (task, dep), file=tdepends_file)
+ print("}", file=tdepends_file)
+ logger.info("Task dependencies saved to 'task-depends.dot'")
+
+ def show_appends_with_no_recipes(self):
+ # Determine which bbappends haven't been applied
+
+ # First get list of recipes, including skipped
+ recipefns = self.recipecache.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):
+
+ localdata = data.createCopy(self.data)
+ bb.data.update_data(localdata)
+ bb.data.expandKeys(localdata)
+
+ # Handle PREFERRED_PROVIDERS
+ for p in (localdata.getVar('PREFERRED_PROVIDERS', True) or "").split():
+ try:
+ (providee, provider) = p.split(':')
+ except:
+ providerlog.critical("Malformed option in PREFERRED_PROVIDERS variable: %s" % p)
+ continue
+ if providee in self.recipecache.preferred and self.recipecache.preferred[providee] != provider:
+ providerlog.error("conflicting preferences for %s: both %s and %s specified", providee, provider, self.recipecache.preferred[providee])
+ self.recipecache.preferred[providee] = provider
+
+ def findCoreBaseFiles(self, subdir, configfile):
+ corebase = self.data.getVar('COREBASE', True) or ""
+ paths = []
+ for root, dirs, files in os.walk(corebase + '/' + subdir):
+ for d in dirs:
+ configfilepath = os.path.join(root, d, configfile)
+ if os.path.exists(configfilepath):
+ paths.append(os.path.join(root, d))
+
+ if paths:
+ bb.event.fire(bb.event.CoreBaseFilesFound(paths), self.data)
+
+ 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', True).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 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', True).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.recipecache.pkg_fn:
+ inherits = self.recipecache.inherits.get(pfn, None)
+ if inherits and klass in inherits:
+ pkg_list.append(self.recipecache.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.recipecache.bbfile_config_priorities = []
+ if collections:
+ collection_priorities = {}
+ collection_depends = {}
+ collection_list = collections.split()
+ min_prio = 0
+ for c in collection_list:
+ # Get collection priority if defined explicitly
+ priority = self.data.getVar("BBFILE_PRIORITY_%s" % c, True)
+ 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, True)
+ if deps:
+ try:
+ deplist = 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 deplist.iteritems():
+ if dep in collection_list:
+ for opstr in oplist:
+ layerver = self.data.getVar("LAYERVERSION_%s" % dep, True)
+ (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] = deplist.keys()
+ else:
+ collection_depends[c] = []
+
+ # 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, True)
+ if regex == None:
+ parselog.error("BBFILE_PATTERN_%s not defined" % c)
+ errors = True
+ continue
+ 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.recipecache.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()
+ if not self.data.getVar("BUILDNAME", False):
+ self.data.setVar("BUILDNAME", "${DATE}${TIME}")
+ self.data.setVar("BUILDSTART", time.strftime('%m/%d/%Y %H:%M:%S', t))
+ self.data.setVar("DATE", time.strftime('%Y%m%d', t))
+ self.data.setVar("TIME", time.strftime('%H%M%S', t))
+
+ 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.recipecache.bbfile_config_priorities)
+ filelist, masked = self.collection.collect_bbfiles(self.data, self.expanded_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
+ """
+
+ # 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.")
+
+ # 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
+
+ fn, cls = bb.cache.Cache.virtualfn2realfn(buildfile)
+ fn = self.matchFile(fn)
+
+ self.buildSetVars()
+
+ infos = bb.cache.Cache.parse(fn, self.collection.get_file_appends(fn), \
+ self.data,
+ self.caches_array)
+ infos = dict(infos)
+
+ fn = bb.cache.Cache.realfn2virtual(fn, cls)
+ 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.recipecache.add_from_recipeinfo(fn, info_array)
+
+ # Tweak some variables
+ item = info_array[0].pn
+ self.recipecache.ignored_dependencies = set()
+ self.recipecache.bbfile_priority[fn] = 1
+
+ # Remove external dependencies
+ self.recipecache.task_deps[fn]['depends'] = {}
+ self.recipecache.deps[fn] = []
+ self.recipecache.rundeps[fn] = []
+ self.recipecache.runrecs[fn] = []
+
+ # Invalidate task for target if force mode active
+ if self.configuration.force:
+ logger.verbose("Invalidate task %s, %s", task, fn)
+ if not task.startswith("do_"):
+ task = "do_%s" % task
+ bb.parse.siggen.invalidate_task(task, self.recipecache, fn)
+
+ # Setup taskdata structure
+ taskdata = bb.taskdata.TaskData(self.configuration.abort)
+ taskdata.add_provider(self.data, self.recipecache, item)
+
+ buildname = self.data.getVar("BUILDNAME", True)
+ bb.event.fire(bb.event.BuildStarted(buildname, [item]), self.expanded_data)
+
+ # Execute the runqueue
+ if not task.startswith("do_"):
+ task = "do_%s" % task
+ runlist = [[item, task]]
+
+ rq = bb.runqueue.RunQueue(self, self.data, self.recipecache, 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))
+ return False
+
+ if not retval:
+ bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runq_fnid), buildname, item, failures, interrupted), self.expanded_data)
+ self.command.finishAsyncCommand(msg)
+ 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:
+ bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runq_fnid), buildname, targets, failures, interrupted), self.data)
+ self.command.finishAsyncCommand(msg)
+ return False
+ if retval is True:
+ return True
+ return retval
+
+ build.reset_cache()
+ 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
+
+ taskdata, runlist, fulltargetlist = 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 fulltargetlist:
+ if ":" in target:
+ if ":do_" not in target:
+ target = "%s:do_%s" % tuple(target.split(":", 1))
+ else:
+ target = "%s:%s" % (target, task)
+ ntargets.append(target)
+
+ bb.event.fire(bb.event.BuildStarted(buildname, ntargets), self.data)
+
+ rq = bb.runqueue.RunQueue(self, self.data, self.recipecache, 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' : 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 generateNewImage(self, image, base_image, package_queue, timestamp, description):
+ '''
+ Create a new image with a "require"/"inherit" base_image statement
+ '''
+ if timestamp:
+ image_name = os.path.splitext(image)[0]
+ timestr = time.strftime("-%Y%m%d-%H%M%S")
+ dest = image_name + str(timestr) + ".bb"
+ else:
+ if not image.endswith(".bb"):
+ dest = image + ".bb"
+ else:
+ dest = image
+
+ basename = False
+ if base_image:
+ with open(base_image, 'r') as f:
+ require_line = f.readline()
+ p = re.compile("IMAGE_BASENAME *=")
+ for line in f:
+ if p.search(line):
+ basename = True
+
+ with open(dest, "w") as imagefile:
+ if base_image is None:
+ imagefile.write("inherit core-image\n")
+ else:
+ topdir = self.data.getVar("TOPDIR", False)
+ if topdir in base_image:
+ base_image = require_line.split()[1]
+ imagefile.write("require " + base_image + "\n")
+ image_install = "IMAGE_INSTALL = \""
+ for package in package_queue:
+ image_install += str(package) + " "
+ image_install += "\"\n"
+ imagefile.write(image_install)
+
+ description_var = "DESCRIPTION = \"" + description + "\"\n"
+ imagefile.write(description_var)
+
+ if basename:
+ # If this is overwritten in a inherited image, reset it to default
+ image_basename = "IMAGE_BASENAME = \"${PN}\"\n"
+ imagefile.write(image_basename)
+
+ self.state = state.initial
+ if timestamp:
+ return timestr
+
+ 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.baseconfig_valid = True
+ self.parsecache_valid = False
+
+ # 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:
+ self.parseConfiguration ()
+ if CookerFeatures.SEND_SANITYEVENTS in self.featureset:
+ bb.event.fire(bb.event.SanityCheck(False), self.data)
+
+ ignore = self.expanded_data.getVar("ASSUME_PROVIDED", True) or ""
+ self.recipecache.ignored_dependencies = set(ignore.split())
+
+ for dep in self.configuration.extra_assume_provided:
+ self.recipecache.ignored_dependencies.add(dep)
+
+ self.collection = CookerCollectFiles(self.recipecache.bbfile_config_priorities)
+ (filelist, masked) = self.collection.collect_bbfiles(self.data, self.expanded_data)
+
+ 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()
+ self.recipecache.bbfile_priority = self.collection.collection_priorities(self.recipecache.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
+ event = bb.event.ReachableStamps(self.recipecache.stamp)
+ bb.event.fire(event, self.expanded_data)
+ return None
+
+ return True
+
+ def checkPackages(self, pkgs_to_build):
+
+ # Return a copy, don't modify the original
+ pkgs_to_build = pkgs_to_build[:]
+
+ if len(pkgs_to_build) == 0:
+ raise NothingToBuild
+
+ ignore = (self.expanded_data.getVar("ASSUME_PROVIDED", True) or "").split()
+ for pkg in pkgs_to_build:
+ if pkg in ignore:
+ parselog.warn("Explicit target \"%s\" is in ASSUME_PROVIDED, ignoring" % pkg)
+
+ if 'world' in pkgs_to_build:
+ bb.providers.buildWorldTargetList(self.recipecache)
+ pkgs_to_build.remove('world')
+ for t in self.recipecache.world_target:
+ pkgs_to_build.append(t)
+
+ if 'universe' in pkgs_to_build:
+ parselog.warn("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 t in self.recipecache.universe_target:
+ pkgs_to_build.append(t)
+
+ return pkgs_to_build
+
+
+
+
+ def pre_serve(self):
+ # Empty the environment. The environment will be populated as
+ # necessary from the data store.
+ #bb.utils.empty_environment()
+ try:
+ self.prhost = prserv.serv.auto_start(self.data)
+ except prserv.serv.PRServiceConfigError:
+ bb.event.fire(CookerExit(), self.expanded_data)
+ self.state = state.error
+ return
+
+ def post_serve(self):
+ prserv.serv.auto_shutdown(self.data)
+ bb.event.fire(CookerExit(), self.expanded_data)
+ lockfile = self.lock.name
+ self.lock.close()
+ self.lock = None
+
+ while not self.lock:
+ with bb.utils.timeout(3):
+ self.lock = bb.utils.lockfile(lockfile, shared=False, retry=False, block=True)
+ if not self.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)
+
+
+ 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 lockBitbake(self):
+ if not hasattr(self, 'lock'):
+ self.lock = None
+ if self.data:
+ lockfile = self.data.expand("${TOPDIR}/bitbake.lock")
+ if lockfile:
+ self.lock = bb.utils.lockfile(lockfile, False, False)
+ return self.lock
+
+ def unlockBitbake(self):
+ if hasattr(self, 'lock') and self.lock:
+ bb.utils.unlockfile(self.lock)
+
+def server_main(cooker, func, *args):
+ cooker.pre_serve()
+
+ if cooker.configuration.profile:
+ try:
+ import cProfile as profile
+ except:
+ import profile
+ prof = profile.Profile()
+
+ ret = profile.Profile.runcall(prof, func, *args)
+
+ 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 = func(*args)
+
+ cooker.post_serve()
+
+ return ret
+
+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", True) 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)
+
+ # 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)
+
+ bbmask = config.getVar('BBMASK', True)
+
+ if bbmask:
+ # First validate the individual regular expressions and ignore any
+ # that do not compile
+ bbmasks = []
+ for mask in bbmask.split():
+ 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)
+
+ 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 = bb.cache.Cache.virtualfn2realfn(p)
+ priorities[p] = self.calc_bbfile_priority(realfn, matched)
+
+ # Don't show the warning if the BBFILE_PATTERN did match .bbappend files
+ unmatched = set()
+ for _, _, regex, pri in self.bbfile_config_priorities:
+ if not regex in matched:
+ unmatched.add(regex)
+
+ def findmatch(regex):
+ for b in self.bbappends:
+ (bbfile, append) = b
+ if regex.match(append):
+ return True
+ return False
+
+ for unmatch in unmatched.copy():
+ if findmatch(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, True) != '1':
+ collectlog.warn("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, caches_array):
+ 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, bb.cache.Cache.parse(filename, appends, self.cfg, caches_array)
+ 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
+
+ # 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.cfgdata, 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, cooker.caches_array))
+ else:
+ self.fromcache.append((filename, appends))
+ self.toparse = self.total - len(self.fromcache)
+ self.progress_chunk = max(self.toparse / 100, 1)
+
+ self.num_processes = min(int(self.cfgdata.getVar("BB_NUMBER_PARSE_THREADS", True) 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.cfg = self.cfgdata
+ 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, self.cfgdata)
+ 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 = self.results.next()
+ 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
+ _, value, _ = sys.exc_info()
+ logger.error('ExpansionError during parsing %s: %s', value.recipe, str(exc))
+ 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])
+ self.bb_cache.add_info(virtualfn, info_array, self.cooker.recipecache,
+ 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),
+ self.cfgdata, self.cooker.caches_array)
+ for vfn, info_array in infos:
+ self.cooker.recipecache.add_from_recipeinfo(vfn, info_array)
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/cookerdata.py b/import-layers/yocto-poky/bitbake/lib/bb/cookerdata.py
new file mode 100644
index 000000000..50259a9a0
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/cookerdata.py
@@ -0,0 +1,345 @@
+#!/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, sys
+from functools import wraps
+import logging
+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 []
+
+ self.options.tracking = False
+ if hasattr(self.options, "show_environment") and self.options.show_environment:
+ self.options.tracking = True
+
+ 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", "tryaltconfigs", "force", "invalidate_stamp",
+ "verbose", "debug", "dry_run", "dump_signatures",
+ "debug_domains", "extra_assume_provided", "profile",
+ "prefile", "postfile"]:
+ options[o] = getattr(self.options, o)
+
+ ret, error = server.runCommand(["updateConfig", options, environment])
+ 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.prefile_server = []
+ self.postfile_server = []
+ 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.interface = []
+ self.writeeventlog = False
+
+ 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()
+ self.tracking = parameters.tracking
+
+ 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))
+ 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", True)
+ 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
+
+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.data = bb.data.init()
+ if self.tracking:
+ self.data.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.data, self.savedenv, filtered_keys)
+ self.data.setVar("BB_ORIGENV", self.savedenv)
+
+ if worker:
+ self.data.setVar("BB_WORKERCONTEXT", "1")
+
+ def parseBaseConfiguration(self):
+ try:
+ self.parseConfigurationFiles(self.prefiles, self.postfiles)
+ except SyntaxError:
+ 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
+
+ def _findLayerConf(self, data):
+ return findConfigFile("bblayers.conf", data)
+
+ def parseConfigurationFiles(self, prefiles, postfiles):
+ data = self.data
+ bb.parse.init_parser(data)
+
+ # 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', True) or "").split()
+
+ data = bb.data.createCopy(data)
+ approved = bb.utils.approved_variables()
+ for layer in layers:
+ 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 = parse_config_file(os.path.join(layer, "conf", "layer.conf"), data)
+ data.expandVarref('LAYERDIR')
+
+ data.delVar('LAYERDIR')
+
+ if not data.getVar("BBPATH", True):
+ 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', True) 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)
+ handlerln = int(data.getVarFlag(var, "lineno", False))
+ bb.event.register(var, data.getVar(var, False), (data.getVarFlag(var, "eventmask", True) or "").split(), handlerfn, handlerln)
+
+ if data.getVar("BB_WORKERCONTEXT", False) is None:
+ bb.fetch.fetcher_init(data)
+ bb.codeparser.parser_cache_init(data)
+ bb.event.fire(bb.event.ConfigParsed(), data)
+
+ if data.getVar("BB_INVALIDCONF", False) is True:
+ data.setVar("BB_INVALIDCONF", False)
+ self.parseConfigurationFiles(self.prefiles, self.postfiles)
+ return
+
+ bb.parse.init_parser(data)
+ data.setVar('BBINCLUDED',bb.parse.get_file_depends(data))
+ self.data = data
+ self.data_hash = data.get_hash()
+
+
+
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/daemonize.py b/import-layers/yocto-poky/bitbake/lib/bb/daemonize.py
new file mode 100644
index 000000000..346a61858
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/daemonize.py
@@ -0,0 +1,193 @@
+"""
+Python Daemonizing helper
+
+Configurable daemon behaviors:
+
+ 1.) The current working directory set to the "/" directory.
+ 2.) The current file creation mode mask set to 0.
+ 3.) Close all open files (1024).
+ 4.) Redirect standard I/O streams to "/dev/null".
+
+A failed call to fork() now raises an exception.
+
+References:
+ 1) Advanced Programming in the Unix Environment: W. Richard Stevens
+ http://www.apuebook.com/apue3e.html
+ 2) The Linux Programming Interface: Michael Kerrisk
+ http://man7.org/tlpi/index.html
+ 3) Unix Programming Frequently Asked Questions:
+ http://www.faqs.org/faqs/unix-faq/programmer/faq/
+
+Modified to allow a function to be daemonized and return for
+bitbake use by Richard Purdie
+"""
+
+__author__ = "Chad J. Schroeder"
+__copyright__ = "Copyright (C) 2005 Chad J. Schroeder"
+__version__ = "0.2"
+
+# Standard Python modules.
+import os # Miscellaneous OS interfaces.
+import sys # System-specific parameters and functions.
+
+# Default daemon parameters.
+# File mode creation mask of the daemon.
+# For BitBake's children, we do want to inherit the parent umask.
+UMASK = None
+
+# Default maximum for the number of available file descriptors.
+MAXFD = 1024
+
+# The standard I/O file descriptors are redirected to /dev/null by default.
+if (hasattr(os, "devnull")):
+ REDIRECT_TO = os.devnull
+else:
+ REDIRECT_TO = "/dev/null"
+
+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()
+
+ # Is ignoring SIGHUP necessary?
+ #
+ # It's often suggested that the SIGHUP signal should be ignored before
+ # the second fork to avoid premature termination of the process. The
+ # reason is that when the first child terminates, all processes, e.g.
+ # the second child, in the orphaned group will be sent a SIGHUP.
+ #
+ # "However, as part of the session management system, there are exactly
+ # two cases where SIGHUP is sent on the death of a process:
+ #
+ # 1) When the process that dies is the session leader of a session that
+ # is attached to a terminal device, SIGHUP is sent to all processes
+ # in the foreground process group of that terminal device.
+ # 2) When the death of a process causes a process group to become
+ # orphaned, and one or more processes in the orphaned group are
+ # stopped, then SIGHUP and SIGCONT are sent to all members of the
+ # orphaned group." [2]
+ #
+ # The first case can be ignored since the child is guaranteed not to have
+ # a controlling terminal. The second case isn't so easy to dismiss.
+ # The process group is orphaned when the first child terminates and
+ # POSIX.1 requires that every STOPPED process in an orphaned process
+ # group be sent a SIGHUP signal followed by a SIGCONT signal. Since the
+ # second child is not STOPPED though, we can safely forego ignoring the
+ # SIGHUP signal. In any case, there are no ill-effects if it is ignored.
+ #
+ # import signal # Set handlers for asynchronous events.
+ # signal.signal(signal.SIGHUP, signal.SIG_IGN)
+
+ 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): # The second child.
+ # We probably don't want the file mode creation mask inherited from
+ # the parent, so we give the child complete control over permissions.
+ if UMASK is not None:
+ os.umask(UMASK)
+ else:
+ # Parent (the first child) of the second child.
+ os._exit(0)
+ else:
+ # 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().
+ return
+
+ # Close all open file descriptors. This prevents the child from keeping
+ # open any file descriptors inherited from the parent. There is a variety
+ # of methods to accomplish this task. Three are listed below.
+ #
+ # Try the system configuration variable, SC_OPEN_MAX, to obtain the maximum
+ # number of open file descriptors to close. If it doesn't exist, use
+ # the default value (configurable).
+ #
+ # try:
+ # maxfd = os.sysconf("SC_OPEN_MAX")
+ # except (AttributeError, ValueError):
+ # maxfd = MAXFD
+ #
+ # OR
+ #
+ # if (os.sysconf_names.has_key("SC_OPEN_MAX")):
+ # maxfd = os.sysconf("SC_OPEN_MAX")
+ # else:
+ # maxfd = MAXFD
+ #
+ # OR
+ #
+ # Use the getrlimit method to retrieve the maximum file descriptor number
+ # that can be opened by this process. If there is no limit on the
+ # resource, use the default value.
+ #
+ import resource # Resource usage information.
+ maxfd = resource.getrlimit(resource.RLIMIT_NOFILE)[1]
+ if (maxfd == resource.RLIM_INFINITY):
+ maxfd = MAXFD
+
+ # Iterate through and close all file descriptors.
+# for fd in range(0, maxfd):
+# try:
+# os.close(fd)
+# except OSError: # ERROR, fd wasn't open to begin with (ignored)
+# pass
+
+ # Redirect the standard I/O file descriptors to the specified file. Since
+ # the daemon has no controlling terminal, most daemons redirect stdin,
+ # stdout, and stderr to /dev/null. This is done to prevent side-effects
+ # from reads and writes to the standard I/O file descriptors.
+
+ # This call to open is guaranteed to return the lowest file descriptor,
+ # which will be 0 (stdin), since it was closed above.
+# os.open(REDIRECT_TO, os.O_RDWR) # standard input (0)
+
+ # Duplicate standard input to standard output and standard error.
+# os.dup2(0, 1) # standard output (1)
+# os.dup2(0, 2) # standard error (2)
+
+
+ si = file('/dev/null', 'r')
+ so = file(logfile, 'w')
+ se = so
+
+
+ # Replace those fds with our own
+ os.dup2(si.fileno(), sys.stdin.fileno())
+ os.dup2(so.fileno(), sys.stdout.fileno())
+ os.dup2(se.fileno(), sys.stderr.fileno())
+
+ function()
+
+ os._exit(0)
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/data.py b/import-layers/yocto-poky/bitbake/lib/bb/data.py
new file mode 100644
index 000000000..dbc6dea68
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/data.py
@@ -0,0 +1,448 @@
+# 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 setVar(var, value, d):
+ """Set a variable to a given value"""
+ d.setVar(var, value)
+
+
+def getVar(var, d, exp = False):
+ """Gets the value of a variable"""
+ return d.getVar(var, exp)
+
+
+def renameVar(key, newkey, d):
+ """Renames a variable from key to newkey"""
+ d.renameVar(key, newkey)
+
+def delVar(var, d):
+ """Removes a variable from the data set"""
+ d.delVar(var)
+
+def appendVar(var, value, d):
+ """Append additional value to a variable"""
+ d.appendVar(var, value)
+
+def setVarFlag(var, flag, flagvalue, d):
+ """Set a flag for a given variable to a given value"""
+ d.setVarFlag(var, flag, flagvalue)
+
+def getVarFlag(var, flag, d):
+ """Gets given flag from given var"""
+ return d.getVarFlag(var, flag, False)
+
+def delVarFlag(var, flag, d):
+ """Removes a given flag from the variable's flags"""
+ d.delVarFlag(var, flag)
+
+def setVarFlags(var, flags, d):
+ """Set the flags for a given variable
+
+ Note:
+ setVarFlags will not clear previous
+ flags. Think of this method as
+ addVarFlags
+ """
+ d.setVarFlags(var, flags)
+
+def getVarFlags(var, d):
+ """Gets a variable's flags"""
+ return d.getVarFlags(var)
+
+def delVarFlags(var, d):
+ """Removes a variable's flags"""
+ d.delVarFlags(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, True), 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."""
+ if d.getVarFlag(var, "python", False):
+ return False
+
+ export = d.getVarFlag(var, "export", False)
+ unexport = d.getVarFlag(var, "unexport", False)
+ func = d.getVarFlag(var, "func", 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, True)
+ 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 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):
+ for key in exported_keys(d):
+ try:
+ value = d.getVar(key, True)
+ except Exception:
+ pass
+
+ 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 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, True))
+ newdeps |= set((d.getVarFlag(func, "vardeps", True) 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, True))
+ newdeps |= set((d.getVarFlag(dep, "vardeps", True) 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", True) 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", True) 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", "vardepvalueexclude", "postfuncs", "prefuncs", "lineno", "filename"]) or {}
+ vardeps = varflags.get("vardeps")
+ value = d.getVar(key, False)
+
+ def handle_contains(value, contains, d):
+ newvalue = ""
+ for k in sorted(contains):
+ l = (d.getVar(k, True) or "").split()
+ for word in sorted(contains[k]):
+ if word in l:
+ newvalue += "\n%s{%s} = Set" % (k, word)
+ else:
+ newvalue += "\n%s{%s} = Unset" % (k, word)
+ 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.warn("Variable %s contains tabs, please remove these (%s)" % (key, d.getVar("FILE", True)))
+ 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())
+ 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 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', True)
+
+ 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/import-layers/yocto-poky/bitbake/lib/bb/data_smart.py b/import-layers/yocto-poky/bitbake/lib/bb/data_smart.py
new file mode 100644
index 000000000..fa1e79427
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/data_smart.py
@@ -0,0 +1,969 @@
+# 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>.*))?$')
+__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", True)
+ self.references.add(key)
+ if var is not None:
+ return var
+ else:
+ return match.group()
+
+ def python_sub(self, match):
+ code = match.group()[3:-1]
+ 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", True)
+ 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))
+ 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, True)
+ 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 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):
+ if var in self.variables:
+ return self.variables[var]
+ else:
+ return []
+
+ 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, True) 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, basestring): # 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:
+ exc_class, exc, tb = sys.exc_info()
+ raise ExpansionError, ExpansionError(varname, s, exc), tb
+
+ 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", True) or "").split(":") or []
+ self.overridesset = set(self.overrides)
+ self.inoverride = False
+ self.expand_cache = {}
+ newoverrides = (self.getVar("OVERRIDES", True) 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]
+
+ if "_data" not in dest:
+ break
+ dest = dest["_data"]
+
+ 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 '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 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, True), 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, noweakdefault=False, parsing=False):
+ return self.getVarFlag(var, "_content", expand, noweakdefault, parsing)
+
+ def renameVar(self, key, newkey, **loginfo):
+ """
+ Rename the variable key to newkey
+ """
+ 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):
+ 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):
+ 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, noweakdefault=False, parsing=False):
+ local_var = self._findVar(var)
+ value = None
+ if flag == "_content" and var in self.overridedata and not parsing:
+ match = False
+ active = {}
+ self.need_overrides()
+ for (r, o) in self.overridedata[var]:
+ # 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())
+
+ 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):
+ 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.datasmart = 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 != '_data':
+ yield key
+
+ def __iter__(self):
+ deleted = set()
+ overrides = set()
+ def keylist(d):
+ klist = set()
+ for key in d:
+ if key == "_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"])
+
+ 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(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)
+ bb.data.update_data(d)
+
+ config_whitelist = set((d.getVar("BB_HASHCONFIG_WHITELIST", True) 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 []
+ bb_list.sort()
+ 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).hexdigest()
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/event.py b/import-layers/yocto-poky/bitbake/lib/bb/event.py
new file mode 100644
index 000000000..5ffe89eae
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/event.py
@@ -0,0 +1,679 @@
+# 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
+try:
+ import cPickle as pickle
+except ImportError:
+ import pickle
+import logging
+import atexit
+import traceback
+import ast
+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
+
+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
+
+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 _handlers.iteritems():
+ 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
+ console = logging.StreamHandler(sys.stdout)
+ console.setFormatter(BBLogFormatter("%(levelname)s: %(message)s"))
+ logger.handlers = [console]
+
+ # First check to see if we have any proper messages
+ msgprint = False
+ for event in ui_queue:
+ if isinstance(event, logging.LogRecord):
+ if event.levelno > logging.DEBUG:
+ logger.handle(event)
+ msgprint = True
+ if msgprint:
+ return
+
+ # Nope, so just print all of the messages we have (including debug messages)
+ for event in ui_queue:
+ if isinstance(event, logging.LogRecord):
+ logger.handle(event)
+
+def fire_ui_handlers(event, d):
+ if not _uiready:
+ # No UI handlers registered yet, queue up the messages
+ ui_queue.append(event)
+ return
+
+ 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]
+
+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:
+ 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, basestring):
+ 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)
+
+def set_eventfilter(func):
+ global _eventfilter
+ _eventfilter = func
+
+def register_UIHhandler(handler, mainui=False):
+ if mainui:
+ global _uiready
+ _uiready = True
+ 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)
+ return _ui_handler_seq
+
+def unregister_UIHhandler(handlerNum):
+ if handlerNum in _ui_handlers:
+ del _ui_handlers[handlerNum]
+ return
+
+# 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 RecipeEvent(Event):
+ def __init__(self, fn):
+ self.fn = fn
+ Event.__init__(self)
+
+class RecipePreFinalise(RecipeEvent):
+ """ Recipe Parsing Complete but not yet finialised"""
+
+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 bbmake run 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 getCfg(self):
+ return self.data
+
+ def setCfg(self, cfg):
+ self.data = cfg
+
+ 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")
+ cfg = property(getCfg, setCfg, None, "cfg property")
+
+
+
+
+
+class BuildStarted(BuildBase, OperationStarted):
+ """bbmake build run started"""
+ def __init__(self, n, p, failures = 0):
+ OperationStarted.__init__(self, "Building Started")
+ BuildBase.__init__(self, n, p, failures)
+
+class BuildCompleted(BuildBase, OperationCompleted):
+ """bbmake build run 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 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
+
+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
+
+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 CoreBaseFilesFound(Event):
+ """
+ Event when a list of appropriate config files has been generated
+ """
+ def __init__(self, paths):
+ Event.__init__(self)
+ self._paths = paths
+
+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
+ value = str(value)
+ record.bb_exc_info = (etype, value, tb)
+ record.exc_info = None
+ fire(record, None)
+
+ def filter(self, record):
+ record.taskpid = worker_pid
+ return True
+
+class RequestPackageInfo(Event):
+ """
+ Event to request package information
+ """
+
+class PackageInfo(Event):
+ """
+ Package information for GUI
+ """
+ def __init__(self, pkginfolist):
+ Event.__init__(self)
+ self._pkginfolist = pkginfolist
+
+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 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
+ """
+
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/exceptions.py b/import-layers/yocto-poky/bitbake/lib/bb/exceptions.py
new file mode 100644
index 000000000..f182c8fd6
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/exceptions.py
@@ -0,0 +1,91 @@
+from __future__ import absolute_import
+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, basestring):
+ return 'Exited with "%d"' % exc.code
+ return str(exc)
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/__init__.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/__init__.py
new file mode 100644
index 000000000..1fa67020c
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/__init__.py
@@ -0,0 +1,1773 @@
+# 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
+
+from __future__ import absolute_import
+from __future__ import print_function
+import os, re
+import signal
+import logging
+import urllib
+import urlparse
+import bb.persist_data, bb.utils
+import bb.checksum
+from bb import data
+import bb.process
+import subprocess
+
+__version__ = "2"
+_checksum_cache = bb.checksum.FileChecksumCache()
+
+logger = logging.getLogger("BitBake.Fetcher")
+
+try:
+ import cPickle as pickle
+except ImportError:
+ import pickle
+ logger.info("Importing cPickle failed. "
+ "Falling back to a very slow implementation.")
+
+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 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 = urlparse.urlparse(uri)
+ self.scheme = urlp.scheme
+
+ reparse = 0
+
+ # Coerce urlparse to make URI scheme use netloc
+ if not self.scheme in urlparse.uses_netloc:
+ urlparse.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 = urlparse.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.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 = {}
+ 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.quote(self.path)
+
+ @path_quoted.setter
+ def path_quoted(self, path):
+ self.path = urllib.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 = {}
+ 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.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 path:
+ raise MissingParameterError('path', "encoded from the data %s" % str(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
+ # Standardise path to ensure comparisons work
+ while '//' in path:
+ path = path.replace("//", "/")
+ url += "%s" % urllib.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):
+ 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 ud.mirrortarball:
+ # If the source and destination url types differ, must be a mirrortarball mapping
+ basename = os.path.basename(ud.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', True) 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):
+ return [ i.split() for i in (data or "").replace('\\n','\n').split('\n') if i ]
+
+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", True) 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)
+
+ # Log missing sums so user can more easily add them
+ logger.warn('Missing md5 SRC_URI checksum for %s, consider adding to the recipe:\n'
+ 'SRC_URI[%s] = "%s"',
+ ud.localpath, ud.md5_name, md5data)
+ logger.warn('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:
+ return True
+
+ if not os.path.exists(ud.donestamp):
+ return False
+
+ if (not ud.method.supports_checksum(ud) or
+ (origud and not origud.method.supports_checksum(origud))):
+ # done stamp exists, checksums not supported; assume the local file is
+ # current
+ return True
+
+ if not os.path.exists(ud.localpath):
+ # 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
+
+ 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.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.warn("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, pickle.HIGHEST_PROTOCOL)
+ p.dump(checksums)
+ return True
+ except ChecksumError as e:
+ # Checksums failed to verify, trigger re-download and remove the
+ # incorrect stamp file.
+ logger.warn("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, pickle.HIGHEST_PROTOCOL)
+ p.dump(checksums)
+ except ChecksumError as e:
+ # Checksums failed to verify, trigger re-download and remove the
+ # incorrect stamp file.
+ logger.warn("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', True) != "cache":
+ d.setVar('BB_DONT_CACHE', '1')
+ return "AUTOINC"
+
+def get_srcrev(d, method_name='sortable_revision'):
+ """
+ Return the revsion 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', True).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', True)
+ if not format:
+ raise FetchError("The SRCREV_FORMAT variable must be set when multiple SCMs are used.")
+
+ 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]
+ format = format.replace(name, rev)
+ 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):
+ """
+ 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']
+
+ if not cleanup:
+ cleanup = []
+
+ for var in exportvars:
+ val = d.getVar(var, True)
+ if val:
+ cmd = 'export ' + var + '=\"%s\"; %s' % (val, cmd)
+
+ logger.debug(1, "Running %s", cmd)
+
+ success = False
+ error_message = ""
+
+ try:
+ (output, errors) = bb.process.run(cmd, shell=True, stderr=subprocess.PIPE)
+ 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 failed with exit code %s, %s" % (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 = None):
+ """
+ log remote network access, and error if BB_NO_NETWORK is set
+ """
+ if d.getVar("BB_NO_NETWORK", True) == "1":
+ raise NetworkAccess(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):
+ for line in mirrors:
+ try:
+ (find, replace) = line
+ except ValueError:
+ continue
+ newuri = uri_replace(ud, find, replace, replacements, ld)
+ 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)
+ except UnboundLocalError:
+ pass
+ continue
+ uris.append(newuri)
+ uds.append(newud)
+
+ adduri(newud, uris, uds, localmirrors)
+
+ adduri(origud, uris, uds, mirrors)
+
+ 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
+
+ os.chdir(ld.getVar("DL_DIR", True))
+
+ 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", True)
+ if origud.mirrortarball and os.path.basename(ud.localpath) == os.path.basename(origud.mirrortarball) \
+ 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):
+ os.symlink(ud.localpath, dest)
+ 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)
+
+ os.symlink(ud.localpath, origud.localpath)
+ update_stamp(origud, ld)
+ return ud.localpath
+
+ except bb.fetch2.NetworkAccess:
+ raise
+
+ except bb.fetch2.BBFetchException as e:
+ if isinstance(e, ChecksumError):
+ logger.warn("Mirror checksum failure for url %s (original url: %s)\nCleaning and trying again." % (ud.url, origud.url))
+ logger.warn(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', True) == "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', True)
+
+ # 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", True)
+ 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, True)
+ 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 spcify 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', True)
+ 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', True), 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', True), 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.mirrortarball = None
+ self.basename = None
+ self.basepath = None
+ (self.type, self.host, self.path, self.user, self.pswd, self.parm) = decodeurl(data.expand(url, d))
+ 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"]:
+ self.md5_expected = None
+ else:
+ self.md5_expected = d.getVarFlag("SRC_URI", self.md5_name, True)
+ 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"]:
+ self.sha256_expected = None
+ else:
+ self.sha256_expected = d.getVarFlag("SRC_URI", self.sha256_name, True)
+ 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.warn('Consider updating %s recipe to use "protocol" not "proto" in SRC_URI.', d.getVar('PN', True))
+ 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", True)
+
+ 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_revisons(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", True)
+
+ if pn:
+ return d.getVar("SRCDATE_%s" % pn, True) or d.getVar("SRCDATE", True) or d.getVar("DATE", True)
+
+ return d.getVar("SRCDATE", True) or d.getVar("DATE", True)
+
+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(data.getVar("DL_DIR", d, True), 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('.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('.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'):
+ cmd = 'ar -p %s data.tar.gz | zcat | tar --no-same-owner -xpf -' % file
+ elif file.endswith('.tar.7z'):
+ cmd = '7z x -so %s | tar xf - ' % file
+ elif file.endswith('.7z'):
+ cmd = '7za x -y %s 1>/dev/null' % file
+
+ # If 'subdir' param exists, create a dir and use it as destination for unpack cmd
+ if 'subdir' in urldata.parm:
+ unpackdir = '%s/%s' % (rootdir, urldata.parm.get('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 -fpPR %s %s' % (file, destdir)
+
+ if not cmd:
+ return
+
+ # Change to unpackdir before executing command
+ save_cwd = os.getcwd();
+ os.chdir(unpackdir)
+
+ path = data.getVar('PATH', True)
+ if path:
+ cmd = "PATH=\"%s\" %s" % (path, cmd)
+ bb.note("Unpacking %s to %s/" % (file, os.getcwd()))
+ ret = subprocess.call(cmd, preexec_fn=subprocess_setup, shell=True)
+
+ os.chdir(save_cwd)
+
+ 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", True) or "")
+
+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", True).split()
+ self.urls = urls
+ self.d = d
+ self.ud = {}
+ self.connection_cache = connection_cache
+
+ fn = d.getVar('FILE', True)
+ if cache and fn and fn in urldata_cache:
+ self.ud = urldata_cache[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[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", True)
+ premirroronly = (self.d.getVar("BB_FETCH_PREMIRRORONLY", True) == "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', True))
+ localpath = try_mirrors(self, self.d, ud, mirrors, False)
+
+ if premirroronly:
+ self.d.setVar("BB_NO_NETWORK", "1")
+
+ os.chdir(self.d.getVar("DL_DIR", True))
+
+ 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.warn("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.warn('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', True))
+ 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 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', True))
+ ret = try_mirrors(self, self.d, ud, mirrors, True)
+ if not ret:
+ # Next try checking from the original uri, u
+ try:
+ ret = m.checkstatus(self, ud, self.d)
+ except:
+ # Finally, try checking uri, u, from MIRRORS
+ mirrors = mirror_from_string(self.d.getVar('MIRRORS', True))
+ 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):
+ """
+ Check all urls exist upstream
+ """
+
+ 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 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 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(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/import-layers/yocto-poky/bitbake/lib/bb/fetch2/bzr.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/bzr.py
new file mode 100644
index 000000000..03e9ac461
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/bzr.py
@@ -0,0 +1,143 @@
+"""
+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 import data
+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(data.expand('${BZRDIR}', d), ud.host, relpath)
+
+ ud.setup_revisons(d)
+
+ if not ud.revision:
+ ud.revision = self.latest_revision(ud, d)
+
+ ud.localfile = data.expand('bzr_%s_%s_%s.tar.gz' % (ud.host, ud.path.replace('/', '.'), ud.revision), d)
+
+ def _buildbzrcommand(self, ud, d, command):
+ """
+ Build up an bzr commandline based on ud
+ command is "fetch", "update", "revno"
+ """
+
+ basecmd = data.expand('${FETCHCMD_bzr}', d)
+
+ 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)
+ os.chdir(os.path.join (ud.pkgdir, os.path.basename(ud.path)))
+ runfetchcmd(bzrcmd, d)
+ 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)
+ os.chdir(ud.pkgdir)
+ logger.debug(1, "Running %s", bzrcmd)
+ runfetchcmd(bzrcmd, d)
+
+ os.chdir(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])
+
+ 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/import-layers/yocto-poky/bitbake/lib/bb/fetch2/clearcase.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/clearcase.py
new file mode 100644
index 000000000..ba83e7cb6
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/clearcase.py
@@ -0,0 +1,263 @@
+# 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 import data
+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", True) or spawn.find_executable("cleartool") or spawn.find_executable("rcleartool")
+
+ if data.getVar("SRCREV", d, True) == "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", True)
+
+ 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(data.getVar("DL_DIR", d, True), 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(data.getVar("DL_DIR", d, True), 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):
+ os.chdir(ud.ccasedir)
+ 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)
+ 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
+ os.chdir(ud.viewdir)
+ 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)
+ 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/import-layers/yocto-poky/bitbake/lib/bb/fetch2/cvs.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/cvs.py
new file mode 100644
index 000000000..d27d96f68
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/cvs.py
@@ -0,0 +1,171 @@
+# 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 = bb.data.expand('%s_%s_%s_%s%s%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.tag, ud.date, norecurse, fullpath), d)
+
+ 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', True)
+ if cvsproxyhost:
+ cvsroot += ";proxy=" + cvsproxyhost
+ cvsproxyport = d.getVar('CVS_PROXY_PORT', True)
+ 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", True)
+ 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', True)
+ pkgdir = os.path.join(d.getVar('CVSDIR', True), pkg)
+ moddir = os.path.join(pkgdir, localdir)
+ 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
+ os.chdir(moddir)
+ cmd = cvsupdatecmd
+ else:
+ logger.info("Fetch " + ud.url)
+ # check out sources there
+ bb.utils.mkdirhier(pkgdir)
+ os.chdir(pkgdir)
+ logger.debug(1, "Running %s", cvscmd)
+ bb.fetch2.check_network_access(d, cvscmd, ud.url)
+ cmd = cvscmd
+
+ runfetchcmd(cmd, d, cleanup = [moddir])
+
+ 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
+ if 'fullpath' in ud.parm:
+ os.chdir(pkgdir)
+ cmd = "tar %s -czf %s %s" % (tar_flags, ud.localpath, localdir)
+ else:
+ os.chdir(moddir)
+ os.chdir('..')
+ cmd = "tar %s -czf %s %s" % (tar_flags, ud.localpath, os.path.basename(moddir))
+
+ runfetchcmd(cmd, d, cleanup = [ud.localpath])
+
+ def clean(self, ud, d):
+ """ Clean CVS Files and tarballs """
+
+ pkg = d.getVar('PN', True)
+ pkgdir = os.path.join(d.getVar("CVSDIR", True), pkg)
+
+ bb.utils.remove(pkgdir, True)
+ bb.utils.remove(ud.localpath)
+
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/git.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/git.py
new file mode 100644
index 000000000..526668bc2
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/git.py
@@ -0,0 +1,435 @@
+# 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.
+
+"""
+
+#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 errno
+import os
+import re
+import bb
+import errno
+from bb import data
+from bb.fetch2 import FetchMethod
+from bb.fetch2 import runfetchcmd
+from bb.fetch2 import logger
+
+class Git(FetchMethod):
+ """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"
+
+ # 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.branches = {}
+ for name in ud.names:
+ branch = branches[ud.names.index(name)]
+ ud.branches[name] = branch
+ ud.unresolvedrev[name] = branch
+
+ ud.basecmd = data.getVar("FETCHCMD_git", d, True) or "git -c core.fsyncobjectfiles=0"
+
+ ud.write_tarballs = ((data.getVar("BB_GENERATE_MIRROR_TARBALLS", d, True) or "0") != "0") or ud.rebaseable
+
+ ud.setup_revisons(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]
+ ud.mirrortarball = 'git2_%s.tar.gz' % (gitsrcname)
+ ud.fullmirror = os.path.join(d.getVar("DL_DIR", True), ud.mirrortarball)
+ gitdir = d.getVar("GITDIR", True) or (d.getVar("DL_DIR", True) + "/git2/")
+ ud.clonedir = os.path.join(gitdir, gitsrcname)
+
+ ud.localfile = ud.clonedir
+
+ def localpath(self, ud, d):
+ return ud.clonedir
+
+ def need_update(self, ud, d):
+ if not os.path.exists(ud.clonedir):
+ return True
+ os.chdir(ud.clonedir)
+ for name in ud.names:
+ if not self._contains_ref(ud, d, name):
+ 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", True) is not None:
+ return True
+ if os.path.exists(ud.clonedir):
+ return False
+ return True
+
+ def download(self, ud, d):
+ """Fetch url"""
+
+ # If the checkout doesn't exist and the mirror tarball does, extract it
+ if not os.path.exists(ud.clonedir) and os.path.exists(ud.fullmirror):
+ bb.utils.mkdirhier(ud.clonedir)
+ os.chdir(ud.clonedir)
+ runfetchcmd("tar -xzf %s" % (ud.fullmirror), d)
+
+ 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 = "%s clone --bare --mirror %s %s" % (ud.basecmd, repourl, ud.clonedir)
+ if ud.proto.lower() != 'file':
+ bb.fetch2.check_network_access(d, clone_cmd)
+ runfetchcmd(clone_cmd, d)
+
+ os.chdir(ud.clonedir)
+ # Update the checkout if needed
+ needupdate = False
+ for name in ud.names:
+ if not self._contains_ref(ud, d, name):
+ needupdate = True
+ if needupdate:
+ try:
+ runfetchcmd("%s remote rm origin" % ud.basecmd, d)
+ except bb.fetch2.FetchError:
+ logger.debug(1, "No Origin")
+
+ runfetchcmd("%s remote add --mirror=fetch origin %s" % (ud.basecmd, repourl), d)
+ fetch_cmd = "%s fetch -f --prune %s refs/*:refs/*" % (ud.basecmd, repourl)
+ if ud.proto.lower() != 'file':
+ bb.fetch2.check_network_access(d, fetch_cmd, ud.url)
+ runfetchcmd(fetch_cmd, d)
+ runfetchcmd("%s prune-packed" % ud.basecmd, d)
+ runfetchcmd("%s pack-redundant --all | xargs -r rm" % ud.basecmd, d)
+ try:
+ os.unlink(ud.fullmirror)
+ except OSError as exc:
+ if exc.errno != errno.ENOENT:
+ raise
+ os.chdir(ud.clonedir)
+ for name in ud.names:
+ if not self._contains_ref(ud, d, name):
+ 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):
+ # 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)
+
+ os.chdir(ud.clonedir)
+ logger.info("Creating tarball of git repository")
+ runfetchcmd("tar -czf %s %s" % (ud.fullmirror, os.path.join(".") ), d)
+ runfetchcmd("touch %s.done" % (ud.fullmirror), d)
+
+ 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)
+
+ cloneflags = "-s -n"
+ if ud.bareclone:
+ cloneflags += " --mirror"
+
+ runfetchcmd("%s clone %s %s/ %s" % (ud.basecmd, cloneflags, ud.clonedir, destdir), d)
+ os.chdir(destdir)
+ repourl = self._get_repo_url(ud)
+ runfetchcmd("%s remote set-url origin %s" % (ud.basecmd, repourl), d)
+ if not ud.nocheckout:
+ if subdir != "":
+ runfetchcmd("%s read-tree %s%s" % (ud.basecmd, ud.revisions[ud.names[0]], readpathspec), d)
+ runfetchcmd("%s checkout-index -q -f -a" % ud.basecmd, d)
+ 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)
+ runfetchcmd("%s branch --set-upstream %s origin/%s" % (ud.basecmd, branchname, \
+ branchname), d)
+ else:
+ runfetchcmd("%s checkout %s" % (ud.basecmd, ud.revisions[ud.names[0]]), d)
+
+ 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):
+ 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)
+ 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
+ """
+ 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)
+ output = runfetchcmd(cmd, d, True)
+ if not output:
+ raise bb.fetch2.FetchError("The command %s gave empty output unexpectedly" % cmd, ud.url)
+ 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/":
+ 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.split('\n'):
+ if s in l:
+ return l.split()[0]
+ 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', True) or "(?P<pver>([0-9][\.|_]?)+)")
+ try:
+ output = self._lsremote(ud, d, "refs/tags/*")
+ except bb.fetch2.FetchError or bb.fetch2.NetworkAccess:
+ 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 FetchError:
+ return False
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/gitannex.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/gitannex.py
new file mode 100644
index 000000000..0f3789745
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/gitannex.py
@@ -0,0 +1,76 @@
+# 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 import data
+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 uses_annex(self, ud, d):
+ for name in ud.names:
+ try:
+ runfetchcmd("%s rev-list git-annex" % (ud.basecmd), d, quiet=True)
+ return True
+ except bb.fetch.FetchError:
+ pass
+
+ return False
+
+ def update_annex(self, ud, d):
+ try:
+ runfetchcmd("%s annex get --all" % (ud.basecmd), d, quiet=True)
+ except bb.fetch.FetchError:
+ return False
+ runfetchcmd("chmod u+w -R %s/annex" % (ud.clonedir), d, quiet=True)
+
+ return True
+
+ def download(self, ud, d):
+ Git.download(self, ud, d)
+
+ os.chdir(ud.clonedir)
+ annex = self.uses_annex(ud, d)
+ if annex:
+ self.update_annex(ud, d)
+
+ def unpack(self, ud, destdir, d):
+ Git.unpack(self, ud, destdir, d)
+
+ os.chdir(ud.destdir)
+ try:
+ runfetchcmd("%s annex sync" % (ud.basecmd), d)
+ except bb.fetch.FetchError:
+ pass
+
+ annex = self.uses_annex(ud, d)
+ if annex:
+ runfetchcmd("%s annex get" % (ud.basecmd), d)
+ runfetchcmd("chmod u+w -R %s/.git/annex" % (ud.destdir), d, quiet=True)
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/gitsm.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/gitsm.py
new file mode 100644
index 000000000..752f1d3c1
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/gitsm.py
@@ -0,0 +1,134 @@
+# 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 import data
+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):
+ for name in ud.names:
+ try:
+ runfetchcmd("%s show %s:.gitmodules" % (ud.basecmd, ud.revisions[name]), d, quiet=True)
+ 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)
+ os.chdir(tmpclonedir)
+ runfetchcmd(ud.basecmd + " reset --hard", d)
+ runfetchcmd(ud.basecmd + " checkout " + ud.revisions[ud.names[0]], d)
+ runfetchcmd(ud.basecmd + " submodule update --init --recursive", d)
+ self._set_relative_paths(tmpclonedir)
+ runfetchcmd("sed " + gitdir + "/config -i -e 's/bare.*=.*false/bare = true/'", d)
+ os.rename(gitdir, ud.clonedir,)
+ bb.utils.remove(tmpclonedir, True)
+
+ def download(self, ud, d):
+ Git.download(self, ud, d)
+
+ os.chdir(ud.clonedir)
+ submodules = self.uses_submodules(ud, d)
+ if submodules:
+ self.update_submodules(ud, d)
+
+ def unpack(self, ud, destdir, d):
+ Git.unpack(self, ud, destdir, d)
+
+ os.chdir(ud.destdir)
+ submodules = self.uses_submodules(ud, d)
+ if submodules:
+ runfetchcmd(ud.basecmd + " checkout " + ud.revisions[ud.names[0]], d)
+ runfetchcmd(ud.basecmd + " submodule update --init --recursive", d)
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/hg.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/hg.py
new file mode 100644
index 000000000..3b743ff51
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/hg.py
@@ -0,0 +1,278 @@
+# 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 import data
+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_revisons(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('/', '.'))
+ ud.mirrortarball = 'hg_%s.tar.gz' % hgsrcname
+ ud.fullmirror = os.path.join(d.getVar("DL_DIR", True), ud.mirrortarball)
+
+ hgdir = d.getVar("HGDIR", True) or (d.getVar("DL_DIR", True) + "/hg/")
+ ud.pkgdir = os.path.join(hgdir, hgsrcname)
+ ud.moddir = os.path.join(ud.pkgdir, ud.module)
+ ud.localfile = ud.moddir
+ ud.basecmd = data.getVar("FETCHCMD_hg", d, True) or "/usr/bin/env hg"
+
+ ud.write_tarballs = d.getVar("BB_GENERATE_MIRROR_TARBALLS", True)
+
+ 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", True) 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)
+ os.chdir(ud.pkgdir)
+ runfetchcmd("tar -xzf %s" % (ud.fullmirror), d)
+
+ 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")
+ os.chdir(ud.moddir)
+ logger.debug(1, "Running %s", updatecmd)
+ try:
+ runfetchcmd(updatecmd, d)
+ except bb.fetch2.FetchError:
+ # Runnning pull in the repo
+ pullcmd = self._buildhgcommand(ud, d, "pull")
+ logger.info("Pulling " + ud.url)
+ # update sources there
+ os.chdir(ud.moddir)
+ logger.debug(1, "Running %s", pullcmd)
+ bb.fetch2.check_network_access(d, pullcmd, ud.url)
+ runfetchcmd(pullcmd, d)
+ 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)
+ os.chdir(ud.pkgdir)
+ logger.debug(1, "Running %s", fetchcmd)
+ bb.fetch2.check_network_access(d, fetchcmd, ud.url)
+ runfetchcmd(fetchcmd, d)
+
+ # 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")
+ os.chdir(ud.moddir)
+ logger.debug(1, "Running %s", updatecmd)
+ runfetchcmd(updatecmd, d)
+
+ 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"))
+ 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)
+
+ os.chdir(ud.pkgdir)
+ logger.info("Creating tarball of hg repository")
+ runfetchcmd("tar -czf %s %s" % (ud.fullmirror, ud.module), d)
+ runfetchcmd("touch %s.done" % (ud.fullmirror), d)
+
+ 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 + "'")
+ os.chdir(codir)
+ runfetchcmd("%s pull %s" % (ud.basecmd, ud.moddir), d)
+ runfetchcmd("%s up -C %s" % (ud.basecmd, revflag), d)
+ else:
+ logger.debug(2, "Unpack: extracting source to '" + codir + "'")
+ os.chdir(ud.moddir)
+ runfetchcmd("%s archive -t files %s %s" % (ud.basecmd, revflag, codir), d)
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/local.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/local.py
new file mode 100644
index 000000000..303a52b63
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/local.py
@@ -0,0 +1,129 @@
+# 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
+import bb
+import bb.utils
+from bb import data
+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.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 = data.getVar('FILESPATH', d, True)
+ 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:
+ filesdir = data.getVar('FILESDIR', d, True)
+ if filesdir:
+ logger.debug(2, "Searching for %s in path: %s" % (path, filesdir))
+ newpath = os.path.join(filesdir, path)
+ searched.append(newpath)
+ 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", True), 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 = data.getVar('FILESPATH', d, True)
+ if filespath:
+ locations = filespath.split(":")
+ filesdir = data.getVar('FILESDIR', d, True)
+ if filesdir:
+ locations.append(filesdir)
+ locations.append(d.getVar("DL_DIR", True))
+
+ 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/import-layers/yocto-poky/bitbake/lib/bb/fetch2/npm.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/npm.py
new file mode 100644
index 000000000..e8d9b1109
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/npm.py
@@ -0,0 +1,284 @@
+# 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};ver=${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
+import json
+import subprocess
+import signal
+import bb
+from bb import data
+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.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", True) or "/usr/bin/env wget -O -t 2 -T 30 -nv --passive-ftp --no-check-certificate "
+ self.basecmd += " --directory-prefix=%s " % prefixdir
+
+ ud.write_tarballs = ((data.getVar("BB_GENERATE_MIRROR_TARBALLS", d, True) or "0") != "0")
+ ud.mirrortarball = 'npm_%s-%s.tar.xz' % (ud.pkgname, ud.version)
+ ud.fullmirror = os.path.join(d.getVar("DL_DIR", True), ud.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)
+ runfetchcmd(command, d, quiet)
+
+ 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
+ save_cwd = os.getcwd()
+ if not os.path.exists(destdir):
+ os.makedirs(destdir)
+ os.chdir(destdir)
+ path = d.getVar('PATH', True)
+ if path:
+ cmd = "PATH=\"%s\" %s" % (path, cmd)
+ bb.note("Unpacking %s to %s/" % (file, os.getcwd()))
+ ret = subprocess.call(cmd, preexec_fn=subprocess_setup, shell=True)
+ os.chdir(save_cwd)
+
+ 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", True)
+ depdumpfile = "%s-%s.deps.json" % (ud.pkgname, ud.version)
+ with open("%s/npm/%s" % (dldir, depdumpfile)) as datafile:
+ workobj = json.load(datafile)
+ dldir = "%s/%s" % (os.path.dirname(ud.localpath), ud.pkgname)
+
+ self._unpackdep(ud, ud.pkgname, workobj, "%s/npmpkg" % destdir, 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):
+ 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]
+ if '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)
+ self._runwget(ud, d, "%s %s" % (self.basecmd, outputurl), False)
+
+ dependencies = pdata.get('dependencies', {})
+ optionalDependencies = pdata.get('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.iteritems():
+ self._getdependencies(dep, data[pkg]['deps'], version, d, ud, optional=True)
+ for dep, version in depsfound.iteritems():
+ self._getdependencies(dep, data[pkg]['deps'], version, d, ud)
+
+ def _getshrinkeddependencies(self, pkg, data, version, d, ud, lockdown, manifest):
+ logger.debug(2, "NPM shrinkwrap file is %s" % data)
+ 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 %s" % (self.basecmd, 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'])
+
+ 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", True)
+ bb.utils.mkdirhier(dest)
+ save_cwd = os.getcwd()
+ os.chdir(dest)
+ runfetchcmd("tar -xJf %s" % (ud.fullmirror), d)
+ os.chdir(save_cwd)
+ return
+
+ shwrf = d.getVar('NPM_SHRINKWRAP', True)
+ logger.debug(2, "NPM shrinkwrap file is %s" % shwrf)
+ try:
+ with open(shwrf) as datafile:
+ shrinkobj = json.load(datafile)
+ except:
+ logger.warn('Missing shrinkwrap file in NPM_SHRINKWRAP for %s, this will lead to unreliable builds!' % ud.pkgname)
+ lckdf = d.getVar('NPM_LOCKDOWN', True)
+ logger.debug(2, "NPM lockdown file is %s" % lckdf)
+ try:
+ with open(lckdf) as datafile:
+ lockdown = json.load(datafile)
+ except:
+ logger.warn('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)
+
+ save_cwd = os.getcwd()
+ os.chdir(d.getVar("DL_DIR", True))
+ logger.info("Creating tarball of npm data")
+ runfetchcmd("tar -cJf %s npm/%s npm/%s" % (ud.fullmirror, ud.bbnpmmanifest, ud.pkgname), d)
+ runfetchcmd("touch %s.done" % (ud.fullmirror), d)
+ os.chdir(save_cwd)
+
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/osc.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/osc.py
new file mode 100644
index 000000000..d051dfdaf
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/osc.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" implementation for osc (Opensuse build service client).
+Based on the svn "Fetch" implementation.
+
+"""
+
+import os
+import sys
+import logging
+import bb
+from bb import data
+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', True), 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 = data.expand('%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.path.replace('/', '.'), ud.revision), d)
+
+ def _buildosccommand(self, ud, d, command):
+ """
+ Build up an ocs commandline based on ud
+ command is "fetch", "update", "info"
+ """
+
+ basecmd = data.expand('${FETCHCMD_osc}', d)
+
+ 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', True), ud.path, ud.module), os.R_OK):
+ oscupdatecmd = self._buildosccommand(ud, d, "update")
+ logger.info("Update "+ ud.url)
+ # update sources there
+ os.chdir(ud.moddir)
+ logger.debug(1, "Running %s", oscupdatecmd)
+ bb.fetch2.check_network_access(d, oscupdatecmd, ud.url)
+ runfetchcmd(oscupdatecmd, d)
+ else:
+ oscfetchcmd = self._buildosccommand(ud, d, "fetch")
+ logger.info("Fetch " + ud.url)
+ # check out sources there
+ bb.utils.mkdirhier(ud.pkgdir)
+ os.chdir(ud.pkgdir)
+ logger.debug(1, "Running %s", oscfetchcmd)
+ bb.fetch2.check_network_access(d, oscfetchcmd, ud.url)
+ runfetchcmd(oscfetchcmd, d)
+
+ os.chdir(os.path.join(ud.pkgdir + ud.path))
+ # tar them up to a defined filename
+ runfetchcmd("tar -czf %s %s" % (ud.localpath, ud.module), d, cleanup = [ud.localpath])
+
+ 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', True), "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', True))
+ f.write("urllist = %s\n" % d.getVar("OSCURLLIST", True))
+ 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/import-layers/yocto-poky/bitbake/lib/bb/fetch2/perforce.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/perforce.py
new file mode 100644
index 000000000..3a10c7ca3
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/perforce.py
@@ -0,0 +1,187 @@
+# 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
+
+from future_builtins import zip
+import os
+import subprocess
+import logging
+import bb
+from bb import data
+from bb.fetch2 import FetchMethod
+from bb.fetch2 import FetchError
+from bb.fetch2 import logger
+from bb.fetch2 import runfetchcmd
+
+class Perforce(FetchMethod):
+ def supports(self, ud, d):
+ return ud.type in ['p4']
+
+ def doparse(url, d):
+ parm = {}
+ path = url.split("://")[1]
+ delim = path.find("@");
+ if delim != -1:
+ (user, pswd, host, port) = path.split('@')[0].split(":")
+ path = path.split('@')[1]
+ else:
+ (host, port) = d.getVar('P4PORT', False).split(':')
+ user = ""
+ pswd = ""
+
+ if path.find(";") != -1:
+ keys=[]
+ values=[]
+ plist = path.split(';')
+ for item in plist:
+ if item.count('='):
+ (key, value) = item.split('=')
+ keys.append(key)
+ values.append(value)
+
+ parm = dict(zip(keys, values))
+ path = "//" + path.split(';')[0]
+ host += ":%s" % (port)
+ parm["cset"] = Perforce.getcset(d, path, host, user, pswd, parm)
+
+ return host, path, user, pswd, parm
+ doparse = staticmethod(doparse)
+
+ def getcset(d, depot, host, user, pswd, parm):
+ p4opt = ""
+ if "cset" in parm:
+ return parm["cset"];
+ if user:
+ p4opt += " -u %s" % (user)
+ if pswd:
+ p4opt += " -P %s" % (pswd)
+ if host:
+ p4opt += " -p %s" % (host)
+
+ p4date = d.getVar("P4DATE", True)
+ if "revision" in parm:
+ depot += "#%s" % (parm["revision"])
+ elif "label" in parm:
+ depot += "@%s" % (parm["label"])
+ elif p4date:
+ depot += "@%s" % (p4date)
+
+ p4cmd = d.getVar('FETCHCMD_p4', True) or "p4"
+ logger.debug(1, "Running %s%s changes -m 1 %s", p4cmd, p4opt, depot)
+ p4file, errors = bb.process.run("%s%s changes -m 1 %s" % (p4cmd, p4opt, depot))
+ cset = p4file.strip()
+ logger.debug(1, "READ %s", cset)
+ if not cset:
+ return -1
+
+ return cset.split(' ')[1]
+ getcset = staticmethod(getcset)
+
+ def urldata_init(self, ud, d):
+ (host, path, user, pswd, parm) = Perforce.doparse(ud.url, d)
+
+ base_path = path.replace('/...', '')
+ base_path = self._strip_leading_slashes(base_path)
+
+ if "label" in parm:
+ version = parm["label"]
+ else:
+ version = Perforce.getcset(d, path, host, user, pswd, parm)
+
+ ud.localfile = data.expand('%s+%s+%s.tar.gz' % (host, base_path.replace('/', '.'), version), d)
+
+ def download(self, ud, d):
+ """
+ Fetch urls
+ """
+
+ (host, depot, user, pswd, parm) = Perforce.doparse(ud.url, d)
+
+ if depot.find('/...') != -1:
+ path = depot[:depot.find('/...')]
+ else:
+ path = depot[:depot.rfind('/')]
+
+ module = parm.get('module', os.path.basename(path))
+
+ # Get the p4 command
+ p4opt = ""
+ if user:
+ p4opt += " -u %s" % (user)
+
+ if pswd:
+ p4opt += " -P %s" % (pswd)
+
+ if host:
+ p4opt += " -p %s" % (host)
+
+ p4cmd = d.getVar('FETCHCMD_p4', True) or "p4"
+
+ # create temp directory
+ logger.debug(2, "Fetch: creating temporary directory")
+ bb.utils.mkdirhier(d.expand('${WORKDIR}'))
+ mktemp = d.getVar("FETCHCMD_p4mktemp", True) or d.expand("mktemp -d -q '${WORKDIR}/oep4.XXXXXX'")
+ tmpfile, errors = bb.process.run(mktemp)
+ tmpfile = tmpfile.strip()
+ if not tmpfile:
+ raise FetchError("Fetch: unable to create temporary directory.. make sure 'mktemp' is in the PATH.", ud.url)
+
+ if "label" in parm:
+ depot = "%s@%s" % (depot, parm["label"])
+ else:
+ cset = Perforce.getcset(d, depot, host, user, pswd, parm)
+ depot = "%s@%s" % (depot, cset)
+
+ os.chdir(tmpfile)
+ logger.info("Fetch " + ud.url)
+ logger.info("%s%s files %s", p4cmd, p4opt, depot)
+ p4file, errors = bb.process.run("%s%s files %s" % (p4cmd, p4opt, depot))
+ p4file = [f.rstrip() for f in p4file.splitlines()]
+
+ if not p4file:
+ raise FetchError("Fetch: unable to get the P4 files from %s" % depot, ud.url)
+
+ count = 0
+
+ for file in p4file:
+ list = file.split()
+
+ if list[2] == "delete":
+ continue
+
+ dest = list[0][len(path)+1:]
+ where = dest.find("#")
+
+ subprocess.call("%s%s print -o %s/%s %s" % (p4cmd, p4opt, module, dest[:where], list[0]), shell=True)
+ count = count + 1
+
+ if count == 0:
+ logger.error()
+ raise FetchError("Fetch: No files gathered from the P4 fetch", ud.url)
+
+ runfetchcmd("tar -czf %s %s" % (ud.localpath, module), d, cleanup = [ud.localpath])
+ # cleanup
+ bb.utils.prunedir(tmpfile)
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/repo.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/repo.py
new file mode 100644
index 000000000..21678eb7d
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/repo.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" 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 import data
+from bb.fetch2 import FetchMethod
+from bb.fetch2 import runfetchcmd
+
+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 = data.expand("repo_%s%s_%s_%s.tar.gz" % (ud.host, ud.path.replace("/", "."), ud.manifest, ud.branch), d)
+
+ def download(self, ud, d):
+ """Fetch url"""
+
+ if os.access(os.path.join(data.getVar("DL_DIR", d, True), 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 = data.getVar("REPODIR", d, True) or os.path.join(data.getVar("DL_DIR", d, True), "repo")
+ codir = os.path.join(repodir, gitsrcname, ud.manifest)
+
+ if ud.user:
+ username = ud.user + "@"
+ else:
+ username = ""
+
+ bb.utils.mkdirhier(os.path.join(codir, "repo"))
+ os.chdir(os.path.join(codir, "repo"))
+ if not os.path.exists(os.path.join(codir, "repo", ".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)
+
+ bb.fetch2.check_network_access(d, "repo sync %s" % ud.url, ud.url)
+ runfetchcmd("repo sync", d)
+ os.chdir(codir)
+
+ 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)
+
+ 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/import-layers/yocto-poky/bitbake/lib/bb/fetch2/sftp.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/sftp.py
new file mode 100644
index 000000000..cb2f753a8
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/sftp.py
@@ -0,0 +1,129 @@
+# 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
+import commands
+from bb import data
+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 = data.expand(urllib.unquote(ud.basename), d)
+
+ 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 = data.getVar('DL_DIR', d, True)
+ 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, commands.mkarg(remote),
+ commands.mkarg(lpath))
+
+ bb.fetch2.check_network_access(d, cmd, ud.url)
+ runfetchcmd(cmd, d)
+ return True
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/ssh.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/ssh.py
new file mode 100644
index 000000000..635578a71
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/ssh.py
@@ -0,0 +1,128 @@
+# 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 import data
+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', True),
+ os.path.basename(os.path.normpath(path)))
+
+ def download(self, urldata, d):
+ dldir = d.getVar('DL_DIR', True)
+
+ 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
+
+
+ import commands
+ cmd = 'scp -B -r %s %s %s/' % (
+ portarg,
+ commands.mkarg(fr),
+ commands.mkarg(dldir)
+ )
+
+ bb.fetch2.check_network_access(d, cmd, urldata.url)
+
+ runfetchcmd(cmd, d)
+
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/fetch2/svn.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/svn.py
new file mode 100644
index 000000000..8a291935c
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/svn.py
@@ -0,0 +1,197 @@
+# 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 import data
+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', True)
+
+ 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(data.expand('${SVNDIR}', d), ud.host, relpath)
+ ud.moddir = os.path.join(ud.pkgdir, ud.module)
+
+ ud.setup_revisons(d)
+
+ if 'rev' in ud.parm:
+ ud.revision = ud.parm['rev']
+
+ ud.localfile = data.expand('%s_%s_%s_%s_.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision), d)
+
+ 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_rsh = None
+ if proto == "svn+ssh" and "rsh" in ud.parm:
+ svn_rsh = ud.parm["rsh"]
+
+ 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_rsh:
+ svncmd = "svn_RSH=\"%s\" %s" % (svn_rsh, 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)
+ # update sources there
+ os.chdir(ud.moddir)
+ # We need to attempt to run svn upgrade first in case its an older working format
+ try:
+ runfetchcmd(ud.basecmd + " upgrade", d)
+ except FetchError:
+ pass
+ logger.debug(1, "Running %s", svnupdatecmd)
+ bb.fetch2.check_network_access(d, svnupdatecmd, ud.url)
+ runfetchcmd(svnupdatecmd, d)
+ else:
+ svnfetchcmd = self._buildsvncommand(ud, d, "fetch")
+ logger.info("Fetch " + ud.url)
+ # check out sources there
+ bb.utils.mkdirhier(ud.pkgdir)
+ os.chdir(ud.pkgdir)
+ logger.debug(1, "Running %s", svnfetchcmd)
+ bb.fetch2.check_network_access(d, svnfetchcmd, ud.url)
+ runfetchcmd(svnfetchcmd, d)
+
+ scmdata = ud.parm.get("scmdata", "")
+ if scmdata == "keep":
+ tar_flags = ""
+ else:
+ tar_flags = "--exclude '.svn'"
+
+ os.chdir(ud.pkgdir)
+ # tar them up to a defined filename
+ runfetchcmd("tar %s -czf %s %s" % (tar_flags, ud.localpath, ud.path_spec), d, cleanup = [ud.localpath])
+
+ 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"))
+
+ 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/import-layers/yocto-poky/bitbake/lib/bb/fetch2/wget.py b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/wget.py
new file mode 100644
index 000000000..8bc9e93ca
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/fetch2/wget.py
@@ -0,0 +1,565 @@
+# 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 bb
+import urllib
+from bb import data
+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 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 = data.expand(urllib.unquote(ud.basename), d)
+ if not ud.localfile:
+ ud.localfile = data.expand(urllib.unquote(ud.host + ud.path).replace("/", "."), d)
+
+ self.basecmd = d.getVar("FETCHCMD_wget", True) or "/usr/bin/env wget -t 2 -T 30 -nv --passive-ftp --no-check-certificate"
+
+ 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)
+ runfetchcmd(command, d, quiet)
+
+ def download(self, ud, d):
+ """Fetch urls"""
+
+ fetchcmd = self.basecmd
+
+ if 'downloadfilename' in ud.parm:
+ dldir = d.getVar("DL_DIR", True)
+ bb.utils.mkdirhier(os.path.dirname(dldir + os.sep + ud.localfile))
+ fetchcmd += " -O " + dldir + os.sep + ud.localfile
+
+ 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):
+ import urllib2, socket, httplib
+ from urllib import addinfourl
+ from bb.fetch2 import FetchConnectionCache
+
+ class HTTPConnectionCache(httplib.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(urllib2.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.get_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 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 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.get_selector(), req.data, headers)
+ except socket.error, err: # XXX what error?
+ # Don't close connection when cache is enabled.
+ if fetch.connection_cache is None:
+ h.close()
+ raise urllib2.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
+
+ 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(urllib2.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 req.headers.items()
+ if k.lower() not in ("content-length", "content-type"))
+ return self.parent.open(urllib2.Request(req.get_full_url(),
+ headers=newheaders,
+ origin_req_host=req.get_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
+
+ """
+ Some servers (e.g. FusionForge) returns 406 Not Acceptable when they
+ actually mean 405 Method Not Allowed.
+ """
+ http_error_406 = http_error_405
+
+ class FixedHTTPRedirectHandler(urllib2.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 = urllib2.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(urllib2.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(urllib2.HTTPSHandler(context=ssl._create_unverified_context()))
+ opener = urllib2.build_opener(*handlers)
+
+ try:
+ uri = ud.url.split(";")[0]
+ r = urllib2.Request(uri)
+ r.get_method = lambda: "HEAD"
+ opener.open(r)
+ except urllib2.URLError as e:
+ # 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()
+
+ 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)
+ fetchresult = f.read()
+ except bb.fetch2.BBFetchException:
+ fetchresult = ""
+
+ f.close()
+ 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|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', True)
+ 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', True), '']
+
+ """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", True)
+ 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', True)
+ 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/import-layers/yocto-poky/bitbake/lib/bb/main.py b/import-layers/yocto-poky/bitbake/lib/bb/main.py
new file mode 100755
index 000000000..e30217369
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/main.py
@@ -0,0 +1,440 @@
+#!/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 bb
+from bb import event
+import bb.msg
+from bb import cooker
+from bb import ui
+from bb import server
+from bb import cookerdata
+
+logger = logging.getLogger("BitBake")
+
+class BBMainException(Exception):
+ 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))
+ elif option.dest == 'servertype':
+ valid_server_types = list_extension_modules(bb.server, 'BitBakeServer')
+ option.help = option.help.replace('@CHOICES@', present_options(valid_server_types))
+
+ 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:
+ raise BBMainException('FATAL: Unable to import extension module "%s" from %s. Valid extension modules: %s' % (modulename, pkg.__name__, present_options(list_extension_modules(pkg, checkattr))))
+
+
+# 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.warn(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", help = "Execute tasks from a specific .bb recipe directly. WARNING: Does not handle any dependencies from other recipes.",
+ action = "store", dest = "buildfile", default = None)
+
+ parser.add_option("-k", "--continue", 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.",
+ action = "store_false", dest = "abort", default = True)
+
+ parser.add_option("-a", "--tryaltconfigs", help = "Continue with builds by trying to use alternative providers where possible.",
+ action = "store_true", dest = "tryaltconfigs", default = False)
+
+ parser.add_option("-f", "--force", help = "Force the specified targets/task to run (invalidating any existing stamp file).",
+ action = "store_true", dest = "force", default = False)
+
+ parser.add_option("-c", "--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.",
+ action = "store", dest = "cmd")
+
+ parser.add_option("-C", "--clear-stamp", help = "Invalidate the stamp for the specified task such as 'compile' and then run the default task for the specified target(s).",
+ action = "store", dest = "invalidate_stamp")
+
+ parser.add_option("-r", "--read", help = "Read the specified file before bitbake.conf.",
+ action = "append", dest = "prefile", default = [])
+
+ parser.add_option("-R", "--postread", help = "Read the specified file after bitbake.conf.",
+ action = "append", dest = "postfile", default = [])
+
+ parser.add_option("-v", "--verbose", help = "Output more log message data to the terminal.",
+ action = "store_true", dest = "verbose", default = False)
+
+ parser.add_option("-D", "--debug", help = "Increase the debug level. You can specify this more than once.",
+ action = "count", dest="debug", default = 0)
+
+ parser.add_option("-n", "--dry-run", help = "Don't execute, just go through the motions.",
+ action = "store_true", dest = "dry_run", default = False)
+
+ parser.add_option("-S", "--dump-signatures", 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.",
+ action = "append", dest = "dump_signatures", default = [], metavar="SIGNATURE_HANDLER")
+
+ parser.add_option("-p", "--parse-only", help = "Quit after parsing the BB recipes.",
+ action = "store_true", dest = "parse_only", default = False)
+
+ parser.add_option("-s", "--show-versions", help = "Show current and preferred versions of all recipes.",
+ action = "store_true", dest = "show_versions", default = False)
+
+ parser.add_option("-e", "--environment", help = "Show the global or per-recipe environment complete with information about where variables were set/changed.",
+ action = "store_true", dest = "show_environment", default = False)
+
+ parser.add_option("-g", "--graphviz", help = "Save dependency tree information for the specified targets in the dot syntax.",
+ action = "store_true", dest = "dot_graph", default = False)
+
+ parser.add_option("-I", "--ignore-deps", help = """Assume these dependencies don't exist and are already provided (equivalent to ASSUME_PROVIDED). Useful to make dependency graphs more appealing""",
+ action = "append", dest = "extra_assume_provided", default = [])
+
+ parser.add_option("-l", "--log-domains", help = """Show debug logging for the specified logging domains""",
+ action = "append", dest = "debug_domains", default = [])
+
+ parser.add_option("-P", "--profile", help = "Profile the command and save reports.",
+ action = "store_true", dest = "profile", default = False)
+
+ env_ui = os.environ.get('BITBAKE_UI', None)
+ default_ui = env_ui or 'knotty'
+ # @CHOICES@ is substituted out by BitbakeHelpFormatter above
+ parser.add_option("-u", "--ui", help = "The user interface to use (@CHOICES@ - default %default).",
+ action="store", dest="ui", default=default_ui)
+
+ # @CHOICES@ is substituted out by BitbakeHelpFormatter above
+ parser.add_option("-t", "--servertype", help = "Choose which server type to use (@CHOICES@ - default %default).",
+ action = "store", dest = "servertype", default = "process")
+
+ parser.add_option("", "--token", help = "Specify the connection token to be used when connecting to a remote server.",
+ action = "store", dest = "xmlrpctoken")
+
+ parser.add_option("", "--revisions-changed", help = "Set the exit code depending on whether upstream floating revisions have changed or not.",
+ action = "store_true", dest = "revisions_changed", default = False)
+
+ parser.add_option("", "--server-only", help = "Run bitbake without a UI, only starting a server (cooker) process.",
+ action = "store_true", dest = "server_only", default = False)
+
+ parser.add_option("-B", "--bind", help = "The name/address for the bitbake server to bind to.",
+ action = "store", dest = "bind", default = False)
+
+ parser.add_option("", "--no-setscene", help = "Do not run any setscene tasks. sstate will be ignored and everything needed, built.",
+ action = "store_true", dest = "nosetscene", default = False)
+
+ parser.add_option("", "--setscene-only", help = "Only run setscene tasks, don't run any real tasks.",
+ action = "store_true", dest = "setsceneonly", default = False)
+
+ parser.add_option("", "--remote-server", help = "Connect to the specified server.",
+ action = "store", dest = "remote_server", default = False)
+
+ parser.add_option("-m", "--kill-server", help = "Terminate the remote server.",
+ action = "store_true", dest = "kill_server", default = False)
+
+ parser.add_option("", "--observe-only", help = "Connect to a server as an observing-only client.",
+ action = "store_true", dest = "observe_only", default = False)
+
+ parser.add_option("", "--status-only", help = "Check the status of the remote bitbake server.",
+ action = "store_true", dest = "status_only", default = False)
+
+ parser.add_option("-w", "--write-log", help = "Writes the event log of the build to a bitbake event json file. Use '' (empty string) to assign the name automatically.",
+ action = "store", dest = "writeeventlog")
+
+ options, targets = parser.parse_args(argv)
+
+ # some environmental variables set also configuration options
+ if "BBSERVER" in os.environ:
+ options.servertype = "xmlrpc"
+ options.remote_server = os.environ["BBSERVER"]
+
+ if "BBTOKEN" in os.environ:
+ options.xmlrpctoken = os.environ["BBTOKEN"]
+
+ if "BBEVENTLOG" in os.environ:
+ options.writeeventlog = os.environ["BBEVENTLOG"]
+
+ # fill in proper log name if not supplied
+ if options.writeeventlog is not None and len(options.writeeventlog) == 0:
+ import datetime
+ options.writeeventlog = "bitbake_eventlog_%s.json" % datetime.datetime.now().strftime("%Y%m%d%H%M%S")
+
+ # if BBSERVER says to autodetect, let's do that
+ if options.remote_server:
+ [host, port] = options.remote_server.split(":", 2)
+ port = int(port)
+ # use automatic port if port set to -1, means read it from
+ # the bitbake.lock file; this is a bit tricky, but we always expect
+ # to be in the base of the build directory if we need to have a
+ # chance to start the server later, anyway
+ if port == -1:
+ lock_location = "./bitbake.lock"
+ # we try to read the address at all times; if the server is not started,
+ # we'll try to start it after the first connect fails, below
+ try:
+ lf = open(lock_location, 'r')
+ remotedef = lf.readline()
+ [host, port] = remotedef.split(":")
+ port = int(port)
+ lf.close()
+ options.remote_server = remotedef
+ except Exception as e:
+ raise BBMainException("Failed to read bitbake.lock (%s), invalid port" % str(e))
+
+ return options, targets[1:]
+
+
+def start_server(servermodule, configParams, configuration, features):
+ server = servermodule.BitBakeServer()
+ single_use = not configParams.server_only
+ if configParams.bind:
+ (host, port) = configParams.bind.split(':')
+ server.initServer((host, int(port)), single_use)
+ configuration.interface = [ server.serverImpl.host, server.serverImpl.port ]
+ else:
+ server.initServer(single_use=single_use)
+ configuration.interface = []
+
+ try:
+ configuration.setServerRegIdleCallback(server.getServerIdleCB())
+
+ cooker = bb.cooker.BBCooker(configuration, features)
+
+ server.addcooker(cooker)
+ server.saveConnectionDetails()
+ except Exception as e:
+ exc_info = sys.exc_info()
+ while hasattr(server, "event_queue"):
+ try:
+ import queue
+ except ImportError:
+ import Queue as queue
+ try:
+ event = server.event_queue.get(block=False)
+ except (queue.Empty, IOError):
+ break
+ if isinstance(event, logging.LogRecord):
+ logger.handle(event)
+ raise exc_info[1], None, exc_info[2]
+ server.detach()
+ cooker.lock.close()
+ return server
+
+
+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>':
+ sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
+ except:
+ pass
+
+
+ configuration.setConfigParameters(configParams)
+
+ ui_module = import_extension_module(bb.ui, configParams.ui, 'main')
+ servermodule = import_extension_module(bb.server, configParams.servertype, 'BitBakeServer')
+
+ if configParams.server_only:
+ if configParams.servertype != "xmlrpc":
+ raise BBMainException("FATAL: If '--server-only' is defined, we must set the "
+ "servertype as 'xmlrpc'.\n")
+ if not configParams.bind:
+ raise BBMainException("FATAL: The '--server-only' option requires a name/address "
+ "to bind to with the -B option.\n")
+ if 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.bind and configParams.servertype != "xmlrpc":
+ raise BBMainException("FATAL: If '-B' or '--bind' is defined, we must "
+ "set the servertype as 'xmlrpc'.\n")
+
+ if configParams.remote_server and configParams.servertype != "xmlrpc":
+ raise BBMainException("FATAL: If '--remote-server' is defined, we must "
+ "set the servertype as 'xmlrpc'.\n")
+
+ 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 configParams.kill_server and not configParams.remote_server:
+ raise BBMainException("FATAL: '--kill-server' can only be used to terminate a remote server")
+
+ 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)
+
+ # 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()
+
+ featureset = []
+ if not configParams.server_only:
+ # Collect the feature set for the UI
+ featureset = getattr(ui_module, "featureSet", [])
+
+ if configParams.server_only:
+ for param in ('prefile', 'postfile'):
+ value = getattr(configParams, param)
+ if value:
+ setattr(configuration, "%s_server" % param, value)
+ param = "%s_server" % param
+
+ if not configParams.remote_server:
+ # we start a server with a given configuration
+ server = start_server(servermodule, configParams, configuration, featureset)
+ bb.event.ui_queue = []
+ else:
+ # we start a stub server that is actually a XMLRPClient that connects to a real server
+ server = servermodule.BitBakeXMLRPCClient(configParams.observe_only, configParams.xmlrpctoken)
+ server.saveConnectionDetails(configParams.remote_server)
+
+
+ if not configParams.server_only:
+ try:
+ server_connection = server.establishConnection(featureset)
+ except Exception as e:
+ bb.fatal("Could not connect to server %s: %s" % (configParams.remote_server, str(e)))
+
+ if configParams.kill_server:
+ server_connection.connection.terminateServer()
+ bb.event.ui_queue = []
+ return 0
+
+ server_connection.setupEventQueue()
+
+ # Restore the environment in case the UI needs it
+ for k in cleanedvars:
+ os.environ[k] = cleanedvars[k]
+
+ logger.removeHandler(handler)
+
+
+ if configParams.status_only:
+ server_connection.terminate()
+ return 0
+
+ try:
+ return ui_module.main(server_connection.connection, server_connection.events, configParams)
+ finally:
+ bb.event.ui_queue = []
+ server_connection.terminate()
+ else:
+ print("Bitbake server address: %s, server port: %s" % (server.serverImpl.host, server.serverImpl.port))
+ return 0
+
+ return 1
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/methodpool.py b/import-layers/yocto-poky/bitbake/lib/bb/methodpool.py
new file mode 100644
index 000000000..49aed3338
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/bb/monitordisk.py b/import-layers/yocto-poky/bitbake/lib/bb/monitordisk.py
new file mode 100644
index 000000000..466523c6e
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/monitordisk.py
@@ -0,0 +1,263 @@
+#!/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[os.path.join(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", True)
+ 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", True) 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:
+ for k in self.devDict:
+ path = os.path.dirname(k)
+ action = os.path.basename(k)
+ dev = self.devDict[k][0]
+ minSpace = self.devDict[k][1]
+ minInode = self.devDict[k][2]
+
+ st = os.statvfs(path)
+
+ # The free space, float point number
+ freeSpace = st.f_bavail * st.f_frsize
+
+ 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.warn("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, float point 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.warn("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)
+ return
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/msg.py b/import-layers/yocto-poky/bitbake/lib/bb/msg.py
new file mode 100644
index 000000000..786b5aef4
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/msg.py
@@ -0,0 +1,199 @@
+# 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 = 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_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):
+ level, debug_domains = constructLogOptions()
+
+ 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)
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/namedtuple_with_abc.py b/import-layers/yocto-poky/bitbake/lib/bb/namedtuple_with_abc.py
new file mode 100644
index 000000000..32f2fc642
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/bb/parse/__init__.py b/import-layers/yocto-poky/bitbake/lib/bb/parse/__init__.py
new file mode 100644
index 000000000..26ae7ead8
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/parse/__init__.py
@@ -0,0 +1,170 @@
+"""
+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 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", True)
+ 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
+
+ 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/import-layers/yocto-poky/bitbake/lib/bb/parse/ast.py b/import-layers/yocto-poky/bitbake/lib/bb/parse/ast.py
new file mode 100644
index 000000000..5f55af5ef
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/parse/ast.py
@@ -0,0 +1,476 @@
+# 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.
+
+from __future__ import absolute_import
+from future_builtins import filter
+import re
+import string
+import logging
+import bb
+import itertools
+from bb import methodpool
+from bb.parse import logger
+
+_bbversions_re = re.compile(r"\[(?P<from>[0-9]+)-(?P<to>[0-9]+)\]")
+
+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 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()
+ bb.data.update_data(e)
+ 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 = string.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 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 finalize(fn, d, variant = None):
+ all_handlers = {}
+ for var in d.getVar('__BBHANDLERS', False) or []:
+ # try to add the handler
+ handlerfn = d.getVarFlag(var, "filename", False)
+ handlerln = int(d.getVarFlag(var, "lineno", False))
+ bb.event.register(var, d.getVar(var, False), (d.getVarFlag(var, "eventmask", True) or "").split(), handlerfn, handlerln)
+
+ bb.event.fire(bb.event.RecipePreFinalise(fn), d)
+
+ bb.data.expandKeys(d)
+ bb.data.update_data(d)
+ code = []
+ for funcname in d.getVar("__BBANONFUNCS", False) or []:
+ code.append("%s(d)" % funcname)
+ bb.utils.better_exec("\n".join(code), {"d": d})
+ bb.data.update_data(d)
+
+ tasklist = d.getVar('__BBTASKS', False) or []
+ 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)
+
+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, variant_d in datastores.items():
+ for name in names:
+ if not variant:
+ # Based on main recipe
+ create_variant(name, variant_d)
+ else:
+ create_variant("%s-%s" % (variant, name), variant_d, name)
+
+def _expand_versions(versions):
+ def expand_one(version, start, end):
+ for i in xrange(start, end + 1):
+ ver = _bbversions_re.sub(str(i), version, 1)
+ yield ver
+
+ versions = iter(versions)
+ while True:
+ try:
+ version = next(versions)
+ except StopIteration:
+ break
+
+ range_ver = _bbversions_re.search(version)
+ if not range_ver:
+ yield version
+ else:
+ newversions = expand_one(version, int(range_ver.group("from")),
+ int(range_ver.group("to")))
+ versions = itertools.chain(newversions, versions)
+
+def multi_finalize(fn, d):
+ appends = (d.getVar("__BBAPPEND", True) 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}
+
+ versions = (d.getVar("BBVERSIONS", True) or "").split()
+ if versions:
+ pv = orig_pv = d.getVar("PV", True)
+ baseversions = {}
+
+ def verfunc(ver, d, pv_d = None):
+ if pv_d is None:
+ pv_d = d
+
+ overrides = d.getVar("OVERRIDES", True).split(":")
+ pv_d.setVar("PV", ver)
+ overrides.append(ver)
+ bpv = baseversions.get(ver) or orig_pv
+ pv_d.setVar("BPV", bpv)
+ overrides.append(bpv)
+ d.setVar("OVERRIDES", ":".join(overrides))
+
+ versions = list(_expand_versions(versions))
+ for pos, version in enumerate(list(versions)):
+ try:
+ pv, bpv = version.split(":", 2)
+ except ValueError:
+ pass
+ else:
+ versions[pos] = pv
+ baseversions[pv] = bpv
+
+ if pv in versions and not baseversions.get(pv):
+ versions.remove(pv)
+ else:
+ pv = versions.pop()
+
+ # This is necessary because our existing main datastore
+ # has already been finalized with the old PV, we need one
+ # that's been finalized with the new PV.
+ d = bb.data.createCopy(safe_d)
+ verfunc(pv, d, safe_d)
+ try:
+ finalize(fn, d)
+ except bb.parse.SkipRecipe as e:
+ d.setVar("__SKIPPED", e.args[0])
+
+ _create_variants(datastores, versions, verfunc, onlyfinalise)
+
+ extended = d.getVar("BBCLASSEXTEND", True) 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", True)
+ 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, variant_d in datastores.iteritems():
+ if variant:
+ try:
+ if not onlyfinalise or variant in onlyfinalise:
+ finalize(fn, variant_d, variant)
+ except bb.parse.SkipRecipe as e:
+ variant_d.setVar("__SKIPPED", e.args[0])
+
+ if len(datastores) > 1:
+ variants = filter(None, datastores.iterkeys())
+ safe_d.setVar("__VARIANTS", " ".join(variants))
+
+ datastores[""] = d
+ return datastores
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/parse/parse_py/BBHandler.py b/import-layers/yocto-poky/bitbake/lib/bb/parse/parse_py/BBHandler.py
new file mode 100644
index 000000000..ef72c3700
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/parse/parse_py/BBHandler.py
@@ -0,0 +1,254 @@
+#!/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.
+
+from __future__ import absolute_import
+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", True)
+ 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:
+ file = open(absolute_filename, 'r')
+ statements = ast.StatementGroup()
+
+ lineno = 0
+ while True:
+ lineno = lineno + 1
+ s = file.readline()
+ if not s: break
+ s = s.rstrip()
+ feeder(lineno, s, filename, base_name, statements)
+ file.close()
+ 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)
+
+ if include:
+ bb.parse.mark_dependency(d, abs_fn)
+
+ # 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:
+ bb.data.setVar("__SKIPPED", True, d)
+ 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/import-layers/yocto-poky/bitbake/lib/bb/parse/parse_py/ConfHandler.py b/import-layers/yocto-poky/bitbake/lib/bb/parse/parse_py/ConfHandler.py
new file mode 100644
index 000000000..fbd75b14a
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/parse/parse_py/ConfHandler.py
@@ -0,0 +1,193 @@
+#!/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\-_+.${}/]+)$" )
+
+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, fn, 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.
+ """
+ if parentfn == fn: # prevent infinite recursion
+ return None
+
+ fn = data.expand(fn)
+ parentfn = data.expand(parentfn)
+
+ if not os.path.isabs(fn):
+ dname = os.path.dirname(parentfn)
+ bbpath = "%s:%s" % (dname, data.getVar("BBPATH", True))
+ abs_fn, attempts = bb.utils.which(bbpath, fn, history=True)
+ if abs_fn and bb.parse.check_dependency(data, abs_fn):
+ logger.warn("Duplicate inclusion for %s in %s" % (abs_fn, data.getVar('FILE', True)))
+ for af in attempts:
+ bb.parse.mark_dependency(data, af)
+ if abs_fn:
+ fn = abs_fn
+ elif bb.parse.check_dependency(data, fn):
+ logger.warn("Duplicate inclusion for %s in %s" % (fn, data.getVar('FILE', True)))
+
+ 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')
+
+ if include:
+ bb.parse.mark_dependency(data, abs_fn)
+
+ 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
+
+ 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/import-layers/yocto-poky/bitbake/lib/bb/parse/parse_py/__init__.py b/import-layers/yocto-poky/bitbake/lib/bb/parse/parse_py/__init__.py
new file mode 100644
index 000000000..3e658d0de
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/bb/persist_data.py b/import-layers/yocto-poky/bitbake/lib/bb/persist_data.py
new file mode 100644
index 000000000..e45042324
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/persist_data.py
@@ -0,0 +1,218 @@
+"""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
+
+try:
+ import sqlite3
+except ImportError:
+ from pysqlite2 import dbapi2 as 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, basestring):
+ raise TypeError('Only string keys are supported')
+ elif not isinstance(value, basestring):
+ 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 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", True) or
+ d.getVar("CACHE", True))
+ 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/import-layers/yocto-poky/bitbake/lib/bb/process.py b/import-layers/yocto-poky/bitbake/lib/bb/process.py
new file mode 100644
index 000000000..1c07f2d9b
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/process.py
@@ -0,0 +1,156 @@
+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, basestring):
+ 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)
+
+ try:
+ while pipe.poll() is None:
+ rlist = rin
+ try:
+ r,w,e = select.select (rlist, [], [], 1)
+ except OSError as e:
+ if e.errno != errno.EINTR:
+ raise
+
+ if pipe.stdout in r:
+ data = pipe.stdout.read()
+ if data is not None:
+ outdata.append(data)
+ log.write(data)
+
+ if pipe.stderr in r:
+ data = pipe.stderr.read()
+ if data is not None:
+ errdata.append(data)
+ log.write(data)
+
+ readextras(r)
+
+ finally:
+ log.flush()
+
+ readextras([fobj for fobj, _ in extrafiles])
+
+ 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, basestring) 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 pipe.returncode != 0:
+ raise ExecutionError(cmd, pipe.returncode, stdout, stderr)
+ return stdout, stderr
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/providers.py b/import-layers/yocto-poky/bitbake/lib/bb/providers.py
new file mode 100644
index 000000000..563a091fd
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/providers.py
@@ -0,0 +1,428 @@
+# 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.update_data(localdata)
+ 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, True)
+ if not preferred_v:
+ preferred_v = cfgData.getVar("PREFERRED_VERSION_%s" % pn, True)
+ if not preferred_v:
+ preferred_v = cfgData.getVar("PREFERRED_VERSION", True)
+
+ 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, pkg_pn.keys())
+
+ # First add PREFERRED_VERSIONS
+ for pn in 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 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, True)
+ 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, True)
+ 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, True)
+ #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):
+ """
+ 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]
+
+ 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/import-layers/yocto-poky/bitbake/lib/bb/pysh/__init__.py b/import-layers/yocto-poky/bitbake/lib/bb/pysh/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/pysh/__init__.py
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/pysh/builtin.py b/import-layers/yocto-poky/bitbake/lib/bb/pysh/builtin.py
new file mode 100644
index 000000000..b748e4a4f
--- /dev/null
+++ b/import-layers/yocto-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 xrange(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/import-layers/yocto-poky/bitbake/lib/bb/pysh/interp.py b/import-layers/yocto-poky/bitbake/lib/bb/pysh/interp.py
new file mode 100644
index 000000000..25d8c92ec
--- /dev/null
+++ b/import-layers/yocto-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 xrange(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 xrange(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/import-layers/yocto-poky/bitbake/lib/bb/pysh/lsprof.py b/import-layers/yocto-poky/bitbake/lib/bb/pysh/lsprof.py
new file mode 100644
index 000000000..b1831c22a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/bb/pysh/pysh.py b/import-layers/yocto-poky/bitbake/lib/bb/pysh/pysh.py
new file mode 100644
index 000000000..b4e6145b5
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/bb/pysh/pyshlex.py b/import-layers/yocto-poky/bitbake/lib/bb/pysh/pyshlex.py
new file mode 100644
index 000000000..b30123675
--- /dev/null
+++ b/import-layers/yocto-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 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/import-layers/yocto-poky/bitbake/lib/bb/pysh/pyshyacc.py b/import-layers/yocto-poky/bitbake/lib/bb/pysh/pyshyacc.py
new file mode 100644
index 000000000..e8e80aac4
--- /dev/null
+++ b/import-layers/yocto-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 pyshlex
+tokens = pyshlex.tokens
+
+from ply import yacc
+import 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/import-layers/yocto-poky/bitbake/lib/bb/pysh/sherrors.py b/import-layers/yocto-poky/bitbake/lib/bb/pysh/sherrors.py
new file mode 100644
index 000000000..49d0533de
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/bb/pysh/subprocess_fix.py b/import-layers/yocto-poky/bitbake/lib/bb/pysh/subprocess_fix.py
new file mode 100644
index 000000000..46eca2280
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/bb/runqueue.py b/import-layers/yocto-poky/bitbake/lib/bb/runqueue.py
new file mode 100644
index 000000000..e1b9b2e66
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/runqueue.py
@@ -0,0 +1,2285 @@
+#!/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
+
+try:
+ import cPickle as pickle
+except ImportError:
+ import pickle
+
+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])' )
+
+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.runq_fnid)
+
+ self.prio_map = []
+ self.prio_map.extend(range(self.numTasks))
+
+ self.buildable = []
+ self.stamps = {}
+ for taskid in xrange(self.numTasks):
+ fn = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[taskid]]
+ taskname = self.rqdata.runq_task[taskid]
+ self.stamps[taskid] = bb.build.stampfile(taskname, self.rqdata.dataCache, fn)
+ if self.rq.runq_buildable[taskid] == 1:
+ self.buildable.append(taskid)
+
+ 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 not self.rq.runq_running[x] == 1]
+ if not self.buildable:
+ return None
+ if len(self.buildable) == 1:
+ taskid = self.buildable[0]
+ stamp = self.stamps[taskid]
+ if stamp not in self.rq.build_stamps.itervalues():
+ return taskid
+
+ if not self.rev_prio_map:
+ self.rev_prio_map = range(self.numTasks)
+ for taskid in xrange(self.numTasks):
+ self.rev_prio_map[self.prio_map[taskid]] = taskid
+
+ best = None
+ bestprio = None
+ for taskid in self.buildable:
+ prio = self.rev_prio_map[taskid]
+ if bestprio is None or bestprio > prio:
+ stamp = self.stamps[taskid]
+ if stamp in self.rq.build_stamps.itervalues():
+ continue
+ bestprio = prio
+ best = taskid
+
+ 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 newbuilable(self, task):
+ self.buildable.append(task)
+
+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)
+
+ sortweight = sorted(copy.deepcopy(self.rqdata.runq_weight))
+ copyweight = copy.deepcopy(self.rqdata.runq_weight)
+ self.prio_map = []
+
+ for weight in sortweight:
+ idx = copyweight.index(weight)
+ self.prio_map.append(idx)
+ copyweight[idx] = -1
+
+ self.prio_map.reverse()
+
+class RunQueueSchedulerCompletion(RunQueueSchedulerSpeed):
+ """
+ A scheduler optimised to complete .bb files are 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. 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):
+ RunQueueSchedulerSpeed.__init__(self, runqueue, rqdata)
+
+ #FIXME - whilst this groups all fnids together it does not reorder the
+ #fnid groups optimally.
+
+ basemap = copy.deepcopy(self.prio_map)
+ self.prio_map = []
+ while (len(basemap) > 0):
+ entry = basemap.pop(0)
+ self.prio_map.append(entry)
+ fnid = self.rqdata.runq_fnid[entry]
+ todel = []
+ for entry in basemap:
+ entry_fnid = self.rqdata.runq_fnid[entry]
+ if entry_fnid == fnid:
+ todel.append(basemap.index(entry))
+ self.prio_map.append(entry)
+ todel.reverse()
+ for idx in todel:
+ del basemap[idx]
+
+class RunQueueData:
+ """
+ BitBake Run Queue implementation
+ """
+ def __init__(self, rq, cooker, cfgData, dataCache, taskData, targets):
+ self.cooker = cooker
+ self.dataCache = dataCache
+ self.taskData = taskData
+ self.targets = targets
+ self.rq = rq
+ self.warn_multi_bb = False
+
+ self.stampwhitelist = cfgData.getVar("BB_STAMP_WHITELIST", True) or ""
+ self.multi_provider_whitelist = (cfgData.getVar("MULTI_PROVIDER_WHITELIST", True) or "").split()
+
+ self.reset()
+
+ def reset(self):
+ self.runq_fnid = []
+ self.runq_task = []
+ self.runq_depends = []
+ self.runq_revdeps = []
+ self.runq_hash = []
+
+ def runq_depends_names(self, ids):
+ import re
+ ret = []
+ for id in self.runq_depends[ids]:
+ nam = os.path.basename(self.get_user_idstring(id))
+ nam = re.sub("_[^,]*,", ",", nam)
+ ret.extend([nam])
+ return ret
+
+ def get_task_name(self, task):
+ return self.runq_task[task]
+
+ def get_task_file(self, task):
+ return self.taskData.fn_index[self.runq_fnid[task]]
+
+ def get_task_hash(self, task):
+ return self.runq_hash[task]
+
+ def get_user_idstring(self, task, task_name_suffix = ""):
+ fn = self.taskData.fn_index[self.runq_fnid[task]]
+ taskname = self.runq_task[task] + task_name_suffix
+ return "%s, %s" % (fn, taskname)
+
+ def get_short_user_idstring(self, task, task_name_suffix = ""):
+ fn = self.taskData.fn_index[self.runq_fnid[task]]
+ pn = self.dataCache.pkg_fn[fn]
+ taskname = self.runq_task[task] + task_name_suffix
+ return "%s:%s" % (pn, taskname)
+
+
+ def get_task_id(self, fnid, taskname):
+ for listid in xrange(len(self.runq_fnid)):
+ if self.runq_fnid[listid] == fnid and self.runq_task[listid] == taskname:
+ return listid
+ return None
+
+ 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 xrange(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 xrange(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(taskid, prev_chain):
+ prev_chain.append(taskid)
+ total_deps = []
+ total_deps.extend(self.runq_revdeps[taskid])
+ for revdep in self.runq_revdeps[taskid]:
+ 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 (%s) (dependent Tasks %s)\n" % (dep, self.get_user_idstring(dep), self.runq_depends_names(dep)))
+ 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[taskid] = 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.runq_fnid)
+ weight = []
+ deps_left = []
+ task_done = []
+
+ for listid in xrange(numTasks):
+ task_done.append(False)
+ weight.append(1)
+ deps_left.append(len(self.runq_revdeps[listid]))
+
+ for listid in endpoints:
+ weight[listid] = 10
+ task_done[listid] = True
+
+ while True:
+ next_points = []
+ for listid in endpoints:
+ for revdep in self.runq_depends[listid]:
+ weight[revdep] = weight[revdep] + weight[listid]
+ 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 task in xrange(numTasks):
+ if task_done[task] is False or deps_left[task] != 0:
+ problem_tasks.append(task)
+ logger.debug(2, "Task %s (%s) is not buildable", task, self.get_user_idstring(task))
+ logger.debug(2, "(Complete marker was %s and the remaining dependency count was %s)\n", task_done[task], deps_left[task])
+
+ if problem_tasks:
+ message = "Unbuildable tasks were found.\n"
+ 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
+
+ if len(taskData.tasks_name) == 0:
+ # Nothing to do
+ return 0
+
+ logger.info("Preparing RunQueue")
+
+ # 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):
+ for depid in depids:
+ # Won't be in build_targets if ASSUME_PROVIDED
+ if depid not in taskData.build_targets:
+ continue
+ depdata = taskData.build_targets[depid][0]
+ if depdata is None:
+ continue
+ for taskname in tasknames:
+ taskid = taskData.gettask_id_fromfnid(depdata, taskname)
+ if taskid is not None:
+ depends.add(taskid)
+
+ def add_runtime_dependencies(depids, tasknames, depends):
+ for depid in depids:
+ if depid not in taskData.run_targets:
+ continue
+ depdata = taskData.run_targets[depid][0]
+ if depdata is None:
+ continue
+ for taskname in tasknames:
+ taskid = taskData.gettask_id_fromfnid(depdata, taskname)
+ if taskid is not None:
+ depends.add(taskid)
+
+ def add_resolved_dependencies(depids, tasknames, depends):
+ for depid in depids:
+ for taskname in tasknames:
+ taskid = taskData.gettask_id_fromfnid(depid, taskname)
+ if taskid is not None:
+ depends.add(taskid)
+
+ for task in xrange(len(taskData.tasks_name)):
+ depends = set()
+ fnid = taskData.tasks_fnid[task]
+ fn = taskData.fn_index[fnid]
+ task_deps = self.dataCache.task_deps[fn]
+
+ #logger.debug(2, "Processing %s:%s", fn, taskData.tasks_name[task])
+
+ if fnid not in taskData.failed_fnids:
+
+ # Resolve task internal dependencies
+ #
+ # e.g. addtask before X after Y
+ depends = set(taskData.tasks_tdepends[task])
+
+ # 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 taskData.tasks_name[task] in task_deps['deptask']:
+ tasknames = task_deps['deptask'][taskData.tasks_name[task]].split()
+ add_build_dependencies(taskData.depids[fnid], tasknames, depends)
+
+ # 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 taskData.tasks_name[task] in task_deps['rdeptask']:
+ tasknames = task_deps['rdeptask'][taskData.tasks_name[task]].split()
+ add_runtime_dependencies(taskData.rdepids[fnid], tasknames, depends)
+
+ # Resolve inter-task dependencies
+ #
+ # e.g. do_sometask[depends] = "targetname:do_someothertask"
+ # (makes sure sometask runs after targetname's someothertask)
+ idepends = taskData.tasks_idepends[task]
+ for (depid, idependtask) in idepends:
+ if depid in taskData.build_targets and not depid in taskData.failed_deps:
+ # Won't be in build_targets if ASSUME_PROVIDED
+ depdata = taskData.build_targets[depid][0]
+ if depdata is not None:
+ taskid = taskData.gettask_id_fromfnid(depdata, idependtask)
+ if taskid is None:
+ bb.msg.fatal("RunQueue", "Task %s in %s depends upon non-existent task %s in %s" % (taskData.tasks_name[task], fn, idependtask, taskData.fn_index[depdata]))
+ depends.add(taskid)
+ irdepends = taskData.tasks_irdepends[task]
+ for (depid, idependtask) in irdepends:
+ if depid in taskData.run_targets:
+ # Won't be in run_targets if ASSUME_PROVIDED
+ depdata = taskData.run_targets[depid][0]
+ if depdata is not None:
+ taskid = taskData.gettask_id_fromfnid(depdata, idependtask)
+ if taskid is None:
+ bb.msg.fatal("RunQueue", "Task %s in %s rdepends upon non-existent task %s in %s" % (taskData.tasks_name[task], fn, idependtask, taskData.fn_index[depdata]))
+ depends.add(taskid)
+
+ # 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 taskData.tasks_name[task] in task_deps['recrdeptask']:
+ tasknames = task_deps['recrdeptask'][taskData.tasks_name[task]].split()
+ recursivetasks[task] = tasknames
+ add_build_dependencies(taskData.depids[fnid], tasknames, depends)
+ add_runtime_dependencies(taskData.rdepids[fnid], tasknames, depends)
+ if taskData.tasks_name[task] in tasknames:
+ recursivetasksselfref.add(task)
+
+ if 'recideptask' in task_deps and taskData.tasks_name[task] in task_deps['recideptask']:
+ recursiveitasks[task] = []
+ for t in task_deps['recideptask'][taskData.tasks_name[task]].split():
+ newdep = taskData.gettask_id_fromfnid(fnid, t)
+ recursiveitasks[task].append(newdep)
+
+ self.runq_fnid.append(taskData.tasks_fnid[task])
+ self.runq_task.append(taskData.tasks_name[task])
+ self.runq_depends.append(depends)
+ self.runq_revdeps.append(set())
+ self.runq_hash.append("")
+
+ runq_build.append(0)
+
+ # 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 self.runq_depends to be complete before this is processed
+ extradeps = {}
+ for task in recursivetasks:
+ extradeps[task] = set(self.runq_depends[task])
+ tasknames = recursivetasks[task]
+ seendeps = set()
+ seenfnid = []
+
+ def generate_recdeps(t):
+ newdeps = set()
+ add_resolved_dependencies([taskData.tasks_fnid[t]], tasknames, newdeps)
+ extradeps[task].update(newdeps)
+ seendeps.add(t)
+ newdeps.add(t)
+ for i in newdeps:
+ for n in self.runq_depends[i]:
+ if n not in seendeps:
+ generate_recdeps(n)
+ generate_recdeps(task)
+
+ if task in recursiveitasks:
+ for dep in recursiveitasks[task]:
+ generate_recdeps(dep)
+
+ # Remove circular references so that do_a[recrdeptask] = "do_a do_b" can work
+ for task in recursivetasks:
+ extradeps[task].difference_update(recursivetasksselfref)
+
+ for task in xrange(len(taskData.tasks_name)):
+ # Add in extra dependencies
+ if task in extradeps:
+ self.runq_depends[task] = extradeps[task]
+ # Remove all self references
+ if task in self.runq_depends[task]:
+ logger.debug(2, "Task %s (%s %s) contains self reference! %s", task, taskData.fn_index[taskData.tasks_fnid[task]], taskData.tasks_name[task], self.runq_depends[task])
+ self.runq_depends[task].remove(task)
+
+ # 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(listid, depth):
+ """
+ Mark an item as active along with its depends
+ (calls itself recursively)
+ """
+
+ if runq_build[listid] == 1:
+ return
+
+ runq_build[listid] = 1
+
+ depends = self.runq_depends[listid]
+ for depend in depends:
+ mark_active(depend, depth+1)
+
+ self.target_pairs = []
+ for target in self.targets:
+ targetid = taskData.getbuild_id(target[0])
+
+ if targetid not in taskData.build_targets:
+ continue
+
+ if targetid in taskData.failed_deps:
+ continue
+
+ fnid = taskData.build_targets[targetid][0]
+ fn = taskData.fn_index[fnid]
+ task = target[1]
+ parents = False
+ if task.endswith('-'):
+ parents = True
+ task = task[:-1]
+
+ self.target_pairs.append((fn, task))
+
+ if fnid in taskData.failed_fnids:
+ continue
+
+ if task not in taskData.tasks_lookup[fnid]:
+ import difflib
+ close_matches = difflib.get_close_matches(task, taskData.tasks_lookup[fnid], 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" % (task, target[0], extra))
+
+ # For tasks called "XXXX-", ony run their dependencies
+ listid = taskData.tasks_lookup[fnid][task]
+ if parents:
+ for i in self.runq_depends[listid]:
+ mark_active(i, 1)
+ else:
+ mark_active(listid, 1)
+
+ # Step C - Prune all inactive tasks
+ #
+ # Once all active tasks are marked, prune the ones we don't need.
+
+ maps = []
+ delcount = 0
+ for listid in xrange(len(self.runq_fnid)):
+ if runq_build[listid-delcount] == 1:
+ maps.append(listid-delcount)
+ else:
+ del self.runq_fnid[listid-delcount]
+ del self.runq_task[listid-delcount]
+ del self.runq_depends[listid-delcount]
+ del runq_build[listid-delcount]
+ del self.runq_revdeps[listid-delcount]
+ del self.runq_hash[listid-delcount]
+ delcount = delcount + 1
+ maps.append(-1)
+
+ #
+ # Step D - Sanity checks and computation
+ #
+
+ # Check to make sure we still have tasks to run
+ if len(self.runq_fnid) == 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", delcount, len(self.runq_fnid))
+
+ # Remap the dependencies to account for the deleted tasks
+ # Check we didn't delete a task we depend on
+ for listid in xrange(len(self.runq_fnid)):
+ newdeps = []
+ origdeps = self.runq_depends[listid]
+ for origdep in origdeps:
+ if maps[origdep] == -1:
+ bb.msg.fatal("RunQueue", "Invalid mapping - Should never happen!")
+ newdeps.append(maps[origdep])
+ self.runq_depends[listid] = set(newdeps)
+
+ logger.verbose("Assign Weightings")
+
+ # Generate a list of reverse dependencies to ease future calculations
+ for listid in xrange(len(self.runq_fnid)):
+ for dep in self.runq_depends[listid]:
+ self.runq_revdeps[dep].add(listid)
+
+ # Identify tasks at the end of dependency chains
+ # Error on circular dependency loops (length two)
+ endpoints = []
+ for listid in xrange(len(self.runq_fnid)):
+ revdeps = self.runq_revdeps[listid]
+ if len(revdeps) == 0:
+ endpoints.append(listid)
+ for dep in revdeps:
+ if dep in self.runq_depends[listid]:
+ #self.dump_data(taskData)
+ bb.msg.fatal("RunQueue", "Task %s (%s) has circular dependency on %s (%s)" % (taskData.fn_index[self.runq_fnid[dep]], self.runq_task[dep], taskData.fn_index[self.runq_fnid[listid]], self.runq_task[listid]))
+
+ logger.verbose("Compute totals (have %s endpoint(s))", len(endpoints))
+
+ # Calculate task weights
+ # Check of higher length circular dependencies
+ self.runq_weight = self.calculate_task_weights(endpoints)
+
+ # Sanity Check - Check for multiple tasks building the same provider
+ prov_list = {}
+ seen_fn = []
+ for task in xrange(len(self.runq_fnid)):
+ fn = taskData.fn_index[self.runq_fnid[task]]
+ if fn in seen_fn:
+ continue
+ seen_fn.append(fn)
+ for prov in self.dataCache.fn_provides[fn]:
+ if prov not in prov_list:
+ prov_list[prov] = [fn]
+ elif fn not in prov_list[prov]:
+ prov_list[prov].append(fn)
+ for prov in prov_list:
+ if len(prov_list[prov]) > 1 and prov not in self.multi_provider_whitelist:
+ 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.dataCache.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 task, fnid in enumerate(self.runq_fnid):
+ fn = taskData.fn_index[fnid]
+ if fn != provfn:
+ continue
+ for dep in self.runq_revdeps[task]:
+ fn = taskData.fn_index[self.runq_fnid[dep]]
+ if fn == provfn:
+ continue
+ deps.add(self.get_short_user_idstring(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.dataCache.fn_provides[provfn])
+ rprovides = set()
+ for rprovide in self.dataCache.rproviders:
+ if provfn in self.dataCache.rproviders[rprovide]:
+ rprovides.add(rprovide)
+ for package in self.dataCache.packages:
+ if provfn in self.dataCache.packages[package]:
+ rprovides.add(package)
+ for package in self.dataCache.packages_dynamic:
+ if provfn in self.dataCache.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.warn(msg)
+ else:
+ logger.error(msg)
+
+ # Create a whitelist usable by the stamp checks
+ stampfnwhitelist = []
+ for entry in self.stampwhitelist.split():
+ entryid = self.taskData.getbuild_id(entry)
+ if entryid not in self.taskData.build_targets:
+ continue
+ fnid = self.taskData.build_targets[entryid][0]
+ fn = self.taskData.fn_index[fnid]
+ stampfnwhitelist.append(fn)
+ self.stampfnwhitelist = stampfnwhitelist
+
+ # Iterate over the task list looking for tasks with a 'setscene' function
+ self.runq_setscene = []
+ if not self.cooker.configuration.nosetscene:
+ for task in range(len(self.runq_fnid)):
+ setscene = taskData.gettask_id(self.taskData.fn_index[self.runq_fnid[task]], self.runq_task[task] + "_setscene", False)
+ if not setscene:
+ continue
+ self.runq_setscene.append(task)
+
+ def invalidate_task(fn, taskname, error_nostamp):
+ taskdep = self.dataCache.task_deps[fn]
+ fnid = self.taskData.getfn_id(fn)
+ if taskname not in taskData.tasks_lookup[fnid]:
+ logger.warn("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.dataCache, fn)
+
+ # Invalidate task if force mode active
+ if self.cooker.configuration.force:
+ for (fn, target) in self.target_pairs:
+ invalidate_task(fn, target, False)
+
+ # Invalidate task if invalidate mode active
+ if self.cooker.configuration.invalidate_stamp:
+ for (fn, target) in self.target_pairs:
+ for st in self.cooker.configuration.invalidate_stamp.split(','):
+ if not st.startswith("do_"):
+ st = "do_%s" % st
+ invalidate_task(fn, st, True)
+
+ # Create and print to the logs a virtual/xxxx -> PN (fn) table
+ virtmap = taskData.get_providermap(prefix="virtual/")
+ virtpnmap = {}
+ for v in virtmap:
+ virtpnmap[v] = self.dataCache.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.dataCache)
+
+ # Iterate over the task list and call into the siggen code
+ dealtwith = set()
+ todeal = set(range(len(self.runq_fnid)))
+ while len(todeal) > 0:
+ for task in todeal.copy():
+ if len(self.runq_depends[task] - dealtwith) == 0:
+ dealtwith.add(task)
+ todeal.remove(task)
+ procdep = []
+ for dep in self.runq_depends[task]:
+ procdep.append(self.taskData.fn_index[self.runq_fnid[dep]] + "." + self.runq_task[dep])
+ self.runq_hash[task] = bb.parse.siggen.get_taskhash(self.taskData.fn_index[self.runq_fnid[task]], self.runq_task[task], procdep, self.dataCache)
+
+ bb.parse.siggen.writeout_file_checksum_cache()
+ return len(self.runq_fnid)
+
+ def dump_data(self, taskQueue):
+ """
+ Dump some debug information on the internal data structures
+ """
+ logger.debug(3, "run_tasks:")
+ for task in xrange(len(self.rqdata.runq_task)):
+ logger.debug(3, " (%s)%s - %s: %s Deps %s RevDeps %s", task,
+ taskQueue.fn_index[self.rqdata.runq_fnid[task]],
+ self.rqdata.runq_task[task],
+ self.rqdata.runq_weight[task],
+ self.rqdata.runq_depends[task],
+ self.rqdata.runq_revdeps[task])
+
+ logger.debug(3, "sorted_tasks:")
+ for task1 in xrange(len(self.rqdata.runq_task)):
+ if task1 in self.prio_map:
+ task = self.prio_map[task1]
+ logger.debug(3, " (%s)%s - %s: %s Deps %s RevDeps %s", task,
+ taskQueue.fn_index[self.rqdata.runq_fnid[task]],
+ self.rqdata.runq_task[task],
+ self.rqdata.runq_weight[task],
+ self.rqdata.runq_depends[task],
+ self.rqdata.runq_revdeps[task])
+
+class RunQueue:
+ def __init__(self, cooker, cfgData, dataCache, taskData, targets):
+
+ self.cooker = cooker
+ self.cfgData = cfgData
+ self.rqdata = RunQueueData(self, cooker, cfgData, dataCache, taskData, targets)
+
+ self.stamppolicy = cfgData.getVar("BB_STAMP_POLICY", True) or "perfile"
+ self.hashvalidate = cfgData.getVar("BB_HASHCHECK_FUNCTION", True) or None
+ self.setsceneverify = cfgData.getVar("BB_SETSCENE_VERIFY_FUNCTION", True) or None
+ self.depvalidate = cfgData.getVar("BB_SETSCENE_DEPVALID", True) or None
+
+ self.state = runQueuePrepare
+
+ # For disk space monitor
+ self.dm = monitordisk.diskMonitor(cfgData)
+
+ self.rqexe = None
+ self.worker = None
+ self.workerpipe = None
+ self.fakeworker = None
+ self.fakeworkerpipe = None
+
+ def _start_worker(self, fakeroot = False, rqexec = None):
+ logger.debug(1, "Starting bitbake-worker")
+ magic = "decafbad"
+ if self.cooker.configuration.profile:
+ magic = "decafbadbad"
+ if fakeroot:
+ magic = magic + "beef"
+ fakerootcmd = self.cfgData.getVar("FAKEROOTCMD", True)
+ fakerootenv = (self.cfgData.getVar("FAKEROOTBASEENV", True) 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)
+
+ workerdata = {
+ "taskdeps" : self.rqdata.dataCache.task_deps,
+ "fakerootenv" : self.rqdata.dataCache.fakerootenv,
+ "fakerootdirs" : self.rqdata.dataCache.fakerootdirs,
+ "fakerootnoenv" : self.rqdata.dataCache.fakerootnoenv,
+ "sigdata" : bb.parse.siggen.get_taskdata(),
+ "runq_hash" : self.rqdata.runq_hash,
+ "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", True),
+ "date" : self.cfgData.getVar("DATE", True),
+ "time" : self.cfgData.getVar("TIME", True),
+ }
+
+ worker.stdin.write("<cookerconfig>" + pickle.dumps(self.cooker.configuration) + "</cookerconfig>")
+ worker.stdin.write("<workerdata>" + pickle.dumps(workerdata) + "</workerdata>")
+ worker.stdin.flush()
+
+ return worker, workerpipe
+
+ def _teardown_worker(self, worker, workerpipe):
+ if not worker:
+ return
+ logger.debug(1, "Teardown for bitbake-worker")
+ try:
+ worker.stdin.write("<quit></quit>")
+ worker.stdin.flush()
+ except IOError:
+ pass
+ while worker.returncode is None:
+ workerpipe.read()
+ worker.poll()
+ while workerpipe.read():
+ continue
+ workerpipe.close()
+
+ def start_worker(self):
+ if self.worker:
+ self.teardown_workers()
+ self.teardown = False
+ self.worker, self.workerpipe = self._start_worker()
+
+ def start_fakeworker(self, rqexec):
+ if not self.fakeworker:
+ self.fakeworker, self.fakeworkerpipe = self._start_worker(True, rqexec)
+
+ def teardown_workers(self):
+ self.teardown = True
+ self._teardown_worker(self.worker, self.workerpipe)
+ self.worker = None
+ self.workerpipe = None
+ self._teardown_worker(self.fakeworker, self.fakeworkerpipe)
+ self.fakeworker = None
+ self.fakeworkerpipe = None
+
+ def read_workers(self):
+ self.workerpipe.read()
+ if self.fakeworkerpipe:
+ self.fakeworkerpipe.read()
+
+ def active_fds(self):
+ fds = []
+ if self.workerpipe:
+ fds.append(self.workerpipe.input)
+ if self.fakeworkerpipe:
+ fds.append(self.fakeworkerpipe.input)
+ return fds
+
+ def check_stamp_task(self, task, 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
+
+ if self.stamppolicy == "perfile":
+ fulldeptree = False
+ else:
+ fulldeptree = True
+ stampwhitelist = []
+ if self.stamppolicy == "whitelist":
+ stampwhitelist = self.rqdata.stampfnwhitelist
+
+ fn = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[task]]
+ if taskname is None:
+ taskname = self.rqdata.runq_task[task]
+
+ stampfile = bb.build.stampfile(taskname, self.rqdata.dataCache, fn)
+
+ # 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.dataCache.task_deps[fn]
+ 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.runq_depends[task]:
+ if iscurrent:
+ fn2 = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[dep]]
+ taskname2 = self.rqdata.runq_task[dep]
+ stampfile2 = bb.build.stampfile(taskname2, self.rqdata.dataCache, fn2)
+ stampfile3 = bb.build.stampfile(taskname2 + "_setscene", self.rqdata.dataCache, fn2)
+ t2 = get_timestamp(stampfile2)
+ t3 = get_timestamp(stampfile3)
+ 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
+ if t1 < t2:
+ logger.debug(2, 'Stampfile %s < %s', stampfile, stampfile2)
+ iscurrent = False
+ 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[task] = 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)
+ if self.rqdata.prepare() == 0:
+ self.state = runQueueComplete
+ else:
+ self.state = runQueueSceneInit
+
+ # we are ready to run, see if any UI client needs the dependency info
+ if bb.cooker.CookerFeatures.SEND_DEPENDS_TREE in self.cooker.featureset:
+ depgraph = self.cooker.buildDependTree(self, self.rqdata.taskData)
+ bb.event.fire(bb.event.DepTreeGenerated(depgraph), self.cooker.data)
+
+ if self.state is runQueueSceneInit:
+ dump = self.cooker.configuration.dump_signatures
+ if dump:
+ 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.start_worker()
+ self.rqexe = RunQueueExecuteScenequeue(self)
+
+ if self.state in [runQueueSceneRun, runQueueRunning, runQueueCleanUp]:
+ self.dm.check(self)
+
+ if self.state is runQueueSceneRun:
+ retval = self.rqexe.execute()
+
+ if self.state is runQueueRunInit:
+ if self.cooker.configuration.setsceneonly:
+ self.state = runQueueComplete
+ else:
+ 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()
+
+ if (self.state is runQueueComplete or self.state is runQueueFailed) 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:
+ if not self.rqdata.taskData.tryaltconfigs:
+ raise bb.runqueue.TaskFailure(self.rqexe.failed_fnids)
+ for fnid in self.rqexe.failed_fnids:
+ self.rqdata.taskData.fail_fnid(fnid)
+ self.rqdata.reset()
+
+ 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:
+ logger.error("An uncaught exception occured in runqueue, please see the failure below:")
+ 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 dump_signatures(self, options):
+ done = set()
+ bb.note("Reparsing files to collect dependency data")
+ for task in range(len(self.rqdata.runq_fnid)):
+ if self.rqdata.runq_fnid[task] not in done:
+ fn = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[task]]
+ the_data = bb.cache.Cache.loadDataFull(fn, self.cooker.collection.get_file_appends(fn), self.cooker.data)
+ done.add(self.rqdata.runq_fnid[task])
+
+ bb.parse.siggen.dump_sigs(self.rqdata.dataCache, options)
+
+ return
+
+ def print_diffscenetasks(self):
+
+ valid = []
+ sq_hash = []
+ sq_hashfn = []
+ sq_fn = []
+ sq_taskname = []
+ sq_task = []
+ noexec = []
+ stamppresent = []
+ valid_new = set()
+
+ for task in xrange(len(self.rqdata.runq_fnid)):
+ fn = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[task]]
+ taskname = self.rqdata.runq_task[task]
+ taskdep = self.rqdata.dataCache.task_deps[fn]
+
+ if 'noexec' in taskdep and taskname in taskdep['noexec']:
+ noexec.append(task)
+ continue
+
+ sq_fn.append(fn)
+ sq_hashfn.append(self.rqdata.dataCache.hashfn[fn])
+ sq_hash.append(self.rqdata.runq_hash[task])
+ sq_taskname.append(taskname)
+ sq_task.append(task)
+ locs = { "sq_fn" : sq_fn, "sq_task" : sq_taskname, "sq_hash" : sq_hash, "sq_hashfn" : sq_hashfn, "d" : self.cooker.expanded_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 task in noexec:
+ if task not in self.rqdata.runq_setscene:
+ continue
+ for dep in self.rqdata.runq_depends[task]:
+ hasnoexecparents = True
+ for dep2 in self.rqdata.runq_revdeps[dep]:
+ if dep2 in self.rqdata.runq_setscene and dep2 in noexec:
+ continue
+ hasnoexecparents = False
+ break
+ if hasnoexecparents:
+ valid_new.add(dep)
+
+ invalidtasks = set()
+ for task in xrange(len(self.rqdata.runq_fnid)):
+ if task not in valid_new and task not in noexec:
+ invalidtasks.add(task)
+
+ found = set()
+ processed = set()
+ for task in invalidtasks:
+ toprocess = set([task])
+ while toprocess:
+ next = set()
+ for t in toprocess:
+ for dep in self.rqdata.runq_depends[t]:
+ if dep in invalidtasks:
+ found.add(task)
+ if dep not in processed:
+ processed.add(dep)
+ next.add(dep)
+ toprocess = next
+ if task in found:
+ toprocess = set()
+
+ tasklist = []
+ for task in invalidtasks.difference(found):
+ tasklist.append(self.rqdata.get_user_idstring(task))
+
+ 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 task in invalidtasks:
+ fn = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[task]]
+ pn = self.rqdata.dataCache.pkg_fn[fn]
+ taskname = self.rqdata.runq_task[task]
+ h = self.rqdata.runq_hash[task]
+ 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 matches.iteritems() 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", True) or 1)
+ self.scheduler = self.cfgData.getVar("BB_SCHEDULER", True) or "speed"
+
+ self.runq_buildable = []
+ self.runq_running = []
+ self.runq_complete = []
+
+ self.build_stamps = {}
+ self.build_stamps2 = []
+ self.failed_fnids = []
+
+ self.stampcache = {}
+
+ rq.workerpipe.setrunqueueexec(self)
+ if rq.fakeworkerpipe:
+ rq.fakeworkerpipe.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 worker in [self.rq.worker, self.rq.fakeworker]:
+ if not worker:
+ continue
+ try:
+ worker.stdin.write("<finishnow></finishnow>")
+ worker.stdin.flush()
+ except IOError:
+ # worker must have died?
+ pass
+
+ if len(self.failed_fnids) != 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_fnids) != 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:
+ if setscene:
+ depid = self.rqdata.runq_setscene[dep]
+ else:
+ depid = dep
+ fn = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[depid]]
+ pn = self.rqdata.dataCache.pkg_fn[fn]
+ taskname = self.rqdata.runq_task[depid]
+ 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.expanded_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.runq_fnid))
+
+ self.stampcache = {}
+
+ initial_covered = self.rq.scenequeue_covered.copy()
+
+ # Mark initial buildable tasks
+ for task in xrange(self.stats.total):
+ self.runq_running.append(0)
+ self.runq_complete.append(0)
+ if len(self.rqdata.runq_depends[task]) == 0:
+ self.runq_buildable.append(1)
+ else:
+ self.runq_buildable.append(0)
+ if len(self.rqdata.runq_revdeps[task]) > 0 and self.rqdata.runq_revdeps[task].issubset(self.rq.scenequeue_covered):
+ self.rq.scenequeue_covered.add(task)
+
+ found = True
+ while found:
+ found = False
+ for task in xrange(self.stats.total):
+ if task in self.rq.scenequeue_covered:
+ continue
+ logger.debug(1, 'Considering %s (%s): %s' % (task, self.rqdata.get_user_idstring(task), str(self.rqdata.runq_revdeps[task])))
+
+ if len(self.rqdata.runq_revdeps[task]) > 0 and self.rqdata.runq_revdeps[task].issubset(self.rq.scenequeue_covered):
+ found = True
+ self.rq.scenequeue_covered.add(task)
+
+ 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 = []
+ for task in xrange(len(self.rqdata.runq_task)):
+ fn = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[task]]
+ taskname = self.rqdata.runq_task[task]
+ taskdep = self.rqdata.dataCache.task_deps[fn]
+
+ if 'noexec' in taskdep and taskname in taskdep['noexec']:
+ continue
+ if self.rq.check_stamp_task(task, taskname + "_setscene", cache=self.stampcache):
+ logger.debug(2, 'Setscene stamp current for task %s(%s)', task, self.rqdata.get_user_idstring(task))
+ continue
+ if self.rq.check_stamp_task(task, taskname, recurse = True, cache=self.stampcache):
+ logger.debug(2, 'Normal stamp current for task %s(%s)', task, self.rqdata.get_user_idstring(task))
+ continue
+ invalidtasks.append(task)
+
+ call = self.rq.setsceneverify + "(covered, tasknames, fnids, fns, d, invalidtasks=invalidtasks)"
+ call2 = self.rq.setsceneverify + "(covered, tasknames, fnids, fns, d)"
+ locs = { "covered" : self.rq.scenequeue_covered, "tasknames" : self.rqdata.runq_task, "fnids" : self.rqdata.runq_fnid, "fns" : self.rqdata.taskData.fn_index, "d" : self.cooker.expanded_data, "invalidtasks" : invalidtasks }
+ # Backwards compatibility with older versions without invalidtasks
+ try:
+ covered_remove = bb.utils.better_eval(call, locs)
+ except TypeError:
+ covered_remove = bb.utils.better_eval(call2, locs)
+
+ def removecoveredtask(task):
+ fn = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[task]]
+ taskname = self.rqdata.runq_task[task] + '_setscene'
+ bb.build.del_stamp(taskname, self.rqdata.dataCache, fn)
+ self.rq.scenequeue_covered.remove(task)
+
+ 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.runq_depends[task]:
+ 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)
+
+ event.fire(bb.event.StampUpdate(self.rqdata.target_pairs, self.rqdata.dataCache.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", True)
+ 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[task] = 1
+ self.sched.newbuilable(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[task] = 1
+ for revdep in self.rqdata.runq_revdeps[task]:
+ if self.runq_running[revdep] == 1:
+ continue
+ if self.runq_buildable[revdep] == 1:
+ continue
+ alldeps = 1
+ for dep in self.rqdata.runq_depends[revdep]:
+ if self.runq_complete[dep] != 1:
+ alldeps = 0
+ if alldeps == 1:
+ self.setbuildable(revdep)
+ fn = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[revdep]]
+ taskname = self.rqdata.runq_task[revdep]
+ logger.debug(1, "Marking task %s (%s, %s) as buildable", revdep, fn, taskname)
+
+ 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()
+ fnid = self.rqdata.runq_fnid[task]
+ self.failed_fnids.append(fnid)
+ 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[task] = 1
+ 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()
+ """
+
+ 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:
+ fn = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[task]]
+ taskname = self.rqdata.runq_task[task]
+
+ if task in self.rq.scenequeue_covered:
+ logger.debug(2, "Setscene covered task %s (%s)", task,
+ self.rqdata.get_user_idstring(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 (%s)", task,
+ self.rqdata.get_user_idstring(task))
+ self.task_skip(task, "existing")
+ return True
+
+ taskdep = self.rqdata.dataCache.task_deps[fn]
+ 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[task] = 1
+ self.stats.taskActive()
+ if not self.cooker.configuration.dry_run:
+ bb.build.make_stamp(taskname, self.rqdata.dataCache, fn)
+ 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.dataCache.task_deps[fn]
+ if 'fakeroot' in taskdep and taskname in taskdep['fakeroot'] and not self.cooker.configuration.dry_run:
+ if not self.rq.fakeworker:
+ try:
+ self.rq.start_fakeworker(self)
+ except OSError as exc:
+ logger.critical("Failed to spawn fakeroot worker to run %s:%s: %s" % (fn, taskname, str(exc)))
+ self.rq.state = runQueueFailed
+ return True
+ self.rq.fakeworker.stdin.write("<runtask>" + pickle.dumps((fn, task, taskname, False, self.cooker.collection.get_file_appends(fn), taskdepdata)) + "</runtask>")
+ self.rq.fakeworker.stdin.flush()
+ else:
+ self.rq.worker.stdin.write("<runtask>" + pickle.dumps((fn, task, taskname, False, self.cooker.collection.get_file_appends(fn), taskdepdata)) + "</runtask>")
+ self.rq.worker.stdin.flush()
+
+ self.build_stamps[task] = bb.build.stampfile(taskname, self.rqdata.dataCache, fn)
+ self.build_stamps2.append(self.build_stamps[task])
+ self.runq_running[task] = 1
+ 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_fnids) != 0:
+ self.rq.state = runQueueFailed
+ return True
+
+ # Sanity Checks
+ for task in xrange(self.stats.total):
+ if self.runq_buildable[task] == 0:
+ logger.error("Task %s never buildable!", task)
+ if self.runq_running[task] == 0:
+ logger.error("Task %s never ran!", task)
+ if self.runq_complete[task] == 0:
+ logger.error("Task %s never completed!", task)
+ self.rq.state = runQueueComplete
+
+ return True
+
+ def build_taskdepdata(self, task):
+ taskdepdata = {}
+ next = self.rqdata.runq_depends[task]
+ next.add(task)
+ while next:
+ additional = []
+ for revdep in next:
+ fn = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[revdep]]
+ pn = self.rqdata.dataCache.pkg_fn[fn]
+ taskname = self.rqdata.runq_task[revdep]
+ deps = self.rqdata.runq_depends[revdep]
+ provides = self.rqdata.dataCache.fn_provides[fn]
+ taskdepdata[revdep] = [pn, taskname, fn, deps, provides]
+ 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) == 0:
+ rq.scenequeue_covered = set()
+ rq.state = runQueueRunInit
+ return
+
+ self.stats = RunQueueStats(len(self.rqdata.runq_setscene))
+
+ sq_revdeps = []
+ sq_revdeps_new = []
+ sq_revdeps_squash = []
+ self.sq_harddeps = {}
+
+ # 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.
+
+ for task in xrange(self.stats.total):
+ self.runq_running.append(0)
+ self.runq_complete.append(0)
+ self.runq_buildable.append(0)
+
+ # First process the chains up to the first setscene task.
+ endpoints = {}
+ for task in xrange(len(self.rqdata.runq_fnid)):
+ sq_revdeps.append(copy.copy(self.rqdata.runq_revdeps[task]))
+ sq_revdeps_new.append(set())
+ if (len(self.rqdata.runq_revdeps[task]) == 0) and task not in self.rqdata.runq_setscene:
+ endpoints[task] = set()
+
+ # Secondly process the chains between setscene tasks.
+ for task in self.rqdata.runq_setscene:
+ for dep in self.rqdata.runq_depends[task]:
+ if dep not in endpoints:
+ endpoints[dep] = set()
+ endpoints[dep].add(task)
+
+ 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:
+ sq_revdeps_new[point] = tasks
+ tasks = set()
+ for dep in self.rqdata.runq_depends[point]:
+ if point in sq_revdeps[dep]:
+ sq_revdeps[dep].remove(point)
+ if tasks:
+ sq_revdeps_new[dep] |= tasks
+ if (len(sq_revdeps[dep]) == 0 or len(sq_revdeps_new[dep]) != 0) and dep not in self.rqdata.runq_setscene:
+ newendpoints[dep] = task
+ if len(newendpoints) != 0:
+ process_endpoints(newendpoints)
+
+ process_endpoints(endpoints)
+
+ # 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:
+ sq_revdeps_new2[point] = tasks
+ for dep in self.rqdata.runq_depends[point]:
+ 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:
+ newendpoints[dep] = tasks
+ if len(newendpoints) != 0:
+ process_endpoints2(newendpoints)
+ for task in xrange(len(self.rqdata.runq_fnid)):
+ sq_revdeps2.append(copy.copy(self.rqdata.runq_revdeps[task]))
+ sq_revdeps_new2.append(set())
+ if (len(self.rqdata.runq_revdeps[task]) == 0) and task not in self.rqdata.runq_setscene:
+ endpoints2[task] = set()
+ process_endpoints2(endpoints2)
+ self.unskippable = []
+ for task in self.rqdata.runq_setscene:
+ if sq_revdeps_new2[task]:
+ self.unskippable.append(self.rqdata.runq_setscene.index(task))
+
+ for task in xrange(len(self.rqdata.runq_fnid)):
+ if task in self.rqdata.runq_setscene:
+ deps = set()
+ for dep in sq_revdeps_new[task]:
+ deps.add(self.rqdata.runq_setscene.index(dep))
+ sq_revdeps_squash.append(deps)
+ elif len(sq_revdeps_new[task]) != 0:
+ bb.msg.fatal("RunQueue", "Something went badly wrong during scenequeue generation, aborting. Please report this problem.")
+
+ # 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 task in self.rqdata.runq_setscene:
+ realid = self.rqdata.taskData.gettask_id(self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[task]], self.rqdata.runq_task[task] + "_setscene", False)
+ idepends = self.rqdata.taskData.tasks_idepends[realid]
+ for (depid, idependtask) in idepends:
+ if depid not in self.rqdata.taskData.build_targets:
+ continue
+
+ depdata = self.rqdata.taskData.build_targets[depid][0]
+ if depdata is None:
+ continue
+ dep = self.rqdata.taskData.fn_index[depdata]
+ taskid = self.rqdata.get_task_id(self.rqdata.taskData.getfn_id(dep), idependtask.replace("_setscene", ""))
+ if taskid is None:
+ bb.msg.fatal("RunQueue", "Task %s_setscene depends upon non-existent task %s:%s" % (self.rqdata.get_user_idstring(task), dep, idependtask))
+
+ if not self.rqdata.runq_setscene.index(taskid) in self.sq_harddeps:
+ self.sq_harddeps[self.rqdata.runq_setscene.index(taskid)] = set()
+ self.sq_harddeps[self.rqdata.runq_setscene.index(taskid)].add(self.rqdata.runq_setscene.index(task))
+
+ sq_revdeps_squash[self.rqdata.runq_setscene.index(task)].add(self.rqdata.runq_setscene.index(taskid))
+ # Have to zero this to avoid circular dependencies
+ sq_revdeps_squash[self.rqdata.runq_setscene.index(taskid)] = set()
+
+ for task in self.sq_harddeps:
+ for dep in self.sq_harddeps[task]:
+ sq_revdeps_squash[dep].add(task)
+
+ #for task in xrange(len(sq_revdeps_squash)):
+ # realtask = self.rqdata.runq_setscene[task]
+ # bb.warn("Task %s: %s_setscene is %s " % (task, self.rqdata.get_user_idstring(realtask) , sq_revdeps_squash[task]))
+
+ self.sq_deps = []
+ self.sq_revdeps = sq_revdeps_squash
+ self.sq_revdeps2 = copy.deepcopy(self.sq_revdeps)
+
+ for task in xrange(len(self.sq_revdeps)):
+ self.sq_deps.append(set())
+ for task in xrange(len(self.sq_revdeps)):
+ for dep in self.sq_revdeps[task]:
+ self.sq_deps[dep].add(task)
+
+ for task in xrange(len(self.sq_revdeps)):
+ if len(self.sq_revdeps[task]) == 0:
+ self.runq_buildable[task] = 1
+
+ self.outrightfail = []
+ if self.rq.hashvalidate:
+ sq_hash = []
+ sq_hashfn = []
+ sq_fn = []
+ sq_taskname = []
+ sq_task = []
+ noexec = []
+ stamppresent = []
+ for task in xrange(len(self.sq_revdeps)):
+ realtask = self.rqdata.runq_setscene[task]
+ fn = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[realtask]]
+ taskname = self.rqdata.runq_task[realtask]
+ taskdep = self.rqdata.dataCache.task_deps[fn]
+
+ if 'noexec' in taskdep and taskname in taskdep['noexec']:
+ noexec.append(task)
+ self.task_skip(task)
+ bb.build.make_stamp(taskname + "_setscene", self.rqdata.dataCache, fn)
+ continue
+
+ if self.rq.check_stamp_task(realtask, taskname + "_setscene", cache=self.stampcache):
+ logger.debug(2, 'Setscene stamp current for task %s(%s)', task, self.rqdata.get_user_idstring(realtask))
+ stamppresent.append(task)
+ self.task_skip(task)
+ continue
+
+ if self.rq.check_stamp_task(realtask, taskname, recurse = True, cache=self.stampcache):
+ logger.debug(2, 'Normal stamp current for task %s(%s)', task, self.rqdata.get_user_idstring(realtask))
+ stamppresent.append(task)
+ self.task_skip(task)
+ continue
+
+ sq_fn.append(fn)
+ sq_hashfn.append(self.rqdata.dataCache.hashfn[fn])
+ sq_hash.append(self.rqdata.runq_hash[realtask])
+ sq_taskname.append(taskname)
+ sq_task.append(task)
+ 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.expanded_data }
+ valid = bb.utils.better_eval(call, locs)
+
+ valid_new = stamppresent
+ for v in valid:
+ valid_new.append(sq_task[v])
+
+ for task in xrange(len(self.sq_revdeps)):
+ if task not in valid_new and task not in noexec:
+ realtask = self.rqdata.runq_setscene[task]
+ logger.debug(2, 'No package found, so skipping setscene task %s',
+ self.rqdata.get_user_idstring(realtask))
+ self.outrightfail.append(task)
+
+ 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]:
+ realtask = self.rqdata.runq_setscene[task]
+ realdep = self.rqdata.runq_setscene[dep]
+ logger.debug(2, "%s was unavailable and is a hard dependency of %s so skipping" % (self.rqdata.get_user_idstring(realtask), self.rqdata.get_user_idstring(realdep)))
+ 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[dep] = 1
+
+ def task_completeoutright(self, task):
+ """
+ Mark a task as completed
+ Look at the reverse dependencies and mark any task with
+ completed dependencies as buildable
+ """
+
+ index = self.rqdata.runq_setscene[task]
+ logger.debug(1, 'Found task %s which could be accelerated',
+ self.rqdata.get_user_idstring(index))
+
+ self.scenequeue_covered.add(task)
+ self.scenequeue_updatecounters(task)
+
+ 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)
+
+ def task_failoutright(self, task):
+ self.runq_running[task] = 1
+ self.runq_buildable[task] = 1
+ self.stats.taskCompleted()
+ self.stats.taskSkipped()
+ index = self.rqdata.runq_setscene[task]
+ self.scenequeue_notcovered.add(task)
+ self.scenequeue_updatecounters(task, True)
+
+ def task_skip(self, task):
+ self.runq_running[task] = 1
+ self.runq_buildable[task] = 1
+ 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 xrange(self.stats.total):
+ if self.runq_buildable[nexttask] == 1 and self.runq_running[nexttask] != 1:
+ if nexttask in self.unskippable:
+ logger.debug(2, "Setscene task %s is unskippable" % self.rqdata.get_user_idstring(self.rqdata.runq_setscene[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):
+ realtask = self.rqdata.runq_setscene[nexttask]
+ fn = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[realtask]]
+ foundtarget = False
+ for target in self.rqdata.target_pairs:
+ if target[0] == fn and target[1] == self.rqdata.runq_task[realtask]:
+ foundtarget = True
+ break
+ if not foundtarget:
+ logger.debug(2, "Skipping setscene for task %s" % self.rqdata.get_user_idstring(self.rqdata.runq_setscene[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:
+ realtask = self.rqdata.runq_setscene[task]
+ fn = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[realtask]]
+
+ taskname = self.rqdata.runq_task[realtask] + "_setscene"
+ if self.rq.check_stamp_task(realtask, self.rqdata.runq_task[realtask], recurse = True, cache=self.stampcache):
+ logger.debug(2, 'Stamp for underlying task %s(%s) is current, so skipping setscene variant',
+ task, self.rqdata.get_user_idstring(realtask))
+ self.task_failoutright(task)
+ return True
+
+ if self.cooker.configuration.force:
+ for target in self.rqdata.target_pairs:
+ if target[0] == fn and target[1] == self.rqdata.runq_task[realtask]:
+ self.task_failoutright(task)
+ return True
+
+ if self.rq.check_stamp_task(realtask, taskname, cache=self.stampcache):
+ logger.debug(2, 'Setscene stamp current task %s(%s), so skip it and its dependencies',
+ task, self.rqdata.get_user_idstring(realtask))
+ self.task_skip(task)
+ return True
+
+ startevent = sceneQueueTaskStarted(task, self.stats, self.rq)
+ bb.event.fire(startevent, self.cfgData)
+
+ taskdep = self.rqdata.dataCache.task_deps[fn]
+ if 'fakeroot' in taskdep and taskname in taskdep['fakeroot']:
+ if not self.rq.fakeworker:
+ self.rq.start_fakeworker(self)
+ self.rq.fakeworker.stdin.write("<runtask>" + pickle.dumps((fn, realtask, taskname, True, self.cooker.collection.get_file_appends(fn), None)) + "</runtask>")
+ self.rq.fakeworker.stdin.flush()
+ else:
+ self.rq.worker.stdin.write("<runtask>" + pickle.dumps((fn, realtask, taskname, True, self.cooker.collection.get_file_appends(fn), None)) + "</runtask>")
+ self.rq.worker.stdin.flush()
+
+ self.runq_running[task] = 1
+ 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 task in xrange(self.stats.total):
+ # if self.runq_running[task] != 1:
+ # buildable = self.runq_buildable[task]
+ # revdeps = self.sq_revdeps[task]
+ # bb.warn("Found we didn't run %s %s %s %s" % (task, buildable, str(revdeps), self.rqdata.get_user_idstring(self.rqdata.runq_setscene[task])))
+
+ # Convert scenequeue_covered task numbers into full taskgraph ids
+ oldcovered = self.scenequeue_covered
+ self.rq.scenequeue_covered = set()
+ for task in oldcovered:
+ self.rq.scenequeue_covered.add(self.rqdata.runq_setscene[task])
+
+ logger.debug(1, 'We can skip tasks %s', 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):
+ task = self.rq.rqdata.runq_setscene.index(task)
+
+ RunQueueExecute.runqueue_process_waitpid(self, task, status)
+
+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 = rq.rqdata.get_user_idstring(task)
+ self.taskname = rq.rqdata.get_task_name(task)
+ self.taskfile = rq.rqdata.get_task_file(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)
+ realtask = rq.rqdata.runq_setscene[task]
+ self.taskstring = rq.rqdata.get_user_idstring(realtask, "_setscene")
+ self.taskname = rq.rqdata.get_task_name(realtask) + "_setscene"
+ self.taskfile = rq.rqdata.get_task_file(realtask)
+ self.taskhash = rq.rqdata.get_task_hash(realtask)
+
+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
+
+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
+
+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 = ""
+ self.d = d
+ self.rq = rq
+ self.rqexec = rqexec
+
+ def setrunqueueexec(self, rqexec):
+ self.rqexec = rqexec
+
+ def read(self):
+ for w in [self.rq.worker, self.rq.fakeworker]:
+ if not w:
+ continue
+ w.poll()
+ if w.returncode is not None and not self.rq.teardown:
+ name = None
+ if self.rq.worker and w.pid == self.rq.worker.pid:
+ name = "Worker"
+ elif self.rq.fakeworker and w.pid == self.rq.fakeworker.pid:
+ name = "Fakeroot"
+ bb.error("%s process (%s) exited unexpectedly (%s), shutting down..." % (name, w.pid, str(w.returncode)))
+ self.rq.finish_runqueue(True)
+
+ start = len(self.queue)
+ try:
+ self.queue = self.queue + self.input.read(102400)
+ 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("</event>")
+ while index != -1 and self.queue.startswith("<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("</event>")
+ index = self.queue.find("</exitcode>")
+ while index != -1 and self.queue.startswith("<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("</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()
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/server/__init__.py b/import-layers/yocto-poky/bitbake/lib/bb/server/__init__.py
new file mode 100644
index 000000000..538a633fe
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/server/__init__.py
@@ -0,0 +1,99 @@
+#
+# 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.
+
+""" Base code for Bitbake server process
+
+Have a common base for that all Bitbake server classes ensures a consistent
+approach to the interface, and minimize risks associated with code duplication.
+
+"""
+
+""" BaseImplServer() the base class for all XXServer() implementations.
+
+ These classes contain the actual code that runs the server side, i.e.
+ listens for the commands and executes them. Although these implementations
+ contain all the data of the original bitbake command, i.e the cooker instance,
+ they may well run on a different process or even machine.
+
+"""
+
+class BaseImplServer():
+ def __init__(self):
+ self._idlefuns = {}
+
+ def addcooker(self, cooker):
+ self.cooker = cooker
+
+ 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
+
+
+
+""" BitBakeBaseServerConnection class is the common ancestor to all
+ BitBakeServerConnection classes.
+
+ These classes control the remote server. The only command currently
+ implemented is the terminate() command.
+
+"""
+
+class BitBakeBaseServerConnection():
+ def __init__(self, serverImpl):
+ pass
+
+ def terminate(self):
+ pass
+
+ def setupEventQueue(self):
+ pass
+
+
+""" BitBakeBaseServer class is the common ancestor to all Bitbake servers
+
+ Derive this class in order to implement a BitBakeServer which is the
+ controlling stub for the actual server implementation
+
+"""
+class BitBakeBaseServer(object):
+ def initServer(self):
+ self.serverImpl = None # we ensure a runtime crash if not overloaded
+ self.connection = None
+ return
+
+ def addcooker(self, cooker):
+ self.cooker = cooker
+ self.serverImpl.addcooker(cooker)
+
+ def getServerIdleCB(self):
+ return self.serverImpl.register_idle_function
+
+ def saveConnectionDetails(self):
+ return
+
+ def detach(self):
+ return
+
+ def establishConnection(self, featureset):
+ raise "Must redefine the %s.establishConnection()" % self.__class__.__name__
+
+ def endSession(self):
+ self.connection.terminate()
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/server/process.py b/import-layers/yocto-poky/bitbake/lib/bb/server/process.py
new file mode 100644
index 000000000..a3078a873
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/server/process.py
@@ -0,0 +1,268 @@
+#
+# 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 itertools
+import logging
+import multiprocessing
+import os
+import signal
+import sys
+import time
+import select
+from Queue import Empty
+from multiprocessing import Event, Process, util, Queue, Pipe, queues, Manager
+
+from . import BitBakeBaseServer, BitBakeBaseServerConnection, BaseImplServer
+
+logger = logging.getLogger('BitBake')
+
+class ServerCommunicator():
+ def __init__(self, connection, event_handle, server):
+ self.connection = connection
+ self.event_handle = event_handle
+ self.server = server
+
+ def runCommand(self, command):
+ # @todo try/except
+ self.connection.send(command)
+
+ if not self.server.is_alive():
+ raise SystemExit
+
+ while True:
+ # don't let the user ctrl-c while we're waiting for a response
+ try:
+ for idx in range(0,4): # 0, 1, 2, 3
+ if self.connection.poll(5):
+ return self.connection.recv()
+ else:
+ bb.warn("Timeout while attempting to communicate with bitbake server")
+ bb.fatal("Gave up; Too many tries: timeout while attempting to communicate with bitbake server")
+ except KeyboardInterrupt:
+ pass
+
+ def getEventHandle(self):
+ return self.event_handle.value
+
+class EventAdapter():
+ """
+ Adapter to wrap our event queue since the caller (bb.event) expects to
+ call a send() method, but our actual queue only has put()
+ """
+ def __init__(self, queue):
+ self.queue = queue
+
+ def send(self, event):
+ try:
+ self.queue.put(event)
+ except Exception as err:
+ print("EventAdapter puked: %s" % str(err))
+
+
+class ProcessServer(Process, BaseImplServer):
+ profile_filename = "profile.log"
+ profile_processed_filename = "profile.log.processed"
+
+ def __init__(self, command_channel, event_queue, featurelist):
+ BaseImplServer.__init__(self)
+ Process.__init__(self)
+ self.command_channel = command_channel
+ self.event_queue = event_queue
+ self.event = EventAdapter(event_queue)
+ self.featurelist = featurelist
+ self.quit = False
+
+ self.quitin, self.quitout = Pipe()
+ self.event_handle = multiprocessing.Value("i")
+
+ def run(self):
+ for event in bb.event.ui_queue:
+ self.event_queue.put(event)
+ self.event_handle.value = bb.event.register_UIHhandler(self, True)
+
+ bb.cooker.server_main(self.cooker, self.main)
+
+ def main(self):
+ # Ignore SIGINT within the server, as all SIGINT handling is done by
+ # the UI and communicated to us
+ self.quitin.close()
+ signal.signal(signal.SIGINT, signal.SIG_IGN)
+ bb.utils.set_process_name("Cooker")
+ while not self.quit:
+ try:
+ if self.command_channel.poll():
+ command = self.command_channel.recv()
+ self.runCommand(command)
+ if self.quitout.poll():
+ self.quitout.recv()
+ self.quit = True
+ try:
+ self.runCommand(["stateForceShutdown"])
+ except:
+ pass
+
+ self.idle_commands(.1, [self.command_channel, self.quitout])
+ except Exception:
+ logger.exception('Running command %s', command)
+
+ self.event_queue.close()
+ bb.event.unregister_UIHhandler(self.event_handle.value)
+ self.command_channel.close()
+ self.cooker.shutdown(True)
+ self.quitout.close()
+
+ def idle_commands(self, delay, fds=None):
+ nextsleep = delay
+ if not fds:
+ fds = []
+
+ for function, data in 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):
+ 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
+
+ if nextsleep is not None:
+ select.select(fds,[],[],nextsleep)
+
+ def runCommand(self, command):
+ """
+ Run a cooker command on the server
+ """
+ self.command_channel.send(self.cooker.command.runCommand(command))
+
+ def stop(self):
+ self.quitin.send("quit")
+ self.quitin.close()
+
+class BitBakeProcessServerConnection(BitBakeBaseServerConnection):
+ def __init__(self, serverImpl, ui_channel, event_queue):
+ self.procserver = serverImpl
+ self.ui_channel = ui_channel
+ self.event_queue = event_queue
+ self.connection = ServerCommunicator(self.ui_channel, self.procserver.event_handle, self.procserver)
+ self.events = self.event_queue
+ self.terminated = False
+
+ def sigterm_terminate(self):
+ bb.error("UI received SIGTERM")
+ self.terminate()
+
+ def terminate(self):
+ if self.terminated:
+ return
+ self.terminated = True
+ def flushevents():
+ while True:
+ try:
+ event = self.event_queue.get(block=False)
+ except (Empty, IOError):
+ break
+ if isinstance(event, logging.LogRecord):
+ logger.handle(event)
+
+ signal.signal(signal.SIGINT, signal.SIG_IGN)
+ self.procserver.stop()
+
+ while self.procserver.is_alive():
+ flushevents()
+ self.procserver.join(0.1)
+
+ self.ui_channel.close()
+ self.event_queue.close()
+ self.event_queue.setexit()
+
+# Wrap Queue to provide API which isn't server implementation specific
+class ProcessEventQueue(multiprocessing.queues.Queue):
+ def __init__(self, maxsize):
+ multiprocessing.queues.Queue.__init__(self, maxsize)
+ self.exit = False
+ bb.utils.set_process_name("ProcessEQueue")
+
+ def setexit(self):
+ self.exit = True
+
+ def waitEvent(self, timeout):
+ if self.exit:
+ sys.exit(1)
+ try:
+ if not self.server.is_alive():
+ self.setexit()
+ return None
+ return self.get(True, timeout)
+ except Empty:
+ return None
+
+ def getEvent(self):
+ try:
+ if not self.server.is_alive():
+ self.setexit()
+ return None
+ return self.get(False)
+ except Empty:
+ return None
+
+
+class BitBakeServer(BitBakeBaseServer):
+ def initServer(self, single_use=True):
+ # establish communication channels. We use bidirectional pipes for
+ # ui <--> server command/response pairs
+ # and a queue for server -> ui event notifications
+ #
+ self.ui_channel, self.server_channel = Pipe()
+ self.event_queue = ProcessEventQueue(0)
+ self.serverImpl = ProcessServer(self.server_channel, self.event_queue, None)
+ self.event_queue.server = self.serverImpl
+
+ def detach(self):
+ self.serverImpl.start()
+ return
+
+ def establishConnection(self, featureset):
+
+ self.connection = BitBakeProcessServerConnection(self.serverImpl, self.ui_channel, self.event_queue)
+
+ _, error = self.connection.connection.runCommand(["setFeatures", featureset])
+ if error:
+ logger.error("Unable to set the cooker to the correct featureset: %s" % error)
+ raise BaseException(error)
+ signal.signal(signal.SIGTERM, lambda i, s: self.connection.sigterm_terminate())
+ return self.connection
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/server/xmlrpc.py b/import-layers/yocto-poky/bitbake/lib/bb/server/xmlrpc.py
new file mode 100644
index 000000000..ace1cf646
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/server/xmlrpc.py
@@ -0,0 +1,390 @@
+#
+# BitBake XMLRPC Server
+#
+# 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.
+
+"""
+ This module implements an xmlrpc server for BitBake.
+
+ Use this by deriving a class from BitBakeXMLRPCServer and then adding
+ methods which you want to "export" via XMLRPC. If the methods have the
+ prefix xmlrpc_, then registering those function will happen automatically,
+ if not, you need to call register_function.
+
+ Use register_idle_function() to add a function which the xmlrpc server
+ calls from within server_forever when no requests are pending. Make sure
+ that those functions are non-blocking or else you will introduce latency
+ in the server's main loop.
+"""
+
+import bb
+import xmlrpclib, sys
+from bb import daemonize
+from bb.ui import uievent
+import hashlib, time
+import socket
+import os, signal
+import threading
+try:
+ import cPickle as pickle
+except ImportError:
+ import pickle
+
+DEBUG = False
+
+from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
+import inspect, select, httplib
+
+from . import BitBakeBaseServer, BitBakeBaseServerConnection, BaseImplServer
+
+class BBTransport(xmlrpclib.Transport):
+ def __init__(self, timeout):
+ self.timeout = timeout
+ self.connection_token = None
+ xmlrpclib.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, httplib.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)
+ xmlrpclib.Transport.send_content(self, h, body)
+
+def _create_server(host, port, timeout = 60):
+ t = BBTransport(timeout)
+ s = xmlrpclib.ServerProxy("http://%s:%d/" % (host, port), transport=t, allow_none=True)
+ return s, t
+
+class BitBakeServerCommands():
+
+ def __init__(self, server):
+ self.server = server
+ self.has_client = False
+
+ def registerEventHandler(self, host, port):
+ """
+ Register a remote UI Event Handler
+ """
+ s, t = _create_server(host, port)
+
+ # we don't allow connections if the cooker is running
+ if (self.cooker.state in [bb.cooker.state.parsing, bb.cooker.state.running]):
+ return None, "Cooker is busy: %s" % bb.cooker.state.get_name(self.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
+ """
+ return bb.event.unregister_UIHhandler(handlerNum)
+
+ def runCommand(self, command):
+ """
+ Run a cooker command on the server
+ """
+ return self.cooker.command.runCommand(command, self.server.readonly)
+
+ def getEventHandle(self):
+ return self.event_handle
+
+ def terminateServer(self):
+ """
+ Trigger the server to quit
+ """
+ self.server.quit = True
+ print("Server (cooker) exiting")
+ return
+
+ def addClient(self):
+ if self.has_client:
+ return None
+ token = hashlib.md5(str(time.time())).hexdigest()
+ self.server.set_connection_token(token)
+ self.has_client = True
+ return token
+
+ def removeClient(self):
+ if self.has_client:
+ self.server.set_connection_token(None)
+ self.has_client = False
+ if self.server.single_use:
+ self.server.quit = True
+
+# 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 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(response)
+
+
+class XMLRPCProxyServer(BaseImplServer):
+ """ not a real working server, but a stub for a proxy server connection
+
+ """
+ def __init__(self, host, port):
+ self.host = host
+ self.port = port
+
+class XMLRPCServer(SimpleXMLRPCServer, BaseImplServer):
+ # remove this when you're done with debugging
+ # allow_reuse_address = True
+
+ def __init__(self, interface, single_use=False):
+ """
+ Constructor
+ """
+ BaseImplServer.__init__(self)
+ self.single_use = single_use
+ # 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.connection_token = None
+ #self.register_introspection_functions()
+ self.commands = BitBakeServerCommands(self)
+ self.autoregister_all_functions(self.commands, "")
+ self.interface = interface
+
+ def addcooker(self, cooker):
+ BaseImplServer.addcooker(self, cooker)
+ self.commands.cooker = cooker
+
+ def autoregister_all_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 serve_forever(self):
+ # Start the actual XMLRPC server
+ bb.cooker.server_main(self.cooker, self._serve_forever)
+
+ def _serve_forever(self):
+ """
+ Serve Requests. Overloaded to honor a quit command
+ """
+ self.quit = False
+ while not self.quit:
+ fds = [self]
+ nextsleep = 0.1
+ for function, data in self._idlefuns.items():
+ retval = None
+ try:
+ retval = function(self, data, False)
+ if retval is False:
+ del self._idlefuns[function]
+ elif retval is True:
+ nextsleep = 0
+ elif isinstance(retval, float):
+ if (retval < nextsleep):
+ nextsleep = retval
+ else:
+ fds = fds + retval
+ except SystemExit:
+ raise
+ except:
+ import traceback
+ traceback.print_exc()
+ if retval == None:
+ # the function execute failed; delete it
+ del self._idlefuns[function]
+ pass
+
+ socktimeout = self.socket.gettimeout() or nextsleep
+ socktimeout = min(socktimeout, nextsleep)
+ # Mirror what BaseServer handle_request would do
+ try:
+ fd_sets = select.select(fds, [], [], socktimeout)
+ if fd_sets[0] and self in fd_sets[0]:
+ self._handle_request_noblock()
+ except IOError:
+ # we ignore interrupted calls
+ pass
+
+ # Tell idle functions we're exiting
+ for function, data in self._idlefuns.items():
+ try:
+ retval = function(self, data, True)
+ except:
+ pass
+ self.server_close()
+ return
+
+ def set_connection_token(self, token):
+ self.connection_token = token
+
+class BitBakeXMLRPCServerConnection(BitBakeBaseServerConnection):
+ def __init__(self, serverImpl, clientinfo=("localhost", 0), observer_only = False, featureset = None):
+ self.connection, self.transport = _create_server(serverImpl.host, serverImpl.port)
+ self.clientinfo = clientinfo
+ self.serverImpl = serverImpl
+ self.observer_only = observer_only
+ if featureset:
+ self.featureset = featureset
+ else:
+ self.featureset = []
+
+ 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 setupEventQueue(self):
+ self.events = uievent.BBUIEventQueue(self.connection, self.clientinfo)
+ for event in bb.event.ui_queue:
+ self.events.queue_event(event)
+
+ _, 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 removeClient(self):
+ if not self.observer_only:
+ self.connection.removeClient()
+
+ def terminate(self):
+ # Don't wait for server indefinitely
+ import socket
+ socket.setdefaulttimeout(2)
+ try:
+ self.events.system_quit()
+ except:
+ pass
+ try:
+ self.connection.removeClient()
+ except:
+ pass
+
+class BitBakeServer(BitBakeBaseServer):
+ def initServer(self, interface = ("localhost", 0), single_use = False):
+ self.interface = interface
+ self.serverImpl = XMLRPCServer(interface, single_use)
+
+ def detach(self):
+ daemonize.createDaemon(self.serverImpl.serve_forever, "bitbake-cookerdaemon.log")
+ del self.cooker
+
+ def establishConnection(self, featureset):
+ self.connection = BitBakeXMLRPCServerConnection(self.serverImpl, self.interface, False, featureset)
+ return self.connection.connect()
+
+ def set_connection_token(self, token):
+ self.connection.transport.set_connection_token(token)
+
+class BitBakeXMLRPCClient(BitBakeBaseServer):
+
+ def __init__(self, observer_only = False, token = None):
+ self.token = token
+
+ self.observer_only = observer_only
+ # if we need extra caches, just tell the server to load them all
+ pass
+
+ def saveConnectionDetails(self, remote):
+ self.remote = remote
+
+ def establishConnection(self, featureset):
+ # The format of "remote" must be "server:port"
+ try:
+ [host, port] = self.remote.split(":")
+ port = int(port)
+ except Exception as e:
+ bb.warn("Failed to read remote definition (%s)" % 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:
+ self.serverImpl = XMLRPCProxyServer(host, port)
+ self.connection = BitBakeXMLRPCServerConnection(self.serverImpl, (ip, 0), self.observer_only, featureset)
+ return self.connection.connect(self.token)
+ except Exception as e:
+ bb.warn("Could not connect to server at %s:%s (%s)" % (host, port, str(e)))
+ raise e
+
+ def endSession(self):
+ self.connection.removeClient()
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/shell.py b/import-layers/yocto-poky/bitbake/lib/bb/shell.py
new file mode 100644
index 000000000..1dd8d54bd
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/shell.py
@@ -0,0 +1,820 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+##########################################################################
+#
+# Copyright (C) 2005-2006 Michael 'Mickey' Lauer <mickey@Vanille.de>
+# Copyright (C) 2005-2006 Vanille Media
+#
+# 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.
+#
+##########################################################################
+#
+# Thanks to:
+# * Holger Freyther <zecke@handhelds.org>
+# * Justin Patrin <papercrane@reversefold.com>
+#
+##########################################################################
+
+"""
+BitBake Shell
+
+IDEAS:
+ * list defined tasks per package
+ * list classes
+ * toggle force
+ * command to reparse just one (or more) bbfile(s)
+ * automatic check if reparsing is necessary (inotify?)
+ * frontend for bb file manipulation
+ * more shell-like features:
+ - output control, i.e. pipe output into grep, sort, etc.
+ - job control, i.e. bring running commands into background and foreground
+ * start parsing in background right after startup
+ * ncurses interface
+
+PROBLEMS:
+ * force doesn't always work
+ * readline completion for commands with more than one parameters
+
+"""
+
+##########################################################################
+# Import and setup global variables
+##########################################################################
+
+from __future__ import print_function
+from functools import reduce
+try:
+ set
+except NameError:
+ from sets import Set as set
+import sys, os, readline, socket, httplib, urllib, commands, popen2, shlex, Queue, fnmatch
+from bb import data, parse, build, cache, taskdata, runqueue, providers as Providers
+
+__version__ = "0.5.3.1"
+__credits__ = """BitBake Shell Version %s (C) 2005 Michael 'Mickey' Lauer <mickey@Vanille.de>
+Type 'help' for more information, press CTRL-D to exit.""" % __version__
+
+cmds = {}
+leave_mainloop = False
+last_exception = None
+cooker = None
+parsed = False
+debug = os.environ.get( "BBSHELL_DEBUG", "" )
+
+##########################################################################
+# Class BitBakeShellCommands
+##########################################################################
+
+class BitBakeShellCommands:
+ """This class contains the valid commands for the shell"""
+
+ def __init__( self, shell ):
+ """Register all the commands"""
+ self._shell = shell
+ for attr in BitBakeShellCommands.__dict__:
+ if not attr.startswith( "_" ):
+ if attr.endswith( "_" ):
+ command = attr[:-1].lower()
+ else:
+ command = attr[:].lower()
+ method = getattr( BitBakeShellCommands, attr )
+ debugOut( "registering command '%s'" % command )
+ # scan number of arguments
+ usage = getattr( method, "usage", "" )
+ if usage != "<...>":
+ numArgs = len( usage.split() )
+ else:
+ numArgs = -1
+ shell.registerCommand( command, method, numArgs, "%s %s" % ( command, usage ), method.__doc__ )
+
+ def _checkParsed( self ):
+ if not parsed:
+ print("SHELL: This command needs to parse bbfiles...")
+ self.parse( None )
+
+ def _findProvider( self, item ):
+ self._checkParsed()
+ # Need to use taskData for this information
+ preferred = data.getVar( "PREFERRED_PROVIDER_%s" % item, cooker.configuration.data, 1 )
+ if not preferred: preferred = item
+ try:
+ lv, lf, pv, pf = Providers.findBestProvider(preferred, cooker.configuration.data, cooker.status)
+ except KeyError:
+ if item in cooker.status.providers:
+ pf = cooker.status.providers[item][0]
+ else:
+ pf = None
+ return pf
+
+ def alias( self, params ):
+ """Register a new name for a command"""
+ new, old = params
+ if not old in cmds:
+ print("ERROR: Command '%s' not known" % old)
+ else:
+ cmds[new] = cmds[old]
+ print("OK")
+ alias.usage = "<alias> <command>"
+
+ def buffer( self, params ):
+ """Dump specified output buffer"""
+ index = params[0]
+ print(self._shell.myout.buffer( int( index ) ))
+ buffer.usage = "<index>"
+
+ def buffers( self, params ):
+ """Show the available output buffers"""
+ commands = self._shell.myout.bufferedCommands()
+ if not commands:
+ print("SHELL: No buffered commands available yet. Start doing something.")
+ else:
+ print("="*35, "Available Output Buffers", "="*27)
+ for index, cmd in enumerate( commands ):
+ print("| %s %s" % ( str( index ).ljust( 3 ), cmd ))
+ print("="*88)
+
+ def build( self, params, cmd = "build" ):
+ """Build a providee"""
+ global last_exception
+ globexpr = params[0]
+ self._checkParsed()
+ names = globfilter( cooker.status.pkg_pn, globexpr )
+ if len( names ) == 0: names = [ globexpr ]
+ print("SHELL: Building %s" % ' '.join( names ))
+
+ td = taskdata.TaskData(cooker.configuration.abort)
+ localdata = data.createCopy(cooker.configuration.data)
+ data.update_data(localdata)
+ data.expandKeys(localdata)
+
+ try:
+ tasks = []
+ for name in names:
+ td.add_provider(localdata, cooker.status, name)
+ providers = td.get_provider(name)
+
+ if len(providers) == 0:
+ raise Providers.NoProvider
+
+ tasks.append([name, "do_%s" % cmd])
+
+ td.add_unresolved(localdata, cooker.status)
+
+ rq = runqueue.RunQueue(cooker, localdata, cooker.status, td, tasks)
+ rq.prepare_runqueue()
+ rq.execute_runqueue()
+
+ except Providers.NoProvider:
+ print("ERROR: No Provider")
+ last_exception = Providers.NoProvider
+
+ except runqueue.TaskFailure as fnids:
+ last_exception = runqueue.TaskFailure
+
+ except build.FuncFailed as e:
+ print("ERROR: Couldn't build '%s'" % names)
+ last_exception = e
+
+
+ build.usage = "<providee>"
+
+ def clean( self, params ):
+ """Clean a providee"""
+ self.build( params, "clean" )
+ clean.usage = "<providee>"
+
+ def compile( self, params ):
+ """Execute 'compile' on a providee"""
+ self.build( params, "compile" )
+ compile.usage = "<providee>"
+
+ def configure( self, params ):
+ """Execute 'configure' on a providee"""
+ self.build( params, "configure" )
+ configure.usage = "<providee>"
+
+ def install( self, params ):
+ """Execute 'install' on a providee"""
+ self.build( params, "install" )
+ install.usage = "<providee>"
+
+ def edit( self, params ):
+ """Call $EDITOR on a providee"""
+ name = params[0]
+ bbfile = self._findProvider( name )
+ if bbfile is not None:
+ os.system( "%s %s" % ( os.environ.get( "EDITOR", "vi" ), bbfile ) )
+ else:
+ print("ERROR: Nothing provides '%s'" % name)
+ edit.usage = "<providee>"
+
+ def environment( self, params ):
+ """Dump out the outer BitBake environment"""
+ cooker.showEnvironment()
+
+ def exit_( self, params ):
+ """Leave the BitBake Shell"""
+ debugOut( "setting leave_mainloop to true" )
+ global leave_mainloop
+ leave_mainloop = True
+
+ def fetch( self, params ):
+ """Fetch a providee"""
+ self.build( params, "fetch" )
+ fetch.usage = "<providee>"
+
+ def fileBuild( self, params, cmd = "build" ):
+ """Parse and build a .bb file"""
+ global last_exception
+ name = params[0]
+ bf = completeFilePath( name )
+ print("SHELL: Calling '%s' on '%s'" % ( cmd, bf ))
+
+ try:
+ cooker.buildFile(bf, cmd)
+ except parse.ParseError:
+ print("ERROR: Unable to open or parse '%s'" % bf)
+ except build.FuncFailed as e:
+ print("ERROR: Couldn't build '%s'" % name)
+ last_exception = e
+
+ fileBuild.usage = "<bbfile>"
+
+ def fileClean( self, params ):
+ """Clean a .bb file"""
+ self.fileBuild( params, "clean" )
+ fileClean.usage = "<bbfile>"
+
+ def fileEdit( self, params ):
+ """Call $EDITOR on a .bb file"""
+ name = params[0]
+ os.system( "%s %s" % ( os.environ.get( "EDITOR", "vi" ), completeFilePath( name ) ) )
+ fileEdit.usage = "<bbfile>"
+
+ def fileRebuild( self, params ):
+ """Rebuild (clean & build) a .bb file"""
+ self.fileBuild( params, "rebuild" )
+ fileRebuild.usage = "<bbfile>"
+
+ def fileReparse( self, params ):
+ """(re)Parse a bb file"""
+ bbfile = params[0]
+ print("SHELL: Parsing '%s'" % bbfile)
+ parse.update_mtime( bbfile )
+ cooker.parser.reparse(bbfile)
+ if False: #fromCache:
+ print("SHELL: File has not been updated, not reparsing")
+ else:
+ print("SHELL: Parsed")
+ fileReparse.usage = "<bbfile>"
+
+ def abort( self, params ):
+ """Toggle abort task execution flag (see bitbake -k)"""
+ cooker.configuration.abort = not cooker.configuration.abort
+ print("SHELL: Abort Flag is now '%s'" % repr( cooker.configuration.abort ))
+
+ def force( self, params ):
+ """Toggle force task execution flag (see bitbake -f)"""
+ cooker.configuration.force = not cooker.configuration.force
+ print("SHELL: Force Flag is now '%s'" % repr( cooker.configuration.force ))
+
+ def help( self, params ):
+ """Show a comprehensive list of commands and their purpose"""
+ print("="*30, "Available Commands", "="*30)
+ for cmd in sorted(cmds):
+ function, numparams, usage, helptext = cmds[cmd]
+ print("| %s | %s" % (usage.ljust(30), helptext))
+ print("="*78)
+
+ def lastError( self, params ):
+ """Show the reason or log that was produced by the last BitBake event exception"""
+ if last_exception is None:
+ print("SHELL: No Errors yet (Phew)...")
+ else:
+ reason, event = last_exception.args
+ print("SHELL: Reason for the last error: '%s'" % reason)
+ if ':' in reason:
+ msg, filename = reason.split( ':' )
+ filename = filename.strip()
+ print("SHELL: Dumping log file for last error:")
+ try:
+ print(open( filename ).read())
+ except IOError:
+ print("ERROR: Couldn't open '%s'" % filename)
+
+ def match( self, params ):
+ """Dump all files or providers matching a glob expression"""
+ what, globexpr = params
+ if what == "files":
+ self._checkParsed()
+ for key in globfilter( cooker.status.pkg_fn, globexpr ): print(key)
+ elif what == "providers":
+ self._checkParsed()
+ for key in globfilter( cooker.status.pkg_pn, globexpr ): print(key)
+ else:
+ print("Usage: match %s" % self.print_.usage)
+ match.usage = "<files|providers> <glob>"
+
+ def new( self, params ):
+ """Create a new .bb file and open the editor"""
+ dirname, filename = params
+ packages = '/'.join( data.getVar( "BBFILES", cooker.configuration.data, 1 ).split('/')[:-2] )
+ fulldirname = "%s/%s" % ( packages, dirname )
+
+ if not os.path.exists( fulldirname ):
+ print("SHELL: Creating '%s'" % fulldirname)
+ os.mkdir( fulldirname )
+ if os.path.exists( fulldirname ) and os.path.isdir( fulldirname ):
+ if os.path.exists( "%s/%s" % ( fulldirname, filename ) ):
+ print("SHELL: ERROR: %s/%s already exists" % ( fulldirname, filename ))
+ return False
+ print("SHELL: Creating '%s/%s'" % ( fulldirname, filename ))
+ newpackage = open( "%s/%s" % ( fulldirname, filename ), "w" )
+ print("""DESCRIPTION = ""
+SECTION = ""
+AUTHOR = ""
+HOMEPAGE = ""
+MAINTAINER = ""
+LICENSE = "GPL"
+PR = "r0"
+
+SRC_URI = ""
+
+#inherit base
+
+#do_configure() {
+#
+#}
+
+#do_compile() {
+#
+#}
+
+#do_stage() {
+#
+#}
+
+#do_install() {
+#
+#}
+""", file=newpackage)
+ newpackage.close()
+ os.system( "%s %s/%s" % ( os.environ.get( "EDITOR" ), fulldirname, filename ) )
+ new.usage = "<directory> <filename>"
+
+ def package( self, params ):
+ """Execute 'package' on a providee"""
+ self.build( params, "package" )
+ package.usage = "<providee>"
+
+ def pasteBin( self, params ):
+ """Send a command + output buffer to the pastebin at http://rafb.net/paste"""
+ index = params[0]
+ contents = self._shell.myout.buffer( int( index ) )
+ sendToPastebin( "output of " + params[0], contents )
+ pasteBin.usage = "<index>"
+
+ def pasteLog( self, params ):
+ """Send the last event exception error log (if there is one) to http://rafb.net/paste"""
+ if last_exception is None:
+ print("SHELL: No Errors yet (Phew)...")
+ else:
+ reason, event = last_exception.args
+ print("SHELL: Reason for the last error: '%s'" % reason)
+ if ':' in reason:
+ msg, filename = reason.split( ':' )
+ filename = filename.strip()
+ print("SHELL: Pasting log file to pastebin...")
+
+ file = open( filename ).read()
+ sendToPastebin( "contents of " + filename, file )
+
+ def patch( self, params ):
+ """Execute 'patch' command on a providee"""
+ self.build( params, "patch" )
+ patch.usage = "<providee>"
+
+ def parse( self, params ):
+ """(Re-)parse .bb files and calculate the dependency graph"""
+ cooker.status = cache.CacheData(cooker.caches_array)
+ ignore = data.getVar("ASSUME_PROVIDED", cooker.configuration.data, 1) or ""
+ cooker.status.ignored_dependencies = set( ignore.split() )
+ cooker.handleCollections( data.getVar("BBFILE_COLLECTIONS", cooker.configuration.data, 1) )
+
+ (filelist, masked) = cooker.collect_bbfiles()
+ cooker.parse_bbfiles(filelist, masked, cooker.myProgressCallback)
+ cooker.buildDepgraph()
+ global parsed
+ parsed = True
+ print()
+
+ def reparse( self, params ):
+ """(re)Parse a providee's bb file"""
+ bbfile = self._findProvider( params[0] )
+ if bbfile is not None:
+ print("SHELL: Found bbfile '%s' for '%s'" % ( bbfile, params[0] ))
+ self.fileReparse( [ bbfile ] )
+ else:
+ print("ERROR: Nothing provides '%s'" % params[0])
+ reparse.usage = "<providee>"
+
+ def getvar( self, params ):
+ """Dump the contents of an outer BitBake environment variable"""
+ var = params[0]
+ value = data.getVar( var, cooker.configuration.data, 1 )
+ print(value)
+ getvar.usage = "<variable>"
+
+ def peek( self, params ):
+ """Dump contents of variable defined in providee's metadata"""
+ name, var = params
+ bbfile = self._findProvider( name )
+ if bbfile is not None:
+ the_data = cache.Cache.loadDataFull(bbfile, cooker.configuration.data)
+ value = the_data.getVar( var, 1 )
+ print(value)
+ else:
+ print("ERROR: Nothing provides '%s'" % name)
+ peek.usage = "<providee> <variable>"
+
+ def poke( self, params ):
+ """Set contents of variable defined in providee's metadata"""
+ name, var, value = params
+ bbfile = self._findProvider( name )
+ if bbfile is not None:
+ print("ERROR: Sorry, this functionality is currently broken")
+ #d = cooker.pkgdata[bbfile]
+ #data.setVar( var, value, d )
+
+ # mark the change semi persistant
+ #cooker.pkgdata.setDirty(bbfile, d)
+ #print "OK"
+ else:
+ print("ERROR: Nothing provides '%s'" % name)
+ poke.usage = "<providee> <variable> <value>"
+
+ def print_( self, params ):
+ """Dump all files or providers"""
+ what = params[0]
+ if what == "files":
+ self._checkParsed()
+ for key in cooker.status.pkg_fn: print(key)
+ elif what == "providers":
+ self._checkParsed()
+ for key in cooker.status.providers: print(key)
+ else:
+ print("Usage: print %s" % self.print_.usage)
+ print_.usage = "<files|providers>"
+
+ def python( self, params ):
+ """Enter the expert mode - an interactive BitBake Python Interpreter"""
+ sys.ps1 = "EXPERT BB>>> "
+ sys.ps2 = "EXPERT BB... "
+ import code
+ interpreter = code.InteractiveConsole( dict( globals() ) )
+ interpreter.interact( "SHELL: Expert Mode - BitBake Python %s\nType 'help' for more information, press CTRL-D to switch back to BBSHELL." % sys.version )
+
+ def showdata( self, params ):
+ """Execute 'showdata' on a providee"""
+ cooker.showEnvironment(None, params)
+ showdata.usage = "<providee>"
+
+ def setVar( self, params ):
+ """Set an outer BitBake environment variable"""
+ var, value = params
+ data.setVar( var, value, cooker.configuration.data )
+ print("OK")
+ setVar.usage = "<variable> <value>"
+
+ def rebuild( self, params ):
+ """Clean and rebuild a .bb file or a providee"""
+ self.build( params, "clean" )
+ self.build( params, "build" )
+ rebuild.usage = "<providee>"
+
+ def shell( self, params ):
+ """Execute a shell command and dump the output"""
+ if params != "":
+ print(commands.getoutput( " ".join( params ) ))
+ shell.usage = "<...>"
+
+ def stage( self, params ):
+ """Execute 'stage' on a providee"""
+ self.build( params, "populate_staging" )
+ stage.usage = "<providee>"
+
+ def status( self, params ):
+ """<just for testing>"""
+ print("-" * 78)
+ print("building list = '%s'" % cooker.building_list)
+ print("build path = '%s'" % cooker.build_path)
+ print("consider_msgs_cache = '%s'" % cooker.consider_msgs_cache)
+ print("build stats = '%s'" % cooker.stats)
+ if last_exception is not None: print("last_exception = '%s'" % repr( last_exception.args ))
+ print("memory output contents = '%s'" % self._shell.myout._buffer)
+
+ def test( self, params ):
+ """<just for testing>"""
+ print("testCommand called with '%s'" % params)
+
+ def unpack( self, params ):
+ """Execute 'unpack' on a providee"""
+ self.build( params, "unpack" )
+ unpack.usage = "<providee>"
+
+ def which( self, params ):
+ """Computes the providers for a given providee"""
+ # Need to use taskData for this information
+ item = params[0]
+
+ self._checkParsed()
+
+ preferred = data.getVar( "PREFERRED_PROVIDER_%s" % item, cooker.configuration.data, 1 )
+ if not preferred: preferred = item
+
+ try:
+ lv, lf, pv, pf = Providers.findBestProvider(preferred, cooker.configuration.data, cooker.status)
+ except KeyError:
+ lv, lf, pv, pf = (None,)*4
+
+ try:
+ providers = cooker.status.providers[item]
+ except KeyError:
+ print("SHELL: ERROR: Nothing provides", preferred)
+ else:
+ for provider in providers:
+ if provider == pf: provider = " (***) %s" % provider
+ else: provider = " %s" % provider
+ print(provider)
+ which.usage = "<providee>"
+
+##########################################################################
+# Common helper functions
+##########################################################################
+
+def completeFilePath( bbfile ):
+ """Get the complete bbfile path"""
+ if not cooker.status: return bbfile
+ if not cooker.status.pkg_fn: return bbfile
+ for key in cooker.status.pkg_fn:
+ if key.endswith( bbfile ):
+ return key
+ return bbfile
+
+def sendToPastebin( desc, content ):
+ """Send content to http://oe.pastebin.com"""
+ mydata = {}
+ mydata["lang"] = "Plain Text"
+ mydata["desc"] = desc
+ mydata["cvt_tabs"] = "No"
+ mydata["nick"] = "%s@%s" % ( os.environ.get( "USER", "unknown" ), socket.gethostname() or "unknown" )
+ mydata["text"] = content
+ params = urllib.urlencode( mydata )
+ headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain"}
+
+ host = "rafb.net"
+ conn = httplib.HTTPConnection( "%s:80" % host )
+ conn.request("POST", "/paste/paste.php", params, headers )
+
+ response = conn.getresponse()
+ conn.close()
+
+ if response.status == 302:
+ location = response.getheader( "location" ) or "unknown"
+ print("SHELL: Pasted to http://%s%s" % ( host, location ))
+ else:
+ print("ERROR: %s %s" % ( response.status, response.reason ))
+
+def completer( text, state ):
+ """Return a possible readline completion"""
+ debugOut( "completer called with text='%s', state='%d'" % ( text, state ) )
+
+ if state == 0:
+ line = readline.get_line_buffer()
+ if " " in line:
+ line = line.split()
+ # we are in second (or more) argument
+ if line[0] in cmds and hasattr( cmds[line[0]][0], "usage" ): # known command and usage
+ u = getattr( cmds[line[0]][0], "usage" ).split()[0]
+ if u == "<variable>":
+ allmatches = cooker.configuration.data.keys()
+ elif u == "<bbfile>":
+ if cooker.status.pkg_fn is None: allmatches = [ "(No Matches Available. Parsed yet?)" ]
+ else: allmatches = [ x.split("/")[-1] for x in cooker.status.pkg_fn ]
+ elif u == "<providee>":
+ if cooker.status.pkg_fn is None: allmatches = [ "(No Matches Available. Parsed yet?)" ]
+ else: allmatches = cooker.status.providers.iterkeys()
+ else: allmatches = [ "(No tab completion available for this command)" ]
+ else: allmatches = [ "(No tab completion available for this command)" ]
+ else:
+ # we are in first argument
+ allmatches = cmds.iterkeys()
+
+ completer.matches = [ x for x in allmatches if x[:len(text)] == text ]
+ #print "completer.matches = '%s'" % completer.matches
+ if len( completer.matches ) > state:
+ return completer.matches[state]
+ else:
+ return None
+
+def debugOut( text ):
+ if debug:
+ sys.stderr.write( "( %s )\n" % text )
+
+def columnize( alist, width = 80 ):
+ """
+ A word-wrap function that preserves existing line breaks
+ and most spaces in the text. Expects that existing line
+ breaks are posix newlines (\n).
+ """
+ return reduce(lambda line, word, width=width: '%s%s%s' %
+ (line,
+ ' \n'[(len(line[line.rfind('\n')+1:])
+ + len(word.split('\n', 1)[0]
+ ) >= width)],
+ word),
+ alist
+ )
+
+def globfilter( names, pattern ):
+ return fnmatch.filter( names, pattern )
+
+##########################################################################
+# Class MemoryOutput
+##########################################################################
+
+class MemoryOutput:
+ """File-like output class buffering the output of the last 10 commands"""
+ def __init__( self, delegate ):
+ self.delegate = delegate
+ self._buffer = []
+ self.text = []
+ self._command = None
+
+ def startCommand( self, command ):
+ self._command = command
+ self.text = []
+ def endCommand( self ):
+ if self._command is not None:
+ if len( self._buffer ) == 10: del self._buffer[0]
+ self._buffer.append( ( self._command, self.text ) )
+ def removeLast( self ):
+ if self._buffer:
+ del self._buffer[ len( self._buffer ) - 1 ]
+ self.text = []
+ self._command = None
+ def lastBuffer( self ):
+ if self._buffer:
+ return self._buffer[ len( self._buffer ) -1 ][1]
+ def bufferedCommands( self ):
+ return [ cmd for cmd, output in self._buffer ]
+ def buffer( self, i ):
+ if i < len( self._buffer ):
+ return "BB>> %s\n%s" % ( self._buffer[i][0], "".join( self._buffer[i][1] ) )
+ else: return "ERROR: Invalid buffer number. Buffer needs to be in (0, %d)" % ( len( self._buffer ) - 1 )
+ def write( self, text ):
+ if self._command is not None and text != "BB>> ": self.text.append( text )
+ if self.delegate is not None: self.delegate.write( text )
+ def flush( self ):
+ return self.delegate.flush()
+ def fileno( self ):
+ return self.delegate.fileno()
+ def isatty( self ):
+ return self.delegate.isatty()
+
+##########################################################################
+# Class BitBakeShell
+##########################################################################
+
+class BitBakeShell:
+
+ def __init__( self ):
+ """Register commands and set up readline"""
+ self.commandQ = Queue.Queue()
+ self.commands = BitBakeShellCommands( self )
+ self.myout = MemoryOutput( sys.stdout )
+ self.historyfilename = os.path.expanduser( "~/.bbsh_history" )
+ self.startupfilename = os.path.expanduser( "~/.bbsh_startup" )
+
+ readline.set_completer( completer )
+ readline.set_completer_delims( " " )
+ readline.parse_and_bind("tab: complete")
+
+ try:
+ readline.read_history_file( self.historyfilename )
+ except IOError:
+ pass # It doesn't exist yet.
+
+ print(__credits__)
+
+ def cleanup( self ):
+ """Write readline history and clean up resources"""
+ debugOut( "writing command history" )
+ try:
+ readline.write_history_file( self.historyfilename )
+ except:
+ print("SHELL: Unable to save command history")
+
+ def registerCommand( self, command, function, numparams = 0, usage = "", helptext = "" ):
+ """Register a command"""
+ if usage == "": usage = command
+ if helptext == "": helptext = function.__doc__ or "<not yet documented>"
+ cmds[command] = ( function, numparams, usage, helptext )
+
+ def processCommand( self, command, params ):
+ """Process a command. Check number of params and print a usage string, if appropriate"""
+ debugOut( "processing command '%s'..." % command )
+ try:
+ function, numparams, usage, helptext = cmds[command]
+ except KeyError:
+ print("SHELL: ERROR: '%s' command is not a valid command." % command)
+ self.myout.removeLast()
+ else:
+ if (numparams != -1) and (not len( params ) == numparams):
+ print("Usage: '%s'" % usage)
+ return
+
+ result = function( self.commands, params )
+ debugOut( "result was '%s'" % result )
+
+ def processStartupFile( self ):
+ """Read and execute all commands found in $HOME/.bbsh_startup"""
+ if os.path.exists( self.startupfilename ):
+ startupfile = open( self.startupfilename, "r" )
+ for cmdline in startupfile:
+ debugOut( "processing startup line '%s'" % cmdline )
+ if not cmdline:
+ continue
+ if "|" in cmdline:
+ print("ERROR: '|' in startup file is not allowed. Ignoring line")
+ continue
+ self.commandQ.put( cmdline.strip() )
+
+ def main( self ):
+ """The main command loop"""
+ while not leave_mainloop:
+ try:
+ if self.commandQ.empty():
+ sys.stdout = self.myout.delegate
+ cmdline = raw_input( "BB>> " )
+ sys.stdout = self.myout
+ else:
+ cmdline = self.commandQ.get()
+ if cmdline:
+ allCommands = cmdline.split( ';' )
+ for command in allCommands:
+ pipecmd = None
+ #
+ # special case for expert mode
+ if command == 'python':
+ sys.stdout = self.myout.delegate
+ self.processCommand( command, "" )
+ sys.stdout = self.myout
+ else:
+ self.myout.startCommand( command )
+ if '|' in command: # disable output
+ command, pipecmd = command.split( '|' )
+ delegate = self.myout.delegate
+ self.myout.delegate = None
+ tokens = shlex.split( command, True )
+ self.processCommand( tokens[0], tokens[1:] or "" )
+ self.myout.endCommand()
+ if pipecmd is not None: # restore output
+ self.myout.delegate = delegate
+
+ pipe = popen2.Popen4( pipecmd )
+ pipe.tochild.write( "\n".join( self.myout.lastBuffer() ) )
+ pipe.tochild.close()
+ sys.stdout.write( pipe.fromchild.read() )
+ #
+ except EOFError:
+ print()
+ return
+ except KeyboardInterrupt:
+ print()
+
+##########################################################################
+# Start function - called from the BitBake command line utility
+##########################################################################
+
+def start( aCooker ):
+ global cooker
+ cooker = aCooker
+ bbshell = BitBakeShell()
+ bbshell.processStartupFile()
+ bbshell.main()
+ bbshell.cleanup()
+
+if __name__ == "__main__":
+ print("SHELL: Sorry, this program should only be called by BitBake.")
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/siggen.py b/import-layers/yocto-poky/bitbake/lib/bb/siggen.py
new file mode 100644
index 000000000..88fc0f1d5
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/siggen.py
@@ -0,0 +1,601 @@
+import hashlib
+import logging
+import os
+import re
+import tempfile
+import bb.data
+from bb.checksum import FileChecksumCache
+
+logger = logging.getLogger('BitBake.SigGen')
+
+try:
+ import cPickle as pickle
+except ImportError:
+ import pickle
+ logger.info('Importing cPickle failed. Falling back to a very slow implementation.')
+
+def init(d):
+ siggens = [obj for obj in globals().itervalues()
+ if type(obj) is type and issubclass(obj, SignatureGenerator)]
+
+ desired = d.getVar("BB_SIGNATURE_HANDLER", True) 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.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)
+
+ def set_taskdata(self, data):
+ self.runtaskdeps, self.taskhash, self.file_checksum_values, self.taints = 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", True) or "").split())
+ self.taskwhitelist = None
+ self.init_rundepcheck(data)
+ checksum_cache_file = data.getVar("BB_HASH_CHECKSUM_CACHE_FILE", True)
+ 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", True) or None
+ if self.taskwhitelist:
+ self.twl = re.compile(self.taskwhitelist)
+ else:
+ self.twl = None
+
+ def _build_data(self, fn, d):
+
+ 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)
+ self.basehash[fn + "." + task] = hashlib.md5(data).hexdigest()
+ taskdeps[task] = alldeps
+
+ self.taskdeps[fn] = taskdeps
+ self.gendeps[fn] = gendeps
+ self.lookupcache[fn] = lookupcache
+
+ return taskdeps
+
+ def finalise(self, fn, d, variant):
+
+ if variant:
+ fn = "virtual:" + variant + ":" + fn
+
+ try:
+ taskdeps = self._build_data(fn, d)
+ 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", True), 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.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.warn("%s is tainted from a forced run" % k)
+
+ h = hashlib.md5(data).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]
+
+ 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, 0664)
+ os.rename(tmpfile, sigfile)
+ except (OSError, IOError) as err:
+ try:
+ os.unlink(tmpfile)
+ except OSError:
+ pass
+ raise err
+
+ computed_basehash = calc_basehash(data)
+ if computed_basehash != self.basehash[k]:
+ bb.error("Basehash mismatch %s verses %s for %s" % (computed_basehash, self.basehash[k], k))
+ if k in self.taskhash:
+ computed_taskhash = calc_taskhash(data)
+ if computed_taskhash != self.taskhash[k]:
+ bb.error("Taskhash mismatch %s verses %s for %s" % (computed_taskhash, self.taskhash[k], k))
+
+
+ def dump_sigs(self, dataCache, options):
+ for fn in self.taskdeps:
+ for task in self.taskdeps[fn]:
+ k = fn + "." + task
+ if k not in self.taskhash:
+ continue
+ if dataCache.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" % (dataCache.basetaskhash[k], self.basehash[k]))
+ self.dump_sigtask(fn, task, dataCache.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", True)
+ task = "do_" + d.getVar("BB_CURRENTTASK", True)
+ referencestamp = bb.build.stamp_internal(task, d, None, True)
+ bb.parse.siggen.dump_sigtask(fn, task, outfile, "customfile:" + referencestamp)
+
+def clean_basepath(a):
+ b = a.rsplit("/", 2)[1] + a.rsplit("/", 2)[2]
+ if a.startswith("virtual:"):
+ b = b + ":" + a.rsplit(":", 1)[0]
+ 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):
+ output = []
+
+ p1 = pickle.Unpickler(open(a, "rb"))
+ a_data = p1.load()
+ p2 = pickle.Unpickler(open(b, "rb"))
+ 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("basewhitelist changed 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("taskwhitelist changed 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("Task dependencies changed from:\n%s\nto:\n%s" % (sorted(a_data['taskdeps']), sorted(b_data['taskdeps'])))
+
+ if a_data['basehash'] != b_data['basehash']:
+ output.append("basehash changed 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("List of dependencies for variable %s changed from '%s' to '%s'" % (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("Dependency on variable %s was added" % (dep))
+ if removed:
+ for dep in removed:
+ output.append("Dependency on Variable %s was removed" % (dep))
+
+
+ changed, added, removed = dict_diff(a_data['varvals'], b_data['varvals'])
+ if changed:
+ for dep in changed:
+ output.append("Variable %s value changed from '%s' to '%s'" % (dep, a_data['varvals'][dep], b_data['varvals'][dep]))
+
+ 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("Checksum for file %s changed from %s to %s" % (f, old, new))
+ if added:
+ for f in added:
+ output.append("Dependency on checksum of file %s was added" % (f))
+ if removed:
+ for f in removed:
+ output.append("Dependency on checksum of file %s was removed" % (f))
+
+
+ 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]:
+ changed.append("%s with hash %s\n changed to\n%s with hash %s" % (a, a_data['runtaskhashes'][a], b, b_data['runtaskhashes'][b]))
+
+ if changed:
+ output.append("runtaskdeps changed from %s to %s" % (clean_basepaths_list(a_data['runtaskdeps']), clean_basepaths_list(b_data['runtaskdeps'])))
+ 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("Dependency on task %s was added 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("Dependency on task %s was removed with hash %s" % (clean_basepath(dep), a[dep]))
+ if changed:
+ for dep in changed:
+ output.append("Hash for dependent task %s changed from %s to %s" % (clean_basepath(dep), a[dep], b[dep]))
+ if callable(recursecb):
+ # 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.
+ recout = recursecb(dep, a[dep], b[dep])
+ if recout:
+ 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("Taint (by forced/invalidated task) changed 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).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']:
+ 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).hexdigest()
+
+
+def dump_sigfile(a):
+ output = []
+
+ p1 = pickle.Unpickler(open(a, "rb"))
+ 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/import-layers/yocto-poky/bitbake/lib/bb/taskdata.py b/import-layers/yocto-poky/bitbake/lib/bb/taskdata.py
new file mode 100644
index 000000000..9ae52d77d
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/taskdata.py
@@ -0,0 +1,690 @@
+#!/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 TaskData:
+ """
+ BitBake Task Data implementation
+ """
+ def __init__(self, abort = True, tryaltconfigs = False, skiplist = None, allowincomplete = False):
+ self.build_names_index = []
+ self.run_names_index = []
+ self.fn_index = []
+
+ self.build_targets = {}
+ self.run_targets = {}
+
+ self.external_targets = []
+
+ self.tasks_fnid = []
+ self.tasks_name = []
+ self.tasks_tdepends = []
+ self.tasks_idepends = []
+ self.tasks_irdepends = []
+ # Cache to speed up task ID lookups
+ self.tasks_lookup = {}
+
+ self.depids = {}
+ self.rdepids = {}
+
+ self.consider_msgs_cache = []
+
+ self.failed_deps = []
+ self.failed_rdeps = []
+ self.failed_fnids = []
+
+ self.abort = abort
+ self.tryaltconfigs = tryaltconfigs
+ self.allowincomplete = allowincomplete
+
+ self.skiplist = skiplist
+
+ def getbuild_id(self, name):
+ """
+ Return an ID number for the build target name.
+ If it doesn't exist, create one.
+ """
+ if not name in self.build_names_index:
+ self.build_names_index.append(name)
+ return len(self.build_names_index) - 1
+
+ return self.build_names_index.index(name)
+
+ def getrun_id(self, name):
+ """
+ Return an ID number for the run target name.
+ If it doesn't exist, create one.
+ """
+ if not name in self.run_names_index:
+ self.run_names_index.append(name)
+ return len(self.run_names_index) - 1
+
+ return self.run_names_index.index(name)
+
+ def getfn_id(self, name):
+ """
+ Return an ID number for the filename.
+ If it doesn't exist, create one.
+ """
+ if not name in self.fn_index:
+ self.fn_index.append(name)
+ return len(self.fn_index) - 1
+
+ return self.fn_index.index(name)
+
+ def gettask_ids(self, fnid):
+ """
+ Return an array of the ID numbers matching a given fnid.
+ """
+ ids = []
+ if fnid in self.tasks_lookup:
+ for task in self.tasks_lookup[fnid]:
+ ids.append(self.tasks_lookup[fnid][task])
+ return ids
+
+ def gettask_id_fromfnid(self, fnid, task):
+ """
+ Return an ID number for the task matching fnid and task.
+ """
+ if fnid in self.tasks_lookup:
+ if task in self.tasks_lookup[fnid]:
+ return self.tasks_lookup[fnid][task]
+
+ return None
+
+ def gettask_id(self, fn, task, create = True):
+ """
+ Return an ID number for the task matching fn and task.
+ If it doesn't exist, create one by default.
+ Optionally return None instead.
+ """
+ fnid = self.getfn_id(fn)
+
+ if fnid in self.tasks_lookup:
+ if task in self.tasks_lookup[fnid]:
+ return self.tasks_lookup[fnid][task]
+
+ if not create:
+ return None
+
+ self.tasks_name.append(task)
+ self.tasks_fnid.append(fnid)
+ self.tasks_tdepends.append([])
+ self.tasks_idepends.append([])
+ self.tasks_irdepends.append([])
+
+ listid = len(self.tasks_name) - 1
+
+ if fnid not in self.tasks_lookup:
+ self.tasks_lookup[fnid] = {}
+ self.tasks_lookup[fnid][task] = listid
+
+ return listid
+
+ def add_tasks(self, fn, dataCache):
+ """
+ Add tasks for a given fn to the database
+ """
+
+ task_deps = dataCache.task_deps[fn]
+
+ fnid = self.getfn_id(fn)
+
+ if fnid in self.failed_fnids:
+ bb.msg.fatal("TaskData", "Trying to re-add a failed file? Something is broken...")
+
+ # Check if we've already seen this fn
+ if fnid in self.tasks_fnid:
+ return
+
+ self.add_extra_deps(fn, dataCache)
+
+ for task in task_deps['tasks']:
+
+ # 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 = self.gettask_id(fn, dep)
+ parentids.append(parentid)
+ taskid = self.gettask_id(fn, task)
+ self.tasks_tdepends[taskid].extend(parentids)
+
+ # Touch all intertask dependencies
+ if 'depends' in task_deps and task in task_deps['depends']:
+ ids = []
+ for dep in task_deps['depends'][task].split():
+ if dep:
+ if ":" not in dep:
+ bb.msg.fatal("TaskData", "Error for %s, dependency %s does not contain ':' character\n. Task 'depends' should be specified in the form 'packagename:task'" % (fn, dep))
+ ids.append(((self.getbuild_id(dep.split(":")[0])), dep.split(":")[1]))
+ self.tasks_idepends[taskid].extend(ids)
+ if 'rdepends' in task_deps and task in task_deps['rdepends']:
+ ids = []
+ for dep in task_deps['rdepends'][task].split():
+ if dep:
+ if ":" not in dep:
+ bb.msg.fatal("TaskData", "Error for %s, dependency %s does not contain ':' character\n. Task 'rdepends' should be specified in the form 'packagename:task'" % (fn, dep))
+ ids.append(((self.getrun_id(dep.split(":")[0])), dep.split(":")[1]))
+ self.tasks_irdepends[taskid].extend(ids)
+
+
+ # Work out build dependencies
+ if not fnid in self.depids:
+ dependids = {}
+ for depend in dataCache.deps[fn]:
+ dependids[self.getbuild_id(depend)] = None
+ self.depids[fnid] = dependids.keys()
+ logger.debug(2, "Added dependencies %s for %s", str(dataCache.deps[fn]), fn)
+
+ # Work out runtime dependencies
+ if not fnid in self.rdepids:
+ rdependids = {}
+ rdepends = dataCache.rundeps[fn]
+ rrecs = dataCache.runrecs[fn]
+ rdependlist = []
+ rreclist = []
+ for package in rdepends:
+ for rdepend in rdepends[package]:
+ rdependlist.append(rdepend)
+ rdependids[self.getrun_id(rdepend)] = None
+ for package in rrecs:
+ for rdepend in rrecs[package]:
+ rreclist.append(rdepend)
+ rdependids[self.getrun_id(rdepend)] = None
+ 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[fnid] = rdependids.keys()
+
+ for dep in self.depids[fnid]:
+ if dep in self.failed_deps:
+ self.fail_fnid(fnid)
+ return
+ for dep in self.rdepids[fnid]:
+ if dep in self.failed_rdeps:
+ self.fail_fnid(fnid)
+ 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?
+ """
+ targetid = self.getbuild_id(target)
+
+ if targetid in self.build_targets:
+ return True
+ return False
+
+ def have_runtime_target(self, target):
+ """
+ Have we a runtime target matching this name?
+ """
+ targetid = self.getrun_id(target)
+
+ if targetid in self.run_targets:
+ return True
+ return False
+
+ def add_build_target(self, fn, item):
+ """
+ Add a build target.
+ If already present, append the provider fn to the list
+ """
+ targetid = self.getbuild_id(item)
+ fnid = self.getfn_id(fn)
+
+ if targetid in self.build_targets:
+ if fnid in self.build_targets[targetid]:
+ return
+ self.build_targets[targetid].append(fnid)
+ return
+ self.build_targets[targetid] = [fnid]
+
+ def add_runtime_target(self, fn, item):
+ """
+ Add a runtime target.
+ If already present, append the provider fn to the list
+ """
+ targetid = self.getrun_id(item)
+ fnid = self.getfn_id(fn)
+
+ if targetid in self.run_targets:
+ if fnid in self.run_targets[targetid]:
+ return
+ self.run_targets[targetid].append(fnid)
+ return
+ self.run_targets[targetid] = [fnid]
+
+ def mark_external_target(self, item):
+ """
+ Mark a build target as being externally requested
+ """
+ targetid = self.getbuild_id(item)
+
+ if targetid not in self.external_targets:
+ self.external_targets.append(targetid)
+
+ def get_unresolved_build_targets(self, dataCache):
+ """
+ Return a list of build targets who's providers
+ are unknown.
+ """
+ unresolved = []
+ for target in self.build_names_index:
+ if re_match_strings(target, dataCache.ignored_dependencies):
+ continue
+ if self.build_names_index.index(target) in self.failed_deps:
+ continue
+ if not self.have_build_target(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_names_index:
+ if re_match_strings(target, dataCache.ignored_dependencies):
+ continue
+ if self.run_names_index.index(target) in self.failed_rdeps:
+ continue
+ if not self.have_runtime_target(target):
+ unresolved.append(target)
+ return unresolved
+
+ def get_provider(self, item):
+ """
+ Return a list of providers of item
+ """
+ targetid = self.getbuild_id(item)
+
+ return self.build_targets[targetid]
+
+ def get_dependees(self, itemid):
+ """
+ Return a list of targets which depend on item
+ """
+ dependees = []
+ for fnid in self.depids:
+ if itemid in self.depids[fnid]:
+ dependees.append(fnid)
+ return dependees
+
+ def get_dependees_str(self, item):
+ """
+ Return a list of targets which depend on item as a user readable string
+ """
+ itemid = self.getbuild_id(item)
+ dependees = []
+ for fnid in self.depids:
+ if itemid in self.depids[fnid]:
+ dependees.append(self.fn_index[fnid])
+ return dependees
+
+ def get_rdependees(self, itemid):
+ """
+ Return a list of targets which depend on runtime item
+ """
+ dependees = []
+ for fnid in self.rdepids:
+ if itemid in self.rdepids[fnid]:
+ dependees.append(fnid)
+ return dependees
+
+ def get_rdependees_str(self, item):
+ """
+ Return a list of targets which depend on runtime item as a user readable string
+ """
+ itemid = self.getrun_id(item)
+ dependees = []
+ for fnid in self.rdepids:
+ if itemid in self.rdepids[fnid]:
+ dependees.append(self.fn_index[fnid])
+ 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(self.getbuild_id(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, 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_str(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 self.getfn_id(p) in self.failed_fnids]
+
+ if not eligible:
+ bb.event.fire(bb.event.NoProvider(item, dependees=self.get_dependees_str(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:
+ fnid = self.getfn_id(fn)
+ if fnid in self.failed_fnids:
+ 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_str(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 self.getfn_id(p) in self.failed_fnids]
+
+ if not eligible:
+ bb.event.fire(bb.event.NoProvider(item, runtime=True, dependees=self.get_rdependees_str(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:
+ fnid = self.getfn_id(fn)
+ if fnid in self.failed_fnids:
+ 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_fnid(self, fnid, 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 fnid in self.failed_fnids:
+ return
+ if not missing_list:
+ missing_list = []
+ logger.debug(1, "File '%s' is unbuildable, removing...", self.fn_index[fnid])
+ self.failed_fnids.append(fnid)
+ for target in self.build_targets:
+ if fnid in self.build_targets[target]:
+ self.build_targets[target].remove(fnid)
+ if len(self.build_targets[target]) == 0:
+ self.remove_buildtarget(target, missing_list)
+ for target in self.run_targets:
+ if fnid in self.run_targets[target]:
+ self.run_targets[target].remove(fnid)
+ if len(self.run_targets[target]) == 0:
+ self.remove_runtarget(target, missing_list)
+
+ def remove_buildtarget(self, targetid, 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 = [self.build_names_index[targetid]]
+ else:
+ missing_list = [self.build_names_index[targetid]] + missing_list
+ logger.verbose("Target '%s' is unbuildable, removing...\nMissing or unbuildable dependency chain was: %s", self.build_names_index[targetid], missing_list)
+ self.failed_deps.append(targetid)
+ dependees = self.get_dependees(targetid)
+ for fnid in dependees:
+ self.fail_fnid(fnid, missing_list)
+ for taskid in xrange(len(self.tasks_idepends)):
+ idepends = self.tasks_idepends[taskid]
+ for (idependid, idependtask) in idepends:
+ if idependid == targetid:
+ self.fail_fnid(self.tasks_fnid[taskid], missing_list)
+
+ if self.abort and targetid in self.external_targets:
+ target = self.build_names_index[targetid]
+ 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, targetid, 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 = [self.run_names_index[targetid]]
+ else:
+ missing_list = [self.run_names_index[targetid]] + missing_list
+
+ logger.info("Runtime target '%s' is unbuildable, removing...\nMissing or unbuildable dependency chain was: %s", self.run_names_index[targetid], missing_list)
+ self.failed_rdeps.append(targetid)
+ dependees = self.get_rdependees(targetid)
+ for fnid in dependees:
+ self.fail_fnid(fnid, missing_list)
+ for taskid in xrange(len(self.tasks_irdepends)):
+ irdepends = self.tasks_irdepends[taskid]
+ for (idependid, idependtask) in irdepends:
+ if idependid == targetid:
+ self.fail_fnid(self.tasks_fnid[taskid], 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:
+ targetid = self.getbuild_id(target)
+ if self.abort and targetid in self.external_targets and not self.allowincomplete:
+ raise
+ if not self.allowincomplete:
+ self.remove_buildtarget(targetid)
+ 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(self.getrun_id(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_names_index:
+ if prefix and not name.startswith(prefix):
+ continue
+ if self.have_build_target(name):
+ provider = self.get_provider(name)
+ if provider:
+ provmap[name] = self.fn_index[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_names_index))
+
+ logger.debug(3, "run_names:")
+ logger.debug(3, ", ".join(self.run_names_index))
+
+ logger.debug(3, "build_targets:")
+ for buildid in xrange(len(self.build_names_index)):
+ target = self.build_names_index[buildid]
+ targets = "None"
+ if buildid in self.build_targets:
+ targets = self.build_targets[buildid]
+ logger.debug(3, " (%s)%s: %s", buildid, target, targets)
+
+ logger.debug(3, "run_targets:")
+ for runid in xrange(len(self.run_names_index)):
+ target = self.run_names_index[runid]
+ targets = "None"
+ if runid in self.run_targets:
+ targets = self.run_targets[runid]
+ logger.debug(3, " (%s)%s: %s", runid, target, targets)
+
+ logger.debug(3, "tasks:")
+ for task in xrange(len(self.tasks_name)):
+ logger.debug(3, " (%s)%s - %s: %s",
+ task,
+ self.fn_index[self.tasks_fnid[task]],
+ self.tasks_name[task],
+ self.tasks_tdepends[task])
+
+ logger.debug(3, "dependency ids (per fn):")
+ for fnid in self.depids:
+ logger.debug(3, " %s %s: %s", fnid, self.fn_index[fnid], self.depids[fnid])
+
+ logger.debug(3, "runtime dependency ids (per fn):")
+ for fnid in self.rdepids:
+ logger.debug(3, " %s %s: %s", fnid, self.fn_index[fnid], self.rdepids[fnid])
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/tests/__init__.py b/import-layers/yocto-poky/bitbake/lib/bb/tests/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/tests/__init__.py
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/tests/codeparser.py b/import-layers/yocto-poky/bitbake/lib/bb/tests/codeparser.py
new file mode 100644
index 000000000..bb820e403
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/tests/codeparser.py
@@ -0,0 +1,380 @@
+# 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)
+
+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("${@bb.data.getVar('BAR', d, True) + '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 __builtin__
+ self.context = __builtin__.__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
+
+ @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("bb.data.getVar('foo', d, True)")
+ self.assertReferences(set(["foo"]))
+ self.assertExecs(set())
+
+ def test_getvar_computed_reference(self):
+ self.parseExpression("bb.data.getVar('f' + 'o' + 'o', d, True)")
+ self.assertReferences(set())
+ self.assertExecs(set())
+
+ def test_getvar_exec_reference(self):
+ self.parseExpression("eval('bb.data.getVar(\"foo\", d, True)')")
+ 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"]
+
+
+class DependencyReferenceTest(ReferenceTest):
+
+ pydata = """
+bb.data.getVar('somevar', d, True)
+def test(d):
+ foo = 'bar %s' % 'foo'
+def test2(d):
+ d.getVar(foo, True)
+ d.getVar('bar', False)
+ test2(d)
+
+def a():
+ \"\"\"some
+ stuff
+ \"\"\"
+ return "heh"
+
+test(d)
+
+bb.data.expand(bb.data.getVar("something", False, d), d)
+bb.data.expand("${inexpand} somethingelse", d)
+bb.data.getVar(a(), d, 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.assertEquals(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.assertEquals(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.assertEquals(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.assertEquals(deps, set(["oe_libinstall"]))
+
+ #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/import-layers/yocto-poky/bitbake/lib/bb/tests/cow.py b/import-layers/yocto-poky/bitbake/lib/bb/tests/cow.py
new file mode 100644
index 000000000..35c5841f3
--- /dev/null
+++ b/import-layers/yocto-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.assertEquals(False, a.has_key('a'))
+
+ a['a'] = 'a'
+ a['b'] = 'b'
+ self.assertEquals(True, a.has_key('a'))
+ self.assertEquals(True, a.has_key('b'))
+ self.assertEquals('a', a['a'] )
+ self.assertEquals('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.assertEquals(False, c.has_key('c'))
+ self.assertEquals(30, c['a'])
+ self.assertEquals(10, b['a'])
+
+ # test copy
+ b_2 = b.copy()
+ c_2 = c.copy()
+
+ self.assertEquals(False, c_2.has_key('c'))
+ self.assertEquals(10, b_2['a'])
+
+ b_2['d'] = 40
+ self.assertEquals(False, c_2.has_key('d'))
+ self.assertEquals(True, b_2.has_key('d'))
+ self.assertEquals(40, b_2['d'])
+ self.assertEquals(False, b.has_key('d'))
+ self.assertEquals(False, c.has_key('d'))
+
+ c_2['d'] = 30
+ self.assertEquals(True, c_2.has_key('d'))
+ self.assertEquals(True, b_2.has_key('d'))
+ self.assertEquals(30, c_2['d'])
+ self.assertEquals(40, b_2['d'])
+ self.assertEquals(False, b.has_key('d'))
+ self.assertEquals(False, c.has_key('d'))
+
+ # 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.assertEquals(4711, c_3['e'])
+ self.assertEquals(False, c_2.has_key('e'))
+ self.assertEquals(False, b_3.has_key('e'))
+ self.assertEquals(False, b_3_2.has_key('e'))
+ self.assertEquals(False, b_2.has_key('e'))
+
+ b_3['e'] = 'viel'
+ self.assertEquals('viel', b_3['e'])
+ self.assertEquals(4711, c_3['e'])
+ self.assertEquals(False, c_2.has_key('e'))
+ self.assertEquals(True, b_3.has_key('e'))
+ self.assertEquals(False, b_3_2.has_key('e'))
+ self.assertEquals(False, b_2.has_key('e'))
+
+ 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.assertEquals(1027, c['123'])
+ self.assertEquals(4711, c['other'])
+ self.assertEquals({'abc':10, 'bcd':20}, c['d'])
+ self.assertEquals(1027, copy['123'])
+ self.assertEquals(4711, copy['other'])
+ self.assertEquals({'abc':10, 'bcd':20}, copy['d'])
+
+ # cow it now
+ copy['123'] = 1028
+ copy['other'] = 4712
+ copy['d']['abc'] = 20
+
+
+ self.assertEquals(1027, c['123'])
+ self.assertEquals(4711, c['other'])
+ self.assertEquals({'abc':10, 'bcd':20}, c['d'])
+ self.assertEquals(1028, copy['123'])
+ self.assertEquals(4712, copy['other'])
+ self.assertEquals({'abc':20, 'bcd':20}, copy['d'])
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/tests/data.py b/import-layers/yocto-poky/bitbake/lib/bb/tests/data.py
new file mode 100644
index 000000000..12232305c
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/tests/data.py
@@ -0,0 +1,446 @@
+# 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', True) + ' ${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', True) + ' ${bar}'}")
+ self.assertEqual(str(val), "${@d.getVar('foo', True) + ' ${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', True) + ' ${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", True)
+ 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", True)
+ 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", True)
+ 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 = self.d.keys()
+ self.assertEqual(keys, ['value_of_foo', 'foo', 'bar'])
+
+ def test_keys_deletion(self):
+ newd = bb.data.createCopy(self.d)
+ newd.delVar("bar")
+ keys = newd.keys()
+ self.assertEqual(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", True), "foo:val")
+
+ def test_append(self):
+ self.d.setVar("TEST", "${VAL}")
+ self.d.appendVar("TEST", ":${BAR}")
+ self.assertEqual(self.d.getVar("TEST", True), "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", True), "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}:")
+ bb.data.update_data(self.d)
+ self.assertEqual(self.d.getVar("TEST", True), "foo:val")
+
+ def test_append(self):
+ self.d.setVar("TEST", "${VAL}")
+ self.d.setVar("TEST_append", ":${BAR}")
+ bb.data.update_data(self.d)
+ self.assertEqual(self.d.getVar("TEST", True), "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}")
+ bb.data.update_data(self.d)
+ self.assertEqual(self.d.getVar("TEST", True), "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}")
+ bb.data.update_data(self.d)
+ self.assertEqual(self.d.getVar("TEST", True), "foo::val2:bar")
+
+ def test_remove(self):
+ self.d.setVar("TEST", "${VAL} ${BAR}")
+ self.d.setVar("TEST_remove", "val")
+ bb.data.update_data(self.d)
+ self.assertEqual(self.d.getVar("TEST", True), "bar")
+
+ def test_doubleref_remove(self):
+ self.d.setVar("TEST", "${VAL} ${BAR}")
+ self.d.setVar("TEST_remove", "val")
+ self.d.setVar("TEST_TEST", "${TEST} ${TEST}")
+ bb.data.update_data(self.d)
+ self.assertEqual(self.d.getVar("TEST_TEST", True), "bar bar")
+
+ def test_empty_remove(self):
+ self.d.setVar("TEST", "")
+ self.d.setVar("TEST_remove", "val")
+ bb.data.update_data(self.d)
+ self.assertEqual(self.d.getVar("TEST", True), "")
+
+ def test_remove_expansion(self):
+ self.d.setVar("BAR", "Z")
+ self.d.setVar("TEST", "${BAR}/X Y")
+ self.d.setVar("TEST_remove", "${BAR}/X")
+ bb.data.update_data(self.d)
+ self.assertEqual(self.d.getVar("TEST", True), "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}")
+ bb.data.update_data(self.d)
+ self.assertEqual(self.d.getVar("TEST", True), "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):
+ bb.data.update_data(self.d)
+ self.assertEqual(self.d.getVar("TEST", True), "testvalue")
+
+ def test_one_override(self):
+ self.d.setVar("TEST_bar", "testvalue2")
+ bb.data.update_data(self.d)
+ self.assertEqual(self.d.getVar("TEST", True), "testvalue2")
+
+ def test_one_override_unset(self):
+ self.d.setVar("TEST2_bar", "testvalue2")
+ bb.data.update_data(self.d)
+ self.assertEqual(self.d.getVar("TEST2", True), "testvalue2")
+ self.assertItemsEqual(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")
+ bb.data.update_data(self.d)
+ self.assertEqual(self.d.getVar("TEST", True), "testvalue3")
+ self.assertItemsEqual(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")
+ bb.data.update_data(self.d)
+ self.assertEqual(self.d.getVar("TEST", True), "testvalue3")
+
+ def test_multiple_overrides_unset(self):
+ self.d.setVar("TEST2_local_foo_bar", "testvalue3")
+ bb.data.update_data(self.d)
+ self.assertEqual(self.d.getVar("TEST2", True), "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.update_data(self.d)
+ bb.data.expandKeys(self.d)
+ self.assertEqual(self.d.getVar("TEST", True), "testvalue3")
+
+ def test_rename_override(self):
+ self.d.setVar("ALTERNATIVE_ncurses-tools_class-target", "a")
+ self.d.setVar("OVERRIDES", "class-target")
+ bb.data.update_data(self.d)
+ self.d.renameVar("ALTERNATIVE_ncurses-tools", "ALTERNATIVE_lib32-ncurses-tools")
+ self.assertEqual(self.d.getVar("ALTERNATIVE_lib32-ncurses-tools", True), "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", True), "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", True), "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))
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/tests/fetch.py b/import-layers/yocto-poky/bitbake/lib/bb/tests/fetch.py
new file mode 100644
index 000000000..4ba688bfe
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/tests/fetch.py
@@ -0,0 +1,812 @@
+# 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 tempfile
+import subprocess
+import os
+from bb.fetch2 import URI
+from bb.fetch2 import FetchMethod
+import bb
+
+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': {
+ '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)
+ 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 file(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'])
+
+class FetcherNetworkTest(FetcherTest):
+
+ if os.environ.get("BB_SKIP_NETTESTS") == "yes":
+ print("Unset BB_SKIP_NETTESTS to run network tests")
+ else:
+ 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)
+
+ 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)
+
+ 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)
+
+ 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)
+
+ 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)
+
+ 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)
+
+ def test_gitfetch(self):
+ url1 = url2 = "git://git.openembedded.org/bitbake"
+ self.gitfetcher(url1, url2)
+
+ 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)
+
+ 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)
+
+ 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)
+
+ 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)
+
+ 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)
+
+ 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)
+
+ 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', {'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",
+ }
+ if os.environ.get("BB_SKIP_NETTESTS") == "yes":
+ print("Unset BB_SKIP_NETTESTS to run network tests")
+ else:
+ 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]
+ r = bb.utils.vercmp_string(v, verstring)
+ self.assertTrue(r == -1 or r == 0, msg="Package %s, version: %s <= %s" % (k[0], v, verstring))
+
+ 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]
+ 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/software/ipptool/ipptool-20130731-linux-ubuntu-i686.tar.gz",
+ "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://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz",
+ "ftp://ftp.gnu.org/gnu/chess/gnuchess-5.08.tar.gz",
+ "ftp://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"
+ ]
+
+ if os.environ.get("BB_SKIP_NETTESTS") == "yes":
+ print("Unset BB_SKIP_NETTESTS to run network tests")
+ else:
+
+ def test_wget_checkstatus(self):
+ fetch = bb.fetch2.Fetch(self.test_wget_uris, self.d)
+ for u in self.test_wget_uris:
+ 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))
+
+
+ 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:
+ 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()
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/tests/parse.py b/import-layers/yocto-poky/bitbake/lib/bb/tests/parse.py
new file mode 100644
index 000000000..6beb76a48
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/tests/parse.py
@@ -0,0 +1,147 @@
+# 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(content)
+ 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", True), "1")
+ self.assertEqual(d.getVar("B", True), "2")
+ self.assertEqual(d.getVar("C", True), "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)['']
+
+ 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", True), "b")
+ bb.data.expandKeys(d)
+ self.assertEqual(d.getVar("RRECOMMENDS", True), "b")
+ d.setVar("RRECOMMENDS_gtk+", "c")
+ self.assertEqual(d.getVar("RRECOMMENDS", True), "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", True), "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", True), "A B")
+ d.setVar("DESCRIPTION", "E")
+ d.setVar("DESCRIPTION_bc-dev", "C D")
+ d.setVar("OVERRIDES", "bc-dev")
+ self.assertEqual(d.getVar("DESCRIPTION", True), "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", True), "B")
+ self.assertEqual(d2.getVar("VAR_var", True), None)
+
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/tests/utils.py b/import-layers/yocto-poky/bitbake/lib/bb/tests/utils.py
new file mode 100644
index 000000000..2f4ccf3c6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/bb/tinfoil.py b/import-layers/yocto-poky/bitbake/lib/bb/tinfoil.py
new file mode 100644
index 000000000..7aa653f1a
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/tinfoil.py
@@ -0,0 +1,105 @@
+# tinfoil: a simple wrapper around cooker for bitbake-based command-line utilities
+#
+# Copyright (C) 2012 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 logging
+import warnings
+import os
+import sys
+
+import bb.cache
+import bb.cooker
+import bb.providers
+import bb.utils
+from bb.cooker import state, BBCooker, CookerFeatures
+from bb.cookerdata import CookerConfiguration, ConfigParameters
+import bb.fetch2
+
+class Tinfoil:
+ def __init__(self, output=sys.stdout, tracking=False):
+ # Needed to avoid deprecation warnings with python 2.6
+ warnings.filterwarnings("ignore", category=DeprecationWarning)
+
+ # Set up logging
+ self.logger = logging.getLogger('BitBake')
+ self._log_hdlr = logging.StreamHandler(output)
+ bb.msg.addDefaultlogFilter(self._log_hdlr)
+ format = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
+ if output.isatty():
+ format.enable_color()
+ self._log_hdlr.setFormatter(format)
+ self.logger.addHandler(self._log_hdlr)
+
+ self.config = CookerConfiguration()
+ configparams = TinfoilConfigParameters(parse_only=True)
+ self.config.setConfigParameters(configparams)
+ self.config.setServerRegIdleCallback(self.register_idle_function)
+ features = []
+ if tracking:
+ features.append(CookerFeatures.BASEDATASTORE_TRACKING)
+ self.cooker = BBCooker(self.config, features)
+ self.config_data = self.cooker.data
+ bb.providers.logger.setLevel(logging.ERROR)
+ self.cooker_data = None
+
+ def register_idle_function(self, function, data):
+ pass
+
+ def parseRecipes(self):
+ sys.stderr.write("Parsing recipes..")
+ self.logger.setLevel(logging.WARNING)
+
+ try:
+ while self.cooker.state in (state.initial, state.parsing):
+ self.cooker.updateCache()
+ except KeyboardInterrupt:
+ self.cooker.shutdown()
+ self.cooker.updateCache()
+ sys.exit(2)
+
+ self.logger.setLevel(logging.INFO)
+ sys.stderr.write("done.\n")
+
+ self.cooker_data = self.cooker.recipecache
+
+ def prepare(self, config_only = False):
+ if not self.cooker_data:
+ if config_only:
+ self.cooker.parseConfiguration()
+ self.cooker_data = self.cooker.recipecache
+ else:
+ self.parseRecipes()
+
+ def shutdown(self):
+ self.cooker.shutdown(force=True)
+ self.cooker.post_serve()
+ self.cooker.unlockBitbake()
+ self.logger.removeHandler(self._log_hdlr)
+
+class TinfoilConfigParameters(ConfigParameters):
+
+ def __init__(self, **options):
+ self.initial_options = options
+ super(TinfoilConfigParameters, self).__init__()
+
+ def parseCommandLine(self, argv=sys.argv):
+ class DummyOptions:
+ def __init__(self, initial_options):
+ for key, val in initial_options.items():
+ setattr(self, key, val)
+
+ return DummyOptions(self.initial_options), None
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/__init__.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/__init__.py
new file mode 100644
index 000000000..a4805ed02
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/bb/ui/buildinfohelper.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/buildinfohelper.py
new file mode 100644
index 000000000..93979054d
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/buildinfohelper.py
@@ -0,0 +1,1521 @@
+#
+# 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
+
+os.environ["DJANGO_SETTINGS_MODULE"] = "toaster.toastermain.settings"
+
+
+import django
+from django.utils import timezone
+
+
+def _configure_toaster():
+ """ Add toaster to sys path for importing modules
+ """
+ sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'toaster'))
+_configure_toaster()
+
+django.setup()
+
+from orm.models import Build, Task, Recipe, Layer_Version, Layer, Target, LogMessage, HelpText
+from orm.models import Target_Image_File, BuildArtifact
+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, CustomImageRecipe
+
+from bldcontrol.models import BuildEnvironment, BuildRequest
+
+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 _timestamp_to_datetime(self, secs):
+ """
+ Convert timestamp in seconds to Python datetime
+ """
+ return 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 create_build_object(self, build_info, brbe, project_id):
+ assert 'machine' in build_info
+ assert 'distro' in build_info
+ assert 'distro_version' in build_info
+ assert 'started_on' in build_info
+ assert 'cooker_log_path' in build_info
+ assert 'build_name' in build_info
+ assert 'bitbake_version' in build_info
+
+ prj = None
+ buildrequest = None
+ if brbe is not None: # this build was triggered by a request from a user
+ logger.debug(1, "buildinfohelper: brbe is %s" % brbe)
+ br, _ = brbe.split(":")
+ buildrequest = BuildRequest.objects.get(pk = br)
+ prj = buildrequest.project
+
+ elif project_id is not None: # this build was triggered by an external system for a specific project
+ logger.debug(1, "buildinfohelper: project is %s" % prj)
+ prj = Project.objects.get(pk = project_id)
+
+ else: # this build was triggered by a legacy system, or command line interactive mode
+ 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:
+ build = buildrequest.build
+ logger.info("Updating existing build, with %s", build_info)
+ build.project = prj
+ build.machine=build_info['machine']
+ build.distro=build_info['distro']
+ build.distro_version=build_info['distro_version']
+ build.cooker_log_path=build_info['cooker_log_path']
+ build.build_name=build_info['build_name']
+ build.bitbake_version=build_info['bitbake_version']
+ build.save()
+
+ else:
+ build = Build.objects.create(
+ project = prj,
+ machine=build_info['machine'],
+ distro=build_info['distro'],
+ distro_version=build_info['distro_version'],
+ started_on=build_info['started_on'],
+ completed_on=build_info['started_on'],
+ cooker_log_path=build_info['cooker_log_path'],
+ build_name=build_info['build_name'],
+ bitbake_version=build_info['bitbake_version'])
+
+ logger.debug(1, "buildinfohelper: build is created %s" % build)
+
+ if buildrequest is not None:
+ buildrequest.build = build
+ buildrequest.save()
+
+ return build
+
+ @staticmethod
+ def get_or_create_targets(target_info):
+ 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, created = Target.objects.get_or_create(build=target_info['build'],
+ target=target)
+ if created:
+ obj.is_image = False
+ if task:
+ obj.task = task
+ obj.save()
+ result.append(obj)
+ return result
+
+ def update_build_object(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()
+
+ def update_target_set_license_manifest(self, target, license_manifest_path):
+ target.license_manifest_path = license_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):
+ # Special case the toaster-custom-images layer which is created
+ # on the fly so don't update the values which may cause the layer
+ # to be duplicated on a future get_or_create
+ if layer_obj.layer.name == CustomImageRecipe.LAYER_NAME:
+ return layer_obj
+ # 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,
+ up_branch=layer_obj.up_branch,
+ branch=layer_version_information['branch'],
+ commit=layer_version_information['commit'],
+ local_path=layer_version_information['local_path'],
+ )
+
+ logger.info("created new historical layer version %d",
+ layer_copy.pk)
+
+ 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
+
+ if brbe is None:
+ layer_object, _ = Layer.objects.get_or_create(
+ name=layer_information['name'],
+ layer_index_url=layer_information['layer_index_url'])
+ return layer_object
+ else:
+ # we are under managed mode; we must match the layer used in the Project Layer
+ br_id, be_id = brbe.split(":")
+
+ # find layer by checkout path;
+ from bldcontrol import bbcontroller
+ bc = bbcontroller.getBuildEnvironmentController(pk = be_id)
+
+ # we might have a race condition here, as the project layers may change between the build trigger and the actual build execution
+ # but we can only match on the layer name, so the worst thing can happen is a mis-identification of the layer, not a total failure
+
+ # note that this is different
+ buildrequest = BuildRequest.objects.get(pk = br_id)
+ for brl in buildrequest.brlayer_set.all():
+ localdirname = os.path.join(bc.getGitCloneDirectory(brl.giturl, brl.commit), brl.dirpath)
+ # we get a relative path, unless running in HEAD mode where the path is absolute
+ if not localdirname.startswith("/"):
+ localdirname = os.path.join(bc.be.sourcedir, localdirname)
+ #logger.debug(1, "Localdirname %s lcal_path %s" % (localdirname, layer_information['local_path']))
+ if localdirname.startswith(layer_information['local_path']):
+ # If the build request came from toaster this field
+ # should contain the information from the layer_version
+ # That created this build request.
+ if brl.layer_version:
+ return brl.layer_version
+
+ # we matched the BRLayer, but we need the layer_version that generated this BR; reverse of the Project.schedule_build()
+ #logger.debug(1, "Matched %s to BRlayer %s" % (pformat(layer_information["local_path"]), localdirname))
+
+ for pl in buildrequest.project.projectlayer_set.filter(layercommit__layer__name = brl.name):
+ if pl.layercommit.layer.vcs_url == brl.giturl :
+ layer = pl.layercommit.layer
+ layer.save()
+ return layer
+
+ 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 = unicode(path, 'utf-8'),
+ 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 = unicode(path, 'utf-8'),
+ 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 = unicode(filetarget_path, 'utf-8'))
+ 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 = unicode(path, 'utf-8'),
+ 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__up_branch=
+ built_recipe.layer_version.up_branch,
+ 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.warn("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.warn("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_artifact_information(self, build_obj, file_name, file_size):
+ # we skip the image files from other builds
+ if Target_Image_File.objects.filter(file_name = file_name).count() > 0:
+ return
+
+ # do not update artifacts found in other builds
+ if BuildArtifact.objects.filter(file_name = file_name).count() > 0:
+ return
+
+ BuildArtifact.objects.create(build = build_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)
+
+ # 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
+
+
+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
+ """
+
+ # 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 _get_build_information(self, build_log_path):
+ build_info = {}
+ build_info['machine'] = self.server.runCommand(["getVariable", "MACHINE"])[0]
+ build_info['distro'] = self.server.runCommand(["getVariable", "DISTRO"])[0]
+ build_info['distro_version'] = self.server.runCommand(["getVariable", "DISTRO_VERSION"])[0]
+ build_info['started_on'] = timezone.now()
+ build_info['completed_on'] = timezone.now()
+ build_info['cooker_log_path'] = build_log_path
+ build_info['build_name'] = self.server.runCommand(["getVariable", "BUILDNAME"])[0]
+ build_info['bitbake_version'] = self.server.runCommand(["getVariable", "BB_VERSION"])[0]
+ build_info['project'] = self.project = self.server.runCommand(["getVariable", "TOASTER_PROJECT"])[0]
+ return build_info
+
+ def _get_task_information(self, event, recipe):
+ assert 'taskname' in vars(event)
+
+ 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_path(self, path):
+ assert path.startswith("/")
+ assert 'build' in self.internal_state
+
+ 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 we get here, we didn't read layers correctly; dump whatever information we have on the error log
+ logger.warn("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):
+ 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.warn("buildinfohelper: cannot identify layer exception:%s ", nee)
+
+
+ def store_started_build(self, event, build_log_path):
+ assert '_pkgs' in vars(event)
+ build_information = self._get_build_information(build_log_path)
+
+ # Update brbe and project as they can be changed for every build
+ self.project = build_information['project']
+
+ build_obj = self.orm_wrapper.create_build_object(build_information, self.brbe, self.project)
+
+ self.internal_state['build'] = build_obj
+
+ # 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']
+
+ # create target information
+ target_information = {}
+ target_information['targets'] = event._pkgs
+ target_information['build'] = build_obj
+
+ self.internal_state['targets'] = self.orm_wrapper.get_or_create_targets(target_information)
+
+ # 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 + "/"):
+ vh['file']=abs_file_name[len(pp + "/"):]
+ break
+
+ # save the variables
+ self.orm_wrapper.save_build_variables(build_obj, data)
+
+ return self.brbe
+
+
+ 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.viewkeys())
+ 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):
+ 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):
+ if 'build' in self.internal_state:
+ self.orm_wrapper.update_build_object(self.internal_state['build'], errors, warnings, taskfailures)
+
+
+ def store_license_manifest_path(self, event):
+ deploy_dir = BuildInfoHelper._get_data_from_event(event)['deploy_dir']
+ image_name = BuildInfoHelper._get_data_from_event(event)['image_name']
+ path = deploy_dir + "/licenses/" + image_name + "/license.manifest"
+ for target in self.internal_state['targets']:
+ if target.target in image_name:
+ self.orm_wrapper.update_target_set_license_manifest(target, path)
+
+
+ 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):
+ 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]
+
+ 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):
+ # 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.warn("KeyError in save_target_package_information"
+ "%s ", e)
+
+ try:
+ self.orm_wrapper.save_target_file_information(self.internal_state['build'], target, filedata)
+ except KeyError as e:
+ logger.warn("KeyError in save_target_file_information"
+ "%s ", e)
+
+
+
+
+ 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_path(path[1:]) # paths start with a ^
+ assert layer_version_obj is not None
+ 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.warn("buildinfohelper: dependency info not identify recipes: \n%s", errormsg)
+
+
+ def store_build_package_information(self, event):
+ 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)
+ br_id, be_id = self.brbe.split(":")
+ be = BuildEnvironment.objects.get(pk = be_id)
+ be.lock = BuildEnvironment.LOCK_LOCK
+ be.save()
+ 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()
+
+
+ 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):
+ if event.levelno < formatter.WARNING:
+ return
+
+ if 'args' in vars(event):
+ event.msg = event.msg % event.args
+
+ if not 'build' in self.internal_state:
+ if self.brbe is None:
+ if not 'backlog' in self.internal_state:
+ self.internal_state['backlog'] = []
+ self.internal_state['backlog'].append(event)
+ return
+ else: # we're under Toaster control, the build is already created
+ br, _ = self.brbe.split(":")
+ buildrequest = BuildRequest.objects.get(pk = br)
+ self.internal_state['build'] = buildrequest.build
+
+ if 'build' in self.internal_state and '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.msg
+ 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 close(self, errorcode):
+ if self.brbe is not None:
+ self._store_build_done(errorcode)
+
+ if 'backlog' in self.internal_state:
+ if 'build' 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)
+ else:
+ # we have no build, and we still have events; something amazingly wrong happend
+ for event in self.internal_state['backlog']:
+ logger.error("UNSAVED log: %s", event.msg)
+
+ 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
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/__init__.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/__init__.py
new file mode 100644
index 000000000..b7cbe1a4f
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/__init__.py
@@ -0,0 +1,17 @@
+#
+# Gtk+ UI pieces for BitBake
+#
+# 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/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/__init__.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/__init__.py
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/crumbsdialog.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/crumbsdialog.py
new file mode 100644
index 000000000..c679f9a07
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/crumbsdialog.py
@@ -0,0 +1,44 @@
+#
+# BitBake Graphical GTK User Interface
+#
+# Copyright (C) 2011-2012 Intel Corporation
+#
+# Authored by Joshua Lock <josh@linux.intel.com>
+# Authored by Dongxiao Xu <dongxiao.xu@intel.com>
+# Authored by Shane Wang <shane.wang@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 gtk
+
+"""
+The following are convenience classes for implementing GNOME HIG compliant
+BitBake GUI's
+In summary: spacing = 12px, border-width = 6px
+"""
+
+class CrumbsDialog(gtk.Dialog):
+ """
+ A GNOME HIG compliant dialog widget.
+ Add buttons with gtk.Dialog.add_button or gtk.Dialog.add_buttons
+ """
+ def __init__(self, title="", parent=None, flags=0, buttons=None):
+ super(CrumbsDialog, self).__init__(title, parent, flags, buttons)
+
+ self.set_property("has-separator", False) # note: deprecated in 2.22
+
+ self.set_border_width(6)
+ self.vbox.set_property("spacing", 12)
+ self.action_area.set_property("spacing", 12)
+ self.action_area.set_property("border-width", 6)
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/crumbsmessagedialog.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/crumbsmessagedialog.py
new file mode 100644
index 000000000..3b998e463
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/crumbsmessagedialog.py
@@ -0,0 +1,70 @@
+#
+# BitBake Graphical GTK User Interface
+#
+# Copyright (C) 2011-2012 Intel Corporation
+#
+# Authored by Joshua Lock <josh@linux.intel.com>
+# Authored by Dongxiao Xu <dongxiao.xu@intel.com>
+# Authored by Shane Wang <shane.wang@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 glib
+import gtk
+from bb.ui.crumbs.hobwidget import HobIconChecker
+from bb.ui.crumbs.hig.crumbsdialog import CrumbsDialog
+
+"""
+The following are convenience classes for implementing GNOME HIG compliant
+BitBake GUI's
+In summary: spacing = 12px, border-width = 6px
+"""
+
+class CrumbsMessageDialog(gtk.MessageDialog):
+ """
+ A GNOME HIG compliant dialog widget.
+ Add buttons with gtk.Dialog.add_button or gtk.Dialog.add_buttons
+ """
+ def __init__(self, parent = None, label="", dialog_type = gtk.MESSAGE_QUESTION, msg=""):
+ super(CrumbsMessageDialog, self).__init__(None,
+ gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
+ dialog_type,
+ gtk.BUTTONS_NONE,
+ None)
+
+ self.set_skip_taskbar_hint(False)
+
+ self.set_markup(label)
+
+ if 0 <= len(msg) < 300:
+ self.format_secondary_markup(msg)
+ else:
+ vbox = self.get_message_area()
+ vbox.set_border_width(1)
+ vbox.set_property("spacing", 12)
+ self.textWindow = gtk.ScrolledWindow()
+ self.textWindow.set_shadow_type(gtk.SHADOW_IN)
+ self.textWindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
+ self.msgView = gtk.TextView()
+ self.msgView.set_editable(False)
+ self.msgView.set_wrap_mode(gtk.WRAP_WORD)
+ self.msgView.set_cursor_visible(False)
+ self.msgView.set_size_request(300, 300)
+ self.buf = gtk.TextBuffer()
+ self.buf.set_text(msg)
+ self.msgView.set_buffer(self.buf)
+ self.textWindow.add(self.msgView)
+ self.msgView.show()
+ vbox.add(self.textWindow)
+ self.textWindow.show()
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/deployimagedialog.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/deployimagedialog.py
new file mode 100644
index 000000000..a13fff906
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/deployimagedialog.py
@@ -0,0 +1,219 @@
+#
+# BitBake Graphical GTK User Interface
+#
+# Copyright (C) 2011-2012 Intel Corporation
+#
+# Authored by Joshua Lock <josh@linux.intel.com>
+# Authored by Dongxiao Xu <dongxiao.xu@intel.com>
+# Authored by Shane Wang <shane.wang@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 glob
+import gtk
+import gobject
+import os
+import re
+import shlex
+import subprocess
+import tempfile
+from bb.ui.crumbs.hobwidget import hic, HobButton
+from bb.ui.crumbs.progressbar import HobProgressBar
+import bb.ui.crumbs.utils
+import bb.process
+from bb.ui.crumbs.hig.crumbsdialog import CrumbsDialog
+from bb.ui.crumbs.hig.crumbsmessagedialog import CrumbsMessageDialog
+
+"""
+The following are convenience classes for implementing GNOME HIG compliant
+BitBake GUI's
+In summary: spacing = 12px, border-width = 6px
+"""
+
+class DeployImageDialog (CrumbsDialog):
+
+ __dummy_usb__ = "--select a usb drive--"
+
+ def __init__(self, title, image_path, parent, flags, buttons=None, standalone=False):
+ super(DeployImageDialog, self).__init__(title, parent, flags, buttons)
+
+ self.image_path = image_path
+ self.standalone = standalone
+
+ self.create_visual_elements()
+ self.connect("response", self.response_cb)
+
+ def create_visual_elements(self):
+ self.set_size_request(600, 400)
+ label = gtk.Label()
+ label.set_alignment(0.0, 0.5)
+ markup = "<span font_desc='12'>The image to be written into usb drive:</span>"
+ label.set_markup(markup)
+ self.vbox.pack_start(label, expand=False, fill=False, padding=2)
+
+ table = gtk.Table(2, 10, False)
+ table.set_col_spacings(5)
+ table.set_row_spacings(5)
+ self.vbox.pack_start(table, expand=True, fill=True)
+
+ scroll = gtk.ScrolledWindow()
+ scroll.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
+ scroll.set_shadow_type(gtk.SHADOW_IN)
+ tv = gtk.TextView()
+ tv.set_editable(False)
+ tv.set_wrap_mode(gtk.WRAP_WORD)
+ tv.set_cursor_visible(False)
+ self.buf = gtk.TextBuffer()
+ self.buf.set_text(self.image_path)
+ tv.set_buffer(self.buf)
+ scroll.add(tv)
+ table.attach(scroll, 0, 10, 0, 1)
+
+ # There are 2 ways to use DeployImageDialog
+ # One way is that called by HOB when the 'Deploy Image' button is clicked
+ # The other way is that called by a standalone script.
+ # Following block of codes handles the latter way. It adds a 'Select Image' button and
+ # emit a signal when the button is clicked.
+ if self.standalone:
+ gobject.signal_new("select_image_clicked", self, gobject.SIGNAL_RUN_FIRST,
+ gobject.TYPE_NONE, ())
+ icon = gtk.Image()
+ pix_buffer = gtk.gdk.pixbuf_new_from_file(hic.ICON_IMAGES_DISPLAY_FILE)
+ icon.set_from_pixbuf(pix_buffer)
+ button = gtk.Button("Select Image")
+ button.set_image(icon)
+ #button.set_size_request(140, 50)
+ table.attach(button, 9, 10, 1, 2, gtk.FILL, 0, 0, 0)
+ button.connect("clicked", self.select_image_button_clicked_cb)
+
+ separator = gtk.HSeparator()
+ self.vbox.pack_start(separator, expand=False, fill=False, padding=10)
+
+ self.usb_desc = gtk.Label()
+ self.usb_desc.set_alignment(0.0, 0.5)
+ markup = "<span font_desc='12'>You haven't chosen any USB drive.</span>"
+ self.usb_desc.set_markup(markup)
+
+ self.usb_combo = gtk.combo_box_new_text()
+ self.usb_combo.connect("changed", self.usb_combo_changed_cb)
+ model = self.usb_combo.get_model()
+ model.clear()
+ self.usb_combo.append_text(self.__dummy_usb__)
+ for usb in self.find_all_usb_devices():
+ self.usb_combo.append_text("/dev/" + usb)
+ self.usb_combo.set_active(0)
+ self.vbox.pack_start(self.usb_combo, expand=False, fill=False)
+ self.vbox.pack_start(self.usb_desc, expand=False, fill=False, padding=2)
+
+ self.progress_bar = HobProgressBar()
+ self.vbox.pack_start(self.progress_bar, expand=False, fill=False)
+ separator = gtk.HSeparator()
+ self.vbox.pack_start(separator, expand=False, fill=True, padding=10)
+
+ self.vbox.show_all()
+ self.progress_bar.hide()
+
+ def set_image_text_buffer(self, image_path):
+ self.buf.set_text(image_path)
+
+ def set_image_path(self, image_path):
+ self.image_path = image_path
+
+ def popen_read(self, cmd):
+ tmpout, errors = bb.process.run("%s" % cmd)
+ return tmpout.strip()
+
+ def find_all_usb_devices(self):
+ usb_devs = [ os.readlink(u)
+ for u in glob.glob('/dev/disk/by-id/usb*')
+ if not re.search(r'part\d+', u) ]
+ return [ '%s' % u[u.rfind('/')+1:] for u in usb_devs ]
+
+ def get_usb_info(self, dev):
+ return "%s %s" % \
+ (self.popen_read('cat /sys/class/block/%s/device/vendor' % dev),
+ self.popen_read('cat /sys/class/block/%s/device/model' % dev))
+
+ def select_image_button_clicked_cb(self, button):
+ self.emit('select_image_clicked')
+
+ def usb_combo_changed_cb(self, usb_combo):
+ combo_item = self.usb_combo.get_active_text()
+ if not combo_item or combo_item == self.__dummy_usb__:
+ markup = "<span font_desc='12'>You haven't chosen any USB drive.</span>"
+ self.usb_desc.set_markup(markup)
+ else:
+ markup = "<span font_desc='12'>" + self.get_usb_info(combo_item.lstrip("/dev/")) + "</span>"
+ self.usb_desc.set_markup(markup)
+
+ def response_cb(self, dialog, response_id):
+ if response_id == gtk.RESPONSE_YES:
+ lbl = ''
+ msg = ''
+ combo_item = self.usb_combo.get_active_text()
+ if combo_item and combo_item != self.__dummy_usb__ and self.image_path:
+ cmdline = bb.ui.crumbs.utils.which_terminal()
+ if cmdline:
+ tmpfile = tempfile.NamedTemporaryFile()
+ cmdline += "\"sudo dd if=" + self.image_path + \
+ " of=" + combo_item + " && sync; echo $? > " + tmpfile.name + "\""
+ subprocess.call(shlex.split(cmdline))
+
+ if int(tmpfile.readline().strip()) == 0:
+ lbl = "<b>Deploy image successfully.</b>"
+ else:
+ lbl = "<b>Failed to deploy image.</b>"
+ msg = "Please check image <b>%s</b> exists and USB device <b>%s</b> is writable." % (self.image_path, combo_item)
+ tmpfile.close()
+ else:
+ if not self.image_path:
+ lbl = "<b>No selection made.</b>"
+ msg = "You have not selected an image to deploy."
+ else:
+ lbl = "<b>No selection made.</b>"
+ msg = "You have not selected a USB device."
+ if len(lbl):
+ crumbs_dialog = CrumbsMessageDialog(self, lbl, gtk.MESSAGE_INFO, msg)
+ button = crumbs_dialog.add_button("Close", gtk.RESPONSE_OK)
+ HobButton.style_button(button)
+ crumbs_dialog.run()
+ crumbs_dialog.destroy()
+
+ def update_progress_bar(self, title, fraction, status=None):
+ self.progress_bar.update(fraction)
+ self.progress_bar.set_title(title)
+ self.progress_bar.set_rcstyle(status)
+
+ def write_file(self, ifile, ofile):
+ self.progress_bar.reset()
+ self.progress_bar.show()
+
+ f_from = os.open(ifile, os.O_RDONLY)
+ f_to = os.open(ofile, os.O_WRONLY)
+
+ total_size = os.stat(ifile).st_size
+ written_size = 0
+
+ while True:
+ buf = os.read(f_from, 1024*1024)
+ if not buf:
+ break
+ os.write(f_to, buf)
+ written_size += 1024*1024
+ self.update_progress_bar("Writing to usb:", written_size * 1.0/total_size)
+
+ self.update_progress_bar("Writing completed:", 1.0)
+ os.close(f_from)
+ os.close(f_to)
+ self.progress_bar.hide()
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/imageselectiondialog.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/imageselectiondialog.py
new file mode 100644
index 000000000..21216adc9
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/imageselectiondialog.py
@@ -0,0 +1,172 @@
+#
+# BitBake Graphical GTK User Interface
+#
+# Copyright (C) 2011-2012 Intel Corporation
+#
+# Authored by Joshua Lock <josh@linux.intel.com>
+# Authored by Dongxiao Xu <dongxiao.xu@intel.com>
+# Authored by Shane Wang <shane.wang@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 gtk
+import gobject
+import os
+from bb.ui.crumbs.hobwidget import HobViewTable, HobInfoButton, HobButton, HobAltButton
+from bb.ui.crumbs.hig.crumbsdialog import CrumbsDialog
+from bb.ui.crumbs.hig.layerselectiondialog import LayerSelectionDialog
+
+"""
+The following are convenience classes for implementing GNOME HIG compliant
+BitBake GUI's
+In summary: spacing = 12px, border-width = 6px
+"""
+
+class ImageSelectionDialog (CrumbsDialog):
+
+ __columns__ = [{
+ 'col_name' : 'Image name',
+ 'col_id' : 0,
+ 'col_style': 'text',
+ 'col_min' : 400,
+ 'col_max' : 400
+ }, {
+ 'col_name' : 'Select',
+ 'col_id' : 1,
+ 'col_style': 'radio toggle',
+ 'col_min' : 160,
+ 'col_max' : 160
+ }]
+
+
+ def __init__(self, image_folder, image_types, title, parent, flags, buttons=None, image_extension = {}):
+ super(ImageSelectionDialog, self).__init__(title, parent, flags, buttons)
+ self.connect("response", self.response_cb)
+
+ self.image_folder = image_folder
+ self.image_types = image_types
+ self.image_list = []
+ self.image_names = []
+ self.image_extension = image_extension
+
+ # create visual elements on the dialog
+ self.create_visual_elements()
+
+ self.image_store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_BOOLEAN)
+ self.fill_image_store()
+
+ def create_visual_elements(self):
+ hbox = gtk.HBox(False, 6)
+
+ self.vbox.pack_start(hbox, expand=False, fill=False)
+
+ entry = gtk.Entry()
+ entry.set_text(self.image_folder)
+ table = gtk.Table(1, 10, True)
+ table.set_size_request(560, -1)
+ hbox.pack_start(table, expand=False, fill=False)
+ table.attach(entry, 0, 9, 0, 1)
+ image = gtk.Image()
+ image.set_from_stock(gtk.STOCK_OPEN, gtk.ICON_SIZE_BUTTON)
+ open_button = gtk.Button()
+ open_button.set_image(image)
+ open_button.connect("clicked", self.select_path_cb, self, entry)
+ table.attach(open_button, 9, 10, 0, 1)
+
+ self.image_table = HobViewTable(self.__columns__, "Images")
+ self.image_table.set_size_request(-1, 300)
+ self.image_table.connect("toggled", self.toggled_cb)
+ self.image_table.connect_group_selection(self.table_selected_cb)
+ self.image_table.connect("row-activated", self.row_actived_cb)
+ self.vbox.pack_start(self.image_table, expand=True, fill=True)
+
+ self.show_all()
+
+ def change_image_cb(self, model, path, columnid):
+ if not model:
+ return
+ iter = model.get_iter_first()
+ while iter:
+ rowpath = model.get_path(iter)
+ model[rowpath][columnid] = False
+ iter = model.iter_next(iter)
+
+ model[path][columnid] = True
+
+ def toggled_cb(self, table, cell, path, columnid, tree):
+ model = tree.get_model()
+ self.change_image_cb(model, path, columnid)
+
+ def table_selected_cb(self, selection):
+ model, paths = selection.get_selected_rows()
+ if paths:
+ self.change_image_cb(model, paths[0], 1)
+
+ def row_actived_cb(self, tab, model, path):
+ self.change_image_cb(model, path, 1)
+ self.emit('response', gtk.RESPONSE_YES)
+
+ def select_path_cb(self, action, parent, entry):
+ dialog = gtk.FileChooserDialog("", parent,
+ gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER)
+ text = entry.get_text()
+ dialog.set_current_folder(text if len(text) > 0 else os.getcwd())
+ button = dialog.add_button("Cancel", gtk.RESPONSE_NO)
+ HobAltButton.style_button(button)
+ button = dialog.add_button("Open", gtk.RESPONSE_YES)
+ HobButton.style_button(button)
+ response = dialog.run()
+ if response == gtk.RESPONSE_YES:
+ path = dialog.get_filename()
+ entry.set_text(path)
+ self.image_folder = path
+ self.fill_image_store()
+
+ dialog.destroy()
+
+ def fill_image_store(self):
+ self.image_list = []
+ self.image_store.clear()
+ imageset = set()
+ for root, dirs, files in os.walk(self.image_folder):
+ # ignore the sub directories
+ dirs[:] = []
+ for f in files:
+ for image_type in self.image_types:
+ if image_type in self.image_extension:
+ real_types = self.image_extension[image_type]
+ else:
+ real_types = [image_type]
+ for real_image_type in real_types:
+ if f.endswith('.' + real_image_type):
+ imageset.add(f.rsplit('.' + real_image_type)[0].rsplit('.rootfs')[0])
+ self.image_list.append(f)
+
+ for image in imageset:
+ self.image_store.set(self.image_store.append(), 0, image, 1, False)
+
+ self.image_table.set_model(self.image_store)
+
+ def response_cb(self, dialog, response_id):
+ self.image_names = []
+ if response_id == gtk.RESPONSE_YES:
+ iter = self.image_store.get_iter_first()
+ while iter:
+ path = self.image_store.get_path(iter)
+ if self.image_store[path][1]:
+ for f in self.image_list:
+ if f.startswith(self.image_store[path][0] + '.'):
+ self.image_names.append(f)
+ break
+ iter = self.image_store.iter_next(iter)
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/layerselectiondialog.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/layerselectiondialog.py
new file mode 100644
index 000000000..52d57b673
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/layerselectiondialog.py
@@ -0,0 +1,298 @@
+#
+# BitBake Graphical GTK User Interface
+#
+# Copyright (C) 2011-2012 Intel Corporation
+#
+# Authored by Joshua Lock <josh@linux.intel.com>
+# Authored by Dongxiao Xu <dongxiao.xu@intel.com>
+# Authored by Shane Wang <shane.wang@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 gtk
+import gobject
+import os
+import tempfile
+from bb.ui.crumbs.hobwidget import hic, HobButton, HobAltButton
+from bb.ui.crumbs.hig.crumbsdialog import CrumbsDialog
+from bb.ui.crumbs.hig.crumbsmessagedialog import CrumbsMessageDialog
+
+"""
+The following are convenience classes for implementing GNOME HIG compliant
+BitBake GUI's
+In summary: spacing = 12px, border-width = 6px
+"""
+
+class CellRendererPixbufActivatable(gtk.CellRendererPixbuf):
+ """
+ A custom CellRenderer implementation which is activatable
+ so that we can handle user clicks
+ """
+ __gsignals__ = { 'clicked' : (gobject.SIGNAL_RUN_LAST,
+ gobject.TYPE_NONE,
+ (gobject.TYPE_STRING,)), }
+
+ def __init__(self):
+ gtk.CellRendererPixbuf.__init__(self)
+ self.set_property('mode', gtk.CELL_RENDERER_MODE_ACTIVATABLE)
+ self.set_property('follow-state', True)
+
+ """
+ Respond to a user click on a cell
+ """
+ def do_activate(self, even, widget, path, background_area, cell_area, flags):
+ self.emit('clicked', path)
+
+#
+# LayerSelectionDialog
+#
+class LayerSelectionDialog (CrumbsDialog):
+
+ TARGETS = [
+ ("MY_TREE_MODEL_ROW", gtk.TARGET_SAME_WIDGET, 0),
+ ("text/plain", 0, 1),
+ ("TEXT", 0, 2),
+ ("STRING", 0, 3),
+ ]
+
+ def gen_label_widget(self, content):
+ label = gtk.Label()
+ label.set_alignment(0, 0)
+ label.set_markup(content)
+ label.show()
+ return label
+
+ def layer_widget_toggled_cb(self, cell, path, layer_store):
+ name = layer_store[path][0]
+ toggle = not layer_store[path][1]
+ layer_store[path][1] = toggle
+
+ def layer_widget_add_clicked_cb(self, action, layer_store, parent):
+ dialog = gtk.FileChooserDialog("Add new layer", parent,
+ gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER)
+ button = dialog.add_button("Cancel", gtk.RESPONSE_NO)
+ HobAltButton.style_button(button)
+ button = dialog.add_button("Open", gtk.RESPONSE_YES)
+ HobButton.style_button(button)
+ label = gtk.Label("Select the layer you wish to add")
+ label.show()
+ dialog.set_extra_widget(label)
+ response = dialog.run()
+ path = dialog.get_filename()
+ dialog.destroy()
+
+ lbl = "<b>Error</b>"
+ msg = "Unable to load layer <i>%s</i> because " % path
+ if response == gtk.RESPONSE_YES:
+ import os
+ import os.path
+ layers = []
+ it = layer_store.get_iter_first()
+ while it:
+ layers.append(layer_store.get_value(it, 0))
+ it = layer_store.iter_next(it)
+
+ if not path:
+ msg += "it is an invalid path."
+ elif not os.path.exists(path+"/conf/layer.conf"):
+ msg += "there is no layer.conf inside the directory."
+ elif path in layers:
+ msg += "it is already in loaded layers."
+ else:
+ layer_store.append([path])
+ return
+ dialog = CrumbsMessageDialog(parent, lbl, gtk.MESSAGE_ERROR, msg)
+ dialog.add_button(gtk.STOCK_CLOSE, gtk.RESPONSE_OK)
+ response = dialog.run()
+ dialog.destroy()
+
+ def layer_widget_del_clicked_cb(self, action, tree_selection, layer_store):
+ model, iter = tree_selection.get_selected()
+ if iter:
+ layer_store.remove(iter)
+
+
+ def gen_layer_widget(self, layers, layers_avail, window, tooltip=""):
+ hbox = gtk.HBox(False, 6)
+
+ layer_tv = gtk.TreeView()
+ layer_tv.set_rules_hint(True)
+ layer_tv.set_headers_visible(False)
+ tree_selection = layer_tv.get_selection()
+ tree_selection.set_mode(gtk.SELECTION_SINGLE)
+
+ # Allow enable drag and drop of rows including row move
+ dnd_internal_target = ''
+ dnd_targets = [(dnd_internal_target, gtk.TARGET_SAME_WIDGET, 0)]
+ layer_tv.enable_model_drag_source( gtk.gdk.BUTTON1_MASK,
+ dnd_targets,
+ gtk.gdk.ACTION_MOVE)
+ layer_tv.enable_model_drag_dest(dnd_targets,
+ gtk.gdk.ACTION_MOVE)
+ layer_tv.connect("drag_data_get", self.drag_data_get_cb)
+ layer_tv.connect("drag_data_received", self.drag_data_received_cb)
+
+ col0= gtk.TreeViewColumn('Path')
+ cell0 = gtk.CellRendererText()
+ cell0.set_padding(5,2)
+ col0.pack_start(cell0, True)
+ col0.set_cell_data_func(cell0, self.draw_layer_path_cb)
+ layer_tv.append_column(col0)
+
+ scroll = gtk.ScrolledWindow()
+ scroll.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
+ scroll.set_shadow_type(gtk.SHADOW_IN)
+ scroll.add(layer_tv)
+
+ table_layer = gtk.Table(2, 10, False)
+ hbox.pack_start(table_layer, expand=True, fill=True)
+
+ table_layer.attach(scroll, 0, 10, 0, 1)
+
+ layer_store = gtk.ListStore(gobject.TYPE_STRING)
+ for layer in layers:
+ layer_store.append([layer])
+
+ col1 = gtk.TreeViewColumn('Enabled')
+ layer_tv.append_column(col1)
+
+ cell1 = CellRendererPixbufActivatable()
+ cell1.set_fixed_size(-1,35)
+ cell1.connect("clicked", self.del_cell_clicked_cb, layer_store)
+ col1.pack_start(cell1, True)
+ col1.set_cell_data_func(cell1, self.draw_delete_button_cb, layer_tv)
+
+ add_button = gtk.Button()
+ add_button.set_relief(gtk.RELIEF_NONE)
+ box = gtk.HBox(False, 6)
+ box.show()
+ add_button.add(box)
+ add_button.connect("enter-notify-event", self.add_hover_cb)
+ add_button.connect("leave-notify-event", self.add_leave_cb)
+ self.im = gtk.Image()
+ self.im.set_from_file(hic.ICON_INDI_ADD_FILE)
+ self.im.show()
+ box.pack_start(self.im, expand=False, fill=False, padding=6)
+ lbl = gtk.Label("Add layer")
+ lbl.set_alignment(0.0, 0.5)
+ lbl.show()
+ box.pack_start(lbl, expand=True, fill=True, padding=6)
+ add_button.connect("clicked", self.layer_widget_add_clicked_cb, layer_store, window)
+ table_layer.attach(add_button, 0, 10, 1, 2, gtk.EXPAND | gtk.FILL, 0, 0, 6)
+ layer_tv.set_model(layer_store)
+
+ hbox.show_all()
+
+ return hbox, layer_store
+
+ def drag_data_get_cb(self, treeview, context, selection, target_id, etime):
+ treeselection = treeview.get_selection()
+ model, iter = treeselection.get_selected()
+ data = model.get_value(iter, 0)
+ selection.set(selection.target, 8, data)
+
+ def drag_data_received_cb(self, treeview, context, x, y, selection, info, etime):
+ model = treeview.get_model()
+ data = selection.data
+ drop_info = treeview.get_dest_row_at_pos(x, y)
+ if drop_info:
+ path, position = drop_info
+ iter = model.get_iter(path)
+ if (position == gtk.TREE_VIEW_DROP_BEFORE or position == gtk.TREE_VIEW_DROP_INTO_OR_BEFORE):
+ model.insert_before(iter, [data])
+ else:
+ model.insert_after(iter, [data])
+ else:
+ model.append([data])
+ if context.action == gtk.gdk.ACTION_MOVE:
+ context.finish(True, True, etime)
+ return
+
+ def add_hover_cb(self, button, event):
+ self.im.set_from_file(hic.ICON_INDI_ADD_HOVER_FILE)
+
+ def add_leave_cb(self, button, event):
+ self.im.set_from_file(hic.ICON_INDI_ADD_FILE)
+
+ def __init__(self, title, layers, layers_non_removable, all_layers, parent, flags, buttons=None):
+ super(LayerSelectionDialog, self).__init__(title, parent, flags, buttons)
+
+ # class members from other objects
+ self.layers = layers
+ self.layers_non_removable = layers_non_removable
+ self.all_layers = all_layers
+ self.layers_changed = False
+
+ # icon for remove button in TreeView
+ im = gtk.Image()
+ im.set_from_file(hic.ICON_INDI_REMOVE_FILE)
+ self.rem_icon = im.get_pixbuf()
+
+ # class members for internal use
+ self.layer_store = None
+
+ # create visual elements on the dialog
+ self.create_visual_elements()
+ self.connect("response", self.response_cb)
+
+ def create_visual_elements(self):
+ layer_widget, self.layer_store = self.gen_layer_widget(self.layers, self.all_layers, self, None)
+ layer_widget.set_size_request(450, 250)
+ self.vbox.pack_start(layer_widget, expand=True, fill=True)
+ self.show_all()
+
+ def response_cb(self, dialog, response_id):
+ model = self.layer_store
+ it = model.get_iter_first()
+ layers = []
+ while it:
+ layers.append(model.get_value(it, 0))
+ it = model.iter_next(it)
+
+ self.layers_changed = (self.layers != layers)
+ self.layers = layers
+
+ """
+ A custom cell_data_func to draw a delete 'button' in the TreeView for layers
+ other than the meta layer. The deletion of which is prevented so that the
+ user can't shoot themselves in the foot too badly.
+ """
+ def draw_delete_button_cb(self, col, cell, model, it, tv):
+ path = model.get_value(it, 0)
+ if path in self.layers_non_removable:
+ cell.set_sensitive(False)
+ cell.set_property('pixbuf', None)
+ cell.set_property('mode', gtk.CELL_RENDERER_MODE_INERT)
+ else:
+ cell.set_property('pixbuf', self.rem_icon)
+ cell.set_sensitive(True)
+ cell.set_property('mode', gtk.CELL_RENDERER_MODE_ACTIVATABLE)
+
+ return True
+
+ """
+ A custom cell_data_func to write an extra message into the layer path cell
+ for the meta layer. We should inform the user that they can't remove it for
+ their own safety.
+ """
+ def draw_layer_path_cb(self, col, cell, model, it):
+ path = model.get_value(it, 0)
+ if path in self.layers_non_removable:
+ cell.set_property('markup', "<b>It cannot be removed</b>\n%s" % path)
+ else:
+ cell.set_property('text', path)
+
+ def del_cell_clicked_cb(self, cell, path, model):
+ it = model.get_iter_from_string(path)
+ model.remove(it)
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/propertydialog.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/propertydialog.py
new file mode 100644
index 000000000..09b9ce6de
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/propertydialog.py
@@ -0,0 +1,437 @@
+#
+# BitBake Graphical GTK User Interface
+#
+# Copyright (C) 2011-2013 Intel Corporation
+#
+# Authored by Andrei Dinu <andrei.adrianx.dinu@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 string
+import gtk
+import gobject
+import os
+import tempfile
+import glib
+from bb.ui.crumbs.hig.crumbsdialog import CrumbsDialog
+from bb.ui.crumbs.hig.settingsuihelper import SettingsUIHelper
+from bb.ui.crumbs.hig.crumbsmessagedialog import CrumbsMessageDialog
+from bb.ui.crumbs.hig.layerselectiondialog import LayerSelectionDialog
+
+"""
+The following are convenience classes for implementing GNOME HIG compliant
+BitBake GUI's
+In summary: spacing = 12px, border-width = 6px
+"""
+
+class PropertyDialog(CrumbsDialog):
+
+ def __init__(self, title, parent, information, flags, buttons=None):
+
+ super(PropertyDialog, self).__init__(title, parent, flags, buttons)
+
+ self.properties = information
+
+ if len(self.properties) == 10:
+ self.create_recipe_visual_elements()
+ elif len(self.properties) == 5:
+ self.create_package_visual_elements()
+ else:
+ self.create_information_visual_elements()
+
+
+ def create_information_visual_elements(self):
+
+ HOB_ICON_BASE_DIR = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), ("icons/"))
+ ICON_PACKAGES_DISPLAY_FILE = os.path.join(HOB_ICON_BASE_DIR, ('info/info_display.png'))
+
+ self.set_resizable(False)
+
+ self.table = gtk.Table(1,1,False)
+ self.table.set_row_spacings(0)
+ self.table.set_col_spacings(0)
+
+ self.image = gtk.Image()
+ self.image.set_from_file(ICON_PACKAGES_DISPLAY_FILE)
+ self.image.set_property("xalign",0)
+ #self.vbox.add(self.image)
+
+ image_info = self.properties.split("*")[0]
+ info = self.properties.split("*")[1]
+
+ vbox = gtk.VBox(True, spacing=30)
+
+ self.label_short = gtk.Label()
+ self.label_short.set_line_wrap(False)
+ self.label_short.set_markup(image_info)
+ self.label_short.set_property("xalign", 0)
+
+ self.info_label = gtk.Label()
+ self.info_label.set_line_wrap(True)
+ self.info_label.set_markup(info)
+ self.info_label.set_property("yalign", 0.5)
+
+ self.table.attach(self.image, 0,1,0,1, xoptions=gtk.FILL|gtk.EXPAND, yoptions=gtk.FILL,xpadding=5,ypadding=5)
+ self.table.attach(self.label_short, 0,1,0,1, xoptions=gtk.FILL|gtk.EXPAND, yoptions=gtk.FILL,xpadding=40,ypadding=5)
+ self.table.attach(self.info_label, 0,1,1,2, xoptions=gtk.FILL|gtk.EXPAND, yoptions=gtk.FILL,xpadding=40,ypadding=10)
+
+ self.vbox.add(self.table)
+ self.connect('delete-event', lambda w, e: self.destroy() or True)
+
+ def treeViewTooltip( self, widget, e, tooltips, cell, emptyText="" ):
+ try:
+ (path,col,x,y) = widget.get_path_at_pos( int(e.x), int(e.y) )
+ it = widget.get_model().get_iter(path)
+ value = widget.get_model().get_value(it,cell)
+ if value in self.tooltip_items:
+ tooltips.set_tip(widget, self.tooltip_items[value])
+ tooltips.enable()
+ else:
+ tooltips.set_tip(widget, emptyText)
+ except:
+ tooltips.set_tip(widget, emptyText)
+
+
+ def create_package_visual_elements(self):
+
+ import json
+
+ name = self.properties['name']
+ binb = self.properties['binb']
+ size = self.properties['size']
+ recipe = self.properties['recipe']
+ file_list = json.loads(self.properties['files_list'])
+
+ files_temp = ''
+ paths_temp = ''
+ files_binb = []
+ paths_binb = []
+
+ self.tooltip_items = {}
+
+ self.set_resizable(False)
+
+ #cleaning out the recipe variable
+ recipe = recipe.split("+")[0]
+
+ vbox = gtk.VBox(True,spacing = 0)
+
+ ###################################### NAME ROW + COL #################################
+
+ self.label_short = gtk.Label()
+ self.label_short.set_size_request(300,-1)
+ self.label_short.set_selectable(True)
+ self.label_short.set_line_wrap(True)
+ self.label_short.set_markup("<span weight=\"bold\">Name: </span>" + name)
+ self.label_short.set_property("xalign", 0)
+
+ self.vbox.add(self.label_short)
+
+ ###################################### SIZE ROW + COL ######################################
+
+ self.label_short = gtk.Label()
+ self.label_short.set_size_request(300,-1)
+ self.label_short.set_selectable(True)
+ self.label_short.set_line_wrap(True)
+ self.label_short.set_markup("<span weight=\"bold\">Size: </span>" + size)
+ self.label_short.set_property("xalign", 0)
+
+ self.vbox.add(self.label_short)
+
+ ##################################### RECIPE ROW + COL #########################################
+
+ self.label_short = gtk.Label()
+ self.label_short.set_size_request(300,-1)
+ self.label_short.set_selectable(True)
+ self.label_short.set_line_wrap(True)
+ self.label_short.set_markup("<span weight=\"bold\">Recipe: </span>" + recipe)
+ self.label_short.set_property("xalign", 0)
+
+ self.vbox.add(self.label_short)
+
+ ##################################### BINB ROW + COL #######################################
+
+ if binb != '':
+ self.label_short = gtk.Label()
+ self.label_short.set_selectable(True)
+ self.label_short.set_line_wrap(True)
+ self.label_short.set_markup("<span weight=\"bold\">Brought in by: </span>")
+ self.label_short.set_property("xalign", 0)
+
+ self.label_info = gtk.Label()
+ self.label_info.set_size_request(300,-1)
+ self.label_info.set_selectable(True)
+ self.label_info.set_line_wrap(True)
+ self.label_info.set_markup(binb)
+ self.label_info.set_property("xalign", 0)
+
+ self.vbox.add(self.label_short)
+ self.vbox.add(self.label_info)
+
+ #################################### FILES BROUGHT BY PACKAGES ###################################
+
+ if file_list:
+
+ self.textWindow = gtk.ScrolledWindow()
+ self.textWindow.set_shadow_type(gtk.SHADOW_IN)
+ self.textWindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
+ self.textWindow.set_size_request(100, 170)
+
+ packagefiles_store = gtk.ListStore(str)
+
+ self.packagefiles_tv = gtk.TreeView()
+ self.packagefiles_tv.set_rules_hint(True)
+ self.packagefiles_tv.set_headers_visible(True)
+ self.textWindow.add(self.packagefiles_tv)
+
+ self.cell1 = gtk.CellRendererText()
+ col1 = gtk.TreeViewColumn('Package files', self.cell1)
+ col1.set_cell_data_func(self.cell1, self.regex_field)
+ self.packagefiles_tv.append_column(col1)
+
+ items = file_list.keys()
+ items.sort()
+ for item in items:
+ fullpath = item
+ while len(item) > 35:
+ item = item[:len(item)/2] + "" + item[len(item)/2+1:]
+ if len(item) == 35:
+ item = item[:len(item)/2] + "..." + item[len(item)/2+3:]
+ self.tooltip_items[item] = fullpath
+
+ packagefiles_store.append([str(item)])
+
+ self.packagefiles_tv.set_model(packagefiles_store)
+
+ tips = gtk.Tooltips()
+ tips.set_tip(self.packagefiles_tv, "")
+ self.packagefiles_tv.connect("motion-notify-event", self.treeViewTooltip, tips, 0)
+ self.packagefiles_tv.set_events(gtk.gdk.POINTER_MOTION_MASK)
+
+ self.vbox.add(self.textWindow)
+
+ self.vbox.show_all()
+
+
+ def regex_field(self, column, cell, model, iter):
+ cell.set_property('text', model.get_value(iter, 0))
+ return
+
+
+ def create_recipe_visual_elements(self):
+
+ summary = self.properties['summary']
+ name = self.properties['name']
+ version = self.properties['version']
+ revision = self.properties['revision']
+ binb = self.properties['binb']
+ group = self.properties['group']
+ license = self.properties['license']
+ homepage = self.properties['homepage']
+ bugtracker = self.properties['bugtracker']
+ description = self.properties['description']
+
+ self.set_resizable(False)
+
+ #cleaning out the version variable and also the summary
+ version = version.split(":")[1]
+ if len(version) > 30:
+ version = version.split("+")[0]
+ else:
+ version = version.split("-")[0]
+ license = license.replace("&" , "and")
+ if (homepage == ''):
+ homepage = 'unknown'
+ if (bugtracker == ''):
+ bugtracker = 'unknown'
+ summary = summary.split("+")[0]
+
+ #calculating the rows needed for the table
+ binb_items_count = len(binb.split(','))
+ binb_items = binb.split(',')
+
+ vbox = gtk.VBox(False,spacing = 0)
+
+ ######################################## SUMMARY LABEL #########################################
+
+ if summary != '':
+ self.label_short = gtk.Label()
+ self.label_short.set_width_chars(37)
+ self.label_short.set_selectable(True)
+ self.label_short.set_line_wrap(True)
+ self.label_short.set_markup("<b>" + summary + "</b>")
+ self.label_short.set_property("xalign", 0)
+
+ self.vbox.add(self.label_short)
+
+ ########################################## NAME ROW + COL #######################################
+
+ self.label_short = gtk.Label()
+ self.label_short.set_selectable(True)
+ self.label_short.set_line_wrap(True)
+ self.label_short.set_markup("<span weight=\"bold\">Name: </span>" + name)
+ self.label_short.set_property("xalign", 0)
+
+ self.vbox.add(self.label_short)
+
+ ####################################### VERSION ROW + COL ####################################
+
+ self.label_short = gtk.Label()
+ self.label_short.set_selectable(True)
+ self.label_short.set_line_wrap(True)
+ self.label_short.set_markup("<span weight=\"bold\">Version: </span>" + version)
+ self.label_short.set_property("xalign", 0)
+
+ self.vbox.add(self.label_short)
+
+ ##################################### REVISION ROW + COL #####################################
+
+ self.label_short = gtk.Label()
+ self.label_short.set_line_wrap(True)
+ self.label_short.set_selectable(True)
+ self.label_short.set_markup("<span weight=\"bold\">Revision: </span>" + revision)
+ self.label_short.set_property("xalign", 0)
+
+ self.vbox.add(self.label_short)
+
+ ################################## GROUP ROW + COL ############################################
+
+ self.label_short = gtk.Label()
+ self.label_short.set_selectable(True)
+ self.label_short.set_line_wrap(True)
+ self.label_short.set_markup("<span weight=\"bold\">Group: </span>" + group)
+ self.label_short.set_property("xalign", 0)
+
+ self.vbox.add(self.label_short)
+
+ ################################# HOMEPAGE ROW + COL ############################################
+
+ if homepage != 'unknown':
+ self.label_info = gtk.Label()
+ self.label_info.set_selectable(True)
+ self.label_info.set_line_wrap(True)
+ if len(homepage) > 35:
+ self.label_info.set_markup("<a href=\"" + homepage + "\">" + homepage[0:35] + "..." + "</a>")
+ else:
+ self.label_info.set_markup("<a href=\"" + homepage + "\">" + homepage[0:60] + "</a>")
+
+ self.label_info.set_property("xalign", 0)
+
+ self.label_short = gtk.Label()
+ self.label_short.set_selectable(True)
+ self.label_short.set_line_wrap(True)
+ self.label_short.set_markup("<b>Homepage: </b>")
+ self.label_short.set_property("xalign", 0)
+
+ self.vbox.add(self.label_short)
+ self.vbox.add(self.label_info)
+
+ ################################# BUGTRACKER ROW + COL ###########################################
+
+ if bugtracker != 'unknown':
+ self.label_info = gtk.Label()
+ self.label_info.set_selectable(True)
+ self.label_info.set_line_wrap(True)
+ if len(bugtracker) > 35:
+ self.label_info.set_markup("<a href=\"" + bugtracker + "\">" + bugtracker[0:35] + "..." + "</a>")
+ else:
+ self.label_info.set_markup("<a href=\"" + bugtracker + "\">" + bugtracker[0:60] + "</a>")
+ self.label_info.set_property("xalign", 0)
+
+ self.label_short = gtk.Label()
+ self.label_short.set_selectable(True)
+ self.label_short.set_line_wrap(True)
+ self.label_short.set_markup("<b>Bugtracker: </b>")
+ self.label_short.set_property("xalign", 0)
+
+ self.vbox.add(self.label_short)
+ self.vbox.add(self.label_info)
+
+ ################################# LICENSE ROW + COL ############################################
+
+ self.label_info = gtk.Label()
+ self.label_info.set_selectable(True)
+ self.label_info.set_line_wrap(True)
+ self.label_info.set_markup(license)
+ self.label_info.set_property("xalign", 0)
+
+ self.label_short = gtk.Label()
+ self.label_short.set_selectable(True)
+ self.label_short.set_line_wrap(True)
+ self.label_short.set_markup("<span weight=\"bold\">License: </span>")
+ self.label_short.set_property("xalign", 0)
+
+ self.vbox.add(self.label_short)
+ self.vbox.add(self.label_info)
+
+ ################################### BINB ROW+COL #############################################
+
+ if binb != '':
+ self.label_short = gtk.Label()
+ self.label_short.set_selectable(True)
+ self.label_short.set_line_wrap(True)
+ self.label_short.set_markup("<span weight=\"bold\">Brought in by: </span>")
+ self.label_short.set_property("xalign", 0)
+ self.vbox.add(self.label_short)
+ self.label_info = gtk.Label()
+ self.label_info.set_selectable(True)
+ self.label_info.set_width_chars(36)
+ if len(binb) > 200:
+ scrolled_window = gtk.ScrolledWindow()
+ scrolled_window.set_policy(gtk.POLICY_NEVER,gtk.POLICY_ALWAYS)
+ scrolled_window.set_size_request(100,100)
+ self.label_info.set_markup(binb)
+ self.label_info.set_padding(6,6)
+ self.label_info.set_alignment(0,0)
+ self.label_info.set_line_wrap(True)
+ scrolled_window.add_with_viewport(self.label_info)
+ self.vbox.add(scrolled_window)
+ else:
+ self.label_info.set_markup(binb)
+ self.label_info.set_property("xalign", 0)
+ self.label_info.set_line_wrap(True)
+ self.vbox.add(self.label_info)
+
+ ################################ DESCRIPTION TAG ROW #################################################
+
+ self.label_short = gtk.Label()
+ self.label_short.set_line_wrap(True)
+ self.label_short.set_markup("<span weight=\"bold\">Description </span>")
+ self.label_short.set_property("xalign", 0)
+ self.vbox.add(self.label_short)
+
+ ################################ DESCRIPTION INFORMATION ROW ##########################################
+
+ hbox = gtk.HBox(True,spacing = 0)
+
+ self.label_short = gtk.Label()
+ self.label_short.set_selectable(True)
+ self.label_short.set_width_chars(36)
+ if len(description) > 200:
+ scrolled_window = gtk.ScrolledWindow()
+ scrolled_window.set_policy(gtk.POLICY_NEVER,gtk.POLICY_ALWAYS)
+ scrolled_window.set_size_request(100,100)
+ self.label_short.set_markup(description)
+ self.label_short.set_padding(6,6)
+ self.label_short.set_alignment(0,0)
+ self.label_short.set_line_wrap(True)
+ scrolled_window.add_with_viewport(self.label_short)
+ self.vbox.add(scrolled_window)
+ else:
+ self.label_short.set_markup(description)
+ self.label_short.set_property("xalign", 0)
+ self.label_short.set_line_wrap(True)
+ self.vbox.add(self.label_short)
+
+ self.vbox.show_all()
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/settingsuihelper.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/settingsuihelper.py
new file mode 100644
index 000000000..e0285c93c
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hig/settingsuihelper.py
@@ -0,0 +1,122 @@
+#
+# BitBake Graphical GTK User Interface
+#
+# Copyright (C) 2011-2012 Intel Corporation
+#
+# Authored by Joshua Lock <josh@linux.intel.com>
+# Authored by Dongxiao Xu <dongxiao.xu@intel.com>
+# Authored by Shane Wang <shane.wang@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 gtk
+import os
+from bb.ui.crumbs.hobwidget import HobInfoButton, HobButton, HobAltButton
+
+"""
+The following are convenience classes for implementing GNOME HIG compliant
+BitBake GUI's
+In summary: spacing = 12px, border-width = 6px
+"""
+
+class SettingsUIHelper():
+
+ def gen_label_widget(self, content):
+ label = gtk.Label()
+ label.set_alignment(0, 0)
+ label.set_markup(content)
+ label.show()
+ return label
+
+ def gen_label_info_widget(self, content, tooltip):
+ table = gtk.Table(1, 10, False)
+ label = self.gen_label_widget(content)
+ info = HobInfoButton(tooltip, self)
+ table.attach(label, 0, 1, 0, 1, xoptions=gtk.FILL)
+ table.attach(info, 1, 2, 0, 1, xoptions=gtk.FILL, xpadding=10)
+ return table
+
+ def gen_spinner_widget(self, content, lower, upper, tooltip=""):
+ hbox = gtk.HBox(False, 12)
+ adjust = gtk.Adjustment(value=content, lower=lower, upper=upper, step_incr=1)
+ spinner = gtk.SpinButton(adjustment=adjust, climb_rate=1, digits=0)
+
+ spinner.set_value(content)
+ hbox.pack_start(spinner, expand=False, fill=False)
+
+ info = HobInfoButton(tooltip, self)
+ hbox.pack_start(info, expand=False, fill=False)
+
+ hbox.show_all()
+ return hbox, spinner
+
+ def gen_combo_widget(self, curr_item, all_item, tooltip=""):
+ hbox = gtk.HBox(False, 12)
+ combo = gtk.combo_box_new_text()
+ hbox.pack_start(combo, expand=False, fill=False)
+
+ index = 0
+ for item in all_item or []:
+ combo.append_text(item)
+ if item == curr_item:
+ combo.set_active(index)
+ index += 1
+
+ info = HobInfoButton(tooltip, self)
+ hbox.pack_start(info, expand=False, fill=False)
+
+ hbox.show_all()
+ return hbox, combo
+
+ def entry_widget_select_path_cb(self, action, parent, entry):
+ dialog = gtk.FileChooserDialog("", parent,
+ gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER)
+ text = entry.get_text()
+ dialog.set_current_folder(text if len(text) > 0 else os.getcwd())
+ button = dialog.add_button("Cancel", gtk.RESPONSE_NO)
+ HobAltButton.style_button(button)
+ button = dialog.add_button("Open", gtk.RESPONSE_YES)
+ HobButton.style_button(button)
+ response = dialog.run()
+ if response == gtk.RESPONSE_YES:
+ path = dialog.get_filename()
+ entry.set_text(path)
+
+ dialog.destroy()
+
+ def gen_entry_widget(self, content, parent, tooltip="", need_button=True):
+ hbox = gtk.HBox(False, 12)
+ entry = gtk.Entry()
+ entry.set_text(content)
+ entry.set_size_request(350,30)
+
+ if need_button:
+ table = gtk.Table(1, 10, False)
+ hbox.pack_start(table, expand=True, fill=True)
+ table.attach(entry, 0, 9, 0, 1, xoptions=gtk.SHRINK)
+ image = gtk.Image()
+ image.set_from_stock(gtk.STOCK_OPEN,gtk.ICON_SIZE_BUTTON)
+ open_button = gtk.Button()
+ open_button.set_image(image)
+ open_button.connect("clicked", self.entry_widget_select_path_cb, parent, entry)
+ table.attach(open_button, 9, 10, 0, 1, xoptions=gtk.SHRINK)
+ else:
+ hbox.pack_start(entry, expand=True, fill=True)
+
+ if tooltip != "":
+ info = HobInfoButton(tooltip, self)
+ hbox.pack_start(info, expand=False, fill=False)
+
+ hbox.show_all()
+ return hbox, entry
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hobcolor.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hobcolor.py
new file mode 100644
index 000000000..3316542a2
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hobcolor.py
@@ -0,0 +1,38 @@
+#
+# BitBake Graphical GTK User Interface
+#
+# Copyright (C) 2012 Intel Corporation
+#
+# Authored by Shane Wang <shane.wang@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.
+
+class HobColors:
+ WHITE = "#ffffff"
+ PALE_GREEN = "#aaffaa"
+ ORANGE = "#eb8e68"
+ PALE_RED = "#ffaaaa"
+ GRAY = "#aaaaaa"
+ LIGHT_GRAY = "#dddddd"
+ SLIGHT_DARK = "#5f5f5f"
+ DARK = "#3c3b37"
+ BLACK = "#000000"
+ PALE_BLUE = "#53b8ff"
+ DEEP_RED = "#aa3e3e"
+ KHAKI = "#fff68f"
+
+ OK = WHITE
+ RUNNING = PALE_GREEN
+ WARNING = ORANGE
+ ERROR = PALE_RED
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hobwidget.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hobwidget.py
new file mode 100644
index 000000000..2b969c146
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/hobwidget.py
@@ -0,0 +1,904 @@
+# BitBake Graphical GTK User Interface
+#
+# Copyright (C) 2011-2012 Intel Corporation
+#
+# Authored by Dongxiao Xu <dongxiao.xu@intel.com>
+# Authored by Shane Wang <shane.wang@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 gtk
+import gobject
+import os
+import os.path
+import sys
+import pango, pangocairo
+import cairo
+import math
+
+from bb.ui.crumbs.hobcolor import HobColors
+from bb.ui.crumbs.persistenttooltip import PersistentTooltip
+
+class hwc:
+
+ MAIN_WIN_WIDTH = 1024
+ MAIN_WIN_HEIGHT = 700
+
+class hic:
+
+ HOB_ICON_BASE_DIR = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), ("ui/icons/"))
+
+ ICON_RCIPE_DISPLAY_FILE = os.path.join(HOB_ICON_BASE_DIR, ('recipe/recipe_display.png'))
+ ICON_RCIPE_HOVER_FILE = os.path.join(HOB_ICON_BASE_DIR, ('recipe/recipe_hover.png'))
+ ICON_PACKAGES_DISPLAY_FILE = os.path.join(HOB_ICON_BASE_DIR, ('packages/packages_display.png'))
+ ICON_PACKAGES_HOVER_FILE = os.path.join(HOB_ICON_BASE_DIR, ('packages/packages_hover.png'))
+ ICON_LAYERS_DISPLAY_FILE = os.path.join(HOB_ICON_BASE_DIR, ('layers/layers_display.png'))
+ ICON_LAYERS_HOVER_FILE = os.path.join(HOB_ICON_BASE_DIR, ('layers/layers_hover.png'))
+ ICON_IMAGES_DISPLAY_FILE = os.path.join(HOB_ICON_BASE_DIR, ('images/images_display.png'))
+ ICON_IMAGES_HOVER_FILE = os.path.join(HOB_ICON_BASE_DIR, ('images/images_hover.png'))
+ ICON_SETTINGS_DISPLAY_FILE = os.path.join(HOB_ICON_BASE_DIR, ('settings/settings_display.png'))
+ ICON_SETTINGS_HOVER_FILE = os.path.join(HOB_ICON_BASE_DIR, ('settings/settings_hover.png'))
+ ICON_INFO_DISPLAY_FILE = os.path.join(HOB_ICON_BASE_DIR, ('info/info_display.png'))
+ ICON_INFO_HOVER_FILE = os.path.join(HOB_ICON_BASE_DIR, ('info/info_hover.png'))
+ ICON_INDI_CONFIRM_FILE = os.path.join(HOB_ICON_BASE_DIR, ('indicators/confirmation.png'))
+ ICON_INDI_ERROR_FILE = os.path.join(HOB_ICON_BASE_DIR, ('indicators/denied.png'))
+ ICON_INDI_REMOVE_FILE = os.path.join(HOB_ICON_BASE_DIR, ('indicators/remove.png'))
+ ICON_INDI_REMOVE_HOVER_FILE = os.path.join(HOB_ICON_BASE_DIR, ('indicators/remove-hover.png'))
+ ICON_INDI_ADD_FILE = os.path.join(HOB_ICON_BASE_DIR, ('indicators/add.png'))
+ ICON_INDI_ADD_HOVER_FILE = os.path.join(HOB_ICON_BASE_DIR, ('indicators/add-hover.png'))
+ ICON_INDI_REFRESH_FILE = os.path.join(HOB_ICON_BASE_DIR, ('indicators/refresh.png'))
+ ICON_INDI_ALERT_FILE = os.path.join(HOB_ICON_BASE_DIR, ('indicators/alert.png'))
+ ICON_INDI_TICK_FILE = os.path.join(HOB_ICON_BASE_DIR, ('indicators/tick.png'))
+ ICON_INDI_INFO_FILE = os.path.join(HOB_ICON_BASE_DIR, ('indicators/info.png'))
+
+class HobViewTable (gtk.VBox):
+ """
+ A VBox to contain the table for different recipe views and package view
+ """
+ __gsignals__ = {
+ "toggled" : (gobject.SIGNAL_RUN_LAST,
+ gobject.TYPE_NONE,
+ (gobject.TYPE_PYOBJECT,
+ gobject.TYPE_STRING,
+ gobject.TYPE_INT,
+ gobject.TYPE_PYOBJECT,)),
+ "row-activated" : (gobject.SIGNAL_RUN_LAST,
+ gobject.TYPE_NONE,
+ (gobject.TYPE_PYOBJECT,
+ gobject.TYPE_PYOBJECT,)),
+ "cell-fadeinout-stopped" : (gobject.SIGNAL_RUN_LAST,
+ gobject.TYPE_NONE,
+ (gobject.TYPE_PYOBJECT,
+ gobject.TYPE_PYOBJECT,
+ gobject.TYPE_PYOBJECT,)),
+ }
+
+ def __init__(self, columns, name):
+ gtk.VBox.__init__(self, False, 6)
+ self.table_tree = gtk.TreeView()
+ self.table_tree.set_headers_visible(True)
+ self.table_tree.set_headers_clickable(True)
+ self.table_tree.set_rules_hint(True)
+ self.table_tree.set_enable_tree_lines(True)
+ self.table_tree.get_selection().set_mode(gtk.SELECTION_SINGLE)
+ self.toggle_columns = []
+ self.table_tree.connect("row-activated", self.row_activated_cb)
+ self.top_bar = None
+ self.tab_name = name
+
+ for i, column in enumerate(columns):
+ col_name = column['col_name']
+ col = gtk.TreeViewColumn(col_name)
+ col.set_clickable(True)
+ col.set_resizable(True)
+ if self.tab_name.startswith('Included'):
+ if col_name!='Included':
+ col.set_sort_column_id(column['col_id'])
+ else:
+ col.set_sort_column_id(column['col_id'])
+ if 'col_min' in column.keys():
+ col.set_min_width(column['col_min'])
+ if 'col_max' in column.keys():
+ col.set_max_width(column['col_max'])
+ if 'expand' in column.keys():
+ col.set_expand(True)
+ self.table_tree.append_column(col)
+
+ if (not 'col_style' in column.keys()) or column['col_style'] == 'text':
+ cell = gtk.CellRendererText()
+ col.pack_start(cell, True)
+ col.set_attributes(cell, text=column['col_id'])
+ if 'col_t_id' in column.keys():
+ col.add_attribute(cell, 'font', column['col_t_id'])
+ elif column['col_style'] == 'check toggle':
+ cell = HobCellRendererToggle()
+ cell.set_property('activatable', True)
+ cell.connect("toggled", self.toggled_cb, i, self.table_tree)
+ cell.connect_render_state_changed(self.stop_cell_fadeinout_cb, self.table_tree)
+ self.toggle_id = i
+ col.pack_end(cell, True)
+ col.set_attributes(cell, active=column['col_id'])
+ self.toggle_columns.append(col_name)
+ if 'col_group' in column.keys():
+ col.set_cell_data_func(cell, self.set_group_number_cb)
+ elif column['col_style'] == 'radio toggle':
+ cell = gtk.CellRendererToggle()
+ cell.set_property('activatable', True)
+ cell.set_radio(True)
+ cell.connect("toggled", self.toggled_cb, i, self.table_tree)
+ self.toggle_id = i
+ col.pack_end(cell, True)
+ col.set_attributes(cell, active=column['col_id'])
+ self.toggle_columns.append(col_name)
+ elif column['col_style'] == 'binb':
+ cell = gtk.CellRendererText()
+ col.pack_start(cell, True)
+ col.set_cell_data_func(cell, self.display_binb_cb, column['col_id'])
+ if 'col_t_id' in column.keys():
+ col.add_attribute(cell, 'font', column['col_t_id'])
+
+ self.scroll = gtk.ScrolledWindow()
+ self.scroll.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
+ self.scroll.add(self.table_tree)
+
+ self.pack_end(self.scroll, True, True, 0)
+
+ def add_no_result_bar(self, entry):
+ color = HobColors.KHAKI
+ self.top_bar = gtk.EventBox()
+ self.top_bar.set_size_request(-1, 70)
+ self.top_bar.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(color))
+ self.top_bar.set_flags(gtk.CAN_DEFAULT)
+ self.top_bar.grab_default()
+
+ no_result_tab = gtk.Table(5, 20, True)
+ self.top_bar.add(no_result_tab)
+
+ label = gtk.Label()
+ label.set_alignment(0.0, 0.5)
+ title = "No results matching your search"
+ label.set_markup("<span size='x-large'><b>%s</b></span>" % title)
+ no_result_tab.attach(label, 1, 14, 1, 4)
+
+ clear_button = HobButton("Clear search")
+ clear_button.set_tooltip_text("Clear search query")
+ clear_button.connect('clicked', self.set_search_entry_clear_cb, entry)
+ no_result_tab.attach(clear_button, 16, 19, 1, 4)
+
+ self.pack_start(self.top_bar, False, True, 12)
+ self.top_bar.show_all()
+
+ def set_search_entry_clear_cb(self, button, search):
+ if search.get_editable() == True:
+ search.set_text("")
+ search.set_icon_sensitive(gtk.ENTRY_ICON_SECONDARY, False)
+ search.grab_focus()
+
+ def display_binb_cb(self, col, cell, model, it, col_id):
+ binb = model.get_value(it, col_id)
+ # Just display the first item
+ if binb:
+ bin = binb.split(', ')
+ total_no = len(bin)
+ if total_no > 1 and bin[0] == "User Selected":
+ if total_no > 2:
+ present_binb = bin[1] + ' (+' + str(total_no - 1) + ')'
+ else:
+ present_binb = bin[1]
+ else:
+ if total_no > 1:
+ present_binb = bin[0] + ' (+' + str(total_no - 1) + ')'
+ else:
+ present_binb = bin[0]
+ cell.set_property('text', present_binb)
+ else:
+ cell.set_property('text', "")
+ return True
+
+ def set_model(self, tree_model):
+ self.table_tree.set_model(tree_model)
+
+ def toggle_default(self):
+ model = self.table_tree.get_model()
+ if not model:
+ return
+ iter = model.get_iter_first()
+ if iter:
+ rowpath = model.get_path(iter)
+ model[rowpath][self.toggle_id] = True
+
+ def toggled_cb(self, cell, path, columnid, tree):
+ self.emit("toggled", cell, path, columnid, tree)
+
+ def row_activated_cb(self, tree, path, view_column):
+ if not view_column.get_title() in self.toggle_columns:
+ self.emit("row-activated", tree.get_model(), path)
+
+ def stop_cell_fadeinout_cb(self, ctrl, cell, tree):
+ self.emit("cell-fadeinout-stopped", ctrl, cell, tree)
+
+ def set_group_number_cb(self, col, cell, model, iter):
+ if model and (model.iter_parent(iter) == None):
+ cell.cell_attr["number_of_children"] = model.iter_n_children(iter)
+ else:
+ cell.cell_attr["number_of_children"] = 0
+
+ def connect_group_selection(self, cb_func):
+ self.table_tree.get_selection().connect("changed", cb_func)
+
+"""
+A method to calculate a softened value for the colour of widget when in the
+provided state.
+
+widget: the widget whose style to use
+state: the state of the widget to use the style for
+
+Returns a string value representing the softened colour
+"""
+def soften_color(widget, state=gtk.STATE_NORMAL):
+ # this colour munging routine is heavily inspired bu gdu_util_get_mix_color()
+ # from gnome-disk-utility:
+ # http://git.gnome.org/browse/gnome-disk-utility/tree/src/gdu-gtk/gdu-gtk.c?h=gnome-3-0
+ blend = 0.7
+ style = widget.get_style()
+ color = style.text[state]
+ color.red = color.red * blend + style.base[state].red * (1.0 - blend)
+ color.green = color.green * blend + style.base[state].green * (1.0 - blend)
+ color.blue = color.blue * blend + style.base[state].blue * (1.0 - blend)
+ return color.to_string()
+
+class BaseHobButton(gtk.Button):
+ """
+ A gtk.Button subclass which follows the visual design of Hob for primary
+ action buttons
+
+ label: the text to display as the button's label
+ """
+ def __init__(self, label):
+ gtk.Button.__init__(self, label)
+ HobButton.style_button(self)
+
+ @staticmethod
+ def style_button(button):
+ style = button.get_style()
+ style = gtk.rc_get_style_by_paths(gtk.settings_get_default(), 'gtk-button', 'gtk-button', gobject.TYPE_NONE)
+
+ button.set_flags(gtk.CAN_DEFAULT)
+ button.grab_default()
+
+# label = "<span size='x-large'><b>%s</b></span>" % gobject.markup_escape_text(button.get_label())
+ label = button.get_label()
+ button.set_label(label)
+ button.child.set_use_markup(True)
+
+class HobButton(BaseHobButton):
+ """
+ A gtk.Button subclass which follows the visual design of Hob for primary
+ action buttons
+
+ label: the text to display as the button's label
+ """
+ def __init__(self, label):
+ BaseHobButton.__init__(self, label)
+ HobButton.style_button(self)
+
+class HobAltButton(BaseHobButton):
+ """
+ A gtk.Button subclass which has no relief, and so is more discrete
+ """
+ def __init__(self, label):
+ BaseHobButton.__init__(self, label)
+ HobAltButton.style_button(self)
+
+ """
+ A callback for the state-changed event to ensure the text is displayed
+ differently when the widget is not sensitive
+ """
+ @staticmethod
+ def desensitise_on_state_change_cb(button, state):
+ if not button.get_property("sensitive"):
+ HobAltButton.set_text(button, False)
+ else:
+ HobAltButton.set_text(button, True)
+
+ """
+ Set the button label with an appropriate colour for the current widget state
+ """
+ @staticmethod
+ def set_text(button, sensitive=True):
+ if sensitive:
+ colour = HobColors.PALE_BLUE
+ else:
+ colour = HobColors.LIGHT_GRAY
+ button.set_label("<span size='large' color='%s'><b>%s</b></span>" % (colour, gobject.markup_escape_text(button.text)))
+ button.child.set_use_markup(True)
+
+class HobImageButton(gtk.Button):
+ """
+ A gtk.Button with an icon and two rows of text, the second of which is
+ displayed in a blended colour.
+
+ primary_text: the main button label
+ secondary_text: optional second line of text
+ icon_path: path to the icon file to display on the button
+ """
+ def __init__(self, primary_text, secondary_text="", icon_path="", hover_icon_path=""):
+ gtk.Button.__init__(self)
+ self.set_relief(gtk.RELIEF_NONE)
+
+ self.icon_path = icon_path
+ self.hover_icon_path = hover_icon_path
+
+ hbox = gtk.HBox(False, 10)
+ hbox.show()
+ self.add(hbox)
+ self.icon = gtk.Image()
+ self.icon.set_from_file(self.icon_path)
+ self.icon.set_alignment(0.5, 0.0)
+ self.icon.show()
+ if self.hover_icon_path and len(self.hover_icon_path):
+ self.connect("enter-notify-event", self.set_hover_icon_cb)
+ self.connect("leave-notify-event", self.set_icon_cb)
+ hbox.pack_start(self.icon, False, False, 0)
+ label = gtk.Label()
+ label.set_alignment(0.0, 0.5)
+ colour = soften_color(label)
+ mark = "<span size='x-large'>%s</span>\n<span size='medium' fgcolor='%s' weight='ultralight'>%s</span>" % (primary_text, colour, secondary_text)
+ label.set_markup(mark)
+ label.show()
+ hbox.pack_start(label, True, True, 0)
+
+ def set_hover_icon_cb(self, widget, event):
+ self.icon.set_from_file(self.hover_icon_path)
+
+ def set_icon_cb(self, widget, event):
+ self.icon.set_from_file(self.icon_path)
+
+class HobInfoButton(gtk.EventBox):
+ """
+ This class implements a button-like widget per the Hob visual and UX designs
+ which will display a persistent tooltip, with the contents of tip_markup, when
+ clicked.
+
+ tip_markup: the Pango Markup to be displayed in the persistent tooltip
+ """
+ def __init__(self, tip_markup, parent=None):
+ gtk.EventBox.__init__(self)
+ self.image = gtk.Image()
+ self.image.set_from_file(
+ hic.ICON_INFO_DISPLAY_FILE)
+ self.image.show()
+ self.add(self.image)
+ self.tip_markup = tip_markup
+ self.my_parent = parent
+
+ self.set_events(gtk.gdk.BUTTON_RELEASE |
+ gtk.gdk.ENTER_NOTIFY_MASK |
+ gtk.gdk.LEAVE_NOTIFY_MASK)
+
+ self.connect("button-release-event", self.button_release_cb)
+ self.connect("enter-notify-event", self.mouse_in_cb)
+ self.connect("leave-notify-event", self.mouse_out_cb)
+
+ """
+ When the mouse click is released emulate a button-click and show the associated
+ PersistentTooltip
+ """
+ def button_release_cb(self, widget, event):
+ from bb.ui.crumbs.hig.propertydialog import PropertyDialog
+ self.dialog = PropertyDialog(title = '',
+ parent = self.my_parent,
+ information = self.tip_markup,
+ flags = gtk.DIALOG_DESTROY_WITH_PARENT
+ | gtk.DIALOG_NO_SEPARATOR)
+
+ button = self.dialog.add_button("Close", gtk.RESPONSE_CANCEL)
+ HobAltButton.style_button(button)
+ button.connect("clicked", lambda w: self.dialog.destroy())
+ self.dialog.show_all()
+ self.dialog.run()
+
+ """
+ Change to the prelight image when the mouse enters the widget
+ """
+ def mouse_in_cb(self, widget, event):
+ self.image.set_from_file(hic.ICON_INFO_HOVER_FILE)
+
+ """
+ Change to the stock image when the mouse enters the widget
+ """
+ def mouse_out_cb(self, widget, event):
+ self.image.set_from_file(hic.ICON_INFO_DISPLAY_FILE)
+
+class HobIndicator(gtk.DrawingArea):
+ def __init__(self, count):
+ gtk.DrawingArea.__init__(self)
+ # Set no window for transparent background
+ self.set_has_window(False)
+ self.set_size_request(38,38)
+ # We need to pass through button clicks
+ self.add_events(gtk.gdk.BUTTON_PRESS_MASK | gtk.gdk.BUTTON_RELEASE_MASK)
+
+ self.connect('expose-event', self.expose)
+
+ self.count = count
+ self.color = HobColors.GRAY
+
+ def expose(self, widget, event):
+ if self.count and self.count > 0:
+ ctx = widget.window.cairo_create()
+
+ x, y, w, h = self.allocation
+
+ ctx.set_operator(cairo.OPERATOR_OVER)
+ ctx.set_source_color(gtk.gdk.color_parse(self.color))
+ ctx.translate(w/2, h/2)
+ ctx.arc(x, y, min(w,h)/2 - 2, 0, 2*math.pi)
+ ctx.fill_preserve()
+
+ layout = self.create_pango_layout(str(self.count))
+ textw, texth = layout.get_pixel_size()
+ x = (w/2)-(textw/2) + x
+ y = (h/2) - (texth/2) + y
+ ctx.move_to(x, y)
+ self.window.draw_layout(self.style.light_gc[gtk.STATE_NORMAL], int(x), int(y), layout)
+
+ def set_count(self, count):
+ self.count = count
+
+ def set_active(self, active):
+ if active:
+ self.color = HobColors.DEEP_RED
+ else:
+ self.color = HobColors.GRAY
+
+class HobTabLabel(gtk.HBox):
+ def __init__(self, text, count=0):
+ gtk.HBox.__init__(self, False, 0)
+ self.indicator = HobIndicator(count)
+ self.indicator.show()
+ self.pack_end(self.indicator, False, False)
+ self.lbl = gtk.Label(text)
+ self.lbl.set_alignment(0.0, 0.5)
+ self.lbl.show()
+ self.pack_end(self.lbl, True, True, 6)
+
+ def set_count(self, count):
+ self.indicator.set_count(count)
+
+ def set_active(self, active=True):
+ self.indicator.set_active(active)
+
+class HobNotebook(gtk.Notebook):
+ def __init__(self):
+ gtk.Notebook.__init__(self)
+ self.set_property('homogeneous', True)
+
+ self.pages = []
+
+ self.search = None
+ self.search_focus = False
+ self.page_changed = False
+
+ self.connect("switch-page", self.page_changed_cb)
+
+ self.show_all()
+
+ def page_changed_cb(self, nb, page, page_num):
+ for p, lbl in enumerate(self.pages):
+ if p == page_num:
+ lbl.set_active()
+ else:
+ lbl.set_active(False)
+
+ if self.search:
+ self.page_changed = True
+ self.reset_entry(self.search, page_num)
+
+ def append_page(self, child, tab_label, tab_tooltip=None):
+ label = HobTabLabel(tab_label)
+ if tab_tooltip:
+ label.set_tooltip_text(tab_tooltip)
+ label.set_active(False)
+ self.pages.append(label)
+ gtk.Notebook.append_page(self, child, label)
+
+ def set_entry(self, names, tips):
+ self.search = gtk.Entry()
+ self.search_names = names
+ self.search_tips = tips
+ style = self.search.get_style()
+ style.text[gtk.STATE_NORMAL] = self.get_colormap().alloc_color(HobColors.GRAY, False, False)
+ self.search.set_style(style)
+ self.search.set_text(names[0])
+ self.search.set_tooltip_text(self.search_tips[0])
+ self.search.props.has_tooltip = True
+
+ self.search.set_editable(False)
+ self.search.set_icon_from_stock(gtk.ENTRY_ICON_SECONDARY, gtk.STOCK_CLEAR)
+ self.search.set_icon_sensitive(gtk.ENTRY_ICON_SECONDARY, False)
+ self.search.connect("icon-release", self.set_search_entry_clear_cb)
+ self.search.set_width_chars(30)
+ self.search.show()
+
+ self.search.connect("focus-in-event", self.set_search_entry_editable_cb)
+ self.search.connect("focus-out-event", self.set_search_entry_reset_cb)
+ self.set_action_widget(self.search, gtk.PACK_END)
+
+ def show_indicator_icon(self, title, number):
+ for child in self.pages:
+ if child.lbl.get_label() == title:
+ child.set_count(number)
+
+ def hide_indicator_icon(self, title):
+ for child in self.pages:
+ if child.lbl.get_label() == title:
+ child.set_count(0)
+
+ def set_search_entry_editable_cb(self, search, event):
+ self.search_focus = True
+ search.set_editable(True)
+ text = search.get_text()
+ if text in self.search_names:
+ search.set_text("")
+ style = self.search.get_style()
+ style.text[gtk.STATE_NORMAL] = self.get_colormap().alloc_color(HobColors.BLACK, False, False)
+ search.set_style(style)
+
+ def set_search_entry_reset_cb(self, search, event):
+ page_num = self.get_current_page()
+ text = search.get_text()
+ if not text:
+ self.reset_entry(search, page_num)
+
+ def reset_entry(self, entry, page_num):
+ style = entry.get_style()
+ style.text[gtk.STATE_NORMAL] = self.get_colormap().alloc_color(HobColors.GRAY, False, False)
+ entry.set_style(style)
+ entry.set_text(self.search_names[page_num])
+ entry.set_tooltip_text(self.search_tips[page_num])
+ entry.set_editable(False)
+ entry.set_icon_sensitive(gtk.ENTRY_ICON_SECONDARY, False)
+
+ def set_search_entry_clear_cb(self, search, icon_pos, event):
+ if search.get_editable() == True:
+ search.set_text("")
+ search.set_icon_sensitive(gtk.ENTRY_ICON_SECONDARY, False)
+ search.grab_focus()
+
+ def set_page(self, title):
+ for child in self.pages:
+ if child.lbl.get_label() == title:
+ child.grab_focus()
+ self.set_current_page(self.pages.index(child))
+ return
+
+class HobWarpCellRendererText(gtk.CellRendererText):
+ def __init__(self, col_number):
+ gtk.CellRendererText.__init__(self)
+ self.set_property("wrap-mode", pango.WRAP_WORD_CHAR)
+ self.set_property("wrap-width", 300) # default value wrap width is 300
+ self.col_n = col_number
+
+ def do_render(self, window, widget, background_area, cell_area, expose_area, flags):
+ if widget:
+ self.props.wrap_width = self.get_resized_wrap_width(widget, widget.get_column(self.col_n))
+ return gtk.CellRendererText.do_render(self, window, widget, background_area, cell_area, expose_area, flags)
+
+ def get_resized_wrap_width(self, treeview, column):
+ otherCols = []
+ for col in treeview.get_columns():
+ if col != column:
+ otherCols.append(col)
+ adjwidth = treeview.allocation.width - sum(c.get_width() for c in otherCols)
+ adjwidth -= treeview.style_get_property("horizontal-separator") * 4
+ if self.props.wrap_width == adjwidth or adjwidth <= 0:
+ adjwidth = self.props.wrap_width
+ return adjwidth
+
+gobject.type_register(HobWarpCellRendererText)
+
+class HobIconChecker(hic):
+ def set_hob_icon_to_stock_icon(self, file_path, stock_id=""):
+ try:
+ pixbuf = gtk.gdk.pixbuf_new_from_file(file_path)
+ except Exception, e:
+ return None
+
+ if stock_id and (gtk.icon_factory_lookup_default(stock_id) == None):
+ icon_factory = gtk.IconFactory()
+ icon_factory.add_default()
+ icon_factory.add(stock_id, gtk.IconSet(pixbuf))
+ gtk.stock_add([(stock_id, '_label', 0, 0, '')])
+
+ return icon_factory.lookup(stock_id)
+
+ return None
+
+ """
+ For make hob icon consistently by request, and avoid icon view diff by system or gtk version, we use some 'hob icon' to replace the 'gtk icon'.
+ this function check the stock_id and make hob_id to replaced the gtk_id then return it or ""
+ """
+ def check_stock_icon(self, stock_name=""):
+ HOB_CHECK_STOCK_NAME = {
+ ('hic-dialog-info', 'gtk-dialog-info', 'dialog-info') : self.ICON_INDI_INFO_FILE,
+ ('hic-ok', 'gtk-ok', 'ok') : self.ICON_INDI_TICK_FILE,
+ ('hic-dialog-error', 'gtk-dialog-error', 'dialog-error') : self.ICON_INDI_ERROR_FILE,
+ ('hic-dialog-warning', 'gtk-dialog-warning', 'dialog-warning') : self.ICON_INDI_ALERT_FILE,
+ ('hic-task-refresh', 'gtk-execute', 'execute') : self.ICON_INDI_REFRESH_FILE,
+ }
+ valid_stock_id = stock_name
+ if stock_name:
+ for names, path in HOB_CHECK_STOCK_NAME.iteritems():
+ if stock_name in names:
+ valid_stock_id = names[0]
+ if not gtk.icon_factory_lookup_default(valid_stock_id):
+ self.set_hob_icon_to_stock_icon(path, valid_stock_id)
+
+ return valid_stock_id
+
+class HobCellRendererController(gobject.GObject):
+ (MODE_CYCLE_RUNNING, MODE_ONE_SHORT) = range(2)
+ __gsignals__ = {
+ "run-timer-stopped" : (gobject.SIGNAL_RUN_LAST,
+ gobject.TYPE_NONE,
+ ()),
+ }
+ def __init__(self, runningmode=MODE_CYCLE_RUNNING, is_draw_row=False):
+ gobject.GObject.__init__(self)
+ self.timeout_id = None
+ self.current_angle_pos = 0.0
+ self.step_angle = 0.0
+ self.tree_headers_height = 0
+ self.running_cell_areas = []
+ self.running_mode = runningmode
+ self.is_queue_draw_row_area = is_draw_row
+ self.force_stop_enable = False
+
+ def is_active(self):
+ if self.timeout_id:
+ return True
+ else:
+ return False
+
+ def reset_run(self):
+ self.force_stop()
+ self.running_cell_areas = []
+ self.current_angle_pos = 0.0
+ self.step_angle = 0.0
+
+ ''' time_iterval: (1~1000)ms, which will be as the basic interval count for timer
+ init_usrdata: the current data which related the progress-bar will be at
+ min_usrdata: the range of min of user data
+ max_usrdata: the range of max of user data
+ step: each step which you want to progress
+ Note: the init_usrdata should in the range of from min to max, and max should > min
+ step should < (max - min)
+ '''
+ def start_run(self, time_iterval, init_usrdata, min_usrdata, max_usrdata, step, tree):
+ if (not time_iterval) or (not max_usrdata):
+ return
+ usr_range = (max_usrdata - min_usrdata) * 1.0
+ self.current_angle_pos = (init_usrdata * 1.0) / usr_range
+ self.step_angle = (step * 1) / usr_range
+ self.timeout_id = gobject.timeout_add(int(time_iterval),
+ self.make_image_on_progressing_cb, tree)
+ self.tree_headers_height = self.get_treeview_headers_height(tree)
+ self.force_stop_enable = False
+
+ def force_stop(self):
+ self.emit("run-timer-stopped")
+ self.force_stop_enable = True
+ if self.timeout_id:
+ if gobject.source_remove(self.timeout_id):
+ self.timeout_id = None
+
+ def on_draw_pixbuf_cb(self, pixbuf, cr, x, y, img_width, img_height, do_refresh=True):
+ if pixbuf:
+ r = max(img_width/2, img_height/2)
+ cr.translate(x + r, y + r)
+ if do_refresh:
+ cr.rotate(2 * math.pi * self.current_angle_pos)
+
+ cr.set_source_pixbuf(pixbuf, -img_width/2, -img_height/2)
+ cr.paint()
+
+ def on_draw_fadeinout_cb(self, cr, color, x, y, width, height, do_fadeout=True):
+ if do_fadeout:
+ alpha = self.current_angle_pos * 0.8
+ else:
+ alpha = (1.0 - self.current_angle_pos) * 0.8
+
+ cr.set_source_rgba(color.red, color.green, color.blue, alpha)
+ cr.rectangle(x, y, width, height)
+ cr.fill()
+
+ def get_treeview_headers_height(self, tree):
+ if tree and (tree.get_property("headers-visible") == True):
+ height = tree.get_allocation().height - tree.get_bin_window().get_size()[1]
+ return height
+
+ return 0
+
+ def make_image_on_progressing_cb(self, tree):
+ self.current_angle_pos += self.step_angle
+ if self.running_mode == self.MODE_CYCLE_RUNNING:
+ if (self.current_angle_pos >= 1):
+ self.current_angle_pos = 0
+ else:
+ if self.current_angle_pos > 1:
+ self.force_stop()
+ return False
+
+ if self.is_queue_draw_row_area:
+ for path in self.running_cell_areas:
+ rect = tree.get_cell_area(path, tree.get_column(0))
+ row_x, _, row_width, _ = tree.get_visible_rect()
+ tree.queue_draw_area(row_x, rect.y + self.tree_headers_height, row_width, rect.height)
+ else:
+ for rect in self.running_cell_areas:
+ tree.queue_draw_area(rect.x, rect.y + self.tree_headers_height, rect.width, rect.height)
+
+ return (not self.force_stop_enable)
+
+ def append_running_cell_area(self, cell_area):
+ if cell_area and (cell_area not in self.running_cell_areas):
+ self.running_cell_areas.append(cell_area)
+
+ def remove_running_cell_area(self, cell_area):
+ if cell_area in self.running_cell_areas:
+ self.running_cell_areas.remove(cell_area)
+ if not self.running_cell_areas:
+ self.reset_run()
+
+gobject.type_register(HobCellRendererController)
+
+class HobCellRendererPixbuf(gtk.CellRendererPixbuf):
+ def __init__(self):
+ gtk.CellRendererPixbuf.__init__(self)
+ self.control = HobCellRendererController()
+ # add icon checker for make the gtk-icon transfer to hob-icon
+ self.checker = HobIconChecker()
+ self.set_property("stock-size", gtk.ICON_SIZE_DND)
+
+ def get_pixbuf_from_stock_icon(self, widget, stock_id="", size=gtk.ICON_SIZE_DIALOG):
+ if widget and stock_id and gtk.icon_factory_lookup_default(stock_id):
+ return widget.render_icon(stock_id, size)
+
+ return None
+
+ def set_icon_name_to_id(self, new_name):
+ if new_name and type(new_name) == str:
+ # check the name is need to transfer to hob icon or not
+ name = self.checker.check_stock_icon(new_name)
+ if name.startswith("hic") or name.startswith("gtk"):
+ stock_id = name
+ else:
+ stock_id = 'gtk-' + name
+
+ return stock_id
+
+ ''' render cell exactly, "icon-name" is priority
+ if use the 'hic-task-refresh' will make the pix animation
+ if 'pix' will change the pixbuf for it from the pixbuf or image.
+ '''
+ def do_render(self, window, tree, background_area,cell_area, expose_area, flags):
+ if (not self.control) or (not tree):
+ return
+
+ x, y, w, h = self.on_get_size(tree, cell_area)
+ x += cell_area.x
+ y += cell_area.y
+ w -= 2 * self.get_property("xpad")
+ h -= 2 * self.get_property("ypad")
+
+ stock_id = ""
+ if self.props.icon_name:
+ stock_id = self.set_icon_name_to_id(self.props.icon_name)
+ elif self.props.stock_id:
+ stock_id = self.props.stock_id
+ elif self.props.pixbuf:
+ pix = self.props.pixbuf
+ else:
+ return
+
+ if stock_id:
+ pix = self.get_pixbuf_from_stock_icon(tree, stock_id, self.props.stock_size)
+ if stock_id == 'hic-task-refresh':
+ self.control.append_running_cell_area(cell_area)
+ if self.control.is_active():
+ self.control.on_draw_pixbuf_cb(pix, window.cairo_create(), x, y, w, h, True)
+ else:
+ self.control.start_run(200, 0, 0, 1000, 150, tree)
+ else:
+ self.control.remove_running_cell_area(cell_area)
+ self.control.on_draw_pixbuf_cb(pix, window.cairo_create(), x, y, w, h, False)
+
+ def on_get_size(self, widget, cell_area):
+ if self.props.icon_name or self.props.pixbuf or self.props.stock_id:
+ w, h = gtk.icon_size_lookup(self.props.stock_size)
+ calc_width = self.get_property("xpad") * 2 + w
+ calc_height = self.get_property("ypad") * 2 + h
+ x_offset = 0
+ y_offset = 0
+ if cell_area and w > 0 and h > 0:
+ x_offset = self.get_property("xalign") * (cell_area.width - calc_width - self.get_property("xpad"))
+ y_offset = self.get_property("yalign") * (cell_area.height - calc_height - self.get_property("ypad"))
+
+ return x_offset, y_offset, w, h
+
+ return 0, 0, 0, 0
+
+gobject.type_register(HobCellRendererPixbuf)
+
+class HobCellRendererToggle(gtk.CellRendererToggle):
+ def __init__(self):
+ gtk.CellRendererToggle.__init__(self)
+ self.ctrl = HobCellRendererController(is_draw_row=True)
+ self.ctrl.running_mode = self.ctrl.MODE_ONE_SHORT
+ self.cell_attr = {"fadeout": False, "number_of_children": 0}
+
+ def do_render(self, window, widget, background_area, cell_area, expose_area, flags):
+ if (not self.ctrl) or (not widget):
+ return
+
+ if flags & gtk.CELL_RENDERER_SELECTED:
+ state = gtk.STATE_SELECTED
+ else:
+ state = gtk.STATE_NORMAL
+
+ if self.ctrl.is_active():
+ path = widget.get_path_at_pos(cell_area.x + cell_area.width/2, cell_area.y + cell_area.height/2)
+ # sometimes the parameters of cell_area will be a negative number,such as pull up down the scroll bar
+ # it's over the tree container range, so the path will be bad
+ if not path: return
+ path = path[0]
+ if path in self.ctrl.running_cell_areas:
+ cr = window.cairo_create()
+ color = widget.get_style().base[state]
+
+ row_x, _, row_width, _ = widget.get_visible_rect()
+ border_y = self.get_property("ypad")
+ self.ctrl.on_draw_fadeinout_cb(cr, color, row_x, cell_area.y - border_y, row_width, \
+ cell_area.height + border_y * 2, self.cell_attr["fadeout"])
+ # draw number of a group
+ if self.cell_attr["number_of_children"]:
+ text = "%d pkg" % self.cell_attr["number_of_children"]
+ pangolayout = widget.create_pango_layout(text)
+ textw, texth = pangolayout.get_pixel_size()
+ x = cell_area.x + (cell_area.width/2) - (textw/2)
+ y = cell_area.y + (cell_area.height/2) - (texth/2)
+
+ widget.style.paint_layout(window, state, True, cell_area, widget, "checkbox", x, y, pangolayout)
+ else:
+ return gtk.CellRendererToggle.do_render(self, window, widget, background_area, cell_area, expose_area, flags)
+
+ '''delay: normally delay time is 1000ms
+ cell_list: whilch cells need to be render
+ '''
+ def fadeout(self, tree, delay, cell_list=None):
+ if (delay < 200) or (not tree):
+ return
+ self.cell_attr["fadeout"] = True
+ self.ctrl.running_cell_areas = cell_list
+ self.ctrl.start_run(200, 0, 0, delay, (delay * 200 / 1000), tree)
+
+ def connect_render_state_changed(self, func, usrdata=None):
+ if not func:
+ return
+ if usrdata:
+ self.ctrl.connect("run-timer-stopped", func, self, usrdata)
+ else:
+ self.ctrl.connect("run-timer-stopped", func, self)
+
+gobject.type_register(HobCellRendererToggle)
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/persistenttooltip.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/persistenttooltip.py
new file mode 100644
index 000000000..927c19429
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/persistenttooltip.py
@@ -0,0 +1,186 @@
+#
+# BitBake Graphical GTK User Interface
+#
+# Copyright (C) 2012 Intel Corporation
+#
+# Authored by Joshua Lock <josh@linux.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 gobject
+import gtk
+try:
+ import gconf
+except:
+ pass
+
+class PersistentTooltip(gtk.Window):
+ """
+ A tooltip which persists once shown until the user dismisses it with the Esc
+ key or by clicking the close button.
+
+ # FIXME: the PersistentTooltip should be disabled when the user clicks anywhere off
+ # it. We can't do this with focus-out-event becuase modal ensures we have focus?
+
+ markup: some Pango text markup to display in the tooltip
+ """
+ def __init__(self, markup, parent_win=None):
+ gtk.Window.__init__(self, gtk.WINDOW_POPUP)
+
+ # Inherit the system theme for a tooltip
+ style = gtk.rc_get_style_by_paths(gtk.settings_get_default(),
+ 'gtk-tooltip', 'gtk-tooltip', gobject.TYPE_NONE)
+ self.set_style(style)
+
+ # The placement of the close button on the tip should reflect how the
+ # window manager of the users system places close buttons. Try to read
+ # the metacity gconf key to determine whether the close button is on the
+ # left or the right.
+ # In the case that we can't determine the users configuration we default
+ # to close buttons being on the right.
+ __button_right = True
+ try:
+ client = gconf.client_get_default()
+ order = client.get_string("/apps/metacity/general/button_layout")
+ if order and order.endswith(":"):
+ __button_right = False
+ except NameError:
+ pass
+
+ # We need to ensure we're only shown once
+ self.shown = False
+
+ # We don't want any WM decorations
+ self.set_decorated(False)
+ # We don't want to show in the taskbar or window switcher
+ self.set_skip_pager_hint(True)
+ self.set_skip_taskbar_hint(True)
+ # We must be modal to ensure we grab focus when presented from a gtk.Dialog
+ self.set_modal(True)
+
+ self.set_border_width(0)
+ self.set_position(gtk.WIN_POS_MOUSE)
+ self.set_opacity(0.95)
+
+ # Ensure a reasonable minimum size
+ self.set_geometry_hints(self, 100, 50)
+
+ # Set this window as a transient window for parent(main window)
+ if parent_win:
+ self.set_transient_for(parent_win)
+ self.set_destroy_with_parent(True)
+ # Draw our label and close buttons
+ hbox = gtk.HBox(False, 0)
+ hbox.show()
+ self.add(hbox)
+
+ img = gtk.Image()
+ img.set_from_stock(gtk.STOCK_CLOSE, gtk.ICON_SIZE_BUTTON)
+
+ self.button = gtk.Button()
+ self.button.set_image(img)
+ self.button.connect("clicked", self._dismiss_cb)
+ self.button.set_flags(gtk.CAN_DEFAULT)
+ self.button.grab_focus()
+ self.button.show()
+ vbox = gtk.VBox(False, 0)
+ vbox.show()
+ vbox.pack_start(self.button, False, False, 0)
+ if __button_right:
+ hbox.pack_end(vbox, True, True, 0)
+ else:
+ hbox.pack_start(vbox, True, True, 0)
+
+ self.set_default(self.button)
+
+ bin = gtk.HBox(True, 6)
+ bin.set_border_width(6)
+ bin.show()
+ self.label = gtk.Label()
+ self.label.set_line_wrap(True)
+ # We want to match the colours of the normal tooltips, as dictated by
+ # the users gtk+-2.0 theme, wherever possible - on some systems this
+ # requires explicitly setting a fg_color for the label which matches the
+ # tooltip_fg_color
+ settings = gtk.settings_get_default()
+ colours = settings.get_property('gtk-color-scheme').split('\n')
+ # remove any empty lines, there's likely to be a trailing one after
+ # calling split on a dictionary-like string
+ colours = filter(None, colours)
+ for col in colours:
+ item, val = col.split(': ')
+ if item == 'tooltip_fg_color':
+ style = self.label.get_style()
+ style.fg[gtk.STATE_NORMAL] = gtk.gdk.color_parse(val)
+ self.label.set_style(style)
+ break # we only care for the tooltip_fg_color
+
+ self.label.set_markup(markup)
+ self.label.show()
+ bin.add(self.label)
+ hbox.pack_end(bin, True, True, 6)
+
+ # add the original URL display for user reference
+ if 'a href' in markup:
+ hbox.set_tooltip_text(self.get_markup_url(markup))
+ hbox.show()
+
+ self.connect("key-press-event", self._catch_esc_cb)
+
+ """
+ Callback when the PersistentTooltip's close button is clicked.
+ Hides the PersistentTooltip.
+ """
+ def _dismiss_cb(self, button):
+ self.hide()
+ return True
+
+ """
+ Callback when the Esc key is detected. Hides the PersistentTooltip.
+ """
+ def _catch_esc_cb(self, widget, event):
+ keyname = gtk.gdk.keyval_name(event.keyval)
+ if keyname == "Escape":
+ self.hide()
+ return True
+
+ """
+ Called to present the PersistentTooltip.
+ Overrides the superclasses show() method to include state tracking.
+ """
+ def show(self):
+ if not self.shown:
+ self.shown = True
+ gtk.Window.show(self)
+
+ """
+ Called to hide the PersistentTooltip.
+ Overrides the superclasses hide() method to include state tracking.
+ """
+ def hide(self):
+ self.shown = False
+ gtk.Window.hide(self)
+
+ """
+ Called to get the hyperlink URL from markup text.
+ """
+ def get_markup_url(self, markup):
+ url = "http:"
+ if markup and type(markup) == str:
+ s = markup
+ if 'http:' in s:
+ import re
+ url = re.search('(http:[^,\\ "]+)', s).group(0)
+
+ return url
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/progress.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/progress.py
new file mode 100644
index 000000000..1d28a111b
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/progress.py
@@ -0,0 +1,23 @@
+import gtk
+
+class ProgressBar(gtk.Dialog):
+ def __init__(self, parent):
+
+ gtk.Dialog.__init__(self, flags=(gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT))
+ self.set_title("Parsing metadata, please wait...")
+ self.set_default_size(500, 0)
+ self.set_transient_for(parent)
+ self.progress = gtk.ProgressBar()
+ self.vbox.pack_start(self.progress)
+ self.show_all()
+
+ def set_text(self, msg):
+ self.progress.set_text(msg)
+
+ def update(self, x, y):
+ self.progress.set_fraction(float(x)/float(y))
+ self.progress.set_text("%2d %%" % (x*100/y))
+
+ def pulse(self):
+ self.progress.set_text("Loading...")
+ self.progress.pulse()
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/progressbar.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/progressbar.py
new file mode 100644
index 000000000..3e2c660e4
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/progressbar.py
@@ -0,0 +1,59 @@
+# BitBake Graphical GTK User Interface
+#
+# Copyright (C) 2011 Intel Corporation
+#
+# Authored by Shane Wang <shane.wang@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 gtk
+from bb.ui.crumbs.hobcolor import HobColors
+
+class HobProgressBar (gtk.ProgressBar):
+ def __init__(self):
+ gtk.ProgressBar.__init__(self)
+ self.set_rcstyle(True)
+ self.percentage = 0
+
+ def set_rcstyle(self, status):
+ rcstyle = gtk.RcStyle()
+ rcstyle.fg[2] = gtk.gdk.Color(HobColors.BLACK)
+ if status == "stop":
+ rcstyle.bg[3] = gtk.gdk.Color(HobColors.WARNING)
+ elif status == "fail":
+ rcstyle.bg[3] = gtk.gdk.Color(HobColors.ERROR)
+ else:
+ rcstyle.bg[3] = gtk.gdk.Color(HobColors.RUNNING)
+ self.modify_style(rcstyle)
+
+ def set_title(self, text=None):
+ if not text:
+ text = ""
+ text += " %.0f%%" % self.percentage
+ self.set_text(text)
+
+ def set_stop_title(self, text=None):
+ if not text:
+ text = ""
+ self.set_text(text)
+
+ def reset(self):
+ self.set_fraction(0)
+ self.set_text("")
+ self.set_rcstyle(True)
+ self.percentage = 0
+
+ def update(self, fraction):
+ self.percentage = int(fraction * 100)
+ self.set_fraction(fraction)
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/puccho.glade b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/puccho.glade
new file mode 100644
index 000000000..d7553a6e1
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/puccho.glade
@@ -0,0 +1,606 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--Generated with glade3 3.4.5 on Mon Nov 10 12:24:12 2008 -->
+<glade-interface>
+ <widget class="GtkDialog" id="build_dialog">
+ <property name="title" translatable="yes">Start a build</property>
+ <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="has_separator">False</property>
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox1">
+ <property name="visible">True</property>
+ <property name="spacing">2</property>
+ <child>
+ <widget class="GtkTable" id="build_table">
+ <property name="visible">True</property>
+ <property name="border_width">6</property>
+ <property name="n_rows">7</property>
+ <property name="n_columns">3</property>
+ <property name="column_spacing">5</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <widget class="GtkAlignment" id="status_alignment">
+ <property name="visible">True</property>
+ <property name="left_padding">12</property>
+ <child>
+ <widget class="GtkHBox" id="status_hbox">
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkImage" id="status_image">
+ <property name="visible">True</property>
+ <property name="no_show_all">True</property>
+ <property name="xalign">0</property>
+ <property name="stock">gtk-dialog-error</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="status_label">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">If you see this text something is wrong...</property>
+ <property name="use_markup">True</property>
+ <property name="use_underline">True</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="right_attach">3</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">&lt;b&gt;Build configuration&lt;/b&gt;</property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="right_attach">3</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkComboBox" id="image_combo">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">6</property>
+ <property name="bottom_attach">7</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="image_label">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="xalign">0</property>
+ <property name="xpad">12</property>
+ <property name="label" translatable="yes">Image:</property>
+ </widget>
+ <packing>
+ <property name="top_attach">6</property>
+ <property name="bottom_attach">7</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkComboBox" id="distribution_combo">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="distribution_label">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="xalign">0</property>
+ <property name="xpad">12</property>
+ <property name="label" translatable="yes">Distribution:</property>
+ </widget>
+ <packing>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkComboBox" id="machine_combo">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="machine_label">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="xalign">0</property>
+ <property name="xpad">12</property>
+ <property name="label" translatable="yes">Machine:</property>
+ </widget>
+ <packing>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="refresh_button">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="label" translatable="yes">gtk-refresh</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="location_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="width_chars">32</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="xpad">12</property>
+ <property name="label" translatable="yes">Location:</property>
+ </widget>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">&lt;b&gt;Repository&lt;/b&gt;</property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="right_attach">3</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkAlignment" id="alignment2">
+ <property name="visible">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkAlignment" id="alignment3">
+ <property name="visible">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">6</property>
+ <property name="bottom_attach">7</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area1">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <widget class="GtkDialog" id="dialog2">
+ <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="has_separator">False</property>
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox2">
+ <property name="visible">True</property>
+ <property name="spacing">2</property>
+ <child>
+ <widget class="GtkTable" id="table2">
+ <property name="visible">True</property>
+ <property name="border_width">6</property>
+ <property name="n_rows">7</property>
+ <property name="n_columns">3</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <widget class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">&lt;b&gt;Repositories&lt;/b&gt;</property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="right_attach">3</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkAlignment" id="alignment4">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="left_padding">12</property>
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <child>
+ <widget class="GtkTreeView" id="treeview1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_clickable">True</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="right_attach">3</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="entry1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label9">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">&lt;b&gt;Additional packages&lt;/b&gt;</property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="right_attach">3</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkAlignment" id="alignment6">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="xscale">0</property>
+ <child>
+ <widget class="GtkLabel" id="label8">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="xpad">12</property>
+ <property name="label" translatable="yes">Location: </property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkAlignment" id="alignment7">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="xscale">0</property>
+ <child>
+ <widget class="GtkHButtonBox" id="hbuttonbox1">
+ <property name="visible">True</property>
+ <property name="spacing">5</property>
+ <child>
+ <widget class="GtkButton" id="button7">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="label" translatable="yes">gtk-remove</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">0</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkButton" id="button6">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="label" translatable="yes">gtk-edit</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">0</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="button5">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="label" translatable="yes">gtk-add</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">0</property>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkAlignment" id="alignment5">
+ <property name="visible">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label10">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="xpad">12</property>
+ <property name="label" translatable="yes">Search:</property>
+ </widget>
+ <packing>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="entry2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkAlignment" id="alignment8">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="left_padding">12</property>
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <child>
+ <widget class="GtkTreeView" id="treeview2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_clickable">True</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="right_attach">3</property>
+ <property name="top_attach">6</property>
+ <property name="bottom_attach">7</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area2">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <child>
+ <widget class="GtkButton" id="button4">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="label" translatable="yes">gtk-close</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">0</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <widget class="GtkWindow" id="main_window">
+ <child>
+ <widget class="GtkVBox" id="main_window_vbox">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkToolbar" id="main_toolbar">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkToolButton" id="main_toolbutton_build">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Build</property>
+ <property name="stock_id">gtk-execute</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkVPaned" id="vpaned1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <widget class="GtkScrolledWindow" id="results_scrolledwindow">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="resize">False</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkScrolledWindow" id="progress_scrolledwindow">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="resize">True</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+</glade-interface>
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/runningbuild.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/runningbuild.py
new file mode 100644
index 000000000..16a955d2b
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/runningbuild.py
@@ -0,0 +1,551 @@
+
+#
+# BitBake Graphical GTK User Interface
+#
+# Copyright (C) 2008 Intel Corporation
+#
+# Authored by Rob Bradford <rob@linux.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 gtk
+import gobject
+import logging
+import time
+import urllib
+import urllib2
+import pango
+from bb.ui.crumbs.hobcolor import HobColors
+from bb.ui.crumbs.hobwidget import HobWarpCellRendererText, HobCellRendererPixbuf
+
+class RunningBuildModel (gtk.TreeStore):
+ (COL_LOG, COL_PACKAGE, COL_TASK, COL_MESSAGE, COL_ICON, COL_COLOR, COL_NUM_ACTIVE) = range(7)
+
+ def __init__ (self):
+ gtk.TreeStore.__init__ (self,
+ gobject.TYPE_STRING,
+ gobject.TYPE_STRING,
+ gobject.TYPE_STRING,
+ gobject.TYPE_STRING,
+ gobject.TYPE_STRING,
+ gobject.TYPE_STRING,
+ gobject.TYPE_INT)
+
+ def failure_model_filter(self, model, it):
+ color = model.get(it, self.COL_COLOR)[0]
+ if not color:
+ return False
+ if color == HobColors.ERROR or color == HobColors.WARNING:
+ return True
+ return False
+
+ def failure_model(self):
+ model = self.filter_new()
+ model.set_visible_func(self.failure_model_filter)
+ return model
+
+ def foreach_cell_func(self, model, path, iter, usr_data=None):
+ if model.get_value(iter, self.COL_ICON) == "gtk-execute":
+ model.set(iter, self.COL_ICON, "")
+
+ def close_task_refresh(self):
+ self.foreach(self.foreach_cell_func, None)
+
+class RunningBuild (gobject.GObject):
+ __gsignals__ = {
+ 'build-started' : (gobject.SIGNAL_RUN_LAST,
+ gobject.TYPE_NONE,
+ ()),
+ 'build-succeeded' : (gobject.SIGNAL_RUN_LAST,
+ gobject.TYPE_NONE,
+ ()),
+ 'build-failed' : (gobject.SIGNAL_RUN_LAST,
+ gobject.TYPE_NONE,
+ ()),
+ 'build-complete' : (gobject.SIGNAL_RUN_LAST,
+ gobject.TYPE_NONE,
+ ()),
+ 'build-aborted' : (gobject.SIGNAL_RUN_LAST,
+ gobject.TYPE_NONE,
+ ()),
+ 'task-started' : (gobject.SIGNAL_RUN_LAST,
+ gobject.TYPE_NONE,
+ (gobject.TYPE_PYOBJECT,)),
+ 'log-error' : (gobject.SIGNAL_RUN_LAST,
+ gobject.TYPE_NONE,
+ ()),
+ 'log-warning' : (gobject.SIGNAL_RUN_LAST,
+ gobject.TYPE_NONE,
+ ()),
+ 'disk-full' : (gobject.SIGNAL_RUN_LAST,
+ gobject.TYPE_NONE,
+ ()),
+ 'no-provider' : (gobject.SIGNAL_RUN_LAST,
+ gobject.TYPE_NONE,
+ (gobject.TYPE_PYOBJECT,)),
+ 'log' : (gobject.SIGNAL_RUN_LAST,
+ gobject.TYPE_NONE,
+ (gobject.TYPE_STRING, gobject.TYPE_PYOBJECT,)),
+ }
+ pids_to_task = {}
+ tasks_to_iter = {}
+
+ def __init__ (self, sequential=False):
+ gobject.GObject.__init__ (self)
+ self.model = RunningBuildModel()
+ self.sequential = sequential
+ self.buildaborted = False
+
+ def reset (self):
+ self.pids_to_task.clear()
+ self.tasks_to_iter.clear()
+ self.model.clear()
+
+ def handle_event (self, event, pbar=None):
+ # Handle an event from the event queue, this may result in updating
+ # the model and thus the UI. Or it may be to tell us that the build
+ # has finished successfully (or not, as the case may be.)
+
+ parent = None
+ pid = 0
+ package = None
+ task = None
+
+ # If we have a pid attached to this message/event try and get the
+ # (package, task) pair for it. If we get that then get the parent iter
+ # for the message.
+ if hasattr(event, 'pid'):
+ pid = event.pid
+ if hasattr(event, 'process'):
+ pid = event.process
+
+ if pid and pid in self.pids_to_task:
+ (package, task) = self.pids_to_task[pid]
+ parent = self.tasks_to_iter[(package, task)]
+
+ if(isinstance(event, logging.LogRecord)):
+ if event.taskpid == 0 or event.levelno > logging.INFO:
+ self.emit("log", "handle", event)
+ # FIXME: this is a hack! More info in Yocto #1433
+ # http://bugzilla.pokylinux.org/show_bug.cgi?id=1433, temporarily
+ # mask the error message as it's not informative for the user.
+ if event.msg.startswith("Execution of event handler 'run_buildstats' failed"):
+ return
+
+ if (event.levelno < logging.INFO or
+ event.msg.startswith("Running task")):
+ return # don't add these to the list
+
+ if event.levelno >= logging.ERROR:
+ icon = "dialog-error"
+ color = HobColors.ERROR
+ self.emit("log-error")
+ elif event.levelno >= logging.WARNING:
+ icon = "dialog-warning"
+ color = HobColors.WARNING
+ self.emit("log-warning")
+ else:
+ icon = None
+ color = HobColors.OK
+
+ # if we know which package we belong to, we'll append onto its list.
+ # otherwise, we'll jump to the top of the master list
+ if self.sequential or not parent:
+ tree_add = self.model.append
+ else:
+ tree_add = self.model.prepend
+ tree_add(parent,
+ (None,
+ package,
+ task,
+ event.getMessage(),
+ icon,
+ color,
+ 0))
+
+ # if there are warnings while processing a package
+ # (parent), mark the task with warning color;
+ # in case there are errors, the updates will be
+ # handled on TaskFailed.
+ if color == HobColors.WARNING and parent:
+ self.model.set(parent, self.model.COL_COLOR, color)
+ if task: #then we have a parent (package), and update it's color
+ self.model.set(self.tasks_to_iter[(package, None)], self.model.COL_COLOR, color)
+
+ elif isinstance(event, bb.build.TaskStarted):
+ (package, task) = (event._package, event._task)
+
+ # Save out this PID.
+ self.pids_to_task[pid] = (package, task)
+
+ # Check if we already have this package in our model. If so then
+ # that can be the parent for the task. Otherwise we create a new
+ # top level for the package.
+ if ((package, None) in self.tasks_to_iter):
+ parent = self.tasks_to_iter[(package, None)]
+ else:
+ if self.sequential:
+ add = self.model.append
+ else:
+ add = self.model.prepend
+ parent = add(None, (None,
+ package,
+ None,
+ "Package: %s" % (package),
+ None,
+ HobColors.OK,
+ 0))
+ self.tasks_to_iter[(package, None)] = parent
+
+ # Because this parent package now has an active child mark it as
+ # such.
+ self.model.set(parent, self.model.COL_ICON, "gtk-execute")
+ parent_color = self.model.get(parent, self.model.COL_COLOR)[0]
+ if parent_color != HobColors.ERROR and parent_color != HobColors.WARNING:
+ self.model.set(parent, self.model.COL_COLOR, HobColors.RUNNING)
+
+ # Add an entry in the model for this task
+ i = self.model.append (parent, (None,
+ package,
+ task,
+ "Task: %s" % (task),
+ "gtk-execute",
+ HobColors.RUNNING,
+ 0))
+
+ # update the parent's active task count
+ num_active = self.model.get(parent, self.model.COL_NUM_ACTIVE)[0] + 1
+ self.model.set(parent, self.model.COL_NUM_ACTIVE, num_active)
+
+ # Save out the iter so that we can find it when we have a message
+ # that we need to attach to a task.
+ self.tasks_to_iter[(package, task)] = i
+
+ elif isinstance(event, bb.build.TaskBase):
+ self.emit("log", "info", event._message)
+ current = self.tasks_to_iter[(package, task)]
+ parent = self.tasks_to_iter[(package, None)]
+
+ # remove this task from the parent's active count
+ num_active = self.model.get(parent, self.model.COL_NUM_ACTIVE)[0] - 1
+ self.model.set(parent, self.model.COL_NUM_ACTIVE, num_active)
+
+ if isinstance(event, bb.build.TaskFailed):
+ # Mark the task and parent as failed
+ icon = "dialog-error"
+ color = HobColors.ERROR
+
+ logfile = event.logfile
+ if logfile and os.path.exists(logfile):
+ with open(logfile) as f:
+ logdata = f.read()
+ self.model.append(current, ('pastebin', None, None, logdata, 'gtk-error', HobColors.OK, 0))
+
+ for i in (current, parent):
+ self.model.set(i, self.model.COL_ICON, icon,
+ self.model.COL_COLOR, color)
+ else:
+ # Mark the parent package and the task as inactive,
+ # but make sure to preserve error, warnings and active
+ # states
+ parent_color = self.model.get(parent, self.model.COL_COLOR)[0]
+ task_color = self.model.get(current, self.model.COL_COLOR)[0]
+
+ # Mark the task as inactive
+ self.model.set(current, self.model.COL_ICON, None)
+ if task_color != HobColors.ERROR:
+ if task_color == HobColors.WARNING:
+ self.model.set(current, self.model.COL_ICON, 'dialog-warning')
+ else:
+ self.model.set(current, self.model.COL_COLOR, HobColors.OK)
+
+ # Mark the parent as inactive
+ if parent_color != HobColors.ERROR:
+ if parent_color == HobColors.WARNING:
+ self.model.set(parent, self.model.COL_ICON, "dialog-warning")
+ else:
+ self.model.set(parent, self.model.COL_ICON, None)
+ if num_active == 0:
+ self.model.set(parent, self.model.COL_COLOR, HobColors.OK)
+
+ # Clear the iters and the pids since when the task goes away the
+ # pid will no longer be used for messages
+ del self.tasks_to_iter[(package, task)]
+ del self.pids_to_task[pid]
+
+ elif isinstance(event, bb.event.BuildStarted):
+
+ self.emit("build-started")
+ self.model.prepend(None, (None,
+ None,
+ None,
+ "Build Started (%s)" % time.strftime('%m/%d/%Y %H:%M:%S'),
+ None,
+ HobColors.OK,
+ 0))
+ if pbar:
+ pbar.update(0, self.progress_total)
+ pbar.set_title(bb.event.getName(event))
+
+ elif isinstance(event, bb.event.BuildCompleted):
+ failures = int (event._failures)
+ self.model.prepend(None, (None,
+ None,
+ None,
+ "Build Completed (%s)" % time.strftime('%m/%d/%Y %H:%M:%S'),
+ None,
+ HobColors.OK,
+ 0))
+
+ # Emit the appropriate signal depending on the number of failures
+ if self.buildaborted:
+ self.emit ("build-aborted")
+ self.buildaborted = False
+ elif (failures >= 1):
+ self.emit ("build-failed")
+ else:
+ self.emit ("build-succeeded")
+ # Emit a generic "build-complete" signal for things wishing to
+ # handle when the build is finished
+ self.emit("build-complete")
+ # reset the all cell's icon indicator
+ self.model.close_task_refresh()
+ if pbar:
+ pbar.set_text(event.msg)
+
+ elif isinstance(event, bb.event.DiskFull):
+ self.buildaborted = True
+ self.emit("disk-full")
+
+ elif isinstance(event, bb.command.CommandFailed):
+ self.emit("log", "error", "Command execution failed: %s" % (event.error))
+ if event.error.startswith("Exited with"):
+ # If the command fails with an exit code we're done, emit the
+ # generic signal for the UI to notify the user
+ self.emit("build-complete")
+ # reset the all cell's icon indicator
+ self.model.close_task_refresh()
+
+ elif isinstance(event, bb.event.CacheLoadStarted) and pbar:
+ pbar.set_title("Loading cache")
+ self.progress_total = event.total
+ pbar.update(0, self.progress_total)
+ elif isinstance(event, bb.event.CacheLoadProgress) and pbar:
+ pbar.update(event.current, self.progress_total)
+ elif isinstance(event, bb.event.CacheLoadCompleted) and pbar:
+ pbar.update(self.progress_total, self.progress_total)
+ pbar.hide()
+ elif isinstance(event, bb.event.ParseStarted) and pbar:
+ if event.total == 0:
+ return
+ pbar.set_title("Processing recipes")
+ self.progress_total = event.total
+ pbar.update(0, self.progress_total)
+ elif isinstance(event, bb.event.ParseProgress) and pbar:
+ pbar.update(event.current, self.progress_total)
+ elif isinstance(event, bb.event.ParseCompleted) and pbar:
+ pbar.hide()
+ #using runqueue events as many as possible to update the progress bar
+ elif isinstance(event, bb.runqueue.runQueueTaskFailed):
+ self.emit("log", "error", "Task %s (%s) failed with exit code '%s'" % (event.taskid, event.taskstring, event.exitcode))
+ elif isinstance(event, bb.runqueue.sceneQueueTaskFailed):
+ self.emit("log", "warn", "Setscene task %s (%s) failed with exit code '%s' - real task will be run instead" \
+ % (event.taskid, event.taskstring, event.exitcode))
+ elif isinstance(event, (bb.runqueue.runQueueTaskStarted, bb.runqueue.sceneQueueTaskStarted)):
+ if isinstance(event, bb.runqueue.sceneQueueTaskStarted):
+ self.emit("log", "info", "Running setscene task %d of %d (%s)" % \
+ (event.stats.completed + event.stats.active + event.stats.failed + 1,
+ event.stats.total, event.taskstring))
+ else:
+ if event.noexec:
+ tasktype = 'noexec task'
+ else:
+ tasktype = 'task'
+ self.emit("log", "info", "Running %s %s of %s (ID: %s, %s)" % \
+ (tasktype, event.stats.completed + event.stats.active + event.stats.failed + 1,
+ event.stats.total, event.taskid, event.taskstring))
+ message = {}
+ message["eventname"] = bb.event.getName(event)
+ num_of_completed = event.stats.completed + event.stats.failed
+ message["current"] = num_of_completed
+ message["total"] = event.stats.total
+ message["title"] = ""
+ message["task"] = event.taskstring
+ self.emit("task-started", message)
+ elif isinstance(event, bb.event.MultipleProviders):
+ self.emit("log", "info", "multiple providers are available for %s%s (%s)" \
+ % (event._is_runtime and "runtime " or "", event._item, ", ".join(event._candidates)))
+ self.emit("log", "info", "consider defining a PREFERRED_PROVIDER entry to match %s" % (event._item))
+ elif isinstance(event, bb.event.NoProvider):
+ msg = ""
+ if event._runtime:
+ r = "R"
+ else:
+ r = ""
+
+ extra = ''
+ if not event._reasons:
+ if event._close_matches:
+ extra = ". Close matches:\n %s" % '\n '.join(event._close_matches)
+
+ if event._dependees:
+ msg = "Nothing %sPROVIDES '%s' (but %s %sDEPENDS on or otherwise requires it)%s\n" % (r, event._item, ", ".join(event._dependees), r, extra)
+ else:
+ msg = "Nothing %sPROVIDES '%s'%s\n" % (r, event._item, extra)
+ if event._reasons:
+ for reason in event._reasons:
+ msg += ("%s\n" % reason)
+ self.emit("no-provider", msg)
+ self.emit("log", "error", msg)
+ elif isinstance(event, bb.event.LogExecTTY):
+ icon = "dialog-warning"
+ color = HobColors.WARNING
+ if self.sequential or not parent:
+ tree_add = self.model.append
+ else:
+ tree_add = self.model.prepend
+ tree_add(parent,
+ (None,
+ package,
+ task,
+ event.msg,
+ icon,
+ color,
+ 0))
+ else:
+ if not isinstance(event, (bb.event.BuildBase,
+ bb.event.StampUpdate,
+ bb.event.ConfigParsed,
+ bb.event.RecipeParsed,
+ bb.event.RecipePreFinalise,
+ bb.runqueue.runQueueEvent,
+ bb.runqueue.runQueueExitWait,
+ bb.event.OperationStarted,
+ bb.event.OperationCompleted,
+ bb.event.OperationProgress)):
+ self.emit("log", "error", "Unknown event: %s" % (event.error if hasattr(event, 'error') else 'error'))
+
+ return
+
+
+def do_pastebin(text):
+ url = 'http://pastebin.com/api_public.php'
+ params = {'paste_code': text, 'paste_format': 'text'}
+
+ req = urllib2.Request(url, urllib.urlencode(params))
+ response = urllib2.urlopen(req)
+ paste_url = response.read()
+
+ return paste_url
+
+
+class RunningBuildTreeView (gtk.TreeView):
+ __gsignals__ = {
+ "button_press_event" : "override"
+ }
+ def __init__ (self, readonly=False, hob=False):
+ gtk.TreeView.__init__ (self)
+ self.readonly = readonly
+
+ # The icon that indicates whether we're building or failed.
+ # add 'hob' flag because there has not only hob to share this code
+ if hob:
+ renderer = HobCellRendererPixbuf ()
+ else:
+ renderer = gtk.CellRendererPixbuf()
+ col = gtk.TreeViewColumn ("Status", renderer)
+ col.add_attribute (renderer, "icon-name", 4)
+ self.append_column (col)
+
+ # The message of the build.
+ # add 'hob' flag because there has not only hob to share this code
+ if hob:
+ self.message_renderer = HobWarpCellRendererText (col_number=1)
+ else:
+ self.message_renderer = gtk.CellRendererText ()
+ self.message_column = gtk.TreeViewColumn ("Message", self.message_renderer, text=3)
+ self.message_column.add_attribute(self.message_renderer, 'background', 5)
+ self.message_renderer.set_property('editable', (not self.readonly))
+ self.append_column (self.message_column)
+
+ def do_button_press_event(self, event):
+ gtk.TreeView.do_button_press_event(self, event)
+
+ if event.button == 3:
+ selection = super(RunningBuildTreeView, self).get_selection()
+ (model, it) = selection.get_selected()
+ if it is not None:
+ can_paste = model.get(it, model.COL_LOG)[0]
+ if can_paste == 'pastebin':
+ # build a simple menu with a pastebin option
+ menu = gtk.Menu()
+ menuitem = gtk.MenuItem("Copy")
+ menu.append(menuitem)
+ menuitem.connect("activate", self.clipboard_handler, (model, it))
+ menuitem.show()
+ menuitem = gtk.MenuItem("Send log to pastebin")
+ menu.append(menuitem)
+ menuitem.connect("activate", self.pastebin_handler, (model, it))
+ menuitem.show()
+ menu.show()
+ menu.popup(None, None, None, event.button, event.time)
+
+ def _add_to_clipboard(self, clipping):
+ """
+ Add the contents of clipping to the system clipboard.
+ """
+ clipboard = gtk.clipboard_get()
+ clipboard.set_text(clipping)
+ clipboard.store()
+
+ def pastebin_handler(self, widget, data):
+ """
+ Send the log data to pastebin, then add the new paste url to the
+ clipboard.
+ """
+ (model, it) = data
+ paste_url = do_pastebin(model.get(it, model.COL_MESSAGE)[0])
+
+ # @todo Provide visual feedback to the user that it is done and that
+ # it worked.
+ print paste_url
+
+ self._add_to_clipboard(paste_url)
+
+ def clipboard_handler(self, widget, data):
+ """
+ """
+ (model, it) = data
+ message = model.get(it, model.COL_MESSAGE)[0]
+
+ self._add_to_clipboard(message)
+
+class BuildFailureTreeView(gtk.TreeView):
+
+ def __init__ (self):
+ gtk.TreeView.__init__(self)
+ self.set_rules_hint(False)
+ self.set_headers_visible(False)
+ self.get_selection().set_mode(gtk.SELECTION_SINGLE)
+
+ # The icon that indicates whether we're building or failed.
+ renderer = HobCellRendererPixbuf ()
+ col = gtk.TreeViewColumn ("Status", renderer)
+ col.add_attribute (renderer, "icon-name", RunningBuildModel.COL_ICON)
+ self.append_column (col)
+
+ # The message of the build.
+ self.message_renderer = HobWarpCellRendererText (col_number=1)
+ self.message_column = gtk.TreeViewColumn ("Message", self.message_renderer, text=RunningBuildModel.COL_MESSAGE, background=RunningBuildModel.COL_COLOR)
+ self.append_column (self.message_column)
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/utils.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/utils.py
new file mode 100644
index 000000000..939864fa6
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/crumbs/utils.py
@@ -0,0 +1,34 @@
+#
+# BitBake UI Utils
+#
+# 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.
+
+# This utility method looks for xterm or vte and return the
+# frist to exist, currently we are keeping this simple, but
+# we will likely move the oe.terminal implementation into
+# bitbake which will allow more flexibility.
+
+import os
+import bb
+
+def which_terminal():
+ term = bb.utils.which(os.environ["PATH"], "xterm")
+ if term:
+ return term + " -e "
+ term = bb.utils.which(os.environ["PATH"], "vte")
+ if term:
+ return term + " -c "
+ return None
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/depexp.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/depexp.py
new file mode 100644
index 000000000..240aafc3e
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/depexp.py
@@ -0,0 +1,333 @@
+#
+# 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 gobject
+import gtk
+import Queue
+import threading
+import xmlrpclib
+import bb
+import bb.event
+from bb.ui.crumbs.progressbar import HobProgressBar
+
+# 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)
+ self.set_model(self.filter_model)
+ #self.connect("row-activated", self.on_package_activated, COL_DEP_PACKAGE)
+ self.append_column(gtk.TreeViewColumn(label, gtk.CellRendererText(), text=COL_DEP_PACKAGE))
+
+ def _filter(self, model, iter):
+ (this_type, package) = model.get(iter, COL_DEP_TYPE, 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.set_model(self.filter_model)
+ self.append_column(gtk.TreeViewColumn(label, gtk.CellRendererText(), text=COL_DEP_PARENT))
+
+ def _filter(self, model, iter):
+ package = model.get_value(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("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.SORT_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.SORT_ASCENDING)
+
+ pane = gtk.HPaned()
+ pane.set_position(250)
+ self.add(pane)
+
+ # The master list of packages
+ scrolled = gtk.ScrolledWindow()
+ scrolled.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
+ scrolled.set_shadow_type(gtk.SHADOW_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)
+
+ # Runtime Depends
+ scrolled = gtk.ScrolledWindow()
+ scrolled.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
+ scrolled.set_shadow_type(gtk.SHADOW_IN)
+ self.rdep_treeview = PackageDepView(self.depends_model, TYPE_RDEP, "Runtime Depends")
+ self.rdep_treeview.connect("row-activated", self.on_package_activated, COL_DEP_PACKAGE)
+ scrolled.add(self.rdep_treeview)
+ box.add(scrolled)
+
+ # Build Depends
+ scrolled = gtk.ScrolledWindow()
+ scrolled.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
+ scrolled.set_shadow_type(gtk.SHADOW_IN)
+ self.dep_treeview = PackageDepView(self.depends_model, TYPE_DEP, "Build Depends")
+ 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 Depends
+ scrolled = gtk.ScrolledWindow()
+ scrolled.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
+ scrolled.set_shadow_type(gtk.SHADOW_IN)
+ self.revdep_treeview = PackageReverseDepView(self.depends_model, "Reverse Depends")
+ 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.rdep_treeview.set_current_package(current_package)
+ self.dep_treeview.set_current_package(current_package)
+ self.revdep_treeview.set_current_package(current_package)
+
+
+ def parse(self, depgraph):
+ for package in depgraph["pn"]:
+ self.pkg_model.insert(0, (package,))
+
+ for package in depgraph["depends"]:
+ for depend in depgraph["depends"][package]:
+ self.depends_model.insert (0, (TYPE_DEP, package, depend))
+
+ for package in depgraph["rdepends-pn"]:
+ for rdepend in depgraph["rdepends-pn"][package]:
+ self.depends_model.insert (0, (TYPE_RDEP, package, rdepend))
+
+
+class gtkthread(threading.Thread):
+ quit = threading.Event()
+ def __init__(self, shutdown):
+ threading.Thread.__init__(self)
+ self.setDaemon(True)
+ self.shutdown = shutdown
+
+ def run(self):
+ gobject.threads_init()
+ gtk.gdk.threads_init()
+ gtk.main()
+ gtkthread.quit.set()
+
+
+def main(server, eventHandler, params):
+ 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 xmlrpclib.Fault as x:
+ print("XMLRPC Fault getting commandline:\n %s" % x)
+ return
+
+ try:
+ gtk.init_check()
+ except RuntimeError:
+ sys.stderr.write("Please set DISPLAY variable before running this command \n")
+ return
+
+ shutdown = 0
+
+ gtkgui = gtkthread(shutdown)
+ gtkgui.start()
+
+ gtk.gdk.threads_enter()
+ dep = DepExplorer()
+ bardialog = gtk.Dialog(parent=dep,
+ flags=gtk.DIALOG_MODAL|gtk.DIALOG_DESTROY_WITH_PARENT)
+ bardialog.set_default_size(400, 50)
+ pbar = HobProgressBar()
+ bardialog.vbox.pack_start(pbar)
+ bardialog.show_all()
+ bardialog.connect("delete-event", gtk.main_quit)
+ gtk.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
+ gtk.gdk.threads_enter()
+ bardialog.set_title("Loading Cache")
+ pbar.update(0)
+ gtk.gdk.threads_leave()
+
+ if isinstance(event, bb.event.CacheLoadProgress):
+ x = event.current
+ gtk.gdk.threads_enter()
+ pbar.update(x * 1.0 / progress_total)
+ pbar.set_title('')
+ gtk.gdk.threads_leave()
+ continue
+
+ if isinstance(event, bb.event.CacheLoadCompleted):
+ bardialog.hide()
+ continue
+
+ if isinstance(event, bb.event.ParseStarted):
+ progress_total = event.total
+ if progress_total == 0:
+ continue
+ gtk.gdk.threads_enter()
+ pbar.update(0)
+ bardialog.set_title("Processing recipes")
+
+ gtk.gdk.threads_leave()
+
+ if isinstance(event, bb.event.ParseProgress):
+ x = event.current
+ gtk.gdk.threads_enter()
+ pbar.update(x * 1.0 / progress_total)
+ pbar.set_title('')
+ gtk.gdk.threads_leave()
+ continue
+
+ if isinstance(event, bb.event.ParseCompleted):
+ bardialog.hide()
+ continue
+
+ if isinstance(event, bb.event.DepTreeGenerated):
+ gtk.gdk.threads_enter()
+ dep.parse(event._depgraph)
+ gtk.gdk.threads_leave()
+
+ if isinstance(event, bb.command.CommandCompleted):
+ continue
+
+ if isinstance(event, bb.command.CommandFailed):
+ print("Command execution failed: %s" % event.error)
+ 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/import-layers/yocto-poky/bitbake/lib/bb/ui/goggle.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/goggle.py
new file mode 100644
index 000000000..f4ee7b41a
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/goggle.py
@@ -0,0 +1,121 @@
+#
+# BitBake Graphical GTK User Interface
+#
+# Copyright (C) 2008 Intel Corporation
+#
+# Authored by Rob Bradford <rob@linux.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 gobject
+import gtk
+import xmlrpclib
+from bb.ui.crumbs.runningbuild import RunningBuildTreeView, RunningBuild
+from bb.ui.crumbs.progress import ProgressBar
+
+import Queue
+
+
+def event_handle_idle_func (eventHandler, build, pbar):
+
+ # Consume as many messages as we can in the time available to us
+ event = eventHandler.getEvent()
+ while event:
+ build.handle_event (event, pbar)
+ event = eventHandler.getEvent()
+
+ return True
+
+def scroll_tv_cb (model, path, iter, view):
+ view.scroll_to_cell (path)
+
+
+# @todo hook these into the GUI so the user has feedback...
+def running_build_failed_cb (running_build):
+ pass
+
+
+def running_build_succeeded_cb (running_build):
+ pass
+
+
+class MainWindow (gtk.Window):
+ def __init__ (self):
+ gtk.Window.__init__ (self, gtk.WINDOW_TOPLEVEL)
+
+ # Setup tree view and the scrolled window
+ scrolled_window = gtk.ScrolledWindow ()
+ self.add (scrolled_window)
+ self.cur_build_tv = RunningBuildTreeView()
+ self.connect("delete-event", gtk.main_quit)
+ self.set_default_size(640, 480)
+ scrolled_window.add (self.cur_build_tv)
+
+
+def main (server, eventHandler, params):
+ gobject.threads_init()
+ gtk.gdk.threads_init()
+
+ window = MainWindow ()
+ window.show_all ()
+ pbar = ProgressBar(window)
+ pbar.connect("delete-event", gtk.main_quit)
+
+ # Create the object for the current build
+ running_build = RunningBuild ()
+ window.cur_build_tv.set_model (running_build.model)
+ running_build.model.connect("row-inserted", scroll_tv_cb, window.cur_build_tv)
+ running_build.connect ("build-succeeded", running_build_succeeded_cb)
+ running_build.connect ("build-failed", running_build_failed_cb)
+
+ 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 1
+ elif ret != True:
+ print("Error running command '%s': returned %s" % (cmdline, ret))
+ return 1
+ except xmlrpclib.Fault as x:
+ print("XMLRPC Fault getting commandline:\n %s" % x)
+ return 1
+
+ # Use a timeout function for probing the event queue to find out if we
+ # have a message waiting for us.
+ gobject.timeout_add (100,
+ event_handle_idle_func,
+ eventHandler,
+ running_build,
+ pbar)
+
+ try:
+ gtk.main()
+ except EnvironmentError as ioerror:
+ # ignore interrupted io
+ if ioerror.args[0] == 4:
+ pass
+ except KeyboardInterrupt:
+ pass
+ finally:
+ server.runCommand(["stateForceShutdown"])
+
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/images/images_display.png b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/images/images_display.png
new file mode 100644
index 000000000..a7f87101a
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/images/images_display.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/images/images_hover.png b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/images/images_hover.png
new file mode 100644
index 000000000..2d9cd99b8
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/images/images_hover.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/add-hover.png b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/add-hover.png
new file mode 100644
index 000000000..526df770d
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/add-hover.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/add.png b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/add.png
new file mode 100644
index 000000000..31e7090d6
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/add.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/alert.png b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/alert.png
new file mode 100644
index 000000000..d1c6f55a2
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/alert.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/confirmation.png b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/confirmation.png
new file mode 100644
index 000000000..3a5402d1e
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/confirmation.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/denied.png b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/denied.png
new file mode 100644
index 000000000..ee35c7def
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/denied.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/error.png b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/error.png
new file mode 100644
index 000000000..d06a8c151
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/error.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/info.png b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/info.png
new file mode 100644
index 000000000..ee8e8d846
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/info.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/issues.png b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/issues.png
new file mode 100644
index 000000000..b0c746133
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/issues.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/refresh.png b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/refresh.png
new file mode 100644
index 000000000..eb6c419db
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/refresh.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/remove-hover.png b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/remove-hover.png
new file mode 100644
index 000000000..aa57c6998
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/remove-hover.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/remove.png b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/remove.png
new file mode 100644
index 000000000..05c3c293d
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/remove.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/tick.png b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/tick.png
new file mode 100644
index 000000000..beaad361c
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/indicators/tick.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/info/info_display.png b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/info/info_display.png
new file mode 100644
index 000000000..5afbba29f
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/info/info_display.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/info/info_hover.png b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/info/info_hover.png
new file mode 100644
index 000000000..f9d294dfa
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/info/info_hover.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/layers/layers_display.png b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/layers/layers_display.png
new file mode 100644
index 000000000..b7f9053a9
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/layers/layers_display.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/layers/layers_hover.png b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/layers/layers_hover.png
new file mode 100644
index 000000000..0bf3ce0db
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/layers/layers_hover.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/packages/packages_display.png b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/packages/packages_display.png
new file mode 100644
index 000000000..f5d0a5064
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/packages/packages_display.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/packages/packages_hover.png b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/packages/packages_hover.png
new file mode 100644
index 000000000..c081165f3
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/packages/packages_hover.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/recipe/recipe_display.png b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/recipe/recipe_display.png
new file mode 100644
index 000000000..e9809bc7d
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/recipe/recipe_display.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/recipe/recipe_hover.png b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/recipe/recipe_hover.png
new file mode 100644
index 000000000..7e48da9af
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/recipe/recipe_hover.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/settings/settings_display.png b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/settings/settings_display.png
new file mode 100644
index 000000000..88c464db0
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/settings/settings_display.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/settings/settings_hover.png b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/settings/settings_hover.png
new file mode 100644
index 000000000..d92a0bf2c
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/settings/settings_hover.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/templates/templates_display.png b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/templates/templates_display.png
new file mode 100644
index 000000000..153c7afb6
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/templates/templates_display.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/templates/templates_hover.png b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/templates/templates_hover.png
new file mode 100644
index 000000000..afb7165fe
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/icons/templates/templates_hover.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/knotty.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/knotty.py
new file mode 100644
index 000000000..268562770
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/knotty.py
@@ -0,0 +1,594 @@
+#
+# 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 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):
+ self.msg = msg
+ widgets = [progressbar.Percentage(), ' ', progressbar.Bar(), ' ',
+ progressbar.ETA()]
+
+ try:
+ self._resize_default = signal.getsignal(signal.SIGWINCH)
+ except:
+ self._resize_default = None
+ progressbar.ProgressBar.__init__(self, maxval, [self.msg + ": "] + widgets, fd=sys.stdout)
+
+ def _handle_resize(self, signum, frame):
+ 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)
+
+class NonInteractiveProgress(object):
+ fobj = sys.stdout
+
+ def __init__(self, msg, maxval):
+ self.msg = msg
+ self.maxval = maxval
+
+ def start(self):
+ self.fobj.write("%s..." % self.msg)
+ self.fobj.flush()
+ return self
+
+ def update(self, value):
+ pass
+
+ def finish(self):
+ self.fobj.write("done.\n")
+ self.fobj.flush()
+
+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):
+ self.main = main
+ self.helper = helper
+ self.cuu = None
+ self.stdinbackup = None
+ self.interactive = sys.stdout.isatty()
+ self.footer_present = False
+ self.lastpids = []
+
+ 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
+ console.addFilter(InteractConsoleLogFilter(self, format))
+ errconsole.addFilter(InteractConsoleLogFilter(self, format))
+
+ def clearFooter(self):
+ if self.footer_present:
+ lines = self.footer_present
+ sys.stdout.write(self.curses.tparm(self.cuu, lines))
+ sys.stdout.write(self.curses.tparm(self.ed))
+ 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
+ if self.footer_present and (self.lastcount == self.helper.tasknumber_current) and (self.lastpids == runningpids):
+ return
+ 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:
+ tasks.append("%s (pid %s)" % (activetasks[t]["title"], t))
+
+ if self.main.shutdown:
+ content = "Waiting for %s running tasks to finish:" % len(activetasks)
+ elif not len(activetasks):
+ content = "No currently running tasks (%s of %s)" % (self.helper.tasknumber_current, self.helper.tasknumber_total)
+ else:
+ content = "Currently %s running tasks (%s of %s):" % (len(activetasks), self.helper.tasknumber_current, self.helper.tasknumber_total)
+ print(content)
+ lines = 1 + int(len(content) / (self.columns + 1))
+ for tasknum, task in enumerate(tasks[:(self.rows - 2)]):
+ 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 _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(["getSetVariable", "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"]
+
+def main(server, eventHandler, params, tf = TerminalFilter):
+
+ includelogs, loglines, consolelogfile = _log_settings_from_server(server)
+
+ 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)
+ bb.msg.addDefaultlogFilter(console, bb.msg.BBLogFilterStdOut)
+ bb.msg.addDefaultlogFilter(errconsole, bb.msg.BBLogFilterStdErr)
+ console.setFormatter(format)
+ errconsole.setFormatter(format)
+ 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
+
+ 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)
+
+ 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)
+ 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
+ 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)
+ 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.warn(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:
+ 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.warn("Logfile for failed setscene task is %s" % event.logfile)
+ continue
+ if isinstance(event, bb.build.TaskFailed):
+ return_value = 1
+ 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)
+ if isinstance(event, bb.build.TaskBase):
+ logger.info(event._message)
+ continue
+ if isinstance(event, bb.event.ParseStarted):
+ if event.total == 0:
+ continue
+ parseprogress = new_progress("Parsing recipes", event.total).start()
+ continue
+ if isinstance(event, bb.event.ParseProgress):
+ parseprogress.update(event.current)
+ continue
+ if isinstance(event, bb.event.ParseCompleted):
+ if not parseprogress:
+ continue
+
+ parseprogress.finish()
+ 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):
+ cacheprogress = new_progress("Loading cache", event.total).start()
+ continue
+ if isinstance(event, bb.event.CacheLoadProgress):
+ cacheprogress.update(event.current)
+ continue
+ if isinstance(event, bb.event.CacheLoadCompleted):
+ cacheprogress.finish()
+ 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("Command execution failed: %s", event.error)
+ 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("multiple providers are available for %s%s (%s)", event._is_runtime and "runtime " or "",
+ event._item,
+ ", ".join(event._candidates))
+ rtime = ""
+ if event._is_runtime:
+ rtime = "R"
+ logger.info("consider defining a PREFERRED_%sPROVIDER entry to match %s" % (rtime, event._item))
+ continue
+ if isinstance(event, bb.event.NoProvider):
+ if event._runtime:
+ r = "R"
+ else:
+ r = ""
+
+ extra = ''
+ if not event._reasons:
+ if event._close_matches:
+ extra = ". Close matches:\n %s" % '\n '.join(event._close_matches)
+
+ # For universe builds, only show these as warnings, not errors
+ h = logger.warning
+ if not universe:
+ return_value = 1
+ errors = errors + 1
+ h = logger.error
+
+ if event._dependees:
+ h("Nothing %sPROVIDES '%s' (but %s %sDEPENDS on or otherwise requires it)%s", r, event._item, ", ".join(event._dependees), r, extra)
+ else:
+ h("Nothing %sPROVIDES '%s'%s", r, event._item, extra)
+ if event._reasons:
+ for reason in event._reasons:
+ h("%s", reason)
+ 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 %s of %s (ID: %s, %s)",
+ tasktype,
+ event.stats.completed + event.stats.active +
+ event.stats.failed + 1,
+ event.stats.total, event.taskid, event.taskstring)
+ continue
+
+ if isinstance(event, bb.runqueue.runQueueTaskFailed):
+ return_value = 1
+ taskfailures.append(event.taskstring)
+ logger.error("Task %s (%s) failed with exit code '%s'",
+ event.taskid, event.taskstring, event.exitcode)
+ continue
+
+ if isinstance(event, bb.runqueue.sceneQueueTaskFailed):
+ logger.warn("Setscene task %s (%s) failed with exit code '%s' - real task will be run instead",
+ event.taskid, event.taskstring, event.exitcode)
+ continue
+
+ if isinstance(event, bb.event.DepTreeGenerated):
+ continue
+
+ # ignore
+ if isinstance(event, (bb.event.BuildBase,
+ bb.event.MetadataEvent,
+ bb.event.StampUpdate,
+ bb.event.ConfigParsed,
+ bb.event.RecipeParsed,
+ bb.event.RecipePreFinalise,
+ bb.runqueue.runQueueEvent,
+ bb.event.OperationStarted,
+ bb.event.OperationCompleted,
+ bb.event.OperationProgress,
+ bb.event.DiskFull)):
+ 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:
+ 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:
+ 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
+
+ return return_value
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/ncurses.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/ncurses.py
new file mode 100644
index 000000000..9589a77d7
--- /dev/null
+++ b/import-layers/yocto-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 |
+ |>>> _ |
+ |---------------------------------------------------------|
+
+"""
+
+
+from __future__ import division
+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 xmlrpclib
+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 xmlrpclib.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.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("Command execution failed: %s" % event.error)
+ 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.itervalues():
+ 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/import-layers/yocto-poky/bitbake/lib/bb/ui/toasterui.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/toasterui.py
new file mode 100644
index 000000000..6bf4c1f03
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/toasterui.py
@@ -0,0 +1,465 @@
+#
+# 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.SEND_DEPENDS_TREE, 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.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.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.warn("buildhistory is not enabled. Please enable INHERIT += \"buildhistory\" to see image details.")
+ build_history_enabled = False
+
+ 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
+
+ # we treat ParseStarted as the first event of toaster-triggered
+ # builds; that way we get the Build Configuration included in the log
+ # and any errors that occur before BuildStarted is fired
+ 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)
+ continue
+
+ if isinstance(event, bb.event.BuildStarted):
+ if not (build_log and build_log_file_path):
+ build_log, build_log_file_path = _open_build_log(log_dir)
+
+ buildinfohelper.store_started_build(event, build_log_file_path)
+ 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.ParseProgress):
+ continue
+ if isinstance(event, bb.event.ParseCompleted):
+ 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("multiple providers are available for %s%s (%s)", event._is_runtime and "runtime " or "",
+ event._item,
+ ", ".join(event._candidates))
+ logger.info("consider defining a PREFERRED_PROVIDER entry to match %s", event._item)
+ continue
+
+ if isinstance(event, bb.event.NoProvider):
+ errors = errors + 1
+ if event._runtime:
+ r = "R"
+ else:
+ r = ""
+
+ if event._dependees:
+ text = "Nothing %sPROVIDES '%s' (but %s %sDEPENDS on or otherwise requires it)" % (r, event._item, ", ".join(event._dependees), r)
+ else:
+ text = "Nothing %sPROVIDES '%s'" % (r, event._item)
+
+ logger.error(text)
+ if event._reasons:
+ for reason in event._reasons:
+ logger.error("%s", reason)
+ text += reason
+ 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("Task %s (%s) failed with exit code '%s'",
+ event.taskid, event.taskstring, event.exitcode)
+ 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("Command execution failed: %s", event.error)
+
+ # 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 == "ImageFileSize":
+ buildinfohelper.update_target_image_file(event)
+ elif event.type == "ArtifactFileSize":
+ buildinfohelper.update_artifact_image_file(event)
+ elif event.type == "LicenseManifestPath":
+ buildinfohelper.store_license_manifest_path(event)
+ elif event.type == "SetBRBE":
+ buildinfohelper.brbe = buildinfohelper._get_data_from_event(event)
+ elif event.type == "OSErrorException":
+ logger.error(event)
+ else:
+ logger.error("Unprocessed MetadataEvent %s ", str(event))
+ 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.warn("Unknown event: %s", event)
+ return_value += 1
+
+ except EnvironmentError as ioerror:
+ # ignore interrupted io
+ if ioerror.args[0] == 4:
+ pass
+ except KeyboardInterrupt:
+ 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.warn("Return value is %d", return_value)
+ return return_value
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/ui/uievent.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/uievent.py
new file mode 100644
index 000000000..df093c53c
--- /dev/null
+++ b/import-layers/yocto-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 SimpleXMLRPCServer 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(e)))
+
+ 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)
+
+ 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/import-layers/yocto-poky/bitbake/lib/bb/ui/uihelper.py b/import-layers/yocto-poky/bitbake/lib/bb/ui/uihelper.py
new file mode 100644
index 000000000..db70b763f
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/ui/uihelper.py
@@ -0,0 +1,59 @@
+# 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
+
+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):
+ self.running_tasks[event.pid] = { 'title' : "%s %s" % (event._package, event._task) }
+ self.running_pids.append(event.pid)
+ self.needUpdate = True
+ if isinstance(event, bb.build.TaskSucceeded):
+ del self.running_tasks[event.pid]
+ self.running_pids.remove(event.pid)
+ self.needUpdate = True
+ if 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
+ if 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
+ if 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
+
+ def getTasks(self):
+ self.needUpdate = False
+ return (self.running_tasks, self.failed_tasks)
+
diff --git a/import-layers/yocto-poky/bitbake/lib/bb/utils.py b/import-layers/yocto-poky/bitbake/lib/bb/utils.py
new file mode 100644
index 000000000..3544bbe17
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bb/utils.py
@@ -0,0 +1,1453 @@
+# 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 subprocess
+import glob
+import fnmatch
+import traceback
+import errno
+import signal
+import ast
+from commands import getstatusoutput
+from contextlib import contextmanager
+from ctypes import cdll
+
+
+logger = logging.getLogger("BitBake.Util")
+
+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.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):
+ """
+ Take an RDEPENDS style string of format:
+ "DEPEND1 (optional version) DEPEND2 (optional version) ..."
+ and return a dictionary of dependencies and versions.
+ """
+ r = {}
+ 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] = []
+
+ 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))
+ 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):
+ return eval(source, get_context(), 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.
+ """
+ try:
+ import hashlib
+ m = hashlib.md5()
+ except ImportError:
+ import md5
+ m = md5.new()
+
+ 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. On Python 2.4 this will return None, so callers will need to
+ handle that by either skipping SHA checks, or running a standalone sha256sum
+ binary.
+ """
+ try:
+ import hashlib
+ except ImportError:
+ return None
+
+ 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
+ """
+ try:
+ import hashlib
+ except ImportError:
+ return None
+
+ 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',
+ ]
+
+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 os.environ.keys():
+ if key in good_vars:
+ continue
+
+ removed_vars[key] = os.environ[key]
+ os.unsetenv(key)
+ del os.environ[key]
+
+ 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 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, True) 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.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
+ if sstat[stat.ST_DEV] == dstat[stat.ST_DEV]:
+ try:
+ # 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
+ 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, dest + "#new")
+ os.rename(dest + "#new", dest)
+ 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(dest, sstat[stat.ST_UID], sstat[stat.ST_GID])
+ os.chmod(dest, 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(dest, (newmtime, newmtime))
+ else:
+ os.utime(dest, (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.warn("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.warn("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.warn("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.warn("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.warn("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):
+ """
+ Locate a file in a PATH
+ """
+
+ hist = []
+ paths = (path or "").split(':')
+ if direction != 0:
+ paths.reverse()
+
+ for p in paths:
+ next = os.path.join(p, item)
+ hist.append(next)
+ if os.path.exists(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, True)) 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, True)
+ if not val:
+ return falsevalue
+ val = set(val.split())
+ if isinstance(checkvalues, basestring):
+ 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, True)
+ if not val:
+ return falsevalue
+ val = set(val.split())
+ if isinstance(checkvalues, basestring):
+ checkvalues = set(checkvalues.split())
+ else:
+ checkvalues = set(checkvalues)
+ if checkvalues & val:
+ return truevalue
+ return falsevalue
+
+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.iterkeys()])
+ 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 three-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.
+ 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, long)):
+ 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.iteritems():
+ 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', True) or '').split()
+ collection_res = {}
+ for collection in collections:
+ collection_res[collection] = d.getVar('BBFILE_PATTERN_%s' % collection, True) or ''
+
+ def path_to_layer(path):
+ # Use longest path so we handle nested layers
+ matchlen = 0
+ match = None
+ for collection, regex in collection_res.iteritems():
+ if len(regex) > matchlen and re.match(regex, path):
+ matchlen = len(regex)
+ match = collection
+ return match
+
+ result = None
+ bbfiles = (d.getVar('BBFILES', True) 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')
+ buff = create_string_buffer(len(name)+1)
+ buff.value = name
+ libc.prctl(15, byref(buff), 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']
+ exported = False
+
+ for v in variables:
+ if v in os.environ.keys():
+ exported = True
+ else:
+ v_proxy = d.getVar(v, True)
+ if v_proxy is not None:
+ os.environ[v] = v_proxy
+ exported = True
+
+ return exported
diff --git a/import-layers/yocto-poky/bitbake/lib/bs4/AUTHORS.txt b/import-layers/yocto-poky/bitbake/lib/bs4/AUTHORS.txt
new file mode 100644
index 000000000..2ac8fcc8c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/bs4/COPYING.txt b/import-layers/yocto-poky/bitbake/lib/bs4/COPYING.txt
new file mode 100644
index 000000000..d668d13f0
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/bs4/NEWS.txt b/import-layers/yocto-poky/bitbake/lib/bs4/NEWS.txt
new file mode 100644
index 000000000..88a60a245
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/bs4/__init__.py b/import-layers/yocto-poky/bitbake/lib/bs4/__init__.py
new file mode 100644
index 000000000..7ba34269a
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bs4/__init__.py
@@ -0,0 +1,406 @@
+"""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.3.2"
+__copyright__ = "Copyright (c) 2004-2013 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.
+syntax_error = u'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 = u'[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'
+
+ def __init__(self, markup="", features=None, builder=None,
+ parse_only=None, from_encoding=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. You can pass in features='html' "
+ "or features='xml' to get a builder capable of handling "
+ "one or the other.")
+
+ 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 = kwargs.keys().pop()
+ raise TypeError(
+ "__init__() got an unexpected keyword argument '%s'" % arg)
+
+ if builder is None:
+ if isinstance(features, basestring):
+ 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()
+ 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, unicode)
+ 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, e:
+ # This is almost certainly a problem involving
+ # characters not valid in filenames on this
+ # system. Just let it go.
+ pass
+ if is_file:
+ 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, unicode) and not u' ' in markup)):
+ 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)):
+ 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 _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."""
+ navigable = subclass(s)
+ navigable.setup()
+ return navigable
+
+ 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 = u''.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
+ most_recent_element = most_recent_element or self._most_recent_element
+ o.setup(parent, most_recent_element)
+
+ if most_recent_element is not None:
+ most_recent_element.next_element = o
+ self._most_recent_element = o
+ parent.contents.append(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 = u'<?xml version="1.0"%s?>\n' % encoding_part
+ else:
+ prefix = u''
+ 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/import-layers/yocto-poky/bitbake/lib/bs4/builder/__init__.py b/import-layers/yocto-poky/bitbake/lib/bs4/builder/__init__.py
new file mode 100644
index 000000000..740f5f29c
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bs4/builder/__init__.py
@@ -0,0 +1,321 @@
+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."""
+
+ features = []
+
+ is_xml = 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 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, basestring):
+ 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/import-layers/yocto-poky/bitbake/lib/bs4/builder/_html5lib.py b/import-layers/yocto-poky/bitbake/lib/bs4/builder/_html5lib.py
new file mode 100644
index 000000000..7de36ae75
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bs4/builder/_html5lib.py
@@ -0,0 +1,285 @@
+__all__ = [
+ 'HTML5TreeBuilder',
+ ]
+
+import warnings
+from bs4.builder import (
+ PERMISSIVE,
+ HTML,
+ HTML_5,
+ HTMLTreeBuilder,
+ )
+from bs4.element import NamespacedAttribute
+import html5lib
+from html5lib.constants import namespaces
+from bs4.element import (
+ Comment,
+ Doctype,
+ NavigableString,
+ Tag,
+ )
+
+class HTML5TreeBuilder(HTMLTreeBuilder):
+ """Use html5lib to build a tree."""
+
+ features = ['html5lib', PERMISSIVE, HTML_5, HTML]
+
+ def prepare_markup(self, markup, user_specified_encoding):
+ # Store the user-specified encoding for use later on.
+ self.user_specified_encoding = user_specified_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, unicode):
+ # 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 u'<html><head></head><body>%s</body></html>' % fragment
+
+
+class TreeBuilderForHtml5lib(html5lib.treebuilders._base.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 html5lib.treebuilders._base.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):
+ "set attr", name, 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(html5lib.treebuilders._base.Node):
+ def __init__(self, element, soup, namespace):
+ html5lib.treebuilders._base.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, basestring):
+ # 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, basestring) 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, basestring):
+ # 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)
+ 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 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."""
+ 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]
+ first_child.previous_element = new_parents_last_descendant
+ first_child.previous_sibling = new_parents_last_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
+ 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
+
+ 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):
+ html5lib.treebuilders._base.Node.__init__(self, None)
+ self.element = element
+ self.soup = soup
+
+ def cloneNode(self):
+ raise NotImplementedError
diff --git a/import-layers/yocto-poky/bitbake/lib/bs4/builder/_htmlparser.py b/import-layers/yocto-poky/bitbake/lib/bs4/builder/_htmlparser.py
new file mode 100644
index 000000000..ca8d8b892
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bs4/builder/_htmlparser.py
@@ -0,0 +1,258 @@
+"""Use the HTMLParser library to parse HTML files that aren't too bad."""
+
+__all__ = [
+ 'HTMLParserTreeBuilder',
+ ]
+
+from HTMLParser import (
+ HTMLParser,
+ HTMLParseError,
+ )
+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
+ or (major == 3 and minor > 2)
+ or (major == 3 and minor == 2 and release >= 3))
+
+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.
+ 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 = unichr(real_name)
+ except (ValueError, OverflowError), e:
+ data = u"\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()
+ if data.endswith("?") and data.lower().startswith("xml"):
+ # "An XHTML processing instruction using the trailing '?'
+ # will cause the '?' to be included in data." - HTMLParser
+ # docs.
+ #
+ # Strip the question mark so we don't end up with two
+ # question marks.
+ data = data[:-1]
+ self.soup.handle_data(data)
+ self.soup.endData(ProcessingInstruction)
+
+
+class HTMLParserTreeBuilder(HTMLTreeBuilder):
+
+ is_xml = False
+ features = [HTML, STRICT, HTMLPARSER]
+
+ def __init__(self, *args, **kwargs):
+ if CONSTRUCTOR_TAKES_STRICT:
+ kwargs['strict'] = False
+ self.parser_args = (args, kwargs)
+
+ def prepare_markup(self, markup, user_specified_encoding=None,
+ document_declared_encoding=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, unicode):
+ yield (markup, None, None, False)
+ return
+
+ try_encodings = [user_specified_encoding, document_declared_encoding]
+ dammit = UnicodeDammit(markup, try_encodings, is_html=True)
+ 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, 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/import-layers/yocto-poky/bitbake/lib/bs4/builder/_lxml.py b/import-layers/yocto-poky/bitbake/lib/bs4/builder/_lxml.py
new file mode 100644
index 000000000..fa5d49875
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bs4/builder/_lxml.py
@@ -0,0 +1,233 @@
+__all__ = [
+ 'LXMLTreeBuilderForXML',
+ 'LXMLTreeBuilder',
+ ]
+
+from io import BytesIO
+from StringIO import StringIO
+import collections
+from lxml import etree
+from bs4.element import Comment, Doctype, NamespacedAttribute
+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
+
+ # Well, it's permissive by XML parser standards.
+ features = [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,
+ 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, unicode):
+ # We were given Unicode. Maybe lxml can parse Unicode on
+ # this system?
+ yield markup, None, document_declared_encoding, False
+
+ if isinstance(markup, unicode):
+ # 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)
+ 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, unicode):
+ 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), 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 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 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 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):
+ pass
+
+ 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 u'<?xml version="1.0" encoding="utf-8"?>\n%s' % fragment
+
+
+class LXMLTreeBuilder(HTMLTreeBuilder, LXMLTreeBuilderForXML):
+
+ features = [LXML, 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), e:
+ raise ParserRejectedMarkup(str(e))
+
+
+ def test_fragment_to_document(self, fragment):
+ """See `TreeBuilder`."""
+ return u'<html><body>%s</body></html>' % fragment
diff --git a/import-layers/yocto-poky/bitbake/lib/bs4/dammit.py b/import-layers/yocto-poky/bitbake/lib/bs4/dammit.py
new file mode 100644
index 000000000..59640b7ce
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bs4/dammit.py
@@ -0,0 +1,829 @@
+# -*- 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 XML, but it does not rewrite the
+XML or HTML to reflect a new encoding; that's the tree builder's job.
+"""
+
+import codecs
+from htmlentitydefs 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 = unichr(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):
+ self.override_encodings = override_encodings or []
+ 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 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 (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')
+ 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):
+ 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)
+
+ # Short-circuit if the data is in Unicode to begin with.
+ if isinstance(markup, unicode) or markup == '':
+ self.markup = markup
+ self.unicode_markup = unicode(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 unicode(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/import-layers/yocto-poky/bitbake/lib/bs4/diagnose.py b/import-layers/yocto-poky/bitbake/lib/bs4/diagnose.py
new file mode 100644
index 000000000..4d0b00afa
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bs4/diagnose.py
@@ -0,0 +1,204 @@
+"""Diagnostic functions, mainly for use when doing tech support."""
+import cProfile
+from StringIO import StringIO
+from HTMLParser 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"])
+ from lxml import etree
+ print "Found lxml version %s" % ".".join(map(str,etree.LXML_VERSION))
+
+ if 'html5lib' in basic_parsers:
+ import html5lib
+ print "Found html5lib version %s" % html5lib.__version__
+
+ 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, 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, 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/import-layers/yocto-poky/bitbake/lib/bs4/element.py b/import-layers/yocto-poky/bitbake/lib/bs4/element.py
new file mode 100644
index 000000000..da9afdf48
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bs4/element.py
@@ -0,0 +1,1611 @@
+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(unicode):
+
+ def __new__(cls, prefix, name, namespace=None):
+ if name is None:
+ obj = unicode.__new__(cls, prefix)
+ elif prefix is None:
+ # Not really namespaced.
+ obj = unicode.__new__(cls, name)
+ else:
+ obj = unicode.__new__(cls, prefix + ":" + name)
+ obj.prefix = prefix
+ obj.name = name
+ obj.namespace = namespace
+ return obj
+
+class AttributeValueWithCharsetSubstitution(unicode):
+ """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 = unicode.__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 unicode.__new__(unicode, original_value)
+
+ obj = unicode.__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 callable(formatter):
+ 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):
+ """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 = None
+ self.previous_sibling = None
+ self.next_sibling = None
+ if self.parent is not None and self.parent.contents:
+ self.previous_sibling = self.parent.contents[-1]
+ self.previous_sibling.next_sibling = self
+
+ nextSibling = _alias("next_sibling") # BS3
+ previousSibling = _alias("previous_sibling") # BS3
+
+ def replace_with(self, replace_with):
+ 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
+ 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:
+ self.previous_element.next_element = next_element
+ if next_element is not None:
+ 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:
+ self.previous_sibling.next_sibling = self.next_sibling
+ if self.next_sibling is not None:
+ 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 == 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 self:
+ raise ValueError("Cannot insert a tag into itself.")
+ if (isinstance(new_child, basestring)
+ 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 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, basestring):
+ # 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-z0-9]+$')
+
+ # /^(\w+)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/
+ # \---/ \---/\-------------/ \-------/
+ # | | | |
+ # | | | The value
+ # | | ~,|,^,$,* or =
+ # | Attribute
+ # Tag
+ attribselect_re = re.compile(
+ r'^(?P<tag>\w+)?\[(?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(unicode, 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, unicode):
+ return unicode.__new__(cls, value)
+ return unicode.__new__(cls, value, DEFAULT_OUTPUT_ENCODING)
+
+ def __copy__(self):
+ return self
+
+ def __getnewargs__(self):
+ return (unicode(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 = u'<![CDATA['
+ SUFFIX = u']]>'
+
+class ProcessingInstruction(PreformattedString):
+
+ PREFIX = u'<?'
+ SUFFIX = u'?>'
+
+class Comment(PreformattedString):
+
+ PREFIX = u'<!--'
+ SUFFIX = u'-->'
+
+
+class Declaration(PreformattedString):
+ PREFIX = u'<!'
+ SUFFIX = u'!>'
+
+
+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 = u'<!DOCTYPE '
+ SUFFIX = u'>\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 and builder.cdata_list_attributes:
+ attrs = builder._replace_cdata_list_attribute_values(
+ self.name, 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
+
+ @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=u"", 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 __nonzero__(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=DEFAULT_OUTPUT_ENCODING):
+ """Renders this tag as a string."""
+ return self.encode(encoding)
+
+ def __unicode__(self):
+ return self.decode()
+
+ def __str__(self):
+ 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 callable(formatter):
+ 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, basestring):
+ val = unicode(val)
+ elif (
+ isinstance(val, AttributeValueWithCharsetSubstitution)
+ and eventual_encoding is not None):
+ val = val.encode(eventual_encoding)
+
+ text = self.format_string(val, formatter)
+ decoded = (
+ unicode(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 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 callable(formatter):
+ 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."""
+ 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(self, selector, _candidate_generator=None):
+ """Perform a CSS selection operation on the current element."""
+ 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):
+ if self._select_debug:
+ print ' Considering token "%s"' % token
+ recursive_candidate_generator = None
+ tag_name = None
+ 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
+ # 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 not None:
+ 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
+
+ new_context = []
+ new_context_ids = set([])
+ 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))
+ 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 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, unicode) or callable(value) 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, unicode)):
+ # 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 unicode(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, basestring)):
+ 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, basestring):
+ 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, unicode)
+ 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, unicode):
+ # 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/import-layers/yocto-poky/bitbake/lib/bs4/testing.py b/import-layers/yocto-poky/bitbake/lib/bs4/testing.py
new file mode 100644
index 000000000..fd4495ac5
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bs4/testing.py
@@ -0,0 +1,592 @@
+"""Helper classes for tests."""
+
+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))
+
+
+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 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_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_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_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 = u'<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 = u'<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 = u"\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)
+
+ 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 = u'<html><head><meta encoding="euc-jp"></head><body>Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!</body>'
+ soup = self.soup(markup)
+ self.assertEqual(u'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 = u"<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,
+ u"\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, u"\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 = u"<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 = u'<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_docstring_generated(self):
+ soup = self.soup("<root/>")
+ self.assertEqual(
+ soup.encode(), b'<?xml version="1.0" encoding="utf-8"?>\n<root/>')
+
+ 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, "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 = u'<?xml version="1.0" encoding="euc-jp"><root>Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!</root>'
+ soup = self.soup(markup)
+ self.assertEqual(u'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(
+ unicode(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(unicode(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(unicode(soup.foo), markup)
+
+ def test_namespaced_attributes_xml_namespace(self):
+ markup = '<foo xml:lang="fr">bar</foo>'
+ soup = self.soup(markup)
+ self.assertEqual(unicode(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/import-layers/yocto-poky/bitbake/lib/bs4/tests/__init__.py b/import-layers/yocto-poky/bitbake/lib/bs4/tests/__init__.py
new file mode 100644
index 000000000..142c8cc3f
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bs4/tests/__init__.py
@@ -0,0 +1 @@
+"The beautifulsoup tests."
diff --git a/import-layers/yocto-poky/bitbake/lib/bs4/tests/test_builder_registry.py b/import-layers/yocto-poky/bitbake/lib/bs4/tests/test_builder_registry.py
new file mode 100644
index 000000000..92ad10fb0
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bs4/tests/test_builder_registry.py
@@ -0,0 +1,141 @@
+"""Tests of the builder registry."""
+
+import unittest
+
+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):
+ # 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/import-layers/yocto-poky/bitbake/lib/bs4/tests/test_docs.py b/import-layers/yocto-poky/bitbake/lib/bs4/tests/test_docs.py
new file mode 100644
index 000000000..5b9f67709
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/bs4/tests/test_html5lib.py b/import-layers/yocto-poky/bitbake/lib/bs4/tests/test_html5lib.py
new file mode 100644
index 000000000..594c3e1f2
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bs4/tests/test_html5lib.py
@@ -0,0 +1,85 @@
+"""Tests to ensure that the html5lib tree builder generates good trees."""
+
+import warnings
+
+try:
+ from bs4.builder import HTML5TreeBuilder
+ HTML5LIB_PRESENT = True
+except ImportError, 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(u"<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(u"<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')))
diff --git a/import-layers/yocto-poky/bitbake/lib/bs4/tests/test_htmlparser.py b/import-layers/yocto-poky/bitbake/lib/bs4/tests/test_htmlparser.py
new file mode 100644
index 000000000..bcb5ed232
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bs4/tests/test_htmlparser.py
@@ -0,0 +1,19 @@
+"""Tests to ensure that the html.parser tree builder generates good
+trees."""
+
+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
diff --git a/import-layers/yocto-poky/bitbake/lib/bs4/tests/test_lxml.py b/import-layers/yocto-poky/bitbake/lib/bs4/tests/test_lxml.py
new file mode 100644
index 000000000..2b2e9b7e7
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bs4/tests/test_lxml.py
@@ -0,0 +1,91 @@
+"""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, 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(u"<b/>", unicode(soup.b))
+ self.assertTrue("BeautifulStoneSoup class is deprecated" in str(w[0].message))
+
+ def test_real_xhtml_document(self):
+ """lxml strips the XML definition from an XHTML doc, which is fine."""
+ 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'').replace(
+ b'<?xml version="1.0" encoding="utf-8"?>', b''))
+
+
+@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/import-layers/yocto-poky/bitbake/lib/bs4/tests/test_soup.py b/import-layers/yocto-poky/bitbake/lib/bs4/tests/test_soup.py
new file mode 100644
index 000000000..47ac245f9
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bs4/tests/test_soup.py
@@ -0,0 +1,434 @@
+# -*- coding: utf-8 -*-
+"""Tests of Beautiful Soup as a whole."""
+
+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,
+)
+from bs4.testing import (
+ SoupTest,
+ skipIf,
+)
+import warnings
+
+try:
+ from bs4.builder import LXMLTreeBuilder, LXMLTreeBuilderForXML
+ LXML_PRESENT = True
+except ImportError, 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 = u"<h1>Ă©Ă©</h1>"
+ soup = self.soup(data)
+ self.assertEqual(u"Ă©Ă©", soup.h1.string)
+
+ def test_embedded_null(self):
+ data = u"<h1>foo\0bar</h1>"
+ soup = self.soup(data)
+ self.assertEqual(u"foo\0bar", soup.h1.string)
+
+
+class TestDeprecatedConstructorArguments(SoupTest):
+
+ 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 = u"foo\u2200\N{SNOWMAN}\u00f5bar"
+ self.assertEqual(self.sub.substitute_html(s),
+ u"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 = u'<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, unicode))
+ 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, u'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, u'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 = u'<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 = u"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, u"<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"\xc3\xa9"
+ dammit = UnicodeDammit(utf8)
+ self.assertEqual(dammit.unicode_markup, u'\xe9')
+ self.assertEqual(dammit.original_encoding.lower(), 'utf-8')
+
+ 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, u'\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 = u"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 = u"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_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(u"\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(u"<a>áé</a>", dammit.unicode_markup)
+ self.assertEqual("utf-16le", dammit.original_encoding)
+
+ def test_detwingle(self):
+ # Here's a UTF8 document.
+ utf8 = (u"\N{SNOWMAN}" * 3).encode("utf8")
+
+ # Here's a Windows-1252 document.
+ windows_1252 = (
+ u"\N{LEFT DOUBLE QUOTATION MARK}Hi, I like Windows!"
+ u"\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(
+ u"âââ“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 (
+ u"\N{LATIN SMALL LIGATURE OE}", # 2-byte char '\xc5\x93'
+ u"\N{LATIN SUBSCRIPT SMALL LETTER X}", # 3-byte char '\xe2\x82\x93'
+ u"\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/import-layers/yocto-poky/bitbake/lib/bs4/tests/test_tree.py b/import-layers/yocto-poky/bitbake/lib/bs4/tests/test_tree.py
new file mode 100644
index 000000000..f8515c0ea
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/bs4/tests/test_tree.py
@@ -0,0 +1,1829 @@
+# -*- 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.
+"""
+
+import copy
+import pickle
+import re
+import warnings
+from bs4 import BeautifulSoup
+from bs4.builder import (
+ builder_registry,
+ HTMLParserTreeBuilder,
+)
+from bs4.element import (
+ CData,
+ Comment,
+ 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(u'<h1>Räksmörgås</h1>')
+ self.assertEqual(soup.find(text=u'Räksmörgås'), u'Räksmörgås')
+
+ 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(text="bar"), [u"bar"])
+ # Match any of a number of strings.
+ self.assertEqual(
+ soup.find_all(text=["Foo", "bar"]), [u"Foo", u"bar"])
+ # Match a regular expression.
+ self.assertEqual(soup.find_all(text=re.compile('.*')),
+ [u"Foo", u"bar", u'\xbb'])
+ # Match anything.
+ self.assertEqual(soup.find_all(text=True),
+ [u"Foo", u"bar", u'\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 = u"םולש".encode("utf8")
+ data = u'<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("", "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")
+ 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_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_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 = u"<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())
+
+
+class TestSubstitutions(SoupTest):
+
+ def test_default_formatter_is_minimal(self):
+ markup = u"<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(
+ u"<b>&lt;&lt;Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!&gt;&gt;</b>"))
+
+ def test_formatter_html(self):
+ markup = u"<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 = u"<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(
+ u"<b>&lt;&lt;Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!&gt;&gt;</b>"))
+
+ def test_formatter_null(self):
+ markup = u"<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(u"<b><<Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!>></b>"))
+
+ def test_formatter_custom(self):
+ markup = u"<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(u"<b><FOO></b><b>BAR</b>"))
+
+ def test_formatter_is_run_on_attribute_values(self):
+ markup = u'<a href="http://a.com?a=b&c=Ă©">e</a>'
+ soup = self.soup(markup)
+ a = soup.a
+
+ expect_minimal = u'<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 = u'<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 = u'<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).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).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(
+ u'<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>")
+ 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(unicode, 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 = u"<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 = u"<b>\N{SNOWMAN}</b>"
+ soup = self.soup(html)
+ self.assertEqual(soup.b.string.encode("utf-8"),
+ u"\N{SNOWMAN}".encode("utf-8"))
+
+ def test_tag_containing_unicode_string_can_be_encoded(self):
+ html = u"<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 = u"<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 = u"<b>\N{SNOWMAN}</b>"
+ soup = self.soup(html)
+ self.assertRaises(
+ UnicodeEncodeError, soup.encode, "ascii", errors="strict")
+
+ def test_decode_contents(self):
+ html = u"<b>\N{SNOWMAN}</b>"
+ soup = self.soup(html)
+ self.assertEqual(u"\N{SNOWMAN}", soup.b.decode_contents())
+
+ def test_encode_contents(self):
+ html = u"<b>\N{SNOWMAN}</b>"
+ soup = self.soup(html)
+ self.assertEqual(
+ u"\N{SNOWMAN}".encode("utf8"), soup.b.encode_contents(
+ encoding="utf8"))
+
+ def test_deprecated_renderContents(self):
+ html = u"<b>\N{SNOWMAN}</b>"
+ soup = self.soup(html)
+ self.assertEqual(
+ u"\N{SNOWMAN}".encode("utf8"), soup.b.renderContents())
+
+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")
+
+
+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>
+
+<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>
+</span>
+</div>
+<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)
+
+ 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, [u'The title'])
+
+ def test_one_tag_many(self):
+ els = self.soup.select('div')
+ self.assertEqual(len(els), 3)
+ for div in els:
+ self.assertEqual(div.name, 'div')
+
+ def test_tag_in_tag_one(self):
+ els = self.soup.select('div div')
+ self.assertSelects('div div', ['inner'])
+
+ def test_tag_in_tag_many(self):
+ for selector in ('html div', 'html body div', 'body div'):
+ self.assertSelects(selector, ['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_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']),
+ )
+
+ def test_attribute_endswith(self):
+ self.assertSelectMultiple(
+ ('[href$=".css"]', ['l1']),
+ ('link[href$=".css"]', ['l1']),
+ ('link[id$="1"]', ['l1']),
+ ('[id$="1"]', ['l1', 'p1', 'header1', 's1a1', 's2a1', 's1a2s1']),
+ ('div[id$="1"]', []),
+ ('[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']),
+ ('a[href*="http://"]', ['bob', 'me']),
+ ('[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"]', ['l1', 'p1', 'header1', 's1a1', 's1a2', 's2a1', 's1a2s1']),
+ ('div[id*="1"]', []),
+ ('[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']),
+ )
+
+ 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]', []),
+ )
+
+ 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, u'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, u'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, u'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'])
+
+ 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'])
diff --git a/import-layers/yocto-poky/bitbake/lib/codegen.py b/import-layers/yocto-poky/bitbake/lib/codegen.py
new file mode 100644
index 000000000..be772d510
--- /dev/null
+++ b/import-layers/yocto-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 node.starargs is not None:
+ paren_or_comma()
+ self.write('*')
+ self.visit(node.starargs)
+ if 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 node.starargs is not None:
+ write_comma()
+ self.write('*')
+ self.visit(node.starargs)
+ if 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/import-layers/yocto-poky/bitbake/lib/ply/__init__.py b/import-layers/yocto-poky/bitbake/lib/ply/__init__.py
new file mode 100644
index 000000000..853a98554
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/ply/__init__.py
@@ -0,0 +1,4 @@
+# PLY package
+# Author: David Beazley (dave@dabeaz.com)
+
+__all__ = ['lex','yacc']
diff --git a/import-layers/yocto-poky/bitbake/lib/ply/lex.py b/import-layers/yocto-poky/bitbake/lib/ply/lex.py
new file mode 100644
index 000000000..267ec100f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/ply/yacc.py b/import-layers/yocto-poky/bitbake/lib/ply/yacc.py
new file mode 100644
index 000000000..6168fd9a0
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/ply/yacc.py
@@ -0,0 +1,3276 @@
+# -----------------------------------------------------------------------------
+# 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 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/import-layers/yocto-poky/bitbake/lib/progressbar.py b/import-layers/yocto-poky/bitbake/lib/progressbar.py
new file mode 100644
index 000000000..114cdc16b
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/progressbar.py
@@ -0,0 +1,384 @@
+#!/usr/bin/env python
+# -*- coding: iso-8859-1 -*-
+#
+# progressbar - Text progressbar 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 progressbar library for python.
+
+This library provides a text mode progressbar. This is typically used
+to display the progress of a long running operation, providing a
+visual clue that processing is underway.
+
+The ProgressBar class manages the progress, and the format of the line
+is given by a number of widgets. A widget is an object that may
+display diferently depending on the state of the progress. There are
+three types of widget:
+- a string, which always shows itself;
+- a ProgressBarWidget, which may return a diferent value every time
+it's update method is called; and
+- 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. And
+automatically supports features like auto-resizing when available.
+"""
+
+from __future__ import division
+
+__author__ = "Nilton Volpato"
+__author_email__ = "first-name dot last-name @ gmail.com"
+__date__ = "2006-05-07"
+__version__ = "2.3-dev"
+
+import sys, time, os
+from array import array
+try:
+ from fcntl import ioctl
+ import termios
+except ImportError:
+ pass
+import signal
+try:
+ basestring
+except NameError:
+ basestring = (str,)
+
+class ProgressBarWidget(object):
+ """This is an element of ProgressBar formatting.
+
+ The ProgressBar object will call it's update value when an update
+ is needed. It's size may change between call, but the results will
+ not be good if the size changes drastically and repeatedly.
+ """
+ def update(self, pbar):
+ """Returns the string representing the widget.
+
+ The parameter pbar is a reference to the calling ProgressBar,
+ where one can access attributes of the class for knowing how
+ the update must be made.
+
+ At least this function must be overriden."""
+ pass
+
+class ProgressBarWidgetHFill(object):
+ """This is a variable width element of ProgressBar formatting.
+
+ The ProgressBar object will call it's update value, informing the
+ width this object must the made. This is like TeX \\hfill, 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.
+ """
+ def update(self, pbar, width):
+ """Returns the string representing the widget.
+
+ The parameter pbar is a reference to the calling ProgressBar,
+ where one can access attributes of the class for knowing how
+ the update must be made. The parameter width is the total
+ horizontal width the widget must have.
+
+ At least this function must be overriden."""
+ pass
+
+
+class ETA(ProgressBarWidget):
+ "Widget for the Estimated Time of Arrival"
+ def format_time(self, seconds):
+ return time.strftime('%H:%M:%S', time.gmtime(seconds))
+ def update(self, pbar):
+ 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 FileTransferSpeed(ProgressBarWidget):
+ "Widget for showing the transfer speed (useful for file transfers)."
+ def __init__(self, unit='B'):
+ self.unit = unit
+ self.fmt = '%6.2f %s'
+ self.prefixes = ['', 'K', 'M', 'G', 'T', 'P']
+ def update(self, pbar):
+ if pbar.seconds_elapsed < 2e-6:#== 0:
+ bps = 0.0
+ else:
+ bps = pbar.currval / pbar.seconds_elapsed
+ spd = bps
+ for u in self.prefixes:
+ if spd < 1000:
+ break
+ spd /= 1000
+ return self.fmt % (spd, u + self.unit + '/s')
+
+class RotatingMarker(ProgressBarWidget):
+ "A rotating marker for filling the bar of progress."
+ def __init__(self, markers='|/-\\'):
+ self.markers = markers
+ self.curmark = -1
+ def update(self, pbar):
+ if pbar.finished:
+ return self.markers[0]
+ self.curmark = (self.curmark + 1) % len(self.markers)
+ return self.markers[self.curmark]
+
+class Percentage(ProgressBarWidget):
+ "Just the percentage done."
+ def update(self, pbar):
+ return '%3d%%' % pbar.percentage()
+
+class SimpleProgress(ProgressBarWidget):
+ "Returns what is already done and the total, e.g.: '5 of 47'"
+ def __init__(self, sep=' of '):
+ self.sep = sep
+ def update(self, pbar):
+ return '%d%s%d' % (pbar.currval, self.sep, pbar.maxval)
+
+class Bar(ProgressBarWidgetHFill):
+ "The bar of progress. It will stretch to fill the line."
+ def __init__(self, marker='#', left='|', right='|'):
+ self.marker = marker
+ self.left = left
+ self.right = right
+ def _format_marker(self, pbar):
+ if isinstance(self.marker, basestring):
+ return self.marker
+ else:
+ return self.marker.update(pbar)
+ def update(self, pbar, width):
+ percent = pbar.percentage()
+ cwidth = width - len(self.left) - len(self.right)
+ marked_width = int(percent * cwidth // 100)
+ m = self._format_marker(pbar)
+ bar = (self.left + (m * marked_width).ljust(cwidth) + self.right)
+ return bar
+
+class ReverseBar(Bar):
+ "The reverse bar of progress, or bar of regress. :)"
+ def update(self, pbar, width):
+ percent = pbar.percentage()
+ cwidth = width - len(self.left) - len(self.right)
+ marked_width = int(percent * cwidth // 100)
+ m = self._format_marker(pbar)
+ bar = (self.left + (m*marked_width).rjust(cwidth) + self.right)
+ return bar
+
+default_widgets = [Percentage(), ' ', Bar()]
+class ProgressBar(object):
+ """This is the ProgressBar class, it updates and prints the bar.
+
+ A common way of using it is like:
+ >>> pbar = ProgressBar().start()
+ >>> for i in xrange(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
+ ...
+
+ But anything you want to do is possible (well, almost anything).
+ You can supply different widgets of any type in any order. And you
+ can even write your own widgets! There are many widgets already
+ shipped and you should experiment with them.
+
+ The term_width parameter must be an integer or None. In the latter case
+ it will try to guess it, if it fails it will default to 80 columns.
+
+ When implementing a widget update method you may access any
+ attribute or function of the ProgressBar object calling the
+ widget's update method. The most important attributes you would
+ like to access are:
+ - currval: current value of the progress, 0 <= currval <= maxval
+ - maxval: maximum (and final) value of the progress
+ - finished: True if the bar has finished (reached 100%), False o/w
+ - start_time: the time when start() method of ProgressBar was called
+ - seconds_elapsed: seconds elapsed since start_time
+ - percentage(): percentage of the progress [0..100]. This is a method.
+
+ The attributes above are unlikely to change between different versions,
+ the other ones may change or cease to exist without notice, so try to rely
+ only on the ones documented above if you are extending the progress bar.
+ """
+
+ __slots__ = ('currval', 'fd', 'finished', 'last_update_time', 'maxval',
+ 'next_update', 'num_intervals', 'seconds_elapsed',
+ 'signal_set', 'start_time', 'term_width', 'update_interval',
+ 'widgets', '_iterable')
+
+ _DEFAULT_MAXVAL = 100
+
+ def __init__(self, maxval=None, widgets=default_widgets, term_width=None,
+ fd=sys.stderr):
+ self.maxval = maxval
+ self.widgets = widgets
+ self.fd = fd
+ 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:
+ self.term_width = int(os.environ.get('COLUMNS', 80)) - 1
+
+ self.currval = 0
+ self.finished = False
+ self.start_time = None
+ self.last_update_time = None
+ self.seconds_elapsed = 0
+ self._iterable = None
+
+ def __call__(self, iterable):
+ try:
+ self.maxval = len(iterable)
+ except TypeError:
+ # If the iterable has no length, then rely on the value provided
+ # by the user, otherwise fail.
+ if not (isinstance(self.maxval, (int, long)) and self.maxval > 0):
+ raise RuntimeError('Could not determine maxval from iterable. '
+ 'You must explicitly provide a maxval.')
+ self._iterable = iter(iterable)
+ self.start()
+ return self
+
+ def __iter__(self):
+ return self
+
+ def next(self):
+ try:
+ next = self._iterable.next()
+ self.update(self.currval + 1)
+ return next
+ except StopIteration:
+ self.finish()
+ raise
+
+ def _handle_resize(self, signum, frame):
+ h, w = array('h', ioctl(self.fd, termios.TIOCGWINSZ, '\0' * 8))[:2]
+ self.term_width = w
+
+ def percentage(self):
+ "Returns the percentage of the progress."
+ return self.currval * 100.0 / self.maxval
+
+ def _format_widgets(self):
+ r = []
+ hfill_inds = []
+ num_hfill = 0
+ currwidth = 0
+ for i, w in enumerate(self.widgets):
+ if isinstance(w, ProgressBarWidgetHFill):
+ r.append(w)
+ hfill_inds.append(i)
+ num_hfill += 1
+ elif isinstance(w, basestring):
+ r.append(w)
+ currwidth += len(w)
+ else:
+ weval = w.update(self)
+ currwidth += len(weval)
+ r.append(weval)
+ for iw in hfill_inds:
+ widget_width = int((self.term_width - currwidth) // num_hfill)
+ r[iw] = r[iw].update(self, widget_width)
+ return r
+
+ def _format_line(self):
+ return ''.join(self._format_widgets()).ljust(self.term_width)
+
+ def _next_update(self):
+ return int((int(self.num_intervals *
+ (self.currval / self.maxval)) + 1) *
+ self.update_interval)
+
+ def _need_update(self):
+ """Returns true when the progressbar should print an updated line.
+
+ You can override this method if you want finer grained control over
+ updates.
+
+ The current implementation is optimized to be as fast as possible and
+ as economical as possible in the number of updates. However, depending
+ on your usage you may want to do more updates. For instance, if your
+ progressbar stays in the same percentage for a long time, and you want
+ to update other widgets, like ETA, then you could return True after
+ some time has passed with no updates.
+
+ Ideally you could call self._format_line() and see if it's different
+ from the previous _format_line() call, but calling _format_line() takes
+ around 20 times more time than calling this implementation of
+ _need_update().
+ """
+ return self.currval >= self.next_update
+
+ def update(self, value):
+ "Updates the progress bar to a new value."
+ assert 0 <= value <= self.maxval, '0 <= %d <= %d' % (value, self.maxval)
+ 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._next_update()
+ self.fd.write(self._format_line() + '\r')
+ self.last_update_time = now
+
+ def start(self):
+ """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 xrange(100):
+ ... # do something
+ ... pbar.update(i+1)
+ ...
+ >>> pbar.finish()
+ """
+ if self.maxval is None:
+ self.maxval = self._DEFAULT_MAXVAL
+ assert self.maxval > 0
+
+ self.num_intervals = max(100, self.term_width)
+ self.update_interval = self.maxval / self.num_intervals
+ self.next_update = 0
+
+ self.start_time = self.last_update_time = time.time()
+ self.update(0)
+ return self
+
+ def finish(self):
+ """Used to tell the progress is finished."""
+ 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/import-layers/yocto-poky/bitbake/lib/prserv/__init__.py b/import-layers/yocto-poky/bitbake/lib/prserv/__init__.py
new file mode 100644
index 000000000..c3cb73ad9
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/prserv/db.py b/import-layers/yocto-poky/bitbake/lib/prserv/db.py
new file mode 100644
index 000000000..2a8618417
--- /dev/null
+++ b/import-layers/yocto-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, basestring):
+ 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/import-layers/yocto-poky/bitbake/lib/prserv/serv.py b/import-layers/yocto-poky/bitbake/lib/prserv/serv.py
new file mode 100644
index 000000000..affccd9b3
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/prserv/serv.py
@@ -0,0 +1,471 @@
+import os,sys,logging
+import signal, time
+from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
+import threading
+import Queue
+import socket
+import StringIO
+
+try:
+ import sqlite3
+except ImportError:
+ from pysqlite2 import dbapi2 as sqlite3
+
+import bb.server.xmlrpc
+import prserv
+import prserv.db
+import errno
+
+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.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.quit:
+ try:
+ (request, client_address) = self.requestqueue.get(True, 30)
+ except Queue.Empty:
+ self.table.sync_if_dirty()
+ 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=True
+
+ 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 = StringIO.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.quit
+
+ 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.quit=True
+ return
+
+ def work_forever(self,):
+ self.quit = False
+ self.timeout = 0.5
+
+ 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.quit:
+ self.handle_request()
+ self.handlerthread.join()
+ self.db.disconnect()
+ logger.info("PRServer: stopping...")
+ self.server_close()
+ return
+
+ def start(self):
+ if self.daemon:
+ pid = self.daemonize()
+ else:
+ pid = self.fork()
+
+ # 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()
+ si = file('/dev/null', 'r')
+ so = file(self.logfile, 'a+')
+ se = so
+ os.dup2(si.fileno(),sys.stdin.fileno())
+ os.dup2(so.fileno(),sys.stdout.fileno())
+ os.dup2(se.fileno(),sys.stderr.fileno())
+
+ # 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 = file(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.xmlrpc._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 = file(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 = file(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
+
+ host_params = filter(None, (d.getVar('PRSERV_HOST', True) 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", True) or d.getVar("CACHE", True))
+ 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(d=None):
+ global singleton
+ if singleton:
+ host, port = singleton.getinfo()
+ try:
+ PRServerConnection(host, port).terminate()
+ except:
+ logger.critical("Stop PRService %s:%d failed" % (host,port))
+ singleton = None
+
+def ping(host, port):
+ conn=PRServerConnection(host, port)
+ return conn.ping()
diff --git a/import-layers/yocto-poky/bitbake/lib/pyinotify.py b/import-layers/yocto-poky/bitbake/lib/pyinotify.py
new file mode 100644
index 000000000..2dae00211
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/pyinotify.py
@@ -0,0 +1,2416 @@
+#!/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
+ """
+ err = 'Python %s is unsupported, requires at least Python 2.4'
+ PyinotifyError.__init__(self, err % version)
+
+
+# Check Python version
+import sys
+if sys.version_info < (2, 4):
+ 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 subprocess
+
+try:
+ from functools import reduce
+except ImportError:
+ pass # Will fail on Python 2.4 which has reduce() builtin anyway.
+
+try:
+ from glob import iglob as glob
+except ImportError:
+ # Python 2.4 does not have glob.iglob().
+ from glob import glob as glob
+
+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.5"
+
+__metaclass__ = type # Use new-style classes by default
+
+
+# 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():
+ # 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, 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, 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, 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.
+
+ if sys.version_info >= (2, 6):
+ self._libc = ctypes.CDLL(libc_name, use_errno=True)
+ self._get_errno_func = ctypes.get_errno
+ else:
+ self._libc = ctypes.CDLL(libc_name)
+ try:
+ location = self._libc.__errno_location
+ location.restype = ctypes.POINTER(ctypes.c_int)
+ self._get_errno_func = lambda: location().contents.value
+ except AttributeError:
+ pass
+
+ # 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):
+ if self._get_errno_func is not None:
+ return self._get_errno_func()
+ return None
+
+ 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
+ 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)
+
+ def _sysctl(self, *args):
+ assert self._libc is not None
+ return self._libc.sysctl(*args)
+
+
+# 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 SysCtlINotify:
+ """
+ Access (read, write) inotify's variables through sysctl. 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
+ """
+
+ inotify_attrs = {'max_user_instances': 1,
+ 'max_user_watches': 2,
+ 'max_queued_events': 3}
+
+ def __init__(self, attrname, inotify_wrapper):
+ # FIXME: right now only supporting ctypes
+ assert ctypes
+ self._attrname = attrname
+ self._inotify_wrapper = inotify_wrapper
+ sino = ctypes.c_int * 3
+ self._attr = sino(5, 20, SysCtlINotify.inotify_attrs[attrname])
+
+ @staticmethod
+ def create(attrname):
+ """
+ Factory method instanciating and returning the right wrapper.
+ """
+ # FIXME: right now only supporting ctypes
+ if ctypes is None:
+ return None
+ inotify_wrapper = _CtypesLibcINotifyWrapper()
+ if not inotify_wrapper.init():
+ return None
+ return SysCtlINotify(attrname, inotify_wrapper)
+
+ def get_val(self):
+ """
+ Gets attribute's value. Raises OSError if the operation failed.
+
+ @return: stored value.
+ @rtype: int
+ """
+ oldv = ctypes.c_int(0)
+ size = ctypes.c_int(ctypes.sizeof(oldv))
+ sysctl = self._inotify_wrapper._sysctl
+ res = sysctl(self._attr, 3,
+ ctypes.c_voidp(ctypes.addressof(oldv)),
+ ctypes.addressof(size),
+ None, 0)
+ if res == -1:
+ raise OSError(self._inotify_wrapper.get_errno(),
+ self._inotify_wrapper.str_errno())
+ return oldv.value
+
+ def set_val(self, nval):
+ """
+ Sets new attribute's value. Raises OSError if the operation failed.
+
+ @param nval: replaces current value by nval.
+ @type nval: int
+ """
+ oldv = ctypes.c_int(0)
+ sizeo = ctypes.c_int(ctypes.sizeof(oldv))
+ newv = ctypes.c_int(nval)
+ sizen = ctypes.c_int(ctypes.sizeof(newv))
+ sysctl = self._inotify_wrapper._sysctl
+ res = sysctl(self._attr, 3,
+ ctypes.c_voidp(ctypes.addressof(oldv)),
+ ctypes.addressof(sizeo),
+ ctypes.c_voidp(ctypes.addressof(newv)),
+ sizen)
+ if res == -1:
+ raise OSError(self._inotify_wrapper.get_errno(),
+ self._inotify_wrapper.str_errno())
+
+ value = property(get_val, set_val)
+
+ def __repr__(self):
+ return '<%s=%d>' % (self._attrname, self.get_val())
+
+
+# Inotify's variables
+#
+# FIXME: currently these variables are only accessible when ctypes is used,
+# otherwise there are set to None.
+#
+# 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] = SysCtlINotify.create(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, basestring) 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, 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 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, err:
+ msg = "process_IN_CREATE, invalid directory %s: %s"
+ log.debug(msg % (created_dir, 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, 0600)
+ os.write(fd, str(self))
+ os.close(fd)
+
+ def __str__(self, scale=45):
+ stats = self._stats_copy()
+ if not stats:
+ return ''
+
+ m = max(stats.values())
+ unity = float(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) 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:
+ https://docs.python.org/3/library/select.html#polling-objects
+ @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.
+ @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, err:
+ if err[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, 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
+ fname, = struct.unpack('%ds' % fname_len,
+ r[rsum + s_size:rsum + s_size + fname_len])
+ rawevent = _RawEvent(wd, mask, cookie, fname)
+ 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):
+ """
+ @param 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.
+ @param stdin:
+ @param stdout:
+ @param 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(022)
+ 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, 0600)
+ os.dup2(fd_out, 1)
+ fd_err = os.open(stderr, os.O_WRONLY|os.O_CREAT, 0600)
+ 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, 0600)
+ os.write(fd_pid, str(os.getpid()) + '\n')
+ 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().
+ """
+ self._pollobj.unregister(self._fd)
+ os.close(self._fd)
+ 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) 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:
+ https://docs.python.org/3/library/select.html#polling-objects
+ @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], '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 = []
+ file_obj = file(filename, 'r')
+ try:
+ for line in file_obj.readlines():
+ # Trim leading an trailing whitespaces
+ pattern = line.strip()
+ if not pattern or pattern.startswith('#'):
+ continue
+ lst.append(pattern)
+ finally:
+ file_obj.close()
+ 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, 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.
+ """
+ # Unicode strings are converted back to strings, because it seems
+ # that inotify_add_watch from ctypes does not work well when
+ # it receives an ctypes.create_unicode_buffer instance as argument.
+ # Therefore even wd are indexed with bytes string and not with
+ # unicode paths.
+ if isinstance(path, unicode):
+ path = path.encode(sys.getfilesystemencoding())
+ 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)
+ self._wmd[wd] = watch
+ log.debug('New %s', watch)
+ return wd
+
+ def __glob(self, path, do_glob):
+ if do_glob:
+ return glob(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.
+ Ideally |path| components should not be unicode objects. Note that
+ although unicode paths are accepted there are converted to byte
+ strings before a watch is put on that path. The encoding used for
+ converting the unicode object is given by sys.getfilesystemencoding().
+ If |path| si 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):
+ # 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/import-layers/yocto-poky/bitbake/lib/toaster/__init__.py b/import-layers/yocto-poky/bitbake/lib/toaster/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/__init__.py
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/bldcollector/__init__.py b/import-layers/yocto-poky/bitbake/lib/toaster/bldcollector/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/bldcollector/__init__.py
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/bldcollector/admin.py b/import-layers/yocto-poky/bitbake/lib/toaster/bldcollector/admin.py
new file mode 100644
index 000000000..c1f85d73d
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/bldcollector/admin.py
@@ -0,0 +1,33 @@
+from django.contrib import admin
+from django.contrib.admin.filters import RelatedFieldListFilter
+from orm.models import BitbakeVersion, Release, LayerSource, ToasterSetting
+from django.forms.widgets import Textarea
+from django import forms
+import django.db.models as models
+
+from django.contrib.admin import widgets, helpers
+
+class LayerSourceAdmin(admin.ModelAdmin):
+ pass
+
+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
+
+admin.site.register(LayerSource, LayerSourceAdmin)
+admin.site.register(BitbakeVersion, BitbakeVersionAdmin)
+admin.site.register(Release, ReleaseAdmin)
+admin.site.register(ToasterSetting, ToasterSettingAdmin)
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/bldcollector/urls.py b/import-layers/yocto-poky/bitbake/lib/toaster/bldcollector/urls.py
new file mode 100644
index 000000000..64722f2cd
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/bldcollector/urls.py
@@ -0,0 +1,25 @@
+#
+# 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.conf.urls import patterns, include, url
+
+urlpatterns = patterns('bldcollector.views',
+ # landing point for pushing a bitbake_eventlog.json file to this toaster instace
+ url(r'^eventfile$', 'eventfile', name='eventfile'),
+ )
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/bldcollector/views.py b/import-layers/yocto-poky/bitbake/lib/toaster/bldcollector/views.py
new file mode 100644
index 000000000..f32fa4d22
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/__init__.py b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/__init__.py
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/admin.py b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/admin.py
new file mode 100644
index 000000000..fcbe5f593
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/bbcontroller.py b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/bbcontroller.py
new file mode 100644
index 000000000..d09ac1787
--- /dev/null
+++ b/import-layers/yocto-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)
+import bb.server.xmlrpc
+
+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):
+ self.connection = bb.server.xmlrpc._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 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/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
new file mode 100644
index 000000000..7def1f3a1
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -0,0 +1,332 @@
+#
+# 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
+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
+import subprocess
+
+from toastermain import settings
+
+from 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):
+ if cwd is None:
+ cwd = self.be.sourcedir
+
+ logger.debug("lbc_shellcmmd: (%s) %s" % (cwd, command))
+ p = subprocess.Popen(command, cwd = cwd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ 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.warn("localhostbecontroller: shellcmd error %s" % err)
+ raise ShellCmdException(err)
+ else:
+ logger.debug("localhostbecontroller: shellcmd success")
+ return out
+
+ 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 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
+ # set layers in the layersource
+
+ # 1. get a list of repos with branches, and map dirpaths for each layer
+ gitrepos = {}
+
+ 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 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).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)
+
+ layerlist = []
+
+
+ # 3. checkout the repositories
+ for giturl, commit in gitrepos.keys():
+ 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))
+
+ # make sure our directory is a git repository
+ if os.path.exists(localdirname):
+ localremotes = self._shellcmd("git remote -v", localdirname)
+ if not giturl in localremotes:
+ 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))
+ 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))
+ self._shellcmd("git remote remove origin", localdirname)
+ self._shellcmd("git remote add origin \"%s\"" % giturl, localdirname)
+ else:
+ logger.debug("localhostbecontroller: cloning %s in %s" % (giturl, localdirname))
+ self._shellcmd('git clone "%s" "%s"' % (giturl, localdirname))
+
+ # 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 --all && git reset --hard "%s"' % ref, localdirname)
+
+ # 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')))
+
+ # 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("/"))
+
+ logger.debug("localhostbecontroller: current layer list %s " % pformat(layerlist))
+
+ # 5. create custom layer and add custom recipes to it
+ layerpath = os.path.join(self.be.builddir,
+ CustomImageRecipe.LAYER_NAME)
+ for target in targets:
+ try:
+ customrecipe = CustomImageRecipe.objects.get(name=target.target,
+ project=bitbake.req.project)
+ except CustomImageRecipe.DoesNotExist:
+ continue # not a custom recipe, skip
+
+ # 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.oonf
+ 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)
+
+ br_layer_base_dirpath = \
+ os.path.join(self.be.sourcedir,
+ self.getGitCloneDirectory(
+ br_layer_base_recipe.giturl,
+ br_layer_base_recipe.commit),
+ 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" % target.target)
+ 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.save()
+
+ customrecipe.file_path = recipe_path
+ customrecipe.save()
+
+ # create *Layer* objects needed for build machinery to work
+ BRLayer.objects.get_or_create(req=target.req,
+ name=layer.name,
+ dirpath=layerpath,
+ giturl="file://%s" % layerpath)
+ if os.path.isdir(layerpath):
+ layerlist.append(layerpath)
+
+ self.islayerset = True
+ return layerlist
+
+ 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
+ self._shellcmd("bash -c 'source %s %s'" % (oe_init, builddir),
+ self.be.sourcedir)
+
+ # update bblayers.conf
+ bblconfpath = os.path.join(builddir, "conf/bblayers.conf")
+ conflines = open(bblconfpath, "r").readlines()
+ skip = False
+ with open(bblconfpath, 'w') as bblayers:
+ for line in conflines:
+ if line.startswith("# line added by toaster"):
+ skip = True
+ continue
+ if skip:
+ skip = False
+ else:
+ bblayers.write(line)
+
+ 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"')
+
+ # run bitbake server from the clone
+ bitbake = os.path.join(self.pokydirname, 'bitbake', 'bin', 'bitbake')
+ self._shellcmd('bash -c \"source %s %s; BITBAKE_UI="" %s --read %s '
+ '--server-only -t xmlrpc -B 0.0.0.0:0\"' % (oe_init,
+ builddir, bitbake, confpath), self.be.sourcedir)
+
+ # read port number from bitbake.lock
+ self.be.bbport = ""
+ bblock = os.path.join(builddir, 'bitbake.lock')
+ 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 not 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(['bash -c \"(TOASTER_BRBE="%s" BBSERVER="0.0.0.0:-1" '
+ '%s %s -u toasterui --token="" >>%s 2>&1;'
+ 'BITBAKE_UI="" BBSERVER=0.0.0.0:-1 %s -m)&\"' \
+ % (brbe, local_bitbake, bbtargets, log, bitbake)],
+ builddir, nowait=True)
+
+ logger.debug('localhostbecontroller: Build launched, exiting. '
+ 'Follow build logs at %s' % log)
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/management/__init__.py b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/management/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/management/__init__.py
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/management/commands/__init__.py b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/management/commands/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/management/commands/__init__.py
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py
new file mode 100644
index 000000000..5e70437b2
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py
@@ -0,0 +1,161 @@
+from django.core.management.base import NoArgsCommand, CommandError
+from django.db import transaction
+from bldcontrol.bbcontroller import getBuildEnvironmentController, ShellCmdException
+from bldcontrol.models import BuildRequest, BuildEnvironment, BRError
+from orm.models import ToasterSetting, Build
+import os
+import traceback
+
+def DN(path):
+ if path is None:
+ return ""
+ else:
+ return os.path.dirname(path)
+
+
+class Command(NoArgsCommand):
+ 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 _find_first_path_for_file(self, startdirectory, filename, level=0):
+ if level < 0:
+ return None
+ dirs = []
+ for i in os.listdir(startdirectory):
+ j = os.path.join(startdirectory, i)
+ if os.path.isfile(j):
+ if i == filename:
+ return startdirectory
+ elif os.path.isdir(j):
+ dirs.append(j)
+ for j in dirs:
+ ret = self._find_first_path_for_file(j, filename, level - 1)
+ if ret is not None:
+ return ret
+ return None
+
+ def _recursive_list_directories(self, startdirectory, level=0):
+ if level < 0:
+ return []
+ dirs = []
+ try:
+ for i in os.listdir(startdirectory):
+ j = os.path.join(startdirectory, i)
+ if os.path.isdir(j):
+ dirs.append(j)
+ except OSError:
+ pass
+ for j in dirs:
+ dirs = dirs + self._recursive_list_directories(j, level - 1)
+ return dirs
+
+
+ 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:
+ print "\n -- Validation: The layers checkout directory must be set."
+ 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:
+ print "\n -- Validation: The build directory must be set."
+ 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:
+ config_file = os.environ.get('TOASTER_CONF')
+ print "\nImporting file: %s" % config_file
+ from loadconf import Command as LoadConfigCommand
+
+ LoadConfigCommand()._import_layer_config(config_file)
+ # we run lsupdates after config update
+ print "\nLayer configuration imported. Updating information from the layer sources, please wait.\nYou can re-update any time later by running bitbake/lib/toaster/manage.py lsupdates"
+ from django.core.management import call_command
+ call_command("lsupdates")
+
+ # we don't look for any other config files
+ return is_changed
+ except Exception as e:
+ print "Failure while trying to import the toaster config file %s: %s" %\
+ (config_file, e)
+ traceback.print_exc(e)
+
+ 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_noargs(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/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py
new file mode 100644
index 000000000..5022b5940
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py
@@ -0,0 +1,183 @@
+from django.core.management.base import BaseCommand, CommandError
+from orm.models import LayerSource, ToasterSetting, Branch, Layer, Layer_Version
+from orm.models import BitbakeVersion, Release, ReleaseDefaultLayer, ReleaseLayerSourcePriority
+from django.db import IntegrityError
+import os
+
+from checksettings import DN
+
+import logging
+logger = logging.getLogger("toaster")
+
+def _reduce_canon_path(path):
+ components = []
+ for c in path.split("/"):
+ if c == "..":
+ del components[-1]
+ elif c == ".":
+ pass
+ else:
+ components.append(c)
+ if len(components) < 2:
+ components.append('')
+ return "/".join(components)
+
+def _get_id_for_sourcetype(s):
+ for i in LayerSource.SOURCE_TYPE:
+ if s == i[1]:
+ return i[0]
+ raise Exception("Could not find definition for sourcetype '%s'. Valid source types are %s" % (str(s), ', '.join(map(lambda x: "'%s'" % x[1], LayerSource.SOURCE_TYPE ))))
+
+class Command(BaseCommand):
+ help = "Loads a toasterconf.json file in the database"
+ args = "filepath"
+
+
+
+ def _import_layer_config(self, filepath):
+ if not os.path.exists(filepath) or not os.path.isfile(filepath):
+ raise Exception("Failed to find toaster config file %s ." % filepath)
+
+ import json
+ data = json.loads(open(filepath, "r").read())
+
+ # verify config file validity before updating settings
+ for i in ['bitbake', 'releases', 'defaultrelease', 'config', 'layersources']:
+ assert i in data
+
+ def _read_git_url_from_local_repository(address):
+ url = None
+ # we detect the remote name at runtime
+ import subprocess
+ (remote, remote_name) = address.split(":", 1)
+ cmd = subprocess.Popen("git remote -v", shell=True, cwd = os.path.dirname(filepath), stdout=subprocess.PIPE, stderr = subprocess.PIPE)
+ (out,err) = cmd.communicate()
+ if cmd.returncode != 0:
+ logging.warning("Error while importing layer vcs_url: git error: %s" % err)
+ for line in out.split("\n"):
+ try:
+ (name, path) = line.split("\t", 1)
+ if name == remote_name:
+ url = path.split(" ")[0]
+ break
+ except ValueError:
+ pass
+ if url == None:
+ logging.warning("Error while looking for remote \"%s\" in \"%s\"" % (remote_name, out))
+ return url
+
+
+ # import bitbake data
+ for bvi in data['bitbake']:
+ bvo, created = BitbakeVersion.objects.get_or_create(name=bvi['name'])
+ if bvi['giturl'].startswith("remote:"):
+ bvo.giturl = _read_git_url_from_local_repository(bvi['giturl'])
+ if bvo.giturl is None:
+ logger.error("The toaster config file references the local git repo, but Toaster cannot detect it.\nYour local configuration for bitbake version %s is invalid. Make sure that the toasterconf.json file is correct." % bvi['name'])
+
+ if bvo.giturl is None:
+ bvo.giturl = bvi['giturl']
+ bvo.branch = bvi['branch']
+ bvo.dirpath = bvi['dirpath']
+ bvo.save()
+
+ # set the layer sources
+ for lsi in data['layersources']:
+ assert 'sourcetype' in lsi
+ assert 'apiurl' in lsi
+ assert 'name' in lsi
+ assert 'branches' in lsi
+
+
+ if _get_id_for_sourcetype(lsi['sourcetype']) == LayerSource.TYPE_LAYERINDEX or lsi['apiurl'].startswith("/"):
+ apiurl = lsi['apiurl']
+ else:
+ apiurl = _reduce_canon_path(os.path.join(DN(os.path.abspath(filepath)), lsi['apiurl']))
+
+ assert ((_get_id_for_sourcetype(lsi['sourcetype']) == LayerSource.TYPE_LAYERINDEX) or apiurl.startswith("/")), (lsi['sourcetype'],apiurl)
+
+ try:
+ ls, created = LayerSource.objects.get_or_create(sourcetype = _get_id_for_sourcetype(lsi['sourcetype']), apiurl = apiurl)
+ ls.name = lsi['name']
+ ls.save()
+ except IntegrityError as e:
+ logger.warning("IntegrityError %s \nWhile setting name %s for layer source %s " % (e, lsi['name'], ls))
+
+
+ layerbranches = []
+ for branchname in lsi['branches']:
+ bo, created = Branch.objects.get_or_create(layer_source = ls, name = branchname)
+ layerbranches.append(bo)
+
+ if 'layers' in lsi:
+ for layerinfo in lsi['layers']:
+ lo, created = Layer.objects.get_or_create(layer_source = ls, name = layerinfo['name'])
+ if layerinfo['local_path'].startswith("/"):
+ lo.local_path = layerinfo['local_path']
+ else:
+ lo.local_path = _reduce_canon_path(os.path.join(ls.apiurl, layerinfo['local_path']))
+
+ if not os.path.exists(lo.local_path):
+ logger.error("Local layer path %s must exists. Are you trying to import a layer that does not exist ? Check your local toasterconf.json" % lo.local_path)
+
+ if layerinfo['vcs_url'].startswith("remote:"):
+ lo.vcs_url = _read_git_url_from_local_repository(layerinfo['vcs_url'])
+ if lo.vcs_url is None:
+ logger.error("The toaster config file references the local git repo, but Toaster cannot detect it.\nYour local configuration for layer %s is invalid. Make sure that the toasterconf.json file is correct." % layerinfo['name'])
+
+ if lo.vcs_url is None:
+ lo.vcs_url = layerinfo['vcs_url']
+
+ if 'layer_index_url' in layerinfo:
+ lo.layer_index_url = layerinfo['layer_index_url']
+ lo.save()
+
+ for branch in layerbranches:
+ lvo, created = Layer_Version.objects.get_or_create(layer_source = ls,
+ up_branch = branch,
+ commit = branch.name,
+ layer = lo)
+ lvo.dirpath = layerinfo['dirpath']
+ lvo.save()
+ # set releases
+ for ri in data['releases']:
+ bvo = BitbakeVersion.objects.get(name = ri['bitbake'])
+ assert bvo is not None
+
+ ro, created = Release.objects.get_or_create(name = ri['name'], bitbake_version = bvo, branch_name = ri['branch'])
+ ro.description = ri['description']
+ ro.helptext = ri['helptext']
+ ro.save()
+
+ # save layer source priority for release
+ for ls_name in ri['layersourcepriority'].keys():
+ rlspo, created = ReleaseLayerSourcePriority.objects.get_or_create(release = ro, layer_source = LayerSource.objects.get(name=ls_name))
+ rlspo.priority = ri['layersourcepriority'][ls_name]
+ rlspo.save()
+
+ for dli in ri['defaultlayers']:
+ # find layers with the same name
+ ReleaseDefaultLayer.objects.get_or_create( release = ro, layer_name = dli)
+
+ # set default release
+ if ToasterSetting.objects.filter(name = "DEFAULT_RELEASE").count() > 0:
+ ToasterSetting.objects.filter(name = "DEFAULT_RELEASE").update(value = data['defaultrelease'])
+ else:
+ ToasterSetting.objects.create(name = "DEFAULT_RELEASE", value = data['defaultrelease'])
+
+ # set default config variables
+ for configname in data['config']:
+ if ToasterSetting.objects.filter(name = "DEFCONF_" + configname).count() > 0:
+ ToasterSetting.objects.filter(name = "DEFCONF_" + configname).update(value = data['config'][configname])
+ else:
+ ToasterSetting.objects.create(name = "DEFCONF_" + configname, value = data['config'][configname])
+
+
+ def handle(self, *args, **options):
+ if len(args) == 0:
+ raise CommandError("Need a path to the toasterconf.json file")
+ filepath = args[0]
+ self._import_layer_config(filepath)
+
+
+
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py
new file mode 100644
index 000000000..27289be5f
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py
@@ -0,0 +1,179 @@
+from django.core.management.base import NoArgsCommand, CommandError
+from django.db import transaction
+from django.db.models import Q
+
+from bldcontrol.bbcontroller import getBuildEnvironmentController
+from bldcontrol.bbcontroller import ShellCmdException, BuildSetupException
+from bldcontrol.models import BuildRequest, BuildEnvironment
+from bldcontrol.models import BRError, BRVariable
+
+from orm.models import Build, ToasterSetting, LogMessage, Target
+
+import os
+import logging
+import time
+import sys
+import traceback
+
+logger = logging.getLogger("toaster")
+
+class Command(NoArgsCommand):
+ 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.debug("runbuilds: starting build %s, environment %s" % \
+ (str(br).decode('utf-8'), 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(e)
+ 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(e))
+ br.state = BuildRequest.REQ_FAILED
+ br.save()
+ bec.be.lock = BuildEnvironment.LOCK_FREE
+ bec.be.save()
+
+ def archive(self):
+ for br in BuildRequest.objects.filter(state = BuildRequest.REQ_ARCHIVE):
+ if br.build == 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 handle_noargs(self, **options):
+ while True:
+ 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))
+
+ time.sleep(1)
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/migrations/0001_initial.py b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/migrations/0001_initial.py
new file mode 100644
index 000000000..67db37856
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/migrations/0002_auto_20160120_1250.py b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/migrations/0002_auto_20160120_1250.py
new file mode 100644
index 000000000..0c2475aba
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/migrations/0003_add_cancelling_state.py b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/migrations/0003_add_cancelling_state.py
new file mode 100644
index 000000000..eec9216ca
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/migrations/__init__.py b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/migrations/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/migrations/__init__.py
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/models.py b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/models.py
new file mode 100644
index 000000000..cb49a58c4
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/models.py
@@ -0,0 +1,160 @@
+from __future__ import unicode_literals
+from django.db import models
+from django.core.validators import MaxValueValidator, MinValueValidator
+from django.utils.encoding import force_bytes
+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_COMPLETED = 3
+ REQ_FAILED = 4
+ REQ_DELETED = 5
+ REQ_CANCELLING = 6
+ REQ_ARCHIVE = 7
+
+ REQUEST_STATE = (
+ (REQ_CREATED, "created"),
+ (REQ_QUEUED, "queued"),
+ (REQ_INPROGRESS, "in progress"),
+ (REQ_COMPLETED, "completed"),
+ (REQ_FAILED, "failed"),
+ (REQ_DELETED, "deleted"),
+ (REQ_CANCELLING, "cancelling"),
+ (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 incase 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.warn("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_bytes('%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)
+ commit = models.CharField(max_length = 254)
+ dirpath = models.CharField(max_length = 254)
+ 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/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/tests.py b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/tests.py
new file mode 100644
index 000000000..f20cc7d4b
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/tests.py
@@ -0,0 +1,160 @@
+"""
+This file demonstrates writing tests using the unittest module. These will pass
+when you run "manage.py test".
+
+Replace this with more appropriate tests for your application.
+"""
+
+from django.test import TestCase
+
+from bldcontrol.bbcontroller import BitbakeController, BuildSetupException
+from bldcontrol.localhostbecontroller import LocalhostBEController
+from bldcontrol.models import BuildEnvironment, BuildRequest
+from bldcontrol.management.commands.runbuilds import Command
+
+import socket
+import subprocess
+import os
+
+# standard poky data hardcoded for testing
+BITBAKE_LAYER = type('bitbake_info', (object,), { "giturl": "git://git.yoctoproject.org/poky.git", "dirpath": "", "commit": "HEAD"})
+POKY_LAYERS = [
+ type('poky_info', (object,), { "name": "meta", "giturl": "git://git.yoctoproject.org/poky.git", "dirpath": "meta", "commit": "HEAD"}),
+ type('poky_info', (object,), { "name": "meta-yocto", "giturl": "git://git.yoctoproject.org/poky.git", "dirpath": "meta-yocto", "commit": "HEAD"}),
+ type('poky_info', (object,), { "name": "meta-yocto-bsp", "giturl": "git://git.yoctoproject.org/poky.git", "dirpath": "meta-yocto-bsp", "commit": "HEAD"}),
+ ]
+
+
+
+# we have an abstract test class designed to ensure that the controllers use a single interface
+# specific controller tests only need to override the _getBuildEnvironment() method
+
+test_sourcedir = os.getenv("TTS_SOURCE_DIR")
+test_builddir = os.getenv("TTS_BUILD_DIR")
+test_address = os.getenv("TTS_TEST_ADDRESS", "localhost")
+
+if test_sourcedir == None or test_builddir == None or test_address == None:
+ raise Exception("Please set TTTS_SOURCE_DIR, TTS_BUILD_DIR and TTS_TEST_ADDRESS")
+
+# The bb server will expect a toaster-pre.conf file to exist. If it doesn't exit then we make
+# an empty one here.
+open(test_builddir + 'conf/toaster-pre.conf', 'a').close()
+
+class BEControllerTests(object):
+
+ def _serverForceStop(self, bc):
+ err = bc._shellcmd("netstat -tapn 2>/dev/null | grep 8200 | awk '{print $7}' | sort -fu | cut -d \"/\" -f 1 | grep -v -- - | tee /dev/fd/2 | xargs -r kill")
+ self.assertTrue(err == '', "bitbake server pid %s not stopped" % err)
+
+ def test_serverStartAndStop(self):
+ obe = self._getBuildEnvironment()
+ bc = self._getBEController(obe)
+ try:
+ # setting layers, skip any layer info
+ bc.setLayers(BITBAKE_LAYER, POKY_LAYERS)
+ except NotImplementedError:
+ print "Test skipped due to command not implemented yet"
+ return True
+ # We are ok with the exception as we're handling the git already exists
+ except BuildSetupException:
+ pass
+
+ bc.pokydirname = test_sourcedir
+ bc.islayerset = True
+
+ hostname = test_address.split("@")[-1]
+
+ # test start server and stop
+ bc.startBBServer()
+
+ self.assertFalse(socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex((hostname, int(bc.be.bbport))), "Server not answering")
+
+ self._serverForceStop(bc)
+
+ def test_getBBController(self):
+ obe = self._getBuildEnvironment()
+ bc = self._getBEController(obe)
+ layerSet = False
+ try:
+ # setting layers, skip any layer info
+ layerSet = bc.setLayers(BITBAKE_LAYER, POKY_LAYERS)
+ except NotImplementedError:
+ print "Test skipped due to command not implemented yet"
+ return True
+ # We are ok with the exception as we're handling the git already exists
+ except BuildSetupException:
+ pass
+
+ bc.pokydirname = test_sourcedir
+ bc.islayerset = True
+
+ bbc = bc.getBBController()
+ self.assertTrue(isinstance(bbc, BitbakeController))
+
+ self._serverForceStop(bc)
+
+class LocalhostBEControllerTests(TestCase, BEControllerTests):
+ def __init__(self, *args):
+ super(LocalhostBEControllerTests, self).__init__(*args)
+
+
+ def _getBuildEnvironment(self):
+ return BuildEnvironment.objects.create(
+ lock = BuildEnvironment.LOCK_FREE,
+ betype = BuildEnvironment.TYPE_LOCAL,
+ address = test_address,
+ sourcedir = test_sourcedir,
+ builddir = test_builddir )
+
+ def _getBEController(self, obe):
+ return LocalhostBEController(obe)
+
+class RunBuildsCommandTests(TestCase):
+ def test_bec_select(self):
+ """
+ Tests that we can find and lock a build environment
+ """
+
+ obe = BuildEnvironment.objects.create(lock = BuildEnvironment.LOCK_FREE, betype = BuildEnvironment.TYPE_LOCAL)
+ command = Command()
+ bec = command._selectBuildEnvironment()
+
+ # make sure we select the object we've just built
+ self.assertTrue(bec.be.id == obe.id, "Environment is not properly selected")
+ # we have a locked environment
+ self.assertTrue(bec.be.lock == BuildEnvironment.LOCK_LOCK, "Environment is not locked")
+ # no more selections possible here
+ self.assertRaises(IndexError, command._selectBuildEnvironment)
+
+ def test_br_select(self):
+ from orm.models import Project, Release, BitbakeVersion, Branch
+ p = Project.objects.create_project("test", Release.objects.get_or_create(name = "HEAD", bitbake_version = BitbakeVersion.objects.get_or_create(name="HEAD", branch=Branch.objects.get_or_create(name="HEAD"))[0])[0])
+ obr = BuildRequest.objects.create(state = BuildRequest.REQ_QUEUED, project = p)
+ command = Command()
+ br = command._selectBuildRequest()
+
+ # make sure we select the object we've just built
+ self.assertTrue(obr.id == br.id, "Request is not properly selected")
+ # we have a locked environment
+ self.assertTrue(br.state == BuildRequest.REQ_INPROGRESS, "Request is not updated")
+ # no more selections possible here
+ self.assertRaises(IndexError, command._selectBuildRequest)
+
+
+class UtilityTests(TestCase):
+ def test_reduce_path(self):
+ from bldcontrol.management.commands.loadconf import _reduce_canon_path, _get_id_for_sourcetype
+
+ self.assertTrue( _reduce_canon_path("/") == "/")
+ self.assertTrue( _reduce_canon_path("/home/..") == "/")
+ self.assertTrue( _reduce_canon_path("/home/../ana") == "/ana")
+ self.assertTrue( _reduce_canon_path("/home/../ana/..") == "/")
+ self.assertTrue( _reduce_canon_path("/home/ana/mihai/../maria") == "/home/ana/maria")
+
+ def test_get_id_for_sorucetype(self):
+ from bldcontrol.management.commands.loadconf import _reduce_canon_path, _get_id_for_sourcetype
+ self.assertTrue( _get_id_for_sourcetype("layerindex") == 1)
+ self.assertTrue( _get_id_for_sourcetype("local") == 0)
+ self.assertTrue( _get_id_for_sourcetype("imported") == 2)
+ with self.assertRaises(Exception):
+ _get_id_for_sourcetype("unknown")
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/views.py b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/views.py
new file mode 100644
index 000000000..60f00ef0e
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/bldcontrol/views.py
@@ -0,0 +1 @@
+# Create your views here.
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/README b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/README
new file mode 100644
index 000000000..46d0ff008
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/README
@@ -0,0 +1,6 @@
+contrib directory for toaster
+
+This directory holds code that works with Toaster, without being an integral part of the Toaster project.
+It is intended for testing code, testing fixtures, tools for Toaster, etc.
+
+NOTE: This directory is NOT a Python module.
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/README b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/README
new file mode 100644
index 000000000..22fa5673b
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/README
@@ -0,0 +1,41 @@
+
+Toaster Testing Framework
+Yocto Project
+
+
+Rationale
+------------
+As Toaster contributions grow with the number of people that contribute code, verifying each patch prior to submitting upstream becomes a hard-to-scale problem for humans. We devised this system in order to run patch-level validation, trying to eliminate common problems from submitted patches, in an automated fashion.
+
+The Toaster Testing Framework is a set of Python scripts that provides an extensible way to write smoke and regression tests that will be run on each patch set sent for review on the toaster mailing list.
+
+
+Usage
+------------
+There are three main executable scripts in this directory.
+ * runner.py is designed to be run from the command line. It requires, as mandatory parameter, a branch name on poky-contrib, branch which contains the patches to be tested. The program will auto-discover the available tests residing in this directory by looking for unittest classes, and will run the tests on the branch dumping the output to the standard output. Optionally, it can take parameters inhibiting the branch checkout, or specifying a single test to be run, for debugging purposes.
+ * launcher.py is a designed to be run from a crontab or similar scheduling mechanism. It looks up a backlog file containing branches-to-test (named tasks in the source code), select the first one in FIFO manner, and launch runner.py on it. It will await for completion, and email the standard output and standard error dumps from the runner.py execution
+ * recv.py is an email receiver, designed to be called as a pipe from a .forward file. It is used to monitor a mailing list, for example, and add tasks to the backlog based on review requests coming on the mailing list.
+
+
+Installation
+------------
+As prerequisite, we expect a functioning email system on a machine with Python2.
+
+The broad steps to installation
+* set up the .forward on the receiving email account to pipe to the recv.py file
+* edit config.py and settings.json to alter for local installation settings
+* on email receive, verify backlog.txt to see that the tasks are received and marked for processing
+* execute launcher.py in command line to verify that a test occurs with no problems, and that the outgoing email is delivered
+* add launcher.py
+
+
+
+Contribute
+------------
+What we need are tests. Add your own tests to either tests.py file, or to a new file.
+Use "config.logger" to write logs that will make it to email.
+
+Commonly used code should be going to shellutils, and configuration to config.py.
+
+Contribute code by emailing patches to the list: toaster@yoctoproject.org (membership required)
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/TODO b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/TODO
new file mode 100644
index 000000000..117192106
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/TODO
@@ -0,0 +1,9 @@
+We need to implement tests:
+
+automated link checker; currently
+$ linkchecker -t 1000 -F csv http://localhost:8000/
+
+integrate the w3c-validation service; currently
+$ python urlcheck.py
+
+
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/config.py b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/config.py
new file mode 100644
index 000000000..40d45f3b7
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/config.py
@@ -0,0 +1,98 @@
+#!/usr/bin/python
+
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (C) 2015 Alexandru Damian for 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.
+
+# This is the configuration/single module for tts
+# everything that would be a global variable goes here
+
+import os, sys, logging
+import socket
+
+LOGDIR = "log"
+SETTINGS_FILE = os.path.join(os.path.dirname(__file__), "settings.json")
+TEST_DIR_NAME = "tts_testdir"
+
+DEBUG = True
+
+OWN_PID = os.getpid()
+
+W3C_VALIDATOR = "http://icarus.local/w3c-validator/check?doctype=HTML5&uri="
+
+TOASTER_PORT = 56789
+
+TESTDIR = None
+
+#we parse the w3c URL to know where to connect
+
+import urlparse
+
+def get_public_ip():
+ temp_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+ parsed_url = urlparse.urlparse("http://icarus.local/w3c-validator/check?doctype=HTML5&uri=")
+ temp_socket.connect((parsed_url.netloc, 80 if parsed_url.port is None else parsed_url.port))
+ public_ip = temp_socket.getsockname()[0]
+ temp_socket.close()
+ return public_ip
+
+TOASTER_BASEURL = "http://%s:%d/" % (get_public_ip(), TOASTER_PORT)
+
+
+OWN_EMAIL_ADDRESS = "Toaster Testing Framework <alexandru.damian@intel.com>"
+REPORT_EMAIL_ADDRESS = "alexandru.damian@intel.com"
+
+# make sure we have the basic logging infrastructure
+
+#pylint: disable=invalid-name
+# we disable the invalid name because the module-level "logger" is used througout bitbake
+logger = logging.getLogger("toastertest")
+__console__ = logging.StreamHandler(sys.stdout)
+__console__.setFormatter(logging.Formatter("%(asctime)s %(levelname)s: %(message)s"))
+logger.addHandler(__console__)
+logger.setLevel(logging.DEBUG)
+
+
+# singleton file names
+LOCKFILE = "/tmp/ttf.lock"
+BACKLOGFILE = os.path.join(os.path.dirname(__file__), "backlog.txt")
+
+# task states
+def enum(*sequential, **named):
+ enums = dict(zip(sequential, range(len(sequential))), **named)
+ reverse = dict((value, key) for key, value in enums.iteritems())
+ enums['reverse_mapping'] = reverse
+ return type('Enum', (), enums)
+
+
+class TASKS(object):
+ #pylint: disable=too-few-public-methods
+ PENDING = "PENDING"
+ INPROGRESS = "INPROGRESS"
+ DONE = "DONE"
+
+ @staticmethod
+ def next_task(task):
+ if task == TASKS.PENDING:
+ return TASKS.INPROGRESS
+ if task == TASKS.INPROGRESS:
+ return TASKS.DONE
+ raise Exception("Invalid next task state for %s" % task)
+
+# TTS specific
+CONTRIB_REPO = "git@git.yoctoproject.org:poky-contrib"
+
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/launcher.py b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/launcher.py
new file mode 100755
index 000000000..e5794c1c5
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/launcher.py
@@ -0,0 +1,101 @@
+#!/usr/bin/python
+
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (C) 2015 Alexandru Damian for 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.
+
+# Program to run the next task listed from the backlog.txt; designed to be
+# run from crontab.
+
+from __future__ import print_function
+import sys, os, config, shellutils
+from shellutils import ShellCmdException
+
+# Import smtplib for the actual sending function
+import smtplib
+
+# Import the email modules we'll need
+from email.mime.text import MIMEText
+
+def _take_lockfile():
+ return shellutils.lockfile(shellutils.mk_lock_filename())
+
+
+def read_next_task_by_state(task_state, task_name=None):
+ if not os.path.exists(os.path.join(os.path.dirname(__file__), config.BACKLOGFILE)):
+ return None
+ os.rename(config.BACKLOGFILE, config.BACKLOGFILE + ".tmp")
+ task = None
+ with open(config.BACKLOGFILE + ".tmp", "r") as f_in:
+ with open(config.BACKLOGFILE, "w") as f_out:
+ for line in f_in.readlines():
+ if task is None:
+ fields = line.strip().split("|", 2)
+ if fields[1] == task_state:
+ if task_name is None or task_name == fields[0]:
+ task = fields[0]
+ print("Updating %s %s to %s" % (task, task_state, config.TASKS.next_task(task_state)))
+ line = "%s|%s\n" % (task, config.TASKS.next_task(task_state))
+ f_out.write(line)
+ os.remove(config.BACKLOGFILE + ".tmp")
+ return task
+
+def send_report(task_name, plaintext, errtext=None):
+ if errtext is None:
+ msg = MIMEText(plaintext)
+ else:
+ if plaintext is None:
+ plaintext = ""
+ msg = MIMEText("--STDOUT dump--\n\n%s\n\n--STDERR dump--\n\n%s" % (plaintext, errtext))
+
+ msg['Subject'] = "[review-request] %s - smoke test results" % task_name
+ msg['From'] = config.OWN_EMAIL_ADDRESS
+ msg['To'] = config.REPORT_EMAIL_ADDRESS
+
+ smtp_connection = smtplib.SMTP("localhost")
+ smtp_connection.sendmail(config.OWN_EMAIL_ADDRESS, [config.REPORT_EMAIL_ADDRESS], msg.as_string())
+ smtp_connection.quit()
+
+def main():
+ # we don't do anything if we have another instance of us running
+ lock_file = _take_lockfile()
+
+ if lock_file is None:
+ if config.DEBUG:
+ print("Concurrent script in progress, exiting")
+ sys.exit(1)
+
+ next_task = read_next_task_by_state(config.TASKS.PENDING)
+ if next_task is not None:
+ print("Next task is", next_task)
+ errtext = None
+ out = None
+ try:
+ out = shellutils.run_shell_cmd("%s %s" % (os.path.join(os.path.dirname(__file__), "runner.py"), next_task))
+ except ShellCmdException as exc:
+ print("Failed while running the test runner: %s", exc)
+ errtext = exc.__str__()
+ send_report(next_task, out, errtext)
+ read_next_task_by_state(config.TASKS.INPROGRESS, next_task)
+ else:
+ print("No task")
+
+ shellutils.unlockfile(lock_file)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/recv.py b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/recv.py
new file mode 100755
index 000000000..07efdac44
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/recv.py
@@ -0,0 +1,56 @@
+#!/usr/bin/python
+
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (C) 2015 Alexandru Damian for 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.
+
+# Program to receive review requests by email and log tasks to backlog.txt
+# Designed to be run by the email system from a .forward file:
+#
+# cat .forward
+# |[full/path]/recv.py
+
+from __future__ import print_function
+import sys, config, shellutils
+
+from email.parser import Parser
+
+def recv_mail(datastring):
+ headers = Parser().parsestr(datastring)
+ return headers['subject']
+
+def main():
+ lock_file = shellutils.lockfile(shellutils.mk_lock_filename(), retry=True)
+
+ if lock_file is None:
+ if config.DEBUG:
+ print("Concurrent script in progress, exiting")
+ sys.exit(1)
+
+ subject = recv_mail(sys.stdin.read())
+
+ subject_parts = subject.split()
+ if "[review-request]" in subject_parts:
+ task_name = subject_parts[subject_parts.index("[review-request]") + 1]
+ with open(config.BACKLOGFILE, "a") as fout:
+ line = "%s|%s\n" % (task_name, config.TASKS.PENDING)
+ fout.write(line)
+
+ shellutils.unlockfile(lock_file)
+
+if __name__ == "__main__":
+ main()
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/runner.py b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/runner.py
new file mode 100755
index 000000000..bed665196
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/runner.py
@@ -0,0 +1,222 @@
+#!/usr/bin/python
+
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (C) 2015 Alexandru Damian for 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.
+
+
+# This is the main test execution controller. It is designed to be run
+# manually from the command line, or to be called from a different program
+# that schedules test execution.
+#
+# Execute runner.py -h for help.
+
+
+
+from __future__ import print_function
+import sys, os
+import unittest, importlib
+import logging, pprint, json
+import re
+from shellutils import ShellCmdException, mkdirhier, run_shell_cmd
+
+import config
+
+# we also log to a file, in addition to console, because our output is important
+__log_file_name__ = os.path.join(os.path.dirname(__file__), "log/tts_%d.log" % config.OWN_PID)
+mkdirhier(os.path.dirname(__log_file_name__))
+__log_file__ = open(__log_file_name__, "w")
+__file_handler__ = logging.StreamHandler(__log_file__)
+__file_handler__.setFormatter(logging.Formatter("%(asctime)s %(levelname)s: %(message)s"))
+
+config.logger.addHandler(__file_handler__)
+
+# set up log directory
+try:
+ if not os.path.exists(config.LOGDIR):
+ os.mkdir(config.LOGDIR)
+ else:
+ if not os.path.isdir(config.LOGDIR):
+ raise Exception("Expected log dir '%s' is not actually a directory." % config.LOGDIR)
+except OSError as exc:
+ raise exc
+
+# creates the under-test-branch as a separate directory
+def set_up_test_branch(settings, branch_name):
+ testdir = "%s/%s.%d" % (settings['workdir'], config.TEST_DIR_NAME, config.OWN_PID)
+
+ # creates the host dir
+ if os.path.exists(testdir):
+ raise Exception("Test dir '%s'is already there, aborting" % testdir)
+
+ # may raise OSError, is to be handled by the caller
+ os.makedirs(testdir)
+
+
+ # copies over the .git from the localclone
+ run_shell_cmd("cp -a '%s'/.git '%s'" % (settings['localclone'], testdir))
+
+ # add the remote if it doesn't exist
+ crt_remotes = run_shell_cmd("git remote -v", cwd=testdir)
+ remotes = [word for line in crt_remotes.split("\n") for word in line.split()]
+ if not config.CONTRIB_REPO in remotes:
+ remote_name = "tts_contrib"
+ run_shell_cmd("git remote add %s %s" % (remote_name, config.CONTRIB_REPO), cwd=testdir)
+ else:
+ remote_name = remotes[remotes.index(config.CONTRIB_REPO) - 1]
+
+ # do the fetch
+ run_shell_cmd("git fetch %s -p" % remote_name, cwd=testdir)
+
+ # do the checkout
+ run_shell_cmd("git checkout origin/master && git branch -D %s; git checkout %s/%s -b %s && git reset --hard" % (branch_name, remote_name, branch_name, branch_name), cwd=testdir)
+
+ return testdir
+
+
+def __search_for_tests():
+ # we find all classes that can run, and run them
+ tests = []
+ for _, _, files_list in os.walk(os.path.dirname(os.path.abspath(__file__))):
+ for module_file in [f[:-3] for f in files_list if f.endswith(".py") and not f.startswith("__init__")]:
+ config.logger.debug("Inspecting module %s", module_file)
+ current_module = importlib.import_module(module_file)
+ crtclass_names = vars(current_module)
+ for name in crtclass_names:
+ tested_value = crtclass_names[name]
+ if isinstance(tested_value, type(unittest.TestCase)) and issubclass(tested_value, unittest.TestCase):
+ tests.append((module_file, name))
+ break
+ return tests
+
+
+# boilerplate to self discover tests and run them
+def execute_tests(dir_under_test, testname):
+
+ if testname is not None and "." in testname:
+ tests = []
+ tests.append(tuple(testname.split(".", 2)))
+ else:
+ tests = __search_for_tests()
+
+ # let's move to the directory under test
+ crt_dir = os.getcwd()
+ os.chdir(dir_under_test)
+
+ # execute each module
+ # pylint: disable=broad-except
+ # we disable the broad-except because we want to actually catch all possible exceptions
+ try:
+ # sorting the tests by the numeric order in the class name
+ tests = sorted(tests, key=lambda x: int(re.search(r"[0-9]+", x[1]).group(0)))
+ config.logger.debug("Discovered test clases: %s", pprint.pformat(tests))
+ unittest.installHandler()
+ suite = unittest.TestSuite()
+ loader = unittest.TestLoader()
+ result = unittest.TestResult()
+ result.failfast = True
+ for module_file, test_name in tests:
+ suite.addTest(loader.loadTestsFromName("%s.%s" % (module_file, test_name)))
+ config.logger.info("Running %d test(s)", suite.countTestCases())
+ suite.run(result)
+
+ for error in result.errors:
+ config.logger.error("Exception on test: %s\n%s", error[0],
+ "\n".join(["-- %s" % x for x in error[1].split("\n")]))
+
+ for failure in result.failures:
+ config.logger.error("Failed test: %s:\n%s\n", failure[0],
+ "\n".join(["-- %s" % x for x in failure[1].split("\n")]))
+
+ config.logger.info("Test results: %d ran, %d errors, %d failures", result.testsRun, len(result.errors), len(result.failures))
+
+ except Exception as exc:
+ import traceback
+ config.logger.error("Exception while running test. Tracedump: \n%s", traceback.format_exc(exc))
+ finally:
+ os.chdir(crt_dir)
+ return len(result.failures)
+
+# verify that we had a branch-under-test name as parameter
+def validate_args():
+ from optparse import OptionParser
+ parser = OptionParser(usage="usage: %prog [options] branch_under_test")
+
+ parser.add_option("-t", "--test-dir", dest="testdir", default=None, help="Use specified directory to run tests, inhibits the checkout.")
+ parser.add_option("-s", "--single", dest="singletest", default=None, help="Run only the specified test")
+
+ (options, args) = parser.parse_args()
+ if len(args) < 1:
+ raise Exception("Please specify the branch to run on. Use option '-h' when in doubt.")
+ return (options, args)
+
+
+
+
+# load the configuration options
+def read_settings():
+ if not os.path.exists(config.SETTINGS_FILE) or not os.path.isfile(config.SETTINGS_FILE):
+ raise Exception("Config file '%s' cannot be openend" % config.SETTINGS_FILE)
+ return json.loads(open(config.SETTINGS_FILE, "r").read())
+
+
+# cleanup !
+def clean_up(testdir):
+ run_shell_cmd("rm -rf -- '%s'" % testdir)
+
+def dump_info(settings, options, args):
+ """ detailed information about current run configuration, for debugging purposes.
+ """
+ config.logger.debug("Settings:\n%s\nOptions:\n%s\nArguments:\n%s\n", settings, options, args)
+
+def main():
+ (options, args) = validate_args()
+
+ settings = read_settings()
+ need_cleanup = False
+
+ # dump debug info
+ dump_info(settings, options, args)
+
+ testdir = None
+ no_failures = 1
+ try:
+ if options.testdir is not None and os.path.exists(options.testdir):
+ testdir = os.path.abspath(options.testdir)
+ config.logger.info("No checkout, using %s", testdir)
+ else:
+ need_cleanup = True
+ testdir = set_up_test_branch(settings, args[0]) # we expect a branch name as first argument
+
+ config.TESTDIR = testdir # we let tests know where to run
+
+ # ensure that the test dir only contains no *.pyc leftovers
+ run_shell_cmd("find '%s' -type f -name *.pyc -exec rm {} \\;" % testdir)
+
+ no_failures = execute_tests(testdir, options.singletest)
+
+ except ShellCmdException as exc:
+ import traceback
+ config.logger.error("Error while setting up testing. Traceback: \n%s", traceback.format_exc(exc))
+ finally:
+ if need_cleanup and testdir is not None:
+ clean_up(testdir)
+
+ sys.exit(no_failures)
+
+if __name__ == "__main__":
+ main()
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/settings.json b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/settings.json
new file mode 100644
index 000000000..bb671eaf2
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/settings.json
@@ -0,0 +1,5 @@
+{
+ "repo": "git@git.yoctoproject.org:poky-contrib",
+ "localclone": "/home/ddalex/ssd/yocto/poky",
+ "workdir": "/home/ddalex/ssd/yocto"
+}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/shellutils.py b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/shellutils.py
new file mode 100644
index 000000000..c2012edf8
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/shellutils.py
@@ -0,0 +1,141 @@
+#!/usr/bin/python
+
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (C) 2015 Alexandru Damian for 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.
+
+# Utilities shared by tests and other common bits of code.
+
+import sys, os, subprocess, fcntl, errno
+import config
+from config import logger
+
+
+# License warning; this code is copied from the BitBake project, file bitbake/lib/bb/utils.py
+# The code is originally licensed GPL-2.0, and we redistribute it under still GPL-2.0
+
+# End of copy is marked with #ENDOFCOPY marker
+
+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 exc:
+ if exc.errno != errno.EEXIST:
+ raise exc
+
+def lockfile(name, shared=False, retry=True):
+ """
+ Use the file fn as a lock file, return when the lock has been acquired.
+ Returns a variable to pass to unlockfile().
+ """
+ config.logger.debug("take lockfile %s", name)
+ 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)
+
+ operation = fcntl.LOCK_EX
+ if shared:
+ operation = fcntl.LOCK_SH
+ if not retry:
+ operation = operation | 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.
+
+ # pylint: disable=broad-except
+ # we disable the broad-except because we want to actually catch all possible exceptions
+ try:
+ lock_file = open(name, 'a+')
+ fileno = lock_file.fileno()
+ fcntl.flock(fileno, operation)
+ statinfo = os.fstat(fileno)
+ if os.path.exists(lock_file.name):
+ statinfo2 = os.stat(lock_file.name)
+ if statinfo.st_ino == statinfo2.st_ino:
+ return lock_file
+ lock_file.close()
+ except Exception as exc:
+ try:
+ lock_file.close()
+ except Exception as exc2:
+ config.logger.error("Failed to close the lockfile: %s", exc2)
+ config.logger.error("Failed to acquire the lockfile: %s", exc)
+ if not retry:
+ return None
+
+def unlockfile(lock_file):
+ """
+ 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(lock_file.fileno(), fcntl.LOCK_EX|fcntl.LOCK_NB)
+ os.unlink(lock_file.name)
+ except (IOError, OSError):
+ pass
+ fcntl.flock(lock_file.fileno(), fcntl.LOCK_UN)
+ lock_file.close()
+
+#ENDOFCOPY
+
+
+def mk_lock_filename():
+ our_name = os.path.basename(__file__)
+ our_name = ".%s" % ".".join(reversed(our_name.split(".")))
+ return config.LOCKFILE + our_name
+
+
+
+class ShellCmdException(Exception):
+ pass
+
+def run_shell_cmd(command, cwd=None):
+ if cwd is None:
+ cwd = os.getcwd()
+
+ config.logger.debug("_shellcmd: (%s) %s", cwd, command)
+ process = subprocess.Popen(command, cwd=cwd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ (out, err) = process.communicate()
+ process.wait()
+ if process.returncode:
+ if len(err) == 0:
+ err = "command: %s \n%s" % (command, out)
+ else:
+ err = "command: %s \n%s" % (command, err)
+ config.logger.warn("_shellcmd: error \n%s\n%s", out, err)
+ raise ShellCmdException(err)
+ else:
+ #config.logger.debug("localhostbecontroller: shellcmd success\n%s" % out)
+ return out
+
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/tests.py b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/tests.py
new file mode 100644
index 000000000..c510ebb10
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/tests.py
@@ -0,0 +1,115 @@
+#!/usr/bin/python
+
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (C) 2015 Alexandru Damian for 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.
+
+
+# Test definitions. The runner will look for and auto-discover the tests
+# no matter what they file are they in, as long as they are in the same directory
+# as this file.
+
+import unittest
+from shellutils import run_shell_cmd, ShellCmdException
+import config
+
+import pexpect
+import sys, os, signal, time
+
+class Test00PyCompilable(unittest.TestCase):
+ ''' Verifies that all Python files are syntactically correct '''
+ def test_compile_file(self):
+ try:
+ run_shell_cmd("find . -name *py -type f -print0 | xargs -0 -n1 -P20 python -m py_compile", config.TESTDIR)
+ except ShellCmdException as exc:
+ self.fail("Error compiling python files: %s" % (exc))
+
+ def test_pylint_file(self):
+ try:
+ run_shell_cmd(r"find . -iname \"*\.py\" -type f -print0 | PYTHONPATH=${PYTHONPATH}:. xargs -r -0 -n1 pylint --load-plugins pylint_django -E --reports=n 2>&1", cwd=config.TESTDIR + "/bitbake/lib/toaster")
+ except ShellCmdException as exc:
+ self.fail("Pylint fails: %s\n" % exc)
+
+class Test01PySystemStart(unittest.TestCase):
+ ''' Attempts to start Toaster, verify that it is succesfull, and stop it '''
+ def setUp(self):
+ run_shell_cmd("bash -c 'rm -f build/*log'")
+
+ def test_start_interactive_mode(self):
+ try:
+ run_shell_cmd("bash -c 'source %s/oe-init-build-env && source toaster start webport=%d && source toaster stop'" % (config.TESTDIR, config.TOASTER_PORT), config.TESTDIR)
+ except ShellCmdException as exc:
+ self.fail("Failed starting interactive mode: %s" % (exc))
+
+ def test_start_managed_mode(self):
+ try:
+ run_shell_cmd("%s/bitbake/bin/toaster webport=%d nobrowser & sleep 10 && curl http://localhost:%d/ && kill -2 %%1" % (config.TESTDIR, config.TOASTER_PORT, config.TOASTER_PORT), config.TESTDIR)
+ except ShellCmdException as exc:
+ self.fail("Failed starting managed mode: %s" % (exc))
+
+class Test02HTML5Compliance(unittest.TestCase):
+ def setUp(self):
+ self.origdir = os.getcwd()
+ self.crtdir = os.path.dirname(config.TESTDIR)
+ self.cleanup_database = False
+ os.chdir(self.crtdir)
+ if not os.path.exists(os.path.join(self.crtdir, "toaster.sqlite")):
+ self.cleanup_database = True
+ run_shell_cmd("%s/bitbake/lib/toaster/manage.py syncdb --noinput" % config.TESTDIR)
+ run_shell_cmd("%s/bitbake/lib/toaster/manage.py migrate orm" % config.TESTDIR)
+ run_shell_cmd("%s/bitbake/lib/toaster/manage.py migrate bldcontrol" % config.TESTDIR)
+ run_shell_cmd("%s/bitbake/lib/toaster/manage.py loadconf %s/meta-yocto/conf/toasterconf.json" % (config.TESTDIR, config.TESTDIR))
+ run_shell_cmd("%s/bitbake/lib/toaster/manage.py lsupdates" % config.TESTDIR)
+
+ setup = pexpect.spawn("%s/bitbake/lib/toaster/manage.py checksettings" % config.TESTDIR)
+ setup.logfile = sys.stdout
+ setup.expect(r".*or type the full path to a different directory: ")
+ setup.sendline('')
+ setup.sendline('')
+ setup.expect(r".*or type the full path to a different directory: ")
+ setup.sendline('')
+ setup.expect(r"Enter your option: ")
+ setup.sendline('0')
+
+ self.child = pexpect.spawn("bash", ["%s/bitbake/bin/toaster" % config.TESTDIR, "webport=%d" % config.TOASTER_PORT, "nobrowser"], cwd=self.crtdir)
+ self.child.logfile = sys.stdout
+ self.child.expect("Toaster is now running. You can stop it with Ctrl-C")
+
+ def test_html5_compliance(self):
+ import urllist, urlcheck
+ results = {}
+ for url in urllist.URLS:
+ results[url] = urlcheck.validate_html5(config.TOASTER_BASEURL + url)
+
+ failed = []
+ for url in results:
+ if results[url][1] != 0:
+ failed.append((url, results[url]))
+
+
+ self.assertTrue(len(failed) == 0, "Not all URLs validate: \n%s " % "\n".join(["".join(str(x)) for x in failed]))
+
+ #(config.TOASTER_BASEURL + url, status, errors, warnings))
+
+ def tearDown(self):
+ while self.child.isalive():
+ self.child.kill(signal.SIGINT)
+ time.sleep(1)
+ os.chdir(self.origdir)
+ toaster_sqlite_path = os.path.join(self.crtdir, "toaster.sqlite")
+ if self.cleanup_database and os.path.exists(toaster_sqlite_path):
+ os.remove(toaster_sqlite_path)
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/toasteruitest/run_toastertests.py b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/toasteruitest/run_toastertests.py
new file mode 100755
index 000000000..754636f0f
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/toasteruitest/run_toastertests.py
@@ -0,0 +1,155 @@
+#!/usr/bin/python
+
+# Copyright
+
+# DESCRIPTION
+# This is script for running all selected toaster cases on
+# selected web browsers manifested in toaster_test.cfg.
+
+# 1. How to start toaster in yocto:
+# $ source poky/oe-init-build-env
+# $ source toaster start
+# $ bitbake core-image-minimal
+
+# 2. How to install selenium on Ubuntu:
+# $ sudo apt-get install scrot python-pip
+# $ sudo pip install selenium
+
+# 3. How to install selenium addon in firefox:
+# Download the lastest firefox addon from http://release.seleniumhq.org/selenium-ide/
+# Then install it. You can also install firebug and firepath addon
+
+# 4. How to start writing a new case:
+# All you need to do is to implement the function test_xxx() and pile it on.
+
+# 5. How to test with Chrome browser
+# Download/install chrome on host
+# Download chromedriver from https://code.google.com/p/chromedriver/downloads/list according to your host type
+# put chromedriver in PATH, (e.g. /usr/bin/, bear in mind to chmod)
+# For windows host, you may put chromedriver.exe in the same directory as chrome.exe
+
+import unittest, sys, os, platform
+import ConfigParser
+import argparse
+from toaster_automation_test import toaster_cases
+
+
+def get_args_parser():
+ description = "Script that runs toaster auto tests."
+ parser = argparse.ArgumentParser(description=description)
+ parser.add_argument('--run-all-tests', required=False, action="store_true", dest="run_all_tests", default=False,
+ help='Run all tests.')
+ parser.add_argument('--run-suite', required=False, dest='run_suite', default=False,
+ help='run suite (defined in cfg file)')
+
+ return parser
+
+
+def get_tests():
+ testslist = []
+
+ prefix = 'toaster_automation_test.toaster_cases'
+
+ for t in dir(toaster_cases):
+ if t.startswith('test_'):
+ testslist.append('.'.join((prefix, t)))
+
+ return testslist
+
+
+def get_tests_from_cfg(suite=None):
+
+ testslist = []
+ config = ConfigParser.SafeConfigParser()
+ config.read('toaster_test.cfg')
+
+ if suite is not None:
+ target_suite = suite.lower()
+
+ # TODO: if suite is valid suite
+
+ else:
+ target_suite = platform.system().lower()
+
+ try:
+ tests_from_cfg = eval(config.get('toaster_test_' + target_suite, 'test_cases'))
+ except:
+ print 'Failed to get test cases from cfg file. Make sure the format is correct.'
+ return None
+
+ prefix = 'toaster_automation_test.toaster_cases.test_'
+ for t in tests_from_cfg:
+ testslist.append(prefix + str(t))
+
+ return testslist
+
+def main():
+
+ # In case this script is called from other directory
+ os.chdir(os.path.abspath(sys.path[0]))
+
+ parser = get_args_parser()
+ args = parser.parse_args()
+
+ if args.run_all_tests:
+ testslist = get_tests()
+ elif args.run_suite:
+ testslist = get_tests_from_cfg(args.run_suite)
+ os.environ['TOASTER_SUITE'] = args.run_suite
+ else:
+ testslist = get_tests_from_cfg()
+
+ if not testslist:
+ print 'Failed to get test cases.'
+ exit(1)
+
+ suite = unittest.TestSuite()
+ loader = unittest.TestLoader()
+ loader.sortTestMethodsUsing = None
+ runner = unittest.TextTestRunner(verbosity=2, resultclass=buildResultClass(args))
+
+ for test in testslist:
+ try:
+ suite.addTests(loader.loadTestsFromName(test))
+ except:
+ return 1
+
+ result = runner.run(suite)
+
+ if result.wasSuccessful():
+ return 0
+ else:
+ return 1
+
+
+def buildResultClass(args):
+ """Build a Result Class to use in the testcase execution"""
+
+ class StampedResult(unittest.TextTestResult):
+ """
+ Custom TestResult that prints the time when a test starts. As toaster-auto
+ can take a long time (ie a few hours) to run, timestamps help us understand
+ what tests are taking a long time to execute.
+ """
+ def startTest(self, test):
+ import time
+ self.stream.write(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + " - ")
+ super(StampedResult, self).startTest(test)
+
+ return StampedResult
+
+
+if __name__ == "__main__":
+
+ try:
+ ret = main()
+ except:
+ ret = 1
+ import traceback
+ traceback.print_exc()
+ finally:
+ if os.getenv('TOASTER_SUITE'):
+ del os.environ['TOASTER_SUITE']
+ sys.exit(ret)
+
+
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/toasteruitest/toaster_automation_test.py b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/toasteruitest/toaster_automation_test.py
new file mode 100755
index 000000000..d8f838aea
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/toasteruitest/toaster_automation_test.py
@@ -0,0 +1,2376 @@
+#!/usr/bin/python
+# Copyright
+
+# DESCRIPTION
+# This is toaster automation base class and test cases file
+
+# History:
+# 2015.03.09 inital version
+# 2015.03.23 adding toaster_test.cfg, run_toastertest.py so we can run case by case from outside
+
+# Briefs:
+# This file is comprised of 3 parts:
+# I: common utils like sorting, getting attribute.. etc
+# II: base class part, which complies with unittest frame work and
+# contains class selenium-based functions
+# III: test cases
+# to add new case: just implement new test_xxx() function in class toaster_cases
+
+# NOTES for cases:
+# case 946:
+# step 6 - 8 needs to be observed using screenshots
+# case 956:
+# step 2 - 3 needs to be run manually
+
+import unittest, time, re, sys, getopt, os, logging, string, errno, exceptions
+import shutil, argparse, ConfigParser, platform, json
+from selenium import webdriver
+from selenium.common.exceptions import NoSuchElementException
+from selenium import selenium
+from selenium.webdriver.common.by import By
+from selenium.webdriver.common.keys import Keys
+from selenium.webdriver.support.ui import Select
+import sqlite3 as sqlite
+
+
+###########################################
+# #
+# PART I: utils stuff #
+# #
+###########################################
+
+class Listattr(object):
+ """
+ Set of list attribute. This is used to determine what the list content is.
+ Later on we may add more attributes here.
+ """
+ NULL = "null"
+ NUMBERS = "numbers"
+ STRINGS = "strings"
+ PERCENT = "percentage"
+ SIZE = "size"
+ UNKNOWN = "unknown"
+
+
+def get_log_root_dir():
+ max_depth = 5
+ parent_dir = '../'
+ for number in range(0, max_depth):
+ if os.path.isdir(sys.path[0] + os.sep + (os.pardir + os.sep)*number + 'log'):
+ log_root_dir = os.path.abspath(sys.path[0] + os.sep + (os.pardir + os.sep)*number + 'log')
+ break
+
+ if number == (max_depth - 1):
+ print 'No log dir found. Please check'
+ raise Exception
+
+ return log_root_dir
+
+
+def mkdir_p(dir):
+ try:
+ os.makedirs(dir)
+ except OSError as exc:
+ if exc.errno == errno.EEXIST and os.path.isdir(dir):
+ pass
+ else:
+ raise
+
+
+def get_list_attr(testlist):
+ """
+ To determine the list content
+ """
+ if not testlist:
+ return Listattr.NULL
+ listtest = testlist[:]
+ try:
+ listtest.remove('')
+ except ValueError:
+ pass
+ pattern_percent = re.compile(r"^([0-9])+(\.)?([0-9])*%$")
+ pattern_size = re.compile(r"^([0-9])+(\.)?([0-9])*( )*(K)*(M)*(G)*B$")
+ pattern_number = re.compile(r"^([0-9])+(\.)?([0-9])*$")
+ def get_patterned_number(pattern, tlist):
+ count = 0
+ for item in tlist:
+ if re.search(pattern, item):
+ count += 1
+ return count
+ if get_patterned_number(pattern_percent, listtest) == len(listtest):
+ return Listattr.PERCENT
+ elif get_patterned_number(pattern_size, listtest) == len(listtest):
+ return Listattr.SIZE
+ elif get_patterned_number(pattern_number, listtest) == len(listtest):
+ return Listattr.NUMBERS
+ else:
+ return Listattr.STRINGS
+
+
+def is_list_sequenced(testlist):
+ """
+ Function to tell if list is sequenced
+ Currently we may have list made up of: Strings ; numbers ; percentage ; time; size
+ Each has respective way to determine if it's sequenced.
+ """
+ test_list = testlist[:]
+ try:
+ test_list.remove('')
+ except ValueError:
+ pass
+
+ if get_list_attr(testlist) == Listattr.NULL :
+ return True
+
+ elif get_list_attr(testlist) == Listattr.STRINGS :
+ return (sorted(test_list) == test_list)
+
+ elif get_list_attr(testlist) == Listattr.NUMBERS :
+ list_number = []
+ for item in test_list:
+ list_number.append(eval(item))
+ return (sorted(list_number) == list_number)
+
+ elif get_list_attr(testlist) == Listattr.PERCENT :
+ list_number = []
+ for item in test_list:
+ list_number.append(eval(item.strip('%')))
+ return (sorted(list_number) == list_number)
+
+ elif get_list_attr(testlist) == Listattr.SIZE :
+ list_number = []
+ # currently SIZE is splitted by space
+ for item in test_list:
+ if item.split()[1].upper() == "KB":
+ list_number.append(1024 * eval(item.split()[0]))
+ elif item.split()[1].upper() == "MB":
+ list_number.append(1024 * 1024 * eval(item.split()[0]))
+ elif item.split()[1].upper() == "GB":
+ list_number.append(1024 * 1024 * 1024 * eval(item.split()[0]))
+ else:
+ list_number.append(eval(item.split()[0]))
+ return (sorted(list_number) == list_number)
+
+ else:
+ print 'Unrecognized list type, please check'
+ return False
+
+
+def is_list_inverted(testlist):
+ """
+ Function to tell if list is inverted
+ Currently we may have list made up of: Strings ; numbers ; percentage ; time; size
+ Each has respective way to determine if it's inverted.
+ """
+ test_list = testlist[:]
+ try:
+ test_list.remove('')
+ except ValueError:
+ pass
+
+ if get_list_attr(testlist) == Listattr.NULL :
+ return True
+
+ elif get_list_attr(testlist) == Listattr.STRINGS :
+ return (sorted(test_list, reverse = True) == test_list)
+
+ elif get_list_attr(testlist) == Listattr.NUMBERS :
+ list_number = []
+ for item in test_list:
+ list_number.append(eval(item))
+ return (sorted(list_number, reverse = True) == list_number)
+
+ elif get_list_attr(testlist) == Listattr.PERCENT :
+ list_number = []
+ for item in test_list:
+ list_number.append(eval(item.strip('%')))
+ return (sorted(list_number, reverse = True) == list_number)
+
+ elif get_list_attr(testlist) == Listattr.SIZE :
+ list_number = []
+ # currently SIZE is splitted by space. such as 0 B; 1 KB; 2 MB
+ for item in test_list:
+ if item.split()[1].upper() == "KB":
+ list_number.append(1024 * eval(item.split()[0]))
+ elif item.split()[1].upper() == "MB":
+ list_number.append(1024 * 1024 * eval(item.split()[0]))
+ elif item.split()[1].upper() == "GB":
+ list_number.append(1024 * 1024 * 1024 * eval(item.split()[0]))
+ else:
+ list_number.append(eval(item.split()[0]))
+ return (sorted(list_number, reverse = True) == list_number)
+
+ else:
+ print 'Unrecognized list type, please check'
+ return False
+
+def replace_file_content(filename, item, option):
+ f = open(filename)
+ lines = f.readlines()
+ f.close()
+ output = open(filename, 'w')
+ for line in lines:
+ if line.startswith(item):
+ output.write(item + " = '" + option + "'\n")
+ else:
+ output.write(line)
+ output.close()
+
+def extract_number_from_string(s):
+ """
+ extract the numbers in a string. return type is 'list'
+ """
+ return re.findall(r'([0-9]+)', s)
+
+# Below is decorator derived from toaster backend test code
+class NoParsingFilter(logging.Filter):
+ def filter(self, record):
+ return record.levelno == 100
+
+def LogResults(original_class):
+ orig_method = original_class.run
+
+ from time import strftime, gmtime
+ caller = 'toaster'
+ 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')
+
+ #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(testMethod.im_class).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
+
+ for (name, msg) in result.errors:
+ if (self._testMethodName == str(name).split(' ')[0]) and (class_name in str(name).split(' ')[1]):
+ 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 (self._testMethodName == str(name).split(' ')[0]) and (class_name in str(name).split(' ')[1]):
+ 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 (self._testMethodName == str(name).split(' ')[0]) and (class_name in str(name).split(' ')[1]):
+ local_log.results("Testcase "+str(test_case)+": SKIPPED")
+ passed = False
+ if passed:
+ local_log.results("Testcase "+str(test_case)+": PASSED")
+
+ # Create symlink to the current log
+ if os.path.exists(linkfile):
+ os.remove(linkfile)
+ os.symlink(logfile, linkfile)
+
+ original_class.run = run
+
+ return original_class
+
+
+###########################################
+# #
+# PART II: base class #
+# #
+###########################################
+
+@LogResults
+class toaster_cases_base(unittest.TestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ cls.log = cls.logger_create()
+
+ def setUp(self):
+ self.screenshot_sequence = 1
+ self.verificationErrors = []
+ self.accept_next_alert = True
+ self.host_os = platform.system().lower()
+ if os.getenv('TOASTER_SUITE'):
+ self.target_suite = os.getenv('TOASTER_SUITE')
+ else:
+ self.target_suite = self.host_os
+
+ self.parser = ConfigParser.SafeConfigParser()
+ self.parser.read('toaster_test.cfg')
+ self.base_url = eval(self.parser.get('toaster_test_' + self.target_suite, 'toaster_url'))
+
+ # create log dir . Currently , we put log files in log/tmp. After all
+ # test cases are done, move them to log/$datetime dir
+ self.log_tmp_dir = os.path.abspath(sys.path[0]) + os.sep + 'log' + os.sep + 'tmp'
+ try:
+ mkdir_p(self.log_tmp_dir)
+ except OSError :
+ logging.error("%(asctime)s Cannot create tmp dir under log, please check your privilege")
+ # self.log = self.logger_create()
+ # driver setup
+ self.setup_browser()
+
+ @staticmethod
+ def logger_create():
+ log_file = "toaster-auto-" + time.strftime("%Y%m%d%H%M%S") + ".log"
+ if os.path.exists("toaster-auto.log"): os.remove("toaster-auto.log")
+ os.symlink(log_file, "toaster-auto.log")
+
+ log = logging.getLogger("toaster")
+ log.setLevel(logging.DEBUG)
+
+ fh = logging.FileHandler(filename=log_file, 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
+
+
+ def setup_browser(self, *browser_path):
+ self.browser = eval(self.parser.get('toaster_test_' + self.target_suite, 'test_browser'))
+ print self.browser
+ if self.browser == "firefox":
+ driver = webdriver.Firefox()
+ elif self.browser == "chrome":
+ driver = webdriver.Chrome()
+ elif self.browser == "ie":
+ driver = webdriver.Ie()
+ else:
+ driver = None
+ print "unrecognized browser type, please check"
+ self.driver = driver
+ self.driver.implicitly_wait(30)
+ return self.driver
+
+
+ def save_screenshot(self, **log_args):
+ """
+ This function is used to save screen either by os interface or selenium interface.
+ How to use:
+ self.save_screenshot(screenshot_type = 'native'/'selenium', log_sub_dir = 'xxx',
+ append_name = 'stepx')
+ where native means screenshot func provided by OS,
+ selenium means screenshot func provided by selenium webdriver
+ """
+ types = [log_args.get('screenshot_type')]
+ # when no screenshot_type is specified
+ if types == [None]:
+ types = ['native', 'selenium']
+ # normally append_name is used to specify which step..
+ add_name = log_args.get('append_name')
+ if not add_name:
+ add_name = '-'
+ # normally there's no need to specify sub_dir
+ sub_dir = log_args.get('log_sub_dir')
+ if not sub_dir:
+ # use casexxx as sub_dir name
+ sub_dir = 'case' + str(self.case_no)
+ for item in types:
+ log_dir = self.log_tmp_dir + os.sep + sub_dir
+ mkdir_p(log_dir)
+ log_path = log_dir + os.sep + self.browser + '-' +\
+ item + '-' + add_name + '-' + str(self.screenshot_sequence) + '.png'
+ if item == 'native':
+ if self.host_os == "linux":
+ os.system("scrot " + log_path)
+ elif self.host_os=="darwin":
+ os.system("screencapture -x " + log_path)
+ elif item == 'selenium':
+ self.driver.get_screenshot_as_file(log_path)
+ self.screenshot_sequence += 1
+
+ def browser_delay(self):
+ """
+ currently this is a workaround for some chrome test.
+ Sometimes we need a delay to accomplish some operation.
+ But for firefox, mostly we don't need this.
+ To be discussed
+ """
+ if self.browser == "chrome":
+ time.sleep(1)
+ return
+
+
+# these functions are not contained in WebDriver class..
+ def find_element_by_text(self, string):
+ return self.driver.find_element_by_xpath("//*[text()='" + string + "']")
+
+
+ def find_elements_by_text(self, string):
+ return self.driver.find_elements_by_xpath("//*[text()='" + string + "']")
+
+
+ def find_element_by_text_in_table(self, table_id, text_string):
+ """
+ This is used to search some certain 'text' in certain table
+ """
+ try:
+ table_element = self.get_table_element(table_id)
+ element = table_element.find_element_by_xpath("//*[text()='" + text_string + "']")
+ except NoSuchElementException, e:
+ print 'no element found'
+ raise
+ return element
+
+
+ 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, e:
+ print 'no element found'
+ raise
+ return element
+
+
+ def find_elements_by_link_text_in_table(self, table_id, link_text):
+ """
+ Search link-text in certain table. This helps to narrow down search area.
+ """
+ try:
+ table_element = self.get_table_element(table_id)
+ element_list = table_element.find_elements_by_link_text(link_text)
+ except NoSuchElementException, e:
+ print 'no element found'
+ raise
+ return element_list
+
+
+ def find_element_by_partial_link_text_in_table(self, table_id, link_text):
+ """
+ Search element by partial link text in certain table.
+ """
+ try:
+ table_element = self.get_table_element(table_id)
+ element = table_element.find_element_by_partial_link_text(link_text)
+ return element
+ except NoSuchElementException, e:
+ print 'no element found'
+ raise
+
+
+ def find_elements_by_partial_link_text_in_table(self, table_id, link_text):
+ """
+ Assume there're multiple suitable "find_partial_element_by_link_text".
+ """
+ try:
+ table_element = self.get_table_element(table_id)
+ element_list = table_element.find_elements_by_partial_link_text(link_text)
+ return element_list
+ except NoSuchElementException, e:
+ print 'no element found'
+ raise
+
+
+ def find_element_by_xpath_in_table(self, table_id, xpath):
+ """
+ This helps to narrow down search area. Especially useful when dealing with pop-up form.
+ """
+ try:
+ table_element = self.get_table_element(table_id)
+ element = table_element.find_element_by_xpath(xpath)
+ except NoSuchElementException, e:
+ print 'no element found'
+ raise
+ return element
+
+
+ def find_elements_by_xpath_in_table(self, table_id, xpath):
+ """
+ This helps to narrow down search area. Especially useful when dealing with pop-up form.
+ """
+ try:
+ table_element = self.get_table_element(table_id)
+ element_list = table_element.find_elements_by_xpath(xpath)
+ except NoSuchElementException, e:
+ print 'no elements found'
+ raise
+ return element_list
+
+
+ def shortest_xpath(self, pname, pvalue):
+ return "//*[@" + pname + "='" + pvalue + "']"
+
+
+#usually elements in the same column are with same class name. for instance: class="outcome" .TBD
+ def get_table_column_text(self, attr_name, attr_value):
+ c_xpath = self.shortest_xpath(attr_name, attr_value)
+ elements = self.driver.find_elements_by_xpath(c_xpath)
+ c_list = []
+ for element in elements:
+ c_list.append(element.text)
+ return c_list
+
+
+ def get_table_column_text_by_column_number(self, table_id, column_number):
+ c_xpath = "//*[@id='" + table_id + "']//td[" + str(column_number) + "]"
+ elements = self.driver.find_elements_by_xpath(c_xpath)
+ c_list = []
+ for element in elements:
+ c_list.append(element.text)
+ return c_list
+
+
+ def get_table_head_text(self, *table_id):
+#now table_id is a tuple...
+ if table_id:
+ thead_xpath = "//*[@id='" + table_id[0] + "']//thead//th[text()]"
+ elements = self.driver.find_elements_by_xpath(thead_xpath)
+ c_list = []
+ for element in elements:
+ if element.text:
+ c_list.append(element.text)
+ return c_list
+#default table on page
+ else:
+ return self.driver.find_element_by_xpath("//*/table/thead").text
+
+
+
+ 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, 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, 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, e:
+ return False
+ return element
+
+
+ def get_table_data(self, table_id, row_count, column_count):
+ row = 1
+ Lists = []
+ while row <= row_count:
+ column = 1
+ row_content=[]
+ while column <= column_count:
+ s= "//*[@id='" + table_id + "']/tbody/tr[" + str(row) +"]/td[" + str(column) + "]"
+ v = self.driver.find_element_by_xpath(s).text
+ row_content.append(v)
+ column = column + 1
+ print("row_content=",row_content)
+ Lists.extend(row_content)
+ print Lists[row-1][0]
+ row = row + 1
+ return Lists
+
+ # The is_xxx_present functions only returns True/False
+ # All the log work is done in test procedure, so we can easily trace back
+ # using logging
+ def is_text_present (self, patterns):
+ for pattern in patterns:
+ if str(pattern) not in self.driver.page_source:
+ print 'Text "'+pattern+'" is missing'
+ return False
+ return True
+
+
+ def is_element_present(self, how, what):
+ try:
+ self.driver.find_element(how, what)
+ except NoSuchElementException, e:
+ print 'Could not find element '+str(what)+' by ' + str(how)
+ return False
+ return True
+
+
+ def is_alert_present(self):
+ try: self.driver.switch_to_alert()
+ except NoAlertPresentException, e: return False
+ return True
+
+
+ def close_alert_and_get_its_text(self):
+ try:
+ alert = self.driver.switch_to_alert()
+ alert_text = alert.text
+ if self.accept_next_alert:
+ alert.accept()
+ else:
+ alert.dismiss()
+ return alert_text
+ finally: self.accept_next_alert = True
+
+
+ def get_case_number(self):
+ """
+ what case are we running now
+ """
+ funcname = sys._getframe(1).f_code.co_name
+ caseno_str = funcname.strip('test_')
+ try:
+ caseno = int(caseno_str)
+ except ValueError:
+ print "get case number error! please check if func name is test_xxx"
+ return False
+ return caseno
+
+
+ def tearDown(self):
+ self.log.info(' END: CASE %s log \n\n' % str(self.case_no))
+ self.driver.quit()
+ self.assertEqual([], self.verificationErrors)
+
+
+###################################################################
+# #
+# PART III: test cases #
+# please refer to #
+# https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=xxx #
+# #
+###################################################################
+
+# Note: to comply with the unittest framework, we call these test_xxx functions
+# from run_toastercases.py to avoid calling setUp() and tearDown() multiple times
+
+
+class toaster_cases(toaster_cases_base):
+ ##############
+ # CASE 901 #
+ ##############
+ def test_901(self):
+ # the reason why get_case_number is not in setUp function is that
+ # otherwise it returns "setUp" instead of "test_xxx"
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ # open all columns
+ self.driver.find_element_by_id("edit-columns-button").click()
+ # adding explicitly wait for chromedriver..-_-
+ self.browser_delay()
+ self.driver.find_element_by_id("started_on").click()
+ self.browser_delay()
+ self.driver.find_element_by_id("time").click()
+ self.driver.find_element_by_id("edit-columns-button").click()
+ # dict: {lint text name : actual class name}
+ table_head_dict = {'Outcome':'outcome', 'Recipe':'target', 'Machine':'machine', 'Started on':'started_on', 'Completed on':'completed_on', \
+ 'Errors':'errors_no', 'Warnings':'warnings_no', 'Time':'time'}
+ for key in table_head_dict:
+ try:
+ self.driver.find_element_by_link_text(key).click()
+ except Exception, e:
+ self.log.error("%s cannot be found on page" % key)
+ raise
+ column_list = self.get_table_column_text("class", table_head_dict[key])
+ # after 1st click, the list should be either sequenced or inverted, but we don't have a "default order" here
+ # the point is, after another click, it should be another order
+ if is_list_inverted(column_list):
+ self.driver.find_element_by_link_text(key).click()
+ column_list = self.get_table_column_text("class", table_head_dict[key])
+ self.assertTrue(is_list_sequenced(column_list), msg=("%s column not in order" % key))
+ else:
+ self.assertTrue(is_list_sequenced(column_list), msg=("%s column not sequenced" % key))
+ self.driver.find_element_by_link_text(key).click()
+ column_list = self.get_table_column_text("class", table_head_dict[key])
+ self.assertTrue(is_list_inverted(column_list), msg=("%s column not inverted" % key))
+ self.log.info("case passed")
+
+
+ ##############
+ # CASE 902 #
+ ##############
+ def test_902(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ # Could add more test patterns here in the future. Also, could search some items other than target column in future..
+ patterns = ["minimal", "sato"]
+ for pattern in patterns:
+ ori_target_column_texts = self.get_table_column_text("class", "target")
+ print ori_target_column_texts
+ self.driver.find_element_by_id("search").clear()
+ self.driver.find_element_by_id("search").send_keys(pattern)
+ self.driver.find_element_by_id("search-button").click()
+ new_target_column_texts = self.get_table_column_text("class", "target")
+ # if nothing found, we still count it as "pass"
+ if new_target_column_texts:
+ for text in new_target_column_texts:
+ self.assertTrue(text.find(pattern), msg=("%s item doesn't exist " % pattern))
+ self.driver.find_element_by_css_selector("i.icon-remove").click()
+ target_column_texts = self.get_table_column_text("class", "target")
+ self.assertTrue(ori_target_column_texts == target_column_texts, msg=("builds changed after operations"))
+
+
+ ##############
+ # CASE 903 #
+ ##############
+ def test_903(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ # when opening a new page, "started_on" is not displayed by default
+ self.driver.find_element_by_id("edit-columns-button").click()
+ # currently all the delay are for chrome driver -_-
+ self.browser_delay()
+ self.driver.find_element_by_id("started_on").click()
+ self.driver.find_element_by_id("edit-columns-button").click()
+ # step 4
+ items = ["Outcome", "Completed on", "Started on"]
+ for item in items:
+ try:
+ temp_element = self.find_element_by_text_in_table('otable', item)
+ # this is how we find "filter icon" in the same level as temp_element(where "a" means clickable, "i" means icon)
+ self.assertTrue(temp_element.find_element_by_xpath("..//*/a/i[@class='icon-filter filtered']"))
+ except Exception,e:
+ self.assertFalse(True, msg=(" %s cannot be found! %s" % (item, e)))
+ raise
+ # step 5-6
+ temp_element = self.find_element_by_link_text_in_table('otable', 'Outcome')
+ temp_element.find_element_by_xpath("..//*/a/i[@class='icon-filter filtered']").click()
+ self.browser_delay()
+ # the 2nd option, whatever it is
+ self.driver.find_element_by_xpath("(//input[@name='filter'])[2]").click()
+ # click "Apply" button
+ self.driver.find_element_by_xpath("//*[@id='filter_outcome']//*[text()='Apply']").click()
+ # save screen here
+ time.sleep(1)
+ self.save_screenshot(screenshot_type='selenium', append_name='step5')
+ temp_element = self.find_element_by_link_text_in_table('otable', 'Completed on')
+ temp_element.find_element_by_xpath("..//*/a/i[@class='icon-filter filtered']").click()
+ self.browser_delay()
+ self.driver.find_element_by_xpath("//*[@id='filter_completed_on']//*[text()='Apply']").click()
+ # save screen here to compare to previous one
+ # please note that for chrome driver, need a little break before saving
+ # screen here -_-
+ self.browser_delay()
+ self.save_screenshot(screenshot_type='selenium', append_name='step6')
+ self.driver.find_element_by_id("search").clear()
+ self.driver.find_element_by_id("search").send_keys("core-image")
+ self.driver.find_element_by_id("search-button").click()
+
+
+ ##############
+ # CASE 904 #
+ ##############
+ def test_904(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ self.driver.find_element_by_partial_link_text("core-image").click()
+ self.driver.find_element_by_link_text("Tasks").click()
+ self.table_name = 'otable'
+ # This is how we find the "default" rows-number!
+ rows_displayed = int(Select(self.driver.find_element_by_css_selector("select.pagesize")).first_selected_option.text)
+ print rows_displayed
+ self.assertTrue(self.get_table_element(self.table_name, rows_displayed), msg=("not enough rows displayed"))
+ self.assertFalse(self.get_table_element(self.table_name, rows_displayed + 1), \
+ msg=("more rows displayed than expected"))
+ # Search text box background text is "Search tasks"
+ self.assertTrue(self.driver.find_element_by_xpath("//*[@id='searchform']/*[@placeholder='Search tasks']"),\
+ msg=("background text doesn't exist"))
+
+ self.driver.find_element_by_id("search").clear()
+ self.driver.find_element_by_id("search").send_keys("busybox")
+ self.driver.find_element_by_id("search-button").click()
+ self.browser_delay()
+ self.save_screenshot(screenshot_type='selenium', append_name='step5')
+ self.driver.find_element_by_css_selector("i.icon-remove").click()
+ # Save screen here
+ self.save_screenshot(screenshot_type='selenium', append_name='step5_2')
+ self.driver.find_element_by_id("edit-columns-button").click()
+ self.driver.find_element_by_id("cpu_used").click()
+ self.driver.find_element_by_id("disk_io").click()
+ self.driver.find_element_by_id("recipe_version").click()
+ self.driver.find_element_by_id("time_taken").click()
+ self.driver.find_element_by_id("edit-columns-button").click()
+ # The operation is the same as case901
+ # dict: {lint text name : actual class name}
+ table_head_dict = {'Order':'order', 'Recipe':'recipe_name', 'Task':'task_name', 'Executed':'executed', \
+ 'Outcome':'outcome', 'Cache attempt':'cache_attempt', 'Time (secs)':'time_taken', 'CPU usage':'cpu_used', \
+ 'Disk I/O (ms)':'disk_io'}
+ for key in table_head_dict:
+ # This is tricky here: we are doing so because there may be more than 1
+ # same-name link_text in one page. So we only find element inside the table
+ self.find_element_by_link_text_in_table(self.table_name, key).click()
+ column_list = self.get_table_column_text("class", table_head_dict[key])
+ # after 1st click, the list should be either sequenced or inverted, but we don't have a "default order" here
+ # the point is, after another click, it should be another order
+ # the first case is special:this means every item in column_list is the same, so
+ # after one click, either sequenced or inverted will be fine
+ if (is_list_inverted(column_list) and is_list_sequenced(column_list)) \
+ or (not column_list) :
+ self.find_element_by_link_text_in_table(self.table_name, key).click()
+ column_list = self.get_table_column_text("class", table_head_dict[key])
+ self.assertTrue(is_list_sequenced(column_list) or is_list_inverted(column_list), \
+ msg=("%s column not in any order" % key))
+ elif is_list_inverted(column_list):
+ self.find_element_by_link_text_in_table(self.table_name, key).click()
+ column_list = self.get_table_column_text("class", table_head_dict[key])
+ self.assertTrue(is_list_sequenced(column_list), msg=("%s column not in order" % key))
+ else:
+ self.assertTrue(is_list_sequenced(column_list), msg=("%s column not in order" % key))
+ self.find_element_by_link_text_in_table(self.table_name, key).click()
+ column_list = self.get_table_column_text("class", table_head_dict[key])
+ self.assertTrue(is_list_inverted(column_list), msg=("%s column not inverted" % key))
+ # step 8-10
+ # filter dict: {link text name : filter table name in xpath}
+ filter_dict = {'Executed':'filter_executed', 'Outcome':'filter_outcome', 'Cache attempt':'filter_cache_attempt'}
+ for key in filter_dict:
+ temp_element = self.find_element_by_link_text_in_table(self.table_name, key)
+ # find the filter icon besides it.
+ # And here we must have break (1 sec) to get the popup stuff
+ temp_element.find_element_by_xpath("..//*[@class='icon-filter filtered']").click()
+ self.browser_delay()
+ avail_options = self.driver.find_elements_by_xpath("//*[@id='" + filter_dict[key] + "']//*[@name='filter'][not(@disabled)]")
+ for number in range(0, len(avail_options)):
+ avail_options[number].click()
+ self.browser_delay()
+ # click "Apply"
+ self.driver.find_element_by_xpath("//*[@id='" + filter_dict[key] + "']//*[@type='submit']").click()
+ # insert screen capture here
+ self.browser_delay()
+ self.save_screenshot(screenshot_type='selenium', append_name='step8')
+ # after the last option was clicked, we don't need operation below anymore
+ if number < len(avail_options)-1:
+ try:
+ temp_element = self.find_element_by_link_text_in_table(self.table_name, key)
+ temp_element.find_element_by_xpath("..//*[@class='icon-filter filtered']").click()
+ avail_options = self.driver.find_elements_by_xpath("//*[@id='" + filter_dict[key] + "']//*[@name='filter'][not(@disabled)]")
+ except:
+ print "in exception"
+ self.find_element_by_text("Show all tasks").click()
+# self.driver.find_element_by_xpath("//*[@id='searchform']/button[2]").click()
+ temp_element = self.find_element_by_link_text_in_table(self.table_name, key)
+ temp_element.find_element_by_xpath("..//*[@class='icon-filter filtered']").click()
+ avail_options = self.driver.find_elements_by_xpath("//*[@id='" + filter_dict[key] + "']//*[@name='filter'][not(@disabled)]")
+ self.browser_delay()
+ # step 11
+ for item in ['order', 'task_name', 'executed', 'outcome', 'recipe_name', 'recipe_version']:
+ try:
+ self.find_element_by_xpath_in_table(self.table_name, "./tbody/tr[1]/*[@class='" + item + "']/a").click()
+ except NoSuchElementException, e:
+ # let it go...
+ print 'no item in the colum' + item
+ # insert screen shot here
+ self.save_screenshot(screenshot_type='selenium', append_name='step11')
+ self.driver.back()
+ # step 12-14
+ # about test_dict: please refer to testcase 904 requirement step 12-14
+ test_dict = {
+ 'Time':{
+ 'class':'time_taken',
+ 'check_head_list':['Recipe', 'Task', 'Executed', 'Outcome', 'Time (secs)'],
+ 'check_column_list':['cpu_used', 'cache_attempt', 'disk_io', 'order', 'recipe_version']
+ },
+ 'CPU usage':{
+ 'class':'cpu_used',
+ 'check_head_list':['Recipe', 'Task', 'Executed', 'Outcome', 'CPU usage'],
+ 'check_column_list':['cache_attempt', 'disk_io', 'order', 'recipe_version', 'time_taken']
+ },
+ 'Disk I/O':{
+ 'class':'disk_io',
+ 'check_head_list':['Recipe', 'Task', 'Executed', 'Outcome', 'Disk I/O (ms)'],
+ 'check_column_list':['cpu_used', 'cache_attempt', 'order', 'recipe_version', 'time_taken']
+ }
+ }
+ for key in test_dict:
+ self.find_element_by_partial_link_text_in_table('nav', 'core-image').click()
+ self.find_element_by_link_text_in_table('nav', key).click()
+ head_list = self.get_table_head_text('otable')
+ for item in test_dict[key]['check_head_list']:
+ self.assertTrue(item in head_list, msg=("%s not in head row" % item))
+ column_list = self.get_table_column_text('class', test_dict[key]['class'])
+ self.assertTrue(is_list_inverted(column_list), msg=("%s column not inverted" % key))
+
+ self.driver.find_element_by_id("edit-columns-button").click()
+ for item2 in test_dict[key]['check_column_list']:
+ self.driver.find_element_by_id(item2).click()
+ self.driver.find_element_by_id("edit-columns-button").click()
+ # TBD: save screen here
+
+
+ ##############
+ # CASE 906 #
+ ##############
+ def test_906(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ self.driver.find_element_by_link_text("core-image-minimal").click()
+ self.find_element_by_link_text_in_table('nav', 'Packages').click()
+ # find "bash" in first column (Packages)
+ self.driver.find_element_by_xpath("//*[@id='otable']//td[1]//*[text()='bash']").click()
+ # save sceen here to observe...
+ # step 6
+ self.driver.find_element_by_partial_link_text("Generated files").click()
+ head_list = self.get_table_head_text('otable')
+ for item in ['File', 'Size']:
+ self.assertTrue(item in head_list, msg=("%s not in head row" % item))
+ c_list = self.get_table_column_text('class', 'path')
+ self.assertTrue(is_list_sequenced(c_list), msg=("column not in order"))
+ # step 7
+ self.driver.find_element_by_partial_link_text("Runtime dependencies").click()
+ # save sceen here to observe...
+ # note that here table name is not 'otable'
+ head_list = self.get_table_head_text('dependencies')
+ for item in ['Package', 'Version', 'Size']:
+ self.assertTrue(item in head_list, msg=("%s not in head row" % item))
+ c_list = self.get_table_column_text_by_column_number('dependencies', 1)
+ self.assertTrue(is_list_sequenced(c_list), msg=("list not in order"))
+ texts = ['Size', 'License', 'Recipe', 'Recipe version', 'Layer', \
+ 'Layer commit']
+ self.failUnless(self.is_text_present(texts))
+
+
+ ##############
+ # CASE 910 #
+ ##############
+ def test_910(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ image_type="core-image-minimal"
+ test_package1="busybox"
+ test_package2="lib"
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ self.driver.find_element_by_link_text(image_type).click()
+ self.driver.find_element_by_link_text("Recipes").click()
+ self.save_screenshot(screenshot_type='selenium', append_name='step3')
+
+ self.table_name = 'otable'
+ # This is how we find the "default" rows-number!
+ rows_displayed = int(Select(self.driver.find_element_by_css_selector("select.pagesize")).first_selected_option.text)
+ print rows_displayed
+ self.assertTrue(self.get_table_element(self.table_name, rows_displayed))
+ self.assertFalse(self.get_table_element(self.table_name, rows_displayed + 1))
+
+ # Check the default table is sorted by Recipe
+ tasks_column_count = len(self.driver.find_elements_by_xpath("/html/body/div[2]/div/div[2]/div[2]/table/tbody/tr/td[1]"))
+ print tasks_column_count
+ default_column_list = self.get_table_column_text_by_column_number(self.table_name, 1)
+ #print default_column_list
+
+ self.assertTrue(is_list_sequenced(default_column_list))
+
+ # Search text box background text is "Search recipes"
+ self.assertTrue(self.driver.find_element_by_xpath("//*[@id='searchform']/*[@placeholder='Search recipes']"))
+
+ self.driver.find_element_by_id("search").clear()
+ self.driver.find_element_by_id("search").send_keys(test_package1)
+ self.driver.find_element_by_id("search-button").click()
+ # Save screen here
+ self.save_screenshot(screenshot_type='selenium', append_name='step4')
+ self.driver.find_element_by_css_selector("i.icon-remove").click()
+ self.save_screenshot(screenshot_type='selenium', append_name='step4_2')
+
+ self.driver.find_element_by_id("edit-columns-button").click()
+ self.driver.find_element_by_id("depends_on").click()
+ self.driver.find_element_by_id("layer_version__branch").click()
+ self.driver.find_element_by_id("layer_version__layer__commit").click()
+ self.driver.find_element_by_id("depends_by").click()
+ self.driver.find_element_by_id("edit-columns-button").click()
+
+ self.find_element_by_link_text_in_table(self.table_name, 'Recipe').click()
+ # Check the inverted table by Recipe
+ # Recipe doesn't have class name
+ #inverted_tasks_column_count = len(self.driver.find_elements_by_xpath("/html/body/div[2]/div/div[2]/div[2]/table/tbody/tr/td[1]"))
+ #print inverted_tasks_column_count
+ #inverted_column_list = self.get_table_column_text_by_column_number(self.table_name, 1)
+ #print inverted_column_list
+
+ #self.driver.find_element_by_partial_link_text("zlib").click()
+ #self.driver.back()
+ #self.assertTrue(is_list_inverted(inverted_column_list))
+ #self.find_element_by_link_text_in_table(self.table_name, 'Recipe').click()
+
+ table_head_dict = {'Recipe':'recipe__name', 'Recipe file':'recipe_file', 'Section':'recipe_section', \
+ 'License':'recipe_license', 'Layer':'layer_version__layer__name', \
+ 'Layer branch':'layer_version__branch'}
+ for key in table_head_dict:
+ self.find_element_by_link_text_in_table(self.table_name, key).click()
+ column_list = self.get_table_column_text("class", table_head_dict[key])
+ if (is_list_inverted(column_list) and is_list_sequenced(column_list)) \
+ or (not column_list) :
+ self.find_element_by_link_text_in_table(self.table_name, key).click()
+ column_list = self.get_table_column_text("class", table_head_dict[key])
+ self.assertTrue(is_list_sequenced(column_list) or is_list_inverted(column_list))
+ self.driver.find_element_by_partial_link_text("acl").click()
+ self.driver.back()
+ self.assertTrue(is_list_sequenced(column_list) or is_list_inverted(column_list))
+ # Search text box background text is "Search recipes"
+ self.assertTrue(self.driver.find_element_by_xpath("//*[@id='searchform']/*[@placeholder='Search recipes']"))
+ self.driver.find_element_by_id("search").clear()
+ self.driver.find_element_by_id("search").send_keys(test_package2)
+ self.driver.find_element_by_id("search-button").click()
+ column_search_list = self.get_table_column_text("class", table_head_dict[key])
+ self.assertTrue(is_list_sequenced(column_search_list) or is_list_inverted(column_search_list))
+ self.driver.find_element_by_css_selector("i.icon-remove").click()
+ elif is_list_inverted(column_list):
+ self.find_element_by_link_text_in_table(self.table_name, key).click()
+ column_list = self.get_table_column_text("class", table_head_dict[key])
+ self.assertTrue(is_list_sequenced(column_list))
+ self.driver.find_element_by_partial_link_text("acl").click()
+ self.driver.back()
+ self.assertTrue(is_list_sequenced(column_list))
+ # Search text box background text is "Search recipes"
+ self.assertTrue(self.driver.find_element_by_xpath("//*[@id='searchform']/*[@placeholder='Search recipes']"))
+ self.driver.find_element_by_id("search").clear()
+ self.driver.find_element_by_id("search").send_keys(test_package2)
+ self.driver.find_element_by_id("search-button").click()
+ column_search_list = self.get_table_column_text("class", table_head_dict[key])
+ self.assertTrue(is_list_sequenced(column_search_list))
+ self.driver.find_element_by_css_selector("i.icon-remove").click()
+ else:
+ self.assertTrue(is_list_sequenced(column_list), msg=("list %s not sequenced" % key))
+ self.find_element_by_link_text_in_table(self.table_name, key).click()
+ column_list = self.get_table_column_text("class", table_head_dict[key])
+ self.assertTrue(is_list_inverted(column_list))
+ try:
+ self.driver.find_element_by_partial_link_text("acl").click()
+ except:
+ self.driver.find_element_by_partial_link_text("zlib").click()
+ self.driver.back()
+ self.assertTrue(is_list_inverted(column_list))
+ # Search text box background text is "Search recipes"
+ self.assertTrue(self.driver.find_element_by_xpath("//*[@id='searchform']/*[@placeholder='Search recipes']"))
+ self.driver.find_element_by_id("search").clear()
+ self.driver.find_element_by_id("search").send_keys(test_package2)
+ self.driver.find_element_by_id("search-button").click()
+ column_search_list = self.get_table_column_text("class", table_head_dict[key])
+ #print column_search_list
+ self.assertTrue(is_list_inverted(column_search_list))
+ self.driver.find_element_by_css_selector("i.icon-remove").click()
+
+ # Bug 5919
+ for key in table_head_dict:
+ print key
+ self.find_element_by_link_text_in_table(self.table_name, key).click()
+ self.driver.find_element_by_id("edit-columns-button").click()
+ self.driver.find_element_by_id(table_head_dict[key]).click()
+ self.driver.find_element_by_id("edit-columns-button").click()
+ self.browser_delay()
+ # After hide the column, the default table should be sorted by Recipe
+ tasks_column_count = len(self.driver.find_elements_by_partial_link_text("acl"))
+ #print tasks_column_count
+ default_column_list = self.get_table_column_text_by_column_number(self.table_name, 1)
+ #print default_column_list
+ self.assertTrue(is_list_sequenced(default_column_list))
+
+ self.driver.find_element_by_id("edit-columns-button").click()
+ self.driver.find_element_by_id("recipe_file").click()
+ self.driver.find_element_by_id("recipe_section").click()
+ self.driver.find_element_by_id("recipe_license").click()
+ self.driver.find_element_by_id("layer_version__layer__name").click()
+ self.driver.find_element_by_id("edit-columns-button").click()
+
+
+ ##############
+ # CASE 911 #
+ ##############
+ def test_911(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ self.driver.find_element_by_link_text("core-image-minimal").click()
+ self.find_element_by_link_text_in_table('nav', 'Recipes').click()
+ # step 3-5
+ self.driver.find_element_by_id("search").clear()
+ self.driver.find_element_by_id("search").send_keys("lib")
+ self.driver.find_element_by_id("search-button").click()
+ # save screen here for observation
+ self.save_screenshot(screenshot_type='selenium', append_name='step5')
+ # step 6
+ self.driver.find_element_by_css_selector("i.icon-remove").click()
+ self.driver.find_element_by_id("search").clear()
+ # we deliberately want "no result" here
+ self.driver.find_element_by_id("search").send_keys("no such input")
+ self.driver.find_element_by_id("search-button").click()
+ try:
+ self.find_element_by_text("Show all recipes").click()
+ except:
+ self.fail(msg='Could not identify blank page elements')
+
+ ##############
+ # CASE 912 #
+ ##############
+ def test_912(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ self.driver.find_element_by_link_text("core-image-minimal").click()
+ self.find_element_by_link_text_in_table('nav', 'Recipes').click()
+ # step 3
+ head_list = self.get_table_head_text('otable')
+ for item in ['Recipe', 'Recipe version', 'Recipe file', 'Section', 'License', 'Layer']:
+ self.assertTrue(item in head_list, msg=("item %s not in head row" % item))
+ self.driver.find_element_by_id("edit-columns-button").click()
+ self.driver.find_element_by_id("depends_on").click()
+ self.driver.find_element_by_id("layer_version__branch").click()
+ self.driver.find_element_by_id("layer_version__layer__commit").click()
+ self.driver.find_element_by_id("depends_by").click()
+ self.driver.find_element_by_id("edit-columns-button").click()
+ # check if columns selected above is shown
+ check_list = ['Dependencies', 'Layer branch', 'Layer commit', 'Reverse dependencies']
+ head_list = self.get_table_head_text('otable')
+ time.sleep(2)
+ print head_list
+ for item in check_list:
+ self.assertTrue(item in head_list, msg=("item %s not in head row" % item))
+ # un-check 'em all
+ self.driver.find_element_by_id("edit-columns-button").click()
+ self.driver.find_element_by_id("depends_on").click()
+ self.driver.find_element_by_id("layer_version__branch").click()
+ self.driver.find_element_by_id("layer_version__layer__commit").click()
+ self.driver.find_element_by_id("depends_by").click()
+ self.driver.find_element_by_id("edit-columns-button").click()
+ # don't exist any more
+ head_list = self.get_table_head_text('otable')
+ for item in check_list:
+ self.assertFalse(item in head_list, msg=("item %s should not be in head row" % item))
+
+
+ ##############
+ # CASE 913 #
+ ##############
+ def test_913(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ self.driver.find_element_by_link_text("core-image-minimal").click()
+ self.find_element_by_link_text_in_table('nav', 'Recipes').click()
+ # step 3
+ head_list = self.get_table_head_text('otable')
+ for item in ['Recipe', 'Recipe version', 'Recipe file', 'Section', 'License', 'Layer']:
+ self.assertTrue(item in head_list, msg=("item %s not in head row" % item))
+ # step 4
+ self.driver.find_element_by_id("edit-columns-button").click()
+ # save screen
+ self.browser_delay()
+ self.save_screenshot(screenshot_type='selenium', append_name='step4')
+ self.driver.find_element_by_id("edit-columns-button").click()
+
+
+ ##############
+ # CASE 914 #
+ ##############
+ def test_914(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ image_type="core-image-minimal"
+ test_package1="busybox"
+ test_package2="gdbm"
+ test_package3="gettext-native"
+ driver = self.driver
+ driver.maximize_window()
+ driver.get(self.base_url)
+ driver.find_element_by_link_text(image_type).click()
+ driver.find_element_by_link_text("Recipes").click()
+ driver.find_element_by_link_text(test_package1).click()
+
+ self.table_name = 'information'
+
+ tasks_row_count = len(driver.find_elements_by_xpath("//*[@id='"+self.table_name+"']/table/tbody/tr/td[1]"))
+ tasks_column_count = len(driver.find_elements_by_xpath("//*[@id='"+self.table_name+"']/table/tbody/tr[1]/td"))
+ print 'rows: '+str(tasks_row_count)
+ print 'columns: '+str(tasks_column_count)
+
+ Tasks_column = self.get_table_column_text_by_column_number(self.table_name, 2)
+ print ("Tasks_column=", Tasks_column)
+
+ key_tasks=["do_fetch", "do_unpack", "do_patch", "do_configure", "do_compile", "do_install", "do_package", "do_build"]
+ i = 0
+ while i < len(key_tasks):
+ if key_tasks[i] not in Tasks_column:
+ print ("Error! Missing key task: %s" % key_tasks[i])
+ else:
+ print ("%s is in tasks" % key_tasks[i])
+ i = i + 1
+
+ if Tasks_column.index(key_tasks[0]) != 0:
+ print ("Error! %s is not in the right position" % key_tasks[0])
+ else:
+ print ("%s is in right position" % key_tasks[0])
+
+ if Tasks_column[-1] != key_tasks[-1]:
+ print ("Error! %s is not in the right position" % key_tasks[-1])
+ else:
+ print ("%s is in right position" % key_tasks[-1])
+
+ driver.find_element_by_partial_link_text("Packages (").click()
+ packages_name = driver.find_element_by_partial_link_text("Packages (").text
+ print packages_name
+ packages_num = int(filter(str.isdigit, repr(packages_name)))
+ print packages_num
+
+ #switch the table to show more than 10 rows at a time
+ self.driver.find_element_by_xpath("//*[@id='packages-built']/div[1]/div/select").click()
+ Select(driver.find_element_by_xpath("//*[@id='packages-built']/div[1]/div/select")).select_by_value('150')
+ self.driver.find_element_by_xpath("//*[@id='packages-built']/div[1]/div/select").send_keys(Keys.ENTER)
+
+ packages_row_count = len(driver.find_elements_by_xpath("//*[@id='otable']/tbody/tr/td[1]"))
+ print packages_row_count
+
+ if packages_num != packages_row_count:
+ print ("Error! The packages number is not correct")
+ else:
+ print ("The packages number is correct")
+
+ driver.find_element_by_partial_link_text("Build dependencies (").click()
+ depends_name = driver.find_element_by_partial_link_text("Build dependencies (").text
+ print depends_name
+ depends_num = int(filter(str.isdigit, repr(depends_name)))
+ print depends_num
+
+ if depends_num == 0:
+ depends_message = repr(driver.find_element_by_css_selector("div.alert.alert-info").text)
+ print depends_message
+ if depends_message.find("has no build dependencies.") < 0:
+ print ("Error! The message isn't expected.")
+ else:
+ print ("The message is expected")
+ else:
+ depends_row_count = len(driver.find_elements_by_xpath("//*[@id='dependencies']/table/tbody/tr/td[1]"))
+ print depends_row_count
+ if depends_num != depends_row_count:
+ print ("Error! The dependent packages number is not correct")
+ else:
+ print ("The dependent packages number is correct")
+
+ driver.find_element_by_partial_link_text("Reverse build dependencies (").click()
+ rdepends_name = driver.find_element_by_partial_link_text("Reverse build dependencies (").text
+ print rdepends_name
+ rdepends_num = int(filter(str.isdigit, repr(rdepends_name)))
+ print rdepends_num
+
+ if rdepends_num == 0:
+ rdepends_message = repr(driver.find_element_by_css_selector("#brought-in-by > div.alert.alert-info").text)
+ print rdepends_message
+ if rdepends_message.find("has no reverse build dependencies.") < 0:
+ print ("Error! The message isn't expected.")
+ else:
+ print ("The message is expected")
+ else:
+ print ("The reverse dependent packages number is correct")
+
+ driver.find_element_by_link_text("Recipes").click()
+ driver.find_element_by_link_text(test_package2).click()
+ driver.find_element_by_partial_link_text("Packages (").click()
+ driver.find_element_by_partial_link_text("Build dependencies (").click()
+ driver.find_element_by_partial_link_text("Reverse build dependencies (").click()
+
+
+ driver.find_element_by_link_text("Recipes").click()
+ driver.find_element_by_link_text(test_package3).click()
+
+ native_tasks_row_count = len(driver.find_elements_by_xpath("//*[@id='information']/table/tbody/tr/td[1]"))
+ native_tasks_column_count = len(driver.find_elements_by_xpath("//*[@id='information']/table/tbody/tr[1]/td"))
+ print native_tasks_row_count
+ print native_tasks_column_count
+
+ Native_Tasks_column = self.get_table_column_text_by_column_number(self.table_name, 2)
+ print ("Native_Tasks_column=", Native_Tasks_column)
+
+ native_key_tasks=["do_fetch", "do_unpack", "do_patch", "do_configure", "do_compile", "do_install", "do_build"]
+ i = 0
+ while i < len(native_key_tasks):
+ if native_key_tasks[i] not in Native_Tasks_column:
+ print ("Error! Missing key task: %s" % native_key_tasks[i])
+ else:
+ print ("%s is in tasks" % native_key_tasks[i])
+ i = i + 1
+
+ if Native_Tasks_column.index(native_key_tasks[0]) != 0:
+ print ("Error! %s is not in the right position" % native_key_tasks[0])
+ else:
+ print ("%s is in right position" % native_key_tasks[0])
+
+ if Native_Tasks_column[-1] != native_key_tasks[-1]:
+ print ("Error! %s is not in the right position" % native_key_tasks[-1])
+ else:
+ print ("%s is in right position" % native_key_tasks[-1])
+
+ driver.find_element_by_partial_link_text("Packages (").click()
+ native_packages_name = driver.find_element_by_partial_link_text("Packages (").text
+ print native_packages_name
+ native_packages_num = int(filter(str.isdigit, repr(native_packages_name)))
+ print native_packages_num
+
+ if native_packages_num != 0:
+ print ("Error! Native task shouldn't have any packages.")
+ else:
+ native_package_message = repr(driver.find_element_by_css_selector("#packages-built > div.alert.alert-info").text)
+ print native_package_message
+ if native_package_message.find("does not build any packages.") < 0:
+ print ("Error! The message for native task isn't expected.")
+ else:
+ print ("The message for native task is expected.")
+
+ driver.find_element_by_partial_link_text("Build dependencies (").click()
+ native_depends_name = driver.find_element_by_partial_link_text("Build dependencies (").text
+ print native_depends_name
+ native_depends_num = int(filter(str.isdigit, repr(native_depends_name)))
+ print native_depends_num
+
+ native_depends_row_count = len(driver.find_elements_by_xpath("//*[@id='dependencies']/table/tbody/tr/td[1]"))
+ print native_depends_row_count
+
+ if native_depends_num != native_depends_row_count:
+ print ("Error! The dependent packages number is not correct")
+ else:
+ print ("The dependent packages number is correct")
+
+ driver.find_element_by_partial_link_text("Reverse build dependencies (").click()
+ native_rdepends_name = driver.find_element_by_partial_link_text("Reverse build dependencies (").text
+ print native_rdepends_name
+ native_rdepends_num = int(filter(str.isdigit, repr(native_rdepends_name)))
+ print native_rdepends_num
+
+ native_rdepends_row_count = len(driver.find_elements_by_xpath("//*[@id='brought-in-by']/table/tbody/tr/td[1]"))
+ print native_rdepends_row_count
+
+ if native_rdepends_num != native_rdepends_row_count:
+ print ("Error! The reverse dependent packages number is not correct")
+ else:
+ print ("The reverse dependent packages number is correct")
+
+ driver.find_element_by_link_text("Recipes").click()
+
+
+ ##############
+ # CASE 915 #
+ ##############
+ def test_915(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ self.driver.find_element_by_link_text("core-image-minimal").click()
+ # step 3
+ self.find_element_by_link_text_in_table('nav', 'Configuration').click()
+ self.driver.find_element_by_link_text("BitBake variables").click()
+ # step 4
+ self.driver.find_element_by_id("search").clear()
+ self.driver.find_element_by_id("search").send_keys("lib")
+ self.driver.find_element_by_id("search-button").click()
+ # save screen to see result
+ self.browser_delay()
+ self.save_screenshot(screenshot_type='selenium', append_name='step4')
+ # step 5
+ self.driver.find_element_by_css_selector("i.icon-remove").click()
+ head_list = self.get_table_head_text('otable')
+ print head_list
+ print len(head_list)
+ self.assertTrue(head_list == ['Variable', 'Value', 'Set in file', 'Description'], \
+ msg=("head row contents wrong"))
+ # step 8
+ # search other string. and click "Variable" to re-sort, check if table
+ # head is still the same
+ self.driver.find_element_by_id("search").clear()
+ self.driver.find_element_by_id("search").send_keys("poky")
+ self.driver.find_element_by_id("search-button").click()
+ self.find_element_by_link_text_in_table('otable', 'Variable').click()
+ head_list = self.get_table_head_text('otable')
+ self.assertTrue(head_list == ['Variable', 'Value', 'Set in file', 'Description'], \
+ msg=("head row contents wrong"))
+ self.find_element_by_link_text_in_table('otable', 'Variable').click()
+ head_list = self.get_table_head_text('otable')
+ self.assertTrue(head_list == ['Variable', 'Value', 'Set in file', 'Description'], \
+ msg=("head row contents wrong"))
+
+
+ ##############
+ # CASE 916 #
+ ##############
+ def test_916(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ self.driver.find_element_by_link_text("core-image-minimal").click()
+ # step 2-3
+ self.find_element_by_link_text_in_table('nav', 'Configuration').click()
+ self.driver.find_element_by_link_text("BitBake variables").click()
+ variable_list = self.get_table_column_text('class', 'variable_name')
+ self.assertTrue(is_list_sequenced(variable_list), msg=("list not in order"))
+ # step 4
+ self.find_element_by_link_text_in_table('otable', 'Variable').click()
+ variable_list = self.get_table_column_text('class', 'variable_name')
+ self.assertTrue(is_list_inverted(variable_list), msg=("list not inverted"))
+ self.find_element_by_link_text_in_table('otable', 'Variable').click()
+ # step 5
+ # searching won't change the sequentiality
+ self.driver.find_element_by_id("search").clear()
+ self.driver.find_element_by_id("search").send_keys("lib")
+ self.driver.find_element_by_id("search-button").click()
+ variable_list = self.get_table_column_text('class', 'variable_name')
+ self.assertTrue(is_list_sequenced(variable_list), msg=("list not in order"))
+
+
+ ##############
+ # CASE 923 #
+ ##############
+ def test_923(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ # Step 2
+ # default sequence in "Completed on" column is inverted
+ c_list = self.get_table_column_text('class', 'completed_on')
+ self.assertTrue(is_list_inverted(c_list), msg=("list not inverted"))
+ # step 3
+ self.driver.find_element_by_id("edit-columns-button").click()
+ self.driver.find_element_by_id("started_on").click()
+ self.driver.find_element_by_id("time").click()
+ self.driver.find_element_by_id("edit-columns-button").click()
+ head_list = self.get_table_head_text('otable')
+ for item in ['Outcome', 'Recipe', 'Machine', 'Started on', 'Completed on', 'Failed tasks', 'Errors', 'Warnings', 'Time', "Image files", "Project"]:
+ self.failUnless(item in head_list, msg=item+' is missing from table head.')
+
+
+ ##############
+ # CASE 924 #
+ ##############
+ def test_924(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ # Please refer to case 924 requirement
+ # default sequence in "Completed on" column is inverted
+ c_list = self.get_table_column_text('class', 'completed_on')
+ self.assertTrue(is_list_inverted(c_list), msg=("list not inverted"))
+ # Step 4
+ # click Errors , order in "Completed on" should be disturbed. Then hide
+ # error column to check if order in "Completed on" can be restored
+#THIS TEST IS NO LONGER VALID DUE TO DESIGN CHANGES. LEAVING IN PENDING UPDATES TO DESIGN
+ #self.find_element_by_link_text_in_table('otable', 'Errors').click()
+ #self.driver.find_element_by_id("edit-columns-button").click()
+ #self.driver.find_element_by_id("errors_no").click()
+ #self.driver.find_element_by_id("edit-columns-button").click()
+ # Note: without time.sleep here, there'll be unpredictable error..TBD
+ time.sleep(1)
+ c_list = self.get_table_column_text('class', 'completed_on')
+ self.assertTrue(is_list_inverted(c_list), msg=("list not inverted"))
+
+
+ ##############
+ # CASE 940 #
+ ##############
+ def test_940(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ self.driver.find_element_by_link_text("core-image-minimal").click()
+ # Step 2-3
+ self.find_element_by_link_text_in_table('nav', 'Packages').click()
+ check_head_list = ['Package', 'Package version', 'Size', 'Recipe']
+ head_list = self.get_table_head_text('otable')
+ self.assertTrue(head_list == check_head_list, msg=("head row not as expected"))
+ # Step 4
+ # pulldown menu
+ option_ids = ['recipe__layer_version__layer__name', 'recipe__layer_version__branch', \
+ 'recipe__layer_version__layer__commit', 'license', 'recipe__version']
+ self.driver.find_element_by_id("edit-columns-button").click()
+ for item in option_ids:
+ if not self.driver.find_element_by_id(item).is_selected():
+ self.driver.find_element_by_id(item).click()
+ self.driver.find_element_by_id("edit-columns-button").click()
+ # save screen here to observe that 'Package' and 'Package version' is
+ # not selectable
+ self.browser_delay()
+ self.save_screenshot(screenshot_type='selenium', append_name='step4')
+
+
+ ##############
+ # CASE 941 #
+ ##############
+ def test_941(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ self.driver.find_element_by_link_text("core-image-minimal").click()
+ # Step 2-3
+ self.find_element_by_link_text_in_table('nav', 'Packages').click()
+ # column -- Package
+ column_list = self.get_table_column_text_by_column_number('otable', 1)
+ self.assertTrue(is_list_sequenced(column_list), msg=("list not in order"))
+ self.find_element_by_link_text_in_table('otable', 'Size').click()
+
+
+ ##############
+ # CASE 942 #
+ ##############
+ def test_942(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ self.driver.find_element_by_link_text("core-image-minimal").click()
+ self.driver.find_element_by_link_text("Packages").click()
+ #get initial table header
+ head_list = self.get_table_head_text('otable')
+ #remove the Recipe column from table header
+ self.driver.find_element_by_id("edit-columns-button").click()
+ self.driver.find_element_by_id("recipe__name").click()
+ self.driver.find_element_by_id("edit-columns-button").click()
+ #get modified table header
+ new_head = self.get_table_head_text('otable')
+ self.assertTrue(head_list > new_head)
+
+ ##############
+ # CASE 943 #
+ ##############
+ def test_943(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ self.driver.find_element_by_link_text("core-image-minimal").click()
+ self.driver.find_element_by_link_text("Packages").click()
+ #search for the "bash" package -> this should definitely be present
+ self.driver.find_element_by_id("search").clear()
+ self.driver.find_element_by_id("search").send_keys("bash")
+ self.driver.find_element_by_id("search-button").click()
+ #check for the search result message "XX packages found"
+ self.assertTrue(self.is_text_present("packages found"), msg=("no packages found text"))
+
+
+ ##############
+ # CASE 944 #
+ ##############
+ def test_944(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ self.driver.find_element_by_link_text("core-image-minimal").click()
+ # step 1: test Recipes page stuff
+ self.driver.find_element_by_link_text("Recipes").click()
+ # for these 3 items, default status is not-checked
+ self.driver.find_element_by_id("edit-columns-button").click()
+ self.driver.find_element_by_id("layer_version__branch").click()
+ self.driver.find_element_by_id("layer_version__layer__commit").click()
+ self.driver.find_element_by_id("edit-columns-button").click()
+ # otable is the recipes table here
+ otable_head_text = self.get_table_head_text('otable')
+ for item in ["Layer", "Layer branch", "Layer commit"]:
+ self.failIf(item not in otable_head_text, msg=item+' not in table head.')
+ # click the fist recipe, whatever it is
+ self.get_table_element("otable", 1, 1).click()
+ self.assertTrue(self.is_text_present(["Layer", "Layer branch", "Layer commit", "Recipe file"]), \
+ msg=("text not in web page"))
+
+ # step 2: test Packages page stuff. almost same as above
+ self.driver.back()
+ self.browser_delay()
+ self.driver.find_element_by_link_text("Packages").click()
+ self.driver.find_element_by_id("edit-columns-button").click()
+ self.driver.find_element_by_id("recipe__layer_version__layer__name").click()
+ self.driver.find_element_by_id("recipe__layer_version__branch").click()
+ self.driver.find_element_by_id("recipe__layer_version__layer__commit").click()
+ self.driver.find_element_by_id("edit-columns-button").click()
+ otable_head_text = self.get_table_head_text("otable")
+ for item in ["Layer", "Layer branch", "Layer commit"]:
+ self.assertFalse(item not in otable_head_text, msg=("item %s should be in head row" % item))
+ # click the fist recipe, whatever it is
+ self.get_table_element("otable", 1, 1).click()
+ self.assertTrue(self.is_text_present(["Layer", "Layer branch", "Layer commit"]), \
+ msg=("text not in web page"))
+
+ # step 3: test Packages core-image-minimal(images) stuff. almost same as above. Note when future element-id changes...
+ self.driver.back()
+ self.driver.find_element_by_link_text("core-image-minimal").click()
+ self.driver.find_element_by_id("edit-columns-button").click()
+ self.driver.find_element_by_id("layer_name").click()
+ self.driver.find_element_by_id("layer_branch").click()
+ self.driver.find_element_by_id("layer_commit").click()
+ self.driver.find_element_by_id("edit-columns-button").click()
+ otable_head_text = self.get_table_head_text("otable")
+ for item in ["Layer", "Layer branch", "Layer commit"]:
+ self.assertFalse(item not in otable_head_text, msg=("item %s should be in head row" % item))
+ # click the fist recipe, whatever it is
+ self.get_table_element("otable", 1, 1).click()
+ self.assertTrue(self.is_text_present(["Layer", "Layer branch", "Layer commit"]), \
+ msg=("text not in web page"))
+
+ # step 4: check Configuration page
+ self.driver.back()
+ self.driver.find_element_by_link_text("Configuration").click()
+ otable_head_text = self.get_table_head_text()
+ self.assertTrue(self.is_text_present(["Layer", "Layer branch", "Layer commit"]), \
+ msg=("text not in web page"))
+
+
+ ##############
+ # CASE 945 #
+ ##############
+ def test_945(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ for item in ["Packages", "Recipes", "Tasks"]:
+ self.driver.get(self.base_url)
+ self.driver.find_element_by_link_text("core-image-minimal").click()
+ self.driver.find_element_by_link_text(items).click()
+
+ # this may be page specific. If future page content changes, try to replace it with new xpath
+ xpath_showrows = "/html/body/div[4]/div/div/div[2]/div[2]/div[2]/div/div/div[2]/select"
+ xpath_table = "html/body/div[4]/div/div/div[2]/div[2]/table/tbody"#"id=('otable')/tbody"
+ self.driver.find_element_by_xpath(xpath_showrows).click()
+ rows_displayed = int(self.driver.find_element_by_xpath(xpath_showrows + "/option[2]").text)
+
+ # not sure if this is a Selenium Select bug: If page is not refreshed here, "select(by visible text)" operation will go back to 100-row page
+ # Sure we can use driver.get(url) to refresh page, but since page will vary, we use click link text here
+ self.driver.find_element_by_link_text(items).click()
+ Select(self.driver.find_element_by_css_selector("select.pagesize")).select_by_visible_text(str(rows_displayed))
+ self.failUnless(self.is_element_present(By.XPATH, xpath_table + "/tr[" + str(rows_displayed) +"]"))
+ self.failIf(self.is_element_present(By.XPATH, xpath_table + "/tr[" + str(rows_displayed+1) +"]"))
+
+ # click 1st package, then go back to check if it's still those rows shown.
+ self.driver.find_element_by_xpath(xpath_otable + "/tr[1]/td[1]/a").click()
+ time.sleep(3)
+ self.driver.find_element_by_link_text(item).click()
+ self.assertTrue(self.is_element_present(By.XPATH, xpath_otable + "/tr[" + str(option_tobeselected) +"]"),\
+ msg=("Row %d should exist" %option_tobeselected))
+ self.assertFalse(self.is_element_present(By.XPATH, xpath_otable + "/tr[" + str(option_tobeselected+1) +"]"),\
+ msg=("Row %d should not exist" %(option_tobeselected+1)))
+
+
+
+ ##############
+ # CASE 946 #
+ ##############
+ def test_946(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ self.driver.find_element_by_link_text("core-image-minimal").click()
+ self.driver.find_element_by_link_text("Configuration").click()
+ # step 3-4
+ check_list = ["Summary", "BitBake variables"]
+ for item in check_list:
+ if not self.is_element_present(how=By.LINK_TEXT, what=item):
+ self.log.error("%s not found" %item)
+ if not self.is_text_present(['Layers', 'Layer', 'Layer branch', 'Layer commit']):
+ self.log.error("text not found")
+ # step 5
+ self.driver.find_element_by_link_text("BitBake variables").click()
+ if not self.is_text_present(['Variable', 'Value', 'Set in file', 'Description']):
+ self.log.error("text not found")
+ # This may be unstable because it's page-specific
+ # step 6: this is how we find filter beside "Set in file"
+ temp_element = self.find_element_by_text_in_table('otable', "Set in file")
+ temp_element.find_element_by_xpath("..//*/a/i[@class='icon-filter filtered']").click()
+ self.browser_delay()
+ self.driver.find_element_by_xpath("(//input[@name='filter'])[3]").click()
+ btns = self.driver.find_elements_by_css_selector("button.btn.btn-primary")
+ for btn in btns:
+ try:
+ btn.click()
+ break
+ except:
+ pass
+ # save screen here
+ self.browser_delay()
+ self.save_screenshot(screenshot_type='selenium', append_name='step6')
+ self.driver.find_element_by_id("edit-columns-button").click()
+ # save screen here
+ # step 7
+ # we should manually check the step 6-8 result using screenshot
+ self.browser_delay()
+ self.save_screenshot(screenshot_type='selenium', append_name='step7')
+ self.driver.find_element_by_id("edit-columns-button").click()
+ # step 9
+ # click the 1st item, no matter what it is
+ self.driver.find_element_by_xpath("//*[@id='otable']/tbody/tr[1]/td[1]/a").click()
+ # give it 1 sec so the pop-up becomes the "active_element"
+ time.sleep(1)
+ element = self.driver.switch_to.active_element
+ check_list = ['Order', 'Configuration file', 'Operation', 'Line number']
+ for item in check_list:
+ if item not in element.text:
+ self.log.error("%s not found" %item)
+ # any better way to close this pop-up? ... TBD
+ element.find_element_by_class_name("close").click()
+ # step 10 : need to manually check "Yocto Manual" in saved screen
+ self.driver.find_element_by_css_selector("i.icon-share.get-info").click()
+ # save screen here
+ time.sleep(5)
+ self.save_screenshot(screenshot_type='native', append_name='step10')
+
+
+ ##############
+ # CASE 947 #
+ ##############
+ def test_947(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ self.driver.find_element_by_link_text("core-image-minimal").click()
+ self.find_element_by_link_text_in_table('nav', 'Configuration').click()
+ # step 2
+ self.driver.find_element_by_link_text("BitBake variables").click()
+ # step 3
+ def xpath_option(column_name):
+ # return xpath of options under "Edit columns" button
+ return self.shortest_xpath('id', 'navTab') + self.shortest_xpath('id', 'editcol') \
+ + self.shortest_xpath('id', column_name)
+ self.driver.find_element_by_id('edit-columns-button').click()
+ # by default, option "Description" and "Set in file" were checked
+ self.driver.find_element_by_xpath(xpath_option('description')).click()
+ self.driver.find_element_by_xpath(xpath_option('file')).click()
+ self.driver.find_element_by_id('edit-columns-button').click()
+ check_list = ['Description', 'Set in file']
+ head_list = self.get_table_head_text('otable')
+ for item in check_list:
+ self.assertFalse(item in head_list, msg=("item %s should not be in head row" % item))
+ # check these 2 options and verify again
+ self.driver.find_element_by_id('edit-columns-button').click()
+ self.driver.find_element_by_xpath(xpath_option('description')).click()
+ self.driver.find_element_by_xpath(xpath_option('file')).click()
+ self.driver.find_element_by_id('edit-columns-button').click()
+ head_list = self.get_table_head_text('otable')
+ for item in check_list:
+ self.assertTrue(item in head_list, msg=("item %s not in head row" % item))
+
+
+ ##############
+ # CASE 948 #
+ ##############
+ def test_948(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ self.driver.find_element_by_link_text("core-image-minimal").click()
+ self.find_element_by_link_text_in_table('nav', 'Configuration').click()
+ self.driver.find_element_by_link_text("BitBake variables").click()
+ #get number of variables visible by default
+ number_before_search = self.driver.find_element_by_class_name('page-header').text
+ # search for a while...
+ self.driver.find_element_by_id("search").clear()
+ self.driver.find_element_by_id("search").send_keys("BB")
+ self.driver.find_element_by_id("search-button").click()
+ #get number of variables visible after search
+ number_after_search = self.driver.find_element_by_class_name('page-header').text
+ self.assertTrue(number_before_search > number_after_search, msg=("items should be less after search"))
+
+
+ ##############
+ # CASE 949 #
+ ##############
+ def test_949(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ self.driver.find_element_by_link_text("core-image-minimal").click()
+ self.find_element_by_link_text_in_table('nav', 'core-image-minimal').click()
+ # step 3
+ try:
+ self.driver.find_element_by_partial_link_text("Packages included")
+ self.driver.find_element_by_partial_link_text("Directory structure")
+ except Exception,e:
+ self.log.error(e)
+ self.assertFalse(True)
+ # step 4
+ head_list = self.get_table_head_text('otable')
+ for item in ['Package', 'Package version', 'Size', 'Dependencies', 'Reverse dependencies', 'Recipe']:
+ self.assertTrue(item in head_list, msg=("item %s not in head row" % item))
+ # step 5-6
+ self.driver.find_element_by_id("edit-columns-button").click()
+ selectable_class = 'checkbox'
+ # minimum-table : means unselectable items
+ unselectable_class = 'checkbox muted'
+ selectable_check_list = ['Dependencies', 'Layer', 'Layer branch', 'Layer commit', \
+ 'License', 'Recipe', 'Recipe version', 'Reverse dependencies', \
+ 'Size', 'Size over total (%)']
+ unselectable_check_list = ['Package', 'Package version']
+ selectable_list = list()
+ unselectable_list = list()
+ selectable_elements = self.driver.find_elements_by_xpath("//*[@id='editcol']//*[@class='" + selectable_class + "']")
+ unselectable_elements = self.driver.find_elements_by_xpath("//*[@id='editcol']//*[@class='" + unselectable_class + "']")
+ for element in selectable_elements:
+ selectable_list.append(element.text)
+ for element in unselectable_elements:
+ unselectable_list.append(element.text)
+ # check them
+ for item in selectable_check_list:
+ self.assertTrue(item in selectable_list, msg=("%s not found in dropdown menu" % item))
+ for item in unselectable_check_list:
+ self.assertTrue(item in unselectable_list, msg=("%s not found in dropdown menu" % item))
+ self.driver.find_element_by_id("edit-columns-button").click()
+ # step 7
+ self.driver.find_element_by_partial_link_text("Directory structure").click()
+ head_list = self.get_table_head_text('dirtable')
+ for item in ['Directory / File', 'Symbolic link to', 'Source package', 'Size', 'Permissions', 'Owner', 'Group']:
+ self.assertTrue(item in head_list, msg=("%s not found in Directory structure table head" % item))
+
+ ##############
+ # CASE 950 #
+ ##############
+ def test_950(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ # step3&4: so far we're not sure if there's "successful build" or "failed
+ # build".If either of them doesn't exist, we can still go on other steps
+ check_list = ['Configuration', 'Tasks', 'Recipes', 'Packages', 'Time', 'CPU usage', 'Disk I/O']
+ has_successful_build = 1
+ has_failed_build = 1
+ try:
+ pass_icon = self.driver.find_element_by_xpath("//*[@class='icon-ok-sign success']")
+ except Exception:
+ self.log.info("no successful build exists")
+ has_successful_build = 0
+ pass
+ if has_successful_build:
+ pass_icon.click()
+ # save screen here to check if it matches requirement.
+ self.browser_delay()
+ self.save_screenshot(screenshot_type='selenium', append_name='step3_1')
+ for item in check_list:
+ try:
+ self.find_element_by_link_text_in_table('nav', item)
+ except Exception:
+ self.assertFalse(True, msg=("link %s cannot be found in the page" % item))
+ # step 6
+ check_list_2 = ['Packages included', 'Total package size', \
+ 'License manifest', 'Image files']
+ self.assertTrue(self.is_text_present(check_list_2), msg=("text not in web page"))
+ self.driver.back()
+ try:
+ fail_icon = self.driver.find_element_by_xpath("//*[@class='icon-minus-sign error']")
+ except Exception:
+ has_failed_build = 0
+ self.log.info("no failed build exists")
+ pass
+ if has_failed_build:
+ fail_icon.click()
+ # save screen here to check if it matches requirement.
+ self.browser_delay()
+ self.save_screenshot(screenshot_type='selenium', append_name='step3_2')
+ for item in check_list:
+ try:
+ self.find_element_by_link_text_in_table('nav', item)
+ except Exception:
+ self.assertFalse(True, msg=("link %s cannot be found in the page" % item))
+ # step 7 involved
+ check_list_3 = ['Machine', 'Distro', 'Layers', 'Total number of tasks', 'Tasks executed', \
+ 'Tasks not executed', 'Reuse', 'Recipes built', 'Packages built']
+ self.assertTrue(self.is_text_present(check_list_3), msg=("text not in web page"))
+ self.driver.back()
+
+
+ ##############
+ # CASE 951 #
+ ##############
+ def test_951(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ # currently test case itself isn't responsible for creating "1 successful and
+ # 1 failed build"
+ has_successful_build = 1
+ has_failed_build = 1
+ try:
+ fail_icon = self.driver.find_element_by_xpath("//*[@class='icon-minus-sign error']")
+ except Exception:
+ has_failed_build = 0
+ self.log.info("no failed build exists")
+ pass
+ # if there's failed build, we can proceed
+ if has_failed_build:
+ self.driver.find_element_by_partial_link_text("error").click()
+ self.driver.back()
+ # not sure if there "must be" some warnings, so here save a screen
+ self.browser_delay()
+ self.save_screenshot(screenshot_type='selenium', append_name='step4')
+
+
+ ##############
+ # CASE 955 #
+ ##############
+ def test_955(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ self.log.info(" You should manually create all images before test starts!")
+ # So far the case itself is not responsable for creating all sorts of images.
+ # So assuming they are already there
+ # step 2
+ self.driver.find_element_by_link_text("core-image-minimal").click()
+ # save screen here to see the page component
+
+
+ ##############
+ # CASE 956 #
+ ##############
+ def test_956(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ # step 2-3 need to run manually
+ self.log.info("step 2-3: checking the help message when you hover on help icon of target,\
+ tasks, recipes, packages need to run manually")
+ self.driver.find_element_by_partial_link_text("Manual").click()
+ if not self.is_text_present("Manual"):
+ self.log.error("please check [Toaster manual] link on page")
+ self.failIf(True)
+
+####################################################################################################
+# Starting backend tests ###########################################################################
+####################################################################################################
+
+ ##############
+ # CASE 1066 #
+ ##############
+ def test_1066(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ con=sqlite.connect('toaster.sqlite')
+ cursor = con.cursor()
+ query = "select count(name) from orm_project a, auth_user b where a.user_id = b.id and b.username='_anonuser';"
+ cursor.execute(query)
+ data = cursor.fetchone()
+ self.failUnless(data >= 1)
+
+
+ ##############
+ # CASE 1071 #
+ ##############
+ def test_1071(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ con=sqlite.connect('toaster.sqlite')
+ cursor = con.cursor()
+ query = "select name from orm_release;"
+ cursor.execute(query)
+ data = cursor.fetchall()
+ for i in range(0,4):
+ data[i] = data[i][0]
+ data.sort()
+ print data
+ json_parse = json.loads(open('toasterconf.json').read())
+ json_data = []
+ for i in range (0,4):
+ json_data.append(json_parse['releases'][i]['name'])
+ json_data.sort()
+ print json_data
+ self.failUnless(data == json_data)
+
+ ##############
+ # CASE 1072 #
+ ##############
+ def test_1072(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ con=sqlite.connect('toaster.sqlite')
+ cursor = con.cursor()
+ query = "select value from orm_toastersetting where name like 'DEFCONF%';"
+ cursor.execute(query)
+ data = cursor.fetchall()
+ for i in range(0,6):
+ data[i] = data[i][0]
+ print data
+ json_parse = json.loads(open('toasterconf.json').read())
+ json_data=json_parse['config']
+ json_data = json_data.values()
+ print json_data
+ self.failUnless(data == json_data)
+
+
+ ##############
+ # CASE 1074 #
+ ##############
+ def test_1074(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ con=sqlite.connect('toaster.sqlite')
+ cursor = con.cursor()
+ query = "select name from orm_layersource;"
+ cursor.execute(query)
+ data = cursor.fetchall()
+ for i in range(0,3):
+ data[i] = data[i][0]
+ print data
+ json_parse = json.loads(open('toasterconf.json').read())
+ json_data = []
+ for i in range(0,3):
+ json_data.append(json_parse['layersources'][i]['name'])
+ print json_data
+ self.failUnless(set(data) == set(json_data))
+
+ ##############
+ # CASE 1075 #
+ ##############
+ def test_1075(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ con=sqlite.connect('toaster.sqlite')
+ cursor = con.cursor()
+ query = "select value from orm_toastersetting where name like 'DEFAULT_RELEASE';"
+ cursor.execute(query)
+ data = cursor.fetchall()
+ data = data[0][0]
+ print data
+ json_parse = json.loads(open('toasterconf.json').read())
+ json_data = json_parse['defaultrelease']
+ print json_data
+ self.failUnless(set(data) == set(json_data))
+
+ ##############
+ # CASE 1076 #
+ ##############
+ def test_1076(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+
+ print 'Checking branches for "Local Yocto Project"'
+ con=sqlite.connect('toaster.sqlite')
+ cursor = con.cursor()
+ query = "select name from orm_branch where layer_source_id=1;"
+ cursor.execute(query)
+ data = cursor.fetchall()
+ lenght = len(data)
+ try:
+ for i in range(0,lenght):
+ data[i] = data[i][0]
+ except:
+ pass
+ print data
+ json_parse = json.loads(open('toasterconf.json').read())
+ json_location = json_parse['layersources'][0]['name']
+ print json_location
+ json_data = json_parse['layersources'][0]['branches']
+ print json_data
+ self.failUnless(set(data) == set(json_data))
+
+ print 'Checking branches for "OpenEmbedded"'
+ con=sqlite.connect('toaster.sqlite')
+ cursor = con.cursor()
+ query = "select name from orm_branch where layer_source_id=3;"
+ cursor.execute(query)
+ data = cursor.fetchall()
+ lenght = len(data)
+ for i in range(0,lenght):
+ data[i] = data[i][0]
+ print data
+ json_parse = json.loads(open('toasterconf.json').read())
+ json_location = json_parse['layersources'][1]['name']
+ print json_location
+ json_data = json_parse['layersources'][1]['branches']
+ print json_data
+ self.failUnless(set(data) == set(json_data))
+
+ print 'Checking branches for "Imported layers"'
+ con=sqlite.connect('toaster.sqlite')
+ cursor = con.cursor()
+ query = "select name from orm_branch where layer_source_id=2;"
+ cursor.execute(query)
+ data = cursor.fetchall()
+ lenght = len(data)
+ for i in range(0,lenght):
+ data[i] = data[i][0]
+ print data
+ json_parse = json.loads(open('toasterconf.json').read())
+ json_location = json_parse['layersources'][2]['name']
+ print json_location
+ json_data = json_parse['layersources'][2]['branches']
+ print json_data
+ self.failUnless(set(data) == set(json_data))
+
+
+ ##############
+ # CASE 1077 #
+ ##############
+ def test_1077(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ con=sqlite.connect('toaster.sqlite')
+ cursor = con.cursor()
+ query = "select name from orm_bitbakeversion;"
+ cursor.execute(query)
+ data = cursor.fetchall()
+ for i in range(0,4):
+ data[i] = data[i][0]
+ print data
+ json_parse = json.loads(open('toasterconf.json').read())
+ json_data = []
+ for i in range(0,4):
+ json_data.append(json_parse['bitbake'][i]['name'])
+ print json_data
+ self.failUnless(set(data) == set(json_data))
+
+ ##############
+ # CASE 1083 #
+ ##############
+ def test_1083(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ self.driver.find_element_by_id("new-project-button").click()
+ self.driver.find_element_by_id("new-project-name").send_keys("new-test-project")
+ self.driver.find_element_by_id("create-project-button").click()
+ con=sqlite.connect('toaster.sqlite')
+ cursor = con.cursor()
+ query = "select count(name) from orm_project where name = 'new-test-project';"
+ cursor.execute(query)
+ data = cursor.fetchone()
+ print 'data: %s' % data
+ self.failUnless(data >= 1)
+
+ ##############
+ # CASE 1084 #
+ ##############
+ def test_1084(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ self.driver.find_element_by_id("new-project-button").click()
+ self.driver.find_element_by_id("new-project-name").send_keys("new-default-project")
+ self.driver.find_element_by_id("create-project-button").click()
+ con=sqlite.connect('toaster.sqlite')
+ cursor = con.cursor()
+ query = "select a.name from orm_release a, orm_project b where a.id = b.release_id and b.name = 'new-default-project' limit 1;"
+ cursor.execute(query)
+ db_data = str(cursor.fetchone()[0])
+ json_parse = json.loads(open('toasterconf.json').read())
+ json_data = str(json_parse['defaultrelease'])
+ self.failUnless(db_data == json_data)
+
+ ##############
+ # CASE 1088 #
+ ##############
+ def test_1088(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ self.driver.find_element_by_css_selector("a[href='/toastergui/projects/']").click()
+ self.driver.find_element_by_link_text('new-default-project').click()
+ self.driver.find_element_by_id('project-change-form-toggle').click()
+ self.driver.find_element_by_id('project-name-change-input').clear()
+ self.driver.find_element_by_id('project-name-change-input').send_keys('new-name')
+ self.driver.find_element_by_id('project-name-change-btn').click()
+ con=sqlite.connect('toaster.sqlite')
+ cursor = con.cursor()
+ query = "select count(name) from orm_project where name = 'new-name';"
+ cursor.execute(query)
+ data = cursor.fetchone()[0]
+ self.failUnless(data == 1)
+ #reseting project name
+ self.driver.find_element_by_id('project-change-form-toggle').click()
+ self.driver.find_element_by_id('project-name-change-input').clear()
+ self.driver.find_element_by_id('project-name-change-input').send_keys('new-default-project')
+ self.driver.find_element_by_id('project-name-change-btn').click()
+
+
+ ##############
+ # CASE 1089 #
+ ##############
+ def test_1089(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ self.driver.find_element_by_css_selector("a[href='/toastergui/projects/']").click()
+ self.driver.find_element_by_link_text('new-default-project').click()
+ self.driver.find_element_by_id('change-machine-toggle').click()
+ self.driver.find_element_by_id('machine-change-input').clear()
+ self.driver.find_element_by_id('machine-change-input').send_keys('qemuarm64')
+# self.driver.find_element_by_id('machine-change-input').send_keys(Keys.RETURN)
+ self.driver.find_element_by_id('machine-change-btn').click()
+ con=sqlite.connect('toaster.sqlite')
+ cursor = con.cursor()
+ query = "select count(id) from orm_projectvariable where name like 'machine' and value like 'qemuarm64';"
+ cursor.execute(query)
+ data = cursor.fetchone()[0]
+ self.failUnless(data == 1)
+ #resetting machine to default value
+ self.driver.find_element_by_id('change-machine-toggle').click()
+ self.driver.find_element_by_id('machine-change-input').clear()
+ self.driver.find_element_by_id('machine-change-input').send_keys('qemux86')
+ self.driver.find_element_by_id('machine-change-input').send_keys(Keys.RETURN)
+ self.driver.find_element_by_id('machine-change-btn').click()
+
+ ##############
+ # CASE 1090 #
+ ##############
+ def test_1090(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ con=sqlite.connect('toaster.sqlite')
+ cursor = con.cursor()
+ query = "select username from auth_user where is_superuser = 1;"
+ cursor.execute(query)
+ data = cursor.fetchall()
+ try:
+ data = data[0][0]
+ except:
+ pass
+ print data
+ self.failUnless(data == 'toaster_admin')
+
+ ##############
+ # CASE 1091 #
+ ##############
+ def test_1091(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ self.driver.get(self.base_url)
+ self.driver.find_element_by_css_selector("a[href='/toastergui/projects/']").click()
+ self.driver.find_element_by_link_text('new-default-project').click()
+ self.driver.find_element_by_id('release-change-toggle').click()
+ dropdown = self.driver.find_element_by_css_selector('select')
+ for option in dropdown.find_elements_by_tag_name('option'):
+ if option.text == 'Local Yocto Project':
+ option.click()
+ self.driver.find_element_by_id('change-release-btn').click()
+ #wait for the changes to register in the DB
+ time.sleep(1)
+ con=sqlite.connect('toaster.sqlite')
+ cursor = con.cursor()
+ query = "select count(*) from orm_layer_version a, orm_projectlayer b, orm_project c where a.\"commit\"=\"HEAD\" and a.id = b.layercommit_id and b.project_id=c.id and c.name='new-default-project';"
+ cursor.execute(query)
+ data = cursor.fetchone()[0]
+ #resetting release to default
+ self.driver.find_element_by_id('release-change-toggle').click()
+ dropdown = self.driver.find_element_by_css_selector('select')
+ for option in dropdown.find_elements_by_tag_name('option'):
+ if option.text == 'Yocto Project master':
+ option.click()
+ self.driver.find_element_by_id('change-release-btn').click()
+ #wait for the changes to register in the DB
+ time.sleep(1)
+ self.failUnless(data == 3)
+
+ ##############
+ # CASE 1092 #
+ ##############
+ def test_1092(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+ self.driver.maximize_window()
+ con=sqlite.connect('toaster.sqlite')
+ cursor = con.cursor()
+ query = "select a.name, a.value from orm_projectvariable a, orm_project b where a.project_id = b.id and b.name = 'new-default-project';"
+ cursor.execute(query)
+ data = dict(cursor.fetchall())
+ print data
+ default_values = {u'IMAGE_INSTALL_append': u'', u'PACKAGE_CLASSES': u'package_rpm', u'MACHINE': u'qemux86', u'SDKMACHINE': u'x86_64', u'DISTRO': u'poky', u'IMAGE_FSTYPES': u'ext3 jffs2 tar.bz2'}
+ self.failUnless(data == default_values)
+
+ ##############
+ # CASE 1093 #
+ ##############
+ def test_1093(self):
+ self.case_no = self.get_case_number()
+ self.log.info(' CASE %s log: ' % str(self.case_no))
+
+ #get initial values
+ con=sqlite.connect('toaster.sqlite')
+ cursor = con.cursor()
+ query = "select layercommit_id from orm_projectlayer a, orm_project b where a.project_id=b.id and b.name='new-default-project';"
+ cursor.execute(query)
+ data_initial = cursor.fetchall()
+ print data_initial
+
+ self.driver.maximize_window()
+ self.driver.get('localhost:8000')#self.base_url)
+ self.driver.find_element_by_css_selector("a[href='/toastergui/projects/']").click()
+ self.driver.find_element_by_link_text('new-default-project').click()
+ self.driver.find_element_by_id('release-change-toggle').click()
+ dropdown = self.driver.find_element_by_css_selector('select')
+ for option in dropdown.find_elements_by_tag_name('option'):
+ if option.text == 'Local Yocto Project':
+ option.click()
+ self.driver.find_element_by_id('change-release-btn').click()
+ #wait for the changes to register in the DB
+ time.sleep(1)
+
+ #get changed values
+ con=sqlite.connect('toaster.sqlite')
+ cursor = con.cursor()
+ query = "select layercommit_id from orm_projectlayer a, orm_project b where a.project_id=b.id and b.name='new-default-project';"
+ cursor.execute(query)
+ data_changed = cursor.fetchall()
+ print data_changed
+
+ #resetting release to default
+ self.driver.find_element_by_id('release-change-toggle').click()
+ dropdown = self.driver.find_element_by_css_selector('select')
+ for option in dropdown.find_elements_by_tag_name('option'):
+ if option.text == 'Yocto Project master':
+ option.click()
+ self.driver.find_element_by_id('change-release-btn').click()
+ #wait for the changes to register in the DB
+ time.sleep(1)
+ self.failUnless(data_initial != data_changed)
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/toasteruitest/toaster_test.cfg b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/toasteruitest/toaster_test.cfg
new file mode 100644
index 000000000..685a9ee6a
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/toasteruitest/toaster_test.cfg
@@ -0,0 +1,25 @@
+# Configuration file for toaster_test
+# Sorted by different host type
+
+# test browser could be: firefox; chrome; ie(still under development)
+# logging_level could be: CRITICAL; ERROR; WARNING; INFO; DEBUG; NOTSET
+
+
+[toaster_test_linux]
+toaster_url = 'http://127.0.0.1:8000'
+test_browser = 'firefox'
+test_cases = [946]
+logging_level = 'INFO'
+
+
+[toaster_test_windows]
+toaster_url = 'http://127.0.0.1:8000'
+test_browser = ['ie', 'firefox', 'chrome']
+test_cases = [901, 902, 903]
+logging_level = 'DEBUG'
+
+[toaster_test_darwin]
+toaster_url = 'http://127.0.0.1:8000'
+test_browser = 'firefox'
+test_cases = [901, 902, 903, 904, 906, 910, 911, 912, 913, 914, 915, 916, 923, 924, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 955, 956]
+logging_level = 'INFO'
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/urlcheck.py b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/urlcheck.py
new file mode 100644
index 000000000..0820f82e2
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/urlcheck.py
@@ -0,0 +1,53 @@
+from __future__ import print_function
+import sys
+
+import httplib2
+import config
+import urllist
+
+
+config.logger.info("Testing %s with %s", config.TOASTER_BASEURL, config.W3C_VALIDATOR)
+
+def validate_html5(url):
+ http_client = httplib2.Http(None)
+ status = "Failed"
+ errors = -1
+ warnings = -1
+
+ urlrequest = config.W3C_VALIDATOR+url
+
+ # pylint: disable=broad-except
+ # we disable the broad-except because we want to actually catch all possible exceptions
+ try:
+ resp, _ = http_client.request(urlrequest, "HEAD")
+ if resp['x-w3c-validator-status'] != "Abort":
+ status = resp['x-w3c-validator-status']
+ errors = int(resp['x-w3c-validator-errors'])
+ warnings = int(resp['x-w3c-validator-warnings'])
+
+ if status == 'Invalid':
+ config.logger.warn("Failed %s is %s\terrors %s warnings %s (check at %s)", url, status, errors, warnings, urlrequest)
+ else:
+ config.logger.debug("OK! %s", url)
+
+ except Exception as exc:
+ config.logger.warn("Failed validation call: %s", exc)
+ return (status, errors, warnings)
+
+
+def print_validation(url):
+ status, errors, warnings = validate_html5(url)
+ config.logger.error("url %s is %s\terrors %s warnings %s (check at %s)", url, status, errors, warnings, config.W3C_VALIDATOR+url)
+
+
+def main():
+ print("Testing %s with %s" % (config.TOASTER_BASEURL, config.W3C_VALIDATOR))
+
+ if len(sys.argv) > 1:
+ print_validation(sys.argv[1])
+ else:
+ for url in urllist.URLS:
+ print_validation(config.TOASTER_BASEURL+url)
+
+if __name__ == "__main__":
+ main()
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/urllist.py b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/urllist.py
new file mode 100644
index 000000000..6db9ffc7b
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/contrib/tts/urllist.py
@@ -0,0 +1,39 @@
+URLS = [
+ 'toastergui/landing/',
+ 'toastergui/builds/',
+ 'toastergui/build/1',
+ 'toastergui/build/1/tasks/',
+ 'toastergui/build/1/tasks/1/',
+ 'toastergui/build/1/task/1',
+ 'toastergui/build/1/recipes/',
+ 'toastergui/build/1/recipe/1/active_tab/1',
+ 'toastergui/build/1/recipe/1',
+ 'toastergui/build/1/recipe_packages/1',
+ 'toastergui/build/1/packages/',
+ 'toastergui/build/1/package/1',
+ 'toastergui/build/1/package_built_dependencies/1',
+ 'toastergui/build/1/package_included_detail/1/1',
+ 'toastergui/build/1/package_included_dependencies/1/1',
+ 'toastergui/build/1/package_included_reverse_dependencies/1/1',
+ 'toastergui/build/1/target/1',
+ 'toastergui/build/1/target/1/targetpkg',
+ 'toastergui/build/1/target/1/dirinfo',
+ 'toastergui/build/1/target/1/dirinfo_filepath/_/bin/bash',
+ 'toastergui/build/1/configuration',
+ 'toastergui/build/1/configvars',
+ 'toastergui/build/1/buildtime',
+ 'toastergui/build/1/cpuusage',
+ 'toastergui/build/1/diskio',
+ 'toastergui/build/1/target/1/packagefile/1',
+ 'toastergui/newproject/',
+ 'toastergui/projects/',
+ 'toastergui/project/1',
+ 'toastergui/project/1/configuration',
+ 'toastergui/project/1/builds/',
+ 'toastergui/project/1/layers/',
+ 'toastergui/project/1/layer/1',
+ 'toastergui/project/1/importlayer',
+ 'toastergui/project/1/targets/',
+ 'toastergui/project/1/machines/',
+ 'toastergui/',
+]
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/manage.py b/import-layers/yocto-poky/bitbake/lib/toaster/manage.py
new file mode 100755
index 000000000..ceaa11bfc
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/manage.py
@@ -0,0 +1,10 @@
+#!/usr/bin/env python
+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/import-layers/yocto-poky/bitbake/lib/toaster/orm/__init__.py b/import-layers/yocto-poky/bitbake/lib/toaster/orm/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/orm/__init__.py
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/orm/management/__init__.py b/import-layers/yocto-poky/bitbake/lib/toaster/orm/management/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/orm/management/__init__.py
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/orm/management/commands/__init__.py b/import-layers/yocto-poky/bitbake/lib/toaster/orm/management/commands/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/orm/management/commands/__init__.py
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/orm/management/commands/lsupdates.py b/import-layers/yocto-poky/bitbake/lib/toaster/orm/management/commands/lsupdates.py
new file mode 100644
index 000000000..75e9513fc
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/orm/management/commands/lsupdates.py
@@ -0,0 +1,12 @@
+from django.core.management.base import NoArgsCommand, CommandError
+from orm.models import LayerSource
+import os
+
+class Command(NoArgsCommand):
+ args = ""
+ help = "Updates locally cached information from all LayerSources"
+
+
+ def handle_noargs(self, **options):
+ for ls in LayerSource.objects.all():
+ ls.update()
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/orm/migrations/0001_initial.py b/import-layers/yocto-poky/bitbake/lib/toaster/orm/migrations/0001_initial.py
new file mode 100644
index 000000000..760462f6b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/orm/migrations/0002_customimagerecipe.py b/import-layers/yocto-poky/bitbake/lib/toaster/orm/migrations/0002_customimagerecipe.py
new file mode 100644
index 000000000..9cec82e8d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/orm/migrations/0003_customimagepackage.py b/import-layers/yocto-poky/bitbake/lib/toaster/orm/migrations/0003_customimagepackage.py
new file mode 100644
index 000000000..b027f6613
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/orm/migrations/0004_provides.py b/import-layers/yocto-poky/bitbake/lib/toaster/orm/migrations/0004_provides.py
new file mode 100644
index 000000000..dfde2d136
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/orm/migrations/0005_task_field_separation.py b/import-layers/yocto-poky/bitbake/lib/toaster/orm/migrations/0005_task_field_separation.py
new file mode 100644
index 000000000..fb1196b56
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/orm/migrations/0006_add_cancelled_state.py b/import-layers/yocto-poky/bitbake/lib/toaster/orm/migrations/0006_add_cancelled_state.py
new file mode 100644
index 000000000..91a32a9e0
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/orm/migrations/__init__.py b/import-layers/yocto-poky/bitbake/lib/toaster/orm/migrations/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/orm/migrations/__init__.py
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/orm/models.py b/import-layers/yocto-poky/bitbake/lib/toaster/orm/models.py
new file mode 100644
index 000000000..0b83b991b
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/orm/models.py
@@ -0,0 +1,1722 @@
+#
+# 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
+from django.db.models import F, Q, Avg, Max, Sum
+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 os.path
+import re
+import itertools
+
+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:
+ 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 xrange(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():
+ try:
+ lv = Layer_Version.objects.filter(layer__name = rdl.layer_name, up_branch__name = release.branch_name)[0].get_equivalents_wpriority(prj)[0]
+ ProjectLayer.objects.create( project = prj,
+ layercommit = lv,
+ optional = False )
+ except IndexError:
+ # we may have no valid layer version objects, and that's ok
+ pass
+
+ 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 = self.get_last_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(up_branch__name=self.release.branch_name) &
+ 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_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, BRVariable, BRBitbake
+ br = BuildRequest.objects.create(project = self)
+ try:
+
+ BRBitbake.objects.create(req = br,
+ giturl = self.bitbake_version.giturl,
+ commit = self.bitbake_version.branch,
+ dirpath = self.bitbake_version.dirpath)
+
+ for l in self.projectlayer_set.all().order_by("pk"):
+ commit = l.layercommit.get_vcs_reference()
+ print("ii Building layer ", l.layercommit.layer.name, " at vcs point ", commit)
+ 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)
+
+ br.state = BuildRequest.REQ_QUEUED
+ now = timezone.now()
+ br.build = Build.objects.create(project = self,
+ completed_on=now,
+ started_on=now,
+ )
+ 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)
+
+ 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()
+ 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)
+ bitbake_version = models.CharField(max_length=50)
+
+ @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()
+
+ return recent_builds
+
+ def completeper(self):
+ tf = Task.objects.filter(build = self)
+ tfc = tf.count()
+ if tfc > 0:
+ completeper = tf.exclude(order__isnull=True).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 get_image_file_extensions(self):
+ """
+ Get list of file name extensions for images produced by this build
+ """
+ targets = Target.objects.filter(build_id = self.id)
+ extensions = []
+
+ # pattern to match against file path for building extension string
+ pattern = re.compile('\.([^\.]+?)$')
+
+ 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:
+ file_name = os.path.basename(target_image_file.file_name)
+ suffix = ''
+
+ continue_matching = True
+
+ # incrementally extract the suffix from the file path,
+ # checking it against the list of valid suffixes at each
+ # step; if the path is stripped of all potential suffix
+ # parts without matching a valid suffix, this returns all
+ # characters after the first '.' in the file name
+ while continue_matching:
+ matches = pattern.search(file_name)
+
+ if None == matches:
+ continue_matching = False
+ suffix = re.sub('^\.', '', suffix)
+ continue
+ else:
+ suffix = matches.group(1) + suffix
+
+ if suffix in Target_Image_File.SUFFIXES:
+ continue_matching = False
+ continue
+ else:
+ # reduce the file name and try to find the next
+ # segment from the path which might be part
+ # of the suffix
+ file_name = re.sub('.' + matches.group(1), '', file_name)
+ suffix = '.' + suffix
+
+ if not suffix in extensions:
+ extensions.append(suffix)
+
+ return ', '.join(extensions)
+
+ 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_current_status(self):
+ """
+ get the status string from the build request if the build
+ has one, or the text for the build outcome if it doesn't
+ """
+
+ from bldcontrol.models import BuildRequest
+
+ build_request = None
+ if hasattr(self, 'buildrequest'):
+ build_request = self.buildrequest
+
+ if (build_request
+ and build_request.state != BuildRequest.REQ_INPROGRESS
+ and self.outcome == Build.IN_PROGRESS):
+ return self.buildrequest.get_state_display()
+ 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()]))
+
+
+# an Artifact is anything that results from a Build, and may be of interest to the user, and is not stored elsewhere
+class BuildArtifact(models.Model):
+ build = models.ForeignKey(Build)
+ file_name = models.FilePathField()
+ file_size = models.IntegerField()
+
+ def get_local_file_name(self):
+ try:
+ deploydir = Variable.objects.get(build = self.build, variable_name="DEPLOY_DIR").variable_value
+ return self.file_name[len(deploydir)+1:]
+ except:
+ raise
+
+ return self.file_name
+
+ def get_basename(self):
+ return os.path.basename(self.file_name)
+
+ def is_available(self):
+ return self.build.buildrequest.environment.has_artifact(self.file_name)
+
+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)
+
+ def package_count(self):
+ return Target_Installed_Package.objects.filter(target_id__exact=self.id).count()
+
+ def __unicode__(self):
+ return self.target
+
+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', 'hddimg', 'iso', 'jffs2', 'jffs2.sum',
+ 'squashfs', 'squashfs-lzo', 'squashfs-xz', 'tar.bz2', 'tar.lz4',
+ 'tar.xz', 'tartar.gz', 'ubi', 'ubifs', 'vmdk'
+ }
+
+ target = models.ForeignKey(Target)
+ file_name = models.FilePathField(max_length=254)
+ file_size = models.IntegerField()
+
+ @property
+ def suffix(self):
+ 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
+
+ def get_queryset(self):
+ return super(Package_DependencyManager, self).get_queryset().exclude(package_id = F('depends_on__id'))
+
+ def get_total_source_deps_size(self):
+ """ Returns the total file size of all the packages that depend on
+ thispackage.
+ """
+ return self.all().aggregate(Sum('depends_on__size'))
+
+ def get_total_revdeps_size(self):
+ """ Returns the total file size of all the packages that depend on
+ this package.
+ """
+ return self.all().aggregate(Sum('package_id__size'))
+
+
+ def all_depends(self):
+ """ Returns just the depends packages and not any other dep_type """
+ 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__name']
+
+ layer_source = models.ForeignKey('LayerSource', default = None, null = True) # from where did we get this recipe
+ up_id = models.IntegerField(null = True, default = None) # id of entry in the source
+ up_date = models.DateTimeField(null = True, default = None)
+
+ name = models.CharField(max_length=100, blank=True) # pn
+ version = models.CharField(max_length=100, blank=True) # pv
+ 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 get_layersource_view_url(self):
+ if self.layer_source is None:
+ return ""
+
+ url = self.layer_source.get_object_view(self.layer_version.up_branch, "recipes", self.name)
+ return url
+
+ 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"]
+ layer_source = models.ForeignKey('LayerSource', default = None, null = True) # from where did we get this machine
+ up_id = models.IntegerField(null = True, default = None) # id of entry in the source
+ 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 Meta:
+ unique_together = ("layer_source", "up_id")
+
+
+from django.db.models.base import ModelBase
+
+class InheritanceMetaclass(ModelBase):
+ def __call__(cls, *args, **kwargs):
+ obj = super(InheritanceMetaclass, cls).__call__(*args, **kwargs)
+ return obj.get_object()
+
+
+class LayerSource(models.Model):
+ __metaclass__ = InheritanceMetaclass
+
+ class Meta:
+ unique_together = (('sourcetype', 'apiurl'), )
+
+ TYPE_LOCAL = 0
+ TYPE_LAYERINDEX = 1
+ TYPE_IMPORTED = 2
+ SOURCE_TYPE = (
+ (TYPE_LOCAL, "local"),
+ (TYPE_LAYERINDEX, "layerindex"),
+ (TYPE_IMPORTED, "imported"),
+ )
+
+ name = models.CharField(max_length=63, unique = True)
+ sourcetype = models.IntegerField(choices=SOURCE_TYPE)
+ apiurl = models.CharField(max_length=255, null=True, default=None)
+
+ def __init__(self, *args, **kwargs):
+ super(LayerSource, self).__init__(*args, **kwargs)
+ if self.sourcetype == LayerSource.TYPE_LOCAL:
+ self.__class__ = LocalLayerSource
+ elif self.sourcetype == LayerSource.TYPE_LAYERINDEX:
+ self.__class__ = LayerIndexLayerSource
+ elif self.sourcetype == LayerSource.TYPE_IMPORTED:
+ self.__class__ = ImportedLayerSource
+ elif self.sourcetype == None:
+ raise Exception("Unknown LayerSource-derived class. If you added a new layer source type, fill out all code stubs.")
+
+
+ def update(self):
+ """
+ Updates the local database information from the upstream layer source
+ """
+ raise Exception("Abstract, update() must be implemented by all LayerSource-derived classes (object is %s)" % str(vars(self)))
+
+ def save(self, *args, **kwargs):
+ return super(LayerSource, self).save(*args, **kwargs)
+
+ def get_object(self):
+ # preset an un-initilized object
+ if None == self.name:
+ self.name=""
+ if None == self.apiurl:
+ self.apiurl=""
+ if None == self.sourcetype:
+ self.sourcetype=LayerSource.TYPE_LOCAL
+
+ if self.sourcetype == LayerSource.TYPE_LOCAL:
+ self.__class__ = LocalLayerSource
+ elif self.sourcetype == LayerSource.TYPE_LAYERINDEX:
+ self.__class__ = LayerIndexLayerSource
+ elif self.sourcetype == LayerSource.TYPE_IMPORTED:
+ self.__class__ = ImportedLayerSource
+ else:
+ raise Exception("Unknown LayerSource type. If you added a new layer source type, fill out all code stubs.")
+ return self
+
+ def __unicode__(self):
+ return "%s (%s)" % (self.name, self.sourcetype)
+
+
+class LocalLayerSource(LayerSource):
+ class Meta(LayerSource._meta.__class__):
+ proxy = True
+
+ def __init__(self, *args, **kwargs):
+ super(LocalLayerSource, self).__init__(args, kwargs)
+ self.sourcetype = LayerSource.TYPE_LOCAL
+
+ def update(self):
+ """
+ Fetches layer, recipe and machine information from local repository
+ """
+ pass
+
+class ImportedLayerSource(LayerSource):
+ class Meta(LayerSource._meta.__class__):
+ proxy = True
+
+ def __init__(self, *args, **kwargs):
+ super(ImportedLayerSource, self).__init__(args, kwargs)
+ self.sourcetype = LayerSource.TYPE_IMPORTED
+
+ def update(self):
+ """
+ Fetches layer, recipe and machine information from local repository
+ """
+ pass
+
+
+class LayerIndexLayerSource(LayerSource):
+ class Meta(LayerSource._meta.__class__):
+ proxy = True
+
+ def __init__(self, *args, **kwargs):
+ super(LayerIndexLayerSource, self).__init__(args, kwargs)
+ self.sourcetype = LayerSource.TYPE_LAYERINDEX
+
+ def get_object_view(self, branch, objectype, upid):
+ return self.apiurl + "../branch/" + branch.name + "/" + objectype + "/?q=" + str(upid)
+
+ def update(self):
+ """
+ Fetches layer, recipe and machine information from remote repository
+ """
+ assert self.apiurl is not None
+ from django.db import transaction, connection
+
+ import urllib2, urlparse, json
+ import os
+ proxy_settings = os.environ.get("http_proxy", None)
+ oe_core_layer = 'openembedded-core'
+
+ def _get_json_response(apiurl = self.apiurl):
+ _parsedurl = urlparse.urlparse(apiurl)
+ path = _parsedurl.path
+
+ try:
+ res = urllib2.urlopen(apiurl)
+ except urllib2.URLError as e:
+ raise Exception("Failed to read %s: %s" % (path, e.reason))
+
+ return json.loads(res.read())
+
+ # 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(e)))
+ return
+
+ # update branches; only those that we already have names listed in the
+ # Releases table
+ whitelist_branch_names = map(lambda x: x.branch_name, Release.objects.all())
+ if len(whitelist_branch_names) == 0:
+ raise Exception("Failed to make list of branches to fetch")
+
+ logger.debug("Fetching branches")
+ branches_info = _get_json_response(apilinks['branches']
+ + "?filter=name:%s" % "OR".join(whitelist_branch_names))
+ for bi in branches_info:
+ b, created = Branch.objects.get_or_create(layer_source = self, name = bi['name'])
+ b.up_id = bi['id']
+ b.up_date = bi['updated']
+ b.name = bi['name']
+ b.short_description = bi['short_description']
+ b.save()
+
+ # update layers
+ layers_info = _get_json_response(apilinks['layerItems'])
+
+ for li in layers_info:
+ # Special case for the openembedded-core layer
+ if li['name'] == oe_core_layer:
+ try:
+ # If we have an existing openembedded-core for example
+ # from the toasterconf.json augment the info using the
+ # layerindex rather than duplicate it
+ oe_core_l = Layer.objects.get(name=oe_core_layer)
+ # Take ownership of the layer as now coming from the
+ # layerindex
+ oe_core_l.layer_source = self
+ oe_core_l.up_id = li['id']
+ oe_core_l.summary = li['summary']
+ oe_core_l.description = li['description']
+ oe_core_l.save()
+ continue
+
+ except Layer.DoesNotExist:
+ pass
+
+ l, created = Layer.objects.get_or_create(layer_source = self, name = li['name'])
+ l.up_id = li['id']
+ l.up_date = li['updated']
+ 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.summary = li['summary']
+ l.description = li['description']
+ l.save()
+
+ # update layerbranches/layer_versions
+ logger.debug("Fetching layer information")
+ layerbranches_info = _get_json_response(apilinks['layerBranches']
+ + "?filter=branch:%s" % "OR".join(map(lambda x: str(x.up_id), [i for i in Branch.objects.filter(layer_source = self) if i.up_id is not None] ))
+ )
+
+ for lbi in layerbranches_info:
+ lv, created = Layer_Version.objects.get_or_create(layer_source = self,
+ up_id = lbi['id'],
+ layer=Layer.objects.get(layer_source = self, up_id = lbi['layer'])
+ )
+
+ lv.up_date = lbi['updated']
+ lv.up_branch = Branch.objects.get(layer_source = self, up_id = lbi['branch'])
+ lv.branch = lbi['actual_branch']
+ lv.commit = lbi['actual_branch']
+ lv.dirpath = lbi['vcs_subdir']
+ lv.save()
+
+ # update layer dependencies
+ layerdependencies_info = _get_json_response(apilinks['layerDependencies'])
+ dependlist = {}
+ for ldi in layerdependencies_info:
+ try:
+ lv = Layer_Version.objects.get(layer_source = self, up_id = ldi['layerbranch'])
+ except Layer_Version.DoesNotExist as e:
+ continue
+
+ if lv not in dependlist:
+ dependlist[lv] = []
+ try:
+ dependlist[lv].append(Layer_Version.objects.get(layer_source = self, layer__up_id = ldi['dependency'], up_branch = lv.up_branch))
+ except Layer_Version.DoesNotExist:
+ logger.warning("Cannot find layer version (ls:%s), up_id:%s lv:%s" % (self, ldi['dependency'], lv))
+
+ for lv in dependlist:
+ LayerVersionDependency.objects.filter(layer_version = lv).delete()
+ for lvd in dependlist[lv]:
+ LayerVersionDependency.objects.get_or_create(layer_version = lv, depends_on = lvd)
+
+
+ # update machines
+ logger.debug("Fetching machine information")
+ machines_info = _get_json_response(apilinks['machines']
+ + "?filter=layerbranch:%s" % "OR".join(map(lambda x: str(x.up_id), Layer_Version.objects.filter(layer_source = self)))
+ )
+
+ for mi in machines_info:
+ mo, created = Machine.objects.get_or_create(layer_source = self, up_id = mi['id'], layer_version = Layer_Version.objects.get(layer_source = self, up_id = mi['layerbranch']))
+ mo.up_date = mi['updated']
+ mo.name = mi['name']
+ mo.description = mi['description']
+ mo.save()
+
+ # update recipes; paginate by layer version / layer branch
+ logger.debug("Fetching target information")
+ recipes_info = _get_json_response(apilinks['recipes']
+ + "?filter=layerbranch:%s" % "OR".join(map(lambda x: str(x.up_id), Layer_Version.objects.filter(layer_source = self)))
+ )
+ for ri in recipes_info:
+ try:
+ ro, created = Recipe.objects.get_or_create(layer_source = self, up_id = ri['id'], layer_version = Layer_Version.objects.get(layer_source = self, up_id = ri['layerbranch']))
+ 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 IntegrityError as e:
+ logger.debug("Failed saving recipe, ignoring: %s (%s:%s)" % (e, ro.layer_version, ri['filepath']+"/"+ri['filename']))
+ ro.delete()
+
+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)
+
+class ReleaseLayerSourcePriority(models.Model):
+ """ Each release selects layers from the set up layer sources, ordered by priority """
+ release = models.ForeignKey("Release")
+ layer_source = models.ForeignKey("LayerSource")
+ priority = models.IntegerField(default = 0)
+
+ def __unicode__(self):
+ return "%s-%s:%d" % (self.release.name, self.layer_source.name, self.priority)
+ class Meta:
+ unique_together = (('release', 'layer_source'),)
+
+
+class ReleaseDefaultLayer(models.Model):
+ release = models.ForeignKey(Release)
+ layer_name = models.CharField(max_length=100, default="")
+
+
+# Branch class is synced with layerindex.Branch, branches can only come from remote layer indexes
+class Branch(models.Model):
+ layer_source = models.ForeignKey('LayerSource', null = True, default = True)
+ up_id = models.IntegerField(null = True, default = None) # id of branch in the source
+ up_date = models.DateTimeField(null = True, default = None)
+
+ name = models.CharField(max_length=50)
+ short_description = models.CharField(max_length=50, blank=True)
+
+ class Meta:
+ verbose_name_plural = "Branches"
+ unique_together = (('layer_source', 'name'),('layer_source', 'up_id'))
+
+ def __unicode__(self):
+ return self.name
+
+
+# Layer class synced with layerindex.LayerItem
+class Layer(models.Model):
+ layer_source = models.ForeignKey(LayerSource, null = True, default = None) # from where did we got this layer
+ up_id = models.IntegerField(null = True, default = None) # id of layer in the remote source
+ up_date = models.DateTimeField(null = True, default = None)
+
+ name = models.CharField(max_length=100)
+ layer_index_url = models.URLField()
+ vcs_url = GitURLField(default = None, null = True)
+ 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.layer_source)
+
+ class Meta:
+ unique_together = (("layer_source", "up_id"), ("layer_source", "name"))
+
+
+# LayerCommit class is synced with layerindex.LayerBranch
+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", "up_branch__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.ForeignKey(LayerSource, null = True, default = None) # from where did we get this Layer Version
+ up_id = models.IntegerField(null = True, default = None) # id of layerbranch in the remote source
+ up_date = models.DateTimeField(null = True, default = None)
+ up_branch = models.ForeignKey(Branch, null = True, default = None)
+
+ branch = models.CharField(max_length=80) # LayerBranch.actual_branch
+ commit = models.CharField(max_length=100) # LayerBranch.vcs_last_rev
+ dirpath = models.CharField(max_length=255, null = True, default = None) # LayerBranch.vcs_subdir
+ priority = models.IntegerField(default = 0) # if -1, this is a default layer
+
+ local_path = models.FilePathField(max_length=1024, default = "/") # where this layer was checked-out
+
+ project = models.ForeignKey('Project', null = True, default = None) # Set if this layer is project-specific; always set for imported layers, and project-set branches
+
+ # 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.up_branch.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_equivalents_wpriority(self, project):
+ layer_versions = project.get_all_compatible_layer_versions()
+ filtered = layer_versions.filter(layer__name = self.layer.name)
+ return filtered.order_by("-layer_source__releaselayersourcepriority__priority")
+
+ def get_vcs_reference(self):
+ if self.branch is not None and len(self.branch) > 0:
+ return self.branch
+ if self.up_branch is not None:
+ return self.up_branch.name
+ if self.commit is not None and len(self.commit) > 0:
+ return self.commit
+ return 'N/A'
+
+ def get_detailspage_url(self, project_id):
+ 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):
+ 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):
+ yield subdep
+
+ project = Project.objects.get(pk=project_id)
+ result = []
+ projectlvers = [player.layercommit for player in project.projectlayer_set.all()]
+ for dep in gen_layerdeps(self, project):
+ # 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 "%d %s (VCS %s, Project %s)" % (self.pk, str(self.layer), self.get_vcs_reference(), self.build.project if self.build is not None else "No project")
+
+ class Meta:
+ unique_together = ("layer_source", "up_id")
+
+class LayerVersionDependency(models.Model):
+ layer_source = models.ForeignKey(LayerSource, null = True, default = None) # from where did we got this layer
+ up_id = models.IntegerField(null = True, default = None) # id of layerbranch in the remote source
+
+ layer_version = models.ForeignKey(Layer_Version, related_name="dependencies")
+ depends_on = models.ForeignKey(Layer_Version, related_name="dependees")
+
+ class Meta:
+ unique_together = ("layer_source", "up_id")
+
+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 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 += "\""
+ try:
+ base_recipe = open("%s/%s" %
+ (self.base_recipe.layer_version.dirpath,
+ self.base_recipe.file_path), 'r').read()
+ except IOError:
+ # The path may now be the full path if the recipe has been built
+ base_recipe = open(self.base_recipe.file_path, 'r').read()
+
+ # 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)
+
+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/import-layers/yocto-poky/bitbake/lib/toaster/orm/tests.py b/import-layers/yocto-poky/bitbake/lib/toaster/orm/tests.py
new file mode 100644
index 000000000..719266e6d
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/orm/tests.py
@@ -0,0 +1,180 @@
+#! /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 ORM."""
+
+from django.test import TestCase, TransactionTestCase
+from orm.models import LocalLayerSource, LayerIndexLayerSource, ImportedLayerSource, LayerSource
+from orm.models import Branch, LayerVersionDependency
+
+from orm.models import Project, Layer, Layer_Version, Branch, ProjectLayer
+from orm.models import Release, ReleaseLayerSourcePriority, BitbakeVersion
+
+from django.db import IntegrityError
+
+import os
+
+# set TTS_LAYER_INDEX to the base url to use a different instance of the layer index
+
+class LayerSourceVerifyInheritanceSaveLoad(TestCase):
+ """
+ Tests to verify inheritance for the LayerSource proxy-inheritance classes.
+ """
+ def test_object_creation(self):
+ """Test LayerSource object creation."""
+ for name, sourcetype in [("a1", LayerSource.TYPE_LOCAL),
+ ("a2", LayerSource.TYPE_LAYERINDEX),
+ ("a3", LayerSource.TYPE_IMPORTED)]:
+ LayerSource.objects.create(name=name, sourcetype=sourcetype)
+
+ objects = LayerSource.objects.all()
+ self.assertTrue(isinstance(objects[0], LocalLayerSource))
+ self.assertTrue(isinstance(objects[1], LayerIndexLayerSource))
+ self.assertTrue(isinstance(objects[2], ImportedLayerSource))
+
+ def test_duplicate_error(self):
+ """Test creation of duplicate LayerSource objects."""
+ stype = LayerSource.TYPE_LOCAL
+ LayerSource.objects.create(name="a1", sourcetype=stype)
+ with self.assertRaises(IntegrityError):
+ LayerSource.objects.create(name="a1", sourcetype=stype)
+
+
+class LILSUpdateTestCase(TransactionTestCase):
+ """Test Layer Source update."""
+
+ def setUp(self):
+ """Create release."""
+ bbv = BitbakeVersion.objects.create(\
+ name="master", giturl="git://git.openembedded.org/bitbake")
+ Release.objects.create(name="default-release", bitbake_version=bbv,
+ branch_name="master")
+
+ def test_update(self):
+ """Check if LayerSource.update can fetch branches."""
+ url = os.getenv("TTS_LAYER_INDEX",
+ default="http://layers.openembedded.org/")
+
+ lsobj = LayerSource.objects.create(\
+ name="b1", sourcetype=LayerSource.TYPE_LAYERINDEX,
+ apiurl=url + "layerindex/api/")
+ lsobj.update()
+ self.assertTrue(lsobj.branch_set.all().count() > 0,
+ "no branches fetched")
+
+class LayerVersionEquivalenceTestCase(TestCase):
+ """Verify Layer_Version priority selection."""
+
+ def setUp(self):
+ """Create required objects."""
+ # create layer source
+ self.lsrc = LayerSource.objects.create(name="dummy-layersource",
+ sourcetype=LayerSource.TYPE_LOCAL)
+ # create release
+ bbv = BitbakeVersion.objects.create(\
+ name="master", giturl="git://git.openembedded.org/bitbake")
+ self.release = Release.objects.create(name="default-release",
+ bitbake_version=bbv,
+ branch_name="master")
+ # attach layer source to release
+ ReleaseLayerSourcePriority.objects.create(\
+ release=self.release, layer_source=self.lsrc, priority=1)
+
+ # create a layer version for the layer on the specified branch
+ self.layer = Layer.objects.create(name="meta-testlayer",
+ layer_source=self.lsrc)
+ self.branch = Branch.objects.create(name="master", layer_source=self.lsrc)
+ self.lver = Layer_Version.objects.create(\
+ layer=self.layer, layer_source=self.lsrc, up_branch=self.branch)
+
+ # create project and project layer
+ self.project = Project.objects.create_project(name="test-project",
+ release=self.release)
+ ProjectLayer.objects.create(project=self.project,
+ layercommit=self.lver)
+
+ # create spoof layer that should not appear in the search results
+ layer = Layer.objects.create(name="meta-notvalid",
+ layer_source=self.lsrc)
+ self.lver2 = Layer_Version.objects.create(layer=layer,
+ layer_source=self.lsrc,
+ up_branch=self.branch)
+
+ def test_single_layersource(self):
+ """
+ When we have a single layer version,
+ get_equivalents_wpriority() should return a list with
+ just this layer_version.
+ """
+ equivqs = self.lver.get_equivalents_wpriority(self.project)
+ self.assertEqual(list(equivqs), [self.lver])
+
+ def test_dual_layersource(self):
+ """
+ If we have two layers with the same name, from different layer sources,
+ we expect both layers in, in increasing priority of the layer source.
+ """
+ lsrc2 = LayerSource.objects.create(\
+ name="dummy-layersource2",
+ sourcetype=LayerSource.TYPE_LOCAL,
+ apiurl="test")
+
+ # assign a lower priority for the second layer source
+ self.release.releaselayersourcepriority_set.create(layer_source=lsrc2,
+ priority=2)
+
+ # create a new layer_version for a layer with the same name
+ # coming from the second layer source
+ layer2 = Layer.objects.create(name="meta-testlayer",
+ layer_source=lsrc2)
+ lver2 = Layer_Version.objects.create(layer=layer2, layer_source=lsrc2,
+ up_branch=self.branch)
+
+ # expect two layer versions, in the priority order
+ equivqs = self.lver.get_equivalents_wpriority(self.project)
+ self.assertEqual(list(equivqs), [lver2, self.lver])
+
+ def test_compatible_layer_versions(self):
+ """
+ When we have a 2 layer versions, get_all_compatible_layerversions()
+ should return a queryset with both.
+ """
+ compat_lv = self.project.get_all_compatible_layer_versions()
+ self.assertEqual(list(compat_lv), [self.lver, self.lver2])
+
+ def test_layerversion_get_alldeps(self):
+ """Test Layer_Version.get_alldeps API."""
+ lvers = {}
+ for i in range(10):
+ name = "layer%d" % i
+ lvers[name] = Layer_Version.objects.create(layer=Layer.objects.create(name=name),
+ project=self.project)
+ if i:
+ LayerVersionDependency.objects.create(layer_version=lvers["layer%d" % (i - 1)],
+ depends_on=lvers[name])
+ # Check dinamically added deps
+ self.assertEqual(lvers['layer0'].get_alldeps(self.project.id),
+ [lvers['layer%d' % n] for n in range(1, i+1)])
+
+ # Check chain of deps created in previous loop
+ for i in range(10):
+ self.assertEqual(lvers['layer%d' % i].get_alldeps(self.project.id),
+ [lvers['layer%d' % n] for n in range(i+1, 10)])
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/tests/__init__.py b/import-layers/yocto-poky/bitbake/lib/toaster/tests/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/tests/__init__.py
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/README b/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/README
new file mode 100644
index 000000000..63e8169c1
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/README
@@ -0,0 +1,41 @@
+# 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 pip:
+
+ pip install selenium
+
+Alternatively, if you used pip to install the libraries required by Toaster,
+selenium will already be installed.
+
+To run tests against Chrome:
+
+* Download chromedriver for your host OS from
+ https://code.google.com/p/chromedriver/downloads/list
+* 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):
+
+* Download and install PhantomJS:
+ http://phantomjs.org/download.html
+* On *nix systems, put phantomjs on PATH
+* Not tested on Windows
+
+Firefox should work without requiring additional software to be installed.
+
+The test case will instantiate a Selenium driver set by the
+TOASTER_TESTS_BROWSER environment variable, or Chrome if this is not specified.
+
+Available drivers:
+
+* chrome (default)
+* firefox
+* ie
+* phantomjs
+
+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/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/__init__.py b/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/__init__.py
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/selenium_helpers.py b/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/selenium_helpers.py
new file mode 100644
index 000000000..56dbe2b34
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/selenium_helpers.py
@@ -0,0 +1,204 @@
+#! /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
+
+from django.contrib.staticfiles.testing import StaticLiveServerTestCase
+from selenium import webdriver
+from selenium.webdriver.support.ui import WebDriverWait
+from selenium.common.exceptions import NoSuchElementException, \
+ StaleElementReferenceException, TimeoutException
+
+def create_selenium_driver(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 == 'ie':
+ return webdriver.Ie()
+ elif browser == 'phantomjs':
+ return webdriver.PhantomJS()
+ 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 SeleniumTestCase(StaticLiveServerTestCase):
+ """
+ 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(SeleniumTestCase, cls).setUpClass()
+
+ # instantiate the Selenium webdriver once for all the test methods
+ # in this test case
+ cls.driver = create_selenium_driver()
+
+ @classmethod
+ def tearDownClass(cls):
+ """ Clean up webdriver driver """
+
+ cls.driver.quit()
+ super(SeleniumTestCase, 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 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/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_all_builds_page.py b/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_all_builds_page.py
new file mode 100644
index 000000000..e4223f482
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_all_builds_page.py
@@ -0,0 +1,143 @@
+#! /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.default_project_build_success = {
+ 'project': self.default_project,
+ 'started_on': now,
+ 'completed_on': now,
+ 'outcome': Build.SUCCEEDED
+ }
+
+ 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 run again button for command-line builds
+ selector = 'div[data-latest-build-result="%s"] button' % default_build.id
+ run_again_button = self.find_all(selector)
+ self.assertEqual(len(run_again_button), 0,
+ 'should not see a run again button for cli builds')
+
+ # should see a run again button for non-command-line builds
+ selector = 'div[data-latest-build-result="%s"] button' % build1.id
+ run_again_button = self.find_all(selector)
+ self.assertEqual(len(run_again_button), 1,
+ 'should see a run again 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 = 'i.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)
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_all_projects_page.py b/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_all_projects_page.py
new file mode 100644
index 000000000..ed8e620db
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_all_projects_page.py
@@ -0,0 +1,214 @@
+#! /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('#no-results-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'))
+
+ # 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.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"] a'
+ 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'))
+
+ # 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.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"] a'
+ 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/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_builddashboard_page.py b/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_builddashboard_page.py
new file mode 100644
index 000000000..5e0874947
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_builddashboard_page.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 -*-
+#
+# 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 selenium_helpers import SeleniumTestCase
+
+from orm.models import Project, Release, BitbakeVersion, Build, LogMessage
+from orm.models import Layer, Layer_Version, Recipe, CustomImageRecipe
+
+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)
+
+ self.build2 = Build.objects.create(project=project,
+ started_on=now,
+ completed_on=now)
+
+ # 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
+ )
+
+ # 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
+ )
+
+ # 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-error')
+
+ def _check_for_log_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.assertEqual(len(errors), 2)
+
+ expected_text = log_message.message
+ expected_id = str(log_message.id)
+
+ found = False
+ for error in errors:
+ error_text = error.find_element_by_tag_name('pre').text
+ text_matches = (error_text == expected_text)
+
+ error_id = error.get_attribute('data-error')
+ id_matches = (error_id == expected_id)
+
+ if text_matches and id_matches:
+ found = True
+ break
+
+ template_vars = (expected_text, error_text,
+ expected_id, error_id)
+ assertion_error_msg = 'exception not found as error: ' \
+ 'expected text "%s" and got "%s"; ' \
+ 'expected ID %s and got %s' % template_vars
+ self.assertTrue(found, assertion_error_msg)
+
+ 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_tag_name('label')
+
+ # because the label content has the structure
+ # label text
+ # <input...>
+ # we have to regex on its innerHTML, as we can't just retrieve the
+ # "label text" on its own via the Selenium API
+ labels_text = sorted(map(
+ lambda label: label.get_attribute('innerHTML'), labels
+ ))
+
+ expected = sorted(expected)
+
+ self.assertEqual(len(labels_text), len(expected))
+
+ for idx, label_text in enumerate(labels_text):
+ self.assertRegexpMatches(label_text, expected[idx])
+
+ def test_exceptions_show_as_errors(self):
+ """
+ LogMessages with level EXCEPTION should display in the errors
+ section of the page
+ """
+ self._check_for_log_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_log_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)
+ modal = self.driver.find_element_by_id('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"] button'
+ self.click(selector)
+
+ modal = self.driver.find_element_by_id('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)
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_js_unit_tests.py b/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_js_unit_tests.py
new file mode 100644
index 000000000..e63da8e7a
--- /dev/null
+++ b/import-layers/yocto-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('#tests-failed')
+
+ failed = self.find("#tests-failed").text
+ passed = self.find("#tests-passed").text
+ total = self.find("#tests-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/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_landing_page.py b/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_landing_page.py
new file mode 100644
index 000000000..4d4cd660f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_new_custom_image_page.py b/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_new_custom_image_page.py
new file mode 100644
index 000000000..8906cb27d
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_new_custom_image_page.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 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(),
+ 'recipe 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/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_project_builds_page.py b/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_project_builds_page.py
new file mode 100644
index 000000000..9fe91ab06
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_project_page.py b/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_project_page.py
new file mode 100644
index 000000000..786bef1c6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_sample.py b/import-layers/yocto-poky/bitbake/lib/toaster/tests/browser/test_sample.py
new file mode 100644
index 000000000..7bb8b97e8
--- /dev/null
+++ b/import-layers/yocto-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('span.brand a')
+ self.assertEqual(brand_link.text.strip(), 'Toaster')
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/tests/toaster-tests-requirements.txt b/import-layers/yocto-poky/bitbake/lib/toaster/tests/toaster-tests-requirements.txt
new file mode 100644
index 000000000..4f9fcc46d
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/tests/toaster-tests-requirements.txt
@@ -0,0 +1 @@
+selenium==2.49.2
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/__init__.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/__init__.py
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/api.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/api.py
new file mode 100644
index 000000000..42901f750
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/api.py
@@ -0,0 +1,110 @@
+#
+# 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.
+
+
+# Temporary home for the UI's misc API
+
+from orm.models import Project, ProjectTarget, Build
+from bldcontrol.models import BuildRequest
+from bldcontrol import bbcontroller
+from django.http import HttpResponse, JsonResponse
+from django.views.generic import View
+
+
+class XhrBuildRequest(View):
+
+ def get(self, request, *args, **kwargs):
+ return HttpResponse()
+
+ 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)
+
+ 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()
+
+ except BuildRequest.DoesNotExist:
+ return JsonResponse({'error':'No such build id %s' % i})
+
+ return JsonResponse({'error': '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 JsonResponse({'error': 'ok' })
+
+ if 'targets' in request.POST:
+ ProjectTarget.objects.filter(project = project).delete()
+ s = str(request.POST['targets'])
+ for t in s.translate(None, ";%|\"").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 JsonResponse({'error': 'ok' })
+
+ response = HttpResponse()
+ response.status_code = 500
+ return response
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/fixtures/toastergui-unittest-data.xml b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/fixtures/toastergui-unittest-data.xml
new file mode 100644
index 000000000..cf35be4be
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/fixtures/toastergui-unittest-data.xml
@@ -0,0 +1,446 @@
+<?xml version="1.0" encoding="utf-8"?>
+<django-objects version="1.0">
+ <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">False</field>
+ <field type="IntegerField" name="image_size">0</field>
+ <field type="CharField" name="license_manifest_path"><None></None></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">2</field>
+ <field type="CharField" name="name">f 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">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 to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
+ <field type="IntegerField" name="up_id"><None></None></field>
+ <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 to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
+ <field type="IntegerField" name="up_id"><None></None></field>
+ <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 to="orm.layersource" name="layer_source" rel="ManyToOneRel"><None></None></field>
+ <field type="IntegerField" name="up_id"><None></None></field>
+ <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 to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
+ <field type="IntegerField" name="up_id"><None></None></field>
+ <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 to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
+ <field type="IntegerField" name="up_id"><None></None></field>
+ <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 to="orm.layersource" name="layer_source" rel="ManyToOneRel"><None></None></field>
+ <field type="IntegerField" name="up_id"><None></None></field>
+ <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>
+ <object pk="1" model="orm.machine">
+ <field to="orm.layersource" name="layer_source" rel="ManyToOneRel"><None></None></field>
+ <field type="IntegerField" name="up_id"><None></None></field>
+ <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 to="orm.layersource" name="layer_source" rel="ManyToOneRel"><None></None></field>
+ <field type="IntegerField" name="up_id"><None></None></field>
+ <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 to="orm.layersource" name="layer_source" rel="ManyToOneRel"><None></None></field>
+ <field type="IntegerField" name="up_id"><None></None></field>
+ <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.layersource">
+ <field type="CharField" name="name">local</field>
+ <field type="IntegerField" name="sourcetype">1</field>
+ <field type="CharField" name="apiurl"></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.releaselayersourcepriority">
+ <field to="orm.release" name="release" rel="ManyToOneRel">1</field>
+ <field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
+ <field type="IntegerField" name="priority">0</field>
+ </object>
+ <object pk="1" model="orm.branch">
+ <field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
+ <field type="IntegerField" name="up_id"><None></None></field>
+ <field type="DateTimeField" name="up_date"><None></None></field>
+ <field type="CharField" name="name">master</field>
+ <field type="CharField" name="short_description"></field>
+ </object>
+ <object pk="1" model="orm.layer">
+ <field to="orm.layersource" name="layer_source" rel="ManyToOneRel"><None></None></field>
+ <field type="IntegerField" name="up_id"><None></None></field>
+ <field type="DateTimeField" name="up_date"><None></None></field>
+ <field type="CharField" name="name">a layer</field>
+ <field type="CharField" name="layer_index_url"></field>
+ <field type="CharField" name="vcs_url">/tmp/</field>
+ <field type="CharField" name="vcs_web_url"><None></None></field>
+ <field type="CharField" name="vcs_web_tree_base_url"><None></None></field>
+ <field type="CharField" name="vcs_web_file_base_url"><None></None></field>
+ <field type="TextField" name="summary"><None></None></field>
+ <field type="TextField" name="description"><None></None></field>
+ </object>
+ <object pk="2" model="orm.layer">
+ <field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
+ <field type="IntegerField" name="up_id"><None></None></field>
+ <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>
+ <field type="CharField" name="vcs_web_url"><None></None></field>
+ <field type="CharField" name="vcs_web_tree_base_url"><None></None></field>
+ <field type="CharField" name="vcs_web_file_base_url"><None></None></field>
+ <field type="TextField" name="summary"><None></None></field>
+ <field type="TextField" name="description"><None></None></field>
+ </object>
+ <object pk="1" model="orm.layer_version">
+ <field to="orm.build" name="build" rel="ManyToOneRel"><None></None></field>
+ <field to="orm.layer" name="layer" rel="ManyToOneRel">1</field>
+ <field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
+ <field type="IntegerField" name="up_id"><None></None></field>
+ <field type="DateTimeField" name="up_date"><None></None></field>
+ <field to="orm.branch" name="up_branch" rel="ManyToOneRel">1</field>
+ <field type="CharField" name="branch"></field>
+ <field type="CharField" name="commit">master</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 to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
+ <field type="IntegerField" name="up_id"><None></None></field>
+ <field type="DateTimeField" name="up_date"><None></None></field>
+ <field to="orm.branch" name="up_branch" rel="ManyToOneRel">1</field>
+ <field type="CharField" name="branch"></field>
+ <field type="CharField" name="commit">master</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>
+</django-objects>
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/bootstrap-responsive.min.css b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/bootstrap-responsive.min.css
new file mode 100755
index 000000000..059786010
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/bootstrap-responsive.min.css
@@ -0,0 +1,9 @@
+/*!
+ * Bootstrap Responsive v2.3.0
+ *
+ * Copyright 2012 Twitter, Inc
+ * Licensed under the Apache License v2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Designed and built with all the love in the world @twitter by @mdo and @fat.
+ */.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}@-ms-viewport{width:device-width}.hidden{display:none;visibility:hidden}.visible-phone{display:none!important}.visible-tablet{display:none!important}.hidden-desktop{display:none!important}.visible-desktop{display:inherit!important}@media(min-width:768px) and (max-width:979px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-tablet{display:inherit!important}.hidden-tablet{display:none!important}}@media(max-width:767px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-phone{display:inherit!important}.hidden-phone{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:inherit!important}.hidden-print{display:none!important}}@media(min-width:1200px){.row{margin-left:-30px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:30px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:1170px}.span12{width:1170px}.span11{width:1070px}.span10{width:970px}.span9{width:870px}.span8{width:770px}.span7{width:670px}.span6{width:570px}.span5{width:470px}.span4{width:370px}.span3{width:270px}.span2{width:170px}.span1{width:70px}.offset12{margin-left:1230px}.offset11{margin-left:1130px}.offset10{margin-left:1030px}.offset9{margin-left:930px}.offset8{margin-left:830px}.offset7{margin-left:730px}.offset6{margin-left:630px}.offset5{margin-left:530px}.offset4{margin-left:430px}.offset3{margin-left:330px}.offset2{margin-left:230px}.offset1{margin-left:130px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.564102564102564%;*margin-left:2.5109110747408616%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.564102564102564%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.45299145299145%;*width:91.39979996362975%}.row-fluid .span10{width:82.90598290598291%;*width:82.8527914166212%}.row-fluid .span9{width:74.35897435897436%;*width:74.30578286961266%}.row-fluid .span8{width:65.81196581196582%;*width:65.75877432260411%}.row-fluid .span7{width:57.26495726495726%;*width:57.21176577559556%}.row-fluid .span6{width:48.717948717948715%;*width:48.664757228587014%}.row-fluid .span5{width:40.17094017094017%;*width:40.11774868157847%}.row-fluid .span4{width:31.623931623931625%;*width:31.570740134569924%}.row-fluid .span3{width:23.076923076923077%;*width:23.023731587561375%}.row-fluid .span2{width:14.52991452991453%;*width:14.476723040552828%}.row-fluid .span1{width:5.982905982905983%;*width:5.929714493544281%}.row-fluid .offset12{margin-left:105.12820512820512%;*margin-left:105.02182214948171%}.row-fluid .offset12:first-child{margin-left:102.56410256410257%;*margin-left:102.45771958537915%}.row-fluid .offset11{margin-left:96.58119658119658%;*margin-left:96.47481360247316%}.row-fluid .offset11:first-child{margin-left:94.01709401709402%;*margin-left:93.91071103837061%}.row-fluid .offset10{margin-left:88.03418803418803%;*margin-left:87.92780505546462%}.row-fluid .offset10:first-child{margin-left:85.47008547008548%;*margin-left:85.36370249136206%}.row-fluid .offset9{margin-left:79.48717948717949%;*margin-left:79.38079650845607%}.row-fluid .offset9:first-child{margin-left:76.92307692307693%;*margin-left:76.81669394435352%}.row-fluid .offset8{margin-left:70.94017094017094%;*margin-left:70.83378796144753%}.row-fluid .offset8:first-child{margin-left:68.37606837606839%;*margin-left:68.26968539734497%}.row-fluid .offset7{margin-left:62.393162393162385%;*margin-left:62.28677941443899%}.row-fluid .offset7:first-child{margin-left:59.82905982905982%;*margin-left:59.72267685033642%}.row-fluid .offset6{margin-left:53.84615384615384%;*margin-left:53.739770867430444%}.row-fluid .offset6:first-child{margin-left:51.28205128205128%;*margin-left:51.175668303327875%}.row-fluid .offset5{margin-left:45.299145299145295%;*margin-left:45.1927623204219%}.row-fluid .offset5:first-child{margin-left:42.73504273504273%;*margin-left:42.62865975631933%}.row-fluid .offset4{margin-left:36.75213675213675%;*margin-left:36.645753773413354%}.row-fluid .offset4:first-child{margin-left:34.18803418803419%;*margin-left:34.081651209310785%}.row-fluid .offset3{margin-left:28.205128205128204%;*margin-left:28.0987452264048%}.row-fluid .offset3:first-child{margin-left:25.641025641025642%;*margin-left:25.53464266230224%}.row-fluid .offset2{margin-left:19.65811965811966%;*margin-left:19.551736679396257%}.row-fluid .offset2:first-child{margin-left:17.094017094017094%;*margin-left:16.98763411529369%}.row-fluid .offset1{margin-left:11.11111111111111%;*margin-left:11.004728132387708%}.row-fluid .offset1:first-child{margin-left:8.547008547008547%;*margin-left:8.440625568285142%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:30px}input.span12,textarea.span12,.uneditable-input.span12{width:1156px}input.span11,textarea.span11,.uneditable-input.span11{width:1056px}input.span10,textarea.span10,.uneditable-input.span10{width:956px}input.span9,textarea.span9,.uneditable-input.span9{width:856px}input.span8,textarea.span8,.uneditable-input.span8{width:756px}input.span7,textarea.span7,.uneditable-input.span7{width:656px}input.span6,textarea.span6,.uneditable-input.span6{width:556px}input.span5,textarea.span5,.uneditable-input.span5{width:456px}input.span4,textarea.span4,.uneditable-input.span4{width:356px}input.span3,textarea.span3,.uneditable-input.span3{width:256px}input.span2,textarea.span2,.uneditable-input.span2{width:156px}input.span1,textarea.span1,.uneditable-input.span1{width:56px}.thumbnails{margin-left:-30px}.thumbnails>li{margin-left:30px}.row-fluid .thumbnails{margin-left:0}}@media(min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:724px}.span12{width:724px}.span11{width:662px}.span10{width:600px}.span9{width:538px}.span8{width:476px}.span7{width:414px}.span6{width:352px}.span5{width:290px}.span4{width:228px}.span3{width:166px}.span2{width:104px}.span1{width:42px}.offset12{margin-left:764px}.offset11{margin-left:702px}.offset10{margin-left:640px}.offset9{margin-left:578px}.offset8{margin-left:516px}.offset7{margin-left:454px}.offset6{margin-left:392px}.offset5{margin-left:330px}.offset4{margin-left:268px}.offset3{margin-left:206px}.offset2{margin-left:144px}.offset1{margin-left:82px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.7624309392265194%;*margin-left:2.709239449864817%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.7624309392265194%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.43646408839778%;*width:91.38327259903608%}.row-fluid .span10{width:82.87292817679558%;*width:82.81973668743387%}.row-fluid .span9{width:74.30939226519337%;*width:74.25620077583166%}.row-fluid .span8{width:65.74585635359117%;*width:65.69266486422946%}.row-fluid .span7{width:57.18232044198895%;*width:57.12912895262725%}.row-fluid .span6{width:48.61878453038674%;*width:48.56559304102504%}.row-fluid .span5{width:40.05524861878453%;*width:40.00205712942283%}.row-fluid .span4{width:31.491712707182323%;*width:31.43852121782062%}.row-fluid .span3{width:22.92817679558011%;*width:22.87498530621841%}.row-fluid .span2{width:14.3646408839779%;*width:14.311449394616199%}.row-fluid .span1{width:5.801104972375691%;*width:5.747913483013988%}.row-fluid .offset12{margin-left:105.52486187845304%;*margin-left:105.41847889972962%}.row-fluid .offset12:first-child{margin-left:102.76243093922652%;*margin-left:102.6560479605031%}.row-fluid .offset11{margin-left:96.96132596685082%;*margin-left:96.8549429881274%}.row-fluid .offset11:first-child{margin-left:94.1988950276243%;*margin-left:94.09251204890089%}.row-fluid .offset10{margin-left:88.39779005524862%;*margin-left:88.2914070765252%}.row-fluid .offset10:first-child{margin-left:85.6353591160221%;*margin-left:85.52897613729868%}.row-fluid .offset9{margin-left:79.8342541436464%;*margin-left:79.72787116492299%}.row-fluid .offset9:first-child{margin-left:77.07182320441989%;*margin-left:76.96544022569647%}.row-fluid .offset8{margin-left:71.2707182320442%;*margin-left:71.16433525332079%}.row-fluid .offset8:first-child{margin-left:68.50828729281768%;*margin-left:68.40190431409427%}.row-fluid .offset7{margin-left:62.70718232044199%;*margin-left:62.600799341718584%}.row-fluid .offset7:first-child{margin-left:59.94475138121547%;*margin-left:59.838368402492065%}.row-fluid .offset6{margin-left:54.14364640883978%;*margin-left:54.037263430116376%}.row-fluid .offset6:first-child{margin-left:51.38121546961326%;*margin-left:51.27483249088986%}.row-fluid .offset5{margin-left:45.58011049723757%;*margin-left:45.47372751851417%}.row-fluid .offset5:first-child{margin-left:42.81767955801105%;*margin-left:42.71129657928765%}.row-fluid .offset4{margin-left:37.01657458563536%;*margin-left:36.91019160691196%}.row-fluid .offset4:first-child{margin-left:34.25414364640884%;*margin-left:34.14776066768544%}.row-fluid .offset3{margin-left:28.45303867403315%;*margin-left:28.346655695309746%}.row-fluid .offset3:first-child{margin-left:25.69060773480663%;*margin-left:25.584224756083227%}.row-fluid .offset2{margin-left:19.88950276243094%;*margin-left:19.783119783707537%}.row-fluid .offset2:first-child{margin-left:17.12707182320442%;*margin-left:17.02068884448102%}.row-fluid .offset1{margin-left:11.32596685082873%;*margin-left:11.219583872105325%}.row-fluid .offset1:first-child{margin-left:8.56353591160221%;*margin-left:8.457152932878806%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:710px}input.span11,textarea.span11,.uneditable-input.span11{width:648px}input.span10,textarea.span10,.uneditable-input.span10{width:586px}input.span9,textarea.span9,.uneditable-input.span9{width:524px}input.span8,textarea.span8,.uneditable-input.span8{width:462px}input.span7,textarea.span7,.uneditable-input.span7{width:400px}input.span6,textarea.span6,.uneditable-input.span6{width:338px}input.span5,textarea.span5,.uneditable-input.span5{width:276px}input.span4,textarea.span4,.uneditable-input.span4{width:214px}input.span3,textarea.span3,.uneditable-input.span3{width:152px}input.span2,textarea.span2,.uneditable-input.span2{width:90px}input.span1,textarea.span1,.uneditable-input.span1{width:28px}}@media(max-width:767px){body{padding-right:20px;padding-left:20px}.navbar-fixed-top,.navbar-fixed-bottom,.navbar-static-top{margin-right:-20px;margin-left:-20px}.container-fluid{padding:0}.dl-horizontal dt{float:none;width:auto;clear:none;text-align:left}.dl-horizontal dd{margin-left:0}.container{width:auto}.row-fluid{width:100%}.row,.thumbnails{margin-left:0}.thumbnails>li{float:none;margin-left:0}[class*="span"],.uneditable-input[class*="span"],.row-fluid [class*="span"]{display:block;float:none;width:100%;margin-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.span12,.row-fluid .span12{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="offset"]:first-child{margin-left:0}.input-large,.input-xlarge,.input-xxlarge,input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.input-prepend input,.input-append input,.input-prepend input[class*="span"],.input-append input[class*="span"]{display:inline-block;width:auto}.controls-row [class*="span"]+[class*="span"]{margin-left:0}.modal{position:fixed;top:20px;right:20px;left:20px;width:auto;margin:0}.modal.fade{top:-100px}.modal.fade.in{top:20px}}@media(max-width:480px){.nav-collapse{-webkit-transform:translate3d(0,0,0)}.page-header h1 small{display:block;line-height:20px}input[type="checkbox"],input[type="radio"]{border:1px solid #ccc}.form-horizontal .control-label{float:none;width:auto;padding-top:0;text-align:left}.form-horizontal .controls{margin-left:0}.form-horizontal .control-list{padding-top:0}.form-horizontal .form-actions{padding-right:10px;padding-left:10px}.media .pull-left,.media .pull-right{display:block;float:none;margin-bottom:10px}.media-object{margin-right:0;margin-left:0}.modal{top:10px;right:10px;left:10px}.modal-header .close{padding:10px;margin:-10px}.carousel-caption{position:static}}@media(max-width:979px){body{padding-top:0}.navbar-fixed-top,.navbar-fixed-bottom{position:static}.navbar-fixed-top{margin-bottom:20px}.navbar-fixed-bottom{margin-top:20px}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding:5px}.navbar .container{width:auto;padding:0}.navbar .brand{padding-right:10px;padding-left:10px;margin:0 0 0 -5px}.nav-collapse{clear:both}.nav-collapse .nav{float:none;margin:0 0 10px}.nav-collapse .nav>li{float:none}.nav-collapse .nav>li>a{margin-bottom:2px}.nav-collapse .nav>.divider-vertical{display:none}.nav-collapse .nav .nav-header{color:#777;text-shadow:none}.nav-collapse .nav>li>a,.nav-collapse .dropdown-menu a{padding:9px 15px;font-weight:bold;color:#777;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.nav-collapse .btn{padding:4px 10px 4px;font-weight:normal;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.nav-collapse .dropdown-menu li+li a{margin-bottom:2px}.nav-collapse .nav>li>a:hover,.nav-collapse .nav>li>a:focus,.nav-collapse .dropdown-menu a:hover,.nav-collapse .dropdown-menu a:focus{background-color:#f2f2f2}.navbar-inverse .nav-collapse .nav>li>a,.navbar-inverse .nav-collapse .dropdown-menu a{color:#999}.navbar-inverse .nav-collapse .nav>li>a:hover,.navbar-inverse .nav-collapse .nav>li>a:focus,.navbar-inverse .nav-collapse .dropdown-menu a:hover,.navbar-inverse .nav-collapse .dropdown-menu a:focus{background-color:#111}.nav-collapse.in .btn-group{padding:0;margin-top:5px}.nav-collapse .dropdown-menu{position:static;top:auto;left:auto;display:none;float:none;max-width:none;padding:0;margin:0 15px;background-color:transparent;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.nav-collapse .open>.dropdown-menu{display:block}.nav-collapse .dropdown-menu:before,.nav-collapse .dropdown-menu:after{display:none}.nav-collapse .dropdown-menu .divider{display:none}.nav-collapse .nav>li>.dropdown-menu:before,.nav-collapse .nav>li>.dropdown-menu:after{display:none}.nav-collapse .navbar-form,.nav-collapse .navbar-search{float:none;padding:10px 15px;margin:10px 0;border-top:1px solid #f2f2f2;border-bottom:1px solid #f2f2f2;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}.navbar-inverse .nav-collapse .navbar-form,.navbar-inverse .nav-collapse .navbar-search{border-top-color:#111;border-bottom-color:#111}.navbar .nav-collapse .nav.pull-right{float:none;margin-left:0}.nav-collapse,.nav-collapse.collapse{height:0;overflow:hidden}.navbar .btn-navbar{display:block}.navbar-static .navbar-inner{padding-right:10px;padding-left:10px}}@media(min-width:980px){.nav-collapse.collapse{height:auto!important;overflow:visible!important}}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/bootstrap.min.css b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/bootstrap.min.css
new file mode 100755
index 000000000..2b927f84e
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/bootstrap.min.css
@@ -0,0 +1,9 @@
+/*!
+ * Bootstrap v2.3.0
+ *
+ * Copyright 2012 Twitter, Inc
+ * Licensed under the Apache License v2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Designed and built with all the love in the world @twitter by @mdo and @fat.
+ */.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}a:hover,a:active{outline:0}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{width:auto\9;height:auto;max-width:100%;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic}#map_canvas img,.google-maps img{max-width:none}button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle}button,input{*overflow:visible;line-height:normal}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}button,html input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button}label,select,button,input[type="button"],input[type="reset"],input[type="submit"],input[type="radio"],input[type="checkbox"]{cursor:pointer}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-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none}textarea{overflow:auto;vertical-align:top}@media print{*{color:#000!important;text-shadow:none!important;background:transparent!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]: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}@page{margin:.5cm}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}}body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;color:#333;background-color:#fff}a{color:#08c;text-decoration:none}a:hover,a:focus{color:#005580;text-decoration:underline}.img-rounded{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.img-polaroid{padding:4px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.1);box-shadow:0 1px 3px rgba(0,0,0,0.1)}.img-circle{-webkit-border-radius:500px;-moz-border-radius:500px;border-radius:500px}.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.span12{width:940px}.span11{width:860px}.span10{width:780px}.span9{width:700px}.span8{width:620px}.span7{width:540px}.span6{width:460px}.span5{width:380px}.span4{width:300px}.span3{width:220px}.span2{width:140px}.span1{width:60px}.offset12{margin-left:980px}.offset11{margin-left:900px}.offset10{margin-left:820px}.offset9{margin-left:740px}.offset8{margin-left:660px}.offset7{margin-left:580px}.offset6{margin-left:500px}.offset5{margin-left:420px}.offset4{margin-left:340px}.offset3{margin-left:260px}.offset2{margin-left:180px}.offset1{margin-left:100px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.127659574468085%;*margin-left:2.074468085106383%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.127659574468085%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.48936170212765%;*width:91.43617021276594%}.row-fluid .span10{width:82.97872340425532%;*width:82.92553191489361%}.row-fluid .span9{width:74.46808510638297%;*width:74.41489361702126%}.row-fluid .span8{width:65.95744680851064%;*width:65.90425531914893%}.row-fluid .span7{width:57.44680851063829%;*width:57.39361702127659%}.row-fluid .span6{width:48.93617021276595%;*width:48.88297872340425%}.row-fluid .span5{width:40.42553191489362%;*width:40.37234042553192%}.row-fluid .span4{width:31.914893617021278%;*width:31.861702127659576%}.row-fluid .span3{width:23.404255319148934%;*width:23.351063829787233%}.row-fluid .span2{width:14.893617021276595%;*width:14.840425531914894%}.row-fluid .span1{width:6.382978723404255%;*width:6.329787234042553%}.row-fluid .offset12{margin-left:104.25531914893617%;*margin-left:104.14893617021275%}.row-fluid .offset12:first-child{margin-left:102.12765957446808%;*margin-left:102.02127659574467%}.row-fluid .offset11{margin-left:95.74468085106382%;*margin-left:95.6382978723404%}.row-fluid .offset11:first-child{margin-left:93.61702127659574%;*margin-left:93.51063829787232%}.row-fluid .offset10{margin-left:87.23404255319149%;*margin-left:87.12765957446807%}.row-fluid .offset10:first-child{margin-left:85.1063829787234%;*margin-left:84.99999999999999%}.row-fluid .offset9{margin-left:78.72340425531914%;*margin-left:78.61702127659572%}.row-fluid .offset9:first-child{margin-left:76.59574468085106%;*margin-left:76.48936170212764%}.row-fluid .offset8{margin-left:70.2127659574468%;*margin-left:70.10638297872339%}.row-fluid .offset8:first-child{margin-left:68.08510638297872%;*margin-left:67.9787234042553%}.row-fluid .offset7{margin-left:61.70212765957446%;*margin-left:61.59574468085106%}.row-fluid .offset7:first-child{margin-left:59.574468085106375%;*margin-left:59.46808510638297%}.row-fluid .offset6{margin-left:53.191489361702125%;*margin-left:53.085106382978715%}.row-fluid .offset6:first-child{margin-left:51.063829787234035%;*margin-left:50.95744680851063%}.row-fluid .offset5{margin-left:44.68085106382979%;*margin-left:44.57446808510638%}.row-fluid .offset5:first-child{margin-left:42.5531914893617%;*margin-left:42.4468085106383%}.row-fluid .offset4{margin-left:36.170212765957444%;*margin-left:36.06382978723405%}.row-fluid .offset4:first-child{margin-left:34.04255319148936%;*margin-left:33.93617021276596%}.row-fluid .offset3{margin-left:27.659574468085104%;*margin-left:27.5531914893617%}.row-fluid .offset3:first-child{margin-left:25.53191489361702%;*margin-left:25.425531914893618%}.row-fluid .offset2{margin-left:19.148936170212764%;*margin-left:19.04255319148936%}.row-fluid .offset2:first-child{margin-left:17.02127659574468%;*margin-left:16.914893617021278%}.row-fluid .offset1{margin-left:10.638297872340425%;*margin-left:10.53191489361702%}.row-fluid .offset1:first-child{margin-left:8.51063829787234%;*margin-left:8.404255319148938%}[class*="span"].hide,.row-fluid [class*="span"].hide{display:none}[class*="span"].pull-right,.row-fluid [class*="span"].pull-right{float:right}.container{margin-right:auto;margin-left:auto;*zoom:1}.container:before,.container:after{display:table;line-height:0;content:""}.container:after{clear:both}.container-fluid{padding-right:20px;padding-left:20px;*zoom:1}.container-fluid:before,.container-fluid:after{display:table;line-height:0;content:""}.container-fluid:after{clear:both}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:21px;font-weight:200;line-height:30px}small{font-size:85%}strong{font-weight:bold}em{font-style:italic}cite{font-style:normal}.muted{color:#999}a.muted:hover,a.muted:focus{color:#808080}.text-warning{color:#c09853}a.text-warning:hover,a.text-warning:focus{color:#a47e3c}.text-error{color:#b94a48}a.text-error:hover,a.text-error:focus{color:#953b39}.text-info{color:#3a87ad}a.text-info:hover,a.text-info:focus{color:#2d6987}.text-success{color:#468847}a.text-success:hover,a.text-success:focus{color:#356635}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}h1,h2,h3,h4,h5,h6{margin:10px 0;font-family:inherit;font-weight:bold;line-height:20px;color:inherit;text-rendering:optimizelegibility}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-weight:normal;line-height:1;color:#999}h1,h2,h3{line-height:40px}h1{font-size:38.5px}h2{font-size:31.5px}h3{font-size:24.5px}h4{font-size:17.5px}h5{font-size:14px}h6{font-size:11.9px}h1 small{font-size:24.5px}h2 small{font-size:17.5px}h3 small{font-size:14px}h4 small{font-size:14px}.page-header{padding-bottom:9px;margin:20px 0 30px;border-bottom:1px solid #eee}ul,ol{padding:0;margin:0 0 10px 25px}ul ul,ul ol,ol ol,ol ul{margin-bottom:0}li{line-height:20px}ul.unstyled,ol.unstyled{margin-left:0;list-style:none}ul.inline,ol.inline{margin-left:0;list-style:none}ul.inline>li,ol.inline>li{display:inline-block;*display:inline;padding-right:5px;padding-left:5px;*zoom:1}dl{margin-bottom:20px}dt,dd{line-height:20px}dt{font-weight:bold}dd{margin-left:10px}.dl-horizontal{*zoom:1}.dl-horizontal:before,.dl-horizontal:after{display:table;line-height:0;content:""}.dl-horizontal:after{clear:both}.dl-horizontal dt{float:left;width:200px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:220px}hr{margin:20px 0;border:0;border-top:1px solid #eee;border-bottom:1px solid #fff}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999}abbr.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:0 0 0 15px;margin:0 0 20px;border-left:5px solid #eee}blockquote p{margin-bottom:0;font-size:17.5px;font-weight:300;line-height:1.25}blockquote small{display:block;line-height:20px;color:#999}blockquote small:before{content:'\2014 \00A0'}blockquote.pull-right{float:right;padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0}blockquote.pull-right p,blockquote.pull-right small{text-align:right}blockquote.pull-right small:before{content:''}blockquote.pull-right small:after{content:'\00A0 \2014'}q:before,q:after,blockquote:before,blockquote:after{content:""}address{display:block;margin-bottom:20px;font-style:normal;line-height:20px}code,pre{padding:0 3px 2px;font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:12px;color:#333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}code{padding:2px 4px;color:#d14;white-space:nowrap;background-color:#f7f7f9;border:1px solid #e1e1e8}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:20px;word-break:break-all;word-wrap:break-word;white-space:pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}pre.prettyprint{margin-bottom:20px}pre code{padding:0;color:inherit;white-space:pre;white-space:pre-wrap;background-color:transparent;border:0}.pre-scrollable{max-height:340px;overflow-y:scroll}form{margin:0 0 20px}fieldset{padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:40px;color:#333;border:0;border-bottom:1px solid #e5e5e5}legend small{font-size:15px;color:#999}label,input,button,select,textarea{font-size:14px;font-weight:normal;line-height:20px}input,button,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif}label{display:block;margin-bottom:5px}select,textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{display:inline-block;height:20px;padding:4px 6px;margin-bottom:10px;font-size:14px;line-height:20px;color:#555;vertical-align:middle;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}input,textarea,.uneditable-input{width:206px}textarea{height:auto}textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{background-color:#fff;border:1px solid #ccc;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border linear .2s,box-shadow linear .2s;-moz-transition:border linear .2s,box-shadow linear .2s;-o-transition:border linear .2s,box-shadow linear .2s;transition:border linear .2s,box-shadow linear .2s}textarea:focus,input[type="text"]:focus,input[type="password"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="time"]:focus,input[type="week"]:focus,input[type="number"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="color"]:focus,.uneditable-input:focus{border-color:rgba(82,168,236,0.8);outline:0;outline:thin dotted \9;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;*margin-top:0;line-height:normal}input[type="file"],input[type="image"],input[type="submit"],input[type="reset"],input[type="button"],input[type="radio"],input[type="checkbox"]{width:auto}select,input[type="file"]{height:30px;*margin-top:4px;line-height:30px}select{width:220px;background-color:#fff;border:1px solid #ccc}select[multiple],select[size]{height:auto}select:focus,input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.uneditable-input,.uneditable-textarea{color:#999;cursor:not-allowed;background-color:#fcfcfc;border-color:#ccc;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);box-shadow:inset 0 1px 2px rgba(0,0,0,0.025)}.uneditable-input{overflow:hidden;white-space:nowrap}.uneditable-textarea{width:auto;height:auto}input:-moz-placeholder,textarea:-moz-placeholder{color:#999}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#999}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#999}.radio,.checkbox{min-height:20px;padding-left:20px}.radio input[type="radio"],.checkbox input[type="checkbox"]{float:left;margin-left:-20px}.controls>.radio:first-child,.controls>.checkbox:first-child{padding-top:5px}.radio.inline,.checkbox.inline{display:inline-block;padding-top:5px;margin-bottom:0;vertical-align:middle}.radio.inline+.radio.inline,.checkbox.inline+.checkbox.inline{margin-left:10px}.input-mini{width:60px}.input-small{width:90px}.input-medium{width:150px}.input-large{width:210px}.input-xlarge{width:270px}.input-xxlarge{width:530px}input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"]{float:none;margin-left:0}.input-append input[class*="span"],.input-append .uneditable-input[class*="span"],.input-prepend input[class*="span"],.input-prepend .uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"],.row-fluid .input-prepend [class*="span"],.row-fluid .input-append [class*="span"]{display:inline-block}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:926px}input.span11,textarea.span11,.uneditable-input.span11{width:846px}input.span10,textarea.span10,.uneditable-input.span10{width:766px}input.span9,textarea.span9,.uneditable-input.span9{width:686px}input.span8,textarea.span8,.uneditable-input.span8{width:606px}input.span7,textarea.span7,.uneditable-input.span7{width:526px}input.span6,textarea.span6,.uneditable-input.span6{width:446px}input.span5,textarea.span5,.uneditable-input.span5{width:366px}input.span4,textarea.span4,.uneditable-input.span4{width:286px}input.span3,textarea.span3,.uneditable-input.span3{width:206px}input.span2,textarea.span2,.uneditable-input.span2{width:126px}input.span1,textarea.span1,.uneditable-input.span1{width:46px}.controls-row{*zoom:1}.controls-row:before,.controls-row:after{display:table;line-height:0;content:""}.controls-row:after{clear:both}.controls-row [class*="span"],.row-fluid .controls-row [class*="span"]{float:left}.controls-row .checkbox[class*="span"],.controls-row .radio[class*="span"]{padding-top:5px}input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#eee}input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"][readonly],input[type="checkbox"][readonly]{background-color:transparent}.control-group.warning .control-label,.control-group.warning .help-block,.control-group.warning .help-inline{color:#c09853}.control-group.warning .checkbox,.control-group.warning .radio,.control-group.warning input,.control-group.warning select,.control-group.warning textarea{color:#c09853}.control-group.warning input,.control-group.warning select,.control-group.warning textarea{border-color:#c09853;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus{border-color:#a47e3c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e}.control-group.warning .input-prepend .add-on,.control-group.warning .input-append .add-on{color:#c09853;background-color:#fcf8e3;border-color:#c09853}.control-group.error .control-label,.control-group.error .help-block,.control-group.error .help-inline{color:#b94a48}.control-group.error .checkbox,.control-group.error .radio,.control-group.error input,.control-group.error select,.control-group.error textarea{color:#b94a48}.control-group.error input,.control-group.error select,.control-group.error textarea{border-color:#b94a48;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus{border-color:#953b39;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392}.control-group.error .input-prepend .add-on,.control-group.error .input-append .add-on{color:#b94a48;background-color:#f2dede;border-color:#b94a48}.control-group.success .control-label,.control-group.success .help-block,.control-group.success .help-inline{color:#468847}.control-group.success .checkbox,.control-group.success .radio,.control-group.success input,.control-group.success select,.control-group.success textarea{color:#468847}.control-group.success input,.control-group.success select,.control-group.success textarea{border-color:#468847;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus{border-color:#356635;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b}.control-group.success .input-prepend .add-on,.control-group.success .input-append .add-on{color:#468847;background-color:#dff0d8;border-color:#468847}.control-group.info .control-label,.control-group.info .help-block,.control-group.info .help-inline{color:#3a87ad}.control-group.info .checkbox,.control-group.info .radio,.control-group.info input,.control-group.info select,.control-group.info textarea{color:#3a87ad}.control-group.info input,.control-group.info select,.control-group.info textarea{border-color:#3a87ad;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.info input:focus,.control-group.info select:focus,.control-group.info textarea:focus{border-color:#2d6987;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3}.control-group.info .input-prepend .add-on,.control-group.info .input-append .add-on{color:#3a87ad;background-color:#d9edf7;border-color:#3a87ad}input:focus:invalid,textarea:focus:invalid,select:focus:invalid{color:#b94a48;border-color:#ee5f5b}input:focus:invalid:focus,textarea:focus:invalid:focus,select:focus:invalid:focus{border-color:#e9322d;-webkit-box-shadow:0 0 6px #f8b9b7;-moz-box-shadow:0 0 6px #f8b9b7;box-shadow:0 0 6px #f8b9b7}.form-actions{padding:19px 20px 20px;margin-top:20px;margin-bottom:20px;background-color:#f5f5f5;border-top:1px solid #e5e5e5;*zoom:1}.form-actions:before,.form-actions:after{display:table;line-height:0;content:""}.form-actions:after{clear:both}.help-block,.help-inline{color:#595959}.help-block{display:block;margin-bottom:10px}.help-inline{display:inline-block;*display:inline;padding-left:5px;vertical-align:middle;*zoom:1}.input-append,.input-prepend{display:inline-block;margin-bottom:10px;font-size:0;white-space:nowrap;vertical-align:middle}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input,.input-append .dropdown-menu,.input-prepend .dropdown-menu,.input-append .popover,.input-prepend .popover{font-size:14px}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input{position:relative;margin-bottom:0;*margin-left:0;vertical-align:top;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-append input:focus,.input-prepend input:focus,.input-append select:focus,.input-prepend select:focus,.input-append .uneditable-input:focus,.input-prepend .uneditable-input:focus{z-index:2}.input-append .add-on,.input-prepend .add-on{display:inline-block;width:auto;height:20px;min-width:16px;padding:4px 5px;font-size:14px;font-weight:normal;line-height:20px;text-align:center;text-shadow:0 1px 0 #fff;background-color:#eee;border:1px solid #ccc}.input-append .add-on,.input-prepend .add-on,.input-append .btn,.input-prepend .btn,.input-append .btn-group>.dropdown-toggle,.input-prepend .btn-group>.dropdown-toggle{vertical-align:top;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-append .active,.input-prepend .active{background-color:#a9dba9;border-color:#46a546}.input-prepend .add-on,.input-prepend .btn{margin-right:-1px}.input-prepend .add-on:first-child,.input-prepend .btn:first-child{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-append input,.input-append select,.input-append .uneditable-input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-append input+.btn-group .btn:last-child,.input-append select+.btn-group .btn:last-child,.input-append .uneditable-input+.btn-group .btn:last-child{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-append .add-on,.input-append .btn,.input-append .btn-group{margin-left:-1px}.input-append .add-on:last-child,.input-append .btn:last-child,.input-append .btn-group:last-child>.dropdown-toggle{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append input,.input-prepend.input-append select,.input-prepend.input-append .uneditable-input{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-prepend.input-append input+.btn-group .btn,.input-prepend.input-append select+.btn-group .btn,.input-prepend.input-append .uneditable-input+.btn-group .btn{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append .add-on:first-child,.input-prepend.input-append .btn:first-child{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-prepend.input-append .add-on:last-child,.input-prepend.input-append .btn:last-child{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append .btn-group:first-child{margin-left:0}input.search-query{padding-right:14px;padding-right:4px \9;padding-left:14px;padding-left:4px \9;margin-bottom:0;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.form-search .input-append .search-query,.form-search .input-prepend .search-query{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.form-search .input-append .search-query{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search .input-append .btn{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .search-query{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .btn{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search input,.form-inline input,.form-horizontal input,.form-search textarea,.form-inline textarea,.form-horizontal textarea,.form-search select,.form-inline select,.form-horizontal select,.form-search .help-inline,.form-inline .help-inline,.form-horizontal .help-inline,.form-search .uneditable-input,.form-inline .uneditable-input,.form-horizontal .uneditable-input,.form-search .input-prepend,.form-inline .input-prepend,.form-horizontal .input-prepend,.form-search .input-append,.form-inline .input-append,.form-horizontal .input-append{display:inline-block;*display:inline;margin-bottom:0;vertical-align:middle;*zoom:1}.form-search .hide,.form-inline .hide,.form-horizontal .hide{display:none}.form-search label,.form-inline label,.form-search .btn-group,.form-inline .btn-group{display:inline-block}.form-search .input-append,.form-inline .input-append,.form-search .input-prepend,.form-inline .input-prepend{margin-bottom:0}.form-search .radio,.form-search .checkbox,.form-inline .radio,.form-inline .checkbox{padding-left:0;margin-bottom:0;vertical-align:middle}.form-search .radio input[type="radio"],.form-search .checkbox input[type="checkbox"],.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:left;margin-right:3px;margin-left:0}.control-group{margin-bottom:10px}legend+.control-group{margin-top:20px;-webkit-margin-top-collapse:separate}.form-horizontal .control-group{margin-bottom:20px;*zoom:1}.form-horizontal .control-group:before,.form-horizontal .control-group:after{display:table;line-height:0;content:""}.form-horizontal .control-group:after{clear:both}.form-horizontal .control-label{float:left;width:160px;padding-top:5px;text-align:right}.form-horizontal .controls{*display:inline-block;*padding-left:20px;margin-left:180px;*margin-left:0}.form-horizontal .controls:first-child{*padding-left:180px}.form-horizontal .help-block{margin-bottom:0}.form-horizontal input+.help-block,.form-horizontal select+.help-block,.form-horizontal textarea+.help-block,.form-horizontal .uneditable-input+.help-block,.form-horizontal .input-prepend+.help-block,.form-horizontal .input-append+.help-block{margin-top:10px}.form-horizontal .form-actions{padding-left:180px}table{max-width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0}.table{width:100%;margin-bottom:20px}.table th,.table td{padding:8px;line-height:20px;text-align:left;vertical-align:top;border-top:1px solid #ddd}.table th{font-weight:bold}.table thead th{vertical-align:bottom}.table caption+thead tr:first-child th,.table caption+thead tr:first-child td,.table colgroup+thead tr:first-child th,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child th,.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 th,.table-condensed td{padding:4px 5px}.table-bordered{border:1px solid #ddd;border-collapse:separate;*border-collapse:collapse;border-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.table-bordered th,.table-bordered td{border-left:1px solid #ddd}.table-bordered caption+thead tr:first-child th,.table-bordered caption+tbody tr:first-child th,.table-bordered caption+tbody tr:first-child td,.table-bordered colgroup+thead tr:first-child th,.table-bordered colgroup+tbody tr:first-child th,.table-bordered colgroup+tbody tr:first-child td,.table-bordered thead:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child td{border-top:0}.table-bordered thead:first-child tr:first-child>th:first-child,.table-bordered tbody:first-child tr:first-child>td:first-child,.table-bordered tbody:first-child tr:first-child>th:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered thead:first-child tr:first-child>th:last-child,.table-bordered tbody:first-child tr:first-child>td:last-child,.table-bordered tbody:first-child tr:first-child>th:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px}.table-bordered thead:last-child tr:last-child>th:first-child,.table-bordered tbody:last-child tr:last-child>td:first-child,.table-bordered tbody:last-child tr:last-child>th:first-child,.table-bordered tfoot:last-child tr:last-child>td:first-child,.table-bordered tfoot:last-child tr:last-child>th:first-child{-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px}.table-bordered thead:last-child tr:last-child>th:last-child,.table-bordered tbody:last-child tr:last-child>td:last-child,.table-bordered tbody:last-child tr:last-child>th:last-child,.table-bordered tfoot:last-child tr:last-child>td:last-child,.table-bordered tfoot:last-child tr:last-child>th:last-child{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px}.table-bordered tfoot+tbody:last-child tr:last-child td:first-child{-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0;-moz-border-radius-bottomleft:0}.table-bordered tfoot+tbody:last-child tr:last-child td:last-child{-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0;-moz-border-radius-bottomright:0}.table-bordered caption+thead tr:first-child th:first-child,.table-bordered caption+tbody tr:first-child td:first-child,.table-bordered colgroup+thead tr:first-child th:first-child,.table-bordered colgroup+tbody tr:first-child td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered caption+thead tr:first-child th:last-child,.table-bordered caption+tbody tr:first-child td:last-child,.table-bordered colgroup+thead tr:first-child th:last-child,.table-bordered colgroup+tbody tr:first-child td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px}.table-striped tbody>tr:nth-child(odd)>td,.table-striped tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-hover tbody tr:hover>td,.table-hover tbody tr:hover>th{background-color:#f5f5f5}table td[class*="span"],table th[class*="span"],.row-fluid table td[class*="span"],.row-fluid table th[class*="span"]{display:table-cell;float:none;margin-left:0}.table td.span1,.table th.span1{float:none;width:44px;margin-left:0}.table td.span2,.table th.span2{float:none;width:124px;margin-left:0}.table td.span3,.table th.span3{float:none;width:204px;margin-left:0}.table td.span4,.table th.span4{float:none;width:284px;margin-left:0}.table td.span5,.table th.span5{float:none;width:364px;margin-left:0}.table td.span6,.table th.span6{float:none;width:444px;margin-left:0}.table td.span7,.table th.span7{float:none;width:524px;margin-left:0}.table td.span8,.table th.span8{float:none;width:604px;margin-left:0}.table td.span9,.table th.span9{float:none;width:684px;margin-left:0}.table td.span10,.table th.span10{float:none;width:764px;margin-left:0}.table td.span11,.table th.span11{float:none;width:844px;margin-left:0}.table td.span12,.table th.span12{float:none;width:924px;margin-left:0}.table tbody tr.success>td{background-color:#dff0d8}.table tbody tr.error>td{background-color:#f2dede}.table tbody tr.warning>td{background-color:#fcf8e3}.table tbody tr.info>td{background-color:#d9edf7}.table-hover tbody tr.success:hover>td{background-color:#d0e9c6}.table-hover tbody tr.error:hover>td{background-color:#ebcccc}.table-hover tbody tr.warning:hover>td{background-color:#faf2cc}.table-hover tbody tr.info:hover>td{background-color:#c4e3f3}[class^="icon-"],[class*=" icon-"]{display:inline-block;width:14px;height:14px;margin-top:1px;*margin-right:.3em;line-height:14px;vertical-align:text-top;background-image:url("../img/glyphicons-halflings.png");background-position:14px 14px;background-repeat:no-repeat}.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:focus>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>li>a:focus>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:focus>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"],.dropdown-submenu:focus>a>[class*=" icon-"]{background-image:url("../img/glyphicons-halflings-white.png")}.icon-glass{background-position:0 0}.icon-music{background-position:-24px 0}.icon-search{background-position:-48px 0}.icon-envelope{background-position:-72px 0}.icon-heart{background-position:-96px 0}.icon-star{background-position:-120px 0}.icon-star-empty{background-position:-144px 0}.icon-user{background-position:-168px 0}.icon-film{background-position:-192px 0}.icon-th-large{background-position:-216px 0}.icon-th{background-position:-240px 0}.icon-th-list{background-position:-264px 0}.icon-ok{background-position:-288px 0}.icon-remove{background-position:-312px 0}.icon-zoom-in{background-position:-336px 0}.icon-zoom-out{background-position:-360px 0}.icon-off{background-position:-384px 0}.icon-signal{background-position:-408px 0}.icon-cog{background-position:-432px 0}.icon-trash{background-position:-456px 0}.icon-home{background-position:0 -24px}.icon-file{background-position:-24px -24px}.icon-time{background-position:-48px -24px}.icon-road{background-position:-72px -24px}.icon-download-alt{background-position:-96px -24px}.icon-download{background-position:-120px -24px}.icon-upload{background-position:-144px -24px}.icon-inbox{background-position:-168px -24px}.icon-play-circle{background-position:-192px -24px}.icon-repeat{background-position:-216px -24px}.icon-refresh{background-position:-240px -24px}.icon-list-alt{background-position:-264px -24px}.icon-lock{background-position:-287px -24px}.icon-flag{background-position:-312px -24px}.icon-headphones{background-position:-336px -24px}.icon-volume-off{background-position:-360px -24px}.icon-volume-down{background-position:-384px -24px}.icon-volume-up{background-position:-408px -24px}.icon-qrcode{background-position:-432px -24px}.icon-barcode{background-position:-456px -24px}.icon-tag{background-position:0 -48px}.icon-tags{background-position:-25px -48px}.icon-book{background-position:-48px -48px}.icon-bookmark{background-position:-72px -48px}.icon-print{background-position:-96px -48px}.icon-camera{background-position:-120px -48px}.icon-font{background-position:-144px -48px}.icon-bold{background-position:-167px -48px}.icon-italic{background-position:-192px -48px}.icon-text-height{background-position:-216px -48px}.icon-text-width{background-position:-240px -48px}.icon-align-left{background-position:-264px -48px}.icon-align-center{background-position:-288px -48px}.icon-align-right{background-position:-312px -48px}.icon-align-justify{background-position:-336px -48px}.icon-list{background-position:-360px -48px}.icon-indent-left{background-position:-384px -48px}.icon-indent-right{background-position:-408px -48px}.icon-facetime-video{background-position:-432px -48px}.icon-picture{background-position:-456px -48px}.icon-pencil{background-position:0 -72px}.icon-map-marker{background-position:-24px -72px}.icon-adjust{background-position:-48px -72px}.icon-tint{background-position:-72px -72px}.icon-edit{background-position:-96px -72px}.icon-share{background-position:-120px -72px}.icon-check{background-position:-144px -72px}.icon-move{background-position:-168px -72px}.icon-step-backward{background-position:-192px -72px}.icon-fast-backward{background-position:-216px -72px}.icon-backward{background-position:-240px -72px}.icon-play{background-position:-264px -72px}.icon-pause{background-position:-288px -72px}.icon-stop{background-position:-312px -72px}.icon-forward{background-position:-336px -72px}.icon-fast-forward{background-position:-360px -72px}.icon-step-forward{background-position:-384px -72px}.icon-eject{background-position:-408px -72px}.icon-chevron-left{background-position:-432px -72px}.icon-chevron-right{background-position:-456px -72px}.icon-plus-sign{background-position:0 -96px}.icon-minus-sign{background-position:-24px -96px}.icon-remove-sign{background-position:-48px -96px}.icon-ok-sign{background-position:-72px -96px}.icon-question-sign{background-position:-96px -96px}.icon-info-sign{background-position:-120px -96px}.icon-screenshot{background-position:-144px -96px}.icon-remove-circle{background-position:-168px -96px}.icon-ok-circle{background-position:-192px -96px}.icon-ban-circle{background-position:-216px -96px}.icon-arrow-left{background-position:-240px -96px}.icon-arrow-right{background-position:-264px -96px}.icon-arrow-up{background-position:-289px -96px}.icon-arrow-down{background-position:-312px -96px}.icon-share-alt{background-position:-336px -96px}.icon-resize-full{background-position:-360px -96px}.icon-resize-small{background-position:-384px -96px}.icon-plus{background-position:-408px -96px}.icon-minus{background-position:-433px -96px}.icon-asterisk{background-position:-456px -96px}.icon-exclamation-sign{background-position:0 -120px}.icon-gift{background-position:-24px -120px}.icon-leaf{background-position:-48px -120px}.icon-fire{background-position:-72px -120px}.icon-eye-open{background-position:-96px -120px}.icon-eye-close{background-position:-120px -120px}.icon-warning-sign{background-position:-144px -120px}.icon-plane{background-position:-168px -120px}.icon-calendar{background-position:-192px -120px}.icon-random{width:16px;background-position:-216px -120px}.icon-comment{background-position:-240px -120px}.icon-magnet{background-position:-264px -120px}.icon-chevron-up{background-position:-288px -120px}.icon-chevron-down{background-position:-313px -119px}.icon-retweet{background-position:-336px -120px}.icon-shopping-cart{background-position:-360px -120px}.icon-folder-close{width:16px;background-position:-384px -120px}.icon-folder-open{width:16px;background-position:-408px -120px}.icon-resize-vertical{background-position:-432px -119px}.icon-resize-horizontal{background-position:-456px -118px}.icon-hdd{background-position:0 -144px}.icon-bullhorn{background-position:-24px -144px}.icon-bell{background-position:-48px -144px}.icon-certificate{background-position:-72px -144px}.icon-thumbs-up{background-position:-96px -144px}.icon-thumbs-down{background-position:-120px -144px}.icon-hand-right{background-position:-144px -144px}.icon-hand-left{background-position:-168px -144px}.icon-hand-up{background-position:-192px -144px}.icon-hand-down{background-position:-216px -144px}.icon-circle-arrow-right{background-position:-240px -144px}.icon-circle-arrow-left{background-position:-264px -144px}.icon-circle-arrow-up{background-position:-288px -144px}.icon-circle-arrow-down{background-position:-312px -144px}.icon-globe{background-position:-336px -144px}.icon-wrench{background-position:-360px -144px}.icon-tasks{background-position:-384px -144px}.icon-filter{background-position:-408px -144px}.icon-briefcase{background-position:-432px -144px}.icon-fullscreen{background-position:-456px -144px}.dropup,.dropdown{position:relative}.dropdown-toggle{*margin-bottom:-3px}.dropdown-toggle:active,.open .dropdown-toggle{outline:0}.caret{display:inline-block;width:0;height:0;vertical-align:top;border-top:4px solid #000;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.dropdown .caret{margin-top:8px;margin-left:2px}.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;list-style:none;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);*border-right-width:2px;*border-bottom-width:2px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus,.dropdown-submenu:hover>a,.dropdown-submenu:focus>a{color:#fff;text-decoration:none;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0)}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;outline:0;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0)}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#999}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;cursor:default;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open{*z-index:1000}.open>.dropdown-menu{display:block}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid #000;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}.dropdown-submenu{position:relative}.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px}.dropdown-submenu:hover>.dropdown-menu{display:block}.dropup .dropdown-submenu>.dropdown-menu{top:auto;bottom:0;margin-top:0;margin-bottom:-2px;-webkit-border-radius:5px 5px 5px 0;-moz-border-radius:5px 5px 5px 0;border-radius:5px 5px 5px 0}.dropdown-submenu>a:after{display:block;float:right;width:0;height:0;margin-top:5px;margin-right:-10px;border-color:transparent;border-left-color:#ccc;border-style:solid;border-width:5px 0 5px 5px;content:" "}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown-submenu.pull-left{float:none}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.dropdown .dropdown-menu .nav-header{padding-right:20px;padding-left:20px}.typeahead{z-index:1051;margin-top:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-large{padding:24px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.well-small{padding:9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.fade{opacity:0;-webkit-transition:opacity .15s linear;-moz-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;-moz-transition:height .35s ease;-o-transition:height .35s ease;transition:height .35s ease}.collapse.in{height:auto}.close{float:right;font-size:20px;font-weight:bold;line-height:20px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.btn{display:inline-block;*display:inline;padding:4px 12px;margin-bottom:0;*margin-left:.3em;font-size:14px;line-height:20px;color:#333;text-align:center;text-shadow:0 1px 1px rgba(255,255,255,0.75);vertical-align:middle;cursor:pointer;background-color:#f5f5f5;*background-color:#e6e6e6;background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-repeat:repeat-x;border:1px solid #ccc;*border:0;border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom-color:#b3b3b3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe6e6e6',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);*zoom:1;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.btn:hover,.btn:focus,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.btn:active,.btn.active{background-color:#ccc \9}.btn:first-child{*margin-left:0}.btn:hover,.btn:focus{color:#333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.btn.disabled,.btn[disabled]{cursor:default;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-large{padding:11px 19px;font-size:17.5px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.btn-large [class^="icon-"],.btn-large [class*=" icon-"]{margin-top:4px}.btn-small{padding:2px 10px;font-size:11.9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-small [class^="icon-"],.btn-small [class*=" icon-"]{margin-top:0}.btn-mini [class^="icon-"],.btn-mini [class*=" icon-"]{margin-top:-1px}.btn-mini{padding:0 6px;font-size:10.5px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-block{display:block;width:100%;padding-right:0;padding-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active{color:rgba(255,255,255,0.75)}.btn-primary{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#006dcc;*background-color:#04c;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;border-color:#04c #04c #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.btn-primary:active,.btn-primary.active{background-color:#039 \9}.btn-warning{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#faa732;*background-color:#f89406;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;border-color:#f89406 #f89406 #ad6704;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-warning:hover,.btn-warning:focus,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{color:#fff;background-color:#f89406;*background-color:#df8505}.btn-warning:active,.btn-warning.active{background-color:#c67605 \9}.btn-danger{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#da4f49;*background-color:#bd362f;background-image:-moz-linear-gradient(top,#ee5f5b,#bd362f);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#bd362f));background-image:-webkit-linear-gradient(top,#ee5f5b,#bd362f);background-image:-o-linear-gradient(top,#ee5f5b,#bd362f);background-image:linear-gradient(to bottom,#ee5f5b,#bd362f);background-repeat:repeat-x;border-color:#bd362f #bd362f #802420;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffbd362f',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-danger:hover,.btn-danger:focus,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{color:#fff;background-color:#bd362f;*background-color:#a9302a}.btn-danger:active,.btn-danger.active{background-color:#942a25 \9}.btn-success{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#5bb75b;*background-color:#51a351;background-image:-moz-linear-gradient(top,#62c462,#51a351);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#51a351));background-image:-webkit-linear-gradient(top,#62c462,#51a351);background-image:-o-linear-gradient(top,#62c462,#51a351);background-image:linear-gradient(to bottom,#62c462,#51a351);background-repeat:repeat-x;border-color:#51a351 #51a351 #387038;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff51a351',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-success:hover,.btn-success:focus,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled]{color:#fff;background-color:#51a351;*background-color:#499249}.btn-success:active,.btn-success.active{background-color:#408140 \9}.btn-info{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#49afcd;*background-color:#2f96b4;background-image:-moz-linear-gradient(top,#5bc0de,#2f96b4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#2f96b4));background-image:-webkit-linear-gradient(top,#5bc0de,#2f96b4);background-image:-o-linear-gradient(top,#5bc0de,#2f96b4);background-image:linear-gradient(to bottom,#5bc0de,#2f96b4);background-repeat:repeat-x;border-color:#2f96b4 #2f96b4 #1f6377;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff2f96b4',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-info:hover,.btn-info:focus,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{color:#fff;background-color:#2f96b4;*background-color:#2a85a0}.btn-info:active,.btn-info.active{background-color:#24748c \9}.btn-inverse{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#363636;*background-color:#222;background-image:-moz-linear-gradient(top,#444,#222);background-image:-webkit-gradient(linear,0 0,0 100%,from(#444),to(#222));background-image:-webkit-linear-gradient(top,#444,#222);background-image:-o-linear-gradient(top,#444,#222);background-image:linear-gradient(to bottom,#444,#222);background-repeat:repeat-x;border-color:#222 #222 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444',endColorstr='#ff222222',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-inverse:hover,.btn-inverse:focus,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled]{color:#fff;background-color:#222;*background-color:#151515}.btn-inverse:active,.btn-inverse.active{background-color:#080808 \9}button.btn,input[type="submit"].btn{*padding-top:3px;*padding-bottom:3px}button.btn::-moz-focus-inner,input[type="submit"].btn::-moz-focus-inner{padding:0;border:0}button.btn.btn-large,input[type="submit"].btn.btn-large{*padding-top:7px;*padding-bottom:7px}button.btn.btn-small,input[type="submit"].btn.btn-small{*padding-top:3px;*padding-bottom:3px}button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-bottom:1px}.btn-link,.btn-link:active,.btn-link[disabled]{background-color:transparent;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-link{color:#08c;cursor:pointer;border-color:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-link:hover,.btn-link:focus{color:#005580;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,.btn-link[disabled]:focus{color:#333;text-decoration:none}.btn-group{position:relative;display:inline-block;*display:inline;*margin-left:.3em;font-size:0;white-space:nowrap;vertical-align:middle;*zoom:1}.btn-group:first-child{*margin-left:0}.btn-group+.btn-group{margin-left:5px}.btn-toolbar{margin-top:10px;margin-bottom:10px;font-size:0}.btn-toolbar>.btn+.btn,.btn-toolbar>.btn-group+.btn,.btn-toolbar>.btn+.btn-group{margin-left:5px}.btn-group>.btn{position:relative;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group>.btn+.btn{margin-left:-1px}.btn-group>.btn,.btn-group>.dropdown-menu,.btn-group>.popover{font-size:14px}.btn-group>.btn-mini{font-size:10.5px}.btn-group>.btn-small{font-size:11.9px}.btn-group>.btn-large{font-size:17.5px}.btn-group>.btn:first-child{margin-left:0;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-topleft:4px}.btn-group>.btn:last-child,.btn-group>.dropdown-toggle{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px}.btn-group>.btn.large:first-child{margin-left:0;-webkit-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-webkit-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-topleft:6px}.btn-group>.btn.large:last-child,.btn-group>.large.dropdown-toggle{-webkit-border-top-right-radius:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;border-bottom-right-radius:6px;-moz-border-radius-topright:6px;-moz-border-radius-bottomright:6px}.btn-group>.btn:hover,.btn-group>.btn:focus,.btn-group>.btn:active,.btn-group>.btn.active{z-index:2}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{*padding-top:5px;padding-right:8px;*padding-bottom:5px;padding-left:8px;-webkit-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.btn-group>.btn-mini+.dropdown-toggle{*padding-top:2px;padding-right:5px;*padding-bottom:2px;padding-left:5px}.btn-group>.btn-small+.dropdown-toggle{*padding-top:5px;*padding-bottom:4px}.btn-group>.btn-large+.dropdown-toggle{*padding-top:7px;padding-right:12px;*padding-bottom:7px;padding-left:12px}.btn-group.open .dropdown-toggle{background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.btn-group.open .btn.dropdown-toggle{background-color:#e6e6e6}.btn-group.open .btn-primary.dropdown-toggle{background-color:#04c}.btn-group.open .btn-warning.dropdown-toggle{background-color:#f89406}.btn-group.open .btn-danger.dropdown-toggle{background-color:#bd362f}.btn-group.open .btn-success.dropdown-toggle{background-color:#51a351}.btn-group.open .btn-info.dropdown-toggle{background-color:#2f96b4}.btn-group.open .btn-inverse.dropdown-toggle{background-color:#222}.btn .caret{margin-top:8px;margin-left:0}.btn-large .caret{margin-top:6px}.btn-large .caret{border-top-width:5px;border-right-width:5px;border-left-width:5px}.btn-mini .caret,.btn-small .caret{margin-top:8px}.dropup .btn-large .caret{border-bottom-width:5px}.btn-primary .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret,.btn-success .caret,.btn-inverse .caret{border-top-color:#fff;border-bottom-color:#fff}.btn-group-vertical{display:inline-block;*display:inline;*zoom:1}.btn-group-vertical>.btn{display:block;float:none;max-width:100%;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group-vertical>.btn+.btn{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:first-child{-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.btn-group-vertical>.btn:last-child{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.btn-group-vertical>.btn-large:first-child{-webkit-border-radius:6px 6px 0 0;-moz-border-radius:6px 6px 0 0;border-radius:6px 6px 0 0}.btn-group-vertical>.btn-large:last-child{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.alert{padding:8px 35px 8px 14px;margin-bottom:20px;text-shadow:0 1px 0 rgba(255,255,255,0.5);background-color:#fcf8e3;border:1px solid #fbeed5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.alert,.alert h4{color:#c09853}.alert h4{margin:0}.alert .close{position:relative;top:-2px;right:-21px;line-height:20px}.alert-success{color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.alert-success h4{color:#468847}.alert-danger,.alert-error{color:#b94a48;background-color:#f2dede;border-color:#eed3d7}.alert-danger h4,.alert-error h4{color:#b94a48}.alert-info{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}.alert-info h4{color:#3a87ad}.alert-block{padding-top:14px;padding-bottom:14px}.alert-block>p,.alert-block>ul{margin-bottom:0}.alert-block p+p{margin-top:5px}.nav{margin-bottom:20px;margin-left:0;list-style:none}.nav>li>a{display:block}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eee}.nav>li>a>img{max-width:none}.nav>.pull-right{float:right}.nav-header{display:block;padding:3px 15px;font-size:11px;font-weight:bold;line-height:20px;color:#999;text-shadow:0 1px 0 rgba(255,255,255,0.5);text-transform:uppercase}.nav li+.nav-header{margin-top:9px}.nav-list{padding-right:15px;padding-left:15px;margin-bottom:0}.nav-list>li>a,.nav-list .nav-header{margin-right:-15px;margin-left:-15px;text-shadow:0 1px 0 rgba(255,255,255,0.5)}.nav-list>li>a{padding:3px 15px}.nav-list>.active>a,.nav-list>.active>a:hover,.nav-list>.active>a:focus{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.2);background-color:#08c}.nav-list [class^="icon-"],.nav-list [class*=" icon-"]{margin-right:2px}.nav-list .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.nav-tabs,.nav-pills{*zoom:1}.nav-tabs:before,.nav-pills:before,.nav-tabs:after,.nav-pills:after{display:table;line-height:0;content:""}.nav-tabs:after,.nav-pills:after{clear:both}.nav-tabs>li,.nav-pills>li{float:left}.nav-tabs>li>a,.nav-pills>li>a{padding-right:12px;padding-left:12px;margin-right:2px;line-height:14px}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{margin-bottom:-1px}.nav-tabs>li>a{padding-top:8px;padding-bottom:8px;line-height:20px;border:1px solid transparent;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover,.nav-tabs>li>a:focus{border-color:#eee #eee #ddd}.nav-tabs>.active>a,.nav-tabs>.active>a:hover,.nav-tabs>.active>a:focus{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-pills>li>a{padding-top:8px;padding-bottom:8px;margin-top:2px;margin-bottom:2px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.nav-pills>.active>a,.nav-pills>.active>a:hover,.nav-pills>.active>a:focus{color:#fff;background-color:#08c}.nav-stacked>li{float:none}.nav-stacked>li>a{margin-right:0}.nav-tabs.nav-stacked{border-bottom:0}.nav-tabs.nav-stacked>li>a{border:1px solid #ddd;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.nav-tabs.nav-stacked>li:first-child>a{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-topleft:4px}.nav-tabs.nav-stacked>li:last-child>a{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomright:4px;-moz-border-radius-bottomleft:4px}.nav-tabs.nav-stacked>li>a:hover,.nav-tabs.nav-stacked>li>a:focus{z-index:2;border-color:#ddd}.nav-pills.nav-stacked>li>a{margin-bottom:3px}.nav-pills.nav-stacked>li:last-child>a{margin-bottom:1px}.nav-tabs .dropdown-menu{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.nav-pills .dropdown-menu{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.nav .dropdown-toggle .caret{margin-top:6px;border-top-color:#08c;border-bottom-color:#08c}.nav .dropdown-toggle:hover .caret,.nav .dropdown-toggle:focus .caret{border-top-color:#005580;border-bottom-color:#005580}.nav-tabs .dropdown-toggle .caret{margin-top:8px}.nav .active .dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.nav-tabs .active .dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.nav>.dropdown.active>a:hover,.nav>.dropdown.active>a:focus{cursor:pointer}.nav-tabs .open .dropdown-toggle,.nav-pills .open .dropdown-toggle,.nav>li.dropdown.open.active>a:hover,.nav>li.dropdown.open.active>a:focus{color:#fff;background-color:#999;border-color:#999}.nav li.dropdown.open .caret,.nav li.dropdown.open.active .caret,.nav li.dropdown.open a:hover .caret,.nav li.dropdown.open a:focus .caret{border-top-color:#fff;border-bottom-color:#fff;opacity:1;filter:alpha(opacity=100)}.tabs-stacked .open>a:hover,.tabs-stacked .open>a:focus{border-color:#999}.tabbable{*zoom:1}.tabbable:before,.tabbable:after{display:table;line-height:0;content:""}.tabbable:after{clear:both}.tab-content{overflow:auto}.tabs-below>.nav-tabs,.tabs-right>.nav-tabs,.tabs-left>.nav-tabs{border-bottom:0}.tab-content>.tab-pane,.pill-content>.pill-pane{display:none}.tab-content>.active,.pill-content>.active{display:block}.tabs-below>.nav-tabs{border-top:1px solid #ddd}.tabs-below>.nav-tabs>li{margin-top:-1px;margin-bottom:0}.tabs-below>.nav-tabs>li>a{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.tabs-below>.nav-tabs>li>a:hover,.tabs-below>.nav-tabs>li>a:focus{border-top-color:#ddd;border-bottom-color:transparent}.tabs-below>.nav-tabs>.active>a,.tabs-below>.nav-tabs>.active>a:hover,.tabs-below>.nav-tabs>.active>a:focus{border-color:transparent #ddd #ddd #ddd}.tabs-left>.nav-tabs>li,.tabs-right>.nav-tabs>li{float:none}.tabs-left>.nav-tabs>li>a,.tabs-right>.nav-tabs>li>a{min-width:74px;margin-right:0;margin-bottom:3px}.tabs-left>.nav-tabs{float:left;margin-right:19px;border-right:1px solid #ddd}.tabs-left>.nav-tabs>li>a{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.tabs-left>.nav-tabs>li>a:hover,.tabs-left>.nav-tabs>li>a:focus{border-color:#eee #ddd #eee #eee}.tabs-left>.nav-tabs .active>a,.tabs-left>.nav-tabs .active>a:hover,.tabs-left>.nav-tabs .active>a:focus{border-color:#ddd transparent #ddd #ddd;*border-right-color:#fff}.tabs-right>.nav-tabs{float:right;margin-left:19px;border-left:1px solid #ddd}.tabs-right>.nav-tabs>li>a{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.tabs-right>.nav-tabs>li>a:hover,.tabs-right>.nav-tabs>li>a:focus{border-color:#eee #eee #eee #ddd}.tabs-right>.nav-tabs .active>a,.tabs-right>.nav-tabs .active>a:hover,.tabs-right>.nav-tabs .active>a:focus{border-color:#ddd #ddd #ddd transparent;*border-left-color:#fff}.nav>.disabled>a{color:#999}.nav>.disabled>a:hover,.nav>.disabled>a:focus{text-decoration:none;cursor:default;background-color:transparent}.navbar{*position:relative;*z-index:2;margin-bottom:20px;overflow:visible}.navbar-inner{min-height:40px;padding-right:20px;padding-left:20px;background-color:#fafafa;background-image:-moz-linear-gradient(top,#fff,#f2f2f2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#f2f2f2));background-image:-webkit-linear-gradient(top,#fff,#f2f2f2);background-image:-o-linear-gradient(top,#fff,#f2f2f2);background-image:linear-gradient(to bottom,#fff,#f2f2f2);background-repeat:repeat-x;border:1px solid #d4d4d4;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#fff2f2f2',GradientType=0);*zoom:1;-webkit-box-shadow:0 1px 4px rgba(0,0,0,0.065);-moz-box-shadow:0 1px 4px rgba(0,0,0,0.065);box-shadow:0 1px 4px rgba(0,0,0,0.065)}.navbar-inner:before,.navbar-inner:after{display:table;line-height:0;content:""}.navbar-inner:after{clear:both}.navbar .container{width:auto}.nav-collapse.collapse{height:auto;overflow:visible}.navbar .brand{display:block;float:left;padding:10px 20px 10px;margin-left:-20px;font-size:20px;font-weight:200;color:#777;text-shadow:0 1px 0 #fff}.navbar .brand:hover,.navbar .brand:focus{text-decoration:none}.navbar-text{margin-bottom:0;line-height:40px;color:#777}.navbar-link{color:#777}.navbar-link:hover,.navbar-link:focus{color:#333}.navbar .divider-vertical{height:40px;margin:0 9px;border-right:1px solid #fff;border-left:1px solid #f2f2f2}.navbar .btn,.navbar .btn-group{margin-top:5px}.navbar .btn-group .btn,.navbar .input-prepend .btn,.navbar .input-append .btn,.navbar .input-prepend .btn-group,.navbar .input-append .btn-group{margin-top:0}.navbar-form{margin-bottom:0;*zoom:1}.navbar-form:before,.navbar-form:after{display:table;line-height:0;content:""}.navbar-form:after{clear:both}.navbar-form input,.navbar-form select,.navbar-form .radio,.navbar-form .checkbox{margin-top:5px}.navbar-form input,.navbar-form select,.navbar-form .btn{display:inline-block;margin-bottom:0}.navbar-form input[type="image"],.navbar-form input[type="checkbox"],.navbar-form input[type="radio"]{margin-top:3px}.navbar-form .input-append,.navbar-form .input-prepend{margin-top:5px;white-space:nowrap}.navbar-form .input-append input,.navbar-form .input-prepend input{margin-top:0}.navbar-search{position:relative;float:left;margin-top:5px;margin-bottom:0}.navbar-search .search-query{padding:4px 14px;margin-bottom:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:1;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.navbar-static-top{position:static;margin-bottom:0}.navbar-static-top .navbar-inner{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030;margin-bottom:0}.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{border-width:0 0 1px}.navbar-fixed-bottom .navbar-inner{border-width:1px 0 0}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding-right:0;padding-left:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.navbar-fixed-top{top:0}.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{-webkit-box-shadow:0 1px 10px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 10px rgba(0,0,0,0.1);box-shadow:0 1px 10px rgba(0,0,0,0.1)}.navbar-fixed-bottom{bottom:0}.navbar-fixed-bottom .navbar-inner{-webkit-box-shadow:0 -1px 10px rgba(0,0,0,0.1);-moz-box-shadow:0 -1px 10px rgba(0,0,0,0.1);box-shadow:0 -1px 10px rgba(0,0,0,0.1)}.navbar .nav{position:relative;left:0;display:block;float:left;margin:0 10px 0 0}.navbar .nav.pull-right{float:right;margin-right:0}.navbar .nav>li{float:left}.navbar .nav>li>a{float:none;padding:10px 15px 10px;color:#777;text-decoration:none;text-shadow:0 1px 0 #fff}.navbar .nav .dropdown-toggle .caret{margin-top:8px}.navbar .nav>li>a:focus,.navbar .nav>li>a:hover{color:#333;text-decoration:none;background-color:transparent}.navbar .nav>.active>a,.navbar .nav>.active>a:hover,.navbar .nav>.active>a:focus{color:#555;text-decoration:none;background-color:#e5e5e5;-webkit-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);-moz-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);box-shadow:inset 0 3px 8px rgba(0,0,0,0.125)}.navbar .btn-navbar{display:none;float:right;padding:7px 10px;margin-right:5px;margin-left:5px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#ededed;*background-color:#e5e5e5;background-image:-moz-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#e5e5e5));background-image:-webkit-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:-o-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:linear-gradient(to bottom,#f2f2f2,#e5e5e5);background-repeat:repeat-x;border-color:#e5e5e5 #e5e5e5 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffe5e5e5',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075)}.navbar .btn-navbar:hover,.navbar .btn-navbar:focus,.navbar .btn-navbar:active,.navbar .btn-navbar.active,.navbar .btn-navbar.disabled,.navbar .btn-navbar[disabled]{color:#fff;background-color:#e5e5e5;*background-color:#d9d9d9}.navbar .btn-navbar:active,.navbar .btn-navbar.active{background-color:#ccc \9}.navbar .btn-navbar .icon-bar{display:block;width:18px;height:2px;background-color:#f5f5f5;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,0.25);-moz-box-shadow:0 1px 0 rgba(0,0,0,0.25);box-shadow:0 1px 0 rgba(0,0,0,0.25)}.btn-navbar .icon-bar+.icon-bar{margin-top:3px}.navbar .nav>li>.dropdown-menu:before{position:absolute;top:-7px;left:9px;display:inline-block;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-left:7px solid transparent;border-bottom-color:rgba(0,0,0,0.2);content:''}.navbar .nav>li>.dropdown-menu:after{position:absolute;top:-6px;left:10px;display:inline-block;border-right:6px solid transparent;border-bottom:6px solid #fff;border-left:6px solid transparent;content:''}.navbar-fixed-bottom .nav>li>.dropdown-menu:before{top:auto;bottom:-7px;border-top:7px solid #ccc;border-bottom:0;border-top-color:rgba(0,0,0,0.2)}.navbar-fixed-bottom .nav>li>.dropdown-menu:after{top:auto;bottom:-6px;border-top:6px solid #fff;border-bottom:0}.navbar .nav li.dropdown>a:hover .caret,.navbar .nav li.dropdown>a:focus .caret{border-top-color:#333;border-bottom-color:#333}.navbar .nav li.dropdown.open>.dropdown-toggle,.navbar .nav li.dropdown.active>.dropdown-toggle,.navbar .nav li.dropdown.open.active>.dropdown-toggle{color:#555;background-color:#e5e5e5}.navbar .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#777;border-bottom-color:#777}.navbar .nav li.dropdown.open>.dropdown-toggle .caret,.navbar .nav li.dropdown.active>.dropdown-toggle .caret,.navbar .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.navbar .pull-right>li>.dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right{right:0;left:auto}.navbar .pull-right>li>.dropdown-menu:before,.navbar .nav>li>.dropdown-menu.pull-right:before{right:12px;left:auto}.navbar .pull-right>li>.dropdown-menu:after,.navbar .nav>li>.dropdown-menu.pull-right:after{right:13px;left:auto}.navbar .pull-right>li>.dropdown-menu .dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right .dropdown-menu{right:100%;left:auto;margin-right:-1px;margin-left:0;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.navbar-inverse .navbar-inner{background-color:#1b1b1b;background-image:-moz-linear-gradient(top,#222,#111);background-image:-webkit-gradient(linear,0 0,0 100%,from(#222),to(#111));background-image:-webkit-linear-gradient(top,#222,#111);background-image:-o-linear-gradient(top,#222,#111);background-image:linear-gradient(to bottom,#222,#111);background-repeat:repeat-x;border-color:#252525;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222',endColorstr='#ff111111',GradientType=0)}.navbar-inverse .brand,.navbar-inverse .nav>li>a{color:#999;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.navbar-inverse .brand:hover,.navbar-inverse .nav>li>a:hover,.navbar-inverse .brand:focus,.navbar-inverse .nav>li>a:focus{color:#fff}.navbar-inverse .brand{color:#999}.navbar-inverse .navbar-text{color:#999}.navbar-inverse .nav>li>a:focus,.navbar-inverse .nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .nav .active>a,.navbar-inverse .nav .active>a:hover,.navbar-inverse .nav .active>a:focus{color:#fff;background-color:#111}.navbar-inverse .navbar-link{color:#999}.navbar-inverse .navbar-link:hover,.navbar-inverse .navbar-link:focus{color:#fff}.navbar-inverse .divider-vertical{border-right-color:#222;border-left-color:#111}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle{color:#fff;background-color:#111}.navbar-inverse .nav li.dropdown>a:hover .caret,.navbar-inverse .nav li.dropdown>a:focus .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#999;border-bottom-color:#999}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .navbar-search .search-query{color:#fff;background-color:#515151;border-color:#111;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.navbar-inverse .navbar-search .search-query:-moz-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:-ms-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query::-webkit-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:focus,.navbar-inverse .navbar-search .search-query.focused{padding:5px 15px;color:#333;text-shadow:0 1px 0 #fff;background-color:#fff;border:0;outline:0;-webkit-box-shadow:0 0 3px rgba(0,0,0,0.15);-moz-box-shadow:0 0 3px rgba(0,0,0,0.15);box-shadow:0 0 3px rgba(0,0,0,0.15)}.navbar-inverse .btn-navbar{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e0e0e;*background-color:#040404;background-image:-moz-linear-gradient(top,#151515,#040404);background-image:-webkit-gradient(linear,0 0,0 100%,from(#151515),to(#040404));background-image:-webkit-linear-gradient(top,#151515,#040404);background-image:-o-linear-gradient(top,#151515,#040404);background-image:linear-gradient(to bottom,#151515,#040404);background-repeat:repeat-x;border-color:#040404 #040404 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff151515',endColorstr='#ff040404',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.navbar-inverse .btn-navbar:hover,.navbar-inverse .btn-navbar:focus,.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active,.navbar-inverse .btn-navbar.disabled,.navbar-inverse .btn-navbar[disabled]{color:#fff;background-color:#040404;*background-color:#000}.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active{background-color:#000 \9}.breadcrumb{padding:8px 15px;margin:0 0 20px;list-style:none;background-color:#f5f5f5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.breadcrumb>li{display:inline-block;*display:inline;text-shadow:0 1px 0 #fff;*zoom:1}.breadcrumb>li>.divider{padding:0 5px;color:#ccc}.breadcrumb>.active{color:#999}.pagination{margin:20px 0}.pagination ul{display:inline-block;*display:inline;margin-bottom:0;margin-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*zoom:1;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:0 1px 2px rgba(0,0,0,0.05);box-shadow:0 1px 2px rgba(0,0,0,0.05)}.pagination ul>li{display:inline}.pagination ul>li>a,.pagination ul>li>span{float:left;padding:4px 12px;line-height:20px;text-decoration:none;background-color:#fff;border:1px solid #ddd;border-left-width:0}.pagination ul>li>a:hover,.pagination ul>li>a:focus,.pagination ul>.active>a,.pagination ul>.active>span{background-color:#f5f5f5}.pagination ul>.active>a,.pagination ul>.active>span{color:#999;cursor:default}.pagination ul>.disabled>span,.pagination ul>.disabled>a,.pagination ul>.disabled>a:hover,.pagination ul>.disabled>a:focus{color:#999;cursor:default;background-color:transparent}.pagination ul>li:first-child>a,.pagination ul>li:first-child>span{border-left-width:1px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-topleft:4px}.pagination ul>li:last-child>a,.pagination ul>li:last-child>span{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px}.pagination-centered{text-align:center}.pagination-right{text-align:right}.pagination-large ul>li>a,.pagination-large ul>li>span{padding:11px 19px;font-size:17.5px}.pagination-large ul>li:first-child>a,.pagination-large ul>li:first-child>span{-webkit-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-webkit-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-topleft:6px}.pagination-large ul>li:last-child>a,.pagination-large ul>li:last-child>span{-webkit-border-top-right-radius:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;border-bottom-right-radius:6px;-moz-border-radius-topright:6px;-moz-border-radius-bottomright:6px}.pagination-mini ul>li:first-child>a,.pagination-small ul>li:first-child>a,.pagination-mini ul>li:first-child>span,.pagination-small ul>li:first-child>span{-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-radius-bottomleft:3px;-moz-border-radius-topleft:3px}.pagination-mini ul>li:last-child>a,.pagination-small ul>li:last-child>a,.pagination-mini ul>li:last-child>span,.pagination-small ul>li:last-child>span{-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px;-moz-border-radius-topright:3px;-moz-border-radius-bottomright:3px}.pagination-small ul>li>a,.pagination-small ul>li>span{padding:2px 10px;font-size:11.9px}.pagination-mini ul>li>a,.pagination-mini ul>li>span{padding:0 6px;font-size:10.5px}.pager{margin:20px 0;text-align:center;list-style:none;*zoom:1}.pager:before,.pager:after{display:table;line-height:0;content:""}.pager:after{clear:both}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#f5f5f5}.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:#999;cursor:default;background-color:#fff}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop,.modal-backdrop.fade.in{opacity:.8;filter:alpha(opacity=80)}.modal{position:fixed;top:10%;left:50%;z-index:1050;width:560px;margin-left:-280px;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;outline:0;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box}.modal.fade{top:-25%;-webkit-transition:opacity .3s linear,top .3s ease-out;-moz-transition:opacity .3s linear,top .3s ease-out;-o-transition:opacity .3s linear,top .3s ease-out;transition:opacity .3s linear,top .3s ease-out}.modal.fade.in{top:10%}.modal-header{padding:9px 15px;border-bottom:1px solid #eee}.modal-header .close{margin-top:2px}.modal-header h3{margin:0;line-height:30px}.modal-body{position:relative;max-height:400px;padding:15px;overflow-y:auto}.modal-form{margin-bottom:0}.modal-footer{padding:14px 15px 15px;margin-bottom:0;text-align:right;background-color:#f5f5f5;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;*zoom:1;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.modal-footer:before,.modal-footer:after{display:table;line-height:0;content:""}.modal-footer:after{clear:both}.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}.tooltip{position:absolute;z-index:1030;display:block;font-size:11px;line-height:1.4;opacity:0;filter:alpha(opacity=0);visibility:visible}.tooltip.in{opacity:.8;filter:alpha(opacity=80)}.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:8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;-webkit-border-radius:4px;-moz-border-radius:4px;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-top-color:#000;border-width:5px 5px 0}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-right-color:#000;border-width:5px 5px 5px 0}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-left-color:#000;border-width:5px 0 5px 5px}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-color:#000;border-width:0 5px 5px}.popover{position:absolute;top:0;left:0;z-index:1010;display:none;max-width:400px;padding:1px;text-align:left;white-space:normal;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.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;font-weight:normal;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.popover-title:empty{display:none}.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{border-width:10px;content:""}.popover.top .arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,0.25);border-bottom-width:0}.popover.top .arrow:after{bottom:1px;margin-left:-10px;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,0.25);border-left-width:0}.popover.right .arrow:after{bottom:-10px;left:1px;border-right-color:#fff;border-left-width:0}.popover.bottom .arrow{top:-11px;left:50%;margin-left:-11px;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,0.25);border-top-width:0}.popover.bottom .arrow:after{top:1px;margin-left:-10px;border-bottom-color:#fff;border-top-width:0}.popover.left .arrow{top:50%;right:-11px;margin-top:-11px;border-left-color:#999;border-left-color:rgba(0,0,0,0.25);border-right-width:0}.popover.left .arrow:after{right:1px;bottom:-10px;border-left-color:#fff;border-right-width:0}.thumbnails{margin-left:-20px;list-style:none;*zoom:1}.thumbnails:before,.thumbnails:after{display:table;line-height:0;content:""}.thumbnails:after{clear:both}.row-fluid .thumbnails{margin-left:0}.thumbnails>li{float:left;margin-bottom:20px;margin-left:20px}.thumbnail{display:block;padding:4px;line-height:20px;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.055);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.055);box-shadow:0 1px 3px rgba(0,0,0,0.055);-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}a.thumbnail:hover,a.thumbnail:focus{border-color:#08c;-webkit-box-shadow:0 1px 4px rgba(0,105,214,0.25);-moz-box-shadow:0 1px 4px rgba(0,105,214,0.25);box-shadow:0 1px 4px rgba(0,105,214,0.25)}.thumbnail>img{display:block;max-width:100%;margin-right:auto;margin-left:auto}.thumbnail .caption{padding:9px;color:#555}.media,.media-body{overflow:hidden;*overflow:visible;zoom:1}.media,.media .media{margin-top:15px}.media:first-child{margin-top:0}.media-object{display:block}.media-heading{margin:0 0 5px}.media>.pull-left{margin-right:10px}.media>.pull-right{margin-left:10px}.media-list{margin-left:0;list-style:none}.label,.badge{display:inline-block;padding:2px 4px;font-size:11.844px;font-weight:bold;line-height:14px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);white-space:nowrap;vertical-align:baseline;background-color:#999}.label{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.badge{padding-right:9px;padding-left:9px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px}.label:empty,.badge:empty{display:none}a.label:hover,a.label:focus,a.badge:hover,a.badge:focus{color:#fff;text-decoration:none;cursor:pointer}.label-important,.badge-important{background-color:#b94a48}.label-important[href],.badge-important[href]{background-color:#953b39}.label-warning,.badge-warning{background-color:#f89406}.label-warning[href],.badge-warning[href]{background-color:#c67605}.label-success,.badge-success{background-color:#468847}.label-success[href],.badge-success[href]{background-color:#356635}.label-info,.badge-info{background-color:#3a87ad}.label-info[href],.badge-info[href]{background-color:#2d6987}.label-inverse,.badge-inverse{background-color:#333}.label-inverse[href],.badge-inverse[href]{background-color:#1a1a1a}.btn .label,.btn .badge{position:relative;top:-1px}.btn-mini .label,.btn-mini .badge{top:0}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-moz-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-ms-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:0 0}to{background-position:40px 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:#f7f7f7;background-image:-moz-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f5f5f5),to(#f9f9f9));background-image:-webkit-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-o-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:linear-gradient(to bottom,#f5f5f5,#f9f9f9);background-repeat:repeat-x;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5',endColorstr='#fff9f9f9',GradientType=0);-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress .bar{float:left;width:0;height:100%;font-size:12px;color:#fff;text-align:center;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e90d2;background-image:-moz-linear-gradient(top,#149bdf,#0480be);background-image:-webkit-gradient(linear,0 0,0 100%,from(#149bdf),to(#0480be));background-image:-webkit-linear-gradient(top,#149bdf,#0480be);background-image:-o-linear-gradient(top,#149bdf,#0480be);background-image:linear-gradient(to bottom,#149bdf,#0480be);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf',endColorstr='#ff0480be',GradientType=0);-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width .6s ease;-moz-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress .bar+.bar{-webkit-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15)}.progress-striped .bar{background-color:#149bdf;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));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);background-image:-moz-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);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);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);-webkit-background-size:40px 40px;-moz-background-size:40px 40px;-o-background-size:40px 40px;background-size:40px 40px}.progress.active .bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-danger .bar,.progress .bar-danger{background-color:#dd514c;background-image:-moz-linear-gradient(top,#ee5f5b,#c43c35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#c43c35));background-image:-webkit-linear-gradient(top,#ee5f5b,#c43c35);background-image:-o-linear-gradient(top,#ee5f5b,#c43c35);background-image:linear-gradient(to bottom,#ee5f5b,#c43c35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffc43c35',GradientType=0)}.progress-danger.progress-striped .bar,.progress-striped .bar-danger{background-color:#ee5f5b;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));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);background-image:-moz-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);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);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)}.progress-success .bar,.progress .bar-success{background-color:#5eb95e;background-image:-moz-linear-gradient(top,#62c462,#57a957);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#57a957));background-image:-webkit-linear-gradient(top,#62c462,#57a957);background-image:-o-linear-gradient(top,#62c462,#57a957);background-image:linear-gradient(to bottom,#62c462,#57a957);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff57a957',GradientType=0)}.progress-success.progress-striped .bar,.progress-striped .bar-success{background-color:#62c462;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));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);background-image:-moz-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);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);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)}.progress-info .bar,.progress .bar-info{background-color:#4bb1cf;background-image:-moz-linear-gradient(top,#5bc0de,#339bb9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#339bb9));background-image:-webkit-linear-gradient(top,#5bc0de,#339bb9);background-image:-o-linear-gradient(top,#5bc0de,#339bb9);background-image:linear-gradient(to bottom,#5bc0de,#339bb9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff339bb9',GradientType=0)}.progress-info.progress-striped .bar,.progress-striped .bar-info{background-color:#5bc0de;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));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);background-image:-moz-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);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);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)}.progress-warning .bar,.progress .bar-warning{background-color:#faa732;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0)}.progress-warning.progress-striped .bar,.progress-striped .bar-warning{background-color:#fbb450;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));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);background-image:-moz-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);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);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)}.accordion{margin-bottom:20px}.accordion-group{margin-bottom:2px;border:1px solid #e5e5e5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.accordion-heading{border-bottom:0}.accordion-heading .accordion-toggle{display:block;padding:8px 15px}.accordion-toggle{cursor:pointer}.accordion-inner{padding:9px 15px;border-top:1px solid #e5e5e5}.carousel{position:relative;margin-bottom:20px;line-height:1}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-moz-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{display:block;line-height:1}.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:40%;left:15px;width:40px;height:40px;margin-top:-20px;font-size:60px;font-weight:100;line-height:30px;color:#fff;text-align:center;background:#222;border:3px solid #fff;-webkit-border-radius:23px;-moz-border-radius:23px;border-radius:23px;opacity:.5;filter:alpha(opacity=50)}.carousel-control.right{right:15px;left:auto}.carousel-control:hover,.carousel-control:focus{color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-indicators{position:absolute;top:15px;right:15px;z-index:5;margin:0;list-style:none}.carousel-indicators li{display:block;float:left;width:10px;height:10px;margin-left:5px;text-indent:-999px;background-color:#ccc;background-color:rgba(255,255,255,0.25);border-radius:5px}.carousel-indicators .active{background-color:#fff}.carousel-caption{position:absolute;right:0;bottom:0;left:0;padding:15px;background:#333;background:rgba(0,0,0,0.75)}.carousel-caption h4,.carousel-caption p{line-height:20px;color:#fff}.carousel-caption h4{margin:0 0 5px}.carousel-caption p{margin-bottom:0}.hero-unit{padding:60px;margin-bottom:30px;font-size:18px;font-weight:200;line-height:30px;color:inherit;background-color:#eee;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.hero-unit h1{margin-bottom:0;font-size:60px;line-height:1;letter-spacing:-1px;color:inherit}.hero-unit li{line-height:30px}.pull-right{float:right}.pull-left{float:left}.hide{display:none}.show{display:block}.invisible{visibility:hidden}.affix{position:fixed}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/default.css b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/default.css
new file mode 100644
index 000000000..b024d962a
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/default.css
@@ -0,0 +1,343 @@
+/* Style the Yocto Project logo */
+.logo img { height: 30px; width: auto !important; }
+.logo { padding-top: 4px !important; padding-bottom:0px !important; }
+
+/* style the version information */
+.brand > a { color: #777; }
+.brand > a:hover { color: #999; text-decoration: none; }
+.icon-info-sign { color: #777; font-size: 16px; margin-left: 5px;}
+.icon-info-sign:hover { color: #999; cursor: pointer; }
+
+/* Style the breadcrumb */
+.breadcrumb { display: inline-block; background-color: transparent; }
+
+/* Styles for the help information */
+.get-help { color: #CCCCCC; }
+.get-help:hover, .icon-plus-sign:hover { color: #999999; cursor: pointer; }
+.get-help-green { color: #468847; }
+.get-help-green:hover { color: #347132; cursor: pointer; }
+.get-help-blue { color: #3A87AD; }
+.get-help-blue:hover { color: #005580; cursor: pointer; }
+.get-help-yellow { color: #C09853; }
+.get-help-yellow:hover { color: #B38942; cursor: pointer; }
+.get-help-red { color: #B94A48; font-size: 16px; padding-left: 2px; }
+.get-help-red:hover { color: #943A38; cursor: pointer; }
+.build-form>i:first-of-type { margin-left: 5px; }
+.manual { margin: 11px 15px 0 11px;}
+.heading-help { font-size: 14px; }
+
+/* Styles for the external link */
+.get-info { color: #0088CC; }
+.get-info:hover { color: #005580; cursor: pointer; text-decoration: none; }
+
+/* Styles for code and pre tags */
+code { background-color: transparent; border: none; color: #333333; }
+dd code, .alert code { white-space: pre-wrap; word-break: break-all; word-wrap: break-word; }
+.alert-warning code, .alert-warning pre { background-color: transparent; border: none; color: #C09853; margin-bottom: 0px; }
+.alert-error code { background-color: transparent; border: none; color: #B94A48; margin-bottom:0px; }
+.alert-error pre { background-color: transparent; border: none; color: #B94A48; word-break: normal; margin-bottom: 0px; }
+.alert-warning pre { word-break: normal; }
+.alert-info a { font-weight: 300; }
+.alert-info code { color: #3A87AD; }
+.tooltip code { background-color: transparent; color: #FFFFFF; font-weight: normal; border: none; font-size: 1em; }
+
+/* Style for definition lists */
+dd ul { list-style-type: none; margin: 0px; }
+dt, dd {line-height: 25px; }
+dd li { line-height: 25px; }
+.item-info dd { line-height: 20px; margin-bottom: 10px; }
+
+/* Style the filter modal dialogs */
+.modal { width: 800px; margin-left: -400px; }
+.modal-footer .btn { float: left; }
+.modal-body { max-height: 300px; }
+
+/* Hover style for the clear search icon */
+.icon-remove-sign:hover { color: #999999; cursor: pointer; }
+
+/* Some extra space before headings when needed */
+.details { margin-top: 30px; }
+.air { margin-top: 30px; }
+
+/* Required classes for the highlight behaviour in tables */
+.highlight { -webkit-animation: target-fade 10s 1; -moz-animation: target-fade 10s 1; animation: target-fade 10s 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; } }
+
+/* This makes tooltips work inside modal dialogs */
+.tooltip { z-index: 2000 !important; }
+
+/* Override default Twitter Boostrap styles for anchor tags inside tables */
+td a, td a > code { color: #333333; }
+td code { white-space: normal; }
+td a:hover, td a > code:hover { color: #000000; text-decoration: underline; }
+
+/* Override default Twitter Bootstrap styles for tr.error */
+.table tbody tr.error > td { background-color: transparent; } /* override default Bootstrap behaviour */
+.table-hover tbody tr.error:hover > td { background-color: #F5F5F5;} /* override default Bootstrap behaviour */
+
+/* Right justify Bootstrap table columns for size fields */
+.table .sizecol { text-align: right; }
+
+/* Set error, warning, success and muted styles */
+.error, .red, td.error a, tr.error a { color: #b94a48; }
+a.error:hover, a.error:focus, tr.error a:hover { color: #943A38; text-decoration: underline; }
+.warning, .yellow { color: #c09853;}
+a.warning { background-color: transparent; }
+a.warning:hover, a.warning:focus { color: #B38942; text-decoration: underline; }
+.success, .green { color: #468847;}
+.success:hover { color: #347132; text-decoration: underline; }
+td > .success:hover { text-decoration: underline; }
+.muted a { color:#999999; }
+.muted a:hover { color:#999999; }
+
+/* Sorting functionality styles for table headings */
+.sorted { color: #333333; font-weight: bold; }
+.sorted:hover { color: #000000; text-decoration: underline; }
+th > a, th > span { font-weight: normal; }
+
+/* Force long strings like commit hashes to wrap */
+.iscommit { white-space: pre-wrap; word-break: break-all; word-wrap: break-word;}
+
+/* Make the popovers scrollable if they are too long */
+.popover-content { max-height: 30em; overflow-y: scroll; }
+
+/* Styles for the directory structure table. We'll probably won't use those in production */
+.one { padding-left: 18px !important; }
+.two { padding-left: 36px !important; }
+.three { padding-left: 54px !important; }
+.content-directory a { color: #0088CC; }
+.content-directory a:hover { color: #005580; text-decoration: underline; }
+.symlink { color: #CCCCCC; }
+
+/* Styles for the navbar actions */
+.btn-group + .btn-group { margin-right: 10px; }
+.navbar-inner > .btn-group { margin-top: 6px; }
+[id^="search-input-"], #search { width: 80%; }
+
+/* Styles for the parent item in the left navigation */
+
+.nav > li > a.nav-parent { font-size: 18px; line-height: 25px; }
+
+/* Other styles */
+.dropdown-menu { padding: 10px; }
+select { width: auto; }
+.page-header { color: #5A5A5A; }
+.top-air { margin-top: 40px;}
+.progress { margin-bottom: 0px; }
+.lead .badge { font-size: 18px; font-weight: normal; border-radius: 15px; padding: 9px; }
+.lead ol, .lead ul { padding: 10px 0 0 20px; }
+.lead ol > li, .lead ul > li {
+ line-height: 35px;
+}
+.well > .lead, .alert .lead { margin-bottom: 0px; }
+.well-transparent { background-color: transparent; }
+.no-results { margin: 10px 0; }
+.task-name { margin-left: 7px; }
+.icon-hand-right {color: #CCCCCC; }
+.help-inline { margin: 5px; }
+.dashboard-section { background-color: transparent; }
+
+/* styles for landing page - analysis mode */
+.hero-unit { margin: 20px 0 30px; }
+.hero-unit > .close { font-size:40px; }
+.hero-actions { margin-top: 30px; }
+
+/* styles for landing page - build mode */
+.hero-unit p { line-height: 25px; }
+.hero-unit p, .hero-unit .btn-large { margin-top: 15px; }
+.hero-unit ul { margin-top: 20px; }
+.hero-unit li { line-height: 30px; }
+.hero-unit img { background-color: #eee; margin-top: 15px; }
+
+/* make tables Chrome-happy (me, not so much) */
+table { table-layout: fixed; word-wrap: break-word; }
+
+table p { margin-bottom: 0 }
+.table td { vertical-align: middle; }
+
+/* styles for the new build button */
+.new-build .btn-primary { padding: 4px 30px; }
+.new-build .alert { margin-top: 10px; }
+.new-build .alert p { margin-top: 10px; }
+
+/* styles for showing the project name in build mode */
+.project-name { padding-top: 0; }
+.project-name .label { font-weight: normal; margin-bottom: 5px; margin-left: -15px; padding: 5px; }
+.project-name .label > a { color: #fff; font-weight: normal; }
+
+/* styles for showing help icons next to command-line builds */
+.build-result .get-help-green, .build-result .get-help-red, .build-result .get-help-blue { margin-right: 35px; margin-top: 8px; font-size: 16px; }
+
+/* Remove bottom margin for forms inside modal dialogs */
+#dependencies-modal-form { margin-bottom: 0px; }
+
+/* Custom column widths */
+.narrow-col { width: 8%; }
+.medium-col { width: 12%; }
+
+/* Configuration styles */
+.icon-trash { color: #B94A48; font-size: 16px; padding-left: 5px; }
+.icon-trash:hover { color: #943A38; text-decoration: none; cursor: pointer; }
+.icon-pencil, .icon-download-alt, .icon-refresh, .icon-star-empty, .icon-star { font-size: 16px; color: #0088CC; padding-left: 2px; }
+.icon-pencil:hover, .icon-download-alt:hover, .icon-refresh:hover, .icon-star-empty:hover, .icon-star:hover, .icon-tasks:hover { color: #005580; text-decoration: none; cursor: pointer; }
+.icon-share { padding-left: 2px; }
+.alert-success .icon-refresh, .alert-success .icon-tasks { color: #468847; }
+.alert-success .icon-refresh:hover, .alert-success .icon-tasks:hover { color: #347132; }
+.alert-error .icon-refresh, .alert-error .icon-tasks { color: #b94a48; }
+.alert-error .icon-refresh:hover, .alert-error .icon-tasks:hover { color: #943A38; }
+.configuration-list li, .configuration-list label { line-height: 35px; font-size: 21px; font-weight: 200; margin-bottom: 0px;}
+.configuration-list { font-size: 16px; margin-bottom: 1.5em; }
+.configuration-list i { font-size: 16px; }
+/*.configuration-layers { height: 135px; overflow: scroll; }*/
+.counter { font-weight: normal; }
+.well-alert { background-color: #FCF8E3; border: 1px solid #FBEED5; border-radius: 4px; }
+.well-alert > .lead { color: #C09853; padding-bottom: .75em; }
+.configuration-alert { margin-bottom: 0px; padding: 8px 14px; }
+.configuration-alert p { margin-bottom: 0px; }
+.project-form { margin-top: 10px; }
+.add-layers .btn-block + .btn-block, .build .btn-block + .btn-block { margin-top: 0px; }
+input.huge { font-size: 17.5px; padding: 11px; min-width: 60%; }
+.build-form { margin-bottom: 0px; }
+.build-form .input-append { margin-bottom: 0px; }
+.build-form .btn-large { padding: 11px 35px; }
+.build-form p { font-size:17.5px ;margin:12px 0 0 10px;}
+#layer-container form, #target-container form { margin-bottom: 0px; }
+.btn-primary .icon-question-sign, .btn-danger .icon-question-sign { color: #fff; }
+.btn-primary .icon-question-sign:hover, .btn-danger .icon-question-sign:hover { color: #999; }
+a code { color: #0088CC; }
+a code:hover { color: #005580; }
+.localconf { font-size: 17.5px; margin-top: 40px; }
+.localconf code { font-size: 17.5px; }
+#add-layer-dependencies { margin-top: 5px; }
+.link-action { font-size: 17.5px; margin-top: 40px; }
+.link-action code { font-size: 17.5px; }
+.artifact { width: 9em; }
+.control-group { margin-bottom: 0px; }
+#project-details form { margin: 0px; }
+dd form { margin: 10px 0 0 0; }
+dl textarea { resize: vertical; }
+.navbar-fixed-top { z-index: 1; }
+.popover { z-index: 2; }
+.btn-danger .icon-trash { color: #fff; }
+.bbappends { list-style-type: none; margin-left: 0; }
+.bbappends li { line-height: 25px; }
+.configuration-list input[type="checkbox"] { margin-top:13px;margin-right:10px; }
+.alert input[type="checkbox"] { margin-top: 0px; margin-right: 3px; }
+.alert ol { padding: 10px 0px 0px 20px; }
+.alert ol > li { line-height: 35px; }
+.dl-vertical form { margin-top: 10px; }
+.scrolling { border: 1px solid #dddddd; height: 154px; overflow: auto; padding: 8px; width: 27.5%; margin-bottom: 10px; }
+.lead .help-block { font-size: 14px; line-height: 20px; font-weight: normal; }
+.button-place .btn { margin: 0 0 20px 0; }
+.tooltip-inner { max-width: 250px; }
+.new-build { padding: 20px; }
+.new-build li { line-height: 30px; }
+.new-build li .alert { line-height: 20px; width: 200px; white-space: normal; }
+.new-build h6 { margin: 10px 0 0 0; color: #5a5a5a; }
+.new-build h3 { margin: 0; color: #5a5a5a; }
+.new-build form { margin: 5px 0 0; }
+.new-build .input-append { margin-bottom: 0; }
+#build-selected { margin-top: 15px; }
+div.add-deps { margin-top: 15px; }
+.btn.log { margin-left: 20px; }
+
+
+.animate-repeat {
+ list-style:none;
+ box-sizing:border-box;
+}
+
+.animate-repeat.ng-move,
+.animate-repeat.ng-enter,
+.animate-repeat.ng-leave {
+ -webkit-transition:all linear 0.5s;
+ transition:all linear 0.5s;
+}
+
+.animate-repeat.ng-leave.ng-leave-active,
+.animate-repeat.ng-move,
+.animate-repeat.ng-enter {
+ opacity:0;
+}
+
+.animate-repeat.ng-leave,
+.animate-repeat.ng-enter.ng-enter-active {
+ opacity:1;
+}
+
+.tab-pane table { margin-top: 10px; }
+
+thead .description, .get_description_or_summary { width: 364px; }
+thead .add-del-layers { width: 124px; }
+
+#loading-notification {
+ position: fixed;
+ z-index: 101;
+ 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: 101;
+ top: 3%;
+ left: 20%;
+ right: 20%;
+ -webkit-box-shadow: 0 0 10px #3a87ad;
+ -moz-box-shadow: 0 0 10px #3a87ad;
+ box-shadow: 0 0 10px #3a87ad;
+}
+
+/* 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 */
+
+.top-padded {
+ padding-top: 60px;
+}
+
+input.input-lg {
+ font-size: 18px;
+ height: 22px;
+ line-height: 1.33333;
+ padding: 10px 16px;
+}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/font-awesome.min.css b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/font-awesome.min.css
new file mode 100755
index 000000000..fa15fd528
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_diagonals-thick_18_b81900_40x40.png b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_diagonals-thick_18_b81900_40x40.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_diagonals-thick_20_666666_40x40.png b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_diagonals-thick_20_666666_40x40.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_flat_10_000000_40x100.png b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_flat_10_000000_40x100.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_glass_100_f6f6f6_1x400.png b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_glass_100_f6f6f6_1x400.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_glass_100_fdf5ce_1x400.png b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_glass_100_fdf5ce_1x400.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_glass_65_ffffff_1x400.png b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_glass_65_ffffff_1x400.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_222222_256x240.png b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_222222_256x240.png
new file mode 100644
index 000000000..e9c8e16ac
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_222222_256x240.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_228ef1_256x240.png b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_228ef1_256x240.png
new file mode 100644
index 000000000..8d68c543e
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_228ef1_256x240.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_ef8c08_256x240.png b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_ef8c08_256x240.png
new file mode 100644
index 000000000..18bbfe821
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_ef8c08_256x240.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_ffd27a_256x240.png b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_ffd27a_256x240.png
new file mode 100644
index 000000000..4435b497e
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_ffd27a_256x240.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_ffffff_256x240.png b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_ffffff_256x240.png
new file mode 100644
index 000000000..4d66f596e
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_ffffff_256x240.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/jquery-ui.min.css b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/jquery-ui.min.css
new file mode 100755
index 000000000..c486ec045
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/jquery-ui.structure.min.css b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/jquery-ui.structure.min.css
new file mode 100755
index 000000000..d1578a4e9
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/jquery-ui.theme.min.css b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/jquery-ui.theme.min.css
new file mode 100755
index 000000000..34543111e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/jquery.treetable.css b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/jquery.treetable.css
new file mode 100644
index 000000000..4e95bfd3a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/jquery.treetable.theme.default.css b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/jquery.treetable.theme.default.css
new file mode 100644
index 000000000..48289baad
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/jquery.treetable.theme.toaster.css b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/jquery.treetable.theme.toaster.css
new file mode 100644
index 000000000..d8552e581
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/prettify.css b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/prettify.css
new file mode 100755
index 000000000..b317a7cda
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/prettify.css
@@ -0,0 +1 @@
+.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/qunit-1.18.0.css b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/qunit-1.18.0.css
new file mode 100644
index 000000000..28cca1cc1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/screen.css b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/css/screen.css
new file mode 100644
index 000000000..e233ef6ae
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/FontAwesome.otf b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/FontAwesome.otf
new file mode 100644
index 000000000..64049bf2e
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/FontAwesome.otf
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.eot b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.eot
new file mode 100644
index 000000000..7d81019e4
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.eot
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.svg b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.svg
new file mode 100644
index 000000000..ba0afe5ef
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.ttf b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.ttf
new file mode 100644
index 000000000..d46172476
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.ttf
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.woff b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.woff
new file mode 100644
index 000000000..3c89ae09b
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.woff
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.eot b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.eot
new file mode 100644
index 000000000..423bd5d3a
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.eot
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.svg b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.svg
new file mode 100644
index 000000000..446948874
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.svg
@@ -0,0 +1,229 @@
+<?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 />
+<glyph />
+<glyph unicode="&#xd;" />
+<glyph unicode=" " />
+<glyph unicode="*" d="M100 500v200h259l-183 183l141 141l183 -183v259h200v-259l183 183l141 -141l-183 -183h259v-200h-259l183 -183l-141 -141l-183 183v-259h-200v259l-183 -183l-141 141l183 183h-259z" />
+<glyph unicode="+" d="M0 400v300h400v400h300v-400h400v-300h-400v-400h-300v400h-400z" />
+<glyph unicode="&#xa0;" />
+<glyph unicode="&#x2000;" horiz-adv-x="652" />
+<glyph unicode="&#x2001;" horiz-adv-x="1304" />
+<glyph unicode="&#x2002;" horiz-adv-x="652" />
+<glyph unicode="&#x2003;" horiz-adv-x="1304" />
+<glyph unicode="&#x2004;" horiz-adv-x="434" />
+<glyph unicode="&#x2005;" horiz-adv-x="326" />
+<glyph unicode="&#x2006;" horiz-adv-x="217" />
+<glyph unicode="&#x2007;" horiz-adv-x="217" />
+<glyph unicode="&#x2008;" horiz-adv-x="163" />
+<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="326" />
+<glyph unicode="&#x20ac;" d="M100 500l100 100h113q0 47 5 100h-218l100 100h135q37 167 112 257q117 141 297 141q242 0 354 -189q60 -103 66 -209h-181q0 55 -25.5 99t-63.5 68t-75 36.5t-67 12.5q-24 0 -52.5 -10t-62.5 -32t-65.5 -67t-50.5 -107h379l-100 -100h-300q-6 -46 -6 -100h406l-100 -100 h-300q9 -74 33 -132t52.5 -91t62 -54.5t59 -29t46.5 -7.5q29 0 66 13t75 37t63.5 67.5t25.5 96.5h174q-31 -172 -128 -278q-107 -117 -274 -117q-205 0 -324 158q-36 46 -69 131.5t-45 205.5h-217z" />
+<glyph unicode="&#x2212;" d="M200 400h900v300h-900v-300z" />
+<glyph unicode="&#x2601;" d="M-14 494q0 -80 56.5 -137t135.5 -57h750q120 0 205 86t85 208q0 120 -85 206.5t-205 86.5q-46 0 -90 -14q-44 97 -134.5 156.5t-200.5 59.5q-152 0 -260 -107.5t-108 -260.5q0 -25 2 -37q-66 -14 -108.5 -67.5t-42.5 -122.5z" />
+<glyph unicode="&#x2709;" d="M0 100l400 400l200 -200l200 200l400 -400h-1200zM0 300v600l300 -300zM0 1100l600 -603l600 603h-1200zM900 600l300 300v-600z" />
+<glyph unicode="&#x270f;" d="M-13 -13l333 112l-223 223zM187 403l214 -214l614 614l-214 214zM887 1103l214 -214l99 92q13 13 13 32.5t-13 33.5l-153 153q-15 13 -33 13t-33 -13z" />
+<glyph unicode="&#xe000;" horiz-adv-x="500" d="M0 0z" />
+<glyph unicode="&#xe001;" d="M0 1200h1200l-500 -550v-550h300v-100h-800v100h300v550z" />
+<glyph unicode="&#xe002;" d="M14 84q18 -55 86 -75.5t147 5.5q65 21 109 69t44 90v606l600 155v-521q-64 16 -138 -7q-79 -26 -122.5 -83t-25.5 -111q17 -55 85.5 -75.5t147.5 4.5q70 23 111.5 63.5t41.5 95.5v881q0 10 -7 15.5t-17 2.5l-752 -193q-10 -3 -17 -12.5t-7 -19.5v-689q-64 17 -138 -7 q-79 -25 -122.5 -82t-25.5 -112z" />
+<glyph unicode="&#xe003;" d="M23 693q0 200 142 342t342 142t342 -142t142 -342q0 -142 -78 -261l300 -300q7 -8 7 -18t-7 -18l-109 -109q-8 -7 -18 -7t-18 7l-300 300q-119 -78 -261 -78q-200 0 -342 142t-142 342zM176 693q0 -136 97 -233t234 -97t233.5 96.5t96.5 233.5t-96.5 233.5t-233.5 96.5 t-234 -97t-97 -233z" />
+<glyph unicode="&#xe005;" d="M100 784q0 64 28 123t73 100.5t104.5 64t119 20.5t120 -38.5t104.5 -104.5q48 69 109.5 105t121.5 38t118.5 -20.5t102.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-149.5 152.5t-126.5 127.5 t-94 124.5t-33.5 117.5z" />
+<glyph unicode="&#xe006;" d="M-72 800h479l146 400h2l146 -400h472l-382 -278l145 -449l-384 275l-382 -275l146 447zM168 71l2 1z" />
+<glyph unicode="&#xe007;" d="M-72 800h479l146 400h2l146 -400h472l-382 -278l145 -449l-384 275l-382 -275l146 447zM168 71l2 1zM237 700l196 -142l-73 -226l192 140l195 -141l-74 229l193 140h-235l-77 211l-78 -211h-239z" />
+<glyph unicode="&#xe008;" d="M0 0v143l400 257v100q-37 0 -68.5 74.5t-31.5 125.5v200q0 124 88 212t212 88t212 -88t88 -212v-200q0 -51 -31.5 -125.5t-68.5 -74.5v-100l400 -257v-143h-1200z" />
+<glyph unicode="&#xe009;" d="M0 0v1100h1200v-1100h-1200zM100 100h100v100h-100v-100zM100 300h100v100h-100v-100zM100 500h100v100h-100v-100zM100 700h100v100h-100v-100zM100 900h100v100h-100v-100zM300 100h600v400h-600v-400zM300 600h600v400h-600v-400zM1000 100h100v100h-100v-100z M1000 300h100v100h-100v-100zM1000 500h100v100h-100v-100zM1000 700h100v100h-100v-100zM1000 900h100v100h-100v-100z" />
+<glyph unicode="&#xe010;" d="M0 50v400q0 21 14.5 35.5t35.5 14.5h400q21 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.5zM0 650v400q0 21 14.5 35.5t35.5 14.5h400q21 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.5zM600 50v400q0 21 14.5 35.5t35.5 14.5h400q21 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.5zM600 650v400q0 21 14.5 35.5t35.5 14.5h400q21 0 35.5 -14.5t14.5 -35.5v-400 q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5z" />
+<glyph unicode="&#xe011;" d="M0 50v200q0 21 14.5 35.5t35.5 14.5h200q21 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.5zM0 450v200q0 21 14.5 35.5t35.5 14.5h200q21 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.5zM0 850v200q0 21 14.5 35.5t35.5 14.5h200q21 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.5zM400 50v200q0 21 14.5 35.5t35.5 14.5h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5 t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5zM400 450v200q0 21 14.5 35.5t35.5 14.5h200q21 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.5zM400 850v200q0 21 14.5 35.5t35.5 14.5h200q21 0 35.5 -14.5t14.5 -35.5 v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5zM800 50v200q0 21 14.5 35.5t35.5 14.5h200q21 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.5zM800 450v200q0 21 14.5 35.5t35.5 14.5h200 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.5zM800 850v200q0 21 14.5 35.5t35.5 14.5h200q21 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.5z" />
+<glyph unicode="&#xe012;" d="M0 50v200q0 21 14.5 35.5t35.5 14.5h200q21 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.5zM0 450q0 -21 14.5 -35.5t35.5 -14.5h200q21 0 35.5 14.5t14.5 35.5v200q0 21 -14.5 35.5t-35.5 14.5h-200q-21 0 -35.5 -14.5 t-14.5 -35.5v-200zM0 850v200q0 21 14.5 35.5t35.5 14.5h200q21 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.5zM400 50v200q0 21 14.5 35.5t35.5 14.5h700q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5 t-35.5 -14.5h-700q-21 0 -35.5 14.5t-14.5 35.5zM400 450v200q0 21 14.5 35.5t35.5 14.5h700q21 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.5zM400 850v200q0 21 14.5 35.5t35.5 14.5h700q21 0 35.5 -14.5t14.5 -35.5 v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-700q-21 0 -35.5 14.5t-14.5 35.5z" />
+<glyph unicode="&#xe013;" d="M29 454l419 -420l818 820l-212 212l-607 -607l-206 207z" />
+<glyph unicode="&#xe014;" d="M106 318l282 282l-282 282l212 212l282 -282l282 282l212 -212l-282 -282l282 -282l-212 -212l-282 282l-282 -282z" />
+<glyph unicode="&#xe015;" d="M23 693q0 200 142 342t342 142t342 -142t142 -342q0 -142 -78 -261l300 -300q7 -8 7 -18t-7 -18l-109 -109q-8 -7 -18 -7t-18 7l-300 300q-119 -78 -261 -78q-200 0 -342 142t-142 342zM176 693q0 -136 97 -233t234 -97t233.5 96.5t96.5 233.5t-96.5 233.5t-233.5 96.5 t-234 -97t-97 -233zM300 600v200h100v100h200v-100h100v-200h-100v-100h-200v100h-100z" />
+<glyph unicode="&#xe016;" d="M23 694q0 200 142 342t342 142t342 -142t142 -342q0 -141 -78 -262l300 -299q7 -7 7 -18t-7 -18l-109 -109q-8 -8 -18 -8t-18 8l-300 299q-120 -77 -261 -77q-200 0 -342 142t-142 342zM176 694q0 -136 97 -233t234 -97t233.5 97t96.5 233t-96.5 233t-233.5 97t-234 -97 t-97 -233zM300 601h400v200h-400v-200z" />
+<glyph unicode="&#xe017;" d="M23 600q0 183 105 331t272 210v-166q-103 -55 -165 -155t-62 -220q0 -177 125 -302t302 -125t302 125t125 302q0 120 -62 220t-165 155v166q167 -62 272 -210t105 -331q0 -118 -45.5 -224.5t-123 -184t-184 -123t-224.5 -45.5t-224.5 45.5t-184 123t-123 184t-45.5 224.5 zM500 750q0 -21 14.5 -35.5t35.5 -14.5h100q21 0 35.5 14.5t14.5 35.5v400q0 21 -14.5 35.5t-35.5 14.5h-100q-21 0 -35.5 -14.5t-14.5 -35.5v-400z" />
+<glyph unicode="&#xe018;" d="M100 1h200v300h-200v-300zM400 1v500h200v-500h-200zM700 1v800h200v-800h-200zM1000 1v1200h200v-1200h-200z" />
+<glyph unicode="&#xe019;" d="M26 601q0 -33 6 -74l151 -38l2 -6q14 -49 38 -93l3 -5l-80 -134q45 -59 105 -105l133 81l5 -3q45 -26 94 -39l5 -2l38 -151q40 -5 74 -5q27 0 74 5l38 151l6 2q46 13 93 39l5 3l134 -81q56 44 104 105l-80 134l3 5q24 44 39 93l1 6l152 38q5 40 5 74q0 28 -5 73l-152 38 l-1 6q-16 51 -39 93l-3 5l80 134q-44 58 -104 105l-134 -81l-5 3q-45 25 -93 39l-6 1l-38 152q-40 5 -74 5q-27 0 -74 -5l-38 -152l-5 -1q-50 -14 -94 -39l-5 -3l-133 81q-59 -47 -105 -105l80 -134l-3 -5q-25 -47 -38 -93l-2 -6l-151 -38q-6 -48 -6 -73zM385 601 q0 88 63 151t152 63t152 -63t63 -151q0 -89 -63 -152t-152 -63t-152 63t-63 152z" />
+<glyph unicode="&#xe020;" d="M100 1025v50q0 10 7.5 17.5t17.5 7.5h275v100q0 41 29.5 70.5t70.5 29.5h300q41 0 70.5 -29.5t29.5 -70.5v-100h275q10 0 17.5 -7.5t7.5 -17.5v-50q0 -11 -7 -18t-18 -7h-1050q-11 0 -18 7t-7 18zM200 100v800h900v-800q0 -41 -29.5 -71t-70.5 -30h-700q-41 0 -70.5 30 t-29.5 71zM300 100h100v700h-100v-700zM500 100h100v700h-100v-700zM500 1100h300v100h-300v-100zM700 100h100v700h-100v-700zM900 100h100v700h-100v-700z" />
+<glyph unicode="&#xe021;" d="M1 601l656 644l644 -644h-200v-600h-300v400h-300v-400h-300v600h-200z" />
+<glyph unicode="&#xe022;" d="M100 25v1150q0 11 7 18t18 7h475v-500h400v-675q0 -11 -7 -18t-18 -7h-850q-11 0 -18 7t-7 18zM700 800v300l300 -300h-300z" />
+<glyph unicode="&#xe023;" d="M4 600q0 162 80 299t217 217t299 80t299 -80t217 -217t80 -299t-80 -299t-217 -217t-299 -80t-299 80t-217 217t-80 299zM186 600q0 -171 121.5 -292.5t292.5 -121.5t292.5 121.5t121.5 292.5t-121.5 292.5t-292.5 121.5t-292.5 -121.5t-121.5 -292.5zM500 500v400h100 v-300h200v-100h-300z" />
+<glyph unicode="&#xe024;" d="M-100 0l431 1200h209l-21 -300h162l-20 300h208l431 -1200h-538l-41 400h-242l-40 -400h-539zM488 500h224l-27 300h-170z" />
+<glyph unicode="&#xe025;" d="M0 0v400h490l-290 300h200v500h300v-500h200l-290 -300h490v-400h-1100zM813 200h175v100h-175v-100z" />
+<glyph unicode="&#xe026;" d="M1 600q0 122 47.5 233t127.5 191t191 127.5t233 47.5t233 -47.5t191 -127.5t127.5 -191t47.5 -233t-47.5 -233t-127.5 -191t-191 -127.5t-233 -47.5t-233 47.5t-191 127.5t-127.5 191t-47.5 233zM188 600q0 -170 121 -291t291 -121t291 121t121 291t-121 291t-291 121 t-291 -121t-121 -291zM350 600h150v300h200v-300h150l-250 -300z" />
+<glyph unicode="&#xe027;" d="M4 600q0 162 80 299t217 217t299 80t299 -80t217 -217t80 -299t-80 -299t-217 -217t-299 -80t-299 80t-217 217t-80 299zM186 600q0 -171 121.5 -292.5t292.5 -121.5t292.5 121.5t121.5 292.5t-121.5 292.5t-292.5 121.5t-292.5 -121.5t-121.5 -292.5zM350 600l250 300 l250 -300h-150v-300h-200v300h-150z" />
+<glyph unicode="&#xe028;" d="M0 25v475l200 700h800q199 -700 200 -700v-475q0 -11 -7 -18t-18 -7h-1150q-11 0 -18 7t-7 18zM200 500h200l50 -200h300l50 200h200l-97 500h-606z" />
+<glyph unicode="&#xe029;" d="M4 600q0 162 80 299t217 217t299 80t299 -80t217 -217t80 -299t-80 -299t-217 -217t-299 -80t-299 80t-217 217t-80 299zM186 600q0 -172 121.5 -293t292.5 -121t292.5 121t121.5 293q0 171 -121.5 292.5t-292.5 121.5t-292.5 -121.5t-121.5 -292.5zM500 397v401 l297 -200z" />
+<glyph unicode="&#xe030;" d="M23 600q0 -118 45.5 -224.5t123 -184t184 -123t224.5 -45.5t224.5 45.5t184 123t123 184t45.5 224.5h-150q0 -177 -125 -302t-302 -125t-302 125t-125 302t125 302t302 125q136 0 246 -81l-146 -146h400v400l-145 -145q-157 122 -355 122q-118 0 -224.5 -45.5t-184 -123 t-123 -184t-45.5 -224.5z" />
+<glyph unicode="&#xe031;" d="M23 600q0 118 45.5 224.5t123 184t184 123t224.5 45.5q198 0 355 -122l145 145v-400h-400l147 147q-112 80 -247 80q-177 0 -302 -125t-125 -302h-150zM100 0v400h400l-147 -147q112 -80 247 -80q177 0 302 125t125 302h150q0 -118 -45.5 -224.5t-123 -184t-184 -123 t-224.5 -45.5q-198 0 -355 122z" />
+<glyph unicode="&#xe032;" d="M100 0h1100v1200h-1100v-1200zM200 100v900h900v-900h-900zM300 200v100h100v-100h-100zM300 400v100h100v-100h-100zM300 600v100h100v-100h-100zM300 800v100h100v-100h-100zM500 200h500v100h-500v-100zM500 400v100h500v-100h-500zM500 600v100h500v-100h-500z M500 800v100h500v-100h-500z" />
+<glyph unicode="&#xe033;" d="M0 100v600q0 41 29.5 70.5t70.5 29.5h100v200q0 82 59 141t141 59h300q82 0 141 -59t59 -141v-200h100q41 0 70.5 -29.5t29.5 -70.5v-600q0 -41 -29.5 -70.5t-70.5 -29.5h-900q-41 0 -70.5 29.5t-29.5 70.5zM400 800h300v150q0 21 -14.5 35.5t-35.5 14.5h-200 q-21 0 -35.5 -14.5t-14.5 -35.5v-150z" />
+<glyph unicode="&#xe034;" d="M100 0v1100h100v-1100h-100zM300 400q60 60 127.5 84t127.5 17.5t122 -23t119 -30t110 -11t103 42t91 120.5v500q-40 -81 -101.5 -115.5t-127.5 -29.5t-138 25t-139.5 40t-125.5 25t-103 -29.5t-65 -115.5v-500z" />
+<glyph unicode="&#xe035;" d="M0 275q0 -11 7 -18t18 -7h50q11 0 18 7t7 18v300q0 127 70.5 231.5t184.5 161.5t245 57t245 -57t184.5 -161.5t70.5 -231.5v-300q0 -11 7 -18t18 -7h50q11 0 18 7t7 18v300q0 116 -49.5 227t-131 192.5t-192.5 131t-227 49.5t-227 -49.5t-192.5 -131t-131 -192.5 t-49.5 -227v-300zM200 20v460q0 8 6 14t14 6h160q8 0 14 -6t6 -14v-460q0 -8 -6 -14t-14 -6h-160q-8 0 -14 6t-6 14zM800 20v460q0 8 6 14t14 6h160q8 0 14 -6t6 -14v-460q0 -8 -6 -14t-14 -6h-160q-8 0 -14 6t-6 14z" />
+<glyph unicode="&#xe036;" d="M0 400h300l300 -200v800l-300 -200h-300v-400zM688 459l141 141l-141 141l71 71l141 -141l141 141l71 -71l-141 -141l141 -141l-71 -71l-141 141l-141 -141z" />
+<glyph unicode="&#xe037;" d="M0 400h300l300 -200v800l-300 -200h-300v-400zM700 857l69 53q111 -135 111 -310q0 -169 -106 -302l-67 54q86 110 86 248q0 146 -93 257z" />
+<glyph unicode="&#xe038;" d="M0 401v400h300l300 200v-800l-300 200h-300zM702 858l69 53q111 -135 111 -310q0 -170 -106 -303l-67 55q86 110 86 248q0 145 -93 257zM889 951l7 -8q123 -151 123 -344q0 -189 -119 -339l-7 -8l81 -66l6 8q142 178 142 405q0 230 -144 408l-6 8z" />
+<glyph unicode="&#xe039;" d="M0 0h500v500h-200v100h-100v-100h-200v-500zM0 600h100v100h400v100h100v100h-100v300h-500v-600zM100 100v300h300v-300h-300zM100 800v300h300v-300h-300zM200 200v100h100v-100h-100zM200 900h100v100h-100v-100zM500 500v100h300v-300h200v-100h-100v-100h-200v100 h-100v100h100v200h-200zM600 0v100h100v-100h-100zM600 1000h100v-300h200v-300h300v200h-200v100h200v500h-600v-200zM800 800v300h300v-300h-300zM900 0v100h300v-100h-300zM900 900v100h100v-100h-100zM1100 200v100h100v-100h-100z" />
+<glyph unicode="&#xe040;" d="M0 200h100v1000h-100v-1000zM100 0v100h300v-100h-300zM200 200v1000h100v-1000h-100zM500 0v91h100v-91h-100zM500 200v1000h200v-1000h-200zM700 0v91h100v-91h-100zM800 200v1000h100v-1000h-100zM900 0v91h200v-91h-200zM1000 200v1000h200v-1000h-200z" />
+<glyph unicode="&#xe041;" d="M1 700v475q0 10 7.5 17.5t17.5 7.5h474l700 -700l-500 -500zM148 953q0 -42 29 -71q30 -30 71.5 -30t71.5 30q29 29 29 71t-29 71q-30 30 -71.5 30t-71.5 -30q-29 -29 -29 -71z" />
+<glyph unicode="&#xe042;" d="M2 700v475q0 11 7 18t18 7h474l700 -700l-500 -500zM148 953q0 -42 30 -71q29 -30 71 -30t71 30q30 29 30 71t-30 71q-29 30 -71 30t-71 -30q-30 -29 -30 -71zM701 1200h100l700 -700l-500 -500l-50 50l450 450z" />
+<glyph unicode="&#xe043;" d="M100 0v1025l175 175h925v-1000l-100 -100v1000h-750l-100 -100h750v-1000h-900z" />
+<glyph unicode="&#xe044;" d="M200 0l450 444l450 -443v1150q0 20 -14.5 35t-35.5 15h-800q-21 0 -35.5 -15t-14.5 -35v-1151z" />
+<glyph unicode="&#xe045;" d="M0 100v700h200l100 -200h600l100 200h200v-700h-200v200h-800v-200h-200zM253 829l40 -124h592l62 124l-94 346q-2 11 -10 18t-18 7h-450q-10 0 -18 -7t-10 -18zM281 24l38 152q2 10 11.5 17t19.5 7h500q10 0 19.5 -7t11.5 -17l38 -152q2 -10 -3.5 -17t-15.5 -7h-600 q-10 0 -15.5 7t-3.5 17z" />
+<glyph unicode="&#xe046;" d="M0 200q0 -41 29.5 -70.5t70.5 -29.5h1000q41 0 70.5 29.5t29.5 70.5v600q0 41 -29.5 70.5t-70.5 29.5h-150q-4 8 -11.5 21.5t-33 48t-53 61t-69 48t-83.5 21.5h-200q-41 0 -82 -20.5t-70 -50t-52 -59t-34 -50.5l-12 -20h-150q-41 0 -70.5 -29.5t-29.5 -70.5v-600z M356 500q0 100 72 172t172 72t172 -72t72 -172t-72 -172t-172 -72t-172 72t-72 172zM494 500q0 -44 31 -75t75 -31t75 31t31 75t-31 75t-75 31t-75 -31t-31 -75zM900 700v100h100v-100h-100z" />
+<glyph unicode="&#xe047;" d="M53 0h365v66q-41 0 -72 11t-49 38t1 71l92 234h391l82 -222q16 -45 -5.5 -88.5t-74.5 -43.5v-66h417v66q-34 1 -74 43q-18 19 -33 42t-21 37l-6 13l-385 998h-93l-399 -1006q-24 -48 -52 -75q-12 -12 -33 -25t-36 -20l-15 -7v-66zM416 521l178 457l46 -140l116 -317h-340 z" />
+<glyph unicode="&#xe048;" d="M100 0v89q41 7 70.5 32.5t29.5 65.5v827q0 28 -1 39.5t-5.5 26t-15.5 21t-29 14t-49 14.5v70h471q120 0 213 -88t93 -228q0 -55 -11.5 -101.5t-28 -74t-33.5 -47.5t-28 -28l-12 -7q8 -3 21.5 -9t48 -31.5t60.5 -58t47.5 -91.5t21.5 -129q0 -84 -59 -156.5t-142 -111 t-162 -38.5h-500zM400 200h161q89 0 153 48.5t64 132.5q0 90 -62.5 154.5t-156.5 64.5h-159v-400zM400 700h139q76 0 130 61.5t54 138.5q0 82 -84 130.5t-239 48.5v-379z" />
+<glyph unicode="&#xe049;" d="M200 0v57q77 7 134.5 40.5t65.5 80.5l173 849q10 56 -10 74t-91 37q-6 1 -10.5 2.5t-9.5 2.5v57h425l2 -57q-33 -8 -62 -25.5t-46 -37t-29.5 -38t-17.5 -30.5l-5 -12l-128 -825q-10 -52 14 -82t95 -36v-57h-500z" />
+<glyph unicode="&#xe050;" d="M-75 200h75v800h-75l125 167l125 -167h-75v-800h75l-125 -167zM300 900v300h150h700h150v-300h-50q0 29 -8 48.5t-18.5 30t-33.5 15t-39.5 5.5t-50.5 1h-200v-850l100 -50v-100h-400v100l100 50v850h-200q-34 0 -50.5 -1t-40 -5.5t-33.5 -15t-18.5 -30t-8.5 -48.5h-49z " />
+<glyph unicode="&#xe051;" d="M33 51l167 125v-75h800v75l167 -125l-167 -125v75h-800v-75zM100 901v300h150h700h150v-300h-50q0 29 -8 48.5t-18 30t-33.5 15t-40 5.5t-50.5 1h-200v-650l100 -50v-100h-400v100l100 50v650h-200q-34 0 -50.5 -1t-39.5 -5.5t-33.5 -15t-18.5 -30t-8 -48.5h-50z" />
+<glyph unicode="&#xe052;" d="M0 50q0 -20 14.5 -35t35.5 -15h1100q21 0 35.5 15t14.5 35v100q0 21 -14.5 35.5t-35.5 14.5h-1100q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM0 350q0 -20 14.5 -35t35.5 -15h800q21 0 35.5 15t14.5 35v100q0 21 -14.5 35.5t-35.5 14.5h-800q-21 0 -35.5 -14.5t-14.5 -35.5 v-100zM0 650q0 -20 14.5 -35t35.5 -15h1000q21 0 35.5 15t14.5 35v100q0 21 -14.5 35.5t-35.5 14.5h-1000q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM0 950q0 -20 14.5 -35t35.5 -15h600q21 0 35.5 15t14.5 35v100q0 21 -14.5 35.5t-35.5 14.5h-600q-21 0 -35.5 -14.5 t-14.5 -35.5v-100z" />
+<glyph unicode="&#xe053;" d="M0 50q0 -20 14.5 -35t35.5 -15h1100q21 0 35.5 15t14.5 35v100q0 21 -14.5 35.5t-35.5 14.5h-1100q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM0 650q0 -20 14.5 -35t35.5 -15h1100q21 0 35.5 15t14.5 35v100q0 21 -14.5 35.5t-35.5 14.5h-1100q-21 0 -35.5 -14.5t-14.5 -35.5 v-100zM200 350q0 -20 14.5 -35t35.5 -15h700q21 0 35.5 15t14.5 35v100q0 21 -14.5 35.5t-35.5 14.5h-700q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM200 950q0 -20 14.5 -35t35.5 -15h700q21 0 35.5 15t14.5 35v100q0 21 -14.5 35.5t-35.5 14.5h-700q-21 0 -35.5 -14.5 t-14.5 -35.5v-100z" />
+<glyph unicode="&#xe054;" d="M0 50v100q0 21 14.5 35.5t35.5 14.5h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-1100q-21 0 -35.5 15t-14.5 35zM100 650v100q0 21 14.5 35.5t35.5 14.5h1000q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-1000q-21 0 -35.5 15 t-14.5 35zM300 350v100q0 21 14.5 35.5t35.5 14.5h800q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-800q-21 0 -35.5 15t-14.5 35zM500 950v100q0 21 14.5 35.5t35.5 14.5h600q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-600 q-21 0 -35.5 15t-14.5 35z" />
+<glyph unicode="&#xe055;" d="M0 50v100q0 21 14.5 35.5t35.5 14.5h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-1100q-21 0 -35.5 15t-14.5 35zM0 350v100q0 21 14.5 35.5t35.5 14.5h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-1100q-21 0 -35.5 15 t-14.5 35zM0 650v100q0 21 14.5 35.5t35.5 14.5h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-1100q-21 0 -35.5 15t-14.5 35zM0 950v100q0 21 14.5 35.5t35.5 14.5h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-1100 q-21 0 -35.5 15t-14.5 35z" />
+<glyph unicode="&#xe056;" d="M0 50v100q0 21 14.5 35.5t35.5 14.5h100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-100q-21 0 -35.5 15t-14.5 35zM0 350v100q0 21 14.5 35.5t35.5 14.5h100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-100q-21 0 -35.5 15 t-14.5 35zM0 650v100q0 21 14.5 35.5t35.5 14.5h100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-100q-21 0 -35.5 15t-14.5 35zM0 950v100q0 21 14.5 35.5t35.5 14.5h100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-100q-21 0 -35.5 15 t-14.5 35zM300 50v100q0 21 14.5 35.5t35.5 14.5h800q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-800q-21 0 -35.5 15t-14.5 35zM300 350v100q0 21 14.5 35.5t35.5 14.5h800q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-800 q-21 0 -35.5 15t-14.5 35zM300 650v100q0 21 14.5 35.5t35.5 14.5h800q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-800q-21 0 -35.5 15t-14.5 35zM300 950v100q0 21 14.5 35.5t35.5 14.5h800q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15 h-800q-21 0 -35.5 15t-14.5 35z" />
+<glyph unicode="&#xe057;" d="M-101 500v100h201v75l166 -125l-166 -125v75h-201zM300 0h100v1100h-100v-1100zM500 50q0 -20 14.5 -35t35.5 -15h600q20 0 35 15t15 35v100q0 21 -15 35.5t-35 14.5h-600q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM500 350q0 -20 14.5 -35t35.5 -15h300q20 0 35 15t15 35 v100q0 21 -15 35.5t-35 14.5h-300q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM500 650q0 -20 14.5 -35t35.5 -15h500q20 0 35 15t15 35v100q0 21 -15 35.5t-35 14.5h-500q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM500 950q0 -20 14.5 -35t35.5 -15h100q20 0 35 15t15 35v100 q0 21 -15 35.5t-35 14.5h-100q-21 0 -35.5 -14.5t-14.5 -35.5v-100z" />
+<glyph unicode="&#xe058;" d="M1 50q0 -20 14.5 -35t35.5 -15h600q20 0 35 15t15 35v100q0 21 -15 35.5t-35 14.5h-600q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM1 350q0 -20 14.5 -35t35.5 -15h300q20 0 35 15t15 35v100q0 21 -15 35.5t-35 14.5h-300q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM1 650 q0 -20 14.5 -35t35.5 -15h500q20 0 35 15t15 35v100q0 21 -15 35.5t-35 14.5h-500q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM1 950q0 -20 14.5 -35t35.5 -15h100q20 0 35 15t15 35v100q0 21 -15 35.5t-35 14.5h-100q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM801 0v1100h100v-1100 h-100zM934 550l167 -125v75h200v100h-200v75z" />
+<glyph unicode="&#xe059;" d="M0 275v650q0 31 22 53t53 22h750q31 0 53 -22t22 -53v-650q0 -31 -22 -53t-53 -22h-750q-31 0 -53 22t-22 53zM900 600l300 300v-600z" />
+<glyph unicode="&#xe060;" d="M0 44v1012q0 18 13 31t31 13h1112q19 0 31.5 -13t12.5 -31v-1012q0 -18 -12.5 -31t-31.5 -13h-1112q-18 0 -31 13t-13 31zM100 263l247 182l298 -131l-74 156l293 318l236 -288v500h-1000v-737zM208 750q0 56 39 95t95 39t95 -39t39 -95t-39 -95t-95 -39t-95 39t-39 95z " />
+<glyph unicode="&#xe062;" d="M148 745q0 124 60.5 231.5t165 172t226.5 64.5q123 0 227 -63t164.5 -169.5t60.5 -229.5t-73 -272q-73 -114 -166.5 -237t-150.5 -189l-57 -66q-10 9 -27 26t-66.5 70.5t-96 109t-104 135.5t-100.5 155q-63 139 -63 262zM342 772q0 -107 75.5 -182.5t181.5 -75.5 q107 0 182.5 75.5t75.5 182.5t-75.5 182t-182.5 75t-182 -75.5t-75 -181.5z" />
+<glyph unicode="&#xe063;" d="M1 600q0 122 47.5 233t127.5 191t191 127.5t233 47.5t233 -47.5t191 -127.5t127.5 -191t47.5 -233t-47.5 -233t-127.5 -191t-191 -127.5t-233 -47.5t-233 47.5t-191 127.5t-127.5 191t-47.5 233zM173 600q0 -177 125.5 -302t301.5 -125v854q-176 0 -301.5 -125 t-125.5 -302z" />
+<glyph unicode="&#xe064;" d="M117 406q0 94 34 186t88.5 172.5t112 159t115 177t87.5 194.5q21 -71 57.5 -142.5t76 -130.5t83 -118.5t82 -117t70 -116t50 -125.5t18.5 -136q0 -89 -39 -165.5t-102 -126.5t-140 -79.5t-156 -33.5q-114 6 -211.5 53t-161.5 138.5t-64 210.5zM243 414q14 -82 59.5 -136 t136.5 -80l16 98q-7 6 -18 17t-34 48t-33 77q-15 73 -14 143.5t10 122.5l9 51q-92 -110 -119.5 -185t-12.5 -156z" />
+<glyph unicode="&#xe065;" d="M0 400v300q0 165 117.5 282.5t282.5 117.5q366 -6 397 -14l-186 -186h-311q-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.5v125l200 200v-225q0 -165 -117.5 -282.5t-282.5 -117.5h-300q-165 0 -282.5 117.5 t-117.5 282.5zM436 341l161 50l412 412l-114 113l-405 -405zM995 1015l113 -113l113 113l-21 85l-92 28z" />
+<glyph unicode="&#xe066;" d="M0 400v300q0 165 117.5 282.5t282.5 117.5h261l2 -80q-133 -32 -218 -120h-145q-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-53q0 -165 -117.5 -282.5t-282.5 -117.5h-300q-165 0 -282.5 117.5t-117.5 282.5 zM423 524q30 38 81.5 64t103 35.5t99 14t77.5 3.5l29 -1v-209l360 324l-359 318v-216q-7 0 -19 -1t-48 -8t-69.5 -18.5t-76.5 -37t-76.5 -59t-62 -88t-39.5 -121.5z" />
+<glyph unicode="&#xe067;" d="M0 400v300q0 165 117.5 282.5t282.5 117.5h300q60 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-169q0 -165 -117.5 -282.5t-282.5 -117.5h-300q-165 0 -282.5 117.5 t-117.5 282.5zM342 632l283 -284l566 567l-136 137l-430 -431l-147 147z" />
+<glyph unicode="&#xe068;" d="M0 603l300 296v-198h200v200h-200l300 300l295 -300h-195v-200h200v198l300 -296l-300 -300v198h-200v-200h195l-295 -300l-300 300h200v200h-200v-198z" />
+<glyph unicode="&#xe069;" d="M200 50v1000q0 21 14.5 35.5t35.5 14.5h100q21 0 35.5 -14.5t14.5 -35.5v-437l500 487v-1100l-500 488v-438q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5z" />
+<glyph unicode="&#xe070;" d="M0 50v1000q0 21 14.5 35.5t35.5 14.5h100q21 0 35.5 -14.5t14.5 -35.5v-437l500 487v-487l500 487v-1100l-500 488v-488l-500 488v-438q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5z" />
+<glyph unicode="&#xe071;" d="M136 550l564 550v-487l500 487v-1100l-500 488v-488z" />
+<glyph unicode="&#xe072;" d="M200 0l900 550l-900 550v-1100z" />
+<glyph unicode="&#xe073;" d="M200 150q0 -21 14.5 -35.5t35.5 -14.5h200q21 0 35.5 14.5t14.5 35.5v800q0 21 -14.5 35.5t-35.5 14.5h-200q-21 0 -35.5 -14.5t-14.5 -35.5v-800zM600 150q0 -21 14.5 -35.5t35.5 -14.5h200q21 0 35.5 14.5t14.5 35.5v800q0 21 -14.5 35.5t-35.5 14.5h-200 q-21 0 -35.5 -14.5t-14.5 -35.5v-800z" />
+<glyph unicode="&#xe074;" d="M200 150q0 -20 14.5 -35t35.5 -15h800q21 0 35.5 15t14.5 35v800q0 21 -14.5 35.5t-35.5 14.5h-800q-21 0 -35.5 -14.5t-14.5 -35.5v-800z" />
+<glyph unicode="&#xe075;" d="M0 0v1100l500 -487v487l564 -550l-564 -550v488z" />
+<glyph unicode="&#xe076;" d="M0 0v1100l500 -487v487l500 -487v437q0 21 14.5 35.5t35.5 14.5h100q21 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-500 -488v488z" />
+<glyph unicode="&#xe077;" d="M300 0v1100l500 -487v437q0 21 14.5 35.5t35.5 14.5h100q21 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.5v438z" />
+<glyph unicode="&#xe078;" d="M100 250v100q0 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-1000q-21 0 -35.5 14.5t-14.5 35.5zM100 500h1100l-550 564z" />
+<glyph unicode="&#xe079;" d="M185 599l592 -592l240 240l-353 353l353 353l-240 240z" />
+<glyph unicode="&#xe080;" d="M272 194l353 353l-353 353l241 240l572 -571l21 -22l-1 -1v-1l-592 -591z" />
+<glyph unicode="&#xe081;" d="M3 600q0 162 80 299.5t217.5 217.5t299.5 80t299.5 -80t217.5 -217.5t80 -299.5t-80 -300t-217.5 -218t-299.5 -80t-299.5 80t-217.5 218t-80 300zM300 500h200v-200h200v200h200v200h-200v200h-200v-200h-200v-200z" />
+<glyph unicode="&#xe082;" d="M3 600q0 162 80 299.5t217.5 217.5t299.5 80t299.5 -80t217.5 -217.5t80 -299.5t-80 -300t-217.5 -218t-299.5 -80t-299.5 80t-217.5 218t-80 300zM300 500h600v200h-600v-200z" />
+<glyph unicode="&#xe083;" d="M3 600q0 162 80 299.5t217.5 217.5t299.5 80t299.5 -80t217.5 -217.5t80 -299.5t-80 -300t-217.5 -218t-299.5 -80t-299.5 80t-217.5 218t-80 300zM246 459l213 -213l141 142l141 -142l213 213l-142 141l142 141l-213 212l-141 -141l-141 142l-212 -213l141 -141z" />
+<glyph unicode="&#xe084;" d="M3 600q0 162 80 299.5t217.5 217.5t299.5 80t299.5 -80t217.5 -217.5t80 -299.5t-80 -299.5t-217.5 -217.5t-299.5 -80t-299.5 80t-217.5 217.5t-80 299.5zM270 551l276 -277l411 411l-175 174l-236 -236l-102 102z" />
+<glyph unicode="&#xe085;" d="M3 600q0 162 80 299.5t217.5 217.5t299.5 80t299.5 -80t217.5 -217.5t80 -299.5t-80 -300t-217.5 -218t-299.5 -80t-299.5 80t-217.5 218t-80 300zM363 700h144q4 0 11.5 -1t11 -1t6.5 3t3 9t1 11t3.5 8.5t3.5 6t5.5 4t6.5 2.5t9 1.5t9 0.5h11.5h12.5q19 0 30 -10t11 -26 q0 -22 -4 -28t-27 -22q-5 -1 -12.5 -3t-27 -13.5t-34 -27t-26.5 -46t-11 -68.5h200q5 3 14 8t31.5 25.5t39.5 45.5t31 69t14 94q0 51 -17.5 89t-42 58t-58.5 32t-58.5 15t-51.5 3q-105 0 -172 -56t-67 -183zM500 300h200v100h-200v-100z" />
+<glyph unicode="&#xe086;" d="M3 600q0 162 80 299.5t217.5 217.5t299.5 80t299.5 -80t217.5 -217.5t80 -299.5t-80 -300t-217.5 -218t-299.5 -80t-299.5 80t-217.5 218t-80 300zM400 300h400v100h-100v300h-300v-100h100v-200h-100v-100zM500 800h200v100h-200v-100z" />
+<glyph unicode="&#xe087;" d="M0 500v200h194q15 60 36 104.5t55.5 86t88 69t126.5 40.5v200h200v-200q54 -20 113 -60t112.5 -105.5t71.5 -134.5h203v-200h-203q-25 -102 -116.5 -186t-180.5 -117v-197h-200v197q-140 27 -208 102.5t-98 200.5h-194zM290 500q24 -73 79.5 -127.5t130.5 -78.5v206h200 v-206q149 48 201 206h-201v200h200q-25 74 -76 127.5t-124 76.5v-204h-200v203q-75 -24 -130 -77.5t-79 -125.5h209v-200h-210z" />
+<glyph unicode="&#xe088;" d="M4 600q0 162 80 299t217 217t299 80t299 -80t217 -217t80 -299t-80 -299t-217 -217t-299 -80t-299 80t-217 217t-80 299zM186 600q0 -171 121.5 -292.5t292.5 -121.5t292.5 121.5t121.5 292.5t-121.5 292.5t-292.5 121.5t-292.5 -121.5t-121.5 -292.5zM356 465l135 135 l-135 135l109 109l135 -135l135 135l109 -109l-135 -135l135 -135l-109 -109l-135 135l-135 -135z" />
+<glyph unicode="&#xe089;" d="M4 600q0 162 80 299t217 217t299 80t299 -80t217 -217t80 -299t-80 -299t-217 -217t-299 -80t-299 80t-217 217t-80 299zM186 600q0 -171 121.5 -292.5t292.5 -121.5t292.5 121.5t121.5 292.5t-121.5 292.5t-292.5 121.5t-292.5 -121.5t-121.5 -292.5zM322 537l141 141 l87 -87l204 205l142 -142l-346 -345z" />
+<glyph unicode="&#xe090;" d="M4 600q0 162 80 299t217 217t299 80t299 -80t217 -217t80 -299t-80 -299t-217 -217t-299 -80t-299 80t-217 217t-80 299zM186 600q0 -115 62 -215l568 567q-100 62 -216 62q-171 0 -292.5 -121.5t-121.5 -292.5zM391 245q97 -59 209 -59q171 0 292.5 121.5t121.5 292.5 q0 112 -59 209z" />
+<glyph unicode="&#xe091;" d="M0 547l600 453v-300h600v-300h-600v-301z" />
+<glyph unicode="&#xe092;" d="M0 400v300h600v300l600 -453l-600 -448v301h-600z" />
+<glyph unicode="&#xe093;" d="M204 600l450 600l444 -600h-298v-600h-300v600h-296z" />
+<glyph unicode="&#xe094;" d="M104 600h296v600h300v-600h298l-449 -600z" />
+<glyph unicode="&#xe095;" d="M0 200q6 132 41 238.5t103.5 193t184 138t271.5 59.5v271l600 -453l-600 -448v301q-95 -2 -183 -20t-170 -52t-147 -92.5t-100 -135.5z" />
+<glyph unicode="&#xe096;" d="M0 0v400l129 -129l294 294l142 -142l-294 -294l129 -129h-400zM635 777l142 -142l294 294l129 -129v400h-400l129 -129z" />
+<glyph unicode="&#xe097;" d="M34 176l295 295l-129 129h400v-400l-129 130l-295 -295zM600 600v400l129 -129l295 295l142 -141l-295 -295l129 -130h-400z" />
+<glyph unicode="&#xe101;" d="M23 600q0 118 45.5 224.5t123 184t184 123t224.5 45.5t224.5 -45.5t184 -123t123 -184t45.5 -224.5t-45.5 -224.5t-123 -184t-184 -123t-224.5 -45.5t-224.5 45.5t-184 123t-123 184t-45.5 224.5zM456 851l58 -302q4 -20 21.5 -34.5t37.5 -14.5h54q20 0 37.5 14.5 t21.5 34.5l58 302q4 20 -8 34.5t-33 14.5h-207q-20 0 -32 -14.5t-8 -34.5zM500 300h200v100h-200v-100z" />
+<glyph unicode="&#xe102;" d="M0 800h100v-200h400v300h200v-300h400v200h100v100h-111v6t-1 15t-3 18l-34 172q-11 39 -41.5 63t-69.5 24q-32 0 -61 -17l-239 -144q-22 -13 -40 -35q-19 24 -40 36l-238 144q-33 18 -62 18q-39 0 -69.5 -23t-40.5 -61l-35 -177q-2 -8 -3 -18t-1 -15v-6h-111v-100z M100 0h400v400h-400v-400zM200 900q-3 0 14 48t35 96l18 47l214 -191h-281zM700 0v400h400v-400h-400zM731 900l202 197q5 -12 12 -32.5t23 -64t25 -72t7 -28.5h-269z" />
+<glyph unicode="&#xe103;" d="M0 -22v143l216 193q-9 53 -13 83t-5.5 94t9 113t38.5 114t74 124q47 60 99.5 102.5t103 68t127.5 48t145.5 37.5t184.5 43.5t220 58.5q0 -189 -22 -343t-59 -258t-89 -181.5t-108.5 -120t-122 -68t-125.5 -30t-121.5 -1.5t-107.5 12.5t-87.5 17t-56.5 7.5l-99 -55z M238.5 300.5q19.5 -6.5 86.5 76.5q55 66 367 234q70 38 118.5 69.5t102 79t99 111.5t86.5 148q22 50 24 60t-6 19q-7 5 -17 5t-26.5 -14.5t-33.5 -39.5q-35 -51 -113.5 -108.5t-139.5 -89.5l-61 -32q-369 -197 -458 -401q-48 -111 -28.5 -117.5z" />
+<glyph unicode="&#xe104;" d="M111 408q0 -33 5 -63q9 -56 44 -119.5t105 -108.5q31 -21 64 -16t62 23.5t57 49.5t48 61.5t35 60.5q32 66 39 184.5t-13 157.5q79 -80 122 -164t26 -184q-5 -33 -20.5 -69.5t-37.5 -80.5q-10 -19 -14.5 -29t-12 -26t-9 -23.5t-3 -19t2.5 -15.5t11 -9.5t19.5 -5t30.5 2.5 t42 8q57 20 91 34t87.5 44.5t87 64t65.5 88.5t47 122q38 172 -44.5 341.5t-246.5 278.5q22 -44 43 -129q39 -159 -32 -154q-15 2 -33 9q-79 33 -120.5 100t-44 175.5t48.5 257.5q-13 -8 -34 -23.5t-72.5 -66.5t-88.5 -105.5t-60 -138t-8 -166.5q2 -12 8 -41.5t8 -43t6 -39.5 t3.5 -39.5t-1 -33.5t-6 -31.5t-13.5 -24t-21 -20.5t-31 -12q-38 -10 -67 13t-40.5 61.5t-15 81.5t10.5 75q-52 -46 -83.5 -101t-39 -107t-7.5 -85z" />
+<glyph unicode="&#xe105;" d="M-61 600l26 40q6 10 20 30t49 63.5t74.5 85.5t97 90t116.5 83.5t132.5 59t145.5 23.5t145.5 -23.5t132.5 -59t116.5 -83.5t97 -90t74.5 -85.5t49 -63.5t20 -30l26 -40l-26 -40q-6 -10 -20 -30t-49 -63.5t-74.5 -85.5t-97 -90t-116.5 -83.5t-132.5 -59t-145.5 -23.5 t-145.5 23.5t-132.5 59t-116.5 83.5t-97 90t-74.5 85.5t-49 63.5t-20 30zM120 600q7 -10 40.5 -58t56 -78.5t68 -77.5t87.5 -75t103 -49.5t125 -21.5t123.5 20t100.5 45.5t85.5 71.5t66.5 75.5t58 81.5t47 66q-1 1 -28.5 37.5t-42 55t-43.5 53t-57.5 63.5t-58.5 54 q49 -74 49 -163q0 -124 -88 -212t-212 -88t-212 88t-88 212q0 85 46 158q-102 -87 -226 -258zM377 656q49 -124 154 -191l105 105q-37 24 -75 72t-57 84l-20 36z" />
+<glyph unicode="&#xe106;" d="M-61 600l26 40q6 10 20 30t49 63.5t74.5 85.5t97 90t116.5 83.5t132.5 59t145.5 23.5q61 0 121 -17l37 142h148l-314 -1200h-148l37 143q-82 21 -165 71.5t-140 102t-109.5 112t-72 88.5t-29.5 43zM120 600q210 -282 393 -336l37 141q-107 18 -178.5 101.5t-71.5 193.5 q0 85 46 158q-102 -87 -226 -258zM377 656q49 -124 154 -191l47 47l23 87q-30 28 -59 69t-44 68l-14 26zM780 161l38 145q22 15 44.5 34t46 44t40.5 44t41 50.5t33.5 43.5t33 44t24.5 34q-97 127 -140 175l39 146q67 -54 131.5 -125.5t87.5 -103.5t36 -52l26 -40l-26 -40 q-7 -12 -25.5 -38t-63.5 -79.5t-95.5 -102.5t-124 -100t-146.5 -79z" />
+<glyph unicode="&#xe107;" d="M-97.5 34q13.5 -34 50.5 -34h1294q37 0 50.5 35.5t-7.5 67.5l-642 1056q-20 33 -48 36t-48 -29l-642 -1066q-21 -32 -7.5 -66zM155 200l445 723l445 -723h-345v100h-200v-100h-345zM500 600l100 -300l100 300v100h-200v-100z" />
+<glyph unicode="&#xe108;" d="M100 262v41q0 20 11 44.5t26 38.5l363 325v339q0 62 44 106t106 44t106 -44t44 -106v-339l363 -325q15 -14 26 -38.5t11 -44.5v-41q0 -20 -12 -26.5t-29 5.5l-359 249v-263q100 -91 100 -113v-64q0 -21 -13 -29t-32 1l-94 78h-222l-94 -78q-19 -9 -32 -1t-13 29v64 q0 22 100 113v263l-359 -249q-17 -12 -29 -5.5t-12 26.5z" />
+<glyph unicode="&#xe109;" d="M0 50q0 -20 14.5 -35t35.5 -15h1000q21 0 35.5 15t14.5 35v750h-1100v-750zM0 900h1100v150q0 21 -14.5 35.5t-35.5 14.5h-150v100h-100v-100h-500v100h-100v-100h-150q-21 0 -35.5 -14.5t-14.5 -35.5v-150zM100 100v100h100v-100h-100zM100 300v100h100v-100h-100z M100 500v100h100v-100h-100zM300 100v100h100v-100h-100zM300 300v100h100v-100h-100zM300 500v100h100v-100h-100zM500 100v100h100v-100h-100zM500 300v100h100v-100h-100zM500 500v100h100v-100h-100zM700 100v100h100v-100h-100zM700 300v100h100v-100h-100zM700 500 v100h100v-100h-100zM900 100v100h100v-100h-100zM900 300v100h100v-100h-100zM900 500v100h100v-100h-100z" />
+<glyph unicode="&#xe110;" d="M0 200v200h259l600 600h241v198l300 -295l-300 -300v197h-159l-600 -600h-341zM0 800h259l122 -122l141 142l-181 180h-341v-200zM678 381l141 142l122 -123h159v198l300 -295l-300 -300v197h-241z" />
+<glyph unicode="&#xe111;" d="M0 400v600q0 41 29.5 70.5t70.5 29.5h1000q41 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.5z" />
+<glyph unicode="&#xe112;" d="M100 600v200h300v-250q0 -113 6 -145q17 -92 102 -117q39 -11 92 -11q37 0 66.5 5.5t50 15.5t36 24t24 31.5t14 37.5t7 42t2.5 45t0 47v25v250h300v-200q0 -42 -3 -83t-15 -104t-31.5 -116t-58 -109.5t-89 -96.5t-129 -65.5t-174.5 -25.5t-174.5 25.5t-129 65.5t-89 96.5 t-58 109.5t-31.5 116t-15 104t-3 83zM100 900v300h300v-300h-300zM800 900v300h300v-300h-300z" />
+<glyph unicode="&#xe113;" d="M-30 411l227 -227l352 353l353 -353l226 227l-578 579z" />
+<glyph unicode="&#xe114;" d="M70 797l580 -579l578 579l-226 227l-353 -353l-352 353z" />
+<glyph unicode="&#xe115;" d="M-198 700l299 283l300 -283h-203v-400h385l215 -200h-800v600h-196zM402 1000l215 -200h381v-400h-198l299 -283l299 283h-200v600h-796z" />
+<glyph unicode="&#xe116;" d="M18 939q-5 24 10 42q14 19 39 19h896l38 162q5 17 18.5 27.5t30.5 10.5h94q20 0 35 -14.5t15 -35.5t-15 -35.5t-35 -14.5h-54l-201 -961q-2 -4 -6 -10.5t-19 -17.5t-33 -11h-31v-50q0 -20 -14.5 -35t-35.5 -15t-35.5 15t-14.5 35v50h-300v-50q0 -20 -14.5 -35t-35.5 -15 t-35.5 15t-14.5 35v50h-50q-21 0 -35.5 15t-14.5 35q0 21 14.5 35.5t35.5 14.5h535l48 200h-633q-32 0 -54.5 21t-27.5 43z" />
+<glyph unicode="&#xe117;" d="M0 0v800h1200v-800h-1200zM0 900v100h200q0 41 29.5 70.5t70.5 29.5h300q41 0 70.5 -29.5t29.5 -70.5h500v-100h-1200z" />
+<glyph unicode="&#xe118;" d="M1 0l300 700h1200l-300 -700h-1200zM1 400v600h200q0 41 29.5 70.5t70.5 29.5h300q41 0 70.5 -29.5t29.5 -70.5h500v-200h-1000z" />
+<glyph unicode="&#xe119;" d="M302 300h198v600h-198l298 300l298 -300h-198v-600h198l-298 -300z" />
+<glyph unicode="&#xe120;" d="M0 600l300 298v-198h600v198l300 -298l-300 -297v197h-600v-197z" />
+<glyph unicode="&#xe121;" d="M0 100v100q0 41 29.5 70.5t70.5 29.5h1000q41 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.5zM31 400l172 739q5 22 23 41.5t38 19.5h672q19 0 37.5 -22.5t23.5 -45.5l172 -732h-1138zM800 100h100v100h-100v-100z M1000 100h100v100h-100v-100z" />
+<glyph unicode="&#xe122;" d="M-101 600v50q0 24 25 49t50 38l25 13v-250l-11 5.5t-24 14t-30 21.5t-24 27.5t-11 31.5zM99 500v250v5q0 13 0.5 18.5t2.5 13t8 10.5t15 3h200l675 250v-850l-675 200h-38l47 -276q2 -12 -3 -17.5t-11 -6t-21 -0.5h-8h-83q-20 0 -34.5 14t-18.5 35q-56 337 -56 351z M1100 200v850q0 21 14.5 35.5t35.5 14.5q20 0 35 -14.5t15 -35.5v-850q0 -20 -15 -35t-35 -15q-21 0 -35.5 15t-14.5 35z" />
+<glyph unicode="&#xe123;" d="M74 350q0 21 13.5 35.5t33.5 14.5h17l118 173l63 327q15 77 76 140t144 83l-18 32q-6 19 3 32t29 13h94q20 0 29 -10.5t3 -29.5l-18 -37q83 -19 144 -82.5t76 -140.5l63 -327l118 -173h17q20 0 33.5 -14.5t13.5 -35.5q0 -20 -13 -40t-31 -27q-22 -9 -63 -23t-167.5 -37 t-251.5 -23t-245.5 20.5t-178.5 41.5l-58 20q-18 7 -31 27.5t-13 40.5zM497 110q12 -49 40 -79.5t63 -30.5t63 30.5t39 79.5q-48 -6 -102 -6t-103 6z" />
+<glyph unicode="&#xe124;" d="M21 445l233 -45l-78 -224l224 78l45 -233l155 179l155 -179l45 233l224 -78l-78 224l234 45l-180 155l180 156l-234 44l78 225l-224 -78l-45 233l-155 -180l-155 180l-45 -233l-224 78l78 -225l-233 -44l179 -156z" />
+<glyph unicode="&#xe125;" d="M0 200h200v600h-200v-600zM300 275q0 -75 100 -75h61q123 -100 139 -100h250q46 0 83 57l238 344q29 31 29 74v100q0 44 -30.5 84.5t-69.5 40.5h-328q28 118 28 125v150q0 44 -30.5 84.5t-69.5 40.5h-50q-27 0 -51 -20t-38 -48l-96 -198l-145 -196q-20 -26 -20 -63v-400z M400 300v375l150 212l100 213h50v-175l-50 -225h450v-125l-250 -375h-214l-136 100h-100z" />
+<glyph unicode="&#xe126;" d="M0 400v600h200v-600h-200zM300 525v400q0 75 100 75h61q123 100 139 100h250q46 0 83 -57l238 -344q29 -31 29 -74v-100q0 -44 -30.5 -84.5t-69.5 -40.5h-328q28 -118 28 -125v-150q0 -44 -30.5 -84.5t-69.5 -40.5h-50q-27 0 -51 20t-38 48l-96 198l-145 196 q-20 26 -20 63zM400 525l150 -212l100 -213h50v175l-50 225h450v125l-250 375h-214l-136 -100h-100v-375z" />
+<glyph unicode="&#xe127;" d="M8 200v600h200v-600h-200zM308 275v525q0 17 14 35.5t28 28.5l14 9l362 230q14 6 25 6q17 0 29 -12l109 -112q14 -14 14 -34q0 -18 -11 -32l-85 -121h302q85 0 138.5 -38t53.5 -110t-54.5 -111t-138.5 -39h-107l-130 -339q-7 -22 -20.5 -41.5t-28.5 -19.5h-341 q-7 0 -90 81t-83 94zM408 289l100 -89h293l131 339q6 21 19.5 41t28.5 20h203q16 0 25 15t9 36q0 20 -9 34.5t-25 14.5h-457h-6.5h-7.5t-6.5 0.5t-6 1t-5 1.5t-5.5 2.5t-4 4t-4 5.5q-5 12 -5 20q0 14 10 27l147 183l-86 83l-339 -236v-503z" />
+<glyph unicode="&#xe128;" d="M-101 651q0 72 54 110t139 37h302l-85 121q-11 16 -11 32q0 21 14 34l109 113q13 12 29 12q11 0 25 -6l365 -230q7 -4 16.5 -10.5t26 -26t16.5 -36.5v-526q0 -13 -85.5 -93.5t-93.5 -80.5h-342q-15 0 -28.5 20t-19.5 41l-131 339h-106q-84 0 -139 39t-55 111zM-1 601h222 q15 0 28.5 -20.5t19.5 -40.5l131 -339h293l106 89v502l-342 237l-87 -83l145 -184q10 -11 10 -26q0 -11 -5 -20q-1 -3 -3.5 -5.5l-4 -4t-5 -2.5t-5.5 -1.5t-6.5 -1t-6.5 -0.5h-7.5h-6.5h-476v-100zM999 201v600h200v-600h-200z" />
+<glyph unicode="&#xe129;" d="M97 719l230 -363q4 -6 10.5 -15.5t26 -25t36.5 -15.5h525q13 0 94 83t81 90v342q0 15 -20 28.5t-41 19.5l-339 131v106q0 84 -39 139t-111 55t-110 -53.5t-38 -138.5v-302l-121 84q-15 12 -33.5 11.5t-32.5 -13.5l-112 -110q-22 -22 -6 -53zM172 739l83 86l183 -146 q22 -18 47 -5q3 1 5.5 3.5l4 4t2.5 5t1.5 5.5t1 6.5t0.5 6v7.5v7v456q0 22 25 31t50 -0.5t25 -30.5v-202q0 -16 20 -29.5t41 -19.5l339 -130v-294l-89 -100h-503zM400 0v200h600v-200h-600z" />
+<glyph unicode="&#xe130;" d="M1 585q-15 -31 7 -53l112 -110q13 -13 32 -13.5t34 10.5l121 85l-1 -302q0 -84 38.5 -138t110.5 -54t111 55t39 139v106l339 131q20 6 40.5 19.5t20.5 28.5v342q0 7 -81 90t-94 83h-525q-17 0 -35.5 -14t-28.5 -28l-10 -15zM76 565l237 339h503l89 -100v-294l-340 -130 q-20 -6 -40 -20t-20 -29v-202q0 -22 -25 -31t-50 0t-25 31v456v14.5t-1.5 11.5t-5 12t-9.5 7q-24 13 -46 -5l-184 -146zM305 1104v200h600v-200h-600z" />
+<glyph unicode="&#xe131;" d="M5 597q0 122 47.5 232.5t127.5 190.5t190.5 127.5t232.5 47.5q162 0 299.5 -80t217.5 -218t80 -300t-80 -299.5t-217.5 -217.5t-299.5 -80t-300 80t-218 217.5t-80 299.5zM300 500h300l-2 -194l402 294l-402 298v-197h-298v-201z" />
+<glyph unicode="&#xe132;" d="M0 597q0 122 47.5 232.5t127.5 190.5t190.5 127.5t231.5 47.5q122 0 232.5 -47.5t190.5 -127.5t127.5 -190.5t47.5 -232.5q0 -162 -80 -299.5t-218 -217.5t-300 -80t-299.5 80t-217.5 217.5t-80 299.5zM200 600l400 -294v194h302v201h-300v197z" />
+<glyph unicode="&#xe133;" d="M5 597q0 122 47.5 232.5t127.5 190.5t190.5 127.5t232.5 47.5q121 0 231.5 -47.5t190.5 -127.5t127.5 -190.5t47.5 -232.5q0 -162 -80 -299.5t-217.5 -217.5t-299.5 -80t-300 80t-218 217.5t-80 299.5zM300 600h200v-300h200v300h200l-300 400z" />
+<glyph unicode="&#xe134;" d="M5 597q0 122 47.5 232.5t127.5 190.5t190.5 127.5t232.5 47.5q121 0 231.5 -47.5t190.5 -127.5t127.5 -190.5t47.5 -232.5q0 -162 -80 -299.5t-217.5 -217.5t-299.5 -80t-300 80t-218 217.5t-80 299.5zM300 600l300 -400l300 400h-200v300h-200v-300h-200z" />
+<glyph unicode="&#xe135;" d="M5 597q0 122 47.5 232.5t127.5 190.5t190.5 127.5t232.5 47.5q121 0 231.5 -47.5t190.5 -127.5t127.5 -190.5t47.5 -232.5q0 -162 -80 -299.5t-217.5 -217.5t-299.5 -80t-300 80t-218 217.5t-80 299.5zM254 780q-8 -34 5.5 -93t7.5 -87q0 -9 17 -44t16 -60q12 0 23 -5.5 t23 -15t20 -13.5q20 -10 108 -42q22 -8 53 -31.5t59.5 -38.5t57.5 -11q8 -18 -15 -55.5t-20 -57.5q12 -21 22.5 -34.5t28 -27t36.5 -17.5q0 -6 -3 -15.5t-3.5 -14.5t4.5 -17q101 -2 221 111q31 30 47 48t34 49t21 62q-14 9 -37.5 9.5t-35.5 7.5q-14 7 -49 15t-52 19 q-9 0 -39.5 -0.5t-46.5 -1.5t-39 -6.5t-39 -16.5q-50 -35 -66 -12q-4 2 -3.5 25.5t0.5 25.5q-6 13 -26.5 17t-24.5 7q2 22 -2 41t-16.5 28t-38.5 -20q-23 -25 -42 4q-19 28 -8 58q8 16 22 22q6 -1 26 -1.5t33.5 -4.5t19.5 -13q12 -19 32 -37.5t34 -27.5l14 -8q0 3 9.5 39.5 t5.5 57.5q-4 23 14.5 44.5t22.5 31.5q5 14 10 35t8.5 31t15.5 22.5t34 21.5q-6 18 10 37q8 0 23.5 -1.5t24.5 -1.5t20.5 4.5t20.5 15.5q-10 23 -30.5 42.5t-38 30t-49 26.5t-43.5 23q11 41 1 44q31 -13 58.5 -14.5t39.5 3.5l11 4q6 36 -17 53.5t-64 28.5t-56 23 q-19 -3 -37 0q-15 -12 -36.5 -21t-34.5 -12t-44 -8t-39 -6q-15 -3 -46 0t-45 -3q-20 -6 -51.5 -25.5t-34.5 -34.5q-3 -11 6.5 -22.5t8.5 -18.5q-3 -34 -27.5 -91t-29.5 -79zM518 915q3 12 16 30.5t16 25.5q10 -10 18.5 -10t14 6t14.5 14.5t16 12.5q0 -18 8 -42.5t16.5 -44 t9.5 -23.5q-6 1 -39 5t-53.5 10t-36.5 16z" />
+<glyph unicode="&#xe136;" d="M0 164.5q0 21.5 15 37.5l600 599q-33 101 6 201.5t135 154.5q164 92 306 -9l-259 -138l145 -232l251 126q13 -175 -151 -267q-123 -70 -253 -23l-596 -596q-15 -16 -36.5 -16t-36.5 16l-111 110q-15 15 -15 36.5z" />
+<glyph unicode="&#xe137;" horiz-adv-x="1220" d="M0 196v100q0 41 29.5 70.5t70.5 29.5h1000q41 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.5zM0 596v100q0 41 29.5 70.5t70.5 29.5h1000q41 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.5zM0 996v100q0 41 29.5 70.5t70.5 29.5h1000q41 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.5zM600 596h500v100h-500v-100zM800 196h300v100h-300v-100zM900 996h200v100h-200v-100z" />
+<glyph unicode="&#xe138;" d="M100 1100v100h1000v-100h-1000zM150 1000h900l-350 -500v-300l-200 -200v500z" />
+<glyph unicode="&#xe139;" d="M0 200v200h1200v-200q0 -41 -29.5 -70.5t-70.5 -29.5h-1000q-41 0 -70.5 29.5t-29.5 70.5zM0 500v400q0 41 29.5 70.5t70.5 29.5h300v100q0 41 29.5 70.5t70.5 29.5h200q41 0 70.5 -29.5t29.5 -70.5v-100h300q41 0 70.5 -29.5t29.5 -70.5v-400h-500v100h-200v-100h-500z M500 1000h200v100h-200v-100z" />
+<glyph unicode="&#xe140;" d="M0 0v400l129 -129l200 200l142 -142l-200 -200l129 -129h-400zM0 800l129 129l200 -200l142 142l-200 200l129 129h-400v-400zM729 329l142 142l200 -200l129 129v-400h-400l129 129zM729 871l200 200l-129 129h400v-400l-129 129l-200 -200z" />
+<glyph unicode="&#xe141;" d="M0 596q0 162 80 299t217 217t299 80t299 -80t217 -217t80 -299t-80 -299t-217 -217t-299 -80t-299 80t-217 217t-80 299zM182 596q0 -172 121.5 -293t292.5 -121t292.5 121t121.5 293q0 171 -121.5 292.5t-292.5 121.5t-292.5 -121.5t-121.5 -292.5zM291 655 q0 23 15.5 38.5t38.5 15.5t39 -16t16 -38q0 -23 -16 -39t-39 -16q-22 0 -38 16t-16 39zM400 850q0 22 16 38.5t39 16.5q22 0 38 -16t16 -39t-16 -39t-38 -16q-23 0 -39 16.5t-16 38.5zM513 609q0 32 21 56.5t52 29.5l122 126l1 1q-9 14 -9 28q0 22 16 38.5t39 16.5 q22 0 38 -16t16 -39t-16 -39t-38 -16q-16 0 -29 10l-55 -145q17 -22 17 -51q0 -36 -25.5 -61.5t-61.5 -25.5q-37 0 -62.5 25.5t-25.5 61.5zM800 655q0 22 16 38t39 16t38.5 -15.5t15.5 -38.5t-16 -39t-38 -16q-23 0 -39 16t-16 39z" />
+<glyph unicode="&#xe142;" d="M-40 375q-13 -95 35 -173q35 -57 94 -89t129 -32q63 0 119 28q33 16 65 40.5t52.5 45.5t59.5 64q40 44 57 61l394 394q35 35 47 84t-3 96q-27 87 -117 104q-20 2 -29 2q-46 0 -79.5 -17t-67.5 -51l-388 -396l-7 -7l69 -67l377 373q20 22 39 38q23 23 50 23q38 0 53 -36 q16 -39 -20 -75l-547 -547q-52 -52 -125 -52q-55 0 -100 33t-54 96q-5 35 2.5 66t31.5 63t42 50t56 54q24 21 44 41l348 348q52 52 82.5 79.5t84 54t107.5 26.5q25 0 48 -4q95 -17 154 -94.5t51 -175.5q-7 -101 -98 -192l-252 -249l-253 -256l7 -7l69 -60l517 511 q67 67 95 157t11 183q-16 87 -67 154t-130 103q-69 33 -152 33q-107 0 -197 -55q-40 -24 -111 -95l-512 -512q-68 -68 -81 -163z" />
+<glyph unicode="&#xe143;" d="M79 784q0 131 99 229.5t230 98.5q144 0 242 -129q103 129 245 129q130 0 227 -98.5t97 -229.5q0 -46 -17.5 -91t-61 -99t-77 -89.5t-104.5 -105.5q-197 -191 -293 -322l-17 -23l-16 23q-43 58 -100 122.5t-92 99.5t-101 100l-84.5 84.5t-68 74t-60 78t-33.5 70.5t-15 78z M250 784q0 -27 30.5 -70t61.5 -75.5t95 -94.5l22 -22q93 -90 190 -201q82 92 195 203l12 12q64 62 97.5 97t64.5 79t31 72q0 71 -48 119.5t-106 48.5q-73 0 -131 -83l-118 -171l-114 174q-51 80 -124 80q-59 0 -108.5 -49.5t-49.5 -118.5z" />
+<glyph unicode="&#xe144;" d="M57 353q0 -94 66 -160l141 -141q66 -66 159 -66q95 0 159 66l283 283q66 66 66 159t-66 159l-141 141q-12 12 -19 17l-105 -105l212 -212l-389 -389l-247 248l95 95l-18 18q-46 45 -75 101l-55 -55q-66 -66 -66 -159zM269 706q0 -93 66 -159l141 -141l19 -17l105 105 l-212 212l389 389l247 -247l-95 -96l18 -18q46 -46 77 -99l29 29q35 35 62.5 88t27.5 96q0 93 -66 159l-141 141q-66 66 -159 66q-95 0 -159 -66l-283 -283q-66 -64 -66 -159z" />
+<glyph unicode="&#xe145;" d="M200 100v953q0 21 30 46t81 48t129 38t163 15t162 -15t127 -38t79 -48t29 -46v-953q0 -41 -29.5 -70.5t-70.5 -29.5h-600q-41 0 -70.5 29.5t-29.5 70.5zM300 300h600v700h-600v-700zM496 150q0 -43 30.5 -73.5t73.5 -30.5t73.5 30.5t30.5 73.5t-30.5 73.5t-73.5 30.5 t-73.5 -30.5t-30.5 -73.5z" />
+<glyph unicode="&#xe146;" d="M0 0l303 380l207 208l-210 212h300l267 279l-35 36q-15 14 -15 35t15 35q14 15 35 15t35 -15l283 -282q15 -15 15 -36t-15 -35q-14 -15 -35 -15t-35 15l-36 35l-279 -267v-300l-212 210l-208 -207z" />
+<glyph unicode="&#xe148;" d="M295 433h139q5 -77 48.5 -126.5t117.5 -64.5v335l-27 7q-46 14 -79 26.5t-72 36t-62.5 52t-40 72.5t-16.5 99q0 92 44 159.5t109 101t144 40.5v78h100v-79q38 -4 72.5 -13.5t75.5 -31.5t71 -53.5t51.5 -84t24.5 -118.5h-159q-8 72 -35 109.5t-101 50.5v-307l64 -14 q34 -7 64 -16.5t70 -31.5t67.5 -52t47.5 -80.5t20 -112.5q0 -139 -89 -224t-244 -96v-77h-100v78q-152 17 -237 104q-40 40 -52.5 93.5t-15.5 139.5zM466 889q0 -29 8 -51t16.5 -34t29.5 -22.5t31 -13.5t38 -10q7 -2 11 -3v274q-61 -8 -97.5 -37.5t-36.5 -102.5zM700 237 q170 18 170 151q0 64 -44 99.5t-126 60.5v-311z" />
+<glyph unicode="&#xe149;" d="M100 600v100h166q-24 49 -44 104q-10 26 -14.5 55.5t-3 72.5t25 90t68.5 87q97 88 263 88q129 0 230 -89t101 -208h-153q0 52 -34 89.5t-74 51.5t-76 14q-37 0 -79 -14.5t-62 -35.5q-41 -44 -41 -101q0 -11 2.5 -24.5t5.5 -24t9.5 -26.5t10.5 -25t14 -27.5t14 -25.5 t15.5 -27t13.5 -24h242v-100h-197q8 -50 -2.5 -115t-31.5 -94q-41 -59 -99 -113q35 11 84 18t70 7q32 1 102 -16t104 -17q76 0 136 30l50 -147q-41 -25 -80.5 -36.5t-59 -13t-61.5 -1.5q-23 0 -128 33t-155 29q-39 -4 -82 -17t-66 -25l-24 -11l-55 145l16.5 11t15.5 10 t13.5 9.5t14.5 12t14.5 14t17.5 18.5q48 55 54 126.5t-30 142.5h-221z" />
+<glyph unicode="&#xe150;" d="M2 300l298 -300l298 300h-198v900h-200v-900h-198zM602 900l298 300l298 -300h-198v-900h-200v900h-198z" />
+<glyph unicode="&#xe151;" d="M2 300h198v900h200v-900h198l-298 -300zM700 0v200h100v-100h200v-100h-300zM700 400v100h300v-200h-99v-100h-100v100h99v100h-200zM700 700v500h300v-500h-100v100h-100v-100h-100zM801 900h100v200h-100v-200z" />
+<glyph unicode="&#xe152;" d="M2 300h198v900h200v-900h198l-298 -300zM700 0v500h300v-500h-100v100h-100v-100h-100zM700 700v200h100v-100h200v-100h-300zM700 1100v100h300v-200h-99v-100h-100v100h99v100h-200zM801 200h100v200h-100v-200z" />
+<glyph unicode="&#xe153;" d="M2 300l298 -300l298 300h-198v900h-200v-900h-198zM800 100v400h300v-500h-100v100h-200zM800 1100v100h200v-500h-100v400h-100zM901 200h100v200h-100v-200z" />
+<glyph unicode="&#xe154;" d="M2 300l298 -300l298 300h-198v900h-200v-900h-198zM800 400v100h200v-500h-100v400h-100zM800 800v400h300v-500h-100v100h-200zM901 900h100v200h-100v-200z" />
+<glyph unicode="&#xe155;" d="M2 300l298 -300l298 300h-198v900h-200v-900h-198zM700 100v200h500v-200h-500zM700 400v200h400v-200h-400zM700 700v200h300v-200h-300zM700 1000v200h200v-200h-200z" />
+<glyph unicode="&#xe156;" d="M2 300l298 -300l298 300h-198v900h-200v-900h-198zM700 100v200h200v-200h-200zM700 400v200h300v-200h-300zM700 700v200h400v-200h-400zM700 1000v200h500v-200h-500z" />
+<glyph unicode="&#xe157;" d="M0 400v300q0 165 117.5 282.5t282.5 117.5h300q162 0 281 -118.5t119 -281.5v-300q0 -165 -118.5 -282.5t-281.5 -117.5h-300q-165 0 -282.5 117.5t-117.5 282.5zM200 300q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5v500q0 41 -29.5 70.5t-70.5 29.5 h-500q-41 0 -70.5 -29.5t-29.5 -70.5v-500z" />
+<glyph unicode="&#xe158;" d="M0 400v300q0 163 119 281.5t281 118.5h300q165 0 282.5 -117.5t117.5 -282.5v-300q0 -165 -117.5 -282.5t-282.5 -117.5h-300q-163 0 -281.5 117.5t-118.5 282.5zM200 300q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5v500q0 41 -29.5 70.5t-70.5 29.5 h-500q-41 0 -70.5 -29.5t-29.5 -70.5v-500zM400 300l333 250l-333 250v-500z" />
+<glyph unicode="&#xe159;" d="M0 400v300q0 163 117.5 281.5t282.5 118.5h300q163 0 281.5 -119t118.5 -281v-300q0 -165 -117.5 -282.5t-282.5 -117.5h-300q-165 0 -282.5 117.5t-117.5 282.5zM200 300q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5v500q0 41 -29.5 70.5t-70.5 29.5 h-500q-41 0 -70.5 -29.5t-29.5 -70.5v-500zM300 700l250 -333l250 333h-500z" />
+<glyph unicode="&#xe160;" d="M0 400v300q0 165 117.5 282.5t282.5 117.5h300q165 0 282.5 -117.5t117.5 -282.5v-300q0 -162 -118.5 -281t-281.5 -119h-300q-165 0 -282.5 118.5t-117.5 281.5zM200 300q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5v500q0 41 -29.5 70.5t-70.5 29.5 h-500q-41 0 -70.5 -29.5t-29.5 -70.5v-500zM300 400h500l-250 333z" />
+<glyph unicode="&#xe161;" d="M0 400v300h300v200l400 -350l-400 -350v200h-300zM500 0v200h500q41 0 70.5 29.5t29.5 70.5v500q0 41 -29.5 70.5t-70.5 29.5h-500v200h400q165 0 282.5 -117.5t117.5 -282.5v-300q0 -165 -117.5 -282.5t-282.5 -117.5h-400z" />
+<glyph unicode="&#xe162;" d="M216 519q10 -19 32 -19h302q-155 -438 -160 -458q-5 -21 4 -32l9 -8l9 -1q13 0 26 16l538 630q15 19 6 36q-8 18 -32 16h-300q1 4 78 219.5t79 227.5q2 17 -6 27l-8 8h-9q-16 0 -25 -15q-4 -5 -98.5 -111.5t-228 -257t-209.5 -238.5q-17 -19 -7 -40z" />
+<glyph unicode="&#xe163;" d="M0 400q0 -165 117.5 -282.5t282.5 -117.5h300q47 0 100 15v185h-500q-41 0 -70.5 29.5t-29.5 70.5v500q0 41 29.5 70.5t70.5 29.5h500v185q-14 4 -114 7.5t-193 5.5l-93 2q-165 0 -282.5 -117.5t-117.5 -282.5v-300zM600 400v300h300v200l400 -350l-400 -350v200h-300z " />
+<glyph unicode="&#xe164;" d="M0 400q0 -165 117.5 -282.5t282.5 -117.5h300q163 0 281.5 117.5t118.5 282.5v98l-78 73l-122 -123v-148q0 -41 -29.5 -70.5t-70.5 -29.5h-500q-41 0 -70.5 29.5t-29.5 70.5v500q0 41 29.5 70.5t70.5 29.5h156l118 122l-74 78h-100q-165 0 -282.5 -117.5t-117.5 -282.5 v-300zM496 709l353 342l-149 149h500v-500l-149 149l-342 -353z" />
+<glyph unicode="&#xe165;" d="M4 600q0 162 80 299t217 217t299 80t299 -80t217 -217t80 -299t-80 -299t-217 -217t-299 -80t-299 80t-217 217t-80 299zM186 600q0 -171 121.5 -292.5t292.5 -121.5t292.5 121.5t121.5 292.5t-121.5 292.5t-292.5 121.5t-292.5 -121.5t-121.5 -292.5zM406 600 q0 80 57 137t137 57t137 -57t57 -137t-57 -137t-137 -57t-137 57t-57 137z" />
+<glyph unicode="&#xe166;" d="M0 0v275q0 11 7 18t18 7h1048q11 0 19 -7.5t8 -17.5v-275h-1100zM100 800l445 -500l450 500h-295v400h-300v-400h-300zM900 150h100v50h-100v-50z" />
+<glyph unicode="&#xe167;" d="M0 0v275q0 11 7 18t18 7h1048q11 0 19 -7.5t8 -17.5v-275h-1100zM100 700h300v-300h300v300h295l-445 500zM900 150h100v50h-100v-50z" />
+<glyph unicode="&#xe168;" d="M0 0v275q0 11 7 18t18 7h1048q11 0 19 -7.5t8 -17.5v-275h-1100zM100 705l305 -305l596 596l-154 155l-442 -442l-150 151zM900 150h100v50h-100v-50z" />
+<glyph unicode="&#xe169;" d="M0 0v275q0 11 7 18t18 7h1048q11 0 19 -7.5t8 -17.5v-275h-1100zM100 988l97 -98l212 213l-97 97zM200 401h700v699l-250 -239l-149 149l-212 -212l149 -149zM900 150h100v50h-100v-50z" />
+<glyph unicode="&#xe170;" d="M0 0v275q0 11 7 18t18 7h1048q11 0 19 -7.5t8 -17.5v-275h-1100zM200 612l212 -212l98 97l-213 212zM300 1200l239 -250l-149 -149l212 -212l149 148l248 -237v700h-699zM900 150h100v50h-100v-50z" />
+<glyph unicode="&#xe171;" d="M23 415l1177 784v-1079l-475 272l-310 -393v416h-392zM494 210l672 938l-672 -712v-226z" />
+<glyph unicode="&#xe172;" d="M0 150v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100l200 -200v-850q0 -21 -15 -35.5t-35 -14.5h-150v400h-700v-400h-150q-21 0 -35.5 14.5t-14.5 35.5zM600 1000h100v200h-100v-200z" />
+<glyph unicode="&#xe173;" d="M0 150v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100l200 -200v-218l-276 -275l-120 120l-126 -127h-378v-400h-150q-21 0 -35.5 14.5t-14.5 35.5zM581 306l123 123l120 -120l353 352l123 -123l-475 -476zM600 1000h100v200h-100v-200z" />
+<glyph unicode="&#xe174;" d="M0 150v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100l200 -200v-269l-103 -103l-170 170l-298 -298h-329v-400h-150q-21 0 -35.5 14.5t-14.5 35.5zM600 1000h100v200h-100v-200zM700 133l170 170l-170 170l127 127l170 -170l170 170l127 -128l-170 -169l170 -170 l-127 -127l-170 170l-170 -170z" />
+<glyph unicode="&#xe175;" d="M0 150v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100l200 -200v-300h-400v-200h-500v-400h-150q-21 0 -35.5 14.5t-14.5 35.5zM600 300l300 -300l300 300h-200v300h-200v-300h-200zM600 1000v200h100v-200h-100z" />
+<glyph unicode="&#xe176;" d="M0 150v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100l200 -200v-402l-200 200l-298 -298h-402v-400h-150q-21 0 -35.5 14.5t-14.5 35.5zM600 300h200v-300h200v300h200l-300 300zM600 1000v200h100v-200h-100z" />
+<glyph unicode="&#xe177;" d="M0 250q0 -21 14.5 -35.5t35.5 -14.5h1100q21 0 35.5 14.5t14.5 35.5v550h-1200v-550zM0 900h1200v150q0 21 -14.5 35.5t-35.5 14.5h-1100q-21 0 -35.5 -14.5t-14.5 -35.5v-150zM100 300v200h400v-200h-400z" />
+<glyph unicode="&#xe178;" d="M0 400l300 298v-198h400v-200h-400v-198zM100 800v200h100v-200h-100zM300 800v200h100v-200h-100zM500 800v200h400v198l300 -298l-300 -298v198h-400zM800 300v200h100v-200h-100zM1000 300h100v200h-100v-200z" />
+<glyph unicode="&#xe179;" d="M100 700v400l50 100l50 -100v-300h100v300l50 100l50 -100v-300h100v300l50 100l50 -100v-400l-100 -203v-447q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v447zM800 597q0 -29 10.5 -55.5t25 -43t29 -28.5t25.5 -18l10 -5v-397q0 -21 14.5 -35.5 t35.5 -14.5h200q21 0 35.5 14.5t14.5 35.5v1106q0 31 -18 40.5t-44 -7.5l-276 -117q-25 -16 -43.5 -50.5t-18.5 -65.5v-359z" />
+<glyph unicode="&#xe180;" d="M100 0h400v56q-75 0 -87.5 6t-12.5 44v394h500v-394q0 -38 -12.5 -44t-87.5 -6v-56h400v56q-4 0 -11 0.5t-24 3t-30 7t-24 15t-11 24.5v888q0 22 25 34.5t50 13.5l25 2v56h-400v-56q75 0 87.5 -6t12.5 -44v-394h-500v394q0 38 12.5 44t87.5 6v56h-400v-56q4 0 11 -0.5 t24 -3t30 -7t24 -15t11 -24.5v-888q0 -22 -25 -34.5t-50 -13.5l-25 -2v-56z" />
+<glyph unicode="&#xe181;" d="M0 300q0 -41 29.5 -70.5t70.5 -29.5h300q41 0 70.5 29.5t29.5 70.5v500q0 41 -29.5 70.5t-70.5 29.5h-300q-41 0 -70.5 -29.5t-29.5 -70.5v-500zM100 100h400l200 200h105l295 98v-298h-425l-100 -100h-375zM100 300v200h300v-200h-300zM100 600v200h300v-200h-300z M100 1000h400l200 -200v-98l295 98h105v200h-425l-100 100h-375zM700 402v163l400 133v-163z" />
+<glyph unicode="&#xe182;" d="M16.5 974.5q0.5 -21.5 16 -90t46.5 -140t104 -177.5t175 -208q103 -103 207.5 -176t180 -103.5t137 -47t92.5 -16.5l31 1l163 162q16 17 13 40.5t-22 37.5l-192 136q-19 14 -45 12t-42 -19l-119 -118q-143 103 -267 227q-126 126 -227 268l118 118q17 17 20 41.5 t-11 44.5l-139 194q-14 19 -36.5 22t-40.5 -14l-162 -162q-1 -11 -0.5 -32.5z" />
+<glyph unicode="&#xe183;" d="M0 50v212q0 20 10.5 45.5t24.5 39.5l365 303v50q0 4 1 10.5t12 22.5t30 28.5t60 23t97 10.5t97 -10t60 -23.5t30 -27.5t12 -24l1 -10v-50l365 -303q14 -14 24.5 -39.5t10.5 -45.5v-212q0 -21 -15 -35.5t-35 -14.5h-1100q-21 0 -35.5 14.5t-14.5 35.5zM0 712 q0 -21 14.5 -33.5t34.5 -8.5l202 33q20 4 34.5 21t14.5 38v146q141 24 300 24t300 -24v-146q0 -21 14.5 -38t34.5 -21l202 -33q20 -4 34.5 8.5t14.5 33.5v200q-6 8 -19 20.5t-63 45t-112 57t-171 45t-235 20.5q-92 0 -175 -10.5t-141.5 -27t-108.5 -36.5t-81.5 -40 t-53.5 -36.5t-31 -27.5l-9 -10v-200z" />
+<glyph unicode="&#xe184;" d="M100 0v100h1100v-100h-1100zM175 200h950l-125 150v250l100 100v400h-100v-200h-100v200h-200v-200h-100v200h-200v-200h-100v200h-100v-400l100 -100v-250z" />
+<glyph unicode="&#xe185;" d="M100 0h300v400q0 41 -29.5 70.5t-70.5 29.5h-100q-41 0 -70.5 -29.5t-29.5 -70.5v-400zM500 0v1000q0 41 29.5 70.5t70.5 29.5h100q41 0 70.5 -29.5t29.5 -70.5v-1000h-300zM900 0v700q0 41 29.5 70.5t70.5 29.5h100q41 0 70.5 -29.5t29.5 -70.5v-700h-300z" />
+<glyph unicode="&#xe186;" d="M-100 300v500q0 124 88 212t212 88h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212zM100 200h900v700h-900v-700zM200 300h300v300h-200v100h200v100h-300v-300h200v-100h-200v-100zM600 300h200v100h100v300h-100v100h-200v-500 zM700 400v300h100v-300h-100z" />
+<glyph unicode="&#xe187;" d="M-100 300v500q0 124 88 212t212 88h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212zM100 200h900v700h-900v-700zM200 300h100v200h100v-200h100v500h-100v-200h-100v200h-100v-500zM600 300h200v100h100v300h-100v100h-200v-500 zM700 400v300h100v-300h-100z" />
+<glyph unicode="&#xe188;" d="M-100 300v500q0 124 88 212t212 88h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212zM100 200h900v700h-900v-700zM200 300h300v100h-200v300h200v100h-300v-500zM600 300h300v100h-200v300h200v100h-300v-500z" />
+<glyph unicode="&#xe189;" d="M-100 300v500q0 124 88 212t212 88h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212zM100 200h900v700h-900v-700zM200 550l300 -150v300zM600 400l300 150l-300 150v-300z" />
+<glyph unicode="&#xe190;" d="M-100 300v500q0 124 88 212t212 88h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212zM100 200h900v700h-900v-700zM200 300v500h700v-500h-700zM300 400h130q41 0 68 42t27 107t-28.5 108t-66.5 43h-130v-300zM575 549 q0 -65 27 -107t68 -42h130v300h-130q-38 0 -66.5 -43t-28.5 -108z" />
+<glyph unicode="&#xe191;" d="M-100 300v500q0 124 88 212t212 88h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212zM100 200h900v700h-900v-700zM200 300h300v300h-200v100h200v100h-300v-300h200v-100h-200v-100zM601 300h100v100h-100v-100zM700 700h100 v-400h100v500h-200v-100z" />
+<glyph unicode="&#xe192;" d="M-100 300v500q0 124 88 212t212 88h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212zM100 200h900v700h-900v-700zM200 300h300v400h-200v100h-100v-500zM301 400v200h100v-200h-100zM601 300h100v100h-100v-100zM700 700h100 v-400h100v500h-200v-100z" />
+<glyph unicode="&#xe193;" d="M-100 300v500q0 124 88 212t212 88h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212zM100 200h900v700h-900v-700zM200 700v100h300v-300h-99v-100h-100v100h99v200h-200zM201 300v100h100v-100h-100zM601 300v100h100v-100h-100z M700 700v100h200v-500h-100v400h-100z" />
+<glyph unicode="&#xe194;" d="M4 600q0 162 80 299t217 217t299 80t299 -80t217 -217t80 -299t-80 -299t-217 -217t-299 -80t-299 80t-217 217t-80 299zM186 600q0 -171 121.5 -292.5t292.5 -121.5t292.5 121.5t121.5 292.5t-121.5 292.5t-292.5 121.5t-292.5 -121.5t-121.5 -292.5zM400 500v200 l100 100h300v-100h-300v-200h300v-100h-300z" />
+<glyph unicode="&#xe195;" d="M0 600q0 162 80 299t217 217t299 80t299 -80t217 -217t80 -299t-80 -299t-217 -217t-299 -80t-299 80t-217 217t-80 299zM182 600q0 -171 121.5 -292.5t292.5 -121.5t292.5 121.5t121.5 292.5t-121.5 292.5t-292.5 121.5t-292.5 -121.5t-121.5 -292.5zM400 400v400h300 l100 -100v-100h-100v100h-200v-100h200v-100h-200v-100h-100zM700 400v100h100v-100h-100z" />
+<glyph unicode="&#xe197;" d="M-14 494q0 -80 56.5 -137t135.5 -57h222v300h400v-300h128q120 0 205 86t85 208q0 120 -85 206.5t-205 86.5q-46 0 -90 -14q-44 97 -134.5 156.5t-200.5 59.5q-152 0 -260 -107.5t-108 -260.5q0 -25 2 -37q-66 -14 -108.5 -67.5t-42.5 -122.5zM300 200h200v300h200v-300 h200l-300 -300z" />
+<glyph unicode="&#xe198;" d="M-14 494q0 -80 56.5 -137t135.5 -57h8l414 414l403 -403q94 26 154.5 104t60.5 178q0 121 -85 207.5t-205 86.5q-46 0 -90 -14q-44 97 -134.5 156.5t-200.5 59.5q-152 0 -260 -107.5t-108 -260.5q0 -25 2 -37q-66 -14 -108.5 -67.5t-42.5 -122.5zM300 200l300 300 l300 -300h-200v-300h-200v300h-200z" />
+<glyph unicode="&#xe199;" d="M100 200h400v-155l-75 -45h350l-75 45v155h400l-270 300h170l-270 300h170l-300 333l-300 -333h170l-270 -300h170z" />
+<glyph unicode="&#xe200;" d="M121 700q0 -53 28.5 -97t75.5 -65q-4 -16 -4 -38q0 -74 52.5 -126.5t126.5 -52.5q56 0 100 30v-306l-75 -45h350l-75 45v306q46 -30 100 -30q74 0 126.5 52.5t52.5 126.5q0 24 -9 55q50 32 79.5 83t29.5 112q0 90 -61.5 155.5t-150.5 71.5q-26 89 -99.5 145.5 t-167.5 56.5q-116 0 -197.5 -81.5t-81.5 -197.5q0 -4 1 -12t1 -11q-14 2 -23 2q-74 0 -126.5 -52.5t-52.5 -126.5z" />
+</font>
+</defs></svg> \ No newline at end of file
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.ttf b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.ttf
new file mode 100644
index 000000000..a498ef4e7
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.ttf
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.woff b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.woff
new file mode 100644
index 000000000..d83c539b8
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.woff
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/html/layer_deps_modal.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/html/layer_deps_modal.html
new file mode 100644
index 000000000..e1dba4358
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/html/layer_deps_modal.html
@@ -0,0 +1,17 @@
+<div id="dependencies-modal" class="modal hide fade" tabindex="-1" role="dialog" aria-hidden="false">
+ <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="unstyled" id="dependencies-list">
+ </ul>
+ </div>
+ <div class="modal-footer">
+ <button class="btn btn-primary" type="submit">Add layers</button>
+ <button class="btn" type="reset" data-dismiss="modal">Cancel</button>
+ </div>
+ </form>
+</div>
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/img/glyphicons-halflings-white.png b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/img/glyphicons-halflings-white.png
new file mode 100644
index 000000000..3bf6484a2
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/img/glyphicons-halflings-white.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/img/glyphicons-halflings.png b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/img/glyphicons-halflings.png
new file mode 100644
index 000000000..a99699932
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/img/glyphicons-halflings.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/img/logo.png b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/img/logo.png
new file mode 100644
index 000000000..35ad733ed
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/img/logo.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/img/toaster_bw.png b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/img/toaster_bw.png
new file mode 100644
index 000000000..b46590793
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/img/toaster_bw.png
Binary files differ
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/jquery-treetable-license/GPL-LICENSE.txt b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/jquery-treetable-license/GPL-LICENSE.txt
new file mode 100644
index 000000000..76927f581
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/jquery-treetable-license/MIT-LICENSE.txt b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/jquery-treetable-license/MIT-LICENSE.txt
new file mode 100644
index 000000000..c2e824fb0
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/jquery-treetable-license/README.md b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/jquery-treetable-license/README.md
new file mode 100644
index 000000000..ece7afb58
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/jquery.treetable.theme.toaster.css b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/jquery.treetable.theme.toaster.css
new file mode 100644
index 000000000..5194b234d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/.jshintrc b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/.jshintrc
new file mode 100644
index 000000000..b02f3efa1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/bootstrap.min.js b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/bootstrap.min.js
new file mode 100644
index 000000000..848258d38
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/bootstrap.min.js
@@ -0,0 +1,6 @@
+/*!
+* Bootstrap.js by @fat & @mdo
+* Copyright 2013 Twitter, Inc.
+* http://www.apache.org/licenses/LICENSE-2.0.txt
+*/
+!function(e){"use strict";e(function(){e.support.transition=function(){var e=function(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(e.style[n]!==undefined)return t[n]}();return e&&{end:e}}()})}(window.jQuery),!function(e){"use strict";var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed").remove()}var n=e(this),r=n.attr("data-target"),i;r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=e(r),t&&t.preventDefault(),i.length||(i=n.hasClass("alert")?n:n.parent()),i.trigger(t=e.Event("close"));if(t.isDefaultPrevented())return;i.removeClass("in"),e.support.transition&&i.hasClass("fade")?i.on(e.support.transition.end,s):s()};var r=e.fn.alert;e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("alert");i||r.data("alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=r,this},e(document).on("click.alert.data-api",t,n.prototype.close)}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.button.defaults,n)};t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.data(),i=n.is("input")?"val":"html";e+="Text",r.resetText||n.data("resetText",n[i]()),n[i](r[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass(t).attr(t,t):n.removeClass(t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="buttons-radio"]');e&&e.find(".active").removeClass("active"),this.$element.toggleClass("active")};var n=e.fn.button;e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("button"),s=typeof n=="object"&&n;i||r.data("button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.defaults={loadingText:"loading..."},e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=n,this},e(document).on("click.button.data-api","[data-toggle^=button]",function(t){var n=e(t.target);n.hasClass("btn")||(n=n.closest(".btn")),n.button("toggle")})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.options.pause=="hover"&&this.$element.on("mouseenter",e.proxy(this.pause,this)).on("mouseleave",e.proxy(this.cycle,this))};t.prototype={cycle:function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},getActiveIndex:function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},to:function(t){var n=this.getActiveIndex(),r=this;if(t>this.$items.length-1||t<0)return;return this.sliding?this.$element.one("slid",function(){r.to(t)}):n==t?this.pause().cycle():this.slide(t>n?"next":"prev",e(this.$items[t]))},pause:function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition.end&&(this.$element.trigger(e.support.transition.end),this.cycle(!0)),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(t,n){var r=this.$element.find(".item.active"),i=n||r[t](),s=this.interval,o=t=="next"?"left":"right",u=t=="next"?"first":"last",a=this,f;this.sliding=!0,s&&this.pause(),i=i.length?i:this.$element.find(".item")[u](),f=e.Event("slide",{relatedTarget:i[0],direction:o});if(i.hasClass("active"))return;this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var t=e(a.$indicators.children()[a.getActiveIndex()]);t&&t.addClass("active")}));if(e.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(f);if(f.isDefaultPrevented())return;i.addClass(t),i[0].offsetWidth,r.addClass(o),i.addClass(o),this.$element.one(e.support.transition.end,function(){i.removeClass([t,o].join(" ")).addClass("active"),r.removeClass(["active",o].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger("slid")},0)})}else{this.$element.trigger(f);if(f.isDefaultPrevented())return;r.removeClass("active"),i.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return s&&this.cycle(),this}};var n=e.fn.carousel;e.fn.carousel=function(n){return this.each(function(){var r=e(this),i=r.data("carousel"),s=e.extend({},e.fn.carousel.defaults,typeof n=="object"&&n),o=typeof n=="string"?n:s.slide;i||r.data("carousel",i=new t(this,s)),typeof n=="number"?i.to(n):o?i[o]():s.interval&&i.pause().cycle()})},e.fn.carousel.defaults={interval:5e3,pause:"hover"},e.fn.carousel.Constructor=t,e.fn.carousel.noConflict=function(){return e.fn.carousel=n,this},e(document).on("click.carousel.data-api","[data-slide], [data-slide-to]",function(t){var n=e(this),r,i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),s=e.extend({},i.data(),n.data()),o;i.carousel(s),(o=n.attr("data-slide-to"))&&i.data("carousel").pause().to(o).cycle(),t.preventDefault()})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.collapse.defaults,n),this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.prototype={constructor:t,dimension:function(){var e=this.$element.hasClass("width");return e?"width":"height"},show:function(){var t,n,r,i;if(this.transitioning||this.$element.hasClass("in"))return;t=this.dimension(),n=e.camelCase(["scroll",t].join("-")),r=this.$parent&&this.$parent.find("> .accordion-group > .in");if(r&&r.length){i=r.data("collapse");if(i&&i.transitioning)return;r.collapse("hide"),i||r.data("collapse",null)}this.$element[t](0),this.transition("addClass",e.Event("show"),"shown"),e.support.transition&&this.$element[t](this.$element[0][n])},hide:function(){var t;if(this.transitioning||!this.$element.hasClass("in"))return;t=this.dimension(),this.reset(this.$element[t]()),this.transition("removeClass",e.Event("hide"),"hidden"),this.$element[t](0)},reset:function(e){var t=this.dimension();return this.$element.removeClass("collapse")[t](e||"auto")[0].offsetWidth,this.$element[e!==null?"addClass":"removeClass"]("collapse"),this},transition:function(t,n,r){var i=this,s=function(){n.type=="show"&&i.reset(),i.transitioning=0,i.$element.trigger(r)};this.$element.trigger(n);if(n.isDefaultPrevented())return;this.transitioning=1,this.$element[t]("in"),e.support.transition&&this.$element.hasClass("collapse")?this.$element.one(e.support.transition.end,s):s()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};var n=e.fn.collapse;e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("collapse"),s=e.extend({},e.fn.collapse.defaults,r.data(),typeof n=="object"&&n);i||r.data("collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.defaults={toggle:!0},e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=n,this},e(document).on("click.collapse.data-api","[data-toggle=collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i).data("collapse")?"toggle":n.data();n[e(i).hasClass("in")?"addClass":"removeClass"]("collapsed"),e(i).collapse(s)})}(window.jQuery),!function(e){"use strict";function r(){e(".dropdown-backdrop").remove(),e(t).each(function(){i(e(this)).removeClass("open")})}function i(t){var n=t.attr("data-target"),r;n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,"")),r=n&&e(n);if(!r||!r.length)r=t.parent();return r}var t="[data-toggle=dropdown]",n=function(t){var n=e(t).on("click.dropdown.data-api",this.toggle);e("html").on("click.dropdown.data-api",function(){n.parent().removeClass("open")})};n.prototype={constructor:n,toggle:function(t){var n=e(this),s,o;if(n.is(".disabled, :disabled"))return;return s=i(n),o=s.hasClass("open"),r(),o||("ontouchstart"in document.documentElement&&e('<div class="dropdown-backdrop"/>').insertBefore(e(this)).on("click",r),s.toggleClass("open")),n.focus(),!1},keydown:function(n){var r,s,o,u,a,f;if(!/(38|40|27)/.test(n.keyCode))return;r=e(this),n.preventDefault(),n.stopPropagation();if(r.is(".disabled, :disabled"))return;u=i(r),a=u.hasClass("open");if(!a||a&&n.keyCode==27)return n.which==27&&u.find(t).focus(),r.click();s=e("[role=menu] li:not(.divider):visible a",u);if(!s.length)return;f=s.index(s.filter(":focus")),n.keyCode==38&&f>0&&f--,n.keyCode==40&&f<s.length-1&&f++,~f||(f=0),s.eq(f).focus()}};var s=e.fn.dropdown;e.fn.dropdown=function(t){return this.each(function(){var r=e(this),i=r.data("dropdown");i||r.data("dropdown",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.dropdown.Constructor=n,e.fn.dropdown.noConflict=function(){return e.fn.dropdown=s,this},e(document).on("click.dropdown.data-api",r).on("click.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("click.dropdown.data-api",t,n.prototype.toggle).on("keydown.dropdown.data-api",t+", [role=menu]",n.prototype.keydown)}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.options=n,this.$element=e(t).delegate('[data-dismiss="modal"]',"click.dismiss.modal",e.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};t.prototype={constructor:t,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var t=this,n=e.Event("show");this.$element.trigger(n);if(this.isShown||n.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.backdrop(function(){var n=e.support.transition&&t.$element.hasClass("fade");t.$element.parent().length||t.$element.appendTo(document.body),t.$element.show(),n&&t.$element[0].offsetWidth,t.$element.addClass("in").attr("aria-hidden",!1),t.enforceFocus(),n?t.$element.one(e.support.transition.end,function(){t.$element.focus().trigger("shown")}):t.$element.focus().trigger("shown")})},hide:function(t){t&&t.preventDefault();var n=this;t=e.Event("hide"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,this.escape(),e(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),e.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal()},enforceFocus:function(){var t=this;e(document).on("focusin.modal",function(e){t.$element[0]!==e.target&&!t.$element.has(e.target).length&&t.$element.focus()})},escape:function(){var e=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(t){t.which==27&&e.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var t=this,n=setTimeout(function(){t.$element.off(e.support.transition.end),t.hideModal()},500);this.$element.one(e.support.transition.end,function(){clearTimeout(n),t.hideModal()})},hideModal:function(){var e=this;this.$element.hide(),this.backdrop(function(){e.removeBackdrop(),e.$element.trigger("hidden")})},removeBackdrop:function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},backdrop:function(t){var n=this,r=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('<div class="modal-backdrop '+r+'" />').appendTo(document.body),this.$backdrop.click(this.options.backdrop=="static"?e.proxy(this.$element[0].focus,this.$element[0]):e.proxy(this.hide,this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in");if(!t)return;i?this.$backdrop.one(e.support.transition.end,t):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,t):t()):t&&t()}};var n=e.fn.modal;e.fn.modal=function(n){return this.each(function(){var r=e(this),i=r.data("modal"),s=e.extend({},e.fn.modal.defaults,r.data(),typeof n=="object"&&n);i||r.data("modal",i=new t(this,s)),typeof n=="string"?i[n]():s.show&&i.show()})},e.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=n,this},e(document).on("click.modal.data-api",'[data-toggle="modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s).one("hide",function(){n.focus()})})}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("tooltip",e,t)};t.prototype={constructor:t,init:function(t,n,r){var i,s,o,u,a;this.type=t,this.$element=e(n),this.options=this.getOptions(r),this.enabled=!0,o=this.options.trigger.split(" ");for(a=o.length;a--;)u=o[a],u=="click"?this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this)):u!="manual"&&(i=u=="hover"?"mouseenter":"focus",s=u=="hover"?"mouseleave":"blur",this.$element.on(i+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,e.proxy(this.leave,this)));this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(t){return t=e.extend({},e.fn[this.type].defaults,this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},enter:function(t){var n=e.fn[this.type].defaults,r={},i;this._options&&e.each(this._options,function(e,t){n[e]!=t&&(r[e]=t)},this),i=e(t.currentTarget)[this.type](r).data(this.type);if(!i.options.delay||!i.options.delay.show)return i.show();clearTimeout(this.timeout),i.hoverState="in",this.timeout=setTimeout(function(){i.hoverState=="in"&&i.show()},i.options.delay.show)},leave:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);this.timeout&&clearTimeout(this.timeout);if(!n.options.delay||!n.options.delay.hide)return n.hide();n.hoverState="out",this.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},show:function(){var t,n,r,i,s,o,u=e.Event("show");if(this.hasContent()&&this.enabled){this.$element.trigger(u);if(u.isDefaultPrevented())return;t=this.tip(),this.setContent(),this.options.animation&&t.addClass("fade"),s=typeof this.options.placement=="function"?this.options.placement.call(this,t[0],this.$element[0]):this.options.placement,t.detach().css({top:0,left:0,display:"block"}),this.options.container?t.appendTo(this.options.container):t.insertAfter(this.$element),n=this.getPosition(),r=t[0].offsetWidth,i=t[0].offsetHeight;switch(s){case"bottom":o={top:n.top+n.height,left:n.left+n.width/2-r/2};break;case"top":o={top:n.top-i,left:n.left+n.width/2-r/2};break;case"left":o={top:n.top+n.height/2-i/2,left:n.left-r};break;case"right":o={top:n.top+n.height/2-i/2,left:n.left+n.width}}this.applyPlacement(o,s),this.$element.trigger("shown")}},applyPlacement:function(e,t){var n=this.tip(),r=n[0].offsetWidth,i=n[0].offsetHeight,s,o,u,a;n.offset(e).addClass(t).addClass("in"),s=n[0].offsetWidth,o=n[0].offsetHeight,t=="top"&&o!=i&&(e.top=e.top+i-o,a=!0),t=="bottom"||t=="top"?(u=0,e.left<0&&(u=e.left*-2,e.left=0,n.offset(e),s=n[0].offsetWidth,o=n[0].offsetHeight),this.replaceArrow(u-r+s,s,"left")):this.replaceArrow(o-i,o,"top"),a&&n.offset(e)},replaceArrow:function(e,t,n){this.arrow().css(n,e?50*(1-e/t)+"%":"")},setContent:function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},hide:function(){function i(){var t=setTimeout(function(){n.off(e.support.transition.end).detach()},500);n.one(e.support.transition.end,function(){clearTimeout(t),n.detach()})}var t=this,n=this.tip(),r=e.Event("hide");this.$element.trigger(r);if(r.isDefaultPrevented())return;return n.removeClass("in"),e.support.transition&&this.$tip.hasClass("fade")?i():n.detach(),this.$element.trigger("hidden"),this},fixTitle:function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},hasContent:function(){return this.getTitle()},getPosition:function(){var t=this.$element[0];return e.extend({},typeof t.getBoundingClientRect=="function"?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())},getTitle:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},tip:function(){return this.$tip=this.$tip||e(this.options.template)},arrow:function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(t){var n=t?e(t.currentTarget)[this.type](this._options).data(this.type):this;n.tip().hasClass("in")?n.hide():n.show()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}};var n=e.fn.tooltip;e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("tooltip"),s=typeof n=="object"&&n;i||r.data("tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},e.fn.tooltip.noConflict=function(){return e.fn.tooltip=n,this}}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("popover",e,t)};t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype,{constructor:t,setContent:function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content")[this.options.html?"html":"text"](n),e.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var e,t=this.$element,n=this.options;return e=(typeof n.content=="function"?n.content.call(t[0]):n.content)||t.attr("data-content"),e},tip:function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}});var n=e.fn.popover;e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("popover"),s=typeof n=="object"&&n;i||r.data("popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.defaults=e.extend({},e.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),e.fn.popover.noConflict=function(){return e.fn.popover=n,this}}(window.jQuery),!function(e){"use strict";function t(t,n){var r=e.proxy(this.process,this),i=e(t).is("body")?e(window):e(t),s;this.options=e.extend({},e.fn.scrollspy.defaults,n),this.$scrollElement=i.on("scroll.scroll-spy.data-api",r),this.selector=(this.options.target||(s=e(t).attr("href"))&&s.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=e("body"),this.refresh(),this.process()}t.prototype={constructor:t,refresh:function(){var t=this,n;this.offsets=e([]),this.targets=e([]),n=this.$body.find(this.selector).map(function(){var n=e(this),r=n.data("target")||n.attr("href"),i=/^#\w/.test(r)&&e(r);return i&&i.length&&[[i.position().top+(!e.isWindow(t.$scrollElement.get(0))&&t.$scrollElement.scrollTop()),r]]||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},process:function(){var e=this.$scrollElement.scrollTop()+this.options.offset,t=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,n=t-this.$scrollElement.height(),r=this.offsets,i=this.targets,s=this.activeTarget,o;if(e>=n)return s!=(o=i.last()[0])&&this.activate(o);for(o=r.length;o--;)s!=i[o]&&e>=r[o]&&(!r[o+1]||e<=r[o+1])&&this.activate(i[o])},activate:function(t){var n,r;this.activeTarget=t,e(this.selector).parent(".active").removeClass("active"),r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',n=e(r).parent("li").addClass("active"),n.parent(".dropdown-menu").length&&(n=n.closest("li.dropdown").addClass("active")),n.trigger("activate")}};var n=e.fn.scrollspy;e.fn.scrollspy=function(n){return this.each(function(){var r=e(this),i=r.data("scrollspy"),s=typeof n=="object"&&n;i||r.data("scrollspy",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.scrollspy.Constructor=t,e.fn.scrollspy.defaults={offset:10},e.fn.scrollspy.noConflict=function(){return e.fn.scrollspy=n,this},e(window).on("load",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);t.scrollspy(t.data())})})}(window.jQuery),!function(e){"use strict";var t=function(t){this.element=e(t)};t.prototype={constructor:t,show:function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),r=t.attr("data-target"),i,s,o;r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("active"))return;i=n.find(".active:last a")[0],o=e.Event("show",{relatedTarget:i}),t.trigger(o);if(o.isDefaultPrevented())return;s=e(r),this.activate(t.parent("li"),n),this.activate(s,s.parent(),function(){t.trigger({type:"shown",relatedTarget:i})})},activate:function(t,n,r){function o(){i.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),t.addClass("active"),s?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active"),r&&r()}var i=n.find("> .active"),s=r&&e.support.transition&&i.hasClass("fade");s?i.one(e.support.transition.end,o):o(),i.removeClass("in")}};var n=e.fn.tab;e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("tab");i||r.data("tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=n,this},e(document).on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault(),e(this).tab("show")})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.typeahead.defaults,n),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.source=this.options.source,this.$menu=e(this.options.menu),this.shown=!1,this.listen()};t.prototype={constructor:t,select:function(){var e=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(e)).change(),this.hide()},updater:function(e){return e},show:function(){var t=e.extend({},this.$element.position(),{height:this.$element[0].offsetHeight});return this.$menu.insertAfter(this.$element).css({top:t.top+t.height,left:t.left}).show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(t){var n;return this.query=this.$element.val(),!this.query||this.query.length<this.options.minLength?this.shown?this.hide():this:(n=e.isFunction(this.source)?this.source(this.query,e.proxy(this.process,this)):this.source,n?this.process(n):this)},process:function(t){var n=this;return t=e.grep(t,function(e){return n.matcher(e)}),t=this.sorter(t),t.length?this.render(t.slice(0,this.options.items)).show():this.shown?this.hide():this},matcher:function(e){return~e.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(e){var t=[],n=[],r=[],i;while(i=e.shift())i.toLowerCase().indexOf(this.query.toLowerCase())?~i.indexOf(this.query)?n.push(i):r.push(i):t.push(i);return t.concat(n,r)},highlighter:function(e){var t=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return e.replace(new RegExp("("+t+")","ig"),function(e,t){return"<strong>"+t+"</strong>"})},render:function(t){var n=this;return t=e(t).map(function(t,r){return t=e(n.options.item).attr("data-value",r),t.find("a").html(n.highlighter(r)),t[0]}),t.first().addClass("active"),this.$menu.html(t),this},next:function(t){var n=this.$menu.find(".active").removeClass("active"),r=n.next();r.length||(r=e(this.$menu.find("li")[0])),r.addClass("active")},prev:function(e){var t=this.$menu.find(".active").removeClass("active"),n=t.prev();n.length||(n=this.$menu.find("li").last()),n.addClass("active")},listen:function(){this.$element.on("focus",e.proxy(this.focus,this)).on("blur",e.proxy(this.blur,this)).on("keypress",e.proxy(this.keypress,this)).on("keyup",e.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown",e.proxy(this.keydown,this)),this.$menu.on("click",e.proxy(this.click,this)).on("mouseenter","li",e.proxy(this.mouseenter,this)).on("mouseleave","li",e.proxy(this.mouseleave,this))},eventSupported:function(e){var t=e in this.$element;return t||(this.$element.setAttribute(e,"return;"),t=typeof this.$element[e]=="function"),t},move:function(e){if(!this.shown)return;switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 38:e.preventDefault(),this.prev();break;case 40:e.preventDefault(),this.next()}e.stopPropagation()},keydown:function(t){this.suppressKeyPressRepeat=~e.inArray(t.keyCode,[40,38,9,13,27]),this.move(t)},keypress:function(e){if(this.suppressKeyPressRepeat)return;this.move(e)},keyup:function(e){switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}e.stopPropagation(),e.preventDefault()},focus:function(e){this.focused=!0},blur:function(e){this.focused=!1,!this.mousedover&&this.shown&&this.hide()},click:function(e){e.stopPropagation(),e.preventDefault(),this.select(),this.$element.focus()},mouseenter:function(t){this.mousedover=!0,this.$menu.find(".active").removeClass("active"),e(t.currentTarget).addClass("active")},mouseleave:function(e){this.mousedover=!1,!this.focused&&this.shown&&this.hide()}};var n=e.fn.typeahead;e.fn.typeahead=function(n){return this.each(function(){var r=e(this),i=r.data("typeahead"),s=typeof n=="object"&&n;i||r.data("typeahead",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.typeahead.defaults={source:[],items:8,menu:'<ul class="typeahead dropdown-menu"></ul>',item:'<li><a href="#"></a></li>',minLength:1},e.fn.typeahead.Constructor=t,e.fn.typeahead.noConflict=function(){return e.fn.typeahead=n,this},e(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(t){var n=e(this);if(n.data("typeahead"))return;n.typeahead(n.data())})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.options=e.extend({},e.fn.affix.defaults,n),this.$window=e(window).on("scroll.affix.data-api",e.proxy(this.checkPosition,this)).on("click.affix.data-api",e.proxy(function(){setTimeout(e.proxy(this.checkPosition,this),1)},this)),this.$element=e(t),this.checkPosition()};t.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var t=e(document).height(),n=this.$window.scrollTop(),r=this.$element.offset(),i=this.options.offset,s=i.bottom,o=i.top,u="affix affix-top affix-bottom",a;typeof i!="object"&&(s=o=i),typeof o=="function"&&(o=i.top()),typeof s=="function"&&(s=i.bottom()),a=this.unpin!=null&&n+this.unpin<=r.top?!1:s!=null&&r.top+this.$element.height()>=t-s?"bottom":o!=null&&n<=o?"top":!1;if(this.affixed===a)return;this.affixed=a,this.unpin=a=="bottom"?r.top-n:null,this.$element.removeClass(u).addClass("affix"+(a?"-"+a:""))};var n=e.fn.affix;e.fn.affix=function(n){return this.each(function(){var r=e(this),i=r.data("affix"),s=typeof n=="object"&&n;i||r.data("affix",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.affix.Constructor=t,e.fn.affix.defaults={offset:0},e.fn.affix.noConflict=function(){return e.fn.affix=n,this},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var t=e(this),n=t.data();n.offset=n.offset||{},n.offsetBottom&&(n.offset.bottom=n.offsetBottom),n.offsetTop&&(n.offset.top=n.offsetTop),t.affix(n)})})}(window.jQuery); \ No newline at end of file
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/customrecipe.js b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/customrecipe.js
new file mode 100644
index 000000000..1c0ef9e37
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/customrecipe.js
@@ -0,0 +1,284 @@
+"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 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 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);
+ });
+ });
+}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/filtersnippet.js b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/filtersnippet.js
new file mode 100755
index 000000000..2b84c546c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/importlayer.js b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/importlayer.js
new file mode 100644
index 000000000..5a59799bc
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/importlayer.js
@@ -0,0 +1,303 @@
+"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 layerDeps = {};
+ var layerDepsDeps = {};
+ var currentLayerDepSelection;
+ var validLayerName = /^(\w|-)+$/;
+
+ libtoaster.makeTypeahead(layerDepInput, libtoaster.ctx.layersTypeAheadUrl, { include_added: "true" }, function(item){
+ currentLayerDepSelection = item;
+ });
+
+ // choices available in the typeahead
+ var layerDepsChoices = {};
+
+ // when the typeahead choices change, store an array of the available layer
+ // choices locally, to use for enabling/disabling the "Add layer" button
+ layerDepInput.on("typeahead-choices-change", function (event, data) {
+ layerDepsChoices = {};
+
+ if (data.choices) {
+ data.choices.forEach(function (item) {
+ layerDepsChoices[item.name] = item;
+ });
+ }
+ });
+
+ // disable the "Add layer" button when the layer input typeahead is empty
+ // or not in the typeahead choices
+ layerDepInput.on("input change", function () {
+ // get the choices from the typeahead
+ var choice = layerDepsChoices[$(this).val()];
+
+ if (choice) {
+ layerDepBtn.removeAttr("disabled");
+ currentLayerDepSelection = choice;
+ }
+ else {
+ layerDepBtn.attr("disabled", "disabled");
+ currentLayerDepSelection = undefined;
+ }
+ });
+
+ /* 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=\"icon-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"});
+
+ 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(){
+ /* 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,
+ };
+
+ $.ajax({
+ type: "POST",
+ url: ctx.xhrImportLayerUrl,
+ data: layerData,
+ headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
+ success: function (data) {
+ if (data.error != "ok") {
+ console.log(data.error);
+ } else {
+ /* Success layer import now go to the project page */
+ $.cookie('layer-imported-alert', JSON.stringify(data), { path: '/'});
+ window.location.replace(libtoaster.ctx.projectPageUrl+'?notify=layer-imported');
+ }
+ },
+ error: function (data) {
+ console.log("Call failed");
+ console.log(data);
+ }
+ });
+ }
+ });
+
+ 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");
+
+ for (var i=0; i<inputs.length; i++){
+ if (!(valid = inputs[i].value)){
+ enable_import_btn(false);
+ break;
+ }
+ }
+
+ if (valid)
+ enable_import_btn(true);
+ }
+
+ function layerExistsError(layer){
+ var dupLayerInfo = $("#duplicate-layer-info");
+ 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("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();
+ });
+
+ }
+
+ /* Don't remove the error class if we're displaying the error for another
+ * reason.
+ */
+ if (!duplicatedLayerName.is(":visible"))
+ layerNameCtrl.removeClass("error")
+
+ $("#invalid-layer-name-hint").hide();
+ check_form();
+ });
+
+ /* Have a guess at the layer name */
+ vcsURLInput.focusout(function (){
+ /* 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())
+ return;
+
+ if ($(this).val().search("/")){
+ var urlPts = $(this).val().split("/");
+ var suggestion = urlPts[urlPts.length-1].replace(".git","");
+ layerNameInput.val(suggestion);
+ }
+ });
+
+}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/jquery-2.0.3.min.js b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/jquery-2.0.3.min.js
new file mode 100644
index 000000000..2be209dd2
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/jquery-2.0.3.min.map b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/jquery-2.0.3.min.map
new file mode 100644
index 000000000..1edecd1ae
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/jquery-ui.min.js b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/jquery-ui.min.js
new file mode 100755
index 000000000..4e6396b21
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/jquery.cookie.js b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/jquery.cookie.js
new file mode 100644
index 000000000..927190008
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/jquery.treetable.js b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/jquery.treetable.js
new file mode 100644
index 000000000..794b902c5
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/layerBtn.js b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/layerBtn.js
new file mode 100644
index 000000000..259271df3
--- /dev/null
+++ b/import-layers/yocto-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();
+ });
+ });
+ }
+
+ });
+ });
+
+ $(".build-recipe-btn").unbind('click');
+ $(".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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/layerDepsModal.js b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/layerDepsModal.js
new file mode 100644
index 000000000..825f9dccd
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/layerDepsModal.js
@@ -0,0 +1,90 @@
+/*
+ * 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><label class=\"checkbox\"><input name=\"dependencies\" value=\"";
+ deplistHtml += dependencies[i].id;
+ deplistHtml +="\" type=\"checkbox\" checked=\"checked\"/>";
+ deplistHtml += dependencies[i].name;
+ deplistHtml += "</label></li>";
+ }
+ $('#dependencies-list').html(deplistHtml);
+
+ $("#dependencies-modal").data("deps", dependencies);
+
+ $('#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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/layerdetails.js b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/layerdetails.js
new file mode 100644
index 000000000..d54540626
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/layerdetails.js
@@ -0,0 +1,395 @@
+"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");
+
+ /* setup the dependencies typeahead */
+ libtoaster.makeTypeahead(layerDepInput, libtoaster.ctx.layersTypeAheadUrl, { include_added: "true" }, function(item){
+ currentLayerDepSelection = item;
+
+ layerDepBtn.removeAttr("disabled");
+ });
+
+ $(window).on('hashchange', function(e){
+ switch(window.location.hash){
+ case '#machines':
+ machineTab.tab('show');
+ break;
+ case '#recipes':
+ targetTab.tab('show');
+ break;
+ default:
+ detailsTab.tab('show');
+ break;
+ }
+ });
+
+ 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=\"icon-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");
+ });
+ });
+
+ $(".icon-pencil").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());
+ /* Hides the "Not set" text */
+ mParent.children(".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(".muted").fadeIn();
+ mParent.children(".delete-current-value").hide();
+ } else {
+ mParent.children(".delete-current-value").show();
+ }
+
+ mParent.children(".icon-pencil").show();
+ mParent.prev().css("margin-top", "0px");
+ });
+ });
+
+ function defaultAddBtnText(){
+ var text = " Add the "+ctx.layerVersion.name+" layer to your project";
+ addRmLayerBtn.text(text);
+ addRmLayerBtn.prepend("<span class=\"icon-plus\"></span>");
+ addRmLayerBtn.removeClass("btn-danger");
+ }
+
+ detailsTab.on('show', function(){
+ if (!ctx.layerVersion.inCurrentPrj)
+ defaultAddBtnText();
+
+ window.location.hash = "details";
+ });
+
+ 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=\"icon-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("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("muted");
+ if (window.location.hash === "#machines"){
+ /* re run the machinesTabShow to update the text */
+ machinesTabShow();
+ }
+
+ $(".select-machine-btn").click(function(e){
+ if ($(this).attr("disabled") === "disabled")
+ e.preventDefault();
+ });
+
+ });
+
+ targetTab.on('show', targetsTabShow);
+
+ 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=\"icon-plus\"></span>");
+ } else {
+ defaultAddBtnText();
+ }
+ }
+
+ window.location.hash = "machines";
+ }
+
+ machineTab.on('show', machinesTabShow);
+
+ $(".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").removeAttr("disabled");
+ $(".select-machine-btn").removeAttr("disabled");
+ addRmLayerBtn.addClass("btn-danger");
+ addRmLayerBtn.data('directive', "remove");
+ addRmLayerBtn.text(" Remove the "+ctx.layerVersion.name+" layer from your project");
+ addRmLayerBtn.prepend("<span class=\"icon-trash\"></span>");
+
+ } else {
+ /* disable and switch all the button states */
+ $(".build-recipe-btn").attr("disabled","disabled");
+ $(".select-machine-btn").attr("disabled", "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-pills .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);
+
+ $("#alert-area").show();
+ });
+ });
+
+ /* 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(".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().children(".change-btn").attr("disabled", "disabled");
+ else
+ $(this).parent().children(".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.sourceId == 3){
+ /* There's no current value and the layer is editable
+ * so show the "Not set" and hide the delete icon
+ */
+ dd.find(".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();
+ });
+
+
+ layerDepsList.find(".icon-trash").click(layerDepRemoveClick);
+ layerDepsList.find("a").tooltip();
+ $(".icon-trash").tooltip();
+ $(".commit").tooltip();
+
+}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/libtoaster.js b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
new file mode 100644
index 000000000..43930a2c3
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
@@ -0,0 +1,623 @@
+"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 (){
+
+ /* makeTypeahead parameters
+ * elementSelector: JQuery elementSelector string
+ * xhrUrl: the url to get the JSON from expects JSON in the form:
+ * { "list": [ { "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 one
+ * arg of the item.
+ */
+ function _makeTypeahead (jQElement, xhrUrl, xhrParams, selectedCB) {
+ if (!xhrUrl || xhrUrl.length === 0)
+ throw("No url to typeahead supplied");
+
+ var xhrReq;
+
+ jQElement.typeahead({
+ // each time the typeahead's choices change, a
+ // "typeahead-choices-change" event is fired with an object
+ // containing the available choices in a "choices" property
+ source: function(query, process){
+ xhrParams.search = query;
+
+ /* If we have a request in progress don't fire off another one*/
+ if (xhrReq)
+ xhrReq.abort();
+
+ xhrReq = $.getJSON(xhrUrl, this.options.xhrParams, function(data){
+ if (data.error !== "ok") {
+ console.log("Error getting data from server "+data.error);
+ return;
+ }
+
+ xhrReq = null;
+
+ jQElement.trigger("typeahead-choices-change", {choices: data.results});
+
+ return process(data.results);
+ });
+ },
+ updater: function(item) {
+ var itemObj = this.$menu.find('.active').data('itemObject');
+ selectedCB(itemObj);
+ return item;
+ },
+ matcher: function(item) {
+ if (!item.hasOwnProperty('name')) {
+ console.log("Name property missing in data");
+ return 0;
+ }
+
+ if (this.$element.val().length === 0)
+ return 0;
+
+ return 1;
+ },
+ highlighter: function (item) {
+ /* Use jquery to escape the item name and detail */
+ var current = $("<span></span>").text(item.name + ' '+item.detail);
+ current = current.html();
+
+ var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
+ return current.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
+ return '<strong>' + match + '</strong>'
+ })
+ },
+ sorter: function (items) { return items; },
+ xhrUrl: xhrUrl,
+ xhrParams: xhrParams,
+ xhrReq: xhrReq,
+ });
+
+
+ /* Copy of bootstrap's render func but sets selectedObject value */
+ function customRenderFunc (items) {
+ var that = this;
+
+ items = $(items).map(function (i, item) {
+ i = $(that.options.item).attr('data-value', item.name).data('itemObject', item);
+ i.find('a').html(that.highlighter(item));
+ return i[0];
+ });
+
+ items.first().addClass('active');
+ this.$menu.html(items);
+ return this;
+ }
+
+ jQElement.data('typeahead').render = customRenderFunc;
+ }
+
+ /* 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);
+ }
+ });
+ }
+
+ /* Get a project's configuration info */
+ function _getProjectInfo(url, onsuccess, onfail){
+ $.ajax({
+ type: "GET",
+ data : { format: "json" },
+ 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.projectPageUrl + "?format=json",
+ 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 (add === true) {
+ /* If adding get the deps for this layer */
+ libtoaster.getLayerDepsForProject(layerObj.layerdetailurl,
+ 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 id=\"layer-affected-name\"></a> and its dependencies </span>");
+
+ /* Build the layer deps list */
+ layerDepsList.map(function(layer, i){
+ var link = $("<a></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 id=\"layer-affected-name\"></a></span></span>");
+ } else if (add === false) {
+ alertMsg = $("<span>You have removed <strong>1</strong> layer from your project: <a 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){
+ 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);
+ }
+ });
+ }
+
+
+ return {
+ reload_params : reload_params,
+ startABuild : _startABuild,
+ cancelABuild : _cancelABuild,
+ makeTypeahead : _makeTypeahead,
+ getProjectInfo: _getProjectInfo,
+ getLayerDepsForProject : _getLayerDepsForProject,
+ editCurrentProject : _editCurrentProject,
+ debug: false,
+ parseUrlParams : _parseUrlParams,
+ dumpsUrlParams : _dumpsUrlParams,
+ addRmLayer : _addRmLayer,
+ makeLayerAddRmAlertMsg : _makeLayerAddRmAlertMsg,
+ showChangeNotification : _showChangeNotification,
+ createCustomRecipe: _createCustomRecipe,
+ };
+})();
+
+/* 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() {
+
+ 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() {};
+ }
+
+ /*
+ * PrettyPrint plugin.
+ *
+ */
+ // Init
+ prettyPrint();
+
+ // 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 only on hover inside tables
+ $(".hover-help").css("visibility","hidden");
+
+ $("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 icon-pencil icons
+ $(".icon-pencil").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
+ $(".icon-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() {
+ $("#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;
+ });
+ }
+
+ 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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/mrbsection.js b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/mrbsection.js
new file mode 100644
index 000000000..09117e1da
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/mrbsection.js
@@ -0,0 +1,95 @@
+
+function mrbSectionInit(ctx){
+
+ var projectBuilds;
+
+ if (ctx.mrbType === 'project')
+ projectBuilds = true;
+
+ $(".cancel-build-btn").click(function(e){
+ e.preventDefault();
+
+ var url = $(this).data('request-url');
+ var buildReqIds = $(this).data('buildrequest-id');
+ var banner = $(this).parents(".alert");
+
+ banner.find(".progress-info").fadeOut().promise().done(function(){
+ $("#cancelling-msg-" + buildReqIds).show();
+ console.log("cancel build");
+ libtoaster.cancelABuild(url, buildReqIds, function(){
+ if (projectBuilds == false){
+ /* the all builds page is not 'self updating' like thei
+ * project Builds
+ */
+ window.location.reload();
+ }
+ }, null);
+ });
+ });
+
+ $(".run-again-btn").click(function(e){
+ e.preventDefault();
+
+ var url = $(this).data('request-url');
+ var target = $(this).data('target');
+
+ libtoaster.startABuild(url, target, function(){
+ window.location.reload();
+ }, null);
+ });
+
+
+ var progressTimer;
+
+ if (projectBuilds === true){
+ progressTimer = window.setInterval(function() {
+ libtoaster.getProjectInfo(libtoaster.ctx.projectPageUrl,
+ function(prjInfo){
+ /* These two are needed because a build can be 100% and still
+ * in progress due to the fact that the % done is updated at the
+ * start of a task so it can be doing the last task at 100%
+ */
+ var inProgress = 0;
+ var allPercentDone = 0;
+ if (prjInfo.builds.length === 0)
+ return
+
+ for (var i in prjInfo.builds){
+ var build = prjInfo.builds[i];
+
+ if (build.outcome === "In Progress" ||
+ $(".progress .bar").length > 0){
+ /* Update the build progress */
+ var percentDone;
+
+ if (build.outcome !== "In Progress"){
+ /* We have to ignore the value when it's Succeeded because it
+ * goes back to 0
+ */
+ percentDone = 100;
+ } else {
+ percentDone = build.percentDone;
+ inProgress++;
+ }
+
+ $("#build-pc-done-" + build.id).text(percentDone);
+ $("#build-pc-done-title-" + build.id).attr("title", percentDone);
+ $("#build-pc-done-bar-" + build.id).css("width",
+ String(percentDone) + "%");
+
+ allPercentDone += percentDone;
+ }
+ }
+
+ if (allPercentDone === (100 * prjInfo.builds.length) && !inProgress)
+ window.location.reload();
+
+ /* Our progress bar is not still showing so shutdown the polling. */
+ if ($(".progress .bar").length === 0)
+ window.clearInterval(progressTimer);
+
+ });
+ }, 1500);
+ }
+}
+
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js
new file mode 100644
index 000000000..cb9ed4da0
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js
@@ -0,0 +1,148 @@
+"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 = "A recipe 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.";
+
+ // 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();
+
+ var recipeId = $(e.target).attr('data-recipe');
+ imgCustomModal.data('recipe', recipeId);
+ });
+
+ newCustomImgBtn.click(function(e){
+ e.preventDefault();
+
+ var baseRecipeId = imgCustomModal.data('recipe');
+
+ if (!baseRecipeId) {
+ showRecipeError(invalidBaseRecipeIdMsg);
+ 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');
+ window.location.replace(ret.url + '?notify=new');
+ }
+ });
+ }
+ });
+
+ function showNameError(text){
+ invalidNameHelp.text(text);
+ invalidNameHelp.show();
+ nameInput.parent().addClass('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('error');
+ } else {
+ invalidNameHelp.hide();
+ newCustomImgBtn.prop("disabled", false);
+ nameInput.parent().removeClass('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(
+ '<label class="radio" data-role="image-radio">' +
+ recipe.name +
+ '<input type="radio" class="form-control" name="select-image" ' +
+ 'data-recipe="' + recipe.id + '">' +
+ '</label>'
+ );
+ }
+
+ // show the radio button container
+ imageSelector.show();
+ }
+}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/prettify.js b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/prettify.js
new file mode 100755
index 000000000..eef5ad7e6
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/prettify.js
@@ -0,0 +1,28 @@
+var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
+(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
+[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c<i;++c){var j=f[c];if(/\\[bdsw]/i.test(j))a.push(j);else{var j=m(j),d;c+2<i&&"-"===f[c+1]?(d=m(f[c+2]),c+=2):d=j;b.push([j,d]);d<65||j>122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;c<b.length;++c)i=b[c],i[0]<=j[1]+1?j[1]=Math.max(j[1],i[1]):f.push(j=i);b=["["];o&&b.push("^");b.push.apply(b,a);for(c=0;c<
+f.length;++c)i=f[c],b.push(e(i[0])),i[1]>i[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c<b;++c){var j=f[c];j==="("?++i:"\\"===j.charAt(0)&&(j=+j.substring(1))&&j<=i&&(d[j]=-1)}for(c=1;c<d.length;++c)-1===d[c]&&(d[c]=++t);for(i=c=0;c<b;++c)j=f[c],j==="("?(++i,d[i]===void 0&&(f[c]="(?:")):"\\"===j.charAt(0)&&
+(j=+j.substring(1))&&j<=i&&(f[c]="\\"+d[i]);for(i=c=0;c<b;++c)"^"===f[c]&&"^"!==f[c+1]&&(f[c]="");if(a.ignoreCase&&s)for(c=0;c<b;++c)j=f[c],a=j.charAt(0),j.length>=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p<d;++p){var g=a[p];if(g.ignoreCase)l=!0;else if(/[a-z]/i.test(g.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){s=!0;l=!1;break}}for(var r=
+{b:8,t:9,n:10,v:11,f:12,r:13},n=[],p=0,d=a.length;p<d;++p){g=a[p];if(g.global||g.multiline)throw Error(""+g);n.push("(?:"+y(g)+")")}return RegExp(n.join("|"),l?"gi":"g")}function M(a){function m(a){switch(a.nodeType){case 1:if(e.test(a.className))break;for(var g=a.firstChild;g;g=g.nextSibling)m(g);g=a.nodeName;if("BR"===g||"LI"===g)h[s]="\n",t[s<<1]=y++,t[s++<<1|1]=a;break;case 3:case 4:g=a.nodeValue,g.length&&(g=p?g.replace(/\r\n?/g,"\n"):g.replace(/[\t\n\r ]+/g," "),h[s]=g,t[s<<1]=y,y+=g.length,
+t[s++<<1|1]=a)}}var e=/(?:^|\s)nocode(?:\s|$)/,h=[],y=0,t=[],s=0,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=document.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);m(a);return{a:h.join("").replace(/\n$/,""),c:t}}function B(a,m,e,h){m&&(a={a:m,d:a},e(a),h.push.apply(h,a.e))}function x(a,m){function e(a){for(var l=a.d,p=[l,"pln"],d=0,g=a.a.match(y)||[],r={},n=0,z=g.length;n<z;++n){var f=g[n],b=r[f],o=void 0,c;if(typeof b===
+"string")c=!1;else{var i=h[f.charAt(0)];if(i)o=f.match(i[1]),b=i[0];else{for(c=0;c<t;++c)if(i=m[c],o=f.match(i[1])){b=i[0];break}o||(b="pln")}if((c=b.length>=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),
+l=[],p={},d=0,g=e.length;d<g;++d){var r=e[d],n=r[3];if(n)for(var k=n.length;--k>=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
+q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,
+q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,
+"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),
+a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
+for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g<d.length;++g)e(d[g]);m===(m|0)&&d[0].setAttribute("value",
+m);var r=s.createElement("OL");r.className="linenums";for(var n=Math.max(0,m-1|0)||0,g=0,z=d.length;g<z;++g)l=d[g],l.className="L"+(g+n)%10,l.firstChild||l.appendChild(s.createTextNode("\xa0")),r.appendChild(l);a.appendChild(r)}function k(a,m){for(var e=m.length;--e>=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*</.test(m)?"default-markup":"default-code";return A[a]}function E(a){var m=
+a.g;try{var e=M(a.h),h=e.a;a.a=h;a.c=e.c;a.d=0;C(m,h)(a);var k=/\bMSIE\b/.test(navigator.userAgent),m=/\n/g,t=a.a,s=t.length,e=0,l=a.c,p=l.length,h=0,d=a.e,g=d.length,a=0;d[g]=s;var r,n;for(n=r=0;n<g;)d[n]!==d[n+2]?(d[r++]=d[n++],d[r++]=d[n++]):n+=2;g=r;for(n=r=0;n<g;){for(var z=d[n],f=d[n+1],b=n+2;b+2<=g&&d[b+1]===f;)b+=2;d[r++]=z;d[r++]=f;n=b}for(d.length=r;h<p;){var o=l[h+2]||s,c=d[a+2]||s,b=Math.min(o,c),i=l[h+1],j;if(i.nodeType!==1&&(j=t.substring(e,b))){k&&(j=j.replace(m,"\r"));i.nodeValue=
+j;var u=i.ownerDocument,v=u.createElement("SPAN");v.className=d[a+1];var x=i.parentNode;x.replaceChild(v,i);v.appendChild(i);e<o&&(l[h+1]=i=u.createTextNode(t.substring(b,o)),x.insertBefore(i,v.nextSibling))}e=b;e>=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
+"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
+H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
+J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
+I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),
+["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",
+/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),
+["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes",
+hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p<h.length&&l.now()<e;p++){var n=h[p],k=n.className;if(k.indexOf("prettyprint")>=0){var k=k.match(g),f,b;if(b=
+!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p<h.length?setTimeout(m,
+250):a&&a()}for(var e=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],h=[],k=0;k<e.length;++k)for(var t=0,s=e[k].length;t<s;++t)h.push(e[k][t]);var e=q,l=Date;l.now||(l={now:function(){return+new Date}});var p=0,d,g=/\blang(?:uage)?-([\w.]+)(?!\S)/;m()};window.PR={createSimpleLexer:x,registerLangHandler:k,sourceDecorator:u,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",
+PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ"}})();
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/projectpage.js b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/projectpage.js
new file mode 100644
index 000000000..3013416dd
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/projectpage.js
@@ -0,0 +1,446 @@
+"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 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 urlParams = libtoaster.parseUrlParams();
+
+ libtoaster.getProjectInfo(libtoaster.ctx.projectPageUrl, function(prjInfo){
+ updateProjectLayers(prjInfo.layers);
+ updateFreqBuildRecipes(prjInfo.freqtargets);
+ updateProjectRelease(prjInfo.release);
+ updateProjectReleases(prjInfo.releases, 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);
+ }
+
+ /* Now we're really ready show the page */
+ $("#project-page").show();
+ });
+
+ (function notificationRequest(){
+
+ if (urlParams.hasOwnProperty('notify')){
+ switch (urlParams.notify){
+ case 'new-project':
+ $("#project-created-notification").show();
+ break;
+ case 'layer-imported':
+ layerImportedNotification();
+ break;
+ default:
+ break;
+ }
+ }
+ })();
+
+ /* Layer imported notification */
+ function layerImportedNotification(){
+ var imported = $.cookie("layer-imported-alert");
+ var message = "Layer imported";
+
+ if (!imported)
+ return;
+ else
+ imported = JSON.parse(imported);
+
+ if (imported.deps_added.length === 0) {
+ message = "You have imported <strong><a 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.showChangeNotification(message);
+
+ $.removeCookie("layer-imported-alert", { path: "/"});
+ }
+
+ /* 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=\"icon-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);
+ 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><label class="checkbox"><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 */
+
+ machineChangeFormToggle.click(function(){
+ 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 class="lead">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 release functionality */
+ function updateProjectRelease(release){
+ releaseTitle.text(release.description);
+ }
+
+ function updateProjectReleases(releases, current){
+ for (var i in releases){
+ var releaseOption = $("<option></option>");
+
+ releaseOption.val(releases[i].id);
+ releaseOption.text(releases[i].description);
+ releaseOption.data('release', releases[i]);
+
+ if (releases[i].id == current.id)
+ releaseOption.attr("selected", "selected");
+
+ releaseForm.children("select").append(releaseOption);
+ }
+ }
+
+ releaseChangeFormToggle.click(function(){
+ releaseForm.slideDown();
+ releaseTitle.hide();
+ $(this).hide();
+ });
+
+ cancelReleaseChange.click(function(e){
+ e.preventDefault();
+ releaseForm.slideUp(function(){
+ releaseTitle.show();
+ releaseChangeFormToggle.show();
+ });
+ });
+
+ function changeProjectRelease(release, layersToRm){
+ libtoaster.editCurrentProject({ projectVersion : release.id },
+ function(){
+ /* Success */
+ /* Update layers list with new layers */
+ layersInPrjList.addClass('muted');
+ libtoaster.getProjectInfo(libtoaster.ctx.projectPageUrl,
+ function(prjInfo){
+ layersInPrjList.children().remove();
+ updateProjectLayers(prjInfo.layers);
+ layersInPrjList.removeClass('muted');
+ releaseChangedNotification(release, prjInfo.layers, layersToRm);
+ });
+ updateProjectRelease(release);
+ cancelReleaseChange.click();
+ });
+ }
+
+ /* Create a notification to show the changes to the layer configuration
+ * caused by changing a release.
+ */
+
+ function releaseChangedNotification(release, layers, layersToRm){
+
+ var message;
+
+ if (layers.length === 0 && layersToRm.length === 0){
+ message = $('<span><span class="lead">You have changed the project release to: <strong><span id="notify-release-name"></span></strong>.');
+ message.find("#notify-release-name").text(release.description);
+ libtoaster.showChangeNotification(message);
+ return;
+ }
+
+ /* Create the whitespace separated list of layers removed */
+ var layersDelList = "";
+
+ layersToRm.map(function(layer, i){
+ layersDelList += layer.name;
+ if (layersToRm[i+1] !== undefined)
+ layersDelList += ', ';
+ });
+
+ message = $('<span><span class="lead">You have changed the project release to: <strong><span id="notify-release-name"></span></strong>. This has caused the following changes in your project layers:</span><ul id="notify-layers-changed-list"></ul></span>');
+
+ var changedList = message.find("#notify-layers-changed-list");
+
+ message.find("#notify-release-name").text(release.description);
+
+ /* Manually construct the list item for changed layers */
+ var li = '<li><strong>'+layers.length+'</strong> layers changed to the <strong>'+release.name+'</strong> release: ';
+ for (var i in layers){
+ li += '<a href='+layers[i].layerdetailurl+'>'+layers[i].name+'</a>';
+ if (i !== 0)
+ li += ', ';
+ }
+
+ changedList.append($(li));
+
+ /* Layers removed */
+ if (layersToRm && layersToRm.length > 0){
+ if (layersToRm.length == 1)
+ li = '<li><strong>1</strong> layer removed: '+layersToRm[0].name+'</li>';
+ else
+ li = '<li><strong>'+layersToRm.length+'</strong> layers deleted: '+layersDelList+'</li>';
+
+ changedList.append($(li));
+ }
+
+ libtoaster.showChangeNotification(message);
+ }
+
+ /* Show the modal dialog which gives the option to remove layers which
+ * aren't compatible with the proposed release
+ */
+ function showReleaseLayerChangeModal(release, layers){
+ var layersToRmList = releaseModal.find("#layers-to-remove-list");
+ layersToRmList.text("");
+
+ releaseModal.find(".proposed-release-change-name").text(release.description);
+ releaseModal.data("layers", layers);
+ releaseModal.data("release", release);
+
+ for (var i in layers){
+ layersToRmList.append($("<li></li>").text(layers[i].name));
+ }
+ releaseModal.modal('show');
+ }
+
+ $("#change-release-btn").click(function(e){
+ e.preventDefault();
+
+ var newRelease = releaseForm.find("option:selected").data('release');
+
+ $.getJSON(ctx.testReleaseChangeUrl,
+ { new_release_id: newRelease.id },
+ function(layers) {
+ if (layers.rows.length === 0){
+ /* No layers to change for this release */
+ changeProjectRelease(newRelease, []);
+ } else {
+ showReleaseLayerChangeModal(newRelease, layers.rows);
+ }
+ });
+ });
+
+ /* Release change modal accept */
+ $("#change-release-and-rm-layers").click(function(){
+ var layers = releaseModal.data("layers");
+ var release = releaseModal.data("release");
+
+ changeProjectRelease(release, layers);
+ });
+
+}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/projecttopbar.js b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/projecttopbar.js
new file mode 100644
index 000000000..b09f974e4
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/projecttopbar.js
@@ -0,0 +1,90 @@
+'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-btn").click(function(){
+ var newProjectName = $("#project-name-change-input").val();
+
+ libtoaster.editCurrentProject({ projectName: newProjectName }, function (){
+ projectName.html(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()) {
+ 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() };
+
+ /* Fire off the build */
+ libtoaster.startABuild(null, selectedTarget.name,
+ function(){
+ window.location.replace(libtoaster.ctx.projectBuildsUrl);
+ }, null);
+ });
+}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/qunit-1.18.0.js b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/qunit-1.18.0.js
new file mode 100644
index 000000000..fadd3403a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/recipedetails.js b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/recipedetails.js
new file mode 100644
index 000000000..604db5f03
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/table.js b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/table.js
new file mode 100644
index 000000000..f738144ae
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/table.js
@@ -0,0 +1,793 @@
+'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,
+ };
+
+ 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){
+ $.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();
+ 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();
+ }
+ table.trigger("table-done", [tableData.total, tableParams]);
+
+ return;
+ } else {
+ tableContainer.show();
+ $("#no-results-"+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]){
+
+ /* if we have a static: version of a key, prefer the static: version for rendering */
+ var orig_key_j = key_j;
+
+ if (key_j.indexOf("static:") === 0) {
+ if (key_j.substr("static:".length) in tableData.rows[i]) {
+ continue;
+ }
+ orig_key_j = key_j.substr("static:".length)
+ } else if (("static:" + key_j) in tableData.rows[i]) {
+ key_j = "static:" + key_j;
+ }
+
+ /* we skip over un-displayable column entries */
+ column_index += 1;
+ if (! tableData.columns[column_index].displayable) {
+ continue;
+ }
+
+ var td = $("<td></td>");
+ td.prop("class", orig_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");
+
+ table.trigger("table-done", [tableData.total, tableParams]);
+ }
+
+ function setupTableChrome(tableData){
+ if (tableChromeDone === true)
+ return;
+
+ var tableHeadRow = table.find("thead");
+ var editColMenu = $("#table-chrome-"+ctx.tableName).find(".editcol");
+
+ tableHeadRow.html("");
+ editColMenu.html("");
+
+ if (!tableParams.orderby && tableData.default_orderby){
+ tableParams.orderby = tableData.default_orderby;
+ }
+
+ /* Add table header and column toggle menu */
+ 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 = $('<i class="icon-question-sign get-help"> </i>');
+ 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.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="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-mini" data-toggle="modal"><i class="icon-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><label class="checkbox">'+col.title+'<input type="checkbox" id="checkbox-'+ col.field_name +'" class="col-toggle" value="'+col.field_name+'" /></label></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("muted");
+ togglerInput.attr("disabled", "disabled");
+ }
+
+ if (col.hidden) {
+ defaultHiddenCols.push(col.field_name);
+ }
+
+ editColMenu.append(toggler);
+ } /* End for each column */
+
+ tableChromeDone = true;
+ }
+
+ /* Toggles the active state of the filter button */
+ function filterBtnActive(filterBtn, active){
+ if (active) {
+ filterBtn.addClass("btn-primary");
+
+ filterBtn.tooltip({
+ html: true,
+ title: '<button class="btn btn-small 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.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");
+ }
+ }
+ }
+
+ function sortColumnClicked(e){
+ e.preventDefault();
+
+ /* We only have one sort at a time so remove any existing sort indicators */
+ $("#"+ctx.tableName+" th .icon-caret-down").hide();
+ $("#"+ctx.tableName+" th .icon-caret-up").hide();
+ $("#"+ctx.tableName+" th a").removeClass("sorted");
+
+ var fieldName = $(this).data('field-name');
+
+ /* if we're already sorted sort the other way */
+ if (tableParams.orderby === fieldName &&
+ tableParams.orderby.indexOf('-') === -1) {
+ tableParams.orderby = '-' + $(this).data('field-name');
+ $(this).parent().children('.icon-caret-up').show();
+ } else {
+ tableParams.orderby = $(this).data('field-name');
+ $(this).parent().children('.icon-caret-down').show();
+ }
+
+ $(this).addClass("sorted");
+
+ loadData(tableParams);
+ }
+
+ 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 */
+ if (col === tableParams.orderby ||
+ '-' + col === tableParams.orderby){
+ tableParams.orderby = null;
+ $("#"+ctx.tableName +" .default-orderby").click();
+ }
+ }
+
+ /* 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">' +
+ '<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 + '">' +
+ '<label class="filter-title' +
+ (hasNoRecords ? ' muted' : '') + '"' +
+ ' 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">' +
+ '<input type="radio" name="filter"' +
+ ' value="' + filterName + '" ' +
+ ' id="' + filterName + '">' +
+ '<input type="hidden" name="filter_value" value=""' +
+ ' data-value-for="' + filterName + '">' +
+ '<label class="filter-title"' +
+ ' for="' + filterName + '">' +
+ filterActionData.title +
+ '</label>' +
+ '<input type="text" maxlength="10" class="input-small"' +
+ ' data-date-from-for="' + filterName + '">' +
+ '<span class="help-inline">to</span>' +
+ '<input type="text" maxlength="10" class="input-small"' +
+ ' data-date-to-for="' + filterName + '">' +
+ '<span class="help-inline get-help">(yyyy-mm-dd)</span>' +
+ '</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-role="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.children('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);
+
+ $(this).parent().modal('hide');
+ });
+}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/tests/test.js b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/tests/test.js
new file mode 100644
index 000000000..aac0ba60a
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/tests/test.js
@@ -0,0 +1,175 @@
+"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",
+ "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",
+ "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",
+ "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.projectPageUrl, function(prjInfo){
+ assert.ok(prjInfo.machine.name);
+ assert.ok(prjInfo.releases.length > 0);
+ 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"
+};
+
+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.projectPageUrl, function(prjInfo){
+ var origNumLayers = prjInfo.layers.length;
+
+ libtoaster.addRmLayer(layer, true, function(deps){
+ libtoaster.getProjectInfo(libtoaster.ctx.projectPageUrl,
+ 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('typeahead'));
+ assert.ok(layersT.data('typeahead'));
+ assert.ok(projectsT.data('typeahead'));
+ assert.ok(recipesT.data('typeahead'));
+});
+
+
+
+/* Page init functions */
+
+QUnit.test("Import layer page init", function(assert){
+ assert.throws(importLayerPageInit());
+});
+
+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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/ui-bootstrap-tpls-0.11.0.js b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/ui-bootstrap-tpls-0.11.0.js
new file mode 100644
index 000000000..fa6a86131
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/static/js/ui-bootstrap-tpls-0.11.0.min.js b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/tablefilter.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/tablefilter.py
new file mode 100644
index 000000000..9d15bcff0
--- /dev/null
+++ b/import-layers/yocto-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.iteritems():
+ data[filter_name] = table_filter.to_json()
+
+ return data
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/tables.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/tables.py
new file mode 100644
index 000000000..2cc2f4eb7
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/tables.py
@@ -0,0 +1,1503 @@
+#
+# 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
+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 %}">
+ <code>{{data.layer.vcs_url}}</code>
+ </a>
+ {% if data.get_vcs_link_url %}
+ <a target="_blank" href="{{ data.get_vcs_link_url }}">
+ <i class="icon-share get-info"></i>
+ </a>
+ {% endif %}
+ '''
+
+ self.add_column(title="Git repository URL",
+ help_text="The Git repository for the layer source code",
+ hidden=True,
+ static_data_name="layer__vcs_url",
+ static_data_template=git_url_template)
+
+ git_dir_template = '''
+ <a href="{% url 'layerdetails' extra.pid data.id %}">
+ <code>{{data.dirpath}}</code>
+ </a>
+ {% if data.dirpath and data.get_vcs_dirpath_link_url %}
+ <a target="_blank" href="{{ data.get_vcs_dirpath_link_url }}">
+ <i class="icon-share get-info"></i>
+ </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 = '''
+ {% load projecttags %}
+ {% with vcs_ref=data.get_vcs_reference %}
+ {% if vcs_ref|is_shaid %}
+ <a class="btn" data-content="<ul class='unstyled'> <li>{{vcs_ref}}</li> </ul>">
+ {{vcs_ref|truncatechars:10}}
+ </a>
+ {% else %}
+ {{vcs_ref}}
+ {% endif %}
+ {% endwith %}
+ '''
+
+ 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" title="<a href='{% url "layerdetails" extra.pid data.id %}'>{{data.layer.name}}</a> dependencies"
+ data-content="<ul class='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" %}')
+
+ project = Project.objects.get(pk=kwargs['pid'])
+ self.add_column(title="LayerDetailsUrl",
+ displayable = False,
+ field_name="layerdetailurl",
+ computation = lambda x: reverse('layerdetails', args=(project.id, x.id)))
+
+ self.add_column(title="name",
+ displayable = False,
+ field_name="name",
+ computation = lambda x: x.layer.name)
+
+
+class MachinesTable(ToasterTable):
+ """Table of Machines in Toaster"""
+
+ def __init__(self, *args, **kwargs):
+ super(MachinesTable, self).__init__(*args, **kwargs)
+ self.empty_state = "No machines maybe you need to do a build?"
+ 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"><i class="icon-share get-info"></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-block select-machine-btn" {% if extra.in_prj == 0%}disabled="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 can configure a layer source then run a build."
+
+ build_col = { 'title' : "Build",
+ 'help_text' : "Add or delete recipes to and from 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'] = map(lambda prjlayer: prjlayer.layercommit.id, 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">
+ <i class="icon-share get-info"></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")
+
+ self.add_column(title="Git revision",
+ hidden=True,
+ field_name="layer_version__get_vcs_reference")
+
+
+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 ='<button class="btn btn-block build-recipe-btn" data-recipe-name="{{data.name}}" {%if extra.in_prj == 0 %}disabled="disabled"{%endif%}>Build recipe</button>'
+
+ 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)
+ 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 = '''
+ <code>{{data.name}}_{{data.version}}.bb</code>
+ <a href="{% url 'customrecipedownload' extra.pid data.pk %}">
+ <i class="icon-download-alt" data-original-title="Download recipe
+ file"></i>
+ </a>'''
+
+ self.add_column(title="Recipe file",
+ static_data_name='recipe_file_download',
+ static_data_template=recipe_file_template)
+
+ approx_packages_template = '''
+ <a href="{% url 'customrecipe' extra.pid data.id %}">
+ {{data.get_all_packages.count}}
+ </a>'''
+
+ self.add_column(title="Approx packages",
+ static_data_name='approx_packages',
+ static_data_template=approx_packages_template)
+
+
+ build_btn_template = '''
+ <button data-recipe-name="{{data.name}}"
+ class="btn btn-block build-recipe-btn" style="margin-top: 5px;" >
+ 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.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,
+ static_data_name="size",
+ static_data_template="{% load projecttags %} \
+ {{data.size|filtered_filesizeformat}}")
+
+ self.add_column(title="License",
+ field_name="license",
+ orderable=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')
+
+ 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">
+ <a href="{% project_url data %}">
+ {{data.updated | date:"d/m/y H:i"}}
+ </a>
+ </span>
+ '''
+
+ release_template = '''
+ <span data-project-field="release">
+ {% if data.release %}
+ <a href="{% url 'project' data.id %}#project-details">
+ {{data.release.name}}
+ </a>
+ {% elif data.is_default %}
+ <span class="muted">Not applicable</span>
+ <i class="icon-question-sign get-help hover-help"
+ data-original-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;">
+ </i>
+ {% else %}
+ No release available
+ {% endif %}
+ </span>
+ '''
+
+ machine_template = '''
+ <span data-project-field="machine">
+ {% if data.is_default %}
+ <span class="muted">Not applicable</span>
+ <i class="icon-question-sign get-help hover-help"
+ data-original-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;"></i>
+ {% else %}
+ <a href="{% url 'project' data.id %}#machine-distro">
+ {{data.get_current_machine_name}}
+ </a>
+ {% 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>
+ {% else %}
+ <span class="muted">0</span>
+ {% endif %}
+ '''
+
+ last_build_outcome_template = '''
+ {% if data.get_number_of_builds > 0 %}
+ <a href="{% url 'builddashboard' data.get_last_build_id %}">
+ {% if data.get_last_outcome == extra.Build.SUCCEEDED %}
+ <i class="icon-ok-sign success"></i>
+ {% elif data.get_last_outcome == extra.Build.FAILED %}
+ <i class="icon-minus-sign error"></i>
+ {% endif %}
+ </a>
+ {% 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 error"
+ 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 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 %}
+ <a href="{% url "builddashboard" data.get_last_build_id %}#images">
+ {{data.get_last_build_extensions}}
+ </a>
+ {% 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='Number of 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 = '''
+ <a href="{% url "builddashboard" data.id %}">
+ {% if data.outcome == data.SUCCEEDED %}
+ <i class="icon-ok-sign success"></i>
+ {% elif data.outcome == data.FAILED %}
+ <i class="icon-minus-sign error"></i>
+ {% endif %}
+ </a>
+
+ {% if data.cooker_log_path %}
+ &nbsp;
+ <a href="{% url "build_artifact" data.id "cookerlog" data.id %}">
+ <i class="icon-download-alt get-help"
+ data-original-title="Download build log"></i>
+ </a>
+ {% endif %}
+ '''
+
+ recipe_template = '''
+ {% for target_label in data.target_labels %}
+ <a href="{% url "builddashboard" data.id %}">
+ {{target_label}}
+ </a>
+ <br />
+ {% endfor %}
+ '''
+
+ machine_template = '''
+ <a href="{% url "builddashboard" data.id %}">
+ {{data.machine}}
+ </a>
+ '''
+
+ started_on_template = '''
+ <a href="{% url "builddashboard" data.id %}">
+ {{data.started_on | date:"d/m/y H:i"}}
+ </a>
+ '''
+
+ completed_on_template = '''
+ <a href="{% url "builddashboard" data.id %}">
+ {{data.completed_on | date:"d/m/y H:i"}}
+ </a>
+ '''
+
+ failed_tasks_template = '''
+ {% if data.failed_tasks.count == 1 %}
+ <a href="{% url "task" data.id data.failed_tasks.0.id %}">
+ <span class="error">
+ {{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 %}">
+ <i class="icon-download-alt"
+ data-original-title="Download task log file">
+ </i>
+ </a>
+ {% elif data.failed_tasks.count > 1 %}
+ <a href="{% url "tasks" data.id %}?filter=outcome%3A{{extra.Task.OUTCOME_FAILED}}">
+ <span class="error">{{data.failed_tasks.count}} tasks</span>
+ </a>
+ {% endif %}
+ '''
+
+ errors_template = '''
+ {% if data.errors_no %}
+ <a class="errors.count error" 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 warning" href="{% url "builddashboard" data.id %}#warnings">
+ {{data.warnings_no}} warning{{data.warnings_no|pluralize}}
+ </a>
+ {% endif %}
+ '''
+
+ time_template = '''
+ {% load projecttags %}
+ <a href="{% url "buildtime" data.id %}">
+ {{data.timespent_seconds | sectohms}}
+ </a>
+ '''
+
+ image_files_template = '''
+ {% if data.outcome == extra.Build.SUCCEEDED %}
+ <a href="{% url "builddashboard" data.id %}#images">
+ {{data.get_image_file_extensions}}
+ </a>
+ {% 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 %}
+ <i class="icon-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;"></i>
+ {% 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)
+
+ project = Project.objects.get(pk=self.project_id)
+ context['mru'] = Build.get_recent(project)
+ context['project'] = project
+
+ return context
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/base.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/base.html
new file mode 100644
index 000000000..210cf3360
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/base.html
@@ -0,0 +1,126 @@
+<!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-responsive.min.css' %}" type='text/css'/>
+ <link rel="stylesheet" href="{% static 'css/font-awesome.min.css' %}" type='text/css'/>
+ <link rel="stylesheet" href="{% static 'css/prettify.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/prettify.js' %}">
+ </script>
+ <script src="{% static 'js/libtoaster.js' %}">
+ </script>
+ {% if DEBUG %}
+ <script>
+ libtoaster.debug = true;
+ </script>
+ {% endif %}
+ <script>
+ 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}},
+ 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}},
+ projectBuildsUrl: {% url 'projectbuilds' project.id as pburl %}{{pburl|json}},
+ xhrCustomRecipeUrl : "{% url 'xhr_customrecipe' %}",
+ projectId : {{project.id}},
+ xhrBuildRequestUrl: "{% url 'xhr_buildrequest' project.id %}",
+ {% else %}
+ projectId : undefined,
+ projectPageUrl : undefined,
+ projectName : undefined,
+ {% endif %}
+ };
+ </script>
+ {% block extraheadcontent %}
+ {% endblock %}
+ </head>
+
+ <body style="height: 100%">
+
+ {% csrf_token %}
+ <div id="loading-notification" class="alert lead text-center" style="display:none">
+ Loading <i class="fa-pulse icon-spinner"></i>
+ </div>
+
+ <div id="change-notification" class="alert lead alert-info" style="display:none">
+ <button type="button" class="close" id="hide-alert">&times;</button>
+ <span id="change-notification-msg"></span>
+ </div>
+
+ <div class="navbar navbar-fixed-top">
+ <div class="navbar-inner">
+ <div class="container-fluid">
+ <a class="brand logo" href="#"><img src="{% static 'img/logo.png' %}" class="" alt="Yocto logo project"/></a>
+ <span class="brand">
+ <a href="/">Toaster</a>
+ {% if DEBUG %}
+ <i class="icon-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 %}
+ </span>
+ {% if request.resolver_match.url_name != 'landing' and request.resolver_match.url_name != 'newproject' %}
+ <ul class="nav">
+ <li {% if request.resolver_match.url_name == 'all-builds' %}
+ class="active"
+ {% endif %}>
+ <a href="{% url 'all-builds' %}">
+ <i class="icon-tasks"></i>
+ All builds
+ </a>
+ </li>
+ <li {% 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>
+ </ul>
+ {% endif %}
+ <ul class="nav pull-right">
+ <li>
+ <a target="_blank" href="http://www.yoctoproject.org/docs/latest/toaster-manual/toaster-manual.html">
+ <i class="icon-book"></i>
+ Manual
+ </a>
+ </li>
+ </ul>
+ <span class="pull-right divider-vertical"></span>
+ <div class="btn-group pull-right">
+ <a class="btn" id="new-project-button" href="{% url 'newproject' %}">New project</a>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="container-fluid top-padded">
+ <div class="row-fluid">
+ {% block pagecontent %}
+ {% endblock %}
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/basebuilddetailpage.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/basebuilddetailpage.html
new file mode 100644
index 000000000..a62e0b1cb
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/basebuilddetailpage.html
@@ -0,0 +1,32 @@
+{% extends "base.html" %}
+{% load project_url_tag %}
+{% load humanize %}
+{% block pagecontent %}
+
+<div class="row-fluid">
+<!-- Breadcrumbs -->
+ <div class="section">
+ <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> <!--section-->
+
+ <!-- Begin container -->
+ {% block pagedetailinfomain %}{% endblock %}
+ <!-- End container -->
+
+</div>
+
+{% endblock %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/basebuildpage.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/basebuildpage.html
new file mode 100644
index 000000000..0d8c8820d
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/basebuildpage.html
@@ -0,0 +1,157 @@
+{% extends "base.html" %}
+{% load projecttags %}
+{% load project_url_tag %}
+{% load objects_to_dictionaries_filter %}
+{% load humanize %}
+{% block pagecontent %}
+ <!-- breadcrumbs -->
+ <div class="section">
+ <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>
+ <script>
+ $( function () {
+ $('#breadcrumb > li').append('<span class="divider">&rarr;</span>');
+ $('#breadcrumb > li:last').addClass("active");
+ $('#breadcrumb > li:last > span').remove();
+ });
+ </script>
+ </div>
+
+ <div class="row-fluid">
+ <!-- begin left sidebar container -->
+ <div id="nav" class="span2">
+ <ul class="nav nav-list well">
+ <li
+ {% if request.resolver_match.url_name == 'builddashboard' %}
+ class="active"
+ {% endif %} >
+ <a class="nav-parent" href="{% url 'builddashboard' build.pk %}">Build summary</a>
+ </li>
+ {% if build.target_set.all.0.is_image and build.outcome == 0 %}
+ <li class="nav-header">Images</li>
+ {% block nav-target %}
+ {% for t in build.get_sorted_target_list %}
+ <li><a href="{% url 'target' build.pk t.pk %}">{{t.target}}</a><li>
+ {% endfor %}
+ {% endblock %}
+ {% endif %}
+ <li class="nav-header">Build</li>
+ {% block nav-configuration %}
+ <li><a href="{% url 'configuration' build.pk %}">Configuration</a></li>
+ {% endblock %}
+ {% block nav-tasks %}
+ <li><a href="{% url 'tasks' build.pk %}">Tasks</a></li>
+ {% endblock %}
+ {% block nav-recipes %}
+ <li><a href="{% url 'recipes' build.pk %}">Recipes</a></li>
+ {% endblock %}
+ {% block nav-packages %}
+ <li><a href="{% url 'packages' build.pk %}">Packages</a></li>
+ {% endblock %}
+ <li class="nav-header">Performance</li>
+ {% block nav-buildtime %}
+ <li><a href="{% url 'buildtime' build.pk %}">Time</a></li>
+ {% endblock %}
+ {% block nav-cputime %}
+ <li><a href="{% url 'cputime' build.pk %}">CPU usage</a></li>
+ {% endblock %}
+ {% block nav-diskio %}
+ <li><a href="{% url 'diskio' build.pk %}">Disk I/O</a></li>
+ {% endblock %}
+
+ <li class="divider"></li>
+
+ <li>
+ <p class="navbar-btn">
+ <a class="btn btn-block" href="{% url 'build_artifact' build.id 'cookerlog' build.id %}">
+ Download build log
+ </a>
+ </p>
+ </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>
+ <p class="navbar-btn" data-role="edit-custom-image-trigger">
+ <button class="btn btn-block">Edit custom image</button>
+ {% 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>
+ </p>
+ </li>
+ {% endif %}
+ {% endwith %}
+
+ <li>
+ <!-- new custom image from image recipe in this build -->
+ <p class="navbar-btn" data-role="new-custom-image-trigger">
+ <button class="btn btn-block">New custom image</button>
+ </p>
+ {% 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>
+ </li>
+ </ul>
+
+ </div>
+ <!-- end left sidebar container -->
+
+ <!-- begin right container -->
+ {% block buildinfomain %}{% endblock %}
+ <!-- end right container -->
+ </div>
+{% endblock %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/baseprojectbuildspage.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/baseprojectbuildspage.html
new file mode 100644
index 000000000..229cd17ba
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/baseprojectpage.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/baseprojectpage.html
new file mode 100644
index 000000000..8778305f3
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/baseprojectpage.html
@@ -0,0 +1,45 @@
+{% extends "base.html" %}
+
+{% load projecttags %}
+{% load humanize %}
+
+{% block title %} {{title}} - {{project.name}} - Toaster {% endblock %}
+
+{% block pagecontent %}
+
+{% 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>
+
+<div class="row-fluid">
+ <!-- only on config pages -->
+ <div id="config-nav" class="span2">
+ <ul class="nav nav-list well">
+ <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 class="nav-header">Extra configuration</li>
+ <li><a href="{% url 'projectconf' project.id %}">BitBake variables</a></li>
+ </ul>
+ </div>
+ <div class="span10">
+ {% block projectinfomain %}{% endblock %}
+ </div>
+</div>
+
+{% endblock %}
+
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/basetable_bottom.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/basetable_bottom.html
new file mode 100644
index 000000000..ce023f51a
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/basetable_bottom.html
@@ -0,0 +1,94 @@
+ </tbody>
+ </table>
+
+<!-- Show pagination controls -->
+<div class="pagination pagination-centered">
+ <div class="pull-left">
+ Showing {{objects.start_index}} to {{objects.end_index}} out of {{objects.paginator.count}} entries.
+ </div>
+
+ <ul class="pagination" style="display: block-inline">
+{%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>
+ <div class="pull-right">
+ <span class="help-inline" style="padding-top:5px;">Show rows:</span>
+ <select style="margin-top:5px;margin-bottom:0px;" class="pagesize">
+ {% with "10 25 50 100 150" as list%}
+ {% for i in list.split %}
+ <option value="{{i}}">{{i}}</option>
+ {% endfor %}
+ {% endwith %}
+ </select>
+ </div>
+</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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/basetable_top.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/basetable_top.html
new file mode 100644
index 000000000..0ddd74904
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/basetable_top.html
@@ -0,0 +1,239 @@
+{% 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">
+ <div class="navbar-inner">
+ <form class="navbar-search input-append pull-left span6" id="searchform">
+ <input 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()" class="add-on btn" tabindex="-1"><i class="icon-remove"></i></a>{%endif%}
+ <input type="hidden" name="orderby" value="{{request.GET.orderby}}">
+ <input type="hidden" name="page" value="1">
+ <button class="btn" id="search-button" type="submit" value="Search">Search</button>
+ </form>
+ <div class="pull-right">
+{% if tablecols %}
+ <div class="btn-group">
+ <button id="edit-columns-button" class="btn dropdown-toggle" data-toggle="dropdown">Edit columns
+ <span class="caret"></span>
+ </button>
+<!--
+ {{tablecols|sortcols}}
+-->
+ <ul id='editcol' class="dropdown-menu">
+ {% for i in tablecols|sortcols %}
+ <li>
+ <label {% if not i.clclass %} class="checkbox muted" {%else%} class="checkbox" {%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>
+ </li>
+ {% endfor %}
+ </ul>
+ </div>
+{% endif %}
+ <div style="display:inline">
+ <span class="divider-vertical"></span>
+ <span class="help-inline" style="padding-top:5px;">Show rows:</span>
+ <select style="margin-top:5px;margin-bottom:0px;" class="pagesize">
+ {% with "10 25 50 100 150" as list%}
+ {% for i in list.split %}
+ <option value="{{i}}">{{i}}</option>
+ {% endfor %}
+ {% endwith %}
+ </select>
+ </div>
+ </div>
+ </div> <!-- navbar-inner -->
+</div>
+
+<!-- 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%}<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%}
+ {%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-small 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="icon-filter filtered"></i> </a>
+ </div>{%endif%}
+ </th>{% endfor %}
+ </tr>
+ </thead>
+ <tbody>
+
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/basetable_top_layers.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/basetable_top_layers.html
new file mode 100644
index 000000000..722091b2d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/bfile.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/bfile.html
new file mode 100644
index 000000000..c7f59434a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/bpackage.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/bpackage.html
new file mode 100644
index 000000000..81973cbc6
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/bpackage.html
@@ -0,0 +1,108 @@
+{% extends "basebuildpage.html" %}
+
+{% load projecttags %}
+
+{% block title %} Packages built - {{build.target_set.all|dictsort:"target"|join:", "}} {{build.machine}} - {{build.project.name}} - Toaster {% endblock %}
+{% block localbreadcrumb %}
+<li>Packages</li>
+{% endblock %}
+
+{% block nav-packages %}
+ <li class="active"><a href="{% url 'packages' build.pk %}">Packages</a></li>
+{% endblock %}
+
+{% block buildinfomain %}
+<div class="span10">
+
+{% if not request.GET.filter and not request.GET.search and not objects.paginator.count %}
+
+<!-- Empty - no data in database -->
+<div class="page-header">
+ <h1>
+ Packages
+ </h1>
+</div>
+<div class="alert alert-info lead">
+ <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.
+</div>
+
+{% else %}
+
+<div class="page-header">
+ <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%}
+ Packages
+ {%endif%}
+ </h1>
+</div>
+
+ {% if objects.paginator.count == 0 %}
+ <div class="row-fluid">
+ <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="add-on btn" tabindex="-1"><i class="icon-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 packages</button>
+ </form>
+ </div>
+ </div>
+
+ {% else %}
+ {% include "basetable_top.html" %}
+
+ {% for package in objects %}
+
+ <tr class="data">
+
+ <!-- Package -->
+ <td class="package_name"><a href="{% url "package_built_detail" build.pk package.pk %}">{{package.name}}</a></td>
+ <!-- Package Version -->
+ <td class="package_version">{%if package.version%}<a href="{% url "package_built_detail" build.pk package.pk %}">{{package.version}}-{{package.revision}}</a>{%endif%}</td>
+ <!-- Package Size -->
+ <td class="size sizecol">{{package.size|filtered_filesizeformat}}</td>
+ <!-- License -->
+ <td class="license">{{package.license}}</td>
+
+ {%if package.recipe%}
+ <!-- Recipe -->
+ <td class="recipe__name"><a href="{% url "recipe" build.pk package.recipe.pk %}">{{package.recipe.name}}</a></td>
+ <!-- Recipe Version -->
+ <td class="recipe__version"><a href="{% url "recipe" build.pk package.recipe.pk %}">{{package.recipe.version}}</a></td>
+
+ <!-- Layer -->
+ <td class="recipe__layer_version__layer__name">{{package.recipe.layer_version.layer.name}}</td>
+ <!-- Layer branch -->
+ <td class="recipe__layer_version__branch">{{package.recipe.layer_version.branch}}</td>
+ <!-- Layer commit -->
+ <td class="recipe__layer_version__layer__commit">
+ <a class="btn"
+ data-content="<ul class='unstyled'>
+ <li>{{package.recipe.layer_version.commit}}</li>
+ </ul>">
+ {{package.recipe.layer_version.commit|truncatechars:13}}
+ </a>
+ </td>
+ <!-- Layer directory -->
+ {%else%}
+ <td class="recipe__name"></td>
+ <td class="recipe__version"></td>
+ <td class="recipe__layer_version__layer__name"></td>
+ <td class="recipe__layer_version__branch"></td>
+ <td class="recipe__layer_version__layer__commit"></td>
+ <td class="recipe__layer_version__local_path"></td>
+ {%endif%}
+
+ </tr>
+ {% endfor %}
+
+ {% include "basetable_bottom.html" %}
+ {% endif %} {# objects.paginator.count #}
+{% endif %} {# Empty #}
+</div>
+{% endblock %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/brtargets.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/brtargets.html
new file mode 100644
index 000000000..4ebd05879
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/builddashboard.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/builddashboard.html
new file mode 100644
index 000000000..a0da71ea4
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/builddashboard.html
@@ -0,0 +1,278 @@
+{% extends "basebuildpage.html" %}
+{% load humanize %}
+{% load projecttags %}
+
+{% block title %} {{build.target_set.all|dictsort:"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="row-fluid span10">
+ <div class="page-header">
+ <h1>{{build.target_set.all|dictsort:"target"|join:", "}} {{build.machine}}</h1>
+ </div>
+</div>
+
+<!-- build result bar -->
+<div class="row-fluid span10 pull-right">
+ <div class="alert {%if build.outcome == build.SUCCEEDED%}alert-success{%elif build.outcome == build.FAILED%}alert-error{%else%}alert-info{%endif%}">
+ <div class="row-fluid lead">
+ <span class="pull-left"><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 %}
+&nbsp;with
+{% endif %}
+{%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
+{% if build.errors.count %}
+ <span > <i class="icon-minus-sign red"></i><strong><a href="#errors" class="error show-errors"> {{build.errors.count}} error{{build.errors.count|pluralize}}</a></strong></span>
+{% endif %}
+{% if build.warnings.count %}
+{% if build.errors.count %}
+ and
+{% endif %}
+ <span > <i class="icon-warning-sign yellow"></i><strong><a href="#warnings" class="warning show-warnings"> {{build.warnings.count}} warning{{build.warnings.count|pluralize}}</a></strong></span>
+{% endif %}
+ <span class="pull-right">Build time: <a href="{% url 'buildtime' build.pk %}">{{ build.timespent_seconds|sectohms }}</a>
+ {% if build.cooker_log_path %}
+ <a class="btn {%if build.outcome == build.SUCCEEDED%}btn-success{%else%}btn-danger{%endif%} pull-right log" href="{% url 'build_artifact' build.id "cookerlog" build.id %}">Download build log</a>
+ {% endif %}
+ </span>
+
+{%endif%}
+ </div>
+ </div>
+</div>
+
+{% if build.errors.count %}
+<div class="accordion span10 pull-right" id="errors">
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a class="accordion-toggle error toggle-errors">
+ <h2 id="error-toggle">
+ <i class="icon-minus-sign"></i>
+ {{build.errors.count}} error{{build.errors.count|pluralize}}
+ </h2>
+ </a>
+ </div>
+ <div class="accordion-body collapse in" id="collapse-errors">
+ <div class="accordion-inner">
+ <div class="span10">
+ {% for error in build.errors %}
+ <div class="alert alert-error" data-error="{{ error.id }}">
+ <pre>{{error.message}}</pre>
+ </div>
+ {% endfor %}
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+{% endif %}
+
+{%if build.outcome == build.SUCCEEDED%}
+<!-- built images -->
+{% if hasImages %}
+<div class="row-fluid span10 pull-right">
+ <h2>Images</h2>
+ {% for target in targets %}
+ {% if target.target.is_image %}
+ <div class="well dashboard-section">
+ <h3><a href="{% url 'target' build.pk target.target.pk %}">{{target.target}}</a>
+ </h3>
+ <dl class="dl-horizontal">
+ <dt>Packages included</dt>
+ <dd><a href="{% url 'target' build.pk target.target.pk %}">{{target.npkg}}</a></dd>
+ <dt>Total package size</dt>
+ <dd>{{target.pkgsz|filtered_filesizeformat}}</dd>
+ {% if target.targetHasNoImages %}
+ </dl>
+ <div class="row-fluid">
+ <div class="alert alert-info span7">
+ <p>
+ <b>This build did not create any image files</b>
+ </p>
+ <p>
+ This is probably because valid image and license manifest
+ files from a previous build already exist in your
+ <code>.../poky/build/tmp/deploy</code>
+ directory. You can
+ also <a href="{% url 'targetpkg' build.pk target.target.pk %}">view the
+ license manifest information</a> in Toaster.
+ </p>
+ </div>
+ </div>
+ {% else %}
+ <dt>
+ <i class="icon-question-sign get-help" title="The location in disk of the license manifest, a document listing all packages installed in your image and their licenses"></i>
+
+ License manifest
+ </dt>
+ <dd>
+ <a href="{% url 'targetpkg' build.pk target.target.pk %}">View in Toaster</a> |
+ <a href="{% url 'build_artifact' build.pk 'licensemanifest' target.target.pk %}">Download</a></dd>
+ <dt>
+ <i class="icon-question-sign get-help" title="Image files are stored in <code>/build/tmp/deploy/images/</code>"></i>
+ Image files
+ </dt>
+ <dd>
+ <ul>
+ {% for i in target.imageFiles %}
+ <li>
+ <a href="{% url 'build_artifact' build.pk 'imagefile' i.id %}">
+ {{i.suffix}}
+ </a>
+ &nbsp;({{i.size|filtered_filesizeformat}})
+ </li>
+ {% endfor %}
+ </ul>
+ </dd>
+ </dl>
+ {% endif %}
+ </div>
+ {% endif %}
+ {% endfor %}
+</div>
+{% endif %}
+
+{%else%}
+<!-- error dump -->
+{%endif%}
+
+<!-- other artifacts -->
+{% if build.buildartifact_set.all.count > 0 %}
+<div class="row-fluid span10 pull-right">
+<h2>Other artifacts</h2>
+
+ <div class="well dashboard-section">
+ <dl class="dl-horizontal">
+ <dt>
+ <i class="icon-question-sign get-help" title="Build artifacts discovered in <i>tmp/deploy/images</i>. Usually kernel images and kernel modules."></i>
+ 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>
+
+</div>
+{% endif %}
+<!-- build summary -->
+<div class="row-fluid span10 pull-right">
+<h2>Build summary</h2>
+ <div class="well span4 dashboard-section" style="margin-left:0px;">
+ <h4><a href="{%url 'configuration' build.pk%}">Configuration</a></h4>
+ <dl>
+ <dt>Machine</dt><dd>{{build.machine}}</dd>
+ <dt>Distro</dt><dd>{{build.distro}}</dd>
+ <dt>Layers</dt>{% for i in build.layer_version_build.all|dictsort:"layer.name" %}<dd>{{i.layer.name}}</dd>{%endfor%}
+ </dl>
+ </div>
+ <div class="well span4 dashboard-section">
+ <h4><a href="{%url 'tasks' build.pk%}">Tasks</a></h4>
+ <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="error" 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 %}">
+ <i class="icon-download-alt" title="" data-original-title="Download task log file"></i>
+ </a>
+
+ {% elif exectask.count > 1%}
+ <a class="error" href="{% url "tasks" build.id %}?filter=outcome%3A4">{{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
+ <i class="icon-question-sign get-help" title="'Executed' tasks are those that need to be run in order to generate the task output"></i>
+ </dt>
+ <dd><a href="{% url 'tasks' build.pk %}?filter=task_executed%3A1&amp;count=25&amp;search=&amp;page=1&amp;orderby=order%3A%2B">{% query build.task_build task_executed=1 order__gt=0 as exectask%}{{exectask.count}}</a></dd>
+ <dt>
+ Tasks not executed
+ <i class="icon-question-sign get-help" title="'Not executed' tasks don't need to run because their outcome is provided by another task"></i>
+ </dt>
+ <dd><a href="{% url 'tasks' build.pk %}?filter=task_executed%3A0&amp;count=25&amp;search=&amp;page=1&amp;orderby=order%3A%2B">{% query build.task_build task_executed=0 order__gt=0 as noexectask%}{{noexectask.count}}</a></dd>
+ <dt>
+ Reuse
+ <i class="icon-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"></i>
+ </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 class="well span4 dashboard-section">
+ <h4><a href="{% url 'recipes' build.pk %}">Recipes</a> & <a href="{% url 'packages' build.pk %}">Packages</a></h4>
+ <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>
+
+{% if build.warnings.count %}
+<div class="accordion span10 pull-right" id="warnings">
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a class="accordion-toggle warning toggle-warnings">
+ <h2 id="warning-toggle">
+ <i class="icon-warning-sign"></i>
+ {{build.warnings.count}} warning{{build.warnings.count|pluralize}}
+ </h2>
+ </a>
+ </div>
+ <div class="accordion-body collapse" id="collapse-warnings">
+ <div class="accordion-inner">
+ <div class="span10">
+ {% for warning in logmessages %}{% if warning.level == 1 %}
+ <div class="alert alert-warning">
+ <pre>{{warning.message}}</pre>
+ </div>
+ {% endif %}{% endfor %}
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+{% endif %}
+
+<script type="text/javascript">
+ $(document).ready(function() {
+ //show warnings section when requested from the previous page
+ if (location.href.search('#warnings') > -1) {
+ $('#collapse-warnings').addClass('in');
+ }
+ });
+</script>
+
+{% endblock %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/buildrequestdetails.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/buildrequestdetails.html
new file mode 100644
index 000000000..70fa1fb9a
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/buildrequestdetails.html
@@ -0,0 +1,64 @@
+{% extends "baseprojectpage.html" %}
+
+{% load static %}
+{% load projecttags %}
+{% load humanize %}
+
+
+{% block projectinfomain %}
+ <!-- begin content -->
+
+ <div class="row-fluid">
+
+ <!-- end left sidebar container -->
+ <!-- Begin right container -->
+ <div class="span10">
+ <div class="page-header">
+ <h1>
+ <span data-toggle="tooltip" {%if buildrequest.brtarget_set.all.count > 1%}title="Targets: {%for target in buildrequest.brtarget_set.all%}{{target.target}} {%endfor%}"{%endif%}>{{buildrequest.brtarget_set.all.0.target}} {%if buildrequest.brtarget_set.all.count > 1%}(+ {{buildrequest.brtarget_set.all.count|add:"-1"}}){%endif%} {{buildrequest.get_machine}} </span>
+
+ </h1>
+ </div>
+ <div class="alert alert-error">
+ <p class="lead">
+ <strong>Failed</strong>
+ on {{ buildrequest.updated|date:'d/m/y H:i' }}
+ with
+
+ <i class="icon-minus-sign error" style="margin-left:6px;"></i>
+ <strong><a class="error accordion-toggle toggle-errors" href="#errors">
+ {{buildrequest.brerror_set.all.count}} error{{buildrequest.brerror_set.all.count|pluralize}}
+ </a></strong>
+ <span class="pull-right">Build time: {{buildrequest.get_duration|sectohms}}</span>
+ </p>
+ </div>
+
+ <div class="accordion" id="errors">
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a class="accordion-toggle error toggle-errors">
+ <h2>
+ <i class="icon-minus-sign"></i>
+ {{buildrequest.brerror_set.all.count}} error{{buildrequest.brerror_set.all.count|pluralize}}
+ </h2>
+ </a>
+ </div>
+ <div class="accordion-body collapse in" id="collapse-errors">
+ <div class="accordion-inner">
+ <div class="span10">
+ {% for error in buildrequest.brerror_set.all %}
+ <div class="alert alert-error">
+ ERROR: <div class="air well"><pre>{{error.errmsg}}</pre></div>
+ </div>
+ {% endfor %}
+ </div>
+ </div>
+ </div>
+
+ </div>
+ </div>
+ </div>
+ </div> <!-- end of row-fluid -->
+
+
+{%endblock%}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/builds-toastertable.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/builds-toastertable.html
new file mode 100644
index 000000000..bf13a66bd
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/builds-toastertable.html
@@ -0,0 +1,48 @@
+{% 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-fluid">
+ {% with mru=mru mrb_type=mrb_type %}
+ {% include 'mrb_section.html' %}
+ {% endwith %}
+
+ <h1 class="page-header top-air" data-role="page-title"></h1>
+
+ {% url 'builds' as xhr_table_url %}
+ {% include 'toastertable.html' %}
+ </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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/buildtime.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/buildtime.html
new file mode 100644
index 000000000..ea84ae797
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/buildtime.html
@@ -0,0 +1,4 @@
+{% extends "basebuildpage.html" %}
+{% block localbreadcrumb %}
+<li>Build Time</li>
+{% endblock %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/configuration.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/configuration.html
new file mode 100644
index 000000000..85d6a622a
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/configuration.html
@@ -0,0 +1,72 @@
+{% 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 nav-configuration %}
+ <li class="active"><a href="{% url 'configuration' build.pk %}">Configuration</a></li>
+{% endblock %}
+
+{% block buildinfomain %}
+<!-- page title -->
+<div class="row-fluid span10">
+ <div class="page-header">
+ <h1>Configuration</h1>
+ </div>
+</div>
+
+<!-- configuration table -->
+<div class="row-fluid pull-right span10" id="navTab">
+<ul class="nav nav-pills">
+ <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> {% 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="span9" style="margin-left:0px;">
+ <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>
+ <td>{{lv.branch}}</td>
+ <td> <a class="btn" data-content="<ul class='unstyled'>
+ <li>{{lv.commit}}</li> </ul>">
+ {{lv.commit|truncatechars:13}}
+ </a></td>
+ </tr>{% endfor %}
+ </tbody>
+ </table>
+ </div>
+ </div>
+
+
+</div>
+{% endblock %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/configvars.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/configvars.html
new file mode 100644
index 000000000..e40c225a3
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/configvars.html
@@ -0,0 +1,133 @@
+{% 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 nav-configuration %}
+ <li class="active"><a href="{% url 'configuration' build.pk %}">Configuration</a></li>
+{% endblock %}
+
+{% block buildinfomain %}
+<!-- page title -->
+<div class="row-fluid span10">
+ <div class="page-header">
+ <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>
+</div>
+
+<!-- configuration table -->
+<div class="row-fluid pull-right span10" id="navTab">
+ <ul class="nav nav-pills">
+ <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="row-fluid">
+ <div class="alert">
+ <form class="no-results input-append" id="searchform">
+ <input id="search" name="search" class="input-xxlarge" type="text" value="{% if request.GET.search %}{{request.GET.search}}{% endif %}"/>{% if request.GET.search %}<a href="javascript:$('#search').val('');searchform.submit()" class="add-on btn" tabindex="-1"><i class="icon-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 variables</button>
+ </form>
+ </div>
+ </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"><a data-toggle="modal" href="#variable-{{variable.pk}}">{{variable.variable_value|truncatechars:153}}</a></td>
+ <td class="file"><a data-toggle="modal" href="#variable-{{variable.pk}}">
+ {% if variable.vhistory.all %}
+ {% for path in variable.vhistory.all|filter_setin_files:file_filter %}
+ {{path}}<br/>
+ {% endfor %}
+ {% endif %}
+ </a></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">
+ <i class="icon-share get-info"></i></a>
+ {% endif %}
+ </td>
+ </tr>
+{% endfor %}
+
+{% 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 hide fade" tabindex="-1" role="dialog">
+ <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 class="btn btn-mini full-show">...</a>
+ </span>
+ </p>
+ <a class="btn btn-mini 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>
+ <table class="table table-bordered table-hover">
+ <thead>
+ <tr>
+ <th>Order</th>
+ <th>Configuration file</th>
+ <th>Operation</th>
+ <th>Line number</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for vh in variable.vhistory.all %}
+ <tr>
+ <td>{{forloop.counter}}</td><td>{{vh.file_name}}</td><td>{{vh.operation}}</td><td>{{vh.line_number}}</td>
+ </tr>
+ {%endfor%}
+ </tbody>
+ </table>
+ </div>
+ </div>
+ {% endif %}
+{% endfor %}
+
+</div> <!-- buildinfomain -->
+
+{% endblock %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/cpuusage.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/cpuusage.html
new file mode 100644
index 000000000..02f07b760
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/customise_btn.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/customise_btn.html
new file mode 100644
index 000000000..2e54a9d90
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/customise_btn.html
@@ -0,0 +1,15 @@
+<button class="btn 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-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="icon-plus"></i>
+ Add layer
+</button>
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/customrecipe.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/customrecipe.html
new file mode 100644
index 000000000..ea3c9c732
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/customrecipe.html
@@ -0,0 +1,223 @@
+{% extends "base.html" %}
+{% load projecttags %}
+{% load humanize %}
+{% load static %}
+{% block pagecontent %}
+
+<div class="section">
+ <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>
+</div>
+
+<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 %}",
+ }
+ };
+
+ try {
+ customRecipePageInit(ctx);
+ } catch (e) {
+ document.write("Sorry, An error has occurred loading this page");
+ console.warn(e);
+ }
+ });
+</script>
+<!-- package dependencies modal -->
+<div style="display:none" id="package-deps-modal" class="modal hide fade in" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false">
+ <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 package</button>
+ <button class="btn" data-dismiss="modal">Cancel</button>
+ </div>
+</div>
+<!-- end package dependencies modal -->
+
+<!-- package reverse dependencies modal -->
+<div style="display:none" id="package-reverse-deps-modal" class="modal hide fade in" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false">
+ <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" data-dismiss="modal">Cancel</button>
+ </div>
+</div>
+<!-- end package dependencies modal -->
+
+
+<div class="row-fluid span11">
+ <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 air">
+ <h1>
+ {{recipe.name}}
+ <small>({{recipe.layer_version.layer.name}})</small>
+ </h1>
+ </div>
+</div>
+
+<div class="row-fluid span11">
+ <div class="span8">
+ <div class="button-place btn-group" style="width: 100%">
+ <a class="btn btn-large span6 build-custom-image" href="#" style="width: 50%">
+ Build {{recipe.name}}
+ </a>
+ <a href="{% url 'customrecipedownload' project.id recipe.id %}" class="btn btn-large span6" style="width: 50%">
+ Download recipe file
+ </a>
+ </div>
+ <div id="no-results-special-{{table_name}}" class="air" style="display:none;">
+ <div class="alert">
+ <h3>No packages found</h3>
+ <p>You might consider <a href={% url 'projectsoftwarerecipes' project.id %}>searching the list of recipes</a> instead. 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="input-append no-results">
+ <input type="text" class="input-xlarge no-results-search-input" id="no-results-search-input-{{table_name}}" name="search" placeholder="Search {{title|lower}}" />
+ <a href="#" class="add-on btn" id="no-results-remove-search-btn" tabindex="-1">
+ <i class="icon-remove"></i>
+ </a>
+ <button class="btn 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 air">
+ <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-large 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="span4 well">
+ <h2 style="margin-bottom:20px;">About {{recipe.name}}</h2>
+
+ <dl>
+ <dt>
+ Approx. packages included
+ <i class="icon-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"></i>
+ </dt>
+ <dd id="total-num-packages">{{recipe.get_all_packages.count}}</dd>
+ <dt>
+ Approx. package size
+ <i class="icon-question-sign get-help" title="" data-original-title="Package size is based on information from previous builds, so we can never be sure it is 100% accurate"></i>
+ </dt>
+ <dd id="total-size-packages">{{approx_pkg_size.size__sum|filtered_filesizeformat}}</dd>
+ {% if last_build %}
+ <dt>Last build</dt>
+ <dd>
+ <i class="icon-ok-sign success"></i>
+ <a href="{% url 'projectbuilds' project.id%}">{{last_build.completed_on|date:"d/m/y H:i"}}</a>
+ </dd>
+ {% endif %}
+ <dt>Layer</dt>
+ <dd><a href="{% url 'layerdetails' project.id recipe.layer_version.pk %}">{{recipe.layer_version.layer.name}}</a></dd>
+ <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>
+ <i class="icon-ok-sign success"></i>
+ <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 %}
+ <dt>Recipe file</dt>
+ <dd>
+ <code>{{recipe.name}}_{{recipe.version}}.bb</code>
+ <a href="{% url 'customrecipedownload' project.pk recipe.pk %}"><i class="icon-share" title="" data-original-title="View recipe file"></i></a>
+ </dd>
+ <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}}
+ <i class="icon-question-sign get-help" title="" data-original-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 no-tooltip"></i>
+ <a href="#" class="error" id="delete">Delete custom image</a>
+ -->
+ </div>
+ </div>
+
+ {% endblock %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/detail_pagination_bottom.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/detail_pagination_bottom.html
new file mode 100644
index 000000000..f40c21d99
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/detail_pagination_bottom.html
@@ -0,0 +1,55 @@
+{% 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 class="pagination">
+ <ul>
+{%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>
+
+ <div class="pull-right">
+ <span class="help-inline" style="padding-bottom:10px;">Show rows:</span>
+ <select class="pagesize">
+ {% with "10 25 50 100 150" as list%}
+ {% for i in list.split %}
+ <option value="{{i}}">{{i}}</option>
+ {% endfor %}
+ {% endwith %}
+ </select>
+ </div>
+</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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/detail_search_header.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/detail_search_header.html
new file mode 100644
index 000000000..7bea3f47f
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/detail_search_header.html
@@ -0,0 +1,68 @@
+{% 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>
+<div class="row-fluid">
+{% if objects.paginator.count > 10 or request.GET.search %}
+ {% if objects.paginator.count == 0 %}
+ <div class="alert">
+ <h3>No {{search_what}} found</h3>
+ <form id="searchform" class="input-append">
+ {% else %}
+ <form id="searchform" class="navbar-search input-append pull-left">
+ {% endif %}
+
+ <input id="search" class="input-xlarge" 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 %}
+ <a class="add-on btn search-clear">
+ <i class="icon-remove"></i>
+ </a>
+ {% endif %}
+ <button type="submit" class="btn">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 %}
+ <div class="pull-right">
+ <span class="help-inline" style="padding-top:5px;">Show rows:</span>
+ <select style="margin-top:5px;margin-bottom:0px;" class="pagesize">
+ {% 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>
+ {% endif %}
+{% endif %}
+</div> {# row-fluid #}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/detail_sorted_header.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/detail_sorted_header.html
new file mode 100644
index 000000000..6ce292e5a
--- /dev/null
+++ b/import-layers/yocto-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%}<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%}
+ {% 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-small 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="icon-filter filtered"></i> </a>
+ </div>{%endif%}
+ </th>{% endfor %}
+ </tr>
+ </thead>
+
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/dirinfo.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/dirinfo.html
new file mode 100644
index 000000000..ecb46bf7a
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/dirinfo.html
@@ -0,0 +1,241 @@
+{% 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'>
+ 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.link_to != null) {
+ tr += 'muted ';
+ }
+ 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(o.link_to);
+ 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 += '<i class="icon-folder-close"></i>';
+ 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 + '><i class="icon-file"></i>';
+ }
+ else {
+ name = '<td><i class="icon-hand-right"></i>';
+ }
+ 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="muted"> as ' + o.installed_package + ' </span>';
+ package += '<i class="icon-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 += '</i>';
+ }
+ }
+ 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="span10">
+
+ <div class="page-header">
+ <h1> {{target.target}} </h1>
+ </div>
+
+ <ul class="nav nav-pills">
+ <li class="">
+ <a href="{% url 'target' build.id target.id %}">
+ <i class="icon-question-sign get-help" title="Of all the packages built, the subset installed in the root file system of this image"></i>
+ Packages included ({{target.package_count}} - {{packages_sum|filtered_filesizeformat}})
+ </a>
+ </li>
+ <li class="active">
+ <a href="{% url 'dirinfo' build.id target.id %}">
+ <i class="icon-question-sign get-help" title="The directories and files in the root file system of this image"></i>
+ 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> <!-- span10 -->
+
+{% endblock buildinfomain %}
+
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/diskio.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/diskio.html
new file mode 100644
index 000000000..c5cef6f38
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/editcustomimage_modal.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/editcustomimage_modal.html
new file mode 100644
index 000000000..8046c08fb
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/editcustomimage_modal.html
@@ -0,0 +1,71 @@
+<!--
+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 hide fade in" aria-hidden="false" id="edit-custom-image-modal">
+ <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">
+ <div class="row-fluid">
+ {% for recipe in build.get_custom_image_recipes %}
+ <label class="radio">
+ {{recipe.name}}
+ <input type="radio" class="form-control" name="select-custom-image"
+ data-url="{% url 'customrecipe' build.project.id recipe.id %}">
+ </label>
+ {% endfor %}
+ </div>
+ <span class="help-block error" 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-large" data-url="#"
+ data-action="edit-custom-image" disabled>
+ Edit custom image
+ </button>
+ </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');
+ };
+
+ radios.change(function () {
+ if (getSelectedRadios().length === 1) {
+ editCustomImageButton.removeAttr('disabled');
+ error.hide();
+ }
+ else {
+ editCustomImageButton.attr('disabled', 'disabled');
+ error.show();
+ }
+ });
+
+ editCustomImageButton.click(function () {
+ var selectedRadios = getSelectedRadios();
+
+ if (selectedRadios.length === 1) {
+ document.location.href = selectedRadios.first().attr('data-url');
+ }
+ else {
+ error.show();
+ }
+ });
+});
+</script>
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/filtersnippet.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/filtersnippet.html
new file mode 100644
index 000000000..1101aa810
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/filtersnippet.html
@@ -0,0 +1,57 @@
+{% load projecttags %}
+<!-- '{{f.class}}' filter -->
+{% with f.class as key %}
+<form id="filter_{{f.class}}" class="modal hide fade" tabindex="-1" role="dialog" aria-hidden="true">
+ <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>
+ <label class="radio">
+ <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>
+ {% for option in f.options %}
+ {% if option.1 == 'daterange' %}
+ <div class="form-inline">
+ <label class="radio">
+ <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 class="radio">
+ <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="radio 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>
+ {% if option.1 == 'daterange' %}
+ <input type="text" id="date_from_{{key}}" name="date_from_{{key}}" disabled class="input-small" /><label class="help-inline">to</label>
+ <input type="text" id="date_to_{{key}}" name="date_to_{{key}}" disabled class="input-small" />
+ <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">
+ <button type="submit" class="btn btn-primary" data-key="{{key}}">Apply</button>
+ {% if request.GET.filter %}
+ {% if request.GET.filter|string_remove_regex:':.*' != f.options.0.1|string_remove_regex:':.*' %}
+ <span class="help-inline pull-left">You can only apply one filter to the table. This filter will override the current filter.</span>
+ {% endif %}
+ {% endif %}
+ </div>
+</form>
+{% endwith %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/generic-toastertable-page.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/generic-toastertable-page.html
new file mode 100644
index 000000000..33aa8ce0d
--- /dev/null
+++ b/import-layers/yocto-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="icon-question-sign get-help heading-help" title="This page lists {{title}} 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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/importlayer.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/importlayer.html
new file mode 100644
index 000000000..1848f410e
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/importlayer.html
@@ -0,0 +1,139 @@
+{% extends "base.html" %}
+{% load projecttags %}
+{% load humanize %}
+{% load static %}
+{% block title %} Import layer - {{project.name}} - Toaster {% endblock %}
+{% block pagecontent %}
+
+{% 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 = {
+ xhrImportLayerUrl : "{% url 'xhr_importlayer' %}",
+ };
+
+ try {
+ importLayerPageInit(ctx);
+ } catch (e) {
+ document.write("Sorry, An error has occurred loading this page");
+ console.warn(e);
+ }
+ });
+ </script>
+
+ <form class="span11">
+ <fieldset>
+ <legend>Layer repository information</legend>
+ <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>
+
+ <div class="control-group" id="layer-name-ctrl">
+ <label class="control-label air" for="import-layer-name">
+ Layer name
+ <span class="icon-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>
+ <div class="controls">
+ <input id="import-layer-name" type="text" required autofocus data-autocomplete="off" data-provide="typeahead">
+ <span class="help-inline" 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>
+
+ </div>
+ <div id="duplicate-layer-info" style="display:none">
+ <div class="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>
+ </div>
+ <dl>
+ <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>
+
+ <p><a href="" class="dup-layer-link">View the <span class="dup-layer-name"></span> layer information</a></p>
+
+ </div>
+
+ <div class="fields-apart-from-layer-name">
+ <label for="layer-git-repo-url" class="project-form">
+ Git repository URL
+ <span class="icon-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="input-xxlarge" required>
+ <label class="project-form" for="layer-subdir">
+ Repository subdirectory
+ <span class="muted">(optional)</span>
+ <span class="icon-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" id="layer-subdir">
+
+ <div class="control-group" id="layer-revision-ctrl">
+ <label class="control-label project-form" for="layer-git-ref">Git revision
+ <span class="icon-question-sign get-help" title="You can provide a Git branch, a tag or a commit SHA as the revision"></span>
+ </label>
+ <div class="controls">
+ <input type="text" class="span3" id="layer-git-ref" required>
+ <span class="help-inline" style="diaply:none;" id="invalid-layer-revision-hint"></span>
+ </div>
+ </div>
+ </div>
+
+ </fieldset>
+
+ <div class="fields-apart-from-layer-name">
+ <fieldset class="air">
+ <legend>
+ Layer dependencies
+ <span class="muted">(optional)</span>
+ <span class="icon-question-sign get-help heading-help" title="Other layers this layer depends upon"></span>
+ </legend>
+ <ul class="unstyled configuration-list" id="layer-deps-list">
+ </ul>
+ <div class="input-append">
+ <input type="text" autocomplete="off" data-minLength="1" data-autocomplete="off" data-provide="typeahead" placeholder="Type a layer name" id="layer-dependency" class="input-xlarge">
+ <a class="btn" id="add-layer-dependency-btn">
+ Add layer
+ </a>
+ </div>
+ <span class="help-inline">You can only add layers Toaster knows about</span>
+ </fieldset>
+ <div class="air" id="form-actions">
+ <button class="btn btn-primary btn-large" 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-and-add-hint" style="vertical-align: middle;">To import a layer you need to enter a layer name, a Git repository URL and a revision (branch, tag or commit)</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 %}
+{% endblock %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/js-unit-tests.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/js-unit-tests.html
new file mode 100644
index 000000000..94ad4f8e9
--- /dev/null
+++ b/import-layers/yocto-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/prettify.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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/landing.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/landing.html
new file mode 100644
index 000000000..a1b5cdce7
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/landing.html
@@ -0,0 +1,62 @@
+{% extends "base.html" %}
+
+{% load static %}
+{% load projecttags %}
+{% load humanize %}
+
+{% block title %} Welcome to Toaster {% endblock %}
+{% block pagecontent %}
+ <div class="container-fluid">
+ <div class="row-fluid">
+ <div class="hero-unit span12 well-transparent">
+ <div class="row-fluid">
+
+ <div class="span6">
+ <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>
+
+ {% if lvs_nos %}
+ <p class="hero-actions">
+ <a class="btn btn-primary btn-large" href="{% url 'newproject' %}">
+ To start building, create your first Toaster project
+ </a>
+ </p>
+ {% else %}
+ <div class="alert alert-info lead 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="unstyled">
+ <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="span6">
+ <img alt="Yocto Project" class="thumbnail" src="{% static 'img/toaster_bw.png' %}"/>
+ </div>
+
+ </div>
+ </div>
+ </div>
+ </div>
+{% endblock %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/landing_not_managed.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/landing_not_managed.html
new file mode 100644
index 000000000..9b37f5530
--- /dev/null
+++ b/import-layers/yocto-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-fluid">
+ <div class="row-fluid">
+ <!-- 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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/layer_btn.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/layer_btn.html
new file mode 100644
index 000000000..10de37d4b
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/layer_btn.html
@@ -0,0 +1,17 @@
+<button class="btn btn-danger btn-block layer-exists-{{data.pk}} layerbtn" data-layer='{ "id": {{data.pk}}, "name": "{{data.layer.name}}", "layerdetailurl": "{%url 'layerdetails' extra.pid data.pk%}"}' data-directive="remove"
+ {% if data.pk not in extra.current_layers %}
+ style="display:none;"
+ {% endif %}
+ >
+ <i class="icon-trash"></i>
+ Remove layer
+</button>
+<button class="btn btn-block layer-add-{{data.pk}} layerbtn" data-layer='{ "id": {{data.pk}}, "name": "{{data.layer.name}}", "layerdetailurl": "{%url 'layerdetails' extra.pid data.pk%}"}' data-directive="add"
+ {% if data.pk in extra.current_layers %}
+ style="display:none;"
+ {% endif %}
+ >
+ <i class="icon-plus"></i>
+ Add layer
+</button>
+
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/layerdetails.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/layerdetails.html
new file mode 100644
index 000000000..82be3703b
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/layerdetails.html
@@ -0,0 +1,275 @@
+{% extends "base.html" %}
+{% load projecttags %}
+{% load humanize %}
+{% load static %}
+
+{% block title %} {{layerversion.layer.name}} - {{project.name}} - Toaster {% endblock %}
+{% block pagecontent %}
+
+<div class="section">
+ <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>
+</div>
+
+{# If this is not an imported layer then hide the edit ui #}
+{% if not layerversion.layer_source_id or layerversion.layer_source.sourcetype != layerversion.layer_source.TYPE_IMPORTED %}
+<style scoped>
+ .icon-pencil {
+ display:none;
+ }
+.delete-current-value{
+ display: none;
+}
+ li .icon-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_updatelayer' %}",
+ 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 %}",
+ sourceId: {{layerversion.layer_source_id|json}},
+ }
+ };
+
+ try {
+ layerDetailsPageInit(ctx);
+ } catch (e) {
+ document.write("Sorry, An error has occurred loading this page");
+ console.warn(e);
+ }
+ });
+</script>
+
+<div class="row-fluid span11">
+ <div class="page-header">
+ <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>
+ </div>
+</div>
+
+<!-- container for tabs -->
+<div class="row-fluid span7 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>
+ <ul class="nav nav-pills">
+ <li class="active">
+ <a data-toggle="tab" href="#information" id="details-tab">Layer details</a>
+ </li>
+ <li>
+ <a data-toggle="tab" href="#recipes" class="muted" id="targets-tab">Recipes (<span class="table-count-recipestable"></span>)</a>
+ </li>
+ <li>
+ <a data-toggle="tab" href="#machines" class="muted" id="machines-tab">Machines (<span class="table-count-machinestable"></span>)</a>
+ </li>
+ </ul>
+ <div class="tab-content">
+ <span class="button-place">
+ {% if layerversion.id not in projectlayers %}
+ <button id="add-remove-layer-btn" data-directive="add" class="btn btn-large btn-block">
+ <span class="icon-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-block btn-large btn-danger">
+ <span class="icon-trash"></span>
+ Remove the {{layerversion.layer.name}} layer from your project
+ </button>
+ {% endif %}
+ </span>
+
+ <!-- layer details pane -->
+ <div id="information" class="tab-pane active">
+ <dl class="dl-horizontal">
+ <dt class="">
+ <i class="icon-question-sign get-help" title="Fetch/clone URL of the repository"></i>
+ 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="icon-share get-info" target="_blank"></a>
+ {% endif %}
+ <form id="change-repo-form" class="control-group" style="display:none">
+ <div class="input-append">
+ <input type="text" class="input-xlarge" value="{{layerversion.layer.vcs_url}}">
+ <button data-layer-prop="vcs_url" class="btn change-btn" type="button">Save</button>
+ <a href="#" style="display:none" class="btn btn-link cancel">Cancel</a>
+ </div>
+ </form>
+ <i class="icon-pencil" ></i>
+ </dd>
+ <dt>
+ <i class="icon-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)"></i>
+ Repository subdirectory
+ </dt>
+ <dd>
+ <span class="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="icon-share get-info" target="_blank"></a>
+ {% endif %}
+ <form id="change-subdir-form" style="display:none;">
+ <div class="input-append">
+ <input type="text" value="{{layerversion.dirpath}}">
+ <button data-layer-prop="dirpath" class="btn change-btn" type="button">Save</button>
+ <a href="#" style="display:none" class="btn btn-link cancel">Cancel</a>
+ </div>
+ </form>
+ <i id="change-subdir" class="icon-pencil"></i>
+ <span class="icon-trash delete-current-value" data-toggle="tooltip" title="Delete"></span>
+ </dd>
+ <dt>
+ <i class="icon-question-sign get-help" title="The Git branch, tag or commit"></i>
+ Git revision
+ </dt>
+ <dd>
+ <span class="current-value">{{layerversion.get_vcs_reference}}</span>
+ <form style="display:none;">
+ <div class="input-append">
+ <input type="text" value="{{layerversion.get_vcs_reference}}">
+ <button data-layer-prop="commit" class="btn change-btn" type="button">Save</button>
+ <a href="#" style="display:none" class="btn btn-link cancel">Cancel</a>
+ </div>
+ </form>
+ <i class="icon-pencil"></i>
+ </dd>
+ <dt>
+ <i class="icon-question-sign get-help" title="Other layers this layer depends upon"></i>
+ Layer dependencies
+ </dt>
+ <dd>
+ <ul class="unstyled current-value" 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="icon-trash " data-toggle="tooltip" title="Delete"></span>
+ </li>
+ {% endfor %}
+ </ul>
+ <div class="input-append add-deps">
+ <input type="text" autocomplete="off" data-minLength="1" data-autocomplete="off" placeholder="Type a layer name" id="layer-dep-input">
+ <a class="btn" id="add-layer-dependency-btn" >
+ Add layer
+ </a>
+ </div>
+ <span class="help-block add-deps">You can only add layers Toaster knows about</span>
+ </dd>
+ </dl>
+ </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>Toaster learns about layers when you build them. If this layer provides any machines, they will be listed here after you build the <strong> {{layerversion.layer.name}} </strong> layer.</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="row-fluid span4 well"> <!-- info side panel -->
+ <h2>About {{layerversion.layer.name}}</h2>
+ <dl class="item-info">
+
+ <dt>
+ Summary
+ <i class="icon-question-sign get-help" title="One-line description of the layer"></i>
+ </dt>
+ <dd>
+ <span class="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">
+ <textarea class="span12" rows="2">{% if layerversion.layer.summary %}{{layerversion.layer.summary}}{% endif %}</textarea>
+ <button class="btn change-btn" data-layer-prop="summary" type="button">Save</button>
+ <a href="#" class="btn btn-link cancel">Cancel</a>
+ </form>
+ <i class="icon-pencil"></i>
+ <span class="icon-trash delete-current-value" data-toggle="tooltip" title="Delete"></span>
+ </dd>
+ <dt>
+ Description
+ </dt>
+ <dd>
+ <span class="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">
+ <textarea class="span12" rows="6">{% if layerversion.layer.description %}{{layerversion.layer.description}}{% endif %}</textarea>
+ <button class="btn change-btn" data-layer-prop="description" type="button" >Save</button>
+ <a href="#" class="btn btn-link cancel">Cancel</a>
+ </form>
+ <i class="icon-pencil"></i>
+ <span class="icon-trash delete-current-value" data-toggle="tooltip" title="Delete"></span>
+ </dd>
+ {% if layerversion.layer.up_id %}
+ <dt>Layer index</dt>
+ <dd>
+ <a href="http://layers.openembedded.org/layerindex/branch/{{layerversion.up_branch.name}}/layer/{{layerversion.layer.name}}">layer index link</a>
+
+ </dd>
+ {% endif %}
+
+ </dl>
+ </div>
+
+ {% endblock %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/machine_btn.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/machine_btn.html
new file mode 100644
index 000000000..7b08f6a9a
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/machine_btn.html
@@ -0,0 +1,16 @@
+<a href="{% url 'project' extra.pid %}?setMachine={{data.name}}" class="btn 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>
+<button class="btn 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 %}"}' data-directive="add"
+ {% if data.layer_version.pk in extra.current_layers %}
+ style="display:none;"
+ {% endif %}
+>
+ <i class="icon-plus"></i>
+ Add layer
+ <i title="" class="icon-question-sign get-help" data-original-title="To enable this machine, you must first add the {{data.layer_version.layer.name}} layer to your project"></i>
+</button>
+
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/mrb_section.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/mrb_section.html
new file mode 100644
index 000000000..b5e798d7c
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/mrb_section.html
@@ -0,0 +1,178 @@
+{% load static %}
+{% load projecttags %}
+{% load project_url_tag %}
+{% load humanize %}
+<script src="{% static 'js/mrbsection.js' %}"></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>
+
+{%if mru and mru.count > 0%}
+
+ {%if mrb_type == 'project' %}
+ <h2 class="page-header">
+ Latest project builds
+
+ {% if project.is_default %}
+ <i class="icon-question-sign get-help heading-help" title="" data-original-title="Builds in this project cannot be started from Toaster: they are started from the command line"></i>
+ {% endif %}
+ </h2>
+ {% else %}
+ <div class="page-header top-air">
+ <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-error{%else%}alert-info{%endif%}{% if mrb_type != 'project' %} project-name{% endif %}">
+ {% if mrb_type != 'project' %}
+ <span class="label {%if build.outcome == build.SUCCEEDED%}label-success{%elif build.outcome == build.FAILED%}label-important{%else%}label-info{%endif%}">
+ <a href={% project_url build.project %}>
+ {{build.project.name}}
+ </a>
+ </span>
+ {% endif %}
+ <div class="row-fluid">
+ <div class="span3 lead">
+ {%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
+ <a href="{%url 'builddashboard' build.pk%}" class="{%if build.outcome == build.SUCCEEDED %}success{%else%}error{%endif%}">
+ {% endif %}
+ {% if build.target_set.all.count > 0 %}
+ <span data-toggle="tooltip"
+ {% if build.target_set.all.count > 1 %}
+ {{build.get_sorted_target_list.0.target}}
+ title="Recipes:
+ {% for target in build.get_sorted_target_list %}
+ {% if target.task %}
+ {{target.target}}:{{target.task}}
+ {% else %}
+ {{target.target}}
+ {% endif %}
+ {% endfor %}"
+ {% endif %}
+ >
+ {% if build.target_set.all.0.task %}
+ {{build.get_sorted_target_list.0.target}}:{{build.target_set.all.0.task}}
+ {% else %}
+ {{build.get_sorted_target_list.0.target}}
+ {% endif %}
+ {% if build.target_set.all.count > 1 %}
+ (+{{build.target_set.all.count|add:"-1"}})
+ {% endif %}
+ </span>
+ {% endif %}
+ {%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
+ </a>
+ {% endif %}
+ </div>
+ {% if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
+ <div class="span2 lead">
+ {% if build.completed_on|format_build_date %}
+ {{ build.completed_on|date:'d/m/y H:i' }}
+ {% else %}
+ {{ build.completed_on|date:'H:i' }}
+ {% endif %}
+ </div>
+ {% endif %}
+ {%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
+ <div class="span2 lead">
+ {% if build.errors.count %}
+ <i class="icon-minus-sign red"></i> <a href="{%url 'builddashboard' build.pk%}#errors" class="error">{{build.errors.count}} error{{build.errors.count|pluralize}}</a>
+ {% endif %}
+ </div>
+ <div class="span2 lead">
+ {% if build.warnings.count %}
+ <i class="icon-warning-sign yellow"></i> <a href="{%url 'builddashboard' build.pk%}#warnings" class="warning">{{build.warnings.count}} warning{{build.warnings.count|pluralize}}</a>
+ {% endif %}
+ </div>
+ <div class="lead ">
+ <span class="lead">
+ Build time: <a href="{% url 'buildtime' build.pk %}">{{ build.timespent_seconds|sectohms }}</a>
+ </span>
+ {% if build.project.is_default %}
+ <i class="pull-right icon-question-sign get-help
+ {% if build.outcome == build.SUCCEEDED %}
+ get-help-green
+ {% elif build.outcome == build.FAILED %}
+ get-help-red
+ {% else %}
+ get-help-blue
+ {% endif %}
+ " title="Builds in this project cannot be started from Toaster: they are started from the command line">
+ </i>
+ {% else %}
+ <button class="run-again-btn btn
+ {% if build.outcome == build.SUCCEEDED %}
+ btn-success
+ {% elif build.outcome == build.FAILED %}
+ btn-danger
+ {% else %}
+ btn-info
+ {%endif%}
+ pull-right"
+ data-request-url="{% url 'xhr_buildrequest' build.project.pk %}"
+ data-target='{{build.target_set.all|get_tasks|json}}'>
+
+
+ Rebuild
+ </button>
+ {% endif %}
+ </div>
+ {%endif%}
+ {%if build.outcome == build.IN_PROGRESS %}
+ <div class="span4" style="display:none" id="cancelling-msg-{{build.buildrequest.pk}}">
+ <p class="lead">Cancelling the build ...</p>
+ </div>
+ <div class="span4 offset1 progress-info">
+ <div class="progress" id="build-pc-done-title-{{build.pk}}" style="margin-top:5px;" data-toggle="tooltip" title="{{build.completeper}}% of tasks complete">
+ <div id="build-pc-done-bar-{{build.pk}}" style="width: {{build.completeper}}%;" class="bar"></div>
+ </div>
+ </div>
+ <div class="lead span3 progress-info"><span id="build-pc-done-{{build.pk}}">{{build.completeper}}</span>% of tasks complete</div>
+ {# No build cancel for command line builds project #}
+ {% if build.project.is_default %}
+ <i class="icon-question-sign get-help get-help-blue pull-right" title="" data-original-title="Builds in this project cannot be cancelled from Toaster: they can only be cancalled from the command line"></i>
+ {% else %}
+ <div class="lead pull-right progress-info">
+ <button class="cancel-build-btn btn btn-info pull-right"
+ data-buildrequest-id={{build.buildrequest.pk}}
+ data-request-url="{% url 'xhr_buildrequest' build.project.pk %}" >
+ Cancel
+ </button>
+ </div>
+ {% endif %}
+
+ {%endif%} {# end if in progress #}
+
+ {% if build.outcome == build.CANCELLED %}
+ <div class="span4">
+ <p class="lead">Build cancelled</p>
+ </div>
+ <button class="btn btn-info pull-right run-again-btn"
+ data-request-url="{% url 'xhr_buildrequest' build.project.pk %}"
+ data-target='{{build.target_set.all|get_tasks|json}}'>
+ Rebuild
+
+ </button>
+ {% endif %}
+ </div>
+</div>
+
+ {% endfor %}
+ </div>
+
+{%endif%}
+
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/newcustomimage.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/newcustomimage.html
new file mode 100644
index 000000000..46aed901f
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/newcustomimage.html
@@ -0,0 +1,14 @@
+{% extends "base.html" %}
+{% load projecttags %}
+{% load humanize %}
+{% load static %}
+{% block pagecontent %}
+
+{% include "newcustomimage_modal.html" %}
+{% include "projecttopbar.html" %}
+
+{% url table_name project.id as xhr_table_url %}
+<h2>{{title}} (<span class="table-count-{{table_name}}">0</span>)</h2>
+{% include "toastertable.html" %}
+
+{% endblock %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/newcustomimage_modal.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/newcustomimage_modal.html
new file mode 100644
index 000000000..caeb30235
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/newcustomimage_modal.html
@@ -0,0 +1,48 @@
+{% 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 hide fade in" id="new-custom-image-modal" aria-hidden="false">
+ <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>
+ <div data-role="image-selector-radios"></div>
+ <span class="help-block error" id="invalid-recipe-help" style="display:none"></span>
+ <div class="air"></div>
+ </div>
+
+ <h4>Name your custom image</h4>
+
+ <div class="row-fluid">
+ <span class="help-block span8">Image names must be unique. They should not contain spaces or capital letters, and the only allowed special character is dash (-).<p></p>
+ </span></div>
+ <div class="control-group controls">
+ <input type="text" class="huge" placeholder="Type the custom image name" required>
+ <span class="help-block error" id="invalid-name-help" style="display:none"></span>
+ </div>
+ </div>
+
+ <div class="modal-footer">
+ <button id="create-new-custom-image-btn" class="btn btn-primary btn-large" data-original-title="" title="" disabled>Create custom image</button>
+ </div>
+</div>
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/newproject.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/newproject.html
new file mode 100644
index 000000000..e83b2bea6
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/newproject.html
@@ -0,0 +1,133 @@
+{% extends "base.html" %}
+{% load projecttags %}
+{% load humanize %}
+
+{% block title %} Create a new project - Toaster {% endblock %}
+
+{% block pagecontent %}
+<div class="row-fluid">
+ <div class="page-header">
+ <h1>Create a new project</h1>
+ </div>
+ <div class="container-fluid">
+ {% if alert %}
+ <div class="alert alert-error row-fluid" role="alert">{{alert}}</div>
+ {% endif %}
+ </div>
+
+ <div class="row-fluid">
+ <div class="span6">
+ <form method="POST">{% csrf_token %}
+
+ <fieldset>
+ <label>Project name <span class="muted">(required)</span></label>
+ <input type="text" class="input-xlarge" required id="new-project-name" name="projectname">
+ </fieldset>
+<!--
+ <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 %}
+ <fieldset class="release">
+ {% if releases.count > 1 %}
+ <label class="project-form">
+ Release
+ <i class="icon-question-sign get-help" title="The version of the build system you want to use"></i>
+ </label>
+ <select name="projectversion" id="projectversion">
+ {% for release in releases %}
+ <option value="{{release.id}}"
+ {%if defaultbranch == release.name %}
+ selected
+ {%endif%}
+ >{{release.description}}</option>
+ {% endfor %}
+ </select>
+ {% for release in releases %}
+ <div class="row-fluid helptext" id="description-{{release.id}}" style="display: none">
+ <span class="help-block span5">{{release.helptext|safe}}</span>
+ </div>
+ {% endfor %}
+ {% else %}
+ <input type="hidden" name="projectversion" value="{{releases.0.id}}"/>
+ {% endif %}
+ </fieldset>
+ {% endif %}
+
+ <div class="form-actions">
+ <input type="submit" id="create-project-button" class="btn btn-primary btn-large" 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>
+ <!--
+ <div class="span5 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();
+ });
+
+/* // 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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/package_built_dependencies.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/package_built_dependencies.html
new file mode 100644
index 000000000..e6f20c330
--- /dev/null
+++ b/import-layers/yocto-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-pills">
+ <li class="">
+ <a href="{% url 'package_built_detail' build.id package.id %}">
+ <i class="icon-question-sign get-help" title="Shows the files produced by this package."></i>
+ Generated files ({{package.buildfilelist_package.count}})
+ </a>
+ </li>
+ <li class="active">
+ <a href="{% url 'package_built_dependencies' build.id package.id %}">
+ <i class="icon-question-sign get-help" title="Shows the runtime packages required by this package."></i>
+ 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 include <strong>{{package.fullpackagespec}}</strong> in future builds.
+ </div>
+ <table class="table table-bordered table-hover">
+ <thead>
+ <tr>
+ <th>Package</th>
+ <th>Version</th>
+ <th class="sizecol span2">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 span2">Size</th>
+ <th>
+ <i class="icon-question-sign get-help" title="Five relationship types exist: recommends, suggests, provides, replaces and conflicts"></i>
+ 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}}
+ <i class="icon-question-sign get-help hover-help" title="{{other_dep.dep_type_help}}" ></i>
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ {% endifnotequal %}
+ </div> <!-- tab-pane -->
+ </div> <!-- tab-content -->
+{% endblock tabcontent %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/package_built_detail.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/package_built_detail.html
new file mode 100644
index 000000000..9be8ccb85
--- /dev/null
+++ b/import-layers/yocto-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-pills">
+ <li class="active"> <a href="#">
+ <i class="icon-question-sign get-help" title="Files added to a root file system when you include {{package.name}} in an image"></i>
+ Generated files ({{packageFileCount}})
+ </a></li>
+ <li class=""><a href="{% url 'package_built_dependencies' build.id package.id %}">
+ <i class="icon-question-sign get-help" title="Projected runtime dependencies when you include {{package.name}} in an image"></i>
+ 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 added to an image root file system if you include <strong>{{package.fullpackagespec}}</strong> in future builds.
+ </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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/package_detail_base.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/package_detail_base.html
new file mode 100644
index 000000000..9fa28a8f8
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/package_detail_base.html
@@ -0,0 +1,149 @@
+{% 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="muted"> as ' + alias + '&nbsp';
+ r += '<i class="icon-question-sign get-help';
+ if (hover) {
+ r+= ' hover-help';
+ }
+ else {
+ r+= ' heading-help';
+ }
+ r += '"';
+ title = package_name + ' was renamed at packaging time and was installed on your system as ' + alias;
+ r += ' title="' + title + '">';
+ r += '</i>';
+ 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 span11">
+ <div class="page-header">
+ {% block mainheading %}
+ <h1>{{package.fullpackagespec}}</h1>
+ {% endblock %}
+ </div> <!-- page-header -->
+ </div> <!-- row span11 page-header -->
+
+ {% block twocolumns %}
+ <div class="row span7 tabbable">
+ {% block tabcontent %}
+ {% endblock tabcontent %}
+ </div> <!-- row span7 -->
+
+ <div class="row span4 well">
+ <h2>Package information</h2>
+
+ <!-- info presented as definition list -->
+ <dl class="item-info">
+ <dt>
+ Size
+ <i class="icon-question-sign get-help" title="The size of the package"></i>
+ </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
+ <i class="icon-question-sign get-help" title="The license under which this package is distributed"></i>
+ </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
+ <i class="icon-question-sign get-help" title="The name of the recipe building this package"></i>
+ </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
+ <i class="icon-question-sign get-help" title="The version of the recipe building this package"></i>
+ </dt>
+ <dd>{{package.recipe.version}}</dd>
+
+ <dt>
+ Layer
+ <i class="icon-question-sign get-help" title="The name of the layer providing the recipe that builds this package"></i>
+ </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="icon-share get-info"></i>
+ </a>
+ {% endcomment %}
+ {% endif %}
+ </dd>
+ {% if package.recipe.layer_version.branch %}
+ <dt>
+ Layer branch
+ <i class="icon-question-sign get-help" title="The Git branch of the layer providing the recipe that builds this package"></i>
+ </dt>
+ <dd>{{package.recipe.layer_version.branch}}</dd>
+ {% endif %}
+ <dt>
+ Layer commit
+ <i class="icon-question-sign get-help" title="The Git commit of the layer providing the recipe that builds this package"></i>
+ </dt>
+
+ <dd class="iscommit">{{package.recipe.layer_version.commit}}</dd>
+
+ </dl>
+ </div> <!-- row4 well -->
+ {% endblock twocolumns %}
+{% endblock pagedetailinfomain %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/package_included_dependencies.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/package_included_dependencies.html
new file mode 100644
index 000000000..8a0508e70
--- /dev/null
+++ b/import-layers/yocto-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 span2'>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 span2'>Size</th>
+ <th>
+ <i class="icon-question-sign get-help" title="Five relationship types exist: recommends, suggests, provides, replaces and conflicts"></i>
+ 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}}
+ <i class="icon-question-sign get-help hover-help" title="{{other_dep.dep_type_help}}" ></i>
+ </td>
+ </tr>
+ {% else %}
+ <tr class="muted">
+ <td>{{other_dep.name}}</td>
+ <td>{{other_dep.version}}</td>
+ <td></td>
+ <td>
+ {{other_dep.dep_type_display}}
+ <i class="icon-question-sign get-help hover-help" title="{{other_dep.dep_type_help}}" ></i>
+ </td>
+ </tr>
+ {% endif %}
+ {% endfor %}
+ </tbody>
+ </table>
+ {% endifnotequal %}
+ </div> <!-- end tab-pane -->
+ </div> <!-- end tab content -->
+ {% endwith %}
+{% endblock tabcontent %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/package_included_detail.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/package_included_detail.html
new file mode 100644
index 000000000..568e2f235
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/package_included_reverse_dependencies.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/package_included_reverse_dependencies.html
new file mode 100644
index 000000000..fb310c7fc
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/package_included_tabs.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/package_included_tabs.html
new file mode 100644
index 000000000..958aa8827
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/package_included_tabs.html
@@ -0,0 +1,33 @@
+
+ <ul class="nav nav-pills">
+ {% if active_tab == "detail" %}
+ <li class="active">
+ {% else %}
+ <li class="">
+ {% endif %}
+ <a href="{% url 'package_included_detail' build.id target.id package.id %}">
+ <i class="icon-question-sign get-help" title="The files this package adds to the image root file system"></i>
+ 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 %}">
+ <i class="icon-question-sign get-help" title="Package runtime dependencies"></i>
+ 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 %}">
+ <i class="icon-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"></i>
+ Reverse runtime dependencies ({{reverse_count}})
+ </a>
+ </li>
+ </ul>
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/pkg_add_rm_btn.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/pkg_add_rm_btn.html
new file mode 100644
index 000000000..0aefc5625
--- /dev/null
+++ b/import-layers/yocto-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="muted">Locale package</span>
+ <i class="icon-question-sign get-help hover-help" title=""
+ data-original-title="This package is included in your image
+ based on the locale specified in the IMAGE_LINGUAS variable"
+ style="visibility: hidden;">
+ </i>
+</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-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="icon-plus"></i>
+ Add package
+ </button>
+</div>
+
+{% endif %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/project.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/project.html
new file mode 100644
index 000000000..125676881
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/project.html
@@ -0,0 +1,140 @@
+{% 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>
+
+<!-- Comment out the ability to change the project release, until we decide what to do this functionality -->
+
+<!--div id="change-release-modal" class="modal hide fade in" tabindex="-1" role="dialog" aria-labelledby="change-release-modal" aria-hidden="false">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
+ <h3>Changing Yocto Project release to <span class="proposed-release-change-name"></span></h3>
+ </div>
+ <div class="modal-body">
+ <p>The following added layers do not exist for <span class="proposed-release-change-name"></span>: </p>
+ <ul id="layers-to-remove-list">
+ </ul>
+ <p>If you change the Yocto Project release to <span class="proposed-release-change-name"></span>, the above layers will be deleted from your added layers.</p>
+ </div>
+ <div class="modal-footer">
+ <button id="change-release-and-rm-layers" data-dismiss="modal" type="submit" class="btn btn-primary">Change release and delete layers</button>
+ <button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
+ </div>
+</div-->
+
+
+<div class="row-fluid" id="project-page" style="display:none">
+ <div class="span6">
+ <div class="well well-transparent" id="machine-section">
+ <h3>Machine</h3>
+
+ <p class="lead"><span id="project-machine-name"></span> <i title="" data-original-title="" id="change-machine-toggle" class="icon-pencil"></i></p>
+
+ <form id="select-machine-form" style="display:none;">
+ <div class="alert alert-info">
+ <strong>Machine changes have a big impact on build outcome.</strong> You cannot really compare the builds for the new machine with the previous ones.
+ </div>
+
+ <div class="input-append">
+ <input id="machine-change-input" autocomplete="off" value="" data-provide="typeahead" data-minlength="1" data-autocomplete="off" type="text">
+ <button id="machine-change-btn" class="btn" type="button">Save</button> <a href="#" id="cancel-machine-change" class="btn btn-link">Cancel</a>
+ </div>
+
+ <p><a href="{% url 'projectmachines' project.id %}" class="link">View compatible machines</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">
+ <span class="lead">You haven't built any recipes yet</span>
+ <p style="margin-top: 10px;"><a href="{% url 'projectimagerecipes' project.id %}">Choose a recipe to build</a></p>
+ </div>
+
+ <ul class="unstyled configuration-list" 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="span6">
+ <div class="well well-transparent" id="layer-container">
+ <h3>Layers <span class="muted counter">(<span id="project-layers-count"></span>)</span>
+ <i data-original-title="OpenEmbedded organises metadata into modules called 'layers'. Layers allow you to isolate different types of customizations from each other. <a href='http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#understanding-and-creating-layers' target='_blank'>More on layers</a>" class="icon-question-sign get-help heading-help" title=""></i>
+ </h3>
+
+ <div class="alert lead" id="no-layers-in-project" style="display:none">
+ You need to add some layers. For that you can:
+ <ul>
+ <li><a href="{% url 'projectlayers' project.id %}">View all 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>
+ </ul>
+ <p>Or type a layer name below.</p>
+ </div>
+
+ <form style="margin-top:20px">
+ <!--div class="control-group error"-->
+
+ <div class="input-append">
+ <input id="layer-add-input" autocomplete="off" placeholder="Type a layer name" data-minlength="1" data-autocomplete="off" data-provide="typeahead" data-source="" type="text">
+ <button id="add-layer-btn" class="btn" disabled>Add</button>
+ </div>
+
+ <div id="import-alert" class="alert alert-info" style="display:none;">
+ Toaster does not know about this layer. Please <a href="#">import it</a>
+ </div>
+
+ <p>
+ <a href="{% url 'projectlayers' project.id %}" id="view-compatible-layers">View compatible layers</a>
+ <i data-original-title="View all the layers you can build with the release selected for this project, which is Yocto Project master" class="icon-question-sign get-help" title=""></i>
+ | <a href="{% url 'importlayer' project.id %}">Import layer</a>
+ </p>
+ </form>
+
+ <ul class="unstyled configuration-list" id="layers-in-project-list">
+ </ul>
+ </div>
+ </div>
+</div>
+{% endblock %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/projectbuilds-toastertable.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/projectbuilds-toastertable.html
new file mode 100644
index 000000000..6d7e10bac
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/projectbuilds-toastertable.html
@@ -0,0 +1,56 @@
+{% 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 %}
+
+ {% include "projecttopbar.html" %}
+
+ <div class="row-fluid">
+ {% with mru=mru mrb_type=mrb_type %}
+ {% include 'mrb_section.html' %}
+ {% endwith %}
+
+ <h2 class="page-header top-air" data-role="page-title"></h2>
+
+ {% url 'projectbuilds' project.id as xhr_table_url %}
+ {% include 'toastertable.html' %}
+ </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";
+ }
+ }
+
+ titleElt.text(title);
+ });
+
+ // highlight builds tab
+ $("#topbar-builds-tab").addClass("active")
+ });
+ </script>
+
+{% endblock %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/projectbuilds.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/projectbuilds.html
new file mode 100644
index 000000000..3402fc4fe
--- /dev/null
+++ b/import-layers/yocto-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-fluid">
+ <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="add-on btn" tabindex="-1"><i class="icon-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/projectconf.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/projectconf.html
new file mode 100644
index 000000000..27a898b65
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/projectconf.html
@@ -0,0 +1,950 @@
+{% extends "baseprojectpage.html" %}
+{% load projecttags %}
+{% load humanize %}
+
+{% block title %} BitBake variables - {{project.name}} - Toaster {% endblock %}
+{% block projectinfomain %}
+
+<h2>Bitbake variables</h2>
+
+ <div style="padding-left:19px;">
+
+ <dl class="dl-vertical">
+ {% if distro_defined %}
+ <dt>
+ <span class="js-config-var-name js-config-var-managed-name">DISTRO</span>
+ <i class="icon-question-sign get-help" title="The short name of the distribution. If the variable is blank, meta/conf/distro/defaultsetup.conf will be used. <br /><a href='http://www.yoctoproject.org/docs/1.6.1/ref-manual/ref-manual.html#var-DISTRO' target='_blank'>Read more in the manual</a>"></i>
+ </dt>
+ <dd class="lead">
+ <span id="distro">{{distro}}</span>
+ <i class="icon-pencil" id="change-distro-icon"></i>
+ <form id="change-distro-form" style="display:none;">
+ <div class="input-append">
+ <span id="edit-distro-name-div" class="control-group">
+ <input type="text" id="new-distro" value="{{distro}}">
+ <button id="apply-change-distro" class="btn" type="button">Save</button>
+ <button id="cancel-change-distro" type="button" class="btn btn-link">Cancel</button>
+ </span>
+ <span class="help-block error" id="distro-error-message"></span>
+ </div>
+ </form>
+ </dd>
+ {% endif %}
+
+ {% if dl_dir_defined %}
+ <dt>
+ <span class="js-config-var-name js-config-var-managed-name">DL_DIR</span>
+ <i class="icon-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.<br /><a href='http://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#var-DL_DIR' target='_blank'>Read more in the manual</a>"></i>
+ </dt>
+ <dd class="lead">
+ <span id="dl_dir"{% if dl_dir %}{%else%} class="muted"{%endif%}>{% if dl_dir %}{{dl_dir}}{%else%}Not set{%endif%}</span>
+ <i class="icon-pencil" id="change-dl_dir-icon"></i>
+ <form id="change-dl_dir-form" style="display:none;">
+ <div class="row-fluid">
+ <span class="help-block span4">To set DL_DIR type the absolute path of the download folder.</span>
+ </div>
+ <div class="input-append" id="validate-dl_dir">
+ <input type="text" class="input-xlarge" id="new-dl_dir" placeholder="Type absolute path of the DL_DIR folder">
+ <button id="apply-change-dl_dir" class="btn" type="button">Save</button>
+ <button id="cancel-change-dl_dir" type="button" class="btn btn-link">Cancel</button>
+ </br><span class="help-block error" id="hintError-dl_dir">A valid directory cannot include spaces or any of these characters: . \ ? % * : | " " < ></span>
+ </div>
+ </form>
+ </dd>
+ {% endif %}
+
+ {% if fstypes_defined %}
+ <dt>
+ <span class="js-config-var-name js-config-var-managed-name">IMAGE_FSTYPES</span>
+ <i class="icon-question-sign get-help" title="Formats of root file system images that you want to have created <br /><a href='http://www.yoctoproject.org/docs/1.6.1/ref-manual/ref-manual.html#var-IMAGE_FSTYPES' target='_blank'>Read more in the manual</a>"></i>
+ </dt>
+ <dd class="lead">
+ <span id="image_fstypes">{{fstypes}}</span>
+ <i class="icon-pencil" id="change-image_fstypes-icon"></i>
+ <form id="change-image_fstypes-form" style="display:none;">
+ <input id="filter-image_fstypes" type="text" placeholder="Search image types" class="span4">
+ <div id="all-image_fstypes" class="scrolling">
+ </div>
+ <span class="help-block" id="fstypes-error-message">You must select at least one image type</span>
+ <button id="apply-change-image_fstypes" type="button" class="btn">Save</button>
+ <button id="cancel-change-image_fstypes" type="button" class="btn btn-link">Cancel</button>
+ </form>
+ </dd>
+ {% endif %}
+
+ {% if image_install_append_defined %}
+ <dt>
+ <span class="js-config-var-name js-config-var-managed-name">IMAGE_INSTALL_append</span>
+ <i class="icon-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 <strong>all of them</strong> <br /><a href='http://www.yoctoproject.org/docs/1.6.1/ref-manual/ref-manual.html#var-IMAGE_INSTALL' target='_blank'>Read more in the manual</a>"></i>
+ </dt>
+ <dd class="lead">
+ <span id="image_install"{% if image_install_append %}{%else%} class="muted"{%endif%}>{% if image_install_append %}{{image_install_append}}{%else%}Not set{%endif%}</span>
+ <i class="icon-pencil" id="change-image_install-icon"></i>
+ <i class="icon-trash" id="delete-image_install-icon" {% if image_install_append %}{%else%}style="display:none;"{%endif%}></i>
+ <form id="change-image_install-form" style="display:none;">
+ <div class="row-fluid">
+ <span class="help-block span4">To set IMAGE_INSTALL_append to more than one package, type the package names separated by a space.</span>
+ </div>
+ <div class="input-append">
+ <input type="text" class="input-xlarge" id="new-image_install" placeholder="Type one or more package names">
+ <button id="apply-change-image_install" class="btn" type="button">Save</button>
+ <button id="cancel-change-image_install" type="button" class="btn btn-link">Cancel</button>
+ </div>
+ </form>
+ </dd>
+ {% endif %}
+
+ {% if package_classes_defined %}
+ <dt>
+ <span class="js-config-var-name js-config-var-managed-name">PACKAGE_CLASSES</span>
+ <i class="icon-question-sign get-help" title="Specifies the package manager to use when packaging data <br /><a href='http://www.yoctoproject.org/docs/1.6.1/ref-manual/ref-manual.html#var-PACKAGE_CLASSES' target='_blank'>Read more in the manual</a>"></i>
+ </dt>
+ <dd class="lead">
+ <span id="package_classes">{{package_classes}}</span>
+ <i id="change-package_classes-icon" class="icon-pencil"></i>
+ <form id="change-package_classes-form" style="display:none;">
+ <label>
+ Root file system package format
+ <i class="icon-question-sign get-help" title="The package format used to generate the root file system. Options are <code>dev</code>, <code>ipk</code> and <code>rpm</code>"></i>
+ </label>
+ <select id="package_classes-select">
+ <option>package_deb</option>
+ <option>package_ipk</option>
+ <option>package_rpm</option>
+ </select>
+ <label>
+ Additional package formats
+ <i class="icon-question-sign get-help" title="Extra package formats to build"></i>
+ </label>
+ <label class="checkbox" id="package_class_1">
+ <input type="checkbox" id="package_class_1_input"> package_deb
+ </label>
+ <label class="checkbox" id="package_class_2">
+ <input type="checkbox" id="package_class_2_input"> package_ipk
+ </label>
+ <div style="padding-top:10px;">
+ <button id="apply-change-package_classes" type="button" class="btn">Save</button>
+ <button id="cancel-change-package_classes" type="button" class="btn btn-link">Cancel</button>
+ </div>
+ </form>
+ </dd>
+ {% endif %}
+
+ {% if sstate_dir_defined %}
+ <dt>
+ <span class="js-config-var-name js-config-var-managed-name">SSTATE_DIR</span>
+ <i class="icon-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.<br /><a href='http://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#var-SSTATE_DIR' target='_blank'>Read more in the manual</a>"></i>
+ </dt>
+ <dd class="lead">
+ <span id="sstate_dir"{% if sstate_dir %}{%else%} class="muted"{%endif%}>{% if sstate_dir %}{{sstate_dir}}{%else%}Not set{%endif%}</span>
+ <i class="icon-pencil" id="change-sstate_dir-icon"></i>
+ <form id="change-sstate_dir-form" style="display:none;">
+ <div class="row-fluid">
+ <span class="help-block span4">To set SSTATE_DIR type the absolute path of the download folder.</span>
+ </div>
+ <div class="input-append" id="validate-sstate_dir">
+ <input type="text" class="input-xlarge" id="new-sstate_dir" placeholder="Type absolute path of the SSTATE_DIR folder">
+ <span class="error">A valid directory name required</span>
+ <button id="apply-change-sstate_dir" class="btn" type="button">Save</button>
+ <button id="cancel-change-sstate_dir" type="button" class="btn btn-link">Cancel</button>
+ </br><p class="help-block error" id="hintError-sstate_dir">A valid directory cannot include spaces or any of these characters: . \ ? % * : | " " < ></span>
+ </div>
+ </form>
+ </dd>
+ {% endif %}
+ </dl>
+
+ <!-- <ul class="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 %}
+
+ <div class="row-fluid">
+ <form id="variable-form">
+ <fieldset style="padding-left:0px;">
+ <legend>Add variable</legend>
+ <div class="span3" style="margin-left:0px;">
+ <span id="add-configvar-name-div" class="control-group">
+ <label>
+ Variable
+ <i title="" class="icon-question-sign get-help"
+ data-original-title="Variable names are case sensitive,
+ cannot have spaces, and can only include letters, numbers, underscores
+ and dashes"></i>
+ </label>
+ <input type="text" placeholder="Type variable name" id="variable">
+ <span class="help-block error" id="new-variable-error-message"></span>
+ </span>
+ <label>Value</label>
+ <input id="value" type="text" placeholder="Type variable value"><p>
+ <div>
+ <button id="add-configvar-button" class="btn save" type="button" disabled>Add variable</button>
+ </div>
+ </div>
+ <div class="span5 help-block">
+ <h5>Some variables are reserved 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-SSTATE_MIRRORS" target="_blank">SSTATE_MIRRORS</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>
+ </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, underscores, dashes, and cannot include spaces";
+ } else if (bad_chars) {
+ error_msg = "A valid variable name can only include letters, numbers, underscores, and dashes";
+ }
+
+ if ("" != error_msg) {
+ $('#new-variable-error-message').html(error_msg);
+ $(".save").attr("disabled","disabled");
+
+ // add one (and only one) error class append
+ var d = document.getElementById("add-configvar-name-div");
+ d.className = d.className.replace(" error","");
+ d.className = d.className + " error";
+
+ return false;
+ } else if (0 == variable.length) {
+ $(".save").attr("disabled","disabled");
+ return false;
+ }
+
+ var d = document.getElementById("add-configvar-name-div");
+ d.className = d.className.replace(" 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
+ var d = document.getElementById("edit-distro-name-div");
+ d.className = d.className.replace(" error","");
+ d.className = d.className + " error";
+
+ return false;
+ }
+
+ var d = document.getElementById("edit-distro-name-div");
+ d.className = d.className.replace(" 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");
+ $('#fstypes-error-message').show();
+ }
+ else {
+ $("#apply-change-image_fstypes").removeAttr("disabled");
+ $('#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 = evt.target.attributes["x-data"].value;
+ var current_val = $("span#config_var_value_"+pk).text();
+ $('.js-icon-pencil-config_var, .js-icon-trash-config_var, #config_var_value_'+pk).hide();
+ $("#change-config_var-form_"+pk).slideDown();
+ $("input#new-config_var_"+pk).val(current_val);
+ });
+
+ $('.js-cancel-change-config_var').click(function (evt) {
+ var pk = evt.target.attributes["x-data"].value;
+ $("#change-config_var-form_"+pk).slideUp(function() {
+ $('.js-icon-pencil-config_var, .js-icon-trash-config_var, #config_var_value_'+pk).show();
+ });
+ });
+
+ $(".js-new-config_var").on('input', function(){
+ if ($(this).val().length == 0) {
+ $(".js-apply-change-config_var").attr("disabled","disabled");
+ }
+ else {
+ $(".js-apply-change-config_var").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});
+ $('#config_var_value_'+pk).parent().removeClass('muted');
+ $("#change-config_var-form_"+pk).slideUp(function() {
+ $('.js-icon-pencil-config_var, .js-icon-trash-config_var, #config_var_value_'+pk).show();
+ });
+ });
+
+ // delete variable
+ $(".js-icon-trash-config_var").click(function (evt) {
+ var xdata = evt.target.attributes["x-data"].value.split(":");
+ var pk = xdata[0];
+
+ // hide the dangling trash tooltip
+ $('#config_var_trash_'+pk).hide();
+
+ // fade out the variable+value div, then refresh the variable list
+ $('#config_var_entry_'+pk).parent().parent().fadeOut(1000, function(){
+ 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 += '<div> <dt><span id="config_var_entry_'+configvars_sorted[i][2]+'" class="js-config-var-name"></span><i class="icon-trash js-icon-trash-config_var" id="config_var_trash_'+configvars_sorted[i][2]+'" x-data="'+configvars_sorted[i][2]+'"></i> </dt>'
+ orightml += '<dd class="lead">'
+ orightml += ' <span id="config_var_value_'+configvars_sorted[i][2]+'"></span>'
+ orightml += ' <i class="icon-pencil js-icon-pencil-config_var" x-data="'+configvars_sorted[i][2]+'"></i>'
+ orightml += ' <form id="change-config_var-form_'+configvars_sorted[i][2]+'" style="display:none;">'
+ orightml += ' <div class="input-append">'
+ orightml += ' <input type="text" class="input-xlarge js-new-config_var" id="new-config_var_'+configvars_sorted[i][2]+'" value="">'
+ orightml += ' <button class="btn 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 += ' </div>'
+ orightml += ' </form>'
+ orightml += '</dd> </div>'
+ }
+ }
+
+ // 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() );
+ });
+
+ $('#cancel-change-distro').click(function(){
+ $("#change-distro-form").slideUp(function() {
+ $('#distro, #change-distro-icon').show();
+
+ // reset any dangling error state
+ $('#distro-error-message').text("");
+ var d = document.getElementById("edit-distro-name-div");
+ d.className = d.className.replace(" 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() {
+ $('#hintError-dl_dir').hide();
+ // preset the edit value
+ var current_val = $("span#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);
+
+ $('#change-dl_dir-icon, #dl_dir').hide();
+ $("#change-dl_dir-form").slideDown();
+ });
+
+ $('#cancel-change-dl_dir').click(function(){
+ $("#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");
+ }
+ else {
+ var input = $(this);
+ var re = /^\/([^ <>\\|":\.%\?\*]+)$/;
+ var invalidDir = re.test(input.val());
+ console.log(invalidDir);
+ if ( invalidDir ) {
+ $('#validate-dl_dir').removeClass('control-group error');
+ $("#apply-change-dl_dir").removeAttr("disabled");
+ $('#hintError-dl_dir').hide();
+ } else {
+ $('#validate-dl_dir').addClass('control-group error');
+ $("#apply-change-dl_dir").attr("disabled","disabled");
+ $('#hintError-dl_dir').show();
+ }
+ }
+ });
+
+ $('#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
+
+ $('#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 += '<label class="checkbox"><input type="checkbox" class="fs-checkbox-fstypes" value="'+fstypes_list[i].value+'" checked="checked">'+fstypes_list[i].value+'</label>\n';
+ }
+ }
+ }
+ // 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 += '<label class="checkbox"><input type="checkbox" class="fs-checkbox-fstypes" value="'+fstypes_list[i].value+'">'+fstypes_list[i].value+'</label>\n';
+ }
+ }
+ // Add the 'no search matches' line last
+ html += '<label id="no-match-fstypes">No image types found</label>\n';
+ // Display the list
+ document.getElementById("all-image_fstypes").innerHTML = html;
+ $('#no-match-fstypes').hide();
+
+ // Watch elements to disable Save when none are checked
+ $(".fs-checkbox-fstypes").each(function(){
+ $(this).click(function() {
+ enableFsTypesSave();
+ });
+ });
+
+ // clear the previous filter values and warning messages
+ $("input#filter-image_fstypes").val("");
+ $('#fstypes-error-message').hide();
+ });
+
+ $('#cancel-change-image_fstypes').click(function(){
+ $("#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(){
+ // extract the selected fstypes and sort them
+ var fstypes_array = [];
+ var checkboxes = document.getElementsByClassName('fs-checkbox-fstypes');
+ $(".fs-checkbox-fstypes:checked").each(function(){
+ fstypes_array.push($(this).val());
+ });
+ fstypes_array.sort();
+
+ // now make a string of them
+ var fstypes = '';
+ for (var i = 0, length = fstypes_array.length; i < length; i++) {
+ fstypes += fstypes_array[i] + ' ';
+ }
+ fstypes = fstypes.trim();
+
+ 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;
+ }
+ $("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('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('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() {
+ $('#hintError-sstate_dir').hide();
+ // 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);
+
+ $('#change-sstate_dir-icon, #sstate_dir').hide();
+ $("#change-sstate_dir-form").slideDown();
+ });
+
+ $('#cancel-change-sstate_dir').click(function(){
+ $("#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");
+ }
+ else {
+ var input = $(this);
+ var re = /^\/([^ <>\\|":\.%\?\*]+)$/;
+ var invalidDir = re.test(input.val());
+ console.log(invalidDir);
+ if ( invalidDir ) {
+ $('#validate-sstate_dir').removeClass('control-group error');
+ $("#apply-change-sstate_dir").removeAttr("disabled");
+ $('#hintError-sstate_dir').hide();
+ } else {
+ $('#validate-sstate_dir').addClass('control-group error');
+ $("#apply-change-sstate_dir").attr("disabled","disabled");
+ $('#hintError-sstate_dir').show();
+ }
+ }
+ });
+
+ $('#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('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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/projects-toastertable.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/projects-toastertable.html
new file mode 100644
index 000000000..5814f32d0
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/projects-toastertable.html
@@ -0,0 +1,36 @@
+{% extends 'base.html' %}
+
+{% block title %} All projects - Toaster {% endblock %}
+
+{% block pagecontent %}
+
+ <div class="page-header top-air">
+ <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>
+
+{% endblock %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/projecttopbar.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/projecttopbar.html
new file mode 100644
index 000000000..007de06ff
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/projecttopbar.html
@@ -0,0 +1,78 @@
+{% 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="alert alert-success lead" id="project-created-notification" style="margin-top:15px; display:none">
+ <button type="button" class="close" data-dismiss="alert">Ă—</button>
+ Your project <strong>{{project.name}}</strong> has been created. You can now <a href="{% url 'projectmachines' project.id %}">select your target machine</a> and <a href="{% url 'projectimagerecipes' project.id %}">choose image recipes</a> to build.
+</div>
+
+<!-- project name -->
+<div class="page-header">
+ <h1 id="project-name-container">
+ <span id="project-name">{{project.name}}</span>
+
+ <i class="icon-pencil" data-original-title="" id="project-change-form-toggle" title=""></i>
+
+ {% if project.is_default %}
+ <i class="icon-question-sign get-help heading-help" title="" data-original-title="This project shows information about the builds you start from the command line while Toaster is running"></i>
+ {% endif %}
+ </h1>
+ <form id="project-name-change-form" style="margin-bottom: 0px; display: none;">
+ <div class="input-append">
+ <input class="huge input-xxlarge" type="text" id="project-name-change-input" autocomplete="off" value="{{project.name}}">
+ <button id="project-name-change-btn" class="btn btn-large" type="button">Save</button>
+ <a href="#" id="project-name-change-cancel" class="btn btn-large btn-link">Cancel</a>
+ </div>
+ </form>
+</div>
+
+{% if not project.is_default %}
+ <div id="project-topbar">
+ <ul class="nav nav-pills">
+ <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" style="margin-bottom:0px;">
+ <i class="icon-question-sign get-help heading-help" data-placement="left" title="" data-original-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>"></i>
+ <div class="input-append">
+ <input id="build-input" type="text" class="input-xlarge input-lg build-target-input" placeholder="Type the recipe you want to build" autocomplete="off" disabled>
+ <button id="build-button" class="btn btn-primary btn-large build-button" data-project-id="{{project.id}}" disabled>Build</button>
+ </div>
+ </form>
+ </li>
+ </ul>
+ </div>
+{% endif %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/recipe.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/recipe.html
new file mode 100644
index 000000000..1d6d64e3c
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/recipe.html
@@ -0,0 +1,267 @@
+{% 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 span11">
+ <div class="page-header">
+ <h1>{{object.name}}_{{object.version}}</h1>
+ </div>
+</div>
+
+<div class="row span7 tabbable">
+ <ul class="nav nav-pills">
+ <li class="{{tab_states.1}}">
+ <a href="#information" data-toggle="tab">
+ <i class="icon-question-sign get-help" title="Build-related information about the recipe"></i>
+ Recipe details
+ </a>
+ </li>
+ <li>
+ <a href="{% url "recipe_packages" build.pk object.id %}">
+ <i class="icon-question-sign get-help" title="The packaged output resulting from building the recipe"></i>
+ Packages ({{package_count}})
+ </a>
+ </li>
+ <li class="{{tab_states.3}}">
+ <a href="#dependencies" data-toggle="tab">
+ <i class="icon-question-sign get-help" title="The recipe build-time dependencies (i.e. other recipes)"></i>
+ Build dependencies ({{object.r_dependencies_recipe.all.count}})
+ </a>
+ </li>
+ <li class="{{tab_states.4}}">
+ <a href="#brought-in-by" data-toggle="tab">
+ <i class="icon-question-sign get-help" title="The recipe build-time reverse dependencies (i.e. the recipes that depend on this recipe)"></i>
+ 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>
+ <i class="icon-question-sign get-help" title="The name of the layer providing the recipe"></i>
+ Layer
+ </dt>
+ <dd>{{layer.name}}</dd>
+
+ <dt>
+ <i class="icon-question-sign get-help" title="Path to the recipe .bb file"></i>
+ Recipe file
+ </dt>
+ <dd><code>{{object.file_path}} {% if object.pathflags %}<i>({{object.pathflags}})</i>{% endif %}</code></dd>
+ {% if layer_version.branch %}
+ <dt>
+ <i class="icon-question-sign get-help" title="The Git branch of the layer providing the recipe"></i>
+ Layer branch
+ </dt>
+ <dd>{{layer_version.branch}}</dd>
+ {% endif %}
+ <dt>
+ <i class="icon-question-sign get-help" title="The Git commit of the layer providing the recipe"></i>
+ Layer commit
+ </dt>
+ <dd class="iscommit">{{layer_version.commit}}</dd>
+ {% if object.provides_set.all %}
+ <dt>
+ <i class="icon-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"></i>
+ 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 %}
+ <table class="table table-bordered table-hover">
+ <thead>
+ <tr>
+ <th>
+ <i class="icon-question-sign get-help" title="The running sequence of each task in the build"></i>
+ Order
+ </th>
+ <th>
+ <i class="icon-question-sign get-help" title="The name of the task"></i>
+ Task
+ </th>
+ <th>
+ <i class="icon-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)"></i>
+ Executed
+ </th>
+ <th>
+ <i class="icon-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"></i>
+ Outcome
+ </th>
+ <th>
+ <i class="icon-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"></i>
+ Cache attempt
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+
+ {% for task in tasks %}
+
+ <tr {{ task|task_color }} >
+
+ <td><a {{ task|task_color }} href="{% url "task" build.pk task.pk %}">{{task.order}}</a></td>
+ <td>
+ <a {{ task|task_color }} href="{% url "task" build.pk task.pk %}">{{task.task_name}}</a>
+ {% if task.get_description %}<i class="icon-question-sign get-help hover-help" title="" data-original-title="{{task.get_description}}"></i> {% endif %}
+ </td>
+
+ <td><a {{ task|task_color }} href="{% url "task" build.pk task.pk %}">{{task.get_executed_display}}</a></td>
+
+ <td>
+ <a {{ task|task_color }} href="{% url "task" build.pk task.pk %}">{{task.get_outcome_display}} </a>
+ {% if task.outcome = task.OUTCOME_FAILED %}
+ <a href="{% url 'build_artifact' build.pk "tasklogfile" task.pk %}">
+ <i class="icon-download-alt" title="Download task log file"></i>
+ </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 %}
+ <a {{ task|task_color }} href="{% url "task" build.pk task.pk %}">{{task.get_sstate_result_display}}</a>
+ {% endifnotequal %}
+ </td>
+
+ </tr>
+
+ {% endfor %}
+ </tbody>
+ </table>
+ {% 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="muted">satisfied via {{rr.via.name}}</span>
+ <i class="icon-question-sign get-help hover-help"
+ title="This dependency is satisfied by the PROVIDES value
+ {{rr.via.name}} in the {{rr.depends_on.name}} recipe"></i>
+ {% endif %}
+ </td>
+ <td><a href="{% url "recipe" build.pk rr.depends_on.pk %}">{{rr.depends_on.version}}</a></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="muted"> satisfied via {{rr.via.name}}</span>
+ <i class="icon-question-sign get-help hover-help"
+ title="This dependency is satisfied by the PROVIDES value
+ {{rr.via.name}} in the {{rr.depends_on.name}} recipe"></i>
+ {% endif %}
+ </td>
+ <td><a href="{% url "recipe" build.pk rr.recipe.pk %}">{{rr.recipe.version}}</a></td>
+ </tr>
+ {% endfor %}
+
+ </tbody>
+ </table>
+ {% endif %}
+
+ </div>
+ </div>
+</div>
+
+<div class="row span4 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
+ <i class="icon-question-sign get-help" title="The section in which recipes should be categorized"></i>
+ </dt>
+ <dd>{{object.section}}</dd>
+ {% endif %}
+ {% if object.license %}
+ <dt>License</dt>
+ <dd>{{object.license}}</dd>
+ {% endif %}
+ </dl>
+</div>
+
+{% endblock %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/recipe_btn.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/recipe_btn.html
new file mode 100644
index 000000000..baab06eb5
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/recipe_btn.html
@@ -0,0 +1,16 @@
+<button data-recipe-name="{{data.name}}" class="btn 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
+</button>
+<button class="btn 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%}"}' data-directive="add"
+ {% if data.layer_version.pk in extra.current_layers %}
+ style="display:none;"
+ {% endif %}
+>
+ <i class="icon-plus"></i>
+ Add layer
+ <i title="" class="icon-question-sign get-help" data-original-title="To build this target, you must first add the {{data.layer_version.layer.name}} layer to your project"></i>
+</button>
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/recipe_packages.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/recipe_packages.html
new file mode 100644
index 000000000..d25847bc0
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/recipe_packages.html
@@ -0,0 +1,123 @@
+{% 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-fluid span11">
+ <div class="page-header">
+ <h1>{{recipe.name}}_{{recipe.version}}</h1>
+ </div>
+</div>
+
+<div class="row-fluid span7 tabbable">
+ <ul class="nav nav-pills">
+ <li>
+ <a href="{% url "recipe" build.pk recipe.id "1" %}">
+ <i class="icon-question-sign get-help" title="Build-related information about the recipe"></i>
+ Recipe details
+ </a>
+ </li>
+ <li class="active">
+ <a href="#packages-built" data-toggle="tab">
+ <i class="icon-question-sign get-help" title="The packaged output resulting from building the recipe"></i>
+ Packages ({{object_count}})
+ </a>
+ </li>
+ <li>
+ <a href="{% url "recipe" build.pk recipe.id "3" %}">
+ <i class="icon-question-sign get-help" title="The recipe build-time dependencies (i.e. other recipes)"></i>
+ Build dependencies ({{recipe.r_dependencies_recipe.all.count}})
+ </a>
+ </li>
+ <li>
+ <a href="{% url "recipe" build.pk recipe.id "4" %}">
+ <i class="icon-question-sign get-help" title="The recipe build-time reverse dependencies (i.e. the recipes that depend on this recipe)"></i>
+ 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><a href="{% url "package_built_detail" build.pk package.pk %}">{{package.version}}_{{package.revision}}</a></td>
+ <td class="sizecol"><a href="{% url "package_built_detail" build.pk package.pk %}">{{package.size|filtered_filesizeformat}}</a></td>
+ </tr>
+
+ {% endfor %}
+
+ {% endif %}
+ {% if objects %}
+ </tbody>
+ </table>
+ {% include "detail_pagination_bottom.html" %}
+ {% endif %}
+ </div> {# tab-pane #}
+ </div> {# tab-content #}
+</div> {# span7 #}
+
+<div class="row span4 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>
+{% endblock pagedetailinfomain %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/recipedetails.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/recipedetails.html
new file mode 100644
index 000000000..23aa171ce
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/recipedetails.html
@@ -0,0 +1,177 @@
+{% extends "base.html" %}
+{% load projecttags %}
+{% load humanize %}
+{% load static %}
+{% block pagecontent %}
+
+<div class="section">
+ <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>
+</div>
+
+<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="row-fluid span11">
+ <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 air">
+ <h1>
+ {{recipe.name}}
+ <small>({{recipe.layer_version.layer.name}})</small>
+ </h1>
+ </div>
+</div>
+
+<div class="row-fluid span11">
+ <div class="span8">
+ <div class="button-place btn-group" id="customise-build-btns"
+ style="width: 100%;
+ {% if not in_project %}
+ display:none;
+ {% endif %}">
+ <button class="btn btn-large span6 build-recipe-btn" style="width: 50%">
+ Build {{recipe.name}}
+ </button>
+ {% if recipe.is_image %}
+ <button class="btn btn-large span6 customise-btn" data-recipe="{{recipe.pk}}" style="width: 50%">
+ Customise {{recipe.name}}
+ </button>
+ {% endif %}
+ </div>
+ <div class="button-place">
+ <button class="btn btn-block btn-large" id="add-layer-btn"
+ style="width:100%;
+ {% if in_project %}
+ display:none;
+ {% endif %}">
+ <i class="icon-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-large 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="span4 well">
+ <h2 style="margin-bottom:20px;">About {{recipe.name}}</h2>
+ <dl>
+ <dt>
+ Approx. packages included
+ <i class="icon-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"></i>
+ </dt>
+ <dd class="no-packages">{{packages.count}}</dd>
+ <dt>
+ Approx. package size
+ <i class="icon-question-sign get-help" title="" data-original-title="Package size is based on information from previous builds, so we can never be sure it is 100% accurate"></i>
+ </dt>
+ <dd>{{approx_pkg_size.size__sum|filtered_filesizeformat}}</dd>
+ {% if last_build %}
+ <dt>Last build</dt>
+ <dd>
+ <i class="icon-ok-sign success"></i>
+ <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}}"><i class="icon-share" title="" data-original-title="View recipe file"></i></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>
+
+{% endblock %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/recipes.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/recipes.html
new file mode 100644
index 000000000..d14489346
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/recipes.html
@@ -0,0 +1,113 @@
+{% extends "basebuildpage.html" %}
+
+{% load projecttags %}
+
+{% block title %} Recipes - {{build.target_set.all|dictsort:"target"|join:", "}} {{build.machine}} - {{build.project.name}} - Toaster {% endblock %}
+{% block localbreadcrumb %}
+<li>Recipes</li>
+{% endblock %}
+
+{% block nav-recipes %}
+ <li class="active"><a href="{% url 'recipes' build.pk %}">Recipes</a></li>
+{% endblock %}
+
+{% block buildinfomain %}
+<div class="span10">
+<div class="page-header">
+<h1>
+ {% if request.GET.search and objects.paginator.count > 0 %}
+ {{objects.paginator.count}} recipe{{objects.paginator.count|pluralize}} found
+ {%elif request.GET.search and objects.paginator.count == 0%}
+ No recipes found
+ {%else%}
+ Recipes
+ {%endif%}
+ </h1>
+</div>
+
+{% if objects.paginator.count == 0 %}
+ <div class="row-fluid">
+ <div class="alert">
+ <form class="no-results input-append" id="searchform">
+ <input id="search" name="search" class="input-xxlarge" type="text" value="{%if request.GET.search%}{{request.GET.search}}{%endif%}"/>{% if request.GET.search %}<a href="javascript:$('#search').val('');searchform.submit()" class="add-on btn" tabindex="-1"><i class="icon-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 recipes</button>
+ </form>
+ </div>
+ </div>
+
+{% else %}
+{% include "basetable_top.html" %}
+
+ {% for recipe in objects %}
+
+ <tr class="data">
+ <td class="recipe__name">
+ <a href="{% url "recipe" build.pk recipe.pk %}">{{recipe.name}}</a>
+ </td>
+ <td class="recipe__version">
+ <a href="{% url "recipe" build.pk recipe.pk %}">{{recipe.version}}</a>
+ </td>
+ <!-- Depends -->
+ <td class="depends_on">
+ {% with deps=recipe_deps|get_dict_value:recipe.pk %}
+ {% with count=deps|length %}
+ {% if count %}
+ <a class="btn"
+ title="<a href='{% url "recipe" build.pk recipe.pk %}#dependencies'>{{recipe.name}}</a> dependencies"
+ data-content="<ul class='unstyled'>
+ {% for i in deps|dictsort:"depends_on.name"%}
+ <li><a href='{% url "recipe" build.pk i.depends_on.pk %}'>{{i.depends_on.name}}</a></li>
+ {% endfor %}
+ </ul>">
+ {{count}}
+ </a>
+ {% endif %}
+ {% endwith %}
+ {% endwith %}
+ </td>
+ <!-- Brought in by -->
+ <td class="depends_by">
+ {% with revs=recipe_revs|get_dict_value:recipe.pk %}
+ {% with count=revs|length %}
+ {% if count %}
+ <a class="btn"
+ title="<a href='{% url "recipe" build.pk recipe.pk %}#brought-in-by'>{{recipe.name}}</a> reverse dependencies"
+ data-content="<ul class='unstyled'>
+ {% for i in revs|dictsort:"recipe.name" %}
+ <li><a href='{% url "recipe" build.pk i.recipe.pk %}'>{{i.recipe.name}}</a></li>
+ {% endfor %}
+ </ul>">
+ {{count}}
+ </a>
+ {% endif %}
+ {% endwith %}
+ {% endwith %}
+ </td>
+ <!-- Recipe file -->
+ <td class="recipe_file">{{recipe.file_path}} {% if recipe.pathflags %}<i>({{recipe.pathflags}})</i>{% endif %}</td>
+ <!-- Section -->
+ <td class="recipe_section">{{recipe.section}}</td>
+ <!-- License -->
+ <td class="recipe_license">{{recipe.license}}</td>
+ <!-- Layer -->
+ <td class="layer_version__layer__name">{{recipe.layer_version.layer.name}}</td>
+ <!-- Layer branch -->
+ <td class="layer_version__branch">{{recipe.layer_version.branch}}</td>
+ <!-- Layer commit -->
+ <td class="layer_version__layer__commit">
+ <a class="btn"
+ data-content="<ul class='unstyled'>
+ <li>{{recipe.layer_version.commit}}</li>
+ </ul>">
+ {{recipe.layer_version.commit|truncatechars:13}}
+ </a>
+ </td>
+ </tr>
+
+ {% endfor %}
+
+{% include "basetable_bottom.html" %}
+{% endif %}
+</div>
+{% endblock %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/snippets/pkg_dependencies_popover.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/snippets/pkg_dependencies_popover.html
new file mode 100644
index 000000000..a3fcdb09e
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/snippets/pkg_dependencies_popover.html
@@ -0,0 +1,14 @@
+{# Popover that displays the dependences and sizes of a package 'data' used in the Packages table #}
+{% with data.package_dependencies_source.all_depends.count as dep_count %}
+{% load projecttags %}
+{% if dep_count %}
+ <a data-content="<ul class='unstyled'>
+ {% for dep in data.package_dependencies_source.all_depends %}
+ <li>{{dep.depends_on.name}} {% if dep.depends_on.size > 0 %}({{dep.depends_on.size|filtered_filesizeformat}}){% endif %}</li>
+ {% endfor %}
+ </ul>" title="" class="btn" data-original-title="
+ <strong>{{data.name}}</strong> dependencies - <strong>{{data.package_dependencies_source.get_total_source_deps_size.depends_on__size__sum|filtered_filesizeformat}}</strong>">
+ {{dep_count}}
+</a>
+{% endif %}
+{% endwith %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html
new file mode 100644
index 000000000..453a9d013
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html
@@ -0,0 +1,14 @@
+{# Popover that displays the reverse dependencies and sizes of a package 'data' used in the Packages table #}
+{% with data.package_dependencies_target.all_depends.count as dep_count %}
+{% load projecttags %}
+{% if dep_count %}
+ <a data-content="<ul class='unstyled'>
+ {% for dep in data.package_dependencies_target.all_depends|dictsort:'package.name' %}
+ <li>{{dep.package.name}} {% if dep.package.size > 0 %}({{dep.package.size|filtered_filesizeformat}}){% endif %}</li>
+ {% endfor %}
+ </ul>" title="" class="btn" data-original-title="
+ <strong>{{data.name}}</strong> reverse dependencies - <strong>{{data.package_dependencies_target.get_total_revdeps_size.package_id__size__sum|filtered_filesizeformat}}</strong>">
+ {{dep_count}}
+</a>
+{% endif %}
+{% endwith %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/tablesort.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/tablesort.html
new file mode 100644
index 000000000..362474293
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/target.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/target.html
new file mode 100644
index 000000000..4c33eaa84
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/target.html
@@ -0,0 +1,163 @@
+{% 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="row-fluid span10">
+ <div class="page-header">
+ <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>
+
+<div class="row-fluid pull-right span10" id="navTab">
+ <ul class="nav nav-pills">
+ <li class="active">
+ <a href="#target">
+ <i class="icon-question-sign get-help" title="Of all the packages built, the subset installed in the root file system of this image"></i>
+ Packages included ({{target.package_count}} - {{packages_sum|filtered_filesizeformat}})
+ </a>
+ </li>
+ <li>
+ <a href="{% url 'dirinfo' build.id target.id %}">
+ <i class="icon-question-sign get-help" title="The directories and files in the root file system of this image"></i>
+ Directory structure
+ </a>
+ </li>
+ </ul>
+
+ <div id="image-packages" class="tab-pane">
+
+ {% if objects.paginator.count == 0 %}
+ <div class="row-fluid">
+ <div class="alert">
+ <form class="no-results input-append" id="searchform">
+ <input id="search" name="search" class="input-xxlarge" type="text" value="{% if request.GET.search %}{{request.GET.search}}{% endif %}"/>{% if request.GET.search %}<a href="javascript:$('#search').val('');searchform.submit()" class="add-on btn" tabindex="-1"><i class="icon-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 packages</button>
+ </form>
+ </div>
+ </div>
+
+
+ {% else %}
+ {% include "basetable_top.html" %}
+ {% for package in objects %}
+ <tr>
+ {# order of the table data must match the columns defined in template's context tablecols #}
+ <td class="package_name">
+ <a href="{% url 'package_included_detail' build.id target.id package.id %}">
+ {{package.name}}
+ </a>
+ {% if package.installed_name and package.name != package.installed_name %}
+ <span class="muted"> as {{package.installed_name}}</span>
+ <i class="icon-question-sign get-help hover-help" title='{{package.name|add:" was renamed at packaging time and was installed in your image as "|add:package.installed_name}}'></i>
+ {% endif %}
+ </td>
+ <td class="package_version">
+ <a href="{% url 'package_included_detail' build.id target.id package.id %}">
+ {{package.version|filtered_packageversion:package.revision}}
+ </a>
+ </td>
+ <td class="license">
+ {{package.license}}
+ </td>
+ <td class="size sizecol">
+ {{package.size|filtered_installedsize:package.installed_size|filtered_filesizeformat}}
+ </td>
+
+ <td class="size_over_total sizecol">
+ {{package|filter_sizeovertotal:packages_sum}}
+ </td>
+ <td class="depends">
+ {% with deps=package.runtime_dependencies %}
+ {% with deps_count=deps|length %}
+ {% if deps_count > 0 %}
+ <a class="btn"
+ title="<a href='{% url "package_included_dependencies" build.id target.id package.id %}'>{{package.name}}</a> dependencies"
+ data-content="<ul class='unstyled'>
+ {% for i in deps|dictsort:'depends_on.name' %}
+ <li><a href='{% url "package_included_detail" build.pk target.id i.depends_on.pk %}'>{{i.depends_on.name}}</a></li>
+ {% endfor %}
+ </ul>">
+ {{deps_count}}
+ </a>
+ {% endif %}
+ {% endwith %}
+ {% endwith %}
+ </td>
+ <td class="brought_in_by">
+ {% with rdeps=package.reverse_runtime_dependencies %}
+ {% with rdeps_count=rdeps|length %}
+ {% if rdeps_count > 0 %}
+ <a class="btn"
+ title="<a href='{% url "package_included_reverse_dependencies" build.id target.id package.id %}'>{{package.name}}</a> reverse dependencies"
+ data-content="<ul class='unstyled'>
+ {% for i in rdeps|dictsort:'package.name' %}
+ <li><a href='{% url "package_included_detail" build.id target.id i.package.id %}'>{{i.package.name}}</a></li>
+ {% endfor %}
+ </ul>">
+ {{rdeps_count}}
+ </a>
+ {% endif %}
+ {% endwith %}
+ {% endwith %}
+ </td>
+ <td class="recipe_name">
+ {% if package.recipe.version %}
+ <a href="{% url 'recipe' build.id package.recipe_id %}">
+ {{ package.recipe.name }}
+ </a>
+ {% endif %}
+ </td>
+ <td class="recipe_version">
+ {% if package.recipe.version %}
+ <a href="{% url 'recipe' build.id package.recipe_id %}">
+ {{ package.recipe.version }}
+ </a>
+ {% endif %}
+ </td>
+ <td class="layer_name">
+ {{ package.recipe.layer_version.layer.name }}
+ </td>
+ <td class="layer_branch">
+ {{ package.recipe.layer_version.branch}}
+ </td>
+ <td class="layer_commit">
+ <a class="btn"
+ data-content="<ul class='unstyled'>
+ <li>{{package.recipe.layer_version.commit}}</li>
+ </ul>">
+ {{package.recipe.layer_version.commit|truncatechars:13}}
+ </a>
+ </td>
+ </tr>
+ {% endfor %}
+
+ {% include "basetable_bottom.html" %}
+ {% endif %}
+ </div> <!-- tabpane -->
+</div> <!--span 10-->
+{% endblock buildinfomain %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/task.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/task.html
new file mode 100644
index 000000000..576826243
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/task.html
@@ -0,0 +1,277 @@
+{% 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 span11">
+ <div class="page-header">
+ <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}}
+ <i class="icon-question-sign get-help heading-help" title="{{task.get_outcome_help}}"></i>
+</h2>
+{%if task.task_executed %}
+ {# executed tasks outcome #}
+ {% if task.logfile %}
+ <a class="btn btn-large" href="{% url 'build_artifact' build.id "tasklogfile" task.pk %}" style="margin:15px;">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-mini">...</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-mini 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" href="javascript:reload_params({'show_matches' : 'true' })">Match to tasks in previous builds <i class="icon-question-sign get-help" style="margin-top:20px;" 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"></i></a>
+ {% elif matching_tasks %}
+ <h3 class="details">Prebuilt task could be based on
+ <i class="icon-question-sign get-help heading-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"></i>
+ </h3>
+ <table class="table table-bordered table-hover">
+ <thead>
+ <th>
+ <i class="icon-question-sign get-help" title="The name of the recipe to which each task applies"></i>
+ Recipe
+ </th>
+ <th>
+ <i class="icon-question-sign get-help" title="The name of the task"></i>
+ Task
+ </th>
+ <th>
+ <i class="icon-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)"></i>
+ Executed
+ </th>
+ <th>
+ <i class="icon-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"></i>
+ Outcome
+ </th>
+ <th>
+ <i class="icon-question-sign get-help" title="The date and time the build finished"></i>
+ Build completed on
+ </th>
+ </thead>
+ <tbody>
+ {% for match in matching_tasks %}
+ <tr {{ match|task_color }}>
+ <td>
+ <a href="{%url "task" match.build.pk match.pk%}">{{match.recipe.name}}</a>
+ </td>
+ <td>
+ <a href="{%url "task" match.build.pk match.pk%}">{{match.task_name}}</a>
+ {% if task.get_description %}
+ <i class="icon-question-sign get-help hover-help" title="{{task.get_description}}"></i>
+ {% endif %}
+ </td>
+ <td>
+ <a href="{%url "task" match.build.pk match.pk%}">{{match.get_executed_display}}</a>
+ </td>
+ <td>
+ <a href="{%url "task" match.build.pk match.pk%}">{{match.get_outcome_display}} </a><i class="icon-question-sign get-help hover-help" title="{{match.get_outcome_help}}"></i>
+ </td>
+ <td>
+ <a href="{%url "task" match.build.pk match.pk%}">{{match.build.completed_on|date:"d/m/y H:i"}}</a>
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ {% 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>
+ <i class="icon-question-sign get-help" title="The task(s) providing the outcome of this task"></i> Task covered by
+ </dt>
+ <dd>
+ <ul>
+ {% 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-large" href="{% url 'build_artifact' build.id "tasklogfile" t.pk %}" style="margin:15px;">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
+ <i class="icon-question-sign get-help heading-help" title="'Executed' tasks are those that need to run in order to generate the task output"></i>
+ {% else %}
+ <h2 class="muted">
+ Not Executed
+ <i class="icon-question-sign get-help heading-help" title="'Not executed' tasks don't need to run because their outcome is provided by another task"></i>
+ {% endif %}
+ </h2>
+
+<dl class="dl-horizontal">
+ <dt>
+ <i class="icon-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"></i>
+ Task inputs signature
+ </dt>
+ <dd>
+ {{task.sstate_checksum}}
+ </dd>
+</dl>
+ {% if task.sstate_result != task.SSTATE_NA %}
+ <div class="alert alert-info">Attempting to restore output from sstate cache
+ <i class="icon-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"></i>
+ </div>
+ <dl class="dl-horizontal">
+ <dt>
+ <i class="icon-question-sign get-help" title="The name of the file searched for in your <code>sstate-cache</code> directory and mirrors"></i>
+ File searched for
+ </dt>
+ <dd><code>{{task.path_to_sstate_obj}}</code></dd>
+ <dt>
+ <i class="icon-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)"></i>
+ URI(s) searched
+ </dt>
+ <dd><ul>{% 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">
+ <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>
+ <i class="icon-question-sign get-help" title="The running sequence of each task in the build"></i>
+ Task order
+ </dt>
+ <dd><a href="{%url "tasks_task" build.pk task.order %}#{{task.order}}">{{task.order}}</a></dd>
+ {% if task.task_executed %}
+ <dt>
+ <i class="icon-question-sign get-help" title="Indicates if this task executes a Python or Shell function(s)"></i>
+ 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>
+ <i class="icon-question-sign get-help" title="Task dependency chain (i.e. other tasks)"></i>
+ Dependencies
+ </dt>
+ <dd>
+ <ul>
+ {% 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="muted">This task has no dependencies</li>
+ {% endfor %}
+ </ul>
+ </dd>
+ <dt>
+ <i class="icon-question-sign get-help" title="Tasks that depend on this task"></i>
+ Reverse dependencies
+ </dt>
+ <dd>
+ <ul>
+ {% 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="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>
+ <i class="icon-question-sign get-help" title="How long it took the task to finish in seconds"></i>
+ Time (secs)
+ </dt>
+ <dd>{{task.elapsed_time|format_none_and_zero|floatformat:2}}</dd>
+ {% endif %}
+ {% if task.cpu_time_user > 0 %}
+ <dt>
+ <i class="icon-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."></i>
+ 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>
+ <i class="icon-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."></i>
+ System CPU time (secs)
+ </dt>
+ <dd>{{task.cpu_time_system|format_none_and_zero|floatformat:2}}</dd>
+ {% endif %}
+ {% if task.disk_io > 0 %}
+ <dt>
+ <i class="icon-question-sign get-help" title="Number of bytes written to and read from the disk during the task"></i>
+ Disk I/O (bytes)
+ </dt>
+ <dd>{{task.disk_io|format_none_and_zero|intcomma}}</dd>
+ {% endif %}
+ </dl>
+
+</div>
+{% endblock %}
+
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/tasks.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/tasks.html
new file mode 100644
index 000000000..84bc10386
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/tasks.html
@@ -0,0 +1,143 @@
+{% extends "basebuildpage.html" %}
+{% load humanize %}
+{% load projecttags %}
+
+{% block title %} {{mainheading}} - {{build.target_set.all|dictsort:"target"|join:", "}} {{build.machine}} - {{build.project.name}} - Toaster{% endblock %}
+{% block localbreadcrumb %}
+<li>{{mainheading}}</li>
+{% endblock %}
+
+{% block nav-tasks %}
+ {% if 'Tasks' == mainheading %}
+ <li class="active"><a href="{% url 'tasks' build.pk %}">Tasks</a></li>
+ {% else %}
+ <li><a href="{% url 'tasks' build.pk %}">Tasks</a></li>
+ {% endif %}
+{% endblock %}
+{% block nav-buildtime %}
+ {% if 'Time' == mainheading %}
+ <li class="active"><a href="{% url 'buildtime' build.pk %}">Time</a></li>
+ {% else %}
+ <li><a href="{% url 'buildtime' build.pk %}">Time</a></li>
+ {% endif %}
+{% endblock %}
+
+{% block nav-cputime %}
+ {% if 'CPU time' == mainheading %}
+ <li class="active"><a href="{% url 'cputime' build.pk %}">CPU time</a></li>
+ {% else %}
+ <li><a href="{% url 'cputime' build.pk %}">CPU time</a></li>
+ {% endif %}
+{% endblock %}
+
+{% block nav-diskio %}
+ {% if 'Disk I/O' == mainheading %}
+ <li class="active"><a href="{% url 'diskio' build.pk %}">Disk I/O</a></li>
+ {% else %}
+ <li><a href="{% url 'diskio' build.pk %}">Disk I/O</a></li>
+ {% endif %}
+{% endblock %}
+
+{% block buildinfomain %}
+<div class="span10">
+{% if not request.GET.filter and not request.GET.search and not objects.paginator.count %}
+ <!-- Empty - no data in database -->
+ <div class="page-header">
+ <h1>{{mainheading}}</h1>
+ </div>
+ <div class="alert alert-info lead">
+ No data was recorded for this build.
+ </div>
+
+{% else %}
+
+ <div class="page-header">
+ <h1>
+ {% if request.GET.filter and objects.paginator.count > 0 or request.GET.search and objects.paginator.count > 0 %}
+ {{objects.paginator.count}} task{{objects.paginator.count|pluralize}} found
+ {%elif request.GET.filter and objects.paginator.count == 0 or request.GET.search and objects.paginator.count == 0 %}
+ No tasks found
+ {%else%}
+ {{mainheading}}
+ {%endif%}
+ </h1>
+ </div>
+
+ {% if objects.paginator.count == 0 %}
+ <div class="row-fluid">
+ <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="add-on btn" tabindex="-1"><i class="icon-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 tasks</button>
+ </form>
+ </div>
+ </div>
+
+
+ {% else %}
+ {% include "basetable_top.html" %}
+
+ {% for task in objects %}
+ <tr {{ task|task_color }} id="{{task.order}}">
+ <td class="order">
+ <a href="{%url "task" build.pk task.pk%}">{{task.order}}</a>
+ </td>
+ <td class="recipe_name" >
+ <a href="{% url "recipe" build.pk task.recipe.pk %}">{{task.recipe.name}}</a>
+ </td>
+ <td class="recipe_version">
+ <a href="{% url "recipe" build.pk task.recipe.pk %}">{{task.recipe.version}}</a>
+ </td>
+ <td class="task_name">
+ <a href="{%url "task" build.pk task.pk%}">{{task.task_name}}</a> {% if task.get_description %}<i class="icon-question-sign get-help hover-help" title="{{task.get_description}}"></i> {% endif %}
+ </td>
+ <td class="executed">
+ <a href="{%url "task" build.pk task.pk%}">{{task.get_executed_display}}</a>
+ </td>
+ <td class="outcome">
+ <a href="{%url "task" build.pk task.pk%}">{{task.get_outcome_display}} </a>
+ {% if task.outcome = task.OUTCOME_FAILED %}
+ <a href="{% url 'build_artifact' build.pk "tasklogfile" task.pk %}">
+ <i class="icon-download-alt" title="Download task log file"></i>
+ </a>
+ {% endif %}
+ <i class="icon-question-sign get-help hover-help" title="{{task.get_outcome_help}}"></i>
+ </td>
+ <td class="cache_attempt">
+ <a href="{%url "task" build.pk task.pk%}">{{task.get_sstate_result_display|format_none_and_zero}}</a>
+ </td>
+ <td class="time_taken">
+ {{task.elapsed_time|format_none_and_zero|floatformat:2}}
+ </td>
+ <td class="cpu_time_system">
+ {{task.cpu_time_system|format_none_and_zero|floatformat:2}}
+ </td>
+ <td class="cpu_time_user">
+ {{task.cpu_time_user|format_none_and_zero|floatformat:2}}
+ </td>
+ <td class="disk_io">
+ {{task.disk_io|format_none_and_zero|intcomma}}
+ </td>
+
+ </tr>
+ {% endfor %}
+
+ {% include "basetable_bottom.html" %}
+ {% endif %} {# objects.paginator.count #}
+{% endif %} {# empty #}
+</div>
+
+<script type="text/javascript">
+
+ $(document).ready(function() {
+ // highlight heading on the column for the field used for ordering
+ if (location.href.search('#') > -1) {
+ var task_order = location.href.split('#')[1];
+ $("#" + task_order).addClass("highlight");
+ }
+ });
+
+</script>
+
+{% endblock %}
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/toastertable-filter.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/toastertable-filter.html
new file mode 100644
index 000000000..4d28793bf
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/toastertable-filter.html
@@ -0,0 +1,20 @@
+<!-- filter modal -->
+<div id="filter-modal-{{table_name}}" class="modal hide fade" tabindex="-1" role="dialog" aria-hidden="false">
+ <form id="filter-modal-form-{{table_name}}" style="margin-bottom: 0px">
+ <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">
+ <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>
+<button id="clear-filter-btn-{{table_name}}" style="display:none"></button>
+<!-- end filter modal -->
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/toastertable-simple.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/toastertable-simple.html
new file mode 100644
index 000000000..212318bc5
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/toastertable-simple.html
@@ -0,0 +1,94 @@
+
+{% 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 class="row-fluid" id="no-results-{{table_name}}" style="display:none">
+ <div class="alert">
+ <form class="no-results input-append">
+ <input class="input-xlarge" id="new-search-input-{{table_name}}" name="search" type="text" placeholder="Search {{title|lower}}" value="{% if request.GET.search %}{{request.GET.search}}{% endif %}"/>
+ <a href="#" class="add-on btn remove-search-btn-{{table_name}}" tabindex="-1">
+ <i class="icon-remove"></i>
+ </a>
+ <button class="btn search-submit-{{table_name}}" >Search</button>
+ <button class="btn btn-link remove-search-btn-{{table_name}}">Show {{title|lower}}
+ </button>
+ </form>
+ </div>
+</div>
+<div id="table-container-{{table_name}}" style="visibility: hidden">
+ <!-- control header -->
+ <div class="row-fluid" id="table-chrome-{{table_name}}">
+ <div class="navbar-search input-append pull-left">
+
+ <input class="input-xlarge" id="search-input-{{table_name}}" name="search" type="text" placeholder="Search {{title|lower}}" value="{% if request.GET.search %}{{request.GET.search}}{% endif %}"/>
+ <a href="#" style="display:none" class="add-on btn remove-search-btn-{{table_name}}" tabindex="-1">
+ <i class="icon-remove"></i>
+ </a>
+ <button class="btn" id="search-submit-{{table_name}}" >Search</button>
+ </div>
+
+ <div class="pull-right">
+
+ <div style="display:inline">
+ <span class="divider-vertical"></span>
+ <span class="help-inline" style="padding-top:5px;">Show rows:</span>
+ <select style="margin-top:5px;margin-bottom:0px;" class="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>
+ </div>
+ </div>
+
+ <!-- The actual table -->
+ <table class="table table-bordered table-hover tablesorter" id="{{table_name}}">
+ <thead>
+ <tr><th></th></tr>
+ </thead>
+ <tbody></tbody>
+ </table>
+
+ <!-- Pagination controls -->
+ <div class="pagination pagination-centered" id="pagination-{{table_name}}">
+ <ul class="pagination" style="display: block-inline">
+ </ul>
+
+ <div class="pull-right">
+ <span class="help-inline" style="padding-top:5px;">Show rows:</span>
+ <select style="margin-top:5px;margin-bottom:0px;" class="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>
+ </div>
+</div>
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/toastertable.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/toastertable.html
new file mode 100644
index 000000000..21c3d36c7
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/toastertable.html
@@ -0,0 +1,105 @@
+
+{% 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="no-results-{{table_name}}" style="display:none">
+ <div class="alert">
+ <form class="no-results input-append">
+ <input class="input-xxlarge" id="new-search-input-{{table_name}}" name="search" type="text" placeholder="Search {{title|lower}}" value="{%if request.GET.search %}{{request.GET.search}}{%endif%}"/>
+ <a href="#" class="add-on btn remove-search-btn-{{table_name}}" tabindex="-1">
+ <i class="icon-remove"></i>
+ </a>
+ <button class="btn 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" id="table-chrome-{{table_name}}">
+ <div class="navbar-inner">
+ <div class="navbar-search input-append pull-left span6">
+
+ <input id="search-input-{{table_name}}" name="search" type="text" placeholder="Search {{title|lower}}" value="{%if request.GET.search%}{{request.GET.search}}{%endif%}"/>
+ <a href="#" style="display:none" class="add-on btn remove-search-btn-{{table_name}}" tabindex="-1">
+ <i class="icon-remove"></i>
+ </a>
+ <button class="btn" id="search-submit-{{table_name}}" >Search</button>
+ </div>
+
+ <div class="pull-right">
+ <div class="btn-group">
+ <button id="edit-columns-button" class="btn dropdown-toggle" data-toggle="dropdown">Edit columns
+ <span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu editcol">
+ </ul>
+ </div>
+ <div style="display:inline">
+ <span class="divider-vertical"></span>
+ <span class="help-inline" style="padding-top:5px;">Show rows:</span>
+ <select style="margin-top:5px;margin-bottom:0px;" class="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>
+ </div>
+ </div>
+ </div>
+
+ <!-- The actual table -->
+ <table class="table table-bordered table-hover tablesorter" id="{{table_name}}">
+ <thead>
+ <tr><th></th></tr>
+ </thead>
+ <tbody></tbody>
+ </table>
+
+ <!-- Pagination controls -->
+ <div class="pagination pagination-centered" id="pagination-{{table_name}}">
+ <ul class="pagination" style="display: block-inline">
+ </ul>
+
+ <div class="pull-right">
+ <span class="help-inline" style="padding-top:5px;">Show rows:</span>
+ <select style="margin-top:5px;margin-bottom:0px;" class="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>
+ </div>
+</div>
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/unavailable_artifact.html b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/unavailable_artifact.html
new file mode 100644
index 000000000..2d3d02c2e
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templates/unavailable_artifact.html
@@ -0,0 +1,16 @@
+{% extends "base.html" %}
+{% load projecttags %}
+{% load humanize %}
+{% load static %}
+
+{% block title %} Build artifact does not exist - Toaster {% endblock %}
+
+{% block pagecontent %}
+ <div class="row-fluid air">
+ <div class="alert alert-info span8 lead">
+ <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>
+{% endblock %}
+
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templatetags/__init__.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templatetags/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templatetags/__init__.py
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templatetags/objects_to_dictionaries_filter.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templatetags/objects_to_dictionaries_filter.py
new file mode 100644
index 000000000..0dcc7d271
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templatetags/project_url_tag.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templatetags/project_url_tag.py
new file mode 100644
index 000000000..04770ac6a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templatetags/projecttags.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
new file mode 100644
index 000000000..75f2261be
--- /dev/null
+++ b/import-layers/yocto-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=muted'
+ elif task_object.outcome == task_object.OUTCOME_FAILED:
+ return 'class=error'
+ elif task_object.outcome == task_object.OUTCOME_SUCCESS and show_green:
+ return 'class=green'
+ 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="muted"')
+ return ''
+
+@register.filter
+def format_vpackage_namehelp(name):
+ r = name + '&nbsp;'
+ r += '<i class="icon-question-sign get-help hover-help"'
+ r += ' title = "' + name + ' has not been built">'
+ r += '</i>'
+ 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 format_build_date(completed_on):
+ now = timezone.now()
+ delta = now - completed_on
+
+ if delta.days >= 1:
+ return True
+
+@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
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/tests.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/tests.py
new file mode 100644
index 000000000..a4cab5848
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/tests.py
@@ -0,0 +1,494 @@
+#! /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.utils import timezone
+
+from orm.models import Project, Release, BitbakeVersion, Package, LogMessage
+from orm.models import ReleaseLayerSourcePriority, LayerSource, Layer, Build
+from orm.models import Layer_Version, Recipe, Machine, ProjectLayer, Target
+from orm.models import CustomImageRecipe, ProjectVariable
+from orm.models import Branch, CustomImagePackage
+
+import toastermain
+import inspect
+import toastergui
+
+from toastergui.tables import SoftwareRecipesTable
+import json
+from datetime import timedelta
+from bs4 import BeautifulSoup
+import re
+import string
+import json
+
+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.recipe2 = Recipe.objects.last()
+ 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)
+
+ self.assertTrue("error" in data)
+ self.assertEqual(data["error"], "ok")
+ self.assertTrue("rows" in data)
+
+ self.assertTrue(self.project.name in [x["name"] for x in data["rows"]])
+ self.assertTrue("id" in data["rows"][0])
+
+ 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)
+
+ 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_import_layer(self):
+ """Test xhr_importlayer API"""
+ LayerSource.objects.create(sourcetype=LayerSource.TYPE_IMPORTED)
+ #Test for importing an already existing layer
+ args = {'vcs_url' : "git://git.example.com/test",
+ 'name' : "base-layer",
+ 'git_ref': "c12b9596afd236116b25ce26dbe0d793de9dc7ce",
+ 'project_id': self.project.id,
+ 'dir_path' : "/path/in/repository"}
+ response = self.client.post(reverse('xhr_importlayer'), args)
+ data = json.loads(response.content)
+ self.assertEqual(response.status_code, 200)
+ self.assertEqual(data["error"], "ok")
+
+ #Test to verify import of a layer successful
+ args['name'] = "meta-oe"
+ response = self.client.post(reverse('xhr_importlayer'), args)
+ data = json.loads(response.content)
+ self.assertTrue(data["error"], "ok")
+
+ #Test for html tag in the data
+ args['<'] = "testing html tag"
+ response = self.client.post(reverse('xhr_importlayer'), args)
+ data = json.loads(response.content)
+ self.assertNotEqual(data["error"], "ok")
+
+ #Empty data passed
+ args = {}
+ response = self.client.post(reverse('xhr_importlayer'), args)
+ data = json.loads(response.content)
+ 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)
+ 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)
+ 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)
+ 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)
+ 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), 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)
+ self.assertEqual(json.loads(response.content), {"error": "ok"})
+ # 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)["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),
+ {"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), {"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)["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),
+ {"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", 'wa').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)
+
+ rows = data['rows']
+ row1 = next(x for x in rows if x['name'] == self.recipe1.name)
+ row2 = next(x for x in rows if x['name'] == self.recipe2.name)
+
+ self.assertEqual(response.status_code, 200, 'should be 200 OK status')
+
+ # check other columns have been populated correctly
+ self.assertEqual(row1['name'], self.recipe1.name)
+ self.assertEqual(row1['version'], self.recipe1.version)
+ self.assertEqual(row1['get_description_or_summary'],
+ self.recipe1.description)
+ self.assertEqual(row1['layer_version__layer__name'],
+ self.recipe1.layer_version.layer.name)
+ self.assertEqual(row2['name'], self.recipe2.name)
+ self.assertEqual(row2['version'], self.recipe2.version)
+ self.assertEqual(row2['get_description_or_summary'],
+ self.recipe2.description)
+ self.assertEqual(row2['layer_version__layer__name'],
+ self.recipe2.layer_version.layer.name)
+
+ def test_toaster_tables(self):
+ """Test all ToasterTables instances"""
+ current_recipes = self.project.get_available_recipes()
+
+ 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
+ }
+
+ response = table.get(request, **args)
+ return json.loads(response.content)
+
+ # Get a list of classes in tables module
+ tables = inspect.getmembers(toastergui.tables, 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:
+ 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 = all_data['rows'][0][table.default_orderby.strip("-")]
+ row_two = 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 = ascending['rows'][0][column['field_name']]
+ row_two = ascending['rows'][1][column['field_name']]
+
+ self.assertTrue(row_one <= row_two,
+ "Ascending sort applied but row 0 is less "
+ "than row 1 %s %s " %
+ (column['field_name'], name))
+
+
+ descending = get_data(table_cls(),
+ {"orderby" :
+ '-'+column['field_name']})
+
+ row_one = descending['rows'][0][column['field_name']]
+ row_two = descending['rows'][1][column['field_name']]
+
+ self.assertTrue(row_one >= row_two,
+ "Descending sort applied but row 0 is "
+ "greater than row 1 %s %s" %
+ (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'] != 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/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/typeaheads.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/typeaheads.py
new file mode 100644
index 000000000..dd4b7f505
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/typeaheads.py
@@ -0,0 +1,146 @@
+#
+# 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 ToasterTypeAhead
+from orm.models import Project
+from django.core.urlresolvers import reverse
+
+class LayersTypeAhead(ToasterTypeAhead):
+ """ Typeahead for layers available and not added in the current project's
+ configuration """
+ def __init__(self):
+ super(LayersTypeAhead, self).__init__()
+
+ 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),
+ 'vcs_url' : layer_version.layer.vcs_url,
+ 'vcs_reference' : vcs_reference,
+ 'detail' : detail,
+ }
+
+ results.append(needed_fields)
+
+ return results
+
+class MachinesTypeAhead(ToasterTypeAhead):
+ """ Typeahead for all the machines available in the current project's
+ configuration """
+ def __init__(self):
+ super(MachinesTypeAhead, self).__init__()
+
+ 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 RecipesTypeAhead(ToasterTypeAhead):
+ """ Typeahead for all the recipes available in the current project's
+ configuration """
+ def __init__(self):
+ super(RecipesTypeAhead, self).__init__()
+
+ 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 __init__(self):
+ super(ProjectsTypeAhead, self).__init__()
+
+ 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
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/urls.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/urls.py
new file mode 100644
index 000000000..27b0baabf
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/urls.py
@@ -0,0 +1,190 @@
+#
+# 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 patterns, include, url
+from django.views.generic import RedirectView, TemplateView
+
+from django.http import HttpResponseBadRequest
+from toastergui import tables
+from toastergui import typeaheads
+from toastergui import api
+
+urlpatterns = patterns('toastergui.views',
+ # landing page
+ url(r'^landing/$', '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+)$', 'builddashboard', name="builddashboard"),
+
+ url(r'^build/(?P<build_id>\d+)/tasks/$', 'tasks', name='tasks'),
+ url(r'^build/(?P<build_id>\d+)/tasks/(?P<task_id>\d+)/$', 'tasks_task', name='tasks_task'),
+ url(r'^build/(?P<build_id>\d+)/task/(?P<task_id>\d+)$', 'task', name='task'),
+
+ url(r'^build/(?P<build_id>\d+)/recipes/$', 'recipes', name='recipes'),
+ url(r'^build/(?P<build_id>\d+)/recipe/(?P<recipe_id>\d+)/active_tab/(?P<active_tab>\d{1})$', 'recipe', name='recipe'),
+ url(r'^build/(?P<build_id>\d+)/recipe/(?P<recipe_id>\d+)$', 'recipe', name='recipe'),
+ url(r'^build/(?P<build_id>\d+)/recipe_packages/(?P<recipe_id>\d+)$', 'recipe_packages', name='recipe_packages'),
+
+ url(r'^build/(?P<build_id>\d+)/packages/$', 'bpackage', name='packages'),
+ url(r'^build/(?P<build_id>\d+)/package/(?P<package_id>\d+)$', 'package_built_detail',
+ name='package_built_detail'),
+ url(r'^build/(?P<build_id>\d+)/package_built_dependencies/(?P<package_id>\d+)$',
+ '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+)$',
+ '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+)$',
+ '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+)$',
+ 'package_included_reverse_dependencies', name='package_included_reverse_dependencies'),
+
+ # images are known as targets in the internal model
+ url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)$', 'target', name='target'),
+ url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)/targetpkg$', 'targetpkg', name='targetpkg'),
+ url(r'^dentries/build/(?P<build_id>\d+)/target/(?P<target_id>\d+)$', 'xhr_dirinfo', name='dirinfo_ajax'),
+ url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)/dirinfo$', 'dirinfo', name='dirinfo'),
+ url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)/dirinfo_filepath/_(?P<file_path>(?:/[^/\n]+)*)$', 'dirinfo', name='dirinfo_filepath'),
+ url(r'^build/(?P<build_id>\d+)/configuration$', 'configuration', name='configuration'),
+ url(r'^build/(?P<build_id>\d+)/configvars$', 'configvars', name='configvars'),
+ url(r'^build/(?P<build_id>\d+)/buildtime$', 'buildtime', name='buildtime'),
+ url(r'^build/(?P<build_id>\d+)/cputime$', 'cputime', name='cputime'),
+ url(r'^build/(?P<build_id>\d+)/diskio$', 'diskio', name='diskio'),
+
+ # image information dir
+ url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)/packagefile/(?P<packagefile_id>\d+)$',
+ '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+)', 'build_artifact', name="build_artifact"),
+
+ # project URLs
+ url(r'^newproject/$', 'newproject', name='newproject'),
+
+ url(r'^projects/$',
+ tables.ProjectsTable.as_view(template_name="projects-toastertable.html"),
+ name='all-projects'),
+
+ url(r'^project/(?P<pid>\d+)/$', 'project', name='project'),
+ url(r'^project/(?P<pid>\d+)/configuration$', '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$', '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+)$',
+ '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+)/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$',
+ '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_testreleasechange/(?P<pid>\d+)$', 'xhr_testreleasechange',
+ name='xhr_testreleasechange'),
+ url(r'^xhr_configvaredit/(?P<pid>\d+)$', 'xhr_configvaredit',
+ name='xhr_configvaredit'),
+
+ url(r'^xhr_importlayer/$', 'xhr_importlayer', name='xhr_importlayer'),
+ url(r'^xhr_updatelayer/$', 'xhr_updatelayer', name='xhr_updatelayer'),
+
+ # JS Unit tests
+ url(r'^js-unit-tests/$', 'jsunittests', name='js-unit-tests'),
+
+ # image customisation functionality
+ url(r'^xhr_customrecipe/(?P<recipe_id>\d+)/packages/(?P<package_id>\d+|)$',
+ 'xhr_customrecipe_packages', name='xhr_customrecipe_packages'),
+
+ url(r'^xhr_customrecipe/(?P<recipe_id>\d+)/packages/$',
+ 'xhr_customrecipe_packages', name='xhr_customrecipe_packages'),
+
+ url(r'^xhr_customrecipe/(?P<recipe_id>\d+)$', 'xhr_customrecipe_id',
+ name='xhr_customrecipe_id'),
+ url(r'^xhr_customrecipe/', 'xhr_customrecipe',
+ name='xhr_customrecipe'),
+
+ url(r'^xhr_buildrequest/project/(?P<pid>\d+)$',
+ api.XhrBuildRequest.as_view(),
+ name='xhr_buildrequest'),
+
+ # default redirection
+ url(r'^$', RedirectView.as_view(url='landing', permanent=True)),
+)
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/views.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/views.py
new file mode 100755
index 000000000..bd5bf6334
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/views.py
@@ -0,0 +1,2982 @@
+#
+# 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.
+
+# pylint: disable=method-hidden
+# Gives E:848, 4: An attribute defined in json.encoder line 162 hides this method (method-hidden)
+# which is an invalid warning
+
+import operator,re
+
+from django.db.models import F, Q, Sum, Count, Max
+from django.db import IntegrityError, Error
+from django.shortcuts import render, redirect, get_object_or_404
+from orm.models import Build, Target, Task, Layer, Layer_Version, Recipe, LogMessage, Variable
+from orm.models import Task_Dependency, Recipe_Dependency, Package, Package_File, Package_Dependency
+from orm.models import Target_Installed_Package, Target_File, Target_Image_File, BuildArtifact, CustomImagePackage
+from orm.models import BitbakeVersion, CustomImageRecipe
+from bldcontrol import bbcontroller
+from django.views.decorators.cache import cache_control
+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 HttpResponseBadRequest, HttpResponseNotFound
+from django.utils import timezone
+from django.utils.html import escape
+from datetime import timedelta, datetime
+from django.utils import formats
+from toastergui.templatetags.projecttags import json as jsonfilter
+from decimal import Decimal
+import json
+import os
+from os.path import dirname
+from functools import wraps
+import itertools
+import mimetypes
+
+import logging
+
+logger = logging.getLogger("toaster")
+
+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
+
+# 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 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 _template_renderer(template):
+ def func_wrapper(view):
+ def returned_wrapper(request, *args, **kwargs):
+ try:
+ context = view(request, *args, **kwargs)
+ except RedirectException as e:
+ return e.get_redirect_response()
+
+ if request.GET.get('format', None) == 'json':
+ # objects is a special keyword - it's a Page, but we need the actual objects here
+ # in XHR, the objects come in the "rows" property
+ if "objects" in context:
+ context["rows"] = context["objects"].object_list
+ del context["objects"]
+
+ # we're about to return; to keep up with the XHR API, we set the error to OK
+ context["error"] = "ok"
+
+ return HttpResponse(jsonfilter(context, default=objtojson ),
+ content_type = "application/json; charset=utf-8")
+ else:
+ return render(request, template, context)
+ return returned_wrapper
+ return func_wrapper
+
+
+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.up_branch == 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):
+ import urllib
+ 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] = urllib.unquote(str(mandatory_parameters[i]))
+
+ return redirect(url + "?%s" % urllib.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:
+ return reduce(operator.or_, map(lambda x: __get_q_for_val(name, x), [ x for x in value.split("OR") ]))
+ if "AND" in value:
+ return reduce(operator.and_, map(lambda x: __get_q_for_val(name, x), [ x for x in value.split("AND") ]))
+ 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 = []
+ for kv in zip(and_keys, and_values):
+ or_keys = kv[0].split(OR_VALUE_SEPARATOR)
+ or_values = kv[1].split(OR_VALUE_SEPARATOR)
+ querydict = dict(zip(or_keys, or_values))
+ and_query.append(reduce(operator.or_, map(lambda x: __get_q_for_val(x, querydict[x]), [k for k in querydict])))
+
+ return reduce(operator.and_, [k for k in 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 = model._meta.get_all_field_names()
+ for field in field_input_list[0].split(AND_VALUE_SEPARATOR):
+ if not reduce(lambda x, y: x or y, [ field.startswith(x) for x in valid_fields ]):
+ return None, (field, [ x for x in 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_objects = []
+ for st in search_term.split(" "):
+ q_map = map(lambda x: Q(**{x+'__icontains': st}),
+ model.search_allowed_fields)
+
+ search_objects.append(reduce(operator.or_, q_map))
+ search_object = reduce(operator.and_, search_objects)
+ 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
+ hasImages = False
+ targetHasNoImages = False
+ for t in tgts:
+ elem = { }
+ elem[ 'target' ] = t
+ if t.is_image:
+ hasImages = True
+ npkg = 0
+ pkgsz = 0
+ package = None
+ for package in Package.objects.filter(id__in = [x.package_id for x in t.target_installed_package_set.all()]):
+ 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 )
+ imageFiles = [ ]
+ for i in ti:
+ ndx = i.file_name.rfind( '/' )
+ if ( ndx < 0 ):
+ ndx = 0;
+ f = i.file_name[ ndx + 1: ]
+ imageFiles.append({
+ 'id': i.id,
+ 'path': f,
+ 'size': i.file_size,
+ 'suffix': i.suffix
+ })
+ if t.is_image and (len(imageFiles) <= 0 or len(t.license_manifest_path) <= 0):
+ targetHasNoImages = True
+ elem[ 'imageFiles' ] = imageFiles
+ elem[ 'targetHasNoImages' ] = targetHasNoImages
+ 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,
+ 'hasImages' : hasImages,
+ 'ntargets' : ntargets,
+ 'targets' : targets,
+ 'recipecount' : recipeCount,
+ 'packagecount' : packageCount,
+ 'logmessages' : logmessages,
+ }
+ return 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,
+ }
+ 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 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 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 = render(request, template, context)
+ _set_parameters_values(pagesize, orderby, request)
+ return response
+
+def target_common( request, build_id, target_id, variant ):
+ template = "target.html"
+ default_orderby = 'name:+'
+
+ (pagesize, orderby) = _get_parameters_values(request, 25, default_orderby)
+ mandatory_parameters = { 'count': pagesize, 'page' : 1, 'orderby': orderby }
+ retval = _verify_parameters( request.GET, mandatory_parameters )
+ if retval:
+ return _redirect_parameters(
+ variant, request.GET, mandatory_parameters,
+ build_id = build_id, target_id = target_id )
+ ( filter_string, search_term, ordering_string ) = _search_tuple( request, Package )
+
+ # FUTURE: get rid of nested sub-queries replacing with ManyToMany field
+ queryset = Package.objects.filter(
+ size__gte = 0,
+ id__in = Target_Installed_Package.objects.filter(
+ target_id=target_id ).values( 'package_id' ))
+ packages_sum = queryset.aggregate( Sum( 'installed_size' ))
+ queryset = _get_queryset(
+ Package, queryset, filter_string, search_term, ordering_string, 'name' )
+ queryset = queryset.select_related("recipe", "recipe__layer_version", "recipe__layer_version__layer")
+ packages = _build_page_range( Paginator(queryset, pagesize), request.GET.get( 'page', 1 ))
+
+ build = Build.objects.get( pk = build_id )
+
+ # bring in package dependencies
+ for p in packages.object_list:
+ p.runtime_dependencies = p.package_dependencies_source.filter(
+ target_id = target_id, dep_type=Package_Dependency.TYPE_TRDEPENDS ).select_related("depends_on")
+ p.reverse_runtime_dependencies = p.package_dependencies_target.filter(
+ target_id = target_id, dep_type=Package_Dependency.TYPE_TRDEPENDS ).select_related("package")
+ tc_package = {
+ 'name' : 'Package',
+ 'qhelp' : 'Packaged output resulting from building a recipe included in this image',
+ 'orderfield' : _get_toggle_order( request, "name" ),
+ 'ordericon' : _get_toggle_order_icon( request, "name" ),
+ }
+ tc_packageVersion = {
+ 'name' : 'Package version',
+ 'qhelp' : 'The package version and revision',
+ }
+ tc_size = {
+ 'name' : 'Size',
+ 'qhelp' : 'The size of the package',
+ 'orderfield' : _get_toggle_order( request, "size", True ),
+ 'ordericon' : _get_toggle_order_icon( request, "size" ),
+ 'orderkey' : 'size',
+ 'clclass' : 'size',
+ 'dclass' : 'span2',
+ }
+ if ( variant == 'target' ):
+ tc_size[ "hidden" ] = 0
+ else:
+ tc_size[ "hidden" ] = 1
+ tc_sizePercentage = {
+ 'name' : 'Size over total (%)',
+ 'qhelp' : 'Proportion of the overall size represented by this package',
+ 'clclass' : 'size_over_total',
+ 'hidden' : 1,
+ }
+ tc_license = {
+ 'name' : 'License',
+ 'qhelp' : 'The license under which the package is distributed. Separate license names u\
+sing | (pipe) means there is a choice between licenses. Separate license names using & (ampersand) m\
+eans multiple licenses exist that cover different parts of the source',
+ 'orderfield' : _get_toggle_order( request, "license" ),
+ 'ordericon' : _get_toggle_order_icon( request, "license" ),
+ 'orderkey' : 'license',
+ 'clclass' : 'license',
+ }
+ if ( variant == 'target' ):
+ tc_license[ "hidden" ] = 1
+ else:
+ tc_license[ "hidden" ] = 0
+ tc_dependencies = {
+ 'name' : 'Dependencies',
+ 'qhelp' : "Package runtime dependencies (other packages)",
+ 'clclass' : 'depends',
+ }
+ if ( variant == 'target' ):
+ tc_dependencies[ "hidden" ] = 0
+ else:
+ tc_dependencies[ "hidden" ] = 1
+ tc_rdependencies = {
+ 'name' : 'Reverse dependencies',
+ 'qhelp' : 'Package run-time reverse dependencies (i.e. which other packages depend on this package',
+ 'clclass' : 'brought_in_by',
+ }
+ if ( variant == 'target' ):
+ tc_rdependencies[ "hidden" ] = 0
+ else:
+ tc_rdependencies[ "hidden" ] = 1
+ tc_recipe = {
+ 'name' : 'Recipe',
+ 'qhelp' : 'The name of the recipe building the package',
+ 'orderfield' : _get_toggle_order( request, "recipe__name" ),
+ 'ordericon' : _get_toggle_order_icon( request, "recipe__name" ),
+ 'orderkey' : "recipe__name",
+ 'clclass' : 'recipe_name',
+ 'hidden' : 0,
+ }
+ tc_recipeVersion = {
+ 'name' : 'Recipe version',
+ 'qhelp' : 'Version and revision of the recipe building the package',
+ 'clclass' : 'recipe_version',
+ 'hidden' : 1,
+ }
+ tc_layer = {
+ 'name' : 'Layer',
+ 'qhelp' : 'The name of the layer providing the recipe that builds the package',
+ 'orderfield' : _get_toggle_order( request, "recipe__layer_version__layer__name" ),
+ 'ordericon' : _get_toggle_order_icon( request, "recipe__layer_version__layer__name" ),
+ 'orderkey' : "recipe__layer_version__layer__name",
+ 'clclass' : 'layer_name',
+ 'hidden' : 1,
+ }
+ tc_layerBranch = {
+ 'name' : 'Layer branch',
+ 'qhelp' : 'The Git branch of the layer providing the recipe that builds the package',
+ 'orderfield' : _get_toggle_order( request, "recipe__layer_version__branch" ),
+ 'ordericon' : _get_toggle_order_icon( request, "recipe__layer_version__branch" ),
+ 'orderkey' : "recipe__layer_version__branch",
+ 'clclass' : 'layer_branch',
+ 'hidden' : 1,
+ }
+ tc_layerCommit = {
+ 'name' : 'Layer commit',
+ 'qhelp' : 'The Git commit of the layer providing the recipe that builds the package',
+ 'clclass' : 'layer_commit',
+ 'hidden' : 1,
+ }
+
+ context = {
+ 'objectname': variant,
+ 'build' : build,
+ 'project' : build.project,
+ 'target' : Target.objects.filter( pk = target_id )[ 0 ],
+ 'objects' : packages,
+ 'packages_sum' : packages_sum[ 'installed_size__sum' ],
+ 'object_search_display': "packages included",
+ 'default_orderby' : default_orderby,
+ 'tablecols' : [
+ tc_package,
+ tc_packageVersion,
+ tc_license,
+ tc_size,
+ tc_sizePercentage,
+ tc_dependencies,
+ tc_rdependencies,
+ tc_recipe,
+ tc_recipeVersion,
+ tc_layer,
+ tc_layerBranch,
+ tc_layerCommit,
+ ]
+ }
+
+
+ response = render(request, template, context)
+ _set_parameters_values(pagesize, orderby, request)
+ return response
+
+def target( request, build_id, target_id ):
+ return( target_common( request, build_id, target_id, "target" ))
+
+def targetpkg( request, build_id, target_id ):
+ return( target_common( request, build_id, target_id, "targetpkg" ))
+
+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(e)
+
+ # 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 render(request, template, context)
+
+def _find_task_dep(task_object):
+ return map(lambda x: x.depends_on, Task_Dependency.objects.filter(task=task_object).filter(depends_on__order__gt = 0).exclude(depends_on__outcome = Task.OUTCOME_NA).select_related("depends_on"))
+
+
+def _find_task_revdep(task_object):
+ tp = []
+ tp = map(lambda t: t.task, Task_Dependency.objects.filter(depends_on=task_object).filter(task__order__gt=0).exclude(task__outcome = Task.OUTCOME_NA).select_related("task", "task__recipe", "task__build"))
+ return tp
+
+def _find_task_revdep_list(tasklist):
+ tp = []
+ tp = map(lambda t: t.task, Task_Dependency.objects.filter(depends_on__in=tasklist).filter(task__order__gt=0).exclude(task__outcome = Task.OUTCOME_NA).select_related("task", "task__recipe", "task__build"))
+ return tp
+
+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 tasks_common(request, build_id, variant, task_anchor):
+# This class is shared between these pages
+#
+# Column tasks buildtime diskio cpuusage
+# --------- ------ ---------- ------- ---------
+# Cache def
+# CPU min -
+# Disk min -
+# Executed def def def def
+# Log
+# Order def +
+# Outcome def def def def
+# Recipe min min min min
+# Version
+# Task min min min min
+# Time min -
+#
+# 'min':on always, 'def':on by default, else hidden
+# '+' default column sort up, '-' default column sort down
+
+ anchor = request.GET.get('anchor', '')
+ if not anchor:
+ anchor=task_anchor
+
+ # default ordering depends on variant
+ default_orderby = None
+ filter_search_display = 'tasks'
+
+ if 'buildtime' == variant:
+ default_orderby = 'elapsed_time:-'
+ title_variant = 'Time'
+ object_search_display = 'time data'
+ elif 'diskio' == variant:
+ default_orderby = 'disk_io:-'
+ title_variant = 'Disk I/O'
+ object_search_display = 'disk I/O data'
+ elif 'cputime' == variant:
+ default_orderby = 'cpu_time_system:-'
+ title_variant='CPU time'
+ object_search_display = 'CPU time data'
+ else:
+ default_orderby = 'order:+'
+ title_variant = 'Tasks'
+ object_search_display = 'tasks'
+
+ (pagesize, orderby) = _get_parameters_values(request, 25, default_orderby)
+
+ mandatory_parameters = {'count': pagesize, 'page' : 1, 'orderby': orderby}
+
+ template = 'tasks.html'
+ retval = _verify_parameters( request.GET, mandatory_parameters )
+ if retval:
+ if task_anchor:
+ mandatory_parameters['anchor']=task_anchor
+ return _redirect_parameters( variant, request.GET, mandatory_parameters, build_id = build_id)
+ (filter_string, search_term, ordering_string) = _search_tuple(request, Task)
+ queryset_all = Task.objects.filter(build=build_id).exclude(order__isnull=True).exclude(outcome=Task.OUTCOME_NA)
+ queryset_all = queryset_all.select_related("recipe", "build")
+
+ queryset_with_search = _get_queryset(Task, queryset_all, None , search_term, ordering_string, 'order')
+
+ if ordering_string.startswith('outcome'):
+ queryset = _get_queryset(Task, queryset_all, filter_string, search_term, 'order:+', 'order')
+ queryset = sorted(queryset, key=lambda ur: (ur.outcome_text), reverse=ordering_string.endswith('-'))
+ elif ordering_string.startswith('sstate_result'):
+ queryset = _get_queryset(Task, queryset_all, filter_string, search_term, 'order:+', 'order')
+ queryset = sorted(queryset, key=lambda ur: (ur.sstate_text), reverse=ordering_string.endswith('-'))
+ else:
+ queryset = _get_queryset(Task, queryset_all, filter_string, search_term, ordering_string, 'order')
+
+
+ # compute the anchor's page
+ if anchor:
+ request.GET = request.GET.copy()
+ del request.GET['anchor']
+ i=0
+ a=int(anchor)
+ count_per_page=int(pagesize)
+ for task_object in queryset.iterator():
+ if a == task_object.order:
+ new_page= (i / count_per_page ) + 1
+ request.GET.__setitem__('page', new_page)
+ mandatory_parameters['page']=new_page
+ return _redirect_parameters( variant, request.GET, mandatory_parameters, build_id = build_id)
+ i += 1
+
+ task_objects = _build_page_range(Paginator(queryset, pagesize),request.GET.get('page', 1))
+
+ # define (and modify by variants) the 'tablecols' members
+ tc_order={
+ 'name':'Order',
+ 'qhelp':'The running sequence of each task in the build',
+ 'clclass': 'order', 'hidden' : 1,
+ 'orderkey' : 'order',
+ 'orderfield':_get_toggle_order(request, "order"),
+ 'ordericon':_get_toggle_order_icon(request, "order")}
+ if 'tasks' == variant:
+ tc_order['hidden']='0'
+ del tc_order['clclass']
+
+ tc_recipe={
+ 'name':'Recipe',
+ 'qhelp':'The name of the recipe to which each task applies',
+ 'orderkey' : 'recipe__name',
+ 'orderfield': _get_toggle_order(request, "recipe__name"),
+ 'ordericon':_get_toggle_order_icon(request, "recipe__name"),
+ }
+ tc_recipe_version={
+ 'name':'Recipe version',
+ 'qhelp':'The version of the recipe to which each task applies',
+ 'clclass': 'recipe_version', 'hidden' : 1,
+ }
+ tc_task={
+ 'name':'Task',
+ 'qhelp':'The name of the task',
+ 'orderfield': _get_toggle_order(request, "task_name"),
+ 'ordericon':_get_toggle_order_icon(request, "task_name"),
+ 'orderkey' : 'task_name',
+ }
+ tc_executed={
+ 'name':'Executed',
+ 'qhelp':"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)",
+ 'clclass': 'executed', 'hidden' : 0,
+ 'orderfield': _get_toggle_order(request, "task_executed"),
+ 'ordericon':_get_toggle_order_icon(request, "task_executed"),
+ 'orderkey' : 'task_executed',
+ 'filter' : {
+ 'class' : 'executed',
+ 'label': 'Show:',
+ 'options' : [
+ ('Executed Tasks', 'task_executed:1', queryset_with_search.filter(task_executed=1).count()),
+ ('Not Executed Tasks', 'task_executed:0', queryset_with_search.filter(task_executed=0).count()),
+ ]
+ }
+
+ }
+ tc_outcome={
+ 'name':'Outcome',
+ 'qhelp':"This column tells you if 'executed' tasks succeeded or failed. The column also tells you why 'not executed' tasks did not need to run",
+ 'clclass': 'outcome', 'hidden' : 0,
+ 'orderfield': _get_toggle_order(request, "outcome"),
+ 'ordericon':_get_toggle_order_icon(request, "outcome"),
+ 'orderkey' : 'outcome',
+ 'filter' : {
+ 'class' : 'outcome',
+ 'label': 'Show:',
+ 'options' : [
+ ('Succeeded Tasks', 'outcome:%d'%Task.OUTCOME_SUCCESS, queryset_with_search.filter(outcome=Task.OUTCOME_SUCCESS).count(), "'Succeeded' tasks are those that ran and completed during the build" ),
+ ('Failed Tasks', 'outcome:%d'%Task.OUTCOME_FAILED, queryset_with_search.filter(outcome=Task.OUTCOME_FAILED).count(), "'Failed' tasks are those that ran but did not complete during the build"),
+ ('Cached Tasks', 'outcome:%d'%Task.OUTCOME_CACHED, queryset_with_search.filter(outcome=Task.OUTCOME_CACHED).count(), 'Cached tasks restore output from the <code>sstate-cache</code> directory or mirrors'),
+ ('Prebuilt Tasks', 'outcome:%d'%Task.OUTCOME_PREBUILT, queryset_with_search.filter(outcome=Task.OUTCOME_PREBUILT).count(),'Prebuilt tasks didn\'t need to run because their output was reused from a previous build'),
+ ('Covered Tasks', 'outcome:%d'%Task.OUTCOME_COVERED, queryset_with_search.filter(outcome=Task.OUTCOME_COVERED).count(), 'Covered tasks didn\'t need to run because their output is provided by another task in this build'),
+ ('Empty Tasks', 'outcome:%d'%Task.OUTCOME_EMPTY, queryset_with_search.filter(outcome=Task.OUTCOME_EMPTY).count(), 'Empty tasks have no executable content'),
+ ]
+ }
+
+ }
+
+ tc_cache={
+ 'name':'Cache attempt',
+ 'qhelp':'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',
+ 'clclass': 'cache_attempt', 'hidden' : 0,
+ 'orderfield': _get_toggle_order(request, "sstate_result"),
+ 'ordericon':_get_toggle_order_icon(request, "sstate_result"),
+ 'orderkey' : 'sstate_result',
+ 'filter' : {
+ 'class' : 'cache_attempt',
+ 'label': 'Show:',
+ 'options' : [
+ ('Tasks with cache attempts', 'sstate_result__gt:%d'%Task.SSTATE_NA, queryset_with_search.filter(sstate_result__gt=Task.SSTATE_NA).count(), 'Show all tasks that tried to restore ouput from the <code>sstate-cache</code> directory or mirrors'),
+ ("Tasks with 'File not in cache' attempts", 'sstate_result:%d'%Task.SSTATE_MISS, queryset_with_search.filter(sstate_result=Task.SSTATE_MISS).count(), 'Show tasks that tried to restore output, but did not find it in the <code>sstate-cache</code> directory or mirrors'),
+ ("Tasks with 'Failed' cache attempts", 'sstate_result:%d'%Task.SSTATE_FAILED, queryset_with_search.filter(sstate_result=Task.SSTATE_FAILED).count(), 'Show tasks that found the required output in the <code>sstate-cache</code> directory or mirrors, but could not restore it'),
+ ("Tasks with 'Succeeded' cache attempts", 'sstate_result:%d'%Task.SSTATE_RESTORED, queryset_with_search.filter(sstate_result=Task.SSTATE_RESTORED).count(), 'Show tasks that successfully restored the required output from the <code>sstate-cache</code> directory or mirrors'),
+ ]
+ }
+
+ }
+ #if 'tasks' == variant: tc_cache['hidden']='0';
+ tc_time={
+ 'name':'Time (secs)',
+ 'qhelp':'How long it took the task to finish in seconds',
+ 'orderfield': _get_toggle_order(request, "elapsed_time", True),
+ 'ordericon':_get_toggle_order_icon(request, "elapsed_time"),
+ 'orderkey' : 'elapsed_time',
+ 'clclass': 'time_taken', 'hidden' : 1,
+ }
+ if 'buildtime' == variant:
+ tc_time['hidden']='0'
+ del tc_time['clclass']
+ tc_cache['hidden']='1'
+
+ tc_cpu_time_system={
+ 'name':'System CPU time (secs)',
+ 'qhelp':'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.',
+ 'orderfield': _get_toggle_order(request, "cpu_time_system", True),
+ 'ordericon':_get_toggle_order_icon(request, "cpu_time_system"),
+ 'orderkey' : 'cpu_time_system',
+ 'clclass': 'cpu_time_system', 'hidden' : 1,
+ }
+
+ tc_cpu_time_user={
+ 'name':'User CPU time (secs)',
+ 'qhelp':'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.',
+ 'orderfield': _get_toggle_order(request, "cpu_time_user", True),
+ 'ordericon':_get_toggle_order_icon(request, "cpu_time_user"),
+ 'orderkey' : 'cpu_time_user',
+ 'clclass': 'cpu_time_user', 'hidden' : 1,
+ }
+
+ if 'cputime' == variant:
+ tc_cpu_time_system['hidden']='0'
+ tc_cpu_time_user['hidden']='0'
+ del tc_cpu_time_system['clclass']
+ del tc_cpu_time_user['clclass']
+ tc_cache['hidden']='1'
+
+ tc_diskio={
+ 'name':'Disk I/O (bytes)',
+ 'qhelp':'Number of bytes written to and read from the disk during the task',
+ 'orderfield': _get_toggle_order(request, "disk_io", True),
+ 'ordericon':_get_toggle_order_icon(request, "disk_io"),
+ 'orderkey' : 'disk_io',
+ 'clclass': 'disk_io', 'hidden' : 1,
+ }
+ if 'diskio' == variant:
+ tc_diskio['hidden']='0'
+ del tc_diskio['clclass']
+ tc_cache['hidden']='1'
+
+ build = Build.objects.get(pk=build_id)
+
+ context = { 'objectname': variant,
+ 'object_search_display': object_search_display,
+ 'filter_search_display': filter_search_display,
+ 'mainheading': title_variant,
+ 'build': build,
+ 'project': build.project,
+ 'objects': task_objects,
+ 'default_orderby' : default_orderby,
+ 'search_term': search_term,
+ 'total_count': queryset_with_search.count(),
+ 'tablecols':[
+ tc_order,
+ tc_recipe,
+ tc_recipe_version,
+ tc_task,
+ tc_executed,
+ tc_outcome,
+ tc_cache,
+ tc_time,
+ tc_cpu_time_system,
+ tc_cpu_time_user,
+ tc_diskio,
+ ]}
+
+
+ response = render(request, template, context)
+ _set_parameters_values(pagesize, orderby, request)
+ return response
+
+def tasks(request, build_id):
+ return tasks_common(request, build_id, 'tasks', '')
+
+def tasks_task(request, build_id, task_id):
+ return tasks_common(request, build_id, 'tasks', task_id)
+
+def buildtime(request, build_id):
+ return tasks_common(request, build_id, 'buildtime', '')
+
+def diskio(request, build_id):
+ return tasks_common(request, build_id, 'diskio', '')
+
+def cputime(request, build_id):
+ return tasks_common(request, build_id, 'cputime', '')
+
+def recipes(request, build_id):
+ template = 'recipes.html'
+ (pagesize, orderby) = _get_parameters_values(request, 100, 'name:+')
+ mandatory_parameters = { 'count': pagesize, 'page' : 1, 'orderby' : orderby }
+ retval = _verify_parameters( request.GET, mandatory_parameters )
+ if retval:
+ return _redirect_parameters( 'recipes', request.GET, mandatory_parameters, build_id = build_id)
+ (filter_string, search_term, ordering_string) = _search_tuple(request, Recipe)
+
+ build = Build.objects.get(pk=build_id)
+
+ queryset = build.get_recipes()
+ queryset = _get_queryset(Recipe, queryset, filter_string, search_term, ordering_string, 'name')
+
+ recipes = _build_page_range(Paginator(queryset, pagesize),request.GET.get('page', 1))
+
+ # prefetch the forward and reverse recipe dependencies
+ deps = { }
+ revs = { }
+ queryset_dependency=Recipe_Dependency.objects.filter(recipe__layer_version__build_id = build_id).select_related("depends_on", "recipe")
+ for recipe in recipes:
+ deplist = [ ]
+ for recipe_dep in [x for x in queryset_dependency if x.recipe_id == recipe.id]:
+ deplist.append(recipe_dep)
+ deps[recipe.id] = deplist
+ revlist = [ ]
+ for recipe_dep in [x for x in queryset_dependency if x.depends_on_id == recipe.id]:
+ revlist.append(recipe_dep)
+ revs[recipe.id] = revlist
+
+ context = {
+ 'objectname': 'recipes',
+ 'build': build,
+ 'project': build.project,
+ 'objects': recipes,
+ 'default_orderby' : 'name:+',
+ 'recipe_deps' : deps,
+ 'recipe_revs' : revs,
+ 'tablecols':[
+ {
+ 'name':'Recipe',
+ 'qhelp':'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',
+ 'orderfield': _get_toggle_order(request, "name"),
+ 'ordericon':_get_toggle_order_icon(request, "name"),
+ },
+ {
+ 'name':'Recipe version',
+ 'qhelp':'The recipe version and revision',
+ },
+ {
+ 'name':'Dependencies',
+ 'qhelp':'Recipe build-time dependencies (i.e. other recipes)',
+ 'clclass': 'depends_on', 'hidden': 1,
+ },
+ {
+ 'name':'Reverse dependencies',
+ 'qhelp':'Recipe build-time reverse dependencies (i.e. the recipes that depend on this recipe)',
+ 'clclass': 'depends_by', 'hidden': 1,
+ },
+ {
+ 'name':'Recipe file',
+ 'qhelp':'Path to the recipe .bb file',
+ 'orderfield': _get_toggle_order(request, "file_path"),
+ 'ordericon':_get_toggle_order_icon(request, "file_path"),
+ 'orderkey' : 'file_path',
+ 'clclass': 'recipe_file', 'hidden': 0,
+ },
+ {
+ 'name':'Section',
+ 'qhelp':'The section in which recipes should be categorized',
+ 'orderfield': _get_toggle_order(request, "section"),
+ 'ordericon':_get_toggle_order_icon(request, "section"),
+ 'orderkey' : 'section',
+ 'clclass': 'recipe_section', 'hidden': 0,
+ },
+ {
+ 'name':'License',
+ 'qhelp':'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',
+ 'orderfield': _get_toggle_order(request, "license"),
+ 'ordericon':_get_toggle_order_icon(request, "license"),
+ 'orderkey' : 'license',
+ 'clclass': 'recipe_license', 'hidden': 0,
+ },
+ {
+ 'name':'Layer',
+ 'qhelp':'The name of the layer providing the recipe',
+ 'orderfield': _get_toggle_order(request, "layer_version__layer__name"),
+ 'ordericon':_get_toggle_order_icon(request, "layer_version__layer__name"),
+ 'orderkey' : 'layer_version__layer__name',
+ 'clclass': 'layer_version__layer__name', 'hidden': 0,
+ },
+ {
+ 'name':'Layer branch',
+ 'qhelp':'The Git branch of the layer providing the recipe',
+ 'orderfield': _get_toggle_order(request, "layer_version__branch"),
+ 'ordericon':_get_toggle_order_icon(request, "layer_version__branch"),
+ 'orderkey' : 'layer_version__branch',
+ 'clclass': 'layer_version__branch', 'hidden': 1,
+ },
+ {
+ 'name':'Layer commit',
+ 'qhelp':'The Git commit of the layer providing the recipe',
+ 'clclass': 'layer_version__layer__commit', 'hidden': 1,
+ },
+ ]
+ }
+
+ response = render(request, template, context)
+ _set_parameters_values(pagesize, orderby, request)
+ return response
+
+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 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",
+ 'dclass': "span4",
+ },
+ {'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 = render(request, template, context)
+ _set_parameters_values(pagesize, orderby, request)
+ return response
+
+def bpackage(request, build_id):
+ template = 'bpackage.html'
+ (pagesize, orderby) = _get_parameters_values(request, 100, 'name:+')
+ mandatory_parameters = { 'count' : pagesize, 'page' : 1, 'orderby' : orderby }
+ retval = _verify_parameters( request.GET, mandatory_parameters )
+ if retval:
+ return _redirect_parameters( 'packages', request.GET, mandatory_parameters, build_id = build_id)
+ (filter_string, search_term, ordering_string) = _search_tuple(request, Package)
+ queryset = Package.objects.filter(build = build_id).filter(size__gte=0)
+ queryset = _get_queryset(Package, queryset, filter_string, search_term, ordering_string, 'name')
+
+ packages = _build_page_range(Paginator(queryset, pagesize),request.GET.get('page', 1))
+
+ build = Build.objects.get( pk = build_id )
+
+ context = {
+ 'objectname': 'packages built',
+ 'build': build,
+ 'project': build.project,
+ 'objects' : packages,
+ 'default_orderby' : 'name:+',
+ 'tablecols':[
+ {
+ 'name':'Package',
+ 'qhelp':'Packaged output resulting from building a recipe',
+ 'orderfield': _get_toggle_order(request, "name"),
+ 'ordericon':_get_toggle_order_icon(request, "name"),
+ },
+ {
+ 'name':'Package version',
+ 'qhelp':'The package version and revision',
+ },
+ {
+ 'name':'Size',
+ 'qhelp':'The size of the package',
+ 'orderfield': _get_toggle_order(request, "size", True),
+ 'ordericon':_get_toggle_order_icon(request, "size"),
+ 'orderkey' : 'size',
+ 'clclass': 'size', 'hidden': 0,
+ 'dclass' : 'span2',
+ },
+ {
+ 'name':'License',
+ 'qhelp':'The license under which the package is distributed. 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',
+ 'orderfield': _get_toggle_order(request, "license"),
+ 'ordericon':_get_toggle_order_icon(request, "license"),
+ 'orderkey' : 'license',
+ 'clclass': 'license', 'hidden': 1,
+ },
+ {
+ 'name':'Recipe',
+ 'qhelp':'The name of the recipe building the package',
+ 'orderfield': _get_toggle_order(request, "recipe__name"),
+ 'ordericon':_get_toggle_order_icon(request, "recipe__name"),
+ 'orderkey' : 'recipe__name',
+ 'clclass': 'recipe__name', 'hidden': 0,
+ },
+ {
+ 'name':'Recipe version',
+ 'qhelp':'Version and revision of the recipe building the package',
+ 'clclass': 'recipe__version', 'hidden': 1,
+ },
+ {
+ 'name':'Layer',
+ 'qhelp':'The name of the layer providing the recipe that builds the package',
+ 'orderfield': _get_toggle_order(request, "recipe__layer_version__layer__name"),
+ 'ordericon':_get_toggle_order_icon(request, "recipe__layer_version__layer__name"),
+ 'orderkey' : 'recipe__layer_version__layer__name',
+ 'clclass': 'recipe__layer_version__layer__name', 'hidden': 1,
+ },
+ {
+ 'name':'Layer branch',
+ 'qhelp':'The Git branch of the layer providing the recipe that builds the package',
+ 'orderfield': _get_toggle_order(request, "recipe__layer_version__branch"),
+ 'ordericon':_get_toggle_order_icon(request, "recipe__layer_version__branch"),
+ 'orderkey' : 'recipe__layer_version__branch',
+ 'clclass': 'recipe__layer_version__branch', 'hidden': 1,
+ },
+ {
+ 'name':'Layer commit',
+ 'qhelp':'The Git commit of the layer providing the recipe that builds the package',
+ 'clclass': 'recipe__layer_version__layer__commit', 'hidden': 1,
+ },
+ ]
+ }
+
+ response = 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 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 = 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 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 = 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 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 = 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
+
+
+
+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 Branch, 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):
+ 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 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
+ if reduce( lambda x, y: x or y, map(lambda x: len(request.POST.get(x, '')) == 0, mandatory_fields)):
+ # set alert for missing fields
+ raise BadParameterException("Fields missing: " +
+ ", ".join([x for x in mandatory_fields if len(request.POST.get(x, '')) == 0 ]))
+
+ 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
+ map(lambda x: context.__setitem__(x, request.POST.get(x, "-- missing")), mandatory_fields)
+ if isinstance(e, IntegrityError) and "username" in str(e):
+ context['alert'] = "Your chosen username is already used"
+ else:
+ context['alert'] = str(e)
+ return render(request, template, context)
+
+ raise Exception("Invalid HTTP method for this page")
+
+
+
+ # Shows the edit project page
+ @_template_renderer('project.html')
+ def project(request, pid):
+ prj = Project.objects.get(id = pid)
+
+ try:
+ puser = User.objects.get(id = prj.user_id)
+ except User.DoesNotExist:
+ puser = None
+
+ # execute POST requests
+ if request.method == "POST":
+ # add layers
+ if 'layerAdd' in request.POST and len(request.POST['layerAdd']) > 0:
+ for lc in Layer_Version.objects.filter(pk__in=[i for i in request.POST['layerAdd'].split(",") if len(i) > 0]):
+ ProjectLayer.objects.get_or_create(project = prj, layercommit = lc)
+
+ # remove layers
+ if 'layerDel' in request.POST and len(request.POST['layerDel']) > 0:
+ for t in request.POST['layerDel'].strip().split(" "):
+ pt = ProjectLayer.objects.filter(project = prj, layercommit_id = int(t)).delete()
+
+ if 'projectName' in request.POST:
+ prj.name = request.POST['projectName']
+ prj.save();
+
+ if 'projectVersion' in request.POST:
+ # If the release is the current project then return now
+ if prj.release.pk == int(request.POST.get('projectVersion',-1)):
+ return {}
+
+ prj.release = Release.objects.get(pk = request.POST['projectVersion'])
+ # we need to change the bitbake version
+ prj.bitbake_version = prj.release.bitbake_version
+ prj.save()
+ # we need to change the layers
+ for project in prj.projectlayer_set.all():
+ # find and add a similarly-named layer on the new branch
+ try:
+ layer_versions = prj.get_all_compatible_layer_versions()
+ layer_versions = layer_versions.filter(layer__name = project.layercommit.layer.name)
+ ProjectLayer.objects.get_or_create(project = prj, layercommit = layer_versions.first())
+ except IndexError:
+ pass
+ finally:
+ # get rid of the old entry
+ project.delete()
+
+ if 'machineName' in request.POST:
+ machinevar = prj.projectvariable_set.get(name="MACHINE")
+ machinevar.value=request.POST['machineName']
+ machinevar.save()
+
+
+ # we use implicit knowledge of the current user's project to filter layer information, e.g.
+ pid = prj.id
+
+ from collections import Counter
+ freqtargets = []
+ try:
+ freqtargets += map(lambda x: x.target, reduce(lambda x, y: x + y, map(lambda x: list(x.target_set.all()), Build.objects.filter(project = prj, outcome__lt = Build.IN_PROGRESS))))
+ freqtargets += map(lambda x: x.target, reduce(lambda x, y: x + y, map(lambda x: list(x.brtarget_set.all()), BuildRequest.objects.filter(project = prj, state = BuildRequest.REQ_FAILED))))
+ except TypeError:
+ pass
+ freqtargets = Counter(freqtargets)
+ freqtargets = sorted(freqtargets, key = lambda x: freqtargets[x], reverse=True)
+
+ context = {
+ "project" : prj,
+ "lvs_nos" : Layer_Version.objects.all().count(),
+ "completedbuilds": Build.objects.exclude(outcome = Build.IN_PROGRESS).filter(project_id = pid),
+ "prj" : {"name": prj.name, },
+ "buildrequests" : prj.build_set.filter(outcome=Build.IN_PROGRESS),
+ "builds" : Build.get_recent(prj),
+ "layers" : map(lambda x: {
+ "id": x.layercommit.pk,
+ "orderid": x.pk,
+ "name" : x.layercommit.layer.name,
+ "vcs_url": x.layercommit.layer.vcs_url,
+ "vcs_reference" : x.layercommit.get_vcs_reference(),
+ "url": x.layercommit.layer.layer_index_url,
+ "layerdetailurl": x.layercommit.get_detailspage_url(prj.pk),
+ # This branch name is actually the release
+ "branch" : { "name" : x.layercommit.get_vcs_reference(), "layersource" : x.layercommit.up_branch.layer_source.name if x.layercommit.up_branch != None else None}},
+ prj.projectlayer_set.all().order_by("id")),
+ "targets" : map(lambda x: {"target" : x.target, "task" : x.task, "pk": x.pk}, prj.projecttarget_set.all()),
+ "variables": map(lambda x: (x.name, x.value), prj.projectvariable_set.all()),
+ "freqtargets": freqtargets[:5],
+ "releases": map(lambda x: {"id": x.pk, "name": x.name, "description":x.description}, Release.objects.all()),
+ "project_html": 1,
+ "recipesTypeAheadUrl": reverse('xhr_recipestypeahead', args=(prj.pk,)),
+ "projectBuildsUrl": reverse('projectbuilds', args=(prj.pk,)),
+ }
+
+ if prj.release is not None:
+ context['release'] = { "id": prj.release.pk, "name": prj.release.name, "description": prj.release.description}
+
+
+ try:
+ context["machine"] = {"name": prj.projectvariable_set.get(name="MACHINE").value}
+ except ProjectVariable.DoesNotExist:
+ context["machine"] = None
+ try:
+ context["distro"] = prj.projectvariable_set.get(name="DISTRO").value
+ except ProjectVariable.DoesNotExist:
+ context["distro"] = "-- not set yet"
+
+ return context
+
+ def xhr_response(fun):
+ """
+ Decorator for REST methods.
+ calls jsonfilter on the returned dictionary and returns result
+ as HttpResponse object of content_type application/json
+ """
+ @wraps(fun)
+ def wrapper(*args, **kwds):
+ return HttpResponse(jsonfilter(fun(*args, **kwds)),
+ content_type="application/json")
+ return wrapper
+
+ 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 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" : map( _lv_to_dict(prj),
+ map(lambda x: x.layercommit, retval ))
+ })
+
+ except Exception as e:
+ return response({"error": str(e) })
+
+ def xhr_configvaredit(request, pid):
+ try:
+ prj = Project.objects.get(id = pid)
+ # add conf variables
+ if 'configvarAdd' in request.POST:
+ t=request.POST['configvarAdd'].strip()
+ if ":" in t:
+ variable, value = t.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(":")
+ 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' : map(lambda x: (x.name, x.value, x.pk), 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 xhr_importlayer(request):
+ if (not request.POST.has_key('vcs_url') or
+ not request.POST.has_key('name') or
+ not request.POST.has_key('git_ref') or
+ not request.POST.has_key('project_id')):
+ return HttpResponse(jsonfilter({"error": "Missing parameters; requires vcs_url, name, git_ref and project_id"}), content_type = "application/json")
+
+ layers_added = [];
+
+ # Rudimentary check for any possible html tags
+ for val in request.POST.values():
+ if "<" in val:
+ return HttpResponse(jsonfilter(
+ {"error": "Invalid character <"}),
+ content_type="application/json")
+
+ prj = Project.objects.get(pk=request.POST['project_id'])
+
+ # Strip trailing/leading whitespace from all values
+ # put into a new dict because POST one is immutable
+ post_data = dict()
+ for key,val in request.POST.iteritems():
+ post_data[key] = val.strip()
+
+
+ # We need to know what release the current project is so that we
+ # can set the imported layer's up_branch_id
+ prj_branch_name = Release.objects.get(pk=prj.release_id).branch_name
+ up_branch, branch_created = Branch.objects.get_or_create(name=prj_branch_name, layer_source_id=LayerSource.TYPE_IMPORTED)
+
+ layer_source = LayerSource.objects.get(sourcetype=LayerSource.TYPE_IMPORTED)
+ try:
+ layer, layer_created = Layer.objects.get_or_create(name=post_data['name'])
+ except MultipleObjectsReturned:
+ return HttpResponse(jsonfilter({"error": "hint-layer-exists"}), content_type = "application/json")
+
+ if layer:
+ if layer_created:
+ layer.layer_source = layer_source
+ layer.vcs_url = post_data['vcs_url']
+ layer.up_date = timezone.now()
+ layer.save()
+ else:
+ # We have an existing layer by this name, let's see if the git
+ # url is the same, if it is then we can just create a new layer
+ # version for this layer. Otherwise we need to bail out.
+ if layer.vcs_url != post_data['vcs_url']:
+ return HttpResponse(jsonfilter({"error": "hint-layer-exists-with-different-url" , "current_url" : layer.vcs_url, "current_id": layer.id }), content_type = "application/json")
+
+
+ layer_version, version_created = Layer_Version.objects.get_or_create(layer_source=layer_source, layer=layer, project=prj, up_branch_id=up_branch.id,branch=post_data['git_ref'], commit=post_data['git_ref'], dirpath=post_data['dir_path'])
+
+ if layer_version:
+ if not version_created:
+ return HttpResponse(jsonfilter({"error": "hint-layer-version-exists", "existing_layer_version": layer_version.id }), content_type = "application/json")
+
+ layer_version.up_date = timezone.now()
+ layer_version.save()
+
+ # Add the dependencies specified for this new layer
+ if (post_data.has_key("layer_deps") and
+ version_created and
+ len(post_data["layer_deps"]) > 0):
+ for layer_dep_id in post_data["layer_deps"].split(","):
+
+ layer_dep_obj = Layer_Version.objects.get(pk=layer_dep_id)
+ LayerVersionDependency.objects.get_or_create(layer_version=layer_version, depends_on=layer_dep_obj)
+ # Now add them to the project, we could get an execption
+ # if the project now contains the exact
+ # dependency already (like modified on another page)
+ try:
+ prj_layer, prj_layer_created = ProjectLayer.objects.get_or_create(layercommit=layer_dep_obj, project=prj)
+ except IntegrityError as e:
+ logger.warning("Integrity error while saving Project Layers: %s (original %s)" % (e, e.__cause__))
+ continue
+
+ if prj_layer_created:
+ layerdepdetailurl = reverse('layerdetails', args=(prj.id, layer_dep_obj.pk))
+ layers_added.append({'id': layer_dep_obj.id, 'name': Layer.objects.get(id=layer_dep_obj.layer_id).name, 'layerdetailurl': layerdepdetailurl })
+
+
+ # If an old layer version exists in our project then remove it
+ for prj_layers in ProjectLayer.objects.filter(project=prj):
+ dup_layer_v = Layer_Version.objects.filter(id=prj_layers.layercommit_id, layer_id=layer.id)
+ if len(dup_layer_v) >0 :
+ prj_layers.delete()
+
+ # finally add the imported layer (version id) to the project
+ ProjectLayer.objects.create(layercommit=layer_version, project=prj,optional=1)
+
+ else:
+ # We didn't create a layer version so back out now and clean up.
+ if layer_created:
+ layer.delete()
+
+ return HttpResponse(jsonfilter({"error": "Uncaught error: Could not create layer version"}), content_type = "application/json")
+
+ layerdetailurl = reverse('layerdetails', args=(prj.id, layer_version.pk))
+
+ json_response = {"error": "ok",
+ "imported_layer" : {
+ "name" : layer.name,
+ "id": layer_version.id,
+ "layerdetailurl": layerdetailurl,
+ },
+ "deps_added": layers_added }
+
+ return HttpResponse(jsonfilter(json_response), content_type = "application/json")
+
+ def xhr_updatelayer(request):
+
+ def error_response(error):
+ return HttpResponse(jsonfilter({"error": error}), content_type = "application/json")
+
+ if not request.POST.has_key("layer_version_id"):
+ return error_response("Please specify a layer version id")
+ try:
+ layer_version_id = request.POST["layer_version_id"]
+ layer_version = Layer_Version.objects.get(id=layer_version_id)
+ except Layer_Version.DoesNotExist:
+ return error_response("Cannot find layer to update")
+
+
+ if request.POST.has_key("vcs_url"):
+ layer_version.layer.vcs_url = request.POST["vcs_url"]
+ if request.POST.has_key("dirpath"):
+ layer_version.dirpath = request.POST["dirpath"]
+ if request.POST.has_key("commit"):
+ layer_version.commit = request.POST["commit"]
+ if request.POST.has_key("up_branch"):
+ layer_version.up_branch_id = int(request.POST["up_branch"])
+
+ if request.POST.has_key("add_dep"):
+ lvd = LayerVersionDependency(layer_version=layer_version, depends_on_id=request.POST["add_dep"])
+ lvd.save()
+
+ if request.POST.has_key("rm_dep"):
+ rm_dep = LayerVersionDependency.objects.get(layer_version=layer_version, depends_on_id=request.POST["rm_dep"])
+ rm_dep.delete()
+
+ if request.POST.has_key("summary"):
+ layer_version.layer.summary = request.POST["summary"]
+ if request.POST.has_key("description"):
+ layer_version.layer.description = request.POST["description"]
+
+ try:
+ layer_version.layer.save()
+ layer_version.save()
+ except Exception as e:
+ return error_response("Could not update layer version entry: %s" % e)
+
+ return HttpResponse(jsonfilter({"error": "ok",}), content_type = "application/json")
+
+ @xhr_response
+ def xhr_customrecipe(request):
+ """
+ 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": "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": "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": "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": "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": "recipe-already-exists"}
+
+ # create layer 'Custom layer' and verion if needed
+ layer = Layer.objects.get_or_create(
+ name=CustomImageRecipe.LAYER_NAME,
+ summary="Layer for custom recipes",
+ vcs_url="file:///toaster_created_layer")[0]
+
+ # 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 == None:
+ lver, created = Layer_Version.objects.get_or_create(
+ project=params['project'],
+ layer=layer,
+ 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, 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 created:
+ recipe.file_path = request.POST["name"]
+ recipe.license = "MIT"
+ recipe.version = "0.1"
+ recipe.save()
+
+ except Error as err:
+ return {"error": "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 == 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
+
+ return {"error": "ok",
+ "packages" : recipe.get_all_packages().count(),
+ "url": reverse('customrecipe', args=(params['project'].pk,
+ recipe.id))}
+
+ @xhr_response
+ def xhr_customrecipe_id(request, recipe_id):
+ """
+ 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>}
+ """
+ try:
+ custom_recipe = CustomImageRecipe.objects.get(id=recipe_id)
+ except CustomImageRecipe.DoesNotExist:
+ return {"error": "Custom recipe with id=%s "
+ "not found" % recipe_id}
+
+ 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 {"error": "ok", "info": info}
+
+ elif request.method == 'DELETE':
+ custom_recipe.delete()
+ return {"error": "ok"}
+ else:
+ return {"error": "Method %s is not supported" % request.method}
+
+ 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 _traverse_dependents(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 (_traverse_dependents(
+ pkg["pk"], rev_deps, all_current_packages, tree_level+1)):
+ return True
+
+ return False
+
+ def _get_all_dependents(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 = []
+ _traverse_dependents(package_id, rev_deps, all_current_packages)
+ rev_deps = sorted(rev_deps, key=lambda x: x["name"])
+ return rev_deps
+
+ @xhr_response
+ def xhr_customrecipe_packages(request, recipe_id, package_id):
+ """
+ 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>}
+ """
+ try:
+ recipe = CustomImageRecipe.objects.get(id=recipe_id)
+ except CustomImageRecipe.DoesNotExist:
+ return {"error": "Custom recipe with id=%s "
+ "not found" % recipe_id}
+
+ if package_id:
+ try:
+ package = CustomImagePackage.objects.get(id=package_id)
+ except Package.DoesNotExist:
+ return {"error": "Package with id=%s "
+ "not found" % package_id}
+
+ if request.method == 'GET':
+ # If no package_id then list the current packages
+ if not 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 {"error": "ok",
+ "packages" : list(packages),
+ "total" : len(packages),
+ "total_size" : total_size,
+ "total_size_formatted" :
+ filtered_filesizeformat(total_size)
+ }
+ else:
+ 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.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 = _get_all_dependents(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 {"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)}
+
+ included_packages = recipe.includes_set.values_list('pk', flat=True)
+
+ if request.method == 'PUT':
+ # 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":
+ "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 {"error": "ok"}
+
+ elif request.method == 'DELETE':
+ try:
+ # 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)
+ all_current_packages = recipe.get_all_packages()
+ reverse_deps_dictlist = _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 {"error": "ok"}
+ except CustomImageRecipe.DoesNotExist:
+ return {"error": "Tried to remove package that wasn't present"}
+
+ else:
+ return {"error": "Method %s is not supported" % request.method}
+
+ def importlayer(request, pid):
+ template = "importlayer.html"
+ context = {
+ 'project': Project.objects.get(id=pid),
+ }
+ return render(request, template, context)
+
+ @_template_renderer('layerdetails.html')
+ def layerdetails(request, pid, layerid):
+ project = Project.objects.get(pk=pid)
+ layer_version = Layer_Version.objects.get(pk=layerid)
+
+ context = {'project' : project,
+ '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': map(lambda prjlayer: prjlayer.layercommit.id, ProjectLayer.objects.filter(project=project))
+ }
+
+ return 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','SSTATE_MIRRORS','TMPDIR',
+ 'all_proxy','ftp_proxy','http_proxy ','https_proxy'
+ }
+
+ vars_fstypes = Target_Image_File.SUFFIXES
+
+ return(vars_managed,sorted(vars_fstypes),vars_blacklist)
+
+ @_template_renderer("projectconf.html")
+ 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 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 == "buildartifact":
+ file_name = BuildArtifact.objects.get(build = build, pk = artifact_id).file_name
+
+ elif artifact_type == "licensemanifest":
+ file_name = Target.objects.get(build = build, pk = artifact_id).license_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, "r")
+ 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 render(request, "unavailable_artifact.html")
+ except ObjectDoesNotExist, IOError:
+ return render(request, "unavailable_artifact.html")
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/widgets.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/widgets.py
new file mode 100644
index 000000000..d2ef5d3db
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastergui/widgets.py
@@ -0,0 +1,421 @@
+#
+# 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.http import HttpResponseBadRequest
+from django.core import serializers
+from django.core.cache import cache
+from django.core.paginator import Paginator, EmptyPage
+from django.db.models import Q
+from orm.models import Project, ProjectLayer, Layer_Version
+from django.template import Context, Template
+from django.core.serializers.json import DjangoJSONEncoder
+from django.core.exceptions import FieldError
+from django.conf.urls import url, patterns
+
+import types
+import json
+import collections
+import operator
+import re
+import urllib
+
+import logging
+logger = logging.getLogger("toaster")
+
+from toastergui.views import objtojson
+from toastergui.tablefilter import TableFilterMap
+
+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 = ""
+
+ # add the "id" column, undisplayable, by default
+ self.add_column(title="Id",
+ displayable=False,
+ orderable=True,
+ field_name="id")
+
+ # 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()
+
+ 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):
+ data = None
+
+ 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,
+ displayable=True, computation=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,
+ 'displayable': displayable,
+ 'computation': computation,
+ })
+
+ 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 = urllib.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 = []
+ for st in search_term.split(" "):
+ q_map = [Q(**{field + '__icontains': st})
+ for field in self.queryset.model.search_allowed_fields]
+
+ search_queries.append(reduce(operator.or_, q_map))
+
+ search_queries = reduce(operator.and_, search_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.iteritems():
+ if key == 'nocache':
+ continue
+ cache_name = cache_name + str(key) + str(val)
+
+ for key, val in kwargs.iteritems():
+ 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 row 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 Exception("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']:
+ required_data["static:%s" % col['static_data_name']] = self.render_static_data(col['static_data_template'], row)
+
+ # 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']
+
+ # compute the computation on the raw data if needed
+ model_data = row
+ if col['computation']:
+ model_data = col['computation'](row)
+ else:
+ # Traverse to any foriegn key in the object hierachy
+ for subfield in field.split("__"):
+ if hasattr(model_data, subfield):
+ model_data = getattr(model_data, subfield)
+ # The field could be a function on the model so check
+ # If it is then call it
+ 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, default=objtojson)
+ 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 == 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 MissingFieldsException as e:
+ error = e
+
+ data = { 'results' : results,
+ 'error' : error,
+ }
+
+ return response(data)
+
+ def validate_fields(self, result):
+ if 'name' in result == False or 'detail' in result == False:
+ raise 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
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/__init__.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/__init__.py
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/management/__init__.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/management/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/management/__init__.py
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/management/commands/__init__.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/management/commands/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/management/commands/__init__.py
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/management/commands/builddelete.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/management/commands/builddelete.py
new file mode 100644
index 000000000..ff93e549d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/management/commands/buildslist.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/management/commands/buildslist.py
new file mode 100644
index 000000000..cad987fd9
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/management/commands/buildslist.py
@@ -0,0 +1,13 @@
+from django.core.management.base import NoArgsCommand, CommandError
+from orm.models import Build
+import os
+
+
+
+class Command(NoArgsCommand):
+ args = ""
+ help = "Lists current builds"
+
+ def handle_noargs(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/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/management/commands/checksocket.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/management/commands/checksocket.py
new file mode 100644
index 000000000..0399b8659
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/management/commands/get-dburl.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/management/commands/get-dburl.py
new file mode 100644
index 000000000..22b3eb79e
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/management/commands/get-dburl.py
@@ -0,0 +1,9 @@
+from toastermain.settings import getDATABASE_URL
+from django.core.management.base import NoArgsCommand
+
+class Command(NoArgsCommand):
+ args = ""
+ help = "get database url"
+
+ def handle_noargs(self,**options):
+ print getDATABASE_URL()
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/management/commands/perf.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/management/commands/perf.py
new file mode 100644
index 000000000..71a48e95d
--- /dev/null
+++ b/import-layers/yocto-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 >>sys.stderr, arg,
+ print >>sys.stderr
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/settings.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/settings.py
new file mode 100644
index 000000000..74ab60462
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/settings.py
@@ -0,0 +1,396 @@
+#
+# 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, re
+
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
+
+# 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
+
+DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
+ 'NAME': 'toaster.sqlite', # Or path to database file if using sqlite3.
+ 'USER': '',
+ 'PASSWORD': '',
+ 'HOST': '127.0.0.1', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
+ 'PORT': '3306', # Set to empty string for default.
+ }
+}
+
+# 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 }
+
+# Reinterpret database settings if we have DATABASE_URL environment variable defined
+
+if 'DATABASE_URL' in os.environ:
+ dburl = os.environ['DATABASE_URL']
+
+ if dburl.startswith('sqlite3://'):
+ result = re.match('sqlite3://(.*)', dburl)
+ if result is None:
+ raise Exception("ERROR: Could not read sqlite database url: %s" % dburl)
+ DATABASES['default'] = {
+ 'ENGINE': 'django.db.backends.sqlite3',
+ 'NAME': result.group(1),
+ 'USER': '',
+ 'PASSWORD': '',
+ 'HOST': '',
+ 'PORT': '',
+ }
+ elif dburl.startswith('mysql://'):
+ # URL must be in this form: mysql://user:pass@host:port/name
+ result = re.match(r"mysql://([^:]*):([^@]*)@([^:]*):(\d*)/([^/]*)", dburl)
+ if result is None:
+ raise Exception("ERROR: Could not read mysql database url: %s" % dburl)
+ DATABASES['default'] = {
+ 'ENGINE': 'django.db.backends.mysql',
+ 'NAME': result.group(5),
+ 'USER': result.group(1),
+ 'PASSWORD': result.group(2),
+ 'HOST': result.group(3),
+ 'PORT': result.group(4),
+ }
+ else:
+ raise Exception("FIXME: Please implement missing database url schema for url: %s" % dburl)
+
+
+# Allows current database settings to be exported as a DATABASE_URL environment variable value
+
+def getDATABASE_URL():
+ d = DATABASES['default']
+ if d['ENGINE'] == 'django.db.backends.sqlite3':
+ if d['NAME'] == ':memory:':
+ return 'sqlite3://:memory:'
+ elif d['NAME'].startswith("/"):
+ return 'sqlite3://' + d['NAME']
+ return "sqlite3://" + os.path.join(os.getcwd(), d['NAME'])
+
+ elif d['ENGINE'] == 'django.db.backends.mysql':
+ return "mysql://" + d['USER'] + ":" + d['PASSWORD'] + "@" + d['HOST'] + ":" + d['PORT'] + "/" + d['NAME']
+
+ raise Exception("FIXME: Please implement missing database url schema for engine: %s" % d['ENGINE'])
+
+
+
+# Hosts/domain names that are valid for this site; required if DEBUG is False
+# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
+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
+ pass
+ try:
+ if pytz.timezone(zonename) is not None:
+ zonefilelist[hashlib.md5(open(filepath).read()).hexdigest()] = zonename
+ except UnknownTimeZoneError, ValueError:
+ # we expect timezone failures here, just move over
+ pass
+ except ImportError:
+ zonefilelist[hashlib.md5(open(filepath).read()).hexdigest()] = zonename
+
+ TIME_ZONE = zonefilelist[hashlib.md5(open('/etc/localtime').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'
+
+# List of callables that know how to import templates from various sources.
+TEMPLATE_LOADERS = (
+ 'django.template.loaders.filesystem.Loader',
+ 'django.template.loaders.app_directories.Loader',
+# 'django.template.loaders.eggs.Loader',
+)
+
+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'
+
+TEMPLATE_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.
+)
+
+TEMPLATE_CONTEXT_PROCESSORS = ('django.contrib.auth.context_processors.auth',
+ 'django.core.context_processors.debug',
+ 'django.core.context_processors.i18n',
+ 'django.core.context_processors.media',
+ 'django.core.context_processors.static',
+ 'django.core.context_processors.tz',
+ 'django.contrib.messages.context_processors.messages',
+ "django.core.context_processors.request",
+ 'toastergui.views.managedcontextprocessor',
+ )
+
+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 os.environ.has_key('VIRTUAL_ENV') 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)
+#
+
+
+class InvalidString(str):
+ def __mod__(self, other):
+ from django.template.base import TemplateSyntaxError
+ raise TemplateSyntaxError(
+ "Undefined variable or unknown value for: \"%s\"" % other)
+
+TEMPLATE_STRING_IF_INVALID = InvalidString("%s")
diff --git a/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/urls.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/urls.py
new file mode 100644
index 000000000..534679dc5
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/urls.py
@@ -0,0 +1,90 @@
+#
+# 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 patterns, include, url
+from django.views.generic import RedirectView
+from django.views.decorators.cache import never_cache
+
+import logging
+
+logger = logging.getLogger("toaster")
+
+# Uncomment the next two lines to enable the admin:
+from django.contrib import admin
+admin.autodiscover()
+
+urlpatterns = patterns('',
+
+ # 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'),
+
+ # 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 os.environ.has_key('VIRTUAL_ENV') 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.warn("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/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/wsgi.py b/import-layers/yocto-poky/bitbake/lib/toaster/toastermain/wsgi.py
new file mode 100644
index 000000000..031b314b1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/bitbake/toaster-requirements.txt b/import-layers/yocto-poky/bitbake/toaster-requirements.txt
new file mode 100644
index 000000000..0e8c742cb
--- /dev/null
+++ b/import-layers/yocto-poky/bitbake/toaster-requirements.txt
@@ -0,0 +1,4 @@
+Django>1.8,<1.9
+argparse==1.2.1
+wsgiref==0.1.2
+beautifulsoup4>=4.4.0
diff --git a/import-layers/yocto-poky/documentation/Makefile b/import-layers/yocto-poky/documentation/Makefile
new file mode 100644
index 000000000..418d3ca8c
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/Makefile
@@ -0,0 +1,467 @@
+# 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 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 Manual or
+# the mega-manual, you must also use the BRANCH argument.
+#
+# Examples:
+#
+# make DOC=bsp-guide
+# make html DOC=yocto-project-qs
+# 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=yocto-project-qs' 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 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 Manual for the 'edison' branch. The fourth example
+# publishes the 1.2 version of the PDF and HTML YP Development Manual for the
+# 'denzil' branch.
+#
+
+ifeq ($(DOC),bsp-guide)
+XSLTOPTS = --xinclude
+ALLPREQ = html eclipse tarball
+TARFILES = bsp-style.css bsp-guide.html figures/bsp-title.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/bsp-dev-flow.png \
+ figures/dev-title.png figures/git-workflow.png \
+ figures/index-downloads.png figures/kernel-dev-flow.png \
+ figures/kernel-overview-1.png figures/kernel-overview-2-generic.png \
+ figures/source-repos.png figures/yp-download.png \
+ figures/recipe-workflow.png figures/build-workspace-directory.png \
+ figures/devtool-add-flow.png figures/devtool-modify-flow.png \
+ figures/devtool-upgrade-flow.png \
+ eclipse
+ endif
+
+MANUALS = $(DOC)/$(DOC).html $(DOC)/eclipse
+FIGURES = figures
+STYLESHEET = $(DOC)/*.css
+
+endif
+
+ifeq ($(DOC),yocto-project-qs)
+XSLTOPTS = --xinclude
+ALLPREQ = html eclipse tarball
+TARFILES = yocto-project-qs.html qs-style.css figures/yocto-environment.png \
+ figures/yocto-project-transp.png \
+ eclipse
+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/yocto-environment.png \
+ figures/building-an-image.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-1.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/yocto-environment-ref.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/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/devtool-add-flow.png \
+ figures/devtool-modify-flow.png figures/devtool-upgrade-flow.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
+ 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/buildhistory.png figures/buildhistory-web.png eclipse \
+ figures/cross-development-toolchains.png figures/layer-input.png \
+ figures/package-feeds.png figures/source-input.png \
+ figures/user-configuration.png figures/yocto-environment-ref.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/sdk-generation.png figures/building-an-image.png
+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 \
+ 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-architecture-overview.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),yocto-project-qs)
+ @echo " "
+ @echo "ERROR: You cannot generate a yocto-project-qs PDF file."
+ @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), sdk-manual bsp-guide dev-manual kernel-dev profile-manual ref-manual yocto-project-qs),)
+ @echo " "
+ @echo "ERROR: You can only create eclipse documentation"
+ @echo " of the following documentation parts:"
+ @echo " - sdk-manual"
+ @echo " - bsp-guide"
+ @echo " - dev-manual"
+ @echo " - kernel-dev"
+ @echo " - profile-manual"
+ @echo " - ref-manual"
+ @echo " - yocto-project-qs"
+ @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/import-layers/yocto-poky/documentation/README b/import-layers/yocto-poky/documentation/README
new file mode 100644
index 000000000..a4e70a872
--- /dev/null
+++ b/import-layers/yocto-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 Manual
+* kernel-dev - The Yocto Project Linux Kernel Development 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/import-layers/yocto-poky/documentation/adt-manual/adt-command.xml b/import-layers/yocto-poky/documentation/adt-manual/adt-command.xml
new file mode 100644
index 000000000..c78d18a16
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/adt-manual/adt-intro.xml b/import-layers/yocto-poky/documentation/adt-manual/adt-intro.xml
new file mode 100644
index 000000000..597c7120b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/adt-manual/adt-manual-customization.xsl b/import-layers/yocto-poky/documentation/adt-manual/adt-manual-customization.xsl
new file mode 100644
index 000000000..b86be519b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/adt-manual/adt-manual-eclipse-customization.xsl b/import-layers/yocto-poky/documentation/adt-manual/adt-manual-eclipse-customization.xsl
new file mode 100644
index 000000000..77ba5f571
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/adt-manual/adt-manual-intro.xml b/import-layers/yocto-poky/documentation/adt-manual/adt-manual-intro.xml
new file mode 100644
index 000000000..034fdff60
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/adt-manual/adt-manual.xml b/import-layers/yocto-poky/documentation/adt-manual/adt-manual.xml
new file mode 100644
index 000000000..972f8bf08
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/adt-manual/adt-package.xml b/import-layers/yocto-poky/documentation/adt-manual/adt-package.xml
new file mode 100644
index 000000000..68eee9b38
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/adt-manual/adt-prepare.xml b/import-layers/yocto-poky/documentation/adt-manual/adt-prepare.xml
new file mode 100644
index 000000000..65df1d03e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/adt-manual/adt-style.css b/import-layers/yocto-poky/documentation/adt-manual/adt-style.css
new file mode 100644
index 000000000..d722ad4b7
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/adt-manual/figures/adt-title.png b/import-layers/yocto-poky/documentation/adt-manual/figures/adt-title.png
new file mode 100644
index 000000000..6e71e41f1
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/adt-manual/figures/adt-title.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/adt-manual/figures/using-a-pre-built-image.png b/import-layers/yocto-poky/documentation/adt-manual/figures/using-a-pre-built-image.png
new file mode 100644
index 000000000..b03130d12
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/adt-manual/figures/using-a-pre-built-image.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/bsp-guide/bsp-guide-customization.xsl b/import-layers/yocto-poky/documentation/bsp-guide/bsp-guide-customization.xsl
new file mode 100644
index 000000000..de674a0ae
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/bsp-guide/bsp-guide-eclipse-customization.xsl b/import-layers/yocto-poky/documentation/bsp-guide/bsp-guide-eclipse-customization.xsl
new file mode 100644
index 000000000..35346effc
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/bsp-guide/bsp-guide.xml b/import-layers/yocto-poky/documentation/bsp-guide/bsp-guide.xml
new file mode 100644
index 000000000..c00b3458c
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/bsp-guide/bsp-guide.xml
@@ -0,0 +1,143 @@
+<!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>Saul</firstname> <surname>Wold</surname>
+ <affiliation>
+ <orgname>Intel Corporation</orgname>
+ </affiliation>
+ <email>saul.wold@intel.com</email>
+ </author>
+ <author>
+ <firstname>Richard</firstname> <surname>Purdie</surname>
+ <affiliation>
+ <orgname>Linux Foundation</orgname>
+ </affiliation>
+ <email>richard.purdie@linuxfoundation.org</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>
+ </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>
+ For the latest version of this manual associated with this
+ Yocto Project release, see the
+ <ulink url='&YOCTO_DOCS_BSP_URL;'>Yocto Project Board Support Package (BSP) Developer's Guide</ulink>
+ from the Yocto Project website.
+ </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/import-layers/yocto-poky/documentation/bsp-guide/bsp-style.css b/import-layers/yocto-poky/documentation/bsp-guide/bsp-style.css
new file mode 100644
index 000000000..e407ca4a7
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/bsp-guide/bsp-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/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;
+}
+
+
+ /*********** /
+ / 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/import-layers/yocto-poky/documentation/bsp-guide/bsp.xml b/import-layers/yocto-poky/documentation/bsp-guide/bsp.xml
new file mode 100644
index 000000000..b0562c7d4
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/bsp-guide/bsp.xml
@@ -0,0 +1,1697 @@
+<!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 and manage a
+ <link linkend='bsp-layers'>BSP Layer</link> using two Yocto Project
+ <link linkend='using-the-yocto-projects-bsp-tools'>BSP Tools</link>.
+ </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, layers in the Yocto Project use the
+ following well-established naming convention:
+ <literallayout class='monospaced'>
+ meta-<replaceable>bsp_name</replaceable>
+ </literallayout>
+ The string "meta-" is prepended to the machine or platform name, which is
+ <replaceable>bsp_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, you might run into situations where obscure
+ scripts 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_DEV_URL;#yocto-project-repositories'>Yocto Project Source Repositories</ulink>
+ through a web interface at
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi'></ulink>.
+ If you go to that interface, you will find near the bottom of the list
+ under "Yocto Metadata Layers" several BSP layers all of which are
+ 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 near the bottom of that referenced
+ Yocto Project Source Repository, 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 and 64-bit IA machines.
+ </para>
+
+ <para>
+ For information on the BSP development workflow, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#developing-a-board-support-package-bsp'>Developing a Board Support Package (BSP)</ulink>"
+ section in the Yocto Project Development Manual.
+ 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;#getting-setup'>Getting Set Up</ulink>"
+ section also in the Yocto Project Development Manual.
+ </para>
+
+ <para>
+ The layer's base directory
+ (<filename>meta-<replaceable>bsp_name</replaceable></filename>)
+ is the root of the BSP Layer.
+ This root 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_DEV_URL;#build-directory'>Build Directory</ulink>,
+ which is established after you run one of the OpenEmbedded build environment
+ setup scripts (i.e.
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>).
+ Adding the root allows the OpenEmbedded build system to recognize the BSP
+ definition 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>
+ </para>
+
+ <para>
+ Some BSPs require additional layers on
+ top of the BSP's root layer in order to be functional.
+ For these cases, you also need to add those layers to the
+ <filename>BBLAYERS</filename> variable in order to build the BSP.
+ You must also specify in the "Dependencies" section of the BSP's
+ <filename>README</filename> file any requirements for additional
+ layers and, preferably, any
+ build instructions that might be contained elsewhere
+ in the <filename>README</filename> file.
+ </para>
+
+ <para>
+ Some layers function as a layer to hold other BSP layers.
+ An example of this type of layer is the <filename>meta-intel</filename> layer,
+ which contains a number of individual BSP sub-layers, as well as a directory
+ named <filename>common/</filename> full of common content across those layers.
+ Another example is the <filename>meta-yocto-bsp</filename> layer mentioned
+ earlier.
+ </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 of the Yocto Project Development Manual.
+ </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 structure.
+ A common format also encourages standardization of software support of hardware.
+ </para>
+
+ <para>
+ The proposed form does have elements that are specific to the
+ OpenEmbedded build system.
+ It is intended that this information can be
+ used by other build systems besides the OpenEmbedded build system
+ and that it will be simple
+ to extract information and convert it to other formats if required.
+ The OpenEmbedded build system, through its standard layers mechanism, can directly
+ accept the format described as a layer.
+ The BSP captures all
+ the hardware-specific details in one place in 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 -
+ it is concerned with the hardware-specific components only.
+ At the end-distribution point, you can ship the BSP combined with a build system
+ and other tools.
+ However, it is important to maintain the distinction that these
+ are separate components that happen 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 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 you can use this basic form for the standard, realize that the actual structures
+ for specific BSPs could differ.
+
+ <literallayout class='monospaced'>
+ meta-<replaceable>bsp_name</replaceable>/
+ meta-<replaceable>bsp_name</replaceable>/<replaceable>bsp_license_file</replaceable>
+ meta-<replaceable>bsp_name</replaceable>/README
+ meta-<replaceable>bsp_name</replaceable>/README.sources
+ meta-<replaceable>bsp_name</replaceable>/binary/<replaceable>bootable_images</replaceable>
+ meta-<replaceable>bsp_name</replaceable>/conf/layer.conf
+ meta-<replaceable>bsp_name</replaceable>/conf/machine/*.conf
+ meta-<replaceable>bsp_name</replaceable>/recipes-bsp/*
+ meta-<replaceable>bsp_name</replaceable>/recipes-core/*
+ meta-<replaceable>bsp_name</replaceable>/recipes-graphics/*
+ meta-<replaceable>bsp_name</replaceable>/recipes-kernel/linux/linux-yocto_<replaceable>kernel_rev</replaceable>.bbappend
+ </literallayout>
+ </para>
+
+ <para>
+ Below is an example of the Raspberry Pi BSP:
+
+ <literallayout class='monospaced'>
+ meta-raspberrypi/COPYING.MIT
+ meta-raspberrypi/README
+ meta-raspberrypi/classes
+ meta-raspberrypi/classes/linux-raspberrypi-base.bbclass
+ meta-raspberrypi/classes/sdcard_image-rpi.bbclass
+ meta-raspberrypi/conf/
+ meta-raspberrypi/conf/layer.conf
+ meta-raspberrypi/conf/machine/
+ meta-raspberrypi/conf/machine/raspberrypi.conf
+ meta-raspberrypi/conf/machine/raspberrypi0.conf
+ meta-raspberrypi/conf/machine/raspberrypi2.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/rpi-tune-arm1176jzf-s.inc
+ 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_00.bbappend
+ meta-raspberrypi/recipes-bsp/formfactor/raspberrypi/machconfig
+ meta-raspberrypi/recipes-bsp/rpi-mkimage_git.bb
+ meta-raspberrypi/recipes-bsp/rpi-mkimage/License
+ meta-raspberrypi/recipes-bsp/rpi-mkimage/open-files-relative-to-script.patch
+ meta-raspberrypi/recipes-bsp/u-boot/u-boot-rpi_git.bb
+ 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/psplash_git.bbappend
+ meta-raspberrypi/recipes-core/psplash/files/psplash-raspberrypi-img.h
+ meta-raspberrypi/recipes-devtools
+ meta-raspberrypi/recipes-devtools/bcm2835
+ meta-raspberrypi/recipes-devtools/bcm2835/bcm2835_1.46.bb
+ meta-raspberrypi/recipes-devtools/pi-blaster
+ meta-raspberrypi/recipes-devtools/pi-blaster/files
+ meta-raspberrypi/recipes-devtools/pi-blaster/*.patch
+ meta-raspberrypi/recipes-devtools/pi-blaster/pi-blaster.inc
+ 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.1.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.1.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
+ meta-raspberrypi/recipes-devtools/wiringPi/wiringpi/*.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/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/weston
+ meta-raspberrypi/recipes-graphics/weston/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/99-pitft.conf
+ meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend
+ meta-raspberrypi/recipes-kernel
+ meta-raspberrypi/recipes-kernel/linux-firmware
+ meta-raspberrypi/recipes-kernel/linux-firmware/linux-firmware
+ meta-raspberrypi/recipes-kernel/linux-firmware/linux-firmware/LICENSE.broadcom_brcm80211
+ meta-raspberrypi/recipes-kernel/linux-firmware/linux-firmware/brcmfmac43430-sdio.bin
+ meta-raspberrypi/recipes-kernel/linux-firmware/linux-firmware/brcmfmac43430-sdio.txt
+ meta-raspberrypi/recipes-kernel/linux-firmware/linux-firmware_git.bbappend
+ meta-raspberrypi/recipes-kernel/linux
+ meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-3.14
+ meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-3.14/*.patch
+ meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-3.18
+ meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-3.18/*.patch
+ meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.1
+ meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.1/*.patch
+ meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi.inc
+ meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi
+ meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/defconfig
+ meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_3.14.bb
+ meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_3.18.bb
+ meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.1.bb
+ meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.4.bb
+ meta-raspberrypi/recipes-kernel/linux/linux.inc
+ 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/omxplayer
+ meta-raspberrypi/recipes-multimedia/omxplayer/omxplayer
+ meta-raspberrypi/recipes-multimedia/omxplayer/omxplayer/*.patch
+ meta-raspberrypi/recipes-multimedia/omxplayer/omxplayer_git.bb
+ meta-raspberrypi/scripts
+ meta-raspberrypi/scripts/lib
+ meta-raspberrypi/scripts/lib/image
+ meta-raspberrypi/scripts/lib/image/canned-wks
+ meta-raspberrypi/scripts/lib/image/canned-wks/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_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.
+ </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_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 special 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_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_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_DEV_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.
+ </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_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 <filename>README</filename> file should be present in the
+ BSP Layer and it will explain how to use the images with the
+ target hardware.
+ Additionally, the <filename>README.sources</filename> 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_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>" and
+ "<replaceable>_bsp</replaceable>" with the actual name
+ of the BSP (i.e. <replaceable>bsp_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_DEV_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_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.
+ If the BSP supports multiple machines, multiple machine configuration files
+ can be present.
+ 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 virtual/kernel), 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>
+ Each BSP Layer requires at least one machine file.
+ However, you can supply more than one file.
+ </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_DEV_URL;#source-directory'>Source Directory</ulink>.
+ For example, the <filename>ia32-base.inc</filename> file resides in the
+ <filename>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/raspberrypi2.conf
+ </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_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_DEV_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_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_name</replaceable>/recipes-kernel/linux/linux-yocto*.bbappend
+ </literallayout>
+ </para>
+
+ <para>
+ These files append your specific changes to the main kernel recipe you are using.
+ </para>
+ <para>
+ For your BSP, you typically want to use an existing Yocto Project kernel recipe found in the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
+ at <filename>meta/recipes-kernel/linux</filename>.
+ You can append your specific changes to the kernel recipe by using a
+ similarly named append file, which is located in the BSP Layer (e.g.
+ the <filename>meta-<replaceable>bsp_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_name</replaceable><filename>.conf</filename> file by adding these types
+ of statements:
+ <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_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>
+ 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.4.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 ?= "ff4c4ef15b51f45b9106d71bf1f62fe7c02e63c2"
+ SRCREV_machine_genericx86-64 ?= "ff4c4ef15b51f45b9106d71bf1f62fe7c02e63c2"
+ SRCREV_machine_edgerouter ?= "ff4c4ef15b51f45b9106d71bf1f62fe7c02e63c2"
+ SRCREV_machine_beaglebone ?= "ff4c4ef15b51f45b9106d71bf1f62fe7c02e63c2"
+ SRCREV_machine_mpc8315e-rdb ?= "df00877ef9387b38b9601c82db57de2a1b23ce53"
+
+ 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.4.3"
+ LINUX_VERSION_genericx86-64 = "4.4.3"
+ </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_DEV_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>
+
+ <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>" and the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding
+ and Creating Layers"</ulink> in the Yocto Project Development 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.
+ In particular, 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.
+ You can find <filename>recipes.txt</filename> in the
+ <filename>meta</filename> directory of the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>,
+ or in the OpenEmbedded Core Layer
+ (<filename>openembedded-core</filename>) found at
+ <ulink url='http://git.openembedded.org/openembedded-core/tree/meta'></ulink>.
+ </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-<replaceable>bsp_name</replaceable></filename> directory.
+ This license covers the BSP Metadata as a whole.
+ You must specify which license to use since there is no
+ default license if one is 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-<replaceable>bsp_name</replaceable></filename> directory.
+ See the
+ <ulink url='&YOCTO_GIT_URL;/cgit.cgi/meta-raspberrypi/tree/README'><filename>README</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'>How to Submit a Change</ulink>"
+ section in the Yocto Project Development 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>
+ You must include a <filename>README.sources</filename> in the
+ <filename>meta-<replaceable>bsp_name</replaceable></filename> directory.
+ This file specifies exactly where you can find the sources used to
+ generate the binary images contained in the
+ <filename>binary</filename> directory, if present.
+ </para></listitem>
+ <listitem><para><emphasis>Layer Configuration File:</emphasis>
+ You must include a <filename>conf/layer.conf</filename> in the
+ <filename>meta-<replaceable>bsp_name</replaceable></filename> directory.
+ This file identifies the <filename>meta-<replaceable>bsp_name</replaceable></filename>
+ 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/<replaceable>bsp_name</replaceable>.conf</filename>
+ files in the <filename>meta-<replaceable>bsp_name</replaceable></filename> 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 are supported by the BSP.
+ 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 a released BSP that conforms to the
+ Yocto Project:
+ <itemizedlist>
+ <listitem><para><emphasis>Bootable Images:</emphasis>
+ BSP releases
+ can contain one or more bootable images.
+ Including bootable images allows users to easily try out the BSP
+ on their own hardware.</para>
+ <para>In some cases, it might not be convenient to include a
+ bootable image.
+ In this case, 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-<replaceable>bsp_name</replaceable></filename> 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;/cgit.cgi'>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</ulink>"
+ section in the Yocto Project Development Manual.
+ </para></listitem>
+ <listitem><para>
+ Ensure your directory structure in the BSP layer
+ that supports your machine is such that it can be found
+ by the build system.
+ 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 out 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.
+ Consider an example that 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.
+ Do the following:
+ <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 the license is accepted, 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" page from the
+ <ulink url='&YOCTO_HOME_URL;'>Yocto Project website's</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 the respective
+ encumbered BSPs.
+ If available, these substitutions are your
+ simplest and most preferred options.
+ Use of these substitutions of course assumes the resulting functionality meets
+ system requirements.
+ </para>
+
+ <para>
+ If however, a non-encumbered version is unavailable or
+ it provides unsuitable functionality or quality, you can use an encumbered
+ version.
+ </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_REF_URL;#enabling-commercially-licensed-recipes'>Enabling
+ Commercially Licensed Recipes</ulink>" section in the Yocto Project Reference
+ 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 visiting the
+ "Downloads" page of 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.
+ Note that 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>
+ </para>
+
+ <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>
+ </section>
+
+ <section id='using-the-yocto-projects-bsp-tools'>
+ <title>Using the Yocto Project's BSP Tools</title>
+
+ <para>
+ The Yocto Project includes a couple of tools that enable
+ you to create a <link linkend='bsp-layers'>BSP layer</link>
+ from scratch and do basic configuration and maintenance
+ of the kernel without ever looking at a Metadata file.
+ These tools are <filename>yocto-bsp</filename> and <filename>yocto-kernel</filename>,
+ respectively.
+ </para>
+
+ <para>
+ The following sections describe the common location and help features as well
+ as provide details for the
+ <filename>yocto-bsp</filename> and <filename>yocto-kernel</filename> tools.
+ </para>
+
+ <section id='common-features'>
+ <title>Common Features</title>
+
+ <para>
+ Designed to have a command interface somewhat like
+ <ulink url='&YOCTO_DOCS_DEV_URL;#git'>Git</ulink>, each
+ tool is structured as a set of sub-commands under a
+ top-level command.
+ The top-level command (<filename>yocto-bsp</filename>
+ or <filename>yocto-kernel</filename>) itself does
+ nothing but invoke or provide help on the sub-commands
+ it supports.
+ </para>
+
+ <para>
+ Both tools reside in the <filename>scripts/</filename> subdirectory
+ of the <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ Consequently, to use the scripts, you must <filename>source</filename> the
+ environment just as you would when invoking a build:
+ <literallayout class='monospaced'>
+ $ source oe-init-build-env <replaceable>build_dir</replaceable>
+ </literallayout>
+ </para>
+
+ <para>
+ The most immediately useful function is to get help on both tools.
+ The built-in help system makes it easy to drill down at
+ any time and view the syntax required for any specific command.
+ Simply enter the name of the command with the <filename>help</filename>
+ switch:
+ <literallayout class='monospaced'>
+ $ yocto-bsp help
+ Usage:
+
+ Create a customized Yocto BSP layer.
+
+ usage: yocto-bsp [--version] [--help] COMMAND [ARGS]
+
+ Current 'yocto-bsp' commands are:
+ create Create a new Yocto BSP
+ list List available values for options and BSP properties
+
+ See 'yocto-bsp help COMMAND' for more information on a specific command.
+
+
+ Options:
+ --version show program's version number and exit
+ -h, --help show this help message and exit
+ -D, --debug output debug information
+ </literallayout>
+ </para>
+
+ <para>
+ Similarly, entering just the name of a sub-command shows the detailed usage
+ for that sub-command:
+ <literallayout class='monospaced'>
+ $ yocto-bsp create
+ ERROR:root:Wrong number of arguments, exiting
+
+ Usage:
+
+ Create a new Yocto BSP
+
+ usage: yocto-bsp create &lt;bsp-name&gt; &lt;karch&gt; [-o &lt;DIRNAME&gt; | --outdir &lt;DIRNAME&gt;]
+ [-i &lt;JSON PROPERTY FILE&gt; | --infile &lt;JSON PROPERTY_FILE&gt;]
+
+ This command creates a Yocto BSP based on the specified parameters.
+ The new BSP will be a new Yocto BSP layer contained by default within
+ the top-level directory specified as 'meta-bsp-name'. The -o option
+ can be used to place the BSP layer in a directory with a different
+ name and location.
+
+ The value of the 'karch' parameter determines the set of files that
+ will be generated for the BSP, along with the specific set of
+ 'properties' that will be used to fill out the BSP-specific portions
+ of the BSP. The possible values for the 'karch' parameter can be
+ listed via 'yocto-bsp list karch'.
+
+ ...
+ </literallayout>
+ </para>
+
+ <para>
+ For any sub-command, you can use the word "help" option just before the
+ sub-command to get more extensive documentation:
+ <literallayout class='monospaced'>
+ $ yocto-bsp help create
+
+ NAME
+ yocto-bsp create - Create a new Yocto BSP
+
+ SYNOPSIS
+ yocto-bsp create &lt;bsp-name> &lt;karch&gt; [-o &lt;DIRNAME&gt; | --outdir &lt;DIRNAME&gt;]
+ [-i &lt;JSON PROPERTY FILE&gt; | --infile &lt;JSON PROPERTY_FILE&gt;]
+
+ DESCRIPTION
+ This command creates a Yocto BSP based on the specified
+ parameters. The new BSP will be a new Yocto BSP layer contained
+ by default within the top-level directory specified as
+ 'meta-bsp-name'. The -o option can be used to place the BSP layer
+ in a directory with a different name and location.
+
+ ...
+ </literallayout>
+ </para>
+
+ <para>
+ Now that you know where these two commands reside and how to access information
+ on them, you should find it relatively straightforward to discover the commands
+ necessary to create a BSP and perform basic kernel maintenance on that BSP using
+ the tools.
+ <note>
+ You can also use the <filename>yocto-layer</filename> tool to create
+ a "generic" layer.
+ For information on this tool, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-a-general-layer-using-the-yocto-layer-script'>Creating a General Layer Using the yocto-layer Script</ulink>"
+ section in the Yocto Project Development Guide.
+ </note>
+ </para>
+
+ <para>
+ The next sections provide a concrete starting point to expand on a few points that
+ might not be immediately obvious or that could use further explanation.
+ </para>
+ </section>
+
+
+ <section id='creating-a-new-bsp-layer-using-the-yocto-bsp-script'>
+ <title>Creating a new BSP Layer Using the yocto-bsp Script</title>
+
+ <para>
+ The <filename>yocto-bsp</filename> script creates a new
+ <link linkend='bsp-layers'>BSP layer</link> for any architecture supported
+ by the Yocto Project, as well as QEMU versions of the same.
+ The default mode of the script's operation is to prompt you for information needed
+ to generate the BSP layer.
+ </para>
+
+ <para>
+ For the current set of BSPs, the script prompts you for various important
+ parameters such as:
+ <itemizedlist>
+ <listitem><para>The kernel to use</para></listitem>
+ <listitem><para>The branch of that kernel to use (or re-use)</para></listitem>
+ <listitem><para>Whether or not to use X, and if so, which drivers to use</para></listitem>
+ <listitem><para>Whether to turn on SMP</para></listitem>
+ <listitem><para>Whether the BSP has a keyboard</para></listitem>
+ <listitem><para>Whether the BSP has a touchscreen</para></listitem>
+ <listitem><para>Remaining configurable items associated with the BSP</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ You use the <filename>yocto-bsp create</filename> sub-command to create
+ a new BSP layer.
+ This command requires you to specify a particular kernel architecture
+ (<filename>karch</filename>) on which to base the BSP.
+ Assuming you have sourced the environment, you can use the
+ <filename>yocto-bsp list karch</filename> sub-command to list the
+ architectures available for BSP creation as follows:
+ <literallayout class='monospaced'>
+ $ yocto-bsp list karch
+ Architectures available:
+ powerpc
+ x86_64
+ i386
+ arm
+ qemu
+ mips
+ mips64
+ </literallayout>
+ </para>
+
+ <para>
+ The remainder of this section presents an example that uses
+ <filename>myarm</filename> as the machine name and <filename>qemu</filename>
+ as the machine architecture.
+ Of the available architectures, <filename>qemu</filename> is the only architecture
+ that causes the script to prompt you further for an actual architecture.
+ In every other way, this architecture is representative of how creating a BSP for
+ an actual machine would work.
+ The reason the example uses this architecture is because it is an emulated architecture
+ and can easily be followed without requiring actual hardware.
+ </para>
+
+ <para>
+ As the <filename>yocto-bsp create</filename> command runs, default values for
+ the prompts appear in brackets.
+ Pressing enter without supplying anything on the command line or pressing enter
+ with an invalid response causes the script to accept the default value.
+ Once the script completes, the new <filename>meta-myarm</filename> BSP layer
+ is created in the current working directory.
+ This example assumes you have sourced the
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
+ setup script.
+ </para>
+
+ <para>
+ Following is the complete example:
+ <literallayout class='monospaced'>
+ $ yocto-bsp create myarm qemu
+ Checking basic git connectivity...
+ Done.
+
+ Which qemu architecture would you like to use? [default: i386]
+ 1) i386 (32-bit)
+ 2) x86_64 (64-bit)
+ 3) ARM (32-bit)
+ 4) PowerPC (32-bit)
+ 5) MIPS (32-bit)
+ 6) MIPS64 (64-bit)
+ 3
+ Would you like to use the default (4.1) kernel? (y/n) [default: y]
+ Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n] [default: y]
+ Getting branches from remote repo git://git.yoctoproject.org/linux-yocto-4.1.git...
+ Please choose a machine branch to base your new BSP branch on: [default: standard/base]
+ 1) standard/arm-versatile-926ejs
+ 2) standard/base
+ 3) standard/beagleboard
+ 4) standard/beaglebone
+ 5) standard/edgerouter
+ 6) standard/fsl-mpc8315e-rdb
+ 7) standard/mti-malta32
+ 8) standard/mti-malta64
+ 9) standard/qemuarm64
+ 10) standard/qemuppc
+ 1
+ Would you like SMP support? (y/n) [default: y]
+ Does your BSP have a touchscreen? (y/n) [default: n]
+ Does your BSP have a keyboard? (y/n) [default: y]
+
+ New qemu BSP created in meta-myarm
+ </literallayout>
+ Take a closer look at the example now:
+ <orderedlist>
+ <listitem><para>For the QEMU architecture,
+ the script first prompts you for which emulated architecture to use.
+ In the example, we use the ARM architecture.
+ </para></listitem>
+ <listitem><para>The script then prompts you for the kernel.
+ The default 4.4 kernel is acceptable.
+ So, the example accepts the default.
+ If you enter 'n', the script prompts you to further enter the kernel
+ you do want to use.</para></listitem>
+ <listitem><para>Next, the script asks whether you would like to have a new
+ branch created especially for your BSP in the local
+ <ulink url='&YOCTO_DOCS_DEV_URL;#local-kernel-files'>Linux Yocto Kernel</ulink>
+ Git repository .
+ If not, then the script re-uses an existing branch.</para>
+ <para>In this example, the default (or "yes") is accepted.
+ Thus, a new branch is created for the BSP rather than using a common, shared
+ branch.
+ The new branch is the branch committed to for any patches you might later add.
+ The reason a new branch is the default is that typically
+ new BSPs do require BSP-specific patches.
+ The tool thus assumes that most of time a new branch is required.
+ </para></listitem>
+ <listitem><para>Regardless of which choice you make in the previous step,
+ you are now given the opportunity to select a particular machine branch on
+ which to base your new BSP-specific machine branch
+ (or to re-use if you had elected to not create a new branch).
+ Because this example is generating an ARM-based BSP, the example
+ uses <filename>#1</filename> at the prompt, which selects the ARM-versatile branch.
+ </para></listitem>
+ <listitem><para>The remainder of the prompts are routine.
+ Defaults are accepted for each.</para></listitem>
+ <listitem><para>By default, the script creates the new BSP Layer in the
+ current working directory of the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>,
+ (i.e. <filename>poky/build</filename>).
+ </para></listitem>
+ </orderedlist>
+ </para>
+
+ <para>
+ Once the BSP Layer is created, you must add it to your
+ <filename>bblayers.conf</filename> file.
+ 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-myarm \
+ "
+ </literallayout>
+ Adding the layer to this file allows the build system to build the BSP and
+ the <filename>yocto-kernel</filename> tool to be able to find the layer and
+ other Metadata it needs on which to operate.
+ </para>
+ </section>
+
+ <section id='managing-kernel-patches-and-config-items-with-yocto-kernel'>
+ <title>Managing Kernel Patches and Config Items with yocto-kernel</title>
+
+ <para>
+ Assuming you have created a <link linkend='bsp-layers'>BSP Layer</link> using
+ <link linkend='creating-a-new-bsp-layer-using-the-yocto-bsp-script'>
+ <filename>yocto-bsp</filename></link> and you added it to your
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BBLAYERS'><filename>BBLAYERS</filename></ulink>
+ variable in the <filename>bblayers.conf</filename> file, you can now use
+ the <filename>yocto-kernel</filename> script to add patches and configuration
+ items to the BSP's kernel.
+ </para>
+
+ <para>
+ The <filename>yocto-kernel</filename> script allows you to add, remove, and list patches
+ and kernel config settings to a BSP's kernel
+ <filename>.bbappend</filename> file.
+ All you need to do is use the appropriate sub-command.
+ Recall that the easiest way to see exactly what sub-commands are available
+ is to use the <filename>yocto-kernel</filename> built-in help as follows:
+ <literallayout class='monospaced'>
+ $ yocto-kernel --help
+ Usage:
+
+ Modify and list Yocto BSP kernel config items and patches.
+
+ usage: yocto-kernel [--version] [--help] COMMAND [ARGS]
+
+ Current 'yocto-kernel' commands are:
+ config list List the modifiable set of bare kernel config options for a BSP
+ config add Add or modify bare kernel config options for a BSP
+ config rm Remove bare kernel config options from a BSP
+ patch list List the patches associated with a BSP
+ patch add Patch the Yocto kernel for a BSP
+ patch rm Remove patches from a BSP
+ feature list List the features used by a BSP
+ feature add Have a BSP use a feature
+ feature rm Have a BSP stop using a feature
+ features list List the features available to BSPs
+ feature describe Describe a particular feature
+ feature create Create a new BSP-local feature
+ feature destroy Remove a BSP-local feature
+
+ See 'yocto-kernel help COMMAND' for more information on a specific command.
+
+
+
+ Options:
+ --version show program's version number and exit
+ -h, --help show this help message and exit
+ -D, --debug output debug information
+ </literallayout>
+ </para>
+
+ <para>
+ The <filename>yocto-kernel patch add</filename> sub-command allows you to add a
+ patch to a BSP.
+ The following example adds two patches to the <filename>myarm</filename> BSP:
+ <literallayout class='monospaced'>
+ $ yocto-kernel patch add myarm ~/test.patch
+ Added patches:
+ test.patch
+
+ $ yocto-kernel patch add myarm ~/yocto-testmod.patch
+ Added patches:
+ yocto-testmod.patch
+ </literallayout>
+ <note>Although the previous example adds patches one at a time, it is possible
+ to add multiple patches at the same time.</note>
+ </para>
+
+ <para>
+ You can verify patches have been added by using the
+ <filename>yocto-kernel patch list</filename> sub-command.
+ Here is an example:
+ <literallayout class='monospaced'>
+ $ yocto-kernel patch list myarm
+ The current set of machine-specific patches for myarm is:
+ 1) test.patch
+ 2) yocto-testmod.patch
+ </literallayout>
+ </para>
+
+ <para>
+ You can also use the <filename>yocto-kernel</filename> script to
+ remove a patch using the <filename>yocto-kernel patch rm</filename> sub-command.
+ Here is an example:
+ <literallayout class='monospaced'>
+ $ yocto-kernel patch rm myarm
+ Specify the patches to remove:
+ 1) test.patch
+ 2) yocto-testmod.patch
+ 1
+ Removed patches:
+ test.patch
+ </literallayout>
+ </para>
+
+ <para>
+ Again, using the <filename>yocto-kernel patch list</filename> sub-command,
+ you can verify that the patch was in fact removed:
+ <literallayout class='monospaced'>
+ $ yocto-kernel patch list myarm
+ The current set of machine-specific patches for myarm is:
+ 1) yocto-testmod.patch
+ </literallayout>
+ </para>
+
+ <para>
+ In a completely similar way, you can use the <filename>yocto-kernel config add</filename>
+ sub-command to add one or more kernel config item settings to a BSP.
+ The following commands add a couple of config items to the
+ <filename>myarm</filename> BSP:
+ <literallayout class='monospaced'>
+ $ yocto-kernel config add myarm CONFIG_MISC_DEVICES=y
+ Added item:
+ CONFIG_MISC_DEVICES=y
+
+ $ yocto-kernel config add myarm CONFIG_YOCTO_TESTMOD=y
+ Added item:
+ CONFIG_YOCTO_TESTMOD=y
+ </literallayout>
+ <note>
+ Although the previous example adds config items one at a time, it is possible
+ to add multiple config items at the same time.
+ </note>
+ </para>
+
+ <para>
+ You can list the config items now associated with the BSP.
+ Doing so shows you the config items you added as well as others associated
+ with the BSP:
+ <literallayout class='monospaced'>
+ $ yocto-kernel config list myarm
+ The current set of machine-specific kernel config items for myarm is:
+ 1) CONFIG_MISC_DEVICES=y
+ 2) CONFIG_YOCTO_TESTMOD=y
+ </literallayout>
+ </para>
+
+ <para>
+ Finally, you can remove one or more config items using the
+ <filename>yocto-kernel config rm</filename> sub-command in a manner
+ completely analogous to <filename>yocto-kernel patch rm</filename>.
+ </para>
+ </section>
+ </section>
+</chapter>
diff --git a/import-layers/yocto-poky/documentation/bsp-guide/figures/bsp-title.png b/import-layers/yocto-poky/documentation/bsp-guide/figures/bsp-title.png
new file mode 100644
index 000000000..f624dd4f9
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/bsp-guide/figures/bsp-title.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/dev-manual/dev-manual-common-tasks.xml b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-common-tasks.xml
new file mode 100644
index 000000000..f926f1d47
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-common-tasks.xml
@@ -0,0 +1,10370 @@
+<!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
+ <link linkend='metadata'>Metadata</link> into multiple layers.
+ Layers allow you to isolate different types of customizations from
+ each other.
+ 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.
+ </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 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, which is described later
+ in this section.
+ </para>
+
+ <para>
+ </para>
+
+ <section id='yocto-project-layers'>
+ <title>Layers</title>
+
+ <para>
+ The <link linkend='source-directory'>Source Directory</link>
+ 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
+ folder names.
+ Folders that represent 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, when you set up the Source Directory structure,
+ 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 folders represents a distinct layer.
+ </para>
+
+ <para>
+ As another example, if you set up a local copy of the
+ <filename>meta-intel</filename> Git repository
+ and then explore the folder of that general layer,
+ you will discover many Intel-specific BSP layers inside.
+ For more information on BSP layers, see the
+ "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>"
+ section in the Yocto Project Board Support Package (BSP)
+ Developer's Guide.
+ </para>
+ </section>
+
+ <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 scripts that speed up creating
+ general layers and BSP layers.
+ This section describes the steps you perform by hand to create
+ a layer so that you can better understand them.
+ For information about the layer-creation scripts, see the
+ "<ulink url='&YOCTO_DOCS_BSP_URL;#creating-a-new-bsp-layer-using-the-yocto-bsp-script'>Creating a New BSP Layer Using the yocto-bsp Script</ulink>"
+ section in the Yocto Project Board Support Package (BSP)
+ Developer's Guide and the
+ "<link linkend='creating-a-general-layer-using-the-yocto-layer-script'>Creating a General Layer Using the yocto-layer Script</link>"
+ section further down in this manual.
+ </para>
+
+ <para>
+ Follow these general steps to create your layer:
+ <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/'><filename>OpenEmbedded Metadata Index</filename></ulink>
+ for a list of layers from the OpenEmbedded community
+ that can be used in the Yocto Project.
+ </para></listitem>
+ <listitem><para><emphasis>Create a Directory:</emphasis>
+ Create the directory for your layer.
+ While not strictly required, prepend the name of the
+ folder with the string <filename>meta-</filename>.
+ For example:
+ <literallayout class='monospaced'>
+ meta-mylayer
+ meta-GUI_xyz
+ meta-mymachine
+ </literallayout>
+ </para></listitem>
+ <listitem><para><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
+ demonstrates the required syntax:
+ <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 = "3"
+ </literallayout></para>
+ <para>Here is an explanation of the example:
+ <itemizedlist>
+ <listitem><para>The configuration and
+ classes directory is appended to
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BBPATH'><filename>BBPATH</filename></ulink>.
+ <note>
+ All non-distro layers, which include all BSP
+ layers, are expected to append the layer
+ directory to the
+ <filename>BBPATH</filename>.
+ On the other hand, distro layers, such as
+ <filename>meta-poky</filename>, can choose
+ to enforce their own precedence over
+ <filename>BBPATH</filename>.
+ For an example of that syntax, see the
+ <filename>layer.conf</filename> file for
+ the <filename>meta-poky</filename> layer.
+ </note></para></listitem>
+ <listitem><para>The recipes for the layers are
+ appended to
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-BBFILES'>BBFILES</ulink></filename>.
+ </para></listitem>
+ <listitem><para>The
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-BBFILE_COLLECTIONS'>BBFILE_COLLECTIONS</ulink></filename>
+ variable is then appended with the layer name.
+ </para></listitem>
+ <listitem><para>The
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-BBFILE_PATTERN'>BBFILE_PATTERN</ulink></filename>
+ variable is set to a regular expression and is
+ used to match files from
+ <filename>BBFILES</filename> into a particular
+ layer.
+ In this case,
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-LAYERDIR'>LAYERDIR</ulink></filename>
+ is used to make <filename>BBFILE_PATTERN</filename> match within the
+ layer's path.</para></listitem>
+ <listitem><para>The
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-BBFILE_PRIORITY'>BBFILE_PRIORITY</ulink></filename>
+ variable then assigns a priority to the layer.
+ Applying priorities is useful in situations
+ where the same recipe might appear in multiple
+ layers and allows you to choose the layer
+ that takes precedence.</para></listitem>
+ <listitem><para>The
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-LAYERVERSION'>LAYERVERSION</ulink></filename>
+ variable optionally specifies the version of a
+ layer as a single number.</para></listitem>
+ </itemizedlist></para>
+ <para>Note the use of the
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-LAYERDIR'>LAYERDIR</ulink></filename>
+ variable, which expands to the directory of the current
+ layer.</para>
+ <para>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><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>In order to be compliant with the Yocto Project,
+ a layer must contain a
+ <ulink url='&YOCTO_DOCS_BSP_URL;#bsp-filelayout-readme'>README file.</ulink>
+ </note></para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='best-practices-to-follow-when-creating-layers'>
+ <title>Best Practices to Follow 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 sections.
+ </para>
+
+ <section id='avoid-overlaying-entire-recipes'>
+ <title>Avoid "Overlaying" Entire Recipes</title>
+
+ <para>
+ Avoid "overlaying" entire recipes from other layers in your
+ configuration.
+ 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>
+ </section>
+
+ <section id='avoid-duplicating-include-files'>
+ <title>Avoid Duplicating Include Files</title>
+
+ <para>
+ Avoid duplicating include files.
+ 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>
+ </section>
+
+ <section id='structure-your-layers'>
+ <title>Structure Your Layers</title>
+
+ <para>
+ 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>Modifying 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>
+ </section>
+
+ <section id='other-recommendations'>
+ <title>Other Recommendations</title>
+
+ <para>
+ We also recommend the following:
+ <itemizedlist>
+ <listitem><para>Store custom layers in a Git repository
+ that uses the
+ <filename>meta-<replaceable>layer_name</replaceable></filename> format.
+ </para></listitem>
+ <listitem><para>Clone the repository alongside other
+ <filename>meta</filename> directories in the
+ <link linkend='source-directory'>Source Directory</link>.
+ </para></listitem>
+ </itemizedlist>
+ Following these recommendations keeps your Source Directory and
+ its configuration entirely inside the Yocto Project's core
+ base.
+ </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
+ <link linkend='build-directory'>Build Directory</link>.
+ The following example shows how to enable a layer named
+ <filename>meta-mylayer</filename>:
+ <literallayout class='monospaced'>
+ LCONF_VERSION = "6"
+
+ BBPATH = "${TOPDIR}"
+ BBFILES ?= ""
+
+ BBLAYERS ?= " \
+ $HOME/poky/meta \
+ $HOME/poky/meta-poky \
+ $HOME/poky/meta-yocto-bsp \
+ $HOME/poky/meta-mylayer \
+ "
+ </literallayout>
+ </para>
+
+ <para>
+ BitBake parses each <filename>conf/layer.conf</filename> file
+ 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</title>
+
+ <para>
+ Recipes used to append Metadata to other recipes are called
+ BitBake append files.
+ BitBake append files use the <filename>.bbappend</filename> file
+ type suffix, while the corresponding recipes to which Metadata
+ is being appended use the <filename>.bb</filename> file type
+ suffix.
+ </para>
+
+ <para>
+ A <filename>.bbappend</filename> file allows your layer to make
+ additions or changes to the content of another layer's recipe
+ without having to copy the other 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>
+ Append files must have the same root names as their corresponding
+ recipes.
+ 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, the corresponding <filename>.bbappend</filename> file must
+ be renamed (and possibly updated) 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>
+ Being able to append information to an existing recipe not only
+ avoids duplication, but also automatically applies recipe
+ changes in a different layer to your layer.
+ If you were copying recipes, you would have to manually merge
+ changes as they occur.
+ </para>
+
+ <para>
+ As an example, consider the main formfactor recipe and a
+ corresponding formfactor append file both from the
+ <link linkend='source-directory'>Source Directory</link>.
+ 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}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+ 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 <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/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.
+ For example:
+ <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 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>
+ Use the following form when running the layer management tool.
+ <literallayout class='monospaced'>
+ $ bitbake-layers <replaceable>command</replaceable> [<replaceable>arguments</replaceable>]
+ </literallayout>
+ The following list describes the available commands:
+ <itemizedlist>
+ <listitem><para><filename><emphasis>help:</emphasis></filename>
+ Displays general help or help on a specified command.
+ </para></listitem>
+ <listitem><para><filename><emphasis>show-layers:</emphasis></filename>
+ Shows the current configured layers.
+ </para></listitem>
+ <listitem><para><filename><emphasis>show-recipes:</emphasis></filename>
+ Lists available recipes and the layers that provide them.
+ </para></listitem>
+ <listitem><para><filename><emphasis>show-overlayed:</emphasis></filename>
+ 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><filename><emphasis>show-appends:</emphasis></filename>
+ Lists <filename>.bbappend</filename> files and the
+ recipe files to which they apply.
+ </para></listitem>
+ <listitem><para><filename><emphasis>show-cross-depends:</emphasis></filename>
+ Lists dependency relationships between recipes that
+ cross layer boundaries.
+ </para></listitem>
+ <listitem><para><filename><emphasis>add-layer:</emphasis></filename>
+ Adds a layer to <filename>bblayers.conf</filename>.
+ </para></listitem>
+ <listitem><para><filename><emphasis>remove-layer:</emphasis></filename>
+ Removes a layer from <filename>bblayers.conf</filename>
+ </para></listitem>
+ <listitem><para><filename><emphasis>flatten:</emphasis></filename>
+ 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>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='creating-a-general-layer-using-the-yocto-layer-script'>
+ <title>Creating a General Layer Using the yocto-layer Script</title>
+
+ <para>
+ The <filename>yocto-layer</filename> script simplifies
+ creating a new general layer.
+ <note>
+ 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.
+ </note>
+ The default mode of the script's operation is to prompt you for
+ information needed to generate the layer:
+ <itemizedlist>
+ <listitem><para>The layer priority.
+ </para></listitem>
+ <listitem><para>Whether or not to create a sample recipe.
+ </para></listitem>
+ <listitem><para>Whether or not to create a sample
+ append file.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Use the <filename>yocto-layer create</filename> sub-command
+ to create a new general layer.
+ In its simplest form, you can create a layer as follows:
+ <literallayout class='monospaced'>
+ $ yocto-layer create mylayer
+ </literallayout>
+ The previous example creates a layer named
+ <filename>meta-mylayer</filename> in the current directory.
+ </para>
+
+ <para>
+ As the <filename>yocto-layer create</filename> command runs,
+ default values for the prompts appear in brackets.
+ Pressing enter without supplying anything for the prompts
+ or pressing enter and providing an invalid response causes the
+ script to accept the default value.
+ Once the script completes, the new layer
+ is created in the current working directory.
+ The script names the layer by prepending
+ <filename>meta-</filename> to the name you provide.
+ </para>
+
+ <para>
+ Minimally, the script creates the following within the layer:
+ <itemizedlist>
+ <listitem><para><emphasis>The <filename>conf</filename>
+ directory:</emphasis>
+ This directory contains the layer's configuration file.
+ The root name for the file is the same as the root name
+ your provided for the layer (e.g.
+ <filename><replaceable>layer</replaceable>.conf</filename>).
+ </para></listitem>
+ <listitem><para><emphasis>The
+ <filename>COPYING.MIT</filename> file:</emphasis>
+ The copyright and use notice for the software.
+ </para></listitem>
+ <listitem><para><emphasis>The <filename>README</filename>
+ file:</emphasis>
+ A file describing the contents of your new layer.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ If you choose to generate a sample recipe file, the script
+ prompts you for the name for the recipe and then creates it
+ in <filename><replaceable>layer</replaceable>/recipes-example/example/</filename>.
+ The script creates a <filename>.bb</filename> file and a
+ directory, which contains a sample
+ <filename>helloworld.c</filename> source file, along with
+ a sample patch file.
+ If you do not provide a recipe name, the script uses
+ "example".
+ </para>
+
+ <para>
+ If you choose to generate a sample append file, the script
+ prompts you for the name for the file and then creates it
+ in <filename><replaceable>layer</replaceable>/recipes-example-bbappend/example-bbappend/</filename>.
+ The script creates a <filename>.bbappend</filename> file and a
+ directory, which contains a sample patch file.
+ If you do not provide a recipe name, the script uses
+ "example".
+ The script also prompts you for the version of the append file.
+ The version should match the recipe to which the append file
+ is associated.
+ </para>
+
+ <para>
+ The easiest way to see how the <filename>yocto-layer</filename>
+ script works is to experiment with the script.
+ You can also read the usage information by entering the
+ following:
+ <literallayout class='monospaced'>
+ $ yocto-layer help
+ </literallayout>
+ </para>
+
+ <para>
+ Once you create your general layer, you must add it to your
+ <filename>bblayers.conf</filename> file.
+ Here is an example where a layer named
+ <filename>meta-mylayer</filename> is added:
+ <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>
+ Adding the layer to this file enables the build system to
+ locate the layer during the build.
+ </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
+ <link linkend='build-directory'>Build Directory</link>.
+ </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
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></ulink>
+ 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, two choices exist that can help you quickly get a
+ start on a new recipe:
+ <itemizedlist>
+ <listitem><para><emphasis><filename>recipetool</filename>:</emphasis>
+ A tool 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>
+ </para>
+
+ <section id='new-recipe-creating-the-base-recipe-using-recipetool'>
+ <title>Creating the Base Recipe Using <filename>recipetool</filename></title>
+
+ <para>
+ <filename>recipetool</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
+ <link linkend='build-directory'>Build Directory</link>
+ 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>
+ or
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>).
+ Here is the basic <filename>recipetool</filename> syntax:
+ <note>
+ Running <filename>recipetool -h</filename> or
+ <filename>recipetool create -h</filename> produces the
+ Python-generated help, which presented differently
+ than what follows here.
+ </note>
+ <literallayout class='monospaced'>
+ recipetool -h
+ recipetool create [-h]
+ recipetool [-d] [-q] [--color auto | always | never ] create -o <replaceable>OUTFILE</replaceable> [-m] [-x <replaceable>EXTERNALSRC</replaceable>] <replaceable>source</replaceable>
+
+ -d Enables debug output.
+ -q Outputs only errors (quiet mode).
+ --color Colorizes the output automatically, always, or never.
+ -h Displays Python generated syntax for recipetool.
+ create Causes recipetool to create a base recipe. The create
+ command is further defined with these options:
+
+ -o <replaceable>OUTFILE</replaceable> Specifies the full path and filename for the generated
+ recipe.
+ -m Causes the recipe to be machine-specific rather than
+ architecture-specific (default).
+ -x <replaceable>EXTERNALSRC</replaceable> Fetches and extracts source files from <replaceable>source</replaceable>
+ and places them in <replaceable>EXTERNALSRC</replaceable>.
+ <replaceable>source</replaceable> must be a URL.
+ -h Displays Python-generated syntax for create.
+ <replaceable>source</replaceable> Specifies the source code on which to base the
+ recipe.
+ </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
+ run in "quiet mode" and to generate debugging information.
+ Once generated, the recipe resides in the existing source
+ code layer:
+ <literallayout class='monospaced'>
+ recipetool create -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 metadata 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='understanding-recipe-syntax'>
+ <title>Understanding 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: <filename>\</filename></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: <filename>${...}</filename></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>
+ </para></listitem>
+ <listitem><para><emphasis>Quote All Assignments: <filename>"<replaceable>value</replaceable>"</filename></emphasis> -
+ Use double quotes around the value in all variable
+ assignments.
+ <literallayout class='monospaced'>
+ VAR1 = "${OTHERVAR}"
+ VAR2 = "The version is ${PV}"
+ </literallayout>
+ </para></listitem>
+ <listitem><para><emphasis>Conditional Assignment: <filename>?=</filename></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: <filename>+=</filename></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: <filename>=+</filename></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: <filename>_append</filename></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: <filename>_prepend</filename></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: <filename>${@<replaceable>python_code</replaceable>}</filename></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 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 a 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>)
+ and you are in the
+ <link linkend='build-directory'>Build Directory</link>,
+ 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 per-recipe temporary work directory is constructed as follows and
+ depends on several factors:
+ <literallayout class='monospaced'>
+ BASE_WORKDIR ?= "${TMPDIR}/work"
+ WORKDIR = "${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}"
+ </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 the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#closer-look'>A Closer Look at the Yocto Project Development Environment</ulink>"
+ chapter of the Yocto Project Reference Manual.
+ </para>
+
+ <para>
+ You can also reference the following variables in the
+ Yocto Project Reference Manual's glossary for more information:
+ <itemizedlist>
+ <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink>:
+ The top-level build output directory</listitem>
+ <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-MULTIMACH_TARGET_SYS'><filename>MULTIMACH_TARGET_SYS</filename></ulink>:
+ The target system identifier</listitem>
+ <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink>:
+ The recipe name</listitem>
+ <listitem><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)</listitem>
+ <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>:
+ The recipe version</listitem>
+ <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>:
+ The recipe revision</listitem>
+ </itemizedlist>
+ </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_REF_URL;#sources-dev-environment'>Sources</ulink>"
+ section in the Yocto Project Reference 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
+ "<ulink url='&YOCTO_DOCS_REF_URL;#usingpoky-configuring-LIC_FILES_CHKSUM'>Tracking License Changes</ulink>"
+ section in the Yocto Project Reference Manual.</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-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 7.1, 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>
+ 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-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
+ <link linkend='source-directory'>Source Directory</link>.
+ 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='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_PACKAGENAME()</filename> function to
+ the recipe file (<filename>.bb</filename>) and replace
+ <filename>PACKAGENAME</filename> 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 <filename>PACKAGENAME</filename>.
+ </para>
+
+ <para>
+ A post-installation function has the following structure:
+ <literallayout class='monospaced'>
+ pkg_postinst_PACKAGENAME() {
+ # 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.
+ </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_PACKAGENAME() {
+ 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>
+
+ <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
+ "<ulink url='&YOCTO_DOCS_REF_URL;#usingpoky-configuring-LIC_FILES_CHKSUM'>Tracking License Changes</ulink>" section.
+ 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
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_OEMAKE'>EXTRA_OEMAKE</ulink></filename>
+ variable.
+ 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.
+ </para>
+
+ <para>
+ If you can't 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
+ <filename>do_configure</filename> and
+ <filename>do_compile</filename> tasks do nothing:
+ <literallayout class='monospaced'>
+ do_configure[noexec] = "1"
+ do_compile[noexec] = "1"
+ </literallayout>
+ Alternatively, you can make these tasks an empty
+ function.
+ </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
+ <filename>FILES</filename> (usually
+ <filename>FILES_${PN}</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>
+
+ <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-yocto-bsp-script'>Creating a New BSP Layer Using the yocto-bsp 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="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
+ <link linkend='source-directory'>Source Directory</link>:
+ <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
+ <link linkend='source-directory'>Source Directory</link> 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
+ <link linkend='build-directory'>Build Directory</link>.
+ 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
+ <link linkend='build-directory'>Build Directory</link>.
+ 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='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
+ <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='creating-partitioned-images'>
+ <title>Creating Partitioned Images</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,
+ <filename>wic</filename>, 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 <filename>.wks</filename> 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 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.
+ </para>
+
+ <para>
+ The <filename>wic</filename> command and the infrastructure
+ it is 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 through a
+ plugin interface.
+ See the
+ "<link linkend='openembedded-kickstart-plugins'>Plugins</link>"
+ section for information on these plugins.
+ </para>
+
+ <para>
+ This section provides some background information on
+ <filename>wic</filename>, describes what you need to have in
+ place to run the tool, provides instruction on how to use
+ <filename>wic</filename>, and provides several examples.
+ </para>
+
+ <section id='wic-background'>
+ <title>Background</title>
+
+ <para>
+ This section provides some background on the
+ <filename>wic</filename> utility.
+ While none of this information is required to use
+ <filename>wic</filename>, 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
+ pronounce.</para></listitem>
+ <listitem><para>
+ <filename>wic</filename> is loosely based on the
+ Meego Image Creator (<filename>mic</filename>)
+ framework.
+ The <filename>wic</filename> 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>
+ <filename>wic</filename> is 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'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
+ <filename>wic</filename> and those examples is
+ that with <filename>wic</filename> 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 <filename>wic</filename> 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 this
+ list of distributions.</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 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
+ <filename>wic</filename>, the current version of
+ <filename>wic</filename> requires the artifacts
+ in the form generated by the build system.
+ </para></listitem>
+ <listitem><para>
+ You must build several native tools, which are tools
+ built to run on the build system:
+ <literallayout class='monospaced'>
+ $ bitbake parted-native dosfstools-native mtools-native
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ You must have sourced one of the build environment
+ setup scripts (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>)
+ found in the
+ <link linkend='build-directory'>Build Directory</link>.
+ </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>
+ 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
+ </literallayout>
+ </para>
+
+ <para>
+ Currently, <filename>wic</filename> supports two commands:
+ <filename>create</filename> and <filename>list</filename>.
+ You can get help for these commands as follows:
+ <literallayout class='monospaced'>
+ $ wic help <replaceable>command</replaceable>
+ </literallayout>
+ </para>
+
+ <para>
+ You can also get detailed help on a number of topics
+ from the help system.
+ The output of <filename>wic --help</filename>
+ displays a list of available help
+ topics under a "Help topics" heading.
+ You can have the help system display the help text for
+ a given topic by prefacing the topic with
+ <filename>wic help</filename>:
+ <literallayout class='monospaced'>
+ $ wic help <replaceable>help_topic</replaceable>
+ </literallayout>
+ </para>
+
+ <para>
+ You can find out more about the images
+ <filename>wic</filename> creates using the existing
+ kickstart files with the following form of the command:
+ <literallayout class='monospaced'>
+ $ wic list <replaceable>image</replaceable> help
+ </literallayout>
+ where <filename><replaceable>image</replaceable></filename> is either
+ <filename>directdisk</filename> or
+ <filename>mkefidisk</filename>.
+ </para>
+ </section>
+
+ <section id='operational-modes'>
+ <title>Operational Modes</title>
+
+ <para>
+ You can use <filename>wic</filename> 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
+ 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.</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Regardless of the mode you use, you need to have the build
+ artifacts ready and available.
+ Additionally, the environment must be set up using the
+ <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>
+ script found in the
+ <link linkend='build-directory'>Build Directory</link>.
+ </para>
+
+ <section id='raw-mode'>
+ <title>Raw Mode</title>
+
+ <para>
+ The general form of the 'wic' command in raw mode is:
+ <literallayout class='monospaced'>
+ $ wic create <replaceable>image_name</replaceable>.wks [<replaceable>options</replaceable>] [...]
+
+ Where:
+
+ <replaceable>image_name</replaceable>.wks
+ 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.
+
+ -o <replaceable>OUTDIR</replaceable>, --outdir=<replaceable>OUTDIR</replaceable>
+ The name of a directory in which to create image.
+
+ -i <replaceable>PROPERTIES_FILE</replaceable>, --infile=<replaceable>PROPERTIES_FILE</replaceable>
+ The name of a file containing the values for image
+ properties as a JSON file.
+
+ -e <replaceable>IMAGE_NAME</replaceable>, --image-name=<replaceable>IMAGE_NAME</replaceable>
+ The name of the image from which to use the artifacts
+ (e.g. <filename>core-image-sato</filename>).
+
+ -r <replaceable>ROOTFS_DIR</replaceable>, --rootfs-dir=<replaceable>ROOTFS_DIR</replaceable>
+ The path to the <filename>/rootfs</filename> directory to use as the
+ <filename>.wks</filename> rootfs source.
+
+ -b <replaceable>BOOTIMG_DIR</replaceable>, --bootimg-dir=<replaceable>BOOTIMG_DIR</replaceable>
+ The path to the directory containing the boot artifacts
+ (e.g. <filename>/EFI</filename> or <filename>/syslinux</filename>) to use as the <filename>.wks</filename> bootimg
+ source.
+
+ -k <replaceable>KERNEL_DIR</replaceable>, --kernel-dir=<replaceable>KERNEL_DIR</replaceable>
+ The path to the directory containing the kernel to use
+ in the <filename>.wks</filename> boot image.
+
+ -n <replaceable>NATIVE_SYSROOT</replaceable>, --native-sysroot=<replaceable>NATIVE_SYSROOT</replaceable>
+ The path to the native sysroot containing the tools to use
+ to build the image.
+
+ -s, --skip-build-check
+ Skips the build check.
+
+ -D, --debug
+ Output debug information.
+ </literallayout>
+ <note>
+ You do not need root privileges to run
+ <filename>wic</filename>.
+ In fact, you should not run as root when using the
+ utility.
+ </note>
+ </para>
+ </section>
+
+ <section id='cooked-mode'>
+ <title>Cooked Mode</title>
+
+ <para>
+ The general form of the <filename>wic</filename> command
+ using Cooked Mode is:
+ <literallayout class='monospaced'>
+ $ wic create <replaceable>kickstart_file</replaceable> -e <replaceable>image_name</replaceable>
+
+ Where:
+
+ <replaceable>kickstart_file</replaceable>
+ An OpenEmbedded kickstart file. You can provide your own
+ custom file or supplied file.
+
+ <replaceable>image_name</replaceable>
+ Specifies the image built using the OpenEmbedded build
+ system.
+ </literallayout>
+ This form is the simplest and most user-friendly, as it
+ does not require specifying all individual parameters.
+ All you need to provide is your own
+ <filename>.wks</filename> file or one provided with the
+ release.
+ </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
+ <filename>.wks</filename> file, you can use an existing
+ file provided by the <filename>wic</filename> installation.
+ Use the following command to list the available files:
+ <literallayout class='monospaced'>
+ $ wic list images
+ directdisk Create a 'pcbios' direct disk image
+ mkefidisk Create an EFI disk image
+ </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>mkefidisk.wks</filename> file to generate
+ an image:
+ <literallayout class='monospaced'>
+ # 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 --label msdos --active --align 1024
+
+ part / --source rootfs --ondisk sda --fstype=ext3 --label platform --align 1024
+
+ part swap --ondisk sda --size 44 --label swap1 --fstype=swap
+
+ bootloader --timeout=10 --append="rootwait rootfstype=ext3 console=ttyPCH0,115200 console=tty0 vmalloc=256MB snd-hda-intel.enable_msi=0"
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='wic-usage-examples'>
+ <title>Examples</title>
+
+ <para>
+ This section provides several examples that show how to use
+ the <filename>wic</filename> 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
+ Checking basic build environment...
+ Done.
+
+ Creating image(s)...
+
+ Info: The new image(s) can be found here:
+ /var/tmp/wic/build/mkefidisk-201310230946-sda.direct
+
+ The following build artifacts were used to create the image(s):
+ ROOTFS_DIR: /home/trz/yocto/yocto-image/build/tmp/work/minnow-poky-linux/core-image-minimal/1.0-r0/rootfs
+ BOOTIMG_DIR: /home/trz/yocto/yocto-image/build/tmp/work/minnow-poky-linux/core-image-minimal/1.0-r0/core-image-minimal-1.0/hddimg
+ KERNEL_DIR: /home/trz/yocto/yocto-image/build/tmp/sysroots/minnow/usr/src/kernel
+ NATIVE_SYSROOT: /home/trz/yocto/yocto-image/build/tmp/sysroots/x86_64-linux
+
+
+ The image(s) were created using OE kickstart file:
+ /home/trz/yocto/yocto-image/scripts/lib/image/canned-wks/mkefidisk.wks
+ </literallayout>
+ This example shows the easiest way to create an image
+ by running in Cooked Mode and using the
+ <filename>-e</filename> option with an existing kickstart
+ file.
+ All that is necessary is to specify the image used to
+ generate the artifacts.
+ Your <filename>local.conf</filename> 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
+ "minnow" in this example.
+ </para>
+
+ <para>
+ The output specifies the exact image created as well as
+ where it was created.
+ The output also names the artifacts used and the exact
+ <filename>.wks</filename> script that was used to generate
+ the image.
+ <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 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=/var/tmp/wic/build/mkefidisk-201310230946-sda.direct of=/dev/sdb
+ [sudo] password for trz:
+ 182274+0 records in
+ 182274+0 records out
+ 93324288 bytes (93 MB) copied, 14.4777 s, 6.4 MB/s
+ [trz@empanada ~]$ sudo eject /dev/sdb
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='using-a-modified-kickstart-file'>
+ <title>Using a Modified Kickstart File</title>
+
+ <para>
+ Because <filename>wic</filename> 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</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 these files reside is
+ <filename>scripts/lib/image/canned-wks/</filename>
+ located in the
+ <link linkend='source-directory'>Source Directory</link>.
+ Because the 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</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</filename> kickstart file uses.
+ </para>
+
+ <para>
+ The example begins by making a copy of the
+ <filename>directdisk.wks</filename> file in the
+ <filename>scripts/lib/image/canned-wks</filename>
+ directory and then changing the lines that specify the
+ target disk from which to boot.
+ <literallayout class='monospaced'>
+ $ cp /home/trz/yocto/yocto-image/scripts/lib/image/canned-wks/directdisk.wks \
+ /home/trz/yocto/yocto-image/scripts/lib/image/canned-wks/directdisksdb.wks
+ </literallayout>
+ Next, the example modifies the
+ <filename>directdisksdb.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=ext3 --label platform --align 1024
+ </literallayout>
+ Once the lines are changed, the example generates the
+ <filename>directdisksdb</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 -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/directdisksdb-201310231131-sdb.direct
+
+ The following build artifacts were used to create the image(s):
+ ROOTFS_DIR: /home/trz/yocto/yocto-image/build/tmp/work/nuc-poky-linux/core-image-minimal/1.0-r0/rootfs
+ BOOTIMG_DIR: /home/trz/yocto/yocto-image/build/tmp/sysroots/nuc/usr/share
+ KERNEL_DIR: /home/trz/yocto/yocto-image/build/tmp/sysroots/nuc/usr/src/kernel
+ NATIVE_SYSROOT: /home/trz/yocto/yocto-image/build/tmp/sysroots/x86_64-linux
+
+
+ The image(s) were created using OE kickstart file:
+ /home/trz/yocto/yocto-image/scripts/lib/image/canned-wks/directdisksdb.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=/var/tmp/wic/build/directdisksdb-201310231131-sdb.direct of=/dev/sdb
+ 86018+0 records in
+ 86018+0 records out
+ 44041216 bytes (44 MB) copied, 13.0734 s, 3.4 MB/s
+ [trz@empanada tmp]$ sudo eject /dev/sdb
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='creating-an-image-based-on-core-image-minimal-and-crownbay-noemgd'>
+ <title>Creating an Image Based on <filename>core-image-minimal</filename> and <filename>crownbay-noemgd</filename></title>
+
+ <para>
+ This example creates an image based on
+ <filename>core-image-minimal</filename> and a
+ <filename>crownbay-noemgd</filename>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
+ that works right out of the box.
+ <literallayout class='monospaced'>
+ $ 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: /home/trz/yocto/yocto-image/build/tmp/work/crownbay_noemgd-poky-linux/core-image-minimal/1.0-r0/rootfs
+ BOOTIMG_DIR: /home/trz/yocto/yocto-image/build/tmp/sysroots/crownbay-noemgd/usr/share
+ KERNEL_DIR: /home/trz/yocto/yocto-image/build/tmp/sysroots/crownbay-noemgd/usr/src/kernel
+ NATIVE_SYSROOT: /home/trz/yocto/yocto-image/build/tmp/sysroots/crownbay-noemgd/usr/src/kernel
+
+ The image(s) were created using OE kickstart file:
+ /home/trz/yocto/yocto-image/scripts/lib/image/canned-wks/directdisk.wks
+ </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 <filename>wic</filename> to create the output
+ somewhere other than the default
+ <filename>/var/tmp/wic</filename> directory:
+ <literallayout class='monospaced'>
+ $ wic create ~/test.wks -o /home/trz/testwic --rootfs-dir \
+ /home/trz/yocto/yocto-image/build/tmp/work/crownbay_noemgd-poky-linux/core-image-minimal/1.0-r0/rootfs \
+ --bootimg-dir /home/trz/yocto/yocto-image/build/tmp/sysroots/crownbay-noemgd/usr/share \
+ --kernel-dir /home/trz/yocto/yocto-image/build/tmp/sysroots/crownbay-noemgd/usr/src/kernel \
+ --native-sysroot /home/trz/yocto/yocto-image/build/tmp/sysroots/x86_64-linux
+
+ Creating image(s)...
+
+ Info: The new image(s) can be found here:
+ /home/trz/testwic/build/test-201309260032-sda.direct
+
+ The following build artifacts were used to create the image(s):
+
+ ROOTFS_DIR: /home/trz/yocto/yocto-image/build/tmp/work/crownbay_noemgd-poky-linux/core-image-minimal/1.0-r0/rootfs
+ BOOTIMG_DIR: /home/trz/yocto/yocto-image/build/tmp/sysroots/crownbay-noemgd/usr/share
+ KERNEL_DIR: /home/trz/yocto/yocto-image/build/tmp/sysroots/crownbay-noemgd/usr/src/kernel
+ NATIVE_SYSROOT: /home/trz/yocto/yocto-image/build/tmp/sysroots/crownbay-noemgd/usr/src/kernel
+
+ The image(s) were created using OE kickstart file:
+ /home/trz/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>
+
+ <section id='openembedded-kickstart-plugins'>
+ <title>Plugins</title>
+
+ <para>
+ Plugins allow <filename>wic</filename> functionality to
+ be extended and specialized by users.
+ This section documents the plugin interface, which is
+ currently restricted to source plugins.
+ </para>
+
+ <para>
+ Source plugins provide a mechanism to customize
+ various aspects of the image generation process in
+ <filename>wic</filename>, mainly the contents of
+ partitions.
+ The plugins provide a mechanism for mapping values
+ specified in <filename>.wks</filename> files using the
+ <filename>--source</filename> keyword to a
+ particular plugin implementation that populates a
+ corresponding partition.
+ </para>
+
+ <para>
+ A source plugin is created as a subclass of
+ <filename>SourcePlugin</filename>.
+ The plugin file containing it is added to
+ <filename>scripts/lib/wic/plugins/source/</filename> to
+ make the plugin implementation available to the
+ <filename>wic</filename> implementation.
+ For more information, see
+ <filename>scripts/lib/wic/pluginbase.py</filename>.
+ </para>
+
+ <para>
+ Source plugins can also be implemented and added by
+ external layers.
+ As such, any plugins found in a
+ <filename>scripts/lib/wic/plugins/source/</filename>
+ directory in an external layer are also made
+ available.
+ </para>
+
+ <para>
+ When the <filename>wic</filename> implementation needs
+ to invoke a partition-specific implementation, it looks
+ for the plugin that has the same name as the
+ <filename>--source</filename> parameter given to
+ that partition.
+ For example, if the partition is set up as follows:
+ <literallayout class='monospaced'>
+ part /boot --source bootimg-pcbios ...
+ </literallayout>
+ The methods defined as class members of the plugin
+ having the matching <filename>bootimg-pcbios.name</filename>
+ class member are used.
+ </para>
+
+ <para>
+ To be more concrete, here is the plugin definition that
+ matches a
+ <filename>--source bootimg-pcbios</filename> usage,
+ along with an example
+ method called by the <filename>wic</filename> implementation
+ when it needs to invoke an implementation-specific
+ partition-preparation function:
+ <literallayout class='monospaced'>
+ class BootimgPcbiosPlugin(SourcePlugin):
+ name = 'bootimg-pcbios'
+
+ @classmethod
+ def do_prepare_partition(self, part, ...)
+ </literallayout>
+ If the subclass itself does not implement a function, a
+ default version in a superclass is located and
+ used, which is why all plugins must be derived from
+ <filename>SourcePlugin</filename>.
+ </para>
+
+ <para>
+ The <filename>SourcePlugin</filename> class defines the
+ following methods, which is the current set of methods
+ that can be implemented or overridden by
+ <filename>--source</filename> plugins.
+ Any methods not implemented by a
+ <filename>SourcePlugin</filename> subclass inherit the
+ implementations present in the
+ <filename>SourcePlugin</filename> class.
+ For more information, see the
+ <filename>SourcePlugin</filename> source for details:
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem><para><emphasis><filename>do_prepare_partition()</filename>:</emphasis>
+ Called to do the actual content population for a
+ partition.
+ 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>.
+ This method is typically used 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.
+ </note>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ This scheme is extensible.
+ Adding more hooks is a simple matter of adding more
+ plugin methods to <filename>SourcePlugin</filename> and
+ derived classes.
+ The code that then needs to call the plugin methods uses
+ <filename>plugin.get_source_plugin_methods()</filename>
+ to find the method or methods needed by the call.
+ Retrieval of those methods is accomplished
+ by filling up a dict with keys
+ containing the method names of interest.
+ On success, these will be filled in with the actual
+ methods.
+ Please see the <filename>wic</filename>
+ implementation for examples and details.
+ </para>
+ </section>
+
+ <section id='openembedded-kickstart-wks-reference'>
+ <title>OpenEmbedded Kickstart (.wks) Reference</title>
+
+ <para>
+ The current <filename>wic</filename> 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>
+ The following is a list of the commands, their syntax,
+ and meanings.
+ The commands are based on the Fedora
+ kickstart versions but with modifications to
+ reflect <filename>wic</filename> capabilities.
+ You can see the original documentation for those commands
+ at the following links:
+ <itemizedlist>
+ <listitem><para>
+ <ulink url='http://fedoraproject.org/wiki/Anaconda/Kickstart#part_or_partition'>http://fedoraproject.org/wiki/Anaconda/Kickstart#part_or_partition</ulink>
+ </para></listitem>
+ <listitem><para>
+ <ulink url='http://fedoraproject.org/wiki/Anaconda/Kickstart#bootloader'>http://fedoraproject.org/wiki/Anaconda/Kickstart#bootloader</ulink>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <section id='command-part-or-partition'>
+ <title>Command: part or partition</title>
+
+ <para>
+ Either of these commands create 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 will be mounted and must be of one of the
+ following forms:
+ <itemizedlist>
+ <listitem><para><filename>/<replaceable>path</replaceable></filename>:
+ For example, <filename>/</filename>,
+ <filename>/usr</filename>, or
+ <filename>/home</filename></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.
+ Here is an example using "/" as the mountpoint.
+ The command uses "--ondisk" 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>--source</filename>:</emphasis>
+ This option is a
+ <filename>wic</filename>-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 plugin.
+ For information on the source plugins, see the
+ "<link linkend='openembedded-kickstart-plugins'>Plugins</link>"
+ section.</para>
+ <para>If you use
+ <filename>--source rootfs</filename>,
+ <filename>wic</filename> creates a partition as
+ large as needed and to fill 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>,
+ <filename>wic</filename> creates a partition as
+ large as needed and fills it with the contents of
+ the partition that is generated by the
+ specified plugin 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 and filesystem type end
+ up being are dependent on the given plugin
+ 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 will be 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 <filename>wic</filename>-specific
+ option that says to start a partition on an
+ x KBytes boundary.</para></listitem>
+ <listitem><para><emphasis><filename>--no-table</filename>:</emphasis>
+ This option is a <filename>wic</filename>-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>--extra-space</filename>:</emphasis>
+ This option is a <filename>wic</filename>-specific
+ option that adds extra space after the space
+ filled by the content of the partition.
+ The final size can go beyond 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 <filename>wic</filename>-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-type</filename>:</emphasis>
+ This option is a <filename>wic</filename>-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 <filename>wic</filename>-specific
+ option that causes <filename>wic</filename> 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 <filename>wic</filename>-specific
+ option that specifies the partition UUID.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='command-bootloader'>
+ <title>Command: bootloader</title>
+
+ <para>
+ This command specifies how the boot loader should be
+ configured and supports the following options:
+ <note>
+ Bootloader functionality and boot partitions are
+ implemented by the various
+ <filename>--source</filename>
+ plugins 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>
+ </section>
+ </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
+ "<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 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>
+ or
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>
+ script found in the
+ <link linkend='build-directory'>Build Directory</link>.
+ You must also be sure of the state of your build in the
+ <link linkend='source-directory'>Source Directory</link>.
+ The following commands run <filename>menuconfig</filename>
+ assuming 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.
+ </para>
+
+ <para>
+ Consider an example that configures the <filename>linux-yocto-3.14</filename>
+ kernel.
+ The OpenEmbedded build system recognizes this kernel as
+ <filename>linux-yocto</filename>.
+ Thus, the following commands from the shell in which you previously sourced the
+ environment initialization script cleans the shared state cache and the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink>
+ directory and then runs <filename>menuconfig</filename>:
+ <literallayout class='monospaced'>
+ $ bitbake linux-yocto -c menuconfig
+ </literallayout>
+ </para>
+
+ <para>
+ Once <filename>menuconfig</filename> launches, use the interface
+ to navigate through the selections to find the configuration settings in
+ which you are interested.
+ For example, consider the <filename>CONFIG_SMP</filename> configuration setting.
+ You can find it at <filename>Processor Type and Features</filename> under
+ the configuration selection <filename>Symmetric Multi-processing Support</filename>.
+ After highlighting the selection, use the arrow keys to select or deselect
+ the setting.
+ When you are finished with all your selections, exit out and save them.
+ </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
+ Linux 3.14 kernel and you were building a QEMU image targeted for
+ <filename>x86</filename> architecture, the
+ <filename>.config</filename> file would be located here:
+ <literallayout class='monospaced'>
+ poky/build/tmp/work/qemux86-poky-linux/linux-yocto-3.14.11+git1+84f...
+ ...656ed30-r1/linux-qemux86-standard-build
+ </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
+ for <filename>linux-yocto-3.14...</filename> 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> and don't just
+ rename it.
+ The build system needs an existing <filename>.config</filename>
+ 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".
+ 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
+ "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#changing-the-configuration'>Changing the Configuration</ulink>"
+ and
+ "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#generating-configuration-files'>Generating Configuration Files</ulink>"
+ sections, both in the Yocto Project Linux Kernel Development
+ Manual.
+ </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.
+ Syntactically, the configuration statement is identical to what would appear
+ in the <filename>.config</filename> file, which is in the
+ <link linkend='build-directory'>Build Directory</link>:
+ <literallayout class='monospaced'>
+ tmp/work/<replaceable>arch</replaceable>-poky-linux/linux-yocto-<replaceable>release_specific_string</replaceable>/linux-<replaceable>arch</replaceable>-<replaceable>build_type</replaceable>
+ </literallayout>
+ </para>
+
+ <para>
+ It is simple to create a configuration fragment.
+ 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>
+ Where do you put your configuration fragment files?
+ You can place these files in the same area pointed to by
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>.
+ 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 and then add a
+ <filename>SRC_URI</filename> statement such as the following
+ to the kernel's append file, those configuration options
+ will be picked up and applied when the kernel is built.
+ <literallayout class='monospaced'>
+ 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='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>Start with a full configuration that you
+ know works - it builds and boots successfully.
+ This configuration file will be your baseline.
+ </para></listitem>
+ <listitem><para>Separately run the
+ <filename>do_kernel_configme</filename> and
+ <filename>do_kernel_configcheck</filename> tasks.
+ </para></listitem>
+ <listitem><para>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>
+ 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 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.
+ 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>
+ In order to not overwhelm the user with configuration warnings,
+ by default the system only reports on missing "hardware"
+ options because a missing hardware option could mean a boot
+ failure or that important hardware is not available.
+ </para>
+
+ <para>
+ To determine whether or not a given option is "hardware" or
+ "non-hardware", the kernel Metadata contains files that
+ classify individual or groups of options as either hardware
+ or non-hardware.
+ To better show this, consider a situation where the
+ Yocto Project kernel cache contains the following files:
+ <literallayout class='monospaced'>
+ kernel-cache/features/drm-psb/hardware.cfg
+ kernel-cache/features/kgdb/hardware.cfg
+ kernel-cache/ktypes/base/hardware.cfg
+ kernel-cache/bsp/mti-malta32/hardware.cfg
+ kernel-cache/bsp/fsl-mpc8315e-rdb/hardware.cfg
+ kernel-cache/bsp/qemu-ppc32/hardware.cfg
+ kernel-cache/bsp/qemuarma9/hardware.cfg
+ kernel-cache/bsp/mti-malta64/hardware.cfg
+ kernel-cache/bsp/arm-versatile-926ejs/hardware.cfg
+ kernel-cache/bsp/common-pc/hardware.cfg
+ kernel-cache/bsp/common-pc-64/hardware.cfg
+ kernel-cache/features/rfkill/non-hardware.cfg
+ kernel-cache/ktypes/base/non-hardware.cfg
+ kernel-cache/features/aufs/non-hardware.kcf
+ kernel-cache/features/ocf/non-hardware.kcf
+ kernel-cache/ktypes/base/non-hardware.kcf
+ kernel-cache/ktypes/base/hardware.kcf
+ 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>
+ </section>
+
+ <section id="patching-the-kernel">
+ <title>Patching the Kernel</title>
+
+ <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.
+ <note>
+ You can use the <filename>yocto-kernel</filename> script
+ found in the <link linkend='source-directory'>Source Directory</link>
+ under <filename>scripts</filename> to manage kernel patches and configuration.
+ See the "<ulink url='&YOCTO_DOCS_BSP_URL;#managing-kernel-patches-and-config-items-with-yocto-kernel'>Managing kernel Patches and Config Items with yocto-kernel</ulink>"
+ section in the Yocto Project Board Support Packages (BSP) Developer's Guide for
+ more information.</note>
+ </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.
+ </para>
+
+ <para>
+ The example assumes a clean build exists for the <filename>qemux86</filename>
+ machine in a
+ <link linkend='source-directory'>Source Directory</link>
+ named <filename>poky</filename>.
+ Furthermore, the <link linkend='build-directory'>Build Directory</link> is
+ <filename>build</filename> and is located in <filename>poky</filename> and
+ the kernel is based on the Linux 3.4 kernel.
+ </para>
+
+ <para>
+ Also, for more information on patching the kernel, see the
+ "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#applying-patches'>Applying Patches</ulink>"
+ section in the Yocto Project Linux Kernel Development Manual.
+ </para>
+
+ <section id='create-a-layer-for-your-changes'>
+ <title>Create a Layer for your Changes</title>
+
+ <para>
+ The first step is to create a layer so you can isolate your
+ changes.
+ Rather than use the <filename>yocto-layer</filename> script
+ to create the layer, this example steps through the process
+ by hand.
+ If you want information on the script that creates a general
+ layer, see the
+ "<link linkend='creating-a-general-layer-using-the-yocto-layer-script'>Creating a General Layer Using the yocto-layer Script</link>"
+ section.
+ </para>
+
+ <para>
+ These two commands create a directory you can use for your
+ layer:
+ <literallayout class='monospaced'>
+ $ cd ~/poky
+ $ mkdir meta-mylayer
+ </literallayout>
+ Creating a directory that follows the Yocto Project layer naming
+ conventions sets up the layer for your changes.
+ The layer is where you place your configuration files, append
+ files, and patch files.
+ To learn more about creating a layer and filling it with the
+ files you need, see the "<link linkend='understanding-and-creating-layers'>Understanding
+ and Creating Layers</link>" section.
+ </para>
+ </section>
+
+ <section id='finding-the-kernel-source-code'>
+ <title>Finding the Kernel Source Code</title>
+
+ <para>
+ Each time you build a kernel image, the kernel source code is fetched
+ and unpacked into the following directory:
+ <literallayout class='monospaced'>
+ ${S}/linux
+ </literallayout>
+ See the "<link linkend='finding-the-temporary-source-code'>Finding Temporary Source Code</link>"
+ section and the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink> variable
+ for more information about where source is kept during a build.
+ </para>
+
+ <para>
+ For this example, we are going to patch the
+ <filename>init/calibrate.c</filename> file
+ by adding some simple console <filename>printk</filename> statements that we can
+ see when we boot the image using QEMU.
+ </para>
+ </section>
+
+ <section id='creating-the-patch'>
+ <title>Creating the Patch</title>
+
+ <para>
+ Two methods exist by which you can create the patch:
+ <link linkend='using-devtool-in-your-workflow'><filename>devtool</filename></link> and
+ <link linkend='using-a-quilt-workflow'>Quilt</link>.
+ For kernel patches, the Git workflow is more appropriate.
+ This section assumes the Git workflow and shows the steps specific to
+ this example.
+ <orderedlist>
+ <listitem><para><emphasis>Change the working directory</emphasis>:
+ Change to where the kernel source code is before making
+ your edits to the <filename>calibrate.c</filename> file:
+ <literallayout class='monospaced'>
+ $ cd ~/poky/build/tmp/work/qemux86-poky-linux/linux-yocto-${PV}-${PR}/linux
+ </literallayout>
+ Because you are working in an established Git repository,
+ you must be in this directory in order to commit your changes
+ and create the patch file.
+ <note>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
+ represent the version and revision for the
+ <filename>linux-yocto</filename> recipe.
+ The <filename>PV</filename> variable includes the Git meta and machine
+ hashes, which make the directory name longer than you might
+ expect.
+ </note></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>
+ <listitem><para><emphasis>Stage and commit your changes</emphasis>:
+ These Git commands display the modified file, stage it, and then
+ commit the file:
+ <literallayout class='monospaced'>
+ $ git status
+ $ git add init/calibrate.c
+ $ git commit -m "calibrate: Add printk example"
+ </literallayout></para></listitem>
+ <listitem><para><emphasis>Generate the patch file</emphasis>:
+ This Git command creates the a patch file named
+ <filename>0001-calibrate-Add-printk-example.patch</filename>
+ in the current directory.
+ <literallayout class='monospaced'>
+ $ git format-patch -1
+ </literallayout>
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='set-up-your-layer-for-the-build'>
+ <title>Set Up Your Layer for the Build</title>
+
+ <para>These steps get your layer set up for the build:
+ <orderedlist>
+ <listitem><para><emphasis>Create additional structure</emphasis>:
+ Create the additional layer structure:
+ <literallayout class='monospaced'>
+ $ cd ~/poky/meta-mylayer
+ $ mkdir conf
+ $ mkdir recipes-kernel
+ $ mkdir recipes-kernel/linux
+ $ mkdir 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
+ your patch file.</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 <filename>linux-yocto_3.4.bbappend</filename> file as follows:
+ <literallayout class='monospaced'>
+ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+ SRC_URI += "file://0001-calibrate-Add-printk-example.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.
+ For more information on using append files, see the
+ "<link linkend='using-bbappend-files'>Using .bbappend Files</link>"
+ section.
+ </para></listitem>
+ <listitem><para><emphasis>Put the patch file in your layer</emphasis>:
+ Move the <filename>0001-calibrate-Add-printk-example.patch</filename> file to
+ the <filename>meta-mylayer/recipes-kernel/linux/linux-yocto</filename>
+ directory.</para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='set-up-for-the-build'>
+ <title>Set Up for the Build</title>
+
+ <para>
+ Do the following to make sure the build parameters are set up for the example.
+ Once you set up these build parameters, they do not have to change unless you
+ change the target architecture of the machine you are building:
+ <itemizedlist>
+ <listitem><para><emphasis>Build for the correct target architecture:</emphasis> Your
+ selected <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
+ definition within the <filename>local.conf</filename> file in the
+ <link linkend='build-directory'>Build Directory</link>
+ specifies the target architecture used when building the Linux kernel.
+ By default, <filename>MACHINE</filename> is set to
+ <filename>qemux86</filename>, which specifies a 32-bit
+ <trademark class='registered'>Intel</trademark> Architecture
+ target machine suitable for the QEMU emulator.</para></listitem>
+ <listitem><para><emphasis>Identify your <filename>meta-mylayer</filename>
+ layer:</emphasis> The
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BBLAYERS'><filename>BBLAYERS</filename></ulink>
+ variable in the
+ <filename>bblayers.conf</filename> file found in the
+ <filename>poky/build/conf</filename> directory needs to have the path to your local
+ <filename>meta-mylayer</filename> layer.
+ By default, the <filename>BBLAYERS</filename> variable contains paths to
+ <filename>meta</filename>, <filename>meta-poky</filename>, and
+ <filename>meta-yocto-bsp</filename> in the
+ <filename>poky</filename> Git repository.
+ Add the path to your <filename>meta-mylayer</filename> location:
+ <literallayout class='monospaced'>
+ BBLAYERS ?= " \
+ $HOME/poky/meta \
+ $HOME/poky/meta-poky \
+ $HOME/poky/meta-yocto-bsp \
+ $HOME/poky/meta-mylayer \
+ "
+ </literallayout></para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='build-the-modified-qemu-kernel-image'>
+ <title>Build the Modified QEMU Kernel Image</title>
+
+ <para>
+ The following steps build your modified kernel image:
+ <orderedlist>
+ <listitem><para><emphasis>Be sure your build environment is initialized</emphasis>:
+ Your environment should be set up since you previously sourced
+ the
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
+ script.
+ If it is not, source the script again from <filename>poky</filename>.
+ <literallayout class='monospaced'>
+ $ cd ~/poky
+ $ source &OE_INIT_FILE;
+ </literallayout>
+ </para></listitem>
+ <listitem><para><emphasis>Clean up</emphasis>:
+ Be sure to clean the shared state out by using BitBake
+ to run from within the Build Directory the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-cleansstate'><filename>do_cleansstate</filename></ulink>
+ task as follows:
+ <literallayout class='monospaced'>
+ $ bitbake -c cleansstate linux-yocto
+ </literallayout></para>
+ <para>
+ <note>
+ Never remove any files by hand from the
+ <filename>tmp/deploy</filename>
+ directory inside the
+ <link linkend='build-directory'>Build Directory</link>.
+ Always use the various BitBake clean tasks to
+ clear out previous build artifacts.
+ For information on the clean tasks, see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-clean'><filename>do_clean</filename></ulink>",
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-cleanall'><filename>do_cleanall</filename></ulink>",
+ and
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-cleansstate'><filename>do_cleansstate</filename></ulink>"
+ sections all in the Yocto Project Reference
+ Manual.
+ </note>
+ </para></listitem>
+ <listitem><para><emphasis>Build the image</emphasis>:
+ Next, build the kernel image using this command:
+ <literallayout class='monospaced'>
+ $ bitbake -k linux-yocto
+ </literallayout></para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='boot-the-image-and-verify-your-changes'>
+ <title>Boot the Image and Verify Your Changes</title>
+
+ <para>
+ These steps boot the image and allow you to see the 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.</para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+ </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://internetcensus2012.bitbucket.org/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
+ <link linkend='source-directory'>Source Directory</link>
+ (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;/cgit/cgit.cgi'>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
+ <link linkend='metadata'>Metadata</link>, 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-yocto-layer-script'>Creating a General Layer Using the yocto-layer 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
+ <link linkend='build-directory'>Build Directory</link>,
+ 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'>Best Practices to Follow 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</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
+ <link linkend='build-directory'>Build Directory's</link>
+ <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
+ <link linkend='source-directory'>Source Directory</link>
+ 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 scripts that set up the build environment
+ (i.e.
+ <ulink url="&YOCTO_DOCS_REF_URL;#structure-core-script"><filename>&OE_INIT_FILE;</filename></ulink>
+ and
+ <ulink url="&YOCTO_DOCS_REF_URL;#structure-memres-core-script"><filename>oe-init-build-env-memres</filename></ulink>)
+ use 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='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
+ <link linkend='source-directory'>Source Directory</link> 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;#generating-configuration-files'>Generating Configuration Files</ulink>"
+ section of the Yocto Project Linux Kernel Development
+ Manual and the "<link linkend='creating-config-fragments'>Creating Configuration Fragments</link>"
+ section, which is in this manual.</para></listitem>
+ <listitem><para><filename>bitbake -u depexp -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 depexp -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='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 the <filename>emgd</filename>
+ graphics stack in the
+ <filename>meta-intel</filename> layer.
+ In this layer, a subset of software exists that is
+ compiled against something different from the rest of the
+ generic packages.
+ You can examine the key code in the
+ <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi'>Source Repositories</ulink>
+ "daisy" branch in
+ <filename>classes/emgd-gl.bbclass</filename>.
+ For a specific set of packages, the code redefines
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_ARCH'><filename>PACKAGE_ARCH</filename></ulink>.
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_EXTRA_ARCHS'><filename>PACKAGE_EXTRA_ARCHS</filename></ulink>
+ is then appended with this extra tune name in
+ <filename>meta-intel-emgd.inc</filename>.
+ The result is that when searching for packages, the
+ build system uses a four-level search and the packages
+ in this new level are preferred as compared to the standard
+ tune.
+ The overall result is that the build system reuses most
+ software from the common tune except for specific cases
+ as needed.
+ </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_CONSOLE'><filename>SERIAL_CONSOLE</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='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-package-revision-number'>Incrementing a package revision number</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-package-revision-number'>
+ <title>Incrementing a Package Revision Number</title>
+
+ <para>
+ If a committed change results in changing the package output,
+ then the value of the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>
+ variable needs to be increased (or "bumped").
+ Increasing <filename>PR</filename> 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> variable.</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Given that one of the challenges any build system and its
+ users face 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 version
+ numbering increases in a linear fashion and that a number of
+ version components exist that support that linear progression.
+ </para>
+
+ <para>
+ The following two sections provide information on the PR Service
+ and on manual <filename>PR</filename> bumping.
+ </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_DEV_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_REF_URL;#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> numbers to trigger a rebuild.
+ The signatures, however, can be used to generate
+ <filename>PR</filename> 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_DEV_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 will take 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 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
+ "<ulink url='&YOCTO_DOCS_REF_URL;#maintaining-build-output-quality'>Maintaining Build Output Quality</ulink>"
+ section in the Yocto Project Reference Manual.
+ </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_REF_URL;#shared-state-cache'>Shared State Cache</ulink>"
+ section in the Yocto Project Reference 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 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 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>
+ 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>
+
+ <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>
+ <link linkend='yocto-project-repositories'>source repository</link>.
+ 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 currently produces the <filename>bash-dbg</filename>,
+ <filename>bash-staticdev</filename>,
+ <filename>bash-dev</filename>, <filename>bash-doc</filename>,
+ <filename>bash-locale</filename>, and
+ <filename>bash</filename> packages.
+ 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/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).
+ </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>qemuarm</filename>
+ device produces the following three package databases:
+ <filename>all</filename>, <filename>armv5te</filename>, and
+ <filename>qemuarm</filename>.
+ If you wanted your <filename>qemuarm</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 that you need
+ to be aware of 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.
+ <note>
+ You can choose to have more than one format but you must
+ provide at least one.
+ </note>
+ </para>
+
+ <para>
+ If you would like your image to start off with a basic
+ package database of the packages in your current build
+ as well as 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 an existing
+ package, it is always a good idea to re-generate the
+ package index with:
+ <literallayout class='monospaced'>
+ $ bitbake package-index
+ </literallayout>
+ Realize that it is not sufficient to simply do the
+ following:
+ <literallayout class='monospaced'>
+ $ bitbake <replaceable>some-package</replaceable> package-index
+ </literallayout>
+ This is because BitBake does not properly schedule the
+ <filename>package-index</filename> target fully after any
+ other target has completed.
+ Thus, be sure to run the package update step separately.
+ </para>
+
+ <para>
+ As described below in the
+ "<link linkend='runtime-package-management-target-ipk'>Using IPK</link>"
+ section, if you are using IPK as your package format, you
+ can make use of the
+ <filename>distro-feed-configs</filename> recipe provided
+ by <filename>meta-oe</filename> in order to configure your
+ target to use your IPK databases.
+ </para>
+
+ <para>
+ When your build is complete, your packages reside in the
+ <filename>${TMPDIR}/deploy/<replaceable>package-format</replaceable></filename>
+ directory.
+ For example, if <filename>${TMPDIR}</filename>
+ is <filename>tmp</filename> and your selected package type
+ is IPK, then your IPK packages are available in
+ <filename>tmp/deploy/ipk</filename>.
+ </para>
+ </section>
+
+ <section id='runtime-package-management-server'>
+ <title>Host or Server Machine Setup</title>
+
+ <para>
+ Typically, packages are served from a server using
+ HTTP.
+ However, other protocols are possible.
+ If you want to use HTTP, then setup and configure a
+ web server, such as Apache 2 or lighttpd, on the machine
+ serving the packages.
+ </para>
+
+ <para>
+ As previously mentioned, the build machine can act as the
+ package server.
+ In the following sections that describe server machine
+ setups, the build machine is assumed to also be the server.
+ </para>
+
+ <section id='package-server-apache'>
+ <title>Serving Packages via Apache 2</title>
+
+ <para>
+ This example assumes you are using the Apache 2
+ server:
+ <orderedlist>
+ <listitem><para>
+ Add the directory to your Apache
+ configuration, which you can find at
+ <filename>/etc/httpd/conf/httpd.conf</filename>.
+ Use commands similar to these on the
+ development system.
+ These example commands assume a top-level
+ <link linkend='source-directory'>Source Directory</link>
+ named <filename>poky</filename> in your home
+ directory.
+ The example also assumes an RPM package type.
+ If you are using a different package type, such
+ as IPK, use "ipk" in the pathnames:
+ <literallayout class='monospaced'>
+ &lt;VirtualHost *:80&gt;
+ ....
+ Alias /rpm ~/poky/build/tmp/deploy/rpm
+ &lt;Directory "~/poky/build/tmp/deploy/rpm"&gt;
+ Options +Indexes
+ &lt;/Directory&gt;
+ &lt;/VirtualHost&gt;
+ </literallayout></para></listitem>
+ <listitem><para>
+ Reload the Apache configuration as described
+ in this step.
+ For all commands, be sure you have root
+ privileges.
+ </para>
+
+ <para>
+ If your development system is using Fedora or
+ CentOS, use the following:
+ <literallayout class='monospaced'>
+ # service httpd reload
+ </literallayout>
+ For Ubuntu and Debian, use the following:
+ <literallayout class='monospaced'>
+ # /etc/init.d/apache2 reload
+ </literallayout>
+ For OpenSUSE, use the following:
+ <literallayout class='monospaced'>
+ # /etc/init.d/apache2 reload
+ </literallayout></para></listitem>
+ <listitem><para>
+ If you are using Security-Enhanced Linux
+ (SELinux), you need to label the files as
+ being accessible through Apache.
+ Use the following command from the development
+ host.
+ This example assumes RPM package types:
+ <literallayout class='monospaced'>
+ # chcon -R -h -t httpd_sys_content_t tmp/deploy/rpm
+ </literallayout></para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='package-server-lighttpd'>
+ <title>Serving Packages via lighttpd</title>
+
+ <para>
+ If you are using lighttpd, all you need
+ to do is to provide a link from your
+ <filename>${TMPDIR}/deploy/<replaceable>package-format</replaceable></filename>
+ directory to lighttpd's document-root.
+ You can determine the specifics of your lighttpd
+ installation by looking through its configuration file,
+ which is usually found at:
+ <filename>/etc/lighttpd/lighttpd.conf</filename>.
+ </para>
+
+ <para>
+ For example, if you are using IPK, lighttpd's
+ document-root is set to
+ <filename>/var/www/lighttpd</filename>, and you had
+ packages for a target named "BOARD",
+ then you might create a link from your build location
+ to lighttpd's document-root as follows:
+ <literallayout class='monospaced'>
+ # ln -s $(PWD)/tmp/deploy/ipk /var/www/lighttpd/BOARD-dir
+ </literallayout>
+ </para>
+
+ <para>
+ At this point, you need to start the lighttpd server.
+ The method used to start the server varies by
+ distribution.
+ However, one basic method that starts it by hand is:
+ <literallayout class='monospaced'>
+ # lighttpd -f /etc/lighttpd/lighttpd.conf
+ </literallayout>
+ </para>
+ </section>
+ </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 and IPK.
+ </para>
+
+ <section id='runtime-package-management-target-rpm'>
+ <title>Using RPM</title>
+
+ <para>
+ The application for performing runtime package
+ management of RPM packages on the target is called
+ <filename>smart</filename>.
+ </para>
+
+ <para>
+ On the target machine, you need to inform
+ <filename>smart</filename> of every package database
+ you want to use.
+ As an example, suppose your target device can use the
+ following three package databases from a server named
+ <filename>server.name</filename>:
+ <filename>all</filename>, <filename>i586</filename>,
+ and <filename>qemux86</filename>.
+ Given this example, issue the following commands on the
+ target:
+ <literallayout class='monospaced'>
+ # smart channel --add all type=rpm-md baseurl=http://server.name/rpm/all
+ # smart channel --add i585 type=rpm-md baseurl=http://server.name/rpm/i586
+ # smart channel --add qemux86 type=rpm-md baseurl=http://server.name/rpm/qemux86
+ </literallayout>
+ Also from the target machine, fetch the repository
+ information using this command:
+ <literallayout class='monospaced'>
+ # smart update
+ </literallayout>
+ You can now use the <filename>smart query</filename>
+ and <filename>smart install</filename> commands to
+ find and install packages from the repositories.
+ </para>
+ </section>
+
+ <section id='runtime-package-management-target-ipk'>
+ <title>Using IPK</title>
+
+ <para>
+ The application for performing runtime package
+ management of IPK packages on the target is called
+ <filename>opkg</filename>.
+ </para>
+
+ <para>
+ In order to inform <filename>opkg</filename> of the
+ package databases you want to use, simply create one
+ or more <filename>*.conf</filename> files in the
+ <filename>/etc/opkg</filename> directory on the target.
+ The <filename>opkg</filename> application uses them
+ to find its available package databases.
+ As an example, suppose you configured your HTTP server
+ on your machine named
+ <filename>www.mysite.com</filename> to serve files
+ from a <filename>BOARD-dir</filename> directory under
+ its document-root.
+ In this case, you might create a configuration
+ file on the target called
+ <filename>/etc/opkg/base-feeds.conf</filename> that
+ contains:
+ <literallayout class='monospaced'>
+ src/gz all http://www.mysite.com/BOARD-dir/all
+ src/gz armv7a http://www.mysite.com/BOARD-dir/armv7a
+ src/gz beaglebone http://www.mysite.com/BOARD-dir/beaglebone
+ </literallayout>
+ </para>
+
+ <para>
+ As a way of making it easier to generate and make
+ these IPK configuration files available on your
+ target, simply define
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FEED_DEPLOYDIR_BASE_URI'><filename>FEED_DEPLOYDIR_BASE_URI</filename></ulink>
+ to point to your server and the location within the
+ document-root which contains the databases.
+ For example: if you are serving your packages over
+ HTTP, your server's IP address is 192.168.7.1, and
+ your databases are located in a directory called
+ <filename>BOARD-dir</filename> underneath your HTTP
+ server's document-root, you need to set
+ <filename>FEED_DEPLOYDIR_BASE_URI</filename> to
+ <filename>http://192.168.7.1/BOARD-dir</filename> and
+ a set of configuration files will be generated for you
+ in your target to work with this feed.
+ </para>
+
+ <para>
+ On the target machine, fetch (or refresh) the
+ repository information using this command:
+ <literallayout class='monospaced'>
+ # opkg update
+ </literallayout>
+ You can now use the <filename>opkg list</filename> and
+ <filename>opkg install</filename> commands to find and
+ install packages from the repositories.
+ </para>
+ </section>
+ </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
+ <link linkend='build-directory'>Build Directory</link>:
+ <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='working-with-source-files'>
+ <title>Working with Source Files</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 presents information for working with source
+ files that can lead to more efficient use of resources and
+ time.
+ </para>
+
+ <section id='setting-up-effective-mirrors'>
+ <title>Setting up Effective Mirrors</title>
+
+ <para>
+ As mentioned, 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 fetchall <replaceable>target</replaceable>
+ </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="building-software-from-an-external-source">
+ <title>Building Software from an External Source</title>
+
+ <para>
+ By default, the OpenEmbedded build system uses the
+ <link linkend='build-directory'>Build Directory</link> 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 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
+ <link linkend='build-directory'>Build Directory</link>
+ 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="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>
+
+ <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.
+ </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 smart tests) start an
+ HTTP server on a random high number port, which is
+ used to serve files to the target.
+ The smart module serves
+ <filename>${DEPLOY_DIR}/rpm</filename> so it can run
+ smart 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>"GummibootTarget":</emphasis>
+ Choose "GummibootTarget" if your hardware is
+ an EFI-based machine with
+ <filename>gummiboot</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 "GummibootTarget", there are
+ additional requirements and considerations.
+ See the
+ "<link linkend='selecting-gummiboottarget'>Selecting GummibootTarget</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-gummiboottarget'>
+ <title>Selecting GummibootTarget</title>
+
+ <para>
+ If you did not set <filename>TEST_TARGET</filename> to
+ "GummibootTarget", 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
+ "GummibootTarget", 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 = "gummiboot"
+ </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 "GummibootTarget" 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 = "GummibootTarget"
+ 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_DEV_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
+ <link linkend='source-directory'>Source Directory</link>.
+ 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 smart 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.
+ Be sure to provide the IP address you need:
+ <literallayout class='monospaced'>
+ TEST_EXPORT_ONLY = "1"
+ TEST_TARGET = "simpleremote"
+ TEST_TARGET_IP = "192.168.7.2"
+ TEST_SERVER_IP = "192.168.7.1"
+ </literallayout>
+ You can then export the tests with the following:
+ <literallayout class='monospaced'>
+ $ bitbake core-image-sato -c testimage
+ </literallayout>
+ Exporting the tests places them in the
+ <link linkend='build-directory'>Build Directory</link> in
+ <filename>tmp/testimage/core-image-sato</filename>, 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/testimage/core-image-sato
+ $ ./runexported.py testdata.json
+ </literallayout>
+ <note>
+ This "export" feature does not deploy or boot the target
+ image.
+ Your target (be it a Qemu or hardware one)
+ has to already be up and running when you call
+ <filename>runexported.py</filename>
+ </note>
+ </para>
+
+ <para>
+ The exported data (i.e. <filename>testdata.json</filename>)
+ contains paths to the Build Directory.
+ Thus, the contents of the directory can be moved
+ to another machine as long as you update some paths in the
+ JSON.
+ Usually, you only care about the
+ <filename>${DEPLOY_DIR}/rpm</filename> directory
+ (assuming the RPM and Smart tests are enabled).
+ Consequently, running the tests on other machine
+ means that you have to move the contents and call
+ <filename>runexported.py</filename> with
+ "--deploy-dir <replaceable>path</replaceable>" as
+ follows:
+ <literallayout class='monospaced'>
+ ./runexported.py --deploy-dir /new/path/on/this/machine testdata.json
+ </literallayout>
+ <filename>runexported.py</filename> accepts other arguments
+ as well as described using <filename>--help</filename>.
+ </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
+ GummibootTarget).
+ 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 "smart" 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>
+
+ <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/"/>.
+ </para>
+
+ <tip>
+ 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.
+ </tip>
+
+ <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.
+ Gdbserver 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.
+ <note>
+ By default, source files are part of the
+ <filename>*-dbg</filename> packages in order to enable GDB
+ to show source lines in its output.
+ You can save further space on the target by setting the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_DEBUG_SPLIT_STYLE'><filename>PACKAGE_DEBUG_SPLIT_STYLE</filename></ulink>
+ variable to "debug-without-src" so that these packages do not
+ include the source files.
+ </note>
+ </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 remainder of this section describes the steps you need to take
+ to debug using the GNU project debugger.
+ </para>
+
+ <section id='platdev-gdb-remotedebug-setup'>
+ <title>Set Up the Cross-Development Debugging Environment</title>
+
+ <para>
+ Before you can initiate a remote debugging session, you need
+ to be sure you have set up the cross-development environment,
+ toolchain, and sysroot.
+ The <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-intro'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>
+ describes this process.
+ </para>
+ </section>
+
+ <section id="platdev-gdb-remotedebug-launch-gdbserver">
+ <title>Launch Gdbserver on the Target</title>
+
+ <para>
+ Make sure Gdbserver is installed on the target.
+ If it is not, install the package
+ <filename>gdbserver</filename>, which needs the
+ <filename>libthread-db1</filename> package.
+ </para>
+
+ <para>
+ Here is an example, that when entered from the host,
+ connects to the target and launches Gdbserver in order to
+ "debug" a binary named <filename>helloworld</filename>:
+ <literallayout class='monospaced'>
+ $ gdbserver localhost:2345 /usr/bin/helloworld
+ </literallayout>
+ Gdbserver should now be listening on port 2345 for debugging
+ commands coming from a remote GDB process that is running on
+ the host computer.
+ Communication between Gdbserver and the host GDB are done
+ using TCP.
+ To use other communication protocols, please refer to the
+ <ulink url='http://www.gnu.org/software/gdb/'>Gdbserver documentation</ulink>.
+ </para>
+ </section>
+
+ <section id="platdev-gdb-remotedebug-launch-gdb">
+ <title>Launch GDB on the Host Computer</title>
+
+ <para>
+ Running GDB on the host computer takes a number of stages, which
+ this section describes.
+ </para>
+
+ <section id="platdev-gdb-remotedebug-launch-gdb-buildcross">
+ <title>Build the Cross-GDB Package</title>
+ <para>
+ A suitable GDB cross-binary is required that runs on your
+ host computer but also knows about the the ABI of the
+ remote target.
+ You can get this binary from the
+ <link linkend='cross-development-toolchain'>Cross-Development Toolchain</link>.
+ Here is an example where the toolchain has been installed
+ in the default directory
+ <filename>/opt/poky/&DISTRO;</filename>:
+ <literallayout class='monospaced'>
+ /opt/poky/&DISTRO;/sysroots/i686-pokysdk-linux/usr/bin/armv7a-vfp-neon-poky-linux-gnueabi/arm-poky-linux-gnueabi-gdb
+ </literallayout>
+ where <filename>arm</filename> is the target architecture
+ and <filename>linux-gnueabi</filename> is the target ABI.
+ </para>
+
+ <para>
+ Alternatively, you can use BitBake to build the
+ <filename>gdb-cross</filename> binary.
+ Here is an example:
+ <literallayout class='monospaced'>
+ $ bitbake gdb-cross
+ </literallayout>
+ Once the binary is built, you can find it here:
+ <literallayout class='monospaced'>
+ tmp/sysroots/<replaceable>host-arch</replaceable>/usr/bin/<replaceable>target-platform</replaceable>/<replaceable>target-abi</replaceable>-gdb
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='create-the-gdb-initialization-file'>
+ <title>Create the GDB Initialization File and Point to Your Root Filesystem</title>
+
+ <para>
+ Aside from the GDB cross-binary, you also need a GDB
+ initialization file in the same top directory in which
+ your binary resides.
+ When you start GDB on your host development system, GDB
+ finds this initialization file and executes all the
+ commands within.
+ For information on the <filename>.gdbinit</filename>, see
+ "<ulink url='http://sourceware.org/gdb/onlinedocs/gdb/'>Debugging with GDB</ulink>",
+ which is maintained by
+ <ulink url='http://www.sourceware.org'>sourceware.org</ulink>.
+ </para>
+
+ <para>
+ You need to add a statement in the
+ <filename>~/.gdbinit</filename> file that points to your
+ root filesystem.
+ Here is an example that points to the root filesystem for
+ an ARM-based target device:
+ <literallayout class='monospaced'>
+ set sysroot ~/sysroot_arm
+ </literallayout>
+ </para>
+ </section>
+
+ <section id="platdev-gdb-remotedebug-launch-gdb-launchhost">
+ <title>Launch the Host GDB</title>
+
+ <para>
+ Before launching the host GDB, you need to be sure
+ you have sourced the cross-debugging environment script,
+ which if you installed the root filesystem in the default
+ location is at <filename>/opt/poky/&DISTRO;</filename>
+ and begins with the string "environment-setup".
+ For more information, see the
+ <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-manual'>Yocto Project Software Development Kit (SDK) Developer's
+ Guide</ulink>.
+ </para>
+
+ <para>
+ Finally, switch to the directory where the binary resides
+ and run the <filename>cross-gdb</filename> binary.
+ Provide the binary file you are going to debug.
+ For example, the following command continues with the
+ example used in the previous section by loading
+ the <filename>helloworld</filename> binary as well as the
+ debugging information:
+ <literallayout class='monospaced'>
+ $ arm-poky-linux-gnuabi-gdb helloworld
+ </literallayout>
+ The commands in your <filename>.gdbinit</filename> execute
+ and the GDB prompt appears.
+ </para>
+ </section>
+ </section>
+
+ <section id='platdev-gdb-connect-to-the-remote-gdb-server'>
+ <title>Connect to the Remote GDB Server</title>
+
+ <para>
+ From the target, you need to connect to the remote GDB
+ server that is running on the host.
+ You need to specify the remote host and port.
+ Here is the command continuing with the example:
+ <literallayout class='monospaced'>
+ target remote 192.168.7.2:2345
+ </literallayout>
+ </para>
+ </section>
+
+ <section id="platdev-gdb-remotedebug-launch-gdb-using">
+ <title>Use the Debugger</title>
+
+ <para>
+ You can now proceed with debugging as normal - as if you were debugging
+ on the local machine.
+ For example, to instruct GDB to break in the "main" function and then
+ continue with execution of the inferior binary use the following commands
+ from within GDB:
+ <literallayout class='monospaced'>
+ (gdb) break main
+ (gdb) continue
+ </literallayout>
+ </para>
+
+ <para>
+ For more information about using GDB, see the project's online documentation at
+ <ulink url="http://sourceware.org/gdb/download/onlinedocs/"/>.
+ </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
+ <link linkend='source-directory'>Source Directory</link>
+ 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'>How to Submit a Change</link>"
+ section for more information.
+ </para>
+ </section>
+ </section>
+
+<!--
+ <section id="platdev-oprofile">
+ <title>Profiling with OProfile</title>
+
+ <para>
+ <ulink url="http://oprofile.sourceforge.net/">OProfile</ulink> is a
+ statistical profiler well suited for finding performance
+ bottlenecks in both user-space software and in the kernel.
+ This profiler provides answers to questions like "Which functions does my application spend
+ the most time in when doing X?"
+ Because the OpenEmbedded build system is well integrated with OProfile, it makes profiling
+ applications on target hardware straight forward.
+ <note>
+ For more information on how to set up and run OProfile, see the
+ "<ulink url='&YOCTO_DOCS_PROF_URL;#profile-manual-oprofile'>oprofile</ulink>"
+ section in the Yocto Project Profiling and Tracing Manual.
+ </note>
+ </para>
+
+ <para>
+ To use OProfile, you need an image that has OProfile installed.
+ The easiest way to do this is with "tools-profile" in the
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FEATURES'>IMAGE_FEATURES</ulink></filename> variable.
+ You also need debugging symbols to be available on the system where the analysis
+ takes place.
+ You can gain access to the symbols by using "dbg-pkgs" in the
+ <filename>IMAGE_FEATURES</filename> variable or by
+ installing the appropriate debug (<filename>-dbg</filename>)
+ packages.
+ </para>
+
+ <para>
+ For successful call graph analysis, the binaries must preserve the frame
+ pointer register and should also be compiled with the
+ <filename>-fno-omit-framepointer</filename> flag.
+ You can achieve this by setting the
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-SELECTED_OPTIMIZATION'>SELECTED_OPTIMIZATION</ulink></filename>
+ variable with the following options:
+ <literallayout class='monospaced'>
+ -fexpensive-optimizations
+ -fno-omit-framepointer
+ -frename-registers
+ -O2
+ </literallayout>
+ You can also achieve it by setting the
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-DEBUG_BUILD'>DEBUG_BUILD</ulink></filename>
+ variable to "1" in the <filename>local.conf</filename> configuration file.
+ If you use the <filename>DEBUG_BUILD</filename> variable,
+ you also add extra debugging information that can make the debug
+ packages large.
+ </para>
+
+ <section id="platdev-oprofile-target">
+ <title>Profiling on the Target</title>
+
+ <para>
+ Using OProfile, you can perform all the profiling work on the target device.
+ A simple OProfile session might look like the following:
+ </para>
+
+ <para>
+ <literallayout class='monospaced'>
+ # opcontrol &dash;&dash;reset
+ # opcontrol &dash;&dash;start &dash;&dash;separate=lib &dash;&dash;no-vmlinux -c 5
+ .
+ .
+ [do whatever is being profiled]
+ .
+ .
+ # opcontrol &dash;&dash;stop
+ $ opreport -cl
+ </literallayout>
+ </para>
+
+ <para>
+ In this example, the <filename>reset</filename> command clears any previously profiled data.
+ The next command starts OProfile.
+ The options used when starting the profiler separate dynamic library data
+ within applications, disable kernel profiling, and enable callgraphing up to
+ five levels deep.
+ <note>
+ To profile the kernel, you would specify the
+ <filename>&dash;&dash;vmlinux=/path/to/vmlinux</filename> option.
+ The <filename>vmlinux</filename> file is usually in the source directory in the
+ <filename>/boot/</filename> directory and must match the running kernel.
+ </note>
+ </para>
+
+ <para>
+ After you perform your profiling tasks, the next command stops the profiler.
+ After that, you can view results with the <filename>opreport</filename> command with options
+ to see the separate library symbols and callgraph information.
+ </para>
+
+ <para>
+ Callgraphing logs information about time spent in functions and about a function's
+ calling function (parent) and called functions (children).
+ The higher the callgraphing depth, the more accurate the results.
+ However, higher depths also increase the logging overhead.
+ Consequently, you should take care when setting the callgraphing depth.
+ <note>
+ On ARM, binaries need to have the frame pointer enabled for callgraphing to work.
+ To accomplish this use the <filename>-fno-omit-framepointer</filename> option
+ with <filename>gcc</filename>.
+ </note>
+ </para>
+
+ <para>
+ For more information on using OProfile, see the OProfile
+ online documentation at
+ <ulink url="http://oprofile.sourceforge.net/docs/"/>.
+ </para>
+ </section>
+
+ <section id="platdev-oprofile-oprofileui">
+ <title>Using OProfileUI</title>
+
+ <para>
+ A graphical user interface for OProfile is also available.
+ You can download and build this interface from the Yocto Project at
+ <ulink url="&YOCTO_GIT_URL;/cgit.cgi/oprofileui/"></ulink>.
+ If the "tools-profile" image feature is selected, all necessary binaries
+ are installed onto the target device for OProfileUI interaction.
+ For a list of image features that ship with the Yocto Project,
+ see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-features-image'>Image Features</ulink>"
+ section in the Yocto Project Reference Manual.
+ </para>
+
+ <para>
+ Even though the source directory usually includes all needed patches on the target device, you
+ might find you need other OProfile patches for recent OProfileUI features.
+ If so, see the <ulink url='&YOCTO_GIT_URL;/cgit.cgi/oprofileui/tree/README'>
+ OProfileUI README</ulink> for the most recent information.
+ </para>
+
+ <section id="platdev-oprofile-oprofileui-online">
+ <title>Online Mode</title>
+
+ <para>
+ Using OProfile in online mode assumes a working network connection with the target
+ hardware.
+ With this connection, you just need to run "oprofile-server" on the device.
+ By default, OProfile listens on port 4224.
+ <note>
+ You can change the port using the <filename>&dash;&dash;port</filename> command-line
+ option.
+ </note>
+ </para>
+
+ <para>
+ The client program is called <filename>oprofile-viewer</filename> and its UI is relatively
+ straight forward.
+ You access key functionality through the buttons on the toolbar, which
+ are duplicated in the menus.
+ Here are the buttons:
+ <itemizedlist>
+ <listitem><para><emphasis>Connect:</emphasis> Connects to the remote host.
+ You can also supply the IP address or hostname.</para></listitem>
+ <listitem><para><emphasis>Disconnect:</emphasis> Disconnects from the target.
+ </para></listitem>
+ <listitem><para><emphasis>Start:</emphasis> Starts profiling on the device.
+ </para></listitem>
+ <listitem><para><emphasis>Stop:</emphasis> Stops profiling on the device and
+ downloads the data to the local host.
+ Stopping the profiler generates the profile and displays it in the viewer.
+ </para></listitem>
+ <listitem><para><emphasis>Download:</emphasis> Downloads the data from the
+ target and generates the profile, which appears in the viewer.</para></listitem>
+ <listitem><para><emphasis>Reset:</emphasis> Resets the sample data on the device.
+ Resetting the data removes sample information collected from previous
+ sampling runs.
+ Be sure you reset the data if you do not want to include old sample information.
+ </para></listitem>
+ <listitem><para><emphasis>Save:</emphasis> Saves the data downloaded from the
+ target to another directory for later examination.</para></listitem>
+ <listitem><para><emphasis>Open:</emphasis> Loads previously saved data.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ The client downloads the complete profile archive from
+ the target to the host for processing.
+ This archive is a directory that contains the sample data, the object files,
+ and the debug information for the object files.
+ The archive is then converted using the <filename>oparchconv</filename> script, which is
+ included in this distribution.
+ The script uses <filename>opimport</filename> to convert the archive from
+ the target to something that can be processed on the host.
+ </para>
+
+ <para>
+ Downloaded archives reside in the
+ <link linkend='build-directory'>Build Directory</link> in
+ <filename>tmp</filename> and are cleared up when they are no longer in use.
+ </para>
+
+ <para>
+ If you wish to perform kernel profiling, you need to be sure
+ a <filename>vmlinux</filename> file that matches the running kernel is available.
+ In the source directory, that file is usually located in
+ <filename>/boot/vmlinux-<replaceable>kernelversion</replaceable></filename>, where
+ <filename><replaceable>kernelversion</replaceable></filename> is the version of the kernel.
+ The OpenEmbedded build system generates separate <filename>vmlinux</filename>
+ packages for each kernel it builds.
+ Thus, it should just be a question of making sure a matching package is
+ installed (e.g. <filename>opkg install kernel-vmlinux</filename>).
+ The files are automatically installed into development and profiling images
+ alongside OProfile.
+ A configuration option exists within the OProfileUI settings page that you can use to
+ enter the location of the <filename>vmlinux</filename> file.
+ </para>
+
+ <para>
+ Waiting for debug symbols to transfer from the device can be slow, and it
+ is not always necessary to actually have them on the device for OProfile use.
+ All that is needed is a copy of the filesystem with the debug symbols present
+ on the viewer system.
+ The "<link linkend='platdev-gdb-remotedebug-launch-gdb'>Launch GDB on the Host Computer</link>"
+ section covers how to create such a directory within
+ the source directory and how to use the OProfileUI Settings
+ Dialog to specify the location.
+ If you specify the directory, it will be used when the file checksums
+ match those on the system you are profiling.
+ </para>
+ </section>
+
+ <section id="platdev-oprofile-oprofileui-offline">
+ <title>Offline Mode</title>
+
+ <para>
+ If network access to the target is unavailable, you can generate
+ an archive for processing in <filename>oprofile-viewer</filename> as follows:
+ <literallayout class='monospaced'>
+ # opcontrol &dash;&dash;reset
+ # opcontrol &dash;&dash;start &dash;&dash;separate=lib &dash;&dash;no-vmlinux -c 5
+ .
+ .
+ [do whatever is being profiled]
+ .
+ .
+ # opcontrol &dash;&dash;stop
+ # oparchive -o my_archive
+ </literallayout>
+ </para>
+
+ <para>
+ In the above example, <filename>my_archive</filename> is the name of the
+ archive directory where you would like the profile archive to be kept.
+ After the directory is created, you can copy it to another host and load it
+ using <filename>oprofile-viewer</filename> open functionality.
+ If necessary, the archive is converted.
+ </para>
+ </section>
+ </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
+ archiver class, you need to decide how you choose to
+ provide source.
+ The source archiver 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
+ <link linkend='build-directory'>Build Directory</link>:
+ <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 with the following:
+ <literallayout class='monospaced'>
+ $ cd poky/build/tmp/deploy/sources
+ $ mkdir ~/gpl_source_release
+ $ for dir in */*GPL*; do cp -r $dir ~/gpl_source_release; 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 archiver 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 address
+ 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 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'>
+ # LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
+ # changes incompatibly
+ LCONF_VERSION = "6"
+
+ BBPATH = "${TOPDIR}"
+ BBFILES ?= ""
+
+ BBLAYERS ?= " \
+ ##OEROOT##/meta \
+ ##OEROOT##/meta-poky \
+ ##OEROOT##/meta-yocto-bsp \
+ ##OEROOT##/meta-mylayer \
+ "
+ </literallayout>
+ Creating and providing an archive of the
+ <link linkend='metadata'>Metadata</link> 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 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
+ <link linkend='source-directory'>Source Directory</link>
+ (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
+ <link linkend='build-directory'>Build Directory</link>.
+ <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
+ <link linkend='build-directory'>Build Directory</link>.
+ <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>
+</chapter>
+
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/import-layers/yocto-poky/documentation/dev-manual/dev-manual-customization.xsl b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-customization.xsl
new file mode 100644
index 000000000..523ea3c5e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/dev-manual/dev-manual-eclipse-customization.xsl b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-eclipse-customization.xsl
new file mode 100644
index 000000000..6d7b5fbb6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/dev-manual/dev-manual-intro.xml b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-intro.xml
new file mode 100644
index 000000000..caa066e82
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-intro.xml
@@ -0,0 +1,247 @@
+<!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 Manual</title>
+ <section id='dev-intro'>
+ <title>Introduction</title>
+
+ <para>
+ Welcome to the Yocto Project Development Manual!
+ This manual provides information on how to use the Yocto Project to
+ develop embedded Linux images and user-space applications that
+ run on targeted devices.
+ The manual provides an overview of image, kernel, and
+ user-space application development using the Yocto Project.
+ Because much of the information in this manual is general, it
+ contains many references to other sources where you can find more
+ detail.
+ For example, you can find detailed information on Git, repositories,
+ and open source in general in many places on the Internet.
+ Another example specific to the Yocto Project is how to quickly
+ set up your host development system and build an image, which you
+ find in the
+ <ulink url='&YOCTO_DOCS_QS_URL;'>Yocto Project Quick Start</ulink>.
+ </para>
+
+ <para>
+ The Yocto Project Development Manual does, however, provide
+ guidance and examples on how to change the kernel source code,
+ reconfigure the kernel, and develop an application using
+ <filename>devtool</filename>.
+ </para>
+
+ <note>
+ By default, using the Yocto Project creates a Poky distribution.
+ However, you can create your own distribution by providing key
+ <link linkend='metadata'>Metadata</link>.
+ A good example is Angstrom, which has had a distribution
+ based on the Yocto Project since its inception.
+ Other examples include commercial distributions like
+ <ulink url='https://www.yoctoproject.org/organization/wind-river-systems'>Wind River Linux</ulink>,
+ <ulink url='https://www.yoctoproject.org/organization/mentor-graphics'>Mentor Embedded Linux</ulink>,
+ <ulink url='https://www.yoctoproject.org/organization/enea-ab'>ENEA Linux</ulink>
+ and <ulink url='https://www.yoctoproject.org/ecosystem/member-organizations'>others</ulink>.
+ See the "<link linkend='creating-your-own-distribution'>Creating Your Own Distribution</link>"
+ section for more information.
+ </note>
+ </section>
+
+ <section id='what-this-manual-provides'>
+ <title>What This Manual Provides</title>
+
+ <para>
+ The following list describes what you can get from this manual:
+ <itemizedlist>
+ <listitem><para>Information that lets you get set
+ up to develop using the Yocto Project.</para></listitem>
+ <listitem><para>Information to help developers who are new to
+ the open source environment and to the distributed revision
+ control system Git, which the Yocto Project uses.
+ </para></listitem>
+ <listitem><para>An understanding of common end-to-end
+ development models and tasks.</para></listitem>
+ <listitem><para>Information about common development tasks
+ generally used during image development for
+ embedded devices.
+ </para></listitem>
+ <listitem><para>Information on using the Yocto Project
+ integration of the QuickEMUlator (QEMU), which lets you
+ simulate running on hardware an image you have built using
+ the OpenEmbedded build system.
+ </para></listitem>
+ <listitem><para>Many references to other sources of related
+ information.</para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='what-this-manual-does-not-provide'>
+ <title>What this Manual Does Not Provide</title>
+
+ <para>
+ This manual will not give you the following:
+ <itemizedlist>
+ <listitem><para><emphasis>Step-by-step instructions when those instructions exist in other Yocto
+ Project documentation:</emphasis>
+ For example, the
+ <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Software Development Kit (SDK) Developer's Guide</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>.
+ </para></listitem>
+ <listitem><para><emphasis>Detailed public information that is not specific to the Yocto Project:</emphasis>
+ For example, exhaustive information on how to use Git is covered better through the
+ Internet than in this manual.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='other-information'>
+ <title>Other Information</title>
+
+ <para>
+ Because this manual presents overview information for many different
+ topics, supplemental information is recommended for full
+ comprehension.
+ The following list presents other sources of information you might find helpful:
+ <itemizedlist>
+ <listitem><para><emphasis><ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>:
+ </emphasis> The home page for the Yocto Project provides lots of information on the project
+ as well as links to software and documentation.
+ </para></listitem>
+ <listitem><para><emphasis>
+ <ulink url='&YOCTO_DOCS_QS_URL;'>Yocto Project Quick Start</ulink>:</emphasis>
+ This short document lets you get started
+ with the Yocto Project and quickly begin building an image.
+ </para></listitem>
+ <listitem><para><emphasis>
+ <ulink url='&YOCTO_DOCS_REF_URL;'>Yocto Project Reference Manual</ulink>:</emphasis>
+ This manual is a reference
+ guide to the OpenEmbedded build system, which is based on BitBake.
+ The build system is sometimes referred to as "Poky".
+ </para></listitem>
+ <listitem><para><emphasis>
+ <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>:</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_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, which is a web interface to the Yocto Project's
+ <link linkend='build-system-term'>OpenEmbedded Build System</link>.
+ </para></listitem>
+ <listitem><para><emphasis>
+ <ulink url='http://www.youtube.com/watch?v=3ZlOu-gLsh0'>
+ Eclipse IDE Yocto Plug-in</ulink>:</emphasis>
+ A step-by-step instructional video that
+ demonstrates how an application developer uses Yocto Plug-in features 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>
+ <ulink url='&YOCTO_RELEASE_NOTES;'>Release Notes</ulink>:</emphasis>
+ Features, updates and known issues for the current
+ release of the Yocto Project.
+ </para></listitem>
+ <listitem><para><emphasis>
+ <ulink url='&YOCTO_HOME_URL;/tools-resources/projects/toaster'>Toaster</ulink>:</emphasis>
+ An Application Programming Interface (API) and web-based
+ interface to the OpenEmbedded build system, which uses
+ BitBake, that reports build information.
+ </para></listitem>
+ <listitem><para><emphasis>
+ <ulink url='&YOCTO_HOME_URL;/tools-resources/projects/build-appliance'>Build Appliance</ulink>:</emphasis>
+ A virtual machine that
+ enables you to build and boot a custom embedded Linux image
+ with the Yocto Project using a non-Linux development system.
+ </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>Yocto Project Mailing Lists:</emphasis>
+ To subscribe to the Yocto Project mailing
+ lists, click on the following URLs and follow the instructions:
+ <itemizedlist>
+ <listitem><para><ulink url='&YOCTO_LISTS_URL;/listinfo/yocto'></ulink>
+ for a Yocto Project Discussions mailing list.
+ </para></listitem>
+ <listitem><para><ulink url='&YOCTO_LISTS_URL;/listinfo/poky'></ulink>
+ for a Yocto Project Discussions mailing list about the
+ OpenEmbedded build system (Poky).
+ </para></listitem>
+ <listitem><para><ulink url='&YOCTO_LISTS_URL;/listinfo/yocto-announce'></ulink>
+ for a mailing list to receive official Yocto Project announcements
+ as well as Yocto Project milestones.
+ </para></listitem>
+ <listitem><para><ulink url='&YOCTO_LISTS_URL;/listinfo'></ulink>
+ for a listing of all public mailing lists on
+ <filename>lists.yoctoproject.org</filename>.
+ </para></listitem>
+ </itemizedlist></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='&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 by the OpenEmbedded build system
+ to process project 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='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/import-layers/yocto-poky/documentation/dev-manual/dev-manual-model.xml b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-model.xml
new file mode 100644
index 000000000..ff44a3f68
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-model.xml
@@ -0,0 +1,2195 @@
+<!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-model'>
+
+<title>Common Development Models</title>
+
+<para>
+ Many development models exist for which you can use the Yocto Project.
+ This chapter overviews simple methods that use tools provided by the
+ Yocto Project:
+ <itemizedlist>
+ <listitem><para><emphasis>System Development:</emphasis>
+ System Development covers Board Support Package (BSP) development
+ and kernel modification or configuration.
+ For an example on how to create a BSP, see the
+ "<ulink url='&YOCTO_DOCS_BSP_URL;#creating-a-new-bsp-layer-using-the-yocto-bsp-script'>Creating a New BSP Layer Using the yocto-bsp Script</ulink>"
+ section in the Yocto Project Board Support Package (BSP)
+ Developer's Guide.
+ For more complete information on how to work with the kernel,
+ see the
+ <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;'>Yocto Project Linux Kernel Development Manual</ulink>.
+ </para></listitem>
+ <listitem><para><emphasis>User Application Development:</emphasis>
+ User Application Development covers development of applications
+ that you intend to run on target hardware.
+ For information on how to set up your host development system for
+ user-space application development, see the
+ <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>.
+ For a simple example of user-space application development using
+ the <trademark class='trade'>Eclipse</trademark> IDE, see the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-developing-applications-using-eclipse'>Developing Applications Using <trademark class='trade'>Eclipse</trademark></ulink>" section.
+ </para></listitem>
+ <listitem><para><emphasis>Temporary Source Code Modification:</emphasis>
+ Direct modification of temporary source code is a convenient
+ development model to quickly iterate and develop towards a
+ solution.
+ Once you implement the solution, you should of course take
+ steps to get the changes upstream and applied in the affected
+ recipes.
+ </para></listitem>
+ <listitem><para><emphasis>Image Development using Toaster:</emphasis>
+ You can use <ulink url='&YOCTO_HOME_URL;/Tools-resources/projects/toaster'>Toaster</ulink>
+ to build custom operating system images within the build
+ environment.
+ Toaster provides an efficient interface to the OpenEmbedded build
+ that allows you to start builds and examine build statistics.
+ </para></listitem>
+ <listitem><para><emphasis>Using a Development Shell:</emphasis>
+ You can use a
+ <link linkend='platdev-appdev-devshell'><filename>devshell</filename></link>
+ to efficiently debug
+ commands or simply edit packages.
+ Working inside a development shell is a quick way to set up the
+ OpenEmbedded build environment to work on parts of a project.
+ </para></listitem>
+ </itemizedlist>
+</para>
+
+<section id='system-development-model'>
+ <title>System Development Workflow</title>
+
+ <para>
+ System development involves modification or creation of an image that you want to run on
+ a specific hardware target.
+ Usually, when you want to create an image that runs on embedded hardware, the image does
+ not require the same number of features that a full-fledged Linux distribution provides.
+ Thus, you can create a much smaller image that is designed to use only the
+ features for your particular hardware.
+ </para>
+
+ <para>
+ To help you understand how system development works in the Yocto Project, this section
+ covers two types of image development: BSP creation and kernel modification or
+ configuration.
+ </para>
+
+ <section id='developing-a-board-support-package-bsp'>
+ <title>Developing a Board Support Package (BSP)</title>
+
+ <para>
+ A BSP is a collection of recipes that, when applied during a build, results in
+ an image that you can run on a particular board.
+ Thus, the package when compiled into the new image, supports the operation of the board.
+ </para>
+
+ <note>
+ For a brief list of terms used when describing the development process in the Yocto Project,
+ see the "<link linkend='yocto-project-terms'>Yocto Project Terms</link>" section.
+ </note>
+
+ <para>
+ The remainder of this section presents the basic
+ steps used to create a BSP using the Yocto Project's
+ <ulink url='&YOCTO_DOCS_BSP_URL;#using-the-yocto-projects-bsp-tools'>BSP Tools</ulink>.
+ 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
+ "<ulink url='&YOCTO_DOCS_BSP_URL;#creating-a-new-bsp-layer-using-the-yocto-bsp-script'>Creating a New BSP Layer Using the yocto-bsp Script</ulink>"
+ section in the Yocto Project Board Support Package (BSP) Developer's Guide.
+ </para>
+
+ <para>
+ The following illustration and list summarize the BSP creation general workflow.
+ </para>
+
+ <para>
+ <imagedata fileref="figures/bsp-dev-flow.png" width="6in" depth="7in" 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_QS_URL;#the-linux-distro'>The Linux Distribution</ulink>"
+ and the
+ "<ulink url='&YOCTO_DOCS_QS_URL;#packages'>The Build Host Packages</ulink>" sections both
+ in the Yocto Project Quick Start for requirements.</para></listitem>
+ <listitem><para><emphasis>Establish a local copy of the project files on your
+ system</emphasis>: You need this <link linkend='source-directory'>Source
+ Directory</link> available on your host system.
+ Having these files on your system gives you access to the build
+ process and to the tools you need.
+ For information on how to set up the Source Directory,
+ see the
+ "<link linkend='getting-setup'>Getting Set Up</link>" section.</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 build on or modify
+ to create your BSP.
+ For information on how to get these files, see the
+ "<link linkend='getting-setup'>Getting Set Up</link>" section.</para></listitem>
+ <listitem><para><emphasis>Create your own BSP layer using the
+ <ulink url='&YOCTO_DOCS_BSP_URL;#creating-a-new-bsp-layer-using-the-yocto-bsp-script'><filename>yocto-bsp</filename></ulink> 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>yocto-bsp</filename> script.
+ For information about that script, see the
+ "<ulink url='&YOCTO_DOCS_BSP_URL;#creating-a-new-bsp-layer-using-the-yocto-bsp-script'>Creating a New BSP Layer Using the yocto-bsp Script</ulink>"
+ section in the Yocto Project Board Support (BSP) Developer's Guide.
+ </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
+ "<link linkend='understanding-and-creating-layers'>Understanding and Creating Layers</link>"
+ section.
+ For more information on BSP layers, see the
+ "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>"
+ section in the Yocto Project Board Support Package (BSP)
+ Developer's Guide.
+ <note>
+ <para>
+ Five BSPs exist that are part of the Yocto Project release:
+ <filename>beaglebone</filename> (ARM),
+ <filename>mpc8315e</filename> (PowerPC),
+ and <filename>edgerouter</filename> (MIPS).
+ The recipes and configurations for these five BSPs
+ are located and dispersed within the
+ <link linkend='source-directory'>Source Directory</link>.
+ </para>
+
+ <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>
+ </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
+ "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-filelayout'>Example Filesystem Layout</ulink>"
+ section of the Board Support Package (BSP) Development Guide.
+ In the standard layout, you will notice a 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 identify which kernel you are going to use.
+ When you run the <filename>yocto-bsp</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 you need to 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> or
+ <filename>oe-init-build-env-memres</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
+ "<link linkend='enabling-your-layer'>Enabling Your Layer</link>" section
+ for information on how to let the build system know about your new layer.</para>
+ <para>The entire process for building an image is overviewed in the section
+ "<ulink url='&YOCTO_DOCS_QS_URL;#qs-building-images'>Building Images</ulink>" section
+ of the Yocto Project Quick Start.
+ You might want to reference this information.</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>
+
+ <para>
+ You can view a video presentation on "Building Custom Embedded Images with Yocto"
+ at <ulink url='http://free-electrons.com/blog/elc-2011-videos'>Free Electrons</ulink>.
+ After going to the page, just search for "Embedded".
+ You can also find supplemental information in the
+ <ulink url='&YOCTO_DOCS_BSP_URL;'>
+ Yocto Project Board Support Package (BSP) Developer's Guide</ulink>.
+ Finally, there is helpful material and links on this
+ <ulink url='&YOCTO_WIKI_URL;/wiki/Transcript:_creating_one_generic_Atom_BSP_from_another'>wiki page</ulink>.
+ Although a bit dated, you might find the information on the wiki
+ helpful.
+ </para>
+ </section>
+
+ <section id='modifying-the-kernel'>
+ <title><anchor id='kernel-spot' />Modifying the Kernel</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>
+ The remainder of this section presents a high-level overview of the Yocto Project
+ kernel architecture and the steps to modify the kernel.
+ You can reference the
+ "<link linkend='patching-the-kernel'>Patching the Kernel</link>" section
+ for an example that changes the source code of the kernel.
+ For information on how to configure the kernel, see the
+ "<link linkend='configuring-the-kernel'>Configuring the Kernel</link>" section.
+ For more information on the kernel and on modifying the kernel, see the
+ <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;'>Yocto Project Linux Kernel Development Manual</ulink>.
+ </para>
+
+ <section id='kernel-overview'>
+ <title>Kernel Overview</title>
+
+ <para>
+ Traditionally, when one thinks of a patched kernel, they think of a base kernel
+ source tree and a fixed structure that contains kernel patches.
+ The Yocto Project, however, employs mechanisms that, in a sense, result in a kernel source
+ generator.
+ By the end of this section, this analogy will become clearer.
+ </para>
+
+ <para>
+ You can find a web interface to the Yocto Project kernel source repositories 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 kernels supported by
+ the Yocto Project:
+ <itemizedlist>
+ <listitem><para><emphasis>
+ <filename>linux-yocto-3.14</filename></emphasis> - The
+ stable Yocto Project kernel to use with the Yocto
+ Project Releases 1.6 and 1.7.
+ This kernel is based on the Linux 3.14 released kernel.
+ </para></listitem>
+ <listitem><para><emphasis>
+ <filename>linux-yocto-3.17</filename></emphasis> - An
+ additional, unsupported Yocto Project kernel used with
+ the Yocto Project Release 1.7.
+ This kernel is based on the Linux 3.17 released kernel.
+ </para></listitem>
+ <listitem><para><emphasis>
+ <filename>linux-yocto-3.19</filename></emphasis> - The
+ stable Yocto Project kernel to use with the Yocto
+ Project Release 1.8.
+ This kernel is based on the Linux 3.19 released kernel.
+ </para></listitem>
+ <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-dev</filename></emphasis> - A
+ development kernel based on the latest upstream release
+ candidate available.
+ </para></listitem>
+ </itemizedlist>
+ <note>
+ Long Term Support Initiative (LTSI) for Yocto Project 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 release 2.1, the
+ LTSI kernel is <filename>linux-yocto-4.1</filename>.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para>
+
+ <para>
+ The kernels are maintained using the Git revision control system
+ that structures them using the familiar "tree", "branch", and "leaf" scheme.
+ Branches represent diversions from general code to more specific code, while leaves
+ represent the end-points for a complete and unique kernel whose source files,
+ when gathered from the root of the tree to the leaf, accumulate to create the files
+ necessary for a specific piece of hardware and its features.
+ The following figure displays this concept:
+ <para>
+ <imagedata fileref="figures/kernel-overview-1.png"
+ width="6in" depth="6in" align="center" scale="100" />
+ </para>
+
+ <para>
+ Within the figure, the "Kernel.org Branch Point" represents the point in the tree
+ where a supported base kernel is modified from the Linux kernel.
+ For example, this could be the branch point for the <filename>linux-yocto-3.19</filename>
+ kernel.
+ Thus, everything further to the right in the structure is based on the
+ <filename>linux-yocto-3.19</filename> kernel.
+ Branch points to the right in the figure represent where the
+ <filename>linux-yocto-3.19</filename> kernel is modified for specific hardware
+ or types of kernels, such as real-time kernels.
+ Each leaf thus represents the end-point for a kernel designed to run on a specific
+ targeted device.
+ </para>
+
+ <para>
+ The overall result is a Git-maintained repository from which all the supported
+ kernel types can be derived for all the supported devices.
+ A big advantage to this scheme is the sharing of common features by keeping them in
+ "larger" branches within the tree.
+ This practice eliminates redundant storage of similar features shared among kernels.
+ </para>
+
+ <note>
+ Keep in mind the figure does not take into account all the supported Yocto
+ Project kernel types, but rather shows a single generic kernel just for conceptual purposes.
+ Also keep in mind that this structure represents the Yocto Project source repositories
+ 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>
+ 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 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 a couple of different
+ ways.
+ If you are working in the kernel all the time, you probably would want
+ to set up your own local Git repository of the kernel tree.
+ If you just need to make some patches to the kernel, you can access
+ temporary kernel source files that were extracted and used
+ during a build.
+ We will just talk about working with the temporary source code.
+ For more information on how to get kernel source code onto your
+ host system, see the
+ "<link linkend='local-kernel-files'>Yocto Project Kernel</link>"
+ bulleted item earlier in the manual.
+ </para>
+
+ <para>
+ What happens during the build?
+ 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 to generate the new kernel image - a source generator if you will.
+ </para>
+ The following figure shows the temporary file structure
+ created on your host system when the build occurs.
+ This
+ <link linkend='build-directory'>Build Directory</link> contains all the
+ source files used during the build.
+ </para>
+
+ <para>
+ <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
+ <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;'>Yocto Project Linux Kernel Development Manual</ulink>.
+ You can also reference the
+ "<link linkend='patching-the-kernel'>Patching the Kernel</link>"
+ section for a detailed example that modifies the kernel.
+ </para>
+ </section>
+
+ <section id='kernel-modification-workflow'>
+ <title>Kernel Modification Workflow</title>
+
+ <para>
+ This illustration and the following list summarizes the kernel modification general workflow.
+ </para>
+
+ <para>
+ <imagedata fileref="figures/kernel-dev-flow.png"
+ width="6in" 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
+ "<ulink url='&YOCTO_DOCS_QS_URL;#the-linux-distro'>The Linux Distribution</ulink>" and
+ "<ulink url='&YOCTO_DOCS_QS_URL;#packages'>The Build Host Packages</ulink>" sections both
+ in the Yocto Project Quick Start for requirements.</para></listitem>
+ <listitem><para><emphasis>Establish a local copy of project files on your
+ system</emphasis>: Having the <link linkend='source-directory'>Source
+ Directory</link> on your system gives you access to the build process and tools
+ you need.
+ For information on how to get these files, see the bulleted item
+ "<link linkend='local-yp-release'>Yocto Project Release</link>" earlier in this manual.
+ </para></listitem>
+ <listitem><para><emphasis>Establish the temporary kernel source files</emphasis>:
+ Temporary kernel source files are kept in the
+ <link linkend='build-directory'>Build Directory</link>
+ created by the
+ OpenEmbedded build system when you run BitBake.
+ If you have never built the kernel in which you are
+ interested, you need to run an initial build to
+ establish local kernel source files.</para>
+ <para>If you are building an image for the first time, you need to get the build
+ environment ready by sourcing an environment setup script
+ (i.e. <filename>oe-init-build-env</filename> or
+ <filename>oe-init-build-env-memres</filename>).
+ You also need to be sure two key configuration files
+ (<filename>local.conf</filename> and <filename>bblayers.conf</filename>)
+ are configured appropriately.</para>
+ <para>The entire process for building an image is overviewed in the
+ "<ulink url='&YOCTO_DOCS_QS_URL;#qs-building-images'>Building Images</ulink>"
+ section of the Yocto Project Quick Start.
+ You might want to reference this information.
+ You can find more information on 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>
+ <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
+ Build Directory.</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
+ <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#generating-configuration-files'><filename>menuconfig</filename></ulink>,
+ 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 at
+ <filename>tmp/sysroots/<replaceable>machine-name</replaceable>/kernel</filename>.
+ 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 the
+ <ulink url='&YOCTO_DOCS_BSP_URL;#managing-kernel-patches-and-config-items-with-yocto-kernel'><filename>yocto-kernel</filename></ulink>
+ script as well as <filename>menuconfig</filename>.
+ The <filename>yocto-kernel</filename> script lets
+ you interactively set up kernel configurations.
+ </para></listitem>
+ <listitem><para><emphasis>Rebuild the kernel image with your changes</emphasis>:
+ Rebuilding the kernel image applies your changes.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+ </section>
+</section>
+
+<section id='application-development-workflow-using-an-sdk'>
+ <title>Application Development Workflow Using an SDK</title>
+
+ <para>
+ Standard and extensible Software Development Kits (SDK) make it easy
+ to develop applications inside or outside of the Yocto Project
+ development environment.
+ Tools exist to help the application developer during any phase
+ of development.
+ For information on how to install and use an SDK, see the
+ <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-intro'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>.
+ </para>
+</section>
+
+<section id="dev-modifying-source-code">
+ <title>Modifying Source Code</title>
+
+ <para>
+ A common development workflow consists of modifying project source
+ files that are external to the Yocto Project and then integrating
+ that project's build output into an image built using the
+ OpenEmbedded build system.
+ Given this scenario, development engineers typically want to stick
+ to their familiar project development tools and methods, which allows
+ them to just focus on the project.
+ </para>
+
+ <para>
+ Several workflows exist that allow you to develop, build, and test
+ code that is going to be integrated into an image built using the
+ OpenEmbedded build system.
+ This section describes two:
+ <itemizedlist>
+ <listitem><para><emphasis><filename>devtool</filename>:</emphasis>
+ A set of tools to aid in working on the source code built by
+ the OpenEmbedded build system.
+ Section
+ "<link linkend='using-devtool-in-your-workflow'>Using <filename>devtool</filename> in Your Workflow</link>"
+ describes this workflow.
+ If you want more information that showcases the workflow, click
+ <ulink url='https://drive.google.com/a/linaro.org/file/d/0B3KGzY5fW7laTDVxUXo3UDRvd2s/view'>here</ulink>
+ for a presentation by Trevor Woerner that, while somewhat dated,
+ provides detailed background information and a complete
+ working tutorial.
+ </para></listitem>
+ <listitem><para><emphasis><ulink url='http://savannah.nongnu.org/projects/quilt'>Quilt</ulink>:</emphasis>
+ A powerful tool that allows you to capture source
+ code changes without having a clean source tree.
+ While Quilt is not the preferred workflow of the two, this
+ section includes it for users that are committed to using
+ the tool.
+ See the
+ "<link linkend='using-a-quilt-workflow'>Using Quilt in Your Workflow</link>"
+ section for more information.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <section id='using-devtool-in-your-workflow'>
+ <title>Using <filename>devtool</filename> in Your Workflow</title>
+
+ <para>
+ As mentioned earlier, <filename>devtool</filename> helps
+ you easily develop projects whose build output must be part of
+ an image built using the OpenEmbedded build system.
+ </para>
+
+ <para>
+ Three entry points exist that allow you to develop using
+ <filename>devtool</filename>:
+ <itemizedlist>
+ <listitem><para><emphasis><filename>devtool add</filename></emphasis>
+ </para></listitem>
+ <listitem><para><emphasis><filename>devtool modify</filename></emphasis>
+ </para></listitem>
+ <listitem><para><emphasis><filename>devtool upgrade</filename></emphasis>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ The remainder of this section presents these workflows.
+ </para>
+
+ <section id='use-devtool-to-integrate-new-code'>
+ <title>Use <filename>devtool add</filename> to Integrate New Code</title>
+
+ <para>
+ The <filename>devtool add</filename> command generates
+ a new recipe based on existing source code.
+ This command takes advantage of the
+ <link linkend='devtool-the-workspace-layer-structure'>workspace</link>
+ 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/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 where other developers are responsible for
+ various areas of source code.
+ As a developer, you are probably interested in using
+ that source code as part of your development using
+ 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 represents a common situation
+ where the source code does not exist locally
+ and needs to be extracted.
+ In this situation, you just let it get
+ extracted to the default workspace - you do not
+ want it 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>
+ creates a recipe and an append file in the
+ workspace as well as extracts the upstream
+ source files into a local Git repository also
+ within the <filename>sources</filename> folder.
+ </para></listitem>
+ <listitem><para><emphasis>Middle</emphasis>:
+ The middle scenario 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.
+ As always, if required <filename>devtool</filename> creates
+ a Git repository locally during the extraction.
+ 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:
+ <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 both the recipe and an append file
+ for the recipe.
+ </para></listitem>
+ <listitem><para><emphasis>Right</emphasis>:
+ The right scenario represents a situation
+ where the source tree (srctree) has been
+ previously prepared outside of the
+ <filename>devtool</filename> workspace.
+ </para>
+
+ <para>The following command names the recipe
+ and identifies where the existing source tree
+ is located:
+ <literallayout class='monospaced'>
+ $ devtool add <replaceable>recipe srctree</replaceable>
+ </literallayout>
+ The command examines the source code and creates
+ a recipe for it placing the recipe into the
+ workspace.</para>
+
+ <para>Because the extracted source code already exists,
+ <filename>devtool</filename> does not try to
+ relocate it into the workspace - just the new
+ the recipe is placed in the workspace.</para>
+
+ <para>Aside from a recipe folder, the command
+ also creates an append folder and places an initial
+ <filename>*.bbappend</filename> within.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para><emphasis>Edit the Recipe</emphasis>:
+ At this point, 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>:
+ At this point in the flow, the next step you
+ take depends on what you are going to do with
+ the new code.</para>
+ <para>If you need to take the build output and eventually
+ move it to the target hardware, you would use
+ <filename>devtool build</filename>:
+ <note>
+ You could use <filename>bitbake</filename> to build
+ the recipe as well.
+ </note>
+ <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 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, 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>Optionally Update the Recipe With Patch Files</emphasis>:
+ Once you are satisfied with the recipe, if you have made
+ any changes to the source tree that you want to have
+ applied by the recipe, you need to generate patches
+ from those changes.
+ You do this before moving the recipe
+ to its final layer and cleaning up the workspace area
+ <filename>devtool</filename> uses.
+ This optional step is especially relevant if you are
+ using or adding third-party software.</para>
+ <para>To convert commits created using Git to patch files,
+ use the <filename>devtool update-recipe</filename> command.
+ <note>
+ Any changes you want to turn into patches must be
+ committed to the Git repository in the source tree.
+ </note>
+ <literallayout class='monospaced'>
+ $ devtool update-recipe <replaceable>recipe</replaceable>
+ </literallayout>
+ </para></listitem>
+ <listitem><para><emphasis>Move the Recipe to its Permanent Layer</emphasis>:
+ Before cleaning up the workspace, you need to move the
+ final recipe to its permanent layer.
+ You must do this before using the
+ <filename>devtool reset</filename> command if you want to
+ retain the recipe.
+ </para></listitem>
+ <listitem><para><emphasis>Reset the Recipe</emphasis>:
+ As a final step, you can restore the state such that
+ standard layers and the upstream source is used to build
+ the recipe rather than data in the workspace.
+ To reset the recipe, use the <filename>devtool reset</filename>
+ command:
+ <literallayout class='monospaced'>
+ $ devtool reset <replaceable>recipe</replaceable>
+ </literallayout>
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe'>
+ <title>Use <filename>devtool modify</filename> to Enable Work on Code Associated with an Existing Recipe</title>
+
+ <para>
+ The <filename>devtool modify</filename> command prepares the
+ way to work on existing code that already has a recipe in
+ place.
+ The command is flexible enough to allow you to extract code,
+ 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
+ you would use with the <filename>devtool modify</filename>
+ command:
+ </para>
+
+ <para>
+ <imagedata fileref="figures/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 in some layer external
+ to the <filename>devtool</filename> workspace.
+ </para></listitem>
+ <listitem><para>The source files exist 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 some 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 represents a common situation
+ where the source code does not exist locally
+ and needs to be extracted.
+ In this situation, the source is extracted
+ into the default 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,
+ it uses the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ variable to locate the source code and
+ any local patch files from other developers are
+ located.
+ <note>
+ You cannot provide an URL for
+ <replaceable>srctree</replaceable> when using the
+ <filename>devtool modify</filename> command.
+ </note>
+ With this scenario, however, since no
+ <replaceable>srctree</replaceable> argument exists, the
+ <filename>devtool modify</filename> command by default
+ extracts the source files to a Git structure.
+ Furthermore, the location for the extracted source is the
+ default area within the workspace.
+ The result is that the command sets up both the source
+ code and an append file within the workspace with the
+ recipe remaining in its original location.
+ </para></listitem>
+ <listitem><para><emphasis>Middle</emphasis>:
+ The middle scenario 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 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 workspace:
+ <literallayout class='monospaced'>
+ $ devtool modify <replaceable>recipe srctree</replaceable>
+ </literallayout>
+ As with all extractions, the command uses
+ the recipe's <filename>SRC_URI</filename> to locate the
+ source files.
+ Once the files are located, the command by default
+ extracts them.
+ Providing the <replaceable>srctree</replaceable>
+ argument instructs <filename>devtool</filename> where
+ place the extracted source.</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
+ provided with <replaceable>srctree</replaceable>.
+ </para></listitem>
+ <listitem><para><emphasis>Right</emphasis>:
+ The right scenario represents a situation
+ where the source tree
+ (<replaceable>srctree</replaceable>) exists as a
+ previously extracted Git structure outside of
+ the <filename>devtool</filename> workspace.
+ In this example, the recipe also exists
+ elsewhere 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 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</emphasis>:
+ Once you have updated the source files, you can build
+ the recipe.
+ You can either use <filename>devtool build</filename> or
+ <filename>bitbake</filename>.
+ Either method produces build output that is stored
+ in
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink>.
+ </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 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, 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>Optionally Create Patch Files for Your Changes</emphasis>:
+ After you have debugged your changes, you can
+ use <filename>devtool update-recipe</filename> to
+ generate patch files for all the commits you have
+ made.
+ <note>
+ Patch files are generated only for changes
+ you have committed.
+ </note>
+ <literallayout class='monospaced'>
+ $ devtool update-recipe <replaceable>recipe</replaceable>
+ </literallayout>
+ By default, the
+ <filename>devtool update-recipe</filename> command
+ creates the patch files in a folder named the same
+ as the recipe beneath the folder in which the recipe
+ resides, and updates the recipe's
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ statement to point to the generated patch files.
+ <note>
+ You can use the
+ "--append <replaceable>LAYERDIR</replaceable>"
+ option to cause the command to create append files
+ in a specific layer rather than the default
+ recipe layer.
+ </note>
+ </para></listitem>
+ <listitem><para><emphasis>Restore the Workspace</emphasis>:
+ The <filename>devtool reset</filename> restores the
+ state so that standard layers and upstream sources are
+ used to build the recipe rather than what is in the
+ workspace.
+ <literallayout class='monospaced'>
+ $ devtool reset <replaceable>recipe</replaceable>
+ </literallayout>
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='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 updates
+ an existing recipe so that you can build it for an updated
+ set of source files.
+ The 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> workspace, and
+ work with any source file forms that the fetchers support.
+ </para>
+
+ <para>
+ Depending on your particular scenario, the arguments and options
+ you use with <filename>devtool upgrade</filename> form different
+ combinations.
+ The following diagram shows a common development flow
+ you would use with the <filename>devtool modify</filename>
+ command:
+ </para>
+
+ <para>
+ <imagedata fileref="figures/devtool-upgrade-flow.png" align="center" />
+ </para>
+
+ <para>
+ <orderedlist>
+ <listitem><para><emphasis>Initiate the Upgrade</emphasis>:
+ The top part of the flow shows a typical scenario by which
+ you could use <filename>devtool upgrade</filename>.
+ The following conditions exist:
+ <itemizedlist>
+ <listitem><para>The recipe exists in some layer external
+ to the <filename>devtool</filename> workspace.
+ </para></listitem>
+ <listitem><para>The source files for the new release
+ exist adjacent to 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 workspace.
+ 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>
+ Also, in this example, the "-V" option is used to specify
+ the new version.
+ 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 are located.
+ 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>:
+ At this point, there could be some conflicts due to the
+ software being upgraded to a new version.
+ This would 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.
+ If this is the case, 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</emphasis>:
+ Once you have your recipe in order, you can build it.
+ You can either use <filename>devtool build</filename> or
+ <filename>bitbake</filename>.
+ Either method produces build output that is stored
+ in
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink>.
+ </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 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, 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>Optionally Create Patch Files for Your Changes</emphasis>:
+ After you have debugged your changes, you can
+ use <filename>devtool update-recipe</filename> to
+ generate patch files for all the commits you have
+ made.
+ <note>
+ Patch files are generated only for changes
+ you have committed.
+ </note>
+ <literallayout class='monospaced'>
+ $ devtool update-recipe <replaceable>recipe</replaceable>
+ </literallayout>
+ By default, the
+ <filename>devtool update-recipe</filename> command
+ creates the patch files in a folder named the same
+ as the recipe beneath the folder in which the recipe
+ resides, and updates the recipe's
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ statement to point to the generated patch files.
+ </para></listitem>
+ <listitem><para><emphasis>Move the Recipe to its Permanent Layer</emphasis>:
+ Before cleaning up the workspace, you need to move the
+ final recipe to its permanent layer.
+ You can either overwrite the original recipe or you can
+ overlay the upgraded recipe into a separate layer.
+ You must do this before using the
+ <filename>devtool reset</filename> command if you want to
+ retain the upgraded recipe.
+ </para></listitem>
+ <listitem><para><emphasis>Restore the Workspace</emphasis>:
+ The <filename>devtool reset</filename> restores the
+ state so that standard layers and upstream sources are
+ used to build the recipe rather than what is in the
+ workspace.
+ <literallayout class='monospaced'>
+ $ devtool reset <replaceable>recipe</replaceable>
+ </literallayout>
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+ </section>
+
+ <section id='devtool-quick-reference'>
+ <title><filename>devtool</filename> Quick Reference</title>
+
+ <para>
+ <filename>devtool</filename> has more functionality than simply
+ adding a new recipe and the supporting Metadata to a temporary
+ workspace layer.
+ This section provides a short reference on
+ <filename>devtool</filename> and its commands.
+ </para>
+
+ <section id='devtool-getting-help'>
+ <title>Getting Help</title>
+
+ <para>
+ The easiest way to get help with the
+ <filename>devtool</filename> command is using the
+ <filename>--help</filename> option:
+ <literallayout class='monospaced'>
+ usage: devtool [--basepath BASEPATH] [--bbpath BBPATH] [-d] [-q]
+ [--color COLOR] [-h]
+ &lt;subcommand&gt; ...
+
+ OpenEmbedded development tool
+
+ optional arguments:
+ --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
+ Working on a recipe in the workspace:
+ build Build a recipe
+ edit-recipe Edit a recipe file in your workspace
+ 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
+ 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
+ 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
+ usage: devtool add [-h] [--same-dir | --no-same-dir] [--fetch URI]
+ [--version VERSION] [--no-git] [--binary] [--also-native]
+ [--src-subdir SUBDIR]
+ [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.
+
+ positional 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
+
+ optional arguments:
+ -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)
+ --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
+ --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
+ </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 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/scottrif/sources/jackson</filename>:
+ <literallayout class='monospaced'>
+ $ devtool add jackson /home/scottrif/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.
+ </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
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ 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>
+ Use the <filename>devtool upgrade</filename> command
+ to upgrade an existing recipe to a new upstream version.
+ The command puts the upgraded recipe file into the
+ workspace along with any associated files, and extracts
+ the source tree to a specified location should patches
+ need rebased or added to as a result of the upgrade.
+ </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
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>),
+ the source revision to which you want to upgrade (i.e. the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRCREV'><filename>SRCREV</filename></ulink>,
+ whether or not to apply patches, and so forth.
+ </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
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-install'><filename>do_install</filename></ulink>
+ 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>
+ </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>
+ </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 workflow described in the
+ "<link linkend='using-devtool-in-your-workflow'>Using <filename>devtool</filename> in Your Workflow</link>"
+ section is a safer development flow than 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
+ <link linkend='build-directory'>Build Directory</link>.
+ 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
+ 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_QS_URL;#qs-building-images'>Building Images</ulink>"
+ section of the Yocto Project Quick Start.
+ </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='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
+ <link linkend='build-directory'>Build Directory</link>, 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.
+ If you are using Quilt for development, see the
+ "<link linkend='using-a-quilt-workflow'>Using Quilt in Your Workflow</link>"
+ section for more information.
+ </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
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-S'>S</ulink></filename> 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
+ <link linkend='source-directory'>Source Directory</link>:
+ <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><ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink>:
+ The top-level build output directory</listitem>
+ <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-MULTIMACH_TARGET_SYS'><filename>MULTIMACH_TARGET_SYS</filename></ulink>:
+ The target system identifier</listitem>
+ <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink>:
+ The recipe name</listitem>
+ <listitem><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)</listitem>
+ <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>:
+ The recipe version</listitem>
+ <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>:
+ The recipe revision</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>
+
+ <para>
+ Now that you know where to locate the directory that has the
+ temporary source code, you can use a Quilt as described in section
+ "<link linkend='using-a-quilt-workflow'>Using Quilt in Your Workflow</link>"
+ to make your edits, test the changes, and preserve the changes in
+ the form of patches.
+ </para>
+ </section>
+</section>
+
+<section id='image-development-using-toaster'>
+ <title>Image Development Using Toaster</title>
+
+ <para>
+ Toaster is a web interface to the Yocto Project's OpenEmbedded build
+ system.
+ You can initiate builds using Toaster as well as examine the results
+ and statistics of builds.
+ See the
+ <ulink url='&YOCTO_DOCS_TOAST_URL;#toaster-manual-intro'>Toaster User Manual</ulink>
+ for information on how to set up and use Toaster to build images.
+ </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>
+
+</chapter>
diff --git a/import-layers/yocto-poky/documentation/dev-manual/dev-manual-newbie.xml b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-newbie.xml
new file mode 100644
index 000000000..75c992f16
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-newbie.xml
@@ -0,0 +1,1710 @@
+<!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-newbie'>
+
+<title>The Yocto Project Open Source Development Environment</title>
+
+<para>
+ This chapter helps you understand the Yocto Project as an open source development project.
+ In general, working in an open source environment is very different from working in a
+ closed, proprietary environment.
+ Additionally, the Yocto Project uses specific tools and constructs as part of its development
+ environment.
+ This chapter specifically addresses open source philosophy, using the
+ Yocto Project in a team environment, source repositories, Yocto Project
+ terms, licensing, the open source distributed version control system Git,
+ workflows, bug tracking, and how to submit changes.
+</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) that 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="usingpoky-changes-collaborate">
+ <title>Using the Yocto Project in a Team Environment</title>
+
+ <para>
+ It might not be immediately clear how you can use the Yocto
+ Project in a team 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 with these types of situations, this section presents
+ some of the project's most successful experiences,
+ practices, solutions, and available technologies that work well.
+ Keep in mind, the information here is a starting point.
+ You can build off it and customize it to fit any
+ particular working environment and set of practices.
+ </para>
+
+ <section id='best-practices-system-configurations'>
+ <title>System Configurations</title>
+
+ <para>
+ Systems across a large team should meet the needs of
+ two types of developers: those working on the contents of the
+ operating system image itself and those developing applications.
+ Regardless of the type of developer, their workstations must
+ be both reasonably powerful and run Linux.
+ </para>
+
+ <section id='best-practices-application-development'>
+ <title>Application Development</title>
+
+ <para>
+ For developers who mainly do application level work
+ on top of an existing software stack,
+ the following list shows practices that work best.
+ For information on using a Software Development Kit (SDK), see
+ the
+ <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-intro'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>:
+ <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 Software Development Kit (SDK) Developer's Guide</ulink>".
+ </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>
+ </section>
+
+ <section id='best-practices-core-system-development'>
+ <title>Core System Development</title>
+
+ <para>
+ For core system development, it is often best to have the
+ build system itself available on the developer workstations
+ so developers can run their own builds and directly
+ rebuild the software stack.
+ You should 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).
+ You can share layers amongst the developers of a particular
+ project and contain the policy configuration that defines
+ the project.
+ </para>
+
+ <para>
+ Aside from the previous best practices, there exists a number
+ of tips and tricks that can help speed up core development
+ projects:
+ <itemizedlist>
+ <listitem><para>Use a
+ <ulink url='&YOCTO_DOCS_REF_URL;#shared-state-cache'>Shared State Cache</ulink>
+ (sstate) among groups of developers who are on a
+ fast network.
+ The best way to share sstate is through a
+ Network File System (NFS) share.
+ The first user to build a given component for the
+ first time contributes that object to the sstate,
+ while subsequent builds from other developers then
+ reuse the object rather than rebuild it themselves.
+ </para>
+ <para>Although it is possible to use other protocols for the
+ sstate such as HTTP and FTP, you should avoid these.
+ Using HTTP limits the sstate to read-only and
+ FTP provides poor performance.
+ </para></listitem>
+ <listitem><para>Have autobuilders contribute to the sstate
+ pool similarly to how the developer workstations
+ contribute.
+ For information, see the
+ "<link linkend='best-practices-autobuilders'>Autobuilders</link>"
+ section.</para></listitem>
+ <listitem><para>Build stand-alone tarballs that contain
+ "missing" system requirements if for some reason
+ developer workstations do not meet minimum system
+ requirements such as latest Python versions,
+ <filename>chrpath</filename>, or other tools.
+ You can install and relocate the tarball exactly as you
+ would the usual cross-development toolchain so that
+ all developers can meet minimum version requirements
+ on most distributions.</para></listitem>
+ <listitem><para>Use a small number of shared,
+ high performance systems for testing purposes
+ (e.g. dual, six-core Xeons with 24 Gbytes of RAM
+ and plenty of disk space).
+ 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>Enable the PR Service when package feeds
+ need to be incremental with continually increasing
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'>PR</ulink>
+ values.
+ Typically, this situation occurs when you use or
+ publish package feeds and use a shared state.
+ You should enable the PR Service for all users who
+ use the shared state pool.
+ For more information on the PR Service, see the
+ "<link linkend='working-with-a-pr-service'>Working With a PR Service</link>".
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ </section>
+
+ <section id='best-practices-source-control-management'>
+ <title>Source Control Management (SCM)</title>
+
+ <para>
+ Keeping your
+ <ulink url='&YOCTO_DOCS_DEV_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
+ <link linkend='git'>Git</link>.
+ 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.
+ </para>
+
+ <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://sitaramc.github.com/gitolite/master-toc.html'>The <filename>gitolite</filename> master index</ulink>:
+ All topics 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>
+ </section>
+
+ <section id='best-practices-autobuilders'>
+ <title>Autobuilders</title>
+
+ <para>
+ Autobuilders are often the core of a development project.
+ 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>
+ </section>
+
+ <section id='best-practices-policies-and-change-flow'>
+ <title>Policies and Change Flow</title>
+
+ <para>
+ 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.
+ </para>
+
+ <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>
+ 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>
+ </section>
+
+ <section id='best-practices-summary'>
+ <title>Summary</title>
+
+ <para>
+ This section summarizes the key recommendations described in the
+ previous sections:
+ <itemizedlist>
+ <listitem><para>Use <link linkend='git'>Git</link>
+ 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
+ "<link linkend='yocto-project-repositories'>Yocto Project Source Repositories</link>"
+ section for information on these repositories.
+ See the
+ "<link linkend='getting-setup'>Getting Set Up</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'>How to Submit a Change</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'>How to Submit a Change</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>
+ </section>
+</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;/cgit/cgit.cgi'></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
+ <link linkend='source-directory'>Source Directory</link>, 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" tab and get a released tarball of the
+ <filename>poky</filename> repository or any supported BSP tarballs.
+ 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
+ <link linkend='source-directory'>Source Directory</link>
+ 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
+ <link linkend='source-directory'>Source Directory</link>
+ (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;/cgit/cgit.cgi'>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" />
+ </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" />
+ </para></listitem>
+ <listitem><para><emphasis>"Downloads" page for the
+ <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>:</emphasis>
+ Access this page by going to the website and then selecting
+ the "Downloads" tab.
+ This page allows you to download any Yocto Project
+ release or 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" />
+ </para></listitem>
+ </itemizedlist>
+ </para>
+</section>
+
+<section id='yocto-project-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
+ "<link linkend='using-bbappend-files'>Using .bbappend Files</link>" section.
+ <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='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. <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>).
+ The <ulink url='&YOCTO_DOCS_REF_URL;#var-TOPDIR'><filename>TOPDIR</filename></ulink>
+ 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
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink>,
+ 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><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
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-classes'>Classes</ulink>" chapter of the
+ Yocto Project Reference Manual.
+ Class files end with the <filename>.bbclass</filename> filename extension.
+ </para></listitem>
+ <listitem><para><emphasis>Configuration File:</emphasis>
+ Configuration information in various <filename>.conf</filename>
+ files provides global definitions of variables.
+ 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).
+ Configuration files end with a <filename>.conf</filename>
+ filename extension.
+ </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_REF_URL;#cross-development-toolchain-generation'>Cross-Development Toolchain Generation</ulink>"
+ section in the Yocto Project Reference Manual.
+ You can also find more information on using the
+ relocatable toolchain in the
+ <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>.
+ </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
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>"
+ chapter in the Yocto Project Reference Manual.</para></listitem>
+ <listitem><para id='layer'><emphasis>Layer:</emphasis> A collection of recipes representing the core,
+ a BSP, or an application stack.
+ 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>
+ The files that BitBake parses when building an image.
+ In general, Metadata includes recipes, classes, and
+ configuration files.
+ In the context of the kernel ("kernel Metadata"),
+ it refers to Metadata in the <filename>meta</filename>
+ branches of the kernel source Git repositories.
+ </para></listitem>
+ <listitem><para id='oe-core'><emphasis>OE-Core:</emphasis> A core set of Metadata originating
+ with OpenEmbedded (OE) that is shared between OE and the Yocto Project.
+ This Metadata is found in the <filename>meta</filename> directory of the
+ <link linkend='source-directory'>Source Directory</link>.</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
+ "<ulink url='&YOCTO_DOCS_QS_URL;#packages'>The Build Host Packages</ulink>" 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. <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>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>
+ The term "poky" can mean several things.
+ In its most general sense, it is an open-source
+ project that was initially developed by OpenedHand.
+ With OpenedHand, poky was developed off of the existing
+ OpenEmbedded build system becoming a commercially
+ supportable build system for embedded Linux.
+ After Intel Corporation acquired OpenedHand, the
+ project poky became the basis for the Yocto Project's
+ build system.</para>
+ <para>Within the Yocto Project source repositories,
+ <filename>poky</filename> exists as a separate Git
+ repository you can clone to yield a local copy on your
+ host system.
+ Thus, "poky" can refer to the local copy of the Source
+ Directory used for development within the Yocto
+ Project.</para>
+ <para>Finally, "poky" can refer to the default
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO'><filename>DISTRO</filename></ulink>
+ (i.e. distribution) created when you use the Yocto
+ Project in conjunction with the
+ <filename>poky</filename> repository to build an image.
+ </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='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
+ "<link linkend='repositories-tags-and-branches'>Repositories, Tags, and Branches</link>"
+ section.</para></listitem>
+ <listitem><para><emphasis>Task:</emphasis>
+ A unit of execution for BitBake (e.g.
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-compile'><filename>do_compile</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-fetch'><filename>do_fetch</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-patch'><filename>do_patch</filename></ulink>,
+ and so forth).
+ </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>
+</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
+ <link linkend='source-directory'>Source Directory</link> 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
+ <link linkend='build-directory'>Build Directory</link> 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
+ <link linkend='source-directory'>Source Directory</link>.
+ </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
+ "<link linkend='maintaining-open-source-license-compliance-during-your-products-lifecycle'>Maintaining Open Source License Compliance During Your Product's Lifecycle</link>"
+ section.
+ </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.
+ </para>
+
+ <para>
+ For more information on Git, see
+ <ulink url='http://git-scm.com/documentation'></ulink>.
+ If you need to download Git, go to <ulink url='http://git-scm.com/download'></ulink>.
+ </para>
+
+ <section id='repositories-tags-and-branches'>
+ <title>Repositories, Tags, and Branches</title>
+
+ <para>
+ As mentioned earlier in the section
+ "<link linkend='yocto-project-repositories'>Yocto Project Source Repositories</link>",
+ the Yocto Project maintains source repositories at
+ <ulink url='&YOCTO_GIT_URL;/cgit.cgi'></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 Poky 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 Git
+ <filename>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
+ "<link linkend='getting-setup'>Getting Set Up</link>" section.
+ </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
+ <filename>&DISTRO_NAME_NO_CAP;</filename> branch, the
+ <filename>master</filename> 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 <filename>master</filename> branch represents the current or most recent
+ development.
+ All other branches represent offshoots of the <filename>master</filename>
+ 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 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, here is a set of commands that creates a local copy of the
+ <filename>poky</filename> Git repository and then creates and checks out a local
+ Git branch that tracks the Yocto Project &DISTRO; Release (&DISTRO_NAME;) development:
+ <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 this example, the name of the top-level directory of your local
+ <link linkend='source-directory'>Source Directory</link>
+ is "poky" and the name of that local working area (local branch)
+ you just created and checked out is "&DISTRO_NAME_NO_CAP;".
+ The files in your local repository now reflect the same files that
+ are in the "&DISTRO_NAME_NO_CAP;" development branch of the
+ Yocto Project's "poky" upstream repository.
+ 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 development branch
+ at the time you created your local branch, which could be
+ different from the files at the time of a similarly named release.
+ In other words, creating and checking out a local branch based on
+ the "&DISTRO_NAME_NO_CAP;" branch name is not the same as
+ cloning and checking out the "master" branch.
+ 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.
+ Typically, a tag is used to mark a special point such as the final
+ change 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 are
+ <filename>dizzy-12.0.0</filename>,
+ <filename>fido-13.0.0</filename>,
+ <filename>jethro-14.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.
+ 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 checkout -b my-&DISTRO_NAME_NO_CAP;-&POKYVERSION; &DISTRO_NAME_NO_CAP;-&POKYVERSION;
+ </literallayout>
+ In this example, the name of the top-level directory of your local Yocto Project
+ Files Git repository is <filename>poky</filename>.
+ And, the name of the local branch you have created and checked out is
+ <filename>my-&DISTRO_NAME_NO_CAP;-&POKYVERSION;</filename>.
+ The files in your repository now exactly match the Yocto Project &DISTRO;
+ Release tag (<filename>&DISTRO_NAME_NO_CAP;-&POKYVERSION;</filename>).
+ 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.
+ </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>.
+ If you need to download Git, you can do so
+ <ulink url='http://git-scm.com/download'>here</ulink>, although
+ any reasonably current Linux distribution should already have an
+ installable package for Git.
+ </para>
+
+ <para>
+ If you do not know much about Git, you should educate
+ yourself by visiting the links previously mentioned.
+ </para>
+
+ <para>
+ The following list 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 they support.
+ 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><emphasis><filename>git clone</filename>:</emphasis>
+ Creates a local clone of a Git repository.
+ During collaboration, this command allows you to create a
+ local Git repository that is on equal footing with a fellow
+ developer’s Git repository.
+ </para></listitem>
+ <listitem><para><emphasis><filename>git add</filename>:</emphasis> 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 "commit" that documents
+ the changes you made.
+ 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 (or master) repository.</para></listitem>
+ <listitem><para><emphasis><filename>git status</filename>:</emphasis> Reports any modified files that
+ possibly need to be staged and committed.</para></listitem>
+ <listitem><para><emphasis><filename>git checkout</filename> <replaceable>branch-name</replaceable>:</emphasis> Changes
+ your working branch.
+ This command is analogous to "cd".</para></listitem>
+ <listitem><para><emphasis><filename>git checkout –b</filename> <replaceable>working-branch</replaceable>:</emphasis> Creates
+ a working branch on your local machine where you can isolate work.
+ It is a good idea to use local branches when adding specific features or changes.
+ This way if you do not like what you have done you can easily get rid of the work.</para></listitem>
+ <listitem><para><emphasis><filename>git branch</filename>:</emphasis> Reports
+ existing local branches and
+ tells you the branch in which you are currently working.</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</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).</para></listitem>
+ <listitem><para><emphasis><filename>git push</filename>:</emphasis>
+ Sends all your committed local changes to an upstream Git
+ repository (e.g. a contribution repository).
+ The maintainer of the project draws from these repositories
+ when adding changes to the project’s master repository or
+ other development branch.
+ </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 for isolated work, make and commit your
+ changes, switch to your local master branch, merge the changes from the temporary branch into the
+ local master branch, and then delete the temporary branch.</para></listitem>
+ <listitem><para><emphasis><filename>git cherry-pick</filename>:</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.</para></listitem>
+ <listitem><para><emphasis><filename>git log</filename>:</emphasis> Reports a history of your changes to the
+ repository.</para></listitem>
+ <listitem><para><emphasis><filename>git diff</filename>:</emphasis> Displays line-by-line differences
+ between your local working files and the same files in the upstream Git repository that your
+ branch currently tracks.</para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+</section>
+
+<section id='workflows'>
+ <title>Workflows</title>
+
+ <para>
+ This section provides some overview on workflows using Git.
+ In particular, the information covers basic practices that describe roles and actions in a
+ collaborative development environment.
+ Again, if you are familiar with this type of development environment, you might want to just
+ skip this section.
+ </para>
+
+ <para>
+ The Yocto Project files are maintained using Git in a "master" branch whose Git history
+ tracks every change and whose structure provides branches for all diverging functionality.
+ Although there is no need to use Git, many open source projects do so.
+ For the Yocto Project, a key individual called the "maintainer" is responsible for the "master"
+ branch of a given Git repository.
+ The "master" branch is the “upstream” repository where the final builds of the 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, see the
+ "<link linkend='how-to-submit-a-change'>How to Submit a Change</link>"
+ section.
+ </note>
+ </para>
+
+ <para>
+ The project 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 temporarily hold changes 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 the upstream "master" branch.
+ These 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 changes
+ to the appropriate "contrib" repository.
+ </para>
+
+ <para>
+ Developers are responsible for keeping their local repository up-to-date with "master".
+ 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 developer’s machines 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 "master"
+ This process is called “submitting a patch” or "submitting a change."
+ For information on submitting patches and changes, see the
+ "<link linkend='how-to-submit-a-change'>How to Submit a Change</link>" section.
+ </para>
+
+ <para>
+ To summarize the environment: a single point of entry exists for
+ changes into the project’s "master" 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>
+ <para>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.
+ 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
+ <link linkend='source-directory'>Source Directory</link>.
+ For information on how to use these scripts, see the
+ "<link linkend='pushing-a-change-upstream'>Using Scripts to Push a Change Upstream and Request a Pull</link>" section.
+ </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
+ "<link linkend='how-to-submit-a-change'>How to Submit a Change</link>"
+ section.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+</section>
+
+<section id='tracking-bugs'>
+ <title>Tracking Bugs</title>
+
+ <para>
+ The Yocto Project uses its own implementation of
+ <ulink url='http://www.bugzilla.org/about/'>Bugzilla</ulink> to track 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.
+ The home page for the Yocto Project implementation of Bugzilla is
+ <ulink url='&YOCTO_BUGZILLA_URL;'>&YOCTO_BUGZILLA_URL;</ulink>.
+ </para>
+
+ <para>
+ Sometimes it is helpful to submit, investigate, or track a bug against the Yocto Project itself
+ such as when discovering an issue with some component of the build system that acts contrary
+ to the documentation or your expectations.
+ Following is the general procedure for submitting a new bug using the Yocto Project
+ Bugzilla.
+ You can find more information on defect management, bug tracking, and feature request
+ processes all accomplished through the Yocto Project Bugzilla on the
+ <ulink url='&YOCTO_WIKI_URL;/wiki/Bugzilla_Configuration_and_Bug_Tracking'>wiki page</ulink>.
+ <orderedlist>
+ <listitem><para>Always use the Yocto Project implementation of Bugzilla to submit
+ a bug.</para></listitem>
+ <listitem><para>When submitting a new bug, be sure to choose the appropriate
+ Classification, Product, and Component for which the issue was found.
+ Defects for the Yocto Project fall into one of seven classifications:
+ Yocto Project Components, Infrastructure, Build System &amp; Metadata,
+ Documentation, QA/Testing, Runtime and Hardware.
+ Each of these Classifications break down into multiple Products and, in some
+ cases, multiple Components.</para></listitem>
+ <listitem><para>Use the bug form to choose the correct Hardware and Architecture
+ for which the bug applies.</para></listitem>
+ <listitem><para>Indicate the Yocto Project version you were using when the issue
+ occurred.</para></listitem>
+ <listitem><para>Be sure to indicate the Severity of the bug.
+ Severity communicates how the bug impacted your work.</para></listitem>
+ <listitem><para>Select the appropriate "Documentation change" item
+ for the bug.
+ Fixing a bug may or may not affect the Yocto Project
+ documentation.</para></listitem>
+ <listitem><para>Provide a brief summary of the issue.
+ Try to limit your summary to just a line or two and be sure to capture the
+ essence of the issue.</para></listitem>
+ <listitem><para>Provide a detailed description of the issue.
+ You should provide as much detail as you can about the context, behavior, output,
+ and so forth that surrounds the issue.
+ You can even attach supporting files for output from logs by
+ using the "Add an attachment" button.</para></listitem>
+ <listitem><para>Be sure to copy the appropriate people in the
+ "CC List" for the bug.
+ See the "<link linkend='how-to-submit-a-change'>How to Submit a Change</link>"
+ section for information about finding out who is responsible
+ for code.</para></listitem>
+ <listitem><para>Submit the bug by clicking the "Submit Bug" button.</para></listitem>
+ </orderedlist>
+ </para>
+</section>
+
+<section id='how-to-submit-a-change'>
+ <title>How to Submit a Change</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.
+ You should send patches to the appropriate mailing list so that they
+ can be reviewed and merged by the appropriate maintainer.
+ </para>
+
+ <para>
+ Before submitting any change, be sure to find out who you should be
+ notifying.
+ Several methods exist through which you find out who you should be copying
+ or notifying:
+ <itemizedlist>
+ <listitem><para><emphasis>Maintenance File:</emphasis>
+ Examine the <filename>maintainers.inc</filename> file, which is
+ located in the
+ <link linkend='source-directory'>Source Directory</link>
+ at <filename>meta-poky/conf/distro/include</filename>, to
+ see who is responsible for code.
+ </para></listitem>
+ <listitem><para><emphasis>Board Support Package (BSP) README Files:</emphasis>
+ For BSP maintainers of supported BSPs, you can examine
+ individual BSP <filename>README</filename> files.
+ In addition, some layers (such as the <filename>meta-intel</filename> layer),
+ include a <filename>MAINTAINERS</filename> file which contains
+ a list of all supported BSP maintainers for that layer.
+ </para></listitem>
+ <listitem><para><emphasis>Search by File:</emphasis>
+ Using <link linkend='git'>Git</link>, 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 all committers grouped by name.
+ From the list, you can see who is responsible for the bulk of
+ the changes against the file.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ 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>
+
+ <para>
+ Here is some guidance on which mailing list to use for what type of change:
+ <itemizedlist>
+ <listitem><para>For changes to the core
+ <link linkend='metadata'>Metadata</link>, send your patch to the
+ <ulink url='&OE_LISTS_URL;/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>For changes to BitBake (anything under the <filename>bitbake</filename>
+ directory), send your patch to the
+ <ulink url='&OE_LISTS_URL;/listinfo/bitbake-devel'>bitbake-devel</ulink> mailing list.</para></listitem>
+ <listitem><para>For changes to <filename>meta-poky</filename>, send your patch to the
+ <ulink url='&YOCTO_LISTS_URL;/listinfo/poky'>poky</ulink> mailing list.</para></listitem>
+ <listitem><para>For changes to other layers hosted on
+ <filename>yoctoproject.org</filename> (unless the
+ layer's documentation specifies otherwise), tools, and Yocto Project
+ documentation, use the
+ <ulink url='&YOCTO_LISTS_URL;/listinfo/yocto'>yocto</ulink> mailing list.</para></listitem>
+ <listitem><para>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. README) supplied
+ with the layer. If in doubt, please ask on the
+ <ulink url='&YOCTO_LISTS_URL;/listinfo/yocto'>yocto</ulink> or
+ <ulink url='&OE_LISTS_URL;/listinfo/openembedded-devel'>openembedded-devel</ulink>
+ mailing lists.</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ When you send a patch, 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>
+
+ <para>
+ In a collaborative environment, it is necessary to have some sort of standard
+ or method through which you submit changes.
+ Otherwise, things could get quite chaotic.
+ One general practice to follow is to make small, controlled changes.
+ Keeping changes small and isolated aids review, makes merging/rebasing easier
+ and keeps the change history clean when anyone needs to refer to it in future.
+ </para>
+
+ <para>
+ When you make a commit, you must follow certain standards established by the
+ OpenEmbedded and Yocto Project development teams.
+ For each commit, you must provide a single-line summary of the change and you
+ should almost always provide a more detailed description of what you did (i.e.
+ the body of the commit message).
+ The only exceptions for not providing a detailed description would be if your
+ change is a simple, self-explanatory change that needs no further description
+ beyond the summary.
+ Here are the guidelines for composing a commit message:
+ <itemizedlist>
+ <listitem><para>Provide a single-line, short summary of the change.
+ 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.
+ This short description should be prefixed by the recipe name (if changing a recipe), or
+ else 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 may 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.
+ </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:
+ <literallayout class='monospaced'>
+ Fixes [YOCTO #<replaceable>bug-id</replaceable>]
+
+ <replaceable>detailed description of change</replaceable>
+ </literallayout></para></listitem>
+ Where <replaceable>bug-id</replaceable> is replaced with the
+ specific bug ID from the Yocto Project Bugzilla instance.
+ </itemizedlist>
+ </para>
+
+ <para>
+ You can find more guidance on creating well-formed commit messages at this OpenEmbedded
+ wiki page:
+ <ulink url='&OE_HOME_URL;/wiki/Commit_Patch_Message_Guidelines'></ulink>.
+ </para>
+
+ <para>
+ The next two sections describe general instructions for both pushing
+ changes upstream and for submitting changes as patches.
+ </para>
+
+ <section id='pushing-a-change-upstream'>
+ <title>Using Scripts to Push a Change Upstream and Request a Pull</title>
+
+ <para>
+ The basic flow for pushing a change to an upstream "contrib" Git repository is as follows:
+ <itemizedlist>
+ <listitem><para>Make your changes in your local Git repository.</para></listitem>
+ <listitem><para>Stage your changes by using the <filename>git add</filename>
+ command on each file you changed.</para></listitem>
+ <listitem><para>
+ Commit the change by using the
+ <filename>git commit</filename> command.
+ Be sure to provide a commit message that follows the
+ project’s commit message standards as described earlier.
+ </para></listitem>
+ <listitem><para>
+ Push the change to the upstream "contrib" repository by
+ using the <filename>git push</filename> command.
+ </para></listitem>
+ <listitem><para>Notify the maintainer that you have pushed a change by making a pull
+ request.
+ 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 <link linkend='source-directory'>Source Directory</link>.</para>
+ <para>Using these scripts correctly formats the requests without introducing any
+ whitespace or HTML formatting.
+ The maintainer that receives your patches 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>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></para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ 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>.
+ </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 list in the
+ "<link linkend='how-to-submit-a-change'>How to Submit a Change</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>
+
+ <para>
+ Here is the general procedure on how to submit a patch through email without using the
+ scripts:
+ <itemizedlist>
+ <listitem><para>Make your changes in your local Git repository.</para></listitem>
+ <listitem><para>Stage your changes by using the <filename>git add</filename>
+ command on each file you changed.</para></listitem>
+ <listitem><para>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 the earlier section
+ "<link linkend='how-to-submit-a-change'>How to Submit a Change</link>"
+ for Yocto Project commit message standards.</para></listitem>
+ <listitem><para>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.</para>
+ <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></listitem>
+ <listitem><para>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
+ the proper Git packages installed.
+ 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>config</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 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>
+ </itemizedlist>
+ </para>
+ </section>
+</section>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/import-layers/yocto-poky/documentation/dev-manual/dev-manual-qemu.xml b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-qemu.xml
new file mode 100644
index 000000000..41c18298a
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-qemu.xml
@@ -0,0 +1,433 @@
+<!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>
+ Quick EMUlator (QEMU) is an Open Source project the Yocto Project uses
+ as part of its development "tool set".
+ As such, the information in this chapter is limited to the
+ Yocto Project integration of QEMU and not QEMU in general.
+ For official information and documentation on QEMU, 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>
+
+<para>
+ This chapter provides an overview of the Yocto Project's integration of
+ QEMU, a description of how you use QEMU and its various options, running
+ under a Network File System (NFS) server, and a few tips and tricks you
+ might find helpful when using QEMU.
+</para>
+
+<section id='qemu-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.
+ </para>
+
+ <para>
+ QEMU is made available with the Yocto Project a number of ways.
+ One method is to install a Software Development Kit (SDK).
+ For more information on how to make sure you have
+ QEMU available, see the
+ <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-intro'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>.
+ </para>
+</section>
+
+<section id='qemu-running-qemu'>
+ <title>Running QEMU</title>
+
+ <para>
+ Running QEMU involves having your build environment set up, having the
+ right artifacts available, and understanding how to use the many
+ options that are available to you when you start QEMU using the
+ <filename>runqemu</filename> command.
+ </para>
+
+ <section id='qemu-setting-up-the-environment'>
+ <title>Setting Up the Environment</title>
+
+ <para>
+ You run QEMU in the same environment from which you run BitBake.
+ This means you need to source a build environment 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>).
+ </para>
+ </section>
+
+ <section id='qemu-using-the-runqemu-command'>
+ <title>Using the <filename>runqemu</filename> Command</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>*.vmdk</filename>), or a kernel image
+ (<filename>*.bin</filename>).
+ </para>
+
+ <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 "qemux86",
+ "qemux86_64", "qemuarm", "qemumips", "qemumipsel",
+ “qemumips64", "qemush4", "qemuppc", "qemumicroblaze",
+ or "qemuzynq".
+ </para></listitem>
+ <listitem><para><filename><replaceable>VM</replaceable></filename>:
+ The virtual machine image, which must be a
+ <filename>.vmdk</filename> file.
+ Use this option when you want to boot a
+ <filename>.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", "qemumips", "qemumipsel",
+ “qemumips64", "qemush4", "qemuppc", "qemumicroblaze",
+ or "qemuzynq".
+ 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>
+
+ <para>
+ For further understanding regarding option use with
+ <filename>runqemu</filename>, consider some examples.
+ </para>
+
+ <para>
+ This example starts QEMU with
+ <replaceable>MACHINE</replaceable> set to "qemux86".
+ Assuming a standard
+ <link linkend='build-directory'>Build Directory</link>,
+ <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>
+ 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>
+ 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>
+ 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>
+ This example specifies to boot a virtual machine image
+ (<filename>.vmdk</filename> file).
+ From the <filename>.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.vmdk
+ </literallayout>
+ </para>
+ </section>
+</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.
+ This section describes how to set up for running QEMU using an NFS
+ server and then how you can start and stop the server.
+ </para>
+
+ <section id='qemu-setting-up-to-use-nfs'>
+ <title>Setting Up to Use NFS</title>
+
+ <para>
+ 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
+ <filename>runqemu</filename> script.
+ The <filename>runqemu-extract-sdk</filename> takes a root
+ file system tarball and extracts it into a location that you
+ specify.
+ Then, when you run <filename>runqemu</filename>, you can specify
+ the location that has the file system to pass it to QEMU.
+ 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>
+ 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>
+ </section>
+
+ <section id='qemu-starting-and-stopping-nfs'>
+ <title>Starting and Stopping NFS</title>
+
+ <para>
+ You can manually start and stop the NFS share using these
+ commands:
+ <itemizedlist>
+ <listitem><para><emphasis><filename>start</filename>:</emphasis>
+ Starts the NFS share:
+ <literallayout class='monospaced'>
+ runqemu-export-rootfs start <replaceable>file-system-location</replaceable>
+ </literallayout>
+ </para></listitem>
+ <listitem><para><emphasis><filename>stop</filename>:</emphasis>
+ Stops the NFS share:
+ <literallayout class='monospaced'>
+ runqemu-export-rootfs stop <replaceable>file-system-location</replaceable>
+ </literallayout>
+ </para></listitem>
+ <listitem><para><emphasis><filename>restart</filename>:</emphasis>
+ Restarts the NFS share:
+ <literallayout class='monospaced'>
+ runqemu-export-rootfs restart <replaceable>file-system-location</replaceable>
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+</section>
+
+<section id='qemu-tips-and-tricks'>
+ <title>Tips and Tricks</title>
+
+ <para>
+ The following list describes things you can do to make running QEMU
+ in the context of the Yocto Project a better experience:
+ <itemizedlist>
+ <listitem><para><emphasis>Switching Between Consoles:</emphasis>
+ 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></listitem>
+ <listitem><para><emphasis>Removing the Splash Screen:</emphasis>
+ 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></listitem>
+ <listitem><para><emphasis>Disabling the Cursor Grab:</emphasis>
+ 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></listitem>
+ </itemizedlist>
+ </para>
+</section>
+
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/import-layers/yocto-poky/documentation/dev-manual/dev-manual-start.xml b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-start.xml
new file mode 100644
index 000000000..23bf8eb0e
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/dev-manual/dev-manual-start.xml
@@ -0,0 +1,435 @@
+<!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>Getting Started with the Yocto Project</title>
+
+<para>
+ This chapter introduces the Yocto Project and gives you an idea of what you need to get started.
+ You can find enough information to set up your development host and build or use images for
+ hardware supported by the Yocto Project by reading the
+ <ulink url='&YOCTO_DOCS_QS_URL;'>Yocto Project Quick Start</ulink>.
+</para>
+
+<para>
+ The remainder of this chapter summarizes what is in the Yocto Project Quick Start and provides
+ some higher-level concepts you might want to consider.
+</para>
+
+<section id='introducing-the-yocto-project'>
+ <title>Introducing the Yocto Project</title>
+
+ <para>
+ The Yocto Project is an open-source collaboration project focused on embedded Linux development.
+ The project currently provides a build system that is
+ referred to as the
+ <link linkend='build-system-term'>OpenEmbedded build system</link>
+ in the Yocto Project documentation.
+ The Yocto Project provides various ancillary tools for the embedded developer
+ and also features the Sato reference User Interface, which is optimized for
+ stylus-driven, low-resolution screens.
+ </para>
+
+ <para>
+ You can use the OpenEmbedded build system, which uses
+ <link linkend='bitbake-term'>BitBake</link>, to develop complete Linux
+ images and associated user-space applications for architectures based
+ on ARM, MIPS, PowerPC, x86 and x86-64.
+ <note>
+ By default, using the Yocto Project creates a Poky distribution.
+ However, you can create your own distribution by providing key
+ <link linkend='metadata'>Metadata</link>.
+ See the "<link linkend='creating-your-own-distribution'>Creating Your Own Distribution</link>"
+ section for more information.
+ </note>
+ While the Yocto Project does not provide a strict testing framework,
+ it does provide or generate for you artifacts that let you perform target-level and
+ emulated testing and debugging.
+ Additionally, if you are an <trademark class='trade'>Eclipse</trademark>
+ IDE user, you can install an Eclipse Yocto Plug-in to allow you to
+ develop within that familiar environment.
+ </para>
+</section>
+
+<section id='getting-setup'>
+ <title>Getting Set Up</title>
+
+ <para>
+ Here is what you need to use the Yocto Project:
+ <itemizedlist>
+ <listitem><para><emphasis>Host System:</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>
+ <para>
+ You should also have about 50 Gbytes of free disk space for building images.
+ </para></listitem>
+ <listitem><para><emphasis>Packages:</emphasis> The OpenEmbedded build system
+ requires that certain packages exist on your development system (e.g. Python 2.7).
+ See "<ulink url='&YOCTO_DOCS_QS_URL;#packages'>The Build Host Packages</ulink>"
+ section in the Yocto Project Quick Start and 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 for the exact
+ package requirements and the installation commands to install
+ them for the supported distributions.
+ </para></listitem>
+ <listitem id='local-yp-release'><para><emphasis>Yocto Project Release:</emphasis>
+ You need a release of the Yocto Project locally installed on
+ your development system.
+ The documentation refers to this set of locally installed files
+ as the <link linkend='source-directory'>Source Directory</link>.
+ You create your Source Directory by using
+ <link linkend='git'>Git</link> to clone a local copy
+ of the upstream <filename>poky</filename> repository,
+ or by downloading and unpacking a tarball of an official
+ Yocto Project release.
+ The preferred method is to create a clone of the repository.
+ </para>
+ <para>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>
+ <note>You can view the Yocto Project Source Repositories at
+ <ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>
+ </note>
+ <para>The following transcript shows how to clone the
+ <filename>poky</filename> Git repository into the current
+ working directory.
+ The command creates the local repository in a directory
+ named <filename>poky</filename>.
+ For information on Git used within the Yocto Project, see
+ the "<link linkend='git'>Git</link>" section.
+ <literallayout class='monospaced'>
+ $ git clone git://git.yoctoproject.org/poky
+ Cloning into 'poky'...
+ remote: Counting objects: 226790, done.
+ remote: Compressing objects: 100% (57465/57465), done.
+ remote: Total 226790 (delta 165212), reused 225887 (delta 164327)
+ Receiving objects: 100% (226790/226790), 100.98 MiB | 263 KiB/s, done.
+ Resolving deltas: 100% (165212/165212), done.
+ </literallayout></para>
+ <para>For another example of how to set up your own local Git
+ repositories, see this
+ <ulink url='&YOCTO_WIKI_URL;/wiki/Transcript:_from_git_checkout_to_meta-intel_BSP'>
+ wiki page</ulink>, which describes how to create local
+ Git repositories for both
+ <filename>poky</filename> and <filename>meta-intel</filename>.
+ </para>
+ <para>
+ You can also get the Yocto Project Files by downloading
+ Yocto Project releases from the
+ <ulink url="&YOCTO_HOME_URL;">Yocto Project website</ulink>.
+ From the website, you just click "Downloads" in the navigation
+ pane to the left to display all Yocto Project downloads.
+ Current and archived releases are available for download.
+ Nightly and developmental builds are also maintained at
+ <ulink url="&YOCTO_AB_NIGHTLY_URL;"></ulink>.
+ One final site you can visit for information on Yocto Project
+ releases is the
+ <ulink url='&YOCTO_WIKI_URL;/wiki/Releases'>Releases</ulink>
+ wiki.
+ </para></listitem>
+ <listitem id='local-kernel-files'><para><emphasis>Yocto Project Kernel:</emphasis>
+ If you are going to be making modifications to a supported Yocto Project kernel, you
+ need to establish local copies of the source.
+ 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;/cgit.cgi'></ulink>.</para>
+ <para>This setup can involve creating a bare clone of the Yocto Project kernel and then
+ copying that cloned repository.
+ You can create the bare clone and the copy of the bare clone anywhere you like.
+ For simplicity, it is recommended that you create these structures outside of the
+ Source Directory, which is usually named <filename>poky</filename>.</para>
+ <para>As an example, the following transcript shows how to create the bare clone
+ of the <filename>linux-yocto-3.19</filename> kernel and then create a copy of
+ that clone.
+ <note>When you have a local Yocto Project kernel Git repository, you can
+ reference that repository rather than the upstream Git repository as
+ part of the <filename>clone</filename> command.
+ Doing so can speed up the process.</note></para>
+ <para>In the following example, the bare clone is named
+ <filename>linux-yocto-3.19.git</filename>, while the
+ copy is named <filename>my-linux-yocto-3.19-work</filename>:
+ <literallayout class='monospaced'>
+ $ git clone --bare git://git.yoctoproject.org/linux-yocto-3.19 linux-yocto-3.19.git
+ Cloning into bare repository 'linux-yocto-3.19.git'...
+ remote: Counting objects: 3983256, done.
+ remote: Compressing objects: 100% (605006/605006), done.
+ remote: Total 3983256 (delta 3352832), reused 3974503 (delta 3344079)
+ Receiving objects: 100% (3983256/3983256), 843.66 MiB | 1.07 MiB/s, done.
+ Resolving deltas: 100% (3352832/3352832), done.
+ Checking connectivity... done.
+ </literallayout></para>
+ <para>Now create a clone of the bare clone just created:
+ <literallayout class='monospaced'>
+ $ git clone linux-yocto-3.19.git my-linux-yocto-3.19-work
+ Cloning into 'my-linux-yocto-3.19-work'...
+ done.
+ Checking out files: 100% (48440/48440), done.
+ </literallayout></para></listitem>
+ <listitem id='meta-yocto-kernel-extras-repo'><para><emphasis>
+ The <filename>meta-yocto-kernel-extras</filename> Git Repository</emphasis>:
+ The <filename>meta-yocto-kernel-extras</filename> Git repository contains Metadata needed
+ only if you are modifying and building the kernel image.
+ In particular, it contains the kernel BitBake append (<filename>.bbappend</filename>)
+ files that you
+ edit to point to your locally modified kernel source files and to build the kernel
+ image.
+ Pointing to these local files is much more efficient than requiring a download of the
+ kernel's source files from upstream each time you make changes to the kernel.</para>
+ <para>You can find the <filename>meta-yocto-kernel-extras</filename> Git Repository in the
+ "Yocto Metadata Layers" area of the Yocto Project Source Repositories at
+ <ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>.
+ It is good practice to create this Git repository inside the Source Directory.</para>
+ <para>Following is an example that creates the <filename>meta-yocto-kernel-extras</filename> Git
+ repository inside the Source Directory, which is named <filename>poky</filename>
+ in this case:
+ <literallayout class='monospaced'>
+ $ cd ~/poky
+ $ git clone git://git.yoctoproject.org/meta-yocto-kernel-extras meta-yocto-kernel-extras
+ Cloning into 'meta-yocto-kernel-extras'...
+ remote: Counting objects: 727, done.
+ remote: Compressing objects: 100% (452/452), done.
+ remote: Total 727 (delta 260), reused 719 (delta 252)
+ Receiving objects: 100% (727/727), 536.36 KiB | 240 KiB/s, done.
+ Resolving deltas: 100% (260/260), done.
+ </literallayout></para></listitem>
+ <listitem><para id='supported-board-support-packages-(bsps)'><emphasis>Supported Board Support Packages (BSPs):</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>
+
+ <para>The Yocto Project uses the following BSP layer naming
+ scheme:
+ <literallayout class='monospaced'>
+ meta-<replaceable>bsp_name</replaceable>
+ </literallayout>
+ where <replaceable>bsp_name</replaceable> is the recognized
+ BSP name.
+ Here is an example:
+ <literallayout class='monospaced'>
+ meta-raspberrypi
+ </literallayout>
+ See the
+ "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>"
+ section in the Yocto Project Board Support Package (BSP)
+ Developer's Guide for more information on BSP Layers.</para>
+
+ <para>A useful Git repository released with the Yocto
+ Project is <filename>meta-intel</filename>, which is a
+ parent layer that contains many supported
+ <ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>.
+ You can locate the <filename>meta-intel</filename> Git
+ repository in the "Yocto Metadata Layers" area of the Yocto
+ Project Source Repositories at
+ <ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>.</para>
+
+ <para>Using
+ <link linkend='git'>Git</link> to create a local clone of the
+ upstream repository can be helpful if you are working with
+ BSPs.
+ Typically, you set up the <filename>meta-intel</filename>
+ Git repository inside the Source Directory.
+ For example, the following transcript shows the steps to clone
+ <filename>meta-intel</filename>.
+ <note>
+ Be sure to work in the <filename>meta-intel</filename>
+ branch that matches your
+ <link linkend='source-directory'>Source Directory</link>
+ (i.e. <filename>poky</filename>) branch.
+ 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>.
+ </note>
+ <literallayout class='monospaced'>
+ $ cd ~/poky
+ $ git clone git://git.yoctoproject.org/meta-intel.git
+ Cloning into 'meta-intel'...
+ remote: Counting objects: 11917, done.
+ remote: Compressing objects: 100% (3842/3842), done.
+ remote: Total 11917 (delta 6840), reused 11699 (delta 6622)
+ Receiving objects: 100% (11917/11917), 2.92 MiB | 2.88 MiB/s, done.
+ Resolving deltas: 100% (6840/6840), done.
+ Checking connectivity... done.
+ </literallayout></para>
+
+ <para>The same
+ <ulink url='&YOCTO_WIKI_URL;/wiki/Transcript:_from_git_checkout_to_meta-intel_BSP'>wiki page</ulink>
+ referenced earlier covers how to set up the
+ <filename>meta-intel</filename> Git repository.
+ </para></listitem>
+ <listitem><para><emphasis>Eclipse Yocto Plug-in:</emphasis> If you are developing
+ applications using the Eclipse Integrated Development Environment (IDE),
+ you will need this plug-in.
+ See the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#setting-up-the-eclipse-ide'>Setting up the Eclipse IDE</ulink>"
+ section in the Yocto Project Software Development Kit (SDK)
+ Developer's Guide for more information.</para></listitem>
+ </itemizedlist>
+ </para>
+</section>
+
+<section id='building-images'>
+ <title>Building Images</title>
+
+ <para>
+ The build process creates an entire Linux distribution, including the toolchain, from source.
+ For more information on this topic, see the
+ "<ulink url='&YOCTO_DOCS_QS_URL;#qs-building-images'>Building Images</ulink>"
+ section in the Yocto Project Quick Start.
+ </para>
+
+ <para>
+ The build process is as follows:
+ <orderedlist>
+ <listitem><para>Make sure you have set up the Source Directory described in the
+ previous section.</para></listitem>
+ <listitem><para>Initialize the build environment by sourcing a build
+ environment 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>).
+ </para></listitem>
+ <listitem><para>Optionally ensure the <filename>conf/local.conf</filename> configuration file,
+ which is found in the
+ <link linkend='build-directory'>Build Directory</link>,
+ 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
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-DL_DIR'>DL_DIR</ulink></filename> variable.</para></listitem>
+ <listitem><para>
+ Build the image using the <filename>bitbake</filename> command.
+ If you want information on BitBake, see the
+ <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>.
+ </para></listitem>
+ <listitem><para>Run the image either on the actual hardware or using the QEMU
+ emulator.</para></listitem>
+ </orderedlist>
+ </para>
+</section>
+
+<section id='using-pre-built-binaries-and-qemu'>
+ <title>Using Pre-Built Binaries and QEMU</title>
+
+ <para>
+ Another option you have to get started is to use pre-built binaries.
+ The Yocto Project provides many types of binaries with each release.
+ See the "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>"
+ chapter in the Yocto Project Reference Manual
+ for descriptions of the types of binaries that ship with a Yocto Project
+ release.
+ </para>
+
+ <para>
+ Using a pre-built binary is ideal for developing software
+ applications to run on your target hardware.
+ To do this, you need to be able to access the appropriate
+ cross-toolchain tarball for the architecture on which you are
+ developing.
+ If you are using an SDK type image, the image ships with the complete
+ toolchain native to the architecture (i.e. a toolchain designed to
+ run on the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDKMACHINE'><filename>SDKMACHINE</filename></ulink>).
+ If you are not using an SDK type image, you need to separately download
+ and install the stand-alone Yocto Project cross-toolchain tarball.
+ </para>
+
+ <para>
+ Regardless of the type of image you are using, you need to download the pre-built kernel
+ that you will boot in the QEMU emulator and then download and extract the target root
+ filesystem for your target machine’s architecture.
+ You can get architecture-specific binaries and file systems from
+ <ulink url='&YOCTO_MACHINES_DL_URL;'>machines</ulink>.
+ You can get installation scripts for stand-alone toolchains from
+ <ulink url='&YOCTO_TOOLCHAIN_DL_URL;'>toolchains</ulink>.
+ Once you have all your files, you set up the environment to emulate the hardware
+ by sourcing an environment setup script.
+ Finally, you start the QEMU emulator.
+ You can find details on all these steps in the
+ <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-manual'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>.
+ You can learn more about using QEMU with the Yocto Project in the
+ "<link linkend='dev-manual-qemu'>Using the Quick EMUlator (QEMU)</link>"
+ section.
+ </para>
+
+ <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.
+ </para>
+
+ <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.</para></listitem>
+ </itemizedlist>
+ </note>
+</section>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/import-layers/yocto-poky/documentation/dev-manual/dev-manual.xml b/import-layers/yocto-poky/documentation/dev-manual/dev-manual.xml
new file mode 100644
index 000000000..791a8cb6a
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/dev-manual/dev-manual.xml
@@ -0,0 +1,129 @@
+<!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 Manual
+ </title>
+
+ <authorgroup>
+ <author>
+ <firstname>Scott</firstname> <surname>Rifenbark</surname>
+ <affiliation>
+ <orgname>Intel Corporation</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>
+ </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_DEV_URL;'>Yocto Project Development Manual</ulink>
+ from the Yocto Project website.
+ </note>
+ </legalnotice>
+
+ </bookinfo>
+
+ <xi:include href="dev-manual-intro.xml"/>
+
+ <xi:include href="dev-manual-start.xml"/>
+
+ <xi:include href="dev-manual-newbie.xml"/>
+
+ <xi:include href="dev-manual-model.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/import-layers/yocto-poky/documentation/dev-manual/dev-style.css b/import-layers/yocto-poky/documentation/dev-manual/dev-style.css
new file mode 100644
index 000000000..6d0aa8e9f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/dev-manual/figures/bsp-dev-flow.png b/import-layers/yocto-poky/documentation/dev-manual/figures/bsp-dev-flow.png
new file mode 100644
index 000000000..540b0abb9
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/dev-manual/figures/bsp-dev-flow.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/dev-manual/figures/build-workspace-directory.png b/import-layers/yocto-poky/documentation/dev-manual/figures/build-workspace-directory.png
new file mode 100644
index 000000000..5387d33f0
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/dev-manual/figures/build-workspace-directory.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/dev-manual/figures/dev-title.png b/import-layers/yocto-poky/documentation/dev-manual/figures/dev-title.png
new file mode 100644
index 000000000..d3cac4a7e
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/dev-manual/figures/dev-title.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/dev-manual/figures/devtool-add-flow.png b/import-layers/yocto-poky/documentation/dev-manual/figures/devtool-add-flow.png
new file mode 100644
index 000000000..c09e60e35
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/dev-manual/figures/devtool-add-flow.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/dev-manual/figures/devtool-modify-flow.png b/import-layers/yocto-poky/documentation/dev-manual/figures/devtool-modify-flow.png
new file mode 100644
index 000000000..cd7f4d05b
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/dev-manual/figures/devtool-modify-flow.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/dev-manual/figures/devtool-upgrade-flow.png b/import-layers/yocto-poky/documentation/dev-manual/figures/devtool-upgrade-flow.png
new file mode 100644
index 000000000..d25168c84
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/dev-manual/figures/devtool-upgrade-flow.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/dev-manual/figures/git-workflow.png b/import-layers/yocto-poky/documentation/dev-manual/figures/git-workflow.png
new file mode 100644
index 000000000..e401330a1
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/dev-manual/figures/git-workflow.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/dev-manual/figures/index-downloads.png b/import-layers/yocto-poky/documentation/dev-manual/figures/index-downloads.png
new file mode 100644
index 000000000..41251d5d1
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/dev-manual/figures/index-downloads.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/dev-manual/figures/kernel-dev-flow.png b/import-layers/yocto-poky/documentation/dev-manual/figures/kernel-dev-flow.png
new file mode 100644
index 000000000..009105d12
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/dev-manual/figures/kernel-dev-flow.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/dev-manual/figures/kernel-overview-1.png b/import-layers/yocto-poky/documentation/dev-manual/figures/kernel-overview-1.png
new file mode 100644
index 000000000..116c0b9bd
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/dev-manual/figures/kernel-overview-1.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/dev-manual/figures/kernel-overview-2-generic.png b/import-layers/yocto-poky/documentation/dev-manual/figures/kernel-overview-2-generic.png
new file mode 100644
index 000000000..cb970eae7
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/dev-manual/figures/kernel-overview-2-generic.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/dev-manual/figures/recipe-workflow.png b/import-layers/yocto-poky/documentation/dev-manual/figures/recipe-workflow.png
new file mode 100644
index 000000000..c0e960b13
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/dev-manual/figures/recipe-workflow.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/dev-manual/figures/source-repos.png b/import-layers/yocto-poky/documentation/dev-manual/figures/source-repos.png
new file mode 100644
index 000000000..65c5f29a4
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/dev-manual/figures/source-repos.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/dev-manual/figures/yp-download.png b/import-layers/yocto-poky/documentation/dev-manual/figures/yp-download.png
new file mode 100644
index 000000000..5770be688
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/dev-manual/figures/yp-download.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/kernel-dev/figures/kernel-architecture-overview.png b/import-layers/yocto-poky/documentation/kernel-dev/figures/kernel-architecture-overview.png
new file mode 100755
index 000000000..2aad172db
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/kernel-dev/figures/kernel-architecture-overview.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/kernel-dev/figures/kernel-dev-title.png b/import-layers/yocto-poky/documentation/kernel-dev/figures/kernel-dev-title.png
new file mode 100644
index 000000000..7a8dd5437
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/kernel-dev/figures/kernel-dev-title.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-advanced.xml b/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-advanced.xml
new file mode 100644
index 000000000..9e15f178a
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-advanced.xml
@@ -0,0 +1,1101 @@
+<!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</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_DEV_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, known as
+ the kern-tools (<filename>kern-tools-native_git.bb</filename>), is
+ to help you manage the complexity of the configuration and sources
+ used to support multiple BSPs and Linux kernel types.
+ </para>
+</section>
+
+<section id='using-kernel-metadata-in-a-recipe'>
+ <title>Using Kernel Metadata in a Recipe</title>
+
+ <para>
+ The kernel sources in the Yocto Project contain kernel Metadata, which
+ is located in the <filename>meta</filename> branches of the kernel
+ source Git repositories.
+ This Metadata defines Board Support Packages (BSPs) that
+ correspond to definitions in linux-yocto recipes for the same 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>
+ Linux kernel source that contains kernel Metadata is said to be
+ "linux-yocto style" kernel source.
+ A Linux kernel recipe that inherits from the
+ <filename>linux-yocto.inc</filename> include 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
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
+ variable, which is used by
+ <ulink url='&YOCTO_DOCS_DEV_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.
+ The "ep108-zynqmp" and "qemuzynqmp" BSP combination
+ in the <filename>meta-xilinx</filename>
+ layer is a good example of two BSPs using the same
+ <filename>KMACHINE</filename> value (i.e. "zynqmp").
+ 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-emenlow</filename> layer:
+ <literallayout class='monospaced'>
+ KBRANCH_emenlow-noemgd = "standard/base"
+ </literallayout>
+ </note>
+ </para>
+
+ <para>
+ The linux-yocto style recipes can optionally define the following
+ variables:
+ <literallayout class='monospaced'>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KERNEL_FEATURES'>KERNEL_FEATURES</ulink>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LINUX_KERNEL_TYPE'>LINUX_KERNEL_TYPE</ulink>
+ </literallayout>
+ </para>
+
+ <para>
+ <filename>LINUX_KERNEL_TYPE</filename> 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
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KMACHINE'><filename>KMACHINE</filename></ulink>,
+ <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 such as
+ the following:
+ <literallayout class='monospaced'>
+ WARNING: Can't find any BSP hardware or required configuration fragments.
+ WARNING: Looked at meta/cfg/broken/emenlow-broken/hdw_frags.txt and
+ meta/cfg/broken/emenlow-broken/required_frags.txt in directory:
+ meta/cfg/broken/emenlow-broken
+ </literallayout>
+ In this example, <filename>KMACHINE</filename> was set to "emenlow-broken"
+ and <filename>LINUX_KERNEL_TYPE</filename> was set to "broken".
+ </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 <filename>KERNEL_FEATURES</filename> 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>meta</filename>
+ branch of the <filename>linux-yocto-3.19</filename> repository.
+ Within that branch, "features" and "cfg" are subdirectories of the
+ <filename>meta/cfg/kernel-cache</filename> directory.
+ For more information, see the
+ "<link linkend='kernel-metadata-syntax'>Kernel Metadata Syntax</link>" section.
+ <note>
+ The processing of the these variables has evolved some between the
+ 0.9 and 1.3 releases of the Yocto Project and associated
+ kern-tools sources.
+ The descriptions in this section are accurate for 1.3 and later
+ releases of the Yocto Project.
+ </note>
+ </para>
+</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>
+ </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 "ktype=meta" 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.4.bb</filename>
+ kernel recipe:
+ <literallayout class='monospaced'>
+ SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.4.git;name=machine;branch=${KBRANCH}; \
+ git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.4;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.
+ </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>
+ Following is an example that shows how a trivial tree of Metadata
+ is stored in a custom Linux kernel Git repository:
+ <literallayout class='monospaced'>
+ meta/
+ `&dash;&dash; cfg
+ `&dash;&dash; kernel-cache
+ |&dash;&dash; bsp-standard.scc
+ |&dash;&dash; bsp.cfg
+ `&dash;&dash; standard.cfg
+ </literallayout>
+ </para>
+
+ <para>
+ To use a branch different from where the sources reside,
+ specify the branch in the <filename>KMETA</filename> variable
+ in your Linux kernel recipe.
+ Here is an example:
+ <literallayout class='monospaced'>
+ KMETA = "meta"
+ </literallayout>
+ To use the same branch as the sources, set
+ <filename>KMETA</filename> to an empty string:
+ <literallayout class='monospaced'>
+ KMETA = ""
+ </literallayout>
+ If you are working with your own sources and want to create an
+ orphan <filename>meta</filename> branch, use these commands
+ from within your Linux kernel Git repository:
+ <literallayout class='monospaced'>
+ $ git checkout &dash;&dash;orphan meta
+ $ git rm -rf .
+ $ git commit &dash;&dash;allow-empty -m "Create orphan meta branch"
+ </literallayout>
+ </para>
+-->
+
+ <para>
+ If you modify the Metadata, you must not forget to update the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRCREV'><filename>SRCREV</filename></ulink>
+ 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='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
+ <filename>&lt;base&gt;</filename>, 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 <filename>meta/cfg/kernel-cache/</filename> 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>
+ The Symmetric Multi-Processing (SMP) fragment included in the
+ <filename>linux-yocto-3.19</filename> Git repository
+ consists of the following two files:
+ <literallayout class='monospaced'>
+ cfg/smp.scc:
+ define KFEATURE_DESCRIPTION "Enable SMP"
+ 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
+ </literallayout>
+ You can find information on configuration fragment files in the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-config-fragments'>Creating Configuration Fragments</ulink>"
+ section of the Yocto Project Development Manual and in
+ the "<link linkend='generating-configuration-files'>Generating Configuration Files</link>"
+ section earlier in this manual.
+ </para>
+
+ <para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KFEATURE_DESCRIPTION'><filename>KFEATURE_DESCRIPTION</filename></ulink>
+ provides a short description of the fragment.
+ Higher level kernel tools use this description.
+ </para>
+
+ <para>
+ The <filename>kconf</filename> command is used to include 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='generating-configuration-files'>Generating Configuration Files</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.
+ </para>
+
+ <para>
+ A typical patch includes a description file and the patch itself:
+ <literallayout class='monospaced'>
+ patches/mypatch.scc:
+ patch mypatch.patch
+
+ patches/mypatch.patch:
+ <replaceable>typical-patch</replaceable>
+ </literallayout>
+ You can create the typical <filename>.patch</filename>
+ file using <filename>diff -Nurp</filename> or
+ <filename>git format-patch</filename>.
+ </para>
+
+ <para>
+ The description file can include multiple patch statements,
+ one per patch.
+ </para>
+ </section>
+
+ <section id='features'>
+ <title>Features</title>
+
+ <para>
+ Features are complex kernel Metadata types that consist
+ of configuration fragments (<filename>kconf</filename>), patches
+ (<filename>patch</filename>), and possibly other feature
+ description files (<filename>include</filename>).
+ </para>
+
+ <para>
+ Here is an example that shows a feature description file:
+ <literallayout class='monospaced'>
+ features/myfeature.scc
+ define KFEATURE_DESCRIPTION "Enable myfeature"
+
+ patch 0001-myfeature-core.patch
+ patch 0002-myfeature-interface.patch
+
+ include cfg/myfeature_dependency.scc
+ kconf non-hardware myfeature.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.
+ </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 kernels of a
+ specific type.
+ Syntactically, kernel types are no different than features
+ as described in the "<link linkend='features'>Features</link>"
+ section.
+ The <filename>LINUX_KERNEL_TYPE</filename> variable in the kernel
+ recipe selects the kernel type.
+ See the "<link linkend='using-kernel-metadata-in-a-recipe'>Using Kernel Metadata in a Recipe</link>"
+ section for more information.
+ </para>
+
+ <para>
+ As an example, the <filename>linux-yocto-3.19</filename>
+ tree defines three kernel types: "standard",
+ "tiny", and "preempt-rt":
+ <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>
+ The "standard" kernel type is defined by
+ <filename>standard.scc</filename>:
+ <literallayout class='monospaced'>
+ # Include this kernel type fragment to get the standard features and
+ # configuration values.
+
+ # Include all standard features
+ include standard-nocfg.scc
+
+ kconf non-hardware standard.cfg
+
+ # individual cfg block section
+ include cfg/fs/devtmpfs.scc
+ include cfg/fs/debugfs.scc
+ include cfg/fs/btrfs.scc
+ include cfg/fs/ext2.scc
+ include cfg/fs/ext3.scc
+ include cfg/fs/ext4.scc
+
+ include cfg/net/ipv6.scc
+ include cfg/net/ip_nf.scc
+ include cfg/net/ip6_nf.scc
+ include cfg/net/bridge.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 combine kernel types with hardware-specific
+ features.
+ The hardware-specific portion is typically defined
+ independently, and then aggregated with each supported kernel
+ type.
+ Consider this simple BSP description that supports the
+ <replaceable>mybsp</replaceable> machine:
+ <literallayout class='monospaced'>
+ <replaceable>mybsp</replaceable>.scc:
+ define KMACHINE <replaceable>mybsp</replaceable>
+ define KTYPE standard
+ define KARCH i386
+
+ kconf <replaceable>mybsp</replaceable>.cfg
+ </literallayout>
+ Every BSP description 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 simple example supports the "mybsp" machine for the "standard"
+ kernel and the "i386" 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 kernel types defined in your kernel
+ Metadata, you only need to ensure that the kernel recipe's
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LINUX_KERNEL_TYPE'><filename>LINUX_KERNEL_TYPE</filename></ulink>
+ variable and the <filename>KTYPE</filename> variable in the
+ BSP description file match.
+ <note>
+ Future versions of the tooling make the specification of
+ <filename>KTYPE</filename> in the BSP optional.
+ </note>
+ </para>
+
+ <para>
+ If you did want to separate your kernel policy from your
+ hardware configuration, you could do so by specifying a kernel
+ type, such as "standard" and including that description file
+ in the BSP description file.
+ See the "<link linkend='kernel-types'>Kernel Types</link>" section
+ for more information.
+ </para>
+
+ <para>
+ You might also have multiple hardware configurations that you
+ aggregate into a single hardware description file that you
+ could include in the BSP description file, rather than referencing
+ a single <filename>.cfg</filename> file.
+ Consider the following:
+ <literallayout class='monospaced'>
+ <replaceable>mybsp</replaceable>.scc:
+ define KMACHINE mybsp
+ define KTYPE standard
+ define KARCH i386
+
+ include standard.scc
+ include <replaceable>mybsp</replaceable>-hw.scc
+ </literallayout>
+ </para>
+
+ <para>
+ In the above example, <filename>standard.scc</filename>
+ aggregates all the configuration fragments, patches, and
+ features that make up your standard kernel policy whereas
+ <replaceable>mybsp</replaceable><filename>-hw.scc</filename>
+ aggregates all those necessary
+ to support the hardware available on the
+ <replaceable>mybsp</replaceable> machine.
+ For information on how to break a complete
+ <filename>.config</filename> file into the various
+ configuration fragments, see the
+ "<link linkend='generating-configuration-files'>Generating Configuration Files</link>"
+ section.
+ </para>
+
+ <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 from the
+ <filename>linux-yocto-3.19</filename>
+ Git repository:
+ <literallayout class='monospaced'>
+ minnow.scc:
+ 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 cfg/timer/rtc.scc
+ include features/leds/leds.scc
+ include features/spi/spidev.scc
+ include features/i2c/i2cdev.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 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:
+ <literallayout class='monospaced'>
+ minnow-standard.scc:
+ 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 hardware enablements 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:
+ <literallayout class='monospaced'>
+ minnow-tiny.scc:
+ 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:
+ <filename>KMACHINE</filename>, <filename>KTYPE</filename>,
+ and <filename>KARCH</filename>.
+ Of these variables, only the <filename>KTYPE</filename> has changed.
+ It is now set to "tiny".
+ </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 linux-yocto Linux
+ kernel 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 <filename>KMACHINE</filename>,
+ <filename>KTYPE</filename>, <filename>KARCH</filename>,
+ and <filename>KFEATURE_DESCRIPTION</filename>.</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/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-common.xml b/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-common.xml
new file mode 100644
index 000000000..261471c46
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-common.xml
@@ -0,0 +1,1159 @@
+<!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 a layer, modifying an existing recipe,
+ 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
+ 1.2.2 Release and forward.
+ </note>
+</para>
+
+ <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_DEV_URL;#bitbake-term'>BitBake</ulink>
+ append files
+ (<filename>.bbappend</filename>) and provides a convenient
+ mechanism to create your own recipe files
+ (<filename>.bb</filename>).
+ For details on how to create and work with layers, see the following
+ sections in the Yocto Project Development Manual:
+ <itemizedlist>
+ <listitem><para>"<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and Creating Layers</ulink>" for
+ general information on layers and how to create layers.</para></listitem>
+ <listitem><para>"<ulink url='&YOCTO_DOCS_DEV_URL;#set-up-your-layer-for-the-build'>Set Up Your Layer for the Build</ulink>" for
+ specific instructions on setting up a layer for kernel
+ development.</para></listitem>
+ </itemizedlist>
+ </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_DEV_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 some general resources.
+ You can also see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#set-up-your-layer-for-the-build'>Set Up Your Layer for the Build</ulink>" section
+ of the Yocto Project Development Manual for a detailed
+ example.
+ </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_3.19.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_3.19.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>
+ </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, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#patching-the-kernel'>Patching the Kernel</ulink>"
+ section in the Yocto Project Development Manual.
+ </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
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#configuring-the-kernel'>Configuring the Kernel</ulink>"
+ section in the Yocto Project Development Manual.
+ </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,
+ edit the recipe that builds your kernel so that it has the
+ following command form:
+ <literallayout class='monospaced'>
+ KBUILD_DEFCONFIG_KMACHINE ?= <replaceable>defconfig_file</replaceable>
+ </literallayout>
+ You need to append the variable with
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KMACHINE'><filename>KMACHINE</filename></ulink>
+ and then supply the path to your "in-tree"
+ <filename>defconfig</filename> file.
+ </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-an-iterative-development-process'>
+ <title>Using an Iterative Development Process</title>
+
+ <para>
+ If you do not have existing patches or configuration files,
+ you can iteratively generate them from within the BitBake build
+ environment as described within this section.
+ During an iterative workflow, running a previously completed BitBake
+ task causes BitBake to invalidate the tasks that follow the
+ completed task in the build sequence.
+ Invalidated tasks rebuild the next time you run the build using
+ BitBake.
+ </para>
+
+ <para>
+ As you read this section, be sure to substitute the name
+ of your Linux kernel recipe for the term
+ "linux-yocto".
+ </para>
+
+ <section id='tip-dirty-string'>
+ <title>"-dirty" String</title>
+
+<!--
+ <para>
+ <emphasis>AR - Darren Hart:</emphasis> This section
+ originated from the old Yocto Project Kernel Architecture
+ and Use Manual.
+ It was decided we need to put it in this section here.
+ Darren needs to figure out where we want it and what part
+ of it we want (all, revision???)
+ </para>
+-->
+
+ <para>
+ If kernel images are being built with "-dirty" on the
+ end of the version string, this simply means that
+ modifications in the source directory have not been committed.
+ <literallayout class='monospaced'>
+ $ git status
+ </literallayout>
+ </para>
+
+ <para>
+ You can use the above Git command to report modified,
+ removed, or added files.
+ You should commit those changes to the tree regardless of
+ whether they will be saved, exported, or used.
+ Once you commit the changes, you need to rebuild the kernel.
+ </para>
+
+ <para>
+ To force a pickup and commit of all such pending changes,
+ enter the following:
+ <literallayout class='monospaced'>
+ $ git add .
+ $ git commit -s -a -m "getting rid of -dirty"
+ </literallayout>
+ </para>
+
+ <para>
+ Next, rebuild the kernel.
+ </para>
+ </section>
+
+ <section id='generating-configuration-files'>
+ <title>Generating Configuration Files</title>
+
+ <para>
+ You can manipulate the <filename>.config</filename> file
+ used to build a linux-yocto recipe with the
+ <filename>menuconfig</filename> command as follows:
+ <literallayout class='monospaced'>
+ $ bitbake linux-yocto -c menuconfig
+ </literallayout>
+ This command starts the Linux kernel configuration tool,
+ which allows you to prepare a new
+ <filename>.config</filename> file for the build.
+ When you exit the tool, be sure to save your changes
+ at the prompt.
+ </para>
+
+ <para>
+ The resulting <filename>.config</filename> file is
+ located in
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink><filename>}</filename> under the
+ <filename>linux-${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_ARCH'><filename>PACKAGE_ARCH</filename></ulink><filename>}-${<ulink url='&YOCTO_DOCS_REF_URL;#var-LINUX_KERNEL_TYPE'><filename>LINUX_KERNEL_TYPE</filename></ulink>}-build</filename> directory.
+ You can use the entire <filename>.config</filename> file as the
+ <filename>defconfig</filename> file as described in the
+ "<link linkend='changing-the-configuration'>Changing the Configuration</link>" section.
+ For more information on the <filename>.config</filename> file,
+ see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#using-menuconfig'>Using <filename>menuconfig</filename></ulink>"
+ section in the Yocto Project Development Manual.
+ </para>
+
+ <para>
+ A better 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>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 will be creating a
+ <filename>.config</filename> file from a known state.
+ Because situations exist where your build state might
+ become unknown, it is best to run the previous
+ command prior to starting up
+ <filename>menuconfig</filename>.
+ </para></listitem>
+ <listitem><para>Run the <filename>menuconfig</filename>
+ command:
+ <literallayout class='monospaced'>
+ $ bitbake linux-yocto -c menuconfig
+ </literallayout></para></listitem>
+ <listitem><para>Run the <filename>diffconfig</filename>
+ command to prepare a configuration fragment.
+ The resulting file <filename>fragment.cfg</filename>
+ will be 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 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>
+ The kernel tools also provide configuration validation.
+ You can use these tools to produce 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.
+ Here is an example with some sample output of the command
+ that runs these tools:
+ <literallayout class='monospaced'>
+ $ bitbake linux-yocto -c kernel_configcheck -f
+
+ ...
+
+ NOTE: validating kernel configuration
+ This BSP sets 3 invalid/obsolete kernel options.
+ These config options are not offered anywhere within this kernel.
+ The full list can be found in your kernel src dir at:
+ meta/cfg/standard/mybsp/invalid.cfg
+
+ This BSP sets 21 kernel options that are possibly non-hardware related.
+ The full list can be found in your kernel src dir at:
+ meta/cfg/standard/mybsp/specified_non_hdw.cfg
+
+ WARNING: There were 2 hardware options requested that do not
+ have a corresponding value present in the final ".config" file.
+ This probably means you are not getting the config you wanted.
+ The full list can be found in your kernel src dir at:
+ meta/cfg/standard/mybsp/mismatch.cfg
+ </literallayout>
+ </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
+ <filename>kernel_configme</filename> and
+ <filename>kernel_configcheck</filename> commands until
+ they produce no warnings.
+ </para>
+
+ <para>
+ For more information on how to use the
+ <filename>menuconfig</filename> tool, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#using-menuconfig'>Using <filename>menuconfig</filename></ulink>"
+ section in the Yocto Project Development Manual.
+ </para>
+ </section>
+
+ <section id='modifying-source-code'>
+ <title>Modifying Source Code</title>
+
+ <para>
+ You can experiment with source code changes and create a
+ simple patch without leaving the BitBake environment.
+ To get started, be sure to complete a build at
+ least through the kernel configuration task:
+ <literallayout class='monospaced'>
+ $ bitbake linux-yocto -c kernel_configme -f
+ </literallayout>
+ Taking this step ensures you have the sources prepared
+ and the configuration completed.
+ You can find the sources in the
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink><filename>}/linux</filename> directory.
+ </para>
+
+ <para>
+ You can edit the sources as you would any other Linux source
+ tree.
+ However, keep in mind that you will lose changes if you
+ trigger the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-fetch'><filename>do_fetch</filename></ulink>
+ task for the recipe.
+ You can avoid triggering this task by not using BitBake to
+ run the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-cleanall'><filename>cleanall</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-cleansstate'><filename>cleansstate</filename></ulink>,
+ or forced
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-fetch'><filename>fetch</filename></ulink>
+ commands.
+ Also, do not modify the recipe itself while working
+ with temporary changes or BitBake might run the
+ <filename>fetch</filename> command depending on the
+ changes to the recipe.
+ </para>
+
+ <para>
+ To test your temporary changes, instruct BitBake to run the
+ <filename>compile</filename> again.
+ The <filename>-f</filename> option forces the command to run
+ even though BitBake might think it has already done so:
+ <literallayout class='monospaced'>
+ $ bitbake linux-yocto -c compile -f
+ </literallayout>
+ If the compile fails, you can update the sources and repeat
+ the <filename>compile</filename>.
+ Once compilation is successful, you can inspect and test
+ the resulting build (i.e. kernel, modules, and so forth) from
+ the following build directory:
+ <literallayout class='monospaced'>
+ ${WORKDIR}/linux-${PACKAGE_ARCH}-${LINUX_KERNEL_TYPE}-build
+ </literallayout>
+ Alternatively, you can run the <filename>deploy</filename>
+ command to place the kernel image in the
+ <filename>tmp/deploy/images</filename> directory:
+ <literallayout class='monospaced'>
+ $ bitbake linux-yocto -c deploy
+ </literallayout>
+ And, of course, you can perform the remaining installation and
+ packaging steps by issuing:
+ <literallayout class='monospaced'>
+ $ bitbake linux-yocto
+ </literallayout>
+ </para>
+
+ <para>
+ For rapid iterative development, the edit-compile-repeat loop
+ described in this section is preferable to rebuilding the
+ entire recipe because the installation and packaging tasks
+ are very time consuming.
+ </para>
+
+ <para>
+ Once you are satisfied with your source code modifications,
+ you can make them permanent by generating patches and
+ applying them to the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ statement as described in the
+ "<link linkend='applying-patches'>Applying Patches</link>"
+ section.
+ If you are not familiar with generating patches, refer to the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-the-patch'>Creating the Patch</ulink>"
+ section in the Yocto Project Development Manual.
+ </para>
+ </section>
+ </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_DEV_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>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 Linux kernel you
+ are using (e.g.
+ <filename>linux-yocto-myproject_3.19.bb</filename>,
+ where "3.19" is the base version of the Linux kernel
+ with which you would be working).</para></listitem>
+ <listitem><para>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>Make sure you have either a
+ <filename>defconfig</filename> file or configuration
+ fragment files.
+ 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> to the
+ <filename>files</filename> directory 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.
+ 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>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.
+ "3.19").</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>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='http://git.yoctoproject.org/cgit.cgi'></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.
+ 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>
+ 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>
+ 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>
+ 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/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-concepts-appx.xml b/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-concepts-appx.xml
new file mode 100644
index 000000000..ac91749cd
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-concepts-appx.xml
@@ -0,0 +1,253 @@
+<!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, like other kernels, are based off the Linux
+ kernel releases from <ulink url='http://www.kernel.org'></ulink>.
+ At the beginning of a major development cycle, the Yocto Project team
+ chooses its 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 kernel chosen is in the
+ final stages of development by the community.
+ In other words, the kernel is in the release
+ candidate or "rc" phase and not yet a 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 team to deliver the most up-to-date kernel
+ possible, while still ensuring that the team has a stable official release for
+ the baseline Linux kernel version.
+ </para>
+ <para>
+ The ultimate source for kernels available through the Yocto Project are released kernels
+ from <filename>kernel.org</filename>.
+ In addition to a foundational kernel from <filename>kernel.org</filename>, the
+ kernels available contain a mix of important new mainline
+ developments, non-mainline developments (when there is no alternative),
+ 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>
+ Once a 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
+ kernel development, BSP support, and release timing to select the best
+ possible <filename>kernel.org</filename> version.
+ The team continually monitors 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 kernel both adds features and introduces new bugs.
+ These consequences are the basic properties of upstream kernel development and are
+ managed by the Yocto Project team's kernel strategy.
+ It is the Yocto Project team's policy to not back-port minor features to the released kernel.
+ They only consider back-porting significant technological jumps - 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 kernel can easily create mismatches, incompatibilities and very
+ subtle errors.
+ </para>
+ <para>
+ These policies result in both a stable and a cutting
+ edge kernel that mixes forward ports of existing features and significant and critical
+ new functionality.
+ Forward porting functionality in the kernels available through the Yocto Project kernel
+ can be thought of as a "micro uprev."
+ The many “micro uprevs” produce a kernel version with a mix of
+ important new mainline, non-mainline, BSP developments and feature integrations.
+ This 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 kernels is evolving and the kernels are used in leading edge
+ feature and BSP development.
+ </para>
+ </section>
+
+ <section id='kernel-architecture'>
+ <title>Kernel Architecture</title>
+ <para>
+ This section describes the architecture of the kernels available through the
+ Yocto Project and provides information
+ on the mechanisms used to achieve that architecture.
+ </para>
+
+ <section id='architecture-overview'>
+ <title>Overview</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 used achieve that goal in a manner similar to the
+ upstream <filename>kernel.org</filename>.
+ </para>
+ <para>
+ You can think of a Yocto Project 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
+ source code manager (SCM) Git.
+ For information on Git as applied to the Yocto Project, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#git'>Git</ulink>" section in the
+ Yocto Project Development Manual.
+ </para>
+ <para>
+ The result is that 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 kernel.
+ </para>
+ <para>
+ The following illustration shows the conceptual Yocto Project kernel.
+ </para>
+ <para>
+ <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 release) from
+ which the Yocto Project kernel is created.
+ From this point "up" 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 up the tree.
+ Placing these common features in the
+ tree this way means features do not have to be duplicated along individual branches of the
+ structure.
+ </para>
+ <para>
+ From the Yocto Project Baseline Kernel, branch points represent specific functionality
+ for individual 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 a real-time kernel.
+ </para>
+ <para>
+ In this example structure, the real-time kernel branch has common features for all
+ real-time 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 kernel needed for any given set
+ of requirements.
+ </para>
+ </section>
+
+ <section id='branching-and-workflow'>
+ <title>Branching Strategy and Workflow</title>
+ <para>
+ 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 branching strategy results in a tree that has features organized to be specific
+ for particular functionality, single kernel types, or a subset of kernel types.
+ This strategy also 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 they 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 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.
+ The developer does not need to be aware of the existence of any other branches at all.
+ Of course, there is value in the existence of 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>
+ 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 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='source-code-manager-git'>
+ <title>Source Code Manager - Git</title>
+ <para>
+ The Source Code Manager (SCM) is Git.
+ This SCM is the obvious mechanism for meeting the previously mentioned goals.
+ Not only is it the SCM for <filename>kernel.org</filename> but,
+ Git continues to grow in popularity and supports many different work flows,
+ front-ends and management techniques.
+ </para>
+ <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_DEV_URL;#git'>Git</ulink>"
+ section in the Yocto Project Development Manual.
+ These referenced sections overview Git and describe a minimal set of
+ commands that allows you to be functional using Git.
+ <note>
+ 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 Master" in order to use it with the Yocto Project.
+ </note>
+ </para>
+ </section>
+ </section>
+</appendix>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-customization.xsl b/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-customization.xsl
new file mode 100644
index 000000000..325b738e9
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-eclipse-customization.xsl b/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-eclipse-customization.xsl
new file mode 100644
index 000000000..3c56a5a9e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-examples.xml b/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-examples.xml
new file mode 100644
index 000000000..9d9aef6d0
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-examples.xml
@@ -0,0 +1,918 @@
+<!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-how-to'>
+
+<title>Working with the Yocto Project Kernel</title>
+
+
+<section id='actions-org'>
+ <title>Introduction</title>
+ <para>
+ This chapter describes how to accomplish tasks involving a kernel's tree structure.
+ The information is designed to help the developer that wants to modify the Yocto
+ Project kernel and contribute changes upstream to the Yocto Project.
+ The information covers the following:
+ <itemizedlist>
+ <listitem><para>Tree construction</para></listitem>
+ <listitem><para>Build strategies</para></listitem>
+ <listitem><para>Workflow examples</para></listitem>
+ </itemizedlist>
+ </para>
+</section>
+
+ <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 kernel repositories.
+ These kernel repositories are found under the heading "Yocto Linux Kernel" at
+ <ulink url='&YOCTO_GIT_URL;/cgit.cgi'>&YOCTO_GIT_URL;/cgit.cgi</ulink>
+ and can be 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/feature
+ in the product.
+ Those feature descriptions list all necessary patches,
+ configuration, branching, tagging and feature divisions found in a kernel.
+ Thus, the Yocto Project kernel repository (or tree) is built.
+ </para>
+ <para>
+ The existence of this tree allows you to access and clone a particular
+ Yocto Project 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 kernel in any clone of the Yocto Project kernel source repository
+ Git tree.
+ For example, the following command clones the Yocto Project baseline kernel that
+ branched off of <filename>linux.org</filename> version 3.4:
+ <literallayout class='monospaced'>
+ $ git clone git://git.yoctoproject.org/linux-yocto-3.4
+ </literallayout>
+ For another example of how to set up a local Git repository of the Yocto Project
+ kernel files, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#local-kernel-files'>Yocto Project Kernel</ulink>" bulleted
+ item in the Yocto Project Development Manual.
+ </para>
+ <para>
+ Once you have cloned the kernel Git repository on your local machine, you can
+ switch to the <filename>meta</filename> branch within the repository.
+ Here is an example that assumes the local Git repository for the kernel is in
+ a top-level directory named <filename>linux-yocto-3.4</filename>:
+ <literallayout class='monospaced'>
+ $ cd ~/linux-yocto-3.4
+ $ git checkout -b meta origin/meta
+ </literallayout>
+ Once you have checked out and switched to the <filename>meta</filename> branch,
+ you can see a snapshot of all the kernel configuration and feature descriptions that are
+ used to build that particular kernel repository.
+ These descriptions are in the form of <filename>.scc</filename> files.
+ </para>
+ <para>
+ You should realize, however, that browsing your local kernel 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.
+ For examples showing how to use Git to inspect kernel commits, see the following sections
+ in this chapter.
+ <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;/cgit.cgi'></ulink> given the
+ introduction of a new top-level kernel feature or BSP.
+ These are the actions that effectively create the tree
+ that includes the new feature, patch or BSP:
+ <orderedlist>
+ <listitem><para>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>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 <filename>meta/cfg/kernel-cache</filename></para></listitem>
+ <listitem><para>Areas pointed to by <filename>SRC_URI</filename> statements
+ found in 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:
+ <literallayout class='monospaced'>
+ &lt;bsp_name&gt;-&lt;kernel_type&gt;.scc
+ </literallayout>
+ </para></listitem>
+ <listitem><para>Once located, the feature description is either compiled into a simple script
+ of actions, or into an existing equivalent script that is already part of the
+ shipped kernel.</para></listitem>
+ <listitem><para>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>Each extra feature is located, compiled and appended to the script
+ as described in step three.</para></listitem>
+ <listitem><para>The script is executed to produce a series of <filename>meta-*</filename>
+ directories.
+ These directories 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>The base repository is cloned, and the actions
+ listed in the <filename>meta-*</filename> directories are applied to the
+ tree.</para></listitem>
+ <listitem><para>The Git repository is left with the desired branch checked out and any
+ required branching, patching and tagging has been performed.</para></listitem>
+ </orderedlist>
+ </para>
+ <para>
+ The kernel tree is now ready for developer consumption to be locally cloned,
+ configured, and built into a Yocto Project kernel specific to some target hardware.
+ <note><para>The generated <filename>meta-*</filename> directories add 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;/cgit.cgi'>http://git.yoctoproject.org/cgit.cgi</ulink>
+ is the combination of all supported boards and configurations.</para>
+ <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>
+ </note>
+ </para>
+ </section>
+
+ <section id='build-strategy'>
+ <title>Build Strategy</title>
+ <para>
+ Once a local Git repository of the Yocto Project kernel exists on a development system,
+ you can consider the compilation phase of kernel development - 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 exists.
+ This branch has the following form:
+ <literallayout class='monospaced'>
+ &lt;kernel_type&gt;/&lt;bsp_name&gt;
+ </literallayout></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, see
+ the "<link linkend='workflow-examples'>Workflow Examples</link>".
+ </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 <filename>meta-*</filename> 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}-&lt;kernel_type&gt;-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 build directory in its own separate branch
+ of the Git repository, you can easily switch between different builds.
+ </para>
+ </section>
+
+ <section id='workflow-examples'>
+ <title>Workflow Examples</title>
+
+ <para>
+ As previously noted, the Yocto Project kernel has built-in Git integration.
+ However, these utilities are not the only way to work with the kernel repository.
+ The Yocto Project has not made changes to Git or to other tools that
+ would invalidate alternate workflows.
+ Additionally, the way the kernel repository is constructed results in using
+ only core Git functionality, thus allowing any number of tools or front ends to use the
+ resulting tree.
+ </para>
+
+ <para>
+ This section contains several workflow examples.
+ Many of the examples use Git commands.
+ You can find Git documentation at
+ <ulink url='http://git-scm.com/documentation'></ulink>.
+ You can find a simple overview of using Git with the Yocto Project in the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#git'>Git</ulink>"
+ section of the Yocto Project Development Manual.
+ </para>
+
+ <section id='change-inspection-kernel-changes-commits'>
+ <title>Change Inspection: Changes/Commits</title>
+
+ <para>
+ A common question when working with a kernel is:
+ "What changes have been applied to this tree?"
+ </para>
+
+ <para>
+ In projects that have a collection of directories that
+ contain patches to the kernel, it is possible to inspect or "grep" the contents
+ of the directories to get a general feel for the changes.
+ This sort of patch inspection is not an efficient way to determine what has been
+ done to the kernel.
+ The reason it is inefficient is because there are many optional patches that are
+ selected based on the kernel type and the feature description.
+ Additionally, patches could exist in directories that are not included in the search.
+ </para>
+
+ <para>
+ A more efficient way to determine what has changed in the branch is to use
+ Git and inspect or search the kernel tree.
+ This method gives you a full view of not only the source code modifications,
+ but also provides the reasons for the changes.
+ </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.
+ Because Git repositories in the Yocto Project do not break existing Git
+ functionality, and because there exists many permutations of these types of
+ Git commands, many methods exist by which you can discover 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='http://git.yoctoproject.org/cgit.cgi'></ulink>.
+ For example, the branch names for the <filename>linux-yocto-3.4</filename>
+ kernel repository can be seen at
+ <ulink url='http://git.yoctoproject.org/cgit.cgi/linux-yocto-3.4/refs/heads'></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 (<filename>&lt;commit&gt;..&lt;commit&gt;</filename>).
+ </para>
+
+ <para>
+ Here is an example that looks at what has changed in the
+ <filename>emenlow</filename> branch of the
+ <filename>linux-yocto-3.4</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 a summary of changes use the <filename>git log</filename> command.
+ Here is an example using the same branches:
+ <literallayout class='monospaced'>
+ $ git log --oneline origin/standard/base..origin/standard/emenlow
+ </literallayout>
+ The <filename>git log</filename> output might be more useful than
+ the <filename>git whatchanged</filename> as you get
+ a short, one-line summary of each change and not the entire commit.
+ </para>
+
+ <para>
+ If you want to see code differences associated with all the changes, use
+ the <filename>git diff</filename> command.
+ Here is an example:
+ <literallayout class='monospaced'>
+ $ git diff origin/standard/base..origin/standard/emenlow
+ </literallayout>
+ </para>
+
+ <para>
+ You can see the commit log messages and the text differences using the
+ <filename>git show</filename> command:
+ Here is an example:
+ <literallayout class='monospaced'>
+ $ git show origin/standard/base..origin/standard/emenlow
+ </literallayout>
+ </para>
+
+ <para>
+ You can create individual patches for each change by using the
+ <filename>git format-patch</filename> command.
+ 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='show-a-particular-feature-or-branch-change'>
+ <title>Show a Particular Feature or Branch Change</title>
+
+ <para>
+ Developers use tags in the Yocto Project kernel tree to divide changes for significant
+ features or branches.
+ Once you know a particular tag, you can use Git commands
+ to show changes associated with the tag and find the branches that contain
+ the feature.
+ <note>
+ Because BSP branch, <filename>kernel.org</filename>, and feature tags are all
+ present, there could be many tags.
+ </note>
+ The <filename>git show &lt;tag&gt;</filename> command shows changes that are tagged by
+ a feature.
+ Here is an example that shows changes tagged by the <filename>systemtap</filename>
+ feature:
+ <literallayout class='monospaced'>
+ $ git show systemtap
+ </literallayout>
+ You can use the <filename>git branch --contains &lt;tag&gt;</filename> 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>
+
+ <para>
+ You can use many other comparisons to isolate BSP and kernel changes.
+ For example, you can compare against <filename>kernel.org</filename> tags
+ such as the <filename>v3.4</filename> tag.
+ </para>
+ </section>
+ </section>
+
+ <section id='development-saving-kernel-modifications'>
+ <title>Development: Saving Kernel Modifications</title>
+
+ <para>
+ Another common operation is to build a BSP supplied by the Yocto Project, make some
+ changes, rebuild, and then test.
+ Those local changes often need to be exported, shared or otherwise maintained.
+ </para>
+
+ <para>
+ Since the Yocto Project kernel source tree is backed by Git, this activity is
+ much easier as compared to with previous releases.
+ Because Git tracks file modifications, additions and deletions, it is easy
+ to modify the code and later realize that you need to save the changes.
+ It is also easy to determine what has changed.
+ This method also provides many tools to commit, undo and export those modifications.
+ </para>
+
+ <para>
+ This section and its sub-sections, describe general application of Git's
+ <filename>push</filename> and <filename>pull</filename> commands, which are used to
+ get your changes upstream or source your code from an upstream repository.
+ The Yocto Project provides scripts that help you work in a collaborative development
+ environment.
+ For information on 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>" and
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#submitting-a-patch'>Using Email to Submit a Patch</ulink>"
+ sections in the Yocto Project Development Manual.
+ </para>
+
+ <para>
+ There are many ways to save kernel modifications.
+ The technique employed
+ depends on the destination for the patches:
+
+ <itemizedlist>
+ <listitem><para>Bulk storage</para></listitem>
+ <listitem><para>Internal sharing either through patches or by using Git</para></listitem>
+ <listitem><para>External submissions</para></listitem>
+ <listitem><para>Exporting for integration into another Source Code
+ Manager (SCM)</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Because of the following list of issues, the destination of the patches also influences
+ the method for gathering them:
+
+ <itemizedlist>
+ <listitem><para>Bisectability</para></listitem>
+ <listitem><para>Commit headers</para></listitem>
+ <listitem><para>Division of subsystems for separate submission or review</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <section id='bulk-export'>
+ <title>Bulk Export</title>
+
+ <para>
+ This section describes how you can "bulk" export changes that have not
+ been separated or divided.
+ This situation works well when you are simply storing patches outside of the kernel
+ source repository, either permanently or temporarily, and you are not committing
+ incremental changes during development.
+ <note>
+ This technique is not appropriate for full integration of upstream submission
+ because changes are not properly divided and do not provide an avenue for per-change
+ commit messages.
+ Therefore, this example assumes that changes have not been committed incrementally
+ during development and that you simply must gather and export them.
+ </note>
+ <literallayout class='monospaced'>
+ # bulk export of ALL modifications without separation or division
+ # of the changes
+
+ $ git add .
+ $ git commit -s -a -m &lt;msg&gt;
+ or
+ $ git commit -s -a # and interact with $EDITOR
+ </literallayout>
+ </para>
+
+ <para>
+ The previous operations capture all the local changes in the project source
+ tree in a single Git commit.
+ And, that commit is also stored in the project's source tree.
+ </para>
+
+ <para>
+ Once the changes are exported, you can restore them manually using a template
+ or through integration with the <filename>default_kernel</filename>.
+ </para>
+
+ </section>
+
+ <section id='incremental-planned-sharing'>
+ <title>Incremental/Planned Sharing</title>
+
+ <para>
+ This section describes how to save modifications when you are making incremental
+ commits or practicing planned sharing.
+ The examples in this section assume that you have incrementally committed
+ changes to the tree during development and now need to export them.
+ The sections that follow
+ describe how you can export your changes internally through either patches or by
+ using Git commands.
+ </para>
+
+ <para>
+ During development, the following commands are of interest.
+ For full Git documentation, refer to the Git documentation at
+ <ulink url='http://github.com'></ulink>.
+
+ <literallayout class='monospaced'>
+ # edit a file
+ $ vi &lt;path&gt;/file
+ # stage the change
+ $ git add &lt;path&gt;/file
+ # commit the change
+ $ git commit -s
+ # remove a file
+ $ git rm &lt;path&gt;/file
+ # commit the change
+ $ git commit -s
+
+ ... etc.
+ </literallayout>
+ </para>
+
+ <para>
+ Distributed development with Git is possible when you use a universally
+ agreed-upon unique commit identifier (set by the creator of the commit) that maps to a
+ specific change set with a specific parent.
+ This identifier is created for you when
+ you create a commit, and is re-created when you amend, alter or re-apply
+ a commit.
+ As an individual in isolation, this is of no interest.
+ However, if you
+ intend to share your tree with normal Git <filename>push</filename> and
+ <filename>pull</filename> operations for
+ distributed development, you should consider the ramifications of changing a
+ commit that you have already shared with others.
+ </para>
+
+ <para>
+ Assuming that the changes have not been pushed upstream, or pulled into
+ another repository, you can update both the commit content and commit messages
+ associated with development by using the following commands:
+
+ <literallayout class='monospaced'>
+ $ Git add &lt;path&gt;/file
+ $ Git commit --amend
+ $ Git rebase or Git rebase -i
+ </literallayout>
+ </para>
+
+ <para>
+ Again, assuming that the changes have not been pushed upstream, and that
+ no pending works-in-progress exist (use <filename>git status</filename> to check), then
+ you can revert (undo) commits by using the following commands:
+
+ <literallayout class='monospaced'>
+ # remove the commit, update working tree and remove all
+ # traces of the change
+ $ git reset --hard HEAD^
+ # remove the commit, but leave the files changed and staged for re-commit
+ $ git reset --soft HEAD^
+ # remove the commit, leave file change, but not staged for commit
+ $ git reset --mixed HEAD^
+ </literallayout>
+ </para>
+
+ <para>
+ You can create branches, "cherry-pick" changes, or perform any number of Git
+ operations until the commits are in good order for pushing upstream
+ or for pull requests.
+ After a <filename>push</filename> or <filename>pull</filename> command,
+ commits are normally considered
+ "permanent" and you should not modify them.
+ If the commits need to be changed, you can incrementally do so with new commits.
+ These practices follow standard Git workflow and the <filename>kernel.org</filename> best
+ practices, which is recommended.
+ <note>
+ It is recommended to tag or branch before adding changes to a Yocto Project
+ BSP or before creating a new one.
+ The reason for this recommendation is because the branch or tag provides a
+ reference point to facilitate locating and exporting local changes.
+ </note>
+ </para>
+
+ <section id='export-internally-via-patches'>
+ <title>Exporting Changes Internally by Using Patches</title>
+
+ <para>
+ This section describes how you can extract committed changes from a working directory
+ by exporting them as patches.
+ Once the changes have been extracted, you can use the patches for upstream submission,
+ place them in a Yocto Project template for automatic kernel patching,
+ or apply them in many other common uses.
+ </para>
+
+ <para>
+ This example shows how to create a directory with sequentially numbered patches.
+ Once the directory is created, you can apply it to a repository using the
+ <filename>git am</filename> command to reproduce the original commit and all
+ the related information such as author, date, commit log, and so forth.
+ <note>
+ The new commit identifiers (ID) will be generated upon re-application.
+ This action reflects that the commit is now applied to an underlying commit
+ with a different ID.
+ </note>
+ <literallayout class='monospaced'>
+ # &lt;first-commit&gt; can be a tag if one was created before development
+ # began. It can also be the parent branch if a branch was created
+ # before development began.
+
+ $ git format-patch -o &lt;dir&gt; &lt;first commit&gt;..&lt;last commit&gt;
+ </literallayout>
+ </para>
+
+ <para>
+ In other words:
+ <literallayout class='monospaced'>
+ # Identify commits of interest.
+
+ # If the tree was tagged before development
+ $ git format-patch -o &lt;save dir&gt; &lt;tag&gt;
+
+ # If no tags are available
+ $ git format-patch -o &lt;save dir&gt; HEAD^ # last commit
+ $ git format-patch -o &lt;save dir&gt; HEAD^^ # last 2 commits
+ $ git whatchanged # identify last commit
+ $ git format-patch -o &lt;save dir&gt; &lt;commit id&gt;
+ $ git format-patch -o &lt;save dir&gt; &lt;rev-list&gt;
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='export-internally-via-git'>
+ <title>Exporting Changes Internally by Using Git</title>
+
+ <para>
+ This section describes how you can export changes from a working directory
+ by pushing the changes into a master repository or by making a pull request.
+ Once you have pushed the changes to the master repository, you can then
+ pull those same changes into a new kernel build at a later time.
+ </para>
+
+ <para>
+ Use this command form to push the changes:
+ <literallayout class='monospaced'>
+ $ git push ssh://&lt;master_server&gt;/&lt;path_to_repo&gt;
+ &lt;local_branch&gt;:&lt;remote_branch&gt;
+ </literallayout>
+ </para>
+
+ <para>
+ For example, the following command pushes the changes from your local branch
+ <filename>yocto/standard/common-pc/base</filename> to the remote branch with the same name
+ in the master repository <filename>//git.mycompany.com/pub/git/kernel-3.4</filename>.
+ <literallayout class='monospaced'>
+ $ git push ssh://git.mycompany.com/pub/git/kernel-3.4 \
+ yocto/standard/common-pc/base:yocto/standard/common-pc/base
+ </literallayout>
+ </para>
+
+ <para>
+ A pull request entails using the <filename>git request-pull</filename> command to compose
+ an email to the
+ maintainer requesting that a branch be pulled into the master repository, see
+ <ulink url='http://github.com/guides/pull-requests'></ulink> for an example.
+ <note>
+ Other commands such as <filename>git stash</filename> or branching can also be used to save
+ changes, but are not covered in this document.
+ </note>
+ </para>
+ </section>
+ </section>
+
+ <section id='export-for-external-upstream-submission'>
+ <title>Exporting Changes for External (Upstream) Submission</title>
+
+ <para>
+ This section describes how to export changes for external upstream submission.
+ If the patch series is large or the maintainer prefers to pull
+ changes, you can submit these changes by using a pull request.
+ However, it is common to send patches as an email series.
+ This method allows easy review and integration of the changes.
+ <note>
+ Before sending patches for review be sure you understand the
+ community standards for submitting and documenting changes and follow their best practices.
+ For example, kernel patches should follow standards such as:
+ <itemizedlist>
+ <listitem><para>
+ <ulink url='http://linux.yyz.us/patch-format.html'></ulink></para></listitem>
+ <listitem><para>Documentation/SubmittingPatches (in any linux
+ kernel source tree)</para></listitem>
+ </itemizedlist>
+ </note>
+ </para>
+
+ <para>
+ The messages used to commit changes are a large part of these standards.
+ Consequently, be sure that the headers for each commit have the required information.
+ For information on how to follow the Yocto Project commit message standards, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#how-to-submit-a-change'>How to Submit a
+ Change</ulink>" section in the Yocto Project Development Manual.
+ </para>
+
+ <para>
+ If the initial commits were not properly documented or do not meet those standards,
+ you can re-base by using the <filename>git rebase -i</filename> command to
+ manipulate the commits and
+ get them into the required format.
+ Other techniques such as branching and cherry-picking commits are also viable options.
+ </para>
+
+ <para>
+ Once you complete the commits, you can generate the email that sends the patches
+ to the maintainer(s) or lists that review and integrate changes.
+ The command <filename>git send-email</filename> is commonly used to ensure
+ that patches are properly
+ formatted for easy application and avoid mailer-induced patch damage.
+ </para>
+
+ <para>
+ The following is an example of dumping patches for external submission:
+ <literallayout class='monospaced'>
+ # dump the last 4 commits
+ $ git format-patch --thread -n -o ~/rr/ HEAD^^^^
+ $ git send-email --compose --subject '[RFC 0/N] &lt;patch series summary&gt;' \
+ --to foo@yoctoproject.org --to bar@yoctoproject.org \
+ --cc list@yoctoproject.org ~/rr
+ # the editor is invoked for the 0/N patch, and when complete the entire
+ # series is sent via email for review
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='export-for-import-into-other-scm'>
+ <title>Exporting Changes for Import into Another SCM</title>
+
+ <para>
+ When you want to export changes for import into another
+ Source Code Manager (SCM), you can use any of the previously discussed
+ techniques.
+ However, if the patches are manually applied to a secondary tree and then
+ that tree is checked into the SCM, you can lose change information such as
+ commit logs.
+ This process is not recommended.
+ </para>
+
+ <para>
+ Many SCMs can directly import Git commits, or can translate Git patches so that
+ information is not lost.
+ Those facilities are SCM-dependent and you should use them whenever possible.
+ </para>
+ </section>
+ </section>
+
+ <section id='scm-working-with-the-yocto-project-kernel-in-another-scm'>
+ <title>Working with the Yocto Project Kernel in Another SCM</title>
+
+ <para>
+ This section describes kernel development in an SCM other than Git,
+ which is not the same as exporting changes to another SCM described earlier.
+ For this scenario, you use the OpenEmbedded build system to
+ develop the kernel in a different SCM.
+ The following must be true for you to accomplish this:
+ <itemizedlist>
+ <listitem><para>The delivered Yocto Project kernel must be exported into the second
+ SCM.</para></listitem>
+ <listitem><para>Development must be exported from that secondary SCM into a
+ format that can be used by the OpenEmbedded build system.</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <section id='exporting-delivered-kernel-to-scm'>
+ <title>Exporting the Delivered Kernel to the SCM</title>
+
+ <para>
+ Depending on the SCM, it might be possible to export the entire Yocto Project
+ kernel Git repository, branches and all, into a new environment.
+ This method is preferred because it has the most flexibility and potential to maintain
+ the meta data associated with each commit.
+ </para>
+
+ <para>
+ When a direct import mechanism is not available, it is still possible to
+ export a branch (or series of branches) and check them into a new repository.
+ </para>
+
+ <para>
+ The following commands illustrate some of the steps you could use to
+ import the <filename>yocto/standard/common-pc/base</filename>
+ kernel into a secondary SCM:
+ <literallayout class='monospaced'>
+ $ git checkout yocto/standard/common-pc/base
+ $ cd .. ; echo linux/.git &gt; .cvsignore
+ $ cvs import -m "initial import" linux MY_COMPANY start
+ </literallayout>
+ </para>
+
+ <para>
+ You could now relocate the CVS repository and use it in a centralized manner.
+ </para>
+
+ <para>
+ The following commands illustrate how you can condense and merge two BSPs into a
+ second SCM:
+ <literallayout class='monospaced'>
+ $ git checkout yocto/standard/common-pc/base
+ $ git merge yocto/standard/common-pc-64/base
+ # resolve any conflicts and commit them
+ $ cd .. ; echo linux/.git &gt; .cvsignore
+ $ cvs import -m "initial import" linux MY_COMPANY start
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='importing-changes-for-build'>
+ <title>Importing Changes for the Build</title>
+
+ <para>
+ Once development has reached a suitable point in the second development
+ environment, you need to export the changes as patches.
+ To export them, place the changes in a recipe and
+ automatically apply them to the kernel during patching.
+ </para>
+ </section>
+ </section>
+
+ <section id='bsp-creating'>
+ <title>Creating a BSP Based on an Existing Similar BSP</title>
+
+ <para>
+ This section overviews the process of creating a BSP based on an
+ existing similar BSP.
+ The information is introductory in nature and does not provide step-by-step examples.
+ For detailed information on how to create a new BSP, see
+ the "<ulink url='&YOCTO_DOCS_BSP_URL;#creating-a-new-bsp-layer-using-the-yocto-bsp-script'>Creating a New BSP Layer Using the yocto-bsp Script</ulink>" section in the
+ Yocto Project Board Support Package (BSP) Developer's Guide, or see the
+ <ulink url='&YOCTO_WIKI_URL;/wiki/Transcript:_creating_one_generic_Atom_BSP_from_another'>Transcript:_creating_one_generic_Atom_BSP_from_another</ulink>
+ wiki page.
+ </para>
+
+ <para>
+ The basic steps you need to follow are:
+ <orderedlist>
+ <listitem><para><emphasis>Make sure you have set up a local Source Directory:</emphasis>
+ You must create a local
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
+ by either creating a Git repository (recommended) or
+ extracting a Yocto Project release tarball.</para></listitem>
+ <listitem><para><emphasis>Choose an existing BSP available with the Yocto Project:</emphasis>
+ Try to map your board features as closely to the features of a BSP that is
+ already supported and exists in the Yocto Project.
+ Starting with something as close as possible to your board makes developing
+ your BSP easier.
+ You can find all the BSPs that are supported and ship with the Yocto Project
+ on the Yocto Project's Download page at
+ <ulink url='&YOCTO_HOME_URL;/download'></ulink>.</para></listitem>
+ <listitem><para><emphasis>Be sure you have the Base BSP:</emphasis>
+ You need to either have a local Git repository of the base BSP set up or
+ have downloaded and extracted the files from a release BSP tarball.
+ Either method gives you access to the BSP source files.</para></listitem>
+ <listitem><para><emphasis>Make a copy of the existing BSP, thus isolating your new
+ BSP work:</emphasis>
+ Copying the existing BSP file structure gives you a new area in which to work.</para></listitem>
+ <listitem><para><emphasis>Make configuration and recipe changes to your new BSP:</emphasis>
+ Configuration changes involve the files in the BSP's <filename>conf</filename>
+ directory.
+ Changes include creating a machine-specific configuration file and editing the
+ <filename>layer.conf</filename> file.
+ The configuration changes identify the kernel you will be using.
+ Recipe changes include removing, modifying, or adding new recipe files that
+ instruct the build process on what features to include in the image.</para></listitem>
+ <listitem><para><emphasis>Prepare for the build:</emphasis>
+ Before you actually initiate the build, you need to set up the build environment
+ by sourcing the environment initialization script.
+ After setting up the environment, you need to make some build configuration
+ changes to the <filename>local.conf</filename> and <filename>bblayers.conf</filename>
+ files.</para></listitem>
+ <listitem><para><emphasis>Build the image:</emphasis>
+ The OpenEmbedded build system uses BitBake to create the image.
+ You need to decide on the type of image you are going to build (e.g. minimal, base,
+ core, sato, and so forth) and then start the build using the <filename>bitbake</filename>
+ command.</para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='tip-dirty-string'>
+ <title>"-dirty" String</title>
+
+ <para>
+ If kernel images are being built with "-dirty" on the end of the version
+ string, this simply means that modifications in the source
+ directory have not been committed.
+ <literallayout class='monospaced'>
+ $ git status
+ </literallayout>
+ </para>
+
+ <para>
+ You can use the above Git command to report modified, removed, or added files.
+ You should commit those changes to the tree regardless of whether they will be saved,
+ exported, or used.
+ Once you commit the changes you need to rebuild the kernel.
+ </para>
+
+ <para>
+ To brute force pickup and commit all such pending changes, enter the following:
+ <literallayout class='monospaced'>
+ $ git add .
+ $ git commit -s -a -m "getting rid of -dirty"
+ </literallayout>
+ </para>
+
+ <para>
+ Next, rebuild the kernel.
+ </para>
+ </section>
+ </section>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-faq.xml b/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-faq.xml
new file mode 100644
index 000000000..2b99ad2dd
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-faq.xml
@@ -0,0 +1,140 @@
+<!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='generating-configuration-files'>Generating Configuration Files</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</ulink>"
+ section in the Yocto Project Development 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/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-intro.xml b/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-intro.xml
new file mode 100644
index 000000000..263e50098
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-intro.xml
@@ -0,0 +1,149 @@
+<!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>
+
+<!--
+<para>
+ <emphasis>AR - Darren Hart:</emphasis> See if the concepts in these
+ three bullets are adequately covered in somewhere in this manual:
+ <itemizedlist>
+ <listitem><para>Do we convey that our kernel Git repositories
+ have a clear and continuous history, similar to the way the
+ kernel Git repositories for <filename>kernel.org</filename>
+ do.
+ </para></listitem>
+ <listitem><para>Does the manual note that Yocto Project delivers
+ a key set of supported kernel types, where
+ each type is tailored to meet a specific use (e.g. networking,
+ consumer, devices, and so forth).</para></listitem>
+ <listitem><para>Do we convey that the Yocto Project uses a
+ Git branching strategy that, from a
+ developer's point of view, results in a linear path from the
+ baseline kernel.org, through a select group of features and
+ ends with their BSP-specific commits.</para></listitem>
+ </itemizedlist>
+</para>
+-->
+
+ <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 provides background information on the Yocto Linux kernel
+ <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink>,
+ describes common tasks you can perform using the kernel tools,
+ and shows you how to use the kernel Metadata needed to work with
+ the kernel inside the Yocto Project.
+ </para>
+
+ <para>
+ Each Yocto Project release has a set of linux-yocto 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 upstream developments
+ and introduce newly-supported platforms.
+ Previous recipes in the release are refreshed and supported for at
+ least one additional release.
+ As they align, these previous releases are updated to include the
+ latest from the
+ <ulink url='&YOCTO_HOME_URL;/organization/long-term-support-initiative-ltsi'>Long Term Support Initiative</ulink>
+ (LTSI) project.
+ Also included is a linux-yocto development recipe
+ (<filename>linux-yocto-dev.bb</filename>) should you want to work
+ with the very latest in upstream Linux kernel development and
+ kernel Metadata development.
+ </para>
+
+ <para>
+ The Yocto Project also provides a powerful set of kernel
+ tools for managing 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 Linux
+ kernel <filename>menuconfig</filename> system.
+ Contrast this against a complete Linux kernel
+ <filename>.config</filename>, 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 linux-yocto
+ recipes, an alternative exists by which you can use the Yocto
+ Project Linux kernel tools with your own kernel sources.
+ </para>
+ </section>
+
+ <section id='kernel-dev-other-resources'>
+ <title>Other Resources</title>
+
+ <para>
+ The sections that follow provide 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_QS_URL;'>Yocto Project Quick Start</ulink>
+ </para></listitem>
+ <listitem><para>The "<ulink url='&YOCTO_DOCS_DEV_URL;#dev-modifying-source-code'>Modifying Source Code</ulink>"
+ section in the Yocto Project Development 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 Manual</para></listitem>
+ <listitem><para>The "<ulink url='&YOCTO_DOCS_DEV_URL;#modifying-the-kernel'>Modifying the Kernel</ulink>" section
+ in the Yocto Project Development Manual.</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Finally, while this document focuses on the manual creation of
+ recipes, patches, and configuration files, the Yocto Project
+ Board Support Package (BSP) tools are available to automate
+ this process with existing content and work well to create the
+ initial framework and boilerplate code.
+ For details on these tools, see the
+ "<ulink url='&YOCTO_DOCS_BSP_URL;#using-the-yocto-projects-bsp-tools'>Using the Yocto Project's BSP Tools</ulink>"
+ section in the Yocto Project Board Support Package (BSP) Developer's
+ Guide.
+ </para>
+ </section>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-maint-appx.xml b/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-maint-appx.xml
new file mode 100644
index 000000000..6bb0cf6fd
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-maint-appx.xml
@@ -0,0 +1,220 @@
+<!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 kernel repositories.
+ These kernel repositories are found under the heading "Yocto Linux Kernel" at
+ <ulink url='&YOCTO_GIT_URL;/cgit.cgi'>&YOCTO_GIT_URL;/cgit.cgi</ulink>
+ and can be 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,
+ configuration, branching, tagging and feature divisions found in a kernel.
+ Thus, the Yocto Project kernel repository (or tree) is built.
+ </para>
+ <para>
+ The existence of this tree allows you to access and clone a particular
+ Yocto Project 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 kernel in any clone of the Yocto Project kernel source repository
+ Git tree.
+ For example, the following command clones the Yocto Project baseline kernel that
+ branched off of <filename>linux.org</filename> version 3.19:
+ <literallayout class='monospaced'>
+ $ git clone git://git.yoctoproject.org/linux-yocto-3.19
+ </literallayout>
+ For another example of how to set up a local Git repository of the Yocto Project
+ kernel files, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#local-kernel-files'>Yocto Project Kernel</ulink>" bulleted
+ item in the Yocto Project Development Manual.
+ </para>
+ <para>
+ Once you have cloned the kernel Git repository on your local machine, you can
+ switch to the <filename>meta</filename> branch within the repository.
+ Here is an example that assumes the local Git repository for the kernel is in
+ a top-level directory named <filename>linux-yocto-3.19</filename>:
+ <literallayout class='monospaced'>
+ $ cd linux-yocto-3.19
+ $ git checkout -b meta origin/meta
+ </literallayout>
+ Once you have checked out and switched to the <filename>meta</filename> branch,
+ you can see a snapshot of all the kernel configuration and feature descriptions that are
+ used to build that particular kernel repository.
+ These descriptions are in the form of <filename>.scc</filename> files.
+ </para>
+ <para>
+ You should realize, however, that browsing your local kernel 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;/cgit.cgi'></ulink> given the
+ introduction of a new top-level kernel feature or BSP.
+ These are the actions that effectively create the tree
+ that includes the new feature, patch or BSP:
+ <orderedlist>
+ <listitem><para>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>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 <filename>meta/cfg/kernel-cache</filename></para></listitem>
+ <listitem><para>Areas pointed to by <filename>SRC_URI</filename> statements
+ found in 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:
+ <literallayout class='monospaced'>
+ <replaceable>bsp_name</replaceable>-<replaceable>kernel_type</replaceable>.scc
+ </literallayout>
+ </para></listitem>
+ <listitem><para>Once located, the feature description is either compiled into a simple script
+ of actions, or into an existing equivalent script that is already part of the
+ shipped kernel.</para></listitem>
+ <listitem><para>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>Each extra feature is located, compiled and appended to the script
+ as described in step three.</para></listitem>
+ <listitem><para>The script is executed to produce a series of <filename>meta-*</filename>
+ directories.
+ These directories 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>The base repository is cloned, and the actions
+ listed in the <filename>meta-*</filename> directories are applied to the
+ tree.</para></listitem>
+ <listitem><para>The Git repository is left with the desired branch checked out and any
+ required branching, patching and tagging has been performed.</para></listitem>
+ </orderedlist>
+ </para>
+ <para>
+ The kernel tree is now ready for developer consumption to be locally cloned,
+ configured, and built into a Yocto Project kernel specific to some target hardware.
+ <note><para>The generated <filename>meta-*</filename> directories add 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;/cgit.cgi'>http://git.yoctoproject.org/cgit.cgi</ulink>
+ is the combination of all supported boards and configurations.</para>
+ <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>
+ </note>
+ </para>
+ </section>
+
+ <section id='build-strategy'>
+ <title>Build Strategy</title>
+
+<!--
+ <para>
+ <emphasis>AR - Darren Hart:</emphasis> Some parts of this section
+ need to be in the
+ "<link linkend='using-an-iterative-development-process'>Using an Iterative Development Process</link>"
+ section.
+ Darren needs to figure out which parts and identify them.
+ </para>
+-->
+
+ <para>
+ Once a local Git repository of the Yocto Project kernel exists on a development system,
+ you can consider the compilation phase of kernel development - 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 exists.
+ This branch has the following form:
+ <literallayout class='monospaced'>
+ <replaceable>kernel_type</replaceable>/<replaceable>bsp_name</replaceable>
+ </literallayout></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 <filename>meta-*</filename> 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_DEV_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/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-style.css b/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-style.css
new file mode 100644
index 000000000..6e0c1c7fc
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev-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/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;
+}
+
+
+ /*********** /
+ / 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/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev.xml b/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev.xml
new file mode 100644
index 000000000..fb11dd15c
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/kernel-dev/kernel-dev.xml
@@ -0,0 +1,120 @@
+<!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>Darren</firstname> <surname>Hart</surname>
+ <affiliation>
+ <orgname>Intel Corporation</orgname>
+ </affiliation>
+ <email>darren.hart@intel.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>
+ </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_KERNEL_DEV_URL;'>Yocto Project Linux Kernel Development Manual</ulink>
+ from the Yocto Project website.
+ </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-examples.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/import-layers/yocto-poky/documentation/mega-manual/figures/add-variable.png b/import-layers/yocto-poky/documentation/mega-manual/figures/add-variable.png
new file mode 100644
index 000000000..6bdcca705
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/add-variable.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/analysis-for-package-splitting.png b/import-layers/yocto-poky/documentation/mega-manual/figures/analysis-for-package-splitting.png
new file mode 100644
index 000000000..04f2794ea
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/analysis-for-package-splitting.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/bash-oecore.png b/import-layers/yocto-poky/documentation/mega-manual/figures/bash-oecore.png
new file mode 100644
index 000000000..801a5d911
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/bash-oecore.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/bsp-dev-flow.png b/import-layers/yocto-poky/documentation/mega-manual/figures/bsp-dev-flow.png
new file mode 100644
index 000000000..540b0abb9
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/bsp-dev-flow.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/bsp-title.png b/import-layers/yocto-poky/documentation/mega-manual/figures/bsp-title.png
new file mode 100644
index 000000000..f624dd4f9
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/bsp-title.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/build-workspace-directory.png b/import-layers/yocto-poky/documentation/mega-manual/figures/build-workspace-directory.png
new file mode 100644
index 000000000..5387d33f0
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/build-workspace-directory.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/buildhistory-web.png b/import-layers/yocto-poky/documentation/mega-manual/figures/buildhistory-web.png
new file mode 100644
index 000000000..f6db86c97
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/buildhistory-web.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/buildhistory.png b/import-layers/yocto-poky/documentation/mega-manual/figures/buildhistory.png
new file mode 100644
index 000000000..bd5f8a490
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/buildhistory.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/building-an-image.png b/import-layers/yocto-poky/documentation/mega-manual/figures/building-an-image.png
new file mode 100755
index 000000000..1fbea5ab0
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/building-an-image.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/compatible-layers.png b/import-layers/yocto-poky/documentation/mega-manual/figures/compatible-layers.png
new file mode 100644
index 000000000..38436b075
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/compatible-layers.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/configuration-compile-autoreconf.png b/import-layers/yocto-poky/documentation/mega-manual/figures/configuration-compile-autoreconf.png
new file mode 100644
index 000000000..a07464f04
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/configuration-compile-autoreconf.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/cross-development-toolchains.png b/import-layers/yocto-poky/documentation/mega-manual/figures/cross-development-toolchains.png
new file mode 100644
index 000000000..d36670a19
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/cross-development-toolchains.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/define-generic.png b/import-layers/yocto-poky/documentation/mega-manual/figures/define-generic.png
new file mode 100644
index 000000000..bd22718a5
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/define-generic.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/dev-title.png b/import-layers/yocto-poky/documentation/mega-manual/figures/dev-title.png
new file mode 100644
index 000000000..d3cac4a7e
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/dev-title.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/devtool-add-flow.png b/import-layers/yocto-poky/documentation/mega-manual/figures/devtool-add-flow.png
new file mode 100644
index 000000000..c09e60e35
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/devtool-add-flow.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/devtool-modify-flow.png b/import-layers/yocto-poky/documentation/mega-manual/figures/devtool-modify-flow.png
new file mode 100644
index 000000000..cd7f4d05b
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/devtool-modify-flow.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/devtool-upgrade-flow.png b/import-layers/yocto-poky/documentation/mega-manual/figures/devtool-upgrade-flow.png
new file mode 100644
index 000000000..d25168c84
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/devtool-upgrade-flow.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/git-workflow.png b/import-layers/yocto-poky/documentation/mega-manual/figures/git-workflow.png
new file mode 100644
index 000000000..e401330a1
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/git-workflow.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/hosted-service.png b/import-layers/yocto-poky/documentation/mega-manual/figures/hosted-service.png
new file mode 100644
index 000000000..01fea7b24
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/hosted-service.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/image-generation.png b/import-layers/yocto-poky/documentation/mega-manual/figures/image-generation.png
new file mode 100644
index 000000000..71a48dc6f
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/image-generation.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/images.png b/import-layers/yocto-poky/documentation/mega-manual/figures/images.png
new file mode 100644
index 000000000..d99eac1fb
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/images.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/import-layer.png b/import-layers/yocto-poky/documentation/mega-manual/figures/import-layer.png
new file mode 100644
index 000000000..436ec7af4
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/import-layer.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/index-downloads.png b/import-layers/yocto-poky/documentation/mega-manual/figures/index-downloads.png
new file mode 100644
index 000000000..c907997db
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/index-downloads.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/kernel-architecture-overview.png b/import-layers/yocto-poky/documentation/mega-manual/figures/kernel-architecture-overview.png
new file mode 100755
index 000000000..2aad172db
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/kernel-architecture-overview.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/kernel-dev-flow.png b/import-layers/yocto-poky/documentation/mega-manual/figures/kernel-dev-flow.png
new file mode 100644
index 000000000..009105d12
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/kernel-dev-flow.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/kernel-dev-title.png b/import-layers/yocto-poky/documentation/mega-manual/figures/kernel-dev-title.png
new file mode 100644
index 000000000..7a8dd5437
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/kernel-dev-title.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/kernel-overview-1.png b/import-layers/yocto-poky/documentation/mega-manual/figures/kernel-overview-1.png
new file mode 100644
index 000000000..116c0b9bd
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/kernel-overview-1.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/kernel-overview-2-generic.png b/import-layers/yocto-poky/documentation/mega-manual/figures/kernel-overview-2-generic.png
new file mode 100644
index 000000000..cb970eae7
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/kernel-overview-2-generic.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/kernel-title.png b/import-layers/yocto-poky/documentation/mega-manual/figures/kernel-title.png
new file mode 100644
index 000000000..59d86c00d
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/kernel-title.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/kernelshark-all.png b/import-layers/yocto-poky/documentation/mega-manual/figures/kernelshark-all.png
new file mode 100644
index 000000000..99b40bafe
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/kernelshark-all.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/kernelshark-choose-events.png b/import-layers/yocto-poky/documentation/mega-manual/figures/kernelshark-choose-events.png
new file mode 100644
index 000000000..e8dd62a57
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/kernelshark-choose-events.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/kernelshark-i915-display.png b/import-layers/yocto-poky/documentation/mega-manual/figures/kernelshark-i915-display.png
new file mode 100644
index 000000000..bb0edfb7f
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/kernelshark-i915-display.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/kernelshark-output-display.png b/import-layers/yocto-poky/documentation/mega-manual/figures/kernelshark-output-display.png
new file mode 100644
index 000000000..ae2d0e573
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/kernelshark-output-display.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/layer-input.png b/import-layers/yocto-poky/documentation/mega-manual/figures/layer-input.png
new file mode 100644
index 000000000..0a4f2e74f
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/layer-input.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/lttngmain0.png b/import-layers/yocto-poky/documentation/mega-manual/figures/lttngmain0.png
new file mode 100644
index 000000000..5f60113cc
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/lttngmain0.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/mega-title.png b/import-layers/yocto-poky/documentation/mega-manual/figures/mega-title.png
new file mode 100644
index 000000000..cde0b89a4
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/mega-title.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/new-project.png b/import-layers/yocto-poky/documentation/mega-manual/figures/new-project.png
new file mode 100644
index 000000000..dbc50b991
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/new-project.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/oprofileui-busybox.png b/import-layers/yocto-poky/documentation/mega-manual/figures/oprofileui-busybox.png
new file mode 100644
index 000000000..a8275c65d
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/oprofileui-busybox.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/oprofileui-copy-to-user.png b/import-layers/yocto-poky/documentation/mega-manual/figures/oprofileui-copy-to-user.png
new file mode 100644
index 000000000..deb647020
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/oprofileui-copy-to-user.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/oprofileui-downloading.png b/import-layers/yocto-poky/documentation/mega-manual/figures/oprofileui-downloading.png
new file mode 100644
index 000000000..57742d672
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/oprofileui-downloading.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/oprofileui-processes.png b/import-layers/yocto-poky/documentation/mega-manual/figures/oprofileui-processes.png
new file mode 100644
index 000000000..ae547028f
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/oprofileui-processes.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/package-feeds.png b/import-layers/yocto-poky/documentation/mega-manual/figures/package-feeds.png
new file mode 100644
index 000000000..37c9c3250
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/package-feeds.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/patching.png b/import-layers/yocto-poky/documentation/mega-manual/figures/patching.png
new file mode 100644
index 000000000..8ecd01850
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/patching.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/perf-probe-do_fork-profile.png b/import-layers/yocto-poky/documentation/mega-manual/figures/perf-probe-do_fork-profile.png
new file mode 100644
index 000000000..1a1070deb
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/perf-probe-do_fork-profile.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/perf-report-cycles-u.png b/import-layers/yocto-poky/documentation/mega-manual/figures/perf-report-cycles-u.png
new file mode 100644
index 000000000..68ec6af80
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/perf-report-cycles-u.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/perf-systemwide-libc.png b/import-layers/yocto-poky/documentation/mega-manual/figures/perf-systemwide-libc.png
new file mode 100644
index 000000000..2b72869c7
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/perf-systemwide-libc.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/perf-systemwide.png b/import-layers/yocto-poky/documentation/mega-manual/figures/perf-systemwide.png
new file mode 100644
index 000000000..12ce2444a
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/perf-systemwide.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-busybox-annotate-menu.png b/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-busybox-annotate-menu.png
new file mode 100644
index 000000000..ceb34eaea
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-busybox-annotate-menu.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-busybox-annotate-udhcpc.png b/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-busybox-annotate-udhcpc.png
new file mode 100644
index 000000000..3581e9daa
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-busybox-annotate-udhcpc.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-busybox-debuginfo.png b/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-busybox-debuginfo.png
new file mode 100644
index 000000000..c317b49a4
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-busybox-debuginfo.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-busybox-dso-zoom-menu.png b/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-busybox-dso-zoom-menu.png
new file mode 100644
index 000000000..1913c867d
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-busybox-dso-zoom-menu.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-busybox-dso-zoom.png b/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-busybox-dso-zoom.png
new file mode 100644
index 000000000..a1962c437
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-busybox-dso-zoom.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-busybox-expanded-stripped.png b/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-busybox-expanded-stripped.png
new file mode 100644
index 000000000..b642d06c8
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-busybox-expanded-stripped.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-flat-stripped.png b/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-flat-stripped.png
new file mode 100644
index 000000000..c8f395ab5
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-flat-stripped.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-g-copy-from-user-expanded-stripped.png b/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-g-copy-from-user-expanded-stripped.png
new file mode 100644
index 000000000..bb7c764ce
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-g-copy-from-user-expanded-stripped.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-debuginfo.png b/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-debuginfo.png
new file mode 100644
index 000000000..a799af512
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-debuginfo.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.png b/import-layers/yocto-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/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-stripped.png b/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-stripped.png
new file mode 100644
index 000000000..812302d0a
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-stripped.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/poky-title.png b/import-layers/yocto-poky/documentation/mega-manual/figures/poky-title.png
new file mode 100644
index 000000000..2893d8462
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/poky-title.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/profile-title.png b/import-layers/yocto-poky/documentation/mega-manual/figures/profile-title.png
new file mode 100644
index 000000000..ce5c682b5
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/profile-title.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/pybootchartgui-linux-yocto.png b/import-layers/yocto-poky/documentation/mega-manual/figures/pybootchartgui-linux-yocto.png
new file mode 100644
index 000000000..2b6bfdacf
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/pybootchartgui-linux-yocto.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/pychart-linux-yocto-rpm-nostrip.png b/import-layers/yocto-poky/documentation/mega-manual/figures/pychart-linux-yocto-rpm-nostrip.png
new file mode 100644
index 000000000..444675c54
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/pychart-linux-yocto-rpm-nostrip.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/pychart-linux-yocto-rpm.png b/import-layers/yocto-poky/documentation/mega-manual/figures/pychart-linux-yocto-rpm.png
new file mode 100644
index 000000000..8ee35352d
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/pychart-linux-yocto-rpm.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/recipe-workflow.png b/import-layers/yocto-poky/documentation/mega-manual/figures/recipe-workflow.png
new file mode 100644
index 000000000..c0e960b13
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/recipe-workflow.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/sched-wakeup-profile.png b/import-layers/yocto-poky/documentation/mega-manual/figures/sched-wakeup-profile.png
new file mode 100644
index 000000000..2f2581188
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/sched-wakeup-profile.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/sdk-devtool-add-flow.png b/import-layers/yocto-poky/documentation/mega-manual/figures/sdk-devtool-add-flow.png
new file mode 100644
index 000000000..c09e60e35
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/sdk-devtool-add-flow.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/sdk-devtool-modify-flow.png b/import-layers/yocto-poky/documentation/mega-manual/figures/sdk-devtool-modify-flow.png
new file mode 100644
index 000000000..cd06c0181
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/sdk-devtool-modify-flow.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/sdk-eclipse-dev-flow.png b/import-layers/yocto-poky/documentation/mega-manual/figures/sdk-eclipse-dev-flow.png
new file mode 100644
index 000000000..9f986e0d4
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/sdk-eclipse-dev-flow.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/sdk-environment.png b/import-layers/yocto-poky/documentation/mega-manual/figures/sdk-environment.png
new file mode 100644
index 000000000..78b8cad39
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/sdk-environment.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/sdk-generation.png b/import-layers/yocto-poky/documentation/mega-manual/figures/sdk-generation.png
new file mode 100755
index 000000000..adbe1f4ac
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/sdk-generation.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/sdk-installed-extensible-sdk-directory.png b/import-layers/yocto-poky/documentation/mega-manual/figures/sdk-installed-extensible-sdk-directory.png
new file mode 100644
index 000000000..99e07ce6f
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/sdk-installed-extensible-sdk-directory.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/sdk-installed-standard-sdk-directory.png b/import-layers/yocto-poky/documentation/mega-manual/figures/sdk-installed-standard-sdk-directory.png
new file mode 100644
index 000000000..d4af85020
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/sdk-installed-standard-sdk-directory.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/sdk-title.png b/import-layers/yocto-poky/documentation/mega-manual/figures/sdk-title.png
new file mode 100644
index 000000000..e9d5b346b
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/sdk-title.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/sdk.png b/import-layers/yocto-poky/documentation/mega-manual/figures/sdk.png
new file mode 100644
index 000000000..5c36b7548
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/sdk.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/set-variable.png b/import-layers/yocto-poky/documentation/mega-manual/figures/set-variable.png
new file mode 100644
index 000000000..d36b52754
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/set-variable.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/simple-configuration.png b/import-layers/yocto-poky/documentation/mega-manual/figures/simple-configuration.png
new file mode 100644
index 000000000..e8fce2bf1
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/simple-configuration.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/source-fetching.png b/import-layers/yocto-poky/documentation/mega-manual/figures/source-fetching.png
new file mode 100644
index 000000000..26aefb50c
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/source-fetching.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/source-input.png b/import-layers/yocto-poky/documentation/mega-manual/figures/source-input.png
new file mode 100644
index 000000000..f7515058e
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/source-input.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/source-repos.png b/import-layers/yocto-poky/documentation/mega-manual/figures/source-repos.png
new file mode 100644
index 000000000..65c5f29a4
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/source-repos.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/sysprof-callers.png b/import-layers/yocto-poky/documentation/mega-manual/figures/sysprof-callers.png
new file mode 100644
index 000000000..640c8d914
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/sysprof-callers.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/sysprof-copy-from-user.png b/import-layers/yocto-poky/documentation/mega-manual/figures/sysprof-copy-from-user.png
new file mode 100644
index 000000000..8d3142782
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/sysprof-copy-from-user.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/sysprof-copy-to-user.png b/import-layers/yocto-poky/documentation/mega-manual/figures/sysprof-copy-to-user.png
new file mode 100644
index 000000000..7a5bab799
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/sysprof-copy-to-user.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/toaster-title.png b/import-layers/yocto-poky/documentation/mega-manual/figures/toaster-title.png
new file mode 100644
index 000000000..b7ea39cd8
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/toaster-title.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/user-configuration.png b/import-layers/yocto-poky/documentation/mega-manual/figures/user-configuration.png
new file mode 100755
index 000000000..c298401fc
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/user-configuration.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/using-a-pre-built-image.png b/import-layers/yocto-poky/documentation/mega-manual/figures/using-a-pre-built-image.png
new file mode 100644
index 000000000..b03130d12
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/using-a-pre-built-image.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/variable-added.png b/import-layers/yocto-poky/documentation/mega-manual/figures/variable-added.png
new file mode 100644
index 000000000..518f25fa1
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/variable-added.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/yocto-environment-ref.png b/import-layers/yocto-poky/documentation/mega-manual/figures/yocto-environment-ref.png
new file mode 100644
index 000000000..650c6c803
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/yocto-environment-ref.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/yocto-environment.png b/import-layers/yocto-poky/documentation/mega-manual/figures/yocto-environment.png
new file mode 100644
index 000000000..82b7a55a3
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/yocto-environment.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/yocto-project-transp.png b/import-layers/yocto-poky/documentation/mega-manual/figures/yocto-project-transp.png
new file mode 100755
index 000000000..31d2b147f
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/yocto-project-transp.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/figures/yp-download.png b/import-layers/yocto-poky/documentation/mega-manual/figures/yp-download.png
new file mode 100644
index 000000000..5770be688
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/figures/yp-download.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/mega-manual/mega-manual-customization.xsl b/import-layers/yocto-poky/documentation/mega-manual/mega-manual-customization.xsl
new file mode 100644
index 000000000..b52b5b2aa
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/mega-manual/mega-manual.xml b/import-layers/yocto-poky/documentation/mega-manual/mega-manual.xml
new file mode 100644
index 000000000..154e369ab
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/mega-manual.xml
@@ -0,0 +1,236 @@
+<!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>Intel Corporation</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>
+ </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_MM_URL;'>Yocto Project Mega-Manual</ulink>
+ from the Yocto Project website.
+ </note>
+
+ </legalnotice>
+
+ </bookinfo>
+
+<!-- Includes yocto-project-qs -->
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../yocto-project-qs/yocto-project-qs.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-newbie.xml"/>
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../dev-manual/dev-manual-model.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-using.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-appendix-obtain.xml"/>
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../sdk-manual/sdk-appendix-customizing.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/introduction.xml"/>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../ref-manual/usingpoky.xml"/>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../ref-manual/closer-look.xml"/>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../ref-manual/technical-details.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-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/import-layers/yocto-poky/documentation/mega-manual/mega-style.css b/import-layers/yocto-poky/documentation/mega-manual/mega-style.css
new file mode 100644
index 000000000..df71a20a0
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/mega-manual/mega-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/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;
+}
+
+
+ /*********** /
+ / 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/import-layers/yocto-poky/documentation/poky.ent b/import-layers/yocto-poky/documentation/poky.ent
new file mode 100644
index 000000000..673ab23c9
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/poky.ent
@@ -0,0 +1,73 @@
+<!ENTITY DISTRO "2.1">
+<!ENTITY DISTRO_COMPRESSED "21">
+<!ENTITY DISTRO_NAME_NO_CAP "krogoth">
+<!ENTITY DISTRO_NAME "Krogoth">
+<!ENTITY YOCTO_DOC_VERSION "2.1">
+<!ENTITY POKYVERSION "15.0.0">
+<!ENTITY POKYVERSION_COMPRESSED "1500">
+<!ENTITY YOCTO_POKY "poky-&DISTRO_NAME_NO_CAP;-&POKYVERSION;">
+<!ENTITY COPYRIGHT_YEAR "2010-2016">
+<!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 YOCTO_RELEASE_NOTES "&YOCTO_HOME_URL;/downloads/core/&DISTRO_NAME_NO_CAP;&DISTRO_COMPRESSED;">
+<!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 "&YOCTO_AB_URL;:8010">
+<!ENTITY YOCTO_AB_NIGHTLY_URL "&YOCTO_AB_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_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/kernel-manual/kernel-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_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">
+<!ENTITY FEDORA_HOST_PACKAGES_ESSENTIAL "gawk make wget tar bzip2 gzip python 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 \
+ findutils which">
+<!ENTITY OPENSUSE_HOST_PACKAGES_ESSENTIAL "python gcc gcc-c++ git chrpath make wget python-xml \
+ diffstat makeinfo python-curses patch socat">
+<!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 socat \
+ perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue">
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/kernelshark-all.png b/import-layers/yocto-poky/documentation/profile-manual/figures/kernelshark-all.png
new file mode 100644
index 000000000..99b40bafe
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/kernelshark-all.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/kernelshark-choose-events.png b/import-layers/yocto-poky/documentation/profile-manual/figures/kernelshark-choose-events.png
new file mode 100644
index 000000000..e8dd62a57
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/kernelshark-choose-events.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/kernelshark-i915-display.png b/import-layers/yocto-poky/documentation/profile-manual/figures/kernelshark-i915-display.png
new file mode 100644
index 000000000..bb0edfb7f
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/kernelshark-i915-display.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/kernelshark-output-display.png b/import-layers/yocto-poky/documentation/profile-manual/figures/kernelshark-output-display.png
new file mode 100644
index 000000000..ae2d0e573
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/kernelshark-output-display.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/lttngmain0.png b/import-layers/yocto-poky/documentation/profile-manual/figures/lttngmain0.png
new file mode 100644
index 000000000..5f60113cc
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/lttngmain0.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/oprofileui-busybox.png b/import-layers/yocto-poky/documentation/profile-manual/figures/oprofileui-busybox.png
new file mode 100644
index 000000000..a8275c65d
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/oprofileui-busybox.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/oprofileui-copy-to-user.png b/import-layers/yocto-poky/documentation/profile-manual/figures/oprofileui-copy-to-user.png
new file mode 100644
index 000000000..deb647020
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/oprofileui-copy-to-user.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/oprofileui-downloading.png b/import-layers/yocto-poky/documentation/profile-manual/figures/oprofileui-downloading.png
new file mode 100644
index 000000000..57742d672
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/oprofileui-downloading.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/oprofileui-processes.png b/import-layers/yocto-poky/documentation/profile-manual/figures/oprofileui-processes.png
new file mode 100644
index 000000000..ae547028f
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/oprofileui-processes.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/perf-probe-do_fork-profile.png b/import-layers/yocto-poky/documentation/profile-manual/figures/perf-probe-do_fork-profile.png
new file mode 100644
index 000000000..1a1070deb
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/perf-probe-do_fork-profile.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/perf-report-cycles-u.png b/import-layers/yocto-poky/documentation/profile-manual/figures/perf-report-cycles-u.png
new file mode 100644
index 000000000..68ec6af80
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/perf-report-cycles-u.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/perf-systemwide-libc.png b/import-layers/yocto-poky/documentation/profile-manual/figures/perf-systemwide-libc.png
new file mode 100644
index 000000000..2b72869c7
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/perf-systemwide-libc.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/perf-systemwide.png b/import-layers/yocto-poky/documentation/profile-manual/figures/perf-systemwide.png
new file mode 100644
index 000000000..12ce2444a
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/perf-systemwide.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-busybox-annotate-menu.png b/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-busybox-annotate-menu.png
new file mode 100644
index 000000000..ceb34eaea
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-busybox-annotate-menu.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-busybox-annotate-udhcpc.png b/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-busybox-annotate-udhcpc.png
new file mode 100644
index 000000000..3581e9daa
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-busybox-annotate-udhcpc.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-busybox-debuginfo.png b/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-busybox-debuginfo.png
new file mode 100644
index 000000000..c317b49a4
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-busybox-debuginfo.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-busybox-dso-zoom-menu.png b/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-busybox-dso-zoom-menu.png
new file mode 100644
index 000000000..1913c867d
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-busybox-dso-zoom-menu.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-busybox-dso-zoom.png b/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-busybox-dso-zoom.png
new file mode 100644
index 000000000..a1962c437
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-busybox-dso-zoom.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-busybox-expanded-stripped.png b/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-busybox-expanded-stripped.png
new file mode 100644
index 000000000..b642d06c8
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-busybox-expanded-stripped.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-flat-stripped.png b/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-flat-stripped.png
new file mode 100644
index 000000000..c8f395ab5
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-flat-stripped.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-g-copy-from-user-expanded-stripped.png b/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-g-copy-from-user-expanded-stripped.png
new file mode 100644
index 000000000..bb7c764ce
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-g-copy-from-user-expanded-stripped.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-debuginfo.png b/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-debuginfo.png
new file mode 100644
index 000000000..a799af512
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-debuginfo.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.png b/import-layers/yocto-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/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-stripped.png b/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-stripped.png
new file mode 100644
index 000000000..812302d0a
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-stripped.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/profile-title.png b/import-layers/yocto-poky/documentation/profile-manual/figures/profile-title.png
new file mode 100644
index 000000000..ce5c682b5
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/profile-title.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/pybootchartgui-linux-yocto.png b/import-layers/yocto-poky/documentation/profile-manual/figures/pybootchartgui-linux-yocto.png
new file mode 100644
index 000000000..2b6bfdacf
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/pybootchartgui-linux-yocto.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/pychart-linux-yocto-rpm-nostrip.png b/import-layers/yocto-poky/documentation/profile-manual/figures/pychart-linux-yocto-rpm-nostrip.png
new file mode 100644
index 000000000..444675c54
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/pychart-linux-yocto-rpm-nostrip.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/pychart-linux-yocto-rpm.png b/import-layers/yocto-poky/documentation/profile-manual/figures/pychart-linux-yocto-rpm.png
new file mode 100644
index 000000000..8ee35352d
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/pychart-linux-yocto-rpm.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/sched-wakeup-profile.png b/import-layers/yocto-poky/documentation/profile-manual/figures/sched-wakeup-profile.png
new file mode 100644
index 000000000..2f2581188
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/sched-wakeup-profile.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/sysprof-callers.png b/import-layers/yocto-poky/documentation/profile-manual/figures/sysprof-callers.png
new file mode 100644
index 000000000..640c8d914
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/sysprof-callers.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/sysprof-copy-from-user.png b/import-layers/yocto-poky/documentation/profile-manual/figures/sysprof-copy-from-user.png
new file mode 100644
index 000000000..8d3142782
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/sysprof-copy-from-user.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/figures/sysprof-copy-to-user.png b/import-layers/yocto-poky/documentation/profile-manual/figures/sysprof-copy-to-user.png
new file mode 100644
index 000000000..7a5bab799
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/figures/sysprof-copy-to-user.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/profile-manual/profile-manual-arch.xml b/import-layers/yocto-poky/documentation/profile-manual/profile-manual-arch.xml
new file mode 100644
index 000000000..19d115522
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/profile-manual/profile-manual-customization.xsl b/import-layers/yocto-poky/documentation/profile-manual/profile-manual-customization.xsl
new file mode 100644
index 000000000..caa57ef34
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/profile-manual/profile-manual-eclipse-customization.xsl b/import-layers/yocto-poky/documentation/profile-manual/profile-manual-eclipse-customization.xsl
new file mode 100644
index 000000000..a898281ff
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/profile-manual/profile-manual-examples.xml b/import-layers/yocto-poky/documentation/profile-manual/profile-manual-examples.xml
new file mode 100644
index 000000000..9630c6c30
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/profile-manual/profile-manual-intro.xml b/import-layers/yocto-poky/documentation/profile-manual/profile-manual-intro.xml
new file mode 100644
index 000000000..cc47f5267
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/profile-manual-intro.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='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 putting the following
+ in your local.conf 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/import-layers/yocto-poky/documentation/profile-manual/profile-manual-style.css b/import-layers/yocto-poky/documentation/profile-manual/profile-manual-style.css
new file mode 100644
index 000000000..f3cca8536
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/profile-manual/profile-manual-usage.xml b/import-layers/yocto-poky/documentation/profile-manual/profile-manual-usage.xml
new file mode 100644
index 000000000..310e8f01c
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/profile-manual-usage.xml
@@ -0,0 +1,3160 @@
+<!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 INHIBIT_PACKAGE_STRIP = "1" in your
+ local.conf.
+ </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 local.conf
+ when you build the image:
+ <literallayout class='monospaced'>
+ INHIBIT_PACKAGE_STRIP = "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/import-layers/yocto-poky/documentation/profile-manual/profile-manual.xml b/import-layers/yocto-poky/documentation/profile-manual/profile-manual.xml
new file mode 100644
index 000000000..1e0ccc1aa
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/profile-manual/profile-manual.xml
@@ -0,0 +1,110 @@
+<!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>Tom</firstname> <surname>Zanussi</surname>
+ <affiliation>
+ <orgname>Intel Corporation</orgname>
+ </affiliation>
+ <email>tom.zanussi@intel.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>
+ </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_PROF_URL;'>Yocto Project Profiling and Tracing Manual</ulink>
+ from the Yocto Project website.
+ </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/import-layers/yocto-poky/documentation/ref-manual/TODO b/import-layers/yocto-poky/documentation/ref-manual/TODO
new file mode 100644
index 000000000..ee0db977c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/ref-manual/closer-look.xml b/import-layers/yocto-poky/documentation/ref-manual/closer-look.xml
new file mode 100644
index 000000000..84ff584ba
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/closer-look.xml
@@ -0,0 +1,1426 @@
+<!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='closer-look'>
+<title>A Closer Look at the Yocto Project Development Environment</title>
+
+ <para>
+ This chapter takes a more detailed look at the Yocto Project
+ development environment.
+ The following diagram represents the development environment at a
+ high level.
+ The remainder of this chapter expands on the fundamental input, output,
+ process, and
+ <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink>) blocks
+ in the Yocto Project development environment.
+ </para>
+
+ <para id='general-yocto-environment-figure'>
+ <imagedata fileref="figures/yocto-environment-ref.png" align="center" width="8in" depth="4.25in" />
+ </para>
+
+ <para>
+ The generalized Yocto Project Development Environment 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_DEV_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
+ 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 development process.
+ </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-yocto-environment-figure'>general Yocto Project Development Environment figure</link>:
+ </para>
+
+ <para>
+ <imagedata fileref="figures/user-configuration.png" align="center" />
+ </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
+ <ulink url='&YOCTO_DOCS_DEV_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 <filename>poky</filename> 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 the build environment
+ script
+ (i.e.
+ <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>
+ or
+ <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>).
+ </para>
+
+ <para>
+ Sourcing the build environment script creates a
+ <ulink url='&YOCTO_DOCS_DEV_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> or
+ <filename>oe-init-build-env-memres</filename> script in the context
+ of separate OpenEmbedded-Core 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
+ <filename>local.conf.sample</filename> in the
+ <filename>meta-poky</filename> layer:
+ <itemizedlist>
+ <listitem><para><emphasis>Parallelism Options:</emphasis>
+ Controlled by the
+ <link linkend='var-BB_NUMBER_THREADS'><filename>BB_NUMBER_THREADS</filename></link>,
+ <link linkend='var-PARALLEL_MAKE'><filename>PARALLEL_MAKE</filename></link>,
+ and
+ <ulink url='&YOCTO_DOCS_BB_URL;#var-BB_NUMBER_PARSE_THREADS'><filename>BB_NUMBER_PARSE_THREADS</filename></ulink>
+ variables.</para></listitem>
+ <listitem><para><emphasis>Target Machine Selection:</emphasis>
+ Controlled by the
+ <link linkend='var-MACHINE'><filename>MACHINE</filename></link>
+ variable.</para></listitem>
+ <listitem><para><emphasis>Download Directory:</emphasis>
+ Controlled by the
+ <link linkend='var-DL_DIR'><filename>DL_DIR</filename></link>
+ variable.</para></listitem>
+ <listitem><para><emphasis>Shared State Directory:</emphasis>
+ Controlled by the
+ <link linkend='var-SSTATE_DIR'><filename>SSTATE_DIR</filename></link>
+ variable.</para></listitem>
+ <listitem><para><emphasis>Build Output:</emphasis>
+ Controlled by the
+ <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>
+ 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 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
+ <link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link>
+ variable.</para>
+ <para>One useful scenario for using the
+ <filename>conf/site.conf</filename> file is to extend your
+ <link linkend='var-BBPATH'><filename>BBPATH</filename></link>
+ 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 OpenEmbedded build system
+ 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.
+ 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
+ policy.
+ </para>
+
+ <para>
+ In general, three types of layer input exist:
+ <itemizedlist>
+ <listitem><para><emphasis>Policy Configuration:</emphasis>
+ Distribution Layers provide top-level or general
+ policies for the image or SDK being built.
+ For example, this layer would dictate whether BitBake
+ produces RPM or IPK packages.</para></listitem>
+ <listitem><para><emphasis>Machine Configuration:</emphasis>
+ Board Support Package (BSP) layers provide machine
+ configurations.
+ This type of information is specific to a particular
+ target architecture.</para></listitem>
+ <listitem><para><emphasis>Metadata:</emphasis>
+ Software layers contain user-supplied recipe files,
+ patches, and append files.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ The following figure shows an expanded representation of the
+ Metadata, Machine Configuration, and Policy Configuration input
+ (layers) boxes of the
+ <link linkend='general-yocto-environment-figure'>general Yocto Project Development Environment figure</link>:
+ </para>
+
+ <para>
+ <imagedata fileref="figures/layer-input.png" align="center" width="8in" depth="7.5in" />
+ </para>
+
+ <para>
+ In general, all layers have a similar structure.
+ They all contain a licensing file
+ (e.g. <filename>COPYING</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.
+ </para>
+
+ <para>
+ The Yocto Project has many layers that can be used.
+ You can see a web-interface listing of them on the
+ <ulink url="http://git.yoctoproject.org/">Source Repositories</ulink>
+ page.
+ The layers are shown at the bottom categorized under
+ "Yocto Metadata Layers."
+ These layers are fundamentally a subset of the
+ <ulink url="http://layers.openembedded.org/layerindex/layers/">OpenEmbedded Metadata Index</ulink>,
+ which lists all layers provided by the OpenEmbedded community.
+ <note>
+ Layers exist in the Yocto Project Source Repositories that
+ cannot be found in the OpenEmbedded Metadata 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>
+
+ <para>
+ For more 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 Manual.
+ </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
+ "<link linkend='ref-classes'>Classes</link>" section.
+ </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.</para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id="bsp-layer">
+ <title>BSP Layer</title>
+
+ <para>
+ The BSP Layer provides machine configurations.
+ 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>, and
+ <filename>recipes-kernel</filename>.
+ 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 new recipes that your project needs
+ in the form of recipe files.
+ </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-yocto-environment-figure'>general Yocto Project Development Environment 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 Mirror(s)" 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
+ <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>
+ 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
+ <link linkend='var-DL_DIR'><filename>DL_DIR</filename></link>
+ 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
+ <link linkend='var-BB_GENERATE_MIRROR_TARBALLS'><filename>BB_GENERATE_MIRROR_TARBALLS</filename></link>
+ 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
+ base figure:
+ <imagedata fileref="figures/source-input.png" align="center" width="7in" depth="7.5in" />
+ </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
+ <link linkend='ref-classes-externalsrc'><filename>externalsrc</filename></link>
+ 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>
+
+ <para>
+ For information on how to use the
+ <filename>externalsrc</filename> class, see the
+ "<link linkend='ref-classes-externalsrc'><filename>externalsrc.bbclass</filename></link>"
+ section.
+ </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
+ <link linkend='ref-tasks-fetch'><filename>do_fetch</filename></link>
+ task inside BitBake 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>
+
+ <note>
+ For information on how to have the OpenEmbedded build system
+ generate tarballs for Git repositories and place them in the
+ <link linkend='var-DL_DIR'><filename>DL_DIR</filename></link>
+ directory, see the
+ <link linkend='var-BB_GENERATE_MIRROR_TARBALLS'><filename>BB_GENERATE_MIRROR_TARBALLS</filename></link>
+ variable.
+ </note>
+
+ <para>
+ When fetching a repository, BitBake uses the
+ <link linkend='var-SRCREV'><filename>SRCREV</filename></link>
+ 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 <link linkend='var-PREMIRRORS'><filename>PREMIRRORS</filename></link>
+ and
+ <link linkend='var-MIRRORS'><filename>MIRRORS</filename></link>
+ 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
+ <link linkend='var-DL_DIR'><filename>DL_DIR</filename></link>
+ 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_DEV_URL;#build-directory'>Build Directory</ulink>.
+ The
+ <link linkend='general-yocto-environment-figure'>general Yocto Project Development Environment 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
+ <link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link>
+ variable.
+ Before placing the packages into package feeds,
+ the build process validates them with generated output quality
+ assurance checks through the
+ <link linkend='ref-classes-insane'><filename>insane</filename></link>
+ 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><link linkend='var-DEPLOY_DIR'><filename>DEPLOY_DIR</filename></link>:
+ 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
+ <link linkend='var-DEPLOY_DIR_RPM'><filename>DEPLOY_DIR_RPM</filename></link>,
+ <link linkend='var-DEPLOY_DIR_IPK'><filename>DEPLOY_DIR_IPK</filename></link>,
+ <link linkend='var-DEPLOY_DIR_DEB'><filename>DEPLOY_DIR_DEB</filename></link>,
+ or
+ <link linkend='var-DEPLOY_DIR_TAR'><filename>DEPLOY_DIR_TAR</filename></link>,
+ variables are used, respectively.
+ </para></listitem>
+ <listitem><para><link linkend='var-PACKAGE_ARCH'><filename>PACKAGE_ARCH</filename></link>:
+ Defines architecture-specific sub-folders.
+ For example, packages could exist for the i586 or qemux86
+ architectures.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ BitBake uses the <filename>do_package_write_*</filename> 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
+ "<link linkend='ref-tasks-package_write_deb'><filename>do_package_write_deb</filename></link>",
+ "<link linkend='ref-tasks-package_write_ipk'><filename>do_package_write_ipk</filename></link>",
+ "<link linkend='ref-tasks-package_write_rpm'><filename>do_package_write_rpm</filename></link>",
+ and
+ "<link linkend='ref-tasks-package_write_tar'><filename>do_package_write_tar</filename></link>"
+ sections 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_DEV_URL;#bitbake-term'>BitBake</ulink>
+ to produce images.
+ You can see from the
+ <link linkend='general-yocto-environment-figure'>general Yocto Project Development Environment figure</link>,
+ the BitBake area consists of several functional areas.
+ This section takes a closer look at each of those areas.
+ </para>
+
+ <para>
+ 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.
+ </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
+ <link linkend='ref-tasks-fetch'><filename>do_fetch</filename></link>
+ and
+ <link linkend='ref-tasks-unpack'><filename>do_unpack</filename></link>
+ tasks fetch the source files and unpack them into the work
+ directory.
+ <note>
+ For every local file (e.g. <filename>file://</filename>)
+ that is part of a recipe's
+ <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>
+ 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>.
+ 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>,
+ which has a defined structure.
+ For additional general information on the Build Directory,
+ see the
+ "<link linkend='structure-core-build'><filename>build/</filename></link>"
+ section.
+ </para>
+
+ <para>
+ Unpacked source files are pointed to by the
+ <link linkend='var-S'><filename>S</filename></link> variable.
+ Each recipe has an area in the Build Directory where the
+ unpacked source code resides.
+ The name of that directory for any given recipe is defined from
+ several different variables.
+ You can see the variables that define these directories
+ by looking at the figure:
+ <itemizedlist>
+ <listitem><para><link linkend='var-TMPDIR'><filename>TMPDIR</filename></link> -
+ The base directory where the OpenEmbedded build system
+ performs all its work during the build.
+ </para></listitem>
+ <listitem><para><link linkend='var-PACKAGE_ARCH'><filename>PACKAGE_ARCH</filename></link> -
+ The architecture of the built package or packages.
+ </para></listitem>
+ <listitem><para><link linkend='var-TARGET_OS'><filename>TARGET_OS</filename></link> -
+ The operating system of the target device.
+ </para></listitem>
+ <listitem><para><link linkend='var-PN'><filename>PN</filename></link> -
+ The name of the built package.
+ </para></listitem>
+ <listitem><para><link linkend='var-PV'><filename>PV</filename></link> -
+ The version of the recipe used to build the package.
+ </para></listitem>
+ <listitem><para><link linkend='var-PR'><filename>PR</filename></link> -
+ The revision of the recipe used to build the package.
+ </para></listitem>
+ <listitem><para><link linkend='var-WORKDIR'><filename>WORKDIR</filename></link> -
+ The location within <filename>TMPDIR</filename> where
+ a specific package is built.
+ </para></listitem>
+ <listitem><para><link linkend='var-S'><filename>S</filename></link> -
+ Contains the unpacked source files for a given recipe.
+ </para></listitem>
+ </itemizedlist>
+ </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="6in" depth="5in" />
+ </para>
+
+ <para>
+ The
+ <link linkend='ref-tasks-patch'><filename>do_patch</filename></link>
+ task processes recipes by
+ using the
+ <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>
+ variable to locate applicable patch files, which by default
+ are <filename>*.patch</filename> or
+ <filename>*.diff</filename> files, or any file if
+ "apply=yes" is specified for the file in
+ <filename>SRC_URI</filename>.
+ </para>
+
+ <para>
+ BitBake finds and applies multiple patches for a single recipe
+ in the order in which it finds the patches.
+ Patches are applied to the recipe's source files located in the
+ <link linkend='var-S'><filename>S</filename></link> 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.
+ </para>
+ </section>
+
+ <section id='configuration-and-compilation-dev-environment'>
+ <title>Configuration and Compilation</title>
+
+ <para>
+ After source code is patched, BitBake executes tasks that
+ configure and compile the source code:
+ <imagedata fileref="figures/configuration-compile-autoreconf.png" align="center" width="7in" depth="5in" />
+ </para>
+
+ <para>
+ This step in the build process consists of three tasks:
+ <itemizedlist>
+ <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
+ <link linkend='ref-tasks-configure'><filename>do_configure</filename></link>
+ task are specific
+ to source code configuration for the source code
+ being built by the recipe.</para>
+
+ <para>If you are using the
+ <link linkend='ref-classes-autotools'><filename>autotools</filename></link>
+ class,
+ you can add additional configuration options by using
+ the <link linkend='var-EXTRA_OECONF'><filename>EXTRA_OECONF</filename></link>
+ variable.
+ For information on how this variable works within
+ that class, see the
+ <filename>meta/classes/autotools.bbclass</filename> file.
+ </para></listitem>
+ <listitem><para><emphasis><filename>do_compile</filename>:</emphasis>
+ Once a configuration task has been satisfied, BitBake
+ compiles the source using the
+ <link linkend='ref-tasks-compile'><filename>do_compile</filename></link>
+ task.
+ Compilation occurs in the directory pointed to by the
+ <link linkend='var-B'><filename>B</filename></link>
+ variable.
+ Realize that the <filename>B</filename> directory is, by
+ default, the same as the
+ <link linkend='var-S'><filename>S</filename></link>
+ directory.</para></listitem>
+ <listitem><para><emphasis><filename>do_install</filename>:</emphasis>
+ Once compilation is done, BitBake executes the
+ <link linkend='ref-tasks-install'><filename>do_install</filename></link>
+ task.
+ This task copies files from the <filename>B</filename>
+ directory and places them in a holding area pointed to
+ by the
+ <link linkend='var-D'><filename>D</filename></link>
+ variable.</para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='package-splitting-dev-environment'>
+ <title>Package Splitting</title>
+
+ <para>
+ After source code is configured and compiled, the
+ OpenEmbedded 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
+ <link linkend='ref-tasks-package'><filename>do_package</filename></link>
+ and
+ <link linkend='ref-tasks-packagedata'><filename>do_packagedata</filename></link>
+ tasks combine to analyze
+ the files found in the
+ <link linkend='var-D'><filename>D</filename></link> directory
+ and split them into subsets based on available packages and
+ files.
+ The analyzing process involves the following as well as other
+ items: splitting out debugging symbols,
+ looking at shared library dependencies between packages,
+ and looking at package relationships.
+ The <filename>do_packagedata</filename> task creates package
+ metadata based on the analysis such that the
+ OpenEmbedded build system can generate the final packages.
+ Working, staged, and intermediate results of the analysis
+ and package splitting process use these areas:
+ <itemizedlist>
+ <listitem><para><link linkend='var-PKGD'><filename>PKGD</filename></link> -
+ The destination directory for packages before they are
+ split.
+ </para></listitem>
+ <listitem><para><link linkend='var-PKGDATA_DIR'><filename>PKGDATA_DIR</filename></link> -
+ A shared, global-state directory that holds data
+ generated during the packaging process.
+ </para></listitem>
+ <listitem><para><link linkend='var-PKGDESTWORK'><filename>PKGDESTWORK</filename></link> -
+ A temporary work area used by the
+ <filename>do_package</filename> task.
+ </para></listitem>
+ <listitem><para><link linkend='var-PKGDEST'><filename>PKGDEST</filename></link> -
+ The parent directory for packages after they have
+ been split.
+ </para></listitem>
+ </itemizedlist>
+ The <link linkend='var-FILES'><filename>FILES</filename></link>
+ variable defines the files that go into each package in
+ <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link>.
+ If you want details on how this is accomplished, you can
+ look at the
+ <link linkend='ref-classes-package'><filename>package</filename></link>
+ class.
+ </para>
+
+ <para>
+ Depending on the type of packages being created (RPM, DEB, or
+ IPK), the <filename>do_package_write_*</filename> 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 OpenEmbedded build system uses BitBake to generate the
+ root filesystem image:
+ <imagedata fileref="figures/image-generation.png" align="center" width="6in" depth="7in" />
+ </para>
+
+ <para>
+ The image generation process consists of several stages and
+ depends on several tasks and variables.
+ The
+ <link linkend='ref-tasks-rootfs'><filename>do_rootfs</filename></link>
+ 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><link linkend='var-IMAGE_INSTALL'><filename>IMAGE_INSTALL</filename></link>:
+ Lists out the base set of packages to install from
+ the Package Feeds area.</para></listitem>
+ <listitem><para><link linkend='var-PACKAGE_EXCLUDE'><filename>PACKAGE_EXCLUDE</filename></link>:
+ Specifies packages that should not be installed.
+ </para></listitem>
+ <listitem><para><link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link>:
+ Specifies features to include in the image.
+ Most of these features map to additional packages for
+ installation.</para></listitem>
+ <listitem><para><link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link>:
+ Specifies the package backend to use and consequently
+ helps determine where to locate packages within the
+ Package Feeds area.</para></listitem>
+ <listitem><para><link linkend='var-IMAGE_LINGUAS'><filename>IMAGE_LINGUAS</filename></link>:
+ Determines the language(s) for which additional
+ language support packages are installed.
+ </para></listitem>
+ <listitem><para><link linkend='var-PACKAGE_INSTALL'><filename>PACKAGE_INSTALL</filename></link>:
+ The final list of packages passed to the package manager
+ for installation into the image.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ With
+ <link linkend='var-IMAGE_ROOTFS'><filename>IMAGE_ROOTFS</filename></link>
+ 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. smart/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, postinstall
+ 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 during the
+ package installation phase since the root filesystem 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
+ <link linkend='ref-classes-testimage*'><filename>testimage</filename></link>
+ class, for example, to determine whether or not to run
+ specific tests.
+ See the
+ <link linkend='var-IMAGE_MANIFEST'><filename>IMAGE_MANIFEST</filename></link>
+ variable for additional information.
+ </para>
+
+ <para>
+ Optimizing processes run across the image include
+ <filename>mklibs</filename>, <filename>prelink</filename>,
+ and any other post-processing commands as defined by the
+ <link linkend='var-ROOTFS_POSTPROCESS_COMMAND'><filename>ROOTFS_POSTPROCESS_COMMAND</filename></link>
+ 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 <filename>do_image</filename> task.
+ The build system runs any pre-processing commands as defined
+ by the
+ <link linkend='var-IMAGE_PREPROCESS_COMMAND'><filename>IMAGE_PREPROCESS_COMMAND</filename></link>
+ variable.
+ This variable specifies a list of functions to call before
+ the OpenEmbedded build system creates the final image output
+ files.
+ </para>
+
+ <para>
+ The <filename>do_image</filename> task dynamically creates
+ other <filename>do_image_*</filename> tasks as needed, which
+ include compressing the root filesystem image to reduce the
+ overall size of the image.
+ The process turns everything into an image file or a set of
+ image files.
+ The formats used for the root filesystem depend on the
+ <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>
+ variable.
+ </para>
+
+ <para>
+ The final task involved in image creation is the
+ <filename>do_image_complete</filename> task.
+ This task completes the image by applying any image
+ post processing as defined through the
+ <link linkend='var-IMAGE_POSTPROCESS_COMMAND'><filename>IMAGE_POSTPROCESS_COMMAND</filename></link>
+ variable.
+ The variable specifies a list of functions to call once the
+ OpenEmbedded build system has created the final image output
+ files.
+ </para>
+
+ <note>
+ The entire image generation process is run under Pseudo.
+ Running under Pseudo ensures that the files in the root
+ filesystem have correct ownership.
+ </note>
+ </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 script for both the
+ standard and extensible SDKs:
+ <imagedata fileref="figures/sdk-generation.png" align="center" />
+ </para>
+
+ <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
+ <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 Software Development Kit (SDK)
+ Developer's Guide.
+ </note>
+
+ <para>
+ Like image generation, the SDK script process consists of
+ several stages and depends on many variables.
+ The <filename>do_populate_sdk</filename> and
+ <filename>do_populate_sdk_ext</filename> 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
+ <link linkend='var-SDKMACHINE'><filename>SDKMACHINE</filename></link>.
+ </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>
+
+ <section id='images-dev-environment'>
+ <title>Images</title>
+
+ <para>
+ The images produced by the OpenEmbedded build system
+ are compressed forms of the
+ root filesystem that are ready to boot on a target device.
+ You can see from the
+ <link linkend='general-yocto-environment-figure'>general Yocto Project Development Environment figure</link>
+ that BitBake output, in part, consists of images.
+ This section is going to look more closely at this output:
+ <imagedata fileref="figures/images.png" align="center" width="5.5in" depth="5.5in" />
+ </para>
+
+ <para>
+ For a list of example images that the Yocto Project provides,
+ see the
+ "<link linkend='ref-images'>Images</link>" chapter.
+ </para>
+
+ <para>
+ Images are written out to the
+ <ulink url='&YOCTO_DOCS_DEV_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
+ <link linkend='var-DEPLOY_DIR'><filename>DEPLOY_DIR</filename></link>
+ variable points to the <filename>deploy</filename> directory,
+ while the
+ <link linkend='var-DEPLOY_DIR_IMAGE'><filename>DEPLOY_DIR_IMAGE</filename></link>
+ variable points to the appropriate directory containing images for
+ the current configuration.
+ <itemizedlist>
+ <listitem><para><filename><replaceable>kernel-image</replaceable></filename>:
+ A kernel binary file.
+ The <link linkend='var-KERNEL_IMAGETYPE'><filename>KERNEL_IMAGETYPE</filename></link>
+ variable setting determines the naming scheme for the
+ kernel image file.
+ Depending on that variable, the file could begin with
+ a variety of naming strings.
+ The <filename>deploy/images/<replaceable>machine</replaceable></filename>
+ directory can contain multiple image files for the
+ machine.</para></listitem>
+ <listitem><para><filename><replaceable>root-filesystem-image</replaceable></filename>:
+ Root filesystems for the target device (e.g.
+ <filename>*.ext3</filename> or <filename>*.bz2</filename>
+ files).
+ The <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>
+ variable setting determines the root filesystem image
+ type.
+ The <filename>deploy/images/<replaceable>machine</replaceable></filename>
+ directory can contain multiple root filesystems for the
+ machine.</para></listitem>
+ <listitem><para><filename><replaceable>kernel-modules</replaceable></filename>:
+ Tarballs that contain all the modules built for the kernel.
+ Kernel module tarballs exist for legacy purposes and
+ can be suppressed by setting the
+ <link linkend='var-MODULE_TARBALL_DEPLOY'><filename>MODULE_TARBALL_DEPLOY</filename></link>
+ variable to "0".
+ The <filename>deploy/images/<replaceable>machine</replaceable></filename>
+ directory can contain multiple kernel module tarballs
+ for the machine.</para></listitem>
+ <listitem><para><filename><replaceable>bootloaders</replaceable></filename>:
+ Bootloaders supporting the image, if applicable to the
+ target machine.
+ The <filename>deploy/images/<replaceable>machine</replaceable></filename>
+ directory can contain multiple bootloaders for the
+ machine.</para></listitem>
+ <listitem><para><filename><replaceable>symlinks</replaceable></filename>:
+ The <filename>deploy/images/<replaceable>machine</replaceable></filename>
+ 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-yocto-environment-figure'>general Yocto Project Development Environment figure</link>,
+ the output labeled "Application Development SDK" represents an
+ SDK.
+ The SDK generation process differs depending on whether you build
+ a standard SDK
+ (e.g. <filename>bitbake -c populate_sdk</filename> <replaceable>imagename</replaceable>)
+ or an extensible SDK
+ (e.g. <filename>bitbake -c populate_sdk_ext</filename> <replaceable>imagename</replaceable>).
+ This section is going to take 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 self-extracting
+ SDK installer (<filename>*.sh</filename>) that, when run,
+ installs the SDK, which 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>
+ <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>
+
+ <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.
+ For information on setting up a cross-development
+ environment, see the
+ <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-manual'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>.
+ </para>
+ </note>
+
+ <para>
+ Once built, the SDK installers are written out to the
+ <filename>deploy/sdk</filename> folder inside the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
+ as shown in the figure at the beginning of this section.
+ Depending on the type of SDK, several variables exist that help
+ configure these files.
+ The following list shows the variables associated with a standard
+ SDK:
+ <itemizedlist>
+ <listitem><para><link linkend='var-DEPLOY_DIR'><filename>DEPLOY_DIR</filename></link>:
+ Points to the <filename>deploy</filename>
+ directory.</para></listitem>
+ <listitem><para><link linkend='var-SDKMACHINE'><filename>SDKMACHINE</filename></link>:
+ 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><link linkend='var-SDKIMAGE_FEATURES'><filename>SDKIMAGE_FEATURES</filename></link>:
+ Lists the features to include in the "target" part
+ of the SDK.
+ </para></listitem>
+ <listitem><para><link linkend='var-TOOLCHAIN_HOST_TASK'><filename>TOOLCHAIN_HOST_TASK</filename></link>:
+ 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><link linkend='var-TOOLCHAIN_TARGET_TASK'><filename>TOOLCHAIN_TARGET_TASK</filename></link>:
+ Lists packages that make up the target part
+ of the SDK (i.e. the part built for the
+ target hardware).
+ </para></listitem>
+ <listitem><para><link linkend='var-SDKPATH'><filename>SDKPATH</filename></link>:
+ Defines the default SDK installation path offered by the
+ installation script.
+ </para></listitem>
+ </itemizedlist>
+ This next list, shows the variables associated with an extensible
+ SDK:
+ <itemizedlist>
+ <listitem><para><link linkend='var-DEPLOY_DIR'><filename>DEPLOY_DIR</filename></link>:
+ Points to the <filename>deploy</filename> directory.
+ </para></listitem>
+ <listitem><para><link linkend='var-SDK_EXT_TYPE'><filename>SDK_EXT_TYPE</filename></link>:
+ 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><link linkend='var-SDK_INCLUDE_PKGDATA'><filename>SDK_INCLUDE_PKGDATA</filename></link>:
+ Specifies whether or not packagedata will be included in
+ the extensible SDK for all recipes in the "world" target.
+ </para></listitem>
+ <listitem><para><link linkend='var-SDK_LOCAL_CONF_WHITELIST'><filename>SDK_LOCAL_CONF_WHITELIST</filename></link>:
+ A list of variables allowed through from the build system
+ configuration into the extensible SDK configuration.
+ </para></listitem>
+ <listitem><para><link linkend='var-SDK_LOCAL_CONF_BLACKLIST'><filename>SDK_LOCAL_CONF_BLACKLIST</filename></link>:
+ A list of variables not allowed through from the build
+ system configuration into the extensible SDK configuration.
+ </para></listitem>
+ <listitem><para><link linkend='var-SDK_INHERIT_BLACKLIST'><filename>SDK_INHERIT_BLACKLIST</filename></link>:
+ A list of classes to remove from the
+ <link linkend='var-INHERIT'><filename>INHERIT</filename></link>
+ value globally within the extensible SDK configuration.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/import-layers/yocto-poky/documentation/ref-manual/examples/hello-autotools/hello_2.3.bb b/import-layers/yocto-poky/documentation/ref-manual/examples/hello-autotools/hello_2.3.bb
new file mode 100644
index 000000000..5dfb0b30c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/ref-manual/examples/hello-single/files/helloworld.c b/import-layers/yocto-poky/documentation/ref-manual/examples/hello-single/files/helloworld.c
new file mode 100644
index 000000000..fc7169b7b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/ref-manual/examples/hello-single/hello.bb b/import-layers/yocto-poky/documentation/ref-manual/examples/hello-single/hello.bb
new file mode 100644
index 000000000..0812743e3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/ref-manual/examples/libxpm/libxpm_3.5.6.bb b/import-layers/yocto-poky/documentation/ref-manual/examples/libxpm/libxpm_3.5.6.bb
new file mode 100644
index 000000000..b58d4d7bd
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/ref-manual/examples/mtd-makefile/mtd-utils_1.0.0.bb b/import-layers/yocto-poky/documentation/ref-manual/examples/mtd-makefile/mtd-utils_1.0.0.bb
new file mode 100644
index 000000000..5d05a437a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/ref-manual/faq.xml b/import-layers/yocto-poky/documentation/ref-manual/faq.xml
new file mode 100644
index 000000000..d2e4e8eb1
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/faq.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='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 "<ulink url='&YOCTO_DOCS_DEV_URL;#poky'>Poky</ulink>"
+ refers to the specific reference build system that
+ the Yocto Project provides.
+ Poky is based on <ulink url='&YOCTO_DOCS_DEV_URL;#oe-core'>OE-Core</ulink>
+ and <ulink url='&YOCTO_DOCS_DEV_URL;#bitbake-term'>BitBake</ulink>.
+ 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 2.7.3 or greater, or
+ I do have Python 3.x, which is specifically not supported by
+ the Yocto Project.
+ 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#oe-core'>OE-Core</ulink> 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 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>"
+ in the Yocto Project Development 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 on
+ <filename>&YOCTO_HOME_URL;/sources/*</filename>. 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_DEV_URL;#licensing'>Licensing</ulink>"
+ and "<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>"
+ sections, both of which are in the Yocto Project Development
+ 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ </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>
+ or
+ <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>).
+ By default, this <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
+ 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
+ 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#bitbake-term'>BitBake</ulink>.
+ 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/import-layers/yocto-poky/documentation/ref-manual/figures/analysis-for-package-splitting.png b/import-layers/yocto-poky/documentation/ref-manual/figures/analysis-for-package-splitting.png
new file mode 100644
index 000000000..04f2794ea
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/figures/analysis-for-package-splitting.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/ref-manual/figures/buildhistory-web.png b/import-layers/yocto-poky/documentation/ref-manual/figures/buildhistory-web.png
new file mode 100644
index 000000000..f6db86c97
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/figures/buildhistory-web.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/ref-manual/figures/buildhistory.png b/import-layers/yocto-poky/documentation/ref-manual/figures/buildhistory.png
new file mode 100644
index 000000000..bd5f8a490
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/figures/buildhistory.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/ref-manual/figures/building-an-image.png b/import-layers/yocto-poky/documentation/ref-manual/figures/building-an-image.png
new file mode 100755
index 000000000..1fbea5ab0
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/figures/building-an-image.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/ref-manual/figures/configuration-compile-autoreconf.png b/import-layers/yocto-poky/documentation/ref-manual/figures/configuration-compile-autoreconf.png
new file mode 100644
index 000000000..a07464f04
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/figures/configuration-compile-autoreconf.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/ref-manual/figures/cross-development-toolchains.png b/import-layers/yocto-poky/documentation/ref-manual/figures/cross-development-toolchains.png
new file mode 100644
index 000000000..d36670a19
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/figures/cross-development-toolchains.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/ref-manual/figures/define-generic.png b/import-layers/yocto-poky/documentation/ref-manual/figures/define-generic.png
new file mode 100644
index 000000000..bd22718a5
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/figures/define-generic.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/ref-manual/figures/image-generation.png b/import-layers/yocto-poky/documentation/ref-manual/figures/image-generation.png
new file mode 100644
index 000000000..71a48dc6f
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/figures/image-generation.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/ref-manual/figures/images.png b/import-layers/yocto-poky/documentation/ref-manual/figures/images.png
new file mode 100644
index 000000000..d99eac1fb
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/figures/images.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/ref-manual/figures/layer-input.png b/import-layers/yocto-poky/documentation/ref-manual/figures/layer-input.png
new file mode 100644
index 000000000..0a4f2e74f
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/figures/layer-input.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/ref-manual/figures/package-feeds.png b/import-layers/yocto-poky/documentation/ref-manual/figures/package-feeds.png
new file mode 100644
index 000000000..37c9c3250
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/figures/package-feeds.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/ref-manual/figures/patching.png b/import-layers/yocto-poky/documentation/ref-manual/figures/patching.png
new file mode 100644
index 000000000..8ecd01850
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/figures/patching.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/ref-manual/figures/poky-title.png b/import-layers/yocto-poky/documentation/ref-manual/figures/poky-title.png
new file mode 100644
index 000000000..2893d8462
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/figures/poky-title.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/ref-manual/figures/sdk-generation.png b/import-layers/yocto-poky/documentation/ref-manual/figures/sdk-generation.png
new file mode 100755
index 000000000..adbe1f4ac
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/figures/sdk-generation.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/ref-manual/figures/sdk.png b/import-layers/yocto-poky/documentation/ref-manual/figures/sdk.png
new file mode 100644
index 000000000..5c36b7548
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/figures/sdk.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/ref-manual/figures/source-fetching.png b/import-layers/yocto-poky/documentation/ref-manual/figures/source-fetching.png
new file mode 100644
index 000000000..26aefb50c
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/figures/source-fetching.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/ref-manual/figures/source-input.png b/import-layers/yocto-poky/documentation/ref-manual/figures/source-input.png
new file mode 100644
index 000000000..f7515058e
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/figures/source-input.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/ref-manual/figures/user-configuration.png b/import-layers/yocto-poky/documentation/ref-manual/figures/user-configuration.png
new file mode 100755
index 000000000..c298401fc
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/figures/user-configuration.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/ref-manual/figures/yocto-environment-ref.png b/import-layers/yocto-poky/documentation/ref-manual/figures/yocto-environment-ref.png
new file mode 100644
index 000000000..650c6c803
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/figures/yocto-environment-ref.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/ref-manual/introduction.xml b/import-layers/yocto-poky/documentation/ref-manual/introduction.xml
new file mode 100644
index 000000000..ce8fa5c65
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/introduction.xml
@@ -0,0 +1,624 @@
+<!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-intro'>
+<title>Introduction</title>
+
+<section id='intro-welcome'>
+ <title>Introduction</title>
+
+ <para>
+ This manual provides reference information for the current release
+ of the Yocto Project.
+ The Yocto Project is an open-source collaboration project focused
+ on embedded Linux developers.
+ Amongst other things, the Yocto Project uses the OpenEmbedded build
+ system, which is based on the Poky project, to construct complete
+ Linux images.
+ You can find complete introductory and getting started information
+ on the Yocto Project by reading the
+ <ulink url='&YOCTO_DOCS_QS_URL;'>Yocto Project Quick Start</ulink>.
+ </para>
+
+ <para>
+ For task-based information using the Yocto Project, see the
+ <ulink url='&YOCTO_DOCS_DEV_URL;'>Yocto Project Development Manual</ulink>
+ and the <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;'>Yocto Project Linux Kernel Development Manual</ulink>.
+ For Board Support Package (BSP) structure information, see the
+ <ulink url='&YOCTO_DOCS_BSP_URL;'>Yocto Project Board Support Package (BSP) Developer's Guide</ulink>.
+ For information on how to use a Software Development Kit, (SDK), see the
+ <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>.
+ You can find information on tracing and profiling in the
+ <ulink url='&YOCTO_DOCS_PROF_URL;'>Yocto Project Profiling and Tracing Manual</ulink>.
+ For information on BitBake, which is the task execution tool the
+ OpenEmbedded build system is based on, see the
+ <ulink url='&YOCTO_DOCS_BB_URL;#bitbake-user-manual'>BitBake User Manual</ulink>.
+ Finally, you can also find lots of Yocto Project information on the
+ <ulink url="&YOCTO_HOME_URL;">Yocto Project website</ulink>.
+ </para>
+</section>
+
+<section id='intro-manualoverview'>
+ <title>Documentation Overview</title>
+ <para>
+ This reference manual consists of the following:
+ <itemizedlist>
+ <listitem><para><emphasis>
+ <link linkend='usingpoky'>Using the Yocto Project</link>:</emphasis>
+ Provides an overview of the components that make up the Yocto Project
+ followed by information about debugng images created in the Yocto Project.
+ </para></listitem>
+ <listitem><para><emphasis>
+ <link linkend='closer-look'>A Closer Look at the Yocto Project Development Environment</link>:</emphasis>
+ Provides a more detailed look at the Yocto Project development
+ environment within the context of development.
+ </para></listitem>
+ <listitem><para><emphasis>
+ <link linkend='technical-details'>Technical Details</link>:</emphasis>
+ Describes fundamental Yocto Project components as well as an explanation
+ behind how the Yocto Project uses shared state (sstate) cache to speed build time.
+ </para></listitem>
+ <listitem><para><emphasis>
+ <link linkend='migration'>Migrating to a Newer Yocto Project Release</link>:</emphasis>
+ Describes release-specific information that helps you move from
+ one Yocto Project Release to another.
+ </para></listitem>
+ <listitem><para><emphasis>
+ <link linkend='ref-structure'>Directory Structure</link>:</emphasis>
+ Describes the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink> created
+ either by unpacking a released Yocto Project tarball on your host development system,
+ or by cloning the upstream
+ <ulink url='&YOCTO_DOCS_DEV_URL;#poky'>Poky</ulink> Git repository.
+ </para></listitem>
+ <listitem><para><emphasis>
+ <link linkend='ref-classes'>Classes</link>:</emphasis>
+ Describes the classes used in the Yocto Project.</para></listitem>
+ <listitem><para><emphasis>
+ <link linkend='ref-tasks'>Tasks</link>:</emphasis>
+ Describes the tasks defined by the OpenEmbedded build system.
+ </para></listitem>
+ <listitem><para><emphasis>
+ <link linkend='ref-qa-checks'>QA Error and Warning Messages</link>:</emphasis>
+ Lists and describes QA warning and error messages.
+ </para></listitem>
+ <listitem><para><emphasis>
+ <link linkend='ref-images'>Images</link>:</emphasis>
+ Describes the standard images that the Yocto Project supports.
+ </para></listitem>
+ <listitem><para><emphasis>
+ <link linkend='ref-features'>Features</link>:</emphasis>
+ Describes mechanisms for creating distribution, machine, and image
+ features during the build process using the OpenEmbedded build system.</para></listitem>
+ <listitem><para><emphasis>
+ <link linkend='ref-variables-glos'>Variables Glossary</link>:</emphasis>
+ Presents most variables used by the OpenEmbedded build system, which
+ uses BitBake.
+ Entries describe the function of the variable and how to apply them.
+ </para></listitem>
+ <listitem><para><emphasis>
+ <link linkend='ref-varlocality'>Variable Context</link>:</emphasis>
+ Provides variable locality or context.</para></listitem>
+ <listitem><para><emphasis>
+ <link linkend='faq'>FAQ</link>:</emphasis>
+ Provides answers for commonly asked questions in the Yocto Project
+ development environment.</para></listitem>
+ <listitem><para><emphasis>
+ <link linkend='resources'>Contributing to the Yocto Project</link>:</emphasis>
+ Provides guidance on how you can contribute back to the Yocto
+ Project.</para></listitem>
+ </itemizedlist>
+ </para>
+</section>
+
+
+<section id='intro-requirements'>
+<title>System Requirements</title>
+ <para>
+ For general Yocto Project system requirements, see the
+ "<ulink url='&YOCTO_DOCS_QS_URL;#yp-resources'>Setting Up to Use the Yocto Project</ulink>" section
+ in the Yocto Project Quick Start.
+ The remainder of this section provides details on system requirements
+ not covered in the Yocto Project Quick Start.
+ </para>
+
+ <section id='detailed-supported-distros'>
+ <title>Supported Linux Distributions</title>
+
+ <para>
+ Currently, the Yocto Project is supported on the following
+ distributions:
+ <note>
+ <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>
+
+ <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>
+
+ <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.
+ </para>
+ </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>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 21</para></listitem>
+ <listitem><para>Fedora release 22</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 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>
+ </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>SDK Installer Extras:</emphasis>
+ Packages needed if you are going to be using the
+ the standard or extensible SDK:
+ <literallayout class='monospaced'>
+ $ sudo apt-get install autoconf automake libtool libglib2.0-dev libarchive-dev
+ </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 xsltproc
+ </literallayout></para></listitem>
+ <listitem><para><emphasis>SDK Installer Extras:</emphasis>
+ Packages needed if you are going to be using the
+ standard or extensible SDK:
+ <literallayout class='monospaced'>
+ $ sudo dnf install autoconf automake libtool glib2-devel libarchive-devel
+ </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 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 fop xsltproc dblatex xmlto
+ </literallayout></para></listitem>
+ <listitem><para><emphasis>SDK Installer Extras:</emphasis>
+ Packages needed if you are going to be using the
+ standard or extensible SDK:
+ <literallayout class='monospaced'>
+ $ sudo zypper install autoconf automake libtool glib2-devel libarchive-devel
+ </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>
+ </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:
+ <note>
+ For CentOS 6.x, some of the versions of the components
+ provided by the distribution are too old (e.g. Git, Python,
+ and tar).
+ It is recommended that you install the buildtools in order
+ to provide versions that will work with the OpenEmbedded
+ build system.
+ For information on how to install the buildtools tarball,
+ see the
+ "<link linkend='required-git-tar-and-python-versions'>Required Git, Tar, and Python Versions</link>"
+ section.
+ </note>
+ <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;
+ </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 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 xsltproc
+ </literallayout></para></listitem>
+ <listitem><para><emphasis>SDK Installer Extras:</emphasis>
+ Packages needed if you are going to be using the
+ standard or extensible SDK:
+ <literallayout class='monospaced'>
+ $ sudo yum install autoconf automake libtool glib2-devel libarchive-devel
+ </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.24 or greater</para></listitem>
+ <listitem><para>Python 2.7.3 or greater not including
+ Python 3.x, which is not supported.</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 poky-glibc-x86_64-buildtools-tarball-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>
+ or
+ <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
+ 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 poky-glibc-x86_64-buildtools-tarball-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>
+</section>
+
+<section id='intro-getit'>
+ <title>Obtaining the Yocto Project</title>
+ <para>
+ The Yocto Project development team makes the Yocto Project available through a number
+ of methods:
+ <itemizedlist>
+ <listitem><para><emphasis>Source Repositories:</emphasis>
+ Working from a copy of the upstream
+ <filename>poky</filename> repository 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;/cgit.cgi'></ulink>.
+ In particular, you can find the
+ <filename>poky</filename> repository at
+ <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/poky/'></ulink>.
+ </para></listitem>
+ <listitem><para><emphasis>Releases:</emphasis> Stable, tested
+ releases are available as tarballs through
+ <ulink url='&YOCTO_DL_URL;/releases/yocto/'/>.</para></listitem>
+ <listitem><para><emphasis>Nightly Builds:</emphasis> These
+ tarball releases are available at
+ <ulink url='&YOCTO_AB_NIGHTLY_URL;'/>.
+ These builds include Yocto Project releases, SDK installation
+ scripts, and experimental builds.
+ </para></listitem>
+ <listitem><para><emphasis>Yocto Project Website:</emphasis> You can
+ find tarball releases of the Yocto Project and supported BSPs
+ at the
+ <ulink url='&YOCTO_HOME_URL;'>Yocto Project website</ulink>.
+ Along with these downloads, you can find lots of other
+ information at this site.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+</section>
+
+<section id='intro-getit-dev'>
+ <title>Development Checkouts</title>
+ <para>
+ Development using the Yocto Project requires a local
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ You can set up the Source Directory by cloning a copy of the upstream
+ <ulink url='&YOCTO_DOCS_DEV_URL;#poky'>poky</ulink> Git repository.
+ For information on how to do this, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#getting-setup'>Getting Set Up</ulink>"
+ section in the Yocto Project Development Manual.
+ </para>
+</section>
+
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/import-layers/yocto-poky/documentation/ref-manual/migration.xml b/import-layers/yocto-poky/documentation/ref-manual/migration.xml
new file mode 100644
index 000000000..e6c0aa36b
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/migration.xml
@@ -0,0 +1,3286 @@
+<!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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink>.
+ 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_DEV_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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
+ 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>"
+ in the Yocto Project Development 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
+ 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
+ <link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link>
+ 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.
+ </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
+ "<link linkend='maintaining-build-output-quality'>Maintaining Build Output Quality</link>"
+ section.
+ </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
+ <link linkend='var-BAD_RECOMMENDATIONS'><filename>BAD_RECOMMENDATIONS</filename></link>
+ 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 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#bitbake-term'>BitBake</ulink>.
+ </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 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'>Setting up and running package test (ptest)</ulink>"
+ section in the Yocto Project Development 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
+ OE-Core.
+ 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_DEV_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>
+
+ <para>
+ For more information, see the
+ <link linkend='var-KERNEL_MODULE_AUTOLOAD'><filename>KERNEL_MODULE_AUTOLOAD</filename></link>
+ and
+ <link linkend='var-KERNEL_MODULE_PROBECONF'><filename>KERNEL_MODULE_PROBECONF</filename></link>
+ variables.
+ </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
+ "<link linkend='maintaining-build-output-quality'>Maintaining Build Output Quality</link>"
+ section.
+ </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 OE-Core.
+ 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 either 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 before the task 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
+ <link linkend='ref-classes-image-vm'><filename>image-vm</filename></link>
+ 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 Yocto Project 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;#sdk-intro'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>.
+ </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 <filename>glibc</filename> 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-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.
+ </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>
+ 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" option 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.
+ <note>
+ This change primarily affects the Sato UI.
+ </note>
+ </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 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 the file, you can simply add
+ <filename>v86d</filename> to your image.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+</section>
+
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/import-layers/yocto-poky/documentation/ref-manual/ref-bitbake.xml b/import-layers/yocto-poky/documentation/ref-manual/ref-bitbake.xml
new file mode 100644
index 000000000..1de114826
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/ref-bitbake.xml
@@ -0,0 +1,472 @@
+<!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-bitbake'>
+
+ <title>BitBake</title>
+
+ <para>
+ BitBake is a program written in Python that interprets the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink> used by
+ the OpenEmbedded build system.
+ At some point, developers wonder what actually happens when you enter:
+ <literallayout class='monospaced'>
+ $ bitbake core-image-sato
+ </literallayout>
+ </para>
+
+ <para>
+ This chapter provides an overview of what happens behind the scenes from BitBake's perspective.
+ </para>
+
+ <note>
+ BitBake strives to be a generic "task" executor that is capable of handling complex dependency relationships.
+ As such, it has no real knowledge of what the tasks being executed actually do.
+ BitBake just considers a list of tasks with dependencies and handles
+ <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink>
+ consisting of variables in a certain format that get passed to the tasks.
+ </note>
+
+ <section id='ref-bitbake-parsing'>
+ <title>Parsing</title>
+
+ <para>
+ BitBake parses configuration files, classes, and <filename>.bb</filename> files.
+ </para>
+
+ <para>
+ The first thing BitBake does is look for the <filename>bitbake.conf</filename> file.
+ This file resides in the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
+ within the <filename>meta/conf/</filename> directory.
+ BitBake finds it by examining its
+ <link linkend='var-BBPATH'><filename>BBPATH</filename></link> environment
+ variable and looking for the <filename>meta/conf/</filename>
+ directory.
+ </para>
+
+ <para>
+ The <filename>bitbake.conf</filename> file lists other configuration
+ files to include from a <filename>conf/</filename>
+ directory below the directories listed in <filename>BBPATH</filename>.
+ In general, the most important configuration file from a user's perspective
+ is <filename>local.conf</filename>, which contains a user's customized
+ settings for the OpenEmbedded build environment.
+ Other notable configuration files are the distribution
+ configuration file (set by the
+ <filename><link linkend='var-DISTRO'>DISTRO</link></filename> variable)
+ and the machine configuration file
+ (set by the
+ <filename><link linkend='var-MACHINE'>MACHINE</link></filename> variable).
+ The <filename>DISTRO</filename> and <filename>MACHINE</filename> BitBake environment
+ variables are both usually set in
+ the <filename>local.conf</filename> file.
+ Valid distribution
+ configuration files are available in the <filename>meta/conf/distro/</filename> directory
+ and valid machine configuration
+ files in the <filename>meta/conf/machine/</filename> directory.
+ Within the <filename>meta/conf/machine/include/</filename>
+ directory are various <filename>tune-*.inc</filename> configuration files that provide common
+ "tuning" settings specific to and shared between particular architectures and machines.
+ </para>
+
+ <para>
+ After the parsing of the configuration files, some standard classes are included.
+ The <filename>base.bbclass</filename> file is always included.
+ Other classes that are specified in the configuration using the
+ <filename><link linkend='var-INHERIT'>INHERIT</link></filename>
+ variable are also included.
+ Class files are searched for in a <filename>classes</filename> subdirectory
+ under the paths in <filename>BBPATH</filename> in the same way as
+ configuration files.
+ </para>
+
+ <para>
+ After classes are included, the variable
+ <filename><link linkend='var-BBFILES'>BBFILES</link></filename>
+ is set, usually in
+ <filename>local.conf</filename>, and defines the list of places to search for
+ <filename>.bb</filename> files.
+ By default, the <filename>BBFILES</filename> variable specifies the
+ <filename>meta/recipes-*/</filename> directory within Poky.
+ Adding extra content to <filename>BBFILES</filename> is best achieved through the use of
+ BitBake layers as described in the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and
+ Creating Layers</ulink>" section of the Yocto Project Development Manual.
+ </para>
+
+ <para>
+ BitBake parses each <filename>.bb</filename> file in <filename>BBFILES</filename> and
+ stores the values of various variables.
+ In summary, for each <filename>.bb</filename>
+ file the configuration plus the base class of variables are set, followed
+ by the data in the <filename>.bb</filename> file
+ itself, followed by any inherit commands that
+ <filename>.bb</filename> file might contain.
+ </para>
+
+ <para>
+ Because parsing <filename>.bb</filename> files is a time
+ consuming process, a cache is kept to speed up subsequent parsing.
+ This cache is invalid if the timestamp of the <filename>.bb</filename>
+ file itself changes, or if the timestamps of any of the include,
+ configuration files or class files on which the
+ <filename>.bb</filename> file depends change.
+ </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 brace 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='ref-bitbake-providers'>
+ <title>Preferences and Providers</title>
+
+ <para>
+ Once all the <filename>.bb</filename> files have been
+ parsed, BitBake starts to build the target (<filename>core-image-sato</filename>
+ in the previous section's example) and looks for providers of that target.
+ Once a provider is selected, BitBake resolves all the dependencies for
+ the target.
+ In the case of <filename>core-image-sato</filename>, it would lead to
+ <filename>packagegroup-core-x11-sato</filename>,
+ which in turn leads to recipes like <filename>matchbox-terminal</filename>,
+ <filename>pcmanfm</filename> and <filename>gthumb</filename>.
+ These recipes in turn depend on <filename>glibc</filename> and the toolchain.
+ </para>
+
+ <para>
+ Sometimes a target might have multiple providers.
+ A common example is "virtual/kernel", which is provided by each kernel package.
+ Each machine often selects the best kernel provider by using a line similar to the
+ following in the machine configuration file:
+ </para>
+
+ <literallayout class='monospaced'>
+ PREFERRED_PROVIDER_virtual/kernel = "linux-yocto"
+ </literallayout>
+
+ <para>
+ The default <filename><link linkend='var-PREFERRED_PROVIDER'>PREFERRED_PROVIDER</link></filename>
+ is the provider with the same name as the target.
+ </para>
+
+ <para>
+ Understanding how providers are chosen is made complicated by the fact
+ that multiple versions might exist.
+ BitBake defaults to the highest version of a provider.
+ Version comparisons are made using the same method as Debian.
+ You can use the
+ <filename><link linkend='var-PREFERRED_VERSION'>PREFERRED_VERSION</link></filename>
+ variable to specify a particular version (usually in the distro configuration).
+ You can influence the order by using the
+ <filename><link linkend='var-DEFAULT_PREFERENCE'>DEFAULT_PREFERENCE</link></filename>
+ variable.
+ By default, files have a preference of "0".
+ Setting the <filename>DEFAULT_PREFERENCE</filename> to "-1" makes the
+ package unlikely to be used unless it is explicitly referenced.
+ Setting the <filename>DEFAULT_PREFERENCE</filename> to "1" makes it likely the package 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 package
+ versions until they have undergone sufficient testing to be considered stable.
+ </para>
+
+ <para>
+ In summary, BitBake has created a list of providers, which is prioritized, for each target.
+ </para>
+ </section>
+
+ <section id='ref-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 BitBake documentation,
+ which is found in the <filename>bitbake/doc/manual</filename> directory within the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ At a basic level, it is sufficient to know that BitBake uses the
+ <filename><link linkend='var-DEPENDS'>DEPENDS</link></filename> and
+ <filename><link linkend='var-RDEPENDS'>RDEPENDS</link></filename> variables when
+ calculating dependencies.
+ </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 build now starts with BitBake forking off threads up to the limit set in the
+ <filename><link linkend='var-BB_NUMBER_THREADS'>BB_NUMBER_THREADS</link></filename> 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.
+ See the
+ "<ulink url='&YOCTO_DOCS_QS_URL;#qs-building-images'>Building Images</ulink>"
+ section in the Yocto Project Quick Start for more information.
+ </para>
+
+ <para>
+ As each task completes, a timestamp is written to the directory specified by the
+ <filename><link linkend='var-STAMP'>STAMP</link></filename> variable.
+ On subsequent runs, BitBake looks within the <filename>build/tmp/stamps</filename>
+ directory 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
+ <filename>.bb</filename> 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.
+ This behavior could change or become configurable in future versions of BitBake.
+ </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>
+ </section>
+
+ <section id='ref-bitbake-runtask'>
+ <title>Running a Task</title>
+
+ <para>
+ Tasks can either be a shell task or a Python task.
+ For shell tasks, BitBake writes a shell script to
+ <filename>${WORKDIR}/temp/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>${WORKDIR}/temp/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>
+ Once all the tasks have been completed BitBake exits.
+ </para>
+
+ <para>
+ When running a task, BitBake tightly controls the execution environment
+ of the build tasks to make sure unwanted contamination from the build machine
+ cannot influence the build.
+ Consequently, if you do want something to get passed into the build
+ task's environment, you must take a few steps:
+ <orderedlist>
+ <listitem><para>Tell BitBake to load what you want from the environment
+ into the data store.
+ You can do so through the <filename>BB_ENV_EXTRAWHITE</filename>
+ variable.
+ For example, assume you want to prevent the build system from
+ accessing your <filename>$HOME/.ccache</filename> directory.
+ The following command tells BitBake to load
+ <filename>CCACHE_DIR</filename> from the environment into the data
+ store:
+ <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
+ environment store to the task environment of every running task.
+ Loading something from the environment into the data store
+ (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
+ <filename>local.conf</filename> or distro configuration file:
+ <literallayout class='monospaced'>
+ export CCACHE_DIR
+ </literallayout></para></listitem>
+ </orderedlist>
+ </para>
+
+ <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 shared state
+ checksums.
+ If doing so results in unnecessary rebuilds of tasks, you can whitelist the
+ variable so that the shared state code ignores the dependency when it creates
+ checksums.
+ For information on this process, see the <filename>BB_HASHBASE_WHITELIST</filename>
+ example in the "<link linkend='checksums'>Checksums (Signatures)</link>" section.
+ </note>
+ </section>
+
+ <section id='ref-bitbake-commandline'>
+ <title>BitBake Command Line</title>
+
+ <para>
+ Following is the BitBake help output:
+ </para>
+
+ <screen>
+$ bitbake --help
+Usage: bitbake [options] [recipename/target ...]
+
+ 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.
+ -a, --tryaltconfigs Continue with builds by trying to use alternative
+ providers where possible.
+ -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 Output more log message data to the terminal.
+ -D, --debug Increase the debug level. You can specify this more
+ than once.
+ -n, --dry-run Don't execute, just go through the motions.
+ -S, --dump-signatures
+ Don't execute, just dump out the signature
+ construction information.
+ -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-package 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 (e.g. knotty and depexp).
+ -t SERVERTYPE, --servertype=SERVERTYPE
+ Choose which server to use, process or xmlrpc.
+ --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 server to bind to.
+ --no-setscene Do not run any setscene tasks. sstate will be ignored
+ and everything needed, built.
+ --remote-server=REMOTE_SERVER
+ Connect to the specified server.
+ -m, --kill-server Terminate the remote server.
+ --observe-only Connect to a server as an observing-only client.
+ </screen>
+ </section>
+
+ <section id='ref-bitbake-fetchers'>
+ <title>Fetchers</title>
+
+ <para>
+ BitBake also contains a set of "fetcher" modules that allow
+ retrieval of source code from various types of sources.
+ For example, BitBake can get source code from a disk with the metadata, from websites,
+ from remote shell accounts, or from Source Code Management (SCM) systems
+ like <filename>cvs/subversion/git</filename>.
+ </para>
+
+ <para>
+ Fetchers are usually triggered by entries in
+ <filename><link linkend='var-SRC_URI'>SRC_URI</link></filename>.
+ You can find information about the options and formats of entries for specific
+ fetchers in the BitBake manual located in the
+ <filename>bitbake/doc/manual</filename> directory of the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ </para>
+
+ <para>
+ One useful feature for certain Source Code Manager (SCM) fetchers is the ability to
+ "auto-update" when the upstream SCM changes version.
+ Since this ability requires certain functionality from the SCM, not all
+ systems support it.
+ Currently Subversion, Bazaar and to a limited extent, Git support the ability to "auto-update".
+ This feature works using the <filename><link linkend='var-SRCREV'>SRCREV</link></filename>
+ variable.
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#platdev-appdev-srcrev'>Using an External SCM</ulink>" section
+ in the Yocto Project Development Manual for more information.
+ </para>
+
+ </section>
+
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4 spell spelllang=en_gb
+-->
diff --git a/import-layers/yocto-poky/documentation/ref-manual/ref-classes.xml b/import-layers/yocto-poky/documentation/ref-manual/ref-classes.xml
new file mode 100644
index 000000000..e919bd7eb
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/ref-classes.xml
@@ -0,0 +1,3715 @@
+<!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 <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink> 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ 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 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 Manual.
+ </para>
+
+ <para>
+ By default, the <filename>autotools*</filename> classes
+ use out-of-tree builds (i.e.
+ <filename>autotools.bbclass</filename>).
+ (<link linkend='var-B'><filename>B</filename></link> <filename>!=</filename>
+ <link linkend='var-S'><filename>S</filename></link>).
+ </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> variable.
+ </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.
+ The class also contains some commonly used functions such as
+ <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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ </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
+ "<link linkend='maintaining-build-output-quality'>Maintaining Build Output Quality</link>"
+ section.
+ </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
+ <ulink url='http://ccache.samba.org/'>C/C++ Compiler Cache</ulink>
+ 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
+ "<link linkend='cross-development-toolchain-generation'>Cross-Development Toolchain Generation</link>"
+ section 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
+ "<link linkend='cross-development-toolchain-generation'>Cross-Development Toolchain Generation</link>"
+ section 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 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ 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 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-gummiboot'>
+ <title><filename>gummiboot.bbclass</filename></title>
+
+ <para>
+ The <filename>gummiboot</filename> class provides functions specific
+ to the gummiboot bootloader for building bootable images.
+ This is an internal class and is not intended to be
+ used directly.
+ Set the
+ <link linkend='var-EFI_PROVIDER'><filename>EFI_PROVIDER</filename></link>
+ variable to "gummiboot" to use this class.
+ </para>
+
+ <para>
+ For information on more variables used and supported in this class,
+ see the
+ <link linkend='var-GUMMIBOOT_CFG'><filename>GUMMIBOOT_CFG</filename></link>,
+ <link linkend='var-GUMMIBOOT_ENTRIES'><filename>GUMMIBOOT_ENTRIES</filename></link>,
+ and
+ <link linkend='var-GUMMIBOOT_TIMEOUT'><filename>GUMMIBOOT_TIMEOUT</filename></link>
+ variables.
+ </para>
+
+ <para>
+ You can also see the
+ <ulink url='http://freedesktop.org/wiki/Software/gummiboot/'>Gummiboot documentation</ulink>
+ for more information.
+ </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 Manual.
+ For information on how images are created, see the
+ "<link linkend='images-dev-environment'>Images</link>" section elsewhere
+ in this 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>
+</section>
+
+<section id='ref-classes-image_types_uboot'>
+ <title><filename>image_types_uboot.bbclass</filename></title>
+
+ <para>
+ The <filename>image_types_uboot</filename> class
+ defines additional image types specifically for the U-Boot bootloader.
+ </para>
+</section>
+
+<section id='ref-classes-image-live'>
+ <title><filename>image-live.bbclass</filename></title>
+
+ <para>
+ The <filename>image-live</filename> class supports building "live"
+ images.
+ </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>.
+ For example, if you were building an ISO image, you would add "live"
+ to <filename>IMAGE_FSTYPES</filename>, set the
+ <link linkend='var-NOISO'><filename>NOISO</filename></link> 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-image-swab'>
+ <title><filename>image-swab.bbclass</filename></title>
+
+ <para>
+ The <filename>image-swab</filename> class enables the
+ <ulink url='&YOCTO_HOME_URL;/tools-resources/projects/swabber'>Swabber</ulink>
+ tool in order to detect and log accesses to the host system during
+ the OpenEmbedded build process.
+ <note>
+ This class is currently unmaintained.
+ The <filename>strace</filename> package needs to be installed
+ in the build host as a dependency for this tool.
+ </note>
+ </para>
+</section>
+
+<section id='ref-classes-image-vm'>
+ <title><filename>image-vm.bbclass</filename></title>
+
+ <para>
+ The <filename>image-vm</filename> class supports building VM
+ images.
+ </para>
+</section>
+
+<section id='ref-classes-image-vmdk'>
+ <title><filename>image-vmdk.bbclass</filename></title>
+
+ <para>
+ The <filename>image-vmdk</filename> class supports building VMware
+ VMDK images.
+ Normally, you do not use this class directly.
+ Instead, you add "vmdk" to
+ <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>.
+ </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><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>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>
+ <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>unsafe-references-in-scripts:</filename></emphasis>
+ Reports when a script file installed in
+ <filename>${base_libdir}</filename>,
+ <filename>${base_bindir}</filename>, or
+ <filename>${base_sbindir}</filename>, depends on files
+ 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>
+ 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-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_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 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>
+ </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>
+ </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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ </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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
+ 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 Smart, 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 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink> 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 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 Software Development Kit (SDK) Developer's Guide.
+ </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
+ "<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
+ <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 Software Development Kit (SDK) Developer's
+ Guide.
+ </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 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 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
+ <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
+ "<link linkend='image-generation-dev-environment'>Image Generation</link>"
+ section.
+ </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
+ "<link linkend='shared-state-cache'>Shared State Cache</link>"
+ section.
+ </para>
+</section>
+
+<section id='ref-classes-staging'>
+ <title><filename>staging.bbclass</filename></title>
+
+ <para>
+ The <filename>staging</filename> class provides the
+ <link linkend='ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></link>
+ task, which stages files into the sysroot to make them available to
+ other recipes at build time.
+ The 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-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 Manual.
+ </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 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>
+</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>.
+ </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 <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
+ 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>
+ variable 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/import-layers/yocto-poky/documentation/ref-manual/ref-features.xml b/import-layers/yocto-poky/documentation/ref-manual/ref-features.xml
new file mode 100644
index 000000000..fd7693500
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/ref-features.xml
@@ -0,0 +1,438 @@
+<!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 <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink>
+ 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
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-COMBINED_FEATURES'><filename>COMBINED_FEATURES</filename></ulink>
+ 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>bluetooth:</emphasis> Include
+ bluetooth support (integrated BT only).</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>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 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.
+ </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 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;#sdk-manual'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>.
+ </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 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/import-layers/yocto-poky/documentation/ref-manual/ref-images.xml b/import-layers/yocto-poky/documentation/ref-manual/ref-images.xml
new file mode 100644
index 000000000..69b58f6ab
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/ref-images.xml
@@ -0,0 +1,167 @@
+<!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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
+ that containe 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;/documentation/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-directfb</filename>:
+ An image that uses <filename>directfb</filename> instead of X11.
+ </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 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
+ "<link linkend='wayland'>Wayland</link>" section.
+ </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/import-layers/yocto-poky/documentation/ref-manual/ref-manual-customization.xsl b/import-layers/yocto-poky/documentation/ref-manual/ref-manual-customization.xsl
new file mode 100644
index 000000000..c58dd905b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/ref-manual/ref-manual-eclipse-customization.xsl b/import-layers/yocto-poky/documentation/ref-manual/ref-manual-eclipse-customization.xsl
new file mode 100644
index 000000000..f3b752155
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/ref-manual/ref-manual.xml b/import-layers/yocto-poky/documentation/ref-manual/ref-manual.xml
new file mode 100644
index 000000000..6834d5f0a
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/ref-manual.xml
@@ -0,0 +1,165 @@
+<!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>Richard</firstname> <surname>Purdie</surname>
+ <affiliation>
+ <orgname>Linux Foundation</orgname>
+ </affiliation>
+ <email>richard.purdie@linuxfoundation.org</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>
+ </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_REF_URL;'>Yocto Project Reference Manual</ulink>
+ from the Yocto Project website.
+ </note>
+ </legalnotice>
+
+ </bookinfo>
+
+ <xi:include href="introduction.xml"/>
+
+ <xi:include href="usingpoky.xml"/>
+
+ <xi:include href="closer-look.xml"/>
+
+ <xi:include href="technical-details.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-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/import-layers/yocto-poky/documentation/ref-manual/ref-qa-checks.xml b/import-layers/yocto-poky/documentation/ref-manual/ref-qa-checks.xml
new file mode 100644
index 000000000..4fcf1db61
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/ref-qa-checks.xml
@@ -0,0 +1,1237 @@
+<!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>
+ 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 [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>
+
+<!--
+Here are some messages that might be documented in the future.
+Right now we are not documenting them because the QA checks are not
+enabled by default:
+
+ <para>
+ <itemizedlist>
+ <listitem><para>
+ <literallayout class='monospaced'>
+ Desktop file issue: &lt;error&gt; [desktop]
+ </literallayout>
+ NEED A DESCRIPTION AND SOLUTION
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem><para>
+ <literallayout class='monospaced'>
+ &lt;packagename&gt;: &lt;file&gt;, installed in the base_prefix, requires a shared library under exec_prefix (&lt;exec_prefix&t;g) [unsafe-references-in-binaries]
+ </literallayout>
+ NEED A DESCRIPTION AND SOLUTION
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem><para>
+ <literallayout class='monospaced'>
+ &lt;packagename&gt;: Found a reference to &lt;exec_prefix&gt;/ in &lt;path&gt; - Shell scripts in base_bindir and base_sbindir should not reference anything in exec_prefix [unsafe-references-in-scripts]
+ </literallayout>
+ NEED A DESCRIPTION AND SOLUTION
+ </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/import-layers/yocto-poky/documentation/ref-manual/ref-structure.xml b/import-layers/yocto-poky/documentation/ref-manual/ref-structure.xml
new file mode 100644
index 000000000..e51ceb1bf
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/ref-structure.xml
@@ -0,0 +1,1142 @@
+<!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 <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink> 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;#getting-setup'>Getting Set Up</ulink>"
+ section in the Yocto Project Development 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ </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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink>
+ 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 an environment setup script (e.g.
+ <link linkend="structure-core-script"><filename>&OE_INIT_FILE;</filename></link>
+ or
+ <link linkend="structure-memres-core-script"><filename>oe-init-build-env-memres</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 <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
+ 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>
+ or
+ <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>).
+ </para>
+
+ <para>
+ It is also possible to place output and configuration
+ files in a directory separate from the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
+ 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>
+ and
+ "<link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>"
+ sections.
+ </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>
+ and
+ <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>
+ scripts append 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 is one of two scripts that set up the OpenEmbedded build
+ environment.
+ For information on the other script, see the
+ "<link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>"
+ section.
+ </para>
+
+ <para>
+ 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
+ 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ 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 Manual for more
+ information.
+ </para>
+
+ <para>
+ By default, running this script without a
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
+ 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>:
+ <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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ 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 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-memres-core-script'>
+ <title><filename>oe-init-build-env-memres</filename></title>
+
+ <para>
+ This script is one of two scripts that set up the OpenEmbedded
+ build environment.
+ Aside from setting up the environment, this script starts a
+ memory-resident BitBake server.
+ For information on the other setup script, see the
+ "<link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>"
+ section.
+ </para>
+
+ <para>
+ Memory-resident BitBake resides in memory until you specifically
+ remove it using the following BitBake command:
+ <literallayout class='monospaced'>
+ $ bitbake -m
+ </literallayout>
+ </para>
+
+ <para>
+ 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.
+ One of these variables is the
+ <link linkend='var-BBSERVER'><filename>BBSERVER</filename></link>
+ variable, which allows the OpenEmbedded build system to locate
+ the server that is running BitBake.
+ </para>
+
+ <para>
+ You need to run an environment setup script before using BitBake
+ commands.
+ Following is the script syntax:
+ <literallayout class='monospaced'>
+ $ source oe-init-build-env-memres <replaceable>port_number</replaceable> <replaceable>build_dir</replaceable>
+ </literallayout>
+ Following are some considerations when sourcing this script:
+ <itemizedlist>
+ <listitem><para>
+ The script uses other scripts within the
+ <filename>scripts</filename> directory to do the bulk of
+ the work.
+ </para></listitem>
+ <listitem><para>
+ If you do not provide a port number with the script, the
+ BitBake server starts at a randomly selected port.
+ </para></listitem>
+ <listitem><para>
+ The script's parameters are positionally dependent.
+ Consequently, you cannot run the script and provide a
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
+ name without also providing a port number.
+ In other words, the following syntax is illegal:
+ <literallayout class='monospaced'>
+ $ source oe-initbuild-env-memres <replaceable>build_dir</replaceable>
+ </literallayout>
+ <note>
+ The previous restriction might be resolved in the
+ future.
+ See
+ <ulink url='https://bugzilla.yoctoproject.org/show_bug.cgi?id=7555'>Bug 7555</ulink>
+ for more information.
+ </note>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ When you run this script, your Yocto Project environment is set
+ up, a Build Directory 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-memres
+ No port specified, using dynamically selected port
+
+ ### 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'
+ Bitbake server address: 127.0.0.1, server port: 53995
+ Bitbake server started on demand as needed, use bitbake -m to shut it down
+ </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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ 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 Manual for more
+ information.
+ </para>
+
+ <para>
+ By default, running this script without a
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
+ argument creates a build directory named
+ <filename>build</filename>.
+ If you provide a Build Directory argument and port number when you
+ <filename>source</filename> the script, the Build Directory is
+ created using that name.
+ For example, the following command starts the BitBake server using
+ port 53995 and creates a Build Directory named
+ <filename>mybuilds</filename> that is outside of the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>:
+ <literallayout class='monospaced'>
+ $ source oe-init-build-env-memres 53995 ~/mybuilds
+ </literallayout>
+ The <filename>oe-init-build-env-memres</filename> script starts a
+ memory resident BitBake server.
+ This BitBake instance uses the
+ <filename>bitbake-cookerdaemon.log</filename> file, which is
+ located in the Build Directory.
+ </para>
+
+ <para>
+ The OpenEmbedded build system uses the template configuration
+ files, which are found by default in the
+ <filename>meta-poky/conf</filename> directory in the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ 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 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-build-env-memres</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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
+ when you run one of the build environment setup scripts (i.e.
+ <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>
+ or
+ <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</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
+ "<link linkend='maintaining-build-output-quality'>Maintaining Build Output Quality</link>"
+ section.
+ </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>
+ or
+ <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ 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>
+ or
+ <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ 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, it creates a cache file of the result that can
+ be used when subsequently running commands.
+ BitBake stores these results here on a per-machine basis.
+ </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
+ "<link linkend='images-dev-environment'>Images</link>" and
+ "<link linkend='sdk-dev-environment'>Application Development SDK</link>"
+ sections.
+ </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.
+ </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 Software Development Kit (SDK) Developer's Guide.
+ </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'>
+ <title><filename>build/tmp/sysroots/</filename></title>
+
+ <para>
+ This directory contains shared header files and libraries as well as other shared
+ data.
+ Packages that need to share output with other packages do so within this directory.
+ The directory is subdivided by architecture so multiple builds can run within
+ the one Build Directory.
+ </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>
+ </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><link linkend='var-WORKDIR'>WORKDIR</link></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 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-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,
+ <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink> 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/import-layers/yocto-poky/documentation/ref-manual/ref-style.css b/import-layers/yocto-poky/documentation/ref-manual/ref-style.css
new file mode 100644
index 000000000..8ea8dac73
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/ref-style.css
@@ -0,0 +1,1028 @@
+/*
+ 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;
+}
+
+
+ /*********** /
+ / 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/import-layers/yocto-poky/documentation/ref-manual/ref-tasks.xml b/import-layers/yocto-poky/documentation/ref-manual/ref-tasks.xml
new file mode 100644
index 000000000..c46debb55
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/ref-tasks.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='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.
+ </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-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-compile'>
+ <title><filename>do_compile</filename></title>
+
+ <para>
+ Compiles the source in the compilation directory, which is pointed
+ to by the
+ <link linkend='var-B'><filename>B</filename></link> variable.
+ </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.
+ </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 the deploy
+ directory, which is defined by the
+ <link linkend='var-DEPLOYDIR'><filename>DEPLOYDIR</filename></link>
+ variable.
+ </para>
+
+ <para>
+ The <filename>do_deploy</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-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
+ "<link linkend='image-generation-dev-environment'>Image Generation</link>"
+ section.
+ </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-rootfs'><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
+ "<link linkend='image-generation-dev-environment'>Image Generation</link>"
+ section.
+ </para>
+ </section>
+
+ <section id='ref-tasks-install'>
+ <title><filename>do_install</filename></title>
+
+ <para>
+ Copies files from the compilation directory, which is defined by
+ the
+ <link linkend='var-B'><filename>B</filename></link> variable,
+ to a holding area defined by the
+ <link linkend='var-D'><filename>D</filename></link> variable.
+ </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 and splits it into subsets
+ based on available packages and files.
+ </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
+ "<link linkend='package-feeds-dev-environment'>Package Feeds</link>"
+ section.
+ </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
+ "<link linkend='package-feeds-dev-environment'>Package Feeds</link>"
+ section.
+ </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
+ "<link linkend='package-feeds-dev-environment'>Package Feeds</link>"
+ section.
+ </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
+ "<link linkend='package-feeds-dev-environment'>Package Feeds</link>"
+ section.
+ </para>
+ </section>
+
+ <section id='ref-tasks-packagedata'>
+ <title><filename>do_packagedata</filename></title>
+
+ <para>
+ Creates package metadata used by the build system to generate the
+ final packages.
+ </para>
+ </section>
+
+ <section id='ref-tasks-patch'>
+ <title><filename>do_patch</filename></title>
+
+ <para>
+ Locates patch files and applies them to the source code.
+ See the
+ "<link linkend='patching-dev-environment'>Patching</link>"
+ section for more information.
+ </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
+ "<link linkend='sdk-generation-dev-environment'>SDK Generation</link>"
+ section for more information.
+ </para>
+ </section>
+
+ <section id='ref-tasks-populate_sysroot'>
+ <title><filename>do_populate_sysroot</filename></title>
+
+ <para>
+ Copies a subset of the files installed by the
+ <link linkend='ref-tasks-install'><filename>do_install</filename></link>
+ task into the sysroot to make them available to other recipes.
+ Files that would typically not be needed by other recipes at build
+ time are skipped.
+ Skipped files include files installed into
+ <filename>/etc.</filename>
+ For information on what files are copied, see the
+ <link linkend='ref-classes-staging'><filename>staging</filename></link>
+ class.
+ </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-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
+ "<link linkend='source-fetching-dev-environment'>Source Fetching</link>"
+ section and 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-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-checkuriall'>
+ <title><filename>do_checkuriall</filename></title>
+
+ <para>
+ Validates the
+ <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>
+ value for all recipes required to build a target.
+ </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.
+ <link linkend='ref-tasks-patch'><filename>do_unpack</filename></link>,
+ <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
+ <link linkend='shared-state-cache'>sstate</link>) 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
+ (<link linkend='shared-state-cache'>sstate</link>) 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
+ (<link linkend='shared-state-cache'>sstate</link>)
+ 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
+ (<link linkend='shared-state-cache'>sstate</link>) 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-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 Manual for more
+ information about using <filename>devshell</filename>.
+ </para>
+ </section>
+
+ <section id='ref-tasks-fetchall'>
+ <title><filename>do_fetchall</filename></title>
+
+ <para>
+ Fetches all remote sources required to build a target.
+ </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
+ <link linkend='package-feeds-dev-environment'>Package Feeds</link>
+ 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
+ "<link linkend='image-generation-dev-environment'>Image Generation</link>"
+ section 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 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 Manual.
+ </para>
+ </section>
+
+ <section id='ref-tasks-vmdkimg'>
+ <title><filename>do_vmdkimg</filename></title>
+
+ <para>
+ Creates a <filename>.vmdk</filename> image for use with
+ <ulink url='http://www.vmware.com/'>VMware</ulink>
+ and compatible virtual machine hosts.
+ </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>
+ Compiles loadable modules for the Linux kernel.
+ </para>
+ </section>
+
+ <section id='ref-tasks-diffconfig'>
+ <title><filename>do_diffconfig</filename></title>
+
+ <para>
+ Compares the old and new config files after running the
+ <link linkend='ref-tasks-menuconfig'><filename>do_menuconfig</filename></link>
+ task for the kernel.
+ </para>
+ </section>
+
+ <section id='ref-tasks-kernel_checkout'>
+ <title><filename>do_kernel_checkout</filename></title>
+
+ <para>
+ Checks out source/meta branches for a linux-yocto style kernel.
+ </para>
+ </section>
+
+ <section id='ref-tasks-kernel_configcheck'>
+ <title><filename>do_kernel_configcheck</filename></title>
+
+ <para>
+ Validates the kernel configuration for a linux-yocto style kernel.
+ </para>
+ </section>
+
+ <section id='ref-tasks-kernel_configme'>
+ <title><filename>do_kernel_configme</filename></title>
+
+ <para>
+ Assembles the kernel configuration for a linux-yocto style kernel.
+ </para>
+ </section>
+
+ <section id='ref-tasks-kernel_link_vmlinux'>
+ <title><filename>do_kernel_link_vmlinux</filename></title>
+
+ <para>
+ Creates a symbolic link in
+ <filename>arch/$arch/boot</filename> for vmlinux kernel
+ images.
+ </para>
+ </section>
+
+ <section id='ref-tasks-kernel_metadata'>
+ <title><filename>do_kernel_metadata</filename></title>
+
+ <para>
+ Collects kernel metadata for a
+ <filename>linux-yocto</filename> style kernel.
+ </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_DEV_URL;#using-menuconfig'>Using&nbsp;&nbsp;<filename>menuconfig</filename></ulink>"
+ section in the Yocto Project Development Manual.
+ </para>
+ </section>
+
+ <section id='ref-tasks-savedefconfig'>
+ <title><filename>do_savedefconfig</filename></title>
+
+ <para>
+ Creates a minimal Linux kernel configuration file.
+ </para>
+ </section>
+
+ <section id='ref-tasks-shared_workdir'>
+ <title><filename>do_shared_workdir</filename></title>
+
+ <para>
+ Creates the shared working directory for the kernel.
+ </para>
+ </section>
+
+ <section id='ref-tasks-sizecheck'>
+ <title><filename>do_sizecheck</filename></title>
+
+ <para>
+ Checks the size of the kernel image against
+ <link linkend='var-KERNEL_IMAGE_MAXSIZE'><filename>KERNEL_IMAGE_MAXSIZE</filename></link>
+ when set.
+ </para>
+ </section>
+
+ <section id='ref-tasks-strip'>
+ <title><filename>do_strip</filename></title>
+
+ <para>
+ Strips unneeded sections out of the Linux kernel image.
+ </para>
+ </section>
+
+ <section id='ref-tasks-uboot_mkimage'>
+ <title><filename>do_uboot_mkimage</filename></title>
+
+ <para>
+ Creates a uImage file from the kernel for the U-Boot bootloader.
+ </para>
+ </section>
+
+ <section id='ref-tasks-validate_branches'>
+ <title><filename>do_validate_branches</filename></title>
+
+ <para>
+ Ensures that the source, metadata (or both) branches are on the
+ locations specified by their
+ <link linkend='var-SRCREV'><filename>SRCREV</filename></link>
+ values for a linux-yocto style kernel.
+ </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/import-layers/yocto-poky/documentation/ref-manual/ref-variables.xml b/import-layers/yocto-poky/documentation/ref-manual/ref-variables.xml
new file mode 100644
index 000000000..d55bccdc6
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/ref-variables.xml
@@ -0,0 +1,14736 @@
+<!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-GDB'>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-glossary-n'>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-glossary-v'>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 if an output package should still be produced if it is empty."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies if an output package should still be produced 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 each LABEL."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ An override list of append strings for each
+ <link linkend='var-LABELS'><filename>LABEL</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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ </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>
+ </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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
+ 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 Manual for
+ information on Multilib.
+ </para>
+
+ <para>
+ The <filename>BASE_LIB</filename> variable is defined in
+ the machine include files in the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>:
+ 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
+ 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
+ <link linkend='var-BB_DISKMON_WARNINTERVAL'>BB_DISKMON_WARNINTERVAL</link> 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
+ </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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
+ </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
+ "<link linkend='speeding-up-the-build'>Speeding Up the Build</link>"
+ section.
+ </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>
+ </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-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 <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
+ 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 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>
+ <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
+ <ulink url='&YOCTO_DOCS_DEV_URL;build-directory'>Build Directory</ulink>,
+ 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 server that runs memory-resident BitBake."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Points to the server that runs memory-resident BitBake.
+ This variable is set by the
+ <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>
+ setup script and should not be hand-edited.
+ The variable is only used when you employ memory-resident
+ BitBake.
+ The setup script exports the value as follows:
+ <literallayout class='monospaced'>
+ export BBSERVER=localhost:$port
+ </literallayout>
+ </para>
+
+ <para>
+ For more information on how the
+ <filename>BBSERVER</filename> is used, see the
+ <filename>oe-init-build-env-memres</filename> script, which
+ is located in the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ </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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ 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] = "The bare name of the recipe. 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" /> -->
+ The bare name of the recipe.
+ This variable is a version of the
+ <link linkend='var-PN'><filename>PN</filename></link>
+ variable but removes common suffixes such as
+ <filename>-native</filename> and
+ <filename>-cross</filename> as well
+ as removes common prefixes such as multilib's
+ <filename>lib64-</filename> and
+ <filename>lib32-</filename>.
+ The exact list of suffixes removed is specified by the
+ <link linkend='var-SPECIAL_PKGSUFFIX'><filename>SPECIAL_PKGSUFFIX</filename></link>
+ variable.
+ The exact list of prefixes removed is specified by the
+ <link linkend='var-MLPREFIX'><filename>MLPREFIX</filename></link>
+ variable.
+ Prefixes are removed for <filename>multilib</filename>
+ and <filename>nativesdk-</filename> cases.
+ </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_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 pre-processor (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 pre-processor
+ (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_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_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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
+ You can define this directory indirectly through the
+ <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>
+ and
+ <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>
+ scripts by passing in a Build Directory path when you run
+ the scripts.
+ If you run the scripts 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 &lt;email@host&gt;".
+ 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
+ "<link linkend='maintaining-build-output-quality'>Maintaining Build Output Quality</link>"
+ section.
+ </para>
+
+ <para>
+ You can specify three 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>
+ </itemizedlist>
+ </para>
+
+ <para>
+ By default, the <filename>buildhistory</filename> class
+ enables all three 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink>
+ 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 set it to
+ appropriate values.
+ </para>
+
+ <para>
+ You do not normally directly interact with this variable.
+ The value for the <filename>CLASSOVERRIDE</filename>
+ variable goes into
+ <link linkend='var-OVERRIDES'><filename>OVERRIDES</filename></link>
+ and then can be used as an override.
+ Here is an example where "python-native" is added to
+ <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>
+ only when building for the <filename>-native</filename> case:
+ <literallayout class='monospaced'>
+ DEPENDS_append_class-native = " python-native"
+ </literallayout>
+ </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>
+
+ <para>
+ For more information, see the
+ <link linkend='var-MACHINE_FEATURES'><filename>MACHINE_FEATURES</filename></link>
+ and <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>
+ variables.
+ </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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>,
+ 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-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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ </note>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-CONFIG_INITRAMFS_SOURCE'><glossterm>CONFIG_INITRAMFS_SOURCE</glossterm>
+ <info>
+ CONFIG_INITRAMFS_SOURCE[doc] = "Identifies the initial RAM disk (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 disk (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>
+ </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-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 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 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
+ </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 <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
+ 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>
+ </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
+ (i.e. other recipe files).
+ The system ensures that all the dependencies listed
+ have been built and have their contents in the appropriate
+ sysroots before the recipe's configure task is executed.
+ </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
+ <link linkend='ref-tasks-configure'><filename>do_configure</filename></link>
+ task for recipe "a" depends on the
+ <link linkend='ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></link>
+ 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-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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
+ 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
+ "<link linkend='images-dev-environment'>Images</link>",
+ "<link linkend='package-feeds-dev-environment'>Package Feeds</link>",
+ and
+ "<link linkend='sdk-dev-environment'>Application Development SDK</link>"
+ sections.
+ </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
+ "<link linkend='package-feeds-dev-environment'>Package Feeds</link>"
+ section.
+ </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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
+ 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
+ "<link linkend='images-dev-environment'>Images</link>" and
+ "<link linkend='sdk-dev-environment'>Application Development SDK</link>"
+ sections.
+ </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
+ "<link linkend='package-feeds-dev-environment'>Package Feeds</link>"
+ section.
+ </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
+ "<link linkend='package-feeds-dev-environment'>Package Feeds</link>"
+ section.
+ </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
+ "<link linkend='package-feeds-dev-environment'>Package Feeds</link>"
+ section.
+ </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>SYSLINUX_ROOT</filename> is set
+ as follows:
+ <literallayout class='monospaced'>
+ SYSLINUX_ROOT = "root=/dev/sda2"
+ </literallayout>
+ However, you can change this to locate the root device
+ using the disk signature instead:
+ <literallayout class='monospaced'>
+ SYSLINUX_ROOT = "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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ </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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink>
+ 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_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_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] = "Lists overrides specific to the current distribution. By default, the variable list includes the value of the DISTRO variable."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ This variable lists overrides specific to the current
+ distribution.
+ By default, the variable list includes the value of the
+ <filename><link linkend='var-DISTRO'>DISTRO</link></filename>
+ variable.
+ You can extend the variable to apply any variable overrides
+ you want as part of the distribution and are not
+ already in <filename>OVERRIDES</filename> through
+ some other means.
+ </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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
+ <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 or 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> or <filename>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 "gummiboot" can be used
+ instead.
+ </para>
+
+ <para>
+ See the
+ <link linkend='ref-classes-gummiboot'><filename>gummiboot</filename></link>
+ class 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 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 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
+ 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 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 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 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, you should
+ use an override for the associated 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-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.
+ </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>
+ </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 packages."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The list of directories or files that are placed in packages.
+ </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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ </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>
+ Here is a final example that specifically adds three paths:
+ <literallayout class='monospaced'>
+ FILESEXTRAPATHS_prepend := "path_1:path_2:path_3:"
+ </literallayout>
+ </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 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.
+ </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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>:
+ <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
+ <link linkend='var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></link>
+ variable.
+ </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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>, 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-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-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 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 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>
+
+ <glossentry id='var-GUMMIBOOT_CFG'><glossterm>GUMMIBOOT_CFG</glossterm>
+ <info>
+ GUMMIBOOT_CFG[doc] = "When EFI_PROVIDER is set to "gummiboot", the GUMMIBOOT_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 "gummiboot", the
+ <filename>GUMMIBOOT_CFG</filename> variable specifies the
+ configuration file that should be used.
+ By default, the
+ <link linkend='ref-classes-gummiboot'><filename>gummiboot</filename></link>
+ class sets the <filename>GUMMIBOOT_CFG</filename> as
+ follows:
+ <literallayout class='monospaced'>
+ GUMMIBOOT_CFG ?= "${<link linkend='var-S'>S</link>}/loader.conf"
+ </literallayout>
+ </para>
+
+ <para>
+ For information on Gummiboot, see the
+ <ulink url='http://freedesktop.org/wiki/Software/gummiboot/'>Gummiboot documentation</ulink>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-GUMMIBOOT_ENTRIES'><glossterm>GUMMIBOOT_ENTRIES</glossterm>
+ <info>
+ GUMMIBOOT_ENTRIES[doc] = "When EFI_PROVIDER is set to "gummiboot", the GUMMIBOOT_ENTRIES variable specifies a list of entry files (*.conf) to be installed containing 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 "gummiboot", the
+ <filename>GUMMIBOOT_ENTRIES</filename> variable specifies
+ a list of entry files
+ (<filename>*.conf</filename>) to be installed
+ containing one boot entry per file.
+ By default, the
+ <link linkend='ref-classes-gummiboot'><filename>gummiboot</filename></link>
+ class sets the <filename>GUMMIBOOT_ENTRIES</filename> as
+ follows:
+ <literallayout class='monospaced'>
+ GUMMIBOOT_ENTRIES ?= ""
+ </literallayout>
+ </para>
+
+ <para>
+ For information on Gummiboot, see the
+ <ulink url='http://freedesktop.org/wiki/Software/gummiboot/'>Gummiboot documentation</ulink>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-GUMMIBOOT_TIMEOUT'><glossterm>GUMMIBOOT_TIMEOUT</glossterm>
+ <info>
+ GUMMIBOOT_TIMEOUT[doc] = "When EFI_PROVIDER is set to "gummiboot", the GUMMIBOOT_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 "gummiboot", the
+ <filename>GUMMIBOOT_TIMEOUT</filename> variable specifies
+ the boot menu timeout in seconds.
+ By default, the
+ <link linkend='ref-classes-gummiboot'><filename>gummiboot</filename></link>
+ class sets the <filename>GUMMIBOOT_TIMEOUT</filename> as
+ follows:
+ <literallayout class='monospaced'>
+ GUMMIBOOT_TIMEOUT ?= "10"
+ </literallayout>
+ </para>
+
+ <para>
+ For information on Gummiboot, see the
+ <ulink url='http://freedesktop.org/wiki/Software/gummiboot/'>Gummiboot documentation</ulink>.
+ </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-uclibc" for <filename>uclibc</filename>.
+ For ARM/EABI targets, there are also "linux-gnueabi" and
+ "linux-uclibc-gnueabi" 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 with 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-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_PREFIX'><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] = "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)."
+ </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
+ <filename>wic</filename> 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
+ will 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>
+ </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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ </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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>,
+ 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 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>
+ 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.
+ </note>
+
+ <note>
+ Due to the way this variable is processed, it is not
+ possible to update its contents using
+ <filename>_append</filename> or
+ <filename>_prepend</filename>. To add one or more
+ additional options to this variable the
+ <filename>+=</filename> operator must be used.
+ </note>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-IMAGE_INSTALL'><glossterm>IMAGE_INSTALL</glossterm>
+ <info>
+ 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."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the packages to install into an image.
+ The <filename>IMAGE_INSTALL</filename> variable is a
+ mechanism for an image recipe and you should use it
+ with care to avoid ordering issues.
+ <note>
+ When working with an
+ <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 disk (initramfs)
+ recipe to use a fixed set of packages and not be
+ affected by <filename>IMAGE_INSTALL</filename>.
+ </note>
+ </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 exist, such as
+ <filename>core-image.bbclass</filename>, that can take
+ <filename><link linkend='var-IMAGE_FEATURES'>IMAGE_FEATURES</link></filename>
+ lists and turn these into auto-generated entries in
+ <filename>IMAGE_INSTALL</filename> in addition to its
+ default contents.
+ </para>
+
+ <para>
+ Using <filename>IMAGE_INSTALL</filename> with the
+ <filename>+=</filename> operator from the
+ <filename>/conf/local.conf</filename> file or from within
+ an image recipe is not recommended as it can cause ordering
+ issues.
+ Since <filename>core-image.bbclass</filename> sets
+ <filename>IMAGE_INSTALL</filename> to a default value using
+ the <filename>?=</filename> operator, using a
+ <filename>+=</filename> operation against
+ <filename>IMAGE_INSTALL</filename> will result in
+ unexpected behavior when used in
+ <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>
+
+ <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.
+ </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
+ "<link linkend='image-generation-dev-environment'>Image Generation</link>"
+ section.
+ </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 (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 (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 has created 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 has created 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 has created 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 has created 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
+ qcow2
+ squashfs
+ squashfs-lzo
+ squashfs-xz
+ tar
+ tar.bz2
+ tar.gz
+ tar.lz4
+ tar.xz
+ ubi
+ ubifs
+ vdi
+ vmdk
+ 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ </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 to be inherited at this point during parsing. The variable is only valid in configuration files."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Causes the named class to be inherited at
+ this point during parsing.
+ The variable is only valid in configuration files.
+ </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_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" /> -->
+ 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.
+ </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 disk (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 disk (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>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-INITRAMFS_IMAGE'><glossterm>INITRAMFS_IMAGE</glossterm>
+ <info>
+ INITRAMFS_IMAGE[doc] = "Causes the OpenEmbedded build system to build an additional recipe as a dependency to your root filesystem recipe (e.g. core-image-sato)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Causes the OpenEmbedded build system to build an additional
+ recipe as a dependency to your root filesystem recipe
+ (e.g. <filename>core-image-sato</filename>).
+ The additional recipe is used to create an initial RAM disk
+ (initramfs) that might be needed during the initial boot of
+ the target system to accomplish such things as loading
+ kernel modules prior to mounting the root file system.
+ </para>
+
+ <para>
+ When you set the variable, specify the name of the
+ initramfs you want created.
+ The following example, which is set in the
+ <filename>local.conf</filename> configuration file, causes
+ a separate recipe to be created that results in an
+ initramfs image named
+ <filename>core-image-sato-initramfs.bb</filename> to be
+ created:
+ <literallayout class='monospaced'>
+ INITRAMFS_IMAGE = "core-image-minimal-initramfs"
+ </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 = ""
+ </literallayout>
+ </para>
+
+ <para>
+ 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.
+ You can also reference the
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta/classes/kernel.bbclass'><filename>kernel.bbclass</filename></ulink>
+ file to see how the variable is used.
+ </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 during kernel compilation in order to build a single binary that contains both the kernel image and the initial RAM disk (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 during kernel compilation
+ in order to build a single binary that contains both the
+ kernel image and the initial RAM disk (initramfs).
+ Using an extra compilation pass ensures that when a kernel
+ attempts to use an initramfs, it does not encounter
+ circular dependencies should the initramfs include kernel
+ modules.
+ </para>
+
+ <para>
+ The combined binary is deposited into the
+ <filename>tmp/deploy</filename> directory, which is part
+ of the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
+ </para>
+
+ <para>
+ Setting the variable to "1" in a configuration file causes
+ the OpenEmbedded build system to make the extra pass during
+ kernel compilation:
+ <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.
+ </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 Yocto Project kernel that
+ is based on the Linux 3.14 kernel, the kernel recipe file
+ is the
+ <filename>meta/recipes-kernel/linux/linux-yocto_3.14.bb</filename>
+ file.
+ Following is an example for a 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.
+ The kernel's append file is located in the BSP layer for
+ a given machine.
+ For example, the kernel append file for the Emenlow BSP is in the
+ <filename>meta-intel</filename> Git repository and is named
+ <filename>meta-emenlow/recipes-kernel/linux/linux-yocto_3.14.bbappend</filename>.
+ Here are the related statements from the append file:
+ <literallayout class='monospaced'>
+ COMPATIBLE_MACHINE_emenlow-noemgd = "emenlow-noemgd"
+ KMACHINE_emenlow-noemgd = "emenlow"
+ KBRANCH_emenlow-noemgd = "standard/base"
+ KERNEL_FEATURES_append_emenlow-noemgd = " features/drm-gma500/drm-gma500.scc"
+ </literallayout>
+ The <filename>KBRANCH</filename> statement identifies
+ the kernel branch to use when building for the Emenlow
+ 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
+ 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 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_<link linkend='var-KMACHINE'>KMACHINE</link> ?= <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.
+ </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 <filename>.dtb</filename>) 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 metadata from the Yocto Project kernel Git repository. 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 metadata from the Yocto Project kernel Git repository.
+ In the OpenEmbedded build system, the default Board Support Packages (BSPs)
+ <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink>
+ 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 to further
+ add metadata for all 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 adds <filename>netfilter</filename> to all
+ the Yocto Project kernels and adds sound support to the <filename>qemux86</filename>
+ machine:
+ <literallayout class='monospaced'>
+ # Add netfilter to all linux-yocto kernels
+ KERNEL_FEATURES="features/netfilter/netfilter.scc"
+
+ # Add sound support to the qemux86 machine
+ KERNEL_FEATURES_append_qemux86=" 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 ?= "${KERNEL_IMAGETYPE}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+ </literallayout>
+ </para>
+
+ <para>
+ See the
+ <link linkend='var-KERNEL_IMAGETYPE'><filename>KERNEL_IMAGETYPE</filename></link>,
+ <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.
+ </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.
+ </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, 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."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Lists the layers that this recipe depends upon, separated by spaces.
+ 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).
+ An error will be produced if any dependency is missing or
+ the version numbers do not match exactly (if specified).
+ 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-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 (.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
+ (<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
+ "<link linkend='usingpoky-configuring-LIC_FILES_CHKSUM'>
+ Tracking License Changes</link>" section.
+ </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 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
+ "<link linkend='enabling-commercially-licensed-recipes'>Enabling Commercially Licensed Recipes</link>"
+ section.
+ </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
+ <link linkend='enabling-commercially-licensed-recipes'>Enabling Commercially Licensed Recipes</link>"
+ section.
+ </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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink>
+ 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
+ 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
+ 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] = "Lists overrides specific to the current machine. By default, this list includes the value of MACHINE."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Lists overrides specific to the current machine.
+ By default, this list includes the value
+ of <filename><link linkend='var-MACHINE'>MACHINE</link></filename>.
+ You can extend the list to apply variable overrides for
+ classes of machines.
+ For example, all QEMU emulated machines (e.g. qemuarm,
+ qemux86, and so forth) include a common file named
+ <filename>meta/conf/machine/include/qemu.inc</filename>
+ that prepends <filename>MACHINEOVERRIDES</filename> with
+ the following variable override:
+ <literallayout class='monospaced'>
+ MACHINEOVERRIDES =. "qemuall:"
+ </literallayout>
+ </para>
+
+ <para>
+ Applying an override like <filename>qemuall</filename>
+ affects all QEMU emulated machines elsewhere.
+ Here is an example from the
+ <filename>connman-conf</filename> recipe:
+ <literallayout class='monospaced'>
+ SRC_URI_append_qemuall = "file://wired.config \
+ file://wired-setup \
+ "
+ </literallayout>
+ </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, such as 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, such as 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>.
+ </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_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" /> -->
+ Separates files for different machines such that you can build
+ for multiple target machines using the same output directories.
+ See the <link linkend='var-STAMP'><filename>STAMP</filename></link> variable
+ for an example.
+ </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. 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."
+ </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> = "<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.
+ <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-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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
+ for details on how this class applies these additional
+ sed command arguments.
+ For general information on the
+ <filename>binconfig.bbclass</filename> class, see the
+ "<link linkend='ref-classes-binconfig'>Binary Configuration Scripts - <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 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 makes two top-level build environment
+ setup scripts available:
+ <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>
+ and
+ <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>.
+ When you run one of these scripts, 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 scripts.
+ </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] = "BitBake uses OVERRIDES to control what variables are overridden after BitBake parses recipes and configuration files."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ BitBake uses <filename>OVERRIDES</filename> to control
+ what variables are overridden after BitBake parses
+ recipes and configuration files.
+ You can find more information on how overrides are handled
+ in the
+ "<ulink url='&YOCTO_DOCS_BB_URL;#conditional-syntax-overrides'>Conditional Syntax (Overrides)</ulink>"
+ section of the BitBake User Manual.
+ </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,
+ <filename>BUILD_ARCH</filename> when building for the
+ build host and "${SDK_ARCH}-${SDKPKGSUFFIX}" when building
+ for the SDK.
+ However, if your recipe's output packages are built
+ specific to the target machine rather than general 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>,
+ 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 is broken
+ and is not supported.
+ 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 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] = "Specifies user-defined package architectures when constructing package feed URIs."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the package architectures used as part of the
+ package feed URIs during the build.
+ 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.
+ </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 disk (initramfs)
+ image, use the <filename>PACKAGE_INSTALL</filename>
+ variable.
+ </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-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>)
+ if the feature is enabled.</para></listitem>
+ <listitem><para>Extra arguments
+ that should be added to <filename>EXTRA_OECONF</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><link linkend='var-DEPENDS'>DEPENDS</link></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-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 to be created from the recipe."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The list of packages to be created from the recipe.
+ 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>
+ </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 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.
+ </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 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
+ "<link linkend='speeding-up-the-build'>Speeding Up the Build</link>"
+ section.
+ </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>
+ 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 Manual.
+ </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>
+ </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:
+ <literallayout class='monospaced'>
+ ${STAGING_DIR_HOST}/pkgdata
+ </literallayout>
+ </para>
+
+ <para>
+ Do not change this default.
+ </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 used by the do_package task to write output from the do_packagedata task."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Points to a temporary work area used by the
+ <link linkend='ref-tasks-package'><filename>do_package</filename></link>
+ task to write output from the
+ <link linkend='ref-tasks-packagedata'><filename>do_packagedata</filename></link>
+ task.
+ The <filename>PKGDESTWORK</filename> location defaults to
+ the following:
+ <literallayout class='monospaced'>
+ ${WORKDIR}/pkgdata
+ </literallayout>
+ </para>
+
+ <para>
+ The <filename>do_packagedata</filename> task then packages
+ the data in the temporary work area and installs it into a
+ shared directory pointed to by
+ <link linkend='var-PKGDATA_DIR'><filename>PKGDATA_DIR</filename></link>.
+ </para>
+
+ <para>
+ Do not change this default.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PKGE'><glossterm>PKGE</glossterm>
+ <info>
+ PKGE[doc] = "The epoch of the output package built by the OpenEmbedded build system."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The epoch of the output package built by the
+ OpenEmbedded build system.
+ 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 output package built by the OpenEmbedded build system."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The revision of the output package built by the
+ OpenEmbedded build system.
+ 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 output package built by the OpenEmbedded build system."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The version of the output package built by the
+ OpenEmbedded build system.
+ 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. It refers to a package name in the context of a file created or produced by the OpenEmbedded build system."
+ </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".
+ </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 an item, this variable
+ determines which recipe should be given preference.
+ 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>
+ <note>
+ If you set <filename>PREFERRED_PROVIDER</filename>
+ for a <filename>virtual/*</filename> item, then any
+ recipe that
+ <link linkend='var-PROVIDES'><filename>PROVIDES</filename></link>
+ that item that is not selected 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 = "2.7.3"
+ PREFERRED_VERSION_linux-yocto = "3.19%"
+ </literallayout>
+ 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 = "3.4%"
+ </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 = "3.4%"
+ </literallayout>
+ </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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>:
+ <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>
+ </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>
+ </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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
+ 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>
+ </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
+ <link linkend='ref-classes-distutils'><filename>distutils</filename></link>
+ 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 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)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ 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>
+ When you use the <filename>RDEPENDS</filename> variable
+ in a recipe, you are essentially stating that the recipe's
+ <link linkend='ref-tasks-build'><filename>do_build</filename></link>
+ task depends on the existence of a specific package.
+ Consider this simple example for two recipes named "a" and
+ "b" that produce similarly named IPK packages.
+ In this example, the <filename>RDEPENDS</filename>
+ statement appears in the "a" recipe:
+ <literallayout class='monospaced'>
+ RDEPENDS_${PN} = "b"
+ </literallayout>
+ Here, the dependency is such that the
+ <filename>do_build</filename> task for recipe "a" depends
+ on the
+ <link linkend='ref-tasks-package_write_ipk'><filename>do_package_write_ipk</filename></link>
+ task of recipe "b".
+ This means the package file for "b" must be available when
+ the output for recipe "a" has been completely built.
+ More importantly, package "a" will be marked as depending
+ on package "b" in a manner that is understood by the
+ package manager.
+ </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.
+ 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>
+ The package name you attach to the
+ <filename>RDEPENDS</filename> variable must appear
+ as it would in the <filename>PACKAGES</filename>
+ namespace before any renaming of the output package by
+ classes like
+ <link linkend='ref-classes-debian'><filename>debian</filename></link>.
+ </para>
+
+ <para>
+ In many cases you do not need to explicitly add
+ runtime dependencies using
+ <filename>RDEPENDS</filename> since some automatic
+ handling occurs:
+ <itemizedlist>
+ <listitem><para><emphasis><filename>shlibdeps</filename></emphasis>: If
+ a runtime package contains a shared library
+ (<filename>.so</filename>), the build
+ processes the library in order to determine other
+ libraries to which it is dynamically linked.
+ The build process adds these libraries to
+ <filename>RDEPENDS</filename> when creating the runtime
+ package.</para></listitem>
+ <listitem><para><emphasis><filename>pcdeps</filename></emphasis>: If
+ the package ships a <filename>pkg-config</filename>
+ information file, the build process uses this file
+ to add items to the <filename>RDEPENDS</filename>
+ variable to create the runtime packages.
+ </para></listitem>
+ </itemizedlist>
+ </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 <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-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_OLD_IMAGE'><glossterm>RM_OLD_IMAGE</glossterm>
+ <info>
+ RM_OLD_IMAGE[doc] = "Reclaims disk space by removing previously built versions of the same image from the images directory pointed to by the DEPLOY_DIR variable."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Reclaims disk space by removing previously built
+ versions of the same image from the
+ <filename>images</filename> directory pointed to by the
+ <link linkend='var-DEPLOY_DIR'><filename>DEPLOY_DIR</filename></link>
+ variable.
+ </para>
+
+ <para>
+ Set this variable to "1" in your
+ <filename>local.conf</filename> file to remove these
+ images.
+ </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><link linkend='var-PACKAGES'>PACKAGES</link></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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
+ 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 if 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
+ 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>
+ 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 = "${<link linkend='var-TMPDIR'>TMPDIR</link>}/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 = "${<link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>}/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 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_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_OUTPUT = "${<link linkend='var-SDK_DIR'>SDK_DIR</link>}/image"
+ </literallayout>
+ <note>
+ The <filename>SDK_OUTPUT</filename> directory is a
+ temporary directory as it is part of
+ <filename>WORKDIR</filename> by way of
+ <filename>SDK_DIR</filename>.
+ 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 has created 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 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] = "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."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Defines a serial console (TTY) to enable using getty.
+ 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 the serial consoles (TTYs) to enable using getty.
+ 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] = "Similar to SERIAL_CONSOLES except the device is checked for existence before attempting to enable it. Supported only by SysVinit."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Similar to
+ <link linkend='var-SERIAL_CONSOLES'><filename>SERIAL_CONSOLES</filename></link>
+ except the device is checked for existence before attempting
+ to enable it.
+ 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 this example, <filename>intone</filename> depends on
+ <filename>mplayer2</filename>.
+ </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:
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
+ <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-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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink>,
+ from the local machine.
+ 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 <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>
+ 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 <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>
+ 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
+ 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.
+ </para>
+
+ <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.
+ </note>
+ </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 has been 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 has been
+ 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 \n \
+ file://.* file:///<replaceable>some-local-dir</replaceable>/sstate/PATH"
+ </literallayout>
+ </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] = "Specifies the path to the top-level sysroots directory (i.e. ${TMPDIR}/sysroots)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the path to the top-level sysroots directory
+ (i.e.
+ <filename>${</filename><link linkend='var-TMPDIR'><filename>TMPDIR</filename></link><filename>}/sysroots</filename>).
+ <note>
+ Recipes should never write files directly under
+ this 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 primary sysroot directory for which the target is being built."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the path to the primary sysroot directory for
+ which the target is being built.
+ Depending on the type of recipe and the build target, the
+ recipe's value is as follows:
+ <itemizedlist>
+ <listitem><para>For recipes building for the target
+ machine, the value is "${STAGING_DIR}/${MACHINE}".
+ </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.
+ </para></listitem>
+ <listitem><para>For native SDK
+ recipes that build for the SDK
+ (<filename>nativesdk</filename>), the value is
+ "${STAGING_DIR}/${MULTIMACH_HOST_SYS}".
+ </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 for the build host."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the path to the sysroot directory for the
+ build host.
+ </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 directory for the target for which the current recipe is being built."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the path to the sysroot directory for the
+ target for which the current recipe is being built.
+ In most cases, this path is the
+ <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
+ and generate binaries for the "TARGET" system.
+ <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>
+ 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 will be 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>
+ 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 are using 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 are using 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>
+ 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_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 service you have specified in SYSTEMD_SERVICE should be started 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 service you have
+ specified in
+ <link linkend='var-SYSTEMD_SERVICE'><filename>SYSTEMD_SERVICE</filename></link>
+ should be started 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_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 be running 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 be running 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
+ 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
+ <link linkend='var-CFLAGS'><filename>CFLAGS</filename></link>
+ 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
+ <link linkend='var-CPPFLAGS'><filename>CPPFLAGS</filename></link>
+ 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
+ <link linkend='var-CXXFLAGS'><filename>CXXFLAGS</filename></link>
+ 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 <filename>glibc</filename>-based systems and
+ to "linux-uclibc" for <filename>uclibc</filename>.
+ For ARM/EABI targets, there are also "linux-gnueabi" and
+ "linux-uclibc-gnueabi" values possible.
+ </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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>,
+ 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 'uclibc'."
+ </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 "uclibc".
+ </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
+ <ulink url='&YOCTO_RELEASE_NOTES;'>Release Notes</ulink>
+ for the specific components with which the toolchain
+ must be compatible.
+ </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>uclibc</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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
+ 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 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 <filename>TEST_LOG_DIR</filename> 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 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 "smart" test suite, which needs to download
+ packages from <filename>DEPLOY_DIR/rpm</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 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 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 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
+ </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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>:
+ <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.
+ </para>
+
+ <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.
+ For information on setting up a cross-development
+ environment, see the
+ <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-manual'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>.
+ </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.
+ </para>
+
+ <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.
+ For information on setting up a cross-development
+ environment, see the
+ <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-manual'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>.
+ </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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
+ BitBake automatically sets this variable when you
+ initialize your build environment using either
+ <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>
+ or
+ <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</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 TARGET_ARCH.
+ </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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
+ 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
+ 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>).
+ 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 to be 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 to be
+ 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-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 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-USERADD_ERROR_DYNAMIC'><glossterm>USERADD_ERROR_DYNAMIC</glossterm>
+ <info>
+ USERADD_ERROR_DYNAMIC[doc] = "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."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ 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.
+ </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 = "1"
+ </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 be passed to the useradd command if you wish to 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 be passed
+ to the <filename>useradd</filename> command
+ if you wish to 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>-->
+<!-- </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-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><link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>:
+ 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/import-layers/yocto-poky/documentation/ref-manual/ref-varlocality.xml b/import-layers/yocto-poky/documentation/ref-manual/ref-varlocality.xml
new file mode 100644
index 000000000..d3f873298
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/ref-varlocality.xml
@@ -0,0 +1,196 @@
+<!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-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-PACKAGES'>PACKAGES</link></filename>
+ </para></listitem>
+ <listitem><para><filename><link linkend='var-DEFAULT_PREFERENCE'>DEFAULT_PREFERENCE
+ </link></filename></para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ </section>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4 spell spelllang=en_gb
+-->
diff --git a/import-layers/yocto-poky/documentation/ref-manual/resources.xml b/import-layers/yocto-poky/documentation/ref-manual/resources.xml
new file mode 100644
index 000000000..8299f9f3c
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/resources.xml
@@ -0,0 +1,123 @@
+<!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>Contributing to the Yocto Project</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.
+ To find out how to download source code,
+ see the "<ulink url='&YOCTO_DOCS_DEV_URL;#local-yp-release'>Yocto Project Release</ulink>"
+ section in the Yocto Project Development Manual.
+ </para>
+</section>
+
+<section id='resources-bugtracker'>
+ <title>Tracking Bugs</title>
+
+ <para>
+ If you find problems with the Yocto Project, you should report them using the
+ Bugzilla application at <ulink url='&YOCTO_BUGZILLA_URL;'></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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#bitbake-term'>BitBake</ulink>
+ build tool.</para></listitem>
+ <listitem><para><ulink url='&YOCTO_LISTS_URL;/listinfo/poky'></ulink> -
+ Discussion mailing list about
+ <ulink url='&YOCTO_DOCS_DEV_URL;#poky'>Poky</ulink>.
+ </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 Yocto Project community mailing lists page
+ <ulink url='&YOCTO_HOME_URL;/tools-resources/community/mailing-lists'>here</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'>
+ <title>Links</title>
+
+ <para>
+ Here is a list of resources you will 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='http://www.intel.com/'>Intel Corporation</ulink>:</emphasis>
+ The company that acquired OpenedHand in 2008 and began
+ development on the Yocto Project.</para></listitem>
+-->
+ <listitem><para><emphasis>
+ <ulink url='&OE_HOME_URL;'>OpenEmbedded</ulink>:</emphasis>
+ The upstream, generic, embedded distribution used as the basis
+ for the build system in the Yocto Project.
+ Poky derives from and contributes back to the OpenEmbedded
+ project.</para></listitem>
+ <listitem><para><emphasis>
+ <ulink url='http://www.openembedded.org/wiki/BitBake'>
+ BitBake</ulink>:</emphasis> The tool used to process metadata.</para></listitem>
+ </itemizedlist>
+ For more links, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#other-information'>Other Information</ulink>"
+ section in the Yocto Project Development Manual.
+ </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'>How to Submit a Change</ulink>"
+ section in the Yocto Project Development Manual.
+ </para>
+</section>
+
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/import-layers/yocto-poky/documentation/ref-manual/technical-details.xml b/import-layers/yocto-poky/documentation/ref-manual/technical-details.xml
new file mode 100644
index 000000000..f06382ab5
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/technical-details.xml
@@ -0,0 +1,1460 @@
+<!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='technical-details'>
+<title>Technical Details</title>
+
+ <para>
+ This chapter provides technical details for various parts of the
+ Yocto Project.
+ Currently, topics include Yocto Project components,
+ cross-toolchain generation, shared state (sstate) cache,
+ x32, Wayland support, and Licenses.
+ </para>
+
+<section id='usingpoky-components'>
+ <title>Yocto Project Components</title>
+
+ <para>
+ The
+ <ulink url='&YOCTO_DOCS_DEV_URL;#bitbake-term'>BitBake</ulink>
+ task executor together with various types of configuration files form
+ the OpenEmbedded Core.
+ 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 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='closer-look'>A Closer Look at the Yocto Project Development Environment</link>"
+ Chapter.
+ </para>
+
+ <section id='usingpoky-components-bitbake'>
+ <title>BitBake</title>
+
+ <para>
+ BitBake is the tool at the heart of the OpenEmbedded build system
+ and is responsible for parsing the
+ <ulink url='&YOCTO_DOCS_DEV_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" in this manual).
+ 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='usingpoky-components-metadata'>
+ <title>Metadata (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='usingpoky-components-classes'>
+ <title>Classes</title>
+
+ <para>
+ Class files (<filename>.bbclass</filename>) contain information that
+ is useful to share between
+ <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink> files.
+ An example is the
+ <link linkend='ref-classes-autotools'><filename>autotools</filename></link>
+ class, which contains common settings for any application that
+ Autotools uses.
+ The "<link linkend='ref-classes'>Classes</link>" chapter provides
+ details about classes and how to use them.
+ </para>
+ </section>
+
+ <section id='usingpoky-components-configuration'>
+ <title>Configuration</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>local.conf</filename>, which is found
+ in the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
+ </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_DEV_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 Software Development Kit (SDK) Developer's Guide</ulink>.
+ </para>
+
+ <para>
+ In the Yocto Project development environment, cross-development
+ toolchains are used to build the image 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 BitBake 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 GLIBC needed to bootstrap
+ <filename>glibc</filename>.
+ </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., the
+ <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
+ <link linkend='var-SDK_ARCH'><filename>SDK_ARCH</filename></link>),
+ 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
+ <link linkend='var-SDKMACHINE'><filename>SDKMACHINE</filename></link>,
+ 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 relocatable <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
+ <link linkend='var-SDKMACHINE'><filename>SDKMACHINE</filename></link>,
+ 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>"
+ section in the Yocto Project Software Development Kit (SDK) Developer's
+ Guide.
+ </note>
+</section>
+
+<section id="shared-state-cache">
+ <title>Shared State Cache</title>
+
+ <para>
+ By design, the OpenEmbedded build system builds everything from scratch unless
+ BitBake 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 there is no possibility of stale data causing problems.
+ When developers hit problems, they typically default back to building from scratch
+ so they know the state of things 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.
+ </para>
+
+ <note>
+ The OpenEmbedded build system does not maintain
+ <link linkend='var-PR'><filename>PR</filename></link> information
+ as part of the shared state packages.
+ Consequently, considerations exist that affect maintaining shared
+ state feeds.
+ For information on how the OpenEmbedded build system
+ works with packages and can
+ track incrementing <filename>PR</filename> information, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#incrementing-a-package-revision-number'>Incrementing a Package Revision Number</ulink>"
+ section.
+ </note>
+
+ <para>
+ The rest of this section goes into detail about the overall incremental build
+ architecture, the checksums (signatures), shared state, and some tips and tricks.
+ </para>
+
+ <section id='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
+ <link linkend='ref-tasks-install'><filename>do_install</filename></link>
+ and
+ <link linkend='ref-tasks-package'><filename>do_package</filename></link>
+ 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='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 <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>.
+ 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 build host.
+ 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 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 <filename>WORKDIR</filename> 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
+ <link linkend='var-PACKAGE_ARCHS'><filename>PACKAGE_ARCHS</filename></link>
+ variable does not
+ depend on the value of
+ <link linkend='var-MACHINE'><filename>MACHINE</filename></link>,
+ 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.
+ 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, there is still the question of a task's indirect inputs - the
+ things that were already built and present in the
+ <ulink url='&YOCTO_DOCS_DEV_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, 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:
+ <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
+ <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>
+ since that variable is actually constructed as a path within
+ <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>, 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 <filename>OE-Core</filename>
+ 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink>
+ 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>
+ </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 part 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
+ <link linkend='ref-classes-sstate'><filename>sstate</filename></link>
+ 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 - the build process does not need to worry about its origin.
+ </para>
+
+ <para>
+ There are two types of output, one is just about creating a directory
+ in <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>.
+ A good example is the output of either
+ <link linkend='ref-tasks-install'><filename>do_install</filename></link>
+ or
+ <link linkend='ref-tasks-package'><filename>do_package</filename></link>.
+ 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
+ <link linkend='ref-tasks-deploy'><filename>do_deploy</filename></link>
+ example taken from the
+ <link linkend='ref-classes-deploy'><filename>deploy</filename></link>
+ 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}"
+ </literallayout>
+ In this example, we add some extra flags to the task, a name field ("deploy"), an
+ input directory where the task sends data, and the output
+ directory where the data from the task should eventually be copied.
+ We also add a <filename>_setscene</filename> variant of the task and add the task
+ name to the <filename>SSTATETASKS</filename> list.
+ </para>
+
+ <para>
+ If you have a directory whose contents you need to preserve, you can do this with
+ a line like the following:
+ <literallayout class='monospaced'>
+ do_package[sstate-plaindirs] = "${PKGD} ${PKGDEST}"
+ </literallayout>
+ This method, as well as the following example, also works for multiple directories.
+ <literallayout class='monospaced'>
+ do_package[sstate-inputdirs] = "${PKGDESTWORK} ${SHLIBSWORKDIR}"
+ do_package[sstate-outputdirs] = "${PKGDATA_DIR} ${SHLIBSDIR}"
+ do_package[sstate-lockfile] = "${PACKAGELOCK}"
+ </literallayout>
+ These methods also include the ability to take a lockfile when manipulating
+ shared state directory structures since some cases are sensitive to file
+ additions or removals.
+ </para>
+
+ <para>
+ Behind the scenes, the shared state code works by looking in
+ <link linkend='var-SSTATE_DIR'><filename>SSTATE_DIR</filename></link> and
+ <link linkend='var-SSTATE_MIRRORS'><filename>SSTATE_MIRRORS</filename></link>
+ for shared state files.
+ Here is an example:
+ <literallayout class='monospaced'>
+ SSTATE_MIRRORS ?= "\
+ file://.* http://someserver.tld/share/sstate/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
+ <link linkend='ref-tasks-package_write_ipk'><filename>do_package_write_ipk</filename></link>
+ 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 id='tips-and-tricks'>
+ <title>Tips and Tricks</title>
+
+ <para>
+ The code in the build system that supports incremental builds is not
+ simple code.
+ This section presents some tips and tricks that help you work around
+ issues related to shared state code.
+ </para>
+
+ <section id='debugging'>
+ <title>Debugging</title>
+
+ <para>
+ When things go wrong, debugging needs to be straightforward.
+ Because of this, the Yocto Project includes strong debugging
+ tools:
+ <itemizedlist>
+ <listitem><para>Whenever a shared state package is written
+ out into the
+ <link linkend='var-SSTATE_DIR'><filename>SSTATE_DIR</filename></link>,
+ a corresponding <filename>.siginfo</filename> file is
+ also written.
+ This file contains a pickled Python database of all
+ the Metadata that went into creating the hash for a
+ given shared state package.
+ Whenever a stamp is written into the stamp directory
+ <link linkend='var-STAMP'><filename>STAMP</filename></link>,
+ a corresponding <filename>.sigdata</filename> file
+ is created that contains the same hash data that
+ represented the executed task.
+ </para></listitem>
+ <listitem><para>You can 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" to only dump the signature
+ or to 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 stamp directory for every task it would have
+ executed instead of building the specified target
+ package.
+ </para></listitem>
+ <listitem><para>There is a
+ <filename>bitbake-diffsigs</filename> command that
+ can process <filename>.sigdata</filename> and
+ <filename>.siginfo</filename> files.
+ If you specify one of these files, BitBake dumps out
+ the dependency information in the file.
+ If you specify two files, BitBake compares the two
+ files and dumps out the differences between the two.
+ This more easily helps answer the question of "What
+ changed between X and Y?"</para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='invalidating-shared-state'>
+ <title>Invalidating Shared State</title>
+
+ <para>
+ The OpenEmbedded build system uses checksums and shared state
+ 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
+ <link linkend='ref-tasks-package'><filename>do_package</filename></link>
+ 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 OpenEmbedded build
+ system to run the task again.
+ </para>
+
+ <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>
+ </section>
+ </section>
+</section>
+
+<section id='x32'>
+ <title>x32</title>
+
+ <para>
+ x32 is a processor-specific Application Binary Interface (psABI) for x86_64.
+ 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>
+
+ <section id='support'>
+ <title>Support</title>
+
+ <para>
+ This Yocto Project release supports the final specifications of x32
+ psABI.
+ Support for x32 psABI exists 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 many 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>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='completing-x32'>
+ <title>Completing x32</title>
+
+ <para>
+ Future Plans for the x32 psABI in the Yocto Project include the following:
+ <itemizedlist>
+ <listitem><para>Enhance and fix the few remaining recipes so they
+ work with and support x32 toolchains.</para></listitem>
+ <listitem><para>Enhance RPM Package Manager (RPM) support for x32 binaries.</para></listitem>
+ <listitem><para>Support larger images.</para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='using-x32-right-now'>
+ <title>Using x32 Right Now</title>
+
+ <para>
+ Follow these steps to use the x32 spABI:
+ <itemizedlist>
+ <listitem><para>Enable the x32 psABI tuning file for <filename>x86_64</filename>
+ machines by editing the <filename>conf/local.conf</filename> like this:
+ <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'}"
+ #MACHINE = "genericx86"
+ #DEFAULTTUNE = "core2-64-x32"
+ </literallayout></para></listitem>
+ <listitem><para>As usual, use BitBake to build an image that supports the x32 psABI.
+ Here is an example:
+ <literallayout class='monospaced'>
+ $ bitbake core-image-sato
+ </literallayout></para></listitem>
+ <listitem><para>As usual, run your image using QEMU:
+ <literallayout class='monospaced'>
+ $ runqemu qemux86-64 core-image-sato
+ </literallayout></para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+</section>
+
+<section id="wayland">
+ <title>Wayland</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.
+ This section describes what you need to do to implement Wayland and
+ use the compositor when building an image for a supporting target.
+ </para>
+
+ <section id="wayland-support">
+ <title>Support</title>
+
+ <para>
+ The Wayland protocol libraries and the reference Weston compositor
+ ship as integrated packages in the <filename>meta</filename> layer
+ of the
+ <ulink url='&YOCTO_DOCS_DEV_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='http://dri.freedesktop.org/wiki/'>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.
+ </para>
+
+ <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>
+ </section>
+
+ <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 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
+ <link linkend="var-DISTRO_FEATURES"><filename>DISTRO_FEATURES</filename></link>
+ statement in your <filename>local.conf</filename> file:
+ <literallayout class='monospaced'>
+ DISTRO_FEATURES_append = " wayland"
+ </literallayout>
+ </para>
+
+ <note>
+ If X11 has been enabled elsewhere, Weston will build Wayland
+ with X11 support
+ </note>
+ </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
+ <link linkend='var-CORE_IMAGE_EXTRA_INSTALL'><filename>CORE_IMAGE_EXTRA_INSTALL</filename></link>
+ 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>
+
+<section id="licenses">
+ <title>Licenses</title>
+
+ <para>
+ This section describes the mechanism by which the OpenEmbedded build system
+ tracks changes to licensing text.
+ The section also describes how to enable commercially licensed recipes,
+ which by default are disabled.
+ </para>
+
+ <para>
+ For information that can help you maintain compliance with various open
+ source licensing during the lifecycle of the product, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#maintaining-open-source-license-compliance-during-your-products-lifecycle'>Maintaining Open Source License Compliance During Your Project's Lifecycle</ulink>" section
+ in the Yocto Project Development Manual.
+ </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
+ <filename><link linkend='var-LIC_FILES_CHKSUM'>LIC_FILES_CHKSUM</link></filename>
+ 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>
+ </para>
+
+ <para>
+ The build system uses the
+ <filename><link linkend='var-S'>S</link></filename> 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>.
+ The second line refers to a file in
+ <filename><link linkend='var-WORKDIR'>WORKDIR</link></filename>.
+ </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.
+ </para>
+
+ <tip>
+ If you specify an empty or invalid "md5" parameter, BitBake 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.
+ </tip>
+
+ <tip>
+ If the whole file contains only license text, you do not need to use the "beginline" and
+ "endline" parameters.
+ </tip>
+ </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
+ <link linkend='var-LICENSE_FLAGS'><filename>LICENSE_FLAGS</filename></link>
+ 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
+ <link linkend='var-LICENSE_FLAGS_WHITELIST'><filename>LICENSE_FLAGS_WHITELIST</filename></link>
+ 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
+ <link linkend='var-LICENSE_FLAGS'><filename>LICENSE_FLAGS</filename></link>
+ strings found in recipes against
+ <link linkend='var-LICENSE_FLAGS_WHITELIST'><filename>LICENSE_FLAGS_WHITELIST</filename></link>
+ 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
+ <link linkend='var-LICENSE_FLAGS'><filename>LICENSE_FLAGS</filename></link>
+ 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>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/import-layers/yocto-poky/documentation/ref-manual/usingpoky.xml b/import-layers/yocto-poky/documentation/ref-manual/usingpoky.xml
new file mode 100644
index 000000000..a7bf32d45
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/ref-manual/usingpoky.xml
@@ -0,0 +1,1132 @@
+<!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='usingpoky'>
+<title>Using the Yocto Project</title>
+
+ <para>
+ This chapter describes common usage for the Yocto Project.
+ The information is introductory in nature as other manuals in the Yocto Project
+ documentation set provide more details on how to use the Yocto Project.
+ </para>
+
+<section id='usingpoky-build'>
+ <title>Running a Build</title>
+
+ <para>
+ This section provides a summary of the build process and provides information
+ for less obvious aspects of the build process.
+ For general information on how to build an image using the OpenEmbedded build
+ system, see the
+ "<ulink url='&YOCTO_DOCS_QS_URL;#qs-building-images'>Building Images</ulink>"
+ section of the Yocto Project Quick Start.
+ </para>
+
+ <section id='build-overview'>
+ <title>Build Overview</title>
+
+ <para>
+ In the development environment you will need to build an image whenever you change hardware
+ support, add or change system libraries, or add or change services that have dependencies.
+ </para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="figures/building-an-image.png" format="PNG" align='center' scalefit='1'/>
+ </imageobject>
+ <caption>
+ <para>Building an Image</para>
+ </caption>
+ </mediaobject>
+
+ <para>
+ The first thing you need to do is set up the OpenEmbedded build
+ environment by sourcing an environment setup script
+ (i.e.
+ <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>
+ or
+ <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>).
+ Here is an example:
+ <literallayout class='monospaced'>
+ $ source &OE_INIT_FILE; [<replaceable>build_dir</replaceable>]
+ </literallayout>
+ </para>
+
+ <para>
+ The <replaceable>build_dir</replaceable> argument is optional and specifies the directory the
+ OpenEmbedded build system uses for the build -
+ the <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
+ If you do not specify a Build Directory, it defaults to a directory
+ named <filename>build</filename> in your current working directory.
+ 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.
+ </para>
+
+ <para>
+ Once the build environment is set up, you can build a target using:
+ <literallayout class='monospaced'>
+ $ bitbake <replaceable>target</replaceable>
+ </literallayout>
+ </para>
+
+ <para>
+ 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>, etc. all found in the
+ <ulink url='&YOCTO_DOCS_DEV_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
+ "<link linkend="ref-images">Images</link>" chapter.
+ </para>
+
+ <note>
+ Building an image without GNU General Public License Version
+ 3 (GPLv3), or similarly licensed, components is supported for
+ only minimal and base images.
+ See the "<link linkend='ref-images'>Images</link>" chapter for more information.
+ </note>
+ </section>
+
+ <section id='building-an-image-using-gpl-components'>
+ <title>Building an Image Using GPL Components</title>
+
+ <para>
+ When building an image using GPL components, you need to maintain your original
+ settings and not switch back and forth applying different versions of the GNU
+ General Public License.
+ If you rebuild using different versions of GPL, dependency errors might occur
+ due to some components not being rebuilt.
+ </para>
+ </section>
+</section>
+
+<section id='usingpoky-install'>
+ <title>Installing and Using the Result</title>
+
+ <para>
+ 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
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink> 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;#sdk-manual'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>.
+ For information about how to install these images, see the documentation for your
+ particular board or machine.
+ </para>
+</section>
+
+<section id='usingpoky-debugging'>
+ <title>Debugging Build Failures</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.
+ </para>
+
+ <para>
+ 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
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#using-the-error-reporting-tool'>Using the Error Reporting Tool</ulink>"
+ section in the Yocto Project Development Manual.
+ </para>
+
+ <para>
+ For discussions on debugging, 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 Developer's Manual
+ and the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#adt-eclipse'>Working within Eclipse</ulink>"
+ section in the Yocto Project Software Development Kit (SDK) Developer's Guide.
+ </para>
+
+ <note>
+ The remainder of this section presents many examples of the
+ <filename>bitbake</filename> command.
+ You can learn about BitBake by reading the
+ <ulink url='&YOCTO_DOCS_BB_URL;#bitbake-user-manual'>BitBake User Manual</ulink>.
+ </note>
+
+
+ <section id='usingpoky-debugging-taskfailures'>
+ <title>Task Failures</title>
+
+ <para>The log file for shell tasks is available in
+ <filename>${WORKDIR}/temp/log.do_<replaceable>taskname</replaceable>.pid</filename>.
+ For example, the <filename>do_compile</filename> task for the QEMU minimal image for the x86
+ machine (<filename>qemux86</filename>) might be
+ <filename>tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/temp/log.do_compile.20830</filename>.
+ To see what
+ <ulink url='&YOCTO_DOCS_DEV_URL;#bitbake-term'>BitBake</ulink>
+ runs to generate that log, look at the corresponding
+ <filename>run.do_<replaceable>taskname</replaceable>.pid</filename> file located in the same directory.
+ </para>
+
+ <para>
+ Presently, the output from Python tasks is sent directly to the console.
+ </para>
+ </section>
+
+ <section id='usingpoky-debugging-taskrunning'>
+ <title>Running Specific Tasks</title>
+
+ <para>
+ Any given package 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>
+ If you wish to rerun a task, use the <filename>-f</filename> force
+ option.
+ For example, the following sequence forces recompilation after
+ changing files in the work directory.
+ <literallayout class='monospaced'>
+ $ bitbake matchbox-desktop
+ .
+ .
+ <replaceable>make some changes to the source code in the work directory</replaceable>
+ .
+ .
+ $ 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>
+ 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='usingpoky-debugging-dependencies'>
+ <title>Dependency Graphs</title>
+
+ <para>
+ Sometimes it can be hard to see why BitBake wants to build
+ other packages before building a given package you have specified.
+ The <filename>bitbake -g <replaceable>targetname</replaceable></filename> command
+ creates the <filename>pn-buildlist</filename>,
+ <filename>pn-depends.dot</filename>,
+ <filename>package-depends.dot</filename>, and
+ <filename>task-depends.dot</filename> files in the current
+ directory.
+ These files show what will be built and the package and task
+ dependencies, which are useful for debugging problems.
+ You can use the
+ <filename>bitbake -g -u depexp <replaceable>targetname</replaceable></filename>
+ command to display the results in a more human-readable form.
+ </para>
+ </section>
+
+ <section id='usingpoky-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='development-host-system-issues'>
+ <title>Development Host System Issues</title>
+
+ <para>
+ Sometimes issues on the host development system can cause your
+ build to fail.
+ Following are known, host-specific problems.
+ Be sure to always consult the
+ <ulink url='&YOCTO_RELEASE_NOTES;'>Release Notes</ulink>
+ for a look at all release-related issues.
+ <itemizedlist>
+ <listitem><para><emphasis><filename>glibc-initial</filename> fails to build</emphasis>:
+ If your development host system has the unpatched
+ <filename>GNU Make 3.82</filename>,
+ the
+ <link linkend='ref-tasks-install'><filename>do_install</filename></link>
+ task fails for <filename>glibc-initial</filename> during
+ the build.</para>
+ <para>Typically, every distribution that ships
+ <filename>GNU Make 3.82</filename> as
+ the default already has the patched version.
+ However, some distributions, such as Debian, have
+ <filename>GNU Make 3.82</filename> as an option, which
+ is unpatched.
+ You will see this error on these types of distributions.
+ Switch to <filename>GNU Make 3.81</filename> or patch
+ your <filename>make</filename> to solve the problem.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='usingpoky-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='usingpoky-debugging-variables'>
+ <title>Variables</title>
+ <para>
+ You can use the <filename>-e</filename> BitBake option to
+ display the parsing environment for a configuration.
+ The following displays the general parsing environment:
+ <literallayout class='monospaced'>
+ $ bitbake -e
+ </literallayout>
+ This next example shows the parsing environment for a specific
+ recipe:
+ <literallayout class='monospaced'>
+ $ bitbake -e <replaceable>recipename</replaceable>
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='recipe-logging-mechanisms'>
+ <title>Recipe Logging Mechanisms</title>
+ <para>
+ Best practices exist while writing recipes that both log build progress and
+ act on build conditions such as warnings and errors.
+ Both Python and Bash language bindings exist for the logging mechanism:
+ <itemizedlist>
+ <listitem><para><emphasis>Python:</emphasis> For Python functions, BitBake
+ supports several loglevels: <filename>bb.fatal</filename>,
+ <filename>bb.error</filename>, <filename>bb.warn</filename>,
+ <filename>bb.note</filename>, <filename>bb.plain</filename>,
+ and <filename>bb.debug</filename>.</para></listitem>
+ <listitem><para><emphasis>Bash:</emphasis> For Bash functions, the same set
+ of loglevels exist and are accessed with a similar syntax:
+ <filename>bbfatal</filename>, <filename>bberror</filename>,
+ <filename>bbwarn</filename>, <filename>bbnote</filename>,
+ <filename>bbplain</filename>, and <filename>bbdebug</filename>.</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ For guidance on how logging is handled in both Python and Bash recipes, see the
+ <filename>logging.bbclass</filename> file in the
+ <filename>meta/classes</filename> folder of the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ </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
+ "<link linkend='ref-tasks-listtasks'><filename>do_listtasks</filename></link>"
+ 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='usingpoky-debugging-others'>
+ <title>Other 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>
+ </itemizedlist>
+ </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
+ <link linkend='ref-classes-buildhistory'><filename>buildhistory</filename></link>
+ 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
+ <link linkend='var-BUILDHISTORY_COMMIT'><filename>BUILDHISTORY_COMMIT</filename></link>
+ variable to "1" at the end of your
+ <filename>conf/local.conf</filename> file found in the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>:
+ <literallayout class='monospaced'>
+ INHERIT += "buildhistory"
+ BUILDHISTORY_COMMIT = "1"
+ </literallayout>
+ Enabling build history as previously described
+ causes the build process to collect build
+ output information and commit it to a local
+ <ulink url='&YOCTO_DOCS_DEV_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><link linkend='var-TOPDIR'><filename>TOPDIR</filename></link><filename>}/buildhistory</filename>
+ in the Build Directory as defined by the
+ <link linkend='var-BUILDHISTORY_DIR'><filename>BUILDHISTORY_DIR</filename></link>
+ 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, there is a <filename>metadata-revs</filename> file
+ that lists the revisions of the repositories for the layers enabled
+ 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 below.
+ </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>
+ There is also a file corresponding 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
+ <link linkend='var-SRCREV'><filename>SRCREV</filename></link>
+ is set to
+ <filename>${<link linkend='var-AUTOREV'>AUTOREV</link>}</filename>.
+ 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>
+ was 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 shown above
+ (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
+ <link linkend='var-BUILDHISTORY_IMAGE_FILES'><filename>BUILDHISTORY_IMAGE_FILES</filename></link>.
+ </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_DEV_URL;#build-directory'>Build Directory</ulink>:
+ <literallayout class='monospaced'>
+ INHERIT += "buildhistory"
+ BUILDHISTORY_COMMIT = "0"
+ BUILDHISTORY_FEATURES = "image"
+ </literallayout>
+ Here, you set the
+ <link linkend='var-BUILDHISTORY_FEATURES'><filename>BUILDHISTORY_FEATURES</filename></link>
+ 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
+ <link linkend='var-BUILDHISTORY_COMMIT'><filename>BUILDHISTORY_COMMIT = "1"</filename></link>),
+ 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>
+ </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='speeding-up-the-build'>
+ <title>Speeding Up the 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>
+ <link linkend='var-BB_NUMBER_THREADS'><filename>BB_NUMBER_THREADS</filename>:</link>
+ 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>
+ <link linkend='var-PARALLEL_MAKE'><filename>PARALLEL_MAKE</filename>:</link>
+ 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.
+ </para></listitem>
+ <listitem><para>
+ <link linkend='var-PARALLEL_MAKEINST'><filename>PARALLEL_MAKEINST</filename>:</link>
+ Extra options passed to the <filename>make</filename> command
+ during the
+ <link linkend='ref-tasks-install'><filename>do_install</filename></link>
+ 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
+ <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>
+ 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_DEV_URL;#build-directory'>Build Directory</ulink>
+ contents could easily be rebuilt.
+ </para></listitem>
+ <listitem><para>
+ Inheriting the
+ <link linkend='ref-classes-rm-work'><filename>rm_work</filename></link>
+ 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
+ <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>
+ 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
+ <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>
+ 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
+ <link linkend='var-INHIBIT_PACKAGE_DEBUG_SPLIT'><filename>INHIBIT_PACKAGE_DEBUG_SPLIT</filename></link>
+ 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>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/import-layers/yocto-poky/documentation/sdk-manual/figures/sdk-devtool-add-flow.png b/import-layers/yocto-poky/documentation/sdk-manual/figures/sdk-devtool-add-flow.png
new file mode 100644
index 000000000..c09e60e35
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/sdk-manual/figures/sdk-devtool-add-flow.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/sdk-manual/figures/sdk-devtool-modify-flow.png b/import-layers/yocto-poky/documentation/sdk-manual/figures/sdk-devtool-modify-flow.png
new file mode 100644
index 000000000..cd06c0181
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/sdk-manual/figures/sdk-devtool-modify-flow.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/sdk-manual/figures/sdk-eclipse-dev-flow.png b/import-layers/yocto-poky/documentation/sdk-manual/figures/sdk-eclipse-dev-flow.png
new file mode 100644
index 000000000..9f986e0d4
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/sdk-manual/figures/sdk-eclipse-dev-flow.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/sdk-manual/figures/sdk-environment.png b/import-layers/yocto-poky/documentation/sdk-manual/figures/sdk-environment.png
new file mode 100644
index 000000000..78b8cad39
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/sdk-manual/figures/sdk-environment.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/sdk-manual/figures/sdk-installed-extensible-sdk-directory.png b/import-layers/yocto-poky/documentation/sdk-manual/figures/sdk-installed-extensible-sdk-directory.png
new file mode 100644
index 000000000..99e07ce6f
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/sdk-manual/figures/sdk-installed-extensible-sdk-directory.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/sdk-manual/figures/sdk-installed-standard-sdk-directory.png b/import-layers/yocto-poky/documentation/sdk-manual/figures/sdk-installed-standard-sdk-directory.png
new file mode 100644
index 000000000..d4af85020
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/sdk-manual/figures/sdk-installed-standard-sdk-directory.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/sdk-manual/figures/sdk-title.png b/import-layers/yocto-poky/documentation/sdk-manual/figures/sdk-title.png
new file mode 100644
index 000000000..e9d5b346b
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/sdk-manual/figures/sdk-title.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/sdk-manual/sdk-appendix-customizing.xml b/import-layers/yocto-poky/documentation/sdk-manual/sdk-appendix-customizing.xml
new file mode 100644
index 000000000..79326077f
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/sdk-manual/sdk-appendix-customizing.xml
@@ -0,0 +1,388 @@
+<!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 SDK</title>
+
+<para>
+ This appendix presents customizations you can apply to both the standard
+ and extensible SDK.
+ Each subsection identifies the type of SDK to which the section applies.
+</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>
+ or
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</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_DEV_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>
+</section>
+</appendix>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/import-layers/yocto-poky/documentation/sdk-manual/sdk-appendix-obtain.xml b/import-layers/yocto-poky/documentation/sdk-manual/sdk-appendix-obtain.xml
new file mode 100644
index 000000000..3d4e364bf
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/sdk-manual/sdk-appendix-obtain.xml
@@ -0,0 +1,252 @@
+<!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
+ toolchain installer and then run the script to hand-install the
+ toolchain.
+ </para>
+
+ <para>
+ You can find SDK installers here:
+ <itemizedlist>
+ <listitem><para><emphasis>Standard SDK Installers</emphasis>
+ 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><emphasis>Extensible SDK Installers</emphasis>
+ Installers for the extensible SDK are in
+ <ulink url='&YOCTO_TOOLCHAIN_DL_URL;'></ulink>.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+</section>
+
+<section id='sdk-building-an-sdk-installer'>
+ <title>Building an SDK Installer</title>
+
+ <para>
+ As an alternative to locating and downloading a toolchain installer,
+ you can build the toolchain installer assuming you have first sourced
+ the environment setup script.
+ See the
+ "<ulink url='&YOCTO_DOCS_QS_URL;#qs-building-images'>Building Images</ulink>"
+ section in the Yocto Project Quick Start for steps that show you
+ how to set up the Yocto Project environment.
+ 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>
+ To build the toolchain installer for a standard SDK and populate
+ the SDK image, use the following command:
+ <literallayout class='monospaced'>
+ $ bitbake <replaceable>image</replaceable> -c populate_sdk
+ </literallayout>
+ You can do the same for the extensible SDK using this command:
+ <literallayout class='monospaced'>
+ $ bitbake <replaceable>image</replaceable> -c populate_sdk_ext
+ </literallayout>
+ These commands result in a toolchain installer that contains the sysroot
+ that matches your target root filesystem.
+ </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='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>
+ 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 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;+snapshot</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/import-layers/yocto-poky/documentation/sdk-manual/sdk-extensible.xml b/import-layers/yocto-poky/documentation/sdk-manual/sdk-extensible.xml
new file mode 100644
index 000000000..3e11fc97d
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/sdk-manual/sdk-extensible.xml
@@ -0,0 +1,1304 @@
+<!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 use it.
+ 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_DEV_URL;#build-system-term'>OpenEmbedded build system</ulink>.
+</para>
+
+<para>
+ Information in this chapter covers features that are not part of the
+ standard SDK.
+ In other words, the chapter presents information unique to the
+ extensible SDK only.
+ For information on how to use the standard SDK, see the
+ "<link linkend='sdk-using-the-standard-sdk'>Using the Standard SDK</link>"
+ chapter.
+</para>
+
+<section id='sdk-setting-up-to-use-the-extensible-sdk'>
+ <title>Setting Up to Use the Extensible SDK</title>
+
+ <para>
+ Getting set up to use the extensible SDK is identical to getting set
+ up to use the standard SDK.
+ You still need to locate and run the installer and then run the
+ environment setup script.
+ See the
+ "<link linkend='sdk-installing-the-sdk'>Installing the SDK</link>"
+ and the
+ "<link linkend='sdk-running-the-sdk-environment-setup-script'>Running the SDK Environment Setup Script</link>"
+ sections for general information.
+ The following items highlight the only differences between getting
+ set up to use the extensible SDK as compared to the standard SDK:
+ <itemizedlist>
+ <listitem><para><emphasis>Default Installation Directory:</emphasis>
+ By default, the extensible SDK installs into the
+ <filename>poky_sdk</filename> folder of your home directory.
+ As with the standard SDK, you can choose to install the
+ extensible SDK in any location when you run the installer.
+ However, unlike the standard SDK, the location you choose needs
+ to be writable for whichever users need to use the SDK,
+ since files will need to be written under that directory during
+ the normal course of operation.
+ </para></listitem>
+ <listitem><para><emphasis>Build Tools and Build System:</emphasis>
+ The extensible SDK installer performs additional tasks as
+ compared to the standard SDK installer.
+ The extensible SDK installer extracts build tools specific
+ to the SDK and the installer also prepares the internal build
+ system within the SDK.
+ Here is example output for running the extensible SDK
+ installer:
+ <literallayout class='monospaced'>
+ $ ./poky-glibc-x86_64-core-image-minimal-core2-64-toolchain-ext-2.1+snapshot.sh
+ Poky (Yocto Project Reference Distro) Extensible SDK installer version 2.1+snapshot
+ ===================================================================================
+ 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...
+ 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></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ After installing the SDK, you need to run the SDK environment setup
+ script.
+ Here is the output:
+ <literallayout class='monospaced'>
+ $ 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>
+ Once you run the environment setup script, you have
+ <filename>devtool</filename> available.
+ </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.
+ </para>
+
+ <para>
+ The <filename>devtool</filename> command line is organized similarly
+ to
+ <ulink url='&YOCTO_DOCS_DEV_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.
+ </para>
+
+ <para>
+ Two <filename>devtool</filename> subcommands that provide
+ entry-points into development are:
+ <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>
+ </itemizedlist>
+ 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 SDK.
+ </para>
+
+ <para>
+ The remainder of this section presents the
+ <filename>devtool add</filename> and
+ <filename>devtool modify</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_DEV_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 where other developers are responsible for
+ various areas of source code.
+ As a developer, you are probably interested in using
+ that source code as part of your development using
+ 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 represents a common situation
+ where the source code does not exist locally
+ and needs to be extracted.
+ In this situation, you just let it get
+ extracted to the default workspace - you do not
+ want it 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>
+ creates a recipe and an append file in the
+ workspace as well as extracts the upstream
+ source files into a local Git repository also
+ within the <filename>sources</filename> folder.
+ </para></listitem>
+ <listitem><para><emphasis>Middle</emphasis>:
+ The middle scenario 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.
+ As always, if required <filename>devtool</filename> creates
+ a Git repository locally during the extraction.
+ 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:
+ <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 both the recipe and an append file
+ for the recipe.
+ </para></listitem>
+ <listitem><para><emphasis>Right</emphasis>:
+ The right scenario represents a situation
+ where the source tree (srctree) has been
+ previously prepared outside of the
+ <filename>devtool</filename> workspace.
+ </para>
+
+ <para>The following command names the recipe
+ and identifies where the existing source tree
+ is located:
+ <literallayout class='monospaced'>
+ $ devtool add <replaceable>recipe srctree</replaceable>
+ </literallayout>
+ The command examines the source code and creates
+ a recipe for it placing the recipe into the
+ workspace.</para>
+
+ <para>Because the extracted source code already exists,
+ <filename>devtool</filename> does not try to
+ relocate it into the workspace - just the new
+ the recipe is placed in the workspace.</para>
+
+ <para>Aside from a recipe folder, the command
+ also creates an append folder and places an initial
+ <filename>*.bbappend</filename> within.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para><emphasis>Edit the Recipe</emphasis>:
+ At this point, 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>:
+ At this point in the flow, the next step you
+ take depends on what you are going to do with
+ the new code.</para>
+ <para>If you need to take the build output and eventually
+ move it to the target hardware, you would use
+ <filename>devtool build</filename>:
+ <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 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, 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>Optionally Update the Recipe With Patch Files</emphasis>:
+ Once you are satisfied with the recipe, if you have made
+ any changes to the source tree that you want to have
+ applied by the recipe, you need to generate patches
+ from those changes.
+ You do this before moving the recipe
+ to its final layer and cleaning up the workspace area
+ <filename>devtool</filename> uses.
+ This optional step is especially relevant if you are
+ using or adding third-party software.</para>
+ <para>To convert commits created using Git to patch files,
+ use the <filename>devtool update-recipe</filename> command.
+ <note>
+ Any changes you want to turn into patches must be
+ committed to the Git repository in the source tree.
+ </note>
+ <literallayout class='monospaced'>
+ $ devtool update-recipe <replaceable>recipe</replaceable>
+ </literallayout>
+ </para></listitem>
+ <listitem><para><emphasis>Move the Recipe to its Permanent Layer</emphasis>:
+ Before cleaning up the workspace, you need to move the
+ final recipe to its permanent layer.
+ You must do this before using the
+ <filename>devtool reset</filename> command if you want to
+ retain the recipe.
+ </para></listitem>
+ <listitem><para><emphasis>Reset the Recipe</emphasis>:
+ As a final step, you can restore the state such that
+ standard layers and the upstream source is used to build
+ the recipe rather than data in the workspace.
+ To reset the recipe, use the <filename>devtool reset</filename>
+ command:
+ <literallayout class='monospaced'>
+ $ devtool reset <replaceable>recipe</replaceable>
+ </literallayout>
+ </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 recipe in
+ place.
+ The command is flexible enough to allow you to extract code,
+ 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
+ you would use with 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 in some layer external
+ to the <filename>devtool</filename> workspace.
+ </para></listitem>
+ <listitem><para>The source files exist 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 some 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 represents a common situation
+ where the source code does not exist locally
+ and needs to be extracted.
+ In this situation, the source is extracted
+ into the default 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,
+ it uses the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ variable to locate the source code and
+ any local patch files from other developers are
+ located.
+ <note>
+ You cannot provide an URL for
+ <replaceable>srctree</replaceable> when using the
+ <filename>devtool modify</filename> command.
+ </note>
+ With this scenario, however, since no
+ <replaceable>srctree</replaceable> argument exists, the
+ <filename>devtool modify</filename> command by default
+ extracts the source files to a Git structure.
+ Furthermore, the location for the extracted source is the
+ default area within the workspace.
+ The result is that the command sets up both the source
+ code and an append file within the workspace with the
+ recipe remaining in its original location.
+ </para></listitem>
+ <listitem><para><emphasis>Middle</emphasis>:
+ The middle scenario 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 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 workspace:
+ <literallayout class='monospaced'>
+ $ devtool modify <replaceable>recipe srctree</replaceable>
+ </literallayout>
+ As with all extractions, the command uses
+ the recipe's <filename>SRC_URI</filename> to locate the
+ source files.
+ Once the files are located, the command by default
+ extracts them.
+ Providing the <replaceable>srctree</replaceable>
+ argument instructs <filename>devtool</filename> where
+ place the extracted source.</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
+ provided with <replaceable>srctree</replaceable>.
+ </para></listitem>
+ <listitem><para><emphasis>Right</emphasis>:
+ The right scenario represents a situation
+ where the source tree
+ (<replaceable>srctree</replaceable>) exists as a
+ previously extracted Git structure outside of
+ the <filename>devtool</filename> workspace.
+ In this example, the recipe also exists
+ elsewhere 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 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</emphasis>:
+ Once you have updated the source files, you can build
+ the recipe.
+ </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, 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>Optionally Create Patch Files for Your Changes</emphasis>:
+ After you have debugged your changes, you can
+ use <filename>devtool update-recipe</filename> to
+ generate patch files for all the commits you have
+ made.
+ <note>
+ Patch files are generated only for changes
+ you have committed.
+ </note>
+ <literallayout class='monospaced'>
+ $ devtool update-recipe <replaceable>recipe</replaceable>
+ </literallayout>
+ By default, the
+ <filename>devtool update-recipe</filename> command
+ creates the patch files in a folder named the same
+ as the recipe beneath the folder in which the recipe
+ resides, and updates the recipe's
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ statement to point to the generated patch files.
+ <note>
+ You can use the
+ "--append <replaceable>LAYERDIR</replaceable>"
+ option to cause the command to create append files
+ in a specific layer rather than the default
+ recipe layer.
+ </note>
+ </para></listitem>
+ <listitem><para><emphasis>Restore the Workspace</emphasis>:
+ The <filename>devtool reset</filename> restores the
+ state so that standard layers and upstream sources are
+ used to build the recipe rather than what is in the
+ workspace.
+ <literallayout class='monospaced'>
+ $ devtool reset <replaceable>recipe</replaceable>
+ </literallayout>
+ </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 with which you provide it.
+ 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 through
+ <filename>npm</filename>
+ </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 you can build the recipe.
+ Once the recipe can be built, 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> attempts to determine
+ the name and version of the software being built from
+ various metadata within the source tree.
+ Furthermore, the command sets the name of the created recipe
+ file accordingly.
+ If the name or version cannot be determined, the
+ <filename>devtool add</filename> command prints an error and
+ you must re-run the command with both the name and version
+ or just the name or version specified.
+ </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 in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPENDS'><filename>DEPENDS</filename></ulink>
+ value within the recipe.
+ If a dependency cannot be mapped, then a comment is placed in
+ the recipe indicating such.
+ The inability to map a dependency might be caused because the
+ naming is not 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 to satisfy the dependency and then come
+ back to the first recipe and add its name to
+ <filename>DEPENDS</filename>.
+ </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} += "dependency1 dependency2 ..."
+ </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 for an option to disable 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 and sets the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LICENSE'><filename>LICENSE</filename></ulink>
+ value accordingly.
+ You should double-check this value against the documentation
+ or source files for the software you are building and update
+ that <filename>LICENSE</filename> value if necessary.
+ </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.
+ However, license statements often appear in comments at the top
+ of source files or within documentation.
+ 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, the
+ <filename>LICENSE</filename> value is set to "CLOSED" and the
+ <filename>LIC_FILES_CHKSUM</filename> vaule remains unset.
+ This behavior allows you to continue with development but is
+ unlikely to be correct in all cases.
+ Consequently, 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 <filename>make</filename> 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
+ <filename>CC</filename> 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 some 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 <filename>make</filename> 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 you will see a list of
+ environment variables 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.
+ In this situation, 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>
+ within the recipe as follows:
+ <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 by virtue of
+ being 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.
+ </para></listitem>
+ <listitem><para>
+ Sometimes a Makefile runs target-specific commands such
+ as <filename>ldconfig</filename>.
+ For such cases, you might be able to simply 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
+ build host system as opposed to the target.
+ You should indicate this 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 in the
+ following form to add Node.js modules:
+ <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 in order to provide Node.js
+ itself.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para>
+ </section>
+</section>
+
+<section id='sdk-working-with-recipes'>
+ <title>Working With Recipes</title>
+
+ <para>
+ When building a recipe with <filename>devtool build</filename> the
+ typical build progression is 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>
+ Compiling 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, usually with a
+ "do_" prefix.
+ 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, leaving the recipe
+ to describe just the things that are specific to the software to be
+ built.
+ A <ulink url='ref-classes-base'><filename>base</filename></ulink>
+ class exists that is implicitly inherited by all recipes and provides
+ the functionality that most typical recipes 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>
+ When you are debugging a recipe that you previously created using
+ <filename>devtool add</filename> or whose source you are modifying
+ by using the <filename>devtool modify</filename> command, after
+ the first run of <filename>devtool build</filename>, you will
+ find some symbolic links created within the source tree:
+ <filename>oe-logs</filename>, which points to the directory in
+ which log files and run scripts for each build step are created
+ and <filename>oe-workdir</filename>, which points to the temporary
+ work area for the recipe.
+ You can use these links to get more information on what is
+ happening at each build step.
+ </para>
+
+ <para>
+ These locations under <filename>oe-workdir</filename> are
+ particularly useful:
+ <itemizedlist>
+ <listitem><para><filename>image/</filename>:
+ Contains all of the files installed at 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>
+ </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>
+ set within the recipe.
+ If you wish to pass additional options, add them to
+ <filename>EXTRA_OECONF</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> 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>.
+ 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 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 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 go 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 several other packages.
+ This separation is done because not all of those installed files
+ are always 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 that has optional modules or
+ plugins might do 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,
+ 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 is named the
+ same 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> 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 at once thus restoring the target device back 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> command do not
+ currently interact with any package management system on the
+ target device (e.g. RPM or OPKG).
+ Consequently, you should not intermingle operations
+ <filename>devtool deploy-target</filename> and the 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>
+ The extensible SDK typically only comes with a small number of tools
+ and libraries out of the box.
+ If you have a minimal SDK, then it starts mostly empty and is
+ populated on-demand.
+ However, sometimes you will need to 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 it.
+ 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> 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 it 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 for sending to a third party (e.g., if you are a vendor with
+ customers needing to build their own software for the target platform).
+ If that is the case, then you can produce a derivative SDK based on
+ the currently installed SDK fairly easily.
+ Use 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 above procedure takes the recipes added to the workspace and
+ constructs a new SDK installer containing those recipes and the
+ resulting binary artifacts.
+ The recipes go into their own separate layer in the constructed
+ derivative SDK, leaving the workspace clean and ready for users
+ to add their own recipes.
+ </para>
+</section>
+
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/import-layers/yocto-poky/documentation/sdk-manual/sdk-intro.xml b/import-layers/yocto-poky/documentation/sdk-manual/sdk-intro.xml
new file mode 100644
index 000000000..88ae77831
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/sdk-manual/sdk-intro.xml
@@ -0,0 +1,338 @@
+<!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 Software Development Kit (SDK)
+ Developer's Guide.
+ This manual provides information that lets you use both the standard
+ Yocto Project SDK and an extensible SDK to develop applications and
+ images using the Yocto Project.
+ 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.
+ </para>
+
+ <para>
+ 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 more traditional SDK and extensible
+ SDK.
+ </para>
+
+ <para>
+ A standard SDK consists of a cross-development toolchain that contains
+ a compiler, debugger, and various miscellaneous tools; libraries,
+ headers, and symbols to match an image; and environment setup script.
+ You can use this SDK to independently develop and test code that is
+ destined to run on some target machine.
+ </para>
+
+ <para>
+ An extensible SDK consists of everything that the standard SDK has plus
+ 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_DEV_URL;#build-system-term'>OpenEmbedded build system</ulink>.
+ </para>
+
+ <para>
+ 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-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>
+ Going beyond the actual SDK, the SDK development environment consists
+ of the following:
+ <itemizedlist>
+ <listitem><para>An architecture-specific cross-toolchain and
+ matching sysroots (target and native) all built by the
+ OpenEmbedded build system.
+ The toolchain and sysroots 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 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 and SDK.
+ </para></listitem>
+ <listitem><para>The Eclipse IDE Yocto Plug-in.
+ This plug-in is also 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 user-space tools that greatly enhance
+ your application 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>
+
+ <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 by running 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>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 ways:
+ <itemizedlist>
+ <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='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
+ "<link link='sdk-developing-applications-using-eclipse'>Developing Applications Using <trademark class='trade'>Eclipse</trademark></link>"
+ section.
+ </para>
+ </section>
+
+ <section id='user-space-tools'>
+ <title>User-Space Tools</title>
+
+ <para>
+ User-space tools are available as part of the SDK development
+ process and can be helpful.
+ The tools include LatencyTOP, PowerTOP, 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>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>
+</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
+ 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 url='sdk-installing-the-sdk'>Installing the SDK</link>"
+ section.</para></listitem>
+ <listitem><para><emphasis>Download 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 kernel, root filesystem, and any other files you
+ need for your process.
+ <note>In order to use the root filesystem in QEMU, you
+ need to extract it.
+ See the
+ "<link url='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.
+ You can see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#dev-manual-qemu'>Using the Quick EMUlator (QEMU)</ulink>"
+ chapter in the Yocto Project Development Manual
+ for information on using QEMU within the Yocto
+ Project.</para></listitem>
+ </orderedlist>
+ </para>
+
+ <para>
+ The remainder of this manual describes how to use both the standard
+ SDK and the extensible SDK.
+ 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/import-layers/yocto-poky/documentation/sdk-manual/sdk-manual-customization.xsl b/import-layers/yocto-poky/documentation/sdk-manual/sdk-manual-customization.xsl
new file mode 100644
index 000000000..dae992c07
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/sdk-manual/sdk-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="'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/import-layers/yocto-poky/documentation/sdk-manual/sdk-manual-eclipse-customization.xsl b/import-layers/yocto-poky/documentation/sdk-manual/sdk-manual-eclipse-customization.xsl
new file mode 100644
index 000000000..03555d6ca
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/sdk-manual/sdk-manual-eclipse-customization.xsl
@@ -0,0 +1,37 @@
+<?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/import-layers/yocto-poky/documentation/sdk-manual/sdk-manual.xml b/import-layers/yocto-poky/documentation/sdk-manual/sdk-manual.xml
new file mode 100644
index 000000000..c860782fb
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/sdk-manual/sdk-manual.xml
@@ -0,0 +1,80 @@
+<!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 Software Development Kit (SDK) Developer's Guide
+ </title>
+
+ <authorgroup>
+ <author>
+ <firstname>Scott</firstname> <surname>Rifenbark</surname>
+ <affiliation>
+ <orgname>Scotty's Documentation Services, LLC</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>
+ </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_SDK_URL;'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>
+ from the Yocto Project website.
+ </note>
+
+ </legalnotice>
+
+ </bookinfo>
+
+ <xi:include href="sdk-intro.xml"/>
+
+ <xi:include href="sdk-using.xml"/>
+
+ <xi:include href="sdk-extensible.xml"/>
+
+ <xi:include href="sdk-appendix-obtain.xml"/>
+
+ <xi:include href="sdk-appendix-customizing.xml"/>
+
+<!-- <index id='index'>
+ <title>Index</title>
+ </index>
+-->
+
+</book>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/import-layers/yocto-poky/documentation/sdk-manual/sdk-style.css b/import-layers/yocto-poky/documentation/sdk-manual/sdk-style.css
new file mode 100644
index 000000000..52518964c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/sdk-manual/sdk-using.xml b/import-layers/yocto-poky/documentation/sdk-manual/sdk-using.xml
new file mode 100644
index 000000000..1ea47d3bb
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/sdk-manual/sdk-using.xml
@@ -0,0 +1,1466 @@
+<!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 use it.
+ Information covers the pieces of the SDK, how to install it, and presents
+ several task-based procedures common for developing with a standard SDK.
+ <note>
+ The tasks you can perform using a standard SDK are also applicable
+ when you are using an extensible SDK.
+ For information on the differences when using an extensible SDK as
+ compared to an extensible SDK, see the
+ "<link linkend='sdk-extensible'>Using the Extensible SDK</link>"
+ chapter.
+ </note>
+</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.
+ </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 host
+ development machine 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 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.
+ <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.
+
+ <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>
+ 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> and
+ using the current &DISTRO; snapshot:
+ <literallayout class='monospaced'>
+ poky-glibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh
+ </literallayout>
+ </para>
+
+ <para>
+ The SDK and toolchains are self-contained and by default are installed
+ into <filename>/opt/poky</filename>.
+ However, when you run the SDK installer, you can choose an
+ installation directory.
+ <note>
+ You must change the permissions on the toolchain
+ installer script so that it is executable:
+ <literallayout class='monospaced'>
+ $ chmod +x poky-glibc-x86_64-core-image-sato-i586-toolchain-2.1.sh
+ </literallayout>
+ </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>.
+ <note>
+ If you do not have write permissions for the directory
+ into which you are installing the SDK, the installer
+ notifies you and exits.
+ Be sure you have write permissions in the directory and
+ run the installer again.
+ </note>
+ <literallayout class='monospaced'>
+ $ ./poky-glibc-x86_64-core-image-sato-i586-toolchain-2.1.sh
+ Poky (Yocto Project Reference Distro) SDK installer version 2.0
+ ===============================================================
+ Enter target directory for SDK (default: /opt/poky/2.1):
+ You are about to install the SDK to "/opt/poky/2.1". 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/2.1/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 it.
+ This setup script resides in the directory you chose when you installed
+ the SDK.
+ For information on where this setup script can reside, see the
+ "<link linkend='sdk-appendix-obtain'>Obtaining the SDK</link>"
+ Appendix.
+ </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.
+ For example, the command to source a setup script for an IA-based
+ target machine using i586 tuning and located in the default SDK
+ installation directory is as follows:
+ <literallayout class='monospaced'>
+ $ source /opt/poky/&DISTRO;/environment-setup-i586-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='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 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".
+ Here is an example that 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>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='sdk-running-the-sdk-environment-setup-script'>Running the SDK Environment Setup Script</link>"
+ section.
+ </note>
+ </para>
+</section>
+
+<section id='sdk-developing-applications-using-eclipse'>
+ <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 section 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 application
+ development general workflow that employs both the SDK Eclipse.
+ </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
+ "<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 QEMU
+ emulator.</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_DEV_URL;#patching-the-kernel'>Patching the Kernel</ulink>"
+ section in the Yocto Project Development
+ manual for an example.</para></listitem>
+ </itemizedlist></para>
+ <para>For information on pre-built kernel image naming schemes for images
+ that can run on the QEMU emulator, see the
+ <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-manual'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>.
+ </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.
+ </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.
+ If you are not using Eclipse, you need to use the cross-development tools you have
+ installed to create the image.</para></listitem>
+ <listitem><para><emphasis>Deploy the image with the application</emphasis>:
+ If you are using the Eclipse IDE, you can deploy your image to the hardware or to
+ QEMU through the project's preferences.
+ If you are not using the Eclipse IDE, then you need to deploy the application
+ to the hardware using other methods.
+ Or, if you are using QEMU, you need to use that tool and
+ load your image in for testing.
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#dev-manual-qemu'>Using the Quick EMUlator (QEMU)</ulink>"
+ chapter in the Yocto Project Development 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 the
+ set of installed user-space tools to debug your application.
+ Of course, the same user-space tools are available separately if you choose
+ not to use the Eclipse IDE.</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.
+ <note>
+ This release of the Yocto Project supports both the Luna
+ and Kepler versions of the Eclipse IDE.
+ Thus, the following information provides setup information for
+ both versions.
+ </note>
+ </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 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>
+ This section describes how to install and configure the Eclipse IDE
+ Yocto Plug-in and how to use it to develop your application.
+ </para>
+
+ <section id='setting-up-the-eclipse-ide'>
+ <title>Setting Up the Eclipse IDE</title>
+
+ <para>
+ To develop within the Eclipse IDE, you need to do the following:
+ <orderedlist>
+ <listitem><para>Install the optimal 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='installing-eclipse-ide'>
+ <title>Installing the Eclipse IDE</title>
+
+ <para>
+ It is recommended that you have the Luna SR2 (4.4.2)
+ version of the Eclipse IDE installed on your development
+ system.
+ However, if you currently have the Kepler 4.3.2 version
+ installed and you do not want to upgrade the IDE, you can
+ configure Kepler to work with the Yocto Project.
+ </para>
+
+ <para>
+ If you do not have the Luna SR2 (4.4.2) Eclipse IDE
+ installed, you can find the tarball at
+ <ulink url='&ECLIPSE_MAIN_URL;'></ulink>.
+ From that site, choose the appropriate download from the
+ "Eclipse IDE for C/C++ Developers".
+ This version contains the Eclipse Platform, the Java
+ Development Tools (JDT), and the Plug-in Development
+ Environment.
+ </para>
+
+ <para>
+ Once you have downloaded the tarball, extract it into a
+ clean directory.
+ For example, the following commands unpack and install the
+ downloaded Eclipse IDE tarball into a clean directory
+ using the default name <filename>eclipse</filename>:
+ <literallayout class='monospaced'>
+ $ cd ~
+ $ tar -xzvf ~/Downloads/eclipse-cpp-luna-SR2-linux-gtk-x86_64.tar.gz
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='configuring-the-eclipse-ide'>
+ <title>Configuring the Eclipse IDE</title>
+
+ <para>
+ This section presents the steps needed to configure the
+ Eclipse IDE.
+ </para>
+
+ <para>
+ Before installing and configuring the Eclipse Yocto Plug-in,
+ you need to configure the Eclipse IDE.
+ Follow these general steps:
+ <orderedlist>
+ <listitem><para>Start the Eclipse IDE.</para></listitem>
+ <listitem><para>Make sure you are in your Workbench and
+ select "Install New Software" from the "Help"
+ pull-down menu.</para></listitem>
+ <listitem><para>Select
+ <filename>Luna - &ECLIPSE_LUNA_URL;</filename>
+ from the "Work with:" pull-down menu.
+ <note>
+ For Kepler, select
+ <filename>Kepler - &ECLIPSE_KEPLER_URL;</filename>
+ </note>
+ </para></listitem>
+ <listitem><para>Expand the box next to "Linux Tools"
+ and select the
+ <filename>Linux Tools LTTng Tracer Control</filename>,
+ <filename>Linux Tools LTTng Userspace Analysis</filename>,
+ and
+ <filename>LTTng Kernel Analysis</filename> boxes.
+ If these selections do not appear in the list,
+ that means the items are already installed.
+ <note>
+ For Kepler, select
+ <filename>LTTng - Linux Tracing Toolkit</filename>
+ box.
+ </note>
+ </para></listitem>
+ <listitem><para>Expand the box next to "Mobile and
+ Device Development" and select the following boxes.
+ Again, if any of the following items are not
+ available for selection, that means the items are
+ already installed:
+ <itemizedlist>
+ <listitem><para><filename>C/C++ Remote Launch (Requires RSE Remote System Explorer)</filename></para></listitem>
+ <listitem><para><filename>Remote System Explorer End-user Runtime</filename></para></listitem>
+ <listitem><para><filename>Remote System Explorer User Actions</filename></para></listitem>
+ <listitem><para><filename>Target Management Terminal (Core SDK)</filename></para></listitem>
+ <listitem><para><filename>TCF Remote System Explorer add-in</filename></para></listitem>
+ <listitem><para><filename>TCF Target Explorer</filename></para></listitem>
+ </itemizedlist></para></listitem>
+ <listitem><para>Expand the box next to "Programming
+ Languages" and select the
+ <filename>C/C++ Autotools Support</filename>
+ and <filename>C/C++ Development Tools</filename>
+ boxes.
+ For Luna, these items do not appear on the list
+ as they are already installed.
+ </para></listitem>
+ <listitem><para>Complete the installation and restart
+ the Eclipse IDE.</para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='installing-the-eclipse-yocto-plug-in'>
+ <title>Installing or Accessing the 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='new-software'>
+ <title>Installing the Pre-built Plug-in from the Yocto Project Eclipse Update Site</title>
+
+ <para>
+ To install the 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;/luna</filename>
+ in the URL field and provide a meaningful name
+ in the "Name" field.
+ <note>
+ If you are using Kepler, use
+ <filename>&ECLIPSE_DL_PLUGIN_URL;/kepler</filename>
+ in the URL field.
+ </note></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
+ <filename>Yocto Project ADT Plug-in</filename>,
+ <filename>Yocto Project Bitbake Commander Plug-in</filename>,
+ and
+ <filename>Yocto Project Documentation plug-in</filename>.
+ </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='zip-file-method'>
+ <title>Installing the Plug-in Using the Latest Source Code</title>
+
+ <para>
+ To install the Eclipse Yocto Plug-in from the latest
+ source code, follow these steps:
+ <orderedlist>
+ <listitem><para>Be sure your development system
+ is not using OpenJDK to build the plug-in
+ by doing the following:
+ <orderedlist>
+ <listitem><para>Use the Oracle JDK.
+ If you don't have that, go to
+ <ulink url='http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html'></ulink>
+ and download the latest appropriate
+ Java SE Development Kit tarball for
+ your development system and
+ extract it into your home directory.
+ </para></listitem>
+ <listitem><para>In the shell you are going
+ to do your work, export the location of
+ the Oracle Java.
+ The previous step creates a new folder
+ for the extracted software.
+ You need to use the following
+ <filename>export</filename> command
+ and provide the specific location:
+ <literallayout class='monospaced'>
+ export PATH=~/<replaceable>extracted_jdk_location</replaceable>/bin:$PATH
+ </literallayout>
+ </para></listitem>
+ </orderedlist>
+ </para></listitem>
+ <listitem><para>In the same shell, create a Git
+ repository with:
+ <literallayout class='monospaced'>
+ $ cd ~
+ $ git clone git://git.yoctoproject.org/eclipse-poky
+ </literallayout>
+ </para></listitem>
+ <listitem><para>Be sure to checkout the correct
+ tag.
+ For example, if you are using Luna, do the
+ following:
+ <literallayout class='monospaced'>
+ $ git checkout luna/yocto-&DISTRO;
+ </literallayout>
+ This puts you in a detached HEAD state, which
+ is fine since you are only going to be building
+ and not developing.
+ <note>
+ If you are building kepler, checkout the
+ <filename>kepler/yocto-&DISTRO;</filename>
+ branch.
+ </note>
+ </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>
+ </para></listitem>
+ <listitem><para>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.
+ Here is an example that uses the
+ <filename>luna/yocto-&DISTRO;</filename> tag, the
+ <filename>master</filename> documentation
+ branch, and
+ <filename>&DISTRO_NAME_NO_CAP;</filename> for the
+ release name:
+ <literallayout class='monospaced'>
+ $ ECLIPSE_HOME=/home/scottrif/eclipse-poky/scripts/eclipse ./build.sh luna/yocto-&DISTRO; master &DISTRO_NAME_NO_CAP; 2>&amp;1 | tee -a build.log
+ </literallayout>
+ 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 in step eight.
+ 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
+ <filename>Yocto Project ADT Plug-in</filename>,
+ <filename>Yocto Project Bitbake Commander Plug-in</filename>,
+ and the
+ <filename>Yocto Project Documentation plug-in</filename>.
+ </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='configuring-the-eclipse-yocto-plug-in'>Configuring the Eclipse Yocto Plug-in</link>"
+ section.</para>
+ </section>
+ </section>
+
+ <section id='configuring-the-eclipse-yocto-plug-in'>
+ <title>Configuring the Eclipse Yocto Plug-in</title>
+
+ <para>
+ Configuring the 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 ADT" to display
+ the configuration screen.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <section id='configuring-the-cross-compiler-options'>
+ <title>Configuring the Cross-Compiler Options</title>
+
+ <para>
+ To configure the Cross Compiler 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 mode 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.</para></listitem>
+ <listitem><para><emphasis>
+ <filename>Build System Derived Toolchain:</filename></emphasis>
+ Select this mode if the
+ cross-toolchain has been installed
+ and built as part of the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
+ When you select
+ <filename>Build system derived toolchain</filename>,
+ you are using the toolchain bundled
+ inside the Build Directory.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para><emphasis>Point to the Toolchain:</emphasis>
+ If you are using a stand-alone pre-built
+ toolchain, you should be pointing to where it is
+ installed.
+ 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 system-derived
+ toolchain, the path you provide for the
+ <filename>Toolchain Root Location</filename>
+ field is the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
+ See the
+ "<link linkend='sdk-building-an-sdk-installer'>Building an SDK Installer</link>"
+ section.</para></listitem>
+ <listitem><para><emphasis>Specify the Sysroot Location:</emphasis>
+ This location is where the root filesystem for
+ the target hardware resides.
+ </para>
+ <para>The location of
+ the sysroot filesystem depends on where you
+ separately extracted and installed the
+ filesystem.</para>
+ <para>For 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_QS_URL;#qs-building-images'>Building Images</ulink>"
+ section of the Yocto Project Quick Start for
+ more information.</para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='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
+ <filename>Build system derived toolchain</filename>,
+ the target kernel you built will be located in
+ the Build Directory in
+ <filename>tmp/deploy/images/<replaceable>machine</replaceable></filename>
+ directory.
+ If you selected
+ <filename>Standalone pre-built toolchain</filename>,
+ 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 "OK" to save your plug-in configurations.
+ </para>
+ </section>
+ </section>
+ </section>
+
+ <section id='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 "Project" from the "File -> New" menu.
+ </para></listitem>
+ <listitem><para>Double click <filename>CC++</filename>.
+ </para></listitem>
+ <listitem><para>Double click <filename>C Project</filename>
+ to create the project.</para></listitem>
+ <listitem><para>Expand <filename>Yocto Project ADT Autotools Project</filename>.
+ </para></listitem>
+ <listitem><para>Select <filename>Hello World ANSI C Autotools Project</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.
+ </para></listitem>
+ <listitem><para>Click "Next".</para></listitem>
+ <listitem><para>Add information in the
+ <filename>Author</filename> and
+ <filename>Copyright notice</filename> fields.
+ </para></listitem>
+ <listitem><para>Be sure the <filename>License</filename>
+ field is correct.</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='configuring-the-cross-toolchains'>
+ <title>Configuring the Cross-Toolchains</title>
+
+ <para>
+ The earlier section,
+ "<link linkend='configuring-the-eclipse-yocto-plug-in'>Configuring the 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 "Change Yocto Project Settings" from
+ the "Project" 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='configuring-the-eclipse-yocto-plug-in'>Configuring the 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 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='building-the-project'>
+ <title>Building the Project</title>
+
+ <para>
+ To build the project select "Build Project" from the
+ "Project" menu.
+ The console should update and you can note the cross-compiler
+ you are using.
+ <note>
+ When building "Yocto Project ADT 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='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 Manual
+ for more information on using QEMU.
+ </note>
+ <orderedlist>
+ <listitem><para>Expose and select "External Tools" from
+ the "Run" menu.
+ Your image should appear as a selectable menu item.
+ </para></listitem>
+ <listitem><para>Select your image from the menu to launch
+ the emulator in a new window.
+ </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.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='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 user_name@remote_host_ip
+ </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>
+ </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>Enter the absolute path into which you want
+ to deploy the application.
+ Use the "Remote Absolute File Path for
+ C/C++Application:" field.
+ For example, enter
+ <filename>/usr/bin/<replaceable>programname</replaceable></filename>.
+ </para></listitem>
+ <listitem><para>Click on the "Debugger" tab to see the
+ cross-tool debugger you are using.</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>TCF</filename>, which means
+ Target Communication Framework.</para></listitem>
+ <listitem><para>Click "Next".</para></listitem>
+ <listitem><para>Clear out the "host name" field and enter
+ the IP Address determined earlier.</para></listitem>
+ <listitem><para>Click "Finish" to close the
+ New Connections Dialog.</para></listitem>
+ <listitem><para>Use the drop-down menu now in the
+ "Connection" field and pick the IP Address you entered.
+ </para></listitem>
+ <listitem><para>Click "Debug" to bring up a login screen
+ and login.</para></listitem>
+ <listitem><para>Accept the debug perspective.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='running-user-space-tools'>
+ <title>Running User-Space Tools</title>
+
+ <para>
+ As mentioned earlier in the manual, several tools exist that
+ enhance your development experience.
+ These tools are aids in developing and debugging applications
+ and images.
+ You can run these user-space tools from within the Eclipse
+ IDE through the "YoctoProjectTools" menu.
+ </para>
+
+ <para>
+ Once you pick a tool, you need to configure it for the remote
+ target.
+ Every tool needs to have the connection configured.
+ You must select an existing TCF-based RSE connection to the
+ remote target.
+ If one does not exist, click "New" to create one.
+ </para>
+
+ <para>
+ Here are some specifics about the remote tools:
+ <itemizedlist>
+ <listitem><para><emphasis><filename>Lttng2.0 trace import</filename>:</emphasis>
+ Selecting this tool transfers the remote target's
+ <filename>Lttng</filename> tracing data back to the
+ local host machine and uses the Lttng Eclipse plug-in
+ to graphically display the output.
+ For information on how to use Lttng to trace an
+ application,
+ see <ulink url='http://lttng.org/documentation'></ulink>
+ and the
+ "<ulink url='&YOCTO_DOCS_PROF_URL;#lttng-linux-trace-toolkit-next-generation'>LTTng (Linux Trace Toolkit, next generation)</ulink>"
+ section, which is in the Yocto Project Profiling and
+ Tracing Manual.
+ <note>Do not use
+ <filename>Lttng-user space (legacy)</filename> tool.
+ This tool no longer has any upstream support.</note>
+ </para>
+ <para>Before you use the
+ <filename>Lttng2.0 trace import</filename> tool,
+ you need to setup the Lttng Eclipse plug-in and create a
+ Tracing project.
+ Do the following:
+ <orderedlist>
+ <listitem><para>Select "Open Perspective" from the
+ "Window" menu and then select "Other..." to
+ bring up a menu of other perspectives.
+ Choose "Tracing".
+ </para></listitem>
+ <listitem><para>Click "OK" to change the Eclipse
+ perspective into the Tracing perspective.
+ </para></listitem>
+ <listitem><para>Create a new Tracing project by
+ selecting "Project" from the "File -> New" menu.
+ </para></listitem>
+ <listitem><para>Choose "Tracing Project" from the
+ "Tracing" menu and click "Next".
+ </para></listitem>
+ <listitem><para>Provide a name for your tracing
+ project and click "Finish".
+ </para></listitem>
+ <listitem><para>Generate your tracing data on the
+ remote target.</para></listitem>
+ <listitem><para>Select "Lttng2.0 trace import"
+ from the "Yocto Project Tools" menu to
+ start the data import process.</para></listitem>
+ <listitem><para>Specify your remote connection name.
+ </para></listitem>
+ <listitem><para>For the Ust directory path, specify
+ the location of your remote tracing data.
+ Make sure the location ends with
+ <filename>ust</filename> (e.g.
+ <filename>/usr/mysession/ust</filename>).
+ </para></listitem>
+ <listitem><para>Click "OK" to complete the import
+ process.
+ The data is now in the local tracing project
+ you created.</para></listitem>
+ <listitem><para>Right click on the data and then use
+ the menu to Select "Generic CTF Trace" from the
+ "Trace Type... -> Common Trace Format" menu to
+ map the tracing type.</para></listitem>
+ <listitem><para>Right click the mouse and select
+ "Open" to bring up the Eclipse Lttng Trace
+ Viewer so you view the tracing data.
+ </para></listitem>
+ </orderedlist></para></listitem>
+ <listitem><para><emphasis><filename>PowerTOP</filename>:</emphasis>
+ Selecting this tool runs PowerTOP on the remote target
+ machine and displays the results in a new view called
+ PowerTOP.</para>
+ <para>The "Time to gather data(sec):" field is the time
+ passed in seconds before data is gathered from the
+ remote target for analysis.</para>
+ <para>The "show pids in wakeups list:" field corresponds
+ to the <filename>-p</filename> argument passed to
+ <filename>PowerTOP</filename>.</para></listitem>
+ <listitem><para><emphasis><filename>LatencyTOP and Perf</filename>:</emphasis>
+ LatencyTOP identifies system latency, while
+ Perf monitors the system's performance counter
+ registers.
+ Selecting either of these tools causes an RSE terminal
+ view to appear from which you can run the tools.
+ Both tools refresh the entire screen to display results
+ while they run.
+ For more information on setting up and using
+ <filename>perf</filename>, 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><filename>SystemTap</filename>:</emphasis>
+ Systemtap is a tool that lets you create and reuse
+ scripts to examine the activities of a live Linux
+ system.
+ You can easily extract, filter, and summarize data
+ that helps you diagnose complex performance or
+ functional problems.
+ For more information on setting up and using
+ <filename>SystemTap</filename>, see the
+ <ulink url='https://sourceware.org/systemtap/documentation.html'>SystemTap Documentation</ulink>.
+ </para></listitem>
+ <listitem><para><emphasis><filename>yocto-bsp</filename>:</emphasis>
+ The <filename>yocto-bsp</filename> tool lets you
+ quickly set up a Board Support Package (BSP) layer.
+ The tool requires a Metadata location, build location,
+ BSP name, BSP output location, and a kernel
+ architecture.
+ For more information on the
+ <filename>yocto-bsp</filename> tool outside of Eclipse,
+ see the
+ "<ulink url='&YOCTO_DOCS_BSP_URL;#creating-a-new-bsp-layer-using-the-yocto-bsp-script'>Creating a new BSP Layer Using the yocto-bsp Script</ulink>"
+ section in the Yocto Project Board Support Package
+ (BSP) Developer's Guide.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ </section>
+</section>
+
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/import-layers/yocto-poky/documentation/template/Vera.ttf b/import-layers/yocto-poky/documentation/template/Vera.ttf
new file mode 100644
index 000000000..58cd6b5e6
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/template/Vera.ttf
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/template/Vera.xml b/import-layers/yocto-poky/documentation/template/Vera.xml
new file mode 100644
index 000000000..3c82043e3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/template/VeraMoBd.ttf b/import-layers/yocto-poky/documentation/template/VeraMoBd.ttf
new file mode 100644
index 000000000..9be6547ed
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/template/VeraMoBd.ttf
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/template/VeraMoBd.xml b/import-layers/yocto-poky/documentation/template/VeraMoBd.xml
new file mode 100644
index 000000000..9b33107a4
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/template/VeraMono.ttf b/import-layers/yocto-poky/documentation/template/VeraMono.ttf
new file mode 100644
index 000000000..139f0b431
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/template/VeraMono.ttf
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/template/VeraMono.xml b/import-layers/yocto-poky/documentation/template/VeraMono.xml
new file mode 100644
index 000000000..3a0a86659
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/template/component.title.xsl b/import-layers/yocto-poky/documentation/template/component.title.xsl
new file mode 100644
index 000000000..ee21d59ad
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/template/division.title.xsl b/import-layers/yocto-poky/documentation/template/division.title.xsl
new file mode 100644
index 000000000..6c265970d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/template/draft.png b/import-layers/yocto-poky/documentation/template/draft.png
new file mode 100644
index 000000000..53051a9dd
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/template/draft.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/template/embedded_video.xsl b/import-layers/yocto-poky/documentation/template/embedded_video.xsl
new file mode 100644
index 000000000..dfb33c344
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/template/fop-config.xml b/import-layers/yocto-poky/documentation/template/fop-config.xml
new file mode 100644
index 000000000..09cc5ca0f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/template/formal.object.heading.xsl b/import-layers/yocto-poky/documentation/template/formal.object.heading.xsl
new file mode 100644
index 000000000..1a5e69780
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/template/gloss-permalinks.xsl b/import-layers/yocto-poky/documentation/template/gloss-permalinks.xsl
new file mode 100644
index 000000000..6bf58116f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/template/ohand-color.svg b/import-layers/yocto-poky/documentation/template/ohand-color.svg
new file mode 100644
index 000000000..e42ff9c6f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/template/permalinks.xsl b/import-layers/yocto-poky/documentation/template/permalinks.xsl
new file mode 100644
index 000000000..d2a1c1452
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/template/poky-db-pdf.xsl b/import-layers/yocto-poky/documentation/template/poky-db-pdf.xsl
new file mode 100644
index 000000000..f8a3df103
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/template/poky-ref-manual.png b/import-layers/yocto-poky/documentation/template/poky-ref-manual.png
new file mode 100644
index 000000000..2085edb46
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/template/poky-ref-manual.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/template/poky.svg b/import-layers/yocto-poky/documentation/template/poky.svg
new file mode 100644
index 000000000..a4ea5e2f4
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/template/qa-code-permalinks.xsl b/import-layers/yocto-poky/documentation/template/qa-code-permalinks.xsl
new file mode 100644
index 000000000..a309095c6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/template/section.title.xsl b/import-layers/yocto-poky/documentation/template/section.title.xsl
new file mode 100644
index 000000000..5c6ff9a96
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/template/titlepage.templates.xml b/import-layers/yocto-poky/documentation/template/titlepage.templates.xml
new file mode 100644
index 000000000..f53f14700
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/template/yocto-project-qs.png b/import-layers/yocto-poky/documentation/template/yocto-project-qs.png
new file mode 100644
index 000000000..333442e0d
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/template/yocto-project-qs.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/toaster-manual/figures/add-variable.png b/import-layers/yocto-poky/documentation/toaster-manual/figures/add-variable.png
new file mode 100644
index 000000000..6bdcca705
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/toaster-manual/figures/add-variable.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/toaster-manual/figures/bash-oecore.png b/import-layers/yocto-poky/documentation/toaster-manual/figures/bash-oecore.png
new file mode 100644
index 000000000..801a5d911
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/toaster-manual/figures/bash-oecore.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/toaster-manual/figures/compatible-layers.png b/import-layers/yocto-poky/documentation/toaster-manual/figures/compatible-layers.png
new file mode 100644
index 000000000..38436b075
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/toaster-manual/figures/compatible-layers.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/toaster-manual/figures/hosted-service.png b/import-layers/yocto-poky/documentation/toaster-manual/figures/hosted-service.png
new file mode 100644
index 000000000..01fea7b24
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/toaster-manual/figures/hosted-service.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/toaster-manual/figures/import-layer.png b/import-layers/yocto-poky/documentation/toaster-manual/figures/import-layer.png
new file mode 100644
index 000000000..436ec7af4
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/toaster-manual/figures/import-layer.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/toaster-manual/figures/new-project.png b/import-layers/yocto-poky/documentation/toaster-manual/figures/new-project.png
new file mode 100644
index 000000000..dbc50b991
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/toaster-manual/figures/new-project.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/toaster-manual/figures/set-variable.png b/import-layers/yocto-poky/documentation/toaster-manual/figures/set-variable.png
new file mode 100644
index 000000000..d36b52754
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/toaster-manual/figures/set-variable.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/toaster-manual/figures/simple-configuration.png b/import-layers/yocto-poky/documentation/toaster-manual/figures/simple-configuration.png
new file mode 100644
index 000000000..e8fce2bf1
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/toaster-manual/figures/simple-configuration.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/toaster-manual/figures/toaster-title.png b/import-layers/yocto-poky/documentation/toaster-manual/figures/toaster-title.png
new file mode 100644
index 000000000..b7ea39cd8
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/toaster-manual/figures/toaster-title.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/toaster-manual/figures/variable-added.png b/import-layers/yocto-poky/documentation/toaster-manual/figures/variable-added.png
new file mode 100644
index 000000000..518f25fa1
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/toaster-manual/figures/variable-added.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/toaster-manual/toaster-manual-customization.xsl b/import-layers/yocto-poky/documentation/toaster-manual/toaster-manual-customization.xsl
new file mode 100644
index 000000000..d78694ac1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/toaster-manual/toaster-manual-intro.xml b/import-layers/yocto-poky/documentation/toaster-manual/toaster-manual-intro.xml
new file mode 100644
index 000000000..ee1dcbaba
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/toaster-manual/toaster-manual-intro.xml
@@ -0,0 +1,157 @@
+<!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_DEV_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 Metadata 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>
+ </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/import-layers/yocto-poky/documentation/toaster-manual/toaster-manual-reference.xml b/import-layers/yocto-poky/documentation/toaster-manual/toaster-manual-reference.xml
new file mode 100644
index 000000000..3a46b61b7
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/toaster-manual/toaster-manual-reference.xml
@@ -0,0 +1,1052 @@
+<!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 Metadata 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_BSP_URL;#bsp-layers'>BSP Layers</ulink>"
+ and
+ "<ulink url='&YOCTO_DOCS_BSP_URL;#using-the-yocto-projects-bsp-tools'>Using the Yocto Project's BSP Tools</ulink>"
+ sections in the Yocto Project Board Support Package (BSP)
+ Developer's Guide.
+ </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='select-the-toasterconf-json-file'>
+ <title>Use the <filename>toasterconf.json</filename> File</title>
+
+ <para>
+ If you do not want to use the Administration
+ Interface, you can edit the
+ <link linkend='toaster-json-files'><filename>toasterconf.json</filename></link>
+ file and reload it to Toaster.
+ </para>
+
+ <para>
+ The Toaster startup script in
+ <filename>/bitbake/bin/toaster</filename> specifies
+ the location of a Toaster configuration file
+ <filename>toasterconf.json</filename> as the value of
+ the <filename>TOASTER_CONF</filename> variable.
+ This configuration file is used to set up the initial
+ configuration values within the Toaster database
+ including the layer sources.
+ Two versions of the configuration file exist:
+ <itemizedlist>
+ <listitem><para>
+ The first version of the file is found in the
+ <filename>conf</filename> directory of the
+ <filename>meta-poky</filename> layer
+ (i.e.
+ <filename>meta-poky/conf/toasterconf.json</filename>).
+ This version contains the default Yocto Project
+ configuration for Toaster.
+ </para></listitem>
+ <listitem><para>
+ The second version of the file is in the
+ <filename>conf</filename> directory of the
+ <filename>openembedded-core</filename> layer
+ (i.e. <filename>meta/conf/toasterconf.json</filename>).
+ This version contains the default OpenEmbedded
+ configuration for Toaster.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='edit-the-configuration-file'>
+ <title>Edit the Configuration File</title>
+
+ <para>
+ Edit the version of the
+ <filename>toasterconf.json</filename> file you
+ used to set up your Toaster instance.
+ In the file, you will find a section for layer sources
+ such as the following:
+ <literallayout class='monospaced'>
+ "layersources": [
+ {
+ "name": "Local Yocto Project",
+ "sourcetype": "local",
+ "apiurl": "../../",
+ "branches": ["HEAD" ],
+ "layers": [
+ {
+ "name": "openembedded-core",
+ "local_path": "meta",
+ "vcs_url": "remote:origin",
+ "dirpath": "meta"
+ },
+ {
+ "name": "meta-poky",
+ "local_path": "meta-poky",
+ "vcs_url": "remote:origin",
+ "dirpath": "meta-poky"
+ },
+ {
+ "name": "meta-yocto-bsp",
+ "local_path": "meta-yocto-bsp",
+ "vcs_url": "remote:origin",
+ "dirpath": "meta-yocto-bsp"
+ }
+
+ ]
+ },
+ {
+ "name": "OpenEmbedded",
+ "sourcetype": "layerindex",
+ "apiurl": "http://layers.openembedded.org/layerindex/api/",
+ "branches": ["master", "jethro" ,"fido"]
+ },
+ {
+ "name": "Imported layers",
+ "sourcetype": "imported",
+ "apiurl": "",
+ "branches": ["master", "jethro","fido", "HEAD"]
+
+ }
+ ],
+ </literallayout>
+ You should add your own layer source to this section by
+ following the same format used for the "OpenEmbedded"
+ layer source shown above.
+ </para>
+
+ <para>
+ Give your layer source a name, provide the URL of your
+ layer source API, use the source type "layerindex", and
+ indicate which branches from your layer source you want
+ to make available through Toaster.
+ For example, the OpenEmbedded layer source makes
+ available only its "master", "fido", and "jethro"
+ branches.
+ </para>
+
+ <para>
+ The branches must match the branch you
+ set when configuring your releases.
+ For example, if you configure one release in Toaster
+ by setting its branch to "branch-one" and you configure
+ another release in Toaster by setting its branch to
+ "branch-two", the branches in your layer source should
+ be "branch-one" and "branch-two" as well.
+ Doing so creates a connection between the releases
+ and the layer information from your layer source.
+ Thus, when users create a project with a given
+ release, they will see the appropriate layers from
+ your layer source.
+ This connection ensures that only layers that are
+ compatible with the selected project release can be
+ selected for building.
+ </para>
+
+ <para>
+ Once you have added this information to the
+ <filename>toasterconf.json</filename> file, save your
+ changes.
+ </para>
+
+ <para>
+ In a terminal window, navigate to the directory that
+ contains the Toaster database, which by default is the
+ root of the Yocto Project
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ Once you are located in that directory, run the
+ "<filename>loadconf</filename>" command, which takes as
+ an argument the full path to the
+ <filename>toasterconf.json</filename> file you just edited.
+ For example, if you cloned the
+ <filename>poky</filename> repository and you edited the
+ <filename>meta-poky/conf/toasterconf.json</filename> file,
+ you would type something like the following:
+ <literallayout class='monospaced'>
+ $ bitbake/lib/toaster/manage.py loadconf /home/scottrif/poky/meta-poky/conf/toasterconf.json
+ </literallayout>
+ After entering this command, you need to update the
+ Toaster database with the information coming from your
+ new layer source.
+ To do that, you should run the
+ "<filename>lsupdates</filename>" command from the directory
+ that contains the Toaster database.
+ Here is an example:
+ <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>
+
+ <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>
+ </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 2.0 "Jethro" or OpenEmbedded "Jethro":</emphasis>
+ This release causes your Toaster projects to
+ build against the head of the jethro branch at
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/log/?h=jethro'></ulink>
+ or
+ <ulink url='http://git.openembedded.org/openembedded-core/commit/?h=jethro'></ulink>.
+ </para></listitem>
+ <listitem><para><emphasis>Yocto Project 1.8 "Fido" or OpenEmbedded "Fido":</emphasis>
+ This release causes your Toaster projects to
+ build against the head of the fido branch at
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/log/?h=fido'></ulink>
+ or
+ <ulink url='http://git.openembedded.org/openembedded-core/commit/?h=fido'></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 id='toaster-releases-comprised-of'>
+ <title>What Makes Up a Release?</title>
+
+ <para>
+ A release consists of the following:
+ <itemizedlist>
+ <listitem><para><emphasis>Name:</emphasis>
+ The name of the release (<filename>name</filename>).
+ This release name never appears in the the Toaster
+ web interface.
+ Consequently, a user never sees the release name.
+ </para></listitem>
+ <listitem><para><emphasis>Description:</emphasis>
+ The textual description of the release
+ (<filename>description</filename>).
+ This description is what users encounter when creating
+ projects with the Toaster web interface.
+ When you configure your release, be sure to use
+ a description that sufficiently describes and is
+ understandable.
+ If Toaster has more than one release configured, the
+ release descriptions appear listed in a drop down menu
+ when a user creates a new project.
+ If Toaster has only one release configured, all
+ projects created using the web interface take that
+ release and the drop down menu does not display in the
+ Toaster web interface.
+ </para></listitem>
+ <listitem><para><emphasis>BitBake:</emphasis>
+ The Bitbake version (<filename>bitbake</filename>)
+ used to build layers set in the current release.
+ This version is described by a name, a Git URL, a
+ branch in the Git URL, and a directory path in the
+ Git repository.
+ As an example, consider the following snippet from
+ a Toaster JSON configuration file.
+ This BitBake version uses the master branch from the
+ OpenEmbedded repository:
+ <literallayout class='monospaced'>
+ "bitbake" : [
+ {
+ "name": "master",
+ "giturl": "git://git.openembedded.org/bitbake",
+ "branch": "master",
+ "dirpath": ""
+ }
+ ]
+ </literallayout>
+ Here is more detail on each of the items that comprise
+ the BitBake version:
+ <itemizedlist>
+ <listitem><para><emphasis>Name:</emphasis>
+ A string
+ (<filename>name</filename>) used to refer to
+ the version of BitBake you are using with
+ Toaster.
+ This name is never exposed through Toaster.
+ </para></listitem>
+ <listitem><para><emphasis>Git URL:</emphasis>
+ The URL (<filename>giturl</filename>)
+ for the BitBake Git repository cloned
+ for Toaster projects.
+ </para></listitem>
+ <listitem><para><emphasis>Branch:</emphasis>
+ The Git branch, or revision,
+ (<filename>branch</filename>) of the BitBake
+ repository used with Toaster.
+ </para></listitem>
+ <listitem><para><emphasis>Directory Path:</emphasis>
+ The sub-directory of the BitBake repository
+ (<filename>dirpath</filename>).
+ If the Git URL includes more than one
+ repository, you need to set this directory.
+ If the URL does not include more than a single
+ repository, you can set
+ <filename>dirpath</filename> to a null string
+ (i.e. "").
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para><emphasis>Branch:</emphasis>
+ The branch for the layer source
+ (<filename>branch</filename>) used with the release.
+ For example, for the OpenEmbedded layer source, the
+ "master", "fido", and "jethro" branches are available.
+ </para></listitem>
+ <listitem><para><emphasis>Default Layers:</emphasis>
+ The set of default layers
+ (<filename>defaultlayers</filename>) automatically
+ added to the project configuration when a project is
+ created.
+ </para></listitem>
+ <listitem><para><emphasis>Layer Source Priorities</emphasis>
+ A specification of
+ <link linkend='layer-source'>layer source</link>
+ priorities (<filename>layersourcepriority</filename>).
+ In order for Toaster to work as intended, the
+ "Imported layers" layer source should have the highest
+ priority, which means that layers manually imported by
+ users with the "Import layer" functionality will
+ always be visible and available for selection.
+ </para></listitem>
+ <listitem><para><emphasis>Help Text:</emphasis>
+ Help text (<filename>helptext</filename>) that explains
+ what the release does when selected.
+ This help text appears below the release drop-down
+ menu when you create a Toaster project.
+ The help text should assist users in making the correct
+ decision regarding the release to use for a given
+ project.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ To summarize what comprises a release, consider the following
+ example from a Toaster JSON file.
+ The configuration names the release "master" and uses the
+ "master" branch provided by the layer source of type
+ "layerindex", which is called "OpenEmbedded", and sets
+ the <filename>openembedded-core</filename> layer as the one
+ to be added by default to any projects created in Toaster.
+ The BitBake version used would be defined as shown earlier
+ in the previous list:
+ <literallayout class='monospaced'>
+ "releases": [
+ {
+ "name": "master",
+ "description": "OpenEmbedded master",
+ "bitbake": "master",
+ "branch": "master",
+ "defaultlayers": [ "openembedded-core" ],
+ "layersourcepriority": { "Imported layers": 99, "Local OpenEmbedded" : 10, "OpenEmbedded" : 0 },
+ "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;, where active development takes place. This is not a stable branch, so your builds might not work as expected."
+ }
+ ]
+ </literallayout>
+ </para>
+ </section>
+ </section>
+
+ <section id='toaster-json-files'>
+ <title>JSON Files</title>
+
+ <para>
+ You must configure Toaster before using it.
+ Configuration customizes layer source settings and Toaster defaults
+ for all users and is performed by the person responsible for
+ Toaster Configuration (i.e the Toaster Administrator).
+ The Toaster Administrator performs this configuration through the
+ Django administration interface.
+ </para>
+
+ <para>
+ To make it easier to initially start Toaster, you can import a
+ pre-defined configuration file using the
+ <link linkend='toaster-command-loadconf'><filename>loadconf</filename></link>
+ command.
+ <note>
+ The configuration file is a JSON-formatted text file with
+ specific fields that Toaster recognizes.
+ It is not a data dump from the database, so it cannot be
+ loaded directly in the database.
+ </note>
+ </para>
+
+ <para>
+ By convention, the supplied configuration files are named
+ <filename>toasterconf.json</filename>.
+ The Toaster Administrator can customize the file prior to loading
+ it into Toaster.
+ The <filename>TOASTER_CONF</filename> variable in the
+ Toaster startup script at <filename>bitbake/bin/toaster</filename>
+ specifies the location of the <filename>toasterconf.json</filename> file.
+ </para>
+
+ <section id='json-file-choices'>
+ <title>Configuration File Choices</title>
+
+ <para>
+ Two versions of the configuration file exist:
+ <itemizedlist>
+ <listitem><para>
+ The
+ <filename>meta-poky/conf/toasterconf.json</filename>
+ in the <filename>conf</filename> directory of the
+ Yocto Project's <filename>meta-poky</filename> layer.
+ This version contains the default Yocto Project
+ configuration for Toaster.
+ You are prompted to select this file during the Toaster
+ set up process if you cloned the
+ <filename>poky</filename> repository (i.e.
+ <filename>&YOCTO_GIT_URL;/poky</filename>).
+ </para></listitem>
+ <listitem><para>
+ The <filename>meta/conf/toasterconf.json</filename>
+ in the <filename>conf</filename> directory of the
+ OpenEmbedded's <filename>openembedded-core</filename>
+ layer.
+ This version contains the default OpenEmbedded
+ configuration for Toaster.
+ You are prompted to select this file during the Toaster
+ set up process if you had cloned the
+ <filename>openembedded-core</filename> repository (i.e.
+ <filename>git://git.openembedded.org/openembedded-core</filename>).
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='json-structure'>
+ <title>File Structure</title>
+
+ <para>
+ The <filename>toasterconf.json</filename> file consists of
+ easily readable areas: configuration, layer sources, BitBake,
+ default release, and releases.
+ </para>
+
+ <section id='json-config-area'>
+ <title>Configuration Area</title>
+
+ <para>
+ This area of the JSON file sets which variables are exposed
+ to users through the Toaster web interface.
+ Users can easily edit these variables.
+ </para>
+
+ <para>
+ The variables you set here are displayed in the
+ "Configuration variables" page in Toaster.
+ Minimally, you should set the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
+ variable, which appears to users as part of the project
+ page in Toaster.
+ </para>
+
+ <para>
+ Here is the default <filename>config</filename> area:
+ <literallayout class='monospaced'>
+ "config": {
+ "MACHINE" : "qemux86",
+ "DISTRO" : "poky",
+ "IMAGE_FSTYPES": "ext3 jffs2 tar.bz2",
+ "IMAGE_INSTALL_append": "",
+ "PACKAGE_CLASSES": "package_rpm",
+ },
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='json-layersources-area'>
+ <title>Layer Sources Area</title>
+
+ <para>
+ This area of the JSON file defines the
+ <link linkend='layer-source'>layer sources</link>
+ Toaster uses.
+ Toaster reads layer information from layer sources.
+ Three types of layer sources exist that Toaster
+ recognizes: Local, LayerIndex, and Imported.
+ </para>
+
+ <para>
+ The Local layer source reads layers from Git clones
+ available on your local drive.
+ Using a local layer source enables you to easily test
+ Toaster.
+ <note>
+ If you are setting up a hosted version of Toaster,
+ it does not make sense to have a local layer source.
+ </note>
+ </para>
+
+ <para>
+ The LayerIndex layer source uses a REST API exposed by
+ instances of the Layer Index application (e.g the public
+ <ulink url='http://layers.openembedded.org/'></ulink>)
+ to read layer data.
+ </para>
+
+ <para>
+ The Imported layer source is reserved for layer data
+ manually introduced by the user or Toaster Administrator
+ through the GUI.
+ This layer source lets users import their own layers
+ and build them with Toaster.
+ You should not remove the imported layer source.
+ </para>
+
+ <para>
+ Here is the default <filename>layersources</filename> area:
+ <literallayout class='monospaced'>
+ "layersources": [
+ {
+ "name": "Local Yocto Project",
+ "sourcetype": "local",
+ "apiurl": "../../",
+ "branches": ["HEAD" ],
+ "layers": [
+ {
+ "name": "openembedded-core",
+ "local_path": "meta",
+ "vcs_url": "remote:origin",
+ "dirpath": "meta"
+ },
+ {
+ "name": "meta-poky",
+ "local_path": "meta-poky",
+ "vcs_url": "remote:origin",
+ "dirpath": "meta-poky"
+ },
+ {
+ "name": "meta-yocto-bsp",
+ "local_path": "meta-yocto-bsp",
+ "vcs_url": "remote:origin",
+ "dirpath": "meta-yocto-bsp"
+ }
+
+ ]
+ },
+ {
+ "name": "OpenEmbedded",
+ "sourcetype": "layerindex",
+ "apiurl": "http://layers.openembedded.org/layerindex/api/",
+ "branches": ["master", "jethro" ,"fido"]
+ },
+ {
+ "name": "Imported layers",
+ "sourcetype": "imported",
+ "apiurl": "",
+ "branches": ["master", "jethro","fido", "HEAD"]
+
+ }
+ ],
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='json-bitbake-area'>
+ <title>BitBake Area</title>
+
+ <para>
+ This area of the JSON file defines the version of
+ BitBake Toaster uses.
+ As shipped, Toaster is configured to recognize four
+ versions of BitBake: master, fido, jethro, and HEAD.
+ <note>
+ HEAD is a special option that builds whatever is
+ available on disk, without checking out any remote
+ Git repositories.
+ </note>
+ </para>
+
+ <para>
+ Here is the default <filename>bitbake</filename> area:
+ <literallayout class='monospaced'>
+ "bitbake" : [
+ {
+ "name": "master",
+ "giturl": "remote:origin",
+ "branch": "master",
+ "dirpath": "bitbake"
+ },
+ {
+ "name": "jethro",
+ "giturl": "remote:origin",
+ "branch": "jethro",
+ "dirpath": "bitbake"
+ },
+ {
+ "name": "fido",
+ "giturl": "remote:origin",
+ "branch": "fido",
+ "dirpath": "bitbake"
+ },
+ {
+ "name": "HEAD",
+ "giturl": "remote:origin",
+ "branch": "HEAD",
+ "dirpath": "bitbake"
+ }
+ ],
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='json-default-area'>
+ <title>Default Area</title>
+
+ <para>
+ This area of the JSON file establishes a default
+ release used by Toaster.
+ As shipped, Toaster uses the "master" release.
+ </para>
+
+ <para>
+ Here is the statement in the JSON file that establishes
+ the default release:
+ <literallayout class='monospaced'>
+ "defaultrelease": "master",
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='json-releases-area'>
+ <title>Releases Area</title>
+
+ <para>
+ This area of the JSON file defines the versions of the
+ OpenEmbedded build system Toaster recognizes.
+ As shipped, Toaster is configured to work with the four
+ releases described in the
+ "<link linkend='toaster-releases-supported'>Pre-Configured Releases</link>"
+ section.
+ </para>
+
+ <para>
+ Here is the default <filename>releases</filename> area:
+ <literallayout class='monospaced'>
+ "releases": [
+ {
+ "name": "master",
+ "description": "Yocto Project master",
+ "bitbake": "master",
+ "branch": "master",
+ "defaultlayers": [ "openembedded-core", "meta-poky", "meta-yocto-bsp"],
+ "layersourcepriority": { "Imported layers": 99, "Local Yocto Project" : 10, "OpenEmbedded" : 0 },
+ "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;, where active development takes place. This is not a stable branch, so your builds might not work as expected."
+ },
+ {
+ "name": "jethro",
+ "description": "Yocto Project 2.0 Jethro",
+ "bitbake": "jethro",
+ "branch": "jethro",
+ "defaultlayers": [ "openembedded-core", "meta-poky", "meta-yocto-bsp"],
+ "layersourcepriority": { "Imported layers": 99, "Local Yocto Project" : 10, "OpenEmbedded" : 0 },
+ "helptext": "Toaster will run your builds with the tip of the &lt;a href=\"http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/?h=jethro\"&gt;Yocto Project 2.0 \"Jethro\"&lt;/a&gt; branch."
+ },
+ {
+ "name": "fido",
+ "description": "Yocto Project 1.8 Fido",
+ "bitbake": "fido",
+ "branch": "fido",
+ "defaultlayers": [ "openembedded-core", "meta-poky", "meta-yocto-bsp"],
+ "layersourcepriority": { "Imported layers": 99, "Local Yocto Project" : 10, "OpenEmbedded" : 0 },
+ "helptext": "Toaster will run your builds with the tip of the &lt;a href=\"http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/?h=fido\"&gt;Yocto Project 1.8 \"Fido\"&lt;/a&gt; branch."
+ },
+ {
+ "name": "local",
+ "description": "Local Yocto Project",
+ "bitbake": "HEAD",
+ "branch": "HEAD",
+ "defaultlayers": [ "openembedded-core", "meta-poky", "meta-yocto-bsp"],
+ "layersourcepriority": { "Imported layers": 99, "Local Yocto Project" : 10, "OpenEmbedded" : 0 },
+ "helptext": "Toaster will run your builds with the version of the Yocto Project you have cloned or downloaded to your computer."
+ }
+ ]
+ </literallayout>
+ </para>
+ </section>
+ </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_DEV_URL;#source-directory'>Source Directory</ulink>
+ (e.g. <filename>poky</filename>) at
+ <filename>bitbake/lib/manage.py</filename>.
+ This section documents those commands.
+ <note>
+ <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_DEV_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>
+
+ <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>
+ </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-loadconf'>
+ <title><filename>loadconf</filename></title>
+
+ <para>
+ The <filename>loadconf</filename> command loads an
+ existing Toaster configuration file (JSON file).
+ You must run this on a new database that does not have any
+ data.
+ Running this command on an existing database that has data
+ results in errors.
+ Access the command as follows:
+ <literallayout class='monospaced'>
+ $ bitbake/lib/toaster/manage.py loadconf <replaceable>filepath</replaceable>
+ </literallayout>
+ The <filename>loadconf</filename> command configures a database
+ based on the supplied existing
+ <filename>toasterconf.json</filename> file.
+ For information on the <filename>toasterconf.json</filename>,
+ see the
+ "<link linkend='toaster-json-files'>JSON Files</link>"
+ section.
+ </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/import-layers/yocto-poky/documentation/toaster-manual/toaster-manual-setup-and-use.xml b/import-layers/yocto-poky/documentation/toaster-manual/toaster-manual-setup-and-use.xml
new file mode 100644
index 000000000..963b21122
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/toaster-manual/toaster-manual-setup-and-use.xml
@@ -0,0 +1,677 @@
+<!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
+ "<link linkend='toaster-manual-start'>Preparing to Use Toaster</link>",
+ you are ready to start Toaster.
+ </para>
+
+ <para>
+ Navigate to the root of your
+ <ulink url='&YOCTO_DOCS_DEV_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 ../bitbake/bin/toaster
+ </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 ../bitbake/bin/toaster webport=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>virtualenv</filename>, which is
+ recommended, to set up the Toaster system dependencies,
+ you need be sure the virtual environment is activated.
+ To activate this environment, use the following command:
+ <literallayout class='monospaced'>
+ $ source venv/bin/activate
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ From the directory containing the Toaster database,
+ which by default is the
+ <ulink url='&YOCTO_DOCS_DEV_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
+ "<link linkend='toaster-setting-up-the-basic-system-requirements'>Setting Up the Basic System Requirements</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 14.04.3, run the following:
+ <literallayout class='monospaced'>
+ $ sudo apt-get install apache2 libapache2-mod-wsgi mysql-server virtualenv libmysqlclient-dev
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ If you are using Fedora 22 or a RedHat distribution, run
+ the following:
+ <literallayout class='monospaced'>
+ $ sudo dnf install httpd mod_wsgi python-virtualenv gcc mysql-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>
+ Checkout a copy of <filename>poky</filename>
+ into the web server directory.
+ You will be using <filename>/var/www/toaster</filename>:
+ <literallayout class='monospaced'>
+ $ mkdir -p /var/www/toaster
+ $ cd /var/www/toaster/
+ $ git clone git://git.yoctoproject.org/poky
+ $ git checkout &DISTRO_NAME_NO_CAP;
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Initialize a virtual environment and install Toaster
+ dependencies.
+ Using a virtual environment keeps the Python packages
+ isolated from your system-provided packages:
+ <literallayout class='monospaced'>
+ $ cd /var/www/toaster/
+ $ virtualenv venv
+ $ source ./venv/bin/activate
+ $ pip install -r ./poky/bitbake/toaster-requirements.txt
+ $ pip install mysql
+ $ pip install MySQL-python
+ </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 <filename>DATABASE</filename> 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 <filename>SECRET_KEY</filename>:
+ <literallayout class='monospaced'>
+ SECRET_KEY = '<replaceable>your_secret_key</replaceable>'
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Edit the <filename>STATIC_ROOT</filename>:
+ <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 syncdb
+ $ ./bitbake/lib/toaster/manage.py migrate
+ $ TOASTER_DIR=`pwd` TOASTER_CONF=./meta-poky/conf/toasterconf.json ./bitbake/lib/toaster/manage.py checksettings
+ $ ./bitbake/lib/toaster/manage.py collectstatic
+ </literallayout>
+ </para>
+
+ <para>
+ For the above set of commands, after moving to the
+ <filename>poky</filename> directory,
+ the <filename>syncdb</filename> and <filename>migrate</filename>
+ commands ensure the database
+ schema has had changes propagated correctly (i.e.
+ migrations).
+ </para>
+
+ <para>
+ 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 the Toaster root directory
+ <filename>TOASTER_DIR</filename>.
+ For more information on the Toaster configuration file
+ <filename>TOASTER_CONF</filename>, see the
+ <link linkend='toaster-json-files'>JSON Files</link>
+ section of this manual.
+ </para>
+
+ <para>
+ This line also runs the <filename>checksettings</filename>
+ command, which configures the location of the Toaster
+ <ulink url='&YOCTO_DOCS_DEV_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.
+ </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>
+ 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;
+ Order allow,deny
+ Allow from all
+ Require all granted
+ &lt;/Directory&gt;
+
+ WSGIDaemonProcess toaster_wsgi python-path=/var/www/toaster/poky/bitbake/lib/toaster:/var/www/toaster/venv/lib/python2.7/site-packages
+
+ WSGIScriptAlias / "/var/www/toaster/poky/bitbake/lib/toaster/toastermain/wsgi.py"
+ &lt;Location /&gt;
+ WSGIProcessGroup toastern_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 and Debian 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>
+ Install the build runner service.
+ This service needs to be running in order to dispatch
+ builds.
+ Use this command:
+ <literallayout class='monospaced'>
+ /var/www/toaster/poky/bitbake/lib/toaster/manage.py runbuilds
+ </literallayout>
+ Here is an example:
+ <literallayout class='monospaced'>
+ #!/bin/sh
+ # toaster run builds dispatcher
+ cd /var/www/toaster/
+ source ./venv/bin/activate
+ ./bitbake/lib/toaster/manage.py runbuilds
+ </literallayout>
+ </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 Metadata 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/import-layers/yocto-poky/documentation/toaster-manual/toaster-manual-start.xml b/import-layers/yocto-poky/documentation/toaster-manual/toaster-manual-start.xml
new file mode 100644
index 000000000..daefa7909
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/toaster-manual/toaster-manual-start.xml
@@ -0,0 +1,147 @@
+<!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_QS_URL;#packages'>The Build Host Packages</ulink>"
+ and
+ "<ulink url='&YOCTO_DOCS_QS_URL;#releases'>Yocto Project Release</ulink>"
+ sections in the Yocto Project Quick Start.
+ </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_DEV_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-virtual-environment'>
+ <title>Set Up a Python Virtual Environment</title>
+
+ <para>
+ Set up a Python virtual environment that allows you
+ to maintain a dedicated Python executable and its own
+ set of installed modules.
+ Doing so separates the executable from Python and the
+ modules provided by the operating system.
+ This separation avoids any version conflicts.
+ <note>
+ Creating a virtual environment is not absolutely
+ necessary.
+ However, doing so is highly recommended.
+ </note>
+ </para>
+
+ <para>
+ Follow these steps to set up your virtual environment.
+ These steps assume a Ubuntu distribution:
+ <orderedlist>
+ <listitem><para><emphasis>Install <filename>virtualenv</filename>:</emphasis>
+ Install the supported
+ <filename>python-virtualenv</filename> package from your
+ distribution rather than using <filename>pip</filename>.
+ <literallayout class='monospaced'>
+ $ sudo apt-get install python-virtualenv
+ </literallayout>
+ </para></listitem>
+ <listitem><para><emphasis>Create and Activate a Virtual Environment:</emphasis>
+ <literallayout class='monospaced'>
+ $ virtualenv venv
+ $ source venv/bin/activate
+ </literallayout>
+ </para></listitem>
+ </orderedlist>
+ <note>
+ After setting up a virtual environment in
+ which to run Toaster, you must initialize that
+ virtual environment each time you want to start
+ Toaster.
+ Use the following to initialize the environment just
+ before you start Toaster:
+ <literallayout class='monospaced'>
+ $ source venv/bin/activate
+ </literallayout>
+ </note>
+ </para>
+ </section>
+
+ <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'>
+ $ pip install -r bitbake/toaster-requirements.txt
+ </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/import-layers/yocto-poky/documentation/toaster-manual/toaster-manual-style.css b/import-layers/yocto-poky/documentation/toaster-manual/toaster-manual-style.css
new file mode 100644
index 000000000..6d6b9fb65
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/toaster-manual/toaster-manual.xml b/import-layers/yocto-poky/documentation/toaster-manual/toaster-manual.xml
new file mode 100644
index 000000000..7a8912a6e
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/toaster-manual/toaster-manual.xml
@@ -0,0 +1,83 @@
+<!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>Scott</firstname> <surname>Rifenbark</surname>
+ <affiliation>
+ <orgname>Intel Corporation</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>
+ </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_TOAST_URL;'>Toaster User Manual</ulink>
+ from the Yocto Project website.
+ </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/import-layers/yocto-poky/documentation/tools/eclipse-help.sed b/import-layers/yocto-poky/documentation/tools/eclipse-help.sed
new file mode 100644
index 000000000..38690bc93
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/tools/eclipse-help.sed
@@ -0,0 +1,18 @@
+# Processes 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/import-layers/yocto-poky/documentation/tools/mega-manual.sed b/import-layers/yocto-poky/documentation/tools/mega-manual.sed
new file mode 100644
index 000000000..5a3bdf9fb
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/tools/mega-manual.sed
@@ -0,0 +1,33 @@
+# 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.1\/[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.1\/yocto-project-qs\/yocto-project-qs.html#/\"link\" href=\"#/g
+s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.1\/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.1\/[a-z]*-[a-z]*\/[a-z]*-[a-z]*.html#/\"link\" href=\"#/g
+
+s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.1\/sdk-manual\/sdk-manual.html#/\"link\" href=\"#/g
+s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.1\/bsp-guide\/bsp-guide.html#/\"link\" href=\"#/g
+s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.1\/dev-manual\/dev-manual.html#/\"link\" href=\"#/g
+s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.1\/kernel-dev\/kernel-dev.html#/\"link\" href=\"#/g
+s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.1\/profile-manual\/profile-manual.html#/\"link\" href=\"#/g
+s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.1\/ref-manual\/ref-manual.html#/\"link\" href=\"#/g
+s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.1\/toaster-manual\/toaster-manual.html#/\"link\" href=\"#/g
+s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.1\/yocto-project-qs\/yocto-project-qs.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.1\/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.1\/dev-manual\/dev-manual.html\" target=\"_top\">Yocto Project Development Manual<\/a>/Yocto Project Development Manual/g
+s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.1\/sdk-manual\/sdk-manual.html\" target=\"_top\">Yocto Project Software Development Kit (SDK) Developer's Guide<\/a>/Yocto Project Software Development Kit (SDK) Developer's Guide/g
+s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.1\/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.1\/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.1\/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.1\/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.1\/toaster-manual\/toaster-manual.html\" target=\"_top\">Toaster User Manual<\/a>/Toaster User Manual/g
diff --git a/import-layers/yocto-poky/documentation/tools/poky-docbook-to-pdf b/import-layers/yocto-poky/documentation/tools/poky-docbook-to-pdf
new file mode 100755
index 000000000..f55fd278a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/tools/update-documentation-conf b/import-layers/yocto-poky/documentation/tools/update-documentation-conf
new file mode 100644
index 000000000..3f8d28009
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/documentation/yocto-project-qs/figures/yocto-environment.png b/import-layers/yocto-poky/documentation/yocto-project-qs/figures/yocto-environment.png
new file mode 100644
index 000000000..82b7a55a3
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/yocto-project-qs/figures/yocto-environment.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/yocto-project-qs/figures/yocto-project-transp.png b/import-layers/yocto-poky/documentation/yocto-project-qs/figures/yocto-project-transp.png
new file mode 100755
index 000000000..31d2b147f
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/yocto-project-qs/figures/yocto-project-transp.png
Binary files differ
diff --git a/import-layers/yocto-poky/documentation/yocto-project-qs/qs-style.css b/import-layers/yocto-poky/documentation/yocto-project-qs/qs-style.css
new file mode 100644
index 000000000..235c85a1b
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/yocto-project-qs/qs-style.css
@@ -0,0 +1,983 @@
+/*
+ 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-position: top;
+ margin-top: -256px;
+ padding-right: 50px;
+ margin-left: 50px;
+ text-align: center;
+ width: 600px;
+}
+
+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/import-layers/yocto-poky/documentation/yocto-project-qs/yocto-project-qs-customization.xsl b/import-layers/yocto-poky/documentation/yocto-project-qs/yocto-project-qs-customization.xsl
new file mode 100644
index 000000000..dcc02dd37
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/yocto-project-qs/yocto-project-qs-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="yocto-project-qs-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="'qs-style.css'" />
+</xsl:stylesheet>
diff --git a/import-layers/yocto-poky/documentation/yocto-project-qs/yocto-project-qs-eclipse-customization.xsl b/import-layers/yocto-poky/documentation/yocto-project-qs/yocto-project-qs-eclipse-customization.xsl
new file mode 100644
index 000000000..50e6830dd
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/yocto-project-qs/yocto-project-qs-eclipse-customization.xsl
@@ -0,0 +1,34 @@
+<?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="yocto-project-qs-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/yocto-project-qs/'"/>
+ <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/import-layers/yocto-poky/documentation/yocto-project-qs/yocto-project-qs-titlepage.xsl b/import-layers/yocto-poky/documentation/yocto-project-qs/yocto-project-qs-titlepage.xsl
new file mode 100644
index 000000000..a435ac77a
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/yocto-project-qs/yocto-project-qs-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/import-layers/yocto-poky/documentation/yocto-project-qs/yocto-project-qs.xml b/import-layers/yocto-poky/documentation/yocto-project-qs/yocto-project-qs.xml
new file mode 100644
index 000000000..c09e971d6
--- /dev/null
+++ b/import-layers/yocto-poky/documentation/yocto-project-qs/yocto-project-qs.xml
@@ -0,0 +1,848 @@
+<!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='yocto-project-qs-intro'>
+ <articleinfo>
+ <title>Yocto Project Quick Start</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>
+ <note>
+ For the latest version of this manual associated with this
+ Yocto Project release, see the
+ <ulink url='&YOCTO_DOCS_QS_URL;'>Yocto Project Quick Start</ulink>
+ from the Yocto Project website.
+ </note>
+ </legalnotice>
+
+
+ <abstract>
+ <imagedata fileref="figures/yocto-project-transp.png"
+ width="6in" depth="1in"
+ align="right" scale="25" />
+ </abstract>
+ </articleinfo>
+
+ <section id='welcome'>
+ <title>Welcome!</title>
+ <para>
+ Welcome to the Yocto Project!
+ The Yocto Project is an open-source collaboration project whose
+ focus is developers of embedded Linux systems.
+ Among other things, the Yocto Project uses a build host based
+ on the OpenEmbedded (OE) project, which uses the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#bitbake-term'>BitBake</ulink>
+ tool, to construct complete Linux images.
+ The BitBake and OE components are combined together to form
+ a reference build host, historically known as
+ <ulink url='&YOCTO_DOCS_DEV_URL;#poky'>Poky</ulink>.
+ </para>
+
+ <para>
+ If you do not have a system that runs Linux and you want to give
+ the Yocto Project a test run, you might consider using the Yocto
+ Project Build Appliance.
+ The Build Appliance allows you to build and boot a custom embedded
+ Linux image with the Yocto Project using a non-Linux development
+ system.
+ See the
+ <ulink url='https://www.yoctoproject.org/tools-resources/projects/build-appliance'>Yocto Project Build Appliance</ulink>
+ for more information.
+ </para>
+
+ <para>
+ This quick start is written so that you can quickly get a
+ build host set up to use the Yocto Project and then build some
+ Linux images.
+ Rather than go into great detail about the Yocto Project and its
+ many capabilities, this quick start provides the minimal
+ information you need to try out the Yocto Project using a
+ supported Linux build host.
+ Reading and using the quick start should result in you having a
+ basic understanding of what the Yocto Project is and how to use
+ some of its core components.
+ You will also have worked through steps to produce two images:
+ one that is suitable for emulation and one that boots on actual
+ hardware.
+ The examples highlight the ease with which you can use the
+ Yocto Project to create images for multiple types of hardware.
+ </para>
+
+ <para>
+ For more detailed information on the Yocto Project, you can
+ reference these resources:
+ <itemizedlist>
+ <listitem><para><emphasis>Website:</emphasis>
+ The
+ <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>
+ provides 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>FAQs:</emphasis>
+ Lists commonly asked Yocto Project questions and answers.
+ You can find two FAQs:
+ <ulink url='&YOCTO_WIKI_URL;/wiki/FAQ'>Yocto Project FAQ</ulink>
+ on a wiki, and the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#faq'>FAQ</ulink>"
+ chapter in the Yocto Project Reference Manual.
+ </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>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='yp-intro'>
+ <title>Introducing the Yocto Project Development Environment</title>
+
+ <para>
+ The Yocto Project through the OpenEmbedded build system provides an
+ open source development environment targeting the ARM, MIPS,
+ PowerPC, and x86 architectures for a variety of platforms
+ including x86-64 and emulated ones.
+ You can use components from the Yocto Project to design, develop,
+ build, debug, simulate, and test the complete software stack using
+ Linux, the X Window System, GTK+ frameworks, and Qt frameworks.
+ </para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="figures/yocto-environment.png"
+ format="PNG" align='center' scalefit='1' width="100%"/>
+ </imageobject>
+ <caption>
+ <para>The Yocto Project Development Environment</para>
+ </caption>
+ </mediaobject>
+
+ <para>
+ Here are some highlights for the Yocto Project:
+ </para>
+
+ <itemizedlist>
+ <listitem><para>
+ Provides a recent Linux kernel along with a set of system
+ commands and libraries suitable for the embedded
+ environment.
+ </para></listitem>
+ <listitem><para>
+ Makes available system components such as X11, GTK+, Qt,
+ Clutter, and SDL (among others) so you can create a rich user
+ experience on devices that have display hardware.
+ For devices that do not have a display or where you wish to
+ use alternative UI frameworks, these components need not be
+ installed.
+ </para></listitem>
+ <listitem><para>
+ Creates a focused and stable core compatible with the
+ OpenEmbedded project with which you can easily and reliably
+ build and develop.
+ </para></listitem>
+ <listitem><para>
+ Fully supports a wide range of hardware and device emulation
+ through the Quick EMUlator (QEMU).
+ </para></listitem>
+ <listitem><para>
+ Provides a layer mechanism that allows you to easily extend
+ the system, make customizations, and keep them organized.
+ </para></listitem>
+ </itemizedlist>
+
+ <para>
+ You can use the Yocto Project to generate images for many kinds
+ of devices.
+ As mentioned earlier, the Yocto Project supports creation of
+ reference images that you can boot within and emulate using QEMU.
+ The standard example machines target QEMU full-system
+ emulation for 32-bit and 64-bit variants of x86, ARM, MIPS, and
+ PowerPC architectures.
+ Beyond emulation, you can use the layer mechanism to extend
+ support to just about any platform that Linux can run on and that
+ a toolchain can target.
+ </para>
+
+ <para>
+ Another Yocto Project feature is the Sato reference User
+ Interface.
+ This optional UI that is based on GTK+ is intended for devices with
+ restricted screen sizes and is included as part of the
+ OpenEmbedded Core layer so that developers can test parts of the
+ software stack.
+ </para>
+ </section>
+
+ <section id='yp-resources'>
+ <title>Setting Up to Use the Yocto Project</title>
+
+ <para>
+ The following list shows what you need in order to use a
+ Linux-based build host to use the Yocto Project to build images:
+ </para>
+
+ <itemizedlist>
+ <listitem><para><emphasis>Build Host</emphasis>
+ A build host with a minimum of 50 Gbytes of free disk
+ space that is running a supported Linux distribution (i.e.
+ recent releases of Fedora, openSUSE, CentOS, Debian, or
+ Ubuntu).
+ </para></listitem>
+ <listitem><para><emphasis>Build Host Packages</emphasis>
+ Appropriate packages installed on the build host.
+ </para></listitem>
+ <listitem><para><emphasis>The Yocto Project</emphasis>
+ A release of the Yocto Project.
+ </para></listitem>
+ </itemizedlist>
+
+ <section id='the-linux-distro'>
+ <title>The Linux Distribution</title>
+
+ <para>
+ The Yocto Project team verifies each release against recent
+ versions of the most popular Linux distributions that
+ provide stable releases.
+ In general, if you have the current release minus one of the
+ following distributions, you should have no problems.
+ <itemizedlist>
+ <listitem><para>
+ Ubuntu
+ </para></listitem>
+ <listitem><para>
+ Fedora
+ </para></listitem>
+ <listitem><para>
+ openSUSE
+ </para></listitem>
+ <listitem><para>
+ CentOS
+ </para></listitem>
+ <listitem><para>
+ Debian
+ </para></listitem>
+ </itemizedlist>
+ For a more detailed list of 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>
+
+ <para>
+ 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.24 or greater
+ </para></listitem>
+ <listitem><para>
+ Python 2.7.3 or greater excluding Python
+ 3.x, which is not supported.
+ </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>
+ </section>
+
+ <section id='packages'>
+ <title>The Build Host Packages</title>
+
+ <para>
+ Required build host packages vary depending on your
+ build machine and what you want to do with the Yocto Project.
+ For example, if you want to build an image that can run
+ on QEMU in graphical mode (a minimal, basic build
+ requirement), then the build host package requirements
+ are different than if you want to build an image on a headless
+ system or build out the Yocto Project documentation set.
+ </para>
+
+ <para>
+ Collectively, the number of required packages is large
+ if you want to be able to cover all cases.
+ <note>
+ In general, you need to have root access and then install
+ the required packages.
+ Thus, the commands in the following section may or may
+ not work depending on whether or not your Linux
+ distribution has <filename>sudo</filename> installed.
+ </note>
+ </para>
+
+ <para>
+ The following list shows the required packages needed to build
+ an image that runs on QEMU in graphical mode (e.g. essential
+ plus graphics support).
+ For lists of required packages for other 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.
+ <itemizedlist>
+ <listitem><para><emphasis>Ubuntu and Debian</emphasis>
+ <literallayout class='monospaced'>
+ $ sudo apt-get install &UBUNTU_HOST_PACKAGES_ESSENTIAL; libsdl1.2-dev xterm
+ </literallayout>
+ </para></listitem>
+ <listitem><para><emphasis>Fedora</emphasis>
+ <literallayout class='monospaced'>
+ $ sudo dnf install &FEDORA_HOST_PACKAGES_ESSENTIAL; SDL-devel xterm
+ </literallayout>
+ </para></listitem>
+ <listitem><para><emphasis>OpenSUSE</emphasis>
+ <literallayout class='monospaced'>
+ $ sudo zypper install &OPENSUSE_HOST_PACKAGES_ESSENTIAL; libSDL-devel xterm
+ </literallayout>
+ </para></listitem>
+ <listitem><para><emphasis>CentOS</emphasis>
+ <literallayout class='monospaced'>
+ $ sudo yum install &CENTOS_HOST_PACKAGES_ESSENTIAL; SDL-devel xterm
+ </literallayout>
+ <note>
+ CentOS 6.x users need to ensure that the required
+ versions of Git, tar and Python are available.
+ For details, 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.
+ </note>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='releases'>
+ <title>Yocto Project Release</title>
+
+ <para>
+ The last requirement you need to meet before using the
+ Yocto Project is getting a Yocto Project release.
+ It is recommended that you get the latest Yocto Project release
+ by setting up (cloning in
+ <ulink url='&YOCTO_DOCS_DEV_URL;#git'>Git</ulink> terms) a
+ local copy of the <filename>poky</filename> Git repository on
+ your build host and then checking out the latest release.
+ Doing so allows you to easily update to newer Yocto Project
+ releases as well as contribute back to the Yocto Project.
+ </para>
+
+ <para>
+ Here is an example from an Ubuntu build host that clones the
+ <filename>poky</filename> repository and then checks out the
+ latest Yocto Project Release (i.e. &DISTRO;):
+ <literallayout class='monospaced'>
+ $ git clone git://git.yoctoproject.org/poky
+ Cloning into 'poky'...
+ remote: Counting objects: 226790, done.
+ remote: Compressing objects: 100% (57465/57465), done.
+ remote: Total 226790 (delta 165212), reused 225887 (delta 164327)
+ Receiving objects: 100% (226790/226790), 100.98 MiB | 263 KiB/s, done.
+ Resolving deltas: 100% (165212/165212), done.
+ $ git checkout &DISTRO_NAME_NO_CAP;
+ </literallayout>
+ You can also get the Yocto Project Files by downloading
+ Yocto Project releases from the
+ <ulink url="&YOCTO_HOME_URL;">Yocto Project website</ulink>.
+ </para>
+
+ <para>
+ For more information on getting set up with the Yocto Project
+ release, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#local-yp-release'>Yocto Project Release</ulink>"
+ item in the Yocto Project Development Manual.
+ </para>
+ </section>
+ </section>
+
+ <section id='qs-building-images'>
+ <title>Building Images</title>
+
+ <para>
+ Now that you have your system requirements in order, you can give
+ Yocto Project a try.
+ You can try out Yocto Project using either the command-line
+ interface or using Toaster, which uses a graphical user
+ interface.
+ If you want to try out the Yocto Project using a GUI, see the
+ <ulink url='&YOCTO_DOCS_TOAST_URL;'>Toaster User Manual</ulink>
+ for information on how to install and set up Toaster.
+ </para>
+
+ <para>
+ You can try out the Yocto Project using the command-line interface
+ by finishing this quick start, which presents steps that let you
+ do the following:
+ <itemizedlist>
+ <listitem><para>
+ Build a <filename>qemux86</filename> reference image
+ and run it in the QEMU emulator.
+ </para></listitem>
+ <listitem><para>
+ Easily change configurations so that you can quickly
+ create a second image, which would be for MinnowBoard
+ MAX-compatible boards.
+ </para></listitem>
+ </itemizedlist>
+ <note>
+ The steps in this section do not provide detail, but rather
+ provide minimal, working commands and examples designed to
+ just get you started.
+ For more details, see the appropriate manuals in the
+ <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project manual set</ulink>.
+ </note>
+ </para>
+
+ <para>
+ Use the following commands to build your image.
+ The OpenEmbedded build system creates an entire Linux
+ distribution, including the toolchain, from source.
+ <note><title>Note about Network Proxies</title>
+ <para>
+ By default, the build process searches for source code
+ using a pre-determined order through a set of
+ locations.
+ 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>
+
+ <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 using the
+ Yocto Project behind a firewall in the Yocto Project
+ Reference Manual
+ <ulink url='&YOCTO_DOCS_REF_URL;#how-does-the-yocto-project-obtain-source-code-and-will-it-work-behind-my-firewall-or-proxy-server'>FAQ</ulink>
+ and on the
+ "<ulink url='https://wiki.yoctoproject.org/wiki/Working_Behind_a_Network_Proxy'>Working Behind a Network Proxy</ulink>"
+ wiki page.
+ </para>
+ </note>
+ </para>
+
+ <para>
+ <orderedlist>
+ <listitem><para><emphasis>Be Sure Your Build Host is Set Up:</emphasis>
+ The steps to build an image in this section depend on
+ your build host being properly set up.
+ Be sure you have worked through the requirements
+ described in the
+ "<link linkend='yp-resources'>Setting Up to Use the Yocto Project</link>"
+ section.
+ </para></listitem>
+ <listitem><para><emphasis>Check Out Your Branch:</emphasis>
+ Be sure you are in the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
+ (e.g. <filename>poky</filename>) and then check out
+ the branch associated with the latest Yocto Project
+ Release:
+ <literallayout class='monospaced'>
+ $ cd ~/poky
+ $ git checkout -b &DISTRO_NAME_NO_CAP; origin/&DISTRO_NAME_NO_CAP;
+ </literallayout>
+ Git's <filename>checkout</filename> command checks out
+ the current Yocto Project release into a local branch
+ whose name matches the release (i.e.
+ <filename>&DISTRO_NAME_NO_CAP;</filename>).
+ The local branch tracks the upstream branch of the
+ same name.
+ Creating your own branch based on the released
+ branch ensures you are using the latest files for
+ that release.
+ </para></listitem>
+ <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 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_DEV_URL;#build-directory'>Build Directory</ulink>,
+ which is <filename>build</filename> in this case
+ and is located in the
+ <ulink url='&YOCTO_DOCS_DEV_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.
+ <note>
+ For information on running a memory-resident
+ <ulink url='&YOCTO_DOCS_REF_URL;#usingpoky-components-bitbake'>BitBake</ulink>,
+ see the
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>
+ setup script.
+ </note>
+ </para></listitem>
+ <listitem><para><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.
+ Before using BitBake to start the build, you can
+ look at this file and be sure your general
+ configurations are how you want them:
+ <itemizedlist>
+ <listitem><para>
+ To help conserve disk space during builds,
+ you can add the following statement to your
+ project's configuration file, which for this
+ example is
+ <filename>poky/build/conf/local.conf</filename>.
+ Adding this statement deletes the work
+ directory used for building a recipe once the
+ recipe is built.
+ <literallayout class='monospaced'>
+ INHERIT += "rm_work"
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ By default, the target machine for the build is
+ <filename>qemux86</filename>,
+ which produces an image that can be used in
+ the QEMU emulator and is targeted at an
+ <trademark class='registered'>Intel</trademark>
+ 32-bit based architecture.
+ Further on in this example, this default is
+ easily changed through the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
+ variable so that you can quickly
+ build an image for a different machine.
+ </para></listitem>
+ <listitem><para>
+ Another consideration before you build is the
+ package manager used when creating the image.
+ The default <filename>local.conf</filename>
+ file selects the RPM package manager.
+ You can control this configuration by using the
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></ulink></filename>
+ variable.</para>
+ <para>Selection of the package manager is separate
+ from whether package management is used at runtime
+ in the target image.</para>
+ <para>For additional package manager selection
+ information, see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-package'><filename>package.bbclass</filename></ulink>"
+ section in the Yocto Project Reference Manual.
+ </para></listitem>
+ </itemizedlist>
+ </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:
+ <note>
+ Depending on the number of processors and cores, the
+ amount of RAM, the speed of your Internet connection
+ and other factors, the build process could take several
+ hours the first time you run it.
+ Subsequent builds run much faster since parts of the
+ build are cached.
+ </note>
+ <literallayout class='monospaced'>
+ $ bitbake core-image-sato
+ </literallayout>
+ For information on using the
+ <filename>bitbake</filename> command, see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#usingpoky-components-bitbake'>BitBake</ulink>"
+ section in the Yocto Project Reference Manual, or see the
+ "<ulink url='&YOCTO_DOCS_BB_URL;#bitbake-user-manual-command'>BitBake Command</ulink>"
+ section in the BitBake User Manual.
+ For information on other targets, see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>"
+ chapter in the Yocto Project Reference Manual.
+ </para></listitem>
+ <listitem><para><emphasis>Simulate Your Image Using QEMU:</emphasis>
+ Once this particular image is built, you can start QEMU
+ and run the image:
+ <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 Manual.
+ </para></listitem>
+ <listitem><para><emphasis>Exit QEMU:</emphasis>
+ Exit QEMU by either clicking on the shutdown icon or by
+ opening a terminal, typing
+ <filename>poweroff</filename>, and then pressing "Enter".
+ </para></listitem>
+ </orderedlist>
+ </para>
+
+ <para id='qs-minnowboard-example'>
+ The following steps show how easy it is to set up to build an
+ image for a new machine.
+ These steps build an image for the MinnowBoard MAX, which is
+ supported by the Yocto Project and the
+ <filename>meta-intel</filename> <filename>intel-corei7-64</filename>
+ and <filename>intel-core2-32</filename> Board Support Packages
+ (BSPs).
+ <note>
+ The MinnowBoard MAX ships with 64-bit firmware.
+ If you want to use the board in 32-bit mode, you must
+ download the
+ <ulink url='http://firmware.intel.com/projects/minnowboard-max'>32-bit firmware</ulink>.
+ </note>
+ </para>
+
+ <para>
+ <orderedlist>
+ <listitem><para><emphasis>Create a Local Copy of the
+ <filename>meta-intel</filename> Repository:</emphasis>
+ Building an image for the MinnowBoard MAX requires the
+ <filename>meta-intel</filename> layer.
+ Use the <filename>git clone</filename> command to create
+ a local copy of the repository inside your
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>,
+ which is <filename>poky</filename> in this example:
+ <literallayout class='monospaced'>
+ $ cd $HOME/poky
+ $ git clone git://git.yoctoproject.org/meta-intel
+ Cloning into 'meta-intel'...
+ remote: Counting objects: 11988, done.
+ remote: Compressing objects: 100% (3884/3884), done.
+ Receiving objects: 100% (11988/11988), 2.93 MiB | 2.51 MiB/s, done.
+ remote: Total 11988 (delta 6881), reused 11752 (delta 6645)
+ Resolving deltas: 100% (6881/6881), done.
+ Checking connectivity... done.
+ </literallayout>
+ By default when you clone a Git repository, the
+ "master" branch is checked out.
+ Before you build your image that uses the
+ <filename>meta-intel</filename> layer, you must be
+ sure that both repositories
+ (<filename>meta-intel</filename> and
+ <filename>poky</filename>) are using the same releases.
+ Consequently, you need to checkout out the
+ "<filename>&DISTRO_NAME_NO_CAP;</filename>" release after
+ cloning <filename>meta-intel</filename>:
+ <literallayout class='monospaced'>
+ $ cd $HOME/poky/meta-intel
+ $ git checkout &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>
+ </para></listitem>
+ <listitem><para><emphasis>Configure the Build:</emphasis>
+ To configure the build, you edit the
+ <filename>bblayers.conf</filename> and
+ <filename>local.conf</filename> files, both of which are
+ located in the <filename>build/conf</filename> directory.
+ </para>
+
+ <para>Here is a quick way to make the edits.
+ The first command uses the
+ <filename>bitbake-layers add-layer</filename> command
+ to add the <filename>meta-intel</filename>
+ layer, which contains the <filename>intel-core*</filename>
+ BSPs to the build.
+ The second command selects the BSP by setting the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
+ variable.
+ <literallayout class='monospaced'>
+ $ cd $HOME/poky/build
+ $ bitbake-layers add-layer "$HOME/poky/meta-intel"
+ $ echo 'MACHINE = "intel-corei7-64"' >> conf/local.conf
+ </literallayout>
+ <note><title>Notes</title>
+ <para>
+ If you want a 64-bit build, use the following:
+ <literallayout class='monospaced'>
+ $ echo 'MACHINE = "intel-corei7-64"' >> conf/local.conf
+ </literallayout>
+ </para>
+
+ <para>
+ If you want 32-bit images, use the following:
+ <literallayout class='monospaced'>
+ $ echo 'MACHINE = "intel-core2-32"' >> conf/local.conf
+ </literallayout>
+ </para>
+ </note>
+ </para></listitem>
+ <listitem><para><emphasis>Build a Minimal Image for MinnowBoard MAX:</emphasis>
+ Use the following command to build the minimal image for
+ MinnowBoard MAX.
+ Because configuration changes are minimal to set up for
+ this second build, the OpenEmbedded build system can
+ re-use files from previous builds as much as possible.
+ Re-using files means this second build will be much faster
+ than an initial build.
+ <literallayout class='monospaced'>
+ $ bitbake core-image-minimal
+ </literallayout>
+ Once the build completes, the resulting basic console image
+ is located in the Build Directory here:
+ <literallayout class='monospaced'>
+ tmp/deploy/images/intel-corei7-64/core-image-minimal-intel-corei7-64.hddimg
+ </literallayout>
+ </para></listitem>
+ <listitem><para><emphasis>Write the Image:</emphasis>
+ You can write the image to a USB key, SATA drive, or SD
+ card by using the <filename>mkefidisk.sh</filename> script,
+ which is included in the <filename>poky</filename>
+ repository at
+ <filename>scripts/contrib/mkefidisk.sh</filename>:
+ <literallayout class='monospaced'>
+ $ sudo $HOME/source/poky/scripts/contrib/mkefidisk.sh <replaceable>HOST_DEVICE</replaceable> \
+ tmp/deploy/images/intel-corei7-64/core-image-minimal-intel-corei7-64.hddimg <replaceable>TARGET_DEVICE</replaceable>
+ </literallayout>
+ In the previous command,
+ <replaceable>HOST_DEVICE</replaceable> is the device node
+ on the build host (e.g. <filename>/dev/sdc</filename> or
+ <filename>/dev/mmcblk0</filename>).
+ <replaceable>TARGET_DEVICE</replaceable> is the name of the
+ device as the MinnowBoard MAX sees it (e.g.
+ <filename>/dev/sda</filename> or
+ <filename>/dev/mmcblk0</filename>).
+ </para></listitem>
+ <listitem><para><emphasis>Boot the Hardware:</emphasis>
+ With the boot device provisioned, you can insert the
+ media into the MinnowBoard MAX and boot the hardware.
+ The board should automatically detect the media and boot to
+ the bootloader and subsequently the operating system.
+ </para>
+
+ <para>If the board does not boot automatically, you can
+ boot it manually from the EFI shell as follows:
+ <literallayout class='monospaced'>
+ Shell> connect -r
+ Shell> map -r
+ Shell> fs0:
+ Shell> bootx64
+ </literallayout>
+ <note>
+ For a 32-bit image use the following:
+ <literallayout class='monospaced'>
+ Shell> bootia32
+ </literallayout>
+ </note>
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='qs-next-steps'>
+ <title>Next Steps</title>
+
+ <para>
+ If you completed all the steps in the previous section then
+ congratulations!
+ What now?
+ </para>
+
+ <para>
+ Depending on what you primary interests are with the Yocto Project,
+ you could consider any of the following:
+ <itemizedlist>
+ <listitem><para><emphasis>Visit the Yocto Project Web Site:</emphasis>
+ The official
+ <ulink url='&YOCTO_HOME_URL;'>Yocto Project</ulink>
+ web site contains information on the entire project.
+ Visiting this site is a good way to familiarize yourself
+ with the overall project.
+ </para></listitem>
+ <listitem><para><emphasis>Look Through the Yocto Project Development Manual:</emphasis>
+ The
+ <ulink url='&YOCTO_DOCS_DEV_URL;#dev-manual-intro'>Yocto Project Development Manual</ulink>
+ is a great place to get a feel for how to use the Yocto
+ Project.
+ The manual contains conceptual and procedural information
+ that covers
+ <ulink url='&YOCTO_DOCS_DEV_URL;#dev-manual-model'>common development models</ulink>
+ and introduces
+ <ulink url='&YOCTO_DOCS_DEV_URL;#dev-manual-newbie'>the Yocto Project open source development environment</ulink>.
+ The manual also contains several targeted sections that
+ cover specific
+ <ulink url='&YOCTO_DOCS_DEV_URL;#extendpoky'>common tasks</ulink>
+ such as understanding and creating layers, customizing
+ images, writing new recipes, working with libraries, and
+ configuring and patching the kernel.
+ </para></listitem>
+ <listitem><para><emphasis>Look Through the Yocto Project Software Development Kit (SDK) Developer's Guide:</emphasis>
+ The
+ <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-intro'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>
+ describes how to use both 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>,
+ which are used primarily for application development.
+ This manual also provides an example workflow that uses
+ the popular <trademark class='trade'>Eclipse</trademark>
+ development environment.
+ See the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#workflow-using-eclipse'>Workflow using Eclipse™</ulink>"
+ section.
+ </para></listitem>
+ <listitem><para><emphasis>Learn About Board Support Packages (BSPs):</emphasis>
+ If you want to learn about BSPs, see the
+ <ulink url='&YOCTO_DOCS_BSP_URL;#bsp'>Yocto Project Board Support Packages (BSP) Developer's Guide</ulink>.
+ </para></listitem>
+ <listitem><para><emphasis>Learn About Toaster:</emphasis>
+ Toaster is a web interface to the Yocto Project's
+ OpenEmbedded build system.
+ If you are interested in using this type of interface to
+ create images, see the
+ <ulink url='&YOCTO_DOCS_TOAST_URL;#toaster-manual-intro'>Toaster User Manual</ulink>.
+ </para></listitem>
+ <listitem><para><emphasis>Have Available the Yocto Project Reference Manual</emphasis>
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-manual-intro'>Yocto Project Reference Manual</ulink>,
+ unlike the rest of the Yocto Project manual set, is
+ comprised of material suited for reference rather than
+ procedures.
+ You can get
+ <ulink url='&YOCTO_DOCS_REF_URL;#usingpoky'>build details</ulink>,
+ a
+ <ulink url='&YOCTO_DOCS_REF_URL;#closer-look'>closer look</ulink>
+ at how the pieces of the Yocto Project development
+ environment work together, information on various
+ <ulink url='&YOCTO_DOCS_REF_URL;#technical-details'>technical details</ulink>,
+ guidance on
+ <ulink url='&YOCTO_DOCS_REF_URL;#migration'>migrating to a newer Yocto Project release</ulink>,
+ reference material on the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-structure'>directory structure</ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes'>classes</ulink>,
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks'>tasks</ulink>.
+ The Yocto Project Reference Manual also contains a fairly
+ comprehensive
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-variables-glossary'>glossary of variables</ulink>
+ used within the Yocto Project.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+</article>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/import-layers/yocto-poky/meta-poky/classes/poky-sanity.bbclass b/import-layers/yocto-poky/meta-poky/classes/poky-sanity.bbclass
new file mode 100644
index 000000000..81cd2eb6a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-poky/conf/bblayers.conf.sample b/import-layers/yocto-poky/meta-poky/conf/bblayers.conf.sample
new file mode 100644
index 000000000..8b1cbdfc5
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-poky/conf/conf-notes.txt b/import-layers/yocto-poky/meta-poky/conf/conf-notes.txt
new file mode 100644
index 000000000..2f2932ba1
--- /dev/null
+++ b/import-layers/yocto-poky/meta-poky/conf/conf-notes.txt
@@ -0,0 +1,7 @@
+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/import-layers/yocto-poky/meta-poky/conf/distro/include/maintainers.inc b/import-layers/yocto-poky/meta-poky/conf/distro/include/maintainers.inc
new file mode 100644
index 000000000..dbc33fc9e
--- /dev/null
+++ b/import-layers/yocto-poky/meta-poky/conf/distro/include/maintainers.inc
@@ -0,0 +1,749 @@
+# 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-acpid = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-adwaita-icon-theme = "Jussi Kukkonen <jussi.kukkonen@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 <anibal.limon@linux.intel.com>"
+RECIPE_MAINTAINER_pn-aspell = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-at = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-at-spi2-atk = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-at-spi2-core = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-atk = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-attr = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-augeas = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-autoconf = "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 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-avahi-ui = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-babeltrace = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-base-files = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-base-passwd = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-bash = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-bc = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-bdwgc = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-beecrypt = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-bigreqsproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-bind = "Kai Kang <kai.kang@windriver.com>"
+RECIPE_MAINTAINER_pn-binutils = "Robert Yang <liezhi.yang@windriver.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 = "Jussi Kukkonen <jussi.kukkonen@intel.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-boost = "Alexander Kanavin <alexander.kanavin@intel.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-builder = "Cristian Iorga <cristian.iorga@intel.com>"
+RECIPE_MAINTAINER_pn-buildtools-tarball = "Cristian Iorga <cristian.iorga@intel.com>"
+RECIPE_MAINTAINER_pn-busybox = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-byacc = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-bzip2 = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-ca-certificates = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-cairo = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-calibrateproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-ccache = "Wenzong Fan <wenzong.fan@windriver.com>"
+RECIPE_MAINTAINER_pn-cdrtools-native = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-chkconfig = "Wenzong Fan <wenzong.fan@windriver.com>"
+RECIPE_MAINTAINER_pn-chkconfig-alternatives-native = "Wenzong Fan <wenzong.fan@windriver.com>"
+RECIPE_MAINTAINER_pn-chrpath = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-clutter-1.0 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-clutter-gst-3.0 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-clutter-gtk-1.0 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-cmake = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-cogl-1.0 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-compositeproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-connman = "Maxin B. John <maxin.john@intel.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-core-image-base = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-core-image-clutter = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-core-image-directfb = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-core-image-full-cmdline = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-core-image-kernel-dev = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-core-image-lsb = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-core-image-lsb-dev = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-core-image-lsb-sdk = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-core-image-minimal = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-core-image-minimal-dev = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-core-image-minimal-initramfs = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-core-image-minimal-mtdutils = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-core-image-rt = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-core-image-rt-sdk = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-core-image-sato = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-core-image-sato-dev = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-core-image-sato-sdk = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-core-image-x11 = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-coreutils = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-cpio = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-cracklib = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-createrepo = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-cronie = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-cross-localedef-native = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-cups = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-curl = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-cwautomacros = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-damageproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-db = "Maxin B. John <maxin.john@intel.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-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 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-dmxproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-docbook-dsssl-stylesheets-native = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-docbook-sgml-dtd-3.1-native = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-docbook-sgml-dtd-4.1-native = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-docbook-sgml-dtd-4.5-native = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-docbook-utils-native = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-docbook-xml-dtd4 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-docbook-xsl-stylesheets = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-dosfstools = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-dpkg = "AnĂ­bal LimĂłn <anibal.limon@linux.intel.com>"
+RECIPE_MAINTAINER_pn-dri2proto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-dri3proto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-dropbear = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-dtc = "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-elfutils = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-enchant = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-encodings = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-epiphany = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-ethtool = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-eudev = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-expat = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-file = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-findutils = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-fixesproto = "Jussi Kukkonen <jussi.kukkonen@intel.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 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-font-util = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-fontconfig = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-fontsproto = "Jussi Kukkonen <jussi.kukkonen@intel.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 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-fstests = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-gawk = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-gcc = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-gcc-runtime = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-gcc-sanitizers = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-gcc-source = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-gccmakedep = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-gconf = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-gcr = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-gdb = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-gdbm = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-gdk-pixbuf = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-gettext = "Wenzong Fan <wenzong.fan@windriver.com>"
+RECIPE_MAINTAINER_pn-gettext-minimal-native = "Hongxu Jia <hongxu.jia@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 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-glib-2.0 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-glib-networking = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-glibc = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-glibc-initial = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-glproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-gmp = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-gnome-common = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-gnome-desktop-testing = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-gnome-desktop3 = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-gnome-doc-utils = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-gnu-config = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-gnu-efi = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-gnupg = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-gnutls = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-gperf = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-gpgme = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-grep = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-groff = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-grub = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-gsettings-desktop-schemas = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-gst-player = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-gstreamer1.0 = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-gstreamer1.0-libav = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-gstreamer1.0-omx = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-gstreamer1.0-meta-base = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-gstreamer1.0-plugins-bad = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-gstreamer1.0-plugins-base = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-gstreamer1.0-plugins-good = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-gstreamer1.0-plugins-ugly = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-gstreamer1.0-rtsp-server = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-gtk+ = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-gtk+3 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-gtk-doc-stub = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-gtk-engines = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-gtk-icon-utils-native = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-gtk-sato-engine = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-guile = "Robert Yang <liezhi.yang@windriver.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 = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-harfbuzz = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-hdparm = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-help2man-native = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-hicolor-icon-theme = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-hostap-conf = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-hostap-utils = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-hwlatdetect = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-icecc-create-env-native = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-icu = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-initramfs-boot = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-initramfs-framework = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-initramfs-live-boot = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-initramfs-live-install = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-initramfs-live-install-efi = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-initscripts = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-inputproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-intltool = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-iproute2 = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-iptables = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-iputils = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-irda-utils = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-iso-codes = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-iw = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libjpeg-turbo = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-json-c = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-json-glib = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-kbd = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-kbproto = "Jussi Kukkonen <jussi.kukkonen@intel.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 = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-keymaps = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-kmod = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-lame = "Tanu Kaskinen <tanuk@iki.fi>"
+RECIPE_MAINTAINER_pn-latencytop = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-ldconfig-native = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-leafpad = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-less = "Robert Yang <liezhi.yang@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 = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libart-lgpl = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libassuan = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libatomic-ops = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libav = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libbsd = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-libcap = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-libcgroup = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libcheck = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-libclass-isa-perl = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-libconvert-asn1-perl = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-libcroco = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libdaemon = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libdmx = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libdrm = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libdumpvalue-perl = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-libenv-perl = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-libepoxy = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-liberation-fonts = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libevdev = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libevent = "Jussi Kukkonen <jussi.kukkonen@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-libfile-checktree-perl = "Alejandro Hernandez <alejandro.hernandez@linux.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 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libgcc = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-libgcrypt = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-libgfortran = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-libglade = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libglu = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libgpg-error = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libi18n-collate-perl = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-libical = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libice = "Jussi Kukkonen <jussi.kukkonen@intel.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 = "Jussi Kukkonen <jussi.kukkonen@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-libmad = "Tanu Kaskinen <tanuk@iki.fi>"
+RECIPE_MAINTAINER_pn-libmatchbox = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libmpc = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+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 = "Jussi Kukkonen <jussi.kukkonen@intel.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 = "Jussi Kukkonen <jussi.kukkonen@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 = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-libpfm4 = "Matthew McClintock <msm@freescale.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-libpod-plainer-perl = "Alejandro Hernandez <alejandro.hernandez@linux.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-librsvg = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libsamplerate0 = "Tanu Kaskinen <tanuk@iki.fi>"
+RECIPE_MAINTAINER_pn-libsdl = "Kai Kang <kai.kang@windriver.com>"
+RECIPE_MAINTAINER_pn-libsdl2 = "Kai Kang <kai.kang@windriver.com>"
+RECIPE_MAINTAINER_pn-libsecret = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libsm = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libsndfile1 = "Tanu Kaskinen <tanuk@iki.fi>"
+RECIPE_MAINTAINER_pn-libsoup-2.4 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libtasn1 = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libtheora = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libtimedate-perl = "Alejandro Hernandez <alejandro.hernandez@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-libunistring = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-liburcu = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-liburi-perl = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-libusb-compat = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-libusb1 = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-libuser = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-libvorbis = "Tanu Kaskinen <tanuk@iki.fi>"
+RECIPE_MAINTAINER_pn-libwebp = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libwnck3 = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libx11 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libx11-diet = "Kai Kang <kai.kang@windriver.com>"
+RECIPE_MAINTAINER_pn-libxau = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libxcalibrate = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libxcb = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libxcomposite = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libxcursor = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libxdamage = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libxdmcp = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libxext = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libxfixes = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libxfont = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libxft = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libxi = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libxinerama = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libxkbcommon = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libxkbfile = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libxml-namespacesupport-perl = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-libxml-parser-perl = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-libxml-perl = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-libxml-sax-perl = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-libxml-simple-perl = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-libxml2 = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-libxmu = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libxpm = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libxrandr = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libxrender = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libxres = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libxscrnsaver = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libxsettings-client = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libxshmfence = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libxslt = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libxt = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libxtst = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libxv = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libxvmc = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libxxf86dga = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libxxf86misc = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-libxxf86vm = "Jussi Kukkonen <jussi.kukkonen@intel.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 = "Maxin B. John <maxin.john@intel.com>"
+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-linuxdoc-tools-native = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-logrotate = "Robert Yang <liezhi.yang@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 = "Ross Burton <ross.burton@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 = "Robert Yang <liezhi.yang@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 = "Armin Kuster <akuster808@gmail.com>"
+RECIPE_MAINTAINER_pn-lzo = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-lzop = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-m4 = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-mailx = "Kai Kang <kai.kang@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-man = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-man-pages = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-matchbox-config-gtk = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-matchbox-desktop = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-matchbox-desktop-sato = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-matchbox-keyboard = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-matchbox-panel-2 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-matchbox-session = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-matchbox-session-sato = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-matchbox-terminal = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-matchbox-theme-sato = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-matchbox-wm = "Jussi Kukkonen <jussi.kukkonen@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 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-mesa = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-mesa-demos = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-mesa-gl = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+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-mingetty = "Kai Kang <kai.kang@windriver.com>"
+RECIPE_MAINTAINER_pn-mini-x-session = "Jussi Kukkonen <jussi.kukkonen@intel.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 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-mkfontscale = "Jussi Kukkonen <jussi.kukkonen@intel.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-mobile-broadband-provider-info = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-modutils-initscripts = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-mpeg2dec = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-mpfr = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-msmtp = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-mtd-utils = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-mtdev = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-mtools = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-mx-1.0 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-nasm = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-nativesdk-qemu-helper = "AnĂ­bal LimĂłn <anibal.limon@linux.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 = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-netbase = "Maxin B. John <maxin.john@intel.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 = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-npth = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-nspr = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-nss = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-ofono = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-oh-puzzles = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-openjade-native = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-opensp = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-openssh = "Jussi Kukkonen <jussi.kukkonen@intel.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-oprofileui = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-oprofileui-server = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-orc = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-ossp-uuid = "Alexander Kanavin <alexander.kanavin@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-packagegroup-base = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-packagegroup-core-boot = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-packagegroup-core-buildessential = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-packagegroup-core-clutter = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-packagegroup-core-device-devel = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-packagegroup-core-directfb = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-packagegroup-core-full-cmdline = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-packagegroup-core-lsb = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-packagegroup-core-nfs = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-packagegroup-core-sdk = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-packagegroup-core-ssh-dropbear = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-packagegroup-core-ssh-openssh = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-packagegroup-core-standalone-sdk-target = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-packagegroup-core-tools-debug = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-packagegroup-core-tools-profile = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-packagegroup-core-tools-testapps = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-packagegroup-core-x11 = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-packagegroup-core-x11-base = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-packagegroup-core-x11-sato = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-packagegroup-core-x11-xserver = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-packagegroup-self-hosted = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-pango = "Jussi Kukkonen <jussi.kukkonen@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-pax = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-pax-utils = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-pciutils = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-pcmanfm = "Alejandro Hernandez <alejandro.hernandez@linux.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 = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-perl-native = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-piglit = "Alexander Kanavin <alexander.kanavin@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 = "Jussi Kukkonen <jussi.kukkonen@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 = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-pong-clock = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-popt = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-portmap = "Robert Yang <liezhi.yang@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 = "Jussi Kukkonen <jussi.kukkonen@intel.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 = "Jussi Kukkonen <jussi.kukkonen@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 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-python = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python-native = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python-async = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python-dbus = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python-distribute = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python-docutils = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python-git = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python-gitdb = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python-imaging = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python-mako = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python-native = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python-nose = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python-numpy = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python-pexpect = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python-pycairo = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python-pycurl = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python-pygobject = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python-pygtk = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python-pyrex = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python-scons = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python-scons-native = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python-setuptools = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python-smartpm = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python-smmap = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python3 = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python3-distribute = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python3-native = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python3-pip = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-python3-setuptools = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-qemu = "AnĂ­bal LimĂłn <anibal.limon@linux.intel.com>"
+RECIPE_MAINTAINER_pn-qemu-helper-native = "AnĂ­bal LimĂłn <anibal.limon@linux.intel.com>"
+RECIPE_MAINTAINER_pn-quilt = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-quota = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-randrproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-readline = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-recordproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-remake = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-renderproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-resolvconf = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-resourceproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-rgb = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-rpcbind = "Hongxu Jia <hongxu.jia@windriver.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 = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-rt-tests = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-ruby = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-run-postinsts = "Cristian Iorga <cristian.iorga@intel.com>"
+RECIPE_MAINTAINER_pn-rxvt-unicode = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-sato-icon-theme = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-sato-screenshot = "Jussi Kukkonen <jussi.kukkonen@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 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-sed = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-setserial = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-settings-daemon = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-sgml-common = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-sgmlspl = "Jussi Kukkonen <jussi.kukkonen@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 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-shutdown-desktop = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-slang = "Kai Kang <kai.kang@windriver.com>"
+RECIPE_MAINTAINER_pn-socat = "Hongxu Jia <hongxu.jia@windriver.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-stat = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-strace = "Robert Yang <liezhi.yang@windriver.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 = "Alejandro Hernandez <alejandro.hernandez@linux.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-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 = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-sysvinit-inittab = "Ross Burton <ross.burton@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 = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-tcp-wrappers = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-texi2html = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-texinfo = "Alejandro Hernandez <alejandro.hernandez@linux.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-tremor = "Tanu Kaskinen <tanuk@iki.fi>"
+RECIPE_MAINTAINER_pn-tslib = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-ttf-bitstream-vera = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-tzcode-native = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-tzdata = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-u-boot = "Denys Dmytriyenko <denis@denix.org>"
+RECIPE_MAINTAINER_pn-u-boot-fw-utils = "Denys Dmytriyenko <denis@denix.org>"
+RECIPE_MAINTAINER_pn-u-boot-mkimage = "Denys Dmytriyenko <denis@denix.org>"
+RECIPE_MAINTAINER_pn-ubootchart = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-uclibc = "Khem Raj <raj.khem@gmail.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-unzip = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-update-rc.d = "Ross Burton <ross.burton@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 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-v86d = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-vala = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-valgrind = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-videoproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-vte = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-waffle = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-watchdog = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-wayland = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-webkitgtk = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-weston = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-weston-init = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-wget = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-which = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
+RECIPE_MAINTAINER_pn-wireless-tools = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-wpa-supplicant = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-x11-common = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-x11perf = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-x264 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xauth = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xcb-proto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xcb-util = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xcb-util-image = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xcb-util-keysyms = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xcb-util-renderutil = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xcb-util-wm = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xcmiscproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xcursor-transparent-theme = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xdg-utils = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xdpyinfo = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xev = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xextproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xeyes = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xf86-input-evdev = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xf86-input-keyboard = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xf86-input-mouse = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xf86-input-synaptics = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xf86-input-vmmouse = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xf86-video-cirrus = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xf86-video-fbdev = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xf86-video-intel = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xf86-video-omap = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xf86-video-omapfb = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xf86-video-vesa = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xf86-video-vmware = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xf86dgaproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xf86driproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xf86miscproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xf86vidmodeproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xhost = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xineramaproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xinetd = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-xinit = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xinput = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xinput-calibrator = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xkbcomp = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xkeyboard-config = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xmlto = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-xmodmap = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xorg-minimal-fonts = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xprop = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xrandr = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xrestop = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xserver-nodm-init = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xserver-xf86-config = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xserver-xorg = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xset = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xtrans = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xtscal = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xuser-account = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xvideo-tests = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-xvinfo = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xwininfo = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-xz = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-yasm = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
+RECIPE_MAINTAINER_pn-zip = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-zlib = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-stress = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-mmc-utils = "Maxin B. John <maxin.john@intel.com>"
diff --git a/import-layers/yocto-poky/meta-poky/conf/distro/include/poky-floating-revisions.inc b/import-layers/yocto-poky/meta-poky/conf/distro/include/poky-floating-revisions.inc
new file mode 100644
index 000000000..e1abd3a1a
--- /dev/null
+++ b/import-layers/yocto-poky/meta-poky/conf/distro/include/poky-floating-revisions.inc
@@ -0,0 +1,59 @@
+#
+# 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-oprofileui ?= "${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/import-layers/yocto-poky/meta-poky/conf/distro/include/poky-world-exclude.inc b/import-layers/yocto-poky/meta-poky/conf/distro/include/poky-world-exclude.inc
new file mode 100644
index 000000000..5194ff143
--- /dev/null
+++ b/import-layers/yocto-poky/meta-poky/conf/distro/include/poky-world-exclude.inc
@@ -0,0 +1,6 @@
+#
+# Things we exlude fromw world testing within the reference distro
+#
+
+# qwt from meta-qt4, has poky-lsb QA warnings, qt4 for lsb only
+EXCLUDE_FROM_WORLD_pn-qwt = "1"
diff --git a/import-layers/yocto-poky/meta-poky/conf/distro/poky-bleeding.conf b/import-layers/yocto-poky/meta-poky/conf/distro/poky-bleeding.conf
new file mode 100644
index 000000000..2d3e046a4
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-poky/conf/distro/poky-lsb.conf b/import-layers/yocto-poky/meta-poky/conf/distro/poky-lsb.conf
new file mode 100644
index 000000000..e7d6995a7
--- /dev/null
+++ b/import-layers/yocto-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.1%"
diff --git a/import-layers/yocto-poky/meta-poky/conf/distro/poky-tiny.conf b/import-layers/yocto-poky/meta-poky/conf/distro/poky-tiny.conf
new file mode 100644
index 000000000..ac054201d
--- /dev/null
+++ b/import-layers/yocto-poky/meta-poky/conf/distro/poky-tiny.conf
@@ -0,0 +1,128 @@
+# 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"
+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.4%"
+
+# 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}"
+
+# Use tmpdevfs and the busybox runtime services
+VIRTUAL-RUNTIME_dev_manager = ""
+VIRTUAL-RUNTIME_login_manager = ""
+VIRTUAL-RUNTIME_init_manager = "tiny-init"
+VIRTUAL-RUNTIME_keymaps = ""
+
+# 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"
+
+# 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-directfb] = "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/import-layers/yocto-poky/meta-poky/conf/distro/poky.conf b/import-layers/yocto-poky/meta-poky/conf/distro/poky.conf
new file mode 100644
index 000000000..722bbf1c3
--- /dev/null
+++ b/import-layers/yocto-poky/meta-poky/conf/distro/poky.conf
@@ -0,0 +1,110 @@
+DISTRO = "poky"
+DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
+DISTRO_VERSION = "2.1"
+DISTRO_CODENAME = "krogoth"
+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"
+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.4%"
+PREFERRED_VERSION_linux-yocto_qemux86 ?= "4.4%"
+PREFERRED_VERSION_linux-yocto_qemux86-64 ?= "4.4%"
+PREFERRED_VERSION_linux-yocto_qemuarm ?= "4.4%"
+PREFERRED_VERSION_linux-yocto_qemumips ?= "4.4%"
+PREFERRED_VERSION_linux-yocto_qemumips64 ?= "4.4%"
+PREFERRED_VERSION_linux-yocto_qemuppc ?= "4.4%"
+
+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 ppc x86_64"
+# Other QEMU_TARGETS "mips64el 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-1.7 \n \
+ poky-1.8 \n \
+ poky-2.0 \n \
+ Ubuntu-14.04 \n \
+ Ubuntu-14.10 \n \
+ Ubuntu-15.04 \n \
+ Ubuntu-15.10 \n \
+ Fedora-21 \n \
+ Fedora-22 \n \
+ Fedora-23 \n \
+ CentOS-6.* \n \
+ CentOS-7.* \n \
+ Debian-7.* \n \
+ Debian-8.* \n \
+ openSUSE-project-13.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 = "11"
+
+# 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/import-layers/yocto-poky/meta-poky/conf/layer.conf b/import-layers/yocto-poky/meta-poky/conf/layer.conf
new file mode 100644
index 000000000..8b7b33d48
--- /dev/null
+++ b/import-layers/yocto-poky/meta-poky/conf/layer.conf
@@ -0,0 +1,18 @@
+# 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"
+
+# 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/import-layers/yocto-poky/meta-poky/conf/local.conf.sample b/import-layers/yocto-poky/meta-poky/conf/local.conf.sample
new file mode 100644
index 000000000..a7b2d8065
--- /dev/null
+++ b/import-layers/yocto-poky/meta-poky/conf/local.conf.sample
@@ -0,0 +1,238 @@
+#
+# 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"
+#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
+# - 'image-swab' to perform host system intrusion detection
+# 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
+# image-prelink disabled for now due to issues with IFUNC symbol relocation
+USER_CLASSES ?= "buildstats image-mklibs"
+
+#
+# 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"
+
+
+#
+# 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/import-layers/yocto-poky/meta-poky/conf/local.conf.sample.extended b/import-layers/yocto-poky/meta-poky/conf/local.conf.sample.extended
new file mode 100644
index 000000000..aa7b42f82
--- /dev/null
+++ b/import-layers/yocto-poky/meta-poky/conf/local.conf.sample.extended
@@ -0,0 +1,400 @@
+# 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"
+
+# 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'
+#
+
+# Remove the old image before the new one generated to save disk space
+#RM_OLD_IMAGE = "1"
+
+#
+# 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"
+#
+
+# Using RPM4
+#
+# Currently the rootfs_rpm code has a hard depends on rpmresolve:do_populate_sysroot,
+# when using rpm4 the rpmresolve code will not compile due to a missing header file.
+# That dependency needs to be removed when using RPM4, also the PREFERRED_VERSION needs
+# to be set. This example shows how to enable rpm4
+# PREFERRED_VERSION_rpm = "4.11.2"
+# PREFERRED_VERSION_rpm-native = "4.11.2"
+# RPMROOTFSDEPENDS_remove = "rpmresolve-native:do_populate_sysroot"
+
+#
+# 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/import-layers/yocto-poky/meta-poky/conf/site.conf.sample b/import-layers/yocto-poky/meta-poky/conf/site.conf.sample
new file mode 100644
index 000000000..6cfefc574
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-poky/conf/toasterconf.json b/import-layers/yocto-poky/meta-poky/conf/toasterconf.json
new file mode 100644
index 000000000..606aac776
--- /dev/null
+++ b/import-layers/yocto-poky/meta-poky/conf/toasterconf.json
@@ -0,0 +1,120 @@
+{
+ "config": {
+ "MACHINE" : "qemux86",
+ "DISTRO" : "poky",
+ "DL_DIR" : "${TOPDIR}/../downloads",
+ "IMAGE_FSTYPES": "ext3 jffs2 tar.bz2",
+ "IMAGE_INSTALL_append": "",
+ "PACKAGE_CLASSES": "package_rpm",
+ "SSTATE_DIR" : "${TOPDIR}/../sstate-cache"
+ },
+ "layersources": [
+ {
+ "name": "Local Yocto Project",
+ "sourcetype": "local",
+ "apiurl": "../../",
+ "branches": ["HEAD" ],
+ "layers": [
+ {
+ "name": "openembedded-core",
+ "local_path": "meta",
+ "vcs_url": "remote:origin",
+ "dirpath": "meta"
+ },
+ {
+ "name": "meta-poky",
+ "local_path": "meta-poky",
+ "vcs_url": "remote:origin",
+ "dirpath": "meta-poky"
+ },
+ {
+ "name": "meta-yocto-bsp",
+ "local_path": "meta-yocto-bsp",
+ "vcs_url": "remote:origin",
+ "dirpath": "meta-yocto-bsp"
+ }
+
+ ]
+ },
+ {
+ "name": "OpenEmbedded",
+ "sourcetype": "layerindex",
+ "apiurl": "http://layers.openembedded.org/layerindex/api/",
+ "branches": ["master", "jethro", "krogoth"]
+ },
+ {
+ "name": "Imported layers",
+ "sourcetype": "imported",
+ "apiurl": "",
+ "branches": ["master", "jethro", "krogoth", "HEAD"]
+
+ }
+ ],
+ "bitbake" : [
+ {
+ "name": "master",
+ "giturl": "remote:origin",
+ "branch": "master",
+ "dirpath": "bitbake"
+ },
+ {
+ "name": "jethro",
+ "giturl": "remote:origin",
+ "branch": "jethro",
+ "dirpath": "bitbake"
+ },
+ {
+ "name": "krogoth",
+ "giturl": "remote:origin",
+ "branch": "krogoth",
+ "dirpath": "bitbake"
+ },
+ {
+ "name": "HEAD",
+ "giturl": "remote:origin",
+ "branch": "HEAD",
+ "dirpath": "bitbake"
+ }
+ ],
+
+ "defaultrelease": "master",
+
+ "releases": [
+ {
+ "name": "master",
+ "description": "Yocto Project master",
+ "bitbake": "master",
+ "branch": "master",
+ "defaultlayers": [ "openembedded-core", "meta-poky", "meta-yocto-bsp"],
+ "layersourcepriority": { "Imported layers": 99, "Local Yocto Project" : 10, "OpenEmbedded" : 0 },
+ "helptext": "Toaster will run your builds using the tip of the <a href=\"http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/\">Yocto Project master branch</a>, where active development takes place. This is not a stable branch, so your builds might not work as expected."
+ },
+ {
+ "name": "jethro",
+ "description": "Yocto Project 2.0 Jethro",
+ "bitbake": "jethro",
+ "branch": "jethro",
+ "defaultlayers": [ "openembedded-core", "meta-yocto", "meta-yocto-bsp"],
+ "layersourcepriority": { "Imported layers": 99, "Local Yocto Project" : 10, "OpenEmbedded" : 0 },
+ "helptext": "Toaster will run your builds with the tip of the <a href=\"http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/?h=jethro\">Yocto Project 2.0 \"Jethro\"</a> branch."
+ },
+ {
+ "name": "krogoth",
+ "description": "Yocto Project 2.1 Krogoth",
+ "bitbake": "krogoth",
+ "branch": "krogoth",
+ "defaultlayers": [ "openembedded-core", "meta-poky", "meta-yocto-bsp"],
+ "layersourcepriority": { "Imported layers": 99, "Local Yocto Project" : 10, "OpenEmbedded" : 0 },
+ "helptext": "Toaster will run your builds with the tip of the <a href=\"http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/?h=krogoth\">Yocto Project 2.1 \"Krogoth\"</a> branch."
+ },
+ {
+ "name": "local",
+ "description": "Local Yocto Project",
+ "bitbake": "HEAD",
+ "branch": "HEAD",
+ "defaultlayers": [ "openembedded-core", "meta-poky", "meta-yocto-bsp"],
+ "layersourcepriority": { "Imported layers": 99, "Local Yocto Project" : 10, "OpenEmbedded" : 0 },
+ "helptext": "Toaster will run your builds with the version of the Yocto Project you have cloned or downloaded to your computer."
+ }
+ ]
+}
diff --git a/import-layers/yocto-poky/meta-poky/recipes-core/busybox/busybox/poky-tiny/defconfig b/import-layers/yocto-poky/meta-poky/recipes-core/busybox/busybox/poky-tiny/defconfig
new file mode 100644
index 000000000..0a5d5c918
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-poky/recipes-core/busybox/busybox_%.bbappend b/import-layers/yocto-poky/meta-poky/recipes-core/busybox/busybox_%.bbappend
new file mode 100644
index 000000000..000578744
--- /dev/null
+++ b/import-layers/yocto-poky/meta-poky/recipes-core/busybox/busybox_%.bbappend
@@ -0,0 +1,2 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
+
diff --git a/import-layers/yocto-poky/meta-poky/recipes-core/psplash/files/psplash-poky-img.h b/import-layers/yocto-poky/meta-poky/recipes-core/psplash/files/psplash-poky-img.h
new file mode 100644
index 000000000..e84dac933
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-poky/recipes-core/psplash/psplash_git.bbappend b/import-layers/yocto-poky/meta-poky/recipes-core/psplash/psplash_git.bbappend
new file mode 100644
index 000000000..433ef6697
--- /dev/null
+++ b/import-layers/yocto-poky/meta-poky/recipes-core/psplash/psplash_git.bbappend
@@ -0,0 +1,2 @@
+FILESEXTRAPATHS_prepend_poky := "${THISDIR}/files:"
+
diff --git a/import-layers/yocto-poky/meta-poky/recipes-core/tiny-init/files/init b/import-layers/yocto-poky/meta-poky/recipes-core/tiny-init/files/init
new file mode 100644
index 000000000..9140e9558
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-poky/recipes-core/tiny-init/files/rc.local.sample b/import-layers/yocto-poky/meta-poky/recipes-core/tiny-init/files/rc.local.sample
new file mode 100644
index 000000000..d9e198a20
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-poky/recipes-core/tiny-init/tiny-init.bb b/import-layers/yocto-poky/meta-poky/recipes-core/tiny-init/tiny-init.bb
new file mode 100644
index 000000000..4d4e34dc8
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-selftest/COPYING.MIT b/import-layers/yocto-poky/meta-selftest/COPYING.MIT
new file mode 100644
index 000000000..89de35479
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-selftest/README b/import-layers/yocto-poky/meta-selftest/README
new file mode 100644
index 000000000..11a6fee2d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-selftest/classes/test_events.bbclass b/import-layers/yocto-poky/meta-selftest/classes/test_events.bbclass
new file mode 100644
index 000000000..35324eb40
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-selftest/conf/layer.conf b/import-layers/yocto-poky/meta-selftest/conf/layer.conf
new file mode 100644
index 000000000..a847b78a2
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/conf/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 += "selftest"
+BBFILE_PATTERN_selftest = "^${LAYERDIR}/"
+BBFILE_PRIORITY_selftest = "5"
diff --git a/import-layers/yocto-poky/meta-selftest/conf/machine/qemux86copy.conf b/import-layers/yocto-poky/meta-selftest/conf/machine/qemux86copy.conf
new file mode 100644
index 000000000..76c13fdcb
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/conf/machine/qemux86copy.conf
@@ -0,0 +1,3 @@
+require conf/machine/qemux86.conf
+
+MACHINEOVERRIDES .= ":qemux86"
diff --git a/import-layers/yocto-poky/meta-selftest/files/signing/key.pub b/import-layers/yocto-poky/meta-selftest/files/signing/key.pub
new file mode 100644
index 000000000..e197bb381
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-selftest/files/signing/key.secret b/import-layers/yocto-poky/meta-selftest/files/signing/key.secret
new file mode 100644
index 000000000..d30d7cd61
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-selftest/lib/devtool/__init__.py b/import-layers/yocto-poky/meta-selftest/lib/devtool/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/lib/devtool/__init__.py
diff --git a/import-layers/yocto-poky/meta-selftest/lib/devtool/test.py b/import-layers/yocto-poky/meta-selftest/lib/devtool/test.py
new file mode 100644
index 000000000..b7474b5ee
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-selftest/recipes-test/aspell/aspell_0.0.0.1.bb b/import-layers/yocto-poky/meta-selftest/recipes-test/aspell/aspell_0.0.0.1.bb
new file mode 100644
index 000000000..20a0ab7d3
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/aspell/aspell_0.0.0.1.bb
@@ -0,0 +1,30 @@
+# 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"
+
+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/import-layers/yocto-poky/meta-selftest/recipes-test/aspell/aspell_0.60.6.1.bbappend b/import-layers/yocto-poky/meta-selftest/recipes-test/aspell/aspell_0.60.6.1.bbappend
new file mode 100644
index 000000000..205720982
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test1-1.5.3/0001-Add-a-note-line-to-the-quick-reference.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb
new file mode 100644
index 000000000..e93b0d551
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb
@@ -0,0 +1,16 @@
+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"
+
+SRC_URI[md5sum] = "9365d86bd884222b4bf1039b5a9ed1bd"
+SRC_URI[sha256sum] = "681bcca9784bf3cb2207e68236d1f68e2aa7b80f999b5750dc77dcd756e81fbc"
+
+PR = "r5"
+
+S = "${WORKDIR}/pv-${PV}"
+
+inherit autotools
+
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb.upgraded b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb.upgraded
new file mode 100644
index 000000000..afcc4aa13
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb.upgraded
@@ -0,0 +1,14 @@
+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"
+
+SRC_URI[md5sum] = "062bca5ff33df1dd09472e7fc3bbe332"
+SRC_URI[sha256sum] = "9dd45391806b0ed215abee4c5ac1597d018c386fe9c1f5afd2f6bc3b07fd82c3"
+
+S = "${WORKDIR}/pv-${PV}"
+
+inherit autotools
+
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb
new file mode 100644
index 000000000..9bfce0afe
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_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"
+
+# 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"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb.upgraded b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb.upgraded
new file mode 100644
index 000000000..9b947ed9e
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb.upgraded
@@ -0,0 +1,17 @@
+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"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/emptytest/emptytest.bb b/import-layers/yocto-poky/meta-selftest/recipes-test/emptytest/emptytest.bb
new file mode 100644
index 000000000..905c6694f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-selftest/recipes-test/error/error.bb b/import-layers/yocto-poky/meta-selftest/recipes-test/error/error.bb
new file mode 100644
index 000000000..a7bdecf29
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/error/error.bb
@@ -0,0 +1,11 @@
+SUMMARY = "Error Test case that fails on do_compile"
+DESCRIPTION = "This generates a compile time error to be used to for testing."
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+INHIBIT_DEFAULT_DEPS = "1"
+EXCLUDE_FROM_WORLD = "1"
+
+do_compile() {
+ bbfatal "Failing as expected.";
+}
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/images/error-image.bb b/import-layers/yocto-poky/meta-selftest/recipes-test/images/error-image.bb
new file mode 100644
index 000000000..13d9cc010
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-selftest/recipes-test/images/oe-selftest-image.bb b/import-layers/yocto-poky/meta-selftest/recipes-test/images/oe-selftest-image.bb
new file mode 100644
index 000000000..f17094c5d
--- /dev/null
+++ b/import-layers/yocto-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 ${ROOTFS_PKGMANAGE_BOOTSTRAP} dropbear"
+IMAGE_FEATURES = "debug-tweaks"
+
+IMAGE_LINGUAS = " "
+
+inherit core-image
+
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/images/test-empty-image.bb b/import-layers/yocto-poky/meta-selftest/recipes-test/images/test-empty-image.bb
new file mode 100644
index 000000000..88d8d612e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-selftest/recipes-test/images/wic-image-minimal.bb b/import-layers/yocto-poky/meta-selftest/recipes-test/images/wic-image-minimal.bb
new file mode 100644
index 000000000..a294ba7af
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/images/wic-image-minimal.bb
@@ -0,0 +1,18 @@
+SUMMARY = "An example of partitioned image."
+
+SRC_URI = "file://${FILE_DIRNAME}/${BPN}.wks"
+
+IMAGE_INSTALL = "packagegroup-core-boot ${ROOTFS_PKGMANAGE_BOOTSTRAP}"
+
+IMAGE_FSTYPES = "wic"
+RM_OLD_IMAGE = "1"
+
+DEPENDS = "syslinux syslinux-native parted-native dosfstools-native mtools-native gptfdisk-native"
+
+# core-image-minimal is referenced in .wks, so we need its rootfs
+# to be ready before our rootfs
+do_rootfs[depends] += "core-image-minimal:do_image core-image-minimal:do_rootfs_wicenv"
+
+IMAGE_ROOTFS_EXTRA_SPACE = "2000"
+
+inherit image
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/images/wic-image-minimal.wks b/import-layers/yocto-poky/meta-selftest/recipes-test/images/wic-image-minimal.wks
new file mode 100644
index 000000000..d55075d50
--- /dev/null
+++ b/import-layers/yocto-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 vda --label boot --active --align 1024
+part / --source rootfs --ondisk vda --fstype=ext4 --label platform --align 1024 --use-uuid
+part /mnt --source rootfs --rootfs-dir=core-image-minimal --ondisk vda --fstype=ext4 --label core --align 1024
+part backup --source rootfs --rootfs-dir=wic-image-minimal --ondisk vda --fstype=ext4 --label backup --align 1024
+
+bootloader --ptable gpt --timeout=0 --append="rootwait console=tty0"
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/m4/m4_1.4.17.bbappend b/import-layers/yocto-poky/meta-selftest/recipes-test/m4/m4_1.4.17.bbappend
new file mode 100644
index 000000000..205720982
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/m4/m4_1.4.17.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/import-layers/yocto-poky/meta-selftest/recipes-test/man/man/man-1.5h1-make.patch b/import-layers/yocto-poky/meta-selftest/recipes-test/man/man/man-1.5h1-make.patch
new file mode 100644
index 000000000..a0d59b78c
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/man/man/man-1.5h1-make.patch
@@ -0,0 +1,16 @@
+Test patch here!
+This is invalid patch used by tests in scripts/lib/selftests.
+
+--- man-1.5g/man/Makefile.in.mike Fri Apr 9 13:35:54 1999
++++ man-1.5g/man/Makefile.in Fri Apr 9 13:36:45 1999
+@@ -1,8 +1,8 @@
+ #MAKE THIS PATCH INVALID
+ MAN1 = man whatis apropos
+-MAN5 = man.conf
++MAN5 = man.config
+ MAN8 = makewhatis
+-ALL = man.1 whatis.1 apropos.1 man.conf.5
++ALL = man.1 whatis.1 apropos.1 man.config.5
+ MAYBE8 = makewhatis
+
+ .SUFFIXES: .man .1 .5 .8
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/man/man_1.6g.bbappend b/import-layers/yocto-poky/meta-selftest/recipes-test/man/man_1.6g.bbappend
new file mode 100644
index 000000000..205720982
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/man/man_1.6g.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/import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/add-file.patch b/import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/add-file.patch
new file mode 100644
index 000000000..bdc99c94f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/file1 b/import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/file1
new file mode 100644
index 000000000..7571aa7a8
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/file1
@@ -0,0 +1,2 @@
+First test file
+123
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/installscript.sh b/import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/installscript.sh
new file mode 100644
index 000000000..9de30d69c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-inst-func b/import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-inst-func
new file mode 100644
index 000000000..2802bb348
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-inst-globfile b/import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-inst-globfile
new file mode 100644
index 000000000..996298bf1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-inst-todir-globfile b/import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-inst-todir-globfile
new file mode 100644
index 000000000..585ae3e9b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-orig b/import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-orig
new file mode 100644
index 000000000..593d6a0bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-orig
@@ -0,0 +1 @@
+Straight through with same nam
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-src-globfile b/import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-src-globfile
new file mode 100644
index 000000000..1e20a2b03
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-todir b/import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-todir
new file mode 100644
index 000000000..85bd5eba4
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/subdir/fileinsubdir b/import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/subdir/fileinsubdir
new file mode 100644
index 000000000..d516b4951
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/files/subdir/fileinsubdir
@@ -0,0 +1 @@
+A file in a subdirectory
diff --git a/import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/selftest-recipetool-appendfile.bb b/import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/selftest-recipetool-appendfile.bb
new file mode 100644
index 000000000..7d0a040be
--- /dev/null
+++ b/import-layers/yocto-poky/meta-selftest/recipes-test/recipetool/selftest-recipetool-appendfile.bb
@@ -0,0 +1,42 @@
+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"
+
+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/import-layers/yocto-poky/meta-selftest/recipes-test/xcursor-transparent-theme/xcursor-transparent-theme_%.bbappend b/import-layers/yocto-poky/meta-selftest/recipes-test/xcursor-transparent-theme/xcursor-transparent-theme_%.bbappend
new file mode 100644
index 000000000..205720982
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-skeleton/COPYING.MIT b/import-layers/yocto-poky/meta-skeleton/COPYING.MIT
new file mode 100644
index 000000000..fb950dc69
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-skeleton/conf/layer.conf b/import-layers/yocto-poky/meta-skeleton/conf/layer.conf
new file mode 100644
index 000000000..aca163342
--- /dev/null
+++ b/import-layers/yocto-poky/meta-skeleton/conf/layer.conf
@@ -0,0 +1,15 @@
+# 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"
diff --git a/import-layers/yocto-poky/meta-skeleton/conf/multilib-example.conf b/import-layers/yocto-poky/meta-skeleton/conf/multilib-example.conf
new file mode 100644
index 000000000..da6da7f1f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-skeleton/conf/multilib-example2.conf b/import-layers/yocto-poky/meta-skeleton/conf/multilib-example2.conf
new file mode 100644
index 000000000..2596f61d9
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-skeleton/recipes-core/busybox/busybox/no_rfkill.cfg b/import-layers/yocto-poky/meta-skeleton/recipes-core/busybox/busybox/no_rfkill.cfg
new file mode 100644
index 000000000..f840ecd26
--- /dev/null
+++ b/import-layers/yocto-poky/meta-skeleton/recipes-core/busybox/busybox/no_rfkill.cfg
@@ -0,0 +1 @@
+# CONFIG_RFKILL is not set
diff --git a/import-layers/yocto-poky/meta-skeleton/recipes-core/busybox/busybox_%.bbappend b/import-layers/yocto-poky/meta-skeleton/recipes-core/busybox/busybox_%.bbappend
new file mode 100644
index 000000000..64cdefc76
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-skeleton/recipes-kernel/hello-mod/files/COPYING b/import-layers/yocto-poky/meta-skeleton/recipes-kernel/hello-mod/files/COPYING
new file mode 100644
index 000000000..6d45519c8
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-skeleton/recipes-kernel/hello-mod/files/Makefile b/import-layers/yocto-poky/meta-skeleton/recipes-kernel/hello-mod/files/Makefile
new file mode 100644
index 000000000..4ded35fbc
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-skeleton/recipes-kernel/hello-mod/files/hello.c b/import-layers/yocto-poky/meta-skeleton/recipes-kernel/hello-mod/files/hello.c
new file mode 100644
index 000000000..f3c0d372e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-skeleton/recipes-kernel/hello-mod/hello-mod_0.1.bb b/import-layers/yocto-poky/meta-skeleton/recipes-kernel/hello-mod/hello-mod_0.1.bb
new file mode 100644
index 000000000..b140b0ac8
--- /dev/null
+++ b/import-layers/yocto-poky/meta-skeleton/recipes-kernel/hello-mod/hello-mod_0.1.bb
@@ -0,0 +1,15 @@
+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.
diff --git a/import-layers/yocto-poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb b/import-layers/yocto-poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
new file mode 100644
index 000000000..6194d4f8d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/0001-linux-version-tweak.patch b/import-layers/yocto-poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/0001-linux-version-tweak.patch
new file mode 100644
index 000000000..1c88315cd
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/feature.scc b/import-layers/yocto-poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/feature.scc
new file mode 100644
index 000000000..aad5af49f
--- /dev/null
+++ b/import-layers/yocto-poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/feature.scc
@@ -0,0 +1 @@
+patch 0001-linux-version-tweak.patch
diff --git a/import-layers/yocto-poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/smp.cfg b/import-layers/yocto-poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/smp.cfg
new file mode 100644
index 000000000..0c26a8626
--- /dev/null
+++ b/import-layers/yocto-poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/smp.cfg
@@ -0,0 +1 @@
+# CONFIG_SMP is not set
diff --git a/import-layers/yocto-poky/meta-skeleton/recipes-multilib/images/core-image-multilib-example.bb b/import-layers/yocto-poky/meta-skeleton/recipes-multilib/images/core-image-multilib-example.bb
new file mode 100644
index 000000000..f13186f93
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/service/service/COPYRIGHT b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/service/service/COPYRIGHT
new file mode 100644
index 000000000..ec3e17113
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/service/service/skeleton b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/service/service/skeleton
new file mode 100644
index 000000000..a3edc9d08
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/service/service/skeleton_test.c b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/service/service/skeleton_test.c
new file mode 100644
index 000000000..96c67ac11
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/service/service_0.1.bb b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/service/service_0.1.bb
new file mode 100644
index 000000000..c5cd7a97b
--- /dev/null
+++ b/import-layers/yocto-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} ${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/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example.bb b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example.bb
new file mode 100644
index 000000000..d3c02d5d6
--- /dev/null
+++ b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example.bb
@@ -0,0 +1,76 @@
+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}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+ file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SRC_URI = "file://file1 \
+ file://file2 \
+ file://file3 \
+ file://file4"
+
+S = "${WORKDIR}"
+
+PACKAGES =+ "${PN}-user3"
+
+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/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file1 b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file1
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file1
diff --git a/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file2 b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file2
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file2
diff --git a/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file3 b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file3
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file3
diff --git a/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file4 b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file4
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file4
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/conf/layer.conf b/import-layers/yocto-poky/meta-yocto-bsp/conf/layer.conf
new file mode 100644
index 000000000..44dbca60f
--- /dev/null
+++ b/import-layers/yocto-poky/meta-yocto-bsp/conf/layer.conf
@@ -0,0 +1,11 @@
+# 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 = "3"
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/beaglebone.conf b/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/beaglebone.conf
new file mode 100644
index 000000000..179d135a5
--- /dev/null
+++ b/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/beaglebone.conf
@@ -0,0 +1,39 @@
+#@TYPE: Machine
+#@NAME: Beaglebone machine
+#@DESCRIPTION: Machine configuration for http://beagleboard.org/bone and http://beagleboard.org/black boards
+
+PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
+XSERVER ?= "xserver-xorg \
+ xf86-input-evdev \
+ xf86-input-mouse \
+ xf86-video-fbdev \
+ xf86-input-keyboard"
+
+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"
+EXTRA_IMAGECMD_jffs2 = "-lnp "
+
+SERIAL_CONSOLE = "115200 ttyO0"
+
+PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
+PREFERRED_VERSION_linux-yocto ?= "4.4%"
+
+KERNEL_IMAGETYPE = "zImage"
+KERNEL_DEVICETREE = "am335x-bone.dtb am335x-boneblack.dtb"
+KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT}"
+
+SPL_BINARY = "MLO"
+UBOOT_SUFFIX = "img"
+UBOOT_MACHINE = "am335x_evm_config"
+UBOOT_ENTRYPOINT = "0x80008000"
+UBOOT_LOADADDRESS = "0x80008000"
+
+MACHINE_FEATURES = "usbgadget usbhost vfat alsa"
+
+IMAGE_BOOT_FILES ?= "u-boot.${UBOOT_SUFFIX} MLO"
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/edgerouter.conf b/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/edgerouter.conf
new file mode 100644
index 000000000..6343dfc38
--- /dev/null
+++ b/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/edgerouter.conf
@@ -0,0 +1,22 @@
+#@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.4%"
+
+SERIAL_CONSOLE = "115200 ttyS0"
+USE_VT ?= "0"
+
+MACHINE_EXTRA_RRECOMMENDS = " kernel-modules"
+
+IMAGE_FSTYPES ?= "jffs2 tar.bz2"
+JFFS2_ERASEBLOCK = "0x10000"
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/genericx86-64.conf b/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/genericx86-64.conf
new file mode 100644
index 000000000..f76e35af6
--- /dev/null
+++ b/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/genericx86-64.conf
@@ -0,0 +1,8 @@
+#@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
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/genericx86.conf b/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/genericx86.conf
new file mode 100644
index 000000000..798b62ec2
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/include/genericx86-common.inc b/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/include/genericx86-common.inc
new file mode 100644
index 000000000..16b689de0
--- /dev/null
+++ b/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/include/genericx86-common.inc
@@ -0,0 +1,20 @@
+include conf/machine/include/x86-base.inc
+MACHINE_FEATURES += "wifi efi pcbios"
+
+PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
+PREFERRED_VERSION_linux-yocto ?= "4.4%"
+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"
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/mpc8315e-rdb.conf b/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/mpc8315e-rdb.conf
new file mode 100644
index 000000000..f3ad12d98
--- /dev/null
+++ b/import-layers/yocto-poky/meta-yocto-bsp/conf/machine/mpc8315e-rdb.conf
@@ -0,0 +1,33 @@
+#@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_mpc8315e-rdb = "MPC8315ERDB_config"
+
+SERIAL_CONSOLE = "115200 ttyS0"
+
+MACHINE_FEATURES = "keyboard pci ext2 ext3 serial"
+
+PREFERRED_VERSION_linux-yocto ?= "4.4%"
+PREFERRED_PROVIDER_virtual/kernel = "linux-yocto"
+
+PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
+XSERVER ?= "xserver-xorg \
+ xf86-input-evdev \
+ xf86-video-fbdev"
+
+PREFERRED_VERSION_u-boot ?= "v2013.07%"
+UBOOT_ENTRYPOINT = "0x00000000"
+
+KERNEL_DEVICETREE = "mpc8315erdb.dtb"
+
+MACHINE_EXTRA_RRECOMMENDS = " kernel-modules"
+
+IMAGE_FSTYPES ?= "jffs2 tar.bz2"
+JFFS2_ERASEBLOCK = "0x4000"
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/lib/oeqa/controllers/__init__.py b/import-layers/yocto-poky/meta-yocto-bsp/lib/oeqa/controllers/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta-yocto-bsp/lib/oeqa/controllers/__init__.py
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/lib/oeqa/controllers/beaglebonetarget.py b/import-layers/yocto-poky/meta-yocto-bsp/lib/oeqa/controllers/beaglebonetarget.py
new file mode 100644
index 000000000..0f1aeb398
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-yocto-bsp/lib/oeqa/controllers/edgeroutertarget.py b/import-layers/yocto-poky/meta-yocto-bsp/lib/oeqa/controllers/edgeroutertarget.py
new file mode 100644
index 000000000..b3338ca85
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-yocto-bsp/lib/oeqa/controllers/grubtarget.py b/import-layers/yocto-poky/meta-yocto-bsp/lib/oeqa/controllers/grubtarget.py
new file mode 100644
index 000000000..7bc807d2b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-yocto-bsp/lib/oeqa/selftest/__init__.py b/import-layers/yocto-poky/meta-yocto-bsp/lib/oeqa/selftest/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta-yocto-bsp/lib/oeqa/selftest/__init__.py
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/lib/oeqa/selftest/gummiboot.py b/import-layers/yocto-poky/meta-yocto-bsp/lib/oeqa/selftest/gummiboot.py
new file mode 100644
index 000000000..00aa36f60
--- /dev/null
+++ b/import-layers/yocto-poky/meta-yocto-bsp/lib/oeqa/selftest/gummiboot.py
@@ -0,0 +1,83 @@
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu
+from oeqa.utils.decorators import testcase
+import re
+import os
+import sys
+import logging
+
+
+class Gummiboot(oeSelfTest):
+
+ def _common_setup(self):
+ """
+ Common setup for test cases: 1101, 1103
+ """
+
+ # Set EFI_PROVIDER = "gummiboot" and MACHINE = "genericx86-64" in conf/local.conf
+ features = 'EFI_PROVIDER = "gummiboot"\n'
+ features += 'MACHINE = "genericx86-64"'
+ self.append_config(features)
+
+ def _common_build(self):
+ """
+ Common build for test cases: 1101, 1103
+ """
+
+ # Build a genericx86-64/efi gummiboot image
+ bitbake('syslinux syslinux-native parted-native dosfstools-native mtools-native core-image-minimal')
+
+
+ @testcase(1101)
+ def test_efi_gummiboot_images_can_be_built(self):
+ """
+ Summary: Check if efi/gummiboot images can be built
+ Expected: 1. File gummibootx64.efi should be available in build/tmp/deploy/images/genericx86-64
+ 2. Efi/gummiboot images can be built
+ Product: oe-core
+ Author: Ionut Chisanovici <ionutx.chisanovici@intel.com>
+ AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@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
+ gummibootfile = os.path.join(get_bb_var('DEPLOY_DIR'), 'images', 'genericx86-64', 'gummibootx64.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 gummiboot')
+ runCmd('rm -f %s' % gummibootfile)
+
+ self._common_build()
+
+ found = os.path.isfile(gummibootfile)
+ self.assertTrue(found, 'Gummiboot file %s not found' % gummibootfile)
+
+ @testcase(1103)
+ def test_wic_command_can_create_efi_gummiboot_installation_images(self):
+ """
+ Summary: Check that wic command can create efi/gummiboot installation images
+ Expected: A .direct file in folder /var/tmp/wic/ must be created.
+ Product: oe-core
+ Author: Ionut Chisanovici <ionutx.chisanovici@intel.com>
+ AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+ """
+
+ self._common_setup()
+ self._common_build()
+
+ # Create efi/gummiboot installation images
+ wic_create_cmd = 'wic create mkgummidisk -e core-image-minimal'
+ result = runCmd(wic_create_cmd)
+
+ # Find file written by wic from output
+ res = re.search('(/var/tmp/wic/.*\.direct)', result.output)
+ if res:
+ direct_file = res.group(1)
+ # Check it actually exists
+ if not os.path.exists(direct_file):
+ self.fail('wic reported direct file "%s" does not exist; wic output:\n%s' % (direct_file, result.output))
+ else:
+ self.fail('No .direct file reported in wic output:\n%s' % result.output)
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/lib/oeqa/yoctobsp.py b/import-layers/yocto-poky/meta-yocto-bsp/lib/oeqa/yoctobsp.py
new file mode 100644
index 000000000..4c539a1f3
--- /dev/null
+++ b/import-layers/yocto-poky/meta-yocto-bsp/lib/oeqa/yoctobsp.py
@@ -0,0 +1,39 @@
+import unittest
+import os
+import logging
+import tempfile
+import shutil
+
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd
+from oeqa.utils.decorators import skipUnlessPassed
+
+class YoctoBSP(oeSelfTest):
+
+ @classmethod
+ def setUpClass(self):
+ result = runCmd("yocto-bsp list karch")
+ self.karchs = [karch.lstrip() for karch in result.output.splitlines()][1:]
+
+ def test_yoctobsp_listproperties(self):
+ for karch in self.karchs:
+ result = runCmd("yocto-bsp list %s properties" % karch)
+ self.assertEqual(0, result.status, msg="Properties from %s architecture could not be listed" % karch)
+
+ def test_yoctobsp_create(self):
+ # Generate a temporal file and folders for each karch
+ json = "{\"use_default_kernel\":\"yes\"}\n"
+ fd = tempfile.NamedTemporaryFile(delete=False)
+ fd.write(json)
+ fd.close()
+ tmpfolders = dict([(karch, tempfile.mkdtemp()) for karch in self.karchs])
+ # Create BSP
+ for karch in self.karchs:
+ result = runCmd("yocto-bsp create test %s -o %s -i %s" % (karch, "%s/unitest" % tmpfolders[karch], fd.name))
+ self.assertEqual(0, result.status, msg="Could not create a BSP with architecture %s using %s " % (karch, fd.name))
+ # Remove tmp file/folders
+ os.unlink(fd.name)
+ self.assertFalse(os.path.exists(fd.name), msg = "Temporal file %s could not be removed" % fd.name)
+ for tree in tmpfolders.values():
+ shutil.rmtree(tree)
+ self.assertFalse(os.path.exists(tree), msg = "Temporal folder %s could not be removed" % tree)
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/recipes-bsp/formfactor/formfactor/beaglebone/machconfig b/import-layers/yocto-poky/meta-yocto-bsp/recipes-bsp/formfactor/formfactor/beaglebone/machconfig
new file mode 100644
index 000000000..ffce01227
--- /dev/null
+++ b/import-layers/yocto-poky/meta-yocto-bsp/recipes-bsp/formfactor/formfactor/beaglebone/machconfig
@@ -0,0 +1,3 @@
+# Assume a USB mouse and keyboard are connected
+HAVE_TOUCHSCREEN=0
+HAVE_KEYBOARD=1
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/recipes-bsp/formfactor/formfactor/genericx86-64/machconfig b/import-layers/yocto-poky/meta-yocto-bsp/recipes-bsp/formfactor/formfactor/genericx86-64/machconfig
new file mode 100644
index 000000000..a81a23bf5
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-yocto-bsp/recipes-bsp/formfactor/formfactor/genericx86/machconfig b/import-layers/yocto-poky/meta-yocto-bsp/recipes-bsp/formfactor/formfactor/genericx86/machconfig
new file mode 100644
index 000000000..a81a23bf5
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta-yocto-bsp/recipes-bsp/formfactor/formfactor_0.0.bbappend b/import-layers/yocto-poky/meta-yocto-bsp/recipes-bsp/formfactor/formfactor_0.0.bbappend
new file mode 100644
index 000000000..72d991c7e
--- /dev/null
+++ b/import-layers/yocto-poky/meta-yocto-bsp/recipes-bsp/formfactor/formfactor_0.0.bbappend
@@ -0,0 +1 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check/gma500-gfx-check.conf b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check/gma500-gfx-check.sh b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check_1.0.bb b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta-yocto-bsp/recipes-core/packagegroups/packagegroup-core-tools-profile.bbappend b/import-layers/yocto-poky/meta-yocto-bsp/recipes-core/packagegroups/packagegroup-core-tools-profile.bbappend
new file mode 100644
index 000000000..f86595c00
--- /dev/null
+++ b/import-layers/yocto-poky/meta-yocto-bsp/recipes-core/packagegroups/packagegroup-core-tools-profile.bbappend
@@ -0,0 +1,2 @@
+RDEPENDS_${PN}_append_genericx86 = " lttng-ust systemtap"
+
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/recipes-core/uclibc/uclibc/genericx86-64/uClibc.machine b/import-layers/yocto-poky/meta-yocto-bsp/recipes-core/uclibc/uclibc/genericx86-64/uClibc.machine
new file mode 100644
index 000000000..305dc64de
--- /dev/null
+++ b/import-layers/yocto-poky/meta-yocto-bsp/recipes-core/uclibc/uclibc/genericx86-64/uClibc.machine
@@ -0,0 +1,69 @@
+#
+# Automatically generated make config: don't edit
+# Fri Nov 23 15:49:33 2007
+#
+# TARGET_alpha is not set
+# TARGET_arm is not set
+# TARGET_bfin is not set
+# TARGET_cris is not set
+# TARGET_e1 is not set
+# TARGET_frv is not set
+# TARGET_h8300 is not set
+# TARGET_hppa is not set
+# TARGET_i386=y
+# TARGET_i960 is not set
+# TARGET_ia64 is not set
+# TARGET_m68k is not set
+# TARGET_microblaze is not set
+# TARGET_mips is not set
+# TARGET_nios is not set
+# TARGET_nios2 is not set
+# TARGET_powerpc is not set
+# TARGET_sh is not set
+# TARGET_sh64 is not set
+# TARGET_sparc is not set
+# TARGET_v850 is not set
+# TARGET_vax is not set
+TARGET_x86_64=y
+
+#
+# Target Architecture Features and Options
+#
+TARGET_ARCH="x86_64"
+FORCE_OPTIONS_FOR_ARCH=y
+# CONFIG_GENERIC_386 is not set
+# CONFIG_386 is not set
+# CONFIG_486 is not set
+# CONFIG_586 is not set
+# CONFIG_586MMX is not set
+# CONFIG_686 is not set
+# CONFIG_PENTIUMII is not set
+# CONFIG_PENTIUMIII is not set
+# CONFIG_PENTIUM4 is not set
+# CONFIG_K6 is not set
+# CONFIG_K7 is not set
+# CONFIG_ELAN is not set
+# CONFIG_CRUSOE is not set
+# CONFIG_WINCHIPC6 is not set
+# CONFIG_WINCHIP2 is not set
+# CONFIG_CYRIXIII is not set
+# CONFIG_NEHEMIAH is not set
+TARGET_SUBARCH=""
+
+#
+# Using ELF file format
+#
+ARCH_LITTLE_ENDIAN=y
+
+#
+# Using Little Endian
+#
+ARCH_HAS_MMU=y
+ARCH_USE_MMU=y
+UCLIBC_HAS_FLOATS=y
+UCLIBC_HAS_FPU=y
+DO_C99_MATH=y
+KERNEL_HEADERS="/usr/include"
+HAVE_DOT_CONFIG=y
+
+UCLIBC_HAS_FENV=y
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/recipes-core/uclibc/uclibc/genericx86/uClibc.machine b/import-layers/yocto-poky/meta-yocto-bsp/recipes-core/uclibc/uclibc/genericx86/uClibc.machine
new file mode 100644
index 000000000..5df15f94c
--- /dev/null
+++ b/import-layers/yocto-poky/meta-yocto-bsp/recipes-core/uclibc/uclibc/genericx86/uClibc.machine
@@ -0,0 +1,69 @@
+#
+# Automatically generated make config: don't edit
+# Fri Nov 23 15:49:33 2007
+#
+# TARGET_alpha is not set
+# TARGET_arm is not set
+# TARGET_bfin is not set
+# TARGET_cris is not set
+# TARGET_e1 is not set
+# TARGET_frv is not set
+# TARGET_h8300 is not set
+# TARGET_hppa is not set
+TARGET_i386=y
+# TARGET_i960 is not set
+# TARGET_ia64 is not set
+# TARGET_m68k is not set
+# TARGET_microblaze is not set
+# TARGET_mips is not set
+# TARGET_nios is not set
+# TARGET_nios2 is not set
+# TARGET_powerpc is not set
+# TARGET_sh is not set
+# TARGET_sh64 is not set
+# TARGET_sparc is not set
+# TARGET_v850 is not set
+# TARGET_vax is not set
+# TARGET_x86_64 is not set
+
+#
+# Target Architecture Features and Options
+#
+TARGET_ARCH="i386"
+FORCE_OPTIONS_FOR_ARCH=y
+CONFIG_GENERIC_386=y
+# CONFIG_386 is not set
+# CONFIG_486 is not set
+# CONFIG_586 is not set
+# CONFIG_586MMX is not set
+# CONFIG_686 is not set
+# CONFIG_PENTIUMII is not set
+# CONFIG_PENTIUMIII is not set
+# CONFIG_PENTIUM4 is not set
+# CONFIG_K6 is not set
+# CONFIG_K7 is not set
+# CONFIG_ELAN is not set
+# CONFIG_CRUSOE is not set
+# CONFIG_WINCHIPC6 is not set
+# CONFIG_WINCHIP2 is not set
+# CONFIG_CYRIXIII is not set
+# CONFIG_NEHEMIAH is not set
+TARGET_SUBARCH=""
+
+#
+# Using ELF file format
+#
+ARCH_LITTLE_ENDIAN=y
+
+#
+# Using Little Endian
+#
+ARCH_HAS_MMU=y
+ARCH_USE_MMU=y
+UCLIBC_HAS_FLOATS=y
+UCLIBC_HAS_FPU=y
+DO_C99_MATH=y
+KERNEL_HEADERS="/usr/include"
+HAVE_DOT_CONFIG=y
+
+UCLIBC_HAS_FENV=y
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/recipes-core/uclibc/uclibc_git.bbappend b/import-layers/yocto-poky/meta-yocto-bsp/recipes-core/uclibc/uclibc_git.bbappend
new file mode 100644
index 000000000..72d991c7e
--- /dev/null
+++ b/import-layers/yocto-poky/meta-yocto-bsp/recipes-core/uclibc/uclibc_git.bbappend
@@ -0,0 +1 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config/genericx86-64/xorg.conf b/import-layers/yocto-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/import-layers/yocto-poky/meta-yocto-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config/genericx86-64/xorg.conf
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config/genericx86/xorg.conf b/import-layers/yocto-poky/meta-yocto-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config/genericx86/xorg.conf
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta-yocto-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config/genericx86/xorg.conf
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend b/import-layers/yocto-poky/meta-yocto-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend
new file mode 100644
index 000000000..72d991c7e
--- /dev/null
+++ b/import-layers/yocto-poky/meta-yocto-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend
@@ -0,0 +1 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.1.bbappend b/import-layers/yocto-poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.1.bbappend
new file mode 100644
index 000000000..b20a18bfe
--- /dev/null
+++ b/import-layers/yocto-poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.1.bbappend
@@ -0,0 +1,23 @@
+KBRANCH_genericx86 = "standard/base"
+KBRANCH_genericx86-64 = "standard/base"
+KBRANCH_edgerouter = "standard/edgerouter"
+KBRANCH_beaglebone = "standard/beaglebone"
+KBRANCH_mpc8315e-rdb = "standard/fsl-mpc8315e-rdb"
+
+KMACHINE_genericx86 ?= "common-pc"
+KMACHINE_genericx86-64 ?= "common-pc-64"
+
+SRCREV_machine_genericx86 ?= "304caa9480f19875e717faf3cad8cb7ecd758733"
+SRCREV_machine_genericx86-64 ?= "304caa9480f19875e717faf3cad8cb7ecd758733"
+SRCREV_machine_edgerouter ?= "79a31b9d23db126f8a6be3eb88fd683056a213f1"
+SRCREV_machine_beaglebone ?= "efb6ffb2ca96a364f916c9890ad023fc595e0e6e"
+SRCREV_machine_mpc8315e-rdb ?= "79a31b9d23db126f8a6be3eb88fd683056a213f1"
+
+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.1.18"
+LINUX_VERSION_genericx86-64 = "4.1.18"
diff --git a/import-layers/yocto-poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.4.bbappend b/import-layers/yocto-poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.4.bbappend
new file mode 100644
index 000000000..e31b0c8f2
--- /dev/null
+++ b/import-layers/yocto-poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.4.bbappend
@@ -0,0 +1,23 @@
+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 ?= "3d2455f9da30f923c6bd69014fad4cc4ea738be6"
+SRCREV_machine_genericx86-64 ?= "3d2455f9da30f923c6bd69014fad4cc4ea738be6"
+SRCREV_machine_edgerouter ?= "ff4c4ef15b51f45b9106d71bf1f62fe7c02e63c2"
+SRCREV_machine_beaglebone ?= "ff4c4ef15b51f45b9106d71bf1f62fe7c02e63c2"
+SRCREV_machine_mpc8315e-rdb ?= "df00877ef9387b38b9601c82db57de2a1b23ce53"
+
+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.4.3"
+LINUX_VERSION_genericx86-64 = "4.4.3"
diff --git a/import-layers/yocto-poky/meta-yocto/conf/layer.conf b/import-layers/yocto-poky/meta-yocto/conf/layer.conf
new file mode 100644
index 000000000..9ed30ed1f
--- /dev/null
+++ b/import-layers/yocto-poky/meta-yocto/conf/layer.conf
@@ -0,0 +1,2 @@
+# Dummy file to allow for meta-yocto -> meta-poky transition
+BBPATH =. "${LAYERDIR}/../meta-poky:"
diff --git a/import-layers/yocto-poky/meta/COPYING.GPLv2 b/import-layers/yocto-poky/meta/COPYING.GPLv2
new file mode 100644
index 000000000..d511905c1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/COPYING.MIT b/import-layers/yocto-poky/meta/COPYING.MIT
new file mode 100644
index 000000000..fb950dc69
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/classes/allarch.bbclass b/import-layers/yocto-poky/meta/classes/allarch.bbclass
new file mode 100644
index 000000000..208cde6e5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/allarch.bbclass
@@ -0,0 +1,47 @@
+#
+# This class is used for architecture independent recipes/data files (usually scripts)
+#
+
+# Expand STAGING_DIR_HOST since for cross-canadian/native/nativesdk, this will
+# point elsewhere after these changes.
+STAGING_DIR_HOST := "${STAGING_DIR_HOST}"
+
+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", True) == "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("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", "")
+ d.setVar("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")
+
+ # 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")
+ 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", True))
+}
+
diff --git a/import-layers/yocto-poky/meta/classes/archiver.bbclass b/import-layers/yocto-poky/meta/classes/archiver.bbclass
new file mode 100644
index 000000000..2f3b278fb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/archiver.bbclass
@@ -0,0 +1,395 @@
+# 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}"
+do_deploy_all_archives[dirs] = "${WORKDIR}"
+
+# This is a convenience for the shell script to use it
+
+
+python () {
+ pn = d.getVar('PN', True)
+ assume_provided = (d.getVar("ASSUME_PROVIDED", True) or "").split()
+ if pn in assume_provided:
+ for p in d.getVar("PROVIDES", True).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))
+
+ # We just archive gcc-source for all the gcc related recipes
+ if d.getVar('BPN', True) 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', True)
+ ar_dumpdata = d.getVarFlag('ARCHIVER_MODE', 'dumpdata', True)
+ ar_recipe = d.getVarFlag('ARCHIVER_MODE', 'recipe', True)
+
+ if ar_src == "original":
+ d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_ar_original' % 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
+ ar_srpm = d.getVarFlag('ARCHIVER_MODE', 'srpm', True)
+ if ar_srpm == "1":
+ if d.getVar('PACKAGES', True) != '' and d.getVar('IMAGE_PKGTYPE', True) == 'rpm':
+ 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)
+}
+
+# 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, tarfile, tempfile
+
+ if d.getVarFlag('ARCHIVER_MODE', 'src', True) != "original":
+ return
+
+ ar_outdir = d.getVar('ARCHIVER_OUTDIR', True)
+ bb.note('Archiving the original source...')
+ fetch = bb.fetch2.Fetch([], d)
+ 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', True))
+ fetch.unpack(tmpdir, (url,))
+ create_tarball(d, tmpdir + '/.', '', 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', True) != 'patched':
+ return
+
+ # Get the ARCHIVER_OUTDIR before we reset the WORKDIR
+ ar_outdir = d.getVar('ARCHIVER_OUTDIR', True)
+ ar_workdir = d.getVar('ARCHIVER_WORKDIR', True)
+ bb.note('Archiving the patched source...')
+ d.setVar('WORKDIR', ar_workdir)
+ create_tarball(d, d.getVar('S', True), 'patched', ar_outdir)
+}
+
+python do_ar_configured() {
+ import shutil
+
+ ar_outdir = d.getVar('ARCHIVER_OUTDIR', True)
+ if d.getVarFlag('ARCHIVER_MODE', 'src', True) == 'configured':
+ bb.note('Archiving the configured source...')
+ pn = d.getVar('PN', True)
+ # "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', True))
+ 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', True))
+ 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', True)
+ 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', True)
+ for func in (postfuncs or '').split():
+ if func != "do_qa_configure":
+ bb.build.exec_func(func, d)
+ srcdir = d.getVar('S', True)
+ builddir = d.getVar('B', True)
+ if srcdir != builddir:
+ if os.path.exists(builddir):
+ oe.path.copytree(builddir, os.path.join(srcdir, \
+ 'build.%s.ar_configured' % d.getVar('PF', True)))
+ 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', True) == ""):
+ return
+
+ bb.utils.mkdirhier(ar_outdir)
+ if suffix:
+ filename = '%s-%s.tar.gz' % (d.getVar('PF', True), suffix)
+ else:
+ filename = '%s.tar.gz' % d.getVar('PF', True)
+ tarname = os.path.join(ar_outdir, filename)
+
+ srcdir = srcdir.rstrip('/')
+ dirname = os.path.dirname(srcdir)
+ basename = os.path.basename(srcdir)
+ os.chdir(dirname)
+ bb.note('Creating %s' % tarname)
+ tar = tarfile.open(tarname, 'w:gz')
+ tar.add(basename)
+ 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', True).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)
+ os.chdir(dirname)
+ out_file = os.path.join(ar_outdir, '%s-diff.gz' % d.getVar('PF', True))
+ diff_cmd = 'diff -Naur %s.orig %s.patched | gzip -c > %s' % (basename, basename, out_file)
+ subprocess.call(diff_cmd, shell=True)
+ bb.utils.remove(src_patched, recurse=True)
+
+# Run do_unpack and do_patch
+python do_unpack_and_patch() {
+ if d.getVarFlag('ARCHIVER_MODE', 'src', True) not in \
+ [ 'patched', 'configured'] and \
+ d.getVarFlag('ARCHIVER_MODE', 'diff', True) != '1':
+ return
+ ar_outdir = d.getVar('ARCHIVER_OUTDIR', True)
+ ar_workdir = d.getVar('ARCHIVER_WORKDIR', True)
+
+ # The kernel class functions require it to be on work-shared, so we dont change WORKDIR
+ if not bb.data.inherits_class('kernel-yocto', d):
+ # Change the WORKDIR to make do_unpack do_patch run in another dir.
+ d.setVar('WORKDIR', ar_workdir)
+
+ # 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', True))
+
+ bb.build.exec_func('do_unpack', d)
+
+ # Save the original source for creating the patches
+ if d.getVarFlag('ARCHIVER_MODE', 'diff', True) == '1':
+ src = d.getVar('S', True).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', True) == "" or bb.data.inherits_class('kernel-yocto', d))):
+ bb.build.exec_func('do_patch', d)
+
+ # Create the patches
+ if d.getVarFlag('ARCHIVER_MODE', 'diff', True) == '1':
+ bb.note('Creating diff gz...')
+ create_diff_gz(d, src_orig, src, ar_outdir)
+ bb.utils.remove(src_orig, recurse=True)
+}
+
+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', True)
+ outdir = os.path.join(d.getVar('WORKDIR', True), \
+ '%s-recipe' % d.getVar('PF', True))
+ bb.utils.mkdirhier(outdir)
+ shutil.copy(bbfile, outdir)
+
+ pn = d.getVar('PN', True)
+ bbappend_files = d.getVar('BBINCLUDED', True).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$" %pn)
+ bbappend_re1 = re.compile( r".*/%s\.bbappend$" %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', True))
+ 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 = bb.data.expand(incfile, d)
+ incfile = bb.utils.which(bbpath, incfile)
+ if incfile:
+ shutil.copy(incfile, outdir)
+
+ create_tarball(d, outdir, 'recipe', d.getVar('ARCHIVER_OUTDIR', True))
+ bb.utils.remove(outdir, recurse=True)
+}
+
+python do_dumpdata () {
+ """
+ dump environment data to ${PF}-showdata.dump
+ """
+
+ dumpfile = os.path.join(d.getVar('ARCHIVER_OUTDIR', True), \
+ '%s-showdata.dump' % d.getVar('PF', True))
+ 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
+
+addtask do_deploy_all_archives after do_deploy_archives
+do_deploy_all_archives[recrdeptask] = "do_deploy_archives"
+do_deploy_all_archives[recideptask] = "do_${BB_DEFAULT_TASK}"
+do_deploy_all_archives() {
+ :
+}
+
+python () {
+ # Add tasks in the correct order, specifically for linux-yocto to avoid race condition
+ if bb.data.inherits_class('kernel-yocto', d):
+ bb.build.addtask('do_kernel_configme', 'do_configure', 'do_unpack_and_patch', d)
+}
diff --git a/import-layers/yocto-poky/meta/classes/autotools-brokensep.bbclass b/import-layers/yocto-poky/meta/classes/autotools-brokensep.bbclass
new file mode 100644
index 000000000..71cf97a39
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/classes/autotools.bbclass b/import-layers/yocto-poky/meta/classes/autotools.bbclass
new file mode 100644
index 000000000..6649f5df7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/autotools.bbclass
@@ -0,0 +1,322 @@
+def autotools_dep_prepend(d):
+ if d.getVar('INHIBIT_AUTOTOOLS_DEPS', True):
+ return ''
+
+ pn = d.getVar('PN', True)
+ 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', True):
+ deps += 'libtool-cross '
+
+ return deps + 'gnu-config-native '
+
+EXTRA_OEMAKE = ""
+
+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, False)}"
+
+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"
+
+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=`python -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 ??= ""
+
+do_configure[prefuncs] += "autotools_preconfigure autotools_copy_aclocals ${EXTRACONFFUNCS}"
+do_configure[postfuncs] += "autotools_postconfigure"
+
+ACLOCALDIR = "${B}/aclocal-copy"
+
+python autotools_copy_aclocals () {
+ s = d.getVar("AUTOTOOLS_SCRIPT_PATH", True)
+ if not os.path.exists(s + "/configure.in") and not os.path.exists(s + "/configure.ac"):
+ if not d.getVar("AUTOTOOLS_COPYACLOCAL", False):
+ return
+
+ taskdepdata = d.getVar("BB_TASKDEPDATA", False)
+ #bb.warn(str(taskdepdata))
+ pn = d.getVar("PN", True)
+ aclocaldir = d.getVar("ACLOCALDIR", True)
+ oe.path.remove(aclocaldir)
+ bb.utils.mkdirhier(aclocaldir)
+ start = None
+ configuredeps = []
+ # Detect bitbake -b usage
+ # Everything but quilt-native would have dependencies
+ nodeps = (pn != "quilt-native")
+
+ for dep in taskdepdata:
+ data = taskdepdata[dep]
+ if data[1] == "do_configure" and data[0] == pn:
+ start = dep
+ if not nodeps and start:
+ break
+ if nodeps and data[0] != pn:
+ nodeps = False
+ if start is None:
+ bb.fatal("Couldn't find ourself in BB_TASKDEPDATA?")
+
+ # We need to find configure tasks which are either from <target> -> <target>
+ # or <native> -> <native> but not <target> -> <native> unless they're direct
+ # dependencies. This mirrors what would get restored from sstate.
+ done = [start]
+ next = [start]
+ while next:
+ new = []
+ for dep in next:
+ data = taskdepdata[dep]
+ for datadep in data[3]:
+ if datadep in done:
+ continue
+ if (not data[0].endswith("-native")) and taskdepdata[datadep][0].endswith("-native") and dep != start:
+ continue
+ done.append(datadep)
+ new.append(datadep)
+ if taskdepdata[datadep][1] == "do_configure":
+ configuredeps.append(taskdepdata[datadep][0])
+ next = new
+
+ #configuredeps2 = []
+ #for dep in taskdepdata:
+ # data = taskdepdata[dep]
+ # if data[1] == "do_configure" and data[0] != pn:
+ # configuredeps2.append(data[0])
+ #configuredeps.sort()
+ #configuredeps2.sort()
+ #bb.warn(str(configuredeps))
+ #bb.warn(str(configuredeps2))
+
+ cp = []
+ if nodeps:
+ bb.warn("autotools: Unable to find task dependencies, -b being used? Pulling in all m4 files")
+ for l in [d.expand("${STAGING_DATADIR_NATIVE}/aclocal/"), d.expand("${STAGING_DATADIR}/aclocal/")]:
+ cp.extend(os.path.join(l, f) for f in os.listdir(l))
+
+ for c in configuredeps:
+ if c.endswith("-native"):
+ manifest = d.expand("${SSTATE_MANIFESTS}/manifest-${BUILD_ARCH}-%s.populate_sysroot" % c)
+ elif c.startswith("nativesdk-"):
+ manifest = d.expand("${SSTATE_MANIFESTS}/manifest-${SDK_ARCH}_${SDK_OS}-%s.populate_sysroot" % c)
+ elif "-cross-" in c or "-crosssdk" in c:
+ continue
+ else:
+ manifest = d.expand("${SSTATE_MANIFESTS}/manifest-${MACHINE}-%s.populate_sysroot" % c)
+ try:
+ f = open(manifest, "r")
+ for l in f:
+ if "/aclocal/" in l and l.strip().endswith(".m4"):
+ cp.append(l.strip())
+ elif "config_site.d/" in l:
+ cp.append(l.strip())
+ except:
+ bb.warn("%s not found" % manifest)
+
+ for c in cp:
+ t = os.path.join(aclocaldir, os.path.basename(c))
+ if not os.path.exists(t):
+ os.symlink(c, t)
+
+ d.setVar("CONFIG_SITE", siteinfo_get_files(d, False))
+}
+autotools_copy_aclocals[vardepsexclude] += "MACHINE SDK_ARCH BUILD_ARCH SDK_OS BB_TASKDEPDATA"
+
+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.
+ 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}
+ 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' | grep -v 'aclocal-copy' | sed -e 's,\(.*/\).*$,\1,'|sort -u`; do
+ acpaths="$acpaths -I $i"
+ done
+ else
+ acpaths="${acpaths}"
+ fi
+ 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 "^[[:space:]]*AM_GLIB_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then
+ if grep "sed.*POTFILES" $CONFIGURE_AC >/dev/null; 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 grep "^[[:space:]]*AM_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; 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
+ for i in gettext.m4 iconv.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4; do
+ for j in `find ${S} -ignore_readdir_race -name $i | grep -v aclocal-copy`; do
+ rm $j
+ done
+ done
+ fi
+ mkdir -p m4
+ if grep "^[[:space:]]*[AI][CT]_PROG_INTLTOOL" $CONFIGURE_AC >/dev/null; then
+ bbnote Executing intltoolize --copy --force --automake
+ intltoolize --copy --force --automake
+ fi
+ 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_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_install
+
+B = "${WORKDIR}/build"
diff --git a/import-layers/yocto-poky/meta/classes/base.bbclass b/import-layers/yocto-poky/meta/classes/base.bbclass
new file mode 100644
index 000000000..a7ca3a667
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/base.bbclass
@@ -0,0 +1,667 @@
+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.data oe.package oe.packagegroup oe.sstatesig oe.lsb oe.cachedpath"
+OE_IMPORTS[type] = "list"
+
+def oe_import(d):
+ import sys
+
+ bbpath = d.getVar("BBPATH", True).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', True)
+ 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):
+ #
+ # Ideally this will check a flag so we will operate properly in
+ # the case where host == build == target, for now we don't work in
+ # that case though.
+ #
+
+ deps = ""
+ # 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', False):
+ if (d.getVar('HOST_SYS', True) != d.getVar('BUILD_SYS', True)):
+ deps += " virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}compilerlibs virtual/libc "
+ return deps
+
+BASEDEPENDS = "${@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', True))}"
+
+def extra_path_elements(d):
+ path = ""
+ elements = (d.getVar('EXTRANATIVEPATH', True) 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", True) or ''
+ tmpdir = d.getVar("TMPDIR", True)
+
+ 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 path[0] == '/':
+ if path.startswith(tmpdir):
+ continue
+ filelist.append(path + ":" + str(os.path.exists(path)))
+ except bb.fetch.MalformedUrl:
+ raise bb.build.FuncFailed(d.getVar('PN', True) + ": LIC_FILES_CHKSUM contains an invalid URL: " + url)
+ return " ".join(filelist)
+
+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', True) or "").split()
+ if len(src_uri) == 0:
+ return
+
+ try:
+ fetcher = bb.fetch2.Fetch(src_uri, d)
+ fetcher.download()
+ except bb.fetch2.BBFetchException as e:
+ raise bb.build.FuncFailed(e)
+}
+
+addtask unpack after do_fetch
+do_unpack[dirs] = "${WORKDIR}"
+python base_do_unpack() {
+ src_uri = (d.getVar('SRC_URI', True) or "").split()
+ if len(src_uri) == 0:
+ return
+
+ rootdir = d.getVar('WORKDIR', True)
+
+ # Ensure that we cleanup ${S}/patches
+ # TODO: Investigate if we can remove
+ # the entire ${S} in this case.
+ s_dir = d.getVar('S', True)
+ p_dir = os.path.join(s_dir, 'patches')
+ bb.utils.remove(p_dir, True)
+
+ try:
+ fetcher = bb.fetch2.Fetch(src_uri, d)
+ fetcher.unpack(rootdir)
+ except bb.fetch2.BBFetchException as e:
+ raise bb.build.FuncFailed(e)
+}
+
+def pkgarch_mapping(d):
+ # Compatibility mappings of TUNE_PKGARCH (opt in)
+ if d.getVar("PKGARCHCOMPAT_ARMV7A", True):
+ if d.getVar("TUNE_PKGARCH", True) == "armv7a-vfp-neon":
+ d.setVar("TUNE_PKGARCH", "armv7a")
+
+def get_layers_branch_rev(d):
+ layers = (d.getVar("BBLAYERS", True) or "").split()
+ layers_branch_rev = ["%-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]
+ 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, True)
+ if value is not None:
+ yield '%-17s = "%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, True)
+ 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.BuildStarted bb.event.RecipePreFinalise bb.runqueue.sceneQueueComplete bb.event.RecipeParsed"
+python base_eventhandler() {
+ import bb.runqueue
+
+ if isinstance(e, bb.event.ConfigParsed):
+ if not e.data.getVar("NATIVELSBSTRING", False):
+ e.data.setVar("NATIVELSBSTRING", lsb_distro_identifier(e.data))
+ e.data.setVar('BB_VERSION', bb.__version__)
+ pkgarch_mapping(e.data)
+ oe.utils.features_backfill("DISTRO_FEATURES", e.data)
+ oe.utils.features_backfill("MACHINE_FEATURES", e.data)
+
+ if isinstance(e, bb.event.BuildStarted):
+ localdata = bb.data.createCopy(e.data)
+ bb.data.update_data(localdata)
+ 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 = e.data.getVar('BUILDCFG_HEADER', True)
+ 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 e.data.getVar("TARGET_PREFIX", True) == e.data.getVar("SDK_PREFIX", True):
+ e.data.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}binutils")
+ e.data.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc-initial")
+ e.data.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc")
+ e.data.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}g++")
+ e.data.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}compilerlibs")
+
+ if isinstance(e, bb.runqueue.sceneQueueComplete):
+ completions = e.data.expand("${STAGING_DIR}/sstatecompletions")
+ if os.path.exists(completions):
+ cmds = set()
+ with open(completions, "r") as f:
+ cmds = set(f)
+ e.data.setVar("completion_function", "\n".join(cmds))
+ e.data.setVarFlag("completion_function", "func", "1")
+ bb.debug(1, "Executing SceneQueue Completion commands: %s" % "\n".join(cmds))
+ bb.build.exec_func("completion_function", e.data)
+ 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', True)
+ source_mirror_fetch = d.getVar('SOURCE_MIRROR_FETCH', False)
+ if not source_mirror_fetch:
+ provs = (d.getVar("PROVIDES", True) or "").split()
+ multiwhitelist = (d.getVar("MULTI_PROVIDER_WHITELIST", True) or "").split()
+ for p in provs:
+ if p.startswith("virtual/") and p not in multiwhitelist:
+ profprov = d.getVar("PREFERRED_PROVIDER_" + p, True)
+ if profprov and pn != profprov:
+ raise bb.parse.SkipPackage("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_configure[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] = "${D} ${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", True).split())
+ tos.append(d.getVar("TARGET_OS", True))
+ tvs.append(d.getVar("TARGET_VENDOR", True))
+
+ 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", True) or ""
+ for item in variants.split():
+ localdata = bb.data.createCopy(d)
+ overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
+ localdata.setVar("OVERRIDES", overrides)
+ bb.data.update_data(localdata)
+
+ archs.append(localdata.getVar("PACKAGE_ARCHS", True).split())
+ tos.append(localdata.getVar("TARGET_OS", True))
+ tvs.append(localdata.getVar("TARGET_VENDOR", True))
+
+ settriplet(d, "PKGMLTRIPLETS", archs, tos, tvs)
+
+python () {
+ import string, re
+
+ # Handle PACKAGECONFIG
+ #
+ # These take the form:
+ #
+ # PACKAGECONFIG ??= "<default options>"
+ # PACKAGECONFIG[foo] = "--enable-foo,--disable-foo,foo_depends,foo_runtime_depends"
+ pkgconfigflags = d.getVarFlags("PACKAGECONFIG") or {}
+ if pkgconfigflags:
+ pkgconfig = (d.getVar('PACKAGECONFIG', True) or "").split()
+ pn = d.getVar("PN", True)
+
+ mlprefix = d.getVar("MLPREFIX", True)
+
+ 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 = []
+ extraconf = []
+ for flag, flagval in sorted(pkgconfigflags.items()):
+ items = flagval.split(",")
+ num = len(items)
+ if num > 4:
+ bb.error("%s: PACKAGECONFIG[%s] Only enable,disable,depend,rdepend can be specified!"
+ % (d.getVar('PN', True), 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 >= 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('PACKAGECONFIG_CONFARGS', extraconf)
+
+ # TODO: once all recipes/classes abusing EXTRA_OECONF
+ # to get PACKAGECONFIG options are fixed to use PACKAGECONFIG_CONFARGS
+ # move this appendVar to autotools.bbclass.
+ if not bb.data.inherits_class('cmake', d):
+ appendVar('EXTRA_OECONF', extraconf)
+
+ pn = d.getVar('PN', True)
+ license = d.getVar('LICENSE', True)
+ if license == "INVALID":
+ 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.SkipPackage("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', True)
+ if need_machine:
+ import re
+ compat_machines = (d.getVar('MACHINEOVERRIDES', True) or "").split(":")
+ for m in compat_machines:
+ if re.match(need_machine, m):
+ break
+ else:
+ raise bb.parse.SkipPackage("incompatible with machine %s (not in COMPATIBLE_MACHINE)" % d.getVar('MACHINE', True))
+
+ source_mirror_fetch = d.getVar('SOURCE_MIRROR_FETCH', 0)
+ if not source_mirror_fetch:
+ need_host = d.getVar('COMPATIBLE_HOST', True)
+ if need_host:
+ import re
+ this_host = d.getVar('HOST_SYS', True)
+ if not re.match(need_host, this_host):
+ raise bb.parse.SkipPackage("incompatible with host %s (not in COMPATIBLE_HOST)" % this_host)
+
+ bad_licenses = (d.getVar('INCOMPATIBLE_LICENSE', True) or "").split()
+
+ check_license = False if pn.startswith("nativesdk-") else True
+ for t in ["-native", "-cross-${TARGET_ARCH}", "-cross-initial-${TARGET_ARCH}",
+ "-crosssdk-${SDK_ARCH}", "-crosssdk-initial-${SDK_ARCH}",
+ "-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, True) or "").split())
+ if spdx_license:
+ whitelist.extend((d.getVar(w + spdx_license, True) 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, True) or "").split())
+ if spdx_license:
+ incompatwl.extend((d.getVar(w + spdx_license, True) or "").split())
+
+ if not pn in whitelist:
+ pkgs = d.getVar('PACKAGES', True).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', True)
+ 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.SkipPackage("incompatible with 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")
+
+ needsrcrev = False
+ srcuri = d.getVar('SRC_URI', True)
+ 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')
+
+ # 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'):
+ d.appendVarFlag('do_unpack', 'depends', ' xz-native:do_populate_sysroot')
+
+ # .zip should DEPEND on unzip-native for unpacking
+ elif path.endswith('.zip'):
+ d.appendVarFlag('do_unpack', 'depends', ' unzip-native:do_populate_sysroot')
+
+ # file is needed by rpm2cpio.sh
+ elif path.endswith('.src.rpm'):
+ d.appendVarFlag('do_unpack', 'depends', ' file-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', True)
+ pkg_arch = d.getVar('PACKAGE_ARCH', True)
+
+ 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', True)
+ if override != '0':
+ paths = []
+ fpaths = (d.getVar('FILESPATH', True) or '').split(':')
+ machine = d.getVar('MACHINE', True)
+ 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', True).split()
+ for pkg in packages:
+ pkgarch = d.getVar("PACKAGE_ARCH_%s" % pkg, True)
+
+ # 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", True))
+}
+
+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', True) or "").split()
+ if len(src_uri) == 0:
+ return
+
+ try:
+ fetcher = bb.fetch2.Fetch(src_uri, d)
+ fetcher.clean()
+ except bb.fetch2.BBFetchException, e:
+ raise bb.build.FuncFailed(e)
+}
+do_cleanall[nostamp] = "1"
+
+
+EXPORT_FUNCTIONS do_fetch do_unpack do_configure do_compile do_install do_package
diff --git a/import-layers/yocto-poky/meta/classes/bash-completion.bbclass b/import-layers/yocto-poky/meta/classes/bash-completion.bbclass
new file mode 100644
index 000000000..74a878edf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/bash-completion.bbclass
@@ -0,0 +1,5 @@
+PACKAGES += "${PN}-bash-completion"
+
+FILES_${PN}-bash-completion = "${datadir}/bash-completion ${sysconfdir}/bash_completion.d"
+
+RDEPENDS_${PN}-bash-completion = "bash-completion"
diff --git a/import-layers/yocto-poky/meta/classes/bin_package.bbclass b/import-layers/yocto-poky/meta/classes/bin_package.bbclass
new file mode 100644
index 000000000..a52b75be5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/bin_package.bbclass
@@ -0,0 +1,36 @@
+#
+# 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
+ cd ${S} || exit 1
+ 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/import-layers/yocto-poky/meta/classes/binconfig-disabled.bbclass b/import-layers/yocto-poky/meta/classes/binconfig-disabled.bbclass
new file mode 100644
index 000000000..602a669aa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/binconfig-disabled.bbclass
@@ -0,0 +1,29 @@
+#
+# 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
+ 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/import-layers/yocto-poky/meta/classes/binconfig.bbclass b/import-layers/yocto-poky/meta/classes/binconfig.bbclass
new file mode 100644
index 000000000..cbc417360
--- /dev/null
+++ b/import-layers/yocto-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: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}:'"
+ s += " -e 's:-I${WORKDIR}:-I${STAGING_INCDIR}:'"
+ s += " -e 's:-L${WORKDIR}:-L${STAGING_LIBDIR}:'"
+ if bb.data.getVar("OE_BINCONFIG_EXTRA_MANGLE", d):
+ s += bb.data.getVar("OE_BINCONFIG_EXTRA_MANGLE", d)
+
+ 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/import-layers/yocto-poky/meta/classes/blacklist.bbclass b/import-layers/yocto-poky/meta/classes/blacklist.bbclass
new file mode 100644
index 000000000..a0141a82c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/blacklist.bbclass
@@ -0,0 +1,45 @@
+# 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"
+#
+
+# Cope with PNBLACKLIST flags for multilib case
+addhandler blacklist_multilib_eventhandler
+blacklist_multilib_eventhandler[eventmask] = "bb.event.ConfigParsed"
+python blacklist_multilib_eventhandler() {
+ multilibs = e.data.getVar('MULTILIBS', True)
+ if not multilibs:
+ return
+
+ # this block has been copied from base.bbclass so keep it in sync
+ prefixes = []
+ for ext in multilibs.split():
+ eext = ext.split(':')
+ if len(eext) > 1 and eext[0] == 'multilib':
+ prefixes.append(eext[1])
+
+ blacklists = e.data.getVarFlags('PNBLACKLIST') or {}
+ for pkg, reason in blacklists.items():
+ if pkg.endswith(("-native", "-crosssdk")) or pkg.startswith(("nativesdk-", "virtual/nativesdk-")) or 'cross-canadian' in pkg:
+ continue
+ for p in prefixes:
+ newpkg = p + "-" + pkg
+ if not e.data.getVarFlag('PNBLACKLIST', newpkg, True):
+ e.data.setVarFlag('PNBLACKLIST', newpkg, reason)
+}
+
+python () {
+ blacklist = d.getVarFlag('PNBLACKLIST', d.getVar('PN', True), True)
+
+ if blacklist:
+ raise bb.parse.SkipPackage("Recipe is blacklisted: %s" % (blacklist))
+}
diff --git a/import-layers/yocto-poky/meta/classes/bluetooth.bbclass b/import-layers/yocto-poky/meta/classes/bluetooth.bbclass
new file mode 100644
index 000000000..f88b4ae5b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/classes/bugzilla.bbclass b/import-layers/yocto-poky/meta/classes/bugzilla.bbclass
new file mode 100644
index 000000000..3fc895642
--- /dev/null
+++ b/import-layers/yocto-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", True)
+ user = data.getVar("BUGZILLA_USER", True)
+ passw = data.getVar("BUGZILLA_PASS", True)
+ product = data.getVar("BUGZILLA_PRODUCT", True)
+ compon = data.getVar("BUGZILLA_COMPONENT", True)
+ version = data.getVar("BUGZILLA_VERSION", True)
+
+ proxy = data.getVar('http_proxy', True )
+ 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", True),"..","bugzilla-log"),"a")
+
+ file = None
+ bugname = "%(package)s-%(pv)s-autobuild" % { "package" : data.getVar("PN", True),
+ "pv" : data.getVar("PV", True),
+ }
+ log_file = glob.glob("%s/log.%s.*" % (event.data.getVar('T', True), event.task))
+ text = "The %s step in %s failed at %s for machine %s" % (e.task, data.getVar("PN", True), data.getVar('DATETIME', True), data.getVar( 'MACHINE', True ) )
+ 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', True))
+ 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/import-layers/yocto-poky/meta/classes/buildhistory.bbclass b/import-layers/yocto-poky/meta/classes/buildhistory.bbclass
new file mode 100644
index 000000000..581d53269
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/buildhistory.bbclass
@@ -0,0 +1,856 @@
+#
+# 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 ?= "0"
+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"
+
+# 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"
+
+#
+# Write out metadata about this package for comparison when writing future packages
+#
+python buildhistory_emit_pkghistory() {
+ if not d.getVar('BB_CURRENTTASK', True) in ['packagedata', 'packagedata_setscene']:
+ return 0
+
+ if not "package" in (d.getVar('BUILDHISTORY_FEATURES', True) or "").split():
+ return 0
+
+ import re
+ import json
+ import errno
+
+ pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE', True)
+ oldpkghistdir = d.getVar('BUILDHISTORY_OLD_DIR_PACKAGE', True)
+
+ class RecipeInfo:
+ def __init__(self, name):
+ self.name = name
+ self.pe = "0"
+ self.pv = "0"
+ self.pr = "r0"
+ self.depends = ""
+ self.packages = ""
+ self.srcrev = ""
+
+
+ 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 = long(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', True)
+ pe = d.getVar('PE', True) or "0"
+ pv = d.getVar('PV', True)
+ pr = d.getVar('PR', True)
+
+ pkgdata_dir = d.getVar('PKGDATA_DIR', True)
+ 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', True).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', True) or ""))
+ rcpinfo.packages = packages
+ write_recipehistory(rcpinfo, d)
+
+ pkgdest = d.getVar('PKGDEST', True)
+ 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].decode('utf-8').decode('string_escape')
+
+ 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 = 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)
+}
+
+
+def write_recipehistory(rcpinfo, d):
+ import codecs
+
+ bb.debug(2, "Writing recipe history")
+
+ pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE', True)
+
+ infofile = os.path.join(pkghistdir, "latest")
+ with codecs.open(infofile, "w", encoding='utf8') 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)
+
+
+def write_pkghistory(pkginfo, d):
+ import codecs
+
+ bb.debug(2, "Writing package history for package %s" % pkginfo.name)
+
+ pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE', True)
+
+ pkgpath = os.path.join(pkghistdir, pkginfo.name)
+ if not os.path.exists(pkgpath):
+ bb.utils.mkdirhier(pkgpath)
+
+ infofile = os.path.join(pkgpath, "latest")
+ with codecs.open(infofile, "w", encoding='utf8') 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)
+
+ pkgvars = {}
+ pkgvars['PKG'] = pkginfo.pkg if pkginfo.pkg != pkginfo.name else ''
+ pkgvars['PKGE'] = pkginfo.pkge if pkginfo.pkge != pkginfo.pe else ''
+ pkgvars['PKGV'] = pkginfo.pkgv if pkginfo.pkgv != pkginfo.pv else ''
+ pkgvars['PKGR'] = pkginfo.pkgr if pkginfo.pkgr != pkginfo.pr else ''
+ for pkgvar in pkgvars:
+ val = pkgvars[pkgvar]
+ if val:
+ f.write(u"%s = %s\n" % (pkgvar, val))
+
+ 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 codecs.open(filevarpath, "w", encoding='utf8') 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', True), 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
+ # Change delimiter from pipe to -> and set style for recommend lines
+ sed -i -e 's:|: -> :' -e 's:"\[REC\]":[style=dotted]:' -e 's:$:;:' $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 | uniq >> $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 " $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
+ import math
+ if d.getVar('BB_CURRENTTASK', True) == 'populate_sdk_ext':
+ tasksizes = {}
+ filesizes = {}
+ for root, _, files in os.walk(d.expand('${SDK_OUTPUT}/${SDKPATH}/sstate-cache')):
+ 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 = tasksizes.get(task, 0)
+ tasksizes[task] = origtotal + fsize
+ filesizes[fn] = fsize
+ with open(d.expand('${BUILDHISTORY_DIR_SDK}/sstate-package-sizes.txt'), 'w') as f:
+ filesizes_sorted = sorted(filesizes.items(), key=operator.itemgetter(1), 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(tasksizes.items(), key=operator.itemgetter(1), 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 ;\
+ buildhistory_get_image_installed ; "
+
+IMAGE_POSTPROCESS_COMMAND += " 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; "
+
+def buildhistory_get_build_id(d):
+ if d.getVar('BB_WORKERCONTEXT', True) != '1':
+ return ""
+ localdata = bb.data.createCopy(d)
+ bb.data.update_data(localdata)
+ 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', True)
+ 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", True) 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, True) 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', True) != '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', True) != '1':
+ return ""
+ sdkvars = "DISTRO DISTRO_VERSION SDK_NAME SDK_VERSION SDKMACHINE SDKIMAGE_FEATURES BAD_RECOMMENDATIONS NO_RECOMMENDATIONS PACKAGE_EXCLUDE"
+ if d.getVar('BB_CURRENTTASK', True) == '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"
+ 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):
+ if sys.argv[0].endswith('bin/bitbake'):
+ bincmd = 'bitbake'
+ else:
+ bincmd = sys.argv[0]
+ return '%s %s' % (bincmd, ' '.join(sys.argv[1:]))
+
+
+buildhistory_single_commit() {
+ if [ "$3" = "" ] ; then
+ commitopts="${BUILDHISTORY_DIR}/ --allow-empty"
+ item="No changes"
+ else
+ commitopts="$3 metadata-revs"
+ item="$3"
+ 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
+$item: 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
+ # If the user hasn't set up their name/email, set some defaults
+ # just for this repo (otherwise the commit will fail with older
+ # versions of git)
+ if ! git config user.email > /dev/null ; then
+ git config --local user.email "buildhistory@${DISTRO}"
+ fi
+ if ! git config user.name > /dev/null ; then
+ git config --local user.name "buildhistory"
+ fi
+ # 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
+ for entry in `echo "$repostatus" | awk '{print $2}' | awk -F/ '{print $1}' | sort | uniq` ; do
+ buildhistory_single_commit "$CMDLINE" "$HOSTNAME" "$entry"
+ done
+ 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', True).strip():
+ reset = e.data.getVar("BUILDHISTORY_RESET", True)
+ olddir = e.data.getVar("BUILDHISTORY_OLD_DIR", True)
+ 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", True)
+ 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", True) == "1":
+ bb.note("Writing buildhistory")
+ 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)
+}
+
+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', True).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() {
+ pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE', True)
+ 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' % srcrevs.itervalues().next())
+ 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', True)
+ 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)
+}
diff --git a/import-layers/yocto-poky/meta/classes/buildstats-summary.bbclass b/import-layers/yocto-poky/meta/classes/buildstats-summary.bbclass
new file mode 100644
index 000000000..d73350b94
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/buildstats-summary.bbclass
@@ -0,0 +1,36 @@
+# 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', True) 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:")
+
+ bb.note(" {0}: {1}% sstate reuse ({2} setscene, {3} scratch)".format(t, 100*len(sstate)/(len(sstate)+len(no_sstate)), len(sstate), len(no_sstate)))
+}
+addhandler buildstats_summary
+buildstats_summary[eventmask] = "bb.event.BuildCompleted"
diff --git a/import-layers/yocto-poky/meta/classes/buildstats.bbclass b/import-layers/yocto-poky/meta/classes/buildstats.bbclass
new file mode 100644
index 000000000..34ecb0386
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/buildstats.bbclass
@@ -0,0 +1,185 @@
+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
+ 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', True)
+ bsdir = os.path.join(d.getVar('BUILDSTATS_BASE', True), 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: Elapsed time: %0.2f seconds \n" %
+ (e.task, 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', True)
+ bsdir = os.path.join(d.getVar('BUILDSTATS_BASE', True), bn)
+ taskdir = os.path.join(bsdir, d.getVar('PF', True))
+
+ 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', True)
+ rootfs_size = subprocess.Popen(["du", "-sh", rootfs], stdout=subprocess.PIPE).stdout.read()
+ f.write("Uncompressed Rootfs size: %s" % rootfs_size)
+
+ 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"
+
diff --git a/import-layers/yocto-poky/meta/classes/ccache.bbclass b/import-layers/yocto-poky/meta/classes/ccache.bbclass
new file mode 100644
index 000000000..2cdce4693
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/ccache.bbclass
@@ -0,0 +1,8 @@
+CCACHE = "${@bb.utils.which(d.getVar('PATH', True), 'ccache') and 'ccache '}"
+export CCACHE_DIR ?= "${TMPDIR}/ccache/${MULTIMACH_HOST_SYS}/${PN}"
+CCACHE_DISABLE[unexport] = "1"
+
+do_configure[dirs] =+ "${CCACHE_DIR}"
+do_kernel_configme[dirs] =+ "${CCACHE_DIR}"
+
+do_clean[cleandirs] += "${CCACHE_DIR}"
diff --git a/import-layers/yocto-poky/meta/classes/chrpath.bbclass b/import-layers/yocto-poky/meta/classes/chrpath.bbclass
new file mode 100644
index 000000000..9c68855ab
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/chrpath.bbclass
@@ -0,0 +1,117 @@
+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)
+ err, out = p.communicate()
+ # If returned successfully, process stderr for results
+ if p.returncode != 0:
+ return
+
+ # Handle RUNPATH as well as RPATH
+ err = err.replace("RUNPATH=","RPATH=")
+ # Throw away everything other than the rpath list
+ curr_rpath = err.partition("RPATH=")[2]
+ #bb.note("Current rpath for %s is %s" % (fpath, curr_rpath.strip()))
+ rpaths = curr_rpath.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.strip())
+ continue
+ rpath = os.path.normpath(rpath)
+ if baseprefix not in rpath and tmpdir not in rpath:
+ new_rpaths.append(rpath.strip())
+ continue
+ new_rpaths.append("$ORIGIN/" + os.path.relpath(rpath.strip(), 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.error("%s: chrpath command failed with exit code %d:\n%s%s" % (d.getVar('PN', True), p.returncode, out, err))
+ raise bb.build.FuncFailed
+
+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)
+ err, out = p.communicate()
+ # If returned successfully, process stderr for results
+ if p.returncode != 0:
+ return
+ for l in err.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)
+ err, out = 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", True)
+
+ #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/import-layers/yocto-poky/meta/classes/clutter.bbclass b/import-layers/yocto-poky/meta/classes/clutter.bbclass
new file mode 100644
index 000000000..167407dfd
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/classes/cmake.bbclass b/import-layers/yocto-poky/meta/classes/cmake.bbclass
new file mode 100644
index 000000000..02f313a86
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/cmake.bbclass
@@ -0,0 +1,137 @@
+# 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 = ""
+
+# 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}"
+
+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}"
+
+# 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() {
+ cat > ${WORKDIR}/toolchain.cmake <<EOF
+# CMake system name must be something like "Linux".
+# This is important for cross-compiling.
+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', True))} )
+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
+
+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_SITEFILE} \
+ ${OECMAKE_SOURCEPATH} \
+ -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
+ -DCMAKE_INSTALL_BINDIR:PATH=${bindir} \
+ -DCMAKE_INSTALL_SBINDIR:PATH=${sbindir} \
+ -DCMAKE_INSTALL_LIBEXECDIR:PATH=${libexecdir} \
+ -DCMAKE_INSTALL_SYSCONFDIR:PATH=${sysconfdir} \
+ -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=${sharedstatedir} \
+ -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=${localstatedir} \
+ -DCMAKE_INSTALL_LIBDIR:PATH=${libdir} \
+ -DCMAKE_INSTALL_INCLUDEDIR:PATH=${includedir} \
+ -DCMAKE_INSTALL_DATAROOTDIR:PATH=${datadir} \
+ -DCMAKE_INSTALL_SO_NO_EXE=0 \
+ -DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain.cmake \
+ -DCMAKE_VERBOSE_MAKEFILE=1 \
+ ${EXTRA_OECMAKE} \
+ -Wno-dev
+}
+
+cmake_do_compile() {
+ cd ${B}
+ base_do_compile
+}
+
+cmake_do_install() {
+ cd ${B}
+ oe_runmake 'DESTDIR=${D}' install
+}
+
+EXPORT_FUNCTIONS do_configure do_compile do_install do_generate_toolchain_file
diff --git a/import-layers/yocto-poky/meta/classes/cml1.bbclass b/import-layers/yocto-poky/meta/classes/cml1.bbclass
new file mode 100644
index 000000000..b5dc028a2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/cml1.bbclass
@@ -0,0 +1,76 @@
+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', True),
+ d.getVar('PN', True ) + ' 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"
+addtask menuconfig after do_configure
+
+python do_diffconfig() {
+ import shutil
+ import subprocess
+
+ workdir = d.getVar('WORKDIR', True)
+ 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)
+
+ 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"
+addtask diffconfig
diff --git a/import-layers/yocto-poky/meta/classes/compress_doc.bbclass b/import-layers/yocto-poky/meta/classes/compress_doc.bbclass
new file mode 100644
index 000000000..8073c173e
--- /dev/null
+++ b/import-layers/yocto-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', True)
+ compress_list = (d.getVar('DOC_COMPRESS_LIST', True) 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', True)
+ compress_cmds = {}
+ decompress_cmds = {}
+ for mode in compress_list:
+ compress_cmds[mode] = d.getVarFlag('DOC_COMPRESS_CMD', mode, True)
+ decompress_cmds[mode] = d.getVarFlag('DOC_DECOMPRESS_CMD', mode, True)
+
+ mandir = os.path.abspath(dvar + os.sep + d.getVar("mandir", True))
+ 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", True))
+ 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", True)
+ infodir = d.getVar("infodir", True)
+ compress_mode = d.getVar('DOC_COMPRESS', True)
+ for pkg in (d.getVar('PACKAGES', True) or "").split():
+ old_names = (d.getVar('ALTERNATIVE_%s' % pkg, True) or "").split()
+ new_names = []
+ for old_name in old_names:
+ old_link = d.getVarFlag('ALTERNATIVE_LINK_NAME', old_name, True)
+ old_target = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, old_name, True) or \
+ d.getVarFlag('ALTERNATIVE_TARGET', old_name, True) or \
+ d.getVar('ALTERNATIVE_TARGET_%s' % pkg, True) or \
+ d.getVar('ALTERNATIVE_TARGET', True) 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, True):
+ 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, True):
+ d.delVarFlag('ALTERNATIVE_TARGET', old_name)
+ d.setVarFlag('ALTERNATIVE_TARGET', new_name, new_target)
+ elif d.getVar('ALTERNATIVE_TARGET_%s' % pkg, True):
+ d.setVar('ALTERNATIVE_TARGET_%s' % pkg, new_target)
+ elif d.getVar('ALTERNATIVE_TARGET', old_name, True):
+ 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/import-layers/yocto-poky/meta/classes/copyleft_compliance.bbclass b/import-layers/yocto-poky/meta/classes/copyleft_compliance.bbclass
new file mode 100644
index 000000000..907c1836b
--- /dev/null
+++ b/import-layers/yocto-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', True)
+ 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', True)
+ dl_dir = d.getVar('DL_DIR', True)
+ src_uri = d.getVar('SRC_URI', True).split()
+ fetch = bb.fetch2.Fetch(src_uri, d)
+ ud = fetch.ud
+
+ pf = d.getVar('PF', True)
+ 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/import-layers/yocto-poky/meta/classes/copyleft_filter.bbclass b/import-layers/yocto-poky/meta/classes/copyleft_filter.bbclass
new file mode 100644
index 000000000..46be7f7d2
--- /dev/null
+++ b/import-layers/yocto-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*'
+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
+
+ included, motive = False, 'recipe did not match anything'
+
+ recipe_type = d.getVar('COPYLEFT_RECIPE_TYPE', True)
+ if recipe_type not in oe.data.typed_value('COPYLEFT_RECIPE_TYPES', d):
+ include, motive = False, 'recipe type "%s" is excluded' % recipe_type
+
+ 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', True), include, exclude)
+ except oe.license.LicenseError as exc:
+ bb.fatal('%s: %s' % (d.getVar('PF', True), 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', True), 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', True), 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/import-layers/yocto-poky/meta/classes/core-image.bbclass b/import-layers/yocto-poky/meta/classes/core-image.bbclass
new file mode 100644
index 000000000..705cad8d9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/core-image.bbclass
@@ -0,0 +1,71 @@
+# Common code for generating core reference images
+#
+# Copyright (C) 2007-2011 Linux Foundation
+
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+ file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+# 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
+# - 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
+#
+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/import-layers/yocto-poky/meta/classes/cpan-base.bbclass b/import-layers/yocto-poky/meta/classes/cpan-base.bbclass
new file mode 100644
index 000000000..55ac05269
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/cpan-base.bbclass
@@ -0,0 +1,40 @@
+#
+# 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))]}"
+
+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
+
+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"
+PERLVERSION := "${@get_perl_version(d)}"
+PERLVERSION[vardepvalue] = ""
diff --git a/import-layers/yocto-poky/meta/classes/cpan.bbclass b/import-layers/yocto-poky/meta/classes/cpan.bbclass
new file mode 100644
index 000000000..8e079e0d5
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/classes/cpan_build.bbclass b/import-layers/yocto-poky/meta/classes/cpan_build.bbclass
new file mode 100644
index 000000000..fac074d61
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/classes/cross-canadian.bbclass b/import-layers/yocto-poky/meta/classes/cross-canadian.bbclass
new file mode 100644
index 000000000..e07b1bdb6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/cross-canadian.bbclass
@@ -0,0 +1,182 @@
+#
+# 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}"
+CANADIANEXTRAOS = "linux-uclibc linux-musl"
+CANADIANEXTRAVENDOR = ""
+MODIFYTOS ??= "1"
+python () {
+ archs = d.getVar('PACKAGE_ARCHS', True).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", True) != "1":
+ return
+
+ if d.getVar("TCLIBC", True) == "baremetal":
+ return
+
+ tos = d.getVar("TARGET_OS", True)
+ whitelist = []
+ for variant in ["", "spe", "x32", "eabi", "n32"]:
+ for libc in ["", "uclibc", "musl"]:
+ 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", True))
+
+ for n in ["PROVIDES", "DEPENDS"]:
+ d.setVar(n, d.getVar(n, True))
+ d.setVar("STAGING_BINDIR_TOOLCHAIN", d.getVar("STAGING_BINDIR_TOOLCHAIN", True))
+ 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, True))
+ # 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", True)
+ if tarch == "x86_64":
+ d.setVar("LIBCEXTENSION", "")
+ d.setVar("ABIEXTENSION", "")
+ d.appendVar("CANADIANEXTRAOS", " linux-gnux32 linux-uclibcx32 linux-muslx32")
+ elif tarch == "powerpc":
+ # PowerPC can build "linux" and "linux-gnuspe"
+ d.setVar("LIBCEXTENSION", "")
+ d.setVar("ABIEXTENSION", "")
+ d.appendVar("CANADIANEXTRAOS", " linux-gnuspe linux-uclibcspe linux-muslspe")
+ elif tarch == "mips64":
+ d.appendVar("CANADIANEXTRAOS", " linux-gnun32 linux-uclibcn32 linux-musln32")
+ if tarch == "arm" or tarch == "armeb":
+ d.setVar("TARGET_OS", "linux-gnueabi")
+ else:
+ d.setVar("TARGET_OS", "linux")
+
+ # Also need to handle multilib target vendors
+ vendors = d.getVar("CANADIANEXTRAVENDOR", True)
+ if not vendors:
+ vendors = all_multilib_tune_values(d, 'TARGET_VENDOR')
+ origvendor = d.getVar("TARGET_VENDOR_MULTILIB_ORIGINAL", True)
+ 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 = "${STAGING_DIR}/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}"
+
+TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR}/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}"
+
+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', True), '')}"
+
+CPPFLAGS = "${BUILDSDK_CPPFLAGS}"
+CFLAGS = "${BUILDSDK_CFLAGS}"
+CXXFLAGS = "${BUILDSDK_CFLAGS}"
+LDFLAGS = "${BUILDSDK_LDFLAGS} \
+ -Wl,-rpath-link,${STAGING_LIBDIR}/.. \
+ -Wl,-rpath,${libdir}/.. "
+
+DEPENDS_GETTEXT = "gettext-native nativesdk-gettext"
+
+#
+# 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"
+
+# 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/import-layers/yocto-poky/meta/classes/cross.bbclass b/import-layers/yocto-poky/meta/classes/cross.bbclass
new file mode 100644
index 000000000..81d1c9d85
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/cross.bbclass
@@ -0,0 +1,71 @@
+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}"
+
+STAGING_DIR_HOST = "${STAGING_DIR}/${HOST_ARCH}${HOST_VENDOR}-${HOST_OS}"
+
+PACKAGE_ARCH = "${BUILD_ARCH}"
+
+MULTIMACH_TARGET_SYS = "${PACKAGE_ARCH}${BUILD_VENDOR}-${BUILD_OS}"
+
+export PKG_CONFIG_DIR = "${exec_prefix}/lib/pkgconfig"
+export PKG_CONFIG_SYSROOT_DIR = ""
+
+CPPFLAGS = "${BUILD_CPPFLAGS}"
+CFLAGS = "${BUILD_CFLAGS}"
+CXXFLAGS = "${BUILD_CFLAGS}"
+LDFLAGS = "${BUILD_LDFLAGS}"
+LDFLAGS_build-darwin = "-L${STAGING_LIBDIR_NATIVE}"
+
+TOOLCHAIN_OPTIONS = ""
+
+DEPENDS_GETTEXT = "gettext-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}"
+
+# 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"
+
+inherit nopackages
diff --git a/import-layers/yocto-poky/meta/classes/crosssdk.bbclass b/import-layers/yocto-poky/meta/classes/crosssdk.bbclass
new file mode 100644
index 000000000..7315c38f1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/crosssdk.bbclass
@@ -0,0 +1,36 @@
+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', True))
+}
+
+STAGING_DIR_TARGET = "${STAGING_DIR}/${SDK_ARCH}-${SDKPKGSUFFIX}${SDK_VENDOR}-${SDK_OS}"
+STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_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_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/import-layers/yocto-poky/meta/classes/debian.bbclass b/import-layers/yocto-poky/meta/classes/debian.bbclass
new file mode 100644
index 000000000..be7cacca9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/debian.bbclass
@@ -0,0 +1,141 @@
+# 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", True):
+ d.setVar("DEBIANRDEP", "")
+}
+
+python debian_package_name_hook () {
+ import glob, copy, stat, errno, re
+
+ pkgdest = d.getVar('PKGDEST', True)
+ packages = d.getVar('PACKAGES', True)
+ bin_re = re.compile(".*/s?" + os.path.basename(d.getVar("bindir", True)) + "$")
+ lib_re = re.compile(".*/" + os.path.basename(d.getVar("libdir", True)) + "$")
+ 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, True)
+ if newpkg and newpkg != pkg:
+ provs = (d.getVar('RPROVIDES_' + pkg, True) or "").split()
+ if pkg not in provs:
+ d.appendVar('RPROVIDES_' + pkg, " " + pkg + " (=" + d.getVar("PKGV", True) + ")")
+
+ def auto_libname(packages, orig_pkg):
+ sonames = []
+ has_bins = 0
+ has_libs = 0
+ for file in pkgfiles[orig_pkg]:
+ root = os.path.dirname(file)
+ if bin_re.match(root):
+ has_bins = 1
+ if lib_re.match(root):
+ has_libs = 1
+ if so_re.match(os.path.basename(file)):
+ cmd = (d.getVar('TARGET_PREFIX', True) or "") + "objdump -p " + file + " 2>/dev/null"
+ fd = os.popen(cmd)
+ lines = fd.readlines()
+ fd.close()
+ for l in lines:
+ m = re.match("\s+SONAME\s+([^\s]*)", l)
+ if m and not m.group(1) in sonames:
+ sonames.append(m.group(1))
+
+ 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', True)
+ 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', True)
+ if mlpre:
+ if not newpkg.find(mlpre) == 0:
+ newpkg = mlpre + newpkg
+ if newpkg != pkg:
+ 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', True) or "").split(), reverse=True):
+ auto_libname(packages, pkg)
+}
+
+EXPORT_FUNCTIONS package_name_hook
+
+DEBIAN_NAMES = "1"
+
diff --git a/import-layers/yocto-poky/meta/classes/deploy.bbclass b/import-layers/yocto-poky/meta/classes/deploy.bbclass
new file mode 100644
index 000000000..8ad07da01
--- /dev/null
+++ b/import-layers/yocto-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}"
diff --git a/import-layers/yocto-poky/meta/classes/devshell.bbclass b/import-layers/yocto-poky/meta/classes/devshell.bbclass
new file mode 100644
index 000000000..341d9c000
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/devshell.bbclass
@@ -0,0 +1,156 @@
+inherit terminal
+
+DEVSHELL = "${SHELL}"
+
+python do_devshell () {
+ if d.getVarFlag("do_devshell", "manualfakeroot", True):
+ d.prependVar("DEVSHELL", "pseudo ")
+ fakeenv = d.getVar("FAKEROOTENV", True).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', True), 'OpenEmbedded Developer Shell', d)
+}
+
+addtask devshell after do_patch
+
+# 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", True):
+ # 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())
+
+ sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
+ sys.stdin = os.fdopen(sys.stdin.fileno(), 'r', 0)
+
+ 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", True))
+
+ def prompt(more):
+ if more:
+ prompt = ps2
+ else:
+ prompt = ps1
+ sys.stdout.write(prompt)
+
+ # 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")
+ 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/import-layers/yocto-poky/meta/classes/distro_features_check.bbclass b/import-layers/yocto-poky/meta/classes/distro_features_check.bbclass
new file mode 100644
index 000000000..7e91dbcf4
--- /dev/null
+++ b/import-layers/yocto-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', True) or "").split()
+
+ any_of_distro_features = d.getVar('ANY_OF_DISTRO_FEATURES', True)
+ 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.SkipPackage("one of '%s' needs to be in DISTRO_FEATURES" % any_of_distro_features)
+
+ required_distro_features = d.getVar('REQUIRED_DISTRO_FEATURES', True)
+ 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.SkipPackage("missing required distro feature '%s' (not in DISTRO_FEATURES)" % f)
+
+ conflict_distro_features = d.getVar('CONFLICT_DISTRO_FEATURES', True)
+ 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.SkipPackage("conflicting distro feature '%s' (in DISTRO_FEATURES)" % f)
+}
diff --git a/import-layers/yocto-poky/meta/classes/distrodata.bbclass b/import-layers/yocto-poky/meta/classes/distrodata.bbclass
new file mode 100644
index 000000000..51bfc1e54
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/distrodata.bbclass
@@ -0,0 +1,480 @@
+include conf/distro/include/package_regex.inc
+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", True)
+ bb.note("Package Name: %s" % pn)
+
+ import oe.distro_check as dist_check
+ tmpdir = d.getVar('TMPDIR', True)
+ distro_check_dir = os.path.join(tmpdir, "distro_check")
+ datetime = localdata.getVar('DATETIME', True)
+ 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', True))
+ bb.data.update_data(localdata)
+
+ if pn.find("-cross") != -1:
+ pnstripped = pn.split("-cross")
+ bb.note("cross Split: %s" % pnstripped)
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
+ bb.data.update_data(localdata)
+
+ if pn.find("-crosssdk") != -1:
+ pnstripped = pn.split("-crosssdk")
+ bb.note("cross Split: %s" % pnstripped)
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
+ bb.data.update_data(localdata)
+
+ if pn.startswith("nativesdk-"):
+ pnstripped = pn.replace("nativesdk-", "")
+ bb.note("NativeSDK Split: %s" % pnstripped)
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped + ":" + d.getVar('OVERRIDES', True))
+ bb.data.update_data(localdata)
+
+
+ if pn.find("-initial") != -1:
+ pnstripped = pn.split("-initial")
+ bb.note("initial Split: %s" % pnstripped)
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
+ bb.data.update_data(localdata)
+
+ """generate package information from .bb file"""
+ pname = localdata.getVar('PN', True)
+ pcurver = localdata.getVar('PV', True)
+ pdesc = localdata.getVar('DESCRIPTION', True)
+ if pdesc is not None:
+ pdesc = pdesc.replace(',','')
+ pdesc = pdesc.replace('\n','')
+
+ pgrp = localdata.getVar('SECTION', True)
+ plicense = localdata.getVar('LICENSE', True).replace(',','_')
+
+ rstatus = localdata.getVar('RECIPE_COLOR', True)
+ if rstatus is not None:
+ rstatus = rstatus.replace(',','')
+
+ pupver = localdata.getVar('RECIPE_UPSTREAM_VERSION', True)
+ if pcurver == pupver:
+ vermatch="1"
+ else:
+ vermatch="0"
+ noupdate_reason = localdata.getVar('RECIPE_NO_UPDATE_REASON', True)
+ if noupdate_reason is None:
+ noupdate="0"
+ else:
+ noupdate="1"
+ noupdate_reason = noupdate_reason.replace(',','')
+
+ maintainer = localdata.getVar('RECIPE_MAINTAINER', True)
+ rlrd = localdata.getVar('RECIPE_UPSTREAM_DATE', True)
+ 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', True)
+ 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', True)
+ distro_check_dir = os.path.join(tmpdir, "distro_check")
+ datetime = localdata.getVar('DATETIME', True)
+ dist_check.update_distro_data(distro_check_dir, datetime, localdata)
+
+ pn = d.getVar("PN", True)
+ 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', True))
+ bb.data.update_data(localdata)
+
+ if pn.startswith("nativesdk-"):
+ pnstripped = pn.replace("nativesdk-", "")
+ bb.note("NativeSDK Split: %s" % pnstripped)
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped + ":" + d.getVar('OVERRIDES', True))
+ bb.data.update_data(localdata)
+
+ if pn.find("-cross") != -1:
+ pnstripped = pn.split("-cross")
+ bb.note("cross Split: %s" % pnstripped)
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
+ bb.data.update_data(localdata)
+
+ if pn.find("-crosssdk") != -1:
+ pnstripped = pn.split("-crosssdk")
+ bb.note("cross Split: %s" % pnstripped)
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
+ bb.data.update_data(localdata)
+
+ if pn.find("-initial") != -1:
+ pnstripped = pn.split("-initial")
+ bb.note("initial Split: %s" % pnstripped)
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
+ bb.data.update_data(localdata)
+
+ """generate package information from .bb file"""
+ pname = localdata.getVar('PN', True)
+ pcurver = localdata.getVar('PV', True)
+ pdesc = localdata.getVar('DESCRIPTION', True)
+ if pdesc is not None:
+ pdesc = pdesc.replace(',','')
+ pdesc = pdesc.replace('\n','')
+
+ pgrp = localdata.getVar('SECTION', True)
+ plicense = localdata.getVar('LICENSE', True).replace(',','_')
+
+ rstatus = localdata.getVar('RECIPE_COLOR', True)
+ if rstatus is not None:
+ rstatus = rstatus.replace(',','')
+
+ pupver = localdata.getVar('RECIPE_UPSTREAM_VERSION', True)
+ if pcurver == pupver:
+ vermatch="1"
+ else:
+ vermatch="0"
+
+ noupdate_reason = localdata.getVar('RECIPE_NO_UPDATE_REASON', True)
+ if noupdate_reason is None:
+ noupdate="0"
+ else:
+ noupdate="1"
+ noupdate_reason = noupdate_reason.replace(',','')
+
+ maintainer = localdata.getVar('RECIPE_MAINTAINER', True)
+ rlrd = localdata.getVar('RECIPE_UPSTREAM_DATE', True)
+ # 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"
+
+addtask distrodataall after do_distrodata
+do_distrodataall[recrdeptask] = "do_distrodataall do_distrodata"
+do_distrodataall[recideptask] = "do_${BB_DEFAULT_TASK}"
+do_distrodataall[nostamp] = "1"
+do_distrodataall() {
+ :
+}
+
+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
+
+ """first check whether a uri is provided"""
+ src_uri = (d.getVar('SRC_URI', True) or '').split()
+ if src_uri:
+ uri_type, _, _, _, _, _ = decodeurl(src_uri[0])
+ else:
+ uri_type = "none"
+
+ """initialize log files."""
+ logpath = d.getVar('LOG_DIR', True)
+ bb.utils.mkdirhier(logpath)
+ logfile = os.path.join(logpath, "checkpkg.csv")
+
+ """generate package information from .bb file"""
+ pname = d.getVar('PN', True)
+
+ if pname.find("-native") != -1:
+ if d.getVar('BBCLASSEXTEND', True):
+ return
+ pnstripped = pname.split("-native")
+ bb.note("Native Split: %s" % pnstripped)
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
+ bb.data.update_data(localdata)
+
+ if pname.startswith("nativesdk-"):
+ if d.getVar('BBCLASSEXTEND', True):
+ return
+ pnstripped = pname.replace("nativesdk-", "")
+ bb.note("NativeSDK Split: %s" % pnstripped)
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped + ":" + d.getVar('OVERRIDES', True))
+ bb.data.update_data(localdata)
+
+ if pname.find("-cross") != -1:
+ pnstripped = pname.split("-cross")
+ bb.note("cross Split: %s" % pnstripped)
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
+ bb.data.update_data(localdata)
+
+ if pname.find("-initial") != -1:
+ pnstripped = pname.split("-initial")
+ bb.note("initial Split: %s" % pnstripped)
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
+ bb.data.update_data(localdata)
+
+ pdesc = localdata.getVar('DESCRIPTION', True)
+ pgrp = localdata.getVar('SECTION', True)
+ pversion = localdata.getVar('PV', True)
+ plicense = localdata.getVar('LICENSE', True)
+ psection = localdata.getVar('SECTION', True)
+ phome = localdata.getVar('HOMEPAGE', True)
+ prelease = localdata.getVar('PR', True)
+ pdepends = localdata.getVar('DEPENDS', True)
+ pbugtracker = localdata.getVar('BUGTRACKER', True)
+ ppe = localdata.getVar('PE', True)
+ psrcuri = localdata.getVar('SRC_URI', True)
+ maintainer = localdata.getVar('RECIPE_MAINTAINER', True)
+
+ """ Get upstream version version """
+ pupver = ""
+ pstatus = ""
+
+ try:
+ uv = oe.recipeutils.get_recipe_upstream_version(localdata)
+
+ pupver = uv['version']
+ except Exception as e:
+ if e is FetchError:
+ pstatus = "ErrAccess"
+ elif e is NoMethodError:
+ pstatus = "ErrUnsupportedProto"
+ else:
+ pstatus = "ErrUnknown"
+
+ """Set upstream version status"""
+ if not pupver:
+ pupver = "N/A"
+ else:
+ pv, _, _ = oe.recipeutils.get_recipe_pv_without_srcpv(pversion, uri_type)
+ upv, _, _ = oe.recipeutils.get_recipe_pv_without_srcpv(pupver, uri_type)
+
+ cmp = vercmp_string(pv, upv)
+ if cmp == -1:
+ pstatus = "UPDATE"
+ elif cmp == 0:
+ pstatus = "MATCH"
+
+ 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', True)
+ 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, pupver,
+ psrcuri, maintainer, no_upgr_reason])
+ f.close()
+ bb.utils.unlockfile(lf)
+}
+
+addtask checkpkgall after do_checkpkg
+do_checkpkgall[recrdeptask] = "do_checkpkgall do_checkpkg"
+do_checkpkgall[recideptask] = "do_${BB_DEFAULT_TASK}"
+do_checkpkgall[nostamp] = "1"
+do_checkpkgall() {
+ :
+}
+
+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"
+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)
+ bb.data.update_data(localdata)
+ tmpdir = d.getVar('TMPDIR', True)
+ distro_check_dir = os.path.join(tmpdir, "distro_check")
+ logpath = d.getVar('LOG_DIR', True)
+ bb.utils.mkdirhier(logpath)
+ result_file = os.path.join(logpath, "distrocheck.csv")
+ datetime = localdata.getVar('DATETIME', True)
+ 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)
+}
+
+addtask distro_checkall after do_distro_check
+do_distro_checkall[recrdeptask] = "do_distro_checkall do_distro_check"
+do_distro_checkall[recideptask] = "do_${BB_DEFAULT_TASK}"
+do_distro_checkall[nostamp] = "1"
+do_distro_checkall() {
+ :
+}
+#
+#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', True)
+ bb.utils.mkdirhier(logpath)
+ pn = d.getVar('PN', True)
+ logfile = os.path.join(logpath, "missinglicense.csv")
+ generic_directory = d.getVar('COMMON_LICENSE_DIR', True)
+ license_types = d.getVar('LICENSE', True)
+ 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
+}
+
+addtask checklicenseall after do_checklicense
+do_checklicenseall[recrdeptask] = "do_checklicenseall do_checklicense"
+do_checklicenseall[recideptask] = "do_${BB_DEFAULT_TASK}"
+do_checklicenseall[nostamp] = "1"
+do_checklicenseall() {
+ :
+}
+
+
diff --git a/import-layers/yocto-poky/meta/classes/distutils-base.bbclass b/import-layers/yocto-poky/meta/classes/distutils-base.bbclass
new file mode 100644
index 000000000..aa18e8b29
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/distutils-base.bbclass
@@ -0,0 +1,4 @@
+DEPENDS += "${@["${PYTHON_PN}-native ${PYTHON_PN}", ""][(d.getVar('PACKAGES', True) == '')]}"
+RDEPENDS_${PN} += "${@['', '${PYTHON_PN}-core']['${CLASSOVERRIDE}' == 'class-target']}"
+
+inherit distutils-common-base pythonnative
diff --git a/import-layers/yocto-poky/meta/classes/distutils-common-base.bbclass b/import-layers/yocto-poky/meta/classes/distutils-common-base.bbclass
new file mode 100644
index 000000000..08511f59c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/distutils-common-base.bbclass
@@ -0,0 +1,17 @@
+inherit python-dir
+
+EXTRA_OEMAKE = ""
+
+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/import-layers/yocto-poky/meta/classes/distutils-native-base.bbclass b/import-layers/yocto-poky/meta/classes/distutils-native-base.bbclass
new file mode 100644
index 000000000..509cb9551
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/distutils-native-base.bbclass
@@ -0,0 +1,3 @@
+inherit distutils-common-base
+
+DEPENDS += "${@["${PYTHON_PN}-native", ""][(d.getVar('PACKAGES', True) == '')]}"
diff --git a/import-layers/yocto-poky/meta/classes/distutils-tools.bbclass b/import-layers/yocto-poky/meta/classes/distutils-tools.bbclass
new file mode 100644
index 000000000..8d9b3f78f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/distutils-tools.bbclass
@@ -0,0 +1,77 @@
+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} \
+ BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+ ${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}
+ BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+ ${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} \
+ BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+ ${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} \
+ BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+ ${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 test -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/import-layers/yocto-poky/meta/classes/distutils.bbclass b/import-layers/yocto-poky/meta/classes/distutils.bbclass
new file mode 100644
index 000000000..da48a2ed5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/distutils.bbclass
@@ -0,0 +1,86 @@
+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} \
+ BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+ ${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}
+ BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+ ${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} \
+ BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+ ${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} \
+ BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+ ${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:${bindir}/env\ python:g $i
+ fi
+ sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
+ done
+ fi
+
+ if test -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:${bindir}/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 test -e ${D}${datadir}/share; then
+ mv -f ${D}${datadir}/share/* ${D}${datadir}/
+ rmdir ${D}${datadir}/share
+ fi
+
+ # Fix backport modules
+ if test -e ${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/backports/__init__.py && test -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/import-layers/yocto-poky/meta/classes/distutils3-base.bbclass b/import-layers/yocto-poky/meta/classes/distutils3-base.bbclass
new file mode 100644
index 000000000..2a093d3a8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/distutils3-base.bbclass
@@ -0,0 +1,8 @@
+DEPENDS += "${@["${PYTHON_PN}-native ${PYTHON_PN}", ""][(d.getVar('PACKAGES', True) == '')]}"
+RDEPENDS_${PN} += "${@['', '${PYTHON_PN}-core']['${CLASSOVERRIDE}' == 'class-target']}"
+
+PYTHON_BASEVERSION = "3.5"
+PYTHON_ABI = "m"
+
+inherit distutils-common-base python3native
+
diff --git a/import-layers/yocto-poky/meta/classes/distutils3-native-base.bbclass b/import-layers/yocto-poky/meta/classes/distutils3-native-base.bbclass
new file mode 100644
index 000000000..db9a1a73c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/distutils3-native-base.bbclass
@@ -0,0 +1,4 @@
+PYTHON_BASEVERSION = "3.5"
+PYTHON_ABI = "m"
+
+inherit distutils-native-base
diff --git a/import-layers/yocto-poky/meta/classes/distutils3.bbclass b/import-layers/yocto-poky/meta/classes/distutils3.bbclass
new file mode 100644
index 000000000..4f6ca4482
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/distutils3.bbclass
@@ -0,0 +1,100 @@
+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() {
+ if [ ${BUILD_SYS} != ${HOST_SYS} ]; then
+ SYS=${MACHINE}
+ else
+ SYS=${HOST_SYS}
+ fi
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ BUILD_SYS=${BUILD_SYS} HOST_SYS=${SYS} \
+ ${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}
+ if [ ${BUILD_SYS} != ${HOST_SYS} ]; then
+ SYS=${MACHINE}
+ else
+ SYS=${HOST_SYS}
+ fi
+ BUILD_SYS=${BUILD_SYS} HOST_SYS=${SYS} \
+ ${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() {
+ if [ ${BUILD_SYS} != ${HOST_SYS} ]; then
+ SYS=${MACHINE}
+ else
+ SYS=${HOST_SYS}
+ fi
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ install -d ${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR}
+ PYTHONPATH=${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR} \
+ BUILD_SYS=${BUILD_SYS} HOST_SYS=${SYS} \
+ ${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}
+ if [ ${BUILD_SYS} != ${HOST_SYS} ]; then
+ SYS=${MACHINE}
+ else
+ SYS=${HOST_SYS}
+ fi
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \
+ BUILD_SYS=${BUILD_SYS} HOST_SYS=${SYS} \
+ ${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}:${bindir}/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}:${bindir}/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 test -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/import-layers/yocto-poky/meta/classes/externalsrc.bbclass b/import-layers/yocto-poky/meta/classes/externalsrc.bbclass
new file mode 100644
index 000000000..da7eb4781
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/externalsrc.bbclass
@@ -0,0 +1,154 @@
+# 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', True)
+ if externalsrc:
+ d.setVar('S', externalsrc)
+ externalsrcbuild = d.getVar('EXTERNALSRC_BUILD', True)
+ if externalsrcbuild:
+ d.setVar('B', externalsrcbuild)
+ else:
+ d.setVar('B', '${WORKDIR}/${BPN}-${PV}/')
+
+ local_srcuri = []
+ fetch = bb.fetch2.Fetch((d.getVar('SRC_URI', True) 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", True), 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 = (d.getVarFlag(task, 'cleandirs', False) or '').split()
+ setvalue = False
+ for cleandir in cleandirs[:]:
+ if d.expand(cleandir) == externalsrc:
+ 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", True).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 ")
+
+ # Force the recipe to be always re-parsed so that the file_checksums
+ # function is run every time
+ d.setVar('BB_DONT_CACHE', '1')
+ d.setVarFlag('do_compile', 'file-checksums', '${@srctree_hash_files(d)}')
+
+ # We don't want the workdir to go away
+ d.appendVar('RM_WORK_EXCLUDE', ' ' + d.getVar('PN', True))
+
+ # 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', True) == d.getVar('B', True):
+ 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}')
+}
+
+python externalsrc_configure_prefunc() {
+ # Create desired symlinks
+ symlinks = (d.getVar('EXTERNALSRC_SYMLINKS', True) or '').split()
+ for symlink in symlinks:
+ symsplit = symlink.split(':', 1)
+ lnkfile = os.path.join(d.getVar('S', True), 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)
+}
+
+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', True), d.getVar('EXTERNALSRC', True)))
+}
+
+def srctree_hash_files(d):
+ import shutil
+ import subprocess
+ import tempfile
+
+ s_dir = d.getVar('EXTERNALSRC', True)
+ git_dir = os.path.join(s_dir, '.git')
+ oe_hash_file = os.path.join(git_dir, 'oe-devtool-tree-sha1')
+
+ ret = " "
+ if os.path.exists(git_dir):
+ with tempfile.NamedTemporaryFile(dir=git_dir, prefix='oe-devtool-index') as tmp_index:
+ # Clone index
+ shutil.copy2(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', '.'], cwd=s_dir, env=env)
+ sha1 = subprocess.check_output(['git', 'write-tree'], cwd=s_dir, env=env)
+ with open(oe_hash_file, 'w') as fobj:
+ fobj.write(sha1)
+ ret = oe_hash_file + ':True'
+ else:
+ ret = d.getVar('EXTERNALSRC', True) + '/*:True'
+ return ret
diff --git a/import-layers/yocto-poky/meta/classes/extrausers.bbclass b/import-layers/yocto-poky/meta/classes/extrausers.bbclass
new file mode 100644
index 000000000..43900f359
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/extrausers.bbclass
@@ -0,0 +1,65 @@
+# 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
+
+IMAGE_INSTALL_append = " ${@['', 'base-passwd shadow'][bool(d.getVar('EXTRA_USERS_PARAMS', True))]}"
+
+# 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
+}
diff --git a/import-layers/yocto-poky/meta/classes/fontcache.bbclass b/import-layers/yocto-poky/meta/classes/fontcache.bbclass
new file mode 100644
index 000000000..8ebdfc4f5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/fontcache.bbclass
@@ -0,0 +1,56 @@
+#
+# This class will generate the proper postinst/postrm scriptlets for font
+# packages.
+#
+
+DEPENDS += "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', True).split()
+ deps = d.getVar("FONT_EXTRA_RDEPENDS", True)
+
+ for pkg in font_pkgs:
+ if deps: d.appendVar('RDEPENDS_' + pkg, ' '+deps)
+}
+
+python add_fontcache_postinsts() {
+ for pkg in d.getVar('FONT_PACKAGES', True).split():
+ bb.note("adding fonts postinst and postrm scripts to %s" % pkg)
+ postinst = d.getVar('pkg_postinst_%s' % pkg, True) or d.getVar('pkg_postinst', True)
+ if not postinst:
+ postinst = '#!/bin/sh\n'
+ postinst += d.getVar('fontcache_common', True)
+ d.setVar('pkg_postinst_%s' % pkg, postinst)
+
+ postrm = d.getVar('pkg_postrm_%s' % pkg, True) or d.getVar('pkg_postrm', True)
+ if not postrm:
+ postrm = '#!/bin/sh\n'
+ postrm += d.getVar('fontcache_common', True)
+ d.setVar('pkg_postrm_%s' % pkg, postrm)
+}
+
+PACKAGEFUNCS =+ "add_fontcache_postinsts"
diff --git a/import-layers/yocto-poky/meta/classes/fs-uuid.bbclass b/import-layers/yocto-poky/meta/classes/fs-uuid.bbclass
new file mode 100644
index 000000000..bd2613cf1
--- /dev/null
+++ b/import-layers/yocto-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', True)
+ 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 gummiboot 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/import-layers/yocto-poky/meta/classes/gconf.bbclass b/import-layers/yocto-poky/meta/classes/gconf.bbclass
new file mode 100644
index 000000000..d7afa7282
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/gconf.bbclass
@@ -0,0 +1,70 @@
+DEPENDS += "gconf 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', True).split()
+ pkgdest = d.getVar('PKGDEST', True)
+
+ 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, True)
+ if not postinst:
+ postinst = '#!/bin/sh\n'
+ postinst += d.getVar('gconf_postinst', True)
+ d.setVar('pkg_postinst_%s' % pkg, postinst)
+ prerm = d.getVar('pkg_prerm_%s' % pkg, True)
+ if not prerm:
+ prerm = '#!/bin/sh\n'
+ prerm += d.getVar('gconf_prerm', True)
+ d.setVar('pkg_prerm_%s' % pkg, prerm)
+ d.appendVar("RDEPENDS_%s" % pkg, ' ' + d.getVar('MLPREFIX', False) + 'gconf')
+}
diff --git a/import-layers/yocto-poky/meta/classes/gettext.bbclass b/import-layers/yocto-poky/meta/classes/gettext.bbclass
new file mode 100644
index 000000000..03b89b245
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/gettext.bbclass
@@ -0,0 +1,19 @@
+def gettext_dependencies(d):
+ if d.getVar('INHIBIT_DEFAULT_DEPS', True) and not oe.utils.inherits(d, 'cross-canadian'):
+ return ""
+ if d.getVar('USE_NLS', True) == 'no':
+ return "gettext-minimal-native"
+ return d.getVar('DEPENDS_GETTEXT', False)
+
+def gettext_oeconf(d):
+ if d.getVar('USE_NLS', True) == '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', True) and not oe.utils.inherits(d, 'cross-canadian'):
+ return '--disable-nls'
+ return "--enable-nls"
+
+DEPENDS_GETTEXT ??= "virtual/gettext gettext-native"
+
+BASEDEPENDS =+ "${@gettext_dependencies(d)}"
+EXTRA_OECONF_append = " ${@gettext_oeconf(d)}"
diff --git a/import-layers/yocto-poky/meta/classes/gio-module-cache.bbclass b/import-layers/yocto-poky/meta/classes/gio-module-cache.bbclass
new file mode 100644
index 000000000..91461b11e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/gio-module-cache.bbclass
@@ -0,0 +1,37 @@
+DEPENDS += "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} \
+ 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', True).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, True)
+ if not postinst:
+ postinst = '#!/bin/sh\n'
+ postinst += d.getVar('gio_module_cache_common', True)
+ d.setVar('pkg_postinst_%s' % pkg, postinst)
+
+ postrm = d.getVar('pkg_postrm_%s' % pkg, True)
+ if not postrm:
+ postrm = '#!/bin/sh\n'
+ postrm += d.getVar('gio_module_cache_common', True)
+ d.setVar('pkg_postrm_%s' % pkg, postrm)
+}
+
diff --git a/import-layers/yocto-poky/meta/classes/gnome.bbclass b/import-layers/yocto-poky/meta/classes/gnome.bbclass
new file mode 100644
index 000000000..c6202bbb7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/gnome.bbclass
@@ -0,0 +1 @@
+inherit gnomebase gtk-icon-cache gconf mime
diff --git a/import-layers/yocto-poky/meta/classes/gnomebase.bbclass b/import-layers/yocto-poky/meta/classes/gnomebase.bbclass
new file mode 100644
index 000000000..e5c67760c
--- /dev/null
+++ b/import-layers/yocto-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"
+
+DEPENDS += "gnome-common-native"
+
+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 \
+"
+
+FILES_${PN}-doc += "${datadir}/devhelp"
+
+inherit autotools pkgconfig
+
+do_install_append() {
+ rm -rf ${D}${localstatedir}/lib/scrollkeeper/*
+ rm -rf ${D}${localstatedir}/scrollkeeper/*
+ rm -f ${D}${datadir}/applications/*.cache
+}
+
diff --git a/import-layers/yocto-poky/meta/classes/gobject-introspection-data.bbclass b/import-layers/yocto-poky/meta/classes/gobject-introspection-data.bbclass
new file mode 100644
index 000000000..b1bdd268e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/gobject-introspection-data.bbclass
@@ -0,0 +1,9 @@
+# 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/import-layers/yocto-poky/meta/classes/gobject-introspection.bbclass b/import-layers/yocto-poky/meta/classes/gobject-introspection.bbclass
new file mode 100644
index 000000000..2d73e402c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/gobject-introspection.bbclass
@@ -0,0 +1,37 @@
+# Inherit this class in recipes to enable building their introspection files
+
+# This sets up autoconf-based recipes to build introspection data (or not),
+# depending on distro and machine features (see gobject-introspection-data class).
+inherit gobject-introspection-data
+EXTRA_OECONF_prepend = "${@bb.utils.contains('GI_DATA_ENABLED', 'True', '--enable-introspection', '--disable-introspection', d)} "
+
+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 = " gobject-introspection gobject-introspection-native qemu-native"
+
+# This is necessary for python scripts to succeed - distutils fails if these
+# are not set
+export BUILD_SYS
+export HOST_SYS
+export STAGING_INCDIR
+export STAGING_LIBDIR
+
+# 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/import-layers/yocto-poky/meta/classes/grub-efi.bbclass b/import-layers/yocto-poky/meta/classes/grub-efi.bbclass
new file mode 100644
index 000000000..4ce3d2844
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/grub-efi.bbclass
@@ -0,0 +1,156 @@
+# 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.
+
+do_bootimg[depends] += "${MLPREFIX}grub-efi:do_deploy"
+do_bootdirectdisk[depends] += "${MLPREFIX}grub-efi:do_deploy"
+
+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
+
+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="bootia32.efi"
+ if [ "${TARGET_ARCH}" = "x86_64" ]; then
+ GRUB_IMAGE="bootx64.efi"
+ fi
+ install -m 0644 ${DEPLOY_DIR_IMAGE}/${GRUB_IMAGE} ${DEST}${EFIDIR}
+
+ 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/vmlinuz ${EFIIMGDIR}
+ EFIPATH=$(echo "${EFIDIR}" | sed 's/\//\\/g')
+ echo "fs0:${EFIPATH}\\${GRUB_IMAGE}" > ${EFIIMGDIR}/startup.nsh
+ if [ -f "$iso_dir/initrd" ] ; then
+ cp $iso_dir/initrd ${EFIIMGDIR}
+ fi
+}
+
+efi_hddimg_populate() {
+ efi_populate $1
+}
+
+python build_efi_cfg() {
+ import sys
+
+ workdir = d.getVar('WORKDIR', True)
+ if not workdir:
+ bb.error("WORKDIR not defined, unable to package")
+ return
+
+ gfxserial = d.getVar('GRUB_GFXSERIAL', True) or ""
+
+ labels = d.getVar('LABELS', True)
+ 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', True)
+ if not cfile:
+ raise bb.build.FuncFailed('Unable to read GRUB_CFG')
+
+ try:
+ cfgfile = file(cfile, 'w')
+ except OSError:
+ raise bb.build.funcFailed('Unable to open %s' % (cfile))
+
+ cfgfile.write('# Automatically created by OE\n')
+
+ opts = d.getVar('GRUB_OPTS', True)
+ 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', True)
+ if timeout:
+ cfgfile.write('timeout=%s\n' % timeout)
+ else:
+ cfgfile.write('timeout=50\n')
+
+ root = d.getVar('GRUB_ROOT', True)
+ if not root:
+ raise bb.build.FuncFailed('GRUB_ROOT not defined')
+
+ if gfxserial == "1":
+ btypes = [ [ " graphics console", "" ],
+ [ " serial console", d.getVar('GRUB_SERIAL', True) or "" ] ]
+ else:
+ btypes = [ [ "", "" ] ]
+
+ for label in labels.split():
+ localdata = d.createCopy()
+
+ overrides = localdata.getVar('OVERRIDES', True)
+ if not overrides:
+ raise bb.build.FuncFailed('OVERRIDES not defined')
+
+ for btype in btypes:
+ localdata.setVar('OVERRIDES', label + ':' + overrides)
+ bb.data.update_data(localdata)
+
+ cfgfile.write('\nmenuentry \'%s%s\'{\n' % (label, btype[0]))
+ lb = label
+ if label == "install":
+ lb = "install-efi"
+ cfgfile.write('linux /vmlinuz LABEL=%s' % (lb))
+
+ cfgfile.write(' %s' % replace_rootfs_uuid(d, root))
+
+ append = localdata.getVar('APPEND', True)
+ initrd = localdata.getVar('INITRD', True)
+
+ 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/import-layers/yocto-poky/meta/classes/gsettings.bbclass b/import-layers/yocto-poky/meta/classes/gsettings.bbclass
new file mode 100644
index 000000000..dec5abc02
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/gsettings.bbclass
@@ -0,0 +1,37 @@
+# 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
+
+DEPENDS += "glib-2.0-native"
+
+RDEPENDS_${PN} += "glib-2.0-utils"
+
+FILES_${PN} += "${datadir}/glib-2.0/schemas"
+
+gsettings_postinstrm () {
+ glib-compile-schemas $D${datadir}/glib-2.0/schemas
+}
+
+python populate_packages_append () {
+ pkg = d.getVar('PN', True)
+ bb.note("adding gsettings postinst scripts to %s" % pkg)
+
+ postinst = d.getVar('pkg_postinst_%s' % pkg, True) or d.getVar('pkg_postinst', True)
+ if not postinst:
+ postinst = '#!/bin/sh\n'
+ postinst += d.getVar('gsettings_postinstrm', True)
+ d.setVar('pkg_postinst_%s' % pkg, postinst)
+
+ bb.note("adding gsettings postrm scripts to %s" % pkg)
+
+ postrm = d.getVar('pkg_postrm_%s' % pkg, True) or d.getVar('pkg_postrm', True)
+ if not postrm:
+ postrm = '#!/bin/sh\n'
+ postrm += d.getVar('gsettings_postinstrm', True)
+ d.setVar('pkg_postrm_%s' % pkg, postrm)
+}
diff --git a/import-layers/yocto-poky/meta/classes/gtk-doc.bbclass b/import-layers/yocto-poky/meta/classes/gtk-doc.bbclass
new file mode 100644
index 000000000..e32f98dcf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/gtk-doc.bbclass
@@ -0,0 +1,25 @@
+# Helper class to pull in the right gtk-doc dependencies and disable
+# gtk-doc.
+#
+# Long-term it would be great if this class could be toggled between
+# gtk-doc-stub-native and the real gtk-doc-native, which would enable
+# re-generation of documentation. For now, we'll make do with this which
+# packages up any existing documentation (so from tarball builds).
+
+# 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}"
+
+DEPENDS_append = " gtk-doc-stub-native"
+
+EXTRA_OECONF_append = "\
+ --disable-gtk-doc \
+ --disable-gtk-doc-html \
+ --disable-gtk-doc-pdf \
+"
+
+do_configure_prepend () {
+ ( cd ${S}; gtkdocize --docdir ${GTKDOC_DOCDIR} )
+}
+
+inherit pkgconfig
diff --git a/import-layers/yocto-poky/meta/classes/gtk-icon-cache.bbclass b/import-layers/yocto-poky/meta/classes/gtk-icon-cache.bbclass
new file mode 100644
index 000000000..0f1052b08
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/gtk-icon-cache.bbclass
@@ -0,0 +1,64 @@
+FILES_${PN} += "${datadir}/icons/hicolor"
+
+DEPENDS += "${@['hicolor-icon-theme', '']['${BPN}' == 'hicolor-icon-theme']} gtk-icon-utils-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', True).split()
+ pkgdest = d.getVar('PKGDEST', True)
+
+ for pkg in packages:
+ icon_dir = '%s/%s/%s/icons' % (pkgdest, pkg, d.getVar('datadir', True))
+ 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, True)
+ if not postinst:
+ postinst = '#!/bin/sh\n'
+ postinst += d.getVar('gtk_icon_cache_postinst', True)
+ d.setVar('pkg_postinst_%s' % pkg, postinst)
+
+ postrm = d.getVar('pkg_postrm_%s' % pkg, True)
+ if not postrm:
+ postrm = '#!/bin/sh\n'
+ postrm += d.getVar('gtk_icon_cache_postrm', True)
+ d.setVar('pkg_postrm_%s' % pkg, postrm)
+}
+
diff --git a/import-layers/yocto-poky/meta/classes/gtk-immodules-cache.bbclass b/import-layers/yocto-poky/meta/classes/gtk-immodules-cache.bbclass
new file mode 100644
index 000000000..c099cd38e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/gtk-immodules-cache.bbclass
@@ -0,0 +1,87 @@
+# 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
+
+DEPENDS =+ "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
+ elif [ -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
+ elif [ -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', True).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, True)
+ if not postinst:
+ postinst = '#!/bin/sh\n'
+ postinst += d.getVar('gtk_immodule_cache_postinst', True)
+ d.setVar('pkg_postinst_%s' % pkg, postinst)
+
+ postrm = d.getVar('pkg_postrm_%s' % pkg, True)
+ if not postrm:
+ postrm = '#!/bin/sh\n'
+ postrm += d.getVar('gtk_immodule_cache_postrm', True)
+ 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)
+ raise bb.build.FuncFailed("ERROR: %s inherits gtk-immodules-cache but doesn't set GTKIMMODULES_PACKAGES" % bb_filename)
+}
+
diff --git a/import-layers/yocto-poky/meta/classes/gummiboot.bbclass b/import-layers/yocto-poky/meta/classes/gummiboot.bbclass
new file mode 100644
index 000000000..1ebb9462d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/gummiboot.bbclass
@@ -0,0 +1,119 @@
+# Copyright (C) 2014 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# gummiboot.bbclass - equivalent of grub-efi.bbclass
+# Set EFI_PROVIDER = "gummiboot" to use gummiboot on your live images instead of grub-efi
+# (images built by image-live.bbclass or image-vm.bbclass)
+
+do_bootimg[depends] += "${MLPREFIX}gummiboot:do_deploy"
+do_bootdirectdisk[depends] += "${MLPREFIX}gummiboot:do_deploy"
+
+EFIDIR = "/EFI/BOOT"
+
+GUMMIBOOT_CFG ?= "${S}/loader.conf"
+GUMMIBOOT_ENTRIES ?= ""
+GUMMIBOOT_TIMEOUT ?= "10"
+
+# Need UUID utility code.
+inherit fs-uuid
+
+efi_populate() {
+ DEST=$1
+
+ EFI_IMAGE="gummibootia32.efi"
+ DEST_EFI_IMAGE="bootia32.efi"
+ if [ "${TARGET_ARCH}" = "x86_64" ]; then
+ EFI_IMAGE="gummibootx64.efi"
+ DEST_EFI_IMAGE="bootx64.efi"
+ fi
+
+ install -d ${DEST}${EFIDIR}
+ # gummiboot 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}
+ install -m 0644 ${GUMMIBOOT_CFG} ${DEST}/loader/loader.conf
+ for i in ${GUMMIBOOT_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 $iso_dir/vmlinuz ${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
+}
+
+python build_efi_cfg() {
+ s = d.getVar("S", True)
+ labels = d.getVar('LABELS', True)
+ 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('GUMMIBOOT_CFG', True)
+ try:
+ cfgfile = open(cfile, 'w')
+ except OSError:
+ raise bb.build.funcFailed('Unable to open %s' % (cfile))
+
+ cfgfile.write('# Automatically created by OE\n')
+ cfgfile.write('default %s\n' % (labels.split()[0]))
+ timeout = d.getVar('GUMMIBOOT_TIMEOUT', True)
+ if timeout:
+ cfgfile.write('timeout %s\n' % timeout)
+ else:
+ cfgfile.write('timeout 10\n')
+ cfgfile.close()
+
+ for label in labels.split():
+ localdata = d.createCopy()
+
+ overrides = localdata.getVar('OVERRIDES', True)
+ if not overrides:
+ raise bb.build.FuncFailed('OVERRIDES not defined')
+
+ entryfile = "%s/%s.conf" % (s, label)
+ d.appendVar("GUMMIBOOT_ENTRIES", " " + entryfile)
+ try:
+ entrycfg = open(entryfile, "w")
+ except OSError:
+ raise bb.build.funcFailed('Unable to open %s' % (entryfile))
+ localdata.setVar('OVERRIDES', label + ':' + overrides)
+ bb.data.update_data(localdata)
+
+ entrycfg.write('title %s\n' % label)
+ entrycfg.write('linux /vmlinuz\n')
+
+ append = localdata.getVar('APPEND', True)
+ initrd = localdata.getVar('INITRD', True)
+
+ 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/import-layers/yocto-poky/meta/classes/gzipnative.bbclass b/import-layers/yocto-poky/meta/classes/gzipnative.bbclass
new file mode 100644
index 000000000..326cbbb6f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/gzipnative.bbclass
@@ -0,0 +1,5 @@
+EXTRANATIVEPATH += "pigz-native gzip-native"
+DEPENDS += "gzip-native"
+
+# tar may get run by do_unpack or do_populate_lic which could call gzip
+do_unpack[depends] += "gzip-native:do_populate_sysroot"
diff --git a/import-layers/yocto-poky/meta/classes/icecc.bbclass b/import-layers/yocto-poky/meta/classes/icecc.bbclass
new file mode 100644
index 000000000..e1c06c49c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/icecc.bbclass
@@ -0,0 +1,333 @@
+# 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_ENV_EXEC ?= "${STAGING_BINDIR_NATIVE}/icecc-create-env"
+
+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', False):
+ return "icecc-create-env-native"
+ return ""
+
+DEPENDS_prepend += "${@icecc_dep_prepend(d)} "
+
+def get_cross_kernel_cc(bb,d):
+ kernel_cc = d.getVar('KERNEL_CC', False)
+
+ # evaluate the expression by the shell if necessary
+ if '`' in kernel_cc or '$(' in kernel_cc:
+ kernel_cc = os.popen("echo %s" % kernel_cc).read()[:-1]
+
+ kernel_cc = d.expand(kernel_cc)
+ 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', False) 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', False) == "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"
+
+ pn = d.getVar('PN', True)
+
+ system_class_blacklist = []
+ user_class_blacklist = (d.getVar('ICECC_USER_CLASS_BL', False) 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 = [ "uclibc", "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', False) or "").split()
+ user_package_whitelist = (d.getVar('ICECC_USER_PACKAGE_WL', False) 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', False) == "":
+ 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", True) == "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);
+
+# 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', False) or ""
+ if not d.getVar('PARALLEL_MAKE', False) == "" and parallel:
+ d.setVar("PARALLEL_MAKE", parallel)
+
+ 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', False) or "hard"
+ archive_name = prefix + distro + "-" + target_sys + "-" + float
+ if icecc_is_kernel(bb, d):
+ archive_name += "-kernel"
+
+ import socket
+ ice_dir = d.expand('${STAGING_DIR_NATIVE}${prefix_native}')
+ tar_file = os.path.join(ice_dir, 'ice', archive_name + "-@VERSION@-" + socket.gethostname() + '.tar.gz')
+
+ 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))
+
+# 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 bb.utils.which(os.getenv("PATH"), tool)
+ elif icecc_is_kernel(bb, d):
+ return bb.utils.which(os.getenv("PATH"), get_cross_kernel_cc(bb, d))
+ else:
+ ice_dir = d.expand('${STAGING_BINDIR_TOOLCHAIN}')
+ target_sys = d.expand('${TARGET_SYS}')
+ tool_bin = os.path.join(ice_dir, "%s-%s" % (target_sys, tool))
+ if os.path.isfile(tool_bin):
+ return tool_bin
+ else:
+ external_tool_bin = icecc_get_external_tool(bb, d, tool)
+ if os.path.isfile(external_tool_bin):
+ return external_tool_bin
+ else:
+ 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 and os.popen("readlink -f %s" % t).read()[:-1] == 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
+
+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_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
+
+ export ICECC_VERSION ICECC_CC ICECC_CXX
+ export PATH="$ICE_PATH:$PATH"
+ export CCACHE_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
+}
diff --git a/import-layers/yocto-poky/meta/classes/image-buildinfo.bbclass b/import-layers/yocto-poky/meta/classes/image-buildinfo.bbclass
new file mode 100644
index 000000000..197b24235
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/image-buildinfo.bbclass
@@ -0,0 +1,78 @@
+#
+# 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"
+
+# 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, True) or ""
+ if (d.getVarFlag(var, 'type', True) == "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; PSEUDO_UNLOAD=1 git diff --quiet --no-ext-diff" % path,
+ shell=True,
+ stderr=subprocess.STDOUT)
+ return ""
+ except subprocess.CalledProcessError, 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", True) 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', True) != '1':
+ return ""
+ # Single and list variables to be read
+ vars = (d.getVar("IMAGE_BUILDINFO_VARS", True) or "")
+ listvars = (d.getVar("IMAGE_BUILDINFO_LVARS", True) or "")
+ return image_buildinfo_outputvars(vars, listvars, d)
+
+# Write build information to target filesystem
+python buildinfo () {
+ with open(d.expand('${IMAGE_ROOTFS}${sysconfdir}/build'), 'w') as build:
+ build.writelines((
+ '''-----------------------
+Build Configuration: |
+-----------------------
+''',
+ buildinfo_target(d),
+ '''
+-----------------------
+Layer Revisions: |
+-----------------------
+''',
+ get_layer_revs(d)
+ ))
+}
+
+IMAGE_PREPROCESS_COMMAND += "buildinfo;"
diff --git a/import-layers/yocto-poky/meta/classes/image-live.bbclass b/import-layers/yocto-poky/meta/classes/image-live.bbclass
new file mode 100644
index 000000000..c8a861060
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/image-live.bbclass
@@ -0,0 +1,284 @@
+# 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)
+# ${COMPRESSISO} - Transparent compress ISO, reduce size ~40% if set to 1
+# ${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 \
+ ${@oe.utils.ifelse(d.getVar('COMPRESSISO', False),'zisofs-tools-native:do_populate_sysroot','')} \
+ ${PN}:do_image_ext4 \
+ "
+
+
+LABELS_LIVE ?= "boot install"
+ROOT_LIVE ?= "root=/dev/ram0"
+INITRD_IMAGE_LIVE ?= "core-image-minimal-initramfs"
+INITRD_LIVE ?= "${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE_LIVE}-${MACHINE}.cpio.gz"
+
+ROOTFS ?= "${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.ext4"
+
+IMAGE_TYPEDEP_live = "ext4"
+IMAGE_TYPEDEP_iso = "ext4"
+IMAGE_TYPEDEP_hddimg = "ext4"
+IMAGE_TYPES_MASKED += "live hddimg iso"
+
+python() {
+ image_b = d.getVar('IMAGE_BASENAME', True)
+ initrd_i = d.getVar('INITRD_IMAGE_LIVE', True)
+ 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.')
+ else:
+ 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"
+COMPRESSISO ?= "0"
+
+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
+ bbnote "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
+
+ if [ "${COMPRESSISO}" = "1" ] ; then
+ # create compact directory, compress iso
+ mkdir -p ${COMPACT_ISODIR}
+ mkzftree -z 9 -p 4 -F ${ISODIR}/rootfs.img ${COMPACT_ISODIR}/rootfs.img
+
+ # move compact iso to iso, then remove compact directory
+ mv ${COMPACT_ISODIR}/rootfs.img ${ISODIR}/rootfs.img
+ rm -Rf ${COMPACT_ISODIR}
+ mkisofs_compress_opts="-R -z -D -l"
+ else
+ mkisofs_compress_opts="-r"
+ fi
+
+ # 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 ${DEPLOY_DIR_IMAGE}/${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 ${DEPLOY_DIR_IMAGE}/${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 ${DEPLOY_DIR_IMAGE}/${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})
+
+ # Ensure total sectors is an integral number of sectors per
+ # track or mcopy will complain. Sectors are 512 bytes, and we
+ # generate images with 32 sectors per track. This calculation is
+ # done in blocks, thus the mod by 16 instead of 32.
+ BLOCKS=$(expr $BLOCKS + $(expr 16 - $(expr $BLOCKS % 16)))
+
+ # 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} -S 512 -C ${FATIMG} \
+ ${BLOCKS}
+ else
+ mkdosfs ${FATSIZE} -n ${BOOTIMG_VOLUME_ID} -S 512 -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} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
+
+ if [ "${PCBIOS}" = "1" ]; then
+ syslinux_hddimg_install
+ fi
+
+ chmod 644 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
+ fi
+}
+
+python do_bootimg() {
+ set_live_vm_vars(d, 'LIVE')
+ if d.getVar("PCBIOS", True) == "1":
+ bb.build.exec_func('build_syslinux_cfg', d)
+ if d.getVar("EFI", True) == "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/import-layers/yocto-poky/meta/classes/image-mklibs.bbclass b/import-layers/yocto-poky/meta/classes/image-mklibs.bbclass
new file mode 100644
index 000000000..5f6df1b17
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/classes/image-prelink.bbclass b/import-layers/yocto-poky/meta/classes/image-prelink.bbclass
new file mode 100644
index 000000000..4157df021
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/image-prelink.bbclass
@@ -0,0 +1,54 @@
+do_rootfs[depends] += "prelink-native:do_populate_sysroot"
+
+IMAGE_PREPROCESS_COMMAND += "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!
+ ${STAGING_SBINDIR_NATIVE}/prelink --root ${IMAGE_ROOTFS} -amR -N -c ${sysconfdir}/prelink.conf --dynamic-linker $dynamic_loader
+
+ # 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/import-layers/yocto-poky/meta/classes/image-swab.bbclass b/import-layers/yocto-poky/meta/classes/image-swab.bbclass
new file mode 100644
index 000000000..6b02cadaf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/image-swab.bbclass
@@ -0,0 +1,94 @@
+HOST_DATA ?= "${TMPDIR}/host-contamination-data/"
+SWABBER_REPORT ?= "${LOG_DIR}/swabber/"
+SWABBER_LOGS ?= "${LOG_DIR}/contamination-logs"
+TRACE_LOGDIR ?= "${SWABBER_LOGS}/${PACKAGE_ARCH}"
+TRACE_LOGFILE = "${TRACE_LOGDIR}/${PN}-${PV}"
+
+SWAB_ORIG_TASK := "${BB_DEFAULT_TASK}"
+BB_DEFAULT_TASK = "generate_swabber_report"
+
+# Several recipes don't build with parallel make when run under strace
+# Ideally these should be fixed but as a temporary measure disable parallel
+# builds for troublesome recipes
+PARALLEL_MAKE_pn-openssl = ""
+PARALLEL_MAKE_pn-glibc = ""
+PARALLEL_MAKE_pn-glib-2.0 = ""
+PARALLEL_MAKE_pn-libxml2 = ""
+PARALLEL_MAKE_pn-readline = ""
+PARALLEL_MAKE_pn-util-linux = ""
+PARALLEL_MAKE_pn-binutils = ""
+PARALLEL_MAKE_pn-bison = ""
+PARALLEL_MAKE_pn-cmake = ""
+PARALLEL_MAKE_pn-elfutils = ""
+PARALLEL_MAKE_pn-gcc = ""
+PARALLEL_MAKE_pn-gcc-runtime = ""
+PARALLEL_MAKE_pn-m4 = ""
+PARALLEL_MAKE_pn-opkg = ""
+PARALLEL_MAKE_pn-pkgconfig = ""
+PARALLEL_MAKE_pn-prelink = ""
+PARALLEL_MAKE_pn-rpm = ""
+PARALLEL_MAKE_pn-tcl = ""
+PARALLEL_MAKE_pn-beecrypt = ""
+PARALLEL_MAKE_pn-curl = ""
+PARALLEL_MAKE_pn-gmp = ""
+PARALLEL_MAKE_pn-libmpc = ""
+PARALLEL_MAKE_pn-libxslt = ""
+PARALLEL_MAKE_pn-lzo = ""
+PARALLEL_MAKE_pn-popt = ""
+PARALLEL_MAKE_pn-linux-wrs = ""
+PARALLEL_MAKE_pn-libgcrypt = ""
+PARALLEL_MAKE_pn-gpgme = ""
+PARALLEL_MAKE_pn-udev = ""
+PARALLEL_MAKE_pn-gnutls = ""
+
+python() {
+ # NOTE: It might be useful to detect host infection on native and cross
+ # packages but as it turns out to be pretty hard to do this for all native
+ # and cross packages which aren't swabber-native or one of its dependencies
+ # I have ignored them for now...
+ if not bb.data.inherits_class('native', d) and not bb.data.inherits_class('nativesdk', d) and not bb.data.inherits_class('cross', d):
+ deps = (d.getVarFlag('do_setscene', 'depends', True) or "").split()
+ deps.append('strace-native:do_populate_sysroot')
+ d.setVarFlag('do_setscene', 'depends', " ".join(deps))
+ logdir = d.expand("${TRACE_LOGDIR}")
+ bb.utils.mkdirhier(logdir)
+ else:
+ d.setVar('STRACEFUNC', '')
+}
+
+STRACEPID = "${@os.getpid()}"
+STRACEFUNC = "imageswab_attachstrace"
+
+do_configure[prefuncs] += "${STRACEFUNC}"
+do_compile[prefuncs] += "${STRACEFUNC}"
+
+imageswab_attachstrace () {
+ STRACE=`which strace`
+
+ if [ -x "$STRACE" ]; then
+ swabber-strace-attach "$STRACE -f -o ${TRACE_LOGFILE}-${BB_CURRENTTASK}.log -e trace=open,execve -p ${STRACEPID}" "${TRACE_LOGFILE}-traceattach-${BB_CURRENTTASK}.log"
+ fi
+}
+
+do_generate_swabber_report () {
+
+ update_distro ${HOST_DATA}
+
+ # Swabber can't create the directory for us
+ mkdir -p ${SWABBER_REPORT}
+
+ REPORTSTAMP=${SWAB_ORIG_TASK}-`date +%2m%2d%2H%2M%Y`
+
+ if [ `which ccache` ] ; then
+ CCACHE_DIR=`( ccache -s | grep "cache directory" | grep -o '[^ ]*$' 2> /dev/null )`
+ fi
+
+ if [ "$(ls -A ${HOST_DATA})" ]; then
+ echo "Generating swabber report"
+ swabber -d ${HOST_DATA} -l ${SWABBER_LOGS} -o ${SWABBER_REPORT}/report-${REPORTSTAMP}.txt -r ${SWABBER_REPORT}/extra_report-${REPORTSTAMP}.txt -c all -p ${TOPDIR} -f ${OEROOT}/meta/conf/swabber ${TOPDIR} ${OEROOT} ${CCACHE_DIR}
+ else
+ echo "No host data, cannot generate swabber report."
+ fi
+}
+addtask generate_swabber_report after do_${SWAB_ORIG_TASK}
+do_generate_swabber_report[depends] = "swabber-native:do_populate_sysroot"
diff --git a/import-layers/yocto-poky/meta/classes/image-vm.bbclass b/import-layers/yocto-poky/meta/classes/image-vm.bbclass
new file mode 100644
index 000000000..47f73261f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/image-vm.bbclass
@@ -0,0 +1,175 @@
+# image-vm.bbclass
+# (loosly based off image-live.bbclass Copyright (C) 2004, Advanced Micro Devices, Inc.)
+#
+# Create an image which can be placed directly onto a harddisk using dd and then
+# booted.
+#
+# This uses syslinux. extlinux would have been nice but required the ext2/3
+# partition to be mounted. grub requires to run itself as part of the install
+# process.
+#
+# The end result is a 512 boot sector populated with an MBR and partition table
+# followed by an msdos fat16 partition containing syslinux and a linux kernel
+# completed by the ext2/3 rootfs.
+#
+# We have to push the msdos parition table size > 16MB so fat 16 is used as parted
+# won't touch fat12 partitions.
+
+inherit live-vm-common
+
+do_bootdirectdisk[depends] += "dosfstools-native:do_populate_sysroot \
+ virtual/kernel:do_deploy \
+ syslinux:do_populate_sysroot \
+ syslinux-native:do_populate_sysroot \
+ parted-native:do_populate_sysroot \
+ mtools-native:do_populate_sysroot \
+ ${PN}:do_image_ext4 \
+ "
+
+IMAGE_TYPEDEP_vmdk = "ext4"
+IMAGE_TYPEDEP_vdi = "ext4"
+IMAGE_TYPEDEP_qcow2 = "ext4"
+IMAGE_TYPEDEP_hdddirect = "ext4"
+IMAGE_TYPES_MASKED += "vmdk vdi qcow2 hdddirect"
+
+ROOTFS ?= "${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.ext4"
+
+# Used by bootloader
+LABELS_VM ?= "boot"
+ROOT_VM ?= "root=/dev/sda2"
+# Using an initramfs is optional. Enable it by setting INITRD_IMAGE_VM.
+INITRD_IMAGE_VM ?= ""
+INITRD_VM ?= "${@'${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE_VM}-${MACHINE}.cpio.gz' if '${INITRD_IMAGE_VM}' else ''}"
+do_bootdirectdisk[depends] += "${@'${INITRD_IMAGE_VM}:do_image_complete' if '${INITRD_IMAGE_VM}' else ''}"
+
+BOOTDD_VOLUME_ID ?= "boot"
+BOOTDD_EXTRA_SPACE ?= "16384"
+
+DISK_SIGNATURE ?= "${DISK_SIGNATURE_GENERATED}"
+DISK_SIGNATURE[vardepsexclude] = "DISK_SIGNATURE_GENERATED"
+
+build_boot_dd() {
+ HDDDIR="${S}/hdd/boot"
+ HDDIMG="${S}/hdd.image"
+ IMAGE=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hdddirect
+
+ populate_kernel $HDDDIR
+
+ if [ "${PCBIOS}" = "1" ]; then
+ syslinux_hddimg_populate $HDDDIR
+ fi
+ if [ "${EFI}" = "1" ]; then
+ efi_hddimg_populate $HDDDIR
+ fi
+
+ BLOCKS=`du -bks $HDDDIR | cut -f 1`
+ BLOCKS=`expr $BLOCKS + ${BOOTDD_EXTRA_SPACE}`
+
+ # Ensure total sectors is an integral number of sectors per
+ # track or mcopy will complain. Sectors are 512 bytes, and we
+ # generate images with 32 sectors per track. This calculation is
+ # done in blocks, thus the mod by 16 instead of 32.
+ BLOCKS=$(expr $BLOCKS + $(expr 16 - $(expr $BLOCKS % 16)))
+
+ # Remove it since mkdosfs would fail when it exists
+ rm -f $HDDIMG
+ mkdosfs -n ${BOOTDD_VOLUME_ID} -S 512 -C $HDDIMG $BLOCKS
+ mcopy -i $HDDIMG -s $HDDDIR/* ::/
+
+ if [ "${PCBIOS}" = "1" ]; then
+ syslinux_hdddirect_install $HDDIMG
+ fi
+ chmod 644 $HDDIMG
+
+ ROOTFSBLOCKS=`du -Lbks ${ROOTFS} | cut -f 1`
+ TOTALSIZE=`expr $BLOCKS + $ROOTFSBLOCKS`
+ END1=`expr $BLOCKS \* 1024`
+ END2=`expr $END1 + 512`
+ END3=`expr \( $ROOTFSBLOCKS \* 1024 \) + $END1`
+
+ echo $ROOTFSBLOCKS $TOTALSIZE $END1 $END2 $END3
+ rm -rf $IMAGE
+ dd if=/dev/zero of=$IMAGE bs=1024 seek=$TOTALSIZE count=1
+
+ parted $IMAGE mklabel msdos
+ parted $IMAGE mkpart primary fat16 0 ${END1}B
+ parted $IMAGE unit B mkpart primary ext2 ${END2}B ${END3}B
+ parted $IMAGE set 1 boot on
+
+ parted $IMAGE print
+
+ awk "BEGIN { printf \"$(echo ${DISK_SIGNATURE} | fold -w 2 | tac | paste -sd '' | sed 's/\(..\)/\\x&/g')\" }" | \
+ dd of=$IMAGE bs=1 seek=440 conv=notrunc
+
+ OFFSET=`expr $END2 / 512`
+ if [ "${PCBIOS}" = "1" ]; then
+ dd if=${STAGING_DATADIR}/syslinux/mbr.bin of=$IMAGE conv=notrunc
+ fi
+
+ dd if=$HDDIMG of=$IMAGE conv=notrunc seek=1 bs=512
+ dd if=${ROOTFS} of=$IMAGE conv=notrunc seek=$OFFSET bs=512
+
+ cd ${DEPLOY_DIR_IMAGE}
+ rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hdddirect
+ ln -s ${IMAGE_NAME}.hdddirect ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hdddirect
+}
+
+python do_bootdirectdisk() {
+ validate_disk_signature(d)
+ set_live_vm_vars(d, 'VM')
+ if d.getVar("PCBIOS", True) == "1":
+ bb.build.exec_func('build_syslinux_cfg', d)
+ if d.getVar("EFI", True) == "1":
+ bb.build.exec_func('build_efi_cfg', d)
+ bb.build.exec_func('build_boot_dd', d)
+}
+
+def generate_disk_signature():
+ import uuid
+
+ signature = str(uuid.uuid4())[:8]
+
+ if signature != '00000000':
+ return signature
+ else:
+ return 'ffffffff'
+
+def validate_disk_signature(d):
+ import re
+
+ disk_signature = d.getVar("DISK_SIGNATURE", True)
+
+ if not re.match(r'^[0-9a-fA-F]{8}$', disk_signature):
+ bb.fatal("DISK_SIGNATURE '%s' must be an 8 digit hex string" % disk_signature)
+
+DISK_SIGNATURE_GENERATED := "${@generate_disk_signature()}"
+
+run_qemu_img (){
+ type="$1"
+ qemu-img convert -O $type ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hdddirect ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.$type
+ ln -sf ${IMAGE_NAME}.$type ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.$type
+}
+create_vmdk_image () {
+ run_qemu_img vmdk
+}
+
+create_vdi_image () {
+ run_qemu_img vdi
+}
+
+create_qcow2_image () {
+ run_qemu_img qcow2
+}
+
+python do_vmimg() {
+ if 'vmdk' in d.getVar('IMAGE_FSTYPES', True):
+ bb.build.exec_func('create_vmdk_image', d)
+ if 'vdi' in d.getVar('IMAGE_FSTYPES', True):
+ bb.build.exec_func('create_vdi_image', d)
+ if 'qcow2' in d.getVar('IMAGE_FSTYPES', True):
+ bb.build.exec_func('create_qcow2_image', d)
+}
+
+addtask bootdirectdisk before do_vmimg
+addtask vmimg after do_bootdirectdisk before do_image_complete
+do_vmimg[depends] += "qemu-native:do_populate_sysroot"
diff --git a/import-layers/yocto-poky/meta/classes/image.bbclass b/import-layers/yocto-poky/meta/classes/image.bbclass
new file mode 100644
index 000000000..8bfd24193
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/image.bbclass
@@ -0,0 +1,547 @@
+inherit rootfs_${IMAGE_PKGTYPE}
+
+# Only Linux SDKs support populate_sdk_ext, fall back to populate_sdk
+# in the non-Linux SDK_OS case, such as mingw32
+SDKEXTCLASS ?= "${@['populate_sdk', 'populate_sdk_ext']['linux' in d.getVar("SDK_OS", True)]}"
+inherit ${SDKEXTCLASS}
+
+TOOLCHAIN_TARGET_TASK += "${PACKAGE_INSTALL}"
+TOOLCHAIN_TARGET_TASK_ATTEMPTONLY += "${PACKAGE_INSTALL_ATTEMPTONLY}"
+POPULATE_SDK_POST_TARGET_COMMAND += "rootfs_sysroot_relativelinks; "
+
+inherit gzipnative
+
+LICENSE = "MIT"
+PACKAGES = ""
+DEPENDS += "${MLPREFIX}qemuwrapper-cross ${MLPREFIX}depmodwrapper-cross"
+RDEPENDS += "${PACKAGE_INSTALL} ${LINGUAS_INSTALL}"
+RRECOMMENDS += "${PACKAGE_INSTALL_ATTEMPTONLY}"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+TESTIMAGECLASS = "${@base_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 = "${@bb.utils.contains("IMAGE_FEATURES", "package-management", "", "${ROOTFS_PKGMANAGE_BOOTSTRAP}",d)}"
+
+# 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', True) 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}"
+
+# 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-uclibc = ""
+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_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','RM_OLD_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',
+ 'COMPRESSIONTYPES', 'IMAGE_GEN_DEBUGFS', 'ROOTFS_RO_UNNEEDED']
+ 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', True) == "0" or d.getVar('NOHDD', True) == "0":
+ return "image-live"
+ return ""
+ return "image-live"
+
+IMAGE_TYPE_live = "${@build_live(d)}"
+inherit ${IMAGE_TYPE_live}
+
+IMAGE_TYPE_vm = '${@bb.utils.contains_any("IMAGE_FSTYPES", ["vmdk", "vdi", "qcow2", "hdddirect"], "image-vm", "", d)}'
+inherit ${IMAGE_TYPE_vm}
+
+python () {
+ deps = " " + imagetypes_getdepends(d)
+ d.appendVarFlag('do_rootfs', 'depends', deps)
+
+ deps = ""
+ for dep in (d.getVar('EXTRA_IMAGEDEPENDS', True) or "").split():
+ deps += " %s:do_populate_sysroot" % dep
+ d.appendVarFlag('do_build', '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, True) or "").split())
+ remain_features -= replaces
+
+ #Check for conflict image features
+ for feature in remain_features:
+ conflicts = set((d.getVar("IMAGE_FEATURES_CONFLICTS_%s" % feature, True) or "").split())
+ temp = conflicts & remain_features
+ if temp:
+ bb.fatal("%s contains conflicting IMAGE_FEATURES %s %s" % (d.getVar('PN', True), feature, ' '.join(list(temp))))
+
+ d.setVar('IMAGE_FEATURES', ' '.join(list(remain_features)))
+
+ check_image_features(d)
+ initramfs_image = d.getVar('INITRAMFS_IMAGE', True) or ""
+ if initramfs_image != "":
+ d.appendVarFlag('do_build', 'depends', " %s:do_bundle_initramfs" % d.getVar('PN', True))
+ d.appendVarFlag('do_bundle_initramfs', 'depends', " %s:do_image_complete" % initramfs_image)
+}
+
+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', True).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
+
+ # Handle package exclusions
+ excl_pkgs = d.getVar("PACKAGE_EXCLUDE", True).split()
+ inst_pkgs = d.getVar("PACKAGE_INSTALL", True).split()
+ inst_attempt_pkgs = d.getVar("PACKAGE_INSTALL_ATTEMPTONLY", True).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', True), 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', True), 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', True)
+ 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)
+
+ # Generate rootfs
+ create_rootfs(d)
+}
+do_rootfs[dirs] = "${TOPDIR}"
+do_rootfs[cleandirs] += "${S}"
+do_rootfs[umask] = "022"
+addtask rootfs before do_build
+
+fakeroot python do_image () {
+ from oe.utils import execute_pre_post_process
+
+ pre_process_cmds = d.getVar("IMAGE_PREPROCESS_COMMAND", True)
+
+ execute_pre_post_process(d, pre_process_cmds)
+}
+do_image[dirs] = "${TOPDIR}"
+do_image[umask] = "022"
+addtask do_image after do_rootfs before do_build
+
+fakeroot python do_image_complete () {
+ from oe.utils import execute_pre_post_process
+
+ post_process_cmds = d.getVar("IMAGE_POSTPROCESS_COMMAND", True)
+
+ execute_pre_post_process(d, post_process_cmds)
+}
+do_image_complete[dirs] = "${TOPDIR}"
+do_image_complete[umask] = "022"
+addtask do_image_complete after do_image before do_build
+
+#
+# Write environment variables used by wic
+# to tmp/sysroots/<machine>/imgdata/<image>.env
+#
+python do_rootfs_wicenv () {
+ wicvars = d.getVar('WICVARS', True)
+ if not wicvars:
+ return
+
+ stdir = d.getVar('STAGING_DIR_TARGET', True)
+ outdir = os.path.join(stdir, 'imgdata')
+ bb.utils.mkdirhier(outdir)
+ basename = d.getVar('IMAGE_BASENAME', True)
+ with open(os.path.join(outdir, basename) + '.env', 'w') as envf:
+ for var in wicvars.split():
+ value = d.getVar(var, True)
+ 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'
+
+def setup_debugfs_variables(d):
+ d.appendVar('IMAGE_ROOTFS', '-dbg')
+ d.appendVar('IMAGE_LINK_NAME', '-dbg')
+ d.appendVar('IMAGE_NAME','-dbg')
+ debugfs_image_fstypes = d.getVar('IMAGE_FSTYPES_DEBUGFS', True)
+ if debugfs_image_fstypes:
+ d.setVar('IMAGE_FSTYPES', debugfs_image_fstypes)
+
+python setup_debugfs () {
+ setup_debugfs_variables(d)
+}
+
+python () {
+ vardeps = set()
+ ctypes = d.getVar('COMPRESSIONTYPES', True).split()
+ old_overrides = d.getVar('OVERRIDES', 0)
+
+ 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', True).split()
+ typedeps = {}
+
+ if d.getVar('IMAGE_GEN_DEBUGFS', True) == "1":
+ debugfs_fstypes = d.getVar('IMAGE_FSTYPES_DEBUGFS', True).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, True) 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', True) or "").split()
+
+ 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))
+ bb.data.update_data(localdata)
+ 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
+ localdata.delVar('DATETIME')
+ localdata.delVar('TMPDIR')
+
+ image_cmd = localdata.getVar("IMAGE_CMD", True)
+ 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 ${DEPLOY_DIR_IMAGE}"))
+
+ rm_tmp_images = set()
+ def gen_conversion_cmds(bt):
+ for ctype in 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)
+ cmds.append("\t" + localdata.getVar("COMPRESS_CMD_" + ctype, True))
+ vardeps.add('COMPRESS_CMD_' + ctype)
+ subimages.append(type + "." + ctype)
+ 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 rm_tmp_images:
+ cmds.append("\trm " + image)
+
+ after = 'do_image'
+ for dep in typedeps[t]:
+ after += ' do_image_%s' % dep.replace("-", "_").replace(".", "_")
+
+ t = t.replace("-", "_").replace(".", "_")
+
+ d.setVar('do_image_%s' % t, '\n'.join(cmds))
+ d.setVarFlag('do_image_%s' % t, 'func', '1')
+ d.setVarFlag('do_image_%s' % t, 'fakeroot', '1')
+ d.setVarFlag('do_image_%s' % t, 'prefuncs', debug + 'set_image_size')
+ d.setVarFlag('do_image_%s' % t, 'postfuncs', 'create_symlinks')
+ d.setVarFlag('do_image_%s' % t, 'subimages', ' '.join(subimages))
+ d.appendVarFlag('do_image_%s' % t, 'vardeps', ' '.join(vardeps))
+ d.appendVarFlag('do_image_%s' % t, 'vardepsexclude', 'DATETIME')
+
+ bb.debug(2, "Adding type %s before %s, after %s" % (t, 'do_image_complete', after))
+ bb.build.addtask('do_image_%s' % t, 'do_image_complete', after, d)
+}
+
+#
+# Compute the rootfs size
+#
+def get_rootfs_size(d):
+ import subprocess
+
+ rootfs_alignment = int(d.getVar('IMAGE_ROOTFS_ALIGNMENT', True))
+ overhead_factor = float(d.getVar('IMAGE_OVERHEAD_FACTOR', True))
+ rootfs_req_size = int(d.getVar('IMAGE_ROOTFS_SIZE', True))
+ rootfs_extra_space = eval(d.getVar('IMAGE_ROOTFS_EXTRA_SPACE', True))
+ rootfs_maxsize = d.getVar('IMAGE_ROOTFS_MAXSIZE', True)
+ image_fstypes = d.getVar('IMAGE_FSTYPES', True) or ''
+ initramfs_fstypes = d.getVar('INITRAMFS_FSTYPES', True) or ''
+ initramfs_maxsize = d.getVar('INITRAMFS_MAXSIZE', True)
+
+ output = subprocess.check_output(['du', '-ks',
+ d.getVar('IMAGE_ROOTFS', True)])
+ size_kb = int(output.split()[0])
+ base_size = size_kb * overhead_factor
+ base_size = max(base_size, rootfs_req_size) + rootfs_extra_space
+
+ if base_size != int(base_size):
+ base_size = int(base_size + 1)
+ else:
+ base_size = int(base_size)
+
+ base_size += rootfs_alignment - 1
+ base_size -= base_size % rootfs_alignment
+
+ # 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")
+ 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('DEPLOY_DIR_IMAGE', True)
+ img_name = d.getVar('IMAGE_NAME', True)
+ link_name = d.getVar('IMAGE_LINK_NAME', True)
+ manifest_name = d.getVar('IMAGE_MANIFEST', True)
+ taskname = d.getVar("BB_CURRENTTASK", True)
+ subimages = (d.getVarFlag("do_" + taskname, 'subimages', False) or "").split()
+ imgsuffix = d.getVarFlag("do_" + taskname, 'imgsuffix', True) or d.expand("${IMAGE_NAME_SUFFIX}.")
+ os.chdir(deploy_dir)
+
+ if not link_name:
+ return
+ for type in subimages:
+ if os.path.exists(img_name + imgsuffix + type):
+ dst = deploy_dir + "/" + link_name + "." + type
+ src = img_name + imgsuffix + type
+ bb.note("Creating symlink: %s -> %s" % (dst, src))
+ if os.path.islink(dst):
+ if d.getVar('RM_OLD_IMAGE', True) == "1" and \
+ os.path.exists(os.path.realpath(dst)):
+ os.remove(os.path.realpath(dst))
+ os.remove(dst)
+ os.symlink(src, dst)
+}
+
+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"
+do_populate_sysroot[noexec] = "1"
+do_package[noexec] = "1"
+do_package_qa[noexec] = "1"
+do_packagedata[noexec] = "1"
+do_package_write_ipk[noexec] = "1"
+do_package_write_deb[noexec] = "1"
+do_package_write_rpm[noexec] = "1"
+
+# Allow the kernel to be repacked with the initramfs and boot image file as a single file
+do_bundle_initramfs[depends] += "virtual/kernel:do_bundle_initramfs"
+do_bundle_initramfs[nostamp] = "1"
+do_bundle_initramfs[noexec] = "1"
+do_bundle_initramfs () {
+ :
+}
+addtask bundle_initramfs after do_image_complete
diff --git a/import-layers/yocto-poky/meta/classes/image_types.bbclass b/import-layers/yocto-poky/meta/classes/image_types.bbclass
new file mode 100644
index 000000000..53af7ca8d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/image_types.bbclass
@@ -0,0 +1,299 @@
+# 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 i in (depstr or "").split():
+ if i not in deps:
+ deps.append(i)
+
+ deps = []
+ ctypes = d.getVar('COMPRESSIONTYPES', True).split()
+ fstypes = set((d.getVar('IMAGE_FSTYPES', True) or "").split())
+ fstypes |= set((d.getVar('IMAGE_FSTYPES_DEBUGFS', True) or "").split())
+ for type in fstypes:
+ if type in ["vmdk", "vdi", "qcow2", "hdddirect", "live", "iso", "hddimg"]:
+ type = "ext4"
+ basetype = type
+ for ctype in ctypes:
+ if type.endswith("." + ctype):
+ basetype = type[:-len("." + ctype)]
+ adddep(d.getVar("COMPRESS_DEPENDS_%s" % ctype, True), deps)
+ break
+ for typedepends in (d.getVar("IMAGE_TYPEDEP_%s" % basetype, True) or "").split():
+ adddep(d.getVar('IMAGE_DEPENDS_%s' % typedepends, True) , deps)
+ adddep(d.getVar('IMAGE_DEPENDS_%s' % basetype, True) , deps)
+
+ depstr = ""
+ for dep in deps:
+ depstr += " " + dep + ":do_populate_sysroot"
+ return depstr
+
+
+XZ_COMPRESSION_LEVEL ?= "-e -6"
+XZ_INTEGRITY_CHECK ?= "crc32"
+XZ_THREADS ?= "-T 0"
+
+JFFS2_SUM_EXTRA_ARGS ?= ""
+IMAGE_CMD_jffs2 = "mkfs.jffs2 --root=${IMAGE_ROOTFS} --faketime --output=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.jffs2 ${EXTRA_IMAGECMD}"
+
+IMAGE_CMD_cramfs = "mkfs.cramfs ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${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
+ dd if=/dev/zero of=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$fstype seek=$ROOTFS_SIZE count=$COUNT bs=1024
+ mkfs.$fstype -F $extra_imagecmd ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$fstype -d ${IMAGE_ROOTFS}
+}
+
+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 () {
+ if [ ${ROOTFS_SIZE} -gt ${MIN_BTRFS_SIZE} ]; then
+ dd if=/dev/zero of=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.btrfs count=${ROOTFS_SIZE} bs=1024
+ mkfs.btrfs ${EXTRA_IMAGECMD} -r ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.btrfs
+ else
+ bbfatal "Rootfs is too small for BTRFS (Rootfs Actual Size: ${ROOTFS_SIZE}, BTRFS Minimum Size: ${MIN_BTRFS_SIZE})"
+ fi
+}
+
+IMAGE_CMD_squashfs = "mksquashfs ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.squashfs ${EXTRA_IMAGECMD} -noappend"
+IMAGE_CMD_squashfs-xz = "mksquashfs ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.squashfs-xz ${EXTRA_IMAGECMD} -noappend -comp xz"
+IMAGE_CMD_squashfs-lzo = "mksquashfs ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.squashfs-lzo ${EXTRA_IMAGECMD} -noappend -comp lzo"
+
+# 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=*"
+# IMAGE_DEPENDS_tar_append = " tar-replacement-native"
+# 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"
+IMAGE_CMD_tar = "${IMAGE_CMD_TAR} -cvf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.tar -C ${IMAGE_ROOTFS} ."
+
+do_image_cpio[cleandirs] += "${WORKDIR}/cpio_append"
+IMAGE_CMD_cpio () {
+ (cd ${IMAGE_ROOTFS} && find . | cpio -o -H newc >${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.cpio)
+ if [ ! -L ${IMAGE_ROOTFS}/init -a ! -e ${IMAGE_ROOTFS}/init ]; then
+ if [ -L ${IMAGE_ROOTFS}/sbin/init -o -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 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.cpio)
+ fi
+}
+
+ELF_KERNEL ?= "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}"
+ELF_APPEND ?= "ramdisk_size=32768 root=/dev/ram0 rw console="
+
+IMAGE_CMD_elf () {
+ test -f ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.elf && rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.elf
+ mkelfImage --kernel=${ELF_KERNEL} --initrd=${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.cpio.gz --output=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.elf --append='${ELF_APPEND}' ${EXTRA_IMAGECMD}
+}
+
+IMAGE_TYPEDEP_elf = "cpio.gz"
+
+UBI_VOLNAME ?= "${MACHINE}-rootfs"
+
+multiubi_mkfs() {
+ local mkubifs_args="$1"
+ local ubinize_args="$2"
+ 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=${DEPLOY_DIR_IMAGE}/${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 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}${vname}${IMAGE_NAME_SUFFIX}.ubifs ${mkubifs_args}
+ ubinize -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}${vname}${IMAGE_NAME_SUFFIX}.ubi ${ubinize_args} ubinize${vname}-${IMAGE_NAME}.cfg
+
+ # Cleanup cfg file
+ mv ubinize${vname}-${IMAGE_NAME}.cfg ${DEPLOY_DIR_IMAGE}/
+
+ # Create own symlinks for 'named' volumes
+ if [ -n "$vname" ]; then
+ cd ${DEPLOY_DIR_IMAGE}
+ 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 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.ubifs ${MKUBIFS_ARGS}"
+
+WKS_FILE ?= "${IMAGE_BASENAME}.${MACHINE}.wks"
+WKS_FILES ?= "${WKS_FILE} ${IMAGE_BASENAME}.wks"
+WKS_SEARCH_PATH ?= "${THISDIR}:${@':'.join('%s/scripts/lib/wic/canned-wks' % l for l in '${BBPATH}:${COREBASE}'.split(':'))}"
+WKS_FULL_PATH = "${@wks_search('${WKS_FILES}'.split(), '${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
+
+IMAGE_CMD_wic () {
+ out="${DEPLOY_DIR_IMAGE}/${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_TARGET}/imgdata/" -e "${IMAGE_BASENAME}" -o "$out/"
+ mv "$out/build/$(basename "${wks%.wks}")"*.direct "$out${IMAGE_NAME_SUFFIX}.wic"
+ rm -rf "$out/"
+}
+IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH WKS_FILES"
+
+# 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 '${COMPRESSIONTYPES}'.split()), '1', '', d)}"
+do_image_wic[file-checksums] += "${@'${WKS_FULL_PATH}:%s' % os.path.exists('${WKS_FULL_PATH}') if '${USING_WIC}' else ''}"
+
+EXTRA_IMAGECMD = ""
+
+inherit siteinfo
+JFFS2_ENDIANNESS ?= "${@base_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_elf ?= ""
+
+IMAGE_DEPENDS = ""
+IMAGE_DEPENDS_jffs2 = "mtd-utils-native"
+IMAGE_DEPENDS_cramfs = "util-linux-native"
+IMAGE_DEPENDS_ext2 = "e2fsprogs-native"
+IMAGE_DEPENDS_ext3 = "e2fsprogs-native"
+IMAGE_DEPENDS_ext4 = "e2fsprogs-native"
+IMAGE_DEPENDS_btrfs = "btrfs-tools-native"
+IMAGE_DEPENDS_squashfs = "squashfs-tools-native"
+IMAGE_DEPENDS_squashfs-xz = "squashfs-tools-native"
+IMAGE_DEPENDS_squashfs-lzo = "squashfs-tools-native"
+IMAGE_DEPENDS_elf = "virtual/kernel mkelfimage-native"
+IMAGE_DEPENDS_ubi = "mtd-utils-native"
+IMAGE_DEPENDS_ubifs = "mtd-utils-native"
+IMAGE_DEPENDS_multiubi = "mtd-utils-native"
+IMAGE_DEPENDS_wic = "parted-native"
+
+# 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 \
+ ubi ubifs multiubi \
+ tar tar.gz tar.bz2 tar.xz tar.lz4 \
+ cpio cpio.gz cpio.xz cpio.lzma cpio.lz4 \
+ vmdk \
+ vdi \
+ qcow2 \
+ hdddirect \
+ elf \
+ wic wic.gz wic.bz2 wic.lzma \
+"
+
+COMPRESSIONTYPES = "gz bz2 lzma xz lz4 sum md5sum sha1sum sha224sum sha256sum sha384sum sha512sum"
+COMPRESS_CMD_lzma = "lzma -k -f -7 ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
+COMPRESS_CMD_gz = "gzip -f -9 -c ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.gz"
+COMPRESS_CMD_bz2 = "pbzip2 -f -k ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
+COMPRESS_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"
+COMPRESS_CMD_lz4 = "lz4c -9 -c ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.lz4"
+COMPRESS_CMD_sum = "sumtool -i ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} -o ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sum ${JFFS2_SUM_EXTRA_ARGS}"
+COMPRESS_CMD_md5sum = "md5sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.md5sum"
+COMPRESS_CMD_sha1sum = "sha1sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sha1sum"
+COMPRESS_CMD_sha224sum = "sha224sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sha224sum"
+COMPRESS_CMD_sha256sum = "sha256sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sha256sum"
+COMPRESS_CMD_sha384sum = "sha384sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sha384sum"
+COMPRESS_CMD_sha512sum = "sha512sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sha512sum"
+COMPRESS_DEPENDS_lzma = "xz-native"
+COMPRESS_DEPENDS_gz = ""
+COMPRESS_DEPENDS_bz2 = "pbzip2-native"
+COMPRESS_DEPENDS_xz = "xz-native"
+COMPRESS_DEPENDS_lz4 = "lz4-native"
+COMPRESS_DEPENDS_sum = "mtd-utils-native"
+
+RUNNABLE_IMAGE_TYPES ?= "ext2 ext3 ext4"
+RUNNABLE_MACHINE_PATTERNS ?= "qemu"
+
+DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso"
+
+# Use IMAGE_EXTENSION_xxx to map image type 'xxx' with real image file extension name(s) for Hob
+IMAGE_EXTENSION_live = "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 ?= ""
+
+# 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 DEPLOY_DIR_IMAGE HDDDIR IMAGE_BASENAME IMAGE_BOOT_FILES IMAGE_LINK_NAME IMAGE_ROOTFS INITRAMFS_FSTYPES INITRD ISODIR MACHINE_ARCH ROOTFS_SIZE STAGING_DATADIR STAGING_DIR_NATIVE STAGING_LIBDIR TARGET_SYS"
diff --git a/import-layers/yocto-poky/meta/classes/image_types_uboot.bbclass b/import-layers/yocto-poky/meta/classes/image_types_uboot.bbclass
new file mode 100644
index 000000000..19e4aa2e4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/image_types_uboot.bbclass
@@ -0,0 +1,26 @@
+inherit image_types kernel-arch
+
+oe_mkimage () {
+ mkimage -A ${UBOOT_ARCH} -O linux -T ramdisk -C $2 -n ${IMAGE_NAME} \
+ -d ${DEPLOY_DIR_IMAGE}/$1 ${DEPLOY_DIR_IMAGE}/$1.u-boot
+ if [ x$3 = x"clean" ]; then
+ rm $1
+ fi
+}
+
+COMPRESSIONTYPES += "gz.u-boot bz2.u-boot lzma.u-boot u-boot"
+
+COMPRESS_DEPENDS_u-boot = "u-boot-mkimage-native"
+COMPRESS_CMD_u-boot = "oe_mkimage ${IMAGE_NAME}.rootfs.${type} none"
+
+COMPRESS_DEPENDS_gz.u-boot = "u-boot-mkimage-native"
+COMPRESS_CMD_gz.u-boot = "${COMPRESS_CMD_gz}; oe_mkimage ${IMAGE_NAME}.rootfs.${type}.gz gzip clean"
+
+COMPRESS_DEPENDS_bz2.u-boot = "u-boot-mkimage-native"
+COMPRESS_CMD_bz2.u-boot = "${COMPRESS_CMD_bz2}; oe_mkimage ${IMAGE_NAME}.rootfs.${type}.bz2 bzip2 clean"
+
+COMPRESS_DEPENDS_lzma.u-boot = "u-boot-mkimage-native"
+COMPRESS_CMD_lzma.u-boot = "${COMPRESS_CMD_lzma}; oe_mkimage ${IMAGE_NAME}.rootfs.${type}.lzma lzma clean"
+
+IMAGE_TYPES += "ext2.u-boot ext2.gz.u-boot ext2.bz2.u-boot ext2.lzma.u-boot ext3.gz.u-boot ext4.gz.u-boot cpio.gz.u-boot"
+
diff --git a/import-layers/yocto-poky/meta/classes/insane.bbclass b/import-layers/yocto-poky/meta/classes/insane.bbclass
new file mode 100644
index 000000000..c57b21735
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/insane.bbclass
@@ -0,0 +1,1319 @@
+# 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
+
+
+# unsafe-references-in-binaries requires prelink-rtld from
+# prelink-native, but we don't want this DEPENDS for -native builds
+QADEPENDS = "prelink-native"
+QADEPENDS_class-native = ""
+QADEPENDS_class-nativesdk = ""
+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 file-rdeps \
+ unknown-configure-option symlink-to-sysroot multilib \
+ invalid-packageconfig host-user-contaminated \
+ "
+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 \
+ "
+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():
+ return {
+ "darwin9" : {
+ "arm" : (40, 0, 0, True, 32),
+ },
+ "eabi" : {
+ "arm" : (40, 0, 0, True, 32),
+ },
+ "elf" : {
+ "i586" : (3, 0, 0, True, 32),
+ "x86_64": (62, 0, 0, True, 64),
+ "epiphany": (4643, 0, 0, True, 32),
+ },
+ "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),
+ "nios2": (113, 0, 0, True, 32),
+ "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-uclibc" : {
+ "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),
+ "avr32": (6317, 0, 0, False, 32),
+ "sh4": (42, 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),
+ },
+ "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-uclibceabi" : {
+ "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-uclibcspe" : {
+ "powerpc": (20, 0, 0, False, 32),
+ },
+ "linux-gnu" : {
+ "powerpc": (20, 0, 0, False, 32),
+ "sh4": (42, 0, 0, True, 32),
+ },
+ "linux-gnux32" : {
+ "x86_64": (62, 0, 0, True, 32),
+ },
+ "linux-gnun32" : {
+ "mips64": ( 8, 0, 0, False, 32),
+ "mips64el": ( 8, 0, 0, True, 32),
+ },
+ }
+
+
+def package_qa_clean_path(path,d):
+ """ Remove the common prefix from the path. In this case it is the TMPDIR"""
+ return path.replace(d.getVar("TMPDIR", True) + "/", "")
+
+def package_qa_write_error(type, error, d):
+ logfile = d.getVar('QA_LOGFILE', True)
+ if logfile:
+ p = d.getVar('P', True)
+ f = file( logfile, "a+")
+ print >> f, "%s: %s [%s]" % (p, error, type)
+ f.close()
+
+def package_qa_handle_error(error_class, error_msg, d):
+ package_qa_write_error(error_class, error_msg, d)
+ if error_class in (d.getVar("ERROR_QA", True) or "").split():
+ 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", True) or "").split():
+ 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', True)
+ 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', True), d.getVar('STAGING_DIR_TARGET', True)]
+
+ 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", True)
+ base_libdir = d.getVar("base_libdir", True)
+
+ 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', True)
+ base_libdir = d.getVar("base_libdir",True) + os.sep
+ libdir = d.getVar("libdir", True) + os.sep
+ libexecdir = d.getVar("libexecdir", True) + os.sep
+ exec_prefix = d.getVar("exec_prefix", True) + 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, True) or "").split():
+ bb.note("Package %s skipping libdir QA test" % (package))
+ skippackages.append(package)
+ elif d.getVar('PACKAGE_DEBUG_SPLIT_STYLE', True) == '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):
+ 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[unsafe-references-in-binaries] = "package_qa_check_unsafe_references_in_binaries"
+def package_qa_check_unsafe_references_in_binaries(path, name, d, elf, messages):
+ """
+ Ensure binaries in base_[bindir|sbindir|libdir] do not link to files under exec_prefix
+ """
+ if unsafe_references_skippable(path, name, d):
+ return
+
+ if elf:
+ import subprocess as sub
+ pn = d.getVar('PN', True)
+
+ exec_prefix = d.getVar('exec_prefix', True)
+ sysroot_path = d.getVar('STAGING_DIR_TARGET', True)
+ sysroot_path_usr = sysroot_path + exec_prefix
+
+ try:
+ ldd_output = bb.process.Popen(["prelink-rtld", "--root", sysroot_path, path], stdout=sub.PIPE).stdout.read()
+ except bb.process.CmdError:
+ error_msg = pn + ": prelink-rtld aborted when processing %s" % path
+ package_qa_handle_error("unsafe-references-in-binaries", error_msg, d)
+ return False
+
+ if sysroot_path_usr in ldd_output:
+ ldd_output = ldd_output.replace(sysroot_path, "")
+
+ pkgdest = d.getVar('PKGDEST', True)
+ packages = d.getVar('PACKAGES', True)
+
+ for package in packages.split():
+ short_path = path.replace('%s/%s' % (pkgdest, package), "", 1)
+ if (short_path != path):
+ break
+
+ base_err = pn + ": %s, installed in the base_prefix, requires a shared library under exec_prefix (%s)" % (short_path, exec_prefix)
+ for line in ldd_output.split('\n'):
+ if exec_prefix in line:
+ error_msg = "%s: %s" % (base_err, line.strip())
+ package_qa_handle_error("unsafe-references-in-binaries", error_msg, d)
+
+ return False
+
+QAPATHTEST[unsafe-references-in-scripts] = "package_qa_check_unsafe_references_in_scripts"
+def package_qa_check_unsafe_references_in_scripts(path, name, d, elf, messages):
+ """
+ Warn if scripts in base_[bindir|sbindir|libdir] reference files under exec_prefix
+ """
+ if unsafe_references_skippable(path, name, d):
+ return
+
+ if not elf:
+ import stat
+ import subprocess
+ pn = d.getVar('PN', True)
+
+ # Ensure we're checking an executable script
+ statinfo = os.stat(path)
+ if bool(statinfo.st_mode & stat.S_IXUSR):
+ # grep shell scripts for possible references to /exec_prefix/
+ exec_prefix = d.getVar('exec_prefix', True)
+ statement = "grep -e '%s/[^ :]\{1,\}/[^ :]\{1,\}' %s > /dev/null" % (exec_prefix, path)
+ if subprocess.call(statement, shell=True) == 0:
+ error_msg = pn + ": Found a reference to %s/ in %s" % (exec_prefix, path)
+ package_qa_handle_error("unsafe-references-in-scripts", error_msg, d)
+ error_msg = "Shell scripts in base_bindir and base_sbindir should not reference anything in exec_prefix"
+ package_qa_handle_error("unsafe-references-in-scripts", error_msg, d)
+
+def unsafe_references_skippable(path, name, d):
+ if bb.data.inherits_class('native', d) or bb.data.inherits_class('nativesdk', d):
+ return True
+
+ if "-dbg" in name or "-dev" in name:
+ return True
+
+ # Other package names to skip:
+ if name.startswith("kernel-module-"):
+ return True
+
+ # Skip symlinks
+ if os.path.islink(path):
+ return True
+
+ # Skip unusual rootfs layouts which make these tests irrelevant
+ exec_prefix = d.getVar('exec_prefix', True)
+ if exec_prefix == "":
+ return True
+
+ pkgdest = d.getVar('PKGDEST', True)
+ pkgdest = pkgdest + "/" + name
+ pkgdest = os.path.abspath(pkgdest)
+ base_bindir = pkgdest + d.getVar('base_bindir', True)
+ base_sbindir = pkgdest + d.getVar('base_sbindir', True)
+ base_libdir = pkgdest + d.getVar('base_libdir', True)
+ bindir = pkgdest + d.getVar('bindir', True)
+ sbindir = pkgdest + d.getVar('sbindir', True)
+ libdir = pkgdest + d.getVar('libdir', True)
+
+ if base_bindir == bindir and base_sbindir == sbindir and base_libdir == libdir:
+ return True
+
+ # Skip files not in base_[bindir|sbindir|libdir]
+ path = os.path.abspath(path)
+ if not (base_bindir in path or base_sbindir in path or base_libdir in path):
+ return True
+
+ return False
+
+QAPATHTEST[arch] = "package_qa_check_arch"
+def package_qa_check_arch(path,name,d, elf, messages):
+ """
+ Check if archs are compatible
+ """
+ if not elf:
+ return
+
+ target_os = d.getVar('TARGET_OS', True)
+ target_arch = d.getVar('TARGET_ARCH', True)
+ provides = d.getVar('PROVIDES', True)
+ bpn = d.getVar('BPN', True)
+
+ if target_arch == "allarch":
+ pn = d.getVar('PN', True)
+ 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()[target_os][target_arch]
+
+ # Check the architecture and endiannes of the binary
+ if not ((machine == elf.machine()) or \
+ ((("virtual/kernel" in provides) or bb.data.inherits_class("module", d) ) and (target_os == "linux-gnux32" or target_os == "linux-gnun32"))):
+ package_qa_add_message(messages, "arch", "Architecture did not match (%d to %d) on %s" % \
+ (machine, elf.machine(), package_qa_clean_path(path,d)))
+ elif not ((bits == elf.abiSize()) or \
+ ((("virtual/kernel" in provides) or bb.data.inherits_class("module", d) ) and (target_os == "linux-gnux32" or target_os == "linux-gnun32"))):
+ 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',True),'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', True)
+ if not gnu_hash:
+ gnu_hash = "--hash-style=both" in d.getVar('LDFLAGS', True)
+ 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', True)
+ with open(path) as f:
+ file_content = f.read()
+ 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', True) or ''
+ for rdep in bb.utils.explode_deps(d.getVar('RDEPENDS_' + name, True) 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', True)
+ if target.startswith(tmpdir):
+ trimmed = path.replace(os.path.join (d.getVar("PKGDEST", True), name), "")
+ package_qa_add_message(messages, "symlink-to-sysroot", "Symlink %s in %s points to TMPDIR" % (trimmed, name))
+
+def package_qa_check_license(workdir, d):
+ """
+ Check for changes in the license files
+ """
+ import tempfile
+ sane = True
+
+ lic_files = d.getVar('LIC_FILES_CHKSUM', True)
+ lic = d.getVar('LICENSE', True)
+ pn = d.getVar('PN', True)
+
+ if lic == "CLOSED":
+ return
+
+ if not lic_files:
+ package_qa_handle_error("license-checksum", pn + ": Recipe file does not have license file information (LIC_FILES_CHKSUM)", d)
+ return
+
+ srcdir = d.getVar('S', True)
+
+ for url in lic_files.split():
+ try:
+ (type, host, path, user, pswd, parm) = bb.fetch.decodeurl(url)
+ except bb.fetch.MalformedUrl:
+ 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
+
+ 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)
+ else:
+ fi = open(srclicfile, 'rb')
+ fo = tempfile.NamedTemporaryFile(mode='wb', prefix='poky.', suffix='.tmp', delete=False)
+ tmplicfile = fo.name;
+ lineno = 0
+ linesout = 0
+ for line in fi:
+ lineno += 1
+ if (lineno >= beginline):
+ if ((lineno <= endline) or not endline):
+ fo.write(line)
+ linesout += 1
+ else:
+ break
+ fo.flush()
+ fo.close()
+ fi.close()
+ md5chksum = bb.utils.md5_file(tmplicfile)
+ 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
+ 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
+ package_qa_handle_error("license-checksum", msg, d)
+
+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', True)
+ workdir = os.path.join(tmpdir, "work")
+
+ 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()
+ 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()
+ 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
+
+# Walk over all files in a directory and call func
+def package_qa_walk(warnfuncs, errorfuncs, skip, package, d):
+ import oe.qa
+
+ #if this will throw an exception, then fix the dict above
+ target_os = d.getVar('TARGET_OS', True)
+ target_arch = d.getVar('TARGET_ARCH', True)
+
+ 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', pkg)
+ bb.data.update_data(localdata)
+
+ # Now check the RDEPENDS
+ rdepends = bb.utils.explode_deps(localdata.getVar('RDEPENDS', True) 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", True)
+ 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'])
+ # 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 rdep_data[key].split():
+ if subkey not in ignored_file_rdeps:
+ # 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 sub_rdeps.split():
+ if sub_rdep in done:
+ continue
+ if not sub_rdep.startswith('(') and \
+ 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', True) + "python", "python" ]:
+ if py in done:
+ filerdepends.pop("/usr/bin/python",None)
+ done.remove(py)
+ for rdep in done:
+ # 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 rdep_data[key].split():
+ 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)
+
+def package_qa_check_deps(pkg, pkgdest, skip, d):
+
+ localdata = bb.data.createCopy(d)
+ localdata.setVar('OVERRIDES', pkg)
+ bb.data.update_data(localdata)
+
+ def check_valid_deps(var):
+ try:
+ rvar = bb.utils.explode_dep_versions2(localdata.getVar(var, True) 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')
+
+QAPATHTEST[expanded-d] = "package_qa_check_expanded_d"
+def package_qa_check_expanded_d(path,name,d,elf,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',True)
+
+ # Get packages for current recipe and iterate
+ packages = d.getVar('PACKAGES', True).split(" ")
+ for pak in packages:
+ # Go through all variables and check if expanded D is found, warn the user accordingly
+ for var in 'FILES','pkg_preinst', 'pkg_postinst', 'pkg_prerm', 'pkg_postrm':
+ bbvar = d.getVar(var + "_" + pak, False)
+ if bbvar:
+ # Bitbake expands ${D} within bbvar during the previous step, so we check for its expanded value
+ 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" % pak)
+ sane = False
+ else:
+ package_qa_add_message(messages, "expanded-d", "%s in %s recipe contains ${D}, it should be replaced by $D instead" % (var, pak))
+ sane = False
+ return sane
+
+def package_qa_check_encoding(keys, encode, d):
+ def check_encoding(key,enc):
+ sane = True
+ value = d.getVar(key, True)
+ if value:
+ try:
+ s = unicode(value, 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', True)
+ pn = d.getVar('PN', True)
+ 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', True))
+ 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', True))
+ 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', True)
+ pkg = d.getVar('PN', True)
+
+ # 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." % (pkg, 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." % (pkg, installlog)
+ package_qa_handle_error("install-host-path", msg, d)
+
+ # Scan the packages...
+ pkgdest = d.getVar('PKGDEST', True)
+ packages = set((d.getVar('PACKAGES', True) 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
+
+ testmatrix = d.getVarFlags("QAPATHTEST")
+ 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])
+
+ g = globals()
+ for package in packages:
+ skip = (d.getVar('INSANE_SKIP_' + package, True) or "").split()
+ if skip:
+ bb.note("Package %s skipping QA tests: %s" % (package, str(skip)))
+ warnchecks = []
+ for w in (d.getVar("WARN_QA", True) or "").split():
+ if w in skip:
+ continue
+ if w in testmatrix and testmatrix[w] in g:
+ warnchecks.append(g[testmatrix[w]])
+ if w == 'unsafe-references-in-binaries':
+ oe.utils.write_ld_so_conf(d)
+
+ errorchecks = []
+ for e in (d.getVar("ERROR_QA", True) or "").split():
+ if e in skip:
+ continue
+ if e in testmatrix and testmatrix[e] in g:
+ errorchecks.append(g[testmatrix[e]])
+ if e == 'unsafe-references-in-binaries':
+ oe.utils.write_ld_so_conf(d)
+
+ 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)
+
+ path = "%s/%s" % (pkgdest, package)
+ package_qa_walk(warnchecks, errorchecks, skip, package, d)
+
+ package_qa_check_rdepends(package, pkgdest, skip, taskdeps, packages, d)
+ package_qa_check_deps(package, pkgdest, skip, d)
+
+ if 'libdir' in d.getVar("ALL_QA", True).split():
+ package_qa_check_libdir(d)
+
+ qa_sane = d.getVar("QA_SANE", True)
+ if not qa_sane:
+ bb.fatal("QA run found fatal errors. Please consider fixing them.")
+ bb.note("DONE with PACKAGE QA")
+}
+
+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', True)
+
+ 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', True) or ""
+ if "gettext" not in d.getVar('P', True) and "gcc-runtime" not in d.getVar('P', True) and "--disable-nls" not in cnf:
+ ml = d.getVar("MLPREFIX", True) or ""
+ 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('nativesdk', d):
+ gt = "gettext-native"
+ elif bb.data.inherits_class('cross-canadian', d):
+ gt = "nativesdk-gettext"
+ else:
+ gt = "virtual/" + ml + "gettext"
+ deps = bb.utils.explode_deps(d.getVar('DEPENDS', True) 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 license variables
+ ###########################################################################
+
+ package_qa_check_license(workdir, d)
+
+ ###########################################################################
+ # 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', True), 'config.log')
+ output = subprocess.check_output(['grep', '-F', flag, log]).replace(', ', ' ')
+ options = set()
+ for line in output.splitlines():
+ options |= set(line.partition(flag)[2].split())
+ whitelist = set(d.getVar("UNKNOWN_CONFIGURE_WHITELIST", True).split())
+ options -= whitelist
+ if options:
+ pn = d.getVar('PN', True)
+ 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", True) or "").split()
+ if pkgconfig:
+ pkgconfigflags = d.getVarFlags("PACKAGECONFIG") or {}
+ for pconfig in pkgconfig:
+ if pconfig not in pkgconfigflags:
+ pn = d.getVar('PN', True)
+ error_msg = "%s: invalid PACKAGECONFIG: %s" % (pn, pconfig)
+ package_qa_handle_error("invalid-packageconfig", error_msg, d)
+
+ qa_sane = d.getVar("QA_SANE", True)
+ if not qa_sane:
+ bb.fatal("Fatal QA errors found, failing task.")
+}
+
+python do_qa_unpack() {
+ bb.note("Checking has ${S} been created")
+
+ s_dir = d.getVar('S', True)
+ if 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', True), 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 and for correct LIC_FILES_CHKSUM
+#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 () {
+ tests = d.getVar('ALL_QA', True).split()
+ if "desktop" in tests:
+ d.appendVar("PACKAGE_DEPENDS", " desktop-file-utils-native")
+
+ ###########################################################################
+ # Check various variables
+ ###########################################################################
+
+ # Checking ${FILESEXTRAPATHS}
+ extrapaths = (d.getVar("FILESEXTRAPATHS", True) 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', True).split(':')
+ pn = d.getVar('PN', True)
+ if pn in overrides:
+ msg = 'Recipe %s has PN of "%s" which is in OVERRIDES, this can result in unexpected behaviour.' % (d.getVar("FILE", True), pn)
+ package_qa_handle_error("pn-overrides", msg, d)
+
+ issues = []
+ if (d.getVar('PACKAGES', True) or "").split():
+ for dep in (d.getVar('QADEPENDS', True) 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', True).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", True), i), d)
+ qa_sane = d.getVar("QA_SANE", True)
+ if not qa_sane:
+ bb.fatal("Fatal QA errors found, failing task.")
+}
diff --git a/import-layers/yocto-poky/meta/classes/kernel-arch.bbclass b/import-layers/yocto-poky/meta/classes/kernel-arch.bbclass
new file mode 100644
index 000000000..3ed5986a5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/kernel-arch.bbclass
@@ -0,0 +1,60 @@
+#
+# 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"
+
+def map_kernel_arch(a, d):
+ import re
+
+ valid_archs = d.getVar('valid_archs', True).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('mips(el|64|64el)$', a): return 'mips'
+ 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:
+ bb.error("cannot map '%s' to a linux kernel architecture" % a)
+
+export ARCH = "${@map_kernel_arch(d.getVar('TARGET_ARCH', True), 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', True), 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"
+KERNEL_LD = "${CCACHE}${HOST_PREFIX}ld.bfd ${HOST_LD_KERNEL_ARCH}"
+KERNEL_AR = "${CCACHE}${HOST_PREFIX}ar ${HOST_AR_KERNEL_ARCH}"
+
diff --git a/import-layers/yocto-poky/meta/classes/kernel-fitimage.bbclass b/import-layers/yocto-poky/meta/classes/kernel-fitimage.bbclass
new file mode 100644
index 000000000..e5b75edf5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/kernel-fitimage.bbclass
@@ -0,0 +1,235 @@
+inherit kernel-uboot
+
+python __anonymous () {
+ kerneltype = d.getVar('KERNEL_IMAGETYPE', True)
+ if kerneltype == 'fitImage':
+ depends = d.getVar("DEPENDS", True)
+ depends = "%s u-boot-mkimage-native dtc-native" % depends
+ d.setVar("DEPENDS", depends)
+
+ # 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 .
+ d.setVar("KERNEL_IMAGETYPE_FOR_MAKE", "zImage")
+
+ image = d.getVar('INITRAMFS_IMAGE', True)
+ if image:
+ d.appendVarFlag('do_assemble_fitimage', 'depends', ' ${INITRAMFS_IMAGE}:do_image_complete')
+}
+
+#
+# Emit the fitImage ITS header
+#
+fitimage_emit_fit_header() {
+ cat << EOF >> fit-image.its
+/dts-v1/;
+
+/ {
+ description = "U-Boot fitImage for ${DISTRO_NAME}/${PV}/${MACHINE}";
+ #address-cells = <1>;
+EOF
+}
+
+#
+# Emit the fitImage section bits
+#
+# $1 ... Section bit type: imagestart - image section start
+# confstart - configuration section start
+# sectend - section end
+# fitend - fitimage end
+#
+fitimage_emit_section_maint() {
+ case $1 in
+ imagestart)
+ cat << EOF >> fit-image.its
+
+ images {
+EOF
+ ;;
+ confstart)
+ cat << EOF >> fit-image.its
+
+ configurations {
+EOF
+ ;;
+ sectend)
+ cat << EOF >> fit-image.its
+ };
+EOF
+ ;;
+ fitend)
+ cat << EOF >> fit-image.its
+};
+EOF
+ ;;
+ esac
+}
+
+#
+# Emit the fitImage ITS kernel section
+#
+# $1 ... Image counter
+# $2 ... Path to kernel image
+# $3 ... Compression type
+fitimage_emit_section_kernel() {
+
+ kernel_csum="sha1"
+
+ ENTRYPOINT=${UBOOT_ENTRYPOINT}
+ if test -n "${UBOOT_ENTRYSYMBOL}"; then
+ ENTRYPOINT=`${HOST_PREFIX}nm ${S}/vmlinux | \
+ awk '$3=="${UBOOT_ENTRYSYMBOL}" {print $1}'`
+ fi
+
+ cat << EOF >> fit-image.its
+ kernel@${1} {
+ description = "Linux kernel";
+ data = /incbin/("${2}");
+ type = "kernel";
+ arch = "${UBOOT_ARCH}";
+ os = "linux";
+ compression = "${3}";
+ load = <${UBOOT_LOADADDRESS}>;
+ entry = <${ENTRYPOINT}>;
+ hash@1 {
+ algo = "${kernel_csum}";
+ };
+ };
+EOF
+}
+
+#
+# Emit the fitImage ITS DTB section
+#
+# $1 ... Image counter
+# $2 ... Path to DTB image
+fitimage_emit_section_dtb() {
+
+ dtb_csum="sha1"
+
+ cat << EOF >> fit-image.its
+ fdt@${1} {
+ description = "Flattened Device Tree blob";
+ data = /incbin/("${2}");
+ type = "flat_dt";
+ arch = "${UBOOT_ARCH}";
+ compression = "none";
+ hash@1 {
+ algo = "${dtb_csum}";
+ };
+ };
+EOF
+}
+
+#
+# Emit the fitImage ITS configuration section
+#
+# $1 ... Linux kernel ID
+# $2 ... DTB image ID
+fitimage_emit_section_config() {
+
+ conf_csum="sha1"
+
+ # Test if we have any DTBs at all
+ if [ -z "${2}" ] ; then
+ conf_desc="Boot Linux kernel"
+ fdt_line=""
+ else
+ conf_desc="Boot Linux kernel with FDT blob"
+ fdt_line="fdt = \"fdt@${2}\";"
+ fi
+ kernel_line="kernel = \"kernel@${1}\";"
+
+ cat << EOF >> fit-image.its
+ default = "conf@1";
+ conf@1 {
+ description = "${conf_desc}";
+ ${kernel_line}
+ ${fdt_line}
+ hash@1 {
+ algo = "${conf_csum}";
+ };
+ };
+EOF
+}
+
+do_assemble_fitimage() {
+ if test "x${KERNEL_IMAGETYPE}" = "xfitImage" ; then
+ kernelcount=1
+ dtbcount=""
+ rm -f fit-image.its
+
+ fitimage_emit_fit_header
+
+ #
+ # Step 1: Prepare a kernel image section.
+ #
+ fitimage_emit_section_maint imagestart
+
+ uboot_prep_kimage
+ fitimage_emit_section_kernel "${kernelcount}" linux.bin "${linux_comp}"
+
+ #
+ # Step 2: Prepare a DTB image section
+ #
+ if test -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
+
+ fitimage_emit_section_dtb ${dtbcount} ${DTB_PATH}
+ dtbcount=`expr ${dtbcount} + 1`
+ done
+ fi
+
+ fitimage_emit_section_maint sectend
+
+ # Force the first Kernel and DTB in the default config
+ kernelcount=1
+ dtbcount=1
+
+ #
+ # Step 3: Prepare a configurations section
+ #
+ fitimage_emit_section_maint confstart
+
+ fitimage_emit_section_config ${kernelcount} ${dtbcount}
+
+ fitimage_emit_section_maint sectend
+
+ fitimage_emit_section_maint fitend
+
+ #
+ # Step 4: Assemble the image
+ #
+ uboot-mkimage -f fit-image.its arch/${ARCH}/boot/fitImage
+ fi
+}
+
+addtask assemble_fitimage before do_install after do_compile
+
+kernel_do_deploy[vardepsexclude] = "DATETIME"
+kernel_do_deploy_append() {
+ # Update deploy directory
+ if test "x${KERNEL_IMAGETYPE}" = "xfitImage" ; then
+ cd ${B}
+ echo "Copying fit-image.its source file..."
+ its_base_name="${KERNEL_IMAGETYPE}-its-${PV}-${PR}-${MACHINE}-${DATETIME}"
+ its_symlink_name=${KERNEL_IMAGETYPE}-its-${MACHINE}
+ install -m 0644 fit-image.its ${DEPLOYDIR}/${its_base_name}.its
+ linux_bin_base_name="${KERNEL_IMAGETYPE}-linux.bin-${PV}-${PR}-${MACHINE}-${DATETIME}"
+ linux_bin_symlink_name=${KERNEL_IMAGETYPE}-linux.bin-${MACHINE}
+ install -m 0644 linux.bin ${DEPLOYDIR}/${linux_bin_base_name}.bin
+
+ cd ${DEPLOYDIR}
+ ln -sf ${its_base_name}.its ${its_symlink_name}.its
+ ln -sf ${linux_bin_base_name}.bin ${linux_bin_symlink_name}.bin
+ fi
+}
diff --git a/import-layers/yocto-poky/meta/classes/kernel-grub.bbclass b/import-layers/yocto-poky/meta/classes/kernel-grub.bbclass
new file mode 100644
index 000000000..a63f482a9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/kernel-grub.bbclass
@@ -0,0 +1,91 @@
+#
+# 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.
+#
+
+pkg_preinst_kernel-image_append () {
+ # 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
+}
+
+pkg_postinst_kernel-image_prepend () {
+ 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
+}
+
diff --git a/import-layers/yocto-poky/meta/classes/kernel-module-split.bbclass b/import-layers/yocto-poky/meta/classes/kernel-module-split.bbclass
new file mode 100644
index 000000000..e1a70e621
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/kernel-module-split.bbclass
@@ -0,0 +1,203 @@
+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
+}
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/modules-load.d/ ${D}${sysconfdir}/modprobe.d/
+}
+
+PACKAGESPLITFUNCS_prepend = "split_kernel_module_packages "
+
+KERNEL_MODULES_META_PACKAGE ?= "kernel-modules"
+
+python split_kernel_module_packages () {
+ import re
+
+ modinfoexp = re.compile("([^=]+)=(.*)")
+ kerverrexp = re.compile('^(.*-hh.*)[\.\+].*$')
+ depmodpat0 = re.compile("^(.*\.k?o):..*$")
+ depmodpat1 = re.compile("^(.*\.k?o):\s*(.*\.k?o)\s*$")
+ depmodpat2 = re.compile("^(.*\.k?o):\s*(.*\.k?o)\s*\\\$")
+ depmodpat3 = re.compile("^\t(.*\.k?o)\s*\\\$")
+ depmodpat4 = re.compile("^\t(.*\.k?o)\s*$")
+
+ def extract_modinfo(file):
+ import tempfile, subprocess
+ tempfile.tempdir = d.getVar("WORKDIR", True)
+ tf = tempfile.mkstemp()
+ tmpfile = tf[1]
+ cmd = "%sobjcopy -j .modinfo -O binary %s %s" % (d.getVar("HOST_PREFIX", True) or "", file, tmpfile)
+ subprocess.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 parse_depmod():
+
+ dvar = d.getVar('PKGD', True)
+
+ kernelver = d.getVar('KERNEL_VERSION', True)
+ kernelver_stripped = kernelver
+ m = kerverrexp.match(kernelver)
+ if m:
+ kernelver_stripped = m.group(1)
+ staging_kernel_dir = d.getVar("STAGING_KERNEL_BUILDDIR", True)
+ system_map_file = "%s/boot/System.map-%s" % (dvar, kernelver)
+ if not os.path.exists(system_map_file):
+ system_map_file = "%s/System.map-%s" % (staging_kernel_dir, kernelver)
+ if not os.path.exists(system_map_file):
+ bb.fatal("System.map-%s does not exist in '%s/boot' nor STAGING_KERNEL_BUILDDIR '%s'" % (kernelver, dvar, staging_kernel_dir))
+
+ cmd = "depmod -n -a -b %s -F %s %s" % (dvar, system_map_file, kernelver_stripped)
+ f = os.popen(cmd, 'r')
+
+ deps = {}
+ line = f.readline()
+ while line:
+ if not depmodpat0.match(line):
+ line = f.readline()
+ continue
+ m1 = depmodpat1.match(line)
+ if m1:
+ deps[m1.group(1)] = m1.group(2).split()
+ else:
+ m2 = depmodpat2.match(line)
+ if m2:
+ deps[m2.group(1)] = m2.group(2).split()
+ line = f.readline()
+ m3 = depmodpat3.match(line)
+ while m3:
+ deps[m2.group(1)].extend(m3.group(1).split())
+ line = f.readline()
+ m3 = depmodpat3.match(line)
+ m4 = depmodpat4.match(line)
+ deps[m2.group(1)].extend(m4.group(1).split())
+ line = f.readline()
+ f.close()
+ return deps
+
+ def get_dependencies(file, pattern, format):
+ # file no longer includes PKGD
+ file = file.replace(d.getVar('PKGD', True) or '', '', 1)
+ # instead is prefixed with /lib/modules/${KERNEL_VERSION}
+ file = file.replace("/lib/modules/%s/" % d.getVar('KERNEL_VERSION', True) or '', '', 1)
+
+ if file in module_deps:
+ dependencies = []
+ for i in module_deps[file]:
+ m = re.match(pattern, os.path.basename(i))
+ if not m:
+ continue
+ on = legitimize_package_name(m.group(1))
+ dependency_pkg = format % on
+ dependencies.append(dependency_pkg)
+ return dependencies
+ return []
+
+ def frob_metadata(file, pkg, pattern, format, basename):
+ vals = extract_modinfo(file)
+
+ dvar = d.getVar('PKGD', True)
+
+ # 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", True) or "").split()
+ autoload = d.getVar('module_autoload_%s' % basename, True)
+ 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, True)
+ if not postinst:
+ bb.fatal("pkg_postinst_%s not defined" % pkg)
+ postinst += d.getVar('autoload_postinst_fragment', True) % (autoload or basename)
+ d.setVar('pkg_postinst_%s' % pkg, postinst)
+
+ # Write out any modconf fragment
+ modconflist = (d.getVar("KERNEL_MODULE_PROBECONF", True) or "").split()
+ modconf = d.getVar('module_conf_%s' % basename, True)
+ 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, True)
+ 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, True) or ""
+ d.setVar('DESCRIPTION_' + pkg, old_desc + "; " + vals["description"])
+
+ rdepends = bb.utils.explode_dep_versions2(d.getVar('RDEPENDS_' + pkg, True) or "")
+ for dep in get_dependencies(file, pattern, format):
+ 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)
+
+ module_deps = parse_depmod()
+ module_regex = '^(.*)\.k?o$'
+ module_pattern = 'kernel-module-%s'
+
+ postinst = d.getVar('pkg_postinst_modules', True)
+ postrm = d.getVar('pkg_postrm_modules', True)
+
+ modules = do_split_packages(d, root='/lib/modules', file_regex=module_regex, output_pattern=module_pattern, description='%s kernel module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, extra_depends='kernel-%s' % (d.getVar("KERNEL_VERSION", True)))
+ if modules:
+ metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE', True)
+ 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', True)
+ 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", True) or "").split()))}'
diff --git a/import-layers/yocto-poky/meta/classes/kernel-uboot.bbclass b/import-layers/yocto-poky/meta/classes/kernel-uboot.bbclass
new file mode 100644
index 000000000..345e7f5f3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/kernel-uboot.bbclass
@@ -0,0 +1,20 @@
+uboot_prep_kimage() {
+ if test -e arch/${ARCH}/boot/compressed/vmlinux ; then
+ vmlinux_path="arch/${ARCH}/boot/compressed/vmlinux"
+ linux_suffix=""
+ linux_comp="none"
+ else
+ vmlinux_path="vmlinux"
+ linux_suffix=".gz"
+ linux_comp="gzip"
+ fi
+
+ ${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/import-layers/yocto-poky/meta/classes/kernel-uimage.bbclass b/import-layers/yocto-poky/meta/classes/kernel-uimage.bbclass
new file mode 100644
index 000000000..f73965b13
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/kernel-uimage.bbclass
@@ -0,0 +1,36 @@
+inherit kernel-uboot
+
+python __anonymous () {
+ kerneltype = d.getVar('KERNEL_IMAGETYPE', True)
+ if kerneltype == 'uImage':
+ depends = d.getVar("DEPENDS", True)
+ 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", True) != 'yes':
+ d.setVar("KERNEL_IMAGETYPE_FOR_MAKE", "zImage")
+}
+
+do_uboot_mkimage() {
+ if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then
+ if test "x${KEEPUIMAGE}" != "xyes" ; then
+ uboot_prep_kimage
+
+ ENTRYPOINT=${UBOOT_ENTRYPOINT}
+ if test -n "${UBOOT_ENTRYSYMBOL}"; then
+ ENTRYPOINT=`${HOST_PREFIX}nm ${S}/vmlinux | \
+ awk '$3=="${UBOOT_ENTRYSYMBOL}" {print $1}'`
+ 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 arch/${ARCH}/boot/uImage
+ rm -f linux.bin
+ fi
+ fi
+}
+
+addtask uboot_mkimage before do_install after do_compile
diff --git a/import-layers/yocto-poky/meta/classes/kernel-yocto.bbclass b/import-layers/yocto-poky/meta/classes/kernel-yocto.bbclass
new file mode 100644
index 000000000..f86b3ef01
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/kernel-yocto.bbclass
@@ -0,0 +1,376 @@
+# 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_shared_workdir do_fetch do_unpack do_patch"
+
+# 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"
+ fi
+ else
+ cp -f ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${WORKDIR}/defconfig
+ sccs="${WORKDIR}/defconfig"
+ fi
+ else
+ bbfatal "A KBUILD_DECONFIG '${KBUILD_DEFCONFIG}' was specified, but not present in the source tree"
+ fi
+ fi
+
+ sccs="$sccs ${@" ".join(find_sccs(d))}"
+ patches="${@" ".join(find_patches(d))}"
+ feat_dirs="${@" ".join(find_kernel_feature_dirs(d))}"
+
+ # add any explicitly referenced features onto the end of the feature
+ # list that is passed to the kernel build scripts.
+ if [ -n "${KERNEL_FEATURES}" ]; then
+ for feat in ${KERNEL_FEATURES}; do
+ addon_features="$addon_features --feature $feat"
+ done
+ fi
+
+ # 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
+ if [ -n "${feat_dirs}" ]; then
+ for f in ${feat_dirs}; do
+ if [ -d "${WORKDIR}/$f/meta" ]; then
+ includes="$includes -I${WORKDIR}/$f/meta"
+ elif [ -d "${WORKDIR}/$f" ]; then
+ includes="$includes -I${WORKDIR}/$f"
+ fi
+ done
+ fi
+
+ # updates or generates the target description
+ updateme ${updateme_flags} -DKDESC=${KMACHINE}:${LINUX_KERNEL_TYPE} \
+ ${includes} ${addon_features} ${ARCH} ${KMACHINE} ${sccs} ${patches}
+ if [ $? -ne 0 ]; then
+ bbfatal_log "Could not update ${machine_branch}"
+ fi
+}
+
+do_patch() {
+ cd ${S}
+
+ # executes and modifies the source tree as required
+ patchme ${KMACHINE}
+ 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
+
+ # check to see if the specified SRCREV is reachable from the final branch.
+ # if it wasn't something wrong has happened, and we should error.
+ machine_srcrev="${SRCREV_machine}"
+ if [ -z "${machine_srcrev}" ]; then
+ # fallback to SRCREV if a non machine_meta tree is being built
+ machine_srcrev="${SRCREV}"
+ # if SRCREV cannot be reached something is wrong.
+ if [ -z "${machine_srcrev}" ]; then
+ bbfatal "Neither SRCREV_machine or SRCREV was specified!"
+ fi
+ fi
+
+ current_branch=`git rev-parse --abbrev-ref HEAD`
+ machine_branch="${@ get_machine_branch(d, "${KBRANCH}" )}"
+ if [ "${current_branch}" != "${machine_branch}" ]; then
+ bbwarn "After meta data application, the kernel tree branch is ${current_branch}. The"
+ bbwarn "SRC_URI specified branch ${machine_branch}. The branch will be forced to ${machine_branch},"
+ bbwarn "but this means the board meta data (.scc files) do not match the SRC_URI specification."
+ bbwarn "The meta data and branch ${machine_branch} should be inspected to ensure the proper"
+ bbwarn "kernel is being built."
+ git checkout -f ${machine_branch}
+ fi
+
+ if [ "${machine_srcrev}" != "AUTOINC" ]; then
+ if ! [ "$(git rev-parse --verify ${machine_srcrev}~0)" = "$(git merge-base ${machine_srcrev} HEAD)" ]; then
+ bberror "SRCREV ${machine_srcrev} was specified, but is not reachable"
+ bbfatal "Check the BSP description for incorrect branch selection, or other errors."
+ fi
+ 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
+ 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_kernel_configme[dirs] += "${S} ${B}"
+do_kernel_configme() {
+ bbnote "kernel configme"
+ export KMETA=${KMETA}
+
+ if [ -n "${KCONFIG_MODE}" ]; then
+ configmeflags=${KCONFIG_MODE}
+ else
+ # If a defconfig was passed, use =n as the baseline, which is achieved
+ # via --allnoconfig
+ if [ -f ${WORKDIR}/defconfig ]; then
+ configmeflags="--allnoconfig"
+ fi
+ fi
+
+ cd ${S}
+ PATH=${PATH}:${S}/scripts/util
+ configme ${configmeflags} --reconfig --output ${B} ${LINUX_KERNEL_TYPE} ${KMACHINE}
+ 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", True ) or "meta"
+ if not os.path.exists(kmeta):
+ kmeta = "." + kmeta
+
+ pathprefix = "export PATH=%s:%s; " % (d.getVar('PATH', True), "${S}/scripts/util/")
+ cmd = d.expand("cd ${S}; kconf_check -config %s/meta-series ${S} ${B}" % kmeta)
+ ret, result = oe.utils.getstatusoutput("%s%s" % (pathprefix, cmd))
+
+ config_check_visibility = int(d.getVar( "KCONF_AUDIT_LEVEL", True ) or 0)
+ bsp_check_visibility = int(d.getVar( "KCONF_BSP_AUDIT_LEVEL", True ) or 0)
+
+ # if config check visibility is non-zero, report dropped configuration values
+ mismatch_file = "${S}/" + kmeta + "/" + "mismatch.cfg"
+ 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)
+
+ # if config check visibility is level 2 or higher, report non-hardware options
+ nonhw_file = "${S}/" + kmeta + "/" + "nonhw_report.cfg"
+ if os.path.exists(nonhw_file):
+ if config_check_visibility > 1:
+ with open (nonhw_file, "r") as myfile:
+ results = myfile.read()
+ bb.warn( "[kernel config]: BSP specified non-hw configuration:\n\n%s" % results)
+
+ bsp_desc = "${S}/" + kmeta + "/" + "top_tgt"
+ if os.path.exists(bsp_desc) and bsp_check_visibility > 1:
+ with open (bsp_desc, "r") as myfile:
+ bsp_tgt = myfile.read()
+ m = re.match("^(.*)scratch.obj(.*)$", bsp_tgt)
+ if not m is None:
+ bb.warn( "[kernel]: An auto generated BSP description was used, this normally indicates a misconfiguration.\n" +
+ "Check that your machine (%s) has an associated kernel description." % "${MACHINE}" )
+}
+
+# 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}
+ 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/import-layers/yocto-poky/meta/classes/kernel.bbclass b/import-layers/yocto-poky/meta/classes/kernel.bbclass
new file mode 100644
index 000000000..6e3e81e93
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/kernel.bbclass
@@ -0,0 +1,512 @@
+inherit linux-kernel-base kernel-module-split
+
+PROVIDES += "virtual/kernel"
+DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc kmod-native depmodwrapper-cross bc-native"
+
+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_TASK ?= ""
+INITRAMFS_IMAGE_BUNDLE ?= ""
+
+python __anonymous () {
+ import re
+
+ kerneltype = d.getVar('KERNEL_IMAGETYPE', True)
+
+ d.setVar("KERNEL_IMAGETYPE_FOR_MAKE", re.sub(r'\.gz$', '', kerneltype))
+
+ image = d.getVar('INITRAMFS_IMAGE', True)
+ 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', True)
+ 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", True)
+ 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", True)
+ if s != kernsrc:
+ bb.utils.mkdirhier(kernsrc)
+ bb.utils.remove(kernsrc, recurse=True)
+ if d.getVar("EXTERNALSRC", True):
+ # 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-module-.*"
+PACKAGES_DYNAMIC += "^kernel-image-.*"
+PACKAGES_DYNAMIC += "^kernel-firmware-.*"
+
+export OS = "${TARGET_OS}"
+export CROSS_COMPILE = "${TARGET_PREFIX}"
+
+KERNEL_PRIORITY ?= "${@int(d.getVar('PV',1).split('-')[0].split('+')[0].split('.')[0]) * 10000 + \
+ int(d.getVar('PV',1).split('-')[0].split('+')[0].split('.')[1]) * 100 + \
+ int(d.getVar('PV',1).split('-')[0].split('+')[0].split('.')[-1])}"
+
+KERNEL_RELEASE ?= "${KERNEL_VERSION}"
+
+# Where built kernel lies in the kernel tree
+KERNEL_OUTPUT ?= "arch/${ARCH}/boot/${KERNEL_IMAGETYPE}"
+KERNEL_IMAGEDEST = "boot"
+
+#
+# configuration
+#
+export CMDLINE_CONSOLE = "console=${@d.getVar("KERNEL_CONSOLE",1) 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 ?= ""
+
+# For the kernel, we don't want the '-e MAKEFLAGS=' in EXTRA_OEMAKE.
+# We don't want to override kernel Makefile variables from the environment
+EXTRA_OEMAKE = ""
+
+KERNEL_ALT_IMAGETYPE ??= ""
+
+# Define where the kernel headers are installed on the target as well as where
+# they are staged.
+KERNEL_SRC_PATH = "/usr/src/kernel"
+
+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}-${MACHINE}.cpio
+ for img in cpio.gz cpio.lz4 cpio.lzo cpio.lzma cpio.xz; do
+ if [ -e "${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.$img" ]; then
+ cp ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.$img ${B}/usr/.
+ case $img in
+ *gz)
+ echo "gzip decompressing image"
+ gunzip -f ${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.$img
+ break
+ ;;
+ *lz4)
+ echo "lz4 decompressing image"
+ lz4 -df ${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.$img
+ break
+ ;;
+ *lzo)
+ echo "lzo decompressing image"
+ lzop -df ${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.$img
+ break
+ ;;
+ *lzma)
+ echo "lzma decompressing image"
+ lzma -df ${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.$img
+ break
+ ;;
+ *xz)
+ echo "xz decompressing image"
+ xz -df ${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.$img
+ break
+ ;;
+ esac
+ fi
+ done
+ echo "Finished copy of initramfs into ./usr"
+}
+
+INITRAMFS_BASE_NAME = "${KERNEL_IMAGETYPE}-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
+ if [ -e ${KERNEL_OUTPUT} ] ; then
+ mv -f ${KERNEL_OUTPUT} ${KERNEL_OUTPUT}.bak
+ fi
+ use_alternate_initrd=CONFIG_INITRAMFS_SOURCE=${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.cpio
+ kernel_do_compile
+ mv -f ${KERNEL_OUTPUT} ${KERNEL_OUTPUT}.initramfs
+ mv -f ${KERNEL_OUTPUT}.bak ${KERNEL_OUTPUT}
+ # Update install area
+ echo "There is kernel image bundled with initramfs: ${B}/${KERNEL_OUTPUT}.initramfs"
+ install -m 0644 ${B}/${KERNEL_OUTPUT}.initramfs ${D}/boot/${KERNEL_IMAGETYPE}-initramfs-${MACHINE}.bin
+ echo "${B}/${KERNEL_OUTPUT}.initramfs"
+ fi
+}
+
+python do_devshell_prepend () {
+ os.environ["LDFLAGS"] = ''
+}
+
+addtask bundle_initramfs after do_install before do_deploy
+
+kernel_do_compile() {
+ unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
+ # 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}-${MACHINE}.cpio
+ fi
+ oe_runmake ${KERNEL_IMAGETYPE_FOR_MAKE} ${KERNEL_ALT_IMAGETYPE} CC="${KERNEL_CC}" LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS} $use_alternate_initrd
+ if test "${KERNEL_IMAGETYPE_FOR_MAKE}.gz" = "${KERNEL_IMAGETYPE}"; then
+ gzip -9c < "${KERNEL_IMAGETYPE_FOR_MAKE}" > "${KERNEL_OUTPUT}"
+ fi
+}
+
+do_compile_kernelmodules() {
+ unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
+ if (grep -q -i -e '^CONFIG_MODULES=y$' ${B}/.config); then
+ oe_runmake -C ${B} ${PARALLEL_MAKE} modules CC="${KERNEL_CC}" 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 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 INSTALL_MOD_PATH="${D}" modules_install
+ rm "${D}/lib/modules/${KERNEL_VERSION}/build"
+ rm "${D}/lib/modules/${KERNEL_VERSION}/source"
+ # If the kernel/ directory is empty remove it to prevent QA issues
+ rmdir --ignore-fail-on-non-empty "${D}/lib/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
+ install -m 0644 ${KERNEL_OUTPUT} ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}
+ 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"
+
+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-depmod/
+ echo "${KERNEL_VERSION}" > ${PKGDESTWORK}/kernel-depmod/kernel-abiversion
+ cp ${B}/System.map ${PKGDESTWORK}/kernel-depmod/System.map-${KERNEL_VERSION}
+}
+
+PACKAGEFUNCS += "emit_depmod_pkgdata"
+
+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-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
+
+ # 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
+ mkdir -p $kerneldir/arch/powerpc/lib/
+ cp arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
+ 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} O=${B} oldnoconfig || yes '' | oe_runmake -C ${S} O=${B} oldconfig"
+
+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() {
+ oe_runmake -C ${B} savedefconfig
+}
+do_savedefconfig[nostamp] = "1"
+addtask savedefconfig after do_configure
+
+inherit cml1
+
+EXPORT_FUNCTIONS do_compile do_install do_configure
+
+# kernel-base becomes kernel-${KERNEL_VERSION}
+# kernel-image becomes kernel-image-${KERNEL_VERISON}
+PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev kernel-modules"
+FILES_${PN} = ""
+FILES_kernel-base = "/lib/modules/${KERNEL_VERSION}/modules.order /lib/modules/${KERNEL_VERSION}/modules.builtin"
+FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
+FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH} /lib/modules/${KERNEL_VERSION}/build"
+FILES_kernel-vmlinux = "/boot/vmlinux*"
+FILES_kernel-modules = ""
+RDEPENDS_kernel = "kernel-base"
+# Allow machines to override this dependency if kernel image files are
+# not wanted in images as standard
+RDEPENDS_kernel-base ?= "kernel-image"
+PKG_kernel-image = "kernel-image-${@legitimize_package_name('${KERNEL_VERSION}')}"
+RDEPENDS_kernel-image += "${@base_conditional('KERNEL_IMAGETYPE', 'vmlinux', 'kernel-vmlinux', '', d)}"
+PKG_kernel-base = "kernel-${@legitimize_package_name('${KERNEL_VERSION}')}"
+RPROVIDES_kernel-base += "kernel-${KERNEL_VERSION}"
+ALLOW_EMPTY_kernel = "1"
+ALLOW_EMPTY_kernel-base = "1"
+ALLOW_EMPTY_kernel-image = "1"
+ALLOW_EMPTY_kernel-modules = "1"
+DESCRIPTION_kernel-modules = "Kernel modules meta package"
+
+pkg_postinst_kernel-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
+}
+
+pkg_postinst_kernel-image () {
+ update-alternatives --install /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE} /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION} ${KERNEL_PRIORITY} || true
+}
+
+pkg_postrm_kernel-image () {
+ update-alternatives --remove ${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE}-${KERNEL_VERSION} || true
+}
+
+PACKAGESPLITFUNCS_prepend = "split_kernel_packages "
+
+python split_kernel_packages () {
+ do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.(bin|fw|cis|csp|dsp)$', output_pattern='kernel-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 based booting. This
+# task arranges to have vmlinux appear in the normalized directory
+# location.
+do_kernel_link_vmlinux() {
+ if [ ! -d "${B}/arch/${ARCH}/boot" ]; then
+ mkdir ${B}/arch/${ARCH}/boot
+ fi
+ cd ${B}/arch/${ARCH}/boot
+ ln -sf ../../../vmlinux
+}
+
+do_strip() {
+ if [ -n "${KERNEL_IMAGE_STRIP_EXTRA_SECTIONS}" ]; then
+ if [ "${KERNEL_IMAGETYPE}" != "vmlinux" ]; then
+ bbwarn "image type will not be stripped (not supported): ${KERNEL_IMAGETYPE}"
+ return
+ fi
+
+ cd ${B}
+ headers=`"$CROSS_COMPILE"readelf -S ${KERNEL_OUTPUT} | \
+ 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}
+ }; done
+
+ bbnote "KERNEL_IMAGE_STRIP_EXTRA_SECTIONS is set, stripping sections:" \
+ "${KERNEL_IMAGE_STRIP_EXTRA_SECTIONS}"
+ fi;
+}
+do_strip[dirs] = "${B}"
+
+addtask do_strip before do_sizecheck after do_kernel_link_vmlinux
+
+# 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
+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 integerx (The unit is Kbytes)"
+ fi
+ size=`du -ks ${B}/${KERNEL_OUTPUT} | awk '{ print $1}'`
+ if [ $size -ge ${KERNEL_IMAGE_MAXSIZE} ]; then
+ die "This kernel (size=$size(K) > ${KERNEL_IMAGE_MAXSIZE}(K)) is 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 ?= "${KERNEL_IMAGETYPE}-${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 ?= "${KERNEL_IMAGETYPE}-${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() {
+ install -m 0644 ${KERNEL_OUTPUT} ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin
+ 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
+
+ ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${DEPLOYDIR}/${KERNEL_IMAGE_SYMLINK_NAME}.bin
+ ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${DEPLOYDIR}/${KERNEL_IMAGETYPE}
+
+ cp ${COREBASE}/meta/files/deploydir_readme.txt ${DEPLOYDIR}/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt
+
+ cd ${B}
+ # Update deploy directory
+ if [ -e "${KERNEL_OUTPUT}.initramfs" ]; then
+ echo "Copying deploy kernel-initramfs image and setting up links..."
+ initramfs_base_name=${INITRAMFS_BASE_NAME}
+ initramfs_symlink_name=${KERNEL_IMAGETYPE}-initramfs-${MACHINE}
+ install -m 0644 ${KERNEL_OUTPUT}.initramfs ${DEPLOYDIR}/${initramfs_base_name}.bin
+ cd ${DEPLOYDIR}
+ ln -sf ${initramfs_base_name}.bin ${initramfs_symlink_name}.bin
+ fi
+}
+do_deploy[cleandirs] = "${DEPLOYDIR}"
+do_deploy[dirs] = "${DEPLOYDIR} ${B}"
+do_deploy[prefuncs] += "package_get_auto_pr"
+
+addtask deploy after do_populate_sysroot
+
+EXPORT_FUNCTIONS do_deploy
+
diff --git a/import-layers/yocto-poky/meta/classes/kernelsrc.bbclass b/import-layers/yocto-poky/meta/classes/kernelsrc.bbclass
new file mode 100644
index 000000000..9efd46a92
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/kernelsrc.bbclass
@@ -0,0 +1,10 @@
+S = "${STAGING_KERNEL_DIR}"
+do_fetch[noexec] = "1"
+do_unpack[depends] += "virtual/kernel:do_patch"
+do_unpack[noexec] = "1"
+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/import-layers/yocto-poky/meta/classes/lib_package.bbclass b/import-layers/yocto-poky/meta/classes/lib_package.bbclass
new file mode 100644
index 000000000..8849f5904
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/classes/libc-common.bbclass b/import-layers/yocto-poky/meta/classes/libc-common.bbclass
new file mode 100644
index 000000000..bbc80167d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/libc-common.bbclass
@@ -0,0 +1,43 @@
+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 -d ${D}/${sysconfdir}/
+ install -m 0644 ${WORKDIR}/etc/ld.so.conf ${D}/${sysconfdir}/
+ 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
+ grep -v $i ${WORKDIR}/SUPPORTED > ${WORKDIR}/SUPPORTED.tmp
+ mv ${WORKDIR}/SUPPORTED.tmp ${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', True) in [ 'soft', 'ppc-efd' ]:
+ return "--without-fp"
+ return ""
+
+python populate_packages_prepend () {
+ if d.getVar('DEBIAN_NAMES', True):
+ pkgs = d.getVar('PACKAGES', True).split()
+ bpn = d.getVar('BPN', True)
+ prefix = d.getVar('MLPREFIX', True) 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/import-layers/yocto-poky/meta/classes/libc-package.bbclass b/import-layers/yocto-poky/meta/classes/libc-package.bbclass
new file mode 100644
index 000000000..467d56792
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/libc-package.bbclass
@@ -0,0 +1,391 @@
+#
+# 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"
+
+python __anonymous () {
+ enabled = d.getVar("ENABLE_BINARY_LOCALE_GENERATION", True)
+
+ pn = d.getVar("PN", True)
+ if pn.endswith("-initial"):
+ enabled = False
+
+ if enabled and int(enabled):
+ import re
+
+ target_arch = d.getVar("TARGET_ARCH", True)
+ binary_arches = d.getVar("BINARY_LOCALE_ARCHES", True) or ""
+ use_cross_localedef = d.getVar("LOCALE_GENERATION_WITH_CROSS-LOCALEDEF", True) or ""
+
+ for regexp in binary_arches.split(" "):
+ r = re.compile(regexp)
+
+ if r.match(target_arch):
+ depends = d.getVar("DEPENDS", True)
+ 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}"
+
+do_configure_prepend() {
+ if [ -e ${S}/elf/ldd.bash.in ]; then
+ sed -e "s#@BASH@#/bin/sh#" -i ${S}/elf/ldd.bash.in
+ fi
+}
+
+
+
+# indentation removed on purpose
+locale_base_postinst() {
+#!/bin/sh
+
+if [ "x$D" != "x" ]; then
+ exit 1
+fi
+
+rm -rf ${TMP_LOCALE}
+mkdir -p ${TMP_LOCALE}
+if [ -f ${localedir}/locale-archive ]; then
+ cp ${localedir}/locale-archive ${TMP_LOCALE}/
+fi
+localedef --inputfile=${datadir}/i18n/locales/%s --charmap=%s --prefix=/tmp/locale %s
+mkdir -p ${localedir}/
+mv ${TMP_LOCALE}/locale-archive ${localedir}/
+rm -rf ${TMP_LOCALE}
+}
+
+# indentation removed on purpose
+locale_base_postrm() {
+#!/bin/sh
+
+rm -rf ${TMP_LOCALE}
+mkdir -p ${TMP_LOCALE}
+if [ -f ${localedir}/locale-archive ]; then
+ cp ${localedir}/locale-archive ${TMP_LOCALE}/
+fi
+localedef --delete-from-archive --inputfile=${datadir}/locales/%s --charmap=%s --prefix=/tmp/locale %s
+mv ${TMP_LOCALE}/locale-archive ${localedir}/
+rm -rf ${TMP_LOCALE}
+}
+
+
+TMP_LOCALE="/tmp/locale${localedir}"
+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', True) == '1'):
+ bb.note("package requested not splitting gconvs")
+ return
+
+ if not d.getVar('PACKAGES', True):
+ return
+
+ mlprefix = d.getVar("MLPREFIX", True) or ""
+
+ bpn = d.getVar('BPN', True)
+ libdir = d.getVar('libdir', True)
+ if not libdir:
+ bb.error("libdir not defined")
+ return
+ datadir = d.getVar('datadir', True)
+ if not datadir:
+ bb.error("datadir not defined")
+ return
+
+ gconv_libdir = base_path_join(libdir, "gconv")
+ charmap_dir = base_path_join(datadir, "i18n", "charmaps")
+ locales_dir = base_path_join(datadir, "i18n", "locales")
+ binary_locales_dir = d.getVar('localedir', True)
+
+ 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():
+ 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():
+ 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():
+ 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", True)
+
+ dot_re = re.compile("(.*)\.(.*)")
+
+ # Read in supported locales and associated encodings
+ supported = {}
+ with open(base_path_join(d.getVar('WORKDIR', True), "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', True)
+ if not to_generate or to_generate == 'all':
+ to_generate = 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', True) \
+ % (locale, encoding, locale))
+ d.setVar('pkg_postrm_%s' % pkgname, d.getVar('locale_base_postrm', True) % \
+ (locale, encoding, locale))
+
+ def output_locale_binary_rdepends(name, pkgname, locale, encoding):
+ m = re.match("(.*)\.(.*)", name)
+ if m:
+ libc_name = "%s.%s" % (m.group(1), m.group(2).lower())
+ else:
+ libc_name = name
+ d.setVar('RDEPENDS_%s' % pkgname, legitimize_package_name('%s-binary-localedata-%s' \
+ % (mlprefix+bpn, libc_name)))
+
+ commands = {}
+
+ def output_locale_binary(name, pkgname, locale, encoding):
+ treedir = base_path_join(d.getVar("WORKDIR", True), "locale-tree")
+ ldlibdir = base_path_join(treedir, d.getVar("base_libdir", True))
+ path = d.getVar("PATH", True)
+ i18npath = base_path_join(treedir, datadir, "i18n")
+ gconvpath = base_path_join(treedir, "iconvdata")
+ outputpath = base_path_join(treedir, binary_locales_dir)
+
+ use_cross_localedef = d.getVar("LOCALE_GENERATION_WITH_CROSS-LOCALEDEF", True) or "0"
+ if use_cross_localedef == "1":
+ target_arch = d.getVar('TARGET_ARCH', True)
+ 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 ", \
+ "mips64": " --uint32-align=4 --big-endian ", \
+ "mipsel": " --uint32-align=4 --little-endian ", \
+ "mips64el":" --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)
+ raise bb.build.FuncFailed("unknown arch:" + target_arch + " for locale_arch_options")
+
+ localedef_opts += " --force --old-style --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 --old-style --no-archive --prefix=%s \
+ --inputfile=%s/i18n/locales/%s --charmap=%s %s" \
+ % (treedir, datadir, locale, encoding, name)
+
+ qemu_options = d.getVar('QEMU_OPTIONS', True)
+
+ 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', True)))
+ 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', True) or 0)
+ utf8_is_default = int(d.getVar('LOCALE_UTF8_IS_DEFAULT', True) 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)
+
+ if use_bin == "compile":
+ makefile = base_path_join(d.getVar("WORKDIR", True), "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)
+ 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)
+ elif use_bin == "precompiled":
+ 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/import-layers/yocto-poky/meta/classes/license.bbclass b/import-layers/yocto-poky/meta/classes/license.bbclass
new file mode 100644
index 000000000..43944e6ee
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/license.bbclass
@@ -0,0 +1,664 @@
+# 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', True)
+ 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', True),
+ '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', True),
+ d.getVar('IMAGE_NAME', True), '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", True) 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', True), 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', True),
+ 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', True)
+ copy_lic_dirs = d.getVar('COPY_LIC_DIRS', True)
+ if copy_lic_manifest == "1":
+ rootfs_license_dir = os.path.join(d.getVar('IMAGE_ROOTFS', 'True'),
+ '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', True),
+ pkg_dic[pkg]["PN"])
+ 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 = re.search("^generic_(.*)$", lic).group(1)
+ if oe.license.license_ok(canonical_license(d,
+ 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", True)
+
+ 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]
+
+ image_license_manifest = os.path.join(d.getVar('LICENSE_DIRECTORY', True),
+ d.getVar('IMAGE_NAME', True), '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 taskdata.itervalues()
+ if not dep[0].endswith("-native")]))
+ extra_depends = d.getVar("EXTRA_IMAGEDEPENDS", True)
+ 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", True)
+ sstate_archs = d.getVar("SSTATE_ARCHS", True)
+ extra_archs = d.getVar("PACKAGE_EXTRA_ARCHS", True)
+ archs = list(set(("%s %s" % (sstate_archs, extra_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, True)
+ 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 = []
+ boot_depends_string = ""
+ taskdepdata = d.getVar("BB_TASKDEPDATA", False)
+ # Only bootimg and bootdirectdisk include the depends flag
+ boot_tasks = ["do_bootimg", "do_bootdirectdisk",]
+
+ for task in boot_tasks:
+ boot_depends_string = "%s %s" % (boot_depends_string,
+ d.getVarFlag(task, "depends", True) 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", True),
+ 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.itervalues():
+ # The fifth field contains what the task provides
+ if dep in taskdep[4]:
+ info_file = os.path.join(
+ d.getVar("LICENSE_DIRECTORY", True),
+ 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 = ["README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt"]
+ 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', True), d.getVar('PN', True))
+ 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', True) == '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', True) + os.path.join(d.getVar('LICENSE_FILES_DIRECTORY', True), d.getVar('PN', True))
+ 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", True)
+ info["PR"] = d.getVar("PR", True)
+ info["LICENSE"] = d.getVar("LICENSE", True)
+ return info
+
+def add_package_and_files(d):
+ packages = d.getVar('PACKAGES', True)
+ files = d.getVar('LICENSE_FILES_DIRECTORY', True)
+ pn = d.getVar('PN', True)
+ pn_lic = "%s%s" % (pn, d.getVar('LICENSE_PACKAGE_SUFFIX', False))
+ if pn_lic in packages:
+ 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, True)
+ 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
+
+ bb.utils.mkdirhier(destdir)
+ for (basename, path) in lic_files_paths:
+ try:
+ src = path
+ dst = os.path.join(destdir, basename)
+ if os.path.exists(dst):
+ os.remove(dst)
+ if os.access(src, os.W_OK) and (os.stat(src).st_dev == os.stat(destdir).st_dev):
+ os.link(src, dst)
+ try:
+ os.chown(dst,0,0)
+ except OSError as err:
+ import errno
+ if err.errno in (errno.EPERM, errno.EINVAL):
+ # Suppress "Operation not permitted" error, as
+ # sometimes this function is not executed under pseudo.
+ # Also ignore "Invalid argument" errors that happen in
+ # some (unprivileged) container environments (no root).
+ pass
+ else:
+ raise
+ else:
+ shutil.copyfile(src, dst)
+ 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
+
+ pn = d.getVar('PN', True)
+ for package in d.getVar('PACKAGES', True):
+ if d.getVar('LICENSE_' + package, True):
+ license_types = license_types + ' & ' + \
+ d.getVar('LICENSE_' + package, True)
+
+ #If we get here with no license types, then that means we have a recipe
+ #level license. If so, we grab only those.
+ try:
+ license_types
+ except NameError:
+ # All the license types at the recipe level
+ license_types = d.getVar('LICENSE', True)
+
+ # All the license files for the package
+ lic_files = d.getVar('LIC_FILES_CHKSUM', True)
+ pn = d.getVar('PN', True)
+ # The license files are located in S/LIC_FILE_CHECKSUM.
+ srcdir = d.getVar('S', True)
+ # Directory we store the generic licenses as set in the distro configuration
+ generic_directory = d.getVar('COMMON_LICENSE_DIR', True)
+ # List of basename, path tuples
+ lic_files_paths = []
+ license_source_dirs = []
+ license_source_dirs.append(generic_directory)
+ try:
+ additional_lic_dirs = d.getVar('LICENSE_PATH', True).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, True) != 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, True)
+ 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
+
+ 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)))
+
+ # 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, True):
+ bb.warn("%s: %s is a generic license, please don't use NO_GENERIC_LICENSE for it." % (pn, license_type))
+
+ elif d.getVarFlag('NO_GENERIC_LICENSE', license_type, True):
+ # if NO_GENERIC_LICENSE is set, we copy the license files from the fetched source
+ # of the package rather than the license_source_dirs.
+ for (basename, path) in lic_files_paths:
+ if d.getVarFlag('NO_GENERIC_LICENSE', license_type, True) == basename:
+ lic_files_paths.append(("generic_" + license_type, path))
+ break
+ 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:
+ raise bb.build.FuncFailed("COMMON_LICENSE_DIR is unset. Please set this in your distro config")
+
+ if not lic_files:
+ # No recipe should have an invalid license file. This is checked else
+ # where, but let's be pedantic
+ bb.note(pn + ": Recipe file does not have license file information.")
+ return lic_files_paths
+
+ for url in lic_files.split():
+ try:
+ (type, host, path, user, pswd, parm) = bb.fetch.decodeurl(url)
+ except bb.fetch.MalformedUrl:
+ raise bb.build.FuncFailed("%s: LIC_FILES_CHKSUM contains an invalid URL: %s" % (d.getVar('PF', True), url))
+ # We want the license filename and path
+ srclicfile = os.path.join(srcdir, path)
+ lic_files_paths.append((os.path.basename(path), srclicfile))
+
+ v = FindVisitor()
+ try:
+ v.visit_string(license_types)
+ except oe.license.InvalidLicense as exc:
+ bb.fatal('%s: %s' % (d.getVar('PF', True), exc))
+ except SyntaxError:
+ bb.warn("%s: Failed to parse it's LICENSE field." % (d.getVar('PF', True)))
+
+ 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, True)
+
+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, True) or ""
+ if not lic and license.endswith('+'):
+ lic = d.getVarFlag('SPDXLICENSEMAP', license.rstrip('+'), True)
+ 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, True) 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', True) 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, True) if package else None
+ if not license:
+ license = d.getVar('LICENSE', True)
+
+ # 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', True), 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', True)
+ 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', True)
+ if license_flags:
+ whitelist = d.getVar('LICENSE_FLAGS_WHITELIST', True)
+ 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', True)
+ licenses = d.getVar('LICENSE', True)
+ from oe.license import license_operator, license_operator_chars, license_pattern
+
+ elements = 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"
+
+do_populate_lic_setscene[dirs] = "${LICSSTATEDIR}/${PN}"
+do_populate_lic_setscene[cleandirs] = "${LICSSTATEDIR}"
+python do_populate_lic_setscene () {
+ sstate_setscene(d)
+}
+addtask do_populate_lic_setscene
diff --git a/import-layers/yocto-poky/meta/classes/linux-kernel-base.bbclass b/import-layers/yocto-poky/meta/classes/linux-kernel-base.bbclass
new file mode 100644
index 000000000..89ce71605
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/classes/linuxloader.bbclass b/import-layers/yocto-poky/meta/classes/linuxloader.bbclass
new file mode 100644
index 000000000..5c4dc5c51
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/linuxloader.bbclass
@@ -0,0 +1,24 @@
+
+linuxloader () {
+ case ${TARGET_ARCH} in
+ powerpc | mips | mipsel | microblaze )
+ 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
+}
diff --git a/import-layers/yocto-poky/meta/classes/live-vm-common.bbclass b/import-layers/yocto-poky/meta/classes/live-vm-common.bbclass
new file mode 100644
index 000000000..c751385e7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/live-vm-common.bbclass
@@ -0,0 +1,58 @@
+# 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, True):
+ bb.warn('Found potential conflicted var %s, please use %s rather than %s' % \
+ (var, var_with_suffix, var))
+ elif d.getVar(var_with_suffix, True):
+ d.setVar(var, d.getVar(var_with_suffix, True))
+
+
+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)}"
+
+# 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', True) == '1']}"
+
+inherit ${EFI_CLASS}
+inherit ${PCBIOS_CLASS}
+
+KERNEL_IMAGETYPE ??= "bzImage"
+
+populate_kernel() {
+ dest=$1
+ install -d $dest
+
+ # Install bzImage, initrd, and rootfs.img in DEST for all loaders to use.
+ if [ -e ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} ]; then
+ install -m 0644 ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} $dest/vmlinuz
+ 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/import-layers/yocto-poky/meta/classes/logging.bbclass b/import-layers/yocto-poky/meta/classes/logging.bbclass
new file mode 100644
index 000000000..06c7c31c3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/classes/meta.bbclass b/import-layers/yocto-poky/meta/classes/meta.bbclass
new file mode 100644
index 000000000..5e6890238
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/meta.bbclass
@@ -0,0 +1,4 @@
+
+PACKAGES = ""
+
+do_build[recrdeptask] = "do_build"
diff --git a/import-layers/yocto-poky/meta/classes/metadata_scm.bbclass b/import-layers/yocto-poky/meta/classes/metadata_scm.bbclass
new file mode 100644
index 000000000..0f7f4235a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/metadata_scm.bbclass
@@ -0,0 +1,83 @@
+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, \
+ base_get_metadata_svn_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 d.getVar( 'COREBASE', True)
+
+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/import-layers/yocto-poky/meta/classes/migrate_localcount.bbclass b/import-layers/yocto-poky/meta/classes/migrate_localcount.bbclass
new file mode 100644
index 000000000..aa0df8bb7
--- /dev/null
+++ b/import-layers/yocto-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', True)
+ if not 'AUTOINC' in pv:
+ return
+
+ localcounts = bb.persist_data.persist('BB_URI_LOCALCOUNT', e.data)
+ pn = e.data.getVar('PN', True)
+ 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', True)
+ srcrev = bb.fetch2.get_srcrev(e.data)
+ base_ver = 'AUTOINC-%s' % version[:version.find(srcrev)]
+ pkgarch = e.data.getVar('PACKAGE_ARCH', True)
+ 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', True))
+ df = e.data.getVar('LOCALCOUNT_DUMPFILE', True)
+ 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/import-layers/yocto-poky/meta/classes/mime.bbclass b/import-layers/yocto-poky/meta/classes/mime.bbclass
new file mode 100644
index 000000000..721c73fcf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/mime.bbclass
@@ -0,0 +1,56 @@
+DEPENDS += "shared-mime-info-native shared-mime-info"
+
+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', True).split()
+ pkgdest = d.getVar('PKGDEST', True)
+
+ 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, True)
+ if not postinst:
+ postinst = '#!/bin/sh\n'
+ postinst += d.getVar('mime_postinst', True)
+ d.setVar('pkg_postinst_%s' % pkg, postinst)
+ postrm = d.getVar('pkg_postrm_%s' % pkg, True)
+ if not postrm:
+ postrm = '#!/bin/sh\n'
+ postrm += d.getVar('mime_postrm', True)
+ 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/import-layers/yocto-poky/meta/classes/mirrors.bbclass b/import-layers/yocto-poky/meta/classes/mirrors.bbclass
new file mode 100644
index 000000000..9e6d4836d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/mirrors.bbclass
@@ -0,0 +1,70 @@
+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} ftp://ftp.de.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} ftp://ftp.au.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} ftp://ftp.cl.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} ftp://ftp.hr.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} ftp://ftp.fi.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} ftp://ftp.hk.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} ftp://ftp.hu.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} ftp://ftp.ie.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} ftp://ftp.it.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} ftp://ftp.jp.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} ftp://ftp.no.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} ftp://ftp.pl.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} ftp://ftp.ro.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} ftp://ftp.si.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} ftp://ftp.es.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} ftp://ftp.se.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} ftp://ftp.tr.debian.org/debian/pool \n \
+${GNU_MIRROR} ftp://mirrors.kernel.org/gnu \n \
+${KERNELORG_MIRROR} http://www.kernel.org/pub \n \
+ftp://ftp.gnupg.org/gcrypt/ ftp://ftp.franken.de/pub/crypt/mirror/ftp.gnupg.org/gcrypt/ \n \
+ftp://ftp.gnupg.org/gcrypt/ ftp://ftp.surfnet.nl/pub/security/gnupg/ \n \
+ftp://ftp.gnupg.org/gcrypt/ http://gulus.USherbrooke.ca/pub/appl/GnuPG/ \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 ftp://ftp.gnupg.org/gcrypt/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 \
+ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ ftp://ftp.cerias.purdue.edu/pub/tools/unix/sysutils/lsof/ \n \
+ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ ftp://ftp.tau.ac.il/pub/unix/admin/ \n \
+ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ ftp://ftp.cert.dfn.de/pub/tools/admin/lsof/ \n \
+ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ ftp://ftp.fu-berlin.de/pub/unix/tools/lsof/ \n \
+ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ ftp://ftp.kaizo.org/pub/lsof/ \n \
+ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ ftp://ftp.tu-darmstadt.de/pub/sysadmin/lsof/ \n \
+ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ ftp://ftp.tux.org/pub/sites/vic.cc.purdue.edu/tools/unix/lsof/ \n \
+ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ ftp://gd.tuwien.ac.at/utils/admin-tools/lsof/ \n \
+ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ ftp://sunsite.ualberta.ca/pub/Mirror/lsof/ \n \
+ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ ftp://the.wiretapped.net/pub/security/host-security/lsof/ \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 \
+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 \
+"
diff --git a/import-layers/yocto-poky/meta/classes/module-base.bbclass b/import-layers/yocto-poky/meta/classes/module-base.bbclass
new file mode 100644
index 000000000..6fe77c01b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/module-base.bbclass
@@ -0,0 +1,27 @@
+inherit kernel-arch
+
+# This is instead of DEPENDS = "virtual/kernel"
+do_configure[depends] += "virtual/kernel:do_compile_kernelmodules"
+
+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 = "${@base_read_file('${STAGING_KERNEL_BUILDDIR}/kernel-abiversion')}"
+KERNEL_OBJECT_SUFFIX = ".ko"
+
+# kernel modules are generally machine specific
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+# Function to ensure the kernel scripts are created. Expected to
+# be called before do_compile. See module.bbclass for an example.
+do_make_scripts() {
+ unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
+ make CC="${KERNEL_CC}" LD="${KERNEL_LD}" AR="${KERNEL_AR}" \
+ -C ${STAGING_KERNEL_DIR} O=${STAGING_KERNEL_BUILDDIR} scripts
+}
diff --git a/import-layers/yocto-poky/meta/classes/module.bbclass b/import-layers/yocto-poky/meta/classes/module.bbclass
new file mode 100644
index 000000000..01c9309eb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/module.bbclass
@@ -0,0 +1,34 @@
+inherit module-base kernel-module-split
+
+addtask make_scripts after do_patch before do_compile
+do_make_scripts[lockfiles] = "${TMPDIR}/kernel-scripts.lock"
+do_make_scripts[depends] += "virtual/kernel:do_shared_workdir"
+
+EXTRA_OEMAKE += "KERNEL_SRC=${STAGING_KERNEL_DIR}"
+
+MODULES_INSTALL_TARGET ?= "modules_install"
+
+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} \
+ ${MAKE_TARGETS}
+}
+
+module_do_install() {
+ unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
+ oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" \
+ CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
+ O=${STAGING_KERNEL_BUILDDIR} \
+ ${MODULES_INSTALL_TARGET}
+}
+
+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/import-layers/yocto-poky/meta/classes/multilib.bbclass b/import-layers/yocto-poky/meta/classes/multilib.bbclass
new file mode 100644
index 000000000..d5a31287a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/multilib.bbclass
@@ -0,0 +1,148 @@
+python multilib_virtclass_handler () {
+ cls = e.data.getVar("BBEXTENDCURR", True)
+ variant = e.data.getVar("BBEXTENDVARIANT", True)
+ if cls != "multilib" or not variant:
+ return
+
+ e.data.setVar('STAGING_KERNEL_DIR', e.data.getVar('STAGING_KERNEL_DIR', True))
+
+ # There should only be one kernel in multilib configs
+ # We also skip multilib setup for module packages.
+ provides = (e.data.getVar("PROVIDES", True) or "").split()
+ if "virtual/kernel" in provides or bb.data.inherits_class('module-base', e.data):
+ raise bb.parse.SkipPackage("We shouldn't have multilib variants for the kernel")
+
+ save_var_name=e.data.getVar("MULTILIB_SAVE_VARNAME", True) or ""
+ for name in save_var_name.split():
+ val=e.data.getVar(name, True)
+ 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', True))
+ 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)
+ bb.data.update_data(e.data)
+ return
+
+ if bb.data.inherits_class('native', e.data):
+ raise bb.parse.SkipPackage("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.SkipPackage("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.SkipPackage("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", True))
+
+ override = ":virtclass-multilib-" + variant
+
+ 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, True)
+ 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)
+ e.data.setVar('DEFAULTTUNE_ML_%s' % variant, newtune)
+}
+
+addhandler multilib_virtclass_handler
+multilib_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise"
+
+STAGINGCC_prepend = "${BBEXTENDVARIANT}-"
+
+python __anonymous () {
+ variant = d.getVar("BBEXTENDVARIANT", True)
+
+ 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", True) + " " + d.getVar("PACKAGE_INSTALL", True)
+ 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", "")
+
+ if bb.data.inherits_class('image', 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", True) or "").split())
+
+ clsextend.map_packagevars()
+ clsextend.map_regexp_variable("PACKAGES_DYNAMIC")
+ clsextend.map_variable("PACKAGE_INSTALL")
+ 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), True) or d.getVar(var, True) 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', True), pkg, ' '.join(candidates), var)
+ package_qa_handle_error("multilib", msg, d)
+
+ ml = d.getVar('MLPREFIX', True)
+ if not ml:
+ return
+
+ packages = d.getVar('PACKAGES', True)
+ 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/import-layers/yocto-poky/meta/classes/multilib_global.bbclass b/import-layers/yocto-poky/meta/classes/multilib_global.bbclass
new file mode 100644
index 000000000..67dc72b76
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/multilib_global.bbclass
@@ -0,0 +1,180 @@
+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', True) 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 = []
+ for v in d.keys():
+ if v.startswith("PREFERRED_VERSION_"):
+ versions.append(v)
+ if v.startswith("PREFERRED_PROVIDER_"):
+ providers.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)
+ bb.data.update_data(localdata)
+ 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)
+ bb.data.update_data(localdata)
+ 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:
+ 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)
+ bb.data.update_data(localdata)
+ 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):
+ 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", True) 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", True) 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", True) 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", True).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 () {
+ if not e.data:
+ return
+
+ variant = e.data.getVar("BBEXTENDVARIANT", True)
+
+ if isinstance(e, bb.event.RecipeParsed) and not variant:
+ 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", True) 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", True) 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", True) 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", True) or "").split():
+ origrprovs = rprovs = e.data.getVar("RPROVIDES_%s" % pkg, True) 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.RecipePreFinalise bb.event.RecipeParsed"
+
diff --git a/import-layers/yocto-poky/meta/classes/multilib_header.bbclass b/import-layers/yocto-poky/meta/classes/multilib_header.bbclass
new file mode 100644
index 000000000..5ee0a2d56
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/multilib_header.bbclass
@@ -0,0 +1,54 @@
+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
+ # We use
+ # For ARM: We don't support multilib builds.
+ # For MIPS: "n32" is a special case, which needs to be
+ # distinct from both 64-bit and 32-bit.
+ case ${TARGET_ARCH} in
+ arm*) return
+ ;;
+ mips*) case "${MIPSPKGSFX_ABI}" in
+ "-n32")
+ ident=n32
+ ;;
+ *)
+ ident=${SITEINFO_BITS}
+ ;;
+ esac
+ ;;
+ *) ident=${SITEINFO_BITS}
+ esac
+ if echo ${TARGET_ARCH} | grep -q arm; then
+ return
+ fi
+ 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
+}
diff --git a/import-layers/yocto-poky/meta/classes/native.bbclass b/import-layers/yocto-poky/meta/classes/native.bbclass
new file mode 100644
index 000000000..f67ef0014
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/native.bbclass
@@ -0,0 +1,179 @@
+# 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 = ""
+
+DEPENDS_GETTEXT = "gettext-native"
+
+# 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"
+
+# Libtool's default paths are correct for the native machine
+lt_cv_sys_lib_dlsearch_path_spec[unexport] = "1"
+
+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] = "${STAGING_DIR_NATIVE}/"
+
+# 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-uclibc or libc-glibc to kick in for native recipes
+LIBCOVERRIDE = ""
+CLASSOVERRIDE = "class-native"
+MACHINEOVERRIDES = ""
+
+PATH_prepend = "${COREBASE}/scripts/native-intercept:"
+
+python native_virtclass_handler () {
+ classextend = e.data.getVar('BBCLASSEXTEND', True) or ""
+ if "native" not in classextend:
+ return
+
+ pn = e.data.getVar("PN", True)
+ if not pn.endswith("-native"):
+ return
+
+ def map_dependencies(varname, d, suffix = ""):
+ if suffix:
+ varname = varname + "_" + suffix
+ deps = d.getVar(varname, True)
+ 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", True), "", "${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", True)
+ 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"
+
+inherit nopackages
+
+do_packagedata[stamp-extra-info] = ""
+do_populate_sysroot[stamp-extra-info] = ""
+
+USE_NLS = "no"
diff --git a/import-layers/yocto-poky/meta/classes/nativesdk.bbclass b/import-layers/yocto-poky/meta/classes/nativesdk.bbclass
new file mode 100644
index 000000000..f74da6267
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/nativesdk.bbclass
@@ -0,0 +1,97 @@
+# 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 = ""
+
+#
+# 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"
+
+STAGING_DIR_HOST = "${STAGING_DIR}/${MULTIMACH_HOST_SYS}"
+STAGING_DIR_TARGET = "${STAGING_DIR}/${MULTIMACH_TARGET_SYS}"
+PKGDATA_DIR = "${STAGING_DIR_HOST}/pkgdata"
+
+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_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", True)
+ if not (pn.endswith("-nativesdk") or pn.startswith("nativesdk-")):
+ return
+
+ e.data.setVar("MLPREFIX", "nativesdk-")
+ e.data.setVar("PN", "nativesdk-" + e.data.getVar("PN", True).replace("-nativesdk", "").replace("nativesdk-", ""))
+ e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + ":virtclass-nativesdk")
+}
+
+python () {
+ pn = d.getVar("PN", True)
+ 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", True) 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}"
diff --git a/import-layers/yocto-poky/meta/classes/nopackages.bbclass b/import-layers/yocto-poky/meta/classes/nopackages.bbclass
new file mode 100644
index 000000000..0c2761bef
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/nopackages.bbclass
@@ -0,0 +1,6 @@
+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
diff --git a/import-layers/yocto-poky/meta/classes/npm.bbclass b/import-layers/yocto-poky/meta/classes/npm.bbclass
new file mode 100644
index 000000000..9843e8735
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/npm.bbclass
@@ -0,0 +1,49 @@
+DEPENDS_prepend = "nodejs-native "
+S = "${WORKDIR}/npmpkg"
+
+NPM_INSTALLDIR = "${D}${libdir}/node_modules/${PN}"
+
+npm_do_compile() {
+ # changing the home directory to the working directory, the .npmrc will
+ # be created in this directory
+ export HOME=${WORKDIR}
+ npm config set dev false
+ npm set cache ${WORKDIR}/npm_cache
+ # clear cache before every build
+ npm cache clear
+ # Install pkg into ${S} without going to the registry
+ npm --arch=${TARGET_ARCH} --production --no-registry install
+}
+
+npm_do_install() {
+ mkdir -p ${NPM_INSTALLDIR}/
+ cp -a ${S}/* ${NPM_INSTALLDIR}/ --no-preserve=ownership
+}
+
+python populate_packages_prepend () {
+ instdir = d.expand('${D}${libdir}/node_modules/${PN}')
+ 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/${PN}/' + 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.encode("utf8"))
+ description = pdata.get('description', None)
+ if description:
+ d.setVar('SUMMARY_%s' % expanded_pkgname, description.replace(u"\u2018", "'").replace(u"\u2019", "'").encode("utf8"))
+ d.appendVar('RDEPENDS_%s' % d.getVar('PN', True), ' %s' % ' '.join(pkgnames).replace('_', '-'))
+}
+
+FILES_${PN} += " \
+ ${libdir}/node_modules/${PN} \
+"
+
+EXPORT_FUNCTIONS do_compile do_install
diff --git a/import-layers/yocto-poky/meta/classes/oelint.bbclass b/import-layers/yocto-poky/meta/classes/oelint.bbclass
new file mode 100644
index 000000000..1b051ca22
--- /dev/null
+++ b/import-layers/yocto-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", True)
+
+ ##############################
+ # 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', True) 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 = file('%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/import-layers/yocto-poky/meta/classes/own-mirrors.bbclass b/import-layers/yocto-poky/meta/classes/own-mirrors.bbclass
new file mode 100644
index 000000000..12b42675b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/own-mirrors.bbclass
@@ -0,0 +1,13 @@
+PREMIRRORS() {
+cvs://.*/.* ${SOURCE_MIRROR_URL}
+svn://.*/.* ${SOURCE_MIRROR_URL}
+git://.*/.* ${SOURCE_MIRROR_URL}
+gitsm://.*/.* ${SOURCE_MIRROR_URL}
+hg://.*/.* ${SOURCE_MIRROR_URL}
+bzr://.*/.* ${SOURCE_MIRROR_URL}
+p4://.*/.* ${SOURCE_MIRROR_URL}
+osc://.*/.* ${SOURCE_MIRROR_URL}
+https?$://.*/.* ${SOURCE_MIRROR_URL}
+ftp://.*/.* ${SOURCE_MIRROR_URL}
+npm://.*/.* ${SOURCE_MIRROR_URL}
+}
diff --git a/import-layers/yocto-poky/meta/classes/package.bbclass b/import-layers/yocto-poky/meta/classes/package.bbclass
new file mode 100644
index 000000000..76b9f8649
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/package.bbclass
@@ -0,0 +1,2131 @@
+#
+# 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
+# depenedencies 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
+PACKAGE_DEPENDS += "rpm-native"
+
+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).decode('unicode_escape').encode('utf-8')
+
+ # 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', True)
+ 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", True)
+ 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', True).split()
+ split_packages = []
+
+ 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", True)
+
+ 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.append(pkg)
+ if not pkg in packages:
+ if prepend:
+ packages = [pkg] + packages
+ else:
+ packages.append(pkg)
+ oldfiles = d.getVar('FILES_' + pkg, True)
+ 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, True):
+ d.setVar('DESCRIPTION_' + pkg, description % on)
+ if not d.getVar('SUMMARY_' + pkg, True):
+ 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 split_packages
+
+PACKAGE_DEPENDS += "file-native"
+
+python () {
+ if d.getVar('PACKAGES', True) != '':
+ deps = ""
+ for dep in (d.getVar('PACKAGE_DEPENDS', True) 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)
+
+ for f in files:
+ 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
+
+# Called in package_<rpm,ipk,deb>.bbclass to get the correct list of configuration files
+def get_conffiles(pkg, d):
+ pkgdest = d.getVar('PKGDEST', True)
+ root = os.path.join(pkgdest, pkg)
+ cwd = os.getcwd()
+ os.chdir(root)
+
+ conffiles = d.getVar('CONFFILES_%s' % pkg, True);
+ if conffiles == None:
+ conffiles = d.getVar('CONFFILES', True)
+ if conffiles == None:
+ conffiles = ""
+ conffiles = conffiles.split()
+ conf_orig_list = files_from_filevars(conffiles)
+
+ # 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', True)
+ with open(file) as f:
+ file_content = f.read()
+ if tmpdir in file_content:
+ return True
+
+ return False
+
+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', True)
+ objcopy = d.getVar("OBJCOPY", True)
+ debugedit = d.expand("${STAGING_LIBDIR_NATIVE}/rpm/bin/debugedit")
+
+ # 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:
+ cmd = "'%s' -i -l '%s' '%s'" % (debugedit, sourcefile, file)
+ (retval, output) = oe.utils.getstatusoutput(cmd)
+ if retval:
+ bb.fatal("debugedit failed with exit code %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else ""))
+
+ 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 procecessed
+ # 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', True)
+ strip = d.getVar("STRIP", True)
+ objcopy = d.getVar("OBJCOPY", True)
+ debugedit = d.expand("${STAGING_LIBDIR_NATIVE}/rpm/bin/debugedit")
+ workdir = d.getVar("WORKDIR", True)
+ 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)
+
+ processdebugsrc = "LC_ALL=C ; sort -z -u '%s' | egrep -v -z '(<internal>|<built-in>)$' | "
+ # 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", True) 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, True)))
+
+ if bb.data.inherits_class('packagegroup', d):
+ return
+
+ new_depends = {}
+ deps = bb.utils.explode_dep_versions2(d.getVar(varname, True) 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, True)))
+
+#
+# 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', True)
+ host = d.getVar("PRSERV_HOST_" + pn, True)
+ if not (host is None):
+ d.setVar("PRSERV_HOST", host)
+
+ pkgv = d.getVar("PKGV", True)
+
+ # PR Server not active, handle AUTOINC
+ if not d.getVar('PRSERV_HOST', True):
+ if 'AUTOINC' in pkgv:
+ d.setVar("PKGV", pkgv.replace("AUTOINC", "0"))
+ return
+
+ auto_pr = None
+ pv = d.getVar("PV", True)
+ version = d.getVar("PRAUTOINX", True)
+ pkgarch = d.getVar("PACKAGE_ARCH", True)
+ checksum = d.getVar("BB_TASKHASH", True)
+
+ if d.getVar('PRSERV_LOCKDOWN', True):
+ auto_pr = d.getVar('PRAUTO_' + version + '_' + pkgarch, True) or d.getVar('PRAUTO_' + version, True) 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", True)
+ 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', True) == '1'):
+ bb.debug(1, "package requested not splitting locales")
+ return
+
+ packages = (d.getVar('PACKAGES', True) or "").split()
+
+ datadir = d.getVar('datadir', True)
+ if not datadir:
+ bb.note("datadir not defined")
+ return
+
+ dvar = d.getVar('PKGD', True)
+ pn = d.getVar('LOCALEBASEPN', True)
+
+ 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', True) or pn
+ description = d.getVar('DESCRIPTION', True) or ""
+ locale_section = d.getVar('LOCALE_SECTION', True)
+ mlprefix = d.getVar('MLPREFIX', True) 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, True) or "").split()
+ #rdep.append('%s-locale*' % pn)
+ #d.setVar('RDEPENDS_%s' % pn, ' '.join(rdep))
+}
+
+python perform_packagecopy () {
+ dest = d.getVar('D', True)
+ dvar = d.getVar('PKGD', True)
+
+ # 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 occured
+ # 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', True)
+ fs_perms_tables = d.getVar('FILESYSTEM_PERMS_TABLES', True)
+ if not fs_perms_tables:
+ fs_perms_tables = 'files/fs-perms.txt'
+ for conf_file in fs_perms_tables.split():
+ str += " %s" % bb.utils.which(bbpath, conf_file)
+ return str
+
+
+
+ dvar = d.getVar('PKGD', True)
+
+ 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, True) or ""
+ if dir == "":
+ continue
+ fs_perms_table[dir] = fs_perms_entry(bb.data.expand("%s 0755 root root false - - -" % (dir), d))
+
+ # 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', True)
+ pn = d.getVar('PN', True)
+
+ # We default to '.debug' style
+ if d.getVar('PACKAGE_DEBUG_SPLIT_STYLE', True) == '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', True) == '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 = ""
+ 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)
+
+ os.chdir(dvar)
+
+ # 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 \"%s\"" % path.replace("\"", "\\\""))
+
+ 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
+
+
+ #
+ # First lets figure out all of the files we may have to process ... do this only once!
+ #
+ elffiles = {}
+ symlinks = {}
+ kernmods = []
+ inodes = {}
+ libdir = os.path.abspath(dvar + os.sep + d.getVar("libdir", True))
+ baselibdir = os.path.abspath(dvar + os.sep + d.getVar("base_libdir", True))
+ if (d.getVar('INHIBIT_PACKAGE_STRIP', True) != '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
+
+ # Skip debug files
+ if debugappend and file.endswith(debugappend):
+ continue
+ if debugdir and debugdir in os.path.dirname(file[len(dvar):]):
+ 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 excutable
+ 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, True) 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 indentify 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', True) != '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)
+
+ # 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', True) != '1'):
+ strip = d.getVar("STRIP", True)
+ 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
+ #
+}
+
+python populate_packages () {
+ import glob, re
+
+ workdir = d.getVar('WORKDIR', True)
+ outdir = d.getVar('DEPLOY_DIR', True)
+ dvar = d.getVar('PKGD', True)
+ packages = d.getVar('PACKAGES', True)
+ pn = d.getVar('PN', True)
+
+ bb.utils.mkdirhier(outdir)
+ os.chdir(dvar)
+
+ autodebug = not (d.getVar("NOAUTOPACKAGEDEBUG", True) or False)
+
+ # Sanity check PACKAGES for duplicates
+ # Sanity should be moved to sanity.bbclass once we have the infrastucture
+ 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)
+ elif autodebug and pkg.endswith("-dbg"):
+ package_list.insert(0, pkg)
+ else:
+ package_list.append(pkg)
+ d.setVar('PACKAGES', ' '.join(package_list))
+ pkgdest = d.getVar('PKGDEST', True)
+
+ 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, True) 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 = 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)
+ fstat = cpath.stat(file)
+ os.chmod(fpath, fstat.st_mode)
+ os.chown(fpath, fstat.st_uid, fstat.st_gid)
+ continue
+ ret = bb.utils.copyfile(file, fpath)
+ if ret is False or ret == 0:
+ raise bb.build.FuncFailed("File population failed")
+
+ os.umask(oldumask)
+ os.chdir(workdir)
+
+ # Handle LICENSE_EXCLUSION
+ package_list = []
+ for pkg in packages.split():
+ if d.getVar('LICENSE_EXCLUSION-' + pkg, True):
+ 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, True) 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', True)
+ 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, True) 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 write_if_exists(f, pkg, var):
+ def encode(str):
+ import codecs
+ c = codecs.getencoder("string_escape")
+ return c(str)[0]
+
+ val = d.getVar('%s_%s' % (var, pkg), True)
+ if val:
+ f.write('%s_%s: %s\n' % (var, pkg, encode(val)))
+ return val
+ val = d.getVar('%s' % (var), True)
+ 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', True)
+ pkgdest = d.getVar('PKGDEST', True)
+ pkgdatadir = d.getVar('PKGDESTWORK', True)
+
+ # 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', True)
+ global_variants = (d.getVar('MULTILIB_GLOBAL_VARIANTS', True) or "").split()
+ variants = (d.getVar('MULTILIB_VARIANTS', True) 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', True)
+
+ for pkg in packages.split():
+ pkgval = d.getVar('PKG_%s' % pkg, True)
+ if pkgval is None:
+ pkgval = pkg
+ d.setVar('PKG_%s' % pkg, pkg)
+
+ pkgdestpkg = os.path.join(pkgdest, pkg)
+ files = {}
+ total_size = 0
+ for f in pkgfiles[pkg]:
+ relpth = os.path.relpath(f, pkgdestpkg)
+ fstat = os.lstat(f)
+ total_size += fstat.st_size
+ files[os.sep + relpth] = 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, '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, True) or "").split():
+ write_if_exists(sf, pkg, 'FILERPROVIDES_' + dfile)
+
+ write_if_exists(sf, pkg, 'FILERDEPENDSFLIST')
+ for dfile in (d.getVar('FILERDEPENDSFLIST_' + pkg, True) 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, True)
+ if not allow_empty:
+ allow_empty = d.getVar('ALLOW_EMPTY', True)
+ 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/bin/rpmdeps-oecore --macros ${STAGING_LIBDIR_NATIVE}/rpm/macros --define '_rpmfc_magic_path ${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc' --rpmpopt ${STAGING_LIBDIR_NATIVE}/rpm/rpmpopt"
+
+# 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', True) == '1':
+ return
+
+ pkgdest = d.getVar('PKGDEST', True)
+ packages = d.getVar('PACKAGES', True)
+ rpmdeps = d.getVar('RPMDEPS', True)
+
+ 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, True) == '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-'):
+ 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', 0)
+ if exclude_shlibs:
+ bb.note("not generating shlibs")
+ return
+
+ lib_re = re.compile("^.*\.so")
+ libdir_re = re.compile(".*/%s$" % d.getVar('baselib', True))
+
+ packages = d.getVar('PACKAGES', True)
+ targetos = d.getVar('TARGET_OS', True)
+
+ workdir = d.getVar('WORKDIR', True)
+
+ ver = d.getVar('PKGV', True)
+ if not ver:
+ msg = "PKGV not defined"
+ package_qa_handle_error("pkgv-undefined", msg, d)
+ return
+
+ pkgdest = d.getVar('PKGDEST', True)
+
+ shlibswork_dir = d.getVar('SHLIBSWORKDIR', True)
+
+ # Take shared lock since we're only reading, not writing
+ lf = bb.utils.lockfile(d.expand("${PACKAGELOCK}"))
+
+ def linux_so(file, needed, sonames, renames, pkgver):
+ needs_ldconfig = False
+ ldir = os.path.dirname(file).replace(pkgdest + "/" + pkg, '')
+ cmd = d.getVar('OBJDUMP', True) + " -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 = 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'):
+ # 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)
+ err, out = p.communicate()
+ # If returned successfully, process stderr for results
+ if p.returncode == 0:
+ for l in err.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)
+ err, out = p.communicate()
+ # If returned successfully, process stderr for results
+ if p.returncode == 0:
+ for l in err.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, []))
+
+ if d.getVar('PACKAGE_SNAP_LIB_SYMLINKS', True) == "1":
+ snap_symlinks = True
+ else:
+ snap_symlinks = False
+
+ if (d.getVar('USE_LDCONFIG', True) or "1") == "1":
+ use_ldconfig = True
+ else:
+ use_ldconfig = False
+
+ needed = {}
+ shlib_provider = oe.package.read_shlib_providers(d)
+
+ for pkg in packages.split():
+ private_libs = d.getVar('PRIVATE_LIBS_' + pkg, True) or d.getVar('PRIVATE_LIBS', True) or ""
+ private_libs = private_libs.split()
+ needs_ldconfig = False
+ bb.debug(2, "calculating shlib provides for %s" % pkg)
+
+ pkgver = d.getVar('PKGV_' + pkg, True)
+ if not pkgver:
+ pkgver = d.getVar('PV_' + pkg, True)
+ 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 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, True)
+ if not postinst:
+ postinst = '#!/bin/sh\n'
+ postinst += d.getVar('ldconfig_postinst_fragment', True)
+ 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', True)
+ if assumed_libs:
+ libdir = d.getVar("libdir", True)
+ 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', True), d.getVar('base_libdir', True)]
+
+ for pkg in packages.split():
+ bb.debug(2, "calculating shlib requirements for %s" % pkg)
+
+ 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 = list()
+ 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', True)
+ workdir = d.getVar('WORKDIR', True)
+ pkgdest = d.getVar('PKGDEST', True)
+
+ shlibs_dirs = d.getVar('SHLIBSDIRS', True).split()
+ shlibswork_dir = d.getVar('SHLIBSWORKDIR', True)
+
+ 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 = bb.data.expand(m.group(2), pd)
+ 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}"))
+
+ 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', True).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', True).split()
+ for pkg in packages:
+ rdepends = bb.utils.explode_dep_versions2(d.getVar('RDEPENDS_' + pkg, True) 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', True)
+ postfixes = (d.getVar('DEPCHAIN_POST', True) or '').split()
+ prefixes = (d.getVar('DEPCHAIN_PRE', True) 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, True) 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, True) 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', True) or ""):
+ add_dep(depends, dep)
+
+ rdepends = []
+ for pkg in packages.split():
+ for dep in bb.utils.explode_deps(d.getVar('RDEPENDS_' + pkg, True) 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', True) == '1') or (bb.data.inherits_class('packagegroup', d)))
+
+ for suffix in pkgs:
+ for pkg in pkgs[suffix]:
+ if d.getVarFlag('RRECOMMENDS_' + pkg, 'nodeprrecs', True):
+ 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, True) 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"
+
+def gen_packagevar(d):
+ ret = []
+ pkgs = (d.getVar("PACKAGES", True) or "").split()
+ vars = (d.getVar("PACKAGEVARS", True) 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 = "1"
+
+ # Init cachedpath
+ global cpath
+ cpath = oe.cachedpath.CachedPath()
+
+ ###########################################################################
+ # Sanity test the setup
+ ###########################################################################
+
+ packages = (d.getVar('PACKAGES', True) or "").split()
+ if len(packages) < 1:
+ bb.debug(1, "No packages to build, skipping do_package")
+ return
+
+ workdir = d.getVar('WORKDIR', True)
+ outdir = d.getVar('DEPLOY_DIR', True)
+ dest = d.getVar('D', True)
+ dvar = d.getVar('PKGD', True)
+ pn = d.getVar('PN', True)
+
+ 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, True))
+
+ for x in 'PN', 'PV', 'BPN', 'TARGET_SYS', 'EXTENDPRAUTO':
+ expandVar(x, d)
+
+ ###########################################################################
+ # Setup PKGD (from D)
+ ###########################################################################
+
+ for f in (d.getVar('PACKAGEBUILDPKGD', True) or '').split():
+ bb.build.exec_func(f, d)
+
+ ###########################################################################
+ # Split up PKGD into PKGDEST
+ ###########################################################################
+
+ cpath = oe.cachedpath.CachedPath()
+
+ for f in (d.getVar('PACKAGESPLITFUNCS', True) 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', True).split()
+ pkgdest = d.getVar('PKGDEST', True)
+ 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', True) or '').split():
+ bb.build.exec_func(f, d)
+
+ qa_sane = d.getVar("QA_SANE", True)
+ 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
+
+PACKAGELOCK = "${STAGING_DIR}/package-output.lock"
+SSTATETASKS += "do_package"
+do_package[cleandirs] = "${PKGDEST} ${PKGDESTWORK}"
+do_package[sstate-plaindirs] = "${PKGD} ${PKGDEST} ${PKGDESTWORK}"
+do_package[sstate-lockfile-shared] = "${PACKAGELOCK}"
+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"
+do_packagedata[sstate-inputdirs] = "${PKGDESTWORK}"
+do_packagedata[sstate-outputdirs] = "${PKGDATA_DIR}"
+do_packagedata[sstate-lockfile-shared] = "${PACKAGELOCK}"
+do_packagedata[stamp-extra-info] = "${MACHINE}"
+
+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", True)
+ runtime_mapping_rename("RDEPENDS", pkg, d)
+ runtime_mapping_rename("RRECOMMENDS", pkg, d)
+ runtime_mapping_rename("RSUGGESTS", pkg, d)
+
diff --git a/import-layers/yocto-poky/meta/classes/package_deb.bbclass b/import-layers/yocto-poky/meta/classes/package_deb.bbclass
new file mode 100644
index 000000000..e1d05a74c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/package_deb.bbclass
@@ -0,0 +1,359 @@
+#
+# Copyright 2006-2008 OpenedHand Ltd.
+#
+
+inherit package
+
+IMAGE_PKGTYPE ?= "deb"
+
+DPKG_ARCH ?= "${@debian_arch_map(d.getVar('TARGET_ARCH', True), d.getVar('TUNE_FEATURES', True))}"
+DPKG_ARCH[vardepvalue] = "${DPKG_ARCH}"
+
+PKGWRITEDIRDEB = "${WORKDIR}/deploy-debs"
+
+APTCONF_TARGET = "${WORKDIR}"
+
+APT_ARGS = "${@['', '--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS", True) == "1"]}"
+
+def debian_arch_map(arch, tune):
+ tune_features = tune.split()
+ 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
+#
+# install a bunch of packages using apt
+# the following shell variables needs to be set before calling this func:
+# INSTALL_ROOTFS_DEB - install root dir
+# INSTALL_BASEARCH_DEB - install base architecutre
+# INSTALL_ARCHS_DEB - list of available archs
+# INSTALL_PACKAGES_NORMAL_DEB - packages to be installed
+# INSTALL_PACKAGES_ATTEMPTONLY_DEB - packages attempted to be installed only
+# INSTALL_PACKAGES_LINGUAS_DEB - additional packages for uclibc
+# INSTALL_TASK_DEB - task name
+
+python do_package_deb () {
+ import re, copy
+ import textwrap
+ import subprocess
+
+ workdir = d.getVar('WORKDIR', True)
+ if not workdir:
+ bb.error("WORKDIR not defined, unable to package")
+ return
+
+ outdir = d.getVar('PKGWRITEDIRDEB', True)
+ if not outdir:
+ bb.error("PKGWRITEDIRDEB not defined, unable to package")
+ return
+
+ packages = d.getVar('PACKAGES', True)
+ if not packages:
+ bb.debug(1, "PACKAGES not defined, nothing to package")
+ return
+
+ tmpdir = d.getVar('TMPDIR', True)
+
+ 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"))
+
+ if packages == []:
+ bb.debug(1, "No packages; nothing to do")
+ return
+
+ pkgdest = d.getVar('PKGDEST', True)
+
+ def cleanupcontrol(root):
+ for p in ['CONTROL', 'DEBIAN']:
+ p = os.path.join(root, p)
+ if os.path.exists(p):
+ bb.utils.prunedir(p)
+
+ for pkg in packages.split():
+ localdata = bb.data.createCopy(d)
+ root = "%s/%s" % (pkgdest, pkg)
+
+ lf = bb.utils.lockfile(root + ".lock")
+
+ localdata.setVar('ROOT', '')
+ localdata.setVar('ROOT_%s' % pkg, root)
+ pkgname = localdata.getVar('PKG_%s' % pkg, True)
+ if not pkgname:
+ pkgname = pkg
+ localdata.setVar('PKG', pkgname)
+
+ localdata.setVar('OVERRIDES', d.getVar("OVERRIDES", False) + ":" + pkg)
+
+ bb.data.update_data(localdata)
+ basedir = os.path.join(os.path.dirname(root))
+
+ pkgoutdir = os.path.join(outdir, localdata.getVar('PACKAGE_ARCH', True))
+ 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', True), localdata.getVar('PKGR', True)))
+ bb.utils.unlockfile(lf)
+ continue
+
+ controldir = os.path.join(root, 'DEBIAN')
+ bb.utils.mkdirhier(controldir)
+ os.chmod(controldir, 0755)
+ try:
+ import codecs
+ ctrlfile = codecs.open(os.path.join(controldir, 'control'), 'w', 'utf-8')
+ except OSError:
+ bb.utils.unlockfile(lf)
+ raise bb.build.FuncFailed("unable to open control file for writing.")
+
+ fields = []
+ pe = d.getVar('PKGE', True)
+ 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', True):
+ 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, True)
+ if data is None:
+ raise KeyError(f)
+ if i == 'DPKG_ARCH' and d.getVar('PACKAGE_ARCH', True) == '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', True) == "all":
+ ctrlfile.write("Multi-Arch: foreign\n")
+ # check for required fields
+ try:
+ 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', True) or localdata.getVar('DESCRIPTION', True) or "."
+ ctrlfile.write('Description: %s\n' % unicode(summary,'utf-8'))
+ description = localdata.getVar('DESCRIPTION', True) or "."
+ description = textwrap.dedent(description).strip()
+ if '\\n' in description:
+ # Manually indent
+ for t in description.split('\\n'):
+ # We don't limit the width when manually indent, but we do
+ # need the textwrap.fill() to set the initial_indent and
+ # subsequent_indent, so set a large width
+ ctrlfile.write('%s\n' % unicode(textwrap.fill(t, width=100000, initial_indent=' ', subsequent_indent=' '),'utf-8'))
+ else:
+ # Auto indent
+ ctrlfile.write('%s\n' % unicode(textwrap.fill(description.strip(), width=74, initial_indent=' ', subsequent_indent=' '),'utf-8'))
+
+ else:
+ ctrlfile.write(unicode(c % tuple(pullData(fs, localdata)),'utf-8'))
+ except KeyError:
+ import sys
+ (type, value, traceback) = sys.exc_info()
+ bb.utils.unlockfile(lf)
+ ctrlfile.close()
+ raise bb.build.FuncFailed("Missing field for deb generation: %s" % value)
+ except UnicodeDecodeError:
+ bb.utils.unlockfile(lf)
+ ctrlfile.close()
+ raise bb.build.FuncFailed("Non UTF-8 characters found in one of the fields")
+
+ # more fields
+
+ custom_fields_chunk = get_package_additional_metadata("deb", localdata)
+ if custom_fields_chunk is not None:
+ ctrlfile.write(unicode(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 these instances with '__' and '__'
+ #
+ # 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:
+ if '(' in dep:
+ newdep = dep.replace('(', '__')
+ newdep = newdep.replace(')', '__')
+ 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", True) or "")
+ debian_cmp_remap(rdepends)
+ for dep in rdepends.keys():
+ if dep == pkg:
+ del rdepends[dep]
+ continue
+ if '*' in dep:
+ del rdepends[dep]
+ rrecommends = bb.utils.explode_dep_versions2(localdata.getVar("RRECOMMENDS", True) or "")
+ debian_cmp_remap(rrecommends)
+ for dep in rrecommends.keys():
+ if '*' in dep:
+ del rrecommends[dep]
+ rsuggests = bb.utils.explode_dep_versions2(localdata.getVar("RSUGGESTS", True) 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", True) or ""), [])
+ debian_cmp_remap(rprovides)
+ rreplaces = bb.utils.explode_dep_versions2(localdata.getVar("RREPLACES", True) or "")
+ debian_cmp_remap(rreplaces)
+ rconflicts = bb.utils.explode_dep_versions2(localdata.getVar("RCONFLICTS", True) or "")
+ debian_cmp_remap(rconflicts)
+ if rdepends:
+ ctrlfile.write("Depends: %s\n" % unicode(bb.utils.join_deps(rdepends)))
+ if rsuggests:
+ ctrlfile.write("Suggests: %s\n" % unicode(bb.utils.join_deps(rsuggests)))
+ if rrecommends:
+ ctrlfile.write("Recommends: %s\n" % unicode(bb.utils.join_deps(rrecommends)))
+ if rprovides:
+ ctrlfile.write("Provides: %s\n" % unicode(bb.utils.join_deps(rprovides)))
+ if rreplaces:
+ ctrlfile.write("Replaces: %s\n" % unicode(bb.utils.join_deps(rreplaces)))
+ if rconflicts:
+ ctrlfile.write("Conflicts: %s\n" % unicode(bb.utils.join_deps(rconflicts)))
+ ctrlfile.close()
+
+ for script in ["preinst", "postinst", "prerm", "postrm"]:
+ scriptvar = localdata.getVar('pkg_%s' % script, True)
+ if not scriptvar:
+ continue
+ scriptvar = scriptvar.strip()
+ try:
+ scriptfile = open(os.path.join(controldir, script), 'w')
+ except OSError:
+ bb.utils.unlockfile(lf)
+ raise bb.build.FuncFailed("unable to open %s script file for writing." % script)
+
+ 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), 0755)
+
+ conffiles_str = ' '.join(get_conffiles(pkg, d))
+ if conffiles_str:
+ try:
+ conffiles = open(os.path.join(controldir, 'conffiles'), 'w')
+ except OSError:
+ bb.utils.unlockfile(lf)
+ raise bb.build.FuncFailed("unable to open conffiles for writing.")
+ 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)
+ ret = subprocess.call("PATH=\"%s\" dpkg-deb -b %s %s" % (localdata.getVar("PATH", True), root, pkgoutdir), shell=True)
+ if ret != 0:
+ bb.utils.unlockfile(lf)
+ raise bb.build.FuncFailed("dpkg-deb execution failed")
+
+ cleanupcontrol(root)
+ bb.utils.unlockfile(lf)
+}
+# Indirect references to these vars
+do_package_write_deb[vardeps] += "PKGV PKGR PKGV DESCRIPTION SECTION PRIORITY MAINTAINER DPKG_ARCH PN HOMEPAGE"
+# Otherwise allarch packages may change depending on override configuration
+do_package_deb[vardepsexclude] = "OVERRIDES"
+
+
+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', True)
+
+ 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', True) != '':
+ 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"
+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/import-layers/yocto-poky/meta/classes/package_ipk.bbclass b/import-layers/yocto-poky/meta/classes/package_ipk.bbclass
new file mode 100644
index 000000000..f1ad1d5c1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/package_ipk.bbclass
@@ -0,0 +1,294 @@
+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"
+
+OPKG_ARGS += "--force_postinstall --prefer-arch-to-version"
+OPKG_ARGS += "${@['', '--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS", True) == "1"]}"
+OPKG_ARGS += "${@['', '--add-exclude ' + ' --add-exclude '.join((d.getVar('PACKAGE_EXCLUDE', True) or "").split())][(d.getVar("PACKAGE_EXCLUDE", True) or "") != ""]}"
+
+OPKGLIBDIR = "${localstatedir}/lib"
+
+python do_package_ipk () {
+ import re, copy
+ import textwrap
+ import subprocess
+
+ workdir = d.getVar('WORKDIR', True)
+ outdir = d.getVar('PKGWRITEDIRIPK', True)
+ tmpdir = d.getVar('TMPDIR', True)
+ pkgdest = d.getVar('PKGDEST', True)
+ if not workdir or not outdir or not tmpdir:
+ bb.error("Variables incorrectly set, unable to package")
+ return
+
+ packages = d.getVar('PACKAGES', True)
+ 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"))
+
+ def cleanupcontrol(root):
+ for p in ['CONTROL', 'DEBIAN']:
+ p = os.path.join(root, p)
+ if os.path.exists(p):
+ bb.utils.prunedir(p)
+
+ for pkg in packages.split():
+ localdata = bb.data.createCopy(d)
+ root = "%s/%s" % (pkgdest, pkg)
+
+ lf = bb.utils.lockfile(root + ".lock")
+
+ localdata.setVar('ROOT', '')
+ localdata.setVar('ROOT_%s' % pkg, root)
+ pkgname = localdata.getVar('PKG_%s' % pkg, True)
+ if not pkgname:
+ pkgname = pkg
+ localdata.setVar('PKG', pkgname)
+
+ localdata.setVar('OVERRIDES', d.getVar("OVERRIDES", False) + ":" + pkg)
+
+ bb.data.update_data(localdata)
+ basedir = os.path.join(os.path.dirname(root))
+ arch = localdata.getVar('PACKAGE_ARCH', True)
+
+ 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', True), localdata.getVar('PKGR', True)))
+ bb.utils.unlockfile(lf)
+ continue
+
+ controldir = os.path.join(root, 'CONTROL')
+ bb.utils.mkdirhier(controldir)
+ try:
+ ctrlfile = open(os.path.join(controldir, 'control'), 'w')
+ except OSError:
+ bb.utils.unlockfile(lf)
+ raise bb.build.FuncFailed("unable to open control file for writing.")
+
+ fields = []
+ pe = d.getVar('PKGE', True)
+ 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', True):
+ fields.append(["Homepage: %s\n", ['HOMEPAGE']])
+
+ def pullData(l, d):
+ l2 = []
+ for i in l:
+ l2.append(d.getVar(i, True))
+ return l2
+
+ ctrlfile.write("Package: %s\n" % pkgname)
+ # check for required fields
+ try:
+ 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', True) or localdata.getVar('DESCRIPTION', True) or "."
+ ctrlfile.write('Description: %s\n' % summary)
+ description = localdata.getVar('DESCRIPTION', True) or "."
+ description = textwrap.dedent(description).strip()
+ if '\\n' in description:
+ # Manually indent
+ for t in description.split('\\n'):
+ # We don't limit the width when manually indent, but we do
+ # need the textwrap.fill() to set the initial_indent and
+ # subsequent_indent, so set a large width
+ ctrlfile.write('%s\n' % textwrap.fill(t.strip(), width=100000, initial_indent=' ', subsequent_indent=' '))
+ else:
+ # Auto indent
+ ctrlfile.write('%s\n' % textwrap.fill(description, width=74, initial_indent=' ', subsequent_indent=' '))
+ else:
+ ctrlfile.write(c % tuple(pullData(fs, localdata)))
+ except KeyError:
+ import sys
+ (type, value, traceback) = sys.exc_info()
+ ctrlfile.close()
+ bb.utils.unlockfile(lf)
+ raise bb.build.FuncFailed("Missing field for ipk generation: %s" % value)
+ # 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", True) or "")
+ debian_cmp_remap(rdepends)
+ rrecommends = bb.utils.explode_dep_versions2(localdata.getVar("RRECOMMENDS", True) or "")
+ debian_cmp_remap(rrecommends)
+ rsuggests = bb.utils.explode_dep_versions2(localdata.getVar("RSUGGESTS", True) 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", True) or ""), [])
+ debian_cmp_remap(rprovides)
+ rreplaces = bb.utils.explode_dep_versions2(localdata.getVar("RREPLACES", True) or "")
+ debian_cmp_remap(rreplaces)
+ rconflicts = bb.utils.explode_dep_versions2(localdata.getVar("RCONFLICTS", True) 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))
+ src_uri = localdata.getVar("SRC_URI", True).strip() or "None"
+ if src_uri:
+ src_uri = re.sub("\s+", " ", src_uri)
+ ctrlfile.write("Source: %s\n" % " ".join(src_uri.split()))
+ ctrlfile.close()
+
+ for script in ["preinst", "postinst", "prerm", "postrm"]:
+ scriptvar = localdata.getVar('pkg_%s' % script, True)
+ if not scriptvar:
+ continue
+ try:
+ scriptfile = open(os.path.join(controldir, script), 'w')
+ except OSError:
+ bb.utils.unlockfile(lf)
+ raise bb.build.FuncFailed("unable to open %s script file for writing." % script)
+ scriptfile.write(scriptvar)
+ scriptfile.close()
+ os.chmod(os.path.join(controldir, script), 0755)
+
+ conffiles_str = ' '.join(get_conffiles(pkg, d))
+ if conffiles_str:
+ try:
+ conffiles = open(os.path.join(controldir, 'conffiles'), 'w')
+ except OSError:
+ bb.utils.unlockfile(lf)
+ raise bb.build.FuncFailed("unable to open conffiles for writing.")
+ 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)
+ ret = subprocess.call("PATH=\"%s\" %s %s %s" % (localdata.getVar("PATH", True),
+ d.getVar("OPKGBUILDCMD",1), pkg, pkgoutdir), shell=True)
+ if ret != 0:
+ bb.utils.unlockfile(lf)
+ raise bb.build.FuncFailed("opkg-build execution failed")
+
+ if d.getVar('IPK_SIGN_PACKAGES', True) == '1':
+ ipkver = "%s-%s" % (d.getVar('PKGV', True), d.getVar('PKGR', True))
+ ipk_to_sign = "%s/%s_%s_%s.ipk" % (pkgoutdir, pkgname, ipkver, d.getVar('PACKAGE_ARCH', True))
+ sign_ipk(d, ipk_to_sign)
+
+ cleanupcontrol(root)
+ bb.utils.unlockfile(lf)
+
+}
+# Otherwise allarch packages may change depending on override configuration
+do_package_ipk[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', True)
+
+ 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', True) != '':
+ deps = ' opkg-utils-native:do_populate_sysroot virtual/fakeroot-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"
+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/import-layers/yocto-poky/meta/classes/package_rpm.bbclass b/import-layers/yocto-poky/meta/classes/package_rpm.bbclass
new file mode 100644
index 000000000..7d523a16f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/package_rpm.bbclass
@@ -0,0 +1,774 @@
+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"
+
+# Construct per file dependencies file
+def write_rpm_perfiledata(srcname, d):
+ workdir = d.getVar('WORKDIR', True)
+ packages = d.getVar('PACKAGES', True)
+ pkgd = d.getVar('PKGD', True)
+
+ 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, True) or "")
+ for dfile in dependsflist.split():
+ key = "FILE" + varname + "_" + dfile + "_" + pkg
+ depends_dict = bb.utils.explode_dep_versions(d.getVar(key, True) or "")
+ 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"
+
+ try:
+ dependsfile = open(outdepends, 'w')
+ except OSError:
+ raise bb.build.FuncFailed("unable to open spec file for writing.")
+
+ dump_filerdeps('RDEPENDS', dependsfile, d)
+
+ dependsfile.close()
+ os.chmod(outdepends, 0755)
+
+ # OE-core / RPM Provides
+ outprovides = workdir + "/" + srcname + ".provides"
+
+ try:
+ providesfile = open(outprovides, 'w')
+ except OSError:
+ raise bb.build.FuncFailed("unable to open spec file for writing.")
+
+ dump_filerdeps('RPROVIDES', providesfile, d)
+
+ providesfile.close()
+ os.chmod(outprovides, 0755)
+
+ 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', True) == '1' and bb.data.inherits_class('archiver', d):
+ spec_files_bottom.append('%%prep -n %s' % d.getVar('PN', True) )
+ 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', True) == '1' and bb.data.inherits_class('archiver', d):
+ ar_outdir = d.getVar('ARCHIVER_OUTDIR', True)
+ 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
+ # We need a simple way to remove the MLPREFIX from the package name,
+ # and dependency information...
+ def strip_multilib(name, d):
+ multilibs = d.getVar('MULTILIBS', True) or ""
+ for ext in multilibs.split():
+ eext = ext.split(':')
+ if len(eext) > 1 and eext[0] == 'multilib' and name and name.find(eext[1] + '-') >= 0:
+ name = "".join(name.split(eext[1] + '-'))
+ return name
+
+ def strip_multilib_deps(deps, d):
+ depends = bb.utils.explode_dep_versions2(deps or "")
+ newdeps = {}
+ for dep in depends:
+ newdeps[strip_multilib(dep, d)] = depends[dep]
+ return bb.utils.join_deps(newdeps)
+
+# ml = d.getVar("MLPREFIX", True)
+# if ml and name and len(ml) != 0 and name.find(ml) == 0:
+# return ml.join(name.split(ml, 1)[1:])
+# return name
+
+ # 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, True)
+ 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("%", "%%%%%%%%")
+
+ # 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("%", "%%%%%%%%")
+ # 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("%", "%%%%%%%%")
+ 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, True) or "")
+ for dfile in dependsflist.split():
+ key = "FILE" + varname + "_" + dfile + "_" + pkg
+ depends = d.getVar(key, True)
+ 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', True)
+ if not packages or packages == '':
+ bb.debug(1, "No packages; nothing to do")
+ return
+
+ pkgdest = d.getVar('PKGDEST', True)
+ if not pkgdest:
+ bb.fatal("No PKGDEST")
+
+ outspecfile = d.getVar('OUTSPECFILE', True)
+ if not outspecfile:
+ bb.fatal("No OUTSPECFILE")
+
+ # Construct the SPEC file...
+ srcname = strip_multilib(d.getVar('PN', True), d)
+ srcsummary = (d.getVar('SUMMARY', True) or d.getVar('DESCRIPTION', True) or ".")
+ srcversion = d.getVar('PKGV', True).replace('-', '+')
+ srcrelease = d.getVar('PKGR', True)
+ srcepoch = (d.getVar('PKGE', True) or "")
+ srclicense = d.getVar('LICENSE', True)
+ srcsection = d.getVar('SECTION', True)
+ srcmaintainer = d.getVar('MAINTAINER', True)
+ srchomepage = d.getVar('HOMEPAGE', True)
+ srcdescription = d.getVar('DESCRIPTION', True) or "."
+ srccustomtagschunk = get_package_additional_metadata("rpm", d)
+
+ srcdepends = strip_multilib_deps(d.getVar('DEPENDS', True), d)
+ 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", True) or "0") == "0"
+ extra_pkgdata = (d.getVar("RPM_EXTRA_PKGDATA", True) 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, True)
+ if not pkgname:
+ pkgname = pkg
+ localdata.setVar('PKG', pkgname)
+
+ localdata.setVar('OVERRIDES', d.getVar("OVERRIDES", False) + ":" + pkg)
+
+ bb.data.update_data(localdata)
+
+ conffiles = get_conffiles(pkg, d)
+ dirfiles = localdata.getVar('DIRFILES', True)
+ if dirfiles is not None:
+ dirfiles = dirfiles.split()
+
+ splitname = strip_multilib(pkgname, d)
+
+ splitsummary = (localdata.getVar('SUMMARY', True) or localdata.getVar('DESCRIPTION', True) or ".")
+ splitversion = (localdata.getVar('PKGV', True) or "").replace('-', '+')
+ splitrelease = (localdata.getVar('PKGR', True) or "")
+ splitepoch = (localdata.getVar('PKGE', True) or "")
+ splitlicense = (localdata.getVar('LICENSE', True) or "")
+ splitsection = (localdata.getVar('SECTION', True) or "")
+ splitdescription = (localdata.getVar('DESCRIPTION', True) 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 = strip_multilib_deps(localdata.getVar('RDEPENDS', True), d)
+ splitrrecommends = strip_multilib_deps(localdata.getVar('RRECOMMENDS', True), d)
+ splitrsuggests = strip_multilib_deps(localdata.getVar('RSUGGESTS', True), d)
+ splitrprovides = strip_multilib_deps(localdata.getVar('RPROVIDES', True), d)
+ splitrreplaces = strip_multilib_deps(localdata.getVar('RREPLACES', True), d)
+ splitrconflicts = strip_multilib_deps(localdata.getVar('RCONFLICTS', True), d)
+ splitrobsoletes = []
+
+ splitrpreinst = localdata.getVar('pkg_preinst', True)
+ splitrpostinst = localdata.getVar('pkg_postinst', True)
+ splitrprerm = localdata.getVar('pkg_prerm', True)
+ splitrpostrm = localdata.getVar('pkg_postrm', True)
+
+
+ if not perfiledeps:
+ # Add in summary of per file dependencies
+ splitrdepends = splitrdepends + " " + get_perfile('RDEPENDS', pkg, d)
+ splitrprovides = splitrprovides + " " + get_perfile('RPROVIDES', pkg, d)
+
+ # Gather special src/first package data
+ if srcname == splitname:
+ 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)
+ if srclicense != splitlicense:
+ 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)
+
+ # Suggests in RPM are like recommends in OE-core!
+ print_deps(splitrrecommends, "Suggests", spec_preamble_bottom, d)
+ # While there is no analog for suggests... (So call them recommends for now)
+ print_deps(splitrsuggests, "Recommends", spec_preamble_bottom, d)
+ print_deps(splitrprovides, "Provides", spec_preamble_bottom, d)
+ print_deps(splitrobsoletes, "Obsoletes", spec_preamble_bottom, d)
+
+ # conflicts can not be in a provide! We will need to filter it.
+ if splitrconflicts:
+ depends_dict = bb.utils.explode_dep_versions2(splitrconflicts)
+ newdeps_dict = {}
+ for dep in depends_dict:
+ if dep not in splitrprovides:
+ newdeps_dict[dep] = depends_dict[dep]
+ if newdeps_dict:
+ splitrconflicts = bb.utils.join_deps(newdeps_dict)
+ else:
+ splitrconflicts = ""
+
+ 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)
+
+ # Suggests in RPM are like recommends in OE-core!
+ print_deps(srcrrecommends, "Suggests", spec_preamble_top, d)
+ # While there is no analog for suggests... (So call them recommends for now)
+ print_deps(srcrsuggests, "Recommends", spec_preamble_top, d)
+ print_deps(srcrprovides, "Provides", spec_preamble_top, d)
+ print_deps(srcrobsoletes, "Obsoletes", spec_preamble_top, d)
+
+ # conflicts can not be in a provide! We will need to filter it.
+ if srcrconflicts:
+ depends_dict = bb.utils.explode_dep_versions2(srcrconflicts)
+ newdeps_dict = {}
+ for dep in depends_dict:
+ if dep not in srcrprovides:
+ newdeps_dict[dep] = depends_dict[dep]
+ if newdeps_dict:
+ srcrconflicts = bb.utils.join_deps(newdeps_dict)
+ else:
+ srcrconflicts = ""
+
+ 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
+ try:
+ specfile = open(outspecfile, 'w')
+ except OSError:
+ raise bb.build.FuncFailed("unable to open spec file for writing.")
+
+ # RPMSPEC_PREAMBLE is a way to add arbitrary text to the top
+ # of the generated spec file
+ external_preamble = d.getVar("RPMSPEC_PREAMBLE", True)
+ 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 () {
+ # We need a simple way to remove the MLPREFIX from the package name,
+ # and dependency information...
+ def strip_multilib(name, d):
+ ml = d.getVar("MLPREFIX", True)
+ if ml and name and len(ml) != 0 and name.find(ml) >= 0:
+ return "".join(name.split(ml))
+ return name
+
+ workdir = d.getVar('WORKDIR', True)
+ tmpdir = d.getVar('TMPDIR', True)
+ pkgd = d.getVar('PKGD', True)
+ pkgdest = d.getVar('PKGDEST', True)
+ if not workdir or not pkgd or not tmpdir:
+ bb.error("Variables incorrectly set, unable to package")
+ return
+
+ packages = d.getVar('PACKAGES', True)
+ 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 = strip_multilib(d.getVar('PN', True), d)
+ 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", True) or "0") == "0"
+ if perfiledeps:
+ outdepends, outprovides = write_rpm_perfiledata(srcname, d)
+
+ # Setup the rpmbuild arguments...
+ rpmbuild = d.getVar('RPMBUILD', True)
+ targetsys = d.getVar('TARGET_SYS', True)
+ targetvendor = d.getVar('HOST_VENDOR', True)
+ package_arch = (d.getVar('PACKAGE_ARCH', True) or "").replace("-", "_")
+ sdkpkgsuffix = (d.getVar('SDKPKGSUFFIX', True) or "nativesdk").replace("-", "_")
+ if package_arch not in "all any noarch".split() and not package_arch.endswith(sdkpkgsuffix):
+ ml_prefix = (d.getVar('MLPREFIX', True) or "").replace("-", "_")
+ d.setVar('PACKAGE_ARCH_EXTEND', ml_prefix + package_arch)
+ else:
+ 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', True))
+ pkgarch = d.expand('${PACKAGE_ARCH_EXTEND}${HOST_VENDOR}-${HOST_OS}')
+ magicfile = d.expand('${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc')
+ bb.utils.mkdirhier(pkgwritedir)
+ os.chmod(pkgwritedir, 0755)
+
+ cmd = rpmbuild
+ cmd = cmd + " --nodeps --short-circuit --target " + pkgarch + " --buildroot " + pkgd
+ cmd = cmd + " --define '_topdir " + workdir + "' --define '_rpmdir " + pkgwritedir + "'"
+ cmd = cmd + " --define '_builddir " + d.getVar('S', True) + "'"
+ cmd = cmd + " --define '_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm'"
+ cmd = cmd + " --define '_use_internal_dependency_generator 0'"
+ 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 '_rpmfc_magic_path " + magicfile + "'"
+ cmd = cmd + " --define '_tmppath " + workdir + "'"
+ if d.getVarFlag('ARCHIVER_MODE', 'srpm', True) == '1' and bb.data.inherits_class('archiver', d):
+ cmd = cmd + " --define '_sourcedir " + d.getVar('ARCHIVER_OUTDIR', True) + "'"
+ cmdsrpm = cmd + " --define '_srcrpmdir " + d.getVar('ARCHIVER_OUTDIR', True) + "'"
+ 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
+
+ # Build the rpm package!
+ d.setVar('BUILDSPEC', cmd + "\n")
+ d.setVarFlag('BUILDSPEC', 'func', '1')
+ bb.build.exec_func('BUILDSPEC', d)
+
+ if d.getVar('RPM_SIGN_PACKAGES', True) == '1':
+ bb.build.exec_func("sign_rpm", d)
+}
+
+python () {
+ if d.getVar('PACKAGES', True) != '':
+ 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"
+addtask package_write_rpm after do_packagedata do_package
+
+PACKAGEINDEXDEPS += "rpm-native:do_populate_sysroot"
+PACKAGEINDEXDEPS += "createrepo-native:do_populate_sysroot"
+
+do_build[recrdeptask] += "do_package_write_rpm"
diff --git a/import-layers/yocto-poky/meta/classes/package_tar.bbclass b/import-layers/yocto-poky/meta/classes/package_tar.bbclass
new file mode 100644
index 000000000..854e64528
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/package_tar.bbclass
@@ -0,0 +1,69 @@
+inherit package
+
+IMAGE_PKGTYPE ?= "tar"
+
+python do_package_tar () {
+ import subprocess
+ workdir = d.getVar('WORKDIR', True)
+ if not workdir:
+ bb.error("WORKDIR not defined, unable to package")
+ return
+
+ outdir = d.getVar('DEPLOY_DIR_TAR', True)
+ if not outdir:
+ bb.error("DEPLOY_DIR_TAR not defined, unable to package")
+ return
+
+ dvar = d.getVar('D', True)
+ if not dvar:
+ bb.error("D not defined, unable to package")
+ return
+
+ packages = d.getVar('PACKAGES', True)
+ if not packages:
+ bb.debug(1, "PACKAGES not defined, nothing to package")
+ return
+
+ pkgdest = d.getVar('PKGDEST', True)
+
+ 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.data.update_data(localdata)
+
+ 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', True), localdata.getVar('PKGR', True)))
+ 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)
+}
+
+python () {
+ if d.getVar('PACKAGES', True) != '':
+ deps = (d.getVarFlag('do_package_write_tar', 'depends', True) 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/import-layers/yocto-poky/meta/classes/packagedata.bbclass b/import-layers/yocto-poky/meta/classes/packagedata.bbclass
new file mode 100644
index 000000000..3397f1e36
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/packagedata.bbclass
@@ -0,0 +1,34 @@
+python read_subpackage_metadata () {
+ import oe.packagedata
+
+ vars = {
+ "PN" : d.getVar('PN', True),
+ "PE" : d.getVar('PE', True),
+ "PV" : d.getVar('PV', True),
+ "PR" : d.getVar('PR', True),
+ }
+
+ data = oe.packagedata.read_pkgdata(vars["PN"], d)
+
+ for key in data.keys():
+ d.setVar(key, data[key])
+
+ for pkg in d.getVar('PACKAGES', True).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/import-layers/yocto-poky/meta/classes/packagegroup.bbclass b/import-layers/yocto-poky/meta/classes/packagegroup.bbclass
new file mode 100644
index 000000000..38bdbd382
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/packagegroup.bbclass
@@ -0,0 +1,54 @@
+# 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}"
+
+inherit ${@oe.utils.ifelse(d.getVar('PACKAGE_ARCH_EXPANDED', True) == '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', True).split()
+ if d.getVar('PACKAGEGROUP_DISABLE_COMPLEMENTARY', True) != '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
+do_fetch[noexec] = "1"
+do_unpack[noexec] = "1"
+do_patch[noexec] = "1"
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+do_install[noexec] = "1"
+do_populate_sysroot[noexec] = "1"
+
+python () {
+ initman = d.getVar("VIRTUAL-RUNTIME_init_manager", True)
+ 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)
+}
+
diff --git a/import-layers/yocto-poky/meta/classes/patch.bbclass b/import-layers/yocto-poky/meta/classes/patch.bbclass
new file mode 100644
index 000000000..3d22ad838
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/patch.bbclass
@@ -0,0 +1,187 @@
+# 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"
+
+inherit terminal
+
+def src_patches(d, all = False ):
+ workdir = d.getVar('WORKDIR', True)
+ fetch = bb.fetch2.Fetch([], d)
+ patches = []
+ sources = []
+ for url in fetch.urls:
+ local = patch_path(url, fetch, workdir)
+ 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 patch_path(url, fetch, workdir):
+ """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', '.Z'):
+ 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 should_apply(parm, d):
+ """Determine if we should apply the given patch"""
+
+ if "mindate" in parm or "maxdate" in parm:
+ pn = d.getVar('PN', True)
+ srcdate = d.getVar('SRCDATE_%s' % pn, True)
+ if not srcdate:
+ srcdate = d.getVar('SRCDATE', True)
+
+ if srcdate == "now":
+ srcdate = d.getVar('DATE', True)
+
+ 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', True)
+ if srcrev and srcrev < parm["minrev"]:
+ return False, 'applies to later revisions'
+
+ if "maxrev" in parm:
+ srcrev = d.getVar('SRCREV', True)
+ if srcrev and srcrev > parm["maxrev"]:
+ return False, 'applies to earlier revisions'
+
+ if "rev" in parm:
+ srcrev = d.getVar('SRCREV', True)
+ if srcrev and parm["rev"] not in srcrev:
+ return False, "doesn't apply to revision"
+
+ if "notrev" in parm:
+ srcrev = d.getVar('SRCREV', True)
+ if srcrev and parm["notrev"] in srcrev:
+ return False, "doesn't apply to revision"
+
+ return True, None
+
+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', True) or 'quilt']
+
+ resolvermap = {
+ "noop": oe.patch.NOOPResolver,
+ "user": oe.patch.UserResolver,
+ }
+
+ rcls = resolvermap[d.getVar('PATCHRESOLVE', True) or 'user']
+
+ classes = {}
+
+ s = d.getVar('S', True)
+
+ os.putenv('PATH', d.getVar('PATH', True))
+
+ # 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/import-layers/yocto-poky/meta/classes/perlnative.bbclass b/import-layers/yocto-poky/meta/classes/perlnative.bbclass
new file mode 100644
index 000000000..cc8de8b38
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/classes/pixbufcache.bbclass b/import-layers/yocto-poky/meta/classes/pixbufcache.bbclass
new file mode 100644
index 000000000..dbe11e12d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/pixbufcache.bbclass
@@ -0,0 +1,67 @@
+#
+# This class will generate the proper postinst/postrm scriptlets for pixbuf
+# packages.
+#
+
+DEPENDS += "qemu-native"
+inherit qemu
+
+PIXBUF_PACKAGES ??= "${PN}"
+
+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', True).split()
+
+ for pkg in pixbuf_pkgs:
+ bb.note("adding pixbuf postinst and postrm scripts to %s" % pkg)
+ postinst = d.getVar('pkg_postinst_%s' % pkg, True) or d.getVar('pkg_postinst', True)
+ if not postinst:
+ postinst = '#!/bin/sh\n'
+ postinst += d.getVar('pixbufcache_common', True)
+ d.setVar('pkg_postinst_%s' % pkg, postinst)
+
+ postrm = d.getVar('pkg_postrm_%s' % pkg, True) or d.getVar('pkg_postrm', True)
+ if not postrm:
+ postrm = '#!/bin/sh\n'
+ postrm += d.getVar('pixbufcache_common', True)
+ 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
+}
+
+#
+# Add an sstate postinst hook to update the cache for native packages.
+# An error exit during populate_sysroot_setscene allows bitbake to
+# try to recover by re-building the package.
+#
+SSTATEPOSTINSTFUNCS_append_class-native = " pixbufcache_sstate_postinst"
+
+# See base.bbclass for the other half of this
+pixbufcache_sstate_postinst() {
+ if [ "${BB_CURRENTTASK}" = "populate_sysroot" ]; then
+ ${gdkpixbuf_complete}
+ elif [ "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]; then
+ echo "${gdkpixbuf_complete}" >> ${STAGING_DIR}/sstatecompletions
+ fi
+}
+
diff --git a/import-layers/yocto-poky/meta/classes/pkgconfig.bbclass b/import-layers/yocto-poky/meta/classes/pkgconfig.bbclass
new file mode 100644
index 000000000..ad1f84f50
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/pkgconfig.bbclass
@@ -0,0 +1,2 @@
+DEPENDS_prepend = "pkgconfig-native "
+
diff --git a/import-layers/yocto-poky/meta/classes/populate_sdk.bbclass b/import-layers/yocto-poky/meta/classes/populate_sdk.bbclass
new file mode 100644
index 000000000..f64a911b7
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/classes/populate_sdk_base.bbclass b/import-layers/yocto-poky/meta/classes/populate_sdk_base.bbclass
new file mode 100644
index 000000000..008bb577c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/populate_sdk_base.bbclass
@@ -0,0 +1,267 @@
+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, True) 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"
+SDKIMAGE_INSTALL_COMPLEMENTARY = '${@complementary_globs("SDKIMAGE_FEATURES", d)}'
+
+inherit rootfs_${IMAGE_PKGTYPE}
+
+SDK_DIR = "${WORKDIR}/sdk"
+SDK_OUTPUT = "${SDK_DIR}/image"
+SDK_DEPLOY = "${DEPLOY_DIR}/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, 'packagegroup-core-standalone-sdk-target-dbg')} \
+ "
+TOOLCHAIN_TARGET_TASK_ATTEMPTONLY ?= ""
+TOOLCHAIN_OUTPUTNAME ?= "${SDK_NAME}-toolchain-${SDK_VERSION}"
+
+SDK_RDEPENDS = "${TOOLCHAIN_TARGET_TASK} ${TOOLCHAIN_HOST_TASK}"
+SDK_DEPENDS = "virtual/fakeroot-native pixz-native"
+
+# 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', True)}_sdk"
+SDK_TITLE ?= "${@d.getVar('DISTRO_NAME', True) or d.getVar('DISTRO', True)} SDK"
+
+SDK_TARGET_MANIFEST = "${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.target.manifest"
+SDK_HOST_MANIFEST = "${SDK_DEPLOY}/${TOOLCHAIN_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", True))
+ pkgs = sdk_list_installed_packages(d, True)
+ if not os.path.exists(sdkmanifestdir):
+ bb.utils.mkdirhier(sdkmanifestdir)
+ with open(d.getVar('SDK_TARGET_MANIFEST', True), 'w') as output:
+ output.write(format_pkg_list(pkgs, 'ver'))
+}
+
+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", True))
+ pkgs = sdk_list_installed_packages(d, False)
+ if not os.path.exists(sdkmanifestdir):
+ bb.utils.mkdirhier(sdkmanifestdir)
+ with open(d.getVar('SDK_HOST_MANIFEST', True), 'w') as output:
+ output.write(format_pkg_list(pkgs, 'ver'))
+}
+
+POPULATE_SDK_POST_TARGET_COMMAND_append = " write_target_sdk_manifest ; "
+POPULATE_SDK_POST_HOST_COMMAND_append = " 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} "
+
+# Some archs override this, we need the nativesdk version
+# turns out this is hard to get from the datastore due to TRANSLATED_TARGET_ARCH
+# manipulation.
+SDK_OLDEST_KERNEL = "2.6.32"
+
+fakeroot python do_populate_sdk() {
+ from oe.sdk import populate_sdk
+ from oe.manifest import create_manifest, Manifest
+
+ pn = d.getVar('PN', True)
+ 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", True))
+ d.setVar("TOOLCHAIN_HOST_TASK_ATTEMPTONLY", ld.getVar("TOOLCHAIN_HOST_TASK_ATTEMPTONLY", True))
+
+ # create target/host SDK manifests
+ create_manifest(d, manifest_dir=d.getVar('SDK_DIR', True),
+ manifest_type=Manifest.MANIFEST_TYPE_SDK_HOST)
+ create_manifest(d, manifest_dir=d.getVar('SDK_DIR', True),
+ manifest_type=Manifest.MANIFEST_TYPE_SDK_TARGET)
+
+ populate_sdk(d)
+}
+
+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', True) != '1':
+ # disabled, bail out
+ return
+
+ def norm_path(path):
+ return os.path.abspath(path)
+
+ # Get scan root
+ SCAN_ROOT = norm_path("${SDK_OUTPUT}/${SDKPATH}/sysroots/")
+
+ 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 ${SDK_DEPLOY}
+ cd ${SDK_OUTPUT}/${SDKPATH}
+ tar ${SDKTAROPTS} -cf - . | pixz > ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.xz
+}
+
+fakeroot create_shar() {
+ # copy in the template shar extractor script
+ cp ${COREBASE}/meta/files/toolchain-shar-extract.sh ${SDK_DEPLOY}/${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' \
+ ${SDK_DEPLOY}/${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@#${SDK_TITLE}#g' \
+ -e 's#@SDK_VERSION@#${SDK_VERSION}#g' \
+ -e '/@SDK_PRE_INSTALL_COMMAND@/d' \
+ -e '/@SDK_POST_INSTALL_COMMAND@/d' \
+ ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh
+
+ # add execution permission
+ chmod +x ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh
+
+ # append the SDK tarball
+ cat ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.xz >> ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh
+
+ # delete the old tarball, we don't need it anymore
+ rm ${SDK_DEPLOY}/${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 test -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_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']
+ 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', True).split()])} ${@d.getVarFlag('do_rootfs', 'depends', False)}"
+do_populate_sdk[rdepends] = "${@' '.join([x + ':do_populate_sysroot' for x in d.getVar('SDK_RDEPENDS', True).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/import-layers/yocto-poky/meta/classes/populate_sdk_ext.bbclass b/import-layers/yocto-poky/meta/classes/populate_sdk_ext.bbclass
new file mode 100644
index 000000000..87518d176
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/populate_sdk_ext.bbclass
@@ -0,0 +1,487 @@
+# 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_RDEPENDS_append_task-populate-sdk-ext = " ${SDK_TARGETS}"
+
+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_RECRDEP_TASKS ?= ""
+
+SDK_LOCAL_CONF_WHITELIST ?= ""
+SDK_LOCAL_CONF_BLACKLIST ?= "CONF_VERSION \
+ BB_NUMBER_THREADS \
+ PARALLEL_MAKE \
+ PRSERV_HOST \
+ SSTATE_MIRRORS \
+ "
+SDK_INHERIT_BLACKLIST ?= "buildhistory icecc"
+SDK_UPDATE_URL ?= ""
+
+SDK_TARGETS ?= "${PN}"
+
+def get_sdk_install_targets(d):
+ sdk_install_targets = ''
+ if d.getVar('SDK_EXT_TYPE', True) != 'minimal':
+ sdk_install_targets = d.getVar('SDK_TARGETS', True)
+
+ depd = d.getVar('BB_TASKDEPDATA', False)
+ for v in depd.itervalues():
+ if v[1] == 'do_image_complete':
+ if v[0] not in sdk_install_targets:
+ sdk_install_targets += ' {}'.format(v[0])
+
+ if d.getVar('SDK_INCLUDE_PKGDATA', True) == '1':
+ sdk_install_targets += ' meta-world-pkgdata:do_allpackagedata'
+
+ 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 \
+ oe-init-build-env-memres \
+ 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"
+
+SDK_TITLE_task-populate-sdk-ext = "${@d.getVar('DISTRO_NAME', True) or d.getVar('DISTRO', True)} Extensible SDK"
+
+python copy_buildsystem () {
+ import re
+ import shutil
+ import glob
+ import oe.copy_buildsystem
+
+ oe_init_env_script = d.getVar('OE_INIT_ENV_SCRIPT', True)
+
+ 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', True) + '/' + d.getVar('SDKPATH', True)
+
+ # Determine if we're building a derivative extensible SDK (from devtool build-sdk)
+ derivative = (d.getVar('SDK_DERIVATIVE', True) 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', True))
+ 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', True))
+ updateurl = d.getVar('SDK_UPDATE_URL', True)
+ 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', True)
+ 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')
+
+ env_whitelist = (d.getVar('BB_ENV_EXTRAWHITE', True) or '').split()
+ env_whitelist_values = {}
+
+ # Create local.conf
+ builddir = d.getVar('TOPDIR', True)
+ if derivative:
+ shutil.copyfile(builddir + '/conf/local.conf', baseoutpath + '/conf/local.conf')
+ else:
+ local_conf_whitelist = (d.getVar('SDK_LOCAL_CONF_WHITELIST', True) or '').split()
+ local_conf_blacklist = (d.getVar('SDK_LOCAL_CONF_BLACKLIST', True) 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 = ['[^#=+ ]*']
+ 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('INHERIT += "%s"\n\n' % 'uninative')
+ 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')
+
+ # Error if the sigs in the locked-signature file don't match
+ # the sig computed from the metadata.
+ f.write('SIGGEN_LOCKEDSIGS_TASKSIG_CHECK = "error"\n\n')
+
+ # Hide the config information from bitbake output (since it's fixed within the SDK)
+ f.write('BUILDCFG_HEADER = ""\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', True) 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')
+
+ if os.path.exists(builddir + '/conf/auto.conf'):
+ if derivative:
+ shutil.copyfile(builddir + '/conf/auto.conf', baseoutpath + '/conf/auto.conf')
+ else:
+ with open(builddir + '/conf/auto.conf', 'r') as f:
+ oldlines = f.readlines()
+ (updated, newlines) = bb.utils.edit_metadata(oldlines, varlist, handle_var)
+ with open(baseoutpath + '/conf/auto.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)
+
+ # 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.iteritems():
+ actualvalue = d.getVar(name, True) 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 = d.getVar('SDK_TARGETS', True)
+ sigfile = d.getVar('WORKDIR', True) + '/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'
+ fixedlsbstring = 'universal'
+
+ # Add packagedata if enabled
+ if d.getVar('SDK_INCLUDE_PKGDATA', True) == '1':
+ lockedsigs_base = d.getVar('WORKDIR', True) + '/locked-sigs-base.inc'
+ lockedsigs_copy = d.getVar('WORKDIR', True) + '/locked-sigs-copy.inc'
+ shutil.move(lockedsigs_pruned, lockedsigs_base)
+ oe.copy_buildsystem.merge_lockedsigs(['do_packagedata'],
+ lockedsigs_base,
+ d.getVar('STAGING_DIR_HOST', True) + '/world-pkgdata/locked-sigs-pkgdata.inc',
+ lockedsigs_pruned,
+ lockedsigs_copy)
+
+ if d.getVar('SDK_EXT_TYPE', True) == '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', True) + '/conf/locked-sigs.inc'
+ if os.path.exists(lockedsigs_orig):
+ lockedsigs_extra = d.getVar('WORKDIR', True) + '/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', True),
+ sstate_out, d,
+ fixedlsbstring)
+ else:
+ oe.copy_buildsystem.create_locked_sstate_cache(lockedsigs_pruned,
+ d.getVar('SSTATE_DIR', True),
+ sstate_out, d,
+ fixedlsbstring)
+
+ # 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 extsdk_get_buildtools_filename(d):
+ return '*-buildtools-nativesdk-standalone-*.sh'
+
+install_tools() {
+ install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}${bindir_nativesdk}
+ lnr ${SDK_OUTPUT}/${SDKPATH}/${scriptrelpath}/devtool ${SDK_OUTPUT}/${SDKPATHNATIVE}${bindir_nativesdk}/devtool
+ lnr ${SDK_OUTPUT}/${SDKPATH}/${scriptrelpath}/recipetool ${SDK_OUTPUT}/${SDKPATHNATIVE}${bindir_nativesdk}/recipetool
+ touch ${SDK_OUTPUT}/${SDKPATH}/.devtoolbase
+
+ localconf=${SDK_OUTPUT}/${SDKPATH}/conf/local.conf
+
+ # find latest buildtools-tarball and install it
+ buildtools_path=`ls -t1 ${SDK_DEPLOY}/${@extsdk_get_buildtools_filename(d)} | head -n1`
+ install $buildtools_path ${SDK_OUTPUT}/${SDKPATH}
+
+ # For now this is where uninative.bbclass expects the tarball
+ chksum=`sha256sum ${SDK_DEPLOY}/${BUILD_ARCH}-nativesdk-libc.tar.bz2 | cut -f 1 -d ' '`
+ install -d ${SDK_OUTPUT}/${SDKPATH}/downloads/uninative/$chksum/
+ install ${SDK_DEPLOY}/${BUILD_ARCH}-nativesdk-libc.tar.bz2 ${SDK_OUTPUT}/${SDKPATH}/downloads/uninative/$chksum/
+ echo "UNINATIVE_CHECKSUM[${BUILD_ARCH}] = '$chksum'" >> ${SDK_OUTPUT}/${SDKPATH}/conf/local.conf
+
+ 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"
+
+# Since bitbake won't run as root it doesn't make sense to try and install
+# the extensible sdk as root.
+sdk_ext_preinst() {
+ if [ "`id -u`" = "0" ]; then
+ echo "ERROR: The extensible sdk cannot be installed as root."
+ 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
+ printf "buildtools\ny" | ./*buildtools-nativesdk-standalone* > /dev/null || ( printf 'ERROR: buildtools installation failed\n' ; exit 1 )
+
+ # Delete the buildtools tar file since it won't be used again
+ rm ./*buildtools-nativesdk-standalone*.sh -f
+
+ # Make sure when the user sets up the environment, they also get
+ # the buildtools-tarball tools in their path.
+ env_setup_script="$target_sdk_dir/environment-setup-${REAL_MULTIMACH_TARGET_SYS}"
+ 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
+
+ # 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 '${SDK_INSTALL_TARGETS}' >> $LOGFILE 2>&1" || { echo "ERROR: SDK preparation failed: see $LOGFILE"; 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', True) != d.getVar('BUILD_ARCH', True):
+ 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', True), d.getVar('BUILD_ARCH', True)))
+
+ d.setVar('SDK_INSTALL_TARGETS', get_sdk_install_targets(d))
+
+ bb.build.exec_func("do_populate_sdk", d)
+}
+
+def get_ext_sdk_depends(d):
+ return d.getVarFlag('do_rootfs', 'depends', True) + ' ' + d.getVarFlag('do_build', 'depends', True)
+
+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', True) + '/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)}"
+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')
+ bb.data.update_data(localdata)
+ return localdata.getVarFlag('do_populate_sdk', 'rdepends', True)
+
+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 uninative-tarball:do_populate_sdk \
+ ${@'meta-world-pkgdata:do_collect_packagedata' if d.getVar('SDK_INCLUDE_PKGDATA', True) == '1' else ''}"
+
+do_populate_sdk_ext[rdepends] += "${@' '.join([x + ':do_build' for x in d.getVar('SDK_TARGETS', True).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"
+
+addtask populate_sdk_ext after do_sdk_depends
diff --git a/import-layers/yocto-poky/meta/classes/prexport.bbclass b/import-layers/yocto-poky/meta/classes/prexport.bbclass
new file mode 100644
index 000000000..809ec1034
--- /dev/null
+++ b/import-layers/yocto-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', True)
+ 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', True))
+ 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/import-layers/yocto-poky/meta/classes/primport.bbclass b/import-layers/yocto-poky/meta/classes/primport.bbclass
new file mode 100644
index 000000000..8ed45f03f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/classes/ptest-gnome.bbclass b/import-layers/yocto-poky/meta/classes/ptest-gnome.bbclass
new file mode 100644
index 000000000..478a33474
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/classes/ptest.bbclass b/import-layers/yocto-poky/meta/classes/ptest.bbclass
new file mode 100644
index 000000000..fa3561e62
--- /dev/null
+++ b/import-layers/yocto-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}/${PN}/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', True) == "1"):
+ for i in ['do_configure_ptest_base', 'do_compile_ptest_base', 'do_install_ptest_base']:
+ bb.build.deltask(i, d)
+}
diff --git a/import-layers/yocto-poky/meta/classes/python-dir.bbclass b/import-layers/yocto-poky/meta/classes/python-dir.bbclass
new file mode 100644
index 000000000..ebfa4b30f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/python-dir.bbclass
@@ -0,0 +1,5 @@
+PYTHON_BASEVERSION ?= "2.7"
+PYTHON_ABI ?= ""
+PYTHON_DIR = "python${PYTHON_BASEVERSION}"
+PYTHON_PN = "python${@'' if '${PYTHON_BASEVERSION}'.startswith('2') else '3'}"
+PYTHON_SITEPACKAGES_DIR = "${libdir}/${PYTHON_DIR}/site-packages"
diff --git a/import-layers/yocto-poky/meta/classes/python3native.bbclass b/import-layers/yocto-poky/meta/classes/python3native.bbclass
new file mode 100644
index 000000000..8ec6b769d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/python3native.bbclass
@@ -0,0 +1,7 @@
+PYTHON_BASEVERSION = "3.5"
+
+inherit python-dir
+
+PYTHON="${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN}"
+EXTRANATIVEPATH += "${PYTHON_PN}-native"
+DEPENDS += " ${PYTHON_PN}-native "
diff --git a/import-layers/yocto-poky/meta/classes/pythonnative.bbclass b/import-layers/yocto-poky/meta/classes/pythonnative.bbclass
new file mode 100644
index 000000000..97029dc52
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/pythonnative.bbclass
@@ -0,0 +1,8 @@
+
+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 += " ${PYTHON_PN}-native "
diff --git a/import-layers/yocto-poky/meta/classes/qemu.bbclass b/import-layers/yocto-poky/meta/classes/qemu.bbclass
new file mode 100644
index 000000000..75739dbbf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/qemu.bbclass
@@ -0,0 +1,59 @@
+#
+# This class contains functions for recipes that need QEMU or test for its
+# existence.
+#
+
+def qemu_target_binary(data):
+ target_arch = data.getVar("TARGET_ARCH", True)
+ 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", True)
+
+ 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', True), True) 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/import-layers/yocto-poky/meta/classes/recipe_sanity.bbclass b/import-layers/yocto-poky/meta/classes/recipe_sanity.bbclass
new file mode 100644
index 000000000..295611f0f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/recipe_sanity.bbclass
@@ -0,0 +1,166 @@
+def __note(msg, d):
+ bb.note("%s: recipe_sanity: %s" % (d.getVar("P", True), 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", True).split():
+ val = d.getVar(var, 0)
+ 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", True).split():
+ if not d.getVar(var, 0):
+ __note("%s should be set" % var, d)
+
+ for var in d.getVar("__recipe_sanity_reqdiffvars", True).split():
+ val = d.getVar(var, 0)
+ 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", 0)
+ 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", True):
+ return True
+
+def can_use_autotools_base(cfgdata, d):
+ cfg = d.getVar("do_configure", True)
+ 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", 0):
+ (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", 0)
+ filespath = d.getVar("FILESPATH", True).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_FILESDIR(cfgdata, d):
+ expected = cfgdata.get("FILESDIR")
+ #expected = "${@bb.utils.which(d.getVar('FILESPATH', True), '.')}"
+ unexpanded = d.getVar("FILESDIR", 0)
+ if unexpanded is None:
+ return False
+
+ expanded = os.path.normpath(d.getVar("FILESDIR", True))
+ filespath = d.getVar("FILESPATH", True).split(":")
+ filespath = [os.path.normpath(f) for f in filespath if os.path.exists(f)]
+
+ return unexpanded != expected and \
+ os.path.exists(expanded) and \
+ (expanded in filespath or
+ expanded == d.expand(expected))
+
+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, 0)
+ cfgunexpanded = cfgdata.get(k)
+ if not cfgunexpanded:
+ continue
+
+ try:
+ expanded = d.getVar(k, True)
+ 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", True)
+ p = "%s %s %s" % (d.getVar("PN", True), d.getVar("PV", True), d.getVar("PR", True))
+
+ sanitychecks = [
+ (can_delete_FILESDIR, "candidate for removal of FILESDIR"),
+ (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", 0)
+
+ 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, 0), bb.data_smart.DataSmart):
+ cfgdata[k] = d.getVar(k, 0)
+
+ 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/import-layers/yocto-poky/meta/classes/relocatable.bbclass b/import-layers/yocto-poky/meta/classes/relocatable.bbclass
new file mode 100644
index 000000000..4ca9981f4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/relocatable.bbclass
@@ -0,0 +1,7 @@
+inherit chrpath
+
+SYSROOT_PREPROCESS_FUNCS += "relocatable_binaries_preprocess"
+
+python relocatable_binaries_preprocess() {
+ rpath_replace(d.expand('${SYSROOT_DESTDIR}'), d)
+}
diff --git a/import-layers/yocto-poky/meta/classes/remove-libtool.bbclass b/import-layers/yocto-poky/meta/classes/remove-libtool.bbclass
new file mode 100644
index 000000000..3fd0cd58f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/classes/report-error.bbclass b/import-layers/yocto-poky/meta/classes/report-error.bbclass
new file mode 100644
index 000000000..82b5bcd69
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/report-error.bbclass
@@ -0,0 +1,95 @@
+#
+# 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', True)
+ 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', True)
+ 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
+
+ logpath = e.data.getVar('ERR_REPORT_DIR', True)
+ datafile = os.path.join(logpath, "error-report.txt")
+
+ if isinstance(e, bb.event.BuildStarted):
+ bb.utils.mkdirhier(logpath)
+ data = {}
+ machine = e.data.getVar("MACHINE", True)
+ data['machine'] = machine
+ data['build_sys'] = e.data.getVar("BUILD_SYS", True)
+ data['nativelsb'] = e.data.getVar("NATIVELSBSTRING", True)
+ data['distro'] = e.data.getVar("DISTRO", True)
+ data['target_sys'] = e.data.getVar("TARGET_SYS", True)
+ data['failures'] = []
+ data['component'] = e.getPkgs()[0]
+ data['branch_commit'] = base_detect_branch(e.data) + ": " + 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', True)
+ taskdata['package'] = e.data.expand("${PF}")
+ taskdata['task'] = task
+ if log:
+ try:
+ logFile = codecs.open(log, 'r', 'utf-8')
+ logdata = logFile.read()
+ 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", True)+".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/import-layers/yocto-poky/meta/classes/rm_work.bbclass b/import-layers/yocto-poky/meta/classes/rm_work.bbclass
new file mode 100644
index 000000000..c647d88d2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/rm_work.bbclass
@@ -0,0 +1,128 @@
+#
+# 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"
+#
+
+# Use the completion scheduler by default when rm_work is active
+# to try and reduce disk usage
+BB_SCHEDULER ?= "completion"
+
+RMWORK_ORIG_TASK := "${BB_DEFAULT_TASK}"
+BB_DEFAULT_TASK = "rm_work_all"
+
+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
+
+ 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 [ $dir != 'temp' ]; then
+ rm -rf $dir
+ 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/
+
+ # 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*)
+ i=dummy
+ break
+ ;;
+ *do_package_write*)
+ i=dummy
+ break
+ ;;
+ *do_rootfs*)
+ i=dummy
+ break
+ ;;
+ *do_image*)
+ i=dummy
+ break
+ ;;
+ *do_build*)
+ 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
+}
+addtask rm_work after do_${RMWORK_ORIG_TASK}
+
+do_rm_work_all () {
+ :
+}
+do_rm_work_all[recrdeptask] = "do_rm_work"
+addtask rm_work_all after do_rm_work
+
+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"
+
+python () {
+ # If the recipe name is in the RM_WORK_EXCLUDE, skip the recipe.
+ excludes = (d.getVar("RM_WORK_EXCLUDE", True) or "").split()
+ pn = d.getVar("PN", True)
+ if pn in excludes:
+ d.delVarFlag('rm_work_rootfs', 'cleandirs')
+ d.delVarFlag('rm_work_populatesdk', 'cleandirs')
+}
diff --git a/import-layers/yocto-poky/meta/classes/rootfs-postcommands.bbclass b/import-layers/yocto-poky/meta/classes/rootfs-postcommands.bbclass
new file mode 100644
index 000000000..95d28afa3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/rootfs-postcommands.bbclass
@@ -0,0 +1,277 @@
+
+# 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)}'
+
+# Write manifest
+IMAGE_MANIFEST = "${DEPLOY_DIR_IMAGE}/${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; ", "", 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}"
+
+
+
+#
+# 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
+ sed -i -e '/^[#[:space:]]*\/dev\/root/{s/defaults/ro/;s/\([[:space:]]*[[:digit:]]\)\([[:space:]]*\)[[:digit:]]$/\1\20/}' ${IMAGE_ROOTFS}/etc/fstab
+
+ # 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=/etc/ssh" >> ${IMAGE_ROOTFS}/etc/default/ssh
+ echo "SSHD_OPTS=" >> ${IMAGE_ROOTFS}/etc/default/ssh
+ else
+ echo "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
+
+ if ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "true", "false", d)}; then
+ # Update user database files so that services don't fail for a read-only systemd system
+ 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=""
+ [ "$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
+ fi
+ done
+ done
+ 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
+ sed -i 's/nullok_secure/nullok/' ${IMAGE_ROOTFS}${sysconfdir}/pam.d/*
+ 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
+}
+
+#
+# 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
+}
+
+insert_feed_uris () {
+
+ echo "Building feeds for [${DISTRO}].."
+
+ for line in ${FEED_URIS}
+ do
+ # strip leading and trailing spaces/tabs, then split into name and uri
+ line_clean="`echo "$line"|sed 's/^[ \t]*//;s/[ \t]*$//'`"
+ feed_name="`echo "$line_clean" | sed -n 's/\(.*\)##\(.*\)/\1/p'`"
+ feed_uri="`echo "$line_clean" | sed -n 's/\(.*\)##\(.*\)/\2/p'`"
+
+ echo "Added $feed_name feed with URL $feed_uri"
+
+ # insert new feed-sources
+ echo "src/gz $feed_name $feed_uri" >> ${IMAGE_ROOTFS}/etc/opkg/${feed_name}-feed.conf
+ done
+}
+
+python write_image_manifest () {
+ from oe.rootfs import image_list_installed_packages
+ from oe.utils import format_pkg_list
+
+ deploy_dir = d.getVar('DEPLOY_DIR_IMAGE', True)
+ link_name = d.getVar('IMAGE_LINK_NAME', True)
+ manifest_name = d.getVar('IMAGE_MANIFEST', True)
+
+ 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):
+ if d.getVar('RM_OLD_IMAGE', True) == "1" and \
+ os.path.exists(os.path.realpath(manifest_link)):
+ os.remove(os.path.realpath(manifest_link))
+ os.remove(manifest_link)
+ os.symlink(os.path.basename(manifest_name), manifest_link)
+}
+
+# Can be use to create /etc/timestamp during image construction to give a reasonably
+# sane default time setting
+rootfs_update_timestamp () {
+ date -u +%4Y%2m%2d%2H%2M%2S >${IMAGE_ROOTFS}/etc/timestamp
+}
+
+# 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}
+}
diff --git a/import-layers/yocto-poky/meta/classes/rootfs_deb.bbclass b/import-layers/yocto-poky/meta/classes/rootfs_deb.bbclass
new file mode 100644
index 000000000..f79fca608
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/rootfs_deb.bbclass
@@ -0,0 +1,38 @@
+#
+# Copyright 2006-2007 Openedhand Ltd.
+#
+
+ROOTFS_PKGMANAGE = "dpkg apt"
+ROOTFS_PKGMANAGE_BOOTSTRAP = "run-postinsts"
+
+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"
+
+python rootfs_deb_bad_recommendations() {
+ if d.getVar("BAD_RECOMMENDATIONS", True):
+ 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', True)
+ 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')
+}
+
+# This will of course only work after rootfs_deb_do_rootfs or populate_sdk_deb has been called
+DPKG_QUERY_COMMAND = "${STAGING_BINDIR_NATIVE}/dpkg-query --admindir=$INSTALL_ROOTFS_DEB/var/lib/dpkg"
diff --git a/import-layers/yocto-poky/meta/classes/rootfs_ipk.bbclass b/import-layers/yocto-poky/meta/classes/rootfs_ipk.bbclass
new file mode 100644
index 000000000..d5c38fef7
--- /dev/null
+++ b/import-layers/yocto-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}"
+ROOTFS_PKGMANAGE_BOOTSTRAP = "run-postinsts"
+
+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"
+
+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', True):
+ flags = d.getVarFlag('do_rootfs', 'recrdeptask', True)
+ 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/import-layers/yocto-poky/meta/classes/rootfs_rpm.bbclass b/import-layers/yocto-poky/meta/classes/rootfs_rpm.bbclass
new file mode 100644
index 000000000..0d2e897c2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/rootfs_rpm.bbclass
@@ -0,0 +1,46 @@
+#
+# Creates a root filesystem out of rpm packages
+#
+
+ROOTFS_PKGMANAGE = "rpm smartpm"
+ROOTFS_PKGMANAGE_BOOTSTRAP = "run-postinsts"
+
+# Add 50Meg of extra space for Smart
+IMAGE_ROOTFS_EXTRA_SPACE_append = "${@bb.utils.contains("PACKAGE_INSTALL", "smartpm", " + 51200", "" ,d)}"
+
+# Smart is python based, so be sure python-native is available to us.
+EXTRANATIVEPATH += "python-native"
+
+# opkg is needed for update-alternatives
+RPMROOTFSDEPENDS = "rpm-native:do_populate_sysroot \
+ rpmresolve-native:do_populate_sysroot \
+ python-smartpm-native:do_populate_sysroot \
+ createrepo-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"
+
+# RPM doesn't work with multiple rootfs generation at once due to collisions in the use of files
+# in ${DEPLOY_DIR_RPM}. This can be removed if package_update_index_rpm can be called concurrently
+do_rootfs[lockfiles] += "${DEPLOY_DIR_RPM}/rpm.lock"
+do_populate_sdk[lockfiles] += "${DEPLOY_DIR_RPM}/rpm.lock"
+
+python () {
+ if d.getVar('BUILD_IMAGES_FROM_FEEDS', True):
+ flags = d.getVarFlag('do_rootfs', 'recrdeptask', True)
+ 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', '')
+
+}
+# Smart is python based, so be sure python-native is available to us.
+EXTRANATIVEPATH += "python-native"
+
+rpmlibdir = "/var/lib/rpm"
diff --git a/import-layers/yocto-poky/meta/classes/rootfsdebugfiles.bbclass b/import-layers/yocto-poky/meta/classes/rootfsdebugfiles.bbclass
new file mode 100644
index 000000000..a558871e9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/rootfsdebugfiles.bbclass
@@ -0,0 +1,36 @@
+# 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.
+#
+# 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; do
+ if [ -e "$source" ]; then
+ mkdir -p $(dirname $target)
+ cp -a $source $target
+ fi
+ done
+}
diff --git a/import-layers/yocto-poky/meta/classes/sanity.bbclass b/import-layers/yocto-poky/meta/classes/sanity.bbclass
new file mode 100644
index 000000000..77813e41b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/sanity.bbclass
@@ -0,0 +1,1015 @@
+#
+# Sanity check the users setup for common misconfigurations
+#
+
+SANITY_REQUIRED_UTILITIES ?= "patch diffstat makeinfo git bzip2 tar \
+ gzip gawk chrpath wget cpio perl file"
+
+def bblayers_conf_file(d):
+ return os.path.join(d.getVar('TOPDIR', True), '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', True)
+ conf_version = d.getVar('LOCALCONF_VERSION', True)
+
+ 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', True)
+ sconf_version = d.getVar('SITE_CONF_VERSION', True)
+
+ 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', True))
+ lconf_version = int(d.getVar('LAYER_CONF_VERSION', True))
+
+ 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
+
+ if not status.reparse:
+ 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', True).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", True) == "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, True) or "").split()
+ args_wanted = (data.getVar("TUNEABI_REQUIRED_%s_tune-%s" % (which, tune), True) 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.data.update_data(localdata)
+ bb.debug(2, "Sanity-checking tuning '%s' (%s) features:" % (tune, multilib))
+ features = (localdata.getVar("TUNE_FEATURES_tune-%s" % tune, True) 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", True)
+ if whitelist:
+ tuneabi = localdata.getVar("TUNEABI_tune-%s" % tune, True)
+ 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", True)
+ tune_errors = check_toolchain_tune(data, deftune, 'default')
+ if tune_errors:
+ tune_error_set.append(tune_errors)
+
+ multilibs = (data.getVar("MULTILIB_VARIANTS", True) or "").split()
+ global_multilibs = (data.getVar("MULTILIB_GLOBAL_VARIANTS", True) 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, True)
+ 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 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', True) or "").split()
+ retval = ""
+
+ # Only check connectivity if network enabled and the
+ # CONNECTIVITY_CHECK_URIS are set
+ network_enabled = not d.getVar('BB_NO_NETWORK', True)
+ check_enabled = len(test_uris)
+ # Take a copy of the data store and unset MIRRORS and PREMIRRORS
+ data = bb.data.createCopy(d)
+ data.delVar('PREMIRRORS')
+ data.delVar('MIRRORS')
+ if check_enabled and network_enabled:
+ 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', True) or ""
+ if len(msg) == 0:
+ msg = "%s. Please ensure your network is configured correctly.\n" % err
+ retval = msg
+
+ return retval
+
+def check_supported_distro(sanity_data):
+ from fnmatch import fnmatch
+
+ tested_distros = sanity_data.getVar('SANITY_TESTED_DISTROS', True)
+ 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', True) == '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', True) == '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', True)
+ tunepkg = sanity_data.getVar('TUNE_PKGARCH', True)
+ defaulttune = sanity_data.getVar('DEFAULTTUNE', True)
+ 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
+
+# Checks if necessary to add option march to host gcc
+def check_gcc_march(sanity_data):
+ result = True
+ message = ""
+
+ # Check if -march not in BUILD_CFLAGS
+ if sanity_data.getVar("BUILD_CFLAGS",True).find("-march") < 0:
+ result = False
+
+ # Construct a test file
+ f = open("gcc_test.c", "w")
+ f.write("int main (){ volatile int atomic = 2; __sync_bool_compare_and_swap (&atomic, 2, 3); return 0; }\n")
+ f.close()
+
+ # Check if GCC could work without march
+ if not result:
+ status,res = oe.utils.getstatusoutput("${BUILD_PREFIX}gcc gcc_test.c -o gcc_test")
+ if status == 0:
+ result = True;
+
+ if not result:
+ status,res = oe.utils.getstatusoutput("${BUILD_PREFIX}gcc -march=native gcc_test.c -o gcc_test")
+ if status == 0:
+ message = "BUILD_CFLAGS_append = \" -march=native\""
+ result = True;
+
+ if not result:
+ build_arch = sanity_data.getVar('BUILD_ARCH', True)
+ status,res = oe.utils.getstatusoutput("${BUILD_PREFIX}gcc -march=%s gcc_test.c -o gcc_test" % build_arch)
+ if status == 0:
+ message = "BUILD_CFLAGS_append = \" -march=%s\"" % build_arch
+ result = True;
+
+ os.remove("gcc_test.c")
+ if os.path.exists("gcc_test"):
+ os.remove("gcc_test")
+
+ return (result, message)
+
+# 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 %s\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 %s\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 %s\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(status, d):
+ funcs = d.getVar('BBLAYERS_CONF_UPDATE_FUNCS', True).split()
+ for func in funcs:
+ conffile, current_version, required_version, func = func.split(":")
+ if check_conf_exists(conffile, d) and d.getVar(current_version, True) is not None and \
+ d.getVar(current_version, True) != d.getVar(required_version, True):
+ success = True
+ try:
+ bb.build.exec_func(func, d, pythonexception=True)
+ except NotImplementedError as e:
+ success = False
+ status.addresult(str(e))
+ if success:
+ status.reparse = True
+
+def sanity_handle_abichanges(status, d):
+ #
+ # Check the 'ABI' of TMPDIR
+ #
+ import subprocess
+
+ current_abi = d.getVar('OELAYOUT_ABI', True)
+ abifile = d.getVar('SANITY_ABIFILE', True)
+ 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 abi == "2" and current_abi == "3":
+ bb.note("Converting staging from layout version 2 to layout version 3")
+ subprocess.call(d.expand("mv ${TMPDIR}/staging ${TMPDIR}/sysroots"), shell=True)
+ subprocess.call(d.expand("ln -s sysroots ${TMPDIR}/staging"), shell=True)
+ subprocess.call(d.expand("cd ${TMPDIR}/stamps; for i in */*do_populate_staging; do new=`echo $i | sed -e 's/do_populate_staging/do_populate_sysroot/'`; mv $i $new; done"), shell=True)
+ with open(abifile, "w") as f:
+ f.write(current_abi)
+ elif abi == "3" and current_abi == "4":
+ bb.note("Converting staging layout from version 3 to layout version 4")
+ if os.path.exists(d.expand("${STAGING_DIR_NATIVE}${bindir_native}/${MULTIMACH_HOST_SYS}")):
+ subprocess.call(d.expand("mv ${STAGING_DIR_NATIVE}${bindir_native}/${MULTIMACH_HOST_SYS} ${STAGING_BINDIR_CROSS}"), shell=True)
+ subprocess.call(d.expand("ln -s ${STAGING_BINDIR_CROSS} ${STAGING_DIR_NATIVE}${bindir_native}/${MULTIMACH_HOST_SYS}"), shell=True)
+ with open(abifile, "w") as f:
+ f.write(current_abi)
+ elif abi == "4":
+ status.addresult("Staging layout has changed. The cross directory has been deprecated and cross packages are now built under the native sysroot.\nThis requires a rebuild.\n")
+ elif abi == "5" and current_abi == "6":
+ bb.note("Converting staging layout from version 5 to layout version 6")
+ subprocess.call(d.expand("mv ${TMPDIR}/pstagelogs ${SSTATE_MANIFESTS}"), shell=True)
+ with open(abifile, "w") as f:
+ f.write(current_abi)
+ elif abi == "7" and current_abi == "8":
+ status.addresult("Your configuration is using stamp files including the sstate hash but your build directory was built with stamp files that do not include this.\nTo continue, either rebuild or switch back to the OEBasic signature handler with BB_SIGNATURE_HANDLER = 'OEBasic'.\n")
+ elif (abi != current_abi and current_abi == "9"):
+ status.addresult("The layout of the TMPDIR STAMPS directory has changed. Please clean out TMPDIR and rebuild (sstate will be still be valid and reused)\n")
+ elif (abi != current_abi and current_abi == "10" and (abi == "8" or abi == "9")):
+ bb.note("Converting staging layout from version 8/9 to layout version 10")
+ cmd = d.expand("grep -r -l sysroot-providers/virtual_kernel ${SSTATE_MANIFESTS}")
+ ret, result = oe.utils.getstatusoutput(cmd)
+ result = result.split()
+ for f in result:
+ bb.note("Uninstalling manifest file %s" % f)
+ sstate_clean_manifest(f, d)
+ with open(abifile, "w") as f:
+ f.write(current_abi)
+ elif abi == "10" and current_abi == "11":
+ bb.note("Converting staging layout from version 10 to layout version 11")
+ # Files in xf86-video-modesetting moved to xserver-xorg and bitbake can't currently handle that:
+ subprocess.call(d.expand("rm ${TMPDIR}/sysroots/*/usr/lib/xorg/modules/drivers/modesetting_drv.so ${TMPDIR}/sysroots/*/pkgdata/runtime/xf86-video-modesetting* ${TMPDIR}/sysroots/*/pkgdata/runtime-reverse/xf86-video-modesetting* ${TMPDIR}/sysroots/*/pkgdata/shlibs2/xf86-video-modesetting*"), shell=True)
+ with open(abifile, "w") as f:
+ f.write(current_abi)
+ 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_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_PREFIX}gcc', d):
+ missing = missing + "C Compiler (%sgcc)," % d.getVar("BUILD_PREFIX", True)
+
+ if not check_app_exists('${BUILD_PREFIX}g++', d):
+ missing = missing + "C++ Compiler (%sg++)," % d.getVar("BUILD_PREFIX", True)
+
+ required_utilities = d.getVar('SANITY_REQUIRED_UTILITIES', True)
+
+ 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', True).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')
+
+ if "qemu-native" in assume_provided:
+ if not check_app_exists("qemu-arm", d):
+ status.addresult("qemu-native was in ASSUME_PROVIDED but the QEMU binaries (qemu-arm) can't be found in PATH")
+
+ if "libsdl-native" in assume_provided:
+ if not check_app_exists("sdl-config", d):
+ status.addresult("libsdl-native is set to be ASSUME_PROVIDED but sdl-config can't be found in PATH. Please either install it, or configure qemu not to require sdl.")
+
+ (result, message) = check_gcc_march(d)
+ if result and message:
+ status.addresult("Your gcc version is older than 4.5, please add the following param to local.conf\n \
+ %s\n" % message)
+ if not result:
+ status.addresult("Your gcc version is older than 4.5 or is not working properly. Please verify you can build")
+ status.addresult(" and link something that uses atomic operations, such as: \n")
+ status.addresult(" __sync_bool_compare_and_swap (&atomic, 2, 3);\n")
+
+ # Check that TMPDIR isn't on a filesystem with limited filename length (eg. eCryptFS)
+ tmpdir = d.getVar('TMPDIR', True)
+ 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', True)
+ 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', True).split(":")
+ if ("." in bbpaths or "./" in bbpaths or "" in bbpaths) and not status.reparse:
+ 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', True)
+ 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"))
+
+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 2.7.3
+ import sys
+ if sys.hexversion < 0x020703F0:
+ status.addresult('The system requires at least Python 2.7.3 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', True)
+ if (LooseVersion(bb.__version__) < LooseVersion(minversion)):
+ status.addresult('Bitbake version %s is required and version %s was found\n' % (minversion, bb.__version__))
+
+ sanity_check_conffiles(status, d)
+
+ paths = d.getVar('PATH', True).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', True)
+ 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", True))
+
+ # 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', True)
+ 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', True):
+ if not check_conf_exists("conf/machine/${MACHINE}.conf", d):
+ status.addresult('Please set a valid MACHINE in your local.conf or environment\n')
+ 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', True):
+ 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(022)
+ if omask & 0755:
+ status.addresult("Please use a umask which allows a+rx and u+rwx\n")
+ os.umask(omask)
+
+ if d.getVar('TARGET_ARCH', True) == "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', True)
+ 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']
+ for mirror_var in mirror_vars:
+ mirrors = (d.getVar(mirror_var, True) or '').replace('\\n', '\n').split('\n')
+ for mirror_entry in mirrors:
+ mirror_entry = mirror_entry.strip()
+ if not mirror_entry:
+ # ignore blank lines
+ continue
+
+ try:
+ pattern, mirror = mirror_entry.split()
+ except ValueError:
+ bb.warn('Invalid %s: %s, should be 2 members.' % (mirror_var, mirror_entry.strip()))
+ continue
+
+ 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 urlparse
+ check_symlink(urlparse.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 = urlparse.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', True)
+ 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)
+
+ # Check /bin/sh links to dash or bash
+ real_sh = os.path.realpath('/bin/sh')
+ if not real_sh.endswith('/dash') and not real_sh.endswith('/bash'):
+ 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
+ self.reparse = False
+
+ def addresult(self, message):
+ if message:
+ self.messages = self.messages + message
+
+ status = SanityStatus()
+
+ tmpdir = sanity_data.getVar('TMPDIR', True)
+ sstate_dir = sanity_data.getVar('SSTATE_DIR', True)
+
+ 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', True) 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)
+ return status.reparse
+
+# 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 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)
+ if e.generateevents:
+ sanity_data.setVar("SANITY_USE_EVENTS", "1")
+ reparse = check_sanity(sanity_data)
+ e.data.setVar("BB_INVALIDCONF", reparse)
+ 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/import-layers/yocto-poky/meta/classes/scons.bbclass b/import-layers/yocto-poky/meta/classes/scons.bbclass
new file mode 100644
index 000000000..1579b05c6
--- /dev/null
+++ b/import-layers/yocto-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 PREFIX=${D}${prefix} prefix=${D}${prefix} install ${EXTRA_OESCONS}|| \
+ die "scons install execution failed."
+}
+
+EXPORT_FUNCTIONS do_compile do_install
diff --git a/import-layers/yocto-poky/meta/classes/sdl.bbclass b/import-layers/yocto-poky/meta/classes/sdl.bbclass
new file mode 100644
index 000000000..cc31288f6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/sdl.bbclass
@@ -0,0 +1,6 @@
+#
+# (C) Michael 'Mickey' Lauer <mickey@Vanille.de>
+#
+
+DEPENDS += "virtual/libsdl libsdl-mixer libsdl-image"
+SECTION = "x11/games"
diff --git a/import-layers/yocto-poky/meta/classes/setuptools.bbclass b/import-layers/yocto-poky/meta/classes/setuptools.bbclass
new file mode 100644
index 000000000..56343b1c7
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/classes/setuptools3.bbclass b/import-layers/yocto-poky/meta/classes/setuptools3.bbclass
new file mode 100644
index 000000000..de6dd9440
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/classes/sign_ipk.bbclass b/import-layers/yocto-poky/meta/classes/sign_ipk.bbclass
new file mode 100644
index 000000000..a481f6d9a
--- /dev/null
+++ b/import-layers/yocto-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, True):
+ raise_sanity_error("You need to define %s in the config" % var, d)
+
+ sigtype = d.getVar("IPK_GPG_SIGNATURE_TYPE", True)
+ 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', True))
+ sig_type = d.getVar('IPK_GPG_SIGNATURE_TYPE', True)
+ is_ascii_sig = (sig_type.upper() != "BIN")
+
+ signer.detach_sign(ipk_to_sign,
+ d.getVar('IPK_GPG_NAME', True),
+ d.getVar('IPK_GPG_PASSPHRASE_FILE', True),
+ armor=is_ascii_sig)
diff --git a/import-layers/yocto-poky/meta/classes/sign_package_feed.bbclass b/import-layers/yocto-poky/meta/classes/sign_package_feed.bbclass
new file mode 100644
index 000000000..31a6e9b04
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/sign_package_feed.bbclass
@@ -0,0 +1,43 @@
+# 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'
+
+python () {
+ # Check sanity of configuration
+ for var in ('PACKAGE_FEED_GPG_NAME', 'PACKAGE_FEED_GPG_PASSPHRASE_FILE'):
+ if not d.getVar(var, True):
+ raise_sanity_error("You need to define %s in the config" % var, d)
+
+ sigtype = d.getVar("PACKAGE_FEED_GPG_SIGNATURE_TYPE", True)
+ 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"
diff --git a/import-layers/yocto-poky/meta/classes/sign_rpm.bbclass b/import-layers/yocto-poky/meta/classes/sign_rpm.bbclass
new file mode 100644
index 000000000..a8ea75faa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/sign_rpm.bbclass
@@ -0,0 +1,53 @@
+# 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.
+# 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
+
+RPM_SIGN_PACKAGES='1'
+RPM_GPG_BACKEND ?= 'local'
+
+
+python () {
+ if d.getVar('RPM_GPG_PASSPHRASE_FILE', True):
+ 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, True):
+ raise_sanity_error("You need to define %s in the config" % var, d)
+
+ # Set the expected location of the public key
+ d.setVar('RPM_GPG_PUBKEY', os.path.join(d.getVar('STAGING_DIR_TARGET', False),
+ d.getVar('sysconfdir', False),
+ 'pki',
+ 'rpm-gpg',
+ 'RPM-GPG-KEY-${DISTRO_VERSION}'))
+}
+
+python sign_rpm () {
+ import glob
+ from oe.gpg_sign import get_signer
+
+ signer = get_signer(d, d.getVar('RPM_GPG_BACKEND', True))
+ rpms = glob.glob(d.getVar('RPM_PKGWRITEDIR', True) + '/*')
+
+ signer.sign_rpms(rpms,
+ d.getVar('RPM_GPG_NAME', True),
+ d.getVar('RPM_GPG_PASSPHRASE', True))
+}
+
+do_package_index[depends] += "signing-keys:do_deploy"
+do_rootfs[depends] += "signing-keys:do_populate_sysroot"
diff --git a/import-layers/yocto-poky/meta/classes/sip.bbclass b/import-layers/yocto-poky/meta/classes/sip.bbclass
new file mode 100644
index 000000000..6ed2a13bd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/sip.bbclass
@@ -0,0 +1,61 @@
+# Build Class for Sip based Python Bindings
+# (C) Michael 'Mickey' Lauer <mickey@Vanille.de>
+#
+STAGING_SIPDIR ?= "${STAGING_DATADIR_NATIVE}/sip"
+
+DEPENDS =+ "sip-native"
+RDEPENDS_${PN} += "python-sip"
+
+# default stuff, do not uncomment
+# EXTRA_SIPTAGS = "-tWS_X11 -tQt_4_3_0"
+
+# do_generate is before do_configure so ensure that sip_native is populated in sysroot before executing it
+do_generate[depends] += "sip-native:do_populate_sysroot"
+
+sip_do_generate() {
+ if [ -z "${SIP_MODULES}" ]; then
+ MODULES="`ls sip/*mod.sip`"
+ else
+ MODULES="${SIP_MODULES}"
+ fi
+
+ if [ -z "$MODULES" ]; then
+ die "SIP_MODULES not set and no modules found in $PWD"
+ else
+ bbnote "using modules '${SIP_MODULES}' and tags '${EXTRA_SIPTAGS}'"
+ fi
+
+ if [ -z "${EXTRA_SIPTAGS}" ]; then
+ die "EXTRA_SIPTAGS needs to be set!"
+ else
+ SIPTAGS="${EXTRA_SIPTAGS}"
+ fi
+
+ if [ ! -z "${SIP_FEATURES}" ]; then
+ FEATURES="-z ${SIP_FEATURES}"
+ bbnote "sip feature file: ${SIP_FEATURES}"
+ fi
+
+ for module in $MODULES
+ do
+ install -d ${module}/
+ echo "calling 'sip4 -I sip -I ${STAGING_SIPDIR} ${SIPTAGS} ${FEATURES} -c ${module} -b ${module}/${module}.pro.in sip/${module}/${module}mod.sip'"
+ sip4 -I ${STAGING_SIPDIR} -I sip ${SIPTAGS} ${FEATURES} -c ${module} -b ${module}/${module}.sbf \
+ sip/${module}/${module}mod.sip || die "Error calling sip on ${module}"
+ sed -e 's,target,TARGET,' -e 's,sources,SOURCES,' -e 's,headers,HEADERS,' \
+ ${module}/${module}.sbf | sed s,"moc_HEADERS =","HEADERS +=", \
+ >${module}/${module}.pro
+ echo "TEMPLATE=lib" >>${module}/${module}.pro
+ [ "${module}" = "qt" ] && echo "" >>${module}/${module}.pro
+ [ "${module}" = "qtcanvas" ] && echo "" >>${module}/${module}.pro
+ [ "${module}" = "qttable" ] && echo "" >>${module}/${module}.pro
+ [ "${module}" = "qwt" ] && echo "" >>${module}/${module}.pro
+ [ "${module}" = "qtpe" ] && echo "" >>${module}/${module}.pro
+ [ "${module}" = "qtpe" ] && echo "LIBS+=-lqpe" >>${module}/${module}.pro
+ true
+ done
+}
+
+EXPORT_FUNCTIONS do_generate
+
+addtask generate after do_unpack do_patch before do_configure
diff --git a/import-layers/yocto-poky/meta/classes/siteconfig.bbclass b/import-layers/yocto-poky/meta/classes/siteconfig.bbclass
new file mode 100644
index 000000000..45dce489d
--- /dev/null
+++ b/import-layers/yocto-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', True), 'site_config')):
+ bb.debug(1, "No site_config directory, skipping do_siteconfig")
+ return
+ bb.build.exec_func('do_siteconfig_gencache', d)
+ sstate_clean(shared_state, d)
+ sstate_install(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/import-layers/yocto-poky/meta/classes/siteinfo.bbclass b/import-layers/yocto-poky/meta/classes/siteinfo.bbclass
new file mode 100644
index 000000000..50141a353
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/siteinfo.bbclass
@@ -0,0 +1,175 @@
+# 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",
+ "mipsel": "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",
+ "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-gnux32": "common-linux common-glibc",
+ "linux-gnun32": "common-linux common-glibc",
+ "linux-gnueabi": "common-linux common-glibc",
+ "linux-gnuspe": "common-linux common-glibc",
+ "linux-uclibc": "common-linux common-uclibc",
+ "linux-uclibceabi": "common-linux common-uclibc",
+ "linux-uclibcspe": "common-linux common-uclibc",
+ "linux-musl": "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-musl": "aarch64-linux",
+ "aarch64_be-linux-musl": "aarch64_be-linux",
+ "arm-linux-gnueabi": "arm-linux",
+ "arm-linux-musleabi": "arm-linux",
+ "arm-linux-uclibceabi": "arm-linux-uclibc",
+ "armeb-linux-gnueabi": "armeb-linux",
+ "armeb-linux-uclibceabi": "armeb-linux-uclibc",
+ "armeb-linux-musleabi": "armeb-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",
+ "powerpc-linux": "powerpc32-linux",
+ "powerpc-linux-musl": "powerpc-linux powerpc32-linux",
+ "powerpc-linux-uclibc": "powerpc-linux powerpc32-linux",
+ "powerpc-linux-gnuspe": "powerpc-linux powerpc32-linux",
+ "powerpc-linux-muslspe": "powerpc-linux powerpc32-linux",
+ "powerpc-linux-uclibcspe": "powerpc-linux powerpc32-linux powerpc-linux-uclibc",
+ "powerpc64-linux-gnuspe": "powerpc-linux powerpc64-linux",
+ "powerpc64-linux-muslspe": "powerpc-linux powerpc64-linux",
+ "powerpc64-linux": "powerpc-linux",
+ "powerpc64-linux-musl": "powerpc-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-uclibc": "bit-64",
+ "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",
+ }
+
+ hostarch = d.getVar("HOST_ARCH", True)
+ hostos = d.getVar("HOST_OS", True)
+ 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", True))
+ 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", True))
+ bb.fatal("Please add your architecture to siteinfo.bbclass")
+}
+
+def siteinfo_get_files(d, no_cache = False):
+ sitedata = siteinfo_data(d)
+ sitefiles = ""
+ for path in d.getVar("BBPATH", True).split(":"):
+ for element in sitedata:
+ filename = os.path.join(path, "site", element)
+ if os.path.exists(filename):
+ sitefiles += filename + " "
+
+ if no_cache: return sitefiles
+
+ # Now check for siteconfig cache files
+ # Use the files copied to the aclocal cache generated by autotools.bbclass
+ # to avoid races
+ path_siteconfig = d.getVar('ACLOCALDIR', True)
+ 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/import-layers/yocto-poky/meta/classes/spdx.bbclass b/import-layers/yocto-poky/meta/classes/spdx.bbclass
new file mode 100644
index 000000000..0c9276584
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/spdx.bbclass
@@ -0,0 +1,365 @@
+# 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', True)
+ info['sourcedir'] = d.getVar('SPDX_S', True)
+ info['pn'] = d.getVar('PN', True)
+ info['pv'] = d.getVar('PV', True)
+ info['spdx_version'] = d.getVar('SPDX_VERSION', True)
+ info['data_license'] = d.getVar('DATA_LICENSE', True)
+
+ sstatedir = d.getVar('SPDXSSTATEDIR', True)
+ sstatefile = os.path.join(sstatedir, info['pn'] + info['pv'] + ".spdx")
+
+ manifest_dir = d.getVar('SPDX_MANIFEST_DIR', True)
+ info['outfile'] = os.path.join(manifest_dir, info['pn'] + ".spdx" )
+
+ info['spdx_temp_dir'] = d.getVar('SPDX_TEMP_DIR', True)
+ 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', True)
+ foss_flags = d.getVar('FOSS_WGET_FLAGS', True)
+ foss_full_spdx = d.getVar('FOSS_FULL_SPDX', True) == "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
+
+ p = subprocess.Popen(foss_command.split(),
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ foss_output, foss_error = p.communicate()
+ if p.returncode != 0:
+ return None
+
+ foss_output = unicode(foss_output, "utf-8")
+ 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/import-layers/yocto-poky/meta/classes/sstate.bbclass b/import-layers/yocto-poky/meta/classes/sstate.bbclass
new file mode 100644
index 000000000..8c623271a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/sstate.bbclass
@@ -0,0 +1,993 @@
+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', True), d.getVar('BB_TASKHASH', True), d)}"
+SSTATE_PKG = "${SSTATE_DIR}/${SSTATE_PKGNAME}"
+SSTATE_EXTRAPATH = ""
+SSTATE_EXTRAPATHWILDCARD = ""
+SSTATE_PATHSPEC = "${SSTATE_DIR}/${SSTATE_EXTRAPATHWILDCARD}*/${SSTATE_PKGSPEC}"
+
+# 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}/all/"
+# Avoid docbook/sgml catalog warnings for now
+SSTATE_DUPWHITELIST += "${STAGING_ETCDIR_NATIVE}/sgml ${STAGING_DATADIR_NATIVE}/sgml"
+# Archive the sources for many architectures in one deploy folder
+SSTATE_DUPWHITELIST += "${DEPLOY_DIR_SRC}"
+
+SSTATE_SCAN_FILES ?= "*.la *-config *_config"
+SSTATE_SCAN_CMD ?= 'find ${SSTATE_BUILDDIR} \( -name "${@"\" -o -name \"".join(d.getVar("SSTATE_SCAN_FILES", True).split())}" \) -type f'
+
+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} \
+ ${MACHINE}"
+
+SSTATE_MANMACH ?= "${SSTATE_PKGARCH}"
+
+SSTATECREATEFUNCS = "sstate_hardcode_path"
+SSTATEPOSTCREATEFUNCS = ""
+SSTATEPREINSTFUNCS = ""
+SSTATEPOSTUNPACKFUNCS = "sstate_hardcode_path_unpack"
+SSTATEPOSTINSTFUNCS = ""
+EXTRA_STAGING_FIXMES ?= ""
+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", True) == "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', "*/")
+
+ # These classes encode staging paths into their scripts data so can only be
+ # reused if we manipulate the paths
+ 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):
+ scan_cmd = "grep -Irl ${STAGING_DIR} ${SSTATE_BUILDDIR}"
+ d.setVar('SSTATE_SCAN_CMD', scan_cmd)
+
+ unique_tasks = set((d.getVar('SSTATETASKS', True) 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', True)
+ 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', True) or "").split()
+ outputs = (d.getVarFlag("do_" + task, 'sstate-outputdirs', True) or "").split()
+ plaindirs = (d.getVarFlag("do_" + task, 'sstate-plaindirs', True) or "").split()
+ lockfiles = (d.getVarFlag("do_" + task, 'sstate-lockfile', True) or "").split()
+ lockfilesshared = (d.getVarFlag("do_" + task, 'sstate-lockfile-shared', True) or "").split()
+ interceptfuncs = (d.getVarFlag("do_" + task, 'sstate-interceptfuncs', True) or "").split()
+ 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
+ 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)
+
+ 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 not dstdir.endswith("/"):
+ dstdir = dstdir + "/"
+ shareddirs.append(dstdir)
+
+ # Check the file list for conflicts against files which already exist
+ whitelist = (d.getVar("SSTATE_DUPWHITELIST", True) or "").split()
+ match = []
+ for f in sharedfiles:
+ if os.path.exists(f):
+ f = os.path.normpath(f)
+ realmatch = True
+ for w in whitelist:
+ if f.startswith(w):
+ realmatch = False
+ break
+ if realmatch:
+ match.append(f)
+ sstate_search_cmd = "grep -rl '%s' %s --exclude=master.list | sed -e 's:^.*/::' -e 's:\.populate-sysroot::'" % (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.rstrip())
+ 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.\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', True), "\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.")
+
+ # 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", True) + " " + d2.getVar("SSTATE_MANFILEPREFIX", True) + " " + d.getVar("WORKDIR", True) + "\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', True) 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):
+ import oe.path
+ import subprocess
+ from oe.gpg_sign import get_signer
+
+ 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)
+
+ sstateinst = d.expand("${WORKDIR}/sstate-install-%s/" % ss['task'])
+ sstatefetch = d.getVar('SSTATE_PKGNAME', True) + '_' + ss['task'] + ".tgz"
+ sstatepkg = d.getVar('SSTATE_PKG', True) + '_' + 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", True), False):
+ signer = get_signer(d, 'local')
+ if not signer.verify(sstatepkg + '.sig'):
+ bb.warn("Cannot verify signature on sstate package %s" % sstatepkg)
+
+ for f in (d.getVar('SSTATEPREINSTFUNCS', True) or '').split() + ['sstate_unpack_package'] + (d.getVar('SSTATEPOSTUNPACKFUNCS', True) or '').split():
+ # All hooks should run in the SSTATE_INSTDIR
+ bb.build.exec_func(f, d, (sstateinst,))
+
+ 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', True)
+ 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', True)
+ fixmefn = sstateinst + "fixmepath"
+ if os.path.isfile(fixmefn):
+ staging = d.getVar('STAGING_DIR', True)
+ staging_target = d.getVar('STAGING_DIR_TARGET', True)
+ staging_host = d.getVar('STAGING_DIR_HOST', True)
+
+ if bb.data.inherits_class('native', d) or bb.data.inherits_class('nativesdk', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('cross-canadian', d):
+ sstate_sed_cmd = "sed -i -e 's:FIXMESTAGINGDIR:%s:g'" % (staging)
+ elif bb.data.inherits_class('cross', d):
+ sstate_sed_cmd = "sed -i -e 's:FIXMESTAGINGDIRTARGET:%s:g; s:FIXMESTAGINGDIR:%s:g'" % (staging_target, staging)
+ else:
+ sstate_sed_cmd = "sed -i -e 's:FIXMESTAGINGDIRHOST:%s:g'" % (staging_host)
+
+ extra_staging_fixmes = d.getVar('EXTRA_STAGING_FIXMES', True) or ''
+ for fixmevar in extra_staging_fixmes.split():
+ fixme_path = d.getVar(fixmevar, True)
+ 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)
+
+ bb.note("Replacing fixme paths in sstate package: %s" % (sstate_hardcode_cmd))
+ subprocess.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', True) + "*_" + ss['task'] + ".tgz*"
+ bb.note("Removing %s" % sstatepkgfile)
+ oe.path.remove(sstatepkgfile)
+
+def sstate_clean_cachefiles(d):
+ for task in (d.getVar('SSTATETASKS', True) or "").split():
+ ld = d.createCopy()
+ ss = sstate_state_fromvars(ld, task)
+ sstate_clean_cachefile(ss, ld)
+
+def sstate_clean_manifest(manifest, d):
+ import oe.path
+
+ mfile = open(manifest)
+ entries = mfile.readlines()
+ mfile.close()
+
+ for entry in entries:
+ entry = entry.strip()
+ 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:
+ oe.path.remove(entry)
+ except OSError:
+ pass
+
+ oe.path.remove(manifest)
+
+def sstate_clean(ss, d):
+ import oe.path
+ import glob
+
+ d2 = d.createCopy()
+ stamp_clean = d.getVar("STAMPCLEAN", True)
+ extrainf = d.getVarFlag("do_" + ss['task'], 'stamp-extra-info', True)
+ 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:
+ 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', True) 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', True))
+
+ manifest_dir = d.getVar('SSTATE_MANIFESTS', True)
+ if not os.path.exists(manifest_dir):
+ return
+
+ tasks = d.getVar('SSTATETASKS', True).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 = d.getVar('STAGING_DIR', True)
+ staging_target = d.getVar('STAGING_DIR_TARGET', True)
+ staging_host = d.getVar('STAGING_DIR_HOST', True)
+ sstate_builddir = d.getVar('SSTATE_BUILDDIR', True)
+
+ if bb.data.inherits_class('native', d) or bb.data.inherits_class('nativesdk', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('cross-canadian', d):
+ sstate_grep_cmd = "grep -l -e '%s'" % (staging)
+ sstate_sed_cmd = "sed -i -e 's:%s:FIXMESTAGINGDIR:g'" % (staging)
+ elif bb.data.inherits_class('cross', d):
+ sstate_grep_cmd = "grep -l -e '%s' -e '%s'" % (staging_target, staging)
+ sstate_sed_cmd = "sed -i -e 's:%s:FIXMESTAGINGDIRTARGET:g; s:%s:FIXMESTAGINGDIR:g'" % (staging_target, staging)
+ else:
+ sstate_grep_cmd = "grep -l -e '%s'" % (staging_host)
+ sstate_sed_cmd = "sed -i -e 's:%s:FIXMESTAGINGDIRHOST:g'" % (staging_host)
+
+ extra_staging_fixmes = d.getVar('EXTRA_STAGING_FIXMES', True) or ''
+ for fixmevar in extra_staging_fixmes.split():
+ fixme_path = d.getVar(fixmevar, True)
+ sstate_sed_cmd += " -e 's:%s:FIXME_%s:g'" % (fixme_path, fixmevar)
+
+ fixmefn = sstate_builddir + "fixmepath"
+
+ sstate_scan_cmd = d.getVar('SSTATE_SCAN_CMD', True)
+ 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.call(sstate_hardcode_cmd, shell=True)
+
+ # 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.call(sstate_filelist_relative_cmd, shell=True)
+}
+
+def sstate_package(ss, d):
+ import oe.path
+
+ def make_relative_symlink(path, outputpath, d):
+ # Replace out absolute TMPDIR paths in symlinks with relative ones
+ if not os.path.islink(path):
+ return
+ link = os.readlink(path)
+ if not os.path.isabs(link):
+ return
+ if not link.startswith(tmpdir):
+ return
+
+ depth = outputpath.rpartition(tmpdir)[2].count('/')
+ base = link.partition(tmpdir)[2].strip()
+ while depth > 1:
+ base = "/.." + base
+ depth -= 1
+ base = "." + base
+
+ bb.debug(2, "Replacing absolute path %s with relative path %s for %s" % (link, base, outputpath))
+ os.remove(path)
+ os.symlink(base, path)
+
+ tmpdir = d.getVar('TMPDIR', True)
+
+ sstatebuild = d.expand("${WORKDIR}/sstate-build-%s/" % ss['task'])
+ sstatepkg = d.getVar('SSTATE_PKG', True) + '_'+ 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]
+ 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])
+ make_relative_symlink(srcpath, dstpath, d)
+ for dir in dirs:
+ srcpath = os.path.join(walkroot, dir)
+ dstpath = srcpath.replace(state[1], state[2])
+ make_relative_symlink(srcpath, dstpath, d)
+ bb.debug(2, "Preparing tree %s for packaging at %s" % (state[1], sstatebuild + state[0]))
+ oe.path.copyhardlinktree(state[1], sstatebuild + state[0])
+
+ workdir = d.getVar('WORKDIR', True)
+ for plain in ss['plaindirs']:
+ pdir = plain.replace(workdir, sstatebuild)
+ bb.utils.mkdirhier(plain)
+ bb.utils.mkdirhier(pdir)
+ oe.path.copyhardlinktree(plain, pdir)
+
+ d.setVar('SSTATE_BUILDDIR', sstatebuild)
+ d.setVar('SSTATE_PKG', sstatepkg)
+
+ for f in (d.getVar('SSTATECREATEFUNCS', True) or '').split() + \
+ ['sstate_create_package', 'sstate_sign_package'] + \
+ (d.getVar('SSTATEPOSTCREATEFUNCS', True) 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', True)
+ if not mirrors:
+ return
+
+ # Copy the data object and override DL_DIR and SRC_URI
+ localdata = bb.data.createCopy(d)
+ bb.data.update_data(localdata)
+
+ 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', True) == "1" and localdata.getVar('SSTATE_MIRROR_ALLOW_NETWORK', True) == "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}'.format(sstatefetch),
+ 'file://{0}.siginfo'.format(sstatefetch)]
+ if bb.utils.to_boolean(d.getVar("SSTATE_VERIFY_SIG", True), False):
+ uris += ['file://{0}.sig'.format(sstatefetch)]
+
+ for srcuri in uris:
+ localdata.setVar('SRC_URI', srcuri)
+ try:
+ fetcher = bb.fetch2.Fetch([srcuri], localdata, cache=False)
+ fetcher.download()
+
+ # Need to optimise this, if using file:// urls, the fetcher just changes the local path
+ # For now work around by symlinking
+ localpath = bb.data.expand(fetcher.localpath(srcuri), localdata)
+ if localpath != sstatepkg and os.path.exists(localpath) and not os.path.exists(sstatepkg):
+ os.symlink(localpath, sstatepkg)
+
+ except bb.fetch2.BBFetchException:
+ break
+
+def sstate_setscene(d):
+ shared_state = sstate_state_fromvars(d)
+ accelerate = sstate_installpkg(shared_state, d)
+ if not accelerate:
+ raise bb.build.FuncFailed("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)
+
+ sstate_install(shared_state, d)
+ for intercept in shared_state['interceptfuncs']:
+ bb.build.exec_func(intercept, d, (d.getVar("WORKDIR", True),))
+ omask = os.umask(002)
+ if omask != 002:
+ bb.note("Using umask 002 (not %0o) for sstate packaging" % omask)
+ sstate_package(shared_state, d)
+ os.umask(omask)
+}
+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}
+
+ cd ${WORKDIR}
+ rm -rf ${SSTATE_BUILDDIR}
+}
+
+python sstate_sign_package () {
+ from oe.gpg_sign import get_signer
+
+ if d.getVar('SSTATE_SIG_KEY', True):
+ signer = get_signer(d, 'local')
+ sstate_pkg = d.getVar('SSTATE_PKG', True)
+ 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', True), 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}
+ # 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", True) + "/"
+ 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", True)
+ if mirrors:
+ # Copy the data object and override DL_DIR and SRC_URI
+ localdata = bb.data.createCopy(d)
+ bb.data.update_data(localdata)
+
+ 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', True) == "1" and localdata.getVar('SSTATE_MIRROR_ALLOW_NETWORK', True) == "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
+
+ 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:
+ bb.note("Checking sstate mirror object availability (for %s objects)" % len(tasklist))
+ import multiprocessing
+ nproc = min(multiprocessing.cpu_count(), len(tasklist))
+
+ 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()
+
+ inheritlist = d.getVar("INHERIT", True)
+ 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):
+ # 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
+
+ bb.debug(2, "Considering setscene task: %s" % (str(taskdependees[task])))
+
+ def isNativeCross(x):
+ return x.endswith("-native") or "-cross-" in x or "-crosssdk" in x
+
+ def isPostInstDep(x):
+ if x in ["qemu-native", "gdk-pixbuf-native", "qemuwrapper-cross", "depmodwrapper-cross", "systemd-systemctl-native", "gtk-icon-utils-native", "ca-certificates-native"]:
+ return True
+ return False
+
+ # We only need to trigger populate_lic through direct dependencies
+ if taskdependees[task][1] == "do_populate_lic":
+ 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:
+ bb.debug(2, " considering dependency: %s" % (str(taskdependees[dep])))
+ 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_* and do_package doesn't need do_populate_sysroot, unless is a postinstall dependency
+ if taskdependees[task][1] == "do_populate_sysroot" and taskdependees[dep][1] in ['do_package', 'do_package_write_deb', 'do_package_write_ipk', 'do_package_write_rpm', 'do_packagedata', 'do_package_qa']:
+ if isPostInstDep(taskdependees[task][0]) and taskdependees[dep][1] in ['do_package_write_deb', 'do_package_write_ipk', 'do_package_write_rpm']:
+ return False
+ 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
+ # 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
+ if isNativeCross(taskdependees[task][0]):
+ 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
+ bb.debug(2, " Default setscene dependency fall through due to dependency: %s" % (str(taskdependees[dep])))
+ 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', True)
+ if not spkg.endswith(".tgz"):
+ taskname = d.getVar("BB_RUNTASK", True)[3:]
+ spec = d.getVar('SSTATE_PKGSPEC', True)
+ swspec = d.getVar('SSTATE_SWSPEC', True)
+ 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', True)
+ 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")
+ seen = []
+ for a in d.getVar("SSTATE_ARCHS", True).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:
+ 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:
+ bb.note("There are %d recipes to be removed from sysroot %s, removing..." % (len(toremove), a))
+
+ for r in toremove:
+ (stamp, manifest, workdir) = r.split()
+ for m in glob.glob(manifest + ".*"):
+ sstate_clean_manifest(m, d)
+ bb.utils.remove(stamp + "*")
+ if removeworkdir:
+ bb.utils.remove(workdir, recurse = True)
+ lines.remove(r)
+ with open(i, "w") as f:
+ for l in lines:
+ f.write(l)
+}
diff --git a/import-layers/yocto-poky/meta/classes/staging.bbclass b/import-layers/yocto-poky/meta/classes/staging.bbclass
new file mode 100644
index 000000000..bc5dfa81a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/staging.bbclass
@@ -0,0 +1,221 @@
+
+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_libdir() {
+ src="$1"
+ dest="$2"
+
+ sysroot_stage_dir $src $dest
+}
+
+sysroot_stage_dirs() {
+ from="$1"
+ to="$2"
+
+ sysroot_stage_dir $from${includedir} $to${includedir}
+ if [ "${BUILD_SYS}" = "${HOST_SYS}" ]; then
+ sysroot_stage_dir $from${bindir} $to${bindir}
+ sysroot_stage_dir $from${sbindir} $to${sbindir}
+ sysroot_stage_dir $from${base_bindir} $to${base_bindir}
+ sysroot_stage_dir $from${base_sbindir} $to${base_sbindir}
+ sysroot_stage_dir $from${libexecdir} $to${libexecdir}
+ sysroot_stage_dir $from${sysconfdir} $to${sysconfdir}
+ sysroot_stage_dir $from${localstatedir} $to${localstatedir}
+ fi
+ if [ -d $from${libdir} ]
+ then
+ sysroot_stage_libdir $from${libdir} $to${libdir}
+ fi
+ if [ -d $from${base_libdir} ]
+ then
+ sysroot_stage_libdir $from${base_libdir} $to${base_libdir}
+ fi
+ if [ -d $from${nonarch_base_libdir} ]
+ then
+ sysroot_stage_libdir $from${nonarch_base_libdir} $to${nonarch_base_libdir}
+ fi
+ sysroot_stage_dir $from${datadir} $to${datadir}
+ # We don't care about docs/info/manpages/locales
+ rm -rf $to${mandir}/ $to${docdir}/ $to${infodir}/ ${to}${datadir}/locale/
+ rm -rf $to${datadir}/applications/ $to${datadir}/fonts/ $to${datadir}/pixmaps/
+}
+
+sysroot_stage_all() {
+ sysroot_stage_dirs ${D} ${SYSROOT_DESTDIR}
+}
+
+python sysroot_strip () {
+ import stat, errno
+
+ dvar = d.getVar('SYSROOT_DESTDIR', True)
+ pn = d.getVar('PN', True)
+
+ os.chdir(dvar)
+
+ # 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 \"%s\"" % path.replace("\"", "\\\""))
+
+ if ret:
+ bb.error("split_and_strip_files: 'file %s' failed" % path)
+ 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
+
+
+ elffiles = {}
+ inodes = {}
+ libdir = os.path.abspath(dvar + os.sep + d.getVar("libdir", True))
+ baselibdir = os.path.abspath(dvar + os.sep + d.getVar("base_libdir", True))
+ if (d.getVar('INHIBIT_SYSROOT_STRIP', True) != '1'):
+ #
+ # First lets figure out all of the files we may have to process
+ #
+ for root, dirs, files in os.walk(dvar):
+ for f in files:
+ file = os.path.join(root, f)
+
+ try:
+ ltarget = oe.path.realpath(file, dvar, 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] & 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):
+ # 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 = isELF(file)
+ if elf_file & 1:
+ if elf_file & 2:
+ if 'already-stripped' in (d.getVar('INSANE_SKIP_' + pn, True) or "").split():
+ bb.note("Skipping file %s from %s for already-stripped QA test" % (file[len(dvar):], pn))
+ else:
+ bb.warn("File '%s' from %s was already stripped, this will prevent future debugging!" % (file[len(dvar):], pn))
+ continue
+
+ if s.st_ino in inodes:
+ os.unlink(file)
+ os.link(inodes[s.st_ino], file)
+ else:
+ inodes[s.st_ino] = file
+ # break hardlink
+ bb.utils.copyfile(file, file)
+ elffiles[file] = elf_file
+
+ #
+ # Now strip them (in parallel)
+ #
+ strip = d.getVar("STRIP", True)
+ sfiles = []
+ for file in elffiles:
+ elf_file = int(elffiles[file])
+ #bb.note("Strip %s" % file)
+ sfiles.append((file, elf_file, strip))
+
+ oe.utils.multiprocess_exec(sfiles, oe.package.runstrip)
+}
+
+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"
+SYSROOT_LOCK = "${STAGING_DIR}/staging.lock"
+
+# We clean out any existing sstate from the sysroot if we rerun configure
+python sysroot_cleansstate () {
+ ss = sstate_state_fromvars(d, "populate_sysroot")
+ sstate_clean(ss, d)
+}
+do_configure[prefuncs] += "sysroot_cleansstate"
+
+
+BB_SETSCENE_VERIFY_FUNCTION = "sysroot_checkhashes"
+
+def sysroot_checkhashes(covered, tasknames, fnids, fns, d, invalidtasks = None):
+ problems = set()
+ configurefnids = set()
+ if not invalidtasks:
+ invalidtasks = xrange(len(tasknames))
+ for task in invalidtasks:
+ if tasknames[task] == "do_configure" and task not in covered:
+ configurefnids.add(fnids[task])
+ for task in covered:
+ if tasknames[task] == "do_populate_sysroot" and fnids[task] in configurefnids:
+ problems.add(task)
+ return problems
+
+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', True) or '').split():
+ bb.build.exec_func(f, d)
+ pn = d.getVar("PN", True)
+ multiprov = d.getVar("MULTI_PROVIDER_WHITELIST", True).split()
+ provdir = d.expand("${SYSROOT_DESTDIR}${base_prefix}/sysroot-providers/")
+ bb.utils.mkdirhier(provdir)
+ for p in d.getVar("PROVIDES", True).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"
+
+SSTATETASKS += "do_populate_sysroot"
+do_populate_sysroot[cleandirs] = "${SYSROOT_DESTDIR}"
+do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}"
+do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_HOST}/"
+do_populate_sysroot[stamp-extra-info] = "${MACHINE}"
+
+python do_populate_sysroot_setscene () {
+ sstate_setscene(d)
+}
+addtask do_populate_sysroot_setscene
+
+
diff --git a/import-layers/yocto-poky/meta/classes/syslinux.bbclass b/import-layers/yocto-poky/meta/classes/syslinux.bbclass
new file mode 100644
index 000000000..4fcb0c5e7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/syslinux.bbclass
@@ -0,0 +1,192 @@
+# 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_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 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
+}
+
+syslinux_hdddirect_install() {
+ DEST=$1
+ syslinux $DEST
+}
+
+python build_syslinux_cfg () {
+ import copy
+ import sys
+
+ workdir = d.getVar('WORKDIR', True)
+ if not workdir:
+ bb.error("WORKDIR not defined, unable to package")
+ return
+
+ labels = d.getVar('LABELS', True)
+ 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', True)
+ if not cfile:
+ raise bb.build.FuncFailed('Unable to read SYSLINUX_CFG')
+
+ try:
+ cfgfile = file(cfile, 'w')
+ except OSError:
+ raise bb.build.funcFailed('Unable to open %s' % (cfile))
+
+ cfgfile.write('# Automatically created by OE\n')
+
+ opts = d.getVar('SYSLINUX_OPTS', True)
+
+ if opts:
+ for opt in opts.split(';'):
+ cfgfile.write('%s\n' % opt)
+
+ cfgfile.write('ALLOWOPTIONS 1\n');
+ syslinux_default_console = d.getVar('SYSLINUX_DEFAULT_CONSOLE', True)
+ syslinux_serial_tty = d.getVar('SYSLINUX_SERIAL_TTY', True)
+ syslinux_serial = d.getVar('SYSLINUX_SERIAL', True)
+ if syslinux_serial:
+ cfgfile.write('SERIAL %s\n' % syslinux_serial)
+
+ menu = (d.getVar('AUTO_SYSLINUXMENU', True) == "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', True)
+
+ if timeout:
+ cfgfile.write('TIMEOUT %s\n' % timeout)
+ else:
+ cfgfile.write('TIMEOUT 50\n')
+
+ prompt = d.getVar('SYSLINUX_PROMPT', True)
+ 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', True)
+ if splash:
+ cfgfile.write('menu background splash.lss\n')
+
+ for label in labels.split():
+ localdata = bb.data.createCopy(d)
+
+ overrides = localdata.getVar('OVERRIDES', True)
+ if not overrides:
+ raise bb.build.FuncFailed('OVERRIDES not defined')
+
+ localdata.setVar('OVERRIDES', label + ':' + overrides)
+ bb.data.update_data(localdata)
+
+ 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', True)
+ if not root:
+ raise bb.build.FuncFailed('SYSLINUX_ROOT not defined')
+
+ for btype in btypes:
+ cfgfile.write('LABEL %s%s\nKERNEL /vmlinuz\n' % (btype[0], label))
+
+ exargs = d.getVar('SYSLINUX_KERNEL_ARGS', True)
+ if exargs:
+ btype[1] += " " + exargs
+
+ append = localdata.getVar('APPEND', True)
+ initrd = localdata.getVar('INITRD', True)
+
+ 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()
+}
diff --git a/import-layers/yocto-poky/meta/classes/systemd.bbclass b/import-layers/yocto-poky/meta/classes/systemd.bbclass
new file mode 100644
index 000000000..db7873fbe
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/systemd.bbclass
@@ -0,0 +1,207 @@
+# 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")
+ 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
+ systemctl $OPTS ${SYSTEMD_AUTO_ENABLE} ${SYSTEMD_SERVICE}
+
+ if [ -z "$D" -a "${SYSTEMD_AUTO_ENABLE}" = "enable" ]; then
+ systemctl 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), True) or "").strip()
+ if val == "":
+ val = (d.getVar(var, True) or "").strip()
+ return val
+
+ # Check if systemd-packages already included in PACKAGES
+ def systemd_check_package(pkg_systemd):
+ packages = d.getVar('PACKAGES', True)
+ 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 + ":")
+ bb.data.update_data(localdata)
+
+ postinst = d.getVar('pkg_postinst_%s' % pkg, True)
+ if not postinst:
+ postinst = '#!/bin/sh\n'
+ postinst += localdata.getVar('systemd_postinst', True)
+ d.setVar('pkg_postinst_%s' % pkg, postinst)
+
+ prerm = d.getVar('pkg_prerm_%s' % pkg, True)
+ if not prerm:
+ prerm = '#!/bin/sh\n'
+ prerm += localdata.getVar('systemd_prerm', True)
+ 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", True), 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", True), 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", True), "systemd", "system"),]
+ searchpaths.append(d.getVar("systemd_system_unitdir", True))
+ systemd_packages = d.getVar('SYSTEMD_PACKAGES', True)
+
+ 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
+ if service.find('@') != -1:
+ base = re.sub('@[^.]+.', '@.', service)
+
+ for path in searchpaths:
+ if os.path.exists(oe.path.join(d.getVar("D", True), path, service)):
+ path_found = path
+ break
+ elif base is not None:
+ if os.path.exists(oe.path.join(d.getVar("D", True), path, base)):
+ path_found = path
+ break
+
+ if path_found != '':
+ systemd_add_files_and_parse(pkg_systemd, path_found, service, keys)
+ else:
+ raise bb.build.FuncFailed("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", True)):
+ for pkg in d.getVar('SYSTEMD_PACKAGES', True).split():
+ systemd_check_package(pkg)
+ if d.getVar('SYSTEMD_SERVICE_' + pkg, True):
+ 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", True), d.getVar('systemd_unitdir', True))
+ 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", True), (d.getVar('INIT_D_DIR', True) 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", True), d.getVar('systemd_system_unitdir', True))
+
+ # 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/import-layers/yocto-poky/meta/classes/terminal.bbclass b/import-layers/yocto-poky/meta/classes/terminal.bbclass
new file mode 100644
index 000000000..9f4c24e90
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/terminal.bbclass
@@ -0,0 +1,96 @@
+OE_TERMINAL ?= 'auto'
+OE_TERMINAL[type] = 'choice'
+OE_TERMINAL[choices] = 'auto none \
+ ${@oe_terminal_prioritized()}'
+
+OE_TERMINAL_EXPORTS += 'EXTRA_OEMAKE'
+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', True) 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', True), 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, 0755)
+
+ 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, True)
+ 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, True)
+ if value is not None:
+ os.environ[key] = str(value)
+ envdata.setVar(key, str(value))
+ envdata.setVarFlag(key, 'export', '1')
+
+ # 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:
+ bb.fatal('No valid terminal found, unable to open devshell')
+ except oe.terminal.ExecutionError as exc:
+ bb.fatal('Unable to spawn terminal %s: %s' % (terminal, exc))
+
+oe_terminal[vardepsexclude] = "BB_ORIGENV"
diff --git a/import-layers/yocto-poky/meta/classes/testimage-auto.bbclass b/import-layers/yocto-poky/meta/classes/testimage-auto.bbclass
new file mode 100644
index 000000000..e0a22b773
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/classes/testimage.bbclass b/import-layers/yocto-poky/meta/classes/testimage.bbclass
new file mode 100644
index 000000000..e77bb1192
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/testimage.bbclass
@@ -0,0 +1,263 @@
+# 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 build a qemu core-image-sato
+# - add INHERIT += "testimage" in local.conf
+# - 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.
+# 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_EXPORT_ONLY ?= "0"
+
+RPMTESTSUITE = "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'smart rpm', '', d)}"
+MINTESTSUITE = "ping"
+NETTESTSUITE = "${MINTESTSUITE} ssh df date scp syslog"
+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"
+DEFAULT_TEST_SUITES_pn-core-image-x11 = "${MINTESTSUITE}"
+DEFAULT_TEST_SUITES_pn-core-image-lsb = "${NETTESTSUITE} pam parselogs ${RPMTESTSUITE}"
+DEFAULT_TEST_SUITES_pn-core-image-sato = "${NETTESTSUITE} connman xorg parselogs ${RPMTESTSUITE} \
+ ${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'python', '', d)}"
+DEFAULT_TEST_SUITES_pn-core-image-sato-sdk = "${NETTESTSUITE} connman xorg perl python \
+ ${DEVTESTSUITE} parselogs ${RPMTESTSUITE}"
+DEFAULT_TEST_SUITES_pn-core-image-lsb-dev = "${NETTESTSUITE} pam perl python parselogs ${RPMTESTSUITE}"
+DEFAULT_TEST_SUITES_pn-core-image-lsb-sdk = "${NETTESTSUITE} buildcvs buildiptables buildsudoku \
+ connman ${DEVTESTSUITE} pam perl python parselogs ${RPMTESTSUITE}"
+DEFAULT_TEST_SUITES_pn-meta-toolchain = "auto"
+
+# aarch64 has no graphics
+DEFAULT_TEST_SUITES_remove_aarch64 = "xorg"
+
+#qemumips is too slow for buildsudoku
+DEFAULT_TEST_SUITES_remove_qemumips = "buildsudoku"
+
+TEST_SUITES ?= "${DEFAULT_TEST_SUITES}"
+
+TEST_QEMUBOOT_TIMEOUT ?= "1000"
+TEST_TARGET ?= "qemu"
+TEST_TARGET_IP ?= ""
+TEST_SERVER_IP ?= ""
+
+TESTIMAGEDEPENDS = ""
+TESTIMAGEDEPENDS_qemuall = "qemu-native:do_populate_sysroot qemu-helper-native:do_populate_sysroot"
+
+TESTIMAGELOCK = "${TMPDIR}/testimage.lock"
+TESTIMAGELOCK_qemuall = ""
+
+TESTIMAGE_DUMP_DIR ?= "/tmp/oe-saved-tests/"
+
+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_main(d)
+}
+addtask testimage
+do_testimage[nostamp] = "1"
+do_testimage[depends] += "${TESTIMAGEDEPENDS}"
+do_testimage[lockfiles] += "${TESTIMAGELOCK}"
+
+def exportTests(d,tc):
+ import json
+ import shutil
+ import pkgutil
+ import re
+
+ exportpath = d.getVar("TEST_EXPORT_DIR", True)
+
+ savedata = {}
+ savedata["d"] = {}
+ savedata["target"] = {}
+ savedata["host_dumper"] = {}
+ for key in tc.__dict__:
+ # special cases
+ if key not in ['d', 'target', 'host_dumper', 'suite']:
+ savedata[key] = getattr(tc, key)
+ savedata["target"]["ip"] = tc.target.ip or d.getVar("TEST_TARGET_IP", True)
+ savedata["target"]["server_ip"] = tc.target.server_ip or d.getVar("TEST_SERVER_IP", True)
+
+ keys = [ key for key in d.keys() if not key.startswith("_") and not key.startswith("BB") \
+ and not key.startswith("B_pn") and not key.startswith("do_") and not d.getVarFlag(key, "func", True)]
+ for key in keys:
+ try:
+ savedata["d"][key] = d.getVar(key, True)
+ except bb.data_smart.ExpansionError:
+ # we don't care about those anyway
+ pass
+
+ savedata["host_dumper"]["parent_dir"] = tc.host_dumper.parent_dir
+ savedata["host_dumper"]["cmds"] = tc.host_dumper.cmds
+
+ json_file = os.path.join(exportpath, "testdata.json")
+ with open(json_file, "w") as f:
+ json.dump(savedata, f, skipkeys=True, indent=4, sort_keys=True)
+
+ # Replace absolute path with relative in the file
+ exclude_path = os.path.join(d.getVar("COREBASE", True),'meta','lib','oeqa')
+ f1 = open(json_file,'r').read()
+ f2 = open(json_file,'w')
+ m = f1.replace(exclude_path,'oeqa')
+ f2.write(m)
+ f2.close()
+
+ # now start copying files
+ # we'll basically copy everything under meta/lib/oeqa, with these exceptions
+ # - oeqa/targetcontrol.py - not needed
+ # - oeqa/selftest - something else
+ # That means:
+ # - all tests from oeqa/runtime defined in TEST_SUITES (including from other layers)
+ # - the contents of oeqa/utils and oeqa/runtime/files
+ # - oeqa/oetest.py and oeqa/runexport.py (this will get copied to exportpath not exportpath/oeqa)
+ # - __init__.py files
+ bb.utils.mkdirhier(os.path.join(exportpath, "oeqa/runtime/files"))
+ bb.utils.mkdirhier(os.path.join(exportpath, "oeqa/utils"))
+ # copy test modules, this should cover tests in other layers too
+ bbpath = d.getVar("BBPATH", True).split(':')
+ for t in tc.testslist:
+ isfolder = False
+ if re.search("\w+\.\w+\.test_\S+", t):
+ t = '.'.join(t.split('.')[:3])
+ mod = pkgutil.get_loader(t)
+ # More depth than usual?
+ if (t.count('.') > 2):
+ for p in bbpath:
+ foldername = os.path.join(p, 'lib', os.sep.join(t.split('.')).rsplit(os.sep, 1)[0])
+ if os.path.isdir(foldername):
+ isfolder = True
+ target_folder = os.path.join(exportpath, "oeqa", "runtime", os.path.basename(foldername))
+ if not os.path.exists(target_folder):
+ shutil.copytree(foldername, target_folder)
+ if not isfolder:
+ shutil.copy2(mod.filename, os.path.join(exportpath, "oeqa/runtime"))
+ # copy __init__.py files
+ oeqadir = pkgutil.get_loader("oeqa").filename
+ shutil.copy2(os.path.join(oeqadir, "__init__.py"), os.path.join(exportpath, "oeqa"))
+ shutil.copy2(os.path.join(oeqadir, "runtime/__init__.py"), os.path.join(exportpath, "oeqa/runtime"))
+ # copy oeqa/oetest.py and oeqa/runexported.py
+ shutil.copy2(os.path.join(oeqadir, "oetest.py"), os.path.join(exportpath, "oeqa"))
+ shutil.copy2(os.path.join(oeqadir, "runexported.py"), exportpath)
+ # copy oeqa/utils/*.py
+ for root, dirs, files in os.walk(os.path.join(oeqadir, "utils")):
+ for f in files:
+ if f.endswith(".py"):
+ shutil.copy2(os.path.join(root, f), os.path.join(exportpath, "oeqa/utils"))
+ # copy oeqa/runtime/files/*
+ for root, dirs, files in os.walk(os.path.join(oeqadir, "runtime/files")):
+ for f in files:
+ shutil.copy2(os.path.join(root, f), os.path.join(exportpath, "oeqa/runtime/files"))
+
+ bb.plain("Exported tests to: %s" % exportpath)
+
+def testimage_main(d):
+ import unittest
+ import os
+ import oeqa.runtime
+ import time
+ import signal
+ from oeqa.oetest import ImageTestContext
+ from oeqa.targetcontrol import get_target_controller
+ from oeqa.utils.dump import get_host_dumper
+
+ pn = d.getVar("PN", True)
+ export = oe.utils.conditional("TEST_EXPORT_ONLY", "1", True, False, d)
+ bb.utils.mkdirhier(d.getVar("TEST_LOG_DIR", True))
+ if export:
+ bb.utils.remove(d.getVar("TEST_EXPORT_DIR", True), recurse=True)
+ bb.utils.mkdirhier(d.getVar("TEST_EXPORT_DIR", True))
+
+ # we need the host dumper in test context
+ host_dumper = get_host_dumper(d)
+
+ # the robot dance
+ target = get_target_controller(d)
+
+ # test context
+ tc = ImageTestContext(d, target, host_dumper)
+
+ # this is a dummy load of tests
+ # we are doing that to find compile errors in the tests themselves
+ # before booting the image
+ try:
+ tc.loadTests()
+ except Exception as e:
+ import traceback
+ bb.fatal("Loading tests failed:\n%s" % traceback.format_exc())
+
+ if export:
+ signal.signal(signal.SIGTERM, tc.origsigtermhandler)
+ tc.origsigtermhandler = None
+ exportTests(d,tc)
+ else:
+ target.deploy()
+ try:
+ target.start()
+ starttime = time.time()
+ result = tc.runTests()
+ stoptime = time.time()
+ if result.wasSuccessful():
+ bb.plain("%s - Ran %d test%s in %.3fs" % (pn, result.testsRun, result.testsRun != 1 and "s" or "", stoptime - starttime))
+ msg = "%s - OK - All required tests passed" % pn
+ skipped = len(result.skipped)
+ if skipped:
+ msg += " (skipped=%d)" % skipped
+ bb.plain(msg)
+ else:
+ raise bb.build.FuncFailed("%s - FAILED - check the task log and the ssh log" % pn )
+ finally:
+ signal.signal(signal.SIGTERM, tc.origsigtermhandler)
+ target.stop()
+
+testimage_main[vardepsexclude] =+ "BB_ORIGENV"
+
+inherit testsdk
diff --git a/import-layers/yocto-poky/meta/classes/testsdk.bbclass b/import-layers/yocto-poky/meta/classes/testsdk.bbclass
new file mode 100644
index 000000000..f4dc2c36d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/testsdk.bbclass
@@ -0,0 +1,142 @@
+# Copyright (C) 2013 - 2016 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# testsdk.bbclass enables testing for SDK and Extensible SDK
+#
+# For run SDK tests you need to do,
+# - bitbake core-image-sato -c populate_sdk
+# - bitbake core-image-sato -c testsdk
+#
+# For run eSDK tests you need to do,
+# - bitbake core-image-sato -c populate_sdk_ext
+# - bitbake core-image-sato -c testsdkext
+
+TEST_LOG_DIR ?= "${WORKDIR}/testimage"
+TESTSDKLOCK = "${TMPDIR}/testsdk.lock"
+
+def run_test_context(CTestContext, d, testdir, tcname, pn, *args):
+ import glob
+ import time
+
+ targets = glob.glob(d.expand(testdir + "/tc/environment-setup-*"))
+ for sdkenv in targets:
+ bb.plain("Testing %s" % sdkenv)
+ tc = CTestContext(d, testdir, sdkenv, tcname, args)
+
+ # this is a dummy load of tests
+ # we are doing that to find compile errors in the tests themselves
+ # before booting the image
+ try:
+ tc.loadTests()
+ except Exception as e:
+ import traceback
+ bb.fatal("Loading tests failed:\n%s" % traceback.format_exc())
+
+ starttime = time.time()
+ result = tc.runTests()
+ stoptime = time.time()
+ if result.wasSuccessful():
+ bb.plain("%s SDK(%s):%s - Ran %d test%s in %.3fs" % (pn, os.path.basename(tcname), os.path.basename(sdkenv),result.testsRun, result.testsRun != 1 and "s" or "", stoptime - starttime))
+ msg = "%s - OK - All required tests passed" % pn
+ skipped = len(result.skipped)
+ if skipped:
+ msg += " (skipped=%d)" % skipped
+ bb.plain(msg)
+ else:
+ raise bb.build.FuncFailed("%s - FAILED - check the task log and the commands log" % pn )
+
+def testsdk_main(d):
+ import os
+ import oeqa.sdk
+ import subprocess
+ from oeqa.oetest import SDKTestContext
+
+ pn = d.getVar("PN", True)
+ bb.utils.mkdirhier(d.getVar("TEST_LOG_DIR", True))
+
+ tcname = d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh")
+ if not os.path.exists(tcname):
+ bb.fatal("The toolchain is not built. Build it before running the tests: 'bitbake <image> -c populate_sdk' .")
+
+ sdktestdir = d.expand("${WORKDIR}/testimage-sdk/")
+ bb.utils.remove(sdktestdir, True)
+ bb.utils.mkdirhier(sdktestdir)
+ try:
+ subprocess.check_output("cd %s; %s <<EOF\n./tc\nY\nEOF" % (sdktestdir, tcname), shell=True)
+ except subprocess.CalledProcessError as e:
+ bb.fatal("Couldn't install the SDK:\n%s" % e.output)
+
+ try:
+ run_test_context(SDKTestContext, d, sdktestdir, tcname, pn)
+ finally:
+ bb.utils.remove(sdktestdir, True)
+
+testsdk_main[vardepsexclude] =+ "BB_ORIGENV"
+
+python do_testsdk() {
+ testsdk_main(d)
+}
+addtask testsdk
+do_testsdk[nostamp] = "1"
+do_testsdk[lockfiles] += "${TESTSDKLOCK}"
+
+TEST_LOG_SDKEXT_DIR ?= "${WORKDIR}/testsdkext"
+TESTSDKEXTLOCK = "${TMPDIR}/testsdkext.lock"
+
+def testsdkext_main(d):
+ import os
+ import oeqa.sdkext
+ import subprocess
+ from bb.utils import export_proxies
+ from oeqa.oetest import SDKTestContext, SDKExtTestContext
+ from oeqa.utils import avoid_paths_in_environ
+
+
+ # extensible sdk use network
+ export_proxies(d)
+
+ # 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', True),
+ d.getVar('BASE_WORKDIR', True)]
+ os.environ['PATH'] = avoid_paths_in_environ(paths_to_avoid)
+
+ pn = d.getVar("PN", True)
+ bb.utils.mkdirhier(d.getVar("TEST_LOG_SDKEXT_DIR", True))
+
+ tcname = d.expand("${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.sh")
+ if not os.path.exists(tcname):
+ bb.fatal("The toolchain ext is not built. Build it before running the" \
+ " tests: 'bitbake <image> -c populate_sdk_ext' .")
+
+ testdir = d.expand("${WORKDIR}/testsdkext/")
+ bb.utils.remove(testdir, True)
+ bb.utils.mkdirhier(testdir)
+ try:
+ subprocess.check_output("%s -y -d %s/tc" % (tcname, testdir), shell=True)
+ except subprocess.CalledProcessError as e:
+ bb.fatal("Couldn't install the SDK EXT:\n%s" % e.output)
+
+ try:
+ bb.plain("Running SDK Compatibility tests ...")
+ run_test_context(SDKExtTestContext, d, testdir, tcname, pn, True)
+ finally:
+ pass
+
+ try:
+ bb.plain("Running Extensible SDK tests ...")
+ run_test_context(SDKExtTestContext, d, testdir, tcname, pn)
+ finally:
+ pass
+
+ bb.utils.remove(testdir, True)
+
+testsdkext_main[vardepsexclude] =+ "BB_ORIGENV"
+
+python do_testsdkext() {
+ testsdkext_main(d)
+}
+addtask testsdkext
+do_testsdkext[nostamp] = "1"
+do_testsdkext[lockfiles] += "${TESTSDKEXTLOCK}"
diff --git a/import-layers/yocto-poky/meta/classes/texinfo.bbclass b/import-layers/yocto-poky/meta/classes/texinfo.bbclass
new file mode 100644
index 000000000..92efbccdd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/texinfo.bbclass
@@ -0,0 +1,15 @@
+# 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 shipped with yoco, 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:"
+
diff --git a/import-layers/yocto-poky/meta/classes/tinderclient.bbclass b/import-layers/yocto-poky/meta/classes/tinderclient.bbclass
new file mode 100644
index 000000000..2bc75fc65
--- /dev/null
+++ b/import-layers/yocto-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', True),
+ "machine_name" : d.getVar('TINDER_MACHINE', True),
+ "os" : os.uname()[0],
+ "os_version" : os.uname()[2],
+ "compiler" : "gcc",
+ "clobber" : d.getVar('TINDER_CLOBBER', True) or "0",
+ "srcdate" : d.getVar('SRCDATE', True),
+ "PN" : d.getVar('PN', True),
+ "PV" : d.getVar('PV', True),
+ "PR" : d.getVar('PR', True),
+ "FILE" : d.getVar('FILE', True) or "N/A",
+ "TARGETARCH" : d.getVar('TARGET_ARCH', True),
+ "TARGETFPU" : d.getVar('TARGET_FPU', True) or "Unknown",
+ "TARGETOS" : d.getVar('TARGET_OS', True) or "Unknown",
+ "MACHINE" : d.getVar('MACHINE', True) or "Unknown",
+ "DISTRO" : d.getVar('DISTRO', True) 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 = file(d.getVar('TMPDIR',True)+'/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', True )
+ url = d.getVar('TINDER_URL', True )
+
+ 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 = file(d.getVar('TMPDIR', True)+"/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', True)
+ url = d.getVar('TINDER_URL', True)
+
+ 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' , True )
+ tree = d.getVar( 'TINDER_TREE', True )
+ branch = d.getVar( 'TINDER_BRANCH', True )
+ srcdate = d.getVar( 'SRCDATE', True )
+ machine = d.getVar( 'MACHINE', True )
+ distro = d.getVar( 'DISTRO', True )
+ bbfiles = d.getVar( 'BBFILES', True )
+ tarch = d.getVar( 'TARGET_ARCH', True )
+ fpu = d.getVar( 'TARGET_FPU', True )
+ oerev = d.getVar( 'OE_REVISION', True ) 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 = file(event.data.getVar('TINDER_LOG', True), 'w')
+ f.write("")
+ f.close()
+ except:
+ pass
+
+ try:
+ # write a status to the file. This is needed for the -k option
+ # of BitBake
+ g = file(event.data.getVar('TMPDIR', True)+"/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', True), event.task))
+
+ if len(log_file) != 0:
+ to_file = event.data.getVar('TINDER_LOG', True)
+ 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', True)
+ elif name == "PkgSucceeded":
+ log += "<--- TINDERBOX Package %s done (SUCCESS)\n" % event.data.getVar('PF', True)
+ elif name == "PkgFailed":
+ if not event.data.getVar('TINDER_AUTOBUILD', True) == "0":
+ build.exec_task('do_clean', event.data)
+ log += "<--- TINDERBOX Package %s failed (FAILURE)\n" % event.data.getVar('PF', True)
+ status = 200
+ # remember the failure for the -k case
+ h = file(event.data.getVar('TMPDIR', True)+"/tinder-status", 'w')
+ h.write("200")
+ elif name == "BuildCompleted":
+ log += "Build Completed\n"
+ status = 100
+ # Check if we have a old status...
+ try:
+ h = file(event.data.getVar('TMPDIR',True)+'/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 = file(event.data.getVar('TMPDIR', True)+"/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', True)
+ if do_tinder_report and do_tinder_report == "1":
+ tinder_do_tinder_report(e)
+
+ return
+}
diff --git a/import-layers/yocto-poky/meta/classes/toaster.bbclass b/import-layers/yocto-poky/meta/classes/toaster.bbclass
new file mode 100644
index 000000000..1a70f14a9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/toaster.bbclass
@@ -0,0 +1,397 @@
+#
+# 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.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", True)
+
+ 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', True):
+ return
+
+ pkgdatadir = d.getVar('PKGDESTWORK', True)
+ 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_image_dumpdata() {
+ """
+ Image filename for output images is not standardized.
+ image_types.bbclass will spell out IMAGE_CMD_xxx variables that actually
+ have hardcoded ways to create image file names in them.
+ So we look for files starting with the set name.
+
+ We also look for other files in the images/ directory which don't
+ match IMAGE_NAME, such as the kernel bzImage, modules tarball etc.
+ """
+
+ dir_to_walk = d.getVar('DEPLOY_DIR_IMAGE', True);
+ image_name = d.getVar('IMAGE_NAME', True);
+ image_info_data = {}
+ artifact_info_data = {}
+
+ # collect all images and artifacts in the images directory
+ for dirpath, dirnames, filenames in os.walk(dir_to_walk):
+ for filename in filenames:
+ full_path = os.path.join(dirpath, filename)
+ try:
+ if filename.startswith(image_name):
+ # image
+ image_info_data[full_path] = os.stat(full_path).st_size
+ else:
+ # other non-image artifact
+ if not os.path.islink(full_path):
+ artifact_info_data[full_path] = os.stat(full_path).st_size
+ except OSError as e:
+ bb.event.fire(bb.event.MetadataEvent("OSErrorException", e), d)
+
+ bb.event.fire(bb.event.MetadataEvent("ImageFileSize", image_info_data), d)
+ bb.event.fire(bb.event.MetadataEvent("ArtifactFileSize", artifact_info_data), d)
+}
+
+python toaster_artifact_dumpdata() {
+ """
+ Dump data about artifacts in the SDK_DEPLOY directory
+ """
+
+ dir_to_walk = d.getVar("SDK_DEPLOY", True)
+ artifact_info_data = {}
+
+ # collect all artifacts in the sdk directory
+ for dirpath, dirnames, filenames in os.walk(dir_to_walk):
+ for filename in filenames:
+ full_path = os.path.join(dirpath, filename)
+ try:
+ if not os.path.islink(full_path):
+ artifact_info_data[full_path] = os.stat(full_path).st_size
+ except OSError as e:
+ bb.event.fire(bb.event.MetadataEvent("OSErrorException", e), d)
+
+ bb.event.fire(bb.event.MetadataEvent("ArtifactFileSize", artifact_info_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
+
+ toaster_statlist_file = os.path.join(e.data.getVar('BUILDSTATS_BASE', True), "toasterstatlist")
+
+ if not e.data.getVar('BUILDSTATS_BASE', True):
+ return # if we don't have buildstats, we cannot collect stats
+
+ 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", True)
+
+
+ # 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, px = line.split("\t")
+ punit, pname = px.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' -> ')
+ dot = re.compile(r'.*style=dotted')
+ for line in fin:
+ line = line.rstrip(';')
+ linesplit = p.split(line)
+ if len(linesplit) == 2:
+ pname = linesplit[0].rstrip('"').strip('"')
+ dependsname = linesplit[1].split(" ")[0].strip().strip(";").strip('"').rstrip('"')
+ deptype = "depends"
+ if dot.match(line):
+ deptype = "recommends"
+ 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))
+
+ with open("%s/files-in-image.txt" % installed_img_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)
+
+}
+
+# dump information related to license manifest path
+
+python toaster_licensemanifest_dump() {
+ deploy_dir = d.getVar('DEPLOY_DIR', True);
+ image_name = d.getVar('IMAGE_NAME', True);
+
+ data = { 'deploy_dir' : deploy_dir, 'image_name' : image_name }
+
+ bb.event.fire(bb.event.MetadataEvent("LicenseManifestPath", data), d)
+}
+
+# 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"
+
+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_image_complete[postfuncs] += "toaster_image_dumpdata "
+do_image_complete[vardepsexclude] += "toaster_image_dumpdata "
+
+do_rootfs[postfuncs] += "toaster_licensemanifest_dump "
+do_rootfs[vardepsexclude] += "toaster_licensemanifest_dump "
+
+do_populate_sdk[postfuncs] += "toaster_artifact_dumpdata "
+do_populate_sdk[vardepsexclude] += "toaster_artifact_dumpdata "
diff --git a/import-layers/yocto-poky/meta/classes/toolchain-scripts.bbclass b/import-layers/yocto-poky/meta/classes/toolchain-scripts.bbclass
new file mode 100644
index 000000000..2e2c93af4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/toolchain-scripts.bbclass
@@ -0,0 +1,157 @@
+inherit 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-uclibc = " -muclibc"
+TARGET_CC_ARCH_append_libc-musl = " -mmusl"
+
+# This function creates an environment-setup-script for use in a deployable SDK
+toolchain_create_sdk_env_script () {
+ # Create environment setup script
+ 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 '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 CCACHE_PATH=$sdkpathnative$bindir:$sdkpathnative$bindir/../${HOST_SYS}/bin:$sdkpathnative$bindir/${TARGET_SYS}"$EXTRAPATH':$CCACHE_PATH' >> $script
+ echo 'export PKG_CONFIG_SYSROOT_DIR=$SDKTARGETSYSROOT' >> $script
+ echo 'export PKG_CONFIG_PATH=$SDKTARGETSYSROOT'"$libdir"'/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 'export PATH=${STAGING_DIR_NATIVE}/usr/bin:${PATH}' >> $script
+ echo 'export CCACHE_PATH=${STAGING_DIR_NATIVE}/usr/bin:${CCACHE_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
+ source \$envfile
+ done
+fi
+if [ -d "\$OECORE_NATIVE_SYSROOT/environment-setup.d" ]; then
+ for envfile in \$OECORE_NATIVE_SYSROOT/environment-setup.d/*.sh; do
+ source \$envfile
+ done
+fi
+EOF
+}
+
+#we get the cached site config in the runtime
+TOOLCHAIN_CONFIGSITE_NOCACHE = "${@siteinfo_get_files(d, True)}"
+TOOLCHAIN_CONFIGSITE_SYSROOTCACHE = "${STAGING_DIR}/${MLPREFIX}${MACHINE}/${target_datadir}/${TARGET_SYS}_config_site.d"
+TOOLCHAIN_NEED_CONFIGSITE_CACHE ??= "virtual/${MLPREFIX}libc ncurses"
+
+#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"
+
+#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"
+
+python __anonymous () {
+ import oe.classextend
+ deps = ""
+ for dep in (d.getVar('TOOLCHAIN_NEED_CONFIGSITE_CACHE', True) or "").split():
+ deps += " %s:do_populate_sysroot" % dep
+ for variant in (d.getVar('MULTILIB_VARIANTS', True) 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/import-layers/yocto-poky/meta/classes/typecheck.bbclass b/import-layers/yocto-poky/meta/classes/typecheck.bbclass
new file mode 100644
index 000000000..6bff7c713
--- /dev/null
+++ b/import-layers/yocto-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", True):
+ oe.data.typed_value(key, e.data)
+}
+addhandler check_types
+check_types[eventmask] = "bb.event.ConfigParsed"
diff --git a/import-layers/yocto-poky/meta/classes/uboot-config.bbclass b/import-layers/yocto-poky/meta/classes/uboot-config.bbclass
new file mode 100644
index 000000000..cb061af34
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/uboot-config.bbclass
@@ -0,0 +1,49 @@
+# Handle U-Boot config for a machine
+#
+# The format to specify it, in the machine, is:
+#
+# UBOOT_CONFIG ??= <default>
+# UBOOT_CONFIG[foo] = "config,images"
+#
+# or
+#
+# UBOOT_MACHINE = "config"
+#
+# Copyright 2013, 2014 (C) O.S. Systems Software LTDA.
+
+python () {
+ ubootmachine = d.getVar("UBOOT_MACHINE", True)
+ ubootconfigflags = d.getVarFlags('UBOOT_CONFIG')
+ # The "doc" varflag is special, we don't want to see it here
+ ubootconfigflags.pop('doc', None)
+
+ if not ubootmachine and not ubootconfigflags:
+ PN = d.getVar("PN", True)
+ FILE = os.path.basename(d.getVar("FILE", True))
+ bb.debug(1, "To build %s, see %s for instructions on \
+ setting up your machine config" % (PN, FILE))
+ raise bb.parse.SkipPackage("Either UBOOT_MACHINE or UBOOT_CONFIG must be set in the %s machine configuration." % d.getVar("MACHINE", True))
+
+ if ubootmachine and ubootconfigflags:
+ raise bb.parse.SkipPackage("You cannot use UBOOT_MACHINE and UBOOT_CONFIG at the same time.")
+
+ if not ubootconfigflags:
+ return
+
+ ubootconfig = (d.getVar('UBOOT_CONFIG', True) or "").split()
+ 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) > 2:
+ raise bb.parse.SkipPackage('Only config,images 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])
+ break
+ elif len(ubootconfig) == 0:
+ raise bb.parse.SkipPackage('You must set a default in UBOOT_CONFIG.')
+}
diff --git a/import-layers/yocto-poky/meta/classes/uninative.bbclass b/import-layers/yocto-poky/meta/classes/uninative.bbclass
new file mode 100644
index 000000000..89cec07d7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/uninative.bbclass
@@ -0,0 +1,140 @@
+UNINATIVE_LOADER ?= "${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_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/"
+
+# https://wiki.debian.org/GCC5
+# We may see binaries built with gcc5 run or linked into gcc4 environment
+# so use the older libstdc++ standard for now until we don't support gcc4
+# on the host system.
+BUILD_CXXFLAGS_append = " -D_GLIBCXX_USE_CXX11_ABI=0"
+
+#
+# icu configure defaults to CXX11 if no -std= option is passed in CXXFLAGS
+# therefore pass one
+BUILD_CXXFLAGS_append_pn-icu-native = " -std=c++98"
+
+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", True), True)
+ if not chksum:
+ bb.fatal("Uninative selected but not configured correctly, please set UNINATIVE_CHECKSUM[%s]" % d.getVar("BUILD_ARCH", True))
+
+ loader = d.getVar("UNINATIVE_LOADER", True)
+ 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", True)
+ tarballdir = os.path.join(d.getVar("UNINATIVE_DLDIR", True), chksum)
+ tarballpath = os.path.join(tarballdir, tarball)
+
+ if not os.path.exists(tarballpath):
+ bb.utils.mkdirhier(tarballdir)
+ if d.getVar("UNINATIVE_URL", True) == "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)
+
+ 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):
+ os.symlink(localpath, tarballpath)
+
+ cmd = d.expand("mkdir -p ${STAGING_DIR}-uninative; cd ${STAGING_DIR}-uninative; tar -xjf ${UNINATIVE_DLDIR}/%s/${UNINATIVE_TARBALL}; ${STAGING_DIR}-uninative/relocate_sdk.py ${STAGING_DIR}-uninative/${BUILD_ARCH}-linux ${UNINATIVE_LOADER} ${UNINATIVE_LOADER} ${STAGING_DIR}-uninative/${BUILD_ARCH}-linux/${bindir_native}/patchelf-uninative ${STAGING_DIR}-uninative/${BUILD_ARCH}-linux${base_libdir_native}/libc*.so" % chksum)
+ subprocess.check_call(cmd, shell=True)
+
+ with open(loaderchksum, "w") as f:
+ f.write(chksum)
+
+ enable_uninative(d)
+
+ 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", True)
+ if os.path.exists(loader):
+ bb.debug(2, "Enabling uninative")
+ d.setVar("NATIVELSBSTRING", "universal")
+ d.appendVar("SSTATEPOSTUNPACKFUNCS", " uninative_changeinterp")
+ 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', True)
+ 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
+
+ try:
+ subprocess.check_output(("patchelf-uninative", "--set-interpreter",
+ d.getVar("UNINATIVE_LOADER", True), f),
+ stderr=subprocess.STDOUT)
+ except subprocess.CalledProcessError as e:
+ bb.fatal("'%s' failed with exit code %d and the following output:\n%s" %
+ (e.cmd, e.returncode, e.output))
+}
diff --git a/import-layers/yocto-poky/meta/classes/update-alternatives.bbclass b/import-layers/yocto-poky/meta/classes/update-alternatives.bbclass
new file mode 100644
index 000000000..70a818572
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/update-alternatives.bbclass
@@ -0,0 +1,267 @@
+# 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"
+
+def gen_updatealternativesvardeps(d):
+ pkgs = (d.getVar("PACKAGES", True) or "").split()
+ vars = (d.getVar("UPDALTVARS", True) or "").split()
+
+ # First compute them for non_pkg versions
+ for v in vars:
+ for flag in (d.getVarFlags(v) or {}):
+ 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 (d.getVarFlags("%s_%s" % (v,p)) or {}):
+ 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', True):
+ 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
+
+ # 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", True) or "").split()
+ vars = (d.getVar("UPDALTVARS", True) 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', True)
+ if d.getVar('ALTERNATIVE_LINKS', True) != 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', True)
+ for pkg in (d.getVar('PACKAGES', True) 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, True) or "").split():
+ alt_link = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name, True)
+ if not alt_link:
+ alt_link = "%s/%s" % (d.getVar('bindir', True), alt_name)
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, alt_link)
+
+ alt_target = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name, True) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name, True)
+ alt_target = alt_target or d.getVar('ALTERNATIVE_TARGET_%s' % pkg, True) or d.getVar('ALTERNATIVE_TARGET', True) 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', True)
+
+ # Do actual update alternatives processing
+ pkgdest = d.getVar('PKGD', True)
+ for pkg in (d.getVar('PACKAGES', True) or "").split():
+ # Create post install/removal scripts
+ alt_setup_links = ""
+ alt_remove_links = ""
+ for alt_name in (d.getVar('ALTERNATIVE_%s' % pkg, True) or "").split():
+ alt_link = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name, True)
+ alt_target = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name, True) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name, True)
+ alt_target = alt_target or d.getVar('ALTERNATIVE_TARGET_%s' % pkg, True) or d.getVar('ALTERNATIVE_TARGET', True) 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, True) or d.getVarFlag('ALTERNATIVE_PRIORITY', alt_name, True)
+ alt_priority = alt_priority or d.getVar('ALTERNATIVE_PRIORITY_%s' % pkg, True) or d.getVar('ALTERNATIVE_PRIORITY', True)
+
+ # 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', True)
+ 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, True) 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, True) or '#!/bin/sh\n'
+ prerm += alt_remove_links
+ d.setVar('pkg_prerm_%s' % pkg, prerm)
+}
+
+python package_do_filedeps_append () {
+ pn = d.getVar('BPN', True)
+ pkgdest = d.getVar('PKGDEST', True)
+
+ for pkg in packages.split():
+ for alt_name in (d.getVar('ALTERNATIVE_%s' % pkg, True) or "").split():
+ alt_link = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name, True)
+ alt_target = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name, True) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name, True)
+ alt_target = alt_target or d.getVar('ALTERNATIVE_TARGET_%s' % pkg, True) or d.getVar('ALTERNATIVE_TARGET', True) 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, True) or ""):
+ d.appendVar('FILERPROVIDESFLIST_%s' % pkg, " " + trans_target)
+}
+
diff --git a/import-layers/yocto-poky/meta/classes/update-rc.d.bbclass b/import-layers/yocto-poky/meta/classes/update-rc.d.bbclass
new file mode 100644
index 000000000..2a0a74a5f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/update-rc.d.bbclass
@@ -0,0 +1,133 @@
+UPDATERCPN ?= "${PN}"
+
+DEPENDS_append_class-target = " update-rc.d-native update-rc.d initscripts"
+UPDATERCD = "update-rc.d"
+UPDATERCD_class-cross = ""
+UPDATERCD_class-native = ""
+UPDATERCD_class-nativesdk = ""
+
+INITSCRIPT_PARAMS ?= "defaults"
+
+INIT_D_DIR = "${sysconfdir}/init.d"
+
+updatercd_preinst() {
+if [ -z "$D" -a -f "${INIT_D_DIR}/${INITSCRIPT_NAME}" ]; then
+ ${INIT_D_DIR}/${INITSCRIPT_NAME} stop
+fi
+if 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
+}
+
+updatercd_postinst() {
+if 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 [ -z "$D" ]; then
+ ${INIT_D_DIR}/${INITSCRIPT_NAME} stop
+fi
+}
+
+updatercd_postrm() {
+if 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:
+ raise bb.build.FuncFailed("%s inherits update-rc.d but doesn't set INITSCRIPT_NAME" % d.getVar('FILE', False))
+ if d.getVar('INITSCRIPT_PARAMS', False) == None:
+ raise bb.build.FuncFailed("%s inherits update-rc.d but doesn't set INITSCRIPT_PARAMS" % d.getVar('FILE', False))
+
+python __anonymous() {
+ update_rc_after_parse(d)
+}
+
+PACKAGESPLITFUNCS_prepend = "populate_packages_updatercd "
+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', True) or ""
+ d.appendVar('RDEPENDS_' + pkg, ' %sinitscripts-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", True)
+ localdata.setVar("OVERRIDES", "%s:%s" % (pkg, overrides))
+ bb.data.update_data(localdata)
+
+ update_rcd_auto_depend(pkg)
+
+ preinst = d.getVar('pkg_preinst_%s' % pkg, True)
+ if not preinst:
+ preinst = '#!/bin/sh\n'
+ preinst += localdata.getVar('updatercd_preinst', True)
+ d.setVar('pkg_preinst_%s' % pkg, preinst)
+
+ postinst = d.getVar('pkg_postinst_%s' % pkg, True)
+ if not postinst:
+ postinst = '#!/bin/sh\n'
+ postinst += localdata.getVar('updatercd_postinst', True)
+ d.setVar('pkg_postinst_%s' % pkg, postinst)
+
+ prerm = d.getVar('pkg_prerm_%s' % pkg, True)
+ if not prerm:
+ prerm = '#!/bin/sh\n'
+ prerm += localdata.getVar('updatercd_prerm', True)
+ d.setVar('pkg_prerm_%s' % pkg, prerm)
+
+ postrm = d.getVar('pkg_postrm_%s' % pkg, True)
+ if not postrm:
+ postrm = '#!/bin/sh\n'
+ postrm += localdata.getVar('updatercd_postrm', True)
+ 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 bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d) or \
+ not d.getVar("INHIBIT_UPDATERCD_BBCLASS", True):
+ pkgs = d.getVar('INITSCRIPT_PACKAGES', True)
+ if pkgs == None:
+ pkgs = d.getVar('UPDATERCPN', True)
+ packages = (d.getVar('PACKAGES', True) or "").split()
+ if not pkgs in packages and packages != []:
+ pkgs = packages[0]
+ for pkg in pkgs.split():
+ update_rcd_package(pkg)
+}
diff --git a/import-layers/yocto-poky/meta/classes/upstream-version-is-even.bbclass b/import-layers/yocto-poky/meta/classes/upstream-version-is-even.bbclass
new file mode 100644
index 000000000..89556ed7d
--- /dev/null
+++ b/import-layers/yocto-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 = "(?P<pver>\d+\.(\d*[02468])+(\.\d+)+)"
diff --git a/import-layers/yocto-poky/meta/classes/useradd-staticids.bbclass b/import-layers/yocto-poky/meta/classes/useradd-staticids.bbclass
new file mode 100644
index 000000000..a9b506d05
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/useradd-staticids.bbclass
@@ -0,0 +1,302 @@
+# 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 argparse
+ import itertools
+ import re
+
+ class myArgumentParser( argparse.ArgumentParser ):
+ def _print_message(self, message, file=None):
+ bb.warn("%s - %s: %s" % (d.getVar('PN', True), 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', True), pkg))
+ error(message)
+
+ def error(self, message):
+ raise bb.build.FuncFailed(message)
+
+ 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():
+ if os.path.exists(conf):
+ f = open(conf, "r")
+ 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(itertools.imap(lambda x, y: x or y, fields, id_table[fields[0]]))
+
+ return id_table
+
+ # We parse and rewrite the useradd components
+ def rewrite_useradd(params):
+ # 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("-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 a list of configuration files based on either the default
+ # files/passwd or the contents of USERADD_UID_TABLES
+ # paths are resolved via BBPATH
+ def get_passwd_list(d):
+ str = ""
+ bbpath = d.getVar('BBPATH', True)
+ passwd_tables = d.getVar('USERADD_UID_TABLES', True)
+ if not passwd_tables:
+ passwd_tables = 'files/passwd'
+ for conf_file in passwd_tables.split():
+ str += " %s" % bb.utils.which(bbpath, conf_file)
+ return str
+
+ newparams = []
+ users = None
+ for param in re.split('''[ \t]*;[ \t]*(?=(?:[^'"]|'[^']*'|"[^"]*")*$)''', params):
+ param = param.strip()
+ if not param:
+ continue
+ try:
+ uaargs = parser.parse_args(re.split('''[ \t]*(?=(?:[^'"]|'[^']*'|"[^"]*")*$)''', param))
+ except:
+ raise bb.build.FuncFailed("%s: Unable to parse arguments for USERADD_PARAM_%s: '%s'" % (d.getVar('PN', True), 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:
+ users = merge_files(get_passwd_list(d), 7)
+
+ if uaargs.LOGIN not in users:
+ 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', True), 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.
+ #
+ user_group = uaargs.user_group is None or uaargs.user_group is True
+ uaargs.groupname = uaargs.LOGIN if user_group else uaargs.gid
+ uaargs.groupid = field[3] or uaargs.gid 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', True), uaargs.LOGIN, uaargs.groupid))
+
+ uaargs.gid = uaargs.groupid
+ uaargs.user_group = None
+ if newgroup:
+ groupadd = d.getVar("GROUPADD_PARAM_%s" % pkg, True)
+ if 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 d.getVar('USERADD_ERROR_DYNAMIC', True) == '1' and not ((uaargs.uid and uaargs.uid.isdigit()) and uaargs.gid):
+ #bb.error("Skipping recipe %s, package %s which adds username %s does not have a static uid defined." % (d.getVar('PN', True), pkg, uaargs.LOGIN))
+ raise bb.build.FuncFailed("%s - %s: Username %s does not have a static uid defined." % (d.getVar('PN', True), pkg, uaargs.LOGIN))
+
+ # 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 += ['', ' --expiredata %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]
+ newparam += ['', ' --password %s' % uaargs.password][uaargs.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):
+ # 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("-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 a list of configuration files based on either the default
+ # files/group or the contents of USERADD_GID_TABLES
+ # paths are resolved via BBPATH
+ def get_group_list(d):
+ str = ""
+ bbpath = d.getVar('BBPATH', True)
+ group_tables = d.getVar('USERADD_GID_TABLES', True)
+ if not group_tables:
+ group_tables = 'files/group'
+ for conf_file in group_tables.split():
+ str += " %s" % bb.utils.which(bbpath, conf_file)
+ return str
+
+ newparams = []
+ groups = None
+ for param in re.split('''[ \t]*;[ \t]*(?=(?:[^'"]|'[^']*'|"[^"]*")*$)''', params):
+ param = param.strip()
+ if not param:
+ continue
+ try:
+ # If we're processing multiple lines, we could have left over values here...
+ gaargs = parser.parse_args(re.split('''[ \t]*(?=(?:[^'"]|'[^']*'|"[^"]*")*$)''', param))
+ except:
+ raise bb.build.FuncFailed("%s: Unable to parse arguments for GROUPADD_PARAM_%s: '%s'" % (d.getVar('PN', True), 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:
+ groups = merge_files(get_group_list(d), 4)
+
+ if gaargs.GROUP not in groups:
+ 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', True), gaargs.GROUP, gaargs.gid, field[2]))
+ gaargs.gid = field[2]
+
+ if d.getVar('USERADD_ERROR_DYNAMIC', True) == '1' and not (gaargs.gid and gaargs.gid.isdigit()):
+ #bb.error("Skipping recipe %s, package %s which adds groupname %s does not have a static gid defined." % (d.getVar('PN', True), pkg, gaargs.GROUP))
+ raise bb.build.FuncFailed("%s - %s: Groupname %s does not have a static gid defined." % (d.getVar('PN', True), pkg, gaargs.GROUP))
+
+ # 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]
+ newparam += ['', ' --password %s' % gaargs.password][gaargs.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()
+
+ # Load and process the users and groups, rewriting the adduser/addgroup params
+ useradd_packages = d.getVar('USERADD_PACKAGES', True)
+
+ 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, True)
+ if useradd_param:
+ #bb.warn("Before: 'USERADD_PARAM_%s' - '%s'" % (pkg, useradd_param))
+ d.setVar('USERADD_PARAM_%s' % pkg, rewrite_useradd(useradd_param))
+ #bb.warn("After: 'USERADD_PARAM_%s' - '%s'" % (pkg, d.getVar('USERADD_PARAM_%s' % pkg, True)))
+
+ groupadd_param = d.getVar('GROUPADD_PARAM_%s' % pkg, True)
+ if groupadd_param:
+ #bb.warn("Before: 'GROUPADD_PARAM_%s' - '%s'" % (pkg, groupadd_param))
+ d.setVar('GROUPADD_PARAM_%s' % pkg, rewrite_groupadd(groupadd_param))
+ #bb.warn("After: 'GROUPADD_PARAM_%s' - '%s'" % (pkg, d.getVar('GROUPADD_PARAM_%s' % pkg, True)))
+
+
+
+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 bb.build.FuncFailed as f:
+ bb.debug(1, "Skipping recipe %s: %s" % (d.getVar('PN', True), f))
+ raise bb.parse.SkipPackage(f)
+}
diff --git a/import-layers/yocto-poky/meta/classes/useradd.bbclass b/import-layers/yocto-poky/meta/classes/useradd.bbclass
new file mode 100644
index 000000000..ee402acef
--- /dev/null
+++ b/import-layers/yocto-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 = "${USERADDDEPENDS}"
+USERADDDEPENDS = " base-files shadow-native shadow-sysroot shadow"
+USERADDDEPENDS_class-cross = ""
+USERADDDEPENDS_class-native = ""
+USERADDDEPENDS_class-nativesdk = ""
+
+# 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:${STAGING_DIR_NATIVE}"
+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`
+ remaining=`echo "$GROUPADD_PARAM" | cut -d ';' -f 2-`
+ 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`
+ remaining=`echo "$remaining" | cut -d ';' -f 2-`
+ 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`
+ remaining=`echo "$USERADD_PARAM" | cut -d ';' -f 2-`
+ 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`
+ remaining=`echo "$remaining" | cut -d ';' -f 2-`
+ 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`
+ remaining=`echo "$GROUPMEMS_PARAM" | cut -d ';' -f 2-`
+ 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`
+ remaining=`echo "$remaining" | cut -d ';' -f 2-`
+ done
+fi
+}
+
+useradd_sysroot () {
+ # Pseudo may (do_install) 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_LOCALSTATEDIR=${STAGING_DIR_TARGET}${localstatedir}/pseudo ${STAGING_DIR_NATIVE}${bindir}/pseudo"
+
+ # Explicitly set $D since it isn't set to anything
+ # before do_install
+ D=${STAGING_DIR_TARGET}
+
+ # 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
+}
+
+useradd_sysroot_sstate () {
+ if [ "${BB_CURRENTTASK}" = "package_setscene" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
+ then
+ useradd_sysroot
+ fi
+}
+
+userdel_sysroot_sstate () {
+if test "x${STAGING_DIR_TARGET}" != "x"; then
+ if [ "${BB_CURRENTTASK}" = "configure" -o "${BB_CURRENTTASK}" = "clean" ]; then
+ export PSEUDO="${FAKEROOTENV} PSEUDO_LOCALSTATEDIR=${STAGING_DIR_TARGET}${localstatedir}/pseudo ${STAGING_DIR_NATIVE}${bindir}/pseudo"
+ OPT="--root ${STAGING_DIR_TARGET}"
+
+ # Remove groups and users defined for package
+ GROUPADD_PARAM="${@get_all_cmd_params(d, 'groupadd')}"
+ USERADD_PARAM="${@get_all_cmd_params(d, 'useradd')}"
+
+ if test "x`echo $USERADD_PARAM | tr -d '[:space:]'`" != "x"; then
+ user=`echo "$USERADD_PARAM" | cut -d ';' -f 1 | awk '{ print $NF }'`
+ perform_userdel "${STAGING_DIR_TARGET}" "$OPT $user"
+ fi
+
+ if test "x`echo $GROUPADD_PARAM | tr -d '[:space:]'`" != "x"; then
+ group=`echo "$GROUPADD_PARAM" | cut -d ';' -f 1 | awk '{ print $NF }'`
+ perform_groupdel "${STAGING_DIR_TARGET}" "$OPT $group"
+ fi
+
+ fi
+fi
+}
+
+SSTATECLEANFUNCS = "userdel_sysroot_sstate"
+SSTATECLEANFUNCS_class-cross = ""
+SSTATECLEANFUNCS_class-native = ""
+SSTATECLEANFUNCS_class-nativesdk = ""
+
+do_install[prefuncs] += "${SYSROOTFUNC}"
+SYSROOTFUNC = "useradd_sysroot"
+SYSROOTFUNC_class-cross = ""
+SYSROOTFUNC_class-native = ""
+SYSROOTFUNC_class-nativesdk = ""
+SSTATEPREINSTFUNCS += "${SYSROOTPOSTFUNC}"
+SYSROOTPOSTFUNC = "useradd_sysroot_sstate"
+SYSROOTPOSTFUNC_class-cross = ""
+SYSROOTPOSTFUNC_class-native = ""
+SYSROOTPOSTFUNC_class-nativesdk = ""
+
+USERADDSETSCENEDEPS = "${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_class-cross = ""
+USERADDSETSCENEDEPS_class-native = ""
+USERADDSETSCENEDEPS_class-nativesdk = ""
+do_package_setscene[depends] += "${USERADDSETSCENEDEPS}"
+do_populate_sysroot_setscene[depends] += "${USERADDSETSCENEDEPS}"
+
+# Recipe parse-time sanity checks
+def update_useradd_after_parse(d):
+ useradd_packages = d.getVar('USERADD_PACKAGES', True)
+
+ if not useradd_packages:
+ raise bb.build.FuncFailed("%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, True) and not d.getVar('GROUPADD_PARAM_%s' % pkg, True) and not d.getVar('GROUPMEMS_PARAM_%s' % pkg, True):
+ 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', True) or ""
+ for pkg in useradd_packages.split():
+ param = d.getVar(param_type % pkg, True)
+ if param:
+ params.append(param)
+
+ 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, True) or d.getVar('pkg_preinst', True)
+ 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', True)
+ preinst += 'perform_useradd () {\n%s}\n' % d.getVar('perform_useradd', True)
+ preinst += 'perform_groupmems () {\n%s}\n' % d.getVar('perform_groupmems', True)
+ preinst += d.getVar('useradd_preinst', True)
+ d.setVar('pkg_preinst_%s' % pkg, preinst)
+
+ # RDEPENDS setup
+ rdepends = d.getVar("RDEPENDS_%s" % pkg, True) 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', True) 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/import-layers/yocto-poky/meta/classes/useradd_base.bbclass b/import-layers/yocto-poky/meta/classes/useradd_base.bbclass
new file mode 100644
index 000000000..0d81accd1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/useradd_base.bbclass
@@ -0,0 +1,151 @@
+# 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
+ opts=`echo $opts | sed s/\'/\"/g`
+ 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
+ opts=`echo $opts | sed s/\'/\"/g`
+ 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"
+ # groupmems fails if /etc/gshadow does not exist
+ local gshadow=""
+ if [ -f $rootdir${sysconfdir}/gshadow ]; then
+ gshadow="yes"
+ else
+ gshadow="no"
+ touch $rootdir${sysconfdir}/gshadow
+ fi
+ 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
+ if test "x$gshadow" = "xno"; then
+ rm -f $rootdir${sysconfdir}/gshadow
+ rm -f $rootdir${sysconfdir}/gshadow-
+ 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
+ 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}: 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/import-layers/yocto-poky/meta/classes/utility-tasks.bbclass b/import-layers/yocto-poky/meta/classes/utility-tasks.bbclass
new file mode 100644
index 000000000..5bcfd0b72
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/utility-tasks.bbclass
@@ -0,0 +1,66 @@
+addtask listtasks
+do_listtasks[nostamp] = "1"
+python do_listtasks() {
+ taskdescs = {}
+ maxlen = 0
+ for e in d.keys():
+ if d.getVarFlag(e, 'task', True):
+ maxlen = max(maxlen, len(e))
+ if e.endswith('_setscene'):
+ desc = "%s (setscene version)" % (d.getVarFlag(e[:-9], 'doc', True) or '')
+ else:
+ desc = d.getVarFlag(e, 'doc', True) 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.*" % bb.data.expand(d.getVar('STAMP', False), d)
+ bb.note("Removing " + dir)
+ oe.path.remove(dir)
+
+ for f in (d.getVar('CLEANFUNCS', True) or '').split():
+ bb.build.exec_func(f, d)
+}
+
+addtask checkuri
+do_checkuri[nostamp] = "1"
+python do_checkuri() {
+ src_uri = (d.getVar('SRC_URI', True) or "").split()
+ if len(src_uri) == 0:
+ return
+
+ try:
+ fetcher = bb.fetch2.Fetch(src_uri, d)
+ fetcher.checkstatus()
+ except bb.fetch2.BBFetchException, e:
+ raise bb.build.FuncFailed(e)
+}
+
+addtask checkuriall after do_checkuri
+do_checkuriall[recrdeptask] = "do_checkuriall do_checkuri"
+do_checkuriall[recideptask] = "do_${BB_DEFAULT_TASK}"
+do_checkuriall[nostamp] = "1"
+do_checkuriall() {
+ :
+}
+
+addtask fetchall after do_fetch
+do_fetchall[recrdeptask] = "do_fetchall do_fetch"
+do_fetchall[recideptask] = "do_${BB_DEFAULT_TASK}"
+do_fetchall() {
+ :
+}
diff --git a/import-layers/yocto-poky/meta/classes/utils.bbclass b/import-layers/yocto-poky/meta/classes/utils.bbclass
new file mode 100644
index 000000000..81b92cb5e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/utils.bbclass
@@ -0,0 +1,380 @@
+# For compatibility
+def base_path_join(a, *p):
+ return oe.path.join(a, *p)
+
+def base_path_relative(src, dest):
+ return oe.path.relative(src, dest)
+
+def base_path_out(path, d):
+ return oe.path.format_display(path, d)
+
+def base_read_file(filename):
+ return oe.utils.read_file(filename)
+
+def base_ifelse(condition, iftrue = True, iffalse = False):
+ return oe.utils.ifelse(condition, iftrue, iffalse)
+
+def base_conditional(variable, checkvalue, truevalue, falsevalue, d):
+ return oe.utils.conditional(variable, checkvalue, truevalue, falsevalue, d)
+
+def base_less_or_equal(variable, checkvalue, truevalue, falsevalue, d):
+ return oe.utils.less_or_equal(variable, checkvalue, truevalue, falsevalue, d)
+
+def base_version_less_or_equal(variable, checkvalue, truevalue, falsevalue, d):
+ return oe.utils.version_less_or_equal(variable, checkvalue, truevalue, falsevalue, d)
+
+def base_contains(variable, checkvalues, truevalue, falsevalue, d):
+ return bb.utils.contains(variable, checkvalues, truevalue, falsevalue, d)
+
+def base_both_contain(variable1, variable2, checkvalue, d):
+ return oe.utils.both_contain(variable1, variable2, checkvalue, d)
+
+def base_prune_suffix(var, suffixes, d):
+ return oe.utils.prune_suffix(var, suffixes, d)
+
+def oe_filter(f, str, d):
+ return oe.utils.str_filter(f, str, d)
+
+def oe_filter_out(f, str, d):
+ return oe.utils.str_filter_out(f, str, d)
+
+def machine_paths(d):
+ """List any existing machine specific filespath directories"""
+ machine = d.getVar("MACHINE", True)
+ filespathpkg = d.getVar("FILESPATHPKG", True).split(":")
+ for basepath in d.getVar("FILESPATHBASE", True).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", True).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_
+ #
+ #bbnote installing shared library $1 to $2
+ #
+ libname=`basename $1`
+ install -m 755 $1 $2/$libname
+ sonamelink=`${HOST_PREFIX}readelf -d $1 |grep 'Library soname:' |sed -e 's/.*\[\(.*\)\].*/\1/'`
+ 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`
+ cat <<END >$cmd
+#!/bin/bash
+realpath=\`readlink -fn \$0\`
+exec -a \`dirname \$realpath\`/$cmdname \`dirname \$realpath\`/$cmdname.real $@ "\$@"
+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`
+ cat <<END >$cmd
+#!/bin/bash
+realpath=\`readlink -fn \$0\`
+export $@
+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)
+ path = d.getVar('PATH', d, True)
+ 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", True) 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", True) 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, True) 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", True) or "").split()
+ if not variants:
+ return pkg
+ pkgs = pkg
+ for v in variants:
+ pkgs = pkgs + " " + v + "-" + pkg
+ return pkgs
+
+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, True) or ""
+ if value != "":
+ if need_split:
+ for item in value.split(delim):
+ values.append(item)
+ else:
+ values.append(value)
+ variants = d.getVar("MULTILIB_VARIANTS", True) or ""
+ for item in variants.split():
+ localdata = bb.data.createCopy(d)
+ overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
+ localdata.setVar("OVERRIDES", overrides)
+ localdata.setVar("MLPREFIX", item + "-")
+ bb.data.update_data(localdata)
+ value = localdata.getVar(var, True) 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)
diff --git a/import-layers/yocto-poky/meta/classes/vala.bbclass b/import-layers/yocto-poky/meta/classes/vala.bbclass
new file mode 100644
index 000000000..615eb379a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/classes/waf.bbclass b/import-layers/yocto-poky/meta/classes/waf.bbclass
new file mode 100644
index 000000000..5e55833ca
--- /dev/null
+++ b/import-layers/yocto-poky/meta/classes/waf.bbclass
@@ -0,0 +1,38 @@
+# avoids build breaks when using no-static-libs.inc
+DISABLE_STATIC = ""
+
+def get_waf_parallel_make(d):
+ pm = d.getVar('PARALLEL_MAKE', True)
+ if pm:
+ # look for '-j' and throw other options (e.g. '-l') away
+ # because they might have different meaning in bjam
+ pm = pm.split()
+ while pm:
+ v = None
+ opt = pm.pop(0)
+ if opt == '-j':
+ v = pm.pop(0)
+ elif opt.startswith('-j'):
+ v = opt[2:].strip()
+ else:
+ v = None
+
+ if v:
+ v = min(64, int(v))
+ return '-j' + str(v)
+
+ return ""
+
+waf_do_configure() {
+ ${S}/waf configure --prefix=${prefix} ${EXTRA_OECONF}
+}
+
+waf_do_compile() {
+ ${S}/waf build ${@get_waf_parallel_make(d)}
+}
+
+waf_do_install() {
+ ${S}/waf install --destdir=${D}
+}
+
+EXPORT_FUNCTIONS do_configure do_compile do_install
diff --git a/import-layers/yocto-poky/meta/conf/abi_version.conf b/import-layers/yocto-poky/meta/conf/abi_version.conf
new file mode 100644
index 000000000..a82968778
--- /dev/null
+++ b/import-layers/yocto-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 = "11"
diff --git a/import-layers/yocto-poky/meta/conf/bitbake.conf b/import-layers/yocto-poky/meta/conf/bitbake.conf
new file mode 100644
index 000000000..40796aab1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/bitbake.conf
@@ -0,0 +1,820 @@
+##################################################################
+# 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 = "/usr"
+
+# Base paths
+export base_bindir = "${base_prefix}/bin"
+export base_sbindir = "${base_prefix}/sbin"
+export base_libdir = "${base_prefix}/${baselib}"
+export nonarch_base_libdir = "${base_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"
+
+##################################################################
+# 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', True), ''][d.getVar('TARGET_OS', True) == ('' or 'custom')]}"
+TARGET_PREFIX = "${TARGET_SYS}-"
+TARGET_CC_ARCH = "${TUNE_CCARGS}"
+TARGET_LD_ARCH = "${TUNE_LDARGS}"
+TARGET_AS_ARCH = "${TUNE_ASARGS}"
+
+SDK_ARCH = "${BUILD_ARCH}"
+SDK_OS = "${BUILD_OS}"
+SDK_VENDOR = "-oesdk"
+SDK_SYS = "${SDK_ARCH}${SDK_VENDOR}${@['-' + d.getVar('SDK_OS', True), ''][d.getVar('SDK_OS', True) == ('' 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', True), d.getVar('MACHINE', True)][bool(d.getVar('MACHINE', True))].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}"
+MULTIMACH_HOST_SYS = "${PACKAGE_ARCH}${HOST_VENDOR}-${HOST_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 \
+ git-native \
+ grep-native \
+ diffstat-native \
+ patch-native \
+ libgcc-native \
+ hostperl-runtime-native \
+ hostpython-runtime-native \
+ tar-native \
+ virtual/libintl-native \
+ virtual/libiconv-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', True) or 0) > 0]}"
+P = "${PN}-${PV}"
+
+PRAUTO = ""
+EXTENDPRAUTO = "${@['.${PRAUTO}', ''][not d.getVar('PRAUTO', True)]}"
+PRAUTOINX = "${PF}"
+
+PKGV ?= "${PV}"
+PKGR ?= "${PR}${EXTENDPRAUTO}"
+PKGE ?= "${@['','${PE}'][int(d.getVar('PE', True) or 0) > 0]}"
+EXTENDPKGEVER = "${@['','${PKGE}:'][d.getVar('PKGE', True).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 = "${@base_prune_suffix(d.getVar('PN', True), d.getVar('SPECIAL_PKGSUFFIX', True).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/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})"
+
+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:"
+
+##################################################################
+# General work and output directories for the build system.
+##################################################################
+
+TMPDIR ?= "${TOPDIR}/tmp"
+CACHE = "${TMPDIR}/cache${@['', '/' + str(d.getVar('MACHINE', True))][bool(d.getVar('MACHINE', True))]}${@['', '/' + str(d.getVar('SDKMACHINE', True))][bool(d.getVar('SDKMACHINE', True))]}"
+# 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"
+
+STAGING_DIR_NATIVE = "${STAGING_DIR}/${BUILD_SYS}"
+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 = "${STAGING_DIR}/${MACHINE}"
+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 = "${STAGING_DIR}/${MACHINE}"
+STAGING_DIR_TCBOOTSTRAP = "${STAGING_DIR_TARGET}-tcbootstrap"
+
+# 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 = "${STAGING_DIR_HOST}/pkgdata"
+
+##################################################################
+# 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 = "2.6.32"
+OLDEST_KERNEL_aarch64 = "3.14"
+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.
+##################################################################
+
+CCACHE ??= ""
+# Disable ccache explicitly if CCACHE is null since gcc may be a symlink
+# of ccache some distributions (e.g., Fedora 17).
+export CCACHE_DISABLE ??= "${@[0,1][d.getVar('CCACHE', True) == '']}"
+# Assign CCACHE_DIR a default value to fix a bug of ccache 3.1.7,
+# since it would always create CCACHE_DIR/.ccache even if
+# CCACHE_DISABLE = 1.
+export CCACHE_DIR ??= "${@os.getenv('HOME')}"
+
+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"
+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 = "C"
+
+##################################################################
+# Patch handling.
+##################################################################
+PATCHTOOL = "quilt"
+PATCHRESOLVE = "noop"
+
+##################################################################
+# Build flags and options.
+##################################################################
+
+export BUILD_CPPFLAGS = "-isystem${STAGING_INCDIR_NATIVE}"
+BUILDSDK_CPPFLAGS = "-isystem${STAGING_INCDIR}"
+export CPPFLAGS = "${TARGET_CPPFLAGS}"
+export TARGET_CPPFLAGS = ""
+#export TARGET_CPPFLAGS = "-isystem${STAGING_DIR_TARGET}${includedir}"
+
+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}"
+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 = "-L${STAGING_LIBDIR} \
+ -Wl,-rpath-link,${STAGING_LIBDIR} \
+ -Wl,-rpath,${libdir} -Wl,-O1 \
+ -L${STAGING_DIR_HOST}${base_libdir} \
+ -Wl,-rpath-link,${STAGING_DIR_HOST}${base_libdir} \
+ -Wl,-rpath,${base_libdir} -Wl,-O1"
+
+LINKER_HASH_STYLE ??= "gnu"
+# mips does not support GNU hash style therefore we override
+LINKER_HASH_STYLE_mips = "sysv"
+LINKER_HASH_STYLE_mipsel = "sysv"
+LINKER_HASH_STYLE_mips64 = "sysv"
+LINKER_HASH_STYLE_mips64el = "sysv"
+LINKER_HASH_STYLE_mips64n32 = "sysv"
+LINKER_HASH_STYLE_mips64eln32 = "sysv"
+TARGET_LINK_HASH_STYLE ?= "${@['-Wl,--hash-style=gnu',''][d.getVar('LINKER_HASH_STYLE', True) != '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.
+##################################################################
+DEBUG_FLAGS ?= "-g -feliminate-unused-debug-types \
+ -fdebug-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
+ -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
+ -fdebug-prefix-map=${STAGING_DIR_HOST}= \
+"
+
+# 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', True) == '1'], True)}"
+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://www.eu.apache.org/dist/"
+DEBIAN_MIRROR = "ftp://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"
+GPE_MIRROR = "http://gpe.linuxtogo.org/download/source"
+KERNELORG_MIRROR = "http://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 \
+ 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 = "ftp://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)}"
+# 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}:${STAGING_DIR_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=${STAGING_BINDIR_NATIVE} PSEUDO_LIBDIR=${STAGING_BINDIR_NATIVE}/../lib/pseudo/lib PSEUDO_PREFIX=${STAGING_BINDIR_NATIVE}/../../ PSEUDO_DISABLED=1"
+FAKEROOTCMD = "${STAGING_BINDIR_NATIVE}/pseudo"
+FAKEROOTENV = "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${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"
+OVERRIDES[vardepsexclude] = "MACHINEOVERRIDES"
+CLASSOVERRIDE ?= "class-target"
+DISTROOVERRIDES ?= "${@d.getVar('DISTRO', True) or ''}"
+MACHINEOVERRIDES ?= "${MACHINE}"
+MACHINEOVERRIDES[vardepsexclude] = "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
+include conf/build/${BUILD_SYS}.conf
+include conf/target/${TARGET_SYS}.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"
+
+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}"
+
+DISTRO_FEATURES_BACKFILL = "pulseaudio sysvinit bluez5 gobject-introspection-data"
+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', True).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', True).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 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 \
+ WARN_QA ERROR_QA WORKDIR STAMPCLEAN PKGDATA_DIR BUILD_ARCH SSTATE_PKGARCH \
+ BB_WORKERCONTEXT"
+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_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"
+
+MLPREFIX ??= ""
+MULTILIB_VARIANTS ??= ""
diff --git a/import-layers/yocto-poky/meta/conf/conf-notes.txt b/import-layers/yocto-poky/meta/conf/conf-notes.txt
new file mode 100644
index 000000000..2f2932ba1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/conf-notes.txt
@@ -0,0 +1,7 @@
+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/import-layers/yocto-poky/meta/conf/distro/defaultsetup.conf b/import-layers/yocto-poky/meta/conf/distro/defaultsetup.conf
new file mode 100644
index 000000000..71c65b146
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/distro/defaultsetup.conf
@@ -0,0 +1,23 @@
+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
+
+# Allow single libc distros to disable this code
+TCLIBCAPPEND ?= "-${TCLIBC}"
+TMPDIR .= "${TCLIBCAPPEND}"
+
+CACHE = "${TMPDIR}/cache/${TCMODE}-${TCLIBC}${@['', '/' + str(d.getVar('MACHINE', True))][bool(d.getVar('MACHINE', True))]}${@['', '/' + str(d.getVar('SDKMACHINE', True))][bool(d.getVar('SDKMACHINE', True))]}"
+
+USER_CLASSES ?= ""
+PACKAGE_CLASSES ?= "package_ipk"
+INHERIT_BLACKLIST = "blacklist"
+INHERIT_DISTRO ?= "debian devshell sstate license"
+INHERIT += "${PACKAGE_CLASSES} ${USER_CLASSES} ${INHERIT_DISTRO} ${INHERIT_BLACKLIST}"
+
diff --git a/import-layers/yocto-poky/meta/conf/distro/include/as-needed.inc b/import-layers/yocto-poky/meta/conf/distro/include/as-needed.inc
new file mode 100644
index 000000000..114d377ea
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/distro/include/as-needed.inc
@@ -0,0 +1,14 @@
+
+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-pulseaudio = ""
+ASNEEDED_pn-rpm = ""
+
+TARGET_LDFLAGS += "${ASNEEDED}"
diff --git a/import-layers/yocto-poky/meta/conf/distro/include/default-distrovars.inc b/import-layers/yocto-poky/meta/conf/distro/include/default-distrovars.inc
new file mode 100644
index 000000000..fac4deb78
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/distro/include/default-distrovars.inc
@@ -0,0 +1,48 @@
+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"
+
+DISTRO_FEATURES_DEFAULT ?= "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 ?= "libidn"
+
+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"
diff --git a/import-layers/yocto-poky/meta/conf/distro/include/default-providers.inc b/import-layers/yocto-poky/meta/conf/distro/include/default-providers.inc
new file mode 100644
index 000000000..ece4d8b30
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/distro/include/default-providers.inc
@@ -0,0 +1,56 @@
+#
+# Default virtual providers
+#
+PREFERRED_PROVIDER_virtual/db ?= "db"
+PREFERRED_PROVIDER_virtual/db-native ?= "db-native"
+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_gzip-native ?= "pigz-native"
+PREFERRED_PROVIDER_udev ?= "${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd','eudev',d)}"
+PREFERRED_RPROVIDER_libasound-module-bluez ?= "${@bb.utils.contains('DISTRO_FEATURES','bluetooth bluez5','bluez5','bluez4',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"
diff --git a/import-layers/yocto-poky/meta/conf/distro/include/default-versions.inc b/import-layers/yocto-poky/meta/conf/distro/include/default-versions.inc
new file mode 100644
index 000000000..a04ea718b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/distro/include/default-versions.inc
@@ -0,0 +1,15 @@
+#
+# Default preferred versions
+#
+
+# Force the python versions in one place
+PYTHON_BASEVERSION ?= "2.7"
+PREFERRED_VERSION_python ?= "2.7.11"
+PREFERRED_VERSION_python-native ?= "2.7.11"
+
+# Force the older version of liberation-fonts until we fix the fontforge issue
+PREFERRED_VERSION_liberation-fonts ?= "1.04"
+
+# Force db-native's version to keep sync with db while
+# 'AGPL-3.0' in ${INCOMPATIBLE_LICENSE} blacklist
+PREFERRED_VERSION_db-native = "${@incompatible_license_contains('AGPL-3.0', '5.%', '6.%', d)}"
diff --git a/import-layers/yocto-poky/meta/conf/distro/include/distro_alias.inc b/import-layers/yocto-poky/meta/conf/distro/include/distro_alias.inc
new file mode 100644
index 000000000..c8f93955d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/distro/include/distro_alias.inc
@@ -0,0 +1,464 @@
+#
+# 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-augeas = "Ubuntu=libaugeas0 Debian=libaugeas0"
+DISTRO_PN_ALIAS_pn-avahi-ui = "Ubuntu=avahi-discover Debian=avahi-discover"
+DISTRO_PN_ALIAS_pn-babeltrace = "OSPDT"
+DISTRO_PN_ALIAS_pn-bdwgc = "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-directfb = "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-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-directfb-examples = "Debian=directfb Fedora=directfb"
+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-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-stub = "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-gummiboot = "Debian=gummiboot Fedora=gummiboot"
+DISTRO_PN_ALIAS_pn-hello-mod = "OE-Core"
+DISTRO_PN_ALIAS_pn-hostap-conf = "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-kconfig-frontends = "OSPDT"
+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-latencytop = "Meego=latencytop Fedora=latencytop Debian=latencytop OpenSuSE=latencytop"
+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-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-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-libxsettings-client = "Debian=libxsettings-client0 Ubuntu=libxsettings-client0 Mandriva=libXsettings-client0"
+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-oprofile = "Debian=oprofile Fedora=oprofile"
+DISTRO_PN_ALIAS_pn-oprofileui = "Fedora=oprofileui Ubuntu=oprofile-gui Debian=oprofile-gui"
+DISTRO_PN_ALIAS_pn-oprofileui-server = "Fedora=oprofileui Ubuntu=oprofile-gui Debian=oprofile-gui"
+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-directfb = "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 = "OE-Core"
+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-postinst-intercept = "OE-Core"
+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-pip = "OpenSuSE=python3-pip Debian=python3-pip"
+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-imaging = "Mandriva=python-imaging Debian=python-imaging"
+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-pycurl = "Debian=python-pycurl Ubuntu=python-pycurl"
+DISTRO_PN_ALIAS_pn-python-pygobject = "Meego=pygobject2 Fedora=pygobject2 Ubuntu=pygobject Debian=pygobject"
+DISTRO_PN_ALIAS_pn-python-pyrex = "Mandriva=python-pyrex Ubuntu=python-pyrex"
+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-tslib = "Debian=tslib Ubuntu=tslib"
+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-x11-common = "OE-Core"
+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-xtscal = "OSPDT upstream=http://gpe.linuxtogo.org/download/source/"
+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/import-layers/yocto-poky/meta/conf/distro/include/no-static-libs.inc b/import-layers/yocto-poky/meta/conf/distro/include/no-static-libs.inc
new file mode 100644
index 000000000..13a791869
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/distro/include/no-static-libs.inc
@@ -0,0 +1,35 @@
+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 = ""
+# 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"
diff --git a/import-layers/yocto-poky/meta/conf/distro/include/package_regex.inc b/import-layers/yocto-poky/meta/conf/distro/include/package_regex.inc
new file mode 100644
index 000000000..9fc115723
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/distro/include/package_regex.inc
@@ -0,0 +1,22 @@
+# NOTE: THIS FILE IS DEPRECATED. Please add new entries to the recipes themselves.
+#
+# package_regex.inc - This file contains data that tracks
+# 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 slowly 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
+#"
+# UPSTREAM_CHECK_URI_pn-<recipe name> = "recipe_url"
+# - This is the url used by the package checking system to
+# get the latest version of the package
+# UPSTREAM_CHECK_REGEX_pn-<recipe name> = "package_regex"
+# - This is the regex the package checking system uses to
+# parse the page found at UPSTREAM_CHECK_URI_pn-<recipe name>
+# UPSTREAM_CHECK_GITTAGREGEX_pn-<recipe name> = "git_tag_regex"
+# - When source code is fetched from git, git tags are used to
+# determine the upstream release version. This regex can be used
+# to filter only relevant tags.
+#
diff --git a/import-layers/yocto-poky/meta/conf/distro/include/security_flags.inc b/import-layers/yocto-poky/meta/conf/distro/include/security_flags.inc
new file mode 100644
index 000000000..ff5f34e3a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/distro/include/security_flags.inc
@@ -0,0 +1,113 @@
+# 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.
+
+# _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 = "${@base_conditional('DEBUG_BUILD','1','','-D_FORTIFY_SOURCE=2',d)}"
+
+SECURITY_CFLAGS ?= "-fstack-protector-strong -pie -fpie ${lcl_maybe_fortify}"
+SECURITY_NO_PIE_CFLAGS ?= "-fstack-protector-strong ${lcl_maybe_fortify}"
+
+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}"
+# Deal with ppc specific linker failures when using the cflags
+SECURITY_CFLAGS_pn-dbus_powerpc = ""
+SECURITY_CFLAGS_pn-dbus-ptest_powerpc = ""
+SECURITY_CFLAGS_pn-libmatchbox_powerpc = ""
+
+# arm specific security flag issues
+SECURITY_CFLAGS_pn-lttng-tools_arm = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-aspell = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-beecrypt = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-blktrace = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-coreutils = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-cups = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-db = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-directfb = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-glibc = ""
+SECURITY_CFLAGS_pn-glibc-initial = ""
+SECURITY_CFLAGS_pn-elfutils = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-enchant = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-expect = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-flac = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-flex = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-gcc = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-gcc-runtime = ""
+SECURITY_CFLAGS_pn-gcc-sanitizers = ""
+SECURITY_CFLAGS_pn-gdb = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-gmp = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-gnutls = "${SECURITY_NO_PIE_CFLAGS}"
+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-gst-plugins-bad = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-gst-plugins-gl = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-gstreamer1.0-plugins-bad = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-gstreamer1.0-plugins-good = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-harfbuzz = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-kexec-tools = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-iptables = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-libaio = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-libcap = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-libgcc = ""
+SECURITY_CFLAGS_pn-libid3tag = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-libnewt = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-libglu = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-libpcap = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-libpcre = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-libproxy = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-lttng-ust = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-mesa = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-mesa-gl = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-openssl = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-opensp = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-ppp = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-python = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-python-imaging = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-python-pycurl = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-python-smartpm = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-python-numpy = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-python3 = "${SECURITY_NO_PIE_CFLAGS}"
+# Revert RPM to using internally supported values
+SECURITY_CFLAGS_pn-rpm = "${lcl_maybe_fortify} -fstack-protector"
+SECURITY_CFLAGS_pn-syslinux = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-tcl = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-tiff = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-uclibc = ""
+SECURITY_CFLAGS_pn-uclibc-initial = ""
+SECURITY_CFLAGS_pn-valgrind = ""
+SECURITY_CFLAGS_pn-zlib = "${SECURITY_NO_PIE_CFLAGS}"
+
+# These 2 have text relco errors with the pie options enabled
+SECURITY_CFLAGS_pn-ltp = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-pulseaudio = "${SECURITY_NO_PIE_CFLAGS}"
+
+TARGET_CFLAGS_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-gcc-sanitizers = "-fstack-protector-strong"
+SECURITY_LDFLAGS_remove_pn-glibc = "-fstack-protector-strong"
+SECURITY_LDFLAGS_remove_pn-glibc-initial = "-fstack-protector-strong"
+SECURITY_LDFLAGS_remove_pn-libgcc = "-fstack-protector-strong"
+SECURITY_LDFLAGS_remove_pn-uclibc = "-fstack-protector-strong"
+SECURITY_LDFLAGS_remove_pn-uclibc-initial = "-fstack-protector-strong"
+SECURITY_LDFLAGS_pn-xf86-video-fbdev = "${SECURITY_X_LDFLAGS}"
+SECURITY_LDFLAGS_pn-xf86-video-intel = "${SECURITY_X_LDFLAGS}"
+SECURITY_LDFLAGS_pn-xf86-video-omapfb = "${SECURITY_X_LDFLAGS}"
+SECURITY_LDFLAGS_pn-xf86-video-omap = "${SECURITY_X_LDFLAGS}"
+SECURITY_LDFLAGS_pn-xf86-video-vesa = "${SECURITY_X_LDFLAGS}"
+SECURITY_LDFLAGS_pn-xf86-video-vmware = "${SECURITY_X_LDFLAGS}"
+SECURITY_LDFLAGS_pn-xserver-xorg = "${SECURITY_X_LDFLAGS}"
+
+TARGET_CC_ARCH_append_pn-binutils = " ${SECURITY_CFLAGS} ${SELECTED_OPTIMIZATION}"
diff --git a/import-layers/yocto-poky/meta/conf/distro/include/tclibc-baremetal.inc b/import-layers/yocto-poky/meta/conf/distro/include/tclibc-baremetal.inc
new file mode 100644
index 000000000..a8ce6d3ac
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/distro/include/tclibc-glibc.inc b/import-layers/yocto-poky/meta/conf/distro/include/tclibc-glibc.inc
new file mode 100644
index 000000000..649918fd2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/distro/include/tclibc-glibc.inc
@@ -0,0 +1,40 @@
+#
+# glibc specific configuration
+#
+
+LIBCEXTENSION = "${@['', '-gnu'][(d.getVar('ABIEXTENSION', True) 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', True) or '').split() :
+ return d.getVar('LIBC_LOCALE_DEPENDENCIES', True) or ''
+ else:
+ return ''
diff --git a/import-layers/yocto-poky/meta/conf/distro/include/tclibc-musl.inc b/import-layers/yocto-poky/meta/conf/distro/include/tclibc-musl.inc
new file mode 100644
index 000000000..e6b10f946
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/distro/include/tclibc-musl.inc
@@ -0,0 +1,31 @@
+#
+# musl specific configuration
+#
+
+LIBCEXTENSION = "-musl"
+
+# Add uclibc 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"
+
+#USE_NLS ?= "no"
+
+CXXFLAGS += "-fvisibility-inlines-hidden"
+
+IMAGE_LINGUAS = ""
+
+LIBC_DEPENDENCIES = "\
+ musl \
+ musl-dbg \
+ musl-dev \
+ "
+
+# GLib binaries trigger assertion failures and crash under qemu
+# when musl is in use
+DISTRO_FEATURES_BACKFILL_CONSIDERED += "gobject-introspection-data"
diff --git a/import-layers/yocto-poky/meta/conf/distro/include/tclibc-uclibc.inc b/import-layers/yocto-poky/meta/conf/distro/include/tclibc-uclibc.inc
new file mode 100644
index 000000000..14c3cdbb8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/distro/include/tclibc-uclibc.inc
@@ -0,0 +1,28 @@
+#
+# uclibc specific configuration
+#
+
+LIBCEXTENSION = "-uclibc"
+
+# Add uclibc overrides to the overrides.
+LIBCOVERRIDE = ":libc-uclibc"
+OVERRIDES .= "${LIBCOVERRIDE}"
+
+PREFERRED_PROVIDER_virtual/libc ?= "uclibc"
+PREFERRED_PROVIDER_virtual/libiconv ?= "libiconv"
+PREFERRED_PROVIDER_virtual/libintl ?= "gettext"
+PREFERRED_PROVIDER_virtual/nativesdk-libintl ?= "nativesdk-glibc"
+PREFERRED_PROVIDER_virtual/nativesdk-libiconv ?= "nativesdk-glibc"
+
+USE_NLS ?= "no"
+
+CXXFLAGS += "-fvisibility-inlines-hidden"
+
+IMAGE_LINGUAS = ""
+
+LIBC_DEPENDENCIES = "\
+ uclibc \
+ uclibc-dbg \
+ uclibc-dev \
+ uclibc-thread-db \
+ "
diff --git a/import-layers/yocto-poky/meta/conf/distro/include/tcmode-default.inc b/import-layers/yocto-poky/meta/conf/distro/include/tcmode-default.inc
new file mode 100644
index 000000000..c412420ea
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/distro/include/tcmode-default.inc
@@ -0,0 +1,75 @@
+#
+# 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_ARCH}"
+PREFERRED_PROVIDER_virtual/${SDK_PREFIX}gcc-initial = "gcc-crosssdk-initial-${SDK_ARCH}"
+PREFERRED_PROVIDER_virtual/${SDK_PREFIX}gcc = "gcc-crosssdk-${SDK_ARCH}"
+PREFERRED_PROVIDER_virtual/${SDK_PREFIX}g++ = "gcc-crosssdk-${SDK_ARCH}"
+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 ?= "5.3%"
+SDKGCCVERSION ?= "${GCCVERSION}"
+BINUVERSION ?= "2.26%"
+GDBVERSION ?= "7.10%"
+GLIBCVERSION ?= "2.23"
+UCLIBCVERSION ?= "1.0%"
+LINUXLIBCVERSION ?= "4.4"
+
+PREFERRED_VERSION_gcc ?= "${GCCVERSION}"
+PREFERRED_VERSION_gcc-cross-${TARGET_ARCH} ?= "${GCCVERSION}"
+PREFERRED_VERSION_gcc-cross-initial-${TARGET_ARCH} ?= "${GCCVERSION}"
+PREFERRED_VERSION_gcc-crosssdk-${SDK_ARCH} ?= "${SDKGCCVERSION}"
+PREFERRED_VERSION_gcc-crosssdk-initial-${SDK_ARCH} ?= "${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_ARCH} ?= "${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_uclibc ?= "${UCLIBCVERSION}"
+PREFERRED_VERSION_uclibc-initial ?= "${UCLIBCVERSION}"
+# don't use version earlier than 1.4 for gzip-native, as it's necessary for
+# some packages using an archive format incompatible with earlier gzip
+PREFERRED_VERSION_gzip-native ?= "1.6"
+
+# Setup suitable toolchain flags
+require conf/distro/include/as-needed.inc
+
diff --git a/import-layers/yocto-poky/meta/conf/distro/include/upstream_tracking.inc b/import-layers/yocto-poky/meta/conf/distro/include/upstream_tracking.inc
new file mode 100644
index 000000000..e2a5e6ce4
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/distro/include/world-broken.inc b/import-layers/yocto-poky/meta/conf/distro/include/world-broken.inc
new file mode 100644
index 000000000..a5f6371d3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/distro/include/world-broken.inc
@@ -0,0 +1,49 @@
+#
+# Exclude known broken packages
+#
+
+# rt-tests needs PI mutex support in libc
+EXCLUDE_FROM_WORLD_pn-rt-tests_libc-musl = "1"
+
+# error: no member named 'sin_port' in 'struct sockaddr_in6'
+# this is due to libtirpc using ipv6 but portmap rpc expecting ipv4
+EXCLUDE_FROM_WORLD_pn-portmap_libc-musl = "1"
+EXCLUDE_FROM_WORLD_pn-unfs3_libc-musl = "1"
+
+# error: use of undeclared identifier '_STAT_VER'
+EXCLUDE_FROM_WORLD_pn-pseudo_libc-musl = "1"
+
+# error: Need to implement custom I/O
+EXCLUDE_FROM_WORLD_pn-libsolv_libc-musl = "1"
+
+# undefined reference to `pthread_tryjoin_np'
+EXCLUDE_FROM_WORLD_pn-btrfs-tools_libc-musl = "1"
+
+# error: error.h: No such file or directory
+EXCLUDE_FROM_WORLD_pn-prelink_libc-musl = "1"
+
+# error: use of undeclared identifier 'O_CREAT'
+EXCLUDE_FROM_WORLD_pn-libbsd_libc-musl = "1"
+
+# error: expected declaration specifiers before '__nonnull'
+EXCLUDE_FROM_WORLD_pn-lttng-ust_libc-musl = "1"
+EXCLUDE_FROM_WORLD_pn-lttng-tools_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"
+
+# glibc specific funcrions
+# error: storage size of 'mi' isn't known struct mallinfo mi
+EXCLUDE_FROM_WORLD_pn-valgrind_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/import-layers/yocto-poky/meta/conf/distro/include/yocto-uninative.inc b/import-layers/yocto-poky/meta/conf/distro/include/yocto-uninative.inc
new file mode 100644
index 000000000..85e613ac4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/distro/include/yocto-uninative.inc
@@ -0,0 +1,11 @@
+#
+# 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_URL = "http://downloads.yoctoproject.org/releases/uninative/0.95/"
+UNINATIVE_CHECKSUM[i686] ?= "5f27d7e0f4dd2ed80a7ff6a0d88af107b08e00765b31ed3aa180cc5ce15b0811"
+UNINATIVE_CHECKSUM[x86_64] ?= "26d46c61ad88cc245e31c88549717c0092a838d111b93ec169d88b08cc027581"
diff --git a/import-layers/yocto-poky/meta/conf/documentation.conf b/import-layers/yocto-poky/meta/conf/documentation.conf
new file mode 100644
index 000000000..4234d75fd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/documentation.conf
@@ -0,0 +1,460 @@
+# 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_checkuriall[doc] = "Validates the SRC_URI value for all recipes required to build a target"
+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_fetchall[doc] = "Fetches all remote sources required to build a target"
+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_vmlinux[doc] = "Creates a symbolic link in arch/$arch/boot for vmlinux 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"
+do_vmimg[doc] = "Creates an image for use with VMware or VirtualBox compatible virtual machine hosts (based on IMAGE_FSTYPES either .vmdk or .vdi)"
+
+# 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_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_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."
+PRINC[doc] = "Causes the PR variable of .bbappend files to dynamically increment. This increment minimizes the impact of layer ordering. This variable defaults to '0'."
+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."
+
+#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_OLD_IMAGE[doc] = "Reclaims disk space by removing previously built versions of the same image from the images directory pointed to by the DEPLOY_DIR variable."
+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 GNU standard C library (libc) variant to use during the build process. You can select 'glibc' or 'uclibc'."
+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_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."
+
+#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/import-layers/yocto-poky/meta/conf/layer.conf b/import-layers/yocto-poky/meta/conf/layer.conf
new file mode 100644
index 000000000..10b98f5bd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/layer.conf
@@ -0,0 +1,61 @@
+# 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"
+
+# This should only be incremented on significant changes that will
+# cause compatibility issues with other layers
+LAYERVERSION_core = "8"
+
+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 \
+ shadow-securetty \
+ opkg-arch-config \
+ netbase \
+ init-ifupdown \
+ connman-conf \
+ formfactor \
+ xserver-xf86-config \
+ pointercal \
+ pointercal-xinput \
+ base-files \
+ keymaps \
+ udev-extraconf \
+ packagegroup-x11-xserver \
+ systemd-serialgetty \
+ initscripts \
+ shadow \
+ shadow-sysroot \
+ base-passwd \
+ opkg-utils \
+ gstreamer1.0-meta-base \
+"
+
+SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += " \
+ 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 \
+ initramfs-framework->${VIRTUAL-RUNTIME_base-utils} \
+ initramfs-framework->systemd \
+ initramfs-framework->eudev \
+ liberation-fonts->fontconfig \
+ cantarell-fonts->fontconfig \
+ gnome-icon-theme->librsvg \
+ font-alias->font-util \
+ weston-init->weston \
+ weston-init->kbd \
+ oprofile->virtual/kernel \
+"
+
diff --git a/import-layers/yocto-poky/meta/conf/licenses.conf b/import-layers/yocto-poky/meta/conf/licenses.conf
new file mode 100644
index 000000000..9917c40e1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/licenses.conf
@@ -0,0 +1,189 @@
+# 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"
+
+#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.
+#
+# It is defined as [FOSS_COPYRIGHT] in ./meta/conf/licenses.conf.
+# FOSS_COPYRIGHT = "true"
+# NO copyright will be processed. That means only license information will be
+# identified and output to SPDX file
+# FOSS_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/import-layers/yocto-poky/meta/conf/machine-sdk/i586.conf b/import-layers/yocto-poky/meta/conf/machine-sdk/i586.conf
new file mode 100644
index 000000000..baacce70a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine-sdk/i586.conf
@@ -0,0 +1,3 @@
+SDK_ARCH = "i586"
+SDK_CC_ARCH = "-march=i586"
+
diff --git a/import-layers/yocto-poky/meta/conf/machine-sdk/i686.conf b/import-layers/yocto-poky/meta/conf/machine-sdk/i686.conf
new file mode 100644
index 000000000..ffdb46131
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine-sdk/i686.conf
@@ -0,0 +1,2 @@
+SDK_ARCH = "i686"
+SDK_CC_ARCH = "-march=i686"
diff --git a/import-layers/yocto-poky/meta/conf/machine-sdk/x86_64.conf b/import-layers/yocto-poky/meta/conf/machine-sdk/x86_64.conf
new file mode 100644
index 000000000..812d67c8d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine-sdk/x86_64.conf
@@ -0,0 +1 @@
+SDK_ARCH = "x86_64"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/README b/import-layers/yocto-poky/meta/conf/machine/include/README
new file mode 100644
index 000000000..d66130acb
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/arm/README b/import-layers/yocto-poky/meta/conf/machine/include/arm/README
new file mode 100644
index 000000000..a1beb75fd
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-arm.inc b/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-arm.inc
new file mode 100644
index 000000000..2e3127c79
--- /dev/null
+++ b/import-layers/yocto-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', True) or 'soft'}"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-arm64.inc b/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-arm64.inc
new file mode 100644
index 000000000..944069836
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-arm64.inc
@@ -0,0 +1,36 @@
+DEFAULTTUNE ?= "aarch64"
+
+require conf/machine/include/arm/arch-armv7a.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', True) 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/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv4.inc b/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv4.inc
new file mode 100644
index 000000000..813ed159d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv5-dsp.inc b/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv5-dsp.inc
new file mode 100644
index 000000000..f20492071
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv5.inc b/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv5.inc
new file mode 100644
index 000000000..e6ff902a9
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv6.inc b/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv6.inc
new file mode 100644
index 000000000..4c93f2c7a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv6.inc
@@ -0,0 +1,50 @@
+DEFAULTTUNE ?= "armv6"
+
+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/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv7a.inc b/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv7a.inc
new file mode 100644
index 000000000..1f2e071d5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv7a.inc
@@ -0,0 +1,141 @@
+DEFAULTTUNE ?= "armv7a"
+
+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/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv7ve.inc b/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv7ve.inc
new file mode 100644
index 000000000..79e1ef655
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv7ve.inc
@@ -0,0 +1,141 @@
+DEFAULTTUNE ?= "armv7ve"
+
+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-armv6.inc
+require conf/machine/include/arm/feature-arm-neon.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-armv6} armv7ve armv7ve-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7vet = "${PACKAGE_EXTRA_ARCHS_tune-armv6t} 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-armv6hf} armv7vehf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7vethf = "${PACKAGE_EXTRA_ARCHS_tune-armv6thf} 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-armv6b} armv7veb-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7vetb = "${PACKAGE_EXTRA_ARCHS_tune-armv6tb} 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-armv6hfb} armv7vehfb-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7vethfb = "${PACKAGE_EXTRA_ARCHS_tune-armv6thfb} 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/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv8.inc b/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv8.inc
new file mode 100644
index 000000000..5e832fae6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/include/arm/arch-armv8.inc
@@ -0,0 +1 @@
+require conf/machine/include/arm/arch-arm64.inc
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/arm/feature-arm-neon.inc b/import-layers/yocto-poky/meta/conf/machine/include/arm/feature-arm-neon.inc
new file mode 100644
index 000000000..50d917522
--- /dev/null
+++ b/import-layers/yocto-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', ' vfpv3d16', '', 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/import-layers/yocto-poky/meta/conf/machine/include/arm/feature-arm-thumb.inc b/import-layers/yocto-poky/meta/conf/machine/include/arm/feature-arm-thumb.inc
new file mode 100644
index 000000000..1faebf7c2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/include/arm/feature-arm-thumb.inc
@@ -0,0 +1,33 @@
+TUNEVALID[thumb] = "Use thumb instructions instead of ARM"
+ARM_THUMB_OPT = "${@['arm', 'thumb'][d.getVar('ARM_INSTRUCTION_SET', True) == 'thumb']}"
+ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv4', 't', '', d)}"
+ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv5', 't', '', d)}"
+ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv6', 't', '', d)}"
+ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv7a', 't2', '', d)}"
+ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv7r', 't2', '', d)}"
+ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv7m', 't2', '', d)}"
+ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv7ve', 't2', '', d)}"
+
+# If the device supports ARM, then respect ARM_THUMB_OPT (which can be "arm" or "thumb")
+# If the defice doesn't support ARM, then always set "thumb" even when
+# some recipe explicitly sets ARM_INSTRUCTION_SET to "arm"
+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', True)
+ if selected == None:
+ return
+ used = d.getVar('ARM_M_OPT', True)
+ if selected != used:
+ pn = d.getVar('PN', True)
+ 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', True) == '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/import-layers/yocto-poky/meta/conf/machine/include/arm/feature-arm-vfp.inc b/import-layers/yocto-poky/meta/conf/machine/include/arm/feature-arm-vfp.inc
new file mode 100644
index 000000000..4247255c5
--- /dev/null
+++ b/import-layers/yocto-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', True).split()[-1]) if (d.getVar('TUNE_CCARGS_MFPU', True) != '') else ''}"
+ARMPKGSFX_FPU = "${@ ('-%s' % d.getVar('TUNE_CCARGS_MFPU', True).split()[-1]) if (d.getVar('TUNE_CCARGS_MFPU', True) != '') 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', True) != '') else '' }"
+TUNE_CCARGS .= "${@ ' -mfloat-abi=${TUNE_CCARGS_MFLOAT}' if (d.getVar('TUNE_CCARGS_MFLOAT', True) != '') else ''}"
+ARMPKGSFX_EABI = "${@ 'hf' if (d.getVar('TUNE_CCARGS_MFLOAT', True) == 'hard') else ''}"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/mips/README b/import-layers/yocto-poky/meta/conf/machine/include/mips/README
new file mode 100644
index 000000000..c375f316d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/include/mips/README
@@ -0,0 +1,36 @@
+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
+
+TUNE_ARCH, the GNU canonical arch, is defined as:
+
+mips${MIPSPKGSFX_BYTE}${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_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.
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/mips/arch-mips.inc b/import-layers/yocto-poky/meta/conf/machine/include/mips/arch-mips.inc
new file mode 100644
index 000000000..89d17e7c2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/include/mips/arch-mips.inc
@@ -0,0 +1,102 @@
+# 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.contains('TUNE_FEATURES', 'n32', 'n32', '' ,d)}"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'n32', ' -mabi=n32', '', 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)}"
+
+# Package naming
+MIPSPKGSFX_ENDIAN = "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', '', '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)}"
+
+TUNE_ARCH = "mips${MIPSPKGSFX_BYTE}${MIPSPKGSFX_ENDIAN}"
+TUNE_PKGARCH = "${MIPSPKGSFX_VARIANT_tune-${DEFAULTTUNE}}${MIPSPKGSFX_FPU}${MIPSPKGSFX_ABI}"
+
+# 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"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/powerpc/README b/import-layers/yocto-poky/meta/conf/machine/include/powerpc/README
new file mode 100644
index 000000000..e87fb5082
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/powerpc/arch-powerpc.inc b/import-layers/yocto-poky/meta/conf/machine/include/powerpc/arch-powerpc.inc
new file mode 100644
index 000000000..9cf6b88fd
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/powerpc/arch-powerpc64.inc b/import-layers/yocto-poky/meta/conf/machine/include/powerpc/arch-powerpc64.inc
new file mode 100644
index 000000000..49419b6e0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/include/powerpc/arch-powerpc64.inc
@@ -0,0 +1,14 @@
+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)}"
+
+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/import-layers/yocto-poky/meta/conf/machine/include/qemu.inc b/import-layers/yocto-poky/meta/conf/machine/include/qemu.inc
new file mode 100644
index 000000000..f44dbe658
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/include/qemu.inc
@@ -0,0 +1,31 @@
+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-input-evdev \
+ xf86-input-mouse \
+ xf86-video-fbdev \
+ xf86-input-keyboard"
+
+MACHINE_FEATURES = "alsa bluetooth usbgadget screen"
+
+MACHINEOVERRIDES =. "qemuall:"
+
+IMAGE_FSTYPES += "tar.bz2 ext4"
+
+# Don't include kernels in standard images
+RDEPENDS_kernel-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"
+
+MACHINE_EXTRA_RRECOMMENDS += "rng-tools"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/sh/README b/import-layers/yocto-poky/meta/conf/machine/include/sh/README
new file mode 100644
index 000000000..b351acdd2
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/sh/arch-sh.inc b/import-layers/yocto-poky/meta/conf/machine/include/sh/arch-sh.inc
new file mode 100644
index 000000000..bdfbf52ca
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/soc-family.inc b/import-layers/yocto-poky/meta/conf/machine/include/soc-family.inc
new file mode 100644
index 000000000..1ff089981
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/tune-arm1136jf-s.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-arm1136jf-s.inc
new file mode 100644
index 000000000..53994ef36
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/include/tune-arm1136jf-s.inc
@@ -0,0 +1,11 @@
+DEFAULTTUNE ?= "armv6"
+
+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/import-layers/yocto-poky/meta/conf/machine/include/tune-arm920t.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-arm920t.inc
new file mode 100644
index 000000000..c6e74b677
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/tune-arm926ejs.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-arm926ejs.inc
new file mode 100644
index 000000000..81bcda339
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/tune-arm9tdmi.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-arm9tdmi.inc
new file mode 100644
index 000000000..e9c2b8fcf
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/tune-atom.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-atom.inc
new file mode 100644
index 000000000..5e1bb74c6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/tune-c3.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-c3.inc
new file mode 100644
index 000000000..1b272b250
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/tune-core2.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-core2.inc
new file mode 100644
index 000000000..f4ba43fbf
--- /dev/null
+++ b/import-layers/yocto-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"
+
+# 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[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-i586} core2-32"
+
+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"
+
+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"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/tune-corei7.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-corei7.inc
new file mode 100644
index 000000000..6edfb680e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa15.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa15.inc
new file mode 100644
index 000000000..a33b27f32
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa15.inc
@@ -0,0 +1,48 @@
+DEFAULTTUNE ?= "armv7ve-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/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa17.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa17.inc
new file mode 100644
index 000000000..d08b00296
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa17.inc
@@ -0,0 +1,48 @@
+DEFAULTTUNE ?= "armv7ve-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/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa5.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa5.inc
new file mode 100644
index 000000000..c7e5ab96a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa5.inc
@@ -0,0 +1,36 @@
+DEFAULTTUNE ?= "armv7a-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/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa7.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa7.inc
new file mode 100644
index 000000000..10b6ea7f3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa7.inc
@@ -0,0 +1,48 @@
+DEFAULTTUNE ?= "armv7ve-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/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa8.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa8.inc
new file mode 100644
index 000000000..c8ce02169
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa8.inc
@@ -0,0 +1,36 @@
+DEFAULTTUNE ?= "armv7a-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/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa9.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa9.inc
new file mode 100644
index 000000000..3d8dc1d8c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/include/tune-cortexa9.inc
@@ -0,0 +1,51 @@
+DEFAULTTUNE ?= "armv7a-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/import-layers/yocto-poky/meta/conf/machine/include/tune-ep9312.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-ep9312.inc
new file mode 100644
index 000000000..84ca528d6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/tune-i586-nlp.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-i586-nlp.inc
new file mode 100644
index 000000000..88e59038f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/tune-i586.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-i586.inc
new file mode 100644
index 000000000..1ab17bd40
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/tune-iwmmxt.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-iwmmxt.inc
new file mode 100644
index 000000000..f27423cb2
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/tune-mips32.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-mips32.inc
new file mode 100644
index 000000000..ce0445f84
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/include/tune-mips32.inc
@@ -0,0 +1,25 @@
+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)}"
+
+AVAILTUNES += "mips32 mips32el mips32-nf mips32el-nf"
+
+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"
+
+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/import-layers/yocto-poky/meta/conf/machine/include/tune-mips32r2.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-mips32r2.inc
new file mode 100644
index 000000000..0e95ec852
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/include/tune-mips32r2.inc
@@ -0,0 +1,17 @@
+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)}"
+
+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"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/tune-mips64.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-mips64.inc
new file mode 100644
index 000000000..9be0e0f8d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/include/tune-mips64.inc
@@ -0,0 +1,3 @@
+DEFAULTTUNE ?= "mips64"
+
+require conf/machine/include/tune-mips32r2.inc
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/tune-octeon.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-octeon.inc
new file mode 100644
index 000000000..b5deb8fd8
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/tune-power5.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-power5.inc
new file mode 100644
index 000000000..a346c309a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/tune-power6.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-power6.inc
new file mode 100644
index 000000000..ee200f97b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/tune-power7.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-power7.inc
new file mode 100644
index 000000000..3a27719be
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/tune-ppc476.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-ppc476.inc
new file mode 100644
index 000000000..d0011ff21
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/tune-ppc603e.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-ppc603e.inc
new file mode 100644
index 000000000..13f60dd06
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/tune-ppc7400.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-ppc7400.inc
new file mode 100644
index 000000000..425e8bd21
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/tune-ppce300c2.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-ppce300c2.inc
new file mode 100644
index 000000000..af21f601a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/tune-ppce300c3.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-ppce300c3.inc
new file mode 100644
index 000000000..a3d836c50
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/tune-ppce500.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-ppce500.inc
new file mode 100644
index 000000000..96073d2d0
--- /dev/null
+++ b/import-layers/yocto-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.contains('TUNE_FEATURES', 'spe', '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/import-layers/yocto-poky/meta/conf/machine/include/tune-ppce500mc.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-ppce500mc.inc
new file mode 100644
index 000000000..a1ca9be4f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/include/tune-ppce500mc.inc
@@ -0,0 +1,14 @@
+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)}"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/tune-ppce500v2.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-ppce500v2.inc
new file mode 100644
index 000000000..20a5f25b6
--- /dev/null
+++ b/import-layers/yocto-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.contains('TUNE_FEATURES', 'spe', '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/import-layers/yocto-poky/meta/conf/machine/include/tune-ppce5500.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-ppce5500.inc
new file mode 100644
index 000000000..ace26146a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/include/tune-ppce5500.inc
@@ -0,0 +1,20 @@
+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)}"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/tune-ppce6500.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-ppce6500.inc
new file mode 100644
index 000000000..da1e864e5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/include/tune-ppce6500.inc
@@ -0,0 +1,21 @@
+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)}"
diff --git a/import-layers/yocto-poky/meta/conf/machine/include/tune-sh3.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-sh3.inc
new file mode 100644
index 000000000..80df9a0b6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/tune-sh4.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-sh4.inc
new file mode 100644
index 000000000..4160c30e1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/tune-strongarm1100.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-strongarm1100.inc
new file mode 100644
index 000000000..80cfb8ab8
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/tune-supersparc.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-supersparc.inc
new file mode 100644
index 000000000..0faa361f1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/tune-thunderx.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-thunderx.inc
new file mode 100644
index 000000000..3d43b0f7e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/tune-xscale.inc b/import-layers/yocto-poky/meta/conf/machine/include/tune-xscale.inc
new file mode 100644
index 000000000..0d0733395
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/x86-base.inc b/import-layers/yocto-poky/meta/conf/machine/include/x86-base.inc
new file mode 100644
index 000000000..5663145be
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/include/x86-base.inc
@@ -0,0 +1,52 @@
+#
+# 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"
+
+KERNEL_IMAGETYPE ?= "bzImage"
+
+SERIAL_CONSOLE ?= "115200 ttyS0"
+
+#
+# kernel-related variables
+#
+PREFERRED_PROVIDER_virtual/kernel ??= "linux-yocto"
+PREFERRED_VERSION_linux-yocto ??= "4.4%"
+
+#
+# XSERVER subcomponents, used to build the XSERVER variable
+#
+XSERVER_X86_BASE = "xserver-xorg \
+ xf86-input-mouse \
+ xf86-input-keyboard \
+ xf86-input-evdev \
+ xf86-input-synaptics \
+ "
+
+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/import-layers/yocto-poky/meta/conf/machine/include/x86/README b/import-layers/yocto-poky/meta/conf/machine/include/x86/README
new file mode 100644
index 000000000..2b6c46c7e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/conf/machine/include/x86/arch-x86.inc b/import-layers/yocto-poky/meta/conf/machine/include/x86/arch-x86.inc
new file mode 100644
index 000000000..e51d595f7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/include/x86/arch-x86.inc
@@ -0,0 +1,53 @@
+#
+# 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)}"
+
+# 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/import-layers/yocto-poky/meta/conf/machine/qemuarm.conf b/import-layers/yocto-poky/meta/conf/machine/qemuarm.conf
new file mode 100644
index 000000000..cdad03fc4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/qemuarm.conf
@@ -0,0 +1,12 @@
+#@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"
+
diff --git a/import-layers/yocto-poky/meta/conf/machine/qemuarm64.conf b/import-layers/yocto-poky/meta/conf/machine/qemuarm64.conf
new file mode 100644
index 000000000..f59fb15c5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/qemuarm64.conf
@@ -0,0 +1,10 @@
+#@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"
diff --git a/import-layers/yocto-poky/meta/conf/machine/qemumips.conf b/import-layers/yocto-poky/meta/conf/machine/qemumips.conf
new file mode 100644
index 000000000..fbf813740
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/qemumips.conf
@@ -0,0 +1,13 @@
+#@TYPE: Machine
+#@NAME: mti_malta32_be MIPS
+#@DESCRIPTION: mti_malta32_be
+
+require conf/machine/include/qemu.inc
+require conf/machine/include/tune-mips32r2.inc
+
+KERNEL_IMAGETYPE = "vmlinux"
+KERNEL_ALT_IMAGETYPE = "vmlinux.bin"
+
+SERIAL_CONSOLES = "115200;ttyS0 115200;ttyS1"
+
+MACHINE_EXTRA_RRECOMMENDS = " kernel-modules"
diff --git a/import-layers/yocto-poky/meta/conf/machine/qemumips64.conf b/import-layers/yocto-poky/meta/conf/machine/qemumips64.conf
new file mode 100644
index 000000000..8c3f1fe28
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/qemumips64.conf
@@ -0,0 +1,13 @@
+#@TYPE: Machine
+#@NAME: mti-malta64-be MIPS64
+#@DESCRIPTION: mti-malta64-be
+
+require conf/machine/include/qemu.inc
+require conf/machine/include/tune-mips64.inc
+
+KERNEL_IMAGETYPE = "vmlinux"
+KERNEL_ALT_IMAGETYPE = "vmlinux.bin"
+
+SERIAL_CONSOLES = "115200;ttyS0 115200;ttyS1"
+
+MACHINE_EXTRA_RRECOMMENDS = " kernel-modules"
diff --git a/import-layers/yocto-poky/meta/conf/machine/qemuppc.conf b/import-layers/yocto-poky/meta/conf/machine/qemuppc.conf
new file mode 100644
index 000000000..bf0038ddb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/qemuppc.conf
@@ -0,0 +1,13 @@
+#@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"
+
diff --git a/import-layers/yocto-poky/meta/conf/machine/qemux86-64.conf b/import-layers/yocto-poky/meta/conf/machine/qemux86-64.conf
new file mode 100644
index 000000000..489194aa6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/qemux86-64.conf
@@ -0,0 +1,29 @@
+#@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
+
+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-input-vmmouse \
+ xf86-input-keyboard \
+ xf86-input-evdev \
+ xf86-video-cirrus \
+ xf86-video-fbdev \
+ xf86-video-vmware"
+
+MACHINE_FEATURES += "x86"
+
+MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "v86d"
diff --git a/import-layers/yocto-poky/meta/conf/machine/qemux86.conf b/import-layers/yocto-poky/meta/conf/machine/qemux86.conf
new file mode 100644
index 000000000..3cc809158
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/machine/qemux86.conf
@@ -0,0 +1,28 @@
+#@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
+
+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-input-vmmouse \
+ xf86-input-keyboard \
+ xf86-input-evdev \
+ xf86-video-cirrus \
+ xf86-video-fbdev \
+ xf86-video-vmware"
+
+MACHINE_FEATURES += "x86"
+
+MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "v86d"
diff --git a/import-layers/yocto-poky/meta/conf/migrate_localcount.conf b/import-layers/yocto-poky/meta/conf/migrate_localcount.conf
new file mode 100644
index 000000000..e486e03e5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/migrate_localcount.conf
@@ -0,0 +1 @@
+INHERIT += "migrate_localcount"
diff --git a/import-layers/yocto-poky/meta/conf/multilib.conf b/import-layers/yocto-poky/meta/conf/multilib.conf
new file mode 100644
index 000000000..50303fb5d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/multilib.conf
@@ -0,0 +1,27 @@
+
+baselib = "${@d.getVar('BASE_LIB_tune-' + (d.getVar('DEFAULTTUNE', True) or 'INVALID'), True) or d.getVar('BASELIB', True)}"
+
+MULTILIB_VARIANTS = "${@extend_variants(d,'MULTILIBS','multilib')}"
+MULTILIB_SAVE_VARNAME = "DEFAULTTUNE TARGET_ARCH TARGET_SYS TARGET_VENDOR"
+
+MULTILIBS ??= "multilib:lib32"
+
+STAGING_DIR_HOST = "${STAGING_DIR}/${MLPREFIX}${MACHINE}"
+STAGING_DIR_TARGET = "${STAGING_DIR}/${MLPREFIX}${MACHINE}"
+PKGDATA_DIR = "${STAGING_DIR}/${MACHINE}/pkgdata"
+
+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 .= ":${STAGING_DIR}/${MACHINE}${datadir}/pkgconfig"
+PKG_CONFIG_PATH[vardepsexclude] = "MACHINE"
diff --git a/import-layers/yocto-poky/meta/conf/prexport.conf b/import-layers/yocto-poky/meta/conf/prexport.conf
new file mode 100644
index 000000000..12f3acb2d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/prexport.conf
@@ -0,0 +1 @@
+INHERIT += "prexport"
diff --git a/import-layers/yocto-poky/meta/conf/primport.conf b/import-layers/yocto-poky/meta/conf/primport.conf
new file mode 100644
index 000000000..d94ea1b1e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/primport.conf
@@ -0,0 +1 @@
+INHERIT += "primport"
diff --git a/import-layers/yocto-poky/meta/conf/sanity.conf b/import-layers/yocto-poky/meta/conf/sanity.conf
new file mode 100644
index 000000000..7021bf929
--- /dev/null
+++ b/import-layers/yocto-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.29.1"
+
+SANITY_ABIFILE = "${TMPDIR}/abi_version"
+
+SANITY_VERSION ?= "1"
+LOCALCONF_VERSION ?= "1"
+LAYER_CONF_VERSION ?= "7"
+SITE_CONF_VERSION ?= "1"
+
+INHERIT += "sanity"
+
diff --git a/import-layers/yocto-poky/meta/conf/swabber/Ubuntu-10.04.1-64/blacklist b/import-layers/yocto-poky/meta/conf/swabber/Ubuntu-10.04.1-64/blacklist
new file mode 100644
index 000000000..5fdb8f2b9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/swabber/Ubuntu-10.04.1-64/blacklist
@@ -0,0 +1,6 @@
+libneon27-gnutls
+openjdk-6-jre-headless
+openjdk-6-jre-lib
+openjdk-6-jre
+libdbus-1-3
+libneon27-gnutls
diff --git a/import-layers/yocto-poky/meta/conf/swabber/Ubuntu-10.04.1-64/filters b/import-layers/yocto-poky/meta/conf/swabber/Ubuntu-10.04.1-64/filters
new file mode 100644
index 000000000..a447f70e9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/swabber/Ubuntu-10.04.1-64/filters
@@ -0,0 +1,7 @@
+/usr/local/lib/python2.6
+/usr/lib/python2.6
+/usr/lib/pymodules/python2.6
+/usr/lib/perl/5.10
+# which is part of the debianutils packages, but we don't want to put the entire
+# debianutils package in the whitelist.
+/usr/bin/which
diff --git a/import-layers/yocto-poky/meta/conf/swabber/Ubuntu-10.04.1-64/whitelist b/import-layers/yocto-poky/meta/conf/swabber/Ubuntu-10.04.1-64/whitelist
new file mode 100644
index 000000000..f0fe9633d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/swabber/Ubuntu-10.04.1-64/whitelist
@@ -0,0 +1,23 @@
+base-files
+dash
+libacl1
+libattr1
+libbz2-1.0
+libc6
+libc-bin
+libglib2.0-0
+libncurses5
+libselinux1
+libsqlite3-0
+libssl0.9.8
+mime-support
+perl-base
+python2.6
+python2.6-minimal
+python-apport
+python-gst0.10
+python-imaging
+python-minimal
+python-support
+python-zope.interface
+zlib1g
diff --git a/import-layers/yocto-poky/meta/conf/swabber/generic/blacklist b/import-layers/yocto-poky/meta/conf/swabber/generic/blacklist
new file mode 100644
index 000000000..396bcb4bf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/swabber/generic/blacklist
@@ -0,0 +1,2 @@
+udev
+dkpg
diff --git a/import-layers/yocto-poky/meta/conf/swabber/generic/filters b/import-layers/yocto-poky/meta/conf/swabber/generic/filters
new file mode 100644
index 000000000..3b10fcb37
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/swabber/generic/filters
@@ -0,0 +1,10 @@
+/tmp
+/etc/localtime
+/etc/ld.so.cache
+/etc/ld.so.conf
+/etc/passwd
+/etc/group
+/etc/nsswitch.conf
+/proc
+/dev/null
+/dev/tty
diff --git a/import-layers/yocto-poky/meta/conf/swabber/generic/whitelist b/import-layers/yocto-poky/meta/conf/swabber/generic/whitelist
new file mode 100644
index 000000000..48ec2af2c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/swabber/generic/whitelist
@@ -0,0 +1,15 @@
+bash
+bzip2
+ccache
+coreutils
+cpp
+file
+findutils
+gawk
+grep
+hostname
+make
+sed
+tar
+util-linux
+zlib1g
diff --git a/import-layers/yocto-poky/meta/conf/toasterconf.json b/import-layers/yocto-poky/meta/conf/toasterconf.json
new file mode 100644
index 000000000..c27880e10
--- /dev/null
+++ b/import-layers/yocto-poky/meta/conf/toasterconf.json
@@ -0,0 +1,107 @@
+{
+ "config": {
+ "MACHINE" : "qemux86",
+ "DISTRO" : "nodistro",
+ "DL_DIR" : "${TOPDIR}/../downloads",
+ "IMAGE_FSTYPES": "ext4 jffs2 tar.bz2",
+ "IMAGE_INSTALL_append": "",
+ "PACKAGE_CLASSES": "package_rpm",
+ "SSTATE_DIR" : "${TOPDIR}/../sstate-cache"
+ },
+ "layersources": [
+ {
+ "name": "Local OpenEmbedded",
+ "sourcetype": "local",
+ "apiurl": "../../",
+ "branches": ["HEAD", "master", "jethro", "krogoth"],
+ "layers": [
+ {
+ "name": "openembedded-core",
+ "local_path": "meta",
+ "vcs_url": "remote:origin",
+ "dirpath": "meta"
+ }
+ ]
+ },
+ {
+ "name": "OpenEmbedded",
+ "sourcetype": "layerindex",
+ "apiurl": "http://layers.openembedded.org/layerindex/api/",
+ "branches": ["master", "jethro", "krogoth"]
+ },
+ {
+ "name": "Imported layers",
+ "sourcetype": "imported",
+ "apiurl": "",
+ "branches": ["master", "jethro", "krogoth", "HEAD"]
+
+ }
+ ],
+ "bitbake" : [
+ {
+ "name": "master",
+ "giturl": "git://git.openembedded.org/bitbake",
+ "branch": "master",
+ "dirpath": ""
+ },
+ {
+ "name": "jethro",
+ "giturl": "git://git.openembedded.org/bitbake",
+ "branch": "1.28",
+ "dirpath": ""
+ },
+ {
+ "name": "krogoth",
+ "giturl": "git://git.openembedded.org/bitbake",
+ "branch": "1.30",
+ "dirpath": ""
+ },
+ {
+ "name": "HEAD",
+ "giturl": "git://git.openembedded.org/bitbake",
+ "branch": "HEAD",
+ "dirpath": ""
+ }
+ ],
+
+ "defaultrelease": "master",
+
+ "releases": [
+ {
+ "name": "master",
+ "description": "OpenEmbedded master",
+ "bitbake": "master",
+ "branch": "master",
+ "defaultlayers": [ "openembedded-core" ],
+ "layersourcepriority": { "Imported layers": 99, "Local OpenEmbedded" : 10, "OpenEmbedded" : 0 },
+ "helptext": "Toaster will run your builds using the tip of the <a href=\"http://cgit.openembedded.org/openembedded-core/log/\">OpenEmbedded master</a> branch, where active development takes place. This is not a stable branch, so your builds might not work as expected."
+ },
+ {
+ "name": "jethro",
+ "description": "OpenEmbedded Jethro",
+ "bitbake": "jethro",
+ "branch": "jethro",
+ "defaultlayers": [ "openembedded-core" ],
+ "layersourcepriority": { "Imported layers": 99, "Local OpenEmbedded" : 10, "OpenEmbedded" : 0 },
+ "helptext": "Toaster will run your builds with the tip of the <a href=\"http://cgit.openembedded.org/openembedded-core/log/?h=jethro\">OpenEmbedded \"Jethro\"</a> branch"
+ },
+ {
+ "name": "krogoth",
+ "description": "OpenEmbedded Krogoth",
+ "bitbake": "krogoth",
+ "branch": "krogoth",
+ "defaultlayers": [ "openembedded-core" ],
+ "layersourcepriority": { "Imported layers": 99, "Local OpenEmbedded" : 10, "OpenEmbedded" : 0 },
+ "helptext": "Toaster will run your builds with the tip of the <a href=\"http://cgit.openembedded.org/openembedded-core/log/?h=krogoth\">OpenEmbedded \"Krogoth\"</a> branch"
+ },
+ {
+ "name": "local",
+ "description": "Local OpenEmbedded",
+ "bitbake": "HEAD",
+ "branch": "HEAD",
+ "defaultlayers": [ "openembedded-core" ],
+ "layersourcepriority": { "Imported layers": 99, "Local OpenEmbedded" : 10, "OpenEmbedded" : 0 },
+ "helptext": "Toaster will run your builds with the version of OpenEmbedded that you have cloned or downloaded to your computer."
+ }
+ ]
+}
diff --git a/import-layers/yocto-poky/meta/files/common-licenses/AAL b/import-layers/yocto-poky/meta/files/common-licenses/AAL
new file mode 100644
index 000000000..54842265f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/AFL-1.2 b/import-layers/yocto-poky/meta/files/common-licenses/AFL-1.2
new file mode 100644
index 000000000..e8131e722
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/AFL-2.0 b/import-layers/yocto-poky/meta/files/common-licenses/AFL-2.0
new file mode 100644
index 000000000..ad27a28d1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/AFL-2.1 b/import-layers/yocto-poky/meta/files/common-licenses/AFL-2.1
new file mode 100644
index 000000000..0284e4f5d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/AFL-3.0 b/import-layers/yocto-poky/meta/files/common-licenses/AFL-3.0
new file mode 100644
index 000000000..126c259e4
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/AGPL-3.0 b/import-layers/yocto-poky/meta/files/common-licenses/AGPL-3.0
new file mode 100644
index 000000000..dba13ed2d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/ANTLR-PD b/import-layers/yocto-poky/meta/files/common-licenses/ANTLR-PD
new file mode 100644
index 000000000..8b02a8c13
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/APL-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/APL-1.0
new file mode 100644
index 000000000..4805b1cb6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/APSL-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/APSL-1.0
new file mode 100644
index 000000000..024f8228a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/APSL-1.1 b/import-layers/yocto-poky/meta/files/common-licenses/APSL-1.1
new file mode 100644
index 000000000..425e46e21
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/APSL-1.2 b/import-layers/yocto-poky/meta/files/common-licenses/APSL-1.2
new file mode 100644
index 000000000..58e3530b8
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/APSL-2.0 b/import-layers/yocto-poky/meta/files/common-licenses/APSL-2.0
new file mode 100644
index 000000000..d12e8b47f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/Adobe b/import-layers/yocto-poky/meta/files/common-licenses/Adobe
new file mode 100644
index 000000000..64779da1d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/Apache-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/Apache-1.0
new file mode 100644
index 000000000..26e90892f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/Apache-1.1 b/import-layers/yocto-poky/meta/files/common-licenses/Apache-1.1
new file mode 100644
index 000000000..c25ec0056
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/Apache-2.0 b/import-layers/yocto-poky/meta/files/common-licenses/Apache-2.0
new file mode 100644
index 000000000..b3201abff
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/Artistic-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/Artistic-1.0
new file mode 100644
index 000000000..807e4d258
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/Artistic-2.0 b/import-layers/yocto-poky/meta/files/common-licenses/Artistic-2.0
new file mode 100644
index 000000000..c0f8d19db
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/BSD b/import-layers/yocto-poky/meta/files/common-licenses/BSD
new file mode 100644
index 000000000..c7a0aa4f9
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/BSD-0-Clause b/import-layers/yocto-poky/meta/files/common-licenses/BSD-0-Clause
new file mode 100644
index 000000000..328bdd6ae
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/BSD-2-Clause b/import-layers/yocto-poky/meta/files/common-licenses/BSD-2-Clause
new file mode 100644
index 000000000..ade0f34d5
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/BSD-3-Clause b/import-layers/yocto-poky/meta/files/common-licenses/BSD-3-Clause
new file mode 100644
index 000000000..d13865eba
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/BSD-4-Clause b/import-layers/yocto-poky/meta/files/common-licenses/BSD-4-Clause
new file mode 100644
index 000000000..7b162dec0
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/BSL-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/BSL-1.0
new file mode 100644
index 000000000..8ea8eae49
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/BitstreamVera b/import-layers/yocto-poky/meta/files/common-licenses/BitstreamVera
new file mode 100644
index 000000000..e6f03aa57
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CATOSL-1.1 b/import-layers/yocto-poky/meta/files/common-licenses/CATOSL-1.1
new file mode 100644
index 000000000..63e8a56b6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-1.0
new file mode 100644
index 000000000..ca0b75207
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-2.0 b/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-2.0
new file mode 100644
index 000000000..0e17a453e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-2.5 b/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-2.5
new file mode 100644
index 000000000..2e3d1932f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-3.0 b/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-3.0
new file mode 100644
index 000000000..593d56291
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-1.0
new file mode 100644
index 000000000..6c5d22995
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-2.0 b/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-2.0
new file mode 100644
index 000000000..4dc517691
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-2.5 b/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-2.5
new file mode 100644
index 000000000..98e61e1f3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-3.0 b/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-3.0
new file mode 100644
index 000000000..cf3425dcb
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-ND-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-ND-1.0
new file mode 100644
index 000000000..b17d84e6d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-ND-2.0 b/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-ND-2.0
new file mode 100644
index 000000000..f46c17033
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-ND-2.5 b/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-ND-2.5
new file mode 100644
index 000000000..cb7aa599a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-ND-3.0 b/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-ND-3.0
new file mode 100644
index 000000000..3c954dbf1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-SA-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-SA-1.0
new file mode 100644
index 000000000..239fd6a07
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-SA-2.0 b/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-SA-2.0
new file mode 100644
index 000000000..9f07f8124
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-SA-2.5 b/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-SA-2.5
new file mode 100644
index 000000000..025cccab6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-SA-3.0 b/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-NC-SA-3.0
new file mode 100644
index 000000000..d0cb1c557
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-ND-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-ND-1.0
new file mode 100644
index 000000000..7358186f6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-ND-2.0 b/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-ND-2.0
new file mode 100644
index 000000000..d2c974b1a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-ND-2.5 b/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-ND-2.5
new file mode 100644
index 000000000..b5e4546d7
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-ND-3.0 b/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-ND-3.0
new file mode 100644
index 000000000..4f64e30dc
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-SA-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-SA-1.0
new file mode 100644
index 000000000..9f1394b02
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-SA-2.0 b/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-SA-2.0
new file mode 100644
index 000000000..a82434afc
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-SA-2.5 b/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-SA-2.5
new file mode 100644
index 000000000..7f8dd5c10
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-SA-3.0 b/import-layers/yocto-poky/meta/files/common-licenses/CC-BY-SA-3.0
new file mode 100644
index 000000000..70bbd6c90
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CC0-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/CC0-1.0
new file mode 100644
index 000000000..52cf88b9b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CDDL-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/CDDL-1.0
new file mode 100644
index 000000000..74198e7c5
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CECILL-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/CECILL-1.0
new file mode 100644
index 000000000..3d31745ba
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CECILL-2.0 b/import-layers/yocto-poky/meta/files/common-licenses/CECILL-2.0
new file mode 100644
index 000000000..7bc14a6a8
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CECILL-B b/import-layers/yocto-poky/meta/files/common-licenses/CECILL-B
new file mode 100644
index 000000000..1cc244f4c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CECILL-C b/import-layers/yocto-poky/meta/files/common-licenses/CECILL-C
new file mode 100644
index 000000000..7e8ef86e8
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CPAL-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/CPAL-1.0
new file mode 100644
index 000000000..aafb0e24a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CPL-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/CPL-1.0
new file mode 100644
index 000000000..517c20fb4
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/CUA-OPL-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/CUA-OPL-1.0
new file mode 100644
index 000000000..1ff59eb42
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/ClArtistic b/import-layers/yocto-poky/meta/files/common-licenses/ClArtistic
new file mode 100644
index 000000000..8d5a4aad8
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/DSSSL b/import-layers/yocto-poky/meta/files/common-licenses/DSSSL
new file mode 100644
index 000000000..7159dfbd6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/ECL-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/ECL-1.0
new file mode 100644
index 000000000..bbc8be107
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/ECL-2.0 b/import-layers/yocto-poky/meta/files/common-licenses/ECL-2.0
new file mode 100644
index 000000000..54c99e7ed
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/EDL-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/EDL-1.0
new file mode 100644
index 000000000..53b1eb045
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/EFL-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/EFL-1.0
new file mode 100644
index 000000000..c39960513
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/EFL-2.0 b/import-layers/yocto-poky/meta/files/common-licenses/EFL-2.0
new file mode 100644
index 000000000..be37f904a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/EPL-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/EPL-1.0
new file mode 100644
index 000000000..1d76e57b9
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/EUDatagrid b/import-layers/yocto-poky/meta/files/common-licenses/EUDatagrid
new file mode 100644
index 000000000..d96e50441
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/EUPL-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/EUPL-1.0
new file mode 100644
index 000000000..40ecbfe23
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/EUPL-1.1 b/import-layers/yocto-poky/meta/files/common-licenses/EUPL-1.1
new file mode 100644
index 000000000..6e1d84f77
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/Elfutils-Exception b/import-layers/yocto-poky/meta/files/common-licenses/Elfutils-Exception
new file mode 100644
index 000000000..627d76912
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/Entessa b/import-layers/yocto-poky/meta/files/common-licenses/Entessa
new file mode 100644
index 000000000..d4dadd226
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/ErlPL-1.1 b/import-layers/yocto-poky/meta/files/common-licenses/ErlPL-1.1
new file mode 100644
index 000000000..5961ccf4d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/FSF-Unlimited b/import-layers/yocto-poky/meta/files/common-licenses/FSF-Unlimited
new file mode 100644
index 000000000..010a981af
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/Fair b/import-layers/yocto-poky/meta/files/common-licenses/Fair
new file mode 100644
index 000000000..475b01db9
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/Frameworx-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/Frameworx-1.0
new file mode 100644
index 000000000..2abb1845a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/FreeType b/import-layers/yocto-poky/meta/files/common-licenses/FreeType
new file mode 100644
index 000000000..b7d4d11c0
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/GFDL-1.1 b/import-layers/yocto-poky/meta/files/common-licenses/GFDL-1.1
new file mode 100644
index 000000000..1d7422315
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/GFDL-1.2 b/import-layers/yocto-poky/meta/files/common-licenses/GFDL-1.2
new file mode 100644
index 000000000..ec872c6b8
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/GFDL-1.3 b/import-layers/yocto-poky/meta/files/common-licenses/GFDL-1.3
new file mode 100644
index 000000000..ab11a44a6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/GPL-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/GPL-1.0
new file mode 100644
index 000000000..9d4ef93ae
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/GPL-2-with-bison-exception b/import-layers/yocto-poky/meta/files/common-licenses/GPL-2-with-bison-exception
new file mode 100644
index 000000000..dd3427397
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/GPL-2.0 b/import-layers/yocto-poky/meta/files/common-licenses/GPL-2.0
new file mode 100644
index 000000000..7f5abbce2
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/GPL-2.0-with-GCC-exception b/import-layers/yocto-poky/meta/files/common-licenses/GPL-2.0-with-GCC-exception
new file mode 100644
index 000000000..ff8de09dc
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/GPL-2.0-with-OpenSSL-exception b/import-layers/yocto-poky/meta/files/common-licenses/GPL-2.0-with-OpenSSL-exception
new file mode 100644
index 000000000..7586c6225
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/GPL-2.0-with-autoconf-exception b/import-layers/yocto-poky/meta/files/common-licenses/GPL-2.0-with-autoconf-exception
new file mode 100644
index 000000000..a22aad7ed
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/GPL-2.0-with-classpath-exception b/import-layers/yocto-poky/meta/files/common-licenses/GPL-2.0-with-classpath-exception
new file mode 100644
index 000000000..8d3e9cdbd
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/GPL-2.0-with-font-exception b/import-layers/yocto-poky/meta/files/common-licenses/GPL-2.0-with-font-exception
new file mode 100644
index 000000000..abb42f9f9
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/GPL-3.0 b/import-layers/yocto-poky/meta/files/common-licenses/GPL-3.0
new file mode 100644
index 000000000..e0665a64a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/GPL-3.0-with-GCC-exception b/import-layers/yocto-poky/meta/files/common-licenses/GPL-3.0-with-GCC-exception
new file mode 100644
index 000000000..6c968b67e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/GPL-3.0-with-autoconf-exception b/import-layers/yocto-poky/meta/files/common-licenses/GPL-3.0-with-autoconf-exception
new file mode 100644
index 000000000..a86f0d7c8
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/HPND b/import-layers/yocto-poky/meta/files/common-licenses/HPND
new file mode 100644
index 000000000..274bbdb8f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/ICU b/import-layers/yocto-poky/meta/files/common-licenses/ICU
new file mode 100644
index 000000000..a29b6fb50
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/IPA b/import-layers/yocto-poky/meta/files/common-licenses/IPA
new file mode 100644
index 000000000..d465b1c58
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/IPL-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/IPL-1.0
new file mode 100644
index 000000000..2b136c9b3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/ISC b/import-layers/yocto-poky/meta/files/common-licenses/ISC
new file mode 100644
index 000000000..97af105b0
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/LGPL-2.0 b/import-layers/yocto-poky/meta/files/common-licenses/LGPL-2.0
new file mode 100644
index 000000000..5931d439b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/LGPL-2.1 b/import-layers/yocto-poky/meta/files/common-licenses/LGPL-2.1
new file mode 100644
index 000000000..a0e735a98
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/LGPL-3.0 b/import-layers/yocto-poky/meta/files/common-licenses/LGPL-3.0
new file mode 100644
index 000000000..6be29bf20
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/LPL-1.02 b/import-layers/yocto-poky/meta/files/common-licenses/LPL-1.02
new file mode 100644
index 000000000..e933748a6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/LPPL-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/LPPL-1.0
new file mode 100644
index 000000000..f9ef35d79
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/LPPL-1.1 b/import-layers/yocto-poky/meta/files/common-licenses/LPPL-1.1
new file mode 100644
index 000000000..808331998
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/LPPL-1.2 b/import-layers/yocto-poky/meta/files/common-licenses/LPPL-1.2
new file mode 100644
index 000000000..c391a47ef
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/LPPL-1.3c b/import-layers/yocto-poky/meta/files/common-licenses/LPPL-1.3c
new file mode 100644
index 000000000..755e3bb12
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/Libpng b/import-layers/yocto-poky/meta/files/common-licenses/Libpng
new file mode 100644
index 000000000..a9d5b031b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/MIT b/import-layers/yocto-poky/meta/files/common-licenses/MIT
new file mode 100644
index 000000000..33f8bef43
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/MPL-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/MPL-1.0
new file mode 100644
index 000000000..83dc3f624
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/MPL-1.1 b/import-layers/yocto-poky/meta/files/common-licenses/MPL-1.1
new file mode 100644
index 000000000..6aa8c4edc
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/MPL-2.0 b/import-layers/yocto-poky/meta/files/common-licenses/MPL-2.0
new file mode 100644
index 000000000..14e2f777f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/MS-PL b/import-layers/yocto-poky/meta/files/common-licenses/MS-PL
new file mode 100644
index 000000000..e90d6b4fd
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/MS-RL b/import-layers/yocto-poky/meta/files/common-licenses/MS-RL
new file mode 100644
index 000000000..f703c0d3d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/MirOS b/import-layers/yocto-poky/meta/files/common-licenses/MirOS
new file mode 100644
index 000000000..146768e28
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/Motosoto b/import-layers/yocto-poky/meta/files/common-licenses/Motosoto
new file mode 100644
index 000000000..7a524f62b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/Multics b/import-layers/yocto-poky/meta/files/common-licenses/Multics
new file mode 100644
index 000000000..a487645d8
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/NASA-1.3 b/import-layers/yocto-poky/meta/files/common-licenses/NASA-1.3
new file mode 100644
index 000000000..123182d89
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/NCSA b/import-layers/yocto-poky/meta/files/common-licenses/NCSA
new file mode 100644
index 000000000..d0ddc9b07
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/NGPL b/import-layers/yocto-poky/meta/files/common-licenses/NGPL
new file mode 100644
index 000000000..2096eab0f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/NPOSL-3.0 b/import-layers/yocto-poky/meta/files/common-licenses/NPOSL-3.0
new file mode 100644
index 000000000..3a2a66237
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/NTP b/import-layers/yocto-poky/meta/files/common-licenses/NTP
new file mode 100644
index 000000000..b3572b0b4
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/Nauman b/import-layers/yocto-poky/meta/files/common-licenses/Nauman
new file mode 100644
index 000000000..69ce785ff
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/Nokia b/import-layers/yocto-poky/meta/files/common-licenses/Nokia
new file mode 100644
index 000000000..0037716df
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/OASIS b/import-layers/yocto-poky/meta/files/common-licenses/OASIS
new file mode 100644
index 000000000..f93df7af2
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/OCLC-2.0 b/import-layers/yocto-poky/meta/files/common-licenses/OCLC-2.0
new file mode 100644
index 000000000..139e3f7e0
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/ODbL-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/ODbL-1.0
new file mode 100644
index 000000000..c9f144eb2
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/OFL-1.1 b/import-layers/yocto-poky/meta/files/common-licenses/OFL-1.1
new file mode 100644
index 000000000..e644bce64
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/OGTSL b/import-layers/yocto-poky/meta/files/common-licenses/OGTSL
new file mode 100644
index 000000000..8a0cad7e0
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/OLDAP-2.8 b/import-layers/yocto-poky/meta/files/common-licenses/OLDAP-2.8
new file mode 100644
index 000000000..be253da41
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/OSL-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/OSL-1.0
new file mode 100644
index 000000000..85ad0dadb
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/OSL-2.0 b/import-layers/yocto-poky/meta/files/common-licenses/OSL-2.0
new file mode 100644
index 000000000..9fe5c9eda
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/OSL-3.0 b/import-layers/yocto-poky/meta/files/common-licenses/OSL-3.0
new file mode 100644
index 000000000..1557749e7
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/OpenSSL b/import-layers/yocto-poky/meta/files/common-licenses/OpenSSL
new file mode 100644
index 000000000..d4270a332
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/PD b/import-layers/yocto-poky/meta/files/common-licenses/PD
new file mode 100644
index 000000000..21fb878e6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/files/common-licenses/PD
@@ -0,0 +1 @@
+This is a placeholder for the Public Domain License
diff --git a/import-layers/yocto-poky/meta/files/common-licenses/PHP-3.0 b/import-layers/yocto-poky/meta/files/common-licenses/PHP-3.0
new file mode 100644
index 000000000..ef0b20306
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/ParaTypeFFL-1.3 b/import-layers/yocto-poky/meta/files/common-licenses/ParaTypeFFL-1.3
new file mode 100644
index 000000000..8357965be
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/PostgreSQL b/import-layers/yocto-poky/meta/files/common-licenses/PostgreSQL
new file mode 100644
index 000000000..ae658dc12
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/Proprietary b/import-layers/yocto-poky/meta/files/common-licenses/Proprietary
new file mode 100644
index 000000000..661875810
--- /dev/null
+++ b/import-layers/yocto-poky/meta/files/common-licenses/Proprietary
@@ -0,0 +1 @@
+Proprietary license.
diff --git a/import-layers/yocto-poky/meta/files/common-licenses/Python-2.0 b/import-layers/yocto-poky/meta/files/common-licenses/Python-2.0
new file mode 100644
index 000000000..9d3e86215
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/QPL-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/QPL-1.0
new file mode 100644
index 000000000..7d433ab26
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/RHeCos-1 b/import-layers/yocto-poky/meta/files/common-licenses/RHeCos-1
new file mode 100644
index 000000000..2ab40b77d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/RHeCos-1.1 b/import-layers/yocto-poky/meta/files/common-licenses/RHeCos-1.1
new file mode 100644
index 000000000..f98900abf
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/RPL-1.5 b/import-layers/yocto-poky/meta/files/common-licenses/RPL-1.5
new file mode 100644
index 000000000..21908751e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/RPSL-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/RPSL-1.0
new file mode 100644
index 000000000..80814f95d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/RSCPL b/import-layers/yocto-poky/meta/files/common-licenses/RSCPL
new file mode 100644
index 000000000..bedbbc1e8
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/Ruby b/import-layers/yocto-poky/meta/files/common-licenses/Ruby
new file mode 100644
index 000000000..bc2e57f89
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/SAX-PD b/import-layers/yocto-poky/meta/files/common-licenses/SAX-PD
new file mode 100644
index 000000000..a1fd1130f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/SGI-1 b/import-layers/yocto-poky/meta/files/common-licenses/SGI-1
new file mode 100644
index 000000000..e3998567e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/SMAIL_GPL b/import-layers/yocto-poky/meta/files/common-licenses/SMAIL_GPL
new file mode 100644
index 000000000..dfc3fd16c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/SPL-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/SPL-1.0
new file mode 100644
index 000000000..2848b3621
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/Simple-2.0 b/import-layers/yocto-poky/meta/files/common-licenses/Simple-2.0
new file mode 100644
index 000000000..d28357d5f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/Sleepycat b/import-layers/yocto-poky/meta/files/common-licenses/Sleepycat
new file mode 100644
index 000000000..02e9d84f7
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/SugarCRM-1 b/import-layers/yocto-poky/meta/files/common-licenses/SugarCRM-1
new file mode 100644
index 000000000..acbb4e0bd
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/SugarCRM-1.1.3 b/import-layers/yocto-poky/meta/files/common-licenses/SugarCRM-1.1.3
new file mode 100644
index 000000000..509681a8c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/UCB b/import-layers/yocto-poky/meta/files/common-licenses/UCB
new file mode 100644
index 000000000..79a757af9
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/VSL-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/VSL-1.0
new file mode 100644
index 000000000..36bae5c63
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/W3C b/import-layers/yocto-poky/meta/files/common-licenses/W3C
new file mode 100644
index 000000000..e4b8c4683
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/WXwindows b/import-layers/yocto-poky/meta/files/common-licenses/WXwindows
new file mode 100644
index 000000000..1fe09482d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/Watcom-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/Watcom-1.0
new file mode 100644
index 000000000..6bb619a9d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/XFree86-1.0 b/import-layers/yocto-poky/meta/files/common-licenses/XFree86-1.0
new file mode 100644
index 000000000..b1f3bf45b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/XFree86-1.1 b/import-layers/yocto-poky/meta/files/common-licenses/XFree86-1.1
new file mode 100644
index 000000000..c2a5cb202
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/XSL b/import-layers/yocto-poky/meta/files/common-licenses/XSL
new file mode 100644
index 000000000..0a82d60c1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/Xnet b/import-layers/yocto-poky/meta/files/common-licenses/Xnet
new file mode 100644
index 000000000..0444edf2c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/YPL-1.1 b/import-layers/yocto-poky/meta/files/common-licenses/YPL-1.1
new file mode 100644
index 000000000..4a1880aa1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/ZPL-1.1 b/import-layers/yocto-poky/meta/files/common-licenses/ZPL-1.1
new file mode 100644
index 000000000..a6aabec3a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/ZPL-2.0 b/import-layers/yocto-poky/meta/files/common-licenses/ZPL-2.0
new file mode 100644
index 000000000..3ae208313
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/ZPL-2.1 b/import-layers/yocto-poky/meta/files/common-licenses/ZPL-2.1
new file mode 100644
index 000000000..2d9d43f03
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/Zimbra-1.3 b/import-layers/yocto-poky/meta/files/common-licenses/Zimbra-1.3
new file mode 100644
index 000000000..79b7b346d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/Zlib b/import-layers/yocto-poky/meta/files/common-licenses/Zlib
new file mode 100644
index 000000000..f8b388494
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/bzip2 b/import-layers/yocto-poky/meta/files/common-licenses/bzip2
new file mode 100644
index 000000000..8ec599dc3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/eCos-2.0 b/import-layers/yocto-poky/meta/files/common-licenses/eCos-2.0
new file mode 100644
index 000000000..39b5d6351
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/gSOAP-1 b/import-layers/yocto-poky/meta/files/common-licenses/gSOAP-1
new file mode 100644
index 000000000..3f8638add
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/gSOAP-1.3b b/import-layers/yocto-poky/meta/files/common-licenses/gSOAP-1.3b
new file mode 100644
index 000000000..68c942bb5
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/tcl b/import-layers/yocto-poky/meta/files/common-licenses/tcl
new file mode 100644
index 000000000..d8049cd9e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/common-licenses/unfs3 b/import-layers/yocto-poky/meta/files/common-licenses/unfs3
new file mode 100644
index 000000000..7f2b53f16
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/deploydir_readme.txt b/import-layers/yocto-poky/meta/files/deploydir_readme.txt
new file mode 100644
index 000000000..97ec1855f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/files/deploydir_readme.txt
@@ -0,0 +1,8 @@
+Files in the deploy directory will not be re-created automatically if you
+delete them. If you do delete a file, you will need to run:
+
+ bitbake -c clean TARGET
+ bitbake TARGET
+
+where TARGET is the name of the appropriate package or target e.g.
+"virtual/kernel" for the kernel, an image, etc.
diff --git a/import-layers/yocto-poky/meta/files/device_table-minimal.txt b/import-layers/yocto-poky/meta/files/device_table-minimal.txt
new file mode 100644
index 000000000..e4891ccb4
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/files/ext-sdk-prepare.py b/import-layers/yocto-poky/meta/files/ext-sdk-prepare.py
new file mode 100644
index 000000000..605e2ebef
--- /dev/null
+++ b/import-layers/yocto-poky/meta/files/ext-sdk-prepare.py
@@ -0,0 +1,103 @@
+#!/usr/bin/env python
+
+# Prepare the build system within the extensible SDK
+
+import sys
+import os
+import subprocess
+
+def exec_watch(cmd, **options):
+ """Run program with stdout shown on sys.stdout"""
+ if isinstance(cmd, basestring) and not "shell" in options:
+ options["shell"] = True
+
+ process = subprocess.Popen(
+ cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **options
+ )
+
+ buf = ''
+ while True:
+ out = process.stdout.read(1)
+ if out:
+ sys.stdout.write(out)
+ sys.stdout.flush()
+ buf += out
+ elif out == '' and process.poll() != None:
+ break
+
+ return process.returncode, buf
+
+def check_unexpected(lines, recipes):
+ """Check for unexpected output lines from dry run"""
+ unexpected = []
+ for line in lines.splitlines():
+ if 'Running task' in line:
+ for recipe in recipes:
+ if recipe in line:
+ break
+ else:
+ line = line.split('Running', 1)[-1]
+ if 'do_rm_work' not in line:
+ unexpected.append(line.rstrip())
+ elif 'Running setscene' in line:
+ unexpected.append(line.rstrip())
+ return unexpected
+
+def main():
+ if len(sys.argv) < 2:
+ sdk_targets = []
+ else:
+ sdk_targets = ' '.join(sys.argv[1:]).split()
+ if not sdk_targets:
+ # Just do a parse so the cache is primed
+ ret, _ = exec_watch('bitbake -p')
+ return ret
+
+ print('Preparing SDK for %s...' % ', '.join(sdk_targets))
+
+ ret, out = exec_watch('bitbake %s --setscene-only' % ' '.join(sdk_targets))
+ if ret:
+ return ret
+
+ targetlist = []
+ for target in sdk_targets:
+ if ':' in target:
+ target = target.split(':')[0]
+ if not target in targetlist:
+ targetlist.append(target)
+
+ recipes = []
+ for target in targetlist:
+ try:
+ out = subprocess.check_output(('bitbake -e %s' % target).split(), stderr=subprocess.STDOUT)
+ for line in out.splitlines():
+ if line.startswith('FILE='):
+ splitval = line.rstrip().split('=')
+ if len(splitval) > 1:
+ recipes.append(splitval[1].strip('"'))
+ break
+ except subprocess.CalledProcessError as e:
+ print('ERROR: Failed to get recipe for target %s:\n%s' % (target, e.output))
+ return 1
+
+ try:
+ out = subprocess.check_output('bitbake %s -n' % ' '.join(sdk_targets), stderr=subprocess.STDOUT, shell=True)
+ unexpected = check_unexpected(out, recipes)
+ except subprocess.CalledProcessError as e:
+ print('ERROR: Failed to execute dry-run:\n%s' % e.output)
+ return 1
+
+ if unexpected:
+ print('ERROR: Unexpected tasks or setscene left over to be executed:')
+ for line in unexpected:
+ print(' ' + line)
+ return 1
+
+if __name__ == "__main__":
+ try:
+ ret = main()
+ except Exception:
+ ret = 1
+ import traceback
+ traceback.print_exc()
+ sys.exit(ret)
diff --git a/import-layers/yocto-poky/meta/files/fs-perms.txt b/import-layers/yocto-poky/meta/files/fs-perms.txt
new file mode 100644
index 000000000..3d00e862e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/files/fs-perms.txt
@@ -0,0 +1,70 @@
+# 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 755-lsb
+/srv 0755 root root false - - -
+
+# Set 2775-lsb
+/var/mail 02775 root mail false - - -
diff --git a/import-layers/yocto-poky/meta/files/toolchain-shar-extract.sh b/import-layers/yocto-poky/meta/files/toolchain-shar-extract.sh
new file mode 100644
index 000000000..397be1119
--- /dev/null
+++ b/import-layers/yocto-poky/meta/files/toolchain-shar-extract.sh
@@ -0,0 +1,227 @@
+#!/bin/sh
+
+[ -z "$ENVCLEANED" ] && exec /usr/bin/env -i ENVCLEANED=1 HOME="$HOME" \
+ 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/::/:/'`
+
+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/")
+
+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: Installation machine not supported!"
+ 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
+while getopts ":yd:npDRS" 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
+ ;;
+ *)
+ 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"
+ exit 1
+ ;;
+ esac
+done
+
+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@"
+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
+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
+
+payload_offset=$(($(grep -na -m1 "^MARKER:$" $0|cut -d':' -f1) + 1))
+
+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
+
+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/import-layers/yocto-poky/meta/files/toolchain-shar-relocate.sh b/import-layers/yocto-poky/meta/files/toolchain-shar-relocate.sh
new file mode 100644
index 000000000..d4bcf0e55
--- /dev/null
+++ b/import-layers/yocto-poky/meta/files/toolchain-shar-relocate.sh
@@ -0,0 +1,61 @@
+# 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' ")
+
+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/bash
+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"
+
+# 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
+done
+
+echo done
diff --git a/import-layers/yocto-poky/meta/lib/oe/__init__.py b/import-layers/yocto-poky/meta/lib/oe/__init__.py
new file mode 100644
index 000000000..3ad9513f4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oe/__init__.py
@@ -0,0 +1,2 @@
+from pkgutil import extend_path
+__path__ = extend_path(__path__, __name__)
diff --git a/import-layers/yocto-poky/meta/lib/oe/buildhistory_analysis.py b/import-layers/yocto-poky/meta/lib/oe/buildhistory_analysis.py
new file mode 100644
index 000000000..5395c768a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oe/buildhistory_analysis.py
@@ -0,0 +1,456 @@
+# Report significant differences in the buildhistory repository since a specific revision
+#
+# Copyright (C) 2012 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 bb.utils
+
+
+# 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['PKGSIZE'] = ['FILELIST']
+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']
+
+
+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.iteritems():
+ if v:
+ pkglist.append("%s (%s)" % (k,v))
+ else:
+ pkglist.append(k)
+ return pkglist
+
+ if self.fieldname in list_fields or self.fieldname in list_order_fields:
+ 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()
+ removed = list(set(aitems) - set(bitems))
+ added = list(set(bitems) - set(aitems))
+
+ if removed or added:
+ if removed and not bitems:
+ out = '%s: removed all items "%s"' % (self.fieldname, ' '.join(removed))
+ else:
+ out = '%s:%s%s' % (self.fieldname, ' removed "%s"' % ' '.join(removed) if removed else '', ' added "%s"' % ' '.join(added) if added else '')
+ else:
+ out = '%s changed order' % self.fieldname
+ 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 = '%s changed from %s to %s (%s%d%%)' % (self.fieldname, self.oldvalue or "''", self.newvalue or "''", '+' if percentchg > 0 else '', percentchg)
+ elif self.fieldname in defaultval_map:
+ out = '%s changed from %s to %s' % (self.fieldname, self.oldvalue, self.newvalue)
+ 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:
+ 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 = '%s changed from "%s" to "%s"' % (self.fieldname, self.oldvalue, self.newvalue)
+
+ 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)
+
+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 = blob.data_stream.read().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.iteritems():
+ 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
+
+ chg = ChangeRecord(path, key, astr, bstr, monitored)
+ changes.append(chg)
+ return changes
+
+
+def process_changes(repopath, revision1, revision2='HEAD', report_all=False, report_ver=False):
+ repo = git.Repo(repopath)
+ assert repo.bare == False
+ commit = repo.commit(revision1)
+ diff = commit.diff(revision2)
+
+ 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(), d.b_blob.data_stream.read(), 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().splitlines()
+ blines = d.b_blob.data_stream.read().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().splitlines()
+ blines = d.b_blob.data_stream.read().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(), d.b_blob.data_stream.read(), 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(), d.b_blob.data_stream.read(), 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(), 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(), '', 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)
+
+ if report_all:
+ return changes
+ else:
+ return [chg for chg in changes if chg.monitored]
diff --git a/import-layers/yocto-poky/meta/lib/oe/cachedpath.py b/import-layers/yocto-poky/meta/lib/oe/cachedpath.py
new file mode 100644
index 000000000..0840cc4c3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/lib/oe/classextend.py b/import-layers/yocto-poky/meta/lib/oe/classextend.py
new file mode 100644
index 000000000..5107ecde2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oe/classextend.py
@@ -0,0 +1,120 @@
+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, True)
+ 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, True)
+ 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", True)
+ 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, True)
+ if not deps:
+ self.d.setVar("EXTENDPKGV", orig)
+ return
+ deps = bb.utils.explode_dep_versions2(deps)
+ newdeps = {}
+ 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", True).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", True) 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/import-layers/yocto-poky/meta/lib/oe/classutils.py b/import-layers/yocto-poky/meta/lib/oe/classutils.py
new file mode 100644
index 000000000..58188fdd6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oe/classutils.py
@@ -0,0 +1,43 @@
+class ClassRegistry(type):
+ """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
+ class __metaclass__(type):
+ """Give each ClassRegistry their own registry"""
+ def __init__(cls, name, bases, attrs):
+ cls.registry = {}
+ type.__init__(cls, name, bases, attrs)
+
+ 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(tcls.registry.values(),
+ key=lambda v: v.priority, reverse=True)
+
+ def unregister(cls):
+ for key in cls.registry.keys():
+ if cls.registry[key] is cls:
+ del cls.registry[key]
diff --git a/import-layers/yocto-poky/meta/lib/oe/copy_buildsystem.py b/import-layers/yocto-poky/meta/lib/oe/copy_buildsystem.py
new file mode 100644
index 000000000..7b9a0ee06
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oe/copy_buildsystem.py
@@ -0,0 +1,217 @@
+# 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):
+ # 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):
+ shutil.copytree(src, dest, symlinks=True, ignore=shutil.ignore_patterns('.git'))
+ 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 = d.getVar('BBLAYERS', True).split()
+ self.layers_exclude = (d.getVar('SDK_LAYERS_EXCLUDE', True) 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 = self.d.getVar('COREBASE', True)
+ layers.append(corebase)
+
+ # 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', True).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)
+ 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(layerdestpath):
+ 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', True)))[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)
+
+ 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.itervalues()]
+ 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):
+ 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))
+
+ write_sigs_file(copy_output, 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=""):
+ bb.note('Generating sstate-cache...')
+
+ nativelsbstring = d.getVar('NATIVELSBSTRING', True)
+ bb.process.run("gen-lockedsig-cache %s %s %s %s" % (lockedsigs, input_sstate_cache, output_sstate_cache, nativelsbstring))
+ if fixedlsbstring:
+ nativedir = output_sstate_cache + '/' + nativelsbstring
+ if os.path.isdir(nativedir):
+ destdir = os.path.join(output_sstate_cache, fixedlsbstring)
+ bb.utils.mkdirhier(destdir)
+
+ dirlist = os.listdir(nativedir)
+ for i in dirlist:
+ src = os.path.join(nativedir, i)
+ dest = os.path.join(destdir, i)
+ os.rename(src, dest)
diff --git a/import-layers/yocto-poky/meta/lib/oe/data.py b/import-layers/yocto-poky/meta/lib/oe/data.py
new file mode 100644
index 000000000..e49572177
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oe/data.py
@@ -0,0 +1,17 @@
+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', True)
+ flags = d.getVarFlags(key)
+ if flags is not None:
+ flags = dict((flag, d.expand(value))
+ for flag, value in flags.iteritems())
+ else:
+ flags = {}
+
+ try:
+ return oe.maketype.create(d.getVar(key, True) or '', var_type, **flags)
+ except (TypeError, ValueError), exc:
+ bb.msg.fatal("Data", "%s: %s" % (key, str(exc)))
diff --git a/import-layers/yocto-poky/meta/lib/oe/distro_check.py b/import-layers/yocto-poky/meta/lib/oe/distro_check.py
new file mode 100644
index 000000000..8655a6fc1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oe/distro_check.py
@@ -0,0 +1,399 @@
+from contextlib import contextmanager
+@contextmanager
+def create_socket(url, d):
+ import urllib
+ socket = urllib.urlopen(url, proxies=get_proxies(d))
+ try:
+ yield socket
+ finally:
+ socket.close()
+
+def get_proxies(d):
+ proxies = {}
+ for key in ['http', 'https', 'ftp', 'ftps', 'no', 'all']:
+ proxy = d.getVar(key + '_proxy', True)
+ if proxy:
+ proxies[key] = proxy
+ return proxies
+
+def get_links_from_url(url, d):
+ "Return all the href links found on the web location"
+
+ import sgmllib
+
+ class LinksParser(sgmllib.SGMLParser):
+ def parse(self, s):
+ "Parse the given string 's'."
+ self.feed(s)
+ self.close()
+
+ def __init__(self, verbose=0):
+ "Initialise an object passing 'verbose' to the superclass."
+ sgmllib.SGMLParser.__init__(self, verbose)
+ self.hyperlinks = []
+
+ def start_a(self, attributes):
+ "Process a hyperlink and its 'attributes'."
+ for name, value in attributes:
+ if name == "href":
+ self.hyperlinks.append(value.strip('/'))
+
+ def get_hyperlinks(self):
+ "Return the list of hyperlinks."
+ return self.hyperlinks
+
+ with create_socket(url,d) as sock:
+ webpage = sock.read()
+
+ linksparser = LinksParser()
+ linksparser.parse(webpage)
+ return linksparser.get_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:
+ 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"
+ if name[-8:] == ".src.rpm":
+ return True
+ else:
+ return False
+
+def package_name_from_srpm(srpm):
+ "Strip out the package name from the src.rpm filename"
+ strings = srpm.split('-')
+ package_name = strings[0]
+ for i in range(1, len (strings) - 1):
+ str = strings[i]
+ if not str[0].isdigit():
+ package_name += '-' + str
+ return package_name
+
+def clean_package_list(package_list):
+ "Removes multiple entries of packages and sorts the list"
+ set = {}
+ map(set.__setitem__, package_list, [])
+ return set.keys()
+
+
+def get_latest_released_meego_source_package_list(d):
+ "Returns list of all the name os packages in the latest meego distro"
+
+ package_names = []
+ try:
+ f = open("/tmp/Meego-1.1", "r")
+ for line in f:
+ package_names.append(line[:-1] + ":" + "main") # Also strip the '\n' at the end
+ except IOError: pass
+ package_list=clean_package_list(package_names)
+ return "1.0", package_list
+
+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 = []
+ for pkgs in names_list:
+ new_pkgs.append(pkgs + ":" + section)
+
+ return new_pkgs
+
+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("http://archive.fedoraproject.org/pub/fedora/linux/releases/%s/Fedora/source/SRPMS/" % latest, "main", d)
+
+# package_names += get_source_package_list_from_url("http://download.fedora.redhat.com/pub/fedora/linux/releases/%s/Everything/source/SPRMS/" % latest, "everything")
+ package_names += get_source_package_list_from_url("http://archive.fedoraproject.org/pub/fedora/linux/updates/%s/SRPMS/" % latest, "updates", d)
+
+ package_list=clean_package_list(package_names)
+
+ return latest, package_list
+
+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/",d)
+
+ package_names = get_source_package_list_from_url("http://download.opensuse.org/source/distribution/%s/repo/oss/suse/src/" % latest, "main", d)
+ package_names += get_source_package_list_from_url("http://download.opensuse.org/update/%s/rpm/src/" % latest, "updates", d)
+
+ package_list=clean_package_list(package_names)
+ return latest, package_list
+
+def get_latest_released_mandriva_source_package_list(d):
+ "Returns list of all the name os packages in the latest mandriva distro"
+ latest = find_latest_numeric_release("http://distrib-coffee.ipsl.jussieu.fr/pub/linux/MandrivaLinux/official/", d)
+ package_names = get_source_package_list_from_url("http://distrib-coffee.ipsl.jussieu.fr/pub/linux/MandrivaLinux/official/%s/SRPMS/main/release/" % latest, "main", d)
+# package_names += get_source_package_list_from_url("http://distrib-coffee.ipsl.jussieu.fr/pub/linux/MandrivaLinux/official/%s/SRPMS/contrib/release/" % latest, "contrib")
+ package_names += get_source_package_list_from_url("http://distrib-coffee.ipsl.jussieu.fr/pub/linux/MandrivaLinux/official/%s/SRPMS/main/updates/" % latest, "updates", d)
+
+ package_list=clean_package_list(package_names)
+ return latest, package_list
+
+def find_latest_debian_release(url, d):
+ "Find the latest listed debian release on the given url"
+
+ releases = []
+ for link in get_links_from_url(url, d):
+ if link[:6] == "Debian":
+ if ';' not in link:
+ releases.append(link)
+ releases.sort()
+ try:
+ return releases.pop()[6:]
+ 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"
+ with create_socket(url,d) as sock:
+ webpage = sock.read()
+ import tempfile
+ tmpfile = tempfile.NamedTemporaryFile(mode='wb', prefix='oecore.', suffix='.tmp', delete=False)
+ tmpfilename=tmpfile.name
+ tmpfile.write(sock.read())
+ tmpfile.close()
+ import gzip
+ bb.note("Reading %s: %s" % (url, section))
+
+ f = gzip.open(tmpfilename)
+ package_names = []
+ for line in f:
+ if line[:9] == "Package: ":
+ package_names.append(line[9:-1] + ":" + section) # Also strip the '\n' at the end
+ os.unlink(tmpfilename)
+
+ return package_names
+
+def get_latest_released_debian_source_package_list(d):
+ "Returns list of all the name os 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/contrib/source/Sources.gz"
+# package_names += get_debian_style_source_package_list(url, "contrib")
+ 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)
+ package_list=clean_package_list(package_names)
+ return latest, package_list
+
+def find_latest_ubuntu_release(url, d):
+ "Find the latest listed ubuntu release on the given url"
+ url += "?C=M;O=D" # Descending Sort by Last Modified
+ for link in get_links_from_url(url, d):
+ if link[-8:] == "-updates":
+ return link[:-8]
+ 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/multiverse/source/Sources.gz" % latest
+# package_names += get_debian_style_source_package_list(url, "multiverse")
+# url = "http://archive.ubuntu.com/ubuntu/dists/%s/universe/source/Sources.gz" % latest
+# package_names += get_debian_style_source_package_list(url, "universe")
+ 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)
+ package_list=clean_package_list(package_names)
+ return latest, package_list
+
+def create_distro_packages_list(distro_check_dir, d):
+ pkglst_dir = os.path.join(distro_check_dir, "package_lists")
+ if not os.path.isdir (pkglst_dir):
+ os.makedirs(pkglst_dir)
+ # first clear old stuff
+ for file in os.listdir(pkglst_dir):
+ os.unlink(os.path.join(pkglst_dir, file))
+
+ 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],
+ ["Mandriva", get_latest_released_mandriva_source_package_list],
+ ["Meego", get_latest_released_meego_source_package_list]
+ ]
+
+ from datetime import datetime
+ begin = datetime.now()
+ for distro in per_distro_functions:
+ name = distro[0]
+ release, package_list = distro[1](d)
+ bb.note("Distro: %s, Latest Release: %s, # src packages: %d" % (name, release, len(package_list)))
+ package_list_file = os.path.join(pkglst_dir, name + "-" + release)
+ f = open(package_list_file, "w+b")
+ for pkg in package_list:
+ f.write(pkg + "\n")
+ f.close()
+ end = datetime.now()
+ delta = end - begin
+ bb.note("package_list generatiosn took this much time: %d seconds" % delta.seconds)
+
+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+b').close() # touch the file so that the next open won't fail
+
+ f = open(datetime_file, "r+b")
+ 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:
+ raise Exception('Unable to read/write this file: %s' % (datetime_file))
+ 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 = d.getVar('PN', True)
+ recipe_name = d.getVar('PN', True)
+ bb.note("Checking: %s" % pn)
+
+ trim_dict = dict({"-native":"-native", "-cross":"-cross", "-initial":"-initial"})
+
+ if pn.find("-native") != -1:
+ pnstripped = pn.split("-native")
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
+ bb.data.update_data(localdata)
+ recipe_name = pnstripped[0]
+
+ if pn.startswith("nativesdk-"):
+ pnstripped = pn.split("nativesdk-")
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped[1] + ":" + d.getVar('OVERRIDES', True))
+ bb.data.update_data(localdata)
+ recipe_name = pnstripped[1]
+
+ if pn.find("-cross") != -1:
+ pnstripped = pn.split("-cross")
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
+ bb.data.update_data(localdata)
+ recipe_name = pnstripped[0]
+
+ if pn.find("-initial") != -1:
+ pnstripped = pn.split("-initial")
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
+ bb.data.update_data(localdata)
+ recipe_name = pnstripped[0]
+
+ bb.note("Recipe: %s" % recipe_name)
+ tmp = localdata.getVar('DISTRO_PN_ALIAS', True)
+
+ distro_exceptions = dict({"OE-Core":'OE-Core', "OpenedHand":'OpenedHand', "Intel":'Intel', "Upstream":'Upstream', "Windriver":'Windriver', "OSPDT":'OSPDT Approved', "Poky":'poky'})
+
+ if tmp:
+ list = tmp.split(' ')
+ for str in list:
+ if str and str.find("=") == -1 and distro_exceptions[str]:
+ matching_distros.append(str)
+
+ distro_pn_aliases = {}
+ if tmp:
+ list = tmp.split(' ')
+ for str in list:
+ if str.find("=") != -1:
+ (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), "rb")
+ 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()
+
+
+ if tmp != None:
+ list = tmp.split(' ')
+ for item in list:
+ matching_distros.append(item)
+ bb.note("Matching: %s" % matching_distros)
+ return matching_distros
+
+def create_log_file(d, logname):
+ import subprocess
+ logpath = d.getVar('LOG_DIR', True)
+ bb.utils.mkdirhier(logpath)
+ logfn, logsuffix = os.path.splitext(logname)
+ logfile = os.path.join(logpath, "%s.%s%s" % (logfn, d.getVar('DATETIME', True), logsuffix))
+ if not os.path.exists(logfile):
+ slogfile = os.path.join(logpath, logname)
+ if os.path.exists(slogfile):
+ os.remove(slogfile)
+ subprocess.call("touch %s" % logfile, shell=True)
+ 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', True)
+ logdir = d.getVar('LOG_DIR', True)
+ if not logdir:
+ bb.error("LOG_DIR variable is not defined, can't write the distro_check results")
+ return
+ if not os.path.isdir(logdir):
+ os.makedirs(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/import-layers/yocto-poky/meta/lib/oe/gpg_sign.py b/import-layers/yocto-poky/meta/lib/oe/gpg_sign.py
new file mode 100644
index 000000000..b83ee8672
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oe/gpg_sign.py
@@ -0,0 +1,116 @@
+"""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', True) or \
+ bb.utils.which(os.getenv('PATH'), 'gpg')
+ self.gpg_path = d.getVar('GPG_PATH', True)
+ self.rpm_bin = bb.utils.which(os.getenv('PATH'), "rpm")
+
+ def export_pubkey(self, output_file, keyid, armor=True):
+ """Export GPG public key to a file"""
+ cmd = '%s --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):
+ """Sign RPM files"""
+
+ cmd = self.rpm_bin + " --addsign --define '_gpg_name %s' " % keyid
+ cmd += "--define '_gpg_passphrase %s' " % passphrase
+ if self.gpg_bin:
+ cmd += "--define '%%__gpg %s' " % self.gpg_bin
+ if self.gpg_path:
+ cmd += "--define '_gpg_path %s' " % self.gpg_path
+ cmd += ' '.join(files)
+
+ status, output = oe.utils.getstatusoutput(cmd)
+ 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', '--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
+ dots = self.get_gpg_version().split('.')
+ assert len(dots) >= 2
+ if int(dots[0]) >= 2 and int(dots[1]) >= 1:
+ cmd += ['--pinentry-mode', 'loopback']
+
+ 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)
+
+ if job.returncode:
+ raise bb.build.FuncFailed("GPG exited with code %d: %s" %
+ (job.returncode, stderr))
+
+ 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"""
+ import subprocess
+ try:
+ return subprocess.check_output((self.gpg_bin, "--version")).split()[2]
+ 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 "
+ 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/import-layers/yocto-poky/meta/lib/oe/license.py b/import-layers/yocto-poky/meta/lib/oe/license.py
new file mode 100644
index 000000000..f0f661c3b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oe/license.py
@@ -0,0 +1,217 @@
+# 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 = filter(lambda x: x.strip(), license_operator.split(licensestr))
+ 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 which were excluded (or None, 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)."""
+ alpha_weight = len(filter(include_license, alpha))
+ beta_weight = len(filter(include_license, beta))
+ 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 = filter(lambda lic: exclude_license(lic), licenses)
+ included = filter(lambda lic: include_license(lic), licenses)
+ 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)
diff --git a/import-layers/yocto-poky/meta/lib/oe/lsb.py b/import-layers/yocto-poky/meta/lib/oe/lsb.py
new file mode 100644
index 000000000..e0bdfba25
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oe/lsb.py
@@ -0,0 +1,88 @@
+def release_dict():
+ """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 None
+
+ data = {}
+ for line in output.splitlines():
+ if line.startswith("-e"): line = line[3:]
+ try:
+ key, value = line.split(":\t", 1)
+ except ValueError:
+ continue
+ else:
+ data[key] = value
+ return data
+
+def release_dict_file():
+ """ Try to gather LSB release information manually when lsb_release tool is unavailable """
+ data = None
+ 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/os-release'):
+ data = {}
+ with open('/etc/os-release') as f:
+ for line in f:
+ if line.startswith('NAME='):
+ data['DISTRIB_ID'] = line[5:].rstrip().strip('"')
+ if line.startswith('VERSION_ID='):
+ data['DISTRIB_RELEASE'] = line[11:].rstrip().strip('"')
+ 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 None
+ 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
+
+ lsb_data = release_dict()
+ if lsb_data:
+ distro_id, release = lsb_data['Distributor ID'], lsb_data['Release']
+ else:
+ lsb_data_file = release_dict_file()
+ if lsb_data_file:
+ distro_id, release = lsb_data_file['DISTRIB_ID'], lsb_data_file.get('DISTRIB_RELEASE', None)
+ else:
+ distro_id, release = None, None
+
+ 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, release)
+ else:
+ id_str = distro_id
+ return id_str.replace(' ','-').replace('/','-')
diff --git a/import-layers/yocto-poky/meta/lib/oe/maketype.py b/import-layers/yocto-poky/meta/lib/oe/maketype.py
new file mode 100644
index 000000000..139f33369
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oe/maketype.py
@@ -0,0 +1,99 @@
+"""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 types
+
+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__
+
+ args, varargs, keywords, defaults = inspect.getargspec(obj)
+ 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 callable(obj):
+ continue
+
+ register(name, obj)
diff --git a/import-layers/yocto-poky/meta/lib/oe/manifest.py b/import-layers/yocto-poky/meta/lib/oe/manifest.py
new file mode 100644
index 000000000..42832f15d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oe/manifest.py
@@ -0,0 +1,345 @@
+from abc import ABCMeta, abstractmethod
+import os
+import re
+import bb
+
+
+class Manifest(object):
+ """
+ This is an abstract class. Do not instantiate this directly.
+ """
+ __metaclass__ = ABCMeta
+
+ 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', True)
+ else:
+ self.manifest_dir = self.d.getVar('WORKDIR', True)
+ 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', True)
+ 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] = "run-postinsts 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', True).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, True))
+ if split_pkgs is not None:
+ pkgs = dict(pkgs.items() + split_pkgs.items())
+ else:
+ pkg_list = self.d.getVar(var, True)
+ if pkg_list is not None:
+ pkgs[self.var_maps[self.manifest_type][var]] = self.d.getVar(var, True)
+
+ 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', True).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, True))
+ if split_pkgs is not None:
+ pkgs = dict(pkgs.items() + split_pkgs.items())
+ else:
+ pkg_list = self.d.getVar(var, True)
+ if pkg_list is not None:
+ pkgs[self.var_maps[self.manifest_type][var]] = self.d.getVar(var, True)
+
+ 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):
+ 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, True)
+
+ 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', True)](d, manifest_dir, manifest_type)
+
+ if final_manifest:
+ manifest.create_final()
+ else:
+ manifest.create_initial()
+
+
+if __name__ == "__main__":
+ pass
diff --git a/import-layers/yocto-poky/meta/lib/oe/package.py b/import-layers/yocto-poky/meta/lib/oe/package.py
new file mode 100644
index 000000000..288768954
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oe/package.py
@@ -0,0 +1,157 @@
+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 commands, 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)
+
+ extraflags = ""
+
+ # kernel module
+ if elftype & 16:
+ extraflags = "--strip-debug --remove-section=.comment --remove-section=.note --preserve-dates"
+ # .so and shared library
+ elif ".so" in file and elftype & 8:
+ extraflags = "--remove-section=.comment --remove-section=.note --strip-unneeded"
+ # shared or executable:
+ elif elftype & 8 or elftype & 4:
+ extraflags = "--remove-section=.comment --remove-section=.note"
+
+ stripcmd = "'%s' %s '%s'" % (strip, extraflags, file)
+ bb.debug(1, "runstrip: %s" % stripcmd)
+
+ try:
+ output = subprocess.check_output(stripcmd, stderr=subprocess.STDOUT, shell=True)
+ 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 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 = {}
+
+ r = re.compile(r'[<>=]+ +[^ ]*')
+
+ def process_deps(pipe, pkg, pkgdest, provides, requires):
+ for line in pipe:
+ f = line.split(" ", 1)[0].strip()
+ line = line.split(" ", 1)[1].strip()
+
+ if line.startswith("Requires:"):
+ i = requires
+ elif line.startswith("Provides:"):
+ i = provides
+ else:
+ continue
+
+ file = f.replace(pkgdest + "/" + pkg, "")
+ file = file_translate(file)
+ value = line.split(":", 1)[1].strip()
+ value = r.sub(r'(\g<0>)', value)
+
+ if value.startswith("rpmlib("):
+ continue
+ if value == "python":
+ continue
+ if file not in i:
+ i[file] = []
+ i[file].append(value)
+
+ return provides, requires
+
+ try:
+ dep_popen = subprocess.Popen(shlex.split(rpmdeps) + pkgfiles, stdout=subprocess.PIPE)
+ provides, requires = process_deps(dep_popen.stdout, pkg, pkgdest, provides, requires)
+ except OSError as e:
+ bb.error("rpmdeps: '%s' command failed, '%s'" % (shlex.split(rpmdeps) + pkgfiles, e))
+ raise e
+
+ return (pkg, provides, requires)
+
+
+def read_shlib_providers(d):
+ import re
+
+ shlib_provider = {}
+ shlibs_dirs = d.getVar('SHLIBSDIRS', True).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)
+ fd = open(os.path.join(dir, file))
+ 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('_', '-')
+ 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/import-layers/yocto-poky/meta/lib/oe/package_manager.py b/import-layers/yocto-poky/meta/lib/oe/package_manager.py
new file mode 100644
index 000000000..b4b359a8c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oe/package_manager.py
@@ -0,0 +1,2061 @@
+from abc import ABCMeta, abstractmethod
+import os
+import glob
+import subprocess
+import shutil
+import multiprocessing
+import re
+import bb
+import tempfile
+import oe.utils
+import string
+from oe.gpg_sign import get_signer
+
+# this can be used by all PM backends to create the index files in parallel
+def create_index(arg):
+ index_cmd = arg
+
+ try:
+ bb.note("Executing '%s' ..." % index_cmd)
+ result = subprocess.check_output(index_cmd, stderr=subprocess.STDOUT, shell=True)
+ except subprocess.CalledProcessError as e:
+ return("Index creation command '%s' failed with return code %d:\n%s" %
+ (e.cmd, e.returncode, e.output))
+
+ if result:
+ bb.note(result)
+
+ return None
+
+
+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 get_ml_prefix_and_os_list(self, arch_var=None, os_var=None):
+ package_archs = {
+ 'default': [],
+ }
+
+ target_os = {
+ 'default': "",
+ }
+
+ if arch_var is not None and os_var is not None:
+ package_archs['default'] = self.d.getVar(arch_var, True).split()
+ package_archs['default'].reverse()
+ target_os['default'] = self.d.getVar(os_var, True).strip()
+ else:
+ package_archs['default'] = self.d.getVar("PACKAGE_ARCHS", True).split()
+ # arch order is reversed. This ensures the -best- match is
+ # listed first!
+ package_archs['default'].reverse()
+ target_os['default'] = self.d.getVar("TARGET_OS", True).strip()
+ multilibs = self.d.getVar('MULTILIBS', True) or ""
+ for ext in multilibs.split():
+ eext = ext.split(':')
+ if len(eext) > 1 and eext[0] == 'multilib':
+ localdata = bb.data.createCopy(self.d)
+ default_tune_key = "DEFAULTTUNE_virtclass-multilib-" + eext[1]
+ default_tune = localdata.getVar(default_tune_key, False)
+ if default_tune is None:
+ default_tune_key = "DEFAULTTUNE_ML_" + eext[1]
+ default_tune = localdata.getVar(default_tune_key, False)
+ if default_tune:
+ localdata.setVar("DEFAULTTUNE", default_tune)
+ bb.data.update_data(localdata)
+ package_archs[eext[1]] = localdata.getVar('PACKAGE_ARCHS',
+ True).split()
+ package_archs[eext[1]].reverse()
+ target_os[eext[1]] = localdata.getVar("TARGET_OS",
+ True).strip()
+
+ ml_prefix_list = dict()
+ for mlib in package_archs:
+ if mlib == 'default':
+ ml_prefix_list[mlib] = package_archs[mlib]
+ else:
+ ml_prefix_list[mlib] = list()
+ for arch in package_archs[mlib]:
+ if arch in ['all', 'noarch', 'any']:
+ ml_prefix_list[mlib].append(arch)
+ else:
+ ml_prefix_list[mlib].append(mlib + "_" + arch)
+
+ return (ml_prefix_list, target_os)
+
+ def write_index(self):
+ sdk_pkg_archs = (self.d.getVar('SDK_PACKAGE_ARCHS', True) or "").replace('-', '_').split()
+ all_mlb_pkg_archs = (self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS', True) or "").replace('-', '_').split()
+
+ mlb_prefix_list = self.get_ml_prefix_and_os_list()[0]
+
+ archs = set()
+ for item in mlb_prefix_list:
+ archs = archs.union(set(i.replace('-', '_') for i in mlb_prefix_list[item]))
+
+ if len(archs) == 0:
+ archs = archs.union(set(all_mlb_pkg_archs))
+
+ archs = archs.union(set(sdk_pkg_archs))
+
+ rpm_createrepo = bb.utils.which(os.getenv('PATH'), "createrepo")
+ if self.d.getVar('PACKAGE_FEED_SIGN', True) == '1':
+ signer = get_signer(self.d, self.d.getVar('PACKAGE_FEED_GPG_BACKEND', True))
+ else:
+ signer = None
+ index_cmds = []
+ repomd_files = []
+ rpm_dirs_found = False
+ for arch in archs:
+ dbpath = os.path.join(self.d.getVar('WORKDIR', True), 'rpmdb', arch)
+ if os.path.exists(dbpath):
+ bb.utils.remove(dbpath, True)
+ arch_dir = os.path.join(self.deploy_dir, arch)
+ if not os.path.isdir(arch_dir):
+ continue
+
+ index_cmds.append("%s --dbpath %s --update -q %s" % \
+ (rpm_createrepo, dbpath, arch_dir))
+ repomd_files.append(os.path.join(arch_dir, 'repodata', 'repomd.xml'))
+
+ rpm_dirs_found = True
+
+ if not rpm_dirs_found:
+ bb.note("There are no packages in %s" % self.deploy_dir)
+ return
+
+ # Create repodata
+ result = oe.utils.multiprocess_exec(index_cmds, create_index)
+ if result:
+ bb.fatal('%s' % ('\n'.join(result)))
+ # Sign repomd
+ if signer:
+ for repomd in repomd_files:
+ feed_sig_type = self.d.getVar('PACKAGE_FEED_GPG_SIGNATURE_TYPE', True)
+ is_ascii_sig = (feed_sig_type.upper() != "BIN")
+ signer.detach_sign(repomd,
+ self.d.getVar('PACKAGE_FEED_GPG_NAME', True),
+ self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE', True),
+ armor=is_ascii_sig)
+
+
+class OpkgIndexer(Indexer):
+ def write_index(self):
+ arch_vars = ["ALL_MULTILIB_PACKAGE_ARCHS",
+ "SDK_PACKAGE_ARCHS",
+ "MULTILIB_ARCHS"]
+
+ opkg_index_cmd = bb.utils.which(os.getenv('PATH'), "opkg-make-index")
+ if self.d.getVar('PACKAGE_FEED_SIGN', True) == '1':
+ signer = get_signer(self.d, self.d.getVar('PACKAGE_FEED_GPG_BACKEND', True))
+ 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, True)
+ 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
+
+ result = oe.utils.multiprocess_exec(index_cmds, create_index)
+ if result:
+ bb.fatal('%s' % ('\n'.join(result)))
+
+ if signer:
+ feed_sig_type = self.d.getVar('PACKAGE_FEED_GPG_SIGNATURE_TYPE', True)
+ 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', True),
+ self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE', True),
+ 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', True)
+ if pkg_archs is not None:
+ arch_list = pkg_archs.split()
+ sdk_pkg_archs = self.d.getVar('SDK_PACKAGE_ARCHS', True)
+ 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', True) 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 -fc 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
+
+ result = oe.utils.multiprocess_exec(index_cmds, create_index)
+ if result:
+ bb.fatal('%s' % ('\n'.join(result)))
+ if self.d.getVar('PACKAGE_FEED_SIGN', True) == '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
+
+
+ """
+ This method parse the output from the package manager
+ and return a dictionary with the information of the
+ installed packages. This is used whne the packages are
+ in deb or ipk format
+ """
+ def opkg_query(self, cmd_output):
+ verregex = re.compile(' \([=<>]* [^ )]*\)')
+ output = dict()
+ filename = ""
+ dep = []
+ pkg = ""
+ 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: "):
+ filename = line.split(": ")[1]
+ 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)
+ else:
+ # 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 }
+ pkg = ""
+ filename = ""
+ dep = []
+
+ 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
+
+
+class RpmPkgsList(PkgsList):
+ def __init__(self, d, rootfs_dir, arch_var=None, os_var=None):
+ super(RpmPkgsList, self).__init__(d, rootfs_dir)
+
+ self.rpm_cmd = bb.utils.which(os.getenv('PATH'), "rpm")
+ self.image_rpmlib = os.path.join(self.rootfs_dir, 'var/lib/rpm')
+
+ self.ml_prefix_list, self.ml_os_list = \
+ RpmIndexer(d, rootfs_dir).get_ml_prefix_and_os_list(arch_var, os_var)
+
+ # Determine rpm version
+ cmd = "%s --version" % self.rpm_cmd
+ try:
+ output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+ except subprocess.CalledProcessError as e:
+ bb.fatal("Getting rpm version failed. Command '%s' "
+ "returned %d:\n%s" % (cmd, e.returncode, e.output))
+
+ '''
+ Translate the RPM/Smart format names to the OE multilib format names
+ '''
+ def _pkg_translate_smart_to_oe(self, pkg, arch):
+ new_pkg = pkg
+ new_arch = arch
+ fixed_arch = arch.replace('_', '-')
+ found = 0
+ for mlib in self.ml_prefix_list:
+ for cmp_arch in self.ml_prefix_list[mlib]:
+ fixed_cmp_arch = cmp_arch.replace('_', '-')
+ if fixed_arch == fixed_cmp_arch:
+ if mlib == 'default':
+ new_pkg = pkg
+ new_arch = cmp_arch
+ else:
+ new_pkg = mlib + '-' + pkg
+ # We need to strip off the ${mlib}_ prefix on the arch
+ new_arch = cmp_arch.replace(mlib + '_', '')
+
+ # Workaround for bug 3565. Simply look to see if we
+ # know of a package with that name, if not try again!
+ filename = os.path.join(self.d.getVar('PKGDATA_DIR', True),
+ 'runtime-reverse',
+ new_pkg)
+ if os.path.exists(filename):
+ found = 1
+ break
+
+ if found == 1 and fixed_arch == fixed_cmp_arch:
+ break
+ #bb.note('%s, %s -> %s, %s' % (pkg, arch, new_pkg, new_arch))
+ return new_pkg, new_arch
+
+ def _list_pkg_deps(self):
+ cmd = [bb.utils.which(os.getenv('PATH'), "rpmresolve"),
+ "-t", self.image_rpmlib]
+
+ try:
+ output = subprocess.check_output(cmd, stderr=subprocess.STDOUT).strip()
+ except subprocess.CalledProcessError as e:
+ bb.fatal("Cannot get the package dependencies. Command '%s' "
+ "returned %d:\n%s" % (' '.join(cmd), e.returncode, e.output))
+
+ return output
+
+ def list_pkgs(self):
+ cmd = self.rpm_cmd + ' --root ' + self.rootfs_dir
+ cmd += ' -D "_dbpath /var/lib/rpm" -qa'
+ cmd += " --qf '[%{NAME} %{ARCH} %{VERSION} %{PACKAGEORIGIN}\n]'"
+
+ try:
+ # bb.note(cmd)
+ tmp_output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True).strip()
+ except subprocess.CalledProcessError as e:
+ bb.fatal("Cannot get the installed packages list. Command '%s' "
+ "returned %d:\n%s" % (cmd, e.returncode, e.output))
+
+ output = dict()
+ deps = dict()
+ dependencies = self._list_pkg_deps()
+
+ # Populate deps dictionary for better manipulation
+ for line in dependencies.splitlines():
+ try:
+ pkg, dep = line.split("|")
+ if not pkg in deps:
+ deps[pkg] = list()
+ if not dep in deps[pkg]:
+ deps[pkg].append(dep)
+ except:
+ # Ignore any other lines they're debug or errors
+ pass
+
+ for line in tmp_output.split('\n'):
+ if len(line.strip()) == 0:
+ continue
+ pkg = line.split()[0]
+ arch = line.split()[1]
+ ver = line.split()[2]
+ dep = deps.get(pkg, [])
+
+ # Skip GPG keys
+ if pkg == 'gpg-pubkey':
+ continue
+
+ pkgorigin = line.split()[3]
+ new_pkg, new_arch = self._pkg_translate_smart_to_oe(pkg, arch)
+
+ output[new_pkg] = {"arch":new_arch, "ver":ver,
+ "filename":pkgorigin, "deps":dep}
+
+ return output
+
+
+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", True)
+
+ 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()
+ 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 self.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()
+ 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))
+
+ return self.opkg_query(cmd_output)
+
+
+class PackageManager(object):
+ """
+ This is an abstract class. Do not instantiate this directly.
+ """
+ __metaclass__ = ABCMeta
+
+ def __init__(self, d):
+ self.d = d
+ self.deploy_dir = None
+ self.deploy_lock = None
+ self.feed_uris = self.d.getVar('PACKAGE_FEED_URIS', True) or ""
+ self.feed_base_paths = self.d.getVar('PACKAGE_FEED_BASE_PATHS', True) or ""
+ self.feed_archs = self.d.getVar('PACKAGE_FEED_ARCHS', True)
+
+ """
+ Update the package manager package database.
+ """
+ @abstractmethod
+ def update(self):
+ pass
+
+ """
+ Install a list of packages. 'pkgs' is a list object. If 'attempt_only' is
+ True, installation failures are ignored.
+ """
+ @abstractmethod
+ def install(self, pkgs, attempt_only=False):
+ pass
+
+ """
+ Remove a list of packages. 'pkgs' is a list object. If 'with_dependencies'
+ is False, the any dependencies are left in place.
+ """
+ @abstractmethod
+ def remove(self, pkgs, with_dependencies=True):
+ pass
+
+ """
+ This function creates the index files
+ """
+ @abstractmethod
+ def write_index(self):
+ pass
+
+ @abstractmethod
+ def remove_packaging_data(self):
+ pass
+
+ @abstractmethod
+ def list_installed(self):
+ pass
+
+ @abstractmethod
+ def insert_feeds_uris(self):
+ pass
+
+ """
+ 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
+ """
+ def install_complementary(self, globs=None):
+ # we need to write the list of installed packages to a file because the
+ # oe-pkgdata-util reads it from a file
+ installed_pkgs_file = os.path.join(self.d.getVar('WORKDIR', True),
+ "installed_pkgs.txt")
+ with open(installed_pkgs_file, "w+") as installed_pkgs:
+ pkgs = self.list_installed()
+ output = oe.utils.format_pkg_list(pkgs, "arch")
+ installed_pkgs.write(output)
+
+ if globs is None:
+ globs = self.d.getVar('IMAGE_INSTALL_COMPLEMENTARY', True)
+ split_linguas = set()
+
+ for translation in self.d.getVar('IMAGE_LINGUAS', True).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
+
+ cmd = [bb.utils.which(os.getenv('PATH'), "oe-pkgdata-util"),
+ "-p", self.d.getVar('PKGDATA_DIR', True), "glob", installed_pkgs_file,
+ globs]
+ exclude = self.d.getVar('PACKAGE_EXCLUDE_COMPLEMENTARY', True)
+ if exclude:
+ cmd.extend(['-x', exclude])
+ try:
+ bb.note("Installing complementary packages ...")
+ bb.note('Running %s' % cmd)
+ complementary_pkgs = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
+ 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))
+ self.install(complementary_pkgs.split(), attempt_only=True)
+ os.remove(installed_pkgs_file)
+
+ 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
+
+ """
+ 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 construct_uris(self, uris, base_paths):
+ def _append(arr1, arr2, sep='/'):
+ res = []
+ narr1 = map(lambda a: string.rstrip(a, sep), arr1)
+ narr2 = map(lambda a: string.lstrip(string.rstrip(a, sep), sep), 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)
+
+class RpmPM(PackageManager):
+ def __init__(self,
+ d,
+ target_rootfs,
+ target_vendor,
+ task_name='target',
+ providename=None,
+ arch_var=None,
+ os_var=None):
+ super(RpmPM, self).__init__(d)
+ self.target_rootfs = target_rootfs
+ self.target_vendor = target_vendor
+ self.task_name = task_name
+ self.providename = providename
+ self.fullpkglist = list()
+ self.deploy_dir = self.d.getVar('DEPLOY_DIR_RPM', True)
+ self.etcrpm_dir = os.path.join(self.target_rootfs, "etc/rpm")
+ self.install_dir_name = "oe_install"
+ self.install_dir_path = os.path.join(self.target_rootfs, self.install_dir_name)
+ self.rpm_cmd = bb.utils.which(os.getenv('PATH'), "rpm")
+ self.smart_cmd = bb.utils.which(os.getenv('PATH'), "smart")
+ # 0 = default, only warnings
+ # 1 = --log-level=info (includes information about executing scriptlets and their output)
+ # 2 = --log-level=debug
+ # 3 = --log-level=debug plus dumps of scriplet content and command invocation
+ self.debug_level = int(d.getVar('ROOTFS_RPM_DEBUG', True) or "0")
+ self.smart_opt = "--log-level=%s --data-dir=%s" % \
+ ("warning" if self.debug_level == 0 else
+ "info" if self.debug_level == 1 else
+ "debug",
+ os.path.join(target_rootfs, 'var/lib/smart'))
+ self.scriptlet_wrapper = self.d.expand('${WORKDIR}/scriptlet_wrapper')
+ self.solution_manifest = self.d.expand('${T}/saved/%s_solution' %
+ self.task_name)
+ self.saved_rpmlib = self.d.expand('${T}/saved/%s' % self.task_name)
+ self.image_rpmlib = os.path.join(self.target_rootfs, 'var/lib/rpm')
+
+ if not os.path.exists(self.d.expand('${T}/saved')):
+ bb.utils.mkdirhier(self.d.expand('${T}/saved'))
+
+ self.indexer = RpmIndexer(self.d, self.deploy_dir)
+ self.pkgs_list = RpmPkgsList(self.d, self.target_rootfs, arch_var, os_var)
+
+ self.ml_prefix_list, self.ml_os_list = self.indexer.get_ml_prefix_and_os_list(arch_var, os_var)
+
+ def insert_feeds_uris(self):
+ if self.feed_uris == "":
+ return
+
+ arch_list = []
+ if self.feed_archs is not None:
+ # User define feed architectures
+ arch_list = self.feed_archs.split()
+ else:
+ # List must be prefered to least preferred order
+ default_platform_extra = set()
+ platform_extra = set()
+ bbextendvariant = self.d.getVar('BBEXTENDVARIANT', True) or ""
+ for mlib in self.ml_os_list:
+ for arch in self.ml_prefix_list[mlib]:
+ plt = arch.replace('-', '_') + '-.*-' + self.ml_os_list[mlib]
+ if mlib == bbextendvariant:
+ default_platform_extra.add(plt)
+ else:
+ platform_extra.add(plt)
+
+ platform_extra = platform_extra.union(default_platform_extra)
+
+ for canonical_arch in platform_extra:
+ arch = canonical_arch.split('-')[0]
+ if not os.path.exists(os.path.join(self.deploy_dir, arch)):
+ continue
+ arch_list.append(arch)
+
+ feed_uris = self.construct_uris(self.feed_uris.split(), self.feed_base_paths.split())
+
+ uri_iterator = 0
+ channel_priority = 10 + 5 * len(feed_uris) * (len(arch_list) if arch_list else 1)
+
+ for uri in feed_uris:
+ if arch_list:
+ for arch in arch_list:
+ bb.note('Note: adding Smart channel url%d%s (%s)' %
+ (uri_iterator, arch, channel_priority))
+ self._invoke_smart('channel --add url%d-%s type=rpm-md baseurl=%s/%s -y'
+ % (uri_iterator, arch, uri, arch))
+ self._invoke_smart('channel --set url%d-%s priority=%d' %
+ (uri_iterator, arch, channel_priority))
+ channel_priority -= 5
+ else:
+ bb.note('Note: adding Smart channel url%d (%s)' %
+ (uri_iterator, channel_priority))
+ self._invoke_smart('channel --add url%d type=rpm-md baseurl=%s -y'
+ % (uri_iterator, uri))
+ self._invoke_smart('channel --set url%d priority=%d' %
+ (uri_iterator, channel_priority))
+ channel_priority -= 5
+
+ uri_iterator += 1
+
+ '''
+ Create configs for rpm and smart, and multilib is supported
+ '''
+ def create_configs(self):
+ target_arch = self.d.getVar('TARGET_ARCH', True)
+ platform = '%s%s-%s' % (target_arch.replace('-', '_'),
+ self.target_vendor,
+ self.ml_os_list['default'])
+
+ # List must be prefered to least preferred order
+ default_platform_extra = list()
+ platform_extra = list()
+ bbextendvariant = self.d.getVar('BBEXTENDVARIANT', True) or ""
+ for mlib in self.ml_os_list:
+ for arch in self.ml_prefix_list[mlib]:
+ plt = arch.replace('-', '_') + '-.*-' + self.ml_os_list[mlib]
+ if mlib == bbextendvariant:
+ if plt not in default_platform_extra:
+ default_platform_extra.append(plt)
+ else:
+ if plt not in platform_extra:
+ platform_extra.append(plt)
+ platform_extra = default_platform_extra + platform_extra
+
+ self._create_configs(platform, platform_extra)
+
+ def _invoke_smart(self, args):
+ cmd = "%s %s %s" % (self.smart_cmd, self.smart_opt, args)
+ # bb.note(cmd)
+ try:
+ complementary_pkgs = subprocess.check_output(cmd,
+ stderr=subprocess.STDOUT,
+ shell=True)
+ # bb.note(complementary_pkgs)
+ return complementary_pkgs
+ except subprocess.CalledProcessError as e:
+ bb.fatal("Could not invoke smart. Command "
+ "'%s' returned %d:\n%s" % (cmd, e.returncode, e.output))
+
+ def _search_pkg_name_in_feeds(self, pkg, feed_archs):
+ for arch in feed_archs:
+ arch = arch.replace('-', '_')
+ regex_match = re.compile(r"^%s-[^-]*-[^-]*@%s$" % \
+ (re.escape(pkg), re.escape(arch)))
+ for p in self.fullpkglist:
+ if regex_match.match(p) is not None:
+ # First found is best match
+ # bb.note('%s -> %s' % (pkg, pkg + '@' + arch))
+ return pkg + '@' + arch
+
+ # Search provides if not found by pkgname.
+ bb.note('Not found %s by name, searching provides ...' % pkg)
+ cmd = "%s %s query --provides %s --show-format='$name-$version'" % \
+ (self.smart_cmd, self.smart_opt, pkg)
+ cmd += " | sed -ne 's/ *Provides://p'"
+ bb.note('cmd: %s' % cmd)
+ output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+ # Found a provider
+ if output:
+ bb.note('Found providers for %s: %s' % (pkg, output))
+ for p in output.split():
+ for arch in feed_archs:
+ arch = arch.replace('-', '_')
+ if p.rstrip().endswith('@' + arch):
+ return p
+
+ return ""
+
+ '''
+ Translate the OE multilib format names to the RPM/Smart format names
+ It searched the RPM/Smart format names in probable multilib feeds first,
+ and then searched the default base feed.
+ '''
+ def _pkg_translate_oe_to_smart(self, pkgs, attempt_only=False):
+ new_pkgs = list()
+
+ for pkg in pkgs:
+ new_pkg = pkg
+ # Search new_pkg in probable multilibs first
+ for mlib in self.ml_prefix_list:
+ # Jump the default archs
+ if mlib == 'default':
+ continue
+
+ subst = pkg.replace(mlib + '-', '')
+ # if the pkg in this multilib feed
+ if subst != pkg:
+ feed_archs = self.ml_prefix_list[mlib]
+ new_pkg = self._search_pkg_name_in_feeds(subst, feed_archs)
+ if not new_pkg:
+ # Failed to translate, package not found!
+ err_msg = '%s not found in the %s feeds (%s).\n' % \
+ (pkg, mlib, " ".join(feed_archs))
+ if not attempt_only:
+ err_msg += " ".join(self.fullpkglist)
+ bb.fatal(err_msg)
+ bb.warn(err_msg)
+ else:
+ new_pkgs.append(new_pkg)
+
+ break
+
+ # Apparently not a multilib package...
+ if pkg == new_pkg:
+ # Search new_pkg in default archs
+ default_archs = self.ml_prefix_list['default']
+ new_pkg = self._search_pkg_name_in_feeds(pkg, default_archs)
+ if not new_pkg:
+ err_msg = '%s not found in the base feeds (%s).\n' % \
+ (pkg, ' '.join(default_archs))
+ if not attempt_only:
+ err_msg += " ".join(self.fullpkglist)
+ bb.fatal(err_msg)
+ bb.warn(err_msg)
+ else:
+ new_pkgs.append(new_pkg)
+
+ return new_pkgs
+
+ def _create_configs(self, platform, platform_extra):
+ # Setup base system configuration
+ bb.note("configuring RPM platform settings")
+
+ # Configure internal RPM environment when using Smart
+ os.environ['RPM_ETCRPM'] = self.etcrpm_dir
+ bb.utils.mkdirhier(self.etcrpm_dir)
+
+ # Setup temporary directory -- install...
+ if os.path.exists(self.install_dir_path):
+ bb.utils.remove(self.install_dir_path, True)
+ bb.utils.mkdirhier(os.path.join(self.install_dir_path, 'tmp'))
+
+ channel_priority = 5
+ platform_dir = os.path.join(self.etcrpm_dir, "platform")
+ sdkos = self.d.getVar("SDK_OS", True)
+ with open(platform_dir, "w+") as platform_fd:
+ platform_fd.write(platform + '\n')
+ for pt in platform_extra:
+ channel_priority += 5
+ if sdkos:
+ tmp = re.sub("-%s$" % sdkos, "-%s\n" % sdkos, pt)
+ tmp = re.sub("-linux.*$", "-linux.*\n", tmp)
+ platform_fd.write(tmp)
+
+ # Tell RPM that the "/" directory exist and is available
+ bb.note("configuring RPM system provides")
+ sysinfo_dir = os.path.join(self.etcrpm_dir, "sysinfo")
+ bb.utils.mkdirhier(sysinfo_dir)
+ with open(os.path.join(sysinfo_dir, "Dirnames"), "w+") as dirnames:
+ dirnames.write("/\n")
+
+ if self.providename:
+ providename_dir = os.path.join(sysinfo_dir, "Providename")
+ if not os.path.exists(providename_dir):
+ providename_content = '\n'.join(self.providename)
+ providename_content += '\n'
+ open(providename_dir, "w+").write(providename_content)
+
+ # Configure RPM... we enforce these settings!
+ bb.note("configuring RPM DB settings")
+ # After change the __db.* cache size, log file will not be
+ # generated automatically, that will raise some warnings,
+ # so touch a bare log for rpm write into it.
+ rpmlib_log = os.path.join(self.image_rpmlib, 'log', 'log.0000000001')
+ if not os.path.exists(rpmlib_log):
+ bb.utils.mkdirhier(os.path.join(self.image_rpmlib, 'log'))
+ open(rpmlib_log, 'w+').close()
+
+ DB_CONFIG_CONTENT = "# ================ Environment\n" \
+ "set_data_dir .\n" \
+ "set_create_dir .\n" \
+ "set_lg_dir ./log\n" \
+ "set_tmp_dir ./tmp\n" \
+ "set_flags db_log_autoremove on\n" \
+ "\n" \
+ "# -- thread_count must be >= 8\n" \
+ "set_thread_count 64\n" \
+ "\n" \
+ "# ================ Logging\n" \
+ "\n" \
+ "# ================ Memory Pool\n" \
+ "set_cachesize 0 1048576 0\n" \
+ "set_mp_mmapsize 268435456\n" \
+ "\n" \
+ "# ================ Locking\n" \
+ "set_lk_max_locks 16384\n" \
+ "set_lk_max_lockers 16384\n" \
+ "set_lk_max_objects 16384\n" \
+ "mutex_set_max 163840\n" \
+ "\n" \
+ "# ================ Replication\n"
+
+ db_config_dir = os.path.join(self.image_rpmlib, 'DB_CONFIG')
+ if not os.path.exists(db_config_dir):
+ open(db_config_dir, 'w+').write(DB_CONFIG_CONTENT)
+
+ # Create database so that smart doesn't complain (lazy init)
+ opt = "-qa"
+ cmd = "%s --root %s --dbpath /var/lib/rpm %s > /dev/null" % (
+ self.rpm_cmd, self.target_rootfs, opt)
+ try:
+ subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+ except subprocess.CalledProcessError as e:
+ bb.fatal("Create rpm database failed. Command '%s' "
+ "returned %d:\n%s" % (cmd, e.returncode, e.output))
+ # Import GPG key to RPM database of the target system
+ if self.d.getVar('RPM_SIGN_PACKAGES', True) == '1':
+ pubkey_path = self.d.getVar('RPM_GPG_PUBKEY', True)
+ cmd = "%s --root %s --dbpath /var/lib/rpm --import %s > /dev/null" % (
+ self.rpm_cmd, self.target_rootfs, pubkey_path)
+ subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+
+ # Configure smart
+ bb.note("configuring Smart settings")
+ bb.utils.remove(os.path.join(self.target_rootfs, 'var/lib/smart'),
+ True)
+ self._invoke_smart('config --set rpm-root=%s' % self.target_rootfs)
+ self._invoke_smart('config --set rpm-dbpath=/var/lib/rpm')
+ self._invoke_smart('config --set rpm-extra-macros._var=%s' %
+ self.d.getVar('localstatedir', True))
+ cmd = "config --set rpm-extra-macros._tmppath=/%s/tmp" % (self.install_dir_name)
+
+ prefer_color = self.d.getVar('RPM_PREFER_ELF_ARCH', True)
+ if prefer_color:
+ if prefer_color not in ['0', '1', '2', '4']:
+ bb.fatal("Invalid RPM_PREFER_ELF_ARCH: %s, it should be one of:\n"
+ "\t1: ELF32 wins\n"
+ "\t2: ELF64 wins\n"
+ "\t4: ELF64 N32 wins (mips64 or mips64el only)" %
+ prefer_color)
+ if prefer_color == "4" and self.d.getVar("TUNE_ARCH", True) not in \
+ ['mips64', 'mips64el']:
+ bb.fatal("RPM_PREFER_ELF_ARCH = \"4\" is for mips64 or mips64el "
+ "only.")
+ self._invoke_smart('config --set rpm-extra-macros._prefer_color=%s'
+ % prefer_color)
+
+ self._invoke_smart(cmd)
+ self._invoke_smart('config --set rpm-ignoresize=1')
+
+ # Write common configuration for host and target usage
+ self._invoke_smart('config --set rpm-nolinktos=1')
+ self._invoke_smart('config --set rpm-noparentdirs=1')
+ check_signature = self.d.getVar('RPM_CHECK_SIGNATURES', True)
+ if check_signature and check_signature.strip() == "0":
+ self._invoke_smart('config --set rpm-check-signatures=false')
+ for i in self.d.getVar('BAD_RECOMMENDATIONS', True).split():
+ self._invoke_smart('flag --set ignore-recommends %s' % i)
+
+ # Do the following configurations here, to avoid them being
+ # saved for field upgrade
+ if self.d.getVar('NO_RECOMMENDATIONS', True).strip() == "1":
+ self._invoke_smart('config --set ignore-all-recommends=1')
+ pkg_exclude = self.d.getVar('PACKAGE_EXCLUDE', True) or ""
+ for i in pkg_exclude.split():
+ self._invoke_smart('flag --set exclude-packages %s' % i)
+
+ # Optional debugging
+ # self._invoke_smart('config --set rpm-log-level=debug')
+ # cmd = 'config --set rpm-log-file=/tmp/smart-debug-logfile'
+ # self._invoke_smart(cmd)
+ ch_already_added = []
+ for canonical_arch in platform_extra:
+ arch = canonical_arch.split('-')[0]
+ arch_channel = os.path.join(self.deploy_dir, arch)
+ if os.path.exists(arch_channel) and not arch in ch_already_added:
+ bb.note('Note: adding Smart channel %s (%s)' %
+ (arch, channel_priority))
+ self._invoke_smart('channel --add %s type=rpm-md baseurl=%s -y'
+ % (arch, arch_channel))
+ self._invoke_smart('channel --set %s priority=%d' %
+ (arch, channel_priority))
+ channel_priority -= 5
+
+ ch_already_added.append(arch)
+
+ bb.note('adding Smart RPM DB channel')
+ self._invoke_smart('channel --add rpmsys type=rpm-sys -y')
+
+ # Construct install scriptlet wrapper.
+ # Scripts need to be ordered when executed, this ensures numeric order.
+ # If we ever run into needing more the 899 scripts, we'll have to.
+ # change num to start with 1000.
+ #
+ scriptletcmd = "$2 $1/$3 $4\n"
+ scriptpath = "$1/$3"
+
+ # When self.debug_level >= 3, also dump the content of the
+ # executed scriptlets and how they get invoked. We have to
+ # replace "exit 1" and "ERR" because printing those as-is
+ # would trigger a log analysis failure.
+ if self.debug_level >= 3:
+ dump_invocation = 'echo "Executing ${name} ${kind} with: ' + scriptletcmd + '"\n'
+ dump_script = 'cat ' + scriptpath + '| sed -e "s/exit 1/exxxit 1/g" -e "s/ERR/IRR/g"; echo\n'
+ else:
+ dump_invocation = 'echo "Executing ${name} ${kind}"\n'
+ dump_script = ''
+
+ SCRIPTLET_FORMAT = "#!/bin/bash\n" \
+ "\n" \
+ "export PATH=%s\n" \
+ "export D=%s\n" \
+ 'export OFFLINE_ROOT="$D"\n' \
+ 'export IPKG_OFFLINE_ROOT="$D"\n' \
+ 'export OPKG_OFFLINE_ROOT="$D"\n' \
+ "export INTERCEPT_DIR=%s\n" \
+ "export NATIVE_ROOT=%s\n" \
+ "\n" \
+ "name=`head -1 " + scriptpath + " | cut -d\' \' -f 2`\n" \
+ "kind=`head -1 " + scriptpath + " | cut -d\' \' -f 4`\n" \
+ + dump_invocation \
+ + dump_script \
+ + scriptletcmd + \
+ "ret=$?\n" \
+ "echo Result of ${name} ${kind}: ${ret}\n" \
+ "if [ ${ret} -ne 0 ]; then\n" \
+ " if [ $4 -eq 1 ]; then\n" \
+ " mkdir -p $1/etc/rpm-postinsts\n" \
+ " num=100\n" \
+ " while [ -e $1/etc/rpm-postinsts/${num}-* ]; do num=$((num + 1)); done\n" \
+ ' echo "#!$2" > $1/etc/rpm-postinsts/${num}-${name}\n' \
+ ' echo "# Arg: $4" >> $1/etc/rpm-postinsts/${num}-${name}\n' \
+ " cat " + scriptpath + " >> $1/etc/rpm-postinsts/${num}-${name}\n" \
+ " chmod +x $1/etc/rpm-postinsts/${num}-${name}\n" \
+ ' echo "Info: deferring ${name} ${kind} install scriptlet to first boot"\n' \
+ " else\n" \
+ ' echo "Error: ${name} ${kind} remove scriptlet failed"\n' \
+ " fi\n" \
+ "fi\n"
+
+ intercept_dir = self.d.expand('${WORKDIR}/intercept_scripts')
+ native_root = self.d.getVar('STAGING_DIR_NATIVE', True)
+ scriptlet_content = SCRIPTLET_FORMAT % (os.environ['PATH'],
+ self.target_rootfs,
+ intercept_dir,
+ native_root)
+ open(self.scriptlet_wrapper, 'w+').write(scriptlet_content)
+
+ bb.note("Note: configuring RPM cross-install scriptlet_wrapper")
+ os.chmod(self.scriptlet_wrapper, 0755)
+ cmd = 'config --set rpm-extra-macros._cross_scriptlet_wrapper=%s' % \
+ self.scriptlet_wrapper
+ self._invoke_smart(cmd)
+
+ # Debug to show smart config info
+ # bb.note(self._invoke_smart('config --show'))
+
+ def update(self):
+ self._invoke_smart('update rpmsys')
+
+ def get_rdepends_recursively(self, pkgs):
+ # pkgs will be changed during the loop, so use [:] to make a copy.
+ for pkg in pkgs[:]:
+ sub_data = oe.packagedata.read_subpkgdata(pkg, self.d)
+ sub_rdep = sub_data.get("RDEPENDS_" + pkg)
+ if not sub_rdep:
+ continue
+ done = bb.utils.explode_dep_versions2(sub_rdep).keys()
+ next = done
+ # Find all the rdepends on dependency chain
+ while next:
+ new = []
+ for sub_pkg in next:
+ sub_data = oe.packagedata.read_subpkgdata(sub_pkg, self.d)
+ sub_pkg_rdep = sub_data.get("RDEPENDS_" + sub_pkg)
+ if not sub_pkg_rdep:
+ continue
+ for p in bb.utils.explode_dep_versions2(sub_pkg_rdep):
+ # Already handled, skip it.
+ if p in done or p in pkgs:
+ continue
+ # It's a new dep
+ if oe.packagedata.has_subpkgdata(p, self.d):
+ done.append(p)
+ new.append(p)
+ next = new
+ pkgs.extend(done)
+ return pkgs
+
+ '''
+ Install pkgs with smart, the pkg name is oe format
+ '''
+ def install(self, pkgs, attempt_only=False):
+
+ if not pkgs:
+ bb.note("There are no packages to install")
+ return
+ bb.note("Installing the following packages: %s" % ' '.join(pkgs))
+ if not attempt_only:
+ # Pull in multilib requires since rpm may not pull in them
+ # correctly, for example,
+ # lib32-packagegroup-core-standalone-sdk-target requires
+ # lib32-libc6, but rpm may pull in libc6 rather than lib32-libc6
+ # since it doesn't know mlprefix (lib32-), bitbake knows it and
+ # can handle it well, find out the RDEPENDS on the chain will
+ # fix the problem. Both do_rootfs and do_populate_sdk have this
+ # issue.
+ # The attempt_only packages don't need this since they are
+ # based on the installed ones.
+ #
+ # Separate pkgs into two lists, one is multilib, the other one
+ # is non-multilib.
+ ml_pkgs = []
+ non_ml_pkgs = pkgs[:]
+ for pkg in pkgs:
+ for mlib in (self.d.getVar("MULTILIB_VARIANTS", True) or "").split():
+ if pkg.startswith(mlib + '-'):
+ ml_pkgs.append(pkg)
+ non_ml_pkgs.remove(pkg)
+
+ if len(ml_pkgs) > 0 and len(non_ml_pkgs) > 0:
+ # Found both foo and lib-foo
+ ml_pkgs = self.get_rdepends_recursively(ml_pkgs)
+ non_ml_pkgs = self.get_rdepends_recursively(non_ml_pkgs)
+ # Longer list makes smart slower, so only keep the pkgs
+ # which have the same BPN, and smart can handle others
+ # correctly.
+ pkgs_new = []
+ for pkg in non_ml_pkgs:
+ for mlib in (self.d.getVar("MULTILIB_VARIANTS", True) or "").split():
+ mlib_pkg = mlib + "-" + pkg
+ if mlib_pkg in ml_pkgs:
+ pkgs_new.append(pkg)
+ pkgs_new.append(mlib_pkg)
+ for pkg in pkgs:
+ if pkg not in pkgs_new:
+ pkgs_new.append(pkg)
+ pkgs = pkgs_new
+ new_depends = {}
+ deps = bb.utils.explode_dep_versions2(" ".join(pkgs))
+ for depend in deps:
+ data = oe.packagedata.read_subpkgdata(depend, self.d)
+ key = "PKG_%s" % depend
+ if key in data:
+ new_depend = data[key]
+ else:
+ new_depend = depend
+ new_depends[new_depend] = deps[depend]
+ pkgs = bb.utils.join_deps(new_depends, commasep=True).split(', ')
+ pkgs = self._pkg_translate_oe_to_smart(pkgs, attempt_only)
+ if not attempt_only:
+ bb.note('to be installed: %s' % ' '.join(pkgs))
+ cmd = "%s %s install -y %s" % \
+ (self.smart_cmd, self.smart_opt, ' '.join(pkgs))
+ bb.note(cmd)
+ else:
+ bb.note('installing attempt only packages...')
+ bb.note('Attempting %s' % ' '.join(pkgs))
+ cmd = "%s %s install --attempt -y %s" % \
+ (self.smart_cmd, self.smart_opt, ' '.join(pkgs))
+ try:
+ output = subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT)
+ bb.note(output)
+ except subprocess.CalledProcessError as e:
+ bb.fatal("Unable to install packages. Command '%s' "
+ "returned %d:\n%s" % (cmd, e.returncode, e.output))
+
+ '''
+ Remove pkgs with smart, the pkg name is smart/rpm format
+ '''
+ def remove(self, pkgs, with_dependencies=True):
+ bb.note('to be removed: ' + ' '.join(pkgs))
+
+ if not with_dependencies:
+ cmd = "%s -e --nodeps " % self.rpm_cmd
+ cmd += "--root=%s " % self.target_rootfs
+ cmd += "--dbpath=/var/lib/rpm "
+ cmd += "--define='_cross_scriptlet_wrapper %s' " % \
+ self.scriptlet_wrapper
+ cmd += "--define='_tmppath /%s/tmp' %s" % (self.install_dir_name, ' '.join(pkgs))
+ else:
+ # for pkg in pkgs:
+ # bb.note('Debug: What required: %s' % pkg)
+ # bb.note(self._invoke_smart('query %s --show-requiredby' % pkg))
+
+ cmd = "%s %s remove -y %s" % (self.smart_cmd,
+ self.smart_opt,
+ ' '.join(pkgs))
+
+ try:
+ bb.note(cmd)
+ output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+ bb.note(output)
+ except subprocess.CalledProcessError as e:
+ bb.note("Unable to remove packages. Command '%s' "
+ "returned %d:\n%s" % (cmd, e.returncode, e.output))
+
+ def upgrade(self):
+ bb.note('smart upgrade')
+ self._invoke_smart('upgrade')
+
+ def write_index(self):
+ result = self.indexer.write_index()
+
+ if result is not None:
+ bb.fatal(result)
+
+ def remove_packaging_data(self):
+ bb.utils.remove(self.image_rpmlib, True)
+ bb.utils.remove(os.path.join(self.target_rootfs, 'var/lib/smart'),
+ True)
+ bb.utils.remove(os.path.join(self.target_rootfs, 'var/lib/opkg'), True)
+
+ # remove temp directory
+ bb.utils.remove(self.install_dir_path, True)
+
+ def backup_packaging_data(self):
+ # Save the rpmlib for increment rpm image generation
+ if os.path.exists(self.saved_rpmlib):
+ bb.utils.remove(self.saved_rpmlib, True)
+ shutil.copytree(self.image_rpmlib,
+ self.saved_rpmlib,
+ symlinks=True)
+
+ def recovery_packaging_data(self):
+ # Move the rpmlib back
+ if os.path.exists(self.saved_rpmlib):
+ if os.path.exists(self.image_rpmlib):
+ bb.utils.remove(self.image_rpmlib, True)
+
+ bb.note('Recovery packaging data')
+ shutil.copytree(self.saved_rpmlib,
+ self.image_rpmlib,
+ symlinks=True)
+
+ def list_installed(self):
+ return self.pkgs_list.list_pkgs()
+
+ '''
+ If incremental install, we need to determine what we've got,
+ what we need to add, and what to remove...
+ The dump_install_solution will dump and save the new install
+ solution.
+ '''
+ def dump_install_solution(self, pkgs):
+ bb.note('creating new install solution for incremental install')
+ if len(pkgs) == 0:
+ return
+
+ pkgs = self._pkg_translate_oe_to_smart(pkgs, False)
+ install_pkgs = list()
+
+ cmd = "%s %s install -y --dump %s 2>%s" % \
+ (self.smart_cmd,
+ self.smart_opt,
+ ' '.join(pkgs),
+ self.solution_manifest)
+ try:
+ # Disable rpmsys channel for the fake install
+ self._invoke_smart('channel --disable rpmsys')
+
+ subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+ with open(self.solution_manifest, 'r') as manifest:
+ for pkg in manifest.read().split('\n'):
+ if '@' in pkg:
+ install_pkgs.append(pkg)
+ except subprocess.CalledProcessError as e:
+ bb.note("Unable to dump install packages. Command '%s' "
+ "returned %d:\n%s" % (cmd, e.returncode, e.output))
+ # Recovery rpmsys channel
+ self._invoke_smart('channel --enable rpmsys')
+ return install_pkgs
+
+ '''
+ If incremental install, we need to determine what we've got,
+ what we need to add, and what to remove...
+ The load_old_install_solution will load the previous install
+ solution
+ '''
+ def load_old_install_solution(self):
+ bb.note('load old install solution for incremental install')
+ installed_pkgs = list()
+ if not os.path.exists(self.solution_manifest):
+ bb.note('old install solution not exist')
+ return installed_pkgs
+
+ with open(self.solution_manifest, 'r') as manifest:
+ for pkg in manifest.read().split('\n'):
+ if '@' in pkg:
+ installed_pkgs.append(pkg.strip())
+
+ return installed_pkgs
+
+ '''
+ Dump all available packages in feeds, it should be invoked after the
+ newest rpm index was created
+ '''
+ def dump_all_available_pkgs(self):
+ available_manifest = self.d.expand('${T}/saved/available_pkgs.txt')
+ available_pkgs = list()
+ cmd = "%s %s query --output %s" % \
+ (self.smart_cmd, self.smart_opt, available_manifest)
+ try:
+ subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+ with open(available_manifest, 'r') as manifest:
+ for pkg in manifest.read().split('\n'):
+ if '@' in pkg:
+ available_pkgs.append(pkg.strip())
+ except subprocess.CalledProcessError as e:
+ bb.note("Unable to list all available packages. Command '%s' "
+ "returned %d:\n%s" % (cmd, e.returncode, e.output))
+
+ self.fullpkglist = available_pkgs
+
+ return
+
+ def save_rpmpostinst(self, pkg):
+ mlibs = (self.d.getVar('MULTILIB_GLOBAL_VARIANTS', False) or "").split()
+
+ new_pkg = pkg
+ # Remove any multilib prefix from the package name
+ for mlib in mlibs:
+ if mlib in pkg:
+ new_pkg = pkg.replace(mlib + '-', '')
+ break
+
+ bb.note(' * postponing %s' % new_pkg)
+ saved_dir = self.target_rootfs + self.d.expand('${sysconfdir}/rpm-postinsts/') + new_pkg
+
+ cmd = self.rpm_cmd + ' -q --scripts --root ' + self.target_rootfs
+ cmd += ' --dbpath=/var/lib/rpm ' + new_pkg
+ cmd += ' | sed -n -e "/^postinstall scriptlet (using .*):$/,/^.* scriptlet (using .*):$/ {/.*/p}"'
+ cmd += ' | sed -e "/postinstall scriptlet (using \(.*\)):$/d"'
+ cmd += ' -e "/^.* scriptlet (using .*):$/d" > %s' % saved_dir
+
+ try:
+ bb.note(cmd)
+ output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True).strip()
+ bb.note(output)
+ os.chmod(saved_dir, 0755)
+ except subprocess.CalledProcessError as e:
+ bb.fatal("Invoke save_rpmpostinst failed. Command '%s' "
+ "returned %d:\n%s" % (cmd, e.returncode, e.output))
+
+ '''Write common configuration for target usage'''
+ def rpm_setup_smart_target_config(self):
+ bb.utils.remove(os.path.join(self.target_rootfs, 'var/lib/smart'),
+ True)
+
+ self._invoke_smart('config --set rpm-nolinktos=1')
+ self._invoke_smart('config --set rpm-noparentdirs=1')
+ for i in self.d.getVar('BAD_RECOMMENDATIONS', True).split():
+ self._invoke_smart('flag --set ignore-recommends %s' % i)
+ self._invoke_smart('channel --add rpmsys type=rpm-sys -y')
+
+ '''
+ The rpm db lock files were produced after invoking rpm to query on
+ build system, and they caused the rpm on target didn't work, so we
+ need to unlock the rpm db by removing the lock files.
+ '''
+ def unlock_rpm_db(self):
+ # Remove rpm db lock files
+ rpm_db_locks = glob.glob('%s/var/lib/rpm/__db.*' % self.target_rootfs)
+ for f in rpm_db_locks:
+ bb.utils.remove(f, True)
+
+
+class OpkgPM(PackageManager):
+ def __init__(self, d, target_rootfs, config_file, archs, task_name='target'):
+ super(OpkgPM, self).__init__(d)
+
+ self.target_rootfs = 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", True)
+ 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 -o %s " % (self.config_file, target_rootfs)
+ self.opkg_args += self.d.getVar("OPKG_ARGS", True)
+
+ opkg_lib_dir = self.d.getVar('OPKGLIBDIR', True)
+ 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', True) or "") == "1"
+ if self.from_feeds:
+ self._create_custom_config()
+ else:
+ self._create_config()
+
+ self.indexer = OpkgIndexer(self.d, self.deploy_dir)
+
+ """
+ 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
+ """
+ def mark_packages(self, status_tag, packages=None):
+ 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', True) 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', True) or "") != "":
+ for arch in self.pkg_archs.split():
+ cfg_file_name = os.path.join(self.target_rootfs,
+ self.d.getVar("sysconfdir", True),
+ "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', True),
+ arch))
+
+ if self.opkg_dir != '/var/lib/opkg':
+ # 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_INFO_DIR "/var/lib/opkg/info"
+ # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_STATUS_FILE "/var/lib/opkg/status"
+ cfg_file.write("option info_dir %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR', True), 'opkg', 'info'))
+ cfg_file.write("option status_file %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR', True), '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.opkg_dir != '/var/lib/opkg':
+ # 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_INFO_DIR "/var/lib/opkg/info"
+ # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_STATUS_FILE "/var/lib/opkg/status"
+ config_file.write("option info_dir %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR', True), 'opkg', 'info'))
+ config_file.write("option status_file %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR', True), 'opkg', 'status'))
+
+ def insert_feeds_uris(self):
+ if self.feed_uris == "":
+ return
+
+ rootfs_config = os.path.join('%s/etc/opkg/base-feeds.conf'
+ % self.target_rootfs)
+
+ feed_uris = self.construct_uris(self.feed_uris.split(), self.feed_base_paths.split())
+ archs = self.pkg_archs.split() if self.feed_archs is None else self.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 (self.feed_archs is None) and (not os.path.exists(os.path.join(self.deploy_dir, arch))):
+ continue
+ bb.note('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('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))
+
+ 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'] = os.path.join(self.d.getVar('WORKDIR', True),
+ "intercept_scripts")
+ os.environ['NATIVE_ROOT'] = self.d.getVar('STAGING_DIR_NATIVE', True)
+
+ try:
+ bb.note("Installing the following packages: %s" % ' '.join(pkgs))
+ bb.note(cmd)
+ output = subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT)
+ bb.note(output)
+ except subprocess.CalledProcessError as e:
+ (bb.fatal, bb.note)[attempt_only]("Unable to install packages. "
+ "Command '%s' returned %d:\n%s" %
+ (cmd, e.returncode, e.output))
+
+ def remove(self, pkgs, with_dependencies=True):
+ if with_dependencies:
+ cmd = "%s %s --force-depends --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)
+ 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))
+
+ 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", True) 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()
+ except subprocess.CalledProcessError as e:
+ bb.fatal("Cannot get package info. Command '%s' "
+ "returned %d:\n%s" % (pkg_info, e.returncode, e.output))
+
+ 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")
+
+ '''
+ The following function dummy installs pkgs and returns the log of output.
+ '''
+ def dummy_install(self, pkgs):
+ if len(pkgs) == 0:
+ return
+
+ # Create an temp dir as opkg root for dummy installation
+ temp_rootfs = self.d.expand('${T}/opkg')
+ temp_opkg_dir = os.path.join(temp_rootfs, 'var/lib/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", True)
+
+ 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))
+
+ # 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))
+
+ 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)
+
+
+class DpkgPM(PackageManager):
+ def __init__(self, d, target_rootfs, archs, base_archs, apt_conf_dir=None):
+ super(DpkgPM, self).__init__(d)
+ self.target_rootfs = target_rootfs
+ self.deploy_dir = self.d.getVar('DEPLOY_DIR_DEB', True)
+ 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_args = d.getVar("APT_ARGS", True)
+
+ self.all_arch_list = archs.split()
+ all_mlb_pkg_arch_list = (self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS', True) 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)
+
+ """
+ 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
+ """
+ def mark_packages(self, status_tag, packages=None):
+ 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)
+
+ """
+ Run the pre/post installs for package "package_name". If package_name is
+ None, then run all pre/post install scriptlets.
+ """
+ def run_pre_post_installs(self, package_name=None):
+ info_dir = self.target_rootfs + "/var/lib/dpkg/info"
+ suffixes = [(".preinst", "Preinstall"), (".postinst", "Postinstall")]
+ 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'] = os.path.join(self.d.getVar('WORKDIR', True),
+ "intercept_scripts")
+ os.environ['NATIVE_ROOT'] = self.d.getVar('STAGING_DIR_NATIVE', True)
+
+ failed_pkgs = []
+ for pkg_name in installed_pkgs:
+ for suffix in suffixes:
+ p_full = os.path.join(info_dir, pkg_name + suffix[0])
+ if os.path.exists(p_full):
+ try:
+ bb.note("Executing %s for package: %s ..." %
+ (suffix[1].lower(), pkg_name))
+ subprocess.check_output(p_full, stderr=subprocess.STDOUT)
+ except subprocess.CalledProcessError as e:
+ bb.note("%s for package %s failed with %d:\n%s" %
+ (suffix[1], pkg_name, e.returncode, e.output))
+ 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))
+
+ 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.note)[attempt_only]("Unable to install packages. "
+ "Command '%s' returned %d:\n%s" %
+ (cmd, e.returncode, e.output))
+
+ # 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))
+
+ 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):
+ if self.feed_uris == "":
+ return
+
+ sources_conf = os.path.join("%s/etc/apt/sources.list"
+ % self.target_rootfs)
+ arch_list = []
+
+ if self.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 = self.feed_archs.split()
+
+ feed_uris = self.construct_uris(self.feed_uris.split(), self.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('Note: adding dpkg channel at (%s)' % uri)
+ sources_file.write("deb %s/%s ./\n" %
+ (uri, arch))
+ else:
+ bb.note('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', True) 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", True);
+ 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", True)
+ localdata.setVar("DEFAULTTUNE", variant_tune)
+ bb.data.update_data(localdata)
+ variant_arch = localdata.getVar("DPKG_ARCH", True)
+ 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)), 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))
+
+ def list_installed(self):
+ return DpkgPkgsList(self.d, self.target_rootfs).list_pkgs()
+
+
+def generate_index_files(d):
+ classes = d.getVar('PACKAGE_CLASSES', True).replace("package_", "").split()
+
+ indexer_map = {
+ "rpm": (RpmIndexer, d.getVar('DEPLOY_DIR_RPM', True)),
+ "ipk": (OpkgIndexer, d.getVar('DEPLOY_DIR_IPK', True)),
+ "deb": (DpkgIndexer, d.getVar('DEPLOY_DIR_DEB', True))
+ }
+
+ 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)
+
+if __name__ == "__main__":
+ """
+ We should be able to run this as a standalone script, from outside bitbake
+ environment.
+ """
+ """
+ TBD
+ """
diff --git a/import-layers/yocto-poky/meta/lib/oe/packagedata.py b/import-layers/yocto-poky/meta/lib/oe/packagedata.py
new file mode 100644
index 000000000..bc0fd06bc
--- /dev/null
+++ b/import-layers/yocto-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("string_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", True)
+
+ pkgmap = {}
+ try:
+ files = os.listdir(pkgdatadir)
+ except OSError:
+ bb.warn("No files in %s?" % pkgdatadir)
+ files = []
+
+ for pn in filter(lambda f: not os.path.isdir(os.path.join(pkgdatadir, f)), files):
+ 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/import-layers/yocto-poky/meta/lib/oe/packagegroup.py b/import-layers/yocto-poky/meta/lib/oe/packagegroup.py
new file mode 100644
index 000000000..a6fee5f95
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oe/packagegroup.py
@@ -0,0 +1,36 @@
+import itertools
+
+def is_optional(feature, d):
+ packages = d.getVar("FEATURE_PACKAGES_%s" % feature, True)
+ if packages:
+ return bool(d.getVarFlag("FEATURE_PACKAGES_%s" % feature, "optional", True))
+ else:
+ return bool(d.getVarFlag("PACKAGE_GROUP_%s" % feature, "optional", True))
+
+def packages(features, d):
+ for feature in features:
+ packages = d.getVar("FEATURE_PACKAGES_%s" % feature, True)
+ if not packages:
+ packages = d.getVar("PACKAGE_GROUP_%s" % feature, True)
+ for pkg in (packages or "").split():
+ yield pkg
+
+def required_packages(features, d):
+ req = filter(lambda feature: not is_optional(feature, d), features)
+ return packages(req, d)
+
+def optional_packages(features, d):
+ opt = filter(lambda feature: is_optional(feature, d), features)
+ 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/import-layers/yocto-poky/meta/lib/oe/patch.py b/import-layers/yocto-poky/meta/lib/oe/patch.py
new file mode 100644
index 000000000..9d3617290
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oe/patch.py
@@ -0,0 +1,704 @@
+import oe.path
+
+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)
+ 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"] = bb.data.expand(bb.fetch2.localpath(patch["remote"], self.d), 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:])
+
+ 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))
+
+ 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", "-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)
+
+ @staticmethod
+ def extractPatchHeader(patchfile):
+ """
+ Extract just the header lines from the top of a patch file
+ """
+ lines = []
+ with open(patchfile, 'r') as f:
+ for line in f.readlines():
+ if line.startswith('Index: ') or line.startswith('diff -') or line.startswith('---'):
+ break
+ lines.append(line)
+ return lines
+
+ @staticmethod
+ def decodeAuthor(line):
+ from email.header import decode_header
+ authorval = line.split(':', 1)[1].strip().replace('"', '')
+ return decode_header(authorval)[0][0]
+
+ @staticmethod
+ def interpretPatchHeader(headerlines):
+ import re
+ author_re = re.compile('[\S ]+ <\S+@\S+\.\S+>')
+ 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
+ outlines.append(line)
+ return outlines, author, date, subject
+
+ @staticmethod
+ def prepareCommit(patchfile):
+ """
+ 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:
+ try:
+ shellcmd = ["git", "log", "--format=email", "--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 or not date:
+ # These really need to go together
+ author = newauthor
+ date = newdate
+ if not subject:
+ subject = newsubject
+ if 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", "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
+ tempdir = tempfile.mkdtemp(prefix='oepatch')
+ try:
+ shellcmd = ["git", "format-patch", startcommit, "-o", tempdir]
+ if paths:
+ shellcmd.append('--')
+ shellcmd.extend(paths)
+ out = runcmd(["sh", "-c", " ".join(shellcmd)], tree)
+ if out:
+ for srcfile in out.split():
+ patchlines = []
+ outfile = None
+ with open(srcfile, 'r') as f:
+ for line in f:
+ if line.startswith(GitApplyTree.patch_line_prefix):
+ outfile = line.split()[-1].strip()
+ continue
+ if line.startswith(GitApplyTree.ignore_commit_prefix):
+ continue
+ patchlines.append(line)
+ 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, 0755)
+ shutil.copy2(commithook, applyhook)
+ try:
+ patchfilevar = 'PATCHFILE="%s"' % os.path.basename(patch['file'])
+ try:
+ shellcmd = [patchfilevar, "git", "--work-tree=%s" % reporoot, "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'])
+ 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', True)
+ 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', True)
+ 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, 0775)
+
+ 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)
diff --git a/import-layers/yocto-poky/meta/lib/oe/path.py b/import-layers/yocto-poky/meta/lib/oe/path.py
new file mode 100644
index 000000000..413ebfb39
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oe/path.py
@@ -0,0 +1,243 @@
+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 format_display(path, metadata):
+ """ Prepare a path for display to the user. """
+ rel = relative(metadata.getVar("TOPDIR", True), 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 -cf - -C %s -p . | tar -xf - -C %s' % (src, dst)
+ 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 -cf - -C %s -p --files-from - --no-recursion | tar -xf - -C %s' % (src, src, dst)
+ check_output(cmd, shell=True, stderr=subprocess.STDOUT)
+ cmd = 'cd %s; find . -print0 | cpio --null -pdlu %s' % (src, dst)
+ check_output(cmd, shell=True, stderr=subprocess.STDOUT)
+ else:
+ copytree(src, dst)
+
+def remove(path, recurse=True):
+ """Equivalent to rm -f or rm -rf"""
+ 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
+
+class CalledProcessError(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)
+
+# Not needed when we move to python 2.7
+def check_output(*popenargs, **kwargs):
+ r"""Run command with arguments and return its output as a byte string.
+
+ If the exit code was non-zero it raises a CalledProcessError. The
+ CalledProcessError object will have the return code in the returncode
+ attribute and output in the output attribute.
+
+ The arguments are the same as for the Popen constructor. Example:
+
+ >>> check_output(["ls", "-l", "/dev/null"])
+ 'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n'
+
+ The stdout argument is not allowed as it is used internally.
+ To capture standard error in the result, use stderr=STDOUT.
+
+ >>> check_output(["/bin/sh", "-c",
+ ... "ls -l non_existent_file ; exit 0"],
+ ... stderr=STDOUT)
+ 'ls: non_existent_file: No such file or directory\n'
+ """
+ if 'stdout' in kwargs:
+ raise ValueError('stdout argument not allowed, it will be overridden.')
+ process = subprocess.Popen(stdout=subprocess.PIPE, *popenargs, **kwargs)
+ output, unused_err = process.communicate()
+ retcode = process.poll()
+ if retcode:
+ cmd = kwargs.get("args")
+ if cmd is None:
+ cmd = popenargs[0]
+ raise CalledProcessError(retcode, cmd, output=output)
+ return output
+
+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
diff --git a/import-layers/yocto-poky/meta/lib/oe/prservice.py b/import-layers/yocto-poky/meta/lib/oe/prservice.py
new file mode 100644
index 000000000..b0cbcb1fb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oe/prservice.py
@@ -0,0 +1,126 @@
+
+def prserv_make_conn(d, check = False):
+ import prserv.serv
+ host_params = filter(None, (d.getVar("PRSERV_HOST", True) or '').split(':'))
+ 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, 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', True):
+ bb.error("Not using network based PR service")
+ return None
+
+ conn = d.getVar("__PRSERV_CONN", True)
+ 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', True)
+ opt_pkgarch = d.getVar('PRSERV_DUMPOPT_PKGARCH', True)
+ opt_checksum = d.getVar('PRSERV_DUMPOPT_CHECKSUM', True)
+ opt_col = ("1" == d.getVar('PRSERV_DUMPOPT_COL', True))
+ 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', True):
+ bb.error("Not using network based PR service")
+ return None
+
+ conn = d.getVar("__PRSERV_CONN", True)
+ 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, True))
+ 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', True))
+ df = d.getVar('PRSERV_DUMPFILE', True)
+ #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 = filter(None, (d.getVar("PRSERV_HOST", True) or '').split(':'))
+ 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/import-layers/yocto-poky/meta/lib/oe/qa.py b/import-layers/yocto-poky/meta/lib/oe/qa.py
new file mode 100644
index 000000000..3cfeee737
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oe/qa.py
@@ -0,0 +1,151 @@
+import os, struct
+
+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
+ ELFDATANONE = 0
+ ELFDATA2LSB = 1
+ ELFDATA2MSB = 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, bits = 0):
+ self.name = name
+ self.bits = bits
+ self.objdump_output = {}
+
+ def open(self):
+ if not os.path.isfile(self.name):
+ raise NotELFFileError("%s is not a normal file" % self.name)
+
+ self.file = file(self.name, "r")
+ # Read 4k which should cover most of the headers we're after
+ self.data = self.file.read(4096)
+
+ if len(self.data) < ELFFile.EI_NIDENT + 4:
+ raise NotELFFileError("%s is not an ELF" % self.name)
+
+ self.my_assert(self.data[0], chr(0x7f) )
+ self.my_assert(self.data[1], 'E')
+ self.my_assert(self.data[2], 'L')
+ self.my_assert(self.data[3], 'F')
+ if self.bits == 0:
+ if self.data[ELFFile.EI_CLASS] == chr(ELFFile.ELFCLASS32):
+ self.bits = 32
+ elif self.data[ELFFile.EI_CLASS] == chr(ELFFile.ELFCLASS64):
+ self.bits = 64
+ else:
+ # Not 32-bit or 64.. lets assert
+ raise NotELFFileError("ELF but not 32 or 64 bit.")
+ elif self.bits == 32:
+ self.my_assert(self.data[ELFFile.EI_CLASS], chr(ELFFile.ELFCLASS32))
+ elif self.bits == 64:
+ self.my_assert(self.data[ELFFile.EI_CLASS], chr(ELFFile.ELFCLASS64))
+ else:
+ raise NotELFFileError("Must specify unknown, 32 or 64 bit size.")
+ self.my_assert(self.data[ELFFile.EI_VERSION], chr(ELFFile.EV_CURRENT) )
+
+ self.sex = self.data[ELFFile.EI_DATA]
+ if self.sex == chr(ELFFile.ELFDATANONE):
+ raise NotELFFileError("self.sex == ELFDATANONE")
+ elif self.sex == chr(ELFFile.ELFDATA2LSB):
+ self.sex = "<"
+ elif self.sex == chr(ELFFile.ELFDATA2MSB):
+ self.sex = ">"
+ else:
+ raise NotELFFileError("Unknown self.sex")
+
+ def osAbi(self):
+ return ord(self.data[ELFFile.EI_OSABI])
+
+ def abiVersion(self):
+ return ord(self.data[ELFFile.EI_ABIVERSION])
+
+ def abiSize(self):
+ return self.bits
+
+ def isLittleEndian(self):
+ return self.sex == "<"
+
+ def isBigEndian(self):
+ return self.sex == ">"
+
+ def getShort(self, offset):
+ return struct.unpack_from(self.sex+"H", self.data, offset)[0]
+
+ def getWord(self, offset):
+ return struct.unpack_from(self.sex+"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 sex stored in self.sex 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', True)
+
+ env = os.environ.copy()
+ env["LC_ALL"] = "C"
+ env["PATH"] = d.getVar('PATH', True)
+
+ 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 ""
+
+if __name__ == "__main__":
+ import sys
+ elf = ELFFile(sys.argv[1])
+ elf.open()
+ print elf.isDynamic()
diff --git a/import-layers/yocto-poky/meta/lib/oe/recipeutils.py b/import-layers/yocto-poky/meta/lib/oe/recipeutils.py
new file mode 100644
index 000000000..6c7adb5bd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oe/recipeutils.py
@@ -0,0 +1,849 @@
+# Utility functions for reading and modifying recipes
+#
+# Some code borrowed from the OE layer index
+#
+# Copyright (C) 2013-2015 Intel Corporation
+#
+
+import sys
+import os
+import os.path
+import tempfile
+import textwrap
+import difflib
+import utils
+import shutil
+import re
+import fnmatch
+from collections import OrderedDict, defaultdict
+
+
+# Help us to find places to insert values
+recipe_progression = ['SUMMARY', 'DESCRIPTION', 'HOMEPAGE', 'BUGTRACKER', 'SECTION', 'LICENSE', 'LIC_FILES_CHKSUM', 'PROVIDES', 'DEPENDS', 'PR', 'PV', 'SRCREV', 'SRC_URI', 'S', 'do_fetch()', 'do_unpack()', 'do_patch()', 'EXTRA_OECONF', 'do_configure()', 'EXTRA_OEMAKE', 'do_compile()', 'do_install()', 'do_populate_sysroot()', 'INITSCRIPT', 'USERADD', 'GROUPADD', 'PACKAGES', 'FILES', 'RDEPENDS', 'RRECOMMENDS', 'RSUGGESTS', 'RPROVIDES', 'RREPLACES', 'RCONFLICTS', 'ALLOW_EMPTY', '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):
+ """Convert a recipe name (PN) to the path to the recipe file"""
+ import bb.providers
+
+ if pn in cooker.recipecache.pkg_pn:
+ best = bb.providers.findBestProvider(pn, cooker.data, cooker.recipecache, cooker.recipecache.pkg_pn)
+ return best[3]
+ elif pn in cooker.recipecache.providers:
+ filenames = cooker.recipecache.providers[pn]
+ eligible, foundUnique = bb.providers.filterProviders(filenames, pn, cooker.expanded_data, cooker.recipecache)
+ filename = eligible[0]
+ return filename
+ else:
+ return None
+
+
+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(fn, appendfiles, d):
+ """
+ Parse an individual recipe file, optionally with a list of
+ bbappend files.
+ """
+ import bb.cache
+ envdata = bb.cache.Cache.loadDataFull(fn, appendfiles, d)
+ return envdata
+
+
+def parse_recipe_simple(cooker, pn, d, appends=True):
+ """
+ Parse a recipe and optionally all bbappends that apply to it
+ in the current configuration.
+ """
+ import bb.providers
+
+ recipefile = pn_to_recipe(cooker, pn)
+ if not recipefile:
+ skipreasons = get_unavailable_reasons(cooker, pn)
+ # We may as well re-use bb.providers.NoProvider here
+ if skipreasons:
+ raise bb.providers.NoProvider(skipreasons)
+ else:
+ raise bb.providers.NoProvider('Unable to find any recipe file matching %s' % pn)
+ if appends:
+ appendfiles = cooker.collection.get_file_appends(recipefile)
+ else:
+ appendfiles = None
+ return parse_recipe(recipefile, appendfiles, d)
+
+
+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_file(fn, values, patch=False, relpath=''):
+ """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.
+ """
+
+ import bb.utils
+
+ 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.iteritems(), key=lambda x: x[1]))
+
+ modifying = False
+
+ def outputvalue(name, lines, rewindcomments=False):
+ if values[name] is None:
+ return
+ rawtext = '%s = "%s"\n' % (name, values[name])
+ addlines = []
+ if name in nowrap_vars:
+ 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"\n' % (name, linesplit.join(splitvalue), linesplit))
+ else:
+ addlines.append(rawtext)
+ else:
+ wrapped = textwrap.wrap(rawtext)
+ for wrapline in wrapped[:-1]:
+ addlines.append('%s \\\n' % wrapline)
+ addlines.append('%s\n' % wrapped[-1])
+ 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 ln[0] != '#':
+ 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 remainingnames.keys()[:]:
+ 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()]
+ with open(fn, 'r') as f:
+ changed, fromlines = bb.utils.edit_metadata(f, 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[-1].strip() != '':
+ tolines.append('\n')
+ for k in remainingnames.keys():
+ outputvalue(k, tolines)
+
+ if 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=''):
+ """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.iteritems():
+ vals = {k: varvalues[k] for k in v}
+ patchdata = patch_recipe_file(f, vals, patch, relpath)
+ if patch:
+ patches.append(patchdata)
+
+ if patch:
+ return patches
+ else:
+ return None
+
+
+
+def copy_recipe_files(d, tgt_dir, whole_dir=False, download=True):
+ """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
+
+ uris = (d.getVar('SRC_URI', True) or "").split()
+ fetch = bb.fetch2.Fetch(uris, d)
+ if download:
+ fetch.download()
+
+ # Copy local files to target directory and gather any remote files
+ bb_dir = os.path.dirname(d.getVar('FILE', True)) + os.sep
+ remotes = []
+ includes = [path for path in d.getVar('BBINCLUDED', True).split() if
+ path.startswith(bb_dir) and os.path.exists(path)]
+ for path in fetch.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))
+ else:
+ remotes.append(path)
+ # Simply copy whole meta dir, if requested
+ if whole_dir:
+ shutil.copytree(bb_dir, tgt_dir)
+
+ return remotes
+
+
+def get_recipe_local_files(d, patches=False):
+ """Get a list of local files in SRC_URI within a recipe."""
+ uris = (d.getVar('SRC_URI', True) or "").split()
+ fetch = bb.fetch2.Fetch(uris, d)
+ ret = {}
+ for uri in uris:
+ if fetch.ud[uri].type == 'file':
+ if (not patches and
+ bb.utils.exec_flat_python_func('patch_path', uri, fetch, '')):
+ continue
+ # Skip files that are referenced by absolute path
+ if not os.path.isabs(fetch.ud[uri].basepath):
+ ret[fetch.ud[uri].basepath] = fetch.localpath(uri)
+ return ret
+
+
+def get_recipe_patches(d):
+ """Get a list of the patches included in SRC_URI within a recipe."""
+ patchfiles = []
+ # Execute src_patches() defined in patch.bbclass - this works since that class
+ # is inherited globally
+ patches = bb.utils.exec_flat_python_func('src_patches', d)
+ 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
+ # Execute src_patches() defined in patch.bbclass - this works since that class
+ # is inherited globally
+ patches = bb.utils.exec_flat_python_func('src_patches', d)
+ 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', True), 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_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', True)
+ 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', True).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):
+ """
+ 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.
+ """
+
+ 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)
+ 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', True).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.iteritems():
+ 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 xrange(0, len(bbappendlines)):
+ if bbappendlines[i][0] == varname:
+ line = bbappendlines.pop(i)
+ return line
+ return None
+
+ def appendline(varname, op, value):
+ for i in xrange(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', True)
+ 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.iteritems():
+ 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', True).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))
+
+ bb.note('Writing append file %s' % appendpath)
+
+ if os.path.exists(appendpath):
+ # 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, basestring):
+ 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(removevalues.keys())
+
+ with open(appendpath, '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(appendpath, 'w') as f:
+ f.writelines(newlines)
+
+ if copyfiles:
+ if machine:
+ destsubdir = os.path.join(destsubdir, machine)
+ for newfile, srcfile in copyfiles.iteritems():
+ filedest = os.path.join(appenddir, destsubdir, os.path.basename(srcfile))
+ if os.path.abspath(newfile) != os.path.abspath(filedest):
+ bb.note('Copying %s to %s' % (newfile, 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 relative path to base of layer for a file (e.g. a recipe)"""
+ pth = os.path.dirname(fn)
+ layerdir = ''
+ while pth:
+ if os.path.exists(os.path.join(pth, 'conf', 'layer.conf')):
+ layerdir = pth
+ break
+ pth = os.path.dirname(pth)
+ 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(d.keys(), key=len):
+ if var.endswith('dir') and var.lower() == var:
+ value = d.getVar(var, True)
+ if value.startswith('/') and not '\n' in value and value not in dirvars:
+ dirvars[value] = var
+ for dirpath in sorted(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, 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['version'] = ''
+ ru['type'] = 'U'
+ ru['datetime'] = ''
+
+ pv = rd.getVar('PV', True)
+
+ # 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', True)
+ if not src_uris:
+ ru['version'] = pv
+ 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)
+
+ manual_upstream_version = rd.getVar("RECIPE_UPSTREAM_VERSION", True)
+ if manual_upstream_version:
+ # manual tracking of upstream version.
+ ru['version'] = manual_upstream_version
+ ru['type'] = 'M'
+
+ manual_upstream_date = rd.getVar("CHECK_DATE", True)
+ 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)
+ pupver = ud.method.latest_versionstring(ud, rd)
+ (upversion, revision) = pupver
+
+ # format git version version+gitAUTOINC+HASH
+ if uri_type == 'git':
+ (pv, pfx, sfx) = get_recipe_pv_without_srcpv(pv, uri_type)
+
+ # if contains revision but not upversion use current pv
+ if upversion == '' and revision:
+ upversion = pv
+
+ if upversion:
+ tmp = upversion
+ upversion = ''
+
+ if pfx:
+ upversion = pfx + tmp
+ else:
+ upversion = tmp
+
+ if sfx:
+ upversion = upversion + sfx + revision[:10]
+
+ if upversion:
+ ru['version'] = upversion
+ ru['type'] = 'A'
+
+ ru['datetime'] = datetime.now()
+
+ return ru
diff --git a/import-layers/yocto-poky/meta/lib/oe/rootfs.py b/import-layers/yocto-poky/meta/lib/oe/rootfs.py
new file mode 100644
index 000000000..a95e1b739
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oe/rootfs.py
@@ -0,0 +1,986 @@
+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):
+ """
+ This is an abstract class. Do not instantiate this directly.
+ """
+ __metaclass__ = ABCMeta
+
+ def __init__(self, d):
+ self.d = d
+ self.pm = None
+ self.image_rootfs = self.d.getVar('IMAGE_ROOTFS', True)
+ self.deploy_dir_image = self.d.getVar('DEPLOY_DIR_IMAGE', True)
+
+ 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_warn(self):
+ r = re.compile('^(warn|Warn|NOTE: warn|NOTE: Warn|WARNING:)')
+ log_path = self.d.expand("${T}/log.do_rootfs")
+ with open(log_path, 'r') as log:
+ for line in log:
+ if 'log_check' in line or 'NOTE:' in line:
+ continue
+
+ m = r.search(line)
+ if m:
+ bb.warn('[log_check] %s: found a warning message in the logfile (keyword \'%s\'):\n[log_check] %s'
+ % (self.d.getVar('PN', True), m.group(), line))
+
+ def _log_check_error(self):
+ r = re.compile(self.log_check_regex)
+ log_path = self.d.expand("${T}/log.do_rootfs")
+ with open(log_path, 'r') as log:
+ found_error = 0
+ message = "\n"
+ for line in log:
+ if 'log_check' in line:
+ continue
+
+ if hasattr(self, 'log_check_expected_errors_regexes'):
+ m = None
+ for ee in self.log_check_expected_errors_regexes:
+ m = re.search(ee, line)
+ if m:
+ break
+ if m:
+ continue
+
+ m = r.search(line)
+ if m:
+ found_error = 1
+ bb.warn('[log_check] In line: [%s]' % line)
+ bb.warn('[log_check] %s: found an error message in the logfile (keyword \'%s\'):\n[log_check] %s'
+ % (self.d.getVar('PN', True), m.group(), line))
+
+ if found_error >= 1 and found_error <= 5:
+ message += line + '\n'
+ found_error += 1
+
+ if found_error == 6:
+ bb.fatal(message)
+
+ def _insert_feed_uris(self):
+ if bb.utils.contains("IMAGE_FEATURES", "package-management",
+ True, False, self.d):
+ self.pm.insert_feeds_uris()
+
+ @abstractmethod
+ def _handle_intercept_failure(self, failed_script):
+ pass
+
+ """
+ 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', True) 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:
+ bb.utils.mkdirhier(self.image_rootfs + os.path.dirname(dir))
+ shutil.copytree(self.image_rootfs + '-orig' + dir, self.image_rootfs + dir)
+
+ 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', True)
+ 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", True)
+ post_process_cmds = self.d.getVar("ROOTFS_POSTPROCESS_COMMAND", True)
+ rootfs_post_install_cmds = self.d.getVar('ROOTFS_POSTINSTALL_COMMAND', True)
+
+ postinst_intercepts_dir = self.d.getVar("POSTINST_INTERCEPTS_DIR", True)
+ if not postinst_intercepts_dir:
+ postinst_intercepts_dir = self.d.expand("${COREBASE}/scripts/postinst-intercepts")
+ intercepts_dir = os.path.join(self.d.getVar('WORKDIR', True),
+ "intercept_scripts")
+
+ bb.utils.remove(intercepts_dir, True)
+
+ bb.utils.mkdirhier(self.image_rootfs)
+
+ bb.utils.mkdirhier(self.deploy_dir_image)
+
+ shutil.copytree(postinst_intercepts_dir, intercepts_dir)
+
+ shutil.copy(self.d.expand("${COREBASE}/meta/files/deploydir_readme.txt"),
+ self.deploy_dir_image +
+ "/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt")
+
+ execute_pre_post_process(self.d, pre_process_cmds)
+
+ # call the package manager dependent create method
+ self._create()
+
+ sysconfdir = self.image_rootfs + self.d.getVar('sysconfdir', True)
+ bb.utils.mkdirhier(sysconfdir)
+ with open(sysconfdir + "/version", "w+") as ver:
+ ver.write(self.d.getVar('BUILDNAME', True) + "\n")
+
+ execute_pre_post_process(self.d, rootfs_post_install_cmds)
+
+ self._run_intercepts()
+
+ execute_pre_post_process(self.d, post_process_cmds)
+
+ 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', True) != "1":
+ self._create_devfs()
+
+ self._uninstall_unneeded()
+
+ self._insert_feed_uris()
+
+ self._run_ldconfig()
+
+ if self.d.getVar('USE_DEPMOD', True) != "0":
+ self._generate_kernel_module_deps()
+
+ self._cleanup()
+ self._log_check()
+
+ 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', True),
+ "run-postinsts", "remove"])
+
+ image_rorfs = bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs",
+ True, False, self.d)
+ if image_rorfs:
+ # Remove components that we don't need if it's a read-only rootfs
+ unneeded_pkgs = self.d.getVar("ROOTFS_RO_UNNEEDED", True).split()
+ pkgs_installed = image_list_installed_packages(self.d)
+ pkgs_to_remove = [pkg for pkg in pkgs_installed if pkg in unneeded_pkgs]
+
+ if len(pkgs_to_remove) > 0:
+ self.pm.remove(pkgs_to_remove, 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", True)
+ 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_intercepts(self):
+ intercepts_dir = os.path.join(self.d.getVar('WORKDIR', True),
+ "intercept_scripts")
+
+ bb.note("Running intercept scripts:")
+ os.environ['D'] = self.image_rootfs
+ os.environ['STAGING_DIR_NATIVE'] = self.d.getVar('STAGING_DIR_NATIVE', True)
+ 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
+
+ bb.note("> Executing %s intercept ..." % script)
+
+ try:
+ subprocess.check_call(script_full)
+ except subprocess.CalledProcessError as e:
+ bb.warn("The postinstall intercept hook '%s' failed (exit code: %d)! See log for details!" %
+ (script, e.returncode))
+
+ with open(script_full) 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.warn("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_ldconfig(self):
+ if self.d.getVar('LDCONFIGDEPEND', True):
+ 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', True), "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', True)
+ if devtable is not None:
+ devtable_list.append(devtable)
+ else:
+ devtables = self.d.getVar('IMAGE_DEVICE_TABLES', True)
+ 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', True), 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):
+ super(RpmRootfs, self).__init__(d)
+ 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', True),
+ self.d.getVar('TARGET_VENDOR', True)
+ )
+
+ self.inc_rpm_image_gen = self.d.getVar('INC_RPM_IMAGE_GEN', True)
+ 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), 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)
+
+ def _create(self):
+ pkgs_to_install = self.manifest.parse_initial_manifest()
+ rpm_pre_process_cmds = self.d.getVar('RPM_PREPROCESS_COMMANDS', True)
+ rpm_post_process_cmds = self.d.getVar('RPM_POSTPROCESS_COMMANDS', True)
+
+ # update PM index files
+ self.pm.write_index()
+
+ execute_pre_post_process(self.d, rpm_pre_process_cmds)
+
+ self.pm.dump_all_available_pkgs()
+
+ if self.inc_rpm_image_gen == "1":
+ self._create_incremental(pkgs_to_install)
+
+ 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]
+
+ self.pm.install(pkgs)
+
+ self.pm.install(pkgs_attempt, True)
+
+ self.pm.install_complementary()
+
+ self._setup_dbg_rootfs(['/etc/rpm', '/var/lib/rpm', '/var/lib/smart'])
+
+ execute_pre_post_process(self.d, rpm_post_process_cmds)
+
+ self._log_check()
+
+ if self.inc_rpm_image_gen == "1":
+ self.pm.backup_packaging_data()
+
+ self.pm.rpm_setup_smart_target_config()
+
+ @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_error(self):
+ r = re.compile('(unpacking of archive failed|Cannot find package|exit 1|ERR|Fail)')
+ log_path = self.d.expand("${T}/log.do_rootfs")
+ with open(log_path, 'r') as log:
+ found_error = 0
+ message = "\n"
+ for line in log.read().split('\n'):
+ if 'log_check' in line:
+ continue
+ # sh -x may emit code which isn't actually executed
+ if line.startswith('+'):
+ continue
+
+ m = r.search(line)
+ if m:
+ found_error = 1
+ bb.warn('log_check: There were error messages in the logfile')
+ bb.warn('log_check: Matched keyword: [%s]\n\n' % m.group())
+
+ if found_error >= 1 and found_error <= 5:
+ message += line + '\n'
+ found_error += 1
+
+ if found_error == 6:
+ bb.fatal(message)
+
+ def _log_check(self):
+ self._log_check_warn()
+ self._log_check_error()
+
+ def _handle_intercept_failure(self, registered_pkgs):
+ rpm_postinsts_dir = self.image_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.pm.save_rpmpostinst(pkg)
+
+ def _cleanup(self):
+ # during the execution of postprocess commands, rpm is called several
+ # times to get the files installed, dependencies, etc. This creates the
+ # __db.00* (Berkeley DB files that hold locks, rpm specific environment
+ # settings, etc.), that should not get into the final rootfs
+ self.pm.unlock_rpm_db()
+ if os.path.isdir(self.pm.install_dir_path + "/tmp") and not os.listdir(self.pm.install_dir_path + "/tmp"):
+ bb.utils.remove(self.pm.install_dir_path + "/tmp", True)
+ if os.path.isdir(self.pm.install_dir_path) and not os.listdir(self.pm.install_dir_path):
+ bb.utils.remove(self.pm.install_dir_path, True)
+
+class DpkgOpkgRootfs(Rootfs):
+ def __init__(self, d):
+ super(DpkgOpkgRootfs, self).__init__(d)
+
+ 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 = 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', True).strip():
+ bb.note("Building empty image")
+ else:
+ pkgs = self._get_pkgs_postinsts(status_file)
+ if pkgs:
+ root = "__packagegroup_postinst__"
+ pkgs[root] = 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):
+ super(DpkgRootfs, self).__init__(d)
+ self.log_check_regex = '^E:'
+ self.log_check_expected_errors_regexes = \
+ [
+ "^E: Unmet dependencies."
+ ]
+
+ bb.utils.remove(self.image_rootfs, True)
+ bb.utils.remove(self.d.getVar('MULTILIB_TEMP_ROOTFS', True), True)
+ self.manifest = DpkgManifest(d, manifest_dir)
+ self.pm = DpkgPM(d, d.getVar('IMAGE_ROOTFS', True),
+ d.getVar('PACKAGE_ARCHS', True),
+ d.getVar('DPKG_ARCH', True))
+
+
+ def _create(self):
+ pkgs_to_install = self.manifest.parse_initial_manifest()
+ deb_pre_process_cmds = self.d.getVar('DEB_PREPROCESS_COMMANDS', True)
+ deb_post_process_cmds = self.d.getVar('DEB_POSTPROCESS_COMMANDS', True)
+
+ 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)
+
+ self.pm.update()
+
+ 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])
+
+ self.pm.install_complementary()
+
+ 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)
+
+ @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 _handle_intercept_failure(self, registered_pkgs):
+ self.pm.mark_packages("unpacked", registered_pkgs.split())
+
+ 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):
+ super(OpkgRootfs, self).__init__(d)
+ self.log_check_regex = '(exit 1|Collected errors)'
+
+ self.manifest = OpkgManifest(d, manifest_dir)
+ self.opkg_conf = self.d.getVar("IPKGCONF_TARGET", True)
+ self.pkg_archs = self.d.getVar("ALL_MULTILIB_PACKAGE_ARCHS", True)
+
+ self.inc_opkg_image_gen = self.d.getVar('INC_IPK_IMAGE_GEN', True) 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), 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", True)
+ 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", True)
+ bb.utils.mkdirhier(ml_temp)
+
+ dirs = [self.image_rootfs]
+
+ for variant in self.d.getVar("MULTILIB_VARIANTS", True).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', True) or '').strip(),
+ (self.d.getVar('NO_RECOMMENDATIONS', True) or '').strip(),
+ (self.d.getVar('PACKAGE_EXCLUDE', True) 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', True)
+ opkg_post_process_cmds = self.d.getVar('OPKG_POSTPROCESS_COMMANDS', True)
+
+ # update PM index files, unless users provide their own feeds
+ if (self.d.getVar('BUILD_IMAGES_FROM_FEEDS', True) or "") != "1":
+ self.pm.write_index()
+
+ execute_pre_post_process(self.d, opkg_pre_process_cmds)
+
+ self.pm.update()
+
+ self.pm.handle_bad_recommendations()
+
+ if self.inc_opkg_image_gen == "1":
+ self._remove_extra_packages(pkgs_to_install)
+
+ 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])
+
+ self.pm.install_complementary()
+
+ self._setup_dbg_rootfs(['/var/lib/opkg'])
+
+ execute_pre_post_process(self.d, opkg_post_process_cmds)
+
+ if self.inc_opkg_image_gen == "1":
+ self.pm.backup_packaging_data()
+
+ @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', True).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 _handle_intercept_failure(self, registered_pkgs):
+ self.pm.mark_packages("unpacked", registered_pkgs.split())
+
+ 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', True)
+ cls = get_class_for_type(img_type)
+ return cls._depends_list()
+
+def create_rootfs(d, manifest_dir=None):
+ env_bkp = os.environ.copy()
+
+ img_type = d.getVar('IMAGE_PKGTYPE', True)
+ if img_type == "rpm":
+ RpmRootfs(d, manifest_dir).create()
+ elif img_type == "ipk":
+ OpkgRootfs(d, manifest_dir).create()
+ elif img_type == "deb":
+ DpkgRootfs(d, manifest_dir).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', True)
+
+ img_type = d.getVar('IMAGE_PKGTYPE', True)
+ if img_type == "rpm":
+ return RpmPkgsList(d, rootfs_dir).list_pkgs()
+ elif img_type == "ipk":
+ return OpkgPkgsList(d, rootfs_dir, d.getVar("IPKGCONF_TARGET", True)).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/import-layers/yocto-poky/meta/lib/oe/sdk.py b/import-layers/yocto-poky/meta/lib/oe/sdk.py
new file mode 100644
index 000000000..f15fbdb36
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oe/sdk.py
@@ -0,0 +1,367 @@
+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
+
+
+class Sdk(object):
+ __metaclass__ = ABCMeta
+
+ def __init__(self, d, manifest_dir):
+ self.d = d
+ self.sdk_output = self.d.getVar('SDK_OUTPUT', True)
+ self.sdk_native_path = self.d.getVar('SDKPATHNATIVE', True).strip('/')
+ self.target_path = self.d.getVar('SDKTARGETSYSROOT', True).strip('/')
+ self.sysconfdir = self.d.getVar('sysconfdir', True).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", True)
+ 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', True).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', True).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', True))
+
+ 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)
+
+class RpmSdk(Sdk):
+ def __init__(self, d, manifest_dir=None):
+ 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)
+
+ target_providename = ['/bin/sh',
+ '/bin/bash',
+ '/usr/bin/env',
+ '/usr/bin/perl',
+ 'pkgconfig'
+ ]
+
+ self.target_pm = RpmPM(d,
+ self.sdk_target_sysroot,
+ self.d.getVar('TARGET_VENDOR', True),
+ 'target',
+ target_providename
+ )
+
+ sdk_providename = ['/bin/sh',
+ '/bin/bash',
+ '/usr/bin/env',
+ '/usr/bin/perl',
+ 'pkgconfig',
+ 'libGL.so()(64bit)',
+ 'libGL.so'
+ ]
+
+ self.host_pm = RpmPM(d,
+ self.sdk_host_sysroot,
+ self.d.getVar('SDK_VENDOR', True),
+ 'host',
+ sdk_providename,
+ "SDK_PACKAGE_ARCHS",
+ "SDK_OS"
+ )
+
+ def _populate_sysroot(self, pm, manifest):
+ pkgs_to_install = manifest.parse_initial_manifest()
+
+ pm.create_configs()
+ pm.write_index()
+ pm.dump_all_available_pkgs()
+ 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):
+ 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', True))
+
+ execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND", True))
+
+ self.target_pm.remove_packaging_data()
+
+ bb.note("Installing NATIVESDK packages")
+ self._populate_sysroot(self.host_pm, self.host_manifest)
+
+ execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_HOST_COMMAND", True))
+
+ 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', True).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", "*")):
+ 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", True)
+ self.host_conf = self.d.getVar("IPKGCONF_SDK", True)
+
+ 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", True))
+
+ self.host_pm = OpkgPM(d, self.sdk_host_sysroot, self.host_conf,
+ self.d.getVar("SDK_PACKAGE_ARCHS", True))
+
+ def _populate_sysroot(self, pm, manifest):
+ pkgs_to_install = manifest.parse_initial_manifest()
+
+ if (self.d.getVar('BUILD_IMAGES_FROM_FEEDS', True) 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):
+ 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', True))
+
+ execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND", True))
+
+ self.target_pm.remove_packaging_data()
+
+ bb.note("Installing NATIVESDK packages")
+ self._populate_sysroot(self.host_pm, self.host_manifest)
+
+ execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_HOST_COMMAND", True))
+
+ 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)), 0644)
+
+ self.mkdirhier(host_sysconfdir)
+ shutil.copy(self.host_conf, host_sysconfdir)
+ os.chmod(os.path.join(host_sysconfdir,
+ os.path.basename(self.host_conf)), 0644)
+
+ native_opkg_state_dir = os.path.join(self.sdk_output, self.sdk_native_path,
+ self.d.getVar('localstatedir_nativesdk', True).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", True), "apt")
+ self.host_conf_dir = os.path.join(self.d.getVar("APTCONF_TARGET", True), "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", True),
+ self.d.getVar("DPKG_ARCH", True),
+ self.target_conf_dir)
+
+ self.host_pm = DpkgPM(d, self.sdk_host_sysroot,
+ self.d.getVar("SDK_PACKAGE_ARCHS", True),
+ self.d.getVar("DEB_SDK_ARCH", True),
+ self.host_conf_dir)
+
+ def _copy_apt_dir_to(self, dst_dir):
+ staging_etcdir_native = self.d.getVar("STAGING_ETCDIR_NATIVE", True)
+
+ 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):
+ 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', True))
+
+ execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND", True))
+
+ self._copy_apt_dir_to(os.path.join(self.sdk_target_sysroot, "etc", "apt"))
+
+ bb.note("Installing NATIVESDK packages")
+ self._populate_sysroot(self.host_pm, self.host_manifest)
+
+ execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_HOST_COMMAND", True))
+
+ self._copy_apt_dir_to(os.path.join(self.sdk_output, self.sdk_native_path,
+ "etc", "apt"))
+
+ 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', True)
+ target_path = d.getVar('SDKTARGETSYSROOT', True).strip('/')
+
+ rootfs_dir = [sdk_output, os.path.join(sdk_output, target_path)][target is True]
+
+ img_type = d.getVar('IMAGE_PKGTYPE', True)
+ 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, arch_var, os_var).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, True)).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', True)
+ 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)
+
+if __name__ == "__main__":
+ pass
diff --git a/import-layers/yocto-poky/meta/lib/oe/sstatesig.py b/import-layers/yocto-poky/meta/lib/oe/sstatesig.py
new file mode 100644
index 000000000..01dce660c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oe/sstatesig.py
@@ -0,0 +1,356 @@
+import bb.siggen
+
+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])
+
+ # Always include our own inter-task dependencies
+ if recipename == depname:
+ return True
+
+ # Quilt (patch application) changing isn't likely to affect anything
+ excludelist = ['quilt-native', 'subversion-native', 'git-native']
+ if depname in excludelist and recipename != depname:
+ return False
+
+ # Exclude well defined recipe->dependency
+ if "%s->%s" % (recipename, depname) in siggen.saferecipedeps:
+ 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", True) or "").split()
+ for t in types:
+ siggen_lockedsigs_var = "SIGGEN_LOCKEDSIGS_%s" % t
+ lockedsigs = (d.getVar(siggen_lockedsigs_var, True) 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", True) or "").split()
+ self.saferecipedeps = (data.getVar("SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS", True) 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", True) or "").split()
+ self.saferecipedeps = (data.getVar("SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS", True) or "").split()
+ self.lockedsigs = sstate_lockedsigs(data)
+ self.lockedhashes = {}
+ self.lockedpnmap = {}
+ self.lockedhashfn = {}
+ self.machine = data.getVar("MACHINE", True)
+ self.mismatch_msgs = []
+ self.unlockedrecipes = (data.getVar("SIGGEN_UNLOCKED_RECIPES", True) 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):
+ self.dump_lockedsigs()
+ 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=None, taskfilter=None):
+ if not sigfile:
+ sigfile = os.getcwd() + "/locked-sigs.inc"
+
+ bb.plain("Writing locked sigs to %s" % sigfile)
+ 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:
+ for t in types:
+ 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(types.keys())))
+
+ 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 self.lockedsigs[pn].itervalues():
+ 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", True)
+ if checklevel == 'warn':
+ warn_msgs += self.mismatch_msgs
+ elif checklevel == 'error':
+ error_msgs += self.mismatch_msgs
+
+ checklevel = d.getVar("SIGGEN_LOCKEDSIGS_SSTATE_EXISTS_CHECK", True)
+ 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 taskhashlist:
+ hashfiles = {}
+
+ 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'
+
+ filedates = {}
+
+ # 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', True)
+ 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
+
+ if not taskhashlist or (len(filedates) < 2 and not foundall):
+ # That didn't work, look in sstate-cache
+ hashes = taskhashlist or ['*']
+ 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', True)
+ 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', True), sstatename)
+
+ if hashval != '*':
+ sstatedir = "%s/%s" % (d.getVar('SSTATE_DIR', True), hashval[:2])
+ else:
+ sstatedir = d.getVar('SSTATE_DIR', True)
+
+ for root, dirs, files in os.walk(sstatedir):
+ for fn in files:
+ fullpath = os.path.join(root, fn)
+ if fnmatch.fnmatch(fullpath, filespec):
+ if taskhashlist:
+ hashfiles[hashval] = fullpath
+ else:
+ 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', True)
+ if extrainf:
+ d2.setVar("SSTATE_MANMACH", extrainf)
+ return (d2.expand("${SSTATE_MANFILEPREFIX}.%s" % task), d2)
diff --git a/import-layers/yocto-poky/meta/lib/oe/terminal.py b/import-layers/yocto-poky/meta/lib/oe/terminal.py
new file mode 100644
index 000000000..634daa903
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oe/terminal.py
@@ -0,0 +1,275 @@
+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):
+ pass
+
+
+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, basestring):
+ 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}" --disable-factory -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','')
+
+ # Check version
+ vernum = check_terminal_version("gnome-terminal")
+ if vernum and LooseVersion(vernum) >= '3.10':
+ logger.debug(1, 'Gnome-Terminal 3.10 or later does not support --disable-factory')
+ self.command = 'gnome-terminal -t "{title}" -x {command}'
+ XTerminal.__init__(self, sh_cmd, title, env, d)
+
+class Mate(XTerminal):
+ command = 'mate-terminal -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 --nofork --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}'
+ 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', True)
+ 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 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()
+
+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)
+
+ pipe = terminal(sh_cmd, title, env, d)
+ output = pipe.communicate()[0]
+ if pipe.returncode != 0:
+ raise ExecutionError(sh_cmd, pipe.returncode, output)
+
+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.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('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/import-layers/yocto-poky/meta/lib/oe/tests/__init__.py b/import-layers/yocto-poky/meta/lib/oe/tests/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oe/tests/__init__.py
diff --git a/import-layers/yocto-poky/meta/lib/oe/tests/test_license.py b/import-layers/yocto-poky/meta/lib/oe/tests/test_license.py
new file mode 100644
index 000000000..c38888618
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oe/tests/test_license.py
@@ -0,0 +1,68 @@
+import unittest
+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(unittest.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(unittest.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"]
diff --git a/import-layers/yocto-poky/meta/lib/oe/tests/test_path.py b/import-layers/yocto-poky/meta/lib/oe/tests/test_path.py
new file mode 100644
index 000000000..3d41ce157
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oe/tests/test_path.py
@@ -0,0 +1,89 @@
+import unittest
+import oe, oe.path
+import tempfile
+import os
+import errno
+import shutil
+
+class TestRealPath(unittest.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:
+ file(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.assertRaisesRegexp(OSError, r'\[Errno %u\]' % e[1],
+ self.__realpath, e[0], False, False)
diff --git a/import-layers/yocto-poky/meta/lib/oe/tests/test_types.py b/import-layers/yocto-poky/meta/lib/oe/tests/test_types.py
new file mode 100644
index 000000000..367cc30e4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oe/tests/test_types.py
@@ -0,0 +1,62 @@
+import unittest
+from oe.maketype import create, factory
+
+class TestTypes(unittest.TestCase):
+ def assertIsInstance(self, obj, cls):
+ return self.assertTrue(isinstance(obj, cls))
+
+ def assertIsNot(self, obj, other):
+ return self.assertFalse(obj is other)
+
+ def assertFactoryCreated(self, value, type, **flags):
+ cls = factory(type)
+ self.assertIsNot(cls, None)
+ self.assertIsInstance(create(value, type, **flags), cls)
+
+class TestBooleanType(TestTypes):
+ 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(TestTypes):
+ 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/import-layers/yocto-poky/meta/lib/oe/tests/test_utils.py b/import-layers/yocto-poky/meta/lib/oe/tests/test_utils.py
new file mode 100644
index 000000000..5d9ac52e7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oe/tests/test_utils.py
@@ -0,0 +1,51 @@
+import unittest
+from oe.utils import packages_filter_out_system
+
+class TestPackagesFilterOutSystem(unittest.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(unittest.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/import-layers/yocto-poky/meta/lib/oe/types.py b/import-layers/yocto-poky/meta/lib/oe/types.py
new file mode 100644
index 000000000..7f47c17d0
--- /dev/null
+++ b/import-layers/yocto-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, basestring):
+ 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, basestring):
+ 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/import-layers/yocto-poky/meta/lib/oe/utils.py b/import-layers/yocto-poky/meta/lib/oe/utils.py
new file mode 100644
index 000000000..30d30629f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oe/utils.py
@@ -0,0 +1,306 @@
+try:
+ # Python 2
+ import commands as cmdstatus
+except ImportError:
+ # Python 3
+ import subprocess as cmdstatus
+
+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,1) == checkvalue:
+ return truevalue
+ else:
+ return falsevalue
+
+def less_or_equal(variable, checkvalue, truevalue, falsevalue, d):
+ if float(d.getVar(variable,1)) <= 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,True), checkvalue)
+ if result <= 0:
+ return truevalue
+ else:
+ return falsevalue
+
+def both_contain(variable1, variable2, checkvalue, d):
+ val1 = d.getVar(variable1, True)
+ val2 = d.getVar(variable2, True)
+ val1 = set(val1.split())
+ val2 = set(val2.split())
+ if isinstance(checkvalue, basestring):
+ 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, True).split())
+ val2 = set(d.getVar(variable2, True).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", True)
+ if prefix and var.startswith(prefix):
+ var = var.replace(prefix, "")
+
+ return var
+
+def str_filter(f, str, d):
+ from re import match
+ return " ".join(filter(lambda x: match(f, x, 0), str.split()))
+
+def str_filter_out(f, str, d):
+ from re import match
+ return " ".join(filter(lambda x: not match(f, x, 0), str.split()))
+
+def param_bool(cfg, field, dflt = None):
+ """Lookup <field> in <cfg> map and convert it to a boolean; take
+ <dflt> when this <field> does not exist"""
+ value = cfg.get(field, dflt)
+ strvalue = str(value).lower()
+ if strvalue in ('yes', 'y', 'true', 't', '1'):
+ return True
+ elif strvalue in ('no', 'n', 'false', 'f', '0'):
+ return False
+ raise ValueError("invalid value for boolean parameter '%s': '%s'" % (field, value))
+
+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, True) or "").split()
+ backfill = (d.getVar(var+"_BACKFILL", True) or "").split()
+ considered = (d.getVar(var+"_BACKFILL_CONSIDERED", True) 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 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', True)
+ blacklist = map(lambda suffix: pn + suffix, ('', '-dbg', '-dev', '-doc', '-locale', '-staticdev'))
+ localepkg = pn + "-locale-"
+ pkgs = []
+
+ for pkg in d.getVar('PACKAGES', True).split():
+ if pkg not in blacklist and localepkg not in pkg:
+ pkgs.append(pkg)
+ return pkgs
+
+def getstatusoutput(cmd):
+ return cmdstatus.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)
+
+ nproc = min(multiprocessing.cpu_count(), len(commands))
+ pool = bb.utils.multiprocessingpool(nproc, init_worker)
+ imap = pool.imap(function, commands)
+
+ try:
+ res = list(imap)
+ pool.close()
+ pool.join()
+ results = []
+ for result in res:
+ if result is not None:
+ results.append(result)
+ return results
+
+ except KeyboardInterrupt:
+ pool.terminate()
+ pool.join()
+ raise
+
+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)
+
+#
+# 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, 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", True) + '\n')
+ f.write(d.getVar("libdir", True) + '\n')
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/__init__.py b/import-layers/yocto-poky/meta/lib/oeqa/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/__init__.py
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/controllers/__init__.py b/import-layers/yocto-poky/meta/lib/oeqa/controllers/__init__.py
new file mode 100644
index 000000000..8eda92763
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/lib/oeqa/controllers/masterimage.py b/import-layers/yocto-poky/meta/lib/oeqa/controllers/masterimage.py
new file mode 100644
index 000000000..522f9ebd7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/controllers/masterimage.py
@@ -0,0 +1,201 @@
+# 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", True) 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", True)
+ 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", True), d.getVar("IMAGE_LINK_NAME", True) + '.' + self.image_fstype)
+ self.kernel = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True), 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", True)
+ 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", True) or None
+ self.powercontrol_args = d.getVar("TEST_POWERCONTROL_EXTRA_ARGS", False) or ""
+
+ self.serialcontrol_cmd = d.getVar("TEST_SERIALCONTROL_CMD", True) 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, True)
+ 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("reboot")
+ 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, params=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.connection)
+
+
+class GummibootTarget(MasterImageHardwareTarget):
+
+ def __init__(self, d):
+ super(GummibootTarget, 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/import-layers/yocto-poky/meta/lib/oeqa/controllers/testtargetloader.py b/import-layers/yocto-poky/meta/lib/oeqa/controllers/testtargetloader.py
new file mode 100644
index 000000000..a1b7b1d92
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/controllers/testtargetloader.py
@@ -0,0 +1,70 @@
+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 isinstance(obj, (type, types.ClassType))):
+ bb.warn("Target {0} found, but not of type Class".format(target))
+ 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/import-layers/yocto-poky/meta/lib/oeqa/oetest.py b/import-layers/yocto-poky/meta/lib/oeqa/oetest.py
new file mode 100644
index 000000000..3ed5bb8c2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/oetest.py
@@ -0,0 +1,447 @@
+# 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
+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
+from oeqa.utils import avoid_paths_in_environ
+
+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):
+
+ longMessage = True
+
+ @classmethod
+ def hasPackage(self, pkg):
+ for item in oeTest.tc.pkgmanifest.split('\n'):
+ if re.match(pkg, item):
+ 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):
+ # 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):
+ 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
+
+ #TODO: use package_manager.py to install packages on any type of image
+ def install_packages(self, packagelist):
+ for package in packagelist:
+ (status, result) = self.target.run("smart install -y "+package)
+ if status != 0:
+ return status
+
+class oeSDKTest(oeTest):
+ def __init__(self, methodName='runTest'):
+ self.sdktestdir = oeSDKTest.tc.sdktestdir
+ super(oeSDKTest, self).__init__(methodName)
+
+ @classmethod
+ def hasHostPackage(self, pkg):
+
+ if re.search(pkg, oeTest.tc.hostpkgmanifest):
+ return True
+ return False
+
+ def _run(self, cmd):
+ return subprocess.check_output(". %s > /dev/null; %s;" % (self.tc.sdkenv, cmd), shell=True)
+
+class oeSDKExtTest(oeSDKTest):
+ 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.sdkenv, cmd), shell=True, env=env)
+
+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):
+ self.d = d
+
+ self.testsuites = self._get_test_suites()
+ self.testslist = self._get_tests_list(d.getVar("BBPATH", True).split(':'))
+ self.testsrequired = self._get_test_suites_required()
+
+ self.filesdir = os.path.join(os.path.dirname(os.path.abspath(
+ oeqa.runtime.__file__)), "files")
+ self.imagefeatures = d.getVar("IMAGE_FEATURES", True).split()
+ self.distrofeatures = d.getVar("DISTRO_FEATURES", True).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):
+ 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, 'lib', 'oeqa', type, testname + '.py')):
+ testslist.append("oeqa." + type + "." + testname)
+ found = True
+ break
+ elif os.path.exists(os.path.join(p, 'lib', 'oeqa', 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):
+ if not os.path.exists(os.path.join(path, '__init__.py')):
+ bb.fatal('Tests 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.' + 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 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))
+
+ def getTests(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 getTests(t1):
+ yield t2
+
+ # 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 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 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
+ suites.sort(cmp=lambda a,b: cmp((a.depth, a.index), (b.depth, b.index)))
+
+ 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 ImageTestContext(TestContext):
+ def __init__(self, d, target, host_dumper):
+ super(ImageTestContext, self).__init__(d)
+
+ self.tagexp = d.getVar("TEST_SUITES_TAGS", True)
+
+ self.target = target
+ self.host_dumper = host_dumper
+
+ manifest = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True),
+ d.getVar("IMAGE_LINK_NAME", True) + ".manifest")
+ nomanifest = d.getVar("IMAGE_NO_MANIFEST", True)
+ if nomanifest is None or nomanifest != "1":
+ try:
+ with open(manifest) as f:
+ self.pkgmanifest = f.read()
+ except IOError as e:
+ bb.fatal("No package manifest file found. Did you build the image?\n%s" % e)
+ else:
+ self.pkgmanifest = ""
+
+ 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 _get_test_namespace(self):
+ return "runtime"
+
+ def _get_test_suites(self):
+ testsuites = []
+
+ manifests = (self.d.getVar("TEST_SUITES_MANIFEST", True) or '').split()
+ if manifests:
+ for manifest in manifests:
+ testsuites.extend(self._read_testlist(manifest,
+ self.d.getVar("TOPDIR", True)).split())
+
+ else:
+ testsuites = self.d.getVar("TEST_SUITES", True).split()
+
+ return testsuites
+
+ def _get_test_suites_required(self):
+ return [t for t in self.d.getVar("TEST_SUITES", True).split() if t != "auto"]
+
+ def loadTests(self):
+ super(ImageTestContext, self).loadTests()
+ setattr(oeRuntimeTest, "pscmd", "ps -ef" if oeTest.hasPackage("procps") else "ps")
+
+class SDKTestContext(TestContext):
+ def __init__(self, d, sdktestdir, sdkenv, tcname, *args):
+ super(SDKTestContext, self).__init__(d)
+
+ self.sdktestdir = sdktestdir
+ self.sdkenv = sdkenv
+ self.tcname = tcname
+
+ if not hasattr(self, 'target_manifest'):
+ self.target_manifest = d.getVar("SDK_TARGET_MANIFEST", True)
+ try:
+ with open(self.target_manifest) as f:
+ self.pkgmanifest = f.read()
+ except IOError as e:
+ bb.fatal("No package manifest file found. Did you build the sdk image?\n%s" % e)
+
+ if not hasattr(self, 'host_manifest'):
+ self.host_manifest = d.getVar("SDK_HOST_MANIFEST", True)
+ try:
+ with open(self.host_manifest) as f:
+ self.hostpkgmanifest = f.read()
+ except IOError as e:
+ bb.fatal("No host package manifest file found. Did you build the sdk image?\n%s" % e)
+
+ def _get_test_namespace(self):
+ return "sdk"
+
+ def _get_test_suites(self):
+ return (self.d.getVar("TEST_SUITES_SDK", True) or "auto").split()
+
+ def _get_test_suites_required(self):
+ return [t for t in (self.d.getVar("TEST_SUITES_SDK", True) or \
+ "auto").split() if t != "auto"]
+
+class SDKExtTestContext(SDKTestContext):
+ def __init__(self, d, sdktestdir, sdkenv, tcname, *args):
+ self.target_manifest = d.getVar("SDK_EXT_TARGET_MANIFEST", True)
+ self.host_manifest = d.getVar("SDK_EXT_HOST_MANIFEST", True)
+ if args:
+ self.cm = args[0] # Compatibility mode for run SDK tests
+ else:
+ self.cm = False
+
+ super(SDKExtTestContext, self).__init__(d, sdktestdir, sdkenv, tcname)
+
+ self.sdkextfilesdir = os.path.join(os.path.dirname(os.path.abspath(
+ oeqa.sdkext.__file__)), "files")
+
+ def _get_test_namespace(self):
+ if self.cm:
+ return "sdk"
+ else:
+ return "sdkext"
+
+ def _get_test_suites(self):
+ return (self.d.getVar("TEST_SUITES_SDK_EXT", True) or "auto").split()
+
+ def _get_test_suites_required(self):
+ return [t for t in (self.d.getVar("TEST_SUITES_SDK_EXT", True) or \
+ "auto").split() if t != "auto"]
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runexported.py b/import-layers/yocto-poky/meta/lib/oeqa/runexported.py
new file mode 100755
index 000000000..cc89e13c0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runexported.py
@@ -0,0 +1,145 @@
+#!/usr/bin/env python
+
+
+# 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 TestContext
+from oeqa.utils.sshcontrol import SSHControl
+from oeqa.utils.dump import get_host_dumper
+
+# 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", True)
+ self.pn = d.getVar("PN", True)
+
+ 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, "")
+
+class ExportTestContext(TestContext):
+ def __init__(self, d):
+ self.d = d
+
+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("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"])
+
+
+ target = FakeTarget(d)
+ for key in loaded["target"].keys():
+ setattr(target, key, loaded["target"][key])
+
+ host_dumper = get_host_dumper(d)
+ host_dumper.parent_dir = loaded["host_dumper"]["parent_dir"]
+ host_dumper.cmds = loaded["host_dumper"]["cmds"]
+
+ target.exportStart()
+ tc = ExportTestContext(d)
+
+ setattr(tc, "d", d)
+ setattr(tc, "target", target)
+ setattr(tc, "host_dumper", host_dumper)
+ for key in loaded.keys():
+ if key != "d" and key != "target" and key != "host_dumper":
+ setattr(tc, key, loaded[key])
+
+ tc.loadTests()
+ tc.runTests()
+
+ return 0
+
+if __name__ == "__main__":
+ try:
+ ret = main()
+ except Exception:
+ ret = 1
+ import traceback
+ traceback.print_exc()
+ sys.exit(ret)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/__init__.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/__init__.py
new file mode 100644
index 000000000..4cf3fa76b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/__init__.py
@@ -0,0 +1,3 @@
+# Enable other layers to have tests in the same named directory
+from pkgutil import extend_path
+__path__ = extend_path(__path__, __name__)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/_ptest.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/_ptest.py
new file mode 100644
index 000000000..0621028b8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/_ptest.py
@@ -0,0 +1,125 @@
+import unittest, os, shutil
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+from oeqa.utils.logparser import *
+from oeqa.utils.httpserver import HTTPService
+import bb
+import glob
+from oe.package_manager import RpmPkgsList
+import subprocess
+
+def setUpModule():
+ if not oeRuntimeTest.hasFeature("package-management"):
+ skipModule("Image doesn't have package management feature")
+ if not oeRuntimeTest.hasPackage("smart"):
+ skipModule("Image doesn't have smart installed")
+ if "package_rpm" != oeRuntimeTest.tc.d.getVar("PACKAGE_CLASSES", True).split()[0]:
+ skipModule("Rpm is not the primary package manager")
+
+class PtestRunnerTest(oeRuntimeTest):
+
+ # a ptest log parser
+ def parse_ptest(self, logfile):
+ parser = Lparser(test_0_pass_regex="^PASS:(.+)", test_0_fail_regex="^FAIL:(.+)", section_0_begin_regex="^BEGIN: .*/(.+)/ptest", section_0_end_regex="^END: .*/(.+)/ptest")
+ parser.init()
+ result = Result()
+
+ with open(logfile) 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
+
+ result.sort_tests()
+ return result
+
+ @classmethod
+ def setUpClass(self):
+ #note the existing channels that are on the board before creating new ones
+# self.existingchannels = set()
+# (status, result) = oeRuntimeTest.tc.target.run('smart channel --show | grep "\["', 0)
+# for x in result.split("\n"):
+# self.existingchannels.add(x)
+ self.repo_server = HTTPService(oeRuntimeTest.tc.d.getVar('DEPLOY_DIR', True), oeRuntimeTest.tc.target.server_ip)
+ self.repo_server.start()
+
+ @classmethod
+ def tearDownClass(self):
+ self.repo_server.stop()
+ #remove created channels to be able to repeat the tests on same image
+# (status, result) = oeRuntimeTest.tc.target.run('smart channel --show | grep "\["', 0)
+# for x in result.split("\n"):
+# if x not in self.existingchannels:
+# oeRuntimeTest.tc.target.run('smart channel --remove '+x[1:-1]+' -y', 0)
+
+ def add_smart_channel(self):
+ image_pkgtype = self.tc.d.getVar('IMAGE_PKGTYPE', True)
+ deploy_url = 'http://%s:%s/%s' %(self.target.server_ip, self.repo_server.port, image_pkgtype)
+ pkgarchs = self.tc.d.getVar('PACKAGE_ARCHS', True).replace("-","_").split()
+ for arch in os.listdir('%s/%s' % (self.repo_server.root_dir, image_pkgtype)):
+ if arch in pkgarchs:
+ self.target.run('smart channel -y --add {a} type=rpm-md baseurl={u}/{a}'.format(a=arch, u=deploy_url), 0)
+ self.target.run('smart update', 0)
+
+ def install_complementary(self, globs=None):
+ installed_pkgs_file = os.path.join(oeRuntimeTest.tc.d.getVar('WORKDIR', True),
+ "installed_pkgs.txt")
+ self.pkgs_list = RpmPkgsList(oeRuntimeTest.tc.d, oeRuntimeTest.tc.d.getVar('IMAGE_ROOTFS', True), oeRuntimeTest.tc.d.getVar('arch_var', True), oeRuntimeTest.tc.d.getVar('os_var', True))
+ with open(installed_pkgs_file, "w+") as installed_pkgs:
+ installed_pkgs.write(self.pkgs_list.list("arch"))
+
+ cmd = [bb.utils.which(os.getenv('PATH'), "oe-pkgdata-util"),
+ "-p", oeRuntimeTest.tc.d.getVar('PKGDATA_DIR', True), "glob", installed_pkgs_file,
+ globs]
+ try:
+ bb.note("Installing complementary packages ...")
+ complementary_pkgs = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
+ 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))
+
+ return complementary_pkgs.split()
+
+ def setUpLocal(self):
+ self.ptest_log = os.path.join(oeRuntimeTest.tc.d.getVar("TEST_LOG_DIR",True), "ptest-%s.log" % oeRuntimeTest.tc.d.getVar('DATETIME', True))
+
+ @skipUnlessPassed('test_ssh')
+ def test_ptestrunner(self):
+ self.add_smart_channel()
+ (runnerstatus, result) = self.target.run('which ptest-runner', 0)
+ cond = oeRuntimeTest.hasPackage("ptest-runner") and oeRuntimeTest.hasFeature("ptest") and oeRuntimeTest.hasPackage("-ptest") and (runnerstatus != 0)
+ if cond:
+ self.install_packages(self.install_complementary("*-ptest"))
+ self.install_packages(['ptest-runner'])
+
+ (runnerstatus, result) = self.target.run('/usr/bin/ptest-runner > /tmp/ptest.log 2>&1', 0)
+ #exit code is !=0 even if ptest-runner executes because some ptest tests fail.
+ self.assertTrue(runnerstatus != 127, msg="Cannot execute ptest-runner!")
+ self.target.copy_from('/tmp/ptest.log', self.ptest_log)
+ shutil.copyfile(self.ptest_log, "ptest.log")
+
+ result = self.parse_ptest("ptest.log")
+ log_results_to_location = "./results"
+ if os.path.exists(log_results_to_location):
+ shutil.rmtree(log_results_to_location)
+ os.makedirs(log_results_to_location)
+
+ result.log_as_files(log_results_to_location, test_status = ['pass','fail'])
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/_qemutiny.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/_qemutiny.py
new file mode 100644
index 000000000..a3c29f357
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/_qemutiny.py
@@ -0,0 +1,9 @@
+import unittest
+from oeqa.oetest import oeRuntimeTest
+from oeqa.utils.qemutinyrunner import *
+
+class QemuTinyTest(oeRuntimeTest):
+
+ def test_boot_tiny(self):
+ (status, output) = self.target.run_serial('uname -a')
+ self.assertTrue("yocto-tiny" in output, msg="Cannot detect poky tiny boot!") \ No newline at end of file
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/buildcvs.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/buildcvs.py
new file mode 100644
index 000000000..fe6cbfbcd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/buildcvs.py
@@ -0,0 +1,31 @@
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+from oeqa.utils.targetbuild import TargetBuildProject
+
+def setUpModule():
+ if not oeRuntimeTest.hasFeature("tools-sdk"):
+ skipModule("Image doesn't have tools-sdk in IMAGE_FEATURES")
+
+class BuildCvsTest(oeRuntimeTest):
+
+ @classmethod
+ def setUpClass(self):
+ self.project = TargetBuildProject(oeRuntimeTest.tc.target, oeRuntimeTest.tc.d,
+ "http://ftp.gnu.org/non-gnu/cvs/source/feature/1.12.13/cvs-1.12.13.tar.bz2")
+ self.project.download_archive()
+
+ @testcase(205)
+ @skipUnlessPassed("test_ssh")
+ def test_cvs(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/import-layers/yocto-poky/meta/lib/oeqa/runtime/buildiptables.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/buildiptables.py
new file mode 100644
index 000000000..09e252df8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/buildiptables.py
@@ -0,0 +1,31 @@
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+from oeqa.utils.targetbuild import TargetBuildProject
+
+def setUpModule():
+ if not oeRuntimeTest.hasFeature("tools-sdk"):
+ skipModule("Image doesn't have tools-sdk in IMAGE_FEATURES")
+
+class BuildIptablesTest(oeRuntimeTest):
+
+ @classmethod
+ def setUpClass(self):
+ self.project = TargetBuildProject(oeRuntimeTest.tc.target, oeRuntimeTest.tc.d,
+ "http://netfilter.org/projects/iptables/files/iptables-1.4.13.tar.bz2")
+ self.project.download_archive()
+
+ @testcase(206)
+ @skipUnlessPassed("test_ssh")
+ def test_iptables(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/import-layers/yocto-poky/meta/lib/oeqa/runtime/buildsudoku.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/buildsudoku.py
new file mode 100644
index 000000000..802b06001
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/buildsudoku.py
@@ -0,0 +1,28 @@
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+from oeqa.utils.targetbuild import TargetBuildProject
+
+def setUpModule():
+ if not oeRuntimeTest.hasFeature("tools-sdk"):
+ skipModule("Image doesn't have tools-sdk in IMAGE_FEATURES")
+
+class SudokuTest(oeRuntimeTest):
+
+ @classmethod
+ def setUpClass(self):
+ self.project = TargetBuildProject(oeRuntimeTest.tc.target, oeRuntimeTest.tc.d,
+ "http://downloads.sourceforge.net/project/sudoku-savant/sudoku-savant/sudoku-savant-1.3/sudoku-savant-1.3.tar.bz2")
+ self.project.download_archive()
+
+ @testcase(207)
+ @skipUnlessPassed("test_ssh")
+ def test_sudoku(self):
+ self.assertEqual(self.project.run_configure(), 0,
+ msg="Running configure failed")
+
+ self.assertEqual(self.project.run_make(), 0,
+ msg="Running make failed")
+
+ @classmethod
+ def tearDownClass(self):
+ self.project.clean()
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/connman.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/connman.py
new file mode 100644
index 000000000..bd9dba3bd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/connman.py
@@ -0,0 +1,31 @@
+import unittest
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+ if not oeRuntimeTest.hasPackage("connman"):
+ skipModule("No connman package in image")
+
+
+class ConnmanTest(oeRuntimeTest):
+
+ def service_status(self, service):
+ if oeRuntimeTest.hasFeature("systemd"):
+ (status, output) = self.target.run('systemctl status -l %s' % service)
+ return output
+ else:
+ return "Unable to get status or logs for %s" % service
+
+ @testcase(961)
+ @skipUnlessPassed('test_ssh')
+ def test_connmand_help(self):
+ (status, output) = self.target.run('/usr/sbin/connmand --help')
+ self.assertEqual(status, 0, msg="status and output: %s and %s" % (status,output))
+
+ @testcase(221)
+ @skipUnlessPassed('test_connmand_help')
+ def test_connmand_running(self):
+ (status, output) = self.target.run(oeRuntimeTest.pscmd + ' | grep [c]onnmand')
+ if status != 0:
+ print self.service_status("connman")
+ self.fail("No connmand process running")
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/date.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/date.py
new file mode 100644
index 000000000..447987e07
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/date.py
@@ -0,0 +1,31 @@
+from oeqa.oetest import oeRuntimeTest
+from oeqa.utils.decorators import *
+import re
+
+class DateTest(oeRuntimeTest):
+
+ def setUpLocal(self):
+ if oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", True) == "systemd":
+ self.target.run('systemctl stop systemd-timesyncd')
+
+ def tearDownLocal(self):
+ if oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", True) == "systemd":
+ self.target.run('systemctl start systemd-timesyncd')
+
+ @testcase(211)
+ @skipUnlessPassed("test_ssh")
+ def test_date(self):
+ (status, output) = self.target.run('date +"%Y-%m-%d %T"')
+ self.assertEqual(status, 0, msg="Failed to get initial date, output: %s" % output)
+ 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)
+ self.assertTrue(p, msg="The date was not set correctly, output: %s" % output)
+
+ (status, output) = self.target.run('date -s "%s"' % oldDate)
+ self.assertEqual(status, 0, msg="Failed to reset date, output: %s" % output)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/df.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/df.py
new file mode 100644
index 000000000..09569d5ff
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/df.py
@@ -0,0 +1,12 @@
+import unittest
+from oeqa.oetest import oeRuntimeTest
+from oeqa.utils.decorators import *
+
+
+class DfTest(oeRuntimeTest):
+
+ @testcase(234)
+ @skipUnlessPassed("test_ssh")
+ def test_df(self):
+ (status,output) = self.target.run("df / | sed -n '2p' | awk '{print $4}'")
+ self.assertTrue(int(output)>5120, msg="Not enough space on image. Current size is %s" % output)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/files/hellomod.c b/import-layers/yocto-poky/meta/lib/oeqa/runtime/files/hellomod.c
new file mode 100644
index 000000000..a383397e9
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/lib/oeqa/runtime/files/hellomod_makefile b/import-layers/yocto-poky/meta/lib/oeqa/runtime/files/hellomod_makefile
new file mode 100644
index 000000000..b92d5c8fe
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/lib/oeqa/runtime/files/test.c b/import-layers/yocto-poky/meta/lib/oeqa/runtime/files/test.c
new file mode 100644
index 000000000..2d8389c92
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/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/import-layers/yocto-poky/meta/lib/oeqa/runtime/files/test.cpp b/import-layers/yocto-poky/meta/lib/oeqa/runtime/files/test.cpp
new file mode 100644
index 000000000..9e1a76473
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/files/test.cpp
@@ -0,0 +1,3 @@
+#include <limits>
+
+int main() {} \ No newline at end of file
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/files/test.pl b/import-layers/yocto-poky/meta/lib/oeqa/runtime/files/test.pl
new file mode 100644
index 000000000..689c8f163
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/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/import-layers/yocto-poky/meta/lib/oeqa/runtime/files/test.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/files/test.py
new file mode 100644
index 000000000..f3a2273c5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/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/import-layers/yocto-poky/meta/lib/oeqa/runtime/files/testmakefile b/import-layers/yocto-poky/meta/lib/oeqa/runtime/files/testmakefile
new file mode 100644
index 000000000..ca1844e93
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/lib/oeqa/runtime/files/testsdkmakefile b/import-layers/yocto-poky/meta/lib/oeqa/runtime/files/testsdkmakefile
new file mode 100644
index 000000000..fb05f822f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/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/import-layers/yocto-poky/meta/lib/oeqa/runtime/gcc.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/gcc.py
new file mode 100644
index 000000000..d90cd1799
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/gcc.py
@@ -0,0 +1,47 @@
+import unittest
+import os
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+ if not oeRuntimeTest.hasFeature("tools-sdk"):
+ skipModule("Image doesn't have tools-sdk in IMAGE_FEATURES")
+
+
+class GccCompileTest(oeRuntimeTest):
+
+ @classmethod
+ def setUpClass(self):
+ oeRuntimeTest.tc.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "test.c"), "/tmp/test.c")
+ oeRuntimeTest.tc.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "testmakefile"), "/tmp/testmakefile")
+ oeRuntimeTest.tc.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "test.cpp"), "/tmp/test.cpp")
+
+ @testcase(203)
+ def test_gcc_compile(self):
+ (status, output) = self.target.run('gcc /tmp/test.c -o /tmp/test -lm')
+ self.assertEqual(status, 0, msg="gcc compile failed, output: %s" % output)
+ (status, output) = self.target.run('/tmp/test')
+ self.assertEqual(status, 0, msg="running compiled file failed, output %s" % output)
+
+ @testcase(200)
+ def test_gpp_compile(self):
+ (status, output) = self.target.run('g++ /tmp/test.c -o /tmp/test -lm')
+ self.assertEqual(status, 0, msg="g++ compile failed, output: %s" % output)
+ (status, output) = self.target.run('/tmp/test')
+ self.assertEqual(status, 0, msg="running compiled file failed, output %s" % output)
+
+ @testcase(1142)
+ def test_gpp2_compile(self):
+ (status, output) = self.target.run('g++ /tmp/test.cpp -o /tmp/test -lm')
+ self.assertEqual(status, 0, msg="g++ compile failed, output: %s" % output)
+ (status, output) = self.target.run('/tmp/test')
+ self.assertEqual(status, 0, msg="running compiled file failed, output %s" % output)
+
+ @testcase(204)
+ def test_make(self):
+ (status, output) = self.target.run('cd /tmp; make -f testmakefile')
+ self.assertEqual(status, 0, msg="running make failed, output %s" % output)
+
+ @classmethod
+ def tearDownClass(self):
+ oeRuntimeTest.tc.target.run("rm /tmp/test.c /tmp/test.o /tmp/test /tmp/testmakefile")
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/kernelmodule.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/kernelmodule.py
new file mode 100644
index 000000000..38ca18454
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/kernelmodule.py
@@ -0,0 +1,34 @@
+import unittest
+import os
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+ if not oeRuntimeTest.hasFeature("tools-sdk"):
+ skipModule("Image doesn't have tools-sdk in IMAGE_FEATURES")
+
+
+class KernelModuleTest(oeRuntimeTest):
+
+ def setUpLocal(self):
+ self.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "hellomod.c"), "/tmp/hellomod.c")
+ self.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "hellomod_makefile"), "/tmp/Makefile")
+
+ @testcase('316')
+ @skipUnlessPassed('test_ssh')
+ @skipUnlessPassed('test_gcc_compile')
+ def test_kernel_module(self):
+ cmds = [
+ 'cd /usr/src/kernel && make scripts',
+ '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]))
+
+ def tearDownLocal(self):
+ self.target.run('rm -f /tmp/Makefile /tmp/hellomod.c')
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/ldd.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/ldd.py
new file mode 100644
index 000000000..47b3885df
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/ldd.py
@@ -0,0 +1,21 @@
+import unittest
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+ if not oeRuntimeTest.hasFeature("tools-sdk"):
+ skipModule("Image doesn't have tools-sdk in IMAGE_FEATURES")
+
+class LddTest(oeRuntimeTest):
+
+ @testcase(962)
+ @skipUnlessPassed('test_ssh')
+ def test_ldd_exists(self):
+ (status, output) = self.target.run('which ldd')
+ self.assertEqual(status, 0, msg = "ldd does not exist in PATH: which ldd: %s" % output)
+
+ @testcase(239)
+ @skipUnlessPassed('test_ldd_exists')
+ def test_ldd_rtldlist_check(self):
+ (status, output) = self.target.run('for i in $(which ldd | xargs cat | grep "^RTLDLIST"|cut -d\'=\' -f2|tr -d \'"\'); do test -f $i && echo $i && break; done')
+ self.assertEqual(status, 0, msg = "ldd path not correct or RTLDLIST files don't exist. ")
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/logrotate.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/logrotate.py
new file mode 100644
index 000000000..de300bf55
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/logrotate.py
@@ -0,0 +1,28 @@
+# 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
+
+import unittest
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+ if not oeRuntimeTest.hasPackage("logrotate"):
+ skipModule("No logrotate package in image")
+
+
+class LogrotateTest(oeRuntimeTest):
+
+ @skipUnlessPassed("test_ssh")
+ def test_1_logrotate_setup(self):
+ (status, output) = self.target.run('mkdir $HOME/logrotate_dir')
+ self.assertEqual(status, 0, msg = "Could not create logrotate_dir. Output: %s" % output)
+ (status, output) = self.target.run("sed -i \"s#wtmp {#wtmp {\\n olddir $HOME/logrotate_dir#\" /etc/logrotate.conf")
+ self.assertEqual(status, 0, msg = "Could not write to logrotate.conf file. Status and output: %s and %s)" % (status, output))
+
+ @testcase(289)
+ @skipUnlessPassed("test_1_logrotate_setup")
+ def test_2_logrotate(self):
+ (status, output) = self.target.run('logrotate -f /etc/logrotate.conf')
+ self.assertEqual(status, 0, msg = "logrotate service could not be reloaded. Status and output: %s and %s" % (status, output))
+ output = self.target.run('ls -la $HOME/logrotate_dir/ | wc -l')[1]
+ self.assertTrue(int(output)>=3, msg = "new logfile could not be created. List of files within log directory: %s" %(self.target.run('ls -la $HOME/logrotate_dir')[1]))
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/multilib.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/multilib.py
new file mode 100644
index 000000000..593d38502
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/multilib.py
@@ -0,0 +1,42 @@
+import unittest
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+ multilibs = oeRuntimeTest.tc.d.getVar("MULTILIBS", True) or ""
+ if "multilib:lib32" not in multilibs:
+ skipModule("this isn't a multilib:lib32 image")
+
+
+class MultilibTest(oeRuntimeTest):
+
+ 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)
+
+ self.assertEqual(theclass, arch, msg="%s isn't %s (is %s)" % (binary, arch, theclass))
+
+ @skipUnlessPassed('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")
+
+ @testcase('279')
+ @skipUnlessPassed('test_check_multilib_libc')
+ def test_file_connman(self):
+ self.assertTrue(oeRuntimeTest.hasPackage('lib32-connman'), msg="This test assumes lib32-connman is installed")
+
+ self.archtest("/usr/sbin/connmand", "ELF32")
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/pam.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/pam.py
new file mode 100644
index 000000000..c8205c9ab
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/pam.py
@@ -0,0 +1,25 @@
+# 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
+
+import unittest
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+ if not oeRuntimeTest.hasFeature("pam"):
+ skipModule("target doesn't have 'pam' in DISTRO_FEATURES")
+
+
+class PamBasicTest(oeRuntimeTest):
+
+ @testcase(287)
+ @skipUnlessPassed('test_ssh')
+ def test_pam(self):
+ (status, output) = self.target.run('login --help')
+ self.assertEqual(status, 1, msg = "login command does not work as expected. Status and output:%s and %s" %(status, output))
+ (status, output) = self.target.run('passwd --help')
+ self.assertEqual(status, 0, msg = "passwd command does not work as expected. Status and output:%s and %s" %(status, output))
+ (status, output) = self.target.run('su --help')
+ self.assertEqual(status, 0, msg = "su command does not work as expected. Status and output:%s and %s" %(status, output))
+ (status, output) = self.target.run('useradd --help')
+ self.assertEqual(status, 0, msg = "useradd command does not work as expected. Status and output:%s and %s" %(status, output))
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/parselogs.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/parselogs.py
new file mode 100644
index 000000000..dec9ebe87
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/parselogs.py
@@ -0,0 +1,277 @@
+import os
+import unittest
+import subprocess
+from oeqa.oetest import oeRuntimeTest
+from oeqa.utils.decorators import *
+
+#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",
+ ]
+
+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',
+] + 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 ",
+] + common_errors
+
+ignore_errors = {
+ 'default' : common_errors,
+ 'qemux86' : [
+ 'Failed to access perfctr msr (MSR',
+ ] + 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)',
+ ] + common_errors,
+ 'qemumips64' : [
+ 'pci 0000:00:00.0: [Firmware Bug]: reg 0x..: invalid BAR (can\'t size)',
+ ] + 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"',
+ ] + 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"'
+ ] + common_errors,
+ 'qemuarm64' : [
+ 'Fatal server error:',
+ '(EE) Server terminated with error (1). Closing log file.',
+ 'dmi: Firmware registration failed.',
+ ] + 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',
+ ] + x86_common,
+ 'intel-corei7-64' : x86_common,
+ 'crownbay' : x86_common,
+ 'genericx86' : x86_common,
+ 'genericx86-64' : 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(oeRuntimeTest):
+
+ @classmethod
+ def setUpClass(self):
+ self.errors = errors
+
+ # When systemd is enabled we need to notice errors on
+ # circular dependencies in units.
+ if self.hasFeature("systemd"):
+ self.errors.extend([
+ 'Found ordering cycle on',
+ 'Breaking ordering cycle by deleting job',
+ 'deleted to break ordering cycle',
+ 'Ordering cycle found, skipping',
+ ])
+
+ self.ignore_errors = ignore_errors
+ self.log_locations = log_locations
+ self.msg = ""
+ (is_lsb, location) = oeRuntimeTest.tc.target.run("which LSB_Test.sh")
+ if is_lsb == 0:
+ for machine in self.ignore_errors:
+ self.ignore_errors[machine] = self.ignore_errors[machine] + video_related
+
+ def getMachine(self):
+ return oeRuntimeTest.tc.d.getVar("MACHINE", True)
+
+ #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 = ""
+ (status, cpu_name) = self.target.run("cat /proc/cpuinfo | grep \"model name\" | head -n1 | awk 'BEGIN{FS=\":\"}{print $2}'")
+ (status, cpu_physical_cores) = self.target.run("cat /proc/cpuinfo | grep \"cpu cores\" | head -n1 | awk {'print $4'}")
+ (status, cpu_logical_cores) = self.target.run("cat /proc/cpuinfo | grep \"processor\" | wc -l")
+ (status, 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, output) = self.target.run("test -f "+str(location))
+ if (status == 0):
+ logs.append(str(location))
+ else:
+ (status, output) = self.target.run("test -d "+str(location))
+ if (status == 0):
+ (status, output) = self.target.run("find "+str(location)+"/*.log -maxdepth 1 -type f")
+ 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):
+ target_logs = 'target_logs'
+ if not os.path.exists(target_logs):
+ os.makedirs(target_logs)
+ for f in log_list:
+ self.target.copy_from(f, target_logs)
+
+ #get the local list of logs
+ def get_local_log_list(self, log_locations):
+ self.transfer_logs(self.getLogList(log_locations))
+ logs = [ os.path.join('target_logs',f) for f in os.listdir('target_logs') if os.path.isfile(os.path.join('target_logs',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 = subprocess.check_output(thegrep, shell=True)
+ except:
+ pass
+ if (result is not None):
+ results[log.replace('target_logs/','')] = {}
+ rez = result.splitlines()
+ for xrez in rez:
+ try:
+ grep_output = subprocess.check_output(['grep', '-F', xrez, '-B', str(lines_before), '-A', str(lines_after), log])
+ 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")
+
+ @testcase(1059)
+ @skipUnlessPassed('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/import-layers/yocto-poky/meta/lib/oeqa/runtime/perl.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/perl.py
new file mode 100644
index 000000000..e044d0a5f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/perl.py
@@ -0,0 +1,30 @@
+import unittest
+import os
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+ if not oeRuntimeTest.hasPackage("perl"):
+ skipModule("No perl package in the image")
+
+
+class PerlTest(oeRuntimeTest):
+
+ @classmethod
+ def setUpClass(self):
+ oeRuntimeTest.tc.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "test.pl"), "/tmp/test.pl")
+
+ @testcase(1141)
+ def test_perl_exists(self):
+ (status, output) = self.target.run('which perl')
+ self.assertEqual(status, 0, msg="Perl binary not in PATH or not on target.")
+
+ @testcase(208)
+ def test_perl_works(self):
+ (status, output) = self.target.run('perl /tmp/test.pl')
+ self.assertEqual(status, 0, msg="Exit status was not 0. Output: %s" % output)
+ self.assertEqual(output, "the value of a is 0.01", msg="Incorrect output: %s" % output)
+
+ @classmethod
+ def tearDownClass(self):
+ oeRuntimeTest.tc.target.run("rm /tmp/test.pl")
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/ping.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/ping.py
new file mode 100644
index 000000000..80c460161
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/ping.py
@@ -0,0 +1,22 @@
+import subprocess
+import unittest
+import sys
+import time
+from oeqa.oetest import oeRuntimeTest
+from oeqa.utils.decorators import *
+
+class PingTest(oeRuntimeTest):
+
+ @testcase(964)
+ def test_ping(self):
+ output = ''
+ count = 0
+ endtime = time.time() + 60
+ while count < 5 and time.time() < endtime:
+ proc = subprocess.Popen("ping -c 1 %s" % self.target.ip, shell=True, stdout=subprocess.PIPE)
+ output += proc.communicate()[0]
+ if proc.poll() == 0:
+ count += 1
+ else:
+ count = 0
+ self.assertEqual(count, 5, msg = "Expected 5 consecutive replies, got %d.\nping output is:\n%s" % (count,output))
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/python.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/python.py
new file mode 100644
index 000000000..26edb7a9b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/python.py
@@ -0,0 +1,35 @@
+import unittest
+import os
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+ if not oeRuntimeTest.hasPackage("python"):
+ skipModule("No python package in the image")
+
+
+class PythonTest(oeRuntimeTest):
+
+ @classmethod
+ def setUpClass(self):
+ oeRuntimeTest.tc.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "test.py"), "/tmp/test.py")
+
+ @testcase(1145)
+ def test_python_exists(self):
+ (status, output) = self.target.run('which python')
+ self.assertEqual(status, 0, msg="Python binary not in PATH or not on target.")
+
+ @testcase(965)
+ def test_python_stdout(self):
+ (status, output) = self.target.run('python /tmp/test.py')
+ self.assertEqual(status, 0, msg="Exit status was not 0. Output: %s" % output)
+ self.assertEqual(output, "the value of a is 0.01", msg="Incorrect output: %s" % output)
+
+ @testcase(1146)
+ def test_python_testfile(self):
+ (status, output) = self.target.run('ls /tmp/testfile.python')
+ self.assertEqual(status, 0, msg="Python test file generate failed.")
+
+ @classmethod
+ def tearDownClass(self):
+ oeRuntimeTest.tc.target.run("rm /tmp/test.py /tmp/testfile.python")
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/rpm.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/rpm.py
new file mode 100644
index 000000000..624c515aa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/rpm.py
@@ -0,0 +1,101 @@
+import unittest
+import os
+import fnmatch
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+ if not oeRuntimeTest.hasFeature("package-management"):
+ skipModule("rpm module skipped: target doesn't have package-management in IMAGE_FEATURES")
+ if "package_rpm" != oeRuntimeTest.tc.d.getVar("PACKAGE_CLASSES", True).split()[0]:
+ skipModule("rpm module skipped: target doesn't have rpm as primary package manager")
+
+
+class RpmBasicTest(oeRuntimeTest):
+
+ @testcase(960)
+ @skipUnlessPassed('test_ssh')
+ def test_rpm_help(self):
+ (status, output) = self.target.run('rpm --help')
+ self.assertEqual(status, 0, msg="status and output: %s and %s" % (status,output))
+
+ @testcase(191)
+ @skipUnlessPassed('test_rpm_help')
+ def test_rpm_query(self):
+ (status, output) = self.target.run('rpm -q rpm')
+ self.assertEqual(status, 0, msg="status and output: %s and %s" % (status,output))
+
+class RpmInstallRemoveTest(oeRuntimeTest):
+
+ @classmethod
+ def setUpClass(self):
+ pkgarch = oeRuntimeTest.tc.d.getVar('TUNE_PKGARCH', True).replace("-", "_")
+ rpmdir = os.path.join(oeRuntimeTest.tc.d.getVar('DEPLOY_DIR', True), "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
+ for f in fnmatch.filter(os.listdir(rpmdir), "rpm-doc-*.%s.rpm" % pkgarch):
+ testrpmfile = f
+ oeRuntimeTest.tc.target.copy_to(os.path.join(rpmdir,testrpmfile), "/tmp/rpm-doc.rpm")
+
+ @testcase(192)
+ @skipUnlessPassed('test_rpm_help')
+ def test_rpm_install(self):
+ (status, output) = self.target.run('rpm -ivh /tmp/rpm-doc.rpm')
+ self.assertEqual(status, 0, msg="Failed to install rpm-doc package: %s" % output)
+
+ @testcase(194)
+ @skipUnlessPassed('test_rpm_install')
+ def test_rpm_remove(self):
+ (status,output) = self.target.run('rpm -e rpm-doc')
+ self.assertEqual(status, 0, msg="Failed to remove rpm-doc package: %s" % output)
+
+ @testcase(1096)
+ @skipUnlessPassed('test_ssh')
+ def test_rpm_query_nonroot(self):
+ (status, output) = self.target.run('useradd test1')
+ self.assertTrue(status == 0, msg="Failed to create new user: " + output)
+ (status, output) = self.target.run('sudo -u test1 id')
+ self.assertTrue('(test1)' in output, msg="Failed to execute as new user")
+ (status, output) = self.target.run('sudo -u test1 rpm -qa')
+ self.assertEqual(status, 0, msg="status: %s. Cannot run rpm -qa: %s" % (status, output))
+
+ @testcase(195)
+ @skipUnlessPassed('test_rpm_install')
+ def test_check_rpm_install_removal_log_file_size(self):
+ """
+ Summary: Check rpm install/removal log file size
+ Expected: There should be some method to keep rpm log in a small size .
+ Product: BSPs
+ Author: Alexandru Georgescu <alexandru.c.georgescu@intel.com>
+ AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+ """
+ db_files_cmd = 'ls /var/lib/rpm/__db.*'
+ get_log_size_cmd = "du /var/lib/rpm/log/log.* | awk '{print $1}'"
+
+ # Make sure that some database files are under /var/lib/rpm as '__db.xxx'
+ (status, output) = self.target.run(db_files_cmd)
+ self.assertEqual(0, status, 'Failed to find database files under /var/lib/rpm/ as __db.xxx')
+
+ # 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')
+ self.assertEqual(0, status, "Failed to install rpm-doc package. Reason: {}".format(output))
+
+ (status, output) = self.target.run('rpm -e rpm-doc')
+ self.assertEqual(0, status, "Failed to remove rpm-doc package. Reason: {}".format(output))
+
+ # Get the size of log file
+ (status, output) = self.target.run(get_log_size_cmd)
+ self.assertEqual(0, status, 'Failed to get the final size of the log file.')
+
+ # Compare each log size
+ for log_file_size in output:
+ self.assertLessEqual(int(log_file_size), 11264,
+ 'Log file size is greater that expected (~10MB), found {} bytes'.format(log_file_size))
+
+ @classmethod
+ def tearDownClass(self):
+ oeRuntimeTest.tc.target.run('rm -f /tmp/rpm-doc.rpm')
+
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/scanelf.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/scanelf.py
new file mode 100644
index 000000000..67e02ff45
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/scanelf.py
@@ -0,0 +1,28 @@
+import unittest
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+ if not oeRuntimeTest.hasPackage("pax-utils"):
+ skipModule("pax-utils package not installed")
+
+class ScanelfTest(oeRuntimeTest):
+
+ def setUpLocal(self):
+ self.scancmd = 'scanelf --quiet --recursive --mount --ldpath --path'
+
+ @testcase(966)
+ @skipUnlessPassed('test_ssh')
+ def test_scanelf_textrel(self):
+ # print TEXTREL information
+ self.scancmd += " --textrel"
+ (status, output) = self.target.run(self.scancmd)
+ self.assertEqual(output.strip(), "", "\n".join([self.scancmd, output]))
+
+ @testcase(967)
+ @skipUnlessPassed('test_ssh')
+ def test_scanelf_rpath(self):
+ # print RPATH information
+ self.scancmd += " --rpath"
+ (status, output) = self.target.run(self.scancmd)
+ self.assertEqual(output.strip(), "", "\n".join([self.scancmd, output]))
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/scp.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/scp.py
new file mode 100644
index 000000000..48e87d2d0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/scp.py
@@ -0,0 +1,22 @@
+import os
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import skipUnlessPassed, testcase
+
+def setUpModule():
+ if not (oeRuntimeTest.hasPackage("dropbear") or oeRuntimeTest.hasPackage("openssh-sshd")):
+ skipModule("No ssh package in image")
+
+class ScpTest(oeRuntimeTest):
+
+ @testcase(220)
+ @skipUnlessPassed('test_ssh')
+ def test_scp_file(self):
+ test_log_dir = oeRuntimeTest.tc.d.getVar("TEST_LOG_DIR", True)
+ test_file_path = os.path.join(test_log_dir, 'test_scp_file')
+ with open(test_file_path, 'w') as test_scp_file:
+ test_scp_file.seek(2 ** 22 - 1)
+ test_scp_file.write(os.linesep)
+ (status, output) = self.target.copy_to(test_file_path, '/tmp/test_scp_file')
+ self.assertEqual(status, 0, msg = "File could not be copied. Output: %s" % output)
+ (status, output) = self.target.run("ls -la /tmp/test_scp_file")
+ self.assertEqual(status, 0, msg = "SCP test failed")
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/skeletoninit.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/skeletoninit.py
new file mode 100644
index 000000000..cb0cb9b4c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/skeletoninit.py
@@ -0,0 +1,29 @@
+# This test should cover https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=284 testcase
+# Note that the image under test must have meta-skeleton layer in bblayers and IMAGE_INSTALL_append = " service" in local.conf
+
+import unittest
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+ if not oeRuntimeTest.hasPackage("service"):
+ skipModule("No service package in image")
+
+
+class SkeletonBasicTest(oeRuntimeTest):
+
+ @skipUnlessPassed('test_ssh')
+ @unittest.skipIf("systemd" == oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", False), "Not appropiate for systemd image")
+ def test_skeleton_availability(self):
+ (status, output) = self.target.run('ls /etc/init.d/skeleton')
+ self.assertEqual(status, 0, msg = "skeleton init script not found. Output:\n%s " % output)
+ (status, output) = self.target.run('ls /usr/sbin/skeleton-test')
+ self.assertEqual(status, 0, msg = "skeleton-test not found. Output:\n%s" % output)
+
+ @testcase(284)
+ @skipUnlessPassed('test_skeleton_availability')
+ @unittest.skipIf("systemd" == oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", False), "Not appropiate for systemd image")
+ def test_skeleton_script(self):
+ output1 = self.target.run("/etc/init.d/skeleton start")[1]
+ (status, output2) = self.target.run(oeRuntimeTest.pscmd + ' | grep [s]keleton-test')
+ self.assertEqual(status, 0, msg = "Skeleton script could not be started:\n%s\n%s" % (output1, output2))
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/smart.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/smart.py
new file mode 100644
index 000000000..126d61463
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/smart.py
@@ -0,0 +1,175 @@
+import unittest
+import re
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+from oeqa.utils.httpserver import HTTPService
+
+def setUpModule():
+ if not oeRuntimeTest.hasFeature("package-management"):
+ skipModule("Image doesn't have package management feature")
+ if not oeRuntimeTest.hasPackage("smart"):
+ skipModule("Image doesn't have smart installed")
+ if "package_rpm" != oeRuntimeTest.tc.d.getVar("PACKAGE_CLASSES", True).split()[0]:
+ skipModule("Rpm is not the primary package manager")
+
+class SmartTest(oeRuntimeTest):
+
+ @skipUnlessPassed('test_smart_help')
+ def smart(self, command, expected = 0):
+ command = 'smart %s' % command
+ status, output = self.target.run(command, 1500)
+ message = os.linesep.join([command, output])
+ self.assertEqual(status, expected, message)
+ self.assertFalse("Cannot allocate memory" in output, message)
+ return output
+
+class SmartBasicTest(SmartTest):
+
+ @testcase(716)
+ @skipUnlessPassed('test_ssh')
+ def test_smart_help(self):
+ self.smart('--help')
+
+ @testcase(968)
+ def test_smart_version(self):
+ self.smart('--version')
+
+ @testcase(721)
+ def test_smart_info(self):
+ self.smart('info python-smartpm')
+
+ @testcase(421)
+ def test_smart_query(self):
+ self.smart('query python-smartpm')
+
+ @testcase(720)
+ def test_smart_search(self):
+ self.smart('search python-smartpm')
+
+ @testcase(722)
+ def test_smart_stats(self):
+ self.smart('stats')
+
+class SmartRepoTest(SmartTest):
+
+ @classmethod
+ def setUpClass(self):
+ self.repolist = []
+ self.repo_server = HTTPService(oeRuntimeTest.tc.d.getVar('DEPLOY_DIR', True), oeRuntimeTest.tc.target.server_ip)
+ self.repo_server.start()
+
+ @classmethod
+ def tearDownClass(self):
+ self.repo_server.stop()
+ for i in self.repolist:
+ oeRuntimeTest.tc.target.run('smart channel -y --remove '+str(i))
+
+ @testcase(1143)
+ def test_smart_channel(self):
+ self.smart('channel', 1)
+
+ @testcase(719)
+ def test_smart_channel_add(self):
+ image_pkgtype = self.tc.d.getVar('IMAGE_PKGTYPE', True)
+ deploy_url = 'http://%s:%s/%s' %(self.target.server_ip, self.repo_server.port, image_pkgtype)
+ pkgarchs = self.tc.d.getVar('PACKAGE_ARCHS', True).replace("-","_").split()
+ for arch in os.listdir('%s/%s' % (self.repo_server.root_dir, image_pkgtype)):
+ if arch in pkgarchs:
+ self.smart('channel -y --add {a} type=rpm-md baseurl={u}/{a}'.format(a=arch, u=deploy_url))
+ self.repolist.append(arch)
+ self.smart('update')
+
+ @testcase(969)
+ def test_smart_channel_help(self):
+ self.smart('channel --help')
+
+ @testcase(970)
+ def test_smart_channel_list(self):
+ self.smart('channel --list')
+
+ @testcase(971)
+ def test_smart_channel_show(self):
+ self.smart('channel --show')
+
+ @testcase(717)
+ def test_smart_channel_rpmsys(self):
+ self.smart('channel --show rpmsys')
+ self.smart('channel --disable rpmsys')
+ self.smart('channel --enable rpmsys')
+
+ @testcase(1144)
+ @skipUnlessPassed('test_smart_channel_add')
+ def test_smart_install(self):
+ self.smart('remove -y psplash-default')
+ self.smart('install -y psplash-default')
+
+ @testcase(728)
+ @skipUnlessPassed('test_smart_install')
+ def test_smart_install_dependency(self):
+ self.smart('remove -y psplash')
+ self.smart('install -y psplash-default')
+
+ @testcase(723)
+ @skipUnlessPassed('test_smart_channel_add')
+ def test_smart_install_from_disk(self):
+ self.smart('remove -y psplash-default')
+ self.smart('download psplash-default')
+ self.smart('install -y ./psplash-default*')
+
+ @testcase(725)
+ @skipUnlessPassed('test_smart_channel_add')
+ def test_smart_install_from_http(self):
+ output = self.smart('download --urls psplash-default')
+ url = re.search('(http://.*/psplash-default.*\.rpm)', output)
+ self.assertTrue(url, msg="Couln't find download url in %s" % output)
+ self.smart('remove -y psplash-default')
+ self.smart('install -y %s' % url.group(0))
+
+ @testcase(729)
+ @skipUnlessPassed('test_smart_install')
+ def test_smart_reinstall(self):
+ self.smart('reinstall -y psplash-default')
+
+ @testcase(727)
+ @skipUnlessPassed('test_smart_channel_add')
+ def test_smart_remote_repo(self):
+ self.smart('update')
+ self.smart('install -y psplash')
+ self.smart('remove -y psplash')
+
+ @testcase(726)
+ def test_smart_local_dir(self):
+ self.target.run('mkdir /tmp/myrpmdir')
+ self.smart('channel --add myrpmdir type=rpm-dir path=/tmp/myrpmdir -y')
+ self.target.run('cd /tmp/myrpmdir')
+ self.smart('download psplash')
+ output = self.smart('channel --list')
+ for i in output.split("\n"):
+ if ("rpmsys" != str(i)) and ("myrpmdir" != str(i)):
+ self.smart('channel --disable '+str(i))
+ self.target.run('cd $HOME')
+ self.smart('install psplash')
+ for i in output.split("\n"):
+ if ("rpmsys" != str(i)) and ("myrpmdir" != str(i)):
+ self.smart('channel --enable '+str(i))
+ self.smart('channel --remove myrpmdir -y')
+ self.target.run("rm -rf /tmp/myrpmdir")
+
+ @testcase(718)
+ def test_smart_add_rpmdir(self):
+ self.target.run('mkdir /tmp/myrpmdir')
+ self.smart('channel --add myrpmdir type=rpm-dir path=/tmp/myrpmdir -y')
+ self.smart('channel --disable myrpmdir -y')
+ output = self.smart('channel --show myrpmdir')
+ self.assertTrue("disabled = yes" in output, msg="Failed to disable rpm dir")
+ self.smart('channel --enable myrpmdir -y')
+ output = self.smart('channel --show myrpmdir')
+ self.assertFalse("disabled = yes" in output, msg="Failed to enable rpm dir")
+ self.smart('channel --remove myrpmdir -y')
+ self.target.run("rm -rf /tmp/myrpmdir")
+
+ @testcase(731)
+ @skipUnlessPassed('test_smart_channel_add')
+ def test_smart_remove_package(self):
+ self.smart('install -y psplash')
+ self.smart('remove -y psplash')
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/ssh.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/ssh.py
new file mode 100644
index 000000000..0e76d5d51
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/ssh.py
@@ -0,0 +1,19 @@
+import subprocess
+import unittest
+import sys
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+ if not (oeRuntimeTest.hasPackage("dropbear") or oeRuntimeTest.hasPackage("openssh")):
+ skipModule("No ssh package in image")
+
+class SshTest(oeRuntimeTest):
+
+ @testcase(224)
+ @skipUnlessPassed('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')
+ self.assertEqual(status, 1, msg="This isn't the right image - /etc/masterimage shouldn't be here %s" % output)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/syslog.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/syslog.py
new file mode 100644
index 000000000..2601dd9ea
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/syslog.py
@@ -0,0 +1,45 @@
+import unittest
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+ if not (oeRuntimeTest.hasPackage("busybox-syslog") or oeRuntimeTest.hasPackage("sysklogd")):
+ skipModule("No syslog package in image")
+
+class SyslogTest(oeRuntimeTest):
+
+ @testcase(201)
+ @skipUnlessPassed("test_syslog_help")
+ def test_syslog_running(self):
+ (status,output) = self.target.run(oeRuntimeTest.pscmd + ' | grep -i [s]yslogd')
+ self.assertEqual(status, 0, msg="no syslogd process, ps output: %s" % self.target.run(oeRuntimeTest.pscmd)[1])
+
+class SyslogTestConfig(oeRuntimeTest):
+
+ @testcase(1149)
+ @skipUnlessPassed("test_syslog_running")
+ def test_syslog_logger(self):
+ (status,output) = self.target.run('logger foobar && test -e /var/log/messages && grep foobar /var/log/messages || logread | grep foobar')
+ self.assertEqual(status, 0, msg="Test log string not found in /var/log/messages. Output: %s " % output)
+
+ @testcase(1150)
+ @skipUnlessPassed("test_syslog_running")
+ def test_syslog_restart(self):
+ if "systemd" != oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", False):
+ (status,output) = self.target.run('/etc/init.d/syslog restart')
+ else:
+ (status,output) = self.target.run('systemctl restart syslog.service')
+
+ @testcase(202)
+ @skipUnlessPassed("test_syslog_restart")
+ @skipUnlessPassed("test_syslog_logger")
+ @unittest.skipIf("systemd" == oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", False), "Not appropiate for systemd image")
+ @unittest.skipIf(oeRuntimeTest.hasPackage("sysklogd") or not oeRuntimeTest.hasPackage("busybox"), "Non-busybox syslog")
+ def test_syslog_startup_config(self):
+ self.target.run('echo "LOGFILE=/var/log/test" >> /etc/syslog-startup.conf')
+ (status,output) = self.target.run('/etc/init.d/syslog restart')
+ self.assertEqual(status, 0, msg="Could not restart syslog service. Status and output: %s and %s" % (status,output))
+ (status,output) = self.target.run('logger foobar && grep foobar /var/log/test')
+ self.assertEqual(status, 0, msg="Test log string not found. Output: %s " % output)
+ self.target.run("sed -i 's#LOGFILE=/var/log/test##' /etc/syslog-startup.conf")
+ self.target.run('/etc/init.d/syslog restart')
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/systemd.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/systemd.py
new file mode 100644
index 000000000..2b2f10d71
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/systemd.py
@@ -0,0 +1,178 @@
+import unittest
+import re
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+ if not oeRuntimeTest.hasFeature("systemd"):
+ skipModule("target doesn't have systemd in DISTRO_FEATURES")
+ if "systemd" != oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", True):
+ skipModule("systemd is not the init manager for this image")
+
+
+class SystemdTest(oeRuntimeTest):
+
+ 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:
+ message += self.target.run('systemctl status --full %s' % target)[1]
+ self.assertEqual(status, expected, message)
+ return output
+
+ #TODO: use pyjournalctl instead
+ def journalctl(self, args='',l_match_units=[]):
+ """
+ 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 len(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):
+
+ @skipUnlessPassed('test_ssh')
+ def test_systemd_basic(self):
+ self.systemctl('--version')
+
+ @testcase(551)
+ @skipUnlessPassed('test_system_basic')
+ def test_systemd_list(self):
+ self.systemctl('list-unit-files')
+
+ 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).
+ """
+ import time
+ 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)
+
+ @testcase(550)
+ @skipUnlessPassed('test_systemd_basic')
+ def test_systemd_failed(self):
+ settled, output = self.settle()
+ self.assertTrue(settled, msg="Timed out waiting for systemd to settle:\n" + output)
+
+ 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):
+
+ def check_for_avahi(self):
+ if not self.hasPackage('avahi-daemon'):
+ raise unittest.SkipTest("Testcase dependency not met: need avahi-daemon installed on target")
+
+ @skipUnlessPassed('test_systemd_basic')
+ def test_systemd_status(self):
+ self.check_for_avahi()
+ self.systemctl('status --full', 'avahi-daemon.service')
+
+ @testcase(695)
+ @skipUnlessPassed('test_systemd_status')
+ def test_systemd_stop_start(self):
+ self.check_for_avahi()
+ 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)
+
+ @testcase(696)
+ @skipUnlessPassed('test_systemd_basic')
+ def test_systemd_disable_enable(self):
+ self.check_for_avahi()
+ 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):
+ @skipUnlessPassed('test_ssh')
+ def test_systemd_journal(self):
+ (status, output) = self.target.run('journalctl')
+ self.assertEqual(status, 0, output)
+
+ @skipUnlessPassed('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:
+ print "%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:
+ print "Target boot time %s exceeds systemd's TimeoutStartSec %s"\
+ %(boot_time_sec, systemd_TimeoutStartSec)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/x32lib.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/x32lib.py
new file mode 100644
index 000000000..ce5e21403
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/x32lib.py
@@ -0,0 +1,18 @@
+import unittest
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+ #check if DEFAULTTUNE is set and it's value is: x86-64-x32
+ defaulttune = oeRuntimeTest.tc.d.getVar("DEFAULTTUNE", True)
+ if "x86-64-x32" not in defaulttune:
+ skipModule("DEFAULTTUNE is not set to x86-64-x32")
+
+class X32libTest(oeRuntimeTest):
+
+ @testcase(281)
+ @skipUnlessPassed("test_ssh")
+ def test_x32_file(self):
+ status1 = self.target.run("readelf -h /bin/ls | grep Class | grep ELF32")[0]
+ status2 = self.target.run("readelf -h /bin/ls | grep Machine | grep X86-64")[0]
+ self.assertTrue(status1 == 0 and status2 == 0, msg="/bin/ls isn't an X86-64 ELF32 binary. readelf says: %s" % self.target.run("readelf -h /bin/ls")[1])
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/runtime/xorg.py b/import-layers/yocto-poky/meta/lib/oeqa/runtime/xorg.py
new file mode 100644
index 000000000..12bcd371a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/runtime/xorg.py
@@ -0,0 +1,16 @@
+import unittest
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+ if not oeRuntimeTest.hasFeature("x11-base"):
+ skipModule("target doesn't have x11 in IMAGE_FEATURES")
+
+
+class XorgTest(oeRuntimeTest):
+
+ @testcase(1151)
+ @skipUnlessPassed('test_ssh')
+ def test_xorg_running(self):
+ (status, output) = self.target.run(oeRuntimeTest.pscmd + ' | grep -v xinit | grep [X]org')
+ self.assertEqual(status, 0, msg="Xorg does not appear to be running %s" % self.target.run(oeRuntimeTest.pscmd)[1])
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdk/__init__.py b/import-layers/yocto-poky/meta/lib/oeqa/sdk/__init__.py
new file mode 100644
index 000000000..4cf3fa76b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/sdk/__init__.py
@@ -0,0 +1,3 @@
+# Enable other layers to have tests in the same named directory
+from pkgutil import extend_path
+__path__ = extend_path(__path__, __name__)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdk/buildcvs.py b/import-layers/yocto-poky/meta/lib/oeqa/sdk/buildcvs.py
new file mode 100644
index 000000000..c7146fa4a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/sdk/buildcvs.py
@@ -0,0 +1,25 @@
+from oeqa.oetest import oeSDKTest, skipModule
+from oeqa.utils.decorators import *
+from oeqa.utils.targetbuild import SDKBuildProject
+
+class BuildCvsTest(oeSDKTest):
+
+ @classmethod
+ def setUpClass(self):
+ self.project = SDKBuildProject(oeSDKTest.tc.sdktestdir + "/cvs/", oeSDKTest.tc.sdkenv, oeSDKTest.tc.d,
+ "http://ftp.gnu.org/non-gnu/cvs/source/feature/1.12.13/cvs-1.12.13.tar.bz2")
+ self.project.download_archive()
+
+ def test_cvs(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/import-layers/yocto-poky/meta/lib/oeqa/sdk/buildiptables.py b/import-layers/yocto-poky/meta/lib/oeqa/sdk/buildiptables.py
new file mode 100644
index 000000000..062e5316e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/sdk/buildiptables.py
@@ -0,0 +1,26 @@
+from oeqa.oetest import oeSDKTest
+from oeqa.utils.decorators import *
+from oeqa.utils.targetbuild import SDKBuildProject
+
+
+class BuildIptablesTest(oeSDKTest):
+
+ @classmethod
+ def setUpClass(self):
+ self.project = SDKBuildProject(oeSDKTest.tc.sdktestdir + "/iptables/", oeSDKTest.tc.sdkenv, oeSDKTest.tc.d,
+ "http://netfilter.org/projects/iptables/files/iptables-1.4.13.tar.bz2")
+ self.project.download_archive()
+
+ def test_iptables(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/import-layers/yocto-poky/meta/lib/oeqa/sdk/buildsudoku.py b/import-layers/yocto-poky/meta/lib/oeqa/sdk/buildsudoku.py
new file mode 100644
index 000000000..dea77c659
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/sdk/buildsudoku.py
@@ -0,0 +1,26 @@
+from oeqa.oetest import oeSDKTest, skipModule
+from oeqa.utils.decorators import *
+from oeqa.utils.targetbuild import SDKBuildProject
+
+def setUpModule():
+ if not oeSDKTest.hasPackage("gtk\+"):
+ skipModule("Image doesn't have gtk+ in manifest")
+
+class SudokuTest(oeSDKTest):
+
+ @classmethod
+ def setUpClass(self):
+ self.project = SDKBuildProject(oeSDKTest.tc.sdktestdir + "/sudoku/", oeSDKTest.tc.sdkenv, oeSDKTest.tc.d,
+ "http://downloads.sourceforge.net/project/sudoku-savant/sudoku-savant/sudoku-savant-1.3/sudoku-savant-1.3.tar.bz2")
+ self.project.download_archive()
+
+ def test_sudoku(self):
+ self.assertEqual(self.project.run_configure(), 0,
+ msg="Running configure failed")
+
+ self.assertEqual(self.project.run_make(), 0,
+ msg="Running make failed")
+
+ @classmethod
+ def tearDownClass(self):
+ self.project.clean()
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdk/gcc.py b/import-layers/yocto-poky/meta/lib/oeqa/sdk/gcc.py
new file mode 100644
index 000000000..8395b9b90
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/sdk/gcc.py
@@ -0,0 +1,36 @@
+import unittest
+import os
+import shutil
+from oeqa.oetest import oeSDKTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+ machine = oeSDKTest.tc.d.getVar("MACHINE", True)
+ if not oeSDKTest.hasHostPackage("packagegroup-cross-canadian-" + machine):
+ skipModule("SDK doesn't contain a cross-canadian toolchain")
+
+
+class GccCompileTest(oeSDKTest):
+
+ @classmethod
+ def setUpClass(self):
+ for f in ['test.c', 'test.cpp', 'testsdkmakefile']:
+ shutil.copyfile(os.path.join(self.tc.filesdir, f), self.tc.sdktestdir + f)
+
+ def test_gcc_compile(self):
+ self._run('$CC %s/test.c -o %s/test -lm' % (self.tc.sdktestdir, self.tc.sdktestdir))
+
+ def test_gpp_compile(self):
+ self._run('$CXX %s/test.c -o %s/test -lm' % (self.tc.sdktestdir, self.tc.sdktestdir))
+
+ def test_gpp2_compile(self):
+ self._run('$CXX %s/test.cpp -o %s/test -lm' % (self.tc.sdktestdir, self.tc.sdktestdir))
+
+ def test_make(self):
+ self._run('cd %s; make -f testsdkmakefile' % self.tc.sdktestdir)
+
+ @classmethod
+ def tearDownClass(self):
+ files = [self.tc.sdktestdir + f for f in ['test.c', 'test.cpp', 'test.o', 'test', 'testsdkmakefile']]
+ for f in files:
+ bb.utils.remove(f)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdk/perl.py b/import-layers/yocto-poky/meta/lib/oeqa/sdk/perl.py
new file mode 100644
index 000000000..45f422ef0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/sdk/perl.py
@@ -0,0 +1,28 @@
+import unittest
+import os
+import shutil
+from oeqa.oetest import oeSDKTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+ if not oeSDKTest.hasHostPackage("nativesdk-perl"):
+ skipModule("No perl package in the SDK")
+
+
+class PerlTest(oeSDKTest):
+
+ @classmethod
+ def setUpClass(self):
+ for f in ['test.pl']:
+ shutil.copyfile(os.path.join(self.tc.filesdir, f), self.tc.sdktestdir + f)
+ self.testfile = self.tc.sdktestdir + "test.pl"
+
+ def test_perl_exists(self):
+ self._run('which perl')
+
+ def test_perl_works(self):
+ self._run('perl %s/test.pl' % self.tc.sdktestdir)
+
+ @classmethod
+ def tearDownClass(self):
+ bb.utils.remove("%s/test.pl" % self.tc.sdktestdir)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdk/python.py b/import-layers/yocto-poky/meta/lib/oeqa/sdk/python.py
new file mode 100644
index 000000000..896fab4df
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/sdk/python.py
@@ -0,0 +1,32 @@
+import unittest
+import os
+import shutil
+from oeqa.oetest import oeSDKTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+ if not oeSDKTest.hasHostPackage("nativesdk-python"):
+ skipModule("No python package in the SDK")
+
+
+class PythonTest(oeSDKTest):
+
+ @classmethod
+ def setUpClass(self):
+ for f in ['test.py']:
+ shutil.copyfile(os.path.join(self.tc.filesdir, f), self.tc.sdktestdir + f)
+
+ def test_python_exists(self):
+ self._run('which python')
+
+ def test_python_stdout(self):
+ output = self._run('python %s/test.py' % self.tc.sdktestdir)
+ 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):
+ bb.utils.remove("%s/test.py" % self.tc.sdktestdir)
+ bb.utils.remove("/tmp/testfile.python")
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdkext/__init__.py b/import-layers/yocto-poky/meta/lib/oeqa/sdkext/__init__.py
new file mode 100644
index 000000000..4cf3fa76b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/sdkext/__init__.py
@@ -0,0 +1,3 @@
+# Enable other layers to have tests in the same named directory
+from pkgutil import extend_path
+__path__ = extend_path(__path__, __name__)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdkext/devtool.py b/import-layers/yocto-poky/meta/lib/oeqa/sdkext/devtool.py
new file mode 100644
index 000000000..c5bb3102a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/sdkext/devtool.py
@@ -0,0 +1,32 @@
+import shutil
+
+from oeqa.oetest import oeSDKExtTest
+from oeqa.utils.decorators import *
+
+class DevtoolTest(oeSDKExtTest):
+
+ @classmethod
+ def setUpClass(self):
+ self.myapp_src = os.path.join(self.tc.sdkextfilesdir, "myapp")
+ self.myapp_dst = os.path.join(self.tc.sdktestdir, "myapp")
+ shutil.copytree(self.myapp_src, self.myapp_dst)
+
+ def test_devtool_location(self):
+ output = self._run('which devtool')
+ self.assertEqual(output.startswith(self.tc.sdktestdir), True, \
+ msg="Seems that devtool isn't the eSDK one: %s" % output)
+
+ @skipUnlessPassed('test_devtool_location')
+ def test_devtool_add_reset(self):
+ self._run('devtool add myapp %s' % self.myapp_dst)
+ self._run('devtool reset myapp')
+
+ @skipUnlessPassed('test_devtool_location')
+ def test_devtool_build(self):
+ self._run('devtool add myapp %s' % self.myapp_dst)
+ self._run('devtool build myapp')
+ self._run('devtool reset myapp')
+
+ @classmethod
+ def tearDownClass(self):
+ shutil.rmtree(self.myapp_dst)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/sdkext/files/myapp/Makefile b/import-layers/yocto-poky/meta/lib/oeqa/sdkext/files/myapp/Makefile
new file mode 100644
index 000000000..abd91bea6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/lib/oeqa/sdkext/files/myapp/myapp.c b/import-layers/yocto-poky/meta/lib/oeqa/sdkext/files/myapp/myapp.c
new file mode 100644
index 000000000..f0b63f03f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/lib/oeqa/sdkext/sdk_update.py b/import-layers/yocto-poky/meta/lib/oeqa/sdkext/sdk_update.py
new file mode 100644
index 000000000..7a2a6fe7c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/sdkext/sdk_update.py
@@ -0,0 +1,39 @@
+import os
+import shutil
+import subprocess
+
+from oeqa.oetest import oeSDKExtTest
+from oeqa.utils.httpserver import HTTPService
+
+class SdkUpdateTest(oeSDKExtTest):
+
+ @classmethod
+ def setUpClass(self):
+ self.publish_dir = os.path.join(self.tc.sdktestdir, 'esdk_publish')
+ if os.path.exists(self.publish_dir):
+ shutil.rmtree(self.publish_dir)
+ os.mkdir(self.publish_dir)
+
+ tcname_new = self.tc.d.expand(
+ "${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}-new.sh")
+ if not os.path.exists(tcname_new):
+ tcname_new = self.tc.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)
+
+ def test_sdk_update_local(self):
+ output = self._run("devtool sdk-update \"%s\"" % self.publish_dir)
+
+ @classmethod
+ def tearDownClass(self):
+ self.http_service.stop()
+ shutil.rmtree(self.publish_dir)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/__init__.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/__init__.py
new file mode 100644
index 000000000..3ad9513f4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/__init__.py
@@ -0,0 +1,2 @@
+from pkgutil import extend_path
+__path__ = extend_path(__path__, __name__)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/_sstatetests_noauto.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/_sstatetests_noauto.py
new file mode 100644
index 000000000..fc9ae7efb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/_sstatetests_noauto.py
@@ -0,0 +1,95 @@
+import datetime
+import unittest
+import os
+import re
+import shutil
+
+import oeqa.utils.ftools as ftools
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer
+from oeqa.selftest.sstate import SStateBase
+
+
+class RebuildFromSState(SStateBase):
+
+ @classmethod
+ def setUpClass(self):
+ 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/import-layers/yocto-poky/meta/lib/oeqa/selftest/_toaster.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/_toaster.py
new file mode 100644
index 000000000..c424659fd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/_toaster.py
@@ -0,0 +1,320 @@
+import unittest
+import os
+import sys
+import shlex, subprocess
+import urllib, commands, time, getpass, re, json, shlex
+
+import oeqa.utils.ftools as ftools
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd
+
+sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../../', 'bitbake/lib/toaster')))
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "toastermain.settings")
+
+import toastermain.settings
+from django.db.models import Q
+from orm.models import *
+from oeqa.utils.decorators import testcase
+
+class ToasterSetup(oeSelfTest):
+
+ def recipe_parse(self, file_path, var):
+ for line in open(file_path,'r'):
+ if line.find(var) > -1:
+ val = line.split(" = ")[1].replace("\"", "").strip()
+ return val
+
+ def fix_file_path(self, file_path):
+ if ":" in file_path:
+ file_path=file_path.split(":")[2]
+ return file_path
+
+class Toaster_DB_Tests(ToasterSetup):
+
+ # Check if build name is unique - tc_id=795
+ @testcase(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 coocker log path is unique - tc_id=819
+ @testcase(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 coocker log path is not unique')
+
+ # Check if task order is unique for one build - tc=824
+ @testcase(824)
+ def test_Task_Unique_Order(self):
+ builds = Build.objects.values('id')
+ cnt_err = []
+ for build in builds:
+ total_task_order = Task.objects.filter(build = build['id']).values('order').count()
+ distinct_task_order = Task.objects.filter(build = build['id']).values('order').distinct().count()
+ if (total_task_order != distinct_task_order):
+ cnt_err.append(build['id'])
+ self.assertEqual(len(cnt_err), 0, msg = 'Errors for build id: %s' % cnt_err)
+
+ # Check task order sequence for one build - tc=825
+ @testcase(825)
+ def test_Task_Order_Sequence(self):
+ builds = builds = Build.objects.values('id')
+ cnt_err = []
+ for build in builds:
+ tasks = Task.objects.filter(Q(build = build['id']), ~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
+ ### this needs to be updated ###
+ #def test_Task_Disk_IO_TC828(self):
+
+ # Check if outcome = 2 (SSTATE) then sstate_result must be 3 (RESTORED) - tc=832
+ @testcase(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 (row['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
+ @testcase(833)
+ def test_Task_If_Outcome_1_3_Sstate_Result_Must_Be_0(self):
+ tasks = Task.objects.filter(outcome__in = (1, 3)).values('id', 'sstate_result')
+ cnt_err = []
+ for task in tasks:
+ if (task['sstate_result'] != 0):
+ cnt_err.append(task['id'])
+ 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
+ @testcase(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
+ @testcase(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
+ @testcase(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
+ @testcase(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
+ @testcase(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
+ @testcase(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
+ @testcase(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
+ @testcase(1037)
+ 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
+ @testcase(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
+ @testcase(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
+ @testcase(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
+ @testcase(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
+ @testcase(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
+ @testcase(1038)
+ 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):
+ cnt_err.append(package['id'])
+ self.assertEqual(len(cnt_err), 0, msg = 'Errors for package id: %s' % cnt_err)
+
+ # Check the validity of package recipe_id
+ ### TC must be added in test run
+ @testcase(1039)
+ 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
+ @testcase(1040)
+ 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)
+
+ # Check if all layers requests return exit code is 200 - tc=843
+ @testcase(843)
+ def test_Layers_Requests_Exit_Code(self):
+ layers = Layer.objects.values('id', 'layer_index_url')
+ cnt_err = []
+ for layer in layers:
+ resp = urllib.urlopen(layer['layer_index_url'])
+ if (resp.getcode() != 200):
+ cnt_err.append(layer['id'])
+ self.assertEqual(len(cnt_err), 0, msg = 'Errors for layer id: %s' % cnt_err)
+
+ # Check if django server starts regardless of the timezone set on the machine - tc=905
+ @testcase(905)
+ def test_Start_Django_Timezone(self):
+ current_path = os.getcwd()
+ zonefilelist = []
+ ZONEINFOPATH = '/usr/share/zoneinfo/'
+ os.chdir("../bitbake/lib/toaster/")
+ cnt_err = 0
+ for filename in os.listdir(ZONEINFOPATH):
+ if os.path.isfile(os.path.join(ZONEINFOPATH, filename)):
+ zonefilelist.append(filename)
+ for k in range(len(zonefilelist)):
+ if k <= 5:
+ files = zonefilelist[k]
+ os.system("export TZ="+str(files)+"; python manage.py runserver > /dev/null 2>&1 &")
+ time.sleep(3)
+ pid = subprocess.check_output("ps aux | grep '[/u]sr/bin/python manage.py runserver' | awk '{print $2}'", shell = True)
+ if pid:
+ os.system("kill -9 "+str(pid))
+ else:
+ cnt_err.append(zonefilelist[k])
+ self.assertEqual(cnt_err, 0, msg = 'Errors django server does not start with timezone: %s' % cnt_err)
+ os.chdir(current_path)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/archiver.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/archiver.py
new file mode 100644
index 000000000..f2030c446
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/archiver.py
@@ -0,0 +1,50 @@
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import bitbake, get_bb_var
+from oeqa.utils.decorators import testcase
+import glob
+import os
+import shutil
+
+
+class Archiver(oeSelfTest):
+
+ @testcase(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
+
+ # Update local.conf
+ self.write_config(features)
+
+ tmp_dir = get_bb_var('TMPDIR')
+ deploy_dir_src = get_bb_var('DEPLOY_DIR_SRC')
+ target_sys = get_bb_var('TARGET_SYS')
+ src_path = os.path.join(deploy_dir_src, target_sys)
+
+ # Delete tmp directory
+ shutil.rmtree(tmp_dir)
+
+ # Build core-image-minimal
+ bitbake('core-image-minimal')
+
+ # Check that include_recipe was included
+ is_included = len(glob.glob(src_path + '/%s*' % include_recipe))
+ self.assertEqual(1, is_included, 'Recipe %s was not included.' % include_recipe)
+
+ # Check that exclude_recipe was excluded
+ is_excluded = len(glob.glob(src_path + '/%s*' % exclude_recipe))
+ self.assertEqual(0, is_excluded, 'Recipe %s was not excluded.' % exclude_recipe)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/base.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/base.py
new file mode 100644
index 000000000..e10455edc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/base.py
@@ -0,0 +1,205 @@
+# Copyright (c) 2013 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+
+# DESCRIPTION
+# Base class inherited by test classes in meta/lib/oeqa/selftest
+
+import unittest
+import os
+import sys
+import shutil
+import logging
+import errno
+
+import oeqa.utils.ftools as ftools
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer
+from oeqa.utils.decorators import LogResults
+from random import choice
+import glob
+
+@LogResults
+class oeSelfTest(unittest.TestCase):
+
+ log = logging.getLogger("selftest.base")
+ longMessage = True
+
+ def __init__(self, methodName="runTest"):
+ self.builddir = os.environ.get("BUILDDIR")
+ self.localconf_path = os.path.join(self.builddir, "conf/local.conf")
+ self.testinc_path = os.path.join(self.builddir, "conf/selftest.inc")
+ self.local_bblayers_path = os.path.join(self.builddir, "conf/bblayers.conf")
+ self.testinc_bblayers_path = os.path.join(self.builddir, "conf/bblayers.inc")
+ self.machineinc_path = os.path.join(self.builddir, "conf/machine.inc")
+ self.testlayer_path = oeSelfTest.testlayer_path
+ self._extra_tear_down_commands = []
+ self._track_for_cleanup = [self.testinc_path, self.testinc_bblayers_path, self.machineinc_path]
+ super(oeSelfTest, self).__init__(methodName)
+
+ def setUp(self):
+ os.chdir(self.builddir)
+ # 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
+
+ # Get CUSTOMMACHINE from env (set by --machine argument to oe-selftest)
+ custommachine = os.getenv('CUSTOMMACHINE')
+ if custommachine:
+ if custommachine == 'random':
+ machine = get_random_machine()
+ else:
+ machine = custommachine
+ machine_conf = 'MACHINE ??= "%s"\n' % machine
+ self.set_machine_config(machine_conf)
+ print 'MACHINE: %s' % machine
+
+ # 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.log.warning("tearDown commands have failed: %s" % ', '.join(map(str, failed_extra_commands)))
+ self.log.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()
+
+ def tearDownLocal(self):
+ pass
+
+ # add test specific commands to the tearDown method.
+ def add_command_to_tearDown(self, command):
+ self.log.debug("Adding command '%s' to tearDown for this test." % command)
+ self._extra_tear_down_commands.append(command)
+ # add test specific files or directories to be removed in the tearDown method
+ def track_for_cleanup(self, path):
+ self.log.debug("Adding path '%s' to be cleaned up when test is over" % path)
+ self._track_for_cleanup.append(path)
+
+ # write to <builddir>/conf/selftest.inc
+ def write_config(self, data):
+ self.log.debug("Writing to: %s\n%s\n" % (self.testinc_path, data))
+ ftools.write_file(self.testinc_path, data)
+
+ custommachine = os.getenv('CUSTOMMACHINE')
+ if custommachine and 'MACHINE' in data:
+ machine = get_bb_var('MACHINE')
+ self.log.warning('MACHINE overridden: %s' % machine)
+
+ # append to <builddir>/conf/selftest.inc
+ def append_config(self, data):
+ self.log.debug("Appending to: %s\n%s\n" % (self.testinc_path, data))
+ ftools.append_file(self.testinc_path, data)
+
+ custommachine = os.getenv('CUSTOMMACHINE')
+ if custommachine and 'MACHINE' in data:
+ machine = get_bb_var('MACHINE')
+ self.log.warning('MACHINE overridden: %s' % machine)
+
+ # remove data from <builddir>/conf/selftest.inc
+ def remove_config(self, data):
+ self.log.debug("Removing from: %s\n\%s\n" % (self.testinc_path, data))
+ ftools.remove_from_file(self.testinc_path, data)
+
+ # write to meta-sefltest/recipes-test/<recipe>/test_recipe.inc
+ def write_recipeinc(self, recipe, data):
+ inc_file = os.path.join(self.testlayer_path, 'recipes-test', recipe, 'test_recipe.inc')
+ self.log.debug("Writing to: %s\n%s\n" % (inc_file, data))
+ ftools.write_file(inc_file, data)
+
+ # append data to meta-sefltest/recipes-test/<recipe>/test_recipe.inc
+ def append_recipeinc(self, recipe, data):
+ inc_file = os.path.join(self.testlayer_path, 'recipes-test', recipe, 'test_recipe.inc')
+ self.log.debug("Appending to: %s\n%s\n" % (inc_file, data))
+ ftools.append_file(inc_file, data)
+
+ # remove data from meta-sefltest/recipes-test/<recipe>/test_recipe.inc
+ def remove_recipeinc(self, recipe, data):
+ inc_file = os.path.join(self.testlayer_path, 'recipes-test', recipe, 'test_recipe.inc')
+ self.log.debug("Removing from: %s\n%s\n" % (inc_file, data))
+ ftools.remove_from_file(inc_file, data)
+
+ # delete meta-sefltest/recipes-test/<recipe>/test_recipe.inc file
+ def delete_recipeinc(self, recipe):
+ inc_file = os.path.join(self.testlayer_path, 'recipes-test', recipe, 'test_recipe.inc')
+ self.log.debug("Deleting file: %s" % inc_file)
+ try:
+ os.remove(inc_file)
+ except OSError as e:
+ if e.errno != errno.ENOENT:
+ raise
+
+ # write to <builddir>/conf/bblayers.inc
+ def write_bblayers_config(self, data):
+ self.log.debug("Writing to: %s\n%s\n" % (self.testinc_bblayers_path, data))
+ ftools.write_file(self.testinc_bblayers_path, data)
+
+ # append to <builddir>/conf/bblayers.inc
+ def append_bblayers_config(self, data):
+ self.log.debug("Appending to: %s\n%s\n" % (self.testinc_bblayers_path, data))
+ ftools.append_file(self.testinc_bblayers_path, data)
+
+ # remove data from <builddir>/conf/bblayers.inc
+ def remove_bblayers_config(self, data):
+ self.log.debug("Removing from: %s\n\%s\n" % (self.testinc_bblayers_path, data))
+ ftools.remove_from_file(self.testinc_bblayers_path, data)
+
+ # write to <builddir>/conf/machine.inc
+ def set_machine_config(self, data):
+ self.log.debug("Writing to: %s\n%s\n" % (self.machineinc_path, data))
+ ftools.write_file(self.machineinc_path, data)
+
+
+def get_available_machines():
+ # Get a list of all available machines
+ bbpath = get_bb_var('BBPATH').split(':')
+ machines = []
+
+ 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_random_machine():
+ # Get a random machine
+ return choice(get_available_machines())
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/bblayers.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/bblayers.py
new file mode 100644
index 000000000..d23675e84
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/bblayers.py
@@ -0,0 +1,104 @@
+import unittest
+import os
+import logging
+import re
+import shutil
+
+import oeqa.utils.ftools as ftools
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd, get_bb_var
+from oeqa.utils.decorators import testcase
+
+class BitbakeLayers(oeSelfTest):
+
+ @testcase(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)
+
+ @testcase(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)
+
+ @testcase(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))
+
+ @testcase(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)
+
+ @testcase(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)
+
+ @testcase(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)
+
+ @testcase(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('linux-yocto:', 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 kernel')
+ self.assertIn('linux-yocto:', result.output)
+ self.assertNotIn('mtd-utils:', result.output)
+ result = runCmd('bitbake-layers show-recipes -i image')
+ self.assertIn('core-image-minimal', result.output)
+ self.assertNotIn('linux-yocto:', 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/import-layers/yocto-poky/meta/lib/oeqa/selftest/bbtests.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/bbtests.py
new file mode 100644
index 000000000..26728a4b4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/bbtests.py
@@ -0,0 +1,272 @@
+import os
+import re
+
+import oeqa.utils.ftools as ftools
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var
+from oeqa.utils.decorators import testcase
+
+class BitbakeTests(oeSelfTest):
+
+ def getline(self, res, line):
+ for l in res.output.split('\n'):
+ if line in l:
+ return l
+
+ @testcase(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")
+
+ @testcase(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")
+
+ @testcase(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: Preparing RunQueue", 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)
+
+ @testcase(103)
+ def test_local_sstate(self):
+ bitbake('m4-native -ccleansstate')
+ 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 )
+
+ @testcase(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)
+
+ @testcase(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)
+
+ @testcase(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)
+
+ @testcase(108)
+ def test_invalid_patch(self):
+ self.write_recipeinc('man', 'SRC_URI += "file://man-1.5h1-make.patch"')
+ result = bitbake('man -c patch', ignore_status=True)
+ self.delete_recipeinc('man')
+ bitbake('-cclean man')
+ line = self.getline(result, "Function failed: patch_do_patch")
+ self.assertTrue(line and line.startswith("ERROR:"), msg = "Though no man-1.5h1-make.patch file exists, bitbake didn't output any err. message. bitbake output: %s" % result.output)
+
+ @testcase(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"
+ image_dir = get_bb_var('D', test_recipe)
+ pkgsplit_dir = get_bb_var('PKGDEST', test_recipe)
+ man_dir = get_bb_var('mandir', test_recipe)
+
+ bitbake('-c cleansstate %s' % test_recipe)
+ bitbake(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.')
+
+ @testcase(163)
+ def test_force_task_2(self):
+ # test 2 from bug 5875
+ test_recipe = 'zlib'
+
+ bitbake('-c cleansstate %s' % test_recipe)
+ 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.")
+
+ @testcase(167)
+ def test_bitbake_g(self):
+ result = bitbake('-g core-image-full-cmdline')
+ for f in ['pn-buildlist', 'pn-depends.dot', 'package-depends.dot', 'task-depends.dot']:
+ self.addCleanup(os.remove, f)
+ self.assertTrue('NOTE: PN build list saved to \'pn-buildlist\'' in result.output, msg = "No dependency \"pn-buildlist\" file was generated for the given task target. bitbake output: %s" % result.output)
+ self.assertTrue('openssh' in ftools.read_file(os.path.join(self.builddir, 'pn-buildlist')), msg = "No \"openssh\" dependency found in pn-buildlist file.")
+
+ @testcase(899)
+ def test_image_manifest(self):
+ bitbake('core-image-minimal')
+ deploydir = get_bb_var("DEPLOY_DIR_IMAGE", target="core-image-minimal")
+ imagename = get_bb_var("IMAGE_LINK_NAME", target="core-image-minimal")
+ 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)
+
+ @testcase(168)
+ def test_invalid_recipe_src_uri(self):
+ data = 'SRC_URI = "file://invalid"'
+ self.write_recipeinc('man', data)
+ self.write_config("""DL_DIR = \"${TOPDIR}/download-selftest\"
+SSTATE_DIR = \"${TOPDIR}/download-selftest\"
+""")
+ self.track_for_cleanup(os.path.join(self.builddir, "download-selftest"))
+
+ bitbake('-ccleanall man')
+ result = bitbake('-c fetch man', ignore_status=True)
+ bitbake('-ccleanall man')
+ self.delete_recipeinc('man')
+ 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, 'Function failed: 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)
+
+ @testcase(171)
+ def test_rename_downloaded_file(self):
+ 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_append = ";downloadfilename=test-aspell.tar.gz"'
+ self.write_recipeinc('aspell', data)
+ bitbake('-ccleanall aspell')
+ result = bitbake('-c fetch aspell', ignore_status=True)
+ self.delete_recipeinc('aspell')
+ self.assertEqual(result.status, 0, msg = "Couldn't fetch aspell. %s" % result.output)
+ self.assertTrue(os.path.isfile(os.path.join(get_bb_var("DL_DIR"), 'test-aspell.tar.gz')), msg = "File rename failed. No corresponding test-aspell.tar.gz file found under %s" % str(get_bb_var("DL_DIR")))
+ self.assertTrue(os.path.isfile(os.path.join(get_bb_var("DL_DIR"), 'test-aspell.tar.gz.done')), "File rename failed. No corresponding test-aspell.tar.gz.done file found under %s" % str(get_bb_var("DL_DIR")))
+
+ @testcase(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='")
+
+ @testcase(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)
+
+ @testcase(1030)
+ def test_just_parse(self):
+ result = runCmd('bitbake -p')
+ self.assertEqual(0, result.status, "errors encountered when parsing recipes. %s" % result.output)
+
+ @testcase(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)
+
+ @testcase(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.")
+
+ @testcase(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.")
+
+ @testcase(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)
+
+ @testcase(1035)
+ def test_continue(self):
+ self.write_config("""DL_DIR = \"${TOPDIR}/download-selftest\"
+SSTATE_DIR = \"${TOPDIR}/download-selftest\"
+""")
+ self.track_for_cleanup(os.path.join(self.builddir, "download-selftest"))
+ self.write_recipeinc('man',"\ndo_fail_task () {\nexit 1 \n}\n\naddtask do_fail_task before do_fetch\n" )
+ runCmd('bitbake -c cleanall man xcursor-transparent-theme')
+ result = runCmd('bitbake man xcursor-transparent-theme -k', 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)
+
+ @testcase(1119)
+ def test_non_gplv3(self):
+ data = 'INCOMPATIBLE_LICENSE = "GPLv3"'
+ conf = os.path.join(self.builddir, 'conf/local.conf')
+ ftools.append_file(conf ,data)
+ self.addCleanup(ftools.remove_from_file, conf ,data)
+ result = bitbake('readline', ignore_status=True)
+ self.assertEqual(result.status, 0, "Bitbake failed, exit code %s, output %s" % (result.status, result.output))
+ self.assertFalse(os.path.isfile(os.path.join(self.builddir, 'tmp/deploy/licenses/readline/generic_GPLv3')))
+ self.assertTrue(os.path.isfile(os.path.join(self.builddir, 'tmp/deploy/licenses/readline/generic_GPLv2')))
+
+ @testcase(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)))
+
+ @testcase(1425)
+ def test_bbappend_order(self):
+ """ Bitbake should bbappend to recipe in a predictable order """
+ test_recipe = 'ed'
+ test_recipe_summary_before = get_bb_var('SUMMARY', test_recipe)
+ test_recipe_pv = get_bb_var('PV', test_recipe)
+ 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/import-layers/yocto-poky/meta/lib/oeqa/selftest/buildhistory.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/buildhistory.py
new file mode 100644
index 000000000..674da6205
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/buildhistory.py
@@ -0,0 +1,46 @@
+import os
+import re
+import datetime
+
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import bitbake, get_bb_var
+from oeqa.utils.decorators import testcase
+
+
+class BuildhistoryBase(oeSelfTest):
+
+ def config_buildhistory(self, tmp_bh_location=False):
+ if (not 'buildhistory' in get_bb_var('USER_CLASSES')) and (not 'buildhistory' in get_bb_var('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/import-layers/yocto-poky/meta/lib/oeqa/selftest/buildoptions.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/buildoptions.py
new file mode 100644
index 000000000..35d5dfd29
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/buildoptions.py
@@ -0,0 +1,287 @@
+import os
+import re
+import glob as g
+import shutil
+import tempfile
+from oeqa.selftest.base import oeSelfTest
+from oeqa.selftest.buildhistory import BuildhistoryBase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var
+import oeqa.utils.ftools as ftools
+from oeqa.utils.decorators import testcase
+
+class ImageOptionsTests(oeSelfTest):
+
+ @testcase(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 cleanall 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("NOTE: load old install solution for incremental install\nNOTE: old install solution not exist\nNOTE: creating new install solution for incremental install(\n.*)*NOTE: Installing the following packages:.*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("NOTE: load old install solution for incremental install\nNOTE: creating new install solution for incremental install(\n.*)*NOTE: incremental removed:.*openssh-sshd-.*", log_data_removed)
+ self.assertTrue(incremental_removed, msg = "Match failed in:\n%s" % log_data_removed)
+
+ @testcase(925)
+ def test_rm_old_image(self):
+ bitbake("core-image-minimal")
+ deploydir = get_bb_var("DEPLOY_DIR_IMAGE", target="core-image-minimal")
+ imagename = get_bb_var("IMAGE_LINK_NAME", target="core-image-minimal")
+ deploydir_files = os.listdir(deploydir)
+ track_original_files = []
+ for image_file in deploydir_files:
+ if imagename in image_file and os.path.islink(os.path.join(deploydir, image_file)):
+ track_original_files.append(os.path.realpath(os.path.join(deploydir, image_file)))
+ self.write_config("RM_OLD_IMAGE = \"1\"")
+ bitbake("-C rootfs core-image-minimal")
+ deploydir_files = os.listdir(deploydir)
+ remaining_not_expected = [path for path in track_original_files if os.path.basename(path) in deploydir_files]
+ self.assertFalse(remaining_not_expected, msg="\nThe following image files were not removed: %s" % ', '.join(map(str, remaining_not_expected)))
+
+ @testcase(286)
+ def test_ccache_tool(self):
+ bitbake("ccache-native")
+ self.assertTrue(os.path.isfile(os.path.join(get_bb_var('STAGING_BINDIR_NATIVE', 'ccache-native'), "ccache")), msg = "No ccache found under %s" % str(get_bb_var('STAGING_BINDIR_NATIVE', 'ccache-native')))
+ self.write_config('INHERIT += "ccache"')
+ bitbake("m4 -c cleansstate")
+ bitbake("m4 -c compile")
+ self.addCleanup(bitbake, 'ccache-native -ccleansstate')
+ res = runCmd("grep ccache %s" % (os.path.join(get_bb_var("WORKDIR","m4"),"temp/log.do_compile")), ignore_status=True)
+ self.assertEqual(0, res.status, msg="No match for ccache in m4 log.do_compile. For further details: %s" % os.path.join(get_bb_var("WORKDIR","m4"),"temp/log.do_compile"))
+
+ @testcase(1435)
+ def test_read_only_image(self):
+ self.write_config('IMAGE_FEATURES += "read-only-rootfs"')
+ bitbake("core-image-sato")
+ # do_image will fail if there are any pending postinsts
+
+class DiskMonTest(oeSelfTest):
+
+ @testcase(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(oeSelfTest):
+ def getline(self, res, line):
+ for l in res.output.split('\n'):
+ if line in l:
+ return l
+
+ @testcase(927)
+ def test_options_warnqa_errorqa_switch(self):
+ bitbake("xcursor-transparent-theme -ccleansstate")
+
+ if "packages-list" not in get_bb_var("ERROR_QA"):
+ self.write_config("ERROR_QA_append = \" packages-list\"")
+
+ self.write_recipeinc('xcursor-transparent-theme', 'PACKAGES += \"${PN}-dbg\"')
+ res = bitbake("xcursor-transparent-theme", 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"')
+ bitbake("xcursor-transparent-theme -ccleansstate")
+ res = bitbake("xcursor-transparent-theme")
+ 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)
+
+ @testcase(278)
+ def test_sanity_unsafe_script_references(self):
+ self.write_config('WARN_QA_append = " unsafe-references-in-scripts"')
+
+ bitbake("-ccleansstate gzip")
+ res = bitbake("gzip")
+ line = self.getline(res, "QA Issue: gzip")
+ self.assertFalse(line, "WARNING: QA Issue: gzip message is present in bitbake's output and shouldn't be: %s" % res.output)
+
+ self.append_config("""
+do_install_append_pn-gzip () {
+ echo "\n${bindir}/test" >> ${D}${bindir}/zcat
+}
+""")
+ res = bitbake("gzip")
+ line = self.getline(res, "QA Issue: gzip")
+ self.assertTrue(line and line.startswith("WARNING:"), "WARNING: QA Issue: gzip message is not present in bitbake's output: %s" % res.output)
+
+ @testcase(1434)
+ def test_sanity_unsafe_binary_references(self):
+ self.write_config('WARN_QA_append = " unsafe-references-in-binaries"')
+
+ bitbake("-ccleansstate nfs-utils")
+ #res = bitbake("nfs-utils")
+ # FIXME when nfs-utils passes this test
+ #line = self.getline(res, "QA Issue: nfs-utils")
+ #self.assertFalse(line, "WARNING: QA Issue: nfs-utils message is present in bitbake's output and shouldn't be: %s" % res.output)
+
+# self.append_config("""
+#do_install_append_pn-nfs-utils () {
+# echo "\n${bindir}/test" >> ${D}${base_sbindir}/osd_login
+#}
+#""")
+ res = bitbake("nfs-utils")
+ line = self.getline(res, "QA Issue: nfs-utils")
+ self.assertTrue(line and line.startswith("WARNING:"), "WARNING: QA Issue: nfs-utils message is not present in bitbake's output: %s" % res.output)
+
+ @testcase(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):
+
+ @testcase(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.")
+
+ @testcase(294)
+ def test_buildhistory_buildtime_pr_backwards(self):
+ self.add_command_to_tearDown('cleanup-workdir')
+ 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)
+
+ @testcase(1386)
+ def test_buildhistory_does_not_change_signatures(self):
+ """
+ Summary: Ensure that buildhistory does not change signatures
+ Expected: Only 'do_rootfs' task should be rerun
+ Product: oe-core
+ Author: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+ AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+ """
+
+ tmpdir1_name = 'tmpsig1'
+ tmpdir2_name = 'tmpsig2'
+ builddir = os.environ.get('BUILDDIR')
+ tmpdir1 = os.path.join(builddir, tmpdir1_name)
+ tmpdir2 = os.path.join(builddir, tmpdir2_name)
+
+ self.track_for_cleanup(tmpdir1)
+ self.track_for_cleanup(tmpdir2)
+
+ features = 'TMPDIR = "%s"\n' % tmpdir1
+ self.write_config(features)
+ bitbake('core-image-minimal -S none -c rootfs')
+
+ features = 'TMPDIR = "%s"\n' % tmpdir2
+ features += 'INHERIT += "buildhistory"\n'
+ self.write_config(features)
+ bitbake('core-image-minimal -S none -c rootfs')
+
+ def get_files(d):
+ f = []
+ for root, dirs, files in os.walk(d):
+ for name in files:
+ f.append(os.path.join(root, name))
+ return f
+
+ files1 = get_files(tmpdir1 + '/stamps')
+ files2 = get_files(tmpdir2 + '/stamps')
+ files2 = [x.replace(tmpdir2_name, tmpdir1_name) for x in files2]
+
+ f1 = set(files1)
+ f2 = set(files2)
+ sigdiff = f1 - f2
+
+ self.assertEqual(len(sigdiff), 1, 'Expected 1 signature differences. Out: %s' % list(sigdiff))
+
+ unexpected_diff = []
+
+ # No new signatures should appear apart from do_rootfs
+ found_do_rootfs_flag = False
+
+ for sig in sigdiff:
+ if 'do_rootfs' in sig:
+ found_do_rootfs_flag = True
+ else:
+ unexpected_diff.append(sig)
+
+ self.assertTrue(found_do_rootfs_flag, 'Task do_rootfs did not rerun.')
+ self.assertFalse(unexpected_diff, 'Found unexpected signature differences. Out: %s' % unexpected_diff)
+
+
+class BuildImagesTest(oeSelfTest):
+ @testcase(563)
+ def test_directfb(self):
+ """
+ This method is used to test the build of directfb image for arm arch.
+ In essence we build a coreimagedirectfb and test the exitcode of bitbake that in case of success is 0.
+ """
+ self.add_command_to_tearDown('cleanup-workdir')
+ self.write_config("DISTRO_FEATURES_remove = \"x11\"\nDISTRO_FEATURES_append = \" directfb\"\nMACHINE ??= \"qemuarm\"")
+ res = bitbake("core-image-directfb", ignore_status=True)
+ self.assertEqual(res.status, 0, "\ncoreimagedirectfb failed to build. Please check logs for further details.\nbitbake output %s" % res.output)
+
+class ArchiverTest(oeSelfTest):
+ @testcase(926)
+ def test_arch_work_dir_and_export_source(self):
+ """
+ Test for archiving the work directory and exporting the source files.
+ """
+ self.add_command_to_tearDown('cleanup-workdir')
+ 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)
+ pkgs_path = g.glob(str(self.builddir) + "/tmp/deploy/sources/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 tmp/deploy/sources/allarch*/xcursor*")
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/devtool.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/devtool.py
new file mode 100644
index 000000000..132a73d0e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/devtool.py
@@ -0,0 +1,1190 @@
+import unittest
+import os
+import logging
+import re
+import shutil
+import tempfile
+import glob
+
+import oeqa.utils.ftools as ftools
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, create_temp_layer, runqemu
+from oeqa.utils.decorators import testcase
+
+class DevtoolBase(oeSelfTest):
+
+ 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')
+ if isinstance(needvalue, set):
+ value = set(value.split())
+ self.assertEqual(value, needvalue, 'values for %s do not match' % var)
+
+
+ missingvars = {}
+ for var, value in checkvars.iteritems():
+ 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):
+
+ 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')
+
+ 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)
+
+ @testcase(1158)
+ def test_create_workspace(self):
+ # Check preconditions
+ result = runCmd('bitbake-layers show-layers')
+ self.assertTrue('/workspace' 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)
+
+ @testcase(1159)
+ def test_devtool_add(self):
+ # Fetch source
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ url = 'http://www.ivarch.com/programs/sources/pv-1.5.3.tar.bz2'
+ result = runCmd('wget %s' % url, cwd=tempdir)
+ result = runCmd('tar xfv pv-1.5.3.tar.bz2', cwd=tempdir)
+ srcdir = os.path.join(tempdir, 'pv-1.5.3')
+ 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 pv')
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ result = runCmd('devtool add pv %s' % srcdir)
+ self.assertTrue(os.path.exists(os.path.join(self.workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created')
+ # Test devtool status
+ result = runCmd('devtool status')
+ self.assertIn('pv', 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('pv -c cleansstate')
+ # Test devtool build
+ result = runCmd('devtool build pv')
+ installdir = get_bb_var('D', 'pv')
+ self.assertTrue(installdir, 'Could not query installdir variable')
+ bindir = get_bb_var('bindir', 'pv')
+ 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')
+
+ @testcase(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'
+ # 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')
+ 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.assertTrue(os.path.exists(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'] = '${AUTOREV}'
+ checkvars['DEPENDS'] = set(['dbus'])
+ self._test_recipe_contents(recipefile, checkvars, [])
+
+ @testcase(1162)
+ def test_devtool_add_library(self):
+ # We don't have the ability to pick up this dependency automatically yet...
+ bitbake('libusb1')
+ # 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.assertTrue(os.path.exists(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')
+ # Test devtool build
+ result = runCmd('devtool build libftdi')
+ staging_libdir = get_bb_var('STAGING_LIBDIR', 'libftdi')
+ self.assertTrue(staging_libdir, 'Could not query STAGING_LIBDIR 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 = get_bb_var('STAMP', 'libftdi')
+ 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')
+
+ @testcase(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.assertTrue(os.path.exists(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, [])
+
+ @testcase(1161)
+ def test_devtool_add_fetch_git(self):
+ # Fetch source
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ url = 'git://git.yoctoproject.org/libmatchbox'
+ checkrev = '462f0652055d89c648ddd54fd7b03f175c2c6973'
+ testrecipe = 'libmatchbox2'
+ 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.assertTrue(os.path.exists(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.ac')), 'Unable to find configure.ac 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.11+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, 'configure.ac')), 'Unable to find configure.ac 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, [])
+
+ @testcase(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.assertTrue(os.path.exists(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, [])
+
+ @testcase(1164)
+ def test_devtool_modify(self):
+ # Clean up anything in the workdir/sysroot/sstate cache
+ bitbake('mdadm -c cleansstate')
+ # 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 mdadm')
+ result = runCmd('devtool modify mdadm -x %s' % tempdir)
+ self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile')), 'Extracted source could not be found')
+ self.assertTrue(os.path.exists(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)
+ # Check git repo
+ self._check_src_repo(tempdir)
+ # Try building
+ bitbake('mdadm')
+ # Try making (minor) modifications to the source
+ result = runCmd("sed -i 's!^\.TH.*!.TH MDADM 8 \"\" v9.999-custom!' %s" % os.path.join(tempdir, 'mdadm.8.in'))
+ bitbake('mdadm -c package')
+ pkgd = get_bb_var('PKGD', 'mdadm')
+ self.assertTrue(pkgd, 'Could not query PKGD variable')
+ mandir = get_bb_var('mandir', 'mdadm')
+ self.assertTrue(mandir, 'Could not query mandir variable')
+ if mandir[0] == '/':
+ mandir = mandir[1:]
+ with open(os.path.join(pkgd, mandir, 'man8', 'mdadm.8'), 'r') as f:
+ for line in f:
+ if line.startswith('.TH'):
+ self.assertEqual(line.rstrip(), '.TH MDADM 8 "" v9.999-custom', 'man file not modified. man searched file path: %s' % os.path.join(pkgd, mandir, 'man8', 'mdadm.8'))
+ # Test devtool reset
+ stampprefix = get_bb_var('STAMP', 'mdadm')
+ result = runCmd('devtool reset mdadm')
+ result = runCmd('devtool status')
+ self.assertNotIn('mdadm', result.output)
+ self.assertTrue(stampprefix, 'Unable to get STAMP value for recipe mdadm')
+ matches = glob.glob(stampprefix + '*')
+ self.assertFalse(matches, 'Stamp files exist for recipe mdadm that should have been cleaned')
+
+ @testcase(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*')
+ reading = False
+ for line in result.output.splitlines():
+ if line.startswith('=='):
+ reading = True
+ elif reading and not line.startswith(' '):
+ testrecipes.append(line.split(':')[0])
+ 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)
+
+ @testcase(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))
+
+
+ @testcase(1165)
+ def test_devtool_modify_git(self):
+ # Check preconditions
+ testrecipe = 'mkelfimage'
+ 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.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile')), 'Extracted source could not be found')
+ self.assertTrue(os.path.exists(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', 'mkelfimage_*.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)
+
+ @testcase(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.assertTrue(os.path.exists(os.path.join(tempdir, 'configure.ac')), 'Extracted source could not be found')
+ self.assertTrue(os.path.exists(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)
+
+ @testcase(1378)
+ def test_devtool_modify_virtual(self):
+ # Try modifying a virtual recipe
+ virtrecipe = 'virtual/libx11'
+ realrecipe = 'libx11'
+ 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.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile.am')), 'Extracted source could not be found')
+ self.assertTrue(os.path.exists(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
+
+
+ @testcase(1169)
+ def test_devtool_update_recipe(self):
+ # Check preconditions
+ testrecipe = 'minicom'
+ recipefile = get_bb_var('FILE', testrecipe)
+ src_uri = get_bb_var('SRC_URI', testrecipe)
+ 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)
+
+ @testcase(1172)
+ def test_devtool_update_recipe_git(self):
+ # Check preconditions
+ testrecipe = 'mtd-utils'
+ recipefile = get_bb_var('FILE', testrecipe)
+ 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)
+ 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', 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)
+
+ @testcase(1170)
+ def test_devtool_update_recipe_append(self):
+ # Check preconditions
+ testrecipe = 'mdadm'
+ recipefile = get_bb_var('FILE', testrecipe)
+ src_uri = get_bb_var('SRC_URI', testrecipe)
+ 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.assertTrue(os.path.exists(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.assertFalse(os.path.exists(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.assertTrue(os.path.exists(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
+
+ @testcase(1171)
+ def test_devtool_update_recipe_append_git(self):
+ # Check preconditions
+ testrecipe = 'mtd-utils'
+ recipefile = get_bb_var('FILE', testrecipe)
+ 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)
+ 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', 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')
+ 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.assertFalse(os.path.exists(os.path.join(appenddir, testrecipe)), 'Patch directory should not be created')
+
+ # Check bbappend contents
+ result = runCmd('git rev-parse HEAD', cwd=tempsrcdir)
+ expectedlines = ['SRCREV = "%s"\n' % result.output,
+ '\n',
+ 'SRC_URI = "%s"\n' % git_uri,
+ '\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 -m srcrev %s -a %s' % (testrecipe, templayerdir))
+ with open(bbappendfile, 'r') as f:
+ self.assertEqual(expectedlines, 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.assertFalse(os.path.exists(os.path.join(appenddir, testrecipe)), 'Patch directory should not be created')
+ result = runCmd('git rev-parse HEAD', cwd=tempsrcdir)
+ expectedlines = ['SRCREV = "%s"\n' % result.output,
+ '\n',
+ 'SRC_URI = "%s"\n' % git_uri,
+ '\n']
+ with open(bbappendfile, 'r') as f:
+ self.assertEqual(expectedlines, 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.assertFalse(os.path.exists(os.path.join(appenddir, testrecipe)), 'Patch directory should not be created')
+ result = runCmd('git rev-parse HEAD', cwd=tempsrcdir)
+ expectedlines = ['SRCREV = "%s"\n' % result.output,
+ '\n',
+ 'SRC_URI = "%s"\n' % git_uri,
+ '\n']
+ with open(bbappendfile, 'r') as f:
+ self.assertEqual(expectedlines, f.readlines())
+ # Deleting isn't expected to work under these circumstances
+
+ @testcase(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)
+ # 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)
+
+ @testcase(1371)
+ def test_devtool_update_recipe_local_files_2(self):
+ """Check local source files support when oe-local-files is in Git"""
+ testrecipe = 'lzo'
+ 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')
+ 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/acinclude.m4', cwd=tempdir)
+ runCmd('git commit -am "Edit existing file"', cwd=tempdir)
+ runCmd('git rm oe-local-files/run-ptest', 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/acinclude.m4', cwd=tempdir)
+ runCmd('devtool update-recipe %s' % testrecipe)
+ expected_status = [(' M', '.*/%s$' % os.path.basename(recipefile)),
+ (' M', '.*/acinclude.m4$'),
+ (' D', '.*/run-ptest$'),
+ ('??', '.*/new-local$'),
+ ('??', '.*/0001-Add-new-file.patch$')]
+ self._check_repo_status(os.path.dirname(recipefile), expected_status)
+
+ @testcase(1163)
+ def test_devtool_extract(self):
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ # Try devtool extract
+ self.track_for_cleanup(tempdir)
+ self.append_config('PREFERRED_PROVIDER_virtual/make = "remake"')
+ result = runCmd('devtool extract remake %s' % tempdir)
+ self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile.am')), 'Extracted source could not be found')
+ # devtool extract shouldn't create the workspace
+ self.assertFalse(os.path.exists(self.workspacedir))
+ self._check_src_repo(tempdir)
+
+ @testcase(1379)
+ def test_devtool_extract_virtual(self):
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ # Try devtool extract
+ self.track_for_cleanup(tempdir)
+ result = runCmd('devtool extract virtual/libx11 %s' % tempdir)
+ self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile.am')), 'Extracted source could not be found')
+ # devtool extract shouldn't create the workspace
+ self.assertFalse(os.path.exists(self.workspacedir))
+ self._check_src_repo(tempdir)
+
+ @testcase(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)
+
+ @testcase(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
+ installdir = get_bb_var('D', testrecipe)
+ fakerootenv = get_bb_var('FAKEROOTENV', testrecipe)
+ fakerootcmd = get_bb_var('FAKEROOTCMD', testrecipe)
+ 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')
+
+ @testcase(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))
+
+ @testcase(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.assertTrue(os.path.exists(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.assertTrue(os.path.exists(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.assertFalse(os.path.exists(os.path.join(self.workspacedir, 'recipes', recipe)), 'Recipe directory should not exist after resetting')
+
+ @testcase(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.assertTrue(os.path.exists(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.assertFalse(os.path.exists(os.path.join(self.workspacedir, 'recipes', recipe)), 'Recipe directory should not exist after resetting')
+
+ @testcase(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])
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/esdk_prepare.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/esdk_prepare.py
new file mode 100755
index 000000000..1b36a0d68
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/esdk_prepare.py
@@ -0,0 +1,75 @@
+#!/usr/bin/env python
+
+import shutil, tempfile
+import sys
+import os
+import imp
+import unittest
+try:
+ from oeqa.utils.commands import get_bb_var
+except ImportError:
+ pass
+
+# module under test
+module_file_name = "ext-sdk-prepare.py"
+module_path = ""
+
+class ExtSdkPrepareTest(unittest.TestCase):
+
+ """ unit test for fix for Yocto #9019 """
+
+ @classmethod
+ def setUpClass(self):
+ # copy module under test to temp dir
+ self.test_dir = tempfile.mkdtemp()
+ module_dest_path = os.path.join(self.test_dir, module_file_name)
+ try:
+ shutil.copy(module_path, self.test_dir)
+ # load module under test
+ self.test_mod = imp.load_source("", module_dest_path)
+ except:
+ print "error: unable to copy or load %s [src: %s, dst: %s]" % \
+ (module_file_name, module_path, module_dest_path)
+ sys.exit(1)
+
+ def test_prepare_unexpected(self):
+ # test data
+ # note: pathnames have been truncated from the actual bitbake
+ # output as they are not important for the test.
+ test_data = (
+ 'NOTE: Running noexec task 9 of 6539 (ID: 28, quilt/quilt-native_0.64.bb, do_build)\n'
+ 'NOTE: Running task 10 of 6539 (ID: 29, quilt/quilt-native_0.64.bb, do_package)\n'
+ 'NOTE: Running task 11 of 6539 (ID: 30, quilt/quilt-native_0.64.bb, do_rm_work)\n'
+ 'NOTE: Running noexec task 6402 of 6539 (ID: 1, images/core-image-sato.bb, do_patch)\n'
+ 'NOTE: Running task 6538 of 6539 (ID: 14, images/core-image-sato.bb, do_rm_work)\n'
+ )
+ # expected warning output
+ expected = [ (' task 10 of 6539 (ID: 29, quilt/quilt-native_0.64.bb, do_package)') ]
+ # recipe to test, matching test input data
+ recipes = [ "core-image-sato.bb" ]
+
+ # run the test
+ output = self.test_mod.check_unexpected(test_data, recipes)
+ self.assertEqual(output, expected)
+
+ @classmethod
+ def tearDownClass(self):
+ # remove temp dir
+ shutil.rmtree(self.test_dir)
+
+if __name__ == '__main__':
+ # running from command line - i.e., not under oe-selftest
+ # directory containing module under test comes from command line
+ if len(sys.argv) == 2 and os.path.isdir(sys.argv[1]):
+ module_path = os.path.join(sys.argv[1], module_file_name)
+ suite = unittest.TestLoader().loadTestsFromTestCase(ExtSdkPrepareTest)
+ unittest.TextTestRunner().run(suite)
+ else:
+ progname = os.path.basename(sys.argv[0])
+ print "%s: missing directory path" % progname
+ print "usage: %s /path/to/directory-of(ext-sdk-prepare.py)" % progname
+ sys.exit(1)
+else:
+ # running under oe-selftest
+ # determine module source dir from COREBASE and expected path
+ module_path = os.path.join(get_bb_var("COREBASE"), "meta", "files", module_file_name)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/imagefeatures.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/imagefeatures.py
new file mode 100644
index 000000000..8a53899c7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/imagefeatures.py
@@ -0,0 +1,100 @@
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu
+from oeqa.utils.decorators import testcase
+from oeqa.utils.sshcontrol import SSHControl
+import os
+import sys
+import logging
+
+class ImageFeatures(oeSelfTest):
+
+ test_user = 'tester'
+ root_user = 'root'
+
+ @testcase(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))
+
+ @testcase(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)
+
+
+ @testcase(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')
+
+ @testcase(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>
+ """
+
+ features = 'DISTRO_FEATURES_append = " wayland"\n'
+ features += 'CORE_IMAGE_EXTRA_INSTALL += "wayland weston"'
+ self.write_config(features)
+
+ # Build a core-image-weston
+ bitbake('core-image-weston')
+
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/layerappend.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/layerappend.py
new file mode 100644
index 000000000..4de5034a9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/layerappend.py
@@ -0,0 +1,99 @@
+import unittest
+import os
+import logging
+import re
+
+from oeqa.selftest.base import oeSelfTest
+from oeqa.selftest.buildhistory import BuildhistoryBase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var
+import oeqa.utils.ftools as ftools
+from oeqa.utils.decorators import testcase
+
+class LayerAppendTests(oeSelfTest):
+ 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)
+
+ @testcase(1196)
+ def test_layer_appends(self):
+ corebase = get_bb_var("COREBASE")
+ stagingdir = get_bb_var("STAGING_DIR_TARGET")
+ 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)
+ 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/import-layers/yocto-poky/meta/lib/oeqa/selftest/lic-checksum.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/lic-checksum.py
new file mode 100644
index 000000000..cac6d8445
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/lic-checksum.py
@@ -0,0 +1,31 @@
+import os
+import tempfile
+
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import bitbake
+from oeqa.utils import CommandError
+from oeqa.utils.decorators import testcase
+
+class LicenseTests(oeSelfTest):
+
+ # Verify that changing a license file that has an absolute path causes
+ # the license qa to fail due to a mismatched md5sum.
+ @testcase(1197)
+ def test_nonmatching_checksum(self):
+ bitbake_cmd = '-c configure 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"')
+ self.append_recipeinc('emptytest', 'LIC_FILES_CHKSUM = "file://%s;md5=d41d8cd98f00b204e9800998ecf8427e"' % lic_path)
+ result = bitbake(bitbake_cmd)
+
+ with open(lic_path, "w") as f:
+ f.write("data")
+
+ result = bitbake(bitbake_cmd, ignore_status=True)
+ if error_msg not in result.output:
+ raise AssertionError(result.output)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/manifest.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/manifest.py
new file mode 100644
index 000000000..44d0404c5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/manifest.py
@@ -0,0 +1,165 @@
+import unittest
+import os
+
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import get_bb_var, bitbake
+from oeqa.utils.decorators import testcase
+
+class ManifestEntry:
+ '''A manifest item of a collection able to list missing packages'''
+ def __init__(self, entry):
+ self.file = entry
+ self.missing = []
+
+class VerifyManifest(oeSelfTest):
+ '''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.log.debug("{}: looking for {}"\
+ .format(self.classname, manifest_entry))
+ if not os.path.isfile(manifest_entry):
+ manifest_errors.append(manifest_entry)
+ self.log.debug("{}: {} not found"\
+ .format(self.classname, manifest_entry))
+ except OSError as e:
+ self.log.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.log.debug("{}: {} points to {} when target = {}"\
+ .format(self.classname, bb_var, directory, target))
+ raise OSError
+ return directory
+
+ @classmethod
+ def setUpClass(self):
+
+ self.buildtarget = 'core-image-minimal'
+ self.classname = 'VerifyManifest'
+
+ self.log.info("{}: doing bitbake {} as a prerequisite of the test"\
+ .format(self.classname, self.buildtarget))
+ if bitbake(self.buildtarget).status:
+ self.log.debug("{} Failed to setup {}"\
+ .format(self.classname, self.buildtarget))
+ unittest.SkipTest("{}: Cannot setup testing scenario"\
+ .format(self.classname))
+
+ @testcase(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.log.debug("{}: doing bitbake {} as a prerequisite of the test"\
+ .format(self.classname, bbargs))
+ if bitbake(bbargs).status:
+ self.log.debug("{} Failed to bitbake {}"\
+ .format(self.classname, bbargs))
+ unittest.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():
+ mfilename[k] = "{}-toolchain-{}.{}.manifest".format(
+ get_bb_var("SDK_NAME", self.buildtarget),
+ get_bb_var("SDK_VERSION", self.buildtarget),
+ k)
+ mpath[k] = os.path.join(mdir, mfilename[k])
+ if not os.path.isfile(mpath[k]):
+ self.log.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.log.debug("{}: {} does not exist".format(
+ self.classname, reverse_dir[k]))
+ raise IOError
+ except OSError:
+ raise unittest.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.log.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.log.debug(logmsg)
+ self.log.info(msg)
+ self.fail(logmsg)
+
+ @testcase(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 unittest.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.log.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.log.debug(logmsg)
+ self.log.info(msg)
+ self.fail(logmsg)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/oescripts.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/oescripts.py
new file mode 100644
index 000000000..31cd50809
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/oescripts.py
@@ -0,0 +1,54 @@
+import datetime
+import unittest
+import os
+import re
+import shutil
+
+import oeqa.utils.ftools as ftools
+from oeqa.selftest.base import oeSelfTest
+from oeqa.selftest.buildhistory import BuildhistoryBase
+from oeqa.utils.commands import Command, runCmd, bitbake, get_bb_var, get_test_layer
+from oeqa.utils.decorators import testcase
+
+class TestScripts(oeSelfTest):
+
+ @testcase(300)
+ def test_cleanup_workdir(self):
+ path = os.path.dirname(get_bb_var('WORKDIR', 'gzip'))
+ old_version_recipe = os.path.join(get_bb_var('COREBASE'), 'meta/recipes-extended/gzip/gzip_1.3.12.bb')
+ old_version = '1.3.12'
+ bitbake("-ccleansstate gzip")
+ bitbake("-ccleansstate -b %s" % old_version_recipe)
+ if os.path.exists(get_bb_var('WORKDIR', "-b %s" % old_version_recipe)):
+ shutil.rmtree(get_bb_var('WORKDIR', "-b %s" % old_version_recipe))
+ if os.path.exists(get_bb_var('WORKDIR', 'gzip')):
+ shutil.rmtree(get_bb_var('WORKDIR', 'gzip'))
+
+ if os.path.exists(path):
+ initial_contents = os.listdir(path)
+ else:
+ initial_contents = []
+
+ bitbake('gzip')
+ intermediary_contents = os.listdir(path)
+ bitbake("-b %s" % old_version_recipe)
+ runCmd('cleanup-workdir')
+ remaining_contents = os.listdir(path)
+
+ expected_contents = [x for x in intermediary_contents if x not in initial_contents]
+ remaining_not_expected = [x for x in remaining_contents if x not in expected_contents]
+ self.assertFalse(remaining_not_expected, msg="Not all necessary content has been deleted from %s: %s" % (path, ', '.join(map(str, remaining_not_expected))))
+ expected_not_remaining = [x for x in expected_contents if x not in remaining_contents]
+ self.assertFalse(expected_not_remaining, msg="The script removed extra contents from %s: %s" % (path, ', '.join(map(str, expected_not_remaining))))
+
+class BuildhistoryDiffTests(BuildhistoryBase):
+
+ @testcase(295)
+ def test_buildhistory_diff(self):
+ self.add_command_to_tearDown('cleanup-workdir')
+ 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/import-layers/yocto-poky/meta/lib/oeqa/selftest/pkgdata.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/pkgdata.py
new file mode 100644
index 000000000..138b03aad
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/pkgdata.py
@@ -0,0 +1,226 @@
+import unittest
+import os
+import tempfile
+import logging
+import fnmatch
+
+import oeqa.utils.ftools as ftools
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var
+from oeqa.utils.decorators import testcase
+
+class OePkgdataUtilTests(oeSelfTest):
+
+ @classmethod
+ def setUpClass(cls):
+ # Ensure we have the right data in pkgdata
+ logger = logging.getLogger("selftest")
+ logger.info('Running bitbake to generate pkgdata')
+ bitbake('glibc busybox zlib bash')
+
+ @testcase(1203)
+ def test_lookup_pkg(self):
+ # Forward tests
+ result = runCmd('oe-pkgdata-util lookup-pkg "glibc busybox"')
+ self.assertEqual(result.output, 'libc6\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 "libc6 busybox"')
+ self.assertEqual(result.output, 'glibc\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')
+
+ @testcase(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 PKGSIZE bash')
+ pkgsize = int(result.output.strip())
+ self.assertGreater(pkgsize, 1, "Size should be greater than 1. %s" % result.output)
+
+ @testcase(1198)
+ def test_find_path(self):
+ result = runCmd('oe-pkgdata-util find-path /lib/libc.so.6')
+ self.assertEqual(result.output, 'glibc: /lib/libc.so.6')
+ result = runCmd('oe-pkgdata-util find-path /bin/bash')
+ self.assertEqual(result.output, 'bash: /bin/bash')
+ 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')
+
+ @testcase(1204)
+ def test_lookup_recipe(self):
+ result = runCmd('oe-pkgdata-util lookup-recipe "libc6-staticdev busybox"')
+ self.assertEqual(result.output, 'glibc\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')
+
+ @testcase(1202)
+ def test_list_pkgs(self):
+ # No arguments
+ result = runCmd('oe-pkgdata-util list-pkgs')
+ pkglist = result.output.split()
+ self.assertIn('glibc-utils', 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('libc6-utils', pkglist, "Listed packages: %s" % result.output)
+ 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)
+
+ @testcase(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
+ base_libdir = get_bb_var('base_libdir')
+ libdir = get_bb_var('libdir')
+ includedir = get_bb_var('includedir')
+ mandir = get_bb_var('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', files.keys(), "listed pkgs. files: %s" %result.output)
+ self.assertIn('zlib-doc', 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', files.keys(), "listed pkgs. files: %s" %result.output)
+ self.assertIn('libz-dev', 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', files.keys(), "listed pkgs. files: %s" %result.output)
+ self.assertIn('zlib-doc', files.keys(), "listed pkgs. files: %s" %result.output)
+ self.assertIn('zlib-dev', files.keys(), "listed pkgs. files: %s" %result.output)
+ self.assertIn('zlib-staticdev', files.keys(), "listed pkgs. files: %s" %result.output)
+ self.assertIn('zlib', files.keys(), "listed pkgs. files: %s" %result.output)
+ self.assertNotIn('zlib-locale', 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', files.keys(), "listed pkgs. files: %s" %result.output)
+ self.assertIn('libz-doc', files.keys(), "listed pkgs. files: %s" %result.output)
+ self.assertIn('libz-dev', files.keys(), "listed pkgs. files: %s" %result.output)
+ self.assertIn('libz-staticdev', files.keys(), "listed pkgs. files: %s" %result.output)
+ self.assertIn('libz1', files.keys(), "listed pkgs. files: %s" %result.output)
+ self.assertNotIn('libz-locale', 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', files.keys(), "listed pkgs. files: %s" %result.output)
+ self.assertIn('zlib-doc', files.keys(), "listed pkgs. files: %s" %result.output)
+ self.assertIn('zlib-dev', files.keys(), "listed pkgs. files: %s" %result.output)
+ self.assertIn('zlib-staticdev', files.keys(), "listed pkgs. files: %s" %result.output)
+ self.assertIn('zlib', files.keys(), "listed pkgs. files: %s" %result.output)
+ self.assertIn('zlib-locale', 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', files.keys(), "listed pkgs. files: %s" %result.output)
+ self.assertIn('libz-doc', files.keys(), "listed pkgs. files: %s" %result.output)
+ self.assertIn('libz-dev', files.keys(), "listed pkgs. files: %s" %result.output)
+ self.assertIn('libz-staticdev', files.keys(), "listed pkgs. files: %s" %result.output)
+ self.assertIn('libz1', files.keys(), "listed pkgs. files: %s" %result.output)
+ self.assertIn('libz-locale', 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'])
+
+ @testcase(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('libc6\n')
+ f.write('libz1\n')
+ f.write('busybox\n')
+ result = runCmd('oe-pkgdata-util glob %s "*-dev"' % pkglistfile)
+ desiredresult = ['libc6-dev', '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)
+
+ @testcase(1206)
+ def test_specify_pkgdatadir(self):
+ result = runCmd('oe-pkgdata-util -p %s lookup-pkg glibc' % get_bb_var('PKGDATA_DIR'))
+ self.assertEqual(result.output, 'libc6')
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/prservice.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/prservice.py
new file mode 100644
index 000000000..1b9a510fd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/prservice.py
@@ -0,0 +1,132 @@
+import unittest
+import os
+import logging
+import re
+import shutil
+import datetime
+
+import oeqa.utils.ftools as ftools
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var
+from oeqa.utils.decorators import testcase
+from oeqa.utils.network import get_free_port
+
+class BitbakePrTests(oeSelfTest):
+
+ def get_pr_version(self, package_name):
+ pkgdata_dir = get_bb_var('PKGDATA_DIR')
+ package_data_file = os.path.join(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)
+ bitbake("-ccleansstate %s" % package_name)
+ res = bitbake(package_name, ignore_status=True)
+ self.delete_recipeinc(package_name)
+ self.assertEqual(res.status, 0, msg=res.output)
+ self.assertTrue("NOTE: Started PRServer with DBfile" in res.output, 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)
+
+ bitbake("-ccleansstate %s" % package_name)
+ 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)
+
+ 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)
+
+ bitbake("-ccleansstate %s" % package_name)
+ self.assertTrue(pr_2 - pr_1 == 1, "Step between same pkg. revision is greater than 1")
+
+ @testcase(930)
+ def test_import_export_replace_db(self):
+ self.run_test_pr_export_import('m4')
+
+ @testcase(931)
+ def test_import_export_override_db(self):
+ self.run_test_pr_export_import('m4', replace_current_db=False)
+
+ @testcase(932)
+ def test_pr_service_rpm_arch_dep(self):
+ self.run_test_pr_service('m4', 'rpm', 'do_package')
+
+ @testcase(934)
+ def test_pr_service_deb_arch_dep(self):
+ self.run_test_pr_service('m4', 'deb', 'do_package')
+
+ @testcase(933)
+ def test_pr_service_ipk_arch_dep(self):
+ self.run_test_pr_service('m4', 'ipk', 'do_package')
+
+ @testcase(935)
+ def test_pr_service_rpm_arch_indep(self):
+ self.run_test_pr_service('xcursor-transparent-theme', 'rpm', 'do_package')
+
+ @testcase(937)
+ def test_pr_service_deb_arch_indep(self):
+ self.run_test_pr_service('xcursor-transparent-theme', 'deb', 'do_package')
+
+ @testcase(936)
+ def test_pr_service_ipk_arch_indep(self):
+ self.run_test_pr_service('xcursor-transparent-theme', 'ipk', 'do_package')
+
+ @testcase(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/import-layers/yocto-poky/meta/lib/oeqa/selftest/recipetool.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/recipetool.py
new file mode 100644
index 000000000..e72911b0a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/recipetool.py
@@ -0,0 +1,605 @@
+import os
+import logging
+import tempfile
+import urlparse
+
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, create_temp_layer
+from oeqa.utils.decorators import testcase
+from oeqa.selftest 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):
+ 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)
+
+ 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):
+ # Ensure we have the right data in shlibs/pkgdata
+ logger = logging.getLogger("selftest")
+ logger.info('Running bitbake to generate pkgdata')
+ bitbake('-c packagedata base-files coreutils busybox selftest-recipetool-appendfile')
+
+ @classmethod
+ def tearDownClass(cls):
+ # Shouldn't leave any traces of this artificial recipe behind
+ bitbake('-c cleansstate selftest-recipetool-appendfile')
+
+ 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)
+
+ @testcase(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)
+
+ @testcase(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'])
+
+ @testcase(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'])
+ corebase = get_bb_var('COREBASE')
+ # Need a test file - should be executable
+ testfile2 = os.path.join(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)
+
+ @testcase(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)
+
+ @testcase(1173)
+ def test_recipetool_appendfile_add(self):
+ corebase = get_bb_var('COREBASE')
+ # 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(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])
+
+ @testcase(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)
+
+ @testcase(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)
+
+ @testcase(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)
+
+ @testcase(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)
+
+ @testcase(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)
+
+ @testcase(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)
+
+ @testcase(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)
+
+ @testcase(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)
+
+ @testcase(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)
+
+ @testcase(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 line.startswith('WARNING: '):
+ 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)
+
+ @testcase(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)
+
+ @testcase(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)
+
+ @testcase(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'])
+
+ @testcase(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))
+
+ @testcase(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')
+
+ @testcase(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.8.7.bb')
+ srcuri = 'https://fedorahosted.org/releases/l/o/logrotate/logrotate-3.8.7.tar.gz'
+ 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=18810669f13b87348459e611d31ab760'
+ checkvars['SRC_URI'] = 'https://fedorahosted.org/releases/l/o/logrotate/logrotate-${PV}.tar.gz'
+ checkvars['SRC_URI[md5sum]'] = '99e08503ef24c3e2e3ff74cc5f3be213'
+ checkvars['SRC_URI[sha256sum]'] = 'f6ba691f40e30e640efa2752c1f9499a3f9738257660994de70a45fe00d12b64'
+ self._test_recipe_contents(recipefile, checkvars, [])
+
+ @testcase(1194)
+ def test_recipetool_create_git(self):
+ # Ensure we have the right data in shlibs/pkgdata
+ bitbake('libpng pango libx11 libxext jpeg libxsettings-client 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 %s %s -x %s' % (recipefile, srcuri, 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', 'libxsettings-client', 'libxext', 'pango'])
+ inherits = ['autotools', 'pkgconfig']
+ self._test_recipe_contents(recipefile, checkvars, inherits)
+
+ @testcase(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)
+
+ @testcase(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)
+
+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 = urlparse.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)
+
+ src_uri = get_bb_var('SRC_URI', testrecipe).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 = get_bb_var('FILE', testrecipe)
+ bbappendfile = self._check_bbappend(testrecipe, recipefile, self.templayerdir)
+ filesdir = os.path.join(os.path.dirname(bbappendfile), testrecipe)
+ filesextrapaths = get_bb_var('FILESEXTRAPATHS', testrecipe).split(':')
+ self.assertIn(filesdir, filesextrapaths)
+
+
+class RecipetoolAppendsrcTests(RecipetoolAppendsrcBase):
+
+ @testcase(1273)
+ def test_recipetool_appendsrcfile_basic(self):
+ self._test_appendsrcfile('base-files', 'a-file')
+
+ @testcase(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)
+
+ @testcase(1281)
+ def test_recipetool_appendsrcfile_subdir_basic(self):
+ self._test_appendsrcfile('base-files', 'a-file', 'tmp')
+
+ @testcase(1282)
+ def test_recipetool_appendsrcfile_subdir_basic_dirdest(self):
+ self._test_appendsrcfile('base-files', destdir='tmp')
+
+ @testcase(1280)
+ def test_recipetool_appendsrcfile_srcdir_basic(self):
+ testrecipe = 'bash'
+ srcdir = get_bb_var('S', testrecipe)
+ workdir = get_bb_var('WORKDIR', testrecipe)
+ subdir = os.path.relpath(srcdir, workdir)
+ self._test_appendsrcfile(testrecipe, 'a-file', srcdir=subdir)
+
+ @testcase(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)
+
+ @testcase(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))
+
+ @testcase(1277)
+ def test_recipetool_appendsrcfile_replace_file_srcdir(self):
+ testrecipe = 'bash'
+ filepath = 'Makefile.in'
+ srcdir = get_bb_var('S', testrecipe)
+ workdir = get_bb_var('WORKDIR', testrecipe)
+ 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())
+
+ @testcase(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')
+
+ @testcase(1279)
+ def test_recipetool_appendsrcfiles_basic_subdir(self):
+ self.test_recipetool_appendsrcfiles_basic(destdir='testdir')
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/signing.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/signing.py
new file mode 100644
index 000000000..1babca07d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/signing.py
@@ -0,0 +1,186 @@
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var
+import os
+import glob
+import re
+import shutil
+import tempfile
+from oeqa.utils.decorators import testcase
+from oeqa.utils.ftools import write_file
+
+
+class Signing(oeSelfTest):
+
+ gpg_dir = ""
+ pub_key_name = 'key.pub'
+ secret_key_name = 'key.secret'
+
+ @classmethod
+ def setUpClass(cls):
+ # Import the gpg keys
+
+ cls.gpg_dir = os.path.join(cls.testlayer_path, 'files/signing/')
+
+ # key.secret key.pub are located in gpg_dir
+ pub_key_location = cls.gpg_dir + cls.pub_key_name
+ secret_key_location = cls.gpg_dir + cls.secret_key_name
+ runCmd('gpg --homedir %s --import %s %s' % (cls.gpg_dir, pub_key_location, secret_key_location))
+
+ @classmethod
+ def tearDownClass(cls):
+ # Delete the files generated by 'gpg --import'
+
+ gpg_files = glob.glob(cls.gpg_dir + '*.gpg*')
+ random_seed_file = cls.gpg_dir + 'random_seed'
+ gpg_files.append(random_seed_file)
+
+ for gpg_file in gpg_files:
+ runCmd('rm -f ' + gpg_file)
+
+ @testcase(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
+ Product: oe-core
+ Author: Daniel Istrate <daniel.alexandrux.istrate@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 += 'RPM_GPG_PUBKEY = "%s%s"\n' % (self.gpg_dir, self.pub_key_name)
+ feature += 'GPG_PATH = "%s"\n' % self.gpg_dir
+
+ self.write_config(feature)
+
+ bitbake('-c cleansstate %s' % test_recipe)
+ bitbake(test_recipe)
+ self.add_command_to_tearDown('bitbake -c clean %s' % test_recipe)
+
+ pkgdatadir = get_bb_var('PKGDATA_DIR', test_recipe)
+ 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 = get_bb_var('DEPLOY_DIR_RPM', test_recipe)
+ package_arch = get_bb_var('PACKAGE_ARCH', test_recipe).replace('-', '_')
+ staging_bindir_native = get_bb_var('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/rpm --define "_dbpath %s" --import %s%s' %
+ (staging_bindir_native, rpmdb, self.gpg_dir, self.pub_key_name))
+
+ ret = runCmd('%s/rpm --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('rsa sha1 md5 OK', ret.output, 'Package signed incorrectly.')
+ shutil.rmtree(rpmdb)
+
+ @testcase(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('bitbake -c cleansstate %s' % test_recipe)
+ self.add_command_to_tearDown('rm -rf %s' % sstatedir)
+
+ # Determine the pub key signature
+ ret = runCmd('gpg --homedir %s --list-keys' % self.gpg_dir)
+ pub_key = re.search(r'^pub\s+\S+/(\S+)\s+', ret.output, re.M)
+ self.assertIsNotNone(pub_key, 'Failed to determine the public key signature.')
+ pub_key = pub_key.group(1)
+
+ feature = 'SSTATE_SIG_KEY ?= "%s"\n' % pub_key
+ 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
+
+ self.write_config(feature)
+
+ bitbake('-c cleansstate %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(oeSelfTest):
+
+ @testcase(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/import-layers/yocto-poky/meta/lib/oeqa/selftest/sstate.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/sstate.py
new file mode 100644
index 000000000..598972443
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/sstate.py
@@ -0,0 +1,53 @@
+import datetime
+import unittest
+import os
+import re
+import shutil
+
+import oeqa.utils.ftools as ftools
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer
+
+
+class SStateBase(oeSelfTest):
+
+ def setUpLocal(self):
+ self.temp_sstate_location = None
+ self.sstate_path = get_bb_var('SSTATE_DIR')
+ self.distro = get_bb_var('NATIVELSBSTRING')
+ self.distro_specific_sstate = os.path.join(self.sstate_path, self.distro)
+
+ # 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)
+ self.sstate_path = get_bb_var('SSTATE_DIR')
+ self.distro = get_bb_var('NATIVELSBSTRING')
+ self.distro_specific_sstate = os.path.join(self.sstate_path, self.distro)
+
+ 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.distro, 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/import-layers/yocto-poky/meta/lib/oeqa/selftest/sstatetests.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/sstatetests.py
new file mode 100644
index 000000000..acaf405ac
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/sstatetests.py
@@ -0,0 +1,461 @@
+import datetime
+import unittest
+import os
+import re
+import shutil
+import glob
+import subprocess
+
+import oeqa.utils.ftools as ftools
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer
+from oeqa.selftest.sstate import SStateBase
+from oeqa.utils.decorators import testcase
+
+class SStateTests(SStateBase):
+
+ # 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)
+
+ 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)))
+
+ @testcase(975)
+ def test_sstate_creation_distro_specific_pass(self):
+ targetarch = get_bb_var('TUNE_ARCH')
+ self.run_test_sstate_creation(['binutils-cross-'+ targetarch, 'binutils-native'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True)
+
+ @testcase(1374)
+ def test_sstate_creation_distro_specific_fail(self):
+ targetarch = get_bb_var('TUNE_ARCH')
+ self.run_test_sstate_creation(['binutils-cross-'+ targetarch, 'binutils-native'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True, should_pass=False)
+
+ @testcase(976)
+ def test_sstate_creation_distro_nonspecific_pass(self):
+ self.run_test_sstate_creation(['glibc-initial'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True)
+
+ @testcase(1375)
+ def test_sstate_creation_distro_nonspecific_fail(self):
+ self.run_test_sstate_creation(['glibc-initial'], 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)
+
+ 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)))
+
+ @testcase(977)
+ def test_cleansstate_task_distro_specific_nonspecific(self):
+ targetarch = get_bb_var('TUNE_ARCH')
+ self.run_test_cleansstate_task(['binutils-cross-' + targetarch, 'binutils-native', 'glibc-initial'], distro_specific=True, distro_nonspecific=True, temp_sstate_location=True)
+
+ @testcase(1376)
+ def test_cleansstate_task_distro_nonspecific(self):
+ self.run_test_cleansstate_task(['glibc-initial'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True)
+
+ @testcase(1377)
+ def test_cleansstate_task_distro_specific(self):
+ targetarch = get_bb_var('TUNE_ARCH')
+ self.run_test_cleansstate_task(['binutils-cross-'+ targetarch, 'binutils-native', 'glibc-initial'], 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)
+
+ 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)))
+
+ @testcase(175)
+ def test_rebuild_distro_specific_sstate_cross_native_targets(self):
+ targetarch = get_bb_var('TUNE_ARCH')
+ self.run_test_rebuild_distro_specific_sstate(['binutils-cross-' + targetarch, 'binutils-native'], temp_sstate_location=True)
+
+ @testcase(1372)
+ def test_rebuild_distro_specific_sstate_cross_target(self):
+ targetarch = get_bb_var('TUNE_ARCH')
+ self.run_test_rebuild_distro_specific_sstate(['binutils-cross-' + targetarch], temp_sstate_location=True)
+
+ @testcase(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.
+ if ('buildhistory' in get_bb_var('USER_CLASSES')) or ('buildhistory' in get_bb_var('INHERIT')):
+ remove_errors_config = 'ERROR_QA_remove = "version-going-backwards"'
+ self.append_config(remove_errors_config)
+
+ # 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)))
+
+ @testcase(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'])
+
+ @testcase(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'])
+
+ @testcase(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'])
+
+ @testcase(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'])
+
+ @testcase(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.
+ """
+
+ topdir = get_bb_var('TOPDIR')
+ targetvendor = get_bb_var('TARGET_VENDOR')
+ self.write_config("""
+MACHINE = "qemux86"
+TMPDIR = "${TOPDIR}/tmp-sstatesamehash"
+BUILD_ARCH = "x86_64"
+BUILD_OS = "linux"
+SDKMACHINE = "x86_64"
+""")
+ self.track_for_cleanup(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"
+""")
+ self.track_for_cleanup(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(topdir + "/tmp-sstatesamehash/stamps/")
+ files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/")
+ files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash").replace("i686-linux", "x86_64-linux").replace("i686" + targetvendor + "-linux", "x86_64" + targetvendor + "-linux", ) for x in files2]
+ self.maxDiff = None
+ self.assertItemsEqual(files1, files2)
+
+
+ @testcase(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.
+ """
+
+ topdir = get_bb_var('TOPDIR')
+ self.write_config("""
+TMPDIR = \"${TOPDIR}/tmp-sstatesamehash\"
+NATIVELSBSTRING = \"DistroA\"
+""")
+ self.track_for_cleanup(topdir + "/tmp-sstatesamehash")
+ bitbake("core-image-sato -S none")
+ self.write_config("""
+TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\"
+NATIVELSBSTRING = \"DistroB\"
+""")
+ self.track_for_cleanup(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(topdir + "/tmp-sstatesamehash/stamps/")
+ files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/")
+ files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash") for x in files2]
+ self.maxDiff = None
+ self.assertItemsEqual(files1, files2)
+
+ @testcase(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.
+ """
+
+ topdir = get_bb_var('TOPDIR')
+ targetos = get_bb_var('TARGET_OS')
+ targetvendor = get_bb_var('TARGET_VENDOR')
+ self.write_config("""
+TMPDIR = \"${TOPDIR}/tmp-sstatesamehash\"
+MACHINE = \"qemux86\"
+""")
+ self.track_for_cleanup(topdir + "/tmp-sstatesamehash")
+ bitbake("world meta-toolchain -S none")
+ self.write_config("""
+TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\"
+MACHINE = \"qemuarm\"
+""")
+ self.track_for_cleanup(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(topdir + "/tmp-sstatesamehash/stamps/all" + targetvendor + "-" + targetos)
+ files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/all" + targetvendor + "-" + targetos)
+ self.maxDiff = None
+ self.assertEqual(files1, files2)
+
+ nativesdkdir = os.path.basename(glob.glob(topdir + "/tmp-sstatesamehash/stamps/*-nativesdk*-linux")[0])
+
+ files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/" + nativesdkdir)
+ files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/" + nativesdkdir)
+ self.maxDiff = None
+ self.assertEqual(files1, files2)
+
+ @testcase(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.
+ """
+
+ topdir = get_bb_var('TOPDIR')
+ targetos = get_bb_var('TARGET_OS')
+ targetvendor = get_bb_var('TARGET_VENDOR')
+ 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(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(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(topdir + "/tmp-sstatesamehash/stamps")
+ files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps")
+ files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash") for x in files2]
+ self.maxDiff = None
+ self.assertItemsEqual(files1, files2)
+
+
+ def test_sstate_noop_samesigs(self):
+ """
+ The sstate checksums of two builds with these variables changed or
+ classes inherits should be the same.
+ """
+
+ topdir = get_bb_var('TOPDIR')
+ targetvendor = get_bb_var('TARGET_VENDOR')
+ self.write_config("""
+TMPDIR = "${TOPDIR}/tmp-sstatesamehash"
+BB_NUMBER_THREADS = "1"
+PARALLEL_MAKE = "-j 1"
+DL_DIR = "${TOPDIR}/download1"
+TIME = "111111"
+DATE = "20161111"
+INHERIT_remove = "buildstats-summary buildhistory"
+""")
+ self.track_for_cleanup(topdir + "/tmp-sstatesamehash")
+ bitbake("world meta-toolchain -S none")
+ self.write_config("""
+TMPDIR = "${TOPDIR}/tmp-sstatesamehash2"
+BB_NUMBER_THREADS = "2"
+PARALLEL_MAKE = "-j 2"
+DL_DIR = "${TOPDIR}/download2"
+TIME = "222222"
+DATE = "20161212"
+INHERIT += "buildstats-summary buildhistory"
+""")
+ self.track_for_cleanup(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:
+ 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
+ files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/")
+ files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/")
+ # Remove items that are identical in both sets
+ for k,v in files1.viewitems() & files2.viewitems():
+ del files1[k]
+ del files2[k]
+ if not files1 and not files2:
+ # No changes, so we're done
+ return
+
+ for k in files1.viewkeys() | files2.viewkeys():
+ if k in files1 and k in files2:
+ print "%s differs:" % k
+ print subprocess.check_output(("bitbake-diffsigs",
+ topdir + "/tmp-sstatesamehash/stamps/" + k + "." + files1[k],
+ topdir + "/tmp-sstatesamehash2/stamps/" + k + "." + files2[k]))
+ 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"
+ self.fail("sstate hashes not identical.")
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/wic.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/wic.py
new file mode 100644
index 000000000..a569fbf74
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/wic.py
@@ -0,0 +1,278 @@
+#!/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
+
+from glob import glob
+from shutil import rmtree
+
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu
+from oeqa.utils.decorators import testcase
+
+
+class Wic(oeSelfTest):
+ """Wic test class."""
+
+ resultdir = "/var/tmp/wic/build/"
+ image_is_ready = False
+
+ def setUpLocal(self):
+ """This code is executed before each test method."""
+ self.write_config('IMAGE_FSTYPES += " hddimg"\n'
+ 'MACHINE_FEATURES_append = " efi"\n')
+
+ # 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:
+ bitbake('syslinux syslinux-native parted-native gptfdisk-native '
+ 'dosfstools-native mtools-native')
+ bitbake('core-image-minimal')
+ Wic.image_is_ready = True
+
+ rmtree(self.resultdir, ignore_errors=True)
+
+ @testcase(1208)
+ def test_help(self):
+ """Test wic --help"""
+ self.assertEqual(0, runCmd('wic --help').status)
+
+ @testcase(1209)
+ def test_createhelp(self):
+ """Test wic create --help"""
+ self.assertEqual(0, runCmd('wic create --help').status)
+
+ @testcase(1210)
+ def test_listhelp(self):
+ """Test wic list --help"""
+ self.assertEqual(0, runCmd('wic list --help').status)
+
+ @testcase(1211)
+ def test_build_image_name(self):
+ """Test wic create directdisk --image-name core-image-minimal"""
+ self.assertEqual(0, runCmd("wic create directdisk "
+ "--image-name core-image-minimal").status)
+ self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
+
+ @testcase(1212)
+ def test_build_artifacts(self):
+ """Test wic create directdisk providing all artifacts."""
+ bbvars = dict((var.lower(), get_bb_var(var, 'core-image-minimal')) \
+ for var in ('STAGING_DATADIR', 'DEPLOY_DIR_IMAGE',
+ 'STAGING_DIR_NATIVE', 'IMAGE_ROOTFS'))
+ status = runCmd("wic create directdisk "
+ "-b %(staging_datadir)s "
+ "-k %(deploy_dir_image)s "
+ "-n %(staging_dir_native)s "
+ "-r %(image_rootfs)s" % bbvars).status
+ self.assertEqual(0, status)
+ self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
+
+ @testcase(1157)
+ def test_gpt_image(self):
+ """Test creation of core-image-minimal with gpt table and UUID boot"""
+ self.assertEqual(0, runCmd("wic create directdisk-gpt "
+ "--image-name core-image-minimal").status)
+ self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
+
+ @testcase(1213)
+ def test_unsupported_subcommand(self):
+ """Test unsupported subcommand"""
+ self.assertEqual(1, runCmd('wic unsupported',
+ ignore_status=True).status)
+
+ @testcase(1214)
+ def test_no_command(self):
+ """Test wic without command"""
+ self.assertEqual(1, runCmd('wic', ignore_status=True).status)
+
+ @testcase(1215)
+ def test_help_overview(self):
+ """Test wic help overview"""
+ self.assertEqual(0, runCmd('wic help overview').status)
+
+ @testcase(1216)
+ def test_help_plugins(self):
+ """Test wic help plugins"""
+ self.assertEqual(0, runCmd('wic help plugins').status)
+
+ @testcase(1217)
+ def test_help_kickstart(self):
+ """Test wic help kickstart"""
+ self.assertEqual(0, runCmd('wic help kickstart').status)
+
+ @testcase(1264)
+ def test_compress_gzip(self):
+ """Test compressing an image with gzip"""
+ self.assertEqual(0, runCmd("wic create directdisk "
+ "--image-name core-image-minimal "
+ "-c gzip").status)
+ self.assertEqual(1, len(glob(self.resultdir + \
+ "directdisk-*.direct.gz")))
+
+ @testcase(1265)
+ def test_compress_bzip2(self):
+ """Test compressing an image with bzip2"""
+ self.assertEqual(0, runCmd("wic create directdisk "
+ "--image-name core-image-minimal "
+ "-c bzip2").status)
+ self.assertEqual(1, len(glob(self.resultdir + \
+ "directdisk-*.direct.bz2")))
+
+ @testcase(1266)
+ def test_compress_xz(self):
+ """Test compressing an image with xz"""
+ self.assertEqual(0, runCmd("wic create directdisk "
+ "--image-name core-image-minimal "
+ "-c xz").status)
+ self.assertEqual(1, len(glob(self.resultdir + \
+ "directdisk-*.direct.xz")))
+
+ @testcase(1267)
+ def test_wrong_compressor(self):
+ """Test how wic breaks if wrong compressor is provided"""
+ self.assertEqual(2, runCmd("wic create directdisk "
+ "--image-name core-image-minimal "
+ "-c wrong", ignore_status=True).status)
+
+ @testcase(1268)
+ def test_rootfs_indirect_recipes(self):
+ """Test usage of rootfs plugin with rootfs recipes"""
+ wks = "directdisk-multi-rootfs"
+ self.assertEqual(0, runCmd("wic create %s "
+ "--image-name core-image-minimal "
+ "--rootfs rootfs1=core-image-minimal "
+ "--rootfs rootfs2=core-image-minimal" \
+ % wks).status)
+ self.assertEqual(1, len(glob(self.resultdir + "%s*.direct" % wks)))
+
+ @testcase(1269)
+ def test_rootfs_artifacts(self):
+ """Test usage of rootfs plugin with rootfs paths"""
+ bbvars = dict((var.lower(), get_bb_var(var, 'core-image-minimal')) \
+ for var in ('STAGING_DATADIR', 'DEPLOY_DIR_IMAGE',
+ 'STAGING_DIR_NATIVE', 'IMAGE_ROOTFS'))
+ bbvars['wks'] = "directdisk-multi-rootfs"
+ status = runCmd("wic create %(wks)s "
+ "-b %(staging_datadir)s "
+ "-k %(deploy_dir_image)s "
+ "-n %(staging_dir_native)s "
+ "--rootfs-dir rootfs1=%(image_rootfs)s "
+ "--rootfs-dir rootfs2=%(image_rootfs)s" \
+ % bbvars).status
+ self.assertEqual(0, status)
+ self.assertEqual(1, len(glob(self.resultdir + \
+ "%(wks)s-*.direct" % bbvars)))
+
+ @testcase(1346)
+ def test_iso_image(self):
+ """Test creation of hybrid iso image with legacy and EFI boot"""
+ self.assertEqual(0, runCmd("wic create mkhybridiso "
+ "--image-name core-image-minimal").status)
+ self.assertEqual(1, len(glob(self.resultdir + "HYBRID_ISO_IMG-*.direct")))
+ self.assertEqual(1, len(glob(self.resultdir + "HYBRID_ISO_IMG-*.iso")))
+
+ @testcase(1347)
+ def test_image_env(self):
+ """Test generation of <image>.env files."""
+ image = 'core-image-minimal'
+ self.assertEqual(0, bitbake('%s -c do_rootfs_wicenv' % image).status)
+ stdir = get_bb_var('STAGING_DIR_TARGET', image)
+ imgdatadir = os.path.join(stdir, 'imgdata')
+
+ basename = get_bb_var('IMAGE_BASENAME', image)
+ self.assertEqual(basename, image)
+ path = os.path.join(imgdatadir, basename) + '.env'
+ self.assertTrue(os.path.isfile(path))
+
+ wicvars = set(get_bb_var('WICVARS', image).split())
+ # filter out optional variables
+ wicvars = wicvars.difference(('HDDDIR', 'IMAGE_BOOT_FILES',
+ 'INITRD', '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])
+
+ @testcase(1351)
+ def test_wic_image_type(self):
+ """Test building wic images by bitbake"""
+ self.assertEqual(0, bitbake('wic-image-minimal').status)
+
+ deploy_dir = get_bb_var('DEPLOY_DIR_IMAGE')
+ machine = get_bb_var('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)))
+
+ @testcase(1348)
+ def test_qemux86_directdisk(self):
+ """Test creation of qemux-86-directdisk image"""
+ image = "qemux86-directdisk"
+ self.assertEqual(0, runCmd("wic create %s -e core-image-minimal" \
+ % image).status)
+ self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
+
+ @testcase(1349)
+ def test_mkgummidisk(self):
+ """Test creation of mkgummidisk image"""
+ image = "mkgummidisk"
+ self.assertEqual(0, runCmd("wic create %s -e core-image-minimal" \
+ % image).status)
+ self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
+
+ @testcase(1350)
+ def test_mkefidisk(self):
+ """Test creation of mkefidisk image"""
+ image = "mkefidisk"
+ self.assertEqual(0, runCmd("wic create %s -e core-image-minimal" \
+ % image).status)
+ self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
+
+ @testcase(1385)
+ def test_directdisk_bootloader_config(self):
+ """Test creation of directdisk-bootloader-config image"""
+ image = "directdisk-bootloader-config"
+ self.assertEqual(0, runCmd("wic create %s -e core-image-minimal" \
+ % image).status)
+ self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
+
+ @testcase(1422)
+ def test_qemu(self):
+ """Test wic-image-minimal under qemu"""
+ self.assertEqual(0, bitbake('wic-image-minimal').status)
+
+ with runqemu('wic-image-minimal', ssh=False) as qemu:
+ command = "mount |grep '^/dev/' | cut -f1,3 -d ' '"
+ status, output = qemu.run_serial(command)
+ self.assertEqual(1, status, 'Failed to run command "%s": %s' % (command, output))
+ self.assertEqual(output, '/dev/root /\r\n/dev/vda3 /mnt')
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/targetcontrol.py b/import-layers/yocto-poky/meta/lib/oeqa/targetcontrol.py
new file mode 100644
index 000000000..5422a617c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/targetcontrol.py
@@ -0,0 +1,242 @@
+# 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
+
+def get_target_controller(d):
+ testtarget = d.getVar("TEST_TARGET", True)
+ # old, simple names
+ if testtarget == "qemu":
+ return QemuTarget(d)
+ elif testtarget == "simpleremote":
+ return SimpleRemoteTarget(d)
+ else:
+ # use the class name
+ try:
+ # is it a core class defined here?
+ controller = getattr(sys.modules[__name__], testtarget)
+ except AttributeError:
+ # nope, perhaps a layer defined one
+ try:
+ bbpath = d.getVar("BBPATH", True).split(':')
+ testtargetloader = TestTargetLoader()
+ controller = testtargetloader.get_controller_module(testtarget, bbpath)
+ except ImportError as e:
+ bb.fatal("Failed to import {0} from available controller modules:\n{1}".format(testtarget,traceback.format_exc()))
+ except AttributeError as e:
+ bb.fatal("Invalid TEST_TARGET - " + str(e))
+ return controller(d)
+
+
+class BaseTarget(object):
+
+ __metaclass__ = ABCMeta
+
+ supported_image_fstypes = []
+
+ def __init__(self, d):
+ self.connection = None
+ self.ip = None
+ self.server_ip = None
+ self.datetime = d.getVar('DATETIME', True)
+ self.testdir = d.getVar("TEST_LOG_DIR", True)
+ self.pn = d.getVar("PN", True)
+
+ @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)
+ bb.note("SSH log file: %s" % self.sshlog)
+
+ @abstractmethod
+ def start(self, params=None, ssh=True):
+ 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', True).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):
+
+ super(QemuTarget, self).__init__(d)
+
+ self.image_fstype = self.get_image_fstype(d)
+ self.qemulog = os.path.join(self.testdir, "qemu_boot_log.%s" % self.datetime)
+ self.origrootfs = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True), d.getVar("IMAGE_LINK_NAME", True) + '.' + self.image_fstype)
+ self.rootfs = os.path.join(self.testdir, d.getVar("IMAGE_LINK_NAME", True) + '-testimage.' + self.image_fstype)
+ self.kernel = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True), d.getVar("KERNEL_IMAGETYPE", False) + '-' + d.getVar('MACHINE', False) + '.bin')
+ dump_target_cmds = d.getVar("testimage_dump_target", True)
+ dump_host_cmds = d.getVar("testimage_dump_host", True)
+ dump_dir = d.getVar("TESTIMAGE_DUMP_DIR", True)
+
+ # 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)
+ logger = logging.getLogger('BitBake.QemuRunner')
+ loggerhandler = logging.FileHandler(self.qemurunnerlog)
+ loggerhandler.setFormatter(logging.Formatter("%(levelname)s: %(message)s"))
+ logger.addHandler(loggerhandler)
+ oe.path.symlink(os.path.basename(self.qemurunnerlog), os.path.join(self.testdir, 'qemurunner_log'), force=True)
+
+ if d.getVar("DISTRO", True) == "poky-tiny":
+ self.runner = QemuTinyRunner(machine=d.getVar("MACHINE", True),
+ rootfs=self.rootfs,
+ tmpdir = d.getVar("TMPDIR", True),
+ deploy_dir_image = d.getVar("DEPLOY_DIR_IMAGE", True),
+ display = d.getVar("BB_ORIGENV", False).getVar("DISPLAY", True),
+ logfile = self.qemulog,
+ kernel = self.kernel,
+ boottime = int(d.getVar("TEST_QEMUBOOT_TIMEOUT", True)))
+ else:
+ self.runner = QemuRunner(machine=d.getVar("MACHINE", True),
+ rootfs=self.rootfs,
+ tmpdir = d.getVar("TMPDIR", True),
+ deploy_dir_image = d.getVar("DEPLOY_DIR_IMAGE", True),
+ display = d.getVar("BB_ORIGENV", False).getVar("DISPLAY", True),
+ logfile = self.qemulog,
+ boottime = int(d.getVar("TEST_QEMUBOOT_TIMEOUT", True)),
+ dump_dir = dump_dir,
+ dump_host_cmds = d.getVar("testimage_dump_host", True))
+
+ self.target_dumper = TargetDumper(dump_target_cmds, dump_dir, self.runner)
+
+ def deploy(self):
+ try:
+ bb.utils.mkdirhier(self.testdir)
+ shutil.copyfile(self.origrootfs, self.rootfs)
+ except Exception as e:
+ bb.fatal("Error copying rootfs: %s" % e)
+
+ qemuloglink = os.path.join(self.testdir, "qemu_boot_log")
+ if os.path.islink(qemuloglink):
+ os.unlink(qemuloglink)
+ os.symlink(self.qemulog, qemuloglink)
+
+ bb.note("rootfs file: %s" % self.rootfs)
+ bb.note("Qemu log file: %s" % self.qemulog)
+ super(QemuTarget, self).deploy()
+
+ def start(self, params=None, ssh=True):
+ if self.runner.start(params, get_ip=ssh):
+ 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):
+ return self.runner.run_serial(command)
+
+
+class SimpleRemoteTarget(BaseTarget):
+
+ def __init__(self, d):
+ super(SimpleRemoteTarget, self).__init__(d)
+ addr = d.getVar("TEST_TARGET_IP", True) 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", True)
+ 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)
+
+ def deploy(self):
+ super(SimpleRemoteTarget, self).deploy()
+
+ def start(self, params=None, ssh=True):
+ 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/import-layers/yocto-poky/meta/lib/oeqa/utils/__init__.py b/import-layers/yocto-poky/meta/lib/oeqa/utils/__init__.py
new file mode 100644
index 000000000..8f706f363
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/utils/__init__.py
@@ -0,0 +1,38 @@
+# 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
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/utils/commands.py b/import-layers/yocto-poky/meta/lib/oeqa/utils/commands.py
new file mode 100644
index 000000000..48f644129
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/utils/commands.py
@@ -0,0 +1,239 @@
+# 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 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, **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, basestring):
+ self.options["shell"] = True
+ if self.data:
+ self.options['stdin'] = subprocess.PIPE
+ self.options.update(options)
+
+ self.status = None
+ self.output = None
+ self.error = None
+ self.thread = None
+
+ self.log = logging.getLogger("utils.commands")
+
+ def run(self):
+ self.process = subprocess.Popen(self.cmd, **self.options)
+
+ def commThread():
+ self.output, self.error = self.process.communicate(self.data)
+
+ self.thread = threading.Thread(target=commThread)
+ self.thread.start()
+
+ self.log.debug("Running command '%s'" % self.cmd)
+
+ if not self.bg:
+ self.thread.join(self.timeout)
+ self.stop()
+
+ def stop(self):
+ if self.thread.isAlive():
+ self.process.terminate()
+ # let's give it more time to terminate gracefully before killing it
+ self.thread.join(5)
+ if self.thread.isAlive():
+ self.process.kill()
+ self.thread.join()
+
+ self.output = self.output.rstrip()
+ self.status = self.process.poll()
+
+ 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, **options):
+ result = Result()
+
+ cmd = Command(command, timeout=timeout, **options)
+ cmd.run()
+
+ result.command = command
+ result.status = cmd.status
+ result.output = cmd.output
+ result.pid = cmd.process.pid
+
+ if result.status and not ignore_status:
+ if assert_error:
+ raise AssertionError("Command '%s' returned non-zero exit status %d:\n%s" % (command, result.status, result.output))
+ else:
+ raise CommandError(result.status, command, result.output)
+
+ return result
+
+
+def bitbake(command, ignore_status=False, timeout=None, postconfig=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, basestring):
+ 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, **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_var(var, target=None, postconfig=None):
+ val = None
+ bbenv = get_bb_env(target, postconfig=postconfig)
+ lastline = None
+ for line in bbenv.splitlines():
+ if re.search("^(export )?%s=" % var, line):
+ val = line.split('=', 1)[1]
+ val = val.strip('\"')
+ break
+ elif re.match("unset %s$" % var, line):
+ # Handle [unexport] variables
+ if lastline.startswith('# "'):
+ val = lastline.split('\"')[1]
+ break
+ lastline = line
+ return val
+
+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)
+
+
+@contextlib.contextmanager
+def runqemu(pn, ssh=True):
+
+ import bb.tinfoil
+ import bb.build
+
+ tinfoil = bb.tinfoil.Tinfoil()
+ tinfoil.prepare(False)
+ 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")
+ import oe.recipeutils
+ recipefile = oe.recipeutils.pn_to_recipe(tinfoil.cooker, pn)
+ recipedata = oe.recipeutils.parse_recipe(recipefile, [], tinfoil.config_data)
+
+ # The QemuRunner log is saved out, but we need to ensure it is at the right
+ # log level (and then ensure that since it's a child of the BitBake logger,
+ # we disable propagation so we don't then see the log events on the console)
+ logger = logging.getLogger('BitBake.QemuRunner')
+ logger.setLevel(logging.DEBUG)
+ logger.propagate = False
+ logdir = recipedata.getVar("TEST_LOG_DIR", True)
+
+ qemu = oeqa.targetcontrol.QemuTarget(recipedata)
+ 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()
+
+ # Setup bitbake logger as console handler is removed by tinfoil.shutdown
+ bblogger = logging.getLogger('BitBake')
+ bblogger.setLevel(logging.INFO)
+ console = logging.StreamHandler(sys.stdout)
+ bbformat = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
+ if sys.stdout.isatty():
+ bbformat.enable_color()
+ console.setFormatter(bbformat)
+ bblogger.addHandler(console)
+
+ try:
+ qemu.deploy()
+ try:
+ qemu.start(ssh=ssh)
+ except bb.build.FuncFailed:
+ raise Exception('Failed to start QEMU - see the logs in %s' % logdir)
+
+ yield qemu
+
+ finally:
+ try:
+ qemu.stop()
+ except:
+ pass
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/utils/decorators.py b/import-layers/yocto-poky/meta/lib/oeqa/utils/decorators.py
new file mode 100644
index 000000000..0d79223a2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/utils/decorators.py
@@ -0,0 +1,262 @@
+# 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):
+ 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):
+ 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):
+ 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):
+ 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
+
+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')
+
+ #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(testMethod.im_class).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
+
+ for (name, msg) in result.errors:
+ if (self._testMethodName == str(name).split(' ')[0]) and (class_name in str(name).split(' ')[1]):
+ 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 (self._testMethodName == str(name).split(' ')[0]) and (class_name in str(name).split(' ')[1]):
+ 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 (self._testMethodName == str(name).split(' ')[0]) and (class_name in str(name).split(' ')[1]):
+ local_log.results("Testcase "+str(test_case)+": SKIPPED")
+ passed = False
+ if passed:
+ local_log.results("Testcase "+str(test_case)+": PASSED")
+
+ # Create symlink to the current log
+ if os.path.exists(linkfile):
+ os.remove(linkfile)
+ os.symlink(logfile, linkfile)
+
+ 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.iteritems():
+ 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/import-layers/yocto-poky/meta/lib/oeqa/utils/dump.py b/import-layers/yocto-poky/meta/lib/oeqa/utils/dump.py
new file mode 100644
index 000000000..63a591d36
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/utils/dump.py
@@ -0,0 +1,98 @@
+import os
+import sys
+import errno
+import datetime
+import itertools
+from commands import runCmd
+
+def get_host_dumper(d):
+ cmds = d.getVar("testimage_dump_host", True)
+ parent_dir = d.getVar("TESTIMAGE_DUMP_DIR", True)
+ return HostDumper(cmds, parent_dir)
+
+
+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, qemurunner):
+ super(TargetDumper, self).__init__(cmds, parent_dir)
+ self.runner = qemurunner
+
+ 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/import-layers/yocto-poky/meta/lib/oeqa/utils/ftools.py b/import-layers/yocto-poky/meta/lib/oeqa/utils/ftools.py
new file mode 100644
index 000000000..a7233d4ca
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/lib/oeqa/utils/httpserver.py b/import-layers/yocto-poky/meta/lib/oeqa/utils/httpserver.py
new file mode 100644
index 000000000..76518d8ef
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/utils/httpserver.py
@@ -0,0 +1,35 @@
+import SimpleHTTPServer
+import multiprocessing
+import os
+
+class HTTPServer(SimpleHTTPServer.BaseHTTPServer.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(SimpleHTTPServer.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/import-layers/yocto-poky/meta/lib/oeqa/utils/logparser.py b/import-layers/yocto-poky/meta/lib/oeqa/utils/logparser.py
new file mode 100644
index 000000000..87b50354c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/utils/logparser.py
@@ -0,0 +1,125 @@
+#!/usr/bin/env python
+
+import sys
+import os
+import re
+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, 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
+ 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']
+ 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/import-layers/yocto-poky/meta/lib/oeqa/utils/network.py b/import-layers/yocto-poky/meta/lib/oeqa/utils/network.py
new file mode 100644
index 000000000..2768f6c5d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/lib/oeqa/utils/qemurunner.py b/import-layers/yocto-poky/meta/lib/oeqa/utils/qemurunner.py
new file mode 100644
index 000000000..784cf964f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/utils/qemurunner.py
@@ -0,0 +1,536 @@
+# 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 time
+import signal
+import re
+import socket
+import select
+import errno
+import string
+import threading
+import codecs
+from oeqa.utils.dump import HostDumper
+
+import logging
+logger = logging.getLogger("BitBake.QemuRunner")
+
+# Get Unicode non printable control chars
+control_range = range(0,32)+range(127,160)
+control_chars = [unichr(x) for x in control_range
+ if unichr(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):
+
+ # 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.logged = False
+ self.thread = None
+
+ self.runqemutime = 60
+ self.host_dumper = HostDumper(dump_host_cmds, dump_dir)
+
+ 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]
+ logger.info("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 = re_control_char.sub('', unicode(msg, 'utf-8'))
+ 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)
+
+
+ def handleSIGCHLD(self, signum, frame):
+ if self.runqemu and self.runqemu.poll():
+ if self.runqemu.returncode:
+ logger.info('runqemu exited with code %d' % self.runqemu.returncode)
+ logger.info("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):
+ if self.display:
+ os.environ["DISPLAY"] = self.display
+ # Set this flag so that Qemu doesn't do any grabs as SDL grabs
+ # interact badly with screensavers.
+ os.environ["QEMU_DONT_GRAB"] = "1"
+ if not os.path.exists(self.rootfs):
+ logger.error("Invalid rootfs %s" % self.rootfs)
+ return False
+ if not os.path.exists(self.tmpdir):
+ logger.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):
+ logger.error("Invalid DEPLOY_DIR_IMAGE path %s" % self.deploy_dir_image)
+ return False
+ else:
+ os.environ["DEPLOY_DIR_IMAGE"] = self.deploy_dir_image
+
+ try:
+ threadsock, threadport = self.create_socket()
+ self.server_socket, self.serverport = self.create_socket()
+ except socket.error, msg:
+ logger.error("Failed to create listening socket: %s" % msg[1])
+ return False
+
+
+ self.qemuparams = 'bootparams="console=tty1 console=ttyS0,115200n8 printk.time=1" qemuparams="-serial tcp:127.0.0.1:{}"'.format(threadport)
+ if not self.display:
+ self.qemuparams = 'nographic ' + self.qemuparams
+ if qemuparams:
+ self.qemuparams = self.qemuparams[:-1] + " " + qemuparams + " " + '\"'
+
+ self.origchldhandler = signal.getsignal(signal.SIGCHLD)
+ signal.signal(signal.SIGCHLD, self.handleSIGCHLD)
+
+ launch_cmd = 'runqemu tcpserial=%s %s %s %s' % (self.serverport, self.machine, self.rootfs, self.qemuparams)
+ # 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)
+ 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)
+
+ logger.info("runqemu started, pid is %s" % self.runqemu.pid)
+ logger.info("waiting at most %s seconds for qemu pid" % self.runqemutime)
+ 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
+ logger.info('runqemu exited with code %d' % self.runqemu.returncode)
+ self._dump_host()
+ self.stop()
+ logger.info("Output from runqemu:\n%s" % self.getOutput(output))
+ return False
+ time.sleep(1)
+
+ if self.is_alive():
+ logger.info("qemu started - qemu procces pid is %s" % self.qemupid)
+ 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])
+ if not ips or len(ips) != 3:
+ raise ValueError
+ else:
+ self.ip = ips[0]
+ self.server_ip = ips[1]
+ except IndexError, ValueError:
+ logger.info("Couldn't get ip from qemu process arguments! Here is the qemu command line used:\n%s\nand output from runqemu:\n%s" % (cmdline, self.getOutput(output)))
+ self._dump_host()
+ self.stop()
+ return False
+ logger.info("qemu cmdline used:\n{}".format(cmdline))
+ logger.info("Target IP: %s" % self.ip)
+ logger.info("Server IP: %s" % self.server_ip)
+
+ self.thread = LoggingThread(self.log, threadsock, logger)
+ self.thread.start()
+ if not self.thread.connection_established.wait(self.boottime):
+ 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,
+ self.getOutput(output)))
+ self.stop_thread()
+ return False
+
+ logger.info("Output from runqemu:\n%s", self.getOutput(output))
+ logger.info("Waiting at most %d seconds for login banner" % self.boottime)
+ endtime = time.time() + self.boottime
+ socklist = [self.server_socket]
+ reachedlogin = False
+ stopread = False
+ qemusock = None
+ bootlog = ''
+ while time.time() < endtime and not stopread:
+ sread, swrite, serror = select.select(socklist, [], [], 5)
+ 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)
+ logger.info("Connection from %s:%s" % addr)
+ else:
+ data = sock.recv(1024)
+ if data:
+ bootlog += data
+ if re.search(".* login:", bootlog):
+ self.server_socket = qemusock
+ stopread = True
+ reachedlogin = True
+ logger.info("Reached login banner")
+ else:
+ socklist.remove(sock)
+ sock.close()
+ stopread = True
+
+ if not reachedlogin:
+ logger.info("Target didn't reached login boot in %d seconds" % self.boottime)
+ lines = "\n".join(bootlog.splitlines()[-25:])
+ logger.info("Last 25 lines of text:\n%s" % lines)
+ logger.info("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
+ logger.info("Logged as root in serial console")
+ else:
+ logger.info("Couldn't login into serial console"
+ " as root using blank password")
+ except:
+ logger.info("Serial console failed while trying to login")
+
+ else:
+ logger.info("Qemu pid didn't appeared in %s seconds" % self.runqemutime)
+ self._dump_host()
+ self.stop()
+ logger.info("Output from runqemu:\n%s" % self.getOutput(output))
+ return False
+
+ return self.is_alive()
+
+ def stop(self):
+ self.stop_thread()
+ if hasattr(self, "origchldhandler"):
+ signal.signal(signal.SIGCHLD, self.origchldhandler)
+ if self.runqemu:
+ os.kill(self.monitorpid, signal.SIGKILL)
+ logger.info("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:
+ logger.info("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
+
+ def stop_thread(self):
+ if self.thread and self.thread.is_alive():
+ self.thread.stop()
+ self.thread.join()
+
+ def restart(self, qemuparams = None):
+ logger.info("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
+ qemu_child = self.find_child(str(self.runqemu.pid))
+ if qemu_child:
+ self.qemupid = qemu_child[0]
+ if os.path.exists("/proc/" + str(self.qemupid)):
+ return True
+ return False
+
+ 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.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-internal 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 tcp" in commands[p]:
+ return [int(p),commands[p]]
+
+ def run_serial(self, command, raw=False):
+ # 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)
+ keepreading = True
+ while keepreading:
+ sread, _, _ = select.select([self.server_socket],[],[],5)
+ if sread:
+ answer = self.server_socket.recv(1024)
+ if answer:
+ data += answer
+ # Search the prompt to stop
+ if re.search("[a-zA-Z0-9]+@[a-zA-Z0-9\-]+:~#", data):
+ keepreading = False
+ else:
+ raise Exception("No data on serial console socket")
+ else:
+ keepreading = False
+
+ 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")
+ 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.info("Starting logging thread")
+ self.readpipe, self.writepipe = os.pipe()
+ threading.Thread.run(self)
+
+ def stop(self):
+ self.logger.info("Stopping logging thread")
+ if self.running:
+ os.write(self.writepipe, "stop")
+
+ def teardown(self):
+ self.logger.info("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.info("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.info("Stop event received")
+ breakout = True
+ break
+
+ # A connection request was received
+ elif self.serversock.fileno() == event[0]:
+ self.logger.info("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.info("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/import-layers/yocto-poky/meta/lib/oeqa/utils/qemutinyrunner.py b/import-layers/yocto-poky/meta/lib/oeqa/utils/qemutinyrunner.py
new file mode 100644
index 000000000..4f95101f3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/utils/qemutinyrunner.py
@@ -0,0 +1,170 @@
+# 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):
+
+ # 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
+
+
+ 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, 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):
+
+ 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())
+ return False
+
+ return self.is_alive()
+
+ def run_serial(self, command):
+ self.server_socket.sendall(command+'\n')
+ data = ''
+ status = 0
+ stopread = False
+ endtime = time.time()+5
+ while time.time()<endtime and not stopread:
+ sread, _, _ = select.select([self.server_socket],[],[],5)
+ for sock in sread:
+ answer = sock.recv(1024)
+ if answer:
+ data += answer
+ else:
+ sock.close()
+ stopread = True
+ if not data:
+ status = 1
+ 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.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-internal 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]] \ No newline at end of file
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/utils/sshcontrol.py b/import-layers/yocto-poky/meta/lib/oeqa/utils/sshcontrol.py
new file mode 100644
index 000000000..165874416
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/utils/sshcontrol.py
@@ -0,0 +1,153 @@
+# 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:
+ 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:
+ output += data
+ self.log(data)
+ endtime = time.time() + timeout
+
+
+ # 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):
+ 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)
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/utils/targetbuild.py b/import-layers/yocto-poky/meta/lib/oeqa/utils/targetbuild.py
new file mode 100644
index 000000000..f850d78df
--- /dev/null
+++ b/import-layers/yocto-poky/meta/lib/oeqa/utils/targetbuild.py
@@ -0,0 +1,137 @@
+# 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
+from abc import ABCMeta, abstractmethod
+
+class BuildProject():
+
+ __metaclass__ = ABCMeta
+
+ def __init__(self, d, uri, foldername=None, tmpdir="/tmp/"):
+ self.d = d
+ self.uri = uri
+ self.archive = os.path.basename(uri)
+ self.localarchive = os.path.join(tmpdir,self.archive)
+ self.fname = re.sub(r'.tar.bz2|tar.gz$', '', self.archive)
+ if foldername:
+ self.fname = foldername
+
+ # Download self.archive to self.localarchive
+ def _download_archive(self):
+
+ dl_dir = self.d.getVar("DL_DIR", True)
+ 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, True)
+ if val:
+ cmd = 'export ' + var + '=\"%s\"; %s' % (val, cmd)
+
+ cmd = cmd + "wget -O %s %s" % (self.localarchive, self.uri)
+ subprocess.check_call(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.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, tmpdir="/tmp")
+
+ 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', True)
+ self.testlogdir = d.getVar("TEST_LOG_DIR", True)
+ 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_call(cmd, shell=True)
+
+ #Change targetdir to project folder
+ self.targetdir = self.targetdir + self.fname
+
+ def run_configure(self, configure_args=''):
+ return super(SDKBuildProject, self).run_configure(configure_args=(configure_args or '$CONFIGURE_FLAGS'), extra_cmds=' gnu-configize; ')
+
+ 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/import-layers/yocto-poky/meta/lib/oeqa/utils/testexport.py b/import-layers/yocto-poky/meta/lib/oeqa/utils/testexport.py
new file mode 100644
index 000000000..243463bc1
--- /dev/null
+++ b/import-layers/yocto-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", True) if export_env else d.getVar("DEPLOY_DIR", True)
+ rpm_deploy_dir = d.getVar("DEPLOY_DIR_RPM", True)
+ arch = get_dest_folder(d.getVar("TUNE_FEATURES", True), 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", True), "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", True), 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", True), "binaries") if determine_if_poky_env() \
+ else os.getenv("bin_dir")
+ arch = get_dest_folder(d.getVar("TUNE_FEATURES", True), 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/import-layers/yocto-poky/meta/recipes-bsp/acpid/acpid.inc b/import-layers/yocto-poky/meta/recipes-bsp/acpid/acpid.inc
new file mode 100644
index 000000000..12ec19bbb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/acpid/acpid.inc
@@ -0,0 +1,30 @@
+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 \
+ "
+
+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/import-layers/yocto-poky/meta/recipes-bsp/acpid/acpid/0001-Fix-out-of-source-build.patch b/import-layers/yocto-poky/meta/recipes-bsp/acpid/acpid/0001-Fix-out-of-source-build.patch
new file mode 100644
index 000000000..d1aa3aa17
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/acpid/acpid/0001-Fix-out-of-source-build.patch
@@ -0,0 +1,46 @@
+From 5d32b65af750e2007730f3d55a552a186aed81a6 Mon Sep 17 00:00:00 2001
+From: "Maxin B. John" <maxin.john@intel.com>
+Date: Wed, 20 Jan 2016 14:08:29 +0200
+Subject: [PATCH] Fix out of source build
+
+Since the source directory contains another config.h, the build
+directory should be searched first.
+
+Upstream-Status: Submitted
+[https://sourceforge.net/p/acpid2/tickets/10/]
+
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ sock.c | 2 +-
+ ud_socket.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/sock.c b/sock.c
+index 644d460..9e04501 100644
+--- a/sock.c
++++ b/sock.c
+@@ -21,7 +21,7 @@
+ */
+
+ #ifdef HAVE_CONFIG_H
+-#include "config.h"
++#include <config.h>
+ #endif
+
+ #include <unistd.h>
+diff --git a/ud_socket.c b/ud_socket.c
+index 1790917..83b2aa9 100644
+--- a/ud_socket.c
++++ b/ud_socket.c
+@@ -4,7 +4,7 @@
+ */
+
+ #ifdef HAVE_CONFIG_H
+-#include "config.h"
++#include <config.h>
+ #endif
+
+ #include <stdio.h>
+--
+2.4.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/acpid/acpid/acpid.service b/import-layers/yocto-poky/meta/recipes-bsp/acpid/acpid/acpid.service
new file mode 100644
index 000000000..f70e74096
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/acpid/acpid/init b/import-layers/yocto-poky/meta/recipes-bsp/acpid/acpid/init
new file mode 100755
index 000000000..40ff385c1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/acpid/acpid_2.0.26.bb b/import-layers/yocto-poky/meta/recipes-bsp/acpid/acpid_2.0.26.bb
new file mode 100644
index 000000000..c3bd51f7d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/acpid/acpid_2.0.26.bb
@@ -0,0 +1,9 @@
+require acpid.inc
+
+SRC_URI += "file://0001-Fix-out-of-source-build.patch"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
+ file://acpid.h;endline=24;md5=324a9cf225ae69ddaad1bf9d942115b5"
+
+SRC_URI[md5sum] = "f6d772e35ed907f1cc14ad1a546fd473"
+SRC_URI[sha256sum] = "8384f37e4f260f50183e2e20039823d8f06aed9db56924fe92097b7e0b2e0343"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/alsa-state/alsa-state.bb b/import-layers/yocto-poky/meta/recipes-bsp/alsa-state/alsa-state.bb
new file mode 100644
index 000000000..d0f7bb330
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/alsa-state/alsa-state.bb
@@ -0,0 +1,67 @@
+# 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"
+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/import-layers/yocto-poky/meta/recipes-bsp/alsa-state/alsa-state/alsa-state-init b/import-layers/yocto-poky/meta/recipes-bsp/alsa-state/alsa-state/alsa-state-init
new file mode 100755
index 000000000..eee59cb32
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/alsa-state/alsa-state/asound.conf b/import-layers/yocto-poky/meta/recipes-bsp/alsa-state/alsa-state/asound.conf
new file mode 100644
index 000000000..03653cfb2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/alsa-state/alsa-state/asound.conf
@@ -0,0 +1 @@
+# Global alsa-lib configuration
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/alsa-state/alsa-state/asound.state b/import-layers/yocto-poky/meta/recipes-bsp/alsa-state/alsa-state/asound.state
new file mode 100644
index 000000000..ddd1cce85
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/alsa-state/alsa-state/asound.state
@@ -0,0 +1 @@
+# Dummy file, do not delete
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd/apmd.service b/import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd/apmd.service
new file mode 100644
index 000000000..ffab82334
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd/apmd_proxy b/import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd/apmd_proxy
new file mode 100644
index 000000000..c48ee4e5d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd/apmd_proxy.conf b/import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd/apmd_proxy.conf
new file mode 100644
index 000000000..751145c52
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd/default b/import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd/default
new file mode 100644
index 000000000..4b7965abf
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd/init b/import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd/init
new file mode 100755
index 000000000..c0b41aa9d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd/legacy.patch b/import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd/legacy.patch
new file mode 100644
index 000000000..5db895e8f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd/libtool.patch b/import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd/libtool.patch
new file mode 100644
index 000000000..834ee080a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd/linkage.patch b/import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd/linkage.patch
new file mode 100644
index 000000000..3d32c49cd
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd/unlinux.patch b/import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd/unlinux.patch
new file mode 100644
index 000000000..ec8206cf1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd/wexitcode.patch b/import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd/wexitcode.patch
new file mode 100644
index 000000000..c5faa85fa
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd_3.2.2-15.bb b/import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd_3.2.2-15.bb
new file mode 100644
index 000000000..4ff6ad087
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/apmd/apmd_3.2.2-15.bb
@@ -0,0 +1,84 @@
+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 = "${DEBIAN_MIRROR}/main/a/apmd/apmd_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_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/import-layers/yocto-poky/meta/recipes-bsp/eee-acpi-scripts/eee-acpi-scripts_git.bb b/import-layers/yocto-poky/meta/recipes-bsp/eee-acpi-scripts/eee-acpi-scripts_git.bb
new file mode 100644
index 000000000..c2a02aadb
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/eee-acpi-scripts/files/policy-funcs b/import-layers/yocto-poky/meta/recipes-bsp/eee-acpi-scripts/files/policy-funcs
new file mode 100644
index 000000000..fd099df0d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/eee-acpi-scripts/files/powerbtn.patch b/import-layers/yocto-poky/meta/recipes-bsp/eee-acpi-scripts/files/powerbtn.patch
new file mode 100644
index 000000000..403e5569b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/eee-acpi-scripts/files/remove-doc-check.patch b/import-layers/yocto-poky/meta/recipes-bsp/eee-acpi-scripts/files/remove-doc-check.patch
new file mode 100644
index 000000000..efb3dca7a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/formfactor/files/config b/import-layers/yocto-poky/meta/recipes-bsp/formfactor/files/config
new file mode 100755
index 000000000..ecfdf26e2
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/formfactor/files/machconfig b/import-layers/yocto-poky/meta/recipes-bsp/formfactor/files/machconfig
new file mode 100755
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/formfactor/files/machconfig
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/formfactor/files/qemuarm/machconfig b/import-layers/yocto-poky/meta/recipes-bsp/formfactor/files/qemuarm/machconfig
new file mode 100755
index 000000000..56a2ae2e3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/formfactor/files/qemuarmv6/machconfig b/import-layers/yocto-poky/meta/recipes-bsp/formfactor/files/qemuarmv6/machconfig
new file mode 100755
index 000000000..56a2ae2e3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/formfactor/files/qemuarmv7/machconfig b/import-layers/yocto-poky/meta/recipes-bsp/formfactor/files/qemuarmv7/machconfig
new file mode 100755
index 000000000..56a2ae2e3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/formfactor/files/qemumips/machconfig b/import-layers/yocto-poky/meta/recipes-bsp/formfactor/files/qemumips/machconfig
new file mode 100755
index 000000000..56777b6e2
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/formfactor/files/qemumips64/machconfig b/import-layers/yocto-poky/meta/recipes-bsp/formfactor/files/qemumips64/machconfig
new file mode 100755
index 000000000..56777b6e2
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/formfactor/files/qemuppc/machconfig b/import-layers/yocto-poky/meta/recipes-bsp/formfactor/files/qemuppc/machconfig
new file mode 100755
index 000000000..5ea2270cd
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/formfactor/files/qemux86-64/machconfig b/import-layers/yocto-poky/meta/recipes-bsp/formfactor/files/qemux86-64/machconfig
new file mode 100755
index 000000000..56a2ae2e3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/formfactor/files/qemux86/machconfig b/import-layers/yocto-poky/meta/recipes-bsp/formfactor/files/qemux86/machconfig
new file mode 100755
index 000000000..56a2ae2e3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/formfactor/formfactor_0.0.bb b/import-layers/yocto-poky/meta/recipes-bsp/formfactor/formfactor_0.0.bb
new file mode 100644
index 000000000..5c30bd510
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/formfactor/formfactor_0.0.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Device formfactor information"
+SECTION = "base"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+ 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/import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi/gcc46-compatibility.patch b/import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi/gcc46-compatibility.patch
new file mode 100644
index 000000000..0ce6d7b0c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi/gcc46-compatibility.patch
@@ -0,0 +1,21 @@
+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
+Index: gnu-efi-3.0.3/inc/x86_64/efibind.h
+===================================================================
+--- gnu-efi-3.0.3.orig/inc/x86_64/efibind.h
++++ gnu-efi-3.0.3/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/import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi/gnu-efi-Make-setjmp.S-portable-to-ARM.patch b/import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi/gnu-efi-Make-setjmp.S-portable-to-ARM.patch
new file mode 100644
index 000000000..ced128a31
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi/gnu-efi-Make-setjmp.S-portable-to-ARM.patch
@@ -0,0 +1,50 @@
+From 8a356d4b6a242ce63b73920d3ed33f88f9e12fe3 Mon Sep 17 00:00:00 2001
+From: Wenzong Fan <wenzong.fan@windriver.com>
+Date: Sun, 6 Sep 2015 05:20:43 -0400
+Subject: [PATCH] gnu-efi: Make setjmp.S portable to ARM
+
+This patch fixes the following error:
+
+ .../lib/arm/setjmp.S:18: Error: unrecognized symbol type ""
+ .../lib/arm/setjmp.S:26: Error: unrecognized symbol type ""
+
+The problem is the assembly syntax that is used is not portable to ARM,
+where the '@' symbol is a comment:
+
+ > Note on targets where the @ character is the start of a comment
+ > (eg ARM) then another character is used instead. For example the
+ > ARM port uses the % character.
+
+(From https://sourceware.org/binutils/docs-2.25/as/Section.html#Section)
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ lib/arm/setjmp.S | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/arm/setjmp.S b/lib/arm/setjmp.S
+index 6e3fbf0..85c8705 100644
+--- a/lib/arm/setjmp.S
++++ b/lib/arm/setjmp.S
+@@ -15,7 +15,7 @@ BASIS,
+ .text
+ .arm
+ .globl setjmp
+- .type setjmp, @function
++ .type setjmp, %function
+ setjmp:
+ mov r3, r13
+ stmia r0, {r3-r12,r14}
+@@ -23,6 +23,6 @@ setjmp:
+ bx lr
+
+ .globl longjmp
+- .type longjmp, @function
++ .type longjmp, %function
+ longjmp:
+ ldmia r0, {r3-r12,r14}
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi/lib-Makefile-fix-parallel-issue.patch b/import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi/lib-Makefile-fix-parallel-issue.patch
new file mode 100644
index 000000000..1b2ae1ef0
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi/parallel-make-archives.patch b/import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi/parallel-make-archives.patch
new file mode 100644
index 000000000..e5b47c197
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi/parallel-make-archives.patch
@@ -0,0 +1,48 @@
+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>
+---
+---
+ gnuefi/Makefile | 3 ++-
+ lib/Makefile | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+Index: gnu-efi-3.0/lib/Makefile
+===================================================================
+--- gnu-efi-3.0.orig/lib/Makefile
++++ gnu-efi-3.0/lib/Makefile
+@@ -66,7 +66,8 @@ all: libsubdirs libefi.a
+ libsubdirs:
+ for sdir in $(SUBDIRS); do mkdir -p $$sdir; done
+
+-libefi.a: $(patsubst %,libefi.a(%),$(OBJS))
++libefi.a: $(OBJS)
++ $(AR) rv $@ $(OBJS)
+
+ clean:
+ rm -f libefi.a *~ $(OBJS) */*.o
+Index: gnu-efi-3.0/gnuefi/Makefile
+===================================================================
+--- gnu-efi-3.0.orig/gnuefi/Makefile
++++ gnu-efi-3.0/gnuefi/Makefile
+@@ -51,7 +51,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/import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.3.bb b/import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.3.bb
new file mode 100644
index 000000000..eca34599c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.3.bb
@@ -0,0 +1,46 @@
+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=9;md5=2240d7bbdf0928294c2f4a68b14d6591 \
+ 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/div64.S;beginline=6;endline=12;md5=a96c84f5ad12b4f011f98b5d039242f2 \
+ file://lib/arm/math.c;beginline=4;endline=10;md5=64dd1987cee1dcf59d11aa572cfa644e \
+ file://lib/arm/initplat.c;beginline=4;endline=10;md5=64dd1987cee1dcf59d11aa572cfa644e \
+ file://lib/arm/lib1funcs.S;beginline=9;endline=33;md5=f56d5ebbc87136bc66cfe24db82bcf01 \
+ file://lib/aarch64/math.c;beginline=9;endline=33;md5=cfade4c560e033a7bb02dab282872c7d \
+ file://lib/aarch64/initplat.c;beginline=9;endline=33;md5=900cb1ffbe3e1ded344102be921830f1 \
+ "
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.bz2 \
+ file://parallel-make-archives.patch \
+ file://lib-Makefile-fix-parallel-issue.patch \
+ file://gnu-efi-Make-setjmp.S-portable-to-ARM.patch \
+ file://gcc46-compatibility.patch \
+ "
+
+SRC_URI[md5sum] = "15a4bcbc18a9a5e8110ed955970622e6"
+SRC_URI[sha256sum] = "c530f21a15fd9c214dd92d29a6caa20fac989289267512020b6da1f5e6f5b4cb"
+
+COMPATIBLE_HOST = "(x86_64.*|i.86.*|aarch64.*|arm.*)-linux"
+
+def gnu_efi_arch(d):
+ import re
+ tarch = d.getVar("TARGET_ARCH", True)
+ 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}' \
+ "
+
+do_install() {
+ oe_runmake install INSTALLROOT="${D}"
+}
+
+FILES_${PN} += "${libdir}/*.lds"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/files/0001-Fix-CVE-2015-8370-Grub2-user-pass-vulnerability.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/0001-Fix-CVE-2015-8370-Grub2-user-pass-vulnerability.patch
new file mode 100644
index 000000000..65ddcaf12
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/0001-Fix-CVE-2015-8370-Grub2-user-pass-vulnerability.patch
@@ -0,0 +1,53 @@
+Upstream-Status: Accepted
+CVE: CVE-2015-8370
+Signed-off-by: Awais Belal <awais_belal@mentor.com>
+
+From 451d80e52d851432e109771bb8febafca7a5f1f2 Mon Sep 17 00:00:00 2001
+From: Hector Marco-Gisbert <hecmargi@upv.es>
+Date: Wed, 16 Dec 2015 04:57:18 +0000
+Subject: Fix security issue when reading username and password
+
+This patch fixes two integer underflows at:
+ * grub-core/lib/crypto.c
+ * grub-core/normal/auth.c
+
+CVE-2015-8370
+
+Signed-off-by: Hector Marco-Gisbert <hecmargi@upv.es>
+Signed-off-by: Ismael Ripoll-Ripoll <iripoll@disca.upv.es>
+Also-By: Andrey Borzenkov <arvidjaar@gmail.com>
+---
+diff --git a/grub-core/lib/crypto.c b/grub-core/lib/crypto.c
+index 010e550..683a8aa 100644
+--- a/grub-core/lib/crypto.c
++++ b/grub-core/lib/crypto.c
+@@ -470,7 +470,8 @@ grub_password_get (char buf[], unsigned buf_size)
+
+ if (key == '\b')
+ {
+- cur_len--;
++ if (cur_len)
++ cur_len--;
+ continue;
+ }
+
+diff --git a/grub-core/normal/auth.c b/grub-core/normal/auth.c
+index c6bd96e..8615c48 100644
+--- a/grub-core/normal/auth.c
++++ b/grub-core/normal/auth.c
+@@ -174,8 +174,11 @@ grub_username_get (char buf[], unsigned buf_size)
+
+ if (key == '\b')
+ {
+- cur_len--;
+- grub_printf ("\b");
++ if (cur_len)
++ {
++ cur_len--;
++ grub_printf ("\b");
++ }
+ continue;
+ }
+
+--
+cgit v0.9.0.2
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/files/0001-Remove-direct-_llseek-code-and-require-long-filesyst.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/0001-Remove-direct-_llseek-code-and-require-long-filesyst.patch
new file mode 100644
index 000000000..9eabce977
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/0001-Remove-direct-_llseek-code-and-require-long-filesyst.patch
@@ -0,0 +1,81 @@
+From 3bac4caa2bc64db313aaee54fffb90383e118517 Mon Sep 17 00:00:00 2001
+From: Felix Janda <felix.janda@posteo.de>
+Date: Thu, 22 Jan 2015 19:54:36 +0100
+Subject: [PATCH] Remove direct _llseek code and require long filesystem libc.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Backport
+ configure.ac | 8 ++++++++
+ grub-core/osdep/unix/hostdisk.c | 24 ------------------------
+ 4 files changed, 13 insertions(+), 24 deletions(-)
+
+Index: grub-2.00/configure.ac
+===================================================================
+--- grub-2.00.orig/configure.ac
++++ grub-2.00/configure.ac
+@@ -306,6 +306,14 @@ if test x$grub_cv_apple_cc = xyes ; then
+ HOST_LDFLAGS="$HOST_LDFLAGS -Wl,-allow_stack_execute"
+ fi
+
++case "$host_os" in
++ cygwin | windows* | mingw32* | aros*)
++ ;;
++ *)
++ AC_CHECK_SIZEOF(off_t)
++ test x"$ac_cv_sizeof_off_t" = x8 || AC_MSG_ERROR([Large file support is required]);;
++esac
++
+ if test x$USE_NLS = xno; then
+ HOST_CFLAGS="$HOST_CFLAGS -fno-builtin-gettext"
+ fi
+Index: grub-2.00/grub-core/kern/emu/hostdisk.c
+===================================================================
+--- grub-2.00.orig/grub-core/kern/emu/hostdisk.c
++++ grub-2.00/grub-core/kern/emu/hostdisk.c
+@@ -44,11 +44,6 @@
+ #ifdef __linux__
+ # include <sys/ioctl.h> /* ioctl */
+ # include <sys/mount.h>
+-# if !defined(__GLIBC__) || \
+- ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1)))
+-/* Maybe libc doesn't have large file support. */
+-# include <linux/unistd.h> /* _llseek */
+-# endif /* (GLIBC < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR < 1)) */
+ # ifndef BLKFLSBUF
+ # define BLKFLSBUF _IO (0x12,97) /* flush buffer cache */
+ # endif /* ! BLKFLSBUF */
+@@ -761,25 +756,6 @@ linux_find_partition (char *dev, grub_di
+ }
+ #endif /* __linux__ */
+
+-#if defined(__linux__) && (!defined(__GLIBC__) || \
+- ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1))))
+- /* Maybe libc doesn't have large file support. */
+-grub_err_t
+-grub_util_fd_seek (int fd, const char *name, grub_uint64_t off)
+-{
+- loff_t offset, result;
+- static int _llseek (uint filedes, ulong hi, ulong lo,
+- loff_t *res, uint wh);
+- _syscall5 (int, _llseek, uint, filedes, ulong, hi, ulong, lo,
+- loff_t *, res, uint, wh);
+-
+- offset = (loff_t) off;
+- if (_llseek (fd, offset >> 32, offset & 0xffffffff, &result, SEEK_SET))
+- return grub_error (GRUB_ERR_BAD_DEVICE, N_("cannot seek `%s': %s"),
+- name, strerror (errno));
+- return GRUB_ERR_NONE;
+-}
+-#else
+ grub_err_t
+ grub_util_fd_seek (int fd, const char *name, grub_uint64_t off)
+ {
+@@ -790,7 +766,6 @@ grub_util_fd_seek (int fd, const char *n
+ name, strerror (errno));
+ return 0;
+ }
+-#endif
+
+ static void
+ flush_initial_buffer (const char *os_dev __attribute__ ((unused)))
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/files/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/grub/files/0001-parse_dhcp_vendor-Add-missing-const-qualifiers.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/0001-parse_dhcp_vendor-Add-missing-const-qualifiers.patch
new file mode 100644
index 000000000..255e3eb7d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/0001-parse_dhcp_vendor-Add-missing-const-qualifiers.patch
@@ -0,0 +1,33 @@
+Upstream-Status: Backport
+
+Original commit: http://git.savannah.gnu.org/cgit/grub.git/commit/grub-core/net/bootp.c?id=f06c2172c0b32052f22e37523445cf8e7affaea3
+
+From 149d2a14f4723778ced23f439487201ccbf1a2c9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 23 Apr 2015 07:03:34 +0000
+Subject: [PATCH] parse_dhcp_vendor: Add missing const qualifiers.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ grub-core/net/bootp.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c
+index bc07d53..44131ed 100644
+--- a/grub-core/net/bootp.c
++++ b/grub-core/net/bootp.c
+@@ -52,9 +52,9 @@ set_env_limn_ro (const char *intername, const char *suffix,
+ }
+
+ static void
+-parse_dhcp_vendor (const char *name, void *vend, int limit, int *mask)
++parse_dhcp_vendor (const char *name, const void *vend, int limit, int *mask)
+ {
+- grub_uint8_t *ptr, *ptr0;
++ const grub_uint8_t *ptr, *ptr0;
+
+ ptr = ptr0 = vend;
+
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/files/cfg b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/cfg
new file mode 100644
index 000000000..8ca53d24d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/grub/files/check-if-liblzma-is-disabled.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/check-if-liblzma-is-disabled.patch
new file mode 100644
index 000000000..0eece082f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/check-if-liblzma-is-disabled.patch
@@ -0,0 +1,33 @@
+Disable liblzma if --enable-liblzma=no
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -1029,10 +1029,20 @@ fi
+
+ AC_SUBST([LIBGEOM])
+
+-AC_CHECK_LIB([lzma], [lzma_code],
+- [LIBLZMA="-llzma"
+- AC_DEFINE([HAVE_LIBLZMA], [1],
+- [Define to 1 if you have the LZMA library.])],)
++AC_ARG_ENABLE([liblzma],
++ [AS_HELP_STRING([--enable-liblzma],
++ [enable liblzma integration (default=guessed)])])
++if test x"$enable_liblzma" = xno ; then
++ liblzma_excuse="explicitly disabled"
++fi
++
++if test x"$liblzma_excuse" = x ; then
++ AC_CHECK_LIB([lzma], [lzma_code],
++ [LIBLZMA="-llzma"
++ AC_DEFINE([HAVE_LIBLZMA], [1],
++ [Define to 1 if you have the LZMA library.])],)
++fi
++
+ AC_SUBST([LIBLZMA])
+
+ AC_ARG_ENABLE([libzfs],
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/files/fix-endianness-problem.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/fix-endianness-problem.patch
new file mode 100644
index 000000000..079992afb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/fix-endianness-problem.patch
@@ -0,0 +1,44 @@
+grub-core/net/tftp.c: fix endianness problem.
+
+ * grub-core/net/tftp.c (ack): Fix endianness problem.
+ (tftp_receive): Likewise.
+ Reported by: Michael Davidsaver.
+
+Upstream-Status: Backport
+
+diff --git a/ChangeLog b/ChangeLog
+index 81bdae9..c2f42d5 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,9 @@
++2012-07-02 Vladimir Serbinenko <phcoder@gmail.com>
++
++ * grub-core/net/tftp.c (ack): Fix endianness problem.
++ (tftp_receive): Likewise.
++ Reported by: Michael Davidsaver.
++
+ 2012-06-27 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * configure.ac: Bump version to 2.00.
+diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c
+index 9c70efb..d0f39ea 100644
+--- a/grub-core/net/tftp.c
++++ b/grub-core/net/tftp.c
+@@ -143,7 +143,7 @@ ack (tftp_data_t data, grub_uint16_t block)
+
+ tftph_ack = (struct tftphdr *) nb_ack.data;
+ tftph_ack->opcode = grub_cpu_to_be16 (TFTP_ACK);
+- tftph_ack->u.ack.block = block;
++ tftph_ack->u.ack.block = grub_cpu_to_be16 (block);
+
+ err = grub_net_send_udp_packet (data->sock, &nb_ack);
+ if (err)
+@@ -225,7 +225,7 @@ tftp_receive (grub_net_udp_socket_t sock __attribute__ ((unused)),
+ grub_priority_queue_pop (data->pq);
+
+ if (file->device->net->packs.count < 50)
+- err = ack (data, tftph->u.data.block);
++ err = ack (data, data->block + 1);
+ else
+ {
+ file->device->net->stall = 1;
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/files/fix-issue-with-flex-2.5.37.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/fix-issue-with-flex-2.5.37.patch
new file mode 100644
index 000000000..61ae2f537
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/fix-issue-with-flex-2.5.37.patch
@@ -0,0 +1,21 @@
+Upstream-Status: Backport
+
+This fixes compilation issues when using flex-2.5.37. It was taken from upstream.
+
+Original author is: Vladimir Serbinenko <phcoder@gmail.com>
+
+Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
+
+Index: grub-2.00/grub-core/script/yylex.l
+===================================================================
+--- grub-2.00.orig/grub-core/script/yylex.l 2012-06-08 23:24:15.000000000 +0300
++++ grub-2.00/grub-core/script/yylex.l 2013-07-31 14:34:40.708100982 +0300
+@@ -29,6 +29,8 @@
+ #pragma GCC diagnostic ignored "-Wmissing-prototypes"
+ #pragma GCC diagnostic ignored "-Wmissing-declarations"
+ #pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations"
++#pragma GCC diagnostic ignored "-Wunused-function"
++#pragma GCC diagnostic ignored "-Wsign-compare"
+
+ #define yyfree grub_lexer_yyfree
+ #define yyalloc grub_lexer_yyalloc
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/files/fix-texinfo.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/fix-texinfo.patch
new file mode 100644
index 000000000..b911d7370
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/fix-texinfo.patch
@@ -0,0 +1,32 @@
+The tarball has a texi file that doesn't parse with current texinfo, so if it's
+being re-generated the build will fail. Take a patch from upstream to fix the
+texi.
+
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From d4c4b8e1a085f92afcec36f6e590c6dfc51d0a1c Mon Sep 17 00:00:00 2001
+From: Bryan Hundven <bryanhundven@gmail.com>
+Date: Mon, 08 Apr 2013 13:23:07 +0000
+Subject: * docs/grub-dev.texi: Move @itemize after @subsection to satisfy
+
+ texinfo-5.1.
+---
+(limited to 'docs/grub-dev.texi')
+
+diff --git a/docs/grub-dev.texi b/docs/grub-dev.texi
+index a4a3820..f74c966 100644
+--- a/docs/grub-dev.texi
++++ b/docs/grub-dev.texi
+@@ -1394,8 +1394,8 @@ grub_video_blit_glyph (&glyph, color, 0, 0);
+
+ @node Bitmap API
+ @section Bitmap API
+-@itemize
+ @subsection grub_video_bitmap_create
++@itemize
+ @item Prototype:
+ @example
+ grub_err_t grub_video_bitmap_create (struct grub_video_bitmap **bitmap, unsigned int width, unsigned int height, enum grub_video_blit_format blit_format)
+--
+cgit v0.9.0.2
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub-2.00-add-oe-kernel.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub-2.00-add-oe-kernel.patch
new file mode 100644
index 000000000..eb8916cb7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub-2.00-add-oe-kernel.patch
@@ -0,0 +1,53 @@
+From 7ab576a7c61406b7e63739d1b11017ae336b9008 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 3 Mar 2014 03:34:48 -0500
+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.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ util/grub.d/10_linux.in | 4 ++--
+ util/grub.d/20_linux_xen.in | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
+index 14402e8..c58f417 100644
+--- a/util/grub.d/10_linux.in
++++ b/util/grub.d/10_linux.in
+@@ -153,11 +153,11 @@ EOF
+ machine=`uname -m`
+ case "x$machine" in
+ xi?86 | xx86_64)
+- list=`for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do
++ list=`for i in /boot/bzImage-* /bzImage-* /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do
+ if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
+ done` ;;
+ *)
+- list=`for i in /boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do
++ list=`for i in /boot/bzImage-* /boot/vmlinuz-* /boot/vmlinux-* /bzImage-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do
+ if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
+ done` ;;
+ esac
+diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
+index 1d94502..b2decf3 100644
+--- a/util/grub.d/20_linux_xen.in
++++ b/util/grub.d/20_linux_xen.in
+@@ -138,7 +138,7 @@ EOF
+ EOF
+ }
+
+-linux_list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* /boot/kernel-*; do
++linux_list=`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")
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub-2.00-fix-enable_execute_stack-check.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub-2.00-fix-enable_execute_stack-check.patch
new file mode 100644
index 000000000..09ef4dbff
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub-2.00-fix-enable_execute_stack-check.patch
@@ -0,0 +1,27 @@
+Upstream-Status: Pending
+
+
+This patch avoids this configure failure
+
+configure:20306: checking whether `ccache i586-poky-linux-gcc -m32 -march=core2 -msse3 -mtune=generic -mfpmath=sse --sysroot=/builddisk/build/build0/tmp/sysroots/emenlow' generates calls to `__enable_execute_stack()'
+configure:20320: ccache i586-poky-linux-gcc -m32 -march=core2 -msse3 -mtune=generic -mfpmath=sse --sysroot=/builddisk/build/build0/tmp/sysroots/emenlow -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 -mfpmath=387 -fno-dwarf2-cfi-asm -m32 -fno-stack-protector -mno-stack-arg-probe -Werror -Wno-trampolines -falign-loops=1 -S conftest.c
+conftest.c:308:6: error: no previous prototype for 'g' [-Werror=missing-prototypes]
+cc1: all warnings being treated as errors
+configure:20323: $? = 1
+configure:20327: error: ccache i586-poky-linux-gcc -m32 -march=core2 -msse3 -mtune=generic -mfpmath=sse --sysroot=/builddisk/build/build0/tmp/sysroots/emenlow failed to produce assembly code
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/04/13
+
+Index: grub-2.00/acinclude.m4
+===================================================================
+--- grub-2.00.orig/acinclude.m4
++++ grub-2.00/acinclude.m4
+@@ -317,6 +317,7 @@ dnl Check if the C compiler generates ca
+ AC_DEFUN([grub_CHECK_ENABLE_EXECUTE_STACK],[
+ AC_MSG_CHECKING([whether `$CC' generates calls to `__enable_execute_stack()'])
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([[
++void g (int);
+ void f (int (*p) (void));
+ void g (int i)
+ {
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub-2.00-fpmath-sse-387-fix.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub-2.00-fpmath-sse-387-fix.patch
new file mode 100644
index 000000000..c557f13e2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub-2.00-fpmath-sse-387-fix.patch
@@ -0,0 +1,24 @@
+Upstream-Status: pending
+
+This patch fixes this configure issue for grub when -mfpmath=sse is in the gcc parameters.
+
+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>
+2012/04/13
+
+Index: grub-1.99/configure.ac
+===================================================================
+--- grub-1.99.orig/configure.ac
++++ grub-1.99/configure.ac
+@@ -378,7 +378,7 @@ if test "x$target_cpu" = xi386; 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-3dnow"
++ TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-3dnow -mfpmath=387"
+ fi
+
+ # By default, GCC 4.4 generates .eh_frame sections containing unwind
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub-efi-allow-a-compilation-without-mcmodel-large.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub-efi-allow-a-compilation-without-mcmodel-large.patch
new file mode 100644
index 000000000..4588fca4b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub-efi-allow-a-compilation-without-mcmodel-large.patch
@@ -0,0 +1,131 @@
+Allow a compilation without -mcmodel=large
+
+It's provided by Vladimir Serbinenko, and he will commit
+it upstream so it should be backport patch.
+
+Upstream-Status: Backport
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+
+--
+diff --git a/configure.ac b/configure.ac
+index 9f8fb8a..2c5e6ed 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -723,9 +723,7 @@ if test "$target_cpu" = x86_64; then
+ [grub_cv_cc_mcmodel=yes],
+ [grub_cv_cc_mcmodel=no])
+ ])
+- if test "x$grub_cv_cc_mcmodel" = xno; then
+- AC_MSG_ERROR([-mcmodel=large not supported. Upgrade your gcc.])
+- else
++ if test "x$grub_cv_cc_mcmodel" = xyes; then
+ TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large"
+ fi
+ fi
+diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c
+index 1409b5d..6e9dace 100644
+--- a/grub-core/kern/efi/mm.c
++++ b/grub-core/kern/efi/mm.c
+@@ -32,6 +32,12 @@
+ #define BYTES_TO_PAGES(bytes) (((bytes) + 0xfff) >> 12)
+ #define PAGES_TO_BYTES(pages) ((pages) << 12)
+
++#if defined (__code_model_large__) || !defined (__x86_64__)
++#define MAX_USABLE_ADDRESS 0xffffffff
++#else
++#define MAX_USABLE_ADDRESS 0x7fffffff
++#endif
++
+ /* The size of a memory map obtained from the firmware. This must be
+ a multiplier of 4KB. */
+ #define MEMORY_MAP_SIZE 0x3000
+@@ -58,7 +64,7 @@ grub_efi_allocate_pages (grub_efi_physical_address_t address,
+
+ #if 1
+ /* Limit the memory access to less than 4GB for 32-bit platforms. */
+- if (address > 0xffffffff)
++ if (address > MAX_USABLE_ADDRESS)
+ return 0;
+ #endif
+
+@@ -66,7 +72,7 @@ grub_efi_allocate_pages (grub_efi_physical_address_t address,
+ if (address == 0)
+ {
+ type = GRUB_EFI_ALLOCATE_MAX_ADDRESS;
+- address = 0xffffffff;
++ address = MAX_USABLE_ADDRESS;
+ }
+ else
+ type = GRUB_EFI_ALLOCATE_ADDRESS;
+@@ -86,7 +92,7 @@ grub_efi_allocate_pages (grub_efi_physical_address_t address,
+ {
+ /* Uggh, the address 0 was allocated... This is too annoying,
+ so reallocate another one. */
+- address = 0xffffffff;
++ address = MAX_USABLE_ADDRESS;
+ status = efi_call_4 (b->allocate_pages, type, GRUB_EFI_LOADER_DATA, pages, &address);
+ grub_efi_free_pages (0, pages);
+ if (status != GRUB_EFI_SUCCESS)
+@@ -319,7 +325,7 @@ filter_memory_map (grub_efi_memory_descriptor_t *memory_map,
+ {
+ if (desc->type == GRUB_EFI_CONVENTIONAL_MEMORY
+ #if 1
+- && desc->physical_start <= 0xffffffff
++ && desc->physical_start <= MAX_USABLE_ADDRESS
+ #endif
+ && desc->physical_start + PAGES_TO_BYTES (desc->num_pages) > 0x100000
+ && desc->num_pages != 0)
+@@ -337,9 +343,9 @@ filter_memory_map (grub_efi_memory_descriptor_t *memory_map,
+ #if 1
+ if (BYTES_TO_PAGES (filtered_desc->physical_start)
+ + filtered_desc->num_pages
+- > BYTES_TO_PAGES (0x100000000LL))
++ > BYTES_TO_PAGES (MAX_USABLE_ADDRESS+1LL))
+ filtered_desc->num_pages
+- = (BYTES_TO_PAGES (0x100000000LL)
++ = (BYTES_TO_PAGES (MAX_USABLE_ADDRESS+1LL)
+ - BYTES_TO_PAGES (filtered_desc->physical_start));
+ #endif
+
+diff --git a/grub-core/kern/x86_64/dl.c b/grub-core/kern/x86_64/dl.c
+index 65f09ef..17c1215 100644
+--- a/grub-core/kern/x86_64/dl.c
++++ b/grub-core/kern/x86_64/dl.c
+@@ -100,14 +100,32 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
+ break;
+
+ case R_X86_64_PC32:
+- *addr32 += rel->r_addend + sym->st_value -
+- (Elf64_Xword) seg->addr - rel->r_offset;
++ {
++ grub_int64_t value;
++ value = ((grub_int32_t) *addr32) + rel->r_addend + sym->st_value -
++ (Elf64_Xword) seg->addr - rel->r_offset;
++ if (value != (grub_int32_t) value)
++ return grub_error (GRUB_ERR_BAD_MODULE, "relocation out of range");
++ *addr32 = value;
++ }
+ break;
+
+ case R_X86_64_32:
++ {
++ grub_uint64_t value = *addr32 + rel->r_addend + sym->st_value;
++ if (value != (grub_uint32_t) value)
++ return grub_error (GRUB_ERR_BAD_MODULE, "relocation out of range");
++ *addr32 = value;
++ }
++ break;
+ case R_X86_64_32S:
+- *addr32 += rel->r_addend + sym->st_value;
+- break;
++ {
++ grub_int64_t value = ((grub_int32_t) *addr32) + rel->r_addend + sym->st_value;
++ if (value != (grub_int32_t) value)
++ return grub_error (GRUB_ERR_BAD_MODULE, "relocation out of range");
++ *addr32 = value;
++ }
++ break;
+
+ default:
+ return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub-efi-fix-with-glibc-2.20.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub-efi-fix-with-glibc-2.20.patch
new file mode 100644
index 000000000..4f12628a4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub-efi-fix-with-glibc-2.20.patch
@@ -0,0 +1,32 @@
+From eb6368e65f6988eebad26cebdec057f797bceb40 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Tue, 9 Sep 2014 00:02:30 -0700
+Subject: [PATCH] Fix build with glibc 2.20
+
+* grub-core/kern/emu/hostfs.c: squahes below warning
+ warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
+
+Upstream-Status: Submitted
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ grub-core/kern/emu/hostfs.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/grub-core/kern/emu/hostfs.c b/grub-core/kern/emu/hostfs.c
+index 3cb089c..a51ee32 100644
+--- a/grub-core/kern/emu/hostfs.c
++++ b/grub-core/kern/emu/hostfs.c
+@@ -16,7 +16,7 @@
+ * You should have received a copy of the GNU General Public License
+ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
+ */
+-#define _BSD_SOURCE
++#define _DEFAULT_SOURCE
+ #include <grub/fs.h>
+ #include <grub/file.h>
+ #include <grub/disk.h>
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub-install.in.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub-install.in.patch
new file mode 100644
index 000000000..326951df4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub-install.in.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Our use of grub-install doesn't require the -x option, so we should be
+be able make use of grep versions that don't support it.
+
+Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
+
+Index: grub-1.99/util/grub-install.in
+===================================================================
+--- grub-1.99.orig/util/grub-install.in 2011-09-09 22:37:20.093906679 -0500
++++ grub-1.99/util/grub-install.in 2011-09-09 22:37:30.854737882 -0500
+@@ -510,7 +510,7 @@
+
+ if [ "x${devabstraction_module}" = "x" ] ; then
+ if [ x"${install_device}" != x ]; then
+- if echo "${install_device}" | grep -qx "(.*)" ; then
++ if echo "${install_device}" | grep -q "(.*)" ; then
+ install_drive="${install_device}"
+ else
+ install_drive="`"$grub_probe" --device-map="${device_map}" --target=drive --device "${install_device}"`" || exit 1
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub-no-unused-result.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub-no-unused-result.patch
new file mode 100644
index 000000000..4cbd0838d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub-no-unused-result.patch
@@ -0,0 +1,19 @@
+Signed-off-by: Radu Moisan <radu.moisan@intel.com>
+Upstream-Status: Pending
+
+I had an error because of an unused return value for read().
+I added -Wno-unused-result.
+
+Index: grub-2.00/configure.ac
+===================================================================
+--- grub-2.00.orig/configure.ac 2012-08-13 16:32:33.000000000 +0300
++++ grub-2.00/configure.ac 2012-08-13 16:38:22.000000000 +0300
+@@ -394,7 +394,7 @@
+ LIBS=""
+
+ # debug flags.
+-WARN_FLAGS="-Wall -W -Wshadow -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Wattributes -Wcast-align -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmultichar -Wnonnull -Woverflow -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
++WARN_FLAGS="-Wall -W -Wshadow -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Wattributes -Wcast-align -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmultichar -Wnonnull -Woverflow -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wno-unused-result -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
+ HOST_CFLAGS="$HOST_CFLAGS $WARN_FLAGS"
+ TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations"
+ TARGET_CCASFLAGS="$TARGET_CCASFLAGS -g"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub2-fix-initrd-size-bug.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub2-fix-initrd-size-bug.patch
new file mode 100644
index 000000000..d114f4847
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub2-fix-initrd-size-bug.patch
@@ -0,0 +1,48 @@
+From 8fbb150a56966edde4dc07b8d01be5eb149b65ab Mon Sep 17 00:00:00 2001
+From: Colin Watson <cjwatson@ubuntu.com>
+Date: Sun, 20 Jan 2013 23:03:35 +0000
+Subject: [PATCH 1/1] * grub-core/loader/i386/linux.c (grub_cmd_initrd): Don't
+ add the initrd size to addr_min, since the initrd will be allocated after
+ this address.
+
+commit 6a0debbd9167e8f79cdef5497a73d23e580c0cd4 upstream
+
+Upstream-Status: Backport
+
+Signed-off-by: Shan Hai <shan.hai@windriver.com>
+---
+ ChangeLog | 6 ++++++
+ grub-core/loader/i386/linux.c | 3 +--
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index c2f42d5..40cb508 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,9 @@
++2013-01-20 Colin Watson <cjwatson@ubuntu.com>
++
++ * grub-core/loader/i386/linux.c (grub_cmd_initrd): Don't add the
++ initrd size to addr_min, since the initrd will be allocated after
++ this address.
++
+ 2012-07-02 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * grub-core/net/tftp.c (ack): Fix endianness problem.
+diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c
+index 62087cf..e2425c8 100644
+--- a/grub-core/loader/i386/linux.c
++++ b/grub-core/loader/i386/linux.c
+@@ -1098,8 +1098,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
+ worse than that of Linux 2.3.xx, so avoid the last 64kb. */
+ addr_max -= 0x10000;
+
+- addr_min = (grub_addr_t) prot_mode_target + prot_init_space
+- + page_align (size);
++ addr_min = (grub_addr_t) prot_mode_target + prot_init_space;
+
+ /* Put the initrd as high as possible, 4KiB aligned. */
+ addr = (addr_max - size) & ~0xFFF;
+--
+1.8.5.2.233.g932f7e4
+
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub2-remove-sparc64-setup-from-x86-builds.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub2-remove-sparc64-setup-from-x86-builds.patch
new file mode 100644
index 000000000..6259a1abe
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/grub2-remove-sparc64-setup-from-x86-builds.patch
@@ -0,0 +1,104 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+remove the grub-sparc64-setup files from the x86 builds.
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+
+--- a/Makefile.util.am 2014-08-15 11:41:02.441011278 -0700
++++ b/Makefile.util.am 2014-08-15 11:44:26.245021142 -0700
+@@ -4692,9 +4692,9 @@
+ endif
+
+ if COND_emu
+-sbin_PROGRAMS += grub-sparc64-setup
++sbin_PROGRAMS +=
+ if COND_MAN_PAGES
+-man_MANS += grub-sparc64-setup.8
++man_MANS +=
+
+ grub-sparc64-setup.8: grub-sparc64-setup
+ chmod a+x grub-sparc64-setup
+@@ -4715,9 +4715,9 @@
+ endif
+
+ if COND_i386_pc
+-sbin_PROGRAMS += grub-sparc64-setup
++sbin_PROGRAMS +=
+ if COND_MAN_PAGES
+-man_MANS += grub-sparc64-setup.8
++man_MANS +=
+
+ grub-sparc64-setup.8: grub-sparc64-setup
+ chmod a+x grub-sparc64-setup
+@@ -4738,9 +4738,9 @@
+ endif
+
+ if COND_i386_efi
+-sbin_PROGRAMS += grub-sparc64-setup
++sbin_PROGRAMS +=
+ if COND_MAN_PAGES
+-man_MANS += grub-sparc64-setup.8
++man_MANS +=
+
+ grub-sparc64-setup.8: grub-sparc64-setup
+ chmod a+x grub-sparc64-setup
+@@ -4761,9 +4761,9 @@
+ endif
+
+ if COND_i386_qemu
+-sbin_PROGRAMS += grub-sparc64-setup
++sbin_PROGRAMS +=
+ if COND_MAN_PAGES
+-man_MANS += grub-sparc64-setup.8
++man_MANS +=
+
+ grub-sparc64-setup.8: grub-sparc64-setup
+ chmod a+x grub-sparc64-setup
+@@ -4784,9 +4784,9 @@
+ endif
+
+ if COND_i386_coreboot
+-sbin_PROGRAMS += grub-sparc64-setup
++sbin_PROGRAMS +=
+ if COND_MAN_PAGES
+-man_MANS += grub-sparc64-setup.8
++man_MANS +=
+
+ grub-sparc64-setup.8: grub-sparc64-setup
+ chmod a+x grub-sparc64-setup
+@@ -4807,9 +4807,9 @@
+ endif
+
+ if COND_i386_multiboot
+-sbin_PROGRAMS += grub-sparc64-setup
++sbin_PROGRAMS +=
+ if COND_MAN_PAGES
+-man_MANS += grub-sparc64-setup.8
++man_MANS +=
+
+ grub-sparc64-setup.8: grub-sparc64-setup
+ chmod a+x grub-sparc64-setup
+@@ -4830,9 +4830,9 @@
+ endif
+
+ if COND_i386_ieee1275
+-sbin_PROGRAMS += grub-sparc64-setup
++sbin_PROGRAMS +=
+ if COND_MAN_PAGES
+-man_MANS += grub-sparc64-setup.8
++man_MANS +=
+
+ grub-sparc64-setup.8: grub-sparc64-setup
+ chmod a+x grub-sparc64-setup
+@@ -4853,9 +4853,9 @@
+ endif
+
+ if COND_x86_64_efi
+-sbin_PROGRAMS += grub-sparc64-setup
++sbin_PROGRAMS +=
+ if COND_MAN_PAGES
+-man_MANS += grub-sparc64-setup.8
++man_MANS +=
+
+ grub-sparc64-setup.8: grub-sparc64-setup
+ chmod a+x grub-sparc64-setup
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/files/remove-gets.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/remove-gets.patch
new file mode 100644
index 000000000..463f7847a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/files/remove-gets.patch
@@ -0,0 +1,20 @@
+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
+Index: grub-1.99/grub-core/gnulib/stdio.in.h
+===================================================================
+--- grub-1.99.orig/grub-core/gnulib/stdio.in.h 2010-12-01 06:45:43.000000000 -0800
++++ grub-1.99/grub-core/gnulib/stdio.in.h 2012-07-04 12:25:02.057099107 -0700
+@@ -140,8 +140,10 @@
+ /* It is very rare that the developer ever has full control of stdin,
+ so any use of gets warrants an unconditional warning. Assume it is
+ always declared, since it is required by C89. */
++#if defined gets
+ #undef gets
+ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
++#endif
+
+ #if @GNULIB_FOPEN@
+ # if @REPLACE_FOPEN@
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/autohell.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/autohell.patch
new file mode 100644
index 000000000..d66207ae6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/autohell.patch
@@ -0,0 +1,21 @@
+Upstream-Status: Inappropriate [configuration]
+
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+Index: grub-0.97/configure.ac
+===================================================================
+--- grub-0.97.orig/configure.ac 2008-09-12 17:39:52.000000000 +0200
++++ grub-0.97/configure.ac 2008-09-12 17:40:21.000000000 +0200
+@@ -60,8 +60,8 @@ AC_PROG_CC
+ _AM_DEPENDENCIES(CC)
+
+ dnl Because recent automake complains about AS, set it here.
+-CCAS="$CC"
+-AC_SUBST(CCAS)
++AM_PROG_AS
++AC_SUBST(AS)
+
+ AC_ARG_WITH(binutils,
+ [ --with-binutils=DIR search the directory DIR to find binutils])
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/grub-support-256byte-inode.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/grub-support-256byte-inode.patch
new file mode 100644
index 000000000..d225d13dc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/grub-support-256byte-inode.patch
@@ -0,0 +1,101 @@
+Upstream-Status: Inappropriate [No Longer Maintained]
+
+diff -Naur grub-0.97-800/stage2/fsys_ext2fs.c grub-0.97-810/stage2/fsys_ext2fs.c
+--- grub-0.97-800/stage2/fsys_ext2fs.c 2008-07-21 00:40:21.668879475 -0600
++++ grub-0.97-810/stage2/fsys_ext2fs.c 2008-07-21 01:01:11.063953773 -0600
+@@ -79,7 +79,52 @@
+ __u32 s_rev_level; /* Revision level */
+ __u16 s_def_resuid; /* Default uid for reserved blocks */
+ __u16 s_def_resgid; /* Default gid for reserved blocks */
+- __u32 s_reserved[235]; /* Padding to the end of the block */
++ /*
++ * These fields are for EXT2_DYNAMIC_REV superblocks only.
++ *
++ * Note: the difference between the compatible feature set and
++ * the incompatible feature set is that if there is a bit set
++ * in the incompatible feature set that the kernel doesn't
++ * know about, it should refuse to mount the filesystem.
++ *
++ * e2fsck's requirements are more strict; if it doesn't know
++ * about a feature in either the compatible or incompatible
++ * feature set, it must abort and not try to meddle with
++ * things it doesn't understand...
++ */
++ __u32 s_first_ino; /* First non-reserved inode */
++ __u16 s_inode_size; /* size of inode structure */
++ __u16 s_block_group_nr; /* block group # of this superblock */
++ __u32 s_feature_compat; /* compatible feature set */
++ __u32 s_feature_incompat; /* incompatible feature set */
++ __u32 s_feature_ro_compat; /* readonly-compatible feature set */
++ __u8 s_uuid[16]; /* 128-bit uuid for volume */
++ char s_volume_name[16]; /* volume name */
++ char s_last_mounted[64]; /* directory where last mounted */
++ __u32 s_algorithm_usage_bitmap; /* For compression */
++ /*
++ * Performance hints. Directory preallocation should only
++ * happen if the EXT2_FEATURE_COMPAT_DIR_PREALLOC flag is on.
++ */
++ __u8 s_prealloc_blocks; /* Nr of blocks to try to preallocate*/
++ __u8 s_prealloc_dir_blocks; /* Nr to preallocate for dirs */
++ __u16 s_reserved_gdt_blocks;/* Per group table for online growth */
++ /*
++ * Journaling support valid if EXT2_FEATURE_COMPAT_HAS_JOURNAL set.
++ */
++ __u8 s_journal_uuid[16]; /* uuid of journal superblock */
++ __u32 s_journal_inum; /* inode number of journal file */
++ __u32 s_journal_dev; /* device number of journal file */
++ __u32 s_last_orphan; /* start of list of inodes to delete */
++ __u32 s_hash_seed[4]; /* HTREE hash seed */
++ __u8 s_def_hash_version; /* Default hash version to use */
++ __u8 s_jnl_backup_type; /* Default type of journal backup */
++ __u16 s_reserved_word_pad;
++ __u32 s_default_mount_opts;
++ __u32 s_first_meta_bg; /* First metablock group */
++ __u32 s_mkfs_time; /* When the filesystem was created */
++ __u32 s_jnl_blocks[17]; /* Backup of the journal inode */
++ __u32 s_reserved[172]; /* Padding to the end of the block */
+ };
+
+ struct ext2_group_desc
+@@ -218,6 +263,14 @@
+ #define EXT2_ADDR_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (__u32))
+ #define EXT2_ADDR_PER_BLOCK_BITS(s) (log2(EXT2_ADDR_PER_BLOCK(s)))
+
++#define EXT2_GOOD_OLD_REV 0 /* The good old (original) format */
++#define EXT2_DYNAMIC_REV 1 /* V2 format w/ dynamic inode sizes */
++#define EXT2_GOOD_OLD_INODE_SIZE 128
++#define EXT2_INODE_SIZE(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \
++ EXT2_GOOD_OLD_INODE_SIZE : \
++ (s)->s_inode_size)
++#define EXT2_INODES_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s)/EXT2_INODE_SIZE(s))
++
+ /* linux/ext2_fs.h */
+ #define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10)
+ /* kind of from ext2/super.c */
+@@ -553,7 +606,7 @@
+ gdp = GROUP_DESC;
+ ino_blk = gdp[desc].bg_inode_table +
+ (((current_ino - 1) % (SUPERBLOCK->s_inodes_per_group))
+- >> log2 (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode)));
++ >> log2 (EXT2_INODES_PER_BLOCK (SUPERBLOCK)));
+ #ifdef E2DEBUG
+ printf ("inode table fsblock=%d\n", ino_blk);
+ #endif /* E2DEBUG */
+@@ -565,13 +618,12 @@
+ /* reset indirect blocks! */
+ mapblock2 = mapblock1 = -1;
+
+- raw_inode = INODE +
+- ((current_ino - 1)
+- & (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode) - 1));
++ raw_inode = (struct ext2_inode *)((char *)INODE +
++ ((current_ino - 1) & (EXT2_INODES_PER_BLOCK (SUPERBLOCK) - 1)) *
++ EXT2_INODE_SIZE (SUPERBLOCK));
+ #ifdef E2DEBUG
+ printf ("ipb=%d, sizeof(inode)=%d\n",
+- (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode)),
+- sizeof (struct ext2_inode));
++ EXT2_INODES_PER_BLOCK (SUPERBLOCK), EXT2_INODE_SIZE (SUPERBLOCK));
+ printf ("inode=%x, raw_inode=%x\n", INODE, raw_inode);
+ printf ("offset into inode table block=%d\n", (int) raw_inode - (int) INODE);
+ for (i = (unsigned char *) INODE; i <= (unsigned char *) raw_inode;
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/grub_fix_for_automake-1.12.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/grub_fix_for_automake-1.12.patch
new file mode 100644
index 000000000..0cf7dc96d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/grub_fix_for_automake-1.12.patch
@@ -0,0 +1,74 @@
+Upstream-Status: Inappropriate
+
+Subject: [PATCH] grub: fix for automake-1.12
+
+automake 1.12 has depricated automatic de-ANSI-fication support
+
+this patch avoids these kinds of errors:
+
+| stage1/Makefile.am:2: error: 'pkglibdir' is not a legitimate directory for 'DATA'
+| stage2/Makefile.am:35: error: 'pkglibdir' is not a legitimate directory for 'DATA'
+| stage2/Makefile.am:46: error: 'pkglibdir' is not a legitimate directory for 'DATA'
+| autoreconf: automake failed with exit status: 1
+| ERROR: autoreconf execution failed.
+
+The upstream status is marked as 'Inappropriate' because this problem is not uncommon,
+it has been there for a long time and no change in upstream.
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+
+Index: grub-0.97/stage1/Makefile.am
+===================================================================
+--- a/stage1/Makefile.am
++++ b/stage1/Makefile.am
+@@ -1,7 +1,7 @@
+-pkglibdir = $(libdir)/$(PACKAGE)/$(host_cpu)-$(host_vendor)
+-nodist_pkglib_DATA = stage1
++pkgdatadir = $(libdir)/$(PACKAGE)/$(host_cpu)-$(host_vendor)
++nodist_pkgdata_DATA = stage1
+
+-CLEANFILES = $(nodist_pkglib_DATA)
++CLEANFILES = $(nodist_pkgdata_DATA)
+
+ # We can't use builtins or standard includes.
+ AM_CCASFLAGS = $(STAGE1_CFLAGS) -fno-builtin -nostdinc
+Index: grub-0.97/stage2/Makefile.am
+===================================================================
+--- a/stage2/Makefile.am
++++ b/stage2/Makefile.am
+@@ -27,12 +27,12 @@ libgrub_a_CFLAGS = $(GRUB_CFLAGS) -I$(top_srcdir)/lib \
+ -DUSE_MD5_PASSWORDS=1 -DSUPPORT_SERIAL=1 -DSUPPORT_HERCULES=1
+
+ # Stage 2 and Stage 1.5's.
+-pkglibdir = $(libdir)/$(PACKAGE)/$(host_cpu)-$(host_vendor)
++pkgdatadir = $(libdir)/$(PACKAGE)/$(host_cpu)-$(host_vendor)
+
+ EXTRA_PROGRAMS = nbloader.exec pxeloader.exec diskless.exec
+
+ if DISKLESS_SUPPORT
+-pkglib_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \
++pkgdata_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \
+ ffs_stage1_5 iso9660_stage1_5 jfs_stage1_5 minix_stage1_5 \
+ reiserfs_stage1_5 ufs2_stage1_5 vstafs_stage1_5 xfs_stage1_5 \
+ nbgrub pxegrub
+@@ -43,7 +43,7 @@ noinst_PROGRAMS = pre_stage2.exec start.exec start_eltorito.exec \
+ reiserfs_stage1_5.exec ufs2_stage1_5.exec vstafs_stage1_5.exec \
+ xfs_stage1_5.exec nbloader.exec pxeloader.exec diskless.exec
+ else
+-pkglib_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \
++pkgdata_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \
+ ffs_stage1_5 iso9660_stage1_5 jfs_stage1_5 minix_stage1_5 \
+ reiserfs_stage1_5 ufs2_stage1_5 vstafs_stage1_5 xfs_stage1_5
+ noinst_DATA = pre_stage2 start start_eltorito
+@@ -105,7 +105,7 @@ else
+ BUILT_SOURCES = stage2_size.h
+ endif
+
+-CLEANFILES = $(pkglib_DATA) $(noinst_DATA) $(BUILT_SOURCES)
++CLEANFILES = $(pkgdata_DATA) $(noinst_DATA) $(BUILT_SOURCES)
+
+ stage2_size.h: pre_stage2
+ -rm -f stage2_size.h
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/no-reorder-functions.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/no-reorder-functions.patch
new file mode 100644
index 000000000..70037e47c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/no-reorder-functions.patch
@@ -0,0 +1,31 @@
+Upstream-Status: Inappropriate [disable feature]
+
+After the commit "tcmode-default: switch to gcc 4.6.0 for x86, x86-64 & arm",
+we got bug 1099 (http://bugzilla.yoctoproject.org/show_bug.cgi?id=1099):
+
+Running "install --stage2=/ssd/boot/grub/stage2 /boot/grub/stage1(hd0)
+ /boot/grub/stage2 p /boot/grub/menu list" failed
+Error 6: Mismatched or corrupt version of stage1/stage2
+
+This turned out to be a gcc's bug. See
+https://bugs.gentoo.org/show_bug.cgi?id=360513
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39333
+
+Upstream gcc seems uninterested in the bug, so at present we can disable the
+option as a workaround. Thanks Ryan Hill for the investigation and the
+workaround patch.
+
+Dexuan Cui <dexuan.cui@intel.com>
+Wed Jun 29 20:21:39 CST 2011
+
+--- grub-0.97/stage2/Makefile.am.orig
++++ grub-0.97/stage2/Makefile.am
+@@ -79,7 +79,7 @@
+ HERCULES_FLAGS =
+ endif
+
+-STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-builtin -nostdinc \
++STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-reorder-functions -fno-builtin -nostdinc \
+ $(NETBOOT_FLAGS) $(SERIAL_FLAGS) $(HERCULES_FLAGS)
+
+ STAGE1_5_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,2000
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/objcopy-absolute.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/objcopy-absolute.patch
new file mode 100644
index 000000000..bd8e0a89f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-0.97/objcopy-absolute.patch
@@ -0,0 +1,40 @@
+
+This patch is from ubuntu:
+ * objcopy-absolute.diff (update): Remove .note, .comment, and
+ .note.gnu.build-id sections from images (LP: #444703).
+
+Upstream-Status: Inappropriate [no longer maintained]
+
+Index: b/acinclude.m4
+===================================================================
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -61,7 +61,7 @@
+ else
+ AC_MSG_ERROR([${CC-cc} cannot link at address $link_addr])
+ fi
+- if AC_TRY_COMMAND([${OBJCOPY-objcopy} -O binary conftest.exec conftest]); then :
++ if AC_TRY_COMMAND([${OBJCOPY-objcopy} --only-section=.text -O binary conftest.exec conftest]); then :
+ else
+ AC_MSG_ERROR([${OBJCOPY-objcopy} cannot create binary files])
+ fi
+Index: b/stage1/Makefile.am
+===================================================================
+--- a/stage1/Makefile.am
++++ b/stage1/Makefile.am
+@@ -12,4 +12,4 @@
+
+ SUFFIXES = .exec
+ .exec:
+- $(OBJCOPY) -O binary $< $@
++ $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@
+Index: b/stage2/Makefile.am
+===================================================================
+--- a/stage2/Makefile.am
++++ b/stage2/Makefile.am
+@@ -293,4 +293,4 @@
+ # General rule for making a raw binary.
+ SUFFIXES = .exec
+ .exec:
+- $(OBJCOPY) -O binary $< $@
++ $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-efi_2.00.bb b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-efi_2.00.bb
new file mode 100644
index 000000000..5a0dc954a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-efi_2.00.bb
@@ -0,0 +1,69 @@
+require grub2.inc
+
+DEPENDS_class-target = "grub-efi-native"
+RDEPENDS_${PN}_class-target = "diffutils freetype"
+PR = "r3"
+
+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', True)
+ if target == "x86_64":
+ grubtarget = 'x86_64'
+ grubimage = "bootx64.efi"
+ elif re.match('i.86', target):
+ grubtarget = 'i386'
+ grubimage = "bootia32.efi"
+ else:
+ raise bb.parse.SkipPackage("grub-efi is incompatible with target %s" % target)
+ d.setVar("GRUB_TARGET", grubtarget)
+ d.setVar("GRUB_IMAGE", grubimage)
+}
+
+inherit deploy
+
+CACHED_CONFIGUREVARS += "ac_cv_path_HELP2MAN="
+EXTRA_OECONF = "--with-platform=efi --disable-grub-mkfont \
+ --enable-efiemu=no --program-prefix='' \
+ --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no"
+
+EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '--enable-largefile', '--disable-largefile', d)}"
+
+# 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_install_class-native() {
+ install -d ${D}${bindir}
+ install -m 755 grub-mkimage ${D}${bindir}
+}
+
+GRUB_BUILDIN ?= "boot linux ext2 fat serial part_msdos part_gpt normal efi_gop iso9660 search"
+
+do_deploy() {
+ # 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} \
+ ${GRUB_BUILDIN}
+ install -m 644 ${B}/${GRUB_IMAGE} ${DEPLOYDIR}
+}
+
+do_deploy_class-native() {
+ :
+}
+
+addtask deploy after do_install before do_build
+
+FILES_${PN} += "${libdir}/grub/${GRUB_TARGET}-efi \
+ ${datadir}/grub \
+ "
+
+BBCLASSEXTEND = "native"
+
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-git/0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-git/0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch
new file mode 100644
index 000000000..87ec29e32
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-git/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/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-git/0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-git/0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch
new file mode 100644
index 000000000..d5bfaa177
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub-git/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/import-layers/yocto-poky/meta/recipes-bsp/grub/grub/autogen.sh-exclude-pc.patch b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub/autogen.sh-exclude-pc.patch
new file mode 100644
index 000000000..fc5aa4e31
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub/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/import-layers/yocto-poky/meta/recipes-bsp/grub/grub2.inc b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub2.inc
new file mode 100644
index 000000000..146dde60c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub2.inc
@@ -0,0 +1,69 @@
+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 = "ftp://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz \
+ file://grub-2.00-fpmath-sse-387-fix.patch \
+ file://check-if-liblzma-is-disabled.patch \
+ file://fix-issue-with-flex-2.5.37.patch \
+ file://grub-2.00-add-oe-kernel.patch \
+ file://grub-install.in.patch \
+ file://remove-gets.patch \
+ file://fix-endianness-problem.patch \
+ file://grub2-remove-sparc64-setup-from-x86-builds.patch \
+ file://grub-2.00-fix-enable_execute_stack-check.patch \
+ file://grub-no-unused-result.patch \
+ file://grub-efi-allow-a-compilation-without-mcmodel-large.patch \
+ file://grub-efi-fix-with-glibc-2.20.patch \
+ file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+ file://0001-parse_dhcp_vendor-Add-missing-const-qualifiers.patch \
+ file://grub2-fix-initrd-size-bug.patch \
+ file://0001-Fix-CVE-2015-8370-Grub2-user-pass-vulnerability.patch \
+ file://0001-Remove-direct-_llseek-code-and-require-long-filesyst.patch \
+ file://fix-texinfo.patch \
+ "
+
+DEPENDS = "flex-native bison-native"
+
+SRC_URI[md5sum] = "e927540b6eda8b024fb0391eeaa4091c"
+SRC_URI[sha256sum] = "65b39a0558f8c802209c574f4d02ca263a804e8a564bc6caf1cd0fd3b3cc11e3"
+
+COMPATIBLE_HOST = '(x86_64.*|i.86.*)-(linux|freebsd.*)'
+
+inherit autotools gettext texinfo
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[grub-mount] = "--enable-grub-mount,--disable-grub-mount,fuse"
+PACKAGECONFIG[device-mapper] = "--enable-device-mapper,--disable-device-mapper,lvm2"
+
+# 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
+}
+
+# grub and grub-efi's sysroot/${datadir}/grub/grub-mkconfig_lib are
+# conflicted, remove it since no one uses it.
+SYSROOT_PREPROCESS_FUNCS_class-target += "remove_sysroot_mkconfig_lib"
+remove_sysroot_mkconfig_lib() {
+ rm -r "${SYSROOT_DESTDIR}${datadir}/grub/grub-mkconfig_lib"
+}
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/grub_0.97.bb b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub_0.97.bb
new file mode 100644
index 000000000..997a045b2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub_0.97.bb
@@ -0,0 +1,35 @@
+SUMMARY = "GRUB is the GRand Unified Bootloader"
+DESCRIPTION = "GRUB is 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 = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c93c0550bd3173f4504b2cbd8991e50b \
+ file://grub/main.c;beginline=3;endline=9;md5=22a5f28d2130fff9f2a17ed54be90ed6"
+
+RDEPENDS_${PN} = "diffutils"
+PR = "r6"
+
+SRC_URI = "ftp://alpha.gnu.org/gnu/grub/grub-${PV}.tar.gz; \
+ file://no-reorder-functions.patch \
+ file://autohell.patch \
+ file://grub_fix_for_automake-1.12.patch \
+ file://objcopy-absolute.patch \
+ file://grub-support-256byte-inode.patch \
+"
+
+SRC_URI[md5sum] = "cd3f3eb54446be6003156158d51f4884"
+SRC_URI[sha256sum] = "4e1d15d12dbd3e9208111d6b806ad5a9857ca8850c47877d36575b904559260b"
+
+inherit autotools texinfo
+
+COMPATIBLE_HOST = "i.86.*-linux"
+
+EXTRA_OECONF = "--without-curses"
+
+do_install_append_vmware() {
+ mkdir -p ${D}/boot/
+ ln -sf ../usr/lib/grub/{$TARGET_ARCH}{$TARGET_VENDOR}/ ${D}/boot/grub
+}
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/grub_2.00.bb b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub_2.00.bb
new file mode 100644
index 000000000..778074a38
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub_2.00.bb
@@ -0,0 +1,16 @@
+require grub2.inc
+
+RDEPENDS_${PN} = "diffutils freetype"
+PR = "r1"
+
+EXTRA_OECONF = "--with-platform=pc --disable-grub-mkfont --program-prefix="" \
+ --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no"
+
+EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '--enable-largefile', '--disable-largefile', d)}"
+
+do_install_append () {
+ install -d ${D}${sysconfdir}/grub.d
+}
+
+INSANE_SKIP_${PN} = "arch"
+INSANE_SKIP_${PN}-dbg = "arch"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/grub/grub_git.bb b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub_git.bb
new file mode 100644
index 000000000..6919c9a35
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/grub/grub_git.bb
@@ -0,0 +1,52 @@
+require grub2.inc
+
+DEPENDS += "autogen-native"
+
+DEFAULT_PREFERENCE = "-1"
+DEFAULT_PREFERENCE_arm = "1"
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/grub-git:"
+
+PV = "2.00+${SRCPV}"
+SRCREV = "b95e92678882f56056c64ae29092bc9cf129905f"
+SRC_URI = "git://git.savannah.gnu.org/grub.git \
+ file://0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch \
+ file://autogen.sh-exclude-pc.patch \
+ file://0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch \
+ "
+
+S = "${WORKDIR}/git"
+
+COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*)-(linux.*|freebsd.*)'
+
+inherit autotools gettext texinfo
+
+# 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"
+
+EXTRA_OECONF = "--with-platform=${GRUBPLATFORM} --disable-grub-mkfont --program-prefix="" \
+ --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no"
+
+EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '--enable-largefile', '--disable-largefile', d)}"
+
+do_configure_prepend() {
+ ( cd ${S}
+ ${S}/autogen.sh )
+}
+
+do_install_append () {
+ install -d ${D}${sysconfdir}/grub.d
+ rm -rf ${D}${libdir}/charset.alias
+}
+
+# debugedit chokes on bare metal binaries
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+
+RDEPENDS_${PN} = "diffutils freetype"
+
+INSANE_SKIP_${PN} = "arch"
+INSANE_SKIP_${PN}-dbg = "arch"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/gummiboot/gummiboot/0001-console-Fix-C-syntax-errors-for-function-declaration.patch b/import-layers/yocto-poky/meta/recipes-bsp/gummiboot/gummiboot/0001-console-Fix-C-syntax-errors-for-function-declaration.patch
new file mode 100644
index 000000000..fa50bc4a6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/gummiboot/gummiboot/0001-console-Fix-C-syntax-errors-for-function-declaration.patch
@@ -0,0 +1,74 @@
+From 55957faf1272c8f5f304909faeebf647a78e3701 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 9 Sep 2015 07:19:45 +0000
+Subject: [PATCH] console: Fix C syntax errors for function declaration
+
+To address this, the semicolons after the function parameters should be
+replaced by commas, and the last one should be omitted
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/efi/console.c | 26 +++++++++++++-------------
+ 1 file changed, 13 insertions(+), 13 deletions(-)
+
+diff --git a/src/efi/console.c b/src/efi/console.c
+index 6206c80..66aa88f 100644
+--- a/src/efi/console.c
++++ b/src/efi/console.c
+@@ -27,8 +27,8 @@
+ struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL;
+
+ typedef EFI_STATUS (EFIAPI *EFI_INPUT_RESET_EX)(
+- struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This;
+- BOOLEAN ExtendedVerification;
++ struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
++ BOOLEAN ExtendedVerification
+ );
+
+ typedef UINT8 EFI_KEY_TOGGLE_STATE;
+@@ -44,29 +44,29 @@ typedef struct {
+ } EFI_KEY_DATA;
+
+ typedef EFI_STATUS (EFIAPI *EFI_INPUT_READ_KEY_EX)(
+- struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This;
+- EFI_KEY_DATA *KeyData;
++ struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
++ EFI_KEY_DATA *KeyData
+ );
+
+ typedef EFI_STATUS (EFIAPI *EFI_SET_STATE)(
+- struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This;
+- EFI_KEY_TOGGLE_STATE *KeyToggleState;
++ struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
++ EFI_KEY_TOGGLE_STATE *KeyToggleState
+ );
+
+ typedef EFI_STATUS (EFIAPI *EFI_KEY_NOTIFY_FUNCTION)(
+- EFI_KEY_DATA *KeyData;
++ EFI_KEY_DATA *KeyData
+ );
+
+ typedef EFI_STATUS (EFIAPI *EFI_REGISTER_KEYSTROKE_NOTIFY)(
+- struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This;
+- EFI_KEY_DATA KeyData;
+- EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction;
+- VOID **NotifyHandle;
++ struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
++ EFI_KEY_DATA KeyData,
++ EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction,
++ VOID **NotifyHandle
+ );
+
+ typedef EFI_STATUS (EFIAPI *EFI_UNREGISTER_KEYSTROKE_NOTIFY)(
+- struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This;
+- VOID *NotificationHandle;
++ struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
++ VOID *NotificationHandle
+ );
+
+ typedef struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL {
+--
+2.5.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/gummiboot/gummiboot/fix-objcopy.patch b/import-layers/yocto-poky/meta/recipes-bsp/gummiboot/gummiboot/fix-objcopy.patch
new file mode 100644
index 000000000..49f55930d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/gummiboot/gummiboot/fix-objcopy.patch
@@ -0,0 +1,45 @@
+From 0f7f9e3bb1d0e1b93f3ad8a1d5d7bdd3fbf27494 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Thu, 27 Mar 2014 07:20:33 +0000
+Subject: [PATCH] Makefile.am: use objcopy from the env
+
+It uses the "objcopy" directly, which is not suitable for cross compile.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ Makefile.am | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+Index: git/Makefile.am
+===================================================================
+--- git.orig/Makefile.am
++++ git/Makefile.am
+@@ -19,6 +19,8 @@
+ ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
+ AM_MAKEFLAGS = --no-print-directory
+
++OBJCOPY ?= objcopy
++
+ gummibootlibdir = $(prefix)/lib/gummiboot
+
+ AM_CPPFLAGS = -include config.h
+@@ -148,7 +150,7 @@ $(gummiboot_solib): $(gummiboot_objects)
+ .DELETE_ON_ERROR: $(gummboot_solib)
+
+ $(gummiboot): $(gummiboot_solib)
+- $(AM_V_GEN) objcopy -j .text -j .sdata -j .data -j .dynamic \
++ $(AM_V_GEN) $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \
+ -j .dynsym -j .rel -j .rela -j .reloc \
+ --target=efi-app-$(ARCH) $< $@
+
+@@ -183,7 +185,7 @@ $(stub_solib): $(stub_objects)
+ .DELETE_ON_ERROR: $(gummboot_solib)
+
+ $(stub): $(stub_solib)
+- $(AM_V_GEN) objcopy -j .text -j .sdata -j .data -j .dynamic \
++ $(AM_V_GEN) $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \
+ -j .dynsym -j .rel -j .rela -j .reloc \
+ --target=efi-app-$(ARCH) $< $@
+
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/gummiboot/gummiboot_git.bb b/import-layers/yocto-poky/meta/recipes-bsp/gummiboot/gummiboot_git.bb
new file mode 100644
index 000000000..376ab542d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/gummiboot/gummiboot_git.bb
@@ -0,0 +1,37 @@
+SUMMARY = "Gummiboot is a simple UEFI boot manager which executes configured EFI images."
+HOMEPAGE = "http://freedesktop.org/wiki/Software/gummiboot"
+
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=4fbd65380cdd255951079008b364516c"
+
+DEPENDS = "gnu-efi util-linux"
+
+inherit autotools pkgconfig
+inherit deploy
+
+PV = "48+git${SRCPV}"
+SRCREV = "2bcd919c681c952eb867ef1bdb458f1bc49c2d55"
+SRC_URI = "git://anongit.freedesktop.org/gummiboot \
+ file://fix-objcopy.patch \
+ file://0001-console-Fix-C-syntax-errors-for-function-declaration.patch \
+ "
+
+# Note: Add COMPATIBLE_HOST here is only because it depends on gnu-efi
+# which has set the COMPATIBLE_HOST, the gummiboot itself may work on
+# more hosts.
+COMPATIBLE_HOST = "(x86_64.*|i.86.*)-linux"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OECONF = "--disable-manpages --with-efi-includedir=${STAGING_INCDIR} \
+ --with-efi-ldsdir=${STAGING_LIBDIR} \
+ --with-efi-libdir=${STAGING_LIBDIR}"
+
+EXTRA_OEMAKE += "gummibootlibdir=${libdir}/gummiboot"
+
+TUNE_CCARGS_remove = "-mfpmath=sse"
+
+do_deploy () {
+ install ${B}/gummiboot*.efi ${DEPLOYDIR}
+}
+addtask deploy before do_build after do_compile
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/hostap/files/COPYING.patch b/import-layers/yocto-poky/meta/recipes-bsp/hostap/files/COPYING.patch
new file mode 100644
index 000000000..05c70c92e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/hostap/files/COPYING.patch
@@ -0,0 +1,346 @@
+Upstream-Status: Inappropriate [other]
+
+diff -ruN hostap-conf-1.0-orig/COPYING hostap-conf-1.0/COPYING
+--- hostap-conf-1.0-orig/COPYING 1970-01-01 08:00:00.000000000 +0800
++++ hostap-conf-1.0/COPYING 2010-12-09 16:36:48.000000000 +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/import-layers/yocto-poky/meta/recipes-bsp/hostap/files/hostap-fw-load.patch b/import-layers/yocto-poky/meta/recipes-bsp/hostap/files/hostap-fw-load.patch
new file mode 100644
index 000000000..050bdc113
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/hostap/files/hostap-fw-load.patch
@@ -0,0 +1,22 @@
+
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+Upstream-Status: Inappropriate [configuration]
+
+--- hostap-utils-0.2.4/hostap_fw_load~hostap-fw-load
++++ hostap-utils-0.2.4/hostap_fw_load
+@@ -6,9 +6,9 @@
+ # Firmware images for the card
+ # TODO: could try to select correct firmware type automatically
+
+-PRI=/etc/pcmcia/PM010102.HEX
+-STA=/etc/pcmcia/RF010802.HEX
+-PRISM2_SREC=/usr/local/bin/prism2_srec
++PRI=/etc/pcmcia/pm010102.hex
++STA=/etc/pcmcia/rf010804.hex
++PRISM2_SREC=/usr/sbin/prism2_srec
+
+ set -e
+
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/hostap/files/hostap_cs.conf b/import-layers/yocto-poky/meta/recipes-bsp/hostap/files/hostap_cs.conf
new file mode 100644
index 000000000..8dda82aad
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/hostap/files/hostap_cs.conf
@@ -0,0 +1,193 @@
+module "hostap_cs" opts "channel=3 iw_mode=2 essid=any ignore_cis_vcc=1"
+
+card "Actiontec 802CI2"
+ manfid 0x1668, 0x0101
+ bind "hostap_cs"
+
+card "AirWay 802.11 Adapter (PCMCIA)"
+ #version "AirWay", "802.11 Adapter (PCMCIA)"
+ manfid 0x0261, 0x0002
+ bind "hostap_cs"
+
+card "Asus SpaceLink WL110"
+ manfid 0x02aa,0x0002
+ bind "hostap_cs"
+
+## handhelds.org bug 964
+card "Belkin F5D6060 Ethernet"
+ #version "PCMCIA", "11M WLAN Card v2.5", "ISL37300P", "RevA"
+ manfid 0x0274, 0x1612
+ bind "hostap_cs"
+
+card "Compaq 11Mbps Wireless PC Card"
+ manfid 0x028a, 0x0002
+ bind "hostap_cs"
+
+card "Compaq WL100 11 Mbps Wireless Adapter"
+ manfid 0x0138, 0x0002
+ bind "hostap_cs"
+
+card "Compaq HNW-100 11 Mbps Wireless Adapter"
+ manfid 0x028a, 0x0002
+ bind "hostap_cs"
+
+card "D-Link DWL-650"
+ version "D", "Link DWL-650 11Mbps WLAN Card"
+ bind "hostap_cs"
+
+card "D-Link DRC-650"
+ version "D", "Link DRC-650 11Mbps WLAN Card"
+ bind "hostap_cs"
+
+card "D-Link DCF660"
+ manfid 0xd601, 0x0005
+ bind "hostap_cs"
+
+card "Farallon SkyLINE"
+ version "INTERSIL", "HFA384x/IEEE"
+ bind "hostap_cs"
+
+card "HyperLink Wireless PC Card 11Mbps"
+ version "HyperLink", "Wireless PC Card 11Mbps"
+ bind "hostap_cs"
+
+# card "Intersil PRISM2 11 Mbps Wireless Adapter"
+# manfid 0x0156, 0x0002
+# bind "hostap_cs"
+
+card "LA4111 Spectrum24 Wireless LAN PC Card"
+ version "Symbol Technologies"
+ bind "hostap_cs"
+
+card "Linksys WPC11 11Mbps 802.11b WLAN Card"
+ version "Instant Wireless ", " Network PC CARD", "Version 01.02"
+ bind "hostap_cs"
+
+card "Linksys WCF11 11Mbps 802.11b WLAN Card"
+ manfid 0x0274, 0x3301
+ bind "hostap_cs"
+
+## handhelds.org bug #790
+card "Linksys Wireless CompactFlash Card WCF12"
+ manfid 0x028a, 0x0673
+ bind "hostap_cs"
+
+card "Linksys WLAN CF Card"
+ manfid 0x0274, 0x3301
+ bind "hostap_cs"
+
+card "NETGEAR MA701 Wireless CF Card"
+ manfid 0xd601, 0x0002
+ bind "hostap_cs"
+
+card "Nortel Networks eMobility 802.11 Wireless Adapter"
+ manfid 0x01eb, 0x080a
+ bind "hostap_cs"
+
+card "PLANEX GeoWave GW-CF110"
+ version "PLANEX", "GeoWave/GW-CF110"
+ bind "hostap_cs"
+
+card "PROXIM LAN PC CARD HARMONY 80211B"
+ version "PROXIM", "LAN PC CARD HARMONY 80211B"
+ bind "hostap_cs"
+
+card "Proxim RangeLAN/DS"
+ version "PROXIM","RangeLAN-DS/LAN PC CARD"
+ manfid 0x0126, 0x8000
+ bind "hostap_cs"
+
+card "Safeway 802.11b Wireless Adapter"
+ manfid 0xd601, 0x0002
+ bind "hostap_cs"
+
+card "SAMSUNG 11Mbps WLAN Card"
+ version "SAMSUNG", "11Mbps WLAN Card"
+ bind "hostap_cs"
+
+# needs firmware upload via hostap_fw_load
+card "SanDisk ConnectPlus OEM (0MB)"
+ manfid 0xd601, 0x0010
+ bind "hostap_cs"
+
+# needs special activation (>=hostap 0.3.2 only) plus firmware upload
+card "SanDisk ConnectPlus w/ Memory"
+ version "SanDisk", "ConnectPlus"
+ manfid 0xd601, 0x0101
+ bind "hostap_cs" to 0
+# bind "ide-cs" to 1
+
+card "Senao/Origo 80211b WLAN Card"
+ manfid 0x000b,0x7100
+ bind "hostap_cs"
+
+card "Sitecom WL-007 WLAN CF Card"
+ manfid 0xd601, 0x0004
+ bind "hostap_cs"
+
+card "SMC2632 802.11 (prism2) Card"
+ version "SMC", "SMC2632W", "Version 01.02", ""
+ bind "hostap_cs"
+
+card "SpeedStream SS1021 Wireless Adapter"
+ #version "Siemens", "SpeedStream Wireless PCMCIA"
+ manfid 0x02ac, 0x0002
+ bind "hostap_cs"
+
+card "ZCOMAX AirRunner/XI-300"
+ #version "ZCOMAX", "AirRunner/XI-300"
+ manfid 0xd601, 0x0002
+ bind "hostap_cs"
+
+card "Zonet ZCF1100"
+ manfid 0x000b, 0x7100
+ bind "hostap_cs"
+
+card "Wireless LAN Adapter Version 01.02"
+ version "Wireless", "LAN Adapter", "Version 01.02"
+# manfid 0x0156, 0x0002
+ bind "hostap_cs"
+
+card "Ambicom WL1100C 11Mbs Card 802.11b"
+ version "AmbiCom", "WL1100C 802.11b CF-Card", "2.2"
+ manfid 0xd601,0x0002
+ bind "hostap_cs"
+
+card "Ambicom WL1100C 11Mbs Card 802.11b"
+ manfid 0xd601,0x0002
+ bind "hostap_cs"
+
+card "Sandisk Connect SDWCFB-000"
+ manfid 0xd601,0x0005
+ bind "hostap_cs"
+
+# Cards with Intersil firmware (Prism chipset)
+
+card "Linksys WPC11 11Mbps 802.11b WLAN Card"
+ version "The Linksys Group, Inc.", "Instant Wireless Network PC Card", "ISL37300P", "RevA"
+ bind "hostap_cs"
+
+card "Linksys CompactFlash Wireless Card"
+ version "Linksys", "Wireless CompactFlash Card"
+ bind "hostap_cs"
+
+card "ACTIONTEC PRISM Wireless LAN PC Card"
+ version "ACTIONTEC", "PRISM Wireless LAN PC Card"
+ bind "hostap_cs"
+
+card "Linksys WPC11 Version 3"
+ manfid 0x0274,0x1613
+ bind "hostap_cs"
+
+card "BENQ AWL100"
+ version "BENQ", "AWL100 PCMCIA ADAPTER"
+ bind "hostap_cs"
+
+card "Pretec WLAN"
+ version "Pretec", "CompactWLAN Card 802.11b", "2.5"
+ manfid 0x0156, 0x0002
+ bind "hostap_cs"
+
+card "TrendNet TEW PC16"
+ manfid 0x0274, 0x1601
+ bind "hostap_cs"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/hostap/files/hostap_cs.conf-upstream b/import-layers/yocto-poky/meta/recipes-bsp/hostap/files/hostap_cs.conf-upstream
new file mode 100644
index 000000000..5b7385a7c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/hostap/files/hostap_cs.conf-upstream
@@ -0,0 +1,191 @@
+device "hostap_cs"
+ class "network" module "hostap", "hostap_cs"
+
+card "Intersil PRISM2 Reference Design 11Mb/s WLAN Card"
+ version "INTERSIL", "HFA384x/IEEE"
+ bind "hostap_cs"
+
+card "Compaq WL100 11Mb/s WLAN Card"
+ manfid 0x0138, 0x0002
+ bind "hostap_cs"
+
+card "Compaq WL200"
+ version "Compaq", "WL200_11Mbps_Wireless_PCI_Card"
+ bind "hostap_cs"
+
+card "EMTAC A2424i 11Mbps WLAN Card"
+ manfid 0xc250, 0x0002
+# cis "cis/Emtac.dat"
+ bind "hostap_cs"
+
+card "Linksys WPC11 11Mbps WLAN Card"
+ version "Instant Wireless ", " Network PC CARD", "Version 01.02"
+ bind "hostap_cs"
+
+card "Linksys WPC11 Ver 2.5 11Mbps WLAN Card"
+ manfid 0x0274, 0x1612
+ bind "hostap_cs"
+
+card "Linksys WPC11 Ver 3 11Mbps WLAN Card"
+ manfid 0x0274, 0x1613
+ bind "hostap_cs"
+
+card "Linksys WCF12 Wireless CompactFlash Card"
+ version "Linksys", "Wireless CompactFlash Card"
+ bind "hostap_cs"
+
+card "D-Link DWL-650 11Mbps WLAN Card"
+ version "D", "Link DWL-650 11Mbps WLAN Card", "Version 01.02"
+ bind "hostap_cs"
+
+card "D-Link DRC-650 11Mbps WLAN Card"
+# version "D", "Link DRC-650 11Mbps WLAN Card", "Version 01.02"
+ manfid 0x028a, 0x0002
+ bind "hostap_cs"
+
+card "ZoomAir 4100 11Mb/s WLAN Card"
+ version "ZoomAir 11Mbps High", "Rate wireless Networking"
+ bind "hostap_cs"
+
+card "Addtron AWP-100 11Mbps WLAN Card"
+ version "Addtron", "AWP-100 Wireless PCMCIA", "Version 01.02"
+ bind "hostap_cs"
+
+card "Samsung SWL2000-N 11Mb/s WLAN Card"
+ manfid 0x0250, 0x0002
+ bind "hostap_cs"
+
+card "SMC 2632W 11Mbps WLAN Card"
+ version "SMC", "SMC2632W", "Version 01.02"
+ bind "hostap_cs"
+
+card "BroMax Freeport 11Mbps WLAN Card"
+ version "Intersil", "PRISM 2_5 PCMCIA ADAPTER", "ISL37300P", "Eval-RevA"
+ bind "hostap_cs"
+
+card "Z-Com XI300 11Mb/s WLAN Card"
+ manfid 0xd601, 0x0002
+ bind "hostap_cs"
+
+card "Zcomax XI-325H 200mW"
+# version " ", "IEEE 802.11 Wireless LAN/PC Card"
+ manfid 0xd601, 0x0005
+ bind "hostap_cs"
+
+card "3Com AirConnect PCI 777A"
+ manfid 0x0101, 0x0777
+ bind "hostap_cs"
+
+card "U.S. Robotics IEEE 802.11b PC-CARD"
+ version "U.S. Robotics", "IEEE 802.11b PC-CARD", "Version 01.02"
+# manfid 0x0156, 0x0002
+ bind "hostap_cs"
+
+card "Longshine LCR-8531 11Mbps WLAN PCMCIA CARD"
+ version "OEM", "PRISM2 IEEE 802.11 PC-Card", "Version 01.02"
+# manfid 0x0156, 0x0002
+ bind "hostap_cs"
+
+card "Philips 802.11b WLAN PCMCIA"
+ manfid 0x000b, 0x7300
+ bind "hostap_cs"
+
+card "Proxim RangeLAN"
+# version "PROXIM", "RangeLAN-DS/LAN PC CARD"
+ manfid 0x0126, 0x8000
+ bind "hostap_cs"
+
+card "Buffalo WLI-CF-S11G"
+ version "BUFFALO", "WLI-CF-S11G"
+# manfid 0x026f, 0x030b
+ bind "hostap_cs"
+
+card "Level-One WPC-0100"
+ version "Digital Data Communications", "WPC-0100", "Version 00.00"
+ manfid 0x0156, 0x0002
+ bind "hostap_cs"
+
+card "Belkin 802.11b WLAN PCMCIA"
+ version "Belkin", "11Mbps Wireless Notebook Network Adapter", "Version 01.02"
+ manfid 0x0156, 0x0002
+ bind "hostap_cs"
+
+card "Senao SL-2011CD/SL-2011CDPLUS"
+ version "INTERSIL", "HFA384x/IEEE", "Version 01.02"
+ manfid 0x0156, 0x0002
+ bind "hostap_cs"
+
+card "Fulbond Airbond XI-300B"
+ version " ", "IEEE 802.11 Wireless LAN/PC Card"
+ manfid 0xd601, 0x0002
+ bind "hostap_cs"
+
+card "Netgear MA401"
+ version "NETGEAR MA401 Wireless PC", "Card", "Version 01.00"
+# manfid 0x0156, 0x0002
+ bind "hostap_cs"
+
+card "D-Link DWL-650 Rev. P1"
+ version "D-Link", "DWL-650 Wireless PC Card RevP", "ISL37101P-10", "A3"
+# manfid 0x000b, 0x7110
+ bind "hostap_cs"
+
+card "SonicWALL Long Range Wireless Card"
+ version "SonicWALL", "Long Range Wireless Card", "ISL37100P", "1.0"
+ manfid 0x000b, 0x7100
+ bind "hostap_cs"
+
+card "Senao NL-2011CD PLUS Ext2 Mercury"
+ version "WLAN", "11Mbps_PC-Card_3.0", "ISL37100P", "Eval-RevA"
+ manfid 0x000b, 0x7100
+ bind "hostap_cs"
+
+card "Airvast WL100"
+ version "AIRVAST", "IEEE 802.11b Wireless PCMCIA Card", "HFA3863"
+ manfid 0x50c2, 0x0001
+ bind "hostap_cs"
+
+card "Microsoft Wireless Notebook Adapter MN-520 1.0.3"
+ version "Microsoft", "Wireless Notebook Adapter MN-520", "", "1.0.3"
+ manfid 0x02d2, 0x0001
+ bind "hostap_cs"
+
+card "NETGEAR MA401RA"
+ version "NETGEAR MA401RA Wireless PC", "Card", "ISL37300P", "Eval-RevA"
+ manfid 0x000b, 0x7300
+ bind "hostap_cs"
+
+card "Allied Telesyn AT-WCL452"
+ version "Allied Telesyn", "AT-WCL452 Wireless PCMCIA Radio", "Ver. 1.00"
+ manfid 0xc00f, 0x0000
+ bind "hostap_cs"
+
+card "corega WL PCCL-11"
+ version "corega", "WL PCCL-11", "ISL37300P", "RevA"
+ manfid 0xc00f, 0x0000
+ bind "hostap_cs"
+
+card "SanDisk ConnectPlus"
+ version "SanDisk", "ConnectPlus"
+ manfid 0xd601, 0x0101
+ bind "hostap_cs" to 0
+ bind "ide-cs" to 1
+
+card "ASUS WL-100 8011b WLAN PC Card"
+ version "ASUS", "802_11b_PC_CARD_25", "Version 01.00"
+ manfid 0x02aa, 0x0002
+ bind "hostap_cs"
+
+card "ZyXel Zyair B-101 802.11b WLAN card"
+ version " ", "IEEE 802.11 Wireless LAN/PC Card"
+ manfid 0xd601, 0x0010
+ bind "hostap_cs"
+
+card "WLAN PRISM PCMCIA CARD 37300P RevB6"
+ version "WLAN", "PRISM PCMCIA CARD", "37300P", "Revision B6"
+ manfid 0x50c2, 0x7300
+ bind "hostap_cs"
+
+
+# Optional configuration parameters for hostap_cs.o
+# module "hostap_cs" opts "channel=3 iw_mode=3 essid=test ignore_cis_vcc=0"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/hostap/files/hostap_cs.modalias b/import-layers/yocto-poky/meta/recipes-bsp/hostap/files/hostap_cs.modalias
new file mode 100644
index 000000000..284835151
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/hostap/files/hostap_cs.modalias
@@ -0,0 +1,28 @@
+# product info: "Pretec", "CompactWLAN Card 802.11b", "2.5"
+alias pcmcia:m0156c0002f06fn00pfn00pa1CADD3E5pbE697636Cpc7A5BFCF1pd00000000 hostap_cs
+
+# manufacturer ID which exist in orinoco_cs AND in hostap_cs
+alias pcmcia:m000Bc7100f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:m000Bc7300f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:m0126c8000f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:m0138c0002f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:m0250c0002f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:m0274c1612f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:m0274c1613f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:m028Ac0002f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:m02AAc0002f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:m50C2c7300f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:mD601c0002f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:mD601c0005f06fn00pfn00pa*pb*pc*pd* hostap_cs
+
+# product info: "Linksys", "Wireless CompactFlash Card", "", ""
+alias pcmcia:m028Ac0673f06fn00pfn00pa0733CC81pb0C52F395pc00000000pd00000000 hostap_cs
+
+# product info:"PLANEX COMMUNICATION INC","PLANEX GW-CF11X Wireless CF Card", "", ""
+alias pcmcia:mD601c0010f06fn00pfn00pa4703CF68pbFAD7318Dpc00000000pd00000000 hostap_cs
+
+# 0x0156, 0x0002 and "Version 01.02" only appear for Prism based cards.
+alias pcmcia:m0156c0002f06fn00pfn00pa*pb*pc4B74BAA0pd00000000 hostap_cs
+
+# "BUFFALO", "WLI-CF-S11G", "", ""
+alias pcmcia:m026Fc030Bf06fn00pfn00pa2DECECE3pb82067C18pc00000000pd00000000 hostap_cs
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/hostap/hostap-conf_1.0.bb b/import-layers/yocto-poky/meta/recipes-bsp/hostap/hostap-conf_1.0.bb
new file mode 100644
index 000000000..e1d4c5477
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/hostap/hostap-conf_1.0.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Configuration files for HostAP (wifi) driver"
+DESCRIPTION = "PCMCIA-cs configuration files for wireless LAN cards based on Intersil's Prism2/2.5/3 chipset."
+SECTION = "kernel/modules"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
+PR = "r15"
+
+SRC_URI = "file://hostap_cs.modalias \
+ file://COPYING.patch"
+
+inherit allarch
+
+S = "${WORKDIR}"
+
+do_compile() {
+}
+
+do_install() {
+ install -d ${D}${sysconfdir}/modprobe.d
+
+ install -m 0644 ${WORKDIR}/hostap_cs.modalias ${D}${sysconfdir}/modprobe.d/hostap_cs.conf
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/hostap/hostap-utils-0.4.7/0001-Define-_u32-__s32-__u16-__s16-__u8-in-terms-of-c99-t.patch b/import-layers/yocto-poky/meta/recipes-bsp/hostap/hostap-utils-0.4.7/0001-Define-_u32-__s32-__u16-__s16-__u8-in-terms-of-c99-t.patch
new file mode 100644
index 000000000..b44dca3ec
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/hostap/hostap-utils-0.4.7/0001-Define-_u32-__s32-__u16-__s16-__u8-in-terms-of-c99-t.patch
@@ -0,0 +1,36 @@
+From 742fb110d9841a04b3ced256b0bf80ff304dcaff Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 31 Aug 2015 05:45:08 +0000
+Subject: [PATCH] Define _u32/__s32/__u16/__s16/__u8 in terms of c99 types
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ wireless_copy.h | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/wireless_copy.h b/wireless_copy.h
+index 8208258..1171a35 100644
+--- a/wireless_copy.h
++++ b/wireless_copy.h
+@@ -86,11 +86,11 @@
+ #else
+ #include <sys/types.h>
+ #include <net/if.h>
+-typedef __uint32_t __u32;
+-typedef __int32_t __s32;
+-typedef __uint16_t __u16;
+-typedef __int16_t __s16;
+-typedef __uint8_t __u8;
++typedef u_int32_t __u32;
++typedef int32_t __s32;
++typedef u_int16_t __u16;
++typedef int16_t __s16;
++typedef u_int8_t __u8;
+ #ifndef __user
+ #define __user
+ #endif /* __user */
+--
+2.5.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/hostap/hostap-utils-0.4.7/ldflags.patch b/import-layers/yocto-poky/meta/recipes-bsp/hostap/hostap-utils-0.4.7/ldflags.patch
new file mode 100644
index 000000000..3e99d0d92
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/hostap/hostap-utils-0.4.7/ldflags.patch
@@ -0,0 +1,27 @@
+Obey LDFLAGS
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+Upstream-Status: Pending
+
+--- hostap-utils-0.4.7.orig/Makefile
++++ hostap-utils-0.4.7/Makefile
+@@ -14,17 +14,17 @@ prism2_srec.o: prism2_srec.c util.h
+ hostap_crypt_conf: hostap_crypt_conf.c
+
+ hostap_diag: hostap_diag.o util.o
+- $(CC) -o hostap_diag $(CFLAGS) hostap_diag.o util.o
++ $(CC) -o hostap_diag $(CFLAGS) $(LDFLAGS) hostap_diag.o util.o
+
+ hostap_diag.o: hostap_diag.c util.h
+
+ util.o: util.c util.h
+
+ hostap_io_debug: hostap_io_debug.c
+- $(CC) -o hostap_io_debug $(CFLAGS) hostap_io_debug.c
++ $(CC) -o hostap_io_debug $(CFLAGS) $(LDFLAGS) hostap_io_debug.c
+
+ hostap_rid: hostap_rid.o util.o
+- $(CC) -o hostap_rid $(CFLAGS) hostap_rid.o util.o
++ $(CC) -o hostap_rid $(CFLAGS) $(LDFLAGS) hostap_rid.o util.o
+
+ hostap_rid.o: hostap_rid.c util.h
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/hostap/hostap-utils.inc b/import-layers/yocto-poky/meta/recipes-bsp/hostap/hostap-utils.inc
new file mode 100644
index 000000000..140321d0c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/hostap/hostap-utils.inc
@@ -0,0 +1,28 @@
+SUMMARY = "User mode helpers for the hostap driver"
+DESCRIPTION = "The hostap driver supports Host AP mode, it allows for IEEE 802.11 \
+management functions on the host computer and allows the system to act as an access point."
+HOMEPAGE = "http://hostap.epitest.fi"
+BUGTRACKER = "http://hostap.epitest.fi/bugz/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
+ file://util.c;beginline=1;endline=9;md5=d3b9280851302e5ba34e5fb717489b6d"
+SECTION = "kernel/userland"
+PR = "r4"
+
+SRC_URI = "http://hostap.epitest.fi/releases/hostap-utils-${PV}.tar.gz \
+ file://hostap-fw-load.patch \
+ file://0001-Define-_u32-__s32-__u16-__s16-__u8-in-terms-of-c99-t.patch \
+"
+S = "${WORKDIR}/hostap-utils-${PV}"
+
+BINARIES = "hostap_crypt_conf hostap_diag hostap_fw_load hostap_io_debug \
+ hostap_rid prism2_param prism2_srec split_combined_hex"
+
+do_install() {
+ install -d ${D}${sbindir}/
+ for f in ${BINARIES}
+ do
+ install -m 0755 $f ${D}${sbindir}/
+ done
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/hostap/hostap-utils_0.4.7.bb b/import-layers/yocto-poky/meta/recipes-bsp/hostap/hostap-utils_0.4.7.bb
new file mode 100644
index 000000000..be5481f6f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/hostap/hostap-utils_0.4.7.bb
@@ -0,0 +1,5 @@
+require hostap-utils.inc
+
+SRC_URI += "file://ldflags.patch"
+SRC_URI[md5sum] = "afe041581b8f01666e353bec20917c85"
+SRC_URI[sha256sum] = "c6f598d8e356c1620fa009eca0a700bf1105e16817eefd77d891994261009355"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/keymaps/files/GPLv2.patch b/import-layers/yocto-poky/meta/recipes-bsp/keymaps/files/GPLv2.patch
new file mode 100644
index 000000000..1ee8181f1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/keymaps/files/keymap.sh b/import-layers/yocto-poky/meta/recipes-bsp/keymaps/files/keymap.sh
new file mode 100755
index 000000000..6ebc63426
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/keymaps/keymaps_1.0.bb b/import-layers/yocto-poky/meta/recipes-bsp/keymaps/keymaps_1.0.bb
new file mode 100644
index 000000000..5793a7652
--- /dev/null
+++ b/import-layers/yocto-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
+}
+
+DEPENDS_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/import-layers/yocto-poky/meta/recipes-bsp/libacpi/files/ldflags.patch b/import-layers/yocto-poky/meta/recipes-bsp/libacpi/files/ldflags.patch
new file mode 100644
index 000000000..a7424c39d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/libacpi/files/libacpi_fix_for_x32.patch b/import-layers/yocto-poky/meta/recipes-bsp/libacpi/files/libacpi_fix_for_x32.patch
new file mode 100644
index 000000000..2fed344ba
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/libacpi/files/libacpi_fix_for_x32.patch
@@ -0,0 +1,47 @@
+Upstream-Status: Pending
+
+Fix libacpi for x32
+
+ libacpi doesn't use base_libdir for install. This patch adds
+ base_libdir support so that x32 libraries are installed properly.
+
+Patch Received from: H.J. Lu <hjl.tools@gmail.com>
+
+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
+@@ -8,6 +8,10 @@ SRC_test = test-libacpi.c libacpi.c list
+ OBJ = ${SRC:.c=.o}
+ OBJ_test = ${SRC_test:.c=.o}
+
++ifndef base_libdir
++base_libdir=/lib
++endif
++
+ all: options libacpi.a libacpi.so test-libacpi
+
+ options:
+@@ -42,13 +46,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}${PREFIX}${base_libdir}
++ @mkdir -p ${DESTDIR}${PREFIX}${base_libdir}
++ @cp -f libacpi.a ${DESTDIR}${PREFIX}${base_libdir}
++ @chmod 644 ${DESTDIR}${PREFIX}${base_libdir}/libacpi.a
++ @cp -f ${SONAME} ${DESTDIR}${PREFIX}${base_libdir}/
++ @chmod 644 ${DESTDIR}${PREFIX}${base_libdir}/${SONAME}
++ @ln -s ${SONAME} ${DESTDIR}${PREFIX}${base_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/import-layers/yocto-poky/meta/recipes-bsp/libacpi/files/makefile-fix.patch b/import-layers/yocto-poky/meta/recipes-bsp/libacpi/files/makefile-fix.patch
new file mode 100644
index 000000000..c34ef34e0
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/libacpi/files/use_correct_strip_in_cross_environment.patch b/import-layers/yocto-poky/meta/recipes-bsp/libacpi/files/use_correct_strip_in_cross_environment.patch
new file mode 100644
index 000000000..bca75fb47
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/libacpi/libacpi_0.2.bb b/import-layers/yocto-poky/meta/recipes-bsp/libacpi/libacpi_0.2.bb
new file mode 100644
index 000000000..6dc66ea25
--- /dev/null
+++ b/import-layers/yocto-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}
+}
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/acdefine.patch b/import-layers/yocto-poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/acdefine.patch
new file mode 100644
index 000000000..682cf416e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/autotools.patch b/import-layers/yocto-poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/autotools.patch
new file mode 100644
index 000000000..394519855
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/gettext.patch b/import-layers/yocto-poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/gettext.patch
new file mode 100644
index 000000000..1a24a1f05
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/lrzsz-check-locale.h.patch b/import-layers/yocto-poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/lrzsz-check-locale.h.patch
new file mode 100644
index 000000000..9e46dfa07
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/lrzsz_fix_for_automake-1.12.patch b/import-layers/yocto-poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/lrzsz_fix_for_automake-1.12.patch
new file mode 100644
index 000000000..b4529f4c7
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/makefile.patch b/import-layers/yocto-poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/makefile.patch
new file mode 100644
index 000000000..ace592c8f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/lrzsz/lrzsz_0.12.20.bb b/import-layers/yocto-poky/meta/recipes-bsp/lrzsz/lrzsz_0.12.20.bb
new file mode 100644
index 000000000..4b349be32
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/pciutils/pciutils/configure.patch b/import-layers/yocto-poky/meta/recipes-bsp/pciutils/pciutils/configure.patch
new file mode 100644
index 000000000..66c9f9163
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/pciutils/pciutils/configure.patch
@@ -0,0 +1,104 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+---
+
+7/30/2010 - rebased to 3.1.5 by Qing He <qing.he@intel.com>
+1/22/2012 - rebased to 3.1.9 by Shane Wang <shane.wang@intel.com>
+
+diff -r af2b10cc3c14 Makefile
+--- a/Makefile Sun Jan 22 18:36:34 2012 +0800
++++ b/Makefile Sun Jan 22 18:38:54 2012 +0800
+@@ -37,7 +37,6 @@
+ # Commands
+ INSTALL=install
+ DIRINSTALL=install -d
+-STRIP=-s
+ CC=$(CROSS_COMPILE)gcc
+ AR=$(CROSS_COMPILE)ar
+ RANLIB=$(CROSS_COMPILE)ranlib
+@@ -86,7 +85,7 @@
+ example.o: example.c $(PCIINC)
+
+ %: %.o
+- $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LDLIBS) -o $@
++ $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LIB_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)#"
+@@ -101,7 +100,7 @@
+ install: all
+ # -c is ignored on Linux, but required on FreeBSD
+ $(DIRINSTALL) -m 755 $(DESTDIR)$(SBINDIR) $(DESTDIR)$(IDSDIR) $(DESTDIR)$(MANDIR)/man8 $(DESTDIR)$(MANDIR)/man7
+- $(INSTALL) -c -m 755 $(STRIP) lspci setpci $(DESTDIR)$(SBINDIR)
++ $(INSTALL) -c -m 755 lspci setpci $(DESTDIR)$(SBINDIR)
+ $(INSTALL) -c -m 755 update-pciids $(DESTDIR)$(SBINDIR)
+ $(INSTALL) -c -m 644 $(PCI_IDS) $(DESTDIR)$(IDSDIR)
+ $(INSTALL) -c -m 644 lspci.8 setpci.8 update-pciids.8 $(DESTDIR)$(MANDIR)/man8
+diff -r af2b10cc3c14 lib/configure
+--- a/lib/configure Sun Jan 22 18:36:34 2012 +0800
++++ b/lib/configure Sun Jan 22 18:38:54 2012 +0800
+@@ -14,6 +14,10 @@
+ fi
+ }
+
++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
+@@ -21,8 +25,8 @@
+
+ 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
+@@ -30,7 +34,7 @@
+ 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
+@@ -40,7 +44,7 @@
+ 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.
+@@ -49,6 +53,21 @@
+ sys=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ echo " $host $rel $cpu $sys"
+
++if [ "$host" = "linux--gnueabi" ]
++then
++ sys=linux
++fi
++
++if [ "$host" = "linux--uclibc" ]
++then
++ sys=linux
++fi
++
++if [ "$host" = "linux--uclibceabi" ]
++then
++ sys=linux
++fi
++
+ c=config.h
+ m=config.mk
+ echo >$c '#define PCI_CONFIG_H'
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/pciutils/pciutils/guess-fix.patch b/import-layers/yocto-poky/meta/recipes-bsp/pciutils/pciutils/guess-fix.patch
new file mode 100644
index 000000000..540b4a0d1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/pciutils/pciutils/guess-fix.patch
@@ -0,0 +1,37 @@
+the original guess algorithm is broken for many archs
+for example, the following two would break:
+ arm-linux-gnueabi --> sys=gnueabi
+ x86_64-unknown-pc-linux-gnu --> sys = pc-linux-gnu
+
+use a simpler scheme here and hope it works for all the cases
+
+Upstream-Status: Pending
+
+7/30/2010 - created by Qing He <qing.he@intel.com>
+
+diff --git a/lib/configure b/lib/configure
+index 4318b05..84f6acb 100755
+--- a/lib/configure
++++ b/lib/configure
+@@ -53,20 +53,7 @@ cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+ sys=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ echo " $host $rel $cpu $sys"
+
+-if [ "$host" = "linux--gnueabi" ]
+-then
+- sys=linux
+-fi
+-
+-if [ "$host" = "linux--uclibc" ]
+-then
+- sys=linux
+-fi
+-
+-if [ "$host" = "linux--uclibceabi" ]
+-then
+- sys=linux
+-fi
++{ echo "$host" | grep linux; } && sys=linux
+
+ c=config.h
+ m=config.mk
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/pciutils/pciutils/makefile.patch b/import-layers/yocto-poky/meta/recipes-bsp/pciutils/pciutils/makefile.patch
new file mode 100644
index 000000000..c3fbc6f9b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/pciutils/pciutils/makefile.patch
@@ -0,0 +1,26 @@
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Ionut Radu <ionutx.radu@intel.com>
+
+Index: pciutils-3.2.0/Makefile
+===================================================================
+--- pciutils-3.2.0.orig/Makefile
++++ pciutils-3.2.0/Makefile
+@@ -35,7 +35,7 @@ SHAREDIR=$(PREFIX)/share
+ IDSDIR=$(SHAREDIR)
+ MANDIR:=$(shell if [ -d $(PREFIX)/share/man ] ; then echo $(PREFIX)/share/man ; else echo $(PREFIX)/man ; fi)
+ INCDIR=$(PREFIX)/include
+-LIBDIR=$(PREFIX)/lib
++LIBDIR=$(libdir)
+ PKGCFDIR=$(LIBDIR)/pkgconfig
+
+ # Commands
+@@ -94,7 +94,7 @@ example: example.o lib/$(PCILIB_DEV)
+ example.o: example.c $(PCIINC)
+
+ %: %.o
+- $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LIB_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)#"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/pciutils/pciutils_3.4.1.bb b/import-layers/yocto-poky/meta/recipes-bsp/pciutils/pciutils_3.4.1.bb
new file mode 100644
index 000000000..33be525c5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/pciutils/pciutils_3.4.1.bb
@@ -0,0 +1,60 @@
+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 \
+ file://guess-fix.patch \
+ file://makefile.patch"
+
+SRC_URI[md5sum] = "35763bb1eab7bc9bf6eb6efb72cbc8a1"
+SRC_URI[sha256sum] = "865554cc5604d1644bd8da38d94845405e2a319a6d5acabc6a0296417684a82a"
+
+inherit multilib_header
+
+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"
+
+# see configure.patch
+do_configure () {
+ (
+ cd lib && \
+ # EXTRA_OECONF for this recipe could only possibly contain 'HWDB=yes/no', so we put it
+ # before ./configure
+ ${PCI_CONF_FLAG} ${EXTRA_OECONF} ./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/import-layers/yocto-poky/meta/recipes-bsp/pcmciautils/pcmciautils-018/lex_sys_types.patch b/import-layers/yocto-poky/meta/recipes-bsp/pcmciautils/pcmciautils-018/lex_sys_types.patch
new file mode 100644
index 000000000..d4c2bed15
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/pcmciautils/pcmciautils-018/makefile_fix.patch b/import-layers/yocto-poky/meta/recipes-bsp/pcmciautils/pcmciautils-018/makefile_fix.patch
new file mode 100644
index 000000000..7b0ce2119
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/pcmciautils/pcmciautils-018/makefile_race.patch b/import-layers/yocto-poky/meta/recipes-bsp/pcmciautils/pcmciautils-018/makefile_race.patch
new file mode 100644
index 000000000..f5a518ff7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/pcmciautils/pcmciautils-018/makefile_race.patch
@@ -0,0 +1,43 @@
+"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
+@@ -249,6 +249,9 @@ $(PCMCIA_SOCKET_STARTUP): $(LIBC) src/st
+ yacc_config.o lex_config.o: %.o: %.c src/yacc_config.h
+ $(CC) -c -MD -O -pipe $(CPPFLAGS) $<
+
++src/lex_config.o : src/lex_config.c src/yacc_config.h
++ $(QUIET) $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
++
+ debugtools: ccdv $(CBDUMP) $(CISDUMP)
+
+ $(CBDUMP): $(LIBC) debug/cbdump.o
+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/import-layers/yocto-poky/meta/recipes-bsp/pcmciautils/pcmciautils.inc b/import-layers/yocto-poky/meta/recipes-bsp/pcmciautils/pcmciautils.inc
new file mode 100644
index 000000000..581bff417
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/pcmciautils/pcmciautils.inc
@@ -0,0 +1,32 @@
+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}"
+
+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/import-layers/yocto-poky/meta/recipes-bsp/pcmciautils/pcmciautils_018.bb b/import-layers/yocto-poky/meta/recipes-bsp/pcmciautils/pcmciautils_018.bb
new file mode 100644
index 000000000..3556a45cf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/pcmciautils/pcmciautils_018.bb
@@ -0,0 +1,13 @@
+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"
+
+FILES_${PN} += "*/udev */*/udev"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/pm-utils/pm-utils_1.4.1.bb b/import-layers/yocto-poky/meta/recipes-bsp/pm-utils/pm-utils_1.4.1.bb
new file mode 100644
index 000000000..27cb3dbe8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/pm-utils/pm-utils_1.4.1.bb
@@ -0,0 +1,25 @@
+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
+
+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/import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/COPYING b/import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/COPYING
new file mode 100644
index 000000000..63f529381
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/COPYING
@@ -0,0 +1,2 @@
+This is a blank COPYING file, and should be filled in by original author in future.
+
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/pointercal b/import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/pointercal
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/pointercal
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/qemuarm/pointercal b/import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/qemuarm/pointercal
new file mode 100644
index 000000000..abd84ca4b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/qemuarm/pointercal
@@ -0,0 +1 @@
+8313 4 -8526 7 8334 -82604 65536
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/qemuarmv6/pointercal b/import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/qemuarmv6/pointercal
new file mode 100644
index 000000000..abd84ca4b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/qemuarmv6/pointercal
@@ -0,0 +1 @@
+8313 4 -8526 7 8334 -82604 65536
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/qemuarmv7/pointercal b/import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/qemuarmv7/pointercal
new file mode 100644
index 000000000..abd84ca4b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/qemuarmv7/pointercal
@@ -0,0 +1 @@
+8313 4 -8526 7 8334 -82604 65536
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/qemumips/pointercal b/import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/qemumips/pointercal
new file mode 100644
index 000000000..abd84ca4b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/qemumips/pointercal
@@ -0,0 +1 @@
+8313 4 -8526 7 8334 -82604 65536
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/qemuppc/pointercal b/import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/qemuppc/pointercal
new file mode 100644
index 000000000..c2d6e37bf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/qemuppc/pointercal
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/qemux86-64/pointercal b/import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/qemux86-64/pointercal
new file mode 100644
index 000000000..640053d39
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/qemux86-64/pointercal
@@ -0,0 +1 @@
+1280 0 1002 0 960 328 65536
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/qemux86/pointercal b/import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/qemux86/pointercal
new file mode 100644
index 000000000..640053d39
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal/qemux86/pointercal
@@ -0,0 +1 @@
+1280 0 1002 0 960 328 65536
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal_0.0.bb b/import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal_0.0.bb
new file mode 100644
index 000000000..df735a59f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/pointercal/pointercal_0.0.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Touchscreen calibration data"
+SECTION = "base"
+PR = "r11"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4b5fcfc87fb615860d398b5e38685edf"
+
+SRC_URI = "file://pointercal \
+ file://COPYING"
+
+S = "${WORKDIR}"
+
+do_install() {
+ # Only install file if it has a contents
+ if [ -s ${S}/pointercal ]; then
+ install -d ${D}${sysconfdir}/
+ install -m 0644 ${S}/pointercal ${D}${sysconfdir}/
+ fi
+}
+
+ALLOW_EMPTY_${PN} = "1"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+INHIBIT_DEFAULT_DEPS = "1"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/setserial/setserial/add_stdlib.patch b/import-layers/yocto-poky/meta/recipes-bsp/setserial/setserial/add_stdlib.patch
new file mode 100644
index 000000000..e34f262a8
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/setserial/setserial/ldflags.patch b/import-layers/yocto-poky/meta/recipes-bsp/setserial/setserial/ldflags.patch
new file mode 100644
index 000000000..174adc89f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/setserial/setserial_2.17.bb b/import-layers/yocto-poky/meta/recipes-bsp/setserial/setserial_2.17.bb
new file mode 100644
index 000000000..8dbddd7dc
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2016.03.bb b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2016.03.bb
new file mode 100644
index 000000000..dfda5c1d3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2016.03.bb
@@ -0,0 +1,49 @@
+SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6"
+SECTION = "bootloader"
+DEPENDS = "mtd-utils"
+
+# This revision corresponds to the tag "v2016.03"
+# We use the revision in order to avoid having to fetch it from the
+# repo during parse
+SRCREV = "df61a74e6845ec9bdcdd48d2aff5e9c2c6debeaa"
+
+PV = "v2016.03+git${SRCPV}"
+
+SRC_URI = "git://git.denx.de/u-boot.git;branch=master"
+
+S = "${WORKDIR}/git"
+
+INSANE_SKIP_${PN} = "already-stripped"
+EXTRA_OEMAKE_class-target = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${CC} ${CFLAGS} ${LDFLAGS}" V=1'
+EXTRA_OEMAKE_class-cross = 'ARCH=${TARGET_ARCH} CC="${CC} ${CFLAGS} ${LDFLAGS}" V=1'
+
+inherit uboot-config
+
+do_compile () {
+ oe_runmake ${UBOOT_MACHINE}
+ oe_runmake env
+}
+
+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_PREPROCESS_FUNCS_class-cross = "uboot_fw_utils_cross"
+uboot_fw_utils_cross() {
+ sysroot_stage_dir ${D}${bindir_cross} ${SYSROOT_DESTDIR}${bindir_cross}
+}
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+BBCLASSEXTEND = "cross"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-mkimage_2016.03.bb b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-mkimage_2016.03.bb
new file mode 100644
index 000000000..d5921a044
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot-mkimage_2016.03.bb
@@ -0,0 +1,32 @@
+SUMMARY = "U-Boot bootloader image creation tool"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6"
+SECTION = "bootloader"
+
+DEPENDS = "openssl"
+
+# This revision corresponds to the tag "v2016.03"
+# We use the revision in order to avoid having to fetch it from the
+# repo during parse
+SRCREV = "df61a74e6845ec9bdcdd48d2aff5e9c2c6debeaa"
+
+PV = "v2016.03+git${SRCPV}"
+
+SRC_URI = "git://git.denx.de/u-boot.git;branch=master"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OEMAKE = 'CROSS_COMPILE="${TARGET_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" STRIP=true V=1'
+
+do_compile () {
+ oe_runmake sandbox_defconfig
+ 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
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot.inc b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot.inc
new file mode 100644
index 000000000..3ba866de0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot.inc
@@ -0,0 +1,289 @@
+SUMMARY = "Universal Boot Loader for embedded devices"
+HOMEPAGE = "http://www.denx.de/wiki/U-Boot/WebHome"
+SECTION = "bootloaders"
+PROVIDES = "virtual/bootloader"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6"
+
+SRC_URI = "git://git.denx.de/u-boot.git;branch=master"
+
+S = "${WORKDIR}/git"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit uboot-config 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_BINARY ?= "u-boot.${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", True))}"
+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}"
+
+do_compile () {
+ if [ "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', 'ld-is-gold', '', d)}" = "ld-is-gold" ] ; then
+ sed -i 's/$(CROSS_COMPILE)ld$/$(CROSS_COMPILE)ld.bfd/g' 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 [ "x${UBOOT_CONFIG}" != "x" ]
+ 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
+ oe_runmake O=${config} ${config}
+ oe_runmake O=${config} ${UBOOT_MAKE_TARGET}
+ cp ${S}/${config}/${UBOOT_BINARY} ${S}/${config}/u-boot-${type}.${UBOOT_SUFFIX}
+ fi
+ done
+ unset j
+ done
+ unset i
+ else
+ oe_runmake ${UBOOT_MACHINE}
+ oe_runmake ${UBOOT_MAKE_TARGET}
+ fi
+
+}
+
+do_install () {
+ if [ "x${UBOOT_CONFIG}" != "x" ]
+ 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 ${S}/${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 ${S}/${UBOOT_BINARY} ${D}/boot/${UBOOT_IMAGE}
+ ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY}
+ fi
+
+ if [ "x${UBOOT_ELF}" != "x" ]
+ then
+ if [ "x${UBOOT_CONFIG}" != "x" ]
+ 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 ${S}/${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 ${S}/${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 [ "x${SPL_BINARY}" != "x" ]
+ then
+ if [ "x${UBOOT_CONFIG}" != "x" ]
+ 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 ${S}/${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 ${S}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE}
+ ln -sf ${SPL_IMAGE} ${D}/boot/${SPL_BINARYNAME}
+ fi
+ fi
+
+ if [ "x${UBOOT_ENV}" != "x" ]
+ then
+ install ${WORKDIR}/${UBOOT_ENV_BINARY} ${D}/boot/${UBOOT_ENV_IMAGE}
+ ln -sf ${UBOOT_ENV_IMAGE} ${D}/boot/${UBOOT_ENV_BINARY}
+ fi
+}
+
+FILES_${PN} = "/boot ${sysconfdir}"
+
+do_deploy () {
+ if [ "x${UBOOT_CONFIG}" != "x" ]
+ 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 ${S}/${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 ${S}/${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 [ "x${UBOOT_ELF}" != "x" ]
+ then
+ if [ "x${UBOOT_CONFIG}" != "x" ]
+ 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 ${S}/${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 ${S}/${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 [ "x${SPL_BINARY}" != "x" ]
+ then
+ if [ "x${UBOOT_CONFIG}" != "x" ]
+ 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 ${S}/${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 ${S}/${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 [ "x${UBOOT_ENV}" != "x" ]
+ then
+ install ${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
+}
+
+addtask deploy before do_build after do_compile
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot_2016.03.bb b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot_2016.03.bb
new file mode 100644
index 000000000..836b0ce03
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/u-boot/u-boot_2016.03.bb
@@ -0,0 +1,10 @@
+require u-boot.inc
+
+DEPENDS += "dtc-native"
+
+# This revision corresponds to the tag "v2016.03"
+# We use the revision in order to avoid having to fetch it from the
+# repo during parse
+SRCREV = "df61a74e6845ec9bdcdd48d2aff5e9c2c6debeaa"
+
+PV = "v2016.03+git${SRCPV}"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/usbinit/usbinit.bb b/import-layers/yocto-poky/meta/recipes-bsp/usbinit/usbinit.bb
new file mode 100644
index 000000000..aba44b406
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/usbinit/usbinit/COPYING.GPL b/import-layers/yocto-poky/meta/recipes-bsp/usbinit/usbinit/COPYING.GPL
new file mode 100644
index 000000000..d511905c1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/usbinit/usbinit/usb-gether b/import-layers/yocto-poky/meta/recipes-bsp/usbinit/usbinit/usb-gether
new file mode 100755
index 000000000..e80a0bb30
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/usbutils/usbutils/Fix-NULL-pointer-crash.patch b/import-layers/yocto-poky/meta/recipes-bsp/usbutils/usbutils/Fix-NULL-pointer-crash.patch
new file mode 100644
index 000000000..0efdc59fc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/usbutils/usbutils/Fix-NULL-pointer-crash.patch
@@ -0,0 +1,28 @@
+Fix NULL pointer crash.
+
+Before use usbbuslist, we should check if it is valid.
+
+Upstream-Status: Pending
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ lsusb-t.c | 4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/lsusb-t.c b/lsusb-t.c
+index f604155..583a46a 100644
+--- a/lsusb-t.c
++++ b/lsusb-t.c
+@@ -643,6 +643,10 @@ static void sort_busses(void)
+ /* need to reverse sort bus numbers */
+ struct usbbusnode *t, *p, **pp;
+ int swapped;
++
++ if (!usbbuslist)
++ return;
++
+ do {
+ p = usbbuslist;
+ pp = &usbbuslist;
+--
+1.7.4.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/usbutils/usbutils/iconv.patch b/import-layers/yocto-poky/meta/recipes-bsp/usbutils/usbutils/iconv.patch
new file mode 100644
index 000000000..645556717
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/usbutils/usbutils/iconv.patch
@@ -0,0 +1,41 @@
+This patch adds support for detecting iconv support using autotools
+uclibc does not have iconv implementation inside libc like glibc, therefore
+the existing checks were not sufficient, it worked for glibc but not for
+uclibc. The new patch portably detects the iconv support and adds the
+libiconv to linker cmdline
+
+This patch should be submitted upstream too
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: usbutils-008/configure.ac
+===================================================================
+--- usbutils-008.orig/configure.ac
++++ usbutils-008/configure.ac
+@@ -10,7 +10,9 @@ AC_USE_SYSTEM_EXTENSIONS
+ AC_SYS_LARGEFILE
+
+ AC_CHECK_HEADERS([byteswap.h])
+-AC_CHECK_FUNCS([nl_langinfo iconv])
++
++AM_GNU_GETTEXT
++AM_ICONV
+
+ PKG_CHECK_MODULES(LIBUSB, libusb-1.0 >= 1.0.0)
+
+Index: usbutils-008/Makefile.am
+===================================================================
+--- usbutils-008.orig/Makefile.am
++++ usbutils-008/Makefile.am
+@@ -29,7 +29,8 @@ lsusb_CPPFLAGS = \
+
+ lsusb_LDADD = \
+ $(LIBUSB_LIBS) \
+- $(UDEV_LIBS)
++ $(UDEV_LIBS) \
++ $(LIBICONV)
+
+ man_MANS = \
+ lsusb.8 \
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/usbutils/usbutils/usb-devices-avoid-dependency-on-bash.patch b/import-layers/yocto-poky/meta/recipes-bsp/usbutils/usbutils/usb-devices-avoid-dependency-on-bash.patch
new file mode 100644
index 000000000..a6b241f85
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/usbutils/usbutils_008.bb b/import-layers/yocto-poky/meta/recipes-bsp/usbutils/usbutils_008.bb
new file mode 100644
index 000000000..75312c3aa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/usbutils/usbutils_008.bb
@@ -0,0 +1,25 @@
+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 \
+ file://Fix-NULL-pointer-crash.patch \
+ file://iconv.patch \
+ "
+
+SRC_URI[md5sum] = "cb20148c2e784577e924a7b4c560c8fb"
+SRC_URI[sha256sum] = "6d5f16c2961df37e22e492c736a3e162a8fde24480f23a40d85f79af80d3fe95"
+
+inherit autotools gettext pkgconfig distro_features_check
+
+FILES_${PN}-dev += "${datadir}/pkgconfig"
+
+RDEPENDS_${PN} = "libudev"
+RDEPENDS_${PN}-ptest = "libboost-system libboost-thread"
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/v86d/v86d/Update-x86emu-from-X.org.patch b/import-layers/yocto-poky/meta/recipes-bsp/v86d/v86d/Update-x86emu-from-X.org.patch
new file mode 100644
index 000000000..a09e2a257
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/v86d/v86d/ar-from-env.patch b/import-layers/yocto-poky/meta/recipes-bsp/v86d/v86d/ar-from-env.patch
new file mode 100644
index 000000000..1dcbc71dc
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-bsp/v86d/v86d/fbsetup b/import-layers/yocto-poky/meta/recipes-bsp/v86d/v86d/fbsetup
new file mode 100755
index 000000000..2a409cc52
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/v86d/v86d/fbsetup
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+/sbin/modprobe uvesafb
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/v86d/v86d/uvesafb.conf b/import-layers/yocto-poky/meta/recipes-bsp/v86d/v86d/uvesafb.conf
new file mode 100644
index 000000000..43789755d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/v86d/v86d/uvesafb.conf
@@ -0,0 +1,2 @@
+# Load uvesafb.ko at boot
+uvesafb
diff --git a/import-layers/yocto-poky/meta/recipes-bsp/v86d/v86d_0.1.10.bb b/import-layers/yocto-poky/meta/recipes-bsp/v86d/v86d_0.1.10.bb
new file mode 100644
index 000000000..f50207212
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-bsp/v86d/v86d_0.1.10.bb
@@ -0,0 +1,69 @@
+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://distfiles.gentoo.org/distfiles/${BP}.tar.bz2 \
+ file://Update-x86emu-from-X.org.patch \
+ file://fbsetup \
+ file://uvesafb.conf \
+ file://ar-from-env.patch"
+
+SRC_URI[md5sum] = "51c792ba7b874ad8c43f0d3da4cfabe0"
+SRC_URI[sha256sum] = "634964ae18ef68c8493add2ce150e3b4502badeb0d9194b4bd81241d25e6735c"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+COMPATIBLE_HOST = '(i.86|x86_64).*-linux'
+
+INITSCRIPT_NAME = "fbsetup"
+INITSCRIPT_PARAMS = "start 0 S ."
+
+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}/
+
+ # Only install fbsetup script if '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}/fbsetup ${D}${sysconfdir}/init.d/fbsetup
+ fi
+
+ # Install systemd related configuration file
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ install -d ${D}${sysconfdir}/modules-load.d
+ install -m 0644 ${WORKDIR}/uvesafb.conf ${D}${sysconfdir}/modules-load.d
+ fi
+}
+
+# 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
+
+DEPENDS_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 fbsetup.service
+ fi
+}
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/avahi/avahi-ui_0.6.32.bb b/import-layers/yocto-poky/meta/recipes-connectivity/avahi/avahi-ui_0.6.32.bb
new file mode 100644
index 000000000..3966b4c6e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/avahi/avahi-ui_0.6.32.bb
@@ -0,0 +1,70 @@
+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 python-dir pythonnative distro_features_check
+ANY_OF_DISTRO_FEATURES = "${GTK2DISTROFEATURES}"
+
+PACKAGECONFIG ??= "dbus python"
+PACKAGECONFIG[python] = "--enable-python,--disable-python,python-native python"
+
+SRC_URI[md5sum] = "22b5e705d3eabb31d26f2e1e7b074013"
+SRC_URI[sha256sum] = "d54991185d514a0aba54ebeb408d7575b60f5818a772e28fa0e18b98bc1db454"
+
+DEPENDS += "avahi gtk+ libglade"
+
+AVAHI_GTK = "--enable-gtk --disable-gtk3 --disable-pygtk"
+
+S = "${WORKDIR}/avahi-${PV}"
+
+PACKAGES = "${PN} ${PN}-utils ${PN}-dbg ${PN}-dev ${PN}-staticdev ${PN}-doc python-avahi 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_python-avahi = "${PYTHON_SITEPACKAGES_DIR}/avahi ${PYTHON_SITEPACKAGES_DIR}/avahi_discover"
+FILES_avahi-discover = "${datadir}/applications/avahi-discover.desktop \
+ ${datadir}/avahi/interfaces/avahi-discover* \
+ ${bindir}/avahi-discover-standalone \
+ ${datadir}/avahi/interfaces/avahi-discover.glade"
+
+RDEPENDS_python-avahi = "python-core python-dbus"
+
+
+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}/avahi/s*
+ 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/import-layers/yocto-poky/meta/recipes-connectivity/avahi/avahi.inc b/import-layers/yocto-poky/meta/recipes-connectivity/avahi/avahi.inc
new file mode 100644
index 000000000..81aad7935
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/avahi/avahi.inc
@@ -0,0 +1,161 @@
+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/"
+
+PACKAGECONFIG ??= "dbus"
+PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus"
+
+USERADD_PACKAGES = "avahi-daemon avahi-autoipd"
+USERADD_PARAM_avahi-daemon = "--system --home /var/run/avahi-daemon \
+ --no-create-home --shell /bin/false \
+ --user-group avahi"
+
+USERADD_PARAM_avahi-autoipd = "--system --home /var/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 \
+ --disable-manpages \
+ ${EXTRA_OECONF_SYSVINIT} \
+ ${EXTRA_OECONF_SYSTEMD} \
+ ${AVAHI_GTK} \
+ "
+
+# 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)}"
+
+AVAHI_GTK ?= "--disable-gtk --disable-gtk3"
+
+LDFLAGS_append_libc-uclibc = " -lintl"
+LDFLAGS_append_uclinux-uclibc = " -lintl"
+
+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-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})"
+
+# uclibc has no nss
+RRECOMMENDS_avahi-daemon_append_libc-glibc = " libnss-mdns"
+RRECOMMENDS_${PN}_append_libc-glibc = " libnss-mdns"
+
+RRECOMMENDS_avahi-dev = "expat-dev libcap-dev libdaemon-dev dbus-dev glib-2.0-dev update-rc.d-dev"
+RRECOMMENDS_avahi-dev_append_libc-glibc = " gettext-dev"
+
+RRECOMMENDS_avahi-dev[nodeprrecs] = "1"
+
+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
+
+ # don't install /var/run when populating rootfs. Do it through volatile
+ # /var/run of current version is empty, so just remove it.
+ # if /var/run become non-empty in the future, need to install it via volatile
+ rm -rf ${D}${localstatedir}/run
+ rmdir --ignore-fail-on-non-empty ${D}${localstatedir}
+ 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
+}
+
+pkg_postrm_avahi-daemon () {
+ deluser avahi || true
+ delgroup avahi || true
+}
+
+pkg_postrm_avahi-autoipd () {
+ deluser avahi-autoipd || true
+ delgroup avahi-autoipd || true
+}
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/avahi/avahi_0.6.32.bb b/import-layers/yocto-poky/meta/recipes-connectivity/avahi/avahi_0.6.32.bb
new file mode 100644
index 000000000..6670106b1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/avahi/avahi_0.6.32.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] = "22b5e705d3eabb31d26f2e1e7b074013"
+SRC_URI[sha256sum] = "d54991185d514a0aba54ebeb408d7575b60f5818a772e28fa0e18b98bc1db454"
+
+DEPENDS += "intltool-native"
+
+PACKAGES =+ "libavahi-gobject"
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/avahi/files/00avahi-autoipd b/import-layers/yocto-poky/meta/recipes-connectivity/avahi/files/00avahi-autoipd
new file mode 100644
index 000000000..a0ab81460
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/avahi/files/99avahi-autoipd b/import-layers/yocto-poky/meta/recipes-connectivity/avahi/files/99avahi-autoipd
new file mode 100644
index 000000000..234cdaa3e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/avahi/files/initscript.patch b/import-layers/yocto-poky/meta/recipes-connectivity/avahi/files/initscript.patch
new file mode 100644
index 000000000..193889eb5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/avahi/files/initscript.patch
@@ -0,0 +1,41 @@
+Upstream-Status: Pending
+
+diff --git a/initscript/debian/avahi-daemon.in b/initscript/debian/avahi-daemon.in
+index 30a2c2f..b5848a8 100755
+--- a/initscript/debian/avahi-daemon.in
++++ b/initscript/debian/avahi-daemon.in
+@@ -1,2 +1,14 @@
+ #!/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
++#
+diff --git a/initscript/debian/avahi-dnsconfd.in b/initscript/debian/avahi-dnsconfd.in
+index ac34804..f95c340 100755
+--- a/initscript/debian/avahi-dnsconfd.in
++++ b/initscript/debian/avahi-dnsconfd.in
+@@ -1,1 +1,14 @@
+ #!/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
++#
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/0001-build-use-pkg-config-to-find-libxml2.patch b/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/0001-build-use-pkg-config-to-find-libxml2.patch
new file mode 100644
index 000000000..805cbb331
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/0001-build-use-pkg-config-to-find-libxml2.patch
@@ -0,0 +1,50 @@
+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>
+---
+ configure.in | 23 +++--------------------
+ 1 file changed, 3 insertions(+), 20 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 0db826d..75819eb 100644
+--- a/configure.in
++++ b/configure.in
+@@ -2107,26 +2107,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 "$use_libxml2" = "yes" ; 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/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/0001-gen.c-extend-DIRNAMESIZE-from-256-to-512.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/0001-lib-dns-gen.c-fix-too-long-error.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/CVE-2016-1285.patch b/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/CVE-2016-1285.patch
new file mode 100644
index 000000000..2149bd180
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/CVE-2016-1285.patch
@@ -0,0 +1,154 @@
+From 70037e040e587329cec82123e12b9f4f7c945f67 Mon Sep 17 00:00:00 2001
+From: Mark Andrews <marka@isc.org>
+Date: Thu, 18 Feb 2016 12:11:27 +1100
+Subject: [PATCH] 4318. [security] Malformed control messages can
+ trigger assertions in named and rndc. (CVE-2016-1285)
+ [RT #41666]
+
+(cherry picked from commit a2b15b3305acd52179e6f3dc7d073b07fbc40b8e)
+
+CVE: CVE-2016-1285
+Upstream-Status: Backport
+[Removed doc/arm/notes.xml changes from upstream patch]
+
+Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
+---
+ CHANGES | 3 +++
+ bin/named/control.c | 2 +-
+ bin/named/controlconf.c | 2 +-
+ bin/rndc/rndc.c | 8 ++++----
+ doc/arm/notes.xml | 11 +++++++++++
+ lib/isccc/cc.c | 14 +++++++-------
+ 6 files changed, 27 insertions(+), 13 deletions(-)
+
+diff --git a/CHANGES b/CHANGES
+index b9bd9ef..2c727d5 100644
+--- a/CHANGES
++++ b/CHANGES
+@@ -1,3 +1,6 @@
++4318. [security] Malformed control messages can trigger assertions
++ in named and rndc. (CVE-2016-1285) [RT #41666]
++
+ --- 9.10.3-P3 released ---
+
+ 4288. [bug] Fixed a regression in resolver.c:possibly_mark()
+diff --git a/bin/named/control.c b/bin/named/control.c
+index 8554335..81340ca 100644
+--- a/bin/named/control.c
++++ b/bin/named/control.c
+@@ -69,7 +69,7 @@ ns_control_docommand(isccc_sexpr_t *message, isc_buffer_t *text) {
+ #endif
+
+ data = isccc_alist_lookup(message, "_data");
+- if (data == NULL) {
++ if (!isccc_alist_alistp(data)) {
+ /*
+ * No data section.
+ */
+diff --git a/bin/named/controlconf.c b/bin/named/controlconf.c
+index 765afdd..a39ab8b 100644
+--- a/bin/named/controlconf.c
++++ b/bin/named/controlconf.c
+@@ -402,7 +402,7 @@ control_recvmessage(isc_task_t *task, isc_event_t *event) {
+ * Limit exposure to replay attacks.
+ */
+ _ctrl = isccc_alist_lookup(request, "_ctrl");
+- if (_ctrl == NULL) {
++ if (!isccc_alist_alistp(_ctrl)) {
+ log_invalid(&conn->ccmsg, ISC_R_FAILURE);
+ goto cleanup_request;
+ }
+diff --git a/bin/rndc/rndc.c b/bin/rndc/rndc.c
+index cb17050..b6e05c8 100644
+--- a/bin/rndc/rndc.c
++++ b/bin/rndc/rndc.c
+@@ -255,8 +255,8 @@ rndc_recvdone(isc_task_t *task, isc_event_t *event) {
+ isccc_cc_fromwire(&source, &response, algorithm, &secret));
+
+ data = isccc_alist_lookup(response, "_data");
+- if (data == NULL)
+- fatal("no data section in response");
++ if (!isccc_alist_alistp(data))
++ fatal("bad or missing data section in response");
+ result = isccc_cc_lookupstring(data, "err", &errormsg);
+ if (result == ISC_R_SUCCESS) {
+ failed = ISC_TRUE;
+@@ -321,8 +321,8 @@ rndc_recvnonce(isc_task_t *task, isc_event_t *event) {
+ isccc_cc_fromwire(&source, &response, algorithm, &secret));
+
+ _ctrl = isccc_alist_lookup(response, "_ctrl");
+- if (_ctrl == NULL)
+- fatal("_ctrl section missing");
++ if (!isccc_alist_alistp(_ctrl))
++ fatal("bad or missing ctrl section in response");
+ nonce = 0;
+ if (isccc_cc_lookupuint32(_ctrl, "_nonce", &nonce) != ISC_R_SUCCESS)
+ nonce = 0;
+diff --git a/lib/isccc/cc.c b/lib/isccc/cc.c
+index 47a3b74..2bb961e 100644
+--- a/lib/isccc/cc.c
++++ b/lib/isccc/cc.c
+@@ -403,13 +403,13 @@ verify(isccc_sexpr_t *alist, unsigned char *data, unsigned int length,
+ * Extract digest.
+ */
+ _auth = isccc_alist_lookup(alist, "_auth");
+- if (_auth == NULL)
++ if (!isccc_alist_alistp(_auth))
+ return (ISC_R_FAILURE);
+ if (algorithm == ISCCC_ALG_HMACMD5)
+ hmac = isccc_alist_lookup(_auth, "hmd5");
+ else
+ hmac = isccc_alist_lookup(_auth, "hsha");
+- if (hmac == NULL)
++ if (!isccc_sexpr_binaryp(hmac))
+ return (ISC_R_FAILURE);
+ /*
+ * Compute digest.
+@@ -728,7 +728,7 @@ isccc_cc_createack(isccc_sexpr_t *message, isc_boolean_t ok,
+ REQUIRE(ackp != NULL && *ackp == NULL);
+
+ _ctrl = isccc_alist_lookup(message, "_ctrl");
+- if (_ctrl == NULL ||
++ if (!isccc_alist_alistp(_ctrl) ||
+ isccc_cc_lookupuint32(_ctrl, "_ser", &serial) != ISC_R_SUCCESS ||
+ isccc_cc_lookupuint32(_ctrl, "_tim", &t) != ISC_R_SUCCESS)
+ return (ISC_R_FAILURE);
+@@ -773,7 +773,7 @@ isccc_cc_isack(isccc_sexpr_t *message)
+ isccc_sexpr_t *_ctrl;
+
+ _ctrl = isccc_alist_lookup(message, "_ctrl");
+- if (_ctrl == NULL)
++ if (!isccc_alist_alistp(_ctrl))
+ return (ISC_FALSE);
+ if (isccc_cc_lookupstring(_ctrl, "_ack", NULL) == ISC_R_SUCCESS)
+ return (ISC_TRUE);
+@@ -786,7 +786,7 @@ isccc_cc_isreply(isccc_sexpr_t *message)
+ isccc_sexpr_t *_ctrl;
+
+ _ctrl = isccc_alist_lookup(message, "_ctrl");
+- if (_ctrl == NULL)
++ if (!isccc_alist_alistp(_ctrl))
+ return (ISC_FALSE);
+ if (isccc_cc_lookupstring(_ctrl, "_rpl", NULL) == ISC_R_SUCCESS)
+ return (ISC_TRUE);
+@@ -806,7 +806,7 @@ isccc_cc_createresponse(isccc_sexpr_t *message, isccc_time_t now,
+
+ _ctrl = isccc_alist_lookup(message, "_ctrl");
+ _data = isccc_alist_lookup(message, "_data");
+- if (_ctrl == NULL || _data == NULL ||
++ if (!isccc_alist_alistp(_ctrl) || !isccc_alist_alistp(_data) ||
+ isccc_cc_lookupuint32(_ctrl, "_ser", &serial) != ISC_R_SUCCESS ||
+ isccc_cc_lookupstring(_data, "type", &type) != ISC_R_SUCCESS)
+ return (ISC_R_FAILURE);
+@@ -995,7 +995,7 @@ isccc_cc_checkdup(isccc_symtab_t *symtab, isccc_sexpr_t *message,
+ isccc_sexpr_t *_ctrl;
+
+ _ctrl = isccc_alist_lookup(message, "_ctrl");
+- if (_ctrl == NULL ||
++ if (!isccc_alist_alistp(_ctrl) ||
+ isccc_cc_lookupstring(_ctrl, "_ser", &_ser) != ISC_R_SUCCESS ||
+ isccc_cc_lookupstring(_ctrl, "_tim", &_tim) != ISC_R_SUCCESS)
+ return (ISC_R_FAILURE);
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/CVE-2016-1286_1.patch b/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/CVE-2016-1286_1.patch
new file mode 100644
index 000000000..ae5cc48d9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/CVE-2016-1286_1.patch
@@ -0,0 +1,79 @@
+From a3d327bf1ceaaeabb20223d8de85166e940b9f12 Mon Sep 17 00:00:00 2001
+From: Mukund Sivaraman <muks@isc.org>
+Date: Mon, 22 Feb 2016 12:22:43 +0530
+Subject: [PATCH] Fix resolver assertion failure due to improper DNAME handling
+ (CVE-2016-1286) (#41753)
+
+(cherry picked from commit 5995fec51cc8bb7e53804e4936e60aa1537f3673)
+
+CVE: CVE-2016-1286
+Upstream-Status: Backport
+
+[Removed doc/arm/notes.xml changes from upstream patch.]
+
+Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
+---
+diff -ruN a/CHANGES b/CHANGES
+--- a/CHANGES 2016-04-13 07:28:44.940873629 +0200
++++ b/CHANGES 2016-04-13 07:38:38.923167851 +0200
+@@ -1,3 +1,7 @@
++4319. [security] Fix resolver assertion failure due to improper
++ DNAME handling when parsing fetch reply messages.
++ (CVE-2016-1286) [RT #41753]
++
+ 4318. [security] Malformed control messages can trigger assertions
+ in named and rndc. (CVE-2016-1285) [RT #41666]
+
+diff -ruN a/lib/dns/resolver.c b/lib/dns/resolver.c
+--- a/lib/dns/resolver.c 2016-04-13 07:28:43.088953790 +0200
++++ b/lib/dns/resolver.c 2016-04-13 07:38:20.411968925 +0200
+@@ -6967,21 +6967,26 @@
+ isc_boolean_t found_dname = ISC_FALSE;
+ dns_name_t *dname_name;
+
++ /*
++ * Only pass DNAME or RRSIG(DNAME).
++ */
++ if (rdataset->type != dns_rdatatype_dname &&
++ (rdataset->type != dns_rdatatype_rrsig ||
++ rdataset->covers != dns_rdatatype_dname))
++ continue;
++
++ /*
++ * If we're not chaining, then the DNAME and
++ * its signature should not be external.
++ */
++ if (!chaining && external) {
++ log_formerr(fctx, "external DNAME");
++ return (DNS_R_FORMERR);
++ }
++
+ found = ISC_FALSE;
+ aflag = 0;
+ if (rdataset->type == dns_rdatatype_dname) {
+- /*
+- * We're looking for something else,
+- * but we found a DNAME.
+- *
+- * If we're not chaining, then the
+- * DNAME should not be external.
+- */
+- if (!chaining && external) {
+- log_formerr(fctx,
+- "external DNAME");
+- return (DNS_R_FORMERR);
+- }
+ found = ISC_TRUE;
+ want_chaining = ISC_TRUE;
+ POST(want_chaining);
+@@ -7010,9 +7015,7 @@
+ &fctx->domain)) {
+ return (DNS_R_SERVFAIL);
+ }
+- } else if (rdataset->type == dns_rdatatype_rrsig
+- && rdataset->covers ==
+- dns_rdatatype_dname) {
++ } else {
+ /*
+ * We've found a signature that
+ * covers the DNAME.
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/CVE-2016-1286_2.patch b/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/CVE-2016-1286_2.patch
new file mode 100644
index 000000000..a31ea81f8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/CVE-2016-1286_2.patch
@@ -0,0 +1,314 @@
+From 7602be276a73a6eb5431c5acd9718e68a55e8b61 Mon Sep 17 00:00:00 2001
+From: Mark Andrews <marka@isc.org>
+Date: Mon, 29 Feb 2016 07:16:48 +1100
+Subject: [PATCH] Part 2 of: 4319. [security] Fix resolver assertion
+ failure due to improper DNAME handling when parsing
+ fetch reply messages. (CVE-2016-1286) [RT #41753]
+
+(cherry picked from commit 2de89ee9de8c8da9dc153a754b02dcdbb7fe2374)
+Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
+---
+ lib/dns/resolver.c | 192 ++++++++++++++++++++++++++---------------------------
+ 1 file changed, 93 insertions(+), 99 deletions(-)
+
+diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c
+index 70aba87..41e9df4 100644
+--- a/lib/dns/resolver.c
++++ b/lib/dns/resolver.c
+@@ -6074,14 +6074,11 @@ cname_target(dns_rdataset_t *rdataset, dns_name_t *tname) {
+ }
+
+ static inline isc_result_t
+-dname_target(fetchctx_t *fctx, dns_rdataset_t *rdataset, dns_name_t *qname,
+- dns_name_t *oname, dns_fixedname_t *fixeddname)
++dname_target(dns_rdataset_t *rdataset, dns_name_t *qname,
++ unsigned int nlabels, dns_fixedname_t *fixeddname)
+ {
+ isc_result_t result;
+ dns_rdata_t rdata = DNS_RDATA_INIT;
+- unsigned int nlabels;
+- int order;
+- dns_namereln_t namereln;
+ dns_rdata_dname_t dname;
+ dns_fixedname_t prefix;
+
+@@ -6096,21 +6093,6 @@ dname_target(fetchctx_t *fctx, dns_rdataset_t *rdataset, dns_name_t *qname,
+ if (result != ISC_R_SUCCESS)
+ return (result);
+
+- /*
+- * Get the prefix of qname.
+- */
+- namereln = dns_name_fullcompare(qname, oname, &order, &nlabels);
+- if (namereln != dns_namereln_subdomain) {
+- char qbuf[DNS_NAME_FORMATSIZE];
+- char obuf[DNS_NAME_FORMATSIZE];
+-
+- dns_rdata_freestruct(&dname);
+- dns_name_format(qname, qbuf, sizeof(qbuf));
+- dns_name_format(oname, obuf, sizeof(obuf));
+- log_formerr(fctx, "unrelated DNAME in answer: "
+- "%s is not in %s", qbuf, obuf);
+- return (DNS_R_FORMERR);
+- }
+ dns_fixedname_init(&prefix);
+ dns_name_split(qname, nlabels, dns_fixedname_name(&prefix), NULL);
+ dns_fixedname_init(fixeddname);
+@@ -6736,13 +6718,13 @@ static isc_result_t
+ answer_response(fetchctx_t *fctx) {
+ isc_result_t result;
+ dns_message_t *message;
+- dns_name_t *name, *qname, tname, *ns_name;
++ dns_name_t *name, *dname, *qname, tname, *ns_name;
+ dns_rdataset_t *rdataset, *ns_rdataset;
+ isc_boolean_t done, external, chaining, aa, found, want_chaining;
+ isc_boolean_t have_answer, found_cname, found_type, wanted_chaining;
+ unsigned int aflag;
+ dns_rdatatype_t type;
+- dns_fixedname_t dname, fqname;
++ dns_fixedname_t fdname, fqname;
+ dns_view_t *view;
+
+ FCTXTRACE("answer_response");
+@@ -6770,10 +6752,15 @@ answer_response(fetchctx_t *fctx) {
+ view = fctx->res->view;
+ result = dns_message_firstname(message, DNS_SECTION_ANSWER);
+ while (!done && result == ISC_R_SUCCESS) {
++ dns_namereln_t namereln;
++ int order;
++ unsigned int nlabels;
++
+ name = NULL;
+ dns_message_currentname(message, DNS_SECTION_ANSWER, &name);
+ external = ISC_TF(!dns_name_issubdomain(name, &fctx->domain));
+- if (dns_name_equal(name, qname)) {
++ namereln = dns_name_fullcompare(qname, name, &order, &nlabels);
++ if (namereln == dns_namereln_equal) {
+ wanted_chaining = ISC_FALSE;
+ for (rdataset = ISC_LIST_HEAD(name->list);
+ rdataset != NULL;
+@@ -6898,10 +6885,11 @@ answer_response(fetchctx_t *fctx) {
+ */
+ INSIST(!external);
+ if (aflag ==
+- DNS_RDATASETATTR_ANSWER)
++ DNS_RDATASETATTR_ANSWER) {
+ have_answer = ISC_TRUE;
+- name->attributes |=
+- DNS_NAMEATTR_ANSWER;
++ name->attributes |=
++ DNS_NAMEATTR_ANSWER;
++ }
+ rdataset->attributes |= aflag;
+ if (aa)
+ rdataset->trust =
+@@ -6956,6 +6944,8 @@ answer_response(fetchctx_t *fctx) {
+ if (wanted_chaining)
+ chaining = ISC_TRUE;
+ } else {
++ dns_rdataset_t *dnameset = NULL;
++
+ /*
+ * Look for a DNAME (or its SIG). Anything else is
+ * ignored.
+@@ -6963,10 +6953,8 @@ answer_response(fetchctx_t *fctx) {
+ wanted_chaining = ISC_FALSE;
+ for (rdataset = ISC_LIST_HEAD(name->list);
+ rdataset != NULL;
+- rdataset = ISC_LIST_NEXT(rdataset, link)) {
+- isc_boolean_t found_dname = ISC_FALSE;
+- dns_name_t *dname_name;
+-
++ rdataset = ISC_LIST_NEXT(rdataset, link))
++ {
+ /*
+ * Only pass DNAME or RRSIG(DNAME).
+ */
+@@ -6980,20 +6968,41 @@ answer_response(fetchctx_t *fctx) {
+ * its signature should not be external.
+ */
+ if (!chaining && external) {
+- log_formerr(fctx, "external DNAME");
++ char qbuf[DNS_NAME_FORMATSIZE];
++ char obuf[DNS_NAME_FORMATSIZE];
++
++ dns_name_format(name, qbuf,
++ sizeof(qbuf));
++ dns_name_format(&fctx->domain, obuf,
++ sizeof(obuf));
++ log_formerr(fctx, "external DNAME or "
++ "RRSIG covering DNAME "
++ "in answer: %s is "
++ "not in %s", qbuf, obuf);
++ return (DNS_R_FORMERR);
++ }
++
++ if (namereln != dns_namereln_subdomain) {
++ char qbuf[DNS_NAME_FORMATSIZE];
++ char obuf[DNS_NAME_FORMATSIZE];
++
++ dns_name_format(qname, qbuf,
++ sizeof(qbuf));
++ dns_name_format(name, obuf,
++ sizeof(obuf));
++ log_formerr(fctx, "unrelated DNAME "
++ "in answer: %s is "
++ "not in %s", qbuf, obuf);
+ return (DNS_R_FORMERR);
+ }
+
+- found = ISC_FALSE;
+ aflag = 0;
+ if (rdataset->type == dns_rdatatype_dname) {
+- found = ISC_TRUE;
+ want_chaining = ISC_TRUE;
+ POST(want_chaining);
+ aflag = DNS_RDATASETATTR_ANSWER;
+- result = dname_target(fctx, rdataset,
+- qname, name,
+- &dname);
++ result = dname_target(rdataset, qname,
++ nlabels, &fdname);
+ if (result == ISC_R_NOSPACE) {
+ /*
+ * We can't construct the
+@@ -7005,14 +7014,12 @@ answer_response(fetchctx_t *fctx) {
+ } else if (result != ISC_R_SUCCESS)
+ return (result);
+ else
+- found_dname = ISC_TRUE;
++ dnameset = rdataset;
+
+- dname_name = dns_fixedname_name(&dname);
++ dname = dns_fixedname_name(&fdname);
+ if (!is_answertarget_allowed(view,
+- qname,
+- rdataset->type,
+- dname_name,
+- &fctx->domain)) {
++ qname, rdataset->type,
++ dname, &fctx->domain)) {
+ return (DNS_R_SERVFAIL);
+ }
+ } else {
+@@ -7020,73 +7027,60 @@ answer_response(fetchctx_t *fctx) {
+ * We've found a signature that
+ * covers the DNAME.
+ */
+- found = ISC_TRUE;
+ aflag = DNS_RDATASETATTR_ANSWERSIG;
+ }
+
+- if (found) {
++ /*
++ * We've found an answer to our
++ * question.
++ */
++ name->attributes |= DNS_NAMEATTR_CACHE;
++ rdataset->attributes |= DNS_RDATASETATTR_CACHE;
++ rdataset->trust = dns_trust_answer;
++ if (!chaining) {
+ /*
+- * We've found an answer to our
+- * question.
++ * This data is "the" answer to
++ * our question only if we're
++ * not chaining.
+ */
+- name->attributes |=
+- DNS_NAMEATTR_CACHE;
+- rdataset->attributes |=
+- DNS_RDATASETATTR_CACHE;
+- rdataset->trust = dns_trust_answer;
+- if (!chaining) {
+- /*
+- * This data is "the" answer
+- * to our question only if
+- * we're not chaining.
+- */
+- INSIST(!external);
+- if (aflag ==
+- DNS_RDATASETATTR_ANSWER)
+- have_answer = ISC_TRUE;
++ INSIST(!external);
++ if (aflag == DNS_RDATASETATTR_ANSWER) {
++ have_answer = ISC_TRUE;
+ name->attributes |=
+ DNS_NAMEATTR_ANSWER;
+- rdataset->attributes |= aflag;
+- if (aa)
+- rdataset->trust =
+- dns_trust_authanswer;
+- } else if (external) {
+- rdataset->attributes |=
+- DNS_RDATASETATTR_EXTERNAL;
+- }
+-
+- /*
+- * DNAME chaining.
+- */
+- if (found_dname) {
+- /*
+- * Copy the dname into the
+- * qname fixed name.
+- *
+- * Although we check for
+- * failure of the copy
+- * operation, in practice it
+- * should never fail since
+- * we already know that the
+- * result fits in a fixedname.
+- */
+- dns_fixedname_init(&fqname);
+- result = dns_name_copy(
+- dns_fixedname_name(&dname),
+- dns_fixedname_name(&fqname),
+- NULL);
+- if (result != ISC_R_SUCCESS)
+- return (result);
+- wanted_chaining = ISC_TRUE;
+- name->attributes |=
+- DNS_NAMEATTR_CHAINING;
+- rdataset->attributes |=
+- DNS_RDATASETATTR_CHAINING;
+- qname = dns_fixedname_name(
+- &fqname);
+ }
++ rdataset->attributes |= aflag;
++ if (aa)
++ rdataset->trust =
++ dns_trust_authanswer;
++ } else if (external) {
++ rdataset->attributes |=
++ DNS_RDATASETATTR_EXTERNAL;
+ }
+ }
++
++ /*
++ * DNAME chaining.
++ */
++ if (dnameset != NULL) {
++ /*
++ * Copy the dname into the qname fixed name.
++ *
++ * Although we check for failure of the copy
++ * operation, in practice it should never fail
++ * since we already know that the result fits
++ * in a fixedname.
++ */
++ dns_fixedname_init(&fqname);
++ qname = dns_fixedname_name(&fqname);
++ result = dns_name_copy(dname, qname, NULL);
++ if (result != ISC_R_SUCCESS)
++ return (result);
++ wanted_chaining = ISC_TRUE;
++ name->attributes |= DNS_NAMEATTR_CHAINING;
++ dnameset->attributes |=
++ DNS_RDATASETATTR_CHAINING;
++ }
+ if (wanted_chaining)
+ chaining = ISC_TRUE;
+ }
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/CVE-2016-2088.patch b/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/CVE-2016-2088.patch
new file mode 100644
index 000000000..1b84d46b7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/CVE-2016-2088.patch
@@ -0,0 +1,247 @@
+CVE-2016-2088
+
+Backport commit d7ff9a1c41bf0ba9773cb3adb08b48b9fd57c956 from the
+v9_10_3_patch branch.
+
+https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-2088
+https://kb.isc.org/article/AA-01351
+
+CVE: CVE-2016-2088
+Upstream-Status: Backport
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+
+Original commit message from Mark Andrews <marka@isc.org> below:
+
+4322. [security] Duplicate EDNS COOKIE options in a response could
+ trigger an assertion failure. (CVE-2016-2088)
+ [RT #41809]
+
+(cherry picked from commit 455c0848f80a8acda27aad1466c72987cafaa029)
+(cherry picked from commit 7cd300abd6ee8b8ee8730593daf742ba53f90bc3)
+---
+ CHANGES | 4 ++++
+ bin/dig/dighost.c | 9 +++++++++
+ bin/named/client.c | 33 +++++++++++++++++++++++----------
+ doc/arm/notes.xml | 7 +++++++
+ lib/dns/resolver.c | 14 +++++++++++++-
+ 5 files changed, 56 insertions(+), 11 deletions(-)
+
+diff --git a/CHANGES b/CHANGES
+index c5b5d2b..d2e3360 100644
+--- a/CHANGES
++++ b/CHANGES
+@@ -1,3 +1,7 @@
++4322. [security] Duplicate EDNS COOKIE options in a response could
++ trigger an assertion failure. (CVE-2016-2088)
++ [RT #41809]
++
+ 4319. [security] Fix resolver assertion failure due to improper
+ DNAME handling when parsing fetch reply messages.
+ (CVE-2016-1286) [RT #41753]
+diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c
+index ca82f8e..340904f 100644
+--- a/bin/dig/dighost.c
++++ b/bin/dig/dighost.c
+@@ -3458,6 +3458,7 @@ process_opt(dig_lookup_t *l, dns_message_t *msg) {
+ isc_buffer_t optbuf;
+ isc_uint16_t optcode, optlen;
+ dns_rdataset_t *opt = msg->opt;
++ isc_boolean_t seen_cookie = ISC_FALSE;
+
+ result = dns_rdataset_first(opt);
+ if (result == ISC_R_SUCCESS) {
+@@ -3470,7 +3471,15 @@ process_opt(dig_lookup_t *l, dns_message_t *msg) {
+ optlen = isc_buffer_getuint16(&optbuf);
+ switch (optcode) {
+ case DNS_OPT_COOKIE:
++ /*
++ * Only process the first cookie option.
++ */
++ if (seen_cookie) {
++ isc_buffer_forward(&optbuf, optlen);
++ break;
++ }
+ process_sit(l, msg, &optbuf, optlen);
++ seen_cookie = ISC_TRUE;
+ break;
+ default:
+ isc_buffer_forward(&optbuf, optlen);
+diff --git a/bin/named/client.c b/bin/named/client.c
+index 683305c..0d7331a 100644
+--- a/bin/named/client.c
++++ b/bin/named/client.c
+@@ -120,7 +120,10 @@
+ */
+ #endif
+
+-#define SIT_SIZE 24U /* 8 + 4 + 4 + 8 */
++#define COOKIE_SIZE 24U /* 8 + 4 + 4 + 8 */
++
++#define WANTNSID(x) (((x)->attributes & NS_CLIENTATTR_WANTNSID) != 0)
++#define WANTEXPIRE(x) (((x)->attributes & NS_CLIENTATTR_WANTEXPIRE) != 0)
+
+ /*% nameserver client manager structure */
+ struct ns_clientmgr {
+@@ -1395,7 +1398,7 @@ ns_client_addopt(ns_client_t *client, dns_message_t *message,
+ {
+ char nsid[BUFSIZ], *nsidp;
+ #ifdef ISC_PLATFORM_USESIT
+- unsigned char sit[SIT_SIZE];
++ unsigned char sit[COOKIE_SIZE];
+ #endif
+ isc_result_t result;
+ dns_view_t *view;
+@@ -1420,7 +1423,7 @@ ns_client_addopt(ns_client_t *client, dns_message_t *message,
+ flags = client->extflags & DNS_MESSAGEEXTFLAG_REPLYPRESERVE;
+
+ /* Set EDNS options if applicable */
+- if ((client->attributes & NS_CLIENTATTR_WANTNSID) != 0 &&
++ if (WANTNSID(client) &&
+ (ns_g_server->server_id != NULL ||
+ ns_g_server->server_usehostname)) {
+ if (ns_g_server->server_usehostname) {
+@@ -1453,7 +1456,7 @@ ns_client_addopt(ns_client_t *client, dns_message_t *message,
+
+ INSIST(count < DNS_EDNSOPTIONS);
+ ednsopts[count].code = DNS_OPT_COOKIE;
+- ednsopts[count].length = SIT_SIZE;
++ ednsopts[count].length = COOKIE_SIZE;
+ ednsopts[count].value = sit;
+ count++;
+ }
+@@ -1661,19 +1664,26 @@ compute_sit(ns_client_t *client, isc_uint32_t when, isc_uint32_t nonce,
+
+ static void
+ process_sit(ns_client_t *client, isc_buffer_t *buf, size_t optlen) {
+- unsigned char dbuf[SIT_SIZE];
++ unsigned char dbuf[COOKIE_SIZE];
+ unsigned char *old;
+ isc_stdtime_t now;
+ isc_uint32_t when;
+ isc_uint32_t nonce;
+ isc_buffer_t db;
+
++ /*
++ * If we have already seen a ECS option skip this ECS option.
++ */
++ if ((client->attributes & NS_CLIENTATTR_WANTSIT) != 0) {
++ isc_buffer_forward(buf, optlen);
++ return;
++ }
+ client->attributes |= NS_CLIENTATTR_WANTSIT;
+
+ isc_stats_increment(ns_g_server->nsstats,
+ dns_nsstatscounter_sitopt);
+
+- if (optlen != SIT_SIZE) {
++ if (optlen != COOKIE_SIZE) {
+ /*
+ * Not our token.
+ */
+@@ -1717,14 +1727,13 @@ process_sit(ns_client_t *client, isc_buffer_t *buf, size_t optlen) {
+ isc_buffer_init(&db, dbuf, sizeof(dbuf));
+ compute_sit(client, when, nonce, &db);
+
+- if (!isc_safe_memequal(old, dbuf, SIT_SIZE)) {
++ if (!isc_safe_memequal(old, dbuf, COOKIE_SIZE)) {
+ isc_stats_increment(ns_g_server->nsstats,
+ dns_nsstatscounter_sitnomatch);
+ return;
+ }
+ isc_stats_increment(ns_g_server->nsstats,
+ dns_nsstatscounter_sitmatch);
+-
+ client->attributes |= NS_CLIENTATTR_HAVESIT;
+ }
+ #endif
+@@ -1783,7 +1792,9 @@ process_opt(ns_client_t *client, dns_rdataset_t *opt) {
+ optlen = isc_buffer_getuint16(&optbuf);
+ switch (optcode) {
+ case DNS_OPT_NSID:
+- isc_stats_increment(ns_g_server->nsstats,
++ if (!WANTNSID(client))
++ isc_stats_increment(
++ ns_g_server->nsstats,
+ dns_nsstatscounter_nsidopt);
+ client->attributes |= NS_CLIENTATTR_WANTNSID;
+ isc_buffer_forward(&optbuf, optlen);
+@@ -1794,7 +1805,9 @@ process_opt(ns_client_t *client, dns_rdataset_t *opt) {
+ break;
+ #endif
+ case DNS_OPT_EXPIRE:
+- isc_stats_increment(ns_g_server->nsstats,
++ if (!WANTEXPIRE(client))
++ isc_stats_increment(
++ ns_g_server->nsstats,
+ dns_nsstatscounter_expireopt);
+ client->attributes |= NS_CLIENTATTR_WANTEXPIRE;
+ isc_buffer_forward(&optbuf, optlen);
+diff --git a/doc/arm/notes.xml b/doc/arm/notes.xml
+index ebf4f55..095eb5b 100644
+--- a/doc/arm/notes.xml
++++ b/doc/arm/notes.xml
+@@ -51,6 +51,13 @@
+ <title>Security Fixes</title>
+ <itemizedlist>
+ <listitem>
++ <para>
++ Duplicate EDNS COOKIE options in a response could trigger
++ an assertion failure. This flaw is disclosed in CVE-2016-2088.
++ [RT #41809]
++ </para>
++ </listitem>
++ <listitem>
+ <para>
+ Specific APL data could trigger an INSIST. This flaw
+ was discovered by Brian Mitchell and is disclosed in
+diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c
+index a797e3f..ba1ae23 100644
+--- a/lib/dns/resolver.c
++++ b/lib/dns/resolver.c
+@@ -7502,7 +7502,9 @@ process_opt(resquery_t *query, dns_rdataset_t *opt) {
+ unsigned char *sit;
+ dns_adbaddrinfo_t *addrinfo;
+ unsigned char cookie[8];
++ isc_boolean_t seen_cookie = ISC_FALSE;
+ #endif
++ isc_boolean_t seen_nsid = ISC_FALSE;
+
+ result = dns_rdataset_first(opt);
+ if (result == ISC_R_SUCCESS) {
+@@ -7516,14 +7518,23 @@ process_opt(resquery_t *query, dns_rdataset_t *opt) {
+ INSIST(optlen <= isc_buffer_remaininglength(&optbuf));
+ switch (optcode) {
+ case DNS_OPT_NSID:
+- if (query->options & DNS_FETCHOPT_WANTNSID)
++ if (!seen_nsid &&
++ query->options & DNS_FETCHOPT_WANTNSID)
+ log_nsid(&optbuf, optlen, query,
+ ISC_LOG_DEBUG(3),
+ query->fctx->res->mctx);
+ isc_buffer_forward(&optbuf, optlen);
++ seen_nsid = ISC_TRUE;
+ break;
+ #ifdef ISC_PLATFORM_USESIT
+ case DNS_OPT_COOKIE:
++ /*
++ * Only process the first cookie option.
++ */
++ if (seen_cookie) {
++ isc_buffer_forward(&optbuf, optlen);
++ break;
++ }
+ sit = isc_buffer_current(&optbuf);
+ compute_cc(query, cookie, sizeof(cookie));
+ INSIST(query->fctx->rmessage->sitbad == 0 &&
+@@ -7541,6 +7552,7 @@ process_opt(resquery_t *query, dns_rdataset_t *opt) {
+ isc_buffer_forward(&optbuf, optlen);
+ inc_stats(query->fctx->res,
+ dns_resstatscounter_sitin);
++ seen_cookie = ISC_TRUE;
+ break;
+ #endif
+ default:
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/bind-confgen-build-unix.o-once.patch b/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/bind-confgen-build-unix.o-once.patch
new file mode 100644
index 000000000..096d5d84f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/bind-confgen-build-unix.o-once.patch
@@ -0,0 +1,44 @@
+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>
+---
+ 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 8b3e5aa..4868a24 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/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/bind-ensure-searching-for-json-headers-searches-sysr.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/bind9 b/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/bind9
new file mode 100644
index 000000000..968679ff7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/bind9
@@ -0,0 +1,2 @@
+# startup options for the server
+OPTIONS="-u bind"
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/conf.patch b/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/conf.patch
new file mode 100644
index 000000000..aad345f9f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/dont-test-on-host.patch b/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/dont-test-on-host.patch
new file mode 100644
index 000000000..6989d6d4b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/generate-rndc-key.sh b/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/generate-rndc-key.sh
new file mode 100644
index 000000000..db201270f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/generate-rndc-key.sh
@@ -0,0 +1,7 @@
+#!/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
+ chmod 0640 /etc/bind/rndc.key
+fi
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/init.d-add-support-for-read-only-rootfs.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/make-etc-initd-bind-stop-work.patch b/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/make-etc-initd-bind-stop-work.patch
new file mode 100644
index 000000000..146f3e35d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/mips1-not-support-opcode.diff b/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/mips1-not-support-opcode.diff
new file mode 100644
index 000000000..2930796b6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/mips1-not-support-opcode.diff
@@ -0,0 +1,104 @@
+bind: port a patch to fix a build failure
+
+mips1 does not support ll and sc instructions, and lead to below error, now
+we port a patch from debian to fix it
+[http://security.debian.org/debian-security/pool/updates/main/b/bind9/bind9_9.8.4.dfsg.P1-6+nmu2+deb7u1.diff.gz]
+
+| {standard input}: Assembler messages:
+| {standard input}:47: Error: Opcode not supported on this processor: mips1 (mips1) `ll $3,0($6)'
+| {standard input}:50: Error: Opcode not supported on this processor: mips1 (mips1) `sc $3,0($6)'
+
+Upstream-Status: Pending
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+
+--- bind9-9.8.4.dfsg.P1.orig/lib/isc/mips/include/isc/atomic.h
++++ bind9-9.8.4.dfsg.P1/lib/isc/mips/include/isc/atomic.h
+@@ -31,18 +31,20 @@
+ isc_atomic_xadd(isc_int32_t *p, int val) {
+ isc_int32_t orig;
+
+- /* add is a cheat, since MIPS has no mov instruction */
+- __asm__ volatile (
+- "1:"
+- "ll $3, %1\n"
+- "add %0, $0, $3\n"
+- "add $3, $3, %2\n"
+- "sc $3, %1\n"
+- "beq $3, 0, 1b"
+- : "=&r"(orig)
+- : "m"(*p), "r"(val)
+- : "memory", "$3"
+- );
++ __asm__ __volatile__ (
++ " .set push \n"
++ " .set mips2 \n"
++ " .set noreorder \n"
++ " .set noat \n"
++ "1: ll $1, %1 \n"
++ " addu %0, $1, %2 \n"
++ " sc %0, %1 \n"
++ " beqz %0, 1b \n"
++ " move %0, $1 \n"
++ " .set pop \n"
++ : "=&r" (orig), "+R" (*p)
++ : "r" (val)
++ : "memory");
+
+ return (orig);
+ }
+@@ -52,16 +54,7 @@
+ */
+ static inline void
+ isc_atomic_store(isc_int32_t *p, isc_int32_t val) {
+- __asm__ volatile (
+- "1:"
+- "ll $3, %0\n"
+- "add $3, $0, %1\n"
+- "sc $3, %0\n"
+- "beq $3, 0, 1b"
+- :
+- : "m"(*p), "r"(val)
+- : "memory", "$3"
+- );
++ *p = val;
+ }
+
+ /*
+@@ -72,20 +65,23 @@
+ static inline isc_int32_t
+ isc_atomic_cmpxchg(isc_int32_t *p, int cmpval, int val) {
+ isc_int32_t orig;
++ isc_int32_t tmp;
+
+- __asm__ volatile(
+- "1:"
+- "ll $3, %1\n"
+- "add %0, $0, $3\n"
+- "bne $3, %2, 2f\n"
+- "add $3, $0, %3\n"
+- "sc $3, %1\n"
+- "beq $3, 0, 1b\n"
+- "2:"
+- : "=&r"(orig)
+- : "m"(*p), "r"(cmpval), "r"(val)
+- : "memory", "$3"
+- );
++ __asm__ __volatile__ (
++ " .set push \n"
++ " .set mips2 \n"
++ " .set noreorder \n"
++ " .set noat \n"
++ "1: ll $1, %1 \n"
++ " bne $1, %3, 2f \n"
++ " move %2, %4 \n"
++ " sc %2, %1 \n"
++ " beqz %2, 1b \n"
++ "2: move %0, $1 \n"
++ " .set pop \n"
++ : "=&r"(orig), "+R" (*p), "=r" (tmp)
++ : "r"(cmpval), "r"(val)
++ : "memory");
+
+ return (orig);
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/named.service b/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind/named.service
new file mode 100644
index 000000000..cda56ef01
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind_9.10.3-P3.bb b/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind_9.10.3-P3.bb
new file mode 100644
index 000000000..1e3a20f9a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/bind/bind_9.10.3-P3.bb
@@ -0,0 +1,109 @@
+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=0a95f52a0ab6c5f52dedc9a45e7abb3f"
+
+DEPENDS = "openssl libcap"
+
+SRC_URI = "ftp://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.gz \
+ file://conf.patch \
+ file://make-etc-initd-bind-stop-work.patch \
+ file://mips1-not-support-opcode.diff \
+ 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://CVE-2016-1285.patch \
+ file://CVE-2016-1286_1.patch \
+ file://CVE-2016-1286_2.patch \
+ file://CVE-2016-2088.patch \
+ "
+
+SRC_URI[md5sum] = "bcf7e772b616f7259420a3edc5df350a"
+SRC_URI[sha256sum] = "690810d1fbb72afa629e74638d19cd44e28d2b2e5eb63f55c705ad85d1a4cb83"
+
+ENABLE_IPV6 = "--enable-ipv6=${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'yes', 'no', d)}"
+EXTRA_OECONF = " ${ENABLE_IPV6} --with-randomdev=/dev/random --disable-threads \
+ --disable-devpoll --disable-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
+
+# 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"
+
+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} = "python-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"
+
+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,#!.*python,#! /usr/bin/env python,' ${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
+}
+
+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/import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5.inc b/import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5.inc
new file mode 100644
index 000000000..a508229a3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5.inc
@@ -0,0 +1,112 @@
+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 libusb dbus-glib glib-2.0 libcheck readline"
+PROVIDES += "bluez-hcidump"
+RPROVIDES_${PN} += "bluez-hcidump"
+
+RCONFLICTS_${PN} = "bluez4"
+
+PACKAGECONFIG ??= "obex-profiles"
+PACKAGECONFIG[obex-profiles] = "--enable-obex,--disable-obex,libical"
+PACKAGECONFIG[experimental] = "--enable-experimental,--disable-experimental,"
+
+SRC_URI = "\
+ ${KERNELORG_MIRROR}/linux/bluetooth/bluez-${PV}.tar.xz \
+ 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}"
+
+inherit autotools-brokensep pkgconfig systemd update-rc.d distro_features_check ptest
+
+EXTRA_OECONF = "\
+ --enable-tools \
+ --disable-cups \
+ --enable-test \
+ --enable-datafiles \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--enable-systemd', '--disable-systemd', d)} \
+ --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_EXPERIMENTAL ??= ""
+NOINST_TOOLS = " \
+ ${NOINST_TOOLS_READLINE} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'experimental', '${NOINST_TOOLS_EXPERIMENTAL}', '', 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/audio/audio.conf ]; then
+ install -m 0644 ${S}/profiles/audio/audio.conf ${D}/${sysconfdir}/bluetooth/
+ fi
+ 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
+
+ # Install desired tools that upstream leaves in build area
+ for f in ${NOINST_TOOLS} ; do
+ install -m 755 ${B}/$f ${D}/${bindir}
+ done
+}
+
+ALLOW_EMPTY_libasound-module-bluez = "1"
+PACKAGES =+ "libasound-module-bluez ${PN}-testtools ${PN}-obex ${PN}-noinst-tools"
+
+FILES_libasound-module-bluez = "${libdir}/alsa-lib/lib*.so ${datadir}/alsa"
+FILES_${PN} += "${libdir}/bluetooth/plugins/*.so ${base_libdir}/udev/ ${nonarch_base_libdir}/udev/ ${systemd_unitdir}/ ${datadir}/dbus-1"
+FILES_${PN}-dev += "\
+ ${libdir}/bluetooth/plugins/*.la \
+ ${libdir}/alsa-lib/*.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", True)
+ 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', True))}"
+
+RDEPENDS_${PN}-testtools += "python python-dbus python-pygobject"
+
+SYSTEMD_SERVICE_${PN} = "bluetooth.service"
+INITSCRIPT_PACKAGES = "${PN}"
+INITSCRIPT_NAME_${PN} = "bluetooth"
+
+EXCLUDE_FROM_WORLD = "1"
+
+do_compile_ptest() {
+ oe_runmake buildtests
+}
+
+do_install_ptest() {
+ cp -r ${B}/unit/ ${D}${PTEST_PATH}
+ rm ${D}${PTEST_PATH}/unit/*.c ${D}${PTEST_PATH}/unit/*.o
+}
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5/0001-tests-add-a-target-for-building-tests-without-runnin.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5/init b/import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5/init
new file mode 100644
index 000000000..1606a5c66
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5/init
@@ -0,0 +1,68 @@
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DESC=bluetooth
+
+DAEMON=/usr/lib/bluez5/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 "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 "Stopping $DESC"
+ if test "$BLUETOOTH_ENABLED" = 0; then
+ echo "disabled."
+ 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/import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5/run-ptest b/import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5/run-ptest
new file mode 100644
index 000000000..21df00c32
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5_5.37.bb b/import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5_5.37.bb
new file mode 100644
index 000000000..db20f79ff
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/bluez5/bluez5_5.37.bb
@@ -0,0 +1,55 @@
+require bluez5.inc
+
+REQUIRED_DISTRO_FEATURES = "bluez5"
+
+SRC_URI[md5sum] = "33177e5743e24b2b3738f72be64e3ffb"
+SRC_URI[sha256sum] = "c14ba9ddcb0055522073477b8fd8bf1ddf5d219e75fdfd4699b7e0ce5350d6b0"
+
+# noinst programs in Makefile.tools that are conditional on READLINE
+# support
+NOINST_TOOLS_READLINE ?= " \
+ attrib/gatttool \
+ tools/obex-client-tool \
+ tools/obex-server-tool \
+ tools/bluetooth-player \
+ tools/obexctl \
+"
+
+# noinst programs in Makefile.tools that are conditional on EXPERIMENTAL
+# support
+NOINST_TOOLS_EXPERIMENTAL ?= " \
+ emulator/btvirt \
+ emulator/b1ee \
+ emulator/hfp \
+ tools/3dsp \
+ tools/mgmt-tester \
+ tools/gap-tester \
+ tools/l2cap-tester \
+ tools/sco-tester \
+ tools/smp-tester \
+ tools/hci-tester \
+ tools/rfcomm-tester \
+ tools/bdaddr \
+ tools/avinfo \
+ tools/avtest \
+ tools/scotest \
+ tools/amptest \
+ tools/hwdb \
+ tools/hcieventmask \
+ tools/hcisecfilter \
+ tools/btmgmt \
+ tools/btinfo \
+ tools/btattach \
+ tools/btsnoop \
+ tools/btproxy \
+ tools/btiotest \
+ tools/mcaptest \
+ tools/cltest \
+ tools/oobtest \
+ tools/seq2bseq \
+ tools/ibeacon \
+ tools/btgatt-client \
+ tools/btgatt-server \
+ tools/gatt-service \
+ profiles/iap/iapd \
+"
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-conf.bb b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-conf.bb
new file mode 100644
index 000000000..9a519ec86
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-connection.service b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-connection.service
new file mode 100644
index 000000000..48adfc08a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-setup b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-setup
new file mode 100644
index 000000000..c46899ef3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired.config b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired.config
new file mode 100644
index 000000000..42998ce89
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome/0001-Removed-icon-from-connman-gnome-about-applet.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome/connman-gnome-fix-dbus-interface-name.patch b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome/connman-gnome-fix-dbus-interface-name.patch
new file mode 100644
index 000000000..f4049fa3e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-01.png b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-01.png
new file mode 100644
index 000000000..33247c1e2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-01.png
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-02.png b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-02.png
new file mode 100644
index 000000000..a94fb952f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-02.png
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-03.png b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-03.png
new file mode 100644
index 000000000..b5eb405a9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-03.png
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-04.png b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-04.png
new file mode 100644
index 000000000..be54419fa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-04.png
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-05.png b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-05.png
new file mode 100644
index 000000000..1c40ac9a1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-05.png
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome/null_check_for_ipv4_config.patch b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome/null_check_for_ipv4_config.patch
new file mode 100644
index 000000000..0421cda0b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome_0.7.bb b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome_0.7.bb
new file mode 100644
index 000000000..7b875f00f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman-gnome_0.7.bb
@@ -0,0 +1,29 @@
+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+ dbus-glib 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 \
+ "
+
+S = "${WORKDIR}/git"
+
+inherit autotools-brokensep gtk-icon-cache pkgconfig distro_features_check
+ANY_OF_DISTRO_FEATURES = "${GTK2DISTROFEATURES}"
+
+RDEPENDS_${PN} = "connman"
+
+do_install_append() {
+ install -m 0644 ${WORKDIR}/images/* ${D}/usr/share/icons/hicolor/22x22/apps/
+}
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman.inc b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman.inc
new file mode 100644
index 000000000..c3752514c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman.inc
@@ -0,0 +1,210 @@
+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
+
+DEPENDS = "dbus glib-2.0 ppp iptables 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 \
+ --enable-test \
+ --disable-polkit \
+ --enable-client \
+"
+CFLAGS += "-D_GNU_SOURCE"
+
+PACKAGECONFIG ??= "wispr \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd','systemd', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wifi','wifi', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', '3g','3g', '', d)} \
+"
+
+# 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,"
+
+INITSCRIPT_NAME = "connman"
+INITSCRIPT_PARAMS = "start 05 5 2 3 . stop 22 0 1 6 ."
+
+python __anonymous () {
+ systemd_packages = "${PN}"
+ pkgconfig = d.getVar('PACKAGECONFIG', True)
+ 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"
+
+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
+}
+
+# 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", True) 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 ${libdir}/${BPN}/test/*"
+RDEPENDS_${PN}-tests = "python-dbus python-pygobject python-textutils python-subprocess python-fcntl python-netclient \
+ ${PN} \
+"
+
+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/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0001-Detect-backtrace-API-availability-before-using-it.patch b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0001-Detect-backtrace-API-availability-before-using-it.patch
new file mode 100644
index 000000000..5dc6fd634
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0001-Detect-backtrace-API-availability-before-using-it.patch
@@ -0,0 +1,55 @@
+From 00d4447395725abaa651e12ed40095081e04011e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 13 Sep 2015 13:22:01 -0700
+Subject: [PATCH 1/3] Detect backtrace() API availability before using it
+
+C libraries besides glibc do not have backtrace() implemented
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ configure.ac | 2 ++
+ src/log.c | 5 ++---
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 69c0eeb..90099f2 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -171,6 +171,8 @@ fi
+ AM_CONDITIONAL(PPTP, test "${enable_pptp}" != "no")
+ AM_CONDITIONAL(PPTP_BUILTIN, test "${enable_pptp}" = "builtin")
+
++AC_CHECK_HEADERS([execinfo.h])
++
+ AC_CHECK_HEADERS(resolv.h, dummy=yes,
+ AC_MSG_ERROR(resolver header files are required))
+ AC_CHECK_LIB(resolv, ns_initparse, dummy=yes, [
+diff --git a/src/log.c b/src/log.c
+index a693bd0..5b40c1f 100644
+--- a/src/log.c
++++ b/src/log.c
+@@ -30,7 +30,6 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <syslog.h>
+-#include <execinfo.h>
+ #include <dlfcn.h>
+
+ #include "connman.h"
+@@ -215,9 +214,9 @@ static void print_backtrace(unsigned int offset)
+ static void signal_handler(int signo)
+ {
+ connman_error("Aborting (signal %d) [%s]", signo, program_exec);
+-
++#ifdef HAVE_EXECINFO_H
+ print_backtrace(2);
+-
++#endif /* HAVE_EXECINFO_H */
+ exit(EXIT_FAILURE);
+ }
+
+--
+2.5.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0001-iptables-Add-missing-function-item-of-xtables-to-mat.patch b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0001-iptables-Add-missing-function-item-of-xtables-to-mat.patch
new file mode 100644
index 000000000..1b5a3e440
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0001-iptables-Add-missing-function-item-of-xtables-to-mat.patch
@@ -0,0 +1,42 @@
+From acea08a0e4234a4c1a87bedc087c73ff36de0c7b Mon Sep 17 00:00:00 2001
+From: Wu Zheng <wu.zheng@intel.com>
+Date: Thu, 28 Jan 2016 18:04:17 +0800
+Subject: [PATCH] iptables: Add missing function item of xtables to match
+ iptables 1.6
+
+The struct of xtables_globals has been modified in iptables 1.6.
+If connman runs with iptables 1.6, it can crash.
+
+Program received signal SIGSEGV, Segmentation fault.
+0x00000000 in ?? ()
+0xb7dea89c in xtables_find_target () from /usr/lib/libxtables.so.11
+0xb7deac1c in ?? () from /usr/lib/libxtables.so.11
+0xb7dea793 in xtables_find_target () from /usr/lib/libxtables.so.11
+
+The the missing function item of xtables is added to xtables_globals.
+
+Upstream-Status: Backport
+
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+Signed-off-by: Wu Zheng <wu.zheng@intel.com>
+---
+ src/iptables.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/iptables.c b/src/iptables.c
+index bc0c763..5ef757a 100644
+--- a/src/iptables.c
++++ b/src/iptables.c
+@@ -1566,6 +1566,9 @@ struct xtables_globals iptables_globals = {
+ .option_offset = 0,
+ .opts = iptables_opts,
+ .orig_opts = iptables_opts,
++#if XTABLES_VERSION_CODE > 10
++ .compat_rev = xtables_compatible_revision,
++#endif
+ };
+
+ static struct xtables_target *prepare_target(struct connman_iptables *table,
+--
+2.4.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0001-plugin.h-Change-visibility-to-default-for-debug-symb.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0002-resolve-musl-does-not-implement-res_ninit.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0003-Fix-header-inclusions-for-musl.patch b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0003-Fix-header-inclusions-for-musl.patch
new file mode 100644
index 000000000..eefc6834b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0003-Fix-header-inclusions-for-musl.patch
@@ -0,0 +1,118 @@
+From 67645a01a2f3f52625d8dd77f2811a9e213e1b7d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 13 Sep 2015 13:28:20 -0700
+Subject: [PATCH] Fix header inclusions for musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ gweb/gresolv.c | 1 +
+ plugins/wifi.c | 3 +--
+ src/tethering.c | 2 --
+ tools/dhcp-test.c | 1 -
+ tools/dnsproxy-test.c | 1 +
+ 5 files changed, 3 insertions(+), 5 deletions(-)
+
+Index: connman-1.30/gweb/gresolv.c
+===================================================================
+--- connman-1.30.orig/gweb/gresolv.c
++++ connman-1.30/gweb/gresolv.c
+@@ -28,6 +28,7 @@
+ #include <stdarg.h>
+ #include <string.h>
+ #include <stdlib.h>
++#include <stdio.h>
+ #include <resolv.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
+Index: connman-1.30/plugins/wifi.c
+===================================================================
+--- connman-1.30.orig/plugins/wifi.c
++++ connman-1.30/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
+Index: connman-1.30/src/tethering.c
+===================================================================
+--- connman-1.30.orig/src/tethering.c
++++ connman-1.30/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>
+
+Index: connman-1.30/tools/dhcp-test.c
+===================================================================
+--- connman-1.30.orig/tools/dhcp-test.c
++++ connman-1.30/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>
+
+Index: connman-1.30/tools/dnsproxy-test.c
+===================================================================
+--- connman-1.30.orig/tools/dnsproxy-test.c
++++ connman-1.30/tools/dnsproxy-test.c
+@@ -27,6 +27,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <stdio.h>
+ #include <arpa/inet.h>
+ #include <netinet/in.h>
+ #include <sys/types.h>
+Index: connman-1.30/configure.ac
+===================================================================
+--- connman-1.30.orig/configure.ac
++++ connman-1.30/configure.ac
+@@ -173,6 +173,8 @@ AM_CONDITIONAL(PPTP_BUILTIN, test "${ena
+
+ AC_CHECK_HEADERS([execinfo.h])
+
++AC_CHECK_MEMBERS([struct in6_pktinfo.ipi6_addr], [], [], [[#include <netinet/in.h>]])
++
+ AC_CHECK_HEADERS(resolv.h, dummy=yes,
+ AC_MSG_ERROR(resolver header files are required))
+ AC_CHECK_LIB(resolv, ns_initparse, dummy=yes, [
+Index: connman-1.30/gdhcp/common.h
+===================================================================
+--- connman-1.30.orig/gdhcp/common.h
++++ connman-1.30/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 GNU or musl libc */
++#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 */
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/connman b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/connman
new file mode 100644
index 000000000..c64fa0d71
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman_1.31.bb b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman_1.31.bb
new file mode 100644
index 000000000..e71d2218a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman_1.31.bb
@@ -0,0 +1,15 @@
+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-Detect-backtrace-API-availability-before-using-it.patch \
+ file://0002-resolve-musl-does-not-implement-res_ninit.patch \
+ file://0003-Fix-header-inclusions-for-musl.patch \
+ file://0001-iptables-Add-missing-function-item-of-xtables-to-mat.patch \
+ file://connman \
+ "
+SRC_URI[md5sum] = "cb1c413fcc4f49430294bbd7a92f5f3c"
+SRC_URI[sha256sum] = "88fcf0b6df334796b90e2fd2e434d6f5b36cd6f13b886a119b8c90276b72b8e2"
+
+RRECOMMENDS_${PN} = "connman-conf"
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp.inc b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp.inc
new file mode 100644
index 000000000..5e396f159
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp.inc
@@ -0,0 +1,127 @@
+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 = "ftp://ftp.isc.org/isc/dhcp/${PV}/dhcp-${PV}.tar.gz \
+ file://define-macro-_PATH_DHCPD_CONF-and-_PATH_DHCLIENT_CON.patch \
+ file://init-relay file://default-relay \
+ file://init-server file://default-server \
+ file://dhclient.conf file://dhcpd.conf \
+ file://dhcpd.service file://dhcrelay.service \
+ file://dhcpd6.service \
+ file://search-for-libxml2.patch "
+
+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/${PN} --shell /bin/false --user-group ${PN}"
+
+SYSTEMD_PACKAGES = "${PN}-server ${PN}-relay"
+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"
+
+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 \
+ "
+
+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
+}
+
+PACKAGES += "dhcp-server dhcp-server-config dhcp-client dhcp-relay dhcp-omshell"
+
+FILES_${PN} = ""
+RDEPENDS_${PN}-dev = ""
+RDEPENDS_${PN}-staticdev = ""
+
+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"
+RDEPENDS_${PN}-client = "bash"
+
+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/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/0001-site.h-enable-gentle-shutdown.patch b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/0001-site.h-enable-gentle-shutdown.patch
new file mode 100644
index 000000000..434421230
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/0001-site.h-enable-gentle-shutdown.patch
@@ -0,0 +1,25 @@
+Upstream-Status: Inappropriate [configuration]
+
+Subject: [PATCH] site.h: enable gentle shutdown
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ includes/site.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/includes/site.h b/includes/site.h
+index 73fa4e8..9c33de3 100644
+--- a/includes/site.h
++++ b/includes/site.h
+@@ -280,7 +280,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.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/CVE-2015-8605.patch b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/CVE-2015-8605.patch
new file mode 100644
index 000000000..923d5d5c5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/CVE-2015-8605.patch
@@ -0,0 +1,99 @@
+Solves CVE-2015-8605 that caused DoS when an invalid lenght field in IPv4 UDP
+was recived by the server.
+
+Upstream-Status: Backport
+CVE: CVE-2015-8605
+
+Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
+
+=======================================================================
+diff --git a/common/packet.c b/common/packet.c
+index b530432..e600e37 100644
+--- a/common/packet.c
++++ b/common/packet.c
+@@ -220,7 +220,28 @@ ssize_t decode_hw_header (interface, buf, bufix, from)
+ }
+ }
+
+-/* UDP header and IP header decoded together for convenience. */
++/*!
++ *
++ * \brief UDP header and IP header decoded together for convenience.
++ *
++ * Attempt to decode the UDP and IP headers and, if necessary, checksum
++ * the packet.
++ *
++ * \param inteface - the interface on which the packet was recevied
++ * \param buf - a pointer to the buffer for the received packet
++ * \param bufix - where to start processing the buffer, previous
++ * routines may have processed parts of the buffer already
++ * \param from - space to return the address of the packet sender
++ * \param buflen - remaining length of the buffer, this will have been
++ * decremented by bufix by the caller
++ * \param rbuflen - space to return the length of the payload from the udp
++ * header
++ * \param csum_ready - indication if the checksum is valid for use
++ * non-zero indicates the checksum should be validated
++ *
++ * \return - the index to the first byte of the udp payload (that is the
++ * start of the DHCP packet
++ */
+
+ ssize_t
+ decode_udp_ip_header(struct interface_info *interface,
+@@ -231,7 +252,7 @@ decode_udp_ip_header(struct interface_info *interface,
+ unsigned char *data;
+ struct ip ip;
+ struct udphdr udp;
+- unsigned char *upp, *endbuf;
++ unsigned char *upp;
+ u_int32_t ip_len, ulen, pkt_len;
+ static unsigned int ip_packets_seen = 0;
+ static unsigned int ip_packets_bad_checksum = 0;
+@@ -241,11 +262,8 @@ decode_udp_ip_header(struct interface_info *interface,
+ static unsigned int udp_packets_length_overflow = 0;
+ unsigned len;
+
+- /* Designate the end of the input buffer for bounds checks. */
+- endbuf = buf + bufix + buflen;
+-
+ /* Assure there is at least an IP header there. */
+- if ((buf + bufix + sizeof(ip)) > endbuf)
++ if (sizeof(ip) > buflen)
+ return -1;
+
+ /* Copy the IP header into a stack aligned structure for inspection.
+@@ -257,13 +275,17 @@ decode_udp_ip_header(struct interface_info *interface,
+ ip_len = (*upp & 0x0f) << 2;
+ upp += ip_len;
+
+- /* Check the IP packet length. */
++ /* Check packet lengths are within the buffer:
++ * first the ip header (ip_len)
++ * then the packet length from the ip header (pkt_len)
++ * then the udp header (ip_len + sizeof(udp)
++ * We are liberal in what we accept, the udp payload should fit within
++ * pkt_len, but we only check against the full buffer size.
++ */
+ pkt_len = ntohs(ip.ip_len);
+- if (pkt_len > buflen)
+- return -1;
+-
+- /* Assure after ip_len bytes that there is enough room for a UDP header. */
+- if ((upp + sizeof(udp)) > endbuf)
++ if ((ip_len > buflen) ||
++ (pkt_len > buflen) ||
++ ((ip_len + sizeof(udp)) > buflen))
+ return -1;
+
+ /* Copy the UDP header into a stack aligned structure for inspection. */
+@@ -284,7 +306,8 @@ decode_udp_ip_header(struct interface_info *interface,
+ return -1;
+
+ udp_packets_length_checked++;
+- if ((upp + ulen) > endbuf) {
++ /* verify that the payload length from the udp packet fits in the buffer */
++ if ((ip_len + ulen) > buflen) {
+ udp_packets_length_overflow++;
+ if (((udp_packets_length_checked > 4) &&
+ (udp_packets_length_overflow != 0)) &&
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/CVE-2016-2774.patch b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/CVE-2016-2774.patch
new file mode 100644
index 000000000..4836dbc2a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/CVE-2016-2774.patch
@@ -0,0 +1,65 @@
+From b9f56d578ebfd649b5d829960540859ac6ca931c Mon Sep 17 00:00:00 2001
+From: Catalin Enache <catalin.enache@windriver.com>
+Date: Tue, 12 Apr 2016 18:23:31 +0300
+Subject: [PATCH] Add patch to limit the value of an fd we accept for a
+ connection.
+
+By limiting the highest value we accept for an fd we limit the number
+of connections.
+
+Upstream-Status: Backport
+CVE: CVE-2016-2774
+
+Author: Shawn Routhier <sar@isc.org>
+Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
+---
+ includes/site.h | 6 ++++++
+ omapip/listener.c | 9 +++++++--
+ 3 files changed, 18 insertions(+), 2 deletions(-)
+
+diff --git a/includes/site.h b/includes/site.h
+index 9c33de3..df020c8 100644
+--- a/includes/site.h
++++ b/includes/site.h
+@@ -290,6 +290,12 @@
+ this option will be removed at some time. */
+ /* #define INCLUDE_OLD_DHCP_ISC_ERROR_CODES */
+
++/* Limit the value of a file descriptor the serve will use
++ when accepting a connecting request. This can be used to
++ limit the number of TCP connections that the server will
++ allow at one time. A value of 0 means there is no limit.*/
++#define MAX_FD_VALUE 200
++
+ /* Include definitions for various options. In general these
+ should be left as is, but if you have already defined one
+ of these and prefer your definition you can comment the
+diff --git a/omapip/listener.c b/omapip/listener.c
+index 8bdcdbd..61473cf 100644
+--- a/omapip/listener.c
++++ b/omapip/listener.c
+@@ -3,7 +3,7 @@
+ Subroutines that support the generic listener object. */
+
+ /*
+- * Copyright (c) 2012,2014 by Internet Systems Consortium, Inc. ("ISC")
++ * Copyright (c) 2012,2014,2016 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004,2007,2009 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1999-2003 by Internet Software Consortium
+ *
+@@ -233,7 +233,12 @@ isc_result_t omapi_accept (omapi_object_t *h)
+ return ISC_R_NORESOURCES;
+ return ISC_R_UNEXPECTED;
+ }
+-
++
++ if ((MAX_FD_VALUE != 0) && (socket > MAX_FD_VALUE)) {
++ close(socket);
++ return (ISC_R_NORESOURCES);
++ }
++
+ #if defined (TRACING)
+ /* If we're recording a trace, remember the connection. */
+ if (trace_record ()) {
+--
+2.7.4
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/define-macro-_PATH_DHCPD_CONF-and-_PATH_DHCLIENT_CON.patch b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/define-macro-_PATH_DHCPD_CONF-and-_PATH_DHCLIENT_CON.patch
new file mode 100644
index 000000000..32bdaf08e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/define-macro-_PATH_DHCPD_CONF-and-_PATH_DHCLIENT_CON.patch
@@ -0,0 +1,26 @@
+define macro _PATH_DHCPD_CONF and _PATH_DHCLIENT_CONF
+
+Upstream-Status: Inappropriate [OE specific]
+
+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 d87b309..17bc40d 100644
+--- a/includes/site.h
++++ b/includes/site.h
+@@ -139,7 +139,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.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/dhclient-script-drop-resolv.conf.dhclient.patch b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/dhclient-script-drop-resolv.conf.dhclient.patch
new file mode 100644
index 000000000..47ea5554b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/dhclient-script-drop-resolv.conf.dhclient.patch
@@ -0,0 +1,70 @@
+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 should use shell variable to instead of
+temp files '/etc/resolv.conf.dhclient' and '/etc/resolv.conf.dhclient6'.
+
+Upstream-Status: Pending
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ client/scripts/linux | 20 +++++++++-----------
+ 1 file changed, 9 insertions(+), 11 deletions(-)
+
+diff --git a/client/scripts/linux b/client/scripts/linux
+--- a/client/scripts/linux
++++ b/client/scripts/linux
+@@ -27,27 +27,25 @@ ip=/sbin/ip
+
+ make_resolv_conf() {
+ if [ x"$new_domain_name_servers" != x ]; then
+- cat /dev/null > /etc/resolv.conf.dhclient
+- chmod 644 /etc/resolv.conf.dhclient
++ resolv_conf=""
+ if [ x"$new_domain_search" != x ]; then
+- echo search $new_domain_search >> /etc/resolv.conf.dhclient
++ resolv_conf="search ${new_domain_search}\n"
+ elif [ x"$new_domain_name" != x ]; then
+ # Note that the DHCP 'Domain Name Option' is really just a domain
+ # name, and that this practice of using the domain name option as
+ # a search path is both nonstandard and deprecated.
+- echo search $new_domain_name >> /etc/resolv.conf.dhclient
++ resolv_conf="search ${new_domain_name}\n"
+ fi
+ for nameserver in $new_domain_name_servers; do
+- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
++ resolv_conf="${resolv_conf}nameserver ${nameserver}\n"
+ done
+
+- mv /etc/resolv.conf.dhclient /etc/resolv.conf
++ echo -e "${resolv_conf}" > /etc/resolv.conf
+ elif [ "x${new_dhcp6_name_servers}" != x ] ; then
+- cat /dev/null > /etc/resolv.conf.dhclient6
+- chmod 644 /etc/resolv.conf.dhclient6
++ resolv_conf=""
+
+ if [ "x${new_dhcp6_domain_search}" != x ] ; then
+- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
++ resolv_conf="search ${new_dhcp6_domain_search}\n"
+ fi
+ shopt -s nocasematch
+ for nameserver in ${new_dhcp6_name_servers} ; do
+@@ -59,11 +57,11 @@ make_resolv_conf() {
+ else
+ zone_id=
+ fi
+- echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6
++ resolv_conf="${resolv_conf}nameserver ${nameserver}$zone_id\n"
+ done
+ shopt -u nocasematch
+
+- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
++ echo -e "${resolv_conf}" > /etc/resolv.conf
+ fi
+ }
+
+--
+1.8.1.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/dhcp-3.0.3-dhclient-dbus.patch b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/dhcp-3.0.3-dhclient-dbus.patch
new file mode 100644
index 000000000..b4a666d10
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/dhcp-3.0.3-dhclient-dbus.patch
@@ -0,0 +1,86 @@
+Upstream-Status: Inappropriate [distribution]
+
+--- client/scripts/bsdos
++++ client/scripts/bsdos
+@@ -47,6 +47,11 @@
+ . /etc/dhcp/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
+ }
+
+--- client/scripts/freebsd
++++ client/scripts/freebsd
+@@ -57,6 +57,11 @@
+ . /etc/dhcp/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
+ }
+
+--- client/scripts/linux
++++ client/scripts/linux
+@@ -69,6 +69,11 @@
+ . /etc/dhcp/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
+ }
+
+--- client/scripts/netbsd
++++ client/scripts/netbsd
+@@ -47,6 +47,11 @@
+ . /etc/dhcp/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
+ }
+
+--- client/scripts/openbsd
++++ client/scripts/openbsd
+@@ -47,6 +47,11 @@
+ . /etc/dhcp/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
+ }
+
+--- client/scripts/solaris
++++ client/scripts/solaris
+@@ -47,6 +47,11 @@
+ . /etc/dhcp/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/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/fix-external-bind.patch b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/fix-external-bind.patch
new file mode 100644
index 000000000..956c5d8b5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/fix-external-bind.patch
@@ -0,0 +1,115 @@
+Upstream-Status: Pending
+
+11/30/2010
+--with-libbind=PATH is available but not used by Makefile,
+this patch is to allow building with external bind
+
+Signed-off-by: Qing He <qing.he@intel.com>
+
+Rebase the patch to 4.3.3
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+diff --git a/Makefile.am b/Makefile.am
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -25,7 +25,7 @@ EXTRA_DIST = RELNOTES LICENSE \
+ bind/Makefile.in bind/bind.tar.gz bind/version.tmp \
+ common/tests/Atffile server/tests/Atffile
+
+-SUBDIRS = bind includes tests common omapip client dhcpctl relay server
++SUBDIRS = includes tests common omapip client dhcpctl relay server
+
+ nobase_include_HEADERS = dhcpctl/dhcpctl.h
+
+diff --git a/client/Makefile.am b/client/Makefile.am
+--- a/client/Makefile.am
++++ b/client/Makefile.am
+@@ -10,8 +10,8 @@ dhclient_SOURCES = clparse.c dhclient.c 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 ../bind/lib/libirs.a \
+- ../bind/lib/libdns.a ../bind/lib/libisccfg.a ../bind/lib/libisc.a
++dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.a $(libbind)/libirs.a \
++ $(libbind)/libdns.a $(libbind)/libisccfg.a $(libbind)/libisc.a
+ man_MANS = dhclient.8 dhclient-script.8 dhclient.conf.5 dhclient.leases.5
+ EXTRA_DIST = $(man_MANS)
+
+diff --git a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
+@@ -623,6 +623,7 @@ no)
+ fi
+ ;;
+ esac
++AC_SUBST([libbind])
+
+ # OpenLDAP support.
+ AC_ARG_WITH(ldap,
+diff --git a/dhcpctl/Makefile.am b/dhcpctl/Makefile.am
+--- a/dhcpctl/Makefile.am
++++ b/dhcpctl/Makefile.am
+@@ -6,12 +6,12 @@ EXTRA_DIST = $(man_MANS)
+
+ omshell_SOURCES = omshell.c
+ omshell_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \
+- ../bind/lib/libirs.a ../bind/lib/libdns.a \
+- ../bind/lib/libisccfg.a ../bind/lib/libisc.a
++ $(libbind)/libirs.a $(libbind)/libdns.a \
++ $(libbind)/libisccfg.a $(libbind)/libisc.a
+
+ libdhcpctl_a_SOURCES = dhcpctl.c callback.c remote.c
+
+ cltest_SOURCES = cltest.c
+ cltest_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \
+- ../bind/lib/libirs.a ../bind/lib/libdns.a \
+- ../bind/lib/libisccfg.a ../bind/lib/libisc.a
++ $(libbind)/libirs.a $(libbind)/libdns.a \
++ $(libbind)/libisccfg.a $(libbind)/libisc.a
+diff --git a/omapip/Makefile.am b/omapip/Makefile.am
+--- a/omapip/Makefile.am
++++ b/omapip/Makefile.am
+@@ -10,6 +10,6 @@ man_MANS = omapi.3
+ EXTRA_DIST = $(man_MANS)
+
+ svtest_SOURCES = test.c
+-svtest_LDADD = libomapi.a ../bind/lib/libirs.a ../bind/lib/libdns.a \
+- ../bind/lib/libisccfg.a ../bind/lib/libisc.a
++svtest_LDADD = libomapi.a $(libbind)/libirs.a $(libbind)/libdns.a \
++ $(libbind)/libisccfg.a $(libbind)/libisc.a
+
+diff --git a/relay/Makefile.am b/relay/Makefile.am
+--- a/relay/Makefile.am
++++ b/relay/Makefile.am
+@@ -3,8 +3,8 @@ AM_CPPFLAGS = -DLOCALSTATEDIR='"@localstatedir@"'
+ sbin_PROGRAMS = dhcrelay
+ dhcrelay_SOURCES = dhcrelay.c
+ dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \
+- ../bind/lib/libirs.a ../bind/lib/libdns.a \
+- ../bind/lib/libisccfg.a ../bind/lib/libisc.a
++ $(libbind)/libirs.a $(libbind)/libdns.a \
++ $(libbind)/libisccfg.a $(libbind)/libisc.a
+ man_MANS = dhcrelay.8
+ EXTRA_DIST = $(man_MANS)
+
+diff --git a/server/Makefile.am b/server/Makefile.am
+--- a/server/Makefile.am
++++ b/server/Makefile.am
+@@ -14,10 +14,12 @@ dhcpd_SOURCES = dhcpd.c dhcp.c bootp.c confpars.c db.c class.c failover.c \
+
+ dhcpd_CFLAGS = $(LDAP_CFLAGS)
+ dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \
+- ../dhcpctl/libdhcpctl.a ../bind/lib/libirs.a \
+- ../bind/lib/libdns.a ../bind/lib/libisccfg.a ../bind/lib/libisc.a \
++ ../dhcpctl/libdhcpctl.a $(libbind)/libirs.a \
++ $(libbind)/libdns.a $(libbind)/libisccfg.a $(libbind)/libisc.a \
+ $(LDAP_LIBS)
+
++ dhcpd_CFLAGS = $(LDAP_CFLAGS)
++
+ man_MANS = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5
+ EXTRA_DIST = $(man_MANS)
+
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/fixsepbuild.patch b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/fixsepbuild.patch
new file mode 100644
index 000000000..b3f8fdb0a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/fixsepbuild.patch
@@ -0,0 +1,89 @@
+Fix out of tree builds
+
+Upstream-Status: Pending
+
+RP 2013/03/21
+
+Rebase to 4.3.1
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+diff --git a/client/Makefile.am b/client/Makefile.am
+index 8411960..1740f72 100644
+--- a/client/Makefile.am
++++ b/client/Makefile.am
+@@ -4,6 +4,8 @@
+ # production code. Sadly, we are not there yet.
+ SUBDIRS = . tests
+
++AM_CPPFLAGS = -I$(top_srcdir)/includes
++
+ dist_sysconf_DATA = dhclient.conf.example
+ sbin_PROGRAMS = dhclient
+ dhclient_SOURCES = clparse.c dhclient.c dhc6.c \
+@@ -17,8 +19,8 @@ EXTRA_DIST = $(man_MANS)
+
+ dhclient.o: dhclient.c
+ $(COMPILE) -DCLIENT_PATH='"PATH=$(sbindir):/sbin:/bin:/usr/sbin:/usr/bin"' \
+- -DLOCALSTATEDIR='"$(localstatedir)"' -c dhclient.c
++ -DLOCALSTATEDIR='"$(localstatedir)"' -c $(srcdir)/dhclient.c
+
+ dhc6.o: dhc6.c
+ $(COMPILE) -DCLIENT_PATH='"PATH=$(sbindir):/sbin:/bin:/usr/sbin:/usr/bin"' \
+- -DLOCALSTATEDIR='"$(localstatedir)"' -c dhc6.c
++ -DLOCALSTATEDIR='"$(localstatedir)"' -c $(srcdir)/dhc6.c
+diff --git a/common/Makefile.am b/common/Makefile.am
+index eddef05..5ce045f 100644
+--- a/common/Makefile.am
++++ b/common/Makefile.am
+@@ -1,4 +1,4 @@
+-AM_CPPFLAGS = -I.. -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 2987a53..cd72d75 100644
+--- a/dhcpctl/Makefile.am
++++ b/dhcpctl/Makefile.am
+@@ -1,3 +1,5 @@
++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 5074479..9c0fab3 100644
+--- a/omapip/Makefile.am
++++ b/omapip/Makefile.am
+@@ -1,3 +1,5 @@
++AM_CPPFLAGS = -I$(top_srcdir)/includes
++
+ lib_LIBRARIES = libomapi.a
+ noinst_PROGRAMS = svtest
+
+diff --git a/relay/Makefile.am b/relay/Makefile.am
+index ec72a31..f842071 100644
+--- a/relay/Makefile.am
++++ b/relay/Makefile.am
+@@ -1,4 +1,4 @@
+-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 a446f0b..d0b873a 100644
+--- a/server/Makefile.am
++++ b/server/Makefile.am
+@@ -4,7 +4,7 @@
+ # production code. Sadly, we are not there yet.
+ SUBDIRS = . tests
+
+-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.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/link-with-lcrypto.patch b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/link-with-lcrypto.patch
new file mode 100644
index 000000000..57e10b029
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/link-with-lcrypto.patch
@@ -0,0 +1,25 @@
+Author: Andrei Gherzan <andrei@gherzan.ro>
+Date: Thu Feb 2 23:59:11 2012 +0200
+
+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.
+
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+Upstream-Status: Pending
+
+Index: dhcp-4.2.3-P2-r0/dhcp-4.2.3-P2/configure.ac
+===================================================================
+--- dhcp-4.2.3-P2.orig/configure.ac 2012-02-02 18:04:20.843023196 +0200
++++ dhcp-4.2.3-P2/configure.ac 2012-02-02 17:58:16.000000000 +0200
+@@ -456,6 +456,10 @@
+ # 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])
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/replace-ifconfig-route.patch b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/replace-ifconfig-route.patch
new file mode 100644
index 000000000..61dd6a718
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/replace-ifconfig-route.patch
@@ -0,0 +1,176 @@
+Found this patch here:
+https://lists.isc.org/pipermail/dhcp-users/2011-January/012910.html
+
+and made some adjustments/updates to make it work with this version.
+Wasn't able to find that why this patch was not accepted by ISC DHCP developers.
+
+Upstream-Status: Pending
+
+Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com>
+
+--- dhcp-4.2.5-P1/client/scripts/linux.orig 2013-09-04 12:22:55.000000000 +0500
++++ dhcp-4.2.5-P1/client/scripts/linux 2013-09-04 12:52:19.068761518 +0500
+@@ -103,17 +103,11 @@
+ if [ x$old_broadcast_address != x ]; then
+ old_broadcast_arg="broadcast $old_broadcast_address"
+ fi
+-if [ x$new_subnet_mask != x ]; then
+- new_subnet_arg="netmask $new_subnet_mask"
+-fi
+-if [ x$old_subnet_mask != x ]; then
+- old_subnet_arg="netmask $old_subnet_mask"
+-fi
+-if [ x$alias_subnet_mask != x ]; then
+- alias_subnet_arg="netmask $alias_subnet_mask"
++if [ -n "$new_subnet_mask" ]; then
++ new_mask="/$new_subnet_mask"
+ fi
+-if [ x$new_interface_mtu != x ]; then
+- mtu_arg="mtu $new_interface_mtu"
++if [ -n "$alias_subnet_mask" ]; then
++ alias_mask="/$alias_subnet_mask"
+ fi
+ if [ x$IF_METRIC != x ]; then
+ metric_arg="metric $IF_METRIC"
+@@ -127,9 +121,9 @@
+ if [ x$reason = xPREINIT ]; then
+ if [ x$alias_ip_address != x ]; then
+ # Bring down alias interface. Its routes will disappear too.
+- ifconfig $interface:0- inet 0
++ ${ip} -4 addr flush dev ${interface} label ${interface}:0
+ fi
+- ifconfig $interface 0 up
++ ${ip} link set dev ${interface} up
+
+ # We need to give the kernel some time to get the interface up.
+ sleep 1
+@@ -156,25 +150,30 @@
+ if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \
+ [ x$alias_ip_address != x$old_ip_address ]; then
+ # Possible new alias. Remove old alias.
+- ifconfig $interface:0- inet 0
++ ${ip} -4 addr flush dev ${interface} label ${interface}:0
+ fi
+ if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]; then
+ # IP address changed. Bringing down the interface will delete all routes,
+ # and clear the ARP cache.
+- ifconfig $interface inet 0 down
++ ${ip} -4 addr flush dev ${interface} label ${interface}
+
+ fi
+ if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
+ [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
+
+- ifconfig $interface inet $new_ip_address $new_subnet_arg \
+- $new_broadcast_arg $mtu_arg
++ ${ip} -4 addr add ${new_ip_address}${new_mask} ${new_broadcast_arg} \
++ dev ${interface} label ${interface}
++ if [ -n "$new_interface_mtu" ]; then
++ # set MTU
++ ${ip} link set dev ${interface} mtu ${new_interface_mtu}
++ fi
+ # Add a network route to the computed network address.
+ for router in $new_routers; do
+ if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
+- route add -host $router dev $interface
++ ${ip} -4 route add ${router} dev $interface >/dev/null 2>&1
+ fi
+- route add default gw $router $metric_arg dev $interface
++ ${ip} -4 route add default via ${router} dev ${interface} \
++ ${metric_arg} >/dev/null 2>&1
+ done
+ else
+ # we haven't changed the address, have we changed other options
+@@ -182,21 +181,23 @@
+ if [ x$new_routers != x ] && [ x$new_routers != x$old_routers ] ; then
+ # if we've changed routers delete the old and add the new.
+ for router in $old_routers; do
+- route del default gw $router
++ ${ip} -4 route delete default via ${router}
+ done
+ for router in $new_routers; do
+ if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
+- route add -host $router dev $interface
+- fi
+- route add default gw $router $metric_arg dev $interface
++ ${ip} -4 route add ${router} dev $interface >/dev/null 2>&1
++ fi
++ ${ip} -4 route add default via ${router} dev ${interface} \
++ ${metric_arg} >/dev/null 2>&1
+ done
+ fi
+ fi
+ if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ];
+ then
+- ifconfig $interface:0- inet 0
+- ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
+- route add -host $alias_ip_address $interface:0
++ ${ip} -4 addr flush dev ${interface} label ${interface}:0
++ ${ip} -4 addr add ${alias_ip_address}${alias_mask} \
++ dev ${interface} label ${interface}:0
++ ${ip} -4 route add ${alias_ip_address} dev ${interface} >/dev/null 2>&1
+ fi
+ make_resolv_conf
+ exit_with_hooks 0
+@@ -206,42 +207,49 @@
+ || [ x$reason = xSTOP ]; then
+ if [ x$alias_ip_address != x ]; then
+ # Turn off alias interface.
+- ifconfig $interface:0- inet 0
++ ${ip} -4 addr flush dev ${interface} label ${interface}:0
+ fi
+ if [ x$old_ip_address != x ]; then
+ # Shut down interface, which will delete routes and clear arp cache.
+- ifconfig $interface inet 0 down
++ ${ip} -4 addr flush dev ${interface} label ${interface}
+ fi
+ if [ x$alias_ip_address != x ]; then
+- ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
+- route add -host $alias_ip_address $interface:0
++ ${ip} -4 addr add ${alias_ip_address}${alias_network_arg} \
++ dev ${interface} label ${interface}:0
++ ${ip} -4 route add ${alias_ip_address} dev ${interface} >/dev/null 2>&1
+ fi
+ exit_with_hooks 0
+ fi
+
+ if [ x$reason = xTIMEOUT ]; then
+ if [ x$alias_ip_address != x ]; then
+- ifconfig $interface:0- inet 0
++ ${ip} -4 addr flush dev ${interface} label ${interface}:0
++ fi
++ ${ip} -4 addr add ${new_ip_address}${new_mask} ${new_broadcast_arg} \
++ dev ${interface} label ${interface}
++ if [ -n "$new_interface_mtu" ]; then
++ # set MTU
++ ip link set dev ${interface} mtu ${new_interface_mtu}
+ fi
+- ifconfig $interface inet $new_ip_address $new_subnet_arg \
+- $new_broadcast_arg $mtu_arg
+ set $new_routers
+ if ping -q -c 1 $1; then
+ if [ x$new_ip_address != x$alias_ip_address ] && \
+ [ x$alias_ip_address != x ]; then
+- ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
+- route add -host $alias_ip_address dev $interface:0
++ ${ip} -4 addr add ${alias_ip_address}${alias_mask} \
++ dev ${interface} label ${interface}:0
++ ${ip} -4 route add ${alias_ip_address} dev ${interface} >/dev/null 2>&1
+ fi
+ for router in $new_routers; do
+ if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
+- route add -host $router dev $interface
++ ${ip} -4 route add ${router} dev $interface >/dev/null 2>&1
+ fi
+- route add default gw $router $metric_arg dev $interface
++ ${ip} -4 route add default via ${router} dev ${interface} \
++ ${metric_arg} >/dev/null 2>&1
+ done
+ make_resolv_conf
+ exit_with_hooks 0
+ fi
+- ifconfig $interface inet 0 down
++ ${ip} -4 addr flush dev ${interface}
+ exit_with_hooks 1
+ fi
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/search-for-libxml2.patch b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/search-for-libxml2.patch
new file mode 100644
index 000000000..a08a5b725
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp/search-for-libxml2.patch
@@ -0,0 +1,23 @@
+libdns requires libxml2 if bind was built with libxml2 support
+enabled. Compilation will fail for omapip/test.c in case
+lxml2 isn't used during the build. So, we add losely coupled
+search path which will pick up the lib if it is present.
+
+Signed-off-by: Awais Belal <awais_belal@mentor.com>
+Upstream-Status: Pending
+
+diff --git a/configure.ac b/configure.ac
+index c9dc8b5..85f59be 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -602,6 +602,10 @@ no)
+ esac
+ AC_SUBST([libbind])
+
++# We need to find libxml2 if bind was built with support enabled
++# otherwise we'll fail to build omapip/test.c
++AC_SEARCH_LIBS(xmlTextWriterStartElement, [xml2],)
++
+ # OpenLDAP support.
+ AC_ARG_WITH(ldap,
+ AS_HELP_STRING([--with-ldap],[enable OpenLDAP support in dhcpd (default is no)]),
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp_4.3.3.bb b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp_4.3.3.bb
new file mode 100644
index 000000000..4e8cd272b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/dhcp_4.3.3.bb
@@ -0,0 +1,15 @@
+require dhcp.inc
+
+SRC_URI += "file://dhcp-3.0.3-dhclient-dbus.patch;striplevel=0 \
+ file://fix-external-bind.patch \
+ file://link-with-lcrypto.patch \
+ file://fixsepbuild.patch \
+ file://dhclient-script-drop-resolv.conf.dhclient.patch \
+ file://replace-ifconfig-route.patch \
+ file://CVE-2015-8605.patch \
+ file://0001-site.h-enable-gentle-shutdown.patch \
+ file://CVE-2016-2774.patch \
+ "
+
+SRC_URI[md5sum] = "c5577b09c9017cdd319a11ff6364268e"
+SRC_URI[sha256sum] = "553c4945b09b1c1b904c4780f34f72aaefa2fc8c6556715de0bc9d4e3d255ede"
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/files/default-relay b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/files/default-relay
new file mode 100644
index 000000000..7961f014b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/files/default-server b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/files/default-server
new file mode 100644
index 000000000..0385d1699
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/files/dhclient.conf b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/files/dhclient.conf
new file mode 100644
index 000000000..0e6dcf96c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/files/dhcpd.conf b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/files/dhcpd.conf
new file mode 100644
index 000000000..0001c0f00
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/files/dhcpd.service b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/files/dhcpd.service
new file mode 100644
index 000000000..ae4f93eca
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/files/dhcpd6.service b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/files/dhcpd6.service
new file mode 100644
index 000000000..ca96abb83
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/files/dhcrelay.service b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/files/dhcrelay.service
new file mode 100644
index 000000000..a2d818917
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/files/dhcrelay.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=DHCP Relay Agent Daemon
+After=network.target
+
+[Service]
+ExecStart=@SBINDIR@/dhcrelay -d --no-pid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/files/init-relay b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/files/init-relay
new file mode 100644
index 000000000..019a7e84c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/files/init-server b/import-layers/yocto-poky/meta/recipes-connectivity/dhcp/files/init-server
new file mode 100644
index 000000000..5e693adf7
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2.inc b/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2.inc
new file mode 100644
index 000000000..86e931063
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2.inc
@@ -0,0 +1,48 @@
+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
+
+EXTRA_OEMAKE = "CC='${CC}' KERNEL_INCLUDE=${STAGING_INCDIR} DOCDIR=${docdir}/iproute2 SUBDIRS='lib tc ip bridge misc genl' SBINDIR='${base_sbindir}' LIBDIR='${libdir}'"
+
+do_configure_append () {
+ sh configure ${STAGING_INCDIR}
+ # Explicitly disable ATM support
+ sed -i -e '/TC_CONFIG_ATM/d' Config
+}
+
+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"
+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"
+
+ALTERNATIVE_${PN} = "ip"
+ALTERNATIVE_TARGET[ip] = "${base_sbindir}/ip.${BPN}"
+ALTERNATIVE_LINK_NAME[ip] = "${base_sbindir}/ip"
+ALTERNATIVE_PRIORITY = "100"
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2/0001-iproute2-de-bash-scripts.patch b/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2/0001-iproute2-de-bash-scripts.patch
new file mode 100644
index 000000000..39c7d4031
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2/0001-iproute2-de-bash-scripts.patch
@@ -0,0 +1,64 @@
+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 083d9df..60bcf1f 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 "[\\\\]" "[
+ ]"
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2/configure-cross.patch b/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2/configure-cross.patch
new file mode 100644
index 000000000..866609ca9
--- /dev/null
+++ b/import-layers/yocto-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-3.7.0/configure
+===================================================================
+--- iproute2-3.7.0.orig/configure
++++ iproute2-3.7.0/configure
+@@ -2,6 +2,7 @@
+ # This is not an autconf generated configure
+ #
+ INCLUDE=${1:-"$PWD/include"}
++SYSROOT=$1
+
+ # Make a temp directory in build tree.
+ TMPDIR=$(mktemp -d config.XXXXXX)
+@@ -158,7 +159,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/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2/iproute2-4.3.0-musl.patch b/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2/iproute2-4.3.0-musl.patch
new file mode 100644
index 000000000..1b415a511
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2/iproute2-4.3.0-musl.patch
@@ -0,0 +1,97 @@
+From 48596709d8ab59727b79a5c6db33ebb251c36543 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Thu, 19 Nov 2015 17:44:25 +0100
+Subject: [PATCH] Avoid in6_addr redefinition
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Due to both <netinet/in.h> and <linux/in6.h> being included, the
+in6_addr is being redefined: once from the C library headers and once
+from the kernel headers. This causes some build failures with for
+example the musl C library:
+
+In file included from ../include/linux/xfrm.h:4:0,
+ from xfrm.h:29,
+ from ipxfrm.c:39:
+../include/linux/in6.h:32:8: error: redefinition of â€struct in6_addr’
+ struct in6_addr {
+ ^
+In file included from .../output/host/usr/x86_64-buildroot-linux-musl/sysroot/usr/include/netdb.h:9:0,
+ from ipxfrm.c:34:
+.../output/host/usr/x86_64-buildroot-linux-musl/sysroot/usr/include/netinet/in.h:24:8: note: originally defined here
+ struct in6_addr
+ ^
+
+In order to fix this, use just the C library header <netinet/in.h>.
+
+Original patch taken from
+http://git.alpinelinux.org/cgit/aports/tree/main/iproute2/musl-fixes.patch.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+Upstream-Status: Pending
+
+ include/libiptc/ipt_kernel_headers.h | 2 --
+ include/linux/if_bridge.h | 1 -
+ include/linux/netfilter.h | 2 --
+ include/linux/xfrm.h | 1 -
+ 4 files changed, 6 deletions(-)
+
+diff --git a/include/libiptc/ipt_kernel_headers.h b/include/libiptc/ipt_kernel_headers.h
+index 7e87828..9566be5 100644
+--- a/include/libiptc/ipt_kernel_headers.h
++++ b/include/libiptc/ipt_kernel_headers.h
+@@ -15,12 +15,10 @@
+ #else /* libc5 */
+ #include <sys/socket.h>
+ #include <linux/ip.h>
+-#include <linux/in.h>
+ #include <linux/if.h>
+ #include <linux/icmp.h>
+ #include <linux/tcp.h>
+ #include <linux/udp.h>
+ #include <linux/types.h>
+-#include <linux/in6.h>
+ #endif
+ #endif
+diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
+index ee197a3..f823aa4 100644
+--- a/include/linux/if_bridge.h
++++ b/include/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/netfilter.h b/include/linux/netfilter.h
+index b71b4c9..3e4e6ae 100644
+--- a/include/linux/netfilter.h
++++ b/include/linux/netfilter.h
+@@ -4,8 +4,6 @@
+ #include <linux/types.h>
+
+ #include <linux/sysctl.h>
+-#include <linux/in.h>
+-#include <linux/in6.h>
+
+ /* Responses from hook functions. */
+ #define NF_DROP 0
+diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
+index b8f5451..a9761a5 100644
+--- a/include/linux/xfrm.h
++++ b/include/linux/xfrm.h
+@@ -1,7 +1,6 @@
+ #ifndef _LINUX_XFRM_H
+ #define _LINUX_XFRM_H
+
+-#include <linux/in6.h>
+ #include <linux/types.h>
+
+ /* All of the structures in this file may not change size as they are
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2/iproute2-fix-building-with-musl.patch b/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2/iproute2-fix-building-with-musl.patch
new file mode 100644
index 000000000..c83a243b7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2/iproute2-fix-building-with-musl.patch
@@ -0,0 +1,24 @@
+iproute2: fix building with musl
+
+We need limits.h for PATH_MAX, fixes:
+
+rt_names.c:364:13: error: â€PATH_MAX’ undeclared (first use in this
+function)
+
+Upstream-Status: Backport
+
+Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+diff --git a/lib/rt_names.c b/lib/rt_names.c
+index f6d17c0..b665d3e 100644
+--- a/lib/rt_names.c
++++ b/lib/rt_names.c
+@@ -18,6 +18,7 @@
+ #include <sys/time.h>
+ #include <sys/socket.h>
+ #include <dirent.h>
++#include <limits.h>
+
+ #include <asm/types.h>
+ #include <linux/rtnetlink.h>
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2_4.4.0.bb b/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2_4.4.0.bb
new file mode 100644
index 000000000..7979e8beb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/iproute2/iproute2_4.4.0.bb
@@ -0,0 +1,14 @@
+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://iproute2-4.3.0-musl.patch \
+ file://iproute2-fix-building-with-musl.patch \
+ "
+SRC_URI[md5sum] = "d762653ec3e1ab0d4a9689e169ca184f"
+SRC_URI[sha256sum] = "bc91c367288a19f78ef800cd6840363be1f22da8436fbae88e1a7250490d6514"
+
+# CFLAGS are computed in Makefile and reference CCOPTS
+#
+EXTRA_OEMAKE_append = " CCOPTS='${CFLAGS}'"
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/init b/import-layers/yocto-poky/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/init
new file mode 100755
index 000000000..6f29e9c6e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/ldflags.patch b/import-layers/yocto-poky/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/ldflags.patch
new file mode 100644
index 000000000..e95fe35f8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/ldflags.patch
@@ -0,0 +1,75 @@
+Obey LDFLAGS
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+Upstream-Status: Pending
+
+--- 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`
+
+--- 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)
+--- 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:
+--- 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:
+--- 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
+--- 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/import-layers/yocto-poky/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/musl.patch b/import-layers/yocto-poky/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/musl.patch
new file mode 100644
index 000000000..97eb97502
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/irda-utils/irda-utils_0.9.18.bb b/import-layers/yocto-poky/meta/recipes-connectivity/irda-utils/irda-utils_0.9.18.bb
new file mode 100644
index 000000000..11b2ee911
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/iw/iw/0001-iw-version.sh-don-t-use-git-describe-for-versioning.patch b/import-layers/yocto-poky/meta/recipes-connectivity/iw/iw/0001-iw-version.sh-don-t-use-git-describe-for-versioning.patch
new file mode 100644
index 000000000..2e52c80c0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/iw/iw/0001-iw-version.sh-don-t-use-git-describe-for-versioning.patch
@@ -0,0 +1,35 @@
+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.3-origin/version.sh iw-4.3/version.sh
+--- iw-4.3-origin/version.sh 2015-11-20 16:37:58.762077162 +0200
++++ iw-4.3/version.sh 2015-11-20 16:52:05.526491150 +0200
+@@ -3,21 +3,7 @@
+ VERSION="4.3"
+ OUT="$1"
+
+-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*)
+-
+- # on git builds check that the version number above
+- # is correct...
+- [ "${descr%%-*}" = "v$VERSION" ] || exit 2
+-
+- v="${descr#v}"
+- if git diff-index --name-only HEAD | read dummy ; then
+- v="$v"-dirty
+- fi
+-else
+- v="$VERSION"
+-fi
++v="$VERSION"
+
+ echo '#include "iw.h"' > "$OUT"
+ echo "const char iw_version[] = \"$v\";" >> "$OUT"
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/iw/iw/separate-objdir.patch b/import-layers/yocto-poky/meta/recipes-connectivity/iw/iw/separate-objdir.patch
new file mode 100644
index 000000000..0ea6a5278
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/iw/iw_4.3.bb b/import-layers/yocto-poky/meta/recipes-connectivity/iw/iw_4.3.bb
new file mode 100644
index 000000000..6865e7ad6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/iw/iw_4.3.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] = "5ca622a270687d6862c9024fab266871"
+SRC_URI[sha256sum] = "2a853d95ffbd2b06c058b40ef4e6fa76a52c2709b05fb1976761fe13e9d9e39f"
+
+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/import-layers/yocto-poky/meta/recipes-connectivity/libnss-mdns/libnss-mdns/0001-check-for-nss.h.patch b/import-layers/yocto-poky/meta/recipes-connectivity/libnss-mdns/libnss-mdns/0001-check-for-nss.h.patch
new file mode 100644
index 000000000..f63eb90cd
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/libnss-mdns/libnss-mdns_0.10.bb b/import-layers/yocto-poky/meta/recipes-connectivity/libnss-mdns/libnss-mdns_0.10.bb
new file mode 100644
index 000000000..8d2feec76
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap.inc b/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap.inc
new file mode 100644
index 000000000..b7601b05c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap.inc
@@ -0,0 +1,40 @@
+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"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)}"
+PACKAGECONFIG[bluez4] = "--enable-bluetooth,--disable-bluetooth,bluez4"
+# Add a dummy PACKAGECONFIG for bluez5 since it is not supported by libpcap.
+PACKAGECONFIG[bluez5] = ",,"
+PACKAGECONFIG[canusb] = "--enable-canusb,--enable-canusb=no,libusb"
+PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus"
+PACKAGECONFIG[libnl] = "--with-libnl,--without-libnl,libnl"
+
+CPPFLAGS_prepend = "-I${S} "
+CFLAGS_prepend = "-I${S} "
+CXXFLAGS_prepend = "-I${S} "
+
+do_configure_prepend () {
+ if [ ! -e ${S}/acinclude.m4 ]; then
+ cat ${S}/aclocal.m4 > ${S}/acinclude.m4
+ fi
+ sed -i -e's,^V_RPATH_OPT=.*$,V_RPATH_OPT=,' ${S}/pcap-config.in
+}
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap/aclocal.patch b/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap/aclocal.patch
new file mode 100644
index 000000000..21519825c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap/aclocal.patch
@@ -0,0 +1,167 @@
+Upstream-Status: Inappropriate [configuration]
+
+diff -ruN libpcap-1.1.1-orig/aclocal.m4 libpcap-1.1.1/aclocal.m4
+--- libpcap-1.1.1-orig/aclocal.m4 2010-06-29 10:46:32.815117569 +0800
++++ libpcap-1.1.1/aclocal.m4 2010-06-29 10:49:17.150149949 +0800
+@@ -37,7 +37,7 @@
+ dnl AC_LBL_C_INIT. Now, we run AC_LBL_C_INIT_BEFORE_CC, AC_PROG_CC,
+ dnl and AC_LBL_C_INIT at the top level.
+ dnl
+-AC_DEFUN(AC_LBL_C_INIT_BEFORE_CC,
++AC_DEFUN([AC_LBL_C_INIT_BEFORE_CC],
+ [
+ AC_BEFORE([$0], [AC_LBL_C_INIT])
+ AC_BEFORE([$0], [AC_PROG_CC])
+@@ -90,7 +90,7 @@
+ dnl LDFLAGS
+ dnl LBL_CFLAGS
+ dnl
+-AC_DEFUN(AC_LBL_C_INIT,
++AC_DEFUN([AC_LBL_C_INIT],
+ [
+ AC_BEFORE([$0], [AC_LBL_FIXINCLUDES])
+ AC_BEFORE([$0], [AC_LBL_DEVEL])
+@@ -217,7 +217,7 @@
+ dnl V_SONAME_OPT
+ dnl V_RPATH_OPT
+ dnl
+-AC_DEFUN(AC_LBL_SHLIBS_INIT,
++AC_DEFUN([AC_LBL_SHLIBS_INIT],
+ [AC_PREREQ(2.50)
+ if test "$GCC" = yes ; then
+ #
+@@ -361,7 +361,7 @@
+ # Make sure we use the V_CCOPT flags, because some of those might
+ # disable inlining.
+ #
+-AC_DEFUN(AC_LBL_C_INLINE,
++AC_DEFUN([AC_LBL_C_INLINE],
+ [AC_MSG_CHECKING(for inline)
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$V_CCOPT"
+@@ -407,7 +407,7 @@
+ dnl
+ dnl AC_LBL_FIXINCLUDES
+ dnl
+-AC_DEFUN(AC_LBL_FIXINCLUDES,
++AC_DEFUN([AC_LBL_FIXINCLUDES],
+ [if test "$GCC" = yes ; then
+ AC_MSG_CHECKING(for ANSI ioctl definitions)
+ AC_CACHE_VAL(ac_cv_lbl_gcc_fixincludes,
+@@ -453,7 +453,7 @@
+ dnl $2 (yacc appended)
+ dnl $3 (optional flex and bison -P prefix)
+ dnl
+-AC_DEFUN(AC_LBL_LEX_AND_YACC,
++AC_DEFUN([AC_LBL_LEX_AND_YACC],
+ [AC_ARG_WITH(flex, [ --without-flex don't use flex])
+ AC_ARG_WITH(bison, [ --without-bison don't use bison])
+ if test "$with_flex" = no ; then
+@@ -506,7 +506,7 @@
+ dnl
+ dnl DECLWAITSTATUS (defined)
+ dnl
+-AC_DEFUN(AC_LBL_UNION_WAIT,
++AC_DEFUN([AC_LBL_UNION_WAIT],
+ [AC_MSG_CHECKING(if union wait is used)
+ AC_CACHE_VAL(ac_cv_lbl_union_wait,
+ AC_TRY_COMPILE([
+@@ -535,7 +535,7 @@
+ dnl
+ dnl HAVE_SOCKADDR_SA_LEN (defined)
+ dnl
+-AC_DEFUN(AC_LBL_SOCKADDR_SA_LEN,
++AC_DEFUN([AC_LBL_SOCKADDR_SA_LEN],
+ [AC_MSG_CHECKING(if sockaddr struct has the sa_len member)
+ AC_CACHE_VAL(ac_cv_lbl_sockaddr_has_sa_len,
+ AC_TRY_COMPILE([
+@@ -560,7 +560,7 @@
+ dnl
+ dnl HAVE_SOCKADDR_STORAGE (defined)
+ dnl
+-AC_DEFUN(AC_LBL_SOCKADDR_STORAGE,
++AC_DEFUN([AC_LBL_SOCKADDR_STORAGE],
+ [AC_MSG_CHECKING(if sockaddr_storage struct exists)
+ AC_CACHE_VAL(ac_cv_lbl_has_sockaddr_storage,
+ AC_TRY_COMPILE([
+@@ -593,7 +593,7 @@
+ dnl won't be using code that would use that member, or we wouldn't
+ dnl compile in any case).
+ dnl
+-AC_DEFUN(AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1,
++AC_DEFUN([AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1],
+ [AC_MSG_CHECKING(if dl_hp_ppa_info_t struct has dl_module_id_1 member)
+ AC_CACHE_VAL(ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1,
+ AC_TRY_COMPILE([
+@@ -619,7 +619,7 @@
+ dnl
+ dnl ac_cv_lbl_have_run_path (yes or no)
+ dnl
+-AC_DEFUN(AC_LBL_HAVE_RUN_PATH,
++AC_DEFUN([AC_LBL_HAVE_RUN_PATH],
+ [AC_MSG_CHECKING(for ${CC-cc} -R)
+ AC_CACHE_VAL(ac_cv_lbl_have_run_path,
+ [echo 'main(){}' > conftest.c
+@@ -644,7 +644,7 @@
+ dnl
+ dnl LBL_ALIGN (DEFINED)
+ dnl
+-AC_DEFUN(AC_LBL_UNALIGNED_ACCESS,
++AC_DEFUN([AC_LBL_UNALIGNED_ACCESS],
+ [AC_MSG_CHECKING(if unaligned accesses fail)
+ AC_CACHE_VAL(ac_cv_lbl_unaligned_fail,
+ [case "$host_cpu" in
+@@ -749,7 +749,7 @@
+ dnl HAVE_OS_PROTO_H (defined)
+ dnl os-proto.h (symlinked)
+ dnl
+-AC_DEFUN(AC_LBL_DEVEL,
++AC_DEFUN([AC_LBL_DEVEL],
+ [rm -f os-proto.h
+ if test "${LBL_CFLAGS+set}" = set; then
+ $1="$$1 ${LBL_CFLAGS}"
+@@ -886,7 +886,7 @@
+ dnl statically and happen to have a libresolv.a lying around (and no
+ dnl libnsl.a).
+ dnl
+-AC_DEFUN(AC_LBL_LIBRARY_NET, [
++AC_DEFUN([AC_LBL_LIBRARY_NET], [
+ # Most operating systems have gethostbyname() in the default searched
+ # libraries (i.e. libc):
+ # Some OSes (eg. Solaris) place it in libnsl
+@@ -909,7 +909,7 @@
+ dnl Test for __attribute__
+ dnl
+
+-AC_DEFUN(AC_C___ATTRIBUTE__, [
++AC_DEFUN([AC_C___ATTRIBUTE__], [
+ AC_MSG_CHECKING(for __attribute__)
+ AC_CACHE_VAL(ac_cv___attribute__, [
+ AC_COMPILE_IFELSE(
+@@ -947,7 +947,7 @@
+ dnl
+ dnl -Scott Barron
+ dnl
+-AC_DEFUN(AC_LBL_TPACKET_STATS,
++AC_DEFUN([AC_LBL_TPACKET_STATS],
+ [AC_MSG_CHECKING(if if_packet.h has tpacket_stats defined)
+ AC_CACHE_VAL(ac_cv_lbl_tpacket_stats,
+ AC_TRY_COMPILE([
+@@ -976,7 +976,7 @@
+ dnl doesn't have that member (which is OK, as either we won't be using
+ dnl code that would use that member, or we wouldn't compile in any case).
+ dnl
+-AC_DEFUN(AC_LBL_LINUX_TPACKET_AUXDATA_TP_VLAN_TCI,
++AC_DEFUN([AC_LBL_LINUX_TPACKET_AUXDATA_TP_VLAN_TCI],
+ [AC_MSG_CHECKING(if tpacket_auxdata struct has tp_vlan_tci member)
+ AC_CACHE_VAL(ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1,
+ AC_TRY_COMPILE([
+@@ -1003,7 +1003,7 @@
+ dnl
+ dnl HAVE_DLPI_PASSIVE (defined)
+ dnl
+-AC_DEFUN(AC_LBL_DL_PASSIVE_REQ_T,
++AC_DEFUN([AC_LBL_DL_PASSIVE_REQ_T],
+ [AC_MSG_CHECKING(if dl_passive_req_t struct exists)
+ AC_CACHE_VAL(ac_cv_lbl_has_dl_passive_req_t,
+ AC_TRY_COMPILE([
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap/libpcap-pkgconfig-support.patch b/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap/libpcap-pkgconfig-support.patch
new file mode 100644
index 000000000..b8615135b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap/libpcap-pkgconfig-support.patch
@@ -0,0 +1,71 @@
+From 8887132e85892a72a84ca3878e60f254ad2ce939 Mon Sep 17 00:00:00 2001
+From: Joe MacDonald <joe_macdonald@mentor.com>
+Date: Tue, 24 Feb 2015 15:56:06 -0500
+Subject: [PATCH] libpcap: pkgconfig support
+
+Adding basic structure to support pkg-config.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
+---
+ Makefile.in | 5 +++++
+ configure.in | 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 1c2d745..1f25faf 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -60,6 +60,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)
+
+@@ -275,6 +279,7 @@ EXTRA_DIST = \
+ lbl/os-solaris2.h \
+ lbl/os-sunos4.h \
+ lbl/os-ultrix4.h \
++ libpcap.pc \
+ missing/snprintf.c \
+ mkdep \
+ msdos/bin2c.c \
+diff --git a/configure.in b/configure.in
+index 8f5c86b..fb51b35 100644
+--- a/configure.in
++++ b/configure.in
+@@ -1700,6 +1700,7 @@ esac
+ 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}
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap_1.7.4.bb b/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap_1.7.4.bb
new file mode 100644
index 000000000..8d12b2521
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/libpcap/libpcap_1.7.4.bb
@@ -0,0 +1,26 @@
+require libpcap.inc
+
+SRC_URI += "file://aclocal.patch \
+ file://libpcap-pkgconfig-support.patch \
+ "
+SRC_URI[md5sum] = "b2e13142bbaba857ab1c6894aedaf547"
+SRC_URI[sha256sum] = "7ad3112187e88328b85e46dce7a9b949632af18ee74d97ffc3f2b41fe7f448b0"
+
+#
+# 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.in
+}
+
+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/import-layers/yocto-poky/meta/recipes-connectivity/mobile-broadband-provider-info/mobile-broadband-provider-info_git.bb b/import-layers/yocto-poky/meta/recipes-connectivity/mobile-broadband-provider-info/mobile-broadband-provider-info_git.bb
new file mode 100644
index 000000000..bd488eb08
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/mobile-broadband-provider-info/mobile-broadband-provider-info_git.bb
@@ -0,0 +1,12 @@
+SUMMARY = "Mobile Broadband Service Provider Database"
+SECTION = "network"
+LICENSE = "PD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=87964579b2a8ece4bc6744d2dc9a8b04"
+SRCREV = "519465766fabc85b9fdea5f2b5ee3d08c2b1f70d"
+PV = "20151214"
+PE = "1"
+
+SRC_URI = "git://git.gnome.org/mobile-broadband-provider-info"
+S = "${WORKDIR}/git"
+
+inherit autotools
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/neard/neard/Makefile.am-do-not-ship-version.h.patch b/import-layers/yocto-poky/meta/recipes-connectivity/neard/neard/Makefile.am-do-not-ship-version.h.patch
new file mode 100644
index 000000000..16875e054
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/neard/neard/Makefile.am-fix-parallel-issue.patch b/import-layers/yocto-poky/meta/recipes-connectivity/neard/neard/Makefile.am-fix-parallel-issue.patch
new file mode 100644
index 000000000..466067693
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/neard/neard/Makefile.am-fix-parallel-issue.patch
@@ -0,0 +1,33 @@
+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(+)
+
+diff --git a/Makefile.am b/Makefile.am
+index 3241311..a43eaa2 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -164,6 +164,7 @@ MAINTAINERCLEANFILES = Makefile.in \
+ 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) > $@
+
+ $(src_neard_OBJECTS) \
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/neard/neard/neard.in b/import-layers/yocto-poky/meta/recipes-connectivity/neard/neard/neard.in
new file mode 100644
index 000000000..a47d4d96c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/neard/neard_0.15.bb b/import-layers/yocto-poky/meta/recipes-connectivity/neard/neard_0.15.bb
new file mode 100644
index 000000000..93bddb34c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/neard/neard_0.15.bb
@@ -0,0 +1,60 @@
+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 \
+ "
+SRC_URI[md5sum] = "b746ce62eeef88e8de90765e00a75a1c"
+SRC_URI[sha256sum] = "651f6513d32cdaf8a426255d03aff38a6620a89b0567ec2b36606c6330a93353"
+
+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.contains('DISTRO_FEATURES', 'systemd', '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
+
+ # Install the tests for neard-tests
+ install -d ${D}${libdir}/neard
+ install -m 0755 ${S}/test/* ${D}${libdir}/${BPN}/
+ install -m 0755 ${B}/tools/nfctool/nfctool ${D}${libdir}/${BPN}/
+}
+
+PACKAGES =+ "${PN}-tests"
+
+FILES_${PN}-tests = "${libdir}/${BPN}/*-test"
+
+RDEPENDS_${PN} = "dbus python python-dbus python-pygobject"
+
+# 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)} \
+ "
+
+RDEPENDS_${PN}-tests = "python python-dbus python-pygobject"
+
+INITSCRIPT_NAME = "neard"
+INITSCRIPT_PARAMS = "defaults 64"
+
+SYSTEMD_SERVICE_${PN} = "neard.service"
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/files/bugfix-adjust-statd-service-name.patch b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/files/bugfix-adjust-statd-service-name.patch
new file mode 100644
index 000000000..14bd4036a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/files/bugfix-adjust-statd-service-name.patch
@@ -0,0 +1,34 @@
+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(-)
+
+diff --git a/utils/statd/start-statd b/utils/statd/start-statd
+index 8211a90..3c2aa6f 100755
+--- a/utils/statd/start-statd
++++ b/utils/statd/start-statd
+@@ -16,7 +16,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
+
+ # Fall back to launching it ourselves.
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/files/nfs-utils-debianize-start-statd.patch b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/files/nfs-utils-debianize-start-statd.patch
new file mode 100644
index 000000000..85002290f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/files/nfs-utils-debianize-start-statd.patch
@@ -0,0 +1,41 @@
+[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 | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/utils/statd/start-statd b/utils/statd/start-statd
+index ec9383b..3969b8c 100755
+--- a/utils/statd/start-statd
++++ b/utils/statd/start-statd
+@@ -6,6 +6,13 @@
+ # site.
+ PATH="/sbin:/usr/sbin:/bin:/usr/bin"
+
++# Read config
++DEFAULTFILE=/etc/default/nfs-common
++NEED_IDMAPD=
++if [ -f $DEFAULTFILE ]; then
++ . $DEFAULTFILE
++fi
++
+ # First try systemd if it's installed.
+ if systemctl --help >/dev/null 2>&1; then
+ # Quit only if the call worked.
+@@ -13,4 +20,4 @@ if systemctl --help >/dev/null 2>&1; then
+ fi
+
+ # Fall back to launching it ourselves.
+-exec rpc.statd --no-notify
++exec rpc.statd --no-notify $STATDOPTS
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/libnfsidmap/0001-include-sys-types.h-for-getting-u_-typedefs.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/libnfsidmap/Set_nobody_user_group.patch b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/libnfsidmap/Set_nobody_user_group.patch
new file mode 100644
index 000000000..4633da919
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/libnfsidmap/fix-ac-prereq.patch b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/libnfsidmap/fix-ac-prereq.patch
new file mode 100644
index 000000000..d81c7c5f3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/libnfsidmap_0.25.bb b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/libnfsidmap_0.25.bb
new file mode 100644
index 000000000..256577100
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-configure-Allow-to-explicitly-disable-nfsidmap.patch b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-configure-Allow-to-explicitly-disable-nfsidmap.patch
new file mode 100644
index 000000000..7025fb555
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-configure-Allow-to-explicitly-disable-nfsidmap.patch
@@ -0,0 +1,43 @@
+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(-)
+
+diff --git a/configure.ac b/configure.ac
+index bf433d6..28a8f62 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -69,6 +69,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([--enable-nfsv41],
+ [enable support for NFSv41 @<:@default=yes@:>@])],
+@@ -296,7 +302,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
+--
+1.8.4.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-nfs-utils-statd-fix-a-segfault-caused-by-improper-us.patch b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-nfs-utils-statd-fix-a-segfault-caused-by-improper-us.patch
new file mode 100644
index 000000000..de0b045c8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-nfs-utils-statd-fix-a-segfault-caused-by-improper-us.patch
@@ -0,0 +1,113 @@
+Upstream-Status: Pending
+
+Subject: nfs-utils/statd: fix a segfault caused by improper usage of RPC interface
+
+There is a hack which uses the bottom-level RPC improperly as below
+in the current statd implementation:
+insert a socket in the svc_fdset without a corresponding transport handle
+and passes the socket to the svc_getreqset subroutine, this usage causes
+a segfault of statd on a huge amount of sm-notifications.
+
+Fix the issue by separating the non-RPC-server sock from RPC dispatcher.
+
+Signed-off-by: Shan Hai <shan.hai@windriver.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ utils/statd/rmtcall.c | 1 -
+ utils/statd/statd.c | 5 +++--
+ utils/statd/statd.h | 2 +-
+ utils/statd/svc_run.c | 8 ++++++--
+ 4 files changed, 10 insertions(+), 6 deletions(-)
+
+diff --git a/utils/statd/rmtcall.c b/utils/statd/rmtcall.c
+index fd576d9..cde091b 100644
+--- a/utils/statd/rmtcall.c
++++ b/utils/statd/rmtcall.c
+@@ -104,7 +104,6 @@ statd_get_socket(void)
+ if (sockfd < 0)
+ return -1;
+
+- FD_SET(sockfd, &SVC_FDSET);
+ return sockfd;
+ }
+
+diff --git a/utils/statd/statd.c b/utils/statd/statd.c
+index 51a016e..e21a259 100644
+--- a/utils/statd/statd.c
++++ b/utils/statd/statd.c
+@@ -247,6 +247,7 @@ int main (int argc, char **argv)
+ int port = 0, out_port = 0;
+ int nlm_udp = 0, nlm_tcp = 0;
+ struct rlimit rlim;
++ int notify_sockfd;
+
+ int pipefds[2] = { -1, -1};
+ char status;
+@@ -473,7 +474,7 @@ int main (int argc, char **argv)
+ }
+
+ /* Make sure we have a privilege port for calling into the kernel */
+- if (statd_get_socket() < 0)
++ if ((notify_sockfd = statd_get_socket()) < 0)
+ exit(1);
+
+ /* If sm-notify didn't take all the state files, load
+@@ -528,7 +529,7 @@ int main (int argc, char **argv)
+ * Handle incoming requests: SM_NOTIFY socket requests, as
+ * well as callbacks from lockd.
+ */
+- my_svc_run(); /* I rolled my own, Olaf made it better... */
++ my_svc_run(notify_sockfd); /* I rolled my own, Olaf made it better... */
+
+ /* Only get here when simulating a crash so we should probably
+ * start sm-notify running again. As we have already dropped
+diff --git a/utils/statd/statd.h b/utils/statd/statd.h
+index a1d8035..231ac7e 100644
+--- a/utils/statd/statd.h
++++ b/utils/statd/statd.h
+@@ -28,7 +28,7 @@ extern _Bool statd_present_address(const struct sockaddr *sap, char *buf,
+ __attribute__((__malloc__))
+ extern char * statd_canonical_name(const char *hostname);
+
+-extern void my_svc_run(void);
++extern void my_svc_run(int);
+ extern void notify_hosts(void);
+ extern void shuffle_dirs(void);
+ extern int statd_get_socket(void);
+diff --git a/utils/statd/svc_run.c b/utils/statd/svc_run.c
+index d98ecee..28c1ad6 100644
+--- a/utils/statd/svc_run.c
++++ b/utils/statd/svc_run.c
+@@ -78,7 +78,7 @@ my_svc_exit(void)
+ * The heart of the server. A crib from libc for the most part...
+ */
+ void
+-my_svc_run(void)
++my_svc_run(int sockfd)
+ {
+ FD_SET_TYPE readfds;
+ int selret;
+@@ -96,6 +96,8 @@ my_svc_run(void)
+ }
+
+ readfds = SVC_FDSET;
++ /* Set notify sockfd for waiting for reply */
++ FD_SET(sockfd, &readfds);
+ if (notify) {
+ struct timeval tv;
+
+@@ -125,8 +127,10 @@ my_svc_run(void)
+
+ default:
+ selret -= process_reply(&readfds);
+- if (selret)
++ if (selret) {
++ FD_CLR(sockfd, &readfds);
+ svc_getreqset(&readfds);
++ }
+ }
+ }
+ }
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service
new file mode 100644
index 000000000..613ddc003
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=NFS Mount Daemon
+After=rpcbind.service nfs-server.service
+Requires=rpcbind.service nfs-server.service
+
+[Service]
+EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf
+ExecStart=@SBINDIR@/rpc.mountd -F $MOUNTD_OPTS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service
new file mode 100644
index 000000000..147d7a7b5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service
@@ -0,0 +1,18 @@
+[Unit]
+Description=NFS Server
+Requires=rpcbind.service nfs-mountd.service
+After=rpcbind.service
+
+[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 -f
+ExecReload=@SBINDIR@/exportfs -r
+StandardError=syslog
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service
new file mode 100644
index 000000000..746dacf05
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=NFS file locking service
+After=rpcbind.service
+Requires=rpcbind.service
+Before=remote-fs-pre.target
+
+[Service]
+EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf
+ExecStart=@SBINDIR@/rpc.statd -F $STATD_OPTS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-sm-notify-res_init.patch b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-sm-notify-res_init.patch
new file mode 100644
index 000000000..d8f818167
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-sm-notify-res_init.patch
@@ -0,0 +1,36 @@
+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>
+
+
+diff -up nfs-utils-1.2.3/utils/statd/sm-notify.c.orig nfs-utils-1.2.3/utils/statd/sm-notify.c
+--- nfs-utils-1.2.3/utils/statd/sm-notify.c.orig 2010-09-28 08:24:16.000000000 -0400
++++ nfs-utils-1.2.3/utils/statd/sm-notify.c 2010-10-15 16:44:43.487119601 -0400
+@@ -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 "sockaddr.h"
+ #include "xlog.h"
+@@ -84,6 +87,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/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils.conf b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils.conf
new file mode 100644
index 000000000..a1007a7fb
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon
new file mode 100644
index 000000000..992267d5a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver
new file mode 100644
index 000000000..7ed93a59d
--- /dev/null
+++ b/import-layers/yocto-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" -- "-f /etc/exports $@"
+ 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/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount
new file mode 100644
index 000000000..630801b37
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.3.bb b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.3.bb
new file mode 100644
index 000000000..a6268f3d4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.3.bb
@@ -0,0 +1,143 @@
+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}-client = "rpcbind bash"
+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://0001-nfs-utils-statd-fix-a-segfault-caused-by-improper-us.patch \
+ file://bugfix-adjust-statd-service-name.patch \
+"
+
+SRC_URI[md5sum] = "cd6b568c2e9301cc3bfac09d87fbbc0b"
+SRC_URI[sha256sum] = "700d689c5622c87953c34102e5befafc4d3c811e676852238f0dd79c9c0c084d"
+
+# 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_SERVICE_${PN} = "nfs-server.service nfs-mountd.service"
+SYSTEMD_SERVICE_${PN}-client = "nfs-statd.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+# --enable-uuid is need for cross-compiling
+EXTRA_OECONF = "--with-statduser=rpcuser \
+ --enable-mountconfig \
+ --enable-libmount-mount \
+ --disable-nfsv41 \
+ --enable-uuid \
+ --disable-gss \
+ --disable-nfsdcltrack \
+ --with-statdpath=/var/lib/nfs/statd \
+ "
+
+PACKAGECONFIG ??= "tcp-wrappers"
+PACKAGECONFIG_remove_libc-musl = "tcp-wrappers"
+PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,--without-tcp-wrappers,tcp-wrappers"
+PACKAGECONFIG[nfsidmap] = "--enable-nfsidmap,--disable-nfsidmap,keyutils"
+
+INHIBIT_AUTO_STAGE = "1"
+
+PACKAGES =+ "${PN}-client ${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 = "${base_sbindir}/*mount.nfs* ${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"
+FILES_${PN}-stats = "${sbindir}/mountstats ${sbindir}/nfsiostat"
+RDEPENDS_${PN}-stats = "python"
+
+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 -d ${D}${sysconfdir}/modules-load.d
+ echo "nfsd" > ${D}${sysconfdir}/modules-load.d/nfsd.conf
+ 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
+}
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/ofono/ofono.inc b/import-layers/yocto-poky/meta/recipes-connectivity/ofono/ofono.inc
new file mode 100644
index 000000000..c415a3998
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/ofono/ofono.inc
@@ -0,0 +1,37 @@
+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
+
+DEPENDS = "dbus glib-2.0 udev mobile-broadband-provider-info"
+
+INITSCRIPT_NAME = "ofono"
+INITSCRIPT_PARAMS = "defaults 22"
+
+PACKAGECONFIG ??= "\
+ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '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"
+
+FILES_${PN} += "${base_libdir}/udev ${systemd_unitdir}"
+FILES_${PN}-tests = "${libdir}/${BPN}/test"
+RDEPENDS_${PN}-tests = "python python-pygobject python-dbus"
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/ofono/ofono/Revert-test-Convert-to-Python-3.patch b/import-layers/yocto-poky/meta/recipes-connectivity/ofono/ofono/Revert-test-Convert-to-Python-3.patch
new file mode 100644
index 000000000..5f8ca7710
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/ofono/ofono/Revert-test-Convert-to-Python-3.patch
@@ -0,0 +1,1270 @@
+Upstream-Status: Inappropriate [configuration]
+
+From 572fc23f6efd65a2ef9e6c957b2506108738672b Mon Sep 17 00:00:00 2001
+From: Cristian Iorga <cristian.iorga@intel.com>
+Date: Mon, 25 Aug 2014 16:59:39 +0300
+Subject: [PATCH] Revert "test: Convert to Python 3"
+
+This reverts commit c027ab9fbc1a8e8c9e76bcd123df1ad7696307c2.
+---
+ test/activate-context | 2 +-
+ test/answer-calls | 2 +-
+ test/backtrace | 2 +-
+ test/cancel-ussd | 2 +-
+ test/cdma-connman-disable | 2 +-
+ test/cdma-connman-enable | 2 +-
+ test/cdma-dial-number | 2 +-
+ test/cdma-hangup | 2 +-
+ test/cdma-list-call | 2 +-
+ test/cdma-set-credentials | 2 +-
+ test/change-pin | 2 +-
+ test/create-internet-context | 2 +-
+ test/create-mms-context | 2 +-
+ test/create-multiparty | 2 +-
+ test/deactivate-all | 2 +-
+ test/deactivate-context | 2 +-
+ test/dial-number | 2 +-
+ test/disable-call-forwarding | 2 +-
+ test/disable-gprs | 2 +-
+ test/disable-modem | 2 +-
+ test/display-icon | 2 +-
+ test/enable-cbs | 2 +-
+ test/enable-gprs | 2 +-
+ test/enable-modem | 2 +-
+ test/enter-pin | 2 +-
+ test/get-icon | 2 +-
+ test/get-operators | 2 +-
+ test/get-tech-preference | 2 +-
+ test/hangup-active | 2 +-
+ test/hangup-all | 2 +-
+ test/hangup-call | 2 +-
+ test/hangup-multiparty | 2 +-
+ test/hold-and-answer | 2 +-
+ test/initiate-ussd | 4 ++--
+ test/list-calls | 2 +-
+ test/list-contexts | 2 +-
+ test/list-messages | 2 +-
+ test/list-modems | 2 +-
+ test/list-operators | 2 +-
+ test/lock-pin | 2 +-
+ test/lockdown-modem | 2 +-
+ test/monitor-ofono | 4 ++--
+ test/offline-modem | 2 +-
+ test/online-modem | 2 +-
+ test/private-chat | 2 +-
+ test/process-context-settings | 2 +-
+ test/receive-sms | 2 +-
+ test/reject-calls | 2 +-
+ test/release-and-answer | 2 +-
+ test/release-and-swap | 2 +-
+ test/remove-contexts | 2 +-
+ test/reset-pin | 2 +-
+ test/scan-for-operators | 2 +-
+ test/send-sms | 2 +-
+ test/send-ussd | 4 ++--
+ test/send-vcal | 2 +-
+ test/send-vcard | 2 +-
+ test/set-call-forwarding | 2 +-
+ test/set-cbs-topics | 2 +-
+ test/set-context-property | 2 +-
+ test/set-fast-dormancy | 2 +-
+ test/set-gsm-band | 2 +-
+ test/set-mic-volume | 2 +-
+ test/set-mms-details | 2 +-
+ test/set-msisdn | 2 +-
+ test/set-roaming-allowed | 2 +-
+ test/set-speaker-volume | 2 +-
+ test/set-tech-preference | 2 +-
+ test/set-tty | 2 +-
+ test/set-umts-band | 2 +-
+ test/set-use-sms-reports | 2 +-
+ test/swap-calls | 2 +-
+ test/test-advice-of-charge | 2 +-
+ test/test-call-barring | 2 +-
+ test/test-call-forwarding | 2 +-
+ test/test-call-settings | 2 +-
+ test/test-cbs | 4 ++--
+ test/test-gnss | 4 ++--
+ test/test-message-waiting | 2 +-
+ test/test-modem | 2 +-
+ test/test-network-registration | 2 +-
+ test/test-phonebook | 2 +-
+ test/test-push-notification | 2 +-
+ test/test-smart-messaging | 2 +-
+ test/test-sms | 18 +++++++++---------
+ test/test-ss | 2 +-
+ test/test-ss-control-cb | 2 +-
+ test/test-ss-control-cf | 2 +-
+ test/test-ss-control-cs | 2 +-
+ test/test-stk-menu | 34 +++++++++++++++++-----------------
+ test/unlock-pin | 2 +-
+ 94 files changed, 124 insertions(+), 124 deletions(-)
+
+diff --git a/test/activate-context b/test/activate-context
+index e4fc702..4241396 100755
+--- a/test/activate-context
++++ b/test/activate-context
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+diff --git a/test/answer-calls b/test/answer-calls
+index daa794b..45ff08f 100755
+--- a/test/answer-calls
++++ b/test/answer-calls
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+
+diff --git a/test/backtrace b/test/backtrace
+index 03c7632..c624709 100755
+--- a/test/backtrace
++++ b/test/backtrace
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import os
+ import re
+diff --git a/test/cancel-ussd b/test/cancel-ussd
+index e7559ba..1797f26 100755
+--- a/test/cancel-ussd
++++ b/test/cancel-ussd
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+diff --git a/test/cdma-connman-disable b/test/cdma-connman-disable
+index 3adc14d..0ddc0cd 100755
+--- a/test/cdma-connman-disable
++++ b/test/cdma-connman-disable
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+ import sys
+diff --git a/test/cdma-connman-enable b/test/cdma-connman-enable
+index ac16a2d..a3cca01 100755
+--- a/test/cdma-connman-enable
++++ b/test/cdma-connman-enable
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+ import sys
+diff --git a/test/cdma-dial-number b/test/cdma-dial-number
+index 683431e..9cdfb24 100755
+--- a/test/cdma-dial-number
++++ b/test/cdma-dial-number
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+diff --git a/test/cdma-hangup b/test/cdma-hangup
+index 41ffa60..493ece4 100755
+--- a/test/cdma-hangup
++++ b/test/cdma-hangup
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+diff --git a/test/cdma-list-call b/test/cdma-list-call
+index b132353..5d36a69 100755
+--- a/test/cdma-list-call
++++ b/test/cdma-list-call
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+
+diff --git a/test/cdma-set-credentials b/test/cdma-set-credentials
+index a60c86e..a286b0e 100755
+--- a/test/cdma-set-credentials
++++ b/test/cdma-set-credentials
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+ import sys
+diff --git a/test/change-pin b/test/change-pin
+index 301c6ce..000ce53 100755
+--- a/test/change-pin
++++ b/test/change-pin
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+ import sys
+diff --git a/test/create-internet-context b/test/create-internet-context
+index 1089053..efd0998 100755
+--- a/test/create-internet-context
++++ b/test/create-internet-context
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+diff --git a/test/create-mms-context b/test/create-mms-context
+index 598336f..e5be08d 100755
+--- a/test/create-mms-context
++++ b/test/create-mms-context
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+diff --git a/test/create-multiparty b/test/create-multiparty
+index 1b76010..97047c3 100755
+--- a/test/create-multiparty
++++ b/test/create-multiparty
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+diff --git a/test/deactivate-all b/test/deactivate-all
+index 5aa8587..427009e 100755
+--- a/test/deactivate-all
++++ b/test/deactivate-all
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+diff --git a/test/deactivate-context b/test/deactivate-context
+index 5c86a71..df47d2e 100755
+--- a/test/deactivate-context
++++ b/test/deactivate-context
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+diff --git a/test/dial-number b/test/dial-number
+index fe5adad..ee674d9 100755
+--- a/test/dial-number
++++ b/test/dial-number
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+diff --git a/test/disable-call-forwarding b/test/disable-call-forwarding
+index 811e4fa..3609816 100755
+--- a/test/disable-call-forwarding
++++ b/test/disable-call-forwarding
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ from gi.repository import GLib
+diff --git a/test/disable-gprs b/test/disable-gprs
+index 61ce216..c6c40a5 100755
+--- a/test/disable-gprs
++++ b/test/disable-gprs
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+ import sys
+diff --git a/test/disable-modem b/test/disable-modem
+index 6fba857..ca8c8d8 100755
+--- a/test/disable-modem
++++ b/test/disable-modem
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+ import sys
+diff --git a/test/display-icon b/test/display-icon
+index ac40818..753d14d 100755
+--- a/test/display-icon
++++ b/test/display-icon
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+diff --git a/test/enable-cbs b/test/enable-cbs
+index 4a8bf66..c08bf2b 100755
+--- a/test/enable-cbs
++++ b/test/enable-cbs
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+ import sys
+diff --git a/test/enable-gprs b/test/enable-gprs
+index 68d5ef0..8664891 100755
+--- a/test/enable-gprs
++++ b/test/enable-gprs
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+ import sys
+diff --git a/test/enable-modem b/test/enable-modem
+index fc5958a..dfaaaa8 100755
+--- a/test/enable-modem
++++ b/test/enable-modem
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+ import sys
+diff --git a/test/enter-pin b/test/enter-pin
+index 9556363..c6ee669 100755
+--- a/test/enter-pin
++++ b/test/enter-pin
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+ import sys
+diff --git a/test/get-icon b/test/get-icon
+index 5569a33..fdaaee7 100755
+--- a/test/get-icon
++++ b/test/get-icon
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+ import sys
+diff --git a/test/get-operators b/test/get-operators
+index 0f35c80..62354c5 100755
+--- a/test/get-operators
++++ b/test/get-operators
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+ import sys
+diff --git a/test/get-tech-preference b/test/get-tech-preference
+index 7ba6365..77d20d0 100755
+--- a/test/get-tech-preference
++++ b/test/get-tech-preference
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus, sys
+
+diff --git a/test/hangup-active b/test/hangup-active
+index 82e0eb0..5af62ab 100755
+--- a/test/hangup-active
++++ b/test/hangup-active
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+diff --git a/test/hangup-all b/test/hangup-all
+index 3a0138d..32933db 100755
+--- a/test/hangup-all
++++ b/test/hangup-all
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+diff --git a/test/hangup-call b/test/hangup-call
+index 5a2de20..447020c 100755
+--- a/test/hangup-call
++++ b/test/hangup-call
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+diff --git a/test/hangup-multiparty b/test/hangup-multiparty
+index 24751c3..48fe342 100755
+--- a/test/hangup-multiparty
++++ b/test/hangup-multiparty
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+diff --git a/test/hold-and-answer b/test/hold-and-answer
+index da3be57..2c47e27 100755
+--- a/test/hold-and-answer
++++ b/test/hold-and-answer
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+diff --git a/test/initiate-ussd b/test/initiate-ussd
+index faf50d0..d7022f1 100755
+--- a/test/initiate-ussd
++++ b/test/initiate-ussd
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+@@ -45,7 +45,7 @@ if state == "idle":
+ print("State: %s" % (state))
+
+ while state == "user-response":
+- response = input("Enter response: ")
++ response = raw_input("Enter response: ")
+
+ result = ussd.Respond(response, timeout=100)
+
+diff --git a/test/list-calls b/test/list-calls
+index f3ee991..08668c6 100755
+--- a/test/list-calls
++++ b/test/list-calls
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+
+diff --git a/test/list-contexts b/test/list-contexts
+index 78278ca..f0d4094 100755
+--- a/test/list-contexts
++++ b/test/list-contexts
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+
+diff --git a/test/list-messages b/test/list-messages
+index 9f5bce3..cfccbea 100755
+--- a/test/list-messages
++++ b/test/list-messages
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+
+diff --git a/test/list-modems b/test/list-modems
+index b9f510a..ed66124 100755
+--- a/test/list-modems
++++ b/test/list-modems
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+
+diff --git a/test/list-operators b/test/list-operators
+index 064c4e3..349bf41 100755
+--- a/test/list-operators
++++ b/test/list-operators
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+ import sys
+diff --git a/test/lock-pin b/test/lock-pin
+index 96ea9c2..5579735 100755
+--- a/test/lock-pin
++++ b/test/lock-pin
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+ import sys
+diff --git a/test/lockdown-modem b/test/lockdown-modem
+index 4e04205..781abb6 100755
+--- a/test/lockdown-modem
++++ b/test/lockdown-modem
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+ import sys
+diff --git a/test/monitor-ofono b/test/monitor-ofono
+index 8830757..bd31617 100755
+--- a/test/monitor-ofono
++++ b/test/monitor-ofono
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ from gi.repository import GLib
+
+@@ -6,7 +6,7 @@ import dbus
+ import dbus.mainloop.glib
+
+ _dbus2py = {
+- dbus.String : str,
++ dbus.String : unicode,
+ dbus.UInt32 : int,
+ dbus.Int32 : int,
+ dbus.Int16 : int,
+diff --git a/test/offline-modem b/test/offline-modem
+index e8c043a..ea1f522 100755
+--- a/test/offline-modem
++++ b/test/offline-modem
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus, sys
+
+diff --git a/test/online-modem b/test/online-modem
+index 029c4a5..310ed7d 100755
+--- a/test/online-modem
++++ b/test/online-modem
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus, sys
+
+diff --git a/test/private-chat b/test/private-chat
+index e7e5406..ef2ef6c 100755
+--- a/test/private-chat
++++ b/test/private-chat
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+diff --git a/test/process-context-settings b/test/process-context-settings
+index 8a3ecfa..0f058b2 100755
+--- a/test/process-context-settings
++++ b/test/process-context-settings
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import os
+ import dbus
+diff --git a/test/receive-sms b/test/receive-sms
+index a0c6915..c23eb14 100755
+--- a/test/receive-sms
++++ b/test/receive-sms
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ from gi.repository import GLib
+
+diff --git a/test/reject-calls b/test/reject-calls
+index 71b243e..9edf1ff 100755
+--- a/test/reject-calls
++++ b/test/reject-calls
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+
+diff --git a/test/release-and-answer b/test/release-and-answer
+index dec8e17..25fd818 100755
+--- a/test/release-and-answer
++++ b/test/release-and-answer
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+diff --git a/test/release-and-swap b/test/release-and-swap
+index cb8c84e..7b3569f 100755
+--- a/test/release-and-swap
++++ b/test/release-and-swap
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+diff --git a/test/remove-contexts b/test/remove-contexts
+index b54184e..c5082cb 100755
+--- a/test/remove-contexts
++++ b/test/remove-contexts
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+
+diff --git a/test/reset-pin b/test/reset-pin
+index 3fbd126..b429254 100755
+--- a/test/reset-pin
++++ b/test/reset-pin
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+ import sys
+diff --git a/test/scan-for-operators b/test/scan-for-operators
+index b4fc05e..749c710 100755
+--- a/test/scan-for-operators
++++ b/test/scan-for-operators
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+ import sys
+diff --git a/test/send-sms b/test/send-sms
+index 98808aa..e06444d 100755
+--- a/test/send-sms
++++ b/test/send-sms
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+diff --git a/test/send-ussd b/test/send-ussd
+index a20e098..e585883 100755
+--- a/test/send-ussd
++++ b/test/send-ussd
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+@@ -46,7 +46,7 @@ if state == "idle":
+ print("State: %s" % (state))
+
+ while state == "user-response":
+- response = input("Enter response: ")
++ response = raw_input("Enter response: ")
+
+ print(ussd.Respond(response, timeout=100))
+
+diff --git a/test/send-vcal b/test/send-vcal
+index 566daef..7f8272b 100755
+--- a/test/send-vcal
++++ b/test/send-vcal
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+diff --git a/test/send-vcard b/test/send-vcard
+index 4dedf51..250b36f 100755
+--- a/test/send-vcard
++++ b/test/send-vcard
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+diff --git a/test/set-call-forwarding b/test/set-call-forwarding
+index 49d1ce0..9fd358b 100755
+--- a/test/set-call-forwarding
++++ b/test/set-call-forwarding
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ from gi.repository import GLib
+diff --git a/test/set-cbs-topics b/test/set-cbs-topics
+index db95e16..78d6d44 100755
+--- a/test/set-cbs-topics
++++ b/test/set-cbs-topics
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+ import sys
+diff --git a/test/set-context-property b/test/set-context-property
+index 5ff7a67..64a6fb8 100755
+--- a/test/set-context-property
++++ b/test/set-context-property
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+diff --git a/test/set-fast-dormancy b/test/set-fast-dormancy
+index ef77bcd..7bf7715 100755
+--- a/test/set-fast-dormancy
++++ b/test/set-fast-dormancy
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+ import sys
+diff --git a/test/set-gsm-band b/test/set-gsm-band
+index b37bcb5..3c17c10 100755
+--- a/test/set-gsm-band
++++ b/test/set-gsm-band
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+ import sys
+diff --git a/test/set-mic-volume b/test/set-mic-volume
+index cd6c73f..e0bff49 100755
+--- a/test/set-mic-volume
++++ b/test/set-mic-volume
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+diff --git a/test/set-mms-details b/test/set-mms-details
+index 6ee59fa..d2d0838 100755
+--- a/test/set-mms-details
++++ b/test/set-mms-details
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+diff --git a/test/set-msisdn b/test/set-msisdn
+index b5fe819..01f284d 100755
+--- a/test/set-msisdn
++++ b/test/set-msisdn
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+ import sys
+diff --git a/test/set-roaming-allowed b/test/set-roaming-allowed
+index 698c8b6..9e3e058 100755
+--- a/test/set-roaming-allowed
++++ b/test/set-roaming-allowed
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+diff --git a/test/set-speaker-volume b/test/set-speaker-volume
+index 6d4e301..7962f39 100755
+--- a/test/set-speaker-volume
++++ b/test/set-speaker-volume
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+diff --git a/test/set-tech-preference b/test/set-tech-preference
+index b549abc..2666cbd 100755
+--- a/test/set-tech-preference
++++ b/test/set-tech-preference
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+ import sys
+diff --git a/test/set-tty b/test/set-tty
+index eed1fba..53d6b99 100755
+--- a/test/set-tty
++++ b/test/set-tty
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+ import sys
+diff --git a/test/set-umts-band b/test/set-umts-band
+index 0bae5c4..c1e6448 100755
+--- a/test/set-umts-band
++++ b/test/set-umts-band
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+ import sys
+diff --git a/test/set-use-sms-reports b/test/set-use-sms-reports
+index 288d4e1..a4efe4f 100755
+--- a/test/set-use-sms-reports
++++ b/test/set-use-sms-reports
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+ import sys
+diff --git a/test/swap-calls b/test/swap-calls
+index 018a8d3..eeb257b 100755
+--- a/test/swap-calls
++++ b/test/swap-calls
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+diff --git a/test/test-advice-of-charge b/test/test-advice-of-charge
+index 6e87e61..0f1f57f 100755
+--- a/test/test-advice-of-charge
++++ b/test/test-advice-of-charge
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ from gi.repository import GLib
+ import sys
+diff --git a/test/test-call-barring b/test/test-call-barring
+index eedb69f..be4ab57 100755
+--- a/test/test-call-barring
++++ b/test/test-call-barring
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ from gi.repository import GLib
+ import sys
+diff --git a/test/test-call-forwarding b/test/test-call-forwarding
+index 5db84d7..01a7294 100755
+--- a/test/test-call-forwarding
++++ b/test/test-call-forwarding
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ from gi.repository import GLib
+
+diff --git a/test/test-call-settings b/test/test-call-settings
+index 435594c..5d7ee49 100755
+--- a/test/test-call-settings
++++ b/test/test-call-settings
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ from gi.repository import GLib
+
+diff --git a/test/test-cbs b/test/test-cbs
+index a5cec06..13cdd80 100755
+--- a/test/test-cbs
++++ b/test/test-cbs
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+ import dbus.mainloop.glib
+@@ -78,7 +78,7 @@ def set_topics(cbs):
+ invalidData = False;
+ index = 0
+
+- topics = input('Enter the topic ID(s) you want to register to: ')
++ topics = raw_input('Enter the topic ID(s) you want to register to: ')
+
+ while index < len(topics):
+ if topics[index] == ',' or topics[index] == '-':
+diff --git a/test/test-gnss b/test/test-gnss
+index 6ae64db..aa0b160 100755
+--- a/test/test-gnss
++++ b/test/test-gnss
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ from gi.repository import GLib
+ import sys
+@@ -40,7 +40,7 @@ def print_menu():
+ def stdin_handler(channel, condition, gnss, path):
+ in_key = os.read(channel.unix_get_fd(), 160).rstrip().decode('UTF-8')
+ if in_key == '0':
+- xml = input('type the element and press enter: ')
++ xml = raw_input('type the element and press enter: ')
+ try:
+ gnss.SendPositioningElement(dbus.String(xml))
+ print("ok")
+diff --git a/test/test-message-waiting b/test/test-message-waiting
+index 432862e..b93fbf3 100755
+--- a/test/test-message-waiting
++++ b/test/test-message-waiting
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ from gi.repository import GLib
+ import sys
+diff --git a/test/test-modem b/test/test-modem
+index aa38b1f..29dbf14 100755
+--- a/test/test-modem
++++ b/test/test-modem
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ from gi.repository import GLib
+
+diff --git a/test/test-network-registration b/test/test-network-registration
+index 68b4347..c5ad586 100755
+--- a/test/test-network-registration
++++ b/test/test-network-registration
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ from gi.repository import GLib
+ import sys
+diff --git a/test/test-phonebook b/test/test-phonebook
+index 42646d3..116fd4f 100755
+--- a/test/test-phonebook
++++ b/test/test-phonebook
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus, sys
+
+diff --git a/test/test-push-notification b/test/test-push-notification
+index d972ad3..ecc6afb 100755
+--- a/test/test-push-notification
++++ b/test/test-push-notification
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ from gi.repository import GLib
+
+diff --git a/test/test-smart-messaging b/test/test-smart-messaging
+index f22efd2..188ac1e 100755
+--- a/test/test-smart-messaging
++++ b/test/test-smart-messaging
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ from gi.repository import GLib
+
+diff --git a/test/test-sms b/test/test-sms
+index 30ac651..49935e1 100755
+--- a/test/test-sms
++++ b/test/test-sms
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ # -*- coding: utf-8 -*-
+
+ from gi.repository import GLib
+@@ -132,7 +132,7 @@ def stdin_handler(channel, condition, sms, value, number):
+ lock = "on"
+ if in_key == '0':
+ print_send_sms_menu()
+- sms_type = input('Select SMS type: ')
++ sms_type = raw_input('Select SMS type: ')
+
+ if sms_type == '1':
+ message_send(sms, number, value)
+@@ -150,49 +150,49 @@ def stdin_handler(channel, condition, sms, value, number):
+
+ elif in_key == '1':
+ message_delivery_report(sms, 1)
+- send_msg = input('Send test message[y/n]?: ')
++ send_msg = raw_input('Send test message[y/n]?: ')
+ if send_msg == 'y':
+ message_send(sms, number, ("(1)" + value +
+ ": UseDeliveryReports[TRUE]"))
+
+ elif in_key == '2':
+ message_delivery_report(sms, 0)
+- send_msg = input('Send test message[y/n]?: ')
++ send_msg = raw_input('Send test message[y/n]?: ')
+ if send_msg == 'y':
+ message_send(sms, number, ("(2) " + value +
+ ": UseDeliveryReports[FALSE]"))
+
+ elif in_key == '3':
+ message_service_center_address(sms, SCA)
+- send_msg = input('Send test message[y/n]?: ')
++ send_msg = raw_input('Send test message[y/n]?: ')
+ if send_msg == 'y':
+ message_send(sms, number, ("(3) " + value +
+ ": ServiceCenterAddress"))
+
+ elif in_key == '4':
+ message_bearer(sms, "ps-only")
+- send_msg = input('Send test message[y/n]?: ')
++ send_msg = raw_input('Send test message[y/n]?: ')
+ if send_msg == 'y':
+ message_send(sms, number, ("(4) " + value +
+ ": Bearer[ps-only]"))
+
+ elif in_key == '5':
+ message_bearer(sms, "cs-only")
+- send_msg = input('Send test message[y/n]?: ')
++ send_msg = raw_input('Send test message[y/n]?: ')
+ if send_msg == 'y':
+ message_send(sms, number, ("(5) " + value +
+ ": Bearer[cs-only]"))
+
+ elif in_key == '6':
+ message_bearer(sms, "ps-preferred")
+- send_msg = input('Send test message[y/n]?: ')
++ send_msg = raw_input('Send test message[y/n]?: ')
+ if send_msg == 'y':
+ message_send(sms, number, ("(6) " + value +
+ ": Bearer[ps-preferred]"))
+
+ elif in_key == '7':
+ message_bearer(sms, "cs-preferred")
+- send_msg = input('Send test message[y/n]?: ')
++ send_msg = raw_input('Send test message[y/n]?: ')
+ if send_msg == 'y':
+ message_send(sms,number, ("(7) " + value +
+ ": Bearer[cs-preferred]"))
+diff --git a/test/test-ss b/test/test-ss
+index 4cd8732..2c80806 100755
+--- a/test/test-ss
++++ b/test/test-ss
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import sys
+ import dbus
+diff --git a/test/test-ss-control-cb b/test/test-ss-control-cb
+index ddae6d3..86bac9b 100755
+--- a/test/test-ss-control-cb
++++ b/test/test-ss-control-cb
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ from gi.repository import GLib
+
+diff --git a/test/test-ss-control-cf b/test/test-ss-control-cf
+index 095eb5d..d30bf4f 100755
+--- a/test/test-ss-control-cf
++++ b/test/test-ss-control-cf
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ from gi.repository import GLib
+
+diff --git a/test/test-ss-control-cs b/test/test-ss-control-cs
+index 8180474..e0ed1d1 100755
+--- a/test/test-ss-control-cs
++++ b/test/test-ss-control-cs
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ from gi.repository import GLib
+
+diff --git a/test/test-stk-menu b/test/test-stk-menu
+index 0cf8fa2..ac0a5bd 100755
+--- a/test/test-stk-menu
++++ b/test/test-stk-menu
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ from gi.repository import GLib
+
+@@ -58,7 +58,7 @@ class StkAgent(dbus.service.Object):
+ index += 1
+
+ print("\nDefault: %d" % (default))
+- select = input("Enter Selection (t, b):")
++ select = raw_input("Enter Selection (t, b):")
+
+ if select == 'b':
+ raise GoBack("User wishes to go back")
+@@ -75,7 +75,7 @@ class StkAgent(dbus.service.Object):
+ print("DisplayText (%s)" % (title))
+ print("Icon: (%d)" % (int(icon)))
+ print("Urgent: (%d)" % (urgent))
+- key = input("Press return to clear ('t' terminates, "
++ key = raw_input("Press return to clear ('t' terminates, "
+ "'b' goes back, 'n' busy, "
+ "'w' return and wait):")
+
+@@ -108,7 +108,7 @@ class StkAgent(dbus.service.Object):
+ print("Hide typing: (%s)" % (hide_typing))
+ print("Enter characters, min: %d, max: %d:" % (min_chars,
+ max_chars))
+- userin = input("")
++ userin = raw_input("")
+
+ return userin
+
+@@ -122,7 +122,7 @@ class StkAgent(dbus.service.Object):
+ print("Hide typing: (%s)" % (hide_typing))
+ print("Enter digits, min: %d, max: %d:" % (min_chars,
+ max_chars))
+- userin = input("'t' terminates, 'b' goes back:")
++ userin = raw_input("'t' terminates, 'b' goes back:")
+
+ if userin == 'b':
+ raise GoBack("User wishes to go back")
+@@ -136,7 +136,7 @@ class StkAgent(dbus.service.Object):
+ def RequestKey(self, title, icon):
+ print("Title: (%s)" % (title))
+ print("Icon: (%d)" % (int(icon)))
+- key = input("Enter Key (t, b):")
++ key = raw_input("Enter Key (t, b):")
+
+ if key == 'b':
+ raise GoBack("User wishes to go back")
+@@ -150,7 +150,7 @@ class StkAgent(dbus.service.Object):
+ def RequestDigit(self, title, icon):
+ print("Title: (%s)" % (title))
+ print("Icon: (%d)" % (int(icon)))
+- key = input("Enter Digit (t, b):")
++ key = raw_input("Enter Digit (t, b):")
+
+ if key == 'b':
+ raise GoBack("User wishes to go back")
+@@ -164,7 +164,7 @@ class StkAgent(dbus.service.Object):
+ def RequestQuickDigit(self, title, icon):
+ print("Title: (%s)" % (title))
+ print("Icon: (%d)" % (int(icon)))
+- key = input("Quick digit (0-9, *, #, t, b):")
++ key = raw_input("Quick digit (0-9, *, #, t, b):")
+
+ if key == 'b':
+ raise GoBack("User wishes to go back")
+@@ -178,7 +178,7 @@ class StkAgent(dbus.service.Object):
+ def RequestConfirmation(self, title, icon):
+ print("Title: (%s)" % (title))
+ print("Icon: (%d)" % (int(icon)))
+- key = input("Enter Confirmation (t, b, y, n):")
++ key = raw_input("Enter Confirmation (t, b, y, n):")
+
+ if key == 'b':
+ raise GoBack("User wishes to go back")
+@@ -194,7 +194,7 @@ class StkAgent(dbus.service.Object):
+ def ConfirmCallSetup(self, info, icon):
+ print("Information: (%s)" % (info))
+ print("Icon: (%d)" % (int(icon)))
+- key = input("Enter Confirmation (t, y, n):")
++ key = raw_input("Enter Confirmation (t, y, n):")
+
+ if key == 't':
+ raise EndSession("User wishes to terminate session")
+@@ -209,7 +209,7 @@ class StkAgent(dbus.service.Object):
+ print("Information: (%s)" % (info))
+ print("Icon: (%d)" % (int(icon)))
+ print("URL (%s)" % (url))
+- key = input("Enter Confirmation (y, n):")
++ key = raw_input("Enter Confirmation (y, n):")
+
+ if key == 'y':
+ return True
+@@ -232,7 +232,7 @@ class StkAgent(dbus.service.Object):
+ signal.alarm(5)
+
+ try:
+- key = input("Press return to end before end of"
++ key = raw_input("Press return to end before end of"
+ " single tone (t):")
+ signal.alarm(0)
+
+@@ -250,7 +250,7 @@ class StkAgent(dbus.service.Object):
+ print("LoopTone: %s" % (tone))
+ print("Text: %s" % (text))
+ print("Icon: %d" % (int(icon)))
+- key = input("Press return to end before timeout "
++ key = raw_input("Press return to end before timeout "
+ "('t' terminates, 'w' return and wait):")
+
+ if key == 'w':
+@@ -279,7 +279,7 @@ class StkAgent(dbus.service.Object):
+ def DisplayAction(self, text, icon):
+ print("Text: (%s)" % (text))
+ print("Icon: (%d)" % (int(icon)))
+- key = input("Press 't' to terminate the session ")
++ key = raw_input("Press 't' to terminate the session ")
+
+ if key == 't':
+ raise EndSession("User wishes to terminate session")
+@@ -289,7 +289,7 @@ class StkAgent(dbus.service.Object):
+ def ConfirmOpenChannel(self, info, icon):
+ print("Open channel confirmation: (%s)" % (info))
+ print("Icon: (%d)" % (int(icon)))
+- key = input("Enter Confirmation (t, y, n):")
++ key = raw_input("Enter Confirmation (t, y, n):")
+
+ if key == 't':
+ raise EndSession("User wishes to terminate session")
+@@ -299,7 +299,7 @@ class StkAgent(dbus.service.Object):
+ return False
+
+ _dbus2py = {
+- dbus.String : str,
++ dbus.String : unicode,
+ dbus.UInt32 : int,
+ dbus.Int32 : int,
+ dbus.Int16 : int,
+@@ -396,7 +396,7 @@ if __name__ == '__main__':
+ except:
+ pass
+
+- select = int(input("Enter Selection: "))
++ select = int(raw_input("Enter Selection: "))
+ stk.SelectItem(select, path)
+ elif mode == 'agent':
+ path = "/test/agent"
+diff --git a/test/unlock-pin b/test/unlock-pin
+index 61f4765..10b6626 100755
+--- a/test/unlock-pin
++++ b/test/unlock-pin
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+
+ import dbus
+ import sys
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/ofono/ofono/ofono b/import-layers/yocto-poky/meta/recipes-connectivity/ofono/ofono/ofono
new file mode 100644
index 000000000..cc9970929
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/ofono/ofono_1.17.bb b/import-layers/yocto-poky/meta/recipes-connectivity/ofono/ofono_1.17.bb
new file mode 100644
index 000000000..947f9d714
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/ofono/ofono_1.17.bb
@@ -0,0 +1,11 @@
+require ofono.inc
+
+SRC_URI = "\
+ ${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \
+ file://ofono \
+ file://Revert-test-Convert-to-Python-3.patch \
+"
+SRC_URI[md5sum] = "d280b1d267ba5bf391d2a898fea7c748"
+SRC_URI[sha256sum] = "cbf20f07fd15253c682b23c1786d517f505c3688f7c4ea93da777e1523b89635"
+
+CFLAGS_append_libc-uclibc = " -D_GNU_SOURCE"
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/ofono/ofono_git.bb b/import-layers/yocto-poky/meta/recipes-connectivity/ofono/ofono_git.bb
new file mode 100644
index 000000000..beafb775c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/ofono/ofono_git.bb
@@ -0,0 +1,14 @@
+require ofono.inc
+
+S = "${WORKDIR}/git"
+SRCREV = "14544d5996836f628613c2ce544380ee6fc8f514"
+PV = "0.12-git${SRCPV}"
+PR = "r5"
+
+SRC_URI = "git://git.kernel.org/pub/scm/network/ofono/ofono.git \
+ file://ofono"
+
+do_configure_prepend () {
+ ${S}/bootstrap
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/CVE-2016-1907_2.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/CVE-2016-1907_2.patch
new file mode 100644
index 000000000..9fac69c3d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/CVE-2016-1907_2.patch
@@ -0,0 +1,65 @@
+From f98a09cacff7baad8748c9aa217afd155a4d493f Mon Sep 17 00:00:00 2001
+From: "mmcc@openbsd.org" <mmcc@openbsd.org>
+Date: Tue, 20 Oct 2015 03:36:35 +0000
+Subject: [PATCH] upstream commit
+
+Replace a function-local allocation with stack memory.
+
+ok djm@
+
+Upstream-ID: c09fbbab637053a2ab9f33ca142b4e20a4c5a17e
+Upstream-Status: Backport
+CVE: CVE-2016-1907
+
+[YOCTO #8935]
+
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ clientloop.c | 9 ++-------
+ 1 file changed, 2 insertions(+), 7 deletions(-)
+
+diff --git a/clientloop.c b/clientloop.c
+index 87ceb3d..1e05cba 100644
+--- a/clientloop.c
++++ b/clientloop.c
+@@ -1,4 +1,4 @@
+-/* $OpenBSD: clientloop.c,v 1.275 2015/07/10 06:21:53 markus Exp $ */
++/* $OpenBSD: clientloop.c,v 1.276 2015/10/20 03:36:35 mmcc Exp $ */
+ /*
+ * Author: Tatu Ylonen <ylo@cs.hut.fi>
+ * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
+@@ -311,11 +311,10 @@ client_x11_get_proto(const char *display, const char *xauth_path,
+ static char proto[512], data[512];
+ FILE *f;
+ int got_data = 0, generated = 0, do_unlink = 0, i;
+- char *xauthdir, *xauthfile;
++ char xauthdir[PATH_MAX] = "", xauthfile[PATH_MAX] = "";
+ struct stat st;
+ u_int now, x11_timeout_real;
+
+- xauthdir = xauthfile = NULL;
+ *_proto = proto;
+ *_data = data;
+ proto[0] = data[0] = '\0';
+@@ -343,8 +342,6 @@ client_x11_get_proto(const char *display, const char *xauth_path,
+ display = xdisplay;
+ }
+ if (trusted == 0) {
+- xauthdir = xmalloc(PATH_MAX);
+- xauthfile = xmalloc(PATH_MAX);
+ mktemp_proto(xauthdir, PATH_MAX);
+ /*
+ * The authentication cookie should briefly outlive
+@@ -407,8 +404,6 @@ client_x11_get_proto(const char *display, const char *xauth_path,
+ unlink(xauthfile);
+ rmdir(xauthdir);
+ }
+- free(xauthdir);
+- free(xauthfile);
+
+ /*
+ * If we didn't get authentication data, just make up some
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/CVE-2016-1907_3.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/CVE-2016-1907_3.patch
new file mode 100644
index 000000000..3dfc51af7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/CVE-2016-1907_3.patch
@@ -0,0 +1,329 @@
+From ed4ce82dbfa8a3a3c8ea6fa0db113c71e234416c Mon Sep 17 00:00:00 2001
+From: "djm@openbsd.org" <djm@openbsd.org>
+Date: Wed, 13 Jan 2016 23:04:47 +0000
+Subject: [PATCH] upstream commit
+
+eliminate fallback from untrusted X11 forwarding to trusted
+ forwarding when the X server disables the SECURITY extension; Reported by
+ Thomas Hoger; ok deraadt@
+
+Upstream-ID: f76195bd2064615a63ef9674a0e4096b0713f938
+Upstream-Status: Backport
+CVE: CVE-2016-1907
+
+[YOCTO #8935]
+
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ clientloop.c | 114 ++++++++++++++++++++++++++++++++++++-----------------------
+ clientloop.h | 4 +--
+ mux.c | 22 ++++++------
+ ssh.c | 23 +++++-------
+ 4 files changed, 93 insertions(+), 70 deletions(-)
+
+Index: openssh-7.1p2/clientloop.c
+===================================================================
+--- openssh-7.1p2.orig/clientloop.c
++++ openssh-7.1p2/clientloop.c
+@@ -1,4 +1,4 @@
+-/* $OpenBSD: clientloop.c,v 1.276 2015/10/20 03:36:35 mmcc Exp $ */
++/* $OpenBSD: clientloop.c,v 1.279 2016/01/13 23:04:47 djm Exp $ */
+ /*
+ * Author: Tatu Ylonen <ylo@cs.hut.fi>
+ * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
+@@ -288,6 +288,9 @@ client_x11_display_valid(const char *dis
+ {
+ size_t i, dlen;
+
++ if (display == NULL)
++ return 0;
++
+ dlen = strlen(display);
+ for (i = 0; i < dlen; i++) {
+ if (!isalnum((u_char)display[i]) &&
+@@ -301,34 +304,33 @@ client_x11_display_valid(const char *dis
+
+ #define SSH_X11_PROTO "MIT-MAGIC-COOKIE-1"
+ #define X11_TIMEOUT_SLACK 60
+-void
++int
+ client_x11_get_proto(const char *display, const char *xauth_path,
+ u_int trusted, u_int timeout, char **_proto, char **_data)
+ {
+- char cmd[1024];
+- char line[512];
+- char xdisplay[512];
++ char cmd[1024], line[512], xdisplay[512];
++ char xauthfile[PATH_MAX], xauthdir[PATH_MAX];
+ static char proto[512], data[512];
+ FILE *f;
+- int got_data = 0, generated = 0, do_unlink = 0, i;
+- char xauthdir[PATH_MAX] = "", xauthfile[PATH_MAX] = "";
++ int got_data = 0, generated = 0, do_unlink = 0, i, r;
+ struct stat st;
+ u_int now, x11_timeout_real;
+
+ *_proto = proto;
+ *_data = data;
+- proto[0] = data[0] = '\0';
++ proto[0] = data[0] = xauthfile[0] = xauthdir[0] = '\0';
+
+- if (xauth_path == NULL ||(stat(xauth_path, &st) == -1)) {
+- debug("No xauth program.");
+- } else if (!client_x11_display_valid(display)) {
+- logit("DISPLAY '%s' invalid, falling back to fake xauth data",
++ if (!client_x11_display_valid(display)) {
++ logit("DISPLAY \"%s\" invalid; disabling X11 forwarding",
+ display);
+- } else {
+- if (display == NULL) {
+- debug("x11_get_proto: DISPLAY not set");
+- return;
+- }
++ return -1;
++ }
++ if (xauth_path != NULL && stat(xauth_path, &st) == -1) {
++ debug("No xauth program.");
++ xauth_path = NULL;
++ }
++
++ if (xauth_path != NULL) {
+ /*
+ * Handle FamilyLocal case where $DISPLAY does
+ * not match an authorization entry. For this we
+@@ -337,43 +339,60 @@ client_x11_get_proto(const char *display
+ * is not perfect.
+ */
+ if (strncmp(display, "localhost:", 10) == 0) {
+- snprintf(xdisplay, sizeof(xdisplay), "unix:%s",
+- display + 10);
++ if ((r = snprintf(xdisplay, sizeof(xdisplay), "unix:%s",
++ display + 10)) < 0 ||
++ (size_t)r >= sizeof(xdisplay)) {
++ error("%s: display name too long", __func__);
++ return -1;
++ }
+ display = xdisplay;
+ }
+ if (trusted == 0) {
+- mktemp_proto(xauthdir, PATH_MAX);
+ /*
++ * Generate an untrusted X11 auth cookie.
++ *
+ * The authentication cookie should briefly outlive
+ * ssh's willingness to forward X11 connections to
+ * avoid nasty fail-open behaviour in the X server.
+ */
++ mktemp_proto(xauthdir, sizeof(xauthdir));
++ if (mkdtemp(xauthdir) == NULL) {
++ error("%s: mkdtemp: %s",
++ __func__, strerror(errno));
++ return -1;
++ }
++ do_unlink = 1;
++ if ((r = snprintf(xauthfile, sizeof(xauthfile),
++ "%s/xauthfile", xauthdir)) < 0 ||
++ (size_t)r >= sizeof(xauthfile)) {
++ error("%s: xauthfile path too long", __func__);
++ unlink(xauthfile);
++ rmdir(xauthdir);
++ return -1;
++ }
++
+ if (timeout >= UINT_MAX - X11_TIMEOUT_SLACK)
+ x11_timeout_real = UINT_MAX;
+ else
+ x11_timeout_real = timeout + X11_TIMEOUT_SLACK;
+- if (mkdtemp(xauthdir) != NULL) {
+- do_unlink = 1;
+- snprintf(xauthfile, PATH_MAX, "%s/xauthfile",
+- xauthdir);
+- snprintf(cmd, sizeof(cmd),
+- "%s -f %s generate %s " SSH_X11_PROTO
+- " untrusted timeout %u 2>" _PATH_DEVNULL,
+- xauth_path, xauthfile, display,
+- x11_timeout_real);
+- debug2("x11_get_proto: %s", cmd);
+- if (x11_refuse_time == 0) {
+- now = monotime() + 1;
+- if (UINT_MAX - timeout < now)
+- x11_refuse_time = UINT_MAX;
+- else
+- x11_refuse_time = now + timeout;
+- channel_set_x11_refuse_time(
+- x11_refuse_time);
+- }
+- if (system(cmd) == 0)
+- generated = 1;
++ if ((r = snprintf(cmd, sizeof(cmd),
++ "%s -f %s generate %s " SSH_X11_PROTO
++ " untrusted timeout %u 2>" _PATH_DEVNULL,
++ xauth_path, xauthfile, display,
++ x11_timeout_real)) < 0 ||
++ (size_t)r >= sizeof(cmd))
++ fatal("%s: cmd too long", __func__);
++ debug2("%s: %s", __func__, cmd);
++ if (x11_refuse_time == 0) {
++ now = monotime() + 1;
++ if (UINT_MAX - timeout < now)
++ x11_refuse_time = UINT_MAX;
++ else
++ x11_refuse_time = now + timeout;
++ channel_set_x11_refuse_time(x11_refuse_time);
+ }
++ if (system(cmd) == 0)
++ generated = 1;
+ }
+
+ /*
+@@ -395,9 +414,7 @@ client_x11_get_proto(const char *display
+ got_data = 1;
+ if (f)
+ pclose(f);
+- } else
+- error("Warning: untrusted X11 forwarding setup failed: "
+- "xauth key data not generated");
++ }
+ }
+
+ if (do_unlink) {
+@@ -405,6 +422,13 @@ client_x11_get_proto(const char *display
+ rmdir(xauthdir);
+ }
+
++ /* Don't fall back to fake X11 data for untrusted forwarding */
++ if (!trusted && !got_data) {
++ error("Warning: untrusted X11 forwarding setup failed: "
++ "xauth key data not generated");
++ return -1;
++ }
++
+ /*
+ * If we didn't get authentication data, just make up some
+ * data. The forwarding code will check the validity of the
+@@ -427,6 +451,8 @@ client_x11_get_proto(const char *display
+ rnd >>= 8;
+ }
+ }
++
++ return 0;
+ }
+
+ /*
+Index: openssh-7.1p2/clientloop.h
+===================================================================
+--- openssh-7.1p2.orig/clientloop.h
++++ openssh-7.1p2/clientloop.h
+@@ -1,4 +1,4 @@
+-/* $OpenBSD: clientloop.h,v 1.31 2013/06/02 23:36:29 dtucker Exp $ */
++/* $OpenBSD: clientloop.h,v 1.32 2016/01/13 23:04:47 djm Exp $ */
+
+ /*
+ * Author: Tatu Ylonen <ylo@cs.hut.fi>
+@@ -39,7 +39,7 @@
+
+ /* Client side main loop for the interactive session. */
+ int client_loop(int, int, int);
+-void client_x11_get_proto(const char *, const char *, u_int, u_int,
++int client_x11_get_proto(const char *, const char *, u_int, u_int,
+ char **, char **);
+ void client_global_request_reply_fwd(int, u_int32_t, void *);
+ void client_session2_setup(int, int, int, const char *, struct termios *,
+Index: openssh-7.1p2/mux.c
+===================================================================
+--- openssh-7.1p2.orig/mux.c
++++ openssh-7.1p2/mux.c
+@@ -1,4 +1,4 @@
+-/* $OpenBSD: mux.c,v 1.54 2015/08/19 23:18:26 djm Exp $ */
++/* $OpenBSD: mux.c,v 1.58 2016/01/13 23:04:47 djm Exp $ */
+ /*
+ * Copyright (c) 2002-2008 Damien Miller <djm@openbsd.org>
+ *
+@@ -1354,16 +1354,18 @@ mux_session_confirm(int id, int success,
+ char *proto, *data;
+
+ /* Get reasonable local authentication information. */
+- client_x11_get_proto(display, options.xauth_location,
++ if (client_x11_get_proto(display, options.xauth_location,
+ options.forward_x11_trusted, options.forward_x11_timeout,
+- &proto, &data);
+- /* Request forwarding with authentication spoofing. */
+- debug("Requesting X11 forwarding with authentication "
+- "spoofing.");
+- x11_request_forwarding_with_spoofing(id, display, proto,
+- data, 1);
+- client_expect_confirm(id, "X11 forwarding", CONFIRM_WARN);
+- /* XXX exit_on_forward_failure */
++ &proto, &data) == 0) {
++ /* Request forwarding with authentication spoofing. */
++ debug("Requesting X11 forwarding with authentication "
++ "spoofing.");
++ x11_request_forwarding_with_spoofing(id, display, proto,
++ data, 1);
++ /* XXX exit_on_forward_failure */
++ client_expect_confirm(id, "X11 forwarding",
++ CONFIRM_WARN);
++ }
+ }
+
+ if (cctx->want_agent_fwd && options.forward_agent) {
+Index: openssh-7.1p2/ssh.c
+===================================================================
+--- openssh-7.1p2.orig/ssh.c
++++ openssh-7.1p2/ssh.c
+@@ -1,4 +1,4 @@
+-/* $OpenBSD: ssh.c,v 1.420 2015/07/30 00:01:34 djm Exp $ */
++/* $OpenBSD: ssh.c,v 1.433 2016/01/13 23:04:47 djm Exp $ */
+ /*
+ * Author: Tatu Ylonen <ylo@cs.hut.fi>
+ * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
+@@ -1604,6 +1604,7 @@ ssh_session(void)
+ struct winsize ws;
+ char *cp;
+ const char *display;
++ char *proto = NULL, *data = NULL;
+
+ /* Enable compression if requested. */
+ if (options.compression) {
+@@ -1674,13 +1675,9 @@ ssh_session(void)
+ display = getenv("DISPLAY");
+ if (display == NULL && options.forward_x11)
+ debug("X11 forwarding requested but DISPLAY not set");
+- if (options.forward_x11 && display != NULL) {
+- char *proto, *data;
+- /* Get reasonable local authentication information. */
+- client_x11_get_proto(display, options.xauth_location,
+- options.forward_x11_trusted,
+- options.forward_x11_timeout,
+- &proto, &data);
++ if (options.forward_x11 && client_x11_get_proto(display,
++ options.xauth_location, options.forward_x11_trusted,
++ options.forward_x11_timeout, &proto, &data) == 0) {
+ /* Request forwarding with authentication spoofing. */
+ debug("Requesting X11 forwarding with authentication "
+ "spoofing.");
+@@ -1770,6 +1767,7 @@ ssh_session2_setup(int id, int success,
+ extern char **environ;
+ const char *display;
+ int interactive = tty_flag;
++ char *proto = NULL, *data = NULL;
+
+ if (!success)
+ return; /* No need for error message, channels code sens one */
+@@ -1777,12 +1775,9 @@ ssh_session2_setup(int id, int success,
+ display = getenv("DISPLAY");
+ if (display == NULL && options.forward_x11)
+ debug("X11 forwarding requested but DISPLAY not set");
+- if (options.forward_x11 && display != NULL) {
+- char *proto, *data;
+- /* Get reasonable local authentication information. */
+- client_x11_get_proto(display, options.xauth_location,
+- options.forward_x11_trusted,
+- options.forward_x11_timeout, &proto, &data);
++ if (options.forward_x11 && client_x11_get_proto(display,
++ options.xauth_location, options.forward_x11_trusted,
++ options.forward_x11_timeout, &proto, &data) == 0) {
+ /* Request forwarding with authentication spoofing. */
+ debug("Requesting X11 forwarding with authentication "
+ "spoofing.");
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/CVE-2016-1907_upstream_commit.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/CVE-2016-1907_upstream_commit.patch
new file mode 100644
index 000000000..f3d132e43
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/CVE-2016-1907_upstream_commit.patch
@@ -0,0 +1,33 @@
+From d77148e3a3ef6c29b26ec74331455394581aa257 Mon Sep 17 00:00:00 2001
+From: "djm@openbsd.org" <djm@openbsd.org>
+Date: Sun, 8 Nov 2015 21:59:11 +0000
+Subject: [PATCH] upstream commit
+
+fix OOB read in packet code caused by missing return
+ statement found by Ben Hawkes; ok markus@ deraadt@
+
+Upstream-ID: a3e3a85434ebfa0690d4879091959591f30efc62
+
+Upstream-Status: Backport
+CVE: CVE-2016-1907
+
+[YOCTO #8935]
+
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ packet.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+Index: openssh-7.1p2/packet.c
+===================================================================
+--- openssh-7.1p2.orig/packet.c
++++ openssh-7.1p2/packet.c
+@@ -1855,6 +1855,7 @@ ssh_packet_process_incoming(struct ssh *
+ if (len >= state->packet_discard) {
+ if ((r = ssh_packet_stop_discard(ssh)) != 0)
+ return r;
++ return SSH_ERR_CONN_CORRUPT;
+ }
+ state->packet_discard -= len;
+ return 0;
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/add-test-support-for-busybox.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/add-test-support-for-busybox.patch
new file mode 100644
index 000000000..adc25c668
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/add-test-support-for-busybox.patch
@@ -0,0 +1,69 @@
+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-6.8p1/regress/cipher-speed.sh
+===================================================================
+--- openssh-6.8p1.orig/regress/cipher-speed.sh
++++ openssh-6.8p1/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 -2 -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
+@@ -42,7 +42,7 @@ for c in $ciphers; do
+ printf "%-60s" "$c:"
+ ( ${SSH} -o 'compression no' \
+ -F $OBJ/ssh_proxy -1 -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
+ fail "ssh -1 failed with cipher $c"
+Index: openssh-6.8p1/regress/transfer.sh
+===================================================================
+--- openssh-6.8p1.orig/regress/transfer.sh
++++ openssh-6.8p1/regress/transfer.sh
+@@ -15,7 +15,7 @@ for p in ${SSH_PROTOCOLS}; do
+ for s in 10 100 1k 32k 64k 128k 256k; do
+ trace "proto $p dd-size ${s}"
+ rm -f ${COPY}
+- dd if=$DATA obs=${s} 2> /dev/null | \
++ dd if=$DATA bs=${s} 2> /dev/null | \
+ ${SSH} -q -$p -F $OBJ/ssh_proxy somehost "cat > ${COPY}"
+ if [ $? -ne 0 ]; then
+ fail "ssh cat $DATA failed"
+Index: openssh-6.8p1/regress/yes-head.sh
+===================================================================
+--- openssh-6.8p1.orig/regress/yes-head.sh
++++ openssh-6.8p1/regress/yes-head.sh
+@@ -4,7 +4,7 @@
+ tid="yes pipe head"
+
+ for p in ${SSH_PROTOCOLS}; do
+- lines=`${SSH} -$p -F $OBJ/ssh_proxy thishost 'sh -c "while true;do echo yes;done | _POSIX2_VERSION=199209 head -2000"' | (sleep 3 ; wc -l)`
++ lines=`${SSH} -$p -F $OBJ/ssh_proxy thishost 'sh -c "while true;do echo yes;done | _POSIX2_VERSION=199209 head -n 2000"' | (sleep 3 ; wc -l)`
+ if [ $? -ne 0 ]; then
+ fail "yes|head test failed"
+ lines = 0;
+Index: openssh-6.8p1/regress/key-options.sh
+===================================================================
+--- openssh-6.8p1.orig/regress/key-options.sh
++++ openssh-6.8p1/regress/key-options.sh
+@@ -54,7 +54,7 @@ for p in ${SSH_PROTOCOLS}; 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 proto $p $from"
+ r=`${SSH} -$p -q -F $OBJ/ssh_proxy somehost 'echo true'`
+ if [ "$r" = "true" ]; then
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/init b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/init
new file mode 100644
index 000000000..70d4a3465
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/init
@@ -0,0 +1,115 @@
+#! /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
+
+HOST_KEY_RSA=$SYSCONFDIR/ssh_host_rsa_key
+HOST_KEY_DSA=$SYSCONFDIR/ssh_host_dsa_key
+HOST_KEY_ECDSA=$SYSCONFDIR/ssh_host_ecdsa_key
+HOST_KEY_ED25519=$SYSCONFDIR/ssh_host_ed25519_key
+
+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 || exit 1
+}
+
+check_keys() {
+ # create keys if necessary
+ if [ ! -f $HOST_KEY_RSA ]; then
+ echo " generating ssh RSA key..."
+ ssh-keygen -q -f $HOST_KEY_RSA -N '' -t rsa
+ fi
+ if [ ! -f $HOST_KEY_ECDSA ]; then
+ echo " generating ssh ECDSA key..."
+ ssh-keygen -q -f $HOST_KEY_ECDSA -N '' -t ecdsa
+ fi
+ if [ ! -f $HOST_KEY_DSA ]; then
+ echo " generating ssh DSA key..."
+ ssh-keygen -q -f $HOST_KEY_DSA -N '' -t dsa
+ fi
+ if [ ! -f $HOST_KEY_ED25519 ]; then
+ echo " generating ssh ED25519 key..."
+ ssh-keygen -q -f $HOST_KEY_ED25519 -N '' -t ed25519
+ fi
+}
+
+export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
+
+case "$1" in
+ start)
+ check_for_no_start
+ echo "Starting OpenBSD Secure Shell server: 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
+ 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)
+ 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/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/run-ptest b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/run-ptest
new file mode 100755
index 000000000..36a3d2a7b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/ssh_config b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/ssh_config
new file mode 100644
index 000000000..9e919156d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/sshd b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/sshd
new file mode 100644
index 000000000..4882e58b4
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/sshd.socket b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/sshd.socket
new file mode 100644
index 000000000..12c39b26b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/sshd@.service b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/sshd@.service
new file mode 100644
index 000000000..9d83dfb2b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/sshd_config b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/sshd_config
new file mode 100644
index 000000000..d48bd2b98
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/sshd_config
@@ -0,0 +1,133 @@
+# $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
+UsePrivilegeSeparation sandbox # Default for new installations.
+#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/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/sshdgenkeys.service b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/sshdgenkeys.service
new file mode 100644
index 000000000..148e6ad63
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/sshdgenkeys.service
@@ -0,0 +1,22 @@
+[Unit]
+Description=OpenSSH Key Generation
+RequiresMountsFor=/var /run
+ConditionPathExists=!/var/run/ssh/ssh_host_rsa_key
+ConditionPathExists=!/var/run/ssh/ssh_host_dsa_key
+ConditionPathExists=!/var/run/ssh/ssh_host_ecdsa_key
+ConditionPathExists=!/var/run/ssh/ssh_host_ed25519_key
+ConditionPathExists=!/etc/ssh/ssh_host_rsa_key
+ConditionPathExists=!/etc/ssh/ssh_host_dsa_key
+ConditionPathExists=!/etc/ssh/ssh_host_ecdsa_key
+ConditionPathExists=!/etc/ssh/ssh_host_ed25519_key
+
+[Service]
+Environment="SYSCONFDIR=/etc/ssh"
+EnvironmentFile=-/etc/default/ssh
+ExecStart=@BASE_BINDIR@/mkdir -p $SYSCONFDIR
+ExecStart=@BINDIR@/ssh-keygen -q -f ${SYSCONFDIR}/ssh_host_rsa_key -N '' -t rsa
+ExecStart=@BINDIR@/ssh-keygen -q -f ${SYSCONFDIR}/ssh_host_dsa_key -N '' -t dsa
+ExecStart=@BINDIR@/ssh-keygen -q -f ${SYSCONFDIR}/ssh_host_ecdsa_key -N '' -t ecdsa
+ExecStart=@BINDIR@/ssh-keygen -q -f ${SYSCONFDIR}/ssh_host_ed25519_key -N '' -t ed25519
+Type=oneshot
+RemainAfterExit=yes
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/volatiles.99_sshd b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh/volatiles.99_sshd
new file mode 100644
index 000000000..a0d2af3c6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh_7.1p2.bb b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh_7.1p2.bb
new file mode 100644
index 000000000..3b5e28a1d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssh/openssh_7.1p2.bb
@@ -0,0 +1,161 @@
+SUMMARY = "Secure rlogin/rsh/rcp/telnet replacement"
+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://openssh.org"
+SECTION = "console/network"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENCE;md5=e326045657e842541d3f35aada442507"
+
+DEPENDS = "zlib openssl"
+DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
+
+SRC_URI = "ftp://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://add-test-support-for-busybox.patch \
+ file://run-ptest \
+ file://CVE-2016-1907_upstream_commit.patch \
+ file://CVE-2016-1907_2.patch \
+ file://CVE-2016-1907_3.patch "
+
+PAM_SRC_URI = "file://sshd"
+
+SRC_URI[md5sum] = "4d8547670e2a220d5ef805ad9e47acf2"
+SRC_URI[sha256sum] = "dd75f024dcf21e06a0d6421d582690bf987a1f6323e32ad6619392f3bfde6bbd"
+
+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"
+
+# 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 \
+ "
+
+# 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"
+
+# This is a workaround for uclibc because including stdio.h
+# pulls in pthreads.h and causes conflicts in function prototypes.
+# This results in compilation failure, so unless this is fixed,
+# disable pam for uclibc.
+EXTRA_OECONF_append_libc-uclibc=" --without-pam"
+
+do_configure_prepend () {
+ export LD="${CC}"
+ install -m 0644 ${WORKDIR}/sshd_config ${B}/
+ install -m 0644 ${WORKDIR}/ssh_config ${B}/
+ if [ ! -e acinclude.m4 -a -e aclocal.m4 ]; then
+ cp aclocal.m4 acinclude.m4
+ fi
+}
+
+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.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" = "pam" ]; 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.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}" = "x11" ]; 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
+
+ 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' \
+ ${D}${systemd_unitdir}/system/sshd.socket ${D}${systemd_unitdir}/system/*.service
+}
+
+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}-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/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl.inc b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl.inc
new file mode 100644
index 000000000..a5ddf4d4b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl.inc
@@ -0,0 +1,211 @@
+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 = "hostperl-runtime-native"
+DEPENDS_append_class-target = " openssl-native"
+
+SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \
+ "
+S = "${WORKDIR}/openssl-${PV}"
+
+PACKAGECONFIG[perl] = ",,,"
+
+AR_append = " r"
+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 = "${@base_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"
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+inherit pkgconfig siteinfo multilib_header ptest
+
+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 ${bindir}/c_rehash"
+RDEPENDS_${PN}-misc = "${@bb.utils.contains('PACKAGECONFIG', 'perl', '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 = "${libdir}/ssl/openssl.cnf"
+CONFFILES_openssl-conf = "${libdir}/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-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-elf-armeb
+ ;;
+ linux-aarch64*)
+ target=linux-generic64
+ ;;
+ 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)
+ target=linux-x32
+ ;;
+ linux-gnu64-x86_64)
+ target=linux-x86_64
+ ;;
+ linux-mips)
+ target=debian-mips
+ ;;
+ linux-mipsel)
+ target=debian-mipsel
+ ;;
+ linux-*-mips64 | linux-mips64)
+ target=linux-mips
+ ;;
+ linux-microblaze*|linux-nios2*)
+ target=linux-generic32
+ ;;
+ linux-powerpc)
+ target=linux-ppc
+ ;;
+ linux-powerpc64)
+ target=linux-ppc64
+ ;;
+ 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
+ perl ./Configure ${EXTRA_OECONF} shared --prefix=$useprefix --openssldir=${libdir}/ssl --libdir=`basename ${libdir}` $target
+}
+
+do_compile_prepend_class-target () {
+ sed -i 's/\((OPENSSL=\)".*"/\1"openssl"/' Makefile
+}
+
+do_compile () {
+ oe_runmake
+}
+
+do_compile_ptest () {
+ 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}
+
+ oe_multilib_header openssl/opensslconf.h
+ if [ "${@bb.utils.contains('PACKAGECONFIG', 'perl', 'perl', '', d)}" = "perl" ]; then
+ install -m 0755 ${S}/tools/c_rehash ${D}${bindir}
+ sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${bindir}/c_rehash
+ 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
+ # The c_rehash utility isn't installed by the normal installation process.
+ else
+ rm -f ${D}${bindir}/c_rehash
+ rm -f ${D}${libdir}/ssl/misc/CA.pl ${D}${libdir}/ssl/misc/tsget
+ fi
+}
+
+do_install_ptest () {
+ cp -r -L Makefile.org Makefile test ${D}${PTEST_PATH}
+ cp Configure config e_os.h ${D}${PTEST_PATH}
+ cp -r -L include ${D}${PTEST_PATH}
+ ln -sf ${base_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 ${libdir}/ssl/openssl.cnf ${D}${PTEST_PATH}/apps
+ ln -sf ${bindir}/openssl ${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
+}
+
+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/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/Makefiles-ptest.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/Makefiles-ptest.patch
new file mode 100644
index 000000000..249446a5b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/Makefiles-ptest.patch
@@ -0,0 +1,77 @@
+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
+---
+Index: openssl-1.0.2/Makefile.org
+===================================================================
+--- openssl-1.0.2.orig/Makefile.org
++++ openssl-1.0.2/Makefile.org
+@@ -451,8 +451,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:
+Index: openssl-1.0.2/test/Makefile
+===================================================================
+--- openssl-1.0.2.orig/test/Makefile
++++ openssl-1.0.2/test/Makefile
+@@ -137,7 +137,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 \
+@@ -148,6 +148,11 @@ alltests: \
+ test_jpake test_srp test_cms test_ocsp test_v3name test_heartbeat \
+ test_constant_time
+
++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
+
+@@ -213,7 +218,7 @@ test_x509: ../apps/openssl$(EXE_EXT) tx5
+ 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)
+
+@@ -313,11 +318,11 @@ test_tsa: ../apps/openssl$(EXE_EXT) test
+ 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)
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/configure-musl-target.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/configure-musl-target.patch
new file mode 100644
index 000000000..613dc7b71
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/configure-musl-target.patch
@@ -0,0 +1,27 @@
+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,6 +504,8 @@ 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-uclibceabi-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-uclibceabi-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/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/configure-targets.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/configure-targets.patch
new file mode 100644
index 000000000..691e74afb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/configure-targets.patch
@@ -0,0 +1,37 @@
+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,23 @@ 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-uclibceabi-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-uclibceabi-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/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/crypto_use_bigint_in_x86-64_perl.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/crypto_use_bigint_in_x86-64_perl.patch
new file mode 100644
index 000000000..af3989f62
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/crypto_use_bigint_in_x86-64_perl.patch
@@ -0,0 +1,35 @@
+Upstream-Status: Backport
+
+When building on x32 systems where the default type is 32bit, make sure
+we can transparently represent 64bit integers. Otherwise we end up with
+build errors like:
+/usr/bin/perl asm/ghash-x86_64.pl elf > ghash-x86_64.s
+Integer overflow in hexadecimal number at asm/../../perlasm/x86_64-xlate.pl line 201, <> line 890.
+...
+ghash-x86_64.s: Assembler messages:
+ghash-x86_64.s:890: Error: junk '.15473355479995e+19' after expression
+
+We don't enable this globally as there are some cases where we'd get
+32bit values interpreted as unsigned when we need them as signed.
+
+Reported-by: Bertrand Jacquin <bertrand@jacquin.bzh>
+URL: https://bugs.gentoo.org/542618
+
+Signed-off-By: Armin Kuster <akuster@mvista.com>
+
+Index: openssl-1.0.2a/crypto/perlasm/x86_64-xlate.pl
+===================================================================
+--- openssl-1.0.2a.orig/crypto/perlasm/x86_64-xlate.pl
++++ openssl-1.0.2a/crypto/perlasm/x86_64-xlate.pl
+@@ -194,7 +194,10 @@ my %globals;
+ }
+ sub out {
+ my $self = shift;
+-
++ # When building on x32 ABIs, the expanded hex value might be too
++ # big to fit into 32bits. Enable transparent 64bit support here
++ # so we can safely print it out.
++ use bigint;
+ if ($gas) {
+ # Solaris /usr/ccs/bin/as can't handle multiplications
+ # in $self->{value}
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian/c_rehash-compat.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian/c_rehash-compat.patch
new file mode 100644
index 000000000..68e54d561
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/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]
+
+diff --git a/tools/c_rehash.in b/tools/c_rehash.in
+index b086ff9..b777d79 100644
+--- a/tools/c_rehash.in
++++ b/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;
+@@ -176,11 +174,21 @@ 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/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian/ca.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian/ca.patch
new file mode 100644
index 000000000..aba4d4298
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/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|-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/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian/debian-targets.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian/debian-targets.patch
new file mode 100644
index 000000000..39d432818
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian/debian-targets.patch
@@ -0,0 +1,73 @@
+Upstream-Status: Backport [debian]
+
+Index: openssl-1.0.2/Configure
+===================================================================
+--- openssl-1.0.2.orig/Configure
++++ openssl-1.0.2/Configure
+@@ -107,6 +107,10 @@ my $gcc_devteam_warn = "-Wall -pedantic
+
+ my $clang_disabled_warnings = "-Wno-language-extension-token -Wno-extended-offsetof -Wno-padded -Wno-shorten-64-to-32 -Wno-format-nonliteral -Wno-missing-noreturn -Wno-unused-parameter -Wno-sign-conversion -Wno-unreachable-code -Wno-conversion -Wno-documentation -Wno-missing-variable-declarations -Wno-cast-align -Wno-incompatible-pointer-types-discards-qualifiers -Wno-missing-variable-declarations -Wno-missing-field-initializers -Wno-unused-macros -Wno-disabled-macro-expansion -Wno-conditional-uninitialized -Wno-switch-enum";
+
++# 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";
+@@ -343,6 +347,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/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian/man-dir.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian/man-dir.patch
new file mode 100644
index 000000000..4085e3b1d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/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/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian/man-section.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian/man-section.patch
new file mode 100644
index 000000000..21c1d1a4e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/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/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian/no-rpath.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian/no-rpath.patch
new file mode 100644
index 000000000..1ccb3b86e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/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/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian/no-symbolic.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian/no-symbolic.patch
new file mode 100644
index 000000000..cc4408ab7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/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/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian/pic.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian/pic.patch
new file mode 100644
index 000000000..bfda3888b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/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/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian/version-script.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian/version-script.patch
new file mode 100644
index 000000000..a24918000
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian/version-script.patch
@@ -0,0 +1,4663 @@
+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,4615 @@
++OPENSSL_1.0.0 {
++ 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;
++
++ local:
++ *;
++};
++
++
++OPENSSL_1.0.1 {
++ global:
++ 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;
++} OPENSSL_1.0.0;
++
++OPENSSL_1.0.1d {
++ global:
++ CRYPTO_memcmp;
++} OPENSSL_1.0.1;
++
++OPENSSL_1.0.2 {
++ global:
++ 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;
++} OPENSSL_1.0.1d;
++
+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.0 {
++ 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.0 {
++ global:
++ bind_engine;
++ v_check;
++ OPENSSL_init;
++ OPENSSL_finish;
++ local:
++ *;
++};
++
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian1.0.2/block_digicert_malaysia.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian1.0.2/block_digicert_malaysia.patch
new file mode 100644
index 000000000..c43bcd1c7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/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/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian1.0.2/block_diginotar.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian1.0.2/block_diginotar.patch
new file mode 100644
index 000000000..d81e22cd8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/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/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian1.0.2/version-script.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian1.0.2/version-script.patch
new file mode 100644
index 000000000..29f11a288
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/debian1.0.2/version-script.patch
@@ -0,0 +1,4656 @@
+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/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/engines-install-in-libdir-ssl.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/engines-install-in-libdir-ssl.patch
new file mode 100644
index 000000000..a5746483e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/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/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/find.pl b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/find.pl
new file mode 100644
index 000000000..8e1b42c88
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/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/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/fix-cipher-des-ede3-cfb1.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/fix-cipher-des-ede3-cfb1.patch
new file mode 100644
index 000000000..06d1ea69d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/fix-cipher-des-ede3-cfb1.patch
@@ -0,0 +1,21 @@
+Upstream-Status: Submitted
+
+This patch adds the fix for one of the ciphers used in openssl, namely
+the cipher des-ede3-cfb1. Complete bug log and patch is present here:
+http://rt.openssl.org/Ticket/Display.html?id=2867
+
+Signed-Off-By: Muhammad Shakeel <muhammad_shakeel@mentor.com>
+
+Index: openssl-1.0.2/crypto/evp/e_des3.c
+===================================================================
+--- openssl-1.0.2.orig/crypto/evp/e_des3.c
++++ openssl-1.0.2/crypto/evp/e_des3.c
+@@ -211,7 +211,7 @@ static int des_ede3_cfb1_cipher(EVP_CIPH
+ size_t n;
+ unsigned char c[1], d[1];
+
+- for (n = 0; n < inl; ++n) {
++ for (n = 0; n * 8 < inl; ++n) {
+ c[0] = (in[n / 8] & (1 << (7 - n % 8))) ? 0x80 : 0;
+ DES_ede3_cfb_encrypt(c, d, 1, 1,
+ &data(ctx)->ks1, &data(ctx)->ks2,
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/oe-ldflags.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/oe-ldflags.patch
new file mode 100644
index 000000000..292e13dc5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/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/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/openssl-1.0.2a-x32-asm.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/openssl-1.0.2a-x32-asm.patch
new file mode 100644
index 000000000..1e5bfa17d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/openssl-1.0.2a-x32-asm.patch
@@ -0,0 +1,46 @@
+https://rt.openssl.org/Ticket/Display.html?id=3759&user=guest&pass=guest
+
+From 6257d59b3a68d2feb9d64317a1c556dc3813ee61 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sat, 21 Mar 2015 06:01:25 -0400
+Subject: [PATCH] crypto: use bigint in x86-64 perl
+
+Upstream-Status: Pending
+Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
+
+When building on x32 systems where the default type is 32bit, make sure
+we can transparently represent 64bit integers. Otherwise we end up with
+build errors like:
+/usr/bin/perl asm/ghash-x86_64.pl elf > ghash-x86_64.s
+Integer overflow in hexadecimal number at asm/../../perlasm/x86_64-xlate.pl line 201, <> line 890.
+...
+ghash-x86_64.s: Assembler messages:
+ghash-x86_64.s:890: Error: junk '.15473355479995e+19' after expression
+
+We don't enable this globally as there are some cases where we'd get
+32bit values interpreted as unsigned when we need them as signed.
+
+Reported-by: Bertrand Jacquin <bertrand@jacquin.bzh>
+URL: https://bugs.gentoo.org/542618
+---
+ crypto/perlasm/x86_64-xlate.pl | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/crypto/perlasm/x86_64-xlate.pl b/crypto/perlasm/x86_64-xlate.pl
+index aae8288..0bf9774 100755
+--- a/crypto/perlasm/x86_64-xlate.pl
++++ b/crypto/perlasm/x86_64-xlate.pl
+@@ -195,6 +195,10 @@ my %globals;
+ sub out {
+ my $self = shift;
+
++ # When building on x32 ABIs, the expanded hex value might be too
++ # big to fit into 32bits. Enable transparent 64bit support here
++ # so we can safely print it out.
++ use bigint;
+ if ($gas) {
+ # Solaris /usr/ccs/bin/as can't handle multiplications
+ # in $self->{value}
+--
+2.3.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/openssl-avoid-NULL-pointer-dereference-in-EVP_DigestInit_ex.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/openssl-avoid-NULL-pointer-dereference-in-EVP_DigestInit_ex.patch
new file mode 100644
index 000000000..cebc8cf0d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/openssl-avoid-NULL-pointer-dereference-in-EVP_DigestInit_ex.patch
@@ -0,0 +1,23 @@
+openssl: avoid NULL pointer dereference in EVP_DigestInit_ex()
+
+We should avoid accessing the type pointer if it's NULL,
+this could happen if ctx->digest is not NULL.
+
+Upstream-Status: Submitted
+http://www.mail-archive.com/openssl-dev@openssl.org/msg32860.html
+
+Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
+---
+Index: openssl-1.0.2/crypto/evp/digest.c
+===================================================================
+--- openssl-1.0.2.orig/crypto/evp/digest.c
++++ openssl-1.0.2/crypto/evp/digest.c
+@@ -208,7 +208,7 @@ int EVP_DigestInit_ex(EVP_MD_CTX *ctx, c
+ return 0;
+ }
+ #endif
+- if (ctx->digest != type) {
++ if (type && (ctx->digest != type)) {
+ if (ctx->digest && ctx->digest->ctx_size)
+ OPENSSL_free(ctx->md_data);
+ ctx->digest = type;
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/openssl-fix-des.pod-error.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/openssl-fix-des.pod-error.patch
new file mode 100644
index 000000000..de49729e5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/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/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/openssl_fix_for_x32.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/openssl_fix_for_x32.patch
new file mode 100644
index 000000000..cbce32c89
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/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/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/parallel.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/parallel.patch
new file mode 100644
index 000000000..b6c2c148b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/parallel.patch
@@ -0,0 +1,326 @@
+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>
+
+--- openssl-1.0.2g/crypto/Makefile
++++ openssl-1.0.2g/crypto/Makefile
+@@ -85,11 +85,11 @@
+ @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 @@
+ # 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 @@
+ fi
+
+ libs:
+- @target=lib; $(RECURSIVE_MAKE)
++ +@target=lib; $(RECURSIVE_MAKE)
+
+ install:
+ @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
+@@ -120,7 +120,7 @@
+ (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)
+--- openssl-1.0.2g/engines/Makefile
++++ openssl-1.0.2g/engines/Makefile
+@@ -72,7 +72,7 @@
+
+ all: lib subdirs
+
+-lib: $(LIBOBJ)
++lib: $(LIBOBJ) | subdirs
+ @if [ -n "$(SHARED_LIBS)" ]; then \
+ set -e; \
+ for l in $(LIBNAMES); do \
+@@ -89,7 +89,7 @@
+
+ subdirs:
+ echo $(EDIRS)
+- @target=all; $(RECURSIVE_MAKE)
++ +@target=all; $(RECURSIVE_MAKE)
+
+ files:
+ $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
+@@ -128,7 +128,7 @@
+ mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx ); \
+ done; \
+ fi
+- @target=install; $(RECURSIVE_MAKE)
++ +@target=install; $(RECURSIVE_MAKE)
+
+ tags:
+ ctags $(SRC)
+--- openssl-1.0.2g/Makefile.org
++++ openssl-1.0.2g/Makefile.org
+@@ -279,17 +279,17 @@
+ 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:
+@@ -544,7 +544,7 @@
+ (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 \
+--- openssl-1.0.2g/Makefile.shared
++++ openssl-1.0.2g/Makefile.shared
+@@ -105,6 +105,7 @@
+ SHAREDFLAGS="$${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 @@
+ 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; \
+--- openssl-1.0.2g/test/Makefile
++++ openssl-1.0.2g/test/Makefile
+@@ -139,7 +139,7 @@
+ tags:
+ ctags $(SRC)
+
+-tests: exe apps $(TESTS)
++tests: exe $(TESTS)
+
+ apps:
+ @(cd ..; $(MAKE) DIRS=apps all)
+@@ -421,130 +421,130 @@
+ 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)
+
+ $(SSLV2CONFTEST)$(EXE_EXT): $(SSLV2CONFTEST).o
+- @target=$(SSLV2CONFTEST) $(BUILD_CMD)
++ +@target=$(SSLV2CONFTEST) $(BUILD_CMD)
+
+ #$(AESTEST).o: $(AESTEST).c
+ # $(CC) -c $(CFLAGS) -DINTERMEDIATE_VALUE_KAT -DTRACE_KAT_MCT $(AESTEST).c
+@@ -557,7 +557,7 @@
+ # 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.
+ \ No newline at end of file
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/ptest-deps.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/ptest-deps.patch
new file mode 100644
index 000000000..ef6d17934
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/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/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/ptest_makefile_deps.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/ptest_makefile_deps.patch
new file mode 100644
index 000000000..4202e61d1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/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/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/run-ptest b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/run-ptest
new file mode 100755
index 000000000..3b20fce1e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+make -k runtest
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/shared-libs.patch b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/shared-libs.patch
new file mode 100644
index 000000000..a7ca0a307
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl/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/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl_1.0.2g.bb b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl_1.0.2g.bb
new file mode 100644
index 000000000..290f129fc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/openssl/openssl_1.0.2g.bb
@@ -0,0 +1,58 @@
+require openssl.inc
+
+# For target side versions of openssl enable support for OCF Linux driver
+# if they are available.
+DEPENDS += "cryptodev-linux"
+
+CFLAG += "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=27ffa5d74bb5a337056c14b2ef93fbf6"
+
+export DIRS = "crypto ssl apps engines"
+export OE_LDFLAGS="${LDFLAGS}"
+
+SRC_URI += "file://find.pl;subdir=${BP}/util/ \
+ file://run-ptest \
+ 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://openssl_fix_for_x32.patch \
+ file://fix-cipher-des-ede3-cfb1.patch \
+ file://openssl-avoid-NULL-pointer-dereference-in-EVP_DigestInit_ex.patch \
+ file://openssl-fix-des.pod-error.patch \
+ file://Makefiles-ptest.patch \
+ file://ptest-deps.patch \
+ file://crypto_use_bigint_in_x86-64_perl.patch \
+ file://openssl-1.0.2a-x32-asm.patch \
+ file://ptest_makefile_deps.patch \
+ file://configure-musl-target.patch \
+ file://parallel.patch \
+ "
+
+SRC_URI[md5sum] = "f3c710c045cdee5fd114feb69feba7aa"
+SRC_URI[sha256sum] = "b784b1b3907ce39abf4098702dade6365522a253ad1552e267a9a0e89594aa33"
+
+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/import-layers/yocto-poky/meta/recipes-connectivity/portmap/portmap.inc b/import-layers/yocto-poky/meta/recipes-connectivity/portmap/portmap.inc
new file mode 100644
index 000000000..338af33a3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/portmap/portmap.inc
@@ -0,0 +1,17 @@
+SUMMARY = "RPC program number mapper"
+HOMEPAGE = "http://neil.brown.name/portmap/"
+SECTION = "console/network"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://portmap.c;beginline=2;endline=31;md5=51ff67e66ec84b2009b017b1f94afbf4 \
+ file://from_local.c;beginline=9;endline=35;md5=1bec938a2268b8b423c58801ace3adc1"
+
+INITSCRIPT_NAME = "portmap"
+INITSCRIPT_PARAMS = "start 10 2 3 4 5 . stop 32 0 1 6 ."
+
+inherit update-rc.d systemd
+
+SYSTEMD_SERVICE_${PN} = "portmap.service"
+
+PACKAGES =+ "portmap-utils"
+FILES_portmap-utils = "${base_sbindir}/pmap_set ${base_sbindir}/pmap_dump"
+FILES_${PN}-doc += "${docdir}"
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/portmap/portmap/destdir-no-strip.patch b/import-layers/yocto-poky/meta/recipes-connectivity/portmap/portmap/destdir-no-strip.patch
new file mode 100644
index 000000000..2fbf784b7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/portmap/portmap/destdir-no-strip.patch
@@ -0,0 +1,46 @@
+Upstream-Status: Backport
+
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sun, 13 May 2007 21:15:12 +0000 (-0400)
+Subject: respect DESTDIR and dont use -s with install
+X-Git-Url: http://neil.brown.name/git?p=portmap;a=commitdiff_plain;h=603c59b978c04df2354f68d4a2dc676a758ff46d
+
+respect DESTDIR and dont use -s with install
+
+$(DESTDIR) is the standard for installing into other trees, not $(BASEDIR) ...
+so I've converted the Makefile to use that. I've also left in $(BASEDIR) as a
+default to support old installs; not sure if you'd just cut it.
+
+Stripping should be left to the person to handle, not automatically done by
+the install step. Also, `install -s` always calls `strip` which is
+wrong/undesired in cross-compiling scenarios.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+Signed-off-by: Neil Brown <neilb@suse.de>
+---
+
+diff --git a/Makefile b/Makefile
+index 9e9a4b4..5343428 100644
+--- a/Makefile
++++ b/Makefile
+@@ -135,13 +135,14 @@ from_local: CPPFLAGS += -DTEST
+ portmap.man : portmap.8
+ sed $(MAN_SED) < portmap.8 > portmap.man
+
++DESTDIR = $(BASEDIR)
+ install: all
+- install -o root -g root -m 0755 -s portmap ${BASEDIR}/sbin
+- install -o root -g root -m 0755 -s pmap_dump ${BASEDIR}/sbin
+- install -o root -g root -m 0755 -s pmap_set ${BASEDIR}/sbin
+- install -o root -g root -m 0644 portmap.man ${BASEDIR}/usr/share/man/man8/portmap.8
+- install -o root -g root -m 0644 pmap_dump.8 ${BASEDIR}/usr/share/man/man8
+- install -o root -g root -m 0644 pmap_set.8 ${BASEDIR}/usr/share/man/man8
++ install -o root -g root -m 0755 portmap $(DESTDIR)/sbin
++ install -o root -g root -m 0755 pmap_dump $(DESTDIR)/sbin
++ install -o root -g root -m 0755 pmap_set $(DESTDIR)/sbin
++ install -o root -g root -m 0644 portmap.man $(DESTDIR)/usr/share/man/man8/portmap.8
++ install -o root -g root -m 0644 pmap_dump.8 $(DESTDIR)/usr/share/man/man8
++ install -o root -g root -m 0644 pmap_set.8 $(DESTDIR)/usr/share/man/man8
+
+ clean:
+ rm -f *.o portmap pmap_dump pmap_set from_local \
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/portmap/portmap/portmap.init b/import-layers/yocto-poky/meta/recipes-connectivity/portmap/portmap/portmap.init
new file mode 100755
index 000000000..621aa171a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/portmap/portmap/portmap.init
@@ -0,0 +1,67 @@
+#!/bin/sh
+#
+### BEGIN INIT INFO
+# Provides: portmap
+# Required-Start: $network
+# Required-Stop: $network
+# Default-Start: S 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: The RPC portmapper
+# Description: Portmap 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
+
+test -f /sbin/portmap || exit 0
+
+case "$1" in
+ start)
+ echo "Starting portmap daemon..."
+ start-stop-daemon --start --quiet --exec /sbin/portmap
+
+ if [ -f /var/run/portmap.upgrade-state ]; then
+ echo "Restoring old RPC service information..."
+ sleep 1 # needs a short pause or pmap_set won't work. :(
+ pmap_set </var/run/portmap.upgrade-state
+ rm -f /var/run/portmap.upgrade-state
+ echo "done."
+ fi
+
+ ;;
+ stop)
+ echo "Stopping portmap daemon..."
+ start-stop-daemon --stop --quiet --exec /sbin/portmap
+ ;;
+ reload)
+ ;;
+ force-reload)
+ $0 restart
+ ;;
+ restart)
+ # pmap_dump and pmap_set may be in a different package and not installed...
+ if [ -f /sbin/pmap_dump -a -f /sbin/pmap_set ]; then
+ do_state=1
+ else
+ do_state=0
+ fi
+ [ $do_state -eq 1 ] && pmap_dump >/var/run/portmap.state
+ $0 stop
+ $0 start
+ if [ $do_state -eq 1 ]; then
+ if [ ! -f /var/run/portmap.upgrade-state ]; then
+ sleep 1
+ pmap_set </var/run/portmap.state
+ fi
+ rm -f /var/run/portmap.state
+ fi
+ ;;
+ *)
+ echo "Usage: /etc/init.d/portmap {start|stop|reload|restart}"
+ exit 1
+ ;;
+esac
+
+exit 0
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/portmap/portmap/portmap.service b/import-layers/yocto-poky/meta/recipes-connectivity/portmap/portmap/portmap.service
new file mode 100644
index 000000000..7ef9d7b02
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/portmap/portmap/portmap.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=The RPC portmapper
+After=network.target
+
+[Service]
+Type=forking
+ExecStart=@BASE_SBINDIR@/portmap
+
+[Install]
+WantedBy=multi-user.target
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/portmap/portmap/tcpd-config.patch b/import-layers/yocto-poky/meta/recipes-connectivity/portmap/portmap/tcpd-config.patch
new file mode 100644
index 000000000..2f2505809
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/portmap/portmap/tcpd-config.patch
@@ -0,0 +1,30 @@
+Upstream-Status: Backport
+
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sun, 13 May 2007 21:17:32 +0000 (-0400)
+Subject: fix building with tcpd support disabled
+X-Git-Url: http://neil.brown.name/git?p=portmap;a=commitdiff_plain;h=7847207aed1b44faf077eed14a9ac9c68244eba5
+
+fix building with tcpd support disabled
+
+Make sure pmap_check.c only includes tcpd.h when HOSTS_ACCESS is defined.
+
+Signed-off-by: Timothy Redaelli <drizzt@gentoo.org>
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+Signed-off-by: Neil Brown <neilb@suse.de>
+---
+
+diff --git a/pmap_check.c b/pmap_check.c
+index 84f2c12..443a822 100644
+--- a/pmap_check.c
++++ b/pmap_check.c
+@@ -44,7 +44,9 @@
+ #include <netinet/in.h>
+ #include <rpc/rpcent.h>
+ #endif
++#ifdef HOSTS_ACCESS
+ #include <tcpd.h>
++#endif
+ #include <arpa/inet.h>
+ #include <grp.h>
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/portmap/portmap_6.0.bb b/import-layers/yocto-poky/meta/recipes-connectivity/portmap/portmap_6.0.bb
new file mode 100644
index 000000000..999b4a937
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/portmap/portmap_6.0.bb
@@ -0,0 +1,35 @@
+require portmap.inc
+
+DEPENDS_append_libc-musl = " libtirpc "
+
+PR = "r9"
+
+SRC_URI = "http://www.sourcefiles.org/Networking/Tools/Miscellanenous/portmap-6.0.tgz \
+ file://destdir-no-strip.patch \
+ file://tcpd-config.patch \
+ file://portmap.init \
+ file://portmap.service"
+
+SRC_URI[md5sum] = "ac108ab68bf0f34477f8317791aaf1ff"
+SRC_URI[sha256sum] = "02c820d39f3e6e729d1bea3287a2d8a6c684f1006fb9612f97dcad4a281d41de"
+
+S = "${WORKDIR}/${BPN}_${PV}/"
+
+PACKAGECONFIG ??= "tcp-wrappers"
+PACKAGECONFIG[tcp-wrappers] = ",,tcp-wrappers"
+
+CPPFLAGS += "-DFACILITY=LOG_DAEMON -DENABLE_DNS -DHOSTS_ACCESS"
+CFLAGS += "-Wall -Wstrict-prototypes -fPIC"
+EXTRA_OEMAKE += "'NO_TCP_WRAPPER=${@bb.utils.contains('PACKAGECONFIG', 'tcp-wrappers', '', '1', d)}'"
+CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc "
+LDFLAGS_append_libc-musl = " -ltirpc "
+
+do_install() {
+ install -d ${D}${mandir}/man8/ ${D}${base_sbindir} ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/portmap.init ${D}${sysconfdir}/init.d/portmap
+ oe_runmake install DESTDIR=${D}
+
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/portmap.service ${D}${systemd_unitdir}/system
+ sed -i -e 's,@BASE_SBINDIR@,${base_sbindir},g' ${D}${systemd_unitdir}/system/portmap.service
+}
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/ppp-dialin/files/host-peer b/import-layers/yocto-poky/meta/recipes-connectivity/ppp-dialin/files/host-peer
new file mode 100644
index 000000000..e7e2e11d4
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/ppp-dialin/files/ppp-dialin b/import-layers/yocto-poky/meta/recipes-connectivity/ppp-dialin/files/ppp-dialin
new file mode 100644
index 000000000..ea2771311
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/ppp-dialin/files/ppp-dialin
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+/usr/sbin/pppd call host
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/ppp-dialin/ppp-dialin_0.1.bb b/import-layers/yocto-poky/meta/recipes-connectivity/ppp-dialin/ppp-dialin_0.1.bb
new file mode 100644
index 000000000..51a76b429
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/ppp-dialin/ppp-dialin_0.1.bb
@@ -0,0 +1,28 @@
+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}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+ 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/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/0001-Fix-build-with-musl.patch b/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/0001-Fix-build-with-musl.patch
new file mode 100644
index 000000000..763e37448
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/0001-ppp-Fix-compilation-errors-in-Makefile.patch b/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/0001-ppp-Fix-compilation-errors-in-Makefile.patch
new file mode 100644
index 000000000..8aa2d2e67
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/0001-ppp-Fix-compilation-errors-in-Makefile.patch
@@ -0,0 +1,75 @@
+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
+
+This patch fixes below issues:
+
+1. Make can't exit while compilation error occurs in subdir for plugins building.
+
+2. If build ppp with newer kernel (3.10.10), it will pick 'if_pppox.h' from sysroot-dir and
+ 'if_pppol2tp.h' from its own source dir, this cause below build errors:
+
+ bitbake_build/tmp/sysroots/intel-x86-64/usr/include/linux/if_pppox.h:84:26:
+ error: field 'pppol2tp' has incomplete type
+ struct pppol2tpin6_addr pppol2tp;
+ ^
+ bitbake_build/tmp/sysroots/intel-x86-64/usr/include/linux/if_pppox.h:99:28:
+ error: field 'pppol2tp' has incomplete type
+ struct pppol2tpv3in6_addr pppol2tp;
+ ^
+
+The 'sysroot-dir/if_pppox.h' enabled ipv6 support but the 'source-dir/if_pppol2tp.h' lost
+related structure definitions, we should use both header files from sysroots to fix this
+build failure.
+
+Upstream-Status: Pending
+
+Signed-off-by: Lu Chong <Chong.Lu@windriver.com>
+---
+ pppd/plugins/Makefile.linux | 2 +-
+ pppd/plugins/pppol2tp/Makefile.linux | 2 +-
+ pppd/plugins/rp-pppoe/Makefile.linux | 2 +-
+ 3 files changed, 3 insertions(+), 3 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) $^
+diff --git a/pppd/plugins/pppol2tp/Makefile.linux b/pppd/plugins/pppol2tp/Makefile.linux
+index 19eff67..feb2f52 100644
+--- a/pppd/plugins/pppol2tp/Makefile.linux
++++ b/pppd/plugins/pppol2tp/Makefile.linux
+@@ -1,6 +1,6 @@
+ #CC = gcc
+ COPTS = -O2 -g
+-CFLAGS = $(COPTS) -I. -I../.. -I../../../include -fPIC
++CFLAGS = $(COPTS) -I. -I../.. -fPIC
+ LDFLAGS = -shared
+ INSTALL = install
+
+diff --git a/pppd/plugins/rp-pppoe/Makefile.linux b/pppd/plugins/rp-pppoe/Makefile.linux
+index f078991..15b9118 100644
+--- a/pppd/plugins/rp-pppoe/Makefile.linux
++++ b/pppd/plugins/rp-pppoe/Makefile.linux
+@@ -26,7 +26,7 @@ INSTALL = install
+ RP_VERSION=3.8p
+
+ COPTS=-O2 -g
+-CFLAGS=$(COPTS) -I../../../include '-DRP_VERSION="$(RP_VERSION)"'
++CFLAGS=$(COPTS) '-DRP_VERSION="$(RP_VERSION)"'
+ all: rp-pppoe.so pppoe-discovery
+
+ pppoe-discovery: pppoe-discovery.o debug.o
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/08setupdns b/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/08setupdns
new file mode 100644
index 000000000..998219de9
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/92removedns b/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/92removedns
new file mode 100644
index 000000000..2eadec689
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/cifdefroute.patch b/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/cifdefroute.patch
new file mode 100644
index 000000000..db4dbc27a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/cifdefroute.patch
@@ -0,0 +1,292 @@
+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]
+
+diff -urN 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 16:40:00.478716855 +0800
+@@ -198,6 +198,16 @@
+ "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 @@
+ 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 *));
+
+@@ -1742,7 +1752,12 @@
+ 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))
+@@ -1830,7 +1845,8 @@
+ */
+ 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);
+@@ -1855,7 +1871,12 @@
+
+ /* 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. */
+@@ -1905,7 +1926,12 @@
+
+ /* 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. */
+@@ -1983,7 +2009,7 @@
+ 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 */
+@@ -1999,12 +2025,21 @@
+ * 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;
+ }
+diff -urN ppp-2.4.5-orig/pppd/ipcp.h ppp-2.4.5/pppd/ipcp.h
+--- ppp-2.4.5-orig/pppd/ipcp.h 2010-06-30 15:51:12.043682063 +0800
++++ ppp-2.4.5/pppd/ipcp.h 2010-06-30 16:40:49.586203129 +0800
+@@ -70,6 +70,7 @@
+ 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? */
+diff -urN ppp-2.4.5-orig/pppd/pppd.8 ppp-2.4.5/pppd/pppd.8
+--- ppp-2.4.5-orig/pppd/pppd.8 2010-06-30 15:51:12.043682063 +0800
++++ ppp-2.4.5/pppd/pppd.8 2010-06-30 16:42:47.102413859 +0800
+@@ -121,6 +121,13 @@
+ 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
+@@ -717,7 +724,12 @@
+ .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
+diff -urN ppp-2.4.5-orig/pppd/pppd.h ppp-2.4.5/pppd/pppd.h
+--- ppp-2.4.5-orig/pppd/pppd.h 2010-06-30 15:51:12.050166398 +0800
++++ ppp-2.4.5/pppd/pppd.h 2010-06-30 16:43:36.514148327 +0800
+@@ -643,7 +643,11 @@
+ 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 */
+diff -urN ppp-2.4.5-orig/pppd/sys-linux.c ppp-2.4.5/pppd/sys-linux.c
+--- ppp-2.4.5-orig/pppd/sys-linux.c 2010-06-30 15:51:12.050166398 +0800
++++ ppp-2.4.5/pppd/sys-linux.c 2010-06-30 16:54:00.362716231 +0800
+@@ -206,6 +206,8 @@
+
+ static int if_is_up; /* Interface has been marked up */
+ 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 */
+@@ -1537,6 +1539,9 @@
+ 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);
+@@ -1606,20 +1611,51 @@
+ /********************************************************************
+ *
+ * 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));
+@@ -1638,6 +1674,12 @@
+ 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;
+@@ -1673,6 +1715,16 @@
+ 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/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/copts.patch b/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/copts.patch
new file mode 100644
index 000000000..53ff06e03
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/fix-CVE-2015-3310.patch b/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/fix-CVE-2015-3310.patch
new file mode 100644
index 000000000..c5a0be86f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/init b/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/init
new file mode 100755
index 000000000..0c0136049
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/ip-down b/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/ip-down
new file mode 100755
index 000000000..06d35487a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/ip-up b/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/ip-up
new file mode 100755
index 000000000..fc2fae9fe
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/makefile-remove-hard-usr-reference.patch b/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/makefile-remove-hard-usr-reference.patch
new file mode 100644
index 000000000..d59717ebd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/makefile-remove-hard-usr-reference.patch
@@ -0,0 +1,37 @@
+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]
+
+diff -urN 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 17:08:21.806363042 +0800
+@@ -117,10 +117,10 @@
+ #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 NEEDDES
+ ifndef USE_CRYPT
+@@ -169,10 +169,10 @@
+ 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/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/makefile.patch b/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/makefile.patch
new file mode 100644
index 000000000..2d09baf5d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/pap b/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/pap
new file mode 100644
index 000000000..093c32607
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/poff b/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/poff
new file mode 100644
index 000000000..0521a9406
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/pon b/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/pon
new file mode 100644
index 000000000..91c059501
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/ppp@.service b/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/ppp@.service
new file mode 100644
index 000000000..2bf0b5e34
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/ppp_on_boot b/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/ppp_on_boot
new file mode 100644
index 000000000..979376184
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/pppd-resolv-varrun.patch b/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/pppd-resolv-varrun.patch
new file mode 100644
index 000000000..a72414ff8
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/provider b/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp/provider
new file mode 100644
index 000000000..e74d71a8e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp_2.4.7.bb b/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp_2.4.7.bb
new file mode 100644
index 000000000..4437b5c51
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/ppp/ppp_2.4.7.bb
@@ -0,0 +1,99 @@
+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 = "http://ppp.samba.org/ftp/ppp/ppp-${PV}.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 \
+"
+
+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/import-layers/yocto-poky/meta/recipes-connectivity/resolvconf/resolvconf/99_resolvconf b/import-layers/yocto-poky/meta/recipes-connectivity/resolvconf/resolvconf/99_resolvconf
new file mode 100644
index 000000000..3790d774a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/resolvconf/resolvconf/fix-path-for-busybox.patch b/import-layers/yocto-poky/meta/recipes-connectivity/resolvconf/resolvconf/fix-path-for-busybox.patch
new file mode 100644
index 000000000..1aead0786
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/resolvconf/resolvconf_1.78.bb b/import-layers/yocto-poky/meta/recipes-connectivity/resolvconf/resolvconf_1.78.bb
new file mode 100644
index 000000000..f4c58514a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/resolvconf/resolvconf_1.78.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/20150828T220730Z/pool/main/r/${BPN}/${BPN}_1.78.tar.xz \
+ file://fix-path-for-busybox.patch \
+ file://99_resolvconf \
+ "
+
+SRC_URI[md5sum] = "373a9f9544c84aa477a7425ae773b8b5"
+SRC_URI[sha256sum] = "961b22e8fcf0c7de7e90a050323e6fa221bc8b25a5348c160be3506f7e73a7a3"
+
+# 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/import-layers/yocto-poky/meta/recipes-connectivity/socat/socat/0001-Access-c_ispeed-and-c_ospeed-via-APIs.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/socat/socat/0001-define-NETDB_INTERNAL-to-1-if-not-available.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/socat/socat/Makefile.in-fix-for-parallel-build.patch b/import-layers/yocto-poky/meta/recipes-connectivity/socat/socat/Makefile.in-fix-for-parallel-build.patch
new file mode 100644
index 000000000..aa4db65a7
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/socat/socat_1.7.3.1.bb b/import-layers/yocto-poky/meta/recipes-connectivity/socat/socat_1.7.3.1.bb
new file mode 100644
index 000000000..6da9a17b3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/socat/socat_1.7.3.1.bb
@@ -0,0 +1,40 @@
+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] = "334e46924f2b386299c9db2ac22bcd36"
+SRC_URI[sha256sum] = "d2da659540c38139f388e9437bfaae16bb458d174d056cb3228432a8f489fbaa"
+
+inherit autotools
+
+EXTRA_AUTORECONF += "--exclude=autoheader"
+
+EXTRA_OECONF += "ac_cv_have_z_modifier=yes sc_cv_sys_crdly_shift=9 \
+ sc_cv_sys_tabdly_shift=11 sc_cv_sys_csize_shift=4 \
+ ac_cv_ispeed_offset=13 \
+ ac_cv_header_bsd_libutil_h=no \
+"
+
+PACKAGECONFIG ??= "tcp-wrappers"
+PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers"
+
+do_install_prepend () {
+ mkdir -p ${D}${bindir}
+ install -d ${D}${bindir} ${D}${mandir}/man1
+}
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/wireless-tools/wireless-tools/avoid_strip.patch b/import-layers/yocto-poky/meta/recipes-connectivity/wireless-tools/wireless-tools/avoid_strip.patch
new file mode 100644
index 000000000..f34e243de
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/wireless-tools/wireless-tools/ldflags.patch b/import-layers/yocto-poky/meta/recipes-connectivity/wireless-tools/wireless-tools/ldflags.patch
new file mode 100644
index 000000000..6c0d8cbd2
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/wireless-tools/wireless-tools/man.patch b/import-layers/yocto-poky/meta/recipes-connectivity/wireless-tools/wireless-tools/man.patch
new file mode 100644
index 000000000..6a757dae7
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/wireless-tools/wireless-tools/remove.ldconfig.call.patch b/import-layers/yocto-poky/meta/recipes-connectivity/wireless-tools/wireless-tools/remove.ldconfig.call.patch
new file mode 100644
index 000000000..3a22c3f1e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/wireless-tools/wireless-tools_30.pre9.bb b/import-layers/yocto-poky/meta/recipes-connectivity/wireless-tools/wireless-tools_30.pre9.bb
new file mode 100644
index 000000000..c3b8f665b
--- /dev/null
+++ b/import-layers/yocto-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 = "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/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 = "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/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 = "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/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/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/99_wpa_supplicant b/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/99_wpa_supplicant
new file mode 100644
index 000000000..6ff4dd882
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/defconfig b/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/defconfig
new file mode 100644
index 000000000..f04e398fd
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa-supplicant.sh b/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa-supplicant.sh
new file mode 100644
index 000000000..5c9e5d33a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa-supplicant.sh
@@ -0,0 +1,85 @@
+#!/bin/sh
+
+
+WPA_SUP_BIN="/usr/sbin/wpa_supplicant"
+WPA_SUP_PNAME="wpa_supplicant"
+WPA_SUP_PIDFILE="/var/run/wpa_supplicant.$IFACE.pid"
+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/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa_supplicant.conf b/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa_supplicant.conf
new file mode 100644
index 000000000..68258f5ee
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa_supplicant.conf-sane b/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa_supplicant.conf-sane
new file mode 100644
index 000000000..c91ffe0c8
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.5.bb b/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.5.bb
new file mode 100644
index 000000000..935c8afc9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.5.bb
@@ -0,0 +1,108 @@
+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=36b27801447e0662ee0138d17fe93880 \
+ file://README;beginline=1;endline=56;md5=7f393579f8b109fe91f3b9765d26c7d3 \
+ file://wpa_supplicant/wpa_supplicant.c;beginline=1;endline=12;md5=3430fda79f2ba1dd545f0b3c4d6e4d24"
+DEPENDS = "dbus libnl"
+RRECOMMENDS_${PN} = "wpa-supplicant-passphrase wpa-supplicant-cli"
+
+PACKAGECONFIG ??= "gnutls"
+PACKAGECONFIG[gnutls] = ",,gnutls libgcrypt"
+PACKAGECONFIG[openssl] = ",,openssl"
+
+inherit 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 \
+ "
+SRC_URI[md5sum] = "96ff75c3a514f1f324560a2376f13110"
+SRC_URI[sha256sum] = "cce55bae483b364eae55c35ba567c279be442ed8bab5b80a3c7fb0d057b9b316"
+
+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/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/filesystems b/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/filesystems
new file mode 100644
index 000000000..7e6c41c38
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/filesystems
@@ -0,0 +1,8 @@
+ext4
+ext3
+ext2
+vfat
+fat
+btrfs
+minix
+*
diff --git a/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/fstab b/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/fstab
new file mode 100644
index 000000000..d79a01602
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/host.conf b/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/host.conf
new file mode 100644
index 000000000..1a8c1e151
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/host.conf
@@ -0,0 +1,2 @@
+order hosts,bind
+multi on
diff --git a/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/issue b/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/issue
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/issue
diff --git a/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/issue.net b/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/issue.net
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/issue.net
diff --git a/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/licenses/GPL-2 b/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/licenses/GPL-2
new file mode 100644
index 000000000..d60c31a97
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/motd b/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/motd
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/motd
diff --git a/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/nsswitch.conf b/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/nsswitch.conf
new file mode 100644
index 000000000..06f03d22a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/profile b/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/profile
new file mode 100644
index 000000000..53c268040
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/profile
@@ -0,0 +1,36 @@
+# /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
+test -z "$TERM" && TERM="vt100" # Basic terminal capab. For screen etc.
+
+if [ ! -e /etc/localtime -a ! -e /etc/TZ ]; then
+ TZ="UTC" # Time Zone. Look at http://theory.uwinnipeg.ca/gnu/glibc/libc_303.html
+ # for an explanation of how to set this to your local timezone.
+ export TZ
+fi
+
+if [ "$HOME" = "ROOTHOME" ]; then
+ PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin
+fi
+if [ "$PS1" ]; then
+# works for bash and ash (no other shells known to be in use here)
+ PS1='\u@\h:\w\$ '
+fi
+
+if [ -d /etc/profile.d ]; then
+ for i in /etc/profile.d/* ; do
+ . $i
+ done
+ unset i
+fi
+
+if [ -x /usr/bin/resize ];then
+ /usr/bin/resize >/dev/null
+fi
+
+export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM
+
+umask 022
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/rotation b/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/rotation
new file mode 100644
index 000000000..c22708346
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/rotation
@@ -0,0 +1 @@
+0 \ No newline at end of file
diff --git a/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/share/dot.bashrc b/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/share/dot.bashrc
new file mode 100644
index 000000000..4be63686c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/share/dot.profile b/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/share/dot.profile
new file mode 100644
index 000000000..979793e8b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/share/dot.profile
@@ -0,0 +1,10 @@
+# ~/.profile: executed by Bourne-compatible login shells.
+
+if [ -f ~/.bashrc ]; then
+ . ~/.bashrc
+fi
+
+# path set by /etc/profile
+# export PATH
+
+mesg n
diff --git a/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/shells b/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/shells
new file mode 100644
index 000000000..3f639874d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/shells
@@ -0,0 +1,2 @@
+# /etc/shells: valid login shells
+/bin/sh
diff --git a/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/usbd b/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/usbd
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/base-files/base-files/usbd
diff --git a/import-layers/yocto-poky/meta/recipes-core/base-files/base-files_3.0.14.bb b/import-layers/yocto-poky/meta/recipes-core/base-files/base-files_3.0.14.bb
new file mode 100644
index 000000000..d39170737
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/base-files/base-files_3.0.14.bb
@@ -0,0 +1,180 @@
+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 = "/bin /boot /dev ${sysconfdir} ${sysconfdir}/default \
+ ${sysconfdir}/skel /lib /mnt /proc ${ROOT_HOME} /run /sbin \
+ ${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/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 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
+
+ if [ "/usr/bin" != "${bindir}" ]; then
+ sed -i "s,/usr/bin/resize,${bindir}/resize," ${D}${sysconfdir}/profile
+ fi
+
+ 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
+ printf "${DISTRO_VERSION} " >> ${D}${sysconfdir}/issue
+ printf "${DISTRO_VERSION} " >> ${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_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_stage_all_append () {
+ sysroot_stage_dir ${D}${sysconfdir}/skel ${SYSROOT_DESTDIR}${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', True) != '')]} ${sysconfdir}/shells"
+CONFFILES_${PN} += "${sysconfdir}/motd ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile"
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/base-passwd/base-passwd/add_shutdown.patch b/import-layers/yocto-poky/meta/recipes-core/base-passwd/base-passwd/add_shutdown.patch
new file mode 100644
index 000000000..5f357d889
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/base-passwd/base-passwd/disable-docs.patch b/import-layers/yocto-poky/meta/recipes-core/base-passwd/base-passwd/disable-docs.patch
new file mode 100644
index 000000000..14c08b748
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/base-passwd/base-passwd/input.patch b/import-layers/yocto-poky/meta/recipes-core/base-passwd/base-passwd/input.patch
new file mode 100644
index 000000000..3abbcad5d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/base-passwd/base-passwd/nobash.patch b/import-layers/yocto-poky/meta/recipes-core/base-passwd/base-passwd/nobash.patch
new file mode 100644
index 000000000..b5a692295
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/base-passwd/base-passwd/noshadow.patch b/import-layers/yocto-poky/meta/recipes-core/base-passwd/base-passwd/noshadow.patch
new file mode 100644
index 000000000..e27bf7d9b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb b/import-layers/yocto-poky/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
new file mode 100644
index 000000000..10457b2de
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
@@ -0,0 +1,108 @@
+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
+
+SSTATEPOSTINSTFUNCS += "base_passwd_sstate_postinst"
+
+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}/
+}
+
+base_passwd_sstate_postinst() {
+ if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
+ then
+ # Staging does not copy ${sysconfdir} files into the
+ # target sysroot, so we need to do so manually. We
+ # put these files in the target sysroot so they can
+ # be used by recipes which use custom user/group
+ # permissions.
+ # Install passwd.master and group.master to sysconfdir and mv
+ # them to make sure they are atomically install.
+ 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}/
+ mv ${STAGING_DIR_TARGET}${sysconfdir}/$i.master ${STAGING_DIR_TARGET}${sysconfdir}/$i
+ done
+ fi
+}
+
+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/import-layers/yocto-poky/meta/recipes-core/bsd-headers/bsd-headers.bb b/import-layers/yocto-poky/meta/recipes-core/bsd-headers/bsd-headers.bb
new file mode 100644
index 000000000..8f43d431d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/bsd-headers/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)
+
+DESCRIPTION = "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/import-layers/yocto-poky/meta/recipes-core/bsd-headers/bsd-headers/sys-cdefs.h b/import-layers/yocto-poky/meta/recipes-core/bsd-headers/bsd-headers/sys-cdefs.h
new file mode 100644
index 000000000..209a623c0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/bsd-headers/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/import-layers/yocto-poky/meta/recipes-core/bsd-headers/bsd-headers/sys-queue.h b/import-layers/yocto-poky/meta/recipes-core/bsd-headers/bsd-headers/sys-queue.h
new file mode 100644
index 000000000..99d01a55b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/bsd-headers/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/import-layers/yocto-poky/meta/recipes-core/bsd-headers/bsd-headers/sys-tree.h b/import-layers/yocto-poky/meta/recipes-core/bsd-headers/bsd-headers/sys-tree.h
new file mode 100644
index 000000000..eaea56aae
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/bsd-headers/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/import-layers/yocto-poky/meta/recipes-core/busybox/busybox.inc b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox.inc
new file mode 100644
index 000000000..5e91a263d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox.inc
@@ -0,0 +1,429 @@
+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}"
+
+# We don't want '-e MAKEFLAGS=' in EXTRA_OEMAKE
+EXTRA_OEMAKE = "CC='${CC}' LD='${CCLD}' V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y"
+
+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 = "busybox-syslog.service"
+
+CONFFILES_${PN}-syslog = "${sysconfdir}/syslog-startup.conf.${BPN}"
+CONFFILES_${PN}-mdev = "${sysconfdir}/mdev.conf"
+
+RRECOMMENDS_${PN} = "${PN}-syslog ${PN}-udhcpc"
+
+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(bb.utils.contains('DISTRO_FEATURES', 'largefile', True, False, d), 'CONFIG_LFS', cnf, rem)
+ busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'largefile', True, False, d), '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_uclibc_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 () {
+ 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
+}
+
+# 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 [ "${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
+ cp .config .config.orig
+ oe_runmake busybox.cfg.suid
+ oe_runmake busybox.cfg.nosuid
+ 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
+ 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
+ # 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_FEATURE_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_FEATURE_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.${BPN}
+ install -m 644 ${WORKDIR}/syslog-startup.conf ${D}${sysconfdir}/syslog-startup.conf.${BPN}
+ install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/syslog.conf.${BPN}
+ 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
+ if grep "CONFIG_FEATURE_USE_INITTAB=y" ${B}/.config; then
+ install -D -m 0777 ${WORKDIR}/inittab ${D}${sysconfdir}/inittab
+ tmp="${SERIAL_CONSOLES}"
+ for i in $tmp
+ do
+ j=`echo ${i} | sed s/\;/\ /g`
+ label=`echo ${i} | sed -e 's/tty//' -e 's/^.*;//' -e 's/;.*//'`
+ echo "tty$label::respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab
+ done
+ fi
+ 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
+ ln -sf /dev/null ${D}${systemd_unitdir}/system/syslog.service
+ 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.${BPN}
+ 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"
+
+ALTERNATIVE_${PN}-syslog += "syslog-conf"
+ALTERNATIVE_LINK_NAME[syslog-conf] = "${sysconfdir}/syslog.conf"
+
+python () {
+ if bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+ pn = d.getVar('PN', True)
+ d.appendVar('ALTERNATIVE_%s-syslog' % (pn), ' syslog-init')
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-init', '%s/init.d/syslog' % (d.getVar('sysconfdir', True)))
+ d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-init', '%s/init.d/syslog.%s' % (d.getVar('sysconfdir', True), d.getVar('BPN', True)))
+ d.appendVar('ALTERNATIVE_%s-syslog' % (pn), ' syslog-startup-conf')
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-startup-conf', '%s/syslog-startup.conf' % (d.getVar('sysconfdir', True)))
+ d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-startup-conf', '%s/syslog-startup.conf.%s' % (d.getVar('sysconfdir', True), d.getVar('BPN', True)))
+}
+
+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', True)
+ pn = d.getVar('PN', True)
+ 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
+}
+
+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_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
+}
diff --git a/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/0001-Use-CC-when-linking-instead-of-LD-and-use-CFLAGS-and.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/busybox-1.24.1-truncate-open-mode.patch b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/busybox-1.24.1-truncate-open-mode.patch
new file mode 100644
index 000000000..cdc91082b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/busybox-1.24.1-truncate-open-mode.patch
@@ -0,0 +1,81 @@
+Upstream-Status: Backport
+
+ http://busybox.net/downloads/fixes-1.24.1/
+ https://git.busybox.net/busybox/commit/?id=e111a1640494fe87fc913f94fae3bb805de0fc99
+ https://git.busybox.net/busybox/commit/?h=1_24_stable&id=be729c1d3b5c923f10871dd68ea94156d0f8c803
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+
+From be729c1d3b5c923f10871dd68ea94156d0f8c803 Mon Sep 17 00:00:00 2001
+From: Ari Sundholm <ari@tuxera.com>
+Date: Mon, 4 Jan 2016 15:40:37 +0200
+Subject: [PATCH] truncate: always set mode when opening file to avoid fortify
+ errors
+
+Busybox crashes due to no mode being given when opening:
+$ ./busybox truncate -s 1M foo
+*** invalid open64 call: O_CREAT without mode ***: ./busybox terminated
+======= Backtrace: =========
+/lib/x86_64-linux-gnu/libc.so.6(+0x7338f)[0x7f66d921338f]
+/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x5c)[0x7f66d92aac9c]
+/lib/x86_64-linux-gnu/libc.so.6(+0xeb6aa)[0x7f66d928b6aa]
+./busybox[0x4899f9]
+======= Memory map: ========
+00400000-004d0000 r-xp 00000000 00:1a 137559 /home/ari/busybox/busybox
+006cf000-006d0000 r--p 000cf000 00:1a 137559 /home/ari/busybox/busybox
+006d0000-006d1000 rw-p 000d0000 00:1a 137559 /home/ari/busybox/busybox
+006d1000-006d4000 rw-p 00000000 00:00 0
+014e7000-01508000 rw-p 00000000 00:00 0 [heap]
+7f66d8f8a000-7f66d8fa0000 r-xp 00000000 08:07 1579008 /lib/x86_64-linux-gnu/libgcc_s.so.1
+7f66d8fa0000-7f66d919f000 ---p 00016000 08:07 1579008 /lib/x86_64-linux-gnu/libgcc_s.so.1
+7f66d919f000-7f66d91a0000 rw-p 00015000 08:07 1579008 /lib/x86_64-linux-gnu/libgcc_s.so.1
+7f66d91a0000-7f66d935b000 r-xp 00000000 08:07 1578994 /lib/x86_64-linux-gnu/libc-2.19.so
+7f66d935b000-7f66d955a000 ---p 001bb000 08:07 1578994 /lib/x86_64-linux-gnu/libc-2.19.so
+7f66d955a000-7f66d955e000 r--p 001ba000 08:07 1578994 /lib/x86_64-linux-gnu/libc-2.19.so
+7f66d955e000-7f66d9560000 rw-p 001be000 08:07 1578994 /lib/x86_64-linux-gnu/libc-2.19.so
+7f66d9560000-7f66d9565000 rw-p 00000000 00:00 0
+7f66d9565000-7f66d966a000 r-xp 00000000 08:07 1579020 /lib/x86_64-linux-gnu/libm-2.19.so
+7f66d966a000-7f66d9869000 ---p 00105000 08:07 1579020 /lib/x86_64-linux-gnu/libm-2.19.so
+7f66d9869000-7f66d986a000 r--p 00104000 08:07 1579020 /lib/x86_64-linux-gnu/libm-2.19.so
+7f66d986a000-7f66d986b000 rw-p 00105000 08:07 1579020 /lib/x86_64-linux-gnu/libm-2.19.so
+7f66d986b000-7f66d988e000 r-xp 00000000 08:07 1578981 /lib/x86_64-linux-gnu/ld-2.19.so
+7f66d9a64000-7f66d9a67000 rw-p 00000000 00:00 0
+7f66d9a8a000-7f66d9a8d000 rw-p 00000000 00:00 0
+7f66d9a8d000-7f66d9a8e000 r--p 00022000 08:07 1578981 /lib/x86_64-linux-gnu/ld-2.19.so
+7f66d9a8e000-7f66d9a8f000 rw-p 00023000 08:07 1578981 /lib/x86_64-linux-gnu/ld-2.19.so
+7f66d9a8f000-7f66d9a90000 rw-p 00000000 00:00 0
+7ffc47761000-7ffc47782000 rw-p 00000000 00:00 0 [stack]
+7ffc477ab000-7ffc477ad000 r-xp 00000000 00:00 0 [vdso]
+ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
+Aborted (core dumped)
+$
+
+Fix this by simply always setting the mode, as it doesn't hurt even
+when O_CREAT is not specified.
+
+This bug is a regression introduced in fc3e40e, as xopen(), which
+was originally used, would automatically set the mode.
+
+Signed-off-by: Ari Sundholm <ari@tuxera.com>
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+(cherry picked from commit e111a1640494fe87fc913f94fae3bb805de0fc99)
+---
+ coreutils/truncate.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/coreutils/truncate.c b/coreutils/truncate.c
+index e5fa656..4c997bf 100644
+--- a/coreutils/truncate.c
++++ b/coreutils/truncate.c
+@@ -64,7 +64,7 @@ int truncate_main(int argc UNUSED_PARAM, char **argv)
+
+ argv += optind;
+ while (*argv) {
+- int fd = open(*argv, flags);
++ int fd = open(*argv, flags, 0666);
+ if (fd < 0) {
+ if (errno != ENOENT || !(opts & OPT_NOCREATE)) {
+ bb_perror_msg("%s: open", *argv);
+--
+2.6.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/busybox-1.24.1-unzip-regression.patch b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/busybox-1.24.1-unzip-regression.patch
new file mode 100644
index 000000000..e3c502091
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/busybox-1.24.1-unzip-regression.patch
@@ -0,0 +1,143 @@
+Upstream-Status: Backport
+
+ http://busybox.net/downloads/fixes-1.24.1/
+ http://git.busybox.net/busybox/commit/?id=092fabcf1df5d46cd22be4ffcd3b871f6180eb9c
+ http://git.busybox.net/busybox/commit/?h=1_24_stable&id=092fabcf1df5d46cd22be4ffcd3b871f6180eb9c
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+
+From 092fabcf1df5d46cd22be4ffcd3b871f6180eb9c Mon Sep 17 00:00:00 2001
+From: Denys Vlasenko <vda.linux@googlemail.com>
+Date: Fri, 30 Oct 2015 23:41:53 +0100
+Subject: [PATCH] [g]unzip: fix recent breakage.
+
+Also, do emit error message we so painstakingly pass from gzip internals
+
+Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
+(cherry picked from commit 6bd3fff51aa74e2ee2d87887b12182a3b09792ef)
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ archival/libarchive/decompress_gunzip.c | 33 +++++++++++++++++++++------------
+ testsuite/unzip.tests | 1 +
+ 2 files changed, 22 insertions(+), 12 deletions(-)
+
+diff --git a/archival/libarchive/decompress_gunzip.c b/archival/libarchive/decompress_gunzip.c
+index c76fd31..357c9bf 100644
+--- a/archival/libarchive/decompress_gunzip.c
++++ b/archival/libarchive/decompress_gunzip.c
+@@ -309,8 +309,7 @@ static int huft_build(const unsigned *b, const unsigned n,
+ huft_t *q; /* points to current table */
+ huft_t r; /* table entry for structure assignment */
+ huft_t *u[BMAX]; /* table stack */
+- unsigned v[N_MAX]; /* values in order of bit length */
+- unsigned v_end;
++ unsigned v[N_MAX + 1]; /* values in order of bit length. last v[] is never used */
+ int ws[BMAX + 1]; /* bits decoded stack */
+ int w; /* bits decoded */
+ unsigned x[BMAX + 1]; /* bit offsets, then code stack */
+@@ -365,15 +364,17 @@ static int huft_build(const unsigned *b, const unsigned n,
+ *xp++ = j;
+ }
+
+- /* Make a table of values in order of bit lengths */
++ /* Make a table of values in order of bit lengths.
++ * To detect bad input, unused v[i]'s are set to invalid value UINT_MAX.
++ * In particular, last v[i] is never filled and must not be accessed.
++ */
++ memset(v, 0xff, sizeof(v));
+ p = b;
+ i = 0;
+- v_end = 0;
+ do {
+ j = *p++;
+ if (j != 0) {
+ v[x[j]++] = i;
+- v_end = x[j];
+ }
+ } while (++i < n);
+
+@@ -435,7 +436,9 @@ static int huft_build(const unsigned *b, const unsigned n,
+
+ /* set up table entry in r */
+ r.b = (unsigned char) (k - w);
+- if (p >= v + v_end) { // Was "if (p >= v + n)" but v[] can be shorter!
++ if (/*p >= v + n || -- redundant, caught by the second check: */
++ *p == UINT_MAX /* do we access uninited v[i]? (see memset(v))*/
++ ) {
+ r.e = 99; /* out of values--invalid code */
+ } else if (*p < s) {
+ r.e = (unsigned char) (*p < 256 ? 16 : 15); /* 256 is EOB code */
+@@ -520,8 +523,9 @@ static NOINLINE int inflate_codes(STATE_PARAM_ONLY)
+ e = t->e;
+ if (e > 16)
+ do {
+- if (e == 99)
+- abort_unzip(PASS_STATE_ONLY);;
++ if (e == 99) {
++ abort_unzip(PASS_STATE_ONLY);
++ }
+ bb >>= t->b;
+ k -= t->b;
+ e -= 16;
+@@ -557,8 +561,9 @@ static NOINLINE int inflate_codes(STATE_PARAM_ONLY)
+ e = t->e;
+ if (e > 16)
+ do {
+- if (e == 99)
++ if (e == 99) {
+ abort_unzip(PASS_STATE_ONLY);
++ }
+ bb >>= t->b;
+ k -= t->b;
+ e -= 16;
+@@ -824,8 +829,9 @@ static int inflate_block(STATE_PARAM smallint *e)
+
+ b_dynamic >>= 4;
+ k_dynamic -= 4;
+- if (nl > 286 || nd > 30)
++ if (nl > 286 || nd > 30) {
+ abort_unzip(PASS_STATE_ONLY); /* bad lengths */
++ }
+
+ /* read in bit-length-code lengths */
+ for (j = 0; j < nb; j++) {
+@@ -906,12 +912,14 @@ static int inflate_block(STATE_PARAM smallint *e)
+ bl = lbits;
+
+ i = huft_build(ll, nl, 257, cplens, cplext, &inflate_codes_tl, &bl);
+- if (i != 0)
++ if (i != 0) {
+ abort_unzip(PASS_STATE_ONLY);
++ }
+ bd = dbits;
+ i = huft_build(ll + nl, nd, 0, cpdist, cpdext, &inflate_codes_td, &bd);
+- if (i != 0)
++ if (i != 0) {
+ abort_unzip(PASS_STATE_ONLY);
++ }
+
+ /* set up data for inflate_codes() */
+ inflate_codes_setup(PASS_STATE bl, bd);
+@@ -999,6 +1007,7 @@ inflate_unzip_internal(STATE_PARAM transformer_state_t *xstate)
+ error_msg = "corrupted data";
+ if (setjmp(error_jmp)) {
+ /* Error from deep inside zip machinery */
++ bb_error_msg(error_msg);
+ n = -1;
+ goto ret;
+ }
+diff --git a/testsuite/unzip.tests b/testsuite/unzip.tests
+index ca0a458..d8738a3 100755
+--- a/testsuite/unzip.tests
++++ b/testsuite/unzip.tests
+@@ -34,6 +34,7 @@ rm foo.zip
+ testing "unzip (bad archive)" "uudecode; unzip bad.zip 2>&1; echo \$?" \
+ "Archive: bad.zip
+ inflating: ]3j½r«IK-%Ix
++unzip: corrupted data
+ unzip: inflate error
+ 1
+ " \
+--
+2.6.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/busybox-1.24.1-unzip.patch b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/busybox-1.24.1-unzip.patch
new file mode 100644
index 000000000..718672695
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/busybox-1.24.1-unzip.patch
@@ -0,0 +1,118 @@
+Upstream-Status: Backport
+
+ http://busybox.net/downloads/fixes-1.24.1/
+ http://git.busybox.net/busybox/commit/?id=1de25a6e87e0e627aa34298105a3d17c60a1f44e
+ http://git.busybox.net/busybox/commit/?h=1_24_stable&id=6767af17f11144c7cd3cfe9ef799d7f89a78fe65
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+
+From 1de25a6e87e0e627aa34298105a3d17c60a1f44e Mon Sep 17 00:00:00 2001
+From: Denys Vlasenko <vda.linux@googlemail.com>
+Date: Mon, 26 Oct 2015 19:33:05 +0100
+Subject: [PATCH] unzip: test for bad archive SEGVing
+
+function old new delta
+huft_build 1296 1300 +4
+
+Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
+---
+ archival/libarchive/decompress_gunzip.c | 11 +++++++----
+ testsuite/unzip.tests | 23 ++++++++++++++++++++++-
+ 2 files changed, 29 insertions(+), 5 deletions(-)
+
+diff --git a/archival/libarchive/decompress_gunzip.c b/archival/libarchive/decompress_gunzip.c
+index 7b6f459..30bf451 100644
+--- a/archival/libarchive/decompress_gunzip.c
++++ b/archival/libarchive/decompress_gunzip.c
+@@ -305,11 +305,12 @@ static int huft_build(const unsigned *b, const unsigned n,
+ unsigned i; /* counter, current code */
+ unsigned j; /* counter */
+ int k; /* number of bits in current code */
+- unsigned *p; /* pointer into c[], b[], or v[] */
++ const unsigned *p; /* pointer into c[], b[], or v[] */
+ huft_t *q; /* points to current table */
+ huft_t r; /* table entry for structure assignment */
+ huft_t *u[BMAX]; /* table stack */
+ unsigned v[N_MAX]; /* values in order of bit length */
++ unsigned v_end;
+ int ws[BMAX + 1]; /* bits decoded stack */
+ int w; /* bits decoded */
+ unsigned x[BMAX + 1]; /* bit offsets, then code stack */
+@@ -324,7 +325,7 @@ static int huft_build(const unsigned *b, const unsigned n,
+
+ /* Generate counts for each bit length */
+ memset(c, 0, sizeof(c));
+- p = (unsigned *) b; /* cast allows us to reuse p for pointing to b */
++ p = b;
+ i = n;
+ do {
+ c[*p]++; /* assume all entries <= BMAX */
+@@ -365,12 +366,14 @@ static int huft_build(const unsigned *b, const unsigned n,
+ }
+
+ /* Make a table of values in order of bit lengths */
+- p = (unsigned *) b;
++ p = b;
+ i = 0;
++ v_end = 0;
+ do {
+ j = *p++;
+ if (j != 0) {
+ v[x[j]++] = i;
++ v_end = x[j];
+ }
+ } while (++i < n);
+
+@@ -432,7 +435,7 @@ static int huft_build(const unsigned *b, const unsigned n,
+
+ /* set up table entry in r */
+ r.b = (unsigned char) (k - w);
+- if (p >= v + n) {
++ if (p >= v + v_end) { // Was "if (p >= v + n)" but v[] can be shorter!
+ r.e = 99; /* out of values--invalid code */
+ } else if (*p < s) {
+ r.e = (unsigned char) (*p < 256 ? 16 : 15); /* 256 is EOB code */
+diff --git a/testsuite/unzip.tests b/testsuite/unzip.tests
+index 8677a03..ca0a458 100755
+--- a/testsuite/unzip.tests
++++ b/testsuite/unzip.tests
+@@ -7,7 +7,7 @@
+
+ . ./testing.sh
+
+-# testing "test name" "options" "expected result" "file input" "stdin"
++# testing "test name" "commands" "expected result" "file input" "stdin"
+ # file input will be file called "input"
+ # test can create a file "actual" instead of writing to stdout
+
+@@ -30,6 +30,27 @@ testing "unzip (subdir only)" "unzip -q foo.zip foo/ && test -d foo && test ! -f
+ rmdir foo
+ rm foo.zip
+
++# File containing some damaged encrypted stream
++testing "unzip (bad archive)" "uudecode; unzip bad.zip 2>&1; echo \$?" \
++"Archive: bad.zip
++ inflating: ]3j½r«IK-%Ix
++unzip: inflate error
++1
++" \
++"" "\
++begin-base64 644 bad.zip
++UEsDBBQAAgkIAAAAIQA5AAAANwAAADwAAAAQAAcAXTNqwr1ywqtJGxJLLSVJ
++eCkBD0AdKBk8JzQsIj01JC0/ORJQSwMEFAECCAAAAAAhADoAAAAPAAAANgAA
++AAwAAQASw73Ct1DCokohPXQiNjoUNTUiHRwgLT4WHlBLAQIQABQAAggIAAAA
++oQA5AAAANwAAADwAAAAQQAcADAAAACwAMgCAAAAAAABdM2rCvXLCq0kbEkst
++JUl4KQEPQB0oGSY4Cz4QNgEnJSYIPVBLAQIAABQAAggAAAAAIQAqAAAADwAA
++BDYAAAAMAAEADQAAADIADQAAAEEAAAASw73Ct1DKokohPXQiNzA+FAI1HCcW
++NzITNFBLBQUKAC4JAA04Cw0EOhZQSwUGAQAABAIAAgCZAAAAeQAAAAIALhM=
++====
++"
++
++rm *
++
+ # Clean up scratch directory.
+
+ cd ..
+--
+2.6.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/busybox-cross-menuconfig.patch b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/busybox-cross-menuconfig.patch
new file mode 100644
index 000000000..bda86859d
--- /dev/null
+++ b/import-layers/yocto-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
+ for ext in so a dylib ; do
+ for lib in ncursesw ncurses curses ; do
+ $cc -print-file-name=lib${lib}.${ext} | grep -q /
+@@ -19,6 +23,10 @@ ldflags()
+ # Where is ncurses.h?
+ ccflags()
+ {
++ if [ x"$CROSS_CURSES_INC" != x ]; then
++ echo "$CROSS_CURSES_INC"
++ exit
++ fi
+ if [ -f /usr/include/ncursesw/ncurses.h ]; then
+ echo '-I/usr/include/ncursesw -DCURSES_LOC="<ncurses.h>"'
+ elif [ -f /usr/include/ncursesw/curses.h ]; then
+--- a/scripts/kconfig/lxdialog/Makefile
++++ b/scripts/kconfig/lxdialog/Makefile
+@@ -5,7 +5,7 @@ check-lxdialog := $(srctree)/$(src)/che
+
+ # 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/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch
new file mode 100644
index 000000000..4c9ce3b71
--- /dev/null
+++ b/import-layers/yocto-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 files changed, 21 insertions(+), 8 deletions(-)
+
+Index: busybox-1.20.2/networking/udhcp/dhcpc.c
+===================================================================
+--- busybox-1.20.2.orig/networking/udhcp/dhcpc.c
++++ busybox-1.20.2/networking/udhcp/dhcpc.c
+@@ -29,6 +29,9 @@
+ #include <netpacket/packet.h>
+ #include <linux/filter.h>
+
++/* option whether to down the interface when reconfiguring */
++static int allow_deconfig = 1;
++
+ /* "struct client_config_t client_config" is in bb_common_bufsiz1 */
+
+
+@@ -81,8 +84,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,)
+@@ -1040,7 +1044,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);
+@@ -1064,7 +1069,8 @@ static void perform_release(uint32_t ser
+ bb_info_msg("Unicasting a release of %s to %s",
+ inet_ntoa(temp_addr), buffer);
+ send_release(server_addr, requested_ip); /* unicast */
+- udhcp_run_script(NULL, "deconfig");
++ if (allow_deconfig)
++ udhcp_run_script(NULL, "deconfig");
+ }
+ bb_info_msg("Entering released state");
+
+@@ -1215,7 +1221,7 @@ int udhcpc_main(int argc UNUSED_PARAM, c
+ /* O,x: list; -T,-t,-A take numeric param */
+ opt_complementary = "O::x::T+:t+:A+" IF_UDHCP_VERBOSE(":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:")
+@@ -1316,6 +1322,9 @@ int udhcpc_main(int argc UNUSED_PARAM, c
+ 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 */
+@@ -1330,7 +1339,8 @@ int udhcpc_main(int argc UNUSED_PARAM, c
+ 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;
+@@ -1484,7 +1494,8 @@ int udhcpc_main(int argc UNUSED_PARAM, c
+ }
+ /* Timed out, enter init state */
+ bb_info_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 */
+@@ -1667,7 +1678,8 @@ int udhcpc_main(int argc UNUSED_PARAM, c
+ 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 */
+@@ -1711,7 +1723,8 @@ int udhcpc_main(int argc UNUSED_PARAM, c
+ bb_info_msg("Received 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/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/defconfig b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/defconfig
new file mode 100644
index 000000000..ffea6be87
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/defconfig
@@ -0,0 +1,1069 @@
+#
+# Automatically generated make config: don't edit
+# Busybox version: 1.24.1
+# Tue Oct 31 11:00:00 2015
+#
+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 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_PAM is not set
+CONFIG_FEATURE_USE_SENDFILE=y
+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
+
+#
+# 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=""
+
+#
+# Debugging Options
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PESSIMIZE 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
+
+#
+# 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_SMALL=1
+CONFIG_SHA3_SMALL=1
+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_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_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=y
+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_UNCOMPRESS is not set
+CONFIG_GUNZIP=y
+CONFIG_BUNZIP2=y
+# 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_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_GZIP=y
+# CONFIG_FEATURE_GZIP_LONG_OPTIONS is not set
+CONFIG_GZIP_FAST=0
+# CONFIG_FEATURE_GZIP_LEVELS is not set
+# CONFIG_LZOP 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_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=y
+# CONFIG_FEATURE_TAR_SELINUX 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_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_HOSTID is not set
+CONFIG_ID=y
+CONFIG_GROUPS=y
+CONFIG_SHUF=y
+CONFIG_SYNC=y
+# CONFIG_FEATURE_SYNC_FANCY is not set
+CONFIG_TEST=y
+CONFIG_FEATURE_TEST_64=y
+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_TRUNCATE is not set
+CONFIG_UNLINK=y
+# 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_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_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_SHA3SUM 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=y
+CONFIG_FEATURE_STAT_FORMAT=y
+CONFIG_STTY=y
+# CONFIG_SUM 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_TRUE=y
+CONFIG_TTY=y
+CONFIG_UNAME=y
+CONFIG_UNAME_OSNAME="GNU/Linux"
+# 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
+#
+CONFIG_FEATURE_VERBOSE=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, sha3sum
+#
+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_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_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
+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_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=y
+# 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_LAST_ID=60000
+CONFIG_FIRST_SYSTEM_ID=100
+CONFIG_LAST_SYSTEM_ID=999
+# 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_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_CRYPTPW is not set
+# CONFIG_CHPASSWD is not set
+CONFIG_FEATURE_DEFAULT_PASSWD_ALGO=""
+# 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=y
+
+#
+# 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_FATATTR is not set
+CONFIG_FSTRIM=y
+# 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_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_REV is not set
+# CONFIG_UEVENT 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 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_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_MKSWAP=y
+# CONFIG_FEATURE_MKSWAP_UUID is not set
+CONFIG_MORE=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_DISCARD=y
+CONFIG_FEATURE_SWAPON_PRI=y
+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_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_UDF is not set
+# CONFIG_FEATURE_VOLUMEID_XFS is not set
+
+#
+# Miscellaneous Utilities
+#
+# 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_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_NANDWRITE is not set
+# CONFIG_NANDDUMP is not set
+CONFIG_RFKILL=y
+# CONFIG_SETSERIAL is not set
+# CONFIG_TASKSET is not set
+# CONFIG_FEATURE_TASKSET_FANCY 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_WALL 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_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_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_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_WGET=y
+CONFIG_FEATURE_WGET_STATUSBAR=y
+CONFIG_FEATURE_WGET_AUTHENTICATION=y
+CONFIG_FEATURE_WGET_LONG_OPTIONS=y
+CONFIG_FEATURE_WGET_TIMEOUT=y
+# CONFIG_FEATURE_WGET_OPENSSL is not set
+# CONFIG_FEATURE_WGET_SSL_HELPER is not set
+# 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_FEATURE_FTP_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_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_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=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_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_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_FEATURE_NTPD_CONF 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_UDHCPC6 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_UDHCPC_SANITIZEOPT=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_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_LSOF 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_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_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_LONG=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_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_HELP=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 is not set
+# 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=64
+CONFIG_LOGREAD=y
+CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING=y
+CONFIG_FEATURE_KMSG_SYSLOG=y
+CONFIG_KLOGD=y
+
+#
+# klogd should not be used together with syslog to kernel printk buffer
+#
+CONFIG_FEATURE_KLOGD_KLOGCTL=y
+CONFIG_LOGGER=y
diff --git a/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/fail_on_no_media.patch b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/fail_on_no_media.patch
new file mode 100644
index 000000000..820acc268
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/getopts.cfg b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/getopts.cfg
new file mode 100644
index 000000000..8db0a4a8f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/init.cfg b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/init.cfg
new file mode 100644
index 000000000..006d4c633
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/init.cfg
@@ -0,0 +1,3 @@
+CONFIG_INIT=y
+CONFIG_FEATURE_USE_INITTAB=y
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/login-utilities.cfg b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/login-utilities.cfg
new file mode 100644
index 000000000..cc9b2db50
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/mdev.cfg b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/mdev.cfg
new file mode 100644
index 000000000..6aefe90e4
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/mount-via-label.cfg b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/mount-via-label.cfg
new file mode 100644
index 000000000..2fe7ab2e5
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/musl.cfg b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/musl.cfg
new file mode 100644
index 000000000..facfe8544
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/musl.cfg
@@ -0,0 +1,12 @@
+# 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_SYSTEMD 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/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/recognize_connmand.patch b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/recognize_connmand.patch
new file mode 100644
index 000000000..f42c74caa
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/resize.cfg b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/resize.cfg
new file mode 100644
index 000000000..a1d9c95b2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/resize.cfg
@@ -0,0 +1,2 @@
+CONFIG_RESIZE=y
+CONFIG_FEATURE_RESIZE_PRINT=y
diff --git a/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/sha1sum.cfg b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/sha1sum.cfg
new file mode 100644
index 000000000..20e72d926
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/sha1sum.cfg
@@ -0,0 +1 @@
+CONFIG_SHA1SUM=y
diff --git a/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/sha256sum.cfg b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/sha256sum.cfg
new file mode 100644
index 000000000..ce652ae4c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox/sha256sum.cfg
@@ -0,0 +1 @@
+CONFIG_SHA256SUM=y
diff --git a/import-layers/yocto-poky/meta/recipes-core/busybox/busybox_1.24.1.bb b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox_1.24.1.bb
new file mode 100644
index 000000000..bdaa5a564
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox_1.24.1.bb
@@ -0,0 +1,50 @@
+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://busybox-1.24.1-unzip.patch \
+ file://busybox-1.24.1-unzip-regression.patch \
+ file://busybox-1.24.1-truncate-open-mode.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', True) == 'busybox')]} \
+ ${@["", "file://mdev.cfg"][(d.getVar('VIRTUAL-RUNTIME_dev_manager', True) == 'busybox-mdev')]} \
+ file://inittab \
+ file://rcS \
+ file://rcK \
+ file://runlevel \
+"
+SRC_URI_append_libc-musl = " file://musl.cfg "
+
+SRC_URI[tarball.md5sum] = "be98a40cadf84ce2d6b05fa41a275c6a"
+SRC_URI[tarball.sha256sum] = "37d03132cc078937360b392170b7a1d0e5b322eee9f57c0b82292a8b1f0afe3d"
diff --git a/import-layers/yocto-poky/meta/recipes-core/busybox/busybox_git.bb b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox_git.bb
new file mode 100644
index 000000000..c29b89434
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/busybox/busybox_git.bb
@@ -0,0 +1,52 @@
+require busybox.inc
+
+SRCREV = "1b7c17391de66502dd7a97c866e0a33681edbb1f"
+# Lookout for PV bump too when SRCREV is changed
+PV = "1.25.0+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+SRC_URI = "git://busybox.net/busybox.git \
+ 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', True) == 'busybox')]} \
+ ${@["", "file://mdev.cfg"][(d.getVar('VIRTUAL-RUNTIME_dev_manager', True) == 'busybox-mdev')]} \
+ file://inittab \
+ file://rcS \
+ file://rcK \
+ file://runlevel \
+"
+SRC_URI_append_libc-musl = " file://musl.cfg "
+
+DEFAULT_PREFERENCE = "-1"
diff --git a/import-layers/yocto-poky/meta/recipes-core/busybox/files/busybox-cron b/import-layers/yocto-poky/meta/recipes-core/busybox/files/busybox-cron
new file mode 100755
index 000000000..f0e6b1562
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/busybox/files/busybox-httpd b/import-layers/yocto-poky/meta/recipes-core/busybox/files/busybox-httpd
new file mode 100755
index 000000000..c8348e54a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/busybox/files/busybox-klogd.service.in b/import-layers/yocto-poky/meta/recipes-core/busybox/files/busybox-klogd.service.in
new file mode 100644
index 000000000..d7c77558f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/busybox/files/busybox-syslog.default b/import-layers/yocto-poky/meta/recipes-core/busybox/files/busybox-syslog.default
new file mode 100644
index 000000000..e516caf51
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/busybox/files/busybox-syslog.service.in b/import-layers/yocto-poky/meta/recipes-core/busybox/files/busybox-syslog.service.in
new file mode 100644
index 000000000..2e0432138
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/busybox/files/busybox-udhcpd b/import-layers/yocto-poky/meta/recipes-core/busybox/files/busybox-udhcpd
new file mode 100755
index 000000000..c43903e8d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/busybox/files/default.script b/import-layers/yocto-poky/meta/recipes-core/busybox/files/default.script
new file mode 100644
index 000000000..f2ac987a2
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/busybox/files/find-touchscreen.sh b/import-layers/yocto-poky/meta/recipes-core/busybox/files/find-touchscreen.sh
new file mode 100644
index 000000000..52c5e7a09
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/busybox/files/hwclock.sh b/import-layers/yocto-poky/meta/recipes-core/busybox/files/hwclock.sh
new file mode 100644
index 000000000..be5f94d86
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/busybox/files/inetd b/import-layers/yocto-poky/meta/recipes-core/busybox/files/inetd
new file mode 100644
index 000000000..cf50bcd54
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/busybox/files/inetd.conf b/import-layers/yocto-poky/meta/recipes-core/busybox/files/inetd.conf
new file mode 100644
index 000000000..b02fe850c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/busybox/files/inittab b/import-layers/yocto-poky/meta/recipes-core/busybox/files/inittab
new file mode 100644
index 000000000..bfec4a774
--- /dev/null
+++ b/import-layers/yocto-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
+null::sysinit:/bin/mount -t proc proc /proc
+null::sysinit:/bin/mount -t sysfs sysfs /sys
+null::sysinit:/bin/mount -t devtmpfs devtmpfs /dev
+null::sysinit:/bin/mount -o remount,rw /
+null::sysinit:/bin/mkdir -p /dev/pts
+null::sysinit:/bin/mount -t devpts devpts /dev/pts
+null::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/import-layers/yocto-poky/meta/recipes-core/busybox/files/mdev b/import-layers/yocto-poky/meta/recipes-core/busybox/files/mdev
new file mode 100755
index 000000000..96252477e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/busybox/files/mdev
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+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
+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/import-layers/yocto-poky/meta/recipes-core/busybox/files/mdev-mount.sh b/import-layers/yocto-poky/meta/recipes-core/busybox/files/mdev-mount.sh
new file mode 100644
index 000000000..b4385a157
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/busybox/files/mdev.conf b/import-layers/yocto-poky/meta/recipes-core/busybox/files/mdev.conf
new file mode 100644
index 000000000..17e93da7c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/busybox/files/mdev.conf
@@ -0,0 +1,42 @@
+$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].* 0:0 660 */etc/mdev/mdev-mount.sh
diff --git a/import-layers/yocto-poky/meta/recipes-core/busybox/files/mount.busybox b/import-layers/yocto-poky/meta/recipes-core/busybox/files/mount.busybox
new file mode 100755
index 000000000..fef945b7b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/busybox/files/mount.busybox
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /bin/busybox mount $@
diff --git a/import-layers/yocto-poky/meta/recipes-core/busybox/files/rcK b/import-layers/yocto-poky/meta/recipes-core/busybox/files/rcK
new file mode 100644
index 000000000..f8a63e132
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/busybox/files/rcS b/import-layers/yocto-poky/meta/recipes-core/busybox/files/rcS
new file mode 100644
index 000000000..bb03eb608
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/busybox/files/run-ptest b/import-layers/yocto-poky/meta/recipes-core/busybox/files/run-ptest
new file mode 100644
index 000000000..3608a8eb6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/busybox/files/runlevel b/import-layers/yocto-poky/meta/recipes-core/busybox/files/runlevel
new file mode 100644
index 000000000..866f3b594
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/busybox/files/simple.script b/import-layers/yocto-poky/meta/recipes-core/busybox/files/simple.script
new file mode 100644
index 000000000..6ed029352
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/busybox/files/syslog b/import-layers/yocto-poky/meta/recipes-core/busybox/files/syslog
new file mode 100644
index 000000000..89c4d12e9
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/busybox/files/syslog-startup.conf b/import-layers/yocto-poky/meta/recipes-core/busybox/files/syslog-startup.conf
new file mode 100644
index 000000000..fda450aa0
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/busybox/files/syslog.conf b/import-layers/yocto-poky/meta/recipes-core/busybox/files/syslog.conf
new file mode 100644
index 000000000..75bb6309a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/busybox/files/syslog.conf
@@ -0,0 +1 @@
+# /etc/syslog.conf Configuration file for busybox's syslogd utility
diff --git a/import-layers/yocto-poky/meta/recipes-core/busybox/files/umount.busybox b/import-layers/yocto-poky/meta/recipes-core/busybox/files/umount.busybox
new file mode 100755
index 000000000..f3731626e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/busybox/files/umount.busybox
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /bin/busybox umount $@
diff --git a/import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/0001-Cover-the-else-with-__GLIBC__.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/Makevars b/import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/Makevars
new file mode 100644
index 000000000..32692ab4b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/codepage.patch b/import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/codepage.patch
new file mode 100644
index 000000000..c28701476
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/compile.patch b/import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/compile.patch
new file mode 100644
index 000000000..c93f51195
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/configure.patch b/import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/configure.patch
new file mode 100644
index 000000000..15c100c90
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/fix-libconsole-linking.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/kbdrate.patch b/import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/kbdrate.patch
new file mode 100644
index 000000000..f370be859
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/lcmessage.m4 b/import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/lcmessage.m4
new file mode 100644
index 000000000..18d47a94f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/no-dep-on-libfl.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/nodocs.patch b/import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/nodocs.patch
new file mode 100644
index 000000000..2ed609219
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/uclibc-fileno.patch b/import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools-0.3.2/uclibc-fileno.patch
new file mode 100644
index 000000000..0c95068a3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools_0.3.2.bb b/import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools_0.3.2.bb
new file mode 100644
index 000000000..1db8414cb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/console-tools/console-tools_0.3.2.bb
@@ -0,0 +1,44 @@
+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://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/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-6.9-cp-i-u.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-6.9-cp-i-u.patch
new file mode 100644
index 000000000..5452b46bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-6.9-cp-i-u.patch
@@ -0,0 +1,120 @@
+Upstream-Status: Inappropriate [legacy version]
+
+This patch was imported from the Fedora Core 8 coreutils-6.9-9 package.
+
+The package is stated as being Licensed as GPLv2+.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+----
+
+When "cp -i --update old new" would do nothing because "new" is
+newer than "old", cp would nonetheless prompt for whether it is
+ok to overwrite "new". Then, regardless of the response (because
+of the --update option), cp would do nothing.
+
+The following patch eliminates the unnecessary prompt in that case.
+
+diff --git a/src/copy.c b/src/copy.c
+index b7bf73b..0e549d2 100644
+--- a/src/copy.c
++++ b/src/copy.c
+@@ -1210,6 +1210,30 @@ copy_internal (char const *src_name, char const *dst_name,
+ return false;
+ }
+
++ if (!S_ISDIR (src_mode) && x->update)
++ {
++ /* When preserving time stamps (but not moving within a file
++ system), don't worry if the destination time stamp is
++ less than the source merely because of time stamp
++ truncation. */
++ int options = ((x->preserve_timestamps
++ && ! (x->move_mode
++ && dst_sb.st_dev == src_sb.st_dev))
++ ? UTIMECMP_TRUNCATE_SOURCE
++ : 0);
++
++ if (0 <= utimecmp (dst_name, &dst_sb, &src_sb, options))
++ {
++ /* We're using --update and the destination is not older
++ than the source, so do not copy or move. Pretend the
++ rename succeeded, so the caller (if it's mv) doesn't
++ end up removing the source file. */
++ if (rename_succeeded)
++ *rename_succeeded = true;
++ return true;
++ }
++ }
++
+ /* When there is an existing destination file, we may end up
+ returning early, and hence not copying/moving the file.
+ This may be due to an interactive `negative' reply to the
+@@ -1302,30 +1326,6 @@ copy_internal (char const *src_name, char const *dst_name,
+ return false;
+ }
+ }
+-
+- if (x->update)
+- {
+- /* When preserving time stamps (but not moving within a file
+- system), don't worry if the destination time stamp is
+- less than the source merely because of time stamp
+- truncation. */
+- int options = ((x->preserve_timestamps
+- && ! (x->move_mode
+- && dst_sb.st_dev == src_sb.st_dev))
+- ? UTIMECMP_TRUNCATE_SOURCE
+- : 0);
+-
+- if (0 <= utimecmp (dst_name, &dst_sb, &src_sb, options))
+- {
+- /* We're using --update and the destination is not older
+- than the source, so do not copy or move. Pretend the
+- rename succeeded, so the caller (if it's mv) doesn't
+- end up removing the source file. */
+- if (rename_succeeded)
+- *rename_succeeded = true;
+- return true;
+- }
+- }
+ }
+
+ if (x->move_mode)
+diff --git a/tests/mv/update b/tests/mv/update
+index 0c06024..6c3d149 100755
+--- a/tests/mv/update
++++ b/tests/mv/update
+@@ -1,7 +1,7 @@
+ #!/bin/sh
+ # make sure --update works as advertised
+
+-# Copyright (C) 2001, 2004, 2006 Free Software Foundation, Inc.
++# Copyright (C) 2001, 2004, 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
+@@ -46,11 +46,16 @@ fi
+
+ fail=0
+
+-for cp_or_mv in cp mv; do
+- # This is a no-op.
+- $cp_or_mv --update old new || fail=1
+- case "`cat new`" in new) ;; *) fail=1 ;; esac
+- case "`cat old`" in old) ;; *) fail=1 ;; esac
++for interactive in '' -i; do
++ for cp_or_mv in cp mv; do
++ # This is a no-op, with no prompt.
++ # With coreutils-6.9 and earlier, using --update with -i would
++ # mistakenly elicit a prompt.
++ $cp_or_mv $interactive --update old new < /dev/null > out 2>&1 || fail=1
++ test -s out && fail=1
++ case "`cat new`" in new) ;; *) fail=1 ;; esac
++ case "`cat old`" in old) ;; *) fail=1 ;; esac
++ done
+ done
+
+ # This will actually perform the rename.
+--
+1.5.3.rc1.16.g9d6f
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-install.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-install.patch
new file mode 100644
index 000000000..88f61fa10
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-install.patch
@@ -0,0 +1,101 @@
+Upstream-Status: Inappropriate [legacy version]
+
+The install command doesn't over write the dangling symlink, for
+example:
+
+$ install fileA /tmp/fileA
+
+If /tmp/fileA is a dangling symlink, there would be an error:
+
+install: cannot create regular file '/tmp/fileA': File exists
+
+This is because of the following code in copy.c:
+
+ if (!new_dst)
+ {
+ if (XSTAT (x, dst_name, &dst_sb) != 0)
+ {
+ if (errno != ENOENT)
+ {
+ error (0, errno, _("cannot stat %s"), quote (dst_name));
+ return false;
+ }
+ else
+ {
+ new_dst = true;
+ }
+ }
+
+XSTAT() use stat() for dst_name(the dangling symlink /tmp/fileA) when
+install.c invokes it, and stat will set errno to ENOENT, and then
+new_dst will be set to true which means that /tmp/fileA doesn't exist,
+then we will create /tmp/fileA without remove it first, so the error
+comes.
+
+This is fixed in a way which adds the member cmd_install in
+struct cp_options to make sure my change only affected to the install
+command and use lstat to fix the problem.
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+---
+ src/copy.c | 10 +++++++++-
+ src/copy.h | 3 +++
+ src/install.c | 1 +
+ 3 files changed, 13 insertions(+), 1 deletions(-)
+
+diff --git a/src/copy.c b/src/copy.c
+--- a/src/copy.c
++++ b/src/copy.c
+@@ -1029,6 +1029,7 @@ copy_internal (char const *src_name, char const *dst_name,
+ bool delayed_ok;
+ bool copied_as_regular = false;
+ bool preserve_metadata;
++ int dst_stat_result;
+
+ if (x->move_mode && rename_succeeded)
+ *rename_succeeded = false;
+@@ -1069,7 +1070,14 @@ copy_internal (char const *src_name, char const *dst_name,
+
+ if (!new_dst)
+ {
+- if (XSTAT (x, dst_name, &dst_sb) != 0)
++ if ( x->cmd_install && ( x->backup_type == no_backups))
++ dst_stat_result = lstat (dst_name, &dst_sb);
++ else
++ {
++ dst_stat_result = XSTAT (x, dst_name, &dst_sb);
++ }
++
++ if (dst_stat_result != 0)
+ {
+ if (errno != ENOENT)
+ {
+diff --git a/src/copy.h b/src/copy.h
+--- a/src/copy.h
++++ b/src/copy.h
+@@ -114,6 +114,9 @@ struct cp_options
+ If that fails, then resort to copying. */
+ bool move_mode;
+
++ /* For the install command */
++ bool cmd_install;
++
+ /* Whether this process has appropriate privileges to chown a file
+ whose owner is not the effective user ID. */
+ bool chown_privileges;
+diff --git a/src/install.c b/src/install.c
+--- a/src/install.c
++++ b/src/install.c
+@@ -149,6 +149,7 @@ cp_option_init (struct cp_options *x)
+ x->hard_link = false;
+ x->interactive = I_UNSPECIFIED;
+ x->move_mode = false;
++ x->cmd_install = true;
+ x->chown_privileges = chown_privileges ();
+ x->one_file_system = false;
+ x->preserve_ownership = false;
+--
+1.7.0.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-texinfo.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-texinfo.patch
new file mode 100644
index 000000000..3ae5a2fae
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-texinfo.patch
@@ -0,0 +1,375 @@
+From 170be4023bbf9e9698a709e03265945588ac8e01 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Tue, 26 Nov 2013 00:21:50 +0800
+Subject: [PATCH] doc/coreutils.texi: Use '@item' instead of '@itemx'
+
+Use '@item' instead of '@itemx' in several places, as Texinfo 5 refuses
+to process an '@itemx' that is not preceded by an '@item'. Ensure that
+node extended names in menus and sectioning are consistent, and that
+ordering and presence of nodes in menus and in the actual text are
+consistent as well.
+
+Upstream-Status: Backport [From: coreutils.7620.n7.nabble.com, bug#11828]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ doc/coreutils.texi | 82 +++++++++++++++++++++++++++---------------------------
+ 1 file changed, 41 insertions(+), 41 deletions(-)
+
+diff --git a/doc/coreutils.texi b/doc/coreutils.texi
+index 588147f..2dae3fe 100644
+--- a/doc/coreutils.texi
++++ b/doc/coreutils.texi
+@@ -555,7 +555,7 @@ symbolic link to a directory. @xref{Target directory}.
+ @end macro
+
+ @macro optSi
+-@itemx --si
++@item --si
+ @opindex --si
+ @cindex SI output
+ Append an SI-style abbreviation to each size, such as @samp{M} for
+@@ -578,7 +578,7 @@ Use the @option{--si} option if you prefer powers of 1000.
+ @end macro
+
+ @macro optStripTrailingSlashes
+-@itemx @w{@kbd{--strip-trailing-slashes}}
++@item @w{@kbd{--strip-trailing-slashes}}
+ @opindex --strip-trailing-slashes
+ @cindex stripping trailing slashes
+ Remove any trailing slashes from each @var{source} argument.
+@@ -2496,7 +2496,7 @@ by 1048576.
+ However, if @var{n} starts with a @samp{-},
+ print all but the last @var{n} bytes of each file.
+
+-@itemx -n @var{n}
++@item -n @var{n}
+ @itemx --lines=@var{n}
+ @opindex -n
+ @opindex --lines
+@@ -2633,7 +2633,7 @@ This option is the same as @option{--follow=name --retry}. That is, tail
+ will attempt to reopen a file when it is removed. Should this fail, tail
+ will keep trying until it becomes accessible again.
+
+-@itemx --retry
++@item --retry
+ @opindex --retry
+ This option is useful mainly when following by name (i.e., with
+ @option{--follow=name}).
+@@ -2641,7 +2641,7 @@ Without this option, when tail encounters a file that doesn't
+ exist or is otherwise inaccessible, it reports that fact and
+ never checks it again.
+
+-@itemx --sleep-interval=@var{number}
++@item --sleep-interval=@var{number}
+ @opindex --sleep-interval
+ Change the number of seconds to wait between iterations (the default is 1.0).
+ During one iteration, every specified file is checked to see if it has
+@@ -2651,7 +2651,7 @@ Historical implementations of @command{tail} have required that
+ an arbitrary floating point number (using a period before any
+ fractional digits).
+
+-@itemx --pid=@var{pid}
++@item --pid=@var{pid}
+ @opindex --pid
+ When following by name or by descriptor, you may specify the process ID,
+ @var{pid}, of the sole writer of all @var{file} arguments. Then, shortly
+@@ -2674,7 +2674,7 @@ terminate until long after the real writer has terminated.
+ Note that @option{--pid} cannot be supported on some systems; @command{tail}
+ will print a warning if this is the case.
+
+-@itemx --max-unchanged-stats=@var{n}
++@item --max-unchanged-stats=@var{n}
+ @opindex --max-unchanged-stats
+ When tailing a file by name, if there have been @var{n} (default
+ n=@value{DEFAULT_MAX_N_UNCHANGED_STATS_BETWEEN_OPENS}) consecutive
+@@ -2686,7 +2686,7 @@ number of seconds between when tail prints the last pre-rotation lines
+ and when it prints the lines that have accumulated in the new log file.
+ This option is meaningful only when following by name.
+
+-@itemx -n @var{n}
++@item -n @var{n}
+ @itemx --lines=@var{n}
+ @opindex -n
+ @opindex --lines
+@@ -2817,7 +2817,7 @@ option.
+ @opindex --numeric-suffixes
+ Use digits in suffixes rather than lower-case letters.
+
+-@itemx --verbose
++@item --verbose
+ @opindex --verbose
+ Write a diagnostic to standard error just before each output file is opened.
+
+@@ -3055,7 +3055,7 @@ Print only the newline counts.
+ @opindex --max-line-length
+ Print only the maximum line lengths.
+
+-@itemx --files0-from=@var{FILE}
++@item --files0-from=@var{FILE}
+ @opindex --files0-from=@var{FILE}
+ @cindex including files from @command{du}
+ Rather than processing files named on the command line, process those
+@@ -3250,7 +3250,7 @@ an MD5 checksum inconsistent with the associated file, or if no valid
+ line is found, @command{md5sum} exits with nonzero status. Otherwise,
+ it exits successfully.
+
+-@itemx --status
++@item --status
+ @opindex --status
+ @cindex verifying MD5 checksums
+ This option is useful only when verifying checksums.
+@@ -5837,7 +5837,7 @@ command line unless the @option{--dereference-command-line} (@option{-H}),
+ If a command line argument specifies a symbolic link, show information
+ for the file the link references rather than for the link itself.
+
+-@itemx --dereference-command-line-symlink-to-dir
++@item --dereference-command-line-symlink-to-dir
+ @opindex --dereference-command-line-symlink-to-dir
+ @cindex symbolic links, dereferencing
+ Do not dereference symbolic links, with one exception:
+@@ -7015,15 +7015,15 @@ If specified, the @var{attribute_list} must be a comma-separated list
+ of one or more of the following strings:
+
+ @table @samp
+-@itemx mode
++@item mode
+ Preserve the file mode bits and access control lists.
+-@itemx ownership
++@item ownership
+ Preserve the owner and group. On most modern systems,
+ only users with appropriate privileges may change the owner of a file,
+ and ordinary users
+ may preserve the group ownership of a file only if they happen to be
+ a member of the desired group.
+-@itemx timestamps
++@item timestamps
+ Preserve the times of last access and last modification, when possible.
+ In general, it is not possible to preserve these attributes
+ when the affected file is a symbolic link.
+@@ -7031,12 +7031,12 @@ However, FreeBSD now provides the @code{lutimes} function, which makes
+ it possibile even for symbolic links. However, this implementation does
+ not yet take advantage of that.
+ @c FIXME: once we provide lutimes support, update the above.
+-@itemx links
++@item links
+ Preserve in the destination files
+ any links between corresponding source files.
+ @c Give examples illustrating how hard links are preserved.
+ @c Also, show how soft links map to hard links with -L and -H.
+-@itemx all
++@item all
+ Preserve all file attributes.
+ Equivalent to specifying all of the above.
+ @end table
+@@ -7049,12 +7049,12 @@ mode bits of the corresponding source file, minus the bits set in the
+ umask and minus the set-user-ID and set-group-ID bits.
+ @xref{File permissions}.
+
+-@itemx @w{@kbd{--no-preserve}=@var{attribute_list}}
++@item @w{@kbd{--no-preserve}=@var{attribute_list}}
+ @cindex file information, preserving
+ Do not preserve the specified attributes. The @var{attribute_list}
+ has the same form as for @option{--preserve}.
+
+-@itemx --parents
++@item --parents
+ @opindex --parents
+ @cindex parent directories and @command{cp}
+ Form the name of each destination file by appending to the target
+@@ -7070,7 +7070,7 @@ cp --parents a/b/c existing_dir
+ copies the file @file{a/b/c} to @file{existing_dir/a/b/c}, creating
+ any missing intermediate directories.
+
+-@itemx @w{@kbd{--reply}=@var{how}}
++@item @w{@kbd{--reply}=@var{how}}
+ @opindex --reply
+ @cindex interactivity
+ @c FIXME: remove in 2008
+@@ -7742,7 +7742,7 @@ Prompt whether to overwrite each existing destination file, regardless
+ of its permissions.
+ If the response is not affirmative, the file is skipped.
+
+-@itemx @w{@kbd{--reply}=@var{how}}
++@item @w{@kbd{--reply}=@var{how}}
+ @opindex --reply
+ @cindex interactivity
+ @c FIXME: remove in 2008
+@@ -7847,7 +7847,7 @@ files are named or if a recursive removal is requested. Ignore any
+ previous @option{--force} (@option{-f}) option. Equivalent to
+ @option{--interactive=once}.
+
+-@itemx --interactive [=@var{when}]
++@item --interactive [=@var{when}]
+ @opindex --interactive
+ Specify when to issue an interactive prompt. @var{when} may be
+ omitted, or one of:
+@@ -7866,7 +7866,7 @@ removal is requested. Equivalent to @option{-I}.
+ Specifying @option{--interactive} and no @var{when} is equivalent to
+ @option{--interactive=always}.
+
+-@itemx --one-file-system
++@item --one-file-system
+ @opindex --one-file-system
+ @cindex one file system, restricting @command{rm} to
+ When removing a hierarchy recursively, skip any directory that is on a
+@@ -7884,7 +7884,7 @@ warn about and skip directories on other file systems.
+ Of course, this will not save your @file{/home} if it and your
+ chroot happen to be on the same file system.
+
+-@itemx --preserve-root
++@item --preserve-root
+ @opindex --preserve-root
+ @cindex root directory, disallow recursive destruction
+ Fail upon any attempt to remove the root directory, @file{/},
+@@ -7892,7 +7892,7 @@ when used with the @option{--recursive} option.
+ This is the default behavior.
+ @xref{Treating / specially}.
+
+-@itemx --no-preserve-root
++@item --no-preserve-root
+ @opindex --no-preserve-root
+ @cindex root directory, allow recursive destruction
+ Do not treat @file{/} specially when removing recursively.
+@@ -8874,7 +8874,7 @@ actually changes.
+ Do not print error messages about files whose ownership cannot be
+ changed.
+
+-@itemx @w{@kbd{--from}=@var{old-owner}}
++@item @w{@kbd{--from}=@var{old-owner}}
+ @opindex --from
+ @cindex symbolic links, changing owner
+ Change a @var{file}'s ownership only if it has current attributes specified
+@@ -8928,14 +8928,14 @@ is a symbolic link.
+ By default, no diagnostic is issued for symbolic links encountered
+ during a recursive traversal, but see @option{--verbose}.
+
+-@itemx --preserve-root
++@item --preserve-root
+ @opindex --preserve-root
+ @cindex root directory, disallow recursive modification
+ Fail upon any attempt to recursively change the root directory, @file{/}.
+ Without @option{--recursive}, this option has no effect.
+ @xref{Treating / specially}.
+
+-@itemx --no-preserve-root
++@item --no-preserve-root
+ @opindex --no-preserve-root
+ @cindex root directory, allow recursive modification
+ Cancel the effect of any preceding @option{--preserve-root} option.
+@@ -9054,14 +9054,14 @@ is a symbolic link.
+ By default, no diagnostic is issued for symbolic links encountered
+ during a recursive traversal, but see @option{--verbose}.
+
+-@itemx --preserve-root
++@item --preserve-root
+ @opindex --preserve-root
+ @cindex root directory, disallow recursive modification
+ Fail upon any attempt to recursively change the root directory, @file{/}.
+ Without @option{--recursive}, this option has no effect.
+ @xref{Treating / specially}.
+
+-@itemx --no-preserve-root
++@item --no-preserve-root
+ @opindex --no-preserve-root
+ @cindex root directory, allow recursive modification
+ Cancel the effect of any preceding @option{--preserve-root} option.
+@@ -9175,14 +9175,14 @@ actually changes.
+ Do not print error messages about files whose permissions cannot be
+ changed.
+
+-@itemx --preserve-root
++@item --preserve-root
+ @opindex --preserve-root
+ @cindex root directory, disallow recursive modification
+ Fail upon any attempt to recursively change the root directory, @file{/}.
+ Without @option{--recursive}, this option has no effect.
+ @xref{Treating / specially}.
+
+-@itemx --no-preserve-root
++@item --no-preserve-root
+ @opindex --no-preserve-root
+ @cindex root directory, allow recursive modification
+ Cancel the effect of any preceding @option{--preserve-root} option.
+@@ -9603,7 +9603,7 @@ The program accepts the following options. Also see @ref{Common options}.
+ @opindex --all
+ Show counts for all files, not just directories.
+
+-@itemx --apparent-size
++@item --apparent-size
+ @opindex --apparent-size
+ Print apparent sizes, rather than disk usage. The apparent size of a
+ file is the number of bytes reported by @code{wc -c} on regular files,
+@@ -9654,7 +9654,7 @@ Does not affect other symbolic links. This is helpful for finding
+ out the disk usage of directories, such as @file{/usr/tmp}, which
+ are often symbolic links.
+
+-@itemx --files0-from=@var{FILE}
++@item --files0-from=@var{FILE}
+ @opindex --files0-from=@var{FILE}
+ @cindex including files from @command{du}
+ Rather than processing files named on the command line, process those
+@@ -9733,7 +9733,7 @@ Output a null byte at the end of each line, rather than a newline.
+ This option enables other programs to parse the output of @command{du}
+ even when that output would contain file names with embedded newlines.
+
+-@itemx --si
++@item --si
+ @opindex --si
+ @cindex SI output
+ Append an SI-style abbreviation to each size, such as @samp{MB} for
+@@ -9754,13 +9754,13 @@ Display only a total for each argument.
+ Report the size of each directory separately, not including the sizes
+ of subdirectories.
+
+-@itemx --time
++@item --time
+ @opindex --time
+ @cindex last modified dates, displaying in @command{du}
+ Show time of the most recent modification of any file in the directory,
+ or any of its subdirectories.
+
+-@itemx --time=ctime
++@item --time=ctime
+ @itemx --time=status
+ @itemx --time=use
+ @opindex --time
+@@ -9770,7 +9770,7 @@ or any of its subdirectories.
+ Show the most recent status change time (the @samp{ctime} in the inode) of
+ any file in the directory, instead of the modification time.
+
+-@itemx --time=atime
++@item --time=atime
+ @itemx --time=access
+ @opindex --time
+ @opindex atime@r{, show the most recent}
+@@ -9911,7 +9911,7 @@ $ stat --format=%d:%i / /usr
+ 2057:2
+ @end example
+
+-@itemx --printf=@var{format}
++@item --printf=@var{format}
+ @opindex --printf=@var{format}
+ @cindex output format
+ Use @var{format} rather than the default format.
+@@ -12240,7 +12240,7 @@ Overrides all other options.
+ @opindex -s
+ Ignored; for compatibility with other versions of @command{who}.
+
+-@itemx -u
++@item -u
+ @opindex -u
+ @cindex idle time
+ After the login time, print the number of hours and minutes that the
+@@ -12254,7 +12254,7 @@ user has been idle. @samp{.} means the user was active in the last minute.
+ List only the entries that correspond to processes via which the
+ system is waiting for a user to login. The user name is always @samp{LOGIN}.
+
+-@itemx --lookup
++@item --lookup
+ @opindex --lookup
+ Attempt to canonicalize hostnames found in utmp through a DNS lookup. This
+ is not the default because it can cause significant delays on systems with
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-i18n.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-i18n.patch
new file mode 100644
index 000000000..653722348
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-i18n.patch
@@ -0,0 +1,4051 @@
+Upstream-Status: Inappropriate [legacy version]
+
+This patch was imported from the Fedora Core 8 coreutils-6.9-9 package.
+
+The package is stated as being Licensed as GPLv2+.
+
+The comment indicates that the purpose is lin18nux/lsb compliance.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+--- /dev/null 2007-03-01 09:16:39.219409909 +0000
++++ coreutils-6.8+/tests/sort/sort-mb-tests 2007-03-01 15:08:24.000000000 +0000
+@@ -0,0 +1,58 @@
++#! /bin/sh
++case $# in
++ 0) xx='../../src/sort';;
++ *) xx="$1";;
++esac
++test "$VERBOSE" && echo=echo || echo=:
++$echo testing program: $xx
++errors=0
++test "$srcdir" || srcdir=.
++test "$VERBOSE" && $xx --version 2> /dev/null
++
++export LC_ALL=en_US.UTF-8
++locale -k LC_CTYPE 2>&1 | grep -q charmap.*UTF-8 || exit 77
++errors=0
++
++$xx -t @ -k2 -n mb1.I > mb1.O
++code=$?
++if test $code != 0; then
++ $echo "Test mb1 failed: $xx return code $code differs from expected value 0" 1>&2
++ errors=`expr $errors + 1`
++else
++ cmp mb1.O $srcdir/mb1.X > /dev/null 2>&1
++ case $? in
++ 0) if test "$VERBOSE"; then $echo "passed mb1"; fi;;
++ 1) $echo "Test mb1 failed: files mb1.O and $srcdir/mb1.X differ" 1>&2
++ (diff -c mb1.O $srcdir/mb1.X) 2> /dev/null
++ errors=`expr $errors + 1`;;
++ 2) $echo "Test mb1 may have failed." 1>&2
++ $echo The command "cmp mb1.O $srcdir/mb1.X" failed. 1>&2
++ errors=`expr $errors + 1`;;
++ esac
++fi
++
++$xx -t @ -k4 -n mb2.I > mb2.O
++code=$?
++if test $code != 0; then
++ $echo "Test mb2 failed: $xx return code $code differs from expected value 0" 1>&2
++ errors=`expr $errors + 1`
++else
++ cmp mb2.O $srcdir/mb2.X > /dev/null 2>&1
++ case $? in
++ 0) if test "$VERBOSE"; then $echo "passed mb2"; fi;;
++ 1) $echo "Test mb2 failed: files mb2.O and $srcdir/mb2.X differ" 1>&2
++ (diff -c mb2.O $srcdir/mb2.X) 2> /dev/null
++ errors=`expr $errors + 1`;;
++ 2) $echo "Test mb2 may have failed." 1>&2
++ $echo The command "cmp mb2.O $srcdir/mb2.X" failed. 1>&2
++ errors=`expr $errors + 1`;;
++ esac
++fi
++
++if test $errors = 0; then
++ $echo Passed all 113 tests. 1>&2
++else
++ $echo Failed $errors tests. 1>&2
++fi
++test $errors = 0 || errors=1
++exit $errors
+--- /dev/null 2007-03-01 09:16:39.219409909 +0000
++++ coreutils-6.8+/tests/sort/mb2.I 2007-03-01 15:08:24.000000000 +0000
+@@ -0,0 +1,4 @@
++Apple@AA10@@20
++Banana@AA5@@30
++Citrus@AA20@@5
++Cherry@AA30@@10
+--- /dev/null 2007-03-01 09:16:39.219409909 +0000
++++ coreutils-6.8+/tests/sort/mb2.X 2007-03-01 15:08:24.000000000 +0000
+@@ -0,0 +1,4 @@
++Citrus@AA20@@5
++Cherry@AA30@@10
++Apple@AA10@@20
++Banana@AA5@@30
+--- /dev/null 2007-03-01 09:16:39.219409909 +0000
++++ coreutils-6.8+/tests/sort/mb1.I 2007-03-01 15:08:24.000000000 +0000
+@@ -0,0 +1,4 @@
++Apple@10
++Banana@5
++Citrus@20
++Cherry@30
+--- /dev/null 2007-03-01 09:16:39.219409909 +0000
++++ coreutils-6.8+/tests/sort/mb1.X 2007-03-01 15:08:24.000000000 +0000
+@@ -0,0 +1,4 @@
++Banana@5
++Apple@10
++Citrus@20
++Cherry@30
+--- coreutils-6.8+/tests/sort/Makefile.am.i18n 2007-01-24 07:47:37.000000000 +0000
++++ coreutils-6.8+/tests/sort/Makefile.am 2007-03-01 15:09:59.000000000 +0000
+@@ -66,15 +66,17 @@
+ bigfield.O bigfield.E
+ ##test-files-end
+
+-EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen)
+-noinst_SCRIPTS = $x-tests
++run_gen += mb1.0 mb2.0
++
++EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen) mb1.I mb1.X mb2.I mb2.X
++noinst_SCRIPTS = $x-tests # $x-mb-tests
+ TESTS_ENVIRONMENT = \
+ CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst \
+ PATH="$(VG_PATH_PREFIX)`pwd`/../../src$(PATH_SEPARATOR)$$PATH"
+
+ editpl = sed -e 's,@''PERL''@,$(PERL),g' -e 's,@''srcdir''@,$(srcdir),g'
+
+-TESTS = $x-tests
++TESTS = $x-tests $x-mb-tests
+
+ mk_script = $(srcdir)/../mk-script
+ $(srcdir)/$x-tests: $(mk_script) Test.pm Makefile.am
+--- coreutils-6.8+/lib/linebuffer.h.i18n 2005-05-14 07:44:24.000000000 +0100
++++ coreutils-6.8+/lib/linebuffer.h 2007-03-01 15:08:24.000000000 +0000
+@@ -22,6 +22,11 @@
+
+ # include <stdio.h>
+
++/* Get mbstate_t. */
++# if HAVE_WCHAR_H
++# include <wchar.h>
++# endif
++
+ /* A `struct linebuffer' holds a line of text. */
+
+ struct linebuffer
+@@ -29,6 +34,9 @@
+ size_t size; /* Allocated. */
+ size_t length; /* Used. */
+ char *buffer;
++# if HAVE_WCHAR_H
++ mbstate_t state;
++# endif
+ };
+
+ /* Initialize linebuffer LINEBUFFER for use. */
+--- coreutils-6.8+/src/expand.c.i18n 2007-01-14 15:41:28.000000000 +0000
++++ coreutils-6.8+/src/expand.c 2007-03-01 15:08:24.000000000 +0000
+@@ -38,11 +38,28 @@
+ #include <stdio.h>
+ #include <getopt.h>
+ #include <sys/types.h>
++
++/* Get mbstate_t, mbrtowc(), wcwidth(). */
++#if HAVE_WCHAR_H
++# include <wchar.h>
++#endif
++
+ #include "system.h"
+ #include "error.h"
+ #include "quote.h"
+ #include "xstrndup.h"
+
++/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
++ installation; work around this configuration error. */
++#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
++# define MB_LEN_MAX 16
++#endif
++
++/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
++#if HAVE_MBRTOWC && defined mbstate_t
++# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
++#endif
++
+ /* The official name of this program (e.g., no `g' prefix). */
+ #define PROGRAM_NAME "expand"
+
+@@ -183,6 +200,7 @@
+ stops = num_start + len - 1;
+ }
+ }
++
+ else
+ {
+ error (0, 0, _("tab size contains invalid character(s): %s"),
+@@ -365,6 +383,142 @@
+ }
+ }
+
++#if HAVE_MBRTOWC
++static void
++expand_multibyte (void)
++{
++ FILE *fp; /* Input strem. */
++ mbstate_t i_state; /* Current shift state of the input stream. */
++ mbstate_t i_state_bak; /* Back up the I_STATE. */
++ mbstate_t o_state; /* Current shift state of the output stream. */
++ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */
++ char *bufpos; /* Next read position of BUF. */
++ size_t buflen = 0; /* The length of the byte sequence in buf. */
++ wchar_t wc; /* A gotten wide character. */
++ size_t mblength; /* The byte size of a multibyte character
++ which shows as same character as WC. */
++ int tab_index = 0; /* Index in `tab_list' of next tabstop. */
++ int column = 0; /* Column on screen of the next char. */
++ int next_tab_column; /* Column the next tab stop is on. */
++ int convert = 1; /* If nonzero, perform translations. */
++
++ fp = next_file ((FILE *) NULL);
++ if (fp == NULL)
++ return;
++
++ memset (&o_state, '\0', sizeof(mbstate_t));
++ memset (&i_state, '\0', sizeof(mbstate_t));
++
++ for (;;)
++ {
++ /* Refill the buffer BUF. */
++ if (buflen < MB_LEN_MAX && !feof(fp) && !ferror(fp))
++ {
++ memmove (buf, bufpos, buflen);
++ buflen += fread (buf + buflen, sizeof(char), BUFSIZ, fp);
++ bufpos = buf;
++ }
++
++ /* No character is left in BUF. */
++ if (buflen < 1)
++ {
++ fp = next_file (fp);
++
++ if (fp == NULL)
++ break; /* No more files. */
++ else
++ {
++ memset (&i_state, '\0', sizeof(mbstate_t));
++ continue;
++ }
++ }
++
++ /* Get a wide character. */
++ i_state_bak = i_state;
++ mblength = mbrtowc (&wc, bufpos, buflen, &i_state);
++
++ switch (mblength)
++ {
++ case (size_t)-1: /* illegal byte sequence. */
++ case (size_t)-2:
++ mblength = 1;
++ i_state = i_state_bak;
++ if (convert)
++ {
++ ++column;
++ if (convert_entire_line == 0)
++ convert = 0;
++ }
++ putchar (*bufpos);
++ break;
++
++ case 0: /* null. */
++ mblength = 1;
++ if (convert && convert_entire_line == 0)
++ convert = 0;
++ putchar ('\0');
++ break;
++
++ default:
++ if (wc == L'\n') /* LF. */
++ {
++ tab_index = 0;
++ column = 0;
++ convert = 1;
++ putchar ('\n');
++ }
++ else if (wc == L'\t' && convert) /* Tab. */
++ {
++ if (tab_size == 0)
++ {
++ /* Do not let tab_index == first_free_tab;
++ stop when it is 1 less. */
++ while (tab_index < first_free_tab - 1
++ && column >= tab_list[tab_index])
++ tab_index++;
++ next_tab_column = tab_list[tab_index];
++ if (tab_index < first_free_tab - 1)
++ tab_index++;
++ if (column >= next_tab_column)
++ next_tab_column = column + 1;
++ }
++ else
++ next_tab_column = column + tab_size - column % tab_size;
++
++ while (column < next_tab_column)
++ {
++ putchar (' ');
++ ++column;
++ }
++ }
++ else /* Others. */
++ {
++ if (convert)
++ {
++ if (wc == L'\b')
++ {
++ if (column > 0)
++ --column;
++ }
++ else
++ {
++ int width; /* The width of WC. */
++
++ width = wcwidth (wc);
++ column += (width > 0) ? width : 0;
++ if (convert_entire_line == 0)
++ convert = 0;
++ }
++ }
++ fwrite (bufpos, sizeof(char), mblength, stdout);
++ }
++ }
++ buflen -= mblength;
++ bufpos += mblength;
++ }
++}
++#endif
++
+ int
+ main (int argc, char **argv)
+ {
+@@ -429,7 +583,12 @@
+
+ file_list = (optind < argc ? &argv[optind] : stdin_argv);
+
+- expand ();
++#if HAVE_MBRTOWC
++ if (MB_CUR_MAX > 1)
++ expand_multibyte ();
++ else
++#endif
++ expand ();
+
+ if (have_read_stdin && fclose (stdin) != 0)
+ error (EXIT_FAILURE, errno, "-");
+--- coreutils-6.8+/src/join.c.i18n 2007-01-14 15:41:28.000000000 +0000
++++ coreutils-6.8+/src/join.c 2007-03-01 15:08:24.000000000 +0000
+@@ -23,16 +23,30 @@
+ #include <sys/types.h>
+ #include <getopt.h>
+
++/* Get mbstate_t, mbrtowc(), mbrtowc(), wcwidth(). */
++#if HAVE_WCHAR_H
++# include <wchar.h>
++#endif
++
++/* Get iswblank(), towupper. */
++#if HAVE_WCTYPE_H
++# include <wctype.h>
++#endif
++
+ #include "system.h"
+ #include "error.h"
+ #include "hard-locale.h"
+ #include "linebuffer.h"
+-#include "memcasecmp.h"
+ #include "quote.h"
+ #include "stdio--.h"
+ #include "xmemcoll.h"
+ #include "xstrtol.h"
+
++/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
++#if HAVE_MBRTOWC && defined mbstate_t
++# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
++#endif
++
+ /* The official name of this program (e.g., no `g' prefix). */
+ #define PROGRAM_NAME "join"
+
+@@ -104,10 +118,12 @@
+ /* Last element in `outlist', where a new element can be added. */
+ static struct outlist *outlist_end = &outlist_head;
+
+-/* Tab character separating fields. If negative, fields are separated
+- by any nonempty string of blanks, otherwise by exactly one
+- tab character whose value (when cast to unsigned char) equals TAB. */
+-static int tab = -1;
++/* Tab character separating fields. If NULL, fields are separated
++ by any nonempty string of blanks. */
++static char *tab = NULL;
++
++/* The number of bytes used for tab. */
++static size_t tablen = 0;
+
+ static struct option const longopts[] =
+ {
+@@ -190,6 +206,8 @@
+
+ /* Fill in the `fields' structure in LINE. */
+
++/* Fill in the `fields' structure in LINE. */
++
+ static void
+ xfields (struct line *line)
+ {
+@@ -199,10 +217,11 @@
+ if (ptr == lim)
+ return;
+
+- if (0 <= tab)
++ if (tab != NULL)
+ {
++ unsigned char t = tab[0];
+ char *sep;
+- for (; (sep = memchr (ptr, tab, lim - ptr)) != NULL; ptr = sep + 1)
++ for (; (sep = memchr (ptr, t, lim - ptr)) != NULL; ptr = sep + 1)
+ extract_field (line, ptr, sep - ptr);
+ }
+ else
+@@ -229,6 +248,148 @@
+ extract_field (line, ptr, lim - ptr);
+ }
+
++#if HAVE_MBRTOWC
++static void
++xfields_multibyte (struct line *line)
++{
++ char *ptr = line->buf.buffer;
++ char const *lim = ptr + line->buf.length - 1;
++ wchar_t wc = 0;
++ size_t mblength = 1;
++ mbstate_t state, state_bak;
++
++ memset (&state, 0, sizeof (mbstate_t));
++
++ if (ptr == lim)
++ return;
++
++ if (tab != NULL)
++ {
++ unsigned char t = tab[0];
++ char *sep = ptr;
++ for (; ptr < lim; ptr = sep + mblength)
++ {
++ sep = ptr;
++ while (sep < lim)
++ {
++ state_bak = state;
++ mblength = mbrtowc (&wc, sep, lim - sep + 1, &state);
++
++ if (mblength == (size_t)-1 || mblength == (size_t)-2)
++ {
++ mblength = 1;
++ state = state_bak;
++ }
++ mblength = (mblength < 1) ? 1 : mblength;
++
++ if (mblength == tablen && !memcmp (sep, tab, mblength))
++ break;
++ else
++ {
++ sep += mblength;
++ continue;
++ }
++ }
++
++ if (sep == lim)
++ break;
++
++ extract_field (line, ptr, sep - ptr);
++ }
++ }
++ else
++ {
++ /* Skip leading blanks before the first field. */
++ while(ptr < lim)
++ {
++ state_bak = state;
++ mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state);
++
++ if (mblength == (size_t)-1 || mblength == (size_t)-2)
++ {
++ mblength = 1;
++ state = state_bak;
++ break;
++ }
++ mblength = (mblength < 1) ? 1 : mblength;
++
++ if (!iswblank(wc))
++ break;
++ ptr += mblength;
++ }
++
++ do
++ {
++ char *sep;
++ state_bak = state;
++ mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state);
++ if (mblength == (size_t)-1 || mblength == (size_t)-2)
++ {
++ mblength = 1;
++ state = state_bak;
++ break;
++ }
++ mblength = (mblength < 1) ? 1 : mblength;
++
++ sep = ptr + mblength;
++ while (sep != lim)
++ {
++ state_bak = state;
++ mblength = mbrtowc (&wc, sep, lim - sep + 1, &state);
++ if (mblength == (size_t)-1 || mblength == (size_t)-2)
++ {
++ mblength = 1;
++ state = state_bak;
++ break;
++ }
++ mblength = (mblength < 1) ? 1 : mblength;
++
++ if (iswblank (wc))
++ break;
++
++ sep += mblength;
++ }
++
++ extract_field (line, ptr, sep - ptr);
++ if (sep == lim)
++ return;
++
++ state_bak = state;
++ mblength = mbrtowc (&wc, sep, lim - sep + 1, &state);
++ if (mblength == (size_t)-1 || mblength == (size_t)-2)
++ {
++ mblength = 1;
++ state = state_bak;
++ break;
++ }
++ mblength = (mblength < 1) ? 1 : mblength;
++
++ ptr = sep + mblength;
++ while (ptr != lim)
++ {
++ state_bak = state;
++ mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state);
++ if (mblength == (size_t)-1 || mblength == (size_t)-2)
++ {
++ mblength = 1;
++ state = state_bak;
++ break;
++ }
++ mblength = (mblength < 1) ? 1 : mblength;
++
++ if (!iswblank (wc))
++ break;
++
++ ptr += mblength;
++ }
++ }
++ while (ptr != lim);
++ }
++
++ extract_field (line, ptr, lim - ptr);
++}
++#endif
++
+ /* Read a line from FP into LINE and split it into fields.
+ Return true if successful. */
+
+@@ -249,6 +410,11 @@
+ line->nfields_allocated = 0;
+ line->nfields = 0;
+ line->fields = NULL;
++#if HAVE_MBRTOWC
++ if (MB_CUR_MAX > 1)
++ xfields_multibyte (line);
++ else
++#endif
+ xfields (line);
+ return true;
+ }
+@@ -303,56 +469,114 @@
+ keycmp (struct line const *line1, struct line const *line2)
+ {
+ /* Start of field to compare in each file. */
+- char *beg1;
+- char *beg2;
+-
+- size_t len1;
+- size_t len2; /* Length of fields to compare. */
++ char *beg[2];
++ char *copy[2];
++ size_t len[2]; /* Length of fields to compare. */
+ int diff;
++ int i, j;
+
+ if (join_field_1 < line1->nfields)
+ {
+- beg1 = line1->fields[join_field_1].beg;
+- len1 = line1->fields[join_field_1].len;
++ beg[0] = line1->fields[join_field_1].beg;
++ len[0] = line1->fields[join_field_1].len;
+ }
+ else
+ {
+- beg1 = NULL;
+- len1 = 0;
++ beg[0] = NULL;
++ len[0] = 0;
+ }
+
+ if (join_field_2 < line2->nfields)
+ {
+- beg2 = line2->fields[join_field_2].beg;
+- len2 = line2->fields[join_field_2].len;
++ beg[1] = line2->fields[join_field_2].beg;
++ len[1] = line2->fields[join_field_2].len;
+ }
+ else
+ {
+- beg2 = NULL;
+- len2 = 0;
++ beg[1] = NULL;
++ len[1] = 0;
+ }
+
+- if (len1 == 0)
+- return len2 == 0 ? 0 : -1;
+- if (len2 == 0)
++ if (len[0] == 0)
++ return len[1] == 0 ? 0 : -1;
++ if (len[1] == 0)
+ return 1;
+
+ if (ignore_case)
+ {
+- /* FIXME: ignore_case does not work with NLS (in particular,
+- with multibyte chars). */
+- diff = memcasecmp (beg1, beg2, MIN (len1, len2));
++#ifdef HAVE_MBRTOWC
++ if (MB_CUR_MAX > 1)
++ {
++ size_t mblength;
++ wchar_t wc, uwc;
++ mbstate_t state, state_bak;
++
++ memset (&state, '\0', sizeof (mbstate_t));
++
++ for (i = 0; i < 2; i++)
++ {
++ copy[i] = alloca (len[i] + 1);
++
++ for (j = 0; j < MIN (len[0], len[1]);)
++ {
++ state_bak = state;
++ mblength = mbrtowc (&wc, beg[i] + j, len[i] - j, &state);
++
++ switch (mblength)
++ {
++ case (size_t) -1:
++ case (size_t) -2:
++ state = state_bak;
++ /* Fall through */
++ case 0:
++ mblength = 1;
++ break;
++
++ default:
++ uwc = towupper (wc);
++
++ if (uwc != wc)
++ {
++ mbstate_t state_wc;
++
++ memset (&state_wc, '\0', sizeof (mbstate_t));
++ wcrtomb (copy[i] + j, uwc, &state_wc);
++ }
++ else
++ memcpy (copy[i] + j, beg[i] + j, mblength);
++ }
++ j += mblength;
++ }
++ copy[i][j] = '\0';
++ }
++ }
++ else
++#endif
++ {
++ for (i = 0; i < 2; i++)
++ {
++ copy[i] = alloca (len[i] + 1);
++
++ for (j = 0; j < MIN (len[0], len[1]); j++)
++ copy[i][j] = toupper (beg[i][j]);
++
++ copy[i][j] = '\0';
++ }
++ }
+ }
+ else
+ {
+- if (hard_LC_COLLATE)
+- return xmemcoll (beg1, len1, beg2, len2);
+- diff = memcmp (beg1, beg2, MIN (len1, len2));
++ copy[0] = (unsigned char *) beg[0];
++ copy[1] = (unsigned char *) beg[1];
+ }
+
++ if (hard_LC_COLLATE)
++ return xmemcoll ((char *) copy[0], len[0], (char *) copy[1], len[1]);
++ diff = memcmp (copy[0], copy[1], MIN (len[0], len[1]));
++
+ if (diff)
+ return diff;
+- return len1 < len2 ? -1 : len1 != len2;
++ return len[0] - len[1];
+ }
+
+ /* Print field N of LINE if it exists and is nonempty, otherwise
+@@ -377,11 +601,18 @@
+
+ /* Print the join of LINE1 and LINE2. */
+
++#define PUT_TAB_CHAR \
++ do \
++ { \
++ (tab != NULL) ? \
++ fwrite(tab, sizeof(char), tablen, stdout) : putchar (' '); \
++ } \
++ while (0)
++
+ static void
+ prjoin (struct line const *line1, struct line const *line2)
+ {
+ const struct outlist *outlist;
+- char output_separator = tab < 0 ? ' ' : tab;
+
+ outlist = outlist_head.next;
+ if (outlist)
+@@ -397,12 +628,12 @@
+ if (o->file == 0)
+ {
+ if (line1 == &uni_blank)
+- {
++ {
+ line = line2;
+ field = join_field_2;
+ }
+ else
+- {
++ {
+ line = line1;
+ field = join_field_1;
+ }
+@@ -416,7 +647,7 @@
+ o = o->next;
+ if (o == NULL)
+ break;
+- putchar (output_separator);
++ PUT_TAB_CHAR;
+ }
+ putchar ('\n');
+ }
+@@ -434,23 +665,23 @@
+ prfield (join_field_1, line1);
+ for (i = 0; i < join_field_1 && i < line1->nfields; ++i)
+ {
+- putchar (output_separator);
++ PUT_TAB_CHAR;
+ prfield (i, line1);
+ }
+ for (i = join_field_1 + 1; i < line1->nfields; ++i)
+ {
+- putchar (output_separator);
++ PUT_TAB_CHAR;
+ prfield (i, line1);
+ }
+
+ for (i = 0; i < join_field_2 && i < line2->nfields; ++i)
+ {
+- putchar (output_separator);
++ PUT_TAB_CHAR;
+ prfield (i, line2);
+ }
+ for (i = join_field_2 + 1; i < line2->nfields; ++i)
+ {
+- putchar (output_separator);
++ PUT_TAB_CHAR;
+ prfield (i, line2);
+ }
+ putchar ('\n');
+@@ -859,20 +1090,41 @@
+
+ case 't':
+ {
+- unsigned char newtab = optarg[0];
+- if (! newtab)
++ char *newtab;
++ size_t newtablen;
++ if (! optarg[0])
+ error (EXIT_FAILURE, 0, _("empty tab"));
+- if (optarg[1])
++ newtab = xstrdup (optarg);
++#if HAVE_MBRTOWC
++ if (MB_CUR_MAX > 1)
++ {
++ mbstate_t state;
++
++ memset (&state, 0, sizeof (mbstate_t));
++ newtablen = mbrtowc (NULL, newtab,
++ strnlen (newtab, MB_LEN_MAX),
++ &state);
++ if (newtablen == (size_t) 0
++ || newtablen == (size_t) -1
++ || newtablen == (size_t) -2)
++ newtablen = 1;
++ }
++ else
++#endif
++ newtablen = 1;
++
++ if (newtablen == 1 && newtab[1])
++ {
++ if (STREQ (newtab, "\\0"))
++ newtab[0] = '\0';
++ }
++ if (tab != NULL && strcmp (tab, newtab))
+ {
+- if (STREQ (optarg, "\\0"))
+- newtab = '\0';
+- else
+- error (EXIT_FAILURE, 0, _("multi-character tab %s"),
+- quote (optarg));
++ free (newtab);
++ error (EXIT_FAILURE, 0, _("incompatible tabs"));
+ }
+- if (0 <= tab && tab != newtab)
+- error (EXIT_FAILURE, 0, _("incompatible tabs"));
+ tab = newtab;
++ tablen = newtablen;
+ }
+ break;
+
+--- coreutils-6.8+/src/uniq.c.i18n 2007-01-14 15:41:28.000000000 +0000
++++ coreutils-6.8+/src/uniq.c 2007-03-01 15:08:24.000000000 +0000
+@@ -23,6 +23,16 @@
+ #include <getopt.h>
+ #include <sys/types.h>
+
++/* Get mbstate_t, mbrtowc(). */
++#if HAVE_WCHAR_H
++# include <wchar.h>
++#endif
++
++/* Get isw* functions. */
++#if HAVE_WCTYPE_H
++# include <wctype.h>
++#endif
++
+ #include "system.h"
+ #include "argmatch.h"
+ #include "linebuffer.h"
+@@ -32,7 +42,19 @@
+ #include "quote.h"
+ #include "xmemcoll.h"
+ #include "xstrtol.h"
+-#include "memcasecmp.h"
++#include "xmemcoll.h"
++
++/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
++ installation; work around this configuration error. */
++#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
++# define MB_LEN_MAX 16
++#endif
++
++/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
++#if HAVE_MBRTOWC && defined mbstate_t
++# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
++#endif
++
+
+ /* The official name of this program (e.g., no `g' prefix). */
+ #define PROGRAM_NAME "uniq"
+@@ -109,6 +131,10 @@
+ /* Select whether/how to delimit groups of duplicate lines. */
+ static enum delimit_method delimit_groups;
+
++/* Function pointers. */
++static char *
++(*find_field) (struct linebuffer *line);
++
+ static struct option const longopts[] =
+ {
+ {"count", no_argument, NULL, 'c'},
+@@ -198,7 +224,7 @@
+ return a pointer to the beginning of the line's field to be compared. */
+
+ static char *
+-find_field (const struct linebuffer *line)
++find_field_uni (struct linebuffer *line)
+ {
+ size_t count;
+ char *lp = line->buffer;
+@@ -219,6 +245,83 @@
+ return lp + i;
+ }
+
++#if HAVE_MBRTOWC
++
++# define MBCHAR_TO_WCHAR(WC, MBLENGTH, LP, POS, SIZE, STATEP, CONVFAIL) \
++ do \
++ { \
++ mbstate_t state_bak; \
++ \
++ CONVFAIL = 0; \
++ state_bak = *STATEP; \
++ \
++ MBLENGTH = mbrtowc (&WC, LP + POS, SIZE - POS, STATEP); \
++ \
++ switch (MBLENGTH) \
++ { \
++ case (size_t)-2: \
++ case (size_t)-1: \
++ *STATEP = state_bak; \
++ CONVFAIL++; \
++ /* Fall through */ \
++ case 0: \
++ MBLENGTH = 1; \
++ } \
++ } \
++ while (0)
++
++static char *
++find_field_multi (struct linebuffer *line)
++{
++ size_t count;
++ char *lp = line->buffer;
++ size_t size = line->length - 1;
++ size_t pos;
++ size_t mblength;
++ wchar_t wc;
++ mbstate_t *statep;
++ int convfail;
++
++ pos = 0;
++ statep = &(line->state);
++
++ /* skip fields. */
++ for (count = 0; count < skip_fields && pos < size; count++)
++ {
++ while (pos < size)
++ {
++ MBCHAR_TO_WCHAR (wc, mblength, lp, pos, size, statep, convfail);
++
++ if (convfail || !iswblank (wc))
++ {
++ pos += mblength;
++ break;
++ }
++ pos += mblength;
++ }
++
++ while (pos < size)
++ {
++ MBCHAR_TO_WCHAR (wc, mblength, lp, pos, size, statep, convfail);
++
++ if (!convfail && iswblank (wc))
++ break;
++
++ pos += mblength;
++ }
++ }
++
++ /* skip fields. */
++ for (count = 0; count < skip_chars && pos < size; count++)
++ {
++ MBCHAR_TO_WCHAR (wc, mblength, lp, pos, size, statep, convfail);
++ pos += mblength;
++ }
++
++ return lp + pos;
++}
++#endif
++
+ /* Return false if two strings OLD and NEW match, true if not.
+ OLD and NEW point not to the beginnings of the lines
+ but rather to the beginnings of the fields to compare.
+@@ -227,6 +330,8 @@
+ static bool
+ different (char *old, char *new, size_t oldlen, size_t newlen)
+ {
++ char *copy_old, *copy_new;
++
+ if (check_chars < oldlen)
+ oldlen = check_chars;
+ if (check_chars < newlen)
+@@ -234,14 +339,92 @@
+
+ if (ignore_case)
+ {
+- /* FIXME: This should invoke strcoll somehow. */
+- return oldlen != newlen || memcasecmp (old, new, oldlen);
++ size_t i;
++
++ copy_old = alloca (oldlen + 1);
++ copy_new = alloca (oldlen + 1);
++
++ for (i = 0; i < oldlen; i++)
++ {
++ copy_old[i] = toupper (old[i]);
++ copy_new[i] = toupper (new[i]);
++ }
+ }
+- else if (hard_LC_COLLATE)
+- return xmemcoll (old, oldlen, new, newlen) != 0;
+ else
+- return oldlen != newlen || memcmp (old, new, oldlen);
++ {
++ copy_old = (char *)old;
++ copy_new = (char *)new;
++ }
++
++ return xmemcoll (copy_old, oldlen, copy_new, newlen);
++}
++
++#if HAVE_MBRTOWC
++static int
++different_multi (const char *old, const char *new, size_t oldlen, size_t newlen, mbstate_t oldstate, mbstate_t newstate)
++{
++ size_t i, j, chars;
++ const char *str[2];
++ char *copy[2];
++ size_t len[2];
++ mbstate_t state[2];
++ size_t mblength;
++ wchar_t wc, uwc;
++ mbstate_t state_bak;
++
++ str[0] = old;
++ str[1] = new;
++ len[0] = oldlen;
++ len[1] = newlen;
++ state[0] = oldstate;
++ state[1] = newstate;
++
++ for (i = 0; i < 2; i++)
++ {
++ copy[i] = alloca (len[i] + 1);
++
++ for (j = 0, chars = 0; j < len[i] && chars < check_chars; chars++)
++ {
++ state_bak = state[i];
++ mblength = mbrtowc (&wc, str[i] + j, len[i] - j, &(state[i]));
++
++ switch (mblength)
++ {
++ case (size_t)-1:
++ case (size_t)-2:
++ state[i] = state_bak;
++ /* Fall through */
++ case 0:
++ mblength = 1;
++ break;
++
++ default:
++ if (ignore_case)
++ {
++ uwc = towupper (wc);
++
++ if (uwc != wc)
++ {
++ mbstate_t state_wc;
++
++ memset (&state_wc, '\0', sizeof(mbstate_t));
++ wcrtomb (copy[i] + j, uwc, &state_wc);
++ }
++ else
++ memcpy (copy[i] + j, str[i] + j, mblength);
++ }
++ else
++ memcpy (copy[i] + j, str[i] + j, mblength);
++ }
++ j += mblength;
++ }
++ copy[i][j] = '\0';
++ len[i] = j;
++ }
++
++ return xmemcoll (copy[0], len[0], copy[1], len[1]);
+ }
++#endif
+
+ /* Output the line in linebuffer LINE to standard output
+ provided that the switches say it should be output.
+@@ -295,15 +478,43 @@
+ {
+ char *prevfield IF_LINT (= NULL);
+ size_t prevlen IF_LINT (= 0);
++#if HAVE_MBRTOWC
++ mbstate_t prevstate;
++
++ memset (&prevstate, '\0', sizeof (mbstate_t));
++#endif
+
+ while (!feof (stdin))
+ {
+ char *thisfield;
+ size_t thislen;
++#if HAVE_MBRTOWC
++ mbstate_t thisstate;
++#endif
++
+ if (readlinebuffer (thisline, stdin) == 0)
+ break;
+ thisfield = find_field (thisline);
+ thislen = thisline->length - 1 - (thisfield - thisline->buffer);
++#if HAVE_MBRTOWC
++ if (MB_CUR_MAX > 1)
++ {
++ thisstate = thisline->state;
++
++ if (prevline->length == 0 || different_multi
++ (thisfield, prevfield, thislen, prevlen, thisstate, prevstate))
++ {
++ fwrite (thisline->buffer, sizeof (char),
++ thisline->length, stdout);
++
++ SWAP_LINES (prevline, thisline);
++ prevfield = thisfield;
++ prevlen = thislen;
++ prevstate = thisstate;
++ }
++ }
++ else
++#endif
+ if (prevline->length == 0
+ || different (thisfield, prevfield, thislen, prevlen))
+ {
+@@ -322,17 +533,26 @@
+ size_t prevlen;
+ uintmax_t match_count = 0;
+ bool first_delimiter = true;
++#if HAVE_MBRTOWC
++ mbstate_t prevstate;
++#endif
+
+ if (readlinebuffer (prevline, stdin) == 0)
+ goto closefiles;
+ prevfield = find_field (prevline);
+ prevlen = prevline->length - 1 - (prevfield - prevline->buffer);
++#if HAVE_MBRTOWC
++ prevstate = prevline->state;
++#endif
+
+ while (!feof (stdin))
+ {
+ bool match;
+ char *thisfield;
+ size_t thislen;
++#if HAVE_MBRTOWC
++ mbstate_t thisstate;
++#endif
+ if (readlinebuffer (thisline, stdin) == 0)
+ {
+ if (ferror (stdin))
+@@ -341,6 +561,15 @@
+ }
+ thisfield = find_field (thisline);
+ thislen = thisline->length - 1 - (thisfield - thisline->buffer);
++#if HAVE_MBRTOWC
++ if (MB_CUR_MAX > 1)
++ {
++ thisstate = thisline->state;
++ match = !different_multi (thisfield, prevfield,
++ thislen, prevlen, thisstate, prevstate);
++ }
++ else
++#endif
+ match = !different (thisfield, prevfield, thislen, prevlen);
+ match_count += match;
+
+@@ -373,6 +602,9 @@
+ SWAP_LINES (prevline, thisline);
+ prevfield = thisfield;
+ prevlen = thislen;
++#if HAVE_MBRTOWC
++ prevstate = thisstate;
++#endif
+ if (!match)
+ match_count = 0;
+ }
+@@ -417,6 +649,19 @@
+
+ atexit (close_stdout);
+
++#if HAVE_MBRTOWC
++ if (MB_CUR_MAX > 1)
++ {
++ find_field = find_field_multi;
++ }
++ else
++#endif
++ {
++ find_field = find_field_uni;
++ }
++
++
++
+ skip_chars = 0;
+ skip_fields = 0;
+ check_chars = SIZE_MAX;
+--- coreutils-6.8+/src/fold.c.i18n 2007-02-23 12:01:47.000000000 +0000
++++ coreutils-6.8+/src/fold.c 2007-03-01 15:08:24.000000000 +0000
+@@ -23,11 +23,33 @@
+ #include <getopt.h>
+ #include <sys/types.h>
+
++/* Get mbstate_t, mbrtowc(), wcwidth(). */
++#if HAVE_WCHAR_H
++# include <wchar.h>
++#endif
++
++/* Get iswprint(), iswblank(), wcwidth(). */
++#if HAVE_WCTYPE_H
++# include <wctype.h>
++#endif
++
+ #include "system.h"
+ #include "error.h"
+ #include "quote.h"
+ #include "xstrtol.h"
+
++/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
++ installation; work around this configuration error. */
++#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
++# undef MB_LEN_MAX
++# define MB_LEN_MAX 16
++#endif
++
++/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
++#if HAVE_MBRTOWC && defined mbstate_t
++# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
++#endif
++
+ #define TAB_WIDTH 8
+
+ /* The official name of this program (e.g., no `g' prefix). */
+@@ -35,23 +57,44 @@
+
+ #define AUTHORS "David MacKenzie"
+
++#define FATAL_ERROR(Message) \
++ do \
++ { \
++ error (0, 0, (Message)); \
++ usage (2); \
++ } \
++ while (0)
++
++enum operating_mode
++{
++ /* Fold texts by columns that are at the given positions. */
++ column_mode,
++
++ /* Fold texts by bytes that are at the given positions. */
++ byte_mode,
++
++ /* Fold texts by characters that are at the given positions. */
++ character_mode,
++};
++
+ /* The name this program was run with. */
+ char *program_name;
+
++/* The argument shows current mode. (Default: column_mode) */
++static enum operating_mode operating_mode;
++
+ /* If nonzero, try to break on whitespace. */
+ static bool break_spaces;
+
+-/* If nonzero, count bytes, not column positions. */
+-static bool count_bytes;
+-
+ /* If nonzero, at least one of the files we read was standard input. */
+ static bool have_read_stdin;
+
+-static char const shortopts[] = "bsw:0::1::2::3::4::5::6::7::8::9::";
++static char const shortopts[] = "bcsw:0::1::2::3::4::5::6::7::8::9::";
+
+ static struct option const longopts[] =
+ {
+ {"bytes", no_argument, NULL, 'b'},
++ {"characters", no_argument, NULL, 'c'},
+ {"spaces", no_argument, NULL, 's'},
+ {"width", required_argument, NULL, 'w'},
+ {GETOPT_HELP_OPTION_DECL},
+@@ -81,6 +124,7 @@
+ "), stdout);
+ fputs (_("\
+ -b, --bytes count bytes rather than columns\n\
++ -c, --characters count characters rather than columns\n\
+ -s, --spaces break at spaces\n\
+ -w, --width=WIDTH use WIDTH columns instead of 80\n\
+ "), stdout);
+@@ -98,7 +142,7 @@
+ static size_t
+ adjust_column (size_t column, char c)
+ {
+- if (!count_bytes)
++ if (operating_mode != byte_mode)
+ {
+ if (c == '\b')
+ {
+@@ -121,30 +165,14 @@
+ to stdout, with maximum line length WIDTH.
+ Return true if successful. */
+
+-static bool
+-fold_file (char const *filename, size_t width)
++static void
++fold_text (FILE *istream, size_t width, int *saved_errno)
+ {
+- FILE *istream;
+ int c;
+ size_t column = 0; /* Screen column where next char will go. */
+ size_t offset_out = 0; /* Index in `line_out' for next char. */
+ static char *line_out = NULL;
+ static size_t allocated_out = 0;
+- int saved_errno;
+-
+- if (STREQ (filename, "-"))
+- {
+- istream = stdin;
+- have_read_stdin = true;
+- }
+- else
+- istream = fopen (filename, "r");
+-
+- if (istream == NULL)
+- {
+- error (0, errno, "%s", filename);
+- return false;
+- }
+
+ while ((c = getc (istream)) != EOF)
+ {
+@@ -172,6 +200,15 @@
+ bool found_blank = false;
+ size_t logical_end = offset_out;
+
++ /* If LINE_OUT has no wide character,
++ put a new wide character in LINE_OUT
++ if column is bigger than width. */
++ if (offset_out == 0)
++ {
++ line_out[offset_out++] = c;
++ continue;
++ }
++
+ /* Look for the last blank. */
+ while (logical_end)
+ {
+@@ -218,11 +255,225 @@
+ line_out[offset_out++] = c;
+ }
+
+- saved_errno = errno;
++ *saved_errno = errno;
++
++ if (offset_out)
++ fwrite (line_out, sizeof (char), (size_t) offset_out, stdout);
++
++ free(line_out);
++}
++
++#if HAVE_MBRTOWC
++static void
++fold_multibyte_text (FILE *istream, size_t width, int *saved_errno)
++{
++ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */
++ size_t buflen = 0; /* The length of the byte sequence in buf. */
++ char *bufpos; /* Next read position of BUF. */
++ wint_t wc; /* A gotten wide character. */
++ size_t mblength; /* The byte size of a multibyte character which shows
++ as same character as WC. */
++ mbstate_t state, state_bak; /* State of the stream. */
++ int convfail; /* 1, when conversion is failed. Otherwise 0. */
++
++ char *line_out = NULL;
++ size_t offset_out = 0; /* Index in `line_out' for next char. */
++ size_t allocated_out = 0;
++
++ int increment;
++ size_t column = 0;
++
++ size_t last_blank_pos;
++ size_t last_blank_column;
++ int is_blank_seen;
++ int last_blank_increment;
++ int is_bs_following_last_blank;
++ size_t bs_following_last_blank_num;
++ int is_cr_after_last_blank;
++
++#define CLEAR_FLAGS \
++ do \
++ { \
++ last_blank_pos = 0; \
++ last_blank_column = 0; \
++ is_blank_seen = 0; \
++ is_bs_following_last_blank = 0; \
++ bs_following_last_blank_num = 0; \
++ is_cr_after_last_blank = 0; \
++ } \
++ while (0)
++
++#define START_NEW_LINE \
++ do \
++ { \
++ putchar ('\n'); \
++ column = 0; \
++ offset_out = 0; \
++ CLEAR_FLAGS; \
++ } \
++ while (0)
++
++ CLEAR_FLAGS;
++ memset (&state, '\0', sizeof(mbstate_t));
++
++ for (;; bufpos += mblength, buflen -= mblength)
++ {
++ if (buflen < MB_LEN_MAX && !feof (istream) && !ferror (istream))
++ {
++ memmove (buf, bufpos, buflen);
++ buflen += fread (buf + buflen, sizeof(char), BUFSIZ, istream);
++ bufpos = buf;
++ }
++
++ if (buflen < 1)
++ break;
++
++ /* Get a wide character. */
++ convfail = 0;
++ state_bak = state;
++ mblength = mbrtowc ((wchar_t *)&wc, bufpos, buflen, &state);
++
++ switch (mblength)
++ {
++ case (size_t)-1:
++ case (size_t)-2:
++ convfail++;
++ state = state_bak;
++ /* Fall through. */
++
++ case 0:
++ mblength = 1;
++ break;
++ }
++
++rescan:
++ if (operating_mode == byte_mode) /* byte mode */
++ increment = mblength;
++ else if (operating_mode == character_mode) /* character mode */
++ increment = 1;
++ else /* column mode */
++ {
++ if (convfail)
++ increment = 1;
++ else
++ {
++ switch (wc)
++ {
++ case L'\n':
++ fwrite (line_out, sizeof(char), offset_out, stdout);
++ START_NEW_LINE;
++ continue;
++
++ case L'\b':
++ increment = (column > 0) ? -1 : 0;
++ break;
++
++ case L'\r':
++ increment = -1 * column;
++ break;
++
++ case L'\t':
++ increment = 8 - column % 8;
++ break;
++
++ default:
++ increment = wcwidth (wc);
++ increment = (increment < 0) ? 0 : increment;
++ }
++ }
++ }
++
++ if (column + increment > width && break_spaces && last_blank_pos)
++ {
++ fwrite (line_out, sizeof(char), last_blank_pos, stdout);
++ putchar ('\n');
++
++ offset_out = offset_out - last_blank_pos;
++ column = column - last_blank_column + ((is_cr_after_last_blank)
++ ? last_blank_increment : bs_following_last_blank_num);
++ memmove (line_out, line_out + last_blank_pos, offset_out);
++ CLEAR_FLAGS;
++ goto rescan;
++ }
++
++ if (column + increment > width && column != 0)
++ {
++ fwrite (line_out, sizeof(char), offset_out, stdout);
++ START_NEW_LINE;
++ goto rescan;
++ }
++
++ if (allocated_out < offset_out + mblength)
++ {
++ allocated_out += 1024;
++ line_out = xrealloc (line_out, allocated_out);
++ }
++
++ memcpy (line_out + offset_out, bufpos, mblength);
++ offset_out += mblength;
++ column += increment;
++
++ if (is_blank_seen && !convfail && wc == L'\r')
++ is_cr_after_last_blank = 1;
++
++ if (is_bs_following_last_blank && !convfail && wc == L'\b')
++ ++bs_following_last_blank_num;
++ else
++ is_bs_following_last_blank = 0;
++
++ if (break_spaces && !convfail && iswblank (wc))
++ {
++ last_blank_pos = offset_out;
++ last_blank_column = column;
++ is_blank_seen = 1;
++ last_blank_increment = increment;
++ is_bs_following_last_blank = 1;
++ bs_following_last_blank_num = 0;
++ is_cr_after_last_blank = 0;
++ }
++ }
++
++ *saved_errno = errno;
+
+ if (offset_out)
+ fwrite (line_out, sizeof (char), (size_t) offset_out, stdout);
+
++ free(line_out);
++}
++#endif
++
++/* Fold file FILENAME, or standard input if FILENAME is "-",
++ to stdout, with maximum line length WIDTH.
++ Return 0 if successful, 1 if an error occurs. */
++
++static bool
++fold_file (char *filename, size_t width)
++{
++ FILE *istream;
++ int saved_errno;
++
++ if (STREQ (filename, "-"))
++ {
++ istream = stdin;
++ have_read_stdin = 1;
++ }
++ else
++ istream = fopen (filename, "r");
++
++ if (istream == NULL)
++ {
++ error (0, errno, "%s", filename);
++ return 1;
++ }
++
++ /* Define how ISTREAM is being folded. */
++#if HAVE_MBRTOWC
++ if (MB_CUR_MAX > 1)
++ fold_multibyte_text (istream, width, &saved_errno);
++ else
++#endif
++ fold_text (istream, width, &saved_errno);
++
+ if (ferror (istream))
+ {
+ error (0, saved_errno, "%s", filename);
+@@ -255,7 +506,8 @@
+
+ atexit (close_stdout);
+
+- break_spaces = count_bytes = have_read_stdin = false;
++ operating_mode = column_mode;
++ break_spaces = have_read_stdin = false;
+
+ while ((optc = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1)
+ {
+@@ -264,7 +516,15 @@
+ switch (optc)
+ {
+ case 'b': /* Count bytes rather than columns. */
+- count_bytes = true;
++ if (operating_mode != column_mode)
++ FATAL_ERROR (_("only one way of folding may be specified"));
++ operating_mode = byte_mode;
++ break;
++
++ case 'c':
++ if (operating_mode != column_mode)
++ FATAL_ERROR (_("only one way of folding may be specified"));
++ operating_mode = character_mode;
+ break;
+
+ case 's': /* Break at word boundaries. */
+--- coreutils-6.8+/src/sort.c.i18n 2007-02-24 11:23:23.000000000 +0000
++++ coreutils-6.8+/src/sort.c 2007-03-01 15:10:57.000000000 +0000
+@@ -23,10 +23,19 @@
+
+ #include <config.h>
+
++#include <assert.h>
+ #include <getopt.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+ #include <signal.h>
++#if HAVE_WCHAR_H
++# include <wchar.h>
++#endif
++/* Get isw* functions. */
++#if HAVE_WCTYPE_H
++# include <wctype.h>
++#endif
++
+ #include "system.h"
+ #include "argmatch.h"
+ #include "error.h"
+@@ -116,14 +125,38 @@
+ /* Thousands separator; if -1, then there isn't one. */
+ static int thousands_sep;
+
++static int force_general_numcompare = 0;
++
+ /* Nonzero if the corresponding locales are hard. */
+ static bool hard_LC_COLLATE;
+-#if HAVE_NL_LANGINFO
++#if HAVE_LANGINFO_CODESET
+ static bool hard_LC_TIME;
+ #endif
+
+ #define NONZERO(x) ((x) != 0)
+
++/* get a multibyte character's byte length. */
++#define GET_BYTELEN_OF_CHAR(LIM, PTR, MBLENGTH, STATE) \
++ do \
++ { \
++ wchar_t wc; \
++ mbstate_t state_bak; \
++ \
++ state_bak = STATE; \
++ mblength = mbrtowc (&wc, PTR, LIM - PTR, &STATE); \
++ \
++ switch (MBLENGTH) \
++ { \
++ case (size_t)-1: \
++ case (size_t)-2: \
++ STATE = state_bak; \
++ /* Fall through. */ \
++ case 0: \
++ MBLENGTH = 1; \
++ } \
++ } \
++ while (0)
++
+ /* The kind of blanks for '-b' to skip in various options. */
+ enum blanktype { bl_start, bl_end, bl_both };
+
+@@ -261,13 +294,11 @@
+ they were read if all keys compare equal. */
+ static bool stable;
+
+-/* If TAB has this value, blanks separate fields. */
+-enum { TAB_DEFAULT = CHAR_MAX + 1 };
+-
+-/* Tab character separating fields. If TAB_DEFAULT, then fields are
++/* Tab character separating fields. If tab_length is 0, then fields are
+ separated by the empty string between a non-blank character and a blank
+ character. */
+-static int tab = TAB_DEFAULT;
++static char tab[MB_LEN_MAX + 1];
++static size_t tab_length = 0;
+
+ /* Flag to remove consecutive duplicate lines from the output.
+ Only the last of a sequence of equal lines will be output. */
+@@ -639,6 +670,44 @@
+ update_proc (pid);
+ }
+
++/* Function pointers. */
++static void
++(*inittables) (void);
++static char *
++(*begfield) (const struct line*, const struct keyfield *);
++static char *
++(*limfield) (const struct line*, const struct keyfield *);
++static int
++(*getmonth) (char const *, size_t);
++static int
++(*keycompare) (const struct line *, const struct line *);
++static int
++(*numcompare) (const char *, const char *);
++
++/* Test for white space multibyte character.
++ Set LENGTH the byte length of investigated multibyte character. */
++#if HAVE_MBRTOWC
++static int
++ismbblank (const char *str, size_t len, size_t *length)
++{
++ size_t mblength;
++ wchar_t wc;
++ mbstate_t state;
++
++ memset (&state, '\0', sizeof(mbstate_t));
++ mblength = mbrtowc (&wc, str, len, &state);
++
++ if (mblength == (size_t)-1 || mblength == (size_t)-2)
++ {
++ *length = 1;
++ return 0;
++ }
++
++ *length = (mblength < 1) ? 1 : mblength;
++ return iswblank (wc);
++}
++#endif
++
+ /* Clean up any remaining temporary files. */
+
+ static void
+@@ -978,7 +1047,7 @@
+ free (node);
+ }
+
+-#if HAVE_NL_LANGINFO
++#if HAVE_LANGINFO_CODESET
+
+ static int
+ struct_month_cmp (const void *m1, const void *m2)
+@@ -993,7 +1062,7 @@
+ /* Initialize the character class tables. */
+
+ static void
+-inittables (void)
++inittables_uni (void)
+ {
+ size_t i;
+
+@@ -1005,7 +1074,7 @@
+ fold_toupper[i] = toupper (i);
+ }
+
+-#if HAVE_NL_LANGINFO
++#if HAVE_LANGINFO_CODESET
+ /* If we're not in the "C" locale, read different names for months. */
+ if (hard_LC_TIME)
+ {
+@@ -1031,6 +1100,64 @@
+ #endif
+ }
+
++#if HAVE_MBRTOWC
++static void
++inittables_mb (void)
++{
++ int i, j, k, l;
++ char *name, *s;
++ size_t s_len, mblength;
++ char mbc[MB_LEN_MAX];
++ wchar_t wc, pwc;
++ mbstate_t state_mb, state_wc;
++
++ for (i = 0; i < MONTHS_PER_YEAR; i++)
++ {
++ s = (char *) nl_langinfo (ABMON_1 + i);
++ s_len = strlen (s);
++ monthtab[i].name = name = (char *) xmalloc (s_len + 1);
++ monthtab[i].val = i + 1;
++
++ memset (&state_mb, '\0', sizeof (mbstate_t));
++ memset (&state_wc, '\0', sizeof (mbstate_t));
++
++ for (j = 0; j < s_len;)
++ {
++ if (!ismbblank (s + j, s_len - j, &mblength))
++ break;
++ j += mblength;
++ }
++
++ for (k = 0; j < s_len;)
++ {
++ mblength = mbrtowc (&wc, (s + j), (s_len - j), &state_mb);
++ assert (mblength != (size_t)-1 && mblength != (size_t)-2);
++ if (mblength == 0)
++ break;
++
++ pwc = towupper (wc);
++ if (pwc == wc)
++ {
++ memcpy (mbc, s + j, mblength);
++ j += mblength;
++ }
++ else
++ {
++ j += mblength;
++ mblength = wcrtomb (mbc, pwc, &state_wc);
++ assert (mblength != (size_t)0 && mblength != (size_t)-1);
++ }
++
++ for (l = 0; l < mblength; l++)
++ name[k++] = mbc[l];
++ }
++ name[k] = '\0';
++ }
++ qsort ((void *) monthtab, MONTHS_PER_YEAR,
++ sizeof (struct month), struct_month_cmp);
++}
++#endif
++
+ /* Specify the amount of main memory to use when sorting. */
+ static void
+ specify_sort_size (char const *s)
+@@ -1241,7 +1368,7 @@
+ by KEY in LINE. */
+
+ static char *
+-begfield (const struct line *line, const struct keyfield *key)
++begfield_uni (const struct line *line, const struct keyfield *key)
+ {
+ char *ptr = line->text, *lim = ptr + line->length - 1;
+ size_t sword = key->sword;
+@@ -1251,10 +1378,10 @@
+ /* The leading field separator itself is included in a field when -t
+ is absent. */
+
+- if (tab != TAB_DEFAULT)
++ if (tab_length)
+ while (ptr < lim && sword--)
+ {
+- while (ptr < lim && *ptr != tab)
++ while (ptr < lim && *ptr != tab[0])
+ ++ptr;
+ if (ptr < lim)
+ ++ptr;
+@@ -1282,11 +1409,70 @@
+ return ptr;
+ }
+
++#if HAVE_MBRTOWC
++static char *
++begfield_mb (const struct line *line, const struct keyfield *key)
++{
++ int i;
++ char *ptr = line->text, *lim = ptr + line->length - 1;
++ size_t sword = key->sword;
++ size_t schar = key->schar;
++ size_t mblength;
++ mbstate_t state;
++
++ memset (&state, '\0', sizeof(mbstate_t));
++
++ if (tab_length)
++ while (ptr < lim && sword--)
++ {
++ while (ptr < lim && memcmp (ptr, tab, tab_length) != 0)
++ {
++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
++ ptr += mblength;
++ }
++ if (ptr < lim)
++ {
++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
++ ptr += mblength;
++ }
++ }
++ else
++ while (ptr < lim && sword--)
++ {
++ while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength))
++ ptr += mblength;
++ if (ptr < lim)
++ {
++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
++ ptr += mblength;
++ }
++ while (ptr < lim && !ismbblank (ptr, lim - ptr, &mblength))
++ ptr += mblength;
++ }
++
++ if (key->skipsblanks)
++ while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength))
++ ptr += mblength;
++
++ for (i = 0; i < schar; i++)
++ {
++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
++
++ if (ptr + mblength > lim)
++ break;
++ else
++ ptr += mblength;
++ }
++
++ return ptr;
++}
++#endif
++
+ /* Return the limit of (a pointer to the first character after) the field
+ in LINE specified by KEY. */
+
+ static char *
+-limfield (const struct line *line, const struct keyfield *key)
++limfield_uni (const struct line *line, const struct keyfield *key)
+ {
+ char *ptr = line->text, *lim = ptr + line->length - 1;
+ size_t eword = key->eword, echar = key->echar;
+@@ -1299,10 +1485,10 @@
+ `beginning' is the first character following the delimiting TAB.
+ Otherwise, leave PTR pointing at the first `blank' character after
+ the preceding field. */
+- if (tab != TAB_DEFAULT)
++ if (tab_length)
+ while (ptr < lim && eword--)
+ {
+- while (ptr < lim && *ptr != tab)
++ while (ptr < lim && *ptr != tab[0])
+ ++ptr;
+ if (ptr < lim && (eword | echar))
+ ++ptr;
+@@ -1348,10 +1534,10 @@
+ */
+
+ /* Make LIM point to the end of (one byte past) the current field. */
+- if (tab != TAB_DEFAULT)
++ if (tab_length)
+ {
+ char *newlim;
+- newlim = memchr (ptr, tab, lim - ptr);
++ newlim = memchr (ptr, tab[0], lim - ptr);
+ if (newlim)
+ lim = newlim;
+ }
+@@ -1384,6 +1570,107 @@
+ return ptr;
+ }
+
++#if HAVE_MBRTOWC
++static char *
++limfield_mb (const struct line *line, const struct keyfield *key)
++{
++ char *ptr = line->text, *lim = ptr + line->length - 1;
++ size_t eword = key->eword, echar = key->echar;
++ int i;
++ size_t mblength;
++ mbstate_t state;
++
++ memset (&state, '\0', sizeof(mbstate_t));
++
++ if (tab_length)
++ while (ptr < lim && eword--)
++ {
++ while (ptr < lim && memcmp (ptr, tab, tab_length) != 0)
++ {
++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
++ ptr += mblength;
++ }
++ if (ptr < lim && (eword | echar))
++ {
++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
++ ptr += mblength;
++ }
++ }
++ else
++ while (ptr < lim && eword--)
++ {
++ while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength))
++ ptr += mblength;
++ if (ptr < lim)
++ {
++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
++ ptr += mblength;
++ }
++ while (ptr < lim && !ismbblank (ptr, lim - ptr, &mblength))
++ ptr += mblength;
++ }
++
++
++# ifdef POSIX_UNSPECIFIED
++ /* Make LIM point to the end of (one byte past) the current field. */
++ if (tab_length)
++ {
++ char *newlim, *p;
++
++ newlim = NULL;
++ for (p = ptr; p < lim;)
++ {
++ if (memcmp (p, tab, tab_length) == 0)
++ {
++ newlim = p;
++ break;
++ }
++
++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
++ p += mblength;
++ }
++ }
++ else
++ {
++ char *newlim;
++ newlim = ptr;
++
++ while (newlim < lim && ismbblank (newlim, lim - newlim, &mblength))
++ newlim += mblength;
++ if (ptr < lim)
++ {
++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
++ ptr += mblength;
++ }
++ while (newlim < lim && !ismbblank (newlim, lim - newlim, &mblength))
++ newlim += mblength;
++ lim = newlim;
++ }
++# endif
++
++ /* If we're skipping leading blanks, don't start counting characters
++ * until after skipping past any leading blanks. */
++ if (key->skipsblanks)
++ while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength))
++ ptr += mblength;
++
++ memset (&state, '\0', sizeof(mbstate_t));
++
++ /* Advance PTR by ECHAR (if possible), but no further than LIM. */
++ for (i = 0; i < echar; i++)
++ {
++ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
++
++ if (ptr + mblength > lim)
++ break;
++ else
++ ptr += mblength;
++ }
++
++ return ptr;
++}
++#endif
++
+ /* Fill BUF reading from FP, moving buf->left bytes from the end
+ of buf->buf to the beginning first. If EOF is reached and the
+ file wasn't terminated by a newline, supply one. Set up BUF's line
+@@ -1466,8 +1753,24 @@
+ else
+ {
+ if (key->skipsblanks)
+- while (blanks[to_uchar (*line_start)])
+- line_start++;
++ {
++#if HAVE_MBRTOWC
++ if (MB_CUR_MAX > 1)
++ {
++ size_t mblength;
++ mbstate_t state;
++ memset (&state, '\0', sizeof(mbstate_t));
++ while (line_start < line->keylim &&
++ ismbblank (line_start,
++ line->keylim - line_start,
++ &mblength))
++ line_start += mblength;
++ }
++ else
++#endif
++ while (blanks[to_uchar (*line_start)])
++ line_start++;
++ }
+ line->keybeg = line_start;
+ }
+ }
+@@ -1500,7 +1803,7 @@
+ hideously fast. */
+
+ static int
+-numcompare (const char *a, const char *b)
++numcompare_uni (const char *a, const char *b)
+ {
+ while (blanks[to_uchar (*a)])
+ a++;
+@@ -1510,6 +1813,25 @@
+ return strnumcmp (a, b, decimal_point, thousands_sep);
+ }
+
++#if HAVE_MBRTOWC
++static int
++numcompare_mb (const char *a, const char *b)
++{
++ size_t mblength, len;
++ len = strlen (a); /* okay for UTF-8 */
++ while (*a && ismbblank (a, len > MB_CUR_MAX ? MB_CUR_MAX : len, &mblength))
++ {
++ a += mblength;
++ len -= mblength;
++ }
++ len = strlen (b); /* okay for UTF-8 */
++ while (*b && ismbblank (b, len > MB_CUR_MAX ? MB_CUR_MAX : len, &mblength))
++ b += mblength;
++
++ return strnumcmp (a, b, decimal_point, thousands_sep);
++}
++#endif /* HAV_EMBRTOWC */
++
+ static int
+ general_numcompare (const char *sa, const char *sb)
+ {
+@@ -1543,7 +1865,7 @@
+ Return 0 if the name in S is not recognized. */
+
+ static int
+-getmonth (char const *month, size_t len)
++getmonth_uni (char const *month, size_t len)
+ {
+ size_t lo = 0;
+ size_t hi = MONTHS_PER_YEAR;
+@@ -1698,11 +2020,79 @@
+ return diff;
+ }
+
++#if HAVE_MBRTOWC
++static int
++getmonth_mb (const char *s, size_t len)
++{
++ char *month;
++ register size_t i;
++ register int lo = 0, hi = MONTHS_PER_YEAR, result;
++ char *tmp;
++ size_t wclength, mblength;
++ const char **pp;
++ const wchar_t **wpp;
++ wchar_t *month_wcs;
++ mbstate_t state;
++
++ while (len > 0 && ismbblank (s, len, &mblength))
++ {
++ s += mblength;
++ len -= mblength;
++ }
++
++ if (len == 0)
++ return 0;
++
++ month = (char *) alloca (len + 1);
++
++ tmp = (char *) alloca (len + 1);
++ memcpy (tmp, s, len);
++ tmp[len] = '\0';
++ pp = (const char **)&tmp;
++ month_wcs = (wchar_t *) alloca ((len + 1) * sizeof (wchar_t));
++ memset (&state, '\0', sizeof(mbstate_t));
++
++ wclength = mbsrtowcs (month_wcs, pp, len + 1, &state);
++ assert (wclength != (size_t)-1 && *pp == NULL);
++
++ for (i = 0; i < wclength; i++)
++ {
++ month_wcs[i] = towupper(month_wcs[i]);
++ if (iswblank (month_wcs[i]))
++ {
++ month_wcs[i] = L'\0';
++ break;
++ }
++ }
++
++ wpp = (const wchar_t **)&month_wcs;
++
++ mblength = wcsrtombs (month, wpp, len + 1, &state);
++ assert (mblength != (-1) && *wpp == NULL);
++
++ do
++ {
++ int ix = (lo + hi) / 2;
++
++ if (strncmp (month, monthtab[ix].name, strlen (monthtab[ix].name)) < 0)
++ hi = ix;
++ else
++ lo = ix;
++ }
++ while (hi - lo > 1);
++
++ result = (!strncmp (month, monthtab[lo].name, strlen (monthtab[lo].name))
++ ? monthtab[lo].val : 0);
++
++ return result;
++}
++#endif
++
+ /* Compare two lines A and B trying every key in sequence until there
+ are no more keys or a difference is found. */
+
+ static int
+-keycompare (const struct line *a, const struct line *b)
++keycompare_uni (const struct line *a, const struct line *b)
+ {
+ struct keyfield const *key = keylist;
+
+@@ -1875,6 +2265,179 @@
+ return key->reverse ? -diff : diff;
+ }
+
++#if HAVE_MBRTOWC
++static int
++keycompare_mb (const struct line *a, const struct line *b)
++{
++ struct keyfield *key = keylist;
++
++ /* For the first iteration only, the key positions have been
++ precomputed for us. */
++ char *texta = a->keybeg;
++ char *textb = b->keybeg;
++ char *lima = a->keylim;
++ char *limb = b->keylim;
++
++ size_t mblength_a, mblength_b;
++ wchar_t wc_a, wc_b;
++ mbstate_t state_a, state_b;
++
++ int diff;
++
++ memset (&state_a, '\0', sizeof(mbstate_t));
++ memset (&state_b, '\0', sizeof(mbstate_t));
++
++ for (;;)
++ {
++ unsigned char *translate = (unsigned char *) key->translate;
++ bool const *ignore = key->ignore;
++
++ /* Find the lengths. */
++ size_t lena = lima <= texta ? 0 : lima - texta;
++ size_t lenb = limb <= textb ? 0 : limb - textb;
++
++ /* Actually compare the fields. */
++ if (key->random)
++ diff = compare_random (texta, lena, textb, lenb);
++ else if (key->numeric | key->general_numeric)
++ {
++ char savea = *lima, saveb = *limb;
++
++ *lima = *limb = '\0';
++ if (force_general_numcompare)
++ diff = general_numcompare (texta, textb);
++ else
++ diff = ((key->numeric ? numcompare : general_numcompare)
++ (texta, textb));
++ *lima = savea, *limb = saveb;
++ }
++ else if (key->month)
++ diff = getmonth (texta, lena) - getmonth (textb, lenb);
++ else
++ {
++ if (ignore || translate)
++ {
++ char *copy_a = (char *) alloca (lena + 1 + lenb + 1);
++ char *copy_b = copy_a + lena + 1;
++ size_t new_len_a, new_len_b;
++ size_t i, j;
++
++ /* Ignore and/or translate chars before comparing. */
++# define IGNORE_CHARS(NEW_LEN, LEN, TEXT, COPY, WC, MBLENGTH, STATE) \
++ do \
++ { \
++ wchar_t uwc; \
++ char mbc[MB_LEN_MAX]; \
++ mbstate_t state_wc; \
++ \
++ for (NEW_LEN = i = 0; i < LEN;) \
++ { \
++ mbstate_t state_bak; \
++ \
++ state_bak = STATE; \
++ MBLENGTH = mbrtowc (&WC, TEXT + i, LEN - i, &STATE); \
++ \
++ if (MBLENGTH == (size_t)-2 || MBLENGTH == (size_t)-1 \
++ || MBLENGTH == 0) \
++ { \
++ if (MBLENGTH == (size_t)-2 || MBLENGTH == (size_t)-1) \
++ STATE = state_bak; \
++ if (!ignore) \
++ COPY[NEW_LEN++] = TEXT[i++]; \
++ continue; \
++ } \
++ \
++ if (ignore) \
++ { \
++ if ((ignore == nonprinting && !iswprint (WC)) \
++ || (ignore == nondictionary \
++ && !iswalnum (WC) && !iswblank (WC))) \
++ { \
++ i += MBLENGTH; \
++ continue; \
++ } \
++ } \
++ \
++ if (translate) \
++ { \
++ \
++ uwc = towupper(WC); \
++ if (WC == uwc) \
++ { \
++ memcpy (mbc, TEXT + i, MBLENGTH); \
++ i += MBLENGTH; \
++ } \
++ else \
++ { \
++ i += MBLENGTH; \
++ WC = uwc; \
++ memset (&state_wc, '\0', sizeof (mbstate_t)); \
++ \
++ MBLENGTH = wcrtomb (mbc, WC, &state_wc); \
++ assert (MBLENGTH != (size_t)-1 && MBLENGTH != 0); \
++ } \
++ \
++ for (j = 0; j < MBLENGTH; j++) \
++ COPY[NEW_LEN++] = mbc[j]; \
++ } \
++ else \
++ for (j = 0; j < MBLENGTH; j++) \
++ COPY[NEW_LEN++] = TEXT[i++]; \
++ } \
++ COPY[NEW_LEN] = '\0'; \
++ } \
++ while (0)
++ IGNORE_CHARS (new_len_a, lena, texta, copy_a,
++ wc_a, mblength_a, state_a);
++ IGNORE_CHARS (new_len_b, lenb, textb, copy_b,
++ wc_b, mblength_b, state_b);
++ diff = xmemcoll (copy_a, new_len_a, copy_b, new_len_b);
++ }
++ else if (lena == 0)
++ diff = - NONZERO (lenb);
++ else if (lenb == 0)
++ goto greater;
++ else
++ diff = xmemcoll (texta, lena, textb, lenb);
++ }
++
++ if (diff)
++ goto not_equal;
++
++ key = key->next;
++ if (! key)
++ break;
++
++ /* Find the beginning and limit of the next field. */
++ if (key->eword != -1)
++ lima = limfield (a, key), limb = limfield (b, key);
++ else
++ lima = a->text + a->length - 1, limb = b->text + b->length - 1;
++
++ if (key->sword != -1)
++ texta = begfield (a, key), textb = begfield (b, key);
++ else
++ {
++ texta = a->text, textb = b->text;
++ if (key->skipsblanks)
++ {
++ while (texta < lima && ismbblank (texta, lima - texta, &mblength_a))
++ texta += mblength_a;
++ while (textb < limb && ismbblank (textb, limb - textb, &mblength_b))
++ textb += mblength_b;
++ }
++ }
++ }
++
++ return 0;
++
++greater:
++ diff = 1;
++not_equal:
++ return key->reverse ? -diff : diff;
++}
++#endif
++
+ /* Compare two lines A and B, returning negative, zero, or positive
+ depending on whether A compares less than, equal to, or greater than B. */
+
+@@ -2744,7 +3305,7 @@
+ initialize_exit_failure (SORT_FAILURE);
+
+ hard_LC_COLLATE = hard_locale (LC_COLLATE);
+-#if HAVE_NL_LANGINFO
++#if HAVE_LANGINFO_CODESET
+ hard_LC_TIME = hard_locale (LC_TIME);
+ #endif
+
+@@ -2765,6 +3326,27 @@
+ thousands_sep = -1;
+ }
+
++#if HAVE_MBRTOWC
++ if (MB_CUR_MAX > 1)
++ {
++ inittables = inittables_mb;
++ begfield = begfield_mb;
++ limfield = limfield_mb;
++ getmonth = getmonth_mb;
++ keycompare = keycompare_mb;
++ numcompare = numcompare_mb;
++ }
++ else
++#endif
++ {
++ inittables = inittables_uni;
++ begfield = begfield_uni;
++ limfield = limfield_uni;
++ getmonth = getmonth_uni;
++ keycompare = keycompare_uni;
++ numcompare = numcompare_uni;
++ }
++
+ have_read_stdin = false;
+ inittables ();
+
+@@ -3015,13 +3597,35 @@
+
+ case 't':
+ {
+- char newtab = optarg[0];
+- if (! newtab)
++ char newtab[MB_LEN_MAX + 1];
++ size_t newtab_length = 1;
++ strncpy (newtab, optarg, MB_LEN_MAX);
++ if (! newtab[0])
+ error (SORT_FAILURE, 0, _("empty tab"));
+- if (optarg[1])
++#if HAVE_MBRTOWC
++ if (MB_CUR_MAX > 1)
++ {
++ wchar_t wc;
++ mbstate_t state;
++ size_t i;
++
++ memset (&state, '\0', sizeof (mbstate_t));
++ newtab_length = mbrtowc (&wc, newtab, strnlen (newtab,
++ MB_LEN_MAX),
++ &state);
++ switch (newtab_length)
++ {
++ case (size_t) -1:
++ case (size_t) -2:
++ case 0:
++ newtab_length = 1;
++ }
++ }
++#endif
++ if (newtab_length == 1 && optarg[1])
+ {
+ if (STREQ (optarg, "\\0"))
+- newtab = '\0';
++ newtab[0] = '\0';
+ else
+ {
+ /* Provoke with `sort -txx'. Complain about
+@@ -3032,9 +3636,12 @@
+ quote (optarg));
+ }
+ }
+- if (tab != TAB_DEFAULT && tab != newtab)
++ if (tab_length
++ && (tab_length != newtab_length
++ || memcmp (tab, newtab, tab_length) != 0))
+ error (SORT_FAILURE, 0, _("incompatible tabs"));
+- tab = newtab;
++ memcpy (tab, newtab, newtab_length);
++ tab_length = newtab_length;
+ }
+ break;
+
+--- coreutils-6.8+/src/unexpand.c.i18n 2007-01-14 15:41:28.000000000 +0000
++++ coreutils-6.8+/src/unexpand.c 2007-03-01 15:08:24.000000000 +0000
+@@ -39,11 +39,28 @@
+ #include <stdio.h>
+ #include <getopt.h>
+ #include <sys/types.h>
++
++/* Get mbstate_t, mbrtowc(), wcwidth(). */
++#if HAVE_WCHAR_H
++# include <wchar.h>
++#endif
++
+ #include "system.h"
+ #include "error.h"
+ #include "quote.h"
+ #include "xstrndup.h"
+
++/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
++ installation; work around this configuration error. */
++#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
++# define MB_LEN_MAX 16
++#endif
++
++/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
++#if HAVE_MBRTOWC && defined mbstate_t
++# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
++#endif
++
+ /* The official name of this program (e.g., no `g' prefix). */
+ #define PROGRAM_NAME "unexpand"
+
+@@ -110,6 +127,208 @@
+ {NULL, 0, NULL, 0}
+ };
+
++static FILE *next_file (FILE *fp);
++
++#if HAVE_MBRTOWC
++static void
++unexpand_multibyte (void)
++{
++ FILE *fp; /* Input stream. */
++ mbstate_t i_state; /* Current shift state of the input stream. */
++ mbstate_t i_state_bak; /* Back up the I_STATE. */
++ mbstate_t o_state; /* Current shift state of the output stream. */
++ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */
++ char *bufpos; /* Next read position of BUF. */
++ size_t buflen = 0; /* The length of the byte sequence in buf. */
++ wint_t wc; /* A gotten wide character. */
++ size_t mblength; /* The byte size of a multibyte character
++ which shows as same character as WC. */
++
++ /* Index in `tab_list' of next tabstop: */
++ int tab_index = 0; /* For calculating width of pending tabs. */
++ int print_tab_index = 0; /* For printing as many tabs as possible. */
++ unsigned int column = 0; /* Column on screen of next char. */
++ int next_tab_column; /* Column the next tab stop is on. */
++ int convert = 1; /* If nonzero, perform translations. */
++ unsigned int pending = 0; /* Pending columns of blanks. */
++
++ fp = next_file ((FILE *) NULL);
++ if (fp == NULL)
++ return;
++
++ memset (&o_state, '\0', sizeof(mbstate_t));
++ memset (&i_state, '\0', sizeof(mbstate_t));
++
++ for (;;)
++ {
++ if (buflen < MB_LEN_MAX && !feof(fp) && !ferror(fp))
++ {
++ memmove (buf, bufpos, buflen);
++ buflen += fread (buf + buflen, sizeof(char), BUFSIZ, fp);
++ bufpos = buf;
++ }
++
++ /* Get a wide character. */
++ if (buflen < 1)
++ {
++ mblength = 1;
++ wc = WEOF;
++ }
++ else
++ {
++ i_state_bak = i_state;
++ mblength = mbrtowc ((wchar_t *)&wc, bufpos, buflen, &i_state);
++ }
++
++ if (mblength == (size_t)-1 || mblength == (size_t)-2)
++ {
++ i_state = i_state_bak;
++ wc = L'\0';
++ }
++
++ if (wc == L' ' && convert && column < INT_MAX)
++ {
++ ++pending;
++ ++column;
++ }
++ else if (wc == L'\t' && convert)
++ {
++ if (tab_size == 0)
++ {
++ /* Do not let tab_index == first_free_tab;
++ stop when it is 1 less. */
++ while (tab_index < first_free_tab - 1
++ && column >= tab_list[tab_index])
++ tab_index++;
++ next_tab_column = tab_list[tab_index];
++ if (tab_index < first_free_tab - 1)
++ tab_index++;
++ if (column >= next_tab_column)
++ {
++ convert = 0; /* Ran out of tab stops. */
++ goto flush_pend_mb;
++ }
++ }
++ else
++ {
++ next_tab_column = column + tab_size - column % tab_size;
++ }
++ pending += next_tab_column - column;
++ column = next_tab_column;
++ }
++ else
++ {
++flush_pend_mb:
++ /* Flush pending spaces. Print as many tabs as possible,
++ then print the rest as spaces. */
++ if (pending == 1)
++ {
++ putchar (' ');
++ pending = 0;
++ }
++ column -= pending;
++ while (pending > 0)
++ {
++ if (tab_size == 0)
++ {
++ /* Do not let print_tab_index == first_free_tab;
++ stop when it is 1 less. */
++ while (print_tab_index < first_free_tab - 1
++ && column >= tab_list[print_tab_index])
++ print_tab_index++;
++ next_tab_column = tab_list[print_tab_index];
++ if (print_tab_index < first_free_tab - 1)
++ print_tab_index++;
++ }
++ else
++ {
++ next_tab_column =
++ column + tab_size - column % tab_size;
++ }
++ if (next_tab_column - column <= pending)
++ {
++ putchar ('\t');
++ pending -= next_tab_column - column;
++ column = next_tab_column;
++ }
++ else
++ {
++ --print_tab_index;
++ column += pending;
++ while (pending != 0)
++ {
++ putchar (' ');
++ pending--;
++ }
++ }
++ }
++
++ if (wc == WEOF)
++ {
++ fp = next_file (fp);
++ if (fp == NULL)
++ break; /* No more files. */
++ else
++ {
++ memset (&i_state, '\0', sizeof(mbstate_t));
++ continue;
++ }
++ }
++
++ if (mblength == (size_t)-1 || mblength == (size_t)-2)
++ {
++ if (convert)
++ {
++ ++column;
++ if (convert_entire_line == 0)
++ convert = 0;
++ }
++ mblength = 1;
++ putchar (buf[0]);
++ }
++ else if (mblength == 0)
++ {
++ if (convert && convert_entire_line == 0)
++ convert = 0;
++ mblength = 1;
++ putchar ('\0');
++ }
++ else
++ {
++ if (convert)
++ {
++ if (wc == L'\b')
++ {
++ if (column > 0)
++ --column;
++ }
++ else
++ {
++ int width; /* The width of WC. */
++
++ width = wcwidth (wc);
++ column += (width > 0) ? width : 0;
++ if (convert_entire_line == 0)
++ convert = 0;
++ }
++ }
++
++ if (wc == L'\n')
++ {
++ tab_index = print_tab_index = 0;
++ column = pending = 0;
++ convert = 1;
++ }
++ fwrite (bufpos, sizeof(char), mblength, stdout);
++ }
++ }
++ buflen -= mblength;
++ bufpos += mblength;
++ }
++}
++#endif
++
++
+ void
+ usage (int status)
+ {
+@@ -531,7 +750,12 @@
+
+ file_list = (optind < argc ? &argv[optind] : stdin_argv);
+
+- unexpand ();
++#if HAVE_MBRTOWC
++ if (MB_CUR_MAX > 1)
++ unexpand_multibyte ();
++ else
++#endif
++ unexpand ();
+
+ if (have_read_stdin && fclose (stdin) != 0)
+ error (EXIT_FAILURE, errno, "-");
+--- coreutils-6.8+/src/pr.c.i18n 2007-01-14 15:41:28.000000000 +0000
++++ coreutils-6.8+/src/pr.c 2007-03-01 15:08:24.000000000 +0000
+@@ -313,6 +313,32 @@
+
+ #include <getopt.h>
+ #include <sys/types.h>
++
++/* Get MB_LEN_MAX. */
++#include <limits.h>
++/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
++ installation; work around this configuration error. */
++#if !defined MB_LEN_MAX || MB_LEN_MAX == 1
++# define MB_LEN_MAX 16
++#endif
++
++/* Get MB_CUR_MAX. */
++#include <stdlib.h>
++
++/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */
++/* Get mbstate_t, mbrtowc(), wcwidth(). */
++#if HAVE_WCHAR_H
++# include <wchar.h>
++#endif
++
++/* Get iswprint(). -- for wcwidth(). */
++#if HAVE_WCTYPE_H
++# include <wctype.h>
++#endif
++#if !defined iswprint && !HAVE_ISWPRINT
++# define iswprint(wc) 1
++#endif
++
+ #include "system.h"
+ #include "error.h"
+ #include "hard-locale.h"
+@@ -324,6 +350,18 @@
+ #include "strftime.h"
+ #include "xstrtol.h"
+
++/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
++#if HAVE_MBRTOWC && defined mbstate_t
++# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
++#endif
++
++#ifndef HAVE_DECL_WCWIDTH
++"this configure-time declaration test was not run"
++#endif
++#if !HAVE_DECL_WCWIDTH
++extern int wcwidth ();
++#endif
++
+ /* The official name of this program (e.g., no `g' prefix). */
+ #define PROGRAM_NAME "pr"
+
+@@ -416,7 +454,20 @@
+
+ #define NULLCOL (COLUMN *)0
+
+-static int char_to_clump (char c);
++/* Funtion pointers to switch functions for single byte locale or for
++ multibyte locale. If multibyte functions do not exist in your sysytem,
++ these pointers always point the function for single byte locale. */
++static void (*print_char) (char c);
++static int (*char_to_clump) (char c);
++
++/* Functions for single byte locale. */
++static void print_char_single (char c);
++static int char_to_clump_single (char c);
++
++/* Functions for multibyte locale. */
++static void print_char_multi (char c);
++static int char_to_clump_multi (char c);
++
+ static bool read_line (COLUMN *p);
+ static bool print_page (void);
+ static bool print_stored (COLUMN *p);
+@@ -426,6 +477,7 @@
+ static void pad_across_to (int position);
+ static void add_line_number (COLUMN *p);
+ static void getoptarg (char *arg, char switch_char, char *character,
++ int *character_length, int *character_width,
+ int *number);
+ void usage (int status);
+ static void print_files (int number_of_files, char **av);
+@@ -440,7 +492,6 @@
+ static void pad_down (int lines);
+ static void read_rest_of_line (COLUMN *p);
+ static void skip_read (COLUMN *p, int column_number);
+-static void print_char (char c);
+ static void cleanup (void);
+ static void print_sep_string (void);
+ static void separator_string (const char *optarg_S);
+@@ -455,7 +506,7 @@
+ we store the leftmost columns contiguously in buff.
+ To print a line from buff, get the index of the first character
+ from line_vector[i], and print up to line_vector[i + 1]. */
+-static char *buff;
++static unsigned char *buff;
+
+ /* Index of the position in buff where the next character
+ will be stored. */
+@@ -559,7 +610,7 @@
+ static bool untabify_input = false;
+
+ /* (-e) The input tab character. */
+-static char input_tab_char = '\t';
++static char input_tab_char[MB_LEN_MAX] = "\t";
+
+ /* (-e) Tabstops are at chars_per_tab, 2*chars_per_tab, 3*chars_per_tab, ...
+ where the leftmost column is 1. */
+@@ -569,7 +620,10 @@
+ static bool tabify_output = false;
+
+ /* (-i) The output tab character. */
+-static char output_tab_char = '\t';
++static char output_tab_char[MB_LEN_MAX] = "\t";
++
++/* (-i) The byte length of output tab character. */
++static int output_tab_char_length = 1;
+
+ /* (-i) The width of the output tab. */
+ static int chars_per_output_tab = 8;
+@@ -643,7 +697,13 @@
+ static bool numbered_lines = false;
+
+ /* (-n) Character which follows each line number. */
+-static char number_separator = '\t';
++static char number_separator[MB_LEN_MAX] = "\t";
++
++/* (-n) The byte length of the character which follows each line number. */
++static int number_separator_length = 1;
++
++/* (-n) The character width of the character which follows each line number. */
++static int number_separator_width = 0;
+
+ /* (-n) line counting starts with 1st line of input file (not with 1st
+ line of 1st page printed). */
+@@ -696,6 +756,7 @@
+ -a|COLUMN|-m is a `space' and with the -J option a `tab'. */
+ static char *col_sep_string = "";
+ static int col_sep_length = 0;
++static int col_sep_width = 0;
+ static char *column_separator = " ";
+ static char *line_separator = "\t";
+
+@@ -852,6 +913,13 @@
+ col_sep_length = (int) strlen (optarg_S);
+ col_sep_string = xmalloc (col_sep_length + 1);
+ strcpy (col_sep_string, optarg_S);
++
++#if HAVE_MBRTOWC
++ if (MB_CUR_MAX > 1)
++ col_sep_width = mbswidth (col_sep_string, 0);
++ else
++#endif
++ col_sep_width = col_sep_length;
+ }
+
+ int
+@@ -877,6 +945,21 @@
+
+ atexit (close_stdout);
+
++/* Define which functions are used, the ones for single byte locale or the ones
++ for multibyte locale. */
++#if HAVE_MBRTOWC
++ if (MB_CUR_MAX > 1)
++ {
++ print_char = print_char_multi;
++ char_to_clump = char_to_clump_multi;
++ }
++ else
++#endif
++ {
++ print_char = print_char_single;
++ char_to_clump = char_to_clump_single;
++ }
++
+ n_files = 0;
+ file_names = (argc > 1
+ ? xmalloc ((argc - 1) * sizeof (char *))
+@@ -949,8 +1032,12 @@
+ break;
+ case 'e':
+ if (optarg)
+- getoptarg (optarg, 'e', &input_tab_char,
+- &chars_per_input_tab);
++ {
++ int dummy_length, dummy_width;
++
++ getoptarg (optarg, 'e', input_tab_char, &dummy_length,
++ &dummy_width, &chars_per_input_tab);
++ }
+ /* Could check tab width > 0. */
+ untabify_input = true;
+ break;
+@@ -963,8 +1050,12 @@
+ break;
+ case 'i':
+ if (optarg)
+- getoptarg (optarg, 'i', &output_tab_char,
+- &chars_per_output_tab);
++ {
++ int dummy_width;
++
++ getoptarg (optarg, 'i', output_tab_char, &output_tab_char_length,
++ &dummy_width, &chars_per_output_tab);
++ }
+ /* Could check tab width > 0. */
+ tabify_output = true;
+ break;
+@@ -991,8 +1082,8 @@
+ case 'n':
+ numbered_lines = true;
+ if (optarg)
+- getoptarg (optarg, 'n', &number_separator,
+- &chars_per_number);
++ getoptarg (optarg, 'n', number_separator, &number_separator_length,
++ &number_separator_width, &chars_per_number);
+ break;
+ case 'N':
+ skip_count = false;
+@@ -1031,7 +1122,7 @@
+ old_s = false;
+ /* Reset an additional input of -s, -S dominates -s */
+ col_sep_string = "";
+- col_sep_length = 0;
++ col_sep_length = col_sep_width = 0;
+ use_col_separator = true;
+ if (optarg)
+ separator_string (optarg);
+@@ -1188,10 +1279,45 @@
+ a number. */
+
+ static void
+-getoptarg (char *arg, char switch_char, char *character, int *number)
++getoptarg (char *arg, char switch_char, char *character, int *character_length,
++ int *character_width, int *number)
+ {
+ if (!ISDIGIT (*arg))
+- *character = *arg++;
++ {
++#ifdef HAVE_MBRTOWC
++ if (MB_CUR_MAX > 1) /* for multibyte locale. */
++ {
++ wchar_t wc;
++ size_t mblength;
++ int width;
++ mbstate_t state = {'\0'};
++
++ mblength = mbrtowc (&wc, arg, strnlen(arg, MB_LEN_MAX), &state);
++
++ if (mblength == (size_t)-1 || mblength == (size_t)-2)
++ {
++ *character_length = 1;
++ *character_width = 1;
++ }
++ else
++ {
++ *character_length = (mblength < 1) ? 1 : mblength;
++ width = wcwidth (wc);
++ *character_width = (width < 0) ? 0 : width;
++ }
++
++ strncpy (character, arg, *character_length);
++ arg += *character_length;
++ }
++ else /* for single byte locale. */
++#endif
++ {
++ *character = *arg++;
++ *character_length = 1;
++ *character_width = 1;
++ }
++ }
++
+ if (*arg)
+ {
+ long int tmp_long;
+@@ -1256,7 +1382,7 @@
+ else
+ col_sep_string = column_separator;
+
+- col_sep_length = 1;
++ col_sep_length = col_sep_width = 1;
+ use_col_separator = true;
+ }
+ /* It's rather pointless to define a TAB separator with column
+@@ -1288,11 +1414,11 @@
+ TAB_WIDTH (chars_per_input_tab, chars_per_number); */
+
+ /* Estimate chars_per_text without any margin and keep it constant. */
+- if (number_separator == '\t')
++ if (number_separator[0] == '\t')
+ number_width = chars_per_number +
+ TAB_WIDTH (chars_per_default_tab, chars_per_number);
+ else
+- number_width = chars_per_number + 1;
++ number_width = chars_per_number + number_separator_width;
+
+ /* The number is part of the column width unless we are
+ printing files in parallel. */
+@@ -1307,7 +1433,7 @@
+ }
+
+ chars_per_column = (chars_per_line - chars_used_by_number -
+- (columns - 1) * col_sep_length) / columns;
++ (columns - 1) * col_sep_width) / columns;
+
+ if (chars_per_column < 1)
+ error (EXIT_FAILURE, 0, _("page width too narrow"));
+@@ -1432,7 +1558,7 @@
+
+ /* Enlarge p->start_position of first column to use the same form of
+ padding_not_printed with all columns. */
+- h = h + col_sep_length;
++ h = h + col_sep_width;
+
+ /* This loop takes care of all but the rightmost column. */
+
+@@ -1466,7 +1592,7 @@
+ }
+ else
+ {
+- h = h_next + col_sep_length;
++ h = h_next + col_sep_width;
+ h_next = h + chars_per_column;
+ }
+ }
+@@ -1756,9 +1882,9 @@
+ align_column (COLUMN *p)
+ {
+ padding_not_printed = p->start_position;
+- if (padding_not_printed - col_sep_length > 0)
++ if (padding_not_printed - col_sep_width > 0)
+ {
+- pad_across_to (padding_not_printed - col_sep_length);
++ pad_across_to (padding_not_printed - col_sep_width);
+ padding_not_printed = ANYWHERE;
+ }
+
+@@ -2029,13 +2155,13 @@
+ /* May be too generous. */
+ buff = X2REALLOC (buff, &buff_allocated);
+ }
+- buff[buff_current++] = c;
++ buff[buff_current++] = (unsigned char) c;
+ }
+
+ static void
+ add_line_number (COLUMN *p)
+ {
+- int i;
++ int i, j;
+ char *s;
+ int left_cut;
+
+@@ -2058,22 +2184,24 @@
+ /* Tabification is assumed for multiple columns, also for n-separators,
+ but `default n-separator = TAB' hasn't been given priority over
+ equal column_width also specified by POSIX. */
+- if (number_separator == '\t')
++ if (number_separator[0] == '\t')
+ {
+ i = number_width - chars_per_number;
+ while (i-- > 0)
+ (p->char_func) (' ');
+ }
+ else
+- (p->char_func) (number_separator);
++ for (j = 0; j < number_separator_length; j++)
++ (p->char_func) (number_separator[j]);
+ }
+ else
+ /* To comply with POSIX, we avoid any expansion of default TAB
+ separator with a single column output. No column_width requirement
+ has to be considered. */
+ {
+- (p->char_func) (number_separator);
+- if (number_separator == '\t')
++ for (j = 0; j < number_separator_length; j++)
++ (p->char_func) (number_separator[j]);
++ if (number_separator[0] == '\t')
+ output_position = POS_AFTER_TAB (chars_per_output_tab,
+ output_position);
+ }
+@@ -2234,7 +2362,7 @@
+ while (goal - h_old > 1
+ && (h_new = POS_AFTER_TAB (chars_per_output_tab, h_old)) <= goal)
+ {
+- putchar (output_tab_char);
++ fwrite (output_tab_char, sizeof(char), output_tab_char_length, stdout);
+ h_old = h_new;
+ }
+ while (++h_old <= goal)
+@@ -2254,6 +2382,7 @@
+ {
+ char *s;
+ int l = col_sep_length;
++ int not_space_flag;
+
+ s = col_sep_string;
+
+@@ -2267,6 +2396,7 @@
+ {
+ for (; separators_not_printed > 0; --separators_not_printed)
+ {
++ not_space_flag = 0;
+ while (l-- > 0)
+ {
+ /* 3 types of sep_strings: spaces only, spaces and chars,
+@@ -2280,12 +2410,15 @@
+ }
+ else
+ {
++ not_space_flag = 1;
+ if (spaces_not_printed > 0)
+ print_white_space ();
+ putchar (*s++);
+- ++output_position;
+ }
+ }
++ if (not_space_flag)
++ output_position += col_sep_width;
++
+ /* sep_string ends with some spaces */
+ if (spaces_not_printed > 0)
+ print_white_space ();
+@@ -2313,7 +2446,7 @@
+ required number of tabs and spaces. */
+
+ static void
+-print_char (char c)
++print_char_single (char c)
+ {
+ if (tabify_output)
+ {
+@@ -2337,6 +2470,74 @@
+ putchar (c);
+ }
+
++#ifdef HAVE_MBRTOWC
++static void
++print_char_multi (char c)
++{
++ static size_t mbc_pos = 0;
++ static char mbc[MB_LEN_MAX] = {'\0'};
++ static mbstate_t state = {'\0'};
++ mbstate_t state_bak;
++ wchar_t wc;
++ size_t mblength;
++ int width;
++
++ if (tabify_output)
++ {
++ state_bak = state;
++ mbc[mbc_pos++] = c;
++ mblength = mbrtowc (&wc, mbc, mbc_pos, &state);
++
++ while (mbc_pos > 0)
++ {
++ switch (mblength)
++ {
++ case (size_t)-2:
++ state = state_bak;
++ return;
++
++ case (size_t)-1:
++ state = state_bak;
++ ++output_position;
++ putchar (mbc[0]);
++ memmove (mbc, mbc + 1, MB_CUR_MAX - 1);
++ --mbc_pos;
++ break;
++
++ case 0:
++ mblength = 1;
++
++ default:
++ if (wc == L' ')
++ {
++ memmove (mbc, mbc + mblength, MB_CUR_MAX - mblength);
++ --mbc_pos;
++ ++spaces_not_printed;
++ return;
++ }
++ else if (spaces_not_printed > 0)
++ print_white_space ();
++
++ /* Nonprintables are assumed to have width 0, except L'\b'. */
++ if ((width = wcwidth (wc)) < 1)
++ {
++ if (wc == L'\b')
++ --output_position;
++ }
++ else
++ output_position += width;
++
++ fwrite (mbc, sizeof(char), mblength, stdout);
++ memmove (mbc, mbc + mblength, MB_CUR_MAX - mblength);
++ mbc_pos -= mblength;
++ }
++ }
++ return;
++ }
++ putchar (c);
++}
++#endif
++
+ /* Skip to page PAGE before printing.
+ PAGE may be larger than total number of pages. */
+
+@@ -2517,9 +2718,9 @@
+ align_empty_cols = false;
+ }
+
+- if (padding_not_printed - col_sep_length > 0)
++ if (padding_not_printed - col_sep_width > 0)
+ {
+- pad_across_to (padding_not_printed - col_sep_length);
++ pad_across_to (padding_not_printed - col_sep_width);
+ padding_not_printed = ANYWHERE;
+ }
+
+@@ -2620,9 +2821,9 @@
+ }
+ }
+
+- if (padding_not_printed - col_sep_length > 0)
++ if (padding_not_printed - col_sep_width > 0)
+ {
+- pad_across_to (padding_not_printed - col_sep_length);
++ pad_across_to (padding_not_printed - col_sep_width);
+ padding_not_printed = ANYWHERE;
+ }
+
+@@ -2635,8 +2836,8 @@
+ if (spaces_not_printed == 0)
+ {
+ output_position = p->start_position + end_vector[line];
+- if (p->start_position - col_sep_length == chars_per_margin)
+- output_position -= col_sep_length;
++ if (p->start_position - col_sep_width == chars_per_margin)
++ output_position -= col_sep_width;
+ }
+
+ return true;
+@@ -2655,7 +2856,7 @@
+ number of characters is 1.) */
+
+ static int
+-char_to_clump (char c)
++char_to_clump_single (char c)
+ {
+ unsigned char uc = c;
+ char *s = clump_buff;
+@@ -2665,10 +2866,10 @@
+ int chars;
+ int chars_per_c = 8;
+
+- if (c == input_tab_char)
++ if (c == input_tab_char[0])
+ chars_per_c = chars_per_input_tab;
+
+- if (c == input_tab_char || c == '\t')
++ if (c == input_tab_char[0] || c == '\t')
+ {
+ width = TAB_WIDTH (chars_per_c, input_position);
+
+@@ -2739,6 +2940,154 @@
+ return chars;
+ }
+
++#ifdef HAVE_MBRTOWC
++static int
++char_to_clump_multi (char c)
++{
++ static size_t mbc_pos = 0;
++ static char mbc[MB_LEN_MAX] = {'\0'};
++ static mbstate_t state = {'\0'};
++ mbstate_t state_bak;
++ wchar_t wc;
++ size_t mblength;
++ int wc_width;
++ register char *s = clump_buff;
++ register int i, j;
++ char esc_buff[4];
++ int width;
++ int chars;
++ int chars_per_c = 8;
++
++ state_bak = state;
++ mbc[mbc_pos++] = c;
++ mblength = mbrtowc (&wc, mbc, mbc_pos, &state);
++
++ width = 0;
++ chars = 0;
++ while (mbc_pos > 0)
++ {
++ switch (mblength)
++ {
++ case (size_t)-2:
++ state = state_bak;
++ return 0;
++
++ case (size_t)-1:
++ state = state_bak;
++ mblength = 1;
++
++ if (use_esc_sequence || use_cntrl_prefix)
++ {
++ width = +4;
++ chars = +4;
++ *s++ = '\\';
++ sprintf (esc_buff, "%03o", mbc[0]);
++ for (i = 0; i <= 2; ++i)
++ *s++ = (int) esc_buff[i];
++ }
++ else
++ {
++ width += 1;
++ chars += 1;
++ *s++ = mbc[0];
++ }
++ break;
++
++ case 0:
++ mblength = 1;
++ /* Fall through */
++
++ default:
++ if (memcmp (mbc, input_tab_char, mblength) == 0)
++ chars_per_c = chars_per_input_tab;
++
++ if (memcmp (mbc, input_tab_char, mblength) == 0 || c == '\t')
++ {
++ int width_inc;
++
++ width_inc = TAB_WIDTH (chars_per_c, input_position);
++ width += width_inc;
++
++ if (untabify_input)
++ {
++ for (i = width_inc; i; --i)
++ *s++ = ' ';
++ chars += width_inc;
++ }
++ else
++ {
++ for (i = 0; i < mblength; i++)
++ *s++ = mbc[i];
++ chars += mblength;
++ }
++ }
++ else if ((wc_width = wcwidth (wc)) < 1)
++ {
++ if (use_esc_sequence)
++ {
++ for (i = 0; i < mblength; i++)
++ {
++ width += 4;
++ chars += 4;
++ *s++ = '\\';
++ sprintf (esc_buff, "%03o", c);
++ for (j = 0; j <= 2; ++j)
++ *s++ = (int) esc_buff[j];
++ }
++ }
++ else if (use_cntrl_prefix)
++ {
++ if (wc < 0200)
++ {
++ width += 2;
++ chars += 2;
++ *s++ = '^';
++ *s++ = wc ^ 0100;
++ }
++ else
++ {
++ for (i = 0; i < mblength; i++)
++ {
++ width += 4;
++ chars += 4;
++ *s++ = '\\';
++ sprintf (esc_buff, "%03o", c);
++ for (j = 0; j <= 2; ++j)
++ *s++ = (int) esc_buff[j];
++ }
++ }
++ }
++ else if (wc == L'\b')
++ {
++ width += -1;
++ chars += 1;
++ *s++ = c;
++ }
++ else
++ {
++ width += 0;
++ chars += mblength;
++ for (i = 0; i < mblength; i++)
++ *s++ = mbc[i];
++ }
++ }
++ else
++ {
++ width += wc_width;
++ chars += mblength;
++ for (i = 0; i < mblength; i++)
++ *s++ = mbc[i];
++ }
++ }
++ memmove (mbc, mbc + mblength, MB_CUR_MAX - mblength);
++ mbc_pos -= mblength;
++ }
++
++ input_position += width;
++ return chars;
++}
++#endif
++
+ /* We've just printed some files and need to clean up things before
+ looking for more options and printing the next batch of files.
+
+--- coreutils-6.8+/src/cut.c.i18n 2007-01-14 15:41:28.000000000 +0000
++++ coreutils-6.8+/src/cut.c 2007-03-01 15:08:24.000000000 +0000
+@@ -29,6 +29,11 @@
+ #include <assert.h>
+ #include <getopt.h>
+ #include <sys/types.h>
++
++/* Get mbstate_t, mbrtowc(). */
++#if HAVE_WCHAR_H
++# include <wchar.h>
++#endif
+ #include "system.h"
+
+ #include "error.h"
+@@ -37,6 +42,18 @@
+ #include "quote.h"
+ #include "xstrndup.h"
+
++/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
++ installation; work around this configuration error. */
++#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
++# undef MB_LEN_MAX
++# define MB_LEN_MAX 16
++#endif
++
++/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
++#if HAVE_MBRTOWC && defined mbstate_t
++# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
++#endif
++
+ /* The official name of this program (e.g., no `g' prefix). */
+ #define PROGRAM_NAME "cut"
+
+@@ -67,6 +84,52 @@
+ } \
+ while (0)
+
++/* Refill the buffer BUF to get a multibyte character. */
++#define REFILL_BUFFER(BUF, BUFPOS, BUFLEN, STREAM) \
++ do \
++ { \
++ if (BUFLEN < MB_LEN_MAX && !feof (STREAM) && !ferror (STREAM)) \
++ { \
++ memmove (BUF, BUFPOS, BUFLEN); \
++ BUFLEN += fread (BUF + BUFLEN, sizeof(char), BUFSIZ, STREAM); \
++ BUFPOS = BUF; \
++ } \
++ } \
++ while (0)
++
++/* Get wide character on BUFPOS. BUFPOS is not included after that.
++ If byte sequence is not valid as a character, CONVFAIL is 1. Otherwise 0. */
++#define GET_NEXT_WC_FROM_BUFFER(WC, BUFPOS, BUFLEN, MBLENGTH, STATE, CONVFAIL) \
++ do \
++ { \
++ mbstate_t state_bak; \
++ \
++ if (BUFLEN < 1) \
++ { \
++ WC = WEOF; \
++ break; \
++ } \
++ \
++ /* Get a wide character. */ \
++ CONVFAIL = 0; \
++ state_bak = STATE; \
++ MBLENGTH = mbrtowc ((wchar_t *)&WC, BUFPOS, BUFLEN, &STATE); \
++ \
++ switch (MBLENGTH) \
++ { \
++ case (size_t)-1: \
++ case (size_t)-2: \
++ CONVFAIL++; \
++ STATE = state_bak; \
++ /* Fall througn. */ \
++ \
++ case 0: \
++ MBLENGTH = 1; \
++ break; \
++ } \
++ } \
++ while (0)
++
+ struct range_pair
+ {
+ size_t lo;
+@@ -85,7 +148,7 @@
+ /* The number of bytes allocated for FIELD_1_BUFFER. */
+ static size_t field_1_bufsize;
+
+-/* The largest field or byte index used as an endpoint of a closed
++/* The largest byte, character or field index used as an endpoint of a closed
+ or degenerate range specification; this doesn't include the starting
+ index of right-open-ended ranges. For example, with either range spec
+ `2-5,9-', `2-3,5,9-' this variable would be set to 5. */
+@@ -97,10 +160,11 @@
+
+ /* This is a bit vector.
+ In byte mode, which bytes to output.
++ In character mode, which characters to output.
+ In field mode, which DELIM-separated fields to output.
+- Both bytes and fields are numbered starting with 1,
++ Bytes, characters and fields are numbered starting with 1,
+ so the zeroth bit of this array is unused.
+- A field or byte K has been selected if
++ A byte, character or field K has been selected if
+ (K <= MAX_RANGE_ENDPOINT and is_printable_field(K))
+ || (EOL_RANGE_START > 0 && K >= EOL_RANGE_START). */
+ static unsigned char *printable_field;
+@@ -109,9 +173,12 @@
+ {
+ undefined_mode,
+
+- /* Output characters that are in the given bytes. */
++ /* Output bytes that are at the given positions. */
+ byte_mode,
+
++ /* Output characters that are at the given positions. */
++ character_mode,
++
+ /* Output the given delimeter-separated fields. */
+ field_mode
+ };
+@@ -121,6 +188,13 @@
+
+ static enum operating_mode operating_mode;
+
++/* If nonzero, when in byte mode, don't split multibyte characters. */
++static int byte_mode_character_aware;
++
++/* If nonzero, the function for single byte locale is work
++ if this program runs on multibyte locale. */
++static int force_singlebyte_mode;
++
+ /* If true do not output lines containing no delimeter characters.
+ Otherwise, all such lines are printed. This option is valid only
+ with field mode. */
+@@ -132,6 +206,9 @@
+
+ /* The delimeter character for field mode. */
+ static unsigned char delim;
++#if HAVE_WCHAR_H
++static wchar_t wcdelim;
++#endif
+
+ /* True if the --output-delimiter=STRING option was specified. */
+ static bool output_delimiter_specified;
+@@ -205,7 +282,7 @@
+ -f, --fields=LIST select only these fields; also print any line\n\
+ that contains no delimiter character, unless\n\
+ the -s option is specified\n\
+- -n (ignored)\n\
++ -n with -b: don't split multibyte characters\n\
+ "), stdout);
+ fputs (_("\
+ --complement complement the set of selected bytes, characters\n\
+@@ -362,7 +439,7 @@
+ in_digits = false;
+ /* Starting a range. */
+ if (dash_found)
+- FATAL_ERROR (_("invalid byte or field list"));
++ FATAL_ERROR (_("invalid byte, character or field list"));
+ dash_found = true;
+ fieldstr++;
+
+@@ -387,14 +464,16 @@
+ if (value == 0)
+ {
+ /* `n-'. From `initial' to end of line. */
+- eol_range_start = initial;
++ if (eol_range_start == 0 ||
++ (eol_range_start != 0 && eol_range_start > initial))
++ eol_range_start = initial;
+ field_found = true;
+ }
+ else
+ {
+ /* `m-n' or `-n' (1-n). */
+ if (value < initial)
+- FATAL_ERROR (_("invalid byte or field list"));
++ FATAL_ERROR (_("invalid byte, character or field list"));
+
+ /* Is there already a range going to end of line? */
+ if (eol_range_start != 0)
+@@ -467,6 +546,9 @@
+ if (operating_mode == byte_mode)
+ error (0, 0,
+ _("byte offset %s is too large"), quote (bad_num));
++ else if (operating_mode == character_mode)
++ error (0, 0,
++ _("character offset %s is too large"), quote (bad_num));
+ else
+ error (0, 0,
+ _("field number %s is too large"), quote (bad_num));
+@@ -477,7 +559,7 @@
+ fieldstr++;
+ }
+ else
+- FATAL_ERROR (_("invalid byte or field list"));
++ FATAL_ERROR (_("invalid byte, character or field list"));
+ }
+
+ max_range_endpoint = 0;
+@@ -570,6 +652,63 @@
+ }
+ }
+
++#if HAVE_MBRTOWC
++/* This function is in use for the following case.
++
++ 1. Read from the stream STREAM, printing to standard output any selected
++ characters.
++
++ 2. Read from stream STREAM, printing to standard output any selected bytes,
++ without splitting multibyte characters. */
++
++static void
++cut_characters_or_cut_bytes_no_split (FILE *stream)
++{
++ int idx; /* number of bytes or characters in the line so far. */
++ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */
++ char *bufpos; /* Next read position of BUF. */
++ size_t buflen; /* The length of the byte sequence in buf. */
++ wint_t wc; /* A gotten wide character. */
++ size_t mblength; /* The byte size of a multibyte character which shows
++ as same character as WC. */
++ mbstate_t state; /* State of the stream. */
++ int convfail; /* 1, when conversion is failed. Otherwise 0. */
++
++ idx = 0;
++ buflen = 0;
++ bufpos = buf;
++ memset (&state, '\0', sizeof(mbstate_t));
++
++ while (1)
++ {
++ REFILL_BUFFER (buf, bufpos, buflen, stream);
++
++ GET_NEXT_WC_FROM_BUFFER (wc, bufpos, buflen, mblength, state, convfail);
++
++ if (wc == WEOF)
++ {
++ if (idx > 0)
++ putchar ('\n');
++ break;
++ }
++ else if (wc == L'\n')
++ {
++ putchar ('\n');
++ idx = 0;
++ }
++ else
++ {
++ idx += (operating_mode == byte_mode) ? mblength : 1;
++ if (print_kth (idx, NULL))
++ fwrite (bufpos, mblength, sizeof(char), stdout);
++ }
++
++ buflen -= mblength;
++ bufpos += mblength;
++ }
++}
++#endif
++
+ /* Read from stream STREAM, printing to standard output any selected fields. */
+
+ static void
+@@ -692,13 +831,192 @@
+ }
+ }
+
++#if HAVE_MBRTOWC
++static void
++cut_fields_mb (FILE *stream)
++{
++ int c;
++ unsigned int field_idx;
++ int found_any_selected_field;
++ int buffer_first_field;
++ int empty_input;
++ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */
++ char *bufpos; /* Next read position of BUF. */
++ size_t buflen; /* The length of the byte sequence in buf. */
++ wint_t wc = 0; /* A gotten wide character. */
++ size_t mblength; /* The byte size of a multibyte character which shows
++ as same character as WC. */
++ mbstate_t state; /* State of the stream. */
++ int convfail; /* 1, when conversion is failed. Otherwise 0. */
++
++ found_any_selected_field = 0;
++ field_idx = 1;
++ bufpos = buf;
++ buflen = 0;
++ memset (&state, '\0', sizeof(mbstate_t));
++
++ c = getc (stream);
++ empty_input = (c == EOF);
++ if (c != EOF)
++ ungetc (c, stream);
++ else
++ wc = WEOF;
++
++ /* To support the semantics of the -s flag, we may have to buffer
++ all of the first field to determine whether it is `delimited.'
++ But that is unnecessary if all non-delimited lines must be printed
++ and the first field has been selected, or if non-delimited lines
++ must be suppressed and the first field has *not* been selected.
++ That is because a non-delimited line has exactly one field. */
++ buffer_first_field = (suppress_non_delimited ^ !print_kth (1, NULL));
++
++ while (1)
++ {
++ if (field_idx == 1 && buffer_first_field)
++ {
++ int len = 0;
++
++ while (1)
++ {
++ REFILL_BUFFER (buf, bufpos, buflen, stream);
++
++ GET_NEXT_WC_FROM_BUFFER
++ (wc, bufpos, buflen, mblength, state, convfail);
++
++ if (wc == WEOF)
++ break;
++
++ field_1_buffer = xrealloc (field_1_buffer, len + mblength);
++ memcpy (field_1_buffer + len, bufpos, mblength);
++ len += mblength;
++ buflen -= mblength;
++ bufpos += mblength;
++
++ if (!convfail && (wc == L'\n' || wc == wcdelim))
++ break;
++ }
++
++ if (wc == WEOF)
++ break;
++
++ /* If the first field extends to the end of line (it is not
++ delimited) and we are printing all non-delimited lines,
++ print this one. */
++ if (convfail || (!convfail && wc != wcdelim))
++ {
++ if (suppress_non_delimited)
++ {
++ /* Empty. */
++ }
++ else
++ {
++ fwrite (field_1_buffer, sizeof (char), len, stdout);
++ /* Make sure the output line is newline terminated. */
++ if (convfail || (!convfail && wc != L'\n'))
++ putchar ('\n');
++ }
++ continue;
++ }
++
++ if (print_kth (1, NULL))
++ {
++ /* Print the field, but not the trailing delimiter. */
++ fwrite (field_1_buffer, sizeof (char), len - 1, stdout);
++ found_any_selected_field = 1;
++ }
++ ++field_idx;
++ }
++
++ if (wc != WEOF)
++ {
++ if (print_kth (field_idx, NULL))
++ {
++ if (found_any_selected_field)
++ {
++ fwrite (output_delimiter_string, sizeof (char),
++ output_delimiter_length, stdout);
++ }
++ found_any_selected_field = 1;
++ }
++
++ while (1)
++ {
++ REFILL_BUFFER (buf, bufpos, buflen, stream);
++
++ GET_NEXT_WC_FROM_BUFFER
++ (wc, bufpos, buflen, mblength, state, convfail);
++
++ if (wc == WEOF)
++ break;
++ else if (!convfail && (wc == wcdelim || wc == L'\n'))
++ {
++ buflen -= mblength;
++ bufpos += mblength;
++ break;
++ }
++
++ if (print_kth (field_idx, NULL))
++ fwrite (bufpos, mblength, sizeof(char), stdout);
++
++ buflen -= mblength;
++ bufpos += mblength;
++ }
++ }
++
++ if ((!convfail || wc == L'\n') && buflen < 1)
++ wc = WEOF;
++
++ if (!convfail && wc == wcdelim)
++ ++field_idx;
++ else if (wc == WEOF || (!convfail && wc == L'\n'))
++ {
++ if (found_any_selected_field
++ || (!empty_input && !(suppress_non_delimited && field_idx == 1)))
++ putchar ('\n');
++ if (wc == WEOF)
++ break;
++ field_idx = 1;
++ found_any_selected_field = 0;
++ }
++ }
++}
++#endif
++
+ static void
+ cut_stream (FILE *stream)
+ {
+- if (operating_mode == byte_mode)
+- cut_bytes (stream);
++#if HAVE_MBRTOWC
++ if (MB_CUR_MAX > 1 && !force_singlebyte_mode)
++ {
++ switch (operating_mode)
++ {
++ case byte_mode:
++ if (byte_mode_character_aware)
++ cut_characters_or_cut_bytes_no_split (stream);
++ else
++ cut_bytes (stream);
++ break;
++
++ case character_mode:
++ cut_characters_or_cut_bytes_no_split (stream);
++ break;
++
++ case field_mode:
++ cut_fields_mb (stream);
++ break;
++
++ default:
++ abort ();
++ }
++ }
+ else
+- cut_fields (stream);
++#endif
++ {
++ if (operating_mode == field_mode)
++ cut_fields (stream);
++ else
++ cut_bytes (stream);
++ }
+ }
+
+ /* Process file FILE to standard output.
+@@ -748,6 +1066,8 @@
+ bool ok;
+ bool delim_specified = false;
+ char *spec_list_string IF_LINT(= NULL);
++ char mbdelim[MB_LEN_MAX + 1];
++ size_t delimlen = 0;
+
+ initialize_main (&argc, &argv);
+ program_name = argv[0];
+@@ -770,7 +1090,6 @@
+ switch (optc)
+ {
+ case 'b':
+- case 'c':
+ /* Build the byte list. */
+ if (operating_mode != undefined_mode)
+ FATAL_ERROR (_("only one type of list may be specified"));
+@@ -778,6 +1097,14 @@
+ spec_list_string = optarg;
+ break;
+
++ case 'c':
++ /* Build the character list. */
++ if (operating_mode != undefined_mode)
++ FATAL_ERROR (_("only one type of list may be specified"));
++ operating_mode = character_mode;
++ spec_list_string = optarg;
++ break;
++
+ case 'f':
+ /* Build the field list. */
+ if (operating_mode != undefined_mode)
+@@ -789,10 +1116,35 @@
+ case 'd':
+ /* New delimiter. */
+ /* Interpret -d '' to mean `use the NUL byte as the delimiter.' */
+- if (optarg[0] != '\0' && optarg[1] != '\0')
+- FATAL_ERROR (_("the delimiter must be a single character"));
+- delim = optarg[0];
+- delim_specified = true;
++#if HAVE_MBRTOWC
++ {
++ if(MB_CUR_MAX > 1)
++ {
++ mbstate_t state;
++
++ memset (&state, '\0', sizeof(mbstate_t));
++ delimlen = mbrtowc (&wcdelim, optarg, strnlen(optarg, MB_LEN_MAX), &state);
++
++ if (delimlen == (size_t)-1 || delimlen == (size_t)-2)
++ ++force_singlebyte_mode;
++ else
++ {
++ delimlen = (delimlen < 1) ? 1 : delimlen;
++ if (wcdelim != L'\0' && *(optarg + delimlen) != '\0')
++ FATAL_ERROR (_("the delimiter must be a single character"));
++ memcpy (mbdelim, optarg, delimlen);
++ }
++ }
++
++ if (MB_CUR_MAX <= 1 || force_singlebyte_mode)
++#endif
++ {
++ if (optarg[0] != '\0' && optarg[1] != '\0')
++ FATAL_ERROR (_("the delimiter must be a single character"));
++ delim = (unsigned char) optarg[0];
++ }
++ delim_specified = true;
++ }
+ break;
+
+ case OUTPUT_DELIMITER_OPTION:
+@@ -805,6 +1157,7 @@
+ break;
+
+ case 'n':
++ byte_mode_character_aware = 1;
+ break;
+
+ case 's':
+@@ -827,7 +1180,7 @@
+ if (operating_mode == undefined_mode)
+ FATAL_ERROR (_("you must specify a list of bytes, characters, or fields"));
+
+- if (delim != '\0' && operating_mode != field_mode)
++ if (delim_specified && operating_mode != field_mode)
+ FATAL_ERROR (_("an input delimiter may be specified only\
+ when operating on fields"));
+
+@@ -854,15 +1207,34 @@
+ }
+
+ if (!delim_specified)
+- delim = '\t';
++ {
++ delim = '\t';
++#ifdef HAVE_MBRTOWC
++ wcdelim = L'\t';
++ mbdelim[0] = '\t';
++ mbdelim[1] = '\0';
++ delimlen = 1;
++#endif
++ }
+
+ if (output_delimiter_string == NULL)
+ {
+- static char dummy[2];
+- dummy[0] = delim;
+- dummy[1] = '\0';
+- output_delimiter_string = dummy;
+- output_delimiter_length = 1;
++#ifdef HAVE_MBRTOWC
++ if (MB_CUR_MAX > 1 && !force_singlebyte_mode)
++ {
++ output_delimiter_string = xstrdup(mbdelim);
++ output_delimiter_length = delimlen;
++ }
++
++ if (MB_CUR_MAX <= 1 || force_singlebyte_mode)
++#endif
++ {
++ static char dummy[2];
++ dummy[0] = delim;
++ dummy[1] = '\0';
++ output_delimiter_string = dummy;
++ output_delimiter_length = 1;
++ }
+ }
+
+ if (optind == argc)
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-ls-x.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-ls-x.patch
new file mode 100644
index 000000000..aba8742f6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-ls-x.patch
@@ -0,0 +1,117 @@
+Upstream-Status: Inappropriate [legacy version]
+
+This patch was imported from the Fedora Core 8 coreutils-6.9-9 package.
+
+The package is stated as being Licensed as GPLv2+.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+--- coreutils-6.9/src/ls.c.ls-x 2007-06-13 14:27:36.000000000 +0100
++++ coreutils-6.9/src/ls.c 2007-06-13 14:28:42.000000000 +0100
+@@ -4151,16 +4151,16 @@
+ size_t pos = 0;
+ size_t cols = calculate_columns (false);
+ struct column_info const *line_fmt = &column_info[cols - 1];
+- size_t name_length = length_of_file_name_and_frills (cwd_file);
++ struct fileinfo const *f = sorted_file[0];
++ size_t name_length = length_of_file_name_and_frills (f);
+ size_t max_name_length = line_fmt->col_arr[0];
+
+ /* Print first entry. */
+- print_file_name_and_frills (cwd_file);
++ print_file_name_and_frills (f);
+
+ /* Now the rest. */
+ for (filesno = 1; filesno < cwd_n_used; ++filesno)
+ {
+- struct fileinfo const *f;
+ size_t col = filesno % cols;
+
+ if (col == 0)
+--- coreutils-6.9/tests/ls/Makefile.am.ls-x 2007-03-18 21:36:43.000000000 +0000
++++ coreutils-6.9/tests/ls/Makefile.am 2007-06-13 14:28:42.000000000 +0100
+@@ -24,7 +24,7 @@
+ stat-dtype \
+ inode dangle file-type recursive dired infloop \
+ rt-1 time-1 symlink-slash follow-slink no-arg m-option \
+- stat-vs-dirent
++ stat-vs-dirent x-option
+
+ EXTRA_DIST = $(TESTS)
+ TESTS_ENVIRONMENT = \
+--- /dev/null 2007-06-13 08:43:51.993263382 +0100
++++ coreutils-6.9/tests/ls/x-option 2007-06-13 14:28:42.000000000 +0100
+@@ -0,0 +1,59 @@
++#!/bin/sh
++# Exercise the -x option.
++
++# Copyright (C) 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 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.
++
++if test "$VERBOSE" = yes; then
++ set -x
++ ls --version
++fi
++
++. $srcdir/../envvar-check
++. $srcdir/../lang-default
++
++pwd=`pwd`
++t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
++trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
++trap '(exit $?); exit $?' 1 2 13 15
++
++framework_failure=0
++mkdir -p $tmp || framework_failure=1
++cd $tmp || framework_failure=1
++mkdir subdir || framework_failure=1
++touch subdir/b || framework_failure=1
++touch subdir/a || framework_failure=1
++
++if test $framework_failure = 1; then
++ echo "$0: failure in testing framework" 1>&2
++ (exit 1); exit 1
++fi
++
++fail=0
++
++# Coreutils 6.8 and 6.9 would output this in the wrong order.
++ls -x subdir > out || fail=1
++ls -rx subdir >> out || fail=1
++cat <<\EOF > exp || fail=1
++a b
++b a
++EOF
++
++cmp out exp || fail=1
++test $fail = 1 && diff out exp 2> /dev/null
++
++(exit $fail); exit $fail
+--- coreutils-6.9/NEWS.ls-x 2007-03-22 21:19:45.000000000 +0000
++++ coreutils-6.9/NEWS 2007-06-13 14:28:42.000000000 +0100
+@@ -13,6 +13,11 @@
+ Using pr -m -s (i.e. merging files, with TAB as the output separator)
+ no longer inserts extraneous spaces between output columns.
+
++** Bug fixes
++
++ ls -x DIR would sometimes output the wrong string in place of the
++ first entry. [introduced in coreutils-6.8]
++
+
+ * Noteworthy changes in release 6.8 (2007-02-24) [not-unstable]
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-overflow.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-overflow.patch
new file mode 100644
index 000000000..58074c09a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils-overflow.patch
@@ -0,0 +1,19 @@
+Upstream-Status: Inappropriate [legacy version]
+
+This patch was imported from the Fedora Core 8 coreutils-6.9-9 package.
+
+The package is stated as being Licensed as GPLv2+.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+--- coreutils-5.2.1/src/who.c.overflow 2005-05-25 09:59:06.000000000 +0100
++++ coreutils-5.2.1/src/who.c 2005-05-25 10:00:31.000000000 +0100
+@@ -75,7 +75,7 @@
+ # define NEW_TIME 0
+ #endif
+
+-#define IDLESTR_LEN 6
++#define IDLESTR_LEN 10
+
+ #if HAVE_STRUCT_XTMP_UT_PID
+ # define PIDSTR_DECL_AND_INIT(Var, Utmp_ent) \
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils_fix_for_automake-1.12.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils_fix_for_automake-1.12.patch
new file mode 100644
index 000000000..02730dbbb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/coreutils_fix_for_automake-1.12.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Pending
+
+automake 1.12 has depricated automatic de-ANSI-fication support
+
+this patch avoids these kinds of errors:
+
+| configure.ac:40: error: automatic de-ANSI-fication support has been removed
+| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/aclocal-1.12/protos.m4:12: AM_C_PROTOTYPES is expanded from...
+| /srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-linux/coreutils-native-6.9-r2/coreutils-6.9/m4/jm-macros.m4:138: gl_CHECK_ALL_TYPES is expanded from...
+| /srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-linux/coreutils-native-6.9-r2/coreutils-6.9/m4/jm-macros.m4:24: coreutils_MACROS is expanded from...
+| configure.ac:40: the top level
+| autom4te: m4 failed with exit status: 1
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/04
+
+Index: coreutils-6.9/m4/jm-macros.m4
+===================================================================
+--- coreutils-6.9.orig/m4/jm-macros.m4
++++ coreutils-6.9/m4/jm-macros.m4
+@@ -142,11 +142,6 @@ AC_DEFUN([gl_CHECK_ALL_TYPES],
+ dnl whether functions and headers are available, whether they work, etc.
+ AC_REQUIRE([AC_SYS_LARGEFILE])
+
+- dnl This test must precede tests of compiler characteristics like
+- dnl that for the inline keyword, since it may change the degree to
+- dnl which the compiler supports such features.
+- AC_REQUIRE([AM_C_PROTOTYPES])
+-
+ dnl Checks for typedefs, structures, and compiler characteristics.
+ AC_REQUIRE([AC_C_BIGENDIAN])
+ AC_REQUIRE([AC_C_VOLATILE])
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/fix_for_manpage_building.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/fix_for_manpage_building.patch
new file mode 100644
index 000000000..e0d600a39
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/fix_for_manpage_building.patch
@@ -0,0 +1,85 @@
+Upstream-Status: Inappropriate [legacy version]
+
+Use native coreutils binaries to build manpages in cross environment.
+This avoids man page build issues like this:
+
+| Making all in man
+| make[1]: Entering directory `/build_disk/poky_build/build1/tmp/work/i586-poky-linux/coreutils-6.9-r0/coreutils-6.9/man'
+| Updating man page cut.1
+| Updating man page dir.1
+| Updating man page expand.1
+| Updating man page fold.1
+| Updating man page install.1
+| Updating man page join.1
+| Updating man page pr.1
+| Updating man page ls.1
+| Updating man page sort.1
+| Updating man page unexpand.1
+| Updating man page uniq.1
+| Updating man page who.1
+| Updating man page vdir.1
+| help2man: can't get `--help' info from dir.td/dir
+| help2man: can't get `--help' info from cut.td/cut
+| make[1]: *** [dir.1] Error 126
+| make[1]: *** Waiting for unfinished jobs....
+| help2man: can't get `--help' info from fold.td/fold
+| help2man: can't get `--help' info from install.td/install
+| help2man: can't get `--help' info from expand.td/expand
+| help2man: can't get `--help' info from join.td/join
+| make[1]: *** [cut.1] Error 126
+| make[1]: *** [fold.1] Error 126
+| make[1]: *** [install.1] Error 126
+| help2man: can't get `--help' info from sort.td/sort
+| make[1]: *** [expand.1] Error 126
+| help2man: can't get `--help' info from pr.td/pr
+| make[1]: *** [join.1] Error 126
+| help2man: can't get `--help' info from ls.td/ls
+| help2man: can't get `--help' info from unexpand.td/unexpand
+| help2man: can't get `--help' info from uniq.td/uniq
+| help2man: can't get `--help' info from who.td/who
+| make[1]: *** [sort.1] Error 126
+| make[1]: *** [pr.1] Error 126
+| help2man: can't get `--help' info from vdir.td/vdir
+| make[1]: *** [ls.1] Error 126
+| make[1]: *** [uniq.1] Error 126
+| make[1]: *** [unexpand.1] Error 126
+| make[1]: *** [who.1] Error 126
+| make[1]: *** [vdir.1] Error 126
+| make[1]: Leaving directory `/build_disk/poky_build/build1/tmp/work/i586-poky-linux/coreutils-6.9-r0/coreutils-6.9/man'
+| make: *** [all-recursive] Error 1
+| FATAL: oe_runmake failed
+| ERROR: Function 'do_compile' failed (see /build_disk/poky_build/build1/tmp/work/i586-poky-linux/coreutils-6.9-r0/temp/log.do_compile.12780 for further information)
+NOTE: package coreutils-6.9-r0: task do_compile: Failed
+ERROR: Task 8 (/home/nitin/prj/poky.git/meta/recipes-core/coreutils/coreutils_6.9.bb, do_compile) failed with exit code '1'
+
+
+This patch is made for gplv2 coreutils the recipe
+Nitin A Kamble <nitin.a.kamble@intel.com>
+2011/03/17
+
+Index: man/Makefile.am
+===================================================================
+--- a/man.orig/Makefile.am
++++ b/man/Makefile.am
+@@ -167,7 +167,7 @@ mapped_name = `echo $*|sed 's/install/gi
+ $(PERL) -- $(srcdir)/help2man \
+ --source='$(PACKAGE_STRING)' \
+ --include=$(srcdir)/$*.x \
+- --output=$t/$@ $t/$*; \
++ --output=$t/$@ $*; \
+ } \
+ && sed 's|$*\.td/||g' $t/$@ > $@ \
+ && chmod a-w $@ \
+Index: man/Makefile.in
+===================================================================
+--- a/man.orig/Makefile.in
++++ b/man/Makefile.in
+@@ -865,7 +865,7 @@ yes.1: $(common_dep) $(srcdir)/yes.x .
+ $(PERL) -- $(srcdir)/help2man \
+ --source='$(PACKAGE_STRING)' \
+ --include=$(srcdir)/$*.x \
+- --output=$t/$@ $t/$*; \
++ --output=$t/$@ $*; \
+ } \
+ && sed 's|$*\.td/||g' $t/$@ > $@ \
+ && chmod a-w $@ \
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/futimens.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/futimens.patch
new file mode 100644
index 000000000..5ca590bcc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/futimens.patch
@@ -0,0 +1,63 @@
+Upstream-Status: Inappropriate [legacy version]
+
+# coreutils uses gnulib which conflicts with newer libc header on futimens
+# this patch simply renames coreutils futimes to avoid confliction
+#
+# Signed-off-by Kevin Tian <kevin.tian@intel.com>, 2010-08-18
+# (this patch is licensed under GPLv2)
+
+diff --git a/lib/utimens.c b/lib/utimens.c
+index 71bc510..ae870b8 100644
+--- a/lib/utimens.c
++++ b/lib/utimens.c
+@@ -75,7 +75,7 @@ struct utimbuf
+ Return 0 on success, -1 (setting errno) on failure. */
+
+ int
+-futimens (int fd ATTRIBUTE_UNUSED,
++futimens_coreutils (int fd ATTRIBUTE_UNUSED,
+ char const *file, struct timespec const timespec[2])
+ {
+ /* Some Linux-based NFS clients are buggy, and mishandle time stamps
+@@ -185,5 +185,5 @@ futimens (int fd ATTRIBUTE_UNUSED,
+ int
+ utimens (char const *file, struct timespec const timespec[2])
+ {
+- return futimens (-1, file, timespec);
++ return futimens_coreutils (-1, file, timespec);
+ }
+diff --git a/lib/utimens.h b/lib/utimens.h
+index 0097aaa..13fc45a 100644
+--- a/lib/utimens.h
++++ b/lib/utimens.h
+@@ -1,3 +1,3 @@
+ #include <time.h>
+-int futimens (int, char const *, struct timespec const [2]);
++int futimens_coreutils (int, char const *, struct timespec const [2]);
+ int utimens (char const *, struct timespec const [2]);
+diff --git a/src/copy.c b/src/copy.c
+index 4bdb75c..04634f1 100644
+--- a/src/copy.c
++++ b/src/copy.c
+@@ -518,7 +518,7 @@ copy_reg (char const *src_name, char const *dst_name,
+ timespec[0] = get_stat_atime (src_sb);
+ timespec[1] = get_stat_mtime (src_sb);
+
+- if (futimens (dest_desc, dst_name, timespec) != 0)
++ if (futimens_coreutils (dest_desc, dst_name, timespec) != 0)
+ {
+ error (0, errno, _("preserving times for %s"), quote (dst_name));
+ if (x->require_preserve)
+diff --git a/src/touch.c b/src/touch.c
+index a79c26d..6ef317d 100644
+--- a/src/touch.c
++++ b/src/touch.c
+@@ -182,7 +182,7 @@ touch (const char *file)
+ t = timespec;
+ }
+
+- ok = (futimens (fd, (fd == STDOUT_FILENO ? NULL : file), t) == 0);
++ ok = (futimens_coreutils (fd, (fd == STDOUT_FILENO ? NULL : file), t) == 0);
+
+ if (fd == STDIN_FILENO)
+ {
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/gnulib_m4.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/gnulib_m4.patch
new file mode 100644
index 000000000..8f355520b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/gnulib_m4.patch
@@ -0,0 +1,21 @@
+Upstream-Status: Inappropriate [legacy version]
+
+# remove the line to cause recursive inclusion error from autoreconf, sicne
+# newer autoconf has included this definition. Simply rename it here.
+#
+# Signed-off-by Kevin Tian <kevin.tian@intel.com>, 2010-08-18
+# (this patch is licensed under GPLv2)
+
+diff --git a/extensions.m4 b/extensions.m4
+index 143a9e5..f6558f1 100644
+--- a/m4/extensions.m4
++++ b/m4/extensions.m4
+@@ -16,7 +16,7 @@
+ # ------------------------
+ # Enable extensions on systems that normally disable them,
+ # typically due to standards-conformance issues.
+-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
++AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS_DUMMY],
+ [
+ AC_BEFORE([$0], [AC_COMPILE_IFELSE])
+ AC_BEFORE([$0], [AC_RUN_IFELSE])
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/loadavg.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/loadavg.patch
new file mode 100644
index 000000000..c72efd4d3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/loadavg.patch
@@ -0,0 +1,18 @@
+Remove hardcoded paths so OE's configure QA does not detect it and fail the builds
+For cross compilation is less interesting to look into host paths for target libraries anyway
+
+Upstream-Status: Inappropriate [OE Specific]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: coreutils-6.9/m4/getloadavg.m4
+===================================================================
+--- coreutils-6.9.orig/m4/getloadavg.m4
++++ coreutils-6.9/m4/getloadavg.m4
+@@ -49,7 +49,6 @@ if test $gl_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.
+ gl_getloadavg_LIBS=$LIBS
+- LIBS="-L/usr/local/lib $LIBS"
+ AC_CHECK_LIB(getloadavg, getloadavg,
+ [LIBS="-lgetloadavg $LIBS"], [LIBS=$gl_getloadavg_LIBS])
+ fi
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/man-touch.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/man-touch.patch
new file mode 100644
index 000000000..c42cb9c05
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-6.9/man-touch.patch
@@ -0,0 +1,24 @@
+Upstream-Status: Inappropriate [legacy version]
+
+# man page for 'touch' is generated differently from others. All other utilities
+# are provided static man source files, while for 'touch' it requires help2man
+# to invoke "touch --help" and then convert the output into the manual. Since touch
+# is with target format which can't be invoked on build system, disable building
+# 'touch' man page here.
+#
+# Signed-off-by Kevin Tian <kevin.tian@intel.com>, 2010-08-18
+# (this patch is licensed under GPLv2)
+
+diff --git a/man/Makefile.am b/man/Makefile.am
+index 32df9d1..37b09e3 100644
+--- a/man/Makefile.am
++++ b/man/Makefile.am
+@@ -27,7 +27,7 @@ dist_man_MANS = \
+ paste.1 pathchk.1 pr.1 printenv.1 printf.1 ptx.1 pwd.1 readlink.1 \
+ rm.1 rmdir.1 seq.1 sha1sum.1 sha224sum.1 sha256sum.1 sha384sum.1 sha512sum.1 \
+ shred.1 shuf.1 sleep.1 sort.1 split.1 stat.1 \
+- su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 touch.1 tr.1 true.1 tsort.1 \
++ su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 tr.1 true.1 tsort.1 \
+ tty.1 unexpand.1 uniq.1 unlink.1 vdir.1 wc.1 \
+ whoami.1 yes.1 $(MAN)
+ optional_mans = \
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..ba1a4bab4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/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/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/0001-uname-report-processor-and-hardware-correctly.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/0001-uname-report-processor-and-hardware-correctly.patch
new file mode 100644
index 000000000..c5f449f4f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/0001-uname-report-processor-and-hardware-correctly.patch
@@ -0,0 +1,64 @@
+Upstream-Status: Rejected
+
+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/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/fix-selinux-flask.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/fix-selinux-flask.patch
new file mode 100644
index 000000000..9d1ae55d4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/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/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/man-decouple-manpages-from-build.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/man-decouple-manpages-from-build.patch
new file mode 100644
index 000000000..3c896a11b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/man-decouple-manpages-from-build.patch
@@ -0,0 +1,27 @@
+From b4d258629f090066783c3b4c91b40f63b9d0a296 Mon Sep 17 00:00:00 2001
+From: Paul Gortmaker <paul.gortmaker@windriver.com>
+Date: Sun, 8 Feb 2015 16:51:57 -0500
+Subject: [PATCH] man: decouple manpages from build
+
+The use of "help2man" doesn't work at all for cross compile, in
+addition to the extra requirement of perl it adds.
+
+Just decouple the manpages from the build in order to pave the way for
+importing prebuilt manpages that can be used in a cross build situation.
+
+Upstream-Status: Inappropriate [upstream doesn't care about x-compile case.]
+Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
+
+diff --git a/Makefile.am b/Makefile.am
+index fb4af27..7576b2c 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -214,5 +214,4 @@ AM_CPPFLAGS = -Ilib -I$(top_srcdir)/lib -Isrc -I$(top_srcdir)/src
+ include $(top_srcdir)/lib/local.mk
+ include $(top_srcdir)/src/local.mk
+ include $(top_srcdir)/doc/local.mk
+-include $(top_srcdir)/man/local.mk
+ include $(top_srcdir)/tests/local.mk
+--
+2.2.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/remove-usr-local-lib-from-m4.patch b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/remove-usr-local-lib-from-m4.patch
new file mode 100644
index 000000000..2ef8a548a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils-8.25/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/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils_6.9.bb b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils_6.9.bb
new file mode 100644
index 000000000..9ce717d1a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils_6.9.bb
@@ -0,0 +1,103 @@
+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 = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
+ file://src/ls.c;beginline=4;endline=16;md5=15ed60f67b1db5fedd5dbc37cf8a9543"
+PR = "r5"
+DEPENDS = "virtual/libiconv"
+
+inherit autotools gettext texinfo
+
+SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.bz2 \
+ file://gnulib_m4.patch \
+ file://futimens.patch \
+ file://coreutils-ls-x.patch \
+ file://coreutils-6.9-cp-i-u.patch \
+ file://coreutils-i18n.patch \
+ file://coreutils-overflow.patch \
+ file://coreutils-fix-install.patch \
+ file://man-touch.patch \
+ file://coreutils_fix_for_automake-1.12.patch \
+ file://coreutils-fix-texinfo.patch \
+ file://fix_for_manpage_building.patch \
+ file://loadavg.patch \
+ "
+
+SRC_URI[md5sum] = "c9607d8495f16e98906e7ed2d9751a06"
+SRC_URI[sha256sum] = "89c2895ad157de50e53298b22d91db116ee4e1dd3fdf4019260254e2e31497b0"
+
+EXTRA_OECONF += "ac_cv_func_getgroups_works=yes \
+ ac_cv_func_strcoll_works=yes"
+
+# acl is not a default feature
+#
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'acl', 'acl', '', d)}"
+
+# with, without, depends, rdepends
+#
+PACKAGECONFIG[acl] = "ac_cv_header_sys_acl_h=yes ac_cv_header_acl_libacl_h=yes ac_cv_search_acl_get_file=-lacl,ac_cv_header_sys_acl_h=no ac_cv_header_acl_libacl_h=no ac_cv_search_acl_get_file=,acl,"
+
+
+# [ gets a special treatment and is not included in this
+bindir_progs = "base64 basename 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 od paste pathchk \
+ pinky pr printenv printf ptx readlink seq sha1sum sha224sum sha256sum \
+ sha384sum sha512sum shred shuf sort split sum tac tail tee test \
+ tr tsort tty unexpand uniq unlink users vdir wc who whoami yes uptime"
+
+# hostname gets a special treatment and is not included in this
+base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdir \
+ mknod mv pwd rm rmdir sleep stty sync touch true uname hostname 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"
+
+do_install() {
+ autotools_do_install
+
+ 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}${sbindir}
+ [ "${bindir}" != "${sbindir}" ] && for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i; 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}
+
+ # Newer versions of coreutils do not include su, to mimic this behavior
+ # we simply remove it.
+ rm -f ${D}${bindir}/su
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN} = "lbracket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs}"
+
+ALTERNATIVE_PRIORITY[uptime] = "10"
+ALTERNATIVE_PRIORITY[hostname] = "10"
+
+ALTERNATIVE_LINK_NAME[lbracket] = "${bindir}/["
+ALTERNATIVE_TARGET[lbracket] = "${bindir}/lbracket.${BPN}"
+
+python __anonymous() {
+ for prog in d.getVar('base_bindir_progs', True).split():
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir', True), prog))
+
+ for prog in d.getVar('sbindir_progs', True).split():
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir', True), prog))
+}
diff --git a/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils_8.25.bb b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils_8.25.bb
new file mode 100644
index 000000000..419a69337
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/coreutils/coreutils_8.25.bb
@@ -0,0 +1,134 @@
+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=5;endline=16;md5=38b79785ca88537b75871782a2a3c6b8"
+DEPENDS = "gmp libcap"
+DEPENDS_class-native = ""
+
+inherit autotools gettext texinfo
+
+SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.xz;name=tarball \
+ http://distfiles.gentoo.org/distfiles/${BP}-man.tar.xz;name=manpages \
+ file://man-decouple-manpages-from-build.patch \
+ 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 \
+ "
+
+SRC_URI[tarball.md5sum] = "070e43ba7f618d747414ef56ab248a48"
+SRC_URI[tarball.sha256sum] = "31e67c057a5b32a582f26408c789e11c2e8d676593324849dcf5779296cdce87"
+SRC_URI[manpages.md5sum] = "415cc0552bc4e480b27ce8b2aebfdeb5"
+SRC_URI[manpages.sha256sum] = "2ee31c3a6d2276f49c5515375d4a0c1047580da6ac10536898e0f0de81707f29"
+
+EXTRA_OECONF_class-native = "--without-gmp"
+EXTRA_OECONF_class-target = "--enable-install-program=arch --libexecdir=${libdir}"
+EXTRA_OECONF_class-nativesdk = "--enable-install-program=arch"
+
+# acl and xattr are not default features
+#
+PACKAGECONFIG_class-target ??= "\
+ ${@bb.utils.contains('DISTRO_FEATURES', 'acl', 'acl', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'xattr', '', d)} \
+"
+
+PACKAGECONFIG_class-native ??= ""
+
+# with, without, depends, rdepends
+#
+PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
+PACKAGECONFIG[xattr] = "--enable-xattr,--disable-xattr,attr,"
+
+# [ 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 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_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}
+
+ # prebuilt man pages
+ install -d ${D}/${mandir}/man1
+ install -t ${D}/${mandir}/man1 ${S}/man/*.1
+ # prebuilt man pages don't do a separate man page for [ vs test.
+ # see comment above r.e. sed and update-alternatives
+ cp -a ${D}${mandir}/man1/test.1 ${D}${mandir}/man1/lbracket.1.${BPN}
+}
+
+do_install_append_class-native(){
+ # remove groups to fix conflict with shadow-native
+ rm -f ${D}${STAGING_BINDIR_NATIVE}/groups
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_${PN} = "lbracket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs} base64 mktemp df"
+ALTERNATIVE_${PN}-doc = "base64.1 mktemp.1 df.1 lbracket.1 groups.1 kill.1 uptime.1 stat.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[lbracket.1] = "${mandir}/man1/lbracket.1"
+
+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', True).split():
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir', True), prog))
+
+ for prog in d.getVar('sbindir_progs', True).split():
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir', True), prog))
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-core/dbus-wait/dbus-wait_git.bb b/import-layers/yocto-poky/meta/recipes-core/dbus-wait/dbus-wait_git.bb
new file mode 100644
index 000000000..691dc86e9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/dbus-wait/dbus-wait_git.bb
@@ -0,0 +1,17 @@
+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}"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
diff --git a/import-layers/yocto-poky/meta/recipes-core/dbus/dbus-glib.inc b/import-layers/yocto-poky/meta/recipes-core/dbus/dbus-glib.inc
new file mode 100644
index 000000000..4661e3af5
--- /dev/null
+++ b/import-layers/yocto-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
+
+#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/import-layers/yocto-poky/meta/recipes-core/dbus/dbus-glib/no-examples.patch b/import-layers/yocto-poky/meta/recipes-core/dbus/dbus-glib/no-examples.patch
new file mode 100644
index 000000000..fbb496782
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/dbus/dbus-glib/no-examples.patch
@@ -0,0 +1,15 @@
+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>
+
+--- dbus-glib-0.70/dbus/Makefile.am.orig 2006-07-23 16:04:43.000000000 +0200
++++ dbus-glib-0.70/dbus/Makefile.am 2006-07-23 16:04:52.000000000 +0200
+@@ -1,4 +1,4 @@
+-SUBDIRS = . examples
++SUBDIRS = .
+
+ INCLUDES=-I$(top_srcdir) $(DBUS_CFLAGS) $(DBUS_GLIB_CFLAGS) $(DBUS_GLIB_TOOL_CFLAGS) -DDBUS_COMPILATION=1 -DDBUS_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\"
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/dbus/dbus-glib/test-install-makefile.patch b/import-layers/yocto-poky/meta/recipes-core/dbus/dbus-glib/test-install-makefile.patch
new file mode 100644
index 000000000..027c82b27
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/dbus/dbus-glib_0.106.bb b/import-layers/yocto-poky/meta/recipes-core/dbus/dbus-glib_0.106.bb
new file mode 100644
index 000000000..0ae848e40
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/dbus/dbus-glib_0.106.bb
@@ -0,0 +1,4 @@
+require dbus-glib.inc
+
+SRC_URI[md5sum] = "2eea0b7f52b49f600a07abfd8535d4e4"
+SRC_URI[sha256sum] = "b38952706dcf68bad9c302999ef0f420b8cf1a2428227123f0ac4764b689c046"
diff --git a/import-layers/yocto-poky/meta/recipes-core/dbus/dbus-test_1.10.6.bb b/import-layers/yocto-poky/meta/recipes-core/dbus/dbus-test_1.10.6.bb
new file mode 100644
index 000000000..a768a09c4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/dbus/dbus-test_1.10.6.bb
@@ -0,0 +1,61 @@
+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 = "python-pygobject dbus"
+
+RDEPENDS_${PN} += "make"
+RDEPENDS_${PN}-dev = ""
+
+SRC_URI = "http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
+ file://tmpdir.patch \
+ file://dbus-1.init \
+ file://run-ptest \
+ file://python-config.patch \
+ file://clear-guid_from_server-if-send_negotiate_unix_f.patch \
+ "
+
+SRC_URI[md5sum] = "26d0cf3a1c9782cb0e342101f0450440"
+SRC_URI[sha256sum] = "b5fefa08a77edd76cd64d872db949eebc02cf6f3f8be82e4bbc641742af5d35f"
+
+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 \
+ --disable-xml-docs \
+ --disable-doxygen-docs \
+ --disable-libaudit \
+ --disable-systemd \
+ --without-systemdsystemunitdir \
+ --with-dbus-test-dir=${PTEST_PATH} \
+ ${EXTRA_OECONF_X}"
+
+do_install() {
+ :
+}
+
+do_install_ptest() {
+ install -d ${D}${PTEST_PATH}/test
+ case1="shell printf refs syslog"
+ for i in ${case1}; do install ${B}/test/test-$i ${D}${PTEST_PATH}/test; done
+ case2="marshal syntax corrupt dbus-daemon dbus-daemon-eavesdrop loopback relay"
+ for i in ${case2}; do install ${B}/test/.libs/test-$i ${D}${PTEST_PATH}/test; done
+ case3="bus bus-system bus-launch-helper"
+ for i in ${case3}; do install ${B}/bus/test-$i ${D}${PTEST_PATH}/test; done
+ install ${B}/dbus/test-dbus ${D}${PTEST_PATH}/test
+ cp -r ${B}/test/data ${D}${PTEST_PATH}/test
+}
+RDEPENDS_${PN}-ptest += "bash"
diff --git a/import-layers/yocto-poky/meta/recipes-core/dbus/dbus/0001-configure.ac-support-large-file-for-stat64.patch b/import-layers/yocto-poky/meta/recipes-core/dbus/dbus/0001-configure.ac-support-large-file-for-stat64.patch
new file mode 100644
index 000000000..c6eac2b7d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/dbus/dbus/0001-configure.ac-support-large-file-for-stat64.patch
@@ -0,0 +1,53 @@
+From e18bd3a571be716d90bedc835a014472470ae7bd Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 30 Dec 2015 10:58:39 +0800
+Subject: [PATCH] configure.ac: support large-file for stat64
+
+While starting dbus-daemon on a 32-bit linux host and it invokes
+fstat to load /etc/dbus-1/system.conf through NFS. If system.conf
+was created with a large indoe number on 64-bit host. The above
+fstat invoking failed. Here is the log of strace:
+............
+$ ls -i /etc/dbus-1/system.conf
+53778558109 /etc/dbus-1/system.conf
+
+$ strace /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
+|open("/etc/dbus-1/system.conf", O_RDONLY) = 4
+|fstat64(4, {st_mode=S_IFREG|0644, st_size=3340, ...}) = 0
+|close(4) = 0
+|close(3) = 0
+|write(2, "Failed to start message bus: Fai"..., 109Failed to start message bus:
+Failed to stat "/etc/dbus-1/system.conf": Value too large for defined data type
+|) = 109
+|exit_group(1) = ?
+|+++ exited with 1 +++
+............
+
+In this situation, we should support large-file for stat64. Add marco
+AC_SYS_LARGEFILE to do the detection at configure time. It can be disabled
+by configuring with the `--disable-largefile' option.
+
+Upstream-Status: Backport
+
+Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93545
+https://bugs.freedesktop.org/attachment.cgi?id=120747
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure.ac | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/configure.ac b/configure.ac
+index 82806ba..cb5a60b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -64,6 +64,7 @@ AC_SUBST(DBUS_VERSION)
+ AC_PROG_CC
+ AM_PROG_CC_C_O
+ AC_PROG_CXX
+ AC_USE_SYSTEM_EXTENSIONS
++AC_SYS_LARGEFILE
+ AC_ISC_POSIX
+ AC_HEADER_STDC
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/dbus/dbus/clear-guid_from_server-if-send_negotiate_unix_f.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/dbus/dbus/dbus-1.init b/import-layers/yocto-poky/meta/recipes-core/dbus/dbus/dbus-1.init
new file mode 100644
index 000000000..42c86297c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/dbus/dbus/os-test.patch b/import-layers/yocto-poky/meta/recipes-core/dbus/dbus/os-test.patch
new file mode 100644
index 000000000..54c257f81
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/dbus/dbus/os-test.patch
@@ -0,0 +1,35 @@
+dbus: remove build host test in configure script
+
+The dbus build tests the build host to detect what initscript
+environment it expects. Remove the test and set it to "redhat"
+unconditionally as the oe-core initscript has a redhat-style pid file
+path.
+
+Signed-off-by: Andy Ross <andy.ross@windriver.com>
+Upstream-Status: Inappropriate [embedded]
+
+diff -u a/configure.ac b/configure.ac
+--- a/configure.ac 2012-08-28 11:23:43.040609874 -0700
++++ b/configure.ac 2012-08-28 11:54:25.602913945 -0700
+@@ -1348,19 +1348,8 @@
+ AS_AC_EXPAND(EXPANDED_LIBEXECDIR, "$libexecdir")
+ AS_AC_EXPAND(EXPANDED_DATADIR, "$datadir")
+
+-#### Check our operating system
+-operating_system=unknown
+-if test -f /etc/redhat-release || test -f $EXPANDED_SYSCONFDIR/redhat-release ; then
+- operating_system=redhat
+-fi
+-
+-if test -f /etc/slackware-version || test -f $EXPANDED_SYSCONFDIR/slackware-version ; then
+- operating_system=slackware
+-fi
+-
+-if test -f /usr/bin/cygwin1.dll || test -f $EXPANDED_BINDIR/cygwin1.dll ; then
+- operating_system=cygwin
+-fi
++#### Build host test removed from upstream code, openembedded initscript is redhat-like:
++operating_system=redhat
+
+ #### Sort out init scripts
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/dbus/dbus/python-config.patch b/import-layers/yocto-poky/meta/recipes-core/dbus/dbus/python-config.patch
new file mode 100644
index 000000000..da2f10c72
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/dbus/dbus/run-ptest b/import-layers/yocto-poky/meta/recipes-core/dbus/dbus/run-ptest
new file mode 100755
index 000000000..c72d083a9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/dbus/dbus/run-ptest
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+output() {
+ if [ $? -eq 0 ]
+ then echo "PASS: $i"
+ else echo "FAIL: $i"
+ fi
+}
+
+for i in `ls test/test-*`; do ./$i ./test/data DBUS_TEST_HOMEDIR=./test >/dev/null; output; done
diff --git a/import-layers/yocto-poky/meta/recipes-core/dbus/dbus/tmpdir.patch b/import-layers/yocto-poky/meta/recipes-core/dbus/dbus/tmpdir.patch
new file mode 100644
index 000000000..bf086e178
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/dbus/dbus_1.10.6.bb b/import-layers/yocto-poky/meta/recipes-core/dbus/dbus_1.10.6.bb
new file mode 100644
index 000000000..245798a00
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/dbus/dbus_1.10.6.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"
+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://os-test.patch \
+ file://clear-guid_from_server-if-send_negotiate_unix_f.patch \
+ file://0001-configure.ac-support-large-file-for-stat64.patch \
+"
+
+SRC_URI[md5sum] = "26d0cf3a1c9782cb0e342101f0450440"
+SRC_URI[sha256sum] = "b5fefa08a77edd76cd64d872db949eebc02cf6f3f8be82e4bbc641742af5d35f"
+
+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 \
+ ${systemd_system_unitdir} \
+ ${systemd_user_unitdir} \
+"
+FILES_${PN}-lib = "${libdir}/lib*.so.*"
+RRECOMMENDS_${PN}-lib = "${PN}"
+FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-test-tool"
+
+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 \
+ "
+
+EXTRA_OECONF_append_class-native = " --disable-selinux"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'largefile', 'largefile', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '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[largefile] = "--enable-largefile,--disable-largefile,,"
+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}/
+ cd ${D}${systemd_system_unitdir}/dbus.target.wants/
+ 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/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear.inc b/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear.inc
new file mode 100644
index 000000000..1dce2a5ff
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear.inc
@@ -0,0 +1,103 @@
+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://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}"'
+EXTRA_OECONF += "\
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)}"
+CFLAGS += "-DSFTPSERVER_PATH=\\"${libdir}/openssh/sftp-server\\""
+
+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.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" = "pam" ]; 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/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch b/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch
new file mode 100644
index 000000000..dc9d5782e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/0003-configure.patch b/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/0003-configure.patch
new file mode 100644
index 000000000..c53ab01dd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/0003-configure.patch
@@ -0,0 +1,42 @@
+From c5f5c5054c1b15539dccf866e2c3faba7ed68456 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 3/6] configure: add a variable to allow openpty check to be cached
+
+Upstream-Status: Pending
+
+---
+ configure.ac | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 05461f3..9c16d90 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -166,15 +166,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],
+--
+1.7.11.7
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/0004-fix-2kb-keys.patch b/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/0004-fix-2kb-keys.patch
new file mode 100644
index 000000000..7539d2034
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/0004-fix-2kb-keys.patch
@@ -0,0 +1,22 @@
+Subject: [PATCH 4/6] fix 2kb keys
+
+Upstream-Status: Inappropriate [configuration]
+---
+ kex.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/kex.h b/kex.h
+index 72430e9..375c677 100644
+--- a/kex.h
++++ b/kex.h
+@@ -67,6 +67,6 @@ struct KEXState {
+ };
+
+
+-#define MAX_KEXHASHBUF 2000
++#define MAX_KEXHASHBUF 3000
+
+ #endif /* _KEX_H_ */
+--
+1.7.11.7
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch b/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch
new file mode 100644
index 000000000..539cb12e9
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch b/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch
new file mode 100644
index 000000000..fa4c8d0a6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/0007-dropbear-fix-for-x32-abi.patch b/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/0007-dropbear-fix-for-x32-abi.patch
new file mode 100644
index 000000000..b4501211c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/dropbear b/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/dropbear
new file mode 100644
index 000000000..47e787fb1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/dropbear.socket b/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/dropbear.socket
new file mode 100644
index 000000000..e5c61b755
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/dropbear@.service b/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/dropbear@.service
new file mode 100644
index 000000000..b420bcddc
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/dropbearkey.service b/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/dropbearkey.service
new file mode 100644
index 000000000..c49053d57
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/init b/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/init
new file mode 100755
index 000000000..e8fed3f94
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear/init
@@ -0,0 +1,113 @@
+#!/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"
+ DROPBEAR_DSSKEY_DEFAULT="/var/lib/dropbear/dropbear_dss_host_key"
+else
+ DROPBEAR_RSAKEY_DEFAULT="/etc/dropbear/dropbear_rsa_host_key"
+ DROPBEAR_DSSKEY_DEFAULT="/etc/dropbear/dropbear_dss_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
+test -n "$DROPBEAR_DSSKEY" || \
+ DROPBEAR_DSSKEY=$DROPBEAR_DSSKEY_DEFAULT
+test -n "$DROPBEAR_KEYTYPES" || \
+ DROPBEAR_KEYTYPES="rsa"
+
+gen_keys() {
+for t in $DROPBEAR_KEYTYPES; do
+ case $t in
+ rsa)
+ if [ -f "$DROPBEAR_RSAKEY" -a ! -s "$DROPBEAR_RSAKEY" ]; then
+ rm $DROPBEAR_RSAKEY || true
+ fi
+ test -f $DROPBEAR_RSAKEY || dropbearkey -t rsa -f $DROPBEAR_RSAKEY
+ ;;
+ dsa)
+ if [ -f "$DROPBEAR_DSSKEY" -a ! -s "$DROPBEAR_DSSKEY" ]; then
+ rm $DROPBEAR_DSSKEY || true
+ fi
+ test -f $DROPBEAR_DSSKEY || dropbearkey -t dss -f $DROPBEAR_DSSKEY
+ ;;
+ esac
+done
+}
+
+case "$1" in
+ start)
+ echo -n "Starting $DESC: "
+ gen_keys
+ KEY_ARGS=""
+ test -f $DROPBEAR_DSSKEY && KEY_ARGS="$KEY_ARGS -d $DROPBEAR_DSSKEY"
+ test -f $DROPBEAR_RSAKEY && KEY_ARGS="$KEY_ARGS -r $DROPBEAR_RSAKEY"
+ start-stop-daemon -S -p $PIDFILE \
+ -x "$DAEMON" -- $KEY_ARGS \
+ -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
+ KEY_ARGS=""
+ test -f $DROPBEAR_DSSKEY && KEY_ARGS="$KEY_ARGS -d $DROPBEAR_DSSKEY"
+ test -f $DROPBEAR_RSAKEY && KEY_ARGS="$KEY_ARGS -r $DROPBEAR_RSAKEY"
+ start-stop-daemon -S -p $PIDFILE \
+ -x "$DAEMON" -- $KEY_ARGS \
+ -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/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear_2015.71.bb b/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear_2015.71.bb
new file mode 100644
index 000000000..6332579e7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/dropbear/dropbear_2015.71.bb
@@ -0,0 +1,5 @@
+require dropbear.inc
+
+SRC_URI[md5sum] = "2ccc0a2f3e37ca221db12c5af6a88137"
+SRC_URI[sha256sum] = "376214169c0e187ee9f48ae1a99b3f835016ad5b98ede4bfd1cf581deba783af"
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/expat/expat-2.1.0/autotools.patch b/import-layers/yocto-poky/meta/recipes-core/expat/expat-2.1.0/autotools.patch
new file mode 100644
index 000000000..0e599697a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/expat/expat-2.1.0/autotools.patch
@@ -0,0 +1,24 @@
+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>
+
+diff -Nurd expat-2.1.0/configure.in expat-2.1.0/configure.in
+--- expat-2.1.0/configure.in 2012-03-04 01:45:53.000000000 +0200
++++ expat-2.1.0/configure.in 2012-05-10 21:04:44.000000000 +0300
+@@ -51,8 +51,6 @@
+
+ AC_CONFIG_HEADER(expat_config.h)
+
+-sinclude(conftools/ac_c_bigendian_cross.m4)
+-
+ AC_LIBTOOL_WIN32_DLL
+ AC_PROG_LIBTOOL
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/expat/expat-2.1.0/expat-CVE-2015-1283.patch b/import-layers/yocto-poky/meta/recipes-core/expat/expat-2.1.0/expat-CVE-2015-1283.patch
new file mode 100644
index 000000000..1d0acb6b9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/expat/expat-2.1.0/expat-CVE-2015-1283.patch
@@ -0,0 +1,62 @@
+Multiple integer overflows in the XML_GetBuffer function in Expat
+through 2.1.0, allow remote attackers to cause a denial of service
+(heap-based buffer overflow) or possibly have unspecified other
+impact via crafted XML data.
+
+CVSSv2: (AV:N/AC:M/Au:N/C:P/I:P/A:P)
+
+CVE: CVE-2015-1283
+Upstream-Status: Backport
+
+Signed-off-by: Eric Rahm <erahm@mozilla.com>
+Signed-off-by: Zhixiong Chi <zhixiong.chi@windirver.com>
+
+Index: expat-2.1.0/lib/xmlparse.c
+===================================================================
+--- expat-2.1.0.orig/lib/xmlparse.c 2012-03-11 13:13:12.000000000 +0800
++++ expat-2.1.0/lib/xmlparse.c 2015-12-23 10:29:07.347361329 +0800
+@@ -1678,6 +1678,12 @@
+ void * XMLCALL
+ XML_GetBuffer(XML_Parser parser, int len)
+ {
++/* BEGIN MOZILLA CHANGE (sanity check len) */
++ if (len < 0) {
++ errorCode = XML_ERROR_NO_MEMORY;
++ return NULL;
++ }
++/* END MOZILLA CHANGE */
+ switch (ps_parsing) {
+ case XML_SUSPENDED:
+ errorCode = XML_ERROR_SUSPENDED;
+@@ -1689,8 +1695,13 @@
+ }
+
+ if (len > bufferLim - bufferEnd) {
+- /* FIXME avoid integer overflow */
+ int neededSize = len + (int)(bufferEnd - bufferPtr);
++/* BEGIN MOZILLA CHANGE (sanity check neededSize) */
++ if (neededSize < 0) {
++ errorCode = XML_ERROR_NO_MEMORY;
++ return NULL;
++ }
++/* END MOZILLA CHANGE */
+ #ifdef XML_CONTEXT_BYTES
+ int keep = (int)(bufferPtr - buffer);
+
+@@ -1719,7 +1730,15 @@
+ bufferSize = INIT_BUFFER_SIZE;
+ do {
+ bufferSize *= 2;
+- } while (bufferSize < neededSize);
++/* BEGIN MOZILLA CHANGE (prevent infinite loop on overflow) */
++ } while (bufferSize < neededSize && bufferSize > 0);
++/* END MOZILLA CHANGE */
++/* BEGIN MOZILLA CHANGE (sanity check bufferSize) */
++ if (bufferSize <= 0) {
++ errorCode = XML_ERROR_NO_MEMORY;
++ return NULL;
++ }
++/* END MOZILLA CHANGE */
+ newBuf = (char *)MALLOC(bufferSize);
+ if (newBuf == 0) {
+ errorCode = XML_ERROR_NO_MEMORY;
diff --git a/import-layers/yocto-poky/meta/recipes-core/expat/expat.inc b/import-layers/yocto-poky/meta/recipes-core/expat/expat.inc
new file mode 100644
index 000000000..4bd60a2a6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/expat/expat.inc
@@ -0,0 +1,22 @@
+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"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/expat/expat-${PV}.tar.gz \
+ file://autotools.patch \
+ file://expat-CVE-2015-1283.patch \
+ "
+
+inherit autotools lib_package gzipnative
+
+# This package uses an archive format known to have issue with some
+# versions of gzip
+do_unpack[depends] += "gzip-native:do_populate_sysroot"
+
+do_configure_prepend () {
+ rm -f ${S}/conftools/libtool.m4
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-core/expat/expat_2.1.0.bb b/import-layers/yocto-poky/meta/recipes-core/expat/expat_2.1.0.bb
new file mode 100644
index 000000000..b958742ed
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/expat/expat_2.1.0.bb
@@ -0,0 +1,5 @@
+require expat.inc
+LIC_FILES_CHKSUM = "file://COPYING;md5=1b71f681713d1256e1c23b0890920874"
+
+SRC_URI[md5sum] = "dd7dab7a5fea97d2a6a43f511449b7cd"
+SRC_URI[sha256sum] = "823705472f816df21c8f6aa026dd162b280806838bb55b3432b0fb1fcca7eb86"
diff --git a/import-layers/yocto-poky/meta/recipes-core/fts/fts.bb b/import-layers/yocto-poky/meta/recipes-core/fts/fts.bb
new file mode 100644
index 000000000..c30172076
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/fts/fts.bb
@@ -0,0 +1,45 @@
+# Copyright (C) 2015 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+DESCRIPTION = "keith bostic's POSIX file tree stream operations library"
+HOMEPAGE = "https://sites.google.com/a/bostic.com/keithbostic"
+LICENSE = "BSD-4-Clause"
+LIC_FILES_CHKSUM = "file://fts.h;beginline=1;endline=36;md5=2532eddb3d1a21905723a4011ec4e085"
+SECTION = "libs"
+
+SRC_URI = "https://sites.google.com/a/bostic.com/keithbostic/files/fts.tar.gz \
+ file://fts-header-correctness.patch \
+ file://fts-uclibc.patch \
+ file://remove_cdefs.patch \
+ file://stdint.patch \
+ file://gcc5.patch \
+"
+
+SRC_URI[md5sum] = "120c14715485ec6ced14f494d059d20a"
+SRC_URI[sha256sum] = "3df9b9b5a45aeaf16f33bb84e692a10dc662e22ec8a51748f98767d67fb6f342"
+
+S = "${WORKDIR}/${BPN}"
+
+do_configure[noexec] = "1"
+
+HASHSTYLE_mips = "sysv"
+HASHSTYLE_mipsel = "sysv"
+HASHSTYLE_mips64 = "sysv"
+HASHSTYLE_mips64el = "sysv"
+HASHSTYLE = "gnu"
+
+VER = "0"
+do_compile () {
+ ${CC} -I${S} -fPIC -shared -Wl,--hash-style=${HASHSTYLE} -o libfts.so.${VER} -Wl,-soname,libfts.so.${VER} ${S}/fts.c
+}
+
+do_install() {
+ install -Dm755 ${B}/libfts.so.${VER} ${D}${libdir}/libfts.so.${VER}
+ ln -sf libfts.so.${VER} ${D}${libdir}/libfts.so
+ install -Dm644 ${S}/fts.h ${D}${includedir}/fts.h
+}
+#
+# We will skip parsing for non-musl systems
+#
+COMPATIBLE_HOST = ".*-musl.*"
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/fts/fts/fts-header-correctness.patch b/import-layers/yocto-poky/meta/recipes-core/fts/fts/fts-header-correctness.patch
new file mode 100644
index 000000000..c73ddc95d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/fts/fts/fts-header-correctness.patch
@@ -0,0 +1,25 @@
+Included needed headers for compiling with musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Inappropriate
+
+--- fts.orig/fts.h
++++ fts/fts.h
+@@ -38,6 +38,17 @@
+ #ifndef _FTS_H_
+ #define _FTS_H_
+
++#include <sys/types.h>
++#include <sys/param.h>
++#include <sys/stat.h>
++
++#include <dirent.h>
++#include <errno.h>
++#include <fcntl.h>
++#include <stdlib.h>
++#include <string.h>
++#include <unistd.h>
++
+ typedef struct {
+ struct _ftsent *fts_cur; /* current node */
+ struct _ftsent *fts_child; /* linked list of children */
diff --git a/import-layers/yocto-poky/meta/recipes-core/fts/fts/fts-uclibc.patch b/import-layers/yocto-poky/meta/recipes-core/fts/fts/fts-uclibc.patch
new file mode 100644
index 000000000..397654bf5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/fts/fts/fts-uclibc.patch
@@ -0,0 +1,50 @@
+Add missing defines for uclibc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Inappropriate
+
+--- fts.orig/fts.c
++++ fts/fts.c
+@@ -31,6 +31,10 @@
+ * SUCH DAMAGE.
+ */
+
++#define alignof(TYPE) ((int) &((struct { char dummy1; TYPE dummy2; } *) 0)->dummy2)
++#define ALIGNBYTES (alignof(long double) - 1)
++#define ALIGN(p) (((uintptr_t)(p) + ALIGNBYTES) & ~ALIGNBYTES)
++
+ #if defined(LIBC_SCCS) && !defined(lint)
+ static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94";
+ #endif /* LIBC_SCCS and not lint */
+@@ -652,10 +656,10 @@
+ if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name))
+ continue;
+
+- if ((p = fts_alloc(sp, dp->d_name, (int)dp->d_namlen)) == NULL)
++ if ((p = fts_alloc(sp, dp->d_name, (int)dp->d_reclen)) == NULL)
+ goto mem1;
+- if (dp->d_namlen > maxlen) {
+- if (fts_palloc(sp, (size_t)dp->d_namlen)) {
++ if (dp->d_reclen > maxlen) {
++ if (fts_palloc(sp, (size_t)dp->d_reclen)) {
+ /*
+ * No more memory for path or structures. Save
+ * errno, free up the current structure and the
+@@ -675,7 +679,7 @@
+ maxlen = sp->fts_pathlen - sp->fts_cur->fts_pathlen - 1;
+ }
+
+- p->fts_pathlen = len + dp->d_namlen + 1;
++ p->fts_pathlen = len + dp->d_reclen + 1;
+ p->fts_parent = sp->fts_cur;
+ p->fts_level = level;
+
+@@ -784,7 +788,7 @@
+ /* If user needs stat info, stat buffer already allocated. */
+ sbp = ISSET(FTS_NOSTAT) ? &sb : p->fts_statp;
+
+-#ifdef DT_WHT
++#ifdef S_IFWHT
+ /*
+ * Whited-out files don't really exist. However, there's stat(2) file
+ * mask for them, so we set it so that programs (i.e., find) don't have
diff --git a/import-layers/yocto-poky/meta/recipes-core/fts/fts/gcc5.patch b/import-layers/yocto-poky/meta/recipes-core/fts/fts/gcc5.patch
new file mode 100644
index 000000000..f5b948edc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/fts/fts/gcc5.patch
@@ -0,0 +1,1368 @@
+Forward port the sources to be able to compile with c99/gcc5
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Inappropriate
+
+Index: fts/fts.c
+===================================================================
+--- fts.orig/fts.c
++++ fts/fts.c
+@@ -51,16 +51,6 @@ static char sccsid[] = "@(#)fts.c 8.6 (B
+ #include <string.h>
+ #include <unistd.h>
+
+-static FTSENT *fts_alloc __P(FTS *, char *, int);
+-static FTSENT *fts_build __P(FTS *, int);
+-static void fts_lfree __P(FTSENT *);
+-static void fts_load __P(FTS *, FTSENT *);
+-static size_t fts_maxarglen __P(char * const *);
+-static void fts_padjust __P(FTS *, void *);
+-static int fts_palloc __P(FTS *, size_t);
+-static FTSENT *fts_sort __P(FTS *, FTSENT *, int);
+-static u_short fts_stat __P(FTS *, struct dirent *, FTSENT *, int);
+-
+ #define ISDOT(a) (a[0] == '.' && (!a[1] || a[1] == '.' && !a[2]))
+
+ #define ISSET(opt) (sp->fts_options & opt)
+@@ -73,119 +63,16 @@ static u_short fts_stat __P(FTS *, stru
+ #define BCHILD 1 /* fts_children */
+ #define BNAMES 2 /* fts_children, names only */
+ #define BREAD 3 /* fts_read */
+-
+-FTS *
+-fts_open(argv, options, compar)
+- char * const *argv;
+- register int options;
+- int (*compar)();
+-{
+- register FTS *sp;
+- register FTSENT *p, *root;
+- register int nitems;
+- FTSENT *parent, *tmp;
+- int len;
+-
+- /* Options check. */
+- if (options & ~FTS_OPTIONMASK) {
+- errno = EINVAL;
+- return (NULL);
+- }
+-
+- /* Allocate/initialize the stream */
+- if ((sp = malloc((u_int)sizeof(FTS))) == NULL)
+- return (NULL);
+- memset(sp, 0, sizeof(FTS));
+- sp->fts_compar = compar;
+- sp->fts_options = options;
+-
+- /* Logical walks turn on NOCHDIR; symbolic links are too hard. */
+- if (ISSET(FTS_LOGICAL))
+- SET(FTS_NOCHDIR);
+-
+- /*
+- * Start out with 1K of path space, and enough, in any case,
+- * to hold the user's paths.
+- */
+- if (fts_palloc(sp, MAX(fts_maxarglen(argv), MAXPATHLEN)))
+- goto mem1;
+-
+- /* Allocate/initialize root's parent. */
+- if ((parent = fts_alloc(sp, "", 0)) == NULL)
+- goto mem2;
+- parent->fts_level = FTS_ROOTPARENTLEVEL;
+-
+- /* Allocate/initialize root(s). */
+- for (root = NULL, nitems = 0; *argv; ++argv, ++nitems) {
+- /* Don't allow zero-length paths. */
+- if ((len = strlen(*argv)) == 0) {
+- errno = EINVAL;
+- goto mem3;
+- }
+-
+- p = fts_alloc(sp, *argv, len);
+- p->fts_level = FTS_ROOTLEVEL;
+- p->fts_parent = parent;
+- p->fts_accpath = p->fts_name;
+- p->fts_info = fts_stat(sp, NULL, p, ISSET(FTS_COMFOLLOW));
+-
+- /* Command-line "." and ".." are real directories. */
+- if (p->fts_info == FTS_DOT)
+- p->fts_info = FTS_D;
+-
+- /*
+- * If comparison routine supplied, traverse in sorted
+- * order; otherwise traverse in the order specified.
+- */
+- if (compar) {
+- p->fts_link = root;
+- root = p;
+- } else {
+- p->fts_link = NULL;
+- if (root == NULL)
+- tmp = root = p;
+- else {
+- tmp->fts_link = p;
+- tmp = p;
+- }
+- }
+- }
+- if (compar && nitems > 1)
+- root = fts_sort(sp, root, nitems);
+-
+- /*
+- * Allocate a dummy pointer and make fts_read think that we've just
+- * finished the node before the root(s); set p->fts_info to FTS_INIT
+- * so that everything about the "current" node is ignored.
+- */
+- if ((sp->fts_cur = fts_alloc(sp, "", 0)) == NULL)
+- goto mem3;
+- sp->fts_cur->fts_link = root;
+- sp->fts_cur->fts_info = FTS_INIT;
+-
+- /*
+- * If using chdir(2), grab a file descriptor pointing to dot to insure
+- * that we can get back here; this could be avoided for some paths,
+- * but almost certainly not worth the effort. Slashes, symbolic links,
+- * and ".." are all fairly nasty problems. Note, if we can't get the
+- * descriptor we run anyway, just more slowly.
+- */
+- if (!ISSET(FTS_NOCHDIR) && (sp->fts_rfd = open(".", O_RDONLY, 0)) < 0)
+- SET(FTS_NOCHDIR);
+-
+- return (sp);
+-
+-mem3: fts_lfree(root);
+- free(parent);
+-mem2: free(sp->fts_path);
+-mem1: free(sp);
+- return (NULL);
+-}
++/*
++ * Special case a root of "/" so that slashes aren't appended which would
++ * cause paths to be written as "//foo".
++ */
++#define NAPPEND(p) \
++ (p->fts_level == FTS_ROOTLEVEL && p->fts_pathlen == 1 && \
++ p->fts_path[0] == '/' ? 0 : p->fts_pathlen)
+
+ static void
+-fts_load(sp, p)
+- FTS *sp;
+- register FTSENT *p;
++fts_load(FTS *sp, register FTSENT *p)
+ {
+ register int len;
+ register char *cp;
+@@ -208,332 +95,214 @@ fts_load(sp, p)
+ sp->fts_dev = p->fts_dev;
+ }
+
+-int
+-fts_close(sp)
+- FTS *sp;
++static void
++fts_lfree(register FTSENT *head)
+ {
+- register FTSENT *freep, *p;
+- int saved_errno;
++ register FTSENT *p;
+
+- /*
+- * This still works if we haven't read anything -- the dummy structure
+- * points to the root list, so we step through to the end of the root
+- * list which has a valid parent pointer.
+- */
+- if (sp->fts_cur) {
+- for (p = sp->fts_cur; p->fts_level >= FTS_ROOTLEVEL;) {
+- freep = p;
+- p = p->fts_link ? p->fts_link : p->fts_parent;
+- free(freep);
+- }
++ /* Free a linked list of structures. */
++ while (p = head) {
++ head = head->fts_link;
+ free(p);
+ }
++}
+
+- /* Free up child linked list, sort array, path buffer. */
+- if (sp->fts_child)
+- fts_lfree(sp->fts_child);
+- if (sp->fts_array)
+- free(sp->fts_array);
+- free(sp->fts_path);
++static size_t
++fts_maxarglen(char * const *argv)
++{
++ size_t len, max;
+
+- /* Return to original directory, save errno if necessary. */
+- if (!ISSET(FTS_NOCHDIR)) {
+- saved_errno = fchdir(sp->fts_rfd) ? errno : 0;
+- (void)close(sp->fts_rfd);
+- }
++ for (max = 0; *argv; ++argv)
++ if ((len = strlen(*argv)) > max)
++ max = len;
++ return (max);
++}
+
+- /* Free up the stream pointer. */
+- free(sp);
+
+- /* Set errno and return. */
+- if (!ISSET(FTS_NOCHDIR) && saved_errno) {
+- errno = saved_errno;
+- return (-1);
++/*
++ * When the path is realloc'd, have to fix all of the pointers in structures
++ * already returned.
++ */
++static void
++fts_padjust(FTS *sp, void *addr)
++{
++ FTSENT *p;
++
++#define ADJUST(p) { \
++ (p)->fts_accpath = \
++ (char *)addr + ((p)->fts_accpath - (p)->fts_path); \
++ (p)->fts_path = addr; \
++}
++ /* Adjust the current set of children. */
++ for (p = sp->fts_child; p; p = p->fts_link)
++ ADJUST(p);
++
++ /* Adjust the rest of the tree. */
++ for (p = sp->fts_cur; p->fts_level >= FTS_ROOTLEVEL;) {
++ ADJUST(p);
++ p = p->fts_link ? p->fts_link : p->fts_parent;
+ }
+- return (0);
+ }
+
+ /*
+- * Special case a root of "/" so that slashes aren't appended which would
+- * cause paths to be written as "//foo".
++ * Allow essentially unlimited paths; find, rm, ls should all work on any tree.
++ * Most systems will allow creation of paths much longer than MAXPATHLEN, even
++ * though the kernel won't resolve them. Add the size (not just what's needed)
++ * plus 256 bytes so don't realloc the path 2 bytes at a time.
+ */
+-#define NAPPEND(p) \
+- (p->fts_level == FTS_ROOTLEVEL && p->fts_pathlen == 1 && \
+- p->fts_path[0] == '/' ? 0 : p->fts_pathlen)
++static int
++fts_palloc(FTS *sp, size_t more)
++{
++ sp->fts_pathlen += more + 256;
++ sp->fts_path = realloc(sp->fts_path, (size_t)sp->fts_pathlen);
++ return (sp->fts_path == NULL);
++}
+
+-FTSENT *
+-fts_read(sp)
+- register FTS *sp;
++static FTSENT *
++fts_alloc(FTS *sp, char *name, register int namelen)
+ {
+- register FTSENT *p, *tmp;
+- register int instr;
+- register char *t;
+- int saved_errno;
++ register FTSENT *p;
++ size_t len;
+
+- /* If finished or unrecoverable error, return NULL. */
+- if (sp->fts_cur == NULL || ISSET(FTS_STOP))
++ /*
++ * The file name is a variable length array and no stat structure is
++ * necessary if the user has set the nostat bit. Allocate the FTSENT
++ * structure, the file name and the stat structure in one chunk, but
++ * be careful that the stat structure is reasonably aligned. Since the
++ * fts_name field is declared to be of size 1, the fts_name pointer is
++ * namelen + 2 before the first possible address of the stat structure.
++ */
++ len = sizeof(FTSENT) + namelen;
++ if (!ISSET(FTS_NOSTAT))
++ len += sizeof(struct stat) + ALIGNBYTES;
++ if ((p = malloc(len)) == NULL)
+ return (NULL);
+
+- /* Set current node pointer. */
+- p = sp->fts_cur;
++ /* Copy the name plus the trailing NULL. */
++ memmove(p->fts_name, name, namelen + 1);
+
+- /* Save and zero out user instructions. */
+- instr = p->fts_instr;
++ if (!ISSET(FTS_NOSTAT))
++ p->fts_statp = (struct stat *)ALIGN(p->fts_name + namelen + 2);
++ p->fts_namelen = namelen;
++ p->fts_path = sp->fts_path;
++ p->fts_errno = 0;
++ p->fts_flags = 0;
+ p->fts_instr = FTS_NOINSTR;
++ p->fts_number = 0;
++ p->fts_pointer = NULL;
++ return (p);
++}
+
+- /* Any type of file may be re-visited; re-stat and re-turn. */
+- if (instr == FTS_AGAIN) {
+- p->fts_info = fts_stat(sp, NULL, p, 0);
+- return (p);
+- }
+
++static u_short
++fts_stat(FTS *sp, register FTSENT *p, struct dirent *dp, int follow)
++{
++ register FTSENT *t;
++ register dev_t dev;
++ register ino_t ino;
++ struct stat *sbp, sb;
++ int saved_errno;
++
++ /* If user needs stat info, stat buffer already allocated. */
++ sbp = ISSET(FTS_NOSTAT) ? &sb : p->fts_statp;
++
++#ifdef S_IFWHT
+ /*
+- * Following a symlink -- SLNONE test allows application to see
+- * SLNONE and recover. If indirecting through a symlink, have
+- * keep a pointer to current location. If unable to get that
+- * pointer, follow fails.
+- */
+- if (instr == FTS_FOLLOW &&
+- (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) {
+- p->fts_info = fts_stat(sp, NULL, p, 1);
+- if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR))
+- if ((p->fts_symfd = open(".", O_RDONLY, 0)) < 0) {
+- p->fts_errno = errno;
+- p->fts_info = FTS_ERR;
+- } else
+- p->fts_flags |= FTS_SYMFOLLOW;
+- return (p);
++ * Whited-out files don't really exist. However, there's stat(2) file
++ * mask for them, so we set it so that programs (i.e., find) don't have
++ * to test FTS_W separately from other file types.
++ */
++ if (dp != NULL && dp->d_type == DT_WHT) {
++ memset(sbp, 0, sizeof(struct stat));
++ sbp->st_mode = S_IFWHT;
++ return (FTS_W);
+ }
+-
+- /* Directory in pre-order. */
+- if (p->fts_info == FTS_D) {
+- /* If skipped or crossed mount point, do post-order visit. */
+- if (instr == FTS_SKIP ||
+- ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev) {
+- if (p->fts_flags & FTS_SYMFOLLOW)
+- (void)close(p->fts_symfd);
+- if (sp->fts_child) {
+- fts_lfree(sp->fts_child);
+- sp->fts_child = NULL;
+- }
+- p->fts_info = FTS_DP;
+- return (p);
+- }
+-
+- /* Rebuild if only read the names and now traversing. */
+- if (sp->fts_child && sp->fts_options & FTS_NAMEONLY) {
+- sp->fts_options &= ~FTS_NAMEONLY;
+- fts_lfree(sp->fts_child);
+- sp->fts_child = NULL;
+- }
+-
+- /*
+- * Cd to the subdirectory.
+- *
+- * If have already read and now fail to chdir, whack the list
+- * to make the names come out right, and set the parent errno
+- * so the application will eventually get an error condition.
+- * Set the FTS_DONTCHDIR flag so that when we logically change
+- * directories back to the parent we don't do a chdir.
+- *
+- * If haven't read do so. If the read fails, fts_build sets
+- * FTS_STOP or the fts_info field of the node.
+- */
+- if (sp->fts_child) {
+- if (CHDIR(sp, p->fts_accpath)) {
+- p->fts_errno = errno;
+- p->fts_flags |= FTS_DONTCHDIR;
+- for (p = sp->fts_child; p; p = p->fts_link)
+- p->fts_accpath =
+- p->fts_parent->fts_accpath;
+- }
+- } else if ((sp->fts_child = fts_build(sp, BREAD)) == NULL) {
+- if (ISSET(FTS_STOP))
+- return (NULL);
+- return (p);
++#endif
++
++ /*
++ * If doing a logical walk, or application requested FTS_FOLLOW, do
++ * a stat(2). If that fails, check for a non-existent symlink. If
++ * fail, set the errno from the stat call.
++ */
++ if (ISSET(FTS_LOGICAL) || follow) {
++ if (stat(p->fts_accpath, sbp)) {
++ saved_errno = errno;
++ if (!lstat(p->fts_accpath, sbp)) {
++ errno = 0;
++ return (FTS_SLNONE);
++ }
++ p->fts_errno = saved_errno;
++ goto err;
+ }
+- p = sp->fts_child;
+- sp->fts_child = NULL;
+- goto name;
++ } else if (lstat(p->fts_accpath, sbp)) {
++ p->fts_errno = errno;
++err: memset(sbp, 0, sizeof(struct stat));
++ return (FTS_NS);
+ }
+
+- /* Move to the next node on this level. */
+-next: tmp = p;
+- if (p = p->fts_link) {
+- free(tmp);
+-
+- /*
+- * If reached the top, return to the original directory, and
+- * load the paths for the next root.
+- */
+- if (p->fts_level == FTS_ROOTLEVEL) {
+- if (!ISSET(FTS_NOCHDIR) && FCHDIR(sp, sp->fts_rfd)) {
+- SET(FTS_STOP);
+- return (NULL);
+- }
+- fts_load(sp, p);
+- return (sp->fts_cur = p);
+- }
+-
++ if (S_ISDIR(sbp->st_mode)) {
+ /*
+- * User may have called fts_set on the node. If skipped,
+- * ignore. If followed, get a file descriptor so we can
+- * get back if necessary.
++ * Set the device/inode. Used to find cycles and check for
++ * crossing mount points. Also remember the link count, used
++ * in fts_build to limit the number of stat calls. It is
++ * understood that these fields are only referenced if fts_info
++ * is set to FTS_D.
+ */
+- if (p->fts_instr == FTS_SKIP)
+- goto next;
+- if (p->fts_instr == FTS_FOLLOW) {
+- p->fts_info = fts_stat(sp, NULL, p, 1);
+- if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR))
+- if ((p->fts_symfd =
+- open(".", O_RDONLY, 0)) < 0) {
+- p->fts_errno = errno;
+- p->fts_info = FTS_ERR;
+- } else
+- p->fts_flags |= FTS_SYMFOLLOW;
+- p->fts_instr = FTS_NOINSTR;
+- }
+-
+-name: t = sp->fts_path + NAPPEND(p->fts_parent);
+- *t++ = '/';
+- memmove(t, p->fts_name, p->fts_namelen + 1);
+- return (sp->fts_cur = p);
+- }
++ dev = p->fts_dev = sbp->st_dev;
++ ino = p->fts_ino = sbp->st_ino;
++ p->fts_nlink = sbp->st_nlink;
+
+- /* Move up to the parent node. */
+- p = tmp->fts_parent;
+- free(tmp);
++ if (ISDOT(p->fts_name))
++ return (FTS_DOT);
+
+- if (p->fts_level == FTS_ROOTPARENTLEVEL) {
+ /*
+- * Done; free everything up and set errno to 0 so the user
+- * can distinguish between error and EOF.
++ * Cycle detection is done by brute force when the directory
++ * is first encountered. If the tree gets deep enough or the
++ * number of symbolic links to directories is high enough,
++ * something faster might be worthwhile.
+ */
+- free(p);
+- errno = 0;
+- return (sp->fts_cur = NULL);
+- }
+-
+- /* Nul terminate the pathname. */
+- sp->fts_path[p->fts_pathlen] = '\0';
+-
+- /*
+- * Return to the parent directory. If at a root node or came through
+- * a symlink, go back through the file descriptor. Otherwise, cd up
+- * one directory.
+- */
+- if (p->fts_level == FTS_ROOTLEVEL) {
+- if (!ISSET(FTS_NOCHDIR) && FCHDIR(sp, sp->fts_rfd)) {
+- SET(FTS_STOP);
+- return (NULL);
+- }
+- } else if (p->fts_flags & FTS_SYMFOLLOW) {
+- if (FCHDIR(sp, p->fts_symfd)) {
+- saved_errno = errno;
+- (void)close(p->fts_symfd);
+- errno = saved_errno;
+- SET(FTS_STOP);
+- return (NULL);
+- }
+- (void)close(p->fts_symfd);
+- } else if (!(p->fts_flags & FTS_DONTCHDIR)) {
+- if (CHDIR(sp, "..")) {
+- SET(FTS_STOP);
+- return (NULL);
+- }
+- }
+- p->fts_info = p->fts_errno ? FTS_ERR : FTS_DP;
+- return (sp->fts_cur = p);
+-}
+-
+-/*
+- * Fts_set takes the stream as an argument although it's not used in this
+- * implementation; it would be necessary if anyone wanted to add global
+- * semantics to fts using fts_set. An error return is allowed for similar
+- * reasons.
+- */
+-/* ARGSUSED */
+-int
+-fts_set(sp, p, instr)
+- FTS *sp;
+- FTSENT *p;
+- int instr;
+-{
+- if (instr && instr != FTS_AGAIN && instr != FTS_FOLLOW &&
+- instr != FTS_NOINSTR && instr != FTS_SKIP) {
+- errno = EINVAL;
+- return (1);
++ for (t = p->fts_parent;
++ t->fts_level >= FTS_ROOTLEVEL; t = t->fts_parent)
++ if (ino == t->fts_ino && dev == t->fts_dev) {
++ p->fts_cycle = t;
++ return (FTS_DC);
++ }
++ return (FTS_D);
+ }
+- p->fts_instr = instr;
+- return (0);
++ if (S_ISLNK(sbp->st_mode))
++ return (FTS_SL);
++ if (S_ISREG(sbp->st_mode))
++ return (FTS_F);
++ return (FTS_DEFAULT);
+ }
+
+-FTSENT *
+-fts_children(sp, instr)
+- register FTS *sp;
+- int instr;
++static FTSENT *
++fts_sort(FTS *sp, FTSENT *head, register int nitems)
+ {
+- register FTSENT *p;
+- int fd;
+-
+- if (instr && instr != FTS_NAMEONLY) {
+- errno = EINVAL;
+- return (NULL);
+- }
+-
+- /* Set current node pointer. */
+- p = sp->fts_cur;
+-
+- /*
+- * Errno set to 0 so user can distinguish empty directory from
+- * an error.
+- */
+- errno = 0;
+-
+- /* Fatal errors stop here. */
+- if (ISSET(FTS_STOP))
+- return (NULL);
+-
+- /* Return logical hierarchy of user's arguments. */
+- if (p->fts_info == FTS_INIT)
+- return (p->fts_link);
+-
+- /*
+- * If not a directory being visited in pre-order, stop here. Could
+- * allow FTS_DNR, assuming the user has fixed the problem, but the
+- * same effect is available with FTS_AGAIN.
+- */
+- if (p->fts_info != FTS_D /* && p->fts_info != FTS_DNR */)
+- return (NULL);
+-
+- /* Free up any previous child list. */
+- if (sp->fts_child)
+- fts_lfree(sp->fts_child);
+-
+- if (instr == FTS_NAMEONLY) {
+- sp->fts_options |= FTS_NAMEONLY;
+- instr = BNAMES;
+- } else
+- instr = BCHILD;
++ register FTSENT **ap, *p;
+
+ /*
+- * If using chdir on a relative path and called BEFORE fts_read does
+- * its chdir to the root of a traversal, we can lose -- we need to
+- * chdir into the subdirectory, and we don't know where the current
+- * directory is, so we can't get back so that the upcoming chdir by
+- * fts_read will work.
++ * Construct an array of pointers to the structures and call qsort(3).
++ * Reassemble the array in the order returned by qsort. If unable to
++ * sort for memory reasons, return the directory entries in their
++ * current order. Allocate enough space for the current needs plus
++ * 40 so don't realloc one entry at a time.
+ */
+- if (p->fts_level != FTS_ROOTLEVEL || p->fts_accpath[0] == '/' ||
+- ISSET(FTS_NOCHDIR))
+- return (sp->fts_child = fts_build(sp, instr));
+-
+- if ((fd = open(".", O_RDONLY, 0)) < 0)
+- return (NULL);
+- sp->fts_child = fts_build(sp, instr);
+- if (fchdir(fd))
+- return (NULL);
+- (void)close(fd);
+- return (sp->fts_child);
++ if (nitems > sp->fts_nitems) {
++ sp->fts_nitems = nitems + 40;
++ if ((sp->fts_array = realloc(sp->fts_array,
++ (size_t)(sp->fts_nitems * sizeof(FTSENT *)))) == NULL) {
++ sp->fts_nitems = 0;
++ return (head);
++ }
++ }
++ for (ap = sp->fts_array, p = head; p; p = p->fts_link)
++ *ap++ = p;
++ qsort((void *)sp->fts_array, nitems, sizeof(FTSENT *), sp->fts_compar);
++ for (head = *(ap = sp->fts_array); --nitems; ++ap)
++ ap[0]->fts_link = ap[1];
++ ap[0]->fts_link = NULL;
++ return (head);
+ }
+
+ /*
+@@ -551,9 +320,7 @@ fts_children(sp, instr)
+ * been found, cutting the stat calls by about 2/3.
+ */
+ static FTSENT *
+-fts_build(sp, type)
+- register FTS *sp;
+- int type;
++fts_build(register FTS *sp, int type)
+ {
+ register struct dirent *dp;
+ register FTSENT *p, *head;
+@@ -716,283 +483,479 @@ mem1: saved_errno = errno;
+ --nlinks;
+ }
+
+- /* We walk in directory order so "ls -f" doesn't get upset. */
+- p->fts_link = NULL;
+- if (head == NULL)
+- head = tail = p;
+- else {
+- tail->fts_link = p;
+- tail = p;
++ /* We walk in directory order so "ls -f" doesn't get upset. */
++ p->fts_link = NULL;
++ if (head == NULL)
++ head = tail = p;
++ else {
++ tail->fts_link = p;
++ tail = p;
++ }
++ ++nitems;
++ }
++ (void)closedir(dirp);
++
++ /*
++ * If had to realloc the path, adjust the addresses for the rest
++ * of the tree.
++ */
++ if (adjaddr)
++ fts_padjust(sp, adjaddr);
++
++ /*
++ * If not changing directories, reset the path back to original
++ * state.
++ */
++ if (ISSET(FTS_NOCHDIR)) {
++ if (cp - 1 > sp->fts_path)
++ --cp;
++ *cp = '\0';
++ }
++
++ /*
++ * If descended after called from fts_children or after called from
++ * fts_read and nothing found, get back. At the root level we use
++ * the saved fd; if one of fts_open()'s arguments is a relative path
++ * to an empty directory, we wind up here with no other way back. If
++ * can't get back, we're done.
++ */
++ if (descend && (type == BCHILD || !nitems) &&
++ (cur->fts_level == FTS_ROOTLEVEL ?
++ FCHDIR(sp, sp->fts_rfd) : CHDIR(sp, ".."))) {
++ cur->fts_info = FTS_ERR;
++ SET(FTS_STOP);
++ return (NULL);
++ }
++
++ /* If didn't find anything, return NULL. */
++ if (!nitems) {
++ if (type == BREAD)
++ cur->fts_info = FTS_DP;
++ return (NULL);
++ }
++
++ /* Sort the entries. */
++ if (sp->fts_compar && nitems > 1)
++ head = fts_sort(sp, head, nitems);
++ return (head);
++}
++
++
++FTS *
++fts_open(char * const *argv, register int options, int (*compar)())
++{
++ register FTS *sp;
++ register FTSENT *p, *root;
++ register int nitems;
++ FTSENT *parent, *tmp;
++ int len;
++
++ /* Options check. */
++ if (options & ~FTS_OPTIONMASK) {
++ errno = EINVAL;
++ return (NULL);
++ }
++
++ /* Allocate/initialize the stream */
++ if ((sp = malloc((u_int)sizeof(FTS))) == NULL)
++ return (NULL);
++ memset(sp, 0, sizeof(FTS));
++ sp->fts_compar = compar;
++ sp->fts_options = options;
++
++ /* Logical walks turn on NOCHDIR; symbolic links are too hard. */
++ if (ISSET(FTS_LOGICAL))
++ SET(FTS_NOCHDIR);
++
++ /*
++ * Start out with 1K of path space, and enough, in any case,
++ * to hold the user's paths.
++ */
++ if (fts_palloc(sp, MAX(fts_maxarglen(argv), MAXPATHLEN)))
++ goto mem1;
++
++ /* Allocate/initialize root's parent. */
++ if ((parent = fts_alloc(sp, "", 0)) == NULL)
++ goto mem2;
++ parent->fts_level = FTS_ROOTPARENTLEVEL;
++
++ /* Allocate/initialize root(s). */
++ for (root = NULL, nitems = 0; *argv; ++argv, ++nitems) {
++ /* Don't allow zero-length paths. */
++ if ((len = strlen(*argv)) == 0) {
++ errno = EINVAL;
++ goto mem3;
++ }
++
++ p = fts_alloc(sp, *argv, len);
++ p->fts_level = FTS_ROOTLEVEL;
++ p->fts_parent = parent;
++ p->fts_accpath = p->fts_name;
++ p->fts_info = fts_stat(sp, NULL, p, ISSET(FTS_COMFOLLOW));
++
++ /* Command-line "." and ".." are real directories. */
++ if (p->fts_info == FTS_DOT)
++ p->fts_info = FTS_D;
++
++ /*
++ * If comparison routine supplied, traverse in sorted
++ * order; otherwise traverse in the order specified.
++ */
++ if (compar) {
++ p->fts_link = root;
++ root = p;
++ } else {
++ p->fts_link = NULL;
++ if (root == NULL)
++ tmp = root = p;
++ else {
++ tmp->fts_link = p;
++ tmp = p;
++ }
+ }
+- ++nitems;
+ }
+- (void)closedir(dirp);
+-
+- /*
+- * If had to realloc the path, adjust the addresses for the rest
+- * of the tree.
+- */
+- if (adjaddr)
+- fts_padjust(sp, adjaddr);
++ if (compar && nitems > 1)
++ root = fts_sort(sp, root, nitems);
+
+ /*
+- * If not changing directories, reset the path back to original
+- * state.
++ * Allocate a dummy pointer and make fts_read think that we've just
++ * finished the node before the root(s); set p->fts_info to FTS_INIT
++ * so that everything about the "current" node is ignored.
+ */
+- if (ISSET(FTS_NOCHDIR)) {
+- if (cp - 1 > sp->fts_path)
+- --cp;
+- *cp = '\0';
+- }
++ if ((sp->fts_cur = fts_alloc(sp, "", 0)) == NULL)
++ goto mem3;
++ sp->fts_cur->fts_link = root;
++ sp->fts_cur->fts_info = FTS_INIT;
+
+ /*
+- * If descended after called from fts_children or after called from
+- * fts_read and nothing found, get back. At the root level we use
+- * the saved fd; if one of fts_open()'s arguments is a relative path
+- * to an empty directory, we wind up here with no other way back. If
+- * can't get back, we're done.
++ * If using chdir(2), grab a file descriptor pointing to dot to insure
++ * that we can get back here; this could be avoided for some paths,
++ * but almost certainly not worth the effort. Slashes, symbolic links,
++ * and ".." are all fairly nasty problems. Note, if we can't get the
++ * descriptor we run anyway, just more slowly.
+ */
+- if (descend && (type == BCHILD || !nitems) &&
+- (cur->fts_level == FTS_ROOTLEVEL ?
+- FCHDIR(sp, sp->fts_rfd) : CHDIR(sp, ".."))) {
+- cur->fts_info = FTS_ERR;
+- SET(FTS_STOP);
+- return (NULL);
+- }
++ if (!ISSET(FTS_NOCHDIR) && (sp->fts_rfd = open(".", O_RDONLY, 0)) < 0)
++ SET(FTS_NOCHDIR);
+
+- /* If didn't find anything, return NULL. */
+- if (!nitems) {
+- if (type == BREAD)
+- cur->fts_info = FTS_DP;
+- return (NULL);
+- }
++ return (sp);
+
+- /* Sort the entries. */
+- if (sp->fts_compar && nitems > 1)
+- head = fts_sort(sp, head, nitems);
+- return (head);
++mem3: fts_lfree(root);
++ free(parent);
++mem2: free(sp->fts_path);
++mem1: free(sp);
++ return (NULL);
+ }
+
+-static u_short
+-fts_stat(sp, dp, p, follow)
+- FTS *sp;
+- register FTSENT *p;
+- struct dirent *dp;
+- int follow;
++FTSENT *
++fts_read(register FTS *sp)
+ {
+- register FTSENT *t;
+- register dev_t dev;
+- register ino_t ino;
+- struct stat *sbp, sb;
++ register FTSENT *p, *tmp;
++ register int instr;
++ register char *t;
+ int saved_errno;
+
+- /* If user needs stat info, stat buffer already allocated. */
+- sbp = ISSET(FTS_NOSTAT) ? &sb : p->fts_statp;
++ /* If finished or unrecoverable error, return NULL. */
++ if (sp->fts_cur == NULL || ISSET(FTS_STOP))
++ return (NULL);
+
+-#ifdef S_IFWHT
+- /*
+- * Whited-out files don't really exist. However, there's stat(2) file
+- * mask for them, so we set it so that programs (i.e., find) don't have
+- * to test FTS_W separately from other file types.
+- */
+- if (dp != NULL && dp->d_type == DT_WHT) {
+- memset(sbp, 0, sizeof(struct stat));
+- sbp->st_mode = S_IFWHT;
+- return (FTS_W);
++ /* Set current node pointer. */
++ p = sp->fts_cur;
++
++ /* Save and zero out user instructions. */
++ instr = p->fts_instr;
++ p->fts_instr = FTS_NOINSTR;
++
++ /* Any type of file may be re-visited; re-stat and re-turn. */
++ if (instr == FTS_AGAIN) {
++ p->fts_info = fts_stat(sp, NULL, p, 0);
++ return (p);
+ }
+-#endif
+-
++
+ /*
+- * If doing a logical walk, or application requested FTS_FOLLOW, do
+- * a stat(2). If that fails, check for a non-existent symlink. If
+- * fail, set the errno from the stat call.
++ * Following a symlink -- SLNONE test allows application to see
++ * SLNONE and recover. If indirecting through a symlink, have
++ * keep a pointer to current location. If unable to get that
++ * pointer, follow fails.
+ */
+- if (ISSET(FTS_LOGICAL) || follow) {
+- if (stat(p->fts_accpath, sbp)) {
+- saved_errno = errno;
+- if (!lstat(p->fts_accpath, sbp)) {
+- errno = 0;
+- return (FTS_SLNONE);
+- }
+- p->fts_errno = saved_errno;
+- goto err;
++ if (instr == FTS_FOLLOW &&
++ (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) {
++ p->fts_info = fts_stat(sp, NULL, p, 1);
++ if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR))
++ if ((p->fts_symfd = open(".", O_RDONLY, 0)) < 0) {
++ p->fts_errno = errno;
++ p->fts_info = FTS_ERR;
++ } else
++ p->fts_flags |= FTS_SYMFOLLOW;
++ return (p);
++ }
++
++ /* Directory in pre-order. */
++ if (p->fts_info == FTS_D) {
++ /* If skipped or crossed mount point, do post-order visit. */
++ if (instr == FTS_SKIP ||
++ ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev) {
++ if (p->fts_flags & FTS_SYMFOLLOW)
++ (void)close(p->fts_symfd);
++ if (sp->fts_child) {
++ fts_lfree(sp->fts_child);
++ sp->fts_child = NULL;
++ }
++ p->fts_info = FTS_DP;
++ return (p);
+ }
+- } else if (lstat(p->fts_accpath, sbp)) {
+- p->fts_errno = errno;
+-err: memset(sbp, 0, sizeof(struct stat));
+- return (FTS_NS);
++
++ /* Rebuild if only read the names and now traversing. */
++ if (sp->fts_child && sp->fts_options & FTS_NAMEONLY) {
++ sp->fts_options &= ~FTS_NAMEONLY;
++ fts_lfree(sp->fts_child);
++ sp->fts_child = NULL;
++ }
++
++ /*
++ * Cd to the subdirectory.
++ *
++ * If have already read and now fail to chdir, whack the list
++ * to make the names come out right, and set the parent errno
++ * so the application will eventually get an error condition.
++ * Set the FTS_DONTCHDIR flag so that when we logically change
++ * directories back to the parent we don't do a chdir.
++ *
++ * If haven't read do so. If the read fails, fts_build sets
++ * FTS_STOP or the fts_info field of the node.
++ */
++ if (sp->fts_child) {
++ if (CHDIR(sp, p->fts_accpath)) {
++ p->fts_errno = errno;
++ p->fts_flags |= FTS_DONTCHDIR;
++ for (p = sp->fts_child; p; p = p->fts_link)
++ p->fts_accpath =
++ p->fts_parent->fts_accpath;
++ }
++ } else if ((sp->fts_child = fts_build(sp, BREAD)) == NULL) {
++ if (ISSET(FTS_STOP))
++ return (NULL);
++ return (p);
++ }
++ p = sp->fts_child;
++ sp->fts_child = NULL;
++ goto name;
+ }
+
+- if (S_ISDIR(sbp->st_mode)) {
++ /* Move to the next node on this level. */
++next: tmp = p;
++ if (p = p->fts_link) {
++ free(tmp);
++
+ /*
+- * Set the device/inode. Used to find cycles and check for
+- * crossing mount points. Also remember the link count, used
+- * in fts_build to limit the number of stat calls. It is
+- * understood that these fields are only referenced if fts_info
+- * is set to FTS_D.
++ * If reached the top, return to the original directory, and
++ * load the paths for the next root.
+ */
+- dev = p->fts_dev = sbp->st_dev;
+- ino = p->fts_ino = sbp->st_ino;
+- p->fts_nlink = sbp->st_nlink;
++ if (p->fts_level == FTS_ROOTLEVEL) {
++ if (!ISSET(FTS_NOCHDIR) && FCHDIR(sp, sp->fts_rfd)) {
++ SET(FTS_STOP);
++ return (NULL);
++ }
++ fts_load(sp, p);
++ return (sp->fts_cur = p);
++ }
++
++ /*
++ * User may have called fts_set on the node. If skipped,
++ * ignore. If followed, get a file descriptor so we can
++ * get back if necessary.
++ */
++ if (p->fts_instr == FTS_SKIP)
++ goto next;
++ if (p->fts_instr == FTS_FOLLOW) {
++ p->fts_info = fts_stat(sp, NULL, p, 1);
++ if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR))
++ if ((p->fts_symfd =
++ open(".", O_RDONLY, 0)) < 0) {
++ p->fts_errno = errno;
++ p->fts_info = FTS_ERR;
++ } else
++ p->fts_flags |= FTS_SYMFOLLOW;
++ p->fts_instr = FTS_NOINSTR;
++ }
+
+- if (ISDOT(p->fts_name))
+- return (FTS_DOT);
++name: t = sp->fts_path + NAPPEND(p->fts_parent);
++ *t++ = '/';
++ memmove(t, p->fts_name, p->fts_namelen + 1);
++ return (sp->fts_cur = p);
++ }
+
++ /* Move up to the parent node. */
++ p = tmp->fts_parent;
++ free(tmp);
++
++ if (p->fts_level == FTS_ROOTPARENTLEVEL) {
+ /*
+- * Cycle detection is done by brute force when the directory
+- * is first encountered. If the tree gets deep enough or the
+- * number of symbolic links to directories is high enough,
+- * something faster might be worthwhile.
++ * Done; free everything up and set errno to 0 so the user
++ * can distinguish between error and EOF.
+ */
+- for (t = p->fts_parent;
+- t->fts_level >= FTS_ROOTLEVEL; t = t->fts_parent)
+- if (ino == t->fts_ino && dev == t->fts_dev) {
+- p->fts_cycle = t;
+- return (FTS_DC);
+- }
+- return (FTS_D);
++ free(p);
++ errno = 0;
++ return (sp->fts_cur = NULL);
+ }
+- if (S_ISLNK(sbp->st_mode))
+- return (FTS_SL);
+- if (S_ISREG(sbp->st_mode))
+- return (FTS_F);
+- return (FTS_DEFAULT);
+-}
+
+-static FTSENT *
+-fts_sort(sp, head, nitems)
+- FTS *sp;
+- FTSENT *head;
+- register int nitems;
+-{
+- register FTSENT **ap, *p;
++ /* Nul terminate the pathname. */
++ sp->fts_path[p->fts_pathlen] = '\0';
+
+ /*
+- * Construct an array of pointers to the structures and call qsort(3).
+- * Reassemble the array in the order returned by qsort. If unable to
+- * sort for memory reasons, return the directory entries in their
+- * current order. Allocate enough space for the current needs plus
+- * 40 so don't realloc one entry at a time.
++ * Return to the parent directory. If at a root node or came through
++ * a symlink, go back through the file descriptor. Otherwise, cd up
++ * one directory.
+ */
+- if (nitems > sp->fts_nitems) {
+- sp->fts_nitems = nitems + 40;
+- if ((sp->fts_array = realloc(sp->fts_array,
+- (size_t)(sp->fts_nitems * sizeof(FTSENT *)))) == NULL) {
+- sp->fts_nitems = 0;
+- return (head);
++ if (p->fts_level == FTS_ROOTLEVEL) {
++ if (!ISSET(FTS_NOCHDIR) && FCHDIR(sp, sp->fts_rfd)) {
++ SET(FTS_STOP);
++ return (NULL);
++ }
++ } else if (p->fts_flags & FTS_SYMFOLLOW) {
++ if (FCHDIR(sp, p->fts_symfd)) {
++ saved_errno = errno;
++ (void)close(p->fts_symfd);
++ errno = saved_errno;
++ SET(FTS_STOP);
++ return (NULL);
++ }
++ (void)close(p->fts_symfd);
++ } else if (!(p->fts_flags & FTS_DONTCHDIR)) {
++ if (CHDIR(sp, "..")) {
++ SET(FTS_STOP);
++ return (NULL);
+ }
+ }
+- for (ap = sp->fts_array, p = head; p; p = p->fts_link)
+- *ap++ = p;
+- qsort((void *)sp->fts_array, nitems, sizeof(FTSENT *), sp->fts_compar);
+- for (head = *(ap = sp->fts_array); --nitems; ++ap)
+- ap[0]->fts_link = ap[1];
+- ap[0]->fts_link = NULL;
+- return (head);
++ p->fts_info = p->fts_errno ? FTS_ERR : FTS_DP;
++ return (sp->fts_cur = p);
+ }
+
+-static FTSENT *
+-fts_alloc(sp, name, namelen)
+- FTS *sp;
+- char *name;
+- register int namelen;
++/*
++ * Fts_set takes the stream as an argument although it's not used in this
++ * implementation; it would be necessary if anyone wanted to add global
++ * semantics to fts using fts_set. An error return is allowed for similar
++ * reasons.
++ */
++/* ARGSUSED */
++int
++fts_set(FTS *sp, FTSENT *p, int instr)
++{
++ if (instr && instr != FTS_AGAIN && instr != FTS_FOLLOW &&
++ instr != FTS_NOINSTR && instr != FTS_SKIP) {
++ errno = EINVAL;
++ return (1);
++ }
++ p->fts_instr = instr;
++ return (0);
++}
++
++FTSENT *
++fts_children(register FTS *sp, int instr)
+ {
+ register FTSENT *p;
+- size_t len;
++ int fd;
++
++ if (instr && instr != FTS_NAMEONLY) {
++ errno = EINVAL;
++ return (NULL);
++ }
++
++ /* Set current node pointer. */
++ p = sp->fts_cur;
+
+ /*
+- * The file name is a variable length array and no stat structure is
+- * necessary if the user has set the nostat bit. Allocate the FTSENT
+- * structure, the file name and the stat structure in one chunk, but
+- * be careful that the stat structure is reasonably aligned. Since the
+- * fts_name field is declared to be of size 1, the fts_name pointer is
+- * namelen + 2 before the first possible address of the stat structure.
++ * Errno set to 0 so user can distinguish empty directory from
++ * an error.
+ */
+- len = sizeof(FTSENT) + namelen;
+- if (!ISSET(FTS_NOSTAT))
+- len += sizeof(struct stat) + ALIGNBYTES;
+- if ((p = malloc(len)) == NULL)
++ errno = 0;
++
++ /* Fatal errors stop here. */
++ if (ISSET(FTS_STOP))
+ return (NULL);
+
+- /* Copy the name plus the trailing NULL. */
+- memmove(p->fts_name, name, namelen + 1);
++ /* Return logical hierarchy of user's arguments. */
++ if (p->fts_info == FTS_INIT)
++ return (p->fts_link);
+
+- if (!ISSET(FTS_NOSTAT))
+- p->fts_statp = (struct stat *)ALIGN(p->fts_name + namelen + 2);
+- p->fts_namelen = namelen;
+- p->fts_path = sp->fts_path;
+- p->fts_errno = 0;
+- p->fts_flags = 0;
+- p->fts_instr = FTS_NOINSTR;
+- p->fts_number = 0;
+- p->fts_pointer = NULL;
+- return (p);
++ /*
++ * If not a directory being visited in pre-order, stop here. Could
++ * allow FTS_DNR, assuming the user has fixed the problem, but the
++ * same effect is available with FTS_AGAIN.
++ */
++ if (p->fts_info != FTS_D /* && p->fts_info != FTS_DNR */)
++ return (NULL);
++
++ /* Free up any previous child list. */
++ if (sp->fts_child)
++ fts_lfree(sp->fts_child);
++
++ if (instr == FTS_NAMEONLY) {
++ sp->fts_options |= FTS_NAMEONLY;
++ instr = BNAMES;
++ } else
++ instr = BCHILD;
++
++ /*
++ * If using chdir on a relative path and called BEFORE fts_read does
++ * its chdir to the root of a traversal, we can lose -- we need to
++ * chdir into the subdirectory, and we don't know where the current
++ * directory is, so we can't get back so that the upcoming chdir by
++ * fts_read will work.
++ */
++ if (p->fts_level != FTS_ROOTLEVEL || p->fts_accpath[0] == '/' ||
++ ISSET(FTS_NOCHDIR))
++ return (sp->fts_child = fts_build(sp, instr));
++
++ if ((fd = open(".", O_RDONLY, 0)) < 0)
++ return (NULL);
++ sp->fts_child = fts_build(sp, instr);
++ if (fchdir(fd))
++ return (NULL);
++ (void)close(fd);
++ return (sp->fts_child);
+ }
+
+-static void
+-fts_lfree(head)
+- register FTSENT *head;
++int
++fts_close(FTS *sp)
+ {
+- register FTSENT *p;
++ register FTSENT *freep, *p;
++ int saved_errno;
+
+- /* Free a linked list of structures. */
+- while (p = head) {
+- head = head->fts_link;
++ /*
++ * This still works if we haven't read anything -- the dummy structure
++ * points to the root list, so we step through to the end of the root
++ * list which has a valid parent pointer.
++ */
++ if (sp->fts_cur) {
++ for (p = sp->fts_cur; p->fts_level >= FTS_ROOTLEVEL;) {
++ freep = p;
++ p = p->fts_link ? p->fts_link : p->fts_parent;
++ free(freep);
++ }
+ free(p);
+ }
+-}
+
+-/*
+- * Allow essentially unlimited paths; find, rm, ls should all work on any tree.
+- * Most systems will allow creation of paths much longer than MAXPATHLEN, even
+- * though the kernel won't resolve them. Add the size (not just what's needed)
+- * plus 256 bytes so don't realloc the path 2 bytes at a time.
+- */
+-static int
+-fts_palloc(sp, more)
+- FTS *sp;
+- size_t more;
+-{
+- sp->fts_pathlen += more + 256;
+- sp->fts_path = realloc(sp->fts_path, (size_t)sp->fts_pathlen);
+- return (sp->fts_path == NULL);
+-}
++ /* Free up child linked list, sort array, path buffer. */
++ if (sp->fts_child)
++ fts_lfree(sp->fts_child);
++ if (sp->fts_array)
++ free(sp->fts_array);
++ free(sp->fts_path);
+
+-/*
+- * When the path is realloc'd, have to fix all of the pointers in structures
+- * already returned.
+- */
+-static void
+-fts_padjust(sp, addr)
+- FTS *sp;
+- void *addr;
+-{
+- FTSENT *p;
++ /* Return to original directory, save errno if necessary. */
++ if (!ISSET(FTS_NOCHDIR)) {
++ saved_errno = fchdir(sp->fts_rfd) ? errno : 0;
++ (void)close(sp->fts_rfd);
++ }
+
+-#define ADJUST(p) { \
+- (p)->fts_accpath = \
+- (char *)addr + ((p)->fts_accpath - (p)->fts_path); \
+- (p)->fts_path = addr; \
+-}
+- /* Adjust the current set of children. */
+- for (p = sp->fts_child; p; p = p->fts_link)
+- ADJUST(p);
++ /* Free up the stream pointer. */
++ free(sp);
+
+- /* Adjust the rest of the tree. */
+- for (p = sp->fts_cur; p->fts_level >= FTS_ROOTLEVEL;) {
+- ADJUST(p);
+- p = p->fts_link ? p->fts_link : p->fts_parent;
++ /* Set errno and return. */
++ if (!ISSET(FTS_NOCHDIR) && saved_errno) {
++ errno = saved_errno;
++ return (-1);
+ }
++ return (0);
+ }
+
+-static size_t
+-fts_maxarglen(argv)
+- char * const *argv;
+-{
+- size_t len, max;
+-
+- for (max = 0; *argv; ++argv)
+- if ((len = strlen(*argv)) > max)
+- max = len;
+- return (max);
+-}
diff --git a/import-layers/yocto-poky/meta/recipes-core/fts/fts/remove_cdefs.patch b/import-layers/yocto-poky/meta/recipes-core/fts/fts/remove_cdefs.patch
new file mode 100644
index 000000000..c152704d4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/fts/fts/remove_cdefs.patch
@@ -0,0 +1,69 @@
+Replace use of macros from sys/cdefs.h since cdefs.h is missing on musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Inappropriate
+
+Index: fts/fts.h
+===================================================================
+--- fts.orig/fts.h
++++ fts/fts.h
+@@ -126,15 +126,21 @@ typedef struct _ftsent {
+ char fts_name[1]; /* file name */
+ } FTSENT;
+
+-#include <sys/cdefs.h>
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+-__BEGIN_DECLS
+-FTSENT *fts_children __P((FTS *, int));
+-int fts_close __P((FTS *));
+-FTS *fts_open __P((char * const *, int,
+- int (*)(const FTSENT **, const FTSENT **)));
+-FTSENT *fts_read __P((FTS *));
+-int fts_set __P((FTS *, FTSENT *, int));
+-__END_DECLS
++#ifndef __P
++#define __P
++#endif
++FTSENT *fts_children (FTS *p, int opts);
++int fts_close (FTS *p);
++FTS *fts_open (char * const * path, int opts,
++ int (*compfn)(const FTSENT **, const FTSENT **));
++FTSENT *fts_read (FTS *p);
++int fts_set (FTS *p, FTSENT *f, int opts);
+
++#ifdef __cplusplus
++}
++#endif
+ #endif /* !_FTS_H_ */
+Index: fts/fts.c
+===================================================================
+--- fts.orig/fts.c
++++ fts/fts.c
+@@ -50,15 +50,15 @@ static char sccsid[] = "@(#)fts.c 8.6 (B
+ #include <string.h>
+ #include <unistd.h>
+
+-static FTSENT *fts_alloc __P((FTS *, char *, int));
+-static FTSENT *fts_build __P((FTS *, int));
+-static void fts_lfree __P((FTSENT *));
+-static void fts_load __P((FTS *, FTSENT *));
+-static size_t fts_maxarglen __P((char * const *));
+-static void fts_padjust __P((FTS *, void *));
+-static int fts_palloc __P((FTS *, size_t));
+-static FTSENT *fts_sort __P((FTS *, FTSENT *, int));
+-static u_short fts_stat __P((FTS *, struct dirent *, FTSENT *, int));
++static FTSENT *fts_alloc __P(FTS *, char *, int);
++static FTSENT *fts_build __P(FTS *, int);
++static void fts_lfree __P(FTSENT *);
++static void fts_load __P(FTS *, FTSENT *);
++static size_t fts_maxarglen __P(char * const *);
++static void fts_padjust __P(FTS *, void *);
++static int fts_palloc __P(FTS *, size_t);
++static FTSENT *fts_sort __P(FTS *, FTSENT *, int);
++static u_short fts_stat __P(FTS *, struct dirent *, FTSENT *, int);
+
+ #define ISDOT(a) (a[0] == '.' && (!a[1] || a[1] == '.' && !a[2]))
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/fts/fts/stdint.patch b/import-layers/yocto-poky/meta/recipes-core/fts/fts/stdint.patch
new file mode 100644
index 000000000..89e6097fc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/fts/fts/stdint.patch
@@ -0,0 +1,15 @@
+Include stdint.h for u_* typedefs
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Inappropriate
+
+--- ./fts.c.orig
++++ ./fts.c
+@@ -46,6 +46,7 @@
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <fts.h>
++#include <stdint.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
diff --git a/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/disable_java.patch b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/disable_java.patch
new file mode 100644
index 000000000..e4c5f1566
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/disable_java.patch
@@ -0,0 +1,39 @@
+
+# Pulled from OpenEmbedded
+#
+# Commented by: Saul Wold <saul.wold@intel.com>
+
+Upstream-Status: Inappropriate [licensing]
+
+Index: gettext-0.16.1/gettext-tools/configure.ac
+===================================================================
+--- gettext-0.16.1.orig/gettext-tools/configure.ac 2006-11-27 09:02:01.000000000 -0800
++++ gettext-0.16.1/gettext-tools/configure.ac 2011-03-16 16:55:36.111396557 -0700
+@@ -36,27 +36,15 @@
+ gt_JAVA_CHOICE
+
+ gt_GCJ
+-if test -n "$HAVE_GCJ" && test "$JAVA_CHOICE" = yes; then
+- BUILDJAVAEXE=yes
+-else
+ BUILDJAVAEXE=no
+-fi
+ AC_SUBST(BUILDJAVAEXE)
+
+ gt_JAVAEXEC
+ gt_JAVACOMP([1.3])
+ AC_CHECK_PROG(JAR, jar, jar)
+-if test -n "$HAVE_JAVACOMP" && test -n "$JAR" && test "$JAVA_CHOICE" != no; then
+- BUILDJAVA=yes
+-else
+ BUILDJAVA=no
+-fi
+ AC_SUBST(BUILDJAVA)
+-if test -n "$HAVE_JAVAEXEC" && test $BUILDJAVA = yes; then
+- TESTJAVA=yes
+-else
+ TESTJAVA=no
+-fi
+ AC_SUBST(TESTJAVA)
+
+ gt_CSHARPCOMP
diff --git a/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/fix_aclocal_version.patch b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/fix_aclocal_version.patch
new file mode 100644
index 000000000..7293f5b08
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/fix_aclocal_version.patch
@@ -0,0 +1,110 @@
+
+This patch updates the required version number from 2.61 to the
+current 2.65 version of aclocal, this will need to be updated
+when we update aclocal
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by Saul Wold <sgw@linux.intel.com>
+
+Index: gettext-0.16.1/autoconf-lib-link/m4/lib-link.m4
+===================================================================
+--- gettext-0.16.1.orig/autoconf-lib-link/m4/lib-link.m4 2011-03-17 02:24:36.391519775 -0700
++++ gettext-0.16.1/autoconf-lib-link/m4/lib-link.m4 2011-03-17 02:24:45.569526073 -0700
+@@ -148,7 +148,7 @@
+ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+ dnl Autoconf >= 2.61 supports dots in --with options.
+- define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])])
++ define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.65]),[-1],[translit([$1],[.],[_])],[$1])])
+ dnl By default, look in $includedir and $libdir.
+ use_additional=yes
+ AC_LIB_WITH_FINAL_PREFIX([
+Index: gettext-0.16.1/autoconf-lib-link/tests/rpathly/aclocal.m4
+===================================================================
+--- gettext-0.16.1.orig/autoconf-lib-link/tests/rpathly/aclocal.m4 2011-03-17 02:24:36.391519775 -0700
++++ gettext-0.16.1/autoconf-lib-link/tests/rpathly/aclocal.m4 2011-03-17 02:24:45.570526904 -0700
+@@ -11,8 +11,8 @@
+ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ # PARTICULAR PURPOSE.
+
+-m4_if(m4_PACKAGE_VERSION, [2.61],,
+-[m4_fatal([this file was generated for autoconf 2.61.
++m4_if(m4_PACKAGE_VERSION, [2.65],,
++[m4_fatal([this file was generated for autoconf 2.65.
+ You have another version of autoconf. If you want to use that,
+ you should regenerate the build system entirely.], [63])])
+
+Index: gettext-0.16.1/autoconf-lib-link/tests/rpathx/aclocal.m4
+===================================================================
+--- gettext-0.16.1.orig/autoconf-lib-link/tests/rpathx/aclocal.m4 2011-03-17 02:24:36.391519775 -0700
++++ gettext-0.16.1/autoconf-lib-link/tests/rpathx/aclocal.m4 2011-03-17 02:24:45.572525773 -0700
+@@ -11,8 +11,8 @@
+ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ # PARTICULAR PURPOSE.
+
+-m4_if(m4_PACKAGE_VERSION, [2.61],,
+-[m4_fatal([this file was generated for autoconf 2.61.
++m4_if(m4_PACKAGE_VERSION, [2.65],,
++[m4_fatal([this file was generated for autoconf 2.65.
+ You have another version of autoconf. If you want to use that,
+ you should regenerate the build system entirely.], [63])])
+
+Index: gettext-0.16.1/autoconf-lib-link/tests/rpathy/aclocal.m4
+===================================================================
+--- gettext-0.16.1.orig/autoconf-lib-link/tests/rpathy/aclocal.m4 2011-03-17 02:24:36.391519775 -0700
++++ gettext-0.16.1/autoconf-lib-link/tests/rpathy/aclocal.m4 2011-03-17 02:24:45.578394916 -0700
+@@ -11,7 +11,7 @@
+ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ # PARTICULAR PURPOSE.
+
+-m4_if(m4_PACKAGE_VERSION, [2.61],,
++m4_if(m4_PACKAGE_VERSION, [2.65],,
+ [m4_fatal([this file was generated for autoconf 2.61.
+ You have another version of autoconf. If you want to use that,
+ you should regenerate the build system entirely.], [63])])
+Index: gettext-0.16.1/autoconf-lib-link/tests/rpathz/aclocal.m4
+===================================================================
+--- gettext-0.16.1.orig/autoconf-lib-link/tests/rpathz/aclocal.m4 2011-03-17 02:24:36.391519775 -0700
++++ gettext-0.16.1/autoconf-lib-link/tests/rpathz/aclocal.m4 2011-03-17 02:24:45.586395416 -0700
+@@ -11,8 +11,8 @@
+ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ # PARTICULAR PURPOSE.
+
+-m4_if(m4_PACKAGE_VERSION, [2.61],,
+-[m4_fatal([this file was generated for autoconf 2.61.
++m4_if(m4_PACKAGE_VERSION, [2.65],,
++[m4_fatal([this file was generated for autoconf 2.65.
+ You have another version of autoconf. If you want to use that,
+ you should regenerate the build system entirely.], [63])])
+
+Index: gettext-0.16.1/gettext-tools/aclocal.m4
+===================================================================
+--- gettext-0.16.1.orig/gettext-tools/aclocal.m4 2006-11-27 09:34:32.000000000 -0800
++++ gettext-0.16.1/gettext-tools/aclocal.m4 2011-03-17 02:27:01.135682807 -0700
+@@ -11,8 +11,8 @@
+ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ # PARTICULAR PURPOSE.
+
+-m4_if(m4_PACKAGE_VERSION, [2.61],,
+-[m4_fatal([this file was generated for autoconf 2.61.
++m4_if(m4_PACKAGE_VERSION, [2.65],,
++[m4_fatal([this file was generated for autoconf 2.65.
+ You have another version of autoconf. If you want to use that,
+ you should regenerate the build system entirely.], [63])])
+
+Index: gettext-0.16.1/gettext-tools/examples/aclocal.m4
+===================================================================
+--- gettext-0.16.1.orig/gettext-tools/examples/aclocal.m4 2006-11-27 09:16:23.000000000 -0800
++++ gettext-0.16.1/gettext-tools/examples/aclocal.m4 2011-03-17 02:26:52.589396683 -0700
+@@ -11,8 +11,8 @@
+ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ # PARTICULAR PURPOSE.
+
+-m4_if(m4_PACKAGE_VERSION, [2.61],,
+-[m4_fatal([this file was generated for autoconf 2.61.
++m4_if(m4_PACKAGE_VERSION, [2.65],,
++[m4_fatal([this file was generated for autoconf 2.65.
+ You have another version of autoconf. If you want to use that,
+ you should regenerate the build system entirely.], [63])])
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/fix_gnu_source_circular.patch b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/fix_gnu_source_circular.patch
new file mode 100644
index 000000000..06861492c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/fix_gnu_source_circular.patch
@@ -0,0 +1,348 @@
+
+This patch removes the circular dependency on AC_GNU_SOURCE in
+AC_USE_SYSTEM_EXTENSIONS.
+
+Thanks to Mark Hatle for the timely pointers and fixes.
+
+Upstream-Status: Inappropriate [licensing]
+
+Signed-off-by Saul Wold <sgw@linux.intel.com>
+
+diff -ru gettext-0.16.1/gettext-runtime/gnulib-m4/extensions.m4 gettext.patched/gettext-runtime/gnulib-m4/extensions.m4
+--- gettext-0.16.1/gettext-runtime/gnulib-m4/extensions.m4 2006-11-27 09:14:38.000000000 -0800
++++ gettext.patched/gettext-runtime/gnulib-m4/extensions.m4 2011-03-16 23:54:01.711923448 -0700
+@@ -16,43 +16,47 @@
+ # ------------------------
+ # Enable extensions on systems that normally disable them,
+ # typically due to standards-conformance issues.
+-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
+-[
+- AC_BEFORE([$0], [AC_COMPILE_IFELSE])
+- AC_BEFORE([$0], [AC_RUN_IFELSE])
+-
+- AC_REQUIRE([AC_GNU_SOURCE])
+- AC_REQUIRE([AC_AIX])
+- AC_REQUIRE([AC_MINIX])
+-
+- AH_VERBATIM([__EXTENSIONS__],
+-[/* Enable extensions on Solaris. */
+-#ifndef __EXTENSIONS__
+-# undef __EXTENSIONS__
+-#endif
+-#ifndef _POSIX_PTHREAD_SEMANTICS
+-# undef _POSIX_PTHREAD_SEMANTICS
+-#endif
+-#ifndef _TANDEM_SOURCE
+-# undef _TANDEM_SOURCE
+-#endif])
+- AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
+- [ac_cv_safe_to_define___extensions__],
+- [AC_COMPILE_IFELSE(
+- [AC_LANG_PROGRAM([
+-# define __EXTENSIONS__ 1
+- AC_INCLUDES_DEFAULT])],
+- [ac_cv_safe_to_define___extensions__=yes],
+- [ac_cv_safe_to_define___extensions__=no])])
+- test $ac_cv_safe_to_define___extensions__ = yes &&
+- AC_DEFINE([__EXTENSIONS__])
+- AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+- AC_DEFINE([_TANDEM_SOURCE])
+-])
++#AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
++#[
++# AC_BEFORE([$0], [AC_COMPILE_IFELSE])
++# AC_BEFORE([$0], [AC_RUN_IFELSE])
++#
++# AC_REQUIRE([AC_GNU_SOURCE])
++# AC_REQUIRE([AC_AIX])
++# AC_REQUIRE([AC_MINIX])
++#
++# AH_VERBATIM([__EXTENSIONS__],
++#[/* Enable extensions on Solaris. */
++##ifndef __EXTENSIONS__
++## undef __EXTENSIONS__
++##endif
++##ifndef _POSIX_PTHREAD_SEMANTICS
++## undef _POSIX_PTHREAD_SEMANTICS
++##endif
++##ifndef _TANDEM_SOURCE
++## undef _TANDEM_SOURCE
++##endif])
++# AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
++# [ac_cv_safe_to_define___extensions__],
++# [AC_COMPILE_IFELSE(
++# [AC_LANG_PROGRAM([
++## define __EXTENSIONS__ 1
++# AC_INCLUDES_DEFAULT])],
++# [ac_cv_safe_to_define___extensions__=yes],
++# [ac_cv_safe_to_define___extensions__=no])])
++# test $ac_cv_safe_to_define___extensions__ = yes &&
++# AC_DEFINE([__EXTENSIONS__])
++# AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
++# AC_DEFINE([_TANDEM_SOURCE])
++#])
+
+ # gl_USE_SYSTEM_EXTENSIONS
+ # ------------------------
+ # Enable extensions on systems that normally disable them,
+ # typically due to standards-conformance issues.
+ AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS],
+- [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])])
++[
++ AC_REQUIRE([AC_GNU_SOURCE])
++
++ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
++])
+diff -ru gettext-0.16.1/gettext-runtime/gnulib-m4/gnulib-comp.m4 gettext.patched/gettext-runtime/gnulib-m4/gnulib-comp.m4
+--- gettext-0.16.1/gettext-runtime/gnulib-m4/gnulib-comp.m4 2006-11-27 09:33:19.000000000 -0800
++++ gettext.patched/gettext-runtime/gnulib-m4/gnulib-comp.m4 2011-03-16 23:50:17.471531838 -0700
+@@ -25,7 +25,7 @@
+ m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
+ m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
+ AC_REQUIRE([AC_PROG_RANLIB])
+- AC_REQUIRE([AC_GNU_SOURCE])
++ dnl AC_REQUIRE([AC_GNU_SOURCE])
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ ])
+
+diff -ru gettext-0.16.1/gettext-runtime/gnulib-m4/mbchar.m4 gettext.patched/gettext-runtime/gnulib-m4/mbchar.m4
+--- gettext-0.16.1/gettext-runtime/gnulib-m4/mbchar.m4 2006-11-27 09:14:38.000000000 -0800
++++ gettext.patched/gettext-runtime/gnulib-m4/mbchar.m4 2011-03-16 23:50:10.814396529 -0700
+@@ -9,7 +9,7 @@
+
+ AC_DEFUN([gl_MBCHAR],
+ [
+- AC_REQUIRE([AC_GNU_SOURCE])
++ dnl AC_REQUIRE([AC_GNU_SOURCE])
+ dnl The following line is that so the user can test HAVE_WCHAR_H
+ dnl before #include "mbchar.h".
+ AC_CHECK_HEADERS_ONCE([wchar.h])
+diff -ru gettext-0.16.1/gettext-runtime/gnulib-m4/wcwidth.m4 gettext.patched/gettext-runtime/gnulib-m4/wcwidth.m4
+--- gettext-0.16.1/gettext-runtime/gnulib-m4/wcwidth.m4 2006-11-27 09:14:38.000000000 -0800
++++ gettext.patched/gettext-runtime/gnulib-m4/wcwidth.m4 2011-03-16 23:50:08.357396247 -0700
+@@ -7,7 +7,7 @@
+ AC_DEFUN([gl_FUNC_WCWIDTH],
+ [
+ dnl Persuade glibc <wchar.h> to declare wcwidth().
+- AC_REQUIRE([AC_GNU_SOURCE])
++ dnl AC_REQUIRE([AC_GNU_SOURCE])
+
+ AC_REQUIRE([AC_C_INLINE])
+ AC_REQUIRE([gt_TYPE_WCHAR_T])
+diff -ru gettext-0.16.1/gettext-runtime/m4/lock.m4 gettext.patched/gettext-runtime/m4/lock.m4
+--- gettext-0.16.1/gettext-runtime/m4/lock.m4 2006-10-24 13:59:59.000000000 -0700
++++ gettext.patched/gettext-runtime/m4/lock.m4 2011-03-16 23:50:04.355891676 -0700
+@@ -35,7 +35,7 @@
+ AC_BEFORE([$0], [gl_ARGP])dnl
+
+ AC_REQUIRE([AC_CANONICAL_HOST])
+- AC_REQUIRE([AC_GNU_SOURCE]) dnl needed for pthread_rwlock_t on glibc systems
++ dnl AC_REQUIRE([AC_GNU_SOURCE]) dnl needed for pthread_rwlock_t on glibc systems
+ dnl Check for multithreading.
+ AC_ARG_ENABLE(threads,
+ AC_HELP_STRING([--enable-threads={posix|solaris|pth|win32}], [specify multithreading API])
+diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/extensions.m4 gettext.patched/gettext-tools/gnulib-m4/extensions.m4
+--- gettext-0.16.1/gettext-tools/gnulib-m4/extensions.m4 2006-11-27 09:14:54.000000000 -0800
++++ gettext.patched/gettext-tools/gnulib-m4/extensions.m4 2011-03-16 23:53:28.487671266 -0700
+@@ -16,43 +16,47 @@
+ # ------------------------
+ # Enable extensions on systems that normally disable them,
+ # typically due to standards-conformance issues.
+-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
+-[
+- AC_BEFORE([$0], [AC_COMPILE_IFELSE])
+- AC_BEFORE([$0], [AC_RUN_IFELSE])
+-
+- AC_REQUIRE([AC_GNU_SOURCE])
+- AC_REQUIRE([AC_AIX])
+- AC_REQUIRE([AC_MINIX])
+-
+- AH_VERBATIM([__EXTENSIONS__],
+-[/* Enable extensions on Solaris. */
+-#ifndef __EXTENSIONS__
+-# undef __EXTENSIONS__
+-#endif
+-#ifndef _POSIX_PTHREAD_SEMANTICS
+-# undef _POSIX_PTHREAD_SEMANTICS
+-#endif
+-#ifndef _TANDEM_SOURCE
+-# undef _TANDEM_SOURCE
+-#endif])
+- AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
+- [ac_cv_safe_to_define___extensions__],
+- [AC_COMPILE_IFELSE(
+- [AC_LANG_PROGRAM([
+-# define __EXTENSIONS__ 1
+- AC_INCLUDES_DEFAULT])],
+- [ac_cv_safe_to_define___extensions__=yes],
+- [ac_cv_safe_to_define___extensions__=no])])
+- test $ac_cv_safe_to_define___extensions__ = yes &&
+- AC_DEFINE([__EXTENSIONS__])
+- AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+- AC_DEFINE([_TANDEM_SOURCE])
+-])
++#AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
++#[
++# AC_BEFORE([$0], [AC_COMPILE_IFELSE])
++# AC_BEFORE([$0], [AC_RUN_IFELSE])
++#
++# AC_REQUIRE([AC_GNU_SOURCE])
++# AC_REQUIRE([AC_AIX])
++# AC_REQUIRE([AC_MINIX])
++#
++# AH_VERBATIM([__EXTENSIONS__],
++#[/* Enable extensions on Solaris. */
++##ifndef __EXTENSIONS__
++## undef __EXTENSIONS__
++##endif
++##ifndef _POSIX_PTHREAD_SEMANTICS
++## undef _POSIX_PTHREAD_SEMANTICS
++##endif
++##ifndef _TANDEM_SOURCE
++## undef _TANDEM_SOURCE
++##endif])
++# AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
++# [ac_cv_safe_to_define___extensions__],
++# [AC_COMPILE_IFELSE(
++# [AC_LANG_PROGRAM([
++## define __EXTENSIONS__ 1
++# AC_INCLUDES_DEFAULT])],
++# [ac_cv_safe_to_define___extensions__=yes],
++# [ac_cv_safe_to_define___extensions__=no])])
++# test $ac_cv_safe_to_define___extensions__ = yes &&
++# AC_DEFINE([__EXTENSIONS__])
++# AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
++# AC_DEFINE([_TANDEM_SOURCE])
++#])
+
+ # gl_USE_SYSTEM_EXTENSIONS
+ # ------------------------
+ # Enable extensions on systems that normally disable them,
+ # typically due to standards-conformance issues.
+ AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS],
+- [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])])
++[
++ AC_REQUIRE([AC_GNU_SOURCE])
++
++ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
++])
+diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/fnmatch.m4 gettext.patched/gettext-tools/gnulib-m4/fnmatch.m4
+--- gettext-0.16.1/gettext-tools/gnulib-m4/fnmatch.m4 2006-11-27 09:14:54.000000000 -0800
++++ gettext.patched/gettext-tools/gnulib-m4/fnmatch.m4 2011-03-16 23:52:06.477463671 -0700
+@@ -91,7 +91,7 @@
+ AC_DEFUN([gl_FUNC_FNMATCH_GNU],
+ [
+ dnl Persuade glibc <fnmatch.h> to declare FNM_CASEFOLD etc.
+- AC_REQUIRE([AC_GNU_SOURCE])
++ dnl AC_REQUIRE([AC_GNU_SOURCE])
+
+ FNMATCH_H=
+ _AC_FUNC_FNMATCH_IF([GNU], [ac_cv_func_fnmatch_gnu],
+diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/getdelim.m4 gettext.patched/gettext-tools/gnulib-m4/getdelim.m4
+--- gettext-0.16.1/gettext-tools/gnulib-m4/getdelim.m4 2006-11-27 09:14:54.000000000 -0800
++++ gettext.patched/gettext-tools/gnulib-m4/getdelim.m4 2011-03-16 23:52:22.871674845 -0700
+@@ -12,7 +12,7 @@
+ [
+
+ dnl Persuade glibc <stdio.h> to declare getdelim().
+- AC_REQUIRE([AC_GNU_SOURCE])
++ dnl AC_REQUIRE([AC_GNU_SOURCE])
+
+ AC_REPLACE_FUNCS(getdelim)
+ AC_CHECK_DECLS_ONCE(getdelim)
+diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/getline.m4 gettext.patched/gettext-tools/gnulib-m4/getline.m4
+--- gettext-0.16.1/gettext-tools/gnulib-m4/getline.m4 2006-11-27 09:14:54.000000000 -0800
++++ gettext.patched/gettext-tools/gnulib-m4/getline.m4 2011-03-16 23:51:49.829971108 -0700
+@@ -16,7 +16,7 @@
+ AC_DEFUN([gl_FUNC_GETLINE],
+ [
+ dnl Persuade glibc <stdio.h> to declare getline().
+- AC_REQUIRE([AC_GNU_SOURCE])
++ dnl AC_REQUIRE([AC_GNU_SOURCE])
+
+ AC_CHECK_DECLS([getline])
+
+diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/gnulib-comp.m4 gettext.patched/gettext-tools/gnulib-m4/gnulib-comp.m4
+--- gettext-0.16.1/gettext-tools/gnulib-m4/gnulib-comp.m4 2006-11-27 09:33:36.000000000 -0800
++++ gettext.patched/gettext-tools/gnulib-m4/gnulib-comp.m4 2011-03-16 23:52:18.970450488 -0700
+@@ -25,7 +25,7 @@
+ m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
+ m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
+ AC_REQUIRE([AC_PROG_RANLIB])
+- AC_REQUIRE([AC_GNU_SOURCE])
++ dnl AC_REQUIRE([AC_GNU_SOURCE])
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_REQUIRE([gl_LOCK_EARLY])
+ ])
+diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/mbchar.m4 gettext.patched/gettext-tools/gnulib-m4/mbchar.m4
+--- gettext-0.16.1/gettext-tools/gnulib-m4/mbchar.m4 2006-11-27 09:14:55.000000000 -0800
++++ gettext.patched/gettext-tools/gnulib-m4/mbchar.m4 2011-03-16 23:51:40.844410216 -0700
+@@ -9,7 +9,7 @@
+
+ AC_DEFUN([gl_MBCHAR],
+ [
+- AC_REQUIRE([AC_GNU_SOURCE])
++ dnl AC_REQUIRE([AC_GNU_SOURCE])
+ dnl The following line is that so the user can test HAVE_WCHAR_H
+ dnl before #include "mbchar.h".
+ AC_CHECK_HEADERS_ONCE([wchar.h])
+diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/stpcpy.m4 gettext.patched/gettext-tools/gnulib-m4/stpcpy.m4
+--- gettext-0.16.1/gettext-tools/gnulib-m4/stpcpy.m4 2006-11-27 09:14:55.000000000 -0800
++++ gettext.patched/gettext-tools/gnulib-m4/stpcpy.m4 2011-03-16 23:52:14.691396045 -0700
+@@ -7,7 +7,7 @@
+ AC_DEFUN([gl_FUNC_STPCPY],
+ [
+ dnl Persuade glibc <string.h> to declare stpcpy().
+- AC_REQUIRE([AC_GNU_SOURCE])
++ dnl AC_REQUIRE([AC_GNU_SOURCE])
+
+ AC_REPLACE_FUNCS(stpcpy)
+ if test $ac_cv_func_stpcpy = no; then
+diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/stpncpy.m4 gettext.patched/gettext-tools/gnulib-m4/stpncpy.m4
+--- gettext-0.16.1/gettext-tools/gnulib-m4/stpncpy.m4 2006-11-27 09:14:55.000000000 -0800
++++ gettext.patched/gettext-tools/gnulib-m4/stpncpy.m4 2011-03-16 23:52:10.356641459 -0700
+@@ -7,7 +7,7 @@
+ AC_DEFUN([gl_FUNC_STPNCPY],
+ [
+ dnl Persuade glibc <string.h> to declare stpncpy().
+- AC_REQUIRE([AC_GNU_SOURCE])
++ dnl AC_REQUIRE([AC_GNU_SOURCE])
+
+ dnl Both glibc and AIX (4.3.3, 5.1) have an stpncpy() function
+ dnl declared in <string.h>. Its side effects are the same as those
+diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/wcwidth.m4 gettext.patched/gettext-tools/gnulib-m4/wcwidth.m4
+--- gettext-0.16.1/gettext-tools/gnulib-m4/wcwidth.m4 2006-11-27 09:14:55.000000000 -0800
++++ gettext.patched/gettext-tools/gnulib-m4/wcwidth.m4 2011-03-16 23:51:08.260324221 -0700
+@@ -7,7 +7,7 @@
+ AC_DEFUN([gl_FUNC_WCWIDTH],
+ [
+ dnl Persuade glibc <wchar.h> to declare wcwidth().
+- AC_REQUIRE([AC_GNU_SOURCE])
++ dnl AC_REQUIRE([AC_GNU_SOURCE])
+
+ AC_REQUIRE([AC_C_INLINE])
+ AC_REQUIRE([gt_TYPE_WCHAR_T])
+diff -ru gettext-0.16.1/gettext-tools/libgettextpo/gnulib-m4/gnulib-comp.m4 gettext.patched/gettext-tools/libgettextpo/gnulib-m4/gnulib-comp.m4
+--- gettext-0.16.1/gettext-tools/libgettextpo/gnulib-m4/gnulib-comp.m4 2006-11-27 09:33:45.000000000 -0800
++++ gettext.patched/gettext-tools/libgettextpo/gnulib-m4/gnulib-comp.m4 2011-03-16 23:51:02.036061317 -0700
+@@ -25,7 +25,7 @@
+ m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
+ m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
+ AC_REQUIRE([AC_PROG_RANLIB])
+- AC_REQUIRE([AC_GNU_SOURCE])
++ dnl AC_REQUIRE([AC_GNU_SOURCE])
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_REQUIRE([gl_LOCK_EARLY])
+ ])
+diff -ru gettext-0.16.1/gettext-tools/m4/regex.m4 gettext.patched/gettext-tools/m4/regex.m4
+--- gettext-0.16.1/gettext-tools/m4/regex.m4 2006-11-27 09:02:05.000000000 -0800
++++ gettext.patched/gettext-tools/m4/regex.m4 2011-03-16 23:50:53.533477195 -0700
+@@ -116,7 +116,7 @@
+ dnl to get them.
+
+ dnl Persuade glibc <string.h> to declare mempcpy().
+- AC_REQUIRE([AC_GNU_SOURCE])
++ dnl AC_REQUIRE([AC_GNU_SOURCE])
+
+ AC_REQUIRE([AC_C_RESTRICT])
+ AC_REQUIRE([AC_FUNC_ALLOCA])
diff --git a/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/gettext-autoconf-lib-link-no-L.patch b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/gettext-autoconf-lib-link-no-L.patch
new file mode 100644
index 000000000..072fe5ff6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/gettext-autoconf-lib-link-no-L.patch
@@ -0,0 +1,19 @@
+
+# Pulled from OpenEmbedded
+#
+# Commented by: Saul Wold <saul.wold@intel.com>
+
+Upstream-Status: Inappropriate [licensing]
+
+--- gettext-0.17/autoconf-lib-link/m4/lib-link.m4~ 2009-04-17 15:12:30.000000000 -0700
++++ gettext-0.17/autoconf-lib-link/m4/lib-link.m4 2009-04-17 15:37:39.000000000 -0700
+@@ -267,6 +267,9 @@
+ fi
+ fi
+ fi
++ dnl Just let the compiler find the library, the compiler and user are smarter then this script
++ dnl when cross compiling and working with a relocated install.
++ found_dir=""
+ if test "X$found_dir" = "X"; then
+ for x in $LDFLAGS $LTLIB[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
diff --git a/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/gettext-vpath.patch b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/gettext-vpath.patch
new file mode 100644
index 000000000..f09e450ef
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/gettext-vpath.patch
@@ -0,0 +1,20 @@
+
+# Pulled from OpenEmbedded
+#
+# Commented by: Saul Wold <saul.wold@intel.com>
+
+Upstream-Status: Inappropriate [licensing]
+
+Index: gettext-0.16.1/gettext-runtime/intl/Makefile.in
+===================================================================
+--- gettext-0.16.1.orig/gettext-runtime/intl/Makefile.in 2006-11-27 09:02:00.000000000 -0800
++++ gettext-0.16.1/gettext-runtime/intl/Makefile.in 2011-03-16 16:04:49.175419930 -0700
+@@ -35,7 +35,7 @@
+ # 'make' does the wrong thing if GNU gettext was configured with
+ # "./configure --srcdir=`pwd`", namely it gets confused by the .lo and .la
+ # files it finds in srcdir = ../../gettext-runtime/intl.
+-VPATH = $(srcdir)
++#VPATH = $(srcdir)
+
+ prefix = @prefix@
+ exec_prefix = @exec_prefix@
diff --git a/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/hardcode_macro_version.patch b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/hardcode_macro_version.patch
new file mode 100644
index 000000000..4da8dd453
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/hardcode_macro_version.patch
@@ -0,0 +1,51 @@
+
+This patch hardcodes in version 0.17 for the GETTEXT_MACRO_VERSION,
+the version check is only part of 0.17 and will not affect any 0.16.1
+operations
+
+Upstream-Status: Inappropriate [licensing]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: gettext-0.16.1/gettext-runtime/m4/po.m4
+===================================================================
+--- gettext-0.16.1.orig/gettext-runtime/m4/po.m4 2011-03-17 02:24:28.953520231 -0700
++++ gettext-0.16.1/gettext-runtime/m4/po.m4 2011-03-17 02:28:25.455396862 -0700
+@@ -27,6 +27,9 @@
+ AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
+ AC_REQUIRE([AM_NLS])dnl
+
++ dnl Hardcode the MACRO_VERSION to 0.17 for gnutls
++ AC_SUBST([GETTEXT_MACRO_VERSION], [0.17])
++
+ dnl Perform the following tests also if --disable-nls has been given,
+ dnl because they are needed for "make dist" to work.
+
+Index: gettext-0.16.1/gettext-runtime/po/Makefile.in.in
+===================================================================
+--- gettext-0.16.1.orig/gettext-runtime/po/Makefile.in.in 2011-03-17 02:24:28.953520231 -0700
++++ gettext-0.16.1/gettext-runtime/po/Makefile.in.in 2011-03-17 02:28:07.574395144 -0700
+@@ -10,6 +10,9 @@
+ #
+ # Origin: gettext-0.16
+
++# Hardcode this value for gnutls building against gplv2 code
++GETTEXT_MACRO_VERSION = 0.17
++
+ PACKAGE = @PACKAGE@
+ VERSION = @VERSION@
+ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+Index: gettext-0.16.1/gettext-tools/po/Makefile.in.in
+===================================================================
+--- gettext-0.16.1.orig/gettext-tools/po/Makefile.in.in 2011-03-17 02:24:28.953520231 -0700
++++ gettext-0.16.1/gettext-tools/po/Makefile.in.in 2011-03-17 02:28:07.574395144 -0700
+@@ -10,6 +10,9 @@
+ #
+ # Origin: gettext-0.16
+
++# Hardcode this value for gnutls building against gplv2 code
++GETTEXT_MACRO_VERSION = 0.17
++
+ PACKAGE = @PACKAGE@
+ VERSION = @VERSION@
+ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
diff --git a/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/linklib_from_0.17.patch b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/linklib_from_0.17.patch
new file mode 100644
index 000000000..d92106971
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.16.1/linklib_from_0.17.patch
@@ -0,0 +1,720 @@
+
+# Pulled from OpenEmbedded
+#
+# Commented by: Saul Wold <saul.wold@intel.com>
+
+Upstream-Status: Inappropriate [licensing]
+
+Index: gettext-0.16.1/autoconf-lib-link/m4/lib-link.m4
+===================================================================
+--- gettext-0.16.1.orig/autoconf-lib-link/m4/lib-link.m4 2006-11-27 09:01:58.000000000 -0800
++++ gettext-0.16.1/autoconf-lib-link/m4/lib-link.m4 2011-03-17 00:36:08.710836720 -0700
+@@ -6,12 +6,14 @@
+
+ dnl From Bruno Haible.
+
+-AC_PREREQ(2.50)
++AC_PREREQ(2.54)
+
+ 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.
++dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
++dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
+ AC_DEFUN([AC_LIB_LINKFLAGS],
+ [
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+@@ -24,13 +26,16 @@
+ ac_cv_lib[]Name[]_libs="$LIB[]NAME"
+ ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
+ ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
++ ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
+ ])
+ LIB[]NAME="$ac_cv_lib[]Name[]_libs"
+ LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
+ INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
++ LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
+ AC_SUBST([LIB]NAME)
+ AC_SUBST([LTLIB]NAME)
++ AC_SUBST([LIB]NAME[_PREFIX])
+ 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
+@@ -46,6 +51,8 @@
+ 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.
++dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
++dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
+ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
+ [
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+@@ -82,17 +89,24 @@
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ LIB[]NAME=
+ LTLIB[]NAME=
++ LIB[]NAME[]_PREFIX=
++
+ fi
+ AC_SUBST([HAVE_LIB]NAME)
+ AC_SUBST([LIB]NAME)
+ AC_SUBST([LTLIB]NAME)
++ AC_SUBST([LIB]NAME[_PREFIX])
+ 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.
++dnl acl_libext,
++dnl acl_shlibext,
++dnl acl_hardcode_libdir_flag_spec,
++dnl acl_hardcode_libdir_separator,
++dnl acl_hardcode_direct,
++dnl acl_hardcode_minus_L.
+ AC_DEFUN([AC_LIB_RPATH],
+ [
+ dnl Tell automake >= 1.10 to complain if config.rpath is missing.
+@@ -109,12 +123,14 @@
+ 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"
++ acl_libext="$acl_cv_libext"
++ acl_shlibext="$acl_cv_shlibext"
++ acl_libname_spec="$acl_cv_libname_spec"
++ acl_library_names_spec="$acl_cv_library_names_spec"
++ acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
++ acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
++ acl_hardcode_direct="$acl_cv_hardcode_direct"
++ acl_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],
+@@ -124,20 +140,24 @@
+ 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.
++dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
++dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
+ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
+ [
+ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
++ dnl Autoconf >= 2.61 supports dots in --with options.
++ define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])])
+ 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],
++ AC_LIB_ARG_WITH([lib]N_A_M_E[-prefix],
++[ --with-lib]N_A_M_E[-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
++ --without-lib]N_A_M_E[-prefix don't search for lib$1 in includedir and libdir],
+ [
+ if test "X$withval" = "Xno"; then
+ use_additional=no
+@@ -158,6 +178,7 @@
+ LIB[]NAME=
+ LTLIB[]NAME=
+ INC[]NAME=
++ LIB[]NAME[]_PREFIX=
+ rpathdirs=
+ ltrpathdirs=
+ names_already_handled=
+@@ -197,27 +218,53 @@
+ found_la=
+ found_so=
+ found_a=
++ eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
++ if test -n "$acl_shlibext"; then
++ shrext=".$acl_shlibext" # typically: shrext=.so
++ else
++ shrext=
++ fi
+ if test $use_additional = yes; then
+- if test -n "$shlibext" \
+- && { test -f "$additional_libdir/lib$name.$shlibext" \
+- || { test "$shlibext" = dll \
+- && test -f "$additional_libdir/lib$name.dll.a"; }; }; then
+- found_dir="$additional_libdir"
+- if test -f "$additional_libdir/lib$name.$shlibext"; then
+- found_so="$additional_libdir/lib$name.$shlibext"
++ dir="$additional_libdir"
++ dnl The same code as in the loop below:
++ dnl First look for a shared library.
++ if test -n "$acl_shlibext"; then
++ if test -f "$dir/$libname$shrext"; then
++ found_dir="$dir"
++ found_so="$dir/$libname$shrext"
+ else
+- found_so="$additional_libdir/lib$name.dll.a"
++ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
++ ver=`(cd "$dir" && \
++ for f in "$libname$shrext".*; do echo "$f"; done \
++ | sed -e "s,^$libname$shrext\\\\.,," \
++ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
++ | sed 1q ) 2>/dev/null`
++ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
++ found_dir="$dir"
++ found_so="$dir/$libname$shrext.$ver"
++ fi
++ else
++ eval library_names=\"$acl_library_names_spec\"
++ for f in $library_names; do
++ if test -f "$dir/$f"; then
++ found_dir="$dir"
++ found_so="$dir/$f"
++ break
++ fi
++ done
++ fi
+ fi
+- if test -f "$additional_libdir/lib$name.la"; then
+- found_la="$additional_libdir/lib$name.la"
++ fi
++ dnl Then look for a static library.
++ if test "X$found_dir" = "X"; then
++ if test -f "$dir/$libname.$acl_libext"; then
++ found_dir="$dir"
++ found_a="$dir/$libname.$acl_libext"
+ 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
++ if test "X$found_dir" != "X"; then
++ if test -f "$dir/$libname.la"; then
++ found_la="$dir/$libname.la"
+ fi
+ fi
+ fi
+@@ -227,26 +274,44 @@
+ case "$x" in
+ -L*)
+ dir=`echo "X$x" | sed -e 's/^X-L//'`
+- if test -n "$shlibext" \
+- && { test -f "$dir/lib$name.$shlibext" \
+- || { test "$shlibext" = dll \
+- && test -f "$dir/lib$name.dll.a"; }; }; then
+- found_dir="$dir"
+- if test -f "$dir/lib$name.$shlibext"; then
+- found_so="$dir/lib$name.$shlibext"
++ dnl First look for a shared library.
++ if test -n "$acl_shlibext"; then
++ if test -f "$dir/$libname$shrext"; then
++ found_dir="$dir"
++ found_so="$dir/$libname$shrext"
+ else
+- found_so="$dir/lib$name.dll.a"
+- fi
+- if test -f "$dir/lib$name.la"; then
+- found_la="$dir/lib$name.la"
++ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
++ ver=`(cd "$dir" && \
++ for f in "$libname$shrext".*; do echo "$f"; done \
++ | sed -e "s,^$libname$shrext\\\\.,," \
++ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
++ | sed 1q ) 2>/dev/null`
++ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
++ found_dir="$dir"
++ found_so="$dir/$libname$shrext.$ver"
++ fi
++ else
++ eval library_names=\"$acl_library_names_spec\"
++ for f in $library_names; do
++ if test -f "$dir/$f"; then
++ found_dir="$dir"
++ found_so="$dir/$f"
++ break
++ fi
++ done
++ fi
+ fi
+- else
+- if test -f "$dir/lib$name.$libext"; then
++ fi
++ dnl Then look for a static library.
++ if test "X$found_dir" = "X"; then
++ if test -f "$dir/$libname.$acl_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
++ found_a="$dir/$libname.$acl_libext"
++ fi
++ fi
++ if test "X$found_dir" != "X"; then
++ if test -f "$dir/$libname.la"; then
++ found_la="$dir/$libname.la"
+ fi
+ fi
+ ;;
+@@ -282,12 +347,12 @@
+ ltrpathdirs="$ltrpathdirs $found_dir"
+ fi
+ dnl The hardcoding into $LIBNAME is system dependent.
+- if test "$hardcode_direct" = yes; then
++ if test "$acl_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
++ if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_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"
+@@ -318,13 +383,13 @@
+ if test -z "$haveit"; then
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
+ fi
+- if test "$hardcode_minus_L" != no; then
++ if test "$acl_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 We cannot use $acl_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.
+@@ -512,18 +577,18 @@
+ done
+ done
+ if test "X$rpathdirs" != "X"; then
+- if test -n "$hardcode_libdir_separator"; then
++ if test -n "$acl_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"
++ alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
+ done
+- dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
++ dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
+ acl_save_libdir="$libdir"
+ libdir="$alldirs"
+- eval flag=\"$hardcode_libdir_flag_spec\"
++ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+ else
+@@ -531,7 +596,7 @@
+ for found_dir in $rpathdirs; do
+ acl_save_libdir="$libdir"
+ libdir="$found_dir"
+- eval flag=\"$hardcode_libdir_flag_spec\"
++ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+ done
+@@ -642,3 +707,79 @@
+ fi
+ AC_SUBST([$1])
+ ])
++
++dnl For those cases where a variable contains several -L and -l options
++dnl referring to unknown libraries and directories, this macro determines the
++dnl necessary additional linker options for the runtime path.
++dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
++dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
++dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
++dnl otherwise linking without libtool is assumed.
++AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
++[
++ AC_REQUIRE([AC_LIB_RPATH])
++ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
++ $1=
++ if test "$enable_rpath" != no; then
++ if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
++ dnl Use an explicit option to hardcode directories into the resulting
++ dnl binary.
++ rpathdirs=
++ next=
++ for opt in $2; do
++ if test -n "$next"; then
++ dir="$next"
++ dnl No need to hardcode the standard /usr/lib.
++ if test "X$dir" != "X/usr/$acl_libdirstem"; then
++ rpathdirs="$rpathdirs $dir"
++ fi
++ next=
++ else
++ case $opt in
++ -L) next=yes ;;
++ -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
++ dnl No need to hardcode the standard /usr/lib.
++ if test "X$dir" != "X/usr/$acl_libdirstem"; then
++ rpathdirs="$rpathdirs $dir"
++ fi
++ next= ;;
++ *) next= ;;
++ esac
++ fi
++ done
++ if test "X$rpathdirs" != "X"; then
++ if test -n ""$3""; then
++ dnl libtool is used for linking. Use -R options.
++ for dir in $rpathdirs; do
++ $1="${$1}${$1:+ }-R$dir"
++ done
++ else
++ dnl The linker is used for linking directly.
++ if test -n "$acl_hardcode_libdir_separator"; then
++ dnl Weird platform: only the last -rpath option counts, the user
++ dnl must pass all path elements in one option.
++ alldirs=
++ for dir in $rpathdirs; do
++ alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
++ done
++ acl_save_libdir="$libdir"
++ libdir="$alldirs"
++ eval flag=\"$acl_hardcode_libdir_flag_spec\"
++ libdir="$acl_save_libdir"
++ $1="$flag"
++ else
++ dnl The -rpath options are cumulative.
++ for dir in $rpathdirs; do
++ acl_save_libdir="$libdir"
++ libdir="$dir"
++ eval flag=\"$acl_hardcode_libdir_flag_spec\"
++ libdir="$acl_save_libdir"
++ $1="${$1}${$1:+ }$flag"
++ done
++ fi
++ fi
++ fi
++ fi
++ fi
++ AC_SUBST([$1])
++])
+Index: gettext-0.16.1/autoconf-lib-link/config.rpath
+===================================================================
+--- gettext-0.16.1.orig/autoconf-lib-link/config.rpath 2006-11-27 09:01:58.000000000 -0800
++++ gettext-0.16.1/autoconf-lib-link/config.rpath 2011-03-17 00:33:23.336539490 -0700
+@@ -2,7 +2,7 @@
+ # Output a system dependent set of variables, describing how to set the
+ # run time search path of shared libraries in an executable.
+ #
+-# Copyright 1996-2006 Free Software Foundation, Inc.
++# Copyright 1996-2007 Free Software Foundation, Inc.
+ # Taken from GNU libtool, 2001
+ # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+ #
+@@ -47,6 +47,18 @@
+ done
+ cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
+
++# 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 AC_LIBTOOL_PROG_COMPILER_PIC.
+
+ wl=
+@@ -64,7 +76,14 @@
+ ;;
+ esac
+ ;;
+- mingw* | pw32* | os2*)
++ darwin*)
++ case $cc_basename in
++ xlc*)
++ wl='-Wl,'
++ ;;
++ esac
++ ;;
++ mingw* | cygwin* | pw32* | os2*)
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ wl='-Wl,'
+@@ -74,7 +93,7 @@
+ ;;
+ newsos6)
+ ;;
+- linux*)
++ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ icc* | ecc*)
+ wl='-Wl,'
+@@ -100,7 +119,7 @@
+ osf3* | osf4* | osf5*)
+ wl='-Wl,'
+ ;;
+- sco3.2v5*)
++ rdos*)
+ ;;
+ solaris*)
+ wl='-Wl,'
+@@ -108,11 +127,14 @@
+ sunos4*)
+ wl='-Qoption ld '
+ ;;
+- sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
++ sysv4 | sysv4.2uw2* | sysv4.3*)
+ wl='-Wl,'
+ ;;
+ sysv4*MP*)
+ ;;
++ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
++ wl='-Wl,'
++ ;;
+ unicos*)
+ wl='-Wl,'
+ ;;
+@@ -141,6 +163,10 @@
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
++ interix*)
++ # we just hope/assume this is gcc and not c89 (= MSVC++)
++ with_gnu_ld=yes
++ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+@@ -189,11 +215,11 @@
+ ld_shlibs=no
+ fi
+ ;;
+- interix3*)
++ interix[3-9]*)
+ hardcode_direct=no
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+- linux*)
++ gnu* | linux* | k*bsd*-gnu)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+@@ -280,7 +306,7 @@
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+- hardcode_direct=yes
++ :
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+@@ -359,7 +385,7 @@
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+- freebsd* | kfreebsd*-gnu | dragonfly*)
++ freebsd* | dragonfly*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+@@ -412,18 +438,22 @@
+ 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'
++ 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
+- 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
++ ld_shlibs=no
+ fi
+ ;;
+ os2*)
+@@ -471,7 +501,7 @@
+ ld_shlibs=yes
+ fi
+ ;;
+- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
++ 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`'
+@@ -488,33 +518,51 @@
+
+ # Check dynamic linker characteristics
+ # Code taken from libtool.m4's AC_LIBTOOL_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'
+ ;;
+ aix4* | aix5*)
++ library_names_spec='$libname$shrext'
+ ;;
+ amigaos*)
++ library_names_spec='$libname.a'
+ ;;
+ beos*)
++ library_names_spec='$libname$shrext'
+ ;;
+ bsdi[45]*)
++ library_names_spec='$libname$shrext'
+ ;;
+ cygwin* | mingw* | pw32*)
+ 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'
+ ;;
+ freebsd1*)
+ ;;
+- kfreebsd*-gnu)
+- ;;
+ freebsd* | dragonfly*)
++ case "$host_os" in
++ freebsd[123]*)
++ library_names_spec='$libname$shrext$versuffix' ;;
++ *)
++ library_names_spec='$libname$shrext' ;;
++ esac
+ ;;
+ gnu*)
++ library_names_spec='$libname$shrext'
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $host_cpu in
+@@ -528,10 +576,13 @@
+ shrext=.sl
+ ;;
+ esac
++ library_names_spec='$libname$shrext'
+ ;;
+- interix3*)
++ interix[3-9]*)
++ library_names_spec='$libname$shrext'
+ ;;
+ irix5* | irix6* | nonstopux*)
++ library_names_spec='$libname$shrext'
+ case "$host_os" in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+@@ -548,33 +599,46 @@
+ ;;
+ linux*oldld* | linux*aout* | linux*coff*)
+ ;;
+- linux*)
++ linux* | k*bsd*-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'
+ ;;
+ 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'
+ ;;
+ uts4*)
+ ;;
+@@ -583,6 +647,8 @@
+ 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
+@@ -596,6 +662,12 @@
+ # 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"
diff --git a/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.19.6/add-with-bisonlocaledir.patch b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.19.6/add-with-bisonlocaledir.patch
new file mode 100644
index 000000000..35a131067
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.19.6/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/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.19.6/parallel.patch b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.19.6/parallel.patch
new file mode 100644
index 000000000..c8e2c94af
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-0.19.6/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/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-minimal-0.19.4/0001-PATCH-Disable-the-test-to-convert-euc-jp.patch b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-minimal-0.19.4/0001-PATCH-Disable-the-test-to-convert-euc-jp.patch
new file mode 100644
index 000000000..29ef2a5a6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-minimal-0.19.4/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/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-minimal-0.19.4/COPYING b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-minimal-0.19.4/COPYING
new file mode 100644
index 000000000..8d11d1d8e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-minimal-0.19.4/COPYING
@@ -0,0 +1,4 @@
+dnl Copyright (C) 1995-2014 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/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-minimal-0.19.4/Makefile.in.in b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-minimal-0.19.4/Makefile.in.in
new file mode 100644
index 000000000..8906ba0ff
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-minimal-0.19.4/Makefile.in.in
@@ -0,0 +1,465 @@
+# 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>
+#
+# 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 but which still want to provide support for the GNU gettext
+# functionality.
+# Please note that the actual code of GNU gettext is covered by the GNU
+# General Public License and is *not* in the public domain.
+#
+# Origin: gettext-0.19
+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@
+
+MKDIR_P = @MKDIR_P@
+
+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; 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_UPDATE) --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"; 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/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-minimal-0.19.4/aclocal.tgz b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-minimal-0.19.4/aclocal.tgz
new file mode 100644
index 000000000..b04ba5503
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-minimal-0.19.4/aclocal.tgz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-minimal-0.19.4/config.rpath b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-minimal-0.19.4/config.rpath
new file mode 100755
index 000000000..b625621fa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-minimal-0.19.4/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-2014 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/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-minimal-0.19.4/remove-potcdate.sin b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-minimal-0.19.4/remove-potcdate.sin
new file mode 100644
index 000000000..2436c49e7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-minimal-0.19.4/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/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-minimal-native_0.19.4.bb b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-minimal-native_0.19.4.bb
new file mode 100644
index 000000000..1d4a443b7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext-minimal-native_0.19.4.bb
@@ -0,0 +1,32 @@
+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=1b20675cd5158442f6007d022f46b35b"
+
+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/import-layers/yocto-poky/meta/recipes-core/gettext/gettext_0.16.1.bb b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext_0.16.1.bb
new file mode 100644
index 000000000..cd0b759d5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext_0.16.1.bb
@@ -0,0 +1,112 @@
+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 = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=9ea3144f04c41cd2eada5d3f472e6ea5"
+
+PR = "r6"
+DEPENDS = "virtual/libiconv"
+DEPENDS_class-native = ""
+PROVIDES = "virtual/libintl virtual/gettext"
+PROVIDES_class-native = ""
+
+SRC_URI = "${GNU_MIRROR}/gettext/gettext-${PV}.tar.gz \
+ file://gettext-vpath.patch \
+ file://linklib_from_0.17.patch \
+ file://gettext-autoconf-lib-link-no-L.patch \
+ file://disable_java.patch \
+ file://fix_aclocal_version.patch \
+ file://fix_gnu_source_circular.patch \
+ file://hardcode_macro_version.patch \
+ "
+
+LDFLAGS_prepend_libc-uclibc = " -lrt -lpthread "
+
+SRC_URI[md5sum] = "3d9ad24301c6d6b17ec30704a13fe127"
+SRC_URI[sha256sum] = "0bf850d1a079fb5a61f0a47b1a9efd35eb44032255375e1cedb0253bc27b376d"
+
+PARALLEL_MAKE = ""
+
+inherit autotools texinfo
+
+EXTRA_OECONF += "--without-lisp --disable-csharp --disable-openmp --without-emacs"
+acpaths = '-I ${S}/autoconf-lib-link/m4/ \
+ -I ${S}/gettext-runtime/m4 \
+ -I ${S}/gettext-tools/m4'
+
+do_configure_prepend() {
+ rm -f ${S}/config/m4/libtool.m4
+}
+
+do_install_append_libc-musl () {
+ rm -f ${D}${libdir}/charset.alias
+ rm -f ${D}${includedir}/libintl.h
+}
+
+# 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-staticdev gettext-runtime-doc"
+
+FILES_${PN} += "${libdir}/${BPN}/*"
+
+FILES_gettext-runtime = "${bindir}/gettext \
+ ${bindir}/ngettext \
+ ${bindir}/envsubst \
+ ${bindir}/gettext.sh \
+ ${libdir}/libasprintf${SODEV} \
+ ${libdir}/GNU.Gettext.dll \
+ "
+FILES_gettext-runtime_append_libc-uclibc = " ${libdir}/libintl.so.* \
+ ${libdir}/charset.alias \
+ "
+FILES_gettext-runtime-staticdev += "${libdir}/libasprintf.a"
+FILES_gettext-runtime-dev += "${includedir}/autosprintf.h \
+ ${libdir}/libasprintf${SOLIBDEV}"
+FILES_gettext-runtime-dev_append_libc-uclibc = " ${libdir}/libintl.so \
+ ${includedir}/libintl.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
+}
+
+# Anyone inheriting gettext will have both gettext-native and gettext
+# available, and we don't want to use older macros from the target gettext in
+# a non-gplv3 build, so kill them and let dependent recipes rely on
+# gettext-native.
+
+SYSROOT_PREPROCESS_FUNCS += "remove_sysroot_m4_macros"
+
+remove_sysroot_m4_macros () {
+ rm -r "${SYSROOT_DESTDIR}${datadir}/aclocal"
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-core/gettext/gettext_0.19.6.bb b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext_0.19.6.bb
new file mode 100644
index 000000000..592e4fc76
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/gettext/gettext_0.19.6.bb
@@ -0,0 +1,115 @@
+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 expat"
+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 \
+"
+
+SRC_URI[md5sum] = "6d1447f8c5c45c329371ef4bfe7d79a5"
+SRC_URI[sha256sum] = "ed4b4c19bd3a3034eb6769500a3592ff616759ef43cf30586dbb7a17c9dd695d"
+
+PACKAGECONFIG[msgcat-curses] = "--with-libncurses-prefix=${STAGING_LIBDIR}/..,--disable-curses,ncurses,"
+
+LDFLAGS_prepend_libc-uclibc = " -lrt -lpthread "
+
+inherit autotools texinfo
+
+EXTRA_OECONF += "--without-lispdir \
+ --disable-csharp \
+ --disable-libasprintf \
+ --disable-java \
+ --disable-native-java \
+ --disable-openmp \
+ --disable-acl \
+ --with-included-glib \
+ --without-emacs \
+ --without-cvs \
+ --without-git \
+ --with-included-libxml \
+ --with-included-libcroco \
+ --with-included-libunistring \
+ "
+EXTRA_OECONF_append_class-target = " \
+ --with-bisonlocaledir=${datadir}/locale \
+"
+
+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}/*"
+
+FILES_gettext-runtime = "${bindir}/gettext \
+ ${bindir}/ngettext \
+ ${bindir}/envsubst \
+ ${bindir}/gettext.sh \
+ ${libdir}/libasprintf.so* \
+ ${libdir}/GNU.Gettext.dll \
+ "
+FILES_gettext-runtime_append_libc-uclibc = " ${libdir}/libintl.so.* \
+ ${libdir}/charset.alias \
+ "
+FILES_gettext-runtime-dev += "${libdir}/libasprintf.a \
+ ${includedir}/autosprintf.h \
+ "
+FILES_gettext-runtime-dev_append_libc-uclibc = " ${libdir}/libintl.so \
+ ${includedir}/libintl.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
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Install-gio-querymodules-as-libexec_PROGRAM.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch b/import-layers/yocto-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..41a190edd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch
@@ -0,0 +1,36 @@
+From 41534253b6b61ed4769eb6a3966698a50ee73b71 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] 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 | 6 ------
+ 1 file changed, 6 deletions(-)
+
+diff --git a/gio/glib-compile-schemas.c b/gio/glib-compile-schemas.c
+index e42949b..ec79d7c 100644
+--- a/gio/glib-compile-schemas.c
++++ b/gio/glib-compile-schemas.c
+@@ -1202,12 +1202,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/")))
+- g_printerr ("warning: Schema '%s' has path '%s'. Paths starting with "
+- "'/apps/', '/desktop/' or '/system/' are deprecated.\n", id, path);
+-
+ state->schema_state = schema_state_new (path, gettext_domain,
+ extends, extends_name, list_of);
+
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/0001-configure.ac-Do-not-use-readlink-when-cross-compilin.patch b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/0001-configure.ac-Do-not-use-readlink-when-cross-compilin.patch
new file mode 100644
index 000000000..0be36316b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/0001-configure.ac-Do-not-use-readlink-when-cross-compilin.patch
@@ -0,0 +1,31 @@
+commit 9b38d507ec37b3d7d4df6095fa7ed16b47d399f7
+Author: Drew Moseley <drew_moseley@mentor.com>
+Date: Sat Mar 29 21:10:43 2014 -0400
+
+ configure.ac: Do not use readlink when cross compiling.
+
+ Do not use readlink to set ABS_GLIB_RUNTIME_LIBDIR when cross
+ compiling. Doing so causes host paths to potentially pollute
+ the target.
+
+ Note that in this case the path is not converted to absolute if
+ it contains any ".." references so it's not completely correct.
+
+ Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=727575]
+ Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
+
+diff -rub glib-2.38.2.orig/configure.ac glib-2.38.2/configure.ac
+--- glib-2.38.2.orig/configure.ac 2014-04-03 20:17:13.035567143 -0400
++++ glib-2.38.2/configure.ac 2014-04-03 20:19:07.071566057 -0400
+@@ -275,7 +275,11 @@
+ [],
+ [with_runtime_libdir=""])
+ GLIB_RUNTIME_LIBDIR="$with_runtime_libdir"
++AS_IF([ test $cross_compiling = yes ], [
++ABS_GLIB_RUNTIME_LIBDIR="$libdir/$with_runtime_libdir"
++], [
+ ABS_GLIB_RUNTIME_LIBDIR="`readlink -m $libdir/$with_runtime_libdir`"
++])
+ AC_SUBST(GLIB_RUNTIME_LIBDIR)
+ AC_SUBST(ABS_GLIB_RUNTIME_LIBDIR)
+ AM_CONDITIONAL(HAVE_GLIB_RUNTIME_LIBDIR, [test "x$with_runtime_libdir" != "x"])
diff --git a/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/Enable-more-tests-while-cross-compiling.patch b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/Enable-more-tests-while-cross-compiling.patch
new file mode 100644
index 000000000..f1e688cac
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/Enable-more-tests-while-cross-compiling.patch
@@ -0,0 +1,81 @@
+From 310dfe1bdd16d4b254732fcc202c6211629bc7b6 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] 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 | 8 +++-----
+ tests/gobject/Makefile.am | 8 +++-----
+ 2 files changed, 6 insertions(+), 10 deletions(-)
+
+diff --git a/gio/tests/Makefile.am b/gio/tests/Makefile.am
+index 868873f..533e454 100644
+--- a/gio/tests/Makefile.am
++++ b/gio/tests/Makefile.am
+@@ -503,10 +503,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
+@@ -528,7 +527,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
+
+ resources.o: test_resources2.h
+ test_resources.c: test2.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/test2.gresource.xml)
+@@ -545,7 +548,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_resources.c test_resources2.[ch] plugin_resources.c test.gresource
+-endif # !CROSS_COMPILING
+
+ BUILT_SOURCES += giotypefuncs.c
+
+diff --git a/tests/gobject/Makefile.am b/tests/gobject/Makefile.am
+index 16f2827..4c2208e 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)'; \
diff --git a/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/allow-run-media-sdX-drive-mount-if-username-root.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/configure-libtool.patch b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/configure-libtool.patch
new file mode 100644
index 000000000..aa5de27d1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/configure-libtool.patch
@@ -0,0 +1,66 @@
+From e8740833336c59d6f616a1781b256e648e338c26 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] 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 | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 1af90c5..f6b7a73 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1378,7 +1378,7 @@ if test x"$glib_native_win32" = xyes; then
+ 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
+@@ -1427,13 +1427,13 @@ 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
+- 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([
+@@ -1506,7 +1506,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
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/fix-conflicting-rand.patch b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/fix-conflicting-rand.patch
new file mode 100644
index 000000000..1571112b0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/fix-conflicting-rand.patch
@@ -0,0 +1,35 @@
+Rename 'rand' variable to avoid conflict.
+
+Upstream-Status: pending
+Signed-off-by: Björn Stenberg <bjst@enea.com>
+
+diff -u glib-2.34.3/tests/refcount/signals.c~ glib-2.34.3/tests/refcount/signals.c
+--- glib-2.34.3/tests/refcount/signals.c 2012-11-26 17:52:48.000000000 +0100
++++ glib-2.34.3/tests/refcount/signals.c 2013-02-08 14:24:10.052477546 +0100
+@@ -9,7 +9,7 @@
+ #define MY_IS_TEST_CLASS(tclass) (G_TYPE_CHECK_CLASS_TYPE ((tclass), G_TYPE_TEST))
+ #define MY_TEST_GET_CLASS(test) (G_TYPE_INSTANCE_GET_CLASS ((test), G_TYPE_TEST, GTestClass))
+
+-static GRand *rand;
++static GRand *grand;
+
+ typedef struct _GTest GTest;
+ typedef struct _GTestClass GTestClass;
+@@ -84,7 +84,7 @@
+ NULL
+ };
+
+- rand = g_rand_new();
++ grand = g_rand_new();
+
+ test_type = g_type_register_static (G_TYPE_OBJECT, "GTest",
+ &test_info, 0);
+@@ -218,7 +218,7 @@
+ static void
+ my_test_do_prop (GTest * test)
+ {
+- test->value = g_rand_int (rand);
++ test->value = g_rand_int (grand);
+ g_object_notify (G_OBJECT (test), "test-prop");
+ }
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/gi-exclude.patch b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/gi-exclude.patch
new file mode 100644
index 000000000..dc62b92ef
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/gi-exclude.patch
@@ -0,0 +1,59 @@
+The autoptr types should be excluded from gobject-introspection parsing as
+they're not user-facing.
+
+Upstream-Status: Submitted
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/gio/gio-autocleanups.h b/gio/gio-autocleanups.h
+index a95ba65..24ccc2d 100644
+--- a/gio/gio-autocleanups.h
++++ b/gio/gio-autocleanups.h
+@@ -21,6 +21,8 @@
+ #error "Only <gio/gio.h> can be included directly."
+ #endif
+
++#ifndef __GI_SCANNER__
++
+ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GAction, g_object_unref)
+ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GActionMap, g_object_unref)
+ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GAppInfo, g_object_unref)
+@@ -146,3 +148,5 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVolume, g_object_unref)
+ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVolumeMonitor, g_object_unref)
+ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GZlibCompressor, g_object_unref)
+ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GZlibDecompressor, g_object_unref)
++
++#endif
+diff --git a/glib/glib-autocleanups.h b/glib/glib-autocleanups.h
+index 6355f75..09d28be 100644
+--- a/glib/glib-autocleanups.h
++++ b/glib/glib-autocleanups.h
+@@ -21,6 +21,8 @@
+ #error "Only <glib.h> can be included directly."
+ #endif
+
++#ifndef __GI_SCANNER__
++
+ static inline void
+ g_autoptr_cleanup_generic_gfree (void *p)
+ {
+@@ -87,3 +89,5 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariantDict, g_variant_dict_unref)
+ G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GVariantDict, g_variant_dict_clear)
+ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariantType, g_variant_type_free)
+ G_DEFINE_AUTO_CLEANUP_FREE_FUNC(GStrv, g_strfreev, NULL)
++
++#endif
+diff --git a/gobject/gobject-autocleanups.h b/gobject/gobject-autocleanups.h
+index 980203f..a1d4ba1 100644
+--- a/gobject/gobject-autocleanups.h
++++ b/gobject/gobject-autocleanups.h
+@@ -21,6 +21,10 @@
+ #error "Only <glib-object.h> can be included directly."
+ #endif
+
++#ifndef __GI_SCANNER__
++
+ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GObject, g_object_unref)
+ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GInitiallyUnowned, g_object_unref)
+ G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GValue, g_value_unset)
++
++#endif
diff --git a/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/glib-2.0-configure-readlink.patch b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/glib-2.0-configure-readlink.patch
new file mode 100644
index 000000000..9759d11e3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/glib-2.0-configure-readlink.patch
@@ -0,0 +1,29 @@
+configure.ac: change readlink -f to -m
+
+Change "readlink -f" to "readlink -m" since $libdir/$with_runtime_libdir
+may not exist.
+
+This patch should go to the upstream, I will send it sooner.
+
+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
+--- a/configure.ac
++++ b/configure.ac
+@@ -271,7 +271,7 @@ AC_ARG_WITH(runtime-libdir,
+ [],
+ [with_runtime_libdir=""])
+ GLIB_RUNTIME_LIBDIR="$with_runtime_libdir"
+-ABS_GLIB_RUNTIME_LIBDIR="`readlink -f $libdir/$with_runtime_libdir`"
++ABS_GLIB_RUNTIME_LIBDIR="`readlink -m $libdir/$with_runtime_libdir`"
+ AC_SUBST(GLIB_RUNTIME_LIBDIR)
+ AC_SUBST(ABS_GLIB_RUNTIME_LIBDIR)
+ AM_CONDITIONAL(HAVE_GLIB_RUNTIME_LIBDIR, [test "x$with_runtime_libdir" != "x"])
+--
+1.8.1.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/glib-gettextize-dir.patch b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/glib-gettextize-dir.patch
new file mode 100644
index 000000000..ee435111f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/glib-gettextize-dir.patch
@@ -0,0 +1,24 @@
+# an very old patch cherry-picked in every glib-2.0 patch directory. The earliest container
+# for it is 2.6.5 in OE. The earliest commit for it is c8e5702127e507e82e6f68a4b8c546803accea9d
+# in OE side which ports from previous bitkeeper SCM. In OE side it's only used til 2.12.4.
+#
+# keep it since it's always cleaner to not hardcode destination path. Use @datadir@ is more
+# portable here. mark for upstream
+#
+# by Kevin Tian <kevin.tian@intel.com>, 06/25/2010
+# Rebased by Dongxiao Xu <dongxiao.xu@intel.com>, 11/16/2010
+
+Upstream-Status: Inappropriate [configuration]
+
+diff -ruN glib-2.27.3-orig/glib-gettextize.in glib-2.27.3/glib-gettextize.in
+--- glib-2.27.3-orig/glib-gettextize.in 2009-04-01 07:04:20.000000000 +0800
++++ glib-2.27.3/glib-gettextize.in 2010-11-16 12:55:06.874605916 +0800
+@@ -52,7 +52,7 @@
+ datadir=@datadir@
+ datarootdir=@datarootdir@
+
+-gettext_dir=$prefix/share/glib-2.0/gettext
++gettext_dir=@datadir@/glib-2.0/gettext
+
+ while test $# -gt 0; do
+ case "$1" in
diff --git a/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/ptest-paths.patch b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/ptest-paths.patch
new file mode 100644
index 000000000..f3be02770
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/relocate-modules.patch b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/relocate-modules.patch
new file mode 100644
index 000000000..f9e3f3dba
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/relocate-modules.patch
@@ -0,0 +1,49 @@
+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>
+
+diff --git a/gio/giomodule.c b/gio/giomodule.c
+index 56c498c..a2e32b7 100644
+--- a/gio/giomodule.c
++++ b/gio/giomodule.c
+@@ -47,6 +47,27 @@
+ #include "gdesktopappinfo.h"
+ #endif
+
++#include <dlfcn.h>
++
++/*
++ * Generate a GIO module directory based on where glib is installed
++ */
++static const char *
++_get_gio_module_dir (void)
++{
++ Dl_info info;
++
++ if (dladdr (g_io_module_new, &info)) {
++ char *libdir = g_path_get_dirname (info.dli_fname);
++ char *dir = g_build_filename (libdir, "gio", "modules", NULL);
++ g_free (libdir);
++ return dir;
++ } else {
++ return GIO_MODULE_DIR;
++ }
++}
++
++
+ /**
+ * SECTION:giomodule
+ * @short_description: Loadable GIO Modules
+@@ -1057,7 +1078,7 @@ _g_io_modules_ensure_loaded (void)
+ /* Then load the compiled in path */
+ module_dir = g_getenv ("GIO_MODULE_DIR");
+ if (module_dir == NULL)
+- module_dir = GIO_MODULE_DIR;
++ module_dir = _get_gio_module_dir ();
+
+ g_io_modules_scan_all_in_directory_with_scope (module_dir, scope);
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/run-ptest b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/run-ptest
new file mode 100644
index 000000000..5b85e8fab
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/uclibc_musl_translation.patch b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0/uclibc_musl_translation.patch
new file mode 100644
index 000000000..7aa6217d6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0_2.46.2.bb b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0_2.46.2.bb
new file mode 100644
index 000000000..8e445b415
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib-2.0_2.46.2.bb
@@ -0,0 +1,26 @@
+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://fix-conflicting-rand.patch \
+ file://glib-2.0-configure-readlink.patch \
+ file://run-ptest \
+ file://ptest-paths.patch \
+ file://uclibc_musl_translation.patch \
+ file://0001-configure.ac-Do-not-use-readlink-when-cross-compilin.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://gi-exclude.patch \
+ file://0001-Install-gio-querymodules-as-libexec_PROGRAM.patch \
+ "
+
+SRC_URI_append_class-native = " file://glib-gettextize-dir.patch \
+ file://relocate-modules.patch"
+
+SRC_URI[md5sum] = "7f815d6e46df68e070cb421ed7f1139e"
+SRC_URI[sha256sum] = "5031722e37036719c1a09163cc6cf7c326e4c4f1f1e074b433c156862bd733db"
diff --git a/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib.inc b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib.inc
new file mode 100644
index 000000000..e764fad13
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glib-2.0/glib.inc
@@ -0,0 +1,130 @@
+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 domai'-like license!
+LICENSE = "LGPLv2+ & BSD & PD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7 \
+ file://glib/glib.h;beginline=4;endline=17;md5=b4f0f4a399c19e5ebb20c31b79d6bc32 \
+ file://gmodule/COPYING;md5=3bf50002aefd002f49e7bb854063f7e7 \
+ file://gmodule/gmodule.h;beginline=4;endline=17;md5=b4f0f4a399c19e5ebb20c31b79d6bc32 \
+ 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"
+
+BBCLASSEXTEND = "native nativesdk"
+
+DEPENDS = "virtual/libiconv libffi zlib glib-2.0-native"
+DEPENDS_append = " ${@bb.utils.contains('PTEST_ENABLED', '1', ' dbus', '', d)}"
+DEPENDS_class-native = "pkgconfig-native gettext-native libffi-native zlib-native"
+DEPENDS_class-nativesdk = "nativesdk-libtool nativesdk-gettext nativesdk-libffi nativesdk-zlib glib-2.0-native"
+
+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
+
+S = "${WORKDIR}/glib-${PV}"
+
+PACKAGECONFIG ??= "system-pcre"
+# To use the system pcre it must be configured with --enable-unicode-properties
+PACKAGECONFIG[system-pcre] = "--with-pcre=system,--with-pcre=internal,libpcre"
+
+CORECONF = "--disable-dtrace --disable-fam --disable-libelf --disable-systemtap --disable-man"
+
+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"
+EXTRA_OECONF_append_libc-uclibc = " --with-libiconv=gnu"
+
+do_configure_prepend() {
+ sed -i -e '1s,#!.*,#!${USRBINPATH}/env python,' ${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"
+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}/*"
+
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
+
+USE_NLS = "yes"
+
+do_install_append () {
+ if [ -f ${D}${bindir}/gtester-report ]; then
+ sed ${D}${bindir}/gtester-report -i -e '1s|^#!.*|#!/usr/bin/env python|'
+ fi
+
+ # Remove some unpackaged files
+ rm -f ${D}${datadir}/glib-2.0/codegen/*.pyc
+ rm -f ${D}${datadir}/glib-2.0/codegen/*.pyo
+
+ # 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.
+ if [ -f ${D}${bindir}/glib-mkenums ]; then
+ sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/glib-mkenums
+ fi
+
+ 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
+
+ # Make sure gio-querymodules is unique among multilibs
+ if test "x${MLPREFIX}" != "x"; then
+ mv ${D}${libexecdir}/gio-querymodules ${D}${libexecdir}/${MLPREFIX}gio-querymodules
+ fi
+}
+
+do_install_append_libc-musl () {
+ rm -f ${D}${libdir}/charset.alias
+}
+
+RDEPENDS_${PN}-ptest += "\
+ gnome-desktop-testing \
+ tzdata \
+ tzdata-americas \
+ tzdata-asia \
+ tzdata-europe \
+ tzdata-posix \
+ python-pygobject \
+ python-dbus \
+ 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/import-layers/yocto-poky/meta/recipes-core/glib-networking/glib-networking_2.46.1.bb b/import-layers/yocto-poky/meta/recipes-core/glib-networking/glib-networking_2.46.1.bb
new file mode 100644
index 000000000..749ac988a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glib-networking/glib-networking_2.46.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 intltool-native"
+
+SRC_URI[archive.md5sum] = "c000e0b579f5d8fd48efebc7ac4d95dc"
+SRC_URI[archive.sha256sum] = "d5034214217f705891b6c9e719cc2c583c870bfcfdc454ebbb5e5e8940ac90b1"
+
+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/import-layers/yocto-poky/meta/recipes-core/glibc/cross-localedef-native/fix_for_centos_5.8.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/cross-localedef-native/fix_for_centos_5.8.patch
new file mode 100644
index 000000000..186a48045
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/cross-localedef-native/fix_for_centos_5.8.patch
@@ -0,0 +1,18 @@
+Upstream-Status: Inappropriate [other]
+
+This is a hack to fix building the locale bits on an older
+CentOs 5.X machine
+
+Index: git/locale/programs/config.h
+===================================================================
+--- git/locale/programs/config.h
++++ git.orig/locale/programs/config.h
+@@ -19,6 +19,8 @@
+ #ifndef _LD_CONFIG_H
+ #define _LD_CONFIG_H 1
+
++#define DUMMY_LOCALE_T
++
+ /* Use the internal textdomain used for libc messages. */
+ #define PACKAGE _libc_intl_domainname
+ #ifndef VERSION
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/cross-localedef-native_2.23.bb b/import-layers/yocto-poky/meta/recipes-core/glibc/cross-localedef-native_2.23.bb
new file mode 100644
index 000000000..fa930fd48
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/cross-localedef-native_2.23.bb
@@ -0,0 +1,58 @@
+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"
+
+
+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+(\.\d+)*)"
+
+SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
+ git://github.com/kraj/localedef;branch=master;name=localedef;destsuffix=git/localedef \
+ file://fix_for_centos_5.8.patch \
+ ${EGLIBCPATCHES} \
+"
+EGLIBCPATCHES = "\
+ file://0016-timezone-re-written-tzselect-as-posix-sh.patch \
+ file://0017-Remove-bash-dependency-for-nscd-init-script.patch \
+ file://0018-eglibc-Cross-building-and-testing-instructions.patch \
+ file://0019-eglibc-Help-bootstrap-cross-toolchain.patch \
+ file://0020-eglibc-cherry-picked-from.patch \
+ file://0021-eglibc-Clear-cache-lines-on-ppc8xx.patch \
+ file://0022-eglibc-Resolve-__fpscr_values-on-SH4.patch \
+ file://0023-eglibc-Install-PIC-archives.patch \
+ file://0025-eglibc-Forward-port-cross-locale-generation-support.patch \
+"
+
+SRCREV_glibc ?= "e742928c1592b43db6809db4f39e67be151cdd27"
+SRCREV_localedef ?= "5a81ff9f06a7a808d4c3d37bbf34077a4c5902ed"
+
+# 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_configure () {
+ ${S}/localedef/configure ${EXTRA_OECONF}
+}
+
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 ${B}/localedef ${D}${bindir}/cross-localedef
+}
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-collateral.inc b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-collateral.inc
new file mode 100644
index 000000000..60655eba3
--- /dev/null
+++ b/import-layers/yocto-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 = "arm"
+
+do_fetch[noexec] = "1"
+do_unpack[noexec] = "1"
+do_patch[noexec] = "1"
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install[depends] += "virtual/${MLPREFIX}libc:do_populate_sysroot"
+
+COMPATIBLE_HOST_libc-musl_class-target = "null"
+COMPATIBLE_HOST_libc-uclibc_class-target = "null"
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-common.inc b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-common.inc
new file mode 100644
index 000000000..bba1568ba
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-common.inc
@@ -0,0 +1,9 @@
+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 "
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-initial.inc b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-initial.inc
new file mode 100644
index 000000000..5975fd26c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-initial.inc
@@ -0,0 +1,78 @@
+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-${TARGET_ARCH}"
+TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}"
+
+do_configure () {
+ (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
+ find ${S} -name "configure" | xargs touch
+ cfgscript=`python -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
+ # add links to linux-libc-headers: final glibc build need this.
+ for t in linux asm asm-generic; do
+ ln -s ${STAGING_DIR_TARGET}${includedir}/$t ${D}${includedir}/
+ done
+}
+
+do_install_locale() {
+ :
+}
+
+do_siteconfig () {
+ :
+}
+
+SSTATEPOSTINSTFUNCS += "glibcinitial_sstate_postinst"
+glibcinitial_sstate_postinst() {
+ if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
+ then
+ # Recreate the symlinks to ensure they point to the correct location
+ for t in linux asm asm-generic; do
+ rm -f ${STAGING_DIR_TCBOOTSTRAP}${includedir}/$t
+ ln -s ${STAGING_DIR_TARGET}${includedir}/$t ${STAGING_DIR_TCBOOTSTRAP}${includedir}/
+ done
+ fi
+}
+
+do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_TCBOOTSTRAP}/"
+
+# We don't install any scripts so there is nothing to evacuate
+do_evacuate_scripts () {
+ :
+}
+
+inherit nopackages
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-initial_2.23.bb b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-initial_2.23.bb
new file mode 100644
index 000000000..e86770e12
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-initial_2.23.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/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-ld.inc b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-ld.inc
new file mode 100644
index 000000000..c5f4db229
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-ld.inc
@@ -0,0 +1,57 @@
+def ld_append_if_tune_exists(d, infos, dict):
+ tune = d.getVar("DEFAULTTUNE", True) or ""
+ libdir = d.getVar("base_libdir", True) 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 = {
+ "mips": ["ld.so.1", "FLAG_ELF_LIBC6"],
+ "mips64-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
+ "mips64": ["ld.so.1", "FLAG_ELF_LIBC6"],
+ "mipsel": ["ld.so.1", "FLAG_ELF_LIBC6"],
+ "mips64el-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
+ "mips64el": ["ld.so.1", "FLAG_ELF_LIBC6"],
+ "mips-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
+ "mips64-nf-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
+ "mips64-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
+ "mips64el-nf-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
+ "mips64el-nf": ["ld.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",True)
+ 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", True) or ""
+ for item in variants.split():
+ localdata = bb.data.createCopy(d)
+ overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
+ localdata.setVar("OVERRIDES", overrides)
+ bb.data.update_data(localdata)
+ 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']}"
+glibc_dl_info[vardepsexclude] = "OVERRIDES"
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-locale.inc b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-locale.inc
new file mode 100644
index 000000000..e868e38a9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-locale.inc
@@ -0,0 +1,95 @@
+include 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}"
+
+# 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 = "0"
+
+#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-.* \
+ ^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', True).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', True).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', True).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', True).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 = "${STAGING_INCDIR}/glibc-locale-internal-${MULTIMACH_TARGET_SYS}"
+
+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/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-locale_2.23.bb b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-locale_2.23.bb
new file mode 100644
index 000000000..f7702e035
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-locale_2.23.bb
@@ -0,0 +1 @@
+require glibc-locale.inc
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-mtrace.inc b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-mtrace.inc
new file mode 100644
index 000000000..e12b079e0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-mtrace.inc
@@ -0,0 +1,13 @@
+include glibc-collateral.inc
+
+SUMMARY = "mtrace utility provided by glibc"
+DESCRIPTION = "mtrace utility provided by glibc"
+RDEPENDS_${PN} = "perl"
+RPROVIDES_${PN} = "libc-mtrace"
+
+SRC = "${STAGING_INCDIR}/glibc-scripts-internal-${MULTIMACH_TARGET_SYS}"
+
+do_install() {
+ install -d -m 0755 ${D}${bindir}
+ install -m 0755 ${SRC}/mtrace ${D}${bindir}/
+}
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-mtrace_2.23.bb b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-mtrace_2.23.bb
new file mode 100644
index 000000000..0b69bad46
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-mtrace_2.23.bb
@@ -0,0 +1 @@
+require glibc-mtrace.inc
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-package.inc b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-package.inc
new file mode 100644
index 000000000..bad642449
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-package.inc
@@ -0,0 +1,214 @@
+#
+# For now, we will skip building of a gcc package if it is a uclibc one
+# and our build is not a uclibc one, and we skip a glibc one if our build
+# is a uclibc build.
+#
+# See the note in gcc/gcc_3.4.0.oe
+#
+
+python __anonymous () {
+ import bb, re
+ uc_os = (re.match('.*uclibc*', d.getVar('TARGET_OS', True)) != None)
+ if uc_os:
+ raise bb.parse.SkipPackage("incompatible with target %s" %
+ d.getVar('TARGET_OS', True))
+}
+
+# Set this to zero if you don't want ldconfig in the output package
+USE_LDCONFIG ?= "1"
+
+INHIBIT_SYSROOT_STRIP = "1"
+
+PACKAGES = "${PN}-dbg catchsegv sln nscd ldd tzcode ${PN}-utils glibc-thread-db ${PN}-pic libcidn libmemusage libsegfault ${PN}-pcprofile libsotruss ${PN} 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_conditional('USE_LDCONFIG', '1', '${base_sbindir}/ldconfig ${sysconfdir}/ld.so.conf', '', d)}"
+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
+
+ 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 [ "${USE_LDCONFIG}" != "1" ]; then
+ # We won't ship these files (see FILES above) 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
+
+ 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}" != "/lib" ] ; then
+ # The aarch64 ABI says the dynamic linker -must- be /lib/ld-linux-aarch64[_be].so.1
+ install -d ${D}/lib
+ if [ -e ${D}${base_libdir}/ld-linux-aarch64.so.1 ]; then
+ ln -s ${@base_path_relative('/lib', '${base_libdir}')}/ld-linux-aarch64.so.1 \
+ ${D}/lib/ld-linux-aarch64.so.1
+ elif [ -e ${D}${base_libdir}/ld-linux-aarch64_be.so.1 ]; then
+ ln -s ${@base_path_relative('/lib', '${base_libdir}')}/ld-linux-aarch64_be.so.1 \
+ ${D}/lib/ld-linux-aarch64_be.so.1
+ fi
+ fi
+}
+
+do_install_locale () {
+ dest=${D}/${includedir}/glibc-locale-internal-${MULTIMACH_TARGET_SYS}
+ 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}
+}
+
+addtask do_install_locale after do_install before do_populate_sysroot do_package
+
+bashscripts = "mtrace sotruss xtrace"
+
+do_evacuate_scripts () {
+ target=${D}${includedir}/glibc-scripts-internal-${MULTIMACH_TARGET_SYS}
+ mkdir -p $target
+ for i in ${bashscripts}; do
+ if [ -f ${D}${bindir}/$i ]; then
+ cp ${D}${bindir}/$i $target/
+ fi
+ done
+}
+
+addtask evacuate_scripts after do_install before do_populate_sysroot do_package
+
+PACKAGE_PREPROCESS_FUNCS += "glibc_package_preprocess"
+
+glibc_package_preprocess () {
+ rm -rf ${PKGD}/${includedir}/glibc-locale-internal-${MULTIMACH_TARGET_SYS}
+ rm -rf ${PKGD}/${includedir}/glibc-scripts-internal-${MULTIMACH_TARGET_SYS}
+ for i in ${bashscripts}; do
+ rm -f ${PKGD}${bindir}/$i
+ done
+ rm -rf ${PKGD}/${localedir}
+ if [ "${libdir}" != "${exec_prefix}/lib" ]; then
+ # This dir only exists to hold locales
+ rm -rf ${PKGD}${exec_prefix}/lib
+ fi
+}
+
+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/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-scripts.inc b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-scripts.inc
new file mode 100644
index 000000000..3a06773d6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-scripts.inc
@@ -0,0 +1,16 @@
+include glibc-collateral.inc
+
+SUMMARY = "utility scripts provided by glibc"
+DESCRIPTION = "utility scripts provided by glibc"
+RDEPENDS_${PN} = "bash glibc-mtrace"
+
+SRC = "${STAGING_INCDIR}/glibc-scripts-internal-${MULTIMACH_TARGET_SYS}"
+
+bashscripts = "sotruss xtrace"
+
+do_install() {
+ install -d -m 0755 ${D}${bindir}
+ for i in ${bashscripts}; do
+ install -m 0755 ${SRC}/$i ${D}${bindir}/
+ done
+}
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-scripts_2.23.bb b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-scripts_2.23.bb
new file mode 100644
index 000000000..5a89bd802
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-scripts_2.23.bb
@@ -0,0 +1 @@
+require glibc-scripts.inc
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-testing.inc b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc-testing.inc
new file mode 100644
index 000000000..0a42ae7f7
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/glibc/glibc.inc b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc.inc
new file mode 100644
index 000000000..bf1dccdeb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc.inc
@@ -0,0 +1,80 @@
+require glibc-common.inc
+require glibc-ld.inc
+require glibc-testing.inc
+
+STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
+STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${TARGET_ARCH}"
+PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
+
+TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}"
+
+python () {
+ opt_effective = "-O"
+ for opt in d.getVar('SELECTED_OPTIMIZATION', True).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', True), 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', True), 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}']}"
+PROVIDES = "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc"
+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=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 = "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"
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0001-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0001-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch
new file mode 100644
index 000000000..97c280059
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0001-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch
@@ -0,0 +1,69 @@
+From 66d04e2cd8badb0984050e4e9f2732f47151fbbf 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/24] 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 6fb615e..ee3d1e6 100644
+--- a/elf/dl-load.c
++++ b/elf/dl-load.c
+@@ -2094,6 +2094,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)
+@@ -2152,14 +2160,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.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0002-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0002-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch
new file mode 100644
index 000000000..473b89449
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0002-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch
@@ -0,0 +1,50 @@
+From 179dc5f1e13c3ff96d5f21a2a78c089cf120ceb8 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/24] 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 ee3d1e6..c4a42e9 100644
+--- a/elf/dl-load.c
++++ b/elf/dl-load.c
+@@ -1793,7 +1793,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.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch
new file mode 100644
index 000000000..60f9f17b8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch
@@ -0,0 +1,136 @@
+From e76048898ae9aa49dc70d6f9b1bbc22082e61fe3 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/24] 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 +++--
+ sysdeps/generic/dl-cache.h | 4 ----
+ 6 files changed, 13 insertions(+), 9 deletions(-)
+
+diff --git a/elf/dl-cache.c b/elf/dl-cache.c
+index dec49bc..862f1d8 100644
+--- a/elf/dl-cache.c
++++ b/elf/dl-cache.c
+@@ -132,6 +132,10 @@ do \
+ while (0)
+
+
++const char LD_SO_CACHE[4096] __attribute__ ((section (".ldsocache"))) =
++ SYSCONFDIR "/ld.so.cache";
++
++
+ int
+ internal_function
+ _dl_cache_libcmp (const char *p1, const char *p2)
+diff --git a/elf/dl-load.c b/elf/dl-load.c
+index c4a42e9..acf6c03 100644
+--- a/elf/dl-load.c
++++ b/elf/dl-load.c
+@@ -106,8 +106,8 @@ static size_t max_capstrlen attribute_relro;
+ /* Get the generated information about the trusted directories. */
+ #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 422ea95e..6d61a36 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 f54ec22..0e78a83 100644
+--- a/elf/ldconfig.c
++++ b/elf/ldconfig.c
+@@ -167,6 +167,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 52160df..80f0582 100644
+--- a/elf/rtld.c
++++ b/elf/rtld.c
+@@ -99,6 +99,7 @@ uintptr_t __pointer_chk_guard_local
+ strong_alias (__pointer_chk_guard_local, __pointer_chk_guard)
+ #endif
+
++extern const char LD_SO_CACHE[4096] __attribute__ ((section (".ldsocache")));
+
+ /* List of auditing DSOs. */
+ static struct audit_list
+@@ -873,12 +874,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/sysdeps/generic/dl-cache.h b/sysdeps/generic/dl-cache.h
+index 70d4aeb..5c726d0 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
+Index: git/iconv/gconv_conf.c
+===================================================================
+--- git.orig/iconv/gconv_conf.c
++++ git/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/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0004-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0004-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch
new file mode 100644
index 000000000..21f04a132
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0004-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch
@@ -0,0 +1,32 @@
+From 2e1638115f0f924ee8235eee9265047054c15cfd 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/24] 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.
+
+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 59f3d34..6f6b7ff 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
+
+
+--
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0005-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0005-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch
new file mode 100644
index 000000000..ba8c92e11
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0005-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch
@@ -0,0 +1,1584 @@
+From 7ff57edfe24b4243373fcb896ee0b613938c1ec9 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/24] 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 0000000..71e516d
+--- /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 0000000..26fa067
+--- /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 0000000..71e516d
+--- /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 0000000..26fa067
+--- /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 0000000..71e516d
+--- /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 0000000..26fa067
+--- /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 0000000..71e516d
+--- /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 0000000..26fa067
+--- /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 0000000..71e516d
+--- /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 0000000..26fa067
+--- /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 0000000..71e516d
+--- /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 0000000..26fa067
+--- /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 0000000..b103b4d
+--- /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 0000000..64db17f
+--- /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 0000000..7eac5fc
+--- /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 0000000..264b2a7
+--- /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 0000000..a259344
+--- /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 0000000..a7bc854
+--- /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 0000000..04ff8cc
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies
+@@ -0,0 +1 @@
++powerpc/powerpc64/e6500/fpu
+--
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0006-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0006-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch
new file mode 100644
index 000000000..086a73dd2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0006-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch
@@ -0,0 +1,33 @@
+From 61129ef3ee735b300604f75d50e01cb29f4387f4 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/24] 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 7fd5b8a..2f5da9f 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.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0007-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0007-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch
new file mode 100644
index 000000000..952784b1c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0007-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch
@@ -0,0 +1,208 @@
+From f936548decac99501f9a4c522a3211d16542fa49 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/24] 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 71e516d..1795fd6 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 26fa067..a917f31 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 71e516d..fc4a749 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 26fa067..9d17512 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 71e516d..fc4a749 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 26fa067..9d17512 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 71e516d..fc4a749 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 26fa067..9d17512 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 71e516d..1795fd6 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 26fa067..a917f31 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 71e516d..fc4a749 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 26fa067..9d17512 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.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0008-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0008-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch
new file mode 100644
index 000000000..8d513ab42
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0008-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch
@@ -0,0 +1,387 @@
+From d02704895fdce917e337619a4414042f63edd88b 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/24] __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 1795fd6..daa83f3 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 a917f31..b812cf1 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 fc4a749..7038a70 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 9d17512..10de1f0 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 fc4a749..7038a70 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 9d17512..10de1f0 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 fc4a749..1c34244 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 9d17512..8126535 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 1795fd6..13a8197 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 a917f31..fae2d81 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 fc4a749..7038a70 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 9d17512..10de1f0 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.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0009-Quote-from-bug-1443-which-explains-what-the-patch-do.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0009-Quote-from-bug-1443-which-explains-what-the-patch-do.patch
new file mode 100644
index 000000000..12f24fb68
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0009-Quote-from-bug-1443-which-explains-what-the-patch-do.patch
@@ -0,0 +1,62 @@
+From 502f061d846e58aac7aca67e4e0d6ba9e0763b17 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/24] 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 6fb20bd..8805537 100644
+--- a/sysdeps/arm/dl-machine.h
++++ b/sysdeps/arm/dl-machine.h
+@@ -499,7 +499,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.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0010-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch b/import-layers/yocto-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..77bd7d132
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0010-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch
@@ -0,0 +1,36 @@
+From 69a3e30b49d28a7386d18725528652931510cbfc 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/24] 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 cdb6763..0b32a0a 100644
+--- a/manual/Makefile
++++ b/manual/Makefile
+@@ -105,7 +105,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.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch
new file mode 100644
index 000000000..251e5f5af
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch
@@ -0,0 +1,61 @@
+From 4cf52971a841304aec30b2e975f81d7ad9d42ef0 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/24] __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 1c34244..7038a70 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 8126535..10de1f0 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.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0012-Make-ld-version-output-matching-grok-gold-s-output.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0012-Make-ld-version-output-matching-grok-gold-s-output.patch
new file mode 100644
index 000000000..3208a0c89
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0012-Make-ld-version-output-matching-grok-gold-s-output.patch
@@ -0,0 +1,44 @@
+From b356816d6e005ecda7adbed9627a4315ad39de39 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:25:45 +0000
+Subject: [PATCH 12/24] Make ld --version output matching grok gold's output
+
+adapted from from upstream branch roland/gold-vs-libc
+
+Upstream-Status: Backport
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure | 2 +-
+ configure.ac | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index aa05d49..6dabd11 100755
+--- a/configure
++++ b/configure
+@@ -4486,7 +4486,7 @@ else
+ # Found it, now check the version.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of $LD" >&5
+ $as_echo_n "checking version of $LD... " >&6; }
+- ac_prog_version=`$LD --version 2>&1 | sed -n 's/^.*GNU ld.* \([0-9][0-9]*\.[0-9.]*\).*$/\1/p'`
++ ac_prog_version=`$LD --version 2>&1 | sed -n 's/^.*GNU [Bbinutilsd][^.]* \([0-9][0-9]*\.[0-9.]*\).*$/\1/p'`
+ case $ac_prog_version in
+ '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
+ 2.1[0-9][0-9]*|2.2[2-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*)
+diff --git a/configure.ac b/configure.ac
+index ee7a3f1..b4b95b9 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -948,7 +948,7 @@ AC_CHECK_PROG_VER(AS, $AS, --version,
+ [2.1[0-9][0-9]*|2.2[2-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*],
+ AS=: critic_missing="$critic_missing as")
+ AC_CHECK_PROG_VER(LD, $LD, --version,
+- [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)],
++ [GNU [Bbinutilsd][^.]* \([0-9][0-9]*\.[0-9.]*\)],
+ [2.1[0-9][0-9]*|2.2[2-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*],
+ LD=: critic_missing="$critic_missing ld")
+
+--
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0013-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0013-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch
new file mode 100644
index 000000000..82fa10044
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0013-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch
@@ -0,0 +1,42 @@
+From 10003d48f83f7a4f7fa562ed89af904a544b6323 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 13/24] 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 71243ad..f578187 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 634fe4d..3db1697 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.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0014-Add-unused-attribute.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0014-Add-unused-attribute.patch
new file mode 100644
index 000000000..ea3e1670f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0014-Add-unused-attribute.patch
@@ -0,0 +1,34 @@
+From cafa8a7ef830e02cdbf928471e06d11054946940 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 14/24] 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 80290bc..7890a8e 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.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0015-yes-within-the-path-sets-wrong-config-variables.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0015-yes-within-the-path-sets-wrong-config-variables.patch
new file mode 100644
index 000000000..90e12b883
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0015-yes-within-the-path-sets-wrong-config-variables.patch
@@ -0,0 +1,263 @@
+From 4d6bead19874e519752ceeb2a15897ff2ffbe5e8 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 15/24] '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 5bd355a..3bc5537 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 7851dd4..6e92381 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 431e843..e152461 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 90cdd69..05a262b 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 4e13248..f14af95 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 bcbdaff..ad3057f 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 14c8a3a..dde3814 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 f05f438..dc86399 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 dee56aa..f2049ed 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 45147c5..4224af1 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 af06970..27b8c1b 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 0822915..9a32fdd 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.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0016-timezone-re-written-tzselect-as-posix-sh.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0016-timezone-re-written-tzselect-as-posix-sh.patch
new file mode 100644
index 000000000..e51b611f3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0016-timezone-re-written-tzselect-as-posix-sh.patch
@@ -0,0 +1,45 @@
+From 3e8586eb3509e2f0d6dfb74be8f89a30b06b56e9 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 16/24] 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 99566cb..b6e757e 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 9d70691..25f45a8 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)}
+
+ # Check for awk Posix compliance.
+ ($AWK -v x=y 'BEGIN { exit 123 }') </dev/null >/dev/null 2>&1
+--
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0017-Remove-bash-dependency-for-nscd-init-script.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0017-Remove-bash-dependency-for-nscd-init-script.patch
new file mode 100644
index 000000000..0c9ae6c13
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0017-Remove-bash-dependency-for-nscd-init-script.patch
@@ -0,0 +1,73 @@
+From cd9d9fe7316f4ce4ca9d8e67e22f5718879535e4 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 17/24] 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.
+
+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 a882da7..b02986e 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.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0018-eglibc-Cross-building-and-testing-instructions.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0018-eglibc-Cross-building-and-testing-instructions.patch
new file mode 100644
index 000000000..e282e60eb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0018-eglibc-Cross-building-and-testing-instructions.patch
@@ -0,0 +1,619 @@
+From 8f554f4a1beb39182aad9cd9b5e1da69464dff7e 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 18/24] 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 0000000..e6e0da1
+--- /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 0000000..b67b468
+--- /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.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0019-eglibc-Help-bootstrap-cross-toolchain.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0019-eglibc-Help-bootstrap-cross-toolchain.patch
new file mode 100644
index 000000000..c04e0a11d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0019-eglibc-Help-bootstrap-cross-toolchain.patch
@@ -0,0 +1,100 @@
+From c2d49eab20db4ab02b6de62092fedc623d757146 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 19/24] 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 9a01c93..a6ae003 100644
+--- a/Makefile
++++ b/Makefile
+@@ -69,9 +69,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
+@@ -151,6 +160,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
+@@ -177,6 +196,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 0000000..1d2b669
+--- /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.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0020-eglibc-cherry-picked-from.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0020-eglibc-cherry-picked-from.patch
new file mode 100644
index 000000000..4362efae7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0020-eglibc-cherry-picked-from.patch
@@ -0,0 +1,66 @@
+From 588d936b9aa65e7cc8b1eb2cad1d209087db43a9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 31 Dec 2015 15:10:33 -0800
+Subject: [PATCH 20/24] eglibc: cherry-picked from
+
+http://www.eglibc.org/archives/patches/msg00772.html
+
+Not yet merged into glibc
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ resolv/res_libc.c | 14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/resolv/res_libc.c b/resolv/res_libc.c
+index a8394e0..981ac7c 100644
+--- a/resolv/res_libc.c
++++ b/resolv/res_libc.c
+@@ -18,6 +18,7 @@
+ #include <atomic.h>
+ #include <limits.h>
+ #include <sys/types.h>
++#include <sys/stat.h>
+ #include <netinet/in.h>
+ #include <arpa/nameser.h>
+ #include <resolv.h>
+@@ -28,6 +29,7 @@
+ out) since res_init() should go into libc.so but the rest of that
+ file should not. */
+
++__libc_lock_define_initialized (static, lock);
+ extern unsigned long long int __res_initstamp attribute_hidden;
+ /* We have atomic increment operations on 64-bit platforms. */
+ #if __WORDSIZE == 64
+@@ -35,7 +37,6 @@ extern unsigned long long int __res_initstamp attribute_hidden;
+ # define atomicincunlock(lock) (void) 0
+ # define atomicinc(var) catomic_increment (&(var))
+ #else
+-__libc_lock_define_initialized (static, lock);
+ # define atomicinclock(lock) __libc_lock_lock (lock)
+ # define atomicincunlock(lock) __libc_lock_unlock (lock)
+ # define atomicinc(var) ++var
+@@ -94,7 +95,18 @@ res_init(void) {
+ int
+ __res_maybe_init (res_state resp, int preinit)
+ {
++ static time_t last_mtime;
++ struct stat statbuf;
++ int ret;
++
+ if (resp->options & RES_INIT) {
++ ret = stat (_PATH_RESCONF, &statbuf);
++ __libc_lock_lock (lock);
++ if ((ret == 0) && (last_mtime != statbuf.st_mtime)) {
++ last_mtime = statbuf.st_mtime;
++ atomicinc (__res_initstamp);
++ }
++ __libc_lock_unlock (lock);
+ if (__res_initstamp != resp->_u._ext.initstamp) {
+ if (resp->nscount > 0)
+ __res_iclose (resp, true);
+--
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0021-eglibc-Clear-cache-lines-on-ppc8xx.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0021-eglibc-Clear-cache-lines-on-ppc8xx.patch
new file mode 100644
index 000000000..225f22f01
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0021-eglibc-Clear-cache-lines-on-ppc8xx.patch
@@ -0,0 +1,83 @@
+From b74e34e6f53816ad57b13ba6fd70a97db1bc1eae 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 21/24] 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 c2504ff..d50f1cb 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 209a16d..5d8572d 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.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0022-eglibc-Resolve-__fpscr_values-on-SH4.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0022-eglibc-Resolve-__fpscr_values-on-SH4.patch
new file mode 100644
index 000000000..88b20f67a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0022-eglibc-Resolve-__fpscr_values-on-SH4.patch
@@ -0,0 +1,56 @@
+From 8f483cb1f21ab6431ff99e8d30d56b91607ae918 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 22/24] 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 e0938c4..ca1d7da 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 a02b7e2..b9be326 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.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0023-eglibc-Install-PIC-archives.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0023-eglibc-Install-PIC-archives.patch
new file mode 100644
index 000000000..d95ea3ba3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0023-eglibc-Install-PIC-archives.patch
@@ -0,0 +1,123 @@
+From 58d424884eed7efde6c90af0cd7c6c37cf9b444a 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 23/24] 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 fa24030..1ff4634 100644
+--- a/Makerules
++++ b/Makerules
+@@ -694,6 +694,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)
+@@ -936,6 +939,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)
+@@ -964,6 +968,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
+@@ -1206,9 +1226,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: \
+@@ -1221,6 +1254,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.
+@@ -1230,7 +1267,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.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0025-eglibc-Forward-port-cross-locale-generation-support.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0025-eglibc-Forward-port-cross-locale-generation-support.patch
new file mode 100644
index 000000000..68d11192a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0025-eglibc-Forward-port-cross-locale-generation-support.patch
@@ -0,0 +1,566 @@
+From a5695930aec68b3f501e475d8705cddbb63f695e 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 25/25] 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 75afbe1..d32523b 100644
+--- a/locale/Makefile
++++ b/locale/Makefile
+@@ -25,7 +25,8 @@ include ../Makeconfig
+ headers = locale.h bits/locale.h langinfo.h xlocale.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 0000000..9fad357
+--- /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 789da44..4ac9249 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 cf7adea..ef3b811 100644
+--- a/locale/programs/charmap-dir.c
++++ b/locale/programs/charmap-dir.c
+@@ -19,7 +19,9 @@
+ #include <error.h>
+ #include <fcntl.h>
+ #include <libintl.h>
++#ifndef NO_UNCOMPRESS
+ #include <spawn.h>
++#endif
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -156,6 +158,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
+@@ -204,6 +207,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 *
+@@ -226,6 +230,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)
+@@ -235,6 +240,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 dc0fe30..3c88c6d 100644
+--- a/locale/programs/ld-collate.c
++++ b/locale/programs/ld-collate.c
+@@ -350,7 +350,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)
+@@ -1776,8 +1776,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)
+ {
+@@ -2010,9 +2009,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))
+ {
+@@ -2036,9 +2035,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 3f464ef..b7b6b51 100644
+--- a/locale/programs/ld-ctype.c
++++ b/locale/programs/ld-ctype.c
+@@ -926,7 +926,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);
+@@ -1937,7 +1937,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;
+ }
+@@ -2471,8 +2471,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;
+
+@@ -3929,8 +3929,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;
+@@ -3967,11 +3966,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
+@@ -3995,18 +3994,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 db490c6..75dc505 100644
+--- a/locale/programs/ld-time.c
++++ b/locale/programs/ld-time.c
+@@ -215,8 +215,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;
+ }
+ }
+
+@@ -226,7 +228,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
+@@ -464,18 +466,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 =
+@@ -530,7 +532,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 2e05130..653b68c 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 fd6ca51..328d36c 100644
+--- a/locale/programs/localedef.c
++++ b/locale/programs/localedef.c
+@@ -114,6 +114,7 @@ void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
+ #define OPT_LIST_ARCHIVE 309
+ #define OPT_LITTLE_ENDIAN 400
+ #define OPT_BIG_ENDIAN 401
++#define OPT_UINT32_ALIGN 402
+
+ /* Definitions of arguments for argp functions. */
+ static const struct argp_option options[] =
+@@ -150,6 +151,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 }
+ };
+
+@@ -239,12 +242,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)
+ WITH_CUR_LOCALE (error (3, 0, _("\
+ FATAL: system does not define `_POSIX2_LOCALEDEF'")));
++#endif
+
+ /* Process charmap file. */
+ charmap = charmap_read (charmap_file, verbose, 1, be_quiet, 1);
+@@ -338,6 +343,9 @@ parse_opt (int key, char *arg, struct argp_state *state)
+ case OPT_BIG_ENDIAN:
+ set_big_endian (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 33da52e..f790c4c 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 6fc441b..118b171 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 ead030d..b551332 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.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0026-When-disabling-SSE-make-sure-fpmath-is-not-set-to-us.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0026-When-disabling-SSE-make-sure-fpmath-is-not-set-to-us.patch
new file mode 100644
index 000000000..2b889a94c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/0026-When-disabling-SSE-make-sure-fpmath-is-not-set-to-us.patch
@@ -0,0 +1,48 @@
+From 97fe7f1b23ea1f17533884b8fa7f7eb40087d558 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 5 Jan 2016 17:50:00 -0800
+Subject: [PATCH] When disabling SSE, make sure -fpmath is not set to use SSE
+ either
+
+This fixes errors when we inject sse options through CFLAGS and now
+that we have -Werror turned on by default this warning turns to become
+error on x86
+
+gcc -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -x c /dev/null -S
+-mno-sse -mno-mmx
+
+generates warning
+/dev/null:1:0: warning: SSE instruction set disabled, using 387
+arithmetics
+
+where as
+
+gcc -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -x c /dev/null -S
+-mno-sse -mno-mmx -mfpmath=387
+
+Generates no warnings
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ ChangeLog | 5 +++++
+ sysdeps/i386/Makefile | 2 +-
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/sysdeps/i386/Makefile b/sysdeps/i386/Makefile
+index 168512f..70153b3 100644
+--- a/sysdeps/i386/Makefile
++++ b/sysdeps/i386/Makefile
+@@ -89,7 +89,7 @@ ifeq ($(subdir),elf)
+ # the first 3 mm/xmm/ymm/zmm registers are used to pass vector parameters
+ # which must be preserved.
+ CFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
+- -mno-sse -mno-mmx)
++ -mno-sse -mno-mmx -mfpmath=387)
+
+ tests-special += $(objpfx)tst-ld-sse-use.out
+ $(objpfx)tst-ld-sse-use.out: ../sysdeps/i386/tst-ld-sse-use.sh $(objpfx)ld.so
+--
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/etc/ld.so.conf b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/etc/ld.so.conf
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/etc/ld.so.conf
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/generate-supported.mk b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc/generate-supported.mk
new file mode 100644
index 000000000..d2a28c2dc
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/glibc/glibc_2.23.bb b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc_2.23.bb
new file mode 100644
index 000000000..18f40660e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/glibc_2.23.bb
@@ -0,0 +1,133 @@
+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"
+
+SRCREV ?= "e742928c1592b43db6809db4f39e67be151cdd27"
+
+SRCBRANCH ?= "release/${PV}/master"
+
+GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git"
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+(\.\d+)*)"
+
+SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
+ 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-Make-ld-version-output-matching-grok-gold-s-output.patch \
+ file://0013-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch \
+ file://0014-Add-unused-attribute.patch \
+ file://0015-yes-within-the-path-sets-wrong-config-variables.patch \
+ file://0016-timezone-re-written-tzselect-as-posix-sh.patch \
+ file://0017-Remove-bash-dependency-for-nscd-init-script.patch \
+ file://0018-eglibc-Cross-building-and-testing-instructions.patch \
+ file://0019-eglibc-Help-bootstrap-cross-toolchain.patch \
+ file://0020-eglibc-cherry-picked-from.patch \
+ file://0021-eglibc-Clear-cache-lines-on-ppc8xx.patch \
+ file://0022-eglibc-Resolve-__fpscr_values-on-SH4.patch \
+ file://0023-eglibc-Install-PIC-archives.patch \
+ file://0025-eglibc-Forward-port-cross-locale-generation-support.patch \
+ file://0026-When-disabling-SSE-make-sure-fpmath-is-not-set-to-us.patch \
+"
+
+SRC_URI += "\
+ file://etc/ld.so.conf \
+ file://generate-supported.mk \
+"
+
+SRC_URI_append_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 \
+"
+
+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 = " _ER _ET so_ET yn_ER sid_ET tr_TR mn_MN gez_ET gez_ER bn_BD te_IN es_CR.ISO-8859-1"
+
+#
+# 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"
+COMPATIBLE_HOST_libc-uclibc_class-target = "null"
+
+EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
+ --without-cvs --disable-profile \
+ --disable-debug --without-gd \
+ --enable-clocale=gnu \
+ --enable-add-ons \
+ --with-headers=${STAGING_INCDIR} \
+ --without-selinux \
+ --enable-obsolete-rpc \
+ ${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/import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/32and64bit.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/32and64bit.patch
new file mode 100644
index 000000000..cdfeaeadd
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/README b/import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/README
new file mode 100644
index 000000000..43fb98372
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/add-64-bit-flag-for-ELF64-entries.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling.patch
new file mode 100644
index 000000000..7f8e4db78
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling_fix.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endianess-header.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endianess-header.patch
new file mode 100644
index 000000000..a18b2c20d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/flag_fix.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/flag_fix.patch
new file mode 100644
index 000000000..4e9aab941
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-default-to-all-multilib-dirs.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2 b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig.patch b/import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig.patch
new file mode 100644
index 000000000..52986e61c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native_2.12.1.bb b/import-layers/yocto-poky/meta/recipes-core/glibc/ldconfig-native_2.12.1.bb
new file mode 100644
index 000000000..93c0b1867
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/glibc/site_config/funcs b/import-layers/yocto-poky/meta/recipes-core/glibc/site_config/funcs
new file mode 100644
index 000000000..ccc85392d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/glibc/site_config/headers b/import-layers/yocto-poky/meta/recipes-core/glibc/site_config/headers
new file mode 100644
index 000000000..609ab5379
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/glibc/site_config/headers
@@ -0,0 +1,156 @@
+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
+crypt.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/import-layers/yocto-poky/meta/recipes-core/glibc/site_config/types b/import-layers/yocto-poky/meta/recipes-core/glibc/site_config/types
new file mode 100644
index 000000000..178bd85a0
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/ifupdown/files/99_network b/import-layers/yocto-poky/meta/recipes-core/ifupdown/files/99_network
new file mode 100644
index 000000000..42d5895d7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/ifupdown/files/99_network
@@ -0,0 +1 @@
+d root root 0755 /run/network none
diff --git a/import-layers/yocto-poky/meta/recipes-core/ifupdown/files/defn2-c-man-don-t-rely-on-dpkg-architecture-to-set-a.patch b/import-layers/yocto-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..8c4d953a2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/ifupdown/files/defn2-c-man-don-t-rely-on-dpkg-architecture-to-set-a.patch
@@ -0,0 +1,56 @@
+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>
+---
+ 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/import-layers/yocto-poky/meta/recipes-core/ifupdown/files/inet-6-.defn-fix-inverted-checks-for-loopback.patch b/import-layers/yocto-poky/meta/recipes-core/ifupdown/files/inet-6-.defn-fix-inverted-checks-for-loopback.patch
new file mode 100644
index 000000000..bff352e3a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/ifupdown/files/inet-6-.defn-fix-inverted-checks-for-loopback.patch
@@ -0,0 +1,103 @@
+From 74152ac74a3e1ea0f3be292aa1eeca5ad1fe69c0 Mon Sep 17 00:00:00 2001
+From: Paul Gortmaker <paul.gortmaker@windriver.com>
+Date: Wed, 6 Aug 2014 15:12:11 -0400
+Subject: [PATCH 2/2] 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:~#
+
+Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
+---
+ inet.defn | 12 ++++++------
+ inet6.defn | 8 ++++----
+ 2 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/inet.defn b/inet.defn
+index b176ab4ed03e..5fdfb14a0e1c 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
+- ip link set dev %iface% up if (!iface_is_lo())
++ ip link set dev %iface% up if (iface_is_lo())
+
+ down
+- ip link set dev %iface% down if (!iface_is_lo())
++ ip link set dev %iface% down if (iface_is_lo())
+
+ method static
+ description
+@@ -212,11 +212,11 @@ method loopback
+
+ up
+ ifconfig %iface% 127.0.0.1 up \
+- if (!iface_is_lo())
++ if (iface_is_lo())
+
+ down
+ ifconfig %iface% down \
+- if (!iface_is_lo())
++ if (iface_is_lo())
+
+ method static
+ description
+@@ -371,11 +371,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
+diff --git a/inet6.defn b/inet6.defn
+index 09325539cd01..4df64aff38cc 100644
+--- a/inet6.defn
++++ b/inet6.defn
+@@ -33,11 +33,11 @@ method loopback
+ description
+ This method may be used to define the IPv6 loopback interface.
+ up
+- -ip link set dev %iface% up 2>/dev/null if (!iface_is_lo())
+- -ip addr add dev %iface% ::1 2>/dev/null if (!iface_is_lo())
++ -ip link set dev %iface% up 2>/dev/null if (iface_is_lo())
++ -ip addr add dev %iface% ::1 2>/dev/null if (iface_is_lo())
+ down
+- -ip addr del dev %iface% ::1 2>/dev/null if (!iface_is_lo())
+- -ip link set dev %iface% down 2>/dev/null if (!iface_is_lo())
++ -ip addr del dev %iface% ::1 2>/dev/null if (iface_is_lo())
++ -ip link set dev %iface% down 2>/dev/null if (iface_is_lo())
+
+ method static
+ description
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/ifupdown/ifupdown_0.8.2.bb b/import-layers/yocto-poky/meta/recipes-core/ifupdown/ifupdown_0.8.2.bb
new file mode 100644
index 000000000..732b295b8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/ifupdown/ifupdown_0.8.2.bb
@@ -0,0 +1,51 @@
+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://anonscm.debian.org/git/collab-maint/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 = "05ea2fd4f49bb1201aeef2a42efbcff8f336112f"
+
+EXTRA_OEMAKE = ""
+
+S = "${WORKDIR}/git"
+
+
+inherit update-rc.d 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"
+
+INITSCRIPT_NAME = "ifup"
+INITSCRIPT_PARAMS = "start 39 S . stop 39 0 6 1 ."
diff --git a/import-layers/yocto-poky/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Guest_Additions.txt b/import-layers/yocto-poky/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Guest_Additions.txt
new file mode 100644
index 000000000..e7298f2c3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmx b/import-layers/yocto-poky/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmx
new file mode 100644
index 000000000..6472e8750
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmxf b/import-layers/yocto-poky/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmxf
new file mode 100644
index 000000000..9e941ff2f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/images/build-appliance-image_14.0.0.bb b/import-layers/yocto-poky/meta/recipes-core/images/build-appliance-image_14.0.0.bb
new file mode 100644
index 000000000..bdcb9212d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/images/build-appliance-image_14.0.0.bb
@@ -0,0 +1,120 @@
+SUMMARY = "An image containing the build system itself"
+DESCRIPTION = "An image containing the build system that you can boot and run using either VMware Player or VMware Workstation."
+HOMEPAGE = "http://www.yoctoproject.org/documentation/build-appliance"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+ file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+IMAGE_INSTALL = "packagegroup-core-boot packagegroup-core-ssh-openssh packagegroup-self-hosted kernel-dev kernel-devsrc "
+
+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"
+IMAGE_FSTYPES = "vmdk"
+
+inherit core-image module-base
+
+SRCREV ?= "5f84d6545e6d7a2be8e603a1f4b1afae0dad0a9b"
+SRC_URI = "git://git.yoctoproject.org/poky;branch=krogoth \
+ file://Yocto_Build_Appliance.vmx \
+ file://Yocto_Build_Appliance.vmxf \
+ file://README_VirtualBox_Guest_Additions.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 ${DEPLOY_DIR_IMAGE}/${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/
+
+ # Create a symlink, needed for out-of-tree kernel modules build
+ ln -snr ${IMAGE_ROOTFS}/usr/src/kernel ${IMAGE_ROOTFS}/lib/modules/${KERNEL_VERSION}/build
+
+ echo "/usr/bin" > ${IMAGE_ROOTFS}/home/builder/poky/build/pseudodone
+ echo "INHERIT += \"rm_work\"" >> ${IMAGE_ROOTFS}/home/builder/poky/build/conf/auto.conf
+ mkdir -p ${IMAGE_ROOTFS}/home/builder/pseudo
+ echo "export PSEUDO_PREFIX=/usr" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
+ echo "export PSEUDO_LOCALSTATEDIR=/home/builder/pseudo" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
+ echo "export PSEUDO_LIBDIR=/usr/lib/pseudo/lib64" >> ${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 "# 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 builder.builder ${IMAGE_ROOTFS}/home/builder/pseudo
+
+ 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
+ ln -sr ${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
+}
+
+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 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmdk Yocto_Build_Appliance/Yocto_Build_Appliance.vmdk
+ zip -r ${DEPLOY_DIR_IMAGE}/Yocto_Build_Appliance-${DATETIME}.zip Yocto_Build_Appliance
+ ln -sf Yocto_Build_Appliance-${DATETIME}.zip ${DEPLOY_DIR_IMAGE}/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_vmimg before do_build
+do_bundle_files[nostamp] = "1"
diff --git a/import-layers/yocto-poky/meta/recipes-core/images/core-image-base.bb b/import-layers/yocto-poky/meta/recipes-core/images/core-image-base.bb
new file mode 100644
index 000000000..75a08cfc9
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/images/core-image-minimal-dev.bb b/import-layers/yocto-poky/meta/recipes-core/images/core-image-minimal-dev.bb
new file mode 100644
index 000000000..93ead2055
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/images/core-image-minimal-initramfs.bb b/import-layers/yocto-poky/meta/recipes-core/images/core-image-minimal-initramfs.bb
new file mode 100644
index 000000000..8d7c0d2d3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/images/core-image-minimal-initramfs.bb
@@ -0,0 +1,22 @@
+# 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."
+
+PACKAGE_INSTALL = "initramfs-live-boot initramfs-live-install initramfs-live-install-efi ${VIRTUAL-RUNTIME_base-utils} udev base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
+
+# Do not pollute the initrd image with rootfs features
+IMAGE_FEATURES = ""
+
+export IMAGE_BASENAME = "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"
diff --git a/import-layers/yocto-poky/meta/recipes-core/images/core-image-minimal-mtdutils.bb b/import-layers/yocto-poky/meta/recipes-core/images/core-image-minimal-mtdutils.bb
new file mode 100644
index 000000000..c92234c08
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/images/core-image-minimal.bb b/import-layers/yocto-poky/meta/recipes-core/images/core-image-minimal.bb
new file mode 100644
index 000000000..8dd77b347
--- /dev/null
+++ b/import-layers/yocto-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 ${ROOTFS_PKGMANAGE_BOOTSTRAP} ${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/import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/copyright b/import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/copyright
new file mode 100644
index 000000000..2a8e0d126
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/init b/import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/init
new file mode 100644
index 000000000..fb31c635b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces b/import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces
new file mode 100644
index 000000000..0acf4cf44
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot b/import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot
new file mode 100644
index 000000000..750c0a98f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm/interfaces b/import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm/interfaces
new file mode 100644
index 000000000..16967763e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm64/interfaces b/import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm64/interfaces
new file mode 100644
index 000000000..16967763e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv6/interfaces b/import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv6/interfaces
new file mode 100644
index 000000000..16967763e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv7/interfaces b/import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv7/interfaces
new file mode 100644
index 000000000..16967763e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips/interfaces b/import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips/interfaces
new file mode 100644
index 000000000..f62b9a897
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips64/interfaces b/import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips64/interfaces
new file mode 100644
index 000000000..f62b9a897
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuppc/interfaces b/import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuppc/interfaces
new file mode 100644
index 000000000..f62b9a897
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemush4/interfaces b/import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemush4/interfaces
new file mode 100644
index 000000000..f62b9a897
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86-64/interfaces b/import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86-64/interfaces
new file mode 100644
index 000000000..f62b9a897
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86/interfaces b/import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86/interfaces
new file mode 100644
index 000000000..f62b9a897
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb b/import-layers/yocto-poky/meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb
new file mode 100644
index 000000000..733ae41f2
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-boot.sh b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-boot.sh
new file mode 100644
index 000000000..e82eba025
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh
new file mode 100644
index 000000000..b56210915
--- /dev/null
+++ b/import-layers/yocto-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
+ GUMMIBOOT_CFGS="/ssd/loader/entries/*.conf"
+ # copy config files for gummiboot
+ 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" $GUMMIBOOT_CFGS
+ # delete any LABEL= strings
+ sed -i "s/ LABEL=[^ ]*/ /" $GUMMIBOOT_CFGS
+ # delete any root= strings
+ sed -i "s/ root=[^ ]*/ /" $GUMMIBOOT_CFGS
+ # add the root= and other standard boot options
+ sed -i "s@options *@options root=$rootfs rw $rootwait quiet @" $GUMMIBOOT_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/import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-install-efi.sh b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-install-efi.sh
new file mode 100644
index 000000000..d58826a24
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-install-efi.sh
@@ -0,0 +1,255 @@
+#!/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 20 Mb for the boot partition
+boot_size=20
+
+# 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*)
+ ;;
+ *)
+ live_dev_name=${live_dev_name%%[0-9]*}
+ ;;
+esac
+
+echo "Searching for hard drives ..."
+
+for device in `ls /sys/block/`; 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
+ # 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=/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 ]; then
+ cat /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}" ]; then
+ part_prefix="p"
+ 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 ext3 $rootfs_start $rootfs_end
+
+echo "Creating swap partition on $swap"
+parted ${device} mkpart swap linux-swap $swap_start 100%
+
+parted ${device} print
+
+echo "Formatting $bootfs to vfat..."
+mkfs.vfat $bootfs
+
+echo "Formatting $rootfs to ext3..."
+mkfs.ext3 $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
+ # Delete any root= strings
+ sed -i "s/ root=[^ ]*/ /g" $GRUBCFG
+ # Add the root= and other standard boot options
+ sed -i "s@linux /vmlinuz *@linux /vmlinuz root=PARTUUID=$root_part_uuid rw $rootwait quiet @" $GRUBCFG
+fi
+
+if [ -d /run/media/$1/loader ]; then
+ rootuuid=$(blkid -o value -s PARTUUID ${rootfs})
+ GUMMIBOOT_CFGS="/boot/loader/entries/*.conf"
+ # copy config files for gummiboot
+ 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" $GUMMIBOOT_CFGS
+ # delete any LABEL= strings
+ sed -i "s/ LABEL=[^ ]*/ /" $GUMMIBOOT_CFGS
+ # delete any root= strings
+ sed -i "s/ root=[^ ]*/ /" $GUMMIBOOT_CFGS
+ # add the root= and other standard boot options
+ sed -i "s@options *@options root=PARTUUID=$rootuuid rw $rootwait quiet @" $GUMMIBOOT_CFGS
+fi
+
+umount /tgt_root
+
+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/import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-install-testfs.sh b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-install-testfs.sh
new file mode 100644
index 000000000..ac6216052
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-install.sh b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-install.sh
new file mode 100644
index 000000000..c5623eeb2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-install.sh
@@ -0,0 +1,272 @@
+#!/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=20
+
+# 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*)
+ ;;
+ *)
+ live_dev_name=${live_dev_name%%[0-9]*}
+ ;;
+esac
+
+echo "Searching for hard drives ..."
+
+for device in `ls /sys/block/`; 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
+ # 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=/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 ]; then
+ cat /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}" ]; then
+ part_prefix="p"
+ 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 ext3 $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 "Formatting $bootfs to ext3..."
+mkfs.ext3 $bootfs
+
+echo "Formatting $rootfs to ext3..."
+mkfs.ext3 $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
+
+# 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 /vmlinuz 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 /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/import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-live.sh b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-live.sh
new file mode 100644
index 000000000..09fb47991
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/files/init-live.sh
@@ -0,0 +1,230 @@
+#!/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
+ killall "${_UDEV_DAEMON##*/}" 2>/dev/null
+
+ # 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/import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-boot_1.0.bb b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-boot_1.0.bb
new file mode 100644
index 000000000..7ae7969f5
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-framework/debug b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-framework/debug
new file mode 100644
index 000000000..00bfd7d3f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-framework/e2fs b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-framework/e2fs
new file mode 100755
index 000000000..29f801a7b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-framework/finish b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-framework/finish
new file mode 100755
index 000000000..d09bbb8be
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-framework/finish
@@ -0,0 +1,60 @@
+#!/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 [ -n "$bootparam_rootdelay" ]; then
+ debug "Sleeping for $rootdelay second(s) to wait root to settle..."
+ sleep $bootparam_rootdelay
+ 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 [ -e "$bootparam_root" ]; then
+ flags=""
+ if [ -n "$bootparam_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
+ else
+ msg "root '$bootparam_root' doesn't exist."
+ fi
+ fi
+
+ 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/import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-framework/init b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-framework/init
new file mode 100755
index 000000000..204f2379a
--- /dev/null
+++ b/import-layers/yocto-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 and /var/lock
+mkdir -p /proc /sys /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/import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-framework/mdev b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-framework/mdev
new file mode 100644
index 000000000..a5df1d717
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-framework/mdev
@@ -0,0 +1,30 @@
+#!/bin/sh
+# Copyright (C) 2011 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/import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-framework/udev b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-framework/udev
new file mode 100644
index 000000000..79c886782
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb
new file mode 100644
index 000000000..0664a95c9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb
@@ -0,0 +1,66 @@
+SUMMARY = "Modular initramfs system"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_base-utils}"
+
+PR = "r2"
+
+inherit allarch
+
+SRC_URI = "file://init \
+ 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}/finish ${D}/init.d/99-finish
+
+ # 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-mdev \
+ initramfs-module-udev \
+ initramfs-module-e2fs \
+ initramfs-module-debug"
+
+FILES_${PN}-base = "/init /init.d/99-finish /dev"
+
+SUMMARY_initramfs-module-mdev = "initramfs support for mdev"
+RDEPENDS_initramfs-module-mdev = "${PN}-base"
+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-debug = "initramfs dynamic debug support"
+RDEPENDS_initramfs-module-debug = "${PN}-base"
+FILES_initramfs-module-debug = "/init.d/00-debug"
diff --git a/import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
new file mode 100644
index 000000000..57b30254a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-live-install-efi-testfs_1.0.bb b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-live-install-efi-testfs_1.0.bb
new file mode 100644
index 000000000..c03bd2d76
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bb b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bb
new file mode 100644
index 000000000..32c1fce76
--- /dev/null
+++ b/import-layers/yocto-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"
+
+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).*-linux"
diff --git a/import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-live-install-testfs_1.0.bb b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-live-install-testfs_1.0.bb
new file mode 100644
index 000000000..937bfd4d3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb b/import-layers/yocto-poky/meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb
new file mode 100644
index 000000000..88b3b3019
--- /dev/null
+++ b/import-layers/yocto-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"
+
+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).*-linux"
diff --git a/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/GPLv2.patch b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/GPLv2.patch
new file mode 100644
index 000000000..1ee8181f1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/arm/alignment.sh b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/arm/alignment.sh
new file mode 100644
index 000000000..b577b9a03
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/banner.sh b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/banner.sh
new file mode 100644
index 000000000..9e2b09125
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
new file mode 100755
index 000000000..df553bc07
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/checkfs.sh b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/checkfs.sh
new file mode 100755
index 000000000..62869451b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh
new file mode 100755
index 000000000..dfee2afaa
--- /dev/null
+++ b/import-layers/yocto-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"
+swapon -a 2> /dev/null
+
+#
+# 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/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/devpts b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/devpts
new file mode 100644
index 000000000..4a0978b40
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/devpts.sh b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/devpts.sh
new file mode 100755
index 000000000..c6043fb1e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh
new file mode 100644
index 000000000..a97b0681e
--- /dev/null
+++ b/import-layers/yocto-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 [ -f /usr/sbin/logrotate ]; then
+ logrotate -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/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/functions b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/functions
new file mode 100755
index 000000000..01ad1edd3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/halt b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/halt
new file mode 100755
index 000000000..a56f73421
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/hostname.sh b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/hostname.sh
new file mode 100755
index 000000000..95287cc13
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/logrotate-dmesg.conf b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/logrotate-dmesg.conf
new file mode 100644
index 000000000..6f46e4216
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/mountall.sh b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/mountall.sh
new file mode 100755
index 000000000..94bae420c
--- /dev/null
+++ b/import-layers/yocto-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.
+#
+swapon -a 2> /dev/null
+
+: exit 0
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh
new file mode 100755
index 000000000..fe6c19605
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
new file mode 100755
index 000000000..ce4622a5e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
@@ -0,0 +1,232 @@
+#!/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="
+ touch \"$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
+ # 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\")\" != \"\$(readlink -f \"$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} | grep -v "^#" | \
+ while read LINE; do
+ eval `echo "$LINE" | sed -n "s/\(.*\)\ \(.*\) \(.*\)\ \(.*\)\ \(.*\)\ \(.*\)/TTYPE=\1 ; TUSER=\2; TGROUP=\3; TMODE=\4; TNAME=\5 TLTARGET=\6/p"`
+ 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}-."
+ create_file "${TNAME}" &
+ ;;
+ "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/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh
new file mode 100644
index 000000000..1a0328d63
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/reboot b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/reboot
new file mode 100755
index 000000000..087d8d5da
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/rmnologin.sh b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/rmnologin.sh
new file mode 100755
index 000000000..76de3418a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
new file mode 100644
index 000000000..1632a5f64
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/sendsigs b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/sendsigs
new file mode 100755
index 000000000..34e1b7714
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/single b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/single
new file mode 100755
index 000000000..da82d178a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/sushell b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/sushell
new file mode 100644
index 000000000..c319d95bf
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh
new file mode 100644
index 000000000..0a52c90da
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh
@@ -0,0 +1,27 @@
+#!/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 /dev/zero ] && [ -e /dev ] && grep -q devtmpfs /proc/filesystems; then
+ mount -n -t devtmpfs devtmpfs /dev
+fi
diff --git a/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/umountfs b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/umountfs
new file mode 100755
index 000000000..61324c630
--- /dev/null
+++ b/import-layers/yocto-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..."
+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/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/umountnfs.sh b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/umountnfs.sh
new file mode 100755
index 000000000..af075407f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/urandom b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/urandom
new file mode 100755
index 000000000..af1625b5f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/volatiles b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/volatiles
new file mode 100644
index 000000000..297245d0e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts-1.0/volatiles
@@ -0,0 +1,36 @@
+# This configuration file lists filesystem objects that should get verified
+# during startup and be created if missing.
+#
+# Every line must either be a comment starting with #
+# or a definition of format:
+# <type> <owner> <group> <mode> <path> <linksource>
+# where the items are separated by whitespace !
+#
+# <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/log /var/volatile/log
+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/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts_1.0.bb b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts_1.0.bb
new file mode 100644
index 000000000..148491fb2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/initscripts/initscripts_1.0.bb
@@ -0,0 +1,182 @@
+SUMMARY = "SysV init scripts"
+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 = ""
+
+inherit update-alternatives
+DEPENDS_append = " update-rc.d-native"
+DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
+
+PACKAGES =+ "${PN}-functions"
+RDEPENDS_${PN} = "${PN}-functions \
+ ${@bb.utils.contains('DISTRO_FEATURES','selinux','bash','',d)} \
+ "
+FILES_${PN}-functions = "${sysconfdir}/init.d/functions*"
+
+ALTERNATIVE_PRIORITY_${PN}-functions = "90"
+ALTERNATIVE_${PN}-functions = "functions"
+ALTERNATIVE_LINK_NAME[functions] = "${sysconfdir}/init.d/functions"
+
+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
+ 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 55 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 38 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/import-layers/yocto-poky/meta/recipes-core/kbd/kbd_2.0.3.bb b/import-layers/yocto-poky/meta/recipes-core/kbd/kbd_2.0.3.bb
new file mode 100644
index 000000000..858dc0566
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/kbd/kbd_2.0.3.bb
@@ -0,0 +1,35 @@
+SUMMARY = "Keytable files and keyboard utilities"
+# everything minus console-fonts is GPLv2+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a5fcc36121d93e1f69d96a313078c8b5"
+DEPENDS = "libcheck"
+
+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 \
+ "
+
+SRC_URI[md5sum] = "231b46e7142eb41ea3ae06d2ded3c208"
+SRC_URI[sha256sum] = "7a899de1c0eb75f3aea737095a736f2375e1cbfbe693fc14a3fe0bfb4649fb5e"
+
+PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
+PACKAGECONFIG[pam] = "--enable-vlock, --disable-vlock, libpam,"
+
+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"
+
+inherit update-alternatives
+
+ALTERNATIVE_${PN} = "chvt deallocvt fgconsole openvt"
+ALTERNATIVE_PRIORITY = "100"
+
+BBCLASSEXTEND = "native"
+PARALLEL_MAKEINST = ""
diff --git a/import-layers/yocto-poky/meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch b/import-layers/yocto-poky/meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch
new file mode 100644
index 000000000..65f4ef9a5
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/libcgroup/libcgroup_0.41.bb b/import-layers/yocto-poky/meta/recipes-core/libcgroup/libcgroup_0.41.bb
new file mode 100644
index 000000000..95979630a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/libcgroup/libcgroup_0.41.bb
@@ -0,0 +1,43 @@
+SUMMARY = "Linux control group abstraction library"
+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 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
+
+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"
+
+EXTRA_OECONF = "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--enable-pam-module-dir=${base_libdir}/security --enable-pam=yes', '--enable-pam=no', d)}"
+
+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}/
+ rel_lib_prefix=`echo ${libdir} | sed 's,\(^/\|\)[^/][^/]*,..,g'`
+ ln -sf ${rel_lib_prefix}${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/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/ansidecl.patch b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/ansidecl.patch
new file mode 100644
index 000000000..1085c680b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/configure.ac-fix-cross-compiling-warning.patch b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/configure.ac-fix-cross-compiling-warning.patch
new file mode 100644
index 000000000..2f8079b05
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/configure.ac-fix-cross-compiling-warning.patch
@@ -0,0 +1,45 @@
+configure.ac: fix cross compiling warning
+
+There is a warning while cross compiling which triggered a
+failure by do_qa_configure
+...
+|configure:12652: checking for gzread in -lz
+|configure:12677: mips-poky-linux-gcc -meb -mabi=32 -mhard-float
+ -L/lib conftest.c -lz >&5
+|ld: warning: library search path "/lib" is unsafe for cross-compilation
+...
+
+While do the lib checking, do not add '-L${Z_DIR}/lib' to LDFLAGS could fix it.
+
+Upstream-Status: Inappropriate [oe specific]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure.ac | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 9a90600..0bac8a4 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -391,8 +391,6 @@ if test "$with_zlib" = "no"; then
+ echo "Disabling compression support"
+ else
+ AC_CHECK_HEADERS(zlib.h,
+- [SAVE_LDFLAGS="${LDFLAGS}"
+- LDFLAGS="-L${Z_DIR}/lib"
+ AC_CHECK_LIB(z, gzread,[
+ AC_DEFINE([HAVE_LIBZ], [1], [Have compression library])
+ WITH_ZLIB=1
+@@ -406,8 +404,7 @@ else
+ esac]
+ else
+ Z_LIBS="-lz"
+- fi])
+- LDFLAGS="${SAVE_LDFLAGS}"])
++ fi]))
+ fi
+
+ AC_SUBST(Z_CFLAGS)
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/libxml-64bit.patch b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/libxml-64bit.patch
new file mode 100644
index 000000000..1147017b6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/libxml-m4-use-pkgconfig.patch b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/libxml-m4-use-pkgconfig.patch
new file mode 100644
index 000000000..327716561
--- /dev/null
+++ b/import-layers/yocto-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 occured. 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/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/python-sitepackages-dir.patch b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/python-sitepackages-dir.patch
new file mode 100644
index 000000000..e83c8325e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/run-ptest b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/run-ptest
new file mode 100644
index 000000000..473d0b67a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+make -k runtests
diff --git a/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/runtest.patch b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/runtest.patch
new file mode 100644
index 000000000..397ab20c3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2/runtest.patch
@@ -0,0 +1,820 @@
+Add 'install-ptest' rule.
+Print a standard result line for each test.
+
+Signed-off-by: Mihaela Sendrea <mihaela.sendrea@enea.com>
+Upstream-Status: Pending
+
+diff -uNr a/Makefile.am b/Makefile.am
+--- a/Makefile.am 2013-04-17 14:51:42.633386477 +0200
++++ b/Makefile.am 2013-04-19 14:47:51.544720568 +0200
+@@ -202,10 +202,19 @@
+ #testOOM_DEPENDENCIES = $(DEPS)
+ #testOOM_LDADD= $(LDADDS)
+
++install-ptest:
++ @(if [ -d .libs ] ; then cd .libs; fi; \
++ install $(noinst_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:
+ [ -d test ] || $(LN_S) $(srcdir)/test .
+ [ -d result ] || $(LN_S) $(srcdir)/result .
+- $(CHECKER) ./runtest$(EXEEXT) && $(CHECKER) ./testrecurse$(EXEEXT) &&$(CHECKER) ./testapi$(EXEEXT) && $(CHECKER) ./testchar$(EXEEXT)&& $(CHECKER) ./testdict$(EXEEXT) && $(CHECKER) ./runxmlconf$(EXEEXT)
++ ./runtest$(EXEEXT) ; ./testrecurse$(EXEEXT) ; ./testapi$(EXEEXT) ; ./testchar$(EXEEXT) ; ./testdict$(EXEEXT) ; ./runxmlconf$(EXEEXT)
+ @(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; \
+ $(MAKE) tests ; fi)
+
+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/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2_2.9.3.bb b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2_2.9.3.bb
new file mode 100644
index 000000000..9c9873fbd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/libxml/libxml2_2.9.3.bb
@@ -0,0 +1,74 @@
+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"
+
+SRC_URI = "ftp://xmlsoft.org/libxml2/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://configure.ac-fix-cross-compiling-warning.patch \
+ "
+
+SRC_URI[libtar.md5sum] = "daece17e045f1c107610e137ab50c179"
+SRC_URI[libtar.sha256sum] = "4de9e31f46b44d34871c22f54bfc54398ef124d6f7cafb1f4a5958fbcd3ba12d"
+SRC_URI[testtar.md5sum] = "ae3d1ebe000a3972afa104ca7f0e1b4a"
+SRC_URI[testtar.sha256sum] = "96151685cec997e1f9f3387e3626d61e6284d4d6e66e0e440c209286c03e9cc7"
+
+BINCONFIG = "${bindir}/xml2-config"
+
+inherit autotools pkgconfig binconfig-disabled pythonnative ptest
+
+RDEPENDS_${PN}-ptest += "python-core"
+
+RDEPENDS_${PN}-python += "python-core"
+
+RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-gconv-ebcdic-us glibc-gconv-ibm1141"
+
+export PYTHON_SITE_PACKAGES="${PYTHON_SITEPACKAGES_DIR}"
+
+PACKAGECONFIG ??= "python"
+PACKAGECONFIG[python] = "--with-python=${PYTHON},--without-python,python"
+
+# WARNING: zlib is require 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"
+
+# required for python binding
+export HOST_SYS
+export BUILD_SYS
+export STAGING_LIBDIR
+export STAGING_INCDIR
+
+python populate_packages_prepend () {
+ # autonamer would call this libxml2-2, but we don't want that
+ if d.getVar('DEBIAN_NAMES', True):
+ 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_install_ptest () {
+ cp -r ${WORKDIR}/xmlconf ${D}${PTEST_PATH}
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-core/meta/buildtools-tarball.bb b/import-layers/yocto-poky/meta/recipes-core/meta/buildtools-tarball.bb
new file mode 100644
index 000000000..e9578cac0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/meta/buildtools-tarball.bb
@@ -0,0 +1,72 @@
+DESCRIPTION = "SDK type target for building a standalone tarball containing python, 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"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+ file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+TOOLCHAIN_TARGET_TASK ?= ""
+
+TOOLCHAIN_HOST_TASK ?= "\
+ nativesdk-python-core \
+ nativesdk-python-modules \
+ nativesdk-python-misc \
+ nativesdk-python-git \
+ nativesdk-python-pexpect \
+ 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 \
+ "
+
+SDK_PACKAGE_ARCHS += "buildtools-dummy-${SDKPKGSUFFIX}"
+
+TOOLCHAIN_OUTPUTNAME ?= "${SDK_NAME}-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
+
+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/import-layers/yocto-poky/meta/recipes-core/meta/meta-environment-extsdk.bb b/import-layers/yocto-poky/meta/recipes-core/meta/meta-environment-extsdk.bb
new file mode 100644
index 000000000..d9e596143
--- /dev/null
+++ b/import-layers/yocto-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}/${@os.path.relpath(d.getVar('STAGING_DIR_TARGET', True), d.getVar('TOPDIR', True))}
+ local sdkpathnative=${SDKPATH}/${@os.path.relpath(d.getVar('STAGING_DIR_NATIVE',True), d.getVar('TOPDIR', True))}
+
+ toolchain_create_sdk_env_script '' '' $sysroot '' ${bindir_native} ${prefix_native} $sdkpathnative
+}
diff --git a/import-layers/yocto-poky/meta/recipes-core/meta/meta-environment.bb b/import-layers/yocto-poky/meta/recipes-core/meta/meta-environment.bb
new file mode 100644
index 000000000..49d45f6ec
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/meta/meta-environment.bb
@@ -0,0 +1,75 @@
+SUMMARY = "Package of environment files for SDK"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+ file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+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"
+
+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}"
+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', True))
+
+ # make sure we only use the SDKTARGETSYSROOT value from 'd'
+ localdata.setVar('SDKTARGETSYSROOT', d.getVar('SDKTARGETSYSROOT', True))
+ localdata.setVar('libdir', d.getVar('target_libdir', False))
+
+ # Process DEFAULTTUNE
+ bb.build.exec_func("create_sdk_files", localdata)
+
+ variants = d.getVar("MULTILIB_VARIANTS", True) 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.data.update_data(localdata)
+ 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}
+}
+
+do_install() {
+ install -d ${D}/${SDKPATH}
+ install -m 0644 -t ${D}/${SDKPATH} ${SDK_OUTPUT}/${SDKPATH}/*
+}
+
+PN = "meta-environment-${MACHINE}"
+PACKAGES = "${PN}"
+FILES_${PN}= " \
+ ${SDKPATH}/* \
+ "
+
+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"
diff --git a/import-layers/yocto-poky/meta/recipes-core/meta/meta-ide-support.bb b/import-layers/yocto-poky/meta/recipes-core/meta/meta-ide-support.bb
new file mode 100644
index 000000000..86c57cda2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/meta/meta-ide-support.bb
@@ -0,0 +1,16 @@
+SUMMARY = "Integrated Development Environment support"
+DESCRIPTION = "Meta package for ensuring the build directory contains all appropriate toolchain packages for using an IDE"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+ file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+DEPENDS = "virtual/libc gdb-cross-${TARGET_ARCH} qemu-native qemu-helper-native unfs3-native"
+PR = "r3"
+
+inherit meta toolchain-scripts
+
+do_populate_ide_support () {
+ toolchain_create_tree_env_script
+}
+
+addtask populate_ide_support before do_build after do_install
diff --git a/import-layers/yocto-poky/meta/recipes-core/meta/meta-toolchain.bb b/import-layers/yocto-poky/meta/recipes-core/meta/meta-toolchain.bb
new file mode 100644
index 000000000..ba9fd8880
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/meta/meta-toolchain.bb
@@ -0,0 +1,9 @@
+SUMMARY = "Meta package for building a installable toolchain"
+LICENSE = "MIT"
+
+PR = "r7"
+
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+ file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+inherit populate_sdk
diff --git a/import-layers/yocto-poky/meta/recipes-core/meta/meta-world-pkgdata.bb b/import-layers/yocto-poky/meta/recipes-core/meta/meta-world-pkgdata.bb
new file mode 100644
index 000000000..3c5db5001
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/meta/meta-world-pkgdata.bb
@@ -0,0 +1,50 @@
+SUMMARY = "Pulls in pkgdata for world"
+LICENSE = "MIT"
+INHIBIT_DEFAULT_DEPS = "1"
+
+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', True))
+ bb.utils.mkdirhier(outdir)
+ sigfile = os.path.join(outdir, 'locked-sigs-pkgdata.inc')
+ oe.copy_buildsystem.generate_locked_sigs(sigfile, d)
+}
+
+do_fetch[noexec] = "1"
+do_unpack[noexec] = "1"
+do_patch[noexec] = "1"
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+do_install[noexec] = "1"
+
+do_configure[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/import-layers/yocto-poky/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb b/import-layers/yocto-poky/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb
new file mode 100644
index 000000000..2b9611160
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Dummy package which ensures perl is excluded from buildtools"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+inherit allarch
+
+PR = "r2"
+
+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', 'buildtools-dummy-${SDKPKGSUFFIX}')
+}
+
+PERLPACKAGES = "nativesdk-perl \
+ nativesdk-perl-module-file-path"
+
+ALLOW_EMPTY_${PN} = "1"
+
+python populate_packages_prepend() {
+ d.appendVar(d.expand('RPROVIDES_${PN}'), '${PERLPACKAGES}')
+ d.appendVar(d.expand('RCONFLICTS_${PN}'), '${PERLPACKAGES}')
+ d.appendVar(d.expand('RREPLACES_${PN}'), '${PERLPACKAGES}')
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/meta/package-index.bb b/import-layers/yocto-poky/meta/recipes-core/meta/package-index.bb
new file mode 100644
index 000000000..3c46b4997
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/meta/package-index.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Rebuilds the package index"
+LICENSE = "MIT"
+
+INHIBIT_DEFAULT_DEPS = "1"
+PACKAGES = ""
+
+do_fetch[noexec] = "1"
+do_unpack[noexec] = "1"
+do_patch[noexec] = "1"
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+do_install[noexec] = "1"
+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"
+do_populate_sysroot[noexec] = "1"
+
+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/import-layers/yocto-poky/meta/recipes-core/meta/signing-keys.bb b/import-layers/yocto-poky/meta/recipes-core/meta/signing-keys.bb
new file mode 100644
index 000000000..e843301b2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/meta/signing-keys.bb
@@ -0,0 +1,77 @@
+# Copyright (C) 2015 Intel Corporation
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+DESCRIPTION = "Make public keys of the signing keys available"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+ file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+
+inherit allarch deploy
+
+EXCLUDE_FROM_WORLD = "1"
+INHIBIT_DEFAULT_DEPS = "1"
+
+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", True):
+ # Export public key of the rpm signing key
+ signer = get_signer(d, d.getVar('RPM_GPG_BACKEND', True))
+ signer.export_pubkey(os.path.join(d.expand('${B}'), 'rpm-key'),
+ d.getVar('RPM_GPG_NAME', True))
+
+ if d.getVar("IPK_SIGN_PACKAGES", True):
+ # Export public key of the ipk signing key
+ signer = get_signer(d, d.getVar('IPK_GPG_BACKEND', True))
+ signer.export_pubkey(os.path.join(d.expand('${B}'), 'ipk-key'),
+ d.getVar('IPK_GPG_NAME', True))
+
+ if d.getVar('PACKAGE_FEED_SIGN', True) == '1':
+ # Export public key of the feed signing key
+ signer = get_signer(d, d.getVar('PACKAGE_FEED_GPG_BACKEND', True))
+ signer.export_pubkey(os.path.join(d.expand('${B}'), 'pf-key'),
+ d.getVar('PACKAGE_FEED_GPG_NAME', True))
+}
+do_get_public_keys[cleandirs] = "${B}"
+addtask get_public_keys before do_install
+
+do_install () {
+ if [ -f "${B}/rpm-key" ]; then
+ install -D -m 0644 "${B}/rpm-key" "${D}${sysconfdir}/pki/rpm-gpg/RPM-GPG-KEY-${DISTRO_VERSION}"
+ fi
+ if [ -f "${B}/ipk-key" ]; then
+ install -D -m 0644 "${B}/ipk-key" "${D}${sysconfdir}/pki/ipk-gpg/IPK-GPG-KEY-${DISTRO_VERSION}"
+ fi
+ if [ -f "${B}/pf-key" ]; then
+ install -D -m 0644 "${B}/pf-key" "${D}${sysconfdir}/pki/packagefeed-gpg/PACKAGEFEED-GPG-KEY-${DISTRO_VERSION}"
+ fi
+}
+
+sysroot_stage_all_append () {
+ sysroot_stage_dir ${D}${sysconfdir}/pki ${SYSROOT_DESTDIR}${sysconfdir}/pki
+}
+
+do_deploy () {
+ if [ -f "${B}/rpm-key" ]; then
+ install -D -m 0644 "${B}/rpm-key" "${DEPLOYDIR}/RPM-GPG-KEY-${DISTRO_VERSION}"
+ fi
+ if [ -f "${B}/ipk-key" ]; then
+ install -D -m 0644 "${B}/ipk-key" "${DEPLOYDIR}/IPK-GPG-KEY-${DISTRO_VERSION}"
+ fi
+ if [ -f "${B}/pf-key" ]; then
+ install -D -m 0644 "${B}/pf-key" "${DEPLOYDIR}/PACKAGEFEED-GPG-KEY-${DISTRO_VERSION}"
+ 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 is normally put there by deploy.bbclass
+do_deploy[stamp-extra-info] = ""
+addtask deploy after do_get_public_keys
diff --git a/import-layers/yocto-poky/meta/recipes-core/meta/uninative-tarball.bb b/import-layers/yocto-poky/meta/recipes-core/meta/uninative-tarball.bb
new file mode 100644
index 000000000..a983e42c6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/meta/uninative-tarball.bb
@@ -0,0 +1,56 @@
+SUMMARY = "libc and patchelf tarball for use with uninative.bbclass"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+ file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+TOOLCHAIN_TARGET_TASK = ""
+
+# ibm850 - mcopy from mtools
+# iso8859-1 - guile
+TOOLCHAIN_HOST_TASK = "\
+ nativesdk-glibc \
+ nativesdk-glibc-gconv-ibm850 \
+ nativesdk-glibc-gconv-iso8859-1 \
+ nativesdk-patchelf \
+ "
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+TOOLCHAIN_OUTPUTNAME ?= "${SDK_ARCH}-nativesdk-libc"
+
+RDEPENDS = "${TOOLCHAIN_HOST_TASK}"
+
+EXCLUDE_FROM_WORLD = "1"
+
+inherit meta
+inherit populate_sdk
+
+deltask install
+deltask package
+deltask packagedata
+
+SDK_DEPENDS += "patchelf-native"
+
+SDK_PACKAGING_FUNC = ""
+
+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() {
+ mkdir -p ${SDK_DEPLOY}
+ 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 xrange(1024))} $DEST/usr/bin/patchelf
+ mv $DEST/usr/bin/patchelf $DEST/usr/bin/patchelf-uninative
+ tar ${SDKTAROPTS} -c -j --file=${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2 .
+}
diff --git a/import-layers/yocto-poky/meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch b/import-layers/yocto-poky/meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch
new file mode 100644
index 000000000..5490b1cba
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/musl/files/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch
@@ -0,0 +1,34 @@
+From 94c0b97b62125d8bbc92dce0694e387d5b2ad181 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 10 Jan 2016 12:14:02 -0800
+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.
+
+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 b2226fa..0d71f7f 100644
+--- a/Makefile
++++ b/Makefile
+@@ -189,7 +189,7 @@ $(DESTDIR)$(includedir)/%: include/%
+ $(INSTALL) -D -m 644 $< $@
+
+ $(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(libdir)/libc.so
+- $(INSTALL) -D -l $(libdir)/libc.so $@ || true
++ $(INSTALL) -D -l ..$(libdir)/libc.so $@ || true
+
+ install-libs: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(if $(SHARED_LIBS),$(DESTDIR)$(LDSO_PATHNAME),)
+
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/musl/musl.inc b/import-layers/yocto-poky/meta/recipes-core/musl/musl.inc
new file mode 100644
index 000000000..d27867f75
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/musl/musl.inc
@@ -0,0 +1,26 @@
+# 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=082411391b4d1ace0d30f4c84317cc05"
+
+PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
+TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
+STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${TARGET_ARCH}"
+
+
+FILES_SOLIBSDEV = ""
+FILES_${PN} += "${libdir}/lib*${SOLIBSDEV}"
+INSANE_SKIP_${PN} = "dev-so"
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/musl/musl_git.bb b/import-layers/yocto-poky/meta/recipes-core/musl/musl_git.bb
new file mode 100644
index 000000000..d4f98191f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/musl/musl_git.bb
@@ -0,0 +1,61 @@
+# Copyright (C) 2014 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+require musl.inc
+
+SRCREV = "5978eb703ce0e64dd778a88c1ffffb76fe5e2202"
+
+PV = "1.1.14+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"
+
+DEPENDS = "virtual/${TARGET_PREFIX}binutils \
+ virtual/${TARGET_PREFIX}gcc-initial \
+ libgcc-initial \
+ linux-libc-headers \
+ bsd-headers \
+ "
+
+export CROSS_COMPILE="${TARGET_PREFIX}"
+
+EXTRA_OEMAKE = ""
+
+LDFLAGS += "-Wl,-soname,libc.so"
+
+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}
+ ln -s ../../${libdir}/libc.so ${D}${bindir}/ldd
+}
+
+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/import-layers/yocto-poky/meta/recipes-core/ncurses/files/config.cache b/import-layers/yocto-poky/meta/recipes-core/ncurses/files/config.cache
new file mode 100644
index 000000000..6a9217d5b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/ncurses/files/tic-hang.patch b/import-layers/yocto-poky/meta/recipes-core/ncurses/files/tic-hang.patch
new file mode 100644
index 000000000..cba89d26f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/ncurses/files/tic-hang.patch
@@ -0,0 +1,27 @@
+Upstream-Status: Inappropriate [configuration]
+
+'tic' of some linux distributions (e.g. fedora 11) hang in an infinite
+loop when processing the original file.
+
+Index: ncurses-5.7/misc/terminfo.src
+===================================================================
+--- ncurses-5.7.orig/misc/terminfo.src
++++ ncurses-5.7/misc/terminfo.src
+@@ -3706,12 +3706,11 @@ konsole-xf3x|KDE console window with key
+ # 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,
diff --git a/import-layers/yocto-poky/meta/recipes-core/ncurses/ncurses.inc b/import-layers/yocto-poky/meta/recipes-core/ncurses/ncurses.inc
new file mode 100644
index 000000000..ff0117b82
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/ncurses/ncurses.inc
@@ -0,0 +1,310 @@
+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"
+
+inherit autotools binconfig-disabled multilib_header pkgconfig
+
+# Upstream has useful patches at times at ftp://invisible-island.net/ncurses/
+SRC_URI = "git://anonscm.debian.org/collab-maint/ncurses.git"
+
+EXTRA_AUTORECONF = "-I m4"
+CONFIG_SITE =+ "${WORKDIR}/config.cache"
+
+# 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"
+
+# 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 \
+ --disable-static \
+ --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=tinfo \
+ --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
+
+ rm -f ${D}${libdir}/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 ${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 \
+ ${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/import-layers/yocto-poky/meta/recipes-core/ncurses/ncurses_6.0+20160213.bb b/import-layers/yocto-poky/meta/recipes-core/ncurses/ncurses_6.0+20160213.bb
new file mode 100644
index 000000000..0d56481a5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/ncurses/ncurses_6.0+20160213.bb
@@ -0,0 +1,10 @@
+require ncurses.inc
+
+SRC_URI += "file://tic-hang.patch \
+ file://config.cache \
+"
+# commit id corresponds to the revision in package version
+SRCREV = "a25949ff653ac5ae7a204381a3ebfd800feeaa01"
+S = "${WORKDIR}/git"
+EXTRA_OECONF += "--with-abi-version=5"
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+(\+\d+)*)"
diff --git a/import-layers/yocto-poky/meta/recipes-core/ncurses/site_config/headers b/import-layers/yocto-poky/meta/recipes-core/ncurses/site_config/headers
new file mode 100644
index 000000000..087b7bfd5
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/netbase/netbase/hosts b/import-layers/yocto-poky/meta/recipes-core/netbase/netbase/hosts
new file mode 100644
index 000000000..b94f414d5
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/netbase/netbase/netbase-add-rpcbind-as-an-alias-to-sunrpc.patch b/import-layers/yocto-poky/meta/recipes-core/netbase/netbase/netbase-add-rpcbind-as-an-alias-to-sunrpc.patch
new file mode 100644
index 000000000..35ce21e36
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/netbase/netbase/netbase-add-rpcbind-as-an-alias-to-sunrpc.patch
@@ -0,0 +1,44 @@
+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>
+---
+ 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 9d64a52..a19f7c8 100644
+--- a/etc-services
++++ b/etc-services
+@@ -72,8 +72,8 @@ pop2 109/tcp postoffice pop-2 # POP version 2
+ pop2 109/udp pop-2
+ pop3 110/tcp pop-3 # POP version 3
+ pop3 110/udp pop-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
+ uucp-path 117/tcp
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/netbase/netbase_5.3.bb b/import-layers/yocto-poky/meta/recipes-core/netbase/netbase_5.3.bb
new file mode 100644
index 000000000..ccd89ff84
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/netbase/netbase_5.3.bb
@@ -0,0 +1,24 @@
+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 = "${DEBIAN_MIRROR}/main/n/netbase/netbase_${PV}.tar.xz \
+ file://netbase-add-rpcbind-as-an-alias-to-sunrpc.patch \
+ file://hosts"
+
+SRC_URI[md5sum] = "2637a27fd3de02a278d2b5be7e6558c1"
+SRC_URI[sha256sum] = "81f6c69795044d62b8ad959cf9daf049d0545fd466c52860ad3f933b1e97b88b"
+
+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/import-layers/yocto-poky/meta/recipes-core/os-release/os-release.bb b/import-layers/yocto-poky/meta/recipes-core/os-release/os-release.bb
new file mode 100644
index 000000000..f519addd8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/os-release/os-release.bb
@@ -0,0 +1,48 @@
+inherit allarch
+
+SUMMARY = "Operating system identification"
+DESCRIPTION = "The /etc/os-release file contains operating system identification data."
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+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', True).split():
+ value = d.getVar(field, True)
+ 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/import-layers/yocto-poky/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb b/import-layers/yocto-poky/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
new file mode 100644
index 000000000..0c6a530be
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
@@ -0,0 +1,33 @@
+#
+# Copyright (C) 2007 OpenedHand Ltd
+#
+
+SUMMARY = "Host packages for the standalone SDK or external toolchain"
+PR = "r12"
+LICENSE = "MIT"
+
+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-smartpm \
+ nativesdk-postinst-intercept \
+ "
+
+RDEPENDS_${PN}_darwin = "\
+ nativesdk-pkgconfig \
+ nativesdk-opkg \
+ nativesdk-libtool \
+ "
diff --git a/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-base.bb b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-base.bb
new file mode 100644
index 000000000..9e40b2852
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-base.bb
@@ -0,0 +1,369 @@
+SUMMARY = "Merge machine and distro options to create a basic machine task/package"
+LICENSE = "MIT"
+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 \
+ \
+ sysfsutils \
+ 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", True).split())
+ machine_features= set(d.getVar("MACHINE_FEATURES", True).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 \
+ libacpi "
+
+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', 'libasound-module-bluez', '',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} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'pcmcia', 'hostap-utils', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'pci', 'hostap-utils', '',d)} \
+ 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/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-boot.bb b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-boot.bb
new file mode 100644
index 000000000..bac93b89b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-boot.bb
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2007 OpenedHand Ltd.
+#
+
+SUMMARY = "Minimal boot requirements"
+DESCRIPTION = "The minimal set of packages required to boot the system"
+LICENSE = "MIT"
+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"
+
+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)} \
+ 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/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb
new file mode 100644
index 000000000..74ed24751
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb
@@ -0,0 +1,29 @@
+#
+# Copyright (C) 2007 OpenedHand Ltd.
+# Copyright (C) 2012 Red Hat, Inc.
+#
+
+SUMMARY = "Essential build dependencies"
+LICENSE = "MIT"
+
+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/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-eclipse-debug.bb b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-eclipse-debug.bb
new file mode 100644
index 000000000..e7b013d40
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-eclipse-debug.bb
@@ -0,0 +1,10 @@
+SUMMARY = "Remote debugging tools for Eclipse integration"
+LICENSE = "MIT"
+
+inherit packagegroup
+
+RDEPENDS_${PN} = "\
+ gdbserver \
+ tcf-agent \
+ openssh-sftp-server \
+ "
diff --git a/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-nfs.bb b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-nfs.bb
new file mode 100644
index 000000000..1882d3ad1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-nfs.bb
@@ -0,0 +1,21 @@
+#
+# Copyright (C) 2008 OpenedHand Ltd.
+#
+
+SUMMARY = "NFS package groups"
+LICENSE = "MIT"
+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/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
new file mode 100644
index 000000000..bee1665b5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
@@ -0,0 +1,85 @@
+#
+# Copyright (C) 2007 OpenedHand Ltd.
+#
+
+SUMMARY = "Software development tools"
+LICENSE = "MIT"
+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_aarch64 = ""
+SANITIZERS_mips = ""
+SANITIZERS_mips64 = ""
+SANITIZERS_mips64n32 = ""
+SANITIZERS_nios2 = ""
+SANITIZERS_powerpc64 = ""
+SANITIZERS_sparc = ""
+SANITIZERS_libc-musl = ""
+SANITIZERS_libc-uclibc = ""
+
+RRECOMMENDS_packagegroup-core-sdk = "\
+ libgomp \
+ libgomp-dev \
+ ${SANITIZERS}"
+
+#python generate_sdk_pkgs () {
+# poky_pkgs = read_pkgdata('packagegroup-core', d)['PACKAGES']
+# pkgs = d.getVar('PACKAGES', True).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/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-ssh-dropbear.bb b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-ssh-dropbear.bb
new file mode 100644
index 000000000..e99946f0a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-ssh-dropbear.bb
@@ -0,0 +1,7 @@
+SUMMARY = "Dropbear SSH client/server"
+LICENSE = "MIT"
+PR = "r1"
+
+inherit packagegroup
+
+RDEPENDS_${PN} = "dropbear"
diff --git a/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-ssh-openssh.bb b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-ssh-openssh.bb
new file mode 100644
index 000000000..32d20e621
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-ssh-openssh.bb
@@ -0,0 +1,7 @@
+SUMMARY = "OpenSSH SSH client/server"
+LICENSE = "MIT"
+PR = "r1"
+
+inherit packagegroup
+
+RDEPENDS_${PN} = "openssh"
diff --git a/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bb b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bb
new file mode 100644
index 000000000..6997f396b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bb
@@ -0,0 +1,15 @@
+SUMMARY = "Target packages for the standalone SDK"
+PR = "r8"
+LICENSE = "MIT"
+
+inherit packagegroup
+
+RDEPENDS_${PN} = "\
+ libgcc \
+ libgcc-dev \
+ libatomic \
+ libatomic-dev \
+ libstdc++ \
+ libstdc++-dev \
+ ${LIBC_DEPENDENCIES} \
+ "
diff --git a/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-tools-debug.bb b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-tools-debug.bb
new file mode 100644
index 000000000..82347b975
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-tools-debug.bb
@@ -0,0 +1,20 @@
+#
+# Copyright (C) 2008 OpenedHand Ltd.
+#
+
+SUMMARY = "Debugging tools"
+LICENSE = "MIT"
+
+inherit packagegroup
+
+PR = "r3"
+
+MTRACE = ""
+MTRACE_libc-glibc = "libc-mtrace"
+
+RDEPENDS_${PN} = "\
+ gdb \
+ gdbserver \
+ strace \
+ ${MTRACE} \
+ "
diff --git a/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-tools-profile.bb b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-tools-profile.bb
new file mode 100644
index 000000000..ff2b5779a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-tools-profile.bb
@@ -0,0 +1,82 @@
+#
+# Copyright (C) 2008 OpenedHand Ltd.
+#
+
+SUMMARY = "Profiling tools"
+LICENSE = "MIT"
+
+PR = "r3"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup
+
+PROFILE_TOOLS_X = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'sysprof', '', d)}"
+# sysprof doesn't support aarch64
+PROFILE_TOOLS_X_aarch64 = ""
+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 \
+ latencytop \
+ "
+PERF = "perf"
+PERF_libc-musl = ""
+
+# systemtap needs elfutils which is not fully buildable on uclibc
+# hence we exclude it from uclibc based builds
+SYSTEMTAP = "systemtap"
+SYSTEMTAP_libc-uclibc = ""
+SYSTEMTAP_libc-musl = ""
+SYSTEMTAP_mips = ""
+SYSTEMTAP_mips64 = ""
+SYSTEMTAP_mips64n32 = ""
+SYSTEMTAP_nios2 = ""
+SYSTEMTAP_aarch64 = ""
+
+# lttng-ust uses sched_getcpu() which is not there on uclibc
+# for some of the architectures it can be patched to call the
+# syscall directly but for x86_64 __NR_getcpu is a vsyscall
+# which means we can not use syscall() to call it. So we ignore
+# it for x86_64/uclibc
+
+LTTNGUST = "lttng-ust"
+LTTNGUST_libc-uclibc = ""
+LTTNGUST_libc-musl = ""
+
+LTTNGTOOLS = "lttng-tools"
+LTTNGTOOLS_libc-musl = ""
+
+LTTNGMODULES = "lttng-modules"
+
+BABELTRACE = "babeltrace"
+
+# valgrind does not work on mips
+
+VALGRIND = "valgrind"
+VALGRIND_libc-uclibc = ""
+VALGRIND_libc-musl = ""
+VALGRIND_mips = ""
+VALGRIND_mips64 = ""
+VALGRIND_mips64n32 = ""
+VALGRIND_nios2 = ""
+VALGRIND_arm = ""
+VALGRIND_aarch64 = ""
+
+RDEPENDS_${PN} = "\
+ ${PROFILETOOLS} \
+ ${LTTNGUST} \
+ ${LTTNGTOOLS} \
+ ${LTTNGMODULES} \
+ ${BABELTRACE} \
+ ${SYSTEMTAP} \
+ ${VALGRIND} \
+ "
diff --git a/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb
new file mode 100644
index 000000000..e8d585e0b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb
@@ -0,0 +1,53 @@
+#
+# Copyright (C) 2008 OpenedHand Ltd.
+#
+
+SUMMARY = "Testing tools/applications"
+LICENSE = "MIT"
+
+PR = "r2"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup
+
+# kexec-tools doesn't work on e5500-64b and nios2 yet
+KEXECTOOLS ?= "kexec"
+KEXECTOOLS_e5500-64b ?= ""
+KEXECTOOLS_nios2 ?= ""
+
+X11GLTOOLS = "\
+ mesa-demos \
+ piglit \
+ "
+
+3GTOOLS = "\
+ ofono-tests \
+ "
+
+X11TOOLS = "\
+ fstests \
+ gst-player-bin \
+ x11perf \
+ xrestop \
+ xwininfo \
+ xprop \
+ xvideo-tests \
+ "
+
+RDEPENDS_${PN} = "\
+ blktool \
+ tslib-calibrate \
+ tslib-tests \
+ 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/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb
new file mode 100644
index 000000000..180dd96f7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Host SDK package for cross canadian toolchain"
+PN = "packagegroup-cross-canadian-${MACHINE}"
+LICENSE = "MIT"
+
+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/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb
new file mode 100644
index 000000000..225204df1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb
@@ -0,0 +1,200 @@
+#
+# Copyright (C) 2010 Intel Corporation
+#
+
+SUMMARY = "Self-hosting"
+DESCRIPTION = "Packages required to run the build system"
+PR = "r13"
+LICENSE = "MIT"
+
+inherit packagegroup distro_features_check
+# rdepends on libx11-dev
+REQUIRED_DISTRO_FEATURES = "x11"
+
+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 = "\
+ connman \
+ connman-plugin-ethernet \
+ dhcp-client \
+ e2fsprogs \
+ e2fsprogs-e2fsck \
+ e2fsprogs-mke2fs \
+ e2fsprogs-tune2fs \
+ hdparm \
+ iptables \
+ lsb \
+ mc \
+ mc-fish \
+ mc-helpers \
+ mc-helpers-perl \
+ mc-helpers-python \
+ 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 \
+ hicolor-icon-theme \
+ sato-icon-theme \
+ libaio \
+ libusb1 \
+ libxml2 \
+ lrzsz \
+ lsof \
+ lzo \
+ man \
+ man-pages \
+ mdadm \
+ minicom \
+ mtools \
+ ncurses \
+ ncurses-terminfo-base \
+ neon \
+ nfs-utils \
+ nfs-utils-client \
+ openssl \
+ openssh-sftp-server \
+ opkg \
+ opkg-utils \
+ patch \
+ perl \
+ perl-dev \
+ perl-modules \
+ perl-pod \
+ python \
+ python-compiler \
+ python-git \
+ python-misc \
+ python-modules \
+ python-rpm \
+ 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 \
+ gtk-theme-clearlooks \
+ xdg-utils \
+ epiphany \
+ leafpad \
+ pcmanfm \
+ vte \
+ "
diff --git a/import-layers/yocto-poky/meta/recipes-core/psplash/files/psplash-init b/import-layers/yocto-poky/meta/recipes-core/psplash/files/psplash-init
new file mode 100755
index 000000000..66c85e933
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/psplash/files/psplash-init
@@ -0,0 +1,29 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: psplash
+# Required-Start:
+# Required-Stop:
+# Default-Start: S
+# Default-Stop:
+### END INIT INFO
+
+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/import-layers/yocto-poky/meta/recipes-core/psplash/files/psplash-poky-img.h b/import-layers/yocto-poky/meta/recipes-core/psplash/files/psplash-poky-img.h
new file mode 100644
index 000000000..8d56aa020
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/psplash/psplash_git.bb b/import-layers/yocto-poky/meta/recipes-core/psplash/psplash_git.bb
new file mode 100644
index 000000000..053742651
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/psplash/psplash_git.bb
@@ -0,0 +1,121 @@
+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 = "88343ad23c90fa1dd8d79ac0d784a691aa0c6d2b"
+PV = "0.1+git${SRCPV}"
+PR = "r15"
+
+SRC_URI = "git://git.yoctoproject.org/${BPN} \
+ file://psplash-init \
+ ${SPLASH_IMAGES}"
+
+SPLASH_IMAGES = "file://psplash-poky-img.h;outsuffix=default"
+
+python __anonymous() {
+ oldpkgs = d.getVar("PACKAGES", True).split()
+ splashfiles = d.getVar('SPLASH_IMAGES', True).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', True) or ''
+ pn = d.getVar('PN', True) 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', True)
+ convertscript = "%s/make-image-header.sh" % d.getVar('S', True)
+ destfile = "%s/psplash-poky-img.h" % d.getVar('S', True)
+ localfiles = d.getVar('SPLASH_LOCALPATHS', True).split()
+ outputfiles = d.getVar('SPLASH_INSTALL', True).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', True), 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 ."
+
+DEPENDS_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/import-layers/yocto-poky/meta/recipes-core/readline/files/config-dirent-symbols.patch b/import-layers/yocto-poky/meta/recipes-core/readline/files/config-dirent-symbols.patch
new file mode 100644
index 000000000..cfff03c0f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/readline/files/config-dirent-symbols.patch
@@ -0,0 +1,34 @@
+Fix the names of the STRUCT_DIRENT_D symbols to match the names used by both
+configure and the source code.
+
+Upstream-Status: Submitted (http://lists.gnu.org/archive/html/bug-readline/2014-05/msg00008.html)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From e48656811550774892fd4e0f4b3c7d418422da52 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Tue, 27 May 2014 22:32:31 +0100
+Subject: [PATCH] config.h.in: fix names of STRUCT_DIRENT_D symbols
+
+---
+ config.h.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/config.h.in b/config.h.in
+index a67e43e..a42acc5 100644
+--- a/config.h.in
++++ b/config.h.in
+@@ -244,9 +244,9 @@
+
+ #undef HAVE_GETPW_DECLS
+
+-#undef STRUCT_DIRENT_HAS_D_INO
++#undef HAVE_STRUCT_DIRENT_D_INO
+
+-#undef STRUCT_DIRENT_HAS_D_FILENO
++#undef HAVE_STRUCT_DIRENT_D_FILENO
+
+ #undef HAVE_BSD_SIGNALS
+
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/readline/files/inputrc b/import-layers/yocto-poky/meta/recipes-core/readline/files/inputrc
new file mode 100644
index 000000000..b5c4c8af2
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/readline/readline-5.2/configure-fix.patch b/import-layers/yocto-poky/meta/recipes-core/readline/readline-5.2/configure-fix.patch
new file mode 100644
index 000000000..be60a9861
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/readline/readline-5.2/configure-fix.patch
@@ -0,0 +1,26 @@
+Upstream-Status: Pending
+
+Without this it fails to link against libtermcap causing various missing symbols
+issues.
+
+RP - 8/10/08
+
+Index: readline-5.2/configure.in
+===================================================================
+--- readline-5.2.orig/configure.in 2008-10-08 09:58:52.000000000 +0100
++++ readline-5.2/configure.in 2008-10-08 09:59:03.000000000 +0100
+@@ -211,10 +211,10 @@
+ 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)
diff --git a/import-layers/yocto-poky/meta/recipes-core/readline/readline-5.2/fix-redundant-rpath.patch b/import-layers/yocto-poky/meta/recipes-core/readline/readline-5.2/fix-redundant-rpath.patch
new file mode 100644
index 000000000..3166b470f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/readline/readline-5.2/fix-redundant-rpath.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
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: readline-5.2/support/shobj-conf
+===================================================================
+--- readline-5.2.orig/support/shobj-conf
++++ readline-5.2/support/shobj-conf
+@@ -110,7 +110,7 @@ linux*-*|gnu*-*|k*bsd*-gnu-*)
+ 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/import-layers/yocto-poky/meta/recipes-core/readline/readline-6.3/configure-fix.patch b/import-layers/yocto-poky/meta/recipes-core/readline/readline-6.3/configure-fix.patch
new file mode 100644
index 000000000..ef3104f8a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/readline/readline-6.3/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/import-layers/yocto-poky/meta/recipes-core/readline/readline-6.3/norpath.patch b/import-layers/yocto-poky/meta/recipes-core/readline/readline-6.3/norpath.patch
new file mode 100644
index 000000000..5d71582b7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/readline/readline-6.3/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/import-layers/yocto-poky/meta/recipes-core/readline/readline.inc b/import-layers/yocto-poky/meta/recipes-core/readline/readline.inc
new file mode 100644
index 000000000..35df8b4bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/readline/readline.inc
@@ -0,0 +1,42 @@
+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"
+
+# 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}
+
+ install -m 0755 -d ${D}${sysconfdir}
+ install -m 0644 ${WORKDIR}/inputrc ${D}${sysconfdir}/inputrc
+}
+
+BBCLASSEXTEND = "native nativesdk"
+
+CONFFILES_${PN} += "${sysconfdir}/inputrc"
diff --git a/import-layers/yocto-poky/meta/recipes-core/readline/readline_5.2.bb b/import-layers/yocto-poky/meta/recipes-core/readline/readline_5.2.bb
new file mode 100644
index 000000000..c1007a231
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/readline/readline_5.2.bb
@@ -0,0 +1,84 @@
+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"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=03b36fdd84f74b8d8189a202b980b67f"
+
+DEPENDS += "ncurses"
+
+PR = "r9"
+
+SRC_URI = "${GNU_MIRROR}/readline/${BPN}-${PV}.tar.gz;name=archive \
+ ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-001;name=patch1;apply=yes;striplevel=0 \
+ ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-002;name=patch2;apply=yes;striplevel=0 \
+ ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-003;name=patch3;apply=yes;striplevel=0 \
+ ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-004;name=patch4;apply=yes;striplevel=0 \
+ ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-005;name=patch5;apply=yes;striplevel=0 \
+ ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-006;name=patch6;apply=yes;striplevel=0 \
+ ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-007;name=patch7;apply=yes;striplevel=0 \
+ ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-008;name=patch8;apply=yes;striplevel=0 \
+ ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-009;name=patch9;apply=yes;striplevel=0 \
+ ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-010;name=patch10;apply=yes;striplevel=0 \
+ ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-011;name=patch11;apply=yes;striplevel=0 \
+ ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-012;name=patch12;apply=yes;striplevel=0 \
+ ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-013;name=patch13;apply=yes;striplevel=0 \
+ ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-014;name=patch14;apply=yes;striplevel=0 \
+ file://configure-fix.patch \
+ file://config-dirent-symbols.patch \
+ file://fix-redundant-rpath.patch"
+
+SRC_URI[archive.md5sum] = "e39331f32ad14009b9ff49cc10c5e751"
+SRC_URI[archive.sha256sum] = "12e88d96aee2cd1192500356f0535540db499282ca7f76339fb4228c31249f45"
+
+SRC_URI[patch1.md5sum] = "9d4d41622aa9b230c57f68548ce87d8f"
+SRC_URI[patch1.sha256sum] = "eac304c369154059f93049ada328739faaf40338d3cb1fb4b544c93d5ce3f8d5"
+SRC_URI[patch2.md5sum] = "f03e512d14206e37f7d6a748b56b9476"
+SRC_URI[patch2.sha256sum] = "9deacaef25507a0c2ae0b661bf9342559b59a2954d66ea3c5f5bcd900fdfcf78"
+SRC_URI[patch3.md5sum] = "252b42d8750f1a94b6bdf086612dceb2"
+SRC_URI[patch3.sha256sum] = "2a55d2ecb1c9b0147aeb193a6323616ab31c1c525a83b2db3a994b15594ba934"
+SRC_URI[patch4.md5sum] = "a32333c2e603a3ed250514e91050e552"
+SRC_URI[patch4.sha256sum] = "a03b65633781efa7c3aae5d57162985e7b7a3c10acf0f2621be610e16f27e5f2"
+SRC_URI[patch5.md5sum] = "8106796c09b789523a3a78ab69c04b6d"
+SRC_URI[patch5.sha256sum] = "06001896514148a757ea6edbbd40c4fc4331dc653847244386c37b138b150f64"
+SRC_URI[patch6.md5sum] = "512188e2bf0837f7eca19dbf71f182ae"
+SRC_URI[patch6.sha256sum] = "dfef3e982c0adf8bb5a9b7d0468ec8f5f18138b325e28759437464de5be71013"
+SRC_URI[patch7.md5sum] = "ac17aca62eb6fb398c9f2fe9de540aff"
+SRC_URI[patch7.sha256sum] = "775b028c7b761397ac6ae1bdfbac7e896dc3b9b3adc2f91312499180ca13bdd1"
+SRC_URI[patch8.md5sum] = "2484c392db021905f112cf97a94dfd4c"
+SRC_URI[patch8.sha256sum] = "a21b4e0bf0530b878bad24d5be23d18a9e03a75a31ae30844dc0933bb3d77ecd"
+SRC_URI[patch9.md5sum] = "fc6eb35d07914fae5c57d49c12483ff7"
+SRC_URI[patch9.sha256sum] = "138d5e0f0709a47a2d1621295a3dd5e3cc73b63b5cc28dab03abc4e94fe95ecf"
+SRC_URI[patch10.md5sum] = "7a2bf3dc7ac7680b1461a5701100e91b"
+SRC_URI[patch10.sha256sum] = "83f8c1aadb86b1a2fad8821a9c6be72a8de5afd7fd9fde58a30b3b57d939693e"
+SRC_URI[patch11.md5sum] = "ef6cef6822663470f6ac8c517c5a7ec6"
+SRC_URI[patch11.sha256sum] = "08ad3384ab0906e6fa4cc417eb8c43ff59375bcead15fd5c8e31730f0413b3d6"
+SRC_URI[patch12.md5sum] = "e3e9f441c8111589855bc363e5640f6c"
+SRC_URI[patch12.sha256sum] = "20f0243be2299c23213492cc2c19cfd15cc528d2b566a76a2de58306bb9e4c9e"
+SRC_URI[patch13.md5sum] = "3e2e5f543ed268a68fd1fa839faade1a"
+SRC_URI[patch13.sha256sum] = "0cc649516a5bdfa61c5e56937407570288b6972d75aa1bd060ad30ebe98144d5"
+SRC_URI[patch14.md5sum] = "a1be30e1c6f1099bb5fcef00a2631fb8"
+SRC_URI[patch14.sha256sum] = "6f1a68320d01522ca1ea5a737124ecc8739f3dcbfea2dee21e3ccf839a21a817"
+
+inherit autotools
+
+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}
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-core/readline/readline_6.3.bb b/import-layers/yocto-poky/meta/recipes-core/readline/readline_6.3.bb
new file mode 100644
index 000000000..8ec7c4ada
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/readline/readline_6.3.bb
@@ -0,0 +1,34 @@
+require readline.inc
+
+SRC_URI += "${GNU_MIRROR}/readline/readline-6.3-patches/readline63-001;name=patch1;apply=yes;striplevel=0 \
+ ${GNU_MIRROR}/readline/readline-6.3-patches/readline63-002;name=patch2;apply=yes;striplevel=0 \
+ ${GNU_MIRROR}/readline/readline-6.3-patches/readline63-003;name=patch3;apply=yes;striplevel=0 \
+ ${GNU_MIRROR}/readline/readline-6.3-patches/readline63-004;name=patch4;apply=yes;striplevel=0 \
+ ${GNU_MIRROR}/readline/readline-6.3-patches/readline63-005;name=patch5;apply=yes;striplevel=0 \
+ ${GNU_MIRROR}/readline/readline-6.3-patches/readline63-006;name=patch6;apply=yes;striplevel=0 \
+ ${GNU_MIRROR}/readline/readline-6.3-patches/readline63-007;name=patch7;apply=yes;striplevel=0 \
+ ${GNU_MIRROR}/readline/readline-6.3-patches/readline63-008;name=patch8;apply=yes;striplevel=0 \
+ file://configure-fix.patch \
+ file://config-dirent-symbols.patch \
+ file://norpath.patch"
+
+SRC_URI[archive.md5sum] = "33c8fb279e981274f485fd91da77e94a"
+SRC_URI[archive.sha256sum] = "56ba6071b9462f980c5a72ab0023893b65ba6debb4eeb475d7a563dc65cafd43"
+
+SRC_URI[patch1.md5sum] = "4343f5ea9b0f42447f102fb61576b398"
+SRC_URI[patch1.sha256sum] = "1a79bbb6eaee750e0d6f7f3d059b30a45fc54e8e388a8e05e9c3ae598590146f"
+SRC_URI[patch2.md5sum] = "700295212f7e2978577feaee584afddb"
+SRC_URI[patch2.sha256sum] = "39e304c7a526888f9e112e733848215736fb7b9d540729b9e31f3347b7a1e0a5"
+SRC_URI[patch3.md5sum] = "af4963862f5156fbf9111c2c6fa86ed7"
+SRC_URI[patch3.sha256sum] = "ec41bdd8b00fd884e847708513df41d51b1243cecb680189e31b7173d01ca52f"
+SRC_URI[patch4.md5sum] = "11f9def89803a5052db3ba72394ce14f"
+SRC_URI[patch4.sha256sum] = "4547b906fb2570866c21887807de5dee19838a60a1afb66385b272155e4355cc"
+SRC_URI[patch5.md5sum] = "93721c31cd225393f80cb3aadb165544"
+SRC_URI[patch5.sha256sum] = "877788f9228d1a9907a4bcfe3d6dd0439c08d728949458b41208d9bf9060274b"
+SRC_URI[patch6.md5sum] = "71dc6ecce66d1489b96595f55d142a52"
+SRC_URI[patch6.sha256sum] = "5c237ab3c6c97c23cf52b2a118adc265b7fb411b57c93a5f7c221d50fafbe556"
+SRC_URI[patch7.md5sum] = "062a08ed60679d3c4878710b3d595b65"
+SRC_URI[patch7.sha256sum] = "4d79b5a2adec3c2e8114cbd3d63c1771f7c6cf64035368624903d257014f5bea"
+SRC_URI[patch8.md5sum] = "ee1c04072154826870848d8b218d7b04"
+SRC_URI[patch8.sha256sum] = "3bc093cf526ceac23eb80256b0ec87fa1735540d659742107b6284d635c43787"
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/obsolete_automake_macros.patch b/import-layers/yocto-poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/obsolete_automake_macros.patch
new file mode 100644
index 000000000..9d828d702
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/separatebuild.patch b/import-layers/yocto-poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/separatebuild.patch
new file mode 100644
index 000000000..82e725e2a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/sysfsutils-2.0.0-class-dup.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/sysfsutils/sysfsutils_2.1.0.bb b/import-layers/yocto-poky/meta/recipes-core/sysfsutils/sysfsutils_2.1.0.bb
new file mode 100644
index 000000000..f9f067dca
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/systemd/systemd-compat-units.bb b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd-compat-units.bb
new file mode 100644
index 000000000..0b8ff09b2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd-compat-units.bb
@@ -0,0 +1,43 @@
+SUMMARY = "Enhances systemd compatilibity with existing SysVinit scripts"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690"
+
+PR = "r29"
+
+DEPENDS = "systemd-systemctl-native"
+
+S = "${WORKDIR}"
+
+inherit allarch
+
+ALLOW_EMPTY_${PN} = "1"
+
+SYSTEMD_DISABLED_SYSV_SERVICES = " \
+ busybox-udhcpc \
+ hwclock \
+ networking \
+ nfsserver \
+ nfscommon \
+ syslog.busybox \
+"
+
+pkg_postinst_${PN} () {
+ cd $D${sysconfdir}/init.d
+
+ echo "Disabling the following sysv scripts: "
+
+ OPTS=""
+
+ if [ -n "$D" ]; then
+ OPTS="--root=$D"
+ fi
+
+ for i in ${SYSTEMD_DISABLED_SYSV_SERVICES} ; do
+ if [ \( -e $i -o $i.sh \) -a ! \( -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
+}
+
+RDPEPENDS_${PN} = "systemd"
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd-serialgetty.bb b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd-serialgetty.bb
new file mode 100644
index 000000000..768b1308f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd-serialgetty.bb
@@ -0,0 +1,51 @@
+SUMMARY = "Serial terminal support for 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}"
+
+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
+}
+
+RDEPENDS_${PN} = "systemd"
+
+# This is a machine specific file
+FILES_${PN} = "${systemd_unitdir}/system/*.service ${sysconfdir}"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+# As this package is tied to systemd, only build it when we're also building systemd.
+python () {
+ if not bb.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d):
+ raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES")
+}
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service
new file mode 100644
index 000000000..e8b027e97
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/systemd/systemd-systemctl-native.bb b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd-systemctl-native.bb
new file mode 100644
index 000000000..fbdc9c0a1
--- /dev/null
+++ b/import-layers/yocto-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}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690"
+
+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/import-layers/yocto-poky/meta/recipes-core/systemd/systemd-systemctl/systemctl b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd-systemctl/systemctl
new file mode 100755
index 000000000..efad14ce1
--- /dev/null
+++ b/import-layers/yocto-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\|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/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/00-create-volatile.conf b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/00-create-volatile.conf
new file mode 100644
index 000000000..87cbe1e7d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0001-core-device.c-Change-the-default-device-timeout-to-2.patch b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0001-core-device.c-Change-the-default-device-timeout-to-2.patch
new file mode 100644
index 000000000..f7ef7a321
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0001-core-device.c-Change-the-default-device-timeout-to-2.patch
@@ -0,0 +1,33 @@
+From 3bc4552117879f57522b5972b724729ca993f1ea 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 01/36] 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 d201dc5..340d62a 100644
+--- a/src/core/device.c
++++ b/src/core/device.c
+@@ -112,7 +112,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_timeout = u->manager->default_timeout_start_usec;
++ u->job_timeout = (240 * USEC_PER_SEC);
+
+ u->ignore_on_isolate = true;
+ }
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0002-units-Prefer-getty-to-agetty-in-console-setup-system.patch b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0002-units-Prefer-getty-to-agetty-in-console-setup-system.patch
new file mode 100644
index 000000000..28939eb02
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0002-units-Prefer-getty-to-agetty-in-console-setup-system.patch
@@ -0,0 +1,44 @@
+From e5f405aba347d216e7f2b73d7dd681b13be442e3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Feb 2015 05:29:15 +0000
+Subject: [PATCH 02/36] units: Prefer getty to agetty in console setup systemd
+ units
+
+Upstream-Status: Inappropriate [configuration specific]
+
+Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ units/getty@.service.m4 | 2 +-
+ units/serial-getty@.service.m4 | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/units/getty@.service.m4 b/units/getty@.service.m4
+index 46164ab..bdf6ec8 100644
+--- a/units/getty@.service.m4
++++ b/units/getty@.service.m4
+@@ -27,7 +27,7 @@ ConditionPathExists=/dev/tty0
+
+ [Service]
+ # the VT is cleared by TTYVTDisallocate
+-ExecStart=-/sbin/agetty --noclear %I $TERM
++ExecStart=-/sbin/getty -L %I $TERM
+ Type=idle
+ Restart=always
+ RestartSec=0
+diff --git a/units/serial-getty@.service.m4 b/units/serial-getty@.service.m4
+index 4522d0d..e6d499d 100644
+--- a/units/serial-getty@.service.m4
++++ b/units/serial-getty@.service.m4
+@@ -22,7 +22,7 @@ Before=getty.target
+ IgnoreOnIsolate=yes
+
+ [Service]
+-ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 %I $TERM
++ExecStart=-/sbin/getty -L 115200 %I $TERM
+ Type=idle
+ Restart=always
+ UtmpIdentifier=%I
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0003-define-exp10-if-missing.patch b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0003-define-exp10-if-missing.patch
new file mode 100644
index 000000000..f183261c8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0003-define-exp10-if-missing.patch
@@ -0,0 +1,33 @@
+From 699893a05edac5194f9670529bacfaeb67252edb Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 14 Dec 2015 00:42:49 +0000
+Subject: [PATCH 03/36] define exp10 if missing
+
+Inspired by: http://peter.korsgaard.com/patches/alsa-utils/alsamixer-fix-build-on-uClibc-exp10.patch
+
+exp10 extension is not part of uClibc, so compute it.
+
+Upstream-Status: Pending
+
+Signed-off-by: Samuel Martin <s.martin49@gmail.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/basic/missing.h | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/basic/missing.h b/src/basic/missing.h
+index f3d3236..ee7e7ea 100644
+--- a/src/basic/missing.h
++++ b/src/basic/missing.h
+@@ -1169,3 +1169,8 @@ static inline key_serial_t request_key(const char *type, const char *description
+ #endif
+
+ #endif
++
++#ifdef __UCLIBC__
++/* 10^x = 10^(log e^x) = (e^x)^log10 = e^(x * log 10) */
++#define exp10(x) (exp((x) * log(10)))
++#endif /* __UCLIBC__ */
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0004-Use-getenv-when-secure-versions-are-not-available.patch b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0004-Use-getenv-when-secure-versions-are-not-available.patch
new file mode 100644
index 000000000..989a1fa1d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0004-Use-getenv-when-secure-versions-are-not-available.patch
@@ -0,0 +1,35 @@
+From bb8d8148b16572ae17d3c308552cf73915386b05 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 12 Sep 2015 19:10:04 +0000
+Subject: [PATCH 04/36] 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 imeplementation
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Denied
+---
+ src/basic/missing.h | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/src/basic/missing.h b/src/basic/missing.h
+index ee7e7ea..3170429 100644
+--- a/src/basic/missing.h
++++ b/src/basic/missing.h
+@@ -585,12 +585,11 @@ static inline int name_to_handle_at(int fd, const char *name, struct file_handle
+ return syscall(__NR_name_to_handle_at, fd, name, handle, mnt_id, flags);
+ }
+ #endif
+-
+ #ifndef HAVE_SECURE_GETENV
+ # ifdef HAVE___SECURE_GETENV
+ # define secure_getenv __secure_getenv
+ # else
+-# error "neither secure_getenv nor __secure_getenv are available"
++# define secure_getenv getenv
+ # endif
+ #endif
+
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0005-binfmt-Don-t-install-dependency-links-at-install-tim.patch b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0005-binfmt-Don-t-install-dependency-links-at-install-tim.patch
new file mode 100644
index 000000000..f69e26ec5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0005-binfmt-Don-t-install-dependency-links-at-install-tim.patch
@@ -0,0 +1,74 @@
+From 3436b12d40bf4f4ab7e3e16600e5f6c35a470da4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Feb 2015 05:03:44 +0000
+Subject: [PATCH 05/36] 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>
+---
+ Makefile.am | 4 ----
+ units/proc-sys-fs-binfmt_misc.automount | 3 +++
+ units/systemd-binfmt.service.in | 5 +++++
+ 3 files changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 03341fc..629740f 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -4387,10 +4387,6 @@ INSTALL_DIRS += \
+ $(prefix)/lib/binfmt.d \
+ $(sysconfdir)/binfmt.d
+
+-SYSINIT_TARGET_WANTS += \
+- systemd-binfmt.service \
+- proc-sys-fs-binfmt_misc.automount
+-
+ endif
+
+ EXTRA_DIST += \
+diff --git a/units/proc-sys-fs-binfmt_misc.automount b/units/proc-sys-fs-binfmt_misc.automount
+index 6be3893..709adef 100644
+--- a/units/proc-sys-fs-binfmt_misc.automount
++++ b/units/proc-sys-fs-binfmt_misc.automount
+@@ -16,3 +16,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 d53073e..8c57ee0 100644
+--- a/units/systemd-binfmt.service.in
++++ b/units/systemd-binfmt.service.in
+@@ -11,6 +11,8 @@ 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/
+@@ -25,3 +27,6 @@ Type=oneshot
+ RemainAfterExit=yes
+ ExecStart=@rootlibexecdir@/systemd-binfmt
+ TimeoutSec=90s
++
++[Install]
++WantedBy=sysinit.target
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0006-configure-Check-for-additional-features-that-uclibc-.patch b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0006-configure-Check-for-additional-features-that-uclibc-.patch
new file mode 100644
index 000000000..0d6375573
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0006-configure-Check-for-additional-features-that-uclibc-.patch
@@ -0,0 +1,48 @@
+From bb6f1d8a000b337280541afde7cccdcfe03cdeb1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Feb 2015 05:05:45 +0000
+Subject: [PATCH 06/36] configure: Check for additional features that uclibc
+ doesnt support
+
+This helps in supporting uclibc which does not have all features that
+glibc might have
+
+Upstream-Status: Denied [no desire for uclibc support]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index f51533c..0239fd0 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -112,6 +112,24 @@ AC_PATH_PROG([UMOUNT_PATH], [umount], [/usr/bin/umount], [$PATH:/usr/sbin:/sbin]
+
+ AS_IF([! ln --relative --help > /dev/null 2>&1], [AC_MSG_ERROR([*** ln doesn't support --relative ***])])
+
++# check for few functions not implemented in uClibc
++
++AC_CHECK_FUNCS_ONCE(mkostemp execvpe posix_fallocate)
++
++# check for %ms format support - assume always no if cross compiling
++
++AC_MSG_CHECKING([whether %ms format is supported by *scanf])
++
++AC_LINK_IFELSE(
++ [AC_LANG_PROGRAM([
++ #include <stdio.h>
++ ],[
++ char *buf1, *buf2, *buf3, str="1 2.3 abcde" ;
++ int rc = sscanf(str, "%ms %ms %ms", &buf1, &buf2, &buf3) ;
++ return (rc==3)?0:1;])],
++ [AC_DEFINE([HAVE_MSFORMAT], [1], [Define if %ms format is supported by *scanf.])],
++ [AC_MSG_RESULT([no])])
++
+ M4_DEFINES=
+
+ AC_CHECK_TOOL(OBJCOPY, objcopy)
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0007-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0007-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch
new file mode 100644
index 000000000..12f6ace93
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0007-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch
@@ -0,0 +1,61 @@
+From fa5e137fbd2fb081ae897575377d718ee8cb6349 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 20 Dec 2015 04:20:28 +0000
+Subject: [PATCH 07/36] use lnr wrapper instead of looking for --relative
+ option for ln
+
+Upstream-Status: Inappropriate [OE-Specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile.am | 6 +++---
+ configure.ac | 2 --
+ 2 files changed, 3 insertions(+), 5 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 629740f..82b6553 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -243,7 +243,7 @@ define move-to-rootlibdir
+ $(MKDIR_P) $(DESTDIR)$(rootlibdir) && \
+ so_img_name=$$(readlink $(DESTDIR)$(libdir)/$$libname) && \
+ rm -f $(DESTDIR)$(libdir)/$$libname && \
+- $(LN_S) --relative -f $(DESTDIR)$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/$$libname && \
++ lnr $(DESTDIR)$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/$$libname && \
+ mv $(DESTDIR)$(libdir)/$$libname.* $(DESTDIR)$(rootlibdir); \
+ fi
+ endef
+@@ -317,7 +317,7 @@ define install-relative-aliases
+ while [ -n "$$1" ]; do \
+ $(MKDIR_P) `dirname $(DESTDIR)$$dir/$$2` && \
+ rm -f $(DESTDIR)$$dir/$$2 && \
+- $(LN_S) --relative $(DESTDIR)$$1 $(DESTDIR)$$dir/$$2 && \
++ lnr $(DESTDIR)$$1 $(DESTDIR)$$dir/$$2 && \
+ shift 2 || exit $$?; \
+ done
+ endef
+@@ -2781,7 +2781,7 @@ systemd_dbus1_generator_LDADD = \
+ dbus1-generator-install-hook:
+ $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(usergeneratordir)
+ $(AM_V_RM)rm -f $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
+- $(AM_V_LN)$(LN_S) --relative -f $(DESTDIR)$(systemgeneratordir)/systemd-dbus1-generator $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
++ $(AM_V_LN)lnr $(DESTDIR)$(systemgeneratordir)/systemd-dbus1-generator $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
+
+ dbus1-generator-uninstall-hook:
+ rm -f $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
+diff --git a/configure.ac b/configure.ac
+index 0239fd0..c5ab9d0 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -110,8 +110,6 @@ AC_PATH_PROG([SULOGIN], [sulogin], [/usr/sbin/sulogin], [$PATH:/usr/sbin:/sbin])
+ AC_PATH_PROG([MOUNT_PATH], [mount], [/usr/bin/mount], [$PATH:/usr/sbin:/sbin])
+ AC_PATH_PROG([UMOUNT_PATH], [umount], [/usr/bin/umount], [$PATH:/usr/sbin:/sbin])
+
+-AS_IF([! ln --relative --help > /dev/null 2>&1], [AC_MSG_ERROR([*** ln doesn't support --relative ***])])
+-
+ # check for few functions not implemented in uClibc
+
+ AC_CHECK_FUNCS_ONCE(mkostemp execvpe posix_fallocate)
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0008-nspawn-Use-execvpe-only-when-libc-supports-it.patch b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0008-nspawn-Use-execvpe-only-when-libc-supports-it.patch
new file mode 100644
index 000000000..6e6f199ef
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0008-nspawn-Use-execvpe-only-when-libc-supports-it.patch
@@ -0,0 +1,41 @@
+From ae999ff50efb9cc82537adef7696c6f732afcfc8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Feb 2015 05:10:37 +0000
+Subject: [PATCH 08/36] nspawn: Use execvpe only when libc supports it
+
+Upstream-Status: Denied [no desire for uclibc support]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/nspawn/nspawn.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
+index 5a68fec..65e65ec 100644
+--- a/src/nspawn/nspawn.c
++++ b/src/nspawn/nspawn.c
+@@ -111,6 +111,8 @@ typedef enum LinkJournal {
+ LINK_GUEST
+ } LinkJournal;
+
++#include "config.h"
++
+ static char *arg_directory = NULL;
+ static char *arg_template = NULL;
+ static char *arg_chdir = NULL;
+@@ -2637,7 +2639,12 @@ static int inner_child(
+ a[0] = (char*) "/sbin/init";
+ execve(a[0], a, env_use);
+ } else if (!strv_isempty(arg_parameters))
++#ifdef HAVE_EXECVPE
+ execvpe(arg_parameters[0], arg_parameters, env_use);
++#else
++ environ = env_use;
++ execvp(arg_parameters[0], arg_parameters);
++#endif /* HAVE_EXECVPE */
+ else {
+ if (!arg_chdir)
+ chdir(home ?: "/root");
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0009-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0009-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch
new file mode 100644
index 000000000..116f3d4de
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0009-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch
@@ -0,0 +1,46 @@
+From 3498f488b27f90398d7c8d1d06aac5ab684370e8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 14 Dec 2015 00:47:53 +0000
+Subject: [PATCH 09/36] util: bypass unimplemented _SC_PHYS_PAGES system
+ configuration API on uclibc
+
+Upstream-Status: Inappropriate [uclibc-specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/basic/util.c | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+diff --git a/src/basic/util.c b/src/basic/util.c
+index ea1bed7..fdaf340 100644
+--- a/src/basic/util.c
++++ b/src/basic/util.c
+@@ -767,10 +767,25 @@ uint64_t physical_memory(void) {
+ /* We return this as uint64_t in case we are running as 32bit
+ * process on a 64bit kernel with huge amounts of memory */
+
++#ifdef __UCLIBC__
++ char line[128];
++ FILE *f = fopen("/proc/meminfo", "r");
++ if (f == NULL)
++ return 0;
++ while (!feof(f) && fgets(line, sizeof(line)-1, f)) {
++ if (sscanf(line, "MemTotal: %li kB", &mem) == 1) {
++ mem *= 1024;
++ break;
++ }
++ }
++ fclose(f);
++ return (uint64_t) mem;
++#else
+ mem = sysconf(_SC_PHYS_PAGES);
+ assert(mem > 0);
+
+ return (uint64_t) mem * (uint64_t) page_size();
++#endif
+ }
+
+ int update_reboot_param_file(const char *param) {
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0010-implment-systemd-sysv-install-for-OE.patch b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0010-implment-systemd-sysv-install-for-OE.patch
new file mode 100644
index 000000000..75fa3a54e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0010-implment-systemd-sysv-install-for-OE.patch
@@ -0,0 +1,43 @@
+From 5f94f5ad46c1ded54c3797979d384e4c1eb77bb0 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 10/36] 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 a53a3e6..5d877b0 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 ;;
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0011-nss-mymachines-Build-conditionally-when-HAVE_MYHOSTN.patch b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0011-nss-mymachines-Build-conditionally-when-HAVE_MYHOSTN.patch
new file mode 100644
index 000000000..34ae64535
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0011-nss-mymachines-Build-conditionally-when-HAVE_MYHOSTN.patch
@@ -0,0 +1,38 @@
+From 2b2450f6b7197bff4637c0283e8784500471d083 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 14 Dec 2015 00:50:01 +0000
+Subject: [PATCH 11/36] nss-mymachines: Build conditionally when
+ HAVE_MYHOSTNAME is set
+
+Fixes build failures when building with --disable-myhostname
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile.am | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/Makefile.am b/Makefile.am
+index 82b6553..b3f3343 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -4876,6 +4876,7 @@ SYSTEM_UNIT_ALIASES += \
+ BUSNAMES_TARGET_WANTS += \
+ org.freedesktop.machine1.busname
+
++if HAVE_MYHOSTNAME
+ libnss_mymachines_la_SOURCES = \
+ src/nss-mymachines/nss-mymachines.sym \
+ src/nss-mymachines/nss-mymachines.c
+@@ -4896,6 +4897,7 @@ lib_LTLIBRARIES += \
+ libnss_mymachines.la
+
+ endif
++endif
+
+ polkitpolicy_in_files += \
+ src/machine/org.freedesktop.machine1.policy.in
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0012-rules-whitelist-hd-devices.patch b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0012-rules-whitelist-hd-devices.patch
new file mode 100644
index 000000000..6143088e8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0012-rules-whitelist-hd-devices.patch
@@ -0,0 +1,32 @@
+From 5ebc0d87565a73710dea602c00b1586d5a1364e5 Mon Sep 17 00:00:00 2001
+From: Patrick Ohly <patrick.ohly@intel.com>
+Date: Wed, 16 Sep 2015 13:55:58 +0200
+Subject: [PATCH 12/36] 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>
+---
+ 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 0b14bb4..1c4d97a 100644
+--- a/rules/60-persistent-storage.rules
++++ b/rules/60-persistent-storage.rules
+@@ -6,7 +6,7 @@
+ ACTION=="remove", 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*", GOTO="persistent_storage_end"
++KERNEL!="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|hd*|sd*|sr*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*", GOTO="persistent_storage_end"
+
+ # ignore partitions that span the entire disk
+ TEST=="whole_disk", GOTO="persistent_storage_end"
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0013-sysv-generator-add-support-for-executing-scripts-und.patch b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0013-sysv-generator-add-support-for-executing-scripts-und.patch
new file mode 100644
index 000000000..ac67f6568
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0013-sysv-generator-add-support-for-executing-scripts-und.patch
@@ -0,0 +1,133 @@
+From 6736de4a3caf9a0b3c888c6cc05103ab1b86907d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 14 Dec 2015 05:09:53 +0000
+Subject: [PATCH 13/36] sysv-generator: add support for executing scripts under
+ /etc/rcS.d/
+
+To be compatible, all services translated from scripts under /etc/rcS.d would
+run before services translated from scripts under /etc/rcN.d.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/sysv-generator/sysv-generator.c | 47 ++++++++++++++++++++++++++++---------
+ 1 file changed, 36 insertions(+), 11 deletions(-)
+
+diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
+index b5925a4..ea06d6a 100644
+--- a/src/sysv-generator/sysv-generator.c
++++ b/src/sysv-generator/sysv-generator.c
+@@ -44,7 +44,8 @@
+
+ typedef enum RunlevelType {
+ RUNLEVEL_UP,
+- RUNLEVEL_DOWN
++ RUNLEVEL_DOWN,
++ RUNLEVEL_SYSINIT
+ } RunlevelType;
+
+ static const struct {
+@@ -59,6 +60,9 @@ static const struct {
+ { "rc4.d", SPECIAL_MULTI_USER_TARGET, RUNLEVEL_UP },
+ { "rc5.d", SPECIAL_GRAPHICAL_TARGET, RUNLEVEL_UP },
+
++ /* Debian style rcS.d, also adopted by OE */
++ { "rcS.d", SPECIAL_SYSINIT_TARGET, RUNLEVEL_SYSINIT},
++
+ /* Standard SysV runlevels for shutdown */
+ { "rc0.d", SPECIAL_POWEROFF_TARGET, RUNLEVEL_DOWN },
+ { "rc6.d", SPECIAL_REBOOT_TARGET, RUNLEVEL_DOWN }
+@@ -67,7 +71,7 @@ static const struct {
+ directories in this order, and we want to make sure that
+ sysv_start_priority is known when we first load the
+ unit. And that value we only know from S links. Hence
+- UP must be read before DOWN */
++ UP/SYSINIT must be read before DOWN */
+ };
+
+ static const char *arg_dest = "/tmp";
+@@ -86,6 +90,8 @@ typedef struct SysvStub {
+ bool has_lsb;
+ bool reload;
+ bool loaded;
++ bool default_dependencies;
++ bool from_rcsd;
+ } SysvStub;
+
+ static void free_sysvstub(SysvStub *s) {
+@@ -711,17 +717,31 @@ static int fix_order(SysvStub *s, Hashmap *all_services) {
+ if (s->has_lsb && other->has_lsb)
+ continue;
+
+- if (other->sysv_start_priority < s->sysv_start_priority) {
+- r = strv_extend(&s->after, other->name);
++ /* All scripts under /etc/rcS.d should execute before scripts under
++ * /etc/rcN.d */
++ if (!other->from_rcsd && s->from_rcsd) {
++ r = strv_extend(&s->before, other->name);
+ if (r < 0)
+ return log_oom();
+
+- } else if (other->sysv_start_priority > s->sysv_start_priority) {
+- r = strv_extend(&s->before, other->name);
++ } else if (other->from_rcsd && !s->from_rcsd) {
++ r = strv_extend(&s->after, other->name);
+ if (r < 0)
+ return log_oom();
+- } else
+- continue;
++ } else {
++ if (other->sysv_start_priority < s->sysv_start_priority) {
++ r = strv_extend(&s->after, other->name);
++ if (r < 0)
++ return log_oom();
++ }
++ else if (other->sysv_start_priority > s->sysv_start_priority) {
++ r = strv_extend(&s->before, other->name);
++ if (r < 0)
++ return log_oom();
++ }
++ else
++ continue;
++ }
+
+ /* FIXME: Maybe we should compare the name here lexicographically? */
+ }
+@@ -788,6 +808,8 @@ static int enumerate_sysv(const LookupPaths *lp, Hashmap *all_services) {
+ return log_oom();
+
+ service->sysv_start_priority = -1;
++ service->default_dependencies = true;
++ service->from_rcsd = false;
+ service->name = name;
+ service->path = fpath;
+ name = fpath = NULL;
+@@ -871,9 +893,11 @@ static int set_dependencies_from_rcnd(const LookupPaths *lp, Hashmap *all_servic
+
+ if (de->d_name[0] == 'S') {
+
+- if (rcnd_table[i].type == RUNLEVEL_UP)
++ if (rcnd_table[i].type == RUNLEVEL_UP || rcnd_table[i].type == RUNLEVEL_SYSINIT) {
+ service->sysv_start_priority = MAX(a*10 + b, service->sysv_start_priority);
+-
++ service->default_dependencies = (rcnd_table[i].type == RUNLEVEL_SYSINIT)?false:true;
++ service->from_rcsd = (rcnd_table[i].type == RUNLEVEL_SYSINIT)?true:false;
++ }
+ r = set_ensure_allocated(&runlevel_services[i], NULL);
+ if (r < 0) {
+ log_oom();
+@@ -887,7 +911,8 @@ static int set_dependencies_from_rcnd(const LookupPaths *lp, Hashmap *all_servic
+ }
+
+ } else if (de->d_name[0] == 'K' &&
+- (rcnd_table[i].type == RUNLEVEL_DOWN)) {
++ (rcnd_table[i].type == RUNLEVEL_DOWN ||
++ rcnd_table[i].type == RUNLEVEL_SYSINIT)) {
+
+ r = set_ensure_allocated(&shutdown_services, NULL);
+ if (r < 0) {
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0014-Make-root-s-home-directory-configurable.patch b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0014-Make-root-s-home-directory-configurable.patch
new file mode 100644
index 000000000..4a576aa7d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0014-Make-root-s-home-directory-configurable.patch
@@ -0,0 +1,184 @@
+From 786883cfa13e21f060ee6da6cabb94845f4349a0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 14 Dec 2015 05:18:20 +0000
+Subject: [PATCH 14/36] 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>
+---
+ Makefile.am | 2 ++
+ configure.ac | 7 +++++++
+ src/basic/user-util.c | 4 ++--
+ src/core/namespace.c | 2 +-
+ src/nspawn/nspawn.c | 4 ++--
+ units/console-shell.service.m4.in | 4 ++--
+ units/emergency.service.in | 4 ++--
+ units/rescue.service.in | 4 ++--
+ 8 files changed, 20 insertions(+), 11 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index b3f3343..a99e8eb 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -202,6 +202,7 @@ AM_CPPFLAGS = \
+ -DLIBDIR=\"$(libdir)\" \
+ -DROOTLIBDIR=\"$(rootlibdir)\" \
+ -DROOTLIBEXECDIR=\"$(rootlibexecdir)\" \
++ -DROOTHOMEDIR=\"$(roothomedir)\" \
+ -DTEST_DIR=\"$(abs_top_srcdir)/test\" \
+ -I $(top_srcdir)/src \
+ -I $(top_builddir)/src/basic \
+@@ -5713,6 +5714,7 @@ EXTRA_DIST += \
+ substitutions = \
+ '|rootlibexecdir=$(rootlibexecdir)|' \
+ '|rootbindir=$(rootbindir)|' \
++ '|roothomedir=$(roothomedir)|' \
+ '|bindir=$(bindir)|' \
+ '|SYSTEMCTL=$(rootbindir)/systemctl|' \
+ '|SYSTEMD_NOTIFY=$(rootbindir)/systemd-notify|' \
+diff --git a/configure.ac b/configure.ac
+index c5ab9d0..16c83bb 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1470,6 +1470,11 @@ AC_ARG_WITH([rootlibdir],
+ [with_rootlibdir=${libdir}])
+ AX_NORMALIZE_PATH([with_rootlibdir])
+
++AC_ARG_WITH([roothomedir],
++ AS_HELP_STRING([--with-roothomedir=DIR], [Home directory for the root user]),
++ [],
++ [with_roothomedir=/root])
++
+ AC_ARG_WITH([pamlibdir],
+ AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]),
+ [],
+@@ -1553,6 +1558,7 @@ AC_SUBST([pamlibdir], [$with_pamlibdir])
+ AC_SUBST([pamconfdir], [$with_pamconfdir])
+ AC_SUBST([rootprefix], [$with_rootprefix])
+ AC_SUBST([rootlibdir], [$with_rootlibdir])
++AC_SUBST([roothomedir], [$with_roothomedir])
+
+ AC_CONFIG_FILES([
+ Makefile
+@@ -1643,6 +1649,7 @@ AC_MSG_RESULT([
+ includedir: ${includedir}
+ lib dir: ${libdir}
+ rootlib dir: ${with_rootlibdir}
++ root home dir: ${with_roothomedir}
+ SysV init scripts: ${SYSTEM_SYSVINIT_PATH}
+ SysV rc?.d directories: ${SYSTEM_SYSVRCND_PATH}
+ Build Python: ${PYTHON}
+diff --git a/src/basic/user-util.c b/src/basic/user-util.c
+index 19155bc..55672b3 100644
+--- a/src/basic/user-util.c
++++ b/src/basic/user-util.c
+@@ -122,7 +122,7 @@ int get_user_creds(
+ *gid = 0;
+
+ if (home)
+- *home = "/root";
++ *home = ROOTHOMEDIR;
+
+ if (shell)
+ *shell = "/bin/sh";
+@@ -353,7 +353,7 @@ int get_home_dir(char **_h) {
+ /* Hardcode home directory for root to avoid NSS */
+ u = getuid();
+ if (u == 0) {
+- h = strdup("/root");
++ h = strdup(ROOTHOMEDIR);
+ if (!h)
+ return -ENOMEM;
+
+diff --git a/src/core/namespace.c b/src/core/namespace.c
+index b573f00..0f70b14 100644
+--- a/src/core/namespace.c
++++ b/src/core/namespace.c
+@@ -409,7 +409,7 @@ int setup_namespace(
+ home_dir = strjoina("-", home_dir);
+ run_user_dir = prefix_roota(root_directory, "/run/user");
+ run_user_dir = strjoina("-", run_user_dir);
+- root_dir = prefix_roota(root_directory, "/root");
++ root_dir = prefix_roota(root_directory, ROOTHOMEDIR);
+ root_dir = strjoina("-", root_dir);
+
+ r = append_mounts(&m, STRV_MAKE(home_dir, run_user_dir, root_dir),
+diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
+index 65e65ec..12f0ee8 100644
+--- a/src/nspawn/nspawn.c
++++ b/src/nspawn/nspawn.c
+@@ -2564,7 +2564,7 @@ static int inner_child(
+ if (envp[n_env])
+ n_env ++;
+
+- if ((asprintf((char**)(envp + n_env++), "HOME=%s", home ? home: "/root") < 0) ||
++ if ((asprintf((char**)(envp + n_env++), "HOME=%s", home ? home: ROOTHOMEDIR) < 0) ||
+ (asprintf((char**)(envp + n_env++), "USER=%s", arg_user ? arg_user : "root") < 0) ||
+ (asprintf((char**)(envp + n_env++), "LOGNAME=%s", arg_user ? arg_user : "root") < 0))
+ return log_oom();
+@@ -2647,7 +2647,7 @@ static int inner_child(
+ #endif /* HAVE_EXECVPE */
+ else {
+ if (!arg_chdir)
+- chdir(home ?: "/root");
++ chdir(home ?: ROOTHOMEDIR);
+
+ execle("/bin/bash", "-bash", NULL, env_use);
+ execle("/bin/sh", "-sh", NULL, env_use);
+diff --git a/units/console-shell.service.m4.in b/units/console-shell.service.m4.in
+index a345ec2..3caae7d 100644
+--- a/units/console-shell.service.m4.in
++++ b/units/console-shell.service.m4.in
+@@ -15,8 +15,8 @@ After=rc-local.service
+ Before=getty.target
+
+ [Service]
+-Environment=HOME=/root
+-WorkingDirectory=-/root
++Environment=HOME=@roothomedir@
++WorkingDirectory=-@roothomedir@
+ ExecStart=-@SULOGIN@
+ ExecStopPost=-@SYSTEMCTL@ poweroff
+ Type=idle
+diff --git a/units/emergency.service.in b/units/emergency.service.in
+index fb390ea..5623a57 100644
+--- a/units/emergency.service.in
++++ b/units/emergency.service.in
+@@ -14,8 +14,8 @@ Conflicts=rescue.service
+ Before=shutdown.target
+
+ [Service]
+-Environment=HOME=/root
+-WorkingDirectory=-/root
++Environment=HOME=@roothomedir@
++WorkingDirectory=-@roothomedir@
+ ExecStartPre=-/bin/plymouth --wait quit
+ ExecStartPre=-/bin/echo -e 'Welcome to emergency mode! After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" or ^D to\\ntry again to boot into default mode.'
+ ExecStart=-/bin/sh -c "@SULOGIN@; @SYSTEMCTL@ --job-mode=fail --no-block default"
+diff --git a/units/rescue.service.in b/units/rescue.service.in
+index 92553f6..590ae17 100644
+--- a/units/rescue.service.in
++++ b/units/rescue.service.in
+@@ -14,8 +14,8 @@ After=sysinit.target plymouth-start.service
+ Before=shutdown.target
+
+ [Service]
+-Environment=HOME=/root
+-WorkingDirectory=-/root
++Environment=HOME=@roothomedir@
++WorkingDirectory=-@roothomedir@
+ ExecStartPre=-/bin/plymouth quit
+ ExecStartPre=-/bin/echo -e 'Welcome to rescue mode! After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" or ^D to\\nboot into default mode.'
+ ExecStart=-/bin/sh -c "@SULOGIN@; @SYSTEMCTL@ --job-mode=fail --no-block default"
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0015-systemd-user-avoid-using-system-auth.patch b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0015-systemd-user-avoid-using-system-auth.patch
new file mode 100644
index 000000000..a35123733
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0015-systemd-user-avoid-using-system-auth.patch
@@ -0,0 +1,36 @@
+From f70a1a9605cd3adac450c49a5a69da6e9acda517 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Feb 2015 05:26:25 +0000
+Subject: [PATCH 15/36] systemd-user: avoid using system-auth
+
+In OE, we don't provide system-auth, instead, we use common-* files.
+So modify systemd-user file to use common-* files.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/login/systemd-user.m4 | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/login/systemd-user.m4 b/src/login/systemd-user.m4
+index 7933508..16b73d2 100644
+--- a/src/login/systemd-user.m4
++++ b/src/login/systemd-user.m4
+@@ -2,10 +2,10 @@
+ #
+ # Used by systemd --user instances.
+
+-account include system-auth
++account include common-account
+
+ m4_ifdef(`HAVE_SELINUX',
+ session required pam_selinux.so close
+ session required pam_selinux.so nottys open
+ )m4_dnl
+-session include system-auth
++session include common-session
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0016-Revert-rules-remove-firmware-loading-rules.patch b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0016-Revert-rules-remove-firmware-loading-rules.patch
new file mode 100644
index 000000000..66905b5c5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0016-Revert-rules-remove-firmware-loading-rules.patch
@@ -0,0 +1,28 @@
+From 7311ecc745c17d6ed9fd9cf43039648483a87605 Mon Sep 17 00:00:00 2001
+From: Jonathan Liu <net147@gmail.com>
+Date: Thu, 19 Mar 2015 15:01:29 +1100
+Subject: [PATCH 16/36] 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"
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0017-Revert-udev-remove-userspace-firmware-loading-suppor.patch b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0017-Revert-udev-remove-userspace-firmware-loading-suppor.patch
new file mode 100644
index 000000000..8e6289d4a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0017-Revert-udev-remove-userspace-firmware-loading-suppor.patch
@@ -0,0 +1,361 @@
+From 9a3a4e16b36e762291cd1574ec71d7954f8b5363 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 14 Dec 2015 05:33:32 +0000
+Subject: [PATCH 17/36] 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>
+---
+ Makefile.am | 12 +++
+ README | 6 +-
+ TODO | 1 +
+ configure.ac | 22 ++++++
+ src/udev/udev-builtin-firmware.c | 154 +++++++++++++++++++++++++++++++++++++++
+ src/udev/udev-builtin.c | 3 +
+ src/udev/udev.h | 6 ++
+ src/udev/udevd.c | 13 ++++
+ 8 files changed, 214 insertions(+), 3 deletions(-)
+ create mode 100644 src/udev/udev-builtin-firmware.c
+
+diff --git a/Makefile.am b/Makefile.am
+index a99e8eb..b5c6ba7 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -3573,6 +3573,18 @@ libudev_core_la_LIBADD = \
+ $(BLKID_LIBS) \
+ $(KMOD_LIBS)
+
++libudev_core_la_CPPFLAGS = \
++ $(AM_CPPFLAGS) \
++ -DFIRMWARE_PATH="$(FIRMWARE_PATH)"
++
++if ENABLE_FIRMWARE
++libudev_core_la_SOURCES += \
++ src/udev/udev-builtin-firmware.c
++
++dist_udevrules_DATA += \
++ rules/50-firmware.rules
++endif
++
+ if HAVE_KMOD
+ libudev_core_la_SOURCES += \
+ src/udev/udev-builtin-kmod.c
+diff --git a/README b/README
+index 41fb07a..10230ac 100644
+--- a/README
++++ b/README
+@@ -50,14 +50,14 @@ REQUIREMENTS:
+ CONFIG_PROC_FS
+ CONFIG_FHANDLE (libudev, mount and bind mount handling)
+
+- udev will fail to work with the legacy sysfs layout:
++ Udev will fail to work with the legacy layout:
+ CONFIG_SYSFS_DEPRECATED=n
+
+ 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 92cc8cc..25f6849 100644
+--- a/TODO
++++ b/TODO
+@@ -628,6 +628,7 @@ Features:
+ * rename "userspace" to "core-os"
+
+ * 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/configure.ac b/configure.ac
+index 16c83bb..36d20b5 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1353,6 +1353,25 @@ AC_ARG_ENABLE(hwdb, [AC_HELP_STRING([--disable-hwdb], [disable hardware database
+ AM_CONDITIONAL(ENABLE_HWDB, [test x$enable_hwdb = xyes])
+
+ # ------------------------------------------------------------------------------
++AC_ARG_WITH(firmware-path,
++ AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
++ [Firmware search path (default="")]),
++ [], [with_firmware_path=""])
++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"])
++
++# ------------------------------------------------------------------------------
+ have_manpages=no
+ AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-manpages], [disable manpages]))
+ AC_PATH_PROG([XSLTPROC], [xsltproc])
+@@ -1653,6 +1672,9 @@ AC_MSG_RESULT([
+ SysV init scripts: ${SYSTEM_SYSVINIT_PATH}
+ SysV rc?.d directories: ${SYSTEM_SYSVRCND_PATH}
+ Build Python: ${PYTHON}
++ Installation Python: ${PYTHON_BINARY}
++ sphinx binary: ${SPHINX_BUILD}
++ firmware path: ${FIRMWARE_PATH}
+ PAM modules dir: ${with_pamlibdir}
+ PAM configuration dir: ${with_pamconfdir}
+ D-Bus policy dir: ${with_dbuspolicydir}
+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 e6b36f1..cd9947e 100644
+--- a/src/udev/udev-builtin.c
++++ b/src/udev/udev-builtin.c
+@@ -31,6 +31,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 1f9c812..fa35a88 100644
+--- a/src/udev/udev.h
++++ b/src/udev/udev.h
+@@ -147,6 +147,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,
+@@ -175,6 +178,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 bb92f16..84024ac 100644
+--- a/src/udev/udevd.c
++++ b/src/udev/udevd.c
+@@ -125,6 +125,9 @@ struct event {
+ bool is_block;
+ sd_event_source *timeout_warning;
+ sd_event_source *timeout;
++#ifdef HAVE_FIRMWARE
++ bool nodelay;
++#endif
+ };
+
+ static inline struct event *node_to_event(struct udev_list_node *node) {
+@@ -613,6 +616,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);
++#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));
+@@ -698,6 +705,12 @@ static bool is_devpath_busy(Manager *manager, 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.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0018-make-test-dir-configurable.patch b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0018-make-test-dir-configurable.patch
new file mode 100644
index 000000000..5f3f2e8a5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0018-make-test-dir-configurable.patch
@@ -0,0 +1,64 @@
+From 569cd3cf9806a02226d26c4104dbe44262f93d33 Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Fri, 22 Jan 2016 16:44:11 +0800
+Subject: [PATCH 18/36] make test dir configurable
+
+Upstream-Status: Pending
+
+test maybe be run on target in cross-compile environment, and test dir
+is not the compilation dir, so make it configurable
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ Makefile.am | 2 +-
+ configure.ac | 7 +++++++
+ 2 files changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index b5c6ba7..d3cd961 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -203,7 +203,7 @@ AM_CPPFLAGS = \
+ -DROOTLIBDIR=\"$(rootlibdir)\" \
+ -DROOTLIBEXECDIR=\"$(rootlibexecdir)\" \
+ -DROOTHOMEDIR=\"$(roothomedir)\" \
+- -DTEST_DIR=\"$(abs_top_srcdir)/test\" \
++ -DTEST_DIR=\"$(testdir)/test\" \
+ -I $(top_srcdir)/src \
+ -I $(top_builddir)/src/basic \
+ -I $(top_srcdir)/src/basic \
+diff --git a/configure.ac b/configure.ac
+index 36d20b5..d96dc5a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1494,6 +1494,11 @@ AC_ARG_WITH([roothomedir],
+ [],
+ [with_roothomedir=/root])
+
++AC_ARG_WITH([testdir],
++ AS_HELP_STRING([--with-testdir=DIR], [test file directory]),
++ [],
++ [with_testdir=${abs_top_srcdir}])
++
+ AC_ARG_WITH([pamlibdir],
+ AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]),
+ [],
+@@ -1578,6 +1583,7 @@ AC_SUBST([pamconfdir], [$with_pamconfdir])
+ AC_SUBST([rootprefix], [$with_rootprefix])
+ AC_SUBST([rootlibdir], [$with_rootlibdir])
+ AC_SUBST([roothomedir], [$with_roothomedir])
++AC_SUBST([testdir], [$with_testdir])
+
+ AC_CONFIG_FILES([
+ Makefile
+@@ -1669,6 +1675,7 @@ AC_MSG_RESULT([
+ lib dir: ${libdir}
+ rootlib dir: ${with_rootlibdir}
+ root home dir: ${with_roothomedir}
++ test dir: ${with_testdir}
+ SysV init scripts: ${SYSTEM_SYSVINIT_PATH}
+ SysV rc?.d directories: ${SYSTEM_SYSVRCND_PATH}
+ Build Python: ${PYTHON}
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0019-remove-duplicate-include-uchar.h.patch b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0019-remove-duplicate-include-uchar.h.patch
new file mode 100644
index 000000000..17592f8aa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0019-remove-duplicate-include-uchar.h.patch
@@ -0,0 +1,42 @@
+From 3ca534935460647fed66e31aaa90b364e29eab5c 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 1/2] 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 deaa4de..36d437c 100644
+--- a/src/basic/escape.h
++++ b/src/basic/escape.h
+@@ -23,7 +23,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 12c272d..bea93a6 100644
+--- a/src/basic/utf8.h
++++ b/src/basic/utf8.h
+@@ -22,7 +22,6 @@
+ #include <stdbool.h>
+ #include <stddef.h>
+ #include <stdint.h>
+-#include <uchar.h>
+
+ #include "macro.h"
+ #include "missing.h"
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0020-check-for-uchar.h-in-configure.patch b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0020-check-for-uchar.h-in-configure.patch
new file mode 100644
index 000000000..a027fad1d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0020-check-for-uchar.h-in-configure.patch
@@ -0,0 +1,44 @@
+From e06eec89a22719c38e257fe07afff18e359114cb Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 22 Feb 2016 06:02:38 +0000
+Subject: [PATCH 2/2] check for uchar.h in configure
+
+Use ifdef to include uchar.h
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ configure.ac | 1 +
+ src/basic/missing.h | 2 ++
+ 2 files changed, 3 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index ecc3e6b..62f934e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -297,6 +297,7 @@ AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])
+
+ # ------------------------------------------------------------------------------
+
++AC_CHECK_HEADERS([uchar.h], [], [])
+ AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
+ AC_CHECK_HEADERS([linux/btrfs.h], [], [])
+ AC_CHECK_HEADERS([linux/memfd.h], [], [])
+diff --git a/src/basic/missing.h b/src/basic/missing.h
+index f704422..a1baa95 100644
+--- a/src/basic/missing.h
++++ b/src/basic/missing.h
+@@ -34,7 +34,9 @@
+ #include <stdlib.h>
+ #include <sys/resource.h>
+ #include <sys/syscall.h>
++#ifdef HAVE_UCHAR_H
+ #include <uchar.h>
++#endif
+ #include <unistd.h>
+
+ #ifdef HAVE_AUDIT
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0021-include-missing.h-for-getting-secure_getenv-definiti.patch b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0021-include-missing.h-for-getting-secure_getenv-definiti.patch
new file mode 100644
index 000000000..5797a29e6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0021-include-missing.h-for-getting-secure_getenv-definiti.patch
@@ -0,0 +1,27 @@
+From 6cedbaee7964f6a6c61b9f2c8f0b87cef9370424 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 15 Dec 2015 22:51:55 +0000
+Subject: [PATCH 26/38] include missing.h for getting secure_getenv definition
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/basic/user-util.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/basic/user-util.c b/src/basic/user-util.c
+index 55672b3..22c4a23 100644
+--- a/src/basic/user-util.c
++++ b/src/basic/user-util.c
+@@ -38,6 +38,7 @@
+ #include "path-util.h"
+ #include "string-util.h"
+ #include "user-util.h"
++#include "missing.h"
+
+ bool uid_is_valid(uid_t uid) {
+
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0022-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0022-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch
new file mode 100644
index 000000000..96fc3d844
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0022-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch
@@ -0,0 +1,36 @@
+From 71e710a6c8a3879af7d50c4cb995e0615deba5c3 Mon Sep 17 00:00:00 2001
+From: Emil Renner Berthing <systemd@esmil.dk>
+Date: Sat, 12 Sep 2015 19:56:52 +0000
+Subject: [PATCH 29/38] socket-util: don't fail if libc doesn't support IDN
+
+Signed-off-by: Emil Renner Berthing <systemd@esmil.dk>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/basic/socket-util.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/src/basic/socket-util.c b/src/basic/socket-util.c
+index 5851268..aefaca5 100644
+--- a/src/basic/socket-util.c
++++ b/src/basic/socket-util.c
+@@ -44,6 +44,15 @@
+ #include "string-util.h"
+ #include "user-util.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
+
+ int socket_address_parse(SocketAddress *a, const char *s) {
+ char *e, *n;
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0023-build-sys-fix-build-with-libgrcypt-disabled.patch b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0023-build-sys-fix-build-with-libgrcypt-disabled.patch
new file mode 100644
index 000000000..1ae3d66c7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/0023-build-sys-fix-build-with-libgrcypt-disabled.patch
@@ -0,0 +1,122 @@
+From b68f10bf1f7519e012da5e35fab3a57da7dc46d4 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
+Date: Sun, 27 Mar 2016 17:33:54 -0400
+Subject: [PATCH] build-sys: fix build with libgrcypt disabled
+
+- Move gcrypt.h include inside grcrypt-util.h.
+- Allow gcrypt-util.[ch] to be compiled even without gcrypt.
+This allows the logic in files using gcrypt to be simplified.
+
+- Fix compilation of systemd-resolve without gcrypt.
+systemd-resolved already supported that.
+
+Upstream-Status: Backport [ https://github.com/systemd/systemd/pull/2905 ]
+
+Fixes [YOCTO #9219]
+
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ Makefile.am | 8 ++++----
+ src/resolve/resolve-tool.c | 3 +--
+ src/shared/gcrypt-util.c | 4 +++-
+ src/shared/gcrypt-util.h | 14 ++++++++++++++
+ 4 files changed, 22 insertions(+), 7 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 2b72a53..95eaa9a 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -4262,7 +4262,9 @@ libsystemd_journal_internal_la_SOURCES = \
+ src/journal/mmap-cache.h \
+ src/journal/compress.c \
+ src/journal/audit-type.h \
+- src/journal/audit-type.c
++ src/journal/audit-type.c \
++ src/shared/gcrypt-util.h \
++ src/shared/gcrypt-util.c
+
+ nodist_libsystemd_journal_internal_la_SOURCES = \
+ src/journal/audit_type-to-name.h
+@@ -4294,9 +4296,7 @@ libsystemd_journal_internal_la_SOURCES += \
+ src/journal/journal-authenticate.c \
+ src/journal/journal-authenticate.h \
+ src/journal/fsprg.c \
+- src/journal/fsprg.h \
+- src/shared/gcrypt-util.c \
+- src/shared/gcrypt-util.h
++ src/journal/fsprg.h
+
+ libsystemd_journal_internal_la_LIBADD += \
+ $(GCRYPT_LIBS)
+diff --git a/src/resolve/resolve-tool.c b/src/resolve/resolve-tool.c
+index 009cc73..14ee01c 100644
+--- a/src/resolve/resolve-tool.c
++++ b/src/resolve/resolve-tool.c
+@@ -17,7 +17,6 @@
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
+ ***/
+
+-#include <gcrypt.h>
+ #include <getopt.h>
+ #include <net/if.h>
+
+@@ -863,7 +862,7 @@ static int resolve_openpgp(sd_bus *bus, const char *address) {
+ }
+ domain++;
+
+- r = string_hashsum(address, domain - 1 - address, GCRY_MD_SHA224, &hashed);
++ r = string_hashsum_sha224(address, domain - 1 - address, &hashed);
+ if (r < 0)
+ return log_error_errno(r, "Hashing failed: %m");
+
+diff --git a/src/shared/gcrypt-util.c b/src/shared/gcrypt-util.c
+index 4ff9452..39b544b 100644
+--- a/src/shared/gcrypt-util.c
++++ b/src/shared/gcrypt-util.c
+@@ -19,10 +19,11 @@
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
+ ***/
+
++#ifdef HAVE_GCRYPT
+ #include <gcrypt.h>
+
+-#include "hexdecoct.h"
+ #include "gcrypt-util.h"
++#include "hexdecoct.h"
+
+ void initialize_libgcrypt(bool secmem) {
+ const char *p;
+@@ -67,3 +68,4 @@ int string_hashsum(const char *s, size_t len, int md_algorithm, char **out) {
+ *out = enc;
+ return 0;
+ }
++#endif
+diff --git a/src/shared/gcrypt-util.h b/src/shared/gcrypt-util.h
+index c7652c2..cf33b3c 100644
+--- a/src/shared/gcrypt-util.h
++++ b/src/shared/gcrypt-util.h
+@@ -19,7 +19,21 @@
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
+ ***/
+
++#include <errno.h>
+ #include <stdbool.h>
++#include <stddef.h>
++
++#ifdef HAVE_GCRYPT
++#include <gcrypt.h>
+
+ void initialize_libgcrypt(bool secmem);
+ int string_hashsum(const char *s, size_t len, int md_algorithm, char **out);
++#endif
++
++static inline int string_hashsum_sha224(const char *s, size_t len, char **out) {
++#ifdef HAVE_GCRYPT
++ return string_hashsum(s, len, GCRY_MD_SHA224, out);
++#else
++ return -EOPNOTSUPP;
++#endif
++}
+--
+2.4.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/init b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/init
new file mode 100644
index 000000000..ea52be482
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/run-ptest b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/run-ptest
new file mode 100644
index 000000000..2ae76ffaf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/run-ptest
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+cd tests
+tar -C test -xJf test/sys.tar.xz
+make check-TESTS
+cd ..
diff --git a/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/touchscreen.rules b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd/touchscreen.rules
new file mode 100644
index 000000000..d83fd1673
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/systemd/systemd_229.bb b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd_229.bb
new file mode 100644
index 000000000..c23c749e2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/systemd/systemd_229.bb
@@ -0,0 +1,579 @@
+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"
+
+PROVIDES = "udev"
+
+PE = "1"
+
+DEPENDS = "kmod docbook-sgml-dtd-4.1-native intltool-native gperf-native acl readline libcap libcgroup qemu-native util-linux"
+
+SECTION = "base/shell"
+
+inherit useradd pkgconfig autotools perlnative update-rc.d update-alternatives qemu systemd ptest gettext bash-completion
+
+SRCREV = "714c62b46379abb7558c544665522aca91691e10"
+
+PV = "229+git${SRCPV}"
+
+SRC_URI = "git://github.com/systemd/systemd.git;protocol=git \
+ file://touchscreen.rules \
+ file://00-create-volatile.conf \
+ file://init \
+ file://run-ptest \
+ file://0003-define-exp10-if-missing.patch \
+ file://0004-Use-getenv-when-secure-versions-are-not-available.patch \
+ file://0005-binfmt-Don-t-install-dependency-links-at-install-tim.patch \
+ file://0006-configure-Check-for-additional-features-that-uclibc-.patch \
+ file://0007-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch \
+ file://0008-nspawn-Use-execvpe-only-when-libc-supports-it.patch \
+ file://0009-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch \
+ file://0010-implment-systemd-sysv-install-for-OE.patch \
+ file://0011-nss-mymachines-Build-conditionally-when-HAVE_MYHOSTN.patch \
+ file://0012-rules-whitelist-hd-devices.patch \
+ file://0013-sysv-generator-add-support-for-executing-scripts-und.patch \
+ file://0014-Make-root-s-home-directory-configurable.patch \
+ file://0015-systemd-user-avoid-using-system-auth.patch \
+ file://0016-Revert-rules-remove-firmware-loading-rules.patch \
+ file://0017-Revert-udev-remove-userspace-firmware-loading-suppor.patch \
+ file://0018-make-test-dir-configurable.patch \
+ file://0019-remove-duplicate-include-uchar.h.patch \
+ file://0020-check-for-uchar.h-in-configure.patch \
+ file://0021-include-missing.h-for-getting-secure_getenv-definiti.patch \
+ file://0022-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch \
+ file://0023-build-sys-fix-build-with-libgrcypt-disabled.patch \
+"
+SRC_URI_append_libc-uclibc = "\
+ file://0002-units-Prefer-getty-to-agetty-in-console-setup-system.patch \
+"
+SRC_URI_append_qemuall = " file://0001-core-device.c-Change-the-default-device-timeout-to-2.patch"
+
+S = "${WORKDIR}/git"
+
+LDFLAGS_append_libc-uclibc = " -lrt -lssp_nonshared -lssp "
+
+GTKDOC_DOCDIR = "${S}/docs/"
+
+PACKAGECONFIG ??= "xz \
+ ldconfig \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \
+ ${@bb.utils.contains('MACHINE_FEATURES', 'efi', 'efi', '', d)} \
+ binfmt \
+ randomseed \
+ machined \
+ backlight \
+ quotacheck \
+ bootchart \
+ hostnamed \
+ ${@bb.utils.contains('TCLIBC', 'glibc', 'myhostname sysusers', '', d)} \
+ hibernate \
+ timedated \
+ timesyncd \
+ localed \
+ kdbus \
+ ima \
+ smack \
+ logind \
+ firstboot \
+ utmp \
+ polkit \
+"
+PACKAGECONFIG_remove_libc-musl = "selinux"
+PACKAGECONFIG_remove_libc-musl = "smack"
+
+# 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[journal-upload] = "--enable-libcurl,--disable-libcurl,curl"
+# Sign the journal for anti-tampering
+PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt"
+PACKAGECONFIG[cryptsetup] = "--enable-libcryptsetup,--disable-libcryptsetup,cryptsetup"
+PACKAGECONFIG[microhttpd] = "--enable-microhttpd,--disable-microhttpd,libmicrohttpd"
+PACKAGECONFIG[elfutils] = "--enable-elfutils,--disable-elfutils,elfutils"
+PACKAGECONFIG[resolved] = "--enable-resolved,--disable-resolved"
+PACKAGECONFIG[networkd] = "--enable-networkd,--disable-networkd"
+PACKAGECONFIG[machined] = "--enable-machined,--disable-machined"
+PACKAGECONFIG[backlight] = "--enable-backlight,--disable-backlight"
+PACKAGECONFIG[quotacheck] = "--enable-quotacheck,--disable-quotacheck"
+PACKAGECONFIG[bootchart] = "--enable-bootchart,--disable-bootchart"
+PACKAGECONFIG[hostnamed] = "--enable-hostnamed,--disable-hostnamed"
+PACKAGECONFIG[myhostname] = "--enable-myhostname,--disable-myhostname"
+PACKAGECONFIG[rfkill] = "--enable-rfkill,--disable-rfkill"
+PACKAGECONFIG[hibernate] = "--enable-hibernate,--disable-hibernate"
+PACKAGECONFIG[timedated] = "--enable-timedated,--disable-timedated"
+PACKAGECONFIG[timesyncd] = "--enable-timesyncd,--disable-timesyncd"
+PACKAGECONFIG[localed] = "--enable-localed,--disable-localed"
+PACKAGECONFIG[efi] = "--enable-efi,--disable-efi"
+PACKAGECONFIG[kdbus] = "--enable-kdbus,--disable-kdbus"
+PACKAGECONFIG[ima] = "--enable-ima,--disable-ima"
+PACKAGECONFIG[smack] = "--enable-smack,--disable-smack"
+# libseccomp is found in meta-security
+PACKAGECONFIG[seccomp] = "--enable-seccomp,--disable-seccomp,libseccomp"
+PACKAGECONFIG[logind] = "--enable-logind,--disable-logind"
+PACKAGECONFIG[sysusers] = "--enable-sysusers,--disable-sysusers"
+PACKAGECONFIG[firstboot] = "--enable-firstboot,--disable-firstboot"
+PACKAGECONFIG[randomseed] = "--enable-randomseed,--disable-randomseed"
+PACKAGECONFIG[binfmt] = "--enable-binfmt,--disable-binfmt"
+PACKAGECONFIG[utmp] = "--enable-utmp,--disable-utmp"
+PACKAGECONFIG[polkit] = "--enable-polkit,--disable-polkit"
+# importd requires curl/xz/zlib/bzip2/gcrypt
+PACKAGECONFIG[importd] = "--enable-importd,--disable-importd"
+PACKAGECONFIG[libidn] = "--enable-libidn,--disable-libidn,libidn"
+PACKAGECONFIG[audit] = "--enable-audit,--disable-audit,audit"
+PACKAGECONFIG[manpages] = "--enable-manpages,--disable-manpages,libxslt-native xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
+PACKAGECONFIG[pam] = "--enable-pam,--disable-pam,libpam"
+# Verify keymaps on locale change
+PACKAGECONFIG[xkbcommon] = "--enable-xkbcommon,--disable-xkbcommon,libxkbcommon"
+# Update NAT firewall rules
+PACKAGECONFIG[iptc] = "--enable-libiptc,--disable-libiptc,iptables"
+PACKAGECONFIG[ldconfig] = "--enable-ldconfig,--disable-ldconfig,,"
+PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux"
+PACKAGECONFIG[valgrind] = "ac_cv_header_valgrind_memcheck_h=yes ac_cv_header_valgrind_valgrind_h=yes ,ac_cv_header_valgrind_memcheck_h=no ac_cv_header_valgrind_valgrind_h=no ,valgrind"
+PACKAGECONFIG[qrencode] = "--enable-qrencode,--disable-qrencode,qrencode"
+PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus"
+PACKAGECONFIG[coredump] = "--enable-coredump,--disable-coredump"
+PACKAGECONFIG[bzip2] = "--enable-bzip2,--disable-bzip2,bzip2"
+PACKAGECONFIG[lz4] = "--enable-lz4,--disable-lz4,lz4"
+PACKAGECONFIG[xz] = "--enable-xz,--disable-xz,xz"
+PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib"
+
+CACHED_CONFIGUREVARS += "ac_cv_path_KILL=${base_bindir}/kill"
+CACHED_CONFIGUREVARS += "ac_cv_path_KMOD=${base_bindir}/kmod"
+CACHED_CONFIGUREVARS += "ac_cv_path_QUOTACHECK=${sbindir}/quotacheck"
+CACHED_CONFIGUREVARS += "ac_cv_path_QUOTAON=${sbindir}/quotaon"
+CACHED_CONFIGUREVARS += "ac_cv_path_SULOGIN=${base_sbindir}/sulogin"
+
+# Helper variables to clarify locations. This mirrors the logic in systemd's
+# build system.
+rootprefix ?= "${base_prefix}"
+rootlibdir ?= "${base_libdir}"
+rootlibexecdir = "${rootprefix}/lib"
+
+CACHED_CONFIGUREVARS_class-target = "\
+ ac_cv_path_MOUNT_PATH=${base_bindir}/mount \
+ ac_cv_path_UMOUNT_PATH=${base_bindir}/umount \
+ ac_cv_path_KMOD=${base_bindir}/kmod \
+ ac_cv_path_KILL=${base_bindir}/kill \
+ ac_cv_path_SULOGIN=${base_sbindir}/sulogin \
+ ac_cv_path_KEXEC=${sbindir}/kexec \
+ ac_cv_path_QUOTACHECK=${sbindir}/quotacheck \
+ ac_cv_path_QUOTAON=${sbindir}/quotaon \
+ "
+
+EXTRA_OECONF = " --with-rootprefix=${rootprefix} \
+ --with-rootlibdir=${rootlibdir} \
+ --with-roothomedir=${ROOT_HOME} \
+ --enable-split-usr \
+ --without-python \
+ --with-sysvrcnd-path=${sysconfdir} \
+ --with-firmware-path=/lib/firmware \
+ --with-testdir=${PTEST_PATH} \
+ "
+# per the systemd README, define VALGRIND=1 to run under valgrind
+CFLAGS .= "${@bb.utils.contains('PACKAGECONFIG', 'valgrind', ' -DVALGRIND=1', '', d)}"
+
+# disable problematic GCC 5.2 optimizations [YOCTO #8291]
+FULL_OPTIMIZATION_append_arm = " -fno-schedule-insns -fno-schedule-insns2"
+
+do_configure_prepend() {
+ export NM="${HOST_PREFIX}gcc-nm"
+ export AR="${HOST_PREFIX}gcc-ar"
+ export RANLIB="${HOST_PREFIX}gcc-ranlib"
+ export KMOD="${base_bindir}/kmod"
+ if [ -d ${S}/units.pre_sed ] ; then
+ cp -r ${S}/units.pre_sed ${S}/units
+ else
+ cp -r ${S}/units ${S}/units.pre_sed
+ fi
+ sed -i -e 's:-DTEST_DIR=\\\".*\\\":-DTEST_DIR=\\\"${PTEST_PATH}/tests/test\\\":' ${S}/Makefile.am
+ sed -i -e 's:-DCATALOG_DIR=\\\".*\\\":-DCATALOG_DIR=\\\"${PTEST_PATH}/tests/catalog\\\":' ${S}/Makefile.am
+}
+
+do_install() {
+ autotools_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 -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
+ # 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
+ # if resolved is disabled, it won't handle the link of resolv.conf, so
+ # set it up ourselves
+ ln -s ../run/resolv.conf ${D}${sysconfdir}/resolv.conf
+ echo 'L! ${sysconfdir}/resolv.conf - - - - ../run/resolv.conf' >>${D}${exec_prefix}/lib/tmpfiles.d/etc.conf
+ echo 'f /run/resolv.conf 0644 root root' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
+ fi
+ install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${systemd_unitdir}/systemd-sysv-install
+}
+
+do_install_ptest () {
+ # install data files needed for tests
+ install -d ${D}${PTEST_PATH}/tests/test
+ cp -rfL ${S}/test/* ${D}${PTEST_PATH}/tests/test
+ sed -i 's/"tree"/"ls"/' ${D}${PTEST_PATH}/tests/test/udev-test.pl
+
+ install -d ${D}${PTEST_PATH}/tests/catalog
+ install ${S}/catalog/* ${D}${PTEST_PATH}/tests/catalog/
+
+ install -D ${S}/build-aux/test-driver ${D}${PTEST_PATH}/tests/build-aux/test-driver
+
+ install -d ${D}${PTEST_PATH}/tests/rules
+ install ${B}/rules/* ${D}${PTEST_PATH}/tests/rules/
+
+ # This directory needs to be there for udev-test.pl to work.
+ install -d ${D}${libdir}/udev/rules.d
+
+ # install actual test binaries
+ install -m 0755 ${B}/test-* ${D}${PTEST_PATH}/tests/
+ install -m 0755 ${B}/.libs/test-* ${D}${PTEST_PATH}/tests/
+
+ install ${B}/Makefile ${D}${PTEST_PATH}/tests/
+}
+
+python populate_packages_prepend (){
+ systemdlibdir = d.getVar("rootlibdir", True)
+ do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True)
+}
+PACKAGES_DYNAMIC += "^lib(udev|systemd).*"
+
+PACKAGES =+ "\
+ ${PN}-gui \
+ ${PN}-vconsole-setup \
+ ${PN}-initramfs \
+ ${PN}-analyze \
+ ${PN}-kernel-install \
+ ${PN}-rpm-macros \
+ ${PN}-binfmt \
+ ${PN}-pam \
+ ${PN}-zsh-completion \
+ ${PN}-xorg-xinitrc \
+ ${PN}-extra-utils \
+"
+
+SYSTEMD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'binfmt', '${PN}-binfmt', '', d)}"
+SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service"
+
+USERADD_PACKAGES = "${PN}"
+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', 'timesyncd', '--system -d / -M --shell /bin/nologin systemd-timesync;', '', d)}"
+GROUPADD_PARAM_${PN} = "-r lock; -r systemd-journal"
+
+FILES_${PN}-analyze = "${bindir}/systemd-analyze"
+
+FILES_${PN}-initramfs = "/init"
+RDEPENDS_${PN}-initramfs = "${PN}"
+
+RDEPENDS_${PN}-ptest += "gawk make perl python bash xz \
+ tzdata tzdata-americas tzdata-asia \
+ tzdata-europe tzdata-africa tzdata-antarctica \
+ tzdata-arctic tzdata-atlantic tzdata-australia \
+ tzdata-pacific tzdata-posix"
+
+FILES_${PN}-ptest += "${libdir}/udev/rules.d"
+
+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}-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 \
+ ${bindir}/systemd-nspawn \
+ ${exec_prefix}/lib/tmpfiles.d/systemd-nspawn.conf \
+ ${systemd_unitdir}/system/systemd-nspawn@.service \
+ ${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 \
+ ${rootlibexecdir}/systemd/* \
+ ${systemd_unitdir}/* \
+ ${base_libdir}/security/*.so \
+ ${libdir}/libnss_* \
+ /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 \
+ ${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 \
+ "
+
+FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
+
+RDEPENDS_${PN} += "kmod dbus util-linux-mount udev (= ${EXTENDPKGV})"
+RDEPENDS_${PN} += "volatile-binds update-rc.d"
+
+RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', '', 'systemd-serialgetty', d)} \
+ systemd-vconsole-setup \
+ systemd-extra-utils \
+ systemd-compat-units udev-hwdb \
+ util-linux-agetty util-linux-fsck e2fsprogs-e2fsck \
+ kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \
+ os-release \
+"
+
+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"
+
+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"
+
+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
+}
+
+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
+}
+
+# As this recipe builds udev, respect systemd being in DISTRO_FEATURES so
+# that we don't build both udev and systemd in world builds.
+python () {
+ if not bb.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d):
+ raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES")
+
+ import re
+ if re.match('.*musl*', d.getVar('TARGET_OS', True)) != None:
+ raise bb.parse.SkipPackage("Not _yet_ supported on musl based targets")
+}
diff --git a/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/crypt-lib.patch b/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/crypt-lib.patch
new file mode 100644
index 000000000..7b342901e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/install.patch b/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/install.patch
new file mode 100644
index 000000000..6c4225a67
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/pidof-add-m-option.patch b/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/pidof-add-m-option.patch
new file mode 100644
index 000000000..5b5dfdc00
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit-inittab/inittab b/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit-inittab/inittab
new file mode 100644
index 000000000..6abbdf455
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty b/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty
new file mode 100644
index 000000000..6eaeb7a2b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty
@@ -0,0 +1,5 @@
+#!/bin/sh
+if [ -c /dev/$2 ]
+then
+ /sbin/getty -L $1 $2
+fi
diff --git a/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb b/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
new file mode 100644
index 000000000..c5b8cdca9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
@@ -0,0 +1,86 @@
+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`
+ label=`echo ${i} | sed -e 's/tty//' -e 's/^.*;//' -e 's/;.*//'`
+ echo "$label:12345:respawn:${base_bindir}/start_getty ${j}" >> ${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 the target
+if [ "x$D" = "x" ] && [ -e /proc/consoles ]; then
+ tmp="${SERIAL_CONSOLES_CHECK}"
+ for i in $tmp
+ do
+ j=`echo ${i} | sed s/^.*\;//g`
+ if [ -z "`grep ${j} /proc/consoles`" ]; then
+ sed -i /^.*${j}$/d /etc/inittab
+ fi
+ done
+ kill -HUP 1
+else
+ if [ "${SERIAL_CONSOLES_CHECK}" = "" ]; then
+ exit 0
+ else
+ exit 1
+ fi
+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/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit/0001-This-fixes-an-issue-that-clang-reports-about-mutlipl.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit/01_bootlogd b/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit/01_bootlogd
new file mode 100644
index 000000000..a689d92d6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit/01_bootlogd
@@ -0,0 +1 @@
+f root root 0644 /var/log/boot none
diff --git a/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit/bootlogd.init b/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit/bootlogd.init
new file mode 100755
index 000000000..df5aa430c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit/rc b/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit/rc
new file mode 100755
index 000000000..7ca41ae1a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit/rcS b/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit/rcS
new file mode 100755
index 000000000..080b04f32
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit/rcS-default b/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit/rcS-default
new file mode 100644
index 000000000..709cdf6ec
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit/realpath.patch b/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit/realpath.patch
new file mode 100644
index 000000000..5e0dca3bf
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb b/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
new file mode 100644
index 000000000..884857a96
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
@@ -0,0 +1,112 @@
+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
+DEPENDS_append = " update-rc.d-native base-passwd"
+
+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 initscripts-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
+}
+
+python () {
+ if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+ raise bb.parse.SkipPackage("'sysvinit' not in DISTRO_FEATURES")
+}
diff --git a/import-layers/yocto-poky/meta/recipes-core/uclibc/site_config/funcs b/import-layers/yocto-poky/meta/recipes-core/uclibc/site_config/funcs
new file mode 100644
index 000000000..ccc85392d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/uclibc/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/import-layers/yocto-poky/meta/recipes-core/uclibc/site_config/headers b/import-layers/yocto-poky/meta/recipes-core/uclibc/site_config/headers
new file mode 100644
index 000000000..609ab5379
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/uclibc/site_config/headers
@@ -0,0 +1,156 @@
+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
+crypt.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/import-layers/yocto-poky/meta/recipes-core/uclibc/site_config/types b/import-layers/yocto-poky/meta/recipes-core/uclibc/site_config/types
new file mode 100644
index 000000000..178bd85a0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/uclibc/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/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-config.inc b/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-config.inc
new file mode 100644
index 000000000..ed7b52226
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-config.inc
@@ -0,0 +1,143 @@
+DEPENDS += "kern-tools-native"
+inherit cml1
+#
+# Set the ARCH environment variable for uClibc compilation.
+# Return value must match one of the architectures known to uClibc:
+# libc/sysdeps/*/*
+#
+
+valid_archs = "\
+alpha \
+arm \
+avr32 \
+bfin \
+c6x \
+cris \
+e1 \
+frv \
+h8300 \
+hppa \
+i386 \
+i960 \
+ia64 \
+m68k \
+microblaze \
+mips \
+nios \
+nios2 \
+powerpc \
+sh \
+sh64 \
+sparc \
+v850 \
+vax \
+x86_64 \
+xtensa \
+"
+def map_uclibc_arch(a, d):
+ """Return the uClibc architecture for the given TARGET_ARCH."""
+ import re
+
+ valid_archs = d.getVar('valid_archs', True).split()
+
+ if re.match('^(arm|sa110).*', a):
+ return 'arm'
+ elif re.match('^(i.86|athlon)$', a):
+ return 'i386'
+ elif re.match('^mips.*', a):
+ return 'mips'
+ elif re.match('^parisc.*', a):
+ return 'hppa'
+ elif re.match('^ppc.*', a):
+ return 'powerpc'
+ elif re.match('^s390.*', a):
+ return 's390'
+ elif re.match('^sh.*', a):
+ return 'sh'
+ elif re.match('^(sun|sparc).*', a):
+ return 'sparc'
+ elif re.match('^xtensa.*', a):
+ return 'xtensa'
+ elif a in valid_archs:
+ return a
+ else:
+ bb.error("cannot map '%s' to a uClibc architecture" % a)
+
+export UCLIBC_ARCH = "${@map_uclibc_arch(d.getVar('TARGET_ARCH', True), d)}"
+
+def map_uclibc_abi(o, d):
+ """Return the uClibc ABI for the given TARGET_OS."""
+ import re
+
+ arch = d.getVar('TARGET_ARCH', True)
+ if map_uclibc_arch(d.getVar('TARGET_ARCH', True), d) == "arm":
+ if re.match('.*eabi$', o):
+ return 'ARM_EABI'
+ else:
+ return 'ARM_OABI'
+ # FIXME: This is inaccurate! Handle o32, n32, n64
+ elif re.match('^mips.*64$', arch):
+ return 'MIPS_N64_ABI'
+ elif re.match('^mips.*', arch):
+ return 'MIPS_O32_ABI'
+ return ""
+
+export UCLIBC_ABI = "${@map_uclibc_abi(d.getVar('TARGET_OS', True), d)}"
+
+def map_uclibc_endian(a, d):
+ """Return the uClibc endianess for the given TARGET_ARCH."""
+ import re
+
+ # Always BE
+ if re.match('^(avr32|e1|frv|(parisc|hppa)|m68k|microblaze|powerpc.*|(sparc|sun).*)$', a):
+ return 'BIG'
+ # Possibly BE
+ elif re.match('^(((arm|sa110).*eb)|h8300.*eb|(parisc|hppa).*eb|mips|mips64|sh.*eb|xtensa.*eb)$', a):
+ return 'BIG'
+ return 'LITTLE'
+
+export UCLIBC_ENDIAN = "${@map_uclibc_endian(d.getVar('TARGET_ARCH', True), d)}"
+
+# internal helper
+def uclibc_cfg(feature, features, tokens, cnf, rem):
+ if type(tokens) == type(""):
+ tokens = [tokens]
+ rem.extend(['/^[# ]*' + token + '[ =]/d' for token in tokens])
+ if type(features) == type([]) and feature in features:
+ 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_uclibc_settings(d):
+ cnf, rem = ([], [])
+ distro_features = d.getVar('DISTRO_FEATURES', True).split()
+ uclibc_cfg('ipv4', distro_features, 'UCLIBC_HAS_IPV4', cnf, rem)
+ uclibc_cfg('ipv6', distro_features, 'UCLIBC_HAS_IPV6', cnf, rem)
+ uclibc_cfg('largefile', distro_features, 'UCLIBC_HAS_LFS', cnf, rem)
+ uclibc_cfg('nls', distro_features, 'UCLIBC_HAS_LOCALE', cnf, rem)
+ uclibc_cfg('thumb-interwork', distro_features,'USE_BX', cnf, rem)
+ uclibc_cfg('xattr', distro_features, 'UCLIBC_HAS_XATTR', cnf, rem)
+ uclibc_cfg('ssp', distro_features, 'UCLIBC_HAS_SSP', cnf, rem)
+ uclibc_cfg('ssp', distro_features, 'UCLIBC_BUILD_SSP', cnf, rem)
+ uclibc_cfg('argp', distro_features, 'UCLIBC_HAS_ARGP', cnf, rem)
+ uclibc_cfg('libc-posix-clang-wchar', distro_features,'UCLIBC_HAS_WCHAR', cnf, rem)
+ return "\n".join(cnf), "\n".join(rem)
+# X, Y = ${@features_to_uclibc_settings(d)}
+# unfortunately doesn't seem to work with bitbake, workaround:
+def features_to_uclibc_conf(d):
+ cnf, rem = features_to_uclibc_settings(d)
+ return cnf
+def features_to_uclibc_del(d):
+ cnf, rem = features_to_uclibc_settings(d)
+ return rem
+
+# 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
diff --git a/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-git.inc b/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-git.inc
new file mode 100644
index 000000000..a56fa7cb6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-git.inc
@@ -0,0 +1,17 @@
+SRCREV = "003b266cbeb370a8eae91dc256197f00798c6f93"
+
+PV = "1.0.12+git${SRCPV}"
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/uclibc-git:"
+
+SRC_URI = "git://uclibc-ng.org/git/uclibc-ng \
+ file://0001-Disable-lrount_tes-function.patch \
+ file://uClibc.machine \
+ file://uClibc.distro \
+ file://obstack.cfg \
+ file://locale.cfg \
+"
+S = "${WORKDIR}/git"
+
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+(\.\d+)*)"
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-git/0001-Disable-lrount_tes-function.patch b/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-git/0001-Disable-lrount_tes-function.patch
new file mode 100644
index 000000000..506f146a7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-git/0001-Disable-lrount_tes-function.patch
@@ -0,0 +1,37 @@
+From 14b865b3438d0df29b4969148678d8fa8943e1ef Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 16 Aug 2015 20:49:33 -0700
+Subject: [PATCH 1/7] Disable lrount_tes() function
+
+Its not used anyway, avoids some strict compiler warnings
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ test/math/libm-test.inc | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/test/math/libm-test.inc b/test/math/libm-test.inc
+index f50b48b..6d70a95 100644
+--- a/test/math/libm-test.inc
++++ b/test/math/libm-test.inc
+@@ -3470,7 +3470,6 @@ logb_test (void)
+ }
+
+
+-#if 0
+ static void
+ lround_test (void)
+ {
+@@ -3605,7 +3604,6 @@ llround_test (void)
+
+ END (llround);
+ }
+-#endif
+
+ static void
+ modf_test (void)
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-git/locale.cfg b/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-git/locale.cfg
new file mode 100644
index 000000000..fc6643516
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-git/locale.cfg
@@ -0,0 +1,3 @@
+UCLIBC_HAS_LOCALE=y
+UCLIBC_HAS_XLOCALE=y
+UCLIBC_BUILD_MINIMAL_LOCALE=y
diff --git a/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-git/obstack.cfg b/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-git/obstack.cfg
new file mode 100644
index 000000000..36bf9d6e4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-git/obstack.cfg
@@ -0,0 +1 @@
+UCLIBC_HAS_OBSTACK=y
diff --git a/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-git/uClibc.distro b/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-git/uClibc.distro
new file mode 100644
index 000000000..7785ce8bf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-git/uClibc.distro
@@ -0,0 +1,195 @@
+#
+# General Library Settings
+#
+# HAVE_NO_PIC is not set
+# DOPIC is not set
+# HAVE_NO_SHARED is not set
+# ARCH_HAS_NO_LDSO is not set
+HAVE_SHARED=y
+# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
+LDSO_LDD_SUPPORT=y
+LDSO_CACHE_SUPPORT=y
+# LDSO_PRELOAD_FILE_SUPPORT is not set
+LDSO_BASE_FILENAME="ld.so"
+# UCLIBC_STATIC_LDCONFIG is not set
+LDSO_RUNPATH=y
+UCLIBC_CTOR_DTOR=y
+LDSO_GNU_HASH_SUPPORT=y
+# HAS_NO_THREADS is not set
+UCLIBC_HAS_THREADS=y
+UCLIBC_HAS_THREADS_NATIVE=y
+PTHREADS_DEBUG_SUPPORT=y
+# LINUXTHREADS_OLD is not set
+UCLIBC_HAS_LFS=y
+# MALLOC is not set
+# MALLOC_SIMPLE is not set
+MALLOC_STANDARD=y
+MALLOC_GLIBC_COMPAT=y
+UCLIBC_DYNAMIC_ATEXIT=y
+COMPAT_ATEXIT=y
+UCLIBC_SUSV3_LEGACY=y
+UCLIBC_SUSV3_LEGACY_MACROS=y
+UCLIBC_SUSV4_LEGACY=y
+UCLIBC_HAS_SHADOW=y
+UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y
+UCLIBC_HAS___PROGNAME=y
+UNIX98PTY_ONLY=y
+ASSUME_DEVPTS=y
+UCLIBC_HAS_LIBUTIL=y
+UCLIBC_HAS_TM_EXTENSIONS=y
+UCLIBC_HAS_TZ_CACHING=y
+UCLIBC_HAS_TZ_FILE=y
+UCLIBC_HAS_TZ_FILE_READ_MANY=y
+UCLIBC_TZ_FILE_PATH="/etc/TZ"
+
+#
+# Advanced Library Settings
+#
+UCLIBC_PWD_BUFFER_SIZE=256
+UCLIBC_GRP_BUFFER_SIZE=256
+
+#
+# Networking Support
+#
+UCLIBC_HAS_IPV6=y
+UCLIBC_HAS_RPC=y
+UCLIBC_HAS_FULL_RPC=y
+UCLIBC_HAS_REENTRANT_RPC=y
+UCLIBC_USE_NETLINK=y
+UCLIBC_SUPPORT_AI_ADDRCONFIG=y
+
+UCLIBC_HAS_BSD_RES_CLOSE=y
+UCLIBC_HAS_LIBRESOLV_STUB=y
+UCLIBC_HAS_LIBNSL_STUB=y
+
+#
+# String and Stdio Support
+#
+UCLIBC_HAS_STRING_GENERIC_OPT=y
+UCLIBC_HAS_STRING_ARCH_OPT=y
+UCLIBC_HAS_CTYPE_TABLES=y
+UCLIBC_HAS_CTYPE_SIGNED=y
+# UCLIBC_HAS_CTYPE_UNSAFE is not set
+UCLIBC_HAS_CTYPE_CHECKED=y
+# UCLIBC_HAS_CTYPE_ENFORCED is not set
+UCLIBC_HAS_WCHAR=y
+# UCLIBC_HAS_LOCALE is not set
+UCLIBC_HAS_HEXADECIMAL_FLOATS=y
+UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
+UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
+UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y
+# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
+UCLIBC_HAS_STDIO_BUFSIZ_4096=y
+# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
+UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
+# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
+UCLIBC_HAS_STDIO_GETC_MACRO=y
+UCLIBC_HAS_STDIO_PUTC_MACRO=y
+UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
+# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
+UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
+UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
+UCLIBC_HAS_PRINTF_M_SPEC=y
+UCLIBC_HAS_ERRNO_MESSAGES=y
+# UCLIBC_HAS_SYS_ERRLIST is not set
+UCLIBC_HAS_SIGNUM_MESSAGES=y
+# UCLIBC_HAS_SYS_SIGLIST is not set
+UCLIBC_HAS_GNU_GETOPT=y
+UCLIBC_HAS_GNU_GETSUBOPT=y
+
+#
+# Big and Tall
+#
+UCLIBC_HAS_REGEX=y
+# UCLIBC_HAS_REGEX_OLD is not set
+UCLIBC_HAS_FNMATCH=y
+# UCLIBC_HAS_FNMATCH_OLD is not set
+UCLIBC_HAS_WORDEXP=y
+UCLIBC_HAS_NFTW=y
+UCLIBC_HAS_FTW=y
+UCLIBC_HAS_FTS=y
+UCLIBC_HAS_GLOB=y
+UCLIBC_HAS_GNU_GLOB=y
+
+#
+# Library Installation Options
+#
+SHARED_LIB_LOADER_PREFIX="/lib"
+RUNTIME_PREFIX="/"
+DEVEL_PREFIX="//usr"
+MULTILIB_DIR="lib"
+
+#
+# Security options
+#
+# UCLIBC_BUILD_PIE is not set
+# UCLIBC_HAS_ARC4RANDOM is not set
+# HAVE_NO_SSP is not set
+# UCLIBC_HAS_SSP is not set
+UCLIBC_BUILD_RELRO=y
+UCLIBC_BUILD_NOW=y
+UCLIBC_BUILD_NOEXECSTACK=y
+
+#
+# uClibc development/debugging options
+#
+CROSS_COMPILER_PREFIX=""
+UCLIBC_EXTRA_CFLAGS=""
+# DODEBUG is not set
+# DODEBUG_PT is not set
+# DOSTRIP is not set
+# DOASSERTS is not set
+# SUPPORT_LD_DEBUG is not set
+# SUPPORT_LD_DEBUG_EARLY is not set
+# UCLIBC_MALLOC_DEBUGGING is not set
+UCLIBC_HAS_BACKTRACE=y
+WARNINGS="-Wall"
+# EXTRA_WARNINGS is not set
+# DOMULTI is not set
+# UCLIBC_MJN3_ONLY is not set
+
+# math stuff for perl
+DO_C99_MATH=y
+UCLIBC_HAS_LONG_DOUBLE_MATH=y
+UCLIBC_HAS_FENV=y
+UCLIBC_LINUX_MODULE_26=y
+# UCLIBC_LINUX_MODULE_24 is not set
+UCLIBC_LINUX_SPECIFIC=y
+UCLIBC_HAS_REALTIME=y
+UCLIBC_HAS_ADVANCED_REALTIME=y
+UCLIBC_HAS_NETWORK_SUPPORT=y
+UCLIBC_HAS_SOCKET=y
+UCLIBC_HAS_BSD_ERR=y
+UCLIBC_HAS_SYSLOG=y
+UCLIBC_HAS_CRYPT=y
+UCLIBC_HAS_CRYPT_IMPL=y
+UCLIBC_HAS_GNU_ERROR=y
+UCLIBC_HAS_PTY=y
+UCLIBC_BSD_SPECIFIC=y
+UCLIBC_HAS_EPOLL=y
+UCLIBC_HAS_FLOATS=y
+
+# The below option is needed for ARM since depending
+# upong what intruction set is chosen this will be
+# enabled. As such it is harmless and will be punted
+# by menuconfig for other arches.
+
+# COMPILE_IN_THUMB_MODE is not set
+
+# needed by shadow
+UCLIBC_HAS_UTMP=y
+# needed by systemd
+UCLIBC_HAS_UTMPX=y
+UCLIBC_LINUX_MODULE_26=y
+UCLIBC_HAS_RESOLVER_SUPPORT=y
+# needed for LTP
+UCLIBC_SUSV4_LEGACY=y
+UCLIBC_HAS_OBSOLETE_BSD_SIGNAL=y
+DO_XSI_MATH=y
+UCLIBC_SV4_DEPRECATED=y
diff --git a/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-git/uClibc.machine b/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-git/uClibc.machine
new file mode 100644
index 000000000..595f444da
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-git/uClibc.machine
@@ -0,0 +1,14 @@
+#
+# Automatically generated make config: don't edit
+# Version: 0.9.32-git
+# Mon Jul 19 01:34:29 2010
+#
+#
+# Using ELF file format
+#
+FORCE_OPTIONS_FOR_ARCH=y
+ARCH_HAS_MMU=y
+ARCH_USE_MMU=y
+KERNEL_HEADERS="/usr/include"
+HAVE_DOT_CONFIG=y
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-initial_git.bb b/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-initial_git.bb
new file mode 100644
index 000000000..c937ccb10
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-initial_git.bb
@@ -0,0 +1,36 @@
+SECTION = "base"
+require uclibc.inc
+require uclibc-git.inc
+
+DEPENDS = "linux-libc-headers ncurses-native virtual/${TARGET_PREFIX}gcc-initial libgcc-initial kern-tools-native"
+PROVIDES = "virtual/${TARGET_PREFIX}libc-initial"
+
+PACKAGES = ""
+PACKAGES_DYNAMIC = ""
+
+STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
+STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${TARGET_ARCH}"
+
+do_install() {
+ # Install initial headers into the cross dir
+ make PREFIX=${D} DEVEL_PREFIX=${prefix}/ RUNTIME_PREFIX=/ \
+ install_headers install_startfiles
+
+ # add links to linux-libc-headers: final uclibc build need this.
+ for t in linux asm asm-generic; do
+ if [ -d ${D}${includedir}/$t ]; then
+ rm -rf ${D}${includedir}/$t
+ fi
+ ln -sf ${STAGING_DIR_TARGET}${includedir}/$t ${D}${includedir}/
+ done
+
+}
+do_compile() {
+ :
+}
+
+do_siteconfig () {
+ :
+}
+
+do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_TCBOOTSTRAP}/"
diff --git a/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-package.inc b/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-package.inc
new file mode 100644
index 000000000..439f84e4f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc-package.inc
@@ -0,0 +1,36 @@
+# Ensure the uclibc-dev package is processed before uclibc-staticdev to allow
+# *_nonshared.a libraries to be packaged in the uclibc-dev package.
+PACKAGES = "ldd uclibc-utils uclibc-gconv uclibc-thread-db uclibc-argp uclibc-backtrace uclibc-libcrypt uclibc-libintl uclibc-libnsl uclibc-libresolv uclibc-libm uclibc-libdl uclibc-libutil uclibc-libpthread uclibc-librt ${PN}-dbg ${PN}-dev ${PN}-staticdev ${PN}-doc ${PN}"
+
+FILES_uclibc-libcrypt = "${base_libdir}/libcrypt*.so.* ${base_libdir}/libcrypt-*.so"
+FILES_uclibc-libintl = "${base_libdir}/libintl*.so.* ${base_libdir}/libintl-*.so"
+FILES_uclibc-libnsl = "${base_libdir}/libnsl*.so.* ${base_libdir}/libnsl-*.so"
+FILES_uclibc-libresolv = "${base_libdir}/libresolv*.so.* ${base_libdir}/libresolv-*.so"
+FILES_uclibc-libm = "${base_libdir}/libm*.so.* ${base_libdir}/libm-*.so"
+FILES_uclibc-libdl = "${base_libdir}/libdl*.so.* ${base_libdir}/libdl-*.so"
+FILES_uclibc-libutil = "${base_libdir}/libutil*.so.* ${base_libdir}/libutil-*.so"
+FILES_uclibc-libpthread = "${base_libdir}/libpthread*.so.* ${base_libdir}/libpthread-*.so"
+FILES_uclibc-librt = "${base_libdir}/librt*.so.* ${base_libdir}/librt-*.so"
+
+FILES_ldd = "${bindir}/ldd"
+FILES_uclibc-utils = "${bindir} ${sbindir}"
+FILES_uclibc-gconv = "${libdir}/gconv"
+FILES_uclibc-thread-db = "${base_libdir}/libthread_db*"
+FILES_uclibc-argp = "${base_libdir}/libuargp-*.so ${base_libdir}/libuargp*.so.*"
+FILES_uclibc-backtrace = "${base_libdir}/libubacktrace-*.so ${base_libdir}/libubacktrace*.so.*"
+
+# The last line (gdb and lib1) is for uclinux-uclibc builds
+uclibc_baselibs = "${base_libdir}/ld*.so.* ${base_libdir}/ld*.so \
+ ${base_libdir}/libc*.so.* ${base_libdir}/libuClibc-*.so \
+ ${libdir}/libc.gdb ${libdir}/libc ${base_libdir}/lib1.so \
+ "
+FILES_SOLIBSDEV = "${libdir}/lib*${SOLIBSDEV}"
+FILES_${PN}-dev += "\
+ ${libdir}/lib*.so \
+ ${libdir}/*_nonshared.a \
+ ${libdir}/[S]*crt[1in].o \
+ ${libdir}/crtreloc*.o \
+ ${includedir}/*.h ${includedir}/*/*.h \
+ "
+FILES_${PN} = "${sysconfdir} ${uclibc_baselibs} /sbin/ldconfig \
+ ${libexecdir} ${datadir}/zoneinfo ${libdir}/locale"
diff --git a/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc.inc b/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc.inc
new file mode 100644
index 000000000..1d42284fb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc.inc
@@ -0,0 +1,168 @@
+SUMMARY = "C library for embedded systems"
+DESCRIPTION = "The name uClibc is an abbreviation for 'the \
+microcontroller C library'. For simplicity, uClibc is pronounced \
+'yew-see-lib-see'. The goal of uClibc is to provide as much \
+functionality as possible in a small amount of space, and it is intended \
+primarily for embedded use. It is also highly configurable in supported \
+features, at the cost of ABI differences for different configurations. \
+uClibc has been designed from the ground up to be a C library for \
+embedded Linux. It is NOT compatible with binaries linked against glibc."
+
+LICENSE = "LGPLv2.1+"
+SECTION = "libs"
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=a6f89e2100d9b6cdffcea4f398e37343 \
+ file://COPYING.LIB.boilerplate;md5=aaddeadcddeb918297e0e4afc52ce46f \
+file://${S}/test/regex/testregex.c;beginline=1;endline=31;md5=234efb227d0a40677f895e4a1e26e960"
+
+require uclibc-config.inc
+
+PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
+TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}"
+
+# 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; \
+"
+
+# For now, we will skip building of a gcc package if it is a uclibc one
+# and our build is not a uclibc one, and we skip a glibc one if our build
+# is a uclibc build.
+COMPATIBLE_HOST = ".*-uclibc.*"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+# There appears to be a parallel race in uclibc:
+# GEN /extra/locale/locale_collate.h
+# xargs: ../..//extra/locale/gen_collate: Text file busy
+# make[1]: *** [../..//extra/locale/locale_collate.h] Error 126
+PARALLEL_MAKE = ""
+
+# do_stage barfs on a CC with whitespace, therefore put the 'HOST_CC_ARCH' in
+# the CFLAGS (when building the utils).
+OEMAKE_NO_CC = "'STRIPTOOL=true' 'LD=${LD}'"
+EXTRA_OEMAKE = "${OEMAKE_NO_CC} \
+ 'HOSTCC=${BUILD_CC}' \
+ 'HOST_CFLAGS=${BUILD_CFLAGS}' \
+ 'CC=${CC}' \
+ ARCH=${UCLIBC_ARCH}"
+
+EXTRA_OEMAKE_task_do_package = "${OEMAKE_NO_CC}"
+
+# enable verbose output:
+export V="2"
+
+# -O<n> -fno-omit-frame-pointer ends up with GCC ICE on thumb as reported
+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44860
+#
+CFLAGS_remove_arm = "-fno-omit-frame-pointer"
+UCLIBC_EXTRA_CFLAGS = "${@oe_filter_out('(-I\S+|-i\S+)', '${CFLAGS}', d)}"
+
+configmangle = '/^KERNEL_HEADERS/d; \
+ /^RUNTIME_PREFIX/d; \
+ /^DEVEL_PREFIX/d; \
+ /^SHARED_LIB_LOADER_PREFIX/d; \
+ /^UCLIBC_EXTRA_CFLAGS/d; \
+ s,.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=y,g; \
+ ${@["","s,.*COMPILE_IN_THUMB_MODE.*,COMPILE_IN_THUMB_MODE=y,;"][d.getVar("ARM_INSTRUCTION_SET", True) == "thumb"]} \
+ ${@["","s,.*UCLIBC_HAS_LOCALE.*,UCLIBC_HAS_LOCALE=y,;"][d.getVar("USE_NLS", True) == "yes"]} \
+ ${@["","s,.*LDSO_GNU_HASH_SUPPORT.*,# LDSO_GNU_HASH_SUPPORT is not set,;"][d.getVar("TARGET_ARCH", True) in ['mips', 'mipsel', 'mips64', 'mips64el', 'avr32']]} \
+ /^CROSS/d; \
+ /^TARGET_ARCH=/d; \
+ /^TARGET_/s,^\([^=]*\).*,# \1 is not set,g; \
+ s,^DOSTRIP.*,# DOSTRIP is not set,g; \
+ /_[EO]*ABI/d; \
+ /HAS_FPU/d; \
+ ${@["","s,.*MULTILIB_DIR.*,MULTILIB_DIR=\"${baselib}\",;"][d.getVar("baselib", True) != "lib"]} \
+ '
+OE_FEATURES = "${@features_to_uclibc_conf(d)}"
+OE_DEL = "${@features_to_uclibc_del(d)}"
+python () {
+ if "${OE_DEL}":
+ d.setVar('configmangle_append', "${OE_DEL}" + "\n")
+
+ # by default uclibc uses mips1 ISA for o32 ABI
+ # if we use TARGET_CC_ARCH="-march=mips32" we end up
+ # with conflicting march options to gcc. Here we
+ # ask for MIPS32 ISA to match the chosen arch
+ tune = d.getVar("DEFAULTTUNE", True)
+ if tune.startswith('mips32'):
+ import re
+ tune = re.sub('(el)*(-nf)*', '', tune)
+ d.setVar('configmangle_append',
+ "/^### MIPS32_CHECK$/a\\\nCONFIG_MIPS_ISA_%s=y\n\n" % (tune.upper()))
+ 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(["CROSS_COMPILER_PREFIX=\"${TARGET_PREFIX}\"",
+ "UCLIBC_EXTRA_CFLAGS=\"${UCLIBC_EXTRA_CFLAGS}\"",
+ "KERNEL_HEADERS=\"${STAGING_INCDIR}\"",
+ "RUNTIME_PREFIX=\"/\"",
+ "DEVEL_PREFIX=\"/${prefix}\"",
+ "SHARED_LIB_LOADER_PREFIX=\"/lib\"",
+ ])
+ ))
+ d.setVar('configmangle_append',
+ "/^### TGT$/a\\\nTARGET_ARCH=\"%s\"\\nTARGET_%s=y\n" %
+ ("${UCLIBC_ARCH}", "${UCLIBC_ARCH}"))
+ d.setVar('configmangle_append',
+ "/^### FPU$/a\\\n%s\n\n" % (["UCLIBC_HAS_FPU=y","# UCLIBC_HAS_FPU is not set"][d.getVar('TARGET_FPU', True) in [ 'soft' ]]))
+ if "${UCLIBC_ENDIAN}":
+ d.setVar('configmangle_append',
+ "/^### ABI$/a\\\nARCH_WANTS_%s_ENDIAN=y\n\n" % ("${UCLIBC_ENDIAN}"))
+ if "${UCLIBC_ABI}":
+ d.setVar('configmangle_append',
+ "/^### ABI$/a\\\nCONFIG_%s=y\n\n" % ("${UCLIBC_ABI}"))
+}
+
+python do_patch_append() {
+ import subprocess
+ subprocess.call("ln -sf ${STAGING_INCDIR}/linux ${S}/include/linux", shell=True)
+ subprocess.call("ln -sf ${STAGING_INCDIR}/asm ${S}/include/asm", shell=True)
+}
+
+do_configure() {
+ rm -f ${S}/.config
+
+ # OpenEmbedded splits the uClibc.config in two parts:
+ # uClibc.machine, uClibc.distro
+ echo "### uClibc.machine ###" >${S}/merged.config
+ cat ${WORKDIR}/uClibc.machine >>${S}/merged.config
+ echo "### uClibc.distro ###" >>${S}/merged.config
+ cat ${WORKDIR}/uClibc.distro >>${S}/merged.config
+ echo "### CROSS" >>${S}/merged.config
+ echo "### TGT" >>${S}/merged.config
+ echo "### MMU" >>${S}/merged.config
+ echo "### FPU" >>${S}/merged.config
+ echo "### ABI" >>${S}/merged.config
+ echo "### DISTRO FEATURES" >>${S}/merged.config
+ echo "### MIPS32_CHECK" >>${S}/merged.config
+
+ # Mangle the resulting .config depending on OE variables
+ sed -i -e '${configmangle}' ${S}/merged.config
+ cp ${S}/merged.config .config
+ merge_config.sh -r -n -m .config ${@" ".join(find_cfgs(d))}
+ cml1_do_configure
+
+}
+
+do_install() {
+ oe_runmake PREFIX=${D} install
+ rm -rf ${D}${includedir}/iconv.h
+}
+
+# build ldd, ldconfig and friends but only for full uclibc
+do_install_append_pn-uclibc () {
+ oe_runmake PREFIX=${D} "SSP_ALL_CFLAGS=${TARGET_LINK_HASH_STYLE}" -C utils utils_install
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc_git.bb b/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc_git.bb
new file mode 100644
index 000000000..fd02b3d61
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/uclibc/uclibc_git.bb
@@ -0,0 +1,22 @@
+require uclibc.inc
+require uclibc-package.inc
+require uclibc-git.inc
+
+STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
+STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${TARGET_ARCH}"
+
+PROVIDES += "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc"
+
+DEPENDS = "virtual/${TARGET_PREFIX}binutils \
+ virtual/${TARGET_PREFIX}gcc-initial \
+ virtual/${TARGET_PREFIX}libc-initial \
+ linux-libc-headers ncurses-native \
+ libgcc-initial kern-tools-native"
+
+RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
+RPROVIDES_${PN}-dev += "libc-dev virtual-libc-dev"
+# uclibc does not really have libsegfault but then using the one from glibc is also not
+# going to work. So we pretend that we have it to make bitbake not pull other recipes
+# to satisfy this dependency for the images/tasks
+
+RPROVIDES_${PN} += "libsegfault rtld(GNU_HASH)"
diff --git a/import-layers/yocto-poky/meta/recipes-core/udev/eudev/devfs-udev.rules b/import-layers/yocto-poky/meta/recipes-core/udev/eudev/devfs-udev.rules
new file mode 100644
index 000000000..0ba1ad4e7
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/udev/eudev/init b/import-layers/yocto-poky/meta/recipes-core/udev/eudev/init
new file mode 100644
index 000000000..0ab028b39
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/udev/eudev/init
@@ -0,0 +1,142 @@
+#!/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
+SYSCONF_CACHED="/etc/udev/cache.data"
+SYSCONF_TMP="/dev/shm/udev.cache"
+DEVCACHE_REGEN="/dev/shm/udev-regen" # create to request cache regen
+
+# A list of files which are used as a criteria to judge whether the udev cache could be reused.
+CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices"
+[ -f /proc/atags ] && CMP_FILE_LIST="$CMP_FILE_LIST /proc/atags"
+
+# List of files whose metadata (size/mtime/name) will be included in cached
+# system state.
+META_FILE_LIST="lib/udev/rules.d/* etc/udev/rules.d/*"
+
+# Command to compute system configuration.
+sysconf_cmd () {
+ cat -- $CMP_FILE_LIST
+ stat -c '%s %Y %n' -- $META_FILE_LIST | awk -F/ '{print $1 " " $NF;}'
+}
+
+[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache
+[ -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
+
+ # Cache handling.
+ if [ "$DEVCACHE" != "" ]; then
+ if [ -e $DEVCACHE ]; then
+ sysconf_cmd > "$SYSCONF_TMP"
+ if cmp $SYSCONF_CACHED $SYSCONF_TMP >/dev/null; then
+ tar xmf $DEVCACHE -C / -m
+ not_first_boot=1
+ [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE"
+ [ -e $SYSCONF_TMP ] && rm -f "$SYSCONF_TMP"
+ [ -e "$DEVCACHE_REGEN" ] && rm -f "$DEVCACHE_REGEN"
+ else
+ # Output detailed reason why the cached /dev is not used
+ cat <<EOF
+udev: Not using udev cache because of changes detected in the following files:
+udev: $CMP_FILE_LIST
+udev: $META_FILE_LIST
+udev: The udev cache will be regenerated. To identify the detected changes,
+udev: compare the cached sysconf at $SYSCONF_CACHED
+udev: against the current sysconf at $SYSCONF_TMP
+EOF
+ touch "$DEVCACHE_REGEN"
+ fi
+ else
+ if [ "$ROOTFS_READ_ONLY" != "yes" ]; then
+ # If rootfs is not read-only, it's possible that a new udev cache would be generated;
+ # otherwise, we do not bother to read files.
+ touch "$DEVCACHE_REGEN"
+ fi
+ fi
+ fi
+
+ # 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/import-layers/yocto-poky/meta/recipes-core/udev/eudev/links.conf b/import-layers/yocto-poky/meta/recipes-core/udev/eudev/links.conf
new file mode 100644
index 000000000..8fff922db
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/udev/eudev/local.rules b/import-layers/yocto-poky/meta/recipes-core/udev/eudev/local.rules
new file mode 100644
index 000000000..d502cdd6b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/udev/eudev/permissions.rules b/import-layers/yocto-poky/meta/recipes-core/udev/eudev/permissions.rules
new file mode 100644
index 000000000..205b73329
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/udev/eudev/run.rules b/import-layers/yocto-poky/meta/recipes-core/udev/eudev/run.rules
new file mode 100644
index 000000000..75d71375b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/udev/eudev/udev-cache b/import-layers/yocto-poky/meta/recipes-core/udev/eudev/udev-cache
new file mode 100644
index 000000000..dcfff1cb4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/udev/eudev/udev-cache
@@ -0,0 +1,75 @@
+#!/bin/sh -e
+
+### BEGIN INIT INFO
+# Provides: udev-cache
+# Required-Start: mountall
+# Required-Stop:
+# Default-Start: S
+# Default-Stop:
+# Short-Description: cache /dev to speedup the udev next boot
+### END INIT INFO
+
+export TZ=/etc/localtime
+
+[ -r /proc/mounts ] || exit 1
+[ -x @UDEVD@ ] || exit 1
+[ -d /sys/class ] || exit 1
+
+[ -f /etc/default/rcS ] && . /etc/default/rcS
+DEVCACHE_TMP="/dev/shm/udev-cache-tmp.tar"
+SYSCONF_CACHED="/etc/udev/cache.data"
+SYSCONF_TMP="/dev/shm/udev.cache"
+DEVCACHE_REGEN="/dev/shm/udev-regen" # create to request cache regen
+
+# A list of files which are used as a criteria to judge whether the udev cache could be reused.
+CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices"
+[ -f /proc/atags ] && CMP_FILE_LIST="$CMP_FILE_LIST /proc/atags"
+
+# List of files whose metadata (size/mtime/name) will be included in cached
+# system state.
+META_FILE_LIST="lib/udev/rules.d/* etc/udev/rules.d/*"
+
+# Command to compute system configuration.
+sysconf_cmd () {
+ cat -- $CMP_FILE_LIST
+ stat -c '%s %Y %n' -- $META_FILE_LIST | awk -F/ '{print $1 " " $NF;}'
+}
+
+[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache
+
+if [ "$ROOTFS_READ_ONLY" = "yes" ]; then
+ [ "$VERBOSE" != "no" ] && echo "udev-cache: read-only rootfs, skip generating udev-cache"
+ exit 0
+fi
+
+[ "$DEVCACHE" != "" ] || exit 0
+[ "${VERBOSE}" == "no" ] || echo -n "udev-cache: checking for ${DEVCACHE_REGEN}... "
+if ! [ -e "$DEVCACHE_REGEN" ]; then
+ [ "${VERBOSE}" == "no" ] || echo "not found."
+ exit 0
+fi
+[ "${VERBOSE}" == "no" ] || echo "found."
+echo "Populating dev cache"
+
+err_cleanup () {
+ echo "udev-cache: update failed!"
+ udevadm control --start-exec-queue
+ rm -f -- "$SYSCONF_TMP" "$DEVCACHE_TMP" "$DEVCACHE" "$SYSCONF_CACHED"
+}
+
+(
+ set -e
+ trap 'err_cleanup' EXIT
+ udevadm control --stop-exec-queue
+ sysconf_cmd > "$SYSCONF_TMP"
+ find /dev -xdev \( -type b -o -type c -o -type l \) | cut -c 2- \
+ | xargs tar cf "${DEVCACHE_TMP}"
+ gzip < "${DEVCACHE_TMP}" > "$DEVCACHE"
+ rm -f "${DEVCACHE_TMP}"
+ mv "$SYSCONF_TMP" "$SYSCONF_CACHED"
+ udevadm control --start-exec-queue
+ rm -f "$DEVCACHE_REGEN"
+ trap - EXIT
+) &
+
+exit 0
diff --git a/import-layers/yocto-poky/meta/recipes-core/udev/eudev/udev-cache.default b/import-layers/yocto-poky/meta/recipes-core/udev/eudev/udev-cache.default
new file mode 100644
index 000000000..a3b732698
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/udev/eudev/udev-cache.default
@@ -0,0 +1,5 @@
+# Default for /etc/init.d/udev
+
+# Comment this out to disable device cache
+DEVCACHE="/etc/udev-cache.tar.gz"
+PROBE_PLATFORM_BUS="yes"
diff --git a/import-layers/yocto-poky/meta/recipes-core/udev/eudev/udev.rules b/import-layers/yocto-poky/meta/recipes-core/udev/eudev/udev.rules
new file mode 100644
index 000000000..a19d4a0bf
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/udev/eudev_3.1.5.bb b/import-layers/yocto-poky/meta/recipes-core/udev/eudev_3.1.5.bb
new file mode 100644
index 000000000..ea19ec413
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/udev/eudev_3.1.5.bb
@@ -0,0 +1,107 @@
+SUMMARY = "eudev is a fork of systemd's udev"
+HOMEPAGE = "https://wiki.gentoo.org/wiki/Eudev"
+LICENSE = "GPLv2.0+"
+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 = "https://github.com/gentoo/${BPN}/archive/v${PV}.tar.gz \
+ file://devfs-udev.rules \
+ file://init \
+ file://links.conf \
+ file://local.rules \
+ file://permissions.rules \
+ file://run.rules \
+ file://udev-cache \
+ file://udev-cache.default \
+ file://udev.rules \
+"
+UPSTREAM_CHECK_URI = "https://github.com/gentoo/eudev/releases"
+
+SRC_URI[md5sum] = "e130f892d8744e292cb855db79935f68"
+SRC_URI[sha256sum] = "ce9d5fa91e3a42c7eb95512ca0fa2a631e89833053066bb6cdf42046b2a88553"
+
+inherit autotools update-rc.d qemu
+
+EXTRA_OECONF = " \
+ --sbindir=${base_sbindir} \
+ --libexecdir=${nonarch_base_libdir} \
+ --with-rootlibdir=${base_libdir} \
+ --with-rootprefix= \
+"
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/udev
+ install -m 0755 ${WORKDIR}/udev-cache ${D}${sysconfdir}/init.d/udev-cache
+ sed -i s%@UDEVD@%${base_sbindir}/udevd% ${D}${sysconfdir}/init.d/udev
+ sed -i s%@UDEVD@%${base_sbindir}/udevd% ${D}${sysconfdir}/init.d/udev-cache
+
+ install -d ${D}${sysconfdir}/default
+ install -m 0755 ${WORKDIR}/udev-cache.default ${D}${sysconfdir}/default/udev-cache
+
+ touch ${D}${sysconfdir}/udev/cache.data
+
+ 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
+
+ # Fix for multilib systems where libs along with confs are installed incorrectly
+ if ! [ -d ${D}${nonarch_base_libdir}/udev ]
+ then
+ install -d ${D}${nonarch_base_libdir}/udev
+ mv ${D}${base_libdir}/udev ${D}${nonarch_base_libdir}
+ fi
+
+ # hid2hci has moved to bluez4. removed in udev as of version 169
+ rm -f ${D}${base_libdir}/udev/hid2hci
+}
+
+INITSCRIPT_PACKAGES = "eudev udev-cache"
+INITSCRIPT_NAME_eudev = "udev"
+INITSCRIPT_PARAMS_eudev = "start 04 S ."
+INITSCRIPT_NAME_udev-cache = "udev-cache"
+INITSCRIPT_PARAMS_udev-cache = "start 36 S ."
+
+PACKAGES =+ "libudev"
+PACKAGES =+ "udev-cache"
+PACKAGES =+ "eudev-hwdb"
+
+
+FILES_${PN} += "${libexecdir} ${nonarch_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_udev-cache = "${sysconfdir}/init.d/udev-cache ${sysconfdir}/default/udev-cache"
+FILES_eudev-hwdb = "${sysconfdir}/udev/hwdb.d"
+
+RDEPENDS_eudev-hwdb += "eudev"
+
+RRECOMMENDS_${PN} += "udev-cache eudev-hwdb"
+
+RPROVIDES_${PN} = "hotplug udev"
+
+python () {
+ if bb.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d):
+ raise bb.parse.SkipPackage("'systemd' in DISTRO_FEATURES")
+}
+
+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/import-layers/yocto-poky/meta/recipes-core/udev/udev-extraconf/automount.rules b/import-layers/yocto-poky/meta/recipes-core/udev/udev-extraconf/automount.rules
new file mode 100644
index 000000000..62578ea63
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/udev/udev-extraconf/autonet.rules b/import-layers/yocto-poky/meta/recipes-core/udev/udev-extraconf/autonet.rules
new file mode 100644
index 000000000..19676aa13
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/udev/udev-extraconf/localextra.rules b/import-layers/yocto-poky/meta/recipes-core/udev/udev-extraconf/localextra.rules
new file mode 100644
index 000000000..3d51d3e39
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/udev/udev-extraconf/mount.blacklist b/import-layers/yocto-poky/meta/recipes-core/udev/udev-extraconf/mount.blacklist
new file mode 100644
index 000000000..e49349428
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/udev/udev-extraconf/mount.sh b/import-layers/yocto-poky/meta/recipes-core/udev/udev-extraconf/mount.sh
new file mode 100644
index 000000000..d760328a0
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/udev/udev-extraconf/network.sh b/import-layers/yocto-poky/meta/recipes-core/udev/udev-extraconf/network.sh
new file mode 100644
index 000000000..3ee92714a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/udev/udev-extraconf_1.1.bb b/import-layers/yocto-poky/meta/recipes-core/udev/udev-extraconf_1.1.bb
new file mode 100644
index 000000000..ecd4a8aab
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/udev/udev-extraconf_1.1.bb
@@ -0,0 +1,42 @@
+SUMMARY = "Extra machine specific configuration files"
+DESCRIPTION = "Extra machine specific configuration files for udev, specifically blacklist information."
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+ 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/import-layers/yocto-poky/meta/recipes-core/update-rc.d/update-rc.d/add-verbose.patch b/import-layers/yocto-poky/meta/recipes-core/update-rc.d/update-rc.d/add-verbose.patch
new file mode 100644
index 000000000..fb443ff15
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/update-rc.d/update-rc.d/check-if-symlinks-are-valid.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/update-rc.d/update-rc.d/fix-to-handle-priority-numbers-correctly.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/update-rc.d/update-rc.d_0.7.bb b/import-layers/yocto-poky/meta/recipes-core/update-rc.d/update-rc.d_0.7.bb
new file mode 100644
index 000000000..c15cb7803
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/update-rc.d/update-rc.d_0.7.bb
@@ -0,0 +1,31 @@
+SUMMARY = "manage symlinks in /etc/rcN.d"
+DESCRIPTION = "update-rc.d is a utilities 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 \
+ "
+
+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/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux.inc b/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux.inc
new file mode 100644
index 000000000..a1614c22f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux.inc
@@ -0,0 +1,311 @@
+SUMMARY = "A suite of basic system administration utilities"
+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"
+
+inherit autotools gettext pkgconfig systemd update-alternatives python-dir ptest bash-completion
+DEPENDS = "zlib ncurses"
+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 util-linux-blkid \
+ util-linux-mkfs util-linux-mcookie util-linux-reset \
+ util-linux-mkfs.cramfs util-linux-fsck.cramfs util-linux-fstrim \
+ util-linux-partx util-linux-hwclock util-linux-mountpoint \
+ util-linux-findfs util-linux-getopt util-linux-sulogin"
+PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 'util-linux-pylibmount', '', d)}"
+PACKAGES =+ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'util-linux-runuser', '', 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-reset --disable-login \
+ --disable-vipw --disable-newgrp --disable-chfn-chsh \
+ --enable-write --enable-mount \
+ --enable-libuuid --enable-libblkid --enable-fsck --without-udev \
+ usrsbin_execdir='${sbindir}' \
+"
+
+EXTRA_OECONF = "${SHARED_EXTRA_OECONF} --libdir=${base_libdir}"
+
+PACKAGECONFIG_class-target ?= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '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 --enable-pylibmount,--without-python --disable-pylibmount,python"
+
+# Readline support
+PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
+
+FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*"
+
+FILES_${PN}-dev += "${libdir}/${PYTHON_DIR}/dist-packages/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-reset = "${base_bindir}/reset"
+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-pylibmount = "${libdir}/${PYTHON_DIR}/dist-packages/libmount/pylibmount.so \
+ ${libdir}/${PYTHON_DIR}/dist-packages/libmount/__init__.*"
+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}"
+
+# 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"
+
+# reset calls 'tput'
+RDEPENDS_util-linux-reset += "ncurses"
+
+RDEPENDS_util-linux-runuser += "libpam"
+
+RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup util-linux-sulogin"
+RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'util-linux-runuser', '', d)}"
+
+RRECOMMENDS_${PN} = "util-linux-fdisk util-linux-cfdisk util-linux-sfdisk util-linux-mount util-linux-readprofile util-linux-mkfs util-linux-mountpoint"
+
+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"
+ binprogs_a="dmesg getopt kill more umount mount login reset 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.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" = "pam" ]; 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
+}
+
+# reset and nologin causes a conflict with ncurses-native and shadow-native
+do_install_append_class-native () {
+ rm -f ${D}${base_bindir}/reset
+ rm -f ${D}${base_sbindir}/nologin
+}
+
+ALTERNATIVE_PRIORITY = "80"
+
+ALTERNATIVE_${PN} = "dmesg kill more mkswap blockdev pivot_root switch_root"
+ALTERNATIVE_${PN} += "mkfs.minix hexdump last lastb logger mesg renice wall"
+ALTERNATIVE_${PN} += "setsid chrt flock utmpdump eject"
+
+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[mkfs.minix] = "${base_sbindir}/mkfs.minix"
+ALTERNATIVE_LINK_NAME[eject] = "${bindir}/eject"
+
+ALTERNATIVE_${PN}-doc = "mountpoint.1 last.1 lastb.1 mesg.1 wall.1 nologin.8 sulogin.8 utmpdump.1 reset.1 kill.1 libblkid.3 blkid.8 findfs.8 fsck.8 uuid.3"
+
+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[reset.1] = "${mandir}/man1/reset.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"
+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_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.minix fsck"
+ALTERNATIVE_LINK_NAME[fsck.minix] = "${base_sbindir}/fsck.minix"
+ALTERNATIVE_LINK_NAME[fsck] = "${base_sbindir}/fsck"
+
+ALTERNATIVE_util-linux-blkid = "blkid"
+ALTERNATIVE_LINK_NAME[blkid] = "${base_sbindir}/blkid"
+
+ALTERNATIVE_util-linux-reset = "reset"
+ALTERNATIVE_LINK_NAME[reset] = "${bindir}/reset"
+ALTERNATIVE_TARGET[reset] = "${base_bindir}/reset"
+
+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', True).split():
+ alt_name = "su"
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, '%s/%s' % (d.getVar('base_bindir', True), alt_name))
+ d.appendVar('ALTERNATIVE_%s' % (d.getVar('PN', True)), ' ' + alt_name)
+}
+
+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}-ptest = "bash"
+
+do_compile_ptest() {
+ oe_runmake buildtest-TESTS
+}
+
+do_install_ptest() {
+ mkdir -p ${D}${PTEST_PATH}/tests/ts
+ find . -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \;
+ cp ${S}/tests/functions.sh ${D}${PTEST_PATH}/tests/
+ cp ${S}/tests/commands.sh ${D}${PTEST_PATH}/tests/
+ cp ${S}/tests/run.sh ${D}${PTEST_PATH}/tests/
+ cp -pR ${S}/tests/expected ${D}${PTEST_PATH}/tests/expected
+
+ list="bitops build-sys cal col colrm column dmesg fsck hexdump hwclock ipcs isosize login look md5 misc more namei paths schedutils script swapon tailf"
+ # The following tests are not installed yet:
+ # blkid scsi_debug module dependent
+ # cramfs gcc dependent
+ # eject gcc dependent
+ # fdisk scsi_debug module and gcc dependent
+ # lscpu gcc dependant
+ # libmount uuidgen dependent
+ # mount gcc dependant
+ # partx blkid dependant
+ for d in $list; do
+ cp -pR ${S}/tests/ts/$d ${D}${PTEST_PATH}/tests/ts/
+ done
+}
diff --git a/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch b/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch
new file mode 100644
index 000000000..46d4d3765
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch
@@ -0,0 +1,19 @@
+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
+
+diff -ruN a/configure.ac b/configure.ac
+--- a/configure.ac 2014-05-27 12:37:42.119772658 +0200
++++ b/configure.ac 2014-05-27 12:41:46.225573272 +0200
+@@ -10,7 +10,7 @@
+ 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 dist-bzip2 no-dist-gzip dist-xz -Wno-portability subdir-objects])
++AM_INIT_AUTOMAKE([-Wall foreign 1.10 tar-pax dist-bzip2 no-dist-gzip dist-xz -Wno-portability subdir-objects serial-tests])
+
+ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
+ [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
diff --git a/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/avoid_unsupported_grep_opts.patch b/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/avoid_unsupported_grep_opts.patch
new file mode 100644
index 000000000..a0d5efad0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/avoid_unsupported_grep_opts.patch
@@ -0,0 +1,57 @@
+Avoid unsupported grep options
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Pending
+
+diff -ruN a/ts/ipcs/headers b/ts/ipcs/headers
+--- a/tests/ts/ipcs/headers 2013-09-04 11:03:36.118613250 +0200
++++ b/teste/ts/ipcs/headers 2013-09-04 11:03:27.906958437 +0200
+@@ -22,35 +22,35 @@
+ ts_init "$*"
+
+ ts_log "test: shm headers"
+-$TS_CMD_IPCS -m -t | grep --after-context=1 "^---" >> $TS_OUTPUT
+-$TS_CMD_IPCS -m -p | grep --after-context=1 "^---" >> $TS_OUTPUT
+-$TS_CMD_IPCS -m -c | grep --after-context=1 "^---" >> $TS_OUTPUT
++$TS_CMD_IPCS -m -t | grep -A 1 "^---" >> $TS_OUTPUT
++$TS_CMD_IPCS -m -p | grep -A 1 "^---" >> $TS_OUTPUT
++$TS_CMD_IPCS -m -c | grep -A 1 "^---" >> $TS_OUTPUT
+ $TS_CMD_IPCS -m -l | grep "^---" >> $TS_OUTPUT
+ $TS_CMD_IPCS -m -u | grep "^---" >> $TS_OUTPUT
+ echo >> $TS_OUTPUT
+
+ ts_log "test: mesg headers"
+-$TS_CMD_IPCS -q -t | grep --after-context=1 "^---" >> $TS_OUTPUT
+-$TS_CMD_IPCS -q -p | grep --after-context=1 "^---" >> $TS_OUTPUT
+-$TS_CMD_IPCS -q -c | grep --after-context=1 "^---" >> $TS_OUTPUT
++$TS_CMD_IPCS -q -t | grep -A 1 "^---" >> $TS_OUTPUT
++$TS_CMD_IPCS -q -p | grep -A 1 "^---" >> $TS_OUTPUT
++$TS_CMD_IPCS -q -c | grep -A 1 "^---" >> $TS_OUTPUT
+ $TS_CMD_IPCS -q -l | grep "^---" >> $TS_OUTPUT
+ $TS_CMD_IPCS -q -u | grep "^---" >> $TS_OUTPUT
+ echo >> $TS_OUTPUT
+
+ ts_log "test: sem headers"
+-$TS_CMD_IPCS -s -t | grep --after-context=1 "^---" >> $TS_OUTPUT
+-$TS_CMD_IPCS -s -p | grep --after-context=1 "^---" >> $TS_OUTPUT
+-$TS_CMD_IPCS -s -c | grep --after-context=1 "^---" >> $TS_OUTPUT
++$TS_CMD_IPCS -s -t | grep -A 1 "^---" >> $TS_OUTPUT
++$TS_CMD_IPCS -s -p | grep -A 1 "^---" >> $TS_OUTPUT
++$TS_CMD_IPCS -s -c | grep -A 1 "^---" >> $TS_OUTPUT
+ $TS_CMD_IPCS -s -l | grep "^---" >> $TS_OUTPUT
+ $TS_CMD_IPCS -s -u | grep "^---" >> $TS_OUTPUT
+ echo >> $TS_OUTPUT
+
+ ts_log "test: all headers"
+-$TS_CMD_IPCS -a | grep --after-context=1 "^---" >> $TS_OUTPUT
++$TS_CMD_IPCS -a | grep -A 1 "^---" >> $TS_OUTPUT
+
+-$TS_CMD_IPCS -a -t | grep --after-context=1 "^---" >> $TS_OUTPUT
+-$TS_CMD_IPCS -a -p | grep --after-context=1 "^---" >> $TS_OUTPUT
+-$TS_CMD_IPCS -a -c | grep --after-context=1 "^---" >> $TS_OUTPUT
++$TS_CMD_IPCS -a -t | grep -A 1 "^---" >> $TS_OUTPUT
++$TS_CMD_IPCS -a -p | grep -A 1 "^---" >> $TS_OUTPUT
++$TS_CMD_IPCS -a -c | grep -A 1 "^---" >> $TS_OUTPUT
+ $TS_CMD_IPCS -a -l | grep "^---" >> $TS_OUTPUT
+ $TS_CMD_IPCS -a -u | grep "^---" >> $TS_OUTPUT
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch b/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch
new file mode 100644
index 000000000..7a63a4e05
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch
@@ -0,0 +1,20 @@
+Avoid unsupported sleep parameter
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Pending
+
+diff -ruN a/simple b/simple
+--- a/tests/ts/tailf/simple 2015-11-12 11:34:49.971817130 +0200
++++ b/tests/ts/tailf/simple 2013-11-12 11:34:37.876325128 +0200
+@@ -27,9 +27,9 @@
+
+ $TS_CMD_TAILF $INPUT > $TS_OUTPUT 2>&1 &
+
+-sleep 0.5
++sleep 1
+ echo {0..9} >> $INPUT
+-sleep 0.5
++sleep 1
+
+ rm -f $INPUT
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/configure-sbindir.patch b/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/configure-sbindir.patch
new file mode 100644
index 000000000..a5b1ff12e
--- /dev/null
+++ b/import-layers/yocto-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.22.1/configure.ac
+===================================================================
+--- util-linux-2.22.1.orig/configure.ac
++++ util-linux-2.22.1/configure.ac
+@@ -73,7 +73,10 @@ AC_SUBST([localstatedir])
+ 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])
+
+ case $libdir in
diff --git a/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch b/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch
new file mode 100644
index 000000000..0eb881085
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch
@@ -0,0 +1,18 @@
+Display testname for subtest
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Pending
+
+diff -ruN a/functions.sh b/functions.sh
+--- a/tests/functions.sh 2015-11-12 21:32:02.434542124 +0100
++++ b/tests/functions.sh 2015-11-12 21:40:37.095317280 +0100
+@@ -297,7 +297,7 @@
+ if [ "$TS_PARALLEL" == "yes" ]; then
+ TS_TITLE=$(printf "%13s: %-30s ...\n%16s: %-27s ..." "$TS_COMPONENT" "$TS_DESC" "" "$TS_SUBNAME")
+ else
+- TS_TITLE=$(printf "%16s: %-27s ..." "" "$TS_SUBNAME")
++ TS_TITLE=$(printf "%13s: %-30s ..." "$TS_COMPONENT" "$TS_SUBNAME")
+ echo -n "$TS_TITLE"
+ fi
+ }
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/ptest.patch b/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/ptest.patch
new file mode 100644
index 000000000..837f18934
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/ptest.patch
@@ -0,0 +1,17 @@
+Define TESTS variable
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Pending
+
+diff -ruN a/Makefile.am b/Makefile.am
+--- a/Makefile.am 2015-11-12 20:29:46.778396936 +0100
++++ b/Makefile.am 2015-11-12 20:32:24.342450279 +0100
+@@ -48,7 +48,7 @@
+ dist_bashcompletion_DATA =
+ check_PROGRAMS =
+ dist_check_SCRIPTS =
+-TESTS =
++TESTS = $(check_PROGRAMS)
+
+ PATHFILES =
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/run-ptest b/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/run-ptest
new file mode 100644
index 000000000..fbc2f9b56
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/runuser-l.pamd b/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/runuser-l.pamd
new file mode 100644
index 000000000..4b368ccf5
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/runuser.pamd b/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/runuser.pamd
new file mode 100644
index 000000000..48d133b9e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch b/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch
new file mode 100644
index 000000000..68bf22de8
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/util-linux-native.patch b/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/util-linux-native.patch
new file mode 100644
index 000000000..1f496dee2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/util-linux-native.patch
@@ -0,0 +1,57 @@
+Support older hosts with latest util-linux-native
+
+mkostemp is not defined on older machines. So we detect this and
+provide a define that uses mkstemp instead.
+
+O_CLOEXEC is not defined on older machines. It is however defined
+in the 'c.h' header. Fix up the users to include 'c.h'.
+
+fdisks/fdisksunlabel.c was modified to use qsort_r, however
+this is not defined on older hosts. Revert:
+ commit c69bbca9c1f6645097bd20fe3a21f5a99a2a0698
+ fdisk: (sun): use ask API, remove global variable
+
+Upstream-Status: Inappropriate [other]
+Patches revert upstream changes in order to support older
+machines.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ configure.ac | 1 +
+ include/c.h | 7 +++++++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index eb3680b..93e015f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -318,6 +318,7 @@ AC_CHECK_FUNCS([ \
+ llseek \
+ lseek64 \
+ mempcpy \
++ mkostemp \
+ nanosleep \
+ open_memstream \
+ personality \
+diff --git a/include/c.h b/include/c.h
+index e423e8b..cf33b94 100644
+--- a/include/c.h
++++ b/include/c.h
+@@ -233,6 +233,13 @@ static inline int dirfd(DIR *d)
+ #endif
+
+ /*
++ * mkostemp replacement
++ */
++#ifndef HAVE_MKOSTEMP
++#define mkostemp(template, flags) mkstemp(template)
++#endif
++
++/*
+ * MAXHOSTNAMELEN replacement
+ */
+ static inline size_t get_hostname_max(void)
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/util-linux-ng-2.16-mount_lock_path.patch b/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/util-linux-ng-2.16-mount_lock_path.patch
new file mode 100644
index 000000000..5773d7ea1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/util-linux-ng-2.16-mount_lock_path.patch
@@ -0,0 +1,27 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+The FHS indicates that /etc must be capable of being mounted R/O.
+
+The FHS also indicates that lock files belong in /var/lock, and /var must
+be R/W as soon as possible during boot.
+
+This patch moves the mtab lock file from the potentially R/O /etc, to the
+R/W /var/lock area. This lock file is used when mounting disks and making
+other mount adjustments. The _PATH_MOUNTED_TMP is not adjusted, as failing
+to write to this file does not cause any functional limitations.
+
+(Note, if /etc is R/O, then /etc/mtab should be a symlink to /proc/mounts)
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+--- util-linux-ng-2.16/include/pathnames.h.orig
++++ util-linux-ng-2.16/include/pathnames.h
+@@ -90,7 +90,7 @@
+ # endif
+ #endif
+
+-#define _PATH_MOUNTED_LOCK _PATH_MOUNTED "~"
++#define _PATH_MOUNTED_LOCK "/var/lock/mtab~"
+ #define _PATH_MOUNTED_TMP _PATH_MOUNTED ".tmp"
+
+ #ifndef _PATH_DEV
diff --git a/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/uuid-test-error-api.patch b/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/uuid-test-error-api.patch
new file mode 100644
index 000000000..1b0ff79d4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux/uuid-test-error-api.patch
@@ -0,0 +1,92 @@
+This patch adds error() API implementation for non-glibc system C libs
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: util-linux-2.27.1/tests/helpers/test_uuidd.c
+===================================================================
+--- util-linux-2.27.1.orig/tests/helpers/test_uuidd.c
++++ util-linux-2.27.1/tests/helpers/test_uuidd.c
+@@ -23,7 +23,6 @@
+ *
+ * make uuidd uuidgen localstatedir=/var
+ */
+-#include <error.h>
+ #include <libgen.h>
+ #include <pthread.h>
+ #include <stdio.h>
+@@ -39,6 +38,17 @@
+ #include "xalloc.h"
+ #include "strutils.h"
+
++#ifdef __GLIBC__
++#include <error.h>
++#else
++extern void (*error_print_progname)(void);
++extern unsigned int error_message_count;
++extern int error_one_per_line;
++
++void error(int, int, const char *, ...);
++void error_at_line(int, int, const char *, unsigned int, const char *, ...);
++#endif
++
+ #define LOG(level,args) if (loglev >= level) { fprintf args; }
+
+ size_t nprocesses = 4;
+@@ -257,6 +267,56 @@ static void object_dump(size_t idx, obje
+ fprintf(stderr, "}\n");
+ }
+
++#ifndef __GLIBC__
++extern char *__progname;
++
++void (*error_print_progname)(void) = 0;
++unsigned int error_message_count = 0;
++int error_one_per_line = 0;
++
++static void eprint(int status, int e, const char *file, unsigned int line, const char *fmt, va_list ap)
++{
++ if (file && error_one_per_line) {
++ static const char *oldfile;
++ static unsigned int oldline;
++ if (line == oldline && strcmp(file, oldfile) == 0)
++ return;
++ oldfile = file;
++ oldline = line;
++ }
++ if (error_print_progname)
++ error_print_progname();
++ else
++ fprintf(stderr, "%s: ", __progname);
++ if (file)
++ fprintf(stderr, "%s:%u: ", file, line);
++ vfprintf(stderr, fmt, ap);
++ if (e)
++ fprintf(stderr, ": %s", strerror(e));
++ putc('\n', stderr);
++ fflush(stderr);
++ error_message_count++;
++ if (status)
++ exit(status);
++}
++
++void error(int status, int e, const char *fmt, ...)
++{
++ va_list ap;
++ va_start(ap,fmt);
++ eprint(status, e, 0, 0, fmt, ap);
++ va_end(ap);
++}
++
++void error_at_line(int status, int e, const char *file, unsigned int line, const char *fmt, ...)
++{
++ va_list ap;
++ va_start(ap,fmt);
++ eprint(status, e, file, line, fmt, ap);
++ va_end(ap);
++}
++#endif /* __GLIBC__ */
++
+ int main(int argc, char *argv[])
+ {
+ size_t i, nfailed = 0, nignored = 0;
diff --git a/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux_2.27.1.bb b/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux_2.27.1.bb
new file mode 100644
index 000000000..754915831
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/util-linux/util-linux_2.27.1.bb
@@ -0,0 +1,36 @@
+MAJOR_VERSION = "2.27"
+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.patch \
+ file://util-linux-native-qsort.patch \
+ "
+
+SRC_URI += "file://util-linux-ng-2.16-mount_lock_path.patch \
+ file://configure-sbindir.patch \
+ file://runuser.pamd \
+ file://runuser-l.pamd \
+ ${OLDHOST} \
+ file://ptest.patch \
+ file://run-ptest \
+ file://avoid_unsupported_sleep_param.patch \
+ file://avoid_unsupported_grep_opts.patch \
+ file://display_testname_for_subtest.patch \
+ file://avoid_parallel_tests.patch \
+ file://uuid-test-error-api.patch \
+"
+SRC_URI[md5sum] = "3cd2698d1363a2c64091c2dadc974647"
+SRC_URI[sha256sum] = "0a818fcdede99aec43ffe6ca5b5388bff80d162f2f7bd4541dca94fecb87a290"
+
+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/import-layers/yocto-poky/meta/recipes-core/volatile-binds/files/COPYING.MIT b/import-layers/yocto-poky/meta/recipes-core/volatile-binds/files/COPYING.MIT
new file mode 100644
index 000000000..7e7d57413
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/volatile-binds/files/mount-copybind b/import-layers/yocto-poky/meta/recipes-core/volatile-binds/files/mount-copybind
new file mode 100755
index 000000000..2aeaf84dd
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/volatile-binds/files/volatile-binds.service.in b/import-layers/yocto-poky/meta/recipes-core/volatile-binds/files/volatile-binds.service.in
new file mode 100644
index 000000000..b23355a71
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-core/volatile-binds/volatile-binds.bb b/import-layers/yocto-poky/meta/recipes-core/volatile-binds/volatile-binds.bb
new file mode 100644
index 000000000..fee7275e3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/volatile-binds/volatile-binds.bb
@@ -0,0 +1,71 @@
+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\
+"
+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', True).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_volatile-binds}; do
+ install -m 0644 $service ${D}${systemd_unitdir}/system/
+ done
+}
+do_install[dirs] = "${WORKDIR}"
diff --git a/import-layers/yocto-poky/meta/recipes-core/zlib/site_config/headers b/import-layers/yocto-poky/meta/recipes-core/zlib/site_config/headers
new file mode 100644
index 000000000..50268918a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/zlib/site_config/headers
@@ -0,0 +1 @@
+zlib.h
diff --git a/import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.8/Makefile-runtests.patch b/import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.8/Makefile-runtests.patch
new file mode 100644
index 000000000..61eea8238
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.8/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/import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.8/ldflags-tests.patch b/import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.8/ldflags-tests.patch
new file mode 100644
index 000000000..19c40b745
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.8/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/import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.8/remove.ldconfig.call.patch b/import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.8/remove.ldconfig.call.patch
new file mode 100644
index 000000000..403b4825c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.8/remove.ldconfig.call.patch
@@ -0,0 +1,20 @@
+
+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 zlib-1.2.6.orig/Makefile.in zlib-1.2.6/Makefile.in
+--- zlib-1.2.6.orig/Makefile.in 2012-01-28 23:48:50.000000000 +0100
++++ zlib-1.2.6/Makefile.in 2012-02-13 15:38:20.577700723 +0100
+@@ -199,7 +199,6 @@
+ 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
+ cp zlib.3 $(DESTDIR)$(man3dir)
+ chmod 644 $(DESTDIR)$(man3dir)/zlib.3
diff --git a/import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.8/run-ptest b/import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.8/run-ptest
new file mode 100644
index 000000000..884d9dc69
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/zlib/zlib-1.2.8/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/import-layers/yocto-poky/meta/recipes-core/zlib/zlib_1.2.8.bb b/import-layers/yocto-poky/meta/recipes-core/zlib/zlib_1.2.8.bb
new file mode 100644
index 000000000..9470adb1b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-core/zlib/zlib_1.2.8.bb
@@ -0,0 +1,59 @@
+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=4;endline=23;md5=fde612df1e5933c428b73844a0c494fd"
+
+SRC_URI = "http://www.zlib.net/${BPN}-${PV}.tar.xz \
+ file://remove.ldconfig.call.patch \
+ file://Makefile-runtests.patch \
+ file://ldflags-tests.patch \
+ file://run-ptest \
+ "
+
+SRC_URI[md5sum] = "28f1205d8dd2001f26fec1e8c2cebe37"
+SRC_URI[sha256sum] = "831df043236df8e9a7667b9e3bb37e1fcb1220a0f163b6de2626774b9590d057"
+
+RDEPENDS_${PN}-ptest += "make"
+
+inherit ptest
+
+do_configure (){
+ ./configure --prefix=${prefix} --shared --libdir=${libdir}
+}
+
+do_compile (){
+ oe_runmake
+}
+
+do_compile_ptest() {
+ oe_runmake static shared
+}
+
+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}
+}
+
+# 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/import-layers/yocto-poky/meta/recipes-devtools/apt/apt-native.inc b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt-native.inc
new file mode 100644
index 000000000..27cc9ff0b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt-native.inc
@@ -0,0 +1,70 @@
+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',1))
+ infile = file(oe.path.join(indir, 'files', 'apt.conf'), 'r')
+ data = infile.read()
+ infile.close()
+
+ data = d.expand(data)
+
+ outdir = oe.path.join(d.getVar('D', True), d.getVar('sysconfdir', True), '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 = file(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/
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt-native_1.0.10.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt-native_1.0.10.1.bb
new file mode 100644
index 000000000..1e660da74
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt-native_1.0.10.1.bb
@@ -0,0 +1,4 @@
+require apt-native.inc
+
+SRC_URI += "file://noconfigure.patch \
+ file://no-curl.patch"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt-package.inc b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt-package.inc
new file mode 100644
index 000000000..a553aa21f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt-package.inc
@@ -0,0 +1,78 @@
+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"
+FILES_${PN}-utils = "${bindir}/apt-sortpkgs ${bindir}/apt-extracttemplates"
+FILES_${PN}-doc = "${@get_files_apt_doc(d, bb, d.getVar('apt-manpages', True))} \
+ ${docdir}/apt"
+FILES_${PN}-utils-doc = "${@get_files_apt_doc(d, bb, d.getVar('apt-utils-manpages', True))}"
+FILES_${PN}-dev = "${libdir}/libapt*.so ${includedir}"
+
+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/
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt.inc b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt.inc
new file mode 100644
index 000000000..78ef5a7e1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt.inc
@@ -0,0 +1,31 @@
+SUMMARY = "Advanced front-end for dpkg"
+LICENSE = "GPLv2.0+"
+SECTION = "base"
+
+SRC_URI = "http://snapshot.debian.org/archive/debian/20150805T094928Z/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 \
+ "
+SRC_URI[md5sum] = "6505c4297b338adb2087ce87bbc4a276"
+SRC_URI[sha256sum] = "3fb1de9598363c416591d49e3c285458e095b035e6c06d5b944a54e15fc9b543"
+LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=0636e73ff0215e8d672dc4c32c317bb3"
+
+# 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
+
+EXTRA_AUTORECONF = "--exclude=autopoint,autoheader"
+
+do_configure_prepend() {
+ rm -rf ${S}/buildlib/config.sub
+ rm -rf ${S}/buildlib/config.guess
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch b/import-layers/yocto-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..d33069b73
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch
@@ -0,0 +1,378 @@
+From 106797f1c66fa578dad21fd9380bf9d576573dfd 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/framework | 25 ++++----
+ test/integration/test-apt-progress-fd | 67 +++++++++----------
+ test/integration/test-apt-progress-fd-deb822 | 18 ++----
+ test/integration/test-apt-progress-fd-error | 2 +-
+ ...est-bug-769609-triggers-still-pending-after-run | 75 ----------------------
+ .../test-no-fds-leaked-to-maintainer-scripts | 6 +-
+ 7 files changed, 56 insertions(+), 146 deletions(-)
+ delete mode 100755 test/integration/test-bug-769609-triggers-still-pending-after-run
+
+diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
+index b187efb..f269764 100644
+--- a/apt-pkg/deb/dpkgpm.cc
++++ b/apt-pkg/deb/dpkgpm.cc
+@@ -1049,12 +1049,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;
+ }
+ /*}}}*/
+ #if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR < 13)
+@@ -1294,8 +1288,9 @@ bool pkgDPkgPM::GoNoABIBreak(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/framework b/test/integration/framework
+index 70ad381..00672ad 100644
+--- a/test/integration/framework
++++ b/test/integration/framework
+@@ -1178,13 +1178,10 @@ testnopackage() {
+ fi
+ }
+
+-testdpkgstatus() {
+- local STATE="$1"
+- local NR="$2"
+- shift 2
+- msgtest "Test that $NR package(s) are in state $STATE with" "dpkg -l $*"
+- local PKGS="$(dpkg -l "$@" 2>/dev/null | grep "^${STATE}" | wc -l)"
+- if [ "$PKGS" != $NR ]; then
++testdpkginstalled() {
++ msgtest "Test for correctly installed package(s) with" "dpkg -l $*"
++ local PKGS="$(dpkg -l "$@" 2>/dev/null | grep '^i' | wc -l)"
++ if [ "$PKGS" != $# ]; then
+ echo >&2 $PKGS
+ dpkg -l "$@" | grep '^[a-z]' >&2
+ msgfail
+@@ -1193,12 +1190,16 @@ testdpkgstatus() {
+ fi
+ }
+
+-testdpkginstalled() {
+- testdpkgstatus 'ii' "$#" "$@"
+-}
+-
+ testdpkgnotinstalled() {
+- testdpkgstatus 'ii' '0' "$@"
++ msgtest "Test for correctly not-installed package(s) with" "dpkg -l $*"
++ local PKGS="$(dpkg -l "$@" 2> /dev/null | grep '^i' | wc -l)"
++ if [ "$PKGS" != 0 ]; then
++ echo
++ dpkg -l "$@" | grep '^[a-z]' >&2
++ msgfail
++ else
++ msgpass
++ fi
+ }
+
+ testmarkedauto() {
+diff --git a/test/integration/test-apt-progress-fd b/test/integration/test-apt-progress-fd
+index 68cc043..d72e7e7 100755
+--- a/test/integration/test-apt-progress-fd
++++ b/test/integration/test-apt-progress-fd
+@@ -19,14 +19,13 @@ testequal "dlstatus:1:0:Retrieving file 1 of 1
+ dlstatus:1:0:Retrieving file 1 of 1
+ pmstatus:dpkg-exec:0:Running dpkg
+ pmstatus:testing:0:Installing testing (amd64)
+-pmstatus:testing:16.6667:Preparing testing (amd64)
+-pmstatus:testing:33.3333:Unpacking testing (amd64)
+-pmstatus:testing:50:Preparing to configure testing (amd64)
+-pmstatus:dpkg-exec:50:Running dpkg
+-pmstatus:testing:50:Configuring testing (amd64)
+-pmstatus:testing:66.6667:Configuring testing (amd64)
+-pmstatus:testing:83.3333:Installed testing (amd64)
+-pmstatus:dpkg-exec:83.3333:Running dpkg" cat apt-progress.log
++pmstatus:testing:20:Preparing testing (amd64)
++pmstatus:testing:40:Unpacking testing (amd64)
++pmstatus:testing:60:Preparing to configure testing (amd64)
++pmstatus:dpkg-exec:60:Running dpkg
++pmstatus:testing:60:Configuring testing (amd64)
++pmstatus:testing:80:Configuring testing (amd64)
++pmstatus:testing:100:Installed testing (amd64)" cat apt-progress.log
+
+ # upgrade
+ exec 3> apt-progress.log
+@@ -35,14 +34,13 @@ testequal "dlstatus:1:0:Retrieving file 1 of 1
+ dlstatus:1:0:Retrieving file 1 of 1
+ pmstatus:dpkg-exec:0:Running dpkg
+ pmstatus:testing:0:Installing testing (amd64)
+-pmstatus:testing:16.6667:Preparing testing (amd64)
+-pmstatus:testing:33.3333:Unpacking testing (amd64)
+-pmstatus:testing:50:Preparing to configure testing (amd64)
+-pmstatus:dpkg-exec:50:Running dpkg
+-pmstatus:testing:50:Configuring testing (amd64)
+-pmstatus:testing:66.6667:Configuring testing (amd64)
+-pmstatus:testing:83.3333:Installed testing (amd64)
+-pmstatus:dpkg-exec:83.3333:Running dpkg" cat apt-progress.log
++pmstatus:testing:20:Preparing testing (amd64)
++pmstatus:testing:40:Unpacking testing (amd64)
++pmstatus:testing:60:Preparing to configure testing (amd64)
++pmstatus:dpkg-exec:60:Running dpkg
++pmstatus:testing:60:Configuring testing (amd64)
++pmstatus:testing:80:Configuring testing (amd64)
++pmstatus:testing:100:Installed testing (amd64)" cat apt-progress.log
+
+ # reinstall
+ exec 3> apt-progress.log
+@@ -51,24 +49,22 @@ testequal "dlstatus:1:0:Retrieving file 1 of 1
+ dlstatus:1:0:Retrieving file 1 of 1
+ pmstatus:dpkg-exec:0:Running dpkg
+ pmstatus:testing:0:Installing testing (amd64)
+-pmstatus:testing:16.6667:Preparing testing (amd64)
+-pmstatus:testing:33.3333:Unpacking testing (amd64)
+-pmstatus:testing:50:Preparing to configure testing (amd64)
+-pmstatus:dpkg-exec:50:Running dpkg
+-pmstatus:testing:50:Configuring testing (amd64)
+-pmstatus:testing:66.6667:Configuring testing (amd64)
+-pmstatus:testing:83.3333:Installed testing (amd64)
+-pmstatus:dpkg-exec:83.3333:Running dpkg" cat apt-progress.log
++pmstatus:testing:20:Preparing testing (amd64)
++pmstatus:testing:40:Unpacking testing (amd64)
++pmstatus:testing:60:Preparing to configure testing (amd64)
++pmstatus:dpkg-exec:60:Running dpkg
++pmstatus:testing:60:Configuring testing (amd64)
++pmstatus:testing:80:Configuring testing (amd64)
++pmstatus:testing:100:Installed testing (amd64)" cat apt-progress.log
+
+ # and remove
+ exec 3> apt-progress.log
+ testsuccess aptget remove testing -y -o APT::Status-Fd=3
+ testequal "pmstatus:dpkg-exec:0:Running dpkg
+ pmstatus:testing:0:Removing testing (amd64)
+-pmstatus:testing:25:Preparing for removal of testing (amd64)
+-pmstatus:testing:50:Removing testing (amd64)
+-pmstatus:testing:75:Removed testing (amd64)
+-pmstatus:dpkg-exec:75:Running dpkg" cat apt-progress.log
++pmstatus:testing:33.3333:Preparing for removal of testing (amd64)
++pmstatus:testing:66.6667:Removing testing (amd64)
++pmstatus:testing:100:Removed testing (amd64)" cat apt-progress.log
+
+ # install non-native and ensure we get proper progress info
+ exec 3> apt-progress.log
+@@ -79,13 +75,12 @@ testequal "dlstatus:1:0:Retrieving file 1 of 1
+ dlstatus:1:0:Retrieving file 1 of 1
+ pmstatus:dpkg-exec:0:Running dpkg
+ pmstatus:testing2:0:Installing testing2 (i386)
+-pmstatus:testing2:16.6667:Preparing testing2 (i386)
+-pmstatus:testing2:33.3333:Unpacking testing2 (i386)
+-pmstatus:testing2:50:Preparing to configure testing2 (i386)
+-pmstatus:dpkg-exec:50:Running dpkg
+-pmstatus:testing2:50:Configuring testing2 (i386)
+-pmstatus:testing2:66.6667:Configuring testing2 (i386)
+-pmstatus:testing2:83.3333:Installed testing2 (i386)
+-pmstatus:dpkg-exec:83.3333:Running dpkg" cat apt-progress.log
++pmstatus:testing2:20:Preparing testing2 (i386)
++pmstatus:testing2:40:Unpacking testing2 (i386)
++pmstatus:testing2:60:Preparing to configure testing2 (i386)
++pmstatus:dpkg-exec:60:Running dpkg
++pmstatus:testing2:60:Configuring testing2 (i386)
++pmstatus:testing2:80:Configuring testing2 (i386)
++pmstatus:testing2:100:Installed testing2 (i386)" cat apt-progress.log
+
+ rm -f apt-progress*.log
+diff --git a/test/integration/test-apt-progress-fd-deb822 b/test/integration/test-apt-progress-fd-deb822
+index badc985..9d22794 100755
+--- a/test/integration/test-apt-progress-fd-deb822
++++ b/test/integration/test-apt-progress-fd-deb822
+@@ -27,41 +27,37 @@ 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
++Percent: 60
+ Message: Preparing to configure testing (amd64)
+
+ Status: progress
+-Percent: 50
++Percent: 60
+ Message: Running dpkg
+
+ Status: progress
+ Package: testing:amd64
+-Percent: 50
++Percent: 60
+ 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
+-Percent: 83.3333
+-Message: Running dpkg
+ " cat apt-progress.log
+
+
+diff --git a/test/integration/test-apt-progress-fd-error b/test/integration/test-apt-progress-fd-error
+index 6323007..a47095b 100755
+--- a/test/integration/test-apt-progress-fd-error
++++ b/test/integration/test-apt-progress-fd-error
+@@ -18,7 +18,7 @@ setupaptarchive
+ exec 3> apt-progress.log
+ testfailure aptget install foo1 foo2 -y -o APT::Status-Fd=3
+ msgtest "Ensure correct error message"
+-if grep -q "aptarchive/pool/foo2_0.8.15_amd64.deb:36.3636:trying to overwrite '/usr/bin/file-conflict', which is also in package foo1 0.8.15" apt-progress.log; then
++if grep -q "aptarchive/pool/foo2_0.8.15_amd64.deb:40:trying to overwrite '/usr/bin/file-conflict', which is also in package foo1 0.8.15" apt-progress.log; then
+ msgpass
+ else
+ cat apt-progress.log
+diff --git a/test/integration/test-bug-769609-triggers-still-pending-after-run b/test/integration/test-bug-769609-triggers-still-pending-after-run
+deleted file mode 100755
+index 146fa76..0000000
+--- a/test/integration/test-bug-769609-triggers-still-pending-after-run
++++ /dev/null
+@@ -1,75 +0,0 @@
+-#!/bin/sh
+-set -e
+-
+-TESTDIR=$(readlink -f $(dirname $0))
+-. $TESTDIR/framework
+-
+-setupenvironment
+-configarchitecture 'amd64'
+-
+-msgtest 'Check if installed dpkg supports' 'noawait trigger'
+-if dpkg-checkbuilddeps -d 'dpkg (>= 1.16.1)' /dev/null; then
+- msgpass
+-else
+- msgskip 'dpkg version too old'
+- exit 0
+-fi
+-configdpkgnoopchroot
+-
+-buildtriggerpackages() {
+- local TYPE="$1"
+- setupsimplenativepackage "triggerable-$TYPE" 'all' '1.0' 'unstable' "Depends: trigdepends-$TYPE"
+- BUILDDIR="incoming/triggerable-${TYPE}-1.0"
+- cat >${BUILDDIR}/debian/postinst <<EOF
+-#!/bin/sh
+-if [ "\$1" = 'triggered' ]; then
+- ls -l /proc/self/fd/
+-fi
+-EOF
+- echo "$TYPE /usr/share/doc" > ${BUILDDIR}/debian/triggers
+- buildpackage "$BUILDDIR" 'unstable' 'main' 'native'
+- rm -rf "$BUILDDIR"
+- buildsimplenativepackage "trigdepends-$TYPE" 'all' '1.0' 'unstable'
+-}
+-
+-#buildtriggerpackages 'interest'
+-buildtriggerpackages 'interest-noawait'
+-buildsimplenativepackage "trigstuff" 'all' '1.0' 'unstable'
+-
+-setupaptarchive
+-
+-runtests() {
+- local TYPE="$1"
+- msgmsg 'Working with trigger type' "$TYPE"
+- testsuccess aptget install triggerable-$TYPE -y
+- cp rootdir/tmp/testsuccess.output terminal.output
+- testsuccess grep '^REWRITE ' terminal.output
+- testdpkginstalled triggerable-$TYPE trigdepends-$TYPE
+-
+- testsuccess aptget install trigdepends-$TYPE -y --reinstall
+- cp rootdir/tmp/testsuccess.output terminal.output
+- testsuccess grep '^REWRITE ' terminal.output
+- testsuccess grep ' root root ' terminal.output
+- testdpkginstalled triggerable-$TYPE trigdepends-$TYPE
+-
+- testsuccess aptget install trigstuff -y
+- cp rootdir/tmp/testsuccess.output terminal.output
+- testsuccess grep '^REWRITE ' terminal.output
+- testsuccess grep ' root root ' terminal.output
+- testdpkginstalled triggerable-$TYPE trigdepends-$TYPE trigstuff
+-
+- testsuccess aptget purge trigstuff -y
+- cp rootdir/tmp/testsuccess.output terminal.output
+- testsuccess grep '^REWRITE ' terminal.output
+- testsuccess grep ' root root ' terminal.output
+- testdpkginstalled triggerable-$TYPE trigdepends-$TYPE
+- testdpkgnotinstalled trigstuff
+-
+- testsuccess aptget purge trigdepends-$TYPE -y
+- cp rootdir/tmp/testsuccess.output terminal.output
+- testfailure grep '^REWRITE ' terminal.output
+- testfailure grep ' root root ' terminal.output
+- testdpkgnotinstalled triggerable-$TYPE trigdepends-$TYPE
+-}
+-#runtests 'interest'
+-runtests 'interest-noawait'
+diff --git a/test/integration/test-no-fds-leaked-to-maintainer-scripts b/test/integration/test-no-fds-leaked-to-maintainer-scripts
+index 41c0570..d3960d7 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.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/0001-environment.mak-musl-based-systems-can-generate-shar.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/0001-fix-the-gcc-version-check.patch b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/0001-fix-the-gcc-version-check.patch
new file mode 100644
index 000000000..beea56d2a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/0001-fix-the-gcc-version-check.patch
@@ -0,0 +1,160 @@
+From 15c6ef6a827d3681ad06e862d27ab3dfb84cb687 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/cacheset.h | 4 ++--
+ apt-pkg/deb/debsrcrecords.cc | 12 ++++++------
+ apt-pkg/srcrecords.cc | 4 ++--
+ apt-pkg/srcrecords.h | 4 ++--
+ apt-pkg/vendorlist.cc | 4 ++--
+ 5 files changed, 14 insertions(+), 14 deletions(-)
+
+diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h
+index b7229bc..8cc2917 100644
+--- a/apt-pkg/cacheset.h
++++ b/apt-pkg/cacheset.h
+@@ -119,12 +119,12 @@ public:
+ inline std::string FullName(bool const Pretty) const { return getPkg().FullName(Pretty); }
+ inline std::string FullName() const { return getPkg().FullName(); }
+ APT_DEPRECATED inline const char *Section() const {
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+ #endif
+ return getPkg().Section();
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ #pragma GCC diagnostic pop
+ #endif
+ }
+diff --git a/apt-pkg/deb/debsrcrecords.cc b/apt-pkg/deb/debsrcrecords.cc
+index 49a348d..4bc9dcf 100644
+--- a/apt-pkg/deb/debsrcrecords.cc
++++ b/apt-pkg/deb/debsrcrecords.cc
+@@ -126,13 +126,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;
+@@ -190,14 +190,14 @@ bool debSrcRecordParser::Files2(std::vector<pkgSrcRecords::File2> &List)
+ // we have it already, store the new hash and be done
+ if (file != List.end())
+ {
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ // set for compatibility only, so warn users not us
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+ #endif
+ if (checksumField == "Files")
+ file->MD5Hash = hash;
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ #pragma GCC diagnostic pop
+ #endif
+ // an error here indicates that we have two different hashes for the same file
+@@ -212,7 +212,7 @@ bool debSrcRecordParser::Files2(std::vector<pkgSrcRecords::File2> &List)
+ F.FileSize = strtoull(size.c_str(), NULL, 10);
+ F.Hashes.push_back(hashString);
+
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ // set for compatibility only, so warn users not us
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+@@ -220,7 +220,7 @@ bool debSrcRecordParser::Files2(std::vector<pkgSrcRecords::File2> &List)
+ F.Size = F.FileSize;
+ if (checksumField == "Files")
+ F.MD5Hash = hash;
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ #pragma GCC diagnostic pop
+ #endif
+
+diff --git a/apt-pkg/srcrecords.cc b/apt-pkg/srcrecords.cc
+index 3175ee7..340e796 100644
+--- a/apt-pkg/srcrecords.cc
++++ b/apt-pkg/srcrecords.cc
+@@ -160,7 +160,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
+@@ -168,7 +168,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;
+diff --git a/apt-pkg/srcrecords.h b/apt-pkg/srcrecords.h
+index dde22bd..91f8061 100644
+--- a/apt-pkg/srcrecords.h
++++ b/apt-pkg/srcrecords.h
+@@ -30,7 +30,7 @@ class pkgSrcRecords
+ {
+ public:
+
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ // ensure that con- & de-structor don't trigger this warning
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+@@ -48,7 +48,7 @@ class pkgSrcRecords
+ unsigned long long FileSize;
+ HashStringList Hashes;
+ };
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ #pragma GCC diagnostic pop
+ #endif
+
+diff --git a/apt-pkg/vendorlist.cc b/apt-pkg/vendorlist.cc
+index fb33ff1..ba1d3c3 100644
+--- a/apt-pkg/vendorlist.cc
++++ b/apt-pkg/vendorlist.cc
+@@ -11,7 +11,7 @@
+
+ #include <apti18n.h>
+
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+ #endif
+@@ -163,6 +163,6 @@ const Vendor* pkgVendorList::FindVendor(const std::vector<string> GPGVOutput) /*
+ }
+ /*}}}*/
+
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ #pragma GCC diagnostic pop
+ #endif
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/0001-remove-Wsuggest-attribute-from-CFLAGS.patch b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/0001-remove-Wsuggest-attribute-from-CFLAGS.patch
new file mode 100644
index 000000000..7c42ff07b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/0001-remove-Wsuggest-attribute-from-CFLAGS.patch
@@ -0,0 +1,43 @@
+From 2bff7ee06a4f96e7d326991d61fb86f8aa651d48 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 b0a8d9d..91ed011 100644
+--- a/buildlib/environment.mak.in
++++ b/buildlib/environment.mak.in
+@@ -11,7 +11,6 @@ CPPFLAGS+= @CPPFLAGS@ @DEFS@ -D_REENTRANT -D_FORTIFY_SOURCE=2
+ CXX = @CXX@
+ CXXFLAGS+= @CXXFLAGS@ -Wall -Wextra
+ CXXFLAGS+= -Wcast-align -Wlogical-op -Wredundant-decls -Wmissing-declarations -Wunsafe-loop-optimizations
+-CXXFLAGS+= -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=noreturn
+ # a bit too pedantic to be run by default
+ #CXXFLAGS+= -Wpedantic -Wno-long-long -Wno-vla -Wno-variadic-macros
+ NUM_PROCS = @NUM_PROCS@
+diff --git a/test/libapt/makefile b/test/libapt/makefile
+index 7f23ace..e805f13 100644
+--- a/test/libapt/makefile
++++ b/test/libapt/makefile
+@@ -39,7 +39,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
+
+ # All Google Test headers. Usually you shouldn't change this definition.
+ GTEST_HEADERS = /usr/include/gtest/*.h \
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/disable-configure-in-makefile.patch b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/disable-configure-in-makefile.patch
new file mode 100644
index 000000000..7c2f64e3e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/disable-test.patch b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/disable-test.patch
new file mode 100644
index 000000000..676795dc8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/disable-test.patch
@@ -0,0 +1,58 @@
+[PATCH] disable test
+
+Upstream-Status: Inappropriate [configuration]
+
+test needs gtest package, so not build the test dir
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ Makefile | 7 +++----
+ configure.ac | 6 ------
+ 2 files changed, 3 insertions(+), 10 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 5f5fb27..5070e96 100644
+--- a/Makefile
++++ b/Makefile
+@@ -9,8 +9,8 @@ endif
+ .PHONY: default
+ default: startup all
+
+-.PHONY: 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: 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,9 +21,8 @@ all headers library clean veryclean binary program doc manpages docbook test upd
+ $(MAKE) -C dselect $@
+ # $(MAKE) -C doc $@
+ $(MAKE) -C po $@
+- $(MAKE) -C test $@
+
+-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
+
+diff --git a/configure.ac b/configure.ac
+index 5663aaf..b0f9564 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -89,12 +89,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_ERROR([failed: I need gtest to build tests]),
+-)
+-AC_LANG_POP([C++])
+-
+
+ AC_SUBST(BDBLIB)
+
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/fix-gcc-4.6-null-not-defined.patch b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/fix-gcc-4.6-null-not-defined.patch
new file mode 100644
index 000000000..801ae6ddd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/fix-gcc-4.6-null-not-defined.patch
@@ -0,0 +1,12 @@
+Upstream-Status: Pending
+
+--- a/apt-pkg/contrib/weakptr.h
++++ b/apt-pkg/contrib/weakptr.h
+@@ -21,6 +21,7 @@
+ #ifndef WEAK_POINTER_H
+ #define WEAK_POINTER_H
+
++#include <cstdlib>
+ #include <set>
+ /**
+ * Class for objects providing support for weak pointers.
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/makerace.patch b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/makerace.patch
new file mode 100644
index 000000000..46e3161b6
--- /dev/null
+++ b/import-layers/yocto-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-0.9.9.4/buildlib/library.mak
+===================================================================
+--- apt-0.9.9.4.orig/buildlib/library.mak 2013-07-31 15:45:07.320440575 +0300
++++ apt-0.9.9.4/buildlib/library.mak 2013-07-31 15:46:49.440440561 +0300
+@@ -61,7 +61,7 @@
+
+ # Compilation rules
+ vpath %.cc $(SUBDIRS)
+-$(OBJ)/%.opic: %.cc $(LIBRARYDEPENDS)
++$(OBJ)/%.opic: %.cc $(LIBRARYDEPENDS) $($(LOCAL)-HEADERS)
+ echo Compiling $< to $@
+ $(CXX) -c $(INLINEDEPFLAG) $(CPPFLAGS) $(CXXFLAGS) $(PICFLAGS) -o $@ $<
+ $(DoDep)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/no-nls-dpkg.patch b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/no-nls-dpkg.patch
new file mode 100644
index 000000000..a0996d4d4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/no-nls-dpkg.patch
@@ -0,0 +1,26 @@
+Upstream-Status: Pending
+
+--- a/apt-pkg/deb/dpkgpm.cc
++++ b/apt-pkg/deb/dpkgpm.cc
+@@ -42,6 +42,12 @@
+ #include <apti18n.h>
+ /*}}}*/
+
++#ifdef USE_NLS
++#define _dpkg(x) dgettext("dpkg", x)
++#else
++#define _dpkg(x) x
++#endif
++
+ using namespace std;
+
+ namespace
+@@ -1279,7 +1285,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/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/noconfigure.patch b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/noconfigure.patch
new file mode 100644
index 000000000..ebc67203b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/nodoc.patch b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/nodoc.patch
new file mode 100644
index 000000000..449e42df4
--- /dev/null
+++ b/import-layers/yocto-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-0.9.7.7/Makefile
+===================================================================
+--- apt-0.9.7.7.orig/Makefile
++++ apt-0.9.7.7/Makefile
+@@ -17,7 +17,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 $@
+ $(MAKE) -C test $@
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/truncate-filename.patch b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/truncate-filename.patch
new file mode 100644
index 000000000..db1c42b66
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/use-host.patch b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/use-host.patch
new file mode 100644
index 000000000..b30fcff0d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/apt/apt_1.0.10.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt_1.0.10.1.bb
new file mode 100644
index 000000000..85c0d5615
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt_1.0.10.1.bb
@@ -0,0 +1,19 @@
+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"
+
+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/import-layers/yocto-poky/meta/recipes-devtools/apt/files/apt.conf b/import-layers/yocto-poky/meta/recipes-devtools/apt/files/apt.conf
new file mode 100644
index 000000000..03351356b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/apt/files/db_linking_hack.patch b/import-layers/yocto-poky/meta/recipes-devtools/apt/files/db_linking_hack.patch
new file mode 100644
index 000000000..a61d4b07c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/apt/files/environment.patch b/import-layers/yocto-poky/meta/recipes-devtools/apt/files/environment.patch
new file mode 100644
index 000000000..9a0303803
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/apt/files/no-curl.patch b/import-layers/yocto-poky/meta/recipes-devtools/apt/files/no-curl.patch
new file mode 100644
index 000000000..30238faad
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/files/no-curl.patch
@@ -0,0 +1,38 @@
+Upstream-Status: Inappropriate [configuration]
+
+---
+ configure.in | 6 ------
+ methods/makefile | 7 -------
+ 2 files changed, 13 deletions(-)
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -86,12 +86,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)
+
+--- 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)
+-LIB_MAKES = apt-pkg/makefile
+-SOURCE = https.cc server.cc
+-include $(PROGRAM_H)
+-
+ # The ftp method
+ PROGRAM=ftp
+ SLIBS = -lapt-pkg $(SOCKETLIBS) $(INTLLIBS)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf.inc b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf.inc
new file mode 100644
index 000000000..b4e33569a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf.inc
@@ -0,0 +1,44 @@
+SUMMARY = "A GNU tool that procude 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"
+
+SRC_URI = "${GNU_MIRROR}/autoconf/autoconf-${PV}.tar.gz \
+ file://program_prefix.patch"
+
+inherit autotools texinfo
+
+CACHED_CONFIGUREVARS += "ac_cv_path_PERL=${USRBINPATH}/perl"
+
+do_configure() {
+ oe_runconf
+}
+
+do_install_append() {
+ rm -rf ${D}${datadir}/emacs
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/add_musl_config.patch b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/add_musl_config.patch
new file mode 100644
index 000000000..a9094d212
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autoreconf-exclude.patch b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autoreconf-exclude.patch
new file mode 100644
index 000000000..d1bd3a2a3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autoreconf-gnuconfigize.patch b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autoreconf-gnuconfigize.patch
new file mode 100644
index 000000000..5ff18c235
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autoreconf-include.patch b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autoreconf-include.patch
new file mode 100644
index 000000000..31326f0bc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autoreconf-include.patch
@@ -0,0 +1,14 @@
+Upstream-Status: Pending
+
+Index: autoconf-2.63/bin/autoreconf.in
+===================================================================
+--- autoconf-2.63.orig/bin/autoreconf.in 2008-08-28 03:08:10.000000000 +0100
++++ autoconf-2.63/bin/autoreconf.in 2008-12-31 17:38:40.000000000 +0000
+@@ -190,6 +190,7 @@
+ $autoconf .= join (' --prepend-include=', '', map { shell_quote ($_) } @prepend_include);
+ $autoheader .= join (' --include=', '', map { shell_quote ($_) } @include);
+ $autoheader .= join (' --prepend-include=', '', map { shell_quote ($_) } @prepend_include);
++ $aclocal .= join (' -I ', '', map { shell_quote ($_) } @include);
+
+ # --install and --symlink;
+ if ($install)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autotest-automake-result-format.patch b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autotest-automake-result-format.patch
new file mode 100644
index 000000000..b5e8174ef
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/check-automake-cross-warning.patch b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/check-automake-cross-warning.patch
new file mode 100644
index 000000000..73394d7d5
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/config_site.patch b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/config_site.patch
new file mode 100644
index 000000000..9f044404d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/fix_path_xtra.patch b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/fix_path_xtra.patch
new file mode 100644
index 000000000..65df88f8f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/performance.patch b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/performance.patch
new file mode 100644
index 000000000..1842fe92b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/preferbash.patch b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/preferbash.patch
new file mode 100644
index 000000000..fa76ee9bd
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/program_prefix.patch b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/program_prefix.patch
new file mode 100644
index 000000000..978a401f0
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/remove-usr-local-lib-from-m4.patch b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/remove-usr-local-lib-from-m4.patch
new file mode 100644
index 000000000..55d2e2fe7
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf_2.69.bb b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf_2.69.bb
new file mode 100644
index 000000000..adb6ad7cc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf_2.69.bb
@@ -0,0 +1,27 @@
+require autoconf.inc
+
+PR = "r11"
+
+LICENSE = "GPLv2 & GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
+ file://COPYINGv3;md5=d32239bcb673463ab874e80d47fae504"
+SRC_URI += "file://autoreconf-include.patch \
+ 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 \
+ "
+
+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/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen-native_5.18.6.bb b/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen-native_5.18.6.bb
new file mode 100644
index 000000000..d77b8273e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen-native_5.18.6.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Automated text and program generation tool"
+DESCRIPTION = "AutoGen is a tool designed to simplify the creation and\
+ maintenance of programs that contain large amounts of repetitious text.\
+ It is especially valuable in programs that have several blocks of text\
+ that must be kept synchronized."
+HOMEPAGE = "http://www.gnu.org/software/autogen/"
+SECTION = "devel"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI = "${GNU_MIRROR}/autogen/rel${PV}/autogen-${PV}.tar.gz \
+ file://increase-timeout-limit.patch \
+ file://mk-tpl-config.sh-force-exit-value-to-be-0-in-subproc.patch \
+ file://redirect-output-dir.patch \
+"
+
+SRC_URI[md5sum] = "fdee403e524c0af3ded6b3becb365671"
+SRC_URI[sha256sum] = "2fc7f12a5ecb3b1e8bd4364aa906b837cff01f80edb7d2fb38ed8b9dfbcd3271"
+
+UPSTREAM_CHECK_URI = "http://ftp.gnu.org/gnu/autogen/"
+UPSTREAM_CHECK_REGEX = "rel(?P<pver>\d+(\.\d+)+)/"
+
+DEPENDS = "guile-native libtool-native libxml2-native"
+
+inherit autotools texinfo native pkgconfig
+
+# autogen-native links against libguile which may have been relocated with sstate
+# these environment variables ensure there isn't a relocation issue
+export GUILE_LOAD_PATH = "${STAGING_DATADIR_NATIVE}/guile/2.0"
+export GUILE_LOAD_COMPILED_PATH = "${STAGING_LIBDIR_NATIVE}/guile/2.0/ccache"
+
+do_install_append () {
+ create_wrapper ${D}/${bindir}/autogen \
+ GUILE_LOAD_PATH=${STAGING_DATADIR_NATIVE}/guile/2.0 \
+ GUILE_LOAD_COMPILED_PATH=${STAGING_LIBDIR_NATIVE}/guile/2.0/ccache
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen/increase-timeout-limit.patch b/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen/increase-timeout-limit.patch
new file mode 100644
index 000000000..9efd7e558
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen/increase-timeout-limit.patch
@@ -0,0 +1,30 @@
+Subject: [PATCH] autogen: increase timeout limit for shell commands
+
+On some overloaded hosts, shell commands of autogen may can not
+finish in 5 secs. This has caused many build failures, so increase
+the timeout limit to fix this.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
+---
+ configure.ac | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 58a848b..170dd9e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -178,9 +178,9 @@ time_delta=`expr ${config_end_time} - ${config_start_time} 2>/dev/null`
+ if test -z "${AG_TIMEOUT}"
+ then
+ if test -z "${time_delta}"
+- then time_delta=10
+- elif test ${time_delta} -lt 5
+- then time_delta=5 ; fi
++ then time_delta=60
++ elif test ${time_delta} -lt 30
++ then time_delta=30 ; fi
+
+ AG_TIMEOUT=${time_delta}
+ fi
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen/mk-tpl-config.sh-force-exit-value-to-be-0-in-subproc.patch b/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen/mk-tpl-config.sh-force-exit-value-to-be-0-in-subproc.patch
new file mode 100644
index 000000000..e56da7b1d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen/mk-tpl-config.sh-force-exit-value-to-be-0-in-subproc.patch
@@ -0,0 +1,30 @@
+Upstream-Status: Pending
+
+mk-tpl-config.sh: force exit value to be 0 in subprocess
+
+The return value of statement list=`<subcommands>` is the exit value of the
+subcommands. So if the subcommands fails, the compilation fails. This is obviously
+not intended. In the normal case, we expect the grep command to fail as there should
+be no 'noreturn' word in the libguile files.
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ autoopts/mk-tpl-config.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/autoopts/mk-tpl-config.sh b/autoopts/mk-tpl-config.sh
+index 926f5ab..6b4a0fb 100755
+--- a/autoopts/mk-tpl-config.sh
++++ b/autoopts/mk-tpl-config.sh
+@@ -202,7 +202,7 @@ fix_guile() {
+
+ list=`set +e ; exec 2>/dev/null
+ find ${libguiledir}/libguile* -type f | \
+- xargs grep -l -E '\<noreturn\>'`
++ xargs grep -l -E '\<noreturn\>' ; exit 0`
+
+ test -z "$list" && exit 0
+
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen/redirect-output-dir.patch b/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen/redirect-output-dir.patch
new file mode 100644
index 000000000..fc5a71b85
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen/redirect-output-dir.patch
@@ -0,0 +1,28 @@
+[PATCH] redirect the dir of mklibsrc-log.tx
+
+Upstream-Status: Pending
+
+redirect mklibsrc-log.tx to builddir, not /tmp; otherwise mklibsrc-log.tx
+maybe unable to be written if other users is building autogen at the same time.
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ pkg/libopts/mklibsrc.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/pkg/libopts/mklibsrc.sh b/pkg/libopts/mklibsrc.sh
+index 416b402..d612fbc 100644
+--- a/pkg/libopts/mklibsrc.sh
++++ b/pkg/libopts/mklibsrc.sh
+@@ -19,7 +19,7 @@
+ ## with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ set -ex
+-exec 2> /tmp/mklibsrc-log.tx
++exec 2> $top_builddir/mklibsrc-log.tx
+
+ top_builddir=`cd $top_builddir ; pwd`
+ top_srcdir=`cd $top_srcdir ; pwd`
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/automake/automake.inc b/import-layers/yocto-poky/meta/recipes-devtools/automake/automake.inc
new file mode 100644
index 000000000..4f9b5f774
--- /dev/null
+++ b/import-layers/yocto-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', True))}"
+
+FILES_${PN} += "${datadir}/automake* ${datadir}/aclocal*"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/automake/automake/buildtest.patch b/import-layers/yocto-poky/meta/recipes-devtools/automake/automake/buildtest.patch
new file mode 100644
index 000000000..1dd533784
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/automake/automake/buildtest.patch
@@ -0,0 +1,33 @@
+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
+
+--- a/lib/am/check.am 2012-11-14 13:46:16.335475995 +0100
++++ b/lib/am/check.am 2012-08-13 18:40:12.000000000 +0200
+@@ -44,7 +44,7 @@
+ am__tty_colors = $(am__tty_colors_dummy)
+ endif !%?COLOR%
+
+-.PHONY: check-TESTS
++.PHONY: check-TESTS buildtest-TESTS runtest-TESTS
+
+ if %?PARALLEL_TESTS%
+
+@@ -465,7 +465,14 @@
+
+ else !%?PARALLEL_TESTS%
+
+-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/import-layers/yocto-poky/meta/recipes-devtools/automake/automake/new_rt_path_for_test-driver.patch b/import-layers/yocto-poky/meta/recipes-devtools/automake/automake/new_rt_path_for_test-driver.patch
new file mode 100644
index 000000000..2c6594f52
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/automake/automake/performance.patch b/import-layers/yocto-poky/meta/recipes-devtools/automake/automake/performance.patch
new file mode 100644
index 000000000..3e6d5694d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/automake/automake/python-libdir.patch b/import-layers/yocto-poky/meta/recipes-devtools/automake/automake/python-libdir.patch
new file mode 100644
index 000000000..47541bded
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/automake/automake/python-libdir.patch
@@ -0,0 +1,65 @@
+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>
+
+diff -Nurd automake-1.12.6/m4/python.m4 automake-1.12.6/m4/python.m4
+--- automake-1.12.6/m4/python.m4 2012-12-13 22:02:25.000000000 +0200
++++ automake-1.12.6/m4/python.m4 2012-12-27 17:40:26.558164660 +0200
+@@ -91,12 +91,13 @@
+ [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
+@@ -148,7 +149,8 @@
+ else:
+ from distutils import sysconfig
+ sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix')
+-sys.stdout.write(sitedir)"`
++sys.stdout.write(sitedir)" ||
++ 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 +160,7 @@
+ 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
+ ;;
+@@ -190,7 +192,8 @@
+ else:
+ from distutils import sysconfig
+ sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix')
+-sys.stdout.write(sitedir)"`
++sys.stdout.write(sitedir)" ||
++ 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 +203,7 @@
+ 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
+ ;;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/automake/automake_1.15.bb b/import-layers/yocto-poky/meta/recipes-devtools/automake/automake_1.15.bb
new file mode 100644
index 000000000..a3c72fd33
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/automake/automake_1.15.bb
@@ -0,0 +1,35 @@
+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"
+
+SRC_URI += " file://python-libdir.patch \
+ file://buildtest.patch \
+ file://performance.patch \
+ file://new_rt_path_for_test-driver.patch"
+
+SRC_URI[md5sum] = "716946a105ca228ab545fc37a70df3a3"
+SRC_URI[sha256sum] = "7946e945a96e28152ba5a6beb0625ca715c6e32ac55f2e353ef54def0c8ed924"
+
+CACHED_CONFIGUREVARS += "ac_cv_path_PERL=${USRBINPATH}/perl"
+
+do_install_append () {
+ install -d ${D}${datadir}
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-2.26.inc b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-2.26.inc
new file mode 100644
index 000000000..6d535fcaa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-2.26.inc
@@ -0,0 +1,42 @@
+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', True).split('.')
+ return pvsplit[0] + "_" + pvsplit[1]
+
+BINUPV = "${@binutils_branch_version(d)}"
+
+UPSTREAM_CHECK_GITTAGREGEX = "binutils-(?P<pver>\d+_(\d_?)*)"
+
+SRCREV = "71fa566a9cf2597b60a58c1d7c148bab637454a6"
+SRC_URI = "\
+ git://sourceware.org/git/binutils-gdb.git;branch=binutils-${BINUPV}-branch;protocol=git \
+ file://0002-configure-widen-the-regexp-for-SH-architectures.patch \
+ file://0003-Point-scripts-location-to-libdir.patch \
+ file://0004-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch \
+ file://0005-Explicitly-link-with-libm-on-uclibc.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-GOT-address-computations-in-initial-PLT-entries-.patch \
+ file://0014-Correct-nios2-_gp-address-computation.patch \
+"
+S = "${WORKDIR}/git"
+
+do_configure_prepend () {
+ rm -rf ${S}/gdb ${S}/libdecnumber ${S}/readline ${S}/sim
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross-canadian.inc b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross-canadian.inc
new file mode 100644
index 000000000..ae1464227
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross-canadian.inc
@@ -0,0 +1,29 @@
+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} \
+ "
+
+# 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"
+
+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/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross-canadian_2.26.bb b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross-canadian_2.26.bb
new file mode 100644
index 000000000..5dbaa0301
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross-canadian_2.26.bb
@@ -0,0 +1,3 @@
+require binutils.inc
+require binutils-${PV}.inc
+require binutils-cross-canadian.inc
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross.inc b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross.inc
new file mode 100644
index 000000000..fd3d80149
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross.inc
@@ -0,0 +1,30 @@
+inherit cross
+PROVIDES = "virtual/${TARGET_PREFIX}binutils"
+
+PN = "binutils-cross-${TARGET_ARCH}"
+BPN = "binutils"
+
+INHIBIT_DEFAULT_DEPS = "1"
+INHIBIT_AUTOTOOLS_DEPS = "1"
+
+EXTRA_OECONF += "--with-sysroot=${STAGING_DIR_TARGET} \
+ --disable-install-libbfd \
+ --enable-poison-system-directories \
+ "
+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/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross_2.26.bb b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross_2.26.bb
new file mode 100644
index 000000000..fbd1f7d25
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross_2.26.bb
@@ -0,0 +1,3 @@
+require binutils.inc
+require binutils-${PV}.inc
+require binutils-cross.inc
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-crosssdk_2.26.bb b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-crosssdk_2.26.bb
new file mode 100644
index 000000000..788106f9e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-crosssdk_2.26.bb
@@ -0,0 +1,13 @@
+require binutils-cross_${PV}.bb
+
+inherit crosssdk
+
+PN = "binutils-crosssdk-${TARGET_ARCH}"
+
+PROVIDES = "virtual/${TARGET_PREFIX}binutils-crosssdk"
+
+SRC_URI += "file://0001-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/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils.inc b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils.inc
new file mode 100644
index 000000000..43e2aa232
--- /dev/null
+++ b/import-layers/yocto-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 \
+"
+USE_ALTERNATIVES_FOR_remove_mips = "ld.gold dwp"
+
+python do_package_prepend() {
+ make_alts = d.getVar("USE_ALTERNATIVES_FOR", True) or ""
+ prefix = d.getVar("TARGET_PREFIX", True)
+ bindir = d.getVar("bindir", True)
+ 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-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', 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/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0001-Generate-relocatable-SDKs.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0001-Generate-relocatable-SDKs.patch
new file mode 100644
index 000000000..91f901761
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0001-Generate-relocatable-SDKs.patch
@@ -0,0 +1,62 @@
+From 3c75355342a8562ccb65b8bbbe81a0495fec5c57 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/14] 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 a84d233..d12c4e2 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
+
+ LD_FLAG=
+ DATA_ALIGNMENT=${DATA_ALIGNMENT_}
+diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
+index ec78c90..f9e7a31 100644
+--- a/ld/scripttempl/elf.sc
++++ b/ld/scripttempl/elf.sc
+@@ -136,8 +136,8 @@ if test -n "${COMMONPAGESIZE}"; then
+ DATA_SEGMENT_END=". = DATA_SEGMENT_END (.);"
+ DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);"
+ 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.7.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0002-configure-widen-the-regexp-for-SH-architectures.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0002-configure-widen-the-regexp-for-SH-architectures.patch
new file mode 100644
index 000000000..4a202d047
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0002-configure-widen-the-regexp-for-SH-architectures.patch
@@ -0,0 +1,56 @@
+From b1ae604880562ed065f614a745d3f8922838bc5a 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 02/14] 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 | 4 ++--
+ gprof/configure | 5 +++++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index 34b66f7..85414ab 100755
+--- a/configure
++++ b/configure
+@@ -3445,7 +3445,7 @@ case "${target}" in
+ ;;
+ s390-*-* | s390x-*-*)
+ ;;
+- sh-*-* | sh[34]*-*-*)
++ sh*-*-* | sh[34]*-*-*)
+ ;;
+ sh64-*-* | sh5*-*-*)
+ ;;
+@@ -3939,7 +3939,7 @@ case "${target}" in
+ or1k*-*-*)
+ noconfigdirs="$noconfigdirs gdb"
+ ;;
+- sh-*-* | sh64-*-*)
++ sh*-*-* | sh64-*-*)
+ case "${target}" in
+ sh*-*-elf)
+ ;;
+diff --git a/gprof/configure b/gprof/configure
+index 693b927..d4db554 100755
+--- a/gprof/configure
++++ b/gprof/configure
+@@ -5869,6 +5869,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.7.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0003-Point-scripts-location-to-libdir.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0003-Point-scripts-location-to-libdir.patch
new file mode 100644
index 000000000..2c70ecd93
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0003-Point-scripts-location-to-libdir.patch
@@ -0,0 +1,42 @@
+From 01808e8ef8ee709c8218d962601c18a63a063a1f 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 03/14] 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 0b3b049..3871c74 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 ed98f87..530e4c9 100644
+--- a/ld/Makefile.in
++++ b/ld/Makefile.in
+@@ -413,7 +413,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.7.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0004-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0004-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch
new file mode 100644
index 000000000..8f0a40210
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0004-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch
@@ -0,0 +1,41 @@
+From c008c7f97c1cf487749c6c375820a1f3b3c6c53d 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 04/14] 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 0405d4f..73c5447 100644
+--- a/ld/emultempl/elf32.em
++++ b/ld/emultempl/elf32.em
+@@ -1242,6 +1242,8 @@ fragment <<EOF
+ && command_line.rpath == NULL)
+ {
+ lib_path = (const char *) getenv ("LD_RUN_PATH");
++ if ((lib_path) && (strlen (lib_path) == 0))
++ lib_path = NULL;
+ if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
+ force))
+ break;
+@@ -1523,6 +1525,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.7.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0005-Explicitly-link-with-libm-on-uclibc.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0005-Explicitly-link-with-libm-on-uclibc.patch
new file mode 100644
index 000000000..92ead7fb4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0005-Explicitly-link-with-libm-on-uclibc.patch
@@ -0,0 +1,52 @@
+From 6a41635e29c4a6c064b1f66e79a8fe2026f4361b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 01:32:49 +0000
+Subject: [PATCH 05/14] Explicitly link with libm on uclibc
+
+Description:
+
+We do not need to have the libtool patch anymore for binutils after
+libtool has been updated upstream it include support for it. However
+for building gas natively on uclibc systems we have to link it with
+-lm so that it picks up missing symbols.
+
+/local/build_area/BUILD/arm_v5t_le_uclibc/binutils-2.17.50/objdir/libiberty/pic/libiberty.a(floatformat.o):
+In function `floatformat_from_double':
+floatformat.c:(.text+0x1ec): undefined reference to `frexp'
+floatformat.c:(.text+0x2f8): undefined reference to `ldexp'
+/local/build_area/BUILD/arm_v5t_le_uclibc/binutils-2.17.50/objdir/libiberty/pic/libiberty.a(floatformat.o):
+In function `floatformat_to_double':
+floatformat.c:(.text+0x38a): undefined reference to `ldexp'
+floatformat.c:(.text+0x3d2): undefined reference to `ldexp'
+floatformat.c:(.text+0x43e): undefined reference to `ldexp'
+floatformat.c:(.text+0x4e2): undefined reference to `ldexp'
+collect2: ld returned 1 exit status
+make[4]: *** [as-new] Error 1
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gas/configure.tgt | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/gas/configure.tgt b/gas/configure.tgt
+index 0b490d4..086e0d2 100644
+--- a/gas/configure.tgt
++++ b/gas/configure.tgt
+@@ -487,6 +487,12 @@ case ${generic_target} in
+ *-*-netware) fmt=elf em=netware ;;
+ esac
+
++case ${generic_target} in
++ arm-*-*uclibc*)
++ need_libm=yes
++ ;;
++esac
++
+ case ${cpu_type} in
+ aarch64 | alpha | arm | i386 | ia64 | microblaze | mips | ns32k | or1k | or1knd | pdp11 | ppc | sparc | z80 | z8k)
+ bfd_gas=yes
+--
+2.7.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0006-Use-libtool-2.4.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0006-Use-libtool-2.4.patch
new file mode 100644
index 000000000..e54ab1bc8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0006-Use-libtool-2.4.patch
@@ -0,0 +1,21295 @@
+From da70f0876cdd8ed703d9ed1524212ccfefb09ef3 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/14] Use libtool 2.4
+
+get libtool sysroot support
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ bfd/configure | 1322 +++++++++++++++++------
+ bfd/configure.ac | 2 +-
+ binutils/configure | 1320 +++++++++++++++++------
+ configure | 4 +-
+ gas/configure | 1320 +++++++++++++++++------
+ gprof/configure | 1325 +++++++++++++++++------
+ ld/configure | 1695 +++++++++++++++++++++--------
+ libtool.m4 | 1080 +++++++++++++------
+ ltmain.sh | 2925 +++++++++++++++++++++++++++++++++-----------------
+ ltoptions.m4 | 2 +-
+ ltversion.m4 | 12 +-
+ lt~obsolete.m4 | 2 +-
+ opcodes/configure | 1322 +++++++++++++++++------
+ opcodes/configure.ac | 2 +-
+ zlib/configure | 1320 +++++++++++++++++------
+ 15 files changed, 9944 insertions(+), 3709 deletions(-)
+
+diff --git a/bfd/configure b/bfd/configure
+index 7411c6d..eae743e 100755
+--- a/bfd/configure
++++ b/bfd/configure
+@@ -670,6 +670,9 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
++ac_ct_AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -782,6 +785,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_plugins
+ enable_largefile
+@@ -1458,6 +1462,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
+@@ -5388,8 +5394,8 @@ esac
+
+
+
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+
+
+
+@@ -5429,7 +5435,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
+@@ -6115,8 +6121,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
+@@ -6165,6 +6171,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 :
+@@ -6181,6 +6261,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'
+@@ -6349,7 +6434,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
+ ;;
+@@ -6503,6 +6589,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
+@@ -6518,9 +6619,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}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 :
+@@ -6536,7 +6790,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
+@@ -6556,11 +6810,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 :
+@@ -6576,7 +6834,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
+@@ -6595,6 +6853,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
+@@ -6606,16 +6868,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
+
+
+
+@@ -6957,8 +7275,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=
+@@ -6994,6 +7312,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
+@@ -7035,6 +7354,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
+@@ -7046,7 +7377,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;
+ }
+@@ -7072,8 +7403,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
+@@ -7083,8 +7414,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
+@@ -7121,6 +7452,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; }
++
++
++
++
++
+ # Check whether --enable-libtool-lock was given.
+ if test "${enable_libtool_lock+set}" = set; then :
+ enableval=$enable_libtool_lock;
+@@ -7348,6 +7728,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*)
+@@ -7911,6 +8408,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
+@@ -8075,7 +8574,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+
+
+
+@@ -8164,7 +8664,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,
+@@ -8462,8 +8962,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,'
+@@ -8629,6 +9127,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)
+@@ -8691,7 +9195,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,';;
+@@ -8748,13 +9252,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.
+@@ -8815,6 +9323,11 @@ fi
+
+
+
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -9165,7 +9678,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'
+@@ -9264,12 +9778,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
+@@ -9283,8 +9797,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
+ ;;
+
+@@ -9302,8 +9816,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
+@@ -9349,8 +9863,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
+@@ -9480,7 +9994,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
+@@ -9493,22 +10013,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"
+@@ -9520,7 +10047,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
+@@ -9533,22 +10066,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,
+@@ -9593,20 +10133,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*)
+@@ -9667,7 +10250,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
+@@ -9675,7 +10258,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
+@@ -9691,7 +10274,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
+@@ -9715,10 +10298,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
+@@ -9797,23 +10380,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'
+@@ -9898,7 +10494,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 \*'
+@@ -9917,9 +10513,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"*)
+@@ -10495,8 +11091,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}`~
+@@ -10529,13 +11126,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
+ ;;
+@@ -10627,7 +11282,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
+ ;;
+
+@@ -11423,7 +12078,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11426 "configure"
++#line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11467,10 +12122,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);
+@@ -11529,7 +12184,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11532 "configure"
++#line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11573,10 +12228,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);
+@@ -15121,7 +15776,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.
+@@ -16746,13 +17401,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"`'
+@@ -16767,14 +17429,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"`'
+@@ -16807,12 +17472,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"`'
+@@ -16867,8 +17532,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 \
+@@ -16878,12 +17548,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 \
+@@ -16899,7 +17571,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 \
+@@ -16935,6 +17606,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -17714,7 +18386,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.
+@@ -17817,19 +18490,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
+
+@@ -17859,6 +18555,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
+
+@@ -17868,6 +18570,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
+
+@@ -17982,12 +18687,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
+
+@@ -18074,9 +18779,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
+
+@@ -18092,6 +18794,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
+
+@@ -18124,210 +18829,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 6f5e85f..44bd02c 100644
+--- a/bfd/configure.ac
++++ b/bfd/configure.ac
+@@ -567,7 +567,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 d4f3e1e..a6df5bb 100755
+--- a/binutils/configure
++++ b/binutils/configure
+@@ -657,8 +657,11 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
+ RANLIB
++ac_ct_AR
+ AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -769,6 +772,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_plugins
+ enable_largefile
+@@ -1441,6 +1445,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
+@@ -5155,8 +5161,8 @@ esac
+
+
+
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+
+
+
+@@ -5196,7 +5202,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
+@@ -5882,8 +5888,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
+@@ -5932,6 +5938,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 :
+@@ -5948,6 +6028,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'
+@@ -6116,7 +6201,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
+ ;;
+@@ -6270,6 +6356,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
+@@ -6285,9 +6386,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 :
+@@ -6303,7 +6557,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
+@@ -6323,11 +6577,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 :
+@@ -6343,7 +6601,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
+@@ -6362,6 +6620,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
+@@ -6373,12 +6635,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}
+
+
+
+@@ -6390,6 +6650,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
+@@ -6724,8 +7042,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=
+@@ -6761,6 +7079,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
+@@ -6802,6 +7121,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
+@@ -6813,7 +7144,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;
+ }
+@@ -6839,8 +7170,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
+@@ -6850,8 +7181,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
+@@ -6888,6 +7219,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
++
++
++
++
++
++
++
++
++
+
+
+
+@@ -6906,6 +7252,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; }
++
++
+
+
+
+@@ -7115,6 +7495,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*)
+@@ -7678,6 +8175,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
+@@ -7873,7 +8372,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+
+
+
+@@ -7962,7 +8462,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,
+@@ -8260,8 +8760,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,'
+@@ -8427,6 +8925,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)
+@@ -8489,7 +8993,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,';;
+@@ -8546,13 +9050,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.
+@@ -8613,6 +9121,11 @@ fi
+
+
+
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -8963,7 +9476,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'
+@@ -9062,12 +9576,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
+@@ -9081,8 +9595,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
+ ;;
+
+@@ -9100,8 +9614,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
+@@ -9147,8 +9661,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
+@@ -9278,7 +9792,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
+@@ -9291,22 +9811,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"
+@@ -9318,7 +9845,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
+@@ -9331,22 +9864,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,
+@@ -9391,20 +9931,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*)
+@@ -9465,7 +10048,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
+@@ -9473,7 +10056,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
+@@ -9489,7 +10072,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
+@@ -9513,10 +10096,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
+@@ -9595,23 +10178,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'
+@@ -9696,7 +10292,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 \*'
+@@ -9715,9 +10311,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"*)
+@@ -10293,8 +10889,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}`~
+@@ -10327,13 +10924,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
+ ;;
+@@ -10425,7 +11080,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
+ ;;
+
+@@ -11221,7 +11876,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11224 "configure"
++#line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11265,10 +11920,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);
+@@ -11327,7 +11982,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11330 "configure"
++#line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11371,10 +12026,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);
+@@ -15355,13 +16010,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"`'
+@@ -15376,14 +16038,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"`'
+@@ -15416,12 +16081,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"`'
+@@ -15476,8 +16141,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 \
+@@ -15487,12 +16157,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 \
+@@ -15508,7 +16180,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 \
+@@ -15544,6 +16215,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -16301,7 +16973,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.
+@@ -16404,19 +17077,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
+
+@@ -16446,6 +17142,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
+
+@@ -16455,6 +17157,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
+
+@@ -16569,12 +17274,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
+
+@@ -16661,9 +17366,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
+
+@@ -16679,6 +17381,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
+
+@@ -16711,210 +17416,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/configure b/configure
+index 85414ab..34b66f7 100755
+--- a/configure
++++ b/configure
+@@ -3445,7 +3445,7 @@ case "${target}" in
+ ;;
+ s390-*-* | s390x-*-*)
+ ;;
+- sh*-*-* | sh[34]*-*-*)
++ sh-*-* | sh[34]*-*-*)
+ ;;
+ sh64-*-* | sh5*-*-*)
+ ;;
+@@ -3939,7 +3939,7 @@ case "${target}" in
+ or1k*-*-*)
+ noconfigdirs="$noconfigdirs gdb"
+ ;;
+- sh*-*-* | sh64-*-*)
++ sh-*-* | sh64-*-*)
+ case "${target}" in
+ sh*-*-elf)
+ ;;
+diff --git a/gas/configure b/gas/configure
+index dd9c953..89f18b3 100755
+--- a/gas/configure
++++ b/gas/configure
+@@ -647,8 +647,11 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
+ RANLIB
++ac_ct_AR
+ AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -759,6 +762,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_plugins
+ enable_largefile
+@@ -1430,6 +1434,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
+
+ Some influential environment variables:
+@@ -4909,8 +4915,8 @@ esac
+
+
+
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+
+
+
+@@ -4950,7 +4956,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
+@@ -5636,8 +5642,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
+@@ -5686,6 +5692,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 :
+@@ -5702,6 +5782,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'
+@@ -5870,7 +5955,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
+ ;;
+@@ -6024,6 +6110,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
+@@ -6039,9 +6140,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 :
+@@ -6057,7 +6311,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
+@@ -6077,11 +6331,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 :
+@@ -6097,7 +6355,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
+@@ -6116,6 +6374,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
+@@ -6127,12 +6389,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}
+
+
+
+@@ -6144,6 +6404,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
+@@ -6478,8 +6796,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=
+@@ -6515,6 +6833,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
+@@ -6556,6 +6875,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
+@@ -6567,7 +6898,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;
+ }
+@@ -6593,8 +6924,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
+@@ -6604,8 +6935,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
+@@ -6642,6 +6973,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
++
++
++
++
++
++
++
++
++
+
+
+
+@@ -6660,6 +7006,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; }
++
++
+
+
+
+@@ -6869,6 +7249,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*)
+@@ -7432,6 +7929,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
+@@ -7627,7 +8126,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+
+
+
+@@ -7716,7 +8216,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,
+@@ -8014,8 +8514,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,'
+@@ -8181,6 +8679,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)
+@@ -8243,7 +8747,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,';;
+@@ -8300,13 +8804,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.
+@@ -8367,6 +8875,11 @@ fi
+
+
+
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -8717,7 +9230,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'
+@@ -8816,12 +9330,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
+@@ -8835,8 +9349,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
+ ;;
+
+@@ -8854,8 +9368,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
+@@ -8901,8 +9415,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
+@@ -9032,7 +9546,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
+@@ -9045,22 +9565,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"
+@@ -9072,7 +9599,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
+@@ -9085,22 +9618,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,
+@@ -9145,20 +9685,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*)
+@@ -9219,7 +9802,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
+@@ -9227,7 +9810,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
+@@ -9243,7 +9826,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
+@@ -9267,10 +9850,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
+@@ -9349,23 +9932,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'
+@@ -9450,7 +10046,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 \*'
+@@ -9469,9 +10065,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"*)
+@@ -10047,8 +10643,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}`~
+@@ -10081,13 +10678,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
+ ;;
+@@ -10179,7 +10834,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
+ ;;
+
+@@ -10975,7 +11630,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 10978 "configure"
++#line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11019,10 +11674,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);
+@@ -11081,7 +11736,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11084 "configure"
++#line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11125,10 +11780,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);
+@@ -15276,13 +15931,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"`'
+@@ -15297,14 +15959,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"`'
+@@ -15337,12 +16002,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"`'
+@@ -15397,8 +16062,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 \
+@@ -15408,12 +16078,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 \
+@@ -15429,7 +16101,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 \
+@@ -15465,6 +16136,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -16229,7 +16901,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.
+@@ -16332,19 +17005,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
+
+@@ -16374,6 +17070,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
+
+@@ -16383,6 +17085,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
+
+@@ -16497,12 +17202,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
+
+@@ -16589,9 +17294,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
+
+@@ -16607,6 +17309,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
+
+@@ -16639,210 +17344,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 d4db554..78b292c 100755
+--- a/gprof/configure
++++ b/gprof/configure
+@@ -629,8 +629,11 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
+ RANLIB
++ac_ct_AR
+ AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -741,6 +744,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_plugins
+ enable_largefile
+@@ -1399,6 +1403,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
+@@ -4831,8 +4837,8 @@ esac
+
+
+
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+
+
+
+@@ -4872,7 +4878,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
+@@ -5558,8 +5564,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
+@@ -5608,6 +5614,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 :
+@@ -5624,6 +5704,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'
+@@ -5792,7 +5877,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
+ ;;
+@@ -5869,11 +5955,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)$'
+@@ -5951,6 +6032,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
+@@ -5966,9 +6062,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 :
+@@ -5984,7 +6233,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
+@@ -6004,11 +6253,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 :
+@@ -6024,7 +6277,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
+@@ -6043,6 +6296,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
+@@ -6054,12 +6311,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}
+
+
+
+@@ -6071,6 +6326,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
+@@ -6405,8 +6718,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=
+@@ -6442,6 +6755,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
+@@ -6483,6 +6797,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
+@@ -6494,7 +6820,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;
+ }
+@@ -6520,8 +6846,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
+@@ -6531,8 +6857,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
+@@ -6569,6 +6895,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; }
++
++
++
++
++
+ # Check whether --enable-libtool-lock was given.
+ if test "${enable_libtool_lock+set}" = set; then :
+ enableval=$enable_libtool_lock;
+@@ -6796,6 +7171,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*)
+@@ -7359,6 +7851,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
+@@ -7554,7 +8048,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+
+
+
+@@ -7643,7 +8138,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,
+@@ -7941,8 +8436,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,'
+@@ -8108,6 +8601,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)
+@@ -8170,7 +8669,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,';;
+@@ -8227,13 +8726,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.
+@@ -8294,6 +8797,11 @@ fi
+
+
+
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -8644,7 +9152,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'
+@@ -8743,12 +9252,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
+@@ -8762,8 +9271,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
+ ;;
+
+@@ -8781,8 +9290,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
+@@ -8828,8 +9337,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
+@@ -8959,7 +9468,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
+@@ -8972,22 +9487,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"
+@@ -8999,7 +9521,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
+@@ -9012,22 +9540,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,
+@@ -9072,20 +9607,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*)
+@@ -9146,7 +9724,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
+@@ -9154,7 +9732,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
+@@ -9170,7 +9748,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
+@@ -9194,10 +9772,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
+@@ -9276,23 +9854,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'
+@@ -9377,7 +9968,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 \*'
+@@ -9396,9 +9987,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"*)
+@@ -9974,8 +10565,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}`~
+@@ -10008,13 +10600,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
+ ;;
+@@ -10106,7 +10756,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
+ ;;
+
+@@ -10902,7 +11552,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 10900 "configure"
++#line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -10946,10 +11596,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);
+@@ -11008,7 +11658,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11006 "configure"
++#line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11052,10 +11702,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);
+@@ -12924,13 +13574,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"`'
+@@ -12945,14 +13602,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"`'
+@@ -12985,12 +13645,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"`'
+@@ -13045,8 +13705,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 \
+@@ -13056,12 +13721,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 \
+@@ -13077,7 +13744,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 \
+@@ -13113,6 +13779,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -13869,7 +14536,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.
+@@ -13972,19 +14640,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
+
+@@ -14014,6 +14705,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
+
+@@ -14023,6 +14720,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
+
+@@ -14137,12 +14837,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
+
+@@ -14229,9 +14929,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
+
+@@ -14247,6 +14944,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
+
+@@ -14279,210 +14979,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 8095b71..eb4f0d7 100755
+--- a/ld/configure
++++ b/ld/configure
+@@ -657,8 +657,11 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
+ RANLIB
++ac_ct_AR
+ AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -779,6 +782,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_plugins
+ enable_largefile
+@@ -1458,6 +1462,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.
+
+@@ -5649,8 +5655,8 @@ esac
+
+
+
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+
+
+
+@@ -5690,7 +5696,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
+@@ -6376,8 +6382,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
+@@ -6426,6 +6432,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 :
+@@ -6442,6 +6522,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'
+@@ -6610,7 +6695,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
+ ;;
+@@ -6764,6 +6850,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
+@@ -6779,9 +6880,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 :
+@@ -6797,7 +7051,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
+@@ -6817,11 +7071,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 :
+@@ -6837,7 +7095,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
+@@ -6856,6 +7114,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
+@@ -6867,12 +7129,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}
++
++
+
+
+
+@@ -6882,6 +7144,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
+@@ -7218,8 +7536,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=
+@@ -7255,6 +7573,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
+@@ -7296,6 +7615,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
+@@ -7307,7 +7638,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;
+ }
+@@ -7333,8 +7664,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
+@@ -7344,8 +7675,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
+@@ -7382,6 +7713,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
++
++
++
++
++
++
++
+
+
+
+@@ -7402,6 +7746,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; }
++
++
++
++
+
+ # Check whether --enable-libtool-lock was given.
+ if test "${enable_libtool_lock+set}" = set; then :
+@@ -7609,6 +7989,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*)
+@@ -8172,6 +8669,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
+@@ -8240,6 +8739,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
+@@ -8368,7 +8877,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+
+
+
+@@ -8457,7 +8967,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,
+@@ -8755,8 +9265,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,'
+@@ -8922,6 +9430,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)
+@@ -8984,7 +9498,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,';;
+@@ -9041,13 +9555,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.
+@@ -9108,6 +9626,11 @@ fi
+
+
+
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -9458,7 +9981,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'
+@@ -9557,12 +10081,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
+@@ -9576,8 +10100,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
+ ;;
+
+@@ -9595,8 +10119,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
+@@ -9642,8 +10166,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
+@@ -9773,7 +10297,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
+@@ -9786,22 +10316,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"
+@@ -9813,7 +10350,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
+@@ -9826,22 +10369,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,
+@@ -9885,21 +10435,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*)
+@@ -9960,7 +10553,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
+@@ -9968,7 +10561,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
+@@ -9984,7 +10577,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
+@@ -10008,10 +10601,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
+@@ -10090,23 +10683,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'
+@@ -10191,7 +10797,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 \*'
+@@ -10210,9 +10816,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"*)
+@@ -10788,8 +11394,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}`~
+@@ -10822,13 +11429,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
+ ;;
+@@ -10920,7 +11585,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
+ ;;
+
+@@ -11716,7 +12381,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11719 "configure"
++#line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11760,10 +12425,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);
+@@ -11822,7 +12487,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11825 "configure"
++#line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11866,10 +12531,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);
+@@ -12261,6 +12926,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
+@@ -12278,6 +12944,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
+@@ -12560,7 +13227,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
+@@ -12573,22 +13246,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"
+
+@@ -12601,7 +13281,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
+@@ -12614,22 +13300,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,
+@@ -12672,29 +13365,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*)
+
+
+@@ -12800,7 +13539,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
+@@ -12871,10 +13610,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
+@@ -12915,9 +13654,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
+@@ -12987,20 +13726,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'
+@@ -13195,7 +13934,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
+
+@@ -13241,7 +13980,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'
+@@ -13282,9 +14021,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
+@@ -13419,6 +14158,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=$?
+@@ -13432,7 +14178,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.
+@@ -13441,13 +14187,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.
+@@ -13467,8 +14222,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.
+@@ -13504,6 +14261,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
+@@ -13539,7 +14297,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
+@@ -13604,8 +14362,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
+@@ -13710,6 +14466,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++*)
+@@ -13862,7 +14623,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'
+@@ -13927,10 +14688,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.
+@@ -13988,6 +14756,8 @@ fi
+
+
+
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -14165,6 +14935,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.
+@@ -14179,15 +14950,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; }
+@@ -14450,8 +15226,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}`~
+@@ -14483,13 +15260,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
+ ;;
+@@ -14580,7 +15415,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
+ ;;
+
+@@ -15039,6 +15874,7 @@ fi
+ fi # test -n "$compiler"
+
+ CC=$lt_save_CC
++ CFLAGS=$lt_save_CFLAGS
+ LDCXX=$LD
+ LD=$lt_save_LD
+ GCC=$lt_save_GCC
+@@ -17953,13 +18789,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"`'
+@@ -17974,14 +18817,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"`'
+@@ -18014,12 +18860,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"`'
+@@ -18058,8 +18904,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"`'
+@@ -18086,12 +18932,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"`'
+@@ -18129,8 +18975,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 \
+@@ -18140,12 +18991,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 \
+@@ -18161,7 +19014,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 \
+@@ -18183,8 +19035,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 \
+@@ -18196,7 +19048,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 \
+@@ -18230,6 +19081,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -18244,7 +19096,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\\"\\\`\\\\\\""
+@@ -19037,7 +19890,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.
+@@ -19140,19 +19994,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
+
+@@ -19182,6 +20059,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
+
+@@ -19191,6 +20074,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
+
+@@ -19305,12 +20191,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
+
+@@ -19397,9 +20283,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
+
+@@ -19415,6 +20298,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
+
+@@ -19461,210 +20347,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"
+
+@@ -19692,12 +20537,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
+
+@@ -19784,9 +20629,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
+
+@@ -19802,6 +20644,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 4b2d30a..008d331 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 9503ec8..70e856e 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 5ef12ce..17cfd51 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 bf87f77..9c7b5d4 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 bf92b5e..c573da9 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 eedb184..d3076e1 100755
+--- a/opcodes/configure
++++ b/opcodes/configure
+@@ -648,6 +648,9 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
++ac_ct_AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -760,6 +763,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_targets
+ enable_werror
+@@ -1420,6 +1424,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
+@@ -5110,8 +5116,8 @@ esac
+
+
+
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+
+
+
+@@ -5151,7 +5157,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
+@@ -5837,8 +5843,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
+@@ -5887,6 +5893,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 :
+@@ -5903,6 +5983,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'
+@@ -6071,7 +6156,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
+ ;;
+@@ -6225,6 +6311,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
+@@ -6240,9 +6341,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}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 :
+@@ -6258,7 +6512,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
+@@ -6278,11 +6532,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 :
+@@ -6298,7 +6556,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
+@@ -6317,6 +6575,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
+@@ -6328,16 +6590,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
+
+
+
+@@ -6679,8 +6997,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=
+@@ -6716,6 +7034,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
+@@ -6757,6 +7076,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
+@@ -6768,7 +7099,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;
+ }
+@@ -6794,8 +7125,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
+@@ -6805,8 +7136,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
+@@ -6843,6 +7174,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; }
++
++
++
++
++
+ # Check whether --enable-libtool-lock was given.
+ if test "${enable_libtool_lock+set}" = set; then :
+ enableval=$enable_libtool_lock;
+@@ -7070,6 +7450,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*)
+@@ -7633,6 +8130,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
+@@ -7798,7 +8297,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+
+
+
+@@ -7887,7 +8387,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,
+@@ -8185,8 +8685,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,'
+@@ -8352,6 +8850,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)
+@@ -8414,7 +8918,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,';;
+@@ -8471,13 +8975,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.
+@@ -8538,6 +9046,11 @@ fi
+
+
+
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -8888,7 +9401,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'
+@@ -8987,12 +9501,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
+@@ -9006,8 +9520,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
+ ;;
+
+@@ -9025,8 +9539,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
+@@ -9072,8 +9586,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
+@@ -9203,7 +9717,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
+@@ -9216,22 +9736,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"
+@@ -9243,7 +9770,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
+@@ -9256,22 +9789,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,
+@@ -9316,20 +9856,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*)
+@@ -9390,7 +9973,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
+@@ -9398,7 +9981,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
+@@ -9414,7 +9997,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
+@@ -9438,10 +10021,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
+@@ -9520,23 +10103,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'
+@@ -9621,7 +10217,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 \*'
+@@ -9640,9 +10236,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"*)
+@@ -10218,8 +10814,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}`~
+@@ -10252,13 +10849,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
+ ;;
+@@ -10350,7 +11005,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
+ ;;
+
+@@ -11146,7 +11801,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11149 "configure"
++#line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11190,10 +11845,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);
+@@ -11252,7 +11907,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11255 "configure"
++#line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11296,10 +11951,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);
+@@ -12462,7 +13117,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
+@@ -13436,13 +14091,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"`'
+@@ -13457,14 +14119,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"`'
+@@ -13497,12 +14162,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"`'
+@@ -13557,8 +14222,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 \
+@@ -13568,12 +14238,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 \
+@@ -13589,7 +14261,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 \
+@@ -13625,6 +14296,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -14381,7 +15053,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.
+@@ -14484,19 +15157,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
+
+@@ -14526,6 +15222,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
+
+@@ -14535,6 +15237,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
+
+@@ -14649,12 +15354,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
+
+@@ -14741,9 +15446,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
+
+@@ -14759,6 +15461,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
+
+@@ -14791,210 +15496,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 07e3162..c0c75d4 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 8378857..7584940 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
+@@ -736,6 +739,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_host_shared
+ '
+@@ -1384,6 +1388,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
+@@ -3907,8 +3913,8 @@ esac
+
+
+
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+
+
+
+@@ -3948,7 +3954,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
+@@ -4764,8 +4770,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
+@@ -4814,6 +4820,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 :
+@@ -4830,6 +4910,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'
+@@ -4998,7 +5083,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
+ ;;
+@@ -5152,6 +5238,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
+@@ -5167,9 +5268,163 @@ 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 :
+@@ -5185,7 +5440,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
+@@ -5205,11 +5460,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 :
+@@ -5225,7 +5484,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
+@@ -5244,6 +5503,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
+@@ -5255,16 +5518,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
+
+
+
+@@ -5606,8 +5925,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=
+@@ -5643,6 +5962,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
+@@ -5684,6 +6004,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
+@@ -5695,7 +6027,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;
+ }
+@@ -5721,8 +6053,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
+@@ -5732,8 +6064,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
+@@ -5770,6 +6102,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; }
++
++
++
+
+
+ # Check whether --enable-libtool-lock was given.
+@@ -6001,6 +6381,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*)
+@@ -6567,6 +7064,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
+@@ -7030,7 +7529,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+
+
+
+@@ -7119,7 +7619,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,
+@@ -7417,8 +7917,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,'
+@@ -7584,6 +8082,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)
+@@ -7646,7 +8150,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,';;
+@@ -7703,13 +8207,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.
+@@ -7770,6 +8278,11 @@ fi
+
+
+
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -8120,7 +8633,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'
+@@ -8219,12 +8733,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
+@@ -8238,8 +8752,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
+ ;;
+
+@@ -8257,8 +8771,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
+@@ -8304,8 +8818,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
+@@ -8435,7 +8949,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
+@@ -8451,22 +8971,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"
+@@ -8478,7 +9005,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
+@@ -8494,22 +9027,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,
+@@ -8554,20 +9094,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*)
+@@ -8628,7 +9211,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
+@@ -8636,7 +9219,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
+@@ -8652,7 +9235,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
+@@ -8676,10 +9259,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
+@@ -8758,26 +9341,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'
+@@ -8862,7 +9458,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 \*'
+@@ -8881,9 +9477,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"*)
+@@ -9459,8 +10055,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}`~
+@@ -9493,13 +10090,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
+ ;;
+@@ -9591,7 +10246,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
+ ;;
+
+@@ -10405,7 +11060,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 10408 "configure"
++#line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -10449,10 +11104,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);
+@@ -10511,7 +11166,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 10514 "configure"
++#line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -10555,10 +11210,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);
+@@ -11990,13 +12645,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"`'
+@@ -12011,14 +12673,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"`'
+@@ -12051,12 +12716,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"`'
+@@ -12111,8 +12776,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 \
+@@ -12122,12 +12792,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 \
+@@ -12143,7 +12815,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 \
+@@ -12179,6 +12850,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -12768,7 +13440,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.
+@@ -12871,19 +13544,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
+
+@@ -12913,6 +13609,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
+
+@@ -12922,6 +13624,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
+
+@@ -13036,12 +13741,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
+
+@@ -13128,9 +13833,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
+
+@@ -13146,6 +13848,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
+
+@@ -13178,210 +13883,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.7.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0007-Add-the-armv5e-architecture-to-binutils.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0007-Add-the-armv5e-architecture-to-binutils.patch
new file mode 100644
index 000000000..cb3f83b4f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0007-Add-the-armv5e-architecture-to-binutils.patch
@@ -0,0 +1,35 @@
+From 4ff9dbe13f38e4fea24fbcc9879cf7352c0561ff 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/14] 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 3bd4bc9..5d99921 100644
+--- a/gas/config/tc-arm.c
++++ b/gas/config/tc-arm.c
+@@ -24791,6 +24791,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.7.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0008-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch b/import-layers/yocto-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..f8382f872
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0008-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch
@@ -0,0 +1,35 @@
+From cb36d94dbd521752e6444418af500e139a26eabb 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/14] 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 7d7e2f4..1aaaf0e 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.7.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0009-warn-for-uses-of-system-directories-when-cross-linki.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0009-warn-for-uses-of-system-directories-when-cross-linki.patch
new file mode 100644
index 000000000..d3f510b11
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0009-warn-for-uses-of-system-directories-when-cross-linki.patch
@@ -0,0 +1,273 @@
+From 4daa841ce16ba52b717bdff9eb1dfc4f19638814 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/14] 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.
+
+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>
+---
+Upstream-Status: Pending
+
+ 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 276fb77..35c58eb 100644
+--- a/ld/config.in
++++ b/ld/config.in
+@@ -14,6 +14,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 eb4f0d7..e9054b4 100755
+--- a/ld/configure
++++ b/ld/configure
+@@ -790,6 +790,7 @@ with_lib_path
+ enable_targets
+ enable_64_bit_bfd
+ with_sysroot
++enable_poison_system_directories
+ enable_gold
+ enable_got
+ enable_compressed_debug_sections
+@@ -1446,6 +1447,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)
+@@ -16306,6 +16309,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 e28f38e..7b474e7 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 d84ec4e..3476b26 100644
+--- a/ld/ld.h
++++ b/ld/ld.h
+@@ -164,6 +164,14 @@ typedef struct {
+ /* If set, display the target memory usage (per memory region). */
+ bfd_boolean print_memory_usage;
+
++ /* 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 2389661..d06112b 100644
+--- a/ld/ld.texinfo
++++ b/ld/ld.texinfo
+@@ -2338,6 +2338,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 96f9ecc..af231c0 100644
+--- a/ld/ldfile.c
++++ b/ld/ldfile.c
+@@ -114,6 +114,23 @@ ldfile_add_library_path (const char *name, bfd_boolean cmdline)
+ new_dirs->name = concat (ld_sysroot, name + 1, (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 6f11e7b..0ca3110 100644
+--- a/ld/ldlex.h
++++ b/ld/ldlex.h
+@@ -144,6 +144,8 @@ enum option_values
+ OPTION_PRINT_MEMORY_USAGE,
+ OPTION_REQUIRE_DEFINED_SYMBOL,
+ OPTION_ORPHAN_HANDLING,
++ 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 bb0b9cc..a23c56c 100644
+--- a/ld/ldmain.c
++++ b/ld/ldmain.c
+@@ -257,6 +257,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 e2fb212..a2064f1 100644
+--- a/ld/lexsup.c
++++ b/ld/lexsup.c
+@@ -530,6 +530,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)
+@@ -1550,6 +1558,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.7.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch
new file mode 100644
index 000000000..407424103
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch
@@ -0,0 +1,52 @@
+From bb9eb09411ddcef515f0f7ad7c29214b0766e960 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/14] 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 70e856e..11ee684 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.7.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0011-Change-default-emulation-for-mips64-linux.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0011-Change-default-emulation-for-mips64-linux.patch
new file mode 100644
index 000000000..c0d2d718a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0011-Change-default-emulation-for-mips64-linux.patch
@@ -0,0 +1,59 @@
+From af1b4ee69b4fd617b88127ed40c3ca7351a9532f 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/14] 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 c5688cb..5c27b49 100644
+--- a/bfd/config.bfd
++++ b/bfd/config.bfd
+@@ -1087,12 +1087,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 6b6bbf2..b45b1e5 100644
+--- a/ld/configure.tgt
++++ b/ld/configure.tgt
+@@ -509,11 +509,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.7.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0012-Add-support-for-Netlogic-XLP.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0012-Add-support-for-Netlogic-XLP.patch
new file mode 100644
index 000000000..af7f12ff8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0012-Add-support-for-Netlogic-XLP.patch
@@ -0,0 +1,413 @@
+From 9f967c555b3fda64af4549ae252a0fba00120529 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/14] 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
+
+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>
+---
+Upstream-Status: Pending
+
+ 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 +++
+ gas/configure.tgt | 2 +-
+ include/elf/mips.h | 1 +
+ include/opcode/mips.h | 10 ++++++++--
+ ld/configure.tgt | 2 ++
+ opcodes/mips-dis.c | 12 +++++-------
+ opcodes/mips-opc.c | 33 +++++++++++++++++++++------------
+ 15 files changed, 65 insertions(+), 25 deletions(-)
+
+diff --git a/bfd/aoutx.h b/bfd/aoutx.h
+index f78b910..d0d8dd3 100644
+--- a/bfd/aoutx.h
++++ b/bfd/aoutx.h
+@@ -802,6 +802,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 51068b9..727741f 100644
+--- a/bfd/archures.c
++++ b/bfd/archures.c
+@@ -181,6 +181,7 @@ DESCRIPTION
+ .#define bfd_mach_mips_octeon2 6502
+ .#define bfd_mach_mips_octeon3 6503
+ .#define bfd_mach_mips_xlr 887682 {* decimal 'XLR' *}
++.#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 779ffbf..bf5a565 100644
+--- a/bfd/bfd-in2.h
++++ b/bfd/bfd-in2.h
+@@ -1993,6 +1993,7 @@ enum bfd_architecture
+ #define bfd_mach_mips_octeon2 6502
+ #define bfd_mach_mips_octeon3 6503
+ #define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */
++#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 5c27b49..d553039 100644
+--- a/bfd/config.bfd
++++ b/bfd/config.bfd
+@@ -1066,6 +1066,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*-*-vxworks | mips*-*-windiss)
+ 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 8a9475d..de7e5a3 100644
+--- a/bfd/cpu-mips.c
++++ b/bfd/cpu-mips.c
+@@ -104,7 +104,8 @@ enum
+ I_mipsocteon2,
+ I_mipsocteon3,
+ I_xlr,
+- I_micromips
++ I_micromips,
++ I_xlp
+ };
+
+ #define NN(index) (&arch_info_struct[(index) + 1])
+@@ -155,7 +156,8 @@ static const bfd_arch_info_type arch_info_struct[] =
+ N (64, 64, bfd_mach_mips_octeon2,"mips:octeon2", FALSE, NN(I_mipsocteon2)),
+ N (64, 64, bfd_mach_mips_octeon3, "mips:octeon3", FALSE, NN(I_mipsocteon3)),
+ N (64, 64, bfd_mach_mips_xlr, "mips:xlr", FALSE, NN(I_xlr)),
+- 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 1f2f4a3..700afd3 100644
+--- a/bfd/elfxx-mips.c
++++ b/bfd/elfxx-mips.c
+@@ -6605,6 +6605,9 @@ _bfd_elf_mips_mach (flagword flags)
+ case E_MIPS_MACH_XLR:
+ return bfd_mach_mips_xlr;
+
++ case E_MIPS_MACH_XLP:
++ return bfd_mach_mips_xlp;
++
+ default:
+ switch (flags & EF_MIPS_ARCH)
+ {
+@@ -11901,6 +11904,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;
+@@ -13931,6 +13938,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 d5dd46f..66810cc 100644
+--- a/binutils/readelf.c
++++ b/binutils/readelf.c
+@@ -3140,6 +3140,7 @@ get_machine_flags (unsigned e_flags, unsigned e_machine)
+ case E_MIPS_MACH_OCTEON2: strcat (buf, ", octeon2"); break;
+ case E_MIPS_MACH_OCTEON3: strcat (buf, ", octeon3"); break;
+ case E_MIPS_MACH_XLR: strcat (buf, ", xlr"); 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 a2d45a4..75902c0 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
+@@ -18702,7 +18704,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 },
+
+ /* i6400. */
+ { "i6400", 0, ASE_MSA, ISA_MIPS64R6, CPU_MIPS64R6},
+diff --git a/gas/configure b/gas/configure
+index 89f18b3..86b19ae 100755
+--- a/gas/configure
++++ b/gas/configure
+@@ -12851,6 +12851,9 @@ _ACEOF
+ mipsisa64r6 | mipsisa64r6el)
+ mips_cpu=mips64r6
+ ;;
++ mipsisa64r2nlm | mipsisa64r2nlmel)
++ mips_cpu=xlp
++ ;;
+ mipstx39 | mipstx39el)
+ mips_cpu=r3900
+ ;;
+diff --git a/gas/configure.tgt b/gas/configure.tgt
+index 086e0d2..2b71270 100644
+--- a/gas/configure.tgt
++++ b/gas/configure.tgt
+@@ -339,7 +339,7 @@ case ${generic_target} in
+ mips-*-sysv4*MP* | mips-*-gnu*) fmt=elf em=tmips ;;
+ mips*-sde-elf* | mips*-mti-elf* | mips*-img-elf*)
+ fmt=elf em=tmips ;;
+- mips-*-elf* | mips-*-rtems*) fmt=elf ;;
++ mips-*-elf* | mips-*-rtems*) fmt=elf em=tmips ;;
+ mips-*-netbsd*) fmt=elf em=tmips ;;
+ mips-*-openbsd*) fmt=elf em=tmips ;;
+
+diff --git a/include/elf/mips.h b/include/elf/mips.h
+index 57de3bc..9ba141d 100644
+--- a/include/elf/mips.h
++++ b/include/elf/mips.h
+@@ -285,6 +285,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 9318fcc..9be5645 100644
+--- a/include/opcode/mips.h
++++ b/include/opcode/mips.h
+@@ -1228,8 +1228,10 @@ static const unsigned int mips_isa_table[] = {
+ #define INSN_LOONGSON_2F 0x80000000
+ /* Loongson 3A. */
+ #define INSN_LOONGSON_3A 0x00000400
+-/* RMI Xlr instruction */
+-#define INSN_XLR 0x00000020
++/* Netlogic Xlr instruction */
++#define INSN_XLR 0x00000020
++/* Netlogic XlP instruction */
++#define INSN_XLP 0x00000080
+
+ /* DSP ASE */
+ #define ASE_DSP 0x00000001
+@@ -1326,6 +1328,7 @@ static const unsigned int mips_isa_table[] = {
+ #define CPU_OCTEON2 6502
+ #define CPU_OCTEON3 6503
+ #define CPU_XLR 887682 /* decimal 'XLR' */
++#define CPU_XLP 887680 /* decimal 'XLP' */
+
+ /* Return true if the given CPU is included in INSN_* mask MASK. */
+
+@@ -1403,6 +1406,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 b45b1e5..fb2f36a 100644
+--- a/ld/configure.tgt
++++ b/ld/configure.tgt
+@@ -495,6 +495,8 @@ mips*el-sde-elf*) targ_emul=elf32ltsmip
+ 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 8200920..40d9fe2 100644
+--- a/opcodes/mips-dis.c
++++ b/opcodes/mips-dis.c
+@@ -648,13 +648,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 402f887..3764836 100644
+--- a/opcodes/mips-opc.c
++++ b/opcodes/mips-opc.c
+@@ -320,7 +320,8 @@ decode_mips_operand (const char *p)
+ #define IOCTP (INSN_OCTEONP | INSN_OCTEON2 | INSN_OCTEON3)
+ #define IOCT2 (INSN_OCTEON2 | INSN_OCTEON3)
+ #define IOCT3 INSN_OCTEON3
+-#define XLR INSN_XLR
++#define XLR INSN_XLR
++#define XLP INSN_XLP
+ #define IVIRT ASE_VIRT
+ #define IVIRT64 ASE_VIRT64
+
+@@ -957,6 +958,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 },
+@@ -989,12 +991,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 },
+@@ -1066,6 +1069,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 },
+@@ -1081,6 +1085,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 },
+@@ -1234,9 +1240,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 },
+@@ -1401,7 +1407,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 },
+@@ -1446,10 +1452,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 },
+@@ -1499,7 +1508,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 },
+@@ -1936,9 +1945,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.7.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0013-Fix-GOT-address-computations-in-initial-PLT-entries-.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0013-Fix-GOT-address-computations-in-initial-PLT-entries-.patch
new file mode 100644
index 000000000..24af1207c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0013-Fix-GOT-address-computations-in-initial-PLT-entries-.patch
@@ -0,0 +1,72 @@
+From 9619a608528383a44ccc1637ae939b5f3e97adc5 Mon Sep 17 00:00:00 2001
+From: Sandra Loosemore <sandra@codesourcery.com>
+Date: Wed, 9 Dec 2015 16:13:58 -0800
+Subject: [PATCH 13/14] Fix GOT address computations in initial PLT entries for
+ nios2.
+
+2015-12-09 Sandra Loosemore <sandra@codesourcery.com>
+
+ bfd/
+ * elf32-nios2.c (nios2_elf32_finish_dynamic_sections): Correct
+ %hiadj/%lo computations for _GLOBAL_OFFSET_TABLE_ in initial
+ PLT entries. Assert alignment requirements.
+
+Signed-off-by: Marek Vasut <marex@denx.de>
+Upstream-Status: Backport
+---
+ bfd/elf32-nios2.c | 23 ++++++++++++++++-------
+ 1 file changed, 16 insertions(+), 7 deletions(-)
+
+diff --git a/bfd/elf32-nios2.c b/bfd/elf32-nios2.c
+index 6b29d8b..1c54320 100644
+--- a/bfd/elf32-nios2.c
++++ b/bfd/elf32-nios2.c
+@@ -5383,12 +5383,17 @@ nios2_elf32_finish_dynamic_sections (bfd *output_bfd,
+ + sgotplt->output_offset);
+ if (bfd_link_pic (info))
+ {
+- bfd_vma corrected = got_address - (splt->output_section->vma
+- + splt->output_offset + 4);
++ bfd_vma got_pcrel = got_address - (splt->output_section->vma
++ + splt->output_offset);
++ /* Both GOT and PLT must be aligned to a 16-byte boundary
++ for the two loads to share the %hiadj part. The 4-byte
++ offset for nextpc is accounted for in the %lo offsets
++ on the loads. */
++ BFD_ASSERT ((got_pcrel & 0xf) == 0);
+ nios2_elf32_install_data (splt, nios2_so_plt0_entry, 0, 6);
+- nios2_elf32_install_imm16 (splt, 4, hiadj (corrected));
+- nios2_elf32_install_imm16 (splt, 12, (corrected & 0xffff) + 4);
+- nios2_elf32_install_imm16 (splt, 16, (corrected & 0xffff) + 8);
++ nios2_elf32_install_imm16 (splt, 4, hiadj (got_pcrel));
++ nios2_elf32_install_imm16 (splt, 12, got_pcrel & 0xffff);
++ nios2_elf32_install_imm16 (splt, 16, (got_pcrel + 4) & 0xffff);
+ }
+ else
+ {
+@@ -5404,6 +5409,10 @@ nios2_elf32_finish_dynamic_sections (bfd *output_bfd,
+ 6 | ((res_size - (res_offset + 4)) << 6),
+ splt->contents + res_offset);
+
++ /* The GOT must be aligned to a 16-byte boundary for the
++ two loads to share the same %hiadj part. */
++ BFD_ASSERT ((got_address & 0xf) == 0);
++
+ nios2_elf32_install_data (splt, nios2_plt0_entry, res_size, 7);
+ nios2_elf32_install_imm16 (splt, res_size, hiadj (res_start));
+ nios2_elf32_install_imm16 (splt, res_size + 4,
+@@ -5411,9 +5420,9 @@ nios2_elf32_finish_dynamic_sections (bfd *output_bfd,
+ nios2_elf32_install_imm16 (splt, res_size + 12,
+ hiadj (got_address));
+ nios2_elf32_install_imm16 (splt, res_size + 16,
+- (got_address & 0xffff) + 4);
++ (got_address + 4) & 0xffff);
+ nios2_elf32_install_imm16 (splt, res_size + 20,
+- (got_address & 0xffff) + 8);
++ (got_address + 8) & 0xffff);
+ }
+ }
+ }
+--
+2.7.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0014-Correct-nios2-_gp-address-computation.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0014-Correct-nios2-_gp-address-computation.patch
new file mode 100644
index 000000000..86eeded6e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0014-Correct-nios2-_gp-address-computation.patch
@@ -0,0 +1,106 @@
+From 27f155fd0ab4ba954366643dbfdc3c7104933794 Mon Sep 17 00:00:00 2001
+From: Sandra Loosemore <sandra@codesourcery.com>
+Date: Sun, 27 Dec 2015 12:30:26 -0800
+Subject: [PATCH 14/14] Correct nios2 _gp address computation.
+
+2015-12-27 Sandra Loosemore <sandra@codesourcery.com>
+
+ bfd/
+ * elf32-nios2.c (nios2_elf_assign_gp): Correct computation of _gp
+ address.
+ (nios2_elf32_relocate_section): Tidy code for R_NIOS2_GPREL error
+ messages.
+
+Signed-off-by: Marek Vasut <marex@denx.de>
+Upstream-Status: Backport
+---
+ bfd/elf32-nios2.c | 31 +++++++++++++++++++++----------
+ 1 file changed, 21 insertions(+), 10 deletions(-)
+
+diff --git a/bfd/elf32-nios2.c b/bfd/elf32-nios2.c
+index 1c54320..babecf3 100644
+--- a/bfd/elf32-nios2.c
++++ b/bfd/elf32-nios2.c
+@@ -3086,7 +3086,15 @@ lookup:
+ case bfd_link_hash_defined:
+ case bfd_link_hash_defweak:
+ gp_found = TRUE;
+- *pgp = lh->u.def.value;
++ {
++ asection *sym_sec = lh->u.def.section;
++ bfd_vma sym_value = lh->u.def.value;
++
++ if (sym_sec->output_section)
++ sym_value = (sym_value + sym_sec->output_offset
++ + sym_sec->output_section->vma);
++ *pgp = sym_value;
++ }
+ break;
+ case bfd_link_hash_indirect:
+ case bfd_link_hash_warning:
+@@ -3719,7 +3727,6 @@ nios2_elf32_relocate_section (bfd *output_bfd,
+ struct elf32_nios2_link_hash_entry *eh;
+ bfd_vma relocation;
+ bfd_vma gp;
+- bfd_vma reloc_address;
+ bfd_reloc_status_type r = bfd_reloc_ok;
+ const char *name = NULL;
+ int r_type;
+@@ -3762,12 +3769,6 @@ nios2_elf32_relocate_section (bfd *output_bfd,
+ if (bfd_link_relocatable (info))
+ continue;
+
+- if (sec && sec->output_section)
+- reloc_address = (sec->output_section->vma + sec->output_offset
+- + rel->r_offset);
+- else
+- reloc_address = 0;
+-
+ if (howto)
+ {
+ switch (howto->type)
+@@ -3816,6 +3817,15 @@ nios2_elf32_relocate_section (bfd *output_bfd,
+ /* Turns an absolute address into a gp-relative address. */
+ if (!nios2_elf_assign_gp (output_bfd, &gp, info))
+ {
++ bfd_vma reloc_address;
++
++ if (sec && sec->output_section)
++ reloc_address = (sec->output_section->vma
++ + sec->output_offset
++ + rel->r_offset);
++ else
++ reloc_address = 0;
++
+ format = _("global pointer relative relocation at address "
+ "0x%08x when _gp not defined\n");
+ sprintf (msgbuf, format, reloc_address);
+@@ -3825,7 +3835,7 @@ nios2_elf32_relocate_section (bfd *output_bfd,
+ else
+ {
+ bfd_vma symbol_address = rel->r_addend + relocation;
+- relocation = relocation + rel->r_addend - gp;
++ relocation = symbol_address - gp;
+ rel->r_addend = 0;
+ if (((signed) relocation < -32768
+ || (signed) relocation > 32767)
+@@ -3833,6 +3843,8 @@ nios2_elf32_relocate_section (bfd *output_bfd,
+ || h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak))
+ {
++ if (h)
++ name = h->root.root.string;
+ format = _("Unable to reach %s (at 0x%08x) from the "
+ "global pointer (at 0x%08x) because the "
+ "offset (%d) is out of the allowed range, "
+@@ -3848,7 +3860,6 @@ nios2_elf32_relocate_section (bfd *output_bfd,
+ rel->r_offset, relocation,
+ rel->r_addend);
+ }
+-
+ break;
+ case R_NIOS2_UJMP:
+ r = nios2_elf32_do_ujmp_relocate (input_bfd, howto,
+--
+2.7.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils_2.26.bb b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils_2.26.bb
new file mode 100644
index 000000000..b70ffbf28
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils_2.26.bb
@@ -0,0 +1,40 @@
+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_OECONF_class-native = "--enable-targets=all \
+ --enable-64-bit-bfd \
+ --enable-install-libiberty \
+ --enable-install-libbfd"
+
+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 || :
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/0001-src-local.mk-fix-parallel-issue.patch b/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/0001-src-local.mk-fix-parallel-issue.patch
new file mode 100644
index 000000000..9543a56f1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/0001-src-local.mk-fix-parallel-issue.patch
@@ -0,0 +1,33 @@
+From 3a15f7c9ace6c0294edc313a1848cafcc31b2a92 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: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@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
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/add-with-bisonlocaledir.patch b/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/add-with-bisonlocaledir.patch
new file mode 100644
index 000000000..35c0f6fa3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/bison-2.3_m4.patch b/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/bison-2.3_m4.patch
new file mode 100644
index 000000000..348ce1d2b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/bison-2.3_m4.patch
@@ -0,0 +1,591 @@
+Upstream-Status: Pending
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+
+--- /dev/null
++++ bison-1.875/m4/inttypes-pri.m4
+@@ -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
++])
+--- /dev/null
++++ bison-1.875/m4/lcmessage.m4
+@@ -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
++])
+--- /dev/null
++++ bison-1.875/m4/uintmax_t.m4
+@@ -0,0 +1,29 @@
++# uintmax_t.m4 serial 6 (gettext-0.11)
++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.
++
++AC_PREREQ(2.13)
++
++# Define uintmax_t to `unsigned long' or `unsigned long long'
++# if <inttypes.h> does not exist.
++
++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 <inttypes.h> and <stdint.h> don't define.])
++ fi
++])
+--- /dev/null
++++ bison-1.875/m4/glibc21.m4
+@@ -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"
++ ]
++)
+--- /dev/null
++++ bison-1.875/m4/stdint_h.m4
+@@ -0,0 +1,28 @@
++# stdint_h.m4 serial 2 (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_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
++])
+--- /dev/null
++++ bison-1.875/m4/inttypes_h.m4
+@@ -0,0 +1,28 @@
++# inttypes_h.m4 serial 4 (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_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
++])
+--- /dev/null
++++ bison-1.875/m4/ulonglong.m4
+@@ -0,0 +1,23 @@
++# ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40)
++dnl Copyright (C) 1999-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.
++
++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 = 1; 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
++])
+--- /dev/null
++++ bison-1.875/m4/codeset.m4
+@@ -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
++])
+--- /dev/null
++++ bison-1.875/m4/intdiv0.m4
+@@ -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.])
++])
+--- /dev/null
++++ bison-1.875/m4/glib.m4
+@@ -0,0 +1,196 @@
++# Configure paths for GLIB
++# Owen Taylor 97-11-3
++
++dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
++dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or
++dnl gthread is specified in MODULES, pass to glib-config
++dnl
++AC_DEFUN(AM_PATH_GLIB,
++[dnl
++dnl Get the cflags and libraries from the glib-config script
++dnl
++AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)],
++ glib_config_prefix="$withval", glib_config_prefix="")
++AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)],
++ glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
++AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program],
++ , enable_glibtest=yes)
++
++ if test x$glib_config_exec_prefix != x ; then
++ glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
++ if test x${GLIB_CONFIG+set} != xset ; then
++ GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
++ fi
++ fi
++ if test x$glib_config_prefix != x ; then
++ glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
++ if test x${GLIB_CONFIG+set} != xset ; then
++ GLIB_CONFIG=$glib_config_prefix/bin/glib-config
++ fi
++ fi
++
++ for module in . $4
++ do
++ case "$module" in
++ gmodule)
++ glib_config_args="$glib_config_args gmodule"
++ ;;
++ gthread)
++ glib_config_args="$glib_config_args gthread"
++ ;;
++ esac
++ done
++
++ AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
++ min_glib_version=ifelse([$1], ,0.99.7,$1)
++ AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
++ no_glib=""
++ if test "$GLIB_CONFIG" = "no" ; then
++ no_glib=yes
++ else
++ GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
++ GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
++ glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
++ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
++ glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
++ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
++ glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
++ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
++ if test "x$enable_glibtest" = "xyes" ; then
++ ac_save_CFLAGS="$CFLAGS"
++ ac_save_LIBS="$LIBS"
++ CFLAGS="$CFLAGS $GLIB_CFLAGS"
++ LIBS="$GLIB_LIBS $LIBS"
++dnl
++dnl Now check if the installed GLIB is sufficiently new. (Also sanity
++dnl checks the results of glib-config to some extent
++dnl
++ rm -f conf.glibtest
++ AC_TRY_RUN([
++#include <glib.h>
++#include <stdio.h>
++#include <stdlib.h>
++
++int
++main ()
++{
++ int major, minor, micro;
++ char *tmp_version;
++
++ system ("touch conf.glibtest");
++
++ /* HP/UX 9 (%@#!) writes to sscanf strings */
++ tmp_version = g_strdup("$min_glib_version");
++ if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
++ printf("%s, bad version string\n", "$min_glib_version");
++ exit(1);
++ }
++
++ if ((glib_major_version != $glib_config_major_version) ||
++ (glib_minor_version != $glib_config_minor_version) ||
++ (glib_micro_version != $glib_config_micro_version))
++ {
++ printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
++ $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
++ glib_major_version, glib_minor_version, glib_micro_version);
++ printf ("*** was found! If glib-config was correct, then it is best\n");
++ printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n");
++ printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
++ printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
++ printf("*** required on your system.\n");
++ printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n");
++ printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n");
++ printf("*** before re-running configure\n");
++ }
++ else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
++ (glib_minor_version != GLIB_MINOR_VERSION) ||
++ (glib_micro_version != GLIB_MICRO_VERSION))
++ {
++ printf("*** GLIB header files (version %d.%d.%d) do not match\n",
++ GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
++ printf("*** library (version %d.%d.%d)\n",
++ glib_major_version, glib_minor_version, glib_micro_version);
++ }
++ else
++ {
++ if ((glib_major_version > major) ||
++ ((glib_major_version == major) && (glib_minor_version > minor)) ||
++ ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
++ {
++ return 0;
++ }
++ else
++ {
++ printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
++ glib_major_version, glib_minor_version, glib_micro_version);
++ printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
++ major, minor, micro);
++ printf("*** GLIB is always available from ftp://ftp.gtk.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 glib-config shell script is\n");
++ printf("*** being found. The easiest way to fix this is to remove the old version\n");
++ printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n");
++ printf("*** correct copy of glib-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_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
++ CFLAGS="$ac_save_CFLAGS"
++ LIBS="$ac_save_LIBS"
++ fi
++ fi
++ if test "x$no_glib" = x ; then
++ AC_MSG_RESULT(yes)
++ ifelse([$2], , :, [$2])
++ else
++ AC_MSG_RESULT(no)
++ if test "$GLIB_CONFIG" = "no" ; then
++ echo "*** The glib-config script installed by GLIB could not be found"
++ echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
++ echo "*** your path, or set the GLIB_CONFIG environment variable to the"
++ echo "*** full path to glib-config."
++ else
++ if test -f conf.glibtest ; then
++ :
++ else
++ echo "*** Could not run GLIB test program, checking why..."
++ CFLAGS="$CFLAGS $GLIB_CFLAGS"
++ LIBS="$LIBS $GLIB_LIBS"
++ AC_TRY_LINK([
++#include <glib.h>
++#include <stdio.h>
++], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
++ [ echo "*** The test program compiled, but did not run. This usually means"
++ echo "*** that the run-time linker is not finding GLIB or finding the wrong"
++ echo "*** version of GLIB. If it is not finding GLIB, 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 "***"
++ echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
++ echo "*** came with the system with the command"
++ echo "***"
++ echo "*** rpm --erase --nodeps gtk gtk-devel" ],
++ [ echo "*** The test program failed to compile or link. See the file config.log for the"
++ echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
++ echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
++ echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
++ CFLAGS="$ac_save_CFLAGS"
++ LIBS="$ac_save_LIBS"
++ fi
++ fi
++ GLIB_CFLAGS=""
++ GLIB_LIBS=""
++ ifelse([$3], , :, [$3])
++ fi
++ AC_SUBST(GLIB_CFLAGS)
++ AC_SUBST(GLIB_LIBS)
++ rm -f conf.glibtest
++])
+--- /dev/null
++++ bison-1.875/m4/inttypes.m4
+@@ -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
++])
+--- /dev/null
++++ bison-1.875/m4/isc-posix.m4
+@@ -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"])
++ ]
++)
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/dont-depend-on-help2man.patch.patch b/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/dont-depend-on-help2man.patch.patch
new file mode 100644
index 000000000..ac16c5770
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/m4.patch b/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/m4.patch
new file mode 100644
index 000000000..d139da5e7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/m4.patch
@@ -0,0 +1,414 @@
+Upstream-Status: Pending
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+
+Index: bison-2.4.2/m4/lcmessage.m4
+===================================================================
+--- /dev/null
++++ bison-2.4.2/m4/lcmessage.m4
+@@ -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
++])
+Index: bison-2.4.2/m4/uintmax_t.m4
+===================================================================
+--- /dev/null
++++ bison-2.4.2/m4/uintmax_t.m4
+@@ -0,0 +1,29 @@
++# uintmax_t.m4 serial 6 (gettext-0.11)
++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.
++
++AC_PREREQ(2.13)
++
++# Define uintmax_t to `unsigned long' or `unsigned long long'
++# if <inttypes.h> does not exist.
++
++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 <inttypes.h> and <stdint.h> don't define.])
++ fi
++])
+Index: bison-2.4.2/m4/ulonglong.m4
+===================================================================
+--- /dev/null
++++ bison-2.4.2/m4/ulonglong.m4
+@@ -0,0 +1,23 @@
++# ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40)
++dnl Copyright (C) 1999-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.
++
++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 = 1; 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
++])
+Index: bison-2.4.2/m4/intdiv0.m4
+===================================================================
+--- /dev/null
++++ bison-2.4.2/m4/intdiv0.m4
+@@ -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.])
++])
+Index: bison-2.4.2/m4/glib.m4
+===================================================================
+--- /dev/null
++++ bison-2.4.2/m4/glib.m4
+@@ -0,0 +1,196 @@
++# Configure paths for GLIB
++# Owen Taylor 97-11-3
++
++dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
++dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or
++dnl gthread is specified in MODULES, pass to glib-config
++dnl
++AC_DEFUN(AM_PATH_GLIB,
++[dnl
++dnl Get the cflags and libraries from the glib-config script
++dnl
++AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)],
++ glib_config_prefix="$withval", glib_config_prefix="")
++AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)],
++ glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
++AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program],
++ , enable_glibtest=yes)
++
++ if test x$glib_config_exec_prefix != x ; then
++ glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
++ if test x${GLIB_CONFIG+set} != xset ; then
++ GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
++ fi
++ fi
++ if test x$glib_config_prefix != x ; then
++ glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
++ if test x${GLIB_CONFIG+set} != xset ; then
++ GLIB_CONFIG=$glib_config_prefix/bin/glib-config
++ fi
++ fi
++
++ for module in . $4
++ do
++ case "$module" in
++ gmodule)
++ glib_config_args="$glib_config_args gmodule"
++ ;;
++ gthread)
++ glib_config_args="$glib_config_args gthread"
++ ;;
++ esac
++ done
++
++ AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
++ min_glib_version=ifelse([$1], ,0.99.7,$1)
++ AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
++ no_glib=""
++ if test "$GLIB_CONFIG" = "no" ; then
++ no_glib=yes
++ else
++ GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
++ GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
++ glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
++ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
++ glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
++ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
++ glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
++ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
++ if test "x$enable_glibtest" = "xyes" ; then
++ ac_save_CFLAGS="$CFLAGS"
++ ac_save_LIBS="$LIBS"
++ CFLAGS="$CFLAGS $GLIB_CFLAGS"
++ LIBS="$GLIB_LIBS $LIBS"
++dnl
++dnl Now check if the installed GLIB is sufficiently new. (Also sanity
++dnl checks the results of glib-config to some extent
++dnl
++ rm -f conf.glibtest
++ AC_TRY_RUN([
++#include <glib.h>
++#include <stdio.h>
++#include <stdlib.h>
++
++int
++main ()
++{
++ int major, minor, micro;
++ char *tmp_version;
++
++ system ("touch conf.glibtest");
++
++ /* HP/UX 9 (%@#!) writes to sscanf strings */
++ tmp_version = g_strdup("$min_glib_version");
++ if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
++ printf("%s, bad version string\n", "$min_glib_version");
++ exit(1);
++ }
++
++ if ((glib_major_version != $glib_config_major_version) ||
++ (glib_minor_version != $glib_config_minor_version) ||
++ (glib_micro_version != $glib_config_micro_version))
++ {
++ printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
++ $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
++ glib_major_version, glib_minor_version, glib_micro_version);
++ printf ("*** was found! If glib-config was correct, then it is best\n");
++ printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n");
++ printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
++ printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
++ printf("*** required on your system.\n");
++ printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n");
++ printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n");
++ printf("*** before re-running configure\n");
++ }
++ else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
++ (glib_minor_version != GLIB_MINOR_VERSION) ||
++ (glib_micro_version != GLIB_MICRO_VERSION))
++ {
++ printf("*** GLIB header files (version %d.%d.%d) do not match\n",
++ GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
++ printf("*** library (version %d.%d.%d)\n",
++ glib_major_version, glib_minor_version, glib_micro_version);
++ }
++ else
++ {
++ if ((glib_major_version > major) ||
++ ((glib_major_version == major) && (glib_minor_version > minor)) ||
++ ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
++ {
++ return 0;
++ }
++ else
++ {
++ printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
++ glib_major_version, glib_minor_version, glib_micro_version);
++ printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
++ major, minor, micro);
++ printf("*** GLIB is always available from ftp://ftp.gtk.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 glib-config shell script is\n");
++ printf("*** being found. The easiest way to fix this is to remove the old version\n");
++ printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n");
++ printf("*** correct copy of glib-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_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
++ CFLAGS="$ac_save_CFLAGS"
++ LIBS="$ac_save_LIBS"
++ fi
++ fi
++ if test "x$no_glib" = x ; then
++ AC_MSG_RESULT(yes)
++ ifelse([$2], , :, [$2])
++ else
++ AC_MSG_RESULT(no)
++ if test "$GLIB_CONFIG" = "no" ; then
++ echo "*** The glib-config script installed by GLIB could not be found"
++ echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
++ echo "*** your path, or set the GLIB_CONFIG environment variable to the"
++ echo "*** full path to glib-config."
++ else
++ if test -f conf.glibtest ; then
++ :
++ else
++ echo "*** Could not run GLIB test program, checking why..."
++ CFLAGS="$CFLAGS $GLIB_CFLAGS"
++ LIBS="$LIBS $GLIB_LIBS"
++ AC_TRY_LINK([
++#include <glib.h>
++#include <stdio.h>
++], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
++ [ echo "*** The test program compiled, but did not run. This usually means"
++ echo "*** that the run-time linker is not finding GLIB or finding the wrong"
++ echo "*** version of GLIB. If it is not finding GLIB, 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 "***"
++ echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
++ echo "*** came with the system with the command"
++ echo "***"
++ echo "*** rpm --erase --nodeps gtk gtk-devel" ],
++ [ echo "*** The test program failed to compile or link. See the file config.log for the"
++ echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
++ echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
++ echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
++ CFLAGS="$ac_save_CFLAGS"
++ LIBS="$ac_save_LIBS"
++ fi
++ fi
++ GLIB_CFLAGS=""
++ GLIB_LIBS=""
++ ifelse([$3], , :, [$3])
++ fi
++ AC_SUBST(GLIB_CFLAGS)
++ AC_SUBST(GLIB_LIBS)
++ rm -f conf.glibtest
++])
+Index: bison-2.4.2/m4/isc-posix.m4
+===================================================================
+--- /dev/null
++++ bison-2.4.2/m4/isc-posix.m4
+@@ -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"])
++ ]
++)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/bison/bison_2.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/bison/bison_2.3.bb
new file mode 100644
index 000000000..182e8802b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/bison/bison_2.3.bb
@@ -0,0 +1,26 @@
+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 = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
+SECTION = "devel"
+DEPENDS = "bison-native flex-native"
+
+PR = "r1"
+
+SRC_URI = "${GNU_MIRROR}/bison/bison-${PV}.tar.gz \
+ file://bison-2.3_m4.patch"
+
+SRC_URI[md5sum] = "22327efdd5080e2b1acb6e560a04b43a"
+SRC_URI[sha256sum] = "52f78aa4761a74ceb7fdf770f3554dd84308c3b93c4255e3a5c17558ecda293e"
+
+inherit autotools gettext texinfo
+acpaths = "-I ${S}/m4"
+
+do_configure_prepend () {
+ rm -f ${S}/m4/*gl.m4
+ cp ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/runtime-po/
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/bison/bison_3.0.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/bison/bison_3.0.4.bb
new file mode 100644
index 000000000..cffcd885a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/bison/bison_3.0.4.bb
@@ -0,0 +1,40 @@
+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://m4.patch \
+ 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"
+
+LDFLAGS_prepend_libc-uclibc = " -lrt "
+DEPENDS_class-native = "gettext-minimal-native"
+
+inherit autotools gettext texinfo
+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/import-layers/yocto-poky/meta/recipes-devtools/bootchart2/bootchart2/bootchartd_stop.sh b/import-layers/yocto-poky/meta/recipes-devtools/bootchart2/bootchart2/bootchartd_stop.sh
new file mode 100644
index 000000000..21a78877a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/bootchart2/bootchart2_0.14.8.bb b/import-layers/yocto-poky/meta/recipes-devtools/bootchart2/bootchart2_0.14.8.bb
new file mode 100644
index 000000000..86c614a63
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/bootchart2/bootchart2_0.14.8.bb
@@ -0,0 +1,155 @@
+# 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/mmeeks/bootchart.git \
+ file://bootchartd_stop.sh \
+ "
+
+S = "${WORKDIR}/git"
+SRCREV = "48e0071048564c6af75ab969e842d6dec808da09"
+
+inherit systemd
+inherit update-rc.d
+inherit pythonnative
+
+# 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 ."
+
+# We want native pybootchartgui to execute with the correct Python interpeter.
+do_compile_append_class-native () {
+ echo "#! ${PYTHON}" | cat - ${S}/pybootchartgui.py > ${WORKDIR}/temp_pybootchartgui
+ mv ${WORKDIR}/temp_pybootchartgui ${S}/pybootchartgui.py
+ chmod +x ${S}/pybootchartgui
+}
+
+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
+}
+
+PACKAGES =+ "pybootchartgui"
+FILES_pybootchartgui += "${libdir}/python*/site-packages/pybootchartgui ${bindir}/pybootchartgui"
+RDEPENDS_pybootchartgui = "python-pycairo python-compression python-image python-textutils python-shell python-compression python-codecs"
+RDEPENDS_${PN}_class-target += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'sysvinit-pidof', 'procps', d)}"
+RDEPENDS_${PN}_class-target += "lsb"
+DEPENDS_append_class-native = " python-pycairo-native"
+
+PACKAGES =+ "bootchartd-stop-initscript"
+FILES_bootchartd-stop-initscript += "${sysconfdir}/init.d ${sysconfdir}/rc*.d"
+
+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/import-layers/yocto-poky/meta/recipes-devtools/btrfs-tools/btrfs-tools/fix-parallel.patch b/import-layers/yocto-poky/meta/recipes-devtools/btrfs-tools/btrfs-tools/fix-parallel.patch
new file mode 100644
index 000000000..bbc53c6fe
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/btrfs-tools/btrfs-tools/fix-parallel.patch
@@ -0,0 +1,32 @@
+From 373eb51328b5e10529763cad441210e6b0efb24e Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 11 Feb 2015 22:08:41 -0800
+Subject: [PATCH] Makefile: fix for parallel build
+
+Fixed:
+mkfs.c:300:46: error: 'BTRFS_BUILD_VERSION' undeclared (first use in this function)
+ fprintf(stderr, "mkfs.btrfs, part of %s\n", BTRFS_BUILD_VERSION);
+
+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 860a390..8a6fbd7 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -142,7 +142,7 @@ else
+ check_echo = true
+ endif
+
+-%.o.d: %.c
++%.o.d: %.c version.h
+ $(Q)$(CC) -MM -MG -MF $@ -MT $(@:.o.d=.o) -MT $(@:.o.d=.static.o) -MT $@ $(CFLAGS) $<
+
+ .c.o:
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/btrfs-tools/btrfs-tools/fix-symlink-creation-multiple-times.patch b/import-layers/yocto-poky/meta/recipes-devtools/btrfs-tools/btrfs-tools/fix-symlink-creation-multiple-times.patch
new file mode 100644
index 000000000..a94549639
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/btrfs-tools/btrfs-tools/fix-symlink-creation-multiple-times.patch
@@ -0,0 +1,46 @@
+From 05ab78e9183575e38f342e05a056cb7bcd1e52e1 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 18 Feb 2016 20:41:28 -0500
+Subject: [PATCH] btrfs-progs: fix symlink creation multiple times
+
+The rule to create symlink in Makefile caused parallel issue:
+$ make -j 40 DESTDIR=/image install BUILD_VERBOSE=1
+...
+ 1 [LN] libbtrfs.so.0
+ 2 [LN] libbtrfs.so
+ 3 ln -s -f libbtrfs.so.0.1 libbtrfs.so.0
+ 4 ln -s -f libbtrfs.so.0.1 libbtrfs.so.0
+ 5 ln -s -f libbtrfs.so.0.1 libbtrfs.so
+ 6 ln -s -f libbtrfs.so.0.1 libbtrfs.so
+...
+
+It failed occasionally:
+...
+|symlinkat: couldn't stat 'git/libbtrfs.so' even though symlink
+creation succeeded (No such file or directory).
+|ln: failed to create symbolic link 'libbtrfs.so': No such file or directory
+...
+
+Upstream-Status: Submitted [linux-btrfs@vger.kernel.org]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ Makefile.in | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 1f4002e..16eeaf9 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -236,8 +236,7 @@ $(libs_static): $(libbtrfs_objects)
+
+ $(lib_links):
+ @echo " [LN] $@"
+- $(Q)$(LN_S) -f libbtrfs.so.0.1 libbtrfs.so.0
+- $(Q)$(LN_S) -f libbtrfs.so.0.1 libbtrfs.so
++ $(Q)$(LN_S) -f libbtrfs.so.0.1 $@
+
+ # keep intermediate files from the below implicit rules around
+ .PRECIOUS: $(addsuffix .o,$(progs))
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.4.bb
new file mode 100644
index 000000000..32e7bae58
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.4.bb
@@ -0,0 +1,34 @@
+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"
+RDEPENDS_${PN} = "libgcc"
+
+SRCREV = "21258fab2caeade405a15ba932d373b364aa6e8c"
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git \
+ file://fix-parallel.patch \
+ file://fix-symlink-creation-multiple-times.patch \
+"
+
+inherit autotools-brokensep pkgconfig
+
+EXTRA_OECONF += "--disable-documentation"
+EXTRA_OECONF_append_libc-musl = " --disable-backtrace "
+
+
+do_configure_prepend() {
+ sh autogen.sh
+}
+
+S = "${WORKDIR}/git"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/build-compare/build-compare_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/build-compare/build-compare_git.bb
new file mode 100644
index 000000000..676f11dd8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/build-compare/build-compare_git.bb
@@ -0,0 +1,28 @@
+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 \
+ "
+
+SRCREV = "c5352c054c6ef15735da31b76d6d88620f4aff0a"
+
+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/import-layers/yocto-poky/meta/recipes-devtools/build-compare/files/0001-Add-support-for-deb-and-ipk-packaging.patch b/import-layers/yocto-poky/meta/recipes-devtools/build-compare/files/0001-Add-support-for-deb-and-ipk-packaging.patch
new file mode 100644
index 000000000..5c15218c8
--- /dev/null
+++ b/import-layers/yocto-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: Pending
+
+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/import-layers/yocto-poky/meta/recipes-devtools/build-compare/files/Ignore-DWARF-sections.patch b/import-layers/yocto-poky/meta/recipes-devtools/build-compare/files/Ignore-DWARF-sections.patch
new file mode 100644
index 000000000..7dda1acbf
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/build-compare/files/Rename-rpm-check.sh-to-pkg-diff.sh.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/ccache/ccache.inc b/import-layers/yocto-poky/meta/recipes-devtools/ccache/ccache.inc
new file mode 100644
index 000000000..69aa64e5e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ccache/ccache.inc
@@ -0,0 +1,18 @@
+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 = "git://git.samba.org/ccache.git"
+
+S = "${WORKDIR}/git"
+
+inherit autotools
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/ccache/ccache_3.2.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/ccache/ccache_3.2.4.bb
new file mode 100644
index 000000000..fd45e4160
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ccache/ccache_3.2.4.bb
@@ -0,0 +1,10 @@
+require ccache.inc
+
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=b3c337e7664559a789d9f7a93e5283c1"
+
+SRCREV = "2254797f1c5cfb83c4272da7b138f7f47218eb7d"
+
+SRC_URI += " \
+ file://0002-dev.mk.in-fix-file-name-too-long.patch \
+"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/ccache/files/0002-dev.mk.in-fix-file-name-too-long.patch b/import-layers/yocto-poky/meta/recipes-devtools/ccache/files/0002-dev.mk.in-fix-file-name-too-long.patch
new file mode 100644
index 000000000..837cfadf6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ccache/files/0002-dev.mk.in-fix-file-name-too-long.patch
@@ -0,0 +1,32 @@
+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(-)
+
+diff --git a/dev.mk.in b/dev.mk.in
+index 1261ad3..ec55ac4 100644
+--- a/dev.mk.in
++++ b/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
+ GPERF = gperf
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/cdrtools/cdrtools-native_3.01.bb b/import-layers/yocto-poky/meta/recipes-devtools/cdrtools/cdrtools-native_3.01.bb
new file mode 100644
index 000000000..ff4d5ac44
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/cdrtools/cdrtools-native_3.01.bb
@@ -0,0 +1,26 @@
+# 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"
+
+SRC_URI[md5sum] = "7d45c5b7e1f78d85d1583b361aee6e8b"
+SRC_URI[sha256sum] = "ed282eb6276c4154ce6a0b5dee0bdb81940d0cbbfc7d03f769c4735ef5f5860f"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+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/import-layers/yocto-poky/meta/recipes-devtools/chrpath/chrpath/standarddoc.patch b/import-layers/yocto-poky/meta/recipes-devtools/chrpath/chrpath/standarddoc.patch
new file mode 100644
index 000000000..f96f104fa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/chrpath/chrpath/standarddoc.patch
@@ -0,0 +1,19 @@
+Upstream-Status: Pending
+
+autoconf/automake set docdir automatically, use their value ensuring
+doc files are placed into $datadir/doc, not $prefix/doc.
+
+RP 5/7/2011
+
+Index: chrpath-0.13/Makefile.am
+===================================================================
+--- chrpath-0.13.orig/Makefile.am 2011-07-05 23:40:14.769920254 +0100
++++ chrpath-0.13/Makefile.am 2011-07-05 23:40:19.819920635 +0100
+@@ -1,7 +1,5 @@
+ SUBDIRS = testsuite deb
+
+-docdir = $(prefix)/doc/$(PACKAGE)-$(VERSION)
+-
+ doc_DATA = AUTHORS COPYING ChangeLog INSTALL NEWS README
+
+ bin_PROGRAMS = chrpath
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/chrpath/chrpath_0.16.bb b/import-layers/yocto-poky/meta/recipes-devtools/chrpath/chrpath_0.16.bb
new file mode 100644
index 000000000..e115eb5c9
--- /dev/null
+++ b/import-layers/yocto-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 = "http://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/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake-native_3.4.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake-native_3.4.3.bb
new file mode 100644
index 000000000..cb4e749d7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake-native_3.4.3.bb
@@ -0,0 +1,16 @@
+require cmake.inc
+inherit native
+
+# Using cmake's internal libarchive, so some dependencies are needed
+DEPENDS += "bzip2-native zlib-native"
+
+SRC_URI += "\
+ file://cmlibarchive-disable-ext2fs.patch \
+"
+
+# Disable ccmake since we don't depend on ncurses
+CMAKE_EXTRACONF = "\
+ -DBUILD_CursesDialog=0 \
+ -DENABLE_ACL=0 -DHAVE_ACL_LIBACL_H=0 \
+ -DHAVE_SYS_ACL_H=0 \
+"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake.inc b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake.inc
new file mode 100644
index 000000000..968d003b2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake.inc
@@ -0,0 +1,55 @@
+# 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=3ba5a6c34481652ce573e5c4e1d707e4 \
+ file://Source/cmake.h;beginline=1;endline=10;md5=341736dae83c9e344b53eeb1bc7d7bc2"
+
+CMAKE_MAJOR_VERSION = "${@'.'.join(d.getVar('PV',1).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://0001-Add-NIOS2-CPU-support.patch \
+ "
+
+SRC_URI[md5sum] = "4cb3ff35b2472aae70f542116d616e63"
+SRC_URI[sha256sum] = "b73f8c1029611df7ed81796bf5ca8ba0ef41c6761132340c73ffe42704f980fa"
+
+UPSTREAM_CHECK_REGEX = "cmake-(?P<pver>\d+(\.\d+)+)\.tar"
+
+inherit autotools
+
+# Ugly hack to work around undefined OE_QMAKE_PATH_EXTERNAL_HOST_BINS variable
+# and possibly missing qmake binary (qtbase-native can be removed from sysroot
+# e.g. in order to upgrade it, even when there is target qtbase)
+
+# Fixes errors like this in cmake(-native).do_configure:
+#| -- Performing Test run_pic_test - Success
+#| CMake Error at tmp-eglibc/sysroots/qemuarm/usr/lib/cmake/Qt5Core/Qt5CoreConfig.cmake:27 (message):
+#| The imported target "Qt5::Core" references the file
+#|
+#| "/qmake"
+#|
+#| but this file does not exist. Possible reasons include:
+
+do_configure_prepend() {
+ sed -i 's/^find_package(Qt5Core QUIET)$/#find_package(Qt5Core QUIET)/g' ${S}/Tests/RunCMake/CMakeLists.txt
+ sed -i 's/^ find_package(Qt5Core REQUIRED)/# find_package(Qt5Core REQUIRED)/g' ${S}/Tests/Qt4And5Automoc/CMakeLists.txt
+ sed -i 's/^ find_package(Qt5Widgets QUIET NO_MODULE)/# find_package(Qt5Widgets QUIET NO_MODULE)/g' ${S}/Tests/CMakeLists.txt
+ sed -i 's/^find_package(Qt5Widgets QUIET)/#find_package(Qt5Widgets QUIET)/g' ${S}/Source/QtDialog/CMakeLists.txt
+ sed -i 's/^ find_package(Qt5Widgets REQUIRED)/# find_package(Qt5Widgets REQUIRED)/g' ${S}/Tests/QtAutoUicInterface/CMakeLists.txt
+ sed -i 's/^ find_package(Qt5Widgets REQUIRED)/# find_package(Qt5Widgets REQUIRED)/g' ${S}/Tests/QtAutogen/CMakeLists.txt
+ sed -i 's/^ find_package(Qt5Core REQUIRED)/# find_package(Qt5Core REQUIRED)/g' ${S}/Tests/QtAutogen/autorcc_depends/CMakeLists.txt
+}
+
+# Extra flags to pass to cmake invoked by bootstrap
+CMAKE_EXTRACONF = ""
+
+do_configure () {
+ ${S}/configure --prefix=${prefix} -- ${CMAKE_EXTRACONF}
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/0001-Add-NIOS2-CPU-support.patch b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/0001-Add-NIOS2-CPU-support.patch
new file mode 100644
index 000000000..6e0ab9fb7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/0001-Add-NIOS2-CPU-support.patch
@@ -0,0 +1,50 @@
+From 3f8c3d3011ea192da2c761560b615f55763715ef Mon Sep 17 00:00:00 2001
+From: Marek Vasut <marex@denx.de>
+Date: Thu, 26 Nov 2015 21:31:04 +0100
+Subject: [PATCH] Add NIOS2 CPU support
+
+Add necessary bits to support the NIOS2 little-endian CPU.
+
+Signed-off-by: Marek Vasut <marex@denx.de>
+Cc: Ley Foon Tan <lftan@altera.com>
+Cc: Thomas Chou <thomas@wytron.com.tw>
+Cc: Walter Goossens <waltergoossens@home.nl>
+Upstream-Status: Submitted
+---
+ Source/kwsys/CPU.h.in | 4 ++++
+ Utilities/KWIML/ABI.h.in | 4 ++++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/Source/kwsys/CPU.h.in b/Source/kwsys/CPU.h.in
+index 884d71a..66ffbb1 100644
+--- a/Source/kwsys/CPU.h.in
++++ b/Source/kwsys/CPU.h.in
+@@ -88,6 +88,10 @@
+ #elif defined(__mips) || defined(__mips__) || defined(__MIPS__)
+ # define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG
+
++/* NIOS2 */
++#elif defined(__NIOS2__) || defined(__NIOS2) || defined(__nios2__)
++# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE
++
+ /* OpenRISC 1000 */
+ #elif defined(__or1k__)
+ # define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG
+diff --git a/Utilities/KWIML/ABI.h.in b/Utilities/KWIML/ABI.h.in
+index 6300ada..87b6e96 100644
+--- a/Utilities/KWIML/ABI.h.in
++++ b/Utilities/KWIML/ABI.h.in
+@@ -398,6 +398,10 @@ suppression macro @KWIML@_ABI_NO_VERIFY was defined.
+ #elif defined(__mips) || defined(__mips__) || defined(__MIPS__)
+ # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_BIG
+
++/* NIOS2 */
++#elif defined(__NIOS2__) || defined(__NIOS2) || defined(__nios2__)
++# define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_LITTLE
++
+ /* OpenRISC 1000 */
+ #elif defined(__or1k__)
+ # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_BIG
+--
+2.6.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake
new file mode 100644
index 000000000..60014bbf2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake
@@ -0,0 +1,18 @@
+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 )
+
+string(REGEX MATCH "sysroots/([a-zA-Z0-9]+)" CMAKE_SYSTEM_PROCESSOR $ENV{SDKTARGETSYSROOT})
+string(REGEX REPLACE "sysroots/" "" CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR})
+
+# 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/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/cmlibarchive-disable-ext2fs.patch b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/cmlibarchive-disable-ext2fs.patch
new file mode 100644
index 000000000..bf3671259
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/environment.d-cmake.sh b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/environment.d-cmake.sh
new file mode 100644
index 000000000..0eb56b66f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/qt4-fail-silent.patch b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/qt4-fail-silent.patch
new file mode 100644
index 000000000..80fc277fa
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/support-oe-qt4-tools-names.patch b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/support-oe-qt4-tools-names.patch
new file mode 100644
index 000000000..15cbca89d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/support-oe-qt4-tools-names.patch
@@ -0,0 +1,54 @@
+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 11091b5..6704769 100644
+--- a/Modules/FindQt4.cmake
++++ b/Modules/FindQt4.cmake
+@@ -522,7 +522,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
+@@ -1148,12 +1148,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)
+
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake_3.4.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake_3.4.3.bb
new file mode 100644
index 000000000..2f188f071
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake_3.4.3.bb
@@ -0,0 +1,53 @@
+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", True)
+ docdir=d.getVar("docdir", True)
+
+ if not docdir.startswith(prefix):
+ raise bb.build.FuncFailed('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_LIBRARY_BZIP2=1 \
+ -DCMAKE_USE_SYSTEM_LIBRARY_CURL=1 \
+ -DCMAKE_USE_SYSTEM_LIBRARY_EXPAT=1 \
+ -DCMAKE_USE_SYSTEM_LIBRARY_FORM=1 \
+ -DCMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE=1 \
+ -DCMAKE_USE_SYSTEM_LIBRARY_LIBLZMA=1 \
+ -DCMAKE_USE_SYSTEM_LIBRARY_ZLIB=1 \
+ -DKWSYS_CHAR_IS_SIGNED=1 \
+ -DBUILD_CursesDialog=0 \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '-DKWSYS_LFS_WORKS=1', '-DKWSYS_LFS_DISABLE=1', d)} \
+"
+
+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/import-layers/yocto-poky/meta/recipes-devtools/desktop-file-utils/desktop-file-utils-native_0.22.bb b/import-layers/yocto-poky/meta/recipes-devtools/desktop-file-utils/desktop-file-utils-native_0.22.bb
new file mode 100644
index 000000000..f899cd2f1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/desktop-file-utils/desktop-file-utils-native_0.22.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] = "c6b9f9aac1ea143091178c23437e6cd0"
+SRC_URI[sha256sum] = "843532672692f98e9b2d6ae6cc8658da562dfde1606c7f33d9d227a344de56c5"
+
+inherit autotools native
+
+S = "${WORKDIR}/desktop-file-utils-${PV}"
+
+EXTRA_OECONF += "ac_cv_prog_EMACS=no"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/devel-config/distcc-config.bb b/import-layers/yocto-poky/meta/recipes-devtools/devel-config/distcc-config.bb
new file mode 100644
index 000000000..cb7830b99
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/devel-config/distcc-config.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Sets up distcc for compilation on the target device"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+ 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/import-layers/yocto-poky/meta/recipes-devtools/devel-config/distcc-config/distcc.sh b/import-layers/yocto-poky/meta/recipes-devtools/devel-config/distcc-config/distcc.sh
new file mode 100644
index 000000000..b4205931d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/devel-config/nfs-export-root.bb b/import-layers/yocto-poky/meta/recipes-devtools/devel-config/nfs-export-root.bb
new file mode 100644
index 000000000..169d00581
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/devel-config/nfs-export-root.bb
@@ -0,0 +1,18 @@
+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}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+ 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/import-layers/yocto-poky/meta/recipes-devtools/devel-config/nfs-export-root/exports b/import-layers/yocto-poky/meta/recipes-devtools/devel-config/nfs-export-root/exports
new file mode 100644
index 000000000..1353c5ad8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/devel-config/nfs-export-root/exports
@@ -0,0 +1 @@
+/ *(rw,no_root_squash,async,no_subtree_check)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/diffstat/diffstat/run-ptest b/import-layers/yocto-poky/meta/recipes-devtools/diffstat/diffstat/run-ptest
new file mode 100644
index 000000000..a936b3d3f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/diffstat/diffstat_1.61.bb b/import-layers/yocto-poky/meta/recipes-devtools/diffstat/diffstat_1.61.bb
new file mode 100644
index 000000000..0ec41c3ab
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/diffstat/diffstat_1.61.bb
@@ -0,0 +1,32 @@
+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 = "ftp://invisible-island.net/diffstat/diffstat-${PV}.tgz \
+ file://run-ptest \
+"
+
+SRC_URI[md5sum] = "c048a32d55d8bd6724f382baf41f325f"
+SRC_URI[sha256sum] = "25359e0c27183f997b36c9202583b5dc2df390c20e22a92606af4bf7856a55ee"
+
+S = "${WORKDIR}/diffstat-${PV}"
+
+inherit autotools gettext ptest
+
+LDFLAGS += "${TOOLCHAIN_OPTIONS}"
+
+do_configure () {
+ if [ ! -e ${S}/acinclude.m4 ]; then
+ mv ${S}/aclocal.m4 ${S}/acinclude.m4
+ fi
+ autotools_do_configure
+}
+
+do_install_ptest() {
+ cp -r ${S}/testing ${D}${PTEST_PATH}
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/distcc/distcc_3.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/distcc/distcc_3.1.bb
new file mode 100644
index 000000000..f8879c87c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/distcc/distcc_3.1.bb
@@ -0,0 +1,74 @@
+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"
+
+GTKCONFIG = "gtk"
+GTKCONFIG_libc-uclibc = ""
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '${GTKCONFIG}', '', d)} 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/distcc/distcc.git \
+ file://separatebuilddir.patch \
+ file://0001-zeroconf-Include-fcntl.h.patch \
+ file://default \
+ file://distccmon-gnome.desktop \
+ file://distcc \
+ file://distcc.service"
+SRCREV = "9a172d3d20042754a30c0cd9a5d63fd1a8120c31"
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig update-rc.d useradd systemd
+
+EXTRA_OECONF += "--disable-Werror PYTHON=/dev/null"
+
+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_append() {
+ 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"
+
+pkg_postrm_${PN} () {
+ deluser distcc || true
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/distcc/files/0001-zeroconf-Include-fcntl.h.patch b/import-layers/yocto-poky/meta/recipes-devtools/distcc/files/0001-zeroconf-Include-fcntl.h.patch
new file mode 100644
index 000000000..b17ec9c95
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/distcc/files/default b/import-layers/yocto-poky/meta/recipes-devtools/distcc/files/default
new file mode 100644
index 000000000..63c4159b9
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/distcc/files/distcc b/import-layers/yocto-poky/meta/recipes-devtools/distcc/files/distcc
new file mode 100755
index 000000000..e36f0fa69
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/distcc/files/distcc.service b/import-layers/yocto-poky/meta/recipes-devtools/distcc/files/distcc.service
new file mode 100644
index 000000000..0253ddf52
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/distcc/files/distccmon-gnome.desktop b/import-layers/yocto-poky/meta/recipes-devtools/distcc/files/distccmon-gnome.desktop
new file mode 100644
index 000000000..7b5d85ce4
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/distcc/files/separatebuilddir.patch b/import-layers/yocto-poky/meta/recipes-devtools/distcc/files/separatebuilddir.patch
new file mode 100644
index 000000000..b9e3e42dd
--- /dev/null
+++ b/import-layers/yocto-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: distcc-3.1/Makefile.in
+===================================================================
+--- distcc-3.1.orig/Makefile.in 2008-12-02 21:50:31.000000000 +0000
++++ distcc-3.1/Makefile.in 2013-03-08 10:49:24.224400937 +0000
+@@ -1088,7 +1088,7 @@
+ 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/import-layers/yocto-poky/meta/recipes-devtools/dmidecode/dmidecode_3.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/dmidecode/dmidecode_3.0.bb
new file mode 100644
index 000000000..109a9d2ee
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dmidecode/dmidecode_3.0.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] = "281ee572d45c78eca73a14834c495ffd"
+SRC_URI[sha256sum] = "7ec35bb193729c1d593a1460b59d82d24b89102ab23fd0416e6cf4325d077e45"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/docbook-dsssl-stylesheets/docbook-dsssl-stylesheets-native_1.79.bb b/import-layers/yocto-poky/meta/recipes-devtools/docbook-dsssl-stylesheets/docbook-dsssl-stylesheets-native_1.79.bb
new file mode 100644
index 000000000..b7791f360
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/docbook-dsssl-stylesheets/docbook-dsssl-stylesheets-native_1.79.bb
@@ -0,0 +1,71 @@
+SUMMARY = "DSSSL stylesheets used to transform SGML and XML DocBook files"
+HOMEPAGE = "http://docbook.sourceforge.net"
+# Simple persmissive
+LICENSE = "DSSSL"
+LIC_FILES_CHKSUM = "file://README;beginline=41;endline=74;md5=875385159b2ee76ecf56136ae7f542d6"
+
+DEPENDS = "sgml-common-native"
+
+PR = "r4"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/docbook/docbook-dsssl-${PV}.tar.bz2"
+
+SRC_URI[md5sum] = "bc192d23266b9a664ca0aba4a7794c7c"
+SRC_URI[sha256sum] = "2f329e120bee9ef42fbdd74ddd60e05e49786c5a7953a0ff4c680ae6bdf0e2bc"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/docbook/files/docbook-dsssl/"
+UPSTREAM_CHECK_REGEX = "/docbook-dsssl/(?P<pver>(\d+[\.\-_]*)+)/"
+
+S = "${WORKDIR}/docbook-dsssl-${PV}"
+
+inherit native
+
+SSTATEPOSTINSTFUNCS += "docbook_dsssl_stylesheets_sstate_postinst"
+SYSROOT_PREPROCESS_FUNCS += "docbook_dsssl_sysroot_preprocess"
+CLEANFUNCS += "docbook_dsssl_stylesheets_sstate_clean"
+
+
+do_install () {
+ # Refer to http://www.linuxfromscratch.org/blfs/view/stable/pst/docbook-dsssl.html
+ # for details.
+ install -d ${D}${bindir}
+ install -m 0755 bin/collateindex.pl ${D}${bindir}
+
+ install -d ${D}${datadir}/sgml/docbook/dsssl-stylesheets-${PV}
+ install -m 0644 catalog ${D}${datadir}/sgml/docbook/dsssl-stylesheets-${PV}
+ cp -v -R * ${D}${datadir}/sgml/docbook/dsssl-stylesheets-${PV}
+
+ install -d ${D}${sysconfdir}/sgml
+ echo "CATALOG ${datadir}/sgml/docbook/dsssl-stylesheets-${PV}/catalog" > \
+ ${D}${sysconfdir}/sgml/dsssl-docbook-stylesheets.cat
+ echo "CATALOG ${datadir}/sgml/docbook/dsssl-stylesheets-${PV}/common/catalog" >> \
+ ${D}${sysconfdir}/sgml/dsssl-docbook-stylesheets.cat
+}
+
+docbook_dsssl_stylesheets_sstate_postinst () {
+ if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
+ then
+ # Ensure that the catalog file sgml-docbook.cat is properly
+ # updated when the package is installed from sstate cache.
+ ${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-docbook-dsssl \
+ --add ${sysconfdir}/sgml/sgml-docbook.bak \
+ ${sysconfdir}/sgml/dsssl-docbook-stylesheets.cat
+ ${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-docbook-dsssl \
+ --add ${sysconfdir}/sgml/sgml-docbook.cat \
+ ${sysconfdir}/sgml/dsssl-docbook-stylesheets.cat
+ fi
+}
+
+docbook_dsssl_sysroot_preprocess () {
+ install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
+ install -m 755 ${STAGING_BINDIR_NATIVE}/install-catalog ${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-docbook-dsssl
+}
+
+docbook_dsssl_stylesheets_sstate_clean () {
+ # Ensure that the catalog file sgml-docbook.cat is properly
+ # updated when the package is removed from sstate cache.
+ files="${sysconfdir}/sgml/sgml-docbook.bak ${sysconfdir}/sgml/sgml-docbook.cat"
+ for f in $files; do
+ [ ! -f $f ] || sed -i '/\/sgml\/dsssl-docbook-stylesheets.cat/d' $f
+ done
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-3.1-native_3.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-3.1-native_3.1.bb
new file mode 100644
index 000000000..a3ee5d83a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-3.1-native_3.1.bb
@@ -0,0 +1,26 @@
+require docbook-sgml-dtd-native.inc
+
+LICENSE = "OASIS"
+LIC_FILES_CHKSUM = "file://LICENSE-OASIS;md5=c608985dd5f7f215e669e7639a0b1d2e"
+
+DTD_VERSION = "3.1"
+
+PR = "${INC_PR}.0"
+
+# 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://www.docbook.org/sgml/3.1/docbk31.zip \
+ file://LICENSE-OASIS"
+
+SRC_URI[md5sum] = "432749c0c806dbae81c8bcb70da3b5d3"
+SRC_URI[sha256sum] = "20261d2771b9a052abfa3d8fab1aa62be05791a010281c566f9073bf0e644538"
+
+UPSTREAM_CHECK_URI = "http://www.docbook.org/sgml/"
+UPSTREAM_CHECK_REGEX = "(?P<pver>3\..+)/"
+
+do_compile() {
+ # Refer to http://www.linuxfromscratch.org/blfs/view/stable/pst/sgml-dtd-3.html
+ # for details.
+ sed -i -e '/ISO 8879/d' -e 's|DTDDECL "-//OASIS//DTD DocBook V3.1//EN"|SGMLDECL|g' docbook.cat
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-4.1-native_4.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-4.1-native_4.1.bb
new file mode 100644
index 000000000..be5968077
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-4.1-native_4.1.bb
@@ -0,0 +1,26 @@
+require docbook-sgml-dtd-native.inc
+
+LICENSE = "OASIS"
+LIC_FILES_CHKSUM = "file://LICENSE-OASIS;md5=c608985dd5f7f215e669e7639a0b1d2e"
+
+DTD_VERSION = "4.1"
+
+PR = "${INC_PR}.0"
+
+# 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://docbook.org/sgml/4.1/docbk41.zip \
+ file://LICENSE-OASIS"
+
+SRC_URI[md5sum] = "489f6ff2a2173eb1e14216c10533ede2"
+SRC_URI[sha256sum] = "deaafcf0a3677692e7ad4412c0e41c1db3e9da6cdcdb3dd32b2cc1f9c97d6311"
+
+UPSTREAM_CHECK_URI = "http://www.docbook.org/sgml/"
+UPSTREAM_CHECK_REGEX = "(?P<pver>4\.1(\.\d+)*)/"
+
+do_compile() {
+ # Refer to http://www.linuxfromscratch.org/blfs/view/stable/pst/sgml-dtd.html
+ # for details.
+ sed -i -e '/ISO 8879/d' -e '/gml/d' docbook.cat
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-4.5-native.bb b/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-4.5-native.bb
new file mode 100644
index 000000000..ae723c74f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-4.5-native.bb
@@ -0,0 +1,18 @@
+require docbook-sgml-dtd-native.inc
+
+LICENSE = "OASIS"
+LIC_FILES_CHKSUM = "file://LICENSE-OASIS;md5=c608985dd5f7f215e669e7639a0b1d2e"
+
+DTD_VERSION = "4.5"
+
+PR = "${INC_PR}.0"
+PV = "4.5"
+
+SRC_URI[md5sum] = "07c581f4bbcba6d3aac85360a19f95f7"
+SRC_URI[sha256sum] = "8043e514e80c6c19cb146b5d37937d1305bf3abf9b0097c36df7f70f611cdf43"
+
+do_compile() {
+ # Refer to http://www.linuxfromscratch.org/blfs/view/stable/pst/sgml-dtd.html
+ # for details.
+ sed -i -e '/ISO 8879/d' -e'/gml/d' docbook.cat
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-native.inc b/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-native.inc
new file mode 100644
index 000000000..af5098796
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-native.inc
@@ -0,0 +1,70 @@
+# The DTDs of the various versions have to be installed in parallel and
+# should not replace each other. The installation step is common for
+# all versions and just differs in ${DTD_VERSION} which is set in each
+# version recipe.
+#
+# The DTDs do have some quirks (see LFS documentation).
+SUMMARY = "Document type definitions for verification of SGML data files"
+DESCRIPTION = "Document type definitions for verification of SGML data \
+files against the DocBook rule set"
+HOMEPAGE = "http://www.docbook.org/sgml/"
+
+DEPENDS = "sgml-common-native"
+
+# 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://www.docbook.org/sgml/${DTD_VERSION}/docbook-${DTD_VERSION}.zip \
+ file://LICENSE-OASIS"
+
+# The .zip file extracts to the current dir
+S = "${WORKDIR}"
+
+INC_PR = "r3"
+
+SSTATEPOSTINSTFUNCS += "docbook_sgml_dtd_sstate_postinst"
+SYSROOT_PREPROCESS_FUNCS += "docbook_sgml_dtd_sysroot_preprocess"
+
+inherit native
+
+do_install () {
+ # Refer to http://www.linuxfromscratch.org/blfs/view/stable/pst/sgml-dtd.html
+ # for details.
+ install -d -m 755 ${D}${datadir}/sgml/docbook/sgml-dtd-${DTD_VERSION}
+ install docbook.cat ${D}${datadir}/sgml/docbook/sgml-dtd-${DTD_VERSION}/catalog
+ cp -PpRr *.dtd *.mod *.dcl ${D}${datadir}/sgml/docbook/sgml-dtd-${DTD_VERSION}
+
+ install -d ${D}${sysconfdir}/sgml
+ echo "CATALOG ${datadir}/sgml/docbook/sgml-dtd-${DTD_VERSION}/catalog" > \
+ ${D}${sysconfdir}/sgml/sgml-docbook-dtd-${DTD_VERSION}.cat
+}
+
+docbook_sgml_dtd_sstate_postinst () {
+ if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
+ then
+ # Ensure that the catalog file sgml-docbook.cat is properly
+ # updated when the package is installed from sstate cache.
+ ${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-docbook-sgml-dtd-${DTD_VERSION} \
+ --add ${sysconfdir}/sgml/sgml-docbook.bak \
+ ${sysconfdir}/sgml/sgml-docbook-dtd-${DTD_VERSION}.cat
+ ${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-docbook-sgml-dtd-${DTD_VERSION} \
+ --add ${sysconfdir}/sgml/sgml-docbook.cat \
+ ${sysconfdir}/sgml/sgml-docbook-dtd-${DTD_VERSION}.cat
+ fi
+}
+
+docbook_sgml_dtd_sysroot_preprocess () {
+ install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
+ install -m 755 ${STAGING_BINDIR_NATIVE}/install-catalog ${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-docbook-sgml-dtd-${DTD_VERSION}
+}
+
+CLEANFUNCS += "docbook_sgml_dtd_sstate_clean"
+
+docbook_sgml_dtd_sstate_clean () {
+ # Ensure that the catalog file sgml-docbook.cat is properly
+ # updated when the package is removed from sstate cache.
+ files="${sysconfdir}/sgml/sgml-docbook.bak ${sysconfdir}/sgml/sgml-docbook.cat"
+ for f in $files; do
+ [ ! -f $f ] || sed -i '/\/sgml\/sgml-docbook-dtd-${DTD_VERSION}.cat/d' $f
+ done
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/files/LICENSE-OASIS b/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/files/LICENSE-OASIS
new file mode 100644
index 000000000..6da7f5b8c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/files/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/import-layers/yocto-poky/meta/recipes-devtools/docbook-utils/docbook-utils-0.6.14/re.patch b/import-layers/yocto-poky/meta/recipes-devtools/docbook-utils/docbook-utils-0.6.14/re.patch
new file mode 100644
index 000000000..db079d68f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/docbook-utils/docbook-utils-0.6.14/re.patch
@@ -0,0 +1,29 @@
+Upstream-Status: Pending
+
+Fix runtime error occurred e.g. with docbook-to-man calls:
+
+ grep: character class syntax is [[:space:]], not [:space:]
+ grep: character class syntax is [[:space:]], not [:space:]
+ jw: There is no frontend called "/docbook/utils-0.6.14/frontends/docbook".
+
+See also:
+
+ <https://qa.mandriva.com/show_bug.cgi?id=61127>
+
+Signed-off-by: Steffen Sledz <sledz@dresearch-fe.de>
+
+diff -Nurd docbook-utils-0.6.14-orig/bin/jw.in docbook-utils-0.6.14/bin/jw.in
+--- docbook-utils-0.6.14-orig/bin/jw.in 2012-03-29 07:50:00.789564826 +0200
++++ docbook-utils-0.6.14/bin/jw.in 2012-03-29 07:52:10.371302967 +0200
+@@ -80,9 +80,9 @@
+ SGML_CATALOGS_DIR="/etc/sgml"
+ if [ -f "$SGML_CONF" ]
+ then
+- RE='^[:space:]*SGML_BASE_DIR[:space:]*=[:space:]*'
++ RE='^[[:space:]]*SGML_BASE_DIR[[:space:]]*=[[:space:]]*'
+ SGML_BASE_DIR=`grep $RE $SGML_CONF | sed "s/$RE//"`
+- RE='^[:space:]*SGML_CATALOGS_DIR[:space:]*=[:space:]*'
++ RE='^[[:space:]]*SGML_CATALOGS_DIR[[:space:]]*=[[:space:]]*'
+ SGML_CATALOGS_DIR=`grep $RE $SGML_CONF | sed "s/$RE//"`
+ fi
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/docbook-utils/docbook-utils-native_0.6.14.bb b/import-layers/yocto-poky/meta/recipes-devtools/docbook-utils/docbook-utils-native_0.6.14.bb
new file mode 100644
index 000000000..c3a5f3b42
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/docbook-utils/docbook-utils-native_0.6.14.bb
@@ -0,0 +1,63 @@
+SUMMARY = "Utilities for formatting and manipulating DocBook documents"
+DESCRIPTION = "A collection of all the free software tools you need to \
+work on and format DocBook documents."
+HOMEPAGE = "http://sources.redhat.com/docbook-tools/"
+SECTION = "console/utils"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+DEPENDS = "openjade-native sgmlspl-native docbook-dsssl-stylesheets-native docbook-sgml-dtd-3.1-native"
+
+PR = "r3"
+
+SRC_URI = "\
+ ftp://sources.redhat.com/pub/docbook-tools/new-trials/SOURCES/docbook-utils-${PV}.tar.gz \
+ file://re.patch \
+"
+
+SRC_URI[md5sum] = "6b41b18c365c01f225bc417cf632d81c"
+SRC_URI[sha256sum] = "48faab8ee8a7605c9342fb7b906e0815e3cee84a489182af38e8f7c0df2e92e9"
+
+inherit autotools native
+
+do_configure_prepend() {
+ # Fix hard-coded references to /etc/sgml
+ if [ ! -e ${S}/.sed_done ]; then
+ sed -i -e "s|/etc/sgml|${sysconfdir}/sgml|g" ${S}/bin/jw.in
+ sed -i -e "s|/etc/sgml|${sysconfdir}/sgml|g" ${S}/doc/man/Makefile.am
+ sed -i -e "s|/etc/sgml|${sysconfdir}/sgml|g" ${S}/doc/HTML/Makefile.am
+
+ # Point jw to the native sysroot catalog
+ sed -i -e 's|^SGML_EXTRA_CATALOGS=""|SGML_EXTRA_CATALOGS=":${sysconfdir}/sgml/catalog"|g' ${S}/bin/jw.in
+ touch ${S}/.sed_done
+ fi
+}
+do_unpack[cleandirs] += "${S}"
+
+do_install() {
+ install -d ${D}${bindir}
+ # Install the binaries and a bunch of other commonly used names for them.
+ for doctype in html ps dvi man pdf rtf tex texi txt
+ do
+ install -m 0755 ${S}/bin/docbook2$doctype ${D}${bindir}/
+ ln -sf docbook2x-$doctype ${D}${bindir}/db2$doctype
+ ln -sf docbook2$doctype ${D}${bindir}/db2$doctype
+ ln -sf docbook2$doctype ${D}${bindir}/docbook-to-$doctype
+ done
+
+ install -m 0755 ${B}/bin/jw ${D}${bindir}/
+ for i in backends/dvi backends/html \
+ backends/pdf backends/ps backends/rtf backends/tex \
+ backends/txt \
+ helpers/docbook2man-spec.pl helpers/docbook2texi-spec.pl \
+ docbook-utils.dsl
+ do
+ install -d ${D}${datadir}/sgml/docbook/utils-${PV}/`dirname $i`
+ install ${S}/$i ${D}${datadir}/sgml/docbook/utils-${PV}/$i
+ done
+ for i in backends/man backends/texi frontends/docbook
+ do
+ install -d ${D}${datadir}/sgml/docbook/utils-${PV}/`dirname $i`
+ install ${B}/$i ${D}${datadir}/sgml/docbook/utils-${PV}/$i
+ done
+
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/LICENSE-OASIS b/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/LICENSE-OASIS
new file mode 100644
index 000000000..6da7f5b8c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/docbook-xml-update-catalog.xml.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/docbook-xml.xml b/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/docbook-xml.xml
new file mode 100644
index 000000000..b71f559ef
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4_4.5.bb b/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4_4.5.bb
new file mode 100644
index 000000000..de1bc3970
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4_4.5.bb
@@ -0,0 +1,64 @@
+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 = "${DEBIAN_MIRROR}/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"
+
+S="${WORKDIR}/docbook-xml-4.5.c31424"
+
+inherit allarch
+BBCLASSEXTEND = "native"
+
+SSTATEPOSTINSTFUNCS_append_class-native = " docbook_xml_dtd_sstate_postinst"
+SYSROOT_PREPROCESS_FUNCS_append_class-native = " docbook_xml_dtd_sysroot_preprocess"
+
+do_configre (){
+ :
+}
+
+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
+}
+
+docbook_xml_dtd_sstate_postinst () {
+ if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
+ then
+ # 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" ${SYSROOT_DESTDIR}${sysconfdir}/xml/docbook-xml.xml
+ fi
+}
+
+docbook_xml_dtd_sysroot_preprocess () {
+ # Update the hardcode dir in docbook-xml.xml
+ sed -i -e "s|file:///usr/share/xml|file://${datadir}/xml|g" ${SYSROOT_DESTDIR}${sysconfdir}/xml/docbook-xml.xml
+}
+
+FILES_${PN} = "${datadir}/* ${sysconfdir}/xml/docbook-xml.xml"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets/docbook-xsl-stylesheets-no-bashism-in-docbook-xsl-up.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets/docbook-xsl.xml b/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets/docbook-xsl.xml
new file mode 100644
index 000000000..a1a576a2e
--- /dev/null
+++ b/import-layers/yocto-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-1.78.1/catalog.xml"/>
+<delegateSystem systemIdStartString="http://docbook.sourceforge.net/release/xsl/" catalog="file:///usr/share/xml/docbook/xsl-stylesheets-1.78.1/catalog.xml"/>
+</catalog>
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets_1.78.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets_1.78.1.bb
new file mode 100644
index 000000000..52de3ab04
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets_1.78.1.bb
@@ -0,0 +1,74 @@
+SUMMARY = "XSL stylesheets for processing DocBook XML to various output formats"
+HOMEPAGE = "http://docbook.sourceforge.net"
+LICENSE = "XSL"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a6eeeed43d498c22a835382533356462"
+
+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] = "6dd0f89131cc35bf4f2ed105a1c17771"
+SRC_URI[sha256sum] = "c98f7296ab5c8ccd2e0bc07634976a37f50847df2d8a59bdb1e157664700b467"
+
+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"
+
+SSTATEPOSTINSTFUNCS_append_class-native = " docbook_xsl_stylesheets_sstate_postinst"
+SYSROOT_PREPROCESS_FUNCS_append_class-native = " docbook_xsl_stylesheets_sysroot_preprocess"
+
+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 common eclipse epub extensions fo highlighting html \
+ htmlhelp images javahelp lib manpages params profiling \
+ roundtrip slides template tests tools webhelp website \
+ xhtml xhtml-1_1 catalog.xml \
+ ${D}${datadir}/xml/docbook/xsl-stylesheets-1.78.1
+
+ ln -s VERSION ${D}/${datadir}/xml/docbook/xsl-stylesheets-1.78.1/VERSION.xsl
+
+ install -v -m644 -D README \
+ ${D}${datadir}/doc/docbook-xsl-1.78.1/README.txt
+ install -v -m644 RELEASE-NOTES* NEWS* \
+ ${D}${datadir}/doc/docbook-xsl-1.78.1
+
+ install -d ${D}${sysconfdir}/xml/
+ install -m 755 ${WORKDIR}/docbook-xsl.xml ${D}${sysconfdir}/xml/docbook-xsl.xml
+
+}
+
+docbook_xsl_stylesheets_sstate_postinst () {
+ if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
+ then
+ # 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" ${SYSROOT_DESTDIR}${sysconfdir}/xml/docbook-xsl.xml
+ fi
+}
+
+docbook_xsl_stylesheets_sysroot_preprocess () {
+ # Update the hardcode dir in docbook-xml.xml
+ sed -i -e "s|file:///usr/share/xml|file://${datadir}/xml|g" ${SYSROOT_DESTDIR}${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/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/0001-Include-fcntl.h-for-getting-loff_t-definition.patch b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/0001-Include-fcntl.h-for-getting-loff_t-definition.patch
new file mode 100644
index 000000000..06f5b7a96
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/0001-Include-fcntl.h-for-getting-loff_t-definition.patch
@@ -0,0 +1,41 @@
+From b7c42c6a9829bea911b22201edd7df2a9bec1a14 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:52:34 -0700
+Subject: [PATCH] Include fcntl.h for getting loff_t definition
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ dosfsck/dosfsck.h | 2 ++
+ dosfsck/lfn.c | 1 +
+ 2 files changed, 3 insertions(+)
+
+diff --git a/dosfsck/dosfsck.h b/dosfsck/dosfsck.h
+index d9314b1..2076d5f 100644
+--- a/dosfsck/dosfsck.h
++++ b/dosfsck/dosfsck.h
+@@ -50,6 +50,8 @@
+ #define CT_LE_L(v) (v)
+ #endif /* __BIG_ENDIAN */
+
++#include <fcntl.h>
++
+ #define VFAT_LN_ATTR (ATTR_RO | ATTR_HIDDEN | ATTR_SYS | ATTR_VOLUME)
+
+ /* ++roman: Use own definition of boot sector structure -- the kernel headers'
+diff --git a/dosfsck/lfn.c b/dosfsck/lfn.c
+index 9b2cfc3..bb04fda 100644
+--- a/dosfsck/lfn.c
++++ b/dosfsck/lfn.c
+@@ -7,6 +7,7 @@
+ #include <string.h>
+ #include <limits.h>
+ #include <time.h>
++#include <fcntl.h>
+
+ #include "common.h"
+ #include "io.h"
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/0001-mkfs.fat-fix-incorrect-int-type.patch b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/0001-mkfs.fat-fix-incorrect-int-type.patch
new file mode 100644
index 000000000..3497ca540
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/0001-mkfs.fat-fix-incorrect-int-type.patch
@@ -0,0 +1,46 @@
+From 3b95786af13e28157d889bd90a384ee255f2d91d Mon Sep 17 00:00:00 2001
+From: "Yann E. MORIN" <yann.morin.1998@free.fr>
+Date: Sun, 16 Aug 2015 15:55:43 +0200
+Subject: [PATCH] mkfs.fat: fix incorrect int type
+
+u_int32_t is not a stanard type, while uint32_t is. This fixes builds
+with the musl C library, which only defines so-called "clean" headers;
+build failures are like (back-quotes and elision manually added for
+readability):
+
+ http://autobuild.buildroot.org/results/a09/a0923d7f6d4dbae02eba4c5024bbdae3a52aa85a/build-end.log
+
+ /home/peko/autobuild/instance-1/output/host/usr/bin/x86_64-linux-gcc -D_LARGEFILE_SOURCE \
+ -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -D_GNU_SOURCE -D_LARGEFILE_SOURCE \
+ -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -c -o mkfs.fat.o src/mkfs.fat.c
+ src/mkfs.fat.c: In function 'main':
+ src/mkfs.fat.c:1415:18: error: 'u_int32_t' undeclared (first use in this function)
+ volume_id = (u_int32_t) ((create_timeval.tv_sec << 20) | create_timeval.tv_usec); [...]
+ ^
+ src/mkfs.fat.c:1415:18: note: each undeclared identifier is reported only once for each
+ function it appears in
+
+Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
+Signed-off-by: Andreas Bombe <aeb@debian.org>
+---
+Upstream-Status: Backport
+
+ src/mkfs.fat.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/mkfs.fat.c b/src/mkfs.fat.c
+index b38d116..dddbe24 100644
+--- a/src/mkfs.fat.c
++++ b/src/mkfs.fat.c
+@@ -1412,7 +1412,7 @@ int main(int argc, char **argv)
+
+ gettimeofday(&create_timeval, NULL);
+ create_time = create_timeval.tv_sec;
+- volume_id = (u_int32_t) ((create_timeval.tv_sec << 20) | create_timeval.tv_usec); /* Default volume ID = creation time, fudged for more uniqueness */
++ volume_id = (uint32_t) ((create_timeval.tv_sec << 20) | create_timeval.tv_usec); /* Default volume ID = creation time, fudged for more uniqueness */
+ check_atari();
+
+ printf("mkfs.fat " VERSION " (" VERSION_DATE ")\n");
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/alignment_hack.patch b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/alignment_hack.patch
new file mode 100644
index 000000000..b46b2db0a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/alignment_hack.patch
@@ -0,0 +1,38 @@
+The problem is that unsigned char[2] is
+guranteed to be 8Bit aligned on arm
+but unsigned short is/needs to be 16bit aligned
+the union { unsigned short; unsigned char[2] } trick
+didn't work so no we use the alpha hack.
+
+memcpy into an 16bit aligned
+
+ -zecke
+
+Upstream-Status: Inappropriate [licensing]
+We're tracking an old release of dosfstools due to licensing issues.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- dosfstools/dosfsck/boot.c.orig 2003-05-15 19:32:23.000000000 +0200
++++ dosfstools/dosfsck/boot.c 2003-06-13 17:44:25.000000000 +0200
+@@ -36,17 +36,15 @@
+ { 0xff, "5.25\" 320k floppy 2s/40tr/8sec" },
+ };
+
+-#if defined __alpha || defined __ia64__ || defined __s390x__ || defined __x86_64__ || defined __ppc64__
++
+ /* Unaligned fields must first be copied byte-wise */
+ #define GET_UNALIGNED_W(f) \
+ ({ \
+ unsigned short __v; \
+ memcpy( &__v, &f, sizeof(__v) ); \
+- CF_LE_W( *(unsigned short *)&f ); \
++ CF_LE_W( *(unsigned short *)&__v ); \
+ })
+-#else
+-#define GET_UNALIGNED_W(f) CF_LE_W( *(unsigned short *)&f )
+-#endif
++
+
+
+ static char *get_media_descr( unsigned char media )
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/dosfstools-msdos_fs-types.patch b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/dosfstools-msdos_fs-types.patch
new file mode 100644
index 000000000..35abd1a2b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/dosfstools-msdos_fs-types.patch
@@ -0,0 +1,37 @@
+Ensure the __s8 type is properly defined.
+
+Upstream-Status: Inappropriate [licensing]
+We're tracking an old release of dosfstools due to licensing issues.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- dosfstools-2.10/dosfsck/dosfsck.h.org 2006-02-21 08:36:14.000000000 -0700
++++ dosfstools-2.10/dosfsck/dosfsck.h 2006-02-21 08:40:12.000000000 -0700
+@@ -22,6 +22,14 @@
+ #undef __KERNEL__
+ #endif
+
++#ifndef __s8
++#include <asm/types.h>
++#endif
++
++#ifndef __ASM_STUB_BYTEORDER_H__
++#include <asm/byteorder.h>
++#endif
++
+ #include <linux/msdos_fs.h>
+
+ /* 2.1 kernels use le16_to_cpu() type functions for CF_LE_W & Co., but don't
+--- dosfstools-2.10/dosfsck/file.c.org 2006-02-21 08:37:36.000000000 -0700
++++ dosfstools-2.10/dosfsck/file.c 2006-02-21 08:37:47.000000000 -0700
+@@ -23,6 +23,10 @@
+ #undef __KERNEL__
+ #endif
+
++#ifndef __s8
++#include <asm/types.h>
++#endif
++
+ #include <linux/msdos_fs.h>
+
+ #include "common.h"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/fix_populated_dosfs_creation.patch b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/fix_populated_dosfs_creation.patch
new file mode 100644
index 000000000..9d7f7321a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/fix_populated_dosfs_creation.patch
@@ -0,0 +1,489 @@
+Upstream-Status: Inappropriate
+
+This patch fixes populated dosfs image creation with directory
+structures. Earlier it was causing segfault; and only image
+population with no subdirectories was working.
+
+Issues fixed:
+1. (dir->count == dir->entries) check was only needed for root
+ directory entries. And this check is wrong for non-root
+ directories.
+2. For each dir entry 2 dir->table entries were needed, one for
+ the file/dir and 2nd for long file name support. Earlier long
+ name support was added for filenames but the 2nd entry
+ allocation, initialization & counting was missed.
+3. The memory clearing was missed at the code path after dir->table
+ memroy allocation.
+4. Add entries for . & .. directories in all non-root directories.
+5. The . directory points to the correct entry in fat now.
+6. All directoriy entries' size was not zero as required for dosfsck,
+ Now all directory entries' size is zero.
+
+Enhancements:
+1. Added support for long names for directory names. This is same
+ as the existing long name support for filenames.
+2. Added error messages for previously silent memory allocation and
+ other errors.
+3. -d options does not work correctly with fat32, so now throwing
+ an error for that.
+4. Use predefined structures from kernel's msdos_fs.h file, rather
+ than defining again here. And accordingly change the names & use
+ of structure variables.
+
+Outstanding Issues:
+1. The .. directory entry do not point to the parent of current
+ directory. This issue can be fixed by running dosfsck -a after
+ image creation.
+2. For files the filesize is correct, but the clusters size is more
+ than it needs to be, this also can be fixed by running dosfsck -a
+ after image creation.
+
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+2011/12/13
+
+
+Index: dosfstools-2.11/mkdosfs/mkdosfs.c
+===================================================================
+--- dosfstools-2.11.orig/mkdosfs/mkdosfs.c
++++ dosfstools-2.11/mkdosfs/mkdosfs.c
+@@ -21,7 +21,17 @@
+ June 2004 - Jordan Crouse (info.linux@amd.com)
+ Added -d <directory> support to populate the image
+ Copyright (C) 2004, Advanced Micro Devices, All Rights Reserved
+-
++
++ 2011-12-13: Nitin A Kamble <nitin.a.kamble@intel.com>
++ Enhanced the -d <directory> support for population of image while
++ creation. Earlier subdirectores support was broken, only files in
++ the rootdir were supported. Now directory hirarchy is supported.
++ Also added long filename support to directory names.
++ The -d <directory> option (image population while creation)
++ is broken with fat32.
++ Copyright (C) 2011, Intel Corporation, All Rights Reserved
++
++
+ Fixes/additions May 1998 by Roman Hodek
+ <Roman.Hodek@informatik.uni-erlangen.de>:
+ - Atari format support
+@@ -86,23 +96,23 @@
+ # undef __KERNEL__
+ #endif
+
+-#if __BYTE_ORDER == __BIG_ENDIAN
+-
++#ifndef __ASM_STUB_BYTEORDER_H__
+ #include <asm/byteorder.h>
+-#ifdef __le16_to_cpu
+-/* ++roman: 2.1 kernel headers define these function, they're probably more
+- * efficient then coding the swaps machine-independently. */
+-#define CF_LE_W __le16_to_cpu
+-#define CF_LE_L __le32_to_cpu
+-#define CT_LE_W __cpu_to_le16
+-#define CT_LE_L __cpu_to_le32
+-#else
+-#define CF_LE_W(v) ((((v) & 0xff) << 8) | (((v) >> 8) & 0xff))
+-#define CF_LE_L(v) (((unsigned)(v)>>24) | (((unsigned)(v)>>8)&0xff00) | \
+- (((unsigned)(v)<<8)&0xff0000) | ((unsigned)(v)<<24))
++#endif
++
++#include <linux/msdos_fs.h>
++
++#undef CF_LE_W
++#undef CF_LE_L
++#undef CT_LE_W
++#undef CT_LE_L
++
++#if __BYTE_ORDER == __BIG_ENDIAN
++#include <byteswap.h>
++#define CF_LE_W(v) bswap_16(v)
++#define CF_LE_L(v) bswap_32(v)
+ #define CT_LE_W(v) CF_LE_W(v)
+ #define CT_LE_L(v) CF_LE_L(v)
+-#endif /* defined(__le16_to_cpu) */
+
+ #else
+
+@@ -253,33 +263,6 @@ struct fat32_fsinfo {
+ __u32 reserved2[4];
+ };
+
+-/* This stores up to 13 chars of the name */
+-
+-struct msdos_dir_slot {
+- __u8 id; /* sequence number for slot */
+- __u8 name0_4[10]; /* first 5 characters in name */
+- __u8 attr; /* attribute byte */
+- __u8 reserved; /* always 0 */
+- __u8 alias_checksum; /* checksum for 8.3 alias */
+- __u8 name5_10[12]; /* 6 more characters in name */
+- __u16 start; /* starting cluster number, 0 in long slots */
+- __u8 name11_12[4]; /* last 2 characters in name */
+-};
+-
+-struct msdos_dir_entry
+- {
+- char name[8], ext[3]; /* name and extension */
+- __u8 attr; /* attribute bits */
+- __u8 lcase; /* Case for base and extension */
+- __u8 ctime_ms; /* Creation time, milliseconds */
+- __u16 ctime; /* Creation time */
+- __u16 cdate; /* Creation date */
+- __u16 adate; /* Last access date */
+- __u16 starthi; /* high 16 bits of first cl. (FAT32) */
+- __u16 time, date, start; /* time, date and first cluster */
+- __u32 size; /* file size (in bytes) */
+- } __attribute__ ((packed));
+-
+ /* The "boot code" we put into the filesystem... it writes a message and
+ tells the user to try again */
+
+@@ -356,7 +339,6 @@ static struct msdos_dir_entry *root_dir;
+ static int size_root_dir; /* Size of the root directory in bytes */
+ static int sectors_per_cluster = 0; /* Number of sectors per disk cluster */
+ static int root_dir_entries = 0; /* Number of root directory entries */
+-static int root_dir_num_entries = 0;
+ static int last_cluster_written = 0;
+
+ static char *blank_sector; /* Blank sector - all zeros */
+@@ -1315,7 +1297,7 @@ setup_tables (void)
+ de->date = CT_LE_W((unsigned short)(ctime->tm_mday +
+ ((ctime->tm_mon+1) << 5) +
+ ((ctime->tm_year-80) << 9)));
+- de->ctime_ms = 0;
++ de->ctime_cs = 0;
+ de->ctime = de->time;
+ de->cdate = de->date;
+ de->adate = de->date;
+@@ -1451,16 +1433,23 @@ write_tables (void)
+
+ /* Add a file to the specified directory entry, and also write it into the image */
+
+-static void copy_filename(char *filename, char *base, char *ext) {
++static void copy_filename(char *filename, char *dos_name) {
+
+ char *ch = filename;
+ int i, len;
+
+- memset(base, 0x20, 8);
+- memset(ext, 0x20, 3);
++ if (!strcmp(filename, ".")) {
++ strncpy(dos_name, MSDOS_DOT, MSDOS_NAME);
++ return;
++ }
++ if (!strcmp(filename, "..")) {
++ strncpy(dos_name, MSDOS_DOTDOT, MSDOS_NAME);
++ return;
++ }
++ memset(dos_name, 0x20, MSDOS_NAME);
+
+ for(len = 0 ; *ch && *ch != '.'; ch++) {
+- base[len++] = toupper(*ch);
++ dos_name[len++] = toupper(*ch);
+ if (len == 8) break;
+ }
+
+@@ -1468,7 +1457,7 @@ static void copy_filename(char *filename
+ if (*ch) ch++;
+
+ for(len = 0 ; *ch; ch++) {
+- ext[len++] = toupper(*ch);
++ dos_name[8 + len++] = toupper(*ch);
+ if (len == 3) break;
+ }
+ }
+@@ -1551,7 +1540,7 @@ static int add_file(char *filename, stru
+ int start;
+ int usedsec, totalsec;
+
+- char name83[8], ext83[3];
++ char dos_name[MSDOS_NAME+1];
+
+ struct msdos_dir_slot *slot;
+ int i;
+@@ -1562,23 +1551,22 @@ static int add_file(char *filename, stru
+ if (dir->root) {
+ if (dir->count == dir->entries) {
+ printf("Error - too many directory entries\n");
++ return;
+ }
+ }
+ else {
+- if (dir->count == dir->entries) {
+- if (!dir->table)
+- dir->table =
+- (struct msdos_dir_entry *) malloc(sizeof(struct msdos_dir_entry));
+- else {
+- dir->table =
+- (struct msdos_dir_entry *) realloc(dir->table, (dir->entries + 1) *
+- sizeof(struct msdos_dir_entry));
+-
+- memset(&dir->table[dir->entries], 0, sizeof(struct msdos_dir_entry));
+- }
+-
+- dir->entries++;
+- }
++ /* 2 entries, one extra for long filename */
++ if (!dir->table)
++ dir->table =
++ (struct msdos_dir_entry *) malloc(2 * sizeof(struct msdos_dir_entry));
++ else
++ dir->table =
++ (struct msdos_dir_entry *) realloc(dir->table, 2 * (dir->entries + 1) *
++ sizeof(struct msdos_dir_entry));
++ if (!dir->table)
++ printf("Error - realloc failed\n");
++ memset(&dir->table[dir->entries], 0, 2 * sizeof(struct msdos_dir_entry));
++ dir->entries += 2;
+ }
+
+ infile = open(filename, O_RDONLY, 0);
+@@ -1611,13 +1599,13 @@ static int add_file(char *filename, stru
+ return -1;
+ }
+
+- printf("ADD %s\n", filename);
++ printf("ADD FILE %s\n", filename);
+
+ /* Grab the basename of the file */
+ base = basename(filename);
+
+- /* Extract out the 8.3 name */
+- copy_filename(base, name83, ext83);
++ /* convert for dos fat structure */
++ copy_filename(base, dos_name);
+
+ /* Make an extended name slot */
+
+@@ -1629,12 +1617,9 @@ static int add_file(char *filename, stru
+
+ slot->alias_checksum = 0;
+
+- for(i = 0; i < 8; i++)
+- slot->alias_checksum = (((slot->alias_checksum&1)<<7)|((slot->alias_checksum&0xfe)>>1)) + name83[i];
++ for(i = 0; i < MSDOS_NAME; i++)
++ slot->alias_checksum = (((slot->alias_checksum&1)<<7)|((slot->alias_checksum&0xfe)>>1)) + dos_name[i];
+
+- for(i = 0; i < 3; i++)
+- slot->alias_checksum = (((slot->alias_checksum&1)<<7)|((slot->alias_checksum&0xfe)>>1)) + ext83[i];
+-
+ p = base;
+
+ copy_name(slot->name0_4, 10, &p);
+@@ -1645,8 +1630,7 @@ static int add_file(char *filename, stru
+ /* Get the entry from the root filesytem */
+ entry = &dir->table[dir->count++];
+
+- strncpy(entry->name, name83, 8);
+- strncpy(entry->ext, ext83, 3);
++ strncpy(entry->name, dos_name, MSDOS_NAME);
+
+
+ /* If the user has it read only, then add read only to the incoming
+@@ -1665,7 +1649,7 @@ static int add_file(char *filename, stru
+ ((ctime->tm_mon+1) << 5) +
+ ((ctime->tm_year-80) << 9)));
+
+- entry->ctime_ms = 0;
++ entry->ctime_cs = 0;
+ entry->ctime = entry->time;
+ entry->cdate = entry->date;
+ entry->adate = entry->date;
+@@ -1711,6 +1695,7 @@ static int add_file(char *filename, stru
+
+ exit_add:
+ if (infile) close(infile);
++ return 0;
+ }
+
+ /* Add a new directory to the specified directory entry, and in turn populate
+@@ -1727,10 +1712,18 @@ static void add_directory(char *filename
+ struct dirent *dentry = 0;
+ int remain;
+ char *data;
++ char *base;
++ char dos_name[MSDOS_NAME+1];
++ struct msdos_dir_slot *slot;
++ int i;
++ char *p;
+
+ /* If the directory doesn't exist */
+- if (!rddir) return;
+-
++ if (!rddir) {
++ printf("Error - dir does not exist: %s\n", filename);
++ return;
++ }
++
+ if (dir->root) {
+ if (dir->count == dir->entries) {
+ printf("Error - too many directory entries\n");
+@@ -1738,28 +1731,58 @@ static void add_directory(char *filename
+ }
+ }
+ else {
+- if (dir->count == dir->entries) {
+- if (!dir->table)
+- dir->table = (struct msdos_dir_entry *) malloc(sizeof(struct msdos_dir_entry));
+- else {
+- dir->table = (struct msdos_dir_entry *) realloc(dir->table, (dir->entries + 1) *
+- sizeof(struct msdos_dir_entry));
+-
+- /* Zero it out to avoid issues */
+- memset(&dir->table[dir->entries], 0, sizeof(struct msdos_dir_entry));
+- }
+- dir->entries++;
++ /* 2 entries, one extra for long name of the directory */
++ if (!dir->table)
++ dir->table = (struct msdos_dir_entry *) malloc(2 * sizeof(struct msdos_dir_entry));
++ else
++ dir->table = (struct msdos_dir_entry *) realloc(dir->table, 2 * (dir->entries + 1) *
++ sizeof(struct msdos_dir_entry));
++ if (!dir->table) {
++ printf("Error - memory allocation failed\n");
++ goto exit_add_dir;
+ }
++ /* Zero it out to avoid issues */
++ memset(&dir->table[dir->entries], 0, 2 * sizeof(struct msdos_dir_entry));
++ dir->entries += 2;
+ }
+
++ printf("ADD DIR %s\n", filename);
+ /* Now, create a new directory entry for the new directory */
+ newdir = (struct dir_entry *) calloc(1, sizeof(struct dir_entry));
+- if (!newdir) goto exit_add_dir;
++ if (!newdir) {
++ printf("Error - calloc failed\n");
++ goto exit_add_dir;
++ }
++
++ /* Grab the basename of the file */
++ base = basename(filename);
++
++ /* convert for dos structure */
++ copy_filename(base, dos_name);
++
++ /* Make an extended name slot */
++ slot = (struct msdos_dir_slot *) &dir->table[dir->count++];
++ slot->id = 'A';
++ slot->attr = 0x0F;
++ slot->reserved = 0;
++ slot->start = 0;
++
++ slot->alias_checksum = 0;
+
++ for (i = 0; i < MSDOS_NAME; i++)
++ slot->alias_checksum = (((slot->alias_checksum&1)<<7)|((slot->alias_checksum&0xfe)>>1)) + dos_name[i];
++
++ p = base;
++
++ copy_name(slot->name0_4, 10, &p);
++ copy_name(slot->name5_10, 12, &p);
++ copy_name(slot->name11_12, 4, &p);
++
++ /* Get the entry from the root filesytem */
+ entry = &dir->table[dir->count++];
+
+- strncpy(entry->name, basename(filename), sizeof(entry->name));
+-
++ strncpy(entry->name, dos_name, MSDOS_NAME);
++
+ entry->attr = ATTR_DIR;
+ ctime = localtime(&create_time);
+
+@@ -1770,25 +1793,32 @@ static void add_directory(char *filename
+ ((ctime->tm_mon+1) << 5) +
+ ((ctime->tm_year-80) << 9)));
+
+- entry->ctime_ms = 0;
++ entry->ctime_cs = 0;
+ entry->ctime = entry->time;
+ entry->cdate = entry->date;
+ entry->adate = entry->date;
+
+ /* Now, read the directory */
+
+- while((dentry = readdir(rddir))) {
++
++ while((base[0] != '.') && (dentry = readdir(rddir))) {
+ struct stat st;
+ char *buffer;
+-
+- if (!strcmp(dentry->d_name, ".") || !strcmp(dentry->d_name, ".."))
+- continue;
+
+- /* DOS wouldn't like a typical unix . (dot) file, so we skip those too */
+- if (dentry->d_name[0] == '.') continue;
++ if (dentry->d_name[0] == '.') {
++ /* dos also has . & .. directory entries */
++ if (! ((!strcmp(dentry->d_name, ".")) || (!strcmp(dentry->d_name, "..")))) {
++ /* ignore other .* files */
++ printf("Error - File/Dir name is not dos compatible, ignored: %s\n", dentry->d_name);
++ continue;
++ }
++ }
+
+ buffer = malloc(strlen(filename) + strlen(dentry->d_name) + 3);
+- if (!buffer) continue;
++ if (!buffer) {
++ printf("Error - malloc failed\n");
++ goto exit_add_dir;
++ }
+
+ sprintf(buffer, "%s/%s", filename, dentry->d_name);
+ if (!stat(buffer, &st)) {
+@@ -1806,11 +1836,23 @@ static void add_directory(char *filename
+ /* Now that the entire directory has been written, go ahead and write the directory
+ entry as well */
+
++ entry->size = 0; /* a directory has zero size */
++
++ if (base[0] == '.') { /* . & .. point to parent's cluster */
++ goto exit_add_dir;
++ }
++
+ entry->start = CT_LE_W(last_cluster_written);
+ entry->starthi = CT_LE_W((last_cluster_written & 0xFFFF0000) >> 16);
+- entry->size = newdir->count * sizeof(struct msdos_dir_entry);
++
++/* . dir start points to parent */
++ newdir->table[1].start = entry->start;
++/* .. dir points to parent of parent*/
++/* .. dir start is not set yet, would need more changes to the code,
++ * but dosfsck can fix these .. entry start pointers correctly */
++
++ remain = newdir->count * sizeof(struct msdos_dir_entry);
+
+- remain = entry->size;
+ data = (char *) newdir->table;
+
+ while(remain) {
+@@ -1858,6 +1900,7 @@ static void add_root_directory(char *dir
+
+ if (!newdir) {
+ closedir(dir);
++ printf("Error - calloc failed!\n");
+ return;
+ }
+
+@@ -1877,7 +1920,10 @@ static void add_root_directory(char *dir
+ if (entry->d_name[0] == '.') continue;
+
+ buffer = malloc(strlen(dirname) + strlen(entry->d_name) + 3);
+- if (!buffer) continue;
++ if (!buffer) {
++ printf("Error - malloc failed!\n");
++ continue;
++ }
+
+ sprintf(buffer, "%s/%s", dirname, entry->d_name);
+ if (!stat(buffer, &st)) {
+@@ -2245,6 +2291,9 @@ main (int argc, char **argv)
+ if (check && listfile) /* Auto and specified bad block handling are mutually */
+ die ("-c and -l are incompatible"); /* exclusive of each other! */
+
++ if (dirname && (size_fat == 32))
++ die ("-d is incompatible with FAT32");
++
+ if (!create) {
+ check_mount (device_name); /* Is the device already mounted? */
+ dev = open (device_name, O_RDWR); /* Is it a suitable device to build the FS on? */
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/include-linux-types.patch b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/include-linux-types.patch
new file mode 100644
index 000000000..ab5c8cf8c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/include-linux-types.patch
@@ -0,0 +1,22 @@
+mkdsofs is using types of the style __u8, which it gets with some
+versions of libc headers via linux/hdreg.h including asm/types.h.
+Newer version of fedora (at least) have a hdreg.h whichdoes not
+include asm/types.h. To work around this patch mkdosfs.c to explicity
+include linux/types.h which will in turn pull in asm/types.h which
+defines these variables.
+
+Upstream-Status: Inappropriate [licensing]
+We're tracking an old release of dosfstools due to licensing issues.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- dosfstools-2.10/mkdosfs/mkdosfs.c~ 2006-07-12 18:46:21.000000000 +1000
++++ dosfstools-2.10/mkdosfs/mkdosfs.c 2006-07-12 18:46:21.000000000 +1000
+@@ -60,6 +60,7 @@
+ #include "../version.h"
+
+ #include <fcntl.h>
++#include <linux/types.h>
+ #include <linux/hdreg.h>
+ #include <linux/fs.h>
+ #include <linux/fd.h>
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/largefile.patch b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/largefile.patch
new file mode 100644
index 000000000..7f7d8359d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/largefile.patch
@@ -0,0 +1,19 @@
+defer setting largefile flags to build makery
+in a cross build we can not do runtime config tests
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Inappropriate[Cross compile Specific]
+Index: dosfstools-3.0.28/Makefile
+===================================================================
+--- dosfstools-3.0.28.orig/Makefile
++++ dosfstools-3.0.28/Makefile
+@@ -27,8 +27,7 @@ SBINDIR = $(PREFIX)/sbin
+ DOCDIR = $(PREFIX)/share/doc
+ MANDIR = $(PREFIX)/share/man
+
+-#OPTFLAGS = -O2 -fomit-frame-pointer -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+-OPTFLAGS = -O2 -fomit-frame-pointer -D_GNU_SOURCE $(shell getconf LFS_CFLAGS)
++OPTFLAGS = -O2 -fomit-frame-pointer
+ #WARNFLAGS = -Wall -pedantic -std=c99
+ WARNFLAGS = -Wall -Wextra -Wno-sign-compare -Wno-missing-field-initializers -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings
+ DEBUGFLAGS = -g
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-bootcode.patch b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-bootcode.patch
new file mode 100644
index 000000000..ae21bee78
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-bootcode.patch
@@ -0,0 +1,241 @@
+Add option to read in bootcode from a file.
+
+Upstream-Status: Inappropriate [licensing]
+We're tracking an old release of dosfstools due to licensing issues.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+Index: dosfstools-2.11/mkdosfs/ChangeLog
+===================================================================
+--- dosfstools-2.11.orig/mkdosfs/ChangeLog 1997-06-18 10:09:38.000000000 +0000
++++ dosfstools-2.11/mkdosfs/ChangeLog 2011-12-06 12:14:23.634011558 +0000
+@@ -1,3 +1,14 @@
++19th June 2003 Sam Bingner (sam@bingner.com)
++
++ Added option to read in bootcode from a file so that if you have
++ for example Windows 2000 boot code, you can have it write that
++ as the bootcode. This is a dump of the behinning of a partition
++ generally 512 bytes, but can be up to reserved sectors*512 bytes.
++ Also writes 0x80 as the BIOS drive number if we are formatting a
++ hard drive, and sets the number of hidden sectors to be the
++ number of sectors in one track. These were required so that DOS
++ could boot using the bootcode.
++
+ 28th January 1995 H. Peter Anvin (hpa@yggdrasil.com)
+
+ Better algorithm to select cluster sizes on large filesystems.
+Index: dosfstools-2.11/mkdosfs/mkdosfs.8
+===================================================================
+--- dosfstools-2.11.orig/mkdosfs/mkdosfs.8 2004-02-25 19:36:07.000000000 +0000
++++ dosfstools-2.11/mkdosfs/mkdosfs.8 2011-12-06 12:19:54.777888434 +0000
+@@ -44,6 +44,10 @@
+ .I message-file
+ ]
+ [
++.B \-B
++.I bootcode-file
++]
++[
+ .B \-n
+ .I volume-name
+ ]
+@@ -165,6 +169,18 @@
+ carriage return-line feed combinations, and tabs have been expanded.
+ If the filename is a hyphen (-), the text is taken from standard input.
+ .TP
++.BI \-B " bootcode-file"
++Uses boot machine code from file "file". On any thing other than FAT32,
++this only writes the first 3 bytes, and 480 bytes from offset 3Eh. On
++FAT32, this writes the first 3 bytes, 420 bytes from offset 5Ah to both
++primary and backup boot sectors. Also writes all other reserved sectors
++excluding the sectors following boot sectors (usually sector 2 and 7).
++Does not require that the input file be as large as reserved_sectors*512.
++To make a FAT32 partition bootable, you will need at least the first
++13 sectors (6656 bytes). You can also specify a partition as the argument
++to clone the boot code from that partition.
++i.e mkdosfs -B /dev/sda1 /dev/sda1
++.TP
+ .BI \-n " volume-name"
+ Sets the volume name (label) of the filesystem. The volume name can
+ be up to 11 characters long. The default is no label.
+@@ -198,8 +214,9 @@
+ simply will not support it ;)
+ .SH AUTHOR
+ Dave Hudson - <dave@humbug.demon.co.uk>; modified by Peter Anvin
+-<hpa@yggdrasil.com>. Fixes and additions by Roman Hodek
+-<roman@hodek.net> for Debian/GNU Linux.
++<hpa@yggdrasil.com> and Sam Bingner <sam@bingner.com>. Fixes and
++additions by Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
++for Debian/GNU Linux.
+ .SH ACKNOWLEDGEMENTS
+ .B mkdosfs
+ is based on code from
+Index: dosfstools-2.11/mkdosfs/mkdosfs.c
+===================================================================
+--- dosfstools-2.11.orig/mkdosfs/mkdosfs.c 2005-03-12 16:12:16.000000000 +0000
++++ dosfstools-2.11/mkdosfs/mkdosfs.c 2011-12-06 12:27:55.121886076 +0000
+@@ -24,6 +24,12 @@
+ - New options -A, -S, -C
+ - Support for filesystems > 2GB
+ - FAT32 support
++
++ Fixes/additions June 2003 by Sam Bingner
++ <sam@bingner.com>:
++ - Add -B option to read in bootcode from a file
++ - Write BIOS drive number so that FS can properly boot
++ - Set number of hidden sectors before boot code to be one track
+
+ Copying: Copyright 1993, 1994 David Hudson (dave@humbug.demon.co.uk)
+
+@@ -153,6 +159,8 @@
+ #define FAT_BAD 0x0ffffff7
+
+ #define MSDOS_EXT_SIGN 0x29 /* extended boot sector signature */
++#define HD_DRIVE_NUMBER 0x80 /* Boot off first hard drive */
++#define FD_DRIVE_NUMBER 0x00 /* Boot off first floppy drive */
+ #define MSDOS_FAT12_SIGN "FAT12 " /* FAT12 filesystem signature */
+ #define MSDOS_FAT16_SIGN "FAT16 " /* FAT16 filesystem signature */
+ #define MSDOS_FAT32_SIGN "FAT32 " /* FAT32 filesystem signature */
+@@ -175,6 +183,8 @@
+ #define BOOTCODE_SIZE 448
+ #define BOOTCODE_FAT32_SIZE 420
+
++#define MAX_RESERVED 0xFFFF
++
+ /* __attribute__ ((packed)) is used on all structures to make gcc ignore any
+ * alignments */
+
+@@ -202,7 +212,7 @@
+ __u16 fat_length; /* sectors/FAT */
+ __u16 secs_track; /* sectors per track */
+ __u16 heads; /* number of heads */
+- __u32 hidden; /* hidden sectors (unused) */
++ __u32 hidden; /* hidden sectors (one track) */
+ __u32 total_sect; /* number of sectors (if sectors == 0) */
+ union {
+ struct {
+@@ -285,6 +295,8 @@
+
+ /* Global variables - the root of all evil :-) - see these and weep! */
+
++static char *template_boot_code; /* Variable to store a full template boot sector in */
++static int use_template = 0;
+ static char *program_name = "mkdosfs"; /* Name of the program */
+ static char *device_name = NULL; /* Name of the device on which to create the filesystem */
+ static int atari_format = 0; /* Use Atari variation of MS-DOS FS format */
+@@ -837,6 +849,12 @@
+ vi->volume_id[2] = (unsigned char) ((volume_id & 0x00ff0000) >> 16);
+ vi->volume_id[3] = (unsigned char) (volume_id >> 24);
+ }
++ if (bs.media == 0xf8) {
++ vi->drive_number = HD_DRIVE_NUMBER; /* Set bios drive number to 80h */
++ }
++ else {
++ vi->drive_number = FD_DRIVE_NUMBER; /* Set bios drive number to 00h */
++ }
+
+ if (!atari_format) {
+ memcpy(vi->volume_label, volume_name, 11);
+@@ -1362,6 +1380,32 @@
+ * dir area on FAT12/16, and the first cluster on FAT32. */
+ writebuf( (char *) root_dir, size_root_dir, "root directory" );
+
++ if (use_template == 1) {
++ /* dupe template into reserved sectors */
++ seekto( 0, "Start of partition" );
++ if (size_fat == 32) {
++ writebuf( template_boot_code, 3, "backup jmpBoot" );
++ seekto( 0x5a, "sector 1 boot area" );
++ writebuf( template_boot_code+0x5a, 420, "sector 1 boot area" );
++ seekto( 512*2, "third sector" );
++ if (backup_boot != 0) {
++ writebuf( template_boot_code+512*2, backup_boot*sector_size - 512*2, "data to backup boot" );
++ seekto( backup_boot*sector_size, "backup boot sector" );
++ writebuf( template_boot_code, 3, "backup jmpBoot" );
++ seekto( backup_boot*sector_size+0x5a, "backup boot sector boot area" );
++ writebuf( template_boot_code+0x5a, 420, "backup boot sector boot area" );
++ seekto( (backup_boot+2)*sector_size, "sector following backup code" );
++ writebuf( template_boot_code+(backup_boot+2)*sector_size, (reserved_sectors-backup_boot-2)*512, "remaining data" );
++ } else {
++ writebuf( template_boot_code+512*2, (reserved_sectors-2)*512, "remaining data" );
++ }
++ } else {
++ writebuf( template_boot_code, 3, "jmpBoot" );
++ seekto( 0x3e, "sector 1 boot area" );
++ writebuf( template_boot_code+0x3e, 448, "boot code" );
++ }
++ }
++
+ if (blank_sector) free( blank_sector );
+ if (info_sector) free( info_sector );
+ free (root_dir); /* Free up the root directory space from setup_tables */
+@@ -1376,7 +1420,7 @@
+ {
+ fatal_error("\
+ Usage: mkdosfs [-A] [-c] [-C] [-v] [-I] [-l bad-block-file] [-b backup-boot-sector]\n\
+- [-m boot-msg-file] [-n volume-name] [-i volume-id]\n\
++ [-m boot-msg-file] [-n volume-name] [-i volume-id] [-B bootcode]\n\
+ [-s sectors-per-cluster] [-S logical-sector-size] [-f number-of-FATs]\n\
+ [-h hidden-sectors] [-F fat-size] [-r root-dir-entries] [-R reserved-sectors]\n\
+ /dev/name [blocks]\n");
+@@ -1439,7 +1483,7 @@
+ printf ("%s " VERSION " (" VERSION_DATE ")\n",
+ program_name);
+
+- while ((c = getopt (argc, argv, "AbcCf:F:Ii:l:m:n:r:R:s:S:h:v")) != EOF)
++ while ((c = getopt (argc, argv, "AbcCf:F:Ii:l:m:n:r:R:s:S:v:B:")) != EOF)
+ /* Scan the command line for options */
+ switch (c)
+ {
+@@ -1509,6 +1553,51 @@
+ listfile = optarg;
+ break;
+
++ case 'B': /* B : read in bootcode */
++ if ( strcmp(optarg, "-") )
++ {
++ msgfile = fopen(optarg, "r");
++ if ( !msgfile )
++ perror(optarg);
++ }
++ else
++ msgfile = stdin;
++
++ if ( msgfile )
++ {
++ if (!(template_boot_code = malloc( MAX_RESERVED )))
++ die( "Out of memory" );
++ /* The template boot sector including reserved must not be > 65535 */
++ use_template = 1;
++ i = 0;
++ do
++ {
++ ch = getc(msgfile);
++ switch (ch)
++ {
++ case EOF:
++ break;
++
++ default:
++ template_boot_code[i++] = ch; /* Store character */
++ break;
++ }
++ }
++ while ( ch != EOF && i < MAX_RESERVED );
++ ch = getc(msgfile); /* find out if we're at EOF */
++
++ /* Fill up with zeros */
++ while( i < MAX_RESERVED )
++ template_boot_code[i++] = '\0';
++
++ if ( ch != EOF )
++ printf ("Warning: template too long; truncated after %d bytes\n", i);
++
++ if ( msgfile != stdin )
++ fclose(msgfile);
++ }
++ break;
++
+ case 'm': /* m : Set boot message */
+ if ( strcmp(optarg, "-") )
+ {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-dir.patch b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-dir.patch
new file mode 100644
index 000000000..3ba4711d1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-dir.patch
@@ -0,0 +1,639 @@
+Add -d <directory> support to populate the image.
+
+Upstream-Status: Inappropriate [licensing]
+We're tracking an old release of dosfstools due to licensing issues.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+Index: dosfstools-2.11/mkdosfs/mkdosfs.c
+===================================================================
+--- dosfstools-2.11.orig/mkdosfs/mkdosfs.c 2011-12-06 12:27:55.000000000 +0000
++++ dosfstools-2.11/mkdosfs/mkdosfs.c 2011-12-06 12:37:13.445950703 +0000
+@@ -18,6 +18,10 @@
+ as a rule), and not the block. For example the boot block does not
+ occupy a full cluster.
+
++ June 2004 - Jordan Crouse (info.linux@amd.com)
++ Added -d <directory> support to populate the image
++ Copyright (C) 2004, Advanced Micro Devices, All Rights Reserved
++
+ Fixes/additions May 1998 by Roman Hodek
+ <Roman.Hodek@informatik.uni-erlangen.de>:
+ - Atari format support
+@@ -71,6 +75,8 @@
+ #include <unistd.h>
+ #include <time.h>
+ #include <errno.h>
++#include <libgen.h>
++#include <dirent.h>
+
+ #include <linux/version.h>
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
+@@ -110,6 +116,8 @@
+ * sufficient (or even better :) for 64 bit offsets in the meantime */
+ #define llseek lseek
+
++#define ROUND_UP(value, divisor) (value + (divisor - (value % divisor))) / divisor
++
+ /* Constant definitions */
+
+ #define TRUE 1 /* Boolean constants */
+@@ -149,7 +157,6 @@
+ #define ATTR_VOLUME 8 /* volume label */
+ #define ATTR_DIR 16 /* directory */
+ #define ATTR_ARCH 32 /* archived */
+-
+ #define ATTR_NONE 0 /* no attribute bits */
+ #define ATTR_UNUSED (ATTR_VOLUME | ATTR_ARCH | ATTR_SYS | ATTR_HIDDEN)
+ /* attribute bits that are copied "as is" */
+@@ -245,6 +252,19 @@
+ __u32 reserved2[4];
+ };
+
++/* This stores up to 13 chars of the name */
++
++struct msdos_dir_slot {
++ __u8 id; /* sequence number for slot */
++ __u8 name0_4[10]; /* first 5 characters in name */
++ __u8 attr; /* attribute byte */
++ __u8 reserved; /* always 0 */
++ __u8 alias_checksum; /* checksum for 8.3 alias */
++ __u8 name5_10[12]; /* 6 more characters in name */
++ __u16 start; /* starting cluster number, 0 in long slots */
++ __u8 name11_12[4]; /* last 2 characters in name */
++};
++
+ struct msdos_dir_entry
+ {
+ char name[8], ext[3]; /* name and extension */
+@@ -293,6 +313,15 @@
+
+ #define MESSAGE_OFFSET 29 /* Offset of message in above code */
+
++/* Special structure to keep track of directories as we add them for the -d option */
++
++struct dir_entry {
++ int root; /* Specifies if this is the root dir or not */
++ int count; /* Number of items in the table */
++ int entries; /* Number of entries in the table */
++ struct msdos_dir_entry *table; /* Pointer to the entry table */
++};
++
+ /* Global variables - the root of all evil :-) - see these and weep! */
+
+ static char *template_boot_code; /* Variable to store a full template boot sector in */
+@@ -326,6 +355,9 @@
+ static int size_root_dir; /* Size of the root directory in bytes */
+ static int sectors_per_cluster = 0; /* Number of sectors per disk cluster */
+ static int root_dir_entries = 0; /* Number of root directory entries */
++static int root_dir_num_entries = 0;
++static int last_cluster_written = 0;
++
+ static char *blank_sector; /* Blank sector - all zeros */
+ static int hidden_sectors = 0; /* Number of hidden sectors */
+
+@@ -399,7 +431,6 @@
+ }
+ }
+
+-
+ /* Mark a specified sector as having a particular value in it's FAT entry */
+
+ static void
+@@ -1266,6 +1297,9 @@
+ die ("unable to allocate space for root directory in memory");
+ }
+
++
++ last_cluster_written = 2;
++
+ memset(root_dir, 0, size_root_dir);
+ if ( memcmp(volume_name, " ", 11) )
+ {
+@@ -1314,11 +1348,11 @@
+ }
+
+ if (!(blank_sector = malloc( sector_size )))
+- die( "Out of memory" );
++ die( "Out of memory" );
++
+ memset(blank_sector, 0, sector_size);
+ }
+-
+-
++
+ /* Write the new filesystem's data tables to wherever they're going to end up! */
+
+ #define error(str) \
+@@ -1340,7 +1374,7 @@
+ do { \
+ int __size = (size); \
+ if (write (dev, buf, __size) != __size) \
+- error ("failed whilst writing " errstr); \
++ error ("failed whilst writing " errstr); \
+ } while(0)
+
+
+@@ -1412,6 +1446,452 @@
+ free (fat); /* Free up the fat table space reserved during setup_tables */
+ }
+
++/* Add a file to the specified directory entry, and also write it into the image */
++
++static void copy_filename(char *filename, char *base, char *ext) {
++
++ char *ch = filename;
++ int i, len;
++
++ memset(base, 0x20, 8);
++ memset(ext, 0x20, 3);
++
++ for(len = 0 ; *ch && *ch != '.'; ch++) {
++ base[len++] = toupper(*ch);
++ if (len == 8) break;
++ }
++
++ for ( ; *ch && *ch != '.'; ch++);
++ if (*ch) ch++;
++
++ for(len = 0 ; *ch; ch++) {
++ ext[len++] = toupper(*ch);
++ if (len == 3) break;
++ }
++}
++
++/* Check for an .attrib.<filename> file, and read the attributes therein */
++
++/* We are going to be pretty pedantic about this. The file needs 3
++ bytes at the beginning, the attributes are listed in this order:
++
++ (H)idden|(S)ystem|(A)rchived
++
++ A capital HSA means to enable it, anything else will disable it
++ (I recommend a '-') The unix user attributes will still be used
++ for write access.
++
++ For example, to enable system file access for ldlinux.sys, write
++ the following to .attrib.ldlinux.sys: -S-
++*/
++
++unsigned char check_attrib_file(char *dir, char *filename) {
++
++ char attrib[4] = { '-', '-', '-' };
++ unsigned char *buffer = 0;
++ int ret = ATTR_NONE;
++ int fd = -1;
++
++ buffer = (char *) calloc(1, strlen(dir) + strlen(filename) + 10);
++ if (!buffer) return ATTR_NONE;
++
++ sprintf(buffer, "%s/.attrib.%s", dir, filename);
++
++ if (access(buffer, R_OK))
++ goto exit_attrib;
++
++ if ((fd = open(buffer, O_RDONLY, 0)) < 0)
++ goto exit_attrib;
++
++ if (read(fd, attrib, 3) < 0)
++ goto exit_attrib;
++
++ if (attrib[0] == 'H') ret |= ATTR_HIDDEN;
++ if (attrib[1] == 'S') ret |= ATTR_SYS;
++ if (attrib[2] == 'A') ret |= ATTR_ARCH;
++
++ printf("%s: Setting atrribute %x\n", filename, ret);
++
++ exit_attrib:
++ if (fd >= 0) close(fd);
++ if (buffer) free(buffer);
++
++ return ret;
++}
++
++static void copy_name(char *buffer, int size, char **pointer) {
++ int i;
++
++ for(i = 0; i < size; i += 2) {
++ if (*pointer) {
++ buffer[i] = **pointer;
++ buffer[i + 1] = 0x00;
++ *pointer = **pointer ? *pointer + 1 : 0;
++ }
++ else {
++ buffer[i] = 0xFF;
++ buffer[i + 1] = 0xFF;
++ }
++ }
++}
++
++static int add_file(char *filename, struct dir_entry *dir, unsigned char attr)
++{
++ struct stat stat;
++ struct msdos_dir_entry *entry;
++ int infile = 0;
++ int sectors, clusters;
++ struct tm *ctime;
++ int c, s;
++ int ptr;
++ char *buffer, *base;
++ int start;
++ int usedsec, totalsec;
++
++ char name83[8], ext83[3];
++
++ struct msdos_dir_slot *slot;
++ int i;
++ char *p;
++
++ /* The root directory is static, everything else grows as needed */
++
++ if (dir->root) {
++ if (dir->count == dir->entries) {
++ printf("Error - too many directory entries\n");
++ }
++ }
++ else {
++ if (dir->count == dir->entries) {
++ if (!dir->table)
++ dir->table =
++ (struct msdos_dir_entry *) malloc(sizeof(struct msdos_dir_entry));
++ else {
++ dir->table =
++ (struct msdos_dir_entry *) realloc(dir->table, (dir->entries + 1) *
++ sizeof(struct msdos_dir_entry));
++
++ memset(&dir->table[dir->entries], 0, sizeof(struct msdos_dir_entry));
++ }
++
++ dir->entries++;
++ }
++ }
++
++ infile = open(filename, O_RDONLY, 0);
++ if (!infile) return;
++
++ if (fstat(infile, &stat))
++ goto exit_add;
++
++ if (S_ISCHR(stat.st_mode) ||S_ISBLK(stat.st_mode) ||
++ S_ISFIFO(stat.st_mode) || S_ISLNK(stat.st_mode)) {
++ printf("Error - cannot create a special file in a FATFS\n");
++ goto exit_add;
++ }
++
++ /* FIXME: This isn't very pretty */
++
++ usedsec = start_data_sector + (size_root_dir / sector_size) +
++ (last_cluster_written * bs.cluster_size);
++
++ totalsec = blocks * BLOCK_SIZE / sector_size;
++
++ /* Figure out how many sectors / clustors the file requires */
++
++ sectors = ROUND_UP(stat.st_size, sector_size);
++ clusters = ROUND_UP(sectors, (int) bs.cluster_size);
++
++ if (usedsec + sectors > totalsec) {
++ printf("Error - %s is too big (%d vs %d)\n", filename, sectors, totalsec - usedsec);
++ close(infile);
++ return -1;
++ }
++
++ printf("ADD %s\n", filename);
++
++ /* Grab the basename of the file */
++ base = basename(filename);
++
++ /* Extract out the 8.3 name */
++ copy_filename(base, name83, ext83);
++
++ /* Make an extended name slot */
++
++ slot = (struct msdos_dir_slot *) &dir->table[dir->count++];
++ slot->id = 'A';
++ slot->attr = 0x0F;
++ slot->reserved = 0;
++ slot->start = 0;
++
++ slot->alias_checksum = 0;
++
++ for(i = 0; i < 8; i++)
++ slot->alias_checksum = (((slot->alias_checksum&1)<<7)|((slot->alias_checksum&0xfe)>>1)) + name83[i];
++
++ for(i = 0; i < 3; i++)
++ slot->alias_checksum = (((slot->alias_checksum&1)<<7)|((slot->alias_checksum&0xfe)>>1)) + ext83[i];
++
++ p = base;
++
++ copy_name(slot->name0_4, 10, &p);
++ copy_name(slot->name5_10, 12, &p);
++ copy_name(slot->name11_12, 4, &p);
++
++
++ /* Get the entry from the root filesytem */
++ entry = &dir->table[dir->count++];
++
++ strncpy(entry->name, name83, 8);
++ strncpy(entry->ext, ext83, 3);
++
++
++ /* If the user has it read only, then add read only to the incoming
++ attribute settings */
++
++ if (!(stat.st_mode & S_IWUSR)) attr |= ATTR_RO;
++ entry->attr = attr;
++
++ /* Set the access time on the file */
++ ctime = localtime(&create_time);
++
++ entry->time = CT_LE_W((unsigned short)((ctime->tm_sec >> 1) +
++ (ctime->tm_min << 5) + (ctime->tm_hour << 11)));
++
++ entry->date = CT_LE_W((unsigned short)(ctime->tm_mday +
++ ((ctime->tm_mon+1) << 5) +
++ ((ctime->tm_year-80) << 9)));
++
++ entry->ctime_ms = 0;
++ entry->ctime = entry->time;
++ entry->cdate = entry->date;
++ entry->adate = entry->date;
++ entry->size = stat.st_size;
++
++ start = last_cluster_written;
++
++ entry->start = CT_LE_W(start); /* start sector */
++ entry->starthi = CT_LE_W((start & 0xFFFF0000) >> 16); /* High start sector (for FAT32) */
++
++ /* We mark all of the clusters we use in the FAT */
++
++ for(c = 0; c < clusters; c++ ) {
++ int free;
++ int next = c == (clusters - 1) ? FAT_EOF : start + c + 1;
++ mark_FAT_cluster(start + c, next);
++ last_cluster_written++;
++ }
++
++ /* This confused me too - cluster 2 starts after the
++ root directory data - search me as to why */
++
++ ptr = (start_data_sector * sector_size) + size_root_dir;
++ ptr += (start - 2) * bs.cluster_size * sector_size;
++
++ buffer = (char *) malloc(sector_size);
++
++ if (!buffer) {
++ printf("Error - couldn't allocate memory\n");
++ goto exit_add;
++ }
++
++ /* Write the file into the file block */
++
++ seekto(ptr, "datafile");
++
++ while(1) {
++ int size = read(infile, buffer, sector_size);
++ if (size <= 0) break;
++
++ writebuf(buffer, size, "data");
++ }
++
++ exit_add:
++ if (infile) close(infile);
++}
++
++/* Add a new directory to the specified directory entry, and in turn populate
++ it with its own files */
++
++/* FIXME: This should check to make sure there is enough size to add itself */
++
++static void add_directory(char *filename, struct dir_entry *dir) {
++
++ struct dir_entry *newdir = 0;
++ struct msdos_dir_entry *entry;
++ struct tm *ctime;
++ DIR *rddir = opendir(filename);
++ struct dirent *dentry = 0;
++ int remain;
++ char *data;
++
++ /* If the directory doesn't exist */
++ if (!rddir) return;
++
++ if (dir->root) {
++ if (dir->count == dir->entries) {
++ printf("Error - too many directory entries\n");
++ goto exit_add_dir;
++ }
++ }
++ else {
++ if (dir->count == dir->entries) {
++ if (!dir->table)
++ dir->table = (struct msdos_dir_entry *) malloc(sizeof(struct msdos_dir_entry));
++ else {
++ dir->table = (struct msdos_dir_entry *) realloc(dir->table, (dir->entries + 1) *
++ sizeof(struct msdos_dir_entry));
++
++ /* Zero it out to avoid issues */
++ memset(&dir->table[dir->entries], 0, sizeof(struct msdos_dir_entry));
++ }
++ dir->entries++;
++ }
++ }
++
++ /* Now, create a new directory entry for the new directory */
++ newdir = (struct dir_entry *) calloc(1, sizeof(struct dir_entry));
++ if (!newdir) goto exit_add_dir;
++
++ entry = &dir->table[dir->count++];
++
++ strncpy(entry->name, basename(filename), sizeof(entry->name));
++
++ entry->attr = ATTR_DIR;
++ ctime = localtime(&create_time);
++
++ entry->time = CT_LE_W((unsigned short)((ctime->tm_sec >> 1) +
++ (ctime->tm_min << 5) + (ctime->tm_hour << 11)));
++
++ entry->date = CT_LE_W((unsigned short)(ctime->tm_mday +
++ ((ctime->tm_mon+1) << 5) +
++ ((ctime->tm_year-80) << 9)));
++
++ entry->ctime_ms = 0;
++ entry->ctime = entry->time;
++ entry->cdate = entry->date;
++ entry->adate = entry->date;
++
++ /* Now, read the directory */
++
++ while((dentry = readdir(rddir))) {
++ struct stat st;
++ char *buffer;
++
++ if (!strcmp(dentry->d_name, ".") || !strcmp(dentry->d_name, ".."))
++ continue;
++
++ /* DOS wouldn't like a typical unix . (dot) file, so we skip those too */
++ if (dentry->d_name[0] == '.') continue;
++
++ buffer = malloc(strlen(filename) + strlen(dentry->d_name) + 3);
++ if (!buffer) continue;
++
++ sprintf(buffer, "%s/%s", filename, dentry->d_name);
++ if (!stat(buffer, &st)) {
++ if (S_ISDIR(st.st_mode))
++ add_directory(buffer, newdir);
++ else if (S_ISREG(st.st_mode)) {
++ unsigned char attrib = check_attrib_file(filename, dentry->d_name);
++ add_file(buffer, newdir, attrib);
++ }
++ }
++
++ free(buffer);
++ }
++
++ /* Now that the entire directory has been written, go ahead and write the directory
++ entry as well */
++
++ entry->start = CT_LE_W(last_cluster_written);
++ entry->starthi = CT_LE_W((last_cluster_written & 0xFFFF0000) >> 16);
++ entry->size = newdir->count * sizeof(struct msdos_dir_entry);
++
++ remain = entry->size;
++ data = (char *) newdir->table;
++
++ while(remain) {
++ int size =
++ remain > bs.cluster_size * sector_size ? bs.cluster_size * sector_size : remain;
++
++ int pos = (start_data_sector * sector_size) + size_root_dir;
++ pos += (last_cluster_written - 2) * bs.cluster_size * sector_size;
++
++ seekto(pos, "add_dir");
++ writebuf(data, size, "add_dir");
++
++ remain -= size;
++ data += size;
++
++ mark_FAT_cluster(last_cluster_written, remain ? last_cluster_written + 1 : FAT_EOF);
++ last_cluster_written++;
++ }
++
++ exit_add_dir:
++ if (rddir) closedir(rddir);
++ if (newdir->table) free(newdir->table);
++ if (newdir) free(newdir);
++}
++
++/* Given a directory, add all the files and directories to the root directory of the
++ image.
++*/
++
++static void add_root_directory(char *dirname)
++{
++ DIR *dir = opendir(dirname);
++ struct dirent *entry = 0;
++ struct dir_entry *newdir = 0;
++
++ if (!dir) {
++ printf("Error - directory %s does not exist\n", dirname);
++ return;
++ }
++
++ /* Create the root directory structure - this is a bit different then
++ above, because the table already exists, we just refer to it. */
++
++ newdir = (struct dir_entry *) calloc(1,sizeof(struct dir_entry));
++
++ if (!newdir) {
++ closedir(dir);
++ return;
++ }
++
++ newdir->entries = root_dir_entries;
++ newdir->root = 1;
++ newdir->count = 0;
++ newdir->table = root_dir;
++
++ while((entry = readdir(dir))) {
++ struct stat st;
++ char *buffer;
++
++ if (!strcmp(entry->d_name, ".") || !strcmp(entry->d_name, ".."))
++ continue;
++
++ /* DOS wouldn't like a typical unix . (dot) file, so we skip those too */
++ if (entry->d_name[0] == '.') continue;
++
++ buffer = malloc(strlen(dirname) + strlen(entry->d_name) + 3);
++ if (!buffer) continue;
++
++ sprintf(buffer, "%s/%s", dirname, entry->d_name);
++ if (!stat(buffer, &st)) {
++ if (S_ISDIR(st.st_mode))
++ add_directory(buffer, newdir);
++ else if (S_ISREG(st.st_mode)) {
++ unsigned char attrib = check_attrib_file(dirname, entry->d_name);
++ add_file(buffer, newdir, attrib);
++ }
++ }
++
++ free(buffer);
++ }
++
++ closedir(dir);
++ if (newdir) free(newdir);
++}
+
+ /* Report the command usage and return a failure error code */
+
+@@ -1423,7 +1903,7 @@
+ [-m boot-msg-file] [-n volume-name] [-i volume-id] [-B bootcode]\n\
+ [-s sectors-per-cluster] [-S logical-sector-size] [-f number-of-FATs]\n\
+ [-h hidden-sectors] [-F fat-size] [-r root-dir-entries] [-R reserved-sectors]\n\
+- /dev/name [blocks]\n");
++ [-d directory] /dev/name [blocks]\n");
+ }
+
+ /*
+@@ -1463,6 +1943,8 @@
+ int c;
+ char *tmp;
+ char *listfile = NULL;
++ char *dirname = NULL;
++
+ FILE *msgfile;
+ struct stat statbuf;
+ int i = 0, pos, ch;
+@@ -1483,7 +1965,7 @@
+ printf ("%s " VERSION " (" VERSION_DATE ")\n",
+ program_name);
+
+- while ((c = getopt (argc, argv, "AbcCf:F:Ii:l:m:n:r:R:s:S:v:B:")) != EOF)
++ while ((c = getopt (argc, argv, "AbcCd:f:F:Ii:l:m:n:r:R:s:S:v:B:")) != EOF)
+ /* Scan the command line for options */
+ switch (c)
+ {
+@@ -1508,6 +1990,10 @@
+ create = TRUE;
+ break;
+
++ case 'd':
++ dirname = optarg;
++ break;
++
+ case 'f': /* f : Choose number of FATs */
+ nr_fats = (int) strtol (optarg, &tmp, 0);
+ if (*tmp || nr_fats < 1 || nr_fats > 4)
+@@ -1811,8 +2297,10 @@
+ else if (listfile)
+ get_list_blocks (listfile);
+
+- write_tables (); /* Write the file system tables away! */
+
++ if (dirname) add_root_directory(dirname);
++
++ write_tables (); /* Write the file system tables away! */
+ exit (0); /* Terminate with no errors! */
+ }
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/msdos_fat12_undefined.patch b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/msdos_fat12_undefined.patch
new file mode 100644
index 000000000..11e8a7594
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/msdos_fat12_undefined.patch
@@ -0,0 +1,19 @@
+Fix a compilation error due to undefined MSDOS_FAT12.
+
+Upstream-Status: Inappropriate [licensing]
+We're tracking an old release of dosfstools due to licensing issues.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- dosfstools-2.10/dosfsck/boot.c.orig 2004-10-15 08:51:42.394725176 -0600
++++ dosfstools-2.10/dosfsck/boot.c 2004-10-15 08:49:16.776862456 -0600
+@@ -14,6 +14,9 @@
+ #include "io.h"
+ #include "boot.h"
+
++#ifndef MSDOS_FAT12
++#define MSDOS_FAT12 4084
++#endif
+
+ #define ROUND_TO_MULTIPLE(n,m) ((n) && (m) ? (n)+(m)-1-((n)-1)%(m) : 0)
+ /* don't divide by zero */
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/nofat32_autoselect.patch b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/nofat32_autoselect.patch
new file mode 100644
index 000000000..848a76b99
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/nofat32_autoselect.patch
@@ -0,0 +1,27 @@
+FAT32 appears to be broken when used with the -d option to populate the msdos
+image. This disables the FAT32 autoselection code which means we don't get
+broken images with the -d option. It can still be enabled on the commandline
+at the users own risk. This changes us back to the 2.10 version's behaviour
+which was known to work well even with large images.
+
+Upstream-Status: Inappropriate [depends on other patches we apply]
+
+RP 2011/12/13
+
+Index: dosfstools-2.11/mkdosfs/mkdosfs.c
+===================================================================
+--- dosfstools-2.11.orig/mkdosfs/mkdosfs.c 2011-12-13 13:54:37.538509391 +0000
++++ dosfstools-2.11/mkdosfs/mkdosfs.c 2011-12-13 13:55:10.258508631 +0000
+@@ -808,10 +808,12 @@
+ bs.media = (char) 0xf8; /* Set up the media descriptor for a hard drive */
+ bs.dir_entries[0] = (char) 0; /* Default to 512 entries */
+ bs.dir_entries[1] = (char) 2;
++/*
+ if (!size_fat && blocks*SECTORS_PER_BLOCK > 1064960) {
+ if (verbose) printf("Auto-selecting FAT32 for large filesystem\n");
+ size_fat = 32;
+ }
++*/
+ if (size_fat == 32) {
+ /* For FAT32, try to do the same as M$'s format command:
+ * fs size < 256M: 0.5k clusters
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools_2.11.bb b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools_2.11.bb
new file mode 100644
index 000000000..176504d4f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools_2.11.bb
@@ -0,0 +1,34 @@
+# dosfstools OE build file
+# Copyright (C) 2004-2006, Advanced Micro Devices, Inc. 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 = "GPLv2"
+LIC_FILES_CHKSUM = "file://mkdosfs/COPYING;md5=cbe67f08d6883bff587f615f0cc81aa8"
+PR = "r5"
+
+SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/${BPN}/${BP}.src.tar.gz/407d405ade410f7597d364ab5dc8c9f6/${BP}.src.tar.gz \
+ file://mkdosfs-bootcode.patch \
+ file://mkdosfs-dir.patch \
+ file://alignment_hack.patch \
+ file://msdos_fat12_undefined.patch \
+ file://dosfstools-msdos_fs-types.patch \
+ file://include-linux-types.patch \
+ file://nofat32_autoselect.patch \
+ file://fix_populated_dosfs_creation.patch \
+ file://0001-Include-fcntl.h-for-getting-loff_t-definition.patch \
+"
+
+SRC_URI[md5sum] = "407d405ade410f7597d364ab5dc8c9f6"
+SRC_URI[sha256sum] = "0eac6d12388b3d9ed78684529c1b0d9346fa2abbe406c4d4a3eb5a023c98a484"
+
+CFLAGS += "-D_GNU_SOURCE ${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', '', d)}"
+
+EXTRA_OEMAKE = "CC='${CC}' CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'"
+
+do_install () {
+ oe_runmake "PREFIX=${D}" "SBINDIR=${D}${base_sbindir}" \
+ "MANDIR=${D}${mandir}/man8" install
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools_3.0.28.bb b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools_3.0.28.bb
new file mode 100644
index 000000000..6fc3e41df
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools_3.0.28.bb
@@ -0,0 +1,31 @@
+# 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/v3.0.28/dosfstools-3.0.28.tar.xz \
+ file://largefile.patch \
+ file://0001-mkfs.fat-fix-incorrect-int-type.patch \
+ "
+SRC_URI[md5sum] = "6a047a6c65186b9ebb1853709adb36db"
+SRC_URI[sha256sum] = "ee95913044ecf2719b63ea11212917649709a6e53209a72d622135aaa8517ee2"
+
+UPSTREAM_CHECK_URI = "https://github.com/dosfstools/dosfstools/releases"
+
+CFLAGS += "-D_GNU_SOURCE ${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', '', d)}"
+
+FILES_${PN} = "${base_sbindir}"
+FILES_${PN}-doc = "${mandir} ${docdir}"
+
+do_install () {
+ oe_runmake "PREFIX=${D}${prefix}" "SBINDIR=${D}${base_sbindir}" \
+ "MANDIR=${D}${mandir}" "DOCDIR=${D}${docdir}" install
+}
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg.inc b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg.inc
new file mode 100644
index 000000000..3d9e7e305
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg.inc
@@ -0,0 +1,79 @@
+SUMMARY = "Package maintenance system from Debian"
+LICENSE = "GPLv2.0+"
+SECTION = "base"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/d/dpkg/dpkg_${PV}.tar.xz"
+
+SRC_URI_append_class-native = " file://0001-When-running-do_package_write_deb-we-have-trees-of-h.patch"
+
+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} xz run-postinsts perl"
+RDEPENDS_${PN}_class-native = "xz-native"
+
+inherit autotools gettext perlnative pkgconfig systemd
+
+python () {
+ if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+ pn = d.getVar('PN', True)
+ 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"
+PERL_LIBDIR_class-native = "${libdir}/perl-native/perl"
+
+EXTRA_OECONF = "\
+ --disable-dselect \
+ --enable-start-stop-daemon \
+ --with-zlib \
+ --with-bz2 \
+ --without-liblzma \
+ --without-selinux \
+ "
+
+EXTRA_OECONF += "TAR=tar"
+
+do_configure () {
+ echo >> ${S}/m4/compiler.m4
+ sed -i -e 's#PERL_LIBDIR=.*$#PERL_LIBDIR="${libdir}/perl"#' ${S}/configure
+ autotools_do_configure
+}
+
+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"
+
+BBCLASSEXTEND = "native"
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0001-When-running-do_package_write_deb-we-have-trees-of-h.patch b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0001-When-running-do_package_write_deb-we-have-trees-of-h.patch
new file mode 100644
index 000000000..49ef853ff
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0001-When-running-do_package_write_deb-we-have-trees-of-h.patch
@@ -0,0 +1,71 @@
+From e391bdba238d1371fc5b67cdae08b06eb5ada5c2 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 26 Aug 2015 15:48:13 +0300
+Subject: [PATCH] When running do_package_write_deb, we have trees of
+ hardlinked files such as the dbg source files in ${PN}-dbg. If something
+ makes another copy of one of those files (or deletes one), the number of
+ links a file has changes and tar can notice this, e.g.:
+
+| DEBUG: Executing python function do_package_deb
+| dpkg-deb: building package `sed-ptest' in `/media/build1/poky/build/tmp/work/i586-poky-linux/sed/4.2.2-r0/deploy-debs/i586/sed-ptest_4.2.2-r0.3_i386.deb'.
+| tar: ./usr/lib/sed/ptest/testsuite/tst-regex2: file changed as we read it
+| dpkg-deb: error: subprocess tar -cf returned error exit status 1
+
+Tar returns an error of 1 when files 'change' and other errors codes
+in other error cases. We tweak dpkg-deb here so that it ignores an exit
+code of 1 from tar. The files don't really change (and we have locking in
+place to avoid that kind of issue).
+
+Upstream-Status: Inappropriate
+RP 2015/3/27
+---
+ dpkg-deb/build.c | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c
+index 2ddeec6..af363f0 100644
+--- a/dpkg-deb/build.c
++++ b/dpkg-deb/build.c
+@@ -452,7 +452,7 @@ static void
+ tarball_pack(const char *dir, filenames_feed_func *tar_filenames_feeder,
+ struct compress_params *tar_compress_params, int fd_out)
+ {
+- int pipe_filenames[2], pipe_tarball[2];
++ int pipe_filenames[2], pipe_tarball[2], rc;
+ pid_t pid_tar, pid_comp;
+
+ /* Fork off a tar. We will feed it a list of filenames on stdin later. */
+@@ -493,7 +493,9 @@ tarball_pack(const char *dir, filenames_feed_func *tar_filenames_feeder,
+ /* All done, clean up wait for tar and <compress> to finish their job. */
+ close(pipe_filenames[1]);
+ subproc_reap(pid_comp, _("<compress> from tar -cf"), 0);
+- subproc_reap(pid_tar, "tar -cf", 0);
++ rc = subproc_reap(pid_tar, "tar -cf", SUBPROC_RETERROR);
++ if (rc && rc != 1)
++ ohshite(_("subprocess %s returned error exit status %d"), "tar -cf", rc);
+ }
+
+ /**
+@@ -509,7 +511,7 @@ do_build(const char *const *argv)
+ char *debar;
+ char *tfbuf;
+ int arfd;
+- int p1[2], gzfd;
++ int p1[2], gzfd, rc;
+ pid_t c1, c2;
+
+ /* Decode our arguments. */
+@@ -590,7 +592,9 @@ do_build(const char *const *argv)
+ }
+ close(p1[0]);
+ subproc_reap(c2, _("<compress> from tar -cf"), 0);
+- subproc_reap(c1, "tar -cf", 0);
++ rc = subproc_reap(c1, "tar -cf", SUBPROC_RETERROR);
++ if (rc && rc != 1)
++ ohshite(_("subprocess %s returned error exit status %d"), "tar -cf", rc);
+
+ if (lseek(gzfd, 0, SEEK_SET))
+ ohshite(_("failed to rewind temporary file (%s)"), _("control member"));
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0002-Adapt-to-linux-wrs-kernel-version-which-has-characte.patch b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0002-Adapt-to-linux-wrs-kernel-version-which-has-characte.patch
new file mode 100644
index 000000000..231a6a290
--- /dev/null
+++ b/import-layers/yocto-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 79b2908..7758aa5 100644
+--- a/lib/dpkg/parsehelp.c
++++ b/lib/dpkg/parsehelp.c
+@@ -235,14 +235,12 @@ parseversion(struct dpkg_version *rversion, const char *string,
+
+ /* XXX: Would be faster to use something like cisversion and cisrevision. */
+ ptr = rversion->version;
+- 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.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch b/import-layers/yocto-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..9f77c6c99
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch
@@ -0,0 +1,60 @@
+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
+---
+ src/script.c | 31 ++-----------------------------
+ 1 file changed, 2 insertions(+), 29 deletions(-)
+
+diff --git a/src/script.c b/src/script.c
+index a958145..24c49f9 100644
+--- a/src/script.c
++++ b/src/script.c
+@@ -100,36 +100,9 @@ maintscript_pre_exec(struct command *cmd)
+ size_t instdirl = strlen(instdir);
+
+ if (*instdir) {
+- if (strncmp(admindir, instdir, instdirl) != 0)
+- ohshit(_("admindir must be inside instdir for dpkg to work properly"));
+- if (setenv("DPKG_ADMINDIR", admindir + instdirl, 1) < 0)
+- ohshite(_("unable to setenv for subprocesses"));
+-
+- if (chroot(instdir))
+- ohshite(_("failed to chroot to '%.250s'"), instdir);
+- }
+- /* Switch to a known good directory to give the maintainer script
+- * a saner environment, also needed after the chroot(). */
+- if (chdir("/"))
+- ohshite(_("failed to chdir to '%.255s'"), "/");
+- 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);
++ setenv("D", instdir, 1);
+ }
+- if (!instdirl)
+- return cmd->filename;
+-
+- assert(strlen(cmd->filename) >= instdirl);
+- return cmd->filename + instdirl;
++ return cmd->filename;
+ }
+
+ /**
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0004-The-lutimes-function-doesn-t-work-properly-for-all-s.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0005-dpkg-compiler.m4-remove-Wvla.patch b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0005-dpkg-compiler.m4-remove-Wvla.patch
new file mode 100644
index 000000000..96e96f277
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0006-add-musleabi-to-known-target-tripets.patch b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0006-add-musleabi-to-known-target-tripets.patch
new file mode 100644
index 000000000..a6b00880c
--- /dev/null
+++ b/import-layers/yocto-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
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ ostable | 1 +
+ triplettable | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/ostable b/ostable
+index 3bb6819..d0ffdc7 100644
+--- a/ostable
++++ b/ostable
+@@ -15,6 +15,7 @@
+ uclibceabi-linux linux-uclibceabi linux[^-]*-uclibceabi
+ uclibc-linux linux-uclibc linux[^-]*-uclibc
+ musleabihf-linux linux-musleabihf linux[^-]*-musleabihf
++musleabi-linux linux-musleabi linux[^-]*-musleabi
+ musl-linux linux-musl linux[^-]*-musl
+ gnueabihf-linux linux-gnueabihf linux[^-]*-gnueabihf
+ gnueabi-linux linux-gnueabi linux[^-]*-gnueabi
+diff --git a/triplettable b/triplettable
+index 1213584..70d24c1 100644
+--- a/triplettable
++++ b/triplettable
+@@ -6,6 +6,7 @@
+ uclibceabi-linux-arm uclibc-linux-armel
+ uclibc-linux-<cpu> uclibc-linux-<cpu>
+ musleabihf-linux-arm musl-linux-armhf
++musleabi-linux-arm musl-linux-armel
+ musl-linux-<cpu> musl-linux-<cpu>
+ gnueabihf-linux-arm armhf
+ gnueabi-linux-arm armel
+--
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/add_armeb_triplet_entry.patch b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/add_armeb_triplet_entry.patch
new file mode 100644
index 000000000..af275dec1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/add_armeb_triplet_entry.patch
@@ -0,0 +1,38 @@
+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>
+
+diff -Naurp dpkg-1.17.21_org/triplettable dpkg-1.17.21/triplettable
+--- dpkg-1.17.21_org/triplettable 2015-04-08 17:08:52.370759171 +0530
++++ dpkg-1.17.21/triplettable 2015-04-08 17:09:12.406752081 +0530
+@@ -9,6 +9,7 @@ musleabihf-linux-arm musl-linux-armhf
+ musl-linux-<cpu> musl-linux-<cpu>
+ gnueabihf-linux-arm armhf
+ gnueabi-linux-arm armel
++gnueabi-linux-armeb armeb
+ gnuabin32-linux-mips64el mipsn32el
+ gnuabin32-linux-mips64 mipsn32
+ gnuabi64-linux-mips64el mips64el
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/arch_pm.patch b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/arch_pm.patch
new file mode 100644
index 000000000..cad4c0f0a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/arch_pm.patch
@@ -0,0 +1,22 @@
+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>
+
+
+--- a/scripts/Dpkg/Arch.pm
++++ b/scripts/Dpkg/Arch.pm
+@@ -233,9 +233,6 @@ sub read_triplettable()
+ (my $dt = $debtriplet) =~ s/<cpu>/$_cpu/;
+ (my $da = $debarch) =~ s/<cpu>/$_cpu/;
+
+- next if exists $debarch_to_debtriplet{$da}
+- or exists $debtriplet_to_debarch{$dt};
+-
+ $debarch_to_debtriplet{$da} = $dt;
+ $debtriplet_to_debarch{$dt} = $da;
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/dpkg-configure.service b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/dpkg-configure.service
new file mode 100644
index 000000000..f0b0789e4
--- /dev/null
+++ b/import-layers/yocto-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 disable dpkg-configure.service
+StandardOutput=syslog
+RemainAfterExit=No
+
+[Install]
+WantedBy=basic.target
+WantedBy=sysinit.target
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/fix-abs-redefine.patch b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/fix-abs-redefine.patch
new file mode 100644
index 000000000..e73311c29
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/fix-abs-redefine.patch
@@ -0,0 +1,40 @@
+Upstream-Status: Pending
+
+dpkg defines:
+#define DPKG_BEGIN_DECLS extern "C" {
+
+That makes header cstdlib included in a extern "C" block which is not supported
+by gcc 4.8. It fails on Fedora 19:
+
+/usr/include/c++/4.8.1/cstdlib: In function â€long long int std::abs(long long int)’:
+/usr/include/c++/4.8.1/cstdlib:174:20: error: declaration of C function â€long long int std::abs(long long int)’ conflicts with
+ abs(long long __x) { return __builtin_llabs (__x); }
+ ^
+/usr/include/c++/4.8.1/cstdlib:166:3: error: previous declaration â€long int std::abs(long int)’ here
+ abs(long __i) { return __builtin_labs(__i); }
+ ^
+
+Move include gettext.h out of the extern "C" block to fix this issue.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+--- dpkg-1.17.1/lib/dpkg/i18n.h.orig 2013-08-13 17:31:28.870935573 +0800
++++ dpkg-1.17.1/lib/dpkg/i18n.h 2013-08-13 17:31:37.893065249 +0800
+@@ -23,8 +23,6 @@
+
+ #include <dpkg/macros.h>
+
+-DPKG_BEGIN_DECLS
+-
+ /**
+ * @defgroup i18n Internationalization support
+ * @ingroup dpkg-internal
+@@ -33,6 +31,8 @@
+
+ #include <gettext.h>
+
++DPKG_BEGIN_DECLS
++
+ /* We need to include this because pgettext() uses LC_MESSAGES, but libintl.h
+ * which gets pulled by gettext.h only includes it if building optimized. */
+ #include <locale.h>
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/glibc2.5-sync_file_range.patch b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/glibc2.5-sync_file_range.patch
new file mode 100644
index 000000000..d56b8a69a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/glibc2.5-sync_file_range.patch
@@ -0,0 +1,86 @@
+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(-)
+
+--- a/src/archives.c
++++ b/src/archives.c
+@@ -75,7 +75,7 @@
+ /* 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);
+@@ -1179,7 +1179,7 @@
+ 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)
+ {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/noman.patch b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/noman.patch
new file mode 100644
index 000000000..d30c15018
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/noman.patch
@@ -0,0 +1,14 @@
+Upstream-Status: Inappropriate [disable feature]
+
+diff -ruN dpkg-1.15.8.5-orig/Makefile.am dpkg-1.15.8.5/Makefile.am
+--- dpkg-1.15.8.5-orig/Makefile.am 2010-10-08 12:27:15.042083703 +0800
++++ dpkg-1.15.8.5/Makefile.am 2010-10-08 12:27:27.755148228 +0800
+@@ -12,8 +12,7 @@
+ utils \
+ $(MAYBE_DSELECT) \
+ scripts \
+- po \
+- man
++ po
+
+ ACLOCAL_AMFLAGS = -I m4
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/remove-tar-no-timestamp.patch b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/remove-tar-no-timestamp.patch
new file mode 100644
index 000000000..4f408ff77
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg_1.18.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg_1.18.4.bb
new file mode 100644
index 000000000..7876944d6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg_1.18.4.bb
@@ -0,0 +1,20 @@
+require dpkg.inc
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+SRC_URI_append_class-native =" file://glibc2.5-sync_file_range.patch "
+SRC_URI += "file://noman.patch \
+ file://remove-tar-no-timestamp.patch \
+ file://fix-abs-redefine.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 \
+ "
+
+SRC_URI[md5sum] = "e95b513c89693f6ec3ab53b6b1c3defd"
+SRC_URI[sha256sum] = "fe89243868888ce715bf45861f26264f767d4e4dbd0d6f1a26ce60bbbbf106da"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs.inc b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs.inc
new file mode 100644
index 000000000..09e4ea5bb
--- /dev/null
+++ b/import-layers/yocto-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://COPYING;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"
+
+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/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch
new file mode 100644
index 000000000..656fb6efb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch
@@ -0,0 +1,34 @@
+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>
+---
+ misc/mke2fs.conf.in | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/misc/mke2fs.conf.in b/misc/mke2fs.conf.in
+index a049d61..106ee80 100644
+--- a/misc/mke2fs.conf.in
++++ b/misc/mke2fs.conf.in
+@@ -11,7 +11,8 @@
+ features = has_journal
+ }
+ ext4 = {
+- features = has_journal,extent,huge_file,flex_bg,metadata_csum,64bit,dir_nlink,extra_isize
++ features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize
++ auto_64-bit_support = 1
+ inode_size = 256
+ }
+ ext4dev = {
+--
+2.7.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/acinclude.m4 b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/acinclude.m4
new file mode 100644
index 000000000..c0bd7dbde
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/acinclude.m4
@@ -0,0 +1,135 @@
+# Extracted from the package's shipped aclocal.m4. Custom macros should be in
+# acinclude.m4 so running aclocal doesn't blow them away.
+#
+# Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+# from http://autoconf-archive.cryp.to/ax_tls.html
+#
+# This was licensed under the GPL with the following exception:
+#
+# 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 distributing such scripts, even though
+# portions of the text of the Macro appear in them. The GNU General
+# Public License (GPL) does govern all other use of the material that
+# constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the
+# Autoconf Macro released by the Autoconf Macro 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.
+#
+AC_DEFUN([AX_TLS], [
+ AC_MSG_CHECKING(for thread local storage (TLS) class)
+ AC_CACHE_VAL(ac_cv_tls, [
+ ax_tls_keywords="__thread __declspec(thread) none"
+ for ax_tls_keyword in $ax_tls_keywords; do
+ case $ax_tls_keyword in
+ none) ac_cv_tls=none ; break ;;
+ *)
+ AC_TRY_COMPILE(
+ [#include <stdlib.h>
+ static void
+ foo(void) {
+ static ] $ax_tls_keyword [ int bar;
+ exit(1);
+ }],
+ [],
+ [ac_cv_tls=$ax_tls_keyword ; break],
+ ac_cv_tls=none
+ )
+ esac
+ done
+])
+
+ if test "$ac_cv_tls" != "none"; then
+ dnl AC_DEFINE([TLS], [], [If the compiler supports a TLS storage class define it to that here])
+ AC_DEFINE_UNQUOTED([TLS], $ac_cv_tls, [If the compiler supports a TLS storage class define it to that here])
+ fi
+ AC_MSG_RESULT($ac_cv_tls)
+])
+
+# ===========================================================================
+# http://www.nongnu.org/autoconf-archive/check_gnu_make.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# CHECK_GNU_MAKE()
+#
+# DESCRIPTION
+#
+# This macro searches for a GNU version of make. If a match is found, the
+# makefile variable `ifGNUmake' is set to the empty string, otherwise it
+# is set to "#". This is useful for including a special features in a
+# Makefile, which cannot be handled by other versions of make. The
+# variable _cv_gnu_make_command is set to the command to invoke GNU make
+# if it exists, the empty string otherwise.
+#
+# Here is an example of its use:
+#
+# Makefile.in might contain:
+#
+# # A failsafe way of putting a dependency rule into a makefile
+# $(DEPEND):
+# $(CC) -MM $(srcdir)/*.c > $(DEPEND)
+#
+# @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
+# @ifGNUmake@ include $(DEPEND)
+# @ifGNUmake@ endif
+#
+# Then configure.in would normally contain:
+#
+# CHECK_GNU_MAKE()
+# AC_OUTPUT(Makefile)
+#
+# Then perhaps to cause gnu make to override any other make, we could do
+# something like this (note that GNU make always looks for GNUmakefile
+# first):
+#
+# if ! test x$_cv_gnu_make_command = x ; then
+# mv Makefile GNUmakefile
+# echo .DEFAULT: > Makefile ;
+# echo \ $_cv_gnu_make_command \$@ >> Makefile;
+# fi
+#
+# Then, if any (well almost any) other make is called, and GNU make also
+# exists, then the other make wraps the GNU make.
+#
+# LICENSE
+#
+# Copyright (c) 2008 John Darrington <j.darrington@elvis.murdoch.edu.au>
+#
+# 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.
+#
+# Note: Modified by Ted Ts'o to add @ifNotGNUMake@
+
+AC_DEFUN(
+ [CHECK_GNU_MAKE], [ AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
+ _cv_gnu_make_command='' ;
+dnl Search all the common names for GNU make
+ for a in "$MAKE" make gmake gnumake ; do
+ if test -z "$a" ; then continue ; fi ;
+ if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null ) ; then
+ _cv_gnu_make_command=$a ;
+ break;
+ fi
+ done ;
+ ) ;
+dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise
+ if test "x$_cv_gnu_make_command" != "x" ; then
+ ifGNUmake='' ;
+ ifNotGNUmake='#' ;
+ else
+ ifGNUmake='#' ;
+ ifNotGNUmake='' ;
+ AC_MSG_RESULT("Not found");
+ fi
+ AC_SUBST(ifGNUmake)
+ AC_SUBST(ifNotGNUmake)
+] )
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/mkdir.patch b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/mkdir.patch
new file mode 100644
index 000000000..2a3aeff61
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/mkdir.patch
@@ -0,0 +1,18 @@
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Mei Lei <lei.mei@intel.com>
+
+diff --git a/configure.ac b/configure.ac
+index c1fe224..f5ac628 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1374,7 +1374,8 @@ if test -n "$WITH_DIET_LIBC" ; then
+ INCLUDES="$INCLUDES -D_REENTRANT"
+ fi
+ AC_SUBST(INCLUDES)
+-AM_MKINSTALLDIRS
++MKINSTALLDIRS="mkdir -p"
++AC_SUBST(MKINSTALLDIRS)
+ dnl
+ dnl Build CFLAGS
+ dnl
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/ptest.patch b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/ptest.patch
new file mode 100644
index 000000000..ef1ce5872
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/ptest.patch
@@ -0,0 +1,67 @@
+diff --git a/tests/Makefile.in b/tests/Makefile.in
+index 60cf655..ce220f1 100644
+--- a/tests/Makefile.in
++++ b/tests/Makefile.in
+@@ -18,7 +18,7 @@ test_one: $(srcdir)/test_one.in Makefile mke2fs.conf
+ @echo "#!/bin/sh" > test_one
+ @echo "HTREE=y" >> test_one
+ @echo "QUOTA=y" >> test_one
+- @echo "SRCDIR=@srcdir@" >> test_one
++ @echo "SRCDIR=/usr/lib/e2fsprogs/ptest/test" >> test_one
+ @echo "DIFF_OPTS=@UNI_DIFF_OPTS@" >> test_one
+ @cat $(srcdir)/test_one.in >> test_one
+ @chmod +x test_one
+@@ -26,7 +26,7 @@ test_one: $(srcdir)/test_one.in Makefile mke2fs.conf
+ 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=/usr/lib/e2fsprogs/ptest/test" >> test_script
+ @cat $(srcdir)/test_script.in >> test_script
+ @chmod +x test_script
+
+diff --git a/tests/test_config b/tests/test_config
+index 7f39157..c815a44 100644
+--- a/tests/test_config
++++ b/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}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/quiet-debugfs.patch b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/quiet-debugfs.patch
new file mode 100644
index 000000000..830e9d57a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/remove.ldconfig.call.patch b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/remove.ldconfig.call.patch
new file mode 100644
index 000000000..f3e6eb778
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/run-ptest b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/run-ptest
new file mode 100644
index 000000000..1ac251324
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/run-ptest
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+cd ./test
+./test_script &>../test.log
+if [ $? -eq 0 ]
+then
+ echo "PASS: e2fsprogs"
+ rm test.log
+else
+ echo "FAIL: e2fsprogs"
+fi
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/xattr_ordering.patch b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/xattr_ordering.patch
new file mode 100644
index 000000000..782a7b187
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/xattr_ordering.patch
@@ -0,0 +1,219 @@
+From: "Darrick J. Wong" <darrick.wong@oracle.com>
+To: tytso@mit.edu, darrick.wong@oracle.com
+Cc: linux-ext4@vger.kernel.org, Darren Hart <dvhart@linux.intel.com>,
+ Richard Purdie <richard.purdie@linuxfoundation.org>
+Date: Sat, 13 Feb 2016 14:38:24 -0800
+Message-ID: <20160213223824.25381.8002.stgit@birch.djwong.org>
+In-Reply-To: <20160213223725.25381.20929.stgit@birch.djwong.org>
+References: <20160213223725.25381.20929.stgit@birch.djwong.org>
+User-Agent: StGit/0.17.1-dirty
+MIME-Version: 1.0
+Content-Type: text/plain; charset="utf-8"
+X-Source-IP: aserv0022.oracle.com [141.146.126.234]
+X-Evolution-Source: 1358860361.4566.33@ted
+Content-Transfer-Encoding: 8bit
+
+Richard Purdie reports that libext2fs doesn't sort attribute keys in
+the xattr block correctly, causing the kernel to return -ENODATA when
+querying attributes that should be there. Therefore, sort attributes
+so that whatever ends up in the xattr block is sorted according to
+what the kernel expects.
+
+Cc: Darren Hart <dvhart@linux.intel.com>
+Reported-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
+---
+ lib/ext2fs/ext_attr.c | 24 +++++++++++-
+ tests/d_xattr_sorting/expect | 29 ++++++++++++++
+ tests/d_xattr_sorting/name | 1
+ tests/d_xattr_sorting/script | 86 ++++++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 139 insertions(+), 1 deletion(-)
+ create mode 100644 tests/d_xattr_sorting/expect
+ create mode 100644 tests/d_xattr_sorting/name
+ create mode 100644 tests/d_xattr_sorting/script
+
+Upstream-Status: Submitted
+
+
+diff --git a/lib/ext2fs/ext_attr.c b/lib/ext2fs/ext_attr.c
+index 0a4f8c0..b121837 100644
+--- a/lib/ext2fs/ext_attr.c
++++ b/lib/ext2fs/ext_attr.c
+@@ -254,10 +254,15 @@ static struct ea_name_index ea_names[] = {
+ {0, NULL},
+ };
+
++static int find_ea_index(char *fullname, char **name, int *index);
++
+ /* Push empty attributes to the end and inlinedata to the front. */
+ static int attr_compare(const void *a, const void *b)
+ {
+ const struct ext2_xattr *xa = a, *xb = b;
++ char *xa_suffix, *xb_suffix;
++ int xa_idx, xb_idx;
++ int cmp;
+
+ if (xa->name == NULL)
+ return +1;
+@@ -267,7 +272,24 @@ static int attr_compare(const void *a, const void *b)
+ return -1;
+ else if (!strcmp(xb->name, "system.data"))
+ return +1;
+- return 0;
++
++ /*
++ * Duplicate the kernel's sorting algorithm because xattr blocks
++ * require sorted keys.
++ */
++ xa_suffix = xa->name;
++ xb_suffix = xb->name;
++ xa_idx = xb_idx = 0;
++ find_ea_index(xa->name, &xa_suffix, &xa_idx);
++ find_ea_index(xb->name, &xb_suffix, &xb_idx);
++ cmp = xa_idx - xb_idx;
++ if (cmp)
++ return cmp;
++ cmp = strlen(xa_suffix) - strlen(xb_suffix);
++ if (cmp)
++ return cmp;
++ cmp = strcmp(xa_suffix, xb_suffix);
++ return cmp;
+ }
+
+ static const char *find_ea_prefix(int index)
+diff --git a/tests/d_xattr_sorting/expect b/tests/d_xattr_sorting/expect
+new file mode 100644
+index 0000000..17da663
+--- /dev/null
++++ b/tests/d_xattr_sorting/expect
+@@ -0,0 +1,29 @@
++debugfs sort extended attributes
++mke2fs -Fq -b 1024 test.img 512
++Exit status is 0
++ea_set / security.SMEG64 -f /tmp/b
++Exit status is 0
++ea_set / security.imb -f /tmp/b
++Exit status is 0
++ea_set / user.moo cow
++Exit status is 0
++ea_list /
++Extended attributes:
++ user.moo = "cow" (3)
++ security.imb = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" (256)
++ security.SMEG64 = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" (256)
++Exit status is 0
++ea_get / security.imb
++xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
++Exit status is 0
++ea_get / nosuchea
++ea_get: Extended attribute key not found while getting extended attribute
++Exit status is 0
++e2fsck -yf -N test_filesys
++Pass 1: Checking inodes, blocks, and sizes
++Pass 2: Checking directory structure
++Pass 3: Checking directory connectivity
++Pass 4: Checking reference counts
++Pass 5: Checking group summary information
++test_filesys: 11/64 files (0.0% non-contiguous), 29/512 blocks
++Exit status is 0
+diff --git a/tests/d_xattr_sorting/name b/tests/d_xattr_sorting/name
+new file mode 100644
+index 0000000..dde8926
+--- /dev/null
++++ b/tests/d_xattr_sorting/name
+@@ -0,0 +1 @@
++sort extended attributes in debugfs
+diff --git a/tests/d_xattr_sorting/script b/tests/d_xattr_sorting/script
+new file mode 100644
+index 0000000..30c189a
+--- /dev/null
++++ b/tests/d_xattr_sorting/script
+@@ -0,0 +1,86 @@
++if test -x $DEBUGFS_EXE; then
++
++OUT=$test_name.log
++EXP=$test_dir/expect
++VERIFY_FSCK_OPT=-yf
++
++TEST_DATA=$test_name.tmp
++VERIFY_DATA=$test_name.ver.tmp
++
++echo "debugfs sort extended attributes" > $OUT
++
++dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
++
++echo "mke2fs -Fq -b 1024 test.img 512" >> $OUT
++
++$MKE2FS -Fq $TMPFILE 512 > /dev/null 2>&1
++status=$?
++echo Exit status is $status >> $OUT
++
++perl -e 'print "x" x 256;' > /tmp/b
++
++echo "ea_set / security.SMEG64 -f /tmp/b" > $OUT.new
++$DEBUGFS -w -R "ea_set / security.SMEG64 -f /tmp/b" $TMPFILE >> $OUT.new 2>&1
++status=$?
++echo Exit status is $status >> $OUT.new
++sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
++
++echo "ea_set / security.imb -f /tmp/b" > $OUT.new
++$DEBUGFS -w -R "ea_set / security.imb -f /tmp/b" $TMPFILE >> $OUT.new 2>&1
++status=$?
++echo Exit status is $status >> $OUT.new
++sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
++
++echo "ea_set / user.moo cow" > $OUT.new
++$DEBUGFS -w -R "ea_set / user.moo cow" $TMPFILE >> $OUT.new 2>&1
++status=$?
++echo Exit status is $status >> $OUT.new
++sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
++
++rm -rf /tmp/b
++
++echo "ea_list /" > $OUT.new
++$DEBUGFS -w -R "ea_list /" $TMPFILE >> $OUT.new 2>&1
++status=$?
++echo Exit status is $status >> $OUT.new
++sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
++
++echo "ea_get / security.imb" > $OUT.new
++$DEBUGFS -w -R "ea_get / security.imb" $TMPFILE >> $OUT.new 2>&1
++status=$?
++echo Exit status is $status >> $OUT.new
++sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
++
++echo "ea_get / nosuchea" > $OUT.new
++$DEBUGFS -w -R "ea_get / nosuchea" $TMPFILE >> $OUT.new 2>&1
++status=$?
++echo Exit status is $status >> $OUT.new
++sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
++
++echo e2fsck $VERIFY_FSCK_OPT -N test_filesys > $OUT.new
++$FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
++status=$?
++echo Exit status is $status >> $OUT.new
++sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
++
++#
++# Do the verification
++#
++
++rm -f $TMPFILE $OUT.new
++cmp -s $OUT $EXP
++status=$?
++
++if [ "$status" = 0 ] ; then
++ echo "$test_name: $test_description: ok"
++ touch $test_name.ok
++else
++ echo "$test_name: $test_description: failed"
++ diff $DIFF_OPTS $EXP $OUT > $test_name.failed
++fi
++
++unset VERIFY_FSCK_OPT NATIVE_FSCK_OPT OUT EXP TEST_DATA VERIFY_DATA
++
++else #if test -x $DEBUGFS_EXE; then
++ echo "$test_name: $test_description: skipped"
++fi
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs_git.bb
new file mode 100644
index 000000000..9cde8e46b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs_git.bb
@@ -0,0 +1,111 @@
+require e2fsprogs.inc
+
+SRC_URI += "file://acinclude.m4 \
+ file://remove.ldconfig.call.patch \
+ file://quiet-debugfs.patch \
+ file://run-ptest \
+ file://ptest.patch \
+ file://mkdir.patch \
+ file://xattr_ordering.patch \
+ file://Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch \
+"
+
+SRCREV = "0f26747167cc9d82df849b0aad387bf824f04544"
+PV = "1.42.99+1.43+git${SRCPV}"
+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'
+
+do_configure_prepend () {
+ cp ${WORKDIR}/acinclude.m4 ${S}/
+}
+
+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}/
+}
+
+# Need to find the right mke2fs.conf file
+e2fsprogs_conf_fixup () {
+ for i in mke2fs mkfs.ext2 mkfs.ext3 mkfs.ext4 mkfs.ext4dev; do
+ create_wrapper ${D}${base_sbindir}/$i MKE2FS_CONFIG=${sysconfdir}/mke2fs.conf
+ done
+}
+
+do_install_append_class-target() {
+ # Clean host path in compile_et, mk_cmds
+ sed -i -e "s,ET_DIR=\"${S}/lib/et\",ET_DIR=\"${datadir}/et\",g" ${D}${bindir}/compile_et
+ sed -i -e "s,SS_DIR=\"${S}/lib/ss\",SS_DIR=\"${datadir}/ss\",g" ${D}${bindir}/mk_cmds
+}
+
+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"
+
+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 -a ${B}/tests ${D}${PTEST_PATH}/test
+ cp -a ${S}/tests/* ${D}${PTEST_PATH}/test
+ sed -e 's!../e2fsck/e2fsck!e2fsck!g' -i ${D}${PTEST_PATH}/test/*/expect*
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/arm_backend.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/arm_backend.diff
new file mode 100644
index 000000000..d4e4675ad
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/arm_backend.diff
@@ -0,0 +1,449 @@
+Upstream-Status: Backport
+
+Index: elfutils-0.146/backends/arm_init.c
+===================================================================
+--- elfutils-0.146.orig/backends/arm_init.c 2009-04-21 14:50:01.000000000 +0000
++++ elfutils-0.146/backends/arm_init.c 2010-04-24 10:11:13.000000000 +0000
+@@ -32,21 +32,32 @@
+ #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, machine, eh, ehlen)
+- Elf *elf __attribute__ ((unused));
++ 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);
+@@ -58,7 +69,10 @@
+ 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;
+
+ return MODVERSION;
+ }
+Index: elfutils-0.146/backends/arm_regs.c
+===================================================================
+--- elfutils-0.146.orig/backends/arm_regs.c 2009-04-21 14:50:01.000000000 +0000
++++ elfutils-0.146/backends/arm_regs.c 2010-04-24 10:11:13.000000000 +0000
+@@ -28,6 +28,7 @@
+ #endif
+
+ #include <string.h>
++#include <stdio.h>
+ #include <dwarf.h>
+
+ #define BACKEND arm_
+@@ -58,7 +59,15 @@
+ namelen = 2;
+ break;
+
+- case 10 ... 12:
++ case 10 ... 11:
++ name[0] = 'r';
++ name[1] = '1';
++ name[2] = regno % 10 + '0';
++ namelen = 3;
++ break;
++
++ case 12:
++ *type = DW_ATE_unsigned;
+ name[0] = 'r';
+ name[1] = '1';
+ name[2] = regno % 10 + '0';
+@@ -73,6 +82,9 @@
+ 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:
+@@ -84,11 +96,139 @@
+ 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 = "special";
+ *type = DW_ATE_unsigned;
+ return stpcpy (name, "spsr") + 1 - name;
+
++ case 129:
++ *setname = "special";
++ *type = DW_ATE_unsigned;
++ return stpcpy(name, "spsr_fiq") + 1 - name;
++
++ case 130:
++ *setname = "special";
++ *type = DW_ATE_unsigned;
++ return stpcpy(name, "spsr_irq") + 1 - name;
++
++ case 131:
++ *setname = "special";
++ *type = DW_ATE_unsigned;
++ return stpcpy(name, "spsr_abt") + 1 - name;
++
++ case 132:
++ *setname = "special";
++ *type = DW_ATE_unsigned;
++ return stpcpy(name, "spsr_und") + 1 - name;
++
++ case 133:
++ *setname = "special";
++ *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: elfutils-0.146/backends/arm_retval.c
+===================================================================
+--- elfutils-0.146.orig/backends/arm_retval.c 2010-01-12 16:57:54.000000000 +0000
++++ elfutils-0.146/backends/arm_retval.c 2010-04-24 10:11:13.000000000 +0000
+@@ -45,6 +45,13 @@
+ #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. */
+@@ -55,8 +62,9 @@
+ #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. */
+@@ -109,14 +117,31 @@
+ 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:
+ *locp = loc_intreg;
+ return size <= 4 ? nloc_intreg : nloc_intregs ((size + 3) / 4);
+ }
++ /* fall through. */
+
+ aggregate:
++ /* XXX TODO sometimes aggregates are returned in r0 (-mabi=aapcs) */
+ *locp = loc_aggregate;
+ return nloc_aggregate;
+
+@@ -135,3 +160,18 @@
+ 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: elfutils-0.146/libelf/elf.h
+===================================================================
+--- elfutils-0.146.orig/libelf/elf.h 2010-04-24 10:11:11.000000000 +0000
++++ elfutils-0.146/libelf/elf.h 2010-04-24 10:11:13.000000000 +0000
+@@ -2290,6 +2290,9 @@
+ #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. */
+@@ -2307,12 +2310,19 @@
+
+ /* 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
+
+ /* ARM relocs. */
+
+@@ -2344,12 +2354,75 @@
+ #define R_ARM_GOTPC 25 /* 32 bit PC relative offset to GOT */
+ #define R_ARM_GOT32 26 /* 32 bit GOT entry */
+ #define R_ARM_PLT32 27 /* 32 bit PLT address */
++#define R_ARM_CALL 28
++#define R_ARM_JUMP24 29
++#define R_ARM_THM_JUMP24 30
++#define R_ARM_BASE_ABS 31
+ #define R_ARM_ALU_PCREL_7_0 32
+ #define R_ARM_ALU_PCREL_15_8 33
+ #define R_ARM_ALU_PCREL_23_15 34
+ #define R_ARM_LDR_SBREL_11_0 35
+ #define R_ARM_ALU_SBREL_19_12 36
+ #define R_ARM_ALU_SBREL_27_20 37
++#define R_ARM_TARGET1 38
++#define R_ARM_SBREL31 39
++#define R_ARM_V4BX 40
++#define R_ARM_TARGET2 41
++#define R_ARM_PREL31 42
++#define R_ARM_MOVW_ABS_NC 43
++#define R_ARM_MOVT_ABS 44
++#define R_ARM_MOVW_PREL_NC 45
++#define R_ARM_MOVT_PREL 46
++#define R_ARM_THM_MOVW_ABS_NC 47
++#define R_ARM_THM_MOVT_ABS 48
++#define R_ARM_THM_MOVW_PREL_NC 49
++#define R_ARM_THM_MOVT_PREL 50
++#define R_ARM_THM_JUMP19 51
++#define R_ARM_THM_JUMP6 52
++#define R_ARM_THM_ALU_PREL_11_0 53
++#define R_ARM_THM_PC12 54
++#define R_ARM_ABS32_NOI 55
++#define R_ARM_REL32_NOI 56
++#define R_ARM_ALU_PC_G0_NC 57
++#define R_ARM_ALU_PC_G0 58
++#define R_ARM_ALU_PC_G1_NC 59
++#define R_ARM_ALU_PC_G1 60
++#define R_ARM_ALU_PC_G2 61
++#define R_ARM_LDR_PC_G1 62
++#define R_ARM_LDR_PC_G2 63
++#define R_ARM_LDRS_PC_G0 64
++#define R_ARM_LDRS_PC_G1 65
++#define R_ARM_LDRS_PC_G2 66
++#define R_ARM_LDC_PC_G0 67
++#define R_ARM_LDC_PC_G1 68
++#define R_ARM_LDC_PC_G2 69
++#define R_ARM_ALU_SB_G0_NC 70
++#define R_ARM_ALU_SB_G0 71
++#define R_ARM_ALU_SB_G1_NC 72
++#define R_ARM_ALU_SB_G1 73
++#define R_ARM_ALU_SB_G2 74
++#define R_ARM_LDR_SB_G0 75
++#define R_ARM_LDR_SB_G1 76
++#define R_ARM_LDR_SB_G2 77
++#define R_ARM_LDRS_SB_G0 78
++#define R_ARM_LDRS_SB_G1 79
++#define R_ARM_LDRS_SB_G2 80
++#define R_ARM_LDC_G0 81
++#define R_ARM_LDC_G1 82
++#define R_ARM_LDC_G2 83
++#define R_ARM_MOVW_BREL_NC 84
++#define R_ARM_MOVT_BREL 85
++#define R_ARM_MOVW_BREL 86
++#define R_ARM_THM_MOVW_BREL_NC 87
++#define R_ARM_THM_MOVT_BREL 88
++#define R_ARM_THM_MOVW_BREL 89
++/* 90-93 unallocated */
++#define R_ARM_PLT32_ABS 94
++#define R_ARM_GOT_ABS 95
++#define R_ARM_GOT_PREL 96
++#define R_ARM_GOT_BREL12 97
++#define R_ARM_GOTOFF12 98
++#define R_ARM_GOTRELAX 99
+ #define R_ARM_GNU_VTENTRY 100
+ #define R_ARM_GNU_VTINHERIT 101
+ #define R_ARM_THM_PC11 102 /* thumb unconditional branch */
+@@ -2364,6 +2437,12 @@
+ static TLS block offset */
+ #define R_ARM_TLS_LE32 108 /* 32 bit offset relative to static
+ TLS block */
++#define R_ARM_TLS_LDO12 109
++#define R_ARM_TLS_LE12 110
++#define R_ARM_TLS_IE12GP 111
++/* 112 - 127 private range */
++#define R_ARM_ME_TOO 128 /* obsolete */
++
+ #define R_ARM_RXPC25 249
+ #define R_ARM_RSBREL32 250
+ #define R_ARM_THM_RPC22 251
+Index: elfutils-0.146/backends/libebl_arm.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.146/backends/libebl_arm.h 2010-04-24 10:11:13.000000000 +0000
+@@ -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
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elf_additions.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elf_additions.diff
new file mode 100644
index 000000000..5baa70900
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elf_additions.diff
@@ -0,0 +1,71 @@
+Upstream-Status: Backport
+
+Index: elfutils-0.146/libelf/elf.h
+===================================================================
+--- elfutils-0.146.orig/libelf/elf.h 2010-04-24 10:13:50.000000000 +0000
++++ elfutils-0.146/libelf/elf.h 2010-04-24 10:22:43.000000000 +0000
+@@ -143,6 +143,7 @@
+ #define ELFOSABI_HPUX 1 /* HP-UX */
+ #define ELFOSABI_NETBSD 2 /* NetBSD. */
+ #define ELFOSABI_LINUX 3 /* Linux. */
++#define ELFOSABI_HURD 4 /* GNU/Hurd */
+ #define ELFOSABI_SOLARIS 6 /* Sun Solaris. */
+ #define ELFOSABI_AIX 7 /* IBM AIX. */
+ #define ELFOSABI_IRIX 8 /* SGI Irix. */
+@@ -150,8 +151,13 @@
+ #define ELFOSABI_TRU64 10 /* Compaq TRU64 UNIX. */
+ #define ELFOSABI_MODESTO 11 /* Novell Modesto. */
+ #define ELFOSABI_OPENBSD 12 /* OpenBSD. */
++#define ELFOSABI_OPENVMS 13 /* OpenVMS */
++#define ELFOSABI_NSK 14 /* Hewlett-Packard Non-Stop Kernel */
++#define ELFOSABI_AROS 15 /* Amiga Research OS */
++/* 64-255 Architecture-specific value range */
+ #define ELFOSABI_ARM_AEABI 64 /* ARM EABI */
+ #define ELFOSABI_ARM 97 /* ARM */
++/* This is deprecated? It's not in the latest version anymore. */
+ #define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */
+
+ #define EI_ABIVERSION 8 /* ABI version */
+@@ -206,7 +212,7 @@
+ #define EM_H8_300H 47 /* Hitachi H8/300H */
+ #define EM_H8S 48 /* Hitachi H8S */
+ #define EM_H8_500 49 /* Hitachi H8/500 */
+-#define EM_IA_64 50 /* Intel Merced */
++#define EM_IA_64 50 /* Intel IA64 */
+ #define EM_MIPS_X 51 /* Stanford MIPS-X */
+ #define EM_COLDFIRE 52 /* Motorola Coldfire */
+ #define EM_68HC12 53 /* Motorola M68HC12 */
+@@ -220,7 +226,8 @@
+ #define EM_TINYJ 61 /* Advanced Logic Corp. Tinyj emb.fam*/
+ #define EM_X86_64 62 /* AMD x86-64 architecture */
+ #define EM_PDSP 63 /* Sony DSP Processor */
+-
++#define EM_PDP10 64 /* Digital Equipment Corp. PDP-10 */
++#define EM_PDP11 65 /* Digital Equipment Corp. PDP-11 */
+ #define EM_FX66 66 /* Siemens FX66 microcontroller */
+ #define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 mc */
+ #define EM_ST7 68 /* STmicroelectronics ST7 8 bit mc */
+@@ -250,7 +257,22 @@
+ #define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */
+ #define EM_ARC_A5 93 /* ARC Cores Tangent-A5 */
+ #define EM_XTENSA 94 /* Tensilica Xtensa Architecture */
+-#define EM_NUM 95
++#define EM_VIDEOCORE 95 /* Alphamosaic VideoCore processor */
++#define EM_TMM_GPP 96 /* Thompson Multimedia General Purpose Processor */
++#define EM_NS32K 97 /* National Semiconductor 32000 series */
++#define EM_TPC 98 /* Tenor Network TPC processor */
++#define EM_SNP1K 99 /* Trebia SNP 1000 processor */
++#define EM_ST200 100 /* STMicroelectronics (www.st.com) ST200 microcontroller */
++#define EM_IP2K 101 /* Ubicom IP2XXX microcontroller family */
++#define EM_MAX 102 /* MAX Processor */
++#define EM_CR 103 /* National Semiconductor CompactRISC */
++#define EM_F2MC16 104 /* Fujitsu F2MC16 */
++#define EM_MSP430 105 /* TI msp430 micro controller */
++#define EM_BLACKFIN 106 /* Analog Devices Blackfin (DSP) processor */
++#define EM_SE_C33 107 /* S1C33 Family of Seiko Epson processors */
++#define EM_SEP 108 /* Sharp embedded microprocessor */
++#define EM_ARCA 109 /* Arca RISC Microprocessor */
++#define EM_NUM 110
+
+ /* If it is necessary to assign new unofficial EM_* values, please
+ pick large random numbers (0x8523, 0xa7f2, etc.) to minimize the
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elf_begin.c-CVE-2014-9447-fix.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elf_begin.c-CVE-2014-9447-fix.patch
new file mode 100644
index 000000000..deba45fa8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elf_begin.c-CVE-2014-9447-fix.patch
@@ -0,0 +1,37 @@
+From 323ca04a0c9189544075c19b49da67f6443a8950 Mon Sep 17 00:00:00 2001
+From: Li xin <lixin.fnst@cn.fujitsu.com>
+Date: Wed, 21 Jan 2015 09:33:38 +0900
+Subject: [PATCH] elf_begin.c: CVE-2014-9447 fix
+
+this patch is from:
+ https://git.fedorahosted.org/cgit/elfutils.git/commit/?id=147018e729e7c22eeabf15b82d26e4bf68a0d18e
+
+Upstream-Status: Backport
+CVE: CVE-2014-9447
+
+Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
+---
+ libelf/elf_begin.c | 7 ++-----
+ 1 file changed, 2 insertions(+), 5 deletions(-)
+
+diff --git a/libelf/elf_begin.c b/libelf/elf_begin.c
+index e46add3..e83ba35 100644
+--- a/libelf/elf_begin.c
++++ b/libelf/elf_begin.c
+@@ -736,11 +736,8 @@ read_long_names (Elf *elf)
+ break;
+
+ /* NUL-terminate the string. */
+- *runp = '\0';
+-
+- /* Skip the NUL byte and the \012. */
+- runp += 2;
+-
++ *runp++ = '\0';
++
+ /* A sanity check. Somebody might have generated invalid
+ archive. */
+ if (runp >= newp + len)
+--
+1.8.4.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elfutils-ar-c-fix-num-passed-to-memset.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elfutils-ar-c-fix-num-passed-to-memset.patch
new file mode 100644
index 000000000..b619619ec
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elfutils-ar-c-fix-num-passed-to-memset.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Backport
+
+ar.c (do_oper_delete): Fix num passed to memset
+native build failed as following on Fedora18+:
+ar.c: In function 'do_oper_delete':
+ar.c:918:31: error: argument to 'sizeof' in 'memset' call is the same expression as the destination; did you mean to dereference it? [-Werror=sizeof-pointer-memaccess]
+ memset (found, '\0', sizeof (found));
+ ^
+The original commit is http://git.fedorahosted.org/cgit/elfutils.git/commit/src/ar.c?id=1a4d0668d18bf1090c5c08cdb5cb3ba2b8eb5410
+
+Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com>
+
+--- elfutils-0.148/src/ar.c.org 2013-03-12 21:12:17.928281375 -0500
++++ elfutils-0.148/src/ar.c 2013-03-12 21:15:30.053285271 -0500
+@@ -915,7 +915,7 @@
+ long int instance)
+ {
+ bool *found = alloca (sizeof (bool) * argc);
+- memset (found, '\0', sizeof (found));
++ memset (found, '\0', sizeof (bool) * argc);
+
+ /* List of the files we keep. */
+ struct armem *to_copy = NULL;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elfutils-fsize.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elfutils-fsize.patch
new file mode 100644
index 000000000..0ff353d0d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elfutils-fsize.patch
@@ -0,0 +1,39 @@
+Upstream-Status: Backport
+
+The ELF_T_LIB and ELF_T_GNUHASH sizes were missing from fsize table.
+
+This could cause a failure in the elf*_xlatetof function.
+
+diff -ur elfutils-0.148.orig/libelf/exttypes.h elfutils-0.148/libelf/exttypes.h
+--- elfutils-0.148.orig/libelf/exttypes.h 2009-01-08 12:56:37.000000000 -0800
++++ elfutils-0.148/libelf/exttypes.h 2010-08-18 14:00:33.000000000 -0700
+@@ -94,6 +94,7 @@
+ Vernaux32 (Ext_);
+ Syminfo32 (Ext_);
+ Move32 (Ext_);
++Lib32 (Ext_);
+ auxv_t32 (Ext_);
+
+ Ehdr64 (Ext_);
+@@ -110,6 +111,7 @@
+ Vernaux64 (Ext_);
+ Syminfo64 (Ext_);
+ Move64 (Ext_);
++Lib64 (Ext_);
+ auxv_t64 (Ext_);
+
+ #undef START
+diff -ur elfutils-0.148.orig/libelf/gelf_fsize.c elfutils-0.148/libelf/gelf_fsize.c
+--- elfutils-0.148.orig/libelf/gelf_fsize.c 2009-01-08 12:56:37.000000000 -0800
++++ elfutils-0.148/libelf/gelf_fsize.c 2010-08-18 14:11:57.000000000 -0700
+@@ -87,7 +87,9 @@
+ [ELF_T_NHDR] = sizeof (ElfW2(LIBELFBITS, Ext_Nhdr)), \
+ [ELF_T_SYMINFO] = sizeof (ElfW2(LIBELFBITS, Ext_Syminfo)), \
+ [ELF_T_MOVE] = sizeof (ElfW2(LIBELFBITS, Ext_Move)), \
+- [ELF_T_AUXV] = sizeof (ElfW2(LIBELFBITS, Ext_auxv_t))
++ [ELF_T_LIB] = sizeof (ElfW2(LIBELFBITS, Ext_Lib)), \
++ [ELF_T_AUXV] = sizeof (ElfW2(LIBELFBITS, Ext_auxv_t)), \
++ [ELF_T_GNUHASH] = ELFW2(LIBELFBITS, FSZ_WORD)
+ TYPE_SIZES (32)
+ },
+ [ELFCLASS64 - 1] = {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/fix-build-gcc-4.8.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/fix-build-gcc-4.8.patch
new file mode 100644
index 000000000..0e2869020
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/fix-build-gcc-4.8.patch
@@ -0,0 +1,57 @@
+This patch fixes a warning seen with gcc 4.8 (especially on ubuntu 13.10)
+
+| addr2line.c: In function 'handle_address':
+| addr2line.c:450:7: error: format '%a' expects argument of type 'float *', but argument 3 has type 'char **' [-Werror=format=]
+| if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
+| ^
+| addr2line.c:453:7: error: format '%a' expects argument of type 'float *', but argument 3 has type 'char **' [-Werror=format=]
+| switch (sscanf (string, "%a[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
+| ^
+| cc1: all warnings being treated as errors
+
+
+%a is old GNU style and should be abandoned in favor of %m
+
+Also see
+
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54361
+
+to support this assertion
+
+This patch is added via redhat-compatibility patch so lets revert this part
+here.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [Caused by an earlier patch]
+
+Index: elfutils-0.148/src/addr2line.c
+===================================================================
+--- elfutils-0.148.orig/src/addr2line.c 2013-09-23 17:46:45.513586538 -0700
++++ elfutils-0.148/src/addr2line.c 2013-09-23 17:46:46.329586558 -0700
+@@ -447,10 +447,10 @@
+ bool parsed = false;
+ int i, j;
+ char *name = NULL;
+- if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
++ if (sscanf (string, "(%m[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
+ && string[i] == '\0')
+ parsed = adjust_to_section (name, &addr, dwfl);
+- switch (sscanf (string, "%a[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
++ switch (sscanf (string, "%m[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
+ {
+ default:
+ break;
+Index: elfutils-0.148/tests/line2addr.c
+===================================================================
+--- elfutils-0.148.orig/tests/line2addr.c 2013-09-23 17:46:45.521586538 -0700
++++ elfutils-0.148/tests/line2addr.c 2013-09-23 17:46:46.329586558 -0700
+@@ -132,7 +132,7 @@
+ {
+ struct args a = { .arg = argv[cnt] };
+
+- switch (sscanf (a.arg, "%a[^:]:%d", &a.file, &a.line))
++ switch (sscanf (a.arg, "%m[^:]:%d", &a.file, &a.line))
+ {
+ default:
+ case 0:
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/fix_for_gcc-4.7.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/fix_for_gcc-4.7.patch
new file mode 100644
index 000000000..bd634b441
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/fix_for_gcc-4.7.patch
@@ -0,0 +1,73 @@
+Upstream-Status: pending
+gcc 4.7 does not like pointer conversion, so have a void * tmp var to work
+around following compilation issue.
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2011/07/07
+
+| md5.c: In function 'md5_finish_ctx':
+| md5.c:108:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
+| md5.c:109:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
+| cc1: all warnings being treated as errors
+|
+| make[2]: *** [md5.o] Error 1
+| make[2]: *** Waiting for unfinished jobs....
+| sha1.c: In function 'sha1_finish_ctx':
+| sha1.c:109:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
+| sha1.c:111:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
+| cc1: all warnings being treated as errors
+|
+| make[2]: *** [sha1.o] Error 1
+
+Index: elfutils-0.148/lib/md5.c
+===================================================================
+--- elfutils-0.148.orig/lib/md5.c
++++ elfutils-0.148/lib/md5.c
+@@ -95,6 +95,7 @@ md5_finish_ctx (ctx, resbuf)
+ /* Take yet unprocessed bytes into account. */
+ md5_uint32 bytes = ctx->buflen;
+ size_t pad;
++ void * tmp;
+
+ /* Now count remaining bytes. */
+ ctx->total[0] += bytes;
+@@ -105,9 +106,10 @@ md5_finish_ctx (ctx, resbuf)
+ memcpy (&ctx->buffer[bytes], fillbuf, pad);
+
+ /* Put the 64-bit file length in *bits* at the end of the buffer. */
+- *(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3);
+- *(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) |
+- (ctx->total[0] >> 29));
++ tmp = &ctx->buffer[bytes + pad];
++ *(md5_uint32 *) tmp = SWAP (ctx->total[0] << 3);
++ tmp = &ctx->buffer[bytes + pad + 4];
++ *(md5_uint32 *) tmp = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29));
+
+ /* Process last bytes. */
+ md5_process_block (ctx->buffer, bytes + pad + 8, ctx);
+Index: elfutils-0.148/lib/sha1.c
+===================================================================
+--- elfutils-0.148.orig/lib/sha1.c
++++ elfutils-0.148/lib/sha1.c
+@@ -96,6 +96,7 @@ sha1_finish_ctx (ctx, resbuf)
+ /* Take yet unprocessed bytes into account. */
+ sha1_uint32 bytes = ctx->buflen;
+ size_t pad;
++ void * tmp;
+
+ /* Now count remaining bytes. */
+ ctx->total[0] += bytes;
+@@ -106,9 +107,10 @@ sha1_finish_ctx (ctx, resbuf)
+ memcpy (&ctx->buffer[bytes], fillbuf, pad);
+
+ /* Put the 64-bit file length in *bits* at the end of the buffer. */
+- *(sha1_uint32 *) &ctx->buffer[bytes + pad] = SWAP ((ctx->total[1] << 3) |
+- (ctx->total[0] >> 29));
+- *(sha1_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP (ctx->total[0] << 3);
++ tmp = &ctx->buffer[bytes + pad];
++ *(sha1_uint32 *) tmp = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29));
++ tmp = &ctx->buffer[bytes + pad + 4];
++ *(sha1_uint32 *) tmp = SWAP (ctx->total[0] << 3);
+
+ /* Process last bytes. */
+ sha1_process_block (ctx->buffer, bytes + pad + 8, ctx);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/hppa_backend.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/hppa_backend.diff
new file mode 100644
index 000000000..a86b97c68
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/hppa_backend.diff
@@ -0,0 +1,801 @@
+Upstream-Status: Backport
+
+Index: elfutils-0.146/backends/parisc_init.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.146/backends/parisc_init.c 2010-04-24 10:10:50.000000000 +0000
+@@ -0,0 +1,74 @@
++/* 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, machine, eh, ehlen)
++ 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.146/backends/parisc_regs.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.146/backends/parisc_regs.c 2010-04-24 10:10:50.000000000 +0000
+@@ -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.146/backends/parisc_reloc.def
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.146/backends/parisc_reloc.def 2010-04-24 10:10:50.000000000 +0000
+@@ -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.146/backends/parisc_retval.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.146/backends/parisc_retval.c 2010-04-24 10:10:50.000000000 +0000
+@@ -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 || tag == DW_TAG_mutable_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.146/backends/parisc_symbol.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.146/backends/parisc_symbol.c 2010-04-24 10:10:50.000000000 +0000
+@@ -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.146/backends/libebl_parisc.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.146/backends/libebl_parisc.h 2010-04-24 10:10:50.000000000 +0000
+@@ -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.146/backends/Makefile.am
+===================================================================
+--- elfutils-0.146.orig/backends/Makefile.am 2010-04-24 10:10:41.000000000 +0000
++++ elfutils-0.146/backends/Makefile.am 2010-04-24 10:10:50.000000000 +0000
+@@ -29,11 +29,11 @@
+ -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw
+
+
+-modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390
++modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390 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_sparc_pic.a libebl_ppc_pic.a libebl_ppc64_pic.a \
+- libebl_s390_pic.a
++ libebl_s390_pic.a libebl_parisc_pic.a
+ noinst_LIBRARIES = $(libebl_pic)
+ noinst_DATA = $(libebl_pic:_pic.a=.so)
+
+@@ -95,6 +95,9 @@
+ libebl_s390_pic_a_SOURCES = $(s390_SRCS)
+ am_libebl_s390_pic_a_OBJECTS = $(s390_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)
+ @rm -f $(@:.so=.map)
+Index: elfutils-0.146/libelf/elf.h
+===================================================================
+--- elfutils-0.146.orig/libelf/elf.h 2010-04-13 20:08:02.000000000 +0000
++++ elfutils-0.146/libelf/elf.h 2010-04-24 10:10:50.000000000 +0000
+@@ -1789,16 +1789,24 @@
+ #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. */
+@@ -1807,6 +1815,7 @@
+ #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. */
+@@ -1832,6 +1841,8 @@
+ #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/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/i386_dis.h b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/i386_dis.h
new file mode 100644
index 000000000..a5cc01f91
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/i386_dis.h
@@ -0,0 +1,1657 @@
+#define MNEMONIC_BITS 10
+#define SUFFIX_BITS 3
+#define FCT1_BITS 7
+#define STR1_BITS 4
+#define OFF1_1_BITS 7
+#define OFF1_1_BIAS 3
+#define OFF1_2_BITS 7
+#define OFF1_2_BIAS 4
+#define OFF1_3_BITS 1
+#define OFF1_3_BIAS 7
+#define FCT2_BITS 6
+#define STR2_BITS 2
+#define OFF2_1_BITS 7
+#define OFF2_1_BIAS 5
+#define OFF2_2_BITS 7
+#define OFF2_2_BIAS 4
+#define OFF2_3_BITS 4
+#define OFF2_3_BIAS 7
+#define FCT3_BITS 4
+#define STR3_BITS 1
+#define OFF3_1_BITS 6
+#define OFF3_1_BIAS 10
+#define OFF3_2_BITS 1
+#define OFF3_2_BIAS 21
+
+#include <i386_data.h>
+
+#define suffix_none 0
+#define suffix_w 1
+#define suffix_w0 2
+#define suffix_W 3
+#define suffix_tttn 4
+#define suffix_D 7
+#define suffix_w1 5
+#define suffix_W1 6
+
+static const opfct_t op1_fct[] =
+{
+ NULL,
+ FCT_MOD$R_M,
+ FCT_Mod$R_m,
+ FCT_abs,
+ FCT_ax,
+ FCT_ax$w,
+ FCT_ccc,
+ FCT_ddd,
+ FCT_disp8,
+ FCT_ds_bx,
+ FCT_ds_si,
+ FCT_dx,
+ FCT_es_di,
+ FCT_freg,
+ FCT_imm$s,
+ FCT_imm$w,
+ FCT_imm16,
+ FCT_imm8,
+ FCT_imms8,
+ FCT_mmxreg,
+ FCT_mod$16r_m,
+ FCT_mod$64r_m,
+ FCT_mod$8r_m,
+ FCT_mod$r_m,
+ FCT_mod$r_m$w,
+ FCT_reg,
+ FCT_reg$w,
+ FCT_reg16,
+ FCT_reg64,
+ FCT_rel,
+ FCT_sel,
+ FCT_sreg2,
+ FCT_sreg3,
+ FCT_string,
+ FCT_xmmreg,
+};
+static const char op1_str[] =
+ "%ax\0"
+ "%cl\0"
+ "%eax\0"
+ "%st\0"
+ "%xmm0\0"
+ "*";
+static const uint8_t op1_str_idx[] = {
+ 0,
+ 4,
+ 8,
+ 13,
+ 17,
+ 23,
+};
+static const opfct_t op2_fct[] =
+{
+ NULL,
+ FCT_MOD$R_M,
+ FCT_Mod$R_m,
+ FCT_abs,
+ FCT_absval,
+ FCT_ax$w,
+ FCT_ccc,
+ FCT_ddd,
+ FCT_ds_si,
+ FCT_dx,
+ FCT_es_di,
+ FCT_freg,
+ FCT_imm8,
+ FCT_mmxreg,
+ FCT_mod$64r_m,
+ FCT_mod$r_m,
+ FCT_mod$r_m$w,
+ FCT_moda$r_m,
+ FCT_reg,
+ FCT_reg$w,
+ FCT_reg64,
+ FCT_sreg3,
+ FCT_string,
+ FCT_xmmreg,
+};
+static const char op2_str[] =
+ "%ecx\0"
+ "%st";
+static const uint8_t op2_str_idx[] = {
+ 0,
+ 5,
+};
+static const opfct_t op3_fct[] =
+{
+ NULL,
+ FCT_mmxreg,
+ FCT_mod$r_m,
+ FCT_reg,
+ FCT_string,
+ FCT_xmmreg,
+};
+static const char op3_str[] =
+ "%edx";
+static const uint8_t op3_str_idx[] = {
+ 0,
+};
+static const struct instr_enc instrtab[] =
+{
+ { .mnemonic = MNE_aaa, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_aad, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_aam, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_aas, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_adc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_adc, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_adc, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_adc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_adc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_add, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_add, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_add, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_add, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_add, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_addsubpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_addsubps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_and, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_and, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_and, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_and, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_and, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_andpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_andps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_andnpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_andnps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_arpl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_bound, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 7, .off1_2 = 0, .off1_3 = 0, .fct2 = 17, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_bsf, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_bsr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_bswap, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 25, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_bt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_bt, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_btc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_btc, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_btr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_btr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_bts, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_bts, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_call, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 29, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_call, .rep = 0, .repe = 0, .suffix = 3, .modrm = 1, .fct1 = 21, .str1 = 6, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lcall, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 30, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 4, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lcall, .rep = 0, .repe = 0, .suffix = 3, .modrm = 1, .fct1 = 21, .str1 = 6, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_clc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cli, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_syscall, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_clts, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sysret, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sysenter, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sysexit, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmov, .rep = 0, .repe = 0, .suffix = 4, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmp, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmp, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmps, .rep = 0, .repe = 1, .suffix = 1, .modrm = 0, .fct1 = 12, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 8, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpxchg, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 15, .off1_2 = 11, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 8, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpxchg8b, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cpuid, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtdq2pd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtpd2dq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvttpd2dq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_daa, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_das, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_dec, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_dec, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 25, .str1 = 0, .off1_1 = 2, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_div, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_emms, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_enter, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 16, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 12, .str2 = 0, .off2_1 = 19, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fnop, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fchs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fabs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ftst, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fxam, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fld1, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fldl2t, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fldl2e, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fldpi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fldlg2, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fldln2, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fldz, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_f2xm1, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fyl2x, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fptan, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fpatan, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fxtract, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fprem1, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fdecstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fincstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fprem, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fyl2xp1, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fsqrt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fsincos, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_frndint, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fscale, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fsin, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcos, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fadd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fadd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fadd, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fmul, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fmul, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fmul, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fsub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fsub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fsub, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fsubr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fsubr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fsubr, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fst, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fst, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fstp, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fldenv, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fldcw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fnstenv, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fnstcw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fxch, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_faddp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcmovb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fiadd, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcmove, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fmulp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fimul, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fsubp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fisub, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fsubrp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fisubr, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fnstsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 1, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fbld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcomip, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fbstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fchs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fclex, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_finit, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fwait, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fnclex, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcmovb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcmove, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcmovbe, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcmovu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcmovnb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcmovne, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcmovnbe, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcmovnu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcom, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcom, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcomp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcomp, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcompp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcomi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcomip, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fucomi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fucomip, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcos, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fdecstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fdiv, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fdiv, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fdiv, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fidivl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fdivp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fidiv, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fdivrp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fdivr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fdivr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fdivr, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fidivrl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fidivr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fdivrp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ffree, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcmovbe, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ficom, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcmovu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ficomp, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fild, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fildl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fildll, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fincstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fninit, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fist, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fistp, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fistpll, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fisttp, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fisttpll, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fldt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fstpt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fld, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fucom, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_frstor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fucomp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fnsave, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fnstsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_hlt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_idiv, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_imul, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_imul, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_imul, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 14, .str1 = 0, .off1_1 = 13, .off1_2 = 2, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 3, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_in, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_in, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 11, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 3, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_inc, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_inc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 25, .str1 = 0, .off1_1 = 2, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ins, .rep = 1, .repe = 0, .suffix = 1, .modrm = 0, .fct1 = 11, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 10, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_int, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_int3, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_into, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_invd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_swapgs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_invlpg, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_iret, .rep = 0, .repe = 0, .suffix = 6, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_j, .rep = 0, .repe = 0, .suffix = 4, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_j, .rep = 0, .repe = 0, .suffix = 4, .modrm = 0, .fct1 = 29, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_set, .rep = 0, .repe = 0, .suffix = 4, .modrm = 1, .fct1 = 22, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_jmp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_jmp, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 29, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_jmp, .rep = 0, .repe = 0, .suffix = 3, .modrm = 1, .fct1 = 21, .str1 = 6, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ljmp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 30, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 4, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ljmp, .rep = 0, .repe = 0, .suffix = 3, .modrm = 1, .fct1 = 21, .str1 = 6, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lahf, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lar, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lds, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 5, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lea, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 5, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_leave, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_les, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 5, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lfs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lgs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lgdt, .rep = 0, .repe = 0, .suffix = 2, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lidt, .rep = 0, .repe = 0, .suffix = 2, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lldt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lmsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lock, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lods, .rep = 1, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 10, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 3, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_loop, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_loope, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_loopne, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lsl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ltr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 3, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 35, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 5, .str1 = 0, .off1_1 = 37, .off1_2 = 3, .off1_3 = 0, .fct2 = 3, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 6, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 28, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 6, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 7, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 28, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 7, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 32, .str1 = 0, .off1_1 = 7, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 21, .str2 = 0, .off2_1 = 5, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movs, .rep = 1, .repe = 0, .suffix = 1, .modrm = 0, .fct1 = 10, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 10, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movsbl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 22, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movswl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movzbl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 22, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movzwl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mul, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_neg, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pause, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_nop, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_popcnt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_not, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_or, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_or, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_or, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_or, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_or, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_out, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 5, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 12, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_out, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 5, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 9, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_outs, .rep = 1, .repe = 0, .suffix = 1, .modrm = 0, .fct1 = 10, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 9, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pop, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pop, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 32, .str1 = 0, .off1_1 = 7, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_popf, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_push, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_push, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 25, .str1 = 0, .off1_1 = 2, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pop, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 25, .str1 = 0, .off1_1 = 2, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_push, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 14, .str1 = 0, .off1_1 = 5, .off1_2 = 2, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_push, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 31, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_push, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 32, .str1 = 0, .off1_1 = 7, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pusha, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_popa, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pushf, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rcl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rcl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rcl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rcr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rcr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rcr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rdmsr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rdpmc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rdtsc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ret, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ret, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 16, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lret, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lret, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 16, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rol, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rol, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rol, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ror, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ror, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ror, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rsm, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sahf, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sar, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sar, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sar, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sbb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sbb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sbb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sbb, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sbb, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_scas, .rep = 0, .repe = 1, .suffix = 0, .modrm = 0, .fct1 = 12, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 3, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_set, .rep = 0, .repe = 0, .suffix = 4, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_shl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_shl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_shl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_shr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_shld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 2, .str3 = 0, .off3_1 = 6, .off3_2 = 0, },
+ { .mnemonic = MNE_shld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 2, .str3 = 0, .off3_1 = 6, .off3_2 = 0, },
+ { .mnemonic = MNE_shr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_shr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_shrd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 2, .str3 = 0, .off3_1 = 6, .off3_2 = 0, },
+ { .mnemonic = MNE_shrd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 2, .str3 = 0, .off3_1 = 6, .off3_2 = 0, },
+ { .mnemonic = MNE_vmcall, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_vmlaunch, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_vmresume, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_vmxoff, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_vmread, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 28, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 14, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_vmwrite, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 21, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sgdtl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_monitor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 3, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 1, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 4, .str3 = 1, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mwait, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 3, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 1, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sidtl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sldt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_smsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_stc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_std, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sti, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_stos, .rep = 1, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 5, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 10, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_str, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sub, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sub, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_test, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_test, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_test, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ud2a, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_verr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_verw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_wbinvd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_prefetch, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 22, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_prefetchw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 22, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_prefetchnta, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_prefetcht0, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_prefetcht1, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_prefetcht2, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_nop, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_wrmsr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_xadd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 15, .off1_2 = 11, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 8, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_xchg, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_xchg, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 4, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_xlat, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 9, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_xor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_xor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_xor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_xor, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_xor, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_emms, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pand, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pand, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pandn, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pandn, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmaddwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmaddwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_por, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_por, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pxor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pxor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_andnps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_andps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpeqps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpltps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpleps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpunordps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpneqps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpnltps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpnleps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpordps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpeqss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpltss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpless, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpunordss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpneqss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpnltss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpnless, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpordss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fxrstor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fxsave, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ldmxcsr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_stmxcsr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movupd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movups, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movupd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movups, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movddup, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movsldup, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movlpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movhlps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movlps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movhlpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movhlps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movlpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movlps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_unpcklpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_unpcklps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_unpckhpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_unpckhps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movshdup, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movhpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movlhps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movhps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movlhpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movlhps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movhpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movhps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movapd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movaps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movapd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movaps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtsi2sd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtsi2ss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtpi2pd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtpi2ps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movntpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movntps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvttsd2si, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvttss2si, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvttpd2pi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvttps2pi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtpd2pi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtsd2si, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtss2si, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtps2pi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ucomisd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ucomiss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_comisd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_comiss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_getsec, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movmskpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 26, .off1_2 = 0, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movmskps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sqrtpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sqrtsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sqrtss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sqrtps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rsqrtss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rsqrtps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rcpss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rcpps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_andpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_andps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_andnpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_andnps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_orpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_orps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_xorpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_xorps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_addsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_addss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_addpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_addps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mulsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mulss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mulpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mulps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtsd2ss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtss2sd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtpd2ps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtps2pd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtps2dq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvttps2dq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtdq2ps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_subsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_subss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_subpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_subps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_minsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_minss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_minpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_minps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_divsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_divss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_divpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_divps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_maxsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_maxss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_maxpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_maxps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_punpcklbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_punpcklbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_punpcklwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_punpcklwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_punpckldq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_punpckldq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_packsswb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_packsswb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpgtb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpgtb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpgtw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpgtw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpgtd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpgtd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_packuswb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_packuswb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_punpckhbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_punpckhbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_punpckhwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_punpckhwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_punpckhdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_punpckhdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_packssdw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_packssdw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_punpcklqdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_punpckhqdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movdqa, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movdqu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pshufd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
+ { .mnemonic = MNE_pshuflw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
+ { .mnemonic = MNE_pshufhw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
+ { .mnemonic = MNE_pshufw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 1, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 1, .str3 = 0, .off3_1 = 8, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpeqb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpeqb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpeqw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpeqw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpeqd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpeqd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_haddpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_haddps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_hsubpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_hsubps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movdqa, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movdqu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 1, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movnti, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pinsrw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
+ { .mnemonic = MNE_pinsrw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 1, .str3 = 0, .off3_1 = 8, .off3_2 = 0, },
+ { .mnemonic = MNE_pextrw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 3, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
+ { .mnemonic = MNE_pextrw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 3, .str3 = 0, .off3_1 = 8, .off3_2 = 0, },
+ { .mnemonic = MNE_shufpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
+ { .mnemonic = MNE_shufps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 8, .off3_2 = 0, },
+ { .mnemonic = MNE_psrlw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrlw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrlq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrlq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmullw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmullw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movdq2q, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 26, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movq2dq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 19, .str1 = 0, .off1_1 = 26, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmovmskb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 26, .off1_2 = 0, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmovmskb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 19, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubusb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubusb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubusw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubusw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pminub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pminub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddusb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddusb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddusw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddusw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmaxub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmaxub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pavgb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pavgb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psraw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psraw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrad, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrad, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pavgw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pavgw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmulhuw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmulhuw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmulhw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmulhw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movntdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movntq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 1, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pminsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pminsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmaxsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmaxsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lddqu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psllw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psllw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pslld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pslld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psllq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psllq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmuludq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmuludq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psadbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psadbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_maskmovdqu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 26, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_maskmovq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 19, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pshufb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pshufb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_phaddw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_phaddw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_phaddd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_phaddd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_phaddsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_phaddsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmaddubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmaddubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_phsubw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_phsubw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_phsubd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_phsubd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_phsubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_phsubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psignb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psignb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psignw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psignw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psignd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psignd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmulhrsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmulhrsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pabsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pabsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pabsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pabsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pabsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pabsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_palignr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_palignr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 1, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 1, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
+ { .mnemonic = MNE_vmclear, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_vmxon, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_vmptrld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_vmptrst, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrlw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrlw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psraw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psraw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psllw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psllw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrad, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrad, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pslld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pslld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrlq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrlq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrldq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psllq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psllq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pslldq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lfence, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mfence, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sfence, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_clflush, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_blendps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_blendpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_blendvps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 33, .str1 = 5, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_blendvpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 33, .str1 = 5, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_dpps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_dppd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_insertps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_movntdqa, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mpsadbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_packusdw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pblendvb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 33, .str1 = 5, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_pblendw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpeqq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpestri, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpestrm, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpistri, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpistrm, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpgtq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_phminposuw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pinsrb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_pinsrd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_pmaxsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmaxsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmaxud, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmaxuw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pminsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pminsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pminud, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pminuw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmovsxbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmovsxbd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmovsxbq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmovsxwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmovsxwq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmovsxdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmovzxbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmovzxbd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmovzxbq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmovzxwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmovzxwq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmovzxdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmuldq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmulld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ptest, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_roundps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_roundpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_roundss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_roundsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_pop, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 31, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+};
+static const uint8_t match_data[] =
+{
+ 0x11, 0x37,
+ 0x22, 0xd5, 0xa,
+ 0x22, 0xd4, 0xa,
+ 0x11, 0x3f,
+ 0x1, 0xfe, 0x14,
+ 0x2, 0xfe, 0x80, 0x38, 0x10,
+ 0x2, 0xfe, 0x82, 0x38, 0x10,
+ 0x2, 0xfe, 0x10, 0, 0,
+ 0x2, 0xfe, 0x12, 0, 0,
+ 0x1, 0xfe, 0x4,
+ 0x2, 0xfe, 0x80, 0x38, 0,
+ 0x12, 0x83, 0x38, 0,
+ 0x2, 0xfe, 0, 0, 0,
+ 0x2, 0xfe, 0x2, 0, 0,
+ 0x34, 0x66, 0xf, 0xd0, 0, 0,
+ 0x34, 0xf2, 0xf, 0xd0, 0, 0,
+ 0x1, 0xfe, 0x24,
+ 0x2, 0xfe, 0x80, 0x38, 0x20,
+ 0x2, 0xfe, 0x82, 0x38, 0x20,
+ 0x2, 0xfe, 0x20, 0, 0,
+ 0x2, 0xfe, 0x22, 0, 0,
+ 0x34, 0x66, 0xf, 0x54, 0, 0,
+ 0x23, 0xf, 0x54, 0, 0,
+ 0x34, 0x66, 0xf, 0x55, 0, 0,
+ 0x23, 0xf, 0x55, 0, 0,
+ 0x12, 0x63, 0, 0,
+ 0x12, 0x62, 0, 0,
+ 0x23, 0xf, 0xbc, 0, 0,
+ 0x23, 0xf, 0xbd, 0, 0,
+ 0x12, 0xf, 0xf8, 0xc8,
+ 0x23, 0xf, 0xa3, 0, 0,
+ 0x23, 0xf, 0xba, 0x38, 0x20,
+ 0x23, 0xf, 0xbb, 0, 0,
+ 0x23, 0xf, 0xba, 0x38, 0x38,
+ 0x23, 0xf, 0xb3, 0, 0,
+ 0x23, 0xf, 0xba, 0x38, 0x30,
+ 0x23, 0xf, 0xab, 0, 0,
+ 0x23, 0xf, 0xba, 0x38, 0x28,
+ 0x11, 0xe8,
+ 0x12, 0xff, 0x38, 0x10,
+ 0x11, 0x9a,
+ 0x12, 0xff, 0x38, 0x18,
+ 0x11, 0x98,
+ 0x11, 0x99,
+ 0x11, 0xf8,
+ 0x11, 0xfc,
+ 0x11, 0xfa,
+ 0x22, 0xf, 0x5,
+ 0x22, 0xf, 0x6,
+ 0x22, 0xf, 0x7,
+ 0x22, 0xf, 0x34,
+ 0x22, 0xf, 0x35,
+ 0x11, 0xf5,
+ 0x13, 0xf, 0xf0, 0x40, 0, 0,
+ 0x1, 0xfe, 0x3c,
+ 0x2, 0xfe, 0x80, 0x38, 0x38,
+ 0x12, 0x83, 0x38, 0x38,
+ 0x2, 0xfe, 0x38, 0, 0,
+ 0x2, 0xfe, 0x3a, 0, 0,
+ 0x34, 0xf2, 0xf, 0xc2, 0, 0,
+ 0x34, 0xf3, 0xf, 0xc2, 0, 0,
+ 0x34, 0x66, 0xf, 0xc2, 0, 0,
+ 0x23, 0xf, 0xc2, 0, 0,
+ 0x1, 0xfe, 0xa6,
+ 0x13, 0xf, 0xfe, 0xb0, 0, 0,
+ 0x23, 0xf, 0xc7, 0x38, 0x8,
+ 0x22, 0xf, 0xa2,
+ 0x34, 0xf3, 0xf, 0xe6, 0, 0,
+ 0x34, 0xf2, 0xf, 0xe6, 0, 0,
+ 0x34, 0x66, 0xf, 0xe6, 0, 0,
+ 0x11, 0x27,
+ 0x11, 0x2f,
+ 0x2, 0xfe, 0xfe, 0x38, 0x8,
+ 0x1, 0xf8, 0x48,
+ 0x2, 0xfe, 0xf6, 0x38, 0x30,
+ 0x22, 0xf, 0x77,
+ 0x11, 0xc8,
+ 0x22, 0xd9, 0xd0,
+ 0x22, 0xd9, 0xe0,
+ 0x22, 0xd9, 0xe1,
+ 0x22, 0xd9, 0xe4,
+ 0x22, 0xd9, 0xe5,
+ 0x22, 0xd9, 0xe8,
+ 0x22, 0xd9, 0xe9,
+ 0x22, 0xd9, 0xea,
+ 0x22, 0xd9, 0xeb,
+ 0x22, 0xd9, 0xec,
+ 0x22, 0xd9, 0xed,
+ 0x22, 0xd9, 0xee,
+ 0x22, 0xd9, 0xf0,
+ 0x22, 0xd9, 0xf1,
+ 0x22, 0xd9, 0xf2,
+ 0x22, 0xd9, 0xf3,
+ 0x22, 0xd9, 0xf4,
+ 0x22, 0xd9, 0xf5,
+ 0x22, 0xd9, 0xf6,
+ 0x22, 0xd9, 0xf7,
+ 0x22, 0xd9, 0xf8,
+ 0x22, 0xd9, 0xf9,
+ 0x22, 0xd9, 0xfa,
+ 0x22, 0xd9, 0xfb,
+ 0x22, 0xd9, 0xfc,
+ 0x22, 0xd9, 0xfd,
+ 0x22, 0xd9, 0xfe,
+ 0x22, 0xd9, 0xff,
+ 0x12, 0xd8, 0xf8, 0xc0,
+ 0x12, 0xdc, 0xf8, 0xc0,
+ 0x2, 0xfb, 0xd8, 0x38, 0,
+ 0x12, 0xd8, 0xf8, 0xc8,
+ 0x12, 0xdc, 0xf8, 0xc8,
+ 0x2, 0xfb, 0xd8, 0x38, 0x8,
+ 0x12, 0xd8, 0xf8, 0xe0,
+ 0x12, 0xdc, 0xf8, 0xe0,
+ 0x2, 0xfb, 0xd8, 0x38, 0x20,
+ 0x12, 0xd8, 0xf8, 0xe8,
+ 0x12, 0xdc, 0xf8, 0xe8,
+ 0x2, 0xfb, 0xd8, 0x38, 0x28,
+ 0x12, 0xdd, 0xf8, 0xd0,
+ 0x2, 0xfb, 0xd9, 0x38, 0x10,
+ 0x12, 0xdd, 0xf8, 0xd8,
+ 0x2, 0xfb, 0xd9, 0x38, 0x18,
+ 0x12, 0xd9, 0x38, 0x20,
+ 0x12, 0xd9, 0x38, 0x28,
+ 0x12, 0xd9, 0x38, 0x30,
+ 0x12, 0xd9, 0x38, 0x38,
+ 0x12, 0xd9, 0xf8, 0xc8,
+ 0x12, 0xde, 0xf8, 0xc0,
+ 0x12, 0xda, 0xf8, 0xc0,
+ 0x2, 0xfb, 0xda, 0x38, 0,
+ 0x12, 0xda, 0xf8, 0xc8,
+ 0x12, 0xde, 0xf8, 0xc8,
+ 0x2, 0xfb, 0xda, 0x38, 0x8,
+ 0x12, 0xde, 0xf8, 0xe0,
+ 0x2, 0xfb, 0xda, 0x38, 0x20,
+ 0x12, 0xde, 0xf8, 0xe8,
+ 0x2, 0xfb, 0xda, 0x38, 0x28,
+ 0x22, 0xdf, 0xe0,
+ 0x12, 0xdf, 0x38, 0x20,
+ 0x12, 0xdf, 0xf8, 0xf0,
+ 0x12, 0xdf, 0x38, 0x30,
+ 0x22, 0xd9, 0xe0,
+ 0x33, 0x9b, 0xdb, 0xe2,
+ 0x33, 0x9b, 0xdb, 0xe3,
+ 0x11, 0x9b,
+ 0x22, 0xdb, 0xe2,
+ 0x12, 0xda, 0xf8, 0xc0,
+ 0x12, 0xda, 0xf8, 0xc8,
+ 0x12, 0xda, 0xf8, 0xd0,
+ 0x12, 0xda, 0xf8, 0xd8,
+ 0x12, 0xdb, 0xf8, 0xc0,
+ 0x12, 0xdb, 0xf8, 0xc8,
+ 0x12, 0xdb, 0xf8, 0xd0,
+ 0x12, 0xdb, 0xf8, 0xd8,
+ 0x12, 0xd8, 0xf8, 0xd0,
+ 0x2, 0xfb, 0xd8, 0x38, 0x10,
+ 0x12, 0xd8, 0xf8, 0xd8,
+ 0x2, 0xfb, 0xd8, 0x38, 0x18,
+ 0x22, 0xde, 0xd9,
+ 0x12, 0xdb, 0xf8, 0xf0,
+ 0x12, 0xdf, 0xf8, 0xf0,
+ 0x12, 0xdb, 0xf8, 0xe8,
+ 0x12, 0xdf, 0xf8, 0xe8,
+ 0x22, 0xd9, 0xff,
+ 0x22, 0xd9, 0xf6,
+ 0x12, 0xd8, 0xf8, 0xf0,
+ 0x12, 0xdc, 0xf8, 0xf0,
+ 0x2, 0xfb, 0xd8, 0x38, 0x30,
+ 0x12, 0xda, 0x38, 0x30,
+ 0x12, 0xde, 0xf8, 0xf0,
+ 0x12, 0xde, 0x38, 0x30,
+ 0x12, 0xde, 0xf8, 0xf8,
+ 0x12, 0xd8, 0xf8, 0xf8,
+ 0x12, 0xdc, 0xf8, 0xf8,
+ 0x2, 0xfb, 0xd8, 0x38, 0x38,
+ 0x12, 0xda, 0x38, 0x38,
+ 0x12, 0xde, 0x38, 0x38,
+ 0x12, 0xde, 0xf8, 0xf0,
+ 0x12, 0xdd, 0xf8, 0xc0,
+ 0x12, 0xda, 0xf8, 0xd0,
+ 0x2, 0xfb, 0xda, 0x38, 0x10,
+ 0x12, 0xda, 0xf8, 0xd8,
+ 0x2, 0xfb, 0xda, 0x38, 0x18,
+ 0x12, 0xdf, 0x38, 0,
+ 0x12, 0xdb, 0x38, 0,
+ 0x12, 0xdf, 0x38, 0x28,
+ 0x22, 0xd9, 0xf7,
+ 0x22, 0xdb, 0xe3,
+ 0x2, 0xfb, 0xdb, 0x38, 0x10,
+ 0x2, 0xfb, 0xdb, 0x38, 0x18,
+ 0x12, 0xdf, 0x38, 0x38,
+ 0x2, 0xfb, 0xdb, 0x38, 0x8,
+ 0x12, 0xdd, 0x38, 0x8,
+ 0x12, 0xdb, 0x38, 0x28,
+ 0x12, 0xdb, 0x38, 0x38,
+ 0x12, 0xd9, 0xf8, 0xc0,
+ 0x2, 0xfb, 0xd9, 0x38, 0,
+ 0x12, 0xdd, 0xf8, 0xe0,
+ 0x12, 0xdd, 0x38, 0x20,
+ 0x12, 0xdd, 0xf8, 0xe8,
+ 0x12, 0xdd, 0x38, 0x30,
+ 0x12, 0xdd, 0x38, 0x38,
+ 0x11, 0xf4,
+ 0x2, 0xfe, 0xf6, 0x38, 0x38,
+ 0x2, 0xfe, 0xf6, 0x38, 0x28,
+ 0x23, 0xf, 0xaf, 0, 0,
+ 0x2, 0xfd, 0x69, 0, 0,
+ 0x1, 0xfe, 0xe4,
+ 0x1, 0xfe, 0xec,
+ 0x2, 0xfe, 0xfe, 0x38, 0,
+ 0x1, 0xf8, 0x40,
+ 0x1, 0xfe, 0x6c,
+ 0x11, 0xcd,
+ 0x11, 0xcc,
+ 0x11, 0xce,
+ 0x22, 0xf, 0x8,
+ 0x33, 0xf, 0x1, 0xf8,
+ 0x23, 0xf, 0x1, 0x38, 0x38,
+ 0x11, 0xcf,
+ 0x1, 0xf0, 0x70,
+ 0x12, 0xf, 0xf0, 0x80,
+ 0x13, 0xf, 0xf0, 0x90, 0x38, 0,
+ 0x11, 0xe3,
+ 0x11, 0xeb,
+ 0x11, 0xe9,
+ 0x12, 0xff, 0x38, 0x20,
+ 0x11, 0xea,
+ 0x12, 0xff, 0x38, 0x28,
+ 0x11, 0x9f,
+ 0x23, 0xf, 0x2, 0, 0,
+ 0x12, 0xc5, 0, 0,
+ 0x12, 0x8d, 0, 0,
+ 0x11, 0xc9,
+ 0x12, 0xc4, 0, 0,
+ 0x23, 0xf, 0xb4, 0, 0,
+ 0x23, 0xf, 0xb5, 0, 0,
+ 0x23, 0xf, 0x1, 0x38, 0x10,
+ 0x23, 0xf, 0x1, 0x38, 0x18,
+ 0x23, 0xf, 0, 0x38, 0x10,
+ 0x23, 0xf, 0x1, 0x38, 0x30,
+ 0x11, 0xf0,
+ 0x1, 0xfe, 0xac,
+ 0x11, 0xe2,
+ 0x11, 0xe1,
+ 0x11, 0xe0,
+ 0x23, 0xf, 0x3, 0, 0,
+ 0x23, 0xf, 0xb2, 0, 0,
+ 0x23, 0xf, 0, 0x38, 0x18,
+ 0x2, 0xfe, 0x88, 0, 0,
+ 0x2, 0xfe, 0x8a, 0, 0,
+ 0x2, 0xfe, 0xc6, 0x38, 0,
+ 0x1, 0xf0, 0xb0,
+ 0x1, 0xfe, 0xa0,
+ 0x1, 0xfe, 0xa2,
+ 0x23, 0xf, 0x20, 0xc0, 0xc0,
+ 0x23, 0xf, 0x22, 0xc0, 0xc0,
+ 0x23, 0xf, 0x21, 0xc0, 0xc0,
+ 0x23, 0xf, 0x23, 0xc0, 0xc0,
+ 0x12, 0x8c, 0, 0,
+ 0x12, 0x8e, 0, 0,
+ 0x1, 0xfe, 0xa4,
+ 0x23, 0xf, 0xbe, 0, 0,
+ 0x23, 0xf, 0xbf, 0, 0,
+ 0x23, 0xf, 0xb6, 0, 0,
+ 0x23, 0xf, 0xb7, 0, 0,
+ 0x2, 0xfe, 0xf6, 0x38, 0x20,
+ 0x2, 0xfe, 0xf6, 0x38, 0x18,
+ 0x22, 0xf3, 0x90,
+ 0x11, 0x90,
+ 0x34, 0xf3, 0xf, 0xb8, 0, 0,
+ 0x2, 0xfe, 0xf6, 0x38, 0x10,
+ 0x2, 0xfe, 0x8, 0, 0,
+ 0x2, 0xfe, 0xa, 0, 0,
+ 0x2, 0xfe, 0x80, 0x38, 0x8,
+ 0x2, 0xfe, 0x82, 0x38, 0x8,
+ 0x1, 0xfe, 0xc,
+ 0x1, 0xfe, 0xe6,
+ 0x1, 0xfe, 0xee,
+ 0x1, 0xfe, 0x6e,
+ 0x12, 0x8f, 0x38, 0,
+ 0x12, 0xf, 0xc7, 0x81,
+ 0x11, 0x9d,
+ 0x12, 0xff, 0x38, 0x30,
+ 0x1, 0xf8, 0x50,
+ 0x1, 0xf8, 0x58,
+ 0x1, 0xfd, 0x68,
+ 0x1, 0xe7, 0x6,
+ 0x12, 0xf, 0xc7, 0x80,
+ 0x11, 0x60,
+ 0x11, 0x61,
+ 0x11, 0x9c,
+ 0x2, 0xfe, 0xd0, 0x38, 0x10,
+ 0x2, 0xfe, 0xd2, 0x38, 0x10,
+ 0x2, 0xfe, 0xc0, 0x38, 0x10,
+ 0x2, 0xfe, 0xd0, 0x38, 0x18,
+ 0x2, 0xfe, 0xd2, 0x38, 0x18,
+ 0x2, 0xfe, 0xc0, 0x38, 0x18,
+ 0x22, 0xf, 0x32,
+ 0x22, 0xf, 0x33,
+ 0x22, 0xf, 0x31,
+ 0x11, 0xc3,
+ 0x11, 0xc2,
+ 0x11, 0xcb,
+ 0x11, 0xca,
+ 0x2, 0xfe, 0xd0, 0x38, 0,
+ 0x2, 0xfe, 0xd2, 0x38, 0,
+ 0x2, 0xfe, 0xc0, 0x38, 0,
+ 0x2, 0xfe, 0xd0, 0x38, 0x8,
+ 0x2, 0xfe, 0xd2, 0x38, 0x8,
+ 0x2, 0xfe, 0xc0, 0x38, 0x8,
+ 0x22, 0xf, 0xaa,
+ 0x11, 0x9e,
+ 0x2, 0xfe, 0xd0, 0x38, 0x38,
+ 0x2, 0xfe, 0xd2, 0x38, 0x38,
+ 0x2, 0xfe, 0xc0, 0x38, 0x38,
+ 0x2, 0xfe, 0x18, 0, 0,
+ 0x2, 0xfe, 0x1a, 0, 0,
+ 0x1, 0xfe, 0x1c,
+ 0x2, 0xfe, 0x80, 0x38, 0x18,
+ 0x2, 0xfe, 0x82, 0x38, 0x18,
+ 0x1, 0xfe, 0xae,
+ 0x13, 0xf, 0xf0, 0x90, 0x38, 0,
+ 0x2, 0xfe, 0xd0, 0x38, 0x20,
+ 0x2, 0xfe, 0xd2, 0x38, 0x20,
+ 0x2, 0xfe, 0xc0, 0x38, 0x20,
+ 0x2, 0xfe, 0xd0, 0x38, 0x28,
+ 0x23, 0xf, 0xa4, 0, 0,
+ 0x23, 0xf, 0xa5, 0, 0,
+ 0x2, 0xfe, 0xd2, 0x38, 0x28,
+ 0x2, 0xfe, 0xc0, 0x38, 0x28,
+ 0x23, 0xf, 0xac, 0, 0,
+ 0x23, 0xf, 0xad, 0, 0,
+ 0x33, 0xf, 0x1, 0xc1,
+ 0x33, 0xf, 0x1, 0xc2,
+ 0x33, 0xf, 0x1, 0xc3,
+ 0x33, 0xf, 0x1, 0xc4,
+ 0x23, 0xf, 0x78, 0, 0,
+ 0x23, 0xf, 0x79, 0, 0,
+ 0x23, 0xf, 0x1, 0x38, 0,
+ 0x33, 0xf, 0x1, 0xc8,
+ 0x33, 0xf, 0x1, 0xc9,
+ 0x23, 0xf, 0x1, 0x38, 0x8,
+ 0x23, 0xf, 0, 0x38, 0,
+ 0x23, 0xf, 0x1, 0x38, 0x20,
+ 0x11, 0xf9,
+ 0x11, 0xfd,
+ 0x11, 0xfb,
+ 0x1, 0xfe, 0xaa,
+ 0x23, 0xf, 0, 0x38, 0x8,
+ 0x2, 0xfe, 0x28, 0, 0,
+ 0x2, 0xfe, 0x2a, 0, 0,
+ 0x1, 0xfe, 0x2c,
+ 0x2, 0xfe, 0x80, 0x38, 0x28,
+ 0x2, 0xfe, 0x82, 0x38, 0x28,
+ 0x2, 0xfe, 0x84, 0, 0,
+ 0x1, 0xfe, 0xa8,
+ 0x2, 0xfe, 0xf6, 0x38, 0,
+ 0x22, 0xf, 0xb,
+ 0x23, 0xf, 0, 0x38, 0x20,
+ 0x23, 0xf, 0, 0x38, 0x28,
+ 0x22, 0xf, 0x9,
+ 0x23, 0xf, 0xd, 0x38, 0,
+ 0x23, 0xf, 0xd, 0x38, 0x8,
+ 0x23, 0xf, 0x18, 0x38, 0,
+ 0x23, 0xf, 0x18, 0x38, 0x8,
+ 0x23, 0xf, 0x18, 0x38, 0x10,
+ 0x23, 0xf, 0x18, 0x38, 0x18,
+ 0x23, 0xf, 0x1f, 0, 0,
+ 0x22, 0xf, 0x30,
+ 0x13, 0xf, 0xfe, 0xc0, 0, 0,
+ 0x2, 0xfe, 0x86, 0, 0,
+ 0x1, 0xf8, 0x90,
+ 0x11, 0xd7,
+ 0x2, 0xfe, 0x30, 0, 0,
+ 0x2, 0xfe, 0x32, 0, 0,
+ 0x1, 0xfe, 0x34,
+ 0x2, 0xfe, 0x80, 0x38, 0x30,
+ 0x2, 0xfe, 0x82, 0x38, 0x30,
+ 0x22, 0xf, 0x77,
+ 0x34, 0x66, 0xf, 0xdb, 0, 0,
+ 0x23, 0xf, 0xdb, 0, 0,
+ 0x34, 0x66, 0xf, 0xdf, 0, 0,
+ 0x23, 0xf, 0xdf, 0, 0,
+ 0x34, 0x66, 0xf, 0xf5, 0, 0,
+ 0x23, 0xf, 0xf5, 0, 0,
+ 0x34, 0x66, 0xf, 0xeb, 0, 0,
+ 0x23, 0xf, 0xeb, 0, 0,
+ 0x34, 0x66, 0xf, 0xef, 0, 0,
+ 0x23, 0xf, 0xef, 0, 0,
+ 0x23, 0xf, 0x55, 0, 0,
+ 0x23, 0xf, 0x54, 0, 0,
+ 0x24, 0xf, 0xc2, 0, 0, 0xff, 0,
+ 0x24, 0xf, 0xc2, 0, 0, 0xff, 0x1,
+ 0x24, 0xf, 0xc2, 0, 0, 0xff, 0x2,
+ 0x24, 0xf, 0xc2, 0, 0, 0xff, 0x3,
+ 0x24, 0xf, 0xc2, 0, 0, 0xff, 0x4,
+ 0x24, 0xf, 0xc2, 0, 0, 0xff, 0x5,
+ 0x24, 0xf, 0xc2, 0, 0, 0xff, 0x6,
+ 0x24, 0xf, 0xc2, 0, 0, 0xff, 0x7,
+ 0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0,
+ 0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x1,
+ 0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x2,
+ 0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x3,
+ 0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x4,
+ 0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x5,
+ 0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x6,
+ 0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x7,
+ 0x23, 0xf, 0xae, 0x38, 0x8,
+ 0x23, 0xf, 0xae, 0x38, 0,
+ 0x23, 0xf, 0xae, 0x38, 0x10,
+ 0x23, 0xf, 0xae, 0x38, 0x18,
+ 0x34, 0xf2, 0xf, 0x10, 0, 0,
+ 0x34, 0xf3, 0xf, 0x10, 0, 0,
+ 0x34, 0x66, 0xf, 0x10, 0, 0,
+ 0x23, 0xf, 0x10, 0, 0,
+ 0x34, 0xf2, 0xf, 0x11, 0, 0,
+ 0x34, 0xf3, 0xf, 0x11, 0, 0,
+ 0x34, 0x66, 0xf, 0x11, 0, 0,
+ 0x23, 0xf, 0x11, 0, 0,
+ 0x34, 0xf2, 0xf, 0x12, 0, 0,
+ 0x34, 0xf3, 0xf, 0x12, 0, 0,
+ 0x34, 0x66, 0xf, 0x12, 0, 0,
+ 0x23, 0xf, 0x12, 0xc0, 0xc0,
+ 0x23, 0xf, 0x12, 0, 0,
+ 0x34, 0x66, 0xf, 0x13, 0xc0, 0xc0,
+ 0x23, 0xf, 0x13, 0xc0, 0xc0,
+ 0x34, 0x66, 0xf, 0x13, 0, 0,
+ 0x23, 0xf, 0x13, 0, 0,
+ 0x34, 0x66, 0xf, 0x14, 0, 0,
+ 0x23, 0xf, 0x14, 0, 0,
+ 0x34, 0x66, 0xf, 0x15, 0, 0,
+ 0x23, 0xf, 0x15, 0, 0,
+ 0x34, 0xf3, 0xf, 0x16, 0, 0,
+ 0x34, 0x66, 0xf, 0x16, 0, 0,
+ 0x23, 0xf, 0x16, 0xc0, 0xc0,
+ 0x23, 0xf, 0x16, 0, 0,
+ 0x34, 0x66, 0xf, 0x17, 0xc0, 0xc0,
+ 0x23, 0xf, 0x17, 0xc0, 0xc0,
+ 0x34, 0x66, 0xf, 0x17, 0, 0,
+ 0x23, 0xf, 0x17, 0, 0,
+ 0x34, 0x66, 0xf, 0x28, 0, 0,
+ 0x23, 0xf, 0x28, 0, 0,
+ 0x34, 0x66, 0xf, 0x29, 0, 0,
+ 0x23, 0xf, 0x29, 0, 0,
+ 0x34, 0xf2, 0xf, 0x2a, 0, 0,
+ 0x34, 0xf3, 0xf, 0x2a, 0, 0,
+ 0x34, 0x66, 0xf, 0x2a, 0, 0,
+ 0x23, 0xf, 0x2a, 0, 0,
+ 0x34, 0x66, 0xf, 0x2b, 0, 0,
+ 0x23, 0xf, 0x2b, 0, 0,
+ 0x34, 0xf2, 0xf, 0x2c, 0, 0,
+ 0x34, 0xf3, 0xf, 0x2c, 0, 0,
+ 0x34, 0x66, 0xf, 0x2c, 0, 0,
+ 0x23, 0xf, 0x2c, 0, 0,
+ 0x34, 0x66, 0xf, 0x2d, 0, 0,
+ 0x34, 0xf2, 0xf, 0x2d, 0, 0,
+ 0x34, 0xf3, 0xf, 0x2d, 0, 0,
+ 0x23, 0xf, 0x2d, 0, 0,
+ 0x34, 0x66, 0xf, 0x2e, 0, 0,
+ 0x23, 0xf, 0x2e, 0, 0,
+ 0x34, 0x66, 0xf, 0x2f, 0, 0,
+ 0x23, 0xf, 0x2f, 0, 0,
+ 0x22, 0xf, 0x37,
+ 0x34, 0x66, 0xf, 0x50, 0xc0, 0xc0,
+ 0x23, 0xf, 0x50, 0xc0, 0xc0,
+ 0x34, 0x66, 0xf, 0x51, 0, 0,
+ 0x34, 0xf2, 0xf, 0x51, 0, 0,
+ 0x34, 0xf3, 0xf, 0x51, 0, 0,
+ 0x23, 0xf, 0x51, 0, 0,
+ 0x34, 0xf3, 0xf, 0x52, 0, 0,
+ 0x23, 0xf, 0x52, 0, 0,
+ 0x34, 0xf3, 0xf, 0x53, 0, 0,
+ 0x23, 0xf, 0x53, 0, 0,
+ 0x34, 0x66, 0xf, 0x54, 0, 0,
+ 0x23, 0xf, 0x54, 0, 0,
+ 0x34, 0x66, 0xf, 0x55, 0, 0,
+ 0x23, 0xf, 0x55, 0, 0,
+ 0x34, 0x66, 0xf, 0x56, 0, 0,
+ 0x23, 0xf, 0x56, 0, 0,
+ 0x34, 0x66, 0xf, 0x57, 0, 0,
+ 0x23, 0xf, 0x57, 0, 0,
+ 0x34, 0xf2, 0xf, 0x58, 0, 0,
+ 0x34, 0xf3, 0xf, 0x58, 0, 0,
+ 0x34, 0x66, 0xf, 0x58, 0, 0,
+ 0x23, 0xf, 0x58, 0, 0,
+ 0x34, 0xf2, 0xf, 0x59, 0, 0,
+ 0x34, 0xf3, 0xf, 0x59, 0, 0,
+ 0x34, 0x66, 0xf, 0x59, 0, 0,
+ 0x23, 0xf, 0x59, 0, 0,
+ 0x34, 0xf2, 0xf, 0x5a, 0, 0,
+ 0x34, 0xf3, 0xf, 0x5a, 0, 0,
+ 0x34, 0x66, 0xf, 0x5a, 0, 0,
+ 0x23, 0xf, 0x5a, 0, 0,
+ 0x34, 0x66, 0xf, 0x5b, 0, 0,
+ 0x34, 0xf3, 0xf, 0x5b, 0, 0,
+ 0x23, 0xf, 0x5b, 0, 0,
+ 0x34, 0xf2, 0xf, 0x5c, 0, 0,
+ 0x34, 0xf3, 0xf, 0x5c, 0, 0,
+ 0x34, 0x66, 0xf, 0x5c, 0, 0,
+ 0x23, 0xf, 0x5c, 0, 0,
+ 0x34, 0xf2, 0xf, 0x5d, 0, 0,
+ 0x34, 0xf3, 0xf, 0x5d, 0, 0,
+ 0x34, 0x66, 0xf, 0x5d, 0, 0,
+ 0x23, 0xf, 0x5d, 0, 0,
+ 0x34, 0xf2, 0xf, 0x5e, 0, 0,
+ 0x34, 0xf3, 0xf, 0x5e, 0, 0,
+ 0x34, 0x66, 0xf, 0x5e, 0, 0,
+ 0x23, 0xf, 0x5e, 0, 0,
+ 0x34, 0xf2, 0xf, 0x5f, 0, 0,
+ 0x34, 0xf3, 0xf, 0x5f, 0, 0,
+ 0x34, 0x66, 0xf, 0x5f, 0, 0,
+ 0x23, 0xf, 0x5f, 0, 0,
+ 0x34, 0x66, 0xf, 0x60, 0, 0,
+ 0x23, 0xf, 0x60, 0, 0,
+ 0x34, 0x66, 0xf, 0x61, 0, 0,
+ 0x23, 0xf, 0x61, 0, 0,
+ 0x34, 0x66, 0xf, 0x62, 0, 0,
+ 0x23, 0xf, 0x62, 0, 0,
+ 0x34, 0x66, 0xf, 0x63, 0, 0,
+ 0x23, 0xf, 0x63, 0, 0,
+ 0x34, 0x66, 0xf, 0x64, 0, 0,
+ 0x23, 0xf, 0x64, 0, 0,
+ 0x34, 0x66, 0xf, 0x65, 0, 0,
+ 0x23, 0xf, 0x65, 0, 0,
+ 0x34, 0x66, 0xf, 0x66, 0, 0,
+ 0x23, 0xf, 0x66, 0, 0,
+ 0x34, 0x66, 0xf, 0x67, 0, 0,
+ 0x23, 0xf, 0x67, 0, 0,
+ 0x34, 0x66, 0xf, 0x68, 0, 0,
+ 0x23, 0xf, 0x68, 0, 0,
+ 0x34, 0x66, 0xf, 0x69, 0, 0,
+ 0x23, 0xf, 0x69, 0, 0,
+ 0x34, 0x66, 0xf, 0x6a, 0, 0,
+ 0x23, 0xf, 0x6a, 0, 0,
+ 0x34, 0x66, 0xf, 0x6b, 0, 0,
+ 0x23, 0xf, 0x6b, 0, 0,
+ 0x34, 0x66, 0xf, 0x6c, 0, 0,
+ 0x34, 0x66, 0xf, 0x6d, 0, 0,
+ 0x34, 0x66, 0xf, 0x6e, 0, 0,
+ 0x23, 0xf, 0x6e, 0, 0,
+ 0x34, 0x66, 0xf, 0x6f, 0, 0,
+ 0x34, 0xf3, 0xf, 0x6f, 0, 0,
+ 0x23, 0xf, 0x6f, 0, 0,
+ 0x34, 0x66, 0xf, 0x70, 0, 0,
+ 0x34, 0xf2, 0xf, 0x70, 0, 0,
+ 0x34, 0xf3, 0xf, 0x70, 0, 0,
+ 0x23, 0xf, 0x70, 0, 0,
+ 0x34, 0x66, 0xf, 0x74, 0, 0,
+ 0x23, 0xf, 0x74, 0, 0,
+ 0x34, 0x66, 0xf, 0x75, 0, 0,
+ 0x23, 0xf, 0x75, 0, 0,
+ 0x34, 0x66, 0xf, 0x76, 0, 0,
+ 0x23, 0xf, 0x76, 0, 0,
+ 0x34, 0x66, 0xf, 0x7c, 0, 0,
+ 0x34, 0xf2, 0xf, 0x7c, 0, 0,
+ 0x34, 0x66, 0xf, 0x7d, 0, 0,
+ 0x34, 0xf2, 0xf, 0x7d, 0, 0,
+ 0x34, 0x66, 0xf, 0x7e, 0, 0,
+ 0x34, 0xf3, 0xf, 0x7e, 0, 0,
+ 0x23, 0xf, 0x7e, 0, 0,
+ 0x34, 0x66, 0xf, 0x7f, 0, 0,
+ 0x34, 0xf3, 0xf, 0x7f, 0, 0,
+ 0x23, 0xf, 0x7f, 0, 0,
+ 0x23, 0xf, 0xc3, 0, 0,
+ 0x34, 0x66, 0xf, 0xc4, 0, 0,
+ 0x23, 0xf, 0xc4, 0, 0,
+ 0x34, 0x66, 0xf, 0xc5, 0xc0, 0xc0,
+ 0x23, 0xf, 0xc5, 0xc0, 0xc0,
+ 0x34, 0x66, 0xf, 0xc6, 0, 0,
+ 0x23, 0xf, 0xc6, 0, 0,
+ 0x34, 0x66, 0xf, 0xd1, 0, 0,
+ 0x23, 0xf, 0xd1, 0, 0,
+ 0x34, 0x66, 0xf, 0xd2, 0, 0,
+ 0x23, 0xf, 0xd2, 0, 0,
+ 0x34, 0x66, 0xf, 0xd3, 0, 0,
+ 0x23, 0xf, 0xd3, 0, 0,
+ 0x34, 0x66, 0xf, 0xd4, 0, 0,
+ 0x23, 0xf, 0xd4, 0, 0,
+ 0x34, 0x66, 0xf, 0xd5, 0, 0,
+ 0x23, 0xf, 0xd5, 0, 0,
+ 0x34, 0x66, 0xf, 0xd6, 0, 0,
+ 0x34, 0xf2, 0xf, 0xd6, 0xc0, 0xc0,
+ 0x34, 0xf3, 0xf, 0xd6, 0xc0, 0xc0,
+ 0x34, 0x66, 0xf, 0xd7, 0xc0, 0xc0,
+ 0x23, 0xf, 0xd7, 0xc0, 0xc0,
+ 0x34, 0x66, 0xf, 0xd8, 0, 0,
+ 0x23, 0xf, 0xd8, 0, 0,
+ 0x34, 0x66, 0xf, 0xd9, 0, 0,
+ 0x23, 0xf, 0xd9, 0, 0,
+ 0x34, 0x66, 0xf, 0xda, 0, 0,
+ 0x23, 0xf, 0xda, 0, 0,
+ 0x34, 0x66, 0xf, 0xdc, 0, 0,
+ 0x23, 0xf, 0xdc, 0, 0,
+ 0x34, 0x66, 0xf, 0xdd, 0, 0,
+ 0x23, 0xf, 0xdd, 0, 0,
+ 0x34, 0x66, 0xf, 0xde, 0, 0,
+ 0x23, 0xf, 0xde, 0, 0,
+ 0x34, 0x66, 0xf, 0xe0, 0, 0,
+ 0x23, 0xf, 0xe0, 0, 0,
+ 0x34, 0x66, 0xf, 0xe1, 0, 0,
+ 0x23, 0xf, 0xe1, 0, 0,
+ 0x34, 0x66, 0xf, 0xe2, 0, 0,
+ 0x23, 0xf, 0xe2, 0, 0,
+ 0x34, 0x66, 0xf, 0xe3, 0, 0,
+ 0x23, 0xf, 0xe3, 0, 0,
+ 0x34, 0x66, 0xf, 0xe4, 0, 0,
+ 0x23, 0xf, 0xe4, 0, 0,
+ 0x34, 0x66, 0xf, 0xe5, 0, 0,
+ 0x23, 0xf, 0xe5, 0, 0,
+ 0x34, 0x66, 0xf, 0xe7, 0, 0,
+ 0x23, 0xf, 0xe7, 0, 0,
+ 0x34, 0x66, 0xf, 0xe8, 0, 0,
+ 0x23, 0xf, 0xe8, 0, 0,
+ 0x34, 0x66, 0xf, 0xe9, 0, 0,
+ 0x23, 0xf, 0xe9, 0, 0,
+ 0x34, 0x66, 0xf, 0xea, 0, 0,
+ 0x23, 0xf, 0xea, 0, 0,
+ 0x34, 0x66, 0xf, 0xec, 0, 0,
+ 0x23, 0xf, 0xec, 0, 0,
+ 0x34, 0x66, 0xf, 0xed, 0, 0,
+ 0x23, 0xf, 0xed, 0, 0,
+ 0x34, 0x66, 0xf, 0xee, 0, 0,
+ 0x23, 0xf, 0xee, 0, 0,
+ 0x34, 0xf2, 0xf, 0xf0, 0, 0,
+ 0x34, 0x66, 0xf, 0xf1, 0, 0,
+ 0x23, 0xf, 0xf1, 0, 0,
+ 0x34, 0x66, 0xf, 0xf2, 0, 0,
+ 0x23, 0xf, 0xf2, 0, 0,
+ 0x34, 0x66, 0xf, 0xf3, 0, 0,
+ 0x23, 0xf, 0xf3, 0, 0,
+ 0x34, 0x66, 0xf, 0xf4, 0, 0,
+ 0x23, 0xf, 0xf4, 0, 0,
+ 0x34, 0x66, 0xf, 0xf6, 0, 0,
+ 0x23, 0xf, 0xf6, 0, 0,
+ 0x34, 0x66, 0xf, 0xf7, 0xc0, 0xc0,
+ 0x23, 0xf, 0xf7, 0xc0, 0xc0,
+ 0x34, 0x66, 0xf, 0xf8, 0, 0,
+ 0x23, 0xf, 0xf8, 0, 0,
+ 0x34, 0x66, 0xf, 0xf9, 0, 0,
+ 0x23, 0xf, 0xf9, 0, 0,
+ 0x34, 0x66, 0xf, 0xfa, 0, 0,
+ 0x23, 0xf, 0xfa, 0, 0,
+ 0x34, 0x66, 0xf, 0xfb, 0, 0,
+ 0x23, 0xf, 0xfb, 0, 0,
+ 0x34, 0x66, 0xf, 0xfc, 0, 0,
+ 0x23, 0xf, 0xfc, 0, 0,
+ 0x34, 0x66, 0xf, 0xfd, 0, 0,
+ 0x23, 0xf, 0xfd, 0, 0,
+ 0x34, 0x66, 0xf, 0xfe, 0, 0,
+ 0x23, 0xf, 0xfe, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0, 0, 0,
+ 0x34, 0xf, 0x38, 0, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x1, 0, 0,
+ 0x34, 0xf, 0x38, 0x1, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x2, 0, 0,
+ 0x34, 0xf, 0x38, 0x2, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x3, 0, 0,
+ 0x34, 0xf, 0x38, 0x3, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x4, 0, 0,
+ 0x34, 0xf, 0x38, 0x4, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x5, 0, 0,
+ 0x34, 0xf, 0x38, 0x5, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x6, 0, 0,
+ 0x34, 0xf, 0x38, 0x6, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x7, 0, 0,
+ 0x34, 0xf, 0x38, 0x7, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x8, 0, 0,
+ 0x34, 0xf, 0x38, 0x8, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x9, 0, 0,
+ 0x34, 0xf, 0x38, 0x9, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0xa, 0, 0,
+ 0x34, 0xf, 0x38, 0xa, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0xb, 0, 0,
+ 0x34, 0xf, 0x38, 0xb, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x1c, 0, 0,
+ 0x34, 0xf, 0x38, 0x1c, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x1d, 0, 0,
+ 0x34, 0xf, 0x38, 0x1d, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x1e, 0, 0,
+ 0x34, 0xf, 0x38, 0x1e, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0xf, 0, 0,
+ 0x34, 0xf, 0x3a, 0xf, 0, 0,
+ 0x34, 0x66, 0xf, 0xc7, 0x38, 0x30,
+ 0x34, 0xf3, 0xf, 0xc7, 0x38, 0x30,
+ 0x23, 0xf, 0xc7, 0x38, 0x30,
+ 0x23, 0xf, 0xc7, 0x38, 0x38,
+ 0x34, 0x66, 0xf, 0x71, 0xf8, 0xd0,
+ 0x23, 0xf, 0x71, 0xf8, 0xd0,
+ 0x34, 0x66, 0xf, 0x71, 0xf8, 0xe0,
+ 0x23, 0xf, 0x71, 0xf8, 0xe0,
+ 0x34, 0x66, 0xf, 0x71, 0xf8, 0xf0,
+ 0x23, 0xf, 0x71, 0xf8, 0xf0,
+ 0x34, 0x66, 0xf, 0x72, 0xf8, 0xd0,
+ 0x23, 0xf, 0x72, 0xf8, 0xd0,
+ 0x34, 0x66, 0xf, 0x72, 0xf8, 0xe0,
+ 0x23, 0xf, 0x72, 0xf8, 0xe0,
+ 0x34, 0x66, 0xf, 0x72, 0xf8, 0xf0,
+ 0x23, 0xf, 0x72, 0xf8, 0xf0,
+ 0x34, 0x66, 0xf, 0x73, 0xf8, 0xd0,
+ 0x23, 0xf, 0x73, 0xf8, 0xd0,
+ 0x34, 0x66, 0xf, 0x73, 0xf8, 0xd8,
+ 0x34, 0x66, 0xf, 0x73, 0xf8, 0xf0,
+ 0x23, 0xf, 0x73, 0xf8, 0xf0,
+ 0x34, 0x66, 0xf, 0x73, 0xf8, 0xf8,
+ 0x33, 0xf, 0xae, 0xe8,
+ 0x33, 0xf, 0xae, 0xf0,
+ 0x33, 0xf, 0xae, 0xf8,
+ 0x23, 0xf, 0xae, 0x38, 0x38,
+ 0x23, 0xf, 0xf, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0xc, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0xd, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x14, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x15, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0x40, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0x41, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0x21, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x2a, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0x42, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x2b, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x10, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0xe, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x29, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0x61, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0x60, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0x63, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0x62, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x37, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x41, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0x20, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0x22, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x3c, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x3d, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x3f, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x3e, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x38, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x39, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x3b, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x3a, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x20, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x21, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x22, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x23, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x24, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x25, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x30, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x31, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x32, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x33, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x34, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x35, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x28, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x40, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x17, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0x8, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0x9, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0xa, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0xb, 0, 0,
+ 0x1, 0xe7, 0x7,
+};
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/m68k_backend.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/m68k_backend.diff
new file mode 100644
index 000000000..5b621f92f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/m68k_backend.diff
@@ -0,0 +1,309 @@
+Upstream-Status: Backport
+
+Index: elfutils-0.146/backends/m68k_init.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.146/backends/m68k_init.c 2010-04-24 10:11:38.000000000 +0000
+@@ -0,0 +1,49 @@
++/* Initialization of m68k specific backend library.
++ Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
++
++ This software 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 softare is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++
++ You should have received a copy of the GNU General Public License along
++ with this software; if not, write to the Free Software Foundation,
++ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++*/
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#define BACKEND m68k_
++#define RELOC_PREFIX R_68K_
++#include "libebl_CPU.h"
++
++/* This defines the common reloc hooks based on m68k_reloc.def. */
++#include "common-reloc.c"
++
++
++const char *
++m68k_init (elf, machine, eh, ehlen)
++ 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. */
++ eh->name = "m68k";
++ m68k_init_reloc (eh);
++ HOOK (eh, reloc_simple_type);
++ HOOK (eh, register_info);
++
++ return MODVERSION;
++}
+Index: elfutils-0.146/backends/m68k_regs.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.146/backends/m68k_regs.c 2010-04-24 10:11:38.000000000 +0000
+@@ -0,0 +1,106 @@
++/* Register names and numbers for m68k DWARF.
++ Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
++
++ This software 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 software is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++
++ You should have received a copy of the GNU General Public License along
++ with this software; if not, write to the Free Software Foundation,
++ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++ */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <string.h>
++#include <dwarf.h>
++
++#define BACKEND m68k_
++#include "libebl_CPU.h"
++
++ssize_t
++m68k_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 25;
++
++ if (regno < 0 || regno > 24 || namelen < 5)
++ return -1;
++
++ *prefix = "%";
++ *bits = 32;
++ *type = (regno < 8 ? DW_ATE_signed
++ : regno < 16 ? DW_ATE_address : DW_ATE_float);
++
++ if (regno < 8)
++ {
++ *setname = "integer";
++ }
++ else if (regno < 16)
++ {
++ *setname = "address";
++ }
++ else if (regno < 24)
++ {
++ *setname = "FPU";
++ }
++ else
++ {
++ *setname = "address";
++ *type = DW_ATE_address;
++ }
++
++ switch (regno)
++ {
++ case 0 ... 7:
++ name[0] = 'd';
++ name[1] = regno + '0';
++ namelen = 2;
++ break;
++
++ case 8 ... 13:
++ name[0] = 'a';
++ name[1] = regno - 8 + '0';
++ namelen = 2;
++ break;
++
++ case 14:
++ name[0] = 'f';
++ name[1] = 'p';
++ namelen = 2;
++ break;
++
++ case 15:
++ name[0] = 's';
++ name[1] = 'p';
++ namelen = 2;
++ break;
++
++ case 16 ... 23:
++ name[0] = 'f';
++ name[1] = 'p';
++ name[2] = regno - 16 + '0';
++ namelen = 3;
++ break;
++
++ case 24:
++ name[0] = 'p';
++ name[1] = 'c';
++ namelen = 2;
++ }
++
++ name[namelen++] = '\0';
++ return namelen;
++}
++
+Index: elfutils-0.146/backends/m68k_reloc.def
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.146/backends/m68k_reloc.def 2010-04-24 10:11:38.000000000 +0000
+@@ -0,0 +1,45 @@
++/* List the relocation types for m68k. -*- C -*-
++ Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
++
++ This software 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 software is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++
++ You should have received a copy of the GNU General Public License along
++ with this software; if not, write to the Free Software Foundation,
++ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++*/
++
++/* NAME, REL|EXEC|DYN */
++
++RELOC_TYPE (NONE, 0)
++RELOC_TYPE (32, REL|EXEC|DYN)
++RELOC_TYPE (16, REL)
++RELOC_TYPE (8, REL)
++RELOC_TYPE (PC32, REL|EXEC|DYN)
++RELOC_TYPE (PC16, REL)
++RELOC_TYPE (PC8, REL)
++RELOC_TYPE (GOT32, REL)
++RELOC_TYPE (GOT16, REL)
++RELOC_TYPE (GOT8, REL)
++RELOC_TYPE (GOT32O, REL)
++RELOC_TYPE (GOT16O, REL)
++RELOC_TYPE (GOT8O, REL)
++RELOC_TYPE (PLT32, REL)
++RELOC_TYPE (PLT16, REL)
++RELOC_TYPE (PLT8, REL)
++RELOC_TYPE (PLT32O, REL)
++RELOC_TYPE (PLT16O, REL)
++RELOC_TYPE (PLT8O, REL)
++RELOC_TYPE (COPY, EXEC)
++RELOC_TYPE (GLOB_DAT, EXEC|DYN)
++RELOC_TYPE (JMP_SLOT, EXEC|DYN)
++RELOC_TYPE (RELATIVE, EXEC|DYN)
++RELOC_TYPE (GNU_VTINHERIT, REL)
++RELOC_TYPE (GNU_VTENTRY, REL)
++
+Index: elfutils-0.146/libelf/elf.h
+===================================================================
+--- elfutils-0.146.orig/libelf/elf.h 2010-04-24 10:11:13.000000000 +0000
++++ elfutils-0.146/libelf/elf.h 2010-04-24 10:13:50.000000000 +0000
+@@ -1125,6 +1125,9 @@
+ #define R_68K_GLOB_DAT 20 /* Create GOT entry */
+ #define R_68K_JMP_SLOT 21 /* Create PLT entry */
+ #define R_68K_RELATIVE 22 /* Adjust by program base */
++/* The next 2 are GNU extensions to enable C++ vtable garbage collection. */
++#define R_68K_GNU_VTINHERIT 23
++#define R_68K_GNU_VTENTRY 24
+ #define R_68K_TLS_GD32 25 /* 32 bit GOT offset for GD */
+ #define R_68K_TLS_GD16 26 /* 16 bit GOT offset for GD */
+ #define R_68K_TLS_GD8 27 /* 8 bit GOT offset for GD */
+Index: elfutils-0.146/backends/Makefile.am
+===================================================================
+--- elfutils-0.146.orig/backends/Makefile.am 2010-04-24 10:11:23.000000000 +0000
++++ elfutils-0.146/backends/Makefile.am 2010-04-24 10:11:38.000000000 +0000
+@@ -29,11 +29,12 @@
+ -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw
+
+
+-modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390 parisc mips
++modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390 parisc mips m68k
+ 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_sparc_pic.a libebl_ppc_pic.a libebl_ppc64_pic.a \
+- libebl_s390_pic.a libebl_parisc_pic.a libebl_mips_pic.a
++ libebl_s390_pic.a libebl_parisc_pic.a libebl_mips_pic.a \
++ libebl_m68k_pic.a
+ noinst_LIBRARIES = $(libebl_pic)
+ noinst_DATA = $(libebl_pic:_pic.a=.so)
+
+@@ -103,6 +104,10 @@
+ libebl_mips_pic_a_SOURCES = $(mips_SRCS)
+ am_libebl_mips_pic_a_OBJECTS = $(mips_SRCS:.c=.os)
+
++m68k_SRCS = m68k_init.c m68k_symbol.c m68k_regs.c
++libebl_m68k_pic_a_SOURCES = $(m68k_SRCS)
++am_libebl_m68k_pic_a_OBJECTS = $(m68k_SRCS:.c=.os)
++
+ libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw)
+ @rm -f $(@:.so=.map)
+ echo 'ELFUTILS_$(PACKAGE_VERSION) { global: $*_init; local: *; };' \
+Index: elfutils-0.146/backends/m68k_symbol.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.146/backends/m68k_symbol.c 2010-04-24 10:11:38.000000000 +0000
+@@ -0,0 +1,43 @@
++/* m68k specific symbolic name handling.
++ Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
++
++ This software 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 software distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++
++ You should have received a copy of the GNU General Public License along
++ with this software; if not, write to the Free Software Foundation,
++ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++*/
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <elf.h>
++#include <stddef.h>
++
++#define BACKEND m68k_
++#include "libebl_CPU.h"
++
++/* Check for the simple reloc types. */
++Elf_Type
++m68k_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
++{
++ switch (type)
++ {
++ case R_68K_32:
++ return ELF_T_SWORD;
++ case R_68K_16:
++ return ELF_T_HALF;
++ case R_68K_8:
++ return ELF_T_BYTE;
++ default:
++ return ELF_T_NUM;
++ }
++}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/mips_backend.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/mips_backend.diff
new file mode 100644
index 000000000..3f81a75b1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/mips_backend.diff
@@ -0,0 +1,713 @@
+Upstream-Status: Backport
+
+Index: elfutils-0.145/backends/mips_init.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.145/backends/mips_init.c 2010-02-24 18:57:35.000000000 +0000
+@@ -0,0 +1,60 @@
++/* 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, machine, eh, ehlen)
++ 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;
++}
+Index: elfutils-0.145/backends/mips_regs.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.145/backends/mips_regs.c 2010-02-24 18:57:35.000000000 +0000
+@@ -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;
++}
+Index: elfutils-0.145/backends/mips_reloc.def
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.145/backends/mips_reloc.def 2010-02-24 18:57:35.000000000 +0000
+@@ -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
+Index: elfutils-0.145/backends/mips_retval.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.145/backends/mips_retval.c 2010-02-24 18:57:35.000000000 +0000
+@@ -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 || tag == DW_TAG_mutable_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;
++}
+Index: elfutils-0.145/backends/mips_symbol.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.145/backends/mips_symbol.c 2010-02-24 18:57:35.000000000 +0000
+@@ -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;
++ }
++}
+Index: elfutils-0.145/libebl/eblopenbackend.c
+===================================================================
+--- elfutils-0.145.orig/libebl/eblopenbackend.c 2010-02-24 18:55:51.000000000 +0000
++++ elfutils-0.145/libebl/eblopenbackend.c 2010-02-24 18:57:35.000000000 +0000
+@@ -91,6 +91,8 @@
+ { "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, 0, 0 },
+Index: elfutils-0.145/backends/common-reloc.c
+===================================================================
+--- elfutils-0.145.orig/backends/common-reloc.c 2010-02-24 18:55:51.000000000 +0000
++++ elfutils-0.145/backends/common-reloc.c 2010-02-24 18:57:35.000000000 +0000
+@@ -109,11 +109,13 @@
+ }
+
+
++#ifndef NO_COPY_RELOC
+ bool
+ EBLHOOK(copy_reloc_p) (int reloc)
+ {
+ return reloc == R_TYPE (COPY);
+ }
++#endif
+
+ bool
+ EBLHOOK(none_reloc_p) (int reloc)
+@@ -135,7 +137,9 @@
+ ebl->reloc_type_name = EBLHOOK(reloc_type_name);
+ ebl->reloc_type_check = EBLHOOK(reloc_type_check);
+ ebl->reloc_valid_use = EBLHOOK(reloc_valid_use);
++#ifndef NO_COPY_RELOC
+ ebl->copy_reloc_p = EBLHOOK(copy_reloc_p);
++#endif
+ ebl->none_reloc_p = EBLHOOK(none_reloc_p);
+ #ifndef NO_RELATIVE_RELOC
+ ebl->relative_reloc_p = EBLHOOK(relative_reloc_p);
+Index: elfutils-0.145/backends/Makefile.am
+===================================================================
+--- elfutils-0.145.orig/backends/Makefile.am 2010-02-24 18:57:26.000000000 +0000
++++ elfutils-0.145/backends/Makefile.am 2010-02-24 18:57:57.000000000 +0000
+@@ -29,11 +29,11 @@
+ -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw
+
+
+-modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390 parisc
++modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390 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_sparc_pic.a libebl_ppc_pic.a libebl_ppc64_pic.a \
+- libebl_s390_pic.a libebl_parisc_pic.a
++ libebl_s390_pic.a libebl_parisc_pic.a libebl_mips_pic.a
+ noinst_LIBRARIES = $(libebl_pic)
+ noinst_DATA = $(libebl_pic:_pic.a=.so)
+
+@@ -99,6 +99,10 @@
+ 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)
+ @rm -f $(@:.so=.map)
+ echo 'ELFUTILS_$(PACKAGE_VERSION) { global: $*_init; local: *; };' \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/nm-Fix-size-passed-to-snprintf-for-invalid-sh_name-case.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/nm-Fix-size-passed-to-snprintf-for-invalid-sh_name-case.patch
new file mode 100644
index 000000000..2b5dad368
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/nm-Fix-size-passed-to-snprintf-for-invalid-sh_name-case.patch
@@ -0,0 +1,27 @@
+Upstream-Status: Backport
+
+nm: Fix size passed to snprintf for invalid sh_name case.
+native build failed as following on Fedora18:
+nm.c: In function 'show_symbols_sysv':
+nm.c:756:27: error: argument to 'sizeof' in 'snprintf' call is the same expression as the destination; did you mean to provide an explicit length? [-Werror=sizeof-pointer-memaccess]
+ snprintf (name, sizeof name, "[invalid sh_name %#" PRIx32 "]",
+ ^
+
+The original commit is http://git.fedorahosted.org/cgit/elfutils.git/commit/src/nm.c?id=57bd66cabf6e6b9ecf622cdbf350804897a8df58
+
+Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com>
+
+--- elfutils-0.148/src/nm.c.org 2013-03-11 22:36:11.000000000 -0500
++++ elfutils-0.148/src/nm.c 2013-03-11 22:46:09.000000000 -0500
+@@ -752,8 +752,9 @@
+ gelf_getshdr (scn, &shdr_mem)->sh_name);
+ if (unlikely (name == NULL))
+ {
+- name = alloca (sizeof "[invalid sh_name 0x12345678]");
+- snprintf (name, sizeof name, "[invalid sh_name %#" PRIx32 "]",
++ const size_t bufsz = sizeof "[invalid sh_name 0x12345678]";
++ name = alloca (bufsz);
++ snprintf (name, bufsz, "[invalid sh_name %#" PRIx32 "]",
+ gelf_getshdr (scn, &shdr_mem)->sh_name);
+ }
+ scnnames[elf_ndxscn (scn)] = name;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/redhat-portability.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/redhat-portability.diff
new file mode 100644
index 000000000..b8a912c41
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/redhat-portability.diff
@@ -0,0 +1,756 @@
+Upstream-Status: Backport
+
+Index: elfutils-0.148/backends/ChangeLog
+===================================================================
+--- elfutils-0.148.orig/backends/ChangeLog 2010-04-13 20:08:02.000000000 +0000
++++ elfutils-0.148/backends/ChangeLog 2010-07-03 13:04:07.000000000 +0000
+@@ -106,6 +106,10 @@
+ * ppc_attrs.c (ppc_check_object_attribute): Handle tag
+ GNU_Power_ABI_Struct_Return.
+
++2009-01-23 Roland McGrath <roland@redhat.com>
++
++ * Makefile.am (libebl_%.so): Use $(LD_AS_NEEDED).
++
+ 2008-10-04 Ulrich Drepper <drepper@redhat.com>
+
+ * i386_reloc.def: Fix entries for TLS_GOTDESC, TLS_DESC_CALL, and
+@@ -433,6 +437,11 @@
+ * sparc_init.c: Likewise.
+ * x86_64_init.c: Likewise.
+
++2005-11-22 Roland McGrath <roland@redhat.com>
++
++ * Makefile.am (LD_AS_NEEDED): New variable, substituted by configure.
++ (libebl_%.so rule): Use it in place of -Wl,--as-needed.
++
+ 2005-11-19 Roland McGrath <roland@redhat.com>
+
+ * ppc64_reloc.def: REL30 -> ADDR30.
+@@ -455,6 +464,9 @@
+ * Makefile.am (uninstall): Don't try to remove $(pkgincludedir).
+ (CLEANFILES): Add libebl_$(m).so.
+
++ * Makefile.am (WEXTRA): New variable, substituted by configure.
++ (AM_CFLAGS): Use it in place of -Wextra.
++
+ * ppc_reloc.def: Update bits per Alan Modra <amodra@bigpond.net.au>.
+ * ppc64_reloc.def: Likewise.
+
+Index: elfutils-0.148/backends/Makefile.am
+===================================================================
+--- elfutils-0.148.orig/backends/Makefile.am 2010-04-13 20:08:02.000000000 +0000
++++ elfutils-0.148/backends/Makefile.am 2010-07-03 13:04:07.000000000 +0000
+@@ -103,7 +103,7 @@
+ $(LINK) -shared -o $(@:.map=.so) \
+ -Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \
+ -Wl,--version-script,$(@:.so=.map) \
+- -Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw) $(libmudflap)
++ -Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw) $(libmudflap)
+ $(textrel_check)
+
+ libebl_i386.so: $(cpu_i386)
+Index: elfutils-0.148/ChangeLog
+===================================================================
+--- elfutils-0.148.orig/ChangeLog 2010-04-21 14:26:40.000000000 +0000
++++ elfutils-0.148/ChangeLog 2010-07-03 13:04:07.000000000 +0000
+@@ -2,6 +2,10 @@
+
+ * configure.ac (LOCALEDIR, DATADIRNAME): Removed.
+
++2009-11-22 Roland McGrath <roland@redhat.com>
++
++ * configure.ac: Use sed and expr instead of modern bash extensions.
++
+ 2009-09-21 Ulrich Drepper <drepper@redhat.com>
+
+ * configure.ac: Update for more modern autoconf.
+@@ -10,6 +14,10 @@
+
+ * configure.ac (zip_LIBS): Check for liblzma too.
+
++2009-08-17 Roland McGrath <roland@redhat.com>
++
++ * configure.ac: Check for -fgnu89-inline; add it to WEXTRA if it works.
++
+ 2009-04-19 Roland McGrath <roland@redhat.com>
+
+ * configure.ac (eu_version): Round down here, not in version.h macros.
+@@ -21,6 +29,8 @@
+
+ 2009-01-23 Roland McGrath <roland@redhat.com>
+
++ * configure.ac: Check for __builtin_popcount.
++
+ * configure.ac (zlib check): Check for gzdirect, need zlib >= 1.2.2.3.
+
+ * configure.ac (__thread check): Use AC_LINK_IFELSE, in case of
+@@ -101,6 +111,10 @@
+ * configure.ac: Add dummy automake conditional to get dependencies
+ for non-generic linker right. See src/Makefile.am.
+
++2005-11-22 Roland McGrath <roland@redhat.com>
++
++ * configure.ac: Check for --as-needed linker option.
++
+ 2005-11-18 Roland McGrath <roland@redhat.com>
+
+ * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable.
+@@ -148,6 +162,17 @@
+ * Makefile.am (all_SUBDIRS): Add libdwfl.
+ * configure.ac: Write libdwfl/Makefile.
+
++2005-05-31 Roland McGrath <roland@redhat.com>
++
++ * configure.ac (WEXTRA): Check for -Wextra and set this substitution.
++
++ * configure.ac: Check for struct stat st_?tim members.
++ * src/strip.c (process_file): Use st_?time if st_?tim are not there.
++
++ * configure.ac: Check for futimes function.
++ * src/strip.c (handle_elf) [! HAVE_FUTIMES]: Use utimes instead.
++ (handle_ar) [! HAVE_FUTIMES]: Likewise.
++
+ 2005-05-19 Roland McGrath <roland@redhat.com>
+
+ * configure.ac [AH_BOTTOM] (INTDECL, _INTDECL): New macros.
+Index: elfutils-0.148/config/eu.am
+===================================================================
+--- elfutils-0.148.orig/config/eu.am 2010-04-21 14:26:40.000000000 +0000
++++ elfutils-0.148/config/eu.am 2010-07-03 13:04:07.000000000 +0000
+@@ -25,11 +25,14 @@
+ ## <http://www.openinventionnetwork.com>.
+ ##
+
++WEXTRA = @WEXTRA@
++LD_AS_NEEDED = @LD_AS_NEEDED@
++
+ DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"${localedir}"'
+ INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I..
+ AM_CFLAGS = -std=gnu99 -Wall -Wshadow \
+ $(if $($(*F)_no_Werror),,-Werror) \
+- $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
++ $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \
+ $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) \
+ $($(*F)_CFLAGS)
+
+Index: elfutils-0.148/config.h.in
+===================================================================
+--- elfutils-0.148.orig/config.h.in 2010-06-28 19:07:37.000000000 +0000
++++ elfutils-0.148/config.h.in 2010-07-03 13:04:07.000000000 +0000
+@@ -1,5 +1,8 @@
+ /* config.h.in. Generated from configure.ac by autoheader. */
+
++/* Have __builtin_popcount. */
++#undef HAVE_BUILTIN_POPCOUNT
++
+ /* $libdir subdirectory containing libebl modules. */
+ #undef LIBEBL_SUBDIR
+
+@@ -55,4 +58,7 @@
+ /* Define for large files, on AIX-style hosts. */
+ #undef _LARGE_FILES
+
++/* Stubbed out if missing compiler support. */
++#undef __thread
++
+ #include <eu-config.h>
+Index: elfutils-0.148/configure.ac
+===================================================================
+--- elfutils-0.148.orig/configure.ac 2010-06-28 19:07:26.000000000 +0000
++++ elfutils-0.148/configure.ac 2010-07-03 13:04:07.000000000 +0000
+@@ -73,6 +73,54 @@
+ AS_IF([test "x$ac_cv_c99" != xyes],
+ AC_MSG_ERROR([gcc with C99 support required]))
+
++AC_CACHE_CHECK([for -Wextra option to $CC], ac_cv_cc_wextra, [dnl
++old_CFLAGS="$CFLAGS"
++CFLAGS="$CFLAGS -Wextra"
++AC_COMPILE_IFELSE([void foo (void) { }],
++ ac_cv_cc_wextra=yes, ac_cv_cc_wextra=no)
++CFLAGS="$old_CFLAGS"])
++AC_SUBST(WEXTRA)
++AS_IF([test "x$ac_cv_cc_wextra" = xyes], [WEXTRA=-Wextra], [WEXTRA=-W])
++
++AC_CACHE_CHECK([for -fgnu89-inline option to $CC], ac_cv_cc_gnu89_inline, [dnl
++old_CFLAGS="$CFLAGS"
++CFLAGS="$CFLAGS -fgnu89-inline -Werror"
++AC_COMPILE_IFELSE([
++void foo (void)
++{
++ inline void bar (void) {}
++ bar ();
++}
++extern inline void baz (void) {}
++], ac_cv_cc_gnu89_inline=yes, ac_cv_cc_gnu89_inline=no)
++CFLAGS="$old_CFLAGS"])
++AS_IF([test "x$ac_cv_cc_gnu89_inline" = xyes],
++ [WEXTRA="${WEXTRA:+$WEXTRA }-fgnu89-inline"])
++
++AC_CACHE_CHECK([for --as-needed linker option],
++ ac_cv_as_needed, [dnl
++cat > conftest.c <<EOF
++int main (void) { return 0; }
++EOF
++if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
++ -fPIC -shared -o conftest.so conftest.c
++ -Wl,--as-needed 1>&AS_MESSAGE_LOG_FD])
++then
++ ac_cv_as_needed=yes
++else
++ ac_cv_as_needed=no
++fi
++rm -f conftest*])
++AS_IF([test "x$ac_cv_as_needed" = xyes],
++ [LD_AS_NEEDED=-Wl,--as-needed], [LD_AS_NEEDED=])
++AC_SUBST(LD_AS_NEEDED)
++
++AC_CACHE_CHECK([for __builtin_popcount], ac_cv_popcount, [dnl
++AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[exit (__builtin_popcount (127));]])],
++ ac_cv_popcount=yes, ac_cv_popcount=no)])
++AS_IF([test "x$ac_cv_popcount" = xyes],
++ [AC_DEFINE([HAVE_BUILTIN_POPCOUNT], [1], [Have __builtin_popcount.])])
++
+ AC_CACHE_CHECK([for __thread support], ac_cv_tls, [dnl
+ # Use the same flags that we use for our DSOs, so the test is representative.
+ # Some old compiler/linker/libc combinations fail some ways and not others.
+@@ -88,7 +136,10 @@
+ CFLAGS="$save_CFLAGS"
+ LDFLAGS="$save_LDFLAGS"])
+ AS_IF([test "x$ac_cv_tls" != xyes],
+- AC_MSG_ERROR([__thread support required]))
++ [AS_IF([test "$use_locks" = yes],
++ [AC_MSG_ERROR([--enable-thread-safety requires __thread support])],
++ [AC_DEFINE([__thread], [/* empty: no multi-thread support */],
++ [Stubbed out if missing compiler support.])])])
+
+ dnl This test must come as early as possible after the compiler configuration
+ dnl tests, because the choice of the file model can (in principle) affect
+@@ -251,7 +302,7 @@
+
+ # 1.234<whatever> -> 1234<whatever>
+ case "$PACKAGE_VERSION" in
+-[[0-9]].*) eu_version="${PACKAGE_VERSION/./}" ;;
++[[0-9]].*) eu_version=`echo "$PACKAGE_VERSION" | sed 's@\.@@'` ;;
+ *) AC_MSG_ERROR([confused by version number '$PACKAGE_VERSION']) ;;
+ esac
+ case "$eu_version" in
+@@ -280,6 +331,6 @@
+ esac
+
+ # Round up to the next release API (x.y) version.
+-[eu_version=$[($eu_version + 999) / 1000]]
++eu_version=`expr \( $eu_version + 999 \) / 1000`
+
+ AC_OUTPUT
+Index: elfutils-0.148/lib/ChangeLog
+===================================================================
+--- elfutils-0.148.orig/lib/ChangeLog 2010-06-28 19:05:56.000000000 +0000
++++ elfutils-0.148/lib/ChangeLog 2010-07-03 13:04:07.000000000 +0000
+@@ -14,6 +14,9 @@
+
+ 2009-01-23 Roland McGrath <roland@redhat.com>
+
++ * eu-config.h [! HAVE_BUILTIN_POPCOUNT]
++ (__builtin_popcount): New inline function.
++
+ * eu-config.h: Add multiple inclusion protection.
+
+ 2009-01-17 Ulrich Drepper <drepper@redhat.com>
+@@ -70,6 +73,11 @@
+ * Makefile.am (libeu_a_SOURCES): Add it.
+ * system.h: Declare crc32_file.
+
++2005-02-07 Roland McGrath <roland@redhat.com>
++
++ * Makefile.am (WEXTRA): New variable, substituted by configure.
++ (AM_CFLAGS): Use it in place of -Wextra.
++
+ 2005-04-30 Ulrich Drepper <drepper@redhat.com>
+
+ * Makefile.am: Use -ffunction-sections for xmalloc.c.
+Index: elfutils-0.148/lib/eu-config.h
+===================================================================
+--- elfutils-0.148.orig/lib/eu-config.h 2009-08-12 14:23:22.000000000 +0000
++++ elfutils-0.148/lib/eu-config.h 2010-07-03 13:04:07.000000000 +0000
+@@ -182,6 +182,17 @@
+ /* This macro is used by the tests conditionalize for standalone building. */
+ #define ELFUTILS_HEADER(name) <lib##name.h>
+
++#ifndef HAVE_BUILTIN_POPCOUNT
++# define __builtin_popcount hakmem_popcount
++static inline unsigned int __attribute__ ((unused))
++hakmem_popcount (unsigned int x)
++{
++ /* HAKMEM 169 */
++ unsigned int n = x - ((x >> 1) & 033333333333) - ((x >> 2) & 011111111111);
++ return ((n + (n >> 3)) & 030707070707) % 63;
++}
++#endif /* HAVE_BUILTIN_POPCOUNT */
++
+
+ #ifdef SHARED
+ # define OLD_VERSION(name, version) \
+Index: elfutils-0.148/libasm/ChangeLog
+===================================================================
+--- elfutils-0.148.orig/libasm/ChangeLog 2010-03-05 05:48:23.000000000 +0000
++++ elfutils-0.148/libasm/ChangeLog 2010-07-03 13:04:07.000000000 +0000
+@@ -67,6 +67,11 @@
+ * asm_error.c: Add new error ASM_E_IOERROR.
+ * libasmP.h: Add ASM_E_IOERROR definition.
+
++2005-05-31 Roland McGrath <roland@redhat.com>
++
++ * Makefile.am (WEXTRA): New variable, substituted by configure.
++ (AM_CFLAGS): Use it in place of -Wextra.
++
+ 2005-02-15 Ulrich Drepper <drepper@redhat.com>
+
+ * Makefile.am (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
+Index: elfutils-0.148/libcpu/ChangeLog
+===================================================================
+--- elfutils-0.148.orig/libcpu/ChangeLog 2010-03-05 05:48:23.000000000 +0000
++++ elfutils-0.148/libcpu/ChangeLog 2010-07-03 13:04:07.000000000 +0000
+@@ -9,6 +9,9 @@
+
+ 2009-01-23 Roland McGrath <roland@redhat.com>
+
++ * i386_disasm.c (i386_disasm): Add abort after assert-constant for old
++ compilers that don't realize it's noreturn.
++
+ * Makefile.am (i386_parse_CFLAGS): Use quotes around command
+ substitution that can produce leading whitespace.
+
+@@ -338,6 +341,11 @@
+ * defs/i386.doc: New file.
+ * defs/x86_64: New file.
+
++2005-04-04 Roland McGrath <roland@redhat.com>
++
++ * Makefile.am (WEXTRA): New variable, substituted by configure.
++ (AM_CFLAGS): Use it instead of -Wextra.
++
+ 2005-02-15 Ulrich Drepper <drepper@redhat.com>
+
+ * Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
+Index: elfutils-0.148/libcpu/i386_disasm.c
+===================================================================
+--- elfutils-0.148.orig/libcpu/i386_disasm.c 2009-01-08 20:56:36.000000000 +0000
++++ elfutils-0.148/libcpu/i386_disasm.c 2010-07-03 13:04:07.000000000 +0000
+@@ -791,6 +791,7 @@
+
+ default:
+ assert (! "INVALID not handled");
++ abort ();
+ }
+ }
+ else
+Index: elfutils-0.148/libdw/ChangeLog
+===================================================================
+--- elfutils-0.148.orig/libdw/ChangeLog 2010-06-28 19:05:56.000000000 +0000
++++ elfutils-0.148/libdw/ChangeLog 2010-07-03 13:04:07.000000000 +0000
+@@ -276,6 +276,10 @@
+
+ * dwarf_hasattr_integrate.c: Integrate DW_AT_specification too.
+
++2009-08-17 Roland McGrath <roland@redhat.com>
++
++ * libdw.h: Disable extern inlines for GCC 4.2.
++
+ 2009-08-10 Roland McGrath <roland@redhat.com>
+
+ * dwarf_getscopevar.c: Use dwarf_diename.
+@@ -1044,6 +1048,11 @@
+
+ 2005-05-31 Roland McGrath <roland@redhat.com>
+
++ * Makefile.am (WEXTRA): New variable, substituted by configure.
++ (AM_CFLAGS): Use it in place of -Wextra.
++
++2005-05-31 Roland McGrath <roland@redhat.com>
++
+ * dwarf_formref_die.c (dwarf_formref_die): Add CU header offset to
+ formref offset.
+
+Index: elfutils-0.148/libdw/libdw.h
+===================================================================
+--- elfutils-0.148.orig/libdw/libdw.h 2010-06-28 19:05:56.000000000 +0000
++++ elfutils-0.148/libdw/libdw.h 2010-07-03 13:04:07.000000000 +0000
+@@ -842,7 +842,7 @@
+
+
+ /* Inline optimizations. */
+-#ifdef __OPTIMIZE__
++#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
+ /* Return attribute code of given attribute. */
+ __libdw_extern_inline unsigned int
+ dwarf_whatattr (Dwarf_Attribute *attr)
+Index: elfutils-0.148/libdwfl/ChangeLog
+===================================================================
+--- elfutils-0.148.orig/libdwfl/ChangeLog 2010-06-28 19:05:56.000000000 +0000
++++ elfutils-0.148/libdwfl/ChangeLog 2010-07-03 13:04:07.000000000 +0000
+@@ -1265,6 +1265,11 @@
+
+ 2005-07-21 Roland McGrath <roland@redhat.com>
+
++ * Makefile.am (WEXTRA): New variable, substituted by configure.
++ (AM_CFLAGS): Use it in place of -Wextra.
++
++2005-07-21 Roland McGrath <roland@redhat.com>
++
+ * Makefile.am (noinst_HEADERS): Add loc2c.c.
+
+ * test2.c (main): Check sscanf result to quiet warning.
+Index: elfutils-0.148/libebl/ChangeLog
+===================================================================
+--- elfutils-0.148.orig/libebl/ChangeLog 2010-03-05 05:48:23.000000000 +0000
++++ elfutils-0.148/libebl/ChangeLog 2010-07-03 13:04:07.000000000 +0000
+@@ -624,6 +624,11 @@
+ * Makefile.am (libebl_*_so_SOURCES): Set to $(*_SRCS) so dependency
+ tracking works right.
+
++2005-05-31 Roland McGrath <roland@redhat.com>
++
++ * Makefile.am (WEXTRA): New variable, substituted by configure.
++ (AM_CFLAGS): Use it in place of -Wextra.
++
+ 2005-05-21 Ulrich Drepper <drepper@redhat.com>
+
+ * libebl_x86_64.map: Add x86_64_core_note.
+Index: elfutils-0.148/libelf/ChangeLog
+===================================================================
+--- elfutils-0.148.orig/libelf/ChangeLog 2010-06-14 21:17:20.000000000 +0000
++++ elfutils-0.148/libelf/ChangeLog 2010-07-03 13:04:07.000000000 +0000
+@@ -657,6 +657,11 @@
+
+ * elf.h: Update from glibc.
+
++2005-05-31 Roland McGrath <roland@redhat.com>
++
++ * Makefile.am (WEXTRA): New variable, substituted by configure.
++ (AM_CFLAGS): Use it in place of -Wextra.
++
+ 2005-05-08 Roland McGrath <roland@redhat.com>
+
+ * elf_begin.c (read_file) [_MUDFLAP]: Don't use mmap for now.
+Index: elfutils-0.148/libelf/common.h
+===================================================================
+--- elfutils-0.148.orig/libelf/common.h 2009-01-08 20:56:36.000000000 +0000
++++ elfutils-0.148/libelf/common.h 2010-07-03 13:04:07.000000000 +0000
+@@ -160,7 +160,7 @@
+ (Var) = (sizeof (Var) == 1 \
+ ? (unsigned char) (Var) \
+ : (sizeof (Var) == 2 \
+- ? bswap_16 (Var) \
++ ? (unsigned short int) bswap_16 (Var) \
+ : (sizeof (Var) == 4 \
+ ? bswap_32 (Var) \
+ : bswap_64 (Var))))
+@@ -169,7 +169,7 @@
+ (Dst) = (sizeof (Var) == 1 \
+ ? (unsigned char) (Var) \
+ : (sizeof (Var) == 2 \
+- ? bswap_16 (Var) \
++ ? (unsigned short int) bswap_16 (Var) \
+ : (sizeof (Var) == 4 \
+ ? bswap_32 (Var) \
+ : bswap_64 (Var))))
+Index: elfutils-0.148/src/addr2line.c
+===================================================================
+--- elfutils-0.148.orig/src/addr2line.c 2010-05-28 14:38:30.000000000 +0000
++++ elfutils-0.148/src/addr2line.c 2010-07-03 13:05:40.000000000 +0000
+@@ -447,10 +447,10 @@
+ bool parsed = false;
+ int i, j;
+ char *name = NULL;
+- if (sscanf (string, "(%m[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
++ if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
+ && string[i] == '\0')
+ parsed = adjust_to_section (name, &addr, dwfl);
+- switch (sscanf (string, "%m[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
++ switch (sscanf (string, "%a[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
+ {
+ default:
+ break;
+Index: elfutils-0.148/src/ChangeLog
+===================================================================
+--- elfutils-0.148.orig/src/ChangeLog 2010-06-28 19:05:56.000000000 +0000
++++ elfutils-0.148/src/ChangeLog 2010-07-03 13:04:08.000000000 +0000
+@@ -165,8 +165,16 @@
+ * readelf.c (attr_callback): Use print_block only when we don't use
+ print_ops.
+
++2009-08-17 Roland McGrath <roland@redhat.com>
++
++ * ld.h: Disable extern inlines for GCC 4.2.
++
+ 2009-08-14 Roland McGrath <roland@redhat.com>
+
++ * strings.c (read_block): Conditionalize posix_fadvise use
++ on [POSIX_FADV_SEQUENTIAL].
++ From Petr Salinger <Petr.Salinger@seznam.cz>.
++
+ * ar.c (do_oper_extract): Use pathconf instead of statfs.
+
+ 2009-08-01 Ulrich Drepper <drepper@redhat.com>
+@@ -330,6 +338,8 @@
+ * readelf.c (print_debug_frame_section): Use t instead of j formats
+ for ptrdiff_t OFFSET.
+
++ * addr2line.c (handle_address): Use %a instead of %m for compatibility.
++
+ 2009-01-21 Ulrich Drepper <drepper@redhat.com>
+
+ * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
+@@ -513,6 +523,11 @@
+ that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really
+ is valid in RELRO.
+
++2008-03-01 Roland McGrath <roland@redhat.com>
++
++ * readelf.c (dump_archive_index): Tweak portability hack
++ to match [__GNUC__ < 4] too.
++
+ 2008-02-29 Roland McGrath <roland@redhat.com>
+
+ * readelf.c (print_attributes): Add a cast.
+@@ -764,6 +779,8 @@
+
+ * readelf.c (hex_dump): Fix rounding error in whitespace calculation.
+
++ * Makefile.am (readelf_no_Werror): New variable.
++
+ 2007-10-15 Roland McGrath <roland@redhat.com>
+
+ * make-debug-archive.in: New file.
+@@ -1203,6 +1220,10 @@
+ * elflint.c (valid_e_machine): Add EM_ALPHA.
+ Reported by Christian Aichinger <Greek0@gmx.net>.
+
++ * strings.c (map_file): Define POSIX_MADV_SEQUENTIAL to
++ MADV_SEQUENTIAL if undefined. Don't call posix_madvise
++ if neither is defined.
++
+ 2006-08-08 Ulrich Drepper <drepper@redhat.com>
+
+ * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
+@@ -1279,6 +1300,10 @@
+ * Makefile.am: Add hacks to create dependency files for non-generic
+ linker.
+
++2006-04-05 Roland McGrath <roland@redhat.com>
++
++ * strings.c (MAP_POPULATE): Define to 0 if undefined.
++
+ 2006-06-12 Ulrich Drepper <drepper@redhat.com>
+
+ * ldgeneric.c (ld_generic_generate_sections): Don't create .interp
+@@ -1627,6 +1652,11 @@
+ * readelf.c (print_debug_loc_section): Fix indentation for larger
+ address size.
+
++2005-05-31 Roland McGrath <roland@redhat.com>
++
++ * Makefile.am (WEXTRA): New variable, substituted by configure.
++ (AM_CFLAGS): Use it in place of -Wextra.
++
+ 2005-05-30 Roland McGrath <roland@redhat.com>
+
+ * readelf.c (print_debug_line_section): Print section offset of each
+Index: elfutils-0.148/src/findtextrel.c
+===================================================================
+--- elfutils-0.148.orig/src/findtextrel.c 2009-02-11 01:12:59.000000000 +0000
++++ elfutils-0.148/src/findtextrel.c 2010-07-03 13:04:08.000000000 +0000
+@@ -490,7 +490,11 @@
+
+
+ static void
+-check_rel (size_t nsegments, struct segments segments[nsegments],
++check_rel (size_t nsegments, struct segments segments[
++#if __GNUC__ >= 4
++ nsegments
++#endif
++ ],
+ GElf_Addr addr, Elf *elf, Elf_Scn *symscn, Dwarf *dw,
+ const char *fname, bool more_than_one, void **knownsrcs)
+ {
+Index: elfutils-0.148/src/ld.h
+===================================================================
+--- elfutils-0.148.orig/src/ld.h 2009-06-13 22:39:51.000000000 +0000
++++ elfutils-0.148/src/ld.h 2010-07-03 13:04:08.000000000 +0000
+@@ -1122,6 +1122,7 @@
+
+ /* Checked whether the symbol is undefined and referenced from a DSO. */
+ extern bool linked_from_dso_p (struct scninfo *scninfo, size_t symidx);
++#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
+ #ifdef __GNUC_STDC_INLINE__
+ __attribute__ ((__gnu_inline__))
+ #endif
+@@ -1139,5 +1140,6 @@
+
+ return sym->defined && sym->in_dso;
+ }
++#endif /* Optimizing and not GCC 4.2. */
+
+ #endif /* ld.h */
+Index: elfutils-0.148/src/Makefile.am
+===================================================================
+--- elfutils-0.148.orig/src/Makefile.am 2010-03-05 05:48:23.000000000 +0000
++++ elfutils-0.148/src/Makefile.am 2010-07-03 13:04:08.000000000 +0000
+@@ -99,6 +99,9 @@
+ # XXX While the file is not finished, don't warn about this
+ ldgeneric_no_Wunused = yes
+
++# Buggy old compilers.
++readelf_no_Werror = yes
++
+ readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
+ nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
+ size_LDADD = $(libelf) $(libeu) $(libmudflap)
+
+Index: elfutils-0.148/src/readelf.c
+===================================================================
+--- elfutils-0.148.orig/src/readelf.c 2010-06-28 19:05:56.000000000 +0000
++++ elfutils-0.148/src/readelf.c 2010-07-03 13:04:08.000000000 +0000
+@@ -7845,7 +7845,7 @@
+ if (unlikely (elf_rand (elf, as_off) == 0)
+ || unlikely ((subelf = elf_begin (-1, ELF_C_READ_MMAP, elf))
+ == NULL))
+-#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7)
++#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7) || __GNUC__ < 4
+ while (1)
+ #endif
+ error (EXIT_FAILURE, 0,
+Index: elfutils-0.148/src/strings.c
+===================================================================
+--- elfutils-0.148.orig/src/strings.c 2009-02-11 01:12:59.000000000 +0000
++++ elfutils-0.148/src/strings.c 2010-07-03 13:04:08.000000000 +0000
+@@ -51,6 +51,10 @@
+
+ #include <system.h>
+
++#ifndef MAP_POPULATE
++# define MAP_POPULATE 0
++#endif
++
+
+ /* Prototypes of local functions. */
+ static int read_fd (int fd, const char *fname, off64_t fdlen);
+@@ -491,8 +495,13 @@
+ fd, start_off);
+ if (mem != MAP_FAILED)
+ {
++#if !defined POSIX_MADV_SEQUENTIAL && defined MADV_SEQUENTIAL
++# define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL
++#endif
++#ifdef POSIX_MADV_SEQUENTIAL
+ /* We will go through the mapping sequentially. */
+ (void) posix_madvise (mem, map_size, POSIX_MADV_SEQUENTIAL);
++#endif
+ break;
+ }
+ if (errno != EINVAL && errno != ENOMEM)
+@@ -586,9 +595,11 @@
+ elfmap_off = from & ~(ps - 1);
+ elfmap_base = elfmap = map_file (fd, elfmap_off, fdlen, &elfmap_size);
+
++#ifdef POSIX_FADV_SEQUENTIAL
+ if (unlikely (elfmap == MAP_FAILED))
+ /* Let the kernel know we are going to read everything in sequence. */
+ (void) posix_fadvise (fd, 0, 0, POSIX_FADV_SEQUENTIAL);
++#endif
+ }
+
+ if (unlikely (elfmap == MAP_FAILED))
+Index: elfutils-0.148/src/strip.c
+===================================================================
+--- elfutils-0.148.orig/src/strip.c 2010-01-15 09:05:55.000000000 +0000
++++ elfutils-0.148/src/strip.c 2010-07-03 13:04:08.000000000 +0000
+@@ -53,6 +53,12 @@
+ #include <libebl.h>
+ #include <system.h>
+
++#ifdef HAVE_FUTIMES
++# define FUTIMES(fd, fname, tvp) futimes (fd, tvp)
++#else
++# define FUTIMES(fd, fname, tvp) utimes (fname, tvp)
++#endif
++
+
+ /* Name and version of program. */
+ static void print_version (FILE *stream, struct argp_state *state);
+@@ -301,8 +307,18 @@
+
+ /* If we have to preserve the timestamp, we need it in the
+ format utimes() understands. */
++#ifdef HAVE_STRUCT_STAT_ST_ATIM
+ TIMESPEC_TO_TIMEVAL (&tv[0], &pre_st.st_atim);
++#else
++ tv[0].tv_sec = pre_st.st_atime;
++ tv[0].tv_usec = 0;
++#endif
++#ifdef HAVE_STRUCT_STAT_ST_MTIM
+ TIMESPEC_TO_TIMEVAL (&tv[1], &pre_st.st_mtim);
++#else
++ tv[1].tv_sec = pre_st.st_atime;
++ tv[1].tv_usec = 0;
++#endif
+ }
+
+ /* Open the file. */
+@@ -1747,7 +1763,7 @@
+ /* If requested, preserve the timestamp. */
+ if (tvp != NULL)
+ {
+- if (futimes (fd, tvp) != 0)
++ if (FUTIMES (fd, output_fname, tvp) != 0)
+ {
+ error (0, errno, gettext ("\
+ cannot set access and modification date of '%s'"),
+@@ -1804,7 +1820,7 @@
+
+ if (tvp != NULL)
+ {
+- if (unlikely (futimes (fd, tvp) != 0))
++ if (unlikely (FUTIMES (fd, fname, tvp) != 0))
+ {
+ error (0, errno, gettext ("\
+ cannot set access and modification date of '%s'"), fname);
+Index: elfutils-0.148/tests/ChangeLog
+===================================================================
+--- elfutils-0.148.orig/tests/ChangeLog 2010-06-28 19:05:56.000000000 +0000
++++ elfutils-0.148/tests/ChangeLog 2010-07-03 13:04:08.000000000 +0000
+@@ -154,6 +154,8 @@
+
+ 2008-01-21 Roland McGrath <roland@redhat.com>
+
++ * line2addr.c (main): Revert last change.
++
+ * testfile45.S.bz2: Add tests for cltq, cqto.
+ * testfile45.expect.bz2: Adjust.
+
+@@ -862,6 +864,11 @@
+ * Makefile.am (TESTS): Add run-elflint-test.sh.
+ (EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2.
+
++2005-05-31 Roland McGrath <roland@redhat.com>
++
++ * Makefile.am (WEXTRA): New variable, substituted by configure.
++ (AM_CFLAGS): Use it in place of -Wextra.
++
+ 2005-05-24 Ulrich Drepper <drepper@redhat.com>
+
+ * get-files.c (main): Use correct format specifier.
+Index: elfutils-0.148/tests/line2addr.c
+===================================================================
+--- elfutils-0.148.orig/tests/line2addr.c 2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/tests/line2addr.c 2010-07-03 13:04:08.000000000 +0000
+@@ -132,7 +132,7 @@
+ {
+ struct args a = { .arg = argv[cnt] };
+
+- switch (sscanf (a.arg, "%m[^:]:%d", &a.file, &a.line))
++ switch (sscanf (a.arg, "%a[^:]:%d", &a.file, &a.line))
+ {
+ default:
+ case 0:
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/redhat-robustify.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/redhat-robustify.diff
new file mode 100644
index 000000000..cd398549d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/redhat-robustify.diff
@@ -0,0 +1,1709 @@
+Upstream-Status: Backport
+
+Index: elfutils-0.148/libelf/ChangeLog
+===================================================================
+--- elfutils-0.148.orig/libelf/ChangeLog 2010-07-03 13:07:10.000000000 +0000
++++ elfutils-0.148/libelf/ChangeLog 2010-07-03 13:07:11.000000000 +0000
+@@ -649,10 +649,53 @@
+ If section content hasn't been read yet, do it before looking for the
+ block size. If no section data present, infer size of section header.
+
++2005-05-14 Jakub Jelinek <jakub@redhat.com>
++
++ * libelfP.h (INVALID_NDX): Define.
++ * gelf_getdyn.c (gelf_getdyn): Use it. Remove ndx < 0 test if any.
++ * gelf_getlib.c (gelf_getlib): Likewise.
++ * gelf_getmove.c (gelf_getmove): Likewise.
++ * gelf_getrel.c (gelf_getrel): Likewise.
++ * gelf_getrela.c (gelf_getrela): Likewise.
++ * gelf_getsym.c (gelf_getsym): Likewise.
++ * gelf_getsyminfo.c (gelf_getsyminfo): Likewise.
++ * gelf_getsymshndx.c (gelf_getsymshndx): Likewise.
++ * gelf_getversym.c (gelf_getversym): Likewise.
++ * gelf_update_dyn.c (gelf_update_dyn): Likewise.
++ * gelf_update_lib.c (gelf_update_lib): Likewise.
++ * gelf_update_move.c (gelf_update_move): Likewise.
++ * gelf_update_rel.c (gelf_update_rel): Likewise.
++ * gelf_update_rela.c (gelf_update_rela): Likewise.
++ * gelf_update_sym.c (gelf_update_sym): Likewise.
++ * gelf_update_syminfo.c (gelf_update_syminfo): Likewise.
++ * gelf_update_symshndx.c (gelf_update_symshndx): Likewise.
++ * gelf_update_versym.c (gelf_update_versym): Likewise.
++ * elf_newscn.c (elf_newscn): Check for overflow.
++ * elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Likewise.
++ (__elfw2(LIBELFBITS,updatefile)): Likewise.
++ * elf_begin.c (file_read_elf): Likewise.
++ * elf32_newphdr.c (elfw2(LIBELFBITS,newphdr)): Likewise.
++ * elf_getarsym.c (elf_getarsym): Likewise.
++ * elf32_getshdr.c (elfw2(LIBELFBITS,getshdr)): Likewise.
+ 2005-05-11 Ulrich Drepper <drepper@redhat.com>
+
+ * elf.h: Update again.
+
++2005-05-17 Jakub Jelinek <jakub@redhat.com>
++
++ * elf32_getphdr.c (elfw2(LIBELFBITS,getphdr)): Check if program header
++ table fits into object's bounds.
++ * elf_getshstrndx.c (elf_getshstrndx): Add elf->start_offset to
++ elf->map_address. Check if first section header fits into object's
++ bounds.
++ * elf32_getshdr.c (elfw2(LIBELFBITS,getshdr)):
++ Check if section header table fits into object's bounds.
++ * elf_begin.c (get_shnum): Ensure section headers fits into
++ object's bounds.
++ (file_read_elf): Make sure scncnt is small enough to allocate both
++ ElfXX_Shdr and Elf_Scn array. Make sure section and program header
++ tables fit into object's bounds. Avoid memory leak on failure.
++
+ 2005-05-09 Ulrich Drepper <drepper@redhat.com>
+
+ * elf.h: Update from glibc.
+Index: elfutils-0.148/libelf/elf32_getphdr.c
+===================================================================
+--- elfutils-0.148.orig/libelf/elf32_getphdr.c 2010-04-21 14:26:40.000000000 +0000
++++ elfutils-0.148/libelf/elf32_getphdr.c 2010-07-03 13:07:11.000000000 +0000
+@@ -114,6 +114,16 @@
+
+ if (elf->map_address != NULL)
+ {
++ /* First see whether the information in the ELF header is
++ valid and it does not ask for too much. */
++ if (unlikely (ehdr->e_phoff >= elf->maximum_size)
++ || unlikely (elf->maximum_size - ehdr->e_phoff < size))
++ {
++ /* Something is wrong. */
++ __libelf_seterrno (ELF_E_INVALID_PHDR);
++ goto out;
++ }
++
+ /* All the data is already mapped. Use it. */
+ void *file_phdr = ((char *) elf->map_address
+ + elf->start_offset + ehdr->e_phoff);
+Index: elfutils-0.148/libelf/elf32_getshdr.c
+===================================================================
+--- elfutils-0.148.orig/libelf/elf32_getshdr.c 2009-06-13 22:41:42.000000000 +0000
++++ elfutils-0.148/libelf/elf32_getshdr.c 2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Return section header.
+- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005, 2007, 2009 Red Hat, Inc.
++ Copyright (C) 1998-2009 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+ Written by Ulrich Drepper <drepper@redhat.com>, 1998.
+
+@@ -81,7 +81,8 @@
+ goto out;
+
+ size_t shnum;
+- if (__elf_getshdrnum_rdlock (elf, &shnum) != 0)
++ if (__elf_getshdrnum_rdlock (elf, &shnum) != 0
++ || shnum > SIZE_MAX / sizeof (ElfW2(LIBELFBITS,Shdr)))
+ goto out;
+ size_t size = shnum * sizeof (ElfW2(LIBELFBITS,Shdr));
+
+@@ -98,6 +99,16 @@
+
+ if (elf->map_address != NULL)
+ {
++ /* First see whether the information in the ELF header is
++ valid and it does not ask for too much. */
++ if (unlikely (ehdr->e_shoff >= elf->maximum_size)
++ || unlikely (elf->maximum_size - ehdr->e_shoff < size))
++ {
++ /* Something is wrong. */
++ __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER);
++ goto free_and_out;
++ }
++
+ ElfW2(LIBELFBITS,Shdr) *notcvt;
+
+ /* All the data is already mapped. If we could use it
+Index: elfutils-0.148/libelf/elf32_newphdr.c
+===================================================================
+--- elfutils-0.148.orig/libelf/elf32_newphdr.c 2010-01-12 16:57:54.000000000 +0000
++++ elfutils-0.148/libelf/elf32_newphdr.c 2010-07-03 13:07:11.000000000 +0000
+@@ -135,6 +135,12 @@
+ || count == PN_XNUM
+ || elf->state.ELFW(elf,LIBELFBITS).phdr == NULL)
+ {
++ if (unlikely (count > SIZE_MAX / sizeof (ElfW2(LIBELFBITS,Phdr))))
++ {
++ result = NULL;
++ goto out;
++ }
++
+ /* Allocate a new program header with the appropriate number of
+ elements. */
+ result = (ElfW2(LIBELFBITS,Phdr) *)
+Index: elfutils-0.148/libelf/elf32_updatefile.c
+===================================================================
+--- elfutils-0.148.orig/libelf/elf32_updatefile.c 2010-01-12 16:57:54.000000000 +0000
++++ elfutils-0.148/libelf/elf32_updatefile.c 2010-07-03 13:07:11.000000000 +0000
+@@ -223,6 +223,9 @@
+ /* Write all the sections. Well, only those which are modified. */
+ if (shnum > 0)
+ {
++ if (unlikely (shnum > SIZE_MAX / sizeof (Elf_Scn *)))
++ return 1;
++
+ Elf_ScnList *list = &elf->state.ELFW(elf,LIBELFBITS).scns;
+ Elf_Scn **scns = (Elf_Scn **) alloca (shnum * sizeof (Elf_Scn *));
+ char *const shdr_start = ((char *) elf->map_address + elf->start_offset
+@@ -645,6 +648,10 @@
+ /* Write all the sections. Well, only those which are modified. */
+ if (shnum > 0)
+ {
++ if (unlikely (shnum > SIZE_MAX / (sizeof (Elf_Scn *)
++ + sizeof (ElfW2(LIBELFBITS,Shdr)))))
++ return 1;
++
+ off_t shdr_offset = elf->start_offset + ehdr->e_shoff;
+ #if EV_NUM != 2
+ xfct_t shdr_fctp = __elf_xfctstom[__libelf_version - 1][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_SHDR];
+Index: elfutils-0.148/libelf/elf_begin.c
+===================================================================
+--- elfutils-0.148.orig/libelf/elf_begin.c 2010-04-21 14:26:40.000000000 +0000
++++ elfutils-0.148/libelf/elf_begin.c 2010-07-03 13:07:11.000000000 +0000
+@@ -165,7 +165,8 @@
+
+ if (unlikely (result == 0) && ehdr.e32->e_shoff != 0)
+ {
+- if (ehdr.e32->e_shoff + sizeof (Elf32_Shdr) > maxsize)
++ if (unlikely (ehdr.e32->e_shoff >= maxsize)
++ || unlikely (maxsize - ehdr.e32->e_shoff < sizeof (Elf32_Shdr)))
+ /* Cannot read the first section header. */
+ return 0;
+
+@@ -213,7 +214,8 @@
+
+ if (unlikely (result == 0) && ehdr.e64->e_shoff != 0)
+ {
+- if (ehdr.e64->e_shoff + sizeof (Elf64_Shdr) > maxsize)
++ if (unlikely (ehdr.e64->e_shoff >= maxsize)
++ || unlikely (ehdr.e64->e_shoff + sizeof (Elf64_Shdr) > maxsize))
+ /* Cannot read the first section header. */
+ return 0;
+
+@@ -285,6 +287,15 @@
+ /* Could not determine the number of sections. */
+ return NULL;
+
++ /* Check for too many sections. */
++ if (e_ident[EI_CLASS] == ELFCLASS32)
++ {
++ if (scncnt > SIZE_MAX / (sizeof (Elf_Scn) + sizeof (Elf32_Shdr)))
++ return NULL;
++ }
++ else if (scncnt > SIZE_MAX / (sizeof (Elf_Scn) + sizeof (Elf64_Shdr)))
++ return NULL;
++
+ /* We can now allocate the memory. Even if there are no section headers,
+ we allocate space for a zeroth section in case we need it later. */
+ const size_t scnmax = (scncnt ?: (cmd == ELF_C_RDWR || cmd == ELF_C_RDWR_MMAP)
+@@ -324,6 +335,16 @@
+ {
+ /* We can use the mmapped memory. */
+ elf->state.elf32.ehdr = ehdr;
++
++ if (unlikely (ehdr->e_shoff >= maxsize)
++ || unlikely (maxsize - ehdr->e_shoff
++ < scncnt * sizeof (Elf32_Shdr)))
++ {
++ free_and_out:
++ free (elf);
++ __libelf_seterrno (ELF_E_INVALID_FILE);
++ return NULL;
++ }
+ elf->state.elf32.shdr
+ = (Elf32_Shdr *) ((char *) ehdr + ehdr->e_shoff);
+
+@@ -410,6 +431,11 @@
+ {
+ /* We can use the mmapped memory. */
+ elf->state.elf64.ehdr = ehdr;
++
++ if (unlikely (ehdr->e_shoff >= maxsize)
++ || unlikely (ehdr->e_shoff
++ + scncnt * sizeof (Elf32_Shdr) > maxsize))
++ goto free_and_out;
+ elf->state.elf64.shdr
+ = (Elf64_Shdr *) ((char *) ehdr + ehdr->e_shoff);
+
+Index: elfutils-0.148/libelf/elf_getarsym.c
+===================================================================
+--- elfutils-0.148.orig/libelf/elf_getarsym.c 2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/elf_getarsym.c 2010-07-03 13:07:11.000000000 +0000
+@@ -179,6 +179,9 @@
+ size_t index_size = atol (tmpbuf);
+
+ if (SARMAG + sizeof (struct ar_hdr) + index_size > elf->maximum_size
++#if SIZE_MAX <= 4294967295U
++ || n >= SIZE_MAX / sizeof (Elf_Arsym)
++#endif
+ || n * sizeof (uint32_t) > index_size)
+ {
+ /* This index table cannot be right since it does not fit into
+Index: elfutils-0.148/libelf/elf_getshdrstrndx.c
+===================================================================
+--- elfutils-0.148.orig/libelf/elf_getshdrstrndx.c 2009-06-13 22:31:35.000000000 +0000
++++ elfutils-0.148/libelf/elf_getshdrstrndx.c 2010-07-03 13:07:11.000000000 +0000
+@@ -125,10 +125,25 @@
+ if (elf->map_address != NULL
+ && elf->state.elf32.ehdr->e_ident[EI_DATA] == MY_ELFDATA
+ && (ALLOW_UNALIGNED
+- || (((size_t) ((char *) elf->map_address + offset))
++ || (((size_t) ((char *) elf->map_address
++ + elf->start_offset + offset))
+ & (__alignof__ (Elf32_Shdr) - 1)) == 0))
+- /* We can directly access the memory. */
+- num = ((Elf32_Shdr *) (elf->map_address + offset))->sh_link;
++ {
++ /* First see whether the information in the ELF header is
++ valid and it does not ask for too much. */
++ if (unlikely (elf->maximum_size - offset
++ < sizeof (Elf32_Shdr)))
++ {
++ /* Something is wrong. */
++ __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER);
++ result = -1;
++ goto out;
++ }
++
++ /* We can directly access the memory. */
++ num = ((Elf32_Shdr *) (elf->map_address + elf->start_offset
++ + offset))->sh_link;
++ }
+ else
+ {
+ /* We avoid reading in all the section headers. Just read
+@@ -163,10 +178,25 @@
+ if (elf->map_address != NULL
+ && elf->state.elf64.ehdr->e_ident[EI_DATA] == MY_ELFDATA
+ && (ALLOW_UNALIGNED
+- || (((size_t) ((char *) elf->map_address + offset))
++ || (((size_t) ((char *) elf->map_address
++ + elf->start_offset + offset))
+ & (__alignof__ (Elf64_Shdr) - 1)) == 0))
+- /* We can directly access the memory. */
+- num = ((Elf64_Shdr *) (elf->map_address + offset))->sh_link;
++ {
++ /* First see whether the information in the ELF header is
++ valid and it does not ask for too much. */
++ if (unlikely (elf->maximum_size - offset
++ < sizeof (Elf64_Shdr)))
++ {
++ /* Something is wrong. */
++ __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER);
++ result = -1;
++ goto out;
++ }
++
++ /* We can directly access the memory. */
++ num = ((Elf64_Shdr *) (elf->map_address + elf->start_offset
++ + offset))->sh_link;
++ }
+ else
+ {
+ /* We avoid reading in all the section headers. Just read
+Index: elfutils-0.148/libelf/elf_newscn.c
+===================================================================
+--- elfutils-0.148.orig/libelf/elf_newscn.c 2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/elf_newscn.c 2010-07-03 13:07:11.000000000 +0000
+@@ -104,10 +104,18 @@
+ else
+ {
+ /* We must allocate a new element. */
+- Elf_ScnList *newp;
++ Elf_ScnList *newp = NULL;
+
+ assert (elf->state.elf.scnincr > 0);
+
++ if (
++#if SIZE_MAX <= 4294967295U
++ likely (elf->state.elf.scnincr
++ < SIZE_MAX / 2 / sizeof (Elf_Scn) - sizeof (Elf_ScnList))
++#else
++ 1
++#endif
++ )
+ newp = (Elf_ScnList *) calloc (sizeof (Elf_ScnList)
+ + ((elf->state.elf.scnincr *= 2)
+ * sizeof (Elf_Scn)), 1);
+Index: elfutils-0.148/libelf/gelf_getdyn.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_getdyn.c 2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_getdyn.c 2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Get information from dynamic table at the given index.
+- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++ Copyright (C) 2000-2009 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+ Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+
+@@ -93,7 +93,7 @@
+ table entries has to be adopted. The user better has provided
+ a buffer where we can store the information. While copying the
+ data we are converting the format. */
+- if (unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf32_Dyn, &data_scn->d))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+@@ -114,7 +114,7 @@
+
+ /* The data is already in the correct form. Just make sure the
+ index is OK. */
+- if (unlikely ((ndx + 1) * sizeof (GElf_Dyn) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, GElf_Dyn, &data_scn->d))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+Index: elfutils-0.148/libelf/gelf_getlib.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_getlib.c 2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_getlib.c 2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Get library from table at the given index.
+- Copyright (C) 2004 Red Hat, Inc.
++ Copyright (C) 2004-2009 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+ Written by Ulrich Drepper <drepper@redhat.com>, 2004.
+
+@@ -86,7 +86,7 @@
+ /* The data is already in the correct form. Just make sure the
+ index is OK. */
+ GElf_Lib *result = NULL;
+- if (unlikely ((ndx + 1) * sizeof (GElf_Lib) > data->d_size))
++ if (INVALID_NDX (ndx, GElf_Lib, data))
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ else
+ {
+Index: elfutils-0.148/libelf/gelf_getmove.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_getmove.c 2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_getmove.c 2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Get move structure at the given index.
+- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++ Copyright (C) 2000-2009 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+ Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+
+@@ -83,7 +83,7 @@
+
+ /* The data is already in the correct form. Just make sure the
+ index is OK. */
+- if (unlikely ((ndx + 1) * sizeof (GElf_Move) > data->d_size))
++ if (INVALID_NDX (ndx, GElf_Move, data))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+Index: elfutils-0.148/libelf/gelf_getrela.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_getrela.c 2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_getrela.c 2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Get RELA relocation information at given index.
+- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++ Copyright (C) 2000-2009 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+ Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+
+@@ -71,12 +71,6 @@
+ if (data_scn == NULL)
+ return NULL;
+
+- if (unlikely (ndx < 0))
+- {
+- __libelf_seterrno (ELF_E_INVALID_INDEX);
+- return NULL;
+- }
+-
+ if (unlikely (data_scn->d.d_type != ELF_T_RELA))
+ {
+ __libelf_seterrno (ELF_E_INVALID_HANDLE);
+@@ -93,7 +87,7 @@
+ if (scn->elf->class == ELFCLASS32)
+ {
+ /* We have to convert the data. */
+- if (unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf32_Rela, &data_scn->d))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ result = NULL;
+@@ -114,7 +108,7 @@
+ {
+ /* Simply copy the data after we made sure we are actually getting
+ correct data. */
+- if (unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf64_Rela, &data_scn->d))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ result = NULL;
+Index: elfutils-0.148/libelf/gelf_getrel.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_getrel.c 2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_getrel.c 2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Get REL relocation information at given index.
+- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++ Copyright (C) 2000-2009 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+ Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+
+@@ -71,12 +71,6 @@
+ if (data_scn == NULL)
+ return NULL;
+
+- if (unlikely (ndx < 0))
+- {
+- __libelf_seterrno (ELF_E_INVALID_INDEX);
+- return NULL;
+- }
+-
+ if (unlikely (data_scn->d.d_type != ELF_T_REL))
+ {
+ __libelf_seterrno (ELF_E_INVALID_HANDLE);
+@@ -93,7 +87,7 @@
+ if (scn->elf->class == ELFCLASS32)
+ {
+ /* We have to convert the data. */
+- if (unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf32_Rel, &data_scn->d))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ result = NULL;
+@@ -113,7 +107,7 @@
+ {
+ /* Simply copy the data after we made sure we are actually getting
+ correct data. */
+- if (unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf64_Rel, &data_scn->d))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ result = NULL;
+Index: elfutils-0.148/libelf/gelf_getsym.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_getsym.c 2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_getsym.c 2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Get symbol information from symbol table at the given index.
+- Copyright (C) 1999, 2000, 2001, 2002 Red Hat, Inc.
++ Copyright (C) 1999-2009 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+ Written by Ulrich Drepper <drepper@redhat.com>, 1999.
+
+@@ -90,7 +90,7 @@
+ table entries has to be adopted. The user better has provided
+ a buffer where we can store the information. While copying the
+ data we are converting the format. */
+- if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data->d_size))
++ if (INVALID_NDX (ndx, Elf32_Sym, data))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+@@ -119,7 +119,7 @@
+
+ /* The data is already in the correct form. Just make sure the
+ index is OK. */
+- if (unlikely ((ndx + 1) * sizeof (GElf_Sym) > data->d_size))
++ if (INVALID_NDX (ndx, GElf_Sym, data))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+Index: elfutils-0.148/libelf/gelf_getsyminfo.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_getsyminfo.c 2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_getsyminfo.c 2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Get additional symbol information from symbol table at the given index.
+- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++ Copyright (C) 2000-2009 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+ Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+
+@@ -84,7 +84,7 @@
+
+ /* The data is already in the correct form. Just make sure the
+ index is OK. */
+- if (unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data->d_size))
++ if (INVALID_NDX (ndx, GElf_Syminfo, data))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+Index: elfutils-0.148/libelf/gelf_getsymshndx.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_getsymshndx.c 2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_getsymshndx.c 2010-07-03 13:07:11.000000000 +0000
+@@ -1,6 +1,6 @@
+ /* Get symbol information and separate section index from symbol table
+ at the given index.
+- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++ Copyright (C) 2000-2009 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+ Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+
+@@ -90,7 +90,7 @@
+ section index table. */
+ if (likely (shndxdata_scn != NULL))
+ {
+- if (unlikely ((ndx + 1) * sizeof (Elf32_Word) > shndxdata_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf32_Word, &shndxdata_scn->d))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+@@ -110,7 +110,7 @@
+ table entries has to be adopted. The user better has provided
+ a buffer where we can store the information. While copying the
+ data we are converting the format. */
+- if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata->d_size))
++ if (INVALID_NDX (ndx, Elf32_Sym, symdata))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+@@ -139,7 +139,7 @@
+
+ /* The data is already in the correct form. Just make sure the
+ index is OK. */
+- if (unlikely ((ndx + 1) * sizeof (GElf_Sym) > symdata->d_size))
++ if (INVALID_NDX (ndx, GElf_Sym, symdata))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+Index: elfutils-0.148/libelf/gelf_getversym.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_getversym.c 2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_getversym.c 2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Get symbol version information at the given index.
+- Copyright (C) 1999, 2000, 2001, 2002 Red Hat, Inc.
++ Copyright (C) 1999-2009 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+ Written by Ulrich Drepper <drepper@redhat.com>, 1999.
+
+@@ -92,7 +92,7 @@
+
+ /* The data is already in the correct form. Just make sure the
+ index is OK. */
+- if (unlikely ((ndx + 1) * sizeof (GElf_Versym) > data->d_size))
++ if (INVALID_NDX (ndx, GElf_Versym, data))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ result = NULL;
+Index: elfutils-0.148/libelf/gelf_update_dyn.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_update_dyn.c 2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_update_dyn.c 2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Update information in dynamic table at the given index.
+- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++ Copyright (C) 2000-2009 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+ Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+
+@@ -71,12 +71,6 @@
+ if (data == NULL)
+ return 0;
+
+- if (unlikely (ndx < 0))
+- {
+- __libelf_seterrno (ELF_E_INVALID_INDEX);
+- return 0;
+- }
+-
+ if (unlikely (data_scn->d.d_type != ELF_T_DYN))
+ {
+ /* The type of the data better should match. */
+@@ -102,7 +96,7 @@
+ }
+
+ /* Check whether we have to resize the data buffer. */
+- if (unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf32_Dyn, &data_scn->d))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+@@ -116,7 +110,7 @@
+ else
+ {
+ /* Check whether we have to resize the data buffer. */
+- if (unlikely ((ndx + 1) * sizeof (Elf64_Dyn) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf64_Dyn, &data_scn->d))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+Index: elfutils-0.148/libelf/gelf_update_lib.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_update_lib.c 2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_update_lib.c 2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Update library in table at the given index.
+- Copyright (C) 2004 Red Hat, Inc.
++ Copyright (C) 2004-2009 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+ Written by Ulrich Drepper <drepper@redhat.com>, 2004.
+
+@@ -68,12 +68,6 @@
+ if (data == NULL)
+ return 0;
+
+- if (unlikely (ndx < 0))
+- {
+- __libelf_seterrno (ELF_E_INVALID_INDEX);
+- return 0;
+- }
+-
+ Elf_Data_Scn *data_scn = (Elf_Data_Scn *) data;
+ if (unlikely (data_scn->d.d_type != ELF_T_LIB))
+ {
+@@ -87,7 +81,7 @@
+
+ /* Check whether we have to resize the data buffer. */
+ int result = 0;
+- if (unlikely ((ndx + 1) * sizeof (Elf64_Lib) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf64_Lib, &data_scn->d))
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ else
+ {
+Index: elfutils-0.148/libelf/gelf_update_move.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_update_move.c 2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_update_move.c 2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Update move structure at the given index.
+- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++ Copyright (C) 2000-2009 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+ Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+
+@@ -75,8 +75,7 @@
+ assert (sizeof (GElf_Move) == sizeof (Elf64_Move));
+
+ /* Check whether we have to resize the data buffer. */
+- if (unlikely (ndx < 0)
+- || unlikely ((ndx + 1) * sizeof (GElf_Move) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, GElf_Move, &data_scn->d))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ return 0;
+Index: elfutils-0.148/libelf/gelf_update_rela.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_update_rela.c 2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_update_rela.c 2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Update RELA relocation information at given index.
+- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++ Copyright (C) 2000-2009 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+ Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+
+@@ -68,12 +68,6 @@
+ if (dst == NULL)
+ return 0;
+
+- if (unlikely (ndx < 0))
+- {
+- __libelf_seterrno (ELF_E_INVALID_INDEX);
+- return 0;
+- }
+-
+ if (unlikely (data_scn->d.d_type != ELF_T_RELA))
+ {
+ /* The type of the data better should match. */
+@@ -101,7 +95,7 @@
+ }
+
+ /* Check whether we have to resize the data buffer. */
+- if (unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf32_Rela, &data_scn->d))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+@@ -117,7 +111,7 @@
+ else
+ {
+ /* Check whether we have to resize the data buffer. */
+- if (unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf64_Rela, &data_scn->d))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+Index: elfutils-0.148/libelf/gelf_update_rel.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_update_rel.c 2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_update_rel.c 2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Update REL relocation information at given index.
+- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++ Copyright (C) 2000-2009 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+ Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+
+@@ -68,12 +68,6 @@
+ if (dst == NULL)
+ return 0;
+
+- if (unlikely (ndx < 0))
+- {
+- __libelf_seterrno (ELF_E_INVALID_INDEX);
+- return 0;
+- }
+-
+ if (unlikely (data_scn->d.d_type != ELF_T_REL))
+ {
+ /* The type of the data better should match. */
+@@ -99,7 +93,7 @@
+ }
+
+ /* Check whether we have to resize the data buffer. */
+- if (unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf32_Rel, &data_scn->d))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+@@ -114,7 +108,7 @@
+ else
+ {
+ /* Check whether we have to resize the data buffer. */
+- if (unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf64_Rel, &data_scn->d))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+Index: elfutils-0.148/libelf/gelf_update_sym.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_update_sym.c 2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_update_sym.c 2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Update symbol information in symbol table at the given index.
+- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++ Copyright (C) 2000-2009 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+ Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+
+@@ -72,12 +72,6 @@
+ if (data == NULL)
+ return 0;
+
+- if (unlikely (ndx < 0))
+- {
+- __libelf_seterrno (ELF_E_INVALID_INDEX);
+- return 0;
+- }
+-
+ if (unlikely (data_scn->d.d_type != ELF_T_SYM))
+ {
+ /* The type of the data better should match. */
+@@ -102,7 +96,7 @@
+ }
+
+ /* Check whether we have to resize the data buffer. */
+- if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf32_Sym, &data_scn->d))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+@@ -125,7 +119,7 @@
+ else
+ {
+ /* Check whether we have to resize the data buffer. */
+- if (unlikely ((ndx + 1) * sizeof (Elf64_Sym) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf64_Sym, &data_scn->d))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+Index: elfutils-0.148/libelf/gelf_update_syminfo.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_update_syminfo.c 2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_update_syminfo.c 2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Update additional symbol information in symbol table at the given index.
+- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++ Copyright (C) 2000-2009 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+ Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+
+@@ -72,12 +72,6 @@
+ if (data == NULL)
+ return 0;
+
+- if (unlikely (ndx < 0))
+- {
+- __libelf_seterrno (ELF_E_INVALID_INDEX);
+- return 0;
+- }
+-
+ if (unlikely (data_scn->d.d_type != ELF_T_SYMINFO))
+ {
+ /* The type of the data better should match. */
+@@ -93,7 +87,7 @@
+ rwlock_wrlock (scn->elf->lock);
+
+ /* Check whether we have to resize the data buffer. */
+- if (unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, GElf_Syminfo, &data_scn->d))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+Index: elfutils-0.148/libelf/gelf_update_symshndx.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_update_symshndx.c 2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_update_symshndx.c 2010-07-03 13:07:11.000000000 +0000
+@@ -1,6 +1,6 @@
+ /* Update symbol information and section index in symbol table at the
+ given index.
+- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++ Copyright (C) 2000-2009 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+ Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+
+@@ -77,12 +77,6 @@
+ if (symdata == NULL)
+ return 0;
+
+- if (unlikely (ndx < 0))
+- {
+- __libelf_seterrno (ELF_E_INVALID_INDEX);
+- return 0;
+- }
+-
+ if (unlikely (symdata_scn->d.d_type != ELF_T_SYM))
+ {
+ /* The type of the data better should match. */
+@@ -128,7 +122,7 @@
+ }
+
+ /* Check whether we have to resize the data buffer. */
+- if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf32_Sym, &symdata_scn->d))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+@@ -151,7 +145,7 @@
+ else
+ {
+ /* Check whether we have to resize the data buffer. */
+- if (unlikely ((ndx + 1) * sizeof (Elf64_Sym) > symdata_scn->d.d_size))
++ if (INVALID_NDX (ndx, Elf64_Sym, &symdata_scn->d))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ goto out;
+Index: elfutils-0.148/libelf/gelf_update_versym.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_update_versym.c 2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_update_versym.c 2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Update symbol version information.
+- Copyright (C) 2001, 2002 Red Hat, Inc.
++ Copyright (C) 2001-2009 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+ Written by Ulrich Drepper <drepper@redhat.com>, 2001.
+
+@@ -75,8 +75,7 @@
+ assert (sizeof (GElf_Versym) == sizeof (Elf64_Versym));
+
+ /* Check whether we have to resize the data buffer. */
+- if (unlikely (ndx < 0)
+- || unlikely ((ndx + 1) * sizeof (GElf_Versym) > data_scn->d.d_size))
++ if (INVALID_NDX (ndx, GElf_Versym, &data_scn->d))
+ {
+ __libelf_seterrno (ELF_E_INVALID_INDEX);
+ return 0;
+Index: elfutils-0.148/libelf/libelfP.h
+===================================================================
+--- elfutils-0.148.orig/libelf/libelfP.h 2010-01-12 16:57:54.000000000 +0000
++++ elfutils-0.148/libelf/libelfP.h 2010-07-03 13:07:11.000000000 +0000
+@@ -608,4 +608,8 @@
+ /* Align offset to 4 bytes as needed for note name and descriptor data. */
+ #define NOTE_ALIGN(n) (((n) + 3) & -4U)
+
++/* Convenience macro. */
++#define INVALID_NDX(ndx, type, data) \
++ unlikely ((data)->d_size / sizeof (type) <= (unsigned int) (ndx))
++
+ #endif /* libelfP.h */
+Index: elfutils-0.148/src/ChangeLog
+===================================================================
+--- elfutils-0.148.orig/src/ChangeLog 2010-07-03 13:07:10.000000000 +0000
++++ elfutils-0.148/src/ChangeLog 2010-07-03 13:07:11.000000000 +0000
+@@ -1640,6 +1640,16 @@
+ object symbols or symbols with unknown type.
+ (check_rel): Likewise.
+
++2005-06-09 Roland McGrath <roland@redhat.com>
++
++ * readelf.c (handle_dynamic, handle_symtab): Check for bogus sh_link.
++ (handle_verneed, handle_verdef, handle_versym, handle_hash): Likewise.
++ (handle_scngrp): Check for bogus sh_info.
++
++ * strip.c (handle_elf): Check for bogus values in sh_link, sh_info,
++ st_shndx, e_shstrndx, and SHT_GROUP or SHT_SYMTAB_SHNDX data.
++ Don't use assert on input values, instead bail with "illformed" error.
++
+ 2005-06-08 Roland McGrath <roland@redhat.com>
+
+ * readelf.c (print_ops): Add consts.
+@@ -1690,6 +1700,19 @@
+
+ * readelf.c (dwarf_tag_string): Add new tags.
+
++2005-05-17 Jakub Jelinek <jakub@redhat.com>
++
++ * elflint.c (check_hash): Don't check entries beyond end of section.
++ (check_note): Don't crash if gelf_rawchunk fails.
++ (section_name): Return <invalid> if gelf_getshdr returns NULL.
++
++2005-05-14 Jakub Jelinek <jakub@redhat.com>
++
++ * elflint.c (section_name): Return "<invalid>" instead of
++ crashing on invalid section name.
++ (check_symtab, is_rel_dyn, check_rela, check_rel, check_dynamic,
++ check_symtab_shndx, check_hash, check_versym): Robustify.
++
+ 2005-05-08 Roland McGrath <roland@redhat.com>
+
+ * strip.c (handle_elf): Don't translate hash and versym data formats,
+Index: elfutils-0.148/src/elflint.c
+===================================================================
+--- elfutils-0.148.orig/src/elflint.c 2010-04-13 20:08:02.000000000 +0000
++++ elfutils-0.148/src/elflint.c 2010-07-03 13:07:11.000000000 +0000
+@@ -131,6 +131,10 @@
+ /* Array to count references in section groups. */
+ static int *scnref;
+
++/* Numbers of sections and program headers. */
++static unsigned int shnum;
++static unsigned int phnum;
++
+
+ int
+ main (int argc, char *argv[])
+@@ -319,10 +323,19 @@
+ {
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *shdr;
++ const char *ret;
++
++ if ((unsigned int) idx > shnum)
++ return "<invalid>";
+
+ shdr = gelf_getshdr (elf_getscn (ebl->elf, idx), &shdr_mem);
++ if (shdr == NULL)
++ return "<invalid>";
+
+- return elf_strptr (ebl->elf, shstrndx, shdr->sh_name);
++ ret = elf_strptr (ebl->elf, shstrndx, shdr->sh_name);
++ if (ret == NULL)
++ return "<invalid>";
++ return ret;
+ }
+
+
+@@ -344,11 +357,6 @@
+ (sizeof (valid_e_machine) / sizeof (valid_e_machine[0]))
+
+
+-/* Numbers of sections and program headers. */
+-static unsigned int shnum;
+-static unsigned int phnum;
+-
+-
+ static void
+ check_elf_header (Ebl *ebl, GElf_Ehdr *ehdr, size_t size)
+ {
+@@ -632,7 +640,8 @@
+ }
+ }
+
+- if (shdr->sh_entsize != gelf_fsize (ebl->elf, ELF_T_SYM, 1, EV_CURRENT))
++ size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_SYM, 1, EV_CURRENT);
++ if (shdr->sh_entsize != sh_entsize)
+ ERROR (gettext ("\
+ section [%2u] '%s': entry size is does not match ElfXX_Sym\n"),
+ idx, section_name (ebl, idx));
+@@ -670,7 +679,7 @@
+ xndxscnidx, section_name (ebl, xndxscnidx));
+ }
+
+- for (size_t cnt = 1; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
++ for (size_t cnt = 1; cnt < shdr->sh_size / sh_entsize; ++cnt)
+ {
+ sym = gelf_getsymshndx (data, xndxdata, cnt, &sym_mem, &xndx);
+ if (sym == NULL)
+@@ -690,7 +699,8 @@
+ else
+ {
+ name = elf_strptr (ebl->elf, shdr->sh_link, sym->st_name);
+- assert (name != NULL);
++ assert (name != NULL
++ || strshdr->sh_type != SHT_STRTAB);
+ }
+
+ if (sym->st_shndx == SHN_XINDEX)
+@@ -1038,9 +1048,11 @@
+ {
+ GElf_Shdr rcshdr_mem;
+ const GElf_Shdr *rcshdr = gelf_getshdr (scn, &rcshdr_mem);
+- assert (rcshdr != NULL);
+
+- if (rcshdr->sh_type == SHT_DYNAMIC)
++ if (rcshdr == NULL)
++ break;
++
++ if (rcshdr->sh_type == SHT_DYNAMIC && rcshdr->sh_entsize)
+ {
+ /* Found the dynamic section. Look through it. */
+ Elf_Data *d = elf_getdata (scn, NULL);
+@@ -1050,7 +1062,9 @@
+ {
+ GElf_Dyn dyn_mem;
+ GElf_Dyn *dyn = gelf_getdyn (d, cnt, &dyn_mem);
+- assert (dyn != NULL);
++
++ if (dyn == NULL)
++ break;
+
+ if (dyn->d_tag == DT_RELCOUNT)
+ {
+@@ -1064,7 +1078,9 @@
+ /* Does the number specified number of relative
+ relocations exceed the total number of
+ relocations? */
+- if (dyn->d_un.d_val > shdr->sh_size / shdr->sh_entsize)
++ if (shdr->sh_entsize != 0
++ && dyn->d_un.d_val > (shdr->sh_size
++ / shdr->sh_entsize))
+ ERROR (gettext ("\
+ section [%2d] '%s': DT_RELCOUNT value %d too high for this section\n"),
+ idx, section_name (ebl, idx),
+@@ -1224,7 +1240,8 @@
+ }
+ }
+
+- if (shdr->sh_entsize != gelf_fsize (ebl->elf, reltype, 1, EV_CURRENT))
++ size_t sh_entsize = gelf_fsize (ebl->elf, reltype, 1, EV_CURRENT);
++ if (shdr->sh_entsize != sh_entsize)
+ ERROR (gettext (reltype == ELF_T_RELA ? "\
+ section [%2d] '%s': section entry size does not match ElfXX_Rela\n" : "\
+ section [%2d] '%s': section entry size does not match ElfXX_Rel\n"),
+@@ -1447,7 +1464,8 @@
+ Elf_Data *symdata = elf_getdata (symscn, NULL);
+ enum load_state state = state_undecided;
+
+- for (size_t cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
++ size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_RELA, 1, EV_CURRENT);
++ for (size_t cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt)
+ {
+ GElf_Rela rela_mem;
+ GElf_Rela *rela = gelf_getrela (data, cnt, &rela_mem);
+@@ -1497,7 +1515,8 @@
+ Elf_Data *symdata = elf_getdata (symscn, NULL);
+ enum load_state state = state_undecided;
+
+- for (size_t cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
++ size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_REL, 1, EV_CURRENT);
++ for (size_t cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt)
+ {
+ GElf_Rel rel_mem;
+ GElf_Rel *rel = gelf_getrel (data, cnt, &rel_mem);
+@@ -1600,7 +1619,8 @@
+ shdr->sh_link, section_name (ebl, shdr->sh_link),
+ idx, section_name (ebl, idx));
+
+- if (shdr->sh_entsize != gelf_fsize (ebl->elf, ELF_T_DYN, 1, EV_CURRENT))
++ size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_DYN, 1, EV_CURRENT);
++ if (shdr->sh_entsize != sh_entsize)
+ ERROR (gettext ("\
+ section [%2d] '%s': section entry size does not match ElfXX_Dyn\n"),
+ idx, section_name (ebl, idx));
+@@ -1610,7 +1630,7 @@
+ idx, section_name (ebl, idx));
+
+ bool non_null_warned = false;
+- for (cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
++ for (cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt)
+ {
+ GElf_Dyn dyn_mem;
+ GElf_Dyn *dyn = gelf_getdyn (data, cnt, &dyn_mem);
+@@ -1891,6 +1911,8 @@
+ idx, section_name (ebl, idx));
+
+ if (symshdr != NULL
++ && shdr->sh_entsize
++ && symshdr->sh_entsize
+ && (shdr->sh_size / shdr->sh_entsize
+ < symshdr->sh_size / symshdr->sh_entsize))
+ ERROR (gettext ("\
+@@ -1917,6 +1939,12 @@
+ }
+
+ Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL);
++ if (data == NULL)
++ {
++ ERROR (gettext ("section [%2d] '%s': cannot get section data\n"),
++ idx, section_name (ebl, idx));
++ return;
++ }
+
+ if (*((Elf32_Word *) data->d_buf) != 0)
+ ERROR (gettext ("symbol 0 should have zero extended section index\n"));
+@@ -1959,7 +1987,7 @@
+
+ size_t maxidx = nchain;
+
+- if (symshdr != NULL)
++ if (symshdr != NULL && symshdr->sh_entsize != 0)
+ {
+ size_t symsize = symshdr->sh_size / symshdr->sh_entsize;
+
+@@ -1970,18 +1998,28 @@
+ maxidx = symsize;
+ }
+
++ Elf32_Word *buf = (Elf32_Word *) data->d_buf;
++ Elf32_Word *end = (Elf32_Word *) ((char *) data->d_buf + shdr->sh_size);
+ size_t cnt;
+ for (cnt = 2; cnt < 2 + nbucket; ++cnt)
+- if (((Elf32_Word *) data->d_buf)[cnt] >= maxidx)
++ {
++ if (buf + cnt >= end)
++ break;
++ else if (buf[cnt] >= maxidx)
+ ERROR (gettext ("\
+ section [%2d] '%s': hash bucket reference %zu out of bounds\n"),
+ idx, section_name (ebl, idx), cnt - 2);
++ }
+
+ for (; cnt < 2 + nbucket + nchain; ++cnt)
+- if (((Elf32_Word *) data->d_buf)[cnt] >= maxidx)
++ {
++ if (buf + cnt >= end)
++ break;
++ else if (buf[cnt] >= maxidx)
+ ERROR (gettext ("\
+ section [%2d] '%s': hash chain reference %zu out of bounds\n"),
+ idx, section_name (ebl, idx), cnt - 2 - nbucket);
++ }
+ }
+
+
+@@ -2011,18 +2049,28 @@
+ maxidx = symsize;
+ }
+
++ Elf64_Xword *buf = (Elf64_Xword *) data->d_buf;
++ Elf64_Xword *end = (Elf64_Xword *) ((char *) data->d_buf + shdr->sh_size);
+ size_t cnt;
+ for (cnt = 2; cnt < 2 + nbucket; ++cnt)
+- if (((Elf64_Xword *) data->d_buf)[cnt] >= maxidx)
++ {
++ if (buf + cnt >= end)
++ break;
++ else if (buf[cnt] >= maxidx)
+ ERROR (gettext ("\
+ section [%2d] '%s': hash bucket reference %zu out of bounds\n"),
+ idx, section_name (ebl, idx), cnt - 2);
++ }
+
+ for (; cnt < 2 + nbucket + nchain; ++cnt)
+- if (((Elf64_Xword *) data->d_buf)[cnt] >= maxidx)
++ {
++ if (buf + cnt >= end)
++ break;
++ else if (buf[cnt] >= maxidx)
+ ERROR (gettext ("\
+ section [%2d] '%s': hash chain reference %" PRIu64 " out of bounds\n"),
+- idx, section_name (ebl, idx), (uint64_t) (cnt - 2 - nbucket));
++ idx, section_name (ebl, idx), (uint64_t) cnt - 2 - nbucket);
++ }
+ }
+
+
+@@ -2047,7 +2095,7 @@
+ if (shdr->sh_size < (4 + bitmask_words + nbuckets) * sizeof (Elf32_Word))
+ {
+ ERROR (gettext ("\
+-section [%2d] '%s': hash table section is too small (is %ld, expected at least%ld)\n"),
++section [%2d] '%s': hash table section is too small (is %ld, expected at least %ld)\n"),
+ idx, section_name (ebl, idx), (long int) shdr->sh_size,
+ (long int) ((4 + bitmask_words + nbuckets) * sizeof (Elf32_Word)));
+ return;
+@@ -2719,8 +2767,9 @@
+
+ /* The number of elements in the version symbol table must be the
+ same as the number of symbols. */
+- if (shdr->sh_size / shdr->sh_entsize
+- != symshdr->sh_size / symshdr->sh_entsize)
++ if (shdr->sh_entsize && symshdr->sh_entsize
++ && (shdr->sh_size / shdr->sh_entsize
++ != symshdr->sh_size / symshdr->sh_entsize))
+ ERROR (gettext ("\
+ section [%2d] '%s' has different number of entries than symbol table [%2d] '%s'\n"),
+ idx, section_name (ebl, idx),
+Index: elfutils-0.148/src/readelf.c
+===================================================================
+--- elfutils-0.148.orig/src/readelf.c 2010-07-03 13:07:10.000000000 +0000
++++ elfutils-0.148/src/readelf.c 2010-07-03 13:07:11.000000000 +0000
+@@ -1172,6 +1172,8 @@
+ Elf32_Word *grpref = (Elf32_Word *) data->d_buf;
+
+ GElf_Sym sym_mem;
++ GElf_Sym *sym = gelf_getsym (symdata, shdr->sh_info, &sym_mem);
++
+ printf ((grpref[0] & GRP_COMDAT)
+ ? ngettext ("\
+ \nCOMDAT section group [%2zu] '%s' with signature '%s' contains %zu entry:\n",
+@@ -1184,8 +1186,8 @@
+ data->d_size / sizeof (Elf32_Word) - 1),
+ elf_ndxscn (scn),
+ elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
+- elf_strptr (ebl->elf, symshdr->sh_link,
+- gelf_getsym (symdata, shdr->sh_info, &sym_mem)->st_name)
++ (sym == NULL ? NULL
++ : elf_strptr (ebl->elf, symshdr->sh_link, sym->st_name))
+ ?: gettext ("<INVALID SYMBOL>"),
+ data->d_size / sizeof (Elf32_Word) - 1);
+
+@@ -1336,7 +1338,8 @@
+ handle_dynamic (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
+ {
+ int class = gelf_getclass (ebl->elf);
+- GElf_Shdr glink;
++ GElf_Shdr glink_mem;
++ GElf_Shdr *glink;
+ Elf_Data *data;
+ size_t cnt;
+ size_t shstrndx;
+@@ -1351,6 +1354,11 @@
+ error (EXIT_FAILURE, 0,
+ gettext ("cannot get section header string table index"));
+
++ glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link), &glink_mem);
++ if (glink == NULL)
++ error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %Zu"),
++ elf_ndxscn (scn));
++
+ printf (ngettext ("\
+ \nDynamic segment contains %lu entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n",
+ "\
+@@ -1360,9 +1368,7 @@
+ class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
+ shdr->sh_offset,
+ (int) shdr->sh_link,
+- elf_strptr (ebl->elf, shstrndx,
+- gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
+- &glink)->sh_name));
++ elf_strptr (ebl->elf, shstrndx, glink->sh_name));
+ fputs_unlocked (gettext (" Type Value\n"), stdout);
+
+ for (cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
+@@ -1945,6 +1951,13 @@
+ error (EXIT_FAILURE, 0,
+ gettext ("cannot get section header string table index"));
+
++ GElf_Shdr glink_mem;
++ GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
++ &glink_mem);
++ if (glink == NULL)
++ error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %Zu"),
++ elf_ndxscn (scn));
++
+ /* Now we can compute the number of entries in the section. */
+ unsigned int nsyms = data->d_size / (class == ELFCLASS32
+ ? sizeof (Elf32_Sym)
+@@ -1955,15 +1968,12 @@
+ nsyms),
+ (unsigned int) elf_ndxscn (scn),
+ elf_strptr (ebl->elf, shstrndx, shdr->sh_name), nsyms);
+- GElf_Shdr glink;
+ printf (ngettext (" %lu local symbol String table: [%2u] '%s'\n",
+ " %lu local symbols String table: [%2u] '%s'\n",
+ shdr->sh_info),
+ (unsigned long int) shdr->sh_info,
+ (unsigned int) shdr->sh_link,
+- elf_strptr (ebl->elf, shstrndx,
+- gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
+- &glink)->sh_name));
++ elf_strptr (ebl->elf, shstrndx, glink->sh_name));
+
+ fputs_unlocked (class == ELFCLASS32
+ ? gettext ("\
+@@ -2199,7 +2209,13 @@
+ error (EXIT_FAILURE, 0,
+ gettext ("cannot get section header string table index"));
+
+- GElf_Shdr glink;
++ GElf_Shdr glink_mem;
++ GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
++ &glink_mem);
++ if (glink == NULL)
++ error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %Zu"),
++ elf_ndxscn (scn));
++
+ printf (ngettext ("\
+ \nVersion needs section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n",
+ "\
+@@ -2210,9 +2226,7 @@
+ class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
+ shdr->sh_offset,
+ (unsigned int) shdr->sh_link,
+- elf_strptr (ebl->elf, shstrndx,
+- gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
+- &glink)->sh_name));
++ elf_strptr (ebl->elf, shstrndx, glink->sh_name));
+
+ unsigned int offset = 0;
+ for (int cnt = shdr->sh_info; --cnt >= 0; )
+@@ -2265,8 +2279,14 @@
+ error (EXIT_FAILURE, 0,
+ gettext ("cannot get section header string table index"));
+
++ GElf_Shdr glink_mem;
++ GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
++ &glink_mem);
++ if (glink == NULL)
++ error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %Zu"),
++ elf_ndxscn (scn));
++
+ int class = gelf_getclass (ebl->elf);
+- GElf_Shdr glink;
+ printf (ngettext ("\
+ \nVersion definition section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n",
+ "\
+@@ -2278,9 +2298,7 @@
+ class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
+ shdr->sh_offset,
+ (unsigned int) shdr->sh_link,
+- elf_strptr (ebl->elf, shstrndx,
+- gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
+- &glink)->sh_name));
++ elf_strptr (ebl->elf, shstrndx, glink->sh_name));
+
+ unsigned int offset = 0;
+ for (int cnt = shdr->sh_info; --cnt >= 0; )
+@@ -2542,8 +2560,14 @@
+ filename = NULL;
+ }
+
++ GElf_Shdr glink_mem;
++ GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
++ &glink_mem);
++ if (glink == NULL)
++ error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %Zu"),
++ elf_ndxscn (scn));
++
+ /* Print the header. */
+- GElf_Shdr glink;
+ printf (ngettext ("\
+ \nVersion symbols section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'",
+ "\
+@@ -2555,9 +2579,7 @@
+ class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
+ shdr->sh_offset,
+ (unsigned int) shdr->sh_link,
+- elf_strptr (ebl->elf, shstrndx,
+- gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
+- &glink)->sh_name));
++ elf_strptr (ebl->elf, shstrndx, glink->sh_name));
+
+ /* Now we can finally look at the actual contents of this section. */
+ for (unsigned int cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
+@@ -2609,7 +2631,17 @@
+ for (Elf32_Word cnt = 0; cnt < nbucket; ++cnt)
+ ++counts[lengths[cnt]];
+
+- GElf_Shdr glink;
++ GElf_Shdr glink_mem;
++ GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf,
++ shdr->sh_link),
++ &glink_mem);
++ if (glink == NULL)
++ {
++ error (0, 0, gettext ("invalid sh_link value in section %Zu"),
++ elf_ndxscn (scn));
++ return;
++ }
++
+ printf (ngettext ("\
+ \nHistogram for bucket list length in section [%2u] '%s' (total of %d bucket):\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n",
+ "\
+@@ -2622,9 +2654,7 @@
+ shdr->sh_addr,
+ shdr->sh_offset,
+ (unsigned int) shdr->sh_link,
+- elf_strptr (ebl->elf, shstrndx,
+- gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
+- &glink)->sh_name));
++ elf_strptr (ebl->elf, shstrndx, glink->sh_name));
+
+ if (extrastr != NULL)
+ fputs (extrastr, stdout);
+@@ -4312,6 +4342,16 @@
+ return;
+ }
+
++ GElf_Shdr glink_mem;
++ GElf_Shdr *glink;
++ glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link), &glink_mem);
++ if (glink == NULL)
++ {
++ error (0, 0, gettext ("invalid sh_link value in section %Zu"),
++ elf_ndxscn (scn));
++ return;
++ }
++
+ printf (ngettext ("\
+ \nDWARF section [%2zu] '%s' at offset %#" PRIx64 " contains %zu entry:\n",
+ "\
+Index: elfutils-0.148/src/strip.c
+===================================================================
+--- elfutils-0.148.orig/src/strip.c 2010-07-03 13:07:10.000000000 +0000
++++ elfutils-0.148/src/strip.c 2010-07-03 13:07:11.000000000 +0000
+@@ -561,6 +561,11 @@
+ goto fail_close;
+ }
+
++ if (shstrndx >= shnum)
++ goto illformed;
++
++#define elf_assert(test) do { if (!(test)) goto illformed; } while (0)
++
+ /* Storage for section information. We leave room for two more
+ entries since we unconditionally create a section header string
+ table. Maybe some weird tool created an ELF file without one.
+@@ -582,7 +587,7 @@
+ {
+ /* This should always be true (i.e., there should not be any
+ holes in the numbering). */
+- assert (elf_ndxscn (scn) == cnt);
++ elf_assert (elf_ndxscn (scn) == cnt);
+
+ shdr_info[cnt].scn = scn;
+
+@@ -595,6 +600,7 @@
+ shdr_info[cnt].shdr.sh_name);
+ if (shdr_info[cnt].name == NULL)
+ {
++ illformed:
+ error (0, 0, gettext ("illformed file '%s'"), fname);
+ goto fail_close;
+ }
+@@ -604,6 +610,8 @@
+
+ /* Remember the shdr.sh_link value. */
+ shdr_info[cnt].old_sh_link = shdr_info[cnt].shdr.sh_link;
++ if (shdr_info[cnt].old_sh_link >= shnum)
++ goto illformed;
+
+ /* Sections in files other than relocatable object files which
+ are not loaded can be freely moved by us. In relocatable
+@@ -616,7 +624,7 @@
+ appropriate reference. */
+ if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_SYMTAB_SHNDX))
+ {
+- assert (shdr_info[shdr_info[cnt].shdr.sh_link].symtab_idx == 0);
++ elf_assert (shdr_info[shdr_info[cnt].shdr.sh_link].symtab_idx == 0);
+ shdr_info[shdr_info[cnt].shdr.sh_link].symtab_idx = cnt;
+ }
+ else if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_GROUP))
+@@ -633,7 +641,12 @@
+ for (inner = 1;
+ inner < shdr_info[cnt].data->d_size / sizeof (Elf32_Word);
+ ++inner)
++ {
++ if (grpref[inner] < shnum)
+ shdr_info[grpref[inner]].group_idx = cnt;
++ else
++ goto illformed;
++ }
+
+ if (inner == 1 || (inner == 2 && (grpref[0] & GRP_COMDAT) == 0))
+ /* If the section group contains only one element and this
+@@ -644,7 +657,7 @@
+ }
+ else if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_GNU_versym))
+ {
+- assert (shdr_info[shdr_info[cnt].shdr.sh_link].version_idx == 0);
++ elf_assert (shdr_info[shdr_info[cnt].shdr.sh_link].version_idx == 0);
+ shdr_info[shdr_info[cnt].shdr.sh_link].version_idx = cnt;
+ }
+
+@@ -652,7 +665,7 @@
+ discarded right away. */
+ if ((shdr_info[cnt].shdr.sh_flags & SHF_GROUP) != 0)
+ {
+- assert (shdr_info[cnt].group_idx != 0);
++ elf_assert (shdr_info[cnt].group_idx != 0);
+
+ if (shdr_info[shdr_info[cnt].group_idx].idx == 0)
+ {
+@@ -727,11 +740,15 @@
+ {
+ /* If a relocation section is marked as being removed make
+ sure the section it is relocating is removed, too. */
+- if ((shdr_info[cnt].shdr.sh_type == SHT_REL
++ if (shdr_info[cnt].shdr.sh_type == SHT_REL
+ || shdr_info[cnt].shdr.sh_type == SHT_RELA)
+- && shdr_info[shdr_info[cnt].shdr.sh_info].idx != 0)
++ {
++ if (shdr_info[cnt].shdr.sh_info >= shnum)
++ goto illformed;
++ else if (shdr_info[shdr_info[cnt].shdr.sh_info].idx != 0)
+ shdr_info[cnt].idx = 1;
+ }
++ }
+
+ if (shdr_info[cnt].idx == 1)
+ {
+@@ -758,7 +775,7 @@
+ if (shdr_info[cnt].symtab_idx != 0
+ && shdr_info[shdr_info[cnt].symtab_idx].data == NULL)
+ {
+- assert (shdr_info[cnt].shdr.sh_type == SHT_SYMTAB);
++ elf_assert (shdr_info[cnt].shdr.sh_type == SHT_SYMTAB);
+
+ shdr_info[shdr_info[cnt].symtab_idx].data
+ = elf_getdata (shdr_info[shdr_info[cnt].symtab_idx].scn,
+@@ -798,6 +815,9 @@
+ else if (scnidx == SHN_XINDEX)
+ scnidx = xndx;
+
++ if (scnidx >= shnum)
++ goto illformed;
++
+ if (shdr_info[scnidx].idx == 0)
+ /* This symbol table has a real symbol in
+ a discarded section. So preserve the
+@@ -828,12 +848,16 @@
+ }
+
+ /* Handle references through sh_info. */
+- if (SH_INFO_LINK_P (&shdr_info[cnt].shdr)
+- && shdr_info[shdr_info[cnt].shdr.sh_info].idx == 0)
++ if (SH_INFO_LINK_P (&shdr_info[cnt].shdr))
++ {
++ if (shdr_info[cnt].shdr.sh_info >= shnum)
++ goto illformed;
++ else if ( shdr_info[shdr_info[cnt].shdr.sh_info].idx == 0)
+ {
+ shdr_info[shdr_info[cnt].shdr.sh_info].idx = 1;
+ changes |= shdr_info[cnt].shdr.sh_info < cnt;
+ }
++ }
+
+ /* Mark the section as investigated. */
+ shdr_info[cnt].idx = 2;
+@@ -972,7 +996,7 @@
+ error (EXIT_FAILURE, 0, gettext ("while generating output file: %s"),
+ elf_errmsg (-1));
+
+- assert (elf_ndxscn (shdr_info[cnt].newscn) == shdr_info[cnt].idx);
++ elf_assert (elf_ndxscn (shdr_info[cnt].newscn) == shdr_info[cnt].idx);
+
+ /* Add this name to the section header string table. */
+ shdr_info[cnt].se = ebl_strtabadd (shst, shdr_info[cnt].name, 0);
+@@ -1009,7 +1033,7 @@
+ error (EXIT_FAILURE, 0,
+ gettext ("while create section header section: %s"),
+ elf_errmsg (-1));
+- assert (elf_ndxscn (shdr_info[cnt].newscn) == shdr_info[cnt].idx);
++ elf_assert (elf_ndxscn (shdr_info[cnt].newscn) == shdr_info[cnt].idx);
+
+ shdr_info[cnt].data = elf_newdata (shdr_info[cnt].newscn);
+ if (shdr_info[cnt].data == NULL)
+@@ -1065,7 +1089,7 @@
+ error (EXIT_FAILURE, 0,
+ gettext ("while create section header section: %s"),
+ elf_errmsg (-1));
+- assert (elf_ndxscn (shdr_info[cnt].newscn) == idx);
++ elf_assert (elf_ndxscn (shdr_info[cnt].newscn) == idx);
+
+ /* Finalize the string table and fill in the correct indices in the
+ section headers. */
+@@ -1155,20 +1179,20 @@
+ shndxdata = elf_getdata (shdr_info[shdr_info[cnt].symtab_idx].scn,
+ NULL);
+
+- assert ((versiondata->d_size / sizeof (Elf32_Word))
++ elf_assert ((versiondata->d_size / sizeof (Elf32_Word))
+ >= shdr_info[cnt].data->d_size / elsize);
+ }
+
+ if (shdr_info[cnt].version_idx != 0)
+ {
+- assert (shdr_info[cnt].shdr.sh_type == SHT_DYNSYM);
++ elf_assert (shdr_info[cnt].shdr.sh_type == SHT_DYNSYM);
+ /* This section has associated version
+ information. We have to modify that
+ information, too. */
+ versiondata = elf_getdata (shdr_info[shdr_info[cnt].version_idx].scn,
+ NULL);
+
+- assert ((versiondata->d_size / sizeof (GElf_Versym))
++ elf_assert ((versiondata->d_size / sizeof (GElf_Versym))
+ >= shdr_info[cnt].data->d_size / elsize);
+ }
+
+@@ -1223,7 +1247,7 @@
+ sec = shdr_info[sym->st_shndx].idx;
+ else
+ {
+- assert (shndxdata != NULL);
++ elf_assert (shndxdata != NULL);
+
+ sec = shdr_info[xshndx].idx;
+ }
+@@ -1244,7 +1268,7 @@
+ nxshndx = sec;
+ }
+
+- assert (sec < SHN_LORESERVE || shndxdata != NULL);
++ elf_assert (sec < SHN_LORESERVE || shndxdata != NULL);
+
+ if ((inner != destidx || nshndx != sym->st_shndx
+ || (shndxdata != NULL && nxshndx != xshndx))
+@@ -1268,7 +1292,7 @@
+ || shdr_info[cnt].debug_data == NULL)
+ /* This is a section symbol for a section which has
+ been removed. */
+- assert (GELF_ST_TYPE (sym->st_info) == STT_SECTION);
++ elf_assert (GELF_ST_TYPE (sym->st_info) == STT_SECTION);
+ }
+
+ if (destidx != inner)
+@@ -1455,11 +1479,11 @@
+ {
+ GElf_Sym sym_mem;
+ GElf_Sym *sym = gelf_getsym (symd, inner, &sym_mem);
+- assert (sym != NULL);
++ elf_assert (sym != NULL);
+
+ const char *name = elf_strptr (elf, strshndx,
+ sym->st_name);
+- assert (name != NULL);
++ elf_assert (name != NULL);
+ size_t hidx = elf_hash (name) % nbucket;
+
+ if (bucket[hidx] == 0)
+@@ -1478,7 +1502,7 @@
+ else
+ {
+ /* Alpha and S390 64-bit use 64-bit SHT_HASH entries. */
+- assert (shdr_info[cnt].shdr.sh_entsize
++ elf_assert (shdr_info[cnt].shdr.sh_entsize
+ == sizeof (Elf64_Xword));
+
+ Elf64_Xword *bucket = (Elf64_Xword *) hashd->d_buf;
+@@ -1509,11 +1533,11 @@
+ {
+ GElf_Sym sym_mem;
+ GElf_Sym *sym = gelf_getsym (symd, inner, &sym_mem);
+- assert (sym != NULL);
++ elf_assert (sym != NULL);
+
+ const char *name = elf_strptr (elf, strshndx,
+ sym->st_name);
+- assert (name != NULL);
++ elf_assert (name != NULL);
+ size_t hidx = elf_hash (name) % nbucket;
+
+ if (bucket[hidx] == 0)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/remove-unused.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/remove-unused.patch
new file mode 100644
index 000000000..6a1979148
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/remove-unused.patch
@@ -0,0 +1,154 @@
+Upstream-Status: Backport
+
+Remove unused variables from the code to prevent -Werror causing a build
+failure on hosts with GCC 4.6.
+
+These changes are all upstream so should not be required once we've updated
+to elfutils 0.152 or later. Therefore this patch consolidates several
+changes from elfutils upstream by Roland McGrath into a single file so that
+it's easier to remove later once we upgrade.
+Links to upstream gitweb of the consolidated commits follow:
+- http://git.fedorahosted.org/git?p=elfutils.git;a=commit;h=7094d00a169afb27e0323f8580e817798ae7c240
+- http://git.fedorahosted.org/git?p=elfutils.git;a=commit;h=fd992543185126eb0280c1ee0883e073020499b4
+- http://git.fedorahosted.org/git?p=elfutils.git;a=commit;h=4db89f04bb59327abd7a3b60e88f2e7e73c65c79
+- http://git.fedorahosted.org/git?p=elfutils.git;a=commit;h=8f6c1795ab9d41f03805eebd55767070ade55aac
+- http://git.fedorahosted.org/git?p=elfutils.git;a=commit;h=240784b48aa276822c5a61c9ad6a4355051ce259
+
+Joshua Lock <josh@linux.intel.com> - 06/04/11
+
+Index: elfutils-0.148/libasm/asm_newscn.c
+===================================================================
+--- elfutils-0.148.orig/libasm/asm_newscn.c
++++ elfutils-0.148/libasm/asm_newscn.c
+@@ -162,7 +162,6 @@ asm_newscn (ctx, scnname, type, flags)
+ GElf_Xword flags;
+ {
+ size_t scnname_len = strlen (scnname) + 1;
+- unsigned long int hval;
+ AsmScn_t *result;
+
+ /* If no context is given there might be an earlier error. */
+@@ -180,8 +179,6 @@ asm_newscn (ctx, scnname, type, flags)
+ return NULL;
+ }
+
+- hval = elf_hash (scnname);
+-
+ rwlock_wrlock (ctx->lock);
+
+ /* This is a new section. */
+Index: elfutils-0.148/src/elflint.c
+===================================================================
+--- elfutils-0.148.orig/src/elflint.c
++++ elfutils-0.148/src/elflint.c
+@@ -707,9 +707,10 @@ section [%2d] '%s': symbol %zu: invalid
+ {
+ if (xndxdata == NULL)
+ {
+- ERROR (gettext ("\
++ if (!no_xndx_warned)
++ ERROR (gettext ("\
+ section [%2d] '%s': symbol %zu: too large section index but no extended section index section\n"),
+- idx, section_name (ebl, idx), cnt);
++ idx, section_name (ebl, idx), cnt);
+ no_xndx_warned = true;
+ }
+ else if (xndx < SHN_LORESERVE)
+@@ -1592,10 +1593,6 @@ check_dynamic (Ebl *ebl, GElf_Ehdr *ehdr
+ [DT_STRSZ] = true,
+ [DT_SYMENT] = true
+ };
+- GElf_Addr reladdr = 0;
+- GElf_Word relsz = 0;
+- GElf_Addr pltreladdr = 0;
+- GElf_Word pltrelsz = 0;
+
+ memset (has_dt, '\0', sizeof (has_dt));
+ memset (has_val_dt, '\0', sizeof (has_val_dt));
+@@ -1694,15 +1691,6 @@ section [%2d] '%s': entry %zu: level 2 t
+ section [%2d] '%s': entry %zu: DT_PLTREL value must be DT_REL or DT_RELA\n"),
+ idx, section_name (ebl, idx), cnt);
+
+- if (dyn->d_tag == DT_REL)
+- reladdr = dyn->d_un.d_ptr;
+- if (dyn->d_tag == DT_RELSZ)
+- relsz = dyn->d_un.d_val;
+- if (dyn->d_tag == DT_JMPREL)
+- pltreladdr = dyn->d_un.d_ptr;
+- if (dyn->d_tag == DT_PLTRELSZ)
+- pltrelsz = dyn->d_un.d_val;
+-
+ /* Check that addresses for entries are in loaded segments. */
+ switch (dyn->d_tag)
+ {
+Index: elfutils-0.148/src/ldgeneric.c
+===================================================================
+--- elfutils-0.148.orig/src/ldgeneric.c
++++ elfutils-0.148/src/ldgeneric.c
+@@ -285,12 +285,10 @@ static int
+ check_for_duplicate2 (struct usedfiles *newp, struct usedfiles *list)
+ {
+ struct usedfiles *first;
+- struct usedfiles *prevp;
+
+ if (list == NULL)
+ return 0;
+
+- prevp = list;
+ list = first = list->next;
+ do
+ {
+Index: elfutils-0.148/src/ldscript.y
+===================================================================
+--- elfutils-0.148.orig/src/ldscript.y
++++ elfutils-0.148/src/ldscript.y
+@@ -802,12 +802,9 @@ add_versions (struct version *versions)
+
+ do
+ {
+- struct version *oldp;
+-
+ add_id_list (versions->versionname, versions->local_names, true);
+ add_id_list (versions->versionname, versions->global_names, false);
+
+- oldp = versions;
+ versions = versions->next;
+ }
+ while (versions != NULL);
+Index: elfutils-0.148/src/unstrip.c
+===================================================================
+--- elfutils-0.148.orig/src/unstrip.c
++++ elfutils-0.148/src/unstrip.c
+@@ -1301,7 +1301,6 @@ more sections in stripped file than debu
+ /* Match each debuginfo section with its corresponding stripped section. */
+ bool check_prelink = false;
+ Elf_Scn *unstripped_symtab = NULL;
+- size_t unstripped_strtab_ndx = SHN_UNDEF;
+ size_t alloc_avail = 0;
+ scn = NULL;
+ while ((scn = elf_nextscn (unstripped, scn)) != NULL)
+@@ -1313,7 +1312,6 @@ more sections in stripped file than debu
+ if (shdr->sh_type == SHT_SYMTAB)
+ {
+ unstripped_symtab = scn;
+- unstripped_strtab_ndx = shdr->sh_link;
+ continue;
+ }
+
+Index: elfutils-0.148/src/ldscript.c
+===================================================================
+--- elfutils-0.148.orig/src/ldscript.c
++++ elfutils-0.148/src/ldscript.c
+@@ -2728,12 +2728,9 @@ add_versions (struct version *versions)
+
+ do
+ {
+- struct version *oldp;
+-
+ add_id_list (versions->versionname, versions->local_names, true);
+ add_id_list (versions->versionname, versions->global_names, false);
+
+- oldp = versions;
+ versions = versions->next;
+ }
+ while (versions != NULL);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/testsuite-ignore-elflint.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/testsuite-ignore-elflint.diff
new file mode 100644
index 000000000..d792d5fd7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/testsuite-ignore-elflint.diff
@@ -0,0 +1,21 @@
+Upstream-Status: Backport
+
+On many architectures this test fails because binaries/libs produced by
+binutils don't pass elflint. However elfutils shouldn't FTBFS because of this.
+
+So we run the tests on all archs to see what breaks, but if it breaks we ignore
+the result (exitcode 77 means: this test was skipped).
+
+Index: elfutils-0.128/tests/run-elflint-self.sh
+===================================================================
+--- elfutils-0.128.orig/tests/run-elflint-self.sh 2007-07-08 21:46:16.000000000 +0000
++++ elfutils-0.128/tests/run-elflint-self.sh 2007-07-08 21:46:49.000000000 +0000
+@@ -32,7 +32,7 @@
+ # echo $1
+ if [ -f $1 ]; then
+ testrun ../src/elflint --quiet --gnu-ld $1 ||
+- { echo "*** failure in $1"; status=1; }
++ { echo "*** failure in $1"; status=77; }
+ fi
+ }
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/uclibc-support-for-elfutils-0.148.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/uclibc-support-for-elfutils-0.148.patch
new file mode 100644
index 000000000..3cf16ac92
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/uclibc-support-for-elfutils-0.148.patch
@@ -0,0 +1,91 @@
+on uclibc systems libintl and libuargp are separate from libc.
+so they need to be specified on commandline when we use proxy-libintl
+then libintl is a static archive so it should be listed last since
+elfutils does not respect disable-nls we need to link in libintl
+
+We add a new option --enable-uclibc which will be used to control
+the uclibc specific configurations during build.
+
+Signed-off-by: Khem Raj <raj.khem>
+
+Upstream-Status: Inappropriate [uclibc specific]
+
+Index: elfutils-0.148/configure.ac
+===================================================================
+--- elfutils-0.148.orig/configure.ac
++++ elfutils-0.148/configure.ac
+@@ -55,9 +55,16 @@ AS_IF([test "$use_locks" = yes], [AC_DEF
+
+ AH_TEMPLATE([USE_LOCKS], [Defined if libraries should be thread-safe.])
+
++AC_ARG_ENABLE([uclibc],
++AS_HELP_STRING([--enable-uclibc], [Use uclibc for system libraries]),
++use_uclibc=yes, use_uclibc=no)
++AM_CONDITIONAL(USE_UCLIBC, test "$use_uclibc" = yes)
++AS_IF([test "$use_uclibc" = yes], [AC_DEFINE(USE_UCLIBC)])
++
++AH_TEMPLATE([USE_UCLIBC], [Defined if uclibc libraries are used.])
++
+ dnl Add all the languages for which translations are available.
+ ALL_LINGUAS=
+-
+ AC_PROG_CC
+ AC_PROG_RANLIB
+ AC_PROG_YACC
+Index: elfutils-0.148/libelf/Makefile.am
+===================================================================
+--- elfutils-0.148.orig/libelf/Makefile.am
++++ elfutils-0.148/libelf/Makefile.am
+@@ -93,7 +93,12 @@ if !MUDFLAP
+ libelf_pic_a_SOURCES =
+ am_libelf_pic_a_OBJECTS = $(libelf_a_SOURCES:.c=.os)
+
++
+ libelf_so_LDLIBS =
++if USE_UCLIBC
++libelf_so_LDLIBS += -lintl -luargp
++endif
++
+ if USE_LOCKS
+ libelf_so_LDLIBS += -lpthread
+ endif
+Index: elfutils-0.148/libdw/Makefile.am
+===================================================================
+--- elfutils-0.148.orig/libdw/Makefile.am
++++ elfutils-0.148/libdw/Makefile.am
+@@ -98,6 +98,11 @@ if !MUDFLAP
+ libdw_pic_a_SOURCES =
+ am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os)
+
++libdw_so_LDLIBS =
++if USE_UCLIBC
++libdw_so_LDLIBS += -lintl -luargp
++endif
++
+ libdw_so_SOURCES =
+ libdw.so: $(srcdir)/libdw.map libdw_pic.a \
+ ../libdwfl/libdwfl_pic.a ../libebl/libebl.a \
+@@ -108,7 +113,7 @@ libdw.so: $(srcdir)/libdw.map libdw_pic.
+ -Wl,--enable-new-dtags,-rpath,$(pkglibdir) \
+ -Wl,--version-script,$<,--no-undefined \
+ -Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\
+- -ldl $(zip_LIBS)
++ -ldl $(zip_LIBS) $(libdw_so_LDLIBS)
+ if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
+ ln -fs $@ $@.$(VERSION)
+
+Index: elfutils-0.148/libcpu/Makefile.am
+===================================================================
+--- elfutils-0.148.orig/libcpu/Makefile.am
++++ elfutils-0.148/libcpu/Makefile.am
+@@ -63,6 +63,10 @@ i386_parse_CFLAGS = -DNMNES="`wc -l < i3
+ i386_lex.o: i386_parse.h
+ i386_gendis_LDADD = $(libeu) -lm $(libmudflap)
+
++if USE_UCLIBC
++i386_gendis_LDADD += -luargp -lintl
++endif
++
+ i386_parse.h: i386_parse.c ;
+
+ noinst_HEADERS = memory-access.h i386_parse.h i386_data.h
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/x86_64_dis.h b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/x86_64_dis.h
new file mode 100644
index 000000000..a0198bed9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/x86_64_dis.h
@@ -0,0 +1,1632 @@
+#define MNEMONIC_BITS 10
+#define SUFFIX_BITS 3
+#define FCT1_BITS 7
+#define STR1_BITS 4
+#define OFF1_1_BITS 7
+#define OFF1_1_BIAS 3
+#define OFF1_2_BITS 7
+#define OFF1_2_BIAS 4
+#define OFF1_3_BITS 1
+#define OFF1_3_BIAS 7
+#define FCT2_BITS 6
+#define STR2_BITS 2
+#define OFF2_1_BITS 7
+#define OFF2_1_BIAS 5
+#define OFF2_2_BITS 7
+#define OFF2_2_BIAS 4
+#define OFF2_3_BITS 4
+#define OFF2_3_BIAS 7
+#define FCT3_BITS 4
+#define STR3_BITS 1
+#define OFF3_1_BITS 6
+#define OFF3_1_BIAS 10
+#define OFF3_2_BITS 1
+#define OFF3_2_BIAS 21
+
+#include <i386_data.h>
+
+#define suffix_none 0
+#define suffix_w 1
+#define suffix_w0 2
+#define suffix_W 3
+#define suffix_tttn 4
+#define suffix_D 7
+#define suffix_w1 5
+#define suffix_W1 6
+
+static const opfct_t op1_fct[] =
+{
+ NULL,
+ FCT_MOD$R_M,
+ FCT_Mod$R_m,
+ FCT_abs,
+ FCT_ax,
+ FCT_ax$w,
+ FCT_ccc,
+ FCT_ddd,
+ FCT_disp8,
+ FCT_ds_bx,
+ FCT_ds_si,
+ FCT_dx,
+ FCT_es_di,
+ FCT_freg,
+ FCT_imm$s,
+ FCT_imm$w,
+ FCT_imm16,
+ FCT_imm64$w,
+ FCT_imm8,
+ FCT_imms8,
+ FCT_mmxreg,
+ FCT_mod$16r_m,
+ FCT_mod$64r_m,
+ FCT_mod$8r_m,
+ FCT_mod$r_m,
+ FCT_mod$r_m$w,
+ FCT_reg,
+ FCT_reg$w,
+ FCT_reg64,
+ FCT_rel,
+ FCT_sel,
+ FCT_sreg2,
+ FCT_sreg3,
+ FCT_string,
+ FCT_xmmreg,
+};
+static const char op1_str[] =
+ "%ax\0"
+ "%cl\0"
+ "%rax\0"
+ "%st\0"
+ "%xmm0\0"
+ "*";
+static const uint8_t op1_str_idx[] = {
+ 0,
+ 4,
+ 8,
+ 13,
+ 17,
+ 23,
+};
+static const opfct_t op2_fct[] =
+{
+ NULL,
+ FCT_MOD$R_M,
+ FCT_Mod$R_m,
+ FCT_abs,
+ FCT_absval,
+ FCT_ax$w,
+ FCT_ccc,
+ FCT_ddd,
+ FCT_ds_si,
+ FCT_dx,
+ FCT_es_di,
+ FCT_freg,
+ FCT_imm8,
+ FCT_mmxreg,
+ FCT_mod$64r_m,
+ FCT_mod$r_m,
+ FCT_mod$r_m$w,
+ FCT_oreg,
+ FCT_oreg$w,
+ FCT_reg,
+ FCT_reg$w,
+ FCT_reg64,
+ FCT_sreg3,
+ FCT_string,
+ FCT_xmmreg,
+};
+static const char op2_str[] =
+ "%rcx\0"
+ "%st";
+static const uint8_t op2_str_idx[] = {
+ 0,
+ 5,
+};
+static const opfct_t op3_fct[] =
+{
+ NULL,
+ FCT_mmxreg,
+ FCT_mod$r_m,
+ FCT_reg,
+ FCT_string,
+ FCT_xmmreg,
+};
+static const char op3_str[] =
+ "%rdx";
+static const uint8_t op3_str_idx[] = {
+ 0,
+};
+static const struct instr_enc instrtab[] =
+{
+ { .mnemonic = MNE_adc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_adc, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_adc, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_adc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_adc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_add, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_add, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_add, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_add, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_add, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_addsubpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_addsubps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_and, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_and, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_and, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_and, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_and, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_andpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_andps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_andnpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_andnps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movslq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 21, .str2 = 0, .off2_1 = 5, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_bsf, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_bsr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_bswap, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 26, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_bt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_bt, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_btc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_btc, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_btr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_btr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_bts, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_bts, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_call, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 29, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_call, .rep = 0, .repe = 0, .suffix = 3, .modrm = 1, .fct1 = 22, .str1 = 6, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lcall, .rep = 0, .repe = 0, .suffix = 3, .modrm = 1, .fct1 = 22, .str1 = 6, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_clc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cli, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_syscall, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_clts, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sysret, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sysenter, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sysexit, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmov, .rep = 0, .repe = 0, .suffix = 4, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmp, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmp, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmps, .rep = 0, .repe = 1, .suffix = 1, .modrm = 0, .fct1 = 12, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 8, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpxchg, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 15, .off1_2 = 11, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 8, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cpuid, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtdq2pd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtpd2dq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvttpd2dq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_dec, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_div, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_emms, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_enter, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 16, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 12, .str2 = 0, .off2_1 = 19, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fnop, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fchs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fabs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ftst, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fxam, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fld1, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fldl2t, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fldl2e, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fldpi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fldlg2, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fldln2, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fldz, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_f2xm1, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fyl2x, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fptan, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fpatan, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fxtract, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fprem1, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fdecstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fincstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fprem, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fyl2xp1, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fsqrt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fsincos, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_frndint, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fscale, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fsin, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcos, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fadd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fadd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fadd, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fmul, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fmul, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fmul, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fsub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fsub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fsub, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fsubr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fsubr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fsubr, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fst, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fst, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fstp, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fldenv, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fldcw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fnstenv, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fnstcw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fxch, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_faddp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcmovb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fiadd, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcmove, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fmulp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fimul, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fsubp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fisub, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fsubrp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fisubr, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fnstsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 1, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fbld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcomip, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fbstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fchs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fclex, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_finit, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fwait, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fnclex, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcmovb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcmove, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcmovbe, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcmovu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcmovnb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcmovne, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcmovnbe, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcmovnu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcom, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcom, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcomp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcomp, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcompp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcomi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcomip, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fucomi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fucomip, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcos, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fdecstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fdiv, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fdiv, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fdiv, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fidivl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fdivp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fidiv, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fdivrp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fdivr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fdivr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fdivr, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fidivrl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fidivr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fdivrp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ffree, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcmovbe, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ficom, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fcmovu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ficomp, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fild, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fildl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fildll, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fincstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fninit, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fist, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fistp, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fistpll, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fisttp, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fisttpll, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fldt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fstpt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fld, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fucom, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_frstor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fucomp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fnsave, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fnstsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_hlt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_idiv, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_imul, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_imul, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_imul, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 14, .str1 = 0, .off1_1 = 13, .off1_2 = 2, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 3, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_in, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_in, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 11, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 3, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_inc, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ins, .rep = 1, .repe = 0, .suffix = 1, .modrm = 0, .fct1 = 11, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 10, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_int, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_int3, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_invd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_swapgs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_invlpg, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_iret, .rep = 0, .repe = 0, .suffix = 6, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_j, .rep = 0, .repe = 0, .suffix = 4, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_j, .rep = 0, .repe = 0, .suffix = 4, .modrm = 0, .fct1 = 29, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_set, .rep = 0, .repe = 0, .suffix = 4, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_jmp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_jmp, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 29, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_jmp, .rep = 0, .repe = 0, .suffix = 3, .modrm = 1, .fct1 = 22, .str1 = 6, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ljmp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 30, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 4, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ljmp, .rep = 0, .repe = 0, .suffix = 3, .modrm = 1, .fct1 = 22, .str1 = 6, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lahf, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lar, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 21, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lea, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 5, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_leave, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lfs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lgs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lgdt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lidt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lldt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 21, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lmsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 21, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lock, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lods, .rep = 1, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 10, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 3, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_loop, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_loope, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_loopne, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lsl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 21, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ltr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 21, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 3, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 35, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 5, .str1 = 0, .off1_1 = 37, .off1_2 = 3, .off1_3 = 0, .fct2 = 3, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 6, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 21, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 28, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 6, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 7, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 21, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 28, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 7, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 32, .str1 = 0, .off1_1 = 7, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 22, .str2 = 0, .off2_1 = 5, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movs, .rep = 1, .repe = 0, .suffix = 1, .modrm = 0, .fct1 = 10, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 10, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movsbl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movswl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 21, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movzbl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movzwl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 21, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mul, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_neg, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pause, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_popcnt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_not, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_or, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_or, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_or, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_or, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_or, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_out, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 5, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 12, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_out, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 5, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 9, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_outs, .rep = 1, .repe = 0, .suffix = 1, .modrm = 0, .fct1 = 10, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 9, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pop, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 28, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pop, .rep = 0, .repe = 0, .suffix = 3, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pop, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 32, .str1 = 0, .off1_1 = 7, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_popf, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_push, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 28, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pushq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_push, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 28, .str1 = 0, .off1_1 = 2, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pop, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 28, .str1 = 0, .off1_1 = 2, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_push, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 14, .str1 = 0, .off1_1 = 5, .off1_2 = 2, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_push, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 31, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_push, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 32, .str1 = 0, .off1_1 = 7, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pushf, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rcl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rcl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rcl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rcr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rcr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rcr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rdmsr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rdpmc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rdtsc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ret, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ret, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 16, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lret, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lret, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 16, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rol, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rol, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rol, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ror, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ror, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ror, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rsm, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sahf, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sar, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sar, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sar, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sbb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sbb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sbb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sbb, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sbb, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_scas, .rep = 0, .repe = 1, .suffix = 0, .modrm = 0, .fct1 = 12, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 3, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_set, .rep = 0, .repe = 0, .suffix = 4, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_shl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_shl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_shl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_shr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_shld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 2, .str3 = 0, .off3_1 = 6, .off3_2 = 0, },
+ { .mnemonic = MNE_shld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 2, .str3 = 0, .off3_1 = 6, .off3_2 = 0, },
+ { .mnemonic = MNE_shr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_shr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_shrd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 2, .str3 = 0, .off3_1 = 6, .off3_2 = 0, },
+ { .mnemonic = MNE_shrd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 2, .str3 = 0, .off3_1 = 6, .off3_2 = 0, },
+ { .mnemonic = MNE_vmcall, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_vmlaunch, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_vmresume, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_vmxoff, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_vmread, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 28, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 14, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_vmwrite, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 22, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 21, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sgdt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_monitor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 3, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 1, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 4, .str3 = 1, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mwait, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 3, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 1, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sidt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sldt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_smsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_stc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_std, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sti, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_stos, .rep = 1, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 5, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 10, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_str, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sub, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sub, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_test, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_test, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_test, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ud2a, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_verr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 21, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_verw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 21, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_wbinvd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_prefetch, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_prefetchw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_prefetchnta, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_prefetcht0, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_prefetcht1, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_prefetcht2, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_nop, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_wrmsr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_xadd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 15, .off1_2 = 11, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 8, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_xchg, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_xchg, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 4, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 17, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_xlat, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 9, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_xor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_xor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_xor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_xor, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_xor, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_emms, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pand, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pand, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pandn, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pandn, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmaddwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmaddwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_por, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_por, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pxor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pxor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_andnps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_andps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpeqps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpltps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpleps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpunordps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpneqps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpnltps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpnleps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpordps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpeqss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpltss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpless, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpunordss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpneqss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpnltss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpnless, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cmpordss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fxrstor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_fxsave, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ldmxcsr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_stmxcsr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movupd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movups, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movupd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movups, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movddup, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movsldup, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movlpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movhlps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movlps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movhlpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movhlps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movlpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movlps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_unpcklpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_unpcklps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_unpckhpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_unpckhps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movshdup, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movhpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movlhps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movhps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movlhpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movlhps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movhpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movhps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movapd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movaps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movapd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movaps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtsi2sd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtsi2ss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtpi2pd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtpi2ps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movntpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movntps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvttsd2si, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvttss2si, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvttpd2pi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvttps2pi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtpd2pi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtsd2si, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtss2si, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtps2pi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ucomisd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ucomiss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_comisd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_comiss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_getsec, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movmskpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 26, .off1_2 = 0, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movmskps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sqrtpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sqrtsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sqrtss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sqrtps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rsqrtss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rsqrtps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rcpss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_rcpps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_andpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_andps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_andnpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_andnps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_orpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_orps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_xorpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_xorps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_addsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_addss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_addpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_addps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mulsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mulss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mulpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mulps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtsd2ss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtss2sd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtpd2ps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtps2pd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtps2dq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvttps2dq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_cvtdq2ps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_subsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_subss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_subpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_subps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_minsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_minss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_minpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_minps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_divsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_divss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_divpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_divps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_maxsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_maxss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_maxpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_maxps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_punpcklbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_punpcklbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_punpcklwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_punpcklwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_punpckldq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_punpckldq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_packsswb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_packsswb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpgtb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpgtb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpgtw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpgtw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpgtd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpgtd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_packuswb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_packuswb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_punpckhbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_punpckhbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_punpckhwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_punpckhwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_punpckhdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_punpckhdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_packssdw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_packssdw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_punpcklqdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_punpckhqdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movdqa, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movdqu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pshufd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
+ { .mnemonic = MNE_pshuflw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
+ { .mnemonic = MNE_pshufhw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
+ { .mnemonic = MNE_pshufw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 1, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 1, .str3 = 0, .off3_1 = 8, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpeqb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpeqb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpeqw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpeqw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpeqd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpeqd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_haddpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_haddps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_hsubpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_hsubps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movdqa, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movdqu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 1, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movnti, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pinsrw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
+ { .mnemonic = MNE_pinsrw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 1, .str3 = 0, .off3_1 = 8, .off3_2 = 0, },
+ { .mnemonic = MNE_pextrw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 3, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
+ { .mnemonic = MNE_pextrw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 3, .str3 = 0, .off3_1 = 8, .off3_2 = 0, },
+ { .mnemonic = MNE_shufpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
+ { .mnemonic = MNE_shufps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 8, .off3_2 = 0, },
+ { .mnemonic = MNE_psrlw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrlw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrlq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrlq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmullw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmullw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movdq2q, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 26, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movq2dq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 20, .str1 = 0, .off1_1 = 26, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmovmskb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 26, .off1_2 = 0, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmovmskb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 20, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubusb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubusb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubusw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubusw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pminub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pminub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddusb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddusb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddusw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddusw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmaxub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmaxub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pavgb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pavgb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psraw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psraw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrad, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrad, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pavgw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pavgw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmulhuw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmulhuw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmulhw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmulhw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movntdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_movntq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 1, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pminsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pminsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmaxsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmaxsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lddqu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psllw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psllw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pslld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pslld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psllq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psllq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmuludq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmuludq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psadbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psadbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_maskmovdqu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 26, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_maskmovq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 20, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psubq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_paddd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pshufb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pshufb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_phaddw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_phaddw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_phaddd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_phaddd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_phaddsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_phaddsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmaddubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmaddubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_phsubw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_phsubw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_phsubd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_phsubd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_phsubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_phsubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psignb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psignb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psignw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psignw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psignd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psignd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmulhrsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmulhrsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pabsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pabsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pabsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pabsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pabsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pabsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_palignr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_palignr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 1, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 1, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
+ { .mnemonic = MNE_vmclear, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_vmxon, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_vmptrld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_vmptrst, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrlw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrlw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psraw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psraw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psllw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psllw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrad, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrad, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pslld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pslld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrlq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrlq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psrldq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psllq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_psllq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pslldq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_lfence, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mfence, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_sfence, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_clflush, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_blendps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_blendpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_blendvps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 33, .str1 = 5, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_blendvpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 33, .str1 = 5, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_dpps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_dppd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_insertps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_movntdqa, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_mpsadbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_packusdw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pblendvb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 33, .str1 = 5, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_pblendw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpeqq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpestri, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpestrm, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpistri, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpistrm, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_pcmpgtq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_phminposuw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pinsrb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_pinsrd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_pmaxsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmaxsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmaxud, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmaxuw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pminsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pminsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pminud, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pminuw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmovsxbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmovsxbd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmovsxbq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmovsxwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmovsxwq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmovsxdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmovzxbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmovzxbd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmovzxbq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmovzxwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmovzxwq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmovzxdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmuldq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_pmulld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_ptest, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+ { .mnemonic = MNE_roundps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_roundpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_roundss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_roundsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+ { .mnemonic = MNE_pop, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 31, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+};
+static const uint8_t match_data[] =
+{
+ 0x1, 0xfe, 0x14,
+ 0x2, 0xfe, 0x80, 0x38, 0x10,
+ 0x2, 0xfe, 0x82, 0x38, 0x10,
+ 0x2, 0xfe, 0x10, 0, 0,
+ 0x2, 0xfe, 0x12, 0, 0,
+ 0x1, 0xfe, 0x4,
+ 0x2, 0xfe, 0x80, 0x38, 0,
+ 0x12, 0x83, 0x38, 0,
+ 0x2, 0xfe, 0, 0, 0,
+ 0x2, 0xfe, 0x2, 0, 0,
+ 0x34, 0x66, 0xf, 0xd0, 0, 0,
+ 0x34, 0xf2, 0xf, 0xd0, 0, 0,
+ 0x1, 0xfe, 0x24,
+ 0x2, 0xfe, 0x80, 0x38, 0x20,
+ 0x2, 0xfe, 0x82, 0x38, 0x20,
+ 0x2, 0xfe, 0x20, 0, 0,
+ 0x2, 0xfe, 0x22, 0, 0,
+ 0x34, 0x66, 0xf, 0x54, 0, 0,
+ 0x23, 0xf, 0x54, 0, 0,
+ 0x34, 0x66, 0xf, 0x55, 0, 0,
+ 0x23, 0xf, 0x55, 0, 0,
+ 0x12, 0x63, 0, 0,
+ 0x23, 0xf, 0xbc, 0, 0,
+ 0x23, 0xf, 0xbd, 0, 0,
+ 0x12, 0xf, 0xf8, 0xc8,
+ 0x23, 0xf, 0xa3, 0, 0,
+ 0x23, 0xf, 0xba, 0x38, 0x20,
+ 0x23, 0xf, 0xbb, 0, 0,
+ 0x23, 0xf, 0xba, 0x38, 0x38,
+ 0x23, 0xf, 0xb3, 0, 0,
+ 0x23, 0xf, 0xba, 0x38, 0x30,
+ 0x23, 0xf, 0xab, 0, 0,
+ 0x23, 0xf, 0xba, 0x38, 0x28,
+ 0x11, 0xe8,
+ 0x12, 0xff, 0x38, 0x10,
+ 0x12, 0xff, 0x38, 0x18,
+ 0x11, 0x98,
+ 0x11, 0x99,
+ 0x11, 0xf8,
+ 0x11, 0xfc,
+ 0x11, 0xfa,
+ 0x22, 0xf, 0x5,
+ 0x22, 0xf, 0x6,
+ 0x22, 0xf, 0x7,
+ 0x22, 0xf, 0x34,
+ 0x22, 0xf, 0x35,
+ 0x11, 0xf5,
+ 0x13, 0xf, 0xf0, 0x40, 0, 0,
+ 0x1, 0xfe, 0x3c,
+ 0x2, 0xfe, 0x80, 0x38, 0x38,
+ 0x12, 0x83, 0x38, 0x38,
+ 0x2, 0xfe, 0x38, 0, 0,
+ 0x2, 0xfe, 0x3a, 0, 0,
+ 0x34, 0xf2, 0xf, 0xc2, 0, 0,
+ 0x34, 0xf3, 0xf, 0xc2, 0, 0,
+ 0x34, 0x66, 0xf, 0xc2, 0, 0,
+ 0x23, 0xf, 0xc2, 0, 0,
+ 0x1, 0xfe, 0xa6,
+ 0x13, 0xf, 0xfe, 0xb0, 0, 0,
+ 0x23, 0xf, 0xc7, 0x38, 0x8,
+ 0x22, 0xf, 0xa2,
+ 0x34, 0xf3, 0xf, 0xe6, 0, 0,
+ 0x34, 0xf2, 0xf, 0xe6, 0, 0,
+ 0x34, 0x66, 0xf, 0xe6, 0, 0,
+ 0x2, 0xfe, 0xfe, 0x38, 0x8,
+ 0x2, 0xfe, 0xf6, 0x38, 0x30,
+ 0x22, 0xf, 0x77,
+ 0x11, 0xc8,
+ 0x22, 0xd9, 0xd0,
+ 0x22, 0xd9, 0xe0,
+ 0x22, 0xd9, 0xe1,
+ 0x22, 0xd9, 0xe4,
+ 0x22, 0xd9, 0xe5,
+ 0x22, 0xd9, 0xe8,
+ 0x22, 0xd9, 0xe9,
+ 0x22, 0xd9, 0xea,
+ 0x22, 0xd9, 0xeb,
+ 0x22, 0xd9, 0xec,
+ 0x22, 0xd9, 0xed,
+ 0x22, 0xd9, 0xee,
+ 0x22, 0xd9, 0xf0,
+ 0x22, 0xd9, 0xf1,
+ 0x22, 0xd9, 0xf2,
+ 0x22, 0xd9, 0xf3,
+ 0x22, 0xd9, 0xf4,
+ 0x22, 0xd9, 0xf5,
+ 0x22, 0xd9, 0xf6,
+ 0x22, 0xd9, 0xf7,
+ 0x22, 0xd9, 0xf8,
+ 0x22, 0xd9, 0xf9,
+ 0x22, 0xd9, 0xfa,
+ 0x22, 0xd9, 0xfb,
+ 0x22, 0xd9, 0xfc,
+ 0x22, 0xd9, 0xfd,
+ 0x22, 0xd9, 0xfe,
+ 0x22, 0xd9, 0xff,
+ 0x12, 0xd8, 0xf8, 0xc0,
+ 0x12, 0xdc, 0xf8, 0xc0,
+ 0x2, 0xfb, 0xd8, 0x38, 0,
+ 0x12, 0xd8, 0xf8, 0xc8,
+ 0x12, 0xdc, 0xf8, 0xc8,
+ 0x2, 0xfb, 0xd8, 0x38, 0x8,
+ 0x12, 0xd8, 0xf8, 0xe0,
+ 0x12, 0xdc, 0xf8, 0xe0,
+ 0x2, 0xfb, 0xd8, 0x38, 0x20,
+ 0x12, 0xd8, 0xf8, 0xe8,
+ 0x12, 0xdc, 0xf8, 0xe8,
+ 0x2, 0xfb, 0xd8, 0x38, 0x28,
+ 0x12, 0xdd, 0xf8, 0xd0,
+ 0x2, 0xfb, 0xd9, 0x38, 0x10,
+ 0x12, 0xdd, 0xf8, 0xd8,
+ 0x2, 0xfb, 0xd9, 0x38, 0x18,
+ 0x12, 0xd9, 0x38, 0x20,
+ 0x12, 0xd9, 0x38, 0x28,
+ 0x12, 0xd9, 0x38, 0x30,
+ 0x12, 0xd9, 0x38, 0x38,
+ 0x12, 0xd9, 0xf8, 0xc8,
+ 0x12, 0xde, 0xf8, 0xc0,
+ 0x12, 0xda, 0xf8, 0xc0,
+ 0x2, 0xfb, 0xda, 0x38, 0,
+ 0x12, 0xda, 0xf8, 0xc8,
+ 0x12, 0xde, 0xf8, 0xc8,
+ 0x2, 0xfb, 0xda, 0x38, 0x8,
+ 0x12, 0xde, 0xf8, 0xe0,
+ 0x2, 0xfb, 0xda, 0x38, 0x20,
+ 0x12, 0xde, 0xf8, 0xe8,
+ 0x2, 0xfb, 0xda, 0x38, 0x28,
+ 0x22, 0xdf, 0xe0,
+ 0x12, 0xdf, 0x38, 0x20,
+ 0x12, 0xdf, 0xf8, 0xf0,
+ 0x12, 0xdf, 0x38, 0x30,
+ 0x22, 0xd9, 0xe0,
+ 0x33, 0x9b, 0xdb, 0xe2,
+ 0x33, 0x9b, 0xdb, 0xe3,
+ 0x11, 0x9b,
+ 0x22, 0xdb, 0xe2,
+ 0x12, 0xda, 0xf8, 0xc0,
+ 0x12, 0xda, 0xf8, 0xc8,
+ 0x12, 0xda, 0xf8, 0xd0,
+ 0x12, 0xda, 0xf8, 0xd8,
+ 0x12, 0xdb, 0xf8, 0xc0,
+ 0x12, 0xdb, 0xf8, 0xc8,
+ 0x12, 0xdb, 0xf8, 0xd0,
+ 0x12, 0xdb, 0xf8, 0xd8,
+ 0x12, 0xd8, 0xf8, 0xd0,
+ 0x2, 0xfb, 0xd8, 0x38, 0x10,
+ 0x12, 0xd8, 0xf8, 0xd8,
+ 0x2, 0xfb, 0xd8, 0x38, 0x18,
+ 0x22, 0xde, 0xd9,
+ 0x12, 0xdb, 0xf8, 0xf0,
+ 0x12, 0xdf, 0xf8, 0xf0,
+ 0x12, 0xdb, 0xf8, 0xe8,
+ 0x12, 0xdf, 0xf8, 0xe8,
+ 0x22, 0xd9, 0xff,
+ 0x22, 0xd9, 0xf6,
+ 0x12, 0xd8, 0xf8, 0xf0,
+ 0x12, 0xdc, 0xf8, 0xf0,
+ 0x2, 0xfb, 0xd8, 0x38, 0x30,
+ 0x12, 0xda, 0x38, 0x30,
+ 0x12, 0xde, 0xf8, 0xf0,
+ 0x12, 0xde, 0x38, 0x30,
+ 0x12, 0xde, 0xf8, 0xf8,
+ 0x12, 0xd8, 0xf8, 0xf8,
+ 0x12, 0xdc, 0xf8, 0xf8,
+ 0x2, 0xfb, 0xd8, 0x38, 0x38,
+ 0x12, 0xda, 0x38, 0x38,
+ 0x12, 0xde, 0x38, 0x38,
+ 0x12, 0xde, 0xf8, 0xf0,
+ 0x12, 0xdd, 0xf8, 0xc0,
+ 0x12, 0xda, 0xf8, 0xd0,
+ 0x2, 0xfb, 0xda, 0x38, 0x10,
+ 0x12, 0xda, 0xf8, 0xd8,
+ 0x2, 0xfb, 0xda, 0x38, 0x18,
+ 0x12, 0xdf, 0x38, 0,
+ 0x12, 0xdb, 0x38, 0,
+ 0x12, 0xdf, 0x38, 0x28,
+ 0x22, 0xd9, 0xf7,
+ 0x22, 0xdb, 0xe3,
+ 0x2, 0xfb, 0xdb, 0x38, 0x10,
+ 0x2, 0xfb, 0xdb, 0x38, 0x18,
+ 0x12, 0xdf, 0x38, 0x38,
+ 0x2, 0xfb, 0xdb, 0x38, 0x8,
+ 0x12, 0xdd, 0x38, 0x8,
+ 0x12, 0xdb, 0x38, 0x28,
+ 0x12, 0xdb, 0x38, 0x38,
+ 0x12, 0xd9, 0xf8, 0xc0,
+ 0x2, 0xfb, 0xd9, 0x38, 0,
+ 0x12, 0xdd, 0xf8, 0xe0,
+ 0x12, 0xdd, 0x38, 0x20,
+ 0x12, 0xdd, 0xf8, 0xe8,
+ 0x12, 0xdd, 0x38, 0x30,
+ 0x12, 0xdd, 0x38, 0x38,
+ 0x11, 0xf4,
+ 0x2, 0xfe, 0xf6, 0x38, 0x38,
+ 0x2, 0xfe, 0xf6, 0x38, 0x28,
+ 0x23, 0xf, 0xaf, 0, 0,
+ 0x2, 0xfd, 0x69, 0, 0,
+ 0x1, 0xfe, 0xe4,
+ 0x1, 0xfe, 0xec,
+ 0x2, 0xfe, 0xfe, 0x38, 0,
+ 0x1, 0xfe, 0x6c,
+ 0x11, 0xcd,
+ 0x11, 0xcc,
+ 0x22, 0xf, 0x8,
+ 0x33, 0xf, 0x1, 0xf8,
+ 0x23, 0xf, 0x1, 0x38, 0x38,
+ 0x11, 0xcf,
+ 0x1, 0xf0, 0x70,
+ 0x12, 0xf, 0xf0, 0x80,
+ 0x13, 0xf, 0xf0, 0x90, 0x38, 0,
+ 0x11, 0xe3,
+ 0x11, 0xeb,
+ 0x11, 0xe9,
+ 0x12, 0xff, 0x38, 0x20,
+ 0x11, 0xea,
+ 0x12, 0xff, 0x38, 0x28,
+ 0x11, 0x9f,
+ 0x23, 0xf, 0x2, 0, 0,
+ 0x12, 0x8d, 0, 0,
+ 0x11, 0xc9,
+ 0x23, 0xf, 0xb4, 0, 0,
+ 0x23, 0xf, 0xb5, 0, 0,
+ 0x23, 0xf, 0x1, 0x38, 0x10,
+ 0x23, 0xf, 0x1, 0x38, 0x18,
+ 0x23, 0xf, 0, 0x38, 0x10,
+ 0x23, 0xf, 0x1, 0x38, 0x30,
+ 0x11, 0xf0,
+ 0x1, 0xfe, 0xac,
+ 0x11, 0xe2,
+ 0x11, 0xe1,
+ 0x11, 0xe0,
+ 0x23, 0xf, 0x3, 0, 0,
+ 0x23, 0xf, 0xb2, 0, 0,
+ 0x23, 0xf, 0, 0x38, 0x18,
+ 0x2, 0xfe, 0x88, 0, 0,
+ 0x2, 0xfe, 0x8a, 0, 0,
+ 0x2, 0xfe, 0xc6, 0x38, 0,
+ 0x1, 0xf0, 0xb0,
+ 0x1, 0xfe, 0xa0,
+ 0x1, 0xfe, 0xa2,
+ 0x23, 0xf, 0x20, 0xc0, 0xc0,
+ 0x23, 0xf, 0x22, 0xc0, 0xc0,
+ 0x23, 0xf, 0x21, 0xc0, 0xc0,
+ 0x23, 0xf, 0x23, 0xc0, 0xc0,
+ 0x12, 0x8c, 0, 0,
+ 0x12, 0x8e, 0, 0,
+ 0x1, 0xfe, 0xa4,
+ 0x23, 0xf, 0xbe, 0, 0,
+ 0x23, 0xf, 0xbf, 0, 0,
+ 0x23, 0xf, 0xb6, 0, 0,
+ 0x23, 0xf, 0xb7, 0, 0,
+ 0x2, 0xfe, 0xf6, 0x38, 0x20,
+ 0x2, 0xfe, 0xf6, 0x38, 0x18,
+ 0x22, 0xf3, 0x90,
+ 0x11, 0x90,
+ 0x34, 0xf3, 0xf, 0xb8, 0, 0,
+ 0x2, 0xfe, 0xf6, 0x38, 0x10,
+ 0x2, 0xfe, 0x8, 0, 0,
+ 0x2, 0xfe, 0xa, 0, 0,
+ 0x2, 0xfe, 0x80, 0x38, 0x8,
+ 0x2, 0xfe, 0x82, 0x38, 0x8,
+ 0x1, 0xfe, 0xc,
+ 0x1, 0xfe, 0xe6,
+ 0x1, 0xfe, 0xee,
+ 0x1, 0xfe, 0x6e,
+ 0x12, 0x8f, 0xf8, 0xc0,
+ 0x12, 0x8f, 0x38, 0,
+ 0x12, 0xf, 0xc7, 0x81,
+ 0x11, 0x9d,
+ 0x12, 0xff, 0xf8, 0xf0,
+ 0x12, 0xff, 0x38, 0x30,
+ 0x1, 0xf8, 0x50,
+ 0x1, 0xf8, 0x58,
+ 0x1, 0xfd, 0x68,
+ 0x1, 0xe7, 0x6,
+ 0x12, 0xf, 0xc7, 0x80,
+ 0x11, 0x9c,
+ 0x2, 0xfe, 0xd0, 0x38, 0x10,
+ 0x2, 0xfe, 0xd2, 0x38, 0x10,
+ 0x2, 0xfe, 0xc0, 0x38, 0x10,
+ 0x2, 0xfe, 0xd0, 0x38, 0x18,
+ 0x2, 0xfe, 0xd2, 0x38, 0x18,
+ 0x2, 0xfe, 0xc0, 0x38, 0x18,
+ 0x22, 0xf, 0x32,
+ 0x22, 0xf, 0x33,
+ 0x22, 0xf, 0x31,
+ 0x11, 0xc3,
+ 0x11, 0xc2,
+ 0x11, 0xcb,
+ 0x11, 0xca,
+ 0x2, 0xfe, 0xd0, 0x38, 0,
+ 0x2, 0xfe, 0xd2, 0x38, 0,
+ 0x2, 0xfe, 0xc0, 0x38, 0,
+ 0x2, 0xfe, 0xd0, 0x38, 0x8,
+ 0x2, 0xfe, 0xd2, 0x38, 0x8,
+ 0x2, 0xfe, 0xc0, 0x38, 0x8,
+ 0x22, 0xf, 0xaa,
+ 0x11, 0x9e,
+ 0x2, 0xfe, 0xd0, 0x38, 0x38,
+ 0x2, 0xfe, 0xd2, 0x38, 0x38,
+ 0x2, 0xfe, 0xc0, 0x38, 0x38,
+ 0x2, 0xfe, 0x18, 0, 0,
+ 0x2, 0xfe, 0x1a, 0, 0,
+ 0x1, 0xfe, 0x1c,
+ 0x2, 0xfe, 0x80, 0x38, 0x18,
+ 0x2, 0xfe, 0x82, 0x38, 0x18,
+ 0x1, 0xfe, 0xae,
+ 0x13, 0xf, 0xf0, 0x90, 0x38, 0,
+ 0x2, 0xfe, 0xd0, 0x38, 0x20,
+ 0x2, 0xfe, 0xd2, 0x38, 0x20,
+ 0x2, 0xfe, 0xc0, 0x38, 0x20,
+ 0x2, 0xfe, 0xd0, 0x38, 0x28,
+ 0x23, 0xf, 0xa4, 0, 0,
+ 0x23, 0xf, 0xa5, 0, 0,
+ 0x2, 0xfe, 0xd2, 0x38, 0x28,
+ 0x2, 0xfe, 0xc0, 0x38, 0x28,
+ 0x23, 0xf, 0xac, 0, 0,
+ 0x23, 0xf, 0xad, 0, 0,
+ 0x33, 0xf, 0x1, 0xc1,
+ 0x33, 0xf, 0x1, 0xc2,
+ 0x33, 0xf, 0x1, 0xc3,
+ 0x33, 0xf, 0x1, 0xc4,
+ 0x23, 0xf, 0x78, 0, 0,
+ 0x23, 0xf, 0x79, 0, 0,
+ 0x23, 0xf, 0x1, 0x38, 0,
+ 0x33, 0xf, 0x1, 0xc8,
+ 0x33, 0xf, 0x1, 0xc9,
+ 0x23, 0xf, 0x1, 0x38, 0x8,
+ 0x23, 0xf, 0, 0x38, 0,
+ 0x23, 0xf, 0x1, 0x38, 0x20,
+ 0x11, 0xf9,
+ 0x11, 0xfd,
+ 0x11, 0xfb,
+ 0x1, 0xfe, 0xaa,
+ 0x23, 0xf, 0, 0x38, 0x8,
+ 0x2, 0xfe, 0x28, 0, 0,
+ 0x2, 0xfe, 0x2a, 0, 0,
+ 0x1, 0xfe, 0x2c,
+ 0x2, 0xfe, 0x80, 0x38, 0x28,
+ 0x2, 0xfe, 0x82, 0x38, 0x28,
+ 0x2, 0xfe, 0x84, 0, 0,
+ 0x1, 0xfe, 0xa8,
+ 0x2, 0xfe, 0xf6, 0x38, 0,
+ 0x22, 0xf, 0xb,
+ 0x23, 0xf, 0, 0x38, 0x20,
+ 0x23, 0xf, 0, 0x38, 0x28,
+ 0x22, 0xf, 0x9,
+ 0x23, 0xf, 0xd, 0x38, 0,
+ 0x23, 0xf, 0xd, 0x38, 0x8,
+ 0x23, 0xf, 0x18, 0x38, 0,
+ 0x23, 0xf, 0x18, 0x38, 0x8,
+ 0x23, 0xf, 0x18, 0x38, 0x10,
+ 0x23, 0xf, 0x18, 0x38, 0x18,
+ 0x23, 0xf, 0x1f, 0, 0,
+ 0x22, 0xf, 0x30,
+ 0x13, 0xf, 0xfe, 0xc0, 0, 0,
+ 0x2, 0xfe, 0x86, 0, 0,
+ 0x1, 0xf8, 0x90,
+ 0x11, 0xd7,
+ 0x2, 0xfe, 0x30, 0, 0,
+ 0x2, 0xfe, 0x32, 0, 0,
+ 0x1, 0xfe, 0x34,
+ 0x2, 0xfe, 0x80, 0x38, 0x30,
+ 0x2, 0xfe, 0x82, 0x38, 0x30,
+ 0x22, 0xf, 0x77,
+ 0x34, 0x66, 0xf, 0xdb, 0, 0,
+ 0x23, 0xf, 0xdb, 0, 0,
+ 0x34, 0x66, 0xf, 0xdf, 0, 0,
+ 0x23, 0xf, 0xdf, 0, 0,
+ 0x34, 0x66, 0xf, 0xf5, 0, 0,
+ 0x23, 0xf, 0xf5, 0, 0,
+ 0x34, 0x66, 0xf, 0xeb, 0, 0,
+ 0x23, 0xf, 0xeb, 0, 0,
+ 0x34, 0x66, 0xf, 0xef, 0, 0,
+ 0x23, 0xf, 0xef, 0, 0,
+ 0x23, 0xf, 0x55, 0, 0,
+ 0x23, 0xf, 0x54, 0, 0,
+ 0x24, 0xf, 0xc2, 0, 0, 0xff, 0,
+ 0x24, 0xf, 0xc2, 0, 0, 0xff, 0x1,
+ 0x24, 0xf, 0xc2, 0, 0, 0xff, 0x2,
+ 0x24, 0xf, 0xc2, 0, 0, 0xff, 0x3,
+ 0x24, 0xf, 0xc2, 0, 0, 0xff, 0x4,
+ 0x24, 0xf, 0xc2, 0, 0, 0xff, 0x5,
+ 0x24, 0xf, 0xc2, 0, 0, 0xff, 0x6,
+ 0x24, 0xf, 0xc2, 0, 0, 0xff, 0x7,
+ 0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0,
+ 0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x1,
+ 0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x2,
+ 0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x3,
+ 0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x4,
+ 0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x5,
+ 0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x6,
+ 0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x7,
+ 0x23, 0xf, 0xae, 0x38, 0x8,
+ 0x23, 0xf, 0xae, 0x38, 0,
+ 0x23, 0xf, 0xae, 0x38, 0x10,
+ 0x23, 0xf, 0xae, 0x38, 0x18,
+ 0x34, 0xf2, 0xf, 0x10, 0, 0,
+ 0x34, 0xf3, 0xf, 0x10, 0, 0,
+ 0x34, 0x66, 0xf, 0x10, 0, 0,
+ 0x23, 0xf, 0x10, 0, 0,
+ 0x34, 0xf2, 0xf, 0x11, 0, 0,
+ 0x34, 0xf3, 0xf, 0x11, 0, 0,
+ 0x34, 0x66, 0xf, 0x11, 0, 0,
+ 0x23, 0xf, 0x11, 0, 0,
+ 0x34, 0xf2, 0xf, 0x12, 0, 0,
+ 0x34, 0xf3, 0xf, 0x12, 0, 0,
+ 0x34, 0x66, 0xf, 0x12, 0, 0,
+ 0x23, 0xf, 0x12, 0xc0, 0xc0,
+ 0x23, 0xf, 0x12, 0, 0,
+ 0x34, 0x66, 0xf, 0x13, 0xc0, 0xc0,
+ 0x23, 0xf, 0x13, 0xc0, 0xc0,
+ 0x34, 0x66, 0xf, 0x13, 0, 0,
+ 0x23, 0xf, 0x13, 0, 0,
+ 0x34, 0x66, 0xf, 0x14, 0, 0,
+ 0x23, 0xf, 0x14, 0, 0,
+ 0x34, 0x66, 0xf, 0x15, 0, 0,
+ 0x23, 0xf, 0x15, 0, 0,
+ 0x34, 0xf3, 0xf, 0x16, 0, 0,
+ 0x34, 0x66, 0xf, 0x16, 0, 0,
+ 0x23, 0xf, 0x16, 0xc0, 0xc0,
+ 0x23, 0xf, 0x16, 0, 0,
+ 0x34, 0x66, 0xf, 0x17, 0xc0, 0xc0,
+ 0x23, 0xf, 0x17, 0xc0, 0xc0,
+ 0x34, 0x66, 0xf, 0x17, 0, 0,
+ 0x23, 0xf, 0x17, 0, 0,
+ 0x34, 0x66, 0xf, 0x28, 0, 0,
+ 0x23, 0xf, 0x28, 0, 0,
+ 0x34, 0x66, 0xf, 0x29, 0, 0,
+ 0x23, 0xf, 0x29, 0, 0,
+ 0x34, 0xf2, 0xf, 0x2a, 0, 0,
+ 0x34, 0xf3, 0xf, 0x2a, 0, 0,
+ 0x34, 0x66, 0xf, 0x2a, 0, 0,
+ 0x23, 0xf, 0x2a, 0, 0,
+ 0x34, 0x66, 0xf, 0x2b, 0, 0,
+ 0x23, 0xf, 0x2b, 0, 0,
+ 0x34, 0xf2, 0xf, 0x2c, 0, 0,
+ 0x34, 0xf3, 0xf, 0x2c, 0, 0,
+ 0x34, 0x66, 0xf, 0x2c, 0, 0,
+ 0x23, 0xf, 0x2c, 0, 0,
+ 0x34, 0x66, 0xf, 0x2d, 0, 0,
+ 0x34, 0xf2, 0xf, 0x2d, 0, 0,
+ 0x34, 0xf3, 0xf, 0x2d, 0, 0,
+ 0x23, 0xf, 0x2d, 0, 0,
+ 0x34, 0x66, 0xf, 0x2e, 0, 0,
+ 0x23, 0xf, 0x2e, 0, 0,
+ 0x34, 0x66, 0xf, 0x2f, 0, 0,
+ 0x23, 0xf, 0x2f, 0, 0,
+ 0x22, 0xf, 0x37,
+ 0x34, 0x66, 0xf, 0x50, 0xc0, 0xc0,
+ 0x23, 0xf, 0x50, 0xc0, 0xc0,
+ 0x34, 0x66, 0xf, 0x51, 0, 0,
+ 0x34, 0xf2, 0xf, 0x51, 0, 0,
+ 0x34, 0xf3, 0xf, 0x51, 0, 0,
+ 0x23, 0xf, 0x51, 0, 0,
+ 0x34, 0xf3, 0xf, 0x52, 0, 0,
+ 0x23, 0xf, 0x52, 0, 0,
+ 0x34, 0xf3, 0xf, 0x53, 0, 0,
+ 0x23, 0xf, 0x53, 0, 0,
+ 0x34, 0x66, 0xf, 0x54, 0, 0,
+ 0x23, 0xf, 0x54, 0, 0,
+ 0x34, 0x66, 0xf, 0x55, 0, 0,
+ 0x23, 0xf, 0x55, 0, 0,
+ 0x34, 0x66, 0xf, 0x56, 0, 0,
+ 0x23, 0xf, 0x56, 0, 0,
+ 0x34, 0x66, 0xf, 0x57, 0, 0,
+ 0x23, 0xf, 0x57, 0, 0,
+ 0x34, 0xf2, 0xf, 0x58, 0, 0,
+ 0x34, 0xf3, 0xf, 0x58, 0, 0,
+ 0x34, 0x66, 0xf, 0x58, 0, 0,
+ 0x23, 0xf, 0x58, 0, 0,
+ 0x34, 0xf2, 0xf, 0x59, 0, 0,
+ 0x34, 0xf3, 0xf, 0x59, 0, 0,
+ 0x34, 0x66, 0xf, 0x59, 0, 0,
+ 0x23, 0xf, 0x59, 0, 0,
+ 0x34, 0xf2, 0xf, 0x5a, 0, 0,
+ 0x34, 0xf3, 0xf, 0x5a, 0, 0,
+ 0x34, 0x66, 0xf, 0x5a, 0, 0,
+ 0x23, 0xf, 0x5a, 0, 0,
+ 0x34, 0x66, 0xf, 0x5b, 0, 0,
+ 0x34, 0xf3, 0xf, 0x5b, 0, 0,
+ 0x23, 0xf, 0x5b, 0, 0,
+ 0x34, 0xf2, 0xf, 0x5c, 0, 0,
+ 0x34, 0xf3, 0xf, 0x5c, 0, 0,
+ 0x34, 0x66, 0xf, 0x5c, 0, 0,
+ 0x23, 0xf, 0x5c, 0, 0,
+ 0x34, 0xf2, 0xf, 0x5d, 0, 0,
+ 0x34, 0xf3, 0xf, 0x5d, 0, 0,
+ 0x34, 0x66, 0xf, 0x5d, 0, 0,
+ 0x23, 0xf, 0x5d, 0, 0,
+ 0x34, 0xf2, 0xf, 0x5e, 0, 0,
+ 0x34, 0xf3, 0xf, 0x5e, 0, 0,
+ 0x34, 0x66, 0xf, 0x5e, 0, 0,
+ 0x23, 0xf, 0x5e, 0, 0,
+ 0x34, 0xf2, 0xf, 0x5f, 0, 0,
+ 0x34, 0xf3, 0xf, 0x5f, 0, 0,
+ 0x34, 0x66, 0xf, 0x5f, 0, 0,
+ 0x23, 0xf, 0x5f, 0, 0,
+ 0x34, 0x66, 0xf, 0x60, 0, 0,
+ 0x23, 0xf, 0x60, 0, 0,
+ 0x34, 0x66, 0xf, 0x61, 0, 0,
+ 0x23, 0xf, 0x61, 0, 0,
+ 0x34, 0x66, 0xf, 0x62, 0, 0,
+ 0x23, 0xf, 0x62, 0, 0,
+ 0x34, 0x66, 0xf, 0x63, 0, 0,
+ 0x23, 0xf, 0x63, 0, 0,
+ 0x34, 0x66, 0xf, 0x64, 0, 0,
+ 0x23, 0xf, 0x64, 0, 0,
+ 0x34, 0x66, 0xf, 0x65, 0, 0,
+ 0x23, 0xf, 0x65, 0, 0,
+ 0x34, 0x66, 0xf, 0x66, 0, 0,
+ 0x23, 0xf, 0x66, 0, 0,
+ 0x34, 0x66, 0xf, 0x67, 0, 0,
+ 0x23, 0xf, 0x67, 0, 0,
+ 0x34, 0x66, 0xf, 0x68, 0, 0,
+ 0x23, 0xf, 0x68, 0, 0,
+ 0x34, 0x66, 0xf, 0x69, 0, 0,
+ 0x23, 0xf, 0x69, 0, 0,
+ 0x34, 0x66, 0xf, 0x6a, 0, 0,
+ 0x23, 0xf, 0x6a, 0, 0,
+ 0x34, 0x66, 0xf, 0x6b, 0, 0,
+ 0x23, 0xf, 0x6b, 0, 0,
+ 0x34, 0x66, 0xf, 0x6c, 0, 0,
+ 0x34, 0x66, 0xf, 0x6d, 0, 0,
+ 0x34, 0x66, 0xf, 0x6e, 0, 0,
+ 0x23, 0xf, 0x6e, 0, 0,
+ 0x34, 0x66, 0xf, 0x6f, 0, 0,
+ 0x34, 0xf3, 0xf, 0x6f, 0, 0,
+ 0x23, 0xf, 0x6f, 0, 0,
+ 0x34, 0x66, 0xf, 0x70, 0, 0,
+ 0x34, 0xf2, 0xf, 0x70, 0, 0,
+ 0x34, 0xf3, 0xf, 0x70, 0, 0,
+ 0x23, 0xf, 0x70, 0, 0,
+ 0x34, 0x66, 0xf, 0x74, 0, 0,
+ 0x23, 0xf, 0x74, 0, 0,
+ 0x34, 0x66, 0xf, 0x75, 0, 0,
+ 0x23, 0xf, 0x75, 0, 0,
+ 0x34, 0x66, 0xf, 0x76, 0, 0,
+ 0x23, 0xf, 0x76, 0, 0,
+ 0x34, 0x66, 0xf, 0x7c, 0, 0,
+ 0x34, 0xf2, 0xf, 0x7c, 0, 0,
+ 0x34, 0x66, 0xf, 0x7d, 0, 0,
+ 0x34, 0xf2, 0xf, 0x7d, 0, 0,
+ 0x34, 0x66, 0xf, 0x7e, 0, 0,
+ 0x34, 0xf3, 0xf, 0x7e, 0, 0,
+ 0x23, 0xf, 0x7e, 0, 0,
+ 0x34, 0x66, 0xf, 0x7f, 0, 0,
+ 0x34, 0xf3, 0xf, 0x7f, 0, 0,
+ 0x23, 0xf, 0x7f, 0, 0,
+ 0x23, 0xf, 0xc3, 0, 0,
+ 0x34, 0x66, 0xf, 0xc4, 0, 0,
+ 0x23, 0xf, 0xc4, 0, 0,
+ 0x34, 0x66, 0xf, 0xc5, 0xc0, 0xc0,
+ 0x23, 0xf, 0xc5, 0xc0, 0xc0,
+ 0x34, 0x66, 0xf, 0xc6, 0, 0,
+ 0x23, 0xf, 0xc6, 0, 0,
+ 0x34, 0x66, 0xf, 0xd1, 0, 0,
+ 0x23, 0xf, 0xd1, 0, 0,
+ 0x34, 0x66, 0xf, 0xd2, 0, 0,
+ 0x23, 0xf, 0xd2, 0, 0,
+ 0x34, 0x66, 0xf, 0xd3, 0, 0,
+ 0x23, 0xf, 0xd3, 0, 0,
+ 0x34, 0x66, 0xf, 0xd4, 0, 0,
+ 0x23, 0xf, 0xd4, 0, 0,
+ 0x34, 0x66, 0xf, 0xd5, 0, 0,
+ 0x23, 0xf, 0xd5, 0, 0,
+ 0x34, 0x66, 0xf, 0xd6, 0, 0,
+ 0x34, 0xf2, 0xf, 0xd6, 0xc0, 0xc0,
+ 0x34, 0xf3, 0xf, 0xd6, 0xc0, 0xc0,
+ 0x34, 0x66, 0xf, 0xd7, 0xc0, 0xc0,
+ 0x23, 0xf, 0xd7, 0xc0, 0xc0,
+ 0x34, 0x66, 0xf, 0xd8, 0, 0,
+ 0x23, 0xf, 0xd8, 0, 0,
+ 0x34, 0x66, 0xf, 0xd9, 0, 0,
+ 0x23, 0xf, 0xd9, 0, 0,
+ 0x34, 0x66, 0xf, 0xda, 0, 0,
+ 0x23, 0xf, 0xda, 0, 0,
+ 0x34, 0x66, 0xf, 0xdc, 0, 0,
+ 0x23, 0xf, 0xdc, 0, 0,
+ 0x34, 0x66, 0xf, 0xdd, 0, 0,
+ 0x23, 0xf, 0xdd, 0, 0,
+ 0x34, 0x66, 0xf, 0xde, 0, 0,
+ 0x23, 0xf, 0xde, 0, 0,
+ 0x34, 0x66, 0xf, 0xe0, 0, 0,
+ 0x23, 0xf, 0xe0, 0, 0,
+ 0x34, 0x66, 0xf, 0xe1, 0, 0,
+ 0x23, 0xf, 0xe1, 0, 0,
+ 0x34, 0x66, 0xf, 0xe2, 0, 0,
+ 0x23, 0xf, 0xe2, 0, 0,
+ 0x34, 0x66, 0xf, 0xe3, 0, 0,
+ 0x23, 0xf, 0xe3, 0, 0,
+ 0x34, 0x66, 0xf, 0xe4, 0, 0,
+ 0x23, 0xf, 0xe4, 0, 0,
+ 0x34, 0x66, 0xf, 0xe5, 0, 0,
+ 0x23, 0xf, 0xe5, 0, 0,
+ 0x34, 0x66, 0xf, 0xe7, 0, 0,
+ 0x23, 0xf, 0xe7, 0, 0,
+ 0x34, 0x66, 0xf, 0xe8, 0, 0,
+ 0x23, 0xf, 0xe8, 0, 0,
+ 0x34, 0x66, 0xf, 0xe9, 0, 0,
+ 0x23, 0xf, 0xe9, 0, 0,
+ 0x34, 0x66, 0xf, 0xea, 0, 0,
+ 0x23, 0xf, 0xea, 0, 0,
+ 0x34, 0x66, 0xf, 0xec, 0, 0,
+ 0x23, 0xf, 0xec, 0, 0,
+ 0x34, 0x66, 0xf, 0xed, 0, 0,
+ 0x23, 0xf, 0xed, 0, 0,
+ 0x34, 0x66, 0xf, 0xee, 0, 0,
+ 0x23, 0xf, 0xee, 0, 0,
+ 0x34, 0xf2, 0xf, 0xf0, 0, 0,
+ 0x34, 0x66, 0xf, 0xf1, 0, 0,
+ 0x23, 0xf, 0xf1, 0, 0,
+ 0x34, 0x66, 0xf, 0xf2, 0, 0,
+ 0x23, 0xf, 0xf2, 0, 0,
+ 0x34, 0x66, 0xf, 0xf3, 0, 0,
+ 0x23, 0xf, 0xf3, 0, 0,
+ 0x34, 0x66, 0xf, 0xf4, 0, 0,
+ 0x23, 0xf, 0xf4, 0, 0,
+ 0x34, 0x66, 0xf, 0xf6, 0, 0,
+ 0x23, 0xf, 0xf6, 0, 0,
+ 0x34, 0x66, 0xf, 0xf7, 0xc0, 0xc0,
+ 0x23, 0xf, 0xf7, 0xc0, 0xc0,
+ 0x34, 0x66, 0xf, 0xf8, 0, 0,
+ 0x23, 0xf, 0xf8, 0, 0,
+ 0x34, 0x66, 0xf, 0xf9, 0, 0,
+ 0x23, 0xf, 0xf9, 0, 0,
+ 0x34, 0x66, 0xf, 0xfa, 0, 0,
+ 0x23, 0xf, 0xfa, 0, 0,
+ 0x34, 0x66, 0xf, 0xfb, 0, 0,
+ 0x23, 0xf, 0xfb, 0, 0,
+ 0x34, 0x66, 0xf, 0xfc, 0, 0,
+ 0x23, 0xf, 0xfc, 0, 0,
+ 0x34, 0x66, 0xf, 0xfd, 0, 0,
+ 0x23, 0xf, 0xfd, 0, 0,
+ 0x34, 0x66, 0xf, 0xfe, 0, 0,
+ 0x23, 0xf, 0xfe, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0, 0, 0,
+ 0x34, 0xf, 0x38, 0, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x1, 0, 0,
+ 0x34, 0xf, 0x38, 0x1, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x2, 0, 0,
+ 0x34, 0xf, 0x38, 0x2, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x3, 0, 0,
+ 0x34, 0xf, 0x38, 0x3, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x4, 0, 0,
+ 0x34, 0xf, 0x38, 0x4, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x5, 0, 0,
+ 0x34, 0xf, 0x38, 0x5, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x6, 0, 0,
+ 0x34, 0xf, 0x38, 0x6, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x7, 0, 0,
+ 0x34, 0xf, 0x38, 0x7, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x8, 0, 0,
+ 0x34, 0xf, 0x38, 0x8, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x9, 0, 0,
+ 0x34, 0xf, 0x38, 0x9, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0xa, 0, 0,
+ 0x34, 0xf, 0x38, 0xa, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0xb, 0, 0,
+ 0x34, 0xf, 0x38, 0xb, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x1c, 0, 0,
+ 0x34, 0xf, 0x38, 0x1c, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x1d, 0, 0,
+ 0x34, 0xf, 0x38, 0x1d, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x1e, 0, 0,
+ 0x34, 0xf, 0x38, 0x1e, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0xf, 0, 0,
+ 0x34, 0xf, 0x3a, 0xf, 0, 0,
+ 0x34, 0x66, 0xf, 0xc7, 0x38, 0x30,
+ 0x34, 0xf3, 0xf, 0xc7, 0x38, 0x30,
+ 0x23, 0xf, 0xc7, 0x38, 0x30,
+ 0x23, 0xf, 0xc7, 0x38, 0x38,
+ 0x34, 0x66, 0xf, 0x71, 0xf8, 0xd0,
+ 0x23, 0xf, 0x71, 0xf8, 0xd0,
+ 0x34, 0x66, 0xf, 0x71, 0xf8, 0xe0,
+ 0x23, 0xf, 0x71, 0xf8, 0xe0,
+ 0x34, 0x66, 0xf, 0x71, 0xf8, 0xf0,
+ 0x23, 0xf, 0x71, 0xf8, 0xf0,
+ 0x34, 0x66, 0xf, 0x72, 0xf8, 0xd0,
+ 0x23, 0xf, 0x72, 0xf8, 0xd0,
+ 0x34, 0x66, 0xf, 0x72, 0xf8, 0xe0,
+ 0x23, 0xf, 0x72, 0xf8, 0xe0,
+ 0x34, 0x66, 0xf, 0x72, 0xf8, 0xf0,
+ 0x23, 0xf, 0x72, 0xf8, 0xf0,
+ 0x34, 0x66, 0xf, 0x73, 0xf8, 0xd0,
+ 0x23, 0xf, 0x73, 0xf8, 0xd0,
+ 0x34, 0x66, 0xf, 0x73, 0xf8, 0xd8,
+ 0x34, 0x66, 0xf, 0x73, 0xf8, 0xf0,
+ 0x23, 0xf, 0x73, 0xf8, 0xf0,
+ 0x34, 0x66, 0xf, 0x73, 0xf8, 0xf8,
+ 0x33, 0xf, 0xae, 0xe8,
+ 0x33, 0xf, 0xae, 0xf0,
+ 0x33, 0xf, 0xae, 0xf8,
+ 0x23, 0xf, 0xae, 0x38, 0x38,
+ 0x23, 0xf, 0xf, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0xc, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0xd, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x14, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x15, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0x40, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0x41, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0x21, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x2a, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0x42, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x2b, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x10, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0xe, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x29, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0x61, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0x60, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0x63, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0x62, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x37, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x41, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0x20, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0x22, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x3c, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x3d, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x3f, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x3e, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x38, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x39, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x3b, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x3a, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x20, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x21, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x22, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x23, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x24, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x25, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x30, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x31, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x32, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x33, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x34, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x35, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x28, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x40, 0, 0,
+ 0x45, 0x66, 0xf, 0x38, 0x17, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0x8, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0x9, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0xa, 0, 0,
+ 0x45, 0x66, 0xf, 0x3a, 0xb, 0, 0,
+ 0x1, 0xe7, 0x7,
+};
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-Ignore-differences-between-mips-machine-identifiers.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-Ignore-differences-between-mips-machine-identifiers.patch
new file mode 100644
index 000000000..3f110f98f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-Ignore-differences-between-mips-machine-identifiers.patch
@@ -0,0 +1,34 @@
+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>
+---
+ backends/mips_init.c | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
+
+diff --git a/backends/mips_init.c b/backends/mips_init.c
+index 7429a89..d10e940 100644
+--- a/backends/mips_init.c
++++ b/backends/mips_init.c
+@@ -46,11 +46,7 @@ mips_init (elf, machine, eh, ehlen)
+ 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);
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-build-Provide-alternatives-for-glibc-assumptions-hel.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-build-Provide-alternatives-for-glibc-assumptions-hel.patch
new file mode 100644
index 000000000..c8d1c8990
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-build-Provide-alternatives-for-glibc-assumptions-hel.patch
@@ -0,0 +1,1163 @@
+From 4b0fe80b3951f044c1c1b14d1d7f5f0b8ab67507 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 31 Dec 2015 06:35:34 +0000
+Subject: [PATCH] build: Provide alternatives for glibc assumptions helps
+ compiling it on musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ Makefile.am | 2 +-
+ lib/color.c | 2 +-
+ lib/crc32_file.c | 4 +++-
+ lib/fixedsizehash.h | 4 ++--
+ lib/system.h | 11 +++++++++++
+ 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 | 2 +-
+ libdw/libdw_alloc.c | 3 ++-
+ libdwfl/Makefile.am | 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 | 10 ++++++++++
+ libdwfl/linux-kernel-modules.c | 1 +
+ libebl/eblopenbackend.c | 2 +-
+ libebl/eblwstrtab.c | 2 +-
+ libelf/elf.h | 9 ++++++---
+ 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/i386_ld.c | 2 +-
+ src/ld.c | 2 +-
+ src/ldgeneric.c | 2 +-
+ src/ldlex.c | 2 +-
+ src/ldscript.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 +-
+ 77 files changed, 109 insertions(+), 73 deletions(-)
+
+Index: elfutils-0.164/Makefile.am
+===================================================================
+--- elfutils-0.164.orig/Makefile.am
++++ elfutils-0.164/Makefile.am
+@@ -24,7 +24,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
+Index: elfutils-0.164/lib/color.c
+===================================================================
+--- elfutils-0.164.orig/lib/color.c
++++ elfutils-0.164/lib/color.c
+@@ -32,7 +32,7 @@
+ #endif
+
+ #include <argp.h>
+-#include <error.h>
++#include <err.h>
+ #include <libintl.h>
+ #include <stdlib.h>
+ #include <string.h>
+Index: elfutils-0.164/lib/crc32_file.c
+===================================================================
+--- elfutils-0.164.orig/lib/crc32_file.c
++++ elfutils-0.164/lib/crc32_file.c
+@@ -30,12 +30,14 @@
+ # include <config.h>
+ #endif
+
+-#include "system.h"
+ #include <errno.h>
+ #include <unistd.h>
++#include <stdint.h>
+ #include <sys/stat.h>
+ #include <sys/mman.h>
+
++#include "system.h"
++
+ int
+ crc32_file (int fd, uint32_t *resp)
+ {
+Index: elfutils-0.164/lib/fixedsizehash.h
+===================================================================
+--- elfutils-0.164.orig/lib/fixedsizehash.h
++++ elfutils-0.164/lib/fixedsizehash.h
+@@ -30,12 +30,12 @@
+ #include <errno.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <sys/cdefs.h>
+ #include <sys/param.h>
+
+ #include <system.h>
+
+-#define CONCAT(t1,t2) __CONCAT (t1,t2)
++#define CONCAT1(x,y) x##y
++#define CONCAT(x,y) CONCAT1(x,y)
+
+ /* Before including this file the following macros must be defined:
+
+Index: elfutils-0.164/lib/system.h
+===================================================================
+--- elfutils-0.164.orig/lib/system.h
++++ elfutils-0.164/lib/system.h
+@@ -49,6 +49,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__)
+
+ extern void *xmalloc (size_t) __attribute__ ((__malloc__));
+ extern void *xcalloc (size_t, size_t) __attribute__ ((__malloc__));
+Index: elfutils-0.164/lib/xmalloc.c
+===================================================================
+--- elfutils-0.164.orig/lib/xmalloc.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/libasm/asm_end.c
+===================================================================
+--- elfutils-0.164.orig/libasm/asm_end.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/libasm/asm_newscn.c
+===================================================================
+--- elfutils-0.164.orig/libasm/asm_newscn.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/libcpu/i386_gendis.c
+===================================================================
+--- elfutils-0.164.orig/libcpu/i386_gendis.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/libcpu/i386_lex.c
+===================================================================
+--- elfutils-0.164.orig/libcpu/i386_lex.c
++++ elfutils-0.164/libcpu/i386_lex.c
+@@ -571,7 +571,7 @@ char *i386_text;
+ #endif
+
+ #include <ctype.h>
+-#include <error.h>
++#include <err.h>
+ #include <libintl.h>
+
+ #include <system.h>
+Index: elfutils-0.164/libcpu/i386_parse.c
+===================================================================
+--- elfutils-0.164.orig/libcpu/i386_parse.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/libdw/Makefile.am
+===================================================================
+--- elfutils-0.164.orig/libdw/Makefile.am
++++ elfutils-0.164/libdw/Makefile.am
+@@ -117,7 +117,7 @@ libdw.so$(EXEEXT): $(srcdir)/libdw.map l
+ -Wl,--enable-new-dtags,-rpath,$(pkglibdir) \
+ -Wl,--version-script,$<,--no-undefined \
+ -Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\
+- -ldl $(argp_LDADD) $(zip_LIBS) $(libdw_so_LDLIBS)
++ -ldl $(argp_LDADD) $(zip_LIBS) $(libdw_so_LDLIBS) -lfts -largp
+ @$(textrel_check)
+ $(AM_V_at)ln -fs $@ $@.$(VERSION)
+
+Index: elfutils-0.164/libdw/libdw_alloc.c
+===================================================================
+--- elfutils-0.164.orig/libdw/libdw_alloc.c
++++ elfutils-0.164/libdw/libdw_alloc.c
+@@ -31,11 +31,12 @@
+ # include <config.h>
+ #endif
+
+-#include <error.h>
++#include <err.h>
+ #include <errno.h>
+ #include <stdlib.h>
+ #include <sys/param.h>
+ #include "libdwP.h"
++#include "system.h"
+
+
+ void *
+Index: elfutils-0.164/libdwfl/Makefile.am
+===================================================================
+--- elfutils-0.164.orig/libdwfl/Makefile.am
++++ elfutils-0.164/libdwfl/Makefile.am
+@@ -86,6 +86,8 @@ libelf = ../libelf/libelf.so
+ libebl = ../libebl/libebl.a
+ libeu = ../lib/libeu.a
+
++LDADD = -lfts
++
+ libdwfl_pic_a_SOURCES =
+ am_libdwfl_pic_a_OBJECTS = $(libdwfl_a_SOURCES:.c=.os)
+
+Index: elfutils-0.164/libdwfl/dwfl_build_id_find_elf.c
+===================================================================
+--- elfutils-0.164.orig/libdwfl/dwfl_build_id_find_elf.c
++++ elfutils-0.164/libdwfl/dwfl_build_id_find_elf.c
+@@ -27,6 +27,7 @@
+ not, see <http://www.gnu.org/licenses/>. */
+
+ #include "libdwflP.h"
++#include "system.h"
+ #include <inttypes.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+@@ -94,7 +95,7 @@ __libdwfl_open_by_build_id (Dwfl_Module
+ {
+ 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;
+Index: elfutils-0.164/libdwfl/dwfl_error.c
+===================================================================
+--- elfutils-0.164.orig/libdwfl/dwfl_error.c
++++ elfutils-0.164/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):
+Index: elfutils-0.164/libdwfl/dwfl_module_getdwarf.c
+===================================================================
+--- elfutils-0.164.orig/libdwfl/dwfl_module_getdwarf.c
++++ elfutils-0.164/libdwfl/dwfl_module_getdwarf.c
+@@ -31,6 +31,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"
+
+Index: elfutils-0.164/libdwfl/find-debuginfo.c
+===================================================================
+--- elfutils-0.164.orig/libdwfl/find-debuginfo.c
++++ elfutils-0.164/libdwfl/find-debuginfo.c
+@@ -372,7 +372,7 @@ dwfl_standard_find_debuginfo (Dwfl_Modul
+ /* 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,
+Index: elfutils-0.164/libdwfl/libdwfl_crc32_file.c
+===================================================================
+--- elfutils-0.164.orig/libdwfl/libdwfl_crc32_file.c
++++ elfutils-0.164/libdwfl/libdwfl_crc32_file.c
+@@ -31,6 +31,16 @@
+
+ #define crc32_file attribute_hidden __libdwfl_crc32_file
+ #define crc32 __libdwfl_crc32
++
++#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 LIB_SYSTEM_H 1
+ #include <libdwflP.h>
+ #include "../lib/crc32_file.c"
+Index: elfutils-0.164/libdwfl/linux-kernel-modules.c
+===================================================================
+--- elfutils-0.164.orig/libdwfl/linux-kernel-modules.c
++++ elfutils-0.164/libdwfl/linux-kernel-modules.c
+@@ -34,6 +34,7 @@
+ #include <config.h>
+
+ #include "libdwflP.h"
++#include "system.h"
+ #include <inttypes.h>
+ #include <errno.h>
+ #include <stdio.h>
+Index: elfutils-0.164/libebl/eblopenbackend.c
+===================================================================
+--- elfutils-0.164.orig/libebl/eblopenbackend.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/libebl/eblwstrtab.c
+===================================================================
+--- elfutils-0.164.orig/libebl/eblwstrtab.c
++++ elfutils-0.164/libebl/eblwstrtab.c
+@@ -305,7 +305,7 @@ copystrings (struct Ebl_WStrent *nodep,
+
+ /* Process the current node. */
+ nodep->offset = *offsetp;
+- *freep = wmempcpy (*freep, nodep->string, nodep->len);
++ *freep = wmemcpy (*freep, nodep->string, nodep->len) + nodep->len;
+ *offsetp += nodep->len * sizeof (wchar_t);
+
+ for (subs = nodep->next; subs != NULL; subs = subs->next)
+Index: elfutils-0.164/libelf/elf.h
+===================================================================
+--- elfutils-0.164.orig/libelf/elf.h
++++ elfutils-0.164/libelf/elf.h
+@@ -21,7 +21,9 @@
+
+ #include <features.h>
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /* Standard ELF types. */
+
+@@ -3552,7 +3554,8 @@ enum
+
+ #define R_TILEGX_NUM 130
+
+-
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* elf.h */
+Index: elfutils-0.164/libelf/libelf.h
+===================================================================
+--- elfutils-0.164.orig/libelf/libelf.h
++++ elfutils-0.164/libelf/libelf.h
+@@ -29,6 +29,7 @@
+ #ifndef _LIBELF_H
+ #define _LIBELF_H 1
+
++#include <fcntl.h>
+ #include <stdint.h>
+ #include <sys/types.h>
+
+Index: elfutils-0.164/libelf/libelfP.h
+===================================================================
+--- elfutils-0.164.orig/libelf/libelfP.h
++++ elfutils-0.164/libelf/libelfP.h
+@@ -36,6 +36,7 @@
+
+ #include <ar.h>
+ #include <gelf.h>
++#include <libelf.h>
+
+ #include <errno.h>
+ #include <stdint.h>
+Index: elfutils-0.164/src/addr2line.c
+===================================================================
+--- elfutils-0.164.orig/src/addr2line.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/src/ar.c
+===================================================================
+--- elfutils-0.164.orig/src/ar.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/src/arlib.c
+===================================================================
+--- elfutils-0.164.orig/src/arlib.c
++++ elfutils-0.164/src/arlib.c
+@@ -21,7 +21,7 @@
+ #endif
+
+ #include <assert.h>
+-#include <error.h>
++#include <err.h>
+ #include <gelf.h>
+ #include <libintl.h>
+ #include <stdio.h>
+Index: elfutils-0.164/src/arlib2.c
+===================================================================
+--- elfutils-0.164.orig/src/arlib2.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/src/elfcmp.c
+===================================================================
+--- elfutils-0.164.orig/src/elfcmp.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/src/elflint.c
+===================================================================
+--- elfutils-0.164.orig/src/elflint.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/src/findtextrel.c
+===================================================================
+--- elfutils-0.164.orig/src/findtextrel.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/src/i386_ld.c
+===================================================================
+--- elfutils-0.164.orig/src/i386_ld.c
++++ elfutils-0.164/src/i386_ld.c
+@@ -20,7 +20,7 @@
+ #endif
+
+ #include <assert.h>
+-#include <error.h>
++#include <err.h>
+ #include <libintl.h>
+ #include <stdlib.h>
+ #include <string.h>
+Index: elfutils-0.164/src/ld.c
+===================================================================
+--- elfutils-0.164.orig/src/ld.c
++++ elfutils-0.164/src/ld.c
+@@ -21,7 +21,7 @@
+
+ #include <argp.h>
+ #include <assert.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <libelf.h>
+ #include <libintl.h>
+Index: elfutils-0.164/src/ldgeneric.c
+===================================================================
+--- elfutils-0.164.orig/src/ldgeneric.c
++++ elfutils-0.164/src/ldgeneric.c
+@@ -23,7 +23,7 @@
+ #include <ctype.h>
+ #include <dlfcn.h>
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <fnmatch.h>
+ #include <gelf.h>
+Index: elfutils-0.164/src/ldlex.c
+===================================================================
+--- elfutils-0.164.orig/src/ldlex.c
++++ elfutils-0.164/src/ldlex.c
+@@ -1099,7 +1099,7 @@ char *ldtext;
+ #include <assert.h>
+ #include <ctype.h>
+ #include <elf.h>
+-#include <error.h>
++#include <err.h>
+ #include <inttypes.h>
+ #include <libintl.h>
+ #include <stdbool.h>
+Index: elfutils-0.164/src/ldscript.c
+===================================================================
+--- elfutils-0.164.orig/src/ldscript.c
++++ elfutils-0.164/src/ldscript.c
+@@ -95,7 +95,7 @@
+ #endif
+
+ #include <assert.h>
+-#include <error.h>
++#include <err.h>
+ #include <libintl.h>
+ #include <stdbool.h>
+ #include <stdint.h>
+Index: elfutils-0.164/src/nm.c
+===================================================================
+--- elfutils-0.164.orig/src/nm.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/src/objdump.c
+===================================================================
+--- elfutils-0.164.orig/src/objdump.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/src/ranlib.c
+===================================================================
+--- elfutils-0.164.orig/src/ranlib.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/src/readelf.c
+===================================================================
+--- elfutils-0.164.orig/src/readelf.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/src/size.c
+===================================================================
+--- elfutils-0.164.orig/src/size.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/src/stack.c
+===================================================================
+--- elfutils-0.164.orig/src/stack.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/src/strings.c
+===================================================================
+--- elfutils-0.164.orig/src/strings.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/src/strip.c
+===================================================================
+--- elfutils-0.164.orig/src/strip.c
++++ elfutils-0.164/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 <gelf.h>
+ #include <libelf.h>
+Index: elfutils-0.164/src/unstrip.c
+===================================================================
+--- elfutils-0.164.orig/src/unstrip.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/tests/addrscopes.c
+===================================================================
+--- elfutils-0.164.orig/tests/addrscopes.c
++++ elfutils-0.164/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>
+
+
+Index: elfutils-0.164/tests/allregs.c
+===================================================================
+--- elfutils-0.164.orig/tests/allregs.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/tests/backtrace-data.c
+===================================================================
+--- elfutils-0.164.orig/tests/backtrace-data.c
++++ elfutils-0.164/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__)
+Index: elfutils-0.164/tests/backtrace-dwarf.c
+===================================================================
+--- elfutils-0.164.orig/tests/backtrace-dwarf.c
++++ elfutils-0.164/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/ptrace.h>
+ #include <sys/types.h>
+Index: elfutils-0.164/tests/backtrace.c
+===================================================================
+--- elfutils-0.164.orig/tests/backtrace.c
++++ elfutils-0.164/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__
+Index: elfutils-0.164/tests/buildid.c
+===================================================================
+--- elfutils-0.164.orig/tests/buildid.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/tests/debugaltlink.c
+===================================================================
+--- elfutils-0.164.orig/tests/debugaltlink.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/tests/debuglink.c
+===================================================================
+--- elfutils-0.164.orig/tests/debuglink.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/tests/deleted.c
+===================================================================
+--- elfutils-0.164.orig/tests/deleted.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/tests/dwfl-addr-sect.c
+===================================================================
+--- elfutils-0.164.orig/tests/dwfl-addr-sect.c
++++ elfutils-0.164/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)
+Index: elfutils-0.164/tests/dwfl-bug-addr-overflow.c
+===================================================================
+--- elfutils-0.164.orig/tests/dwfl-bug-addr-overflow.c
++++ elfutils-0.164/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)
+
+Index: elfutils-0.164/tests/dwfl-bug-fd-leak.c
+===================================================================
+--- elfutils-0.164.orig/tests/dwfl-bug-fd-leak.c
++++ elfutils-0.164/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>
+ #include <sys/resource.h>
+Index: elfutils-0.164/tests/dwfl-bug-getmodules.c
+===================================================================
+--- elfutils-0.164.orig/tests/dwfl-bug-getmodules.c
++++ elfutils-0.164/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 =
+ {
+Index: elfutils-0.164/tests/dwfl-report-elf-align.c
+===================================================================
+--- elfutils-0.164.orig/tests/dwfl-report-elf-align.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/tests/dwfllines.c
+===================================================================
+--- elfutils-0.164.orig/tests/dwfllines.c
++++ elfutils-0.164/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[])
+Index: elfutils-0.164/tests/dwflmodtest.c
+===================================================================
+--- elfutils-0.164.orig/tests/dwflmodtest.c
++++ elfutils-0.164/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)
+Index: elfutils-0.164/tests/dwflsyms.c
+===================================================================
+--- elfutils-0.164.orig/tests/dwflsyms.c
++++ elfutils-0.164/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 *
+Index: elfutils-0.164/tests/early-offscn.c
+===================================================================
+--- elfutils-0.164.orig/tests/early-offscn.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/tests/ecp.c
+===================================================================
+--- elfutils-0.164.orig/tests/ecp.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/tests/find-prologues.c
+===================================================================
+--- elfutils-0.164.orig/tests/find-prologues.c
++++ elfutils-0.164/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>
+
+Index: elfutils-0.164/tests/funcretval.c
+===================================================================
+--- elfutils-0.164.orig/tests/funcretval.c
++++ elfutils-0.164/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>
+
+Index: elfutils-0.164/tests/funcscopes.c
+===================================================================
+--- elfutils-0.164.orig/tests/funcscopes.c
++++ elfutils-0.164/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>
+
+Index: elfutils-0.164/tests/getsrc_die.c
+===================================================================
+--- elfutils-0.164.orig/tests/getsrc_die.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/tests/line2addr.c
+===================================================================
+--- elfutils-0.164.orig/tests/line2addr.c
++++ elfutils-0.164/tests/line2addr.c
+@@ -26,7 +26,7 @@
+ #include <locale.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <error.h>
++#include <err.h>
+
+
+ static void
+Index: elfutils-0.164/tests/low_high_pc.c
+===================================================================
+--- elfutils-0.164.orig/tests/low_high_pc.c
++++ elfutils-0.164/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>
+
+Index: elfutils-0.164/tests/md5-sha1-test.c
+===================================================================
+--- elfutils-0.164.orig/tests/md5-sha1-test.c
++++ elfutils-0.164/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"
+Index: elfutils-0.164/tests/rdwrmmap.c
+===================================================================
+--- elfutils-0.164.orig/tests/rdwrmmap.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/tests/saridx.c
+===================================================================
+--- elfutils-0.164.orig/tests/saridx.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/tests/sectiondump.c
+===================================================================
+--- elfutils-0.164.orig/tests/sectiondump.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/tests/varlocs.c
+===================================================================
+--- elfutils-0.164.orig/tests/varlocs.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/tests/vdsosyms.c
+===================================================================
+--- elfutils-0.164.orig/tests/vdsosyms.c
++++ elfutils-0.164/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>
+Index: elfutils-0.164/libelf/elf_getarsym.c
+===================================================================
+--- elfutils-0.164.orig/libelf/elf_getarsym.c
++++ elfutils-0.164/libelf/elf_getarsym.c
+@@ -302,7 +302,7 @@ elf_getarsym (Elf *elf, size_t *ptr)
+ arsym[cnt].as_off = (*u32)[cnt];
+
+ arsym[cnt].as_hash = _dl_elf_hash (str_data);
+- str_data = rawmemchr (str_data, '\0') + 1;
++ str_data = memchr (str_data, '\0', SIZE_MAX) + 1;
+ }
+
+ /* At the end a special entry. */
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch
new file mode 100644
index 000000000..3754c1c36
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch
@@ -0,0 +1,35 @@
+From 668accf322fd7185e273bfd50b84320e71d9de5a Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Fri, 10 Apr 2015 00:29:18 +0200
+Subject: [PATCH] elf_getarsym: Silence -Werror=maybe-uninitialized false
+ positive
+
+Upstream-Status: Pending
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ libelf/elf_getarsym.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/libelf/elf_getarsym.c b/libelf/elf_getarsym.c
+index d0bb28a..08954d2 100644
+--- a/libelf/elf_getarsym.c
++++ b/libelf/elf_getarsym.c
+@@ -165,8 +165,13 @@ elf_getarsym (elf, ptr)
+ int w = index64_p ? 8 : 4;
+
+ /* We have an archive. The first word in there is the number of
+- entries in the table. */
+- uint64_t n;
++ entries in the table.
++ Set to SIZE_MAX just to silence -Werror=maybe-uninitialized
++ elf_getarsym.c:290:9: error: 'n' may be used uninitialized in this function
++ The read_number_entries function doesn't initialize n only when returning
++ -1 which in turn ensures to jump over usage of this uninitialized variable.
++ */
++ uint64_t n = SIZE_MAX;
+ size_t off = elf->start_offset + SARMAG + sizeof (struct ar_hdr);
+ if (read_number_entries (&n, elf, &off, index64_p) < 0)
+ {
+--
+2.3.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-fix-a-stack-usage-warning.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-fix-a-stack-usage-warning.patch
new file mode 100644
index 000000000..6923bf705
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-fix-a-stack-usage-warning.patch
@@ -0,0 +1,28 @@
+[PATCH] 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>
+---
+ 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 64f5379..52dde3e 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.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-remove-the-unneed-checking.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-remove-the-unneed-checking.patch
new file mode 100644
index 000000000..5be92d705
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-remove-the-unneed-checking.patch
@@ -0,0 +1,38 @@
+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>
+---
+ 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],
+--
+2.0.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch
new file mode 100644
index 000000000..72125c9ff
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch
@@ -0,0 +1,168 @@
+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>
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0003-Add-mips-n64-relocation-format-hack.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0003-Add-mips-n64-relocation-format-hack.patch
new file mode 100644
index 000000000..14b7985ce
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0003-Add-mips-n64-relocation-format-hack.patch
@@ -0,0 +1,226 @@
+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>
+---
+ 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: elfutils-0.164/libelf/gelf_getrel.c
+===================================================================
+--- elfutils-0.164.orig/libelf/gelf_getrel.c
++++ elfutils-0.164/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: elfutils-0.164/libelf/gelf_getrela.c
+===================================================================
+--- elfutils-0.164.orig/libelf/gelf_getrela.c
++++ elfutils-0.164/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: elfutils-0.164/libelf/gelf_update_rel.c
+===================================================================
+--- elfutils-0.164.orig/libelf/gelf_update_rel.c
++++ elfutils-0.164/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: elfutils-0.164/libelf/gelf_update_rela.c
+===================================================================
+--- elfutils-0.164.orig/libelf/gelf_update_rela.c
++++ elfutils-0.164/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: elfutils-0.164/src/strip.c
+===================================================================
+--- elfutils-0.164.orig/src/strip.c
++++ elfutils-0.164/src/strip.c
+@@ -546,6 +546,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/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/aarch64_uio.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/aarch64_uio.patch
new file mode 100644
index 000000000..38dc57bef
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/aarch64_uio.patch
@@ -0,0 +1,47 @@
+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>
+Index: elfutils-0.163/backends/aarch64_initreg.c
+===================================================================
+--- elfutils-0.163.orig/backends/aarch64_initreg.c
++++ elfutils-0.163/backends/aarch64_initreg.c
+@@ -33,7 +33,7 @@
+ #include "system.h"
+ #include <assert.h>
+ #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. */
+@@ -82,7 +82,7 @@ aarch64_set_initial_registers_tid (pid_t
+
+ 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;
+Index: elfutils-0.163/backends/arm_initreg.c
+===================================================================
+--- elfutils-0.163.orig/backends/arm_initreg.c
++++ elfutils-0.163/backends/arm_initreg.c
+@@ -37,7 +37,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. */
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/arm_backend.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/arm_backend.diff
new file mode 100644
index 000000000..9d47f95f2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/arm_backend.diff
@@ -0,0 +1,600 @@
+Index: elfutils-0.164/backends/arm_init.c
+===================================================================
+--- elfutils-0.164.orig/backends/arm_init.c
++++ elfutils-0.164/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: elfutils-0.164/backends/arm_regs.c
+===================================================================
+--- elfutils-0.164.orig/backends/arm_regs.c
++++ elfutils-0.164/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: elfutils-0.164/backends/arm_retval.c
+===================================================================
+--- elfutils-0.164.orig/backends/arm_retval.c
++++ elfutils-0.164/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: elfutils-0.164/libelf/elf.h
+===================================================================
+--- elfutils-0.164.orig/libelf/elf.h
++++ elfutils-0.164/libelf/elf.h
+@@ -2450,6 +2450,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. */
+@@ -2467,12 +2470,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. */
+
+@@ -2765,6 +2775,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: elfutils-0.164/backends/libebl_arm.h
+===================================================================
+--- /dev/null
++++ elfutils-0.164/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: elfutils-0.164/tests/run-allregs.sh
+===================================================================
+--- elfutils-0.164.orig/tests/run-allregs.sh
++++ elfutils-0.164/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: elfutils-0.164/tests/run-readelf-mixed-corenote.sh
+===================================================================
+--- elfutils-0.164.orig/tests/run-readelf-mixed-corenote.sh
++++ elfutils-0.164/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: elfutils-0.164/tests/run-addrcfi.sh
+===================================================================
+--- elfutils-0.164.orig/tests/run-addrcfi.sh
++++ elfutils-0.164/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/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/fixheadercheck.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/fixheadercheck.patch
new file mode 100644
index 000000000..5de3b24c8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/fixheadercheck.patch
@@ -0,0 +1,23 @@
+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
+
+diff --git a/libelf/elf32_updatenull.c b/libelf/elf32_updatenull.c
+--- 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;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/hppa_backend.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/hppa_backend.diff
new file mode 100644
index 000000000..45456715a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/hppa_backend.diff
@@ -0,0 +1,799 @@
+Index: elfutils-0.164/backends/parisc_init.c
+===================================================================
+--- /dev/null
++++ elfutils-0.164/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.164/backends/parisc_regs.c
+===================================================================
+--- /dev/null
++++ elfutils-0.164/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.164/backends/parisc_reloc.def
+===================================================================
+--- /dev/null
++++ elfutils-0.164/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.164/backends/parisc_retval.c
+===================================================================
+--- /dev/null
++++ elfutils-0.164/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.164/backends/parisc_symbol.c
+===================================================================
+--- /dev/null
++++ elfutils-0.164/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.164/backends/libebl_parisc.h
+===================================================================
+--- /dev/null
++++ elfutils-0.164/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.164/backends/Makefile.am
+===================================================================
+--- elfutils-0.164.orig/backends/Makefile.am
++++ elfutils-0.164/backends/Makefile.am
+@@ -33,11 +33,12 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I
+
+
+ modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
+- tilegx
++ tilegx 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_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a \
++ libebl_parisc_pic.a
+ noinst_LIBRARIES = $(libebl_pic)
+ noinst_DATA = $(libebl_pic:_pic.a=.so)
+
+@@ -111,6 +112,9 @@ tilegx_SRCS = tilegx_init.c tilegx_symbo
+ libebl_tilegx_pic_a_SOURCES = $(tilegx_SRCS)
+ am_libebl_tilegx_pic_a_OBJECTS = $(tilegx_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)
+ @rm -f $(@:.so=.map)
+Index: elfutils-0.164/libelf/elf.h
+===================================================================
+--- elfutils-0.164.orig/libelf/elf.h
++++ elfutils-0.164/libelf/elf.h
+@@ -1912,16 +1912,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. */
+@@ -1930,6 +1938,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. */
+@@ -1955,6 +1964,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/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/kfreebsd_path.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/kfreebsd_path.patch
new file mode 100644
index 000000000..ba454ee77
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/kfreebsd_path.patch
@@ -0,0 +1,15 @@
+--- elfutils/tests/run-native-test.sh.orig
++++ elfutils/tests/run-native-test.sh
+@@ -78,6 +78,12 @@
+ test $native -eq 0 || testrun "$@" -p $native > /dev/null
+ }
+
++# On the Debian buildds, GNU/kFreeBSD linprocfs /proc/$PID/maps does
++# not give absolute paths due to sbuild's bind mounts (bug #570805)
++# therefore the next two test programs are expected to fail with
++# "cannot attach to process: Function not implemented".
++[ "$(uname)" = "GNU/kFreeBSD" ] && exit 77
++
+ native_test ${abs_builddir}/allregs
+ native_test ${abs_builddir}/funcretval
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/m68k_backend.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/m68k_backend.diff
new file mode 100644
index 000000000..d73855b60
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/m68k_backend.diff
@@ -0,0 +1,492 @@
+From: Kurt Roeckx <kurt@roeckx.be>
+From: Thorsten Glaser <tg@mirbsd.de>
+Subject: m68k support
+
+Written by Kurt Roeckx, except for the retval support which was written
+by Thorsten Glaser
+
+
+Index: elfutils-0.164/backends/m68k_init.c
+===================================================================
+--- /dev/null
++++ elfutils-0.164/backends/m68k_init.c
+@@ -0,0 +1,49 @@
++/* Initialization of m68k specific backend library.
++ Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
++
++ This software 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 softare is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++
++ You should have received a copy of the GNU General Public License along
++ with this software; if not, write to the Free Software Foundation,
++ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++*/
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#define BACKEND m68k_
++#define RELOC_PREFIX R_68K_
++#include "libebl_CPU.h"
++
++/* This defines the common reloc hooks based on m68k_reloc.def. */
++#include "common-reloc.c"
++
++
++const char *
++m68k_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. */
++ eh->name = "m68k";
++ m68k_init_reloc (eh);
++ HOOK (eh, reloc_simple_type);
++ HOOK (eh, return_value_location);
++ HOOK (eh, register_info);
++
++ return MODVERSION;
++}
+Index: elfutils-0.164/backends/m68k_regs.c
+===================================================================
+--- /dev/null
++++ elfutils-0.164/backends/m68k_regs.c
+@@ -0,0 +1,106 @@
++/* Register names and numbers for m68k DWARF.
++ Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
++
++ This software 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 software is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++
++ You should have received a copy of the GNU General Public License along
++ with this software; if not, write to the Free Software Foundation,
++ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++ */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <string.h>
++#include <dwarf.h>
++
++#define BACKEND m68k_
++#include "libebl_CPU.h"
++
++ssize_t
++m68k_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 25;
++
++ if (regno < 0 || regno > 24 || namelen < 5)
++ return -1;
++
++ *prefix = "%";
++ *bits = 32;
++ *type = (regno < 8 ? DW_ATE_signed
++ : regno < 16 ? DW_ATE_address : DW_ATE_float);
++
++ if (regno < 8)
++ {
++ *setname = "integer";
++ }
++ else if (regno < 16)
++ {
++ *setname = "address";
++ }
++ else if (regno < 24)
++ {
++ *setname = "FPU";
++ }
++ else
++ {
++ *setname = "address";
++ *type = DW_ATE_address;
++ }
++
++ switch (regno)
++ {
++ case 0 ... 7:
++ name[0] = 'd';
++ name[1] = regno + '0';
++ namelen = 2;
++ break;
++
++ case 8 ... 13:
++ name[0] = 'a';
++ name[1] = regno - 8 + '0';
++ namelen = 2;
++ break;
++
++ case 14:
++ name[0] = 'f';
++ name[1] = 'p';
++ namelen = 2;
++ break;
++
++ case 15:
++ name[0] = 's';
++ name[1] = 'p';
++ namelen = 2;
++ break;
++
++ case 16 ... 23:
++ name[0] = 'f';
++ name[1] = 'p';
++ name[2] = regno - 16 + '0';
++ namelen = 3;
++ break;
++
++ case 24:
++ name[0] = 'p';
++ name[1] = 'c';
++ namelen = 2;
++ }
++
++ name[namelen++] = '\0';
++ return namelen;
++}
++
+Index: elfutils-0.164/backends/m68k_reloc.def
+===================================================================
+--- /dev/null
++++ elfutils-0.164/backends/m68k_reloc.def
+@@ -0,0 +1,45 @@
++/* List the relocation types for m68k. -*- C -*-
++ Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
++
++ This software 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 software is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++
++ You should have received a copy of the GNU General Public License along
++ with this software; if not, write to the Free Software Foundation,
++ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++*/
++
++/* NAME, REL|EXEC|DYN */
++
++RELOC_TYPE (NONE, 0)
++RELOC_TYPE (32, REL|EXEC|DYN)
++RELOC_TYPE (16, REL)
++RELOC_TYPE (8, REL)
++RELOC_TYPE (PC32, REL|EXEC|DYN)
++RELOC_TYPE (PC16, REL)
++RELOC_TYPE (PC8, REL)
++RELOC_TYPE (GOT32, REL)
++RELOC_TYPE (GOT16, REL)
++RELOC_TYPE (GOT8, REL)
++RELOC_TYPE (GOT32O, REL)
++RELOC_TYPE (GOT16O, REL)
++RELOC_TYPE (GOT8O, REL)
++RELOC_TYPE (PLT32, REL)
++RELOC_TYPE (PLT16, REL)
++RELOC_TYPE (PLT8, REL)
++RELOC_TYPE (PLT32O, REL)
++RELOC_TYPE (PLT16O, REL)
++RELOC_TYPE (PLT8O, REL)
++RELOC_TYPE (COPY, EXEC)
++RELOC_TYPE (GLOB_DAT, EXEC|DYN)
++RELOC_TYPE (JMP_SLOT, EXEC|DYN)
++RELOC_TYPE (RELATIVE, EXEC|DYN)
++RELOC_TYPE (GNU_VTINHERIT, REL)
++RELOC_TYPE (GNU_VTENTRY, REL)
++
+Index: elfutils-0.164/libelf/elf.h
+===================================================================
+--- elfutils-0.164.orig/libelf/elf.h
++++ elfutils-0.164/libelf/elf.h
+@@ -1158,6 +1158,9 @@ typedef struct
+ #define R_68K_GLOB_DAT 20 /* Create GOT entry */
+ #define R_68K_JMP_SLOT 21 /* Create PLT entry */
+ #define R_68K_RELATIVE 22 /* Adjust by program base */
++/* The next 2 are GNU extensions to enable C++ vtable garbage collection. */
++#define R_68K_GNU_VTINHERIT 23
++#define R_68K_GNU_VTENTRY 24
+ #define R_68K_TLS_GD32 25 /* 32 bit GOT offset for GD */
+ #define R_68K_TLS_GD16 26 /* 16 bit GOT offset for GD */
+ #define R_68K_TLS_GD8 27 /* 8 bit GOT offset for GD */
+Index: elfutils-0.164/backends/Makefile.am
+===================================================================
+--- elfutils-0.164.orig/backends/Makefile.am
++++ elfutils-0.164/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 parisc mips
++ tilegx parisc mips m68k
+ 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_parisc_pic.a libebl_mips_pic.a
++ libebl_parisc_pic.a libebl_mips_pic.a libebl_m68k_pic.a
+ noinst_LIBRARIES = $(libebl_pic)
+ noinst_DATA = $(libebl_pic:_pic.a=.so)
+
+@@ -120,6 +120,10 @@ mips_SRCS = mips_init.c mips_symbol.c mi
+ libebl_mips_pic_a_SOURCES = $(mips_SRCS)
+ am_libebl_mips_pic_a_OBJECTS = $(mips_SRCS:.c=.os)
+
++m68k_SRCS = m68k_init.c m68k_symbol.c m68k_regs.c m68k_retval.c
++libebl_m68k_pic_a_SOURCES = $(m68k_SRCS)
++am_libebl_m68k_pic_a_OBJECTS = $(m68k_SRCS:.c=.os)
++
+ libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw)
+ @rm -f $(@:.so=.map)
+ $(AM_V_at)echo 'ELFUTILS_$(PACKAGE_VERSION) { global: $*_init; local: *; };' \
+Index: elfutils-0.164/backends/m68k_symbol.c
+===================================================================
+--- /dev/null
++++ elfutils-0.164/backends/m68k_symbol.c
+@@ -0,0 +1,43 @@
++/* m68k specific symbolic name handling.
++ Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
++
++ This software 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 software distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++
++ You should have received a copy of the GNU General Public License along
++ with this software; if not, write to the Free Software Foundation,
++ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++*/
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <elf.h>
++#include <stddef.h>
++
++#define BACKEND m68k_
++#include "libebl_CPU.h"
++
++/* Check for the simple reloc types. */
++Elf_Type
++m68k_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
++{
++ switch (type)
++ {
++ case R_68K_32:
++ return ELF_T_SWORD;
++ case R_68K_16:
++ return ELF_T_HALF;
++ case R_68K_8:
++ return ELF_T_BYTE;
++ default:
++ return ELF_T_NUM;
++ }
++}
+Index: elfutils-0.164/backends/m68k_retval.c
+===================================================================
+--- /dev/null
++++ elfutils-0.164/backends/m68k_retval.c
+@@ -0,0 +1,172 @@
++/* Function return value location for Linux/m68k ABI.
++ Copyright (C) 2005-2010 Red Hat, Inc.
++ Copyright (c) 2011 Thorsten Glaser, Debian.
++ 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 m68k_
++#include "libebl_CPU.h"
++
++
++/* %d0, or pair %d0, %d1, or %a0 */
++static const Dwarf_Op loc_intreg[] =
++ {
++ { .atom = DW_OP_reg0 }, { .atom = DW_OP_piece, .number = 4 },
++ { .atom = DW_OP_reg1 }, { .atom = DW_OP_piece, .number = 4 },
++ };
++static const Dwarf_Op loc_ptrreg[] =
++ {
++ { .atom = DW_OP_reg8 },
++ };
++#define nloc_intreg 1
++#define nloc_intregpair 4
++#define nloc_ptrreg 1
++
++/* %f0 */
++static const Dwarf_Op loc_fpreg[] =
++ {
++ { .atom = DW_OP_reg16 }
++ };
++#define nloc_fpreg 1
++
++/* Structures are a bit more complicated - small structures are returned
++ in %d0 / %d1 (-freg-struct-return which is enabled by default), large
++ structures use %a1 (in constrast to the SYSV psABI which says %a0) as
++ reentrant storage space indicator. */
++static const Dwarf_Op loc_aggregate[] =
++ {
++ { .atom = DW_OP_breg9, .number = 0 }
++ };
++#define nloc_aggregate 1
++
++int
++m68k_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
++{
++ Dwarf_Word size;
++
++ /* 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:
++ 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_pointer_type || tag == DW_TAG_ptr_to_member_type)
++ {
++ *locp = loc_ptrreg;
++ return nloc_ptrreg;
++ }
++ 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)
++ {
++ /* XXX really 10? */
++ if (size > 10)
++ return -2;
++ *locp = loc_fpreg;
++ return nloc_fpreg;
++ }
++ }
++ if (size <= 8)
++ {
++ intreg:
++ /* XXX check endianness of dword pair, int64 vs aggregate */
++ *locp = loc_intreg;
++ return size <= 4 ? nloc_intreg : nloc_intregpair;
++ }
++
++ aggregate:
++ *locp = loc_aggregate;
++ return nloc_aggregate;
++
++ case DW_TAG_structure_type:
++ case DW_TAG_class_type:
++ case DW_TAG_union_type:
++ case DW_TAG_array_type:
++ if (dwarf_aggregate_size (typedie, &size) == 0
++ && size > 0 && size <= 8)
++ /* not accurate for a struct whose only member is a float */
++ goto intreg;
++ goto 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/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/mips_backend.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/mips_backend.diff
new file mode 100644
index 000000000..de1237be0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/mips_backend.diff
@@ -0,0 +1,711 @@
+Index: elfutils-0.164/backends/mips_init.c
+===================================================================
+--- /dev/null
++++ elfutils-0.164/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;
++}
+Index: elfutils-0.164/backends/mips_regs.c
+===================================================================
+--- /dev/null
++++ elfutils-0.164/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;
++}
+Index: elfutils-0.164/backends/mips_reloc.def
+===================================================================
+--- /dev/null
++++ elfutils-0.164/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
+Index: elfutils-0.164/backends/mips_retval.c
+===================================================================
+--- /dev/null
++++ elfutils-0.164/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;
++}
+Index: elfutils-0.164/backends/mips_symbol.c
+===================================================================
+--- /dev/null
++++ elfutils-0.164/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;
++ }
++}
+Index: elfutils-0.164/libebl/eblopenbackend.c
+===================================================================
+--- elfutils-0.164.orig/libebl/eblopenbackend.c
++++ elfutils-0.164/libebl/eblopenbackend.c
+@@ -71,6 +71,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, 0, 0 },
+Index: elfutils-0.164/backends/common-reloc.c
+===================================================================
+--- elfutils-0.164.orig/backends/common-reloc.c
++++ elfutils-0.164/backends/common-reloc.c
+@@ -125,11 +125,13 @@ EBLHOOK(reloc_valid_use) (Elf *elf, int
+ }
+
+
++#ifndef NO_COPY_RELOC
+ bool
+ EBLHOOK(copy_reloc_p) (int reloc)
+ {
+ return reloc == R_TYPE (COPY);
+ }
++#endif
+
+ bool
+ EBLHOOK(none_reloc_p) (int reloc)
+@@ -151,7 +153,9 @@ EBLHOOK(init_reloc) (Ebl *ebl)
+ ebl->reloc_type_name = EBLHOOK(reloc_type_name);
+ ebl->reloc_type_check = EBLHOOK(reloc_type_check);
+ ebl->reloc_valid_use = EBLHOOK(reloc_valid_use);
++#ifndef NO_COPY_RELOC
+ ebl->copy_reloc_p = EBLHOOK(copy_reloc_p);
++#endif
+ ebl->none_reloc_p = EBLHOOK(none_reloc_p);
+ #ifndef NO_RELATIVE_RELOC
+ ebl->relative_reloc_p = EBLHOOK(relative_reloc_p);
+Index: elfutils-0.164/backends/Makefile.am
+===================================================================
+--- elfutils-0.164.orig/backends/Makefile.am
++++ elfutils-0.164/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 parisc
++ tilegx 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_parisc_pic.a
++ libebl_parisc_pic.a libebl_mips_pic.a
+ noinst_LIBRARIES = $(libebl_pic)
+ noinst_DATA = $(libebl_pic:_pic.a=.so)
+
+@@ -116,6 +116,10 @@ parisc_SRCS = parisc_init.c parisc_symbo
+ 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)
+ @rm -f $(@:.so=.map)
+ $(AM_V_at)echo 'ELFUTILS_$(PACKAGE_VERSION) { global: $*_init; local: *; };' \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/mips_readelf_w.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/mips_readelf_w.patch
new file mode 100644
index 000000000..930d6f664
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/mips_readelf_w.patch
@@ -0,0 +1,22 @@
+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.
+
+Index: elfutils-0.164/src/readelf.c
+===================================================================
+--- elfutils-0.164.orig/src/readelf.c
++++ elfutils-0.164/src/readelf.c
+@@ -8218,7 +8218,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/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/shadow.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/shadow.patch
new file mode 100644
index 000000000..d31961f94
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/shadow.patch
@@ -0,0 +1,23 @@
+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
+Index: elfutils-0.164/libcpu/i386_disasm.c
+===================================================================
+--- elfutils-0.164.orig/libcpu/i386_disasm.c
++++ elfutils-0.164/libcpu/i386_disasm.c
+@@ -821,6 +821,7 @@ i386_disasm (const uint8_t **startp, con
+ }
+
+ default:
++ str = "";
+ assert (! "INVALID not handled");
+ }
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/testsuite-ignore-elflint.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/testsuite-ignore-elflint.diff
new file mode 100644
index 000000000..eae5796de
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/testsuite-ignore-elflint.diff
@@ -0,0 +1,39 @@
+On many architectures this test fails because binaries/libs produced by
+binutils don't pass elflint. However elfutils shouldn't FTBFS because of this.
+
+So we run the tests on all archs to see what breaks, but if it breaks we ignore
+the result (exitcode 77 means: this test was skipped).
+
+Index: elfutils-0.156/tests/run-elflint-self.sh
+===================================================================
+--- elfutils-0.156.orig/tests/run-elflint-self.sh 2013-07-28 14:35:36.000000000 +0200
++++ elfutils-0.156/tests/run-elflint-self.sh 2013-07-28 14:36:10.000000000 +0200
+@@ -18,4 +18,4 @@
+
+ . $srcdir/test-subr.sh
+
+-testrun_on_self ${abs_top_builddir}/src/elflint --quiet --gnu-ld
++testrun_on_self_skip ${abs_top_builddir}/src/elflint --quiet --gnu-ld
+Index: elfutils-0.156/tests/test-subr.sh
+===================================================================
+--- elfutils-0.156.orig/tests/test-subr.sh 2013-07-28 14:35:36.000000000 +0200
++++ elfutils-0.156/tests/test-subr.sh 2013-07-28 14:35:36.000000000 +0200
+@@ -149,3 +149,18 @@
+ # Only exit if something failed
+ if test $exit_status != 0; then exit $exit_status; fi
+ }
++
++# Same as testrun_on_self(), but skip on failure.
++testrun_on_self_skip()
++{
++ exit_status=0
++
++ for file in $self_test_files; do
++ testrun $* $file \
++ || { echo "*** failure in $* $file"; exit_status=77; }
++ done
++
++ # Only exit if something failed
++ if test $exit_status != 0; then exit $exit_status; fi
++}
++
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/uclibc-support.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/uclibc-support.patch
new file mode 100644
index 000000000..966b70fcc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/uclibc-support.patch
@@ -0,0 +1,129 @@
+From 3daec2dd11a04955f95e8f65a48820103d84dbec Mon Sep 17 00:00:00 2001
+From: Junling Zheng <zhengjunling@huawei.com>
+Date: Thu, 9 Apr 2015 12:12:49 +0000
+Subject: [PATCH] uclibc support for elfutils 0.161
+
+on uclibc systems libintl and libuargp are separate from libc.
+so they need to be specified on commandline when we use proxy-libintl
+then libintl is a static archive so it should be listed last since
+elfutils does not respect disable-nls we need to link in libintl
+
+We add a new option --enable-uclibc which will be used to control
+the uclibc specific configurations during build.
+
+Upstream-Status: Inappropriate [uclibc specific]
+
+Signed-off-by: Khem Raj <raj.khem>
+Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
+[Junling Zheng:
+ - adjust context
+]
+---
+ configure.ac | 8 ++++++++
+ libcpu/Makefile.am | 4 ++++
+ libdw/Makefile.am | 7 ++++++-
+ libelf/Makefile.am | 5 +++++
+ 4 files changed, 23 insertions(+), 1 deletion(-)
+
+Index: elfutils-0.164/configure.ac
+===================================================================
+--- elfutils-0.164.orig/configure.ac
++++ elfutils-0.164/configure.ac
+@@ -66,6 +66,14 @@ AS_IF([test "$use_locks" = yes],
+
+ AH_TEMPLATE([USE_LOCKS], [Defined if libraries should be thread-safe.])
+
++AC_ARG_ENABLE([uclibc],
++AS_HELP_STRING([--enable-uclibc], [Use uclibc for system libraries]),
++use_uclibc=yes, use_uclibc=no)
++AM_CONDITIONAL(USE_UCLIBC, test "$use_uclibc" = yes)
++AS_IF([test "$use_uclibc" = yes], [AC_DEFINE(USE_UCLIBC)])
++
++AH_TEMPLATE([USE_UCLIBC], [Defined if uclibc libraries are used.])
++
+ AC_PROG_CC
+ AC_PROG_RANLIB
+ AC_PROG_YACC
+@@ -291,18 +299,13 @@ AC_LINK_IFELSE(
+ )
+
+ dnl If our 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
+- argp_LDADD="-largp"
+- fi
+-else
+- argp_LDADD=""
+-fi
++AS_IF([test "x$libc_has_argp" = "xfalse"],
++ [AC_MSG_WARN("libc does not have argp")
++ AC_CHECK_LIB([argp], [argp_parse], [have_argp="true" argp_LDADD="-largp"], [have_argp="false"])], [argp_LDADD=""])
++
++AS_IF([test "x$libc_has_argp" = "xfalse" -a "x$have_argp" = "xfalse"],
++ AC_CHECK_LIB([uargp], [argp_parse], [have_uargp="true" argp_LDADD="-luargp"], [have_uargp="false"])], [argp_LDADD=""])
++
+ AC_SUBST([argp_LDADD])
+
+ dnl The directories with content.
+Index: elfutils-0.164/libcpu/Makefile.am
+===================================================================
+--- elfutils-0.164.orig/libcpu/Makefile.am
++++ elfutils-0.164/libcpu/Makefile.am
+@@ -80,6 +80,10 @@ i386_parse_CFLAGS = -DNMNES="`wc -l < i3
+ i386_lex.o: i386_parse.h
+ i386_gendis_LDADD = $(libeu) -lm
+
++if USE_UCLIBC
++i386_gendis_LDADD += -lintl
++endif
++
+ i386_parse.h: i386_parse.c ;
+
+ EXTRA_DIST = defs/i386
+Index: elfutils-0.164/libdw/Makefile.am
+===================================================================
+--- elfutils-0.164.orig/libdw/Makefile.am
++++ elfutils-0.164/libdw/Makefile.am
+@@ -102,6 +102,11 @@ endif
+ libdw_pic_a_SOURCES =
+ am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os)
+
++libdw_so_LDLIBS =
++if USE_UCLIBC
++libdw_so_LDLIBS += -lintl
++endif
++
+ libdw_so_SOURCES =
+ libdw.so$(EXEEXT): $(srcdir)/libdw.map libdw_pic.a ../libdwelf/libdwelf_pic.a \
+ ../libdwfl/libdwfl_pic.a ../libebl/libebl.a \
+@@ -112,7 +117,7 @@ libdw.so$(EXEEXT): $(srcdir)/libdw.map l
+ -Wl,--enable-new-dtags,-rpath,$(pkglibdir) \
+ -Wl,--version-script,$<,--no-undefined \
+ -Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\
+- -ldl $(argp_LDADD) $(zip_LIBS)
++ -ldl $(argp_LDADD) $(zip_LIBS) $(libdw_so_LDLIBS)
+ @$(textrel_check)
+ $(AM_V_at)ln -fs $@ $@.$(VERSION)
+
+Index: elfutils-0.164/libelf/Makefile.am
+===================================================================
+--- elfutils-0.164.orig/libelf/Makefile.am
++++ elfutils-0.164/libelf/Makefile.am
+@@ -93,7 +93,12 @@ libelf_a_SOURCES = elf_version.c elf_has
+ libelf_pic_a_SOURCES =
+ am_libelf_pic_a_OBJECTS = $(libelf_a_SOURCES:.c=.os)
+
++
+ libelf_so_LDLIBS =
++if USE_UCLIBC
++libelf_so_LDLIBS += -lintl
++endif
++
+ if USE_LOCKS
+ libelf_so_LDLIBS += -lpthread
+ endif
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils/Fix_elf_cvt_gunhash.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils/Fix_elf_cvt_gunhash.patch
new file mode 100644
index 000000000..f861e8990
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils/Fix_elf_cvt_gunhash.patch
@@ -0,0 +1,29 @@
+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>
+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];
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils/dso-link-change.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils/dso-link-change.patch
new file mode 100644
index 000000000..d0cd3ed6f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils/dso-link-change.patch
@@ -0,0 +1,32 @@
+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.
+
+--- elfutils-0.148.orig/src/Makefile.am
++++ elfutils-0.148/src/Makefile.am
+@@ -86,7 +86,7 @@ libdw = ../libdw/libdw.a $(zip_LIBS) $(l
+ libelf = ../libelf/libelf.a
+ 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
+--- elfutils-0.148.orig/tests/Makefile.am
++++ elfutils-0.148/tests/Makefile.am
+@@ -172,7 +172,7 @@ libdw = ../libdw/libdw.a $(zip_LIBS) $(l
+ libelf = ../libelf/libelf.a
+ 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
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.148.bb b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.148.bb
new file mode 100644
index 000000000..ff5325734
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.148.bb
@@ -0,0 +1,90 @@
+SUMMARY = "Utilities and libraries for handling compiled object files"
+HOMEPAGE = "https://fedorahosted.org/elfutils"
+SECTION = "base"
+LICENSE = "(GPL-2+ & Elfutils-Exception)"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3\
+ file://EXCEPTION;md5=570adcb0c1218ab57f2249c67d0ce417"
+DEPENDS = "libtool bzip2 zlib virtual/libintl"
+
+PR = "r11"
+
+SRC_URI = "https://fedorahosted.org/releases/e/l/${BPN}/${BP}.tar.bz2"
+
+SRC_URI[md5sum] = "a0bed1130135f17ad27533b0034dba8d"
+SRC_URI[sha256sum] = "8aebfa4a745db21cf5429c9541fe482729b62efc7e53e9110151b4169fe887da"
+
+# pick the patch from debian
+# http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.148-1.debian.tar.gz
+
+SRC_URI += "\
+ file://redhat-portability.diff \
+ file://redhat-robustify.diff \
+ file://hppa_backend.diff \
+ file://arm_backend.diff \
+ file://mips_backend.diff \
+ file://m68k_backend.diff \
+ file://testsuite-ignore-elflint.diff \
+ file://elf_additions.diff \
+ file://elfutils-fsize.patch \
+ file://remove-unused.patch \
+ file://fix_for_gcc-4.7.patch \
+ file://dso-link-change.patch \
+ file://nm-Fix-size-passed-to-snprintf-for-invalid-sh_name-case.patch \
+ file://elfutils-ar-c-fix-num-passed-to-memset.patch \
+ file://Fix_elf_cvt_gunhash.patch \
+ file://elf_begin.c-CVE-2014-9447-fix.patch \
+ file://fix-build-gcc-4.8.patch \
+"
+# Only apply when building uclibc based target recipe
+SRC_URI_append_libc-uclibc = " file://uclibc-support-for-elfutils-0.148.patch"
+
+# The buildsystem wants to generate 2 .h files from source using a binary it just built,
+# which can not pass the cross compiling, so let's work around it by adding 2 .h files
+# along with the do_configure_prepend()
+
+SRC_URI += "\
+ file://i386_dis.h \
+ file://x86_64_dis.h \
+"
+inherit autotools gettext
+
+EXTRA_OECONF = "--program-prefix=eu- --without-lzma"
+EXTRA_OECONF_append_class-native = " --without-bzlib"
+EXTRA_OECONF_append_libc-uclibc = " --enable-uclibc"
+
+do_configure_prepend() {
+ sed -i '/^i386_dis.h:/,+4 {/.*/d}' ${S}/libcpu/Makefile.am
+
+ cp ${WORKDIR}/*dis.h ${S}/libcpu
+}
+
+# we can not build complete elfutils when using uclibc
+# but some recipes e.g. gcc 4.5 depends on libelf so we
+# build only libelf for uclibc case
+
+EXTRA_OEMAKE_libc-uclibc = "-C libelf"
+EXTRA_OEMAKE_class-native = ""
+EXTRA_OEMAKE_class-nativesdk = ""
+
+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/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.164.bb b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.164.bb
new file mode 100644
index 000000000..4964c0507
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.164.bb
@@ -0,0 +1,89 @@
+SUMMARY = "Utilities and libraries for handling compiled object files"
+HOMEPAGE = "https://fedorahosted.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 "
+
+SRC_URI = "https://fedorahosted.org/releases/e/l/elfutils/${PV}/${BP}.tar.bz2"
+
+SRC_URI[md5sum] = "2e4536c1c48034f188a80789a59114d8"
+SRC_URI[sha256sum] = "9683c025928a12d06b7fe812928aa6235249e22d197d086f7084606a48165900"
+
+SRC_URI += "\
+ file://dso-link-change.patch \
+ file://Fix_elf_cvt_gunhash.patch \
+ file://fixheadercheck.patch \
+ file://0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch \
+ file://0001-remove-the-unneed-checking.patch \
+ file://0001-fix-a-stack-usage-warning.patch \
+ file://aarch64_uio.patch \
+ file://shadow.patch \
+"
+
+# pick the patch from debian
+# http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.164-1.debian.tar.xz
+SRC_URI += "\
+ file://hppa_backend.diff \
+ file://arm_backend.diff \
+ file://mips_backend.diff \
+ file://m68k_backend.diff \
+ file://testsuite-ignore-elflint.diff \
+ file://mips_readelf_w.patch \
+ file://kfreebsd_path.patch \
+ file://0001-Ignore-differences-between-mips-machine-identifiers.patch \
+ file://0002-Add-support-for-mips64-abis-in-mips_retval.c.patch \
+ file://0003-Add-mips-n64-relocation-format-hack.patch \
+ file://uclibc-support.patch \
+"
+SRC_URI_append_libc-musl = " file://0001-build-Provide-alternatives-for-glibc-assumptions-hel.patch "
+
+# The buildsystem wants to generate 2 .h files from source using a binary it just built,
+# which can not pass the cross compiling, so let's work around it by adding 2 .h files
+# along with the do_configure_prepend()
+
+inherit autotools gettext
+
+EXTRA_OECONF = "--program-prefix=eu- --without-lzma"
+EXTRA_OECONF_append_class-native = " --without-bzlib"
+EXTRA_OECONF_append_libc-uclibc = " --enable-uclibc"
+
+do_install_append() {
+ if [ "${TARGET_ARCH}" != "x86_64" ] && [ -z `echo "${TARGET_ARCH}"|grep 'i.86'` ];then
+ rm -f ${D}${bindir}/eu-objdump
+ fi
+}
+
+# we can not build complete elfutils when using uclibc
+# but some recipes e.g. gcc 4.5 depends on libelf so we
+# build only libelf for uclibc case
+
+EXTRA_OEMAKE_libc-uclibc = "-C libelf"
+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/import-layers/yocto-poky/meta/recipes-devtools/expect/expect/0001-configure.in.patch b/import-layers/yocto-poky/meta/recipes-devtools/expect/expect/0001-configure.in.patch
new file mode 100644
index 000000000..7595a254a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/expect/expect/0001-expect-install-scripts-without-using-the-fixline1-tc.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/expect/expect/0002-tcl.m4.patch b/import-layers/yocto-poky/meta/recipes-devtools/expect/expect/0002-tcl.m4.patch
new file mode 100644
index 000000000..dc4c6ba40
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/expect/expect/01-example-shebang.patch b/import-layers/yocto-poky/meta/recipes-devtools/expect/expect/01-example-shebang.patch
new file mode 100644
index 000000000..8597f3138
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/expect/expect_5.45.bb b/import-layers/yocto-poky/meta/recipes-devtools/expect/expect_5.45.bb
new file mode 100644
index 000000000..b4dfe157c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/expect/expect_5.45.bb
@@ -0,0 +1,64 @@
+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
+
+PR = "r1"
+
+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 \
+ "
+SRC_URI[md5sum] = "44e1a4f4c877e9ddc5a542dfa7ecc92b"
+SRC_URI[sha256sum] = "b28dca90428a3b30e650525cdc16255d76bb6ccd65d448be53e620d95d5cc040"
+
+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
+}
+
+EXTRA_OECONF += "--with-tcl=${STAGING_LIBDIR} \
+ --with-tclinclude=${STAGING_INCDIR}/tcl8.6 \
+ --enable-shared \
+ --enable-threads \
+ --disable-rpath \
+ "
+EXTRA_OEMAKE_install = " 'SCRIPTS=' "
+
+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}/* \
+ "
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/fdisk/gptfdisk_1.0.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/fdisk/gptfdisk_1.0.1.bb
new file mode 100644
index 000000000..8fab28f33
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/fdisk/gptfdisk_1.0.1.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] = "d7f3d306b083123bcc6f5941efade586"
+SRC_URI[sha256sum] = "864c8aee2efdda50346804d7e6230407d5f42a8ae754df70404dd8b2fdfaeac7"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/gptfdisk/files/gptfdisk/"
+UPSTREAM_CHECK_REGEX = "/gptfdisk/(?P<pver>(\d+[\.\-_]*)+)/"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+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/import-layers/yocto-poky/meta/recipes-devtools/file/file/0001-Add-P-prompt-into-Usage-info.patch b/import-layers/yocto-poky/meta/recipes-devtools/file/file/0001-Add-P-prompt-into-Usage-info.patch
new file mode 100644
index 000000000..8a16b2cf7
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/file/file/debian-742262.patch b/import-layers/yocto-poky/meta/recipes-devtools/file/file/debian-742262.patch
new file mode 100644
index 000000000..1ef485e93
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/file/file/debian-742262.patch
@@ -0,0 +1,19 @@
+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>
+---
+diff --git a/magic/Magdir/commands b/magic/Magdir/commands
+--- 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 =^\\s{0,100}BEGIN\\s{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/import-layers/yocto-poky/meta/recipes-devtools/file/file/host-file.patch b/import-layers/yocto-poky/meta/recipes-devtools/file/file/host-file.patch
new file mode 100644
index 000000000..a7efbdcbc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/file/file/host-file.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Submitted (http://bugs.gw.com/view.php?id=485)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From 3cde199d03b39632361c275cd30fa0612a03138b Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Mon, 19 Oct 2015 10:30:57 +0100
+Subject: [PATCH 2/2] When using the host file, respect FILE_COMPILE
+
+If we're cross-compiling and not using the file binary that was just built,
+execute the binary that we've been told to use (via FILE_COMPILE) when checking
+the version instead of assuming that "file" is correct as the actual compile
+uses FILE_COMPILE so different binaries may be used.
+---
+ magic/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/magic/Makefile.am b/magic/Makefile.am
+index 89ac844..67067fe 100644
+--- a/magic/Makefile.am
++++ b/magic/Makefile.am
+@@ -293,7 +293,7 @@ ${MAGIC}: $(EXTRA_DIST) $(FILE_COMPILE_DEP)
+ @(if expr "${FILE_COMPILE}" : '.*/.*' > /dev/null; then \
+ echo "Using ${FILE_COMPILE} to generate ${MAGIC}" > /dev/null; \
+ else \
+- v=$$(file --version | sed -e s/file-// -e q); \
++ v=$$(${FILE_COMPILE} --version | sed -e s/file-// -e q); \
+ if [ "$$v" != "${PACKAGE_VERSION}" ]; then \
+ echo "Cannot use the installed version of file ($$v) to"; \
+ echo "cross-compile file ${PACKAGE_VERSION}"; \
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/file/file_5.25.bb b/import-layers/yocto-poky/meta/recipes-devtools/file/file_5.25.bb
new file mode 100644
index 000000000..68bad69b4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/file/file_5.25.bb
@@ -0,0 +1,47 @@
+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 \
+ file://host-file.patch \
+ "
+
+SRCREV = "f45db89ddc91692b662fffbabbdafc7bc4c00f5e"
+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"
+
+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/import-layers/yocto-poky/meta/recipes-devtools/flex/flex/0001-tests-add-a-target-for-building-tests-without-runnin.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/flex/flex/disable-tests.patch b/import-layers/yocto-poky/meta/recipes-devtools/flex/flex/disable-tests.patch
new file mode 100644
index 000000000..4dc801d72
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/flex/flex/do_not_create_pdf_doc.patch b/import-layers/yocto-poky/meta/recipes-devtools/flex/flex/do_not_create_pdf_doc.patch
new file mode 100644
index 000000000..032833ae7
--- /dev/null
+++ b/import-layers/yocto-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.5.37/doc/Makefile.am
+===================================================================
+--- flex-2.5.37.orig/doc/Makefile.am 2012-07-21 04:18:27.000000000 +0300
++++ flex-2.5.37/doc/Makefile.am 2013-07-30 17:57:09.834834531 +0300
+@@ -2,7 +2,7 @@
+
+ info_TEXINFOS = flex.texi
+ dist_man_MANS = flex.1
+-dist_doc_DATA= flex.pdf
++EXTRA_DIST= flex.pdf
+
+ CLEANFILES = \
+ flex.hks \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/flex/flex/run-ptest b/import-layers/yocto-poky/meta/recipes-devtools/flex/flex/run-ptest
new file mode 100755
index 000000000..19db33790
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/flex/flex_2.6.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/flex/flex_2.6.0.bb
new file mode 100644
index 000000000..8285426d4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/flex/flex_2.6.0.bb
@@ -0,0 +1,55 @@
+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 \
+ ${@bb.utils.contains('PTEST_ENABLED', '1', '', 'file://disable-tests.patch', d)} \
+ "
+
+SRC_URI[md5sum] = "266270f13c48ed043d95648075084d59"
+SRC_URI[sha256sum] = "24e611ef5a4703a191012f80c1027dc9d12555183ce0ecd46f3636e587e9b8e9"
+
+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}
+}
+
+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/^Makefile:/_Makefile:/' -e 's/^srcdir = \(.*\)/srcdir = ./' -e 's/^top_srcdir = \(.*\)/top_srcdir = ./' -i ${D}${PTEST_PATH}/Makefile
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9.inc
new file mode 100644
index 000000000..7e03f3121
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9.inc
@@ -0,0 +1,139 @@
+require gcc-common.inc
+
+# Third digit in PV should be incremented after a minor release
+
+PV = "4.9.3"
+
+# BINV should be incremented to a revision after a minor gcc release
+
+BINV = "4.9.3"
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/gcc-4.9:"
+
+DEPENDS =+ "mpfr gmp libmpc zlib"
+NATIVEDEPS = "mpfr-native gmp-native libmpc-native zlib-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 \
+"
+
+SRC_URI = "\
+ ${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \
+ file://0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch \
+ file://0002-uclibc-conf.patch \
+ file://0003-gcc-uclibc-locale-ctype_touplow_t.patch \
+ file://0004-uclibc-locale.patch \
+ file://0005-uclibc-locale-no__x.patch \
+ file://0006-uclibc-locale-wchar_fix.patch \
+ file://0007-uclibc-locale-update.patch \
+ file://0008-missing-execinfo_h.patch \
+ file://0009-c99-snprintf.patch \
+ file://0010-c99-complex-ugly-hack.patch \
+ file://0011-index_macro.patch \
+ file://0013-libstdc-namespace.patch \
+ file://0014-sh-pr24836.patch \
+ file://0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch \
+ file://0016-gcc-poison-system-directories.patch \
+ file://0017-gcc-poison-dir-extend.patch \
+ file://0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch \
+ file://0019-64-bit-multilib-hack.patch \
+ file://0020-optional-libstdc.patch \
+ file://0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch \
+ file://0022-COLLECT_GCC_OPTIONS.patch \
+ file://0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch \
+ file://0025-fortran-cross-compile-hack.patch \
+ file://0026-libgcc-sjlj-check.patch \
+ file://0027-cpp-honor-sysroot.patch \
+ file://0028-MIPS64-Default-to-N64-ABI.patch \
+ file://0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch \
+ file://0030-gcc-Fix-argument-list-too-long-error.patch \
+ file://0031-Disable-sdt.patch \
+ file://0032-libtool.patch \
+ file://0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch \
+ file://0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch \
+ file://0040-fix-g++-sysroot.patch \
+ file://0041-libtool-avoid-libdir.patch \
+ file://0043-cpp.patch \
+ file://0044-gengtypes.patch \
+ file://0046-libatomic-deptracking.patch \
+ file://0047-repomembug.patch \
+ file://0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch \
+ file://0050-Revert-Use-dbx_reg_number-for-spanning-registers.patch \
+ file://0051-eabispe.patch \
+ file://0052-Add-target-hook-to-override-DWARF2-frame-register-si.patch \
+ file://0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch \
+ file://0054-gcc-Makefile.in-fix-parallel-building-failure.patch \
+ file://0055-dwarf-reg-processing-helper.patch \
+ file://0056-define-default-cfa-register-mapping.patch \
+ file://0057-aarch64-config.patch \
+ file://0058-gcc-r212171.patch \
+ file://0059-gcc-PR-rtl-optimization-63348.patch \
+ file://0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch \
+ file://0061-target-gcc-includedir.patch \
+ file://0062-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch \
+ file://0063-nativesdk-gcc-support.patch \
+ file://0064-handle-target-sysroot-multilib.patch \
+ file://0065-gcc-483-universal-initializer-no-warning.patch \
+ file://0066-cxxflags-for-build.patch \
+ file://0067-fix-arm-thumb.patch \
+ file://0067-gcc-musl-support.patch \
+ file://0068-musl-dynamic-linker.patch \
+ file://0069-musl-no-fixincludes.patch \
+ file://0070-libstdc-musl.patch \
+ file://0071-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch \
+ file://0072-support-ffile-prefix-map.patch \
+ file://0073-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch \
+ file://0074-fdebug-prefix-map-support-to-remap-relative-path.patch \
+"
+SRC_URI[md5sum] = "6f831b4d251872736e8e9cc09746f327"
+SRC_URI[sha256sum] = "2332b2a5a321b57508b9031354a8503af6fdfb868b8c1748d33028d100a8b67e"
+
+UPSTREAM_CHECK_REGEX = "gcc-(?P<pver>4\.9\.\d+).tar"
+
+S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}"
+B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}"
+
+# Language Overrides
+FORTRAN = ""
+JAVA = ""
+
+LTO = "--enable-lto"
+
+EXTRA_OECONF_BASE = "\
+ ${LTO} \
+ --enable-libssp \
+ --disable-bootstrap \
+ --disable-libmudflap \
+ --with-system-zlib \
+ --with-linker-hash-style=${LINKER_HASH_STYLE} \
+ --enable-linker-build-id \
+ --with-ppl=no \
+ --with-cloog=no \
+ --enable-checking=release \
+ --enable-cheaders=c_global \
+"
+
+EXTRA_OECONF_INITIAL = "\
+ --disable-libmudflap \
+ --disable-libgomp \
+ --disable-libssp \
+ --disable-libquadmath \
+ --with-system-zlib \
+ --disable-lto \
+ --disable-plugin \
+ --enable-decimal-float=no \
+"
+
+EXTRA_OECONF_append_libc-uclibc = " --disable-decimal-float "
+
+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/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch
new file mode 100644
index 000000000..e58801167
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch
@@ -0,0 +1,42 @@
+From bf3d96ae58fa180b8b468d25dc2e0209daca2751 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/35] 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 d809535..1b76c90 100755
+--- a/configure
++++ b/configure
+@@ -7439,7 +7439,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 48ec1aa..89d1d3f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2873,7 +2873,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
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0002-uclibc-conf.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0002-uclibc-conf.patch
new file mode 100644
index 000000000..dda3b1041
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0002-uclibc-conf.patch
@@ -0,0 +1,53 @@
+From d030973c872c00d916921d84deee0af2c0d38081 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:38:25 +0400
+Subject: [PATCH 02/35] uclibc-conf
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ contrib/regression/objs-gcc.sh | 4 ++++
+ libjava/classpath/ltconfig | 4 ++--
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/contrib/regression/objs-gcc.sh b/contrib/regression/objs-gcc.sh
+index 60b0497..6dc7ead 100755
+--- a/contrib/regression/objs-gcc.sh
++++ b/contrib/regression/objs-gcc.sh
+@@ -106,6 +106,10 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-gnu ]
+ then
+ make all-gdb all-dejagnu all-ld || exit 1
+ make install-gdb install-dejagnu install-ld || exit 1
++elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
++ then
++ make all-gdb all-dejagnu all-ld || exit 1
++ make install-gdb install-dejagnu install-ld || exit 1
+ elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
+ make bootstrap || exit 1
+ make install || exit 1
+diff --git a/libjava/classpath/ltconfig b/libjava/classpath/ltconfig
+index 743d951..ae4ea60 100755
+--- a/libjava/classpath/ltconfig
++++ b/libjava/classpath/ltconfig
+@@ -603,7 +603,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+-linux-gnu*) ;;
++linux-gnu*|linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1247,7 +1247,7 @@ linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0003-gcc-uclibc-locale-ctype_touplow_t.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0003-gcc-uclibc-locale-ctype_touplow_t.patch
new file mode 100644
index 000000000..7098e9950
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0003-gcc-uclibc-locale-ctype_touplow_t.patch
@@ -0,0 +1,87 @@
+From d2d9dd756c4356d14dd7ae003856344cb4f37985 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:40:12 +0400
+Subject: [PATCH 03/35] gcc-uclibc-locale-ctype_touplow_t
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/config/locale/generic/c_locale.cc | 5 +++++
+ libstdc++-v3/config/locale/generic/c_locale.h | 9 +++++++++
+ libstdc++-v3/config/os/gnu-linux/ctype_base.h | 9 +++++++++
+ 3 files changed, 23 insertions(+)
+
+diff --git a/libstdc++-v3/config/locale/generic/c_locale.cc b/libstdc++-v3/config/locale/generic/c_locale.cc
+index 0d309a5..f2f1e1f 100644
+--- a/libstdc++-v3/config/locale/generic/c_locale.cc
++++ b/libstdc++-v3/config/locale/generic/c_locale.cc
+@@ -263,5 +263,10 @@ _GLIBCXX_END_NAMESPACE_VERSION
+ #ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
+ #define _GLIBCXX_LDBL_COMPAT(dbl, ldbl) \
+ extern "C" void ldbl (void) __attribute__ ((alias (#dbl)))
++#ifdef __UCLIBC__
++// This is because __c_locale is of type __ctype_touplow_t* which is short on uclibc. for glibc its int*
++_GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKPs, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKPs);
++#else
+ _GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKPi, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKPi);
++#endif
+ #endif // _GLIBCXX_LONG_DOUBLE_COMPAT
+diff --git a/libstdc++-v3/config/locale/generic/c_locale.h b/libstdc++-v3/config/locale/generic/c_locale.h
+index b5fd989..3da9a5d 100644
+--- a/libstdc++-v3/config/locale/generic/c_locale.h
++++ b/libstdc++-v3/config/locale/generic/c_locale.h
+@@ -40,13 +40,22 @@
+
+ #include <clocale>
+
++#ifdef __UCLIBC__
++#include <features.h>
++#include <ctype.h>
++#endif
++
+ #define _GLIBCXX_NUM_CATEGORIES 0
+
+ namespace std _GLIBCXX_VISIBILITY(default)
+ {
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+
++#ifdef __UCLIBC__
++ typedef __ctype_touplow_t* __c_locale;
++#else
+ typedef int* __c_locale;
++#endif
+
+ // Convert numeric value of type double and long double to string and
+ // return length of string. If vsnprintf is available use it, otherwise
+diff --git a/libstdc++-v3/config/os/gnu-linux/ctype_base.h b/libstdc++-v3/config/os/gnu-linux/ctype_base.h
+index 2d8e978..14eb08f 100644
+--- a/libstdc++-v3/config/os/gnu-linux/ctype_base.h
++++ b/libstdc++-v3/config/os/gnu-linux/ctype_base.h
+@@ -33,6 +33,11 @@
+
+ // Information as gleaned from /usr/include/ctype.h
+
++#ifdef __UCLIBC__
++#include <features.h>
++#include <ctype.h>
++#endif
++
+ namespace std _GLIBCXX_VISIBILITY(default)
+ {
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -41,7 +46,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ struct ctype_base
+ {
+ // Non-standard typedefs.
++#ifdef __UCLIBC__
++ typedef const __ctype_touplow_t* __to_type;
++#else
+ typedef const int* __to_type;
++#endif
+
+ // NB: Offsets into ctype<char>::_M_table force a particular size
+ // on the mask type. Because of this, we don't use an enum.
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0004-uclibc-locale.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0004-uclibc-locale.patch
new file mode 100644
index 000000000..49f5f338e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0004-uclibc-locale.patch
@@ -0,0 +1,2862 @@
+From a55c751a449c2cbf0b3fcc07aab1b86bf9661510 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:41:39 +0400
+Subject: [PATCH 04/35] uclibc-locale
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/acinclude.m4 | 37 ++
+ .../config/locale/uclibc/c++locale_internal.h | 63 ++
+ libstdc++-v3/config/locale/uclibc/c_locale.cc | 160 +++++
+ libstdc++-v3/config/locale/uclibc/c_locale.h | 117 ++++
+ .../config/locale/uclibc/codecvt_members.cc | 308 +++++++++
+ .../config/locale/uclibc/collate_members.cc | 80 +++
+ libstdc++-v3/config/locale/uclibc/ctype_members.cc | 300 +++++++++
+ .../config/locale/uclibc/messages_members.cc | 100 +++
+ .../config/locale/uclibc/messages_members.h | 118 ++++
+ .../config/locale/uclibc/monetary_members.cc | 692 ++++++++++++++++++++
+ .../config/locale/uclibc/numeric_members.cc | 160 +++++
+ libstdc++-v3/config/locale/uclibc/time_members.cc | 406 ++++++++++++
+ libstdc++-v3/config/locale/uclibc/time_members.h | 68 ++
+ libstdc++-v3/configure | 75 +++
+ libstdc++-v3/include/c_compatibility/wchar.h | 2 +
+ libstdc++-v3/include/c_std/cwchar | 2 +
+ 16 files changed, 2688 insertions(+)
+ create mode 100644 libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+ create mode 100644 libstdc++-v3/config/locale/uclibc/c_locale.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/c_locale.h
+ create mode 100644 libstdc++-v3/config/locale/uclibc/codecvt_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/collate_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/ctype_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/messages_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/messages_members.h
+ create mode 100644 libstdc++-v3/config/locale/uclibc/monetary_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/numeric_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/time_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/time_members.h
+
+diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
+index 0871a6a..326d7ef 100644
+--- a/libstdc++-v3/acinclude.m4
++++ b/libstdc++-v3/acinclude.m4
+@@ -1905,6 +1905,9 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
+ # Default to "generic".
+ if test $enable_clocale_flag = auto; then
+ case ${target_os} in
++ *-uclibc*)
++ enable_clocale_flag=uclibc
++ ;;
+ linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
+ enable_clocale_flag=gnu
+ ;;
+@@ -2069,6 +2072,40 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
+ CTIME_CC=config/locale/generic/time_members.cc
+ CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
+ ;;
++ uclibc)
++ AC_MSG_RESULT(uclibc)
++
++ # Declare intention to use gettext, and add support for specific
++ # languages.
++ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
++ ALL_LINGUAS="de fr"
++
++ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
++ AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
++ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
++ USE_NLS=yes
++ fi
++ # Export the build objects.
++ for ling in $ALL_LINGUAS; do \
++ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
++ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
++ done
++ AC_SUBST(glibcxx_MOFILES)
++ AC_SUBST(glibcxx_POFILES)
++
++ CLOCALE_H=config/locale/uclibc/c_locale.h
++ CLOCALE_CC=config/locale/uclibc/c_locale.cc
++ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
++ CCOLLATE_CC=config/locale/uclibc/collate_members.cc
++ CCTYPE_CC=config/locale/uclibc/ctype_members.cc
++ CMESSAGES_H=config/locale/uclibc/messages_members.h
++ CMESSAGES_CC=config/locale/uclibc/messages_members.cc
++ CMONEY_CC=config/locale/uclibc/monetary_members.cc
++ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
++ CTIME_H=config/locale/uclibc/time_members.h
++ CTIME_CC=config/locale/uclibc/time_members.cc
++ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
++ ;;
+ esac
+
+ # This is where the testsuite looks for locale catalogs, using the
+diff --git a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+new file mode 100644
+index 0000000..2ae3e4a
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+@@ -0,0 +1,63 @@
++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
++
++// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++// Written by Jakub Jelinek <jakub@redhat.com>
++
++#include <bits/c++config.h>
++#include <clocale>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning clean this up
++#endif
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++
++extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
++extern "C" __typeof(strcoll_l) __strcoll_l;
++extern "C" __typeof(strftime_l) __strftime_l;
++extern "C" __typeof(strtod_l) __strtod_l;
++extern "C" __typeof(strtof_l) __strtof_l;
++extern "C" __typeof(strtold_l) __strtold_l;
++extern "C" __typeof(strxfrm_l) __strxfrm_l;
++extern "C" __typeof(newlocale) __newlocale;
++extern "C" __typeof(freelocale) __freelocale;
++extern "C" __typeof(duplocale) __duplocale;
++extern "C" __typeof(uselocale) __uselocale;
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++extern "C" __typeof(iswctype_l) __iswctype_l;
++extern "C" __typeof(towlower_l) __towlower_l;
++extern "C" __typeof(towupper_l) __towupper_l;
++extern "C" __typeof(wcscoll_l) __wcscoll_l;
++extern "C" __typeof(wcsftime_l) __wcsftime_l;
++extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
++extern "C" __typeof(wctype_l) __wctype_l;
++#endif
++
++#endif // GLIBC 2.3 and later
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.cc b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+new file mode 100644
+index 0000000..5081dc1
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+@@ -0,0 +1,160 @@
++// Wrapper for underlying C-language localization -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.8 Standard locale categories.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <cerrno> // For errno
++#include <locale>
++#include <stdexcept>
++#include <langinfo.h>
++#include <bits/c++locale_internal.h>
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
++#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
++#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
++#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
++#define __strtof_l(S, E, L) strtof((S), (E))
++#define __strtod_l(S, E, L) strtod((S), (E))
++#define __strtold_l(S, E, L) strtold((S), (E))
++#warning should dummy __newlocale check for C|POSIX ?
++#define __newlocale(a, b, c) NULL
++#define __freelocale(a) ((void)0)
++#define __duplocale(a) __c_locale()
++#endif
++
++namespace std
++{
++ template<>
++ void
++ __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
++ const __c_locale& __cloc)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ char* __sanity;
++ errno = 0;
++ float __f = __strtof_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __f;
++ else
++ __err |= ios_base::failbit;
++ }
++ }
++
++ template<>
++ void
++ __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
++ const __c_locale& __cloc)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ char* __sanity;
++ errno = 0;
++ double __d = __strtod_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __d;
++ else
++ __err |= ios_base::failbit;
++ }
++ }
++
++ template<>
++ void
++ __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
++ const __c_locale& __cloc)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ char* __sanity;
++ errno = 0;
++ long double __ld = __strtold_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __ld;
++ else
++ __err |= ios_base::failbit;
++ }
++ }
++
++ void
++ locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
++ __c_locale __old)
++ {
++ __cloc = __newlocale(1 << LC_ALL, __s, __old);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ if (!__cloc)
++ {
++ // This named locale is not supported by the underlying OS.
++ __throw_runtime_error(__N("locale::facet::_S_create_c_locale "
++ "name not valid"));
++ }
++#endif
++ }
++
++ void
++ locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
++ {
++ if (_S_get_c_locale() != __cloc)
++ __freelocale(__cloc);
++ }
++
++ __c_locale
++ locale::facet::_S_clone_c_locale(__c_locale& __cloc)
++ { return __duplocale(__cloc); }
++} // namespace std
++
++namespace __gnu_cxx
++{
++ const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
++ {
++ "LC_CTYPE",
++ "LC_NUMERIC",
++ "LC_TIME",
++ "LC_COLLATE",
++ "LC_MONETARY",
++ "LC_MESSAGES",
++#if _GLIBCXX_NUM_CATEGORIES != 0
++ "LC_PAPER",
++ "LC_NAME",
++ "LC_ADDRESS",
++ "LC_TELEPHONE",
++ "LC_MEASUREMENT",
++ "LC_IDENTIFICATION"
++#endif
++ };
++}
++
++namespace std
++{
++ const char* const* const locale::_S_categories = __gnu_cxx::category_names;
++} // namespace std
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.h b/libstdc++-v3/config/locale/uclibc/c_locale.h
+new file mode 100644
+index 0000000..da07c1f
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.h
+@@ -0,0 +1,117 @@
++// Wrapper for underlying C-language localization -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.8 Standard locale categories.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#ifndef _C_LOCALE_H
++#define _C_LOCALE_H 1
++
++#pragma GCC system_header
++
++#include <cstring> // get std::strlen
++#include <cstdio> // get std::snprintf or std::sprintf
++#include <clocale>
++#include <langinfo.h> // For codecvt
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this
++#endif
++#ifdef __UCLIBC_HAS_LOCALE__
++#include <iconv.h> // For codecvt using iconv, iconv_t
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++#include <libintl.h> // For messages
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning what is _GLIBCXX_C_LOCALE_GNU for
++#endif
++#define _GLIBCXX_C_LOCALE_GNU 1
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix categories
++#endif
++// #define _GLIBCXX_NUM_CATEGORIES 6
++#define _GLIBCXX_NUM_CATEGORIES 0
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++namespace __gnu_cxx
++{
++ extern "C" __typeof(uselocale) __uselocale;
++}
++#endif
++
++namespace std
++{
++#ifdef __UCLIBC_HAS_XLOCALE__
++ typedef __locale_t __c_locale;
++#else
++ typedef int* __c_locale;
++#endif
++
++ // Convert numeric value of type _Tv to string and return length of
++ // string. If snprintf is available use it, otherwise fall back to
++ // the unsafe sprintf which, in general, can be dangerous and should
++ // be avoided.
++ template<typename _Tv>
++ int
++ __convert_from_v(char* __out,
++ const int __size __attribute__ ((__unused__)),
++ const char* __fmt,
++#ifdef __UCLIBC_HAS_XCLOCALE__
++ _Tv __v, const __c_locale& __cloc, int __prec)
++ {
++ __c_locale __old = __gnu_cxx::__uselocale(__cloc);
++#else
++ _Tv __v, const __c_locale&, int __prec)
++ {
++# ifdef __UCLIBC_HAS_LOCALE__
++ char* __old = std::setlocale(LC_ALL, NULL);
++ char* __sav = new char[std::strlen(__old) + 1];
++ std::strcpy(__sav, __old);
++ std::setlocale(LC_ALL, "C");
++# endif
++#endif
++
++ const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
++
++#ifdef __UCLIBC_HAS_XCLOCALE__
++ __gnu_cxx::__uselocale(__old);
++#elif defined __UCLIBC_HAS_LOCALE__
++ std::setlocale(LC_ALL, __sav);
++ delete [] __sav;
++#endif
++ return __ret;
++ }
++}
++
++#endif
+diff --git a/libstdc++-v3/config/locale/uclibc/codecvt_members.cc b/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
+new file mode 100644
+index 0000000..64aa962
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
+@@ -0,0 +1,308 @@
++// std::codecvt implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.1.5 - Template class codecvt
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <cstdlib> // For MB_CUR_MAX
++#include <climits> // For MB_LEN_MAX
++#include <bits/c++locale_internal.h>
++
++namespace std
++{
++ // Specializations.
++#ifdef _GLIBCXX_USE_WCHAR_T
++ codecvt_base::result
++ codecvt<wchar_t, char, mbstate_t>::
++ do_out(state_type& __state, const intern_type* __from,
++ const intern_type* __from_end, const intern_type*& __from_next,
++ extern_type* __to, extern_type* __to_end,
++ extern_type*& __to_next) const
++ {
++ result __ret = ok;
++ state_type __tmp_state(__state);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++
++ // wcsnrtombs is *very* fast but stops if encounters NUL characters:
++ // in case we fall back to wcrtomb and then continue, in a loop.
++ // NB: wcsnrtombs is a GNU extension
++ for (__from_next = __from, __to_next = __to;
++ __from_next < __from_end && __to_next < __to_end
++ && __ret == ok;)
++ {
++ const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
++ __from_end - __from_next);
++ if (!__from_chunk_end)
++ __from_chunk_end = __from_end;
++
++ __from = __from_next;
++ const size_t __conv = wcsnrtombs(__to_next, &__from_next,
++ __from_chunk_end - __from_next,
++ __to_end - __to_next, &__state);
++ if (__conv == static_cast<size_t>(-1))
++ {
++ // In case of error, in order to stop at the exact place we
++ // have to start again from the beginning with a series of
++ // wcrtomb.
++ for (; __from < __from_next; ++__from)
++ __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
++ __state = __tmp_state;
++ __ret = error;
++ }
++ else if (__from_next && __from_next < __from_chunk_end)
++ {
++ __to_next += __conv;
++ __ret = partial;
++ }
++ else
++ {
++ __from_next = __from_chunk_end;
++ __to_next += __conv;
++ }
++
++ if (__from_next < __from_end && __ret == ok)
++ {
++ extern_type __buf[MB_LEN_MAX];
++ __tmp_state = __state;
++ const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
++ if (__conv > static_cast<size_t>(__to_end - __to_next))
++ __ret = partial;
++ else
++ {
++ memcpy(__to_next, __buf, __conv);
++ __state = __tmp_state;
++ __to_next += __conv;
++ ++__from_next;
++ }
++ }
++ }
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++
++ return __ret;
++ }
++
++ codecvt_base::result
++ codecvt<wchar_t, char, mbstate_t>::
++ do_in(state_type& __state, const extern_type* __from,
++ const extern_type* __from_end, const extern_type*& __from_next,
++ intern_type* __to, intern_type* __to_end,
++ intern_type*& __to_next) const
++ {
++ result __ret = ok;
++ state_type __tmp_state(__state);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++
++ // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
++ // in case we store a L'\0' and then continue, in a loop.
++ // NB: mbsnrtowcs is a GNU extension
++ for (__from_next = __from, __to_next = __to;
++ __from_next < __from_end && __to_next < __to_end
++ && __ret == ok;)
++ {
++ const extern_type* __from_chunk_end;
++ __from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
++ __from_end
++ - __from_next));
++ if (!__from_chunk_end)
++ __from_chunk_end = __from_end;
++
++ __from = __from_next;
++ size_t __conv = mbsnrtowcs(__to_next, &__from_next,
++ __from_chunk_end - __from_next,
++ __to_end - __to_next, &__state);
++ if (__conv == static_cast<size_t>(-1))
++ {
++ // In case of error, in order to stop at the exact place we
++ // have to start again from the beginning with a series of
++ // mbrtowc.
++ for (;; ++__to_next, __from += __conv)
++ {
++ __conv = mbrtowc(__to_next, __from, __from_end - __from,
++ &__tmp_state);
++ if (__conv == static_cast<size_t>(-1)
++ || __conv == static_cast<size_t>(-2))
++ break;
++ }
++ __from_next = __from;
++ __state = __tmp_state;
++ __ret = error;
++ }
++ else if (__from_next && __from_next < __from_chunk_end)
++ {
++ // It is unclear what to return in this case (see DR 382).
++ __to_next += __conv;
++ __ret = partial;
++ }
++ else
++ {
++ __from_next = __from_chunk_end;
++ __to_next += __conv;
++ }
++
++ if (__from_next < __from_end && __ret == ok)
++ {
++ if (__to_next < __to_end)
++ {
++ // XXX Probably wrong for stateful encodings
++ __tmp_state = __state;
++ ++__from_next;
++ *__to_next++ = L'\0';
++ }
++ else
++ __ret = partial;
++ }
++ }
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++
++ return __ret;
++ }
++
++ int
++ codecvt<wchar_t, char, mbstate_t>::
++ do_encoding() const throw()
++ {
++ // XXX This implementation assumes that the encoding is
++ // stateless and is either single-byte or variable-width.
++ int __ret = 0;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++ if (MB_CUR_MAX == 1)
++ __ret = 1;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return __ret;
++ }
++
++ int
++ codecvt<wchar_t, char, mbstate_t>::
++ do_max_length() const throw()
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++ // XXX Probably wrong for stateful encodings.
++ int __ret = MB_CUR_MAX;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return __ret;
++ }
++
++ int
++ codecvt<wchar_t, char, mbstate_t>::
++ do_length(state_type& __state, const extern_type* __from,
++ const extern_type* __end, size_t __max) const
++ {
++ int __ret = 0;
++ state_type __tmp_state(__state);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++
++ // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
++ // in case we advance past it and then continue, in a loop.
++ // NB: mbsnrtowcs is a GNU extension
++
++ // A dummy internal buffer is needed in order for mbsnrtocws to consider
++ // its fourth parameter (it wouldn't with NULL as first parameter).
++ wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t)
++ * __max));
++ while (__from < __end && __max)
++ {
++ const extern_type* __from_chunk_end;
++ __from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
++ __end
++ - __from));
++ if (!__from_chunk_end)
++ __from_chunk_end = __end;
++
++ const extern_type* __tmp_from = __from;
++ size_t __conv = mbsnrtowcs(__to, &__from,
++ __from_chunk_end - __from,
++ __max, &__state);
++ if (__conv == static_cast<size_t>(-1))
++ {
++ // In case of error, in order to stop at the exact place we
++ // have to start again from the beginning with a series of
++ // mbrtowc.
++ for (__from = __tmp_from;; __from += __conv)
++ {
++ __conv = mbrtowc(NULL, __from, __end - __from,
++ &__tmp_state);
++ if (__conv == static_cast<size_t>(-1)
++ || __conv == static_cast<size_t>(-2))
++ break;
++ }
++ __state = __tmp_state;
++ __ret += __from - __tmp_from;
++ break;
++ }
++ if (!__from)
++ __from = __from_chunk_end;
++
++ __ret += __from - __tmp_from;
++ __max -= __conv;
++
++ if (__from < __end && __max)
++ {
++ // XXX Probably wrong for stateful encodings
++ __tmp_state = __state;
++ ++__from;
++ ++__ret;
++ --__max;
++ }
++ }
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++
++ return __ret;
++ }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/collate_members.cc b/libstdc++-v3/config/locale/uclibc/collate_members.cc
+new file mode 100644
+index 0000000..c2664a7
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/collate_members.cc
+@@ -0,0 +1,80 @@
++// std::collate implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.4.1.2 collate virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
++#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
++#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
++#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
++#endif
++
++namespace std
++{
++ // These are basically extensions to char_traits, and perhaps should
++ // be put there instead of here.
++ template<>
++ int
++ collate<char>::_M_compare(const char* __one, const char* __two) const
++ {
++ int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
++ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
++ }
++
++ template<>
++ size_t
++ collate<char>::_M_transform(char* __to, const char* __from,
++ size_t __n) const
++ { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ int
++ collate<wchar_t>::_M_compare(const wchar_t* __one,
++ const wchar_t* __two) const
++ {
++ int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
++ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
++ }
++
++ template<>
++ size_t
++ collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
++ size_t __n) const
++ { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/ctype_members.cc b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+new file mode 100644
+index 0000000..7294e3a
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+@@ -0,0 +1,300 @@
++// std::ctype implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __wctype_l(S, L) wctype((S))
++#define __towupper_l(C, L) towupper((C))
++#define __towlower_l(C, L) towlower((C))
++#define __iswctype_l(C, M, L) iswctype((C), (M))
++#endif
++
++namespace std
++{
++ // NB: The other ctype<char> specializations are in src/locale.cc and
++ // various /config/os/* files.
++ template<>
++ ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
++ : ctype<char>(0, false, __refs)
++ {
++ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
++ {
++ this->_S_destroy_c_locale(this->_M_c_locale_ctype);
++ this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
++ this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
++ this->_M_table = this->_M_c_locale_ctype->__ctype_b;
++#endif
++ }
++ }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ ctype<wchar_t>::__wmask_type
++ ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
++ {
++ __wmask_type __ret;
++ switch (__m)
++ {
++ case space:
++ __ret = __wctype_l("space", _M_c_locale_ctype);
++ break;
++ case print:
++ __ret = __wctype_l("print", _M_c_locale_ctype);
++ break;
++ case cntrl:
++ __ret = __wctype_l("cntrl", _M_c_locale_ctype);
++ break;
++ case upper:
++ __ret = __wctype_l("upper", _M_c_locale_ctype);
++ break;
++ case lower:
++ __ret = __wctype_l("lower", _M_c_locale_ctype);
++ break;
++ case alpha:
++ __ret = __wctype_l("alpha", _M_c_locale_ctype);
++ break;
++ case digit:
++ __ret = __wctype_l("digit", _M_c_locale_ctype);
++ break;
++ case punct:
++ __ret = __wctype_l("punct", _M_c_locale_ctype);
++ break;
++ case xdigit:
++ __ret = __wctype_l("xdigit", _M_c_locale_ctype);
++ break;
++ case alnum:
++ __ret = __wctype_l("alnum", _M_c_locale_ctype);
++ break;
++ case graph:
++ __ret = __wctype_l("graph", _M_c_locale_ctype);
++ break;
++ default:
++ __ret = __wmask_type();
++ }
++ return __ret;
++ }
++
++ wchar_t
++ ctype<wchar_t>::do_toupper(wchar_t __c) const
++ { return __towupper_l(__c, _M_c_locale_ctype); }
++
++ const wchar_t*
++ ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
++ {
++ while (__lo < __hi)
++ {
++ *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
++ ++__lo;
++ }
++ return __hi;
++ }
++
++ wchar_t
++ ctype<wchar_t>::do_tolower(wchar_t __c) const
++ { return __towlower_l(__c, _M_c_locale_ctype); }
++
++ const wchar_t*
++ ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
++ {
++ while (__lo < __hi)
++ {
++ *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
++ ++__lo;
++ }
++ return __hi;
++ }
++
++ bool
++ ctype<wchar_t>::
++ do_is(mask __m, wchar_t __c) const
++ {
++ // Highest bitmask in ctype_base == 10, but extra in "C"
++ // library for blank.
++ bool __ret = false;
++ const size_t __bitmasksize = 11;
++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++ if (__m & _M_bit[__bitcur]
++ && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
++ {
++ __ret = true;
++ break;
++ }
++ return __ret;
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
++ {
++ for (; __lo < __hi; ++__vec, ++__lo)
++ {
++ // Highest bitmask in ctype_base == 10, but extra in "C"
++ // library for blank.
++ const size_t __bitmasksize = 11;
++ mask __m = 0;
++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++ if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
++ __m |= _M_bit[__bitcur];
++ *__vec = __m;
++ }
++ return __hi;
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
++ {
++ while (__lo < __hi && !this->do_is(__m, *__lo))
++ ++__lo;
++ return __lo;
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
++ {
++ while (__lo < __hi && this->do_is(__m, *__lo) != 0)
++ ++__lo;
++ return __lo;
++ }
++
++ wchar_t
++ ctype<wchar_t>::
++ do_widen(char __c) const
++ { return _M_widen[static_cast<unsigned char>(__c)]; }
++
++ const char*
++ ctype<wchar_t>::
++ do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
++ {
++ while (__lo < __hi)
++ {
++ *__dest = _M_widen[static_cast<unsigned char>(*__lo)];
++ ++__lo;
++ ++__dest;
++ }
++ return __hi;
++ }
++
++ char
++ ctype<wchar_t>::
++ do_narrow(wchar_t __wc, char __dfault) const
++ {
++ if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
++ return _M_narrow[__wc];
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++ const int __c = wctob(__wc);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return (__c == EOF ? __dfault : static_cast<char>(__c));
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
++ char* __dest) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++ if (_M_narrow_ok)
++ while (__lo < __hi)
++ {
++ if (*__lo >= 0 && *__lo < 128)
++ *__dest = _M_narrow[*__lo];
++ else
++ {
++ const int __c = wctob(*__lo);
++ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
++ }
++ ++__lo;
++ ++__dest;
++ }
++ else
++ while (__lo < __hi)
++ {
++ const int __c = wctob(*__lo);
++ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
++ ++__lo;
++ ++__dest;
++ }
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return __hi;
++ }
++
++ void
++ ctype<wchar_t>::_M_initialize_ctype()
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++ wint_t __i;
++ for (__i = 0; __i < 128; ++__i)
++ {
++ const int __c = wctob(__i);
++ if (__c == EOF)
++ break;
++ else
++ _M_narrow[__i] = static_cast<char>(__c);
++ }
++ if (__i == 128)
++ _M_narrow_ok = true;
++ else
++ _M_narrow_ok = false;
++ for (size_t __j = 0;
++ __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
++ _M_widen[__j] = btowc(__j);
++
++ for (size_t __k = 0; __k <= 11; ++__k)
++ {
++ _M_bit[__k] = static_cast<mask>(_ISbit(__k));
++ _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
++ }
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ }
++#endif // _GLIBCXX_USE_WCHAR_T
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.cc b/libstdc++-v3/config/locale/uclibc/messages_members.cc
+new file mode 100644
+index 0000000..13594d9
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.cc
+@@ -0,0 +1,100 @@
++// std::messages implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix gettext stuff
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++extern "C" char *__dcgettext(const char *domainname,
++ const char *msgid, int category);
++#undef gettext
++#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
++#else
++#undef gettext
++#define gettext(msgid) (msgid)
++#endif
++
++namespace std
++{
++ // Specializations.
++ template<>
++ string
++ messages<char>::do_get(catalog, int, int, const string& __dfault) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_messages);
++ const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
++ __uselocale(__old);
++ return string(__msg);
++#elif defined __UCLIBC_HAS_LOCALE__
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_messages);
++ const char* __msg = gettext(__dfault.c_str());
++ setlocale(LC_ALL, __old);
++ free(__old);
++ return string(__msg);
++#else
++ const char* __msg = gettext(__dfault.c_str());
++ return string(__msg);
++#endif
++ }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ wstring
++ messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
++ {
++# ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_messages);
++ char* __msg = gettext(_M_convert_to_char(__dfault));
++ __uselocale(__old);
++ return _M_convert_from_char(__msg);
++# elif defined __UCLIBC_HAS_LOCALE__
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_messages);
++ char* __msg = gettext(_M_convert_to_char(__dfault));
++ setlocale(LC_ALL, __old);
++ free(__old);
++ return _M_convert_from_char(__msg);
++# else
++ char* __msg = gettext(_M_convert_to_char(__dfault));
++ return _M_convert_from_char(__msg);
++# endif
++ }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h
+new file mode 100644
+index 0000000..1424078
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h
+@@ -0,0 +1,118 @@
++// std::messages implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.7.1.2 messages functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix prototypes for *textdomain funcs
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++extern "C" char *__textdomain(const char *domainname);
++extern "C" char *__bindtextdomain(const char *domainname,
++ const char *dirname);
++#else
++#undef __textdomain
++#undef __bindtextdomain
++#define __textdomain(D) ((void)0)
++#define __bindtextdomain(D,P) ((void)0)
++#endif
++
++ // Non-virtual member functions.
++ template<typename _CharT>
++ messages<_CharT>::messages(size_t __refs)
++ : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
++ _M_name_messages(_S_get_c_name())
++ { }
++
++ template<typename _CharT>
++ messages<_CharT>::messages(__c_locale __cloc, const char* __s,
++ size_t __refs)
++ : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
++ _M_name_messages(__s)
++ {
++ char* __tmp = new char[std::strlen(__s) + 1];
++ std::strcpy(__tmp, __s);
++ _M_name_messages = __tmp;
++ }
++
++ template<typename _CharT>
++ typename messages<_CharT>::catalog
++ messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
++ const char* __dir) const
++ {
++ __bindtextdomain(__s.c_str(), __dir);
++ return this->do_open(__s, __loc);
++ }
++
++ // Virtual member functions.
++ template<typename _CharT>
++ messages<_CharT>::~messages()
++ {
++ if (_M_name_messages != _S_get_c_name())
++ delete [] _M_name_messages;
++ _S_destroy_c_locale(_M_c_locale_messages);
++ }
++
++ template<typename _CharT>
++ typename messages<_CharT>::catalog
++ messages<_CharT>::do_open(const basic_string<char>& __s,
++ const locale&) const
++ {
++ // No error checking is done, assume the catalog exists and can
++ // be used.
++ __textdomain(__s.c_str());
++ return 0;
++ }
++
++ template<typename _CharT>
++ void
++ messages<_CharT>::do_close(catalog) const
++ { }
++
++ // messages_byname
++ template<typename _CharT>
++ messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
++ : messages<_CharT>(__refs)
++ {
++ if (this->_M_name_messages != locale::facet::_S_get_c_name())
++ delete [] this->_M_name_messages;
++ char* __tmp = new char[std::strlen(__s) + 1];
++ std::strcpy(__tmp, __s);
++ this->_M_name_messages = __tmp;
++
++ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
++ {
++ this->_S_destroy_c_locale(this->_M_c_locale_messages);
++ this->_S_create_c_locale(this->_M_c_locale_messages, __s);
++ }
++ }
+diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+new file mode 100644
+index 0000000..aa52731
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -0,0 +1,692 @@
++// std::moneypunct implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning optimize this for uclibc
++#warning tailor for stub locale support
++#endif
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __nl_langinfo_l(N, L) nl_langinfo((N))
++#endif
++
++namespace std
++{
++ // Construct and return valid pattern consisting of some combination of:
++ // space none symbol sign value
++ money_base::pattern
++ money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
++ {
++ pattern __ret;
++
++ // This insanely complicated routine attempts to construct a valid
++ // pattern for use with monyepunct. A couple of invariants:
++
++ // if (__precedes) symbol -> value
++ // else value -> symbol
++
++ // if (__space) space
++ // else none
++
++ // none == never first
++ // space never first or last
++
++ // Any elegant implementations of this are welcome.
++ switch (__posn)
++ {
++ case 0:
++ case 1:
++ // 1 The sign precedes the value and symbol.
++ __ret.field[0] = sign;
++ if (__space)
++ {
++ // Pattern starts with sign.
++ if (__precedes)
++ {
++ __ret.field[1] = symbol;
++ __ret.field[3] = value;
++ }
++ else
++ {
++ __ret.field[1] = value;
++ __ret.field[3] = symbol;
++ }
++ __ret.field[2] = space;
++ }
++ else
++ {
++ // Pattern starts with sign and ends with none.
++ if (__precedes)
++ {
++ __ret.field[1] = symbol;
++ __ret.field[2] = value;
++ }
++ else
++ {
++ __ret.field[1] = value;
++ __ret.field[2] = symbol;
++ }
++ __ret.field[3] = none;
++ }
++ break;
++ case 2:
++ // 2 The sign follows the value and symbol.
++ if (__space)
++ {
++ // Pattern either ends with sign.
++ if (__precedes)
++ {
++ __ret.field[0] = symbol;
++ __ret.field[2] = value;
++ }
++ else
++ {
++ __ret.field[0] = value;
++ __ret.field[2] = symbol;
++ }
++ __ret.field[1] = space;
++ __ret.field[3] = sign;
++ }
++ else
++ {
++ // Pattern ends with sign then none.
++ if (__precedes)
++ {
++ __ret.field[0] = symbol;
++ __ret.field[1] = value;
++ }
++ else
++ {
++ __ret.field[0] = value;
++ __ret.field[1] = symbol;
++ }
++ __ret.field[2] = sign;
++ __ret.field[3] = none;
++ }
++ break;
++ case 3:
++ // 3 The sign immediately precedes the symbol.
++ if (__precedes)
++ {
++ __ret.field[0] = sign;
++ __ret.field[1] = symbol;
++ if (__space)
++ {
++ __ret.field[2] = space;
++ __ret.field[3] = value;
++ }
++ else
++ {
++ __ret.field[2] = value;
++ __ret.field[3] = none;
++ }
++ }
++ else
++ {
++ __ret.field[0] = value;
++ if (__space)
++ {
++ __ret.field[1] = space;
++ __ret.field[2] = sign;
++ __ret.field[3] = symbol;
++ }
++ else
++ {
++ __ret.field[1] = sign;
++ __ret.field[2] = symbol;
++ __ret.field[3] = none;
++ }
++ }
++ break;
++ case 4:
++ // 4 The sign immediately follows the symbol.
++ if (__precedes)
++ {
++ __ret.field[0] = symbol;
++ __ret.field[1] = sign;
++ if (__space)
++ {
++ __ret.field[2] = space;
++ __ret.field[3] = value;
++ }
++ else
++ {
++ __ret.field[2] = value;
++ __ret.field[3] = none;
++ }
++ }
++ else
++ {
++ __ret.field[0] = value;
++ if (__space)
++ {
++ __ret.field[1] = space;
++ __ret.field[2] = symbol;
++ __ret.field[3] = sign;
++ }
++ else
++ {
++ __ret.field[1] = symbol;
++ __ret.field[2] = sign;
++ __ret.field[3] = none;
++ }
++ }
++ break;
++ default:
++ ;
++ }
++ return __ret;
++ }
++
++ template<>
++ void
++ moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
++ const char*)
++ {
++ if (!_M_data)
++ _M_data = new __moneypunct_cache<char, true>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_decimal_point = '.';
++ _M_data->_M_thousands_sep = ',';
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_curr_symbol = "";
++ _M_data->_M_curr_symbol_size = 0;
++ _M_data->_M_positive_sign = "";
++ _M_data->_M_positive_sign_size = 0;
++ _M_data->_M_negative_sign = "";
++ _M_data->_M_negative_sign_size = 0;
++ _M_data->_M_frac_digits = 0;
++ _M_data->_M_pos_format = money_base::_S_default_pattern;
++ _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
++ }
++ else
++ {
++ // Named locale.
++ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
++ __cloc));
++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
++ __cloc));
++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
++
++ char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
++ if (!__nposn)
++ _M_data->_M_negative_sign = "()";
++ else
++ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
++ __cloc);
++ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
++
++ // _Intl == true
++ _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
++ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
++ __cloc));
++ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
++ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
++ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++ __pposn);
++ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
++ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++ __nposn);
++ }
++ }
++
++ template<>
++ void
++ moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
++ const char*)
++ {
++ if (!_M_data)
++ _M_data = new __moneypunct_cache<char, false>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_decimal_point = '.';
++ _M_data->_M_thousands_sep = ',';
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_curr_symbol = "";
++ _M_data->_M_curr_symbol_size = 0;
++ _M_data->_M_positive_sign = "";
++ _M_data->_M_positive_sign_size = 0;
++ _M_data->_M_negative_sign = "";
++ _M_data->_M_negative_sign_size = 0;
++ _M_data->_M_frac_digits = 0;
++ _M_data->_M_pos_format = money_base::_S_default_pattern;
++ _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
++ }
++ else
++ {
++ // Named locale.
++ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
++ __cloc));
++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
++ __cloc));
++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
++
++ char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
++ if (!__nposn)
++ _M_data->_M_negative_sign = "()";
++ else
++ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
++ __cloc);
++ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
++
++ // _Intl == false
++ _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
++ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
++ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
++ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
++ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++ __pposn);
++ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
++ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++ __nposn);
++ }
++ }
++
++ template<>
++ moneypunct<char, true>::~moneypunct()
++ { delete _M_data; }
++
++ template<>
++ moneypunct<char, false>::~moneypunct()
++ { delete _M_data; }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ void
++ moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
++#ifdef __UCLIBC_HAS_XLOCALE__
++ const char*)
++#else
++ const char* __name)
++#endif
++ {
++ if (!_M_data)
++ _M_data = new __moneypunct_cache<wchar_t, true>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_decimal_point = L'.';
++ _M_data->_M_thousands_sep = L',';
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_curr_symbol = L"";
++ _M_data->_M_curr_symbol_size = 0;
++ _M_data->_M_positive_sign = L"";
++ _M_data->_M_positive_sign_size = 0;
++ _M_data->_M_negative_sign = L"";
++ _M_data->_M_negative_sign_size = 0;
++ _M_data->_M_frac_digits = 0;
++ _M_data->_M_pos_format = money_base::_S_default_pattern;
++ _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++ // Use ctype::widen code without the facet...
++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++ _M_data->_M_atoms[__i] =
++ static_cast<wchar_t>(money_base::_S_atoms[__i]);
++ }
++ else
++ {
++ // Named locale.
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(__cloc);
++#else
++ // Switch to named locale so that mbsrtowcs will work.
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, __name);
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this... should be monetary
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
++# else
++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++ union { char *__s; wchar_t __w; } __u;
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
++ _M_data->_M_decimal_point = __u.__w;
++
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
++ _M_data->_M_thousands_sep = __u.__w;
++#endif
++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++
++ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
++ const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
++
++ wchar_t* __wcs_ps = 0;
++ wchar_t* __wcs_ns = 0;
++ const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
++ try
++ {
++ mbstate_t __state;
++ size_t __len = strlen(__cpossign);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ __wcs_ps = new wchar_t[__len];
++ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
++ _M_data->_M_positive_sign = __wcs_ps;
++ }
++ else
++ _M_data->_M_positive_sign = L"";
++ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
++
++ __len = strlen(__cnegsign);
++ if (!__nposn)
++ _M_data->_M_negative_sign = L"()";
++ else if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ __wcs_ns = new wchar_t[__len];
++ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
++ _M_data->_M_negative_sign = __wcs_ns;
++ }
++ else
++ _M_data->_M_negative_sign = L"";
++ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
++
++ // _Intl == true.
++ __len = strlen(__ccurr);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ wchar_t* __wcs = new wchar_t[__len];
++ mbsrtowcs(__wcs, &__ccurr, __len, &__state);
++ _M_data->_M_curr_symbol = __wcs;
++ }
++ else
++ _M_data->_M_curr_symbol = L"";
++ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
++ }
++ catch (...)
++ {
++ delete _M_data;
++ _M_data = 0;
++ delete __wcs_ps;
++ delete __wcs_ns;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#else
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ __throw_exception_again;
++ }
++
++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
++ __cloc));
++ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
++ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
++ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++ __pposn);
++ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
++ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++ __nposn);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#else
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ }
++ }
++
++ template<>
++ void
++ moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
++#ifdef __UCLIBC_HAS_XLOCALE__
++ const char*)
++#else
++ const char* __name)
++#endif
++ {
++ if (!_M_data)
++ _M_data = new __moneypunct_cache<wchar_t, false>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_decimal_point = L'.';
++ _M_data->_M_thousands_sep = L',';
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_curr_symbol = L"";
++ _M_data->_M_curr_symbol_size = 0;
++ _M_data->_M_positive_sign = L"";
++ _M_data->_M_positive_sign_size = 0;
++ _M_data->_M_negative_sign = L"";
++ _M_data->_M_negative_sign_size = 0;
++ _M_data->_M_frac_digits = 0;
++ _M_data->_M_pos_format = money_base::_S_default_pattern;
++ _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++ // Use ctype::widen code without the facet...
++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++ _M_data->_M_atoms[__i] =
++ static_cast<wchar_t>(money_base::_S_atoms[__i]);
++ }
++ else
++ {
++ // Named locale.
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(__cloc);
++#else
++ // Switch to named locale so that mbsrtowcs will work.
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, __name);
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this... should be monetary
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
++# else
++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++ union { char *__s; wchar_t __w; } __u;
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
++ _M_data->_M_decimal_point = __u.__w;
++
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
++ _M_data->_M_thousands_sep = __u.__w;
++#endif
++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++
++ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
++ const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
++
++ wchar_t* __wcs_ps = 0;
++ wchar_t* __wcs_ns = 0;
++ const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
++ try
++ {
++ mbstate_t __state;
++ size_t __len;
++ __len = strlen(__cpossign);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ __wcs_ps = new wchar_t[__len];
++ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
++ _M_data->_M_positive_sign = __wcs_ps;
++ }
++ else
++ _M_data->_M_positive_sign = L"";
++ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
++
++ __len = strlen(__cnegsign);
++ if (!__nposn)
++ _M_data->_M_negative_sign = L"()";
++ else if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ __wcs_ns = new wchar_t[__len];
++ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
++ _M_data->_M_negative_sign = __wcs_ns;
++ }
++ else
++ _M_data->_M_negative_sign = L"";
++ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
++
++ // _Intl == true.
++ __len = strlen(__ccurr);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ wchar_t* __wcs = new wchar_t[__len];
++ mbsrtowcs(__wcs, &__ccurr, __len, &__state);
++ _M_data->_M_curr_symbol = __wcs;
++ }
++ else
++ _M_data->_M_curr_symbol = L"";
++ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
++ }
++ catch (...)
++ {
++ delete _M_data;
++ _M_data = 0;
++ delete __wcs_ps;
++ delete __wcs_ns;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#else
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ __throw_exception_again;
++ }
++
++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
++ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
++ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
++ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++ __pposn);
++ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
++ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++ __nposn);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#else
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ }
++ }
++
++ template<>
++ moneypunct<wchar_t, true>::~moneypunct()
++ {
++ if (_M_data->_M_positive_sign_size)
++ delete [] _M_data->_M_positive_sign;
++ if (_M_data->_M_negative_sign_size
++ && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
++ delete [] _M_data->_M_negative_sign;
++ if (_M_data->_M_curr_symbol_size)
++ delete [] _M_data->_M_curr_symbol;
++ delete _M_data;
++ }
++
++ template<>
++ moneypunct<wchar_t, false>::~moneypunct()
++ {
++ if (_M_data->_M_positive_sign_size)
++ delete [] _M_data->_M_positive_sign;
++ if (_M_data->_M_negative_sign_size
++ && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
++ delete [] _M_data->_M_negative_sign;
++ if (_M_data->_M_curr_symbol_size)
++ delete [] _M_data->_M_curr_symbol;
++ delete _M_data;
++ }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+new file mode 100644
+index 0000000..883ec1a
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -0,0 +1,160 @@
++// std::numpunct implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning tailor for stub locale support
++#endif
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __nl_langinfo_l(N, L) nl_langinfo((N))
++#endif
++
++namespace std
++{
++ template<>
++ void
++ numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __numpunct_cache<char>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_use_grouping = false;
++
++ _M_data->_M_decimal_point = '.';
++ _M_data->_M_thousands_sep = ',';
++
++ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
++ _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
++
++ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
++ _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
++ }
++ else
++ {
++ // Named locale.
++ _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT,
++ __cloc));
++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP,
++ __cloc));
++
++ // Check for NULL, which implies no grouping.
++ if (_M_data->_M_thousands_sep == '\0')
++ _M_data->_M_grouping = "";
++ else
++ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++ }
++
++ // NB: There is no way to extact this info from posix locales.
++ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
++ _M_data->_M_truename = "true";
++ _M_data->_M_truename_size = 4;
++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
++ _M_data->_M_falsename = "false";
++ _M_data->_M_falsename_size = 5;
++ }
++
++ template<>
++ numpunct<char>::~numpunct()
++ { delete _M_data; }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ void
++ numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __numpunct_cache<wchar_t>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_use_grouping = false;
++
++ _M_data->_M_decimal_point = L'.';
++ _M_data->_M_thousands_sep = L',';
++
++ // Use ctype::widen code without the facet...
++ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
++ _M_data->_M_atoms_out[__i] =
++ static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
++
++ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
++ _M_data->_M_atoms_in[__j] =
++ static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
++ }
++ else
++ {
++ // Named locale.
++ // NB: In the GNU model wchar_t is always 32 bit wide.
++ union { char *__s; wchar_t __w; } __u;
++ __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
++ _M_data->_M_decimal_point = __u.__w;
++
++ __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
++ _M_data->_M_thousands_sep = __u.__w;
++
++ if (_M_data->_M_thousands_sep == L'\0')
++ _M_data->_M_grouping = "";
++ else
++ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++ }
++
++ // NB: There is no way to extact this info from posix locales.
++ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
++ _M_data->_M_truename = L"true";
++ _M_data->_M_truename_size = 4;
++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
++ _M_data->_M_falsename = L"false";
++ _M_data->_M_falsename_size = 5;
++ }
++
++ template<>
++ numpunct<wchar_t>::~numpunct()
++ { delete _M_data; }
++ #endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.cc b/libstdc++-v3/config/locale/uclibc/time_members.cc
+new file mode 100644
+index 0000000..e0707d7
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/time_members.cc
+@@ -0,0 +1,406 @@
++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning tailor for stub locale support
++#endif
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __nl_langinfo_l(N, L) nl_langinfo((N))
++#endif
++
++namespace std
++{
++ template<>
++ void
++ __timepunct<char>::
++ _M_put(char* __s, size_t __maxlen, const char* __format,
++ const tm* __tm) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
++ _M_c_locale_timepunct);
++#else
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_timepunct);
++ const size_t __len = strftime(__s, __maxlen, __format, __tm);
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ // Make sure __s is null terminated.
++ if (__len == 0)
++ __s[0] = '\0';
++ }
++
++ template<>
++ void
++ __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __timepunct_cache<char>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_c_locale_timepunct = _S_get_c_locale();
++
++ _M_data->_M_date_format = "%m/%d/%y";
++ _M_data->_M_date_era_format = "%m/%d/%y";
++ _M_data->_M_time_format = "%H:%M:%S";
++ _M_data->_M_time_era_format = "%H:%M:%S";
++ _M_data->_M_date_time_format = "";
++ _M_data->_M_date_time_era_format = "";
++ _M_data->_M_am = "AM";
++ _M_data->_M_pm = "PM";
++ _M_data->_M_am_pm_format = "";
++
++ // Day names, starting with "C"'s Sunday.
++ _M_data->_M_day1 = "Sunday";
++ _M_data->_M_day2 = "Monday";
++ _M_data->_M_day3 = "Tuesday";
++ _M_data->_M_day4 = "Wednesday";
++ _M_data->_M_day5 = "Thursday";
++ _M_data->_M_day6 = "Friday";
++ _M_data->_M_day7 = "Saturday";
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ _M_data->_M_aday1 = "Sun";
++ _M_data->_M_aday2 = "Mon";
++ _M_data->_M_aday3 = "Tue";
++ _M_data->_M_aday4 = "Wed";
++ _M_data->_M_aday5 = "Thu";
++ _M_data->_M_aday6 = "Fri";
++ _M_data->_M_aday7 = "Sat";
++
++ // Month names, starting with "C"'s January.
++ _M_data->_M_month01 = "January";
++ _M_data->_M_month02 = "February";
++ _M_data->_M_month03 = "March";
++ _M_data->_M_month04 = "April";
++ _M_data->_M_month05 = "May";
++ _M_data->_M_month06 = "June";
++ _M_data->_M_month07 = "July";
++ _M_data->_M_month08 = "August";
++ _M_data->_M_month09 = "September";
++ _M_data->_M_month10 = "October";
++ _M_data->_M_month11 = "November";
++ _M_data->_M_month12 = "December";
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ _M_data->_M_amonth01 = "Jan";
++ _M_data->_M_amonth02 = "Feb";
++ _M_data->_M_amonth03 = "Mar";
++ _M_data->_M_amonth04 = "Apr";
++ _M_data->_M_amonth05 = "May";
++ _M_data->_M_amonth06 = "Jun";
++ _M_data->_M_amonth07 = "Jul";
++ _M_data->_M_amonth08 = "Aug";
++ _M_data->_M_amonth09 = "Sep";
++ _M_data->_M_amonth10 = "Oct";
++ _M_data->_M_amonth11 = "Nov";
++ _M_data->_M_amonth12 = "Dec";
++ }
++ else
++ {
++ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
++
++ _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
++ _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
++ _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
++ _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
++ _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
++ _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
++ __cloc);
++ _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
++ _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
++ _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
++
++ // Day names, starting with "C"'s Sunday.
++ _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
++ _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
++ _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
++ _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
++ _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
++ _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
++ _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
++ _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
++ _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
++ _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
++ _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
++ _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
++ _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
++
++ // Month names, starting with "C"'s January.
++ _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
++ _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
++ _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
++ _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
++ _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
++ _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
++ _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
++ _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
++ _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
++ _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
++ _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
++ _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
++ _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
++ _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
++ _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
++ _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
++ _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
++ _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
++ _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
++ _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
++ _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
++ _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
++ _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
++ }
++ }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ void
++ __timepunct<wchar_t>::
++ _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
++ const tm* __tm) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
++ const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
++ _M_c_locale_timepunct);
++#else
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_timepunct);
++ const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ // Make sure __s is null terminated.
++ if (__len == 0)
++ __s[0] = L'\0';
++ }
++
++ template<>
++ void
++ __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __timepunct_cache<wchar_t>;
++
++#warning wide time stuff
++// if (!__cloc)
++ {
++ // "C" locale
++ _M_c_locale_timepunct = _S_get_c_locale();
++
++ _M_data->_M_date_format = L"%m/%d/%y";
++ _M_data->_M_date_era_format = L"%m/%d/%y";
++ _M_data->_M_time_format = L"%H:%M:%S";
++ _M_data->_M_time_era_format = L"%H:%M:%S";
++ _M_data->_M_date_time_format = L"";
++ _M_data->_M_date_time_era_format = L"";
++ _M_data->_M_am = L"AM";
++ _M_data->_M_pm = L"PM";
++ _M_data->_M_am_pm_format = L"";
++
++ // Day names, starting with "C"'s Sunday.
++ _M_data->_M_day1 = L"Sunday";
++ _M_data->_M_day2 = L"Monday";
++ _M_data->_M_day3 = L"Tuesday";
++ _M_data->_M_day4 = L"Wednesday";
++ _M_data->_M_day5 = L"Thursday";
++ _M_data->_M_day6 = L"Friday";
++ _M_data->_M_day7 = L"Saturday";
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ _M_data->_M_aday1 = L"Sun";
++ _M_data->_M_aday2 = L"Mon";
++ _M_data->_M_aday3 = L"Tue";
++ _M_data->_M_aday4 = L"Wed";
++ _M_data->_M_aday5 = L"Thu";
++ _M_data->_M_aday6 = L"Fri";
++ _M_data->_M_aday7 = L"Sat";
++
++ // Month names, starting with "C"'s January.
++ _M_data->_M_month01 = L"January";
++ _M_data->_M_month02 = L"February";
++ _M_data->_M_month03 = L"March";
++ _M_data->_M_month04 = L"April";
++ _M_data->_M_month05 = L"May";
++ _M_data->_M_month06 = L"June";
++ _M_data->_M_month07 = L"July";
++ _M_data->_M_month08 = L"August";
++ _M_data->_M_month09 = L"September";
++ _M_data->_M_month10 = L"October";
++ _M_data->_M_month11 = L"November";
++ _M_data->_M_month12 = L"December";
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ _M_data->_M_amonth01 = L"Jan";
++ _M_data->_M_amonth02 = L"Feb";
++ _M_data->_M_amonth03 = L"Mar";
++ _M_data->_M_amonth04 = L"Apr";
++ _M_data->_M_amonth05 = L"May";
++ _M_data->_M_amonth06 = L"Jun";
++ _M_data->_M_amonth07 = L"Jul";
++ _M_data->_M_amonth08 = L"Aug";
++ _M_data->_M_amonth09 = L"Sep";
++ _M_data->_M_amonth10 = L"Oct";
++ _M_data->_M_amonth11 = L"Nov";
++ _M_data->_M_amonth12 = L"Dec";
++ }
++#if 0
++ else
++ {
++ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
++
++ union { char *__s; wchar_t *__w; } __u;
++
++ __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
++ _M_data->_M_date_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
++ _M_data->_M_date_era_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
++ _M_data->_M_time_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
++ _M_data->_M_time_era_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
++ _M_data->_M_date_time_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
++ _M_data->_M_date_time_era_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
++ _M_data->_M_am = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
++ _M_data->_M_pm = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
++ _M_data->_M_am_pm_format = __u.__w;
++
++ // Day names, starting with "C"'s Sunday.
++ __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
++ _M_data->_M_day1 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
++ _M_data->_M_day2 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
++ _M_data->_M_day3 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
++ _M_data->_M_day4 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
++ _M_data->_M_day5 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
++ _M_data->_M_day6 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
++ _M_data->_M_day7 = __u.__w;
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
++ _M_data->_M_aday1 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
++ _M_data->_M_aday2 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
++ _M_data->_M_aday3 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
++ _M_data->_M_aday4 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
++ _M_data->_M_aday5 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
++ _M_data->_M_aday6 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
++ _M_data->_M_aday7 = __u.__w;
++
++ // Month names, starting with "C"'s January.
++ __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
++ _M_data->_M_month01 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
++ _M_data->_M_month02 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
++ _M_data->_M_month03 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
++ _M_data->_M_month04 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
++ _M_data->_M_month05 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
++ _M_data->_M_month06 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
++ _M_data->_M_month07 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
++ _M_data->_M_month08 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
++ _M_data->_M_month09 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
++ _M_data->_M_month10 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
++ _M_data->_M_month11 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
++ _M_data->_M_month12 = __u.__w;
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
++ _M_data->_M_amonth01 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
++ _M_data->_M_amonth02 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
++ _M_data->_M_amonth03 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
++ _M_data->_M_amonth04 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
++ _M_data->_M_amonth05 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
++ _M_data->_M_amonth06 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
++ _M_data->_M_amonth07 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
++ _M_data->_M_amonth08 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
++ _M_data->_M_amonth09 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
++ _M_data->_M_amonth10 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
++ _M_data->_M_amonth11 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
++ _M_data->_M_amonth12 = __u.__w;
++ }
++#endif // 0
++ }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.h b/libstdc++-v3/config/locale/uclibc/time_members.h
+new file mode 100644
+index 0000000..ba8e858
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/time_members.h
+@@ -0,0 +1,68 @@
++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.5.1.2 - time_get functions
++// ISO C++ 14882: 22.2.5.3.2 - time_put functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++ template<typename _CharT>
++ __timepunct<_CharT>::__timepunct(size_t __refs)
++ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
++ _M_name_timepunct(_S_get_c_name())
++ { _M_initialize_timepunct(); }
++
++ template<typename _CharT>
++ __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
++ : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
++ _M_name_timepunct(_S_get_c_name())
++ { _M_initialize_timepunct(); }
++
++ template<typename _CharT>
++ __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
++ size_t __refs)
++ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
++ _M_name_timepunct(__s)
++ {
++ char* __tmp = new char[std::strlen(__s) + 1];
++ std::strcpy(__tmp, __s);
++ _M_name_timepunct = __tmp;
++ _M_initialize_timepunct(__cloc);
++ }
++
++ template<typename _CharT>
++ __timepunct<_CharT>::~__timepunct()
++ {
++ if (_M_name_timepunct != _S_get_c_name())
++ delete [] _M_name_timepunct;
++ delete _M_data;
++ _S_destroy_c_locale(_M_c_locale_timepunct);
++ }
+diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
+index f40ddcf..c57a751 100755
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -15822,6 +15822,9 @@ fi
+ # Default to "generic".
+ if test $enable_clocale_flag = auto; then
+ case ${target_os} in
++ *-uclibc*)
++ enable_clocale_flag=uclibc
++ ;;
+ linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
+ enable_clocale_flag=gnu
+ ;;
+@@ -16079,6 +16082,78 @@ $as_echo "newlib" >&6; }
+ CTIME_CC=config/locale/generic/time_members.cc
+ CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
+ ;;
++ uclibc)
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: uclibc" >&5
++$as_echo "uclibc" >&6; }
++
++ # Declare intention to use gettext, and add support for specific
++ # languages.
++ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
++ ALL_LINGUAS="de fr"
++
++ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
++ # Extract the first word of "msgfmt", so it can be a program name with args.
++set dummy msgfmt; 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_check_msgfmt+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$check_msgfmt"; then
++ ac_cv_prog_check_msgfmt="$check_msgfmt" # 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_check_msgfmt="yes"
++ $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
++
++ test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
++fi
++fi
++check_msgfmt=$ac_cv_prog_check_msgfmt
++if test -n "$check_msgfmt"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_msgfmt" >&5
++$as_echo "$check_msgfmt" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
++ USE_NLS=yes
++ fi
++ # Export the build objects.
++ for ling in $ALL_LINGUAS; do \
++ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
++ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
++ done
++
++
++
++ CLOCALE_H=config/locale/uclibc/c_locale.h
++ CLOCALE_CC=config/locale/uclibc/c_locale.cc
++ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
++ CCOLLATE_CC=config/locale/uclibc/collate_members.cc
++ CCTYPE_CC=config/locale/uclibc/ctype_members.cc
++ CMESSAGES_H=config/locale/uclibc/messages_members.h
++ CMESSAGES_CC=config/locale/uclibc/messages_members.cc
++ CMONEY_CC=config/locale/uclibc/monetary_members.cc
++ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
++ CTIME_H=config/locale/uclibc/time_members.h
++ CTIME_CC=config/locale/uclibc/time_members.cc
++ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
++ ;;
+ esac
+
+ # This is where the testsuite looks for locale catalogs, using the
+diff --git a/libstdc++-v3/include/c_compatibility/wchar.h b/libstdc++-v3/include/c_compatibility/wchar.h
+index 580d725..3fe61b8 100644
+--- a/libstdc++-v3/include/c_compatibility/wchar.h
++++ b/libstdc++-v3/include/c_compatibility/wchar.h
+@@ -101,7 +101,9 @@ using std::wmemcmp;
+ using std::wmemcpy;
+ using std::wmemmove;
+ using std::wmemset;
++#if _GLIBCXX_HAVE_WCSFTIME
+ using std::wcsftime;
++#endif
+
+ #if _GLIBCXX_USE_C99
+ using std::wcstold;
+diff --git a/libstdc++-v3/include/c_std/cwchar b/libstdc++-v3/include/c_std/cwchar
+index 0e6b1fc..405aee2 100644
+--- a/libstdc++-v3/include/c_std/cwchar
++++ b/libstdc++-v3/include/c_std/cwchar
+@@ -175,7 +175,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ using ::wcscoll;
+ using ::wcscpy;
+ using ::wcscspn;
++#if _GLIBCXX_HAVE_WCSFTIME
+ using ::wcsftime;
++#endif
+ using ::wcslen;
+ using ::wcsncat;
+ using ::wcsncmp;
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0005-uclibc-locale-no__x.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0005-uclibc-locale-no__x.patch
new file mode 100644
index 000000000..dcbbfe454
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0005-uclibc-locale-no__x.patch
@@ -0,0 +1,257 @@
+From 6a3e8506a12c12728d8b29901defd738be43757f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:42:36 +0400
+Subject: [PATCH 05/35] uclibc-locale-no__x
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ .../config/locale/uclibc/c++locale_internal.h | 45 ++++++++++++++++++++
+ libstdc++-v3/config/locale/uclibc/c_locale.cc | 14 ------
+ libstdc++-v3/config/locale/uclibc/c_locale.h | 1 +
+ .../config/locale/uclibc/collate_members.cc | 7 ---
+ libstdc++-v3/config/locale/uclibc/ctype_members.cc | 7 ---
+ .../config/locale/uclibc/messages_members.cc | 7 +--
+ .../config/locale/uclibc/messages_members.h | 18 +++-----
+ .../config/locale/uclibc/monetary_members.cc | 4 --
+ .../config/locale/uclibc/numeric_members.cc | 3 --
+ libstdc++-v3/config/locale/uclibc/time_members.cc | 3 --
+ 10 files changed, 55 insertions(+), 54 deletions(-)
+
+diff --git a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+index 2ae3e4a..e74fddf 100644
+--- a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
++++ b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+@@ -60,4 +60,49 @@ extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
+ extern "C" __typeof(wctype_l) __wctype_l;
+ #endif
+
++# define __nl_langinfo_l nl_langinfo_l
++# define __strcoll_l strcoll_l
++# define __strftime_l strftime_l
++# define __strtod_l strtod_l
++# define __strtof_l strtof_l
++# define __strtold_l strtold_l
++# define __strxfrm_l strxfrm_l
++# define __newlocale newlocale
++# define __freelocale freelocale
++# define __duplocale duplocale
++# define __uselocale uselocale
++
++# ifdef _GLIBCXX_USE_WCHAR_T
++# define __iswctype_l iswctype_l
++# define __towlower_l towlower_l
++# define __towupper_l towupper_l
++# define __wcscoll_l wcscoll_l
++# define __wcsftime_l wcsftime_l
++# define __wcsxfrm_l wcsxfrm_l
++# define __wctype_l wctype_l
++# endif
++
++#else
++# define __nl_langinfo_l(N, L) nl_langinfo((N))
++# define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
++# define __strtod_l(S, E, L) strtod((S), (E))
++# define __strtof_l(S, E, L) strtof((S), (E))
++# define __strtold_l(S, E, L) strtold((S), (E))
++# define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
++# warning should dummy __newlocale check for C|POSIX ?
++# define __newlocale(a, b, c) NULL
++# define __freelocale(a) ((void)0)
++# define __duplocale(a) __c_locale()
++//# define __uselocale ?
++//
++# ifdef _GLIBCXX_USE_WCHAR_T
++# define __iswctype_l(C, M, L) iswctype((C), (M))
++# define __towlower_l(C, L) towlower((C))
++# define __towupper_l(C, L) towupper((C))
++# define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
++//# define __wcsftime_l(S, M, F, T, L) wcsftime((S), (M), (F), (T))
++# define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
++# define __wctype_l(S, L) wctype((S))
++# endif
++
+ #endif // GLIBC 2.3 and later
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.cc b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+index 5081dc1..21430d0 100644
+--- a/libstdc++-v3/config/locale/uclibc/c_locale.cc
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+@@ -39,20 +39,6 @@
+ #include <langinfo.h>
+ #include <bits/c++locale_internal.h>
+
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
+-#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
+-#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
+-#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
+-#define __strtof_l(S, E, L) strtof((S), (E))
+-#define __strtod_l(S, E, L) strtod((S), (E))
+-#define __strtold_l(S, E, L) strtold((S), (E))
+-#warning should dummy __newlocale check for C|POSIX ?
+-#define __newlocale(a, b, c) NULL
+-#define __freelocale(a) ((void)0)
+-#define __duplocale(a) __c_locale()
+-#endif
+-
+ namespace std
+ {
+ template<>
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.h b/libstdc++-v3/config/locale/uclibc/c_locale.h
+index da07c1f..4bca5f1 100644
+--- a/libstdc++-v3/config/locale/uclibc/c_locale.h
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.h
+@@ -68,6 +68,7 @@ namespace __gnu_cxx
+ {
+ extern "C" __typeof(uselocale) __uselocale;
+ }
++#define __uselocale uselocale
+ #endif
+
+ namespace std
+diff --git a/libstdc++-v3/config/locale/uclibc/collate_members.cc b/libstdc++-v3/config/locale/uclibc/collate_members.cc
+index c2664a7..ec5c329 100644
+--- a/libstdc++-v3/config/locale/uclibc/collate_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/collate_members.cc
+@@ -36,13 +36,6 @@
+ #include <locale>
+ #include <bits/c++locale_internal.h>
+
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
+-#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
+-#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
+-#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
+-#endif
+-
+ namespace std
+ {
+ // These are basically extensions to char_traits, and perhaps should
+diff --git a/libstdc++-v3/config/locale/uclibc/ctype_members.cc b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+index 7294e3a..7b12861 100644
+--- a/libstdc++-v3/config/locale/uclibc/ctype_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+@@ -38,13 +38,6 @@
+ #undef _LIBC
+ #include <bits/c++locale_internal.h>
+
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __wctype_l(S, L) wctype((S))
+-#define __towupper_l(C, L) towupper((C))
+-#define __towlower_l(C, L) towlower((C))
+-#define __iswctype_l(C, M, L) iswctype((C), (M))
+-#endif
+-
+ namespace std
+ {
+ // NB: The other ctype<char> specializations are in src/locale.cc and
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.cc b/libstdc++-v3/config/locale/uclibc/messages_members.cc
+index 13594d9..d7693b4 100644
+--- a/libstdc++-v3/config/locale/uclibc/messages_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.cc
+@@ -39,13 +39,10 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning fix gettext stuff
+ #endif
+-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
+-extern "C" char *__dcgettext(const char *domainname,
+- const char *msgid, int category);
+ #undef gettext
+-#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
+ #else
+-#undef gettext
+ #define gettext(msgid) (msgid)
+ #endif
+
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h
+index 1424078..d89da33 100644
+--- a/libstdc++-v3/config/locale/uclibc/messages_members.h
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h
+@@ -36,15 +36,11 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning fix prototypes for *textdomain funcs
+ #endif
+-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
+-extern "C" char *__textdomain(const char *domainname);
+-extern "C" char *__bindtextdomain(const char *domainname,
+- const char *dirname);
+-#else
+-#undef __textdomain
+-#undef __bindtextdomain
+-#define __textdomain(D) ((void)0)
+-#define __bindtextdomain(D,P) ((void)0)
++#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
++#undef textdomain
++#undef bindtextdomain
++#define textdomain(D) ((void)0)
++#define bindtextdomain(D,P) ((void)0)
+ #endif
+
+ // Non-virtual member functions.
+@@ -70,7 +66,7 @@ extern "C" char *__bindtextdomain(const char *domainname,
+ messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
+ const char* __dir) const
+ {
+- __bindtextdomain(__s.c_str(), __dir);
++ bindtextdomain(__s.c_str(), __dir);
+ return this->do_open(__s, __loc);
+ }
+
+@@ -90,7 +86,7 @@ extern "C" char *__bindtextdomain(const char *domainname,
+ {
+ // No error checking is done, assume the catalog exists and can
+ // be used.
+- __textdomain(__s.c_str());
++ textdomain(__s.c_str());
+ return 0;
+ }
+
+diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+index aa52731..2e6f80a 100644
+--- a/libstdc++-v3/config/locale/uclibc/monetary_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -43,10 +43,6 @@
+ #warning tailor for stub locale support
+ #endif
+
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __nl_langinfo_l(N, L) nl_langinfo((N))
+-#endif
+-
+ namespace std
+ {
+ // Construct and return valid pattern consisting of some combination of:
+diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+index 883ec1a..2c70642 100644
+--- a/libstdc++-v3/config/locale/uclibc/numeric_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -41,9 +41,6 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning tailor for stub locale support
+ #endif
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __nl_langinfo_l(N, L) nl_langinfo((N))
+-#endif
+
+ namespace std
+ {
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.cc b/libstdc++-v3/config/locale/uclibc/time_members.cc
+index e0707d7..d848ed5 100644
+--- a/libstdc++-v3/config/locale/uclibc/time_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/time_members.cc
+@@ -40,9 +40,6 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning tailor for stub locale support
+ #endif
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __nl_langinfo_l(N, L) nl_langinfo((N))
+-#endif
+
+ namespace std
+ {
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0006-uclibc-locale-wchar_fix.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0006-uclibc-locale-wchar_fix.patch
new file mode 100644
index 000000000..3406859e1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0006-uclibc-locale-wchar_fix.patch
@@ -0,0 +1,68 @@
+From 225511a3aeb193a916b3999f0b640a392caa67cd Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:45:57 +0400
+Subject: [PATCH 06/35] uclibc-locale-wchar_fix
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/config/locale/uclibc/monetary_members.cc | 4 ++--
+ libstdc++-v3/config/locale/uclibc/numeric_members.cc | 13 +++++++++++++
+ 2 files changed, 15 insertions(+), 2 deletions(-)
+
+diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+index 2e6f80a..31ebb9f 100644
+--- a/libstdc++-v3/config/locale/uclibc/monetary_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -401,7 +401,7 @@ namespace std
+ # ifdef __UCLIBC_HAS_XLOCALE__
+ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
+-# else
++# elif defined __UCLIBC_HAS_LOCALE__
+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
+ # endif
+@@ -556,7 +556,7 @@ namespace std
+ # ifdef __UCLIBC_HAS_XLOCALE__
+ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
+-# else
++# elif defined __UCLIBC_HAS_LOCALE__
+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
+ # endif
+diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+index 2c70642..d5c8961 100644
+--- a/libstdc++-v3/config/locale/uclibc/numeric_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -127,12 +127,25 @@ namespace std
+ {
+ // Named locale.
+ // NB: In the GNU model wchar_t is always 32 bit wide.
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this... should be numeric
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
++# elif defined __UCLIBC_HAS_LOCALE__
++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
+ union { char *__s; wchar_t __w; } __u;
+ __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
+ _M_data->_M_decimal_point = __u.__w;
+
+ __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
+ _M_data->_M_thousands_sep = __u.__w;
++#endif
+
+ if (_M_data->_M_thousands_sep == L'\0')
+ _M_data->_M_grouping = "";
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0007-uclibc-locale-update.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0007-uclibc-locale-update.patch
new file mode 100644
index 000000000..58511233d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0007-uclibc-locale-update.patch
@@ -0,0 +1,542 @@
+From 6ffe7c46f52d27864c3df3663e16ec9ddee71e8f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:46:58 +0400
+Subject: [PATCH 07/35] uclibc-locale-update
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ .../config/locale/uclibc/c++locale_internal.h | 3 +
+ libstdc++-v3/config/locale/uclibc/c_locale.cc | 74 +++++++++-----------
+ libstdc++-v3/config/locale/uclibc/c_locale.h | 42 ++++++-----
+ libstdc++-v3/config/locale/uclibc/ctype_members.cc | 51 ++++++++++----
+ .../config/locale/uclibc/messages_members.h | 12 ++--
+ .../config/locale/uclibc/monetary_members.cc | 34 +++++----
+ .../config/locale/uclibc/numeric_members.cc | 5 ++
+ libstdc++-v3/config/locale/uclibc/time_members.cc | 18 +++--
+ libstdc++-v3/config/locale/uclibc/time_members.h | 17 +++--
+ 9 files changed, 158 insertions(+), 98 deletions(-)
+
+diff --git a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+index e74fddf..971a6b4 100644
+--- a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
++++ b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+@@ -31,6 +31,9 @@
+
+ #include <bits/c++config.h>
+ #include <clocale>
++#include <cstdlib>
++#include <cstring>
++#include <cstddef>
+
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning clean this up
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.cc b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+index 21430d0..1b9d8e1 100644
+--- a/libstdc++-v3/config/locale/uclibc/c_locale.cc
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+@@ -39,23 +39,20 @@
+ #include <langinfo.h>
+ #include <bits/c++locale_internal.h>
+
+-namespace std
+-{
++_GLIBCXX_BEGIN_NAMESPACE(std)
++
+ template<>
+ void
+ __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
+ const __c_locale& __cloc)
+ {
+- if (!(__err & ios_base::failbit))
+- {
+- char* __sanity;
+- errno = 0;
+- float __f = __strtof_l(__s, &__sanity, __cloc);
+- if (__sanity != __s && errno != ERANGE)
+- __v = __f;
+- else
+- __err |= ios_base::failbit;
+- }
++ char* __sanity;
++ errno = 0;
++ float __f = __strtof_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __f;
++ else
++ __err |= ios_base::failbit;
+ }
+
+ template<>
+@@ -63,16 +60,13 @@ namespace std
+ __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
+ const __c_locale& __cloc)
+ {
+- if (!(__err & ios_base::failbit))
+- {
+- char* __sanity;
+- errno = 0;
+- double __d = __strtod_l(__s, &__sanity, __cloc);
+- if (__sanity != __s && errno != ERANGE)
+- __v = __d;
+- else
+- __err |= ios_base::failbit;
+- }
++ char* __sanity;
++ errno = 0;
++ double __d = __strtod_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __d;
++ else
++ __err |= ios_base::failbit;
+ }
+
+ template<>
+@@ -80,16 +74,13 @@ namespace std
+ __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
+ const __c_locale& __cloc)
+ {
+- if (!(__err & ios_base::failbit))
+- {
+- char* __sanity;
+- errno = 0;
+- long double __ld = __strtold_l(__s, &__sanity, __cloc);
+- if (__sanity != __s && errno != ERANGE)
+- __v = __ld;
+- else
+- __err |= ios_base::failbit;
+- }
++ char* __sanity;
++ errno = 0;
++ long double __ld = __strtold_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __ld;
++ else
++ __err |= ios_base::failbit;
+ }
+
+ void
+@@ -110,17 +101,18 @@ namespace std
+ void
+ locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
+ {
+- if (_S_get_c_locale() != __cloc)
++ if (__cloc && _S_get_c_locale() != __cloc)
+ __freelocale(__cloc);
+ }
+
+ __c_locale
+ locale::facet::_S_clone_c_locale(__c_locale& __cloc)
+ { return __duplocale(__cloc); }
+-} // namespace std
+
+-namespace __gnu_cxx
+-{
++_GLIBCXX_END_NAMESPACE
++
++_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
++
+ const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
+ {
+ "LC_CTYPE",
+@@ -138,9 +130,11 @@ namespace __gnu_cxx
+ "LC_IDENTIFICATION"
+ #endif
+ };
+-}
+
+-namespace std
+-{
++_GLIBCXX_END_NAMESPACE
++
++_GLIBCXX_BEGIN_NAMESPACE(std)
++
+ const char* const* const locale::_S_categories = __gnu_cxx::category_names;
+-} // namespace std
++
++_GLIBCXX_END_NAMESPACE
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.h b/libstdc++-v3/config/locale/uclibc/c_locale.h
+index 4bca5f1..64a6d46 100644
+--- a/libstdc++-v3/config/locale/uclibc/c_locale.h
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.h
+@@ -39,21 +39,23 @@
+ #pragma GCC system_header
+
+ #include <cstring> // get std::strlen
+-#include <cstdio> // get std::snprintf or std::sprintf
++#include <cstdio> // get std::vsnprintf or std::vsprintf
+ #include <clocale>
+ #include <langinfo.h> // For codecvt
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning fix this
+ #endif
+-#ifdef __UCLIBC_HAS_LOCALE__
++#ifdef _GLIBCXX_USE_ICONV
+ #include <iconv.h> // For codecvt using iconv, iconv_t
+ #endif
+-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
+-#include <libintl.h> // For messages
++#ifdef HAVE_LIBINTL_H
++#include <libintl.h> // For messages
+ #endif
++#include <cstdarg>
+
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning what is _GLIBCXX_C_LOCALE_GNU for
++// psm: used in os/gnu-linux/ctype_noninline.h
+ #endif
+ #define _GLIBCXX_C_LOCALE_GNU 1
+
+@@ -78,23 +80,25 @@ namespace std
+ #else
+ typedef int* __c_locale;
+ #endif
+-
+- // Convert numeric value of type _Tv to string and return length of
+- // string. If snprintf is available use it, otherwise fall back to
+- // the unsafe sprintf which, in general, can be dangerous and should
++ // Convert numeric value of type double to string and return length of
++ // string. If vsnprintf is available use it, otherwise fall back to
++ // the unsafe vsprintf which, in general, can be dangerous and should
+ // be avoided.
+- template<typename _Tv>
+- int
+- __convert_from_v(char* __out,
+- const int __size __attribute__ ((__unused__)),
+- const char* __fmt,
+-#ifdef __UCLIBC_HAS_XCLOCALE__
+- _Tv __v, const __c_locale& __cloc, int __prec)
++ inline int
++ __convert_from_v(const __c_locale&
++#ifndef __UCLIBC_HAS_XCLOCALE__
++ __cloc __attribute__ ((__unused__))
++#endif
++ ,
++ char* __out,
++ const int __size,
++ const char* __fmt, ...)
+ {
++ va_list __args;
++#ifdef __UCLIBC_HAS_XCLOCALE__
++
+ __c_locale __old = __gnu_cxx::__uselocale(__cloc);
+ #else
+- _Tv __v, const __c_locale&, int __prec)
+- {
+ # ifdef __UCLIBC_HAS_LOCALE__
+ char* __old = std::setlocale(LC_ALL, NULL);
+ char* __sav = new char[std::strlen(__old) + 1];
+@@ -103,7 +107,9 @@ namespace std
+ # endif
+ #endif
+
+- const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
++ va_start(__args, __fmt);
++ const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
++ va_end(__args);
+
+ #ifdef __UCLIBC_HAS_XCLOCALE__
+ __gnu_cxx::__uselocale(__old);
+diff --git a/libstdc++-v3/config/locale/uclibc/ctype_members.cc b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+index 7b12861..13e011d 100644
+--- a/libstdc++-v3/config/locale/uclibc/ctype_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+@@ -33,16 +33,20 @@
+
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+
++#include <features.h>
++#ifdef __UCLIBC_HAS_LOCALE__
+ #define _LIBC
+ #include <locale>
+ #undef _LIBC
++#else
++#include <locale>
++#endif
+ #include <bits/c++locale_internal.h>
+
+-namespace std
+-{
++_GLIBCXX_BEGIN_NAMESPACE(std)
++
+ // NB: The other ctype<char> specializations are in src/locale.cc and
+ // various /config/os/* files.
+- template<>
+ ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
+ : ctype<char>(0, false, __refs)
+ {
+@@ -57,6 +61,8 @@ namespace std
+ #endif
+ }
+ }
++ ctype_byname<char>::~ctype_byname()
++ { }
+
+ #ifdef _GLIBCXX_USE_WCHAR_T
+ ctype<wchar_t>::__wmask_type
+@@ -138,17 +144,33 @@ namespace std
+ ctype<wchar_t>::
+ do_is(mask __m, wchar_t __c) const
+ {
+- // Highest bitmask in ctype_base == 10, but extra in "C"
+- // library for blank.
++ // The case of __m == ctype_base::space is particularly important,
++ // due to its use in many istream functions. Therefore we deal with
++ // it first, exploiting the knowledge that on GNU systems _M_bit[5]
++ // is the mask corresponding to ctype_base::space. NB: an encoding
++ // change would not affect correctness!
++
+ bool __ret = false;
+- const size_t __bitmasksize = 11;
+- for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
+- if (__m & _M_bit[__bitcur]
+- && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
+- {
+- __ret = true;
+- break;
+- }
++ if (__m == _M_bit[5])
++ __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
++ else
++ {
++ // Highest bitmask in ctype_base == 10, but extra in "C"
++ // library for blank.
++ const size_t __bitmasksize = 11;
++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++ if (__m & _M_bit[__bitcur])
++ {
++ if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
++ {
++ __ret = true;
++ break;
++ }
++ else if (__m == _M_bit[__bitcur])
++ break;
++ }
++ }
++
+ return __ret;
+ }
+
+@@ -290,4 +312,5 @@ namespace std
+ #endif
+ }
+ #endif // _GLIBCXX_USE_WCHAR_T
+-}
++
++_GLIBCXX_END_NAMESPACE
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h
+index d89da33..067657a 100644
+--- a/libstdc++-v3/config/locale/uclibc/messages_members.h
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h
+@@ -53,12 +53,16 @@
+ template<typename _CharT>
+ messages<_CharT>::messages(__c_locale __cloc, const char* __s,
+ size_t __refs)
+- : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
+- _M_name_messages(__s)
++ : facet(__refs), _M_c_locale_messages(NULL),
++ _M_name_messages(NULL)
+ {
+- char* __tmp = new char[std::strlen(__s) + 1];
+- std::strcpy(__tmp, __s);
++ const size_t __len = std::strlen(__s) + 1;
++ char* __tmp = new char[__len];
++ std::memcpy(__tmp, __s, __len);
+ _M_name_messages = __tmp;
++
++ // Last to avoid leaking memory if new throws.
++ _M_c_locale_messages = _S_clone_c_locale(__cloc);
+ }
+
+ template<typename _CharT>
+diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+index 31ebb9f..7679b9c 100644
+--- a/libstdc++-v3/config/locale/uclibc/monetary_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -33,9 +33,14 @@
+
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+
++#include <features.h>
++#ifdef __UCLIBC_HAS_LOCALE__
+ #define _LIBC
+ #include <locale>
+ #undef _LIBC
++#else
++#include <locale>
++#endif
+ #include <bits/c++locale_internal.h>
+
+ #ifdef __UCLIBC_MJN3_ONLY__
+@@ -206,7 +211,7 @@ namespace std
+ }
+ break;
+ default:
+- ;
++ __ret = pattern();
+ }
+ return __ret;
+ }
+@@ -390,7 +395,9 @@ namespace std
+ __c_locale __old = __uselocale(__cloc);
+ #else
+ // Switch to named locale so that mbsrtowcs will work.
+- char* __old = strdup(setlocale(LC_ALL, NULL));
++ char* __old = setlocale(LC_ALL, NULL);
++ const size_t __llen = strlen(__old) + 1;
++ char* __sav = new char[__llen];
+ setlocale(LC_ALL, __name);
+ #endif
+
+@@ -477,8 +484,8 @@ namespace std
+ #ifdef __UCLIBC_HAS_XLOCALE__
+ __uselocale(__old);
+ #else
+- setlocale(LC_ALL, __old);
+- free(__old);
++ setlocale(LC_ALL, __sav);
++ delete [] __sav;
+ #endif
+ __throw_exception_again;
+ }
+@@ -498,8 +505,8 @@ namespace std
+ #ifdef __UCLIBC_HAS_XLOCALE__
+ __uselocale(__old);
+ #else
+- setlocale(LC_ALL, __old);
+- free(__old);
++ setlocale(LC_ALL, __sav);
++ delete [] __sav;
+ #endif
+ }
+ }
+@@ -545,8 +552,11 @@ namespace std
+ __c_locale __old = __uselocale(__cloc);
+ #else
+ // Switch to named locale so that mbsrtowcs will work.
+- char* __old = strdup(setlocale(LC_ALL, NULL));
+- setlocale(LC_ALL, __name);
++ char* __old = setlocale(LC_ALL, NULL);
++ const size_t __llen = strlen(__old) + 1;
++ char* __sav = new char[__llen];
++ memcpy(__sav, __old, __llen);
++ setlocale(LC_ALL, __name);
+ #endif
+
+ #ifdef __UCLIBC_MJN3_ONLY__
+@@ -633,8 +643,8 @@ namespace std
+ #ifdef __UCLIBC_HAS_XLOCALE__
+ __uselocale(__old);
+ #else
+- setlocale(LC_ALL, __old);
+- free(__old);
++ setlocale(LC_ALL, __sav);
++ delete [] __sav;
+ #endif
+ __throw_exception_again;
+ }
+@@ -653,8 +663,8 @@ namespace std
+ #ifdef __UCLIBC_HAS_XLOCALE__
+ __uselocale(__old);
+ #else
+- setlocale(LC_ALL, __old);
+- free(__old);
++ setlocale(LC_ALL, __sav);
++ delete [] __sav;
+ #endif
+ }
+ }
+diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+index d5c8961..8ae8969 100644
+--- a/libstdc++-v3/config/locale/uclibc/numeric_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -33,9 +33,14 @@
+
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+
++#include <features.h>
++#ifdef __UCLIBC_HAS_LOCALE__
+ #define _LIBC
+ #include <locale>
+ #undef _LIBC
++#else
++#include <locale>
++#endif
+ #include <bits/c++locale_internal.h>
+
+ #ifdef __UCLIBC_MJN3_ONLY__
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.cc b/libstdc++-v3/config/locale/uclibc/time_members.cc
+index d848ed5..f24d53e 100644
+--- a/libstdc++-v3/config/locale/uclibc/time_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/time_members.cc
+@@ -53,11 +53,14 @@ namespace std
+ const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
+ _M_c_locale_timepunct);
+ #else
+- char* __old = strdup(setlocale(LC_ALL, NULL));
++ char* __old = setlocale(LC_ALL, NULL);
++ const size_t __llen = strlen(__old) + 1;
++ char* __sav = new char[__llen];
++ memcpy(__sav, __old, __llen);
+ setlocale(LC_ALL, _M_name_timepunct);
+ const size_t __len = strftime(__s, __maxlen, __format, __tm);
+- setlocale(LC_ALL, __old);
+- free(__old);
++ setlocale(LC_ALL, __sav);
++ delete [] __sav;
+ #endif
+ // Make sure __s is null terminated.
+ if (__len == 0)
+@@ -207,11 +210,14 @@ namespace std
+ const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
+ _M_c_locale_timepunct);
+ #else
+- char* __old = strdup(setlocale(LC_ALL, NULL));
++ char* __old = setlocale(LC_ALL, NULL);
++ const size_t __llen = strlen(__old) + 1;
++ char* __sav = new char[__llen];
++ memcpy(__sav, __old, __llen);
+ setlocale(LC_ALL, _M_name_timepunct);
+ const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
+- setlocale(LC_ALL, __old);
+- free(__old);
++ setlocale(LC_ALL, __sav);
++ delete [] __sav;
+ #endif
+ // Make sure __s is null terminated.
+ if (__len == 0)
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.h b/libstdc++-v3/config/locale/uclibc/time_members.h
+index ba8e858..1665dde 100644
+--- a/libstdc++-v3/config/locale/uclibc/time_members.h
++++ b/libstdc++-v3/config/locale/uclibc/time_members.h
+@@ -50,12 +50,21 @@
+ __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
+ size_t __refs)
+ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
+- _M_name_timepunct(__s)
++ _M_name_timepunct(NULL)
+ {
+- char* __tmp = new char[std::strlen(__s) + 1];
+- std::strcpy(__tmp, __s);
++ const size_t __len = std::strlen(__s) + 1;
++ char* __tmp = new char[__len];
++ std::memcpy(__tmp, __s, __len);
+ _M_name_timepunct = __tmp;
+- _M_initialize_timepunct(__cloc);
++
++ try
++ { _M_initialize_timepunct(__cloc); }
++ catch(...)
++ {
++ delete [] _M_name_timepunct;
++ __throw_exception_again;
++ }
++
+ }
+
+ template<typename _CharT>
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0008-missing-execinfo_h.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0008-missing-execinfo_h.patch
new file mode 100644
index 000000000..282380934
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0008-missing-execinfo_h.patch
@@ -0,0 +1,28 @@
+From 9f2158451981cf0a80cfabdc79ae31bb6976a801 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:48:10 +0400
+Subject: [PATCH 08/35] missing-execinfo_h
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ boehm-gc/include/gc.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/boehm-gc/include/gc.h b/boehm-gc/include/gc.h
+index c51e017..a7ba8dc 100644
+--- a/boehm-gc/include/gc.h
++++ b/boehm-gc/include/gc.h
+@@ -503,7 +503,7 @@ GC_API GC_PTR GC_malloc_atomic_ignore_off_page GC_PROTO((size_t lb));
+ #if defined(__linux__) || defined(__GLIBC__)
+ # include <features.h>
+ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
+- && !defined(__ia64__)
++ && !defined(__ia64__) && !defined(__UCLIBC__)
+ # ifndef GC_HAVE_BUILTIN_BACKTRACE
+ # define GC_HAVE_BUILTIN_BACKTRACE
+ # endif
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0009-c99-snprintf.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0009-c99-snprintf.patch
new file mode 100644
index 000000000..7168778df
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0009-c99-snprintf.patch
@@ -0,0 +1,28 @@
+From e393e076f1ab82d25e1aa04d6edea27b41d3eb06 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 09/35] 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 e85bd83..6af839a 100644
+--- a/libstdc++-v3/include/c_std/cstdio
++++ b/libstdc++-v3/include/c_std/cstdio
+@@ -139,7 +139,7 @@ namespace std
+ using ::vsprintf;
+ } // namespace std
+
+-#if _GLIBCXX_USE_C99
++#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
+
+ #undef snprintf
+ #undef vfscanf
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0010-c99-complex-ugly-hack.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0010-c99-complex-ugly-hack.patch
new file mode 100644
index 000000000..b628571e5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0010-c99-complex-ugly-hack.patch
@@ -0,0 +1,29 @@
+From 73f69d806e2c9561a54995223431a1076cfd6164 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:49:57 +0400
+Subject: [PATCH 10/35] c99-complex-ugly-hack
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ libstdc++-v3/configure | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
+index c57a751..a1333e2 100755
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -18734,6 +18734,9 @@ $as_echo_n "checking for ISO C99 support to TR1 in <complex.h>... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+ #include <complex.h>
++#ifdef __UCLIBC__
++#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
++#endif
+ int
+ main ()
+ {
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0011-index_macro.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0011-index_macro.patch
new file mode 100644
index 000000000..8ee79b09b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0011-index_macro.patch
@@ -0,0 +1,44 @@
+From b037953e40312b45ab84ed0a3ad882bb5e413101 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:51:02 +0400
+Subject: [PATCH 11/35] index_macro
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/include/ext/rope | 3 +++
+ libstdc++-v3/include/ext/ropeimpl.h | 3 +++
+ 2 files changed, 6 insertions(+)
+
+diff --git a/libstdc++-v3/include/ext/rope b/libstdc++-v3/include/ext/rope
+index 38eb1e8..158d21a 100644
+--- a/libstdc++-v3/include/ext/rope
++++ b/libstdc++-v3/include/ext/rope
+@@ -55,6 +55,9 @@
+ #include <bits/gthr.h>
+ #include <tr1/functional>
+
++/* cope w/ index defined as macro, SuSv3 proposal */
++#undef index
++
+ # ifdef __GC
+ # define __GC_CONST const
+ # else
+diff --git a/libstdc++-v3/include/ext/ropeimpl.h b/libstdc++-v3/include/ext/ropeimpl.h
+index d7b5cbd..b9b3acb 100644
+--- a/libstdc++-v3/include/ext/ropeimpl.h
++++ b/libstdc++-v3/include/ext/ropeimpl.h
+@@ -48,6 +48,9 @@
+ #include <ext/memory> // For uninitialized_copy_n
+ #include <ext/numeric> // For power
+
++/* cope w/ index defined as macro, SuSv3 proposal */
++#undef index
++
+ namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
+ {
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0013-libstdc-namespace.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0013-libstdc-namespace.patch
new file mode 100644
index 000000000..4a3efdebd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0013-libstdc-namespace.patch
@@ -0,0 +1,54 @@
+From 104e4d66208f2726b14d2f5eebce90700cbc83c8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:54:02 +0400
+Subject: [PATCH 13/35] libstdc++-namespace
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/config/locale/uclibc/messages_members.h | 4 +++-
+ libstdc++-v3/config/locale/uclibc/time_members.h | 4 +++-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h
+index 067657a..dd76a6c 100644
+--- a/libstdc++-v3/config/locale/uclibc/messages_members.h
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h
+@@ -32,7 +32,8 @@
+ //
+
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+-
++namespace std
++{
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning fix prototypes for *textdomain funcs
+ #endif
+@@ -116,3 +117,4 @@
+ this->_S_create_c_locale(this->_M_c_locale_messages, __s);
+ }
+ }
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.h b/libstdc++-v3/config/locale/uclibc/time_members.h
+index 1665dde..905c433 100644
+--- a/libstdc++-v3/config/locale/uclibc/time_members.h
++++ b/libstdc++-v3/config/locale/uclibc/time_members.h
+@@ -33,7 +33,8 @@
+ //
+
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+-
++namespace std
++{
+ template<typename _CharT>
+ __timepunct<_CharT>::__timepunct(size_t __refs)
+ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
+@@ -75,3 +76,4 @@
+ delete _M_data;
+ _S_destroy_c_locale(_M_c_locale_timepunct);
+ }
++}
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0014-sh-pr24836.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0014-sh-pr24836.patch
new file mode 100644
index 000000000..cb8fd525b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0014-sh-pr24836.patch
@@ -0,0 +1,45 @@
+From edc9acb181810f234b6b9f7d2820b0e4f6a1eeaf Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:54:48 +0400
+Subject: [PATCH 14/35] sh-pr24836
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+
+http://sourceforge.net/mailarchive/forum.php?thread_id=8959304&forum_id=5348
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24836
+---
+ gcc/configure | 2 +-
+ gcc/configure.ac | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gcc/configure b/gcc/configure
+index e12a180..135bbf5 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -23378,7 +23378,7 @@ foo: .long 25
+ tls_first_minor=14
+ tls_as_opt="-m64 -Aesame --fatal-warnings"
+ ;;
+- sh-*-* | sh[34]-*-*)
++ sh-*-* | sh[34]*-*-*)
+ conftest_s='
+ .section ".tdata","awT",@progbits
+ foo: .long 25
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index eba3577..6363a21 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -3141,7 +3141,7 @@ foo: .long 25
+ tls_first_minor=14
+ tls_as_opt="-m64 -Aesame --fatal-warnings"
+ ;;
+- sh-*-* | sh[34]-*-*)
++ sh-*-* | sh[34]*-*-*)
+ conftest_s='
+ .section ".tdata","awT",@progbits
+ foo: .long 25
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch
new file mode 100644
index 000000000..37c46fc2e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch
@@ -0,0 +1,47 @@
+From 50e5366005b0f6af27378e2a5c3cb9f9936a7e62 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:58:36 +0400
+Subject: [PATCH 15/35] arm: Use TARGET_ENDIAN_OPTION for determining
+ MULTILIB_DEFAULTS
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/config/arm/linux-elf.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: gcc-4.9.2/gcc/config/arm/coff.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/config/arm/coff.h
++++ gcc-4.9.2/gcc/config/arm/coff.h
+@@ -32,8 +32,11 @@
+ #define TARGET_DEFAULT (MASK_APCS_FRAME)
+
+ #ifndef MULTILIB_DEFAULTS
++#ifndef TARGET_ENDIAN_OPTION
++#define TARGET_ENDIAN_OPTION "mlittle-endian"
++#endif
+ #define MULTILIB_DEFAULTS \
+- { "marm", "mlittle-endian", "mfloat-abi=soft", "mno-thumb-interwork" }
++ { "marm", TARGET_ENDIAN_OPTION, "mfloat-abi=soft", "mno-thumb-interwork" }
+ #endif
+
+ /* This is COFF, but prefer stabs. */
+Index: gcc-4.9.2/gcc/config/arm/elf.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/config/arm/elf.h
++++ gcc-4.9.2/gcc/config/arm/elf.h
+@@ -116,8 +116,11 @@
+ #endif
+
+ #ifndef MULTILIB_DEFAULTS
++#ifndef TARGET_ENDIAN_OPTION
++#define TARGET_ENDIAN_OPTION "mlittle-endian"
++#endif
+ #define MULTILIB_DEFAULTS \
+- { "marm", "mlittle-endian", "mfloat-abi=soft", "mno-thumb-interwork", "fno-leading-underscore" }
++ { "marm", TARGET_ENDIAN_OPTION, "mfloat-abi=soft", "mno-thumb-interwork", "fno-leading-underscore" }
+ #endif
+
+ #define TARGET_ASM_FILE_START_APP_OFF true
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0016-gcc-poison-system-directories.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0016-gcc-poison-system-directories.patch
new file mode 100644
index 000000000..475ef96b9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0016-gcc-poison-system-directories.patch
@@ -0,0 +1,190 @@
+From 160397ef3c3331099af028f1b8d3e085b07d88ad 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 16/35] gcc: poison-system-directories
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [distribution: codesourcery]
+---
+ gcc/Makefile.in | 2 +-
+ gcc/common.opt | 4 ++++
+ gcc/config.in | 6 ++++++
+ gcc/configure | 20 ++++++++++++++++++--
+ gcc/configure.ac | 10 ++++++++++
+ gcc/doc/invoke.texi | 9 +++++++++
+ gcc/gcc.c | 2 ++
+ gcc/incpath.c | 19 +++++++++++++++++++
+ 8 files changed, 69 insertions(+), 3 deletions(-)
+
+Index: gcc-4.9-20140316/gcc/common.opt
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/common.opt
++++ gcc-4.9-20140316/gcc/common.opt
+@@ -603,6 +603,10 @@ Wpedantic
+ Common Var(pedantic) Warning
+ Issue warnings needed for strict compliance to the standard
+
++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 local variable shadows another
+Index: gcc-4.9-20140316/gcc/config.in
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/config.in
++++ gcc-4.9-20140316/gcc/config.in
+@@ -138,6 +138,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. */
+Index: gcc-4.9-20140316/gcc/configure
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/configure
++++ gcc-4.9-20140316/gcc/configure
+@@ -928,6 +928,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
+@@ -1648,6 +1649,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
+@@ -27702,6 +27705,19 @@ if test "${enable_version_specific_runti
+ 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
+
+
+Index: gcc-4.9-20140316/gcc/configure.ac
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/configure.ac
++++ gcc-4.9-20140316/gcc/configure.ac
+@@ -5366,6 +5366,16 @@ AC_ARG_ENABLE(version-specific-runtime-l
+ [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)
+Index: gcc-4.9-20140316/gcc/doc/invoke.texi
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/doc/invoke.texi
++++ gcc-4.9-20140316/gcc/doc/invoke.texi
+@@ -260,6 +260,7 @@ Objective-C and Objective-C++ Dialects}.
+ -Woverlength-strings -Wpacked -Wpacked-bitfield-compat -Wpadded @gol
+ -Wparentheses -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
+ -Wpointer-arith -Wno-pointer-to-int-cast @gol
++-Wno-poison-system-directories @gol
+ -Wredundant-decls -Wno-return-local-addr @gol
+ -Wreturn-type -Wsequence-point -Wshadow @gol
+ -Wsign-compare -Wsign-conversion -Wfloat-conversion @gol
+@@ -4230,6 +4231,14 @@ headers---for that, @option{-Wunknown-pr
+ 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
+Index: gcc-4.9-20140316/gcc/gcc.c
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/gcc.c
++++ gcc-4.9-20140316/gcc/gcc.c
+@@ -764,6 +764,8 @@ proper position among the other output f
+ "%{fuse-ld=*:-fuse-ld=%*}\
+ %X %{o*} %{e*} %{N} %{n} %{r}\
+ %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} " VTABLE_VERIFICATION_SPEC " \
++ %{Wno-poison-system-directories:--no-poison-system-directories}\
++ %{Werror=poison-system-directories:--error-poison-system-directories}\
+ %{static:} %{L*} %(mfwrap) %(link_libgcc) " SANITIZER_EARLY_SPEC " %o\
+ %{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)}\
+ %{fgnu-tm:%:include(libitm.spec)%(link_itm)}\
+Index: gcc-4.9-20140316/gcc/incpath.c
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/incpath.c
++++ gcc-4.9-20140316/gcc/incpath.c
+@@ -28,6 +28,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 *sysroo
+ }
+ 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
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0017-gcc-poison-dir-extend.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0017-gcc-poison-dir-extend.patch
new file mode 100644
index 000000000..9e81efd4d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0017-gcc-poison-dir-extend.patch
@@ -0,0 +1,39 @@
+From e99c9c97266d6d3e8cac798aa91408250c4d60cf 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 17/35] 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 cd41c78..eac4a92 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",
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch
new file mode 100644
index 000000000..a28cafdf9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch
@@ -0,0 +1,73 @@
+From 56207fa2923e8edf774e98ffac82666091076be3 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 18/35] 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 1b76c90..e4dce7c 100755
+--- a/configure
++++ b/configure
+@@ -6772,6 +6772,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
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0019-64-bit-multilib-hack.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0019-64-bit-multilib-hack.patch
new file mode 100644
index 000000000..058be0c40
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0019-64-bit-multilib-hack.patch
@@ -0,0 +1,82 @@
+From 18fde5740b09324dfb9cf41e9849672573ff5fa0 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 19/35] 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(-)
+
+Index: gcc-4.9-20140316/gcc/config/i386/t-linux64
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/config/i386/t-linux64
++++ gcc-4.9-20140316/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))
+Index: gcc-4.9-20140316/gcc/config/mips/t-linux64
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/config/mips/t-linux64
++++ gcc-4.9-20140316/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))
++
+Index: gcc-4.9-20140316/gcc/config/rs6000/t-linux64
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/config/rs6000/t-linux64
++++ gcc-4.9-20140316/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) $<
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0020-optional-libstdc.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0020-optional-libstdc.patch
new file mode 100644
index 000000000..5b466140d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0020-optional-libstdc.patch
@@ -0,0 +1,98 @@
+From 307c8ff3ef666b7bd5ac733863f2fbb27a9d521e 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 20/35] 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 | 9 +++++++--
+ gcc/gcc.c | 1 +
+ 4 files changed, 13 insertions(+), 2 deletions(-)
+
+Index: gcc-4.9-20140316/gcc/c-family/c.opt
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/c-family/c.opt
++++ gcc-4.9-20140316/gcc/c-family/c.opt
+@@ -1323,6 +1323,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
+Index: gcc-4.9-20140316/gcc/cp/g++spec.c
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/cp/g++spec.c
++++ gcc-4.9-20140316/gcc/cp/g++spec.c
+@@ -138,6 +138,7 @@ lang_specific_driver (struct cl_decoded_
+ switch (decoded_options[i].opt_index)
+ {
+ case OPT_nostdlib:
++ case OPT_nostdlib__:
+ case OPT_nodefaultlibs:
+ library = -1;
+ break;
+Index: gcc-4.9-20140316/gcc/doc/invoke.texi
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/doc/invoke.texi
++++ gcc-4.9-20140316/gcc/doc/invoke.texi
+@@ -193,6 +193,7 @@ in the following sections.
+ -fvisibility-inlines-hidden @gol
+ -fvtable-verify=@var{std|preinit|none} @gol
+ -fvtv-counts -fvtv-debug @gol
++-nostdlib++ @gol
+ -fvisibility-ms-compat @gol
+ -fext-numeric-literals @gol
+ -Wabi -Wconversion-null -Wctor-dtor-privacy @gol
+@@ -457,7 +458,7 @@ Objective-C and Objective-C++ Dialects}.
+ -nostartfiles -nodefaultlibs -nostdlib -pie -rdynamic @gol
+ -s -static -static-libgcc -static-libstdc++ @gol
+ -static-libasan -static-libtsan -static-liblsan -static-libubsan @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}}
+
+@@ -10285,6 +10286,11 @@ These entries are usually resolved by en
+ libc. These entry points should be supplied through some other
+ mechanism when this option is specified.
+
++@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}
+Index: gcc-4.9-20140316/gcc/gcc.c
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/gcc.c
++++ gcc-4.9-20140316/gcc/gcc.c
+@@ -772,6 +772,7 @@ proper position among the other output f
+ %(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*} }}}}}}"
+ #endif
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch
new file mode 100644
index 000000000..eb3c61f12
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch
@@ -0,0 +1,59 @@
+From 004696e054ae9dc71d512cc755ccc4074fc62b2d 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 21/35] 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 b65d21d..bdab45a 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -25829,13 +25829,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 e226b85..5f5c909 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -4099,13 +4099,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],
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0022-COLLECT_GCC_OPTIONS.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0022-COLLECT_GCC_OPTIONS.patch
new file mode 100644
index 000000000..40c8abffa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0022-COLLECT_GCC_OPTIONS.patch
@@ -0,0 +1,38 @@
+From 7f5c9dcc71c8b83a0b5596266cc4bdf0936e8e00 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 22/35] 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 477752f..51062aa 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -4098,6 +4098,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;
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
new file mode 100644
index 000000000..fddfe9e5e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
@@ -0,0 +1,96 @@
+From f7d49ca445e60faa1b5256c6b4f96c1ee5c0e353 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 23/35] 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 d1ab22f..15fe4b6 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -483,7 +483,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 5399b2b..60a04bd 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -11631,8 +11631,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 f87c3b6..460e0d9 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -1740,8 +1740,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 c7146ed..b153f45 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
+@@ -106,7 +106,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.
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0025-fortran-cross-compile-hack.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0025-fortran-cross-compile-hack.patch
new file mode 100644
index 000000000..0e7914d5c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0025-fortran-cross-compile-hack.patch
@@ -0,0 +1,46 @@
+From af8a56ea4e17b2909eff2c57704ab43ef24f28d3 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 25/35] 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 8385e96..b8f7a92 100755
+--- a/libgfortran/configure
++++ b/libgfortran/configure
+@@ -12704,7 +12704,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 7d97fed..3f9f484 100644
+--- a/libgfortran/configure.ac
++++ b/libgfortran/configure.ac
+@@ -227,7 +227,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
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0026-libgcc-sjlj-check.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0026-libgcc-sjlj-check.patch
new file mode 100644
index 000000000..d4efab956
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0026-libgcc-sjlj-check.patch
@@ -0,0 +1,74 @@
+From 08c2398445e6cac282488f64ae6bf29cbcd8db23 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:20:50 +0400
+Subject: [PATCH 26/35] libgcc-sjlj-check
+
+ac_fn_c_try_compile doesnt seem to keep the intermediate files
+which are needed for sjlj test to pass since it greps into the
+generated file. So we run the compiler command using AC_TRY_COMMAND
+which then generates the needed .s file
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libgcc/configure | 10 ++++++----
+ libgcc/configure.ac | 10 ++++------
+ 2 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/libgcc/configure b/libgcc/configure
+index 1425df6..d18e3cb 100644
+--- a/libgcc/configure
++++ b/libgcc/configure
+@@ -4208,17 +4208,19 @@ void foo ()
+ }
+
+ _ACEOF
+-CFLAGS_hold=$CFLAGS
+-CFLAGS="--save-temps -fexceptions"
+ libgcc_cv_lib_sjlj_exceptions=unknown
+-if ac_fn_c_try_compile; then :
++if { ac_try='${CC-cc} -fexceptions -S conftest.c -o conftest.s 1>&5'
++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }; }; then
+ if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
+ libgcc_cv_lib_sjlj_exceptions=yes
+ elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then
+ libgcc_cv_lib_sjlj_exceptions=no
+ fi
+ fi
+-CFLAGS=$CFLAGS_hold
+ rm -f conftest*
+
+ fi
+diff --git a/libgcc/configure.ac b/libgcc/configure.ac
+index 8b7aba5..c7c9644 100644
+--- a/libgcc/configure.ac
++++ b/libgcc/configure.ac
+@@ -216,16 +216,14 @@ void foo ()
+ bar();
+ }
+ ])])
+-CFLAGS_hold=$CFLAGS
+-CFLAGS="--save-temps -fexceptions"
+ libgcc_cv_lib_sjlj_exceptions=unknown
+-AS_IF([ac_fn_c_try_compile],
+- [if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
++if AC_TRY_COMMAND(${CC-cc} -fexceptions -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
++ if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
+ libgcc_cv_lib_sjlj_exceptions=yes
+ elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then
+ libgcc_cv_lib_sjlj_exceptions=no
+- fi])
+-CFLAGS=$CFLAGS_hold
++ fi
++fi
+ rm -f conftest*
+ ])
+
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0027-cpp-honor-sysroot.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0027-cpp-honor-sysroot.patch
new file mode 100644
index 000000000..05e95219f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0027-cpp-honor-sysroot.patch
@@ -0,0 +1,54 @@
+From a0f9bd09c816ad29ecf7c29d6c27f7df97710364 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 27/35] 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 a001c3e..1aae1e4 100644
+--- a/gcc/cp/lang-specs.h
++++ b/gcc/cp/lang-specs.h
+@@ -63,5 +63,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 51062aa..cf6b99e 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -1042,7 +1042,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},
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0028-MIPS64-Default-to-N64-ABI.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0028-MIPS64-Default-to-N64-ABI.patch
new file mode 100644
index 000000000..263872069
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0028-MIPS64-Default-to-N64-ABI.patch
@@ -0,0 +1,31 @@
+From 301e18d4711db5925e767fad08dffa9cfe0a2f1f 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 28/35] 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 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gcc/config.gcc b/gcc/config.gcc
+index 1a0be50..989c2fb 100644
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -1797,7 +1797,7 @@ mips*-mti-linux*)
+ mips64*-*-linux* | mipsisa64*-*-linux*)
+ tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/gnu-user64.h mips/linux64.h mips/linux-common.h"
+ tmake_file="${tmake_file} mips/t-linux64"
+- tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_N32"
++ tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_64"
+ case ${target} in
+ mips64el-st-linux-gnu)
+ tm_file="${tm_file} mips/st.h"
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
new file mode 100644
index 000000000..969d290ad
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
@@ -0,0 +1,228 @@
+From 29d12344fb682a053de53eb08b95704cf3b67af2 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 29/35] 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/mips/linux.h | 2 +-
+ gcc/config/mips/linux64.h | 8 ++++----
+ gcc/config/rs6000/linux64.h | 8 ++++----
+ gcc/config/sh/linux.h | 2 +-
+ gcc/config/sparc/linux.h | 2 +-
+ gcc/config/sparc/linux64.h | 4 ++--
+ 11 files changed, 22 insertions(+), 22 deletions(-)
+
+Index: gcc-4.9.0/gcc/config/alpha/linux-elf.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/alpha/linux-elf.h 2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/alpha/linux-elf.h 2014-05-07 16:43:50.605106535 +0000
+@@ -23,8 +23,8 @@
+ #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
+Index: gcc-4.9.0/gcc/config/arm/linux-eabi.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/arm/linux-eabi.h 2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/arm/linux-eabi.h 2014-05-07 16:43:50.605106535 +0000
+@@ -68,8 +68,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 \
+Index: gcc-4.9.0/gcc/config/arm/linux-elf.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/arm/linux-elf.h 2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/arm/linux-elf.h 2014-05-07 16:43:50.605106535 +0000
+@@ -57,7 +57,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} \
+Index: gcc-4.9.0/gcc/config/i386/linux.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/i386/linux.h 2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/i386/linux.h 2014-05-07 16:43:50.605106535 +0000
+@@ -20,4 +20,4 @@
+ <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"
+Index: gcc-4.9.0/gcc/config/i386/linux64.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/i386/linux64.h 2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/i386/linux64.h 2014-05-07 16:43:50.605106535 +0000
+@@ -27,6 +27,6 @@
+ #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"
+Index: gcc-4.9.0/gcc/config/mips/linux.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/mips/linux.h 2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/mips/linux.h 2014-05-07 16:43:50.605106535 +0000
+@@ -18,8 +18,8 @@
+ <http://www.gnu.org/licenses/>. */
+
+ #define GLIBC_DYNAMIC_LINKER \
+- "%{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}"
+
+ #undef UCLIBC_DYNAMIC_LINKER
+ #define UCLIBC_DYNAMIC_LINKER \
+- "%{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}"
+Index: gcc-4.9.0/gcc/config/mips/linux64.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/mips/linux64.h 2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/mips/linux64.h 2014-05-07 16:43:50.605106535 +0000
+@@ -23,20 +23,20 @@
+ #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}"
+
+ #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
+ #define GNU_USER_DYNAMIC_LINKERN32 \
+Index: gcc-4.9.0/gcc/config/rs6000/linux64.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/rs6000/linux64.h 2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/rs6000/linux64.h 2014-05-07 16:43:50.605106535 +0000
+@@ -367,14 +367,14 @@
+ #undef LINK_OS_DEFAULT_SPEC
+ #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
+
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
++#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld.so.1"
+ #ifdef LINUX64_DEFAULT_ABI_ELFv2
+-#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv1:/lib64/ld64.so.1;:/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:/lib64/ld64.so.2;:/lib64/ld64.so.1}"
++#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv2:" SYSTEMLIBS_DIR "ld64.so.2;:" SYSTEMLIBS_DIR "ld64.so.1}"
+ #endif
+-#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) "%{mglibc:" G ";:" U "}"
+ #elif DEFAULT_LIBC == LIBC_GLIBC
+Index: gcc-4.9.0/gcc/config/sh/linux.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/sh/linux.h 2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/sh/linux.h 2014-05-07 16:43:50.605106535 +0000
+@@ -43,7 +43,7 @@
+
+ #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
+
+-#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 "_linux"
+Index: gcc-4.9.0/gcc/config/sparc/linux.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/sparc/linux.h 2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/sparc/linux.h 2014-05-07 16:43:50.605106535 +0000
+@@ -83,7 +83,7 @@
+ 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} \
+Index: gcc-4.9.0/gcc/config/sparc/linux64.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/sparc/linux64.h 2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/sparc/linux64.h 2014-05-07 16:43:50.605106535 +0000
+@@ -92,8 +92,8 @@
+ 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
+
+Index: gcc-4.9.0/gcc/config/linux.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/linux.h 2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/linux.h 2014-05-07 16:43:50.605106535 +0000
+@@ -73,10 +73,10 @@
+ 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/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0030-gcc-Fix-argument-list-too-long-error.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0030-gcc-Fix-argument-list-too-long-error.patch
new file mode 100644
index 000000000..2ceaff64f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0030-gcc-Fix-argument-list-too-long-error.patch
@@ -0,0 +1,40 @@
+From c1816c160156f99c34e6a0a0311bb0219326804e 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 30/35] 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 2320497..8562a62 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -4627,7 +4627,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) | tr ' ' '\012' | sort -u`; \
++ headers="$(sort $(PLUGIN_HEADERS))"; \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`; \
+ for file in $$headers; do \
+ if [ -f $$file ] ; then \
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0031-Disable-sdt.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0031-Disable-sdt.patch
new file mode 100644
index 000000000..2c1d5e086
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0031-Disable-sdt.patch
@@ -0,0 +1,113 @@
+From b85265bc94ec1beaf1d3b697c03db62991553467 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 31/35] 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 3c550a6..01c7626 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -26812,12 +26812,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 3601ab6..06e501f 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -4779,15 +4779,15 @@ if test x$gcc_cv_libc_provides_ssp = xyes; then
+ fi
+
+ # 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 4953c9f..53a1145 100755
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -20578,11 +20578,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 73d430a..f2135e2 100644
+--- a/libstdc++-v3/configure.ac
++++ b/libstdc++-v3/configure.ac
+@@ -211,7 +211,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 \
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0032-libtool.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0032-libtool.patch
new file mode 100644
index 000000000..3b3d1b621
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0032-libtool.patch
@@ -0,0 +1,42 @@
+From 6c715fcfa262adadca81c68a1f3f69aa3187a501 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 32/35] 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 a03433f..46f47c2 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
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch
new file mode 100644
index 000000000..b236c37a5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch
@@ -0,0 +1,40 @@
+From 97e4591c20310425e7aca0e6712a8d9480e7744c 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 33/35] 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(-)
+
+Index: gcc-4.9-20140316/gcc/config/arm/linux-eabi.h
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/config/arm/linux-eabi.h
++++ gcc-4.9-20140316/gcc/config/arm/linux-eabi.h
+@@ -77,10 +77,14 @@
+ %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \
+ %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}"
+
++/* 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)
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch
new file mode 100644
index 000000000..66b9f89a1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch
@@ -0,0 +1,102 @@
+From fc5e4beaea856a2b486c770ad3addc0f5bb3100e 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 34/35] 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 8bc0c98..3cd0817 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -11519,10 +11519,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_}"
+
+@@ -11533,6 +11543,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 5e5e84f..415a6df 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -1700,10 +1700,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_}"
+
+@@ -1714,6 +1724,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"
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0040-fix-g++-sysroot.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0040-fix-g++-sysroot.patch
new file mode 100644
index 000000000..d50aa5c9b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0040-fix-g++-sysroot.patch
@@ -0,0 +1,40 @@
+Portions of
+
+http://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg26013.html
+
+are not upstreamed yet. So lets keep missing pieces.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: gcc-4.8.1/gcc/configure.ac
+===================================================================
+--- gcc-4.8.1.orig/gcc/configure.ac 2013-07-15 15:55:49.488399132 -0700
++++ gcc-4.8.1/gcc/configure.ac 2013-07-15 16:02:31.772406679 -0700
+@@ -148,7 +148,9 @@
+ if test "${with_sysroot+set}" = set; then
+ gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'`
+ if test "${gcc_gxx_without_sysroot}"; then
+- gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++ if test x${with_sysroot} != x/; then
++ gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++ fi
+ gcc_gxx_include_dir_add_sysroot=1
+ fi
+ fi
+Index: gcc-4.8.1/gcc/configure
+===================================================================
+--- gcc-4.8.1.orig/gcc/configure 2013-07-15 15:55:49.472399132 -0700
++++ gcc-4.8.1/gcc/configure 2013-07-15 16:02:31.780406680 -0700
+@@ -3325,7 +3325,9 @@
+ if test "${with_sysroot+set}" = set; then
+ gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'`
+ if test "${gcc_gxx_without_sysroot}"; then
+- gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++ if test x${with_sysroot} != x/; then
++ gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++ fi
+ gcc_gxx_include_dir_add_sysroot=1
+ fi
+ fi
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0041-libtool-avoid-libdir.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0041-libtool-avoid-libdir.patch
new file mode 100644
index 000000000..2dd9610a2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0041-libtool-avoid-libdir.patch
@@ -0,0 +1,19 @@
+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>
+
+diff --git a/ltmain.sh b/ltmain.sh
+index a03433f..1902a90 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
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0043-cpp.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0043-cpp.patch
new file mode 100644
index 000000000..eaf8646f9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0043-cpp.patch
@@ -0,0 +1,40 @@
+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
+
+Index: gcc-4.8.1/Makefile.in
+===================================================================
+--- gcc-4.8.1.orig/Makefile.in 2013-03-30 11:25:03.000000000 +0000
++++ gcc-4.8.1/Makefile.in 2013-08-13 12:03:17.151988882 +0000
+@@ -149,6 +149,7 @@
+ 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; \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0044-gengtypes.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0044-gengtypes.patch
new file mode 100644
index 000000000..e38761d4c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0044-gengtypes.patch
@@ -0,0 +1,97 @@
+gengtype is generated for both the build system and the target. -DGENERATOR_FILE
+was added in the patch http://gcc.gnu.org/ml/gcc-patches/2012-07/msg00273.html
+and was applied to both versions of gengtype.
+
+Unfortunately the presence of this flag triggers the build configuration (bconfig.h)
+to be included for the target build of gengtype. Compiling gengtype with the target
+compiler and bconfig.h can result in errors if the build and target systems are
+dissimilar. An example case this fails is cross compiling gcc on linux for a darwin
+target system:
+
+In file included from /media/build1/poky/build/tmp/work-shared/gcc-4.8.1-r0/gcc-4.8.1/gcc/gengtype-parse.c:25:0:
+| /media/build1/poky/build/tmp/work-shared/gcc-4.8.1-r0/gcc-4.8.1/gcc/gengtype-parse.c: In function 'void parse_error(const char*, ...)':
+| /media/build1/poky/build/tmp/work-shared/gcc-4.8.1-r0/gcc-4.8.1/gcc/system.h:93:53: error: 'fputc_unlocked' was not declared in this scope
+| # define fputc(C, Stream) fputc_unlocked (C, Stream)
+
+which occurs since auto-build.h and auto-host.h have differnet values of
+HAVE_FPUTC_UNLOCKED:
+
+#define HAVE_FPUTC_UNLOCKED 1
+/* #undef HAVE_FPUTS_UNLOCKED */
+
+The obvious fix is to only include the flag on build/ targets which this patch does, however
+this also leads to compile errors due to const_tree being undefined but used in double_int.h
+
+I added a GENERATOR_FILE2 flag to workaround those in the
+target case and allow the build to succeed.
+
+Only the build/gengtypes should have the -DGENERATOR_FILE
+
+RP 22/8/2013
+
+Upstream-Status: Pending
+
+Index: gcc-4.8.1/gcc/Makefile.in
+===================================================================
+--- gcc-4.8.1.orig/gcc/Makefile.in 2013-08-19 11:40:36.844014424 +0000
++++ gcc-4.8.1/gcc/Makefile.in 2013-08-19 11:40:37.784014402 +0000
+@@ -3903,27 +3903,29 @@
+
+ gengtype-lex.o build/gengtype-lex.o : gengtype-lex.c gengtype.h $(SYSTEM_H)
+ gengtype-lex.o: $(CONFIG_H) $(BCONFIG_H)
+-CFLAGS-gengtype-lex.o += -DGENERATOR_FILE
++CFLAGS-build/gengtype-lex.o += -DGENERATOR_FILE
+ build/gengtype-lex.o: $(BCONFIG_H)
+
+ gengtype-parse.o build/gengtype-parse.o : gengtype-parse.c gengtype.h \
+ $(SYSTEM_H)
+ gengtype-parse.o: $(CONFIG_H)
+-CFLAGS-gengtype-parse.o += -DGENERATOR_FILE
++CFLAGS-build/gengtype-parse.o += -DGENERATOR_FILE
+ build/gengtype-parse.o: $(BCONFIG_H)
+
+ gengtype-state.o build/gengtype-state.o: gengtype-state.c $(SYSTEM_H) \
+ gengtype.h errors.h double-int.h version.h $(HASHTAB_H) $(OBSTACK_H) \
+ $(XREGEX_H)
+ gengtype-state.o: $(CONFIG_H)
+-CFLAGS-gengtype-state.o += -DGENERATOR_FILE
++CFLAGS-gengtype-state.o += -DGENERATOR_FILE2
++CFLAGS-build/gengtype-state.o += -DGENERATOR_FILE
+ build/gengtype-state.o: $(BCONFIG_H)
+
+ gengtype.o build/gengtype.o : gengtype.c $(SYSTEM_H) gengtype.h \
+ rtl.def insn-notes.def errors.h double-int.h version.h $(HASHTAB_H) \
+ $(OBSTACK_H) $(XREGEX_H)
+ gengtype.o: $(CONFIG_H)
+-CFLAGS-gengtype.o += -DGENERATOR_FILE
++CFLAGS-gengtype.o += -DGENERATOR_FILE2
++CFLAGS-build/gengtype.o += -DGENERATOR_FILE
+ build/gengtype.o: $(BCONFIG_H)
+
+ build/genmddeps.o: genmddeps.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
+@@ -3988,7 +3990,7 @@
+ # any system header is included.
+ gengtype-lex.c : gengtype-lex.l
+ -$(FLEX) $(FLEXFLAGS) -o$@ $< && { \
+- echo '#include "bconfig.h"' > $@.tmp; \
++ echo '' > $@.tmp; \
+ cat $@ >> $@.tmp; \
+ mv $@.tmp $@; \
+ }
+Index: gcc-4.8.1/gcc/double-int.h
+===================================================================
+--- gcc-4.8.1.orig/gcc/double-int.h 2013-01-30 11:04:30.000000000 +0000
++++ gcc-4.8.1/gcc/double-int.h 2013-08-19 11:41:51.564012719 +0000
+@@ -448,10 +448,12 @@
+
+
+ #ifndef GENERATOR_FILE
++#ifndef GENERATOR_FILE2
+ /* Conversion to and from GMP integer representations. */
+
+ void mpz_set_double_int (mpz_t, double_int, bool);
+ double_int mpz_get_double_int (const_tree, mpz_t, bool);
+ #endif
++#endif
+
+ #endif /* DOUBLE_INT_H */
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0046-libatomic-deptracking.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0046-libatomic-deptracking.patch
new file mode 100644
index 000000000..6ea4f4276
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0046-libatomic-deptracking.patch
@@ -0,0 +1,41 @@
+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
+
+Index: gcc-4.8.1/libatomic/Makefile.am
+===================================================================
+--- gcc-4.8.1.orig/libatomic/Makefile.am 2013-01-14 18:16:23.000000000 +0000
++++ gcc-4.8.1/libatomic/Makefile.am 2013-09-22 10:38:18.904064750 +0000
+@@ -100,7 +100,8 @@
+ 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
+Index: gcc-4.8.1/libatomic/Makefile.in
+===================================================================
+--- gcc-4.8.1.orig/libatomic/Makefile.in 2013-05-31 09:09:26.000000000 +0000
++++ gcc-4.8.1/libatomic/Makefile.in 2013-09-22 10:40:42.520059917 +0000
+@@ -298,7 +298,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/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0047-repomembug.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0047-repomembug.patch
new file mode 100644
index 000000000..9afd55cbd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0047-repomembug.patch
@@ -0,0 +1,53 @@
+When compiling a project using -frepo, .rpo files are written alongside
+the .o file, the symbols either have O or C against them. During final linking,
+the objects can be recompiled with some of the entries tweaked/chosen by the
+tlink.c code (visible with TLINK_VERBOSE=3), it does this by changing O -> C
+in the .rpo files.
+
+My tests showed that init_repo (cp/repo.c) was correctly calling
+IDENTIFIER_REPO_CHOSEN against the right identifers and setting the
+chosen bit.
+
+By the time finish_repo() or emit_repo_p() were called, the pointer returned
+by get_identifier() for the symbol marked during init_repo had changed and
+the chosen bit was no longer set. This lead to linking bugs like:
+
+collect: relinking
+collect2: error: '_ZNK6sudoku5ClearINS_8SequenceEEclERS1_' was assigned to 'board.rpo', but was not defined during recompilation, or vice versa
+
+The problem is that the garbage collection is getting called before
+finish_repo() is called and ggc_protect_identifiers is set to false
+so the identifiers are not preserved. They are recreated but the
+chosen bits get wiped out which is why the pointer changes and the
+chosen bit is not set.
+
+The fix is to change ggc_protect_identifiers *after* the finish_repo
+calls are made.
+
+Reproduction is tricky since you need to trigger the garbage collector at
+just the right moment.
+
+RP 2013/10/9
+
+[YOCTO #5133]
+
+Upstream-Status: Pending
+
+Index: gcc-4.8.1/gcc/toplev.c
+===================================================================
+--- gcc-4.8.1.orig/gcc/toplev.c 2013-03-28 08:29:51.000000000 +0000
++++ gcc-4.8.1/gcc/toplev.c 2013-10-09 20:27:17.089228023 +0000
+@@ -551,11 +551,11 @@
+ if (flag_syntax_only || flag_wpa)
+ return;
+
+- ggc_protect_identifiers = false;
+-
+ /* This must also call finalize_compilation_unit. */
+ lang_hooks.decls.final_write_globals ();
+
++ ggc_protect_identifiers = false;
++
+ if (seen_error ())
+ return;
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch
new file mode 100644
index 000000000..b98f8ff01
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch
@@ -0,0 +1,42 @@
+From 9e0e19eac2562f73858602fe26e2044eb8b20c47 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] 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 | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/config.gcc b/gcc/config.gcc
+index cb7a94e..d392c2b 100644
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -2068,7 +2068,12 @@ powerpc-*-rtems*)
+ tmake_file="rs6000/t-fprules rs6000/t-rtems t-rtems rs6000/t-ppccomm"
+ ;;
+ powerpc*-*-linux*)
+- tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h"
++ case ${target} in
++ powerpc*-*-linux*spe* | powerpc*-*-linux*altivec*)
++ tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h" ;;
++ *)
++ tm_file="${tm_file} dbxelf.h elfos.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="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
+ case ${target} in
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0050-Revert-Use-dbx_reg_number-for-spanning-registers.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0050-Revert-Use-dbx_reg_number-for-spanning-registers.patch
new file mode 100644
index 000000000..aead6f67b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0050-Revert-Use-dbx_reg_number-for-spanning-registers.patch
@@ -0,0 +1,80 @@
+Upstream-Status: Pending
+
+From cb9b1c041b634a4c128896e3d3eed4082608c797 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 3 May 2014 19:25:17 -0700
+Subject: [PATCH] Revert "2013-05-21 Christian Bruel
+ <christian.bruel@st.com>"
+
+This reverts commit 3983036a8b6b2710c57777194f21507819a73553.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Conflicts:
+ gcc/ChangeLog
+---
+ gcc/ChangeLog | 219 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
+ gcc/dwarf2out.c | 33 +++++----
+ 2 files changed, 234 insertions(+), 18 deletions(-)
+
+diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
+index 1272326..6ac2b28 100644
+--- a/gcc/dwarf2out.c
++++ b/gcc/dwarf2out.c
+@@ -10870,27 +10870,25 @@ static dw_loc_descr_ref
+ multiple_reg_loc_descriptor (rtx rtl, rtx regs,
+ enum var_init_status initialized)
+ {
+- int size, i;
++ int nregs, size, i;
++ unsigned reg;
+ dw_loc_descr_ref loc_result = NULL;
+
+- /* Simple, contiguous registers. */
+- if (regs == NULL_RTX)
+- {
+- unsigned reg = REGNO (rtl);
+- int nregs;
+-
++ reg = REGNO (rtl);
+ #ifdef LEAF_REG_REMAP
+- if (crtl->uses_only_leaf_regs)
+- {
+- int leaf_reg = LEAF_REG_REMAP (reg);
+- if (leaf_reg != -1)
+- reg = (unsigned) leaf_reg;
+- }
++ if (crtl->uses_only_leaf_regs)
++ {
++ int leaf_reg = LEAF_REG_REMAP (reg);
++ if (leaf_reg != -1)
++ reg = (unsigned) leaf_reg;
++ }
+ #endif
++ gcc_assert ((unsigned) DBX_REGISTER_NUMBER (reg) == dbx_reg_number (rtl));
++ nregs = hard_regno_nregs[REGNO (rtl)][GET_MODE (rtl)];
+
+- gcc_assert ((unsigned) DBX_REGISTER_NUMBER (reg) == dbx_reg_number (rtl));
+- nregs = hard_regno_nregs[REGNO (rtl)][GET_MODE (rtl)];
+-
++ /* Simple, contiguous registers. */
++ if (regs == NULL_RTX)
++ {
+ size = GET_MODE_SIZE (GET_MODE (rtl)) / nregs;
+
+ loc_result = NULL;
+@@ -10918,9 +10916,10 @@ multiple_reg_loc_descriptor (rtx rtl, rtx regs,
+ {
+ dw_loc_descr_ref t;
+
+- t = one_reg_loc_descriptor (dbx_reg_number (XVECEXP (regs, 0, i)),
++ t = one_reg_loc_descriptor (REGNO (XVECEXP (regs, 0, i)),
+ VAR_INIT_STATUS_INITIALIZED);
+ add_loc_descr (&loc_result, t);
++ size = GET_MODE_SIZE (GET_MODE (XVECEXP (regs, 0, 0)));
+ add_loc_descr_op_piece (&loc_result, size);
+ }
+
+--
+1.9.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0051-eabispe.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0051-eabispe.patch
new file mode 100644
index 000000000..55e38903f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0051-eabispe.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Pending
+
+Taken from http://gcc.gnu.org/ml/gcc-patches/2014-04/msg02064.html
+
+2014-04-30 Cesar Philippidis <cesar@codesourcery.com>
+
+ gcc/
+ * dwarf2cfi.c (dwf_regno): Don't assert reg is a pseudo
+ register.
+
+
+diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c
+index 4180890..40ef0e2 100644
+--- a/gcc/dwarf2cfi.c
++++ b/gcc/dwarf2cfi.c
+@@ -906,7 +906,6 @@ notice_eh_throw (rtx insn)
+ static inline unsigned
+ dwf_regno (const_rtx reg)
+ {
+- gcc_assert (REGNO (reg) < FIRST_PSEUDO_REGISTER);
+ return DWARF_FRAME_REGNUM (REGNO (reg));
+ }
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0052-Add-target-hook-to-override-DWARF2-frame-register-si.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0052-Add-target-hook-to-override-DWARF2-frame-register-si.patch
new file mode 100644
index 000000000..f6958b32c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0052-Add-target-hook-to-override-DWARF2-frame-register-si.patch
@@ -0,0 +1,138 @@
+From d626297e87e19251a284ea1e9360e831b48999ca Mon Sep 17 00:00:00 2001
+From: mpf <mpf@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Thu, 4 Sep 2014 08:32:05 +0000
+Subject: [PATCH] Add target hook to override DWARF2 frame register size
+
+gcc/
+
+ * target.def (TARGET_DWARF_FRAME_REG_MODE): New target hook.
+ * targhooks.c (default_dwarf_frame_reg_mode): New function.
+ * targhooks.h (default_dwarf_frame_reg_mode): New prototype.
+ * doc/tm.texi.in (TARGET_DWARF_FRAME_REG_MODE): Document.
+ * doc/tm.texi: Regenerate.
+ * dwarf2cfi.c (expand_builtin_init_dwarf_reg_sizes): Abstract mode
+ selection logic to default_dwarf_frame_reg_mode.
+
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214898 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport [gcc 5.0]
+
+---
+ gcc/ChangeLog | 10 ++++++++++
+ gcc/doc/tm.texi | 7 +++++++
+ gcc/doc/tm.texi.in | 2 ++
+ gcc/dwarf2cfi.c | 4 +---
+ gcc/target.def | 11 +++++++++++
+ gcc/targhooks.c | 13 +++++++++++++
+ gcc/targhooks.h | 1 +
+ 7 files changed, 45 insertions(+), 3 deletions(-)
+
+Index: gcc-4.9.2/gcc/doc/tm.texi
+===================================================================
+--- gcc-4.9.2.orig/gcc/doc/tm.texi
++++ gcc-4.9.2/gcc/doc/tm.texi
+@@ -9017,6 +9017,13 @@ register in Dwarf. Otherwise, this hook
+ If not defined, the default is to return @code{NULL_RTX}.
+ @end deftypefn
+
++@deftypefn {Target Hook} {enum machine_mode} TARGET_DWARF_FRAME_REG_MODE (int @var{regno})
++Given a register, this hook should return the mode which the
++corresponding Dwarf frame register should have. This is normally
++used to return a smaller mode than the raw mode to prevent call
++clobbered parts of a register altering the frame register size
++@end deftypefn
++
+ @deftypefn {Target Hook} void TARGET_INIT_DWARF_REG_SIZES_EXTRA (tree @var{address})
+ If some registers are represented in Dwarf-2 unwind information in
+ multiple pieces, define this hook to fill in information about the
+Index: gcc-4.9.2/gcc/doc/tm.texi.in
+===================================================================
+--- gcc-4.9.2.orig/gcc/doc/tm.texi.in
++++ gcc-4.9.2/gcc/doc/tm.texi.in
+@@ -6745,6 +6745,8 @@ the target supports DWARF 2 frame unwind
+
+ @hook TARGET_DWARF_REGISTER_SPAN
+
++@hook TARGET_DWARF_FRAME_REG_MODE
++
+ @hook TARGET_INIT_DWARF_REG_SIZES_EXTRA
+
+ @hook TARGET_ASM_TTYPE
+Index: gcc-4.9.2/gcc/dwarf2cfi.c
+===================================================================
+--- gcc-4.9.2.orig/gcc/dwarf2cfi.c
++++ gcc-4.9.2/gcc/dwarf2cfi.c
+@@ -271,11 +271,9 @@ expand_builtin_init_dwarf_reg_sizes (tre
+ if (rnum < DWARF_FRAME_REGISTERS)
+ {
+ HOST_WIDE_INT offset = rnum * GET_MODE_SIZE (mode);
+- enum machine_mode save_mode = reg_raw_mode[i];
+ HOST_WIDE_INT size;
++ enum machine_mode save_mode = targetm.dwarf_frame_reg_mode (i);
+
+- if (HARD_REGNO_CALL_PART_CLOBBERED (i, save_mode))
+- save_mode = choose_hard_reg_mode (i, 1, true);
+ if (dnum == DWARF_FRAME_RETURN_COLUMN)
+ {
+ if (save_mode == VOIDmode)
+Index: gcc-4.9.2/gcc/target.def
+===================================================================
+--- gcc-4.9.2.orig/gcc/target.def
++++ gcc-4.9.2/gcc/target.def
+@@ -3218,6 +3218,17 @@ If not defined, the default is to return
+ rtx, (rtx reg),
+ hook_rtx_rtx_null)
+
++/* Given a register return the mode of the corresponding DWARF frame
++ register. */
++DEFHOOK
++(dwarf_frame_reg_mode,
++ "Given a register, this hook should return the mode which the\n\
++corresponding Dwarf frame register should have. This is normally\n\
++used to return a smaller mode than the raw mode to prevent call\n\
++clobbered parts of a register altering the frame register size",
++ enum machine_mode, (int regno),
++ default_dwarf_frame_reg_mode)
++
+ /* If expand_builtin_init_dwarf_reg_sizes needs to fill in table
+ entries not corresponding directly to registers below
+ FIRST_PSEUDO_REGISTER, this hook should generate the necessary
+Index: gcc-4.9.2/gcc/targhooks.c
+===================================================================
+--- gcc-4.9.2.orig/gcc/targhooks.c
++++ gcc-4.9.2/gcc/targhooks.c
+@@ -1438,6 +1438,19 @@ default_debug_unwind_info (void)
+ return UI_NONE;
+ }
+
++/* Determine the correct mode for a Dwarf frame register that represents
++ register REGNO. */
++
++enum machine_mode
++default_dwarf_frame_reg_mode (int regno)
++{
++ enum machine_mode save_mode = reg_raw_mode[regno];
++
++ if (HARD_REGNO_CALL_PART_CLOBBERED (regno, save_mode))
++ save_mode = choose_hard_reg_mode (regno, 1, true);
++ return save_mode;
++}
++
+ /* To be used by targets where reg_raw_mode doesn't return the right
+ mode for registers used in apply_builtin_return and apply_builtin_arg. */
+
+Index: gcc-4.9.2/gcc/targhooks.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/targhooks.h
++++ gcc-4.9.2/gcc/targhooks.h
+@@ -194,6 +194,7 @@ extern int default_label_align_max_skip
+ extern int default_jump_align_max_skip (rtx);
+ extern section * default_function_section(tree decl, enum node_frequency freq,
+ bool startup, bool exit);
++extern enum machine_mode default_dwarf_frame_reg_mode (int);
+ extern enum machine_mode default_get_reg_raw_mode (int);
+
+ extern void *default_get_pch_validity (size_t *);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch
new file mode 100644
index 000000000..23b445c9e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch
@@ -0,0 +1,66 @@
+From a22a222c8f9299f6c07a0274388ade7d4ab8c28d Mon Sep 17 00:00:00 2001
+From: Paul Gortmaker <paul.gortmaker@windriver.com>
+Date: Fri, 20 Jun 2014 16:41:08 -0400
+Subject: [PATCH] gcc: fix segfault from calling free on non-malloc'd area
+
+We see the following on a 32bit gcc installed on 64 bit host:
+
+ Reading symbols from ./i586-pokymllib32-linux-gcc...done.
+ (gdb) run
+ Starting program: x86-pokymllib32-linux/lib32-gcc/4.9.0-r0/image/usr/bin/i586-pokymllib32-linux-gcc
+
+ Program received signal SIGSEGV, Segmentation fault.
+ 0xf7e957e0 in free () from /lib/i386-linux-gnu/libc.so.6
+ (gdb) bt
+ #0 0xf7e957e0 in free () from /lib/i386-linux-gnu/libc.so.6
+ #1 0x0804b73c in set_multilib_dir () at gcc-4.9.0/gcc/gcc.c:7827
+ #2 main (argc=1, argv=0xffffd504) at gcc-4.9.0/gcc/gcc.c:6688
+ (gdb)
+
+The problem arises because we conditionally assign the pointer we
+eventually free, and the conditional may assign the pointer to the
+non-malloc'd internal string "." which fails when we free it here:
+
+ if (multilib_dir == NULL && multilib_os_dir != NULL
+ && strcmp (multilib_os_dir, ".") == 0)
+ {
+ free (CONST_CAST (char *, multilib_os_dir));
+ ...
+
+As suggested by Jakub, ensure the "." case is also malloc'd via
+xstrdup() and hence the pointer for the "." case can be freed.
+
+Cc: Jakub Jelinek <jakub@redhat.com>
+Cc: Jeff Law <law@redhat.com>
+Cc: Matthias Klose <doko@ubuntu.com>
+CC: Tobias Burnus <burnus@net-b.de>
+Upstream-Status: Accepted [ https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02069.html ]
+Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
+
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 9ac18e60d801..168acf7eb0c9 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -7790,10 +7790,15 @@ set_multilib_dir (void)
+ q2++;
+ if (*q2 == ':')
+ ml_end = q2;
+- new_multilib_os_dir = XNEWVEC (char, ml_end - q);
+- memcpy (new_multilib_os_dir, q + 1, ml_end - q - 1);
+- new_multilib_os_dir[ml_end - q - 1] = '\0';
+- multilib_os_dir = *new_multilib_os_dir ? new_multilib_os_dir : ".";
++ if (ml_end - q == 1)
++ multilib_os_dir = xstrdup (".");
++ else
++ {
++ new_multilib_os_dir = XNEWVEC (char, ml_end - q);
++ memcpy (new_multilib_os_dir, q + 1, ml_end - q - 1);
++ new_multilib_os_dir[ml_end - q - 1] = '\0';
++ multilib_os_dir = new_multilib_os_dir;
++ }
+
+ if (q2 < end && *q2 == ':')
+ {
+--
+1.9.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch
new file mode 100644
index 000000000..7e8efa1e8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch
@@ -0,0 +1,61 @@
+gcc/Makefile.in: fix parallel building failure
+
+The gcc-ar.o, gcc-nm.o, gcc-ranlib.o and errors.o included
+config.h which was a generated file. But no explicity rule
+to clarify the dependency. There was potential building
+failure while parallel make.
+
+For gcc-ar.o, gcc-nm.o and gcc-ranlib.o, they were compiled from one C
+source file gcc-ar.c, we add them to ALL_HOST_BACKEND_OBJS, so the
+'$(ALL_HOST_OBJS) : | $(generated_files)' rule could work for these
+objects.
+
+For errors.o, it is part of gengtype, and the gengtype generator program
+is special: Two versions are built. One is for the build machine, and one
+is for the host. We refered what gengtype-parse.o did (which also is part
+of gengtype).
+
+[GCC #61899]
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61899
+
+Upstream-Status: Submitted [gcc-patches@gcc.gnu.org]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ gcc/Makefile.in | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index 6475cba..56e50bb 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -1481,13 +1481,16 @@ OBJS-libcommon-target = $(common_out_object_file) prefix.o params.o \
+ opts.o opts-common.o options.o vec.o hooks.o common/common-targhooks.o \
+ hash-table.o file-find.o
+
++# Objects compiled from one C source file gcc-ar.c
++OBJS-gcc-ar = gcc-ar.o gcc-nm.o gcc-ranlib.o
++
+ # This lists all host objects for the front ends.
+ ALL_HOST_FRONTEND_OBJS = $(foreach v,$(CONFIG_LANGUAGES),$($(v)_OBJS))
+
+ ALL_HOST_BACKEND_OBJS = $(GCC_OBJS) $(OBJS) $(OBJS-libcommon) \
+ $(OBJS-libcommon-target) @TREEBROWSER@ main.o c-family/cppspec.o \
+ $(COLLECT2_OBJS) $(EXTRA_GCC_OBJS) $(GCOV_OBJS) $(GCOV_DUMP_OBJS) \
+- lto-wrapper.o
++ lto-wrapper.o $(OBJS-gcc-ar)
+
+ # This lists all host object files, whether they are included in this
+ # compilation or not.
+@@ -2437,6 +2440,8 @@ gengtype-parse.o: $(CONFIG_H)
+ CFLAGS-build/gengtype-parse.o += -DGENERATOR_FILE
+ build/gengtype-parse.o: $(BCONFIG_H)
+
++errors.o : $(CONFIG_H)
++
+ gengtype-state.o build/gengtype-state.o: gengtype-state.c $(SYSTEM_H) \
+ gengtype.h errors.h double-int.h version.h $(HASHTAB_H) $(OBSTACK_H) \
+ $(XREGEX_H)
+--
+1.8.1.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0055-dwarf-reg-processing-helper.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0055-dwarf-reg-processing-helper.patch
new file mode 100644
index 000000000..557dab0f3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0055-dwarf-reg-processing-helper.patch
@@ -0,0 +1,148 @@
+From 4fd39f1329379e00f958394adde6be96f0caf21f Mon Sep 17 00:00:00 2001
+From: hainque <hainque@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Fri, 5 Dec 2014 16:53:22 +0000
+Subject: [PATCH] 2014-12-05 Olivier Hainque <hainque@adacore.com>
+
+ * dwarf2cfi.c (init_one_dwarf_reg_size): New helper, processing
+ one particular reg for expand_builtin_init_dwarf_reg_sizes.
+ (expand_builtin_init_dwarf_reg_sizes): Rework to use helper and
+ account for dwarf register spans.
+
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218428 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport [gcc 5.0]
+
+---
+ gcc/ChangeLog | 7 +++++
+ gcc/dwarf2cfi.c | 98 +++++++++++++++++++++++++++++++++++++++++++++------------
+ 2 files changed, 85 insertions(+), 20 deletions(-)
+
+Index: gcc-4.9.2/gcc/dwarf2cfi.c
+===================================================================
+--- gcc-4.9.2.orig/gcc/dwarf2cfi.c
++++ gcc-4.9.2/gcc/dwarf2cfi.c
+@@ -252,7 +252,59 @@ init_return_column_size (enum machine_mo
+ gen_int_mode (size, mode));
+ }
+
+-/* Generate code to initialize the register size table. */
++/* Datastructure used by expand_builtin_init_dwarf_reg_sizes and
++ init_one_dwarf_reg_size to communicate on what has been done by the
++ latter. */
++
++typedef struct
++{
++ /* Whether the dwarf return column was initialized. */
++ bool wrote_return_column;
++
++ /* For each hard register REGNO, whether init_one_dwarf_reg_size
++ was given REGNO to process already. */
++ bool processed_regno [FIRST_PSEUDO_REGISTER];
++
++} init_one_dwarf_reg_state;
++
++/* Helper for expand_builtin_init_dwarf_reg_sizes. Generate code to
++ initialize the dwarf register size table entry corresponding to register
++ REGNO in REGMODE. TABLE is the table base address, SLOTMODE is the mode to
++ use for the size entry to initialize, and INIT_STATE is the communication
++ datastructure conveying what we're doing to our caller. */
++
++static
++void init_one_dwarf_reg_size (int regno, machine_mode regmode,
++ rtx table, machine_mode slotmode,
++ init_one_dwarf_reg_state *init_state)
++{
++ const unsigned int dnum = DWARF_FRAME_REGNUM (regno);
++ const unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
++
++ const HOST_WIDE_INT slotoffset = rnum * GET_MODE_SIZE (slotmode);
++ const HOST_WIDE_INT regsize = GET_MODE_SIZE (regmode);
++
++ init_state->processed_regno[regno] = true;
++
++ if (rnum >= DWARF_FRAME_REGISTERS)
++ return;
++
++ if (dnum == DWARF_FRAME_RETURN_COLUMN)
++ {
++ if (regmode == VOIDmode)
++ return;
++ init_state->wrote_return_column = true;
++ }
++
++ if (slotoffset < 0)
++ return;
++
++ emit_move_insn (adjust_address (table, slotmode, slotoffset),
++ gen_int_mode (regsize, slotmode));
++}
++
++/* Generate code to initialize the dwarf register size table located
++ at the provided ADDRESS. */
+
+ void
+ expand_builtin_init_dwarf_reg_sizes (tree address)
+@@ -261,35 +313,40 @@ expand_builtin_init_dwarf_reg_sizes (tre
+ enum machine_mode mode = TYPE_MODE (char_type_node);
+ rtx addr = expand_normal (address);
+ rtx mem = gen_rtx_MEM (BLKmode, addr);
+- bool wrote_return_column = false;
++
++ init_one_dwarf_reg_state init_state;
++
++ memset ((char *)&init_state, 0, sizeof (init_state));
+
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ {
+- unsigned int dnum = DWARF_FRAME_REGNUM (i);
+- unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
+-
+- if (rnum < DWARF_FRAME_REGISTERS)
+- {
+- HOST_WIDE_INT offset = rnum * GET_MODE_SIZE (mode);
+- HOST_WIDE_INT size;
+- enum machine_mode save_mode = targetm.dwarf_frame_reg_mode (i);
++ machine_mode save_mode;
++ rtx span;
+
+- if (dnum == DWARF_FRAME_RETURN_COLUMN)
++ /* No point in processing a register multiple times. This could happen
++ with register spans, e.g. when a reg is first processed as a piece of
++ a span, then as a register on its own later on. */
++
++ if (init_state.processed_regno[i])
++ continue;
++
++ save_mode = targetm.dwarf_frame_reg_mode (i);
++ span = targetm.dwarf_register_span (gen_rtx_REG (save_mode, i));
++ if (!span)
++ init_one_dwarf_reg_size (i, save_mode, mem, mode, &init_state);
++ else
++ {
++ for (int si = 0; si < XVECLEN (span, 0); si++)
+ {
+- if (save_mode == VOIDmode)
+- continue;
+- wrote_return_column = true;
+- }
+- size = GET_MODE_SIZE (save_mode);
+- if (offset < 0)
+- continue;
++ rtx reg = XVECEXP (span, 0, si);
++ init_one_dwarf_reg_size
++ (REGNO (reg), GET_MODE (reg), mem, mode, &init_state);
++ }
+
+- emit_move_insn (adjust_address (mem, mode, offset),
+- gen_int_mode (size, mode));
+ }
+ }
+
+- if (!wrote_return_column)
++ if (!init_state.wrote_return_column)
+ init_return_column_size (mode, mem, DWARF_FRAME_RETURN_COLUMN);
+
+ #ifdef DWARF_ALT_FRAME_RETURN_COLUMN
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0056-define-default-cfa-register-mapping.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0056-define-default-cfa-register-mapping.patch
new file mode 100644
index 000000000..3b6c94c49
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0056-define-default-cfa-register-mapping.patch
@@ -0,0 +1,75 @@
+From c0235a33de8c4f78cce35b2a8c2035c83fe1bd14 Mon Sep 17 00:00:00 2001
+From: hainque <hainque@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Fri, 5 Dec 2014 17:01:42 +0000
+Subject: [PATCH] 2014-12-05 Olivier Hainque <hainque@adacore.com>
+
+ gcc/
+ * defaults.h: (DWARF_REG_TO_UNWIND_COLUMN): Define default.
+ * dwarf2cfi.c (init_one_dwarf_reg_size): Honor
+ DWARF_REG_TO_UNWIND_COLUMN.
+
+ libgcc/
+ * unwind-dw2.c (DWARF_REG_TO_UNWIND_COLUMN): Remove default def,
+ now provided by defaults.h.
+
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218429 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport [gcc 5.0]
+
+---
+ gcc/ChangeLog | 6 ++++++
+ gcc/defaults.h | 5 +++++
+ gcc/dwarf2cfi.c | 3 ++-
+ libgcc/ChangeLog | 5 +++++
+ libgcc/unwind-dw2.c | 4 ----
+ 5 files changed, 18 insertions(+), 5 deletions(-)
+
+Index: gcc-4.9.2/gcc/defaults.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/defaults.h
++++ gcc-4.9.2/gcc/defaults.h
+@@ -438,6 +438,11 @@ see the files COPYING3 and COPYING.RUNTI
+ #define DWARF_FRAME_REGNUM(REG) DBX_REGISTER_NUMBER (REG)
+ #endif
+
++/* The mapping from dwarf CFA reg number to internal dwarf reg numbers. */
++#ifndef DWARF_REG_TO_UNWIND_COLUMN
++#define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO)
++#endif
++
+ /* Map register numbers held in the call frame info that gcc has
+ collected using DWARF_FRAME_REGNUM to those that should be output in
+ .debug_frame and .eh_frame. */
+Index: gcc-4.9.2/gcc/dwarf2cfi.c
+===================================================================
+--- gcc-4.9.2.orig/gcc/dwarf2cfi.c
++++ gcc-4.9.2/gcc/dwarf2cfi.c
+@@ -280,8 +280,9 @@ void init_one_dwarf_reg_size (int regno,
+ {
+ const unsigned int dnum = DWARF_FRAME_REGNUM (regno);
+ const unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
++ const unsigned int dcol = DWARF_REG_TO_UNWIND_COLUMN (rnum);
+
+- const HOST_WIDE_INT slotoffset = rnum * GET_MODE_SIZE (slotmode);
++ const HOST_WIDE_INT slotoffset = dcol * GET_MODE_SIZE (slotmode);
+ const HOST_WIDE_INT regsize = GET_MODE_SIZE (regmode);
+
+ init_state->processed_regno[regno] = true;
+Index: gcc-4.9.2/libgcc/unwind-dw2.c
+===================================================================
+--- gcc-4.9.2.orig/libgcc/unwind-dw2.c
++++ gcc-4.9.2/libgcc/unwind-dw2.c
+@@ -55,10 +55,6 @@
+ #define PRE_GCC3_DWARF_FRAME_REGISTERS DWARF_FRAME_REGISTERS
+ #endif
+
+-#ifndef DWARF_REG_TO_UNWIND_COLUMN
+-#define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO)
+-#endif
+-
+ /* ??? For the public function interfaces, we tend to gcc_assert that the
+ column numbers are in range. For the dwarf2 unwind info this does happen,
+ although so far in a case that doesn't actually matter.
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0057-aarch64-config.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0057-aarch64-config.patch
new file mode 100644
index 000000000..f29559698
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0057-aarch64-config.patch
@@ -0,0 +1,32 @@
+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.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: gcc-4.9.1/gcc/config/aarch64/t-aarch64-linux
+===================================================================
+--- gcc-4.9.1.orig/gcc/config/aarch64/t-aarch64-linux
++++ gcc-4.9.1/gcc/config/aarch64/t-aarch64-linux
+@@ -21,11 +21,11 @@
+ LIB1ASMSRC = aarch64/lib1funcs.asm
+ LIB1ASMFUNCS = _aarch64_sync_cache_range
+
+-AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be)
+-MULTILIB_OSDIRNAMES = .=../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 = .=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
++#MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
+
+ # Disable the multilib for linux-gnu targets for the time being; focus
+ # on the baremetal targets.
+-MULTILIB_OPTIONS =
+-MULTILIB_DIRNAMES =
++#MULTILIB_OPTIONS =
++#MULTILIB_DIRNAMES =
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0058-gcc-r212171.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0058-gcc-r212171.patch
new file mode 100644
index 000000000..d442ba8a8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0058-gcc-r212171.patch
@@ -0,0 +1,113 @@
+From ca03cf1b133d66eb978c68f6dbc345e9aabcba88 Mon Sep 17 00:00:00 2001
+From: uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Mon, 30 Jun 2014 19:30:52 +0000
+Subject: [PATCH] r212171
+
+* except.c (emit_note_eh_region_end): New helper
+ function. (convert_to_eh_region_ranges): Use
+ emit_note_eh_region_end to emit EH_REGION_END note.
+ * jump.c (cleanup_barriers): Do not split a call and its
+ corresponding CALL_ARG_LOCATION note.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212171 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Upstream-Status: Backport [https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=212171]
+Signed-off-by: Baoshan Pang <baoshan.pang@windriver.com>
+---
+ gcc/except.c | 23 ++++++++++++++++++-----
+ gcc/jump.c | 19 +++++++++++++++----
+ 2 files changed, 33 insertions(+), 9 deletions(-)
+
+diff --git a/gcc/except.c b/gcc/except.c
+index dc5c1d2..7ac114f 100644
+--- a/gcc/except.c
++++ b/gcc/except.c
+@@ -2466,6 +2466,20 @@ add_call_site (rtx landing_pad, int action, int section)
+ return call_site_base + crtl->eh.call_site_record_v[section]->length () - 1;
+ }
+
++static rtx
++emit_note_eh_region_end (rtx insn)
++{
++ rtx next = NEXT_INSN (insn);
++
++ /* Make sure we do not split a call and its corresponding
++ CALL_ARG_LOCATION note. */
++ if (next && NOTE_P (next)
++ && NOTE_KIND (next) == NOTE_INSN_CALL_ARG_LOCATION)
++ insn = next;
++
++ return emit_note_after (NOTE_INSN_EH_REGION_END, insn);
++}
++
+ /* Turn REG_EH_REGION notes back into NOTE_INSN_EH_REGION notes.
+ The new note numbers will not refer to region numbers, but
+ instead to call site entries. */
+@@ -2544,8 +2558,8 @@ convert_to_eh_region_ranges (void)
+ note = emit_note_before (NOTE_INSN_EH_REGION_BEG,
+ first_no_action_insn_before_switch);
+ NOTE_EH_HANDLER (note) = call_site;
+- note = emit_note_after (NOTE_INSN_EH_REGION_END,
+- last_no_action_insn_before_switch);
++ note
++ = emit_note_eh_region_end (last_no_action_insn_before_switch);
+ NOTE_EH_HANDLER (note) = call_site;
+ gcc_assert (last_action != -3
+ || (last_action_insn
+@@ -2569,8 +2583,7 @@ convert_to_eh_region_ranges (void)
+ first_no_action_insn = NULL_RTX;
+ }
+
+- note = emit_note_after (NOTE_INSN_EH_REGION_END,
+- last_action_insn);
++ note = emit_note_eh_region_end (last_action_insn);
+ NOTE_EH_HANDLER (note) = call_site;
+ }
+
+@@ -2617,7 +2630,7 @@ convert_to_eh_region_ranges (void)
+
+ if (last_action >= -1 && ! first_no_action_insn)
+ {
+- note = emit_note_after (NOTE_INSN_EH_REGION_END, last_action_insn);
++ note = emit_note_eh_region_end (last_action_insn);
+ NOTE_EH_HANDLER (note) = call_site;
+ }
+
+diff --git a/gcc/jump.c b/gcc/jump.c
+index 9418f65..a5e5f52 100644
+--- a/gcc/jump.c
++++ b/gcc/jump.c
+@@ -121,15 +121,26 @@ rebuild_jump_labels_chain (rtx chain)
+ static unsigned int
+ cleanup_barriers (void)
+ {
+- rtx insn, next, prev;
+- for (insn = get_insns (); insn; insn = next)
++ rtx insn;
++ for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
+ {
+- next = NEXT_INSN (insn);
+ if (BARRIER_P (insn))
+ {
+- prev = prev_nonnote_insn (insn);
++ rtx prev = prev_nonnote_insn (insn);
+ if (!prev)
+ continue;
++
++ if (CALL_P (prev))
++ {
++ /* Make sure we do not split a call and its corresponding
++ CALL_ARG_LOCATION note. */
++ rtx next = NEXT_INSN (prev);
++
++ if (NOTE_P (next)
++ && NOTE_KIND (next) == NOTE_INSN_CALL_ARG_LOCATION)
++ prev = next;
++ }
++
+ if (BARRIER_P (prev))
+ delete_insn (insn);
+ else if (prev != PREV_INSN (insn))
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0059-gcc-PR-rtl-optimization-63348.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0059-gcc-PR-rtl-optimization-63348.patch
new file mode 100644
index 000000000..de827cbda
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0059-gcc-PR-rtl-optimization-63348.patch
@@ -0,0 +1,59 @@
+From 6eae3e637fcc22d21b51d44d61e3a9cb4825e776 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Thu, 30 Oct 2014 20:37:14 -0700
+Subject: [PATCH]PR rtl-optimization/63348
+
+PR rtl-optimization/63348
+* emit-rtl.c (try_split): Do not emit extra barrier.
+
+Note: this patch is to fix the side effect introduced by r212171 which was reported at:
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63348
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215613 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Upstream-Status: Backport [https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=215613]
+Signed-off-by: Baoshan Pang <baoshan.pang@windriver.com>
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ gcc/emit-rtl.c | 11 -----------
+ 1 files changed, 0 insertions(+), 11 deletions(-)
+
+diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
+index 4736f8d..ae69dbd 100644
+--- a/gcc/emit-rtl.c
++++ b/gcc/emit-rtl.c
+@@ -3422,7 +3422,6 @@ try_split (rtx pat, rtx trial, int last)
+ {
+ rtx before = PREV_INSN (trial);
+ rtx after = NEXT_INSN (trial);
+- int has_barrier = 0;
+ rtx note, seq, tem;
+ int probability;
+ rtx insn_last, insn;
+@@ -3441,14 +3440,6 @@ try_split (rtx pat, rtx trial, int last)
+
+ split_branch_probability = -1;
+
+- /* If we are splitting a JUMP_INSN, it might be followed by a BARRIER.
+- We may need to handle this specially. */
+- if (after && BARRIER_P (after))
+- {
+- has_barrier = 1;
+- after = NEXT_INSN (after);
+- }
+-
+ if (!seq)
+ return trial;
+
+@@ -3594,8 +3585,6 @@ try_split (rtx pat, rtx trial, int last)
+ tem = emit_insn_after_setloc (seq, trial, INSN_LOCATION (trial));
+
+ delete_insn (trial);
+- if (has_barrier)
+- emit_barrier_after (tem);
+
+ /* Recursively call try_split for each new insn created; by the
+ time control returns here that insn will be fully split, so
+--
+1.7.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch
new file mode 100644
index 000000000..75a9fdd44
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch
@@ -0,0 +1,55 @@
+From 5c0092070253113cf0d9c45eacc884b3ecc34d81 Mon Sep 17 00:00:00 2001
+From: jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Sat, 25 Oct 2014 00:23:17 +0000
+Subject: [PATCH] Only allow e500 double in SPE_SIMD_REGNO_P registers.
+
+rs6000_hard_regno_nregs_internal allows SPE vectors in single
+registers satisfying SPE_SIMD_REGNO_P (i.e. register numbers 0 to
+31). However, the corresponding test for e500 double treats all
+registers as being able to store a 64-bit value, rather than just
+those GPRs.
+
+Logically this inconsistency is wrong; in addition, it causes problems
+unwinding from signal handlers. linux-unwind.h uses
+ARG_POINTER_REGNUM as a place to store the return address from a
+signal handler, but this logic in rs6000_hard_regno_nregs_internal
+results in that being considered an 8-byte register, resulting in
+assertion failures.
+(<https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02625.html> first
+needs to be applied for unwinding to work in general on e500.) This
+patch makes rs6000_hard_regno_nregs_internal handle the e500 double
+case consistently with SPE vectors.
+
+Tested with no regressions with cross to powerpc-linux-gnuspe (given
+the aforementioned patch applied). Failures of signal handling
+unwinding tests such as gcc.dg/cleanup-{8,9,10,11}.c are fixed by this
+patch.
+
+ * config/rs6000/rs6000.c (rs6000_hard_regno_nregs_internal): Do
+ not allow e500 double in registers not satisyfing
+ SPE_SIMD_REGNO_P.
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216688 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport [gcc 5.0]
+
+---
+ gcc/ChangeLog | 6 ++++++
+ gcc/config/rs6000/rs6000.c | 2 +-
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+Index: gcc-4.9.2/gcc/config/rs6000/rs6000.c
+===================================================================
+--- gcc-4.9.2.orig/gcc/config/rs6000/rs6000.c
++++ gcc-4.9.2/gcc/config/rs6000/rs6000.c
+@@ -1703,7 +1703,7 @@ rs6000_hard_regno_nregs_internal (int re
+ SCmode so as to pass the value correctly in a pair of
+ registers. */
+ else if (TARGET_E500_DOUBLE && FLOAT_MODE_P (mode) && mode != SCmode
+- && !DECIMAL_FLOAT_MODE_P (mode))
++ && !DECIMAL_FLOAT_MODE_P (mode) && SPE_SIMD_REGNO_P (regno))
+ reg_size = UNITS_PER_FP_WORD;
+
+ else
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0061-target-gcc-includedir.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0061-target-gcc-includedir.patch
new file mode 100644
index 000000000..f48c66dca
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0061-target-gcc-includedir.patch
@@ -0,0 +1,81 @@
+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.
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+Upstream-Status: Pending
+
+--- a/gcc/Makefile.in 2014-12-23 11:57:33.327873331 +0000
++++ b/gcc/Makefile.in 2015-01-21 11:32:35.447305394 +0000
+@@ -587,6 +587,7 @@
+
+ # Directory in which the compiler finds libraries etc.
+ libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(version)
++libsubdir_target = gcc/$(target_noncanonical)/$(version)
+ # Directory in which the compiler finds executables
+ libexecsubdir = $(libexecdir)/gcc/$(target_noncanonical)/$(version)
+ # Directory in which all plugin resources are installed
+@@ -2534,6 +2535,7 @@
+
+ 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) \
+--- a/gcc/cppdefault.c 2015-01-13 17:40:26.131012725 +0000
++++ b/gcc/cppdefault.c 2015-01-21 11:30:08.928426492 +0000
+@@ -59,6 +59,10 @@
+ /* 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 f94ae17..d98b40b 100644
+--- a/gcc/defaults.h
++++ b/gcc/defaults.h
+@@ -1390,4 +1390,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+
+ #endif /* GCC_INSN_FLAGS_H */
+
++/* 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 9f0b781..174fca8 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -1189,13 +1189,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
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0062-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0062-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch
new file mode 100644
index 000000000..c48bd4847
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0062-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch
@@ -0,0 +1,24 @@
+From 861bcfd4ae814f351e0c668ee26d01d1331e0422 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 36/37] Use SYSTEMLIBS_DIR replacement instead of hardcoding
+ base_libdir
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gcc/config/aarch64/aarch64-linux.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: gcc-4.9.2/gcc/config/aarch64/aarch64-linux.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/config/aarch64/aarch64-linux.h
++++ gcc-4.9.2/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}.so.1"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux-aarch64%{mbig-endian:_be}.so.1"
+
+ #define CPP_SPEC "%{pthread:-D_REENTRANT}"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0063-nativesdk-gcc-support.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0063-nativesdk-gcc-support.patch
new file mode 100644
index 000000000..f9efa4537
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0063-nativesdk-gcc-support.patch
@@ -0,0 +1,198 @@
+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
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 5fd3d0a..2de29aa 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -120,6 +120,8 @@ static const char *target_system_root = TARGET_SYSTEM_ROOT;
+ #else
+ static const char *target_system_root = 0;
+ #endif
++
++static char target_relocatable_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = SYSTEMLIBS_DIR;
+
+ /* Nonzero means pass the updated target_system_root to the compiler. */
+
+@@ -384,6 +386,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.
+@@ -1218,10 +1221,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
+@@ -1229,9 +1232,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
+@@ -5305,6 +5308,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)
+
+diff --git a/gcc/cppdefault.c b/gcc/cppdefault.c
+index dad69e6..cf43f28 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 30b6fed..2ef96b7 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/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0064-handle-target-sysroot-multilib.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0064-handle-target-sysroot-multilib.patch
new file mode 100644
index 000000000..53569847f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0064-handle-target-sysroot-multilib.patch
@@ -0,0 +1,88 @@
+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
+
+Index: gcc-5.2.0/gcc/gcc.c
+===================================================================
+--- gcc-5.2.0.orig/gcc/gcc.c
++++ gcc-5.2.0/gcc/gcc.c
+@@ -2305,7 +2305,7 @@ for_each_path (const struct path_prefix
+ 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);
+ }
+
+@@ -2317,6 +2317,33 @@ for_each_path (const struct path_prefix
+ /* 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)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0065-gcc-483-universal-initializer-no-warning.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0065-gcc-483-universal-initializer-no-warning.patch
new file mode 100644
index 000000000..fde227b8a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0065-gcc-483-universal-initializer-no-warning.patch
@@ -0,0 +1,107 @@
+Upstream-Status: Backport
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+Fix for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119
+wrong warning when using the universal zero initializer {0}
+
+Backported to GCC 4.8.3
+
+Subject: 2014-06-05 S. Gilles <sgilles@terpmail.umd.edu>
+X-Git-Url: http://repo.or.cz/w/official-gcc.git/commitdiff_plain/95cdf3fdf2d440eb7775def8e35ab970651c33d9?hp=14a3093e9943937cbc63dfbf4d51ca60f8325b29
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211289 138bc75d-0d04-0410-961f-82ee72b054a4
+
+--- gcc-4.8.3.org/gcc/c/c-typeck.c 2014-08-03 20:52:09.257042137 +0200
++++ gcc-4.8.3/gcc/c/c-typeck.c 2014-08-03 20:57:10.645042614 +0200
+@@ -62,9 +62,9 @@
+ if expr.original_code == SIZEOF_EXPR. */
+ tree c_last_sizeof_arg;
+
+-/* Nonzero if we've already printed a "missing braces around initializer"
+- message within this initializer. */
+-static int missing_braces_mentioned;
++/* Nonzero if we might need to print a "missing braces around
++ initializer" message within this initializer. */
++static int found_missing_braces;
+
+ static int require_constant_value;
+ static int require_constant_elements;
+@@ -6379,6 +6379,9 @@
+ /* 1 if this constructor is erroneous so far. */
+ static int constructor_erroneous;
+
++/* 1 if this constructor is the universal zero initializer { 0 }. */
++static int constructor_zeroinit;
++
+ /* Structure for managing pending initializer elements, organized as an
+ AVL tree. */
+
+@@ -6540,7 +6543,7 @@
+ constructor_stack = 0;
+ constructor_range_stack = 0;
+
+- missing_braces_mentioned = 0;
++ found_missing_braces = 0;
+
+ spelling_base = 0;
+ spelling_size = 0;
+@@ -6635,6 +6638,7 @@
+ constructor_type = type;
+ constructor_incremental = 1;
+ constructor_designated = 0;
++ constructor_zeroinit = 1;
+ designator_depth = 0;
+ designator_erroneous = 0;
+
+@@ -6832,11 +6836,8 @@
+ set_nonincremental_init (braced_init_obstack);
+ }
+
+- if (implicit == 1 && warn_missing_braces && !missing_braces_mentioned)
+- {
+- missing_braces_mentioned = 1;
+- warning_init (OPT_Wmissing_braces, "missing braces around initializer");
+- }
++ if (implicit == 1)
++ found_missing_braces = 1;
+
+ if (TREE_CODE (constructor_type) == RECORD_TYPE
+ || TREE_CODE (constructor_type) == UNION_TYPE)
+@@ -6969,16 +6970,23 @@
+ }
+ }
+
++ if (vec_safe_length (constructor_elements) != 1)
++ constructor_zeroinit = 0;
++
++ /* Warn when some structs are initialized with direct aggregation. */
++ if (!implicit && found_missing_braces && warn_missing_braces
++ && !constructor_zeroinit)
++ {
++ warning_init (OPT_Wmissing_braces,
++ "missing braces around initializer");
++ }
++
+ /* Warn when some struct elements are implicitly initialized to zero. */
+ if (warn_missing_field_initializers
+ && constructor_type
+ && TREE_CODE (constructor_type) == RECORD_TYPE
+ && constructor_unfilled_fields)
+ {
+- bool constructor_zeroinit =
+- (vec_safe_length (constructor_elements) == 1
+- && integer_zerop ((*constructor_elements)[0].value));
+-
+ /* Do not warn for flexible array members or zero-length arrays. */
+ while (constructor_unfilled_fields
+ && (!DECL_SIZE (constructor_unfilled_fields)
+@@ -8093,6 +8101,9 @@
+ designator_depth = 0;
+ designator_erroneous = 0;
+
++ if (!implicit && value.value && !integer_zerop (value.value))
++ constructor_zeroinit = 0;
++
+ /* Handle superfluous braces around string cst as in
+ char x[] = {"foo"}; */
+ if (string_flag
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0066-cxxflags-for-build.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0066-cxxflags-for-build.patch
new file mode 100644
index 000000000..1105e29f6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0066-cxxflags-for-build.patch
@@ -0,0 +1,123 @@
+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>
+
+diff --git a/Makefile.in b/Makefile.in
+index 9370174..011c29a 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; \
+ GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
+@@ -170,6 +171,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.
+@@ -187,6 +191,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; \
+@@ -711,6 +715,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 1ea1954..78a59c3 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; \
+ GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
+@@ -172,6 +173,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.
+@@ -189,6 +193,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 cd5bc4a..98ae4f4 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -762,7 +762,7 @@ BUILD_LINKERFLAGS = $(BUILD_CXXFLAGS)
+ # Native linker and preprocessor flags. For x-fragment overrides.
+ BUILD_LDFLAGS=@BUILD_LDFLAGS@
+ 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 c7ac14b..5ac63e4 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -11521,7 +11521,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 50856e6..17a4dfd 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -1633,7 +1633,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/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0067-fix-arm-thumb.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0067-fix-arm-thumb.patch
new file mode 100644
index 000000000..2f262e3a3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0067-fix-arm-thumb.patch
@@ -0,0 +1,39 @@
+Upstream-Status: Accepted
+
+Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
+---
+
+2015-11-25 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR rtl-optimization/67954
+ * lra-constraints.c (curr_insn_transform): Add check on scratch
+ pseudo when change class to NO_REGS. Add an assert.
+
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230894 138bc75d-0d04-0410-961f-82ee72b054a4
+---
+
+diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
+index 4670e81..c62bf6a 100644
+--- a/gcc/lra-constraints.c
++++ b/gcc/lra-constraints.c
+@@ -3725,7 +3725,8 @@ curr_insn_transform (bool check_only_p)
+ assigment pass and the scratch pseudo will be
+ spilled. Spilled scratch pseudos are transformed
+ back to scratches at the LRA end. */
+- && lra_former_scratch_operand_p (curr_insn, i))
++ && lra_former_scratch_operand_p (curr_insn, i)
++ && lra_former_scratch_p (REGNO (op)))
+ {
+ int regno = REGNO (op);
+ lra_change_class (regno, NO_REGS, " Change to", true);
+@@ -3734,6 +3735,8 @@ curr_insn_transform (bool check_only_p)
+ spilled pseudo as there is only one such insn, the
+ current one. */
+ reg_renumber[regno] = -1;
++ lra_assert (bitmap_single_bit_set_p
++ (&lra_reg_info[REGNO (op)].insn_bitmap));
+ }
+ /* We can do an optional reload. If the pseudo got a hard
+ reg, we might improve the code through inheritance. If
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0067-gcc-musl-support.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0067-gcc-musl-support.patch
new file mode 100644
index 000000000..9a0b5ade4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0067-gcc-musl-support.patch
@@ -0,0 +1,267 @@
+# HG changeset patch
+# Parent e5b4564f249f8634194bdabef4b3057d0e54ee97
+Adding -mmusl as a musl libc specifier, and the necessary hacks for it to know how to find musl's dynamic linker.
+Upstream-Status: backport [partial]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+
+Index: gcc-4.9.0/gcc/config.gcc
+===================================================================
+--- gcc-4.9.0.orig/gcc/config.gcc 2014-04-22 22:44:17.153567150 -0700
++++ gcc-4.9.0/gcc/config.gcc 2014-04-23 23:54:31.427357051 -0700
+@@ -594,7 +594,7 @@
+ esac
+
+ # Common C libraries.
+-tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3"
++tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4"
+
+ # 32-bit x86 processors supported by --with-arch=. Each processor
+ # MUST be separated by exactly one space.
+@@ -719,6 +719,9 @@
+ *-*-*uclibc*)
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
+ ;;
++ *-*-*musl*)
++ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
++ ;;
+ *)
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
+ ;;
+@@ -2328,6 +2331,11 @@
+ powerpc*-*-linux*paired*)
+ tm_file="${tm_file} rs6000/750cl.h" ;;
+ esac
++ case ${target} in
++ *-linux*-musl*)
++ enable_secureplt=yes ;;
++ esac
++
+ if test x${enable_secureplt} = xyes; then
+ tm_file="rs6000/secureplt.h ${tm_file}"
+ fi
+Index: gcc-4.9.0/gcc/config/linux.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/linux.h 2014-01-02 14:23:26.000000000 -0800
++++ gcc-4.9.0/gcc/config/linux.h 2014-04-24 00:11:29.034028895 -0700
+@@ -32,10 +32,12 @@
+ #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
+ #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
+ #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
++#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
+ #else
+ #define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
+ #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
+ #define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
++#define OPTION_MUSL (linux_libc == LIBC_MUSL)
+ #endif
+
+ #define GNU_USER_TARGET_OS_CPP_BUILTINS() \
+@@ -53,18 +55,21 @@
+ uClibc or Bionic is the default C library and whether
+ -muclibc or -mglibc or -mbionic has been passed to change the default. */
+
+-#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3) \
+- "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}"
++#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4) \
++ "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}"
+
+ #if DEFAULT_LIBC == LIBC_GLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
+- CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B)
++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
++ CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M)
+ #elif DEFAULT_LIBC == LIBC_UCLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
+- CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B)
++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
++ CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M)
+ #elif DEFAULT_LIBC == LIBC_BIONIC
+-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
+- CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U)
++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
++ CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M)
++#elif DEFAULT_LIBC == LIBC_MUSL
++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
++ CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B)
+ #else
+ #error "Unsupported DEFAULT_LIBC"
+ #endif /* DEFAULT_LIBC */
+@@ -84,16 +89,16 @@
+
+ #define GNU_USER_DYNAMIC_LINKER \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \
+- BIONIC_DYNAMIC_LINKER)
++ BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
+ #define GNU_USER_DYNAMIC_LINKER32 \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \
+- BIONIC_DYNAMIC_LINKER32)
++ BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
+ #define GNU_USER_DYNAMIC_LINKER64 \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \
+- BIONIC_DYNAMIC_LINKER64)
++ BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
+ #define GNU_USER_DYNAMIC_LINKERX32 \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \
+- BIONIC_DYNAMIC_LINKERX32)
++ BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKERX32)
+
+ /* Whether we have Bionic libc runtime */
+ #undef TARGET_HAS_BIONIC
+@@ -127,3 +132,74 @@
+ # define TARGET_LIBC_HAS_FUNCTION linux_libc_has_function
+
+ #endif
++
++/* musl avoids problematic includes by rearranging the include directories.
++ * Unfortunately, this is mostly duplicated from cppdefault.c */
++#if DEFAULT_LIBC == LIBC_MUSL
++#define INCLUDE_DEFAULTS_MUSL_GPP \
++ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, \
++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \
++ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, \
++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \
++ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, \
++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
++
++#ifdef LOCAL_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_LOCAL \
++ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, \
++ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
++#else
++#define INCLUDE_DEFAULTS_MUSL_LOCAL
++#endif
++
++#ifdef PREFIX_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_PREFIX \
++ { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0},
++#else
++#define INCLUDE_DEFAULTS_MUSL_PREFIX
++#endif
++
++#ifdef CROSS_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_CROSS \
++ { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0},
++#else
++#define INCLUDE_DEFAULTS_MUSL_CROSS
++#endif
++
++#ifdef TOOL_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_TOOL \
++ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0},
++#else
++#define INCLUDE_DEFAULTS_MUSL_TOOL
++#endif
++
++#ifdef NATIVE_SYSTEM_HEADER_DIR
++#define INCLUDE_DEFAULTS_MUSL_NATIVE \
++ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
++ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
++#else
++#define INCLUDE_DEFAULTS_MUSL_NATIVE
++#endif
++
++#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT)
++# undef INCLUDE_DEFAULTS_MUSL_LOCAL
++# define INCLUDE_DEFAULTS_MUSL_LOCAL
++# undef INCLUDE_DEFAULTS_MUSL_NATIVE
++# define INCLUDE_DEFAULTS_MUSL_NATIVE
++#else
++# undef INCLUDE_DEFAULTS_MUSL_CROSS
++# define INCLUDE_DEFAULTS_MUSL_CROSS
++#endif
++
++#undef INCLUDE_DEFAULTS
++#define INCLUDE_DEFAULTS \
++ { \
++ INCLUDE_DEFAULTS_MUSL_GPP \
++ INCLUDE_DEFAULTS_MUSL_PREFIX \
++ INCLUDE_DEFAULTS_MUSL_CROSS \
++ INCLUDE_DEFAULTS_MUSL_TOOL \
++ INCLUDE_DEFAULTS_MUSL_NATIVE \
++ { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \
++ { 0, 0, 0, 0, 0, 0 } \
++ }
++#endif
+Index: gcc-4.9.0/gcc/config/linux.opt
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/linux.opt 2014-01-02 14:23:26.000000000 -0800
++++ gcc-4.9.0/gcc/config/linux.opt 2014-04-22 22:44:17.280233817 -0700
+@@ -30,3 +30,7 @@
+ muclibc
+ Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic)
+ Use uClibc C library
++
++mmusl
++Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mglibc)
++Use musl C library
+Index: gcc-4.9.0/gcc/ginclude/stddef.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/ginclude/stddef.h 2014-01-02 14:23:26.000000000 -0800
++++ gcc-4.9.0/gcc/ginclude/stddef.h 2014-04-22 22:44:17.280233817 -0700
+@@ -181,6 +181,7 @@
+ #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
+@@ -197,6 +198,7 @@
+ #define ___int_size_t_h
+ #define _GCC_SIZE_T
+ #define _SIZET_
++#define __DEFINED_size_t /* musl */
+ #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \
+ || defined(__FreeBSD_kernel__)
+ /* __size_t is a typedef on FreeBSD 5, must not trash it. */
+@@ -214,6 +216,7 @@
+ typedef long ssize_t;
+ #endif /* __BEOS__ */
+ #endif /* !(defined (__GNUG__) && defined (size_t)) */
++#endif /* __DEFINED_size_t */
+ #endif /* __size_t */
+ #endif /* _SIZET_ */
+ #endif /* _GCC_SIZE_T */
+Index: gcc-4.9.0/gcc/config/rs6000/secureplt.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/rs6000/secureplt.h 2014-01-02 14:23:26.000000000 -0800
++++ gcc-4.9.0/gcc/config/rs6000/secureplt.h 2014-04-23 23:55:15.114024175 -0700
+@@ -18,3 +18,4 @@
+ <http://www.gnu.org/licenses/>. */
+
+ #define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt"
++#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt"
+Index: gcc-4.9.0/gcc/config/rs6000/sysv4.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/rs6000/sysv4.h 2014-04-23 23:52:13.854023015 -0700
++++ gcc-4.9.0/gcc/config/rs6000/sysv4.h 2014-04-24 00:10:55.550695334 -0700
+@@ -538,6 +538,10 @@
+ #define CC1_SECURE_PLT_DEFAULT_SPEC ""
+ #endif
+
++#ifndef LINK_SECURE_PLT_DEFAULT_SPEC
++#define LINK_SECURE_PLT_DEFAULT_SPEC ""
++#endif
++
+ /* Pass -G xxx to the compiler. */
+ #define CC1_SPEC "%{G*} %(cc1_cpu)" \
+ "%{meabi: %{!mcall-*: -mcall-sysv }} \
+@@ -585,7 +589,8 @@
+
+ /* Override the default target of the linker. */
+ #define LINK_TARGET_SPEC \
+- ENDIAN_SELECT("", " --oformat elf32-powerpcle", "")
++ ENDIAN_SELECT("", " --oformat elf32-powerpcle", "") \
++ "%{!mbss-plt: %{!msecure-plt: %(link_secure_plt_default)}}"
+
+ /* Any specific OS flags. */
+ #define LINK_OS_SPEC "\
+@@ -894,6 +899,7 @@
+ { "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \
+ { "link_os_default", LINK_OS_DEFAULT_SPEC }, \
+ { "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \
++ { "link_secure_plt_default", LINK_SECURE_PLT_DEFAULT_SPEC }, \
+ { "cpp_os_ads", CPP_OS_ADS_SPEC }, \
+ { "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \
+ { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0068-musl-dynamic-linker.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0068-musl-dynamic-linker.patch
new file mode 100644
index 000000000..605ac6675
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0068-musl-dynamic-linker.patch
@@ -0,0 +1,205 @@
+# HG changeset patch
+# Parent 6738fd6f6fcc2a72f2ba527bda3325642af26885
+Support for arm-linux-musl.
+Upstream-Status: Backport [partial]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+
+Index: gcc-4.9.2/gcc/config/arm/linux-eabi.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/config/arm/linux-eabi.h
++++ gcc-4.9.2/gcc/config/arm/linux-eabi.h
+@@ -81,6 +81,23 @@
+ #undef TARGET_FIX_V4BX_SPEC
+ #define TARGET_FIX_V4BX_SPEC "%{mcpu=arm8|mcpu=arm810|mcpu=strongarm*|march=armv4: --fix-v4bx}"
+
++/* For ARM musl currently supports four dynamic linkers:
++ - ld-musl-arm.so.1 - for the EABI-derived soft-float ABI
++ - ld-musl-armhf.so.1 - for the EABI-derived hard-float ABI
++ - ld-musl-armeb.so.1 - for the EABI-derived soft-float ABI, EB
++ - ld-musl-armebhf.so.1 - for the EABI-derived hard-float ABI, EB
++ musl does not support the legacy OABI mode.
++ All the dynamic linkers live in /lib.
++ We default to soft-float, EL. */
++#undef MUSL_DYNAMIC_LINKER
++#if TARGET_BIG_ENDIAN_DEFAULT
++#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:;:eb}"
++#else
++#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}"
++#endif
++#define MUSL_DYNAMIC_LINKER \
++ SYSTEMLIBS_DIR "ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1"
++
+ /* 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
+Index: gcc-4.9.2/libitm/config/arm/hwcap.cc
+===================================================================
+--- gcc-4.9.2.orig/libitm/config/arm/hwcap.cc
++++ gcc-4.9.2/libitm/config/arm/hwcap.cc
+@@ -40,7 +40,11 @@ int GTM_hwcap HIDDEN = 0
+
+ #ifdef __linux__
+ #include <unistd.h>
++#ifdef __GLIBC__
+ #include <sys/fcntl.h>
++#else
++#include <fcntl.h>
++#endif
+ #include <elf.h>
+
+ static void __attribute__((constructor))
+Index: gcc-4.9.2/gcc/config/i386/linux.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/config/i386/linux.h
++++ gcc-4.9.2/gcc/config/i386/linux.h
+@@ -21,3 +21,4 @@ along with GCC; see the file COPYING3.
+
+ #define GNU_USER_LINK_EMULATION "elf_i386"
+ #define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
++#define MUSL_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-musl-i386.so.1"
+Index: gcc-4.9.2/gcc/config/i386/linux64.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/config/i386/linux64.h
++++ gcc-4.9.2/gcc/config/i386/linux64.h
+@@ -30,3 +30,8 @@ see the files COPYING3 and COPYING.RUNTI
+ #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"
++
++#define MUSL_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-musl-i386.so.1"
++#define MUSL_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-musl-x86_64.so.1"
++#define MUSL_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ld-musl-x32.so.1"
++
+Index: gcc-4.9.2/gcc/config/mips/linux.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/config/mips/linux.h
++++ gcc-4.9.2/gcc/config/mips/linux.h
+@@ -23,3 +23,6 @@ along with GCC; see the file COPYING3.
+ #undef UCLIBC_DYNAMIC_LINKER
+ #define UCLIBC_DYNAMIC_LINKER \
+ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld-uClibc.so.0}"
++
++#define MUSL_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-musl-mips.so.1"
++
+Index: gcc-4.9.2/gcc/config/mips/linux64.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/config/mips/linux64.h
++++ gcc-4.9.2/gcc/config/mips/linux64.h
+@@ -39,6 +39,11 @@ along with GCC; see the file COPYING3.
+ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld-uClibc.so.0}"
+
+ #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
++
++#define MUSL_DYNAMIC_LINKERN32 SYSTEMLIBS_DIR "ld-musl-mips.so.1"
++#define MUSL_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-musl-mips.so.1"
++#define MUSL_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-musl-mips.so.1"
++
+ #define GNU_USER_DYNAMIC_LINKERN32 \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \
+- BIONIC_DYNAMIC_LINKERN32)
++ BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKERN32)
+Index: gcc-4.9.2/gcc/config/rs6000/linux64.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/config/rs6000/linux64.h
++++ gcc-4.9.2/gcc/config/rs6000/linux64.h
+@@ -375,17 +375,22 @@ extern int dot_symbols;
+ #endif
+ #define UCLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-uClibc.so.0"
+ #define UCLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld64-uClibc.so.0"
++#define MUSL_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-musl-powerpc.so.1"
++#define MUSL_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-musl-powerpc64.so.1"
++
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
+ #elif DEFAULT_LIBC == LIBC_GLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
++#elif DEFAULT_LIBC == LIBC_MUSL
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
+ #else
+ #error "Unsupported DEFAULT_LIBC"
+ #endif
+ #define GNU_USER_DYNAMIC_LINKER32 \
+- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32)
++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
+ #define GNU_USER_DYNAMIC_LINKER64 \
+- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
+
+ #undef DEFAULT_ASM_ENDIAN
+ #if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN)
+Index: gcc-4.9.2/gcc/config/rs6000/sysv4.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/config/rs6000/sysv4.h
++++ gcc-4.9.2/gcc/config/rs6000/sysv4.h
+@@ -768,15 +768,19 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+ #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc.so.1"
++
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
++#elif DEFAULT_LIBC == LIBC_MUSL
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
+ #elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
+ #else
+ #error "Unsupported DEFAULT_LIBC"
+ #endif
+ #define GNU_USER_DYNAMIC_LINKER \
+- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
+
+ #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
+ %{rdynamic:-export-dynamic} \
+Index: gcc-4.9.2/libitm/config/linux/x86/tls.h
+===================================================================
+--- gcc-4.9.2.orig/libitm/config/linux/x86/tls.h
++++ gcc-4.9.2/libitm/config/linux/x86/tls.h
+@@ -25,16 +25,19 @@
+ #ifndef LIBITM_X86_TLS_H
+ #define LIBITM_X86_TLS_H 1
+
+-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
++#if defined(__GLIBC_PREREQ)
++#if __GLIBC_PREREQ(2, 10)
+ /* Use slots in the TCB head rather than __thread lookups.
+ GLIBC has reserved words 10 through 13 for TM. */
+ #define HAVE_ARCH_GTM_THREAD 1
+ #define HAVE_ARCH_GTM_THREAD_DISP 1
+ #endif
++#endif
+
+ #include "config/generic/tls.h"
+
+-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
++#if defined(__GLIBC_PREREQ)
++#if __GLIBC_PREREQ(2, 10)
+ namespace GTM HIDDEN {
+
+ #ifdef __x86_64__
+@@ -101,5 +104,6 @@ static inline void set_abi_disp(struct a
+
+ } // namespace GTM
+ #endif /* >= GLIBC 2.10 */
++#endif
+
+ #endif // LIBITM_X86_TLS_H
+Index: gcc-4.9.2/gcc/config/aarch64/aarch64-linux.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/config/aarch64/aarch64-linux.h
++++ gcc-4.9.2/gcc/config/aarch64/aarch64-linux.h
+@@ -25,6 +25,8 @@
+
+ #define CPP_SPEC "%{pthread:-D_REENTRANT}"
+
++#define MUSL_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-musl-aarch64.so.1"
++
+ #define LINUX_TARGET_LINK_SPEC "%{h*} \
+ %{static:-Bstatic} \
+ %{shared:-shared} \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0069-musl-no-fixincludes.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0069-musl-no-fixincludes.patch
new file mode 100644
index 000000000..e2b18a402
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0069-musl-no-fixincludes.patch
@@ -0,0 +1,21 @@
+# HG changeset patch
+# Parent 600a8a422ccaf5627ad1f5a138e7398df2b9e9d8
+Get rid of ever-broken fixincludes on musl.
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+
+Index: gcc-4.9-20140316/fixincludes/mkfixinc.sh
+===================================================================
+--- gcc-4.9-20140316.orig/fixincludes/mkfixinc.sh
++++ gcc-4.9-20140316/fixincludes/mkfixinc.sh
+@@ -19,7 +19,8 @@ case $machine in
+ powerpc-*-eabi* | \
+ powerpc-*-rtems* | \
+ powerpcle-*-eabisim* | \
+- powerpcle-*-eabi* )
++ powerpcle-*-eabi* | \
++ *-musl* )
+ # IF there is no include fixing,
+ # THEN create a no-op fixer and exit
+ (echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0070-libstdc-musl.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0070-libstdc-musl.patch
new file mode 100644
index 000000000..048e481dc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0070-libstdc-musl.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: gcc-4.9-20140316/libstdc++-v3/configure.host
+===================================================================
+--- gcc-4.9-20140316.orig/libstdc++-v3/configure.host 2014-03-26 01:12:19.466008193 -0700
++++ gcc-4.9-20140316/libstdc++-v3/configure.host 2014-03-26 01:43:48.222684357 -0700
+@@ -264,14 +264,24 @@
+ os_include_dir="os/bsd/freebsd"
+ ;;
+ gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
++ # check for musl by target
++ case "${host_os}" in
++ *-musl*)
++ os_include_dir="os/generic"
++ ;;
++ *)
+ if [ "$uclibc" = "yes" ]; then
+ os_include_dir="os/uclibc"
+ elif [ "$bionic" = "yes" ]; then
+ os_include_dir="os/bionic"
++ elif [ "$musl" = "yes" ]; then
++ os_include_dir="os/generic"
+ else
+ os_include_dir="os/gnu-linux"
+ fi
+ ;;
++ esac
++ ;;
+ hpux*)
+ os_include_dir="os/hpux"
+ ;;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0071-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0071-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch
new file mode 100644
index 000000000..e8f79b590
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0071-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch
@@ -0,0 +1,31 @@
+From 32593b38082ea65f4c82159254adf1e0dc2423be Mon Sep 17 00:00:00 2001
+From: bernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Tue, 16 Feb 2016 03:15:15 -0500
+Subject: [PATCH] Ignore -fdebug-prefix-map in producer string (by Daniel Kahn
+ Gillmor)
+
+* dwarf2out.c (gen_producer_string): Ignore -fdebug-prefix-map.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231835 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Upstream-Status: Backport
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ gcc/dwarf2out.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
+index 3614c10..526f114 100644
+--- a/gcc/dwarf2out.c
++++ b/gcc/dwarf2out.c
+@@ -19670,6 +19670,7 @@ gen_producer_string (void)
+ case OPT_fpreprocessed:
+ case OPT_fltrans_output_list_:
+ case OPT_fresolution_:
++ case OPT_fdebug_prefix_map_:
+ /* Ignore these. */
+ continue;
+ default:
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0072-support-ffile-prefix-map.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0072-support-ffile-prefix-map.patch
new file mode 100644
index 000000000..9809a6a22
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0072-support-ffile-prefix-map.patch
@@ -0,0 +1,284 @@
+From e863be798ed13312a0faf0b961275f211a8123ab Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 17 Mar 2016 00:32:17 -0400
+Subject: [PATCH] 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 | 6 ++++
+ 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, 142 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 dd5fd23..9c004a1 100644
+--- a/gcc/c-family/c-opts.c
++++ b/gcc/c-family/c-opts.c
+@@ -36,6 +36,7 @@ along with GCC; see the file COPYING3. If not see
+ #include "options.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,
+@@ -553,6 +554,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 f295805..3a99662 100644
+--- a/gcc/c-family/c.opt
++++ b/gcc/c-family/c.opt
+@@ -928,6 +928,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 99bf6e2..3e58cfd 100644
+--- a/gcc/dwarf2out.c
++++ b/gcc/dwarf2out.c
+@@ -19199,6 +19199,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 89e7334..a7a97c0 100644
+--- a/gcc/gimplify.c
++++ b/gcc/gimplify.c
+@@ -59,6 +59,7 @@ along with GCC; see the file COPYING3. If not see
+ #include "omp-low.h"
+ #include "gimple-low.h"
+ #include "cilk.h"
++#include "file-map.h"
+
+ #include "langhooks-def.h" /* FIXME: for lhd_set_decl_assembler_name */
+ #include "tree-pass.h" /* FIXME: only for PROP_gimple_any */
+@@ -2288,6 +2289,7 @@ gimplify_call_expr (tree *expr_p, gimple_seq *pre_p, bool want_value)
+ case BUILT_IN_FILE:
+ {
+ expanded_location loc = expand_location (EXPR_LOCATION (*expr_p));
++ loc.file = remap_file_filename (loc.file);
+ *expr_p = build_string_literal (strlen (loc.file) + 1, loc.file);
+ return GS_OK;
+ }
+diff --git a/libcpp/Makefile.in b/libcpp/Makefile.in
+index 5561c97..5017256 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 0000000..04e851b
+--- /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 0000000..e6f8cbf
+--- /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 11e50f4..5c6f90e 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
+@@ -288,6 +289,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;
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0073-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0073-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch
new file mode 100644
index 000000000..94e45ed0a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0073-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch
@@ -0,0 +1,43 @@
+From 5e10baff84038d26dc3d59b2412ba1db92cb8274 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 17 Mar 2016 00:34:01 -0400
+Subject: [PATCH 2/2] 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 111884b..037f6c8 100644
+--- a/gcc/opts-global.c
++++ b/gcc/opts-global.c
+@@ -42,6 +42,7 @@ along with GCC; see the file COPYING3. If not see
+ #include "toplev.h"
+ #include "tree-pass.h"
+ #include "context.h"
++#include "file-map.h"
+
+ typedef const char *const_char_p; /* For DEF_VEC_P. */
+
+@@ -354,6 +355,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_:
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0074-fdebug-prefix-map-support-to-remap-relative-path.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0074-fdebug-prefix-map-support-to-remap-relative-path.patch
new file mode 100644
index 000000000..0b91fdbbc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0074-fdebug-prefix-map-support-to-remap-relative-path.patch
@@ -0,0 +1,51 @@
+From 289ad2969a5966c603bf6928ce442db74c4cbb25 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] 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>
+---
+diff --git a/gcc/final.c b/gcc/final.c
+index 55cf509..c3594c2 100644
+--- a/gcc/final.c
++++ b/gcc/final.c
+@@ -1554,16 +1554,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.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3.inc
new file mode 100644
index 000000000..9808be113
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3.inc
@@ -0,0 +1,143 @@
+require gcc-common.inc
+
+# Third digit in PV should be incremented after a minor release
+
+PV = "5.3.0"
+
+#SNAP = "5-20150405"
+
+# BINV should be incremented to a revision after a minor gcc release
+
+BINV = "5.3.0"
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/gcc-5.3:${FILE_DIRNAME}/gcc-5.3/backport:"
+
+DEPENDS =+ "mpfr gmp libmpc zlib"
+NATIVEDEPS = "mpfr-native gmp-native libmpc-native zlib-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 \
+"
+#BASEURI = "http://www.netgull.com/gcc/snapshots/${SNAP}/gcc-${SNAP}.tar.bz2"
+BASEURI = "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2"
+
+SRC_URI = "\
+ ${BASEURI} \
+ ${BACKPORTS} \
+ file://0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch \
+ file://0002-uclibc-conf.patch \
+ file://0003-gcc-uclibc-locale-ctype_touplow_t.patch \
+ file://0004-uclibc-locale.patch \
+ file://0005-uclibc-locale-no__x.patch \
+ file://0006-uclibc-locale-wchar_fix.patch \
+ file://0007-uclibc-locale-update.patch \
+ file://0008-missing-execinfo_h.patch \
+ file://0009-c99-snprintf.patch \
+ file://0010-gcc-poison-system-directories.patch \
+ file://0011-gcc-poison-dir-extend.patch \
+ file://0012-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch \
+ file://0013-64-bit-multilib-hack.patch \
+ file://0014-optional-libstdc.patch \
+ file://0015-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch \
+ file://0016-COLLECT_GCC_OPTIONS.patch \
+ file://0017-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch \
+ file://0018-fortran-cross-compile-hack.patch \
+ file://0019-libgcc-sjlj-check.patch \
+ file://0020-cpp-honor-sysroot.patch \
+ file://0021-MIPS64-Default-to-N64-ABI.patch \
+ file://0022-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch \
+ file://0023-gcc-Fix-argument-list-too-long-error.patch \
+ file://0024-Disable-sdt.patch \
+ file://0025-libtool.patch \
+ file://0026-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch \
+ file://0027-Use-the-multilib-config-files-from-B-instead-of-usin.patch \
+ file://0028-Avoid-using-libdir-from-.la-which-usually-points-to-.patch \
+ file://0029-export-CPP.patch \
+ file://0030-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch \
+ file://0031-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch \
+ file://0032-Ensure-target-gcc-headers-can-be-included.patch \
+ file://0033-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch \
+ file://0034-Don-t-search-host-directory-during-relink-if-inst_pr.patch \
+ file://0035-Dont-link-the-plugins-with-libgomp-explicitly.patch \
+ file://0036-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch \
+ file://0037-aarch64-Add-support-for-musl-ldso.patch \
+ file://0038-fix-g-sysroot.patch \
+ file://0039-libcc1-fix-libcc1-s-install-path-and-rpath.patch \
+ file://0040-handle-sysroot-support-for-nativesdk-gcc.patch \
+ file://0041-Search-target-sysroot-gcc-version-specific-dirs-with.patch \
+ file://0042-Fix-various-_FOR_BUILD-and-related-variables.patch \
+ file://0043-libstdc-Support-musl.patch \
+ file://0044-Adding-mmusl-as-a-musl-libc-specifier-and-the-necess.patch \
+ file://0045-Support-for-arm-linux-musl.patch \
+ file://0046-Get-rid-of-ever-broken-fixincludes-on-musl.patch \
+ file://0047-nios2-Define-MUSL_DYNAMIC_LINKER.patch \
+ file://0048-ssp_nonshared.patch \
+ file://0049-Disable-the-weak-reference-logic-in-gthr.h-for-os-ge.patch \
+ file://0050-powerpc-pass-secure-plt-to-the-linker.patch \
+ file://0051-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch \
+ file://0052-nios2-use-ret-with-r31.patch \
+ file://0053-expr.c-PR-target-65358-Avoid-clobbering-partial-argu.patch \
+ file://0054-support-ffile-prefix-map.patch \
+ file://0055-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch \
+ file://0056-Enable-libc-provide-ssp-and-gcc_cv_target_dl_iterate.patch \
+ file://0057-unwind-fix-for-musl.patch \
+ file://0058-fdebug-prefix-map-support-to-remap-relative-path.patch \
+"
+
+BACKPORTS = ""
+
+SRC_URI[md5sum] = "c9616fd448f980259c31de613e575719"
+SRC_URI[sha256sum] = "b84f5592e9218b73dbae612b5253035a7b34a9a1f7688d2e1bfaaf7267d5c4db"
+
+#S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${SNAP}"
+S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}"
+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} \
+ --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_append_libc-uclibc = " --disable-decimal-float "
+
+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/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch
new file mode 100644
index 000000000..1aead9691
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch
@@ -0,0 +1,42 @@
+From 6029bb338305a5d1403ee23427ed8d58eae1ff53 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/46] 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 a3f66ba..1cba3a9 100755
+--- a/configure
++++ b/configure
+@@ -7464,7 +7464,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 987dfab..d3adb95 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -3104,7 +3104,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.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0002-uclibc-conf.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0002-uclibc-conf.patch
new file mode 100644
index 000000000..8d6aeb5e4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0002-uclibc-conf.patch
@@ -0,0 +1,53 @@
+From b67c3a844bccec1766a7ec120e2d18cdcbc5f114 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:38:25 +0400
+Subject: [PATCH 02/46] uclibc-conf
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ contrib/regression/objs-gcc.sh | 4 ++++
+ libjava/classpath/ltconfig | 4 ++--
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/contrib/regression/objs-gcc.sh b/contrib/regression/objs-gcc.sh
+index 60b0497..6dc7ead 100755
+--- a/contrib/regression/objs-gcc.sh
++++ b/contrib/regression/objs-gcc.sh
+@@ -106,6 +106,10 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-gnu ]
+ then
+ make all-gdb all-dejagnu all-ld || exit 1
+ make install-gdb install-dejagnu install-ld || exit 1
++elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
++ then
++ make all-gdb all-dejagnu all-ld || exit 1
++ make install-gdb install-dejagnu install-ld || exit 1
+ elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
+ make bootstrap || exit 1
+ make install || exit 1
+diff --git a/libjava/classpath/ltconfig b/libjava/classpath/ltconfig
+index 743d951..ae4ea60 100755
+--- a/libjava/classpath/ltconfig
++++ b/libjava/classpath/ltconfig
+@@ -603,7 +603,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+-linux-gnu*) ;;
++linux-gnu*|linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1247,7 +1247,7 @@ linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0003-gcc-uclibc-locale-ctype_touplow_t.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0003-gcc-uclibc-locale-ctype_touplow_t.patch
new file mode 100644
index 000000000..bd0326343
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0003-gcc-uclibc-locale-ctype_touplow_t.patch
@@ -0,0 +1,87 @@
+From 9bcb3a1848ff0f8990301ca09a25b15c2cf90c6f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:40:12 +0400
+Subject: [PATCH 03/46] gcc-uclibc-locale-ctype_touplow_t
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/config/locale/generic/c_locale.cc | 5 +++++
+ libstdc++-v3/config/locale/generic/c_locale.h | 9 +++++++++
+ libstdc++-v3/config/os/gnu-linux/ctype_base.h | 9 +++++++++
+ 3 files changed, 23 insertions(+)
+
+diff --git a/libstdc++-v3/config/locale/generic/c_locale.cc b/libstdc++-v3/config/locale/generic/c_locale.cc
+index 6da5f22..2f85c2f 100644
+--- a/libstdc++-v3/config/locale/generic/c_locale.cc
++++ b/libstdc++-v3/config/locale/generic/c_locale.cc
+@@ -263,5 +263,10 @@ _GLIBCXX_END_NAMESPACE_VERSION
+ #ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
+ #define _GLIBCXX_LDBL_COMPAT(dbl, ldbl) \
+ extern "C" void ldbl (void) __attribute__ ((alias (#dbl)))
++#ifdef __UCLIBC__
++// This is because __c_locale is of type __ctype_touplow_t* which is short on uclibc. for glibc its int*
++_GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKPs, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKPs);
++#else
+ _GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKPi, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKPi);
++#endif
+ #endif // _GLIBCXX_LONG_DOUBLE_COMPAT
+diff --git a/libstdc++-v3/config/locale/generic/c_locale.h b/libstdc++-v3/config/locale/generic/c_locale.h
+index ee3ef86..7fd5485 100644
+--- a/libstdc++-v3/config/locale/generic/c_locale.h
++++ b/libstdc++-v3/config/locale/generic/c_locale.h
+@@ -40,13 +40,22 @@
+
+ #include <clocale>
+
++#ifdef __UCLIBC__
++#include <features.h>
++#include <ctype.h>
++#endif
++
+ #define _GLIBCXX_NUM_CATEGORIES 0
+
+ namespace std _GLIBCXX_VISIBILITY(default)
+ {
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+
++#ifdef __UCLIBC__
++ typedef __ctype_touplow_t* __c_locale;
++#else
+ typedef int* __c_locale;
++#endif
+
+ // Convert numeric value of type double and long double to string and
+ // return length of string. If vsnprintf is available use it, otherwise
+diff --git a/libstdc++-v3/config/os/gnu-linux/ctype_base.h b/libstdc++-v3/config/os/gnu-linux/ctype_base.h
+index fd52b73..2627cf3 100644
+--- a/libstdc++-v3/config/os/gnu-linux/ctype_base.h
++++ b/libstdc++-v3/config/os/gnu-linux/ctype_base.h
+@@ -33,6 +33,11 @@
+
+ // Information as gleaned from /usr/include/ctype.h
+
++#ifdef __UCLIBC__
++#include <features.h>
++#include <ctype.h>
++#endif
++
+ namespace std _GLIBCXX_VISIBILITY(default)
+ {
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -41,7 +46,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ struct ctype_base
+ {
+ // Non-standard typedefs.
++#ifdef __UCLIBC__
++ typedef const __ctype_touplow_t* __to_type;
++#else
+ typedef const int* __to_type;
++#endif
+
+ // NB: Offsets into ctype<char>::_M_table force a particular size
+ // on the mask type. Because of this, we don't use an enum.
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0004-uclibc-locale.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0004-uclibc-locale.patch
new file mode 100644
index 000000000..656265a28
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0004-uclibc-locale.patch
@@ -0,0 +1,2862 @@
+From bd9dd472d162fc72522f96f70f6391c7c63d2bf7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:41:39 +0400
+Subject: [PATCH 04/46] uclibc-locale
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/acinclude.m4 | 37 ++
+ .../config/locale/uclibc/c++locale_internal.h | 63 ++
+ libstdc++-v3/config/locale/uclibc/c_locale.cc | 160 +++++
+ libstdc++-v3/config/locale/uclibc/c_locale.h | 117 ++++
+ .../config/locale/uclibc/codecvt_members.cc | 308 +++++++++
+ .../config/locale/uclibc/collate_members.cc | 80 +++
+ libstdc++-v3/config/locale/uclibc/ctype_members.cc | 300 +++++++++
+ .../config/locale/uclibc/messages_members.cc | 100 +++
+ .../config/locale/uclibc/messages_members.h | 118 ++++
+ .../config/locale/uclibc/monetary_members.cc | 692 +++++++++++++++++++++
+ .../config/locale/uclibc/numeric_members.cc | 160 +++++
+ libstdc++-v3/config/locale/uclibc/time_members.cc | 406 ++++++++++++
+ libstdc++-v3/config/locale/uclibc/time_members.h | 68 ++
+ libstdc++-v3/configure | 75 +++
+ libstdc++-v3/include/c_compatibility/wchar.h | 2 +
+ libstdc++-v3/include/c_std/cwchar | 2 +
+ 16 files changed, 2688 insertions(+)
+ create mode 100644 libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+ create mode 100644 libstdc++-v3/config/locale/uclibc/c_locale.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/c_locale.h
+ create mode 100644 libstdc++-v3/config/locale/uclibc/codecvt_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/collate_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/ctype_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/messages_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/messages_members.h
+ create mode 100644 libstdc++-v3/config/locale/uclibc/monetary_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/numeric_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/time_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/time_members.h
+
+diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
+index 826ef86..79cc716 100644
+--- a/libstdc++-v3/acinclude.m4
++++ b/libstdc++-v3/acinclude.m4
+@@ -2029,6 +2029,9 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
+ # Default to "generic".
+ if test $enable_clocale_flag = auto; then
+ case ${target_os} in
++ *-uclibc*)
++ enable_clocale_flag=uclibc
++ ;;
+ linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
+ enable_clocale_flag=gnu
+ ;;
+@@ -2213,6 +2216,40 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
+ CTIME_CC=config/locale/generic/time_members.cc
+ CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
+ ;;
++ uclibc)
++ AC_MSG_RESULT(uclibc)
++
++ # Declare intention to use gettext, and add support for specific
++ # languages.
++ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
++ ALL_LINGUAS="de fr"
++
++ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
++ AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
++ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
++ USE_NLS=yes
++ fi
++ # Export the build objects.
++ for ling in $ALL_LINGUAS; do \
++ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
++ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
++ done
++ AC_SUBST(glibcxx_MOFILES)
++ AC_SUBST(glibcxx_POFILES)
++
++ CLOCALE_H=config/locale/uclibc/c_locale.h
++ CLOCALE_CC=config/locale/uclibc/c_locale.cc
++ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
++ CCOLLATE_CC=config/locale/uclibc/collate_members.cc
++ CCTYPE_CC=config/locale/uclibc/ctype_members.cc
++ CMESSAGES_H=config/locale/uclibc/messages_members.h
++ CMESSAGES_CC=config/locale/uclibc/messages_members.cc
++ CMONEY_CC=config/locale/uclibc/monetary_members.cc
++ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
++ CTIME_H=config/locale/uclibc/time_members.h
++ CTIME_CC=config/locale/uclibc/time_members.cc
++ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
++ ;;
+ esac
+
+ # This is where the testsuite looks for locale catalogs, using the
+diff --git a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+new file mode 100644
+index 0000000..2ae3e4a
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+@@ -0,0 +1,63 @@
++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
++
++// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++// Written by Jakub Jelinek <jakub@redhat.com>
++
++#include <bits/c++config.h>
++#include <clocale>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning clean this up
++#endif
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++
++extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
++extern "C" __typeof(strcoll_l) __strcoll_l;
++extern "C" __typeof(strftime_l) __strftime_l;
++extern "C" __typeof(strtod_l) __strtod_l;
++extern "C" __typeof(strtof_l) __strtof_l;
++extern "C" __typeof(strtold_l) __strtold_l;
++extern "C" __typeof(strxfrm_l) __strxfrm_l;
++extern "C" __typeof(newlocale) __newlocale;
++extern "C" __typeof(freelocale) __freelocale;
++extern "C" __typeof(duplocale) __duplocale;
++extern "C" __typeof(uselocale) __uselocale;
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++extern "C" __typeof(iswctype_l) __iswctype_l;
++extern "C" __typeof(towlower_l) __towlower_l;
++extern "C" __typeof(towupper_l) __towupper_l;
++extern "C" __typeof(wcscoll_l) __wcscoll_l;
++extern "C" __typeof(wcsftime_l) __wcsftime_l;
++extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
++extern "C" __typeof(wctype_l) __wctype_l;
++#endif
++
++#endif // GLIBC 2.3 and later
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.cc b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+new file mode 100644
+index 0000000..5081dc1
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+@@ -0,0 +1,160 @@
++// Wrapper for underlying C-language localization -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.8 Standard locale categories.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <cerrno> // For errno
++#include <locale>
++#include <stdexcept>
++#include <langinfo.h>
++#include <bits/c++locale_internal.h>
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
++#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
++#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
++#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
++#define __strtof_l(S, E, L) strtof((S), (E))
++#define __strtod_l(S, E, L) strtod((S), (E))
++#define __strtold_l(S, E, L) strtold((S), (E))
++#warning should dummy __newlocale check for C|POSIX ?
++#define __newlocale(a, b, c) NULL
++#define __freelocale(a) ((void)0)
++#define __duplocale(a) __c_locale()
++#endif
++
++namespace std
++{
++ template<>
++ void
++ __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
++ const __c_locale& __cloc)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ char* __sanity;
++ errno = 0;
++ float __f = __strtof_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __f;
++ else
++ __err |= ios_base::failbit;
++ }
++ }
++
++ template<>
++ void
++ __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
++ const __c_locale& __cloc)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ char* __sanity;
++ errno = 0;
++ double __d = __strtod_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __d;
++ else
++ __err |= ios_base::failbit;
++ }
++ }
++
++ template<>
++ void
++ __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
++ const __c_locale& __cloc)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ char* __sanity;
++ errno = 0;
++ long double __ld = __strtold_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __ld;
++ else
++ __err |= ios_base::failbit;
++ }
++ }
++
++ void
++ locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
++ __c_locale __old)
++ {
++ __cloc = __newlocale(1 << LC_ALL, __s, __old);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ if (!__cloc)
++ {
++ // This named locale is not supported by the underlying OS.
++ __throw_runtime_error(__N("locale::facet::_S_create_c_locale "
++ "name not valid"));
++ }
++#endif
++ }
++
++ void
++ locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
++ {
++ if (_S_get_c_locale() != __cloc)
++ __freelocale(__cloc);
++ }
++
++ __c_locale
++ locale::facet::_S_clone_c_locale(__c_locale& __cloc)
++ { return __duplocale(__cloc); }
++} // namespace std
++
++namespace __gnu_cxx
++{
++ const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
++ {
++ "LC_CTYPE",
++ "LC_NUMERIC",
++ "LC_TIME",
++ "LC_COLLATE",
++ "LC_MONETARY",
++ "LC_MESSAGES",
++#if _GLIBCXX_NUM_CATEGORIES != 0
++ "LC_PAPER",
++ "LC_NAME",
++ "LC_ADDRESS",
++ "LC_TELEPHONE",
++ "LC_MEASUREMENT",
++ "LC_IDENTIFICATION"
++#endif
++ };
++}
++
++namespace std
++{
++ const char* const* const locale::_S_categories = __gnu_cxx::category_names;
++} // namespace std
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.h b/libstdc++-v3/config/locale/uclibc/c_locale.h
+new file mode 100644
+index 0000000..da07c1f
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.h
+@@ -0,0 +1,117 @@
++// Wrapper for underlying C-language localization -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.8 Standard locale categories.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#ifndef _C_LOCALE_H
++#define _C_LOCALE_H 1
++
++#pragma GCC system_header
++
++#include <cstring> // get std::strlen
++#include <cstdio> // get std::snprintf or std::sprintf
++#include <clocale>
++#include <langinfo.h> // For codecvt
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this
++#endif
++#ifdef __UCLIBC_HAS_LOCALE__
++#include <iconv.h> // For codecvt using iconv, iconv_t
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++#include <libintl.h> // For messages
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning what is _GLIBCXX_C_LOCALE_GNU for
++#endif
++#define _GLIBCXX_C_LOCALE_GNU 1
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix categories
++#endif
++// #define _GLIBCXX_NUM_CATEGORIES 6
++#define _GLIBCXX_NUM_CATEGORIES 0
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++namespace __gnu_cxx
++{
++ extern "C" __typeof(uselocale) __uselocale;
++}
++#endif
++
++namespace std
++{
++#ifdef __UCLIBC_HAS_XLOCALE__
++ typedef __locale_t __c_locale;
++#else
++ typedef int* __c_locale;
++#endif
++
++ // Convert numeric value of type _Tv to string and return length of
++ // string. If snprintf is available use it, otherwise fall back to
++ // the unsafe sprintf which, in general, can be dangerous and should
++ // be avoided.
++ template<typename _Tv>
++ int
++ __convert_from_v(char* __out,
++ const int __size __attribute__ ((__unused__)),
++ const char* __fmt,
++#ifdef __UCLIBC_HAS_XCLOCALE__
++ _Tv __v, const __c_locale& __cloc, int __prec)
++ {
++ __c_locale __old = __gnu_cxx::__uselocale(__cloc);
++#else
++ _Tv __v, const __c_locale&, int __prec)
++ {
++# ifdef __UCLIBC_HAS_LOCALE__
++ char* __old = std::setlocale(LC_ALL, NULL);
++ char* __sav = new char[std::strlen(__old) + 1];
++ std::strcpy(__sav, __old);
++ std::setlocale(LC_ALL, "C");
++# endif
++#endif
++
++ const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
++
++#ifdef __UCLIBC_HAS_XCLOCALE__
++ __gnu_cxx::__uselocale(__old);
++#elif defined __UCLIBC_HAS_LOCALE__
++ std::setlocale(LC_ALL, __sav);
++ delete [] __sav;
++#endif
++ return __ret;
++ }
++}
++
++#endif
+diff --git a/libstdc++-v3/config/locale/uclibc/codecvt_members.cc b/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
+new file mode 100644
+index 0000000..64aa962
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
+@@ -0,0 +1,308 @@
++// std::codecvt implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.1.5 - Template class codecvt
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <cstdlib> // For MB_CUR_MAX
++#include <climits> // For MB_LEN_MAX
++#include <bits/c++locale_internal.h>
++
++namespace std
++{
++ // Specializations.
++#ifdef _GLIBCXX_USE_WCHAR_T
++ codecvt_base::result
++ codecvt<wchar_t, char, mbstate_t>::
++ do_out(state_type& __state, const intern_type* __from,
++ const intern_type* __from_end, const intern_type*& __from_next,
++ extern_type* __to, extern_type* __to_end,
++ extern_type*& __to_next) const
++ {
++ result __ret = ok;
++ state_type __tmp_state(__state);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++
++ // wcsnrtombs is *very* fast but stops if encounters NUL characters:
++ // in case we fall back to wcrtomb and then continue, in a loop.
++ // NB: wcsnrtombs is a GNU extension
++ for (__from_next = __from, __to_next = __to;
++ __from_next < __from_end && __to_next < __to_end
++ && __ret == ok;)
++ {
++ const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
++ __from_end - __from_next);
++ if (!__from_chunk_end)
++ __from_chunk_end = __from_end;
++
++ __from = __from_next;
++ const size_t __conv = wcsnrtombs(__to_next, &__from_next,
++ __from_chunk_end - __from_next,
++ __to_end - __to_next, &__state);
++ if (__conv == static_cast<size_t>(-1))
++ {
++ // In case of error, in order to stop at the exact place we
++ // have to start again from the beginning with a series of
++ // wcrtomb.
++ for (; __from < __from_next; ++__from)
++ __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
++ __state = __tmp_state;
++ __ret = error;
++ }
++ else if (__from_next && __from_next < __from_chunk_end)
++ {
++ __to_next += __conv;
++ __ret = partial;
++ }
++ else
++ {
++ __from_next = __from_chunk_end;
++ __to_next += __conv;
++ }
++
++ if (__from_next < __from_end && __ret == ok)
++ {
++ extern_type __buf[MB_LEN_MAX];
++ __tmp_state = __state;
++ const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
++ if (__conv > static_cast<size_t>(__to_end - __to_next))
++ __ret = partial;
++ else
++ {
++ memcpy(__to_next, __buf, __conv);
++ __state = __tmp_state;
++ __to_next += __conv;
++ ++__from_next;
++ }
++ }
++ }
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++
++ return __ret;
++ }
++
++ codecvt_base::result
++ codecvt<wchar_t, char, mbstate_t>::
++ do_in(state_type& __state, const extern_type* __from,
++ const extern_type* __from_end, const extern_type*& __from_next,
++ intern_type* __to, intern_type* __to_end,
++ intern_type*& __to_next) const
++ {
++ result __ret = ok;
++ state_type __tmp_state(__state);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++
++ // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
++ // in case we store a L'\0' and then continue, in a loop.
++ // NB: mbsnrtowcs is a GNU extension
++ for (__from_next = __from, __to_next = __to;
++ __from_next < __from_end && __to_next < __to_end
++ && __ret == ok;)
++ {
++ const extern_type* __from_chunk_end;
++ __from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
++ __from_end
++ - __from_next));
++ if (!__from_chunk_end)
++ __from_chunk_end = __from_end;
++
++ __from = __from_next;
++ size_t __conv = mbsnrtowcs(__to_next, &__from_next,
++ __from_chunk_end - __from_next,
++ __to_end - __to_next, &__state);
++ if (__conv == static_cast<size_t>(-1))
++ {
++ // In case of error, in order to stop at the exact place we
++ // have to start again from the beginning with a series of
++ // mbrtowc.
++ for (;; ++__to_next, __from += __conv)
++ {
++ __conv = mbrtowc(__to_next, __from, __from_end - __from,
++ &__tmp_state);
++ if (__conv == static_cast<size_t>(-1)
++ || __conv == static_cast<size_t>(-2))
++ break;
++ }
++ __from_next = __from;
++ __state = __tmp_state;
++ __ret = error;
++ }
++ else if (__from_next && __from_next < __from_chunk_end)
++ {
++ // It is unclear what to return in this case (see DR 382).
++ __to_next += __conv;
++ __ret = partial;
++ }
++ else
++ {
++ __from_next = __from_chunk_end;
++ __to_next += __conv;
++ }
++
++ if (__from_next < __from_end && __ret == ok)
++ {
++ if (__to_next < __to_end)
++ {
++ // XXX Probably wrong for stateful encodings
++ __tmp_state = __state;
++ ++__from_next;
++ *__to_next++ = L'\0';
++ }
++ else
++ __ret = partial;
++ }
++ }
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++
++ return __ret;
++ }
++
++ int
++ codecvt<wchar_t, char, mbstate_t>::
++ do_encoding() const throw()
++ {
++ // XXX This implementation assumes that the encoding is
++ // stateless and is either single-byte or variable-width.
++ int __ret = 0;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++ if (MB_CUR_MAX == 1)
++ __ret = 1;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return __ret;
++ }
++
++ int
++ codecvt<wchar_t, char, mbstate_t>::
++ do_max_length() const throw()
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++ // XXX Probably wrong for stateful encodings.
++ int __ret = MB_CUR_MAX;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return __ret;
++ }
++
++ int
++ codecvt<wchar_t, char, mbstate_t>::
++ do_length(state_type& __state, const extern_type* __from,
++ const extern_type* __end, size_t __max) const
++ {
++ int __ret = 0;
++ state_type __tmp_state(__state);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++
++ // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
++ // in case we advance past it and then continue, in a loop.
++ // NB: mbsnrtowcs is a GNU extension
++
++ // A dummy internal buffer is needed in order for mbsnrtocws to consider
++ // its fourth parameter (it wouldn't with NULL as first parameter).
++ wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t)
++ * __max));
++ while (__from < __end && __max)
++ {
++ const extern_type* __from_chunk_end;
++ __from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
++ __end
++ - __from));
++ if (!__from_chunk_end)
++ __from_chunk_end = __end;
++
++ const extern_type* __tmp_from = __from;
++ size_t __conv = mbsnrtowcs(__to, &__from,
++ __from_chunk_end - __from,
++ __max, &__state);
++ if (__conv == static_cast<size_t>(-1))
++ {
++ // In case of error, in order to stop at the exact place we
++ // have to start again from the beginning with a series of
++ // mbrtowc.
++ for (__from = __tmp_from;; __from += __conv)
++ {
++ __conv = mbrtowc(NULL, __from, __end - __from,
++ &__tmp_state);
++ if (__conv == static_cast<size_t>(-1)
++ || __conv == static_cast<size_t>(-2))
++ break;
++ }
++ __state = __tmp_state;
++ __ret += __from - __tmp_from;
++ break;
++ }
++ if (!__from)
++ __from = __from_chunk_end;
++
++ __ret += __from - __tmp_from;
++ __max -= __conv;
++
++ if (__from < __end && __max)
++ {
++ // XXX Probably wrong for stateful encodings
++ __tmp_state = __state;
++ ++__from;
++ ++__ret;
++ --__max;
++ }
++ }
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++
++ return __ret;
++ }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/collate_members.cc b/libstdc++-v3/config/locale/uclibc/collate_members.cc
+new file mode 100644
+index 0000000..c2664a7
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/collate_members.cc
+@@ -0,0 +1,80 @@
++// std::collate implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.4.1.2 collate virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
++#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
++#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
++#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
++#endif
++
++namespace std
++{
++ // These are basically extensions to char_traits, and perhaps should
++ // be put there instead of here.
++ template<>
++ int
++ collate<char>::_M_compare(const char* __one, const char* __two) const
++ {
++ int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
++ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
++ }
++
++ template<>
++ size_t
++ collate<char>::_M_transform(char* __to, const char* __from,
++ size_t __n) const
++ { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ int
++ collate<wchar_t>::_M_compare(const wchar_t* __one,
++ const wchar_t* __two) const
++ {
++ int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
++ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
++ }
++
++ template<>
++ size_t
++ collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
++ size_t __n) const
++ { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/ctype_members.cc b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+new file mode 100644
+index 0000000..7294e3a
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+@@ -0,0 +1,300 @@
++// std::ctype implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __wctype_l(S, L) wctype((S))
++#define __towupper_l(C, L) towupper((C))
++#define __towlower_l(C, L) towlower((C))
++#define __iswctype_l(C, M, L) iswctype((C), (M))
++#endif
++
++namespace std
++{
++ // NB: The other ctype<char> specializations are in src/locale.cc and
++ // various /config/os/* files.
++ template<>
++ ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
++ : ctype<char>(0, false, __refs)
++ {
++ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
++ {
++ this->_S_destroy_c_locale(this->_M_c_locale_ctype);
++ this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
++ this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
++ this->_M_table = this->_M_c_locale_ctype->__ctype_b;
++#endif
++ }
++ }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ ctype<wchar_t>::__wmask_type
++ ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
++ {
++ __wmask_type __ret;
++ switch (__m)
++ {
++ case space:
++ __ret = __wctype_l("space", _M_c_locale_ctype);
++ break;
++ case print:
++ __ret = __wctype_l("print", _M_c_locale_ctype);
++ break;
++ case cntrl:
++ __ret = __wctype_l("cntrl", _M_c_locale_ctype);
++ break;
++ case upper:
++ __ret = __wctype_l("upper", _M_c_locale_ctype);
++ break;
++ case lower:
++ __ret = __wctype_l("lower", _M_c_locale_ctype);
++ break;
++ case alpha:
++ __ret = __wctype_l("alpha", _M_c_locale_ctype);
++ break;
++ case digit:
++ __ret = __wctype_l("digit", _M_c_locale_ctype);
++ break;
++ case punct:
++ __ret = __wctype_l("punct", _M_c_locale_ctype);
++ break;
++ case xdigit:
++ __ret = __wctype_l("xdigit", _M_c_locale_ctype);
++ break;
++ case alnum:
++ __ret = __wctype_l("alnum", _M_c_locale_ctype);
++ break;
++ case graph:
++ __ret = __wctype_l("graph", _M_c_locale_ctype);
++ break;
++ default:
++ __ret = __wmask_type();
++ }
++ return __ret;
++ }
++
++ wchar_t
++ ctype<wchar_t>::do_toupper(wchar_t __c) const
++ { return __towupper_l(__c, _M_c_locale_ctype); }
++
++ const wchar_t*
++ ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
++ {
++ while (__lo < __hi)
++ {
++ *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
++ ++__lo;
++ }
++ return __hi;
++ }
++
++ wchar_t
++ ctype<wchar_t>::do_tolower(wchar_t __c) const
++ { return __towlower_l(__c, _M_c_locale_ctype); }
++
++ const wchar_t*
++ ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
++ {
++ while (__lo < __hi)
++ {
++ *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
++ ++__lo;
++ }
++ return __hi;
++ }
++
++ bool
++ ctype<wchar_t>::
++ do_is(mask __m, wchar_t __c) const
++ {
++ // Highest bitmask in ctype_base == 10, but extra in "C"
++ // library for blank.
++ bool __ret = false;
++ const size_t __bitmasksize = 11;
++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++ if (__m & _M_bit[__bitcur]
++ && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
++ {
++ __ret = true;
++ break;
++ }
++ return __ret;
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
++ {
++ for (; __lo < __hi; ++__vec, ++__lo)
++ {
++ // Highest bitmask in ctype_base == 10, but extra in "C"
++ // library for blank.
++ const size_t __bitmasksize = 11;
++ mask __m = 0;
++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++ if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
++ __m |= _M_bit[__bitcur];
++ *__vec = __m;
++ }
++ return __hi;
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
++ {
++ while (__lo < __hi && !this->do_is(__m, *__lo))
++ ++__lo;
++ return __lo;
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
++ {
++ while (__lo < __hi && this->do_is(__m, *__lo) != 0)
++ ++__lo;
++ return __lo;
++ }
++
++ wchar_t
++ ctype<wchar_t>::
++ do_widen(char __c) const
++ { return _M_widen[static_cast<unsigned char>(__c)]; }
++
++ const char*
++ ctype<wchar_t>::
++ do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
++ {
++ while (__lo < __hi)
++ {
++ *__dest = _M_widen[static_cast<unsigned char>(*__lo)];
++ ++__lo;
++ ++__dest;
++ }
++ return __hi;
++ }
++
++ char
++ ctype<wchar_t>::
++ do_narrow(wchar_t __wc, char __dfault) const
++ {
++ if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
++ return _M_narrow[__wc];
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++ const int __c = wctob(__wc);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return (__c == EOF ? __dfault : static_cast<char>(__c));
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
++ char* __dest) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++ if (_M_narrow_ok)
++ while (__lo < __hi)
++ {
++ if (*__lo >= 0 && *__lo < 128)
++ *__dest = _M_narrow[*__lo];
++ else
++ {
++ const int __c = wctob(*__lo);
++ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
++ }
++ ++__lo;
++ ++__dest;
++ }
++ else
++ while (__lo < __hi)
++ {
++ const int __c = wctob(*__lo);
++ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
++ ++__lo;
++ ++__dest;
++ }
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return __hi;
++ }
++
++ void
++ ctype<wchar_t>::_M_initialize_ctype()
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++ wint_t __i;
++ for (__i = 0; __i < 128; ++__i)
++ {
++ const int __c = wctob(__i);
++ if (__c == EOF)
++ break;
++ else
++ _M_narrow[__i] = static_cast<char>(__c);
++ }
++ if (__i == 128)
++ _M_narrow_ok = true;
++ else
++ _M_narrow_ok = false;
++ for (size_t __j = 0;
++ __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
++ _M_widen[__j] = btowc(__j);
++
++ for (size_t __k = 0; __k <= 11; ++__k)
++ {
++ _M_bit[__k] = static_cast<mask>(_ISbit(__k));
++ _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
++ }
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ }
++#endif // _GLIBCXX_USE_WCHAR_T
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.cc b/libstdc++-v3/config/locale/uclibc/messages_members.cc
+new file mode 100644
+index 0000000..13594d9
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.cc
+@@ -0,0 +1,100 @@
++// std::messages implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix gettext stuff
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++extern "C" char *__dcgettext(const char *domainname,
++ const char *msgid, int category);
++#undef gettext
++#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
++#else
++#undef gettext
++#define gettext(msgid) (msgid)
++#endif
++
++namespace std
++{
++ // Specializations.
++ template<>
++ string
++ messages<char>::do_get(catalog, int, int, const string& __dfault) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_messages);
++ const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
++ __uselocale(__old);
++ return string(__msg);
++#elif defined __UCLIBC_HAS_LOCALE__
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_messages);
++ const char* __msg = gettext(__dfault.c_str());
++ setlocale(LC_ALL, __old);
++ free(__old);
++ return string(__msg);
++#else
++ const char* __msg = gettext(__dfault.c_str());
++ return string(__msg);
++#endif
++ }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ wstring
++ messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
++ {
++# ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_messages);
++ char* __msg = gettext(_M_convert_to_char(__dfault));
++ __uselocale(__old);
++ return _M_convert_from_char(__msg);
++# elif defined __UCLIBC_HAS_LOCALE__
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_messages);
++ char* __msg = gettext(_M_convert_to_char(__dfault));
++ setlocale(LC_ALL, __old);
++ free(__old);
++ return _M_convert_from_char(__msg);
++# else
++ char* __msg = gettext(_M_convert_to_char(__dfault));
++ return _M_convert_from_char(__msg);
++# endif
++ }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h
+new file mode 100644
+index 0000000..1424078
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h
+@@ -0,0 +1,118 @@
++// std::messages implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.7.1.2 messages functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix prototypes for *textdomain funcs
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++extern "C" char *__textdomain(const char *domainname);
++extern "C" char *__bindtextdomain(const char *domainname,
++ const char *dirname);
++#else
++#undef __textdomain
++#undef __bindtextdomain
++#define __textdomain(D) ((void)0)
++#define __bindtextdomain(D,P) ((void)0)
++#endif
++
++ // Non-virtual member functions.
++ template<typename _CharT>
++ messages<_CharT>::messages(size_t __refs)
++ : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
++ _M_name_messages(_S_get_c_name())
++ { }
++
++ template<typename _CharT>
++ messages<_CharT>::messages(__c_locale __cloc, const char* __s,
++ size_t __refs)
++ : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
++ _M_name_messages(__s)
++ {
++ char* __tmp = new char[std::strlen(__s) + 1];
++ std::strcpy(__tmp, __s);
++ _M_name_messages = __tmp;
++ }
++
++ template<typename _CharT>
++ typename messages<_CharT>::catalog
++ messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
++ const char* __dir) const
++ {
++ __bindtextdomain(__s.c_str(), __dir);
++ return this->do_open(__s, __loc);
++ }
++
++ // Virtual member functions.
++ template<typename _CharT>
++ messages<_CharT>::~messages()
++ {
++ if (_M_name_messages != _S_get_c_name())
++ delete [] _M_name_messages;
++ _S_destroy_c_locale(_M_c_locale_messages);
++ }
++
++ template<typename _CharT>
++ typename messages<_CharT>::catalog
++ messages<_CharT>::do_open(const basic_string<char>& __s,
++ const locale&) const
++ {
++ // No error checking is done, assume the catalog exists and can
++ // be used.
++ __textdomain(__s.c_str());
++ return 0;
++ }
++
++ template<typename _CharT>
++ void
++ messages<_CharT>::do_close(catalog) const
++ { }
++
++ // messages_byname
++ template<typename _CharT>
++ messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
++ : messages<_CharT>(__refs)
++ {
++ if (this->_M_name_messages != locale::facet::_S_get_c_name())
++ delete [] this->_M_name_messages;
++ char* __tmp = new char[std::strlen(__s) + 1];
++ std::strcpy(__tmp, __s);
++ this->_M_name_messages = __tmp;
++
++ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
++ {
++ this->_S_destroy_c_locale(this->_M_c_locale_messages);
++ this->_S_create_c_locale(this->_M_c_locale_messages, __s);
++ }
++ }
+diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+new file mode 100644
+index 0000000..aa52731
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -0,0 +1,692 @@
++// std::moneypunct implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning optimize this for uclibc
++#warning tailor for stub locale support
++#endif
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __nl_langinfo_l(N, L) nl_langinfo((N))
++#endif
++
++namespace std
++{
++ // Construct and return valid pattern consisting of some combination of:
++ // space none symbol sign value
++ money_base::pattern
++ money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
++ {
++ pattern __ret;
++
++ // This insanely complicated routine attempts to construct a valid
++ // pattern for use with monyepunct. A couple of invariants:
++
++ // if (__precedes) symbol -> value
++ // else value -> symbol
++
++ // if (__space) space
++ // else none
++
++ // none == never first
++ // space never first or last
++
++ // Any elegant implementations of this are welcome.
++ switch (__posn)
++ {
++ case 0:
++ case 1:
++ // 1 The sign precedes the value and symbol.
++ __ret.field[0] = sign;
++ if (__space)
++ {
++ // Pattern starts with sign.
++ if (__precedes)
++ {
++ __ret.field[1] = symbol;
++ __ret.field[3] = value;
++ }
++ else
++ {
++ __ret.field[1] = value;
++ __ret.field[3] = symbol;
++ }
++ __ret.field[2] = space;
++ }
++ else
++ {
++ // Pattern starts with sign and ends with none.
++ if (__precedes)
++ {
++ __ret.field[1] = symbol;
++ __ret.field[2] = value;
++ }
++ else
++ {
++ __ret.field[1] = value;
++ __ret.field[2] = symbol;
++ }
++ __ret.field[3] = none;
++ }
++ break;
++ case 2:
++ // 2 The sign follows the value and symbol.
++ if (__space)
++ {
++ // Pattern either ends with sign.
++ if (__precedes)
++ {
++ __ret.field[0] = symbol;
++ __ret.field[2] = value;
++ }
++ else
++ {
++ __ret.field[0] = value;
++ __ret.field[2] = symbol;
++ }
++ __ret.field[1] = space;
++ __ret.field[3] = sign;
++ }
++ else
++ {
++ // Pattern ends with sign then none.
++ if (__precedes)
++ {
++ __ret.field[0] = symbol;
++ __ret.field[1] = value;
++ }
++ else
++ {
++ __ret.field[0] = value;
++ __ret.field[1] = symbol;
++ }
++ __ret.field[2] = sign;
++ __ret.field[3] = none;
++ }
++ break;
++ case 3:
++ // 3 The sign immediately precedes the symbol.
++ if (__precedes)
++ {
++ __ret.field[0] = sign;
++ __ret.field[1] = symbol;
++ if (__space)
++ {
++ __ret.field[2] = space;
++ __ret.field[3] = value;
++ }
++ else
++ {
++ __ret.field[2] = value;
++ __ret.field[3] = none;
++ }
++ }
++ else
++ {
++ __ret.field[0] = value;
++ if (__space)
++ {
++ __ret.field[1] = space;
++ __ret.field[2] = sign;
++ __ret.field[3] = symbol;
++ }
++ else
++ {
++ __ret.field[1] = sign;
++ __ret.field[2] = symbol;
++ __ret.field[3] = none;
++ }
++ }
++ break;
++ case 4:
++ // 4 The sign immediately follows the symbol.
++ if (__precedes)
++ {
++ __ret.field[0] = symbol;
++ __ret.field[1] = sign;
++ if (__space)
++ {
++ __ret.field[2] = space;
++ __ret.field[3] = value;
++ }
++ else
++ {
++ __ret.field[2] = value;
++ __ret.field[3] = none;
++ }
++ }
++ else
++ {
++ __ret.field[0] = value;
++ if (__space)
++ {
++ __ret.field[1] = space;
++ __ret.field[2] = symbol;
++ __ret.field[3] = sign;
++ }
++ else
++ {
++ __ret.field[1] = symbol;
++ __ret.field[2] = sign;
++ __ret.field[3] = none;
++ }
++ }
++ break;
++ default:
++ ;
++ }
++ return __ret;
++ }
++
++ template<>
++ void
++ moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
++ const char*)
++ {
++ if (!_M_data)
++ _M_data = new __moneypunct_cache<char, true>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_decimal_point = '.';
++ _M_data->_M_thousands_sep = ',';
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_curr_symbol = "";
++ _M_data->_M_curr_symbol_size = 0;
++ _M_data->_M_positive_sign = "";
++ _M_data->_M_positive_sign_size = 0;
++ _M_data->_M_negative_sign = "";
++ _M_data->_M_negative_sign_size = 0;
++ _M_data->_M_frac_digits = 0;
++ _M_data->_M_pos_format = money_base::_S_default_pattern;
++ _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
++ }
++ else
++ {
++ // Named locale.
++ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
++ __cloc));
++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
++ __cloc));
++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
++
++ char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
++ if (!__nposn)
++ _M_data->_M_negative_sign = "()";
++ else
++ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
++ __cloc);
++ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
++
++ // _Intl == true
++ _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
++ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
++ __cloc));
++ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
++ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
++ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++ __pposn);
++ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
++ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++ __nposn);
++ }
++ }
++
++ template<>
++ void
++ moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
++ const char*)
++ {
++ if (!_M_data)
++ _M_data = new __moneypunct_cache<char, false>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_decimal_point = '.';
++ _M_data->_M_thousands_sep = ',';
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_curr_symbol = "";
++ _M_data->_M_curr_symbol_size = 0;
++ _M_data->_M_positive_sign = "";
++ _M_data->_M_positive_sign_size = 0;
++ _M_data->_M_negative_sign = "";
++ _M_data->_M_negative_sign_size = 0;
++ _M_data->_M_frac_digits = 0;
++ _M_data->_M_pos_format = money_base::_S_default_pattern;
++ _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
++ }
++ else
++ {
++ // Named locale.
++ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
++ __cloc));
++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
++ __cloc));
++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
++
++ char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
++ if (!__nposn)
++ _M_data->_M_negative_sign = "()";
++ else
++ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
++ __cloc);
++ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
++
++ // _Intl == false
++ _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
++ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
++ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
++ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
++ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++ __pposn);
++ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
++ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++ __nposn);
++ }
++ }
++
++ template<>
++ moneypunct<char, true>::~moneypunct()
++ { delete _M_data; }
++
++ template<>
++ moneypunct<char, false>::~moneypunct()
++ { delete _M_data; }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ void
++ moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
++#ifdef __UCLIBC_HAS_XLOCALE__
++ const char*)
++#else
++ const char* __name)
++#endif
++ {
++ if (!_M_data)
++ _M_data = new __moneypunct_cache<wchar_t, true>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_decimal_point = L'.';
++ _M_data->_M_thousands_sep = L',';
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_curr_symbol = L"";
++ _M_data->_M_curr_symbol_size = 0;
++ _M_data->_M_positive_sign = L"";
++ _M_data->_M_positive_sign_size = 0;
++ _M_data->_M_negative_sign = L"";
++ _M_data->_M_negative_sign_size = 0;
++ _M_data->_M_frac_digits = 0;
++ _M_data->_M_pos_format = money_base::_S_default_pattern;
++ _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++ // Use ctype::widen code without the facet...
++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++ _M_data->_M_atoms[__i] =
++ static_cast<wchar_t>(money_base::_S_atoms[__i]);
++ }
++ else
++ {
++ // Named locale.
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(__cloc);
++#else
++ // Switch to named locale so that mbsrtowcs will work.
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, __name);
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this... should be monetary
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
++# else
++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++ union { char *__s; wchar_t __w; } __u;
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
++ _M_data->_M_decimal_point = __u.__w;
++
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
++ _M_data->_M_thousands_sep = __u.__w;
++#endif
++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++
++ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
++ const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
++
++ wchar_t* __wcs_ps = 0;
++ wchar_t* __wcs_ns = 0;
++ const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
++ try
++ {
++ mbstate_t __state;
++ size_t __len = strlen(__cpossign);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ __wcs_ps = new wchar_t[__len];
++ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
++ _M_data->_M_positive_sign = __wcs_ps;
++ }
++ else
++ _M_data->_M_positive_sign = L"";
++ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
++
++ __len = strlen(__cnegsign);
++ if (!__nposn)
++ _M_data->_M_negative_sign = L"()";
++ else if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ __wcs_ns = new wchar_t[__len];
++ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
++ _M_data->_M_negative_sign = __wcs_ns;
++ }
++ else
++ _M_data->_M_negative_sign = L"";
++ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
++
++ // _Intl == true.
++ __len = strlen(__ccurr);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ wchar_t* __wcs = new wchar_t[__len];
++ mbsrtowcs(__wcs, &__ccurr, __len, &__state);
++ _M_data->_M_curr_symbol = __wcs;
++ }
++ else
++ _M_data->_M_curr_symbol = L"";
++ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
++ }
++ catch (...)
++ {
++ delete _M_data;
++ _M_data = 0;
++ delete __wcs_ps;
++ delete __wcs_ns;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#else
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ __throw_exception_again;
++ }
++
++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
++ __cloc));
++ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
++ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
++ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++ __pposn);
++ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
++ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++ __nposn);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#else
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ }
++ }
++
++ template<>
++ void
++ moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
++#ifdef __UCLIBC_HAS_XLOCALE__
++ const char*)
++#else
++ const char* __name)
++#endif
++ {
++ if (!_M_data)
++ _M_data = new __moneypunct_cache<wchar_t, false>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_decimal_point = L'.';
++ _M_data->_M_thousands_sep = L',';
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_curr_symbol = L"";
++ _M_data->_M_curr_symbol_size = 0;
++ _M_data->_M_positive_sign = L"";
++ _M_data->_M_positive_sign_size = 0;
++ _M_data->_M_negative_sign = L"";
++ _M_data->_M_negative_sign_size = 0;
++ _M_data->_M_frac_digits = 0;
++ _M_data->_M_pos_format = money_base::_S_default_pattern;
++ _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++ // Use ctype::widen code without the facet...
++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++ _M_data->_M_atoms[__i] =
++ static_cast<wchar_t>(money_base::_S_atoms[__i]);
++ }
++ else
++ {
++ // Named locale.
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(__cloc);
++#else
++ // Switch to named locale so that mbsrtowcs will work.
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, __name);
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this... should be monetary
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
++# else
++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++ union { char *__s; wchar_t __w; } __u;
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
++ _M_data->_M_decimal_point = __u.__w;
++
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
++ _M_data->_M_thousands_sep = __u.__w;
++#endif
++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++
++ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
++ const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
++
++ wchar_t* __wcs_ps = 0;
++ wchar_t* __wcs_ns = 0;
++ const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
++ try
++ {
++ mbstate_t __state;
++ size_t __len;
++ __len = strlen(__cpossign);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ __wcs_ps = new wchar_t[__len];
++ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
++ _M_data->_M_positive_sign = __wcs_ps;
++ }
++ else
++ _M_data->_M_positive_sign = L"";
++ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
++
++ __len = strlen(__cnegsign);
++ if (!__nposn)
++ _M_data->_M_negative_sign = L"()";
++ else if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ __wcs_ns = new wchar_t[__len];
++ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
++ _M_data->_M_negative_sign = __wcs_ns;
++ }
++ else
++ _M_data->_M_negative_sign = L"";
++ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
++
++ // _Intl == true.
++ __len = strlen(__ccurr);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ wchar_t* __wcs = new wchar_t[__len];
++ mbsrtowcs(__wcs, &__ccurr, __len, &__state);
++ _M_data->_M_curr_symbol = __wcs;
++ }
++ else
++ _M_data->_M_curr_symbol = L"";
++ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
++ }
++ catch (...)
++ {
++ delete _M_data;
++ _M_data = 0;
++ delete __wcs_ps;
++ delete __wcs_ns;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#else
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ __throw_exception_again;
++ }
++
++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
++ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
++ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
++ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++ __pposn);
++ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
++ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++ __nposn);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#else
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ }
++ }
++
++ template<>
++ moneypunct<wchar_t, true>::~moneypunct()
++ {
++ if (_M_data->_M_positive_sign_size)
++ delete [] _M_data->_M_positive_sign;
++ if (_M_data->_M_negative_sign_size
++ && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
++ delete [] _M_data->_M_negative_sign;
++ if (_M_data->_M_curr_symbol_size)
++ delete [] _M_data->_M_curr_symbol;
++ delete _M_data;
++ }
++
++ template<>
++ moneypunct<wchar_t, false>::~moneypunct()
++ {
++ if (_M_data->_M_positive_sign_size)
++ delete [] _M_data->_M_positive_sign;
++ if (_M_data->_M_negative_sign_size
++ && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
++ delete [] _M_data->_M_negative_sign;
++ if (_M_data->_M_curr_symbol_size)
++ delete [] _M_data->_M_curr_symbol;
++ delete _M_data;
++ }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+new file mode 100644
+index 0000000..883ec1a
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -0,0 +1,160 @@
++// std::numpunct implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning tailor for stub locale support
++#endif
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __nl_langinfo_l(N, L) nl_langinfo((N))
++#endif
++
++namespace std
++{
++ template<>
++ void
++ numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __numpunct_cache<char>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_use_grouping = false;
++
++ _M_data->_M_decimal_point = '.';
++ _M_data->_M_thousands_sep = ',';
++
++ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
++ _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
++
++ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
++ _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
++ }
++ else
++ {
++ // Named locale.
++ _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT,
++ __cloc));
++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP,
++ __cloc));
++
++ // Check for NULL, which implies no grouping.
++ if (_M_data->_M_thousands_sep == '\0')
++ _M_data->_M_grouping = "";
++ else
++ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++ }
++
++ // NB: There is no way to extact this info from posix locales.
++ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
++ _M_data->_M_truename = "true";
++ _M_data->_M_truename_size = 4;
++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
++ _M_data->_M_falsename = "false";
++ _M_data->_M_falsename_size = 5;
++ }
++
++ template<>
++ numpunct<char>::~numpunct()
++ { delete _M_data; }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ void
++ numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __numpunct_cache<wchar_t>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_use_grouping = false;
++
++ _M_data->_M_decimal_point = L'.';
++ _M_data->_M_thousands_sep = L',';
++
++ // Use ctype::widen code without the facet...
++ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
++ _M_data->_M_atoms_out[__i] =
++ static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
++
++ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
++ _M_data->_M_atoms_in[__j] =
++ static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
++ }
++ else
++ {
++ // Named locale.
++ // NB: In the GNU model wchar_t is always 32 bit wide.
++ union { char *__s; wchar_t __w; } __u;
++ __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
++ _M_data->_M_decimal_point = __u.__w;
++
++ __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
++ _M_data->_M_thousands_sep = __u.__w;
++
++ if (_M_data->_M_thousands_sep == L'\0')
++ _M_data->_M_grouping = "";
++ else
++ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++ }
++
++ // NB: There is no way to extact this info from posix locales.
++ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
++ _M_data->_M_truename = L"true";
++ _M_data->_M_truename_size = 4;
++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
++ _M_data->_M_falsename = L"false";
++ _M_data->_M_falsename_size = 5;
++ }
++
++ template<>
++ numpunct<wchar_t>::~numpunct()
++ { delete _M_data; }
++ #endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.cc b/libstdc++-v3/config/locale/uclibc/time_members.cc
+new file mode 100644
+index 0000000..e0707d7
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/time_members.cc
+@@ -0,0 +1,406 @@
++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning tailor for stub locale support
++#endif
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __nl_langinfo_l(N, L) nl_langinfo((N))
++#endif
++
++namespace std
++{
++ template<>
++ void
++ __timepunct<char>::
++ _M_put(char* __s, size_t __maxlen, const char* __format,
++ const tm* __tm) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
++ _M_c_locale_timepunct);
++#else
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_timepunct);
++ const size_t __len = strftime(__s, __maxlen, __format, __tm);
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ // Make sure __s is null terminated.
++ if (__len == 0)
++ __s[0] = '\0';
++ }
++
++ template<>
++ void
++ __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __timepunct_cache<char>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_c_locale_timepunct = _S_get_c_locale();
++
++ _M_data->_M_date_format = "%m/%d/%y";
++ _M_data->_M_date_era_format = "%m/%d/%y";
++ _M_data->_M_time_format = "%H:%M:%S";
++ _M_data->_M_time_era_format = "%H:%M:%S";
++ _M_data->_M_date_time_format = "";
++ _M_data->_M_date_time_era_format = "";
++ _M_data->_M_am = "AM";
++ _M_data->_M_pm = "PM";
++ _M_data->_M_am_pm_format = "";
++
++ // Day names, starting with "C"'s Sunday.
++ _M_data->_M_day1 = "Sunday";
++ _M_data->_M_day2 = "Monday";
++ _M_data->_M_day3 = "Tuesday";
++ _M_data->_M_day4 = "Wednesday";
++ _M_data->_M_day5 = "Thursday";
++ _M_data->_M_day6 = "Friday";
++ _M_data->_M_day7 = "Saturday";
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ _M_data->_M_aday1 = "Sun";
++ _M_data->_M_aday2 = "Mon";
++ _M_data->_M_aday3 = "Tue";
++ _M_data->_M_aday4 = "Wed";
++ _M_data->_M_aday5 = "Thu";
++ _M_data->_M_aday6 = "Fri";
++ _M_data->_M_aday7 = "Sat";
++
++ // Month names, starting with "C"'s January.
++ _M_data->_M_month01 = "January";
++ _M_data->_M_month02 = "February";
++ _M_data->_M_month03 = "March";
++ _M_data->_M_month04 = "April";
++ _M_data->_M_month05 = "May";
++ _M_data->_M_month06 = "June";
++ _M_data->_M_month07 = "July";
++ _M_data->_M_month08 = "August";
++ _M_data->_M_month09 = "September";
++ _M_data->_M_month10 = "October";
++ _M_data->_M_month11 = "November";
++ _M_data->_M_month12 = "December";
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ _M_data->_M_amonth01 = "Jan";
++ _M_data->_M_amonth02 = "Feb";
++ _M_data->_M_amonth03 = "Mar";
++ _M_data->_M_amonth04 = "Apr";
++ _M_data->_M_amonth05 = "May";
++ _M_data->_M_amonth06 = "Jun";
++ _M_data->_M_amonth07 = "Jul";
++ _M_data->_M_amonth08 = "Aug";
++ _M_data->_M_amonth09 = "Sep";
++ _M_data->_M_amonth10 = "Oct";
++ _M_data->_M_amonth11 = "Nov";
++ _M_data->_M_amonth12 = "Dec";
++ }
++ else
++ {
++ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
++
++ _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
++ _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
++ _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
++ _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
++ _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
++ _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
++ __cloc);
++ _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
++ _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
++ _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
++
++ // Day names, starting with "C"'s Sunday.
++ _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
++ _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
++ _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
++ _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
++ _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
++ _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
++ _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
++ _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
++ _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
++ _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
++ _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
++ _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
++ _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
++
++ // Month names, starting with "C"'s January.
++ _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
++ _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
++ _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
++ _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
++ _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
++ _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
++ _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
++ _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
++ _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
++ _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
++ _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
++ _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
++ _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
++ _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
++ _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
++ _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
++ _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
++ _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
++ _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
++ _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
++ _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
++ _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
++ _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
++ }
++ }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ void
++ __timepunct<wchar_t>::
++ _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
++ const tm* __tm) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
++ const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
++ _M_c_locale_timepunct);
++#else
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_timepunct);
++ const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ // Make sure __s is null terminated.
++ if (__len == 0)
++ __s[0] = L'\0';
++ }
++
++ template<>
++ void
++ __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __timepunct_cache<wchar_t>;
++
++#warning wide time stuff
++// if (!__cloc)
++ {
++ // "C" locale
++ _M_c_locale_timepunct = _S_get_c_locale();
++
++ _M_data->_M_date_format = L"%m/%d/%y";
++ _M_data->_M_date_era_format = L"%m/%d/%y";
++ _M_data->_M_time_format = L"%H:%M:%S";
++ _M_data->_M_time_era_format = L"%H:%M:%S";
++ _M_data->_M_date_time_format = L"";
++ _M_data->_M_date_time_era_format = L"";
++ _M_data->_M_am = L"AM";
++ _M_data->_M_pm = L"PM";
++ _M_data->_M_am_pm_format = L"";
++
++ // Day names, starting with "C"'s Sunday.
++ _M_data->_M_day1 = L"Sunday";
++ _M_data->_M_day2 = L"Monday";
++ _M_data->_M_day3 = L"Tuesday";
++ _M_data->_M_day4 = L"Wednesday";
++ _M_data->_M_day5 = L"Thursday";
++ _M_data->_M_day6 = L"Friday";
++ _M_data->_M_day7 = L"Saturday";
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ _M_data->_M_aday1 = L"Sun";
++ _M_data->_M_aday2 = L"Mon";
++ _M_data->_M_aday3 = L"Tue";
++ _M_data->_M_aday4 = L"Wed";
++ _M_data->_M_aday5 = L"Thu";
++ _M_data->_M_aday6 = L"Fri";
++ _M_data->_M_aday7 = L"Sat";
++
++ // Month names, starting with "C"'s January.
++ _M_data->_M_month01 = L"January";
++ _M_data->_M_month02 = L"February";
++ _M_data->_M_month03 = L"March";
++ _M_data->_M_month04 = L"April";
++ _M_data->_M_month05 = L"May";
++ _M_data->_M_month06 = L"June";
++ _M_data->_M_month07 = L"July";
++ _M_data->_M_month08 = L"August";
++ _M_data->_M_month09 = L"September";
++ _M_data->_M_month10 = L"October";
++ _M_data->_M_month11 = L"November";
++ _M_data->_M_month12 = L"December";
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ _M_data->_M_amonth01 = L"Jan";
++ _M_data->_M_amonth02 = L"Feb";
++ _M_data->_M_amonth03 = L"Mar";
++ _M_data->_M_amonth04 = L"Apr";
++ _M_data->_M_amonth05 = L"May";
++ _M_data->_M_amonth06 = L"Jun";
++ _M_data->_M_amonth07 = L"Jul";
++ _M_data->_M_amonth08 = L"Aug";
++ _M_data->_M_amonth09 = L"Sep";
++ _M_data->_M_amonth10 = L"Oct";
++ _M_data->_M_amonth11 = L"Nov";
++ _M_data->_M_amonth12 = L"Dec";
++ }
++#if 0
++ else
++ {
++ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
++
++ union { char *__s; wchar_t *__w; } __u;
++
++ __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
++ _M_data->_M_date_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
++ _M_data->_M_date_era_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
++ _M_data->_M_time_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
++ _M_data->_M_time_era_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
++ _M_data->_M_date_time_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
++ _M_data->_M_date_time_era_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
++ _M_data->_M_am = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
++ _M_data->_M_pm = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
++ _M_data->_M_am_pm_format = __u.__w;
++
++ // Day names, starting with "C"'s Sunday.
++ __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
++ _M_data->_M_day1 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
++ _M_data->_M_day2 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
++ _M_data->_M_day3 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
++ _M_data->_M_day4 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
++ _M_data->_M_day5 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
++ _M_data->_M_day6 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
++ _M_data->_M_day7 = __u.__w;
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
++ _M_data->_M_aday1 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
++ _M_data->_M_aday2 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
++ _M_data->_M_aday3 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
++ _M_data->_M_aday4 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
++ _M_data->_M_aday5 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
++ _M_data->_M_aday6 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
++ _M_data->_M_aday7 = __u.__w;
++
++ // Month names, starting with "C"'s January.
++ __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
++ _M_data->_M_month01 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
++ _M_data->_M_month02 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
++ _M_data->_M_month03 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
++ _M_data->_M_month04 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
++ _M_data->_M_month05 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
++ _M_data->_M_month06 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
++ _M_data->_M_month07 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
++ _M_data->_M_month08 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
++ _M_data->_M_month09 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
++ _M_data->_M_month10 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
++ _M_data->_M_month11 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
++ _M_data->_M_month12 = __u.__w;
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
++ _M_data->_M_amonth01 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
++ _M_data->_M_amonth02 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
++ _M_data->_M_amonth03 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
++ _M_data->_M_amonth04 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
++ _M_data->_M_amonth05 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
++ _M_data->_M_amonth06 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
++ _M_data->_M_amonth07 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
++ _M_data->_M_amonth08 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
++ _M_data->_M_amonth09 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
++ _M_data->_M_amonth10 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
++ _M_data->_M_amonth11 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
++ _M_data->_M_amonth12 = __u.__w;
++ }
++#endif // 0
++ }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.h b/libstdc++-v3/config/locale/uclibc/time_members.h
+new file mode 100644
+index 0000000..ba8e858
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/time_members.h
+@@ -0,0 +1,68 @@
++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.5.1.2 - time_get functions
++// ISO C++ 14882: 22.2.5.3.2 - time_put functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++ template<typename _CharT>
++ __timepunct<_CharT>::__timepunct(size_t __refs)
++ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
++ _M_name_timepunct(_S_get_c_name())
++ { _M_initialize_timepunct(); }
++
++ template<typename _CharT>
++ __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
++ : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
++ _M_name_timepunct(_S_get_c_name())
++ { _M_initialize_timepunct(); }
++
++ template<typename _CharT>
++ __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
++ size_t __refs)
++ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
++ _M_name_timepunct(__s)
++ {
++ char* __tmp = new char[std::strlen(__s) + 1];
++ std::strcpy(__tmp, __s);
++ _M_name_timepunct = __tmp;
++ _M_initialize_timepunct(__cloc);
++ }
++
++ template<typename _CharT>
++ __timepunct<_CharT>::~__timepunct()
++ {
++ if (_M_name_timepunct != _S_get_c_name())
++ delete [] _M_name_timepunct;
++ delete _M_data;
++ _S_destroy_c_locale(_M_c_locale_timepunct);
++ }
+diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
+index 8cd4c76..217012e 100755
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -15918,6 +15918,9 @@ fi
+ # Default to "generic".
+ if test $enable_clocale_flag = auto; then
+ case ${target_os} in
++ *-uclibc*)
++ enable_clocale_flag=uclibc
++ ;;
+ linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
+ enable_clocale_flag=gnu
+ ;;
+@@ -16196,6 +16199,78 @@ $as_echo "newlib" >&6; }
+ CTIME_CC=config/locale/generic/time_members.cc
+ CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
+ ;;
++ uclibc)
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: uclibc" >&5
++$as_echo "uclibc" >&6; }
++
++ # Declare intention to use gettext, and add support for specific
++ # languages.
++ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
++ ALL_LINGUAS="de fr"
++
++ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
++ # Extract the first word of "msgfmt", so it can be a program name with args.
++set dummy msgfmt; 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_check_msgfmt+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$check_msgfmt"; then
++ ac_cv_prog_check_msgfmt="$check_msgfmt" # 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_check_msgfmt="yes"
++ $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
++
++ test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
++fi
++fi
++check_msgfmt=$ac_cv_prog_check_msgfmt
++if test -n "$check_msgfmt"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_msgfmt" >&5
++$as_echo "$check_msgfmt" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
++ USE_NLS=yes
++ fi
++ # Export the build objects.
++ for ling in $ALL_LINGUAS; do \
++ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
++ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
++ done
++
++
++
++ CLOCALE_H=config/locale/uclibc/c_locale.h
++ CLOCALE_CC=config/locale/uclibc/c_locale.cc
++ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
++ CCOLLATE_CC=config/locale/uclibc/collate_members.cc
++ CCTYPE_CC=config/locale/uclibc/ctype_members.cc
++ CMESSAGES_H=config/locale/uclibc/messages_members.h
++ CMESSAGES_CC=config/locale/uclibc/messages_members.cc
++ CMONEY_CC=config/locale/uclibc/monetary_members.cc
++ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
++ CTIME_H=config/locale/uclibc/time_members.h
++ CTIME_CC=config/locale/uclibc/time_members.cc
++ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
++ ;;
+ esac
+
+ # This is where the testsuite looks for locale catalogs, using the
+diff --git a/libstdc++-v3/include/c_compatibility/wchar.h b/libstdc++-v3/include/c_compatibility/wchar.h
+index 06b5d47..7d3f835 100644
+--- a/libstdc++-v3/include/c_compatibility/wchar.h
++++ b/libstdc++-v3/include/c_compatibility/wchar.h
+@@ -101,7 +101,9 @@ using std::wmemcmp;
+ using std::wmemcpy;
+ using std::wmemmove;
+ using std::wmemset;
++#if _GLIBCXX_HAVE_WCSFTIME
+ using std::wcsftime;
++#endif
+
+ #if _GLIBCXX_USE_C99
+ using std::wcstold;
+diff --git a/libstdc++-v3/include/c_std/cwchar b/libstdc++-v3/include/c_std/cwchar
+index aa1b2fa..45c4617 100644
+--- a/libstdc++-v3/include/c_std/cwchar
++++ b/libstdc++-v3/include/c_std/cwchar
+@@ -175,7 +175,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ using ::wcscoll;
+ using ::wcscpy;
+ using ::wcscspn;
++#if _GLIBCXX_HAVE_WCSFTIME
+ using ::wcsftime;
++#endif
+ using ::wcslen;
+ using ::wcsncat;
+ using ::wcsncmp;
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0005-uclibc-locale-no__x.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0005-uclibc-locale-no__x.patch
new file mode 100644
index 000000000..19a86a4e1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0005-uclibc-locale-no__x.patch
@@ -0,0 +1,257 @@
+From 72a1a4af3c18627f59aa5ba1f753a89011b4e4f0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:42:36 +0400
+Subject: [PATCH 05/46] uclibc-locale-no__x
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ .../config/locale/uclibc/c++locale_internal.h | 45 ++++++++++++++++++++++
+ libstdc++-v3/config/locale/uclibc/c_locale.cc | 14 -------
+ libstdc++-v3/config/locale/uclibc/c_locale.h | 1 +
+ .../config/locale/uclibc/collate_members.cc | 7 ----
+ libstdc++-v3/config/locale/uclibc/ctype_members.cc | 7 ----
+ .../config/locale/uclibc/messages_members.cc | 7 +---
+ .../config/locale/uclibc/messages_members.h | 18 ++++-----
+ .../config/locale/uclibc/monetary_members.cc | 4 --
+ .../config/locale/uclibc/numeric_members.cc | 3 --
+ libstdc++-v3/config/locale/uclibc/time_members.cc | 3 --
+ 10 files changed, 55 insertions(+), 54 deletions(-)
+
+diff --git a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+index 2ae3e4a..e74fddf 100644
+--- a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
++++ b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+@@ -60,4 +60,49 @@ extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
+ extern "C" __typeof(wctype_l) __wctype_l;
+ #endif
+
++# define __nl_langinfo_l nl_langinfo_l
++# define __strcoll_l strcoll_l
++# define __strftime_l strftime_l
++# define __strtod_l strtod_l
++# define __strtof_l strtof_l
++# define __strtold_l strtold_l
++# define __strxfrm_l strxfrm_l
++# define __newlocale newlocale
++# define __freelocale freelocale
++# define __duplocale duplocale
++# define __uselocale uselocale
++
++# ifdef _GLIBCXX_USE_WCHAR_T
++# define __iswctype_l iswctype_l
++# define __towlower_l towlower_l
++# define __towupper_l towupper_l
++# define __wcscoll_l wcscoll_l
++# define __wcsftime_l wcsftime_l
++# define __wcsxfrm_l wcsxfrm_l
++# define __wctype_l wctype_l
++# endif
++
++#else
++# define __nl_langinfo_l(N, L) nl_langinfo((N))
++# define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
++# define __strtod_l(S, E, L) strtod((S), (E))
++# define __strtof_l(S, E, L) strtof((S), (E))
++# define __strtold_l(S, E, L) strtold((S), (E))
++# define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
++# warning should dummy __newlocale check for C|POSIX ?
++# define __newlocale(a, b, c) NULL
++# define __freelocale(a) ((void)0)
++# define __duplocale(a) __c_locale()
++//# define __uselocale ?
++//
++# ifdef _GLIBCXX_USE_WCHAR_T
++# define __iswctype_l(C, M, L) iswctype((C), (M))
++# define __towlower_l(C, L) towlower((C))
++# define __towupper_l(C, L) towupper((C))
++# define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
++//# define __wcsftime_l(S, M, F, T, L) wcsftime((S), (M), (F), (T))
++# define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
++# define __wctype_l(S, L) wctype((S))
++# endif
++
+ #endif // GLIBC 2.3 and later
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.cc b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+index 5081dc1..21430d0 100644
+--- a/libstdc++-v3/config/locale/uclibc/c_locale.cc
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+@@ -39,20 +39,6 @@
+ #include <langinfo.h>
+ #include <bits/c++locale_internal.h>
+
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
+-#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
+-#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
+-#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
+-#define __strtof_l(S, E, L) strtof((S), (E))
+-#define __strtod_l(S, E, L) strtod((S), (E))
+-#define __strtold_l(S, E, L) strtold((S), (E))
+-#warning should dummy __newlocale check for C|POSIX ?
+-#define __newlocale(a, b, c) NULL
+-#define __freelocale(a) ((void)0)
+-#define __duplocale(a) __c_locale()
+-#endif
+-
+ namespace std
+ {
+ template<>
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.h b/libstdc++-v3/config/locale/uclibc/c_locale.h
+index da07c1f..4bca5f1 100644
+--- a/libstdc++-v3/config/locale/uclibc/c_locale.h
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.h
+@@ -68,6 +68,7 @@ namespace __gnu_cxx
+ {
+ extern "C" __typeof(uselocale) __uselocale;
+ }
++#define __uselocale uselocale
+ #endif
+
+ namespace std
+diff --git a/libstdc++-v3/config/locale/uclibc/collate_members.cc b/libstdc++-v3/config/locale/uclibc/collate_members.cc
+index c2664a7..ec5c329 100644
+--- a/libstdc++-v3/config/locale/uclibc/collate_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/collate_members.cc
+@@ -36,13 +36,6 @@
+ #include <locale>
+ #include <bits/c++locale_internal.h>
+
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
+-#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
+-#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
+-#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
+-#endif
+-
+ namespace std
+ {
+ // These are basically extensions to char_traits, and perhaps should
+diff --git a/libstdc++-v3/config/locale/uclibc/ctype_members.cc b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+index 7294e3a..7b12861 100644
+--- a/libstdc++-v3/config/locale/uclibc/ctype_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+@@ -38,13 +38,6 @@
+ #undef _LIBC
+ #include <bits/c++locale_internal.h>
+
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __wctype_l(S, L) wctype((S))
+-#define __towupper_l(C, L) towupper((C))
+-#define __towlower_l(C, L) towlower((C))
+-#define __iswctype_l(C, M, L) iswctype((C), (M))
+-#endif
+-
+ namespace std
+ {
+ // NB: The other ctype<char> specializations are in src/locale.cc and
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.cc b/libstdc++-v3/config/locale/uclibc/messages_members.cc
+index 13594d9..d7693b4 100644
+--- a/libstdc++-v3/config/locale/uclibc/messages_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.cc
+@@ -39,13 +39,10 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning fix gettext stuff
+ #endif
+-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
+-extern "C" char *__dcgettext(const char *domainname,
+- const char *msgid, int category);
+ #undef gettext
+-#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
+ #else
+-#undef gettext
+ #define gettext(msgid) (msgid)
+ #endif
+
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h
+index 1424078..d89da33 100644
+--- a/libstdc++-v3/config/locale/uclibc/messages_members.h
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h
+@@ -36,15 +36,11 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning fix prototypes for *textdomain funcs
+ #endif
+-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
+-extern "C" char *__textdomain(const char *domainname);
+-extern "C" char *__bindtextdomain(const char *domainname,
+- const char *dirname);
+-#else
+-#undef __textdomain
+-#undef __bindtextdomain
+-#define __textdomain(D) ((void)0)
+-#define __bindtextdomain(D,P) ((void)0)
++#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
++#undef textdomain
++#undef bindtextdomain
++#define textdomain(D) ((void)0)
++#define bindtextdomain(D,P) ((void)0)
+ #endif
+
+ // Non-virtual member functions.
+@@ -70,7 +66,7 @@ extern "C" char *__bindtextdomain(const char *domainname,
+ messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
+ const char* __dir) const
+ {
+- __bindtextdomain(__s.c_str(), __dir);
++ bindtextdomain(__s.c_str(), __dir);
+ return this->do_open(__s, __loc);
+ }
+
+@@ -90,7 +86,7 @@ extern "C" char *__bindtextdomain(const char *domainname,
+ {
+ // No error checking is done, assume the catalog exists and can
+ // be used.
+- __textdomain(__s.c_str());
++ textdomain(__s.c_str());
+ return 0;
+ }
+
+diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+index aa52731..2e6f80a 100644
+--- a/libstdc++-v3/config/locale/uclibc/monetary_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -43,10 +43,6 @@
+ #warning tailor for stub locale support
+ #endif
+
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __nl_langinfo_l(N, L) nl_langinfo((N))
+-#endif
+-
+ namespace std
+ {
+ // Construct and return valid pattern consisting of some combination of:
+diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+index 883ec1a..2c70642 100644
+--- a/libstdc++-v3/config/locale/uclibc/numeric_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -41,9 +41,6 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning tailor for stub locale support
+ #endif
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __nl_langinfo_l(N, L) nl_langinfo((N))
+-#endif
+
+ namespace std
+ {
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.cc b/libstdc++-v3/config/locale/uclibc/time_members.cc
+index e0707d7..d848ed5 100644
+--- a/libstdc++-v3/config/locale/uclibc/time_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/time_members.cc
+@@ -40,9 +40,6 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning tailor for stub locale support
+ #endif
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __nl_langinfo_l(N, L) nl_langinfo((N))
+-#endif
+
+ namespace std
+ {
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0006-uclibc-locale-wchar_fix.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0006-uclibc-locale-wchar_fix.patch
new file mode 100644
index 000000000..d7dbe68bd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0006-uclibc-locale-wchar_fix.patch
@@ -0,0 +1,68 @@
+From b1298344f0c221c382a95af689f7f3ecd864f531 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:45:57 +0400
+Subject: [PATCH 06/46] uclibc-locale-wchar_fix
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/config/locale/uclibc/monetary_members.cc | 4 ++--
+ libstdc++-v3/config/locale/uclibc/numeric_members.cc | 13 +++++++++++++
+ 2 files changed, 15 insertions(+), 2 deletions(-)
+
+diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+index 2e6f80a..31ebb9f 100644
+--- a/libstdc++-v3/config/locale/uclibc/monetary_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -401,7 +401,7 @@ namespace std
+ # ifdef __UCLIBC_HAS_XLOCALE__
+ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
+-# else
++# elif defined __UCLIBC_HAS_LOCALE__
+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
+ # endif
+@@ -556,7 +556,7 @@ namespace std
+ # ifdef __UCLIBC_HAS_XLOCALE__
+ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
+-# else
++# elif defined __UCLIBC_HAS_LOCALE__
+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
+ # endif
+diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+index 2c70642..d5c8961 100644
+--- a/libstdc++-v3/config/locale/uclibc/numeric_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -127,12 +127,25 @@ namespace std
+ {
+ // Named locale.
+ // NB: In the GNU model wchar_t is always 32 bit wide.
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this... should be numeric
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
++# elif defined __UCLIBC_HAS_LOCALE__
++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
+ union { char *__s; wchar_t __w; } __u;
+ __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
+ _M_data->_M_decimal_point = __u.__w;
+
+ __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
+ _M_data->_M_thousands_sep = __u.__w;
++#endif
+
+ if (_M_data->_M_thousands_sep == L'\0')
+ _M_data->_M_grouping = "";
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0007-uclibc-locale-update.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0007-uclibc-locale-update.patch
new file mode 100644
index 000000000..cde749931
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0007-uclibc-locale-update.patch
@@ -0,0 +1,542 @@
+From e9d7cb62741c22d667fe56e98d50753d89aefdc3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:46:58 +0400
+Subject: [PATCH 07/46] uclibc-locale-update
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ .../config/locale/uclibc/c++locale_internal.h | 3 +
+ libstdc++-v3/config/locale/uclibc/c_locale.cc | 74 ++++++++++------------
+ libstdc++-v3/config/locale/uclibc/c_locale.h | 42 ++++++------
+ libstdc++-v3/config/locale/uclibc/ctype_members.cc | 51 +++++++++++----
+ .../config/locale/uclibc/messages_members.h | 12 ++--
+ .../config/locale/uclibc/monetary_members.cc | 34 ++++++----
+ .../config/locale/uclibc/numeric_members.cc | 5 ++
+ libstdc++-v3/config/locale/uclibc/time_members.cc | 18 ++++--
+ libstdc++-v3/config/locale/uclibc/time_members.h | 17 +++--
+ 9 files changed, 158 insertions(+), 98 deletions(-)
+
+diff --git a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+index e74fddf..971a6b4 100644
+--- a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
++++ b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+@@ -31,6 +31,9 @@
+
+ #include <bits/c++config.h>
+ #include <clocale>
++#include <cstdlib>
++#include <cstring>
++#include <cstddef>
+
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning clean this up
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.cc b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+index 21430d0..1b9d8e1 100644
+--- a/libstdc++-v3/config/locale/uclibc/c_locale.cc
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+@@ -39,23 +39,20 @@
+ #include <langinfo.h>
+ #include <bits/c++locale_internal.h>
+
+-namespace std
+-{
++_GLIBCXX_BEGIN_NAMESPACE(std)
++
+ template<>
+ void
+ __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
+ const __c_locale& __cloc)
+ {
+- if (!(__err & ios_base::failbit))
+- {
+- char* __sanity;
+- errno = 0;
+- float __f = __strtof_l(__s, &__sanity, __cloc);
+- if (__sanity != __s && errno != ERANGE)
+- __v = __f;
+- else
+- __err |= ios_base::failbit;
+- }
++ char* __sanity;
++ errno = 0;
++ float __f = __strtof_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __f;
++ else
++ __err |= ios_base::failbit;
+ }
+
+ template<>
+@@ -63,16 +60,13 @@ namespace std
+ __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
+ const __c_locale& __cloc)
+ {
+- if (!(__err & ios_base::failbit))
+- {
+- char* __sanity;
+- errno = 0;
+- double __d = __strtod_l(__s, &__sanity, __cloc);
+- if (__sanity != __s && errno != ERANGE)
+- __v = __d;
+- else
+- __err |= ios_base::failbit;
+- }
++ char* __sanity;
++ errno = 0;
++ double __d = __strtod_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __d;
++ else
++ __err |= ios_base::failbit;
+ }
+
+ template<>
+@@ -80,16 +74,13 @@ namespace std
+ __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
+ const __c_locale& __cloc)
+ {
+- if (!(__err & ios_base::failbit))
+- {
+- char* __sanity;
+- errno = 0;
+- long double __ld = __strtold_l(__s, &__sanity, __cloc);
+- if (__sanity != __s && errno != ERANGE)
+- __v = __ld;
+- else
+- __err |= ios_base::failbit;
+- }
++ char* __sanity;
++ errno = 0;
++ long double __ld = __strtold_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __ld;
++ else
++ __err |= ios_base::failbit;
+ }
+
+ void
+@@ -110,17 +101,18 @@ namespace std
+ void
+ locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
+ {
+- if (_S_get_c_locale() != __cloc)
++ if (__cloc && _S_get_c_locale() != __cloc)
+ __freelocale(__cloc);
+ }
+
+ __c_locale
+ locale::facet::_S_clone_c_locale(__c_locale& __cloc)
+ { return __duplocale(__cloc); }
+-} // namespace std
+
+-namespace __gnu_cxx
+-{
++_GLIBCXX_END_NAMESPACE
++
++_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
++
+ const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
+ {
+ "LC_CTYPE",
+@@ -138,9 +130,11 @@ namespace __gnu_cxx
+ "LC_IDENTIFICATION"
+ #endif
+ };
+-}
+
+-namespace std
+-{
++_GLIBCXX_END_NAMESPACE
++
++_GLIBCXX_BEGIN_NAMESPACE(std)
++
+ const char* const* const locale::_S_categories = __gnu_cxx::category_names;
+-} // namespace std
++
++_GLIBCXX_END_NAMESPACE
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.h b/libstdc++-v3/config/locale/uclibc/c_locale.h
+index 4bca5f1..64a6d46 100644
+--- a/libstdc++-v3/config/locale/uclibc/c_locale.h
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.h
+@@ -39,21 +39,23 @@
+ #pragma GCC system_header
+
+ #include <cstring> // get std::strlen
+-#include <cstdio> // get std::snprintf or std::sprintf
++#include <cstdio> // get std::vsnprintf or std::vsprintf
+ #include <clocale>
+ #include <langinfo.h> // For codecvt
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning fix this
+ #endif
+-#ifdef __UCLIBC_HAS_LOCALE__
++#ifdef _GLIBCXX_USE_ICONV
+ #include <iconv.h> // For codecvt using iconv, iconv_t
+ #endif
+-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
+-#include <libintl.h> // For messages
++#ifdef HAVE_LIBINTL_H
++#include <libintl.h> // For messages
+ #endif
++#include <cstdarg>
+
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning what is _GLIBCXX_C_LOCALE_GNU for
++// psm: used in os/gnu-linux/ctype_noninline.h
+ #endif
+ #define _GLIBCXX_C_LOCALE_GNU 1
+
+@@ -78,23 +80,25 @@ namespace std
+ #else
+ typedef int* __c_locale;
+ #endif
+-
+- // Convert numeric value of type _Tv to string and return length of
+- // string. If snprintf is available use it, otherwise fall back to
+- // the unsafe sprintf which, in general, can be dangerous and should
++ // Convert numeric value of type double to string and return length of
++ // string. If vsnprintf is available use it, otherwise fall back to
++ // the unsafe vsprintf which, in general, can be dangerous and should
+ // be avoided.
+- template<typename _Tv>
+- int
+- __convert_from_v(char* __out,
+- const int __size __attribute__ ((__unused__)),
+- const char* __fmt,
+-#ifdef __UCLIBC_HAS_XCLOCALE__
+- _Tv __v, const __c_locale& __cloc, int __prec)
++ inline int
++ __convert_from_v(const __c_locale&
++#ifndef __UCLIBC_HAS_XCLOCALE__
++ __cloc __attribute__ ((__unused__))
++#endif
++ ,
++ char* __out,
++ const int __size,
++ const char* __fmt, ...)
+ {
++ va_list __args;
++#ifdef __UCLIBC_HAS_XCLOCALE__
++
+ __c_locale __old = __gnu_cxx::__uselocale(__cloc);
+ #else
+- _Tv __v, const __c_locale&, int __prec)
+- {
+ # ifdef __UCLIBC_HAS_LOCALE__
+ char* __old = std::setlocale(LC_ALL, NULL);
+ char* __sav = new char[std::strlen(__old) + 1];
+@@ -103,7 +107,9 @@ namespace std
+ # endif
+ #endif
+
+- const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
++ va_start(__args, __fmt);
++ const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
++ va_end(__args);
+
+ #ifdef __UCLIBC_HAS_XCLOCALE__
+ __gnu_cxx::__uselocale(__old);
+diff --git a/libstdc++-v3/config/locale/uclibc/ctype_members.cc b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+index 7b12861..13e011d 100644
+--- a/libstdc++-v3/config/locale/uclibc/ctype_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+@@ -33,16 +33,20 @@
+
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+
++#include <features.h>
++#ifdef __UCLIBC_HAS_LOCALE__
+ #define _LIBC
+ #include <locale>
+ #undef _LIBC
++#else
++#include <locale>
++#endif
+ #include <bits/c++locale_internal.h>
+
+-namespace std
+-{
++_GLIBCXX_BEGIN_NAMESPACE(std)
++
+ // NB: The other ctype<char> specializations are in src/locale.cc and
+ // various /config/os/* files.
+- template<>
+ ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
+ : ctype<char>(0, false, __refs)
+ {
+@@ -57,6 +61,8 @@ namespace std
+ #endif
+ }
+ }
++ ctype_byname<char>::~ctype_byname()
++ { }
+
+ #ifdef _GLIBCXX_USE_WCHAR_T
+ ctype<wchar_t>::__wmask_type
+@@ -138,17 +144,33 @@ namespace std
+ ctype<wchar_t>::
+ do_is(mask __m, wchar_t __c) const
+ {
+- // Highest bitmask in ctype_base == 10, but extra in "C"
+- // library for blank.
++ // The case of __m == ctype_base::space is particularly important,
++ // due to its use in many istream functions. Therefore we deal with
++ // it first, exploiting the knowledge that on GNU systems _M_bit[5]
++ // is the mask corresponding to ctype_base::space. NB: an encoding
++ // change would not affect correctness!
++
+ bool __ret = false;
+- const size_t __bitmasksize = 11;
+- for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
+- if (__m & _M_bit[__bitcur]
+- && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
+- {
+- __ret = true;
+- break;
+- }
++ if (__m == _M_bit[5])
++ __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
++ else
++ {
++ // Highest bitmask in ctype_base == 10, but extra in "C"
++ // library for blank.
++ const size_t __bitmasksize = 11;
++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++ if (__m & _M_bit[__bitcur])
++ {
++ if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
++ {
++ __ret = true;
++ break;
++ }
++ else if (__m == _M_bit[__bitcur])
++ break;
++ }
++ }
++
+ return __ret;
+ }
+
+@@ -290,4 +312,5 @@ namespace std
+ #endif
+ }
+ #endif // _GLIBCXX_USE_WCHAR_T
+-}
++
++_GLIBCXX_END_NAMESPACE
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h
+index d89da33..067657a 100644
+--- a/libstdc++-v3/config/locale/uclibc/messages_members.h
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h
+@@ -53,12 +53,16 @@
+ template<typename _CharT>
+ messages<_CharT>::messages(__c_locale __cloc, const char* __s,
+ size_t __refs)
+- : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
+- _M_name_messages(__s)
++ : facet(__refs), _M_c_locale_messages(NULL),
++ _M_name_messages(NULL)
+ {
+- char* __tmp = new char[std::strlen(__s) + 1];
+- std::strcpy(__tmp, __s);
++ const size_t __len = std::strlen(__s) + 1;
++ char* __tmp = new char[__len];
++ std::memcpy(__tmp, __s, __len);
+ _M_name_messages = __tmp;
++
++ // Last to avoid leaking memory if new throws.
++ _M_c_locale_messages = _S_clone_c_locale(__cloc);
+ }
+
+ template<typename _CharT>
+diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+index 31ebb9f..7679b9c 100644
+--- a/libstdc++-v3/config/locale/uclibc/monetary_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -33,9 +33,14 @@
+
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+
++#include <features.h>
++#ifdef __UCLIBC_HAS_LOCALE__
+ #define _LIBC
+ #include <locale>
+ #undef _LIBC
++#else
++#include <locale>
++#endif
+ #include <bits/c++locale_internal.h>
+
+ #ifdef __UCLIBC_MJN3_ONLY__
+@@ -206,7 +211,7 @@ namespace std
+ }
+ break;
+ default:
+- ;
++ __ret = pattern();
+ }
+ return __ret;
+ }
+@@ -390,7 +395,9 @@ namespace std
+ __c_locale __old = __uselocale(__cloc);
+ #else
+ // Switch to named locale so that mbsrtowcs will work.
+- char* __old = strdup(setlocale(LC_ALL, NULL));
++ char* __old = setlocale(LC_ALL, NULL);
++ const size_t __llen = strlen(__old) + 1;
++ char* __sav = new char[__llen];
+ setlocale(LC_ALL, __name);
+ #endif
+
+@@ -477,8 +484,8 @@ namespace std
+ #ifdef __UCLIBC_HAS_XLOCALE__
+ __uselocale(__old);
+ #else
+- setlocale(LC_ALL, __old);
+- free(__old);
++ setlocale(LC_ALL, __sav);
++ delete [] __sav;
+ #endif
+ __throw_exception_again;
+ }
+@@ -498,8 +505,8 @@ namespace std
+ #ifdef __UCLIBC_HAS_XLOCALE__
+ __uselocale(__old);
+ #else
+- setlocale(LC_ALL, __old);
+- free(__old);
++ setlocale(LC_ALL, __sav);
++ delete [] __sav;
+ #endif
+ }
+ }
+@@ -545,8 +552,11 @@ namespace std
+ __c_locale __old = __uselocale(__cloc);
+ #else
+ // Switch to named locale so that mbsrtowcs will work.
+- char* __old = strdup(setlocale(LC_ALL, NULL));
+- setlocale(LC_ALL, __name);
++ char* __old = setlocale(LC_ALL, NULL);
++ const size_t __llen = strlen(__old) + 1;
++ char* __sav = new char[__llen];
++ memcpy(__sav, __old, __llen);
++ setlocale(LC_ALL, __name);
+ #endif
+
+ #ifdef __UCLIBC_MJN3_ONLY__
+@@ -633,8 +643,8 @@ namespace std
+ #ifdef __UCLIBC_HAS_XLOCALE__
+ __uselocale(__old);
+ #else
+- setlocale(LC_ALL, __old);
+- free(__old);
++ setlocale(LC_ALL, __sav);
++ delete [] __sav;
+ #endif
+ __throw_exception_again;
+ }
+@@ -653,8 +663,8 @@ namespace std
+ #ifdef __UCLIBC_HAS_XLOCALE__
+ __uselocale(__old);
+ #else
+- setlocale(LC_ALL, __old);
+- free(__old);
++ setlocale(LC_ALL, __sav);
++ delete [] __sav;
+ #endif
+ }
+ }
+diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+index d5c8961..8ae8969 100644
+--- a/libstdc++-v3/config/locale/uclibc/numeric_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -33,9 +33,14 @@
+
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+
++#include <features.h>
++#ifdef __UCLIBC_HAS_LOCALE__
+ #define _LIBC
+ #include <locale>
+ #undef _LIBC
++#else
++#include <locale>
++#endif
+ #include <bits/c++locale_internal.h>
+
+ #ifdef __UCLIBC_MJN3_ONLY__
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.cc b/libstdc++-v3/config/locale/uclibc/time_members.cc
+index d848ed5..f24d53e 100644
+--- a/libstdc++-v3/config/locale/uclibc/time_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/time_members.cc
+@@ -53,11 +53,14 @@ namespace std
+ const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
+ _M_c_locale_timepunct);
+ #else
+- char* __old = strdup(setlocale(LC_ALL, NULL));
++ char* __old = setlocale(LC_ALL, NULL);
++ const size_t __llen = strlen(__old) + 1;
++ char* __sav = new char[__llen];
++ memcpy(__sav, __old, __llen);
+ setlocale(LC_ALL, _M_name_timepunct);
+ const size_t __len = strftime(__s, __maxlen, __format, __tm);
+- setlocale(LC_ALL, __old);
+- free(__old);
++ setlocale(LC_ALL, __sav);
++ delete [] __sav;
+ #endif
+ // Make sure __s is null terminated.
+ if (__len == 0)
+@@ -207,11 +210,14 @@ namespace std
+ const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
+ _M_c_locale_timepunct);
+ #else
+- char* __old = strdup(setlocale(LC_ALL, NULL));
++ char* __old = setlocale(LC_ALL, NULL);
++ const size_t __llen = strlen(__old) + 1;
++ char* __sav = new char[__llen];
++ memcpy(__sav, __old, __llen);
+ setlocale(LC_ALL, _M_name_timepunct);
+ const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
+- setlocale(LC_ALL, __old);
+- free(__old);
++ setlocale(LC_ALL, __sav);
++ delete [] __sav;
+ #endif
+ // Make sure __s is null terminated.
+ if (__len == 0)
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.h b/libstdc++-v3/config/locale/uclibc/time_members.h
+index ba8e858..1665dde 100644
+--- a/libstdc++-v3/config/locale/uclibc/time_members.h
++++ b/libstdc++-v3/config/locale/uclibc/time_members.h
+@@ -50,12 +50,21 @@
+ __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
+ size_t __refs)
+ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
+- _M_name_timepunct(__s)
++ _M_name_timepunct(NULL)
+ {
+- char* __tmp = new char[std::strlen(__s) + 1];
+- std::strcpy(__tmp, __s);
++ const size_t __len = std::strlen(__s) + 1;
++ char* __tmp = new char[__len];
++ std::memcpy(__tmp, __s, __len);
+ _M_name_timepunct = __tmp;
+- _M_initialize_timepunct(__cloc);
++
++ try
++ { _M_initialize_timepunct(__cloc); }
++ catch(...)
++ {
++ delete [] _M_name_timepunct;
++ __throw_exception_again;
++ }
++
+ }
+
+ template<typename _CharT>
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0008-missing-execinfo_h.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0008-missing-execinfo_h.patch
new file mode 100644
index 000000000..9f8793125
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0008-missing-execinfo_h.patch
@@ -0,0 +1,28 @@
+From 9b7442069eb68a42d2437181c1b2e710dd077e8b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:48:10 +0400
+Subject: [PATCH 08/46] missing-execinfo_h
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ boehm-gc/include/gc.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/boehm-gc/include/gc.h b/boehm-gc/include/gc.h
+index 6b38f2d..fca98ff 100644
+--- a/boehm-gc/include/gc.h
++++ b/boehm-gc/include/gc.h
+@@ -503,7 +503,7 @@ GC_API GC_PTR GC_malloc_atomic_ignore_off_page GC_PROTO((size_t lb));
+ #if defined(__linux__) || defined(__GLIBC__)
+ # include <features.h>
+ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
+- && !defined(__ia64__)
++ && !defined(__ia64__) && !defined(__UCLIBC__)
+ # ifndef GC_HAVE_BUILTIN_BACKTRACE
+ # define GC_HAVE_BUILTIN_BACKTRACE
+ # endif
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0009-c99-snprintf.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0009-c99-snprintf.patch
new file mode 100644
index 000000000..6b236c62c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0009-c99-snprintf.patch
@@ -0,0 +1,28 @@
+From fde97f80d2d931ed3fa4a86294799366b2359331 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 09/46] 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 37f01ca..f00c06d 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
++#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
+
+ #undef snprintf
+ #undef vfscanf
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0010-gcc-poison-system-directories.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0010-gcc-poison-system-directories.patch
new file mode 100644
index 000000000..2da887767
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0010-gcc-poison-system-directories.patch
@@ -0,0 +1,192 @@
+From 7a90e62d557c78ae52006dff30c99006e10d9357 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 10/46] 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 1218a71..bfba114 100644
+--- a/gcc/common.opt
++++ b/gcc/common.opt
+@@ -623,6 +623,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 local variable shadows another
+diff --git a/gcc/config.in b/gcc/config.in
+index 5335258..f079826 100644
+--- a/gcc/config.in
++++ b/gcc/config.in
+@@ -168,6 +168,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 3c92795..34371a3 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -933,6 +933,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
+@@ -1670,6 +1671,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
+@@ -28211,6 +28214,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 d414081..240d322 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -5654,6 +5654,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 d3be589..c81b55b 100644
+--- a/gcc/doc/invoke.texi
++++ b/gcc/doc/invoke.texi
+@@ -269,6 +269,7 @@ Objective-C and Objective-C++ Dialects}.
+ -Woverlength-strings -Wpacked -Wpacked-bitfield-compat -Wpadded @gol
+ -Wparentheses -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
+ -Wpointer-arith -Wno-pointer-to-int-cast @gol
++-Wno-poison-system-directories @gol
+ -Wredundant-decls -Wno-return-local-addr @gol
+ -Wreturn-type -Wsequence-point -Wshadow -Wno-shadow-ivar @gol
+ -Wshift-count-negative -Wshift-count-overflow @gol
+@@ -4433,6 +4434,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 d956c36..675bcc1 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -835,6 +835,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}} " VTABLE_VERIFICATION_SPEC " \
++ %{Wno-poison-system-directories:--no-poison-system-directories}\
++ %{Werror=poison-system-directories:--error-poison-system-directories}\
+ %{static:} %{L*} %(mfwrap) %(link_libgcc) " SANITIZER_EARLY_SPEC " %o\
+ " CHKP_SPEC " \
+ %{fopenacc|fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)}\
+diff --git a/gcc/incpath.c b/gcc/incpath.c
+index 6c54ca6..cc0c921 100644
+--- a/gcc/incpath.c
++++ b/gcc/incpath.c
+@@ -28,6 +28,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. */
+@@ -383,6 +384,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.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0011-gcc-poison-dir-extend.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0011-gcc-poison-dir-extend.patch
new file mode 100644
index 000000000..511e69481
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0011-gcc-poison-dir-extend.patch
@@ -0,0 +1,39 @@
+From db406054de6b0967cd76cbb998f05b0c5af0bd94 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 11/46] 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 cc0c921..0bc1f67 100644
+--- a/gcc/incpath.c
++++ b/gcc/incpath.c
+@@ -394,7 +394,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.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0012-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0012-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch
new file mode 100644
index 000000000..750bbc823
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0012-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch
@@ -0,0 +1,73 @@
+From 278d293c4cee9482a23aa3443741861ff2f67212 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 12/46] 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 1cba3a9..9cae8da 100755
+--- a/configure
++++ b/configure
+@@ -6733,6 +6733,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.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0013-64-bit-multilib-hack.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0013-64-bit-multilib-hack.patch
new file mode 100644
index 000000000..45aaf4cc2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0013-64-bit-multilib-hack.patch
@@ -0,0 +1,85 @@
+From bdde4f5efa3c89ac7ee0bc05f322f27e3dabeab9 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 13/46] 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 f6dbb78..d770da5 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 7e96406..b72dcb0 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 b6b351d..1d5b37a 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.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0014-optional-libstdc.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0014-optional-libstdc.patch
new file mode 100644
index 000000000..73741f83c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0014-optional-libstdc.patch
@@ -0,0 +1,101 @@
+From a13763f8a1d413a432e7b40835a062f86208f29a 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 14/46] 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 | 8 +++++++-
+ gcc/gcc.c | 1 +
+ 4 files changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
+index 4162566..453ec8e 100644
+--- a/gcc/c-family/c.opt
++++ b/gcc/c-family/c.opt
+@@ -1543,6 +1543,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 6536d7e..f57a5d4 100644
+--- a/gcc/cp/g++spec.c
++++ b/gcc/cp/g++spec.c
+@@ -138,6 +138,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 c81b55b..6d3f68c 100644
+--- a/gcc/doc/invoke.texi
++++ b/gcc/doc/invoke.texi
+@@ -195,6 +195,7 @@ in the following sections.
+ -fvisibility-inlines-hidden @gol
+ -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]} @gol
+ -fvtv-counts -fvtv-debug @gol
++-nostdlib++ @gol
+ -fvisibility-ms-compat @gol
+ -fext-numeric-literals @gol
+ -Wabi=@var{n} -Wabi-tag -Wconversion-null -Wctor-dtor-privacy @gol
+@@ -488,7 +489,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}}
+
+@@ -11187,6 +11188,11 @@ These entries are usually resolved by entries in
+ libc. These entry points should be supplied through some other
+ mechanism when this option is specified.
+
++@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}
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 675bcc1..a37ec8b 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -845,6 +845,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*} }}}}}}"
+ #endif
+
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0015-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0015-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch
new file mode 100644
index 000000000..1b62ef806
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0015-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch
@@ -0,0 +1,59 @@
+From 4bd21a1d63cfb14e261d90adc0c5d4f9462dc555 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 15/46] 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 34371a3..8caecdc 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -26479,13 +26479,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 240d322..57819ff 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -4384,13 +4384,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.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0016-COLLECT_GCC_OPTIONS.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0016-COLLECT_GCC_OPTIONS.patch
new file mode 100644
index 000000000..e6ae262e4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0016-COLLECT_GCC_OPTIONS.patch
@@ -0,0 +1,38 @@
+From 92427ebb94dc66f8e64ebf3ffbcd6dd5ce0935c1 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 16/46] 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 a37ec8b..87b47c5 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -4352,6 +4352,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.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0017-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0017-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
new file mode 100644
index 000000000..b89a27919
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0017-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
@@ -0,0 +1,96 @@
+From b1f3118e439459c26a3e19c617b7b0c93745e77a 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 17/46] 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 07c6f0a..e1e63e8 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -502,7 +502,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 8caecdc..8ec3d40 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -11850,8 +11850,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 57819ff..643a47e 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -1832,8 +1832,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 c32f087..6803ab9 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.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0018-fortran-cross-compile-hack.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0018-fortran-cross-compile-hack.patch
new file mode 100644
index 000000000..e8ba32558
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0018-fortran-cross-compile-hack.patch
@@ -0,0 +1,46 @@
+From d11c73c1295565ff3766ae04e2a410a89fc84dd5 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 18/46] 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 bb3107b..5d47e65 100755
+--- a/libgfortran/configure
++++ b/libgfortran/configure
+@@ -12747,7 +12747,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 adafb3f..b4ade28 100644
+--- a/libgfortran/configure.ac
++++ b/libgfortran/configure.ac
+@@ -240,7 +240,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.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0019-libgcc-sjlj-check.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0019-libgcc-sjlj-check.patch
new file mode 100644
index 000000000..01a4d1fda
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0019-libgcc-sjlj-check.patch
@@ -0,0 +1,74 @@
+From 7b40212ed6c0c9fe4efe51f31bccd3d9f892f238 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:20:50 +0400
+Subject: [PATCH 19/46] libgcc-sjlj-check
+
+ac_fn_c_try_compile doesnt seem to keep the intermediate files
+which are needed for sjlj test to pass since it greps into the
+generated file. So we run the compiler command using AC_TRY_COMMAND
+which then generates the needed .s file
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libgcc/configure | 10 ++++++----
+ libgcc/configure.ac | 10 ++++------
+ 2 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/libgcc/configure b/libgcc/configure
+index 203d384..6aef3e7 100644
+--- a/libgcc/configure
++++ b/libgcc/configure
+@@ -4570,17 +4570,19 @@ void foo ()
+ }
+
+ _ACEOF
+-CFLAGS_hold=$CFLAGS
+-CFLAGS="--save-temps -fexceptions"
+ libgcc_cv_lib_sjlj_exceptions=unknown
+-if ac_fn_c_try_compile; then :
++if { ac_try='${CC-cc} -fexceptions -S conftest.c -o conftest.s 1>&5'
++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }; }; then
+ if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
+ libgcc_cv_lib_sjlj_exceptions=yes
+ elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then
+ libgcc_cv_lib_sjlj_exceptions=no
+ fi
+ fi
+-CFLAGS=$CFLAGS_hold
+ rm -f conftest*
+
+ fi
+diff --git a/libgcc/configure.ac b/libgcc/configure.ac
+index a10a952..cc324f3 100644
+--- a/libgcc/configure.ac
++++ b/libgcc/configure.ac
+@@ -255,16 +255,14 @@ void foo ()
+ bar();
+ }
+ ])])
+-CFLAGS_hold=$CFLAGS
+-CFLAGS="--save-temps -fexceptions"
+ libgcc_cv_lib_sjlj_exceptions=unknown
+-AS_IF([ac_fn_c_try_compile],
+- [if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
++if AC_TRY_COMMAND(${CC-cc} -fexceptions -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
++ if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
+ libgcc_cv_lib_sjlj_exceptions=yes
+ elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then
+ libgcc_cv_lib_sjlj_exceptions=no
+- fi])
+-CFLAGS=$CFLAGS_hold
++ fi
++fi
+ rm -f conftest*
+ ])
+
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0020-cpp-honor-sysroot.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0020-cpp-honor-sysroot.patch
new file mode 100644
index 000000000..13f66d413
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0020-cpp-honor-sysroot.patch
@@ -0,0 +1,54 @@
+From 5f9759a85fff3d78e3f71ae01c970b10d326c406 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 20/46] 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 b0728f0..e69ee7d 100644
+--- a/gcc/cp/lang-specs.h
++++ b/gcc/cp/lang-specs.h
+@@ -63,5 +63,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 87b47c5..e6efae7 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -1142,7 +1142,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.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0021-MIPS64-Default-to-N64-ABI.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0021-MIPS64-Default-to-N64-ABI.patch
new file mode 100644
index 000000000..c7cffe417
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0021-MIPS64-Default-to-N64-ABI.patch
@@ -0,0 +1,57 @@
+From 34d22ab6cfd2dfe6dd171c8d0b31cafcdeb86298 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 21/46] 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 c835734..dd0739d 100644
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -2017,29 +2017,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.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0022-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0022-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
new file mode 100644
index 000000000..620835132
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0022-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
@@ -0,0 +1,216 @@
+From f6b41b62ea62a0f1447d9fc235f7fd2bbf3fe7c2 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 22/46] 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 | 10 +++++-----
+ gcc/config/sh/linux.h | 2 +-
+ gcc/config/sparc/linux.h | 2 +-
+ gcc/config/sparc/linux64.h | 4 ++--
+ 11 files changed, 28 insertions(+), 28 deletions(-)
+
+diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h
+index 2c70a2f..dd048db 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 e9d65dc..cfdf3f0 100644
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -68,8 +68,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 49ad954..a5ab559 100644
+--- a/gcc/config/arm/linux-elf.h
++++ b/gcc/config/arm/linux-elf.h
+@@ -62,7 +62,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 a100963..21ba2b2 100644
+--- a/gcc/config/i386/linux.h
++++ b/gcc/config/i386/linux.h
+@@ -20,4 +20,4 @@ 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"
+diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h
+index a27d3be..6185cce 100644
+--- a/gcc/config/i386/linux64.h
++++ b/gcc/config/i386/linux64.h
+@@ -27,6 +27,6 @@ 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"
+diff --git a/gcc/config/linux.h b/gcc/config/linux.h
+index 857389a..22b9be5 100644
+--- a/gcc/config/linux.h
++++ b/gcc/config/linux.h
+@@ -73,10 +73,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 91df261..c306afb 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}"
+
+ #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
+ #define GNU_USER_DYNAMIC_LINKERN32 \
+diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
+index 0879e7e..31c4338 100644
+--- a/gcc/config/rs6000/linux64.h
++++ b/gcc/config/rs6000/linux64.h
+@@ -357,14 +357,14 @@ extern int dot_symbols;
+ #undef LINK_OS_DEFAULT_SPEC
+ #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
+
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
++#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld.so.1"
+ #ifdef LINUX64_DEFAULT_ABI_ELFv2
+-#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv1:/lib64/ld64.so.1;:/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:/lib64/ld64.so.2;:/lib64/ld64.so.1}"
++#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv2:" SYSTEMLIBS_DIR "ld64.so.2;:" SYSTEMLIBS_DIR "ld64.so.1}"
+ #endif
+-#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) "%{mglibc:" G ";:" U "}"
+ #elif DEFAULT_LIBC == LIBC_GLIBC
+diff --git a/gcc/config/sh/linux.h b/gcc/config/sh/linux.h
+index 0f5d614..168416c 100644
+--- a/gcc/config/sh/linux.h
++++ b/gcc/config/sh/linux.h
+@@ -43,7 +43,7 @@ along with GCC; see the file COPYING3. If not see
+
+ #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
+
+-#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 "_linux"
+diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
+index 56def4b..00b564c 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 fa805fd..0eb4acd 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.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0023-gcc-Fix-argument-list-too-long-error.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0023-gcc-Fix-argument-list-too-long-error.patch
new file mode 100644
index 000000000..be91c9e63
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0023-gcc-Fix-argument-list-too-long-error.patch
@@ -0,0 +1,40 @@
+From 9701f596bbe5bf51bbf48661bc515b45d4b6f4d2 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 23/46] 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 e1e63e8..7b49f88 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -3262,7 +3262,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.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0024-Disable-sdt.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0024-Disable-sdt.patch
new file mode 100644
index 000000000..b23ce9756
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0024-Disable-sdt.patch
@@ -0,0 +1,113 @@
+From 946e047614103e1f2982613c7aa5f76587500c0e 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 24/46] 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 8ec3d40..eaa3b07 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -27857,12 +27857,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 643a47e..9f6cacb 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -5315,15 +5315,15 @@ if test x$gcc_cv_libc_provides_ssp = xyes; then
+ fi
+
+ # 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 217012e..81240b9 100755
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -20964,11 +20964,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 580fb8b..5a41083 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.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0025-libtool.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0025-libtool.patch
new file mode 100644
index 000000000..8d5eb973b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0025-libtool.patch
@@ -0,0 +1,42 @@
+From f68c5b78751660505b22b46dad99240db0df3456 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 25/46] 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 9503ec8..0121fba 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.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0026-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0026-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch
new file mode 100644
index 000000000..a22d95f72
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0026-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch
@@ -0,0 +1,43 @@
+From 4c75e349aa7abd1e285720328b23690636bea242 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 26/46] 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 cfdf3f0..048a062 100644
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -77,10 +77,14 @@
+ %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \
+ %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}"
+
++/* 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.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0027-Use-the-multilib-config-files-from-B-instead-of-usin.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0027-Use-the-multilib-config-files-from-B-instead-of-usin.patch
new file mode 100644
index 000000000..46815d156
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0027-Use-the-multilib-config-files-from-B-instead-of-usin.patch
@@ -0,0 +1,102 @@
+From 8217dd7fb318f9abc6564f67b424c433d8398d61 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 27/46] 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 eaa3b07..9b60aad 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -11830,10 +11830,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_}"
+
+@@ -11844,6 +11854,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 9f6cacb..e1e54f2 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -1812,10 +1812,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_}"
+
+@@ -1826,6 +1836,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.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0028-Avoid-using-libdir-from-.la-which-usually-points-to-.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0028-Avoid-using-libdir-from-.la-which-usually-points-to-.patch
new file mode 100644
index 000000000..60ddd9cee
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0028-Avoid-using-libdir-from-.la-which-usually-points-to-.patch
@@ -0,0 +1,31 @@
+From 08a0e45b308fc97d06f5c3ef77a257e7a6bd1a48 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 28/46] 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 0121fba..52bdbdb 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.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0029-export-CPP.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0029-export-CPP.patch
new file mode 100644
index 000000000..62195aa87
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0029-export-CPP.patch
@@ -0,0 +1,53 @@
+From 95f494d1544857ad38949a7da37e2d7264475233 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 29/46] 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 36b4008..a783e1e 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.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0030-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0030-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch
new file mode 100644
index 000000000..57051871b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0030-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch
@@ -0,0 +1,52 @@
+From 4ed8c1fd9dc05f7a9db9298a55396c8f0ff549a7 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 30/46] 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 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+Index: gcc-5.3.0/gcc/config.gcc
+===================================================================
+--- gcc-5.3.0.orig/gcc/config.gcc
++++ gcc-5.3.0/gcc/config.gcc
+@@ -2346,7 +2346,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"
+Index: gcc-5.3.0/gcc/config/rs6000/linuxspe.h
+===================================================================
+--- gcc-5.3.0.orig/gcc/config/rs6000/linuxspe.h
++++ gcc-5.3.0/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"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0031-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0031-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch
new file mode 100644
index 000000000..f2bc66432
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0031-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch
@@ -0,0 +1,42 @@
+From bb6fea821483aa3259b34e101a39c993edd01411 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 31/46] 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 c296376..3bb59bf 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.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0032-Ensure-target-gcc-headers-can-be-included.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0032-Ensure-target-gcc-headers-can-be-included.patch
new file mode 100644
index 000000000..89503ff60
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0032-Ensure-target-gcc-headers-can-be-included.patch
@@ -0,0 +1,98 @@
+From bb26f90f5e0accc3539f62b6fec663682959dd36 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 32/46] 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 7b49f88..cd5bc4a 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -582,6 +582,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
+@@ -2610,6 +2611,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 580c1ba..03a0287 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 1d54798..983d45e 100644
+--- a/gcc/defaults.h
++++ b/gcc/defaults.h
+@@ -1361,4 +1361,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+
+ #endif /* GCC_INSN_FLAGS_H */
+
++/* 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 e6efae7..3ca27b9 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -1263,13 +1263,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.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0033-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0033-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch
new file mode 100644
index 000000000..19d480f3d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0033-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch
@@ -0,0 +1,54 @@
+From 629fcc7d0075c9b4261da6435e122429fb028ec0 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 33/46] 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 3d8ab62..23dff7e 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 9288652..3720256 100644
+--- a/libatomic/Makefile.in
++++ b/libatomic/Makefile.in
+@@ -330,7 +330,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.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0034-Don-t-search-host-directory-during-relink-if-inst_pr.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0034-Don-t-search-host-directory-during-relink-if-inst_pr.patch
new file mode 100644
index 000000000..a453fa6b3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0034-Don-t-search-host-directory-during-relink-if-inst_pr.patch
@@ -0,0 +1,38 @@
+From a4efc9ca85734c283d4da09b628121e1c1f49c4e 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 34/46] 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 52bdbdb..82bcec3 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.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0035-Dont-link-the-plugins-with-libgomp-explicitly.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0035-Dont-link-the-plugins-with-libgomp-explicitly.patch
new file mode 100644
index 000000000..6ed589beb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0035-Dont-link-the-plugins-with-libgomp-explicitly.patch
@@ -0,0 +1,83 @@
+From 5b0125a792842ae02df507bc55555661cb10f9a3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 8 Mar 2015 03:41:39 +0000
+Subject: [PATCH 35/46] Dont link the plugins with libgomp explicitly
+
+They are dlopened by libgomp anyway. This fixes
+the libtool relink issue which causes issues during
+cross compilation
+
+libtool: install: /usr/bin/install -c .libs/libgomp.lai
+/home/ubuntu/work/bleeding/build-qemux86-64mc/tmp/work/core2-64-rdk-linux/gcc-runtime/5.0-r0/image/usr/lib/../lib/libgomp.la
+libtool: install: error: cannot install `libgomp-plugin-host_nonshm.la'
+to a directory not ending in /usr/lib
+Makefile:517: recipe for target 'install-toolexeclibLTLIBRARIES' failed
+make[2]: *** [install-toolexeclibLTLIBRARIES] Error 1
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libgomp/Makefile.in | 7 +++----
+ libgomp/plugin/Makefrag.am | 3 +--
+ 2 files changed, 4 insertions(+), 6 deletions(-)
+
+diff --git a/libgomp/Makefile.in b/libgomp/Makefile.in
+index b61b108..71b2627 100644
+--- a/libgomp/Makefile.in
++++ b/libgomp/Makefile.in
+@@ -123,7 +123,7 @@ am__installdirs = "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(infodir)" \
+ "$(DESTDIR)$(fincludedir)" "$(DESTDIR)$(libsubincludedir)" \
+ "$(DESTDIR)$(toolexeclibdir)"
+ LTLIBRARIES = $(toolexeclib_LTLIBRARIES)
+-libgomp_plugin_host_nonshm_la_DEPENDENCIES = libgomp.la
++libgomp_plugin_host_nonshm_la_LIBADD =
+ am_libgomp_plugin_host_nonshm_la_OBJECTS = \
+ libgomp_plugin_host_nonshm_la-plugin-host.lo
+ libgomp_plugin_host_nonshm_la_OBJECTS = \
+@@ -133,7 +133,7 @@ libgomp_plugin_host_nonshm_la_LINK = $(LIBTOOL) --tag=CC \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(libgomp_plugin_host_nonshm_la_LDFLAGS) $(LDFLAGS) -o $@
+ am__DEPENDENCIES_1 =
+-@PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_DEPENDENCIES = libgomp.la \
++@PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_DEPENDENCIES = \
+ @PLUGIN_NVPTX_TRUE@ $(am__DEPENDENCIES_1)
+ @PLUGIN_NVPTX_TRUE@am_libgomp_plugin_nvptx_la_OBJECTS = \
+ @PLUGIN_NVPTX_TRUE@ libgomp_plugin_nvptx_la-plugin-nvptx.lo
+@@ -407,7 +407,7 @@ libgomp_la_SOURCES = alloc.c barrier.c critical.c env.c error.c iter.c \
+ @PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_LDFLAGS = \
+ @PLUGIN_NVPTX_TRUE@ $(libgomp_plugin_nvptx_version_info) \
+ @PLUGIN_NVPTX_TRUE@ $(lt_host_flags) $(PLUGIN_NVPTX_LDFLAGS)
+-@PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_LIBADD = libgomp.la $(PLUGIN_NVPTX_LIBS)
++@PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_LIBADD = $(PLUGIN_NVPTX_LIBS)
+ @PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_LIBTOOLFLAGS = --tag=disable-static
+ libgomp_plugin_host_nonshm_version_info = -version-info $(libtool_VERSION)
+ libgomp_plugin_host_nonshm_la_SOURCES = plugin/plugin-host.c
+@@ -415,7 +415,6 @@ libgomp_plugin_host_nonshm_la_CPPFLAGS = $(AM_CPPFLAGS) -DHOST_NONSHM_PLUGIN
+ libgomp_plugin_host_nonshm_la_LDFLAGS = \
+ $(libgomp_plugin_host_nonshm_version_info) $(lt_host_flags)
+
+-libgomp_plugin_host_nonshm_la_LIBADD = libgomp.la
+ libgomp_plugin_host_nonshm_la_LIBTOOLFLAGS = --tag=disable-static
+ nodist_noinst_HEADERS = libgomp_f.h
+ nodist_libsubinclude_HEADERS = omp.h openacc.h
+diff --git a/libgomp/plugin/Makefrag.am b/libgomp/plugin/Makefrag.am
+index 167485f..d2c5428 100644
+--- a/libgomp/plugin/Makefrag.am
++++ b/libgomp/plugin/Makefrag.am
+@@ -35,7 +35,7 @@ libgomp_plugin_nvptx_la_CPPFLAGS = $(AM_CPPFLAGS) $(PLUGIN_NVPTX_CPPFLAGS)
+ libgomp_plugin_nvptx_la_LDFLAGS = $(libgomp_plugin_nvptx_version_info) \
+ $(lt_host_flags)
+ libgomp_plugin_nvptx_la_LDFLAGS += $(PLUGIN_NVPTX_LDFLAGS)
+-libgomp_plugin_nvptx_la_LIBADD = libgomp.la $(PLUGIN_NVPTX_LIBS)
++libgomp_plugin_nvptx_la_LIBADD = $(PLUGIN_NVPTX_LIBS)
+ libgomp_plugin_nvptx_la_LIBTOOLFLAGS = --tag=disable-static
+ endif
+
+@@ -45,5 +45,4 @@ libgomp_plugin_host_nonshm_la_SOURCES = plugin/plugin-host.c
+ libgomp_plugin_host_nonshm_la_CPPFLAGS = $(AM_CPPFLAGS) -DHOST_NONSHM_PLUGIN
+ libgomp_plugin_host_nonshm_la_LDFLAGS = \
+ $(libgomp_plugin_host_nonshm_version_info) $(lt_host_flags)
+-libgomp_plugin_host_nonshm_la_LIBADD = libgomp.la
+ libgomp_plugin_host_nonshm_la_LIBTOOLFLAGS = --tag=disable-static
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0036-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0036-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch
new file mode 100644
index 000000000..41c0294da
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0036-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch
@@ -0,0 +1,27 @@
+From b0b0688176a9482777e9b2e98408bfc4505d31af 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 36/46] Use SYSTEMLIBS_DIR replacement instead of hardcoding
+ base_libdir
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ 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 257acf0..abeb948 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 ASAN_CC1_SPEC
+ #define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}"
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0037-aarch64-Add-support-for-musl-ldso.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0037-aarch64-Add-support-for-musl-ldso.patch
new file mode 100644
index 000000000..30dbe74ef
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0037-aarch64-Add-support-for-musl-ldso.patch
@@ -0,0 +1,26 @@
+From 420ca64a86d560a77ee596a9774d672b08ca8278 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 37/46] aarch64: Add support for musl ldso
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gcc/config/aarch64/aarch64-linux.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
+index abeb948..f9e65fc 100644
+--- a/gcc/config/aarch64/aarch64-linux.h
++++ b/gcc/config/aarch64/aarch64-linux.h
+@@ -23,6 +23,8 @@
+
+ #define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
+
++#define MUSL_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-musl-aarch64.so.1"
++
+ #undef ASAN_CC1_SPEC
+ #define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}"
+
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0038-fix-g-sysroot.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0038-fix-g-sysroot.patch
new file mode 100644
index 000000000..9ba574a5c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0038-fix-g-sysroot.patch
@@ -0,0 +1,56 @@
+From 8df3e7007a22c9d6be5d5ae4b9b169c5c8431917 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 27 May 2015 17:06:06 -0700
+Subject: [PATCH 38/46] fix g++ sysroot
+
+Portions of
+
+http://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg26013.html
+
+are not upstreamed yet. So lets keep missing pieces.
+
+Upstream-Status: Pending
+
+Without this, compiling something simple like #include <limits> on target
+with c++ test.cpp fails unable to find the header. strace shows it looking in
+usr/include/xxxx rather than /usr/include/xxxx
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gcc/configure | 4 +++-
+ gcc/configure.ac | 4 +++-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/gcc/configure b/gcc/configure
+index 9b60aad..6df594c 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -3375,7 +3375,9 @@ gcc_gxx_include_dir_add_sysroot=0
+ if test "${with_sysroot+set}" = set; then
+ gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'`
+ if test "${gcc_gxx_without_sysroot}"; then
+- gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++ if test x${with_sysroot} != x/; then
++ gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++ fi
+ gcc_gxx_include_dir_add_sysroot=1
+ fi
+ fi
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index e1e54f2..3bb2173 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -152,7 +152,9 @@ gcc_gxx_include_dir_add_sysroot=0
+ if test "${with_sysroot+set}" = set; then
+ gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'`
+ if test "${gcc_gxx_without_sysroot}"; then
+- gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++ if test x${with_sysroot} != x/; then
++ gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++ fi
+ gcc_gxx_include_dir_add_sysroot=1
+ fi
+ fi
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0039-libcc1-fix-libcc1-s-install-path-and-rpath.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0039-libcc1-fix-libcc1-s-install-path-and-rpath.patch
new file mode 100644
index 000000000..2e0df968b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0039-libcc1-fix-libcc1-s-install-path-and-rpath.patch
@@ -0,0 +1,54 @@
+From 1eede9e4a10d3532db826a6eeced695df3ad5b89 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 39/46] 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 7a274b3..db69bea 100644
+--- a/libcc1/Makefile.am
++++ b/libcc1/Makefile.am
+@@ -35,8 +35,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
+diff --git a/libcc1/Makefile.in b/libcc1/Makefile.in
+index 1916134..c8995d2 100644
+--- a/libcc1/Makefile.in
++++ b/libcc1/Makefile.in
+@@ -262,8 +262,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
+ @ENABLE_PLUGIN_TRUE@cc1lib_LTLIBRARIES = libcc1.la
+ BUILT_SOURCES = compiler-name.h
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0040-handle-sysroot-support-for-nativesdk-gcc.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0040-handle-sysroot-support-for-nativesdk-gcc.patch
new file mode 100644
index 000000000..11e1310f1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0040-handle-sysroot-support-for-nativesdk-gcc.patch
@@ -0,0 +1,213 @@
+From b41674d357c4ba320b9860e0f313d2f5a332f27d 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 40/46] 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 03a0287..f44c1d8 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 c98644f..4198669 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 3ca27b9..2b7756e 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -120,6 +120,8 @@ static const char *target_system_root = TARGET_SYSTEM_ROOT;
+ #else
+ static const char *target_system_root = 0;
+ #endif
++
++static char target_relocatable_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = SYSTEMLIBS_DIR;
+
+ /* Nonzero means pass the updated target_system_root to the compiler. */
+
+@@ -390,6 +392,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.
+@@ -1286,10 +1289,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
+@@ -1297,9 +1300,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
+@@ -5523,6 +5526,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.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0041-Search-target-sysroot-gcc-version-specific-dirs-with.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0041-Search-target-sysroot-gcc-version-specific-dirs-with.patch
new file mode 100644
index 000000000..5a504a1f2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0041-Search-target-sysroot-gcc-version-specific-dirs-with.patch
@@ -0,0 +1,102 @@
+From 99cadb4d8415dd5a275d7d6410f20db33d0f8433 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 41/46] 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 2b7756e..8f53aea 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -2305,7 +2305,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);
+ }
+
+@@ -2317,6 +2317,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.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0042-Fix-various-_FOR_BUILD-and-related-variables.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0042-Fix-various-_FOR_BUILD-and-related-variables.patch
new file mode 100644
index 000000000..5af764b7c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0042-Fix-various-_FOR_BUILD-and-related-variables.patch
@@ -0,0 +1,137 @@
+From 78e77206902349c9256f06c3dd179197a39af2e1 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 42/46] 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 a783e1e..8b6d3d2 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; \
+ GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
+@@ -170,6 +171,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.
+@@ -187,6 +191,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; \
+@@ -710,6 +715,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 1ea1954..78a59c3 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; \
+ GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
+@@ -172,6 +173,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.
+@@ -189,6 +193,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 cd5bc4a..98ae4f4 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -762,7 +762,7 @@ BUILD_LINKERFLAGS = $(BUILD_CXXFLAGS)
+ # Native linker and preprocessor flags. For x-fragment overrides.
+ BUILD_LDFLAGS=@BUILD_LDFLAGS@
+ 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 6df594c..fcb05e7 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -11521,7 +11521,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 3bb2173..923bc9a 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -1633,7 +1633,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.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0043-libstdc-Support-musl.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0043-libstdc-Support-musl.patch
new file mode 100644
index 000000000..bad8402ef
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0043-libstdc-Support-musl.patch
@@ -0,0 +1,44 @@
+From df430b943a2df6b72054c808d4b93338a82562de Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 8 Dec 2015 08:23:34 +0000
+Subject: [PATCH 43/46] libstdc++: Support musl
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libstdc++-v3/configure.host | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host
+index 640199c..1756444 100644
+--- a/libstdc++-v3/configure.host
++++ b/libstdc++-v3/configure.host
+@@ -274,14 +274,24 @@ case "${host_os}" in
+ os_include_dir="os/bsd/freebsd"
+ ;;
+ gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
++ # check for musl by target
++ case "${host_os}" in
++ *-musl*)
++ os_include_dir="os/generic"
++ ;;
++ *)
+ if [ "$uclibc" = "yes" ]; then
+ os_include_dir="os/uclibc"
+ elif [ "$bionic" = "yes" ]; then
+ os_include_dir="os/bionic"
++ elif [ "$musl" = "yes" ]; then
++ os_include_dir="os/generic"
+ else
+ os_include_dir="os/gnu-linux"
+ fi
+ ;;
++ esac
++ ;;
+ hpux*)
+ os_include_dir="os/hpux"
+ ;;
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0044-Adding-mmusl-as-a-musl-libc-specifier-and-the-necess.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0044-Adding-mmusl-as-a-musl-libc-specifier-and-the-necess.patch
new file mode 100644
index 000000000..b91c02d0b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0044-Adding-mmusl-as-a-musl-libc-specifier-and-the-necess.patch
@@ -0,0 +1,270 @@
+From 0b54799d80fb859c7b142467e4d42c99db59df50 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 8 Dec 2015 08:30:35 +0000
+Subject: [PATCH 44/46] Adding -mmusl as a musl libc specifier, and the
+ necessary hacks for it to know how to find musl's dynamic linker.
+
+Upstream-Status: Backport [partial]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gcc/config.gcc | 10 ++++-
+ gcc/config/linux.h | 100 +++++++++++++++++++++++++++++++++++++-----
+ gcc/config/linux.opt | 4 ++
+ gcc/config/rs6000/secureplt.h | 1 +
+ gcc/config/rs6000/sysv4.h | 5 +++
+ gcc/ginclude/stddef.h | 3 ++
+ 6 files changed, 110 insertions(+), 13 deletions(-)
+
+diff --git a/gcc/config.gcc b/gcc/config.gcc
+index 3825bd5..39ce047 100644
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -575,7 +575,7 @@ case ${target} in
+ esac
+
+ # Common C libraries.
+-tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3"
++tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4"
+
+ # 32-bit x86 processors supported by --with-arch=. Each processor
+ # MUST be separated by exactly one space.
+@@ -720,6 +720,9 @@ case ${target} in
+ *-*-*uclibc*)
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
+ ;;
++ *-*-*musl*)
++ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
++ ;;
+ *)
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
+ ;;
+@@ -2420,6 +2423,11 @@ powerpc*-*-linux*)
+ powerpc*-*-linux*paired*)
+ tm_file="${tm_file} rs6000/750cl.h" ;;
+ esac
++ case ${target} in
++ *-linux*-musl*)
++ enable_secureplt=yes ;;
++ esac
++
+ if test x${enable_secureplt} = xyes; then
+ tm_file="rs6000/secureplt.h ${tm_file}"
+ fi
+diff --git a/gcc/config/linux.h b/gcc/config/linux.h
+index 22b9be5..ca9a17f 100644
+--- a/gcc/config/linux.h
++++ b/gcc/config/linux.h
+@@ -32,10 +32,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
+ #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
+ #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
++#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
+ #else
+ #define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
+ #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
+ #define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
++#define OPTION_MUSL (linux_libc == LIBC_MUSL)
+ #endif
+
+ #define GNU_USER_TARGET_OS_CPP_BUILTINS() \
+@@ -53,18 +55,21 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ uClibc or Bionic is the default C library and whether
+ -muclibc or -mglibc or -mbionic has been passed to change the default. */
+
+-#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3) \
+- "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}"
++#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4) \
++ "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}"
+
+ #if DEFAULT_LIBC == LIBC_GLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
+- CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B)
++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
++ CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M)
+ #elif DEFAULT_LIBC == LIBC_UCLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
+- CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B)
++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
++ CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M)
+ #elif DEFAULT_LIBC == LIBC_BIONIC
+-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
+- CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U)
++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
++ CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M)
++#elif DEFAULT_LIBC == LIBC_MUSL
++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
++ CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B)
+ #else
+ #error "Unsupported DEFAULT_LIBC"
+ #endif /* DEFAULT_LIBC */
+@@ -84,16 +89,16 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+
+ #define GNU_USER_DYNAMIC_LINKER \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \
+- BIONIC_DYNAMIC_LINKER)
++ BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
+ #define GNU_USER_DYNAMIC_LINKER32 \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \
+- BIONIC_DYNAMIC_LINKER32)
++ BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
+ #define GNU_USER_DYNAMIC_LINKER64 \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \
+- BIONIC_DYNAMIC_LINKER64)
++ BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
+ #define GNU_USER_DYNAMIC_LINKERX32 \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \
+- BIONIC_DYNAMIC_LINKERX32)
++ BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKERX32)
+
+ /* Whether we have Bionic libc runtime */
+ #undef TARGET_HAS_BIONIC
+@@ -123,3 +128,74 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ # define TARGET_LIBC_HAS_FUNCTION linux_libc_has_function
+
+ #endif
++
++/* musl avoids problematic includes by rearranging the include directories.
++ * Unfortunately, this is mostly duplicated from cppdefault.c */
++#if DEFAULT_LIBC == LIBC_MUSL
++#define INCLUDE_DEFAULTS_MUSL_GPP \
++ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, \
++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \
++ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, \
++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \
++ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, \
++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
++
++#ifdef LOCAL_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_LOCAL \
++ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, \
++ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
++#else
++#define INCLUDE_DEFAULTS_MUSL_LOCAL
++#endif
++
++#ifdef PREFIX_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_PREFIX \
++ { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0},
++#else
++#define INCLUDE_DEFAULTS_MUSL_PREFIX
++#endif
++
++#ifdef CROSS_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_CROSS \
++ { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0},
++#else
++#define INCLUDE_DEFAULTS_MUSL_CROSS
++#endif
++
++#ifdef TOOL_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_TOOL \
++ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0},
++#else
++#define INCLUDE_DEFAULTS_MUSL_TOOL
++#endif
++
++#ifdef NATIVE_SYSTEM_HEADER_DIR
++#define INCLUDE_DEFAULTS_MUSL_NATIVE \
++ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
++ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
++#else
++#define INCLUDE_DEFAULTS_MUSL_NATIVE
++#endif
++
++#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT)
++# undef INCLUDE_DEFAULTS_MUSL_LOCAL
++# define INCLUDE_DEFAULTS_MUSL_LOCAL
++# undef INCLUDE_DEFAULTS_MUSL_NATIVE
++# define INCLUDE_DEFAULTS_MUSL_NATIVE
++#else
++# undef INCLUDE_DEFAULTS_MUSL_CROSS
++# define INCLUDE_DEFAULTS_MUSL_CROSS
++#endif
++
++#undef INCLUDE_DEFAULTS
++#define INCLUDE_DEFAULTS \
++ { \
++ INCLUDE_DEFAULTS_MUSL_GPP \
++ INCLUDE_DEFAULTS_MUSL_PREFIX \
++ INCLUDE_DEFAULTS_MUSL_CROSS \
++ INCLUDE_DEFAULTS_MUSL_TOOL \
++ INCLUDE_DEFAULTS_MUSL_NATIVE \
++ { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \
++ { 0, 0, 0, 0, 0, 0 } \
++ }
++#endif
+diff --git a/gcc/config/linux.opt b/gcc/config/linux.opt
+index c054338..9334f74 100644
+--- a/gcc/config/linux.opt
++++ b/gcc/config/linux.opt
+@@ -30,3 +30,7 @@ Use GNU C library
+ muclibc
+ Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic)
+ Use uClibc C library
++
++mmusl
++Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mglibc)
++Use musl C library
+diff --git a/gcc/config/rs6000/secureplt.h b/gcc/config/rs6000/secureplt.h
+index b463463..77edf2a 100644
+--- a/gcc/config/rs6000/secureplt.h
++++ b/gcc/config/rs6000/secureplt.h
+@@ -18,3 +18,4 @@ along with GCC; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+ #define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt"
++#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt"
+diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
+index c6c31dc..7cd07e0 100644
+--- a/gcc/config/rs6000/sysv4.h
++++ b/gcc/config/rs6000/sysv4.h
+@@ -538,6 +538,10 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
+ #define CC1_SECURE_PLT_DEFAULT_SPEC ""
+ #endif
+
++#ifndef LINK_SECURE_PLT_DEFAULT_SPEC
++#define LINK_SECURE_PLT_DEFAULT_SPEC ""
++#endif
++
+ /* Pass -G xxx to the compiler. */
+ #undef CC1_SPEC
+ #define CC1_SPEC "%{G*} %(cc1_cpu)" \
+@@ -889,6 +893,7 @@ ncrtn.o%s"
+ { "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \
+ { "link_os_default", LINK_OS_DEFAULT_SPEC }, \
+ { "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \
++ { "link_secure_plt_default", LINK_SECURE_PLT_DEFAULT_SPEC }, \
+ { "cpp_os_ads", CPP_OS_ADS_SPEC }, \
+ { "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \
+ { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \
+diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h
+index f20a41b..eb879ef 100644
+--- a/gcc/ginclude/stddef.h
++++ b/gcc/ginclude/stddef.h
+@@ -184,6 +184,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 +201,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__)
+@@ -218,6 +220,7 @@ typedef __SIZE_TYPE__ size_t;
+ typedef long ssize_t;
+ #endif /* __BEOS__ */
+ #endif /* !(defined (__GNUG__) && defined (size_t)) */
++#endif /* __DEFINED_size_t */
+ #endif /* __size_t */
+ #endif /* _SIZET_ */
+ #endif /* _GCC_SIZE_T */
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0045-Support-for-arm-linux-musl.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0045-Support-for-arm-linux-musl.patch
new file mode 100644
index 000000000..3c1115aa8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0045-Support-for-arm-linux-musl.patch
@@ -0,0 +1,216 @@
+From a6c649571d49c972e6d207577780ada7e9b6bad5 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 8 Dec 2015 08:31:52 +0000
+Subject: [PATCH 45/57] Support for arm-linux-musl.
+
+Fix musl ldso for all arches
+
+Upstream-Status: backport [partial]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gcc/config/aarch64/aarch64-linux.h | 1 +
+ gcc/config/arm/linux-eabi.h | 17 +++++++++++++++++
+ gcc/config/i386/linux.h | 1 +
+ gcc/config/i386/linux64.h | 5 +++++
+ gcc/config/mips/linux.h | 8 +++++++-
+ gcc/config/rs6000/linux64.h | 13 +++++++++----
+ gcc/config/rs6000/sysv4.h | 10 +++++++---
+ libitm/config/arm/hwcap.cc | 4 ++++
+ libitm/config/linux/x86/tls.h | 8 ++++++--
+ 9 files changed, 57 insertions(+), 10 deletions(-)
+
+diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
+index f9e65fc..1b2d0c0 100644
+--- a/gcc/config/aarch64/aarch64-linux.h
++++ b/gcc/config/aarch64/aarch64-linux.h
+@@ -22,6 +22,7 @@
+ #define GCC_AARCH64_LINUX_H
+
+ #define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
++#define MUSL_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-musl-aarch64.so.1"
+
+ #define MUSL_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-musl-aarch64.so.1"
+
+diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h
+index 048a062..adb9c44 100644
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -81,6 +81,23 @@
+ #undef TARGET_FIX_V4BX_SPEC
+ #define TARGET_FIX_V4BX_SPEC "%{mcpu=arm8|mcpu=arm810|mcpu=strongarm*|march=armv4: --fix-v4bx}"
+
++/* For ARM musl currently supports four dynamic linkers:
++ - ld-musl-arm.so.1 - for the EABI-derived soft-float ABI
++ - ld-musl-armhf.so.1 - for the EABI-derived hard-float ABI
++ - ld-musl-armeb.so.1 - for the EABI-derived soft-float ABI, EB
++ - ld-musl-armebhf.so.1 - for the EABI-derived hard-float ABI, EB
++ musl does not support the legacy OABI mode.
++ All the dynamic linkers live in /lib.
++ We default to soft-float, EL. */
++#undef MUSL_DYNAMIC_LINKER
++#if TARGET_BIG_ENDIAN_DEFAULT
++#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:;:eb}"
++#else
++#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}"
++#endif
++#define MUSL_DYNAMIC_LINKER \
++ SYSTEMLIBS_DIR "ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1"
++
+ /* 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
+diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
+index 21ba2b2..e2b81e5 100644
+--- a/gcc/config/i386/linux.h
++++ b/gcc/config/i386/linux.h
+@@ -21,3 +21,4 @@ along with GCC; see the file COPYING3. If not see
+
+ #define GNU_USER_LINK_EMULATION "elf_i386"
+ #define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
++#define MUSL_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-musl-i386.so.1"
+diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h
+index 6185cce..5a3a977 100644
+--- a/gcc/config/i386/linux64.h
++++ b/gcc/config/i386/linux64.h
+@@ -30,3 +30,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ #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"
++
++#define MUSL_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-musl-i386.so.1"
++#define MUSL_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-musl-x86_64.so.1"
++#define MUSL_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ld-musl-x32.so.1"
++
+diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h
+index c306afb..b899388 100644
+--- a/gcc/config/mips/linux.h
++++ b/gcc/config/mips/linux.h
+@@ -21,6 +21,12 @@ along with GCC; see the file COPYING3. If not see
+ #define GNU_USER_LINK_EMULATION64 "elf64%{EB:b}%{EL:l}tsmip"
+ #define GNU_USER_LINK_EMULATIONN32 "elf32%{EB:b}%{EL:l}tsmipn32"
+
++#undef MUSL_DYNAMIC_LINKER32
++#define MUSL_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-musl-mips%{EL:el}%{msoft-float:-sf}.so.1"
++#undef MUSL_DYNAMIC_LINKER64
++#define MUSL_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-musl-mips64%{EL:el}%{msoft-float:-sf}.so.1"
++#define MUSL_DYNAMIC_LINKERN32 SYSTEMLIBS_DIR "ld-musl-mipsn32%{EL:el}%{msoft-float:-sf}.so.1"
++
+ #define GLIBC_DYNAMIC_LINKER32 \
+ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-linux-mipsn8.so.1;:" SYSTEMLIBS_DIR "ld.so.1}"
+ #define GLIBC_DYNAMIC_LINKER64 \
+@@ -40,4 +46,4 @@ along with GCC; see the file COPYING3. If not see
+ #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
+ #define GNU_USER_DYNAMIC_LINKERN32 \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \
+- BIONIC_DYNAMIC_LINKERN32)
++ BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKERN32)
+diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
+index 31c4338..679da4b 100644
+--- a/gcc/config/rs6000/linux64.h
++++ b/gcc/config/rs6000/linux64.h
+@@ -365,17 +365,22 @@ extern int dot_symbols;
+ #endif
+ #define UCLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-uClibc.so.0"
+ #define UCLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld64-uClibc.so.0"
++#define MUSL_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-musl-powerpc.so.1"
++#define MUSL_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-musl-powerpc64.so.1"
++
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
+ #elif DEFAULT_LIBC == LIBC_GLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
++#elif DEFAULT_LIBC == LIBC_MUSL
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
+ #else
+ #error "Unsupported DEFAULT_LIBC"
+ #endif
+ #define GNU_USER_DYNAMIC_LINKER32 \
+- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32)
++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
+ #define GNU_USER_DYNAMIC_LINKER64 \
+- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
+
+ #undef DEFAULT_ASM_ENDIAN
+ #if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN)
+diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
+index 7cd07e0..8794fa5 100644
+--- a/gcc/config/rs6000/sysv4.h
++++ b/gcc/config/rs6000/sysv4.h
+@@ -763,15 +763,19 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+ #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc.so.1"
++
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
++#elif DEFAULT_LIBC == LIBC_MUSL
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
+ #elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
+ #else
+ #error "Unsupported DEFAULT_LIBC"
+ #endif
+ #define GNU_USER_DYNAMIC_LINKER \
+- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
+
+ #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
+ %{rdynamic:-export-dynamic} \
+diff --git a/libitm/config/arm/hwcap.cc b/libitm/config/arm/hwcap.cc
+index a1c2cfd..dd4fad2 100644
+--- a/libitm/config/arm/hwcap.cc
++++ b/libitm/config/arm/hwcap.cc
+@@ -40,7 +40,11 @@ int GTM_hwcap HIDDEN = 0
+
+ #ifdef __linux__
+ #include <unistd.h>
++#ifdef __GLIBC__
+ #include <sys/fcntl.h>
++#else
++#include <fcntl.h>
++#endif
+ #include <elf.h>
+
+ static void __attribute__((constructor))
+diff --git a/libitm/config/linux/x86/tls.h b/libitm/config/linux/x86/tls.h
+index e731ab7..54ad8b6 100644
+--- a/libitm/config/linux/x86/tls.h
++++ b/libitm/config/linux/x86/tls.h
+@@ -25,16 +25,19 @@
+ #ifndef LIBITM_X86_TLS_H
+ #define LIBITM_X86_TLS_H 1
+
+-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
++#if defined(__GLIBC_PREREQ)
++#if __GLIBC_PREREQ(2, 10)
+ /* Use slots in the TCB head rather than __thread lookups.
+ GLIBC has reserved words 10 through 13 for TM. */
+ #define HAVE_ARCH_GTM_THREAD 1
+ #define HAVE_ARCH_GTM_THREAD_DISP 1
+ #endif
++#endif
+
+ #include "config/generic/tls.h"
+
+-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
++#if defined(__GLIBC_PREREQ)
++#if __GLIBC_PREREQ(2, 10)
+ namespace GTM HIDDEN {
+
+ #ifdef __x86_64__
+@@ -101,5 +104,6 @@ static inline void set_abi_disp(struct abi_dispatch *x)
+
+ } // namespace GTM
+ #endif /* >= GLIBC 2.10 */
++#endif
+
+ #endif // LIBITM_X86_TLS_H
+--
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0046-Get-rid-of-ever-broken-fixincludes-on-musl.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0046-Get-rid-of-ever-broken-fixincludes-on-musl.patch
new file mode 100644
index 000000000..ddb0fc4f4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0046-Get-rid-of-ever-broken-fixincludes-on-musl.patch
@@ -0,0 +1,28 @@
+From 047116e8c9cbb340264f4f28db3f21a68ba57ff3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 8 Dec 2015 08:32:24 +0000
+Subject: [PATCH 46/46] Get rid of ever-broken fixincludes on musl.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ fixincludes/mkfixinc.sh | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/fixincludes/mkfixinc.sh b/fixincludes/mkfixinc.sh
+index 6653fedb..0d96c8c 100755
+--- a/fixincludes/mkfixinc.sh
++++ b/fixincludes/mkfixinc.sh
+@@ -19,7 +19,8 @@ case $machine in
+ powerpc-*-eabi* | \
+ powerpc-*-rtems* | \
+ powerpcle-*-eabisim* | \
+- powerpcle-*-eabi* )
++ powerpcle-*-eabi* | \
++ *-musl* )
+ # IF there is no include fixing,
+ # THEN create a no-op fixer and exit
+ (echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0047-nios2-Define-MUSL_DYNAMIC_LINKER.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0047-nios2-Define-MUSL_DYNAMIC_LINKER.patch
new file mode 100644
index 000000000..a1cfb9c7a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0047-nios2-Define-MUSL_DYNAMIC_LINKER.patch
@@ -0,0 +1,28 @@
+From f5ca07132b9292d2045ca7204e9cbfde2e59d0bf 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 47/48] nios2: Define MUSL_DYNAMIC_LINKER
+
+Signed-off-by: Marek Vasut <marex@denx.de>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ 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 f43f655..5587ab3 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.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0048-ssp_nonshared.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0048-ssp_nonshared.patch
new file mode 100644
index 000000000..5ddd40a4a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0048-ssp_nonshared.patch
@@ -0,0 +1,29 @@
+From 3cb6013cf287ed9b1247ea37541e64b9810a121d Mon Sep 17 00:00:00 2001
+From: Szabolcs Nagy <nsz@port70.net>
+Date: Sat, 7 Nov 2015 14:58:40 +0000
+Subject: [PATCH 48/48] ssp_nonshared
+
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+ gcc/gcc.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 8f53aea..3ddc658 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -732,7 +732,8 @@ proper position among the other output files. */
+ #ifndef LINK_SSP_SPEC
+ #ifdef TARGET_LIBC_PROVIDES_SSP
+ #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
+- "|fstack-protector-strong|fstack-protector-explicit:}"
++ "|fstack-protector-strong|fstack-protector-explicit" \
++ ":-lssp_nonshared}"
+ #else
+ #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
+ "|fstack-protector-strong|fstack-protector-explicit" \
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0049-Disable-the-weak-reference-logic-in-gthr.h-for-os-ge.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0049-Disable-the-weak-reference-logic-in-gthr.h-for-os-ge.patch
new file mode 100644
index 000000000..0ea5143e0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0049-Disable-the-weak-reference-logic-in-gthr.h-for-os-ge.patch
@@ -0,0 +1,78 @@
+From 553d8e3b9073ff3e0a9d2fac9b1823fb17ad247c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 2 Feb 2016 21:00:18 -0800
+Subject: [PATCH 49/51] Disable the weak reference logic in gthr.h for
+ os/generic
+
+It does not work unless work arounds are there in gthr-posix.h
+
+origin of patch
+http://port70.net/~nsz/musl/gcc-5.3.0/0004-gthr.patch
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ libgfortran/acinclude.m4 | 2 +-
+ libgfortran/configure | 2 +-
+ libstdc++-v3/config/os/generic/os_defines.h | 5 +++++
+ libstdc++-v3/configure.host | 3 +++
+ 4 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/libgfortran/acinclude.m4 b/libgfortran/acinclude.m4
+index ba890f9..30b8b1a6 100644
+--- a/libgfortran/acinclude.m4
++++ b/libgfortran/acinclude.m4
+@@ -100,7 +100,7 @@ void foo (void);
+ [Define to 1 if the target supports #pragma weak])
+ fi
+ case "$host" in
+- *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* )
++ *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* )
+ AC_DEFINE(GTHREAD_USE_WEAK, 0,
+ [Define to 0 if the target shouldn't use #pragma weak])
+ ;;
+diff --git a/libgfortran/configure b/libgfortran/configure
+index 5d47e65..cdf9695 100755
+--- a/libgfortran/configure
++++ b/libgfortran/configure
+@@ -26456,7 +26456,7 @@ $as_echo "#define SUPPORTS_WEAK 1" >>confdefs.h
+
+ fi
+ case "$host" in
+- *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* )
++ *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* )
+
+ $as_echo "#define GTHREAD_USE_WEAK 0" >>confdefs.h
+
+diff --git a/libstdc++-v3/config/os/generic/os_defines.h b/libstdc++-v3/config/os/generic/os_defines.h
+index 45bf52a..103ec0e 100644
+--- a/libstdc++-v3/config/os/generic/os_defines.h
++++ b/libstdc++-v3/config/os/generic/os_defines.h
+@@ -33,4 +33,9 @@
+ // System-specific #define, typedefs, corrections, etc, go here. This
+ // file will come before all others.
+
++// Disable the weak reference logic in gthr.h for os/generic because it
++// is broken on every platform unless there is implementation specific
++// workaround in gthr-posix.h and at link-time for static linking.
++#define _GLIBCXX_GTHREAD_USE_WEAK 0
++
+ #endif
+diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host
+index 1756444..2a87bb8 100644
+--- a/libstdc++-v3/configure.host
++++ b/libstdc++-v3/configure.host
+@@ -273,6 +273,9 @@ case "${host_os}" in
+ freebsd*)
+ os_include_dir="os/bsd/freebsd"
+ ;;
++ linux-musl*)
++ os_include_dir="os/generic"
++ ;;
+ gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
+ # check for musl by target
+ case "${host_os}" in
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0050-powerpc-pass-secure-plt-to-the-linker.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0050-powerpc-pass-secure-plt-to-the-linker.patch
new file mode 100644
index 000000000..b2f2bbdf4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0050-powerpc-pass-secure-plt-to-the-linker.patch
@@ -0,0 +1,66 @@
+From 4fa0cf03678f849917dcc3d149989b7fecdbe276 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 2 Feb 2016 21:10:00 -0800
+Subject: [PATCH 50/51] powerpc pass --secure-plt to the linker
+
+Secure-plt when enabled does not pass right options to linker
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+ gcc/config/rs6000/linux64.h | 4 ++++
+ gcc/config/rs6000/sysv4.h | 2 ++
+ 2 files changed, 6 insertions(+)
+
+diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
+index 679da4b..3ca7cd7 100644
+--- a/gcc/config/rs6000/linux64.h
++++ b/gcc/config/rs6000/linux64.h
+@@ -174,20 +174,24 @@ extern int dot_symbols;
+ #undef ASM_DEFAULT_SPEC
+ #undef ASM_SPEC
+ #undef LINK_OS_LINUX_SPEC
++#undef LINK_SECURE_PLT_SPEC
+
+ #ifndef RS6000_BI_ARCH
+ #define ASM_DEFAULT_SPEC "-mppc64"
+ #define ASM_SPEC "%(asm_spec64) %(asm_spec_common)"
+ #define LINK_OS_LINUX_SPEC "%(link_os_linux_spec64)"
++#define LINK_SECURE_PLT_SPEC ""
+ #else
+ #if DEFAULT_ARCH64_P
+ #define ASM_DEFAULT_SPEC "-mppc%{!m32:64}"
+ #define ASM_SPEC "%{m32:%(asm_spec32)}%{!m32:%(asm_spec64)} %(asm_spec_common)"
+ #define LINK_OS_LINUX_SPEC "%{m32:%(link_os_linux_spec32)}%{!m32:%(link_os_linux_spec64)}"
++#define LINK_SECURE_PLT_SPEC "%{m32: " LINK_SECURE_PLT_DEFAULT_SPEC "}"
+ #else
+ #define ASM_DEFAULT_SPEC "-mppc%{m64:64}"
+ #define ASM_SPEC "%{!m64:%(asm_spec32)}%{m64:%(asm_spec64)} %(asm_spec_common)"
+ #define LINK_OS_LINUX_SPEC "%{!m64:%(link_os_linux_spec32)}%{m64:%(link_os_linux_spec64)}"
++#define LINK_SECURE_PLT_SPEC "%{!m64: " LINK_SECURE_PLT_DEFAULT_SPEC "}"
+ #endif
+ #endif
+
+diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
+index 8794fa5..0835551 100644
+--- a/gcc/config/rs6000/sysv4.h
++++ b/gcc/config/rs6000/sysv4.h
+@@ -571,6 +571,7 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
+ : %(link_start_default) }"
+
+ #define LINK_START_DEFAULT_SPEC ""
++#define LINK_SECURE_PLT_SPEC LINK_SECURE_PLT_DEFAULT_SPEC
+
+ #undef LINK_SPEC
+ #define LINK_SPEC "\
+@@ -578,6 +579,7 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
+ %{R*} \
+ %(link_shlib) \
+ %{!T*: %(link_start) } \
++%{!static: %{!mbss-plt: %(link_secure_plt_default)}} \
+ %(link_os)"
+
+ /* Shared libraries are not default. */
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0051-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0051-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch
new file mode 100644
index 000000000..e8f79b590
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0051-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch
@@ -0,0 +1,31 @@
+From 32593b38082ea65f4c82159254adf1e0dc2423be Mon Sep 17 00:00:00 2001
+From: bernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Tue, 16 Feb 2016 03:15:15 -0500
+Subject: [PATCH] Ignore -fdebug-prefix-map in producer string (by Daniel Kahn
+ Gillmor)
+
+* dwarf2out.c (gen_producer_string): Ignore -fdebug-prefix-map.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231835 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Upstream-Status: Backport
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ gcc/dwarf2out.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
+index 3614c10..526f114 100644
+--- a/gcc/dwarf2out.c
++++ b/gcc/dwarf2out.c
+@@ -19670,6 +19670,7 @@ gen_producer_string (void)
+ case OPT_fpreprocessed:
+ case OPT_fltrans_output_list_:
+ case OPT_fresolution_:
++ case OPT_fdebug_prefix_map_:
+ /* Ignore these. */
+ continue;
+ default:
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0052-nios2-use-ret-with-r31.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0052-nios2-use-ret-with-r31.patch
new file mode 100644
index 000000000..f3cb47fd1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0052-nios2-use-ret-with-r31.patch
@@ -0,0 +1,103 @@
+From 1d67120d95c2c6e0ed4f7357d1cc62887eaba463 Mon Sep 17 00:00:00 2001
+From: sandra <sandra@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Tue, 12 May 2015 15:57:22 +0000
+Subject: [PATCH] 2015-05-12 Chung-Lin Tang <cltang@codesourcery.com>
+ Sandra Loosemore <sandra@codesourcery.com>
+
+ gcc/
+ * config/nios2/nios2.h (enum reg_class): Add IJMP_REGS enum
+ value.
+ (REG_CLASS_NAMES): Add "IJMP_REGS".
+ (REG_CLASS_CONTENTS): Add new entry for IJMP_REGS.
+ * config/nios2/nios2.md (indirect_jump,*tablejump): Adjust to
+ use new "c" register constraint.
+ * config/nios2/constraint.md (c): New register constraint
+ corresponding to IJMP_REGS.
+
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223082 138bc75d-0d04-0410-961f-82ee72b054a4
+Signed-off-by: Marek Vasut <marex@denx.de>
+Upstream-Status: Backport [ git://gcc.gnu.org/git/gcc.git 1d67120d95c2c6e0ed4f7357d1cc62887eaba463 ]
+---
+ gcc/ChangeLog | 12 ++++++++++++
+ gcc/config/nios2/constraints.md | 3 +++
+ gcc/config/nios2/nios2.h | 11 +++++++----
+ gcc/config/nios2/nios2.md | 4 ++--
+ 4 files changed, 24 insertions(+), 6 deletions(-)
+
+diff --git a/gcc/config/nios2/constraints.md b/gcc/config/nios2/constraints.md
+index f4bd9f7..735f892 100644
+--- a/gcc/config/nios2/constraints.md
++++ b/gcc/config/nios2/constraints.md
+@@ -39,6 +39,9 @@
+
+ ;; Register constraints
+
++(define_register_constraint "c" "IJMP_REGS"
++ "A register suitable for an indirect jump.")
++
+ (define_register_constraint "j" "SIB_REGS"
+ "A register suitable for an indirect sibcall.")
+
+diff --git a/gcc/config/nios2/nios2.h b/gcc/config/nios2/nios2.h
+index 510ab5f..ac33978 100644
+--- a/gcc/config/nios2/nios2.h
++++ b/gcc/config/nios2/nios2.h
+@@ -173,6 +173,7 @@ enum reg_class
+ {
+ NO_REGS,
+ SIB_REGS,
++ IJMP_REGS,
+ GP_REGS,
+ ALL_REGS,
+ LIM_REG_CLASSES
+@@ -183,6 +184,7 @@ enum reg_class
+ #define REG_CLASS_NAMES \
+ { "NO_REGS", \
+ "SIB_REGS", \
++ "IJMP_REGS", \
+ "GP_REGS", \
+ "ALL_REGS" }
+
+@@ -190,10 +192,11 @@ enum reg_class
+
+ #define REG_CLASS_CONTENTS \
+ { \
+- /* NO_REGS */ { 0, 0}, \
+- /* SIB_REGS */ { 0xfe0c, 0}, \
+- /* GP_REGS */ {~0, 0}, \
+- /* ALL_REGS */ {~0,~0} \
++ /* NO_REGS */ { 0, 0}, \
++ /* SIB_REGS */ { 0xfe0c, 0}, \
++ /* IJMP_REGS */ { 0x7fffffff, 0}, \
++ /* GP_REGS */ {~0, 0}, \
++ /* ALL_REGS */ {~0,~0} \
+ }
+
+
+diff --git a/gcc/config/nios2/nios2.md b/gcc/config/nios2/nios2.md
+index 7b35d269..36ef101 100644
+--- a/gcc/config/nios2/nios2.md
++++ b/gcc/config/nios2/nios2.md
+@@ -697,7 +697,7 @@
+ ; check or adjust for overflow.
+
+ (define_insn "indirect_jump"
+- [(set (pc) (match_operand:SI 0 "register_operand" "r"))]
++ [(set (pc) (match_operand:SI 0 "register_operand" "c"))]
+ ""
+ "jmp\\t%0"
+ [(set_attr "type" "control")])
+@@ -811,7 +811,7 @@
+
+ (define_insn "*tablejump"
+ [(set (pc)
+- (match_operand:SI 0 "register_operand" "r"))
++ (match_operand:SI 0 "register_operand" "c"))
+ (use (label_ref (match_operand 1 "" "")))]
+ ""
+ "jmp\\t%0"
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0053-expr.c-PR-target-65358-Avoid-clobbering-partial-argu.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0053-expr.c-PR-target-65358-Avoid-clobbering-partial-argu.patch
new file mode 100644
index 000000000..c18f40e74
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0053-expr.c-PR-target-65358-Avoid-clobbering-partial-argu.patch
@@ -0,0 +1,307 @@
+From 536b8318974495cde2b42c3c2742748e2b271be0 Mon Sep 17 00:00:00 2001
+From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Wed, 27 May 2015 13:25:01 +0000
+Subject: [PATCH] PR target/65358 Avoid clobbering partial argument during
+ sibcall
+
+ PR target/65358
+ * expr.c (memory_load_overlap): New function.
+ (emit_push_insn): When pushing partial args to the stack would
+ clobber the register part load the overlapping part into a pseudo
+ and put it into the hard reg after pushing. Change return type
+ to bool. Add bool argument.
+ * expr.h (emit_push_insn): Change return type to bool.
+ Add bool argument.
+ * calls.c (expand_call): Cancel sibcall optimization when encountering
+ partial argument on targets with ARGS_GROW_DOWNWARD and
+ !STACK_GROWS_DOWNWARD.
+ (emit_library_call_value_1): Update callsite of emit_push_insn.
+ (store_one_arg): Likewise.
+
+ PR target/65358
+ * gcc.dg/pr65358.c: New test.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223753 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Upstream-Status: Backport from 6.0
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ gcc/calls.c | 17 ++++++--
+ gcc/expr.c | 90 +++++++++++++++++++++++++++++++++++++-----
+ gcc/expr.h | 4 +-
+ gcc/testsuite/gcc.dg/pr65358.c | 33 ++++++++++++++++
+ 4 files changed, 129 insertions(+), 15 deletions(-)
+ create mode 100644 gcc/testsuite/gcc.dg/pr65358.c
+
+diff --git a/gcc/calls.c b/gcc/calls.c
+index ee8ea5f..2334381 100644
+--- a/gcc/calls.c
++++ b/gcc/calls.c
+@@ -3236,6 +3236,14 @@ expand_call (tree exp, rtx target, int ignore)
+ {
+ rtx_insn *before_arg = get_last_insn ();
+
++ /* On targets with weird calling conventions (e.g. PA) it's
++ hard to ensure that all cases of argument overlap between
++ stack and registers work. Play it safe and bail out. */
++#if defined(ARGS_GROW_DOWNWARD) && !defined(STACK_GROWS_DOWNWARD)
++ sibcall_failure = 1;
++ break;
++#endif
++
+ if (store_one_arg (&args[i], argblock, flags,
+ adjusted_args_size.var != 0,
+ reg_parm_stack_space)
+@@ -4279,7 +4287,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
+ partial, reg, 0, argblock,
+ GEN_INT (argvec[argnum].locate.offset.constant),
+ reg_parm_stack_space,
+- ARGS_SIZE_RTX (argvec[argnum].locate.alignment_pad));
++ ARGS_SIZE_RTX (argvec[argnum].locate.alignment_pad), false);
+
+ /* Now mark the segment we just used. */
+ if (ACCUMULATE_OUTGOING_ARGS)
+@@ -4886,10 +4894,11 @@ store_one_arg (struct arg_data *arg, rtx argblock, int flags,
+
+ /* This isn't already where we want it on the stack, so put it there.
+ This can either be done with push or copy insns. */
+- emit_push_insn (arg->value, arg->mode, TREE_TYPE (pval), NULL_RTX,
++ if (!emit_push_insn (arg->value, arg->mode, TREE_TYPE (pval), NULL_RTX,
+ parm_align, partial, reg, used - size, argblock,
+ ARGS_SIZE_RTX (arg->locate.offset), reg_parm_stack_space,
+- ARGS_SIZE_RTX (arg->locate.alignment_pad));
++ ARGS_SIZE_RTX (arg->locate.alignment_pad), true))
++ sibcall_failure = 1;
+
+ /* Unless this is a partially-in-register argument, the argument is now
+ in the stack. */
+@@ -5001,7 +5010,7 @@ store_one_arg (struct arg_data *arg, rtx argblock, int flags,
+ emit_push_insn (arg->value, arg->mode, TREE_TYPE (pval), size_rtx,
+ parm_align, partial, reg, excess, argblock,
+ ARGS_SIZE_RTX (arg->locate.offset), reg_parm_stack_space,
+- ARGS_SIZE_RTX (arg->locate.alignment_pad));
++ ARGS_SIZE_RTX (arg->locate.alignment_pad), false);
+
+ /* Unless this is a partially-in-register argument, the argument is now
+ in the stack.
+diff --git a/gcc/expr.c b/gcc/expr.c
+index 5c09550..24a6293 100644
+--- a/gcc/expr.c
++++ b/gcc/expr.c
+@@ -4121,12 +4121,35 @@ emit_single_push_insn (machine_mode mode, rtx x, tree type)
+ }
+ #endif
+
++/* If reading SIZE bytes from X will end up reading from
++ Y return the number of bytes that overlap. Return -1
++ if there is no overlap or -2 if we can't determine
++ (for example when X and Y have different base registers). */
++
++static int
++memory_load_overlap (rtx x, rtx y, HOST_WIDE_INT size)
++{
++ rtx tmp = plus_constant (Pmode, x, size);
++ rtx sub = simplify_gen_binary (MINUS, Pmode, tmp, y);
++
++ if (!CONST_INT_P (sub))
++ return -2;
++
++ HOST_WIDE_INT val = INTVAL (sub);
++
++ return IN_RANGE (val, 1, size) ? val : -1;
++}
++
+ /* Generate code to push X onto the stack, assuming it has mode MODE and
+ type TYPE.
+ MODE is redundant except when X is a CONST_INT (since they don't
+ carry mode info).
+ SIZE is an rtx for the size of data to be copied (in bytes),
+ needed only if X is BLKmode.
++ Return true if successful. May return false if asked to push a
++ partial argument during a sibcall optimization (as specified by
++ SIBCALL_P) and the incoming and outgoing pointers cannot be shown
++ to not overlap.
+
+ ALIGN (in bits) is maximum alignment we can assume.
+
+@@ -4152,11 +4175,11 @@ emit_single_push_insn (machine_mode mode, rtx x, tree type)
+ for arguments passed in registers. If nonzero, it will be the number
+ of bytes required. */
+
+-void
++bool
+ emit_push_insn (rtx x, machine_mode mode, tree type, rtx size,
+ unsigned int align, int partial, rtx reg, int extra,
+ rtx args_addr, rtx args_so_far, int reg_parm_stack_space,
+- rtx alignment_pad)
++ rtx alignment_pad, bool sibcall_p)
+ {
+ rtx xinner;
+ enum direction stack_direction
+@@ -4179,6 +4202,10 @@ emit_push_insn (rtx x, machine_mode mode, tree type, rtx size,
+
+ xinner = x;
+
++ int nregs = partial / UNITS_PER_WORD;
++ rtx *tmp_regs = NULL;
++ int overlapping = 0;
++
+ if (mode == BLKmode
+ || (STRICT_ALIGNMENT && align < GET_MODE_ALIGNMENT (mode)))
+ {
+@@ -4309,6 +4336,43 @@ emit_push_insn (rtx x, machine_mode mode, tree type, rtx size,
+ PARM_BOUNDARY. Assume the caller isn't lying. */
+ set_mem_align (target, align);
+
++ /* If part should go in registers and pushing to that part would
++ overwrite some of the values that need to go into regs, load the
++ overlapping values into temporary pseudos to be moved into the hard
++ regs at the end after the stack pushing has completed.
++ We cannot load them directly into the hard regs here because
++ they can be clobbered by the block move expansions.
++ See PR 65358. */
++
++ if (partial > 0 && reg != 0 && mode == BLKmode
++ && GET_CODE (reg) != PARALLEL)
++ {
++ overlapping = memory_load_overlap (XEXP (x, 0), temp, partial);
++ if (overlapping > 0)
++ {
++ gcc_assert (overlapping % UNITS_PER_WORD == 0);
++ overlapping /= UNITS_PER_WORD;
++
++ tmp_regs = XALLOCAVEC (rtx, overlapping);
++
++ for (int i = 0; i < overlapping; i++)
++ tmp_regs[i] = gen_reg_rtx (word_mode);
++
++ for (int i = 0; i < overlapping; i++)
++ emit_move_insn (tmp_regs[i],
++ operand_subword_force (target, i, mode));
++ }
++ else if (overlapping == -1)
++ overlapping = 0;
++ /* Could not determine whether there is overlap.
++ Fail the sibcall. */
++ else
++ {
++ overlapping = 0;
++ if (sibcall_p)
++ return false;
++ }
++ }
+ emit_block_move (target, xinner, size, BLOCK_OP_CALL_PARM);
+ }
+ }
+@@ -4363,12 +4427,13 @@ emit_push_insn (rtx x, machine_mode mode, tree type, rtx size,
+ has a size a multiple of a word. */
+ for (i = size - 1; i >= not_stack; i--)
+ if (i >= not_stack + offset)
+- emit_push_insn (operand_subword_force (x, i, mode),
++ if (!emit_push_insn (operand_subword_force (x, i, mode),
+ word_mode, NULL_TREE, NULL_RTX, align, 0, NULL_RTX,
+ 0, args_addr,
+ GEN_INT (args_offset + ((i - not_stack + skip)
+ * UNITS_PER_WORD)),
+- reg_parm_stack_space, alignment_pad);
++ reg_parm_stack_space, alignment_pad, sibcall_p))
++ return false;
+ }
+ else
+ {
+@@ -4411,9 +4476,8 @@ emit_push_insn (rtx x, machine_mode mode, tree type, rtx size,
+ }
+ }
+
+- /* If part should go in registers, copy that part
+- into the appropriate registers. Do this now, at the end,
+- since mem-to-mem copies above may do function calls. */
++ /* Move the partial arguments into the registers and any overlapping
++ values that we moved into the pseudos in tmp_regs. */
+ if (partial > 0 && reg != 0)
+ {
+ /* Handle calls that pass values in multiple non-contiguous locations.
+@@ -4421,9 +4485,15 @@ emit_push_insn (rtx x, machine_mode mode, tree type, rtx size,
+ if (GET_CODE (reg) == PARALLEL)
+ emit_group_load (reg, x, type, -1);
+ else
+- {
++ {
+ gcc_assert (partial % UNITS_PER_WORD == 0);
+- move_block_to_reg (REGNO (reg), x, partial / UNITS_PER_WORD, mode);
++ move_block_to_reg (REGNO (reg), x, nregs - overlapping, mode);
++
++ for (int i = 0; i < overlapping; i++)
++ emit_move_insn (gen_rtx_REG (word_mode, REGNO (reg)
++ + nregs - overlapping + i),
++ tmp_regs[i]);
++
+ }
+ }
+
+@@ -4432,6 +4502,8 @@ emit_push_insn (rtx x, machine_mode mode, tree type, rtx size,
+
+ if (alignment_pad && args_addr == 0)
+ anti_adjust_stack (alignment_pad);
++
++ return true;
+ }
+
+ /* Return X if X can be used as a subtarget in a sequence of arithmetic
+diff --git a/gcc/expr.h b/gcc/expr.h
+index 867852e..5fcc13f 100644
+--- a/gcc/expr.h
++++ b/gcc/expr.h
+@@ -218,8 +218,8 @@ extern rtx emit_move_resolve_push (machine_mode, rtx);
+ extern rtx push_block (rtx, int, int);
+
+ /* Generate code to push something onto the stack, given its mode and type. */
+-extern void emit_push_insn (rtx, machine_mode, tree, rtx, unsigned int,
+- int, rtx, int, rtx, rtx, int, rtx);
++extern bool emit_push_insn (rtx, machine_mode, tree, rtx, unsigned int,
++ int, rtx, int, rtx, rtx, int, rtx, bool);
+
+ /* Expand an assignment that stores the value of FROM into TO. */
+ extern void expand_assignment (tree, tree, bool);
+diff --git a/gcc/testsuite/gcc.dg/pr65358.c b/gcc/testsuite/gcc.dg/pr65358.c
+new file mode 100644
+index 0000000..ba89fd4
+--- /dev/null
++++ b/gcc/testsuite/gcc.dg/pr65358.c
+@@ -0,0 +1,33 @@
++/* { dg-do run } */
++/* { dg-options "-O2" } */
++
++struct pack
++{
++ int fine;
++ int victim;
++ int killer;
++};
++
++int __attribute__ ((__noinline__, __noclone__))
++bar (int a, int b, struct pack p)
++{
++ if (a != 20 || b != 30)
++ __builtin_abort ();
++ if (p.fine != 40 || p.victim != 50 || p.killer != 60)
++ __builtin_abort ();
++ return 0;
++}
++
++int __attribute__ ((__noinline__, __noclone__))
++foo (int arg1, int arg2, int arg3, struct pack p)
++{
++ return bar (arg2, arg3, p);
++}
++
++int main (void)
++{
++ struct pack p = { 40, 50, 60 };
++
++ (void) foo (10, 20, 30, p);
++ return 0;
++}
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0054-support-ffile-prefix-map.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0054-support-ffile-prefix-map.patch
new file mode 100644
index 000000000..da1687913
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0054-support-ffile-prefix-map.patch
@@ -0,0 +1,284 @@
+From ef7c2bda6b4c88f8007ed663b1108cd4651598c8 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] 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 | 6 ++++
+ 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, 142 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 718a052..3f93c56 100644
+--- a/gcc/c-family/c-opts.c
++++ b/gcc/c-family/c-opts.c
+@@ -46,6 +46,7 @@ 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,
+@@ -510,6 +511,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 453ec8e..30ad053 100644
+--- a/gcc/c-family/c.opt
++++ b/gcc/c-family/c.opt
+@@ -1117,6 +1117,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 526f114..438a475 100644
+--- a/gcc/dwarf2out.c
++++ b/gcc/dwarf2out.c
+@@ -19671,6 +19671,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 c85f83a..1ffe1e1 100644
+--- a/gcc/gimplify.c
++++ b/gcc/gimplify.c
+@@ -87,6 +87,7 @@ along with GCC; see the file COPYING3. If not see
+ #include "gimple-low.h"
+ #include "cilk.h"
+ #include "gomp-constants.h"
++#include "file-map.h"
+
+ #include "langhooks-def.h" /* FIXME: for lhd_set_decl_assembler_name */
+ #include "tree-pass.h" /* FIXME: only for PROP_gimple_any */
+@@ -2370,6 +2371,7 @@ gimplify_call_expr (tree *expr_p, gimple_seq *pre_p, bool want_value)
+ case BUILT_IN_FILE:
+ {
+ const char *locfile = LOCATION_FILE (EXPR_LOCATION (*expr_p));
++ locfile = remap_file_filename (locfile);
+ *expr_p = build_string_literal (strlen (locfile) + 1, locfile);
+ return GS_OK;
+ }
+diff --git a/libcpp/Makefile.in b/libcpp/Makefile.in
+index ad35563..c210ff9 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 0000000..04e851b
+--- /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 0000000..e6f8cbf
+--- /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 1e0a0b5..c3d330c 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
+@@ -297,6 +298,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;
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0055-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0055-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch
new file mode 100644
index 000000000..c7caed8c8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0055-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch
@@ -0,0 +1,43 @@
+From 14b79641ff6b0008aef7fbf7aa300daec11d1e78 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] 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 b61bdcf..51bb177 100644
+--- a/gcc/opts-global.c
++++ b/gcc/opts-global.c
+@@ -50,6 +50,7 @@ along with GCC; see the file COPYING3. If not see
+ #include "rtl.h"
+ #include "dbgcnt.h"
+ #include "debug.h"
++#include "file-map.h"
+ #include "hash-map.h"
+ #include "plugin-api.h"
+ #include "ipa-ref.h"
+@@ -378,6 +379,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_:
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0056-Enable-libc-provide-ssp-and-gcc_cv_target_dl_iterate.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0056-Enable-libc-provide-ssp-and-gcc_cv_target_dl_iterate.patch
new file mode 100644
index 000000000..97913420e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0056-Enable-libc-provide-ssp-and-gcc_cv_target_dl_iterate.patch
@@ -0,0 +1,85 @@
+From 5c7bd853c8703f65904083778712ef625c3f3814 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 27 Mar 2016 20:31:50 -0700
+Subject: [PATCH 56/57] Enable libc provide ssp and
+ gcc_cv_target_dl_iterate_phdr for musl
+
+ * configure.ac (gcc_cv_libc_provides_ssp): Add *-*-musl*.
+ (gcc_cv_target_dl_iterate_phdr): Add *-linux-musl*.
+ * configure: Regenerate.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Backport
+
+ gcc/configure | 7 +++++++
+ gcc/configure.ac | 7 +++++++
+ 2 files changed, 14 insertions(+)
+
+diff --git a/gcc/configure b/gcc/configure
+index fcb05e7..81a449c 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -27814,6 +27814,9 @@ if test "${gcc_cv_libc_provides_ssp+set}" = set; then :
+ else
+ gcc_cv_libc_provides_ssp=no
+ case "$target" in
++ *-*-musl*)
++ # All versions of musl provide stack protector
++ gcc_cv_libc_provides_ssp=yes;;
+ *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
+ # glibc 2.4 and later provides __stack_chk_fail and
+ # either __stack_chk_guard, or TLS access to stack guard canary.
+@@ -27846,6 +27849,7 @@ fi
+ # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now
+ # simply assert that glibc does provide this, which is true for all
+ # realistically usable GNU/Hurd configurations.
++ # All supported versions of musl provide it as well
+ gcc_cv_libc_provides_ssp=yes;;
+ *-*-darwin* | *-*-freebsd*)
+ ac_fn_c_check_func "$LINENO" "__stack_chk_fail" "ac_cv_func___stack_chk_fail"
+@@ -27942,6 +27946,9 @@ case "$target" in
+ gcc_cv_target_dl_iterate_phdr=no
+ fi
+ ;;
++ *-linux-musl*)
++ gcc_cv_target_dl_iterate_phdr=yes
++ ;;
+ esac
+
+ if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 923bc9a..b08e3dc 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -5291,6 +5291,9 @@ AC_CACHE_CHECK(__stack_chk_fail in target C library,
+ gcc_cv_libc_provides_ssp,
+ [gcc_cv_libc_provides_ssp=no
+ case "$target" in
++ *-*-musl*)
++ # All versions of musl provide stack protector
++ gcc_cv_libc_provides_ssp=yes;;
+ *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
+ # glibc 2.4 and later provides __stack_chk_fail and
+ # either __stack_chk_guard, or TLS access to stack guard canary.
+@@ -5317,6 +5320,7 @@ AC_CACHE_CHECK(__stack_chk_fail in target C library,
+ # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now
+ # simply assert that glibc does provide this, which is true for all
+ # realistically usable GNU/Hurd configurations.
++ # All supported versions of musl provide it as well
+ gcc_cv_libc_provides_ssp=yes;;
+ *-*-darwin* | *-*-freebsd*)
+ AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes],
+@@ -5390,6 +5394,9 @@ case "$target" in
+ gcc_cv_target_dl_iterate_phdr=no
+ fi
+ ;;
++ *-linux-musl*)
++ gcc_cv_target_dl_iterate_phdr=yes
++ ;;
+ esac
+ GCC_TARGET_TEMPLATE([TARGET_DL_ITERATE_PHDR])
+ if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
+--
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0057-unwind-fix-for-musl.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0057-unwind-fix-for-musl.patch
new file mode 100644
index 000000000..c193587bf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0057-unwind-fix-for-musl.patch
@@ -0,0 +1,42 @@
+From c5c33bf881a2aea355310dd90873ed39bc272b3c Mon Sep 17 00:00:00 2001
+From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Wed, 22 Apr 2015 14:20:01 +0000
+Subject: [PATCH 57/57] unwind fix for musl
+
+On behalf of szabolcs.nagy@arm.com
+
+2015-04-22 Gregor Richards <gregor.richards@uwaterloo.ca>
+ Szabolcs Nagy <szabolcs.nagy@arm.com>
+
+ * unwind-dw2-fde-dip.c (USE_PT_GNU_EH_FRAME): Define it on
+ Linux if target provides dl_iterate_phdr.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222328 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Backport
+
+ libgcc/unwind-dw2-fde-dip.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/libgcc/unwind-dw2-fde-dip.c b/libgcc/unwind-dw2-fde-dip.c
+index e1e566b..137dced 100644
+--- a/libgcc/unwind-dw2-fde-dip.c
++++ b/libgcc/unwind-dw2-fde-dip.c
+@@ -59,6 +59,12 @@
+
+ #if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
+ && defined(TARGET_DL_ITERATE_PHDR) \
++ && defined(__linux__)
++# define USE_PT_GNU_EH_FRAME
++#endif
++
++#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
++ && defined(TARGET_DL_ITERATE_PHDR) \
+ && (defined(__DragonFly__) || defined(__FreeBSD__))
+ # define ElfW __ElfN
+ # define USE_PT_GNU_EH_FRAME
+--
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0058-fdebug-prefix-map-support-to-remap-relative-path.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0058-fdebug-prefix-map-support-to-remap-relative-path.patch
new file mode 100644
index 000000000..0b91fdbbc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0058-fdebug-prefix-map-support-to-remap-relative-path.patch
@@ -0,0 +1,51 @@
+From 289ad2969a5966c603bf6928ce442db74c4cbb25 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] 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>
+---
+diff --git a/gcc/final.c b/gcc/final.c
+index 55cf509..c3594c2 100644
+--- a/gcc/final.c
++++ b/gcc/final.c
+@@ -1554,16 +1554,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.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-common.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-common.inc
new file mode 100644
index 000000000..e4fd4d6f7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-common.inc
@@ -0,0 +1,105 @@
+SUMMARY = "GNU cc and gcc C compilers"
+HOMEPAGE = "http://www.gnu.org/software/gcc/"
+SECTION = "devel"
+LICENSE = "GPL"
+
+NATIVEDEPS = ""
+
+inherit autotools gettext texinfo
+
+BPN = "gcc"
+
+def get_gcc_float_setting(bb, d):
+ if d.getVar('ARMPKGSFX_EABI', True) == "hf" and d.getVar('TRANSLATED_TARGET_ARCH', True) == "arm":
+ return "--with-float=hard"
+ if d.getVar('TARGET_FPU', True) in [ 'soft' ]:
+ return "--with-float=soft"
+ if d.getVar('TARGET_FPU', True) 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', True) 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', True) 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', True) in [ 'powerpc', 'powerpc64' ] and d.getVar('TCLIBC', True) in [ 'uclibc', 'glibc' ]:
+ return "--with-long-double-128"
+ return ""
+
+def get_gcc_multiarch_setting(bb, d):
+ target_arch = d.getVar('TRANSLATED_TARGET_ARCH', True)
+ 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', True)
+ 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)
+ bb.data.update_data(localdata)
+
+ retdict = {}
+ retdict['tune'] = tune
+ retdict['ccargs'] = localdata.getVar('TUNE_CCARGS', True)
+ retdict['features'] = localdata.getVar('TUNE_FEATURES', True)
+ # BASELIB is used by the multilib code to change library paths
+ retdict['baselib'] = localdata.getVar('BASE_LIB', True) or localdata.getVar('BASELIB', True)
+ retdict['arch'] = localdata.getVar('TUNE_ARCH', True)
+ retdict['abiextension'] = localdata.getVar('ABIEXTENSION', True)
+ retdict['target_fpu'] = localdata.getVar('TARGET_FPU', True)
+ retdict['pkgarch'] = localdata.getVar('TUNE_PKGARCH', True)
+ retdict['package_extra_archs'] = localdata.getVar('PACKAGE_EXTRA_ARCHS', True)
+ 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/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-configure-common.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-configure-common.inc
new file mode 100644
index 000000000..f4f76bda5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-configure-common.inc
@@ -0,0 +1,122 @@
+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"
+
+EXTRA_OECONF = "\
+ ${@['--enable-clocale=generic', ''][d.getVar('USE_NLS', True) != 'no']} \
+ --with-gnu-ld \
+ --enable-shared \
+ --enable-languages=${LANGUAGES} \
+ --enable-threads=${GCCTHREADS} \
+ ${GCCMULTILIB} \
+ --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)} \
+"
+
+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).
+
+# Build uclibc compilers without cxa_atexit support
+EXTRA_OECONF_append_linux = " --enable-__cxa_atexit"
+EXTRA_OECONF_append_libc-uclibc = " --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"
+
+# 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"
+
+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/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-canadian.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
new file mode 100644
index 000000000..ec1d28180
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
@@ -0,0 +1,172 @@
+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"
+
+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
+}
+
+# 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}/usr/include/* \
+"
+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 )
+ 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 = "/usr/include"
+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/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-canadian_4.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-canadian_4.9.bb
new file mode 100644
index 000000000..bf53c5cd7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-canadian_4.9.bb
@@ -0,0 +1,5 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-cross-canadian.inc
+
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-canadian_5.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-canadian_5.3.bb
new file mode 100644
index 000000000..bf53c5cd7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-canadian_5.3.bb
@@ -0,0 +1,5 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-cross-canadian.inc
+
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-initial.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-initial.inc
new file mode 100644
index 000000000..048b5302b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-initial.inc
@@ -0,0 +1,100 @@
+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=${GCCCROSS_BUILDSYSROOT} \
+ ${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}"
+
+GCCCROSS_BUILDSYSROOT = "${B}/tmpsysroot"
+
+do_configure_prepend () {
+ sysr=${GCCCROSS_BUILDSYSROOT}${target_includedir}
+ mkdir -p $sysr
+ for t in linux asm asm-generic; do
+ rm -f $sysr/$t
+ ln -s ${STAGING_DIR_TARGET}${target_includedir}/$t $sysr/
+ done
+}
+
+do_compile () {
+ oe_runmake all-gcc configure-target-libgcc
+}
+do_install () {
+ ( cd ${B}/${TARGET_SYS}/libgcc; oe_runmake 'DESTDIR=${D}' 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
+
+ # gcc-runtime installs libgcc into a special location in staging since it breaks doing a standalone build
+ case ${PN} in
+ *gcc-cross-initial-${TARGET_ARCH}|*gcc-crosssdk-initial-${TARGET_ARCH})
+ dest=${D}/${includedir}/gcc-build-internal-initial-${TARGET_SYS}
+ hardlinkdir . $dest
+ ;;
+ esac
+}
+#
+# 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}/ ${SYSROOT_DESTDIR}/${STAGING_DIR_TARGET}/${target_base_libdir}/"
+do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_HOST}/ ${STAGING_DIR_TCBOOTSTRAP}/${target_base_libdir}/"
+
+inherit nopackages
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-initial_4.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-initial_4.9.bb
new file mode 100644
index 000000000..4c73e5ce6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-initial_4.9.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-cross_${PV}.bb
+require gcc-cross-initial.inc
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-initial_5.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-initial_5.3.bb
new file mode 100644
index 000000000..4c73e5ce6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-initial_5.3.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-cross_${PV}.bb
+require gcc-cross-initial.inc
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross.inc
new file mode 100644
index 000000000..f47936061
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross.inc
@@ -0,0 +1,197 @@
+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", True).startswith("linux"):
+ d.setVar("EXTRADEPENDS", "linux-libc-headers")
+}
+
+PN = "gcc-cross-${TARGET_ARCH}"
+
+require gcc-configure-common.inc
+
+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
+ # 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 )
+ 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.
+ ln -sf ${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}gfortran ${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}g77 || true
+
+
+ # 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 nm objcopy objdump ranlib strip g77 gcc cpp gfortran; 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
+
+ # gcc-runtime installs libgcc into a special location in staging since it breaks doing a standalone build
+ case ${PN} in
+ *gcc-cross-${TARGET_ARCH}|*gcc-crosssdk-${TARGET_ARCH})
+ dest=${D}/${includedir}/gcc-build-internal-${TARGET_SYS}
+ hardlinkdir . $dest
+ ;;
+ esac
+}
+
+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"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross_4.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross_4.9.bb
new file mode 100644
index 000000000..b43cca0c5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross_4.9.bb
@@ -0,0 +1,3 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-cross.inc
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross_5.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross_5.3.bb
new file mode 100644
index 000000000..b43cca0c5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross_5.3.bb
@@ -0,0 +1,3 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-cross.inc
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial.inc
new file mode 100644
index 000000000..7d2599cb6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial.inc
@@ -0,0 +1,10 @@
+inherit crosssdk
+
+PN = "gcc-crosssdk-initial-${TARGET_ARCH}"
+
+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/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.9.bb
new file mode 100644
index 000000000..fd90e1140
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.9.bb
@@ -0,0 +1,3 @@
+require recipes-devtools/gcc/gcc-cross-initial_${PV}.bb
+require gcc-crosssdk-initial.inc
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial_5.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial_5.3.bb
new file mode 100644
index 000000000..fd90e1140
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial_5.3.bb
@@ -0,0 +1,3 @@
+require recipes-devtools/gcc/gcc-cross-initial_${PV}.bb
+require gcc-crosssdk-initial.inc
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk.inc
new file mode 100644
index 000000000..53f880f39
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk.inc
@@ -0,0 +1,12 @@
+inherit crosssdk
+
+PN = "gcc-crosssdk-${TARGET_ARCH}"
+
+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/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk_4.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk_4.9.bb
new file mode 100644
index 000000000..40a6c4fef
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk_4.9.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-cross_${PV}.bb
+require gcc-crosssdk.inc
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk_5.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk_5.3.bb
new file mode 100644
index 000000000..40a6c4fef
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk_5.3.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-cross_${PV}.bb
+require gcc-crosssdk.inc
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-multilib-config.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-multilib-config.inc
new file mode 100644
index 000000000..a0a2ac09a
--- /dev/null
+++ b/import-layers/yocto-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', True)
+ builddir = d.getVar('B', True)
+ 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', True)
+ multilibs = (d.getVar('MULTILIB_VARIANTS', True) or '').split()
+ if not multilibs and pn != "nativesdk-gcc":
+ return
+
+ mlprefix = d.getVar('MLPREFIX', True)
+
+ 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', True) if mlprefix
+ else d.getVar('TARGET_ARCH', True))
+ if pn == "nativesdk-gcc":
+ header_config_files = gcc_header_config_files[d.getVar("SDK_ARCH", True)]
+ 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, True)
+ 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", True) 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/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-runtime.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-runtime.inc
new file mode 100644
index 000000000..8639c1c49
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-runtime.inc
@@ -0,0 +1,196 @@
+require gcc-configure-common.inc
+
+# 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_mips = ""
+RUNTIMELIBITM_mipsel = ""
+RUNTIMELIBITM_mips64 = ""
+RUNTIMELIBITM_mips64el = ""
+RUNTIMELIBITM_nios2 = ""
+RUNTIMELIBITM_microblaze = ""
+
+RUNTIMETARGET = "libssp libstdc++-v3 libgomp libatomic ${RUNTIMELIBITM} \
+ ${@bb.utils.contains_any('FORTRAN', [',fortran',',f77'], 'libquadmath', '', d)} \
+"
+
+# ?
+# libiberty
+# libmudflap
+# libgfortran needs separate recipe due to libquadmath dependency
+
+do_configure () {
+ export CXX="${CXX} -nostdinc++ -nostdlib++"
+ mtarget=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+ target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+ hardlinkdir ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget ${B}
+ for d in libgcc ${RUNTIMETARGET}; do
+ echo "Configuring $d"
+ rm -rf ${B}/$target/$d/
+ mkdir -p ${B}/$target/$d/
+ cd ${B}/$target/$d/
+ chmod a+x ${S}/$d/configure
+ relpath=${@os.path.relpath("${S}/$d", "${B}/$target/$d")}
+ $relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
+ done
+}
+
+do_compile () {
+ target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+ for d in libgcc ${RUNTIMETARGET}; do
+ cd ${B}/$target/$d/
+ oe_runmake MULTIBUILDTOP=${B}/$target/$d/
+ done
+}
+
+do_install () {
+ target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+ for d in ${RUNTIMETARGET}; do
+ cd ${B}/$target/$d/
+ oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/$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
+ if [ "${TARGET_OS}" = "linux-gnuspe" ]; then
+ ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
+ 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 \
+"
+
+# 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.*"
+FILES_libg2c-dev = "\
+ ${libdir}/libg2c.so \
+ ${libdir}/libg2c.a \
+ ${libdir}/libfrtbegin.a \
+"
+
+FILES_libstdc++ = "${libdir}/libstdc++.so.*"
+FILES_libstdc++-dev = "\
+ ${includedir}/c++/ \
+ ${libdir}/libstdc++.so \
+ ${libdir}/libstdc++*.la \
+ ${libdir}/libsupc++.la \
+"
+FILES_libstdc++-staticdev = "\
+ ${libdir}/libstdc++*.a \
+ ${libdir}/libsupc++.a \
+"
+
+FILES_libstdc++-precompile-dev = "${includedir}/c++/${TARGET_SYS}/bits/*.gch"
+
+FILES_libssp = "${libdir}/libssp.so.*"
+FILES_libssp-dev = "\
+ ${libdir}/libssp*.so \
+ ${libdir}/libssp*_nonshared.a \
+ ${libdir}/libssp*.la \
+ ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ssp \
+"
+FILES_libssp-staticdev = "${libdir}/libssp*.a"
+
+FILES_libquadmath = "${libdir}/libquadmath*.so.*"
+FILES_libquadmath-dev = "\
+ ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/quadmath* \
+ ${libdir}/libquadmath*.so \
+ ${libdir}/libquadmath.la \
+"
+FILES_libquadmath-staticdev = "${libdir}/libquadmath.a"
+
+FILES_libmudflap = "${libdir}/libmudflap*.so.*"
+FILES_libmudflap-dev = "\
+ ${libdir}/libmudflap*.so \
+ ${libdir}/libmudflap.la \
+"
+FILES_libmudflap-staticdev = "${libdir}/libmudflap.a"
+
+FILES_libgomp = "${libdir}/libgomp*${SOLIBS}"
+FILES_libgomp-dev = "\
+ ${libdir}/libgomp*${SOLIBSDEV} \
+ ${libdir}/libgomp*.la \
+ ${libdir}/libgomp.spec \
+ ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/omp.h \
+"
+FILES_libgomp-staticdev = "${libdir}/libgomp*.a"
+
+FILES_libatomic = "${libdir}/libatomic.so.*"
+FILES_libatomic-dev = "\
+ ${libdir}/libatomic.so \
+ ${libdir}/libatomic.la \
+"
+FILES_libatomic-staticdev = "${libdir}/libatomic.a"
+
+FILES_libitm = "${libdir}/libitm.so.*"
+FILES_libitm-dev = "\
+ ${libdir}/libitm.so \
+ ${libdir}/libitm.la \
+ ${libdir}/libitm.spec \
+"
+FILES_libitm-staticdev = "${libdir}/libitm.a"
+
+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/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-runtime_4.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-runtime_4.9.bb
new file mode 100644
index 000000000..497d69168
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-runtime_4.9.bb
@@ -0,0 +1,3 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-runtime.inc
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-runtime_5.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-runtime_5.3.bb
new file mode 100644
index 000000000..8f31e7792
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-runtime_5.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/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-sanitizers.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-sanitizers.inc
new file mode 100644
index 000000000..6091a0b6f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-sanitizers.inc
@@ -0,0 +1,110 @@
+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 () {
+ mtarget=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+ target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+ if [ -d ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget ]; then
+ hardlinkdir ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget ${B}
+ fi
+
+ echo "Configuring libsanitizer"
+ rm -rf ${B}/$target/libsanitizer/
+ mkdir -p ${B}/$target/libsanitizer/
+ cd ${B}/$target/libsanitizer/
+ chmod a+x ${S}/libsanitizer/configure
+ relpath=${@os.path.relpath("${S}/libsanitizer", "${B}/$target/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/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/libsanitizer/*/Makefile
+}
+
+do_compile () {
+ target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+ cd ${B}/$target/libsanitizer/
+ oe_runmake MULTIBUILDTOP=${B}/$target/libsanitizer/
+}
+
+do_install () {
+ target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+ cd ${B}/$target/libsanitizer/
+ oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/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"
+
+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-64 = " liblsan libtsan"
+RRECOMMENDS_${PN}_append_x86 = " liblsan"
+
+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"
+
+# MIPS, aarch64, and SPARC are broken.
+COMPATIBLE_HOST = '(x86_64|i.86|powerpc|arm).*-linux'
+
+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 \
+"
+FILES_libtsan-staticdev += "${libdir}/libtsan.a"
+
+FILES_${PN} = "${libdir}/*.spec ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/sanitizer/*.h"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-sanitizers_4.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-sanitizers_4.9.bb
new file mode 100644
index 000000000..601f66602
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-sanitizers_4.9.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-sanitizers.inc
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-sanitizers_5.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-sanitizers_5.3.bb
new file mode 100644
index 000000000..601f66602
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-sanitizers_5.3.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-sanitizers.inc
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-shared-source.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-shared-source.inc
new file mode 100644
index 000000000..aac4b4931
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-source.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-source.inc
new file mode 100644
index 000000000..49bde92c4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-source.inc
@@ -0,0 +1,32 @@
+deltask do_configure
+deltask do_compile
+deltask do_install
+deltask do_populate_sysroot
+deltask do_populate_lic
+deltask do_rm_work
+
+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 = ""
+
+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)
+}
+addtask do_preconfigure after do_patch
+do_preconfigure[depends] += "gnu-config-native:do_populate_sysroot autoconf-native:do_populate_sysroot"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-source_4.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-source_4.9.bb
new file mode 100644
index 000000000..b890fa33e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-source_4.9.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/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-source_5.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-source_5.3.bb
new file mode 100644
index 000000000..b890fa33e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-source_5.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/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-target.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-target.inc
new file mode 100644
index 000000000..b8dabe574
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-target.inc
@@ -0,0 +1,210 @@
+GCCMULTILIB = "--enable-multilib"
+require gcc-configure-common.inc
+
+EXTRA_OECONF_PATHS = "\
+ --with-sysroot=/ \
+ --with-build-sysroot=${STAGING_DIR_TARGET} \
+ --with-native-system-header-dir=${STAGING_DIR_TARGET}${target_includedir} \
+ --with-gxx-include-dir=${includedir}/c++/${BINV} \
+"
+
+EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
+
+# 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}/cc* \
+ ${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"
+
+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 \
+"
+FILES_gfortran = "\
+ ${bindir}/${TARGET_PREFIX}gfortran \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f951 \
+"
+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++ \
+"
+
+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
+ 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_stage_dirs_append () {
+ rm -rf $to${libdir}/gcc
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc_4.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc_4.9.bb
new file mode 100644
index 000000000..a9dc612fb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc_4.9.bb
@@ -0,0 +1,13 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-target.inc
+
+# http://errors.yoctoproject.org/Errors/Details/20497/
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
+
+BBCLASSEXTEND = "nativesdk"
+
+#SYSTEMHEADERS_class-nativesdk = "${@'${target_includedir}'.replace(d.getVar('SDKPATH', True),'%r')}"
+#SYSTEMLIBS_class-nativesdk = "${@'${target_base_libdir}'.replace(d.getVar('SDKPATH', True),'%r')}/"
+#SYSTEMLIBS1_class-nativesdk = "${@'${target_libdir}'.replace(d.getVar('SDKPATH', True),'%r')}/"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc_5.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc_5.3.bb
new file mode 100644
index 000000000..b0a523cae
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc_5.3.bb
@@ -0,0 +1,15 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-target.inc
+
+# Building with thumb enabled on armv4t 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"
+
+do_configure_prepend() {
+ # 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/' ${S}/libcc1/configure
+}
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-common.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-common.inc
new file mode 100644
index 000000000..dae07e96d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-common.inc
@@ -0,0 +1,145 @@
+BPN = "libgcc"
+
+require gcc-shared-source.inc
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+do_configure () {
+ target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+ install -d ${D}${base_libdir} ${D}${libdir}
+ hardlinkdir ${STAGING_INCDIR_NATIVE}/${LIBGCCBUILDTREENAME}$target/ ${B}
+ mkdir -p ${B}/${BPN}
+ mkdir -p ${B}/$target/${BPN}/
+ cd ${B}/${BPN}
+ chmod a+x ${S}/${BPN}/configure
+ relpath=${@os.path.relpath("${S}/${BPN}", "${B}/${BPN}")}
+ $relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
+}
+
+do_compile () {
+ target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+ cd ${B}/${BPN}
+ oe_runmake MULTIBUILDTOP=${B}/$target/${BPN}/
+}
+
+do_install () {
+ target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+ cd ${B}/${BPN}
+ oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/${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', True)
+ if not multilibs or bb.data.inherits_class('nativesdk', d):
+ return
+
+ binv = d.getVar('BINV', True)
+
+ mlprefix = d.getVar('MLPREFIX', True)
+ if ('%slibgcc' % mlprefix) != d.getVar('PN', True):
+ return
+
+ if mlprefix:
+ orig_tune = d.getVar('DEFAULTTUNE_MULTILIB_ORIGINAL', True)
+ 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', True) + '/' + binv + '/'
+
+ dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + \
+ d.getVar('TARGET_SYS', True) + '/' + 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, True)
+ 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
+
+ src = '../../../' + tune_baselib + '/' + \
+ tune_arch + d.getVar('TARGET_VENDOR', True) + 'ml' + ml + \
+ '-' + d.getVar('TARGET_OS', True) + '/' + binv + '/'
+
+ dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + \
+ d.getVar('TARGET_SYS', True) + '/' + binv + '/' + tune_bitness
+
+ if os.path.lexists(dest):
+ os.unlink(dest)
+ os.symlink(src, dest)
+}
+
+def get_original_vendoros(d):
+ vendoros = d.expand('${TARGET_VENDOR}-${TARGET_OS}')
+ for suffix in [d.getVar('ABIEXTENSION', True), d.getVar('LIBCEXTENSION', True)]:
+ if suffix and vendoros.endswith(suffix):
+ vendoros = vendoros[:-len(suffix)]
+ return vendoros
+
+ORIG_TARGET_VENDOROS := "${@get_original_vendoros(d)}"
+BASETARGET_SYS = "${TARGET_ARCH}${ORIG_TARGET_VENDOROS}"
+
+addtask extra_symlinks after do_multilib_install before do_package do_populate_sysroot
+fakeroot python do_extra_symlinks() {
+ targetsys = d.getVar('BASETARGET_SYS', True)
+
+ if targetsys != d.getVar('TARGET_SYS', True):
+ dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + targetsys
+ src = d.getVar('TARGET_SYS', True)
+ if not os.path.lexists(dest) and os.path.lexists(d.getVar('D', True) + d.getVar('libdir', True)):
+ os.symlink(src, dest)
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-initial.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-initial.inc
new file mode 100644
index 000000000..59e8a62e7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-initial.inc
@@ -0,0 +1,19 @@
+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-${TARGET_ARCH}"
+PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
+
+PACKAGES = ""
+
+EXTRA_OECONF += "--disable-shared"
+
+LIBGCCBUILDTREENAME = "gcc-build-internal-initial-"
+
+do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_TCBOOTSTRAP}/"
+
+inherit nopackages
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-initial_4.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-initial_4.9.bb
new file mode 100644
index 000000000..19f253fce
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-initial_4.9.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require libgcc-initial.inc
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb
new file mode 100644
index 000000000..19f253fce
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require libgcc-initial.inc
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc.inc
new file mode 100644
index 000000000..68377869c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc.inc
@@ -0,0 +1,32 @@
+require libgcc-common.inc
+
+DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
+
+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 \
+ ${@base_conditional('BASETARGET_SYS', '${TARGET_SYS}', '', '${libdir}/${BASETARGET_SYS}', d)} \
+ ${libdir}/${TARGET_SYS}/${BINV}* \
+"
+
+LIBGCCBUILDTREENAME = "gcc-build-internal-"
+
+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/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc_4.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc_4.9.bb
new file mode 100644
index 000000000..a5152f28e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc_4.9.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require libgcc.inc
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc_5.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc_5.3.bb
new file mode 100644
index 000000000..a5152f28e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc_5.3.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require libgcc.inc
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran.inc
new file mode 100644
index 000000000..58ceb2e07
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran.inc
@@ -0,0 +1,75 @@
+require gcc-configure-common.inc
+
+EXTRA_OECONF_PATHS = "\
+ --with-sysroot=/not/exist \
+ --with-build-sysroot=${STAGING_DIR_TARGET} \
+"
+
+do_configure () {
+ mtarget=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+ target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+ hardlinkdir ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget ${B}
+
+ echo "Configuring libgfortran"
+ rm -rf ${B}/$target/libgfortran/
+ mkdir -p ${B}/$target/libgfortran/
+ cd ${B}/$target/libgfortran/
+ chmod a+x ${S}/libgfortran/configure
+ relpath=${@os.path.relpath("${S}/libgfortran", "${B}/$target/libgfortran")}
+ $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/libgfortran/libtool
+}
+
+do_compile () {
+ target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+ cd ${B}/$target/libgfortran/
+ oe_runmake MULTIBUILDTOP=${B}/$target/libgfortran/
+}
+
+do_install () {
+ target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+ cd ${B}/$target/libgfortran/
+ oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/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"
+
+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* \
+"
+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", True)
+ if "fortran" not in f:
+ raise bb.parse.SkipPackage("libgfortran needs fortran support to be enabled in the compiler")
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran_4.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran_4.9.bb
new file mode 100644
index 000000000..71dd8b4bd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran_4.9.bb
@@ -0,0 +1,3 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require libgfortran.inc
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran_5.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran_5.3.bb
new file mode 100644
index 000000000..71dd8b4bd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran_5.3.bb
@@ -0,0 +1,3 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require libgfortran.inc
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-7.10.1.inc b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-7.10.1.inc
new file mode 100644
index 000000000..a9267d554
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-7.10.1.inc
@@ -0,0 +1,9 @@
+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[md5sum] = "b93a2721393e5fa226375b42d567d90b"
+SRC_URI[sha256sum] = "ff14f8050e6484508c73cbfa63731e57901478490ca1672dc0b5e2b03f6af622"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-common.inc b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-common.inc
new file mode 100644
index 000000000..0d28ee4ee
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-common.inc
@@ -0,0 +1,72 @@
+SUMMARY = "GNU debugger"
+HOMEPAGE = "http://www.gnu.org/software/gdb/"
+LICENSE = "GPLv3+"
+SECTION = "devel"
+DEPENDS = "expat zlib ncurses ${LTTNGUST}"
+
+LTTNGUST = "lttng-ust"
+LTTNGUST_aarch64 = ""
+LTTNGUST_libc-uclibc = ""
+LTTNGUST_mips = ""
+LTTNGUST_mipsel = ""
+LTTNGUST_mips64 = ""
+LTTNGUST_mips64el = ""
+LTTNGUST_mips64n32 = ""
+LTTNGUST_mips64eln32 = ""
+LTTNGUST_sh4 = ""
+LTTNGUST_libc-musl = ""
+
+INC_PR = "r0"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+ file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674 \
+ file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \
+ file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6"
+
+inherit autotools texinfo
+
+SRC_URI = "${GNU_MIRROR}/gdb/gdb-${PV}.tar.gz \
+ "
+
+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 \
+ "
+
+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,python,python python-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.
+do_install_append() {
+ rm -rf ${D}${libdir}
+ rm -rf ${D}${includedir}
+ rm -rf ${D}${datadir}/locale
+}
+
+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/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian.inc b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
new file mode 100644
index 000000000..6e42af1ba
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
@@ -0,0 +1,42 @@
+inherit cross-canadian
+inherit python-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-python, \
+ nativesdk-python-core nativesdk-python-lang nativesdk-python-re \
+ nativesdk-python-codecs nativesdk-python-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}/" ;;
+ --ldflags) echo "-Wl,-rpath-link,${STAGING_LIBDIR}/.. -Wl,-rpath,${libdir}/.. -lpthread -ldl -lutil -lm -lpython${PYTHON_BASEVERSION}" ;;
+ --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/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian_7.10.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian_7.10.1.bb
new file mode 100644
index 000000000..301035940
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian_7.10.1.bb
@@ -0,0 +1,3 @@
+require gdb-common.inc
+require gdb-cross-canadian.inc
+require gdb-${PV}.inc
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross.inc b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross.inc
new file mode 100644
index 000000000..2468d2303
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross.inc
@@ -0,0 +1,29 @@
+require gdb-common.inc
+
+DEPENDS = "expat-native ncurses-native"
+
+inherit pythonnative
+
+# Overrides PACKAGECONFIG variables in gdb-common.inc
+PACKAGECONFIG ??= "python readline"
+PACKAGECONFIG[python] = "--with-python=${STAGING_BINDIR_NATIVE}/python-native/python,--without-python,python-native"
+PACKAGECONFIG[readline] = "--with-system-readline,--without-system-readline,readline-native"
+
+do_compile_prepend() {
+ export BUILD_SYS="${BUILD_SYS}"
+ export HOST_SYS="${HOST_SYS}"
+ 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"
+
+inherit cross
+inherit gettext
+
+datadir .= "/gdb-${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross_7.10.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross_7.10.1.bb
new file mode 100644
index 000000000..3a95cfb03
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross_7.10.1.bb
@@ -0,0 +1,4 @@
+require gdb-cross.inc
+require gdb-${PV}.inc
+
+SRC_URI += "file://0001-make-man-install-relative-to-DESTDIR.patch"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb.inc b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb.inc
new file mode 100644
index 000000000..d9c864dca
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb.inc
@@ -0,0 +1,18 @@
+require gdb-common.inc
+
+inherit gettext
+
+SRC_URI += "file://0002-Change-order-of-CFLAGS.patch \
+ file://0003-Add-support-for-Renesas-SH-sh4-architecture.patch \
+ file://0001-Use-exported-definitions-of-SIGRTMIN.patch \
+ file://0001-include-sys-types.h-for-mode_t.patch \
+ file://0001-use-asm-sgidefs.h.patch \
+ file://force-readline-static.patch \
+ file://0001-mips-linux-nat-Define-_ABIO32-if-not-defined.patch \
+ "
+#LDFLAGS_append = " -s"
+#export CFLAGS_append=" -L${STAGING_LIBDIR}"
+
+# cross-canadian must not see this
+PACKAGES =+ "gdbserver"
+FILES_gdbserver = "${bindir}/gdbserver"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-Use-exported-definitions-of-SIGRTMIN.patch b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-Use-exported-definitions-of-SIGRTMIN.patch
new file mode 100644
index 000000000..5f0c09693
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-Use-exported-definitions-of-SIGRTMIN.patch
@@ -0,0 +1,54 @@
+From 2f97e89e9e4e5797d0d973e1d05c1f44c46b4912 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 5 Jun 2015 20:21:38 -0700
+Subject: [PATCH] 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
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ 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 396c30c..50320ee 100644
+--- a/gdb/linux-nat.c
++++ b/gdb/linux-nat.c
+@@ -4856,10 +4856,10 @@ lin_thread_get_thread_signals (sigset_t *set)
+ fortunately they don't change! */
+
+ if (restart == 0)
+- restart = __SIGRTMIN;
++ restart = SIGRTMIN;
+
+ if (cancel == 0)
+- cancel = __SIGRTMIN + 1;
++ cancel = SIGRTMIN + 1;
+
+ sigaddset (set, restart);
+ sigaddset (set, cancel);
+diff --git a/gdb/nat/linux-nat.h b/gdb/nat/linux-nat.h
+index 83a6d91..efbe0fd 100644
+--- a/gdb/nat/linux-nat.h
++++ b/gdb/nat/linux-nat.h
+@@ -25,4 +25,8 @@
+ instead SIGTRAP with bit 7 set. */
+ #define SYSCALL_SIGTRAP (SIGTRAP | 0x80)
+
++#ifndef W_STOPCODE
++#define W_STOPCODE(sig) ((sig) << 8 | 0x7f)
++#endif
++
+ #endif /* LINUX_NAT_H */
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-include-sys-types.h-for-mode_t.patch b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-include-sys-types.h-for-mode_t.patch
new file mode 100644
index 000000000..a0292e416
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-include-sys-types.h-for-mode_t.patch
@@ -0,0 +1,30 @@
+From acbee4edacb80b5eeaff2480712fe98e56443997 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] 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 9a40867..aaecab9 100644
+--- a/gdb/gdbserver/target.h
++++ b/gdb/gdbserver/target.h
+@@ -27,6 +27,7 @@
+ #include "target/waitstatus.h"
+ #include "mem-break.h"
+ #include "btrace-common.h"
++#include <sys/types.h>
+
+ struct emit_ops;
+ struct buffer;
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-make-man-install-relative-to-DESTDIR.patch b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-make-man-install-relative-to-DESTDIR.patch
new file mode 100644
index 000000000..6996c183b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-make-man-install-relative-to-DESTDIR.patch
@@ -0,0 +1,28 @@
+From 12b0506951460c3cc37d775478d024db3f95e9d8 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 1/3] 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 d49a93b..2121c46 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.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-mips-linux-nat-Define-_ABIO32-if-not-defined.patch b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-mips-linux-nat-Define-_ABIO32-if-not-defined.patch
new file mode 100644
index 000000000..31739525a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-mips-linux-nat-Define-_ABIO32-if-not-defined.patch
@@ -0,0 +1,37 @@
+From e92f8932ef488de2a56db4299131ce6a4eb170bd 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] 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 fd5c705..753f29d 100644
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -46,6 +46,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;
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-use-asm-sgidefs.h.patch b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-use-asm-sgidefs.h.patch
new file mode 100644
index 000000000..eaec39030
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-use-asm-sgidefs.h.patch
@@ -0,0 +1,35 @@
+From 677b5b56135141c0d259e370aacd0e11c810aa15 Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Fri, 5 Feb 2016 14:00:00 -0800
+Subject: [PATCH] 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>
+---
+ 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 a36bb63..fd5c705 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 <sys/ptrace.h>
+ #include <asm/ptrace.h>
+
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0002-Change-order-of-CFLAGS.patch b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0002-Change-order-of-CFLAGS.patch
new file mode 100644
index 000000000..bccb45fda
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0002-Change-order-of-CFLAGS.patch
@@ -0,0 +1,34 @@
+From 262ccc4fdb2a3df0f16c61a807046964ae7729c9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 02:29:23 +0000
+Subject: [PATCH 2/3] 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 | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
+index 1ed2ec8..0cef95b 100644
+--- a/gdb/gdbserver/Makefile.in
++++ b/gdb/gdbserver/Makefile.in
+@@ -131,10 +131,10 @@ CFLAGS = @CFLAGS@
+ CPPFLAGS = @CPPFLAGS@
+
+ # INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
+-INTERNAL_CFLAGS_BASE = ${CFLAGS} ${GLOBAL_CFLAGS} \
++INTERNAL_CFLAGS_BASE = ${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) ${CFLAGS} -DGDBSERVER
+
+ # LDFLAGS is specifically reserved for setting from the command line
+ # when running make.
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0003-Add-support-for-Renesas-SH-sh4-architecture.patch b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0003-Add-support-for-Renesas-SH-sh4-architecture.patch
new file mode 100644
index 000000000..4a3e22c44
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0003-Add-support-for-Renesas-SH-sh4-architecture.patch
@@ -0,0 +1,921 @@
+From 407cb13cfb70697f45dfb761304e005e1ecbd0e9 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 3/3] 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 | 1 +
+ 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, 617 insertions(+), 29 deletions(-)
+
+diff --git a/gdb/Makefile.in b/gdb/Makefile.in
+index 7937801..63baf81 100644
+--- a/gdb/Makefile.in
++++ b/gdb/Makefile.in
+@@ -1707,6 +1707,7 @@ ALLDEPFILES = \
+ score-tdep.c \
+ ser-go32.c ser-pipe.c ser-tcp.c ser-mingw.c \
+ sh-tdep.c sh64-tdep.c shnbsd-tdep.c shnbsd-nat.c \
++ sh-linux-tdep.c sh-linux-nat.c \
+ sol2-tdep.c \
+ solib-svr4.c \
+ sparc-linux-nat.c sparc-linux-tdep.c \
+diff --git a/gdb/configure.host b/gdb/configure.host
+index d07be4b..b6391c5 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 2ff2ee8..1a11262 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 82cf2f4..b443e46 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"
+@@ -67,23 +71,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)
+ {
+@@ -1043,7 +1030,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;
+@@ -1093,7 +1080,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);
+
+@@ -1821,7 +1808,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;
+@@ -1848,7 +1835,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);
+@@ -1915,9 +1902,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);
+@@ -1931,7 +1918,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,
+@@ -2237,8 +2224,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)
+@@ -2254,6 +2241,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);
+@@ -2404,10 +2403,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 fc671a5..699f59f 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 8854af0..ef44682 100644
+--- a/gdb/testsuite/gdb.asm/asm-source.exp
++++ b/gdb/testsuite/gdb.asm/asm-source.exp
+@@ -113,6 +113,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 a4a5fc5..89efed7 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 424e1b8..0de2e7b 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 424e1b8..952aaf2 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 81f3b08..1574b2d 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 7566068..1205a9b 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.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/force-readline-static.patch b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/force-readline-static.patch
new file mode 100644
index 000000000..d34ee8cee
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/force-readline-static.patch
@@ -0,0 +1,37 @@
+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>
+
+diff --git a/Makefile.def b/Makefile.def
+index 4394188..05c661a 100644
+--- a/Makefile.def
++++ b/Makefile.def
+@@ -100,7 +100,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 61e0ab6..837f36e 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -24971,7 +24971,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
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb_7.10.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb_7.10.1.bb
new file mode 100644
index 000000000..f897e1213
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb_7.10.1.bb
@@ -0,0 +1,20 @@
+require gdb.inc
+require gdb-${PV}.inc
+
+inherit python-dir
+
+do_configure_prepend() {
+ if [ -n "${@bb.utils.contains('PACKAGECONFIG', 'python', 'python', '', d)}" ]; then
+ cat > ${WORKDIR}/python << EOF
+#!/bin/sh
+case "\$2" in
+ --includes) echo "-I${STAGING_INCDIR}/${PYTHON_DIR}/" ;;
+ --ldflags) echo "-Wl,-rpath-link,${STAGING_LIBDIR}/.. -Wl,-rpath,${libdir}/.. -lpthread -ldl -lutil -lm -lpython${PYTHON_BASEVERSION}" ;;
+ --exec-prefix) echo "${exec_prefix}" ;;
+ *) exit 1 ;;
+esac
+exit 0
+EOF
+ chmod +x ${WORKDIR}/python
+ fi
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/git/git.inc b/import-layers/yocto-poky/meta/recipes-devtools/git/git.inc
new file mode 100644
index 000000000..a1d0300be
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/git/git.inc
@@ -0,0 +1,127 @@
+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"
+
+EXTRA_OECONF = "--with-perl=${STAGING_BINDIR_NATIVE}/perl-native/perl \
+ --without-tcltk \
+"
+
+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 \
+ GIT_PYTHON_DIR=${D}${datadir}/git-core/python
+ 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", True).replace(' /',d.getVar('D', True) + '/')}
+
+ # ${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
+}
+
+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-relink \
+ ${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 \
+"
+
+# 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"
+
+PACKAGES =+ "${PN}-python"
+FILES_${PN}-python = "${libdir}/python*"
+
+
+# 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/"
+
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/git/git_2.7.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/git/git_2.7.4.bb
new file mode 100644
index 000000000..bc72793d4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/git/git_2.7.4.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] = "c64012d491e24c7d65cd389f75383d91"
+SRC_URI[tarball.sha256sum] = "7104c4f5d948a75b499a954524cb281fe30c6649d8abe20982936f75ec1f275b"
+SRC_URI[manpages.md5sum] = "58020dc13a5801c49f7986fef7027535"
+SRC_URI[manpages.sha256sum] = "0dfe1931ad302873470e0280248e3aa50502b5edd00dcc3e9c9173667b6fea6a"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config/config-guess-uclibc.patch b/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config/config-guess-uclibc.patch
new file mode 100644
index 000000000..2094116f0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config/config-guess-uclibc.patch
@@ -0,0 +1,170 @@
+Upstream-Status: Pending
+
+Patch courtesy gentoo-portage/sys-devel/gnuconfig/files/automake-1.8.5-config-guess-uclibc.patch.
+
+updated to 20050516 by Marcin 'Hrw' Juszkiewicz (by hand)
+updated to 20080123 by Nitin A Kamble (by hand)
+updated to 20111001 by Saul Wold (by hand)
+updated to 20120818 by Marcin 'Hrw' Juszkiewicz (by hand)
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
+
+---
+ config.guess | 67 +++++++++++++++++++++++++++++++++++------------------------
+ 1 file changed, 40 insertions(+), 27 deletions(-)
+
+--- git.orig/config.guess
++++ git/config.guess
+@@ -138,6 +138,19 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` |
+ UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
++# Detect uclibc systems.
++
++LIBC="gnu"
++if [ -f /usr/include/bits/uClibc_config.h ]
++then
++ LIBC=uclibc
++ if [ -n `grep "#define __UCLIBC_CONFIG_VERSION__" /usr/include/bits/uClibc_config.h` ]
++ then
++ UCLIBC_SUBVER=`sed -n "/#define __UCLIBC_CONFIG_VERSION__ /s///p" /usr/include/bits/uClibc_config.h`
++ LIBC=$LIBC$UCLIBC_SUBVER
++ fi
++fi
++
+ # Note: order is significant - the case branches are not exclusive.
+
+ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+@@ -886,15 +899,15 @@ EOF
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep -q ld.so.1
+- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
++ if test "$?" = 0 ; then LIBC="gnulibc1" ; else LIBC="" ; fi
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ arm*:Linux:*:*)
+ eval $set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ else
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+@@ -906,19 +919,19 @@ EOF
+ fi
+ exit ;;
+ avr32*:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ cris:Linux:*:*)
+- echo ${UNAME_MACHINE}-axis-linux-gnu
++ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ exit ;;
+ crisv32:Linux:*:*)
+- echo ${UNAME_MACHINE}-axis-linux-gnu
++ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ exit ;;
+ frv:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ hexagon:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ i*86:Linux:*:*)
+ LIBC=gnu
+@@ -932,13 +945,13 @@ EOF
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ exit ;;
+ ia64:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ m32r*:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ m68*:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ mips:Linux:*:* | mips64:Linux:*:*)
+ eval $set_cc_for_build
+@@ -957,54 +970,54 @@ EOF
+ #endif
+ EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
++ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+ ;;
+ or32:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ padre:Linux:*:*)
+- echo sparc-unknown-linux-gnu
++ echo sparc-unknown-linux-${LIBC}
+ exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+- echo hppa64-unknown-linux-gnu
++ echo hppa64-unknown-linux-${LIBC}
+ exit ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+- PA7*) echo hppa1.1-unknown-linux-gnu ;;
+- PA8*) echo hppa2.0-unknown-linux-gnu ;;
+- *) echo hppa-unknown-linux-gnu ;;
++ PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
++ PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
++ *) echo hppa-unknown-linux-${LIBC} ;;
+ esac
+ exit ;;
+ ppc64:Linux:*:*)
+- echo powerpc64-unknown-linux-gnu
++ echo powerpc64-unknown-linux-${LIBC}
+ exit ;;
+ ppc:Linux:*:*)
+- echo powerpc-unknown-linux-gnu
++ echo powerpc-unknown-linux-${LIBC}
+ exit ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux
+ exit ;;
+ sh64*:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ sh*:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ tile*:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ vax:Linux:*:*)
+- echo ${UNAME_MACHINE}-dec-linux-gnu
++ echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+ exit ;;
+ x86_64:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ xtensa*:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config/gnu-configize.in b/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config/gnu-configize.in
new file mode 100755
index 000000000..d4908fc4f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config/musl-support.patch b/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config/musl-support.patch
new file mode 100644
index 000000000..3147435a6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config/uclibc.patch b/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config/uclibc.patch
new file mode 100644
index 000000000..75fe10082
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config/uclibc.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Pending
+
+--- config.sub.orig 2004-05-14 19:38:36.000000000 -0500
++++ config.sub 2004-05-14 19:39:17.000000000 -0500
+@@ -118,7 +118,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | kfreebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
++ nto-qnx* | linux-gnu* | linux-uclibc* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+@@ -1135,7 +1135,8 @@
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
++ | -mingw32* | -linux-gnu* | -linux-uclibc* \
++ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config_20120814.bb b/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config_20120814.bb
new file mode 100644
index 000000000..0d05e79fd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config_20120814.bb
@@ -0,0 +1,41 @@
+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://config-guess-uclibc.patch \
+ 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/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config_git.bb
new file mode 100644
index 000000000..072726f60
--- /dev/null
+++ b/import-layers/yocto-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.sv.gnu.org/config.git \
+ file://gnu-configize.in"
+
+S = "${WORKDIR}/git"
+
+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/import-layers/yocto-poky/meta/recipes-devtools/guile/files/0001-libguile-Check-for-strtol_l-during-configure.patch b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/0001-libguile-Check-for-strtol_l-during-configure.patch
new file mode 100644
index 000000000..24f073f9f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/0001-libguile-Check-for-strtol_l-during-configure.patch
@@ -0,0 +1,56 @@
+From 814d6fb6c1f4a544c8fd37f5a390ba020c2d8c85 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 10 Jan 2016 22:28:17 +0000
+Subject: [PATCH] libguile: Check for strtol_l during configure
+
+strtol_l is a gnu extention which may not be available on other linux
+libc implementations e.g. musl. Therefore check for this funciton and
+conditionalize the use of it.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ configure.ac | 5 +++--
+ libguile/i18n.c | 2 +-
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 3969929..f8a6a1a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -752,7 +752,8 @@ AC_CHECK_HEADERS([assert.h crt_externs.h])
+ # truncate - not in mingw
+ # isblank - available as a GNU extension or in C99
+ # _NSGetEnviron - Darwin specific
+-# strcoll_l, newlocale - GNU extensions (glibc), also available on Darwin
++# strcoll_l, newlocale, strtol_l - GNU extensions (glibc),
++# also available on Darwin
+ # fork - unavailable on Windows
+ # utimensat - posix.1-2008
+ # sched_getaffinity, sched_setaffinity - GNU extensions (glibc)
+@@ -768,7 +769,7 @@ AC_CHECK_FUNCS([DINFINITY DQNAN cexp chsize clog clog10 ctermid \
+ getgrent kill getppid getpgrp fork setitimer getitimer strchr strcmp \
+ index bcopy memcpy rindex truncate unsetenv isblank _NSGetEnviron \
+ strcoll strcoll_l newlocale utimensat sched_getaffinity \
+- sched_setaffinity sendfile])
++ sched_setaffinity sendfile strtol_l])
+
+ AM_CONDITIONAL([BUILD_ICE_9_POPEN],
+ [test "x$enable_posix" = "xyes" && test "x$ac_cv_func_fork" = "xyes"])
+diff --git a/libguile/i18n.c b/libguile/i18n.c
+index 97d44b0..9fb6976 100644
+--- a/libguile/i18n.c
++++ b/libguile/i18n.c
+@@ -1352,7 +1352,7 @@ SCM_DEFINE (scm_locale_string_to_integer, "locale-string->integer",
+
+ if (c_locale != NULL)
+ {
+-#ifdef USE_GNU_LOCALE_API
++#if defined(USE_GNU_LOCALE_API) && defined(HAVE_STRTOL_L)
+ c_result = strtol_l (c_str, &c_endptr, c_base, c_locale);
+ #else
+ RUN_IN_LOCALE_SECTION (c_locale,
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guile/files/0002-Recognize-nios2-as-compilation-target.patch b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/0002-Recognize-nios2-as-compilation-target.patch
new file mode 100644
index 000000000..519585b8e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/0002-Recognize-nios2-as-compilation-target.patch
@@ -0,0 +1,36 @@
+From 76155065c70b5ab65c6c805423183b360141db84 Mon Sep 17 00:00:00 2001
+From: Marek Vasut <marex@denx.de>
+Date: Thu, 28 Jan 2016 04:46:23 +0100
+Subject: [PATCH] Recognize nios2 as compilation target
+
+Signed-off-by: Marek Vasut <marex@denx.de>
+Upstream-Status: Submitted [ http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22480 ]
+---
+ module/system/base/target.scm | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/module/system/base/target.scm b/module/system/base/target.scm
+index d60a8e0..d1f6cff 100644
+--- a/module/system/base/target.scm
++++ b/module/system/base/target.scm
+@@ -65,7 +65,7 @@
+ (cond ((string-match "^i[0-9]86$" cpu)
+ (endianness little))
+ ((member cpu '("x86_64" "ia64"
+- "powerpcle" "powerpc64le" "mipsel" "mips64el"))
++ "powerpcle" "powerpc64le" "mipsel" "mips64el" "nios2"))
+ (endianness little))
+ ((member cpu '("sparc" "sparc64" "powerpc" "powerpc64" "spu"
+ "mips" "mips64"))
+@@ -100,7 +100,7 @@
+
+ ((string-match "64$" cpu) 8)
+ ((string-match "64[lbe][lbe]$" cpu) 8)
+- ((member cpu '("sparc" "powerpc" "mips" "mipsel")) 4)
++ ((member cpu '("sparc" "powerpc" "mips" "mipsel" "nios2")) 4)
+ ((string-match "^arm.*" cpu) 4)
+ (else (error "unknown CPU word size" cpu)))))
+
+--
+2.7.0.rc3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guile/files/arm_aarch64.patch b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/arm_aarch64.patch
new file mode 100644
index 000000000..f1788b62f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/arm_aarch64.patch
@@ -0,0 +1,19 @@
+guile: add aarch64 recognition
+
+Assume little-endian.
+
+Upstream-Status: Pending
+
+Signed-off-by: joe.slater@windriver.com
+
+--- a/module/system/base/target.scm
++++ b/module/system/base/target.scm
+@@ -70,6 +70,8 @@
+ ((member cpu '("sparc" "sparc64" "powerpc" "powerpc64" "spu"
+ "mips" "mips64"))
+ (endianness big))
++ ((string-match "^aarch64" cpu)
++ (endianness little))
+ ((string-match "^arm.*eb" cpu)
+ (endianness big))
+ ((string-match "^arm.*" cpu)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guile/files/arm_endianness.patch b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/arm_endianness.patch
new file mode 100644
index 000000000..ea4328b81
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/arm_endianness.patch
@@ -0,0 +1,23 @@
+Support form ARM endianness
+
+Fixes Yocto bug# 2729
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+
+Index: guile-2.0.5/module/system/base/target.scm
+===================================================================
+--- guile-2.0.5.orig/module/system/base/target.scm 2012-01-24 03:06:06.000000000 -0800
++++ guile-2.0.5/module/system/base/target.scm 2012-07-12 13:05:44.372364103 -0700
+@@ -70,7 +70,9 @@
+ ((member cpu '("sparc" "sparc64" "powerpc" "powerpc64" "spu"
+ "mips" "mips64"))
+ (endianness big))
+- ((string-match "^arm.*el" cpu)
++ ((string-match "^arm.*eb" cpu)
++ (endianness big))
++ ((string-match "^arm.*" cpu)
+ (endianness little))
+ (else
+ (error "unknown CPU endianness" cpu)))))
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guile/files/debian/0002-Mark-Unused-modules-are-removed-gc-test-as-unresolve.patch b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/debian/0002-Mark-Unused-modules-are-removed-gc-test-as-unresolve.patch
new file mode 100644
index 000000000..43238a7d2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/debian/0002-Mark-Unused-modules-are-removed-gc-test-as-unresolve.patch
@@ -0,0 +1,39 @@
+Upstream-Status: Inappropriate [debian patch]
+
+Signed-Off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+
+From e52bfcdbaca5dce498678d8f512381e3e39a4066 Mon Sep 17 00:00:00 2001
+From: Rob Browning <rlb@defaultvalue.org>
+Date: Sun, 18 Mar 2012 11:40:55 -0500
+Subject: Mark "Unused modules are removed" gc test as unresolved.
+
+As per discussion with upstream, mark this test as unresolved since it
+may produce false negatives, depending on the behavior/timing of the
+garbage collector.
+---
+ test-suite/tests/gc.test | 11 ++++++-----
+ 1 files changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/test-suite/tests/gc.test b/test-suite/tests/gc.test
+index a969752..8c8e13e 100644
+--- a/test-suite/tests/gc.test
++++ b/test-suite/tests/gc.test
+@@ -84,11 +84,13 @@
+ ;; one gc round. not sure why.
+
+ (maybe-gc-flakiness
+- (= (let lp ((i 0))
+- (if (guard)
+- (lp (1+ i))
+- i))
+- total))))
++ (or (= (let lp ((i 0))
++ (if (guard)
++ (lp (1+ i))
++ i))
++ total)
++ (throw 'unresolved)))))
++
+
+ (pass-if "Lexical vars are collectable"
+ (let ((l (compile
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guile/files/debian/0003-Mark-mutex-with-owner-not-retained-threads-test-as-u.patch b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/debian/0003-Mark-mutex-with-owner-not-retained-threads-test-as-u.patch
new file mode 100644
index 000000000..34be3b96e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/debian/0003-Mark-mutex-with-owner-not-retained-threads-test-as-u.patch
@@ -0,0 +1,33 @@
+Upstream-Status: Inappropriate [debian patch]
+
+Signed-Off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+
+From 848543091d55dddb54a85612155964506d712852 Mon Sep 17 00:00:00 2001
+From: Rob Browning <rlb@defaultvalue.org>
+Date: Sun, 18 Mar 2012 13:28:24 -0500
+Subject: Mark "mutex with owner not retained" threads test as unresolved.
+
+As per discussion with upstream, mark this test as unresolved since it
+may produce false negatives, depending on the behavior/timing of the
+garbage collector.
+---
+ test-suite/tests/threads.test | 6 ++++--
+ 1 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/test-suite/tests/threads.test b/test-suite/tests/threads.test
+index 85a7c38..50899cb 100644
+--- a/test-suite/tests/threads.test
++++ b/test-suite/tests/threads.test
+@@ -414,8 +414,10 @@
+
+ (gc) (gc)
+ (let ((m (g)))
+- (and (mutex? m)
+- (eq? (mutex-owner m) (current-thread)))))))
++ (or
++ (and (mutex? m)
++ (eq? (mutex-owner m) (current-thread)))
++ (throw 'unresolved))))))
+
+ ;;
+ ;; mutex lock levels
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guile/files/guile_2.0.6_fix_sed_error.patch b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/guile_2.0.6_fix_sed_error.patch
new file mode 100644
index 000000000..e5dc22637
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/guile_2.0.6_fix_sed_error.patch
@@ -0,0 +1,24 @@
+Upstream-Status: Pending
+
+This fixes sed issue when prefix has / in it, like /usr/local
+
+autoreconf error avoided:
+| sed: -e expression #1, char 9: unknown option to `s'
+| configure.ac:39: error: AC_INIT should be called with package and version arguments
+
+Signed-Off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/01
+
+Index: guile-2.0.5/build-aux/git-version-gen
+===================================================================
+--- guile-2.0.5.orig/build-aux/git-version-gen
++++ guile-2.0.5/build-aux/git-version-gen
+@@ -187,7 +187,7 @@ else
+ v=UNKNOWN
+ fi
+
+-v=`echo "$v" |sed "s/^$prefix//"`
++v=`echo "$v" |sed "s#^$prefix##"`
+
+ # Test whether to append the "-dirty" suffix only if the version
+ # string we're using came from git. I.e., skip the test if it's "UNKNOWN"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guile/files/libguile-Makefile.am-hook.patch b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/libguile-Makefile.am-hook.patch
new file mode 100644
index 000000000..290b9d447
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/libguile-Makefile.am-hook.patch
@@ -0,0 +1,42 @@
+From 9c4e120a7a87db34d22a50883a5a525170b480d7 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Tue, 6 Jan 2015 23:10:51 -0800
+Subject: [PATCH] libguile/Makefile.am: install-data-hook -> install-exec-hook
+
+It may install such a file:
+/usr/lib64/libguile-2.0*-gdb.scm
+
+This is because when there is no file in the directory:
+for f in libguile-2.0*; do
+ [snip]
+done
+
+The f would be libguile-2.0* itself, use install-exec-hook will fix the
+problem since it depends on install-libLTLIBRARIES.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ libguile/Makefile.am | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/libguile/Makefile.am b/libguile/Makefile.am
+index 5decd99..52645b7 100644
+--- a/libguile/Makefile.am
++++ b/libguile/Makefile.am
+@@ -446,10 +446,8 @@ EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES = _scm.h \
+ ## delete guile-snarf.awk from the installation bindir, in case it's
+ ## lingering there due to an earlier guile version not having been
+ ## wiped out.
+-install-exec-hook:
++install-exec-hook: libguile-2.0-gdb.scm
+ rm -f $(DESTDIR)$(bindir)/guile-snarf.awk
+-
+-install-data-hook: libguile-2.0-gdb.scm
+ @$(MKDIR_P) $(DESTDIR)$(libdir)
+ ## We want to install libguile-2.0-gdb.scm as SOMETHING-gdb.scm.
+ ## SOMETHING is the full name of the final library. We want to ignore
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guile/files/libguile-VM-ASM_MUL-for-ARM-Add-earlyclobber.patch b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/libguile-VM-ASM_MUL-for-ARM-Add-earlyclobber.patch
new file mode 100644
index 000000000..e50059a7e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/libguile-VM-ASM_MUL-for-ARM-Add-earlyclobber.patch
@@ -0,0 +1,43 @@
+From a85c78ea1393985fdb6e6678dea19135c553d341 Mon Sep 17 00:00:00 2001
+From: Mark H Weaver <mhw@netris.org>
+Date: Fri, 19 Sep 2014 21:18:09 -0400
+Subject: [PATCH] VM: ASM_MUL for ARM: Add earlyclobber constraint to the SMULL
+ outputs.
+
+Reported by Rob Browning <rlb@defaultvalue.org>.
+
+* libguile/vm-i-scheme.c (ASM_MUL)[ARM]: Add earlyclobber (&) constraint
+ to the SMULL output registers.
+
+Author: Mark H Weaver <mhw@netris.org>
+
+Upstream-Status: Backport
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ libguile/vm-i-scheme.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/libguile/vm-i-scheme.c b/libguile/vm-i-scheme.c
+index 587aa95..162efab 100644
+--- a/libguile/vm-i-scheme.c
++++ b/libguile/vm-i-scheme.c
+@@ -1,5 +1,4 @@
+-/* Copyright (C) 2001, 2009, 2010, 2011, 2012, 2013,
+- * 2014 Free Software Foundation, Inc.
++/* Copyright (C) 2001, 2009-2014 Free Software Foundation, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+@@ -363,7 +362,7 @@ VM_DEFINE_FUNCTION (149, ge, "ge?", 2)
+ { \
+ scm_t_signed_bits rlo, rhi; \
+ asm ("smull %0, %1, %2, %3\n" \
+- : "=r" (rlo), "=r" (rhi) \
++ : "=&r" (rlo), "=&r" (rhi) \
+ : "r" (SCM_UNPACK (x) - scm_tc2_int), \
+ "r" (SCM_I_INUM (y))); \
+ if (SCM_LIKELY (SCM_SRS (rlo, 31) == rhi)) \
+--
+2.3.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guile/files/opensuse/guile-64bit.patch b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/opensuse/guile-64bit.patch
new file mode 100644
index 000000000..d3e312f77
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/opensuse/guile-64bit.patch
@@ -0,0 +1,39 @@
+Upstream-Status: Inappropriate [opensuse patch]
+
+Signed-Off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+
+Index: guile-2.0.3/libguile/hash.c
+===================================================================
+--- guile-2.0.3.orig/libguile/hash.c 2011-07-06 15:49:59.000000000 -0700
++++ guile-2.0.3/libguile/hash.c 2012-01-13 21:49:43.332844884 -0800
+@@ -270,7 +270,7 @@ scm_hasher(SCM obj, unsigned long n, siz
+ unsigned long
+ scm_ihashq (SCM obj, unsigned long n)
+ {
+- return (SCM_UNPACK (obj) >> 1) % n;
++ return ((unsigned long) SCM_UNPACK (obj) >> 1) % n;
+ }
+
+
+@@ -306,7 +306,7 @@ scm_ihashv (SCM obj, unsigned long n)
+ if (SCM_NUMP(obj))
+ return (unsigned long) scm_hasher(obj, n, 10);
+ else
+- return SCM_UNPACK (obj) % n;
++ return (unsigned long) SCM_UNPACK (obj) % n;
+ }
+
+
+Index: guile-2.0.3/libguile/struct.c
+===================================================================
+--- guile-2.0.3.orig/libguile/struct.c 2011-07-06 15:50:00.000000000 -0700
++++ guile-2.0.3/libguile/struct.c 2012-01-13 21:49:43.332844884 -0800
+@@ -942,7 +942,7 @@ scm_struct_ihashq (SCM obj, unsigned lon
+ {
+ /* The length of the hash table should be a relative prime it's not
+ necessary to shift down the address. */
+- return SCM_UNPACK (obj) % n;
++ return (unsigned long) SCM_UNPACK (obj) % n;
+ }
+
+ SCM_DEFINE (scm_struct_vtable_name, "struct-vtable-name", 1, 0, 0,
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guile/files/opensuse/guile-turn-off-gc-test.patch b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/opensuse/guile-turn-off-gc-test.patch
new file mode 100644
index 000000000..e20148628
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/opensuse/guile-turn-off-gc-test.patch
@@ -0,0 +1,49 @@
+Upstream-Status: Inappropriate [opensuse patch]
+
+Signed-Off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+
+See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10096
+why this test is turned off.
+Index: guile-2.0.3/test-suite/tests/gc.test
+===================================================================
+--- guile-2.0.3.orig/test-suite/tests/gc.test 2011-10-15 09:34:40.000000000 -0700
++++ guile-2.0.3/test-suite/tests/gc.test 2012-01-13 21:52:10.282540355 -0800
+@@ -65,23 +65,23 @@
+ foo)))
+
+
+-(with-test-prefix "gc"
+- (pass-if "Unused modules are removed"
+- (let* ((guard (make-guardian))
+- (total 1000))
+-
+- (for-each (lambda (x) (guard (make-module))) (iota total))
++;;(with-test-prefix "gc"
++;; (pass-if "Unused modules are removed"
++;; (let* ((guard (make-guardian))
++;; (total 1000))
++;;
++;; (for-each (lambda (x) (guard (make-module))) (iota total))
+
+ ;; Avoid false references to the modules on the stack.
+- (stack-cleanup 20)
++;; (stack-cleanup 20)
+
+- (gc)
+- (gc) ;; twice: have to kill the weak vectors.
+- (gc) ;; thrice: because the test doesn't succeed with only
++;; (gc)
++;; (gc) ;; twice: have to kill the weak vectors.
++;; (gc) ;; thrice: because the test doesn't succeed with only
+ ;; one gc round. not sure why.
+
+- (= (let lp ((i 0))
+- (if (guard)
+- (lp (1+ i))
+- i))
+- total))))
++;; (= (let lp ((i 0))
++;; (if (guard)
++;; (lp (1+ i))
++;; i))
++;; total))))
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guile/files/remove_strcase_l_funcs.patch b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/remove_strcase_l_funcs.patch
new file mode 100644
index 000000000..e7a06fef1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/remove_strcase_l_funcs.patch
@@ -0,0 +1,38 @@
+These unused functions cause build failures with uclibc since they reference __uclibc_locale_struct
+and this is exposed by uclibc API headers only if C locales are built, but for OE we build full locale
+support
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: guile-2.0.11/libguile/i18n.c
+===================================================================
+--- guile-2.0.11.orig/libguile/i18n.c
++++ guile-2.0.11/libguile/i18n.c
+@@ -851,27 +851,6 @@ str_downcase (register char *dst, regist
+ *dst = '\0';
+ }
+
+-#ifdef USE_GNU_LOCALE_API
+-static inline void
+-str_upcase_l (register char *dst, register const char *src,
+- scm_t_locale locale)
+-{
+- for (; *src != '\0'; src++, dst++)
+- *dst = toupper_l (*src, locale);
+- *dst = '\0';
+-}
+-
+-static inline void
+-str_downcase_l (register char *dst, register const char *src,
+- scm_t_locale locale)
+-{
+- for (; *src != '\0'; src++, dst++)
+- *dst = tolower_l (*src, locale);
+- *dst = '\0';
+-}
+-#endif
+-
+-
+ SCM_DEFINE (scm_string_locale_lt, "string-locale<?", 2, 1, 0,
+ (SCM s1, SCM s2, SCM locale),
+ "Compare strings @var{s1} and @var{s2} in a locale-dependent way."
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guile/files/workaround-ice-ssa-corruption.patch b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/workaround-ice-ssa-corruption.patch
new file mode 100644
index 000000000..6c348384a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/workaround-ice-ssa-corruption.patch
@@ -0,0 +1,60 @@
+libguile/vm-i-system.c: workaround ice ssa corruption while compiling with option -g -O
+
+While compiling with option -g -O, there was a ssa corruption:
+..
+Unable to coalesce ssa_names 48 and 3476 which are marked as MUST COALESCE.
+sp_48(ab) and sp_3476(ab)
+guile-2.0.11/libguile/vm-engine.c: In function 'vm_debug_engine':
+guile-2.0.11/libguile/vm.c:673:19: internal compiler error: SSA corruption
+ #define VM_NAME vm_debug_engine
+ ^
+guile-2.0.11/libguile/vm-engine.c:39:1: note: in expansion of macro 'VM_NAME'
+ VM_NAME (SCM vm, SCM program, SCM *argv, int nargs)
+ ^
+Please submit a full bug report,
+with preprocessed source if appropriate.
+See <http://gcc.gnu.org/bugs.html> for instructions.
+...
+
+Tweak libguile/vm-i-system.c to add boundary value check to workaround it.
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ libguile/vm-i-system.c | 20 ++++++++++++++++----
+ 1 file changed, 16 insertions(+), 4 deletions(-)
+
+diff --git a/libguile/vm-i-system.c b/libguile/vm-i-system.c
+--- a/libguile/vm-i-system.c
++++ b/libguile/vm-i-system.c
+@@ -625,10 +625,22 @@ VM_DEFINE_INSTRUCTION (47, bind_optionals_shuffle, "bind-optionals/shuffle", 6,
+ /* now shuffle up, from walk to ntotal */
+ {
+ scm_t_ptrdiff nshuf = sp - walk + 1, i;
+- sp = (fp - 1) + ntotal + nshuf;
+- CHECK_OVERFLOW ();
+- for (i = 0; i < nshuf; i++)
+- sp[-i] = walk[nshuf-i-1];
++ /* check the value of nshuf to workaround ice ssa corruption */
++ /* while compiling with -O -g */
++ if (nshuf > 0)
++ {
++ sp = (fp - 1) + ntotal + nshuf;
++ CHECK_OVERFLOW ();
++ for (i = 0; i < nshuf; i++)
++ sp[-i] = walk[nshuf-i-1];
++ }
++ else
++ {
++ sp = (fp - 1) + ntotal + nshuf;
++ CHECK_OVERFLOW ();
++ for (i = 0; i < nshuf; i++)
++ sp[-i] = walk[nshuf-i-1];
++ }
+ }
+ /* and fill optionals & keyword args with SCM_UNDEFINED */
+ while (walk <= (fp - 1) + ntotal)
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guile/guile_2.0.11.bb b/import-layers/yocto-poky/meta/recipes-devtools/guile/guile_2.0.11.bb
new file mode 100644
index 000000000..6cefe6649
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guile/guile_2.0.11.bb
@@ -0,0 +1,128 @@
+SUMMARY = "Guile is the GNU Ubiquitous Intelligent Language for Extensions"
+DESCRIPTION = "Guile is the GNU Ubiquitous Intelligent Language for Extensions,\
+ the official extension language for the GNU operating system.\
+ Guile is a library designed to help programmers create flexible applications.\
+ Using Guile in an application allows the application's functionality to be\
+ extended by users or other programmers with plug-ins, modules, or scripts.\
+ Guile provides what might be described as 'practical software freedom,'\
+ making it possible for users to customize an application to meet their\
+ needs without digging into the application's internals."
+
+HOMEPAGE = "http://www.gnu.org/software/guile/"
+SECTION = "devel"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI = "${GNU_MIRROR}/guile/guile-${PV}.tar.xz \
+ file://debian/0002-Mark-Unused-modules-are-removed-gc-test-as-unresolve.patch \
+ file://debian/0003-Mark-mutex-with-owner-not-retained-threads-test-as-u.patch \
+ file://opensuse/guile-64bit.patch \
+ file://guile_2.0.6_fix_sed_error.patch \
+ file://arm_endianness.patch \
+ file://arm_aarch64.patch \
+ file://workaround-ice-ssa-corruption.patch \
+ file://libguile-Makefile.am-hook.patch \
+ file://libguile-VM-ASM_MUL-for-ARM-Add-earlyclobber.patch \
+ file://remove_strcase_l_funcs.patch \
+ file://0001-libguile-Check-for-strtol_l-during-configure.patch \
+ file://0002-Recognize-nios2-as-compilation-target.patch \
+ "
+
+# file://debian/0001-Change-guile-to-guile-X.Y-for-info-pages.patch
+# file://opensuse/guile-turn-off-gc-test.patch
+
+SRC_URI[md5sum] = "03f1bce1a4983076d955003472306a13"
+SRC_URI[sha256sum] = "aed0a4a6db4e310cbdfeb3613fa6f86fddc91ef624c1e3f8937a6304c69103e2"
+
+
+inherit autotools gettext pkgconfig texinfo
+BBCLASSEXTEND = "native"
+
+DEPENDS = "libunistring bdwgc gmp libtool libffi ncurses readline"
+# add guile-native only to the target recipe's DEPENDS
+DEPENDS_append_class-target = " guile-native libatomic-ops"
+
+# The comment of the script guile-config said it has been deprecated but we should
+# at least add the required dependency to make it work since we still provide the script.
+RDEPENDS_${PN} = "pkgconfig"
+
+RDEPENDS_${PN}_append_libc-glibc_class-target = " glibc-gconv-iso8859-1"
+
+EXTRA_OECONF += "${@['--without-libltdl-prefix --without-libgmp-prefix --without-libreadline-prefix', ''][bb.data.inherits_class('native',d)]}"
+
+EXTRA_OECONF_append_class-target = " --with-libunistring-prefix=${STAGING_LIBDIR} \
+ --with-libgmp-prefix=${STAGING_LIBDIR} \
+ --with-libltdl-prefix=${STAGING_LIBDIR}"
+EXTRA_OECONF_append_libc-uclibc = " guile_cv_use_csqrt=no "
+
+CFLAGS_append_libc-musl = " -DHAVE_GC_SET_FINALIZER_NOTIFIER \
+ -DHAVE_GC_GET_HEAP_USAGE_SAFE \
+ -DHAVE_GC_GET_FREE_SPACE_DIVISOR \
+ -DHAVE_GC_SET_FINALIZE_ON_DEMAND \
+ "
+
+do_configure_prepend() {
+ mkdir -p po
+}
+
+export GUILE_FOR_BUILD="${BUILD_SYS}-guile"
+
+do_install_append_class-native() {
+ install -m 0755 ${D}${bindir}/guile ${D}${bindir}/${HOST_SYS}-guile
+
+ create_wrapper ${D}/${bindir}/guile \
+ GUILE_LOAD_PATH=${STAGING_DATADIR_NATIVE}/guile/2.0 \
+ GUILE_LOAD_COMPILED_PATH=${STAGING_LIBDIR_NATIVE}/guile/2.0/ccache
+ create_wrapper ${D}${bindir}/${HOST_SYS}-guile \
+ GUILE_LOAD_PATH=${STAGING_DATADIR_NATIVE}/guile/2.0 \
+ GUILE_LOAD_COMPILED_PATH=${STAGING_LIBDIR_NATIVE}/guile/2.0/ccache
+}
+
+do_install_append_class-target() {
+ # cleanup buildpaths in scripts
+ sed -i -e 's:${STAGING_DIR_NATIVE}::' ${D}${bindir}/guile-config
+ sed -i -e 's:${STAGING_DIR_HOST}::' ${D}${bindir}/guile-snarf
+
+ sed -i -e 's:${STAGING_DIR_TARGET}::g' ${D}${libdir}/pkgconfig/guile-2.0.pc
+}
+
+do_install_append_libc-musl() {
+ rm -f ${D}${libdir}/charset.alias
+}
+
+SYSROOT_PREPROCESS_FUNCS = "guile_cross_config"
+
+guile_cross_config() {
+ # this is only for target recipe
+ if [ "${PN}" = "guile" ]
+ then
+ # Create guile-config returning target values instead of native values
+ install -d ${SYSROOT_DESTDIR}${STAGING_BINDIR_CROSS}
+ echo '#!'`which ${BUILD_SYS}-guile`$' \\\n--no-auto-compile -e main -s\n!#\n(define %guile-build-info '\'\( \
+ > ${B}/guile-config.cross
+ sed -n -e 's:^[ \t]*{[ \t]*": (:' \
+ -e 's:",[ \t]*": . ":' \
+ -e 's:" *}, *\\:"):' \
+ -e 's:^.*cachedir.*$::' \
+ -e '/^ (/p' \
+ < ${B}/libguile/libpath.h >> ${B}/guile-config.cross
+ echo '))' >> ${B}/guile-config.cross
+ cat ${B}/meta/guile-config >> ${B}/guile-config.cross
+ install ${B}/guile-config.cross ${STAGING_BINDIR_CROSS}/guile-config
+ fi
+}
+
+# Guile needs the compiled files to be newer than the source, and it won't
+# auto-compile into the prefix even if it can write there, so touch them here as
+# sysroot is managed.
+SSTATEPOSTINSTFUNCS += "guile_sstate_postinst"
+guile_sstate_postinst() {
+ if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
+ then
+ find ${STAGING_DIR_TARGET}/${libdir}/guile/2.0/ccache -type f | xargs touch
+ fi
+}
+
+# http://errors.yoctoproject.org/Errors/Details/20491/
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guilt/files/guilt-bash.patch b/import-layers/yocto-poky/meta/recipes-devtools/guilt/files/guilt-bash.patch
new file mode 100644
index 000000000..70a439e81
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guilt/files/guilt-bash.patch
@@ -0,0 +1,288 @@
+guilt: explicitly call for bash
+
+Running complex guilt stacks of patches/commits can cause interesting
+failures after ~20m of processing, with errors like "Bad substitution".
+
+These have been traced back to having /bin/sh --> /bin/dash on Ubuntu
+systems. Putting a shell that actually *works* (such as /bin/bash)
+in as /bin/sh makes the problem go away. So here we change the guilt
+scripts to explicitly call for bash to ensure we don't have a similar
+issue after deployment.
+
+Upstream-Status: Inappropriate [oe-specific]
+
+Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
+
+---
+ guilt | 2 +-
+ guilt-add | 2 +-
+ guilt-applied | 2 +-
+ guilt-branch | 2 +-
+ guilt-delete | 2 +-
+ guilt-diff | 2 +-
+ guilt-export | 2 +-
+ guilt-files | 2 +-
+ guilt-fold | 2 +-
+ guilt-fork | 2 +-
+ guilt-graph | 2 +-
+ guilt-header | 2 +-
+ guilt-help | 2 +-
+ guilt-import | 2 +-
+ guilt-import-commit | 2 +-
+ guilt-init | 4 ++--
+ guilt-new | 2 +-
+ guilt-next | 2 +-
+ guilt-patchbomb | 2 +-
+ guilt-pop | 2 +-
+ guilt-prev | 2 +-
+ guilt-push | 2 +-
+ guilt-rebase | 2 +-
+ guilt-refresh | 2 +-
+ guilt-rm | 2 +-
+ guilt-series | 2 +-
+ guilt-status | 2 +-
+ guilt-top | 2 +-
+ guilt-unapplied | 2 +-
+ 29 files changed, 30 insertions(+), 30 deletions(-)
+
+--- a/guilt
++++ b/guilt
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006-2010
+ #
+--- a/guilt-add
++++ b/guilt-add
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
+--- a/guilt-applied
++++ b/guilt-applied
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
+--- a/guilt-branch
++++ b/guilt-branch
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2007-2008
+ #
+--- a/guilt-delete
++++ b/guilt-delete
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
+--- a/guilt-diff
++++ b/guilt-diff
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (C) 2007 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
+ #
+--- a/guilt-export
++++ b/guilt-export
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Pierre Habouzit, 2007
+ #
+--- a/guilt-files
++++ b/guilt-files
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (C) 2007 Yasushi SHOJI <yashi@atmark-techno.com>
+ #
+--- a/guilt-fold
++++ b/guilt-fold
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
+--- a/guilt-fork
++++ b/guilt-fork
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2007
+ #
+--- a/guilt-graph
++++ b/guilt-graph
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2007
+ #
+--- a/guilt-header
++++ b/guilt-header
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006-2010
+ #
+--- a/guilt-help
++++ b/guilt-help
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2007
+ #
+--- a/guilt-import
++++ b/guilt-import
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2007
+ #
+--- a/guilt-import-commit
++++ b/guilt-import-commit
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2007
+ #
+--- a/guilt-init
++++ b/guilt-init
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
+@@ -31,7 +31,7 @@ touch "$GUILT_DIR/$branch/status"
+
+ mkdir -p "$GIT_DIR/hooks/guilt"
+ cat > "$GIT_DIR/hooks/guilt/delete" <<EOF
+-#!/bin/sh
++#!/bin/bash
+ # Usage: <script> <patch being removed>
+
+ echo "Removing patch '\$1'..."
+--- a/guilt-new
++++ b/guilt-new
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
+--- a/guilt-next
++++ b/guilt-next
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
+--- a/guilt-patchbomb
++++ b/guilt-patchbomb
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2007
+ #
+--- a/guilt-pop
++++ b/guilt-pop
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
+--- a/guilt-prev
++++ b/guilt-prev
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
+--- a/guilt-push
++++ b/guilt-push
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
+--- a/guilt-rebase
++++ b/guilt-rebase
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2007
+ #
+--- a/guilt-refresh
++++ b/guilt-refresh
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
+--- a/guilt-rm
++++ b/guilt-rm
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
+--- a/guilt-series
++++ b/guilt-series
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
+--- a/guilt-status
++++ b/guilt-status
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
+--- a/guilt-top
++++ b/guilt-top
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
+--- a/guilt-unapplied
++++ b/guilt-unapplied
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guilt/guilt-native_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/guilt/guilt-native_git.bb
new file mode 100644
index 000000000..b63c68c4d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guilt/guilt-native_git.bb
@@ -0,0 +1,23 @@
+SUMMARY = "quilt-like tool for Git"
+LICENSE = "GPLv2"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=b6f3400dc1a01cebafe8a52b3f344135"
+
+inherit native
+
+SRC_URI = "git://repo.or.cz/guilt.git \
+ file://guilt-bash.patch \
+ "
+PV = "0.35+git${SRCPV}"
+SRCREV = "c2a5bae511c6d5354aa4e1cb59069c31df2b8eeb"
+
+S = "${WORKDIR}/git"
+
+# we don't compile, we just install
+do_compile() {
+ :
+}
+
+do_install() {
+ oe_runmake PREFIX=${D}/${prefix} install
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/help2man/help2man-native_1.47.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/help2man/help2man-native_1.47.3.bb
new file mode 100644
index 000000000..232b0c37a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/help2man/help2man-native_1.47.3.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] = "d1d44a7a7b2bd61755a2045d96ecaea0"
+SRC_URI[sha256sum] = "c232af6475ef65bee02770862a362f4c4c2e6c9967d39e987eb94cadcfc13856"
+
+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/import-layers/yocto-poky/meta/recipes-devtools/i2c-tools/files/Module.mk b/import-layers/yocto-poky/meta/recipes-devtools/i2c-tools/files/Module.mk
new file mode 100644
index 000000000..fcaf72f22
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/i2c-tools/files/Module.mk
@@ -0,0 +1,72 @@
+# EEPROMER
+#
+# Licensed under the GNU General Public License.
+
+EEPROMER_DIR := eepromer
+
+EEPROMER_CFLAGS := -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual \
+ -Wcast-align -Wwrite-strings -Wnested-externs -Winline \
+ -W -Wundef -Wmissing-prototypes -Iinclude
+
+EEPROMER_TARGETS := eepromer eeprom eeprog
+
+#
+# Programs
+#
+
+$(EEPROMER_DIR)/eepromer: $(EEPROMER_DIR)/eepromer.o
+ $(CC) $(LDFLAGS) -o $@ $^
+
+$(EEPROMER_DIR)/eeprom: $(EEPROMER_DIR)/eeprom.o
+ $(CC) $(LDFLAGS) -o $@ $^
+
+$(EEPROMER_DIR)/eeprog: $(EEPROMER_DIR)/eeprog.o $(EEPROMER_DIR)/24cXX.o
+ $(CC) $(LDFLAGS) -o $@ $^
+
+#
+# Objects
+#
+
+$(EEPROMER_DIR)/eepromer.o: $(EEPROMER_DIR)/eepromer.c
+ $(CC) $(CFLAGS) $(EEPROMER_CFLAGS) -c $< -o $@
+
+$(EEPROMER_DIR)/eeprom.o: $(EEPROMER_DIR)/eeprom.c
+ $(CC) $(CFLAGS) $(EEPROMER_CFLAGS) -c $< -o $@
+
+$(EEPROMER_DIR)/eeprog.o: $(EEPROMER_DIR)/eeprog.c
+ $(CC) $(CFLAGS) $(EEPROMER_CFLAGS) -c $< -o $@
+
+$(EEPROMER_DIR)/24cXX.o: $(EEPROMER_DIR)/24cXX.c
+ $(CC) $(CFLAGS) $(EEPROMER_CFLAGS) -c $< -o $@
+
+#
+# Commands
+#
+
+all-eepromer: $(addprefix $(EEPROMER_DIR)/,$(EEPROMER_TARGETS))
+
+strip-eepromer: $(addprefix $(EEPROMER_DIR)/,$(EEPROMER_TARGETS))
+ strip $(addprefix $(EEPROMER_DIR)/,$(EEPROMER_TARGETS))
+
+clean-eepromer:
+ $(RM) $(addprefix $(EEPROMER_DIR)/,*.o $(EEPROMER_TARGETS))
+
+install-eepromer: $(addprefix $(EEPROMER_DIR)/,$(EEPROMER_TARGETS))
+ $(INSTALL_DIR) $(DESTDIR)$(sbindir) $(DESTDIR)$(man8dir)
+ for program in $(EEPROMER_TARGETS) ; do \
+ $(INSTALL_PROGRAM) $(EEPROMER_DIR)/$$program $(DESTDIR)$(sbindir) ; done
+
+uninstall-eepromer:
+ for program in $(EEPROMER_TARGETS) ; do \
+ $(RM) $(DESTDIR)$(sbindir)/$$program ; \
+ $(RM) $(DESTDIR)$(man8dir)/$$program.8 ; done
+
+all: all-eepromer
+
+strip: strip-eepromer
+
+clean: clean-eepromer
+
+install: install-eepromer
+
+uninstall: uninstall-eepromer
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/i2c-tools/i2c-tools_3.1.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/i2c-tools/i2c-tools_3.1.2.bb
new file mode 100644
index 000000000..4d255423e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/i2c-tools/i2c-tools_3.1.2.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Set of i2c tools for linux"
+SECTION = "base"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+SRC_URI = "http://downloads.yoctoproject.org/mirror/sources/${BP}.tar.bz2 \
+ file://Module.mk \
+"
+SRC_URI[md5sum] = "7104a1043d11a5e2c7b131614eb1b962"
+SRC_URI[sha256sum] = "db5e69f2e2a6e3aa2ecdfe6a5f490b149c504468770f58921c8c5b8a7860a441"
+
+inherit autotools-brokensep
+
+do_compile_prepend() {
+ cp ${WORKDIR}/Module.mk ${S}/eepromer/
+ sed -i 's#/usr/local#/usr#' ${S}/Makefile
+ echo "include eepromer/Module.mk" >> ${S}/Makefile
+}
+
+do_install_append() {
+ install -d ${D}${includedir}/linux
+ install -m 0644 include/linux/i2c-dev.h ${D}${includedir}/linux/i2c-dev-user.h
+ rm -f ${D}${includedir}/linux/i2c-dev.h
+}
+
+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"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb
new file mode 100644
index 000000000..f8f4aef39
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/icecc-create-env/icecc-create-env-native_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"
+
+inherit native
+
+# 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}
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/icecc-create-env/icecc-create-env/icecc-create-env b/import-layers/yocto-poky/meta/recipes-devtools/icecc-create-env/icecc-create-env/icecc-create-env
new file mode 100755
index 000000000..7e4dbc414
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/icecc-create-env/icecc-create-env/icecc-create-env
@@ -0,0 +1,192 @@
+#! /usr/bin/env bash
+# icecc -- A simple distributed compiler system
+#
+# Copyright (C) 2004 by the Icecream Authors
+# GPL
+
+target_files=
+
+is_contained ()
+{
+ case " $target_files " in
+ *" $1 "* ) return 0 ;;
+ *"=$1 "* ) return 0;;
+ * ) return 1 ;;
+ esac
+}
+
+add_file ()
+{
+ local name="$1"
+ local path="$1";
+ if test -n "$2"; then
+ name="$2"
+ fi
+ test -z "$name" && return
+ # ls -H isn't really the same as readlink, but
+ # readlink is not portable enough.
+ path=`ls -H $path`
+ toadd="$name=$path"
+ is_contained "$toadd" && return
+ if test -z "$silent"; then
+ echo "adding file $toadd"
+ fi
+ target_files="$target_files $toadd"
+ if test -x "$path"; then
+ # Only call ldd when it makes sense
+ if file -L "$path" | grep 'ELF' > /dev/null 2>&1; then
+ if ! file -L "$path" | grep 'static' > /dev/null 2>&1; then
+ # 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 )
+ for lib in `ldd "$path" | sed -n 's,^[^/]*\(/[^ ]*\).*,\1,p'`; do
+ test -f "$lib" || continue
+ # Check wether 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_file "$lib"
+ done
+ fi
+ fi
+ fi
+}
+
+# backward compat
+if test "$1" = "--respect-path"; then
+ shift
+fi
+
+#add a --silent switch to avoid "broken pipe" errors when calling this scipt from within OE
+if test "$1" = "--silent"; then
+ silent=1
+ shift
+fi
+
+
+added_gcc=$1
+shift
+added_gxx=$1
+shift
+added_as=$1
+shift
+archive_name=$1
+
+if test -z "$added_gcc" || test -z "$added_gxx" ; then
+ echo "usage: $0 <gcc_path> <g++_path>"
+ exit 1
+fi
+
+if ! test -x "$added_gcc" ; then
+ echo "'$added_gcc' is no executable."
+ exit 1
+fi
+
+if ! test -x "$added_gxx" ; then
+ echo "'$added_gcc' is no 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
+ echo "'$added_as' is no 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="${ltofile%lto1}liblto_plugin.so"
+if test -r "$pluginfile"
+then
+ add_file $pluginfile ${pluginfile#*usr}
+ add_file $pluginfile /usr${pluginfile#*usr}
+fi
+
+tempdir=`mktemp -d /tmp/iceccenvXXXXXX`
+new_target_files=
+for i in $target_files; do
+ case $i in
+ *=/*)
+ target=`echo $i | cut -d= -f1`
+ path=`echo $i | cut -d= -f2`
+ ;;
+ *)
+ path=$i
+ target=$i
+ ;;
+ esac
+ mkdir -p $tempdir/`dirname $target`
+ cp -p $path $tempdir/$target
+ if test -f $tempdir/$target -a -x $tempdir/$target; then
+ strip -s $tempdir/$target 2>/dev/null
+ fi
+ target=`echo $target | cut -b2-`
+ new_target_files="$new_target_files $target"
+done
+
+#sort the files
+target_files=`for i in $new_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 || {
+ if test -z "$silent"; then
+ echo "Couldn't compute MD5 sum."
+ fi
+ 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
+
+if test -z "$silent"; then
+echo "creating $archive_name"
+fi
+
+cd $tempdir
+tar -czhf "$mydir/$archive_name" $target_files || {
+ if test -z "$silent"; then
+ echo "Couldn't create archive"
+ fi
+ exit 3
+}
+cd ..
+rm -rf $tempdir
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/icon-naming-utils/icon-naming-utils_0.8.90.bb b/import-layers/yocto-poky/meta/recipes-devtools/icon-naming-utils/icon-naming-utils_0.8.90.bb
new file mode 100644
index 000000000..6b356b0d4
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool.inc b/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool.inc
new file mode 100644
index 000000000..eb7ae004a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool.inc
@@ -0,0 +1,30 @@
+SUMMARY = "Utility scripts for internationalizing XML"
+SECTION = "devel"
+LICENSE = "GPLv2"
+
+URLV="${@'.'.join(d.getVar('PV',1).split('.')[0:2])}"
+SRC_URI = "http://launchpad.net/${BPN}/trunk/${PV}/+download/${BP}.tar.gz"
+
+UPSTREAM_CHECK_URI = "https://launchpad.net/intltool/trunk/"
+
+S = "${WORKDIR}/intltool-${PV}"
+
+DEPENDS = "libxml-parser-perl-native"
+RDEPENDS_${PN} = "gettext-dev libxml-parser-perl"
+DEPENDS_class-native = "libxml-parser-perl-native"
+# 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"
+
+inherit autotools pkgconfig perlnative
+
+export PERL = "${bindir}/env perl"
+PERL_class-native = "/usr/bin/env nativeperl"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/intltool-nowarn.patch b/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/intltool-nowarn.patch
new file mode 100644
index 000000000..06c938b7e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/noperlcheck.patch b/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/noperlcheck.patch
new file mode 100644
index 000000000..853ee1a43
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/perl-522-deprecations.patch b/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/perl-522-deprecations.patch
new file mode 100644
index 000000000..eb52172e1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/perl-522-deprecations.patch
@@ -0,0 +1,55 @@
+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>
+
+--- intltool-0.51.0-ORIG/intltool-update.in 2015-05-27 00:20:43.038379963 +0200
++++ intltool-0.51.0/intltool-update.in 2015-05-27 00:23:53.309078052 +0200
+@@ -1062,7 +1062,7 @@
+ }
+ }
+
+- if ($str =~ /^(.*)\${?([A-Z_]+)}?(.*)$/)
++ if ($str =~ /^(.*)\$\{?([A-Z_]+)\}?(.*)$/)
+ {
+ my $rest = $3;
+ my $untouched = $1;
+@@ -1190,10 +1190,10 @@
+ $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 @@
+ $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? \ No newline at end of file
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/remove-xml-check.patch b/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/remove-xml-check.patch
new file mode 100644
index 000000000..fc69e37b4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/remove-xml-check.patch
@@ -0,0 +1,33 @@
+Signed-off-by: Florin Sarbu <florin.sarbu@windriver.com>
+
+Upstream-Status: Inappropriate [OE specific]
+
+Index: intltool-0.40.6/intltool.m4
+===================================================================
+--- intltool-0.40.6.orig/intltool.m4 2009-02-14 14:12:28.000000000 -0800
++++ intltool-0.40.6/intltool.m4 2011-11-23 15:39:34.689561872 -0800
+@@ -122,14 +122,16 @@
+ 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
++
++# Disable this check since we know XML::Parser is installed
++#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/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/use-nativeperl.patch b/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/use-nativeperl.patch
new file mode 100644
index 000000000..5f5fed385
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/use-nativeperl.patch
@@ -0,0 +1,20 @@
+OE has perl binary as 'nativeperl' in native sysroot so we look for it
+in order to avoid intltool searching and finding perl from /usr/bin
+on build system which may not have all the modules that it needs.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [OE specific]
+Index: intltool-0.40.6/intltool.m4
+===================================================================
+--- intltool-0.40.6.orig/intltool.m4 2009-02-14 14:12:28.000000000 -0800
++++ intltool-0.40.6/intltool.m4 2011-08-09 08:07:16.427347846 -0700
+@@ -110,7 +110,7 @@
+ AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
+ fi
+
+-AC_PATH_PROG(INTLTOOL_PERL, perl)
++AC_PATH_PROG(INTLTOOL_PERL, nativeperl)
+ if test -z "$INTLTOOL_PERL"; then
+ AC_MSG_ERROR([perl not found])
+ fi
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool_0.51.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool_0.51.0.bb
new file mode 100644
index 000000000..d520d43c1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool_0.51.0.bb
@@ -0,0 +1,19 @@
+require intltool.inc
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+SRC_URI += "file://intltool-nowarn.patch \
+ file://perl-522-deprecations.patch \
+ ${NATIVEPATCHES} \
+ "
+
+#
+# All of the intltool scripts have the correct paths to perl already
+# embedded into them and can find perl fine, so we add the remove xml-check
+# in the intltool.m4 via the remove-xml-check.patch
+NATIVEPATCHES = "file://noperlcheck.patch \
+ file://remove-xml-check.patch"
+NATIVEPATCHES_class-native = "file://use-nativeperl.patch"
+
+SRC_URI[md5sum] = "12e517cac2b57a0121cda351570f1e63"
+SRC_URI[sha256sum] = "67c74d94196b153b774ab9f89b2fa6c6ba79352407037c8c14d5aeb334e959cd"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/json-c/json-c/0001-json_tokener-requires-INF-and-NAN.patch b/import-layers/yocto-poky/meta/recipes-devtools/json-c/json-c/0001-json_tokener-requires-INF-and-NAN.patch
new file mode 100644
index 000000000..d29d9118d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/json-c/json-c/0001-json_tokener-requires-INF-and-NAN.patch
@@ -0,0 +1,37 @@
+From 9be71700eb580c815688584a64621a38867c3fdd Mon Sep 17 00:00:00 2001
+From: James Myatt <james.myatt@tessella.com>
+Date: Thu, 5 Feb 2015 15:57:14 +0000
+Subject: [PATCH] json_tokener requires INF and NAN
+
+---
+Upstream-Status: Backport
+
+ json_tokener.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+Index: json-c-0.12/json_tokener.c
+===================================================================
+--- json-c-0.12.orig/json_tokener.c
++++ json-c-0.12/json_tokener.c
+@@ -16,6 +16,7 @@
+ #include "config.h"
+
+ #include <math.h>
++#include "math_compat.h"
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <stddef.h>
+@@ -352,12 +353,10 @@ struct json_object* json_tokener_parse_e
+
+ case json_tokener_state_inf: /* aka starts with 'i' */
+ {
+- int size;
+- int size_inf;
++ size_t size_inf;
+ int is_negative = 0;
+
+ printbuf_memappend_fast(tok->pb, &c, 1);
+- size = json_min(tok->st_pos+1, json_null_str_len);
+ size_inf = json_min(tok->st_pos+1, json_inf_str_len);
+ char *infbuf = tok->pb->buf;
+ if (*infbuf == '-')
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/json-c/json-c_0.12.bb b/import-layers/yocto-poky/meta/recipes-devtools/json-c/json-c_0.12.bb
new file mode 100644
index 000000000..1a5c3948e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/json-c/json-c_0.12.bb
@@ -0,0 +1,29 @@
+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 \
+ file://0001-json_tokener-requires-INF-and-NAN.patch \
+ "
+
+SRC_URI[md5sum] = "3ca4bbb881dfc4017e8021b5e0a8c491"
+SRC_URI[sha256sum] = "000c01b2b3f82dcb4261751eb71f1b084404fb7d6a282f06074d3c17078b9f3f"
+
+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.12"
+RECIPE_UPSTREAM_DATE = "Apr 11, 2014"
+CHECK_DATE = "Dec 04, 2015"
+
+RPROVIDES_${PN} = "libjson"
+
+inherit autotools
+
+do_configure_prepend() {
+ # Clean up autoconf cruft that should not be in the tarball
+ rm -f ${S}/config.status
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/kconfig-frontends/kconfig-frontends_3.12.0.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/kconfig-frontends/kconfig-frontends_3.12.0.0.bb
new file mode 100644
index 000000000..48a2f935b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/kconfig-frontends/kconfig-frontends_3.12.0.0.bb
@@ -0,0 +1,38 @@
+# Copyright (C) 2012 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "Linux kernel style configuration framework for other projects"
+DESCRIPTION = "The kconfig-frontends project aims at centralising \
+the effort of keeping an up-to-date, out-of-tree, packaging of the \
+kconfig infrastructure, ready for use by third-party projects. \
+The kconfig-frontends package provides the kconfig parser, as well as all \
+the frontends"
+HOMEPAGE = "http://ymorin.is-a-geek.org/projects/kconfig-frontends"
+LICENSE = "GPL-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=9b8cf60ff39767ff04b671fca8302408"
+SECTION = "devel"
+DEPENDS += "ncurses flex bison gperf-native pkgconfig-native"
+RDEPENDS_${PN} += "python bash"
+SRC_URI = "http://ymorin.is-a-geek.org/download/${BPN}/${BP}.tar.xz"
+
+SRC_URI[md5sum] = "b939280dcc83f8feabd87a1d5f9b00c2"
+SRC_URI[sha256sum] = "ea2615a62c74bea6ce3b38402f00c7513858f307f6ba7aa9fdbf0bbc12bcf407"
+
+inherit autotools
+do_configure_prepend () {
+ mkdir -p scripts/.autostuff/m4
+}
+
+do_install_append() {
+ ln -s kconfig-conf ${D}${bindir}/conf
+ ln -s kconfig-mconf ${D}${bindir}/mconf
+}
+
+EXTRA_OECONF += "--disable-gconf --disable-qconf"
+
+# Some packages have the version preceeding the .so instead properly
+# versioned .so.<version>, so we need to reorder and repackage.
+SOLIBS = "-${@d.getVar('PV',1)[:-2]}.so"
+FILES_SOLIBSDEV = "${libdir}/libkconfig-parser.so"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool-2.4.6.inc b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool-2.4.6.inc
new file mode 100644
index 000000000..f307a1075
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool-cross_2.4.6.bb b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool-cross_2.4.6.bb
new file mode 100644
index 000000000..0204d347b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool-cross_2.4.6.bb
@@ -0,0 +1,45 @@
+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_PREPROCESS_FUNCS += "libtoolcross_sysroot_preprocess"
+
+libtoolcross_sysroot_preprocess () {
+ sysroot_stage_dir ${D}${bindir_crossscripts} ${SYSROOT_DESTDIR}${bindir_crossscripts}
+ sysroot_stage_dir ${D}${target_datadir} ${SYSROOT_DESTDIR}${target_datadir}
+}
+
+SSTATE_SCAN_FILES += "libtoolize *-libtool"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool-native_2.4.6.bb b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool-native_2.4.6.bb
new file mode 100644
index 000000000..4c5218ade
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/0001-libtool-Fix-support-for-NIOS2-processor.patch b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/0001-libtool-Fix-support-for-NIOS2-processor.patch
new file mode 100644
index 000000000..bbd36d8dc
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/dont-depend-on-help2man.patch b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/dont-depend-on-help2man.patch
new file mode 100644
index 000000000..fd4084c85
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/fix-final-rpath.patch b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/fix-final-rpath.patch
new file mode 100644
index 000000000..5c9f8cc9c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/fix-resolve-lt-sysroot.patch b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/fix-resolve-lt-sysroot.patch
new file mode 100644
index 000000000..1bd95980c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/fix-rpath.patch b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/fix-rpath.patch
new file mode 100644
index 000000000..a2ec9473e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/fixinstall.patch b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/fixinstall.patch
new file mode 100644
index 000000000..8f343bf43
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/nohardcodepaths.patch b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/nohardcodepaths.patch
new file mode 100644
index 000000000..b2239fbad
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/nohardcodepaths.patch
@@ -0,0 +1,27 @@
+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
+
+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/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/norm-rpath.patch b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/norm-rpath.patch
new file mode 100644
index 000000000..1e4c65e02
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/prefix.patch b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/prefix.patch
new file mode 100644
index 000000000..a73df2e4a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/rename-with-sysroot.patch b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/rename-with-sysroot.patch
new file mode 100644
index 000000000..ad2b11053
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/trailingslash.patch b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/trailingslash.patch
new file mode 100644
index 000000000..e8824d7db
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/unwind-opt-parsing.patch b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/unwind-opt-parsing.patch
new file mode 100644
index 000000000..b633bc41b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/use-sysroot-in-libpath.patch b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/use-sysroot-in-libpath.patch
new file mode 100644
index 000000000..6af99f327
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool_2.4.6.bb b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool_2.4.6.bb
new file mode 100644
index 000000000..3851ec7f8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool_2.4.6.bb
@@ -0,0 +1,27 @@
+require libtool-${PV}.inc
+
+RDEPENDS_${PN} += "bash"
+
+#
+# We want the results of libtool-cross preserved - don't stage anything ourselves.
+#
+SYSROOT_PREPROCESS_FUNCS += "libtool_sysroot_preprocess"
+
+do_install_append () {
+ sed -e 's@--sysroot=${STAGING_DIR_HOST}@@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"@' \
+ -i ${D}${bindir}/libtool
+}
+
+libtool_sysroot_preprocess () {
+ rm -rf ${SYSROOT_DESTDIR}${bindir}/*
+ rm -rf ${SYSROOT_DESTDIR}${datadir}/aclocal/*
+ rm -rf ${SYSROOT_DESTDIR}${datadir}/libtool/build-aux/*
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/libtool/nativesdk-libtool_2.4.6.bb b/import-layers/yocto-poky/meta/recipes-devtools/libtool/nativesdk-libtool_2.4.6.bb
new file mode 100644
index 000000000..508eade32
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools-native_0.9.69.bb b/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools-native_0.9.69.bb
new file mode 100644
index 000000000..a8a90fc82
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools-native_0.9.69.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Convert LinuxDoc SGML source into other formats"
+HOMEPAGE = "http://packages.debian.org/linuxdoc-tools"
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=077ef64ec3ac257fb0d786531cf26931"
+
+DEPENDS = "groff-native openjade-native"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/l/linuxdoc-tools/linuxdoc-tools_${PV}.orig.tar.gz \
+ file://disable_sgml2rtf.patch \
+ file://disable_txt_doc.patch \
+ file://disable_tex_doc.patch \
+ file://disable_dvips_doc.patch"
+
+SRC_URI[md5sum] = "1d13d500918a7a145b0edc2f16f61dd1"
+SRC_URI[sha256sum] = "7103facee18a2ea97186ca459d743d22f7f89ad4b5cd1dfd1c34f83d6bfd4101"
+
+inherit autotools-brokensep native
+
+do_configure () {
+ oe_runconf
+}
+
+do_install() {
+ oe_runmake 'DESTDIR=${D}' 'TMPDIR=${T}' install
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_dvips_doc.patch b/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_dvips_doc.patch
new file mode 100644
index 000000000..490b36799
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_dvips_doc.patch
@@ -0,0 +1,33 @@
+Disable building documentation which requires the dvips utility.
+This patch should be dropped once we include a native version of
+dvips.
+
+Upstream-Status: Inappropriate [Other]
+Temporary workaround which disables documentation.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+diff -urN linuxdoc-tools-0.9.66.orig/doc/Makedoc.sh linuxdoc-tools-0.9.66/doc/Makedoc.sh
+--- linuxdoc-tools-0.9.66.orig/doc/Makedoc.sh 2011-02-25 15:26:41.142917782 -0800
++++ linuxdoc-tools-0.9.66/doc/Makedoc.sh 2011-02-25 15:27:25.141917472 -0800
+@@ -52,13 +52,13 @@
+ # $TMPDIR/sgml2latex --pass="\usepackage{times}" -o dvi ./guide
+ #fi
+
+-if [ -n "`which dvips`" ]; then
+- echo " + dvips" >&2
+- dvips -t letter -o ./guide.ps ./guide.dvi
+- if [ -n "`which gzip`" -a -f ./guide.ps ]; then
+- gzip -fN ./guide.ps
+- fi
+-fi
++#if [ -n "`which dvips`" ]; then
++# echo " + dvips" >&2
++# dvips -t letter -o ./guide.ps ./guide.dvi
++# if [ -n "`which gzip`" -a -f ./guide.ps ]; then
++# gzip -fN ./guide.ps
++# fi
++#fi
+
+
+ echo "- Building info docs" >&2
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_sgml2rtf.patch b/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_sgml2rtf.patch
new file mode 100644
index 000000000..50c8a8f3f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_sgml2rtf.patch
@@ -0,0 +1,64 @@
+From 756f20e70a97ee2dea9b32c0955eabfc27f29be1 Mon Sep 17 00:00:00 2001
+From: Andrei Dinu <andrei.adrianx.dinu@intel.com>
+Date: Wed, 29 May 2013 16:50:17 +0300
+Subject: [PATCH] The build of sgml2rtf is problematic due to the way it wants
+ to link to a shared library version of flex. Flex only
+ ships with a static lib. Rather than diverging from
+ upstream flex, simply skip building this un-needed utility.
+
+Upstream-Status: Inappropriate [Other]
+Workaround which disables a feature.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com>
+---
+ Makefile.in | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 359f14e..fc04020 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -40,7 +40,7 @@ perl5lib_ddir = $(DESTDIR)$(perl5libdir)
+ pkgdata_ddir = $(DESTDIR)$(pkgdatadir)
+ tex_ddir = $(DESTDIR)$(texdir)
+
+-progs := sgml2html sgml2info sgml2latex sgml2lyx sgml2rtf sgml2txt sgmlcheck
++progs := sgml2html sgml2info sgml2latex sgml2lyx sgml2txt sgmlcheck
+
+ PROFILE =
+ INCLUDE =
+@@ -71,9 +71,9 @@ endif
+ ( cd sgmlpre ; \
+ $(MAKE) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LEX=flex sgmlpre || exit -1 )
+
+- @echo "Compiling RTF conversion tools (in rtf-fix/)..."
+- ( cd rtf-fix ; \
+- $(MAKE) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" || exit -1 )
++# @echo "Compiling RTF conversion tools (in rtf-fix/)..."
++# ( cd rtf-fix ; \
++# $(MAKE) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" || exit -1 )
+
+ @echo "making man pages in genman ..."
+ if [ ! -d genman ]; then mkdir genman ; fi
+@@ -117,7 +117,7 @@ endif
+
+ # -- Install auxiliary programs
+ mkdir -p $(auxbin_ddir)
+- for ii in sgmlpre/sgmlpre rtf-fix/rtf2rtf; do \
++ for ii in sgmlpre/sgmlpre; do \
+ bn=`basename $$ii`; \
+ $(INSTALL_PROGRAM) $$ii $(auxbin_ddir)/$$bn; \
+ done
+@@ -206,7 +206,7 @@ bin/linuxdoc:: Makefile bin/linuxdoc.in
+
+ clean::
+ -rm -f *~ bin/*~ bin/linuxdoc
+- for d in $(DDIRS) $(MDIRS) rtf-fix; do $(MAKE) -C $$d clean; done
++ for d in $(DDIRS) $(MDIRS); do $(MAKE) -C $$d clean; done
+ (cd sgmlpre ; rm -f sgmlpre.o sgmlpre)
+ -rm -rf genman/
+
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_tex_doc.patch b/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_tex_doc.patch
new file mode 100644
index 000000000..b62895c67
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_tex_doc.patch
@@ -0,0 +1,29 @@
+Disable building documentation which requires the latex utility.
+This patch should be dropped once we include a native version of
+latex.
+
+Upstream-Status: Inappropriate [Other]
+Temporary workaround which disables documentation.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+diff -urN linuxdoc-tools-0.9.66.orig/doc/Makedoc.sh linuxdoc-tools-0.9.66/doc/Makedoc.sh
+--- linuxdoc-tools-0.9.66.orig/doc/Makedoc.sh 2009-11-09 11:58:25.000000000 -0800
++++ linuxdoc-tools-0.9.66/doc/Makedoc.sh 2011-02-25 15:23:58.610016114 -0800
+@@ -46,11 +46,11 @@
+ $TMPDIR/sgml2txt -b 1 ./guide
+ fi
+
+-if [ -n "`which latex`" ]; then
+- ln -s $TMPDIR/linuxdoc $TMPDIR/sgml2latex
+- echo "- Building latex docs" >&2
+- $TMPDIR/sgml2latex --pass="\usepackage{times}" -o dvi ./guide
+-fi
++#if [ -n "`which latex`" ]; then
++# ln -s $TMPDIR/linuxdoc $TMPDIR/sgml2latex
++# echo "- Building latex docs" >&2
++# $TMPDIR/sgml2latex --pass="\usepackage{times}" -o dvi ./guide
++#fi
+
+ if [ -n "`which dvips`" ]; then
+ echo " + dvips" >&2
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_txt_doc.patch b/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_txt_doc.patch
new file mode 100644
index 000000000..8d784110d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_txt_doc.patch
@@ -0,0 +1,36 @@
+Disable building txt documentation. This is a temporary workaround,
+as I have found an Ubuntu 10.10 system which throws errors during
+building this that I'd like to ultimately fix. The error manifests
+itself from the end of LinuxDocTools.pm with the following messages
+during do_install:
+
+| - Building txt docs
+| Processing file ./guide
+| troff: fatal error: can't find macro file s
+| fmt_txt::postASP: Empty output file, error when calling groff. Aborting...
+
+Upstream-Status: Inappropriate [Other]
+Temporary workaround which disables documentation.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+diff -urN linuxdoc-tools-0.9.66.orig//doc/Makedoc.sh linuxdoc-tools-0.9.66/doc/Makedoc.sh
+--- linuxdoc-tools-0.9.66.orig//doc/Makedoc.sh 2009-11-09 11:58:25.000000000 -0800
++++ linuxdoc-tools-0.9.66/doc/Makedoc.sh 2011-03-04 17:37:24.788923998 -0800
+@@ -40,11 +40,11 @@
+
+ chmod u+x $TMPDIR/linuxdoc
+
+-if [ -n "`which groff`" ]; then
+- ln -s $TMPDIR/linuxdoc $TMPDIR/sgml2txt
+- echo "- Building txt docs" >&2
+- $TMPDIR/sgml2txt -b 1 ./guide
+-fi
++#if [ -n "`which groff`" ]; then
++# ln -s $TMPDIR/linuxdoc $TMPDIR/sgml2txt
++# echo "- Building txt docs" >&2
++# $TMPDIR/sgml2txt -b 1 ./guide
++#fi
+
+ if [ -n "`which latex`" ]; then
+ ln -s $TMPDIR/linuxdoc $TMPDIR/sgml2latex
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/m4/m4-1.4.17.inc b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4-1.4.17.inc
new file mode 100644
index 000000000..8ea4e0490
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4-1.4.17.inc
@@ -0,0 +1,18 @@
+require m4.inc
+
+EXTRA_OECONF += "--without-libsigsegv-prefix"
+
+LICENSE = "GPLv3"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
+ file://examples/COPYING;md5=4031593b2166d6c47cae282d944a7ede"
+
+SRC_URI += "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] = "a5e9954b1dae036762f7b13673a2cf76"
+SRC_URI[sha256sum] = "3ce725133ee552b8b4baca7837fb772940b25e81b2a9dc92537aeaf733538c9e"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/m4/m4-1.4.9.inc b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4-1.4.9.inc
new file mode 100644
index 000000000..aab2c1efa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4-1.4.9.inc
@@ -0,0 +1,13 @@
+require m4.inc
+
+LICENSE = "GPLv2"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe\
+ file://examples/COPYING;md5=1d49bd61dc590f014cae7173b43e3e5c"
+
+PR = "r2"
+SRC_URI += "file://fix_for_circular_dependency.patch"
+
+SRC_URI[md5sum] = "1ba8e147aff5e79bd2bfb983d86b53d5"
+SRC_URI[sha256sum] = "815ce53853fbf6493617f467389b799208b1ec98296b95be44a683f8bcfd7c47"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/m4/m4-native_1.4.17.bb b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4-native_1.4.17.bb
new file mode 100644
index 000000000..06d8aa244
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4-native_1.4.17.bb
@@ -0,0 +1,13 @@
+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
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/m4/m4.inc b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4.inc
new file mode 100644
index 000000000..4a83929f0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4.inc
@@ -0,0 +1,10 @@
+SUMMARY = "Traditional Unix macro processor"
+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
+
+EXTRA_OEMAKE += "'infodir=${infodir}'"
+LDFLAGS_prepend_libc-uclibc = " -lrt "
+SRC_URI = "${GNU_MIRROR}/m4/m4-${PV}.tar.gz"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/m4/m4/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/m4/m4/ac_config_links.patch b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4/ac_config_links.patch
new file mode 100644
index 000000000..275c0b2e7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4/ac_config_links.patch
@@ -0,0 +1,30 @@
+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>
+
+diff -urN m4-1.4.13.orig/configure m4-1.4.13/configure
+--- m4-1.4.13.orig/configure 2009-11-10 10:54:00.301707097 +0100
++++ m4-1.4.13/configure 2009-11-10 10:54:17.314206379 +0100
+@@ -14860,8 +14860,8 @@
+ # 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/import-layers/yocto-poky/meta/recipes-devtools/m4/m4/fix_for_circular_dependency.patch b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4/fix_for_circular_dependency.patch
new file mode 100644
index 000000000..98774535d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4/fix_for_circular_dependency.patch
@@ -0,0 +1,77 @@
+Upstream-Status: Inappropriate [licensing]
+
+The older GPLv2 m4 does not work well with newer autoconf. It causes the
+circular dependency as seen bellow.
+ Removing this m4 file which was needed only forl older autoconf
+
+| configure.ac:34: error: AC_REQUIRE: circular dependency of AC_GNU_SOURCE
+| /build_disk/poky_build/build1/tmp/work/i586-poky-linux/m4-1.4.9-r0/m4-1.4.9/m4/extensions.m4:19: AC_USE_SYSTEM_EXTENSIONS is expanded from...
+| ../../lib/autoconf/specific.m4:310: AC_GNU_SOURCE is expanded from...
+| /build_disk/poky_build/build1/tmp/work/i586-poky-linux/m4-1.4.9-r0/m4-1.4.9/m4/gnulib-comp.m4:21: M4_EARLY is expanded from...
+| configure.ac:34: the top level
+| autom4te: /build_disk/poky_build/build1/tmp/sysroots/x86_64-linux/usr/bin/m4 failed with exit status: 1
+| aclocal: /build_disk/poky_build/build1/tmp/sysroots/x86_64-linux/usr/bin/autom4te failed with exit status: 1
+| autoreconf: aclocal failed with exit status: 1
+
+Nitin A Kamble <nitin.a.kamble@intel.com>
+2011/03/16
+
+Index: m4-1.4.9/m4/extensions.m4
+===================================================================
+--- m4-1.4.9.orig/m4/extensions.m4
++++ m4-1.4.9/m4/extensions.m4
+@@ -6,53 +6,10 @@
+ # gives unlimited permission to copy and/or distribute it,
+ # with or without modifications, as long as this notice is preserved.
+
+-# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
+-# Autoconf. Perhaps we can remove this once we can assume Autoconf
+-# 2.61 or later everywhere, but since CVS Autoconf mutates rapidly
+-# enough in this area it's likely we'll need to redefine
+-# AC_USE_SYSTEM_EXTENSIONS for quite some time.
+-
+-# AC_USE_SYSTEM_EXTENSIONS
+-# ------------------------
+-# Enable extensions on systems that normally disable them,
+-# typically due to standards-conformance issues.
+-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
+-[
+- AC_BEFORE([$0], [AC_COMPILE_IFELSE])
+- AC_BEFORE([$0], [AC_RUN_IFELSE])
+-
+- AC_REQUIRE([AC_GNU_SOURCE])
+- AC_REQUIRE([AC_AIX])
+- AC_REQUIRE([AC_MINIX])
+-
+- AH_VERBATIM([__EXTENSIONS__],
+-[/* Enable extensions on Solaris. */
+-#ifndef __EXTENSIONS__
+-# undef __EXTENSIONS__
+-#endif
+-#ifndef _POSIX_PTHREAD_SEMANTICS
+-# undef _POSIX_PTHREAD_SEMANTICS
+-#endif
+-#ifndef _TANDEM_SOURCE
+-# undef _TANDEM_SOURCE
+-#endif])
+- AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
+- [ac_cv_safe_to_define___extensions__],
+- [AC_COMPILE_IFELSE(
+- [AC_LANG_PROGRAM([
+-# define __EXTENSIONS__ 1
+- AC_INCLUDES_DEFAULT])],
+- [ac_cv_safe_to_define___extensions__=yes],
+- [ac_cv_safe_to_define___extensions__=no])])
+- test $ac_cv_safe_to_define___extensions__ = yes &&
+- AC_DEFINE([__EXTENSIONS__])
+- AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+- AC_DEFINE([_TANDEM_SOURCE])
+-])
+
+ # gl_USE_SYSTEM_EXTENSIONS
+ # ------------------------
+ # Enable extensions on systems that normally disable them,
+ # typically due to standards-conformance issues.
+ AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS],
+- [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])])
++ [])
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/m4/m4/remove-gets.patch b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4/remove-gets.patch
new file mode 100644
index 000000000..effb353f1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4/remove-gets.patch
@@ -0,0 +1,23 @@
+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>
+Index: m4-1.4.17/lib/stdio.in.h
+===================================================================
+--- m4-1.4.17.orig/lib/stdio.in.h 2013-10-16 14:41:01.678496227 +0300
++++ m4-1.4.17/lib/stdio.in.h 2013-10-16 14:41:48.849427839 +0300
+@@ -717,10 +717,12 @@
+ /* 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
+ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+ #endif
++#endif
+
+
+ #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/m4/m4_1.4.17.bb b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4_1.4.17.bb
new file mode 100644
index 000000000..b12c0adf3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4_1.4.17.bb
@@ -0,0 +1,3 @@
+require m4-${PV}.inc
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/m4/m4_1.4.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4_1.4.9.bb
new file mode 100644
index 000000000..b12c0adf3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4_1.4.9.bb
@@ -0,0 +1,3 @@
+require m4-${PV}.inc
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/make/make-3.81/make_fix_for_automake-1.12.patch b/import-layers/yocto-poky/meta/recipes-devtools/make/make-3.81/make_fix_for_automake-1.12.patch
new file mode 100644
index 000000000..9b2e96431
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/make/make-3.81/make_fix_for_automake-1.12.patch
@@ -0,0 +1,43 @@
+Upstream-Status: Pending
+
+automake 1.12 has depricated automatic de-ANSI-fication support
+
+this patch avoids these kinds of errors:
+
+| configure.in:48: error: automatic de-ANSI-fication support has been removed
+...
+| Makefile.am:19: error: automatic de-ANSI-fication support has been removed
+| autoreconf: automake failed with exit status: 1
+| ERROR: autoreconf execution failed.
+
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/04
+
+Index: make-3.81/configure.in
+===================================================================
+--- make-3.81.orig/configure.in
++++ make-3.81/configure.in
+@@ -44,9 +44,6 @@ AC_AIX
+ AC_ISC_POSIX
+ AC_MINIX
+
+-# Needed for ansi2knr
+-AM_C_PROTOTYPES
+-
+ # Enable gettext, in "external" mode.
+
+ AM_GNU_GETTEXT_VERSION(0.14.1)
+Index: make-3.81/Makefile.am
+===================================================================
+--- make-3.81.orig/Makefile.am
++++ make-3.81/Makefile.am
+@@ -16,7 +16,7 @@
+ # GNU Make; see the file COPYING. If not, write to the Free Software
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+-AUTOMAKE_OPTIONS = 1.8 dist-bzip2 check-news ansi2knr
++AUTOMAKE_OPTIONS = 1.8 dist-bzip2 check-news
+ ACLOCAL_AMFLAGS = -I config
+
+ MAKE_HOST = @MAKE_HOST@
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/make/make-3.81/makeinfo.patch b/import-layers/yocto-poky/meta/recipes-devtools/make/make-3.81/makeinfo.patch
new file mode 100644
index 000000000..5dd760467
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/make/make-3.81/makeinfo.patch
@@ -0,0 +1,22 @@
+Allow docs to build with makeinfo 5.X, fixing the error:
+
+doc/make.texi:8165: @itemx must follow @item
+
+Upstream-Status: Backport
+
+RP
+2014/03/29
+
+Index: make-3.81/doc/make.texi
+===================================================================
+--- make-3.81.orig/doc/make.texi 2006-04-01 06:36:40.000000000 +0000
++++ make-3.81/doc/make.texi 2014-03-29 09:39:51.007727012 +0000
+@@ -8162,7 +8162,7 @@
+ rarely need to specify this option since @samp{make} does it for you;
+ see @ref{-w Option, ,The @samp{--print-directory} Option}.)
+
+-@itemx --no-print-directory
++@item --no-print-directory
+ @cindex @code{--no-print-directory}
+ Disable printing of the working directory under @code{-w}.
+ This option is useful when @code{-w} is turned on automatically,
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/make/make-4.1/0001-main.c-main-SV-43434-Handle-NULL-returns-from-ttynam.patch b/import-layers/yocto-poky/meta/recipes-devtools/make/make-4.1/0001-main.c-main-SV-43434-Handle-NULL-returns-from-ttynam.patch
new file mode 100644
index 000000000..7a5f4ba05
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/make/make-4.1/0001-main.c-main-SV-43434-Handle-NULL-returns-from-ttynam.patch
@@ -0,0 +1,63 @@
+From 292da6f6867b75a5af7ddbb639a1feae022f438f Mon Sep 17 00:00:00 2001
+From: Paul Smith <psmith@gnu.org>
+Date: Mon, 20 Oct 2014 01:54:56 -0400
+Subject: [PATCH] * main.c (main): [SV 43434] Handle NULL returns from
+ ttyname().
+
+Upstream-Status: Backport
+
+From: http://git.savannah.gnu.org/cgit/make.git/commit/?id=292da6f6867b75a5af7ddbb639a1feae022f438f
+
+---
+ main.c | 15 ++++++++++-----
+ makeint.h | 3 ++-
+ 2 files changed, 12 insertions(+), 6 deletions(-)
+
+diff --git a/main.c b/main.c
+index b2d169c..0cdb8a8 100644
+--- a/main.c
++++ b/main.c
+@@ -1429,13 +1429,18 @@ main (int argc, char **argv, char **envp)
+ #ifdef HAVE_ISATTY
+ if (isatty (fileno (stdout)))
+ if (! lookup_variable (STRING_SIZE_TUPLE ("MAKE_TERMOUT")))
+- define_variable_cname ("MAKE_TERMOUT", TTYNAME (fileno (stdout)),
+- o_default, 0)->export = v_export;
+-
++ {
++ const char *tty = TTYNAME (fileno (stdout));
++ define_variable_cname ("MAKE_TERMOUT", tty ? tty : DEFAULT_TTYNAME,
++ o_default, 0)->export = v_export;
++ }
+ if (isatty (fileno (stderr)))
+ if (! lookup_variable (STRING_SIZE_TUPLE ("MAKE_TERMERR")))
+- define_variable_cname ("MAKE_TERMERR", TTYNAME (fileno (stderr)),
+- o_default, 0)->export = v_export;
++ {
++ const char *tty = TTYNAME (fileno (stderr));
++ define_variable_cname ("MAKE_TERMERR", tty ? tty : DEFAULT_TTYNAME,
++ o_default, 0)->export = v_export;
++ }
+ #endif
+
+ /* Reset in case the switches changed our minds. */
+diff --git a/makeint.h b/makeint.h
+index 6223936..2009f41 100644
+--- a/makeint.h
++++ b/makeint.h
+@@ -436,10 +436,11 @@ extern struct rlimit stack_limit;
+ /* The number of bytes needed to represent the largest integer as a string. */
+ #define INTSTR_LENGTH CSTRLEN ("18446744073709551616")
+
++#define DEFAULT_TTYNAME "true"
+ #ifdef HAVE_TTYNAME
+ # define TTYNAME(_f) ttyname (_f)
+ #else
+-# define TTYNAME(_f) "true"
++# define TTYNAME(_f) DEFAULT_TTYNAME
+ #endif
+
+
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/make/make.inc b/import-layers/yocto-poky/meta/recipes-devtools/make/make.inc
new file mode 100644
index 000000000..849b74299
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/make/make.inc
@@ -0,0 +1,12 @@
+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"
+
+inherit autotools gettext pkgconfig texinfo
+
+PROVIDES = "virtual/make"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/make/make_3.81.bb b/import-layers/yocto-poky/meta/recipes-devtools/make/make_3.81.bb
new file mode 100644
index 000000000..b8a79b0eb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/make/make_3.81.bb
@@ -0,0 +1,15 @@
+PR = "r1"
+
+LICENSE = "GPLv2 & LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=361b6b837cad26c6900a926b62aada5f \
+ file://tests/COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
+ file://glob/COPYING.LIB;md5=4a770b67e6be0f60da244beb2de0fce4"
+
+require make.inc
+
+SRC_URI += "file://make_fix_for_automake-1.12.patch"
+SRC_URI += "file://makeinfo.patch"
+
+SRC_URI[md5sum] = "354853e0b2da90c527e35aabb8d6f1e6"
+SRC_URI[sha256sum] = "f3e69023771e23908f5d5592954d8271d3d6af09693cecfd29cee6fde8550dc8"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/make/make_4.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/make/make_4.1.bb
new file mode 100644
index 000000000..78fe0b547
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/make/make_4.1.bb
@@ -0,0 +1,14 @@
+LICENSE = "GPLv3 & LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://tests/COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://glob/COPYING.LIB;md5=4a770b67e6be0f60da244beb2de0fce4"
+require make.inc
+
+SRC_URI += "file://0001-main.c-main-SV-43434-Handle-NULL-returns-from-ttynam.patch"
+
+EXTRA_OECONF += "--without-guile"
+
+SRC_URI[md5sum] = "57a7a224a822f94789a587ccbcedff69"
+SRC_URI[sha256sum] = "0bc7613389650ee6a24554b52572a272f7356164fd2c4132b0bcf13123e4fca5"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/makedevs/makedevs/COPYING.patch b/import-layers/yocto-poky/meta/recipes-devtools/makedevs/makedevs/COPYING.patch
new file mode 100644
index 000000000..3a8902b97
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/makedevs/makedevs/makedevs.c b/import-layers/yocto-poky/meta/recipes-devtools/makedevs/makedevs/makedevs.c
new file mode 100644
index 000000000..771f33ef5
--- /dev/null
+++ b/import-layers/yocto-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, "%40s %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) {
+ fprintf(stderr, helptext);
+ 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':
+ printf(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:
+ fprintf(stderr, helptext);
+ exit(1);
+ }
+ }
+
+ if (argv[optind] != NULL) {
+ fprintf(stderr, helptext);
+ 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/import-layers/yocto-poky/meta/recipes-devtools/makedevs/makedevs_1.0.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/makedevs/makedevs_1.0.1.bb
new file mode 100644
index 000000000..92d5870f4
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/mkelfimage/mkelfimage/cross-compile.patch b/import-layers/yocto-poky/meta/recipes-devtools/mkelfimage/mkelfimage/cross-compile.patch
new file mode 100644
index 000000000..769270972
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mkelfimage/mkelfimage/cross-compile.patch
@@ -0,0 +1,71 @@
+make the tool to be cross compilable.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: mkelfImage/configure.ac
+===================================================================
+--- mkelfImage.orig/configure.ac 2012-07-14 14:04:48.964898667 -0700
++++ mkelfImage/configure.ac 2012-07-14 14:10:47.800916083 -0700
+@@ -70,6 +70,9 @@
+ AC_MSG_ERROR([cc not found])
+ fi
+ eval "${with_default}_CC='$CC'"
++ if test "x$HOST_CC" = 'x'; then
++ AC_CHECK_PROG([HOST_CC], [$CC], [$CC], [gcc], [$PATH])
++ fi
+ AC_PROG_CPP
+ if test "$CPP" = no; then
+ AC_MSG_ERROR([cpp not found])
+@@ -172,7 +175,6 @@
+
+ dnl ---Output variables...
+
+-HOST_CC=$CC
+ HOST_CFLAGS="$HOST_CFLAGS -O2 -Wall \$(HOST_CPPFLAGS)"
+
+ dnl TODO: figure out how to set these appropriately for compilers other than gcc
+Index: mkelfImage/linux-i386/Makefile
+===================================================================
+--- mkelfImage.orig/linux-i386/Makefile 2012-07-14 14:04:48.964898667 -0700
++++ mkelfImage/linux-i386/Makefile 2012-07-14 14:04:49.032898671 -0700
+@@ -4,7 +4,7 @@
+
+ $(LI386_OBJ)/mkelf-linux-i386.o: $(LI386_DIR)/mkelf-linux-i386.c $(LI386_DIR)/convert.bin.c $(LI386_DEP)
+ $(MKDIR) -p $(@D)
+- $(HOST_CC) $(HOST_CFLAGS) -c -g $< -o $@
++ $(CC) $(HOST_CFLAGS) -c -g $< -o $@
+
+
+ ifdef I386_CC
+Index: mkelfImage/linux-ia64/Makefile
+===================================================================
+--- mkelfImage.orig/linux-ia64/Makefile 2012-07-14 14:04:48.964898667 -0700
++++ mkelfImage/linux-ia64/Makefile 2012-07-14 14:04:49.032898671 -0700
+@@ -4,7 +4,7 @@
+
+ $(LIA64_OBJ)/mkelf-linux-ia64.o: $(LIA64_DIR)/mkelf-linux-ia64.c $(LIA64_DIR)/convert.bin.c $(LIA64_DEP)
+ $(MKDIR) -p $(@D)
+- $(HOST_CC) $(HOST_CFLAGS) -c -g $< -o $@
++ $(CC) $(HOST_CFLAGS) -c -g $< -o $@
+
+ ifdef IA64_CC
+
+Index: mkelfImage/main/Makefile
+===================================================================
+--- mkelfImage.orig/main/Makefile 2012-07-14 14:04:48.964898667 -0700
++++ mkelfImage/main/Makefile 2012-07-14 14:04:49.032898671 -0700
+@@ -4,11 +4,11 @@
+
+ $(OBJDIR)/sbin/mkelfImage: $(MKELF_OBJS) $(DEPS)
+ $(MKDIR) -p $(@D)
+- $(HOST_CC) $(HOST_CFLAGS) $(MKELF_OBJS) -o $@ $(LIBS)
++ $(CC) $(HOST_CFLAGS) $(MKELF_OBJS) -o $@ $(LIBS)
+
+ $(OBJDIR)/main/mkelfImage.o: main/mkelfImage.c include/mkelfImage.h $(DEPS)
+ $(MKDIR) -p $(@D)
+- $(HOST_CC) $(HOST_CFLAGS) -c $< -o $@
++ $(CC) $(HOST_CFLAGS) -c $< -o $@
+
+ $(OBJDIR)/man/man8/mkelfImage.8: main/mkelfImage.man
+ $(MKDIR) -p $(@D)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mkelfimage/mkelfimage/fix-makefile-to-find-libz.patch b/import-layers/yocto-poky/meta/recipes-devtools/mkelfimage/mkelfimage/fix-makefile-to-find-libz.patch
new file mode 100644
index 000000000..756a65cd9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mkelfimage/mkelfimage/fix-makefile-to-find-libz.patch
@@ -0,0 +1,30 @@
+Let makefile find libz and zlib.h by CFLAGS and LDFLAGS.
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Upstream-Status: Pending
+---
+diff --git a/configure.ac b/configure.ac
+index d1acc36..6f865b0 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -62,7 +62,7 @@ AC_CHECK_PROG([RPM], rpm, rpm, [], [$PATH])
+ AC_CHECK_PROG([SED], sed, sed, [], [$PATH])
+ AC_CHECK_PROG([FIND], find, find, [], [$PATH])
+
+-AC_CHECK_HEADER(zlib.h, AC_CHECK_LIB(z, inflateInit_, [AC_DEFINE(HAVE_ZLIB_H, 1) LIBS="$LIBS -lz"]))
++AC_CHECK_HEADER(zlib.h, AC_CHECK_LIB(z, inflateInit_, [AC_DEFINE(HAVE_ZLIB_H, 1) LIBS="$LIBS $LDFLAGS -lz"]))
+
+ dnl Find the default programs
+ if test "with_default" != no ; then
+@@ -175,7 +175,7 @@ fi
+
+ dnl ---Output variables...
+
+-HOST_CFLAGS="$HOST_CFLAGS -O2 -Wall \$(HOST_CPPFLAGS)"
++HOST_CFLAGS="$HOST_CFLAGS -O2 -Wall \$(HOST_CPPFLAGS) $CFLAGS"
+
+ dnl TODO: figure out how to set these appropriately for compilers other than gcc
+ I386_CFLAGS="$I386_CFLAGS -Os -ffreestanding -Wall -W -Wno-format \$(I386_CPPFLAGS)"
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mkelfimage/mkelfimage_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/mkelfimage/mkelfimage_git.bb
new file mode 100644
index 000000000..92435cd1c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mkelfimage/mkelfimage_git.bb
@@ -0,0 +1,38 @@
+SUMMARY = "Utility for creating ELF boot images for ELF-based Linux kernel images"
+HOMEPAGE = "http://www.coreboot.org/Mkelfimage"
+SECTION = "devel"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=ea5bed2f60d357618ca161ad539f7c0a"
+
+SRCREV = "686a48a339b3200184c27e7f98d4c03180b2be6c"
+PV = "4.0+git${SRCPV}"
+RECIPE_NO_UPDATE_REASON = "mkelfimage has been removed in coreboot 4.1 release: \
+http://review.coreboot.org/gitweb?p=coreboot.git;a=commit;h=34fc4ab80b507739e2580d490dff67fcfdde11ea"
+
+
+DEPENDS += "zlib"
+
+SRC_URI = "git://review.coreboot.org/p/coreboot;protocol=http \
+ file://cross-compile.patch \
+ "
+SRC_URI_append_class-native = " \
+ file://fix-makefile-to-find-libz.patch \
+"
+
+CLEANBROKEN = "1"
+
+S = "${WORKDIR}/git/util/mkelfImage"
+
+CFLAGS += "-fno-stack-protector"
+CACHED_CONFIGUREVARS += "HOST_CC='${BUILD_CC}'"
+EXTRA_OEMAKE += "HOST_CPPFLAGS='${BUILD_CPPFLAGS}'"
+
+inherit autotools-brokensep
+
+do_install_append() {
+ rmdir ${D}${datadir}/mkelfImage/elf32-i386
+ rmdir ${D}${datadir}/mkelfImage
+ chown root:root ${D}/${sbindir}/mkelfImage
+}
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/ac_init_fix.patch b/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/ac_init_fix.patch
new file mode 100644
index 000000000..422af1042
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/avoid-failure-on-symbol-provided-by-application.patch b/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/avoid-failure-on-symbol-provided-by-application.patch
new file mode 100644
index 000000000..7d6d62e77
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/avoid-failure-on-symbol-provided-by-application.patch
@@ -0,0 +1,102 @@
+From f172101130604e4a9efa5746f4d8d30de99a0fdc 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] 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 c5614ea..b0d9034 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
+
+ # Return undefined symbols in an object as a set of tuples (name, weakness)
+ def undefined_symbols(obj):
+@@ -144,6 +144,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]
+@@ -160,7 +165,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
+
+@@ -495,12 +500,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(ldlib)
+@@ -510,6 +516,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
+@@ -565,6 +577,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]
+--
+1.8.5.2.233.g932f7e4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/fix_STT_GNU_IFUNC.patch b/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/fix_STT_GNU_IFUNC.patch
new file mode 100644
index 000000000..d27a48916
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/fix_cross_compile.patch b/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/fix_cross_compile.patch
new file mode 100644
index 000000000..13e4606b8
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/show-GNU-unique-symbols-as-provided-symbols.patch b/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/show-GNU-unique-symbols-as-provided-symbols.patch
new file mode 100644
index 000000000..bc56593e6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/sysrooted-ldso.patch b/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/sysrooted-ldso.patch
new file mode 100644
index 000000000..75500a029
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/mklibs/mklibs-native_0.1.40.bb b/import-layers/yocto-poky/meta/recipes-devtools/mklibs/mklibs-native_0.1.40.bb
new file mode 100644
index 000000000..59fec29a0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mklibs/mklibs-native_0.1.40.bb
@@ -0,0 +1,21 @@
+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"
+DEPENDS = "python-native"
+
+SRC_URI = "http://ftp.de.debian.org/debian/pool/main/m/mklibs/${BPN}_${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] = "e1dafe5f962caa9dc5f2651c0723812a"
+SRC_URI[sha256sum] = "1db24ae779d21ccfed49f22e49a2b7ee43ec0e9197bc206d81cd02f96e91e125"
+
+inherit autotools gettext native pythonnative
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mmc/mmc-utils_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/mmc/mmc-utils_git.bb
new file mode 100644
index 000000000..64b8910a2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mmc/mmc-utils_git.bb
@@ -0,0 +1,22 @@
+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=17;md5=d7747fc87f1eb22b946ef819969503f0"
+
+SRCBRANCH ?= "master"
+SRCREV = "44f94b925894577f9ffcf2c418dd013a5e582648"
+
+PV = "0.1"
+
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc-utils.git;branch=${SRCBRANCH}"
+
+S = "${WORKDIR}/git"
+
+CFLAGS_append_powerpc64 = " -D__SANE_USERSPACE_TYPES__"
+CFLAGS_append_mips64 = " -D__SANE_USERSPACE_TYPES__"
+CFLAGS_append_mips64n32 = " -D__SANE_USERSPACE_TYPES__"
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 mmc ${D}${bindir}
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch
new file mode 100644
index 000000000..305be5215
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch
@@ -0,0 +1,29 @@
+From e16fa28bc57c29923ab60af2ac343da83e1992d8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 6 Oct 2015 23:51:34 +0000
+Subject: [PATCH] Fix build with musl
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ mkfs.jffs2.c | 44 ++++++++++++++++++++++++++++++++++++++++++--
+ recv_image.c | 1 -
+ serve_image.c | 1 -
+ 3 files changed, 42 insertions(+), 4 deletions(-)
+
+diff --git a/mkfs.jffs2.c b/mkfs.jffs2.c
+index f09c0b2..ed2dc43 100644
+--- a/mkfs.jffs2.c
++++ b/mkfs.jffs2.c
+@@ -72,6 +72,7 @@
+ #include <byteswap.h>
+ #include <crc32.h>
+ #include <inttypes.h>
++#include <limits.h>
+
+ #include "rbtree.h"
+ #include "common.h"
+--
+2.6.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch
new file mode 100644
index 000000000..7d783e7a5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch
@@ -0,0 +1,24 @@
+Replace rpmatch() usage with checking first character of line
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+--- a/include/common.h
++++ b/include/common.h
+@@ -122,10 +122,12 @@
+ }
+
+ if (strcmp("\n", line) != 0) {
+- switch (rpmatch(line)) {
+- case 0: ret = false; break;
+- case 1: ret = true; break;
+- case -1:
++ switch (line[0]) {
++ case 'N':
++ case 'n': ret = false; break;
++ case 'Y':
++ case 'y': ret = true; break;
++ default:
+ puts("unknown response; please try again");
+ continue;
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git-2.patch b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git-2.patch
new file mode 100644
index 000000000..57d6a30d8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git-2.patch
@@ -0,0 +1,103 @@
+Upstream-Status: Pending
+
+--- /tmp/mkfs.jffs2.c 2009-01-11 15:28:41.000000000 +0100
++++ git/mkfs.jffs2.c 2009-01-11 15:59:29.000000000 +0100
+@@ -100,6 +100,11 @@
+ 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;
+@@ -408,7 +413,7 @@
+ char *hpath, *tpath;
+ struct dirent *dp, **namelist;
+ struct filesystem_entry *entry;
+-
++ struct ignorepath_entry* element = ignorepath;
+
+ if (lstat(hostpath, &sb)) {
+ perror_msg_and_die("%s", hostpath);
+@@ -417,6 +422,15 @@
+ 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) {
+ perror_msg_and_die("opening directory %s", hostpath);
+@@ -1453,6 +1467,7 @@
+ {"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'},
+@@ -1500,6 +1515,7 @@
+ " -L, --list-compressors Show the list of the avaiable 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"
+@@ -1666,6 +1682,7 @@
+ 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 ... */
+@@ -1676,7 +1693,7 @@
+ 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':
+@@ -1700,6 +1717,28 @@
+ 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) {
+ error_msg_and_die("output filename specified more than once");
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch
new file mode 100644
index 000000000..05f1629d5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch
@@ -0,0 +1,44 @@
+Upstream-Status: Pending
+
+NEON instruction VLD1.64 was used to copy 64 bits data after type
+casting, and they will trigger alignment trap.
+This patch uses memcpy to avoid alignment problem.
+
+Signed-off-by: Yuanjie Huang <Yuanjie.Huang@windriver.com>
+
+diff --git a/mkfs.ubifs/key.h b/mkfs.ubifs/key.h
+index d3a02d4..e7e9218 100644
+--- a/mkfs.ubifs/key.h
++++ b/mkfs.ubifs/key.h
+@@ -141,10 +141,12 @@ static inline void data_key_init(union ubifs_key *key, ino_t inum,
+ */
+ static inline void key_write(const union ubifs_key *from, void *to)
+ {
+- union ubifs_key *t = to;
++ __le32 x[2];
+
+- t->j32[0] = cpu_to_le32(from->u32[0]);
+- t->j32[1] = cpu_to_le32(from->u32[1]);
++ x[0] = cpu_to_le32(from->u32[0]);
++ x[1] = cpu_to_le32(from->u32[1]);
++
++ memcpy(to, &x, 8);
+ memset(to + 8, 0, UBIFS_MAX_KEY_LEN - 8);
+ }
+
+@@ -156,10 +158,12 @@ static inline void key_write(const union ubifs_key *from, void *to)
+ */
+ static inline void key_write_idx(const union ubifs_key *from, void *to)
+ {
+- union ubifs_key *t = to;
++ __le32 x[2];
++
++ x[0] = cpu_to_le32(from->u32[0]);
++ x[1] = cpu_to_le32(from->u32[1]);
+
+- t->j32[0] = cpu_to_le32(from->u32[0]);
+- t->j32[1] = cpu_to_le32(from->u32[1]);
++ memcpy(to, &x, 8);
+ }
+
+ /**
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch
new file mode 100644
index 000000000..7207cfcb3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch
@@ -0,0 +1,137 @@
+Upstream-Status: Pending
+From patchwork Mon Aug 8 08:16:43 2011
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: mtd-utils: fix corrupt cleanmarker with flash_erase -j command
+Date: Sun, 07 Aug 2011 22:16:43 -0000
+From: b35362@freescale.com
+X-Patchwork-Id: 108873
+Message-Id: <1312791403-13473-1-git-send-email-b35362@freescale.com>
+To: <dwmw2@infradead.org>
+Cc: Liu Shuo <b35362@freescale.com>, Artem.Bityutskiy@nokia.com,
+ Li Yang <leoli@freescale.com>, linux-mtd@lists.infradead.org
+
+From: Liu Shuo <b35362@freescale.com>
+
+Flash_erase -j should fill discrete freeoob areas with required bytes
+of JFFS2 cleanmarker in jffs2_check_nand_cleanmarker(). Not just fill
+the first freeoob area.
+
+The below is the result without this workaround:
+
+JFFS2: Erase block at 0x00000000 is not formatted. It will be erased
+JFFS2: Erase block at 0x00004000 is not formatted. It will be erased
+JFFS2: Erase block at 0x00008000 is not formatted. It will be erased
+JFFS2: Erase block at 0x0000c000 is not formatted. It will be erased
+JFFS2: Erase block at 0x00010000 is not formatted. It will be erased
+JFFS2: Erase block at 0x00014000 is not formatted. It will be erased
+JFFS2: Erase block at 0x00018000 is not formatted. It will be erased
+JFFS2: Erase block at 0x0001c000 is not formatted. It will be erased
+JFFS2: Erase block at 0x00020000 is not formatted. It will be erased
+JFFS2: Erase block at 0x00024000 is not formatted. It will be erased
+JFFS2: Erase block at 0x00028000 is not formatted. It will be erased
+...
+
+Signed-off-by: Liu Shuo <b35362@freescale.com>
+Signed-off-by: Li Yang <leoli@freescale.com>
+
+Updated for the new version
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+---
+v2 : get length of availble freeoob bytes from oobinfo information,
+ not use the ioctl ECCGETLAYOUT which is being deprecated.
+
+ flash_erase.c | 46 +++++++++++++++++++++++++++++++++++++++-------
+ 1 files changed, 39 insertions(+), 7 deletions(-)
+
+diff --git a/flash_erase.c b/flash_erase.c
+index 933373a..4b9d84b 100644
+--- a/flash_erase.c
++++ b/flash_erase.c
+@@ -99,6 +99,7 @@ int main(int argc, char *argv[])
+ bool isNAND;
+ int error = 0;
+ off_t offset = 0;
++ void *oob_data = NULL;
+
+ /*
+ * Process user arguments
+@@ -201,15 +202,43 @@ int main(int argc, char *argv[])
+ if (ioctl(fd, MEMGETOOBSEL, &oobinfo) != 0)
+ return sys_errmsg("%s: unable to get NAND oobinfo", mtd_device);
+
++ cleanmarker.totlen = cpu_to_je32(8);
+ /* Check for autoplacement */
+ if (oobinfo.useecc == MTD_NANDECC_AUTOPLACE) {
+- /* Get the position of the free bytes */
+- if (!oobinfo.oobfree[0][1])
++ struct nand_ecclayout_user ecclayout;
++ int i, oobavail;
++
++ for (i = 0, oobavail = 0; oobinfo.oobfree[i][1]; i++)
++ oobavail += oobinfo.oobfree[i][1];
++
++ if (!oobavail)
+ return errmsg(" Eeep. Autoplacement selected and no empty space in oob");
++
++ /* Get the position of the free bytes */
+ clmpos = oobinfo.oobfree[0][0];
+- clmlen = oobinfo.oobfree[0][1];
+- if (clmlen > 8)
+- clmlen = 8;
++ clmlen = MIN(oobavail, 8);
++
++ if (oobinfo.oobfree[0][1] < 8 && oobavail >= 8) {
++ int left, n, last = 0;
++ void *cm;
++
++ oob_data = malloc(mtd.oob_size);
++ if (!oob_data)
++ return -ENOMEM;
++
++ memset(oob_data, 0xff, mtd.oob_size);
++ cm = &cleanmarker;
++ for (i = 0, left = clmlen; left ; i++) {
++ n = MIN(left, oobinfo.oobfree[i][1]);
++ memcpy(oob_data + oobinfo.oobfree[i][0],
++ cm, n);
++ left -= n;
++ cm += n;
++ last = oobinfo.oobfree[i][0] + n;
++ }
++
++ clmlen = last - clmpos;
++ }
+ } else {
+ /* Legacy mode */
+ switch (mtd.oob_size) {
+@@ -227,7 +256,6 @@ int main(int argc, char *argv[])
+ break;
+ }
+ }
+- cleanmarker.totlen = cpu_to_je32(8);
+ }
+ cleanmarker.hdr_crc = cpu_to_je32(mtd_crc32(0, &cleanmarker, sizeof(cleanmarker) - 4));
+ }
+@@ -276,7 +304,8 @@ int main(int argc, char *argv[])
+
+ /* write cleanmarker */
+ if (isNAND) {
+- if (mtd_write_oob(mtd_desc, &mtd, fd, (uint64_t)offset + clmpos, clmlen, &cleanmarker) != 0) {
++ void *data = oob_data ? oob_data + clmpos : &cleanmarker;
++ if (mtd_write_oob(mtd_desc, &mtd, fd, (uint64_t)offset + clmpos, clmlen, data) != 0) {
+ sys_errmsg("%s: MTD writeoob failure", mtd_device);
+ continue;
+ }
+@@ -291,5 +320,8 @@ int main(int argc, char *argv[])
+ show_progress(&mtd, offset, eb, eb_start, eb_cnt);
+ bareverbose(!quiet, "\n");
+
++ if (oob_data)
++ free(oob_data);
++
+ return 0;
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils_git.bb
new file mode 100644
index 000000000..cd9ae06ce
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils_git.bb
@@ -0,0 +1,46 @@
+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"
+
+DEPENDS = "zlib lzo e2fsprogs util-linux"
+
+PV = "1.5.2"
+
+SRCREV = "aea36417067dade75192bafa03af70b6eb2677b1"
+SRC_URI = "git://git.infradead.org/mtd-utils.git \
+ file://add-exclusion-to-mkfs-jffs2-git-2.patch \
+ file://fix-armv7-neon-alignment.patch \
+ file://mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch \
+ file://0001-Fix-build-with-musl.patch \
+"
+
+SRC_URI_append_libc-musl = " file://010-fix-rpmatch.patch "
+
+S = "${WORKDIR}/git/"
+
+# 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.contains('DISTRO_FEATURES', 'xattr', 'xattr', '', d)}"
+PACKAGECONFIG[xattr] = ",,acl,"
+
+EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} ${@bb.utils.contains('PACKAGECONFIG', 'xattr', '', '-DWITHOUT_XATTR', d)} -I${S}/include' '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"
+
+BBCLASSEXTEND = "native"
+
+# 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/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/fix-broken-lz.patch b/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/fix-broken-lz.patch
new file mode 100644
index 000000000..cb454917f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/fix-broken-lz.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Backport
+
+Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com>
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ Makefile.in | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Makefile.in b/Makefile.in
+index 8f9305a..694e837 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -251,6 +251,7 @@ install-scripts: ${DESTDIR}$(bindir)/mtools
+ @$(top_srcdir)/mkinstalldirs ${DESTDIR}$(bindir)
+ @for j in $(SCRIPTS) ; do \
+ $(INSTALL_SCRIPT) $(srcdir)/scripts/$$j ${DESTDIR}$(bindir)/$$j ; \
++ $(INSTALL_PROGRAM) $(srcdir)/scripts/$$j ${DESTDIR}$(bindir)/$$j ; \
+ echo ${DESTDIR}$(bindir)/$$j ; \
+ done
+ rm -f ${DESTDIR}$(bindir)/lz
+--
+2.0.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/mtools-makeinfo.patch b/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/mtools-makeinfo.patch
new file mode 100644
index 000000000..2e2873a4f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/mtools-makeinfo.patch
@@ -0,0 +1,65 @@
+Upstream-Status: Inappropriate [licensing]
+
+--- mtools-3.9.9/configure.in.orig 2006-04-14 16:05:54.337655192 -0600
++++ mtools-3.9.9/configure.in 2006-04-14 16:12:29.736545424 -0600
+@@ -21,6 +21,33 @@
+ 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
+--- mtools-3.9.9/Makefile.in.sav 2006-04-14 15:56:19.000000000 -0600
++++ mtools-3.9.9/Makefile.in 2006-04-14 16:15:29.315245312 -0600
+@@ -11,10 +11,11 @@
+ 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
+@@ -181,7 +182,7 @@
+
+ ps: mtools.ps
+ %.ps: %.dvi
+- dvips -f < $< > $@
++ $(DVI2PS) -f < $< > $@
+
+ pdf: mtools.pdf
+ %.pdf: %.texi
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/mtools.patch b/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/mtools.patch
new file mode 100644
index 000000000..15a32088d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/mtools.patch
@@ -0,0 +1,129 @@
+$NetBSD: patch-aa,v 1.10 2007/08/17 20:55:34 joerg Exp $
+
+---
+ Makefile.in | 74 ++++++++++++++++++++++++++----------------------------------
+ 1 file changed, 33 insertions(+), 41 deletions(-)
+
+Upstream-Status: Inappropriate [licensing]
+
+Index: mtools-3.9.9/Makefile.in
+===================================================================
+--- mtools-3.9.9.orig/Makefile.in 2007-10-12 11:18:46.000000000 +0100
++++ mtools-3.9.9/Makefile.in 2007-10-12 11:28:14.000000000 +0100
+@@ -195,30 +195,22 @@ html: mtools.html mtools_toc.html
+
+ # Don't cd, to avoid breaking install-sh references.
+ install-info: info
+- $(top_srcdir)/mkinstalldirs $(infodir)
++ $(top_srcdir)/mkinstalldirs ${DESTDIR}$(infodir)
+ if test -f mtools.info; then \
+ for i in mtools.info*; do \
+- $(INSTALL_DATA) $$i $(infodir)/$$i; \
++ $(INSTALL_DATA) $$i ${DESTDIR}$(infodir)/$$i; \
+ done; \
+ else \
+ for i in $(srcdir)/mtools.info*; do \
+- $(INSTALL_DATA) $$i $(infodir)/`echo $$i | sed 's|^$(srcdir)/||'`; \
++ $(INSTALL_DATA) $$i ${DESTDIR}$(infodir)/`echo $$i | sed 's|^$(srcdir)/||'`; \
+ done; \
+ fi; \
+- if [ -n "$(INSTALL_INFO)" ] ; then \
+- if [ -f $(infodir)/dir.info ] ; then \
+- $(INSTALL_INFO) $(infodir)/mtools.info $(infodir)/dir.info; \
+- fi; \
+- if [ -f $(infodir)/dir ] ; then \
+- $(INSTALL_INFO) $(infodir)/mtools.info $(infodir)/dir; \
+- fi; \
+- fi
+
+ uninstall-info:
+ cd $(infodir) && rm -f mtools.info*
+
+-install: $(bindir)/mtools @BINFLOPPYD@ install-man install-links \
+- $(bindir)/mkmanifest install-scripts install-info
++install: ${DESTDIR}$(bindir)/mtools ${DESTDIR}$(bindir)/floppyd install-man install-links \
++ ${DESTDIR}$(bindir)/mkmanifest install-scripts install-info
+
+ uninstall: uninstall-bin uninstall-man uninstall-links \
+ uninstall-scripts
+@@ -228,52 +220,52 @@ distclean: clean texclean
+ maintainer-clean: distclean
+
+
+-$(bindir)/floppyd: floppyd
+- $(top_srcdir)/mkinstalldirs $(bindir)
+- $(INSTALL_PROGRAM) floppyd $(bindir)/floppyd
++${DESTDIR}$(bindir)/floppyd: floppyd
++ $(top_srcdir)/mkinstalldirs ${DESTDIR}$(bindir)
++ $(INSTALL_PROGRAM) floppyd ${DESTDIR}$(bindir)/floppyd
+
+-$(bindir)/floppyd_installtest: floppyd_installtest
+- $(top_srcdir)/mkinstalldirs $(bindir)
+- $(INSTALL_PROGRAM) floppyd_installtest $(bindir)/floppyd_installtest
++${DESTDIR}$(bindir)/floppyd_installtest: floppyd_installtest
++ $(top_srcdir)/mkinstalldirs ${DESTDIR}$(bindir)
++ $(INSTALL_PROGRAM) floppyd_installtest ${DESTDIR}$(bindir)/floppyd_installtest
+
+-$(bindir)/mtools: mtools
+- $(top_srcdir)/mkinstalldirs $(bindir)
+- $(INSTALL_PROGRAM) mtools $(bindir)/mtools
++${DESTDIR}$(bindir)/mtools: mtools
++ $(top_srcdir)/mkinstalldirs ${DESTDIR}$(bindir)
++ $(INSTALL_PROGRAM) mtools ${DESTDIR}$(bindir)/mtools
+
+-$(bindir)/mkmanifest: mkmanifest
+- $(top_srcdir)/mkinstalldirs $(bindir)
+- $(INSTALL_PROGRAM) mkmanifest $(bindir)/mkmanifest
++${DESTDIR}$(bindir)/mkmanifest: mkmanifest
++ $(top_srcdir)/mkinstalldirs ${DESTDIR}$(bindir)
++ $(INSTALL_PROGRAM) mkmanifest ${DESTDIR}$(bindir)/mkmanifest
+
+ #$(ETCDIR)/mtools: mtools.etc
+ # cp mtools.etc $(ETCDIR)/mtools
+
+-install-links: $(bindir)/mtools
++install-links: ${DESTDIR}$(bindir)/mtools
+ @for j in $(LINKS); do \
+- rm -f $(bindir)/$$j ; \
+- $(LN_S) mtools $(bindir)/$$j ; \
+- echo $(bindir)/$$j ; \
++ rm -f ${DESTDIR}$(bindir)/$$j ; \
++ $(LN_S) mtools ${DESTDIR}$(bindir)/$$j ; \
++ echo ${DESTDIR}$(bindir)/$$j ; \
+ done
+
+ ## "z" is the older version of "gz"; the name is just *too* short
+-install-scripts: $(bindir)/mtools
+- @$(top_srcdir)/mkinstalldirs $(bindir)
++install-scripts: ${DESTDIR}$(bindir)/mtools
++ @$(top_srcdir)/mkinstalldirs ${DESTDIR}$(bindir)
+ @for j in $(SCRIPTS) ; do \
+- $(INSTALL_PROGRAM) $(srcdir)/scripts/$$j $(bindir)/$$j ; \
+- echo $(bindir)/$$j ; \
++ $(INSTALL_SCRIPT) $(srcdir)/scripts/$$j ${DESTDIR}$(bindir)/$$j ; \
++ echo ${DESTDIR}$(bindir)/$$j ; \
+ done
+- rm -f $(bindir)/lz
+- $(LN_S) uz $(bindir)/lz
++ rm -f ${DESTDIR}$(bindir)/lz
++ $(LN_S) uz ${DESTDIR}$(bindir)/lz
+
+ install-man:
+- @$(top_srcdir)/mkinstalldirs $(MAN1DIR)
++ @$(top_srcdir)/mkinstalldirs ${DESTDIR}$(MAN1DIR)
+ @for j in $(MAN1); do \
+- $(INSTALL_DATA) $(srcdir)/$$j $(MAN1DIR)/$$j ; \
+- echo $(MAN1DIR)/$$j ; \
++ $(INSTALL_DATA) $(srcdir)/$$j ${DESTDIR}$(MAN1DIR)/$$j ; \
++ echo ${DESTDIR}$(MAN1DIR)/$$j ; \
+ done
+- @$(top_srcdir)/mkinstalldirs $(MAN5DIR)
++ @$(top_srcdir)/mkinstalldirs ${DESTDIR}$(MAN5DIR)
+ @for j in $(MAN5); do \
+- $(INSTALL_DATA) $(srcdir)/$$j $(MAN5DIR)/$$j ; \
+- echo $(MAN5DIR)/$$j ; \
++ $(INSTALL_DATA) $(srcdir)/$$j ${DESTDIR}$(MAN5DIR)/$$j ; \
++ echo ${DESTDIR}$(MAN5DIR)/$$j ; \
+ done
+
+ uninstall-bin:
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/no-x11.gplv3.patch b/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/no-x11.gplv3.patch
new file mode 100644
index 000000000..9cb3e39f5
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/no-x11.patch b/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/no-x11.patch
new file mode 100644
index 000000000..705b62944
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/no-x11.patch
@@ -0,0 +1,21 @@
+---
+ Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Upstream-Status: Inappropriate [licensing]
+
+--- mtools-3.9.9.orig/Makefile.in
++++ mtools-3.9.9/Makefile.in
+@@ -128,11 +128,11 @@ X_EXTRA_LIBS = @X_EXTRA_LIBS@
+ X_PRE_LIBS = @X_PRE_LIBS@
+ CFLAGS = $(CPPFLAGS) $(DEFS) $(MYCFLAGS) -I. @extraincludedir@ -I@srcdir@ $(USERCFLAGS)
+ 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) $(X_PRE_LIBS) -lXau -lX11 $(LIBS)
++X_LDFLAGS = $(X_EXTRA_LIBS) $(X_LIBS) $(X_PRE_LIBS) $(LIBS)
+ X_CCFLAGS = $(X_CFLAGS) $(CFLAGS)
+
+ all: mtools $(LINKS) mkmanifest @FLOPPYD@
+
+ %.o: %.c
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools_3.9.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools_3.9.9.bb
new file mode 100644
index 000000000..3423917d0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools_3.9.9.bb
@@ -0,0 +1,53 @@
+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 = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=92b58ec77696788ce278b044d2a8e9d3"
+PR = "r6"
+
+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] = "3e68b857b4e1f3a6521d1dfefbd30a36"
+SRC_URI[sha256sum] = "af083a73425d664d4607ef6c6564fd9319a0e47ee7c105259a45356cb834690e"
+
+#http://mtools.linux.lu/mtools-${PV}.tar.gz
+SRC_URI = "http://downloads.yoctoproject.org/mirror/sources/mtools-${PV}.tar.gz \
+ file://mtools-makeinfo.patch \
+ file://mtools.patch \
+ file://no-x11.patch \
+ file://fix-broken-lz.patch"
+
+inherit autotools texinfo
+
+EXTRA_OECONF = "--without-x"
+
+LDFLAGS_append_libc-uclibc = " -liconv "
+
+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/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools_4.0.18.bb b/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools_4.0.18.bb
new file mode 100644
index 000000000..efde547e2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools_4.0.18.bb
@@ -0,0 +1,50 @@
+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"
+
+
+inherit autotools texinfo
+
+EXTRA_OECONF = "--without-x"
+
+LDFLAGS_append_libc-uclibc = " -liconv "
+
+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/import-layers/yocto-poky/meta/recipes-devtools/nasm/nasm_2.11.08.bb b/import-layers/yocto-poky/meta/recipes-devtools/nasm/nasm_2.11.08.bb
new file mode 100644
index 000000000..e0724e68a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/nasm/nasm_2.11.08.bb
@@ -0,0 +1,30 @@
+SUMMARY = "General-purpose x86 assembler"
+SECTION = "devel"
+LICENSE = "BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=90904486f8fbf1861cf42752e1a39efe"
+COMPATIBLE_HOST = '(x86_64|i.86).*-(linux|freebsd.*)'
+
+
+SRC_URI = "http://www.nasm.us/pub/nasm/releasebuilds/${PV}/nasm-${PV}.tar.bz2 "
+
+SRC_URI[md5sum] = "7aae5cb8e03fac48029c82a7470ab066"
+SRC_URI[sha256sum] = "9da3a0291a0bdc06305b7ba194f1e2c2b55ae6f11210b4af43729868149d5445"
+
+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/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/fix-regex.patch b/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/fix-regex.patch
new file mode 100644
index 000000000..6b40afdad
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/fix-regex.patch
@@ -0,0 +1,32 @@
+From 55f6fd8f1958aa36584eefeecce782a505963c88 Mon Sep 17 00:00:00 2001
+From: benvm <benvm@yow-gmoffatt-lx2.wrs.com>
+Date: Wed, 9 Jan 2013 12:14:06 -0500
+Subject: [PATCH] Fix Makefile regular expression
+
+This patch modifies a regular expression within a Makefile to stop builds
+from failing in the case where the path contains the characters ".a".
+
+Upstream-Status: Submitted
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+---
+ Makefile.prog.in | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/Makefile.prog.in b/Makefile.prog.in
+index 76310c9..44c3534 100644
+--- a/Makefile.prog.in
++++ b/Makefile.prog.in
+@@ -12,7 +12,7 @@ LINKFLAGS = @LINKFLAGS@
+
+ ALL_LIBS = $(XLIBS) $(LIBS)
+ Makefile.lt:
+- echo 'LT_LIBS='`echo $(ALL_LIBS)|sed 's/\.a/.la/g'` >Makefile.lt
++ echo 'LT_LIBS='`echo $(ALL_LIBS) | sed 's/\.a\s/\.la /g' | sed s/\.a$$/\.la/` > Makefile.lt
+
+ PROG:=$(shell echo "$(PROG)" | sed '@program_transform_name@')
+
+--
+1.7.0.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/makefile.patch b/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/makefile.patch
new file mode 100644
index 000000000..968b9b47c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/makefile.patch
@@ -0,0 +1,39 @@
+This patch fixes libtool QA issues with WORKDIR creeping in to
+libospgrove.la and libostyle.la. Patch obtained from OpenEmbedded.
+
+Upstream-Status: Inappropriate [Other]
+Workaround is specific to our build system.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+Index: openjade-1.3.2/spgrove/Makefile.sub
+===================================================================
+--- openjade-1.3.2.orig/spgrove/Makefile.sub
++++ openjade-1.3.2/spgrove/Makefile.sub
+@@ -1,8 +1,8 @@
+ LTVERSION=0:1:0
+ LIB=ospgrove
+ INCLUDE=-I$(srcdir)/../grove
+-DEPLIBS=-lm -L$(TOP)/grove -L$(TOP)/grove/.libs \
+- -L$(TOP)/lib -L$(TOP)/lib/.libs \
++DEPLIBS=-lm $(TOP)/grove \
++ $(TOP)/lib \
+ $(LIB_THREADS)
+ OBJS=GroveApp.o GroveBuilder.o SdNode.o
+ GENSRCS=grove_inst.cxx
+Index: openjade-1.3.2/style/Makefile.sub
+===================================================================
+--- openjade-1.3.2.orig/style/Makefile.sub
++++ openjade-1.3.2/style/Makefile.sub
+@@ -1,8 +1,8 @@
+ LTVERSION=0:1:0
+ LIB=ostyle
+-DEPLIBS=-lm -L$(TOP)/grove -L$(TOP)/grove/.libs \
+- -L$(TOP)/lib -L$(TOP)/lib/.libs \
+- -L$(TOP)/spgrove -L$(TOP)/spgrove/.libs
++DEPLIBS=-lm $(TOP)/grove \
++ $(TOP)/lib \
++ $(TOP)/spgrove
+ OBJS=LangObj.o \
+ Collector.o \
+ DssslApp.o \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/msggen.pl.patch b/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/msggen.pl.patch
new file mode 100644
index 000000000..b47fd4655
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/msggen.pl.patch
@@ -0,0 +1,44 @@
+commit fcc5b94f118495b1a467edcda6c6f631691c3f69
+Author: Dennis Lan <dennis.yxun@gmail.com>
+Date: Tue Jul 3 09:25:42 2012 +0800
+
+ openjade: fix undefined Getopts error, use std namespace
+
+ Using Gentoo Linux as the build host, it fails without this patch
+ Use Getopt::Std in place of getopts.pl.
+
+ Upstream-Status: Inappropriate [no upstream]
+ Original-Author-By: Mike Gilbert <floppym@gentoo.org>
+ Signed-off-by: Dennis Lan <dennis.yxun@gmail.com>
+
+diff --git a/msggen.pl b/msggen.pl
+index 0c33968..2ee3f66 100644
+--- a/msggen.pl
++++ b/msggen.pl
+@@ -4,6 +4,7 @@
+ # See the file COPYING for copying permission.
+
+ use POSIX;
++use Getopt::Std;
+
+ # Package and version.
+ $package = 'openjade';
+@@ -18,8 +19,7 @@ $gen_c = 0;
+ undef $opt_l;
+ undef $opt_p;
+ undef $opt_t;
+-do 'getopts.pl';
+-&Getopts('l:p:t:');
++getopts('l:p:t:');
+ $module = $opt_l;
+ $pot_file = $opt_p;
+
+@@ -72,7 +72,7 @@ while (<DEF>) {
+ else {
+ $field[0] =~ /^[IWQXE][0-9]$/ || &error("invalid first field");;
+ $type[$num] = substr($field[0], 0, 1);
+- $argc = int(substr($field[0], 1, 1));
++ $argc = substr($field[0], 1, 1);
+ }
+ $nargs[$num] = $argc;
+ $field[1] =~ /^[a-zA-Z_][a-zA-Z0-9_]+$/ || &error("invalid tag");
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/no-libtool.patch b/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/no-libtool.patch
new file mode 100644
index 000000000..2f57c000f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/no-libtool.patch
@@ -0,0 +1,20 @@
+The openjade build is fairly unique in auto-generating explicit dependencies to
+installed .la files. As some distributions may delete these files unless
+clearly required, change the Makefile fragment to depend on the .so instead.
+
+Patch originally by Phil Blundell <philb@brightsign.biz>.
+
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+Upstream-Status: Inappropriate
+
+--- openjade-1.3.2/Makefile.prog.in~ 2013-05-14 11:42:02.646782318 +0100
++++ openjade-1.3.2/Makefile.prog.in 2013-05-14 11:54:55.051728343 +0100
+@@ -12,7 +12,7 @@
+
+ ALL_LIBS = $(XLIBS) $(LIBS)
+ Makefile.lt:
+- echo 'LT_LIBS='`echo $(ALL_LIBS) | sed 's/\.a\s/\.la /g' | sed s/\.a$$/\.la/` > Makefile.lt
++ echo 'LT_LIBS='`for d in $(ALL_LIBS); do case $$d in ../*) echo $$d | sed s/\.a$$/.la/g ;; *) echo $$d | sed s/\.a$$/.so/g ;; esac ; done` >Makefile.lt
+
+ PROG:=$(shell echo "$(PROG)" | sed '@program_transform_name@')
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/reautoconf.patch b/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/reautoconf.patch
new file mode 100644
index 000000000..1a23a4a68
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/reautoconf.patch
@@ -0,0 +1,83 @@
+Ensure we reautoconf the packag
+
+Currently since configure.in in is in a subdirectory, we don't reautoconf the
+recipe. We really need to do this, to update things like the libtool script used
+and fix various issues such as those that could creep in if a reautoconf is
+triggered for some reason. Since this source only calls AM_INIT_AUTOMAKE to
+gain the PACKAGE and VERSION definitions and that macro now errors if Makefile.am
+doesn't exist, we need to add these definitions manually.
+
+These changes avoid failures like:
+----
+| ...
+| DssslApp.cxx:117:36: error: 'PACKAGE' was not declared in this scope
+| DssslApp.cxx:118:36: error: 'VERSION' was not declared in this scope
+| make[2]: *** [DssslApp.lo] Error 1 ----
+
+Upstream-Status: Pending
+
+RP 2012/6/12
+
+Index: openjade-1.3.2/acinclude.m4
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ openjade-1.3.2/acinclude.m4 2012-06-12 12:48:54.871365344 +0000
+@@ -0,0 +1,39 @@
++dnl Configure-time switch with default
++dnl
++dnl Each switch defines an --enable-FOO and --disable-FOO option in
++dnl the resulting configure script.
++dnl
++dnl Usage:
++dnl smr_SWITCH(name, description, default, pos-def, neg-def)
++dnl
++dnl where:
++dnl
++dnl name name of switch; generates --enable-name & --disable-name
++dnl options
++dnl description help string is set to this prefixed by "enable" or
++dnl "disable", whichever is the non-default value
++dnl default either "on" or "off"; specifies default if neither
++dnl --enable-name nor --disable-name is specified
++dnl pos-def a symbol to AC_DEFINE if switch is on (optional)
++dnl neg-def a symbol to AC_DEFINE if switch is off (optional)
++dnl
++AC_DEFUN(smr_SWITCH, [
++ AC_MSG_CHECKING(whether to enable $2)
++ AC_ARG_ENABLE(
++ $1,
++ ifelse($3, on,
++ [ --disable-[$1] disable [$2]],
++ [ --enable-[$1] enable [$2]]),
++ [ if test "$enableval" = yes; then
++ AC_MSG_RESULT(yes)
++ ifelse($4, , , AC_DEFINE($4))
++ else
++ AC_MSG_RESULT(no)
++ ifelse($5, , , AC_DEFINE($5))
++ fi ],
++ ifelse($3, on,
++ [ AC_MSG_RESULT(yes)
++ ifelse($4, , , AC_DEFINE($4)) ],
++ [ AC_MSG_RESULT(no)
++ ifelse($5, , , AC_DEFINE($5))]))])
++
+Index: openjade-1.3.2/config/configure.in
+===================================================================
+--- openjade-1.3.2.orig/config/configure.in 2012-06-12 12:47:20.735365445 +0000
++++ openjade-1.3.2/config/configure.in 2012-06-12 12:48:17.507364080 +0000
+@@ -12,9 +12,12 @@
+ dnl Credits: this autoconf script was largely "inspired" <g> by the
+ dnl autoconf script around SP made by Henry Thompson.
+ dnl
+-AC_INIT(dsssl)
++AC_INIT([openjade], [1.3.2])
+ AC_CONFIG_AUX_DIR(config)
+-AM_INIT_AUTOMAKE( openjade, 1.3.2)
++AC_SUBST([PACKAGE], [openjade])
++AC_SUBST([VERSION], [1.3.2])
++AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
++AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
+ TOP=`pwd`
+ AC_SUBST(TOP)
+ dnl
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/user-declared-default-constructor.patch b/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/user-declared-default-constructor.patch
new file mode 100644
index 000000000..073af46fc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/user-declared-default-constructor.patch
@@ -0,0 +1,92 @@
+In GCC 4.6 the compiler no longer allows objects of const-qualified type to
+be default initialized unless the type has a user-declared default
+constructor.
+
+Patch from Gentoo bugzilla: http://bugs.gentoo.org/show_bug.cgi?id=358021
+
+Gentoo Bugzilla description follows:
+"If a class or struct has no user-defined default constructor, C++ doesn't
+allow you to default construct a const instance of it.
+
+https://bugs.gentoo.org/358021
+http://clang.llvm.org/compatibility.html#default_init_const
+http://gcc.gnu.org/PR44499"
+
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- a/jade/TeXFOTBuilder.cxx
++++ b/jade/TeXFOTBuilder.cxx
+@@ -88,6 +88,8 @@ public:
+ value.convertString(nic_.placement);
+ }
+ ExtensionFlowObj *copy() const { return new PageFloatFlowObj(*this); }
++ public:
++ PageFloatFlowObj() {}
+ private:
+ PageFloatNIC nic_;
+ StringC name_;
+@@ -101,6 +103,8 @@ public:
+ fotb.endPageFootnote();
+ }
+ ExtensionFlowObj *copy() const { return new PageFootnoteFlowObj(*this); }
++ public:
++ PageFootnoteFlowObj() {}
+ private:
+ };
+ //////////////////////////////////////////////////////////////////////
+--- a/jade/TransformFOTBuilder.cxx
++++ b/jade/TransformFOTBuilder.cxx
+@@ -41,6 +41,7 @@ public:
+ };
+ class EntityRefFlowObj : public TransformExtensionFlowObj {
+ public:
++ EntityRefFlowObj() {}
+ void atomic(TransformFOTBuilder &fotb, const NodePtr &) const {
+ fotb.entityRef(name_);
+ }
+@@ -56,6 +57,7 @@ public:
+ };
+ class ProcessingInstructionFlowObj : public TransformExtensionFlowObj {
+ public:
++ ProcessingInstructionFlowObj() {}
+ void atomic(TransformFOTBuilder &fotb, const NodePtr &) const {
+ fotb.processingInstruction(data_);
+ }
+@@ -98,6 +100,8 @@ public:
+ }
+ }
+ ExtensionFlowObj *copy() const { return new EmptyElementFlowObj(*this); }
++ public:
++ EmptyElementFlowObj() {}
+ private:
+ ElementNIC nic_;
+ };
+@@ -133,6 +137,8 @@ public:
+ }
+ }
+ ExtensionFlowObj *copy() const { return new ElementFlowObj(*this); }
++ public:
++ ElementFlowObj() {}
+ private:
+ ElementNIC nic_;
+ };
+@@ -150,6 +156,8 @@ public:
+ value.convertString(systemId_);
+ }
+ ExtensionFlowObj *copy() const { return new EntityFlowObj(*this); }
++ public:
++ EntityFlowObj() {}
+ private:
+ StringC systemId_;
+ };
+@@ -174,6 +182,8 @@ public:
+ }
+ }
+ ExtensionFlowObj *copy() const { return new DocumentTypeFlowObj(*this); }
++ public:
++ DocumentTypeFlowObj() {}
+ private:
+ DocumentTypeNIC nic_;
+ };
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-native_1.3.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-native_1.3.2.bb
new file mode 100644
index 000000000..bc250080f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-native_1.3.2.bb
@@ -0,0 +1,121 @@
+SUMMARY = "Tools for working with DSSSL stylesheets for SGML and XML documents"
+DESCRIPTION = "OpenJade is a suite of tools for validating, \
+processing, and applying DSSSL (Document Style Semantics and \
+Specification Language) stylesheets to SGML and XML documents."
+HOMEPAGE = "http://openjade.sourceforge.net"
+SECTION = "base"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=641ff1e4511f0a87044ad42f87cb1045"
+
+PR = "r5"
+
+DEPENDS = "opensp-native sgml-common-native"
+RDEPENDS_${PN} = "sgml-common-native"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/openjade/openjade-${PV}.tar.gz \
+ file://makefile.patch \
+ file://msggen.pl.patch \
+ file://reautoconf.patch \
+ file://user-declared-default-constructor.patch \
+ file://fix-regex.patch \
+ file://no-libtool.patch"
+
+SRC_URI[md5sum] = "7df692e3186109cc00db6825b777201e"
+SRC_URI[sha256sum] = "1d2d7996cc94f9b87d0c51cf0e028070ac177c4123ecbfd7ac1cb8d0b7d322d1"
+
+UPSTREAM_CHECK_URI = "http://openjade.sourceforge.net/download.html"
+
+inherit autotools-brokensep native
+
+# Statically link local libs to avoid gold link issue [YOCTO #2972]
+PACKAGECONFIG ?= "static-only-libs"
+PACKAGECONFIG[static-only-libs] = "--enable-static --disable-shared,--enable-static --enable-shared,,"
+
+EXTRA_OECONF = "--enable-spincludedir=${STAGING_INCDIR}/OpenSP \
+ --enable-splibdir=${STAGING_LIBDIR}"
+
+# We need to set datadir explicitly, but adding it to EXTRA_OECONF
+# results in it being specified twice when configure is run.
+CONFIGUREOPTS := "${@d.getVar('CONFIGUREOPTS', True).replace('--datadir=${datadir}', '--datadir=${STAGING_DATADIR}/sgml/openjade-${PV}')}"
+
+# CONFIGUREOPTS has hard coded paths so we need to ignore it's vardeps
+# there are other bits in there too but they are picked up by other variable
+# dependencies so it all works out
+oe_runconf[vardepsexclude] += "CONFIGUREOPTS"
+
+CFLAGS =+ "-I${S}/include"
+
+SSTATEPOSTINSTFUNCS += "openjade_sstate_postinst"
+SYSROOT_PREPROCESS_FUNCS += "openjade_sysroot_preprocess"
+CLEANFUNCS += "openjade_sstate_clean"
+
+# configure.in needs to be reloacted to trigger reautoconf
+do_extraunpack () {
+ cp ${S}/config/configure.in ${S}/
+}
+addtask extraunpack after do_patch before do_configure
+
+# We need to do this else the source interdependencies aren't generated and
+# build failures can result (e.g. zero size style/Makefile.dep file)
+do_compile_prepend () {
+ oe_runmake depend
+}
+
+do_install() {
+ # Refer to http://www.linuxfromscratch.org/blfs/view/stable/pst/openjade.html
+ # for details.
+ install -d ${D}${bindir} ${D}${libdir}
+ if ${@bb.utils.contains('PACKAGECONFIG', 'static-only-libs', 'true', 'false', d)}; then
+ install -m 0755 jade/openjade ${D}${bindir}/openjade
+ oe_libinstall -a -C style libostyle ${D}${libdir}
+ oe_libinstall -a -C spgrove libospgrove ${D}${libdir}
+ oe_libinstall -a -C grove libogrove ${D}${libdir}
+ else
+ install -m 0755 jade/.libs/openjade ${D}${bindir}/openjade
+ oe_libinstall -a -so -C style libostyle ${D}${libdir}
+ oe_libinstall -a -so -C spgrove libospgrove ${D}${libdir}
+ oe_libinstall -a -so -C grove libogrove ${D}${libdir}
+ fi
+ ln -sf openjade ${D}${bindir}/jade
+
+ install -d ${D}${datadir}/sgml/openjade-${PV}
+ install -m 644 dsssl/catalog ${D}${datadir}/sgml/openjade-${PV}
+ install -m 644 dsssl/*.dtd ${D}${datadir}/sgml/openjade-${PV}
+ install -m 644 dsssl/*.dsl ${D}${datadir}/sgml/openjade-${PV}
+ install -m 644 dsssl/*.sgm ${D}${datadir}/sgml/openjade-${PV}
+
+ install -d ${datadir}/sgml/openjade-${PV}
+ install -m 644 dsssl/catalog ${datadir}/sgml/openjade-${PV}/catalog
+
+ install -d ${D}${sysconfdir}/sgml
+ echo "CATALOG ${datadir}/sgml/openjade-${PV}/catalog" > \
+ ${D}${sysconfdir}/sgml/openjade-${PV}.cat
+}
+
+openjade_sstate_postinst() {
+ if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
+ then
+ # Ensure that the catalog file sgml-docbook.cat is properly
+ # updated when the package is installed from sstate cache.
+ ${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-openjade \
+ --add ${sysconfdir}/sgml/sgml-docbook.bak \
+ ${sysconfdir}/sgml/openjade-${PV}.cat
+ ${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-openjade \
+ --add ${sysconfdir}/sgml/sgml-docbook.cat \
+ ${sysconfdir}/sgml/openjade-${PV}.cat
+ fi
+}
+
+openjade_sysroot_preprocess () {
+ install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
+ install -m 755 ${STAGING_BINDIR_NATIVE}/install-catalog ${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-openjade
+}
+
+openjade_sstate_clean () {
+ # Ensure that the catalog file sgml-docbook.cat is properly
+ # updated when the package is removed from sstate cache.
+ files="${sysconfdir}/sgml/sgml-docbook.bak ${sysconfdir}/sgml/sgml-docbook.cat"
+ for f in $files; do
+ [ ! -f $f ] || sed -i '/\/sgml\/openjade-${PV}.cat/d' $f
+ done
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opensp/opensp-1.5.2/obsolete_automake_macros.patch b/import-layers/yocto-poky/meta/recipes-devtools/opensp/opensp-1.5.2/obsolete_automake_macros.patch
new file mode 100644
index 000000000..42218a6d6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opensp/opensp-1.5.2/obsolete_automake_macros.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Submitted [https://sourceforge.net/tracker/?func=detail&aid=3599291&group_id=2115&atid=102115]
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+diff -Nurd OpenSP-1.5.2/configure.in OpenSP-1.5.2/configure.in
+--- OpenSP-1.5.2/configure.in 2005-12-23 16:15:21.000000000 +0200
++++ OpenSP-1.5.2/configure.in 2013-01-03 09:04:51.922645689 +0200
+@@ -16,7 +16,7 @@
+ AM_INIT_AUTOMAKE(OpenSP, 1.5.2, no-define)
+ AM_MAINTAINER_MODE
+ AC_PREREQ(2.53)
+-AM_CONFIG_HEADER(config.h)
++AC_CONFIG_HEADERS(config.h)
+ AM_SANITY_CHECK
+
+ dnl Autoheader definitions
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opensp/opensp_1.5.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/opensp/opensp_1.5.2.bb
new file mode 100644
index 000000000..60a7d2e47
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opensp/opensp_1.5.2.bb
@@ -0,0 +1,59 @@
+SUMMARY = "An SGML parser"
+DESCRIPTION = "An SGML parser used by the OpenJade suite of utilities."
+HOMEPAGE = "http://openjade.sourceforge.net"
+SECTION = "libs"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=641ff1e4511f0a87044ad42f87cb1045"
+
+PR = "r1"
+
+# At -Os it encounters calls to some inline functions which are then
+# not found in any other objects with gcc 4.5
+FULL_OPTIMIZATION += "-O2"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/openjade/OpenSP-${PV}.tar.gz \
+ file://obsolete_automake_macros.patch \
+"
+
+SRC_URI[md5sum] = "670b223c5d12cee40c9137be86b6c39b"
+SRC_URI[sha256sum] = "57f4898498a368918b0d49c826aa434bb5b703d2c3b169beb348016ab25617ce"
+
+S = "${WORKDIR}/OpenSP-${PV}"
+
+inherit autotools gettext
+
+EXTRA_OECONF = "--disable-doc-build"
+
+EXTRA_OECONF_class-native = "\
+ --disable-doc-build \
+ --enable-default-catalog=${sysconfdir}/sgml/catalog \
+ --enable-default-search-path=${datadir}/sgml \
+ "
+
+do_install_append() {
+ # Set up symlinks to often-used alternate names. See
+ # http://www.linuxfromscratch.org/blfs/view/stable/pst/opensp.html
+ cd ${D}${libdir}
+ ln -sf libosp.so libsp.so
+
+ cd ${D}${bindir}
+ for util in nsgmls sgmlnorm spam spcat spent sx; do
+ ln -sf o$util $util
+ done
+ ln -sf osx sgml2xml
+}
+
+do_install_append_class-native() {
+ for util in nsgmls sgmlnorm spam spcat spent sx; do
+ create_cmdline_wrapper ${D}/${bindir}/$util \
+ -D ${sysconfdir}/sgml
+ done
+}
+
+FILES_${PN} += "${datadir}/OpenSP/"
+
+BBCLASSEXTEND = "native"
+
+# http://errors.yoctoproject.org/Errors/Details/20489/
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-opkg-build-re-do-find-ls-code-to-not-fail-on-filenam.patch b/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-opkg-build-re-do-find-ls-code-to-not-fail-on-filenam.patch
new file mode 100644
index 000000000..5cbb55a7d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-opkg-build-re-do-find-ls-code-to-not-fail-on-filenam.patch
@@ -0,0 +1,56 @@
+From 8e424296ce2af4a5a7392c38a31f8723f9b9fbda Mon Sep 17 00:00:00 2001
+From: Denys Dmytriyenko <denys@ti.com>
+Date: Thu, 7 Apr 2016 20:43:13 -0400
+Subject: [PATCH] opkg-build: re-do find/ls code to not fail on filenames with
+ spaces
+
+Signed-off-by: Denys Dmytriyenko <denys@ti.com>
+---
+ opkg-build | 9 ++++-----
+ 1 file changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/opkg-build b/opkg-build
+index a9ccad2..07305b2 100755
+--- a/opkg-build
++++ b/opkg-build
+@@ -6,7 +6,6 @@
+ # 2003-04-25 rea@sr.unh.edu
+ # Updated to work on Familiar Pre0.7rc1, with busybox tar.
+ # Note it Requires: binutils-ar (since the busybox ar can't create)
+-# For UID debugging it needs a better "find".
+ set -e
+
+ version=1.0
+@@ -47,12 +46,12 @@ pkg_appears_sane() {
+
+ PKG_ERROR=0
+
+- tilde_files=`find . -name '*~'`
++ tilde_files=`find . -name '*~' -ls -printf '\\\n'`
+ if [ -n "$tilde_files" ]; then
+ if [ "$noclean" = "1" ]; then
+ echo "*** Warning: The following files have names ending in '~'.
+ You probably want to remove them: " >&2
+- ls -ld $tilde_files
++ echo -e $tilde_files
+ if [ $? -ne 0 ]; then
+ echo "*** Error: Fail to list files have names ending in '~'."
+ exit 1
+@@ -64,12 +63,12 @@ You probably want to remove them: " >&2
+ fi
+ fi
+
+- large_uid_files=`find . -uid +99 || true`
++ large_uid_files=`find . -uid +99 -ls -printf '\\\n' || true`
+
+ if [ "$ogargs" = "" ] && [ -n "$large_uid_files" ]; then
+ echo "*** Warning: The following files have a UID greater than 99.
+ You probably want to chown these to a system user: " >&2
+- ls -ld $large_uid_files
++ echo -e $large_uid_files
+ if [ $? -ne 0 ]; then
+ echo "*** Error: Fail to list files have a UID greater than 99."
+ exit 1
+--
+2.2.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/opkg-build-Exit-when-fail-to-list-files.patch b/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/opkg-build-Exit-when-fail-to-list-files.patch
new file mode 100644
index 000000000..6c66902ef
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/opkg-build-Exit-when-fail-to-list-files.patch
@@ -0,0 +1,45 @@
+We have an issue when ls segfaults in some cases [1] so it's
+better to detect the failure at this level instead of continue
+the build process.
+
+[YOCTO #8926]
+
+Upstream-Status: Submitted [2]
+
+[1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=8926#c0
+[2] https://groups.google.com/forum/#!topic/opkg-devel/cmX02bgHZms
+
+Signed-off-by: AnĂ­bal LimĂłn <anibal.limon@linux.intel.com>
+---
+ opkg-build | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/opkg-build b/opkg-build
+index 98008b6..a9ccad2 100755
+--- a/opkg-build
++++ b/opkg-build
+@@ -53,6 +53,10 @@ pkg_appears_sane() {
+ echo "*** Warning: The following files have names ending in '~'.
+ You probably want to remove them: " >&2
+ ls -ld $tilde_files
++ if [ $? -ne 0 ]; then
++ echo "*** Error: Fail to list files have names ending in '~'."
++ exit 1
++ fi
+ echo >&2
+ else
+ echo "*** Removing the following files: $tilde_files"
+@@ -66,6 +70,10 @@ You probably want to remove them: " >&2
+ echo "*** Warning: The following files have a UID greater than 99.
+ You probably want to chown these to a system user: " >&2
+ ls -ld $large_uid_files
++ if [ $? -ne 0 ]; then
++ echo "*** Error: Fail to list files have a UID greater than 99."
++ exit 1
++ fi
+ echo >&2
+ fi
+
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch b/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch
new file mode 100644
index 000000000..4dddb08c9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch
@@ -0,0 +1,47 @@
+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
+@@ -250,8 +250,21 @@ tmp_dir=$dest_dir/IPKG_BUILD.$$
+ mkdir $tmp_dir
+
+ echo $CONTROL > $tmp_dir/tarX
+-( cd $pkg_dir && tar $ogargs -X $tmp_dir/tarX -cz $tarformat -f $tmp_dir/data.tar.gz . )
+-( cd $pkg_dir/$CONTROL && tar $ogargs -cz $tarformat -f $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 -X $tmp_dir/tarX -cz $tarformat -f $tmp_dir/data.tar.gz . ) || rc=$?
++if [ $rc -ne 1 ] && [ $rc -ne 0 ]; then
++ exit $rc
++fi
++
++rc=0
++( cd $pkg_dir/$CONTROL && tar $ogargs -cz $tarformat -f $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/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
new file mode 100644
index 000000000..8873b2870
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
@@ -0,0 +1,48 @@
+SUMMARY = "Additional utilities for the opkg package manager"
+SUMMARY_update-alternatives-opkg = "Utility for managing the alternatives system"
+SECTION = "base"
+HOMEPAGE = "http://code.google.com/p/opkg/"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://opkg.py;beginline=1;endline=18;md5=15917491ad6bf7acc666ca5f7cc1e083"
+PROVIDES += "${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'virtual/update-alternatives', '', d)}"
+
+SRCREV = "53274f087565fd45d8452c5367997ba6a682a37a"
+PV = "0.1.8+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/opkg-utils \
+ file://opkg-build-Exit-when-fail-to-list-files.patch \
+ file://0001-opkg-build-re-do-find-ls-code-to-not-fail-on-filenam.patch"
+SRC_URI_append_class-native = " file://tar_ignore_error.patch"
+
+S = "${WORKDIR}/git"
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+PYTHONRDEPS = "python python-shell python-io python-math python-crypt python-logging python-fcntl python-subprocess python-pickle python-compression python-textutils python-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
+}
+
+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
+}
+
+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"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg-arch-config_1.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg-arch-config_1.0.bb
new file mode 100644
index 000000000..ace3de4f4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg-arch-config_1.0.bb
@@ -0,0 +1,35 @@
+SUMMARY = "Architecture-dependent configuration for opkg"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+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/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg-keyrings_1.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg-keyrings_1.0.bb
new file mode 100644
index 000000000..18d6abdde
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-configure.ac-use-pkg-config-for-libsolv.patch b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-configure.ac-use-pkg-config-for-libsolv.patch
new file mode 100644
index 000000000..e67ec7479
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-configure.ac-use-pkg-config-for-libsolv.patch
@@ -0,0 +1,36 @@
+From 2a43027f7ecf2bb3ce73f95bcf575c56bc495d07 Mon Sep 17 00:00:00 2001
+From: Alejandro del Castillo <alejandro.delcastillo@ni.com>
+Date: Wed, 9 Dec 2015 17:38:05 -0600
+Subject: [PATCH] configure.ac: use pkg-config for libsolv
+
+Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
+---
+ configure.ac | 12 +-----------
+ 1 file changed, 1 insertion(+), 11 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 52e1025..d17dc5c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -159,17 +159,7 @@ if test "x$want_solver" != "xno"; then
+ AC_MSG_ERROR(Specify which solver with --enable-solver=<SOLVER>)],
+ [libsolv],
+ [AC_MSG_RESULT(libsolv)
+-
+- SOLVER_CFLAGS="-I/usr/local/include/"
+- SOLVER_LIBS="-lsolv -lsolvext"
+- AC_CHECK_LIB([solv],
+- [solver_solve],
+- [],
+- [AC_MSG_ERROR(libsolv not found)])
+- dnl TODO: remove previous 6 lines and uncomment line below to use
+- dnl pkg-config once there is a release of libsolv with pkg-config:
+- dnl PKG_CHECK_MODULES(SOLVER, libsolv)
+-
++ PKG_CHECK_MODULES(SOLVER, libsolv)
+ AC_DEFINE(HAVE_SOLVER_LIBSOLV,1,[Define if you want to use libsolv])],
+ # default
+ [AC_MSG_RESULT(no)
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-libsolv_solver_set_arch_policy-use-correct-logic-dur.patch b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-libsolv_solver_set_arch_policy-use-correct-logic-dur.patch
new file mode 100644
index 000000000..1ab1790d6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-libsolv_solver_set_arch_policy-use-correct-logic-dur.patch
@@ -0,0 +1,35 @@
+From 3e562bed7dced25eb3e9174ca9395324b6c873c1 Mon Sep 17 00:00:00 2001
+From: Alejandro del Castillo <alejandro.delcastillo@ni.com>
+Date: Wed, 9 Dec 2015 13:36:14 -0600
+Subject: [PATCH] libsolv_solver_set_arch_policy: use correct logic during
+ archs resizing
+
+If there are more than INITIAL_ARCH_LIST_SIZE archs defined in the
+configuration, libsolv_solver_set_arch_policy crashes due to flawed
+logic when resizing the archs array.
+
+Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
+---
+ libopkg/opkg_solver_libsolv.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/libopkg/opkg_solver_libsolv.c b/libopkg/opkg_solver_libsolv.c
+index 1cdcf1f..b5af0fa 100644
+--- a/libopkg/opkg_solver_libsolv.c
++++ b/libopkg/opkg_solver_libsolv.c
+@@ -66,8 +66,10 @@ static void libsolv_solver_set_arch_policy(libsolv_solver_t *libsolv_solver)
+ nv_pair_list_elt_t *arch_info;
+
+ list_for_each_entry(arch_info, &opkg_config->arch_list.head, node) {
+- if (arch_count > arch_list_size)
+- archs = xrealloc(archs, arch_list_size *= 2);
++ if (arch_count >= arch_list_size) {
++ arch_list_size *= 2;
++ archs = xrealloc(archs, arch_list_size * sizeof(arch_data_t));
++ }
+
+ archs[arch_count].arch = ((nv_pair_t *)(arch_info->data))->name;
+ archs[arch_count].priority = atoi(((nv_pair_t *)
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch b/import-layers/yocto-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..255021b4b
--- /dev/null
+++ b/import-layers/yocto-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 "/var/lib/opkg/status"
+ #define OPKG_CONF_DEFAULT_CACHE_DIR "/var/cache/opkg"
+ #define OPKG_CONF_DEFAULT_CONF_FILE_DIR "/etc/opkg"
+-#define OPKG_CONF_DEFAULT_LOCK_FILE "/var/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/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/opkg-configure.service b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/opkg-configure.service
new file mode 100644
index 000000000..8e74026ec
--- /dev/null
+++ b/import-layers/yocto-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 disable opkg-configure.service
+StandardOutput=syslog
+RemainAfterExit=No
+
+[Install]
+WantedBy=basic.target
+WantedBy=sysinit.target
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/opkg.conf b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/opkg.conf
new file mode 100644
index 000000000..c2e9e92f9
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg_0.3.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg_0.3.1.bb
new file mode 100644
index 000000000..577f49534
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg_0.3.1.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 \
+ file://0001-libsolv_solver_set_arch_policy-use-correct-logic-dur.patch \
+ file://0001-configure.ac-use-pkg-config-for-libsolv.patch \
+"
+
+SRC_URI[md5sum] = "43735e5dc1ebf46bd6ce56a7cdfdc720"
+SRC_URI[sha256sum] = "d2c6c02a8384ec21168a1f0a186cb5e9f577d1452f491d02ed3e56b2ea8b87df"
+
+inherit autotools pkgconfig systemd
+
+SYSTEMD_SERVICE_${PN} = "opkg-configure.service"
+
+target_localstatedir := "${localstatedir}"
+OPKGLIBDIR = "${target_localstatedir}/lib"
+
+PACKAGECONFIG ??= ""
+
+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] = "--enable-solver=libsolv,--disable-solver,libsolv"
+
+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 run-postinsts 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/import-layers/yocto-poky/meta/recipes-devtools/orc/orc_0.4.24.bb b/import-layers/yocto-poky/meta/recipes-devtools/orc/orc_0.4.24.bb
new file mode 100644
index 000000000..520f88d92
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/orc/orc_0.4.24.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] = "9e793ec34c0e20339659dd4bbbf62135"
+SRC_URI[sha256sum] = "338cd493b5247300149821c6312bdf7422a3593ae98691fc75d7e4fe727bd39b"
+
+inherit autotools pkgconfig
+
+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/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0001-Change-library-name.patch b/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0001-Change-library-name.patch
new file mode 100644
index 000000000..ed67c501c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0002-uuid-preserve-m-option-status-in-v-option-handling.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0003-Fix-whatis-entries.patch b/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0003-Fix-whatis-entries.patch
new file mode 100644
index 000000000..13cbb5989
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0004-fix-data-uuid-from-string.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/install-pc.patch b/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/install-pc.patch
new file mode 100644
index 000000000..04222cbf7
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/ldflags.patch b/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/ldflags.patch
new file mode 100644
index 000000000..4dfc1370c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/uuid-libtool.patch b/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/uuid-libtool.patch
new file mode 100644
index 000000000..4bc91b86e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/uuid-nostrip.patch b/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/uuid-nostrip.patch
new file mode 100644
index 000000000..d806b5fb7
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid_1.6.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid_1.6.2.bb
new file mode 100644
index 000000000..08926ba6b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid_1.6.2.bb
@@ -0,0 +1,63 @@
+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"
+
+SRC_URI = "${DEBIAN_MIRROR}/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 \
+ "
+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"
+
+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/import-layers/yocto-poky/meta/recipes-devtools/packagegroups/packagegroup-core-device-devel.bb b/import-layers/yocto-poky/meta/recipes-devtools/packagegroups/packagegroup-core-device-devel.bb
new file mode 100644
index 000000000..e83186005
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/packagegroups/packagegroup-core-device-devel.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Provides a small set of tools for development on the device"
+LICENSE = "MIT"
+
+PR = "r1"
+
+inherit packagegroup
+
+RPROVIDES_${PN} = "qemu-config"
+RREPLACES_${PN} = "qemu-config"
+RCONFLICTS_${PN} = "qemu-config"
+
+RDEPENDS_${PN} = "\
+ distcc-config \
+ oprofileui-server \
+ nfs-export-root \
+ bash \
+ "
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/patch/patch.inc b/import-layers/yocto-poky/meta/recipes-devtools/patch/patch.inc
new file mode 100644
index 000000000..cbfb8cfcf
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/debian.patch b/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/debian.patch
new file mode 100644
index 000000000..1a0764659
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/debian.patch
@@ -0,0 +1,10426 @@
+Upstream-Status: Inappropriate [debian patch]
+
+--- patch-2.5.9.orig/m4/hash.m4
++++ patch-2.5.9/m4/hash.m4
+@@ -0,0 +1,15 @@
++# hash.m4 serial 1
++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.
++
++AC_DEFUN([gl_HASH],
++[
++ dnl Prerequisites of lib/hash.c.
++ AC_CHECK_HEADERS_ONCE(stdlib.h)
++ AC_HEADER_STDBOOL
++ AC_CHECK_DECLS_ONCE(free malloc)
++])
+--- patch-2.5.9.orig/m4/nanosecond_stat.m4
++++ patch-2.5.9/m4/nanosecond_stat.m4
+@@ -0,0 +1,35 @@
++AC_DEFUN([ag_CHECK_NANOSECOND_STAT],
++ [AC_CACHE_CHECK([for nanosecond timestamps in struct stat],
++ [ac_cv_stat_nsec],
++ [AC_TRY_COMPILE(
++ [
++ #include <sys/types.h>
++ #include <sys/stat.h>
++ #include <unistd.h>
++ struct stat st;
++ ],
++ [ return st.st_atimensec + st.st_mtimensec + st.st_ctimensec; ],
++ [ac_cv_stat_nsec=yes],
++ [ac_cv_stat_nsec=no])
++ ])
++ if test $ac_cv_stat_nsec = yes; then
++ AC_DEFINE(HAVE_STAT_NSEC, 1, [Define to 1 if struct stat has nanosecond timestamps.])
++ fi
++
++ AC_CACHE_CHECK([for nanosecond timestamps in struct stat],
++ [ac_cv_stat_timeval],
++ [AC_TRY_COMPILE(
++ [
++ #include <time.h>
++ #include <sys/types.h>
++ #include <sys/stat.h>
++ #include <unistd.h>
++ struct stat st;
++ ],
++ [ return st.st_atim.tv_nsec + st.st_mtim.tv_nsec + st.st_ctim.tv_nsec; ],
++ [ac_cv_stat_timeval=yes],
++ [ac_cv_stat_timeval=no])
++ ])
++ if test $ac_cv_stat_timeval = yes; then
++ AC_DEFINE(HAVE_STAT_TIMEVAL, 1, [Define to 1 if struct stat comtains struct timeval's.])
++ fi])
+--- patch-2.5.9.orig/Makefile.in
++++ patch-2.5.9/Makefile.in
+@@ -62,7 +62,7 @@
+ SHELL = /bin/sh
+
+ LIBSRCS = error.c malloc.c memchr.c mkdir.c \
+- realloc.c rmdir.c strcasecmp.c strncasecmp.c
++ realloc.c rmdir.c strcasecmp.c strncasecmp.c hash.c
+ SRCS = $(LIBSRCS) \
+ addext.c argmatch.c backupfile.c \
+ basename.c dirname.c \
+@@ -78,12 +78,12 @@
+ maketime.$(OBJEXT) partime.$(OBJEXT) \
+ patch.$(OBJEXT) pch.$(OBJEXT) \
+ quote.$(OBJEXT) quotearg.$(OBJEXT) quotesys.$(OBJEXT) \
+- util.$(OBJEXT) version.$(OBJEXT) xmalloc.$(OBJEXT)
++ util.$(OBJEXT) version.$(OBJEXT) xmalloc.$(OBJEXT) hash.$(OBJEXT)
+ HDRS = argmatch.h backupfile.h common.h dirname.h \
+ error.h getopt.h gettext.h \
+ inp.h maketime.h partime.h pch.h \
+ quote.h quotearg.h quotesys.h \
+- unlocked-io.h util.h version.h xalloc.h
++ unlocked-io.h util.h version.h xalloc.h hash.h
+ MISC = AUTHORS COPYING ChangeLog INSTALL Makefile.in NEWS README \
+ aclocal.m4 \
+ config.hin configure configure.ac \
+--- patch-2.5.9.orig/aclocal.m4
++++ patch-2.5.9/aclocal.m4
+@@ -1,3 +1,1058 @@
++dnl aclocal.m4 generated automatically by aclocal 1.4-p6
++
++dnl Copyright (C) 1994, 1995-8, 1999, 2001 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 This program is distributed in the hope that it will be useful,
++dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
++dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
++dnl PARTICULAR PURPOSE.
++
++# 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"
++])
++
++# 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
++])
++
++# 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
++])
++
++# 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"])
++ ]
++)
++
++# Check for stdbool.h that conforms to C99.
++
++# 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 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.
++
++# Prepare for substituting <stdbool.h> if it is not supported.
++
++AC_DEFUN([AM_STDBOOL_H],
++[
++ AC_REQUIRE([AC_HEADER_STDBOOL])
++
++ # Define two additional variables used in the Makefile substitution.
++
++ if test "$ac_cv_header_stdbool_h" = yes; then
++ STDBOOL_H=''
++ else
++ STDBOOL_H='stdbool.h'
++ fi
++ AC_SUBST([STDBOOL_H])
++
++ if test "$ac_cv_type__Bool" = yes; then
++ HAVE__BOOL=1
++ else
++ HAVE__BOOL=0
++ fi
++ AC_SUBST([HAVE__BOOL])
++])
++
++# This macro is only needed in autoconf <= 2.54. Newer versions of autoconf
++# have this macro built-in.
++
++AC_DEFUN([AC_HEADER_STDBOOL],
++ [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
++ [ac_cv_header_stdbool_h],
++ [AC_TRY_COMPILE(
++ [
++ #include <stdbool.h>
++ #ifndef bool
++ "error: bool is not defined"
++ #endif
++ #ifndef false
++ "error: false is not defined"
++ #endif
++ #if false
++ "error: false is not 0"
++ #endif
++ #ifndef true
++ "error: false is not defined"
++ #endif
++ #if true != 1
++ "error: true is not 1"
++ #endif
++ #ifndef __bool_true_false_are_defined
++ "error: __bool_true_false_are_defined is not defined"
++ #endif
++
++ struct s { _Bool s: 1; _Bool t; } s;
++
++ char a[true == 1 ? 1 : -1];
++ char b[false == 0 ? 1 : -1];
++ char c[__bool_true_false_are_defined == 1 ? 1 : -1];
++ char d[(bool) -0.5 == true ? 1 : -1];
++ bool e = &s;
++ char f[(_Bool) -0.0 == false ? 1 : -1];
++ char g[true];
++ char h[sizeof (_Bool)];
++ char i[sizeof s.t];
++ ],
++ [ return !a + !b + !c + !d + !e + !f + !g + !h + !i; ],
++ [ac_cv_header_stdbool_h=yes],
++ [ac_cv_header_stdbool_h=no])])
++ AC_CHECK_TYPES([_Bool])
++ if test $ac_cv_header_stdbool_h = yes; then
++ AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.])
++ fi])
++
++#serial 5
++
++dnl From Jim Meyering
++
++dnl Define HAVE_STRUCT_UTIMBUF if `struct utimbuf' is declared --
++dnl usually in <utime.h>.
++dnl Some systems have utime.h but don't declare the struct anywhere.
++
++AC_DEFUN([jm_CHECK_TYPE_STRUCT_UTIMBUF],
++[
++ AC_CHECK_HEADERS_ONCE(sys/time.h utime.h)
++ AC_REQUIRE([AC_HEADER_TIME])
++ AC_CACHE_CHECK([for struct utimbuf], fu_cv_sys_struct_utimbuf,
++ [AC_TRY_COMPILE(
++ [
++#ifdef TIME_WITH_SYS_TIME
++# include <sys/time.h>
++# include <time.h>
++#else
++# ifdef HAVE_SYS_TIME_H
++# include <sys/time.h>
++# else
++# include <time.h>
++# endif
++#endif
++#ifdef HAVE_UTIME_H
++# include <utime.h>
++#endif
++ ],
++ [static struct utimbuf x; x.actime = x.modtime;],
++ fu_cv_sys_struct_utimbuf=yes,
++ fu_cv_sys_struct_utimbuf=no)
++ ])
++
++ if test $fu_cv_sys_struct_utimbuf = yes; then
++ AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1,
++ [Define if struct utimbuf is declared -- usually in <utime.h>.
++ Some systems have utime.h but don't declare the struct anywhere. ])
++ fi
++])
++
++# onceonly.m4 serial 3
++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 This file defines some "once only" variants of standard autoconf macros.
++dnl AC_CHECK_HEADERS_ONCE like AC_CHECK_HEADERS
++dnl AC_CHECK_FUNCS_ONCE like AC_CHECK_FUNCS
++dnl AC_CHECK_DECLS_ONCE like AC_CHECK_DECLS
++dnl AC_REQUIRE([AC_HEADER_STDC]) like AC_HEADER_STDC
++dnl The advantage is that the check for each of the headers/functions/decls
++dnl will be put only once into the 'configure' file. It keeps the size of
++dnl the 'configure' file down, and avoids redundant output when 'configure'
++dnl is run.
++dnl The drawback is that the checks cannot be conditionalized. If you write
++dnl if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi
++dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to
++dnl empty, and the check will be inserted before the body of the AC_DEFUNed
++dnl function.
++
++dnl Autoconf version 2.57 or newer is recommended.
++AC_PREREQ(2.54)
++
++# AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of
++# AC_CHECK_HEADERS(HEADER1 HEADER2 ...).
++AC_DEFUN([AC_CHECK_HEADERS_ONCE], [
++ :
++ AC_FOREACH([gl_HEADER_NAME], [$1], [
++ AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(m4_defn([gl_HEADER_NAME]),
++ [-./], [___])), [
++ AC_CHECK_HEADERS(gl_HEADER_NAME)
++ ])
++ AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
++ [-./], [___])))
++ ])
++])
++
++# AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of
++# AC_CHECK_FUNCS(FUNC1 FUNC2 ...).
++AC_DEFUN([AC_CHECK_FUNCS_ONCE], [
++ :
++ AC_FOREACH([gl_FUNC_NAME], [$1], [
++ AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [
++ AC_CHECK_FUNCS(m4_defn([gl_FUNC_NAME]))
++ ])
++ AC_REQUIRE([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]))
++ ])
++])
++
++# AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of
++# AC_CHECK_DECLS(DECL1, DECL2, ...).
++AC_DEFUN([AC_CHECK_DECLS_ONCE], [
++ :
++ AC_FOREACH([gl_DECL_NAME], [$1], [
++ AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [
++ AC_CHECK_DECLS(m4_defn([gl_DECL_NAME]))
++ ])
++ AC_REQUIRE([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]))
++ ])
++])
++
+ # backupfile.m4 serial 1
+ dnl Copyright (C) 2002 Free Software Foundation, Inc.
+ dnl This file is free software, distributed under the terms of the GNU
+@@ -21,6 +1076,7 @@
+ AC_CHECK_HEADERS_ONCE(limits.h string.h unistd.h)
+ AC_CHECK_FUNCS(pathconf)
+ ])
++
+ #serial 5
+
+ dnl From Jim Meyering.
+@@ -63,31 +1119,7 @@
+ fi
+ ]
+ )
+-# dirname.m4 serial 1
+-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.
+
+-AC_DEFUN([gl_DIRNAME],
+-[
+- dnl Prerequisites of lib/dirname.h.
+- AC_REQUIRE([jm_AC_DOS])
+-
+- dnl Prerequisites of lib/dirname.c.
+- AC_REQUIRE([AC_HEADER_STDC])
+- AC_CHECK_HEADERS_ONCE(string.h)
+-
+- dnl Prerequisites of lib/basename.c.
+- AC_REQUIRE([AC_HEADER_STDC])
+- AC_CHECK_HEADERS_ONCE(string.h)
+-
+- dnl Prerequisites of lib/stripslash.c.
+- AC_REQUIRE([AC_HEADER_STDC])
+- AC_CHECK_HEADERS_ONCE(string.h)
+-])
+ #serial 5
+
+ # Define some macros required for proper operation of code in lib/*.c
+@@ -141,6 +1173,33 @@
+ [Define if the backslash character may also serve as a file name
+ component separator.])
+ ])
++
++# dirname.m4 serial 1
++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.
++
++AC_DEFUN([gl_DIRNAME],
++[
++ dnl Prerequisites of lib/dirname.h.
++ AC_REQUIRE([jm_AC_DOS])
++
++ dnl Prerequisites of lib/dirname.c.
++ AC_REQUIRE([AC_HEADER_STDC])
++ AC_CHECK_HEADERS_ONCE(string.h)
++
++ dnl Prerequisites of lib/basename.c.
++ AC_REQUIRE([AC_HEADER_STDC])
++ AC_CHECK_HEADERS_ONCE(string.h)
++
++ dnl Prerequisites of lib/stripslash.c.
++ AC_REQUIRE([AC_HEADER_STDC])
++ AC_CHECK_HEADERS_ONCE(string.h)
++])
++
+ #serial 7
+
+ AC_DEFUN([gl_ERROR],
+@@ -159,7 +1218,67 @@
+ AC_CHECK_DECLS([strerror])
+ AC_FUNC_STRERROR_R
+ ])
+-# getopt.m4 serial 1
++
++# memchr.m4 serial 1
++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.
++
++AC_DEFUN([gl_FUNC_MEMCHR],
++[
++ AC_REPLACE_FUNCS(memchr)
++ if test $ac_cv_func_memchr = no; then
++ jm_PREREQ_MEMCHR
++ fi
++])
++
++# Prerequisites of lib/memchr.c.
++AC_DEFUN([jm_PREREQ_MEMCHR], [
++ AC_CHECK_HEADERS_ONCE(limits.h stdlib.h)
++ AC_CHECK_HEADERS(bp-sym.h)
++])
++
++# rmdir.m4 serial 1
++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.
++
++AC_DEFUN([gl_FUNC_RMDIR],
++[
++ AC_REPLACE_FUNCS(rmdir)
++ if test $ac_cv_func_rmdir = no; then
++ gl_PREREQ_RMDIR
++ fi
++])
++
++# Prerequisites of lib/rmdir.c.
++AC_DEFUN([gl_PREREQ_RMDIR], [
++ AC_REQUIRE([AC_HEADER_STAT])
++ :
++])
++
++
++# getopt.m4 serial 1
++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.
++
++AC_DEFUN([gl_GETOPT],
++[
++ dnl Prerequisites of lib/getopt.c.
++ AC_CHECK_HEADERS_ONCE(string.h)
++])
++
++# xalloc.m4 serial 1
+ 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
+@@ -167,11 +1286,25 @@
+ dnl that contains a configuration script generated by Autoconf, under
+ dnl the same distribution terms as the rest of that program.
+
+-AC_DEFUN([gl_GETOPT],
++AC_DEFUN([gl_XALLOC],
+ [
+- dnl Prerequisites of lib/getopt.c.
++ gl_PREREQ_XMALLOC
++ gl_PREREQ_XSTRDUP
++])
++
++# Prerequisites of lib/xmalloc.c.
++AC_DEFUN([gl_PREREQ_XMALLOC], [
++ AC_REQUIRE([AC_HEADER_STDC])
++ AC_REQUIRE([jm_FUNC_MALLOC])
++ AC_REQUIRE([jm_FUNC_REALLOC])
++])
++
++# Prerequisites of lib/xstrdup.c.
++AC_DEFUN([gl_PREREQ_XSTRDUP], [
++ AC_REQUIRE([AC_HEADER_STDC])
+ AC_CHECK_HEADERS_ONCE(string.h)
+ ])
++
+ # malloc.m4 serial 7
+ dnl Copyright (C) 2002 Free Software Foundation, Inc.
+ dnl This file is free software, distributed under the terms of the GNU
+@@ -197,66 +1330,8 @@
+ AC_DEFUN([gl_PREREQ_MALLOC], [
+ :
+ ])
+-# mbrtowc.m4 serial 5
+-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 Paul Eggert
+-
+-dnl This file can be removed, and jm_FUNC_MBRTOWC replaced with
+-dnl AC_FUNC_MBRTOWC, when autoconf 2.57 can be assumed everywhere.
+-
+-AC_DEFUN([jm_FUNC_MBRTOWC],
+-[
+- AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
+- jm_cv_func_mbrtowc,
+- [AC_TRY_LINK(
+- [#include <wchar.h>],
+- [mbstate_t state; return ! (sizeof state && mbrtowc);],
+- jm_cv_func_mbrtowc=yes,
+- jm_cv_func_mbrtowc=no)])
+- if test $jm_cv_func_mbrtowc = yes; then
+- AC_DEFINE(HAVE_MBRTOWC, 1,
+- [Define to 1 if mbrtowc and mbstate_t are properly declared.])
+- fi
+-])
+-# mbstate_t.m4 serial 9
+-dnl Copyright (C) 2000, 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.
+-
+-# From Paul Eggert.
+-
+-# BeOS 5 has <wchar.h> but does not define mbstate_t,
+-# so you can't declare an object of that type.
+-# Check for this incompatibility with Standard C.
+
+-# AC_TYPE_MBSTATE_T
+-# -----------------
+-AC_DEFUN([AC_TYPE_MBSTATE_T],
+- [AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t,
+- [AC_COMPILE_IFELSE(
+- [AC_LANG_PROGRAM(
+- [AC_INCLUDES_DEFAULT
+-# include <wchar.h>],
+- [mbstate_t x; return sizeof x;])],
+- [ac_cv_type_mbstate_t=yes],
+- [ac_cv_type_mbstate_t=no])])
+- if test $ac_cv_type_mbstate_t = yes; then
+- AC_DEFINE([HAVE_MBSTATE_T], 1,
+- [Define to 1 if <wchar.h> declares mbstate_t.])
+- else
+- AC_DEFINE([mbstate_t], int,
+- [Define to a type if <wchar.h> does not define.])
+- fi])
+-# memchr.m4 serial 1
++# realloc.m4 serial 7
+ 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
+@@ -264,116 +1339,24 @@
+ dnl that contains a configuration script generated by Autoconf, under
+ dnl the same distribution terms as the rest of that program.
+
+-AC_DEFUN([gl_FUNC_MEMCHR],
++dnl From Jim Meyering.
++dnl Determine whether realloc works when both arguments are 0.
++dnl If it doesn't, arrange to use the replacement function.
++
++AC_DEFUN([jm_FUNC_REALLOC],
+ [
+- AC_REPLACE_FUNCS(memchr)
+- if test $ac_cv_func_memchr = no; then
+- jm_PREREQ_MEMCHR
++ AC_REQUIRE([AC_FUNC_REALLOC])
++ dnl autoconf < 2.57 used the symbol ac_cv_func_realloc_works.
++ if test X"$ac_cv_func_realloc_0_nonnull" = Xno || test X"$ac_cv_func_realloc_works" = Xno; then
++ gl_PREREQ_REALLOC
+ fi
+ ])
+
+-# Prerequisites of lib/memchr.c.
+-AC_DEFUN([jm_PREREQ_MEMCHR], [
+- AC_CHECK_HEADERS_ONCE(limits.h stdlib.h)
+- AC_CHECK_HEADERS(bp-sym.h)
+-])
+-#serial 1
+-
+-dnl From Mumit Khan and Paul Eggert
+-dnl Determine whether mkdir accepts only one argument instead of the usual two.
+-
+-AC_DEFUN([PATCH_FUNC_MKDIR_TAKES_ONE_ARG],
+- [AC_CHECK_FUNCS(mkdir)
+- AC_CACHE_CHECK([whether mkdir takes only one argument],
+- patch_cv_mkdir_takes_one_arg,
+- [patch_cv_mkdir_takes_one_arg=no
+- if test $ac_cv_func_mkdir = yes; then
+- AC_TRY_COMPILE([
+-#include <sys/types.h>
+-#include <sys/stat.h>
+- ],
+- [mkdir (".", 0);],
+- ,
+- [AC_TRY_COMPILE([
+-#include <sys/types.h>
+-#include <sys/stat.h>
+- ],
+- [mkdir (".");],
+- patch_cv_mkdir_takes_one_arg=yes
+- )]
+- )
+- fi
+- ]
+- )
+- if test $patch_cv_mkdir_takes_one_arg = yes; then
+- AC_DEFINE([MKDIR_TAKES_ONE_ARG], 1,
+- [Define if mkdir takes only one argument.])
+- fi
+- ]
+-)
+-# onceonly.m4 serial 3
+-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 This file defines some "once only" variants of standard autoconf macros.
+-dnl AC_CHECK_HEADERS_ONCE like AC_CHECK_HEADERS
+-dnl AC_CHECK_FUNCS_ONCE like AC_CHECK_FUNCS
+-dnl AC_CHECK_DECLS_ONCE like AC_CHECK_DECLS
+-dnl AC_REQUIRE([AC_HEADER_STDC]) like AC_HEADER_STDC
+-dnl The advantage is that the check for each of the headers/functions/decls
+-dnl will be put only once into the 'configure' file. It keeps the size of
+-dnl the 'configure' file down, and avoids redundant output when 'configure'
+-dnl is run.
+-dnl The drawback is that the checks cannot be conditionalized. If you write
+-dnl if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi
+-dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to
+-dnl empty, and the check will be inserted before the body of the AC_DEFUNed
+-dnl function.
+-
+-dnl Autoconf version 2.57 or newer is recommended.
+-AC_PREREQ(2.54)
+-
+-# AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of
+-# AC_CHECK_HEADERS(HEADER1 HEADER2 ...).
+-AC_DEFUN([AC_CHECK_HEADERS_ONCE], [
+- :
+- AC_FOREACH([gl_HEADER_NAME], [$1], [
+- AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(m4_defn([gl_HEADER_NAME]),
+- [-./], [___])), [
+- AC_CHECK_HEADERS(gl_HEADER_NAME)
+- ])
+- AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
+- [-./], [___])))
+- ])
+-])
+-
+-# AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of
+-# AC_CHECK_FUNCS(FUNC1 FUNC2 ...).
+-AC_DEFUN([AC_CHECK_FUNCS_ONCE], [
++# Prerequisites of lib/realloc.c.
++AC_DEFUN([gl_PREREQ_REALLOC], [
+ :
+- AC_FOREACH([gl_FUNC_NAME], [$1], [
+- AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [
+- AC_CHECK_FUNCS(m4_defn([gl_FUNC_NAME]))
+- ])
+- AC_REQUIRE([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]))
+- ])
+ ])
+
+-# AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of
+-# AC_CHECK_DECLS(DECL1, DECL2, ...).
+-AC_DEFUN([AC_CHECK_DECLS_ONCE], [
+- :
+- AC_FOREACH([gl_DECL_NAME], [$1], [
+- AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [
+- AC_CHECK_DECLS(m4_defn([gl_DECL_NAME]))
+- ])
+- AC_REQUIRE([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]))
+- ])
+-])
+ # quote.m4 serial 1
+ dnl Copyright (C) 2002 Free Software Foundation, Inc.
+ dnl This file is free software, distributed under the terms of the GNU
+@@ -387,6 +1370,7 @@
+ dnl Prerequisites of lib/quote.c.
+ AC_CHECK_HEADERS_ONCE(stddef.h)
+ ])
++
+ # quotearg.m4 serial 1
+ dnl Copyright (C) 2002 Free Software Foundation, Inc.
+ dnl This file is free software, distributed under the terms of the GNU
+@@ -403,32 +1387,69 @@
+ AC_TYPE_MBSTATE_T
+ jm_FUNC_MBRTOWC
+ ])
+-# realloc.m4 serial 7
+-dnl Copyright (C) 2002 Free Software Foundation, Inc.
++
++# mbstate_t.m4 serial 9
++dnl Copyright (C) 2000, 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 Jim Meyering.
+-dnl Determine whether realloc works when both arguments are 0.
+-dnl If it doesn't, arrange to use the replacement function.
++# From Paul Eggert.
+
+-AC_DEFUN([jm_FUNC_REALLOC],
++# BeOS 5 has <wchar.h> but does not define mbstate_t,
++# so you can't declare an object of that type.
++# Check for this incompatibility with Standard C.
++
++# AC_TYPE_MBSTATE_T
++# -----------------
++AC_DEFUN([AC_TYPE_MBSTATE_T],
++ [AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t,
++ [AC_COMPILE_IFELSE(
++ [AC_LANG_PROGRAM(
++ [AC_INCLUDES_DEFAULT
++# include <wchar.h>],
++ [mbstate_t x; return sizeof x;])],
++ [ac_cv_type_mbstate_t=yes],
++ [ac_cv_type_mbstate_t=no])])
++ if test $ac_cv_type_mbstate_t = yes; then
++ AC_DEFINE([HAVE_MBSTATE_T], 1,
++ [Define to 1 if <wchar.h> declares mbstate_t.])
++ else
++ AC_DEFINE([mbstate_t], int,
++ [Define to a type if <wchar.h> does not define.])
++ fi])
++
++# mbrtowc.m4 serial 5
++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 Paul Eggert
++
++dnl This file can be removed, and jm_FUNC_MBRTOWC replaced with
++dnl AC_FUNC_MBRTOWC, when autoconf 2.57 can be assumed everywhere.
++
++AC_DEFUN([jm_FUNC_MBRTOWC],
+ [
+- AC_REQUIRE([AC_FUNC_REALLOC])
+- dnl autoconf < 2.57 used the symbol ac_cv_func_realloc_works.
+- if test X"$ac_cv_func_realloc_0_nonnull" = Xno || test X"$ac_cv_func_realloc_works" = Xno; then
+- gl_PREREQ_REALLOC
++ AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
++ jm_cv_func_mbrtowc,
++ [AC_TRY_LINK(
++ [#include <wchar.h>],
++ [mbstate_t state; return ! (sizeof state && mbrtowc);],
++ jm_cv_func_mbrtowc=yes,
++ jm_cv_func_mbrtowc=no)])
++ if test $jm_cv_func_mbrtowc = yes; then
++ AC_DEFINE(HAVE_MBRTOWC, 1,
++ [Define to 1 if mbrtowc and mbstate_t are properly declared.])
+ fi
+ ])
+
+-# Prerequisites of lib/realloc.c.
+-AC_DEFUN([gl_PREREQ_REALLOC], [
+- :
+-])
+-# rmdir.m4 serial 1
++# hash.m4 serial 1
+ 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
+@@ -436,18 +1457,71 @@
+ dnl that contains a configuration script generated by Autoconf, under
+ dnl the same distribution terms as the rest of that program.
+
+-AC_DEFUN([gl_FUNC_RMDIR],
++AC_DEFUN([gl_HASH],
+ [
+- AC_REPLACE_FUNCS(rmdir)
+- if test $ac_cv_func_rmdir = no; then
+- gl_PREREQ_RMDIR
+- fi
++ dnl Prerequisites of lib/hash.c.
++ AC_CHECK_HEADERS_ONCE(stdlib.h)
++ AC_HEADER_STDBOOL
++ AC_CHECK_DECLS_ONCE(free malloc)
+ ])
+
+-# Prerequisites of lib/rmdir.c.
+-AC_DEFUN([gl_PREREQ_RMDIR], [
+- AC_REQUIRE([AC_HEADER_STAT])
+- :
++AC_DEFUN([ag_CHECK_NANOSECOND_STAT],
++ [AC_CACHE_CHECK([for nanosecond timestamps in struct stat],
++ [ac_cv_stat_nsec],
++ [AC_TRY_COMPILE(
++ [
++ #include <sys/types.h>
++ #include <sys/stat.h>
++ #include <unistd.h>
++ struct stat st;
++ ],
++ [ return st.st_atimensec + st.st_mtimensec + st.st_ctimensec; ],
++ [ac_cv_stat_nsec=yes],
++ [ac_cv_stat_nsec=no])
++ ])
++ if test $ac_cv_stat_nsec = yes; then
++ AC_DEFINE(HAVE_STAT_NSEC, 1, [Define to 1 if struct stat has nanosecond timestamps.])
++ fi
++
++ AC_CACHE_CHECK([for nanosecond timestamps in struct stat],
++ [ac_cv_stat_timeval],
++ [AC_TRY_COMPILE(
++ [
++ #include <time.h>
++ #include <sys/types.h>
++ #include <sys/stat.h>
++ #include <unistd.h>
++ struct stat st;
++ ],
++ [ return st.st_atim.tv_nsec + st.st_mtim.tv_nsec + st.st_ctim.tv_nsec; ],
++ [ac_cv_stat_timeval=yes],
++ [ac_cv_stat_timeval=no])
++ ])
++ if test $ac_cv_stat_timeval = yes; then
++ AC_DEFINE(HAVE_STAT_TIMEVAL, 1, [Define to 1 if struct stat comtains struct timeval's.])
++ fi])
++
++#serial 7 -*- autoconf -*-
++
++dnl From Jim Meyering.
++dnl
++dnl See if the glibc *_unlocked I/O macros or functions are available.
++dnl Use only those *_unlocked macros or functions that are declared
++dnl (because some of them were declared in Solaris 2.5.1 but were removed
++dnl in Solaris 2.6, whereas we want binaries built on Solaris 2.5.1 to run
++dnl on Solaris 2.6).
++
++AC_DEFUN([jm_FUNC_GLIBC_UNLOCKED_IO],
++[
++ dnl Persuade glibc <stdio.h> to declare fgets_unlocked(), fputs_unlocked()
++ dnl etc.
++ AC_REQUIRE([AC_GNU_SOURCE])
++
++ AC_CHECK_DECLS_ONCE(
++ [clearerr_unlocked feof_unlocked ferror_unlocked
++ fflush_unlocked fgets_unlocked fputc_unlocked fputs_unlocked
++ fread_unlocked fwrite_unlocked getc_unlocked
++ getchar_unlocked putc_unlocked putchar_unlocked])
+ ])
+
+ # Check for setmode, DOS style.
+@@ -488,180 +1562,39 @@
+ AC_DEFINE(HAVE_SETMODE_DOS, 1,
+ [Define to 1 if you have the DOS-style `setmode' function.])
+ fi])
+-# Check for stdbool.h that conforms to C99.
+-
+-# 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 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.
+-
+-# Prepare for substituting <stdbool.h> if it is not supported.
+-
+-AC_DEFUN([AM_STDBOOL_H],
+-[
+- AC_REQUIRE([AC_HEADER_STDBOOL])
+-
+- # Define two additional variables used in the Makefile substitution.
+-
+- if test "$ac_cv_header_stdbool_h" = yes; then
+- STDBOOL_H=''
+- else
+- STDBOOL_H='stdbool.h'
+- fi
+- AC_SUBST([STDBOOL_H])
+-
+- if test "$ac_cv_type__Bool" = yes; then
+- HAVE__BOOL=1
+- else
+- HAVE__BOOL=0
+- fi
+- AC_SUBST([HAVE__BOOL])
+-])
+-
+-# This macro is only needed in autoconf <= 2.54. Newer versions of autoconf
+-# have this macro built-in.
+-
+-AC_DEFUN([AC_HEADER_STDBOOL],
+- [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
+- [ac_cv_header_stdbool_h],
+- [AC_TRY_COMPILE(
+- [
+- #include <stdbool.h>
+- #ifndef bool
+- "error: bool is not defined"
+- #endif
+- #ifndef false
+- "error: false is not defined"
+- #endif
+- #if false
+- "error: false is not 0"
+- #endif
+- #ifndef true
+- "error: false is not defined"
+- #endif
+- #if true != 1
+- "error: true is not 1"
+- #endif
+- #ifndef __bool_true_false_are_defined
+- "error: __bool_true_false_are_defined is not defined"
+- #endif
+-
+- struct s { _Bool s: 1; _Bool t; } s;
+-
+- char a[true == 1 ? 1 : -1];
+- char b[false == 0 ? 1 : -1];
+- char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+- char d[(bool) -0.5 == true ? 1 : -1];
+- bool e = &s;
+- char f[(_Bool) -0.0 == false ? 1 : -1];
+- char g[true];
+- char h[sizeof (_Bool)];
+- char i[sizeof s.t];
+- ],
+- [ return !a + !b + !c + !d + !e + !f + !g + !h + !i; ],
+- [ac_cv_header_stdbool_h=yes],
+- [ac_cv_header_stdbool_h=no])])
+- AC_CHECK_TYPES([_Bool])
+- if test $ac_cv_header_stdbool_h = yes; then
+- AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.])
+- fi])
+-#serial 7 -*- autoconf -*-
+-
+-dnl From Jim Meyering.
+-dnl
+-dnl See if the glibc *_unlocked I/O macros or functions are available.
+-dnl Use only those *_unlocked macros or functions that are declared
+-dnl (because some of them were declared in Solaris 2.5.1 but were removed
+-dnl in Solaris 2.6, whereas we want binaries built on Solaris 2.5.1 to run
+-dnl on Solaris 2.6).
+-
+-AC_DEFUN([jm_FUNC_GLIBC_UNLOCKED_IO],
+-[
+- dnl Persuade glibc <stdio.h> to declare fgets_unlocked(), fputs_unlocked()
+- dnl etc.
+- AC_REQUIRE([AC_GNU_SOURCE])
+-
+- AC_CHECK_DECLS_ONCE(
+- [clearerr_unlocked feof_unlocked ferror_unlocked
+- fflush_unlocked fgets_unlocked fputc_unlocked fputs_unlocked
+- fread_unlocked fwrite_unlocked getc_unlocked
+- getchar_unlocked putc_unlocked putchar_unlocked])
+-])
+-#serial 5
+-
+-dnl From Jim Meyering
+-
+-dnl Define HAVE_STRUCT_UTIMBUF if `struct utimbuf' is declared --
+-dnl usually in <utime.h>.
+-dnl Some systems have utime.h but don't declare the struct anywhere.
+-
+-AC_DEFUN([jm_CHECK_TYPE_STRUCT_UTIMBUF],
+-[
+- AC_CHECK_HEADERS_ONCE(sys/time.h utime.h)
+- AC_REQUIRE([AC_HEADER_TIME])
+- AC_CACHE_CHECK([for struct utimbuf], fu_cv_sys_struct_utimbuf,
+- [AC_TRY_COMPILE(
+- [
+-#ifdef TIME_WITH_SYS_TIME
+-# include <sys/time.h>
+-# include <time.h>
+-#else
+-# ifdef HAVE_SYS_TIME_H
+-# include <sys/time.h>
+-# else
+-# include <time.h>
+-# endif
+-#endif
+-#ifdef HAVE_UTIME_H
+-# include <utime.h>
+-#endif
+- ],
+- [static struct utimbuf x; x.actime = x.modtime;],
+- fu_cv_sys_struct_utimbuf=yes,
+- fu_cv_sys_struct_utimbuf=no)
+- ])
+
+- if test $fu_cv_sys_struct_utimbuf = yes; then
+- AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1,
+- [Define if struct utimbuf is declared -- usually in <utime.h>.
+- Some systems have utime.h but don't declare the struct anywhere. ])
+- fi
+-])
+-# xalloc.m4 serial 1
+-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.
++#serial 1
+
+-AC_DEFUN([gl_XALLOC],
+-[
+- gl_PREREQ_XMALLOC
+- gl_PREREQ_XSTRDUP
+-])
++dnl From Mumit Khan and Paul Eggert
++dnl Determine whether mkdir accepts only one argument instead of the usual two.
+
+-# Prerequisites of lib/xmalloc.c.
+-AC_DEFUN([gl_PREREQ_XMALLOC], [
+- AC_REQUIRE([AC_HEADER_STDC])
+- AC_REQUIRE([jm_FUNC_MALLOC])
+- AC_REQUIRE([jm_FUNC_REALLOC])
+-])
++AC_DEFUN([PATCH_FUNC_MKDIR_TAKES_ONE_ARG],
++ [AC_CHECK_FUNCS(mkdir)
++ AC_CACHE_CHECK([whether mkdir takes only one argument],
++ patch_cv_mkdir_takes_one_arg,
++ [patch_cv_mkdir_takes_one_arg=no
++ if test $ac_cv_func_mkdir = yes; then
++ AC_TRY_COMPILE([
++#include <sys/types.h>
++#include <sys/stat.h>
++ ],
++ [mkdir (".", 0);],
++ ,
++ [AC_TRY_COMPILE([
++#include <sys/types.h>
++#include <sys/stat.h>
++ ],
++ [mkdir (".");],
++ patch_cv_mkdir_takes_one_arg=yes
++ )]
++ )
++ fi
++ ]
++ )
++ if test $patch_cv_mkdir_takes_one_arg = yes; then
++ AC_DEFINE([MKDIR_TAKES_ONE_ARG], 1,
++ [Define if mkdir takes only one argument.])
++ fi
++ ]
++)
+
+-# Prerequisites of lib/xstrdup.c.
+-AC_DEFUN([gl_PREREQ_XSTRDUP], [
+- AC_REQUIRE([AC_HEADER_STDC])
+- AC_CHECK_HEADERS_ONCE(string.h)
+-])
+--- patch-2.5.9.orig/configure
++++ patch-2.5.9/configure
+@@ -1,11 +1,10 @@
+ #! /bin/sh
+ # Guess values for system-dependent variables and create Makefiles.
+-# Generated by GNU Autoconf 2.57 for patch 2.5.9.
++# Generated by GNU Autoconf 2.59 for patch 2.5.9.
+ #
+ # Report bugs to <bug-patch@gnu.org>.
+ #
+-# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+-# Free Software Foundation, Inc.
++# Copyright (C) 2003 Free Software Foundation, Inc.
+ # This configure script is free software; the Free Software Foundation
+ # gives unlimited permission to copy, distribute and modify it.
+ ## --------------------- ##
+@@ -22,9 +21,10 @@
+ elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+ fi
++DUALCASE=1; export DUALCASE # for MKS sh
+
+ # Support unset when possible.
+-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
++if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+ else
+ as_unset=false
+@@ -43,7 +43,7 @@
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+ do
+- if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
++ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+@@ -220,16 +220,17 @@
+ if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+ else
++ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+ fi
+
+ as_executable_p="test -f"
+
+ # Sed expression to map a string onto a valid CPP name.
+-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
++as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+ # Sed expression to map a string onto a valid variable name.
+-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
++as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+ # IFS
+@@ -669,7 +670,7 @@
+
+ # Be sure to have absolute paths.
+ for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+- localstatedir libdir includedir oldincludedir infodir mandir
++ localstatedir libdir includedir oldincludedir infodir mandir
+ do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+@@ -709,10 +710,10 @@
+ # Try the directory containing this script, then its parent.
+ ac_confdir=`(dirname "$0") 2>/dev/null ||
+ $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+- X"$0" : 'X\(//\)[^/]' \| \
+- X"$0" : 'X\(//\)$' \| \
+- X"$0" : 'X\(/\)' \| \
+- . : '\(.\)' 2>/dev/null ||
++ X"$0" : 'X\(//\)[^/]' \| \
++ X"$0" : 'X\(//\)$' \| \
++ X"$0" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
+ echo X"$0" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+@@ -804,9 +805,9 @@
+ cat <<_ACEOF
+ Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+- [$ac_default_prefix]
++ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+- [PREFIX]
++ [PREFIX]
+
+ By default, \`make install' will install all the files in
+ \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+@@ -896,12 +897,45 @@
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+ esac
+-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+-# absolute.
+-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
++
++# Do not use `cd foo && pwd` to compute absolute paths, because
++# the directories may not exist.
++case `pwd` in
++.) ac_abs_builddir="$ac_dir";;
++*)
++ case "$ac_dir" in
++ .) ac_abs_builddir=`pwd`;;
++ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
++ *) ac_abs_builddir=`pwd`/"$ac_dir";;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_builddir=${ac_top_builddir}.;;
++*)
++ case ${ac_top_builddir}. in
++ .) ac_abs_top_builddir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
++ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_srcdir=$ac_srcdir;;
++*)
++ case $ac_srcdir in
++ .) ac_abs_srcdir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
++ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_srcdir=$ac_top_srcdir;;
++*)
++ case $ac_top_srcdir in
++ .) ac_abs_top_srcdir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
++ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
++ esac;;
++esac
+
+ cd $ac_dir
+ # Check for guested configure; otherwise get Cygnus style configure.
+@@ -912,13 +946,13 @@
+ echo
+ $SHELL $ac_srcdir/configure --help=recursive
+ elif test -f $ac_srcdir/configure.ac ||
+- test -f $ac_srcdir/configure.in; then
++ test -f $ac_srcdir/configure.in; then
+ echo
+ $ac_configure --help
+ else
+ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi
+- cd $ac_popdir
++ cd "$ac_popdir"
+ done
+ fi
+
+@@ -926,10 +960,9 @@
+ if $ac_init_version; then
+ cat <<\_ACEOF
+ patch configure 2.5.9
+-generated by GNU Autoconf 2.57
++generated by GNU Autoconf 2.59
+
+-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+-Free Software Foundation, Inc.
++Copyright (C) 2003 Free Software Foundation, Inc.
+ This configure script is free software; the Free Software Foundation
+ gives unlimited permission to copy, distribute and modify it.
+ _ACEOF
+@@ -941,7 +974,7 @@
+ running configure, to aid debugging if configure makes a mistake.
+
+ It was created by patch $as_me 2.5.9, which was
+-generated by GNU Autoconf 2.57. Invocation command line was
++generated by GNU Autoconf 2.59. Invocation command line was
+
+ $ $0 $@
+
+@@ -1018,19 +1051,19 @@
+ 2)
+ ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+- ac_must_keep_next=false # Got value, back to normal.
++ ac_must_keep_next=false # Got value, back to normal.
+ else
+- case $ac_arg in
+- *=* | --config-cache | -C | -disable-* | --disable-* \
+- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+- | -with-* | --with-* | -without-* | --without-* | --x)
+- case "$ac_configure_args0 " in
+- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+- esac
+- ;;
+- -* ) ac_must_keep_next=true ;;
+- esac
++ case $ac_arg in
++ *=* | --config-cache | -C | -disable-* | --disable-* \
++ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
++ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
++ | -with-* | --with-* | -without-* | --without-* | --x)
++ case "$ac_configure_args0 " in
++ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
++ esac
++ ;;
++ -* ) ac_must_keep_next=true ;;
++ esac
+ fi
+ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+ # Get rid of the leading space.
+@@ -1064,12 +1097,12 @@
+ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ sed -n \
+- "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
++ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
++ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+ ;;
+ *)
+ sed -n \
+- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
++ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+ }
+@@ -1098,7 +1131,7 @@
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=$`echo $ac_var`
+- echo "$ac_var='"'"'$ac_val'"'"'"
++ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+ fi
+@@ -1117,7 +1150,7 @@
+ echo "$as_me: caught signal $ac_signal"
+ echo "$as_me: exit $exit_status"
+ } >&5
+- rm -f core core.* *.core &&
++ rm -f core *.core &&
+ rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+ ' 0
+@@ -1197,7 +1230,7 @@
+ # value.
+ ac_cache_corrupted=false
+ for ac_var in `(set) 2>&1 |
+- sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
++ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+@@ -1214,13 +1247,13 @@
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
++ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+ echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
++ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+ echo "$as_me: former value: $ac_old_val" >&2;}
+- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
++ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+ echo "$as_me: current value: $ac_new_val" >&2;}
+- ac_cache_corrupted=:
++ ac_cache_corrupted=:
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+@@ -1629,7 +1662,6 @@
+ (exit $ac_status); }
+
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -1649,8 +1681,8 @@
+ # Try to create an executable without -o first, disregard a.out.
+ # It will help us diagnose broken compilers, and finding out an intuition
+ # of exeext.
+-echo "$as_me:$LINENO: checking for C compiler default output" >&5
+-echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
++echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
++echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+ ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+ if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+ (eval $ac_link_default) 2>&5
+@@ -1670,23 +1702,23 @@
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+- ;;
++ ;;
+ conftest.$ac_ext )
+- # This is the source file.
+- ;;
++ # This is the source file.
++ ;;
+ [ab].out )
+- # We found the default executable, but exeext='' is most
+- # certainly right.
+- break;;
++ # We found the default executable, but exeext='' is most
++ # certainly right.
++ break;;
+ *.* )
+- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+- # FIXME: I believe we export ac_cv_exeext for Libtool,
+- # but it would be cool to find out if it's true. Does anybody
+- # maintain Libtool? --akim.
+- export ac_cv_exeext
+- break;;
++ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
++ # FIXME: I believe we export ac_cv_exeext for Libtool,
++ # but it would be cool to find out if it's true. Does anybody
++ # maintain Libtool? --akim.
++ export ac_cv_exeext
++ break;;
+ * )
+- break;;
++ break;;
+ esac
+ done
+ else
+@@ -1760,8 +1792,8 @@
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+- export ac_cv_exeext
+- break;;
++ export ac_cv_exeext
++ break;;
+ * ) break;;
+ esac
+ done
+@@ -1786,7 +1818,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -1837,7 +1868,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -1857,11 +1887,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -1874,7 +1913,7 @@
+
+ ac_compiler_gnu=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+ fi
+@@ -1890,7 +1929,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -1907,11 +1945,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -1924,7 +1971,7 @@
+
+ ac_cv_prog_cc_g=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+ echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+@@ -1951,7 +1998,6 @@
+ ac_cv_prog_cc_stdc=no
+ ac_save_CC=$CC
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -1979,6 +2025,16 @@
+ va_end (v);
+ return s;
+ }
++
++/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
++ function prototypes and stuff, but not '\xHH' hex character constants.
++ These don't provoke an error unfortunately, instead are silently treated
++ as 'x'. The following induces an error, until -std1 is added to get
++ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
++ array size at least. It's necessary to write '\x00'==0 to get something
++ that's true only with -std1. */
++int osf4_cc_array ['\x00' == 0 ? 1 : -1];
++
+ int test (int i, double x);
+ struct s1 {int (*f) (int a);};
+ struct s2 {int (*f) (double a);};
+@@ -2005,11 +2061,20 @@
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -2022,7 +2087,7 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ fi
+-rm -f conftest.$ac_objext
++rm -f conftest.err conftest.$ac_objext
+ done
+ rm -f conftest.$ac_ext conftest.$ac_objext
+ CC=$ac_save_CC
+@@ -2050,19 +2115,27 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ for ac_declaration in \
+- ''\
+- '#include <stdlib.h>' \
++ '' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+@@ -2070,14 +2143,13 @@
+ 'void exit (int);'
+ do
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+-#include <stdlib.h>
+ $ac_declaration
++#include <stdlib.h>
+ int
+ main ()
+ {
+@@ -2088,11 +2160,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -2105,9 +2186,8 @@
+
+ continue
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2124,11 +2204,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -2140,7 +2229,7 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ rm -f conftest*
+ if test -n "$ac_declaration"; then
+@@ -2154,7 +2243,7 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_ext=c
+ ac_cpp='$CPP $CPPFLAGS'
+ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+@@ -2189,7 +2278,6 @@
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2200,7 +2288,7 @@
+ #else
+ # include <assert.h>
+ #endif
+- Syntax error
++ Syntax error
+ _ACEOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+@@ -2212,6 +2300,7 @@
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+@@ -2232,7 +2321,6 @@
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2250,6 +2338,7 @@
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+@@ -2296,7 +2385,6 @@
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2307,7 +2395,7 @@
+ #else
+ # include <assert.h>
+ #endif
+- Syntax error
++ Syntax error
+ _ACEOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+@@ -2319,6 +2407,7 @@
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+@@ -2339,7 +2428,6 @@
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2357,6 +2445,7 @@
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+@@ -2431,6 +2520,7 @@
+ # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+ # AFS /usr/afsws/bin/install, which mishandles nonexistent args
+ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
++# OS/2's system install, which has a completely different semantic
+ # ./install, which can be erroneously created by make from ./install.sh.
+ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+ echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+@@ -2447,6 +2537,7 @@
+ case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
++ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+@@ -2454,20 +2545,20 @@
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+- if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+- if test $ac_prog = install &&
+- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+- # AIX install. It has an incompatible calling convention.
+- :
+- elif test $ac_prog = install &&
+- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+- # program-specific install script used by HP pwplus--don't use.
+- :
+- else
+- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+- break 3
+- fi
+- fi
++ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
++ if test $ac_prog = install &&
++ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
++ # AIX install. It has an incompatible calling convention.
++ :
++ elif test $ac_prog = install &&
++ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
++ # program-specific install script used by HP pwplus--don't use.
++ :
++ else
++ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
++ break 3
++ fi
++ fi
+ done
+ done
+ ;;
+@@ -2499,7 +2590,7 @@
+
+ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+ echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
++set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
+ if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+@@ -2596,7 +2687,6 @@
+ echo "$as_me:$LINENO: checking for AIX" >&5
+ echo $ECHO_N "checking for AIX... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2628,7 +2718,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2649,11 +2738,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -2666,12 +2764,11 @@
+
+ ac_cv_header_stdc=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2693,7 +2790,6 @@
+ if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2718,7 +2814,6 @@
+ :
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2730,9 +2825,9 @@
+ # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+ #else
+ # define ISLOWER(c) \
+- (('a' <= (c) && (c) <= 'i') \
+- || ('j' <= (c) && (c) <= 'r') \
+- || ('s' <= (c) && (c) <= 'z'))
++ (('a' <= (c) && (c) <= 'i') \
++ || ('j' <= (c) && (c) <= 'r') \
++ || ('s' <= (c) && (c) <= 'z'))
+ # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+ #endif
+
+@@ -2743,7 +2838,7 @@
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+- || toupper (i) != TOUPPER (i))
++ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
+ }
+@@ -2768,7 +2863,7 @@
+ ( exit $ac_status )
+ ac_cv_header_stdc=no
+ fi
+-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ fi
+ fi
+ fi
+@@ -2793,7 +2888,7 @@
+
+
+ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+- inttypes.h stdint.h unistd.h
++ inttypes.h stdint.h unistd.h
+ do
+ as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+@@ -2802,7 +2897,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2814,11 +2908,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -2831,7 +2934,7 @@
+
+ eval "$as_ac_Header=no"
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -2858,7 +2961,6 @@
+ echo "$as_me:$LINENO: checking minix/config.h usability" >&5
+ echo $ECHO_N "checking minix/config.h usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2869,11 +2971,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -2886,7 +2997,7 @@
+
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+
+@@ -2894,7 +3005,6 @@
+ echo "$as_me:$LINENO: checking minix/config.h presence" >&5
+ echo $ECHO_N "checking minix/config.h presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2912,6 +3022,7 @@
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+@@ -2931,33 +3042,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+
+ # So? What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+- yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+- { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;}
+- (
+- cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+- ) |
+- sed "s/^/$as_me: WARNING: /" >&2
++ { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;}
++ ac_header_preproc=yes
+ ;;
+- no:yes )
++ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;}
+- { echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;}
++ { echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+@@ -3000,15 +3110,15 @@
+ fi
+
+
+-echo "$as_me:$LINENO: checking for library containing strerror" >&5
+-echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6
+-if test "${ac_cv_search_strerror+set}" = set; then
++
++ echo "$as_me:$LINENO: checking for strerror in -lcposix" >&5
++echo $ECHO_N "checking for strerror in -lcposix... $ECHO_C" >&6
++if test "${ac_cv_lib_cposix_strerror+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- ac_func_search_save_LIBS=$LIBS
+-ac_cv_search_strerror=no
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-lcposix $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3032,79 +3142,43 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+- ac_cv_search_strerror="none required"
+-else
+- echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+-fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+-if test "$ac_cv_search_strerror" = no; then
+- for ac_lib in cposix; do
+- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+- cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+-/* confdefs.h. */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h. */
+-
+-/* Override any gcc2 internal prototype to avoid an error. */
+-#ifdef __cplusplus
+-extern "C"
+-#endif
+-/* We use char because int might match the return type of a gcc2
+- builtin and then its argument prototype would still apply. */
+-char strerror ();
+-int
+-main ()
+-{
+-strerror ();
+- ;
+- return 0;
+-}
+-_ACEOF
+-rm -f conftest.$ac_objext conftest$ac_exeext
+-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+- ac_cv_search_strerror="-l$ac_lib"
+-break
++ ac_cv_lib_cposix_strerror=yes
+ else
+ echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
++ac_cv_lib_cposix_strerror=no
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+- done
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
+ fi
+-LIBS=$ac_func_search_save_LIBS
++echo "$as_me:$LINENO: result: $ac_cv_lib_cposix_strerror" >&5
++echo "${ECHO_T}$ac_cv_lib_cposix_strerror" >&6
++if test $ac_cv_lib_cposix_strerror = yes; then
++ LIBS="$LIBS -lcposix"
+ fi
+-echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5
+-echo "${ECHO_T}$ac_cv_search_strerror" >&6
+-if test "$ac_cv_search_strerror" != no; then
+- test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS"
+
+-fi
++
+
+ # Check whether --enable-largefile or --disable-largefile was given.
+ if test "${enable_largefile+set}" = set; then
+@@ -3124,8 +3198,7 @@
+ while :; do
+ # IRIX 6.2 and later do not support large files by default,
+ # so use the C compiler's -n32 option if that helps.
+- cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
++ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3150,11 +3223,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -3166,15 +3248,24 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ fi
+-rm -f conftest.$ac_objext
++rm -f conftest.err conftest.$ac_objext
+ CC="$CC -n32"
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -3186,8 +3277,8 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ fi
+-rm -f conftest.$ac_objext
+- break
++rm -f conftest.err conftest.$ac_objext
++ break
+ done
+ CC=$ac_save_CC
+ rm -f conftest.$ac_ext
+@@ -3207,7 +3298,6 @@
+ while :; do
+ ac_cv_sys_file_offset_bits=no
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3232,11 +3322,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -3248,9 +3347,8 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3276,11 +3374,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -3292,7 +3399,7 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ break
+ done
+ fi
+@@ -3314,7 +3421,6 @@
+ while :; do
+ ac_cv_sys_large_files=no
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3339,11 +3445,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -3355,9 +3470,8 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3383,11 +3497,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -3399,7 +3522,7 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ break
+ done
+ fi
+@@ -3443,7 +3566,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3506,11 +3628,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -3523,7 +3654,7 @@
+
+ ac_cv_c_const=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
+ echo "${ECHO_T}$ac_cv_c_const" >&6
+@@ -3550,7 +3681,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3570,11 +3700,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -3587,7 +3726,7 @@
+
+ eval "$as_ac_Header=no"
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -3610,7 +3749,6 @@
+ ac_func_search_save_LIBS=$LIBS
+ ac_cv_search_opendir=no
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3634,11 +3772,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -3650,12 +3797,12 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ if test "$ac_cv_search_opendir" = no; then
+ for ac_lib in dir; do
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3679,11 +3826,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -3696,7 +3852,8 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ done
+ fi
+ LIBS=$ac_func_search_save_LIBS
+@@ -3717,7 +3874,6 @@
+ ac_func_search_save_LIBS=$LIBS
+ ac_cv_search_opendir=no
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3741,11 +3897,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -3757,12 +3922,12 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ if test "$ac_cv_search_opendir" = no; then
+ for ac_lib in x; do
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3786,11 +3951,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -3803,7 +3977,8 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ done
+ fi
+ LIBS=$ac_func_search_save_LIBS
+@@ -3823,7 +3998,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3844,11 +4018,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -3861,12 +4044,11 @@
+
+ ac_cv_header_stdc=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3888,7 +4070,6 @@
+ if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3913,7 +4094,6 @@
+ :
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3925,9 +4105,9 @@
+ # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+ #else
+ # define ISLOWER(c) \
+- (('a' <= (c) && (c) <= 'i') \
+- || ('j' <= (c) && (c) <= 'r') \
+- || ('s' <= (c) && (c) <= 'z'))
++ (('a' <= (c) && (c) <= 'i') \
++ || ('j' <= (c) && (c) <= 'r') \
++ || ('s' <= (c) && (c) <= 'z'))
+ # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+ #endif
+
+@@ -3938,7 +4118,7 @@
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+- || toupper (i) != TOUPPER (i))
++ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
+ }
+@@ -3963,7 +4143,7 @@
+ ( exit $ac_status )
+ ac_cv_header_stdc=no
+ fi
+-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ fi
+ fi
+ fi
+@@ -3999,7 +4179,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4010,11 +4189,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -4027,7 +4215,7 @@
+
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+
+@@ -4035,7 +4223,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4053,6 +4240,7 @@
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+@@ -4072,33 +4260,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+
+ # So? What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+- yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++ ac_header_preproc=yes
++ ;;
++ no:yes:* )
++ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
++echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+- ) |
+- sed "s/^/$as_me: WARNING: /" >&2
+- ;;
+- no:yes )
+- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+- (
+- cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+@@ -4109,7 +4296,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- eval "$as_ac_Header=$ac_header_preproc"
++ eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -4131,7 +4318,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4151,11 +4337,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -4168,7 +4363,7 @@
+
+ ac_cv_type_mode_t=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5
+ echo "${ECHO_T}$ac_cv_type_mode_t" >&6
+@@ -4188,7 +4383,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4208,11 +4402,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -4225,7 +4428,7 @@
+
+ ac_cv_type_off_t=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
+ echo "${ECHO_T}$ac_cv_type_off_t" >&6
+@@ -4245,7 +4448,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4265,11 +4467,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -4282,7 +4493,7 @@
+
+ ac_cv_type_pid_t=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
+ echo "${ECHO_T}$ac_cv_type_pid_t" >&6
+@@ -4302,7 +4513,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4329,11 +4539,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -4346,7 +4565,7 @@
+
+ ac_cv_type_signal=int
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
+ echo "${ECHO_T}$ac_cv_type_signal" >&6
+@@ -4362,7 +4581,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4382,11 +4600,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -4399,7 +4626,7 @@
+
+ ac_cv_type_size_t=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+ echo "${ECHO_T}$ac_cv_type_size_t" >&6
+@@ -4419,7 +4646,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4468,11 +4694,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -4485,7 +4720,7 @@
+
+ ac_cv_header_stdbool_h=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5
+ echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6
+@@ -4495,7 +4730,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4515,11 +4749,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -4532,7 +4775,7 @@
+
+ ac_cv_type__Bool=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5
+ echo "${ECHO_T}$ac_cv_type__Bool" >&6
+@@ -4589,7 +4832,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4600,11 +4842,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -4617,7 +4868,7 @@
+
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+
+@@ -4625,7 +4876,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4643,6 +4893,7 @@
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+@@ -4662,33 +4913,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+
+ # So? What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+- yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+- (
+- cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+- ) |
+- sed "s/^/$as_me: WARNING: /" >&2
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++ ac_header_preproc=yes
+ ;;
+- no:yes )
++ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+@@ -4699,7 +4949,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- eval "$as_ac_Header=$ac_header_preproc"
++ eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -4733,7 +4983,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4744,11 +4993,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -4761,7 +5019,7 @@
+
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+
+@@ -4769,7 +5027,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4787,6 +5044,7 @@
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+@@ -4806,33 +5064,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+
+ # So? What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+- yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+- (
+- cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+- ) |
+- sed "s/^/$as_me: WARNING: /" >&2
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++ ac_header_preproc=yes
+ ;;
+- no:yes )
++ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+@@ -4843,7 +5100,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- eval "$as_ac_Header=$ac_header_preproc"
++ eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -4865,7 +5122,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4886,11 +5142,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -4903,7 +5168,7 @@
+
+ ac_cv_header_time=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
+ echo "${ECHO_T}$ac_cv_header_time" >&6
+@@ -4933,7 +5198,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4964,11 +5228,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -4981,7 +5254,7 @@
+
+ fu_cv_sys_struct_utimbuf=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ fi
+ echo "$as_me:$LINENO: result: $fu_cv_sys_struct_utimbuf" >&5
+@@ -5005,7 +5278,6 @@
+ ac_cv_func_closedir_void=yes
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5045,7 +5317,7 @@
+ ( exit $ac_status )
+ ac_cv_func_closedir_void=yes
+ fi
+-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ fi
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5
+@@ -5076,7 +5348,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5087,11 +5358,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -5104,7 +5384,7 @@
+
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+
+@@ -5112,7 +5392,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5130,6 +5409,7 @@
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+@@ -5149,33 +5429,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+
+ # So? What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+- yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+- (
+- cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+- ) |
+- sed "s/^/$as_me: WARNING: /" >&2
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++ ac_header_preproc=yes
+ ;;
+- no:yes )
++ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+@@ -5186,7 +5465,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- eval "$as_ac_Header=$ac_header_preproc"
++ eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -5220,7 +5499,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5231,11 +5509,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -5248,7 +5535,7 @@
+
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+
+@@ -5256,7 +5543,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5274,6 +5560,7 @@
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+@@ -5293,33 +5580,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+
+ # So? What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+- yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+- (
+- cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+- ) |
+- sed "s/^/$as_me: WARNING: /" >&2
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++ ac_header_preproc=yes
+ ;;
+- no:yes )
++ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+@@ -5330,7 +5616,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- eval "$as_ac_Header=$ac_header_preproc"
++ eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -5364,7 +5650,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5375,11 +5660,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -5392,7 +5686,7 @@
+
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+
+@@ -5400,7 +5694,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5418,6 +5711,7 @@
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+@@ -5437,33 +5731,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+
+ # So? What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+- yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+- (
+- cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+- ) |
+- sed "s/^/$as_me: WARNING: /" >&2
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++ ac_header_preproc=yes
+ ;;
+- no:yes )
++ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+@@ -5474,7 +5767,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- eval "$as_ac_Header=$ac_header_preproc"
++ eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -5497,7 +5790,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5517,11 +5809,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -5534,7 +5835,7 @@
+
+ ac_cv_have_decl_getenv=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getenv" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_getenv" >&6
+@@ -5562,7 +5863,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5582,11 +5882,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -5599,7 +5908,7 @@
+
+ ac_cv_have_decl_malloc=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_malloc" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_malloc" >&6
+@@ -5628,7 +5937,6 @@
+ else
+
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5647,11 +5955,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -5664,7 +5981,7 @@
+
+ ac_cv_win_or_dos=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_win_or_dos" >&5
+@@ -5714,7 +6031,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5725,11 +6041,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -5742,7 +6067,7 @@
+
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+
+@@ -5750,7 +6075,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5768,6 +6092,7 @@
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+@@ -5787,33 +6112,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+
+ # So? What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+- yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+- (
+- cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+- ) |
+- sed "s/^/$as_me: WARNING: /" >&2
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++ ac_header_preproc=yes
+ ;;
+- no:yes )
++ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+@@ -5824,7 +6148,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- eval "$as_ac_Header=$ac_header_preproc"
++ eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -5872,7 +6196,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5905,11 +6228,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -5922,7 +6254,8 @@
+
+ jm_cv_struct_dirent_d_ino=no
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+
+
+ fi
+@@ -6011,21 +6344,28 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
++ For example, HP-UX 11i <limits.h> declares gettimeofday. */
++#define $ac_func innocuous_$ac_func
++
+ /* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
++
+ #ifdef __STDC__
+ # include <limits.h>
+ #else
+ # include <assert.h>
+ #endif
++
++#undef $ac_func
++
+ /* Override any gcc2 internal prototype to avoid an error. */
+ #ifdef __cplusplus
+ extern "C"
+@@ -6056,11 +6396,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -6073,7 +6422,8 @@
+
+ eval "$as_ac_var=no"
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+@@ -6126,21 +6476,28 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
++ For example, HP-UX 11i <limits.h> declares gettimeofday. */
++#define $ac_func innocuous_$ac_func
++
+ /* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
++
+ #ifdef __STDC__
+ # include <limits.h>
+ #else
+ # include <assert.h>
+ #endif
++
++#undef $ac_func
++
+ /* Override any gcc2 internal prototype to avoid an error. */
+ #ifdef __cplusplus
+ extern "C"
+@@ -6171,11 +6528,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -6188,7 +6554,8 @@
+
+ eval "$as_ac_var=no"
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+@@ -6203,21 +6570,28 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
++/* Define _doprnt to an innocuous variant, in case <limits.h> declares _doprnt.
++ For example, HP-UX 11i <limits.h> declares gettimeofday. */
++#define _doprnt innocuous__doprnt
++
+ /* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char _doprnt (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
++
+ #ifdef __STDC__
+ # include <limits.h>
+ #else
+ # include <assert.h>
+ #endif
++
++#undef _doprnt
++
+ /* Override any gcc2 internal prototype to avoid an error. */
+ #ifdef __cplusplus
+ extern "C"
+@@ -6248,11 +6622,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -6265,7 +6648,8 @@
+
+ ac_cv_func__doprnt=no
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5
+ echo "${ECHO_T}$ac_cv_func__doprnt" >&6
+@@ -6288,13 +6672,12 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+-
++$ac_includes_default
+ int
+ main ()
+ {
+@@ -6305,11 +6688,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -6322,12 +6714,20 @@
+
+ ac_cv_lib_error_at_line=no
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_lib_error_at_line" >&5
+ echo "${ECHO_T}$ac_cv_lib_error_at_line" >&6
+ if test $ac_cv_lib_error_at_line = no; then
+- LIBOBJS="$LIBOBJS error.$ac_objext"
++ case $LIBOBJS in
++ "error.$ac_objext" | \
++ *" error.$ac_objext" | \
++ "error.$ac_objext "* | \
++ *" error.$ac_objext "* ) ;;
++ *) LIBOBJS="$LIBOBJS error.$ac_objext" ;;
++esac
++
+ fi
+
+
+@@ -6343,21 +6743,28 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
++ For example, HP-UX 11i <limits.h> declares gettimeofday. */
++#define $ac_func innocuous_$ac_func
++
+ /* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
++
+ #ifdef __STDC__
+ # include <limits.h>
+ #else
+ # include <assert.h>
+ #endif
++
++#undef $ac_func
++
+ /* Override any gcc2 internal prototype to avoid an error. */
+ #ifdef __cplusplus
+ extern "C"
+@@ -6388,11 +6795,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -6405,7 +6821,8 @@
+
+ eval "$as_ac_var=no"
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+@@ -6423,7 +6840,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -6443,11 +6859,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -6460,7 +6885,7 @@
+
+ ac_cv_have_decl_strerror=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_strerror" >&6
+@@ -6486,7 +6911,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -6506,11 +6930,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -6523,7 +6956,7 @@
+
+ ac_cv_have_decl_strerror_r=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror_r" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_strerror_r" >&6
+@@ -6553,21 +6986,28 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
++ For example, HP-UX 11i <limits.h> declares gettimeofday. */
++#define $ac_func innocuous_$ac_func
++
+ /* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
++
+ #ifdef __STDC__
+ # include <limits.h>
+ #else
+ # include <assert.h>
+ #endif
++
++#undef $ac_func
++
+ /* Override any gcc2 internal prototype to avoid an error. */
+ #ifdef __cplusplus
+ extern "C"
+@@ -6598,11 +7038,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -6615,7 +7064,8 @@
+
+ eval "$as_ac_var=no"
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+@@ -6636,7 +7086,6 @@
+ ac_cv_func_strerror_r_char_p=no
+ if test $ac_cv_have_decl_strerror_r = yes; then
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -6657,11 +7106,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -6673,7 +7131,7 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ else
+ # strerror_r is not declared. Choose between
+ # systems that have relatively inaccessible declarations for the
+@@ -6685,7 +7143,6 @@
+ :
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -6721,7 +7178,7 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ fi
+-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ fi
+ fi
+
+@@ -6749,21 +7206,28 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
++ For example, HP-UX 11i <limits.h> declares gettimeofday. */
++#define $ac_func innocuous_$ac_func
++
+ /* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
++
+ #ifdef __STDC__
+ # include <limits.h>
+ #else
+ # include <assert.h>
+ #endif
++
++#undef $ac_func
++
+ /* Override any gcc2 internal prototype to avoid an error. */
+ #ifdef __cplusplus
+ extern "C"
+@@ -6794,11 +7258,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -6811,7 +7284,8 @@
+
+ eval "$as_ac_var=no"
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+@@ -6821,7 +7295,14 @@
+ _ACEOF
+
+ else
+- LIBOBJS="$LIBOBJS $ac_func.$ac_objext"
++ case $LIBOBJS in
++ "$ac_func.$ac_objext" | \
++ *" $ac_func.$ac_objext" | \
++ "$ac_func.$ac_objext "* | \
++ *" $ac_func.$ac_objext "* ) ;;
++ *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
++esac
++
+ fi
+ done
+
+@@ -6855,7 +7336,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -6866,11 +7346,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -6883,7 +7372,7 @@
+
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+
+@@ -6891,7 +7380,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -6909,6 +7397,7 @@
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+@@ -6928,33 +7417,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+
+ # So? What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+- yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+- (
+- cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+- ) |
+- sed "s/^/$as_me: WARNING: /" >&2
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++ ac_header_preproc=yes
+ ;;
+- no:yes )
++ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+@@ -6965,7 +7453,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- eval "$as_ac_Header=$ac_header_preproc"
++ eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -6989,7 +7477,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -7053,21 +7540,28 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
++ For example, HP-UX 11i <limits.h> declares gettimeofday. */
++#define $ac_func innocuous_$ac_func
++
+ /* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
++
+ #ifdef __STDC__
+ # include <limits.h>
+ #else
+ # include <assert.h>
+ #endif
++
++#undef $ac_func
++
+ /* Override any gcc2 internal prototype to avoid an error. */
+ #ifdef __cplusplus
+ extern "C"
+@@ -7098,11 +7592,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -7115,7 +7618,8 @@
+
+ eval "$as_ac_var=no"
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+@@ -7125,7 +7629,14 @@
+ _ACEOF
+
+ else
+- LIBOBJS="$LIBOBJS $ac_func.$ac_objext"
++ case $LIBOBJS in
++ "$ac_func.$ac_objext" | \
++ *" $ac_func.$ac_objext" | \
++ "$ac_func.$ac_objext "* | \
++ *" $ac_func.$ac_objext "* ) ;;
++ *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
++esac
++
+ fi
+ done
+
+@@ -7163,7 +7674,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -7174,11 +7684,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -7191,7 +7710,7 @@
+
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+
+@@ -7199,7 +7718,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -7217,6 +7735,7 @@
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+@@ -7236,33 +7755,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+
+ # So? What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+- yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+- (
+- cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+- ) |
+- sed "s/^/$as_me: WARNING: /" >&2
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++ ac_header_preproc=yes
+ ;;
+- no:yes )
++ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+@@ -7273,7 +7791,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- eval "$as_ac_Header=$ac_header_preproc"
++ eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -7297,7 +7815,6 @@
+ ac_cv_func_malloc_0_nonnull=no
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -7337,7 +7854,7 @@
+ ( exit $ac_status )
+ ac_cv_func_malloc_0_nonnull=no
+ fi
+-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ fi
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5
+@@ -7353,7 +7870,14 @@
+ #define HAVE_MALLOC 0
+ _ACEOF
+
+- LIBOBJS="$LIBOBJS malloc.$ac_objext"
++ case $LIBOBJS in
++ "malloc.$ac_objext" | \
++ *" malloc.$ac_objext" | \
++ "malloc.$ac_objext "* | \
++ *" malloc.$ac_objext "* ) ;;
++ *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;;
++esac
++
+
+ cat >>confdefs.h <<\_ACEOF
+ #define malloc rpl_malloc
+@@ -7388,7 +7912,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -7399,11 +7922,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -7416,7 +7948,7 @@
+
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+
+@@ -7424,7 +7956,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -7442,6 +7973,7 @@
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+@@ -7461,33 +7993,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+
+ # So? What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+- yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+- (
+- cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+- ) |
+- sed "s/^/$as_me: WARNING: /" >&2
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++ ac_header_preproc=yes
+ ;;
+- no:yes )
++ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+@@ -7498,7 +8029,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- eval "$as_ac_Header=$ac_header_preproc"
++ eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -7522,7 +8053,6 @@
+ ac_cv_func_realloc_0_nonnull=no
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -7562,7 +8092,7 @@
+ ( exit $ac_status )
+ ac_cv_func_realloc_0_nonnull=no
+ fi
+-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ fi
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_func_realloc_0_nonnull" >&5
+@@ -7578,7 +8108,14 @@
+ #define HAVE_REALLOC 0
+ _ACEOF
+
+- LIBOBJS="$LIBOBJS realloc.$ac_objext"
++ case $LIBOBJS in
++ "realloc.$ac_objext" | \
++ *" realloc.$ac_objext" | \
++ "realloc.$ac_objext "* | \
++ *" realloc.$ac_objext "* ) ;;
++ *) LIBOBJS="$LIBOBJS realloc.$ac_objext" ;;
++esac
++
+
+ cat >>confdefs.h <<\_ACEOF
+ #define realloc rpl_realloc
+@@ -7619,7 +8156,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -7630,11 +8166,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -7647,7 +8192,7 @@
+
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+
+@@ -7655,7 +8200,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -7673,6 +8217,7 @@
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+@@ -7692,33 +8237,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+
+ # So? What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+- yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+- (
+- cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+- ) |
+- sed "s/^/$as_me: WARNING: /" >&2
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++ ac_header_preproc=yes
+ ;;
+- no:yes )
++ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+@@ -7729,7 +8273,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- eval "$as_ac_Header=$ac_header_preproc"
++ eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -7772,7 +8316,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -7783,11 +8326,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -7800,7 +8352,7 @@
+
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+
+@@ -7808,7 +8360,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -7826,6 +8377,7 @@
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+@@ -7845,33 +8397,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+
+ # So? What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+- yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+- (
+- cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+- ) |
+- sed "s/^/$as_me: WARNING: /" >&2
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++ ac_header_preproc=yes
+ ;;
+- no:yes )
++ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+@@ -7882,7 +8433,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- eval "$as_ac_Header=$ac_header_preproc"
++ eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -7916,7 +8467,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -7927,11 +8477,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -7944,7 +8503,7 @@
+
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+
+@@ -7952,7 +8511,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -7970,6 +8528,7 @@
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+@@ -7989,33 +8548,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+
+ # So? What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+- yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+- (
+- cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+- ) |
+- sed "s/^/$as_me: WARNING: /" >&2
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++ ac_header_preproc=yes
+ ;;
+- no:yes )
++ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+@@ -8026,7 +8584,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- eval "$as_ac_Header=$ac_header_preproc"
++ eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -8053,21 +8611,28 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
++ For example, HP-UX 11i <limits.h> declares gettimeofday. */
++#define $ac_func innocuous_$ac_func
++
+ /* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
++
+ #ifdef __STDC__
+ # include <limits.h>
+ #else
+ # include <assert.h>
+ #endif
++
++#undef $ac_func
++
+ /* Override any gcc2 internal prototype to avoid an error. */
+ #ifdef __cplusplus
+ extern "C"
+@@ -8098,11 +8663,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -8115,7 +8689,8 @@
+
+ eval "$as_ac_var=no"
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+@@ -8139,21 +8714,28 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
++ For example, HP-UX 11i <limits.h> declares gettimeofday. */
++#define $ac_func innocuous_$ac_func
++
+ /* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
++
+ #ifdef __STDC__
+ # include <limits.h>
+ #else
+ # include <assert.h>
+ #endif
++
++#undef $ac_func
++
+ /* Override any gcc2 internal prototype to avoid an error. */
+ #ifdef __cplusplus
+ extern "C"
+@@ -8184,11 +8766,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -8201,7 +8792,8 @@
+
+ eval "$as_ac_var=no"
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+@@ -8241,7 +8833,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -8259,11 +8850,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -8276,7 +8876,7 @@
+
+ ac_cv_type_mbstate_t=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_type_mbstate_t" >&5
+ echo "${ECHO_T}$ac_cv_type_mbstate_t" >&6
+@@ -8300,7 +8900,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -8317,11 +8916,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -8334,7 +8942,8 @@
+
+ jm_cv_func_mbrtowc=no
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $jm_cv_func_mbrtowc" >&5
+ echo "${ECHO_T}$jm_cv_func_mbrtowc" >&6
+@@ -8348,69 +8957,465 @@
+
+
+
+-
+-
+-
+-
+-for ac_func in pathconf
+-do
+-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+-echo "$as_me:$LINENO: checking for $ac_func" >&5
+-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+-if eval "test \"\${$as_ac_var+set}\" = set"; then
++ echo "$as_me:$LINENO: checking whether free is declared" >&5
++echo $ECHO_N "checking whether free is declared... $ECHO_C" >&6
++if test "${ac_cv_have_decl_free+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+-/* System header to define __stub macros and hopefully few prototypes,
+- which can conflict with char $ac_func (); below.
+- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+- <limits.h> exists even on freestanding compilers. */
+-#ifdef __STDC__
+-# include <limits.h>
+-#else
+-# include <assert.h>
+-#endif
+-/* Override any gcc2 internal prototype to avoid an error. */
+-#ifdef __cplusplus
+-extern "C"
+-{
+-#endif
+-/* We use char because int might match the return type of a gcc2
+- builtin and then its argument prototype would still apply. */
+-char $ac_func ();
+-/* The GNU C library defines this for functions which it implements
+- to always fail with ENOSYS. Some functions are actually named
+- something starting with __ and the normal name is an alias. */
+-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+-choke me
+-#else
+-char (*f) () = $ac_func;
+-#endif
+-#ifdef __cplusplus
+-}
+-#endif
+-
++$ac_includes_default
+ int
+ main ()
+ {
+-return f != $ac_func;
++#ifndef free
++ char *p = (char *) free;
++#endif
++
+ ;
+ return 0;
+ }
+ _ACEOF
+-rm -f conftest.$ac_objext conftest$ac_exeext
+-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_have_decl_free=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_have_decl_free=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_have_decl_free" >&5
++echo "${ECHO_T}$ac_cv_have_decl_free" >&6
++if test $ac_cv_have_decl_free = yes; then
++
++cat >>confdefs.h <<_ACEOF
++#define HAVE_DECL_FREE 1
++_ACEOF
++
++
++else
++ cat >>confdefs.h <<_ACEOF
++#define HAVE_DECL_FREE 0
++_ACEOF
++
++
++fi
++
++
++
++
++
++ :
++
++
++
++
++
++ echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5
++echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6
++if test "${ac_cv_header_stdbool_h+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++ #include <stdbool.h>
++ #ifndef bool
++ "error: bool is not defined"
++ #endif
++ #ifndef false
++ "error: false is not defined"
++ #endif
++ #if false
++ "error: false is not 0"
++ #endif
++ #ifndef true
++ "error: false is not defined"
++ #endif
++ #if true != 1
++ "error: true is not 1"
++ #endif
++ #ifndef __bool_true_false_are_defined
++ "error: __bool_true_false_are_defined is not defined"
++ #endif
++
++ struct s { _Bool s: 1; _Bool t; } s;
++
++ char a[true == 1 ? 1 : -1];
++ char b[false == 0 ? 1 : -1];
++ char c[__bool_true_false_are_defined == 1 ? 1 : -1];
++ char d[(bool) -0.5 == true ? 1 : -1];
++ bool e = &s;
++ char f[(_Bool) -0.0 == false ? 1 : -1];
++ char g[true];
++ char h[sizeof (_Bool)];
++ char i[sizeof s.t];
++
++int
++main ()
++{
++ return !a + !b + !c + !d + !e + !f + !g + !h + !i;
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_header_stdbool_h=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_header_stdbool_h=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5
++echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6
++ echo "$as_me:$LINENO: checking for _Bool" >&5
++echo $ECHO_N "checking for _Bool... $ECHO_C" >&6
++if test "${ac_cv_type__Bool+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++$ac_includes_default
++int
++main ()
++{
++if ((_Bool *) 0)
++ return 0;
++if (sizeof (_Bool))
++ return 0;
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_type__Bool=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_type__Bool=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5
++echo "${ECHO_T}$ac_cv_type__Bool" >&6
++if test $ac_cv_type__Bool = yes; then
++
++cat >>confdefs.h <<_ACEOF
++#define HAVE__BOOL 1
++_ACEOF
++
++
++fi
++
++ if test $ac_cv_header_stdbool_h = yes; then
++
++cat >>confdefs.h <<\_ACEOF
++#define HAVE_STDBOOL_H 1
++_ACEOF
++
++ fi
++
++ :
++
++
++
++
++
++
++
++
++
++
++echo "$as_me:$LINENO: checking for nanosecond timestamps in struct stat" >&5
++echo $ECHO_N "checking for nanosecond timestamps in struct stat... $ECHO_C" >&6
++if test "${ac_cv_stat_nsec+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++ #include <sys/types.h>
++ #include <sys/stat.h>
++ #include <unistd.h>
++ struct stat st;
++
++int
++main ()
++{
++ return st.st_atimensec + st.st_mtimensec + st.st_ctimensec;
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_stat_nsec=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_stat_nsec=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++fi
++echo "$as_me:$LINENO: result: $ac_cv_stat_nsec" >&5
++echo "${ECHO_T}$ac_cv_stat_nsec" >&6
++ if test $ac_cv_stat_nsec = yes; then
++
++cat >>confdefs.h <<\_ACEOF
++#define HAVE_STAT_NSEC 1
++_ACEOF
++
++ fi
++
++ echo "$as_me:$LINENO: checking for nanosecond timestamps in struct stat" >&5
++echo $ECHO_N "checking for nanosecond timestamps in struct stat... $ECHO_C" >&6
++if test "${ac_cv_stat_timeval+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++ #include <time.h>
++ #include <sys/types.h>
++ #include <sys/stat.h>
++ #include <unistd.h>
++ struct stat st;
++
++int
++main ()
++{
++ return st.st_atim.tv_nsec + st.st_mtim.tv_nsec + st.st_ctim.tv_nsec;
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_stat_timeval=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_stat_timeval=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++fi
++echo "$as_me:$LINENO: result: $ac_cv_stat_timeval" >&5
++echo "${ECHO_T}$ac_cv_stat_timeval" >&6
++ if test $ac_cv_stat_timeval = yes; then
++
++cat >>confdefs.h <<\_ACEOF
++#define HAVE_STAT_TIMEVAL 1
++_ACEOF
++
++ fi
++
++
++
++
++
++for ac_func in pathconf
++do
++as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
++echo "$as_me:$LINENO: checking for $ac_func" >&5
++echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
++if eval "test \"\${$as_ac_var+set}\" = set"; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
++ For example, HP-UX 11i <limits.h> declares gettimeofday. */
++#define $ac_func innocuous_$ac_func
++
++/* System header to define __stub macros and hopefully few prototypes,
++ which can conflict with char $ac_func (); below.
++ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
++ <limits.h> exists even on freestanding compilers. */
++
++#ifdef __STDC__
++# include <limits.h>
++#else
++# include <assert.h>
++#endif
++
++#undef $ac_func
++
++/* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++{
++#endif
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char $ac_func ();
++/* The GNU C library defines this for functions which it implements
++ to always fail with ENOSYS. Some functions are actually named
++ something starting with __ and the normal name is an alias. */
++#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
++choke me
++#else
++char (*f) () = $ac_func;
++#endif
++#ifdef __cplusplus
++}
++#endif
++
++int
++main ()
++{
++return f != $ac_func;
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -8423,7 +9428,8 @@
+
+ eval "$as_ac_var=no"
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+@@ -8454,7 +9460,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -8465,11 +9470,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -8482,7 +9496,7 @@
+
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+
+@@ -8490,7 +9504,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -8508,6 +9521,7 @@
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+@@ -8527,33 +9541,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+
+ # So? What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+- yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+- (
+- cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+- ) |
+- sed "s/^/$as_me: WARNING: /" >&2
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++ ac_header_preproc=yes
+ ;;
+- no:yes )
++ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+@@ -8564,7 +9577,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- eval "$as_ac_Header=$ac_header_preproc"
++ eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -8587,7 +9600,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -8607,11 +9619,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -8624,7 +9645,7 @@
+
+ ac_cv_have_decl_free=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_free" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_free" >&6
+@@ -8648,7 +9669,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -8668,11 +9688,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -8685,7 +9714,7 @@
+
+ ac_cv_have_decl_getenv=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getenv" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_getenv" >&6
+@@ -8709,7 +9738,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -8729,11 +9757,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -8746,7 +9783,7 @@
+
+ ac_cv_have_decl_malloc=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_malloc" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_malloc" >&6
+@@ -8770,7 +9807,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -8790,11 +9826,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -8807,7 +9852,7 @@
+
+ ac_cv_have_decl_mktemp=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_mktemp" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_mktemp" >&6
+@@ -8849,21 +9894,28 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
++ For example, HP-UX 11i <limits.h> declares gettimeofday. */
++#define $ac_func innocuous_$ac_func
++
+ /* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
++
+ #ifdef __STDC__
+ # include <limits.h>
+ #else
+ # include <assert.h>
+ #endif
++
++#undef $ac_func
++
+ /* Override any gcc2 internal prototype to avoid an error. */
+ #ifdef __cplusplus
+ extern "C"
+@@ -8894,11 +9946,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -8911,7 +9972,8 @@
+
+ eval "$as_ac_var=no"
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+@@ -8934,21 +9996,28 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
++ For example, HP-UX 11i <limits.h> declares gettimeofday. */
++#define $ac_func innocuous_$ac_func
++
+ /* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
++
+ #ifdef __STDC__
+ # include <limits.h>
+ #else
+ # include <assert.h>
+ #endif
++
++#undef $ac_func
++
+ /* Override any gcc2 internal prototype to avoid an error. */
+ #ifdef __cplusplus
+ extern "C"
+@@ -8979,11 +10048,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -8996,7 +10074,8 @@
+
+ eval "$as_ac_var=no"
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+@@ -9006,7 +10085,14 @@
+ _ACEOF
+
+ else
+- LIBOBJS="$LIBOBJS $ac_func.$ac_objext"
++ case $LIBOBJS in
++ "$ac_func.$ac_objext" | \
++ *" $ac_func.$ac_objext" | \
++ "$ac_func.$ac_objext "* | \
++ *" $ac_func.$ac_objext "* ) ;;
++ *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
++esac
++
+ fi
+ done
+
+@@ -9019,7 +10105,6 @@
+ while :; do
+ ac_cv_sys_largefile_source=no
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9036,11 +10121,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -9052,9 +10146,8 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9072,11 +10165,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -9088,7 +10190,7 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ break
+ done
+ fi
+@@ -9112,7 +10214,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9129,11 +10230,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -9146,7 +10256,8 @@
+
+ ac_cv_func_fseeko=no
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_func_fseeko" >&5
+ echo "${ECHO_T}$ac_cv_func_fseeko" >&6
+@@ -9165,7 +10276,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9185,11 +10295,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -9202,7 +10321,7 @@
+
+ ac_cv_have_decl_clearerr_unlocked=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_clearerr_unlocked" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_clearerr_unlocked" >&6
+@@ -9230,7 +10349,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9250,11 +10368,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -9267,7 +10394,7 @@
+
+ ac_cv_have_decl_feof_unlocked=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_feof_unlocked" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_feof_unlocked" >&6
+@@ -9295,7 +10422,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9315,11 +10441,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -9332,7 +10467,7 @@
+
+ ac_cv_have_decl_ferror_unlocked=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_ferror_unlocked" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_ferror_unlocked" >&6
+@@ -9360,7 +10495,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9380,11 +10514,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -9397,7 +10540,7 @@
+
+ ac_cv_have_decl_fflush_unlocked=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fflush_unlocked" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_fflush_unlocked" >&6
+@@ -9425,7 +10568,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9445,11 +10587,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -9462,7 +10613,7 @@
+
+ ac_cv_have_decl_fgets_unlocked=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fgets_unlocked" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_fgets_unlocked" >&6
+@@ -9490,7 +10641,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9510,11 +10660,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -9527,7 +10686,7 @@
+
+ ac_cv_have_decl_fputc_unlocked=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputc_unlocked" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_fputc_unlocked" >&6
+@@ -9555,7 +10714,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9575,11 +10733,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -9592,7 +10759,7 @@
+
+ ac_cv_have_decl_fputs_unlocked=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputs_unlocked" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_fputs_unlocked" >&6
+@@ -9620,7 +10787,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9640,11 +10806,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -9657,7 +10832,7 @@
+
+ ac_cv_have_decl_fread_unlocked=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fread_unlocked" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_fread_unlocked" >&6
+@@ -9685,7 +10860,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9705,11 +10879,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -9722,7 +10905,7 @@
+
+ ac_cv_have_decl_fwrite_unlocked=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fwrite_unlocked" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_fwrite_unlocked" >&6
+@@ -9750,7 +10933,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9770,11 +10952,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -9787,7 +10978,7 @@
+
+ ac_cv_have_decl_getc_unlocked=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getc_unlocked" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_getc_unlocked" >&6
+@@ -9815,7 +11006,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9835,11 +11025,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -9852,7 +11051,7 @@
+
+ ac_cv_have_decl_getchar_unlocked=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getchar_unlocked" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_getchar_unlocked" >&6
+@@ -9880,7 +11079,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9900,11 +11098,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -9917,7 +11124,7 @@
+
+ ac_cv_have_decl_putc_unlocked=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_putc_unlocked" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_putc_unlocked" >&6
+@@ -9945,7 +11152,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9965,11 +11171,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -9982,7 +11197,7 @@
+
+ ac_cv_have_decl_putchar_unlocked=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_putchar_unlocked" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_putchar_unlocked" >&6
+@@ -10075,7 +11290,6 @@
+ ac_cv_func_closedir_void=yes
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -10115,7 +11329,7 @@
+ ( exit $ac_status )
+ ac_cv_func_closedir_void=yes
+ fi
+-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ fi
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5
+@@ -10146,7 +11360,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -10157,11 +11370,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -10174,7 +11396,7 @@
+
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+
+@@ -10182,7 +11404,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -10200,6 +11421,7 @@
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+@@ -10219,33 +11441,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+
+ # So? What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+- yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+- (
+- cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+- ) |
+- sed "s/^/$as_me: WARNING: /" >&2
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++ ac_header_preproc=yes
+ ;;
+- no:yes )
++ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+@@ -10256,7 +11477,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- eval "$as_ac_Header=$ac_header_preproc"
++ eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -10277,7 +11498,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -10300,11 +11520,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -10317,7 +11546,8 @@
+
+ ac_cv_func_setmode_dos=no
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_func_setmode_dos" >&5
+ echo "${ECHO_T}$ac_cv_func_setmode_dos" >&6
+@@ -10338,21 +11568,28 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
++ For example, HP-UX 11i <limits.h> declares gettimeofday. */
++#define $ac_func innocuous_$ac_func
++
+ /* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
++
+ #ifdef __STDC__
+ # include <limits.h>
+ #else
+ # include <assert.h>
+ #endif
++
++#undef $ac_func
++
+ /* Override any gcc2 internal prototype to avoid an error. */
+ #ifdef __cplusplus
+ extern "C"
+@@ -10383,11 +11620,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -10400,7 +11646,8 @@
+
+ eval "$as_ac_var=no"
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+@@ -10415,21 +11662,28 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
++/* Define _doprnt to an innocuous variant, in case <limits.h> declares _doprnt.
++ For example, HP-UX 11i <limits.h> declares gettimeofday. */
++#define _doprnt innocuous__doprnt
++
+ /* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char _doprnt (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
++
+ #ifdef __STDC__
+ # include <limits.h>
+ #else
+ # include <assert.h>
+ #endif
++
++#undef _doprnt
++
+ /* Override any gcc2 internal prototype to avoid an error. */
+ #ifdef __cplusplus
+ extern "C"
+@@ -10460,11 +11714,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -10477,7 +11740,8 @@
+
+ ac_cv_func__doprnt=no
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5
+ echo "${ECHO_T}$ac_cv_func__doprnt" >&6
+@@ -10503,21 +11767,28 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
++ For example, HP-UX 11i <limits.h> declares gettimeofday. */
++#define $ac_func innocuous_$ac_func
++
+ /* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
++
+ #ifdef __STDC__
+ # include <limits.h>
+ #else
+ # include <assert.h>
+ #endif
++
++#undef $ac_func
++
+ /* Override any gcc2 internal prototype to avoid an error. */
+ #ifdef __cplusplus
+ extern "C"
+@@ -10548,11 +11819,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -10565,7 +11845,8 @@
+
+ eval "$as_ac_var=no"
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+@@ -10585,7 +11866,6 @@
+ patch_cv_mkdir_takes_one_arg=no
+ if test $ac_cv_func_mkdir = yes; then
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -10605,11 +11885,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -10621,7 +11910,6 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -10641,11 +11929,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -10658,10 +11955,10 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+
+
+@@ -10686,7 +11983,6 @@
+ else
+
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -10705,11 +12001,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -10722,7 +12027,7 @@
+
+ ac_cv_win_or_dos=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_win_or_dos" >&5
+@@ -10834,13 +12139,13 @@
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+- "s/'/'\\\\''/g;
+- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
++ "s/'/'\\\\''/g;
++ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n \
+- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
++ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+ } |
+@@ -10870,13 +12175,13 @@
+ # trailing colons and then remove the whole line if VPATH becomes empty
+ # (actually we leave an empty line to preserve line numbers).
+ if test "x$srcdir" = x.; then
+- ac_vpsub='/^[ ]*VPATH[ ]*=/{
++ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+ s/:*\$(srcdir):*/:/;
+ s/:*\${srcdir}:*/:/;
+ s/:*@srcdir@:*/:/;
+-s/^\([^=]*=[ ]*\):*/\1/;
++s/^\([^=]*=[ ]*\):*/\1/;
+ s/:*$//;
+-s/^[^=]*=[ ]*$//;
++s/^[^=]*=[ ]*$//;
+ }'
+ fi
+
+@@ -10887,7 +12192,7 @@
+ for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_i=`echo "$ac_i" |
+- sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
++ sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+ # 2. Add them.
+ ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+@@ -10931,9 +12236,10 @@
+ elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+ fi
++DUALCASE=1; export DUALCASE # for MKS sh
+
+ # Support unset when possible.
+-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
++if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+ else
+ as_unset=false
+@@ -10952,7 +12258,7 @@
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+ do
+- if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
++ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+@@ -11131,16 +12437,17 @@
+ if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+ else
++ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+ fi
+
+ as_executable_p="test -f"
+
+ # Sed expression to map a string onto a valid CPP name.
+-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
++as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+ # Sed expression to map a string onto a valid variable name.
+-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
++as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+ # IFS
+@@ -11167,7 +12474,7 @@
+ cat >&5 <<_CSEOF
+
+ This file was extended by patch $as_me 2.5.9, which was
+-generated by GNU Autoconf 2.57. Invocation command line was
++generated by GNU Autoconf 2.59. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+@@ -11211,9 +12518,9 @@
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+- instantiate the configuration file FILE
++ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+- instantiate the configuration header FILE
++ instantiate the configuration header FILE
+
+ Configuration files:
+ $config_files
+@@ -11227,11 +12534,10 @@
+ cat >>$CONFIG_STATUS <<_ACEOF
+ ac_cs_version="\\
+ patch config.status 2.5.9
+-configured by $0, generated by GNU Autoconf 2.57,
++configured by $0, generated by GNU Autoconf 2.59,
+ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+-Free Software Foundation, Inc.
++Copyright (C) 2003 Free Software Foundation, Inc.
+ This config.status script is free software; the Free Software Foundation
+ gives unlimited permission to copy, distribute and modify it."
+ srcdir=$srcdir
+@@ -11463,9 +12769,9 @@
+ (echo ':t
+ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+ if test -z "$ac_sed_cmds"; then
+- ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
++ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+ else
+- ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
++ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+ fi
+ ac_sed_frag=`expr $ac_sed_frag + 1`
+ ac_beg=$ac_end
+@@ -11483,21 +12789,21 @@
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+- cat >$tmp/stdin
+- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
++ cat >$tmp/stdin
++ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
+ esac
+
+ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+- X"$ac_file" : 'X\(//\)[^/]' \| \
+- X"$ac_file" : 'X\(//\)$' \| \
+- X"$ac_file" : 'X\(/\)' \| \
+- . : '\(.\)' 2>/dev/null ||
++ X"$ac_file" : 'X\(//\)[^/]' \| \
++ X"$ac_file" : 'X\(//\)$' \| \
++ X"$ac_file" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
+ echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+@@ -11513,10 +12819,10 @@
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+- X"$as_dir" : 'X\(//\)[^/]' \| \
+- X"$as_dir" : 'X\(//\)$' \| \
+- X"$as_dir" : 'X\(/\)' \| \
+- . : '\(.\)' 2>/dev/null ||
++ X"$as_dir" : 'X\(//\)[^/]' \| \
++ X"$as_dir" : 'X\(//\)$' \| \
++ X"$as_dir" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
+ echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+@@ -11554,12 +12860,45 @@
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+ esac
+-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+-# absolute.
+-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
++
++# Do not use `cd foo && pwd` to compute absolute paths, because
++# the directories may not exist.
++case `pwd` in
++.) ac_abs_builddir="$ac_dir";;
++*)
++ case "$ac_dir" in
++ .) ac_abs_builddir=`pwd`;;
++ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
++ *) ac_abs_builddir=`pwd`/"$ac_dir";;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_builddir=${ac_top_builddir}.;;
++*)
++ case ${ac_top_builddir}. in
++ .) ac_abs_top_builddir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
++ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_srcdir=$ac_srcdir;;
++*)
++ case $ac_srcdir in
++ .) ac_abs_srcdir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
++ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_srcdir=$ac_top_srcdir;;
++*)
++ case $ac_top_srcdir in
++ .) ac_abs_top_srcdir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
++ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
++ esac;;
++esac
+
+
+ case $INSTALL in
+@@ -11567,11 +12906,6 @@
+ *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+ esac
+
+- if test x"$ac_file" != x-; then
+- { echo "$as_me:$LINENO: creating $ac_file" >&5
+-echo "$as_me: creating $ac_file" >&6;}
+- rm -f "$ac_file"
+- fi
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+@@ -11581,7 +12915,7 @@
+ configure_input="$ac_file. "
+ fi
+ configure_input=$configure_input"Generated from `echo $ac_file_in |
+- sed 's,.*/,,'` by configure."
++ sed 's,.*/,,'` by configure."
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+@@ -11590,26 +12924,32 @@
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+- # Absolute (can't be DOS-style, as IFS=:)
+- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
++ # Absolute (can't be DOS-style, as IFS=:)
++ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+- echo $f;;
++ echo "$f";;
+ *) # Relative
+- if test -f "$f"; then
+- # Build tree
+- echo $f
+- elif test -f "$srcdir/$f"; then
+- # Source tree
+- echo $srcdir/$f
+- else
+- # /dev/null tree
+- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
++ if test -f "$f"; then
++ # Build tree
++ echo "$f"
++ elif test -f "$srcdir/$f"; then
++ # Source tree
++ echo "$srcdir/$f"
++ else
++ # /dev/null tree
++ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+- fi;;
++ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
++
++ if test x"$ac_file" != x-; then
++ { echo "$as_me:$LINENO: creating $ac_file" >&5
++echo "$as_me: creating $ac_file" >&6;}
++ rm -f "$ac_file"
++ fi
+ _ACEOF
+ cat >>$CONFIG_STATUS <<_ACEOF
+ sed "$ac_vpsub
+@@ -11649,12 +12989,12 @@
+ # NAME is the cpp macro being defined and VALUE is the value it is being given.
+ #
+ # ac_d sets the value in "#define NAME VALUE" lines.
+-ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+-ac_dB='[ ].*$,\1#\2'
++ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
++ac_dB='[ ].*$,\1#\2'
+ ac_dC=' '
+ ac_dD=',;t'
+ # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+-ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
++ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ ac_uB='$,\1#\2define\3'
+ ac_uC=' '
+ ac_uD=',;t'
+@@ -11663,11 +13003,11 @@
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+- cat >$tmp/stdin
+- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
++ cat >$tmp/stdin
++ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
+ esac
+
+@@ -11681,28 +13021,29 @@
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+- # Absolute (can't be DOS-style, as IFS=:)
+- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
++ # Absolute (can't be DOS-style, as IFS=:)
++ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+- echo $f;;
++ # Do quote $f, to prevent DOS paths from being IFS'd.
++ echo "$f";;
+ *) # Relative
+- if test -f "$f"; then
+- # Build tree
+- echo $f
+- elif test -f "$srcdir/$f"; then
+- # Source tree
+- echo $srcdir/$f
+- else
+- # /dev/null tree
+- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
++ if test -f "$f"; then
++ # Build tree
++ echo "$f"
++ elif test -f "$srcdir/$f"; then
++ # Source tree
++ echo "$srcdir/$f"
++ else
++ # /dev/null tree
++ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+- fi;;
++ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+ # Remove the trailing spaces.
+- sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
++ sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
+
+ _ACEOF
+
+@@ -11725,9 +13066,9 @@
+ s,[\\$`],\\&,g
+ t clear
+ : clear
+-s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
++s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+ t end
+-s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
++s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+ : end
+ _ACEOF
+ # If some macros were called several times there might be several times
+@@ -11741,13 +13082,13 @@
+ # example, in the case of _POSIX_SOURCE, which is predefined and required
+ # on some systems where configure will not decide to define it.
+ cat >>conftest.undefs <<\_ACEOF
+-s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
++s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+ _ACEOF
+
+ # Break up conftest.defines because some shells have a limit on the size
+ # of here documents, and old seds have small limits too (100 cmds).
+ echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+-echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
++echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+ echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+ echo ' :' >>$CONFIG_STATUS
+ rm -f conftest.tail
+@@ -11756,7 +13097,7 @@
+ # Write a limited-size here document to $tmp/defines.sed.
+ echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#define' lines.
+- echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
++ echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+@@ -11783,7 +13124,7 @@
+ # Write a limited-size here document to $tmp/undefs.sed.
+ echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#undef'
+- echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
++ echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+@@ -11817,10 +13158,10 @@
+ else
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+- X"$ac_file" : 'X\(//\)[^/]' \| \
+- X"$ac_file" : 'X\(//\)$' \| \
+- X"$ac_file" : 'X\(/\)' \| \
+- . : '\(.\)' 2>/dev/null ||
++ X"$ac_file" : 'X\(//\)[^/]' \| \
++ X"$ac_file" : 'X\(//\)$' \| \
++ X"$ac_file" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
+ echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+@@ -11836,10 +13177,10 @@
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+- X"$as_dir" : 'X\(//\)[^/]' \| \
+- X"$as_dir" : 'X\(//\)$' \| \
+- X"$as_dir" : 'X\(/\)' \| \
+- . : '\(.\)' 2>/dev/null ||
++ X"$as_dir" : 'X\(//\)[^/]' \| \
++ X"$as_dir" : 'X\(//\)$' \| \
++ X"$as_dir" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
+ echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+--- patch-2.5.9.orig/configure.ac
++++ patch-2.5.9/configure.ac
+@@ -64,6 +64,9 @@
+ gl_PREREQ_XMALLOC
+ gl_QUOTE
+ gl_QUOTEARG
++gl_HASH
++
++ag_CHECK_NANOSECOND_STAT
+
+ dnl This should be in gnulib, but isn't for some reason.
+ AC_DEFUN([jm_PREREQ_ADDEXT],
+--- patch-2.5.9.orig/pch.c
++++ patch-2.5.9/pch.c
+@@ -1,6 +1,6 @@
+ /* reading patches */
+
+-/* $Id: pch.c,v 1.44 2003/05/20 14:03:17 eggert Exp $ */
++/* $Id: pch.c,v 1.45 2003/07/02 22:19:21 eggert Exp $ */
+
+ /* Copyright (C) 1986, 1987, 1988 Larry Wall
+
+@@ -366,10 +366,16 @@
+ if (!stars_last_line && strnEQ(s, "*** ", 4))
+ name[OLD] = fetchname (s+4, strippath, &p_timestamp[OLD]);
+ else if (strnEQ(s, "+++ ", 4))
++ {
+ /* Swap with NEW below. */
+ name[OLD] = fetchname (s+4, strippath, &p_timestamp[OLD]);
++ p_strip_trailing_cr = strip_trailing_cr;
++ }
+ else if (strnEQ(s, "Index:", 6))
++ {
+ name[INDEX] = fetchname (s+6, strippath, (time_t *) 0);
++ p_strip_trailing_cr = strip_trailing_cr;
++ }
+ else if (strnEQ(s, "Prereq:", 7)) {
+ for (t = s + 7; ISSPACE ((unsigned char) *t); t++)
+ continue;
+@@ -409,6 +415,7 @@
+ p_timestamp[NEW] = timestamp;
+ p_rfc934_nesting = (t - s) >> 1;
+ }
++ p_strip_trailing_cr = strip_trailing_cr;
+ }
+ }
+ if ((diff_type == NO_DIFF || diff_type == ED_DIFF) &&
+--- patch-2.5.9.orig/util.c
++++ patch-2.5.9/util.c
+@@ -45,9 +45,17 @@
+ # define raise(sig) kill (getpid (), sig)
+ #endif
+
++#if defined(HAVE_STAT_TIMEVAL)
++#include <time.h>
++#endif
++
+ #include <stdarg.h>
++#include <hash.h>
+
+ static void makedirs (char *);
++static bool fid_search (const char *, const struct stat *, bool);
++# define fid_exists(name, pst) fid_search (name, pst, false)
++# define insert_fid(name) fid_search (name, NULL, true)
+
+ /* Move a file FROM (where *FROM_NEEDS_REMOVAL is nonzero if FROM
+ needs removal when cleaning up at the end of execution)
+@@ -64,7 +72,7 @@
+ struct stat to_st;
+ int to_errno = ! backup ? -1 : stat (to, &to_st) == 0 ? 0 : errno;
+
+- if (backup)
++ if (backup && (to_errno || ! fid_exists (to, &to_st)))
+ {
+ int try_makedirs_errno = 0;
+ char *bakname;
+@@ -165,6 +173,7 @@
+ if (! to_dir_known_to_exist)
+ makedirs (to);
+ copy_file (from, to, 0, mode);
++ insert_fid (to);
+ return;
+ }
+
+@@ -173,6 +182,7 @@
+ }
+
+ rename_succeeded:
++ insert_fid (to);
+ /* Do not clear *FROM_NEEDS_REMOVAL if it's possible that the
+ rename returned zero because FROM and TO are hard links to
+ the same file. */
+@@ -1011,3 +1021,105 @@
+ if (file_seek (stream, offset, ptrname) != 0)
+ pfatal ("fseek");
+ }
++
++typedef struct
++{
++ dev_t fid_dev;
++ ino_t fid_ino;
++ time_t fid_mtime;
++ unsigned long fid_mtimensec;
++} file_id;
++
++unsigned
++file_id_hasher (file_id *entry, unsigned table_size)
++{
++ return ((unsigned long) entry->fid_ino +
++ (unsigned long) entry->fid_dev +
++ (unsigned long) entry->fid_mtime +
++ (unsigned long) entry->fid_mtimensec) % table_size;
++}
++
++bool
++file_id_comparator (file_id *entry1, file_id *entry2)
++{
++ return (entry1->fid_dev == entry2->fid_dev &&
++ entry1->fid_ino == entry2->fid_ino &&
++ entry1->fid_mtime == entry2->fid_mtime &&
++ entry1->fid_mtimensec == entry2->fid_mtimensec);
++}
++
++void
++file_id_freer (file_id *entry)
++{
++ free (entry);
++}
++
++Hash_table *file_id_hash;
++
++/* Check if the file identified by FILENAME and PST was already seen. If the
++ file was already seen, returns TRUE. If the file has not yet been seen
++ and INSERT is TRUE, it is inserted. PST or FILENAME may be NULL (but not
++ both of them). */
++
++static bool
++fid_search (const char *filename, const struct stat *pst, bool insert)
++{
++ struct stat st;
++
++ if (!file_id_hash)
++ {
++ file_id_hash = hash_initialize (0, NULL, (Hash_hasher) file_id_hasher,
++ (Hash_comparator) file_id_comparator,
++ (Hash_data_freer) file_id_freer);
++ if (!file_id_hash)
++ pfatal ("hash_initialize");
++ }
++
++ if (!pst)
++ {
++ if (stat (filename, &st) != 0)
++ pfatal ("%s", quotearg (filename));
++ pst = &st;
++ }
++
++ if (insert)
++ {
++ file_id *pfid = xmalloc (sizeof (file_id)), *old_pfid;
++ pfid->fid_dev = pst->st_dev;
++ pfid->fid_ino = pst->st_ino;
++ pfid->fid_mtime = pst->st_mtime;
++#if defined(HAVE_STAT_NSEC)
++ pfid->fid_mtimensec = pst->st_mtimensec;
++#elif defined(HAVE_STAT_TIMEVAL)
++ pfid->fid_mtimensec = pst->st_mtim.tv_nsec;
++#else
++ pfid->fid_mtimensec = 0;
++#endif
++ old_pfid = hash_insert (file_id_hash, pfid);
++ if (!old_pfid)
++ pfatal ("hash_insert");
++ else if (old_pfid != pfid)
++ {
++ free (pfid);
++ return true;
++ }
++ else
++ return false;
++ }
++ else
++ {
++ file_id fid;
++ fid.fid_dev = pst->st_dev;
++ fid.fid_ino = pst->st_ino;
++ fid.fid_mtime = pst->st_mtime;
++#if defined(HAVE_STAT_NSEC)
++ fid.fid_mtimensec = pst->st_mtimensec;
++#elif defined(HAVE_STAT_TIMEVAL)
++ fid.fid_mtimensec = pst->st_mtim.tv_nsec;
++#else
++ fid.fid_mtimensec = 0;
++#endif
++ return hash_lookup (file_id_hash, &fid) != 0;
++ }
++}
++
+--- patch-2.5.9.orig/hash.c
++++ patch-2.5.9/hash.c
+@@ -0,0 +1,1051 @@
++/* hash - hashing table processing.
++
++ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software
++ Foundation, Inc.
++
++ Written by Jim Meyering, 1992.
++
++ 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. */
++
++/* A generic hash table package. */
++
++/* Define USE_OBSTACK to 1 if you want the allocator to use obstacks instead
++ of malloc. If you change USE_OBSTACK, you have to recompile! */
++
++#if HAVE_CONFIG_H
++# include <config.h>
++#endif
++#if HAVE_STDLIB_H
++# include <stdlib.h>
++#endif
++
++#include <limits.h>
++#include <stdbool.h>
++#include <stdio.h>
++
++#ifndef HAVE_DECL_FREE
++"this configure-time declaration test was not run"
++#endif
++#if !HAVE_DECL_FREE
++void free ();
++#endif
++
++#ifndef HAVE_DECL_MALLOC
++"this configure-time declaration test was not run"
++#endif
++#if !HAVE_DECL_MALLOC
++char *malloc ();
++#endif
++
++#if USE_OBSTACK
++# include "obstack.h"
++# ifndef obstack_chunk_alloc
++# define obstack_chunk_alloc malloc
++# endif
++# ifndef obstack_chunk_free
++# define obstack_chunk_free free
++# endif
++#endif
++
++#include "hash.h"
++
++struct hash_table
++ {
++ /* The array of buckets starts at BUCKET and extends to BUCKET_LIMIT-1,
++ for a possibility of N_BUCKETS. Among those, N_BUCKETS_USED buckets
++ are not empty, there are N_ENTRIES active entries in the table. */
++ struct hash_entry *bucket;
++ struct hash_entry *bucket_limit;
++ unsigned n_buckets;
++ unsigned n_buckets_used;
++ unsigned n_entries;
++
++ /* Tuning arguments, kept in a physicaly separate structure. */
++ const Hash_tuning *tuning;
++
++ /* Three functions are given to `hash_initialize', see the documentation
++ block for this function. In a word, HASHER randomizes a user entry
++ into a number up from 0 up to some maximum minus 1; COMPARATOR returns
++ true if two user entries compare equally; and DATA_FREER is the cleanup
++ function for a user entry. */
++ Hash_hasher hasher;
++ Hash_comparator comparator;
++ Hash_data_freer data_freer;
++
++ /* A linked list of freed struct hash_entry structs. */
++ struct hash_entry *free_entry_list;
++
++#if USE_OBSTACK
++ /* Whenever obstacks are used, it is possible to allocate all overflowed
++ entries into a single stack, so they all can be freed in a single
++ operation. It is not clear if the speedup is worth the trouble. */
++ struct obstack entry_stack;
++#endif
++ };
++
++/* A hash table contains many internal entries, each holding a pointer to
++ some user provided data (also called a user entry). An entry indistinctly
++ refers to both the internal entry and its associated user entry. A user
++ entry contents may be hashed by a randomization function (the hashing
++ function, or just `hasher' for short) into a number (or `slot') between 0
++ and the current table size. At each slot position in the hash table,
++ starts a linked chain of entries for which the user data all hash to this
++ slot. A bucket is the collection of all entries hashing to the same slot.
++
++ A good `hasher' function will distribute entries rather evenly in buckets.
++ In the ideal case, the length of each bucket is roughly the number of
++ entries divided by the table size. Finding the slot for a data is usually
++ done in constant time by the `hasher', and the later finding of a precise
++ entry is linear in time with the size of the bucket. Consequently, a
++ larger hash table size (that is, a larger number of buckets) is prone to
++ yielding shorter chains, *given* the `hasher' function behaves properly.
++
++ Long buckets slow down the lookup algorithm. One might use big hash table
++ sizes in hope to reduce the average length of buckets, but this might
++ become inordinate, as unused slots in the hash table take some space. The
++ best bet is to make sure you are using a good `hasher' function (beware
++ that those are not that easy to write! :-), and to use a table size
++ larger than the actual number of entries. */
++
++/* If an insertion makes the ratio of nonempty buckets to table size larger
++ than the growth threshold (a number between 0.0 and 1.0), then increase
++ the table size by multiplying by the growth factor (a number greater than
++ 1.0). The growth threshold defaults to 0.8, and the growth factor
++ defaults to 1.414, meaning that the table will have doubled its size
++ every second time 80% of the buckets get used. */
++#define DEFAULT_GROWTH_THRESHOLD 0.8
++#define DEFAULT_GROWTH_FACTOR 1.414
++
++/* If a deletion empties a bucket and causes the ratio of used buckets to
++ table size to become smaller than the shrink threshold (a number between
++ 0.0 and 1.0), then shrink the table by multiplying by the shrink factor (a
++ number greater than the shrink threshold but smaller than 1.0). The shrink
++ threshold and factor default to 0.0 and 1.0, meaning that the table never
++ shrinks. */
++#define DEFAULT_SHRINK_THRESHOLD 0.0
++#define DEFAULT_SHRINK_FACTOR 1.0
++
++/* Use this to initialize or reset a TUNING structure to
++ some sensible values. */
++static const Hash_tuning default_tuning =
++ {
++ DEFAULT_SHRINK_THRESHOLD,
++ DEFAULT_SHRINK_FACTOR,
++ DEFAULT_GROWTH_THRESHOLD,
++ DEFAULT_GROWTH_FACTOR,
++ false
++ };
++
++/* Information and lookup. */
++
++/* The following few functions provide information about the overall hash
++ table organization: the number of entries, number of buckets and maximum
++ length of buckets. */
++
++/* Return the number of buckets in the hash table. The table size, the total
++ number of buckets (used plus unused), or the maximum number of slots, are
++ the same quantity. */
++
++unsigned
++hash_get_n_buckets (const Hash_table *table)
++{
++ return table->n_buckets;
++}
++
++/* Return the number of slots in use (non-empty buckets). */
++
++unsigned
++hash_get_n_buckets_used (const Hash_table *table)
++{
++ return table->n_buckets_used;
++}
++
++/* Return the number of active entries. */
++
++unsigned
++hash_get_n_entries (const Hash_table *table)
++{
++ return table->n_entries;
++}
++
++/* Return the length of the longest chain (bucket). */
++
++unsigned
++hash_get_max_bucket_length (const Hash_table *table)
++{
++ struct hash_entry *bucket;
++ unsigned max_bucket_length = 0;
++
++ for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
++ {
++ if (bucket->data)
++ {
++ struct hash_entry *cursor = bucket;
++ unsigned bucket_length = 1;
++
++ while (cursor = cursor->next, cursor)
++ bucket_length++;
++
++ if (bucket_length > max_bucket_length)
++ max_bucket_length = bucket_length;
++ }
++ }
++
++ return max_bucket_length;
++}
++
++/* Do a mild validation of a hash table, by traversing it and checking two
++ statistics. */
++
++bool
++hash_table_ok (const Hash_table *table)
++{
++ struct hash_entry *bucket;
++ unsigned n_buckets_used = 0;
++ unsigned n_entries = 0;
++
++ for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
++ {
++ if (bucket->data)
++ {
++ struct hash_entry *cursor = bucket;
++
++ /* Count bucket head. */
++ n_buckets_used++;
++ n_entries++;
++
++ /* Count bucket overflow. */
++ while (cursor = cursor->next, cursor)
++ n_entries++;
++ }
++ }
++
++ if (n_buckets_used == table->n_buckets_used && n_entries == table->n_entries)
++ return true;
++
++ return false;
++}
++
++void
++hash_print_statistics (const Hash_table *table, FILE *stream)
++{
++ unsigned n_entries = hash_get_n_entries (table);
++ unsigned n_buckets = hash_get_n_buckets (table);
++ unsigned n_buckets_used = hash_get_n_buckets_used (table);
++ unsigned max_bucket_length = hash_get_max_bucket_length (table);
++
++ fprintf (stream, "# entries: %u\n", n_entries);
++ fprintf (stream, "# buckets: %u\n", n_buckets);
++ fprintf (stream, "# buckets used: %u (%.2f%%)\n", n_buckets_used,
++ (100.0 * n_buckets_used) / n_buckets);
++ fprintf (stream, "max bucket length: %u\n", max_bucket_length);
++}
++
++/* If ENTRY matches an entry already in the hash table, return the
++ entry from the table. Otherwise, return NULL. */
++
++void *
++hash_lookup (const Hash_table *table, const void *entry)
++{
++ struct hash_entry *bucket
++ = table->bucket + table->hasher (entry, table->n_buckets);
++ struct hash_entry *cursor;
++
++ if (! (bucket < table->bucket_limit))
++ abort ();
++
++ if (bucket->data == NULL)
++ return NULL;
++
++ for (cursor = bucket; cursor; cursor = cursor->next)
++ if (table->comparator (entry, cursor->data))
++ return cursor->data;
++
++ return NULL;
++}
++
++/* Walking. */
++
++/* The functions in this page traverse the hash table and process the
++ contained entries. For the traversal to work properly, the hash table
++ should not be resized nor modified while any particular entry is being
++ processed. In particular, entries should not be added or removed. */
++
++/* Return the first data in the table, or NULL if the table is empty. */
++
++void *
++hash_get_first (const Hash_table *table)
++{
++ struct hash_entry *bucket;
++
++ if (table->n_entries == 0)
++ return NULL;
++
++ for (bucket = table->bucket; ; bucket++)
++ if (! (bucket < table->bucket_limit))
++ abort ();
++ else if (bucket->data)
++ return bucket->data;
++}
++
++/* Return the user data for the entry following ENTRY, where ENTRY has been
++ returned by a previous call to either `hash_get_first' or `hash_get_next'.
++ Return NULL if there are no more entries. */
++
++void *
++hash_get_next (const Hash_table *table, const void *entry)
++{
++ struct hash_entry *bucket
++ = table->bucket + table->hasher (entry, table->n_buckets);
++ struct hash_entry *cursor;
++
++ if (! (bucket < table->bucket_limit))
++ abort ();
++
++ /* Find next entry in the same bucket. */
++ for (cursor = bucket; cursor; cursor = cursor->next)
++ if (cursor->data == entry && cursor->next)
++ return cursor->next->data;
++
++ /* Find first entry in any subsequent bucket. */
++ while (++bucket < table->bucket_limit)
++ if (bucket->data)
++ return bucket->data;
++
++ /* None found. */
++ return NULL;
++}
++
++/* Fill BUFFER with pointers to active user entries in the hash table, then
++ return the number of pointers copied. Do not copy more than BUFFER_SIZE
++ pointers. */
++
++unsigned
++hash_get_entries (const Hash_table *table, void **buffer,
++ unsigned buffer_size)
++{
++ unsigned counter = 0;
++ struct hash_entry *bucket;
++ struct hash_entry *cursor;
++
++ for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
++ {
++ if (bucket->data)
++ {
++ for (cursor = bucket; cursor; cursor = cursor->next)
++ {
++ if (counter >= buffer_size)
++ return counter;
++ buffer[counter++] = cursor->data;
++ }
++ }
++ }
++
++ return counter;
++}
++
++/* Call a PROCESSOR function for each entry of a hash table, and return the
++ number of entries for which the processor function returned success. A
++ pointer to some PROCESSOR_DATA which will be made available to each call to
++ the processor function. The PROCESSOR accepts two arguments: the first is
++ the user entry being walked into, the second is the value of PROCESSOR_DATA
++ as received. The walking continue for as long as the PROCESSOR function
++ returns nonzero. When it returns zero, the walking is interrupted. */
++
++unsigned
++hash_do_for_each (const Hash_table *table, Hash_processor processor,
++ void *processor_data)
++{
++ unsigned counter = 0;
++ struct hash_entry *bucket;
++ struct hash_entry *cursor;
++
++ for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
++ {
++ if (bucket->data)
++ {
++ for (cursor = bucket; cursor; cursor = cursor->next)
++ {
++ if (!(*processor) (cursor->data, processor_data))
++ return counter;
++ counter++;
++ }
++ }
++ }
++
++ return counter;
++}
++
++/* Allocation and clean-up. */
++
++/* Return a hash index for a NUL-terminated STRING between 0 and N_BUCKETS-1.
++ This is a convenience routine for constructing other hashing functions. */
++
++#if USE_DIFF_HASH
++
++/* About hashings, Paul Eggert writes to me (FP), on 1994-01-01: "Please see
++ B. J. McKenzie, R. Harries & T. Bell, Selecting a hashing algorithm,
++ Software--practice & experience 20, 2 (Feb 1990), 209-224. Good hash
++ algorithms tend to be domain-specific, so what's good for [diffutils'] io.c
++ may not be good for your application." */
++
++unsigned
++hash_string (const char *string, unsigned n_buckets)
++{
++# define ROTATE_LEFT(Value, Shift) \
++ ((Value) << (Shift) | (Value) >> ((sizeof (unsigned) * CHAR_BIT) - (Shift)))
++# define HASH_ONE_CHAR(Value, Byte) \
++ ((Byte) + ROTATE_LEFT (Value, 7))
++
++ unsigned value = 0;
++
++ for (; *string; string++)
++ value = HASH_ONE_CHAR (value, *(const unsigned char *) string);
++ return value % n_buckets;
++
++# undef ROTATE_LEFT
++# undef HASH_ONE_CHAR
++}
++
++#else /* not USE_DIFF_HASH */
++
++/* This one comes from `recode', and performs a bit better than the above as
++ per a few experiments. It is inspired from a hashing routine found in the
++ very old Cyber `snoop', itself written in typical Greg Mansfield style.
++ (By the way, what happened to this excellent man? Is he still alive?) */
++
++unsigned
++hash_string (const char *string, unsigned n_buckets)
++{
++ unsigned value = 0;
++
++ while (*string)
++ value = ((value * 31 + (int) *(const unsigned char *) string++)
++ % n_buckets);
++ return value;
++}
++
++#endif /* not USE_DIFF_HASH */
++
++/* Return true if CANDIDATE is a prime number. CANDIDATE should be an odd
++ number at least equal to 11. */
++
++static bool
++is_prime (unsigned long candidate)
++{
++ unsigned long divisor = 3;
++ unsigned long square = divisor * divisor;
++
++ while (square < candidate && (candidate % divisor))
++ {
++ divisor++;
++ square += 4 * divisor;
++ divisor++;
++ }
++
++ return (candidate % divisor ? true : false);
++}
++
++/* Round a given CANDIDATE number up to the nearest prime, and return that
++ prime. Primes lower than 10 are merely skipped. */
++
++static unsigned long
++next_prime (unsigned long candidate)
++{
++ /* Skip small primes. */
++ if (candidate < 10)
++ candidate = 10;
++
++ /* Make it definitely odd. */
++ candidate |= 1;
++
++ while (!is_prime (candidate))
++ candidate += 2;
++
++ return candidate;
++}
++
++void
++hash_reset_tuning (Hash_tuning *tuning)
++{
++ *tuning = default_tuning;
++}
++
++/* For the given hash TABLE, check the user supplied tuning structure for
++ reasonable values, and return true if there is no gross error with it.
++ Otherwise, definitively reset the TUNING field to some acceptable default
++ in the hash table (that is, the user loses the right of further modifying
++ tuning arguments), and return false. */
++
++static bool
++check_tuning (Hash_table *table)
++{
++ const Hash_tuning *tuning = table->tuning;
++
++ if (tuning->growth_threshold > 0.0
++ && tuning->growth_threshold < 1.0
++ && tuning->growth_factor > 1.0
++ && tuning->shrink_threshold >= 0.0
++ && tuning->shrink_threshold < 1.0
++ && tuning->shrink_factor > tuning->shrink_threshold
++ && tuning->shrink_factor <= 1.0
++ && tuning->shrink_threshold < tuning->growth_threshold)
++ return true;
++
++ table->tuning = &default_tuning;
++ return false;
++}
++
++/* Allocate and return a new hash table, or NULL upon failure. The initial
++ number of buckets is automatically selected so as to _guarantee_ that you
++ may insert at least CANDIDATE different user entries before any growth of
++ the hash table size occurs. So, if have a reasonably tight a-priori upper
++ bound on the number of entries you intend to insert in the hash table, you
++ may save some table memory and insertion time, by specifying it here. If
++ the IS_N_BUCKETS field of the TUNING structure is true, the CANDIDATE
++ argument has its meaning changed to the wanted number of buckets.
++
++ TUNING points to a structure of user-supplied values, in case some fine
++ tuning is wanted over the default behavior of the hasher. If TUNING is
++ NULL, the default tuning parameters are used instead.
++
++ The user-supplied HASHER function should be provided. It accepts two
++ arguments ENTRY and TABLE_SIZE. It computes, by hashing ENTRY contents, a
++ slot number for that entry which should be in the range 0..TABLE_SIZE-1.
++ This slot number is then returned.
++
++ The user-supplied COMPARATOR function should be provided. It accepts two
++ arguments pointing to user data, it then returns true for a pair of entries
++ that compare equal, or false otherwise. This function is internally called
++ on entries which are already known to hash to the same bucket index.
++
++ The user-supplied DATA_FREER function, when not NULL, may be later called
++ with the user data as an argument, just before the entry containing the
++ data gets freed. This happens from within `hash_free' or `hash_clear'.
++ You should specify this function only if you want these functions to free
++ all of your `data' data. This is typically the case when your data is
++ simply an auxiliary struct that you have malloc'd to aggregate several
++ values. */
++
++Hash_table *
++hash_initialize (unsigned candidate, const Hash_tuning *tuning,
++ Hash_hasher hasher, Hash_comparator comparator,
++ Hash_data_freer data_freer)
++{
++ Hash_table *table;
++ struct hash_entry *bucket;
++
++ if (hasher == NULL || comparator == NULL)
++ return NULL;
++
++ table = (Hash_table *) malloc (sizeof (Hash_table));
++ if (table == NULL)
++ return NULL;
++
++ if (!tuning)
++ tuning = &default_tuning;
++ table->tuning = tuning;
++ if (!check_tuning (table))
++ {
++ /* Fail if the tuning options are invalid. This is the only occasion
++ when the user gets some feedback about it. Once the table is created,
++ if the user provides invalid tuning options, we silently revert to
++ using the defaults, and ignore further request to change the tuning
++ options. */
++ free (table);
++ return NULL;
++ }
++
++ table->n_buckets
++ = next_prime (tuning->is_n_buckets ? candidate
++ : (unsigned) (candidate / tuning->growth_threshold));
++
++ table->bucket = (struct hash_entry *)
++ malloc (table->n_buckets * sizeof (struct hash_entry));
++ if (table->bucket == NULL)
++ {
++ free (table);
++ return NULL;
++ }
++ table->bucket_limit = table->bucket + table->n_buckets;
++
++ for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
++ {
++ bucket->data = NULL;
++ bucket->next = NULL;
++ }
++ table->n_buckets_used = 0;
++ table->n_entries = 0;
++
++ table->hasher = hasher;
++ table->comparator = comparator;
++ table->data_freer = data_freer;
++
++ table->free_entry_list = NULL;
++#if USE_OBSTACK
++ obstack_init (&table->entry_stack);
++#endif
++ return table;
++}
++
++/* Make all buckets empty, placing any chained entries on the free list.
++ Apply the user-specified function data_freer (if any) to the datas of any
++ affected entries. */
++
++void
++hash_clear (Hash_table *table)
++{
++ struct hash_entry *bucket;
++
++ for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
++ {
++ if (bucket->data)
++ {
++ struct hash_entry *cursor;
++ struct hash_entry *next;
++
++ /* Free the bucket overflow. */
++ for (cursor = bucket->next; cursor; cursor = next)
++ {
++ if (table->data_freer)
++ (*table->data_freer) (cursor->data);
++ cursor->data = NULL;
++
++ next = cursor->next;
++ /* Relinking is done one entry at a time, as it is to be expected
++ that overflows are either rare or short. */
++ cursor->next = table->free_entry_list;
++ table->free_entry_list = cursor;
++ }
++
++ /* Free the bucket head. */
++ if (table->data_freer)
++ (*table->data_freer) (bucket->data);
++ bucket->data = NULL;
++ bucket->next = NULL;
++ }
++ }
++
++ table->n_buckets_used = 0;
++ table->n_entries = 0;
++}
++
++/* Reclaim all storage associated with a hash table. If a data_freer
++ function has been supplied by the user when the hash table was created,
++ this function applies it to the data of each entry before freeing that
++ entry. */
++
++void
++hash_free (Hash_table *table)
++{
++ struct hash_entry *bucket;
++ struct hash_entry *cursor;
++ struct hash_entry *next;
++
++ /* Call the user data_freer function. */
++ if (table->data_freer && table->n_entries)
++ {
++ for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
++ {
++ if (bucket->data)
++ {
++ for (cursor = bucket; cursor; cursor = cursor->next)
++ {
++ (*table->data_freer) (cursor->data);
++ }
++ }
++ }
++ }
++
++#if USE_OBSTACK
++
++ obstack_free (&table->entry_stack, NULL);
++
++#else
++
++ /* Free all bucket overflowed entries. */
++ for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
++ {
++ for (cursor = bucket->next; cursor; cursor = next)
++ {
++ next = cursor->next;
++ free (cursor);
++ }
++ }
++
++ /* Also reclaim the internal list of previously freed entries. */
++ for (cursor = table->free_entry_list; cursor; cursor = next)
++ {
++ next = cursor->next;
++ free (cursor);
++ }
++
++#endif
++
++ /* Free the remainder of the hash table structure. */
++ free (table->bucket);
++ free (table);
++}
++
++/* Insertion and deletion. */
++
++/* Get a new hash entry for a bucket overflow, possibly by reclying a
++ previously freed one. If this is not possible, allocate a new one. */
++
++static struct hash_entry *
++allocate_entry (Hash_table *table)
++{
++ struct hash_entry *new;
++
++ if (table->free_entry_list)
++ {
++ new = table->free_entry_list;
++ table->free_entry_list = new->next;
++ }
++ else
++ {
++#if USE_OBSTACK
++ new = (struct hash_entry *)
++ obstack_alloc (&table->entry_stack, sizeof (struct hash_entry));
++#else
++ new = (struct hash_entry *) malloc (sizeof (struct hash_entry));
++#endif
++ }
++
++ return new;
++}
++
++/* Free a hash entry which was part of some bucket overflow,
++ saving it for later recycling. */
++
++static void
++free_entry (Hash_table *table, struct hash_entry *entry)
++{
++ entry->data = NULL;
++ entry->next = table->free_entry_list;
++ table->free_entry_list = entry;
++}
++
++/* This private function is used to help with insertion and deletion. When
++ ENTRY matches an entry in the table, return a pointer to the corresponding
++ user data and set *BUCKET_HEAD to the head of the selected bucket.
++ Otherwise, return NULL. When DELETE is true and ENTRY matches an entry in
++ the table, unlink the matching entry. */
++
++static void *
++hash_find_entry (Hash_table *table, const void *entry,
++ struct hash_entry **bucket_head, bool delete)
++{
++ struct hash_entry *bucket
++ = table->bucket + table->hasher (entry, table->n_buckets);
++ struct hash_entry *cursor;
++
++ if (! (bucket < table->bucket_limit))
++ abort ();
++
++ *bucket_head = bucket;
++
++ /* Test for empty bucket. */
++ if (bucket->data == NULL)
++ return NULL;
++
++ /* See if the entry is the first in the bucket. */
++ if ((*table->comparator) (entry, bucket->data))
++ {
++ void *data = bucket->data;
++
++ if (delete)
++ {
++ if (bucket->next)
++ {
++ struct hash_entry *next = bucket->next;
++
++ /* Bump the first overflow entry into the bucket head, then save
++ the previous first overflow entry for later recycling. */
++ *bucket = *next;
++ free_entry (table, next);
++ }
++ else
++ {
++ bucket->data = NULL;
++ }
++ }
++
++ return data;
++ }
++
++ /* Scan the bucket overflow. */
++ for (cursor = bucket; cursor->next; cursor = cursor->next)
++ {
++ if ((*table->comparator) (entry, cursor->next->data))
++ {
++ void *data = cursor->next->data;
++
++ if (delete)
++ {
++ struct hash_entry *next = cursor->next;
++
++ /* Unlink the entry to delete, then save the freed entry for later
++ recycling. */
++ cursor->next = next->next;
++ free_entry (table, next);
++ }
++
++ return data;
++ }
++ }
++
++ /* No entry found. */
++ return NULL;
++}
++
++/* For an already existing hash table, change the number of buckets through
++ specifying CANDIDATE. The contents of the hash table are preserved. The
++ new number of buckets is automatically selected so as to _guarantee_ that
++ the table may receive at least CANDIDATE different user entries, including
++ those already in the table, before any other growth of the hash table size
++ occurs. If TUNING->IS_N_BUCKETS is true, then CANDIDATE specifies the
++ exact number of buckets desired. */
++
++bool
++hash_rehash (Hash_table *table, unsigned candidate)
++{
++ Hash_table *new_table;
++ struct hash_entry *bucket;
++ struct hash_entry *cursor;
++ struct hash_entry *next;
++
++ new_table = hash_initialize (candidate, table->tuning, table->hasher,
++ table->comparator, table->data_freer);
++ if (new_table == NULL)
++ return false;
++
++ /* Merely reuse the extra old space into the new table. */
++#if USE_OBSTACK
++ obstack_free (&new_table->entry_stack, NULL);
++ new_table->entry_stack = table->entry_stack;
++#endif
++ new_table->free_entry_list = table->free_entry_list;
++
++ for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
++ if (bucket->data)
++ for (cursor = bucket; cursor; cursor = next)
++ {
++ void *data = cursor->data;
++ struct hash_entry *new_bucket
++ = (new_table->bucket
++ + new_table->hasher (data, new_table->n_buckets));
++
++ if (! (new_bucket < new_table->bucket_limit))
++ abort ();
++
++ next = cursor->next;
++
++ if (new_bucket->data)
++ {
++ if (cursor == bucket)
++ {
++ /* Allocate or recycle an entry, when moving from a bucket
++ header into a bucket overflow. */
++ struct hash_entry *new_entry = allocate_entry (new_table);
++
++ if (new_entry == NULL)
++ return false;
++
++ new_entry->data = data;
++ new_entry->next = new_bucket->next;
++ new_bucket->next = new_entry;
++ }
++ else
++ {
++ /* Merely relink an existing entry, when moving from a
++ bucket overflow into a bucket overflow. */
++ cursor->next = new_bucket->next;
++ new_bucket->next = cursor;
++ }
++ }
++ else
++ {
++ /* Free an existing entry, when moving from a bucket
++ overflow into a bucket header. Also take care of the
++ simple case of moving from a bucket header into a bucket
++ header. */
++ new_bucket->data = data;
++ new_table->n_buckets_used++;
++ if (cursor != bucket)
++ free_entry (new_table, cursor);
++ }
++ }
++
++ free (table->bucket);
++ table->bucket = new_table->bucket;
++ table->bucket_limit = new_table->bucket_limit;
++ table->n_buckets = new_table->n_buckets;
++ table->n_buckets_used = new_table->n_buckets_used;
++ table->free_entry_list = new_table->free_entry_list;
++ /* table->n_entries already holds its value. */
++#if USE_OBSTACK
++ table->entry_stack = new_table->entry_stack;
++#endif
++ free (new_table);
++
++ return true;
++}
++
++/* If ENTRY matches an entry already in the hash table, return the pointer
++ to the entry from the table. Otherwise, insert ENTRY and return ENTRY.
++ Return NULL if the storage required for insertion cannot be allocated. */
++
++void *
++hash_insert (Hash_table *table, const void *entry)
++{
++ void *data;
++ struct hash_entry *bucket;
++
++ /* The caller cannot insert a NULL entry. */
++ if (! entry)
++ abort ();
++
++ /* If there's a matching entry already in the table, return that. */
++ if ((data = hash_find_entry (table, entry, &bucket, false)) != NULL)
++ return data;
++
++ /* ENTRY is not matched, it should be inserted. */
++
++ if (bucket->data)
++ {
++ struct hash_entry *new_entry = allocate_entry (table);
++
++ if (new_entry == NULL)
++ return NULL;
++
++ /* Add ENTRY in the overflow of the bucket. */
++
++ new_entry->data = (void *) entry;
++ new_entry->next = bucket->next;
++ bucket->next = new_entry;
++ table->n_entries++;
++ return (void *) entry;
++ }
++
++ /* Add ENTRY right in the bucket head. */
++
++ bucket->data = (void *) entry;
++ table->n_entries++;
++ table->n_buckets_used++;
++
++ /* If the growth threshold of the buckets in use has been reached, increase
++ the table size and rehash. There's no point in checking the number of
++ entries: if the hashing function is ill-conditioned, rehashing is not
++ likely to improve it. */
++
++ if (table->n_buckets_used
++ > table->tuning->growth_threshold * table->n_buckets)
++ {
++ /* Check more fully, before starting real work. If tuning arguments
++ became invalid, the second check will rely on proper defaults. */
++ check_tuning (table);
++ if (table->n_buckets_used
++ > table->tuning->growth_threshold * table->n_buckets)
++ {
++ const Hash_tuning *tuning = table->tuning;
++ unsigned candidate
++ = (unsigned) (tuning->is_n_buckets
++ ? (table->n_buckets * tuning->growth_factor)
++ : (table->n_buckets * tuning->growth_factor
++ * tuning->growth_threshold));
++
++ /* If the rehash fails, arrange to return NULL. */
++ if (!hash_rehash (table, candidate))
++ entry = NULL;
++ }
++ }
++
++ return (void *) entry;
++}
++
++/* If ENTRY is already in the table, remove it and return the just-deleted
++ data (the user may want to deallocate its storage). If ENTRY is not in the
++ table, don't modify the table and return NULL. */
++
++void *
++hash_delete (Hash_table *table, const void *entry)
++{
++ void *data;
++ struct hash_entry *bucket;
++
++ data = hash_find_entry (table, entry, &bucket, true);
++ if (!data)
++ return NULL;
++
++ table->n_entries--;
++ if (!bucket->data)
++ {
++ table->n_buckets_used--;
++
++ /* If the shrink threshold of the buckets in use has been reached,
++ rehash into a smaller table. */
++
++ if (table->n_buckets_used
++ < table->tuning->shrink_threshold * table->n_buckets)
++ {
++ /* Check more fully, before starting real work. If tuning arguments
++ became invalid, the second check will rely on proper defaults. */
++ check_tuning (table);
++ if (table->n_buckets_used
++ < table->tuning->shrink_threshold * table->n_buckets)
++ {
++ const Hash_tuning *tuning = table->tuning;
++ unsigned candidate
++ = (unsigned) (tuning->is_n_buckets
++ ? table->n_buckets * tuning->shrink_factor
++ : (table->n_buckets * tuning->shrink_factor
++ * tuning->growth_threshold));
++
++ hash_rehash (table, candidate);
++ }
++ }
++ }
++
++ return data;
++}
++
++/* Testing. */
++
++#if TESTING
++
++void
++hash_print (const Hash_table *table)
++{
++ struct hash_entry *bucket;
++
++ for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
++ {
++ struct hash_entry *cursor;
++
++ if (bucket)
++ printf ("%d:\n", bucket - table->bucket);
++
++ for (cursor = bucket; cursor; cursor = cursor->next)
++ {
++ char *s = (char *) cursor->data;
++ /* FIXME */
++ if (s)
++ printf (" %s\n", s);
++ }
++ }
++}
++
++#endif /* TESTING */
+--- patch-2.5.9.orig/hash.h
++++ patch-2.5.9/hash.h
+@@ -0,0 +1,93 @@
++/* hash - hashing table processing.
++ Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
++ Written by Jim Meyering <meyering@ascend.com>, 1998.
++
++ 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. */
++
++/* A generic hash table package. */
++
++/* Make sure USE_OBSTACK is defined to 1 if you want the allocator to use
++ obstacks instead of malloc, and recompile `hash.c' with same setting. */
++
++#ifndef HASH_H_
++# define HASH_H_
++
++# ifndef PARAMS
++# if PROTOTYPES || __STDC__
++# define PARAMS(Args) Args
++# else
++# define PARAMS(Args) ()
++# endif
++# endif
++
++typedef unsigned (*Hash_hasher) PARAMS ((const void *, unsigned));
++typedef bool (*Hash_comparator) PARAMS ((const void *, const void *));
++typedef void (*Hash_data_freer) PARAMS ((void *));
++typedef bool (*Hash_processor) PARAMS ((void *, void *));
++
++struct hash_entry
++ {
++ void *data;
++ struct hash_entry *next;
++ };
++
++struct hash_tuning
++ {
++ /* This structure is mainly used for `hash_initialize', see the block
++ documentation of `hash_reset_tuning' for more complete comments. */
++
++ float shrink_threshold; /* ratio of used buckets to trigger a shrink */
++ float shrink_factor; /* ratio of new smaller size to original size */
++ float growth_threshold; /* ratio of used buckets to trigger a growth */
++ float growth_factor; /* ratio of new bigger size to original size */
++ bool is_n_buckets; /* if CANDIDATE really means table size */
++ };
++
++typedef struct hash_tuning Hash_tuning;
++
++struct hash_table;
++
++typedef struct hash_table Hash_table;
++
++/* Information and lookup. */
++unsigned hash_get_n_buckets PARAMS ((const Hash_table *));
++unsigned hash_get_n_buckets_used PARAMS ((const Hash_table *));
++unsigned hash_get_n_entries PARAMS ((const Hash_table *));
++unsigned hash_get_max_bucket_length PARAMS ((const Hash_table *));
++bool hash_table_ok PARAMS ((const Hash_table *));
++void hash_print_statistics PARAMS ((const Hash_table *, FILE *));
++void *hash_lookup PARAMS ((const Hash_table *, const void *));
++
++/* Walking. */
++void *hash_get_first PARAMS ((const Hash_table *));
++void *hash_get_next PARAMS ((const Hash_table *, const void *));
++unsigned hash_get_entries PARAMS ((const Hash_table *, void **, unsigned));
++unsigned hash_do_for_each PARAMS ((const Hash_table *, Hash_processor, void *));
++
++/* Allocation and clean-up. */
++unsigned hash_string PARAMS ((const char *, unsigned));
++void hash_reset_tuning PARAMS ((Hash_tuning *));
++Hash_table *hash_initialize PARAMS ((unsigned, const Hash_tuning *,
++ Hash_hasher, Hash_comparator,
++ Hash_data_freer));
++void hash_clear PARAMS ((Hash_table *));
++void hash_free PARAMS ((Hash_table *));
++
++/* Insertion and deletion. */
++bool hash_rehash PARAMS ((Hash_table *, unsigned));
++void *hash_insert PARAMS ((Hash_table *, const void *));
++void *hash_delete PARAMS ((Hash_table *, const void *));
++
++#endif
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/global-reject-file.diff b/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/global-reject-file.diff
new file mode 100644
index 000000000..bb7ca7912
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/global-reject-file.diff
@@ -0,0 +1,203 @@
+Upstream-Status: Inappropriate [debian patch]
+
+Index: patch-2.5.9/patch.man
+===================================================================
+--- patch-2.5.9.orig/patch.man
++++ patch-2.5.9/patch.man
+@@ -520,6 +520,15 @@ file.
+ \fB\*=reject\-unified\fP
+ Produce unified reject files. The default is to produce context type reject files.
+ .TP
++.BI \*=global\-reject\-file= rejectfile
++Put all rejects into
++.I rejectfile
++instead of creating separate reject files for all files that have rejects. The
++.I rejectfile
++will contain headers that identify which file each reject refers to. Note that
++the global reject file is created even if \-\-dry\-run is specified (while
++non-global reject files will only be created without \-\-dry\-run).
++.TP
+ \fB\-R\fP or \fB\*=reverse\fP
+ Assume that this patch was created with the old and new files swapped.
+ (Yes, I'm afraid that does happen occasionally, human nature being what it
+Index: patch-2.5.9/patch.c
+===================================================================
+--- patch-2.5.9.orig/patch.c
++++ patch-2.5.9/patch.c
+@@ -67,6 +67,7 @@ static bool similar (char const *, size_
+ static bool spew_output (struct outstate *);
+ static char const *make_temp (char);
+ static int numeric_string (char const *, bool, char const *);
++static void reject_header (const char *filename);
+ static void abort_hunk (void);
+ static void cleanup (void);
+ static void get_some_switches (void);
+@@ -98,6 +99,7 @@ static int Argc;
+ static char * const *Argv;
+
+ static FILE *rejfp; /* reject file pointer */
++static char *global_reject;
+
+ static char const *patchname;
+ static char *rejname;
+@@ -172,6 +174,10 @@ main (int argc, char **argv)
+ /* Make sure we clean up in case of disaster. */
+ set_signals (false);
+
++ /* initialize global reject file */
++ if (global_reject)
++ init_reject ();
++
+ for (
+ open_patch_file (patchname);
+ there_is_another_patch();
+@@ -208,8 +214,9 @@ main (int argc, char **argv)
+ init_output (TMPOUTNAME, exclusive, &outstate);
+ }
+
+- /* initialize reject file */
+- init_reject ();
++ /* initialize per-patch reject file */
++ if (!global_reject)
++ init_reject ();
+
+ /* find out where all the lines are */
+ if (!skip_rest_of_patch)
+@@ -278,6 +285,8 @@ main (int argc, char **argv)
+
+ newwhere = pch_newfirst() + last_offset;
+ if (skip_rest_of_patch) {
++ if (!failed)
++ reject_header(outname);
+ abort_hunk();
+ failed++;
+ if (verbosity == VERBOSE)
+@@ -292,6 +301,8 @@ main (int argc, char **argv)
+ say ("Patch attempted to create file %s, which already exists.\n",
+ quotearg (inname));
+
++ if (!failed)
++ reject_header(outname);
+ abort_hunk();
+ failed++;
+ if (verbosity != SILENT)
+@@ -299,6 +310,8 @@ main (int argc, char **argv)
+ format_linenum (numbuf, newwhere));
+ }
+ else if (! apply_hunk (&outstate, where)) {
++ if (!failed)
++ reject_header(outname);
+ abort_hunk ();
+ failed++;
+ if (verbosity != SILENT)
+@@ -332,7 +345,8 @@ main (int argc, char **argv)
+ fclose (outstate.ofp);
+ outstate.ofp = 0;
+ }
+- fclose (rejfp);
++ if (!global_reject)
++ fclose (rejfp);
+ continue;
+ }
+
+@@ -412,13 +426,13 @@ main (int argc, char **argv)
+ }
+ }
+ if (diff_type != ED_DIFF) {
+- if (fclose (rejfp) != 0)
++ if (!global_reject && fclose (rejfp) != 0)
+ write_fatal ();
+ if (failed) {
+ somefailed = true;
+ say ("%d out of %d hunk%s %s", failed, hunk, "s" + (hunk == 1),
+ skip_rest_of_patch ? "ignored" : "FAILED");
+- if (outname) {
++ if (!global_reject && outname) {
+ char *rej = rejname;
+ if (!rejname) {
+ rej = xmalloc (strlen (outname) + 5);
+@@ -445,6 +459,20 @@ main (int argc, char **argv)
+ }
+ set_signals (true);
+ }
++ if (global_reject)
++ {
++ if (fclose (rejfp) != 0)
++ write_fatal ();
++ if (somefailed)
++ {
++ say (" -- saving rejects to file %s\n", quotearg (global_reject));
++ /*if (! dry_run)
++ {*/
++ move_file (TMPREJNAME, &TMPREJNAME_needs_removal,
++ global_reject, 0644, false);
++ /*}*/
++ }
++ }
+ if (outstate.ofp && (ferror (outstate.ofp) || fclose (outstate.ofp) != 0))
+ write_fatal ();
+ cleanup ();
+@@ -523,6 +551,7 @@ static struct option const longopts[] =
+ {"posix", no_argument, NULL, CHAR_MAX + 7},
+ {"quoting-style", required_argument, NULL, CHAR_MAX + 8},
+ {"unified-reject-files", no_argument, NULL, CHAR_MAX + 9},
++ {"global-reject-file", required_argument, NULL, CHAR_MAX + 10},
+ {NULL, no_argument, NULL, 0}
+ };
+
+@@ -582,6 +611,7 @@ static char const *const option_help[] =
+ " --dry-run Do not actually change any files; just print what would happen.",
+ " --posix Conform to the POSIX standard.",
+ " --unified-reject-files Create unified reject files.",
++" --global-reject-file=file Put all rejects into one file.",
+ "",
+ " -d DIR --directory=DIR Change the working directory to DIR first.",
+ #if HAVE_SETMODE_DOS
+@@ -784,6 +814,9 @@ get_some_switches (void)
+ case CHAR_MAX + 9:
+ unified_reject_files = true;
+ break;
++ case CHAR_MAX + 10:
++ global_reject = savestr (optarg);
++ break;
+ default:
+ usage (stderr, 2);
+ }
+@@ -933,6 +966,37 @@ locate_hunk (LINENUM fuzz)
+ }
+
+ static char *
++format_timestamp (char timebuf[37], bool which)
++{
++ time_t ts = pch_timestamp(which);
++ if (ts != -1)
++ {
++ struct tm *tm = localtime(&ts);
++ strftime(timebuf, 37, "\t%Y-%m-%d %H:%M:%S.000000000 %z", tm);
++ }
++ else
++ timebuf[0] = 0;
++ return timebuf;
++}
++
++/* Write a header in a reject file that combines multiple hunks. */
++static void
++reject_header (const char *outname)
++{
++ char timebuf0[37], timebuf1[37];
++ if (!global_reject)
++ return;
++ if (diff_type == UNI_DIFF)
++ fprintf(rejfp, "--- %s.orig%s\n+++ %s%s\n",
++ outname, format_timestamp(timebuf0, reverse),
++ outname, format_timestamp(timebuf1, !reverse));
++ else
++ fprintf(rejfp, "*** %s.orig%s\n--- %s%s\n",
++ outname, format_timestamp(timebuf0, reverse),
++ outname, format_timestamp(timebuf1, !reverse));
++}
++
++static char *
+ format_linerange (char rangebuf[LINENUM_LENGTH_BOUND*2 + 2],
+ LINENUM first, LINENUM lines)
+ {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/install.patch b/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/install.patch
new file mode 100644
index 000000000..0354ec8f0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/install.patch
@@ -0,0 +1,43 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Index: patch-2.5.4/Makefile.in
+===================================================================
+--- patch-2.5.4.orig/Makefile.in 2005-03-09 07:23:54.779311824 -0500
++++ patch-2.5.4/Makefile.in 2005-03-09 07:26:09.616813408 -0500
+@@ -43,10 +43,11 @@
+ PACKAGE_NAME = @PACKAGE_NAME@
+ PACKAGE_VERSION = @PACKAGE_VERSION@
+
++DESTDIR =
+ prefix = @prefix@
+ exec_prefix = @exec_prefix@
+
+-bindir = $(exec_prefix)/bin
++bindir = @bindir@
+
+ # Where to put the manual pages.
+ mandir = @mandir@
+@@ -112,18 +113,18 @@
+ $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS)
+
+ install:: all installdirs
+- $(INSTALL_PROGRAM) patch$(EXEEXT) $(bindir)/$(patch_name)$(EXEEXT)
+- -$(INSTALL_DATA) $(srcdir)/patch.man $(man1dir)/$(patch_name)$(man1ext)
++ $(INSTALL_PROGRAM) patch$(EXEEXT) $(DESTDIR)$(bindir)/$(patch_name)$(EXEEXT)
++ -$(INSTALL_DATA) $(srcdir)/patch.man $(DESTDIR)$(man1dir)/$(patch_name)$(man1ext)
+
+ installdirs::
+- $(SHELL) $(srcdir)/mkinstalldirs $(bindir) $(man1dir)
++ $(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir)
+
+ install-strip::
+ $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
+
+ uninstall::
+- rm -f $(bindir)/$(patch_name)$(EXEEXT)
+- rm -f $(man1dir)/$(patch_name)$(man1ext)
++ rm -f $(DESTDIR)$(bindir)/$(patch_name)$(EXEEXT)
++ rm -f $(DESTDIR)$(man1dir)/$(patch_name)$(man1ext)
+
+ Makefile: Makefile.in $(CONFIG_STATUS)
+ $(SHELL) $(CONFIG_STATUS)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/unified-reject-files.diff b/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/unified-reject-files.diff
new file mode 100644
index 000000000..4b59212db
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/unified-reject-files.diff
@@ -0,0 +1,307 @@
+Upstream-Status: Inappropriate [debian patch]
+
+Generate unified diff style reject files. Also include the C function names
+in reject files whenever possible.
+
+ $ cat > f.orig
+ < a() {
+ < 2
+ < 3
+ <
+ < 5
+ < 6
+ < }
+
+ $ sed -e 's/5/5a/' f.orig > f
+ $ diff -U2 -p f.orig f > f.diff
+ $ sed -e 's/5/5a/' -e 's/6/6x/' f.orig > f
+ $ ./patch -F0 -s --no-backup-if-mismatch f --reject-unified < f.diff
+ > 1 out of 1 hunk FAILED -- saving rejects to file f.rej
+
+ $ cat f.rej
+ > @@ -3,5 +3,5 @@ a() {
+ > 3
+ >
+ > -5
+ > +5a
+ > 6
+ > }
+
+ $ ./patch -F0 -s --no-backup-if-mismatch f < f.diff
+ > 1 out of 1 hunk FAILED -- saving rejects to file f.rej
+
+ $ cat f.rej
+ > *************** a() {
+ > *** 3,7 ****
+ > 3
+ >
+ > - 5
+ > 6
+ > }
+ > --- 3,7 ----
+ > 3
+ >
+ > + 5a
+ > 6
+ > }
+
+ $ diff -Nu -p /dev/null f.orig > f2.diff
+ $ ./patch -F0 -s --no-backup-if-mismatch f --reject-unified < f2.diff
+ > Patch attempted to create file f, which already exists.
+ > 1 out of 1 hunk FAILED -- saving rejects to file f.rej
+
+ $ cat f.rej
+ > @@ -0,0 +1,7 @@
+ > +a() {
+ > +2
+ > +3
+ > +
+ > +5
+ > +6
+ > +}
+
+ $ rm -f f f.orig f.rej f.diff f2.diff
+
+Index: patch-2.5.9/pch.c
+===================================================================
+--- patch-2.5.9.orig/pch.c
++++ patch-2.5.9/pch.c
+@@ -68,6 +68,7 @@ static LINENUM p_sline; /* and the lin
+ static LINENUM p_hunk_beg; /* line number of current hunk */
+ static LINENUM p_efake = -1; /* end of faked up lines--don't free */
+ static LINENUM p_bfake = -1; /* beg of faked up lines */
++static char *p_c_function; /* the C function a hunk is in */
+
+ enum nametype { OLD, NEW, INDEX, NONE };
+
+@@ -888,6 +889,19 @@ another_hunk (enum diff difftype, bool r
+ next_intuit_at(line_beginning,p_input_line);
+ return chars_read == (size_t) -1 ? -1 : 0;
+ }
++ s = buf;
++ while (*s == '*')
++ s++;
++ if (*s == ' ')
++ {
++ p_c_function = s;
++ while (*s != '\n')
++ s++;
++ *s = '\0';
++ p_c_function = savestr (p_c_function);
++ }
++ else
++ p_c_function = NULL;
+ p_hunk_beg = p_input_line + 1;
+ while (p_end < p_max) {
+ chars_read = get_line ();
+@@ -1277,8 +1291,18 @@ another_hunk (enum diff difftype, bool r
+ else
+ p_repl_lines = 1;
+ if (*s == ' ') s++;
+- if (*s != '@')
++ if (*s++ != '@')
+ malformed ();
++ if (*s++ == '@' && *s == ' ' && *s != '\0')
++ {
++ p_c_function = s;
++ while (*s != '\n')
++ s++;
++ *s = '\0';
++ p_c_function = savestr (p_c_function);
++ }
++ else
++ p_c_function = NULL;
+ if (!p_ptrn_lines)
+ p_first++; /* do append rather than insert */
+ if (!p_repl_lines)
+@@ -1884,6 +1908,12 @@ pch_hunk_beg (void)
+ return p_hunk_beg;
+ }
+
++char const *
++pch_c_function (void)
++{
++ return p_c_function;
++}
++
+ /* Is the newline-terminated line a valid `ed' command for patch
+ input? If so, return the command character; if not, return 0.
+ This accepts accepts just a subset of the valid commands, but it's
+Index: patch-2.5.9/pch.h
+===================================================================
+--- patch-2.5.9.orig/pch.h
++++ patch-2.5.9/pch.h
+@@ -25,6 +25,7 @@
+ LINENUM pch_end (void);
+ LINENUM pch_first (void);
+ LINENUM pch_hunk_beg (void);
++char const *pch_c_function (void);
+ LINENUM pch_newfirst (void);
+ LINENUM pch_prefix_context (void);
+ LINENUM pch_ptrn_lines (void);
+Index: patch-2.5.9/patch.man
+===================================================================
+--- patch-2.5.9.orig/patch.man
++++ patch-2.5.9/patch.man
+@@ -517,6 +517,9 @@ instead of the default
+ .B \&.rej
+ file.
+ .TP
++\fB\*=reject\-unified\fP
++Produce unified reject files. The default is to produce context type reject files.
++.TP
+ \fB\-R\fP or \fB\*=reverse\fP
+ Assume that this patch was created with the old and new files swapped.
+ (Yes, I'm afraid that does happen occasionally, human nature being what it
+Index: patch-2.5.9/common.h
+===================================================================
+--- patch-2.5.9.orig/common.h
++++ patch-2.5.9/common.h
+@@ -146,6 +146,7 @@ XTERN int invc;
+ XTERN struct stat instat;
+ XTERN bool dry_run;
+ XTERN bool posixly_correct;
++XTERN bool unified_reject_files;
+
+ XTERN char const *origprae;
+ XTERN char const *origbase;
+Index: patch-2.5.9/patch.c
+===================================================================
+--- patch-2.5.9.orig/patch.c
++++ patch-2.5.9/patch.c
+@@ -522,6 +522,7 @@ static struct option const longopts[] =
+ {"no-backup-if-mismatch", no_argument, NULL, CHAR_MAX + 6},
+ {"posix", no_argument, NULL, CHAR_MAX + 7},
+ {"quoting-style", required_argument, NULL, CHAR_MAX + 8},
++ {"unified-reject-files", no_argument, NULL, CHAR_MAX + 9},
+ {NULL, no_argument, NULL, 0}
+ };
+
+@@ -580,6 +581,7 @@ static char const *const option_help[] =
+ " --verbose Output extra information about the work being done.",
+ " --dry-run Do not actually change any files; just print what would happen.",
+ " --posix Conform to the POSIX standard.",
++" --unified-reject-files Create unified reject files.",
+ "",
+ " -d DIR --directory=DIR Change the working directory to DIR first.",
+ #if HAVE_SETMODE_DOS
+@@ -779,6 +781,9 @@ get_some_switches (void)
+ (enum quoting_style) i);
+ }
+ break;
++ case CHAR_MAX + 9:
++ unified_reject_files = true;
++ break;
+ default:
+ usage (stderr, 2);
+ }
+@@ -927,6 +932,24 @@ locate_hunk (LINENUM fuzz)
+ return 0;
+ }
+
++static char *
++format_linerange (char rangebuf[LINENUM_LENGTH_BOUND*2 + 2],
++ LINENUM first, LINENUM lines)
++{
++ if (lines == 1)
++ rangebuf = format_linenum (rangebuf, first);
++ else
++ {
++ char *rb;
++ rangebuf = format_linenum (rangebuf + LINENUM_LENGTH_BOUND + 1, lines);
++ rb = rangebuf-1;
++ rangebuf = format_linenum (rangebuf - LINENUM_LENGTH_BOUND - 1,
++ (lines > 0) ? first : 0);
++ *rb = ',';
++ }
++ return rangebuf;
++}
++
+ /* We did not find the pattern, dump out the hunk so they can handle it. */
+
+ static void
+@@ -943,8 +966,83 @@ abort_hunk (void)
+ (int) NEW_CONTEXT_DIFF <= (int) diff_type ? " ****" : "";
+ char const *minuses =
+ (int) NEW_CONTEXT_DIFF <= (int) diff_type ? " ----" : " -----";
++ char const *function = pch_c_function();
++ if (function == NULL)
++ function = "";
++
++ if (unified_reject_files)
++ {
++ /* produce unified reject files */
++ char rangebuf0[LINENUM_LENGTH_BOUND*2 + 2];
++ char rangebuf1[LINENUM_LENGTH_BOUND*2 + 2];
++ LINENUM j;
++
++ /* Find the beginning of the remove and insert section. */
++ for (j = 0; j <= pat_end; j++)
++ if (pch_char (j) == '=')
++ break;
++ for (i = j+1; i <= pat_end; i++)
++ if (pch_char (i) == '^')
++ break;
++ if (pch_char (0) != '*' || j > pat_end || i > pat_end+1)
++ fatal ("internal error in abort_hunk");
++ i = 1; j++;
++
++ /* @@ -from,lines +to,lines @@ */
++ fprintf (rejfp, "@@ -%s +%s @@%s\n",
++ format_linerange (rangebuf0, oldfirst, pch_ptrn_lines()),
++ format_linerange (rangebuf1, newfirst, pch_repl_lines()),
++ function);
++
++ while ( (i <= pat_end && pch_char (i) != '=')
++ || (j <= pat_end && pch_char (j) != '^'))
++ {
++ if (i <= pat_end
++ && (pch_char (i) == '-' || pch_char (i) == '!'))
++ {
++ fputc('-', rejfp);
++ pch_write_line (i++, rejfp);
++ }
++ else if (j <= pat_end
++ && (pch_char (j) == '+' || pch_char (j) == '!'))
++ {
++ fputc('+', rejfp);
++ pch_write_line (j++, rejfp);
++ }
++ else if ((i <= pat_end
++ && (pch_char (i) == ' ' || pch_char (i) == '\n')) &&
++ (j > pat_end
++ || (pch_char (j) == ' ' || pch_char (j) == '\n')))
++ {
++ /* Unless j is already past the end, lines i and j
++ must be equal here. */
++
++ if (pch_char (i) == ' ')
++ fputc(' ', rejfp);
++ pch_write_line (i++, rejfp);
++ if (j <= pat_end)
++ j++;
++ }
++ else if ((j <= pat_end &&
++ (pch_char (j) == ' ' || pch_char (j) == '\n')) &&
++ (pch_char (i) == '='))
++ {
++ if (pch_char (j) == ' ')
++ fputc(' ', rejfp);
++ pch_write_line (j++, rejfp);
++ }
++ else
++ fatal ("internal error in abort_hunk");
++ }
++
++ if (ferror (rejfp))
++ write_fatal ();
++ return;
++ }
+
+- fprintf(rejfp, "***************\n");
++ /* produce context type reject files */
++
++ fprintf(rejfp, "***************%s\n", function);
+ for (i=0; i<=pat_end; i++) {
+ char numbuf0[LINENUM_LENGTH_BOUND + 1];
+ char numbuf1[LINENUM_LENGTH_BOUND + 1];
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/patch/patch_2.5.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/patch/patch_2.5.9.bb
new file mode 100644
index 000000000..c29b24075
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/patch/patch_2.5.9.bb
@@ -0,0 +1,12 @@
+require patch.inc
+LICENSE = "GPLv2"
+
+SRC_URI += " file://debian.patch \
+ file://install.patch \
+ file://unified-reject-files.diff \
+ file://global-reject-file.diff "
+PR = "r3"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+SRC_URI[md5sum] = "dacfb618082f8d3a2194601193cf8716"
+SRC_URI[sha256sum] = "ecb5c6469d732bcf01d6ec1afe9e64f1668caba5bfdb103c28d7f537ba3cdb8a"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/patch/patch_2.7.5.bb b/import-layers/yocto-poky/meta/recipes-devtools/patch/patch_2.7.5.bb
new file mode 100644
index 000000000..f3fcf5e86
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/patch/patch_2.7.5.bb
@@ -0,0 +1,15 @@
+require patch.inc
+LICENSE = "GPLv3"
+
+SRC_URI += "file://0001-Unset-need_charset_alias-when-building-for-musl.patch"
+
+SRC_URI[md5sum] = "ed4d5674ef4543b4eb463db168886dc7"
+SRC_URI[sha256sum] = "7436f5a19f93c3ca83153ce9c5cbe4847e97c5d956e57a220121e741f6e7968f"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+acpaths = "-I ${S}/m4 "
+
+PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'xattr', '', d)}"
+PACKAGECONFIG[xattr] = "--enable-xattr,--disable-xattr,attr,"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/patchelf/patchelf/maxsize.patch b/import-layers/yocto-poky/meta/recipes-devtools/patchelf/patchelf/maxsize.patch
new file mode 100644
index 000000000..cc04a89e6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/patchelf/patchelf/maxsize.patch
@@ -0,0 +1,30 @@
+From f6886c2c33a1cf8771163919f3d20f6340c0ce38 Mon Sep 17 00:00:00 2001
+From: Eelco Dolstra <eelco.dolstra@logicblox.com>
+Date: Fri, 10 Jul 2015 18:12:37 +0200
+Subject: [PATCH] Quick fix for #47
+
+https://github.com/NixOS/patchelf/issues/47
+
+Avoid issues with holes in binaries such as qemu-pcc from qemu-native.
+
+Upstream-Status: Submitted
+RP
+2016/2/3
+
+---
+ src/patchelf.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/patchelf.cc b/src/patchelf.cc
+index 8566ed9..df75593 100644
+--- a/src/patchelf.cc
++++ b/src/patchelf.cc
+@@ -248,7 +248,7 @@ static void readFile(string fileName, mode_t * fileMode)
+ if (stat(fileName.c_str(), &st) != 0) error("stat");
+ fileSize = st.st_size;
+ *fileMode = st.st_mode;
+- maxSize = fileSize + 8 * 1024 * 1024;
++ maxSize = fileSize + 64 * 1024 * 1024;
+
+ contents = (unsigned char *) malloc(fileSize + maxSize);
+ if (!contents) abort(); \ No newline at end of file
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/patchelf/patchelf_0.8.bb b/import-layers/yocto-poky/meta/recipes-devtools/patchelf/patchelf_0.8.bb
new file mode 100644
index 000000000..8484a7e58
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/patchelf/patchelf_0.8.bb
@@ -0,0 +1,13 @@
+SRC_URI = "http://nixos.org/releases/${BPN}/${BPN}-${PV}/${BPN}-${PV}.tar.bz2 \
+ file://maxsize.patch"
+LICENSE = "GPLv3"
+SUMMARY = "Tool to allow editing of RPATH and interpreter fields in ELF binaries"
+
+SRC_URI[md5sum] = "5b151e3c83b31f5931b4a9fc01635bfd"
+SRC_URI[sha256sum] = "c99f84d124347340c36707089ec8f70530abd56e7827c54d506eb4cc097a17e7"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+inherit autotools
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pax-utils/pax-utils_1.1.5.bb b/import-layers/yocto-poky/meta/recipes-devtools/pax-utils/pax-utils_1.1.5.bb
new file mode 100644
index 000000000..a887c037d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pax-utils/pax-utils_1.1.5.bb
@@ -0,0 +1,35 @@
+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 = "http://gentoo.osuosl.org/distfiles/pax-utils-${PV}.tar.xz \
+"
+
+SRC_URI[md5sum] = "bc3614322eaf88f167a608ae85d6b207"
+SRC_URI[sha256sum] = "2945b3e4df2e0dc95800bfbd3d88ab2243b2ee4ff064bbfc75734f6d9d986a89"
+
+RDEPENDS_${PN} += "bash"
+
+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 ??= "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', 'largefile', '', d)} \
+"
+PACKAGECONFIG[libcap] = "--with-caps, --without-caps, libcap"
+PACKAGECONFIG[libseccomp] = "--with-seccomp, --without-seccomp, libseccomp"
+PACKAGECONFIG[largefile] = "--enable-largefile,--disable-largefile,,"
+PACKAGECONFIG[pyelftools] = "--with-python, --without-python,, pyelftools"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/liberror-perl_0.17024.bb b/import-layers/yocto-poky/meta/recipes-devtools/perl/liberror-perl_0.17024.bb
new file mode 100644
index 000000000..6ae0e7e6f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/liberror-perl_0.17024.bb
@@ -0,0 +1,28 @@
+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] = "7e3676a7fb14f65f568f12d4b40a2a72"
+SRC_URI[sha256sum] = "074db7c783a67b0667eca64a4f6a0c3de94998afc92c01d6453163eb04b9150d"
+
+S = "${WORKDIR}/Error-${PV}"
+
+inherit cpan
+
+do_compile() {
+ export LIBC="$(find ${STAGING_DIR_TARGET}/${base_libdir}/ -name 'libc-*.so')"
+ cpan_do_compile
+}
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/liburi-perl_1.60.bb b/import-layers/yocto-poky/meta/recipes-devtools/perl/liburi-perl_1.60.bb
new file mode 100644
index 000000000..8809a44fc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/liburi-perl_1.60.bb
@@ -0,0 +1,29 @@
+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."
+
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+
+LIC_FILES_CHKSUM = "file://README;beginline=26;endline=30;md5=6c33ae5c87fd1c4897714e122dd9c23d"
+
+DEPENDS += "perl"
+
+SRC_URI = "http://www.cpan.org/authors/id/G/GA/GAAS/URI-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "70f739be8ce28b8baba7c5920ffee4dc"
+SRC_URI[sha256sum] = "1f92d3dc64acb8845e9917c945e22b9a5275aeb9ff924eb7873c3b7a5c0d2377"
+
+S = "${WORKDIR}/URI-${PV}"
+
+EXTRA_CPANFLAGS = "EXPATLIBPATH=${STAGING_LIBDIR} EXPATINCPATH=${STAGING_INCDIR}"
+
+inherit cpan
+
+do_compile() {
+ export LIBC="$(find ${STAGING_DIR_TARGET}/${base_libdir}/ -name 'libc-*.so')"
+ cpan_do_compile
+}
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/libxml-parser-perl_2.44.bb b/import-layers/yocto-poky/meta/recipes-devtools/perl/libxml-parser-perl_2.44.bb
new file mode 100644
index 000000000..9561a5955
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/libxml-parser-perl_2.44.bb
@@ -0,0 +1,35 @@
+SUMMARY = "XML::Parser - A perl module for parsing XML documents"
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+LIC_FILES_CHKSUM = "file://README;beginline=2;endline=6;md5=c8767d7516229f07b26e42d1cf8b51f1"
+
+DEPENDS += "expat expat-native"
+
+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
+
+# 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
+}
+
+do_compile() {
+ export LIBC="$(find ${STAGING_DIR_TARGET}/${base_libdir}/ -name 'libc-*.so')"
+ cpan_do_compile
+}
+
+do_compile_class-native() {
+ cpan_do_compile
+}
+
+BBCLASSEXTEND="native"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/libxml-perl_0.08.bb b/import-layers/yocto-poky/meta/recipes-devtools/perl/libxml-perl_0.08.bb
new file mode 100644
index 000000000..2c01976ca
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/libxml-perl_0.08.bb
@@ -0,0 +1,27 @@
+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."
+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
+
+do_compile() {
+ export LIBC="$(find ${STAGING_DIR_TARGET}/${base_libdir}/ -name 'libc-*.so')"
+ cpan_do_compile
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/libxml-simple-perl_2.22.bb b/import-layers/yocto-poky/meta/recipes-devtools/perl/libxml-simple-perl_2.22.bb
new file mode 100644
index 000000000..2243bb2c2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/libxml-simple-perl_2.22.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=fa1187fceda00eee10b62961407ea7be"
+DEPENDS += "libxml-parser-perl"
+
+SRC_URI = "http://www.cpan.org/modules/by-module/XML/XML-Simple-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "0914abddfce749453ed89b54029f2643"
+SRC_URI[sha256sum] = "b9450ef22ea9644ae5d6ada086dc4300fa105be050a2030ebd4efd28c198eb49"
+
+S = "${WORKDIR}/XML-Simple-${PV}"
+
+EXTRA_PERLFLAGS = "-I ${PERLHOSTLIB}"
+
+inherit cpan
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl-native_5.22.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl-native_5.22.1.bb
new file mode 100644
index 000000000..ed8222f24
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl-native_5.22.1.bb
@@ -0,0 +1,127 @@
+require perl.inc
+
+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 \
+ "
+
+SRC_URI[md5sum] = "6671e4829cbaf9cecafa9a84f141b0a3"
+SRC_URI[sha256sum] = "9e87317d693ce828095204be0d09af8d60b8785533fadea1a82b6f0e071e5c79"
+
+inherit native
+
+NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}"
+
+export LD="${CCLD}"
+
+do_configure () {
+ ./Configure \
+ -Dcc="${CC}" \
+ -Dcflags="${CFLAGS}" \
+ -Dldflags="${LDFLAGS}" \
+ -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
+}
+
+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"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl-ptest.inc b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl-ptest.inc
new file mode 100644
index 000000000..948ea7cdd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl-ptest.inc
@@ -0,0 +1,37 @@
+inherit ptest
+
+SRC_URI += "file://run-ptest \
+ "
+
+do_install_ptest () {
+ mkdir -p ${D}${PTEST_PATH}
+ sed -e "s:\/opt:\/usr:" -i Porting/add-package.pl
+ sed -e "s:\/local\/gnu\/:\/:" -i hints/cxux.sh
+ tar -cf - * --exclude \*.o --exclude libperl.so --exclude Makefile --exclude makefile --exclude hostperl \
+ --exclude miniperl --exclude generate_uudmap --exclude patches | ( cd ${D}${PTEST_PATH} && tar -xf - )
+
+ sed -i -e "s,${D},,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" \
+ ${D}${PTEST_PATH}/lib/Config.pm
+
+ ln -sf ${bindir}/perl ${D}${PTEST_PATH}/t/perl
+
+}
+
+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"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl-rdepends_5.22.1.inc b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl-rdepends_5.22.1.inc
new file mode 100644
index 000000000..830ecce53
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl-rdepends_5.22.1.inc
@@ -0,0 +1,2562 @@
+# 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"
+DEPENDS_${PN}-module-math-bigint += "${PN}-module-math-bigint-calc"
+RDEPENDS_${PN}-module-thread-queue += "${PN}-module-attributes"
+
+
+# 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-scopeutil += "${PN}-module-autodie-scope-guardstack"
+RDEPENDS_${PN}-module-autodie-scopeutil += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-autodie-scopeutil += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autodie-scopeutil += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-autodie-skip += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autodie-skip += "${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-vars"
+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-vars"
+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-vars"
+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-carp"
+RDEPENDS_${PN}-module-charnames += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-charnames += "${PN}-module-re"
+RDEPENDS_${PN}-module-charnames += "${PN}-module-strict"
+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-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-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-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 += "${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-vars"
+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-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-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-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-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-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-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-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-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-extutils-makemaker-version-regex"
+RDEPENDS_${PN}-module-extutils-makemaker-version += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-makemaker-version += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-makemaker-version-regex += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-makemaker-version-regex += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-makemaker-version-vpp += "${PN}-module-b"
+RDEPENDS_${PN}-module-extutils-makemaker-version-vpp += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-makemaker-version-vpp += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-makemaker-version-vpp += "${PN}-module-constant"
+RDEPENDS_${PN}-module-extutils-makemaker-version-vpp += "${PN}-module-extutils-makemaker-version-regex"
+RDEPENDS_${PN}-module-extutils-makemaker-version-vpp += "${PN}-module-locale"
+RDEPENDS_${PN}-module-extutils-makemaker-version-vpp += "${PN}-module-overload"
+RDEPENDS_${PN}-module-extutils-makemaker-version-vpp += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-makemaker-version-vpp += "${PN}-module-universal"
+RDEPENDS_${PN}-module-extutils-makemaker-version-vpp += "${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-exception-system"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-autodie-hints"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-autodie-scopeutil"
+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-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-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-overload"
+RDEPENDS_${PN}-module-math-bigfloat += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-bigfloat += "${PN}-module-vars"
+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-vars"
+RDEPENDS_${PN}-module-math-bigint-calcemu += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-bigint-calcemu += "${PN}-module-vars"
+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-fastcalc += "${PN}-module-math-bigint-calc"
+RDEPENDS_${PN}-module-math-bigint-fastcalc += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-bigint-fastcalc += "${PN}-module-vars"
+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-overload"
+RDEPENDS_${PN}-module-math-bigint += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-bigint += "${PN}-module-vars"
+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-vars"
+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-vars"
+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-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-encode"
+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-parselink += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-pod-parselink += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-parselink += "${PN}-module-vars"
+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-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-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 += "${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-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-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-seconds += "${PN}-module-vars"
+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-unicode-collate"
+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-constant"
+RDEPENDS_${PN}-module-unicode-normalize += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-unicode-normalize += "${PN}-module-file-spec"
+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-regex += "${PN}-module-strict"
+RDEPENDS_${PN}-module-version-regex += "${PN}-module-vars"
+RDEPENDS_${PN}-module-version-vpp += "${PN}-module-b"
+RDEPENDS_${PN}-module-version-vpp += "${PN}-module-carp"
+RDEPENDS_${PN}-module-version-vpp += "${PN}-module-config"
+RDEPENDS_${PN}-module-version-vpp += "${PN}-module-constant"
+RDEPENDS_${PN}-module-version-vpp += "${PN}-module-if"
+RDEPENDS_${PN}-module-version-vpp += "${PN}-module-overload"
+RDEPENDS_${PN}-module-version-vpp += "${PN}-module-posix"
+RDEPENDS_${PN}-module-version-vpp += "${PN}-module-strict"
+RDEPENDS_${PN}-module-version-vpp += "${PN}-module-universal"
+RDEPENDS_${PN}-module-version-vpp += "${PN}-module-vars"
+RDEPENDS_${PN}-module-version-vpp += "${PN}-module-version-regex"
+RDEPENDS_${PN}-module-xsloader += "${PN}-module-carp"
+RDEPENDS_${PN}-module-xsloader += "${PN}-module-dynaloader"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl.inc b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl.inc
new file mode 100644
index 000000000..3313a9436
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/Configure-multilib.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/Configure-multilib.patch
new file mode 100644
index 000000000..9625b0b84
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/MM_Unix.pm.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/MM_Unix.pm.patch
new file mode 100644
index 000000000..eb92ccb67
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/Makefile.SH.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/Makefile.SH.patch
new file mode 100644
index 000000000..edf49d60e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/Makefile.SH.patch
@@ -0,0 +1,375 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ Makefile.SH | 145 +++++++++++++++++++++++++++--------------------------------
+ 1 file changed, 67 insertions(+), 78 deletions(-)
+
+Index: perl-5.22.1/Makefile.SH
+===================================================================
+--- perl-5.22.1.orig/Makefile.SH
++++ perl-5.22.1/Makefile.SH
+@@ -39,10 +39,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=''
+@@ -122,10 +122,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
+@@ -141,18 +142,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"
+ ;;
+@@ -566,13 +556,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
+@@ -581,7 +581,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
+@@ -594,7 +594,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'
+@@ -604,7 +604,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
+@@ -699,7 +699,7 @@ esac
+
+
+ $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
+@@ -760,7 +760,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!
+@@ -769,7 +769,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!
+@@ -829,7 +829,7 @@ $(LIBPERL): $& $(obj) $(DYNALOADER) $(LI
+ true)
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+ rm -f $@
+- $(LD) -o $@ $(SHRPLDFLAGS) $(obj) $(DYNALOADER) $(libs)
++ $(LD) -o $@ $(SHRPLDFLAGS) $(obj) $(DYNALOADER) $(libs) -Wl,-soname,libperl.so.5
+ !NO!SUBS!
+ case "$osname" in
+ aix)
+@@ -877,7 +877,9 @@ $(MINIPERL_EXE): lib/buildcustomize.pl
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+ lib/buildcustomize.pl: $& $(mini_obj)
+ $(CC) -o $(MINIPERL_EXE) $(CLDFLAGS) $(mini_obj) $(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!
+ ;;
+@@ -885,7 +887,9 @@ lib/buildcustomize.pl: $& $(mini_obj)
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+ lib/buildcustomize.pl: $& $(mini_obj) write ldcustomize.pl
+ $(CC) -o $(MINIPERL_EXE) $(mini_obj 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'
++ 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!
+ ;;
+@@ -907,7 +911,9 @@ lib/buildcustomize.pl: $& $(mini_obj) wr
+ -@rm -f miniperl.xok
+ $(CC) $(CLDFLAGS) $(NAMESPACEFLAGS) -o $(MINIPERL_EXE) \
+ $(mini_obj) $(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!
+ ;;
+@@ -918,7 +924,9 @@ lib/buildcustomize.pl: \$& \$(mini_obj)
+ -@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
+@@ -927,7 +935,9 @@ lib/buildcustomize.pl: $& $(mini_obj) wr
+ -@rm -f miniperl.xok
+ $(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
+ $(mini_obj) $(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
+@@ -971,7 +981,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
+@@ -981,7 +991,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!
+@@ -991,16 +1001,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
+@@ -1009,12 +1019,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
+@@ -1024,7 +1034,7 @@ pod/perl5221delta.pod: pod/perldelta.pod
+ $(RMS) pod/perl5221delta.pod
+ $(LNS) perldelta.pod pod/perl5221delta.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 \
+@@ -1068,8 +1078,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
+
+@@ -1079,11 +1088,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.
+@@ -1101,24 +1106,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
+
+@@ -1210,13 +1199,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
+@@ -1405,14 +1394,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.*
+@@ -1465,7 +1454,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!
+@@ -1526,7 +1515,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) </dev/tty
+
+ minitest-notty minitest_notty: $(MINIPERL_EXE) minitest_prep
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/Makefile.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/Makefile.patch
new file mode 100644
index 000000000..858e2e10f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh
new file mode 100644
index 000000000..59e016e4d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh
@@ -0,0 +1,1221 @@
+#!/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: Thu Jun 18 05:37:27 UTC 2015
+# 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.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=@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.22.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='0'
+api_version='22'
+api_versionstring='5.22.1'
+ar='ar'
+archlib='@LIBDIR@/perl/5.22.1/@ARCH@-thread-multi'
+archlibexp='@STAGINGDIR@@LIBDIR@/perl/5.22.1/@ARCH@-thread-multi'
+archlib_exp='@LIBDIR@/perl/5.22.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.22.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='Thu Jun 18 05:37:27 UTC 2015'
+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='define'
+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'
+doublekind='3'
+doublesize='8'
+drand01='Perl_drand48()'
+drand48_r_proto='REENTRANT_PROTO_I_ST'
+dtrace=''
+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.22.1/@ARCH@-thread-multi'
+installbin='@USRBIN@'
+installhtml1dir=''
+installhtml3dir=''
+installman1dir=''
+installman3dir=''
+installprefix='@EXECPREFIX@'
+installprefixexp='@EXECPREFIX@'
+installprivlib='@LIBDIR@/perl/5.22.1'
+installscript='@USRBIN@'
+installsitearch='@LIBDIR@/perl/site_perl/5.22.1/@ARCH@-thread-multi'
+installsitebin='@USRBIN@'
+installsitehtml1dir=''
+installsitehtml3dir=''
+installsitelib='@LIBDIR@/perl/site_perl/5.22.1'
+installsiteman1dir=''
+installsiteman3dir=''
+installsitescript='@USRBIN@'
+installstyle='lib/perl'
+installusrbinperl='define'
+installvendorarch='@LIBDIR@/perl/vendor_perl/5.22.1/@ARCH@-thread-multi'
+installvendorbin='@USRBIN@'
+installvendorhtml1dir=''
+installvendorhtml3dir=''
+installvendorlib='@LIBDIR@/perl/vendor_perl/5.22.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@'
+longdblkind='3'
+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"'
+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.22.1'
+package='perl'
+pager='/usr/bin/less -isr'
+passcat='cat /etc/passwd'
+patchlevel='22'
+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.22.1'
+privlibexp='@LIBDIR@/perl/5.22.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.22.1/@ARCH@-thread-multi'
+sitearchexp='@LIBDIR@/perl/site_perl/5.22.1/@ARCH@-thread-multi'
+sitebin='@USRBIN@'
+sitebinexp='@USRBIN@'
+sitehtml1dir=''
+sitehtml1direxp=''
+sitehtml3dir=''
+sitehtml3direxp=''
+sitelib='@LIBDIR@/perl/site_perl/5.22.1'
+sitelib_stem='@LIBDIR@/perl/site_perl'
+sitelibexp='@LIBDIR@/perl/site_perl/5.22.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='0'
+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='define'
+use64bitint='define'
+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.22.1/@ARCH@-thread-multi'
+vendorarchexp='@LIBDIR@/perl/vendor_perl/5.22.1/@ARCH@-thread-multi'
+vendorbin='@USRBIN@'
+vendorbinexp='@USRBIN@'
+vendorhtml1dir=' '
+vendorhtml1direxp=''
+vendorhtml3dir=' '
+vendorhtml3direxp=''
+vendorlib='@LIBDIR@/perl/vendor_perl/5.22.1'
+vendorlib_stem='@LIBDIR@/perl/vendor_perl'
+vendorlibexp='@LIBDIR@/perl/vendor_perl/5.22.1'
+vendorman1dir=' '
+vendorman1direxp=''
+vendorman3dir=' '
+vendorman3direxp=''
+vendorprefix='@EXECPREFIX@'
+vendorprefixexp='@EXECPREFIX@'
+vendorscript='@USRBIN@'
+vendorscriptexp='@USRBIN@'
+version='5.22.1'
+version_patchlevel_string='version 22 subversion 0'
+versiononly='undef'
+vi=''
+xlibpth='@LIBDIR@/386 @BASELIBDIR@386'
+yacc='yacc'
+yaccflags=''
+zcat=''
+zip='zip'
+PERL_REVISION=5
+PERL_VERSION=22
+PERL_SUBVERSION=0
+PERL_API_REVISION=5
+PERL_API_VERSION=22
+PERL_API_SUBVERSION=0
+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'
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-32 b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-32
new file mode 100644
index 000000000..7259a0c6a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-32-be b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-32-be
new file mode 100644
index 000000000..a59a9abb5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-32-be
@@ -0,0 +1 @@
+byteorder='4321'
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-32-le b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-32-le
new file mode 100644
index 000000000..10e422656
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-32-le
@@ -0,0 +1 @@
+byteorder='1234'
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-64 b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-64
new file mode 100644
index 000000000..6929d3a09
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-64-be b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-64-be
new file mode 100644
index 000000000..c08ce3c43
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-64-be
@@ -0,0 +1 @@
+byteorder='87654321'
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-64-le b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-64-le
new file mode 100644
index 000000000..277d2a9be
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-64-le
@@ -0,0 +1 @@
+byteorder='12345678'
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/cross-generate_uudmap.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/cross-generate_uudmap.patch
new file mode 100644
index 000000000..a00ad61d9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/cross-generate_uudmap.patch
@@ -0,0 +1,15 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+Index: perl-5.14.2/Makefile.SH
+===================================================================
+--- perl-5.14.2.orig/Makefile.SH
++++ perl-5.14.2/Makefile.SH
+@@ -622,7 +622,7 @@ bitcount.h: generate_uudmap$(HOST_EXE_EX
+ $(RUN) ./generate_uudmap$(HOST_EXE_EXT) uudmap.h bitcount.h
+
+ 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
+
+ miniperlmain$(OBJ_EXT): miniperlmain.c patchlevel.h
+ $(CCCMD) $(PLDLFLAGS) $*.c
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/cpan-missing-site-dirs.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/cpan-missing-site-dirs.diff
new file mode 100644
index 000000000..a63b96831
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/cpan-missing-site-dirs.diff
@@ -0,0 +1,62 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/cpan_definstalldirs.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/cpan_definstalldirs.diff
new file mode 100644
index 000000000..6b5295045
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/cpan_definstalldirs.diff
@@ -0,0 +1,37 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/db_file_ver.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/db_file_ver.diff
new file mode 100644
index 000000000..280bf1170
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/db_file_ver.diff
@@ -0,0 +1,34 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/deprecate-with-apt.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/deprecate-with-apt.diff
new file mode 100644
index 000000000..601ee4c30
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/deprecate-with-apt.diff
@@ -0,0 +1,56 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/doc_info.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/doc_info.diff
new file mode 100644
index 000000000..fbea2ee22
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/doc_info.diff
@@ -0,0 +1,35 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/enc2xs_inc.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/enc2xs_inc.diff
new file mode 100644
index 000000000..e074b20fd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/enc2xs_inc.diff
@@ -0,0 +1,70 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/errno_ver.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/errno_ver.diff
new file mode 100644
index 000000000..bcb59c69e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/errno_ver.diff
@@ -0,0 +1,35 @@
+From 827eee225897c35ec97194a5971bf4bfcf250748 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 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
+---
+ 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 c6bfa06..519e5c7 100644
+--- a/ext/Errno/Errno_pm.PL
++++ b/ext/Errno/Errno_pm.PL
+@@ -278,13 +278,8 @@ sub write_errno_pm {
+
+ package Errno;
+ require Exporter;
+-use Config;
+ use strict;
+
+-"\$Config{'archname'}-\$Config{'osvers'}" eq
+-"$archname-$Config{'osvers'}" or
+- die "Errno architecture ($archname-$Config{'osvers'}) does not match executable architecture (\$Config{'archname'}-\$Config{'osvers'})";
+-
+ our \$VERSION = "$VERSION";
+ \$VERSION = eval \$VERSION;
+ our \@ISA = 'Exporter';
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/extutils_set_libperl_path.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/extutils_set_libperl_path.diff
new file mode 100644
index 000000000..adb4bd991
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/extutils_set_libperl_path.diff
@@ -0,0 +1,37 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fakeroot.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fakeroot.diff
new file mode 100644
index 000000000..ec461cfe5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fakeroot.diff
@@ -0,0 +1,42 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/find_html2text.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/find_html2text.diff
new file mode 100644
index 000000000..d319e7518
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/find_html2text.diff
@@ -0,0 +1,35 @@
+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].
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/document_makemaker_ccflags.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/document_makemaker_ccflags.diff
new file mode 100644
index 000000000..61a92712e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/document_makemaker_ccflags.diff
@@ -0,0 +1,31 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/memoize_storable_nstore.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/memoize_storable_nstore.diff
new file mode 100644
index 000000000..525f962c1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/memoize_storable_nstore.diff
@@ -0,0 +1,110 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/net_smtp_docs.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/net_smtp_docs.diff
new file mode 100644
index 000000000..3c31972c6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/net_smtp_docs.diff
@@ -0,0 +1,25 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/perl-Cnn.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/perl-Cnn.diff
new file mode 100644
index 000000000..b5564fdbc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/perl-Cnn.diff
@@ -0,0 +1,73 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/pod_man_reproducible_date.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/pod_man_reproducible_date.diff
new file mode 100644
index 000000000..7c9ca867a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/pod_man_reproducible_date.diff
@@ -0,0 +1,170 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-empty-date.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-empty-date.diff
new file mode 100644
index 000000000..7ebbf9c60
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-empty-date.diff
@@ -0,0 +1,51 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-pipe.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-pipe.diff
new file mode 100644
index 000000000..1a6036116
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-pipe.diff
@@ -0,0 +1,109 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-utc-docs.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-utc-docs.diff
new file mode 100644
index 000000000..0cdfeffd1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-utc-docs.diff
@@ -0,0 +1,86 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-utc.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-utc.diff
new file mode 100644
index 000000000..fbd7b9db9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-utc.diff
@@ -0,0 +1,33 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/respect_umask.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/respect_umask.diff
new file mode 100644
index 000000000..d1b498b52
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/respect_umask.diff
@@ -0,0 +1,153 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/instmodsh_doc.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/instmodsh_doc.diff
new file mode 100644
index 000000000..a62c746e9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/instmodsh_doc.diff
@@ -0,0 +1,27 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/ld_run_path.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/ld_run_path.diff
new file mode 100644
index 000000000..d80f86c21
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/ld_run_path.diff
@@ -0,0 +1,24 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/libnet_config_path.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/libnet_config_path.diff
new file mode 100644
index 000000000..54ef9640e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/libnet_config_path.diff
@@ -0,0 +1,37 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/libperl_embed_doc.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/libperl_embed_doc.diff
new file mode 100644
index 000000000..76b805451
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/libperl_embed_doc.diff
@@ -0,0 +1,26 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/locale-robustness.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/locale-robustness.diff
new file mode 100644
index 000000000..fd471ed7a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/locale-robustness.diff
@@ -0,0 +1,52 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/makemaker-pasthru.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/makemaker-pasthru.diff
new file mode 100644
index 000000000..fa0f9daf9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/makemaker-pasthru.diff
@@ -0,0 +1,30 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/makemaker_customized.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/makemaker_customized.diff
new file mode 100644
index 000000000..b1b4cb9a6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/makemaker_customized.diff
@@ -0,0 +1,42 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/mod_paths.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/mod_paths.diff
new file mode 100644
index 000000000..ae1590760
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/mod_paths.diff
@@ -0,0 +1,99 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/no_packlist_perllocal.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/no_packlist_perllocal.diff
new file mode 100644
index 000000000..b911fd276
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/no_packlist_perllocal.diff
@@ -0,0 +1,92 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/patchlevel.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/patchlevel.diff
new file mode 100644
index 000000000..8656b027e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/patchlevel.diff
@@ -0,0 +1,30 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/perl5db-x-terminal-emulator.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/perl5db-x-terminal-emulator.patch
new file mode 100644
index 000000000..533952cac
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/perl5db-x-terminal-emulator.patch
@@ -0,0 +1,29 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/perlivp.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/perlivp.diff
new file mode 100644
index 000000000..2c1eab970
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/perlivp.diff
@@ -0,0 +1,39 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/pod2man-customized.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/pod2man-customized.diff
new file mode 100644
index 000000000..6270b8731
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/pod2man-customized.diff
@@ -0,0 +1,23 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/prefix_changes.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/prefix_changes.diff
new file mode 100644
index 000000000..c41efbe3e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/prefix_changes.diff
@@ -0,0 +1,118 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/prune_libs.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/prune_libs.diff
new file mode 100644
index 000000000..b4443f647
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/prune_libs.diff
@@ -0,0 +1,38 @@
+From 21bc033755f0b609f9bb2aa9e98b10d58424406f Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Fri, 18 Mar 2005 22:22:25 +1100
+Subject: 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
+---
+ Configure | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/Configure b/Configure
+index 0a405d3..6fcc3bc 100755
+--- a/Configure
++++ b/Configure
+@@ -1454,8 +1454,7 @@ libswanted_uselargefiles=''
+ : set usesocks on the Configure command line to enable socks.
+ : List of libraries we want.
+ : If anyone needs extra -lxxx, put those in a hint file.
+-libswanted="cl pthread socket bind inet nsl nm 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 ! !'`
+@@ -23593,7 +23592,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="$*"
+ ;;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/regen-skip.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/regen-skip.diff
new file mode 100644
index 000000000..8a3fc9912
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/regen-skip.diff
@@ -0,0 +1,27 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/skip-kfreebsd-crash.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/skip-kfreebsd-crash.diff
new file mode 100644
index 000000000..ecfc0bc62
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/skip-kfreebsd-crash.diff
@@ -0,0 +1,40 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/skip-upstream-git-tests.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/skip-upstream-git-tests.diff
new file mode 100644
index 000000000..4c87104cc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/skip-upstream-git-tests.diff
@@ -0,0 +1,28 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/squelch-locale-warnings.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/squelch-locale-warnings.diff
new file mode 100644
index 000000000..cb3145776
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/squelch-locale-warnings.diff
@@ -0,0 +1,56 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/writable_site_dirs.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/writable_site_dirs.diff
new file mode 100644
index 000000000..53adc2f4d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/writable_site_dirs.diff
@@ -0,0 +1,36 @@
+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
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/dynaloaderhack.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/dynaloaderhack.patch
new file mode 100644
index 000000000..3df593346
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/dynaloaderhack.patch
@@ -0,0 +1,23 @@
+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
+
+Index: perl-5.14.2/ext/DynaLoader/DynaLoader_pm.PL
+===================================================================
+--- perl-5.14.2.orig/ext/DynaLoader/DynaLoader_pm.PL 2011-09-19 13:18:22.000000000 +0000
++++ perl-5.14.2/ext/DynaLoader/DynaLoader_pm.PL 2013-01-19 16:09:51.020584945 +0000
+@@ -310,6 +310,10 @@
+ foreach (@INC) {
+ <<$^O-eq-VMS>>chop($_ = VMS::Filespec::unixpath($_));<</$^O-eq-VMS>>
+ my $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
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/ext-ODBM_File-hints-linux.pl-link-libgdbm_compat.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/ext-ODBM_File-t-odbm.t-fix-the-path-of-dbmt_common.p.patch b/import-layers/yocto-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..6b05b877f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/ext-ODBM_File-t-odbm.t-fix-the-path-of-dbmt_common.p.patch
@@ -0,0 +1,31 @@
+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>
+---
+ 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/fix_bad_rpath.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/fix_bad_rpath.patch
new file mode 100644
index 000000000..69ac43477
--- /dev/null
+++ b/import-layers/yocto-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.14.2/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
+===================================================================
+--- perl-5.14.2.orig/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
++++ perl-5.14.2/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
+@@ -55,6 +55,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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/generate-sh.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/generate-sh.patch
new file mode 100644
index 000000000..27f6e691c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/installperl.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/installperl.patch
new file mode 100644
index 000000000..456012376
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/installperl.patch
@@ -0,0 +1,17 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+Index: perl-5.12.3/installperl
+===================================================================
+--- perl-5.12.3.orig/installperl
++++ perl-5.12.3/installperl
+@@ -3,8 +3,8 @@
+ BEGIN {
+ require 5.004;
+ 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
+ require './install_lib.pl';
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/letgcc-find-errno.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/letgcc-find-errno.patch
new file mode 100644
index 000000000..5161e4c8b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/make_ext.pl-fix-regenerate-makefile-failed-while-cc-.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/make_ext.pl-fix-regenerate-makefile-failed-while-cc-.patch
new file mode 100644
index 000000000..de6f65294
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/make_ext.pl-fix-regenerate-makefile-failed-while-cc-.patch
@@ -0,0 +1,30 @@
+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(+)
+
+diff --git a/make_ext.pl b/make_ext.pl
+index b433762..9fc1a36 100644
+--- a/make_ext.pl
++++ b/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');
++ }
+ }
+ }
+ }
+--
+1.8.1.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/native-nopacklist.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/native-nopacklist.patch
new file mode 100644
index 000000000..5482dcb79
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/native-perlinc.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/native-perlinc.patch
new file mode 100644
index 000000000..f0bb1f659
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-PathTools-don-t-filter-out-blib-from-INC.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-archlib-exp.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-archlib-exp.patch
new file mode 100644
index 000000000..d912d0031
--- /dev/null
+++ b/import-layers/yocto-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.14.2/config_h.SH
+===================================================================
+--- perl-5.14.2.orig/config_h.SH
++++ perl-5.14.2/config_h.SH
+@@ -996,7 +996,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" /**/
+
+ /* ARCHNAME:
+ * This symbol holds a string representing the architecture name.
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-configpm-switch.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-configpm-switch.patch
new file mode 100644
index 000000000..c6cc15c93
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-configure.sh b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-configure.sh
new file mode 100755
index 000000000..e72ce49f9
--- /dev/null
+++ b/import-layers/yocto-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.12.3 \
+ -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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-dynloader.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-dynloader.patch
new file mode 100644
index 000000000..035beba66
--- /dev/null
+++ b/import-layers/yocto-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.14.2/dist/XSLoader/XSLoader_pm.PL
+===================================================================
+--- perl-5.14.2.orig/dist/XSLoader/XSLoader_pm.PL
++++ perl-5.14.2/dist/XSLoader/XSLoader_pm.PL
+@@ -28,6 +28,20 @@ sub load {
+
+ my ($module, $modlibname) = 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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-enable-gdbm.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-enable-gdbm.patch
new file mode 100644
index 000000000..aa83fca5a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-enable-gdbm.patch
@@ -0,0 +1,19 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+Index: perl-5.8.8/config_h.SH
+===================================================================
+--- perl-5.8.8.orig/config_h.SH 2005-11-01 02:13:05.000000000 +0800
++++ perl-5.8.8/config_h.SH 2010-11-01 17:06:07.215219738 +0800
+@@ -709,6 +709,12 @@
+ */
+ #$i_float I_FLOAT /**/
+
++/* I_GDBM:
++ * This symbol, if defined, indicates that <gdbm.h> exists and should
++ * be included.
++ */
++#$i_gdbm I_GDBM /**/
++
+ /* I_LIMITS:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <limits.h> to get definition of symbols like WORD_BIT or
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-errno-generation-gcc5.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-errno-generation-gcc5.patch
new file mode 100644
index 000000000..7379d8b81
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-moreconfig.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-moreconfig.patch
new file mode 100644
index 000000000..59ce85a7a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/run-ptest b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/run-ptest
new file mode 100644
index 000000000..1e2dd1b66
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/t-run-switches.t-perl5-perl.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/t-run-switches.t-perl5-perl.patch
new file mode 100644
index 000000000..03fdf4ab9
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/test/dist-threads-t-join.t-adjust-ps-option.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/test/ext-DynaLoader-t-DynaLoader.t-fix-calling-dl_findfil.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/perl/perl_5.22.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl_5.22.1.bb
new file mode 100644
index 000000000..bf8b3b60b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl_5.22.1.bb
@@ -0,0 +1,367 @@
+require perl.inc
+
+# We need gnugrep (for -I)
+DEPENDS = "virtual/db grep-native"
+DEPENDS += "gdbm zlib"
+
+# 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-dynloader.patch \
+ file://perl-moreconfig.patch \
+ file://letgcc-find-errno.patch \
+ file://generate-sh.patch \
+ file://native-perlinc.patch \
+ file://perl-enable-gdbm.patch \
+ file://cross-generate_uudmap.patch \
+ file://fix_bad_rpath.patch \
+ file://perl-archlib-exp.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 \
+"
+
+# 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] = "6671e4829cbaf9cecafa9a84f141b0a3"
+SRC_URI[sha256sum] = "9e87317d693ce828095204be0d09af8d60b8785533fadea1a82b6f0e071e5c79"
+
+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_nolargefile() {
+ sed -i -e "s,\(uselargefiles=\)'define',\1'undef',g" \
+ -e "s,\(d_readdir64_r=\)'define',\1'undef',g" \
+ -e "s,\(readdir64_r_proto=\)'\w+',\1'0',g" \
+ -e "/ccflags_uselargefiles/d" \
+ -e "s/-Duselargefiles//" \
+ -e "s/-D_FILE_OFFSET_BITS=64//" \
+ -e "s/-D_LARGEFILE_SOURCE//" \
+ ${S}/Cross/config.sh-${TARGET_ARCH}-${TARGET_OS}
+}
+
+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 uclibc
+ if [ "${TARGET_OS}" = "linux-uclibc" -o "${TARGET_OS}" = "linux-uclibceabi" ]; then
+ sed -i -e "s,\(d_crypt_r=\)'define',\1'undef',g" \
+ -e "s,\(d_futimes=\)'define',\1'undef',g" \
+ -e "s,\(d_finitel=\)'define',\1'undef',g" \
+ -e "s,\(crypt_r_proto=\)'\w+',\1'0',g" \
+ -e "s,\(d_getnetbyname_r=\)'define',\1'undef',g" \
+ -e "s,\(getnetbyname_r_proto=\)'\w+',\1'0',g" \
+ -e "s,\(d_getnetbyaddr_r=\)'define',\1'undef',g" \
+ -e "s,\(getnetbyaddr_r_proto=\)'\w+',\1'0',g" \
+ -e "s,\(d_getnetent_r=\)'define',\1'undef',g" \
+ -e "s,\(getnetent_r_proto=\)'\w+',\1'0',g" \
+ -e "s,\(d_sockatmark=\)'define',\1'undef',g" \
+ -e "s,\(d_sockatmarkproto=\)'\w+',\1'0',g" \
+ -e "s,\(d_eaccess=\)'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,-fstack-protector,-fno-stack-protector,g" \
+ config.sh-${TARGET_ARCH}-${TARGET_OS}
+ fi
+ # Fixups for musl
+ if [ "${TARGET_OS}" = "linux-musl" -o "${TARGET_OS}" = "linux-musleabi" ]; 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
+
+ ${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '', 'do_nolargefile', d)}
+
+ # 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*" -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_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,--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" \
+ ${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_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 "
+
+python populate_packages_prepend () {
+ 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', True).split())
+ d.setVar(d.expand("RRECOMMENDS_${PN}-modules"), ' '.join(packages))
+}
+
+PACKAGES_DYNAMIC += "^perl-module-.*"
+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/import-layers/yocto-poky/meta/recipes-devtools/pkgconfig/pkgconfig/fix-glib-configure-libtool-usage.patch b/import-layers/yocto-poky/meta/recipes-devtools/pkgconfig/pkgconfig/fix-glib-configure-libtool-usage.patch
new file mode 100644
index 000000000..01c62472c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/pkgconfig/pkgconfig/pkg-config-native.in b/import-layers/yocto-poky/meta/recipes-devtools/pkgconfig/pkgconfig/pkg-config-native.in
new file mode 100644
index 000000000..5e44bb435
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb
new file mode 100644
index 000000000..d34f608f1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb
@@ -0,0 +1,53 @@
+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"
+
+DEPENDS = "glib-2.0"
+DEPENDS_class-native = ""
+DEPENDS_class-nativesdk = ""
+
+SRCREV = "5914edfe9604abfedd220103cbac382fc4d268bb"
+PV = "0.29+git${SRCPV}"
+
+SRC_URI = "git://anongit.freedesktop.org/pkg-config \
+ file://pkg-config-native.in \
+ file://fix-glib-configure-libtool-usage.patch \
+ "
+
+S = "${WORKDIR}/git"
+
+inherit autotools
+
+EXTRA_OECONF = "--without-internal-glib"
+EXTRA_OECONF_class-native = "--with-internal-glib"
+EXTRA_OECONF_class-nativesdk = "--with-internal-glib"
+
+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
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/postinst-intercept/nativesdk-postinst-intercept_1.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/postinst-intercept/nativesdk-postinst-intercept_1.0.bb
new file mode 100644
index 000000000..7dc45c68f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/postinst-intercept/nativesdk-postinst-intercept_1.0.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Postinstall scriptlets"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+FILES_${PN}_append = " ${datadir}/postinst-intercepts/*"
+
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install() {
+ install -d ${D}${datadir}/postinst-intercepts
+ install -m 755 ${COREBASE}/scripts/postinst-intercepts/postinst_intercept ${D}${datadir}/postinst-intercepts/
+ install -m 755 ${COREBASE}/scripts/postinst-intercepts/update_font_cache ${D}${datadir}/postinst-intercepts/
+ install -m 755 ${COREBASE}/scripts/postinst-intercepts/update_icon_cache ${D}${datadir}/postinst-intercepts/
+ install -m 755 ${COREBASE}/scripts/postinst-intercepts/update_pixbuf_cache ${D}${datadir}/postinst-intercepts/
+}
+
+inherit nativesdk
+INHIBIT_DEFAULT_DEPS = "1"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink/macros.prelink b/import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink/macros.prelink
new file mode 100644
index 000000000..cb1669588
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink/prelink.conf b/import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink/prelink.conf
new file mode 100644
index 000000000..562f23c59
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink/prelink.cron.daily b/import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink/prelink.cron.daily
new file mode 100644
index 000000000..0b3c07322
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink/prelink.default b/import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink/prelink.default
new file mode 100644
index 000000000..d8802f820
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink_git.bb
new file mode 100644
index 000000000..e223ef689
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink_git.bb
@@ -0,0 +1,81 @@
+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"
+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 = "927979bbd115eeb8a75db3231906ef6aca4c4eb6"
+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"
+
+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/"
+
+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're using image-prelink, we want to skip this on the host side
+# but still do it if the package is installed on the target...
+pkg_postinst_prelink() {
+#!/bin/sh
+
+if [ "x$D" != "x" ]; then
+ ${@bb.utils.contains('USER_CLASSES', 'image-prelink', 'exit 0', 'exit 1', d)}
+fi
+
+prelink -a
+}
+
+pkg_prerm_prelink() {
+#!/bin/sh
+
+if [ "x$D" != "x" ]; then
+ exit 1
+fi
+
+prelink -au
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0001-configure-Prune-PIE-flags.patch b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0001-configure-Prune-PIE-flags.patch
new file mode 100644
index 000000000..43504eaab
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/fallback-group b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/fallback-group
new file mode 100644
index 000000000..81bf73231
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/fallback-group
@@ -0,0 +1,2 @@
+root:*:0:
+mail:*:8:
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/fallback-passwd b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/fallback-passwd
new file mode 100644
index 000000000..c1458dc0f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/fallback-passwd
@@ -0,0 +1 @@
+root::0:0:root:/home/root:/bin/sh
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/handle-remove-xattr.patch b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/handle-remove-xattr.patch
new file mode 100644
index 000000000..8b7f30c66
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/handle-remove-xattr.patch
@@ -0,0 +1,36 @@
+From a24cf102967a4966bfabe36c3542fb65f35bf539 Mon Sep 17 00:00:00 2001
+From: Peter Seebach <peter.seebach@windriver.com>
+Date: Wed, 23 Mar 2016 11:55:25 -0500
+Subject: actually handle remove_xattr correctly
+
+The path is required but wasn't being extracted from the client's message,
+resulting in xattr removal never working. This does not fully address some
+deeper problems with the xattr implementation, but at least the common
+removal case works.
+
+Upstream-Status: Backport
+
+Index: pseudo-1.7.5/ChangeLog.txt
+===================================================================
+--- pseudo-1.7.5.orig/ChangeLog.txt
++++ pseudo-1.7.5/ChangeLog.txt
+@@ -1,3 +1,7 @@
++2016-03-22:
++ * (seebs) extract path from message for remove_xattr so it
++ actually works.
++
+ 2016-02-09:
+ * (seebs) 1.7.5 release
+
+Index: pseudo-1.7.5/pseudo.c
+===================================================================
+--- pseudo-1.7.5.orig/pseudo.c
++++ pseudo-1.7.5/pseudo.c
+@@ -543,6 +543,7 @@ pseudo_op(pseudo_msg_t *msg, const char
+ case OP_GET_XATTR:
+ case OP_LIST_XATTR:
+ case OP_REPLACE_XATTR:
++ case OP_REMOVE_XATTR:
+ case OP_SET_XATTR:
+ /* In a rename there are two paths, null separated in msg->path */
+ initial_len = strlen(msg->path);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/moreretries.patch b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/moreretries.patch
new file mode 100644
index 000000000..c1e555236
--- /dev/null
+++ b/import-layers/yocto-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: pseudo-1.7.5/pseudo_client.c
+===================================================================
+--- pseudo-1.7.5.orig/pseudo_client.c
++++ pseudo-1.7.5/pseudo_client.c
+@@ -1214,7 +1214,7 @@ pseudo_client_setup(void) {
+ return 1;
+ }
+
+-#define PSEUDO_RETRIES 50
++#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/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo.inc b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo.inc
new file mode 100644
index 000000000..0de7b3615
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo.inc
@@ -0,0 +1,134 @@
+# 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"
+
+# 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
+}
+
+# Two below are the same
+# If necessary install for the alternative machine arch. This is only
+# necessary in a native build.
+do_install_append_class-native () {
+ 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
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.6.7.bb b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.6.7.bb
new file mode 100644
index 000000000..b8c20ad65
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.6.7.bb
@@ -0,0 +1,19 @@
+require pseudo.inc
+
+SRC_URI = " \
+ http://downloads.yoctoproject.org/releases/pseudo/${BPN}-${PV}.tar.bz2 \
+ file://fallback-passwd \
+ file://fallback-group \
+"
+
+SRC_URI[md5sum] = "4cd39502f9bd0e734dee80e08b28a5f1"
+SRC_URI[sha256sum] = "9f2caca5f1579a376a509cd81a81156fc208650add9f0af275da9e911f18f291"
+
+PSEUDO_EXTRA_OPTS ?= "--enable-force-async --without-passwd-fallback"
+
+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
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.7.5.bb b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.7.5.bb
new file mode 100644
index 000000000..d90e64445
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.7.5.bb
@@ -0,0 +1,22 @@
+require pseudo.inc
+
+SRC_URI = " \
+ http://downloads.yoctoproject.org/releases/pseudo/${BPN}-${PV}.tar.bz2 \
+ file://0001-configure-Prune-PIE-flags.patch \
+ file://fallback-passwd \
+ file://fallback-group \
+ file://moreretries.patch \
+ file://handle-remove-xattr.patch \
+"
+
+SRC_URI[md5sum] = "c10209938f03128d0c193f041ff3596d"
+SRC_URI[sha256sum] = "fd89cadec984d3b8202aca465898b1bb4350e0d63ba9aa9ac899f6f50270e688"
+
+PSEUDO_EXTRA_OPTS ?= "--enable-force-async --without-passwd-fallback"
+
+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
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_git.bb
new file mode 100644
index 000000000..abff1cfd3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_git.bb
@@ -0,0 +1,11 @@
+require pseudo.inc
+
+SRCREV = "786c6d3813622d18e12d36c4aa722af6a417c8fa"
+PV = "1.7.5+git${SRCPV}"
+
+DEFAULT_PREFERENCE = "-1"
+
+SRC_URI = "git://git.yoctoproject.org/pseudo"
+
+S = "${WORKDIR}/git"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-2.7-manifest.inc b/import-layers/yocto-poky/meta/recipes-devtools/python/python-2.7-manifest.inc
new file mode 100644
index 000000000..189689d4c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-2.7-manifest.inc
@@ -0,0 +1,288 @@
+
+# WARNING: This file is AUTO GENERATED: Manual edits will be lost next time I regenerate the file.
+# Generator: '../../../scripts/contrib/python/generate-manifest-2.7.py' Version 20110222.2 (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
+# Visit the Python for Embedded Systems Site => http://www.Vanille.de/projects/python.spy
+
+
+
+PROVIDES+="${PN}-2to3 ${PN}-argparse ${PN}-audio ${PN}-bsddb ${PN}-codecs ${PN}-compile ${PN}-compiler ${PN}-compression ${PN}-contextlib ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-dev ${PN}-difflib ${PN}-distutils ${PN}-distutils-staticdev ${PN}-doctest ${PN}-email ${PN}-fcntl ${PN}-gdbm ${PN}-hotshot ${PN}-html ${PN}-idle ${PN}-image ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil ${PN}-plistlib ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-resource ${PN}-robotparser ${PN}-shell ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils ${PN}-threading ${PN}-tkinter ${PN}-unittest ${PN}-unixadmin ${PN}-xml ${PN}-xmlrpc ${PN}-zlib "
+
+PACKAGES="${PN}-dbg ${PN}-2to3 ${PN}-argparse ${PN}-audio ${PN}-bsddb ${PN}-codecs ${PN}-compile ${PN}-compiler ${PN}-compression ${PN}-contextlib ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-dev ${PN}-difflib ${PN}-distutils-staticdev ${PN}-distutils ${PN}-doctest ${PN}-email ${PN}-fcntl ${PN}-gdbm ${PN}-hotshot ${PN}-html ${PN}-idle ${PN}-image ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil ${PN}-plistlib ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-resource ${PN}-robotparser ${PN}-shell ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils ${PN}-threading ${PN}-tkinter ${PN}-unittest ${PN}-unixadmin ${PN}-xml ${PN}-xmlrpc ${PN}-zlib ${PN}-modules"
+
+SUMMARY_${PN}-2to3="Python automated Python 2 to 3 code translator"
+RDEPENDS_${PN}-2to3="${PN}-core"
+FILES_${PN}-2to3="${bindir}/2to3 ${libdir}/python2.7/lib2to3 "
+
+SUMMARY_${PN}-argparse="Python command line argument parser"
+RDEPENDS_${PN}-argparse="${PN}-core ${PN}-codecs ${PN}-textutils"
+FILES_${PN}-argparse="${libdir}/python2.7/argparse.* "
+
+SUMMARY_${PN}-audio="Python Audio Handling"
+RDEPENDS_${PN}-audio="${PN}-core"
+FILES_${PN}-audio="${libdir}/python2.7/wave.* ${libdir}/python2.7/chunk.* ${libdir}/python2.7/sndhdr.* ${libdir}/python2.7/lib-dynload/ossaudiodev.so ${libdir}/python2.7/lib-dynload/audioop.so ${libdir}/python2.7/audiodev.* ${libdir}/python2.7/sunaudio.* ${libdir}/python2.7/sunau.* ${libdir}/python2.7/toaiff.* "
+
+SUMMARY_${PN}-bsddb="Python bindings for the Berkeley Database"
+RDEPENDS_${PN}-bsddb="${PN}-core"
+FILES_${PN}-bsddb="${libdir}/python2.7/bsddb ${libdir}/python2.7/lib-dynload/_bsddb.so "
+
+SUMMARY_${PN}-codecs="Python codecs, encodings & i18n support"
+RDEPENDS_${PN}-codecs="${PN}-core ${PN}-lang"
+FILES_${PN}-codecs="${libdir}/python2.7/codecs.* ${libdir}/python2.7/encodings ${libdir}/python2.7/gettext.* ${libdir}/python2.7/locale.* ${libdir}/python2.7/lib-dynload/_locale.so ${libdir}/python2.7/lib-dynload/_codecs* ${libdir}/python2.7/lib-dynload/_multibytecodec.so ${libdir}/python2.7/lib-dynload/unicodedata.so ${libdir}/python2.7/stringprep.* ${libdir}/python2.7/xdrlib.* "
+
+SUMMARY_${PN}-compile="Python bytecode compilation support"
+RDEPENDS_${PN}-compile="${PN}-core"
+FILES_${PN}-compile="${libdir}/python2.7/py_compile.* ${libdir}/python2.7/compileall.* "
+
+SUMMARY_${PN}-compiler="Python compiler support"
+RDEPENDS_${PN}-compiler="${PN}-core"
+FILES_${PN}-compiler="${libdir}/python2.7/compiler "
+
+SUMMARY_${PN}-compression="Python high-level compression support"
+RDEPENDS_${PN}-compression="${PN}-core ${PN}-zlib"
+FILES_${PN}-compression="${libdir}/python2.7/gzip.* ${libdir}/python2.7/zipfile.* ${libdir}/python2.7/tarfile.* ${libdir}/python2.7/lib-dynload/bz2.so "
+
+SUMMARY_${PN}-contextlib="Python utilities for with-statementcontexts."
+RDEPENDS_${PN}-contextlib="${PN}-core"
+FILES_${PN}-contextlib="${libdir}/python${PYTHON_MAJMIN}/contextlib.* "
+
+SUMMARY_${PN}-core="Python interpreter and core modules"
+RDEPENDS_${PN}-core="${PN}-lang ${PN}-re"
+FILES_${PN}-core="${libdir}/python2.7/__future__.* ${libdir}/python2.7/_abcoll.* ${libdir}/python2.7/abc.* ${libdir}/python2.7/ast.* ${libdir}/python2.7/copy.* ${libdir}/python2.7/copy_reg.* ${libdir}/python2.7/ConfigParser.* ${libdir}/python2.7/genericpath.* ${libdir}/python2.7/getopt.* ${libdir}/python2.7/linecache.* ${libdir}/python2.7/new.* ${libdir}/python2.7/os.* ${libdir}/python2.7/posixpath.* ${libdir}/python2.7/struct.* ${libdir}/python2.7/warnings.* ${libdir}/python2.7/site.* ${libdir}/python2.7/stat.* ${libdir}/python2.7/UserDict.* ${libdir}/python2.7/UserList.* ${libdir}/python2.7/UserString.* ${libdir}/python2.7/lib-dynload/binascii.so ${libdir}/python2.7/lib-dynload/_struct.so ${libdir}/python2.7/lib-dynload/time.so ${libdir}/python2.7/lib-dynload/xreadlines.so ${libdir}/python2.7/types.* ${libdir}/python2.7/platform.* ${bindir}/python* ${libdir}/python2.7/_weakrefset.* ${libdir}/python2.7/sysconfig.* ${libdir}/python2.7/_sysconfigdata.* ${libdir}/python2.7/config/Makefile ${includedir}/python${PYTHON_MAJMIN}/pyconfig*.h ${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py "
+
+SUMMARY_${PN}-crypt="Python basic cryptographic and hashing support"
+RDEPENDS_${PN}-crypt="${PN}-core"
+FILES_${PN}-crypt="${libdir}/python2.7/hashlib.* ${libdir}/python2.7/md5.* ${libdir}/python2.7/sha.* ${libdir}/python2.7/lib-dynload/crypt.so ${libdir}/python2.7/lib-dynload/_hashlib.so ${libdir}/python2.7/lib-dynload/_sha256.so ${libdir}/python2.7/lib-dynload/_sha512.so "
+
+SUMMARY_${PN}-ctypes="Python C types support"
+RDEPENDS_${PN}-ctypes="${PN}-core"
+FILES_${PN}-ctypes="${libdir}/python2.7/ctypes ${libdir}/python2.7/lib-dynload/_ctypes.so ${libdir}/python2.7/lib-dynload/_ctypes_test.so "
+
+SUMMARY_${PN}-curses="Python curses support"
+RDEPENDS_${PN}-curses="${PN}-core"
+FILES_${PN}-curses="${libdir}/python2.7/curses ${libdir}/python2.7/lib-dynload/_curses.so ${libdir}/python2.7/lib-dynload/_curses_panel.so "
+
+SUMMARY_${PN}-datetime="Python calendar and time support"
+RDEPENDS_${PN}-datetime="${PN}-core ${PN}-codecs"
+FILES_${PN}-datetime="${libdir}/python2.7/_strptime.* ${libdir}/python2.7/calendar.* ${libdir}/python2.7/lib-dynload/datetime.so "
+
+SUMMARY_${PN}-db="Python file-based database support"
+RDEPENDS_${PN}-db="${PN}-core"
+FILES_${PN}-db="${libdir}/python2.7/anydbm.* ${libdir}/python2.7/dumbdbm.* ${libdir}/python2.7/whichdb.* "
+
+SUMMARY_${PN}-debugger="Python debugger"
+RDEPENDS_${PN}-debugger="${PN}-core ${PN}-io ${PN}-lang ${PN}-re ${PN}-stringold ${PN}-shell ${PN}-pprint"
+FILES_${PN}-debugger="${libdir}/python2.7/bdb.* ${libdir}/python2.7/pdb.* "
+
+SUMMARY_${PN}-dev="Python development package"
+RDEPENDS_${PN}-dev="${PN}-core"
+FILES_${PN}-dev="${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la ${libdir}/*.a ${libdir}/*.o ${libdir}/pkgconfig ${base_libdir}/*.a ${base_libdir}/*.o ${datadir}/aclocal ${datadir}/pkgconfig "
+
+SUMMARY_${PN}-difflib="Python helpers for computing deltas between objects"
+RDEPENDS_${PN}-difflib="${PN}-lang ${PN}-re"
+FILES_${PN}-difflib="${libdir}/python2.7/difflib.* "
+
+SUMMARY_${PN}-distutils="Python Distribution Utilities"
+RDEPENDS_${PN}-distutils="${PN}-core ${PN}-email"
+FILES_${PN}-distutils="${libdir}/python2.7/config ${libdir}/python2.7/distutils "
+
+SUMMARY_${PN}-distutils-staticdev="Python distribution utilities (static libraries)"
+RDEPENDS_${PN}-distutils-staticdev="${PN}-distutils"
+FILES_${PN}-distutils-staticdev="${libdir}/python2.7/config/lib*.a "
+
+SUMMARY_${PN}-doctest="Python framework for running examples in docstrings"
+RDEPENDS_${PN}-doctest="${PN}-core ${PN}-lang ${PN}-io ${PN}-re ${PN}-unittest ${PN}-debugger ${PN}-difflib"
+FILES_${PN}-doctest="${libdir}/python2.7/doctest.* "
+
+SUMMARY_${PN}-email="Python email support"
+RDEPENDS_${PN}-email="${PN}-core ${PN}-io ${PN}-re ${PN}-mime ${PN}-audio ${PN}-image ${PN}-netclient"
+FILES_${PN}-email="${libdir}/python2.7/imaplib.* ${libdir}/python2.7/email "
+
+SUMMARY_${PN}-fcntl="Python's fcntl interface"
+RDEPENDS_${PN}-fcntl="${PN}-core"
+FILES_${PN}-fcntl="${libdir}/python2.7/lib-dynload/fcntl.so "
+
+SUMMARY_${PN}-gdbm="Python GNU database support"
+RDEPENDS_${PN}-gdbm="${PN}-core"
+FILES_${PN}-gdbm="${libdir}/python2.7/lib-dynload/gdbm.so "
+
+SUMMARY_${PN}-hotshot="Python hotshot performance profiler"
+RDEPENDS_${PN}-hotshot="${PN}-core"
+FILES_${PN}-hotshot="${libdir}/python2.7/hotshot ${libdir}/python2.7/lib-dynload/_hotshot.so "
+
+SUMMARY_${PN}-html="Python HTML processing support"
+RDEPENDS_${PN}-html="${PN}-core"
+FILES_${PN}-html="${libdir}/python2.7/formatter.* ${libdir}/python2.7/htmlentitydefs.* ${libdir}/python2.7/htmllib.* ${libdir}/python2.7/markupbase.* ${libdir}/python2.7/sgmllib.* ${libdir}/python2.7/HTMLParser.* "
+
+SUMMARY_${PN}-idle="Python Integrated Development Environment"
+RDEPENDS_${PN}-idle="${PN}-core ${PN}-tkinter"
+FILES_${PN}-idle="${bindir}/idle ${libdir}/python2.7/idlelib "
+
+SUMMARY_${PN}-image="Python graphical image handling"
+RDEPENDS_${PN}-image="${PN}-core"
+FILES_${PN}-image="${libdir}/python2.7/colorsys.* ${libdir}/python2.7/imghdr.* ${libdir}/python2.7/lib-dynload/imageop.so ${libdir}/python2.7/lib-dynload/rgbimg.so "
+
+SUMMARY_${PN}-importlib="Python import implementation library"
+RDEPENDS_${PN}-importlib="${PN}-core"
+FILES_${PN}-importlib="${libdir}/python2.7/importlib "
+
+SUMMARY_${PN}-io="Python low-level I/O"
+RDEPENDS_${PN}-io="${PN}-core ${PN}-math ${PN}-textutils ${PN}-netclient ${PN}-contextlib"
+FILES_${PN}-io="${libdir}/python2.7/lib-dynload/_socket.so ${libdir}/python2.7/lib-dynload/_io.so ${libdir}/python2.7/lib-dynload/_ssl.so ${libdir}/python2.7/lib-dynload/select.so ${libdir}/python2.7/lib-dynload/termios.so ${libdir}/python2.7/lib-dynload/cStringIO.so ${libdir}/python2.7/pipes.* ${libdir}/python2.7/socket.* ${libdir}/python2.7/ssl.* ${libdir}/python2.7/tempfile.* ${libdir}/python2.7/StringIO.* ${libdir}/python2.7/io.* ${libdir}/python2.7/_pyio.* "
+
+SUMMARY_${PN}-json="Python JSON support"
+RDEPENDS_${PN}-json="${PN}-core ${PN}-math ${PN}-re ${PN}-codecs"
+FILES_${PN}-json="${libdir}/python2.7/json ${libdir}/python2.7/lib-dynload/_json.so "
+
+SUMMARY_${PN}-lang="Python low-level language support"
+RDEPENDS_${PN}-lang="${PN}-core"
+FILES_${PN}-lang="${libdir}/python2.7/lib-dynload/_bisect.so ${libdir}/python2.7/lib-dynload/_collections.so ${libdir}/python2.7/lib-dynload/_heapq.so ${libdir}/python2.7/lib-dynload/_weakref.so ${libdir}/python2.7/lib-dynload/_functools.so ${libdir}/python2.7/lib-dynload/array.so ${libdir}/python2.7/lib-dynload/itertools.so ${libdir}/python2.7/lib-dynload/operator.so ${libdir}/python2.7/lib-dynload/parser.so ${libdir}/python2.7/atexit.* ${libdir}/python2.7/bisect.* ${libdir}/python2.7/code.* ${libdir}/python2.7/codeop.* ${libdir}/python2.7/collections.* ${libdir}/python2.7/dis.* ${libdir}/python2.7/functools.* ${libdir}/python2.7/heapq.* ${libdir}/python2.7/inspect.* ${libdir}/python2.7/keyword.* ${libdir}/python2.7/opcode.* ${libdir}/python2.7/symbol.* ${libdir}/python2.7/repr.* ${libdir}/python2.7/token.* ${libdir}/python2.7/tokenize.* ${libdir}/python2.7/traceback.* ${libdir}/python2.7/weakref.* "
+
+SUMMARY_${PN}-logging="Python logging support"
+RDEPENDS_${PN}-logging="${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-stringold"
+FILES_${PN}-logging="${libdir}/python2.7/logging "
+
+SUMMARY_${PN}-mailbox="Python mailbox format support"
+RDEPENDS_${PN}-mailbox="${PN}-core ${PN}-mime"
+FILES_${PN}-mailbox="${libdir}/python2.7/mailbox.* "
+
+SUMMARY_${PN}-math="Python math support"
+RDEPENDS_${PN}-math="${PN}-core ${PN}-crypt"
+FILES_${PN}-math="${libdir}/python2.7/lib-dynload/cmath.so ${libdir}/python2.7/lib-dynload/math.so ${libdir}/python2.7/lib-dynload/_random.so ${libdir}/python2.7/random.* ${libdir}/python2.7/sets.* "
+
+SUMMARY_${PN}-mime="Python MIME handling APIs"
+RDEPENDS_${PN}-mime="${PN}-core ${PN}-io"
+FILES_${PN}-mime="${libdir}/python2.7/mimetools.* ${libdir}/python2.7/uu.* ${libdir}/python2.7/quopri.* ${libdir}/python2.7/rfc822.* ${libdir}/python2.7/MimeWriter.* "
+
+SUMMARY_${PN}-mmap="Python memory-mapped file support"
+RDEPENDS_${PN}-mmap="${PN}-core ${PN}-io"
+FILES_${PN}-mmap="${libdir}/python2.7/lib-dynload/mmap.so "
+
+SUMMARY_${PN}-multiprocessing="Python multiprocessing support"
+RDEPENDS_${PN}-multiprocessing="${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-threading ${PN}-ctypes ${PN}-mmap"
+FILES_${PN}-multiprocessing="${libdir}/python2.7/lib-dynload/_multiprocessing.so ${libdir}/python2.7/multiprocessing "
+
+SUMMARY_${PN}-netclient="Python Internet Protocol clients"
+RDEPENDS_${PN}-netclient="${PN}-core ${PN}-crypt ${PN}-datetime ${PN}-io ${PN}-lang ${PN}-logging ${PN}-mime"
+FILES_${PN}-netclient="${libdir}/python2.7/*Cookie*.* ${libdir}/python2.7/base64.* ${libdir}/python2.7/cookielib.* ${libdir}/python2.7/ftplib.* ${libdir}/python2.7/gopherlib.* ${libdir}/python2.7/hmac.* ${libdir}/python2.7/httplib.* ${libdir}/python2.7/mimetypes.* ${libdir}/python2.7/nntplib.* ${libdir}/python2.7/poplib.* ${libdir}/python2.7/smtplib.* ${libdir}/python2.7/telnetlib.* ${libdir}/python2.7/urllib.* ${libdir}/python2.7/urllib2.* ${libdir}/python2.7/urlparse.* ${libdir}/python2.7/uuid.* ${libdir}/python2.7/rfc822.* ${libdir}/python2.7/mimetools.* "
+
+SUMMARY_${PN}-netserver="Python Internet Protocol servers"
+RDEPENDS_${PN}-netserver="${PN}-core ${PN}-netclient ${PN}-shell ${PN}-threading"
+FILES_${PN}-netserver="${libdir}/python2.7/cgi.* ${libdir}/python2.7/*HTTPServer.* ${libdir}/python2.7/SocketServer.* "
+
+SUMMARY_${PN}-numbers="Python number APIs"
+RDEPENDS_${PN}-numbers="${PN}-core ${PN}-lang ${PN}-re"
+FILES_${PN}-numbers="${libdir}/python2.7/decimal.* ${libdir}/python2.7/fractions.* ${libdir}/python2.7/numbers.* "
+
+SUMMARY_${PN}-pickle="Python serialisation/persistence support"
+RDEPENDS_${PN}-pickle="${PN}-core ${PN}-codecs ${PN}-io ${PN}-re"
+FILES_${PN}-pickle="${libdir}/python2.7/pickle.* ${libdir}/python2.7/shelve.* ${libdir}/python2.7/lib-dynload/cPickle.so ${libdir}/python2.7/pickletools.* "
+
+SUMMARY_${PN}-pkgutil="Python package extension utility support"
+RDEPENDS_${PN}-pkgutil="${PN}-core"
+FILES_${PN}-pkgutil="${libdir}/python2.7/pkgutil.* "
+
+SUMMARY_${PN}-plistlib="Generate and parse Mac OS X .plist files"
+RDEPENDS_${PN}-plistlib="${PN}-core ${PN}-datetime ${PN}-io"
+FILES_${PN}-plistlib="${libdir}/python2.7/plistlib.* "
+
+SUMMARY_${PN}-pprint="Python pretty-print support"
+RDEPENDS_${PN}-pprint="${PN}-core ${PN}-io"
+FILES_${PN}-pprint="${libdir}/python2.7/pprint.* "
+
+SUMMARY_${PN}-profile="Python basic performance profiling support"
+RDEPENDS_${PN}-profile="${PN}-core ${PN}-textutils"
+FILES_${PN}-profile="${libdir}/python2.7/profile.* ${libdir}/python2.7/pstats.* ${libdir}/python2.7/cProfile.* ${libdir}/python2.7/lib-dynload/_lsprof.so "
+
+SUMMARY_${PN}-pydoc="Python interactive help support"
+RDEPENDS_${PN}-pydoc="${PN}-core ${PN}-lang ${PN}-stringold ${PN}-re"
+FILES_${PN}-pydoc="${bindir}/pydoc ${libdir}/python2.7/pydoc.* ${libdir}/python2.7/pydoc_data "
+
+SUMMARY_${PN}-re="Python Regular Expression APIs"
+RDEPENDS_${PN}-re="${PN}-core"
+FILES_${PN}-re="${libdir}/python2.7/re.* ${libdir}/python2.7/sre.* ${libdir}/python2.7/sre_compile.* ${libdir}/python2.7/sre_constants* ${libdir}/python2.7/sre_parse.* "
+
+SUMMARY_${PN}-readline="Python readline support"
+RDEPENDS_${PN}-readline="${PN}-core"
+FILES_${PN}-readline="${libdir}/python2.7/lib-dynload/readline.so ${libdir}/python2.7/rlcompleter.* "
+
+SUMMARY_${PN}-resource="Python resource control interface"
+RDEPENDS_${PN}-resource="${PN}-core"
+FILES_${PN}-resource="${libdir}/python2.7/lib-dynload/resource.so "
+
+SUMMARY_${PN}-robotparser="Python robots.txt parser"
+RDEPENDS_${PN}-robotparser="${PN}-core ${PN}-netclient"
+FILES_${PN}-robotparser="${libdir}/python2.7/robotparser.* "
+
+SUMMARY_${PN}-shell="Python shell-like functionality"
+RDEPENDS_${PN}-shell="${PN}-core ${PN}-re"
+FILES_${PN}-shell="${libdir}/python2.7/cmd.* ${libdir}/python2.7/commands.* ${libdir}/python2.7/dircache.* ${libdir}/python2.7/fnmatch.* ${libdir}/python2.7/glob.* ${libdir}/python2.7/popen2.* ${libdir}/python2.7/shlex.* ${libdir}/python2.7/shutil.* "
+
+SUMMARY_${PN}-smtpd="Python Simple Mail Transport Daemon"
+RDEPENDS_${PN}-smtpd="${PN}-core ${PN}-netserver ${PN}-email ${PN}-mime"
+FILES_${PN}-smtpd="${bindir}/smtpd.* ${libdir}/python2.7/smtpd.* "
+
+SUMMARY_${PN}-sqlite3="Python Sqlite3 database support"
+RDEPENDS_${PN}-sqlite3="${PN}-core ${PN}-datetime ${PN}-lang ${PN}-crypt ${PN}-io ${PN}-threading ${PN}-zlib"
+FILES_${PN}-sqlite3="${libdir}/python2.7/lib-dynload/_sqlite3.so ${libdir}/python2.7/sqlite3/dbapi2.* ${libdir}/python2.7/sqlite3/__init__.* ${libdir}/python2.7/sqlite3/dump.* "
+
+SUMMARY_${PN}-sqlite3-tests="Python Sqlite3 database support tests"
+RDEPENDS_${PN}-sqlite3-tests="${PN}-core ${PN}-sqlite3"
+FILES_${PN}-sqlite3-tests="${libdir}/python2.7/sqlite3/test "
+
+SUMMARY_${PN}-stringold="Python string APIs [deprecated]"
+RDEPENDS_${PN}-stringold="${PN}-core ${PN}-re"
+FILES_${PN}-stringold="${libdir}/python2.7/lib-dynload/strop.so ${libdir}/python2.7/string.* ${libdir}/python2.7/stringold.* "
+
+SUMMARY_${PN}-subprocess="Python subprocess support"
+RDEPENDS_${PN}-subprocess="${PN}-core ${PN}-io ${PN}-re ${PN}-fcntl ${PN}-pickle"
+FILES_${PN}-subprocess="${libdir}/python2.7/subprocess.* "
+
+SUMMARY_${PN}-syslog="Python syslog interface"
+RDEPENDS_${PN}-syslog="${PN}-core"
+FILES_${PN}-syslog="${libdir}/python2.7/lib-dynload/syslog.so "
+
+SUMMARY_${PN}-terminal="Python terminal controlling support"
+RDEPENDS_${PN}-terminal="${PN}-core ${PN}-io"
+FILES_${PN}-terminal="${libdir}/python2.7/pty.* ${libdir}/python2.7/tty.* "
+
+SUMMARY_${PN}-tests="Python tests"
+RDEPENDS_${PN}-tests="${PN}-core"
+FILES_${PN}-tests="${libdir}/python2.7/test "
+
+SUMMARY_${PN}-textutils="Python option parsing, text wrapping and CSV support"
+RDEPENDS_${PN}-textutils="${PN}-core ${PN}-io ${PN}-re ${PN}-stringold"
+FILES_${PN}-textutils="${libdir}/python2.7/lib-dynload/_csv.so ${libdir}/python2.7/csv.* ${libdir}/python2.7/optparse.* ${libdir}/python2.7/textwrap.* "
+
+SUMMARY_${PN}-threading="Python threading & synchronization support"
+RDEPENDS_${PN}-threading="${PN}-core ${PN}-lang"
+FILES_${PN}-threading="${libdir}/python2.7/_threading_local.* ${libdir}/python2.7/dummy_thread.* ${libdir}/python2.7/dummy_threading.* ${libdir}/python2.7/mutex.* ${libdir}/python2.7/threading.* ${libdir}/python2.7/Queue.* "
+
+SUMMARY_${PN}-tkinter="Python Tcl/Tk bindings"
+RDEPENDS_${PN}-tkinter="${PN}-core"
+FILES_${PN}-tkinter="${libdir}/python2.7/lib-dynload/_tkinter.so ${libdir}/python2.7/lib-tk "
+
+SUMMARY_${PN}-unittest="Python unit testing framework"
+RDEPENDS_${PN}-unittest="${PN}-core ${PN}-stringold ${PN}-lang ${PN}-io ${PN}-difflib ${PN}-pprint ${PN}-shell"
+FILES_${PN}-unittest="${libdir}/python2.7/unittest/ "
+
+SUMMARY_${PN}-unixadmin="Python Unix administration support"
+RDEPENDS_${PN}-unixadmin="${PN}-core"
+FILES_${PN}-unixadmin="${libdir}/python2.7/lib-dynload/nis.so ${libdir}/python2.7/lib-dynload/grp.so ${libdir}/python2.7/lib-dynload/pwd.so ${libdir}/python2.7/getpass.* "
+
+SUMMARY_${PN}-xml="Python basic XML support"
+RDEPENDS_${PN}-xml="${PN}-core ${PN}-re"
+FILES_${PN}-xml="${libdir}/python2.7/lib-dynload/_elementtree.so ${libdir}/python2.7/lib-dynload/pyexpat.so ${libdir}/python2.7/xml ${libdir}/python2.7/xmllib.* "
+
+SUMMARY_${PN}-xmlrpc="Python XML-RPC support"
+RDEPENDS_${PN}-xmlrpc="${PN}-core ${PN}-xml ${PN}-netserver ${PN}-lang"
+FILES_${PN}-xmlrpc="${libdir}/python2.7/xmlrpclib.* ${libdir}/python2.7/SimpleXMLRPCServer.* ${libdir}/python2.7/DocXMLRPCServer.* "
+
+SUMMARY_${PN}-zlib="Python zlib compression support"
+RDEPENDS_${PN}-zlib="${PN}-core"
+FILES_${PN}-zlib="${libdir}/python2.7/lib-dynload/zlib.so "
+
+SUMMARY_${PN}-modules="All Python modules"
+RDEPENDS_${PN}-modules="${PN}-2to3 ${PN}-argparse ${PN}-audio ${PN}-bsddb ${PN}-codecs ${PN}-compile ${PN}-compiler ${PN}-compression ${PN}-contextlib ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-difflib ${PN}-distutils ${PN}-doctest ${PN}-email ${PN}-fcntl ${PN}-gdbm ${PN}-hotshot ${PN}-html ${PN}-idle ${PN}-image ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil ${PN}-plistlib ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-resource ${PN}-robotparser ${PN}-shell ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils ${PN}-threading ${PN}-tkinter ${PN}-unittest ${PN}-unixadmin ${PN}-xml ${PN}-xmlrpc ${PN}-zlib "
+ALLOW_EMPTY_${PN}-modules = "1"
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-3.5-manifest.inc b/import-layers/yocto-poky/meta/recipes-devtools/python/python-3.5-manifest.inc
new file mode 100644
index 000000000..335c3ffdb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-3.5-manifest.inc
@@ -0,0 +1,264 @@
+
+# WARNING: This file is AUTO GENERATED: Manual edits will be lost next time I regenerate the file.
+# Generator: '../../../scripts/contrib/python/generate-manifest-3.5.py' Version 20140131 (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
+# Visit the Python for Embedded Systems Site => http://www.Vanille.de/projects/python.spy
+
+
+
+PROVIDES+="${PN}-2to3 ${PN}-asyncio ${PN}-audio ${PN}-codecs ${PN}-compile ${PN}-compression ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-dev ${PN}-difflib ${PN}-distutils ${PN}-distutils-staticdev ${PN}-doctest ${PN}-email ${PN}-fcntl ${PN}-gdbm ${PN}-html ${PN}-idle ${PN}-image ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-reprlib ${PN}-resource ${PN}-shell ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils ${PN}-threading ${PN}-tkinter ${PN}-unittest ${PN}-unixadmin ${PN}-xml ${PN}-xmlrpc "
+
+PACKAGES="${PN}-dbg ${PN}-2to3 ${PN}-asyncio ${PN}-audio ${PN}-codecs ${PN}-compile ${PN}-compression ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-dev ${PN}-difflib ${PN}-distutils-staticdev ${PN}-distutils ${PN}-doctest ${PN}-email ${PN}-fcntl ${PN}-gdbm ${PN}-html ${PN}-idle ${PN}-image ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-reprlib ${PN}-resource ${PN}-shell ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils ${PN}-threading ${PN}-tkinter ${PN}-unittest ${PN}-unixadmin ${PN}-xml ${PN}-xmlrpc ${PN}-modules"
+
+SUMMARY_${PN}-2to3="Python automated Python 2 to 3 code translator"
+RDEPENDS_${PN}-2to3="${PN}-core"
+FILES_${PN}-2to3="${libdir}/python3.5/lib2to3 "
+
+SUMMARY_${PN}-asyncio="Python Asynchronous I/O, event loop, coroutines and tasks"
+RDEPENDS_${PN}-asyncio="${PN}-core"
+FILES_${PN}-asyncio="${libdir}/python3.5/asyncio "
+
+SUMMARY_${PN}-audio="Python Audio Handling"
+RDEPENDS_${PN}-audio="${PN}-core"
+FILES_${PN}-audio="${libdir}/python3.5/wave.* ${libdir}/python3.5/chunk.* ${libdir}/python3.5/sndhdr.* ${libdir}/python3.5/lib-dynload/ossaudiodev.*.so ${libdir}/python3.5/lib-dynload/audioop.*.so ${libdir}/python3.5/audiodev.* ${libdir}/python3.5/sunaudio.* ${libdir}/python3.5/sunau.* ${libdir}/python3.5/toaiff.* "
+
+SUMMARY_${PN}-codecs="Python codecs, encodings & i18n support"
+RDEPENDS_${PN}-codecs="${PN}-core ${PN}-lang"
+FILES_${PN}-codecs="${libdir}/python3.5/codecs.* ${libdir}/python3.5/encodings ${libdir}/python3.5/gettext.* ${libdir}/python3.5/locale.* ${libdir}/python3.5/lib-dynload/_locale.*.so ${libdir}/python3.5/lib-dynload/_codecs* ${libdir}/python3.5/lib-dynload/_multibytecodec.*.so ${libdir}/python3.5/lib-dynload/unicodedata.*.so ${libdir}/python3.5/stringprep.* ${libdir}/python3.5/xdrlib.* "
+
+SUMMARY_${PN}-compile="Python bytecode compilation support"
+RDEPENDS_${PN}-compile="${PN}-core"
+FILES_${PN}-compile="${libdir}/python3.5/py_compile.* ${libdir}/python3.5/compileall.* "
+
+SUMMARY_${PN}-compression="Python high-level compression support"
+RDEPENDS_${PN}-compression="${PN}-core ${PN}-codecs"
+FILES_${PN}-compression="${libdir}/python3.5/gzip.* ${libdir}/python3.5/zipfile.* ${libdir}/python3.5/tarfile.* ${libdir}/python3.5/lib-dynload/bz2.*.so "
+
+SUMMARY_${PN}-core="Python interpreter and core modules"
+RDEPENDS_${PN}-core="${PN}-lang ${PN}-re ${PN}-reprlib ${PN}-codecs ${PN}-io ${PN}-math"
+FILES_${PN}-core="${libdir}/python3.5/__future__.* ${libdir}/python3.5/_abcoll.* ${libdir}/python3.5/abc.* ${libdir}/python3.5/ast.* ${libdir}/python3.5/copy.* ${libdir}/python3.5/copyreg.* ${libdir}/python3.5/ConfigParser.* ${libdir}/python3.5/genericpath.* ${libdir}/python3.5/getopt.* ${libdir}/python3.5/linecache.* ${libdir}/python3.5/new.* ${libdir}/python3.5/os.* ${libdir}/python3.5/posixpath.* ${libdir}/python3.5/struct.* ${libdir}/python3.5/warnings.* ${libdir}/python3.5/site.* ${libdir}/python3.5/stat.* ${libdir}/python3.5/UserDict.* ${libdir}/python3.5/UserList.* ${libdir}/python3.5/UserString.* ${libdir}/python3.5/lib-dynload/binascii.*.so ${libdir}/python3.5/lib-dynload/_struct.*.so ${libdir}/python3.5/lib-dynload/time.*.so ${libdir}/python3.5/lib-dynload/xreadlines.*.so ${libdir}/python3.5/types.* ${libdir}/python3.5/platform.* ${bindir}/python* ${libdir}/python3.5/_weakrefset.* ${libdir}/python3.5/sysconfig.* ${libdir}/python3.5/_sysconfigdata.* ${libdir}/python3.5/config/Makefile ${includedir}/python${PYTHON_BINABI}/pyconfig*.h ${libdir}/python${PYTHON_MAJMIN}/collections ${libdir}/python${PYTHON_MAJMIN}/_collections_abc.* ${libdir}/python${PYTHON_MAJMIN}/_sitebuiltins.* ${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py "
+
+SUMMARY_${PN}-crypt="Python basic cryptographic and hashing support"
+RDEPENDS_${PN}-crypt="${PN}-core"
+FILES_${PN}-crypt="${libdir}/python3.5/hashlib.* ${libdir}/python3.5/md5.* ${libdir}/python3.5/sha.* ${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 "
+
+SUMMARY_${PN}-ctypes="Python C types support"
+RDEPENDS_${PN}-ctypes="${PN}-core"
+FILES_${PN}-ctypes="${libdir}/python3.5/ctypes ${libdir}/python3.5/lib-dynload/_ctypes.*.so ${libdir}/python3.5/lib-dynload/_ctypes_test.*.so "
+
+SUMMARY_${PN}-curses="Python curses support"
+RDEPENDS_${PN}-curses="${PN}-core"
+FILES_${PN}-curses="${libdir}/python3.5/curses ${libdir}/python3.5/lib-dynload/_curses.*.so ${libdir}/python3.5/lib-dynload/_curses_panel.*.so "
+
+SUMMARY_${PN}-datetime="Python calendar and time support"
+RDEPENDS_${PN}-datetime="${PN}-core ${PN}-codecs"
+FILES_${PN}-datetime="${libdir}/python3.5/_strptime.* ${libdir}/python3.5/calendar.* ${libdir}/python3.5/lib-dynload/datetime.*.so "
+
+SUMMARY_${PN}-db="Python file-based database support"
+RDEPENDS_${PN}-db="${PN}-core"
+FILES_${PN}-db="${libdir}/python3.5/anydbm.* ${libdir}/python3.5/dumbdbm.* ${libdir}/python3.5/whichdb.* ${libdir}/python3.5/dbm ${libdir}/python3.5/lib-dynload/_dbm.*.so "
+
+SUMMARY_${PN}-debugger="Python debugger"
+RDEPENDS_${PN}-debugger="${PN}-core ${PN}-io ${PN}-lang ${PN}-re ${PN}-stringold ${PN}-shell ${PN}-pprint ${PN}-importlib ${PN}-pkgutil"
+FILES_${PN}-debugger="${libdir}/python3.5/bdb.* ${libdir}/python3.5/pdb.* "
+
+SUMMARY_${PN}-dev="Python development package"
+RDEPENDS_${PN}-dev="${PN}-core"
+FILES_${PN}-dev="${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la ${libdir}/*.a ${libdir}/*.o ${libdir}/pkgconfig ${base_libdir}/*.a ${base_libdir}/*.o ${datadir}/aclocal ${datadir}/pkgconfig "
+
+SUMMARY_${PN}-difflib="Python helpers for computing deltas between objects"
+RDEPENDS_${PN}-difflib="${PN}-lang ${PN}-re"
+FILES_${PN}-difflib="${libdir}/python3.5/difflib.* "
+
+SUMMARY_${PN}-distutils="Python Distribution Utilities"
+RDEPENDS_${PN}-distutils="${PN}-core ${PN}-email"
+FILES_${PN}-distutils="${libdir}/python3.5/config ${libdir}/python3.5/distutils "
+
+SUMMARY_${PN}-distutils-staticdev="Python distribution utilities (static libraries)"
+RDEPENDS_${PN}-distutils-staticdev="${PN}-distutils"
+FILES_${PN}-distutils-staticdev="${libdir}/python3.5/config/lib*.a "
+
+SUMMARY_${PN}-doctest="Python framework for running examples in docstrings"
+RDEPENDS_${PN}-doctest="${PN}-core ${PN}-lang ${PN}-io ${PN}-re ${PN}-unittest ${PN}-debugger ${PN}-difflib"
+FILES_${PN}-doctest="${libdir}/python3.5/doctest.* "
+
+SUMMARY_${PN}-email="Python email support"
+RDEPENDS_${PN}-email="${PN}-core ${PN}-io ${PN}-re ${PN}-mime ${PN}-audio ${PN}-image ${PN}-netclient"
+FILES_${PN}-email="${libdir}/python3.5/imaplib.* ${libdir}/python3.5/email "
+
+SUMMARY_${PN}-fcntl="Python's fcntl interface"
+RDEPENDS_${PN}-fcntl="${PN}-core"
+FILES_${PN}-fcntl="${libdir}/python3.5/lib-dynload/fcntl.*.so "
+
+SUMMARY_${PN}-gdbm="Python GNU database support"
+RDEPENDS_${PN}-gdbm="${PN}-core"
+FILES_${PN}-gdbm="${libdir}/python3.5/lib-dynload/_gdbm.*.so "
+
+SUMMARY_${PN}-html="Python HTML processing support"
+RDEPENDS_${PN}-html="${PN}-core"
+FILES_${PN}-html="${libdir}/python3.5/formatter.* ${libdir}/python3.5/htmlentitydefs.* ${libdir}/python3.5/htmllib.* ${libdir}/python3.5/markupbase.* ${libdir}/python3.5/sgmllib.* ${libdir}/python3.5/HTMLParser.* "
+
+SUMMARY_${PN}-idle="Python Integrated Development Environment"
+RDEPENDS_${PN}-idle="${PN}-core ${PN}-tkinter"
+FILES_${PN}-idle="${bindir}/idle ${libdir}/python3.5/idlelib "
+
+SUMMARY_${PN}-image="Python graphical image handling"
+RDEPENDS_${PN}-image="${PN}-core"
+FILES_${PN}-image="${libdir}/python3.5/colorsys.* ${libdir}/python3.5/imghdr.* ${libdir}/python3.5/lib-dynload/imageop.*.so ${libdir}/python3.5/lib-dynload/rgbimg.*.so "
+
+SUMMARY_${PN}-importlib="Python import implementation library"
+RDEPENDS_${PN}-importlib="${PN}-core"
+FILES_${PN}-importlib="${libdir}/python3.5/importlib "
+
+SUMMARY_${PN}-io="Python low-level I/O"
+RDEPENDS_${PN}-io="${PN}-core ${PN}-math"
+FILES_${PN}-io="${libdir}/python3.5/lib-dynload/_socket.*.so ${libdir}/python3.5/lib-dynload/_io.*.so ${libdir}/python3.5/lib-dynload/_ssl.*.so ${libdir}/python3.5/lib-dynload/select.*.so ${libdir}/python3.5/lib-dynload/termios.*.so ${libdir}/python3.5/lib-dynload/cStringIO.*.so ${libdir}/python3.5/pipes.* ${libdir}/python3.5/socket.* ${libdir}/python3.5/ssl.* ${libdir}/python3.5/tempfile.* ${libdir}/python3.5/StringIO.* ${libdir}/python3.5/io.* ${libdir}/python3.5/_pyio.* "
+
+SUMMARY_${PN}-json="Python JSON support"
+RDEPENDS_${PN}-json="${PN}-core ${PN}-math ${PN}-re"
+FILES_${PN}-json="${libdir}/python3.5/json ${libdir}/python3.5/lib-dynload/_json.*.so "
+
+SUMMARY_${PN}-lang="Python low-level language support"
+RDEPENDS_${PN}-lang="${PN}-core"
+FILES_${PN}-lang="${libdir}/python3.5/lib-dynload/_bisect.*.so ${libdir}/python3.5/lib-dynload/_collections.*.so ${libdir}/python3.5/lib-dynload/_heapq.*.so ${libdir}/python3.5/lib-dynload/_weakref.*.so ${libdir}/python3.5/lib-dynload/_functools.*.so ${libdir}/python3.5/lib-dynload/array.*.so ${libdir}/python3.5/lib-dynload/itertools.*.so ${libdir}/python3.5/lib-dynload/operator.*.so ${libdir}/python3.5/lib-dynload/parser.*.so ${libdir}/python3.5/atexit.* ${libdir}/python3.5/bisect.* ${libdir}/python3.5/code.* ${libdir}/python3.5/codeop.* ${libdir}/python3.5/collections.* ${libdir}/python3.5/_collections_abc.* ${libdir}/python3.5/dis.* ${libdir}/python3.5/functools.* ${libdir}/python3.5/heapq.* ${libdir}/python3.5/inspect.* ${libdir}/python3.5/keyword.* ${libdir}/python3.5/opcode.* ${libdir}/python3.5/symbol.* ${libdir}/python3.5/repr.* ${libdir}/python3.5/token.* ${libdir}/python3.5/tokenize.* ${libdir}/python3.5/traceback.* ${libdir}/python3.5/weakref.* "
+
+SUMMARY_${PN}-logging="Python logging support"
+RDEPENDS_${PN}-logging="${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-stringold"
+FILES_${PN}-logging="${libdir}/python3.5/logging "
+
+SUMMARY_${PN}-mailbox="Python mailbox format support"
+RDEPENDS_${PN}-mailbox="${PN}-core ${PN}-mime"
+FILES_${PN}-mailbox="${libdir}/python3.5/mailbox.* "
+
+SUMMARY_${PN}-math="Python math support"
+RDEPENDS_${PN}-math="${PN}-core"
+FILES_${PN}-math="${libdir}/python3.5/lib-dynload/cmath.*.so ${libdir}/python3.5/lib-dynload/math.*.so ${libdir}/python3.5/lib-dynload/_random.*.so ${libdir}/python3.5/random.* ${libdir}/python3.5/sets.* "
+
+SUMMARY_${PN}-mime="Python MIME handling APIs"
+RDEPENDS_${PN}-mime="${PN}-core ${PN}-io"
+FILES_${PN}-mime="${libdir}/python3.5/mimetools.* ${libdir}/python3.5/uu.* ${libdir}/python3.5/quopri.* ${libdir}/python3.5/rfc822.* ${libdir}/python3.5/MimeWriter.* "
+
+SUMMARY_${PN}-mmap="Python memory-mapped file support"
+RDEPENDS_${PN}-mmap="${PN}-core ${PN}-io"
+FILES_${PN}-mmap="${libdir}/python3.5/lib-dynload/mmap.*.so "
+
+SUMMARY_${PN}-multiprocessing="Python multiprocessing support"
+RDEPENDS_${PN}-multiprocessing="${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-threading ${PN}-ctypes ${PN}-mmap"
+FILES_${PN}-multiprocessing="${libdir}/python3.5/lib-dynload/_multiprocessing.*.so ${libdir}/python3.5/multiprocessing "
+
+SUMMARY_${PN}-netclient="Python Internet Protocol clients"
+RDEPENDS_${PN}-netclient="${PN}-core ${PN}-crypt ${PN}-datetime ${PN}-io ${PN}-lang ${PN}-logging ${PN}-mime"
+FILES_${PN}-netclient="${libdir}/python3.5/*Cookie*.* ${libdir}/python3.5/base64.* ${libdir}/python3.5/cookielib.* ${libdir}/python3.5/ftplib.* ${libdir}/python3.5/gopherlib.* ${libdir}/python3.5/hmac.* ${libdir}/python3.5/httplib.* ${libdir}/python3.5/mimetypes.* ${libdir}/python3.5/nntplib.* ${libdir}/python3.5/poplib.* ${libdir}/python3.5/smtplib.* ${libdir}/python3.5/telnetlib.* ${libdir}/python3.5/urllib ${libdir}/python3.5/uuid.* ${libdir}/python3.5/rfc822.* ${libdir}/python3.5/mimetools.* "
+
+SUMMARY_${PN}-netserver="Python Internet Protocol servers"
+RDEPENDS_${PN}-netserver="${PN}-core ${PN}-netclient ${PN}-shell ${PN}-threading"
+FILES_${PN}-netserver="${libdir}/python3.5/cgi.* ${libdir}/python3.5/*HTTPServer.* ${libdir}/python3.5/SocketServer.* "
+
+SUMMARY_${PN}-numbers="Python number APIs"
+RDEPENDS_${PN}-numbers="${PN}-core ${PN}-lang ${PN}-re"
+FILES_${PN}-numbers="${libdir}/python3.5/decimal.* ${libdir}/python3.5/fractions.* ${libdir}/python3.5/numbers.* "
+
+SUMMARY_${PN}-pickle="Python serialisation/persistence support"
+RDEPENDS_${PN}-pickle="${PN}-core ${PN}-codecs ${PN}-io ${PN}-re"
+FILES_${PN}-pickle="${libdir}/python3.5/pickle.* ${libdir}/python3.5/shelve.* ${libdir}/python3.5/lib-dynload/cPickle.*.so ${libdir}/python3.5/pickletools.* "
+
+SUMMARY_${PN}-pkgutil="Python package extension utility support"
+RDEPENDS_${PN}-pkgutil="${PN}-core"
+FILES_${PN}-pkgutil="${libdir}/python3.5/pkgutil.* "
+
+SUMMARY_${PN}-pprint="Python pretty-print support"
+RDEPENDS_${PN}-pprint="${PN}-core ${PN}-io"
+FILES_${PN}-pprint="${libdir}/python3.5/pprint.* "
+
+SUMMARY_${PN}-profile="Python basic performance profiling support"
+RDEPENDS_${PN}-profile="${PN}-core ${PN}-textutils"
+FILES_${PN}-profile="${libdir}/python3.5/profile.* ${libdir}/python3.5/pstats.* ${libdir}/python3.5/cProfile.* ${libdir}/python3.5/lib-dynload/_lsprof.*.so "
+
+SUMMARY_${PN}-pydoc="Python interactive help support"
+RDEPENDS_${PN}-pydoc="${PN}-core ${PN}-lang ${PN}-stringold ${PN}-re"
+FILES_${PN}-pydoc="${bindir}/pydoc ${libdir}/python3.5/pydoc.* ${libdir}/python3.5/pydoc_data "
+
+SUMMARY_${PN}-re="Python Regular Expression APIs"
+RDEPENDS_${PN}-re="${PN}-core"
+FILES_${PN}-re="${libdir}/python3.5/re.* ${libdir}/python3.5/sre.* ${libdir}/python3.5/sre_compile.* ${libdir}/python3.5/sre_constants* ${libdir}/python3.5/sre_parse.* "
+
+SUMMARY_${PN}-readline="Python readline support"
+RDEPENDS_${PN}-readline="${PN}-core"
+FILES_${PN}-readline="${libdir}/python3.5/lib-dynload/readline.*.so ${libdir}/python3.5/rlcompleter.* "
+
+SUMMARY_${PN}-reprlib="Python alternate repr() implementation"
+RDEPENDS_${PN}-reprlib="${PN}-core"
+FILES_${PN}-reprlib="${libdir}/python3.5/reprlib.py "
+
+SUMMARY_${PN}-resource="Python resource control interface"
+RDEPENDS_${PN}-resource="${PN}-core"
+FILES_${PN}-resource="${libdir}/python3.5/lib-dynload/resource.*.so "
+
+SUMMARY_${PN}-shell="Python shell-like functionality"
+RDEPENDS_${PN}-shell="${PN}-core ${PN}-re"
+FILES_${PN}-shell="${libdir}/python3.5/cmd.* ${libdir}/python3.5/commands.* ${libdir}/python3.5/dircache.* ${libdir}/python3.5/fnmatch.* ${libdir}/python3.5/glob.* ${libdir}/python3.5/popen2.* ${libdir}/python3.5/shlex.* ${libdir}/python3.5/shutil.* "
+
+SUMMARY_${PN}-smtpd="Python Simple Mail Transport Daemon"
+RDEPENDS_${PN}-smtpd="${PN}-core ${PN}-netserver ${PN}-email ${PN}-mime"
+FILES_${PN}-smtpd="${bindir}/smtpd.* ${libdir}/python3.5/smtpd.* "
+
+SUMMARY_${PN}-sqlite3="Python Sqlite3 database support"
+RDEPENDS_${PN}-sqlite3="${PN}-core ${PN}-datetime ${PN}-lang ${PN}-crypt ${PN}-io ${PN}-threading"
+FILES_${PN}-sqlite3="${libdir}/python3.5/lib-dynload/_sqlite3.*.so ${libdir}/python3.5/sqlite3/dbapi2.* ${libdir}/python3.5/sqlite3/__init__.* ${libdir}/python3.5/sqlite3/dump.* "
+
+SUMMARY_${PN}-sqlite3-tests="Python Sqlite3 database support tests"
+RDEPENDS_${PN}-sqlite3-tests="${PN}-core ${PN}-sqlite3"
+FILES_${PN}-sqlite3-tests="${libdir}/python3.5/sqlite3/test "
+
+SUMMARY_${PN}-stringold="Python string APIs [deprecated]"
+RDEPENDS_${PN}-stringold="${PN}-core ${PN}-re"
+FILES_${PN}-stringold="${libdir}/python3.5/lib-dynload/strop.*.so ${libdir}/python3.5/string.* ${libdir}/python3.5/stringold.* "
+
+SUMMARY_${PN}-subprocess="Python subprocess support"
+RDEPENDS_${PN}-subprocess="${PN}-core ${PN}-io ${PN}-re ${PN}-fcntl ${PN}-pickle"
+FILES_${PN}-subprocess="${libdir}/python3.5/subprocess.* "
+
+SUMMARY_${PN}-syslog="Python syslog interface"
+RDEPENDS_${PN}-syslog="${PN}-core"
+FILES_${PN}-syslog="${libdir}/python3.5/lib-dynload/syslog.*.so "
+
+SUMMARY_${PN}-terminal="Python terminal controlling support"
+RDEPENDS_${PN}-terminal="${PN}-core ${PN}-io"
+FILES_${PN}-terminal="${libdir}/python3.5/pty.* ${libdir}/python3.5/tty.* "
+
+SUMMARY_${PN}-tests="Python tests"
+RDEPENDS_${PN}-tests="${PN}-core"
+FILES_${PN}-tests="${libdir}/python3.5/test "
+
+SUMMARY_${PN}-textutils="Python option parsing, text wrapping and CSV support"
+RDEPENDS_${PN}-textutils="${PN}-core ${PN}-io ${PN}-re ${PN}-stringold"
+FILES_${PN}-textutils="${libdir}/python3.5/lib-dynload/_csv.*.so ${libdir}/python3.5/csv.* ${libdir}/python3.5/optparse.* ${libdir}/python3.5/textwrap.* "
+
+SUMMARY_${PN}-threading="Python threading & synchronization support"
+RDEPENDS_${PN}-threading="${PN}-core ${PN}-lang"
+FILES_${PN}-threading="${libdir}/python3.5/_threading_local.* ${libdir}/python3.5/dummy_thread.* ${libdir}/python3.5/dummy_threading.* ${libdir}/python3.5/mutex.* ${libdir}/python3.5/threading.* ${libdir}/python3.5/Queue.* "
+
+SUMMARY_${PN}-tkinter="Python Tcl/Tk bindings"
+RDEPENDS_${PN}-tkinter="${PN}-core"
+FILES_${PN}-tkinter="${libdir}/python3.5/lib-dynload/_tkinter.*.so ${libdir}/python3.5/lib-tk ${libdir}/python3.5/tkinter "
+
+SUMMARY_${PN}-unittest="Python unit testing framework"
+RDEPENDS_${PN}-unittest="${PN}-core ${PN}-stringold ${PN}-lang ${PN}-io ${PN}-difflib ${PN}-pprint ${PN}-shell"
+FILES_${PN}-unittest="${libdir}/python3.5/unittest/ "
+
+SUMMARY_${PN}-unixadmin="Python Unix administration support"
+RDEPENDS_${PN}-unixadmin="${PN}-core"
+FILES_${PN}-unixadmin="${libdir}/python3.5/lib-dynload/nis.*.so ${libdir}/python3.5/lib-dynload/grp.*.so ${libdir}/python3.5/lib-dynload/pwd.*.so ${libdir}/python3.5/getpass.* "
+
+SUMMARY_${PN}-xml="Python basic XML support"
+RDEPENDS_${PN}-xml="${PN}-core ${PN}-re"
+FILES_${PN}-xml="${libdir}/python3.5/lib-dynload/_elementtree.*.so ${libdir}/python3.5/lib-dynload/pyexpat.*.so ${libdir}/python3.5/xml ${libdir}/python3.5/xmllib.* "
+
+SUMMARY_${PN}-xmlrpc="Python XML-RPC support"
+RDEPENDS_${PN}-xmlrpc="${PN}-core ${PN}-xml ${PN}-netserver ${PN}-lang"
+FILES_${PN}-xmlrpc="${libdir}/python3.5/xmlrpclib.* ${libdir}/python3.5/SimpleXMLRPCServer.* ${libdir}/python3.5/DocXMLRPCServer.* ${libdir}/python3.5/xmlrpc "
+
+SUMMARY_${PN}-modules="All Python modules"
+RDEPENDS_${PN}-modules="${PN}-2to3 ${PN}-asyncio ${PN}-audio ${PN}-codecs ${PN}-compile ${PN}-compression ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-difflib ${PN}-distutils ${PN}-doctest ${PN}-email ${PN}-fcntl ${PN}-gdbm ${PN}-html ${PN}-idle ${PN}-image ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-reprlib ${PN}-resource ${PN}-shell ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils ${PN}-threading ${PN}-tkinter ${PN}-unittest ${PN}-unixadmin ${PN}-xml ${PN}-xmlrpc "
+ALLOW_EMPTY_${PN}-modules = "1"
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-async_0.6.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-async_0.6.2.bb
new file mode 100644
index 000000000..ad0a61776
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-async_0.6.2.bb
@@ -0,0 +1,19 @@
+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"
+
+SRC_URI = "http://pypi.python.org/packages/source/a/async/async-${PV}.tar.gz"
+SRC_URI[md5sum] = "9b06b5997de2154f3bc0273f80bcef6b"
+SRC_URI[sha256sum] = "ac6894d876e45878faae493b0cf61d0e28ec417334448ac0a6ea2229d8343051"
+
+UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/async/"
+
+S = "${WORKDIR}/async-${PV}"
+
+inherit setuptools
+
+RDEPENDS_${PN} += "python-threading python-lang"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-dbus_1.2.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-dbus_1.2.0.bb
new file mode 100644
index 000000000..b314dce1c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-dbus_1.2.0.bb
@@ -0,0 +1,29 @@
+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=0b83047ce9e948b67c0facc5f233476a"
+DEPENDS = "expat dbus dbus-glib virtual/libintl python-pyrex-native"
+
+SRC_URI = "http://dbus.freedesktop.org/releases/dbus-python/dbus-python-${PV}.tar.gz \
+"
+
+SRC_URI[md5sum] = "b09cd2d1a057cc432ce944de3fc06bf7"
+SRC_URI[sha256sum] = "e12c6c8b2bf3a9302f75166952cbe41d6b38c3441bbc6767dbd498942316c6df"
+S = "${WORKDIR}/dbus-python-${PV}"
+
+inherit distutils-base autotools pkgconfig
+
+PACKAGECONFIG ?= ""
+PACKAGECONFIG[docs] = "--enable-html-docs,--disable-html-docs,python-docutils-native"
+PACKAGECONFIG[api-docs] = "--enable-api-docs,--disable-api-docs,python-docutils-native python-epydoc-native"
+
+export BUILD_SYS
+export HOST_SYS
+
+export STAGING_LIBDIR
+export STAGING_INCDIR
+
+RDEPENDS_${PN} = "python-io python-logging python-stringold python-threading python-xml"
+
+FILES_${PN}-dev += "${libdir}/pkgconfig"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-docutils_0.12.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-docutils_0.12.bb
new file mode 100644
index 000000000..8cda88d27
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-docutils_0.12.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=a722fbdc20347db7b69223594dd54574"
+
+DEPENDS = "python"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/docutils/docutils-${PV}.tar.gz"
+SRC_URI[md5sum] = "4622263b62c5c771c03502afa3157768"
+SRC_URI[sha256sum] = "c7db717810ab6965f66c8cf0398a98c9d8df982da39b4cd7f162911eb89596fa"
+
+S = "${WORKDIR}/docutils-${PV}"
+
+inherit distutils
+
+BBCLASSEXTEND = "native"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-git_1.0.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-git_1.0.2.bb
new file mode 100644
index 000000000..f00f805a8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-git_1.0.2.bb
@@ -0,0 +1,26 @@
+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"
+DEPENDS = "python-gitdb"
+
+SRC_URI = "http://pypi.python.org/packages/source/G/GitPython/GitPython-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "d92d96a8da0fc77cf141d3e16084e094"
+SRC_URI[sha256sum] = "85de72556781480a38897a77de5b458ae3838b0fd589593679a1b5f34d181d84"
+
+UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/GitPython/"
+UPSTREAM_CHECK_REGEX = "/GitPython/(?P<pver>(\d+[\.\-_]*)+)"
+
+S = "${WORKDIR}/GitPython-${PV}"
+
+inherit setuptools
+
+RDEPENDS_${PN} += "python-gitdb python-lang python-io python-shell python-math python-re python-subprocess python-stringold python-unixadmin"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-gitdb_0.6.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-gitdb_0.6.4.bb
new file mode 100644
index 000000000..c82df1ef7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-gitdb_0.6.4.bb
@@ -0,0 +1,21 @@
+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"
+DEPENDS = "python-async python-smmap"
+
+SRC_URI = "https://pypi.python.org/packages/source/g/gitdb/gitdb-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "44e4366b8bdfd306b075c3a52c96ae1a"
+SRC_URI[sha256sum] = "a3ebbc27be035a2e874ed904df516e35f4a29a778a764385de09de9e0f139658"
+
+UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/gitdb/"
+
+S = "${WORKDIR}/gitdb-${PV}"
+
+inherit distutils
+
+RDEPENDS_${PN} += "python-smmap python-async python-mmap python-lang python-zlib python-io python-shell"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging/0001-python-imaging-setup.py-force-paths-for-zlib-freetyp.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging/0001-python-imaging-setup.py-force-paths-for-zlib-freetyp.patch
new file mode 100644
index 000000000..2575306be
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging/0001-python-imaging-setup.py-force-paths-for-zlib-freetyp.patch
@@ -0,0 +1,55 @@
+From 07d4f095a9e22ae676a8d68073101131e65012dc Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Tue, 15 Nov 2011 13:16:54 +0100
+Subject: [PATCH] python imaging setup.py: force paths for zlib, freetype and jpeg and don't add host paths
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ setup.py | 14 +++-----------
+ 1 files changed, 3 insertions(+), 11 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 5d4d53a..b1a22ec 100644
+--- a/setup.py
++++ b/setup.py
+@@ -34,10 +34,10 @@ def libinclude(root):
+ # TIFF_ROOT = libinclude("/opt/tiff")
+
+ TCL_ROOT = None
+-JPEG_ROOT = None
+-ZLIB_ROOT = None
++JPEG_ROOT = os.environ['STAGING_LIBDIR']
++ZLIB_ROOT = os.environ['STAGING_LIBDIR']
+ TIFF_ROOT = None
+-FREETYPE_ROOT = None
++FREETYPE_ROOT = os.environ['STAGING_LIBDIR'], os.environ['STAGING_INCDIR']
+ LCMS_ROOT = None
+
+ # FIXME: add mechanism to explicitly *disable* the use of a library
+@@ -147,7 +147,6 @@ class pil_build_ext(build_ext):
+ add_directory(library_dirs, "/opt/local/lib")
+ add_directory(include_dirs, "/opt/local/include")
+
+- add_directory(library_dirs, "/usr/local/lib")
+ # FIXME: check /opt/stuff directories here?
+
+ prefix = sysconfig.get_config_var("prefix")
+@@ -207,13 +206,6 @@ class pil_build_ext(build_ext):
+ if os.path.isfile(os.path.join(tcl_dir, "tk.h")):
+ add_directory(include_dirs, tcl_dir)
+
+- # standard locations
+- add_directory(library_dirs, "/usr/local/lib")
+- add_directory(include_dirs, "/usr/local/include")
+-
+- add_directory(library_dirs, "/usr/lib")
+- add_directory(include_dirs, "/usr/include")
+-
+ #
+ # insert new dirs *before* default libs, to avoid conflicts
+ # between Python PYD stub libs and real libraries
+--
+1.7.2.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging/allow.to.disable.some.features.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging/allow.to.disable.some.features.patch
new file mode 100644
index 000000000..4960ed466
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging/allow.to.disable.some.features.patch
@@ -0,0 +1,65 @@
+At least lcms wasn't deterministicly detected from sysroot.
+
+This will allow to export LCMS_ENABLED=False when lcms isn't in PACKAGECONFIG.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+diff -uNr Imaging-1.1.7.orig/setup.py Imaging-1.1.7/setup.py
+--- Imaging-1.1.7.orig/setup.py 2013-07-22 10:17:02.081457075 +0200
++++ Imaging-1.1.7/setup.py 2013-07-22 13:10:09.029707492 +0200
+@@ -39,6 +39,12 @@
+ TIFF_ROOT = None
+ FREETYPE_ROOT = os.environ['STAGING_LIBDIR'], os.environ['STAGING_INCDIR']
+ LCMS_ROOT = None
++TCL_ENABLED = os.getenv('TCL_ENABLED', "True")
++JPEG_ENABLED = os.getenv('JPEG_ENABLED', "True")
++ZLIB_ENABLED = os.getenv('ZLIB_ENABLED', "True")
++TIFF_ENABLED = os.getenv('TIFF_ENABLED', "True")
++FREETYPE_ENABLED = os.getenv('FREETYPE_ENABLED', "True")
++LCMS_ENABLED = os.getenv('LCMS_ENABLED', "True")
+
+ # FIXME: add mechanism to explicitly *disable* the use of a library
+
+@@ -220,22 +226,22 @@
+ zlib = jpeg = tiff = freetype = tcl = tk = lcms = None
+ feature = feature()
+
+- if find_include_file(self, "zlib.h"):
++ if ZLIB_ENABLED == 'True' and find_include_file(self, "zlib.h"):
+ if find_library_file(self, "z"):
+ feature.zlib = "z"
+ elif sys.platform == "win32" and find_library_file(self, "zlib"):
+ feature.zlib = "zlib" # alternative name
+
+- if find_include_file(self, "jpeglib.h"):
++ if JPEG_ENABLED == 'True' and find_include_file(self, "jpeglib.h"):
+ if find_library_file(self, "jpeg"):
+ feature.jpeg = "jpeg"
+ elif sys.platform == "win32" and find_library_file(self, "libjpeg"):
+ feature.jpeg = "libjpeg" # alternative name
+
+- if find_library_file(self, "tiff"):
++ if TIFF_ENABLED == 'True' and find_library_file(self, "tiff"):
+ feature.tiff = "tiff"
+
+- if find_library_file(self, "freetype"):
++ if FREETYPE_ENABLED == 'True' and find_library_file(self, "freetype"):
+ # look for freetype2 include files
+ freetype_version = 0
+ for dir in self.compiler.include_dirs:
+@@ -256,11 +262,11 @@
+ if dir:
+ add_directory(self.compiler.include_dirs, dir, 0)
+
+- if find_include_file(self, "lcms.h"):
++ if LCMS_ENABLED == 'True' and find_include_file(self, "lcms.h"):
+ if find_library_file(self, "lcms"):
+ feature.lcms = "lcms"
+
+- if _tkinter and find_include_file(self, "tk.h"):
++ if TCL_ENABLED == 'True' and _tkinter and find_include_file(self, "tk.h"):
+ # the library names may vary somewhat (e.g. tcl84 or tcl8.4)
+ version = TCL_VERSION[0] + TCL_VERSION[2]
+ if find_library_file(self, "tcl" + version):
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging/fix-freetype-includes.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging/fix-freetype-includes.patch
new file mode 100644
index 000000000..9ecc63a0d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging/fix-freetype-includes.patch
@@ -0,0 +1,30 @@
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From c6040f618d8f2706a7b46d1cdf37d1a587f9701f Mon Sep 17 00:00:00 2001
+From: Andrew Stromnov <stromnov@gmail.com>
+Date: Thu, 28 Nov 2013 16:58:43 +0400
+Subject: [PATCH] fix compiling with FreeType 2.5.1
+
+---
+ _imagingft.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/_imagingft.c b/_imagingft.c
+index 47d50bd..f19555b 100644
+--- a/_imagingft.c
++++ b/_imagingft.c
+@@ -59,7 +59,11 @@ struct {
+ const char* message;
+ } ft_errors[] =
+
++#if defined(USE_FREETYPE_2_1)
++#include FT_ERRORS_H
++#else
+ #include <freetype/fterrors.h>
++#endif
+
+ /* -------------------------------------------------------------------- */
+ /* font objects */
+--
+1.8.5.1
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging_1.1.7.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging_1.1.7.bb
new file mode 100644
index 000000000..a67832827
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging_1.1.7.bb
@@ -0,0 +1,45 @@
+SUMMARY = "Python Imaging Library (PIL)"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://README;beginline=92;endline=120;md5=c4371af4579f1e489cf881c1443dd4ec"
+DEPENDS = "freetype jpeg tiff"
+SRCNAME = "Imaging"
+PR = "r5"
+
+SRC_URI = "http://effbot.org/downloads/Imaging-${PV}.tar.gz \
+ file://0001-python-imaging-setup.py-force-paths-for-zlib-freetyp.patch \
+ file://allow.to.disable.some.features.patch \
+ file://fix-freetype-includes.patch"
+
+SRC_URI[md5sum] = "fc14a54e1ce02a0225be8854bfba478e"
+SRC_URI[sha256sum] = "895bc7c2498c8e1f9b99938f1a40dc86b3f149741f105cf7c7bd2e0725405211"
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+# There isn't enable/disable option, and lcms is in meta-oe, at least make it explicit when enabled
+# setup.py already has FIXME: add mechanism to explicitly *disable* the use of a library
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[lcms] = ",,lcms"
+
+inherit distutils
+
+do_compile() {
+ export STAGING_LIBDIR=${STAGING_LIBDIR}
+ export STAGING_INCDIR=${STAGING_INCDIR}
+ export LCMS_ENABLED=${@bb.utils.contains('PACKAGECONFIG', 'lcms', 'True', 'False', d)}
+ distutils_do_compile
+}
+
+do_install() {
+ export STAGING_LIBDIR=${STAGING_LIBDIR}
+ export STAGING_INCDIR=${STAGING_INCDIR}
+ export LCMS_ENABLED=${@bb.utils.contains('PACKAGECONFIG', 'lcms', 'True', 'False', d)}
+ distutils_do_install
+ install -d ${D}${datadir}/doc/${BPN}/html/
+ install -m 0644 ${S}/README ${D}${datadir}/doc/${BPN}/
+ install -m 0644 ${S}/Docs/* ${D}${datadir}/doc/${BPN}/html/
+
+ # get rid of #!/usr/local/bin/python
+ sed -i -e 's:/usr/local/bin/:${bindir}/env :g' ${D}${bindir}/*
+}
+
+RDEPENDS_${PN} += "python-lang python-stringold"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-mako_1.0.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-mako_1.0.3.bb
new file mode 100644
index 000000000..9efd700dc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-mako_1.0.3.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Templating library for Python"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=deb3ff8e4c17aaf7b80889b6b2bf4c83"
+
+SRC_URI = "https://pypi.python.org/packages/source/M/Mako/Mako-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "a78f20f6366a8a0659ce5532f8614e53"
+SRC_URI[sha256sum] = "7644bc0ee35965d2e146dde31827b8982ed70a58281085fac42869a09764d38c"
+
+UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/mako/"
+UPSTREAM_CHECK_REGEX = "/Mako/(?P<pver>(\d+[\.\-_]*)+)"
+
+S = "${WORKDIR}/Mako-${PV}"
+
+inherit setuptools
+
+RDEPENDS_${PN} = "python-threading \
+ python-netclient \
+ python-html \
+"
+RDEPENDS_${PN}_class-native = ""
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch
new file mode 100644
index 000000000..a39247ce7
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch
new file mode 100644
index 000000000..c92469b9b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch
new file mode 100644
index 000000000..f89aaff7b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch
@@ -0,0 +1,65 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+# 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>
+
+--- Python-2.6.6/Lib/distutils/sysconfig.py.orig 2012-01-03 14:02:03.027005296 +0000
++++ Python-2.6.6/Lib/distutils/sysconfig.py 2012-01-03 14:02:31.517601081 +0000
+@@ -19,8 +19,8 @@
+ from distutils.errors import DistutilsPlatformError
+
+ # These are needed in a couple of spots, so just compute them once.
+-PREFIX = os.path.normpath(sys.prefix)
+-EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
++PREFIX = os.path.normpath(sys.prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
++EXEC_PREFIX = os.path.normpath(sys.exec_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
+
+ # Path to the base directory of the project. On Windows the binary may
+ # live in project/PCBuild9. If we're dealing with an x64 Windows build,
+@@ -70,7 +70,7 @@
+ 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 @@
+ 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:
+@@ -216,7 +220,7 @@
+ else:
+ # The name of the config.h file changed in 2.2
+ config_h = 'pyconfig.h'
+- return os.path.join(inc_dir, config_h)
++ return os.path.join(inc_dir, config_h).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
+
+
+ def get_makefile_filename():
+@@ -225,7 +229,7 @@
+ return os.path.join(os.path.dirname(os.path.realpath(sys.executable)),
+ "Makefile")
+ lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
+- return os.path.join(lib_dir, "config", "Makefile")
++ return os.path.join(lib_dir, "config", "Makefile").replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
+
+
+ def parse_config_h(fp, g=None):
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/avoid_parallel_make_races_on_pgen.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/avoid_parallel_make_races_on_pgen.patch
new file mode 100644
index 000000000..5279e7c3b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/avoid_parallel_make_races_on_pgen.patch
@@ -0,0 +1,27 @@
+Upstream-Status: Pending
+
+Avoids parallel make races linking errors when making Parser/PGEN
+
+- Implements Richard Purdie's idea
+
+Signed-Off-By: Richard Purdie <richard.purdie@linuxfoundation.org>
+Signed-Off-By: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+Index: Python-2.7.9/Makefile.pre.in
+===================================================================
+--- Python-2.7.9.orig/Makefile.pre.in
++++ Python-2.7.9/Makefile.pre.in
+@@ -610,12 +610,10 @@ Modules/grpmodule.o: $(srcdir)/Modules/g
+
+ Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c $(srcdir)/Modules/posixmodule.h
+
+-$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS)
++$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS) $(PGEN)
+ @$(MKDIR_P) Include
+- $(MAKE) $(PGEN)
+ $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
+ $(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS)
+- $(MAKE) $(GRAMMAR_H)
+ touch $(GRAMMAR_C)
+
+ $(PGEN): $(PGENOBJS)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/debug.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/debug.patch
new file mode 100644
index 000000000..5ec10d6b2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/debug.patch
@@ -0,0 +1,29 @@
+Upstream-Status: Pending
+
+Index: Python-2.6.1/Lib/distutils/unixccompiler.py
+===================================================================
+--- Python-2.6.1.orig/Lib/distutils/unixccompiler.py 2009-11-13 16:04:54.000000000 +0000
++++ Python-2.6.1/Lib/distutils/unixccompiler.py 2009-11-13 16:06:27.000000000 +0000
+@@ -300,6 +300,8 @@
+ dylib_f = self.library_filename(lib, lib_type='dylib')
+ static_f = self.library_filename(lib, lib_type='static')
+
++ 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)
+@@ -309,10 +311,13 @@
+ # 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(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/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/multilib.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/multilib.patch
new file mode 100644
index 000000000..8ca89e7c5
--- /dev/null
+++ b/import-layers/yocto-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.9/Include/pythonrun.h
+===================================================================
+--- Python-2.7.9.orig/Include/pythonrun.h
++++ Python-2.7.9/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.9/Lib/distutils/command/install.py
+===================================================================
+--- Python-2.7.9.orig/Lib/distutils/command/install.py
++++ Python-2.7.9/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.9/Lib/pydoc.py
+===================================================================
+--- Python-2.7.9.orig/Lib/pydoc.py
++++ Python-2.7.9/Lib/pydoc.py
+@@ -383,7 +383,7 @@ class Doc:
+
+ docloc = os.environ.get("PYTHONDOCS",
+ "http://docs.python.org/library")
+- basedir = os.path.join(sys.exec_prefix, "lib",
++ basedir = os.path.join(sys.exec_prefix, sys.lib,
+ "python"+sys.version[0:3])
+ if (isinstance(object, type(os)) and
+ (object.__name__ in ('errno', 'exceptions', 'gc', 'imp',
+Index: Python-2.7.9/Lib/site.py
+===================================================================
+--- Python-2.7.9.orig/Lib/site.py
++++ Python-2.7.9/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"))
+ if sys.platform == "darwin":
+ # for framework builds *only* we add the standard Apple
+ # locations.
+Index: Python-2.7.9/Lib/test/test_dl.py
+===================================================================
+--- Python-2.7.9.orig/Lib/test/test_dl.py
++++ Python-2.7.9/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.9/Lib/trace.py
+===================================================================
+--- Python-2.7.9.orig/Lib/trace.py
++++ Python-2.7.9/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.9/Makefile.pre.in
+===================================================================
+--- Python-2.7.9.orig/Makefile.pre.in
++++ Python-2.7.9/Makefile.pre.in
+@@ -87,6 +87,7 @@ PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAG
+
+ # Machine-dependent subdirectories
+ MACHDEP= @MACHDEP@
++LIB= @LIB@
+
+ # Multiarch directory (may be empty)
+ MULTIARCH= @MULTIARCH@
+@@ -106,7 +107,7 @@ LIBDIR= @libdir@
+ MANDIR= @mandir@
+ INCLUDEDIR= @includedir@
+ CONFINCLUDEDIR= $(exec_prefix)/include
+-SCRIPTDIR= $(prefix)/lib
++SCRIPTDIR= $(prefix)/@LIB@
+
+ # Detailed destination directories
+ BINLIBDEST= $(LIBDIR)/python$(VERSION)
+@@ -597,6 +598,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
+@@ -639,7 +641,7 @@ $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES)
+ Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(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.9/Modules/getpath.c
+===================================================================
+--- Python-2.7.9.orig/Modules/getpath.c
++++ Python-2.7.9/Modules/getpath.c
+@@ -116,9 +116,11 @@
+ #define EXEC_PREFIX PREFIX
+ #endif
+
++#define LIB_PYTHON LIB "/python" VERSION
++
+ #ifndef PYTHONPATH
+-#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
+- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
++#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
++ EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
+ #endif
+
+ #ifndef LANDMARK
+@@ -129,7 +131,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.9/Python/getplatform.c
+===================================================================
+--- Python-2.7.9.orig/Python/getplatform.c
++++ Python-2.7.9/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.9/Python/sysmodule.c
+===================================================================
+--- Python-2.7.9.orig/Python/sysmodule.c
++++ Python-2.7.9/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.9/configure.ac
+===================================================================
+--- Python-2.7.9.orig/configure.ac
++++ Python-2.7.9/configure.ac
+@@ -736,6 +736,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/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/nohostlibs.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/nohostlibs.patch
new file mode 100644
index 000000000..8a452e94d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/revert_use_of_sysconfigdata.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/revert_use_of_sysconfigdata.patch
new file mode 100644
index 000000000..202aaf106
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/unixccompiler.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/unixccompiler.patch
new file mode 100644
index 000000000..450282912
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python-native_2.7.11.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native_2.7.11.bb
new file mode 100644
index 000000000..4c204a4f0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native_2.7.11.bb
@@ -0,0 +1,63 @@
+require python.inc
+
+EXTRANATIVEPATH += "bzip2-native"
+DEPENDS = "openssl-native bzip2-replacement-native zlib-native readline-native sqlite3-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://12-distutils-prefix-is-inside-staging-area.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://avoid_parallel_make_races_on_pgen.patch \
+ "
+S = "${WORKDIR}/Python-${PV}"
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/${PN}:"
+
+inherit native
+
+RPROVIDES += "python-distutils-native python-compression-native python-textutils-native python-codecs-native python-core-native python-unittest-native"
+
+EXTRA_OECONF_append = " --bindir=${bindir}/${PN}"
+
+EXTRA_OEMAKE = '\
+ BUILD_SYS="" \
+ HOST_SYS="" \
+ 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
+}
+
+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
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-nose_1.3.7.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-nose_1.3.7.bb
new file mode 100644
index 000000000..ec6158fab
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-nose_1.3.7.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Extends Python unittest to make testing easier"
+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 = "http://pypi.python.org/packages/source/n/nose/nose-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "4d3ad0ff07b61373d2cefc89c5d0b20b"
+SRC_URI[sha256sum] = "f1bffef9cbc82628f6e7d7b40d7e255aefaa1adb6a1b1d26c69a8b79e6208a98"
+
+UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/nose/"
+UPSTREAM_CHECK_REGEX = "/nose/(?P<pver>(\d+[\.\-_]*)+)"
+
+S = "${WORKDIR}/nose-${PV}"
+
+inherit setuptools
+
+RDEPENDS_${PN} = "\
+ python-unittest \
+ "
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch
new file mode 100644
index 000000000..5b134edf0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch
@@ -0,0 +1,78 @@
+From cc2ce6d8b6a3e6e2c8874896c10897034a80cd4f 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] 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 9dd48e2..80e197a 100644
+--- a/numpy/distutils/system_info.py
++++ b/numpy/distutils/system_info.py
+@@ -204,51 +204,13 @@ if sys.platform == 'win32':
+ default_x11_lib_dirs = []
+ default_x11_include_dirs = []
+ 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.6.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/aarch64/_numpyconfig.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/aarch64/_numpyconfig.h
new file mode 100644
index 000000000..191e5a19e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/aarch64/_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_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_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/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/aarch64/config.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/aarch64/config.h
new file mode 100644
index 000000000..c30b868f2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/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/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/add-glibc-check.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/add-glibc-check.patch
new file mode 100644
index 000000000..29768f34d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/add-glibc-check.patch
@@ -0,0 +1,36 @@
+Dont punish musl for glibc's trignometeric functions problems
+additionally ensure that glibc specific macros are not used
+unconditionally
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: numpy-1.10.4/numpy/core/src/private/npy_config.h
+===================================================================
+--- numpy-1.10.4.orig/numpy/core/src/private/npy_config.h
++++ numpy-1.10.4/numpy/core/src/private/npy_config.h
+@@ -75,10 +75,12 @@
+
+ #if defined(HAVE_FEATURES_H)
+ #include <features.h>
++#ifdef __GLIBC__
+ #define TRIG_OK __GLIBC_PREREQ(2, 16)
+ #else
+ #define TRIG_OK 0
+ #endif
++#endif
+
+ #if !TRIG_OK
+ #undef HAVE_CASIN
+Index: numpy-1.10.4/numpy/core/src/npymath/ieee754.c.src
+===================================================================
+--- numpy-1.10.4.orig/numpy/core/src/npymath/ieee754.c.src
++++ numpy-1.10.4/numpy/core/src/npymath/ieee754.c.src
+@@ -612,7 +612,7 @@ void npy_set_floatstatus_invalid(void)
+ }
+
+
+-#elif defined(__GLIBC__) || defined(__APPLE__) || \
++#elif defined(__linux__) || defined(__APPLE__) || \
+ defined(__CYGWIN__) || defined(__MINGW32__) || \
+ (defined(__FreeBSD__) && (__FreeBSD_version >= 502114))
+ # include <fenv.h>
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/arm/config.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/arm/config.h
new file mode 100644
index 000000000..17ef186d5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/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/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/arm/numpyconfig.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/arm/numpyconfig.h
new file mode 100644
index 000000000..c4bf6547f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/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/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/armeb/config.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/armeb/config.h
new file mode 100644
index 000000000..17ef186d5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/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/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/armeb/numpyconfig.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/armeb/numpyconfig.h
new file mode 100644
index 000000000..c4bf6547f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/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/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips/_numpyconfig.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips/_numpyconfig.h
new file mode 100644
index 000000000..05d2b8b94
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips/_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 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_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/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips/config.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips/config.h
new file mode 100644
index 000000000..2f6135adc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips/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/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips64/_numpyconfig.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips64/_numpyconfig.h
new file mode 100644
index 000000000..8e2b5d094
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips64/_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/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips64/config.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips64/config.h
new file mode 100644
index 000000000..c30b868f2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips64/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/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips64n32/_numpyconfig.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips64n32/_numpyconfig.h
new file mode 100644
index 000000000..8e2b5d094
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips64n32/_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/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips64n32/config.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips64n32/config.h
new file mode 100644
index 000000000..c30b868f2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips64n32/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/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mipsel/config.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mipsel/config.h
new file mode 100644
index 000000000..17ef186d5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mipsel/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/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mipsel/numpyconfig.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mipsel/numpyconfig.h
new file mode 100644
index 000000000..c4bf6547f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mipsel/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/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/powerpc/_numpyconfig.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/powerpc/_numpyconfig.h
new file mode 100644
index 000000000..0f45d5bd4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/powerpc/_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 4
+#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/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/powerpc/config.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/powerpc/config.h
new file mode 100644
index 000000000..f65d39d5d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/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/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/powerpc64/_numpyconfig.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/powerpc64/_numpyconfig.h
new file mode 100644
index 000000000..8e2b5d094
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/powerpc64/_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/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/powerpc64/config.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/powerpc64/config.h
new file mode 100644
index 000000000..c30b868f2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/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/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/remove-build-path-in-comments.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/remove-build-path-in-comments.patch
new file mode 100644
index 000000000..eb8a71a2e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/remove-build-path-in-comments.patch
@@ -0,0 +1,30 @@
+From c560abff71f98a39a7401f08c2c13dad9ae7f15f Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 25 Feb 2016 01:23:32 -0500
+Subject: [PATCH] remove build path in comments
+
+It has build path in comments, so remove it.
+
+Upstream-Status: Inappropriate [openembedded specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ numpy/distutils/misc_util.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/numpy/distutils/misc_util.py b/numpy/distutils/misc_util.py
+index 345e60f..dafb068 100644
+--- a/numpy/distutils/misc_util.py
++++ b/numpy/distutils/misc_util.py
+@@ -2254,7 +2254,7 @@ def generate_config_py(target):
+ from distutils.dir_util import mkpath
+ mkpath(os.path.dirname(target))
+ f = open(target, 'w')
+- f.write('# This file is generated by %s\n' % (os.path.abspath(sys.argv[0])))
++ f.write('# This file is generated by %s\n' % (os.path.abspath(sys.argv[0]).replace(os.path.abspath('../'),'')))
+ f.write('# It contains system_info results at the time of building this package.\n')
+ f.write('__all__ = ["get_info","show"]\n\n')
+ for k, i in system_info.saved_results.items():
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/x86-64/_numpyconfig.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/x86-64/_numpyconfig.h
new file mode 100644
index 000000000..b33036164
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/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/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/x86-64/config.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/x86-64/config.h
new file mode 100644
index 000000000..0ce63b7d2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/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/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/x86/config.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/x86/config.h
new file mode 100644
index 000000000..08e41e3d9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/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/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/x86/numpyconfig.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/x86/numpyconfig.h
new file mode 100644
index 000000000..ff7938cd9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/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/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy_1.10.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy_1.10.4.bb
new file mode 100644
index 000000000..8a562dcb9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy_1.10.4.bb
@@ -0,0 +1,102 @@
+SUMMARY = "A sophisticated Numeric Processing Package for Python"
+SECTION = "devel/python"
+LICENSE = "PSF"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=9f4e88b5748e8313caaf33d081ce65a3"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/numpy/numpy-${PV}.tar.gz \
+ file://0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch \
+ file://remove-build-path-in-comments.patch \
+ file://add-glibc-check.patch \
+ ${CONFIGFILESURI} "
+
+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_mipsel = " \
+ file://config.h \
+ file://numpyconfig.h \
+"
+CONFIGFILESURI_x86 = " \
+ file://config.h \
+ file://numpyconfig.h \
+"
+CONFIGFILESURI_x86-64 = " \
+ file://config.h \
+ file://_numpyconfig.h \
+"
+CONFIGFILESURI_mips = " \
+ file://config.h \
+ file://_numpyconfig.h \
+"
+CONFIGFILESURI_powerpc = " \
+ file://config.h \
+ file://_numpyconfig.h \
+"
+CONFIGFILESURI_powerpc64 = " \
+ file://config.h \
+ file://_numpyconfig.h \
+"
+CONFIGFILESURI_mips64 = " \
+ file://config.h \
+ file://_numpyconfig.h \
+"
+CONFIGFILESURI_mips64n32 = " \
+ file://config.h \
+ file://_numpyconfig.h \
+"
+
+S = "${WORKDIR}/numpy-${PV}"
+
+inherit distutils
+
+# Make the build fail and replace *config.h with proper one
+# This is a ugly, ugly hack - Koen
+do_compile_prepend_class-target() {
+ BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+ ${STAGING_BINDIR_NATIVE}/python-native/python 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"
+
+SRC_URI[md5sum] = "90bb9034652cefbada19cf7d141a6a61"
+SRC_URI[sha256sum] = "f7f91842056a7cf680b0eaf8cefc5e46c69e2521e651128d2e6aaaccec8652ae"
+
+# install what is needed for numpy.test()
+RDEPENDS_${PN} = "python-unittest \
+ python-difflib \
+ python-pprint \
+ python-pickle \
+ python-shell \
+ python-nose \
+ python-doctest \
+ python-datetime \
+ python-distutils \
+ python-misc \
+ python-mmap \
+ python-netclient \
+ python-numbers \
+ python-pydoc \
+ python-pkgutil \
+ python-email \
+ python-subprocess \
+ python-compression \
+ python-ctypes \
+ python-threading \
+"
+
+RDEPENDS_${PN}_class-native = ""
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-pexpect_4.0.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pexpect_4.0.1.bb
new file mode 100644
index 000000000..7f142a385
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pexpect_4.0.1.bb
@@ -0,0 +1,25 @@
+SUMMARY = "A Pure Python Expect like Module for Python"
+HOMEPAGE = "http://pexpect.readthedocs.org/"
+SECTION = "devel/python"
+LICENSE = "ISC"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=66c2378a96b307d56bfb3a9e58edafa8"
+
+SRC_URI = "https://pypi.python.org/packages/source/p/pexpect/pexpect-${PV}.tar.gz"
+SRC_URI[md5sum] = "056df81e6ca7081f1015b4b147b977b7"
+SRC_URI[sha256sum] = "232795ebcaaf2e120396dbbaa3a129eda51757eeaae1911558f4ef8ee414fc6c"
+
+UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/pexpect"
+
+S = "${WORKDIR}/pexpect-${PV}"
+
+inherit distutils
+
+RDEPENDS_${PN} = "\
+ python-core \
+ python-io \
+ python-terminal \
+ python-resource \
+ python-fcntl \
+"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-pycairo_1.10.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pycairo_1.10.0.bb
new file mode 100644
index 000000000..70fe25c1a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pycairo_1.10.0.bb
@@ -0,0 +1,41 @@
+SUMMARY = "Python bindings for the Cairo canvas library"
+HOMEPAGE = "http://cairographics.org/pycairo"
+BUGTRACKER = "http://bugs.freedesktop.org"
+SECTION = "python-devel"
+LICENSE = "LGPLv2.1 & MPL-1.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f2e071ab72978431b294a0d696327421 \
+ file://COPYING-LGPL-2.1;md5=fad9b3332be894bab9bc501572864b29 \
+ file://COPYING-MPL-1.1;md5=bfe1f75d606912a4111c90743d6c7325"
+
+# cairo >= 1.8.8
+DEPENDS = "cairo"
+PR = "r2"
+
+SRC_URI = "http://cairographics.org/releases/py2cairo-${PV}.tar.bz2"
+
+SRC_URI[md5sum] = "20337132c4ab06c1146ad384d55372c5"
+SRC_URI[sha256sum] = "d30439f06c2ec1a39e27464c6c828b6eface3b22ee17b2de05dc409e429a7431"
+
+S = "${WORKDIR}/py2cairo-${PV}"
+
+inherit distutils pkgconfig
+
+BBCLASSEXTEND = "native"
+
+do_configure() {
+ BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} ./waf configure --prefix=${D}${prefix} --libdir=${D}${libdir}
+}
+
+do_compile() {
+ ./waf build ${PARALLEL_MAKE}
+}
+
+do_install() {
+ ./waf install
+ sed \
+ -e 's:@prefix@:${prefix}:' \
+ -e 's:@VERSION@:${PV}:' \
+ -e 's:@includedir@:${includedir}:' \
+ pycairo.pc.in > pycairo.pc
+ install -m 0644 pycairo.pc ${D}${libdir}/pkgconfig/
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-pycurl/no-static-link.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pycurl/no-static-link.patch
new file mode 100644
index 000000000..212779ca3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pycurl/no-static-link.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Pending
+
+Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+diff -Naur pycurl-7.19.5.2-orig/setup.py pycurl-7.19.5.2/setup.py
+--- pycurl-7.19.5.2-orig/setup.py 2015-11-02 15:42:24.000000000 +0200
++++ pycurl-7.19.5.2/setup.py 2015-11-02 17:59:36.121527273 +0200
+@@ -154,7 +154,7 @@
+ optbuf = ''
+ sslhintbuf = ''
+ errtext = ''
+- for option in ["--libs", "--static-libs"]:
++ for option in ["--libs"]:
+ p = subprocess.Popen((CURL_CONFIG, option),
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ stdout, stderr = p.communicate()
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-pycurl_7.21.5.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pycurl_7.21.5.bb
new file mode 100644
index 000000000..7b41f6d33
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pycurl_7.21.5.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Python bindings for libcurl"
+HOMEPAGE = "http://pycurl.sourceforge.net/"
+SECTION = "devel/python"
+LICENSE = "LGPLv2.1+ | MIT"
+LIC_FILES_CHKSUM = "file://README.rst;beginline=166;endline=182;md5=a84a1caa65b89d4584b693d3680062fb \
+ file://COPYING-LGPL;md5=3579a9fd0221d49a237aaa33492f988c \
+ file://COPYING-MIT;md5=b7e434aeb228ed731c00bcf177e79b19"
+
+DEPENDS = "curl python"
+RDEPENDS_${PN} = "python-core curl"
+SRCNAME = "pycurl"
+
+SRC_URI = "\
+ http://${SRCNAME}.sourceforge.net/download/${SRCNAME}-${PV}.tar.gz;name=archive \
+ file://no-static-link.patch \
+"
+
+SRC_URI[archive.md5sum] = "bca7bf47320082588db544ced2ba8717"
+SRC_URI[archive.sha256sum] = "8a1e0eb55573388275a1d6c2534ca4cfca5d7fa772b99b505c08fa149b27aed0"
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit distutils
+
+BBCLASSEXTEND = "native"
+
+# Ensure the docstrings are generated as make clean will remove them
+do_compile_prepend() {
+ ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py docstrings
+}
+
+do_install_append() {
+ rm -rf ${D}${datadir}/share
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-pygobject/0001-configure.ac-add-sysroot-path-to-GI_DATADIR-don-t-se.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pygobject/0001-configure.ac-add-sysroot-path-to-GI_DATADIR-don-t-se.patch
new file mode 100644
index 000000000..a391f7e74
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pygobject/0001-configure.ac-add-sysroot-path-to-GI_DATADIR-don-t-se.patch
@@ -0,0 +1,41 @@
+From 5e5350d730f85957a42c6d846d347d080e7dd996 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 23 Oct 2015 12:40:34 +0300
+Subject: [PATCH] configure.ac: add sysroot path to GI_DATADIR; don't set
+ introspection scanner and compiler paths
+
+Upstream-Status: Pending [review on oe-core maillist]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ configure.ac | 8 +-------
+ 1 file changed, 1 insertion(+), 7 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 2c0cfbd..cfcb3bf 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -194,7 +194,7 @@ PKG_CHECK_MODULES(GI,
+ gobject-introspection-1.0 >= introspection_required_version
+ )
+
+-GI_DATADIR=$($PKG_CONFIG --variable=gidatadir gobject-introspection-1.0)
++GI_DATADIR=$PKG_CONFIG_SYSROOT_DIR$($PKG_CONFIG --variable=gidatadir gobject-introspection-1.0)
+ AC_SUBST(GI_DATADIR)
+
+ if test "$enable_cairo" != no; then
+@@ -219,12 +219,6 @@ AC_ARG_WITH(common,
+ with_common=yes)
+ AM_CONDITIONAL(WITH_COMMON, test "$with_common" = "yes")
+
+-INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
+-INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
+-
+-AC_SUBST(INTROSPECTION_SCANNER)
+-AC_SUBST(INTROSPECTION_COMPILER)
+-
+ # compiler warnings, errors, required cflags, and code coverage support
+ GNOME_COMPILE_WARNINGS([maximum])
+ AC_MSG_CHECKING(for Gnome code coverage support)
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-pygobject_3.18.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pygobject_3.18.2.bb
new file mode 100644
index 000000000..a9871fe26
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pygobject_3.18.2.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Python GObject bindings"
+SECTION = "devel/python"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a916467b91076e631dd8edb7424769c7"
+
+inherit autotools pkgconfig gnomebase distutils-base gobject-introspection
+
+DEPENDS += "python glib-2.0 gnome-common"
+
+SRCNAME="pygobject"
+SRC_URI = " \
+ http://ftp.gnome.org/pub/GNOME/sources/${SRCNAME}/${@gnome_verdir("${PV}")}/${SRCNAME}-${PV}.tar.xz \
+ file://0001-configure.ac-add-sysroot-path-to-GI_DATADIR-don-t-se.patch \
+"
+
+SRC_URI[md5sum] = "0a956f3e785e23b0f136832f2e57a862"
+SRC_URI[sha256sum] = "2a3cad1517916b74e131e6002c3824361aee0671ffb0d55ded119477fc1c2c5f"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+BBCLASSEXTEND = "native"
+
+EXTRA_OECONF = "--disable-cairo --with-python=python2.7"
+
+RDEPENDS_${PN} += "python-setuptools python-importlib"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-pyrex-native_0.9.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pyrex-native_0.9.9.bb
new file mode 100644
index 000000000..e8ef1aa12
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pyrex-native_0.9.9.bb
@@ -0,0 +1,5 @@
+require python-pyrex_${PV}.bb
+inherit native pythonnative
+DEPENDS = "python-native"
+RDEPENDS_${PN} = ""
+PR = "r3"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-pyrex/pyrex-fix-optimized-mode.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pyrex/pyrex-fix-optimized-mode.patch
new file mode 100644
index 000000000..c58c3280e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pyrex/pyrex-fix-optimized-mode.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Index: Pyrex-0.9.8.4/Pyrex/Distutils/extension.py
+===================================================================
+--- Pyrex-0.9.8.4.orig/Pyrex/Distutils/extension.py
++++ Pyrex-0.9.8.4/Pyrex/Distutils/extension.py
+@@ -15,7 +15,7 @@ except ImportError:
+ warnings = None
+
+ class Extension(_Extension.Extension):
+- _Extension.Extension.__doc__ + \
++ _Extension.Extension.__doc__ or "" + \
+ """pyrex_include_dirs : [string]
+ list of directories to search for Pyrex header files (.pxd) (in
+ Unix form for portability)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-pyrex_0.9.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pyrex_0.9.9.bb
new file mode 100644
index 000000000..c4dd2e69b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pyrex_0.9.9.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Language for writing Python extension modules"
+DESCRIPTION = "Pyrex is a language specially designed for writing Python extension modules. \
+It's designed to bridge the gap between the nice, high-level, easy-to-use world of Python \
+and the messy, low-level world of C."
+SECTION = "devel/python"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=771d472f53f933033f57eeee7808e5bd"
+SRCNAME = "Pyrex"
+PR = "r4"
+
+SRC_URI = "\
+ http://www.cosc.canterbury.ac.nz/greg.ewing/python/${SRCNAME}/${SRCNAME}-${PV}.tar.gz \
+ file://pyrex-fix-optimized-mode.patch \
+"
+
+SRC_URI[md5sum] = "515dee67d15d4393841e2d60e8341947"
+SRC_URI[sha256sum] = "5f87df06831d0b3412eb4bc9d3fc2ee7bfae1b913d7da8c23ab2bf5699fb6b50"
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit distutils
+
+FILES_${PN} += "${datadir}${base_libdir}/${PYTHON_DIR}/site-packages/Pyrex/Compiler/Lexicon.pickle"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-scons-native_2.4.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-scons-native_2.4.1.bb
new file mode 100644
index 000000000..dae89ab5d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-scons-native_2.4.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/import-layers/yocto-poky/meta/recipes-devtools/python/python-scons_2.4.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-scons_2.4.1.bb
new file mode 100644
index 000000000..096cf5c96
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-scons_2.4.1.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Software Construction tool (make/autotools replacement)"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=23bc1530c55e9f0d1b709056bcea237d"
+SRCNAME = "scons"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/scons/scons-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "9a0ddf33d9839f04380e0fae87cc4b40"
+SRC_URI[sha256sum] = "8fc4f42928c69bcbb33e1be94b646f2c700b659693fabc778c192d4d22f753a7"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/scons/files/scons/"
+UPSTREAM_CHECK_REGEX = "/scons/(?P<pver>(\d+[\.\-_]*)+)/"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit distutils
+
+RDEPENDS_${PN} = "\
+ python-fcntl \
+ python-io \
+ "
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-setuptools.inc b/import-layers/yocto-poky/meta/recipes-devtools/python/python-setuptools.inc
new file mode 100644
index 000000000..0917e88ab
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-setuptools.inc
@@ -0,0 +1,21 @@
+SUMMARY = "Download, build, install, upgrade, and uninstall Python packages"
+HOMEPAGE = "https://pypi.python.org/pypi/setuptools"
+SECTION = "devel/python"
+LICENSE = "PSF | ZPL-2.0"
+
+LIC_FILES_CHKSUM = "file://setup.py;beginline=78;endline=78;md5=8a314270dd7a8dbca741775415f1716e"
+
+SRCNAME = "setuptools"
+
+SRC_URI = "http://pypi.python.org/packages/source/s/${SRCNAME}/${SRCNAME}-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "c5a7d90c1e0acf8c4ec5c2bf31bc25b5"
+SRC_URI[sha256sum] = "214bf29933f47cf25e6faa569f710731728a07a19cae91ea64f826051f68a8cf"
+
+UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/setuptools"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+do_install_prepend() {
+ install -d ${D}/${libdir}/${PYTHON_DIR}/site-packages
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-setuptools_19.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-setuptools_19.4.bb
new file mode 100644
index 000000000..c17203923
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-setuptools_19.4.bb
@@ -0,0 +1,38 @@
+require python-setuptools.inc
+
+PROVIDES = "python-distribute"
+
+DEPENDS += "python"
+DEPENDS_class-native += "python-native"
+
+inherit distutils
+
+DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${libdir}/${PYTHON_DIR}/site-packages"
+
+RDEPENDS_${PN} = "\
+ python-stringold \
+ python-email \
+ python-shell \
+ python-distutils \
+ python-compression \
+ python-pkgutil \
+ python-plistlib \
+ python-numbers \
+ python-html \
+ python-netserver \
+ python-ctypes \
+ python-subprocess \
+ python-unittest \
+ python-compile \
+"
+
+RDEPENDS_${PN}_class-native = "\
+ python-distutils \
+ python-compression \
+"
+
+RREPLACES_${PN} = "python-distribute"
+RPROVIDES_${PN} = "python-distribute"
+RCONFLICTS_${PN} = "python-distribute"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-add-for-rpm-ignoresize-check.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-add-for-rpm-ignoresize-check.patch
new file mode 100644
index 000000000..fe98d070d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-add-for-rpm-ignoresize-check.patch
@@ -0,0 +1,35 @@
+python-smartpm: Add checking for "rpm-ignoresize" option
+
+The do_rootfs takes a very long time when build host has mounted many NFS
+devices. syscall lstat() was being called on every filesystem mounted on the
+build host during building.
+The reason for the lstat() is that rpm is verifying that enough free disk space
+is available to do the install. However, since the install is into the target
+rootfs it should not matter how much free space there is in the host mounts.
+Add checking for "rpm-ignoresize", by it, smart can make whether RPM skip
+checking for diskspace when install a rpm package.
+
+Upstream-Status: Pending
+
+Signed-off-by: wenlin.kang <wenlin.kang@windriver.com>
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ smart/backends/rpm/pm.py | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+Index: git/smart/backends/rpm/pm.py
+===================================================================
+--- git.orig/smart/backends/rpm/pm.py
++++ git/smart/backends/rpm/pm.py
+@@ -233,6 +233,11 @@ class RPMPackageManager(PackageManager):
+ if sysconf.get("rpm-order"):
+ ts.order()
+ probfilter = rpm.RPMPROB_FILTER_OLDPACKAGE
++
++ if sysconf.get("rpm-ignoresize", False):
++ probfilter |= rpm.RPMPROB_FILTER_DISKNODES
++ probfilter |= rpm.RPMPROB_FILTER_DISKSPACE
++
+ if force or reinstall:
+ probfilter |= rpm.RPMPROB_FILTER_REPLACEPKG
+ probfilter |= rpm.RPMPROB_FILTER_REPLACEOLDFILES
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-already-installed-message.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-already-installed-message.patch
new file mode 100644
index 000000000..9055555cd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-already-installed-message.patch
@@ -0,0 +1,54 @@
+From a74a9a9eb9d75964a0e978950e8b191d7a18d763 Mon Sep 17 00:00:00 2001
+From: Paul Eggleton <paul.eggleton@linux.intel.com>
+Date: Fri, 5 Jun 2015 17:07:16 +0100
+Subject: [PATCH] smart: change "is already installed" message from warning to
+ info
+
+This doesn't need to be a warning.
+
+Upstream-Status: Pending
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+---
+ smart/commands/install.py | 4 ++--
+ smart/interfaces/text/interactive.py | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/smart/commands/install.py b/smart/commands/install.py
+index 6ef9682..80d456b 100644
+--- a/smart/commands/install.py
++++ b/smart/commands/install.py
+@@ -152,7 +152,7 @@ def main(ctrl, opts):
+ for obj in results:
+ for pkg in obj.packages:
+ if pkg.installed:
+- iface.warning(_("%s (for %s) is already installed")
++ iface.info(_("%s (for %s) is already installed")
+ % (pkg, arg))
+ installed = True
+ break
+@@ -184,7 +184,7 @@ def main(ctrl, opts):
+ for name in names:
+ pkg = names[name][0]
+ if pkg.installed:
+- iface.warning(_("%s is already installed") % pkg)
++ iface.info(_("%s is already installed") % pkg)
+ else:
+ trans.enqueue(pkg, INSTALL)
+
+diff --git a/smart/interfaces/text/interactive.py b/smart/interfaces/text/interactive.py
+index 9865584..190867b 100644
+--- a/smart/interfaces/text/interactive.py
++++ b/smart/interfaces/text/interactive.py
+@@ -278,7 +278,7 @@ class Interpreter(Cmd):
+ for name in names:
+ pkg = names[name][0]
+ if pkg.installed:
+- iface.warning(_("%s is already installed") % pkg)
++ iface.info(_("%s is already installed") % pkg)
+ else:
+ found = True
+ transaction.enqueue(pkg, INSTALL)
+--
+2.1.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-attempt-fix.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-attempt-fix.patch
new file mode 100644
index 000000000..6e672b332
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-attempt-fix.patch
@@ -0,0 +1,158 @@
+Sadly, smart is not deterministic so the same build can go down multiple different
+pathways. We'd expect to see the same warnings however depending on the pathway
+taken, it may or may not warn, particularly with Recommends since they're optional.
+
+For example, where a Recommended package is available but has Conflicts, we'd expect
+to see an warning that we couldn't install it. Some code paths silently hide this
+(its a LOCKED_CONFLICT). We add printing of warnings for this case.
+
+Also, if there are two compatible feeds available (e.g. i586 and core2_32), this
+changes the code path from direct _install() to _pending() since there are multiple
+providers. This patch adds warning handling to _pending() so we don't hit hard
+failures there. This is as seen with the mysterious libspeexdsp failures for x86-lsb
+on the autobuilder.
+
+Upstream-Status: Pending
+RP
+2015/7/16
+
+Index: git/smart/transaction.py
+===================================================================
+--- git.orig/smart/transaction.py
++++ git/smart/transaction.py
+@@ -651,13 +651,14 @@ class Transaction(object):
+
+ if not prvpkgs:
+ # No packages provide it at all. Give up.
++
++ reasons = []
++ for prv in req.providedby:
++ for prvpkg in prv.packages:
++ lockedres = lockedpkgs.get(prvpkg, None)
++ if lockedres:
++ reasons.append(lock_reason(prvpkg, lockedres))
+ if reqrequired:
+- reasons = []
+- for prv in req.providedby:
+- for prvpkg in prv.packages:
+- lockedres = lockedpkgs.get(prvpkg, None)
+- if lockedres:
+- reasons.append(lock_reason(prvpkg, lockedres))
+ if reasons:
+ raise Failed, _("Can't install %s: unable to install provider for %s:\n %s") % \
+ (pkg, req, '\n '.join(reasons))
+@@ -665,7 +666,11 @@ class Transaction(object):
+ raise Failed, _("Can't install %s: no package provides %s") % \
+ (pkg, req)
+ else:
++ if reasons:
++ iface.warning(_("Can't install %s: unable to install provider for %s:\n %s") % \
++ (pkg, req, '\n '.join(reasons)))
++
+ # It's only a recommend, skip
+ continue
+
+ if len(prvpkgs) == 1:
+@@ -846,6 +852,14 @@ class Transaction(object):
+ isinst = changeset.installed
+ getweight = self._policy.getWeight
+
++ attempt = sysconf.has("attempt-install", soft=True)
++
++ def handle_failure(msg):
++ if attempt:
++ iface.warning(msg)
++ else:
++ raise Failed, msg
++
+ updown = []
+ while pending:
+ item = pending.pop(0)
+@@ -870,8 +884,9 @@ class Transaction(object):
+
+ if not prvpkgs:
+ # No packages provide it at all. Give up.
+- raise Failed, _("Can't install %s: no package "
+- "provides %s") % (pkg, req)
++ handle_failure(_("Can't install %s: no package "
++ "provides %s") % (pkg, req))
++ continue
+
+ if len(prvpkgs) > 1:
+ # More than one package provide it. We use _pending here,
+@@ -894,9 +909,10 @@ class Transaction(object):
+ keeporder, cs, lk))
+ keeporder += 0.000001
+ if not alternatives:
+- raise Failed, _("Can't install %s: all packages "
++ handle_failure(_("Can't install %s: all packages "
+ "providing %s failed to install:\n%s")\
+- % (pkg, req, "\n".join(failures))
++ % (pkg, req, "\n".join(failures)))
++ continue
+ alternatives.sort()
+ changeset.setState(alternatives[0][1])
+ if len(alternatives) == 1:
+@@ -954,18 +970,20 @@ class Transaction(object):
+
+ for reqpkg in reqpkgs:
+ if reqpkg in locked and isinst(reqpkg):
+- raise Failed, _("Can't remove %s: requiring "
++ handle_failure(_("Can't remove %s: requiring "
+ "package %s is locked") % \
+- (pkg, reqpkg)
++ (pkg, reqpkg))
++ continue
+ for reqpkg in reqpkgs:
+ # We check again, since other actions may have
+ # changed their state.
+ if not isinst(reqpkg):
+ continue
+ if reqpkg in locked:
+- raise Failed, _("Can't remove %s: requiring "
++ handle_failure(_("Can't remove %s: requiring "
+ "package %s is locked") % \
+- (pkg, reqpkg)
++ (pkg, reqpkg))
++ continue
+ self._remove(reqpkg, changeset, locked,
+ pending, depth)
+ continue
+@@ -978,12 +996,14 @@ class Transaction(object):
+ try:
+ for reqpkg in reqpkgs:
+ if reqpkg in locked and isinst(reqpkg):
+- raise Failed, _("%s is locked") % reqpkg
++ handle_failure(_("%s is locked") % reqpkg)
++ continue
+ for reqpkg in reqpkgs:
+ if not cs.installed(reqpkg):
+ continue
+ if reqpkg in lk:
+- raise Failed, _("%s is locked") % reqpkg
++ handle_failure(_("%s is locked") % reqpkg)
++ continue
+ self._remove(reqpkg, cs, lk, None, depth)
+ except Failed, e:
+ failures.append(unicode(e))
+@@ -991,9 +1011,10 @@ class Transaction(object):
+ alternatives.append((getweight(cs), cs, lk))
+
+ if not alternatives:
+- raise Failed, _("Can't install %s: all packages providing "
++ handle_failure(_("Can't install %s: all packages providing "
+ "%s failed to install:\n%s") \
+- % (pkg, prv, "\n".join(failures))
++ % (pkg, prv, "\n".join(failures)))
++ continue
+
+ alternatives.sort()
+ changeset.setState(alternatives[0][1])
+@@ -1246,6 +1267,7 @@ class Transaction(object):
+ changeset.setRequested(pkg, True)
+ except Failed, e:
+ if sysconf.has("attempt-install", soft=True):
++ iface.warning(_("Can't install %s: %s") % (pkg, str(e)))
+ if pkg in changeset:
+ del changeset[pkg]
+ continue
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-attempt.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-attempt.patch
new file mode 100644
index 000000000..ec98e03c0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-attempt.patch
@@ -0,0 +1,177 @@
+From b105e7fe812da3ccaf7155c0fe14c8728b0d39a5 Mon Sep 17 00:00:00 2001
+From: Mark Hatle <mark.hatle@windriver.com>
+Date: Mon, 20 Jan 2014 14:30:52 +0000
+Subject: [PATCH] Add mechanism to attempt install without failing
+
+In OpenEmbedded, for complementary and 'attemptonly' package processing,
+we need a way to instruct smart to try to install, but ignore any
+failures (usually conflicts).
+
+This option only works for the install operation.
+
+If a complementary install fails, an actual error occurred, one that
+we can't ignore without losing the entire attempted transaction. Keep
+this as an error so that we can catch these cases in the futre.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+---
+ backends/rpm/pm.py | 35 ++++++++++++++++++++++++++++++++++-
+ transaction.py | 50 +++++++++++++++++++++++++++++++++++++-------------
+ 2 files changed, 71 insertions(+), 14 deletions(-)
+
+diff --git a/smart/backends/rpm/pm.py b/smart/backends/rpm/pm.py
+index 9bbd952..ba6405a 100644
+--- a/smart/backends/rpm/pm.py
++++ b/smart/backends/rpm/pm.py
+@@ -241,15 +241,48 @@ class RPMPackageManager(PackageManager):
+ cb = RPMCallback(prog, upgradednames)
+ cb.grabOutput(True)
+ probs = None
++ retry = 0
+ try:
+ probs = ts.run(cb, None)
+ finally:
+ del getTS.ts
+ cb.grabOutput(False)
++ if probs and sysconf.has("attempt-install", soft=True):
++ def remove_conflict(pkgNEVR):
++ for key in changeset.keys():
++ if pkgNEVR == str(key):
++ del changeset[key]
++ del pkgpaths[key]
++ iface.warning("Removing %s due to file %s conflicting with %s" % (pkgNEVR, fname, altNEVR))
++ break
++
++ retry = 1
++ for prob in probs:
++ if prob[1][0] == rpm.RPMPROB_NEW_FILE_CONFLICT:
++ msg = prob[0].split()
++ fname = msg[1]
++ pkgNEVR = msg[7]
++ altNEVR = msg[9]
++ pkgNEVR = pkgNEVR.rsplit('.', 1)[0] + '@' + pkgNEVR.rsplit('.', 1)[1]
++ altNEVR = altNEVR.rsplit('.', 1)[0] + '@' + altNEVR.rsplit('.', 1)[1]
++ remove_conflict(pkgNEVR)
++ elif prob[1][0] == rpm.RPMPROB_FILE_CONFLICT:
++ msg = prob[0].split()
++ fname = msg[1]
++ pkgNEVR = msg[5]
++ altNEVR = msg[11]
++ pkgNEVR = pkgNEVR.rsplit('.', 1)[0] + '@' + pkgNEVR.rsplit('.', 1)[1]
++ altNEVR = altNEVR.rsplit('.', 1)[0] + '@' + altNEVR.rsplit('.', 1)[1]
++ remove_conflict(pkgNEVR)
++ else:
++ retry = 0
++
+ prog.setDone()
+- if probs:
++ if probs and (not retry):
+ raise Error, "\n".join([x[0] for x in probs])
+ prog.stop()
++ if retry and len(changeset):
++ self.commit(changeset, pkgpaths)
+
+ class RPMCallback:
+ def __init__(self, prog, upgradednames):
+diff --git a/smart/transaction.py b/smart/transaction.py
+index 4b90cb7..3e043e9 100644
+--- a/smart/transaction.py
++++ b/smart/transaction.py
+@@ -555,6 +555,8 @@ class Transaction(object):
+ changeset.set(pkg, INSTALL)
+ isinst = changeset.installed
+
++ attempt = sysconf.has("attempt-install", soft=True)
++
+ # Remove packages conflicted by this one.
+ for cnf in pkg.conflicts:
+ for prv in cnf.providedby:
+@@ -564,11 +566,16 @@ class Transaction(object):
+ if not isinst(prvpkg):
+ locked[prvpkg] = (LOCKED_CONFLICT_BY, pkg)
+ continue
+- if prvpkg in locked:
+- raise Failed, _("Can't install %s: conflicted package "
+- "%s is locked") % (pkg, prvpkg)
+- self._remove(prvpkg, changeset, locked, pending, depth)
+- pending.append((PENDING_UPDOWN, prvpkg))
++ if attempt:
++ del changeset[pkg]
++ raise Failed, _("Can't install %s: it conflicts with package "
++ "%s") % (pkg, prvpkg)
++ else:
++ if prvpkg in locked:
++ raise Failed, _("Can't install %s: conflicted package "
++ "%s is locked") % (pkg, prvpkg)
++ self._remove(prvpkg, changeset, locked, pending, depth)
++ pending.append((PENDING_UPDOWN, prvpkg))
+
+ # Remove packages conflicting with this one.
+ for prv in pkg.provides:
+@@ -579,12 +586,18 @@ class Transaction(object):
+ if not isinst(cnfpkg):
+ locked[cnfpkg] = (LOCKED_CONFLICT, pkg)
+ continue
+- if cnfpkg in locked:
++ if attempt:
++ del changeset[pkg]
+ raise Failed, _("Can't install %s: it's conflicted by "
+- "the locked package %s") \
+- % (pkg, cnfpkg)
+- self._remove(cnfpkg, changeset, locked, pending, depth)
+- pending.append((PENDING_UPDOWN, cnfpkg))
++ "the package %s") \
++ % (pkg, cnfpkg)
++ else:
++ if cnfpkg in locked:
++ raise Failed, _("Can't install %s: it's conflicted by "
++ "the locked package %s") \
++ % (pkg, cnfpkg)
++ self._remove(cnfpkg, changeset, locked, pending, depth)
++ pending.append((PENDING_UPDOWN, cnfpkg))
+
+ # Remove packages with the same name that can't
+ # coexist with this one.
+@@ -594,10 +607,15 @@ class Transaction(object):
+ if not isinst(namepkg):
+ locked[namepkg] = (LOCKED_NO_COEXIST, pkg)
+ continue
+- if namepkg in locked:
++ if attempt:
++ del changeset[pkg]
+ raise Failed, _("Can't install %s: it can't coexist "
+ "with %s") % (pkg, namepkg)
+- self._remove(namepkg, changeset, locked, pending, depth)
++ else:
++ if namepkg in locked:
++ raise Failed, _("Can't install %s: it can't coexist "
++ "with %s") % (pkg, namepkg)
++ self._remove(namepkg, changeset, locked, pending, depth)
+
+ # Install packages required by this one.
+ for req in pkg.requires + pkg.recommends:
+@@ -1176,6 +1194,8 @@ class Transaction(object):
+
+ self._policy.runStarting()
+
++ attempt = sysconf.has("attempt-install", soft=True)
++
+ try:
+ changeset = self._changeset.copy()
+ isinst = changeset.installed
+@@ -1190,7 +1210,11 @@ class Transaction(object):
+ locked[pkg] = (LOCKED_KEEP, None)
+ elif op is INSTALL:
+ if not isinst(pkg) and pkg in locked:
+- raise Failed, _("Can't install %s: it's locked") % pkg
++ if attempt:
++ iface.warning(_("Can't install %s: it's locked") % pkg)
++ del changeset[pkg]
++ else:
++ raise Failed, _("Can't install %s: it's locked") % pkg
+ changeset.set(pkg, INSTALL)
+ locked[pkg] = (LOCKED_INSTALL, None)
+ elif op is REMOVE:
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-cache.py-getPackages-matches-name-version.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-cache.py-getPackages-matches-name-version.patch
new file mode 100644
index 000000000..225b02f96
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-cache.py-getPackages-matches-name-version.patch
@@ -0,0 +1,43 @@
+From ee05e55e84b53f4bb0d0baba13ca47a8f84b7cb4 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 30 Sep 2015 01:12:52 -0700
+Subject: [PATCH] smart:cache.py: getPackages() matches name + arch
+
+It only matched name ony in the past, for example:
+smart install busybox (matched)
+but:
+smart install busybox@core2_64 (didn't match)
+
+The installation is very slow when no match since it would seach all the
+packages in the repo
+This patch makes it match both.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ smart/cache.py | 3 ++-
+ smart/ccache.c | 9 ++++++++-
+ 2 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/smart/control.py b/smart/control.py
+index d44abe7..f23a604 100644
+--- a/smart/control.py
++++ b/smart/control.py
+@@ -876,9 +876,13 @@ class Control(object):
+ objects = []
+
+ # If we find packages with exactly the given
+- # name or name-version, use them.
+- for pkg in self._cache.getPackages(s):
+- if pkg.name == s or "%s-%s" % (pkg.name, pkg.version) == s:
++ # name, name-version, or name@arch, use them.
++ s_name = s
++ if "@" in s:
++ s_name = s.split("@")[0]
++ for pkg in self._cache.getPackages(s_name):
++ if pkg.name == s or "%s-%s" % (pkg.name, pkg.version) == s \
++ or "%s@%s" % (pkg.name, pkg.version.split('@')[1]) == s:
+ objects.append((1.0, pkg))
+
+ if not objects:
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-channelsdir.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-channelsdir.patch
new file mode 100644
index 000000000..e621b3387
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-channelsdir.patch
@@ -0,0 +1,24 @@
+Make CHANNELSDIR in smart empty, since this causes host contamination issues
+on some RPM-based hosts on which smart is already installed.
+
+[YOCTO #3881]
+
+Upstream-Status: Inappropriate [embedded specific]
+
+diff --git a/smart/plugins/channelsync.py b/smart/plugins/channelsync.py
+index 3ba95ff..646d696 100644
+--- a/smart/plugins/channelsync.py
++++ b/smart/plugins/channelsync.py
+@@ -23,7 +23,11 @@ from smart.channel import *
+ from smart import *
+ import os
+
+-CHANNELSDIR = "/etc/smart/channels/"
++# For now, we leave the definition of CHANNELSDIR empty. This prevents smart
++# from erroneously consider the build host's channels while setting up its
++# channels [YOCTO #3881]. If this feature will be used in the future, CHANNELSDIR
++# should be set to a proper value.
++CHANNELSDIR = ""
+
+ def syncChannels(channelsdir, force=None):
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-improve-error-reporting.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-improve-error-reporting.patch
new file mode 100644
index 000000000..b82265b3f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-improve-error-reporting.patch
@@ -0,0 +1,91 @@
+Improve error reporting in smart
+
+Add code to check proper command line arguments for various
+smart commands. Exit with error if erroneous/additional arguments
+are given in the command line.
+
+Upstream-Status: Pending
+
+Signed-off-by: Bogdan Marinescu <bogdan.a.marinescu@intel.com>
+
+diff --git a/smart/util/optparse.py b/smart/util/optparse.py
+index 6fff1bc..f445a3b 100644
+--- a/smart/util/optparse.py
++++ b/smart/util/optparse.py
+@@ -70,6 +70,8 @@ import sys, os
+ import types
+ import textwrap
+ from gettext import gettext as _
++from smart import Error
++import re
+
+ def _repr(self):
+ return "<%s at 0x%x: %s>" % (self.__class__.__name__, id(self), self)
+@@ -710,6 +712,12 @@ class Option:
+ self.action, self.dest, opt, value, values, parser)
+
+ def take_action(self, action, dest, opt, value, values, parser):
++ # Keep all the options in the command line in the '_given_opts' array
++ # This will be used later to validate the command line
++ given_opts = getattr(parser.values, "_given_opts", [])
++ user_opt = re.sub(r"^\-*", "", opt).replace("-", "_")
++ given_opts.append(user_opt)
++ setattr(parser.values, "_given_opts", given_opts)
+ if action == "store":
+ setattr(values, dest, value)
+ elif action == "store_const":
+@@ -821,6 +829,54 @@ class Values:
+ setattr(self, attr, value)
+ return getattr(self, attr)
+
++ # Check if the given option has the specified number of arguments
++ # Raise an error if the option has an invalid number of arguments
++ # A negative number for 'nargs' means "at least |nargs| arguments are needed"
++ def check_args_of_option(self, opt, nargs, err=None):
++ given_opts = getattr(self, "_given_opts", [])
++ if not opt in given_opts:
++ return
++ values = getattr(self, opt, [])
++ if type(values) != type([]):
++ return
++ if nargs < 0:
++ nargs = -nargs
++ if len(values) >= nargs:
++ return
++ if not err:
++ if nargs == 1:
++ err = _("Option '%s' requires at least one argument") % opt
++ else:
++ err = _("Option '%s' requires at least %d arguments") % (opt, nargs)
++ raise Error, err
++ elif nargs == 0:
++ if len( values ) == 0:
++ return
++ raise Error, err
++ else:
++ if len(values) == nargs:
++ return
++ if not err:
++ if nargs == 1:
++ err = _("Option '%s' requires one argument") % opt
++ else:
++ err = _("Option '%s' requires %d arguments") % (opt, nargs)
++ raise Error, err
++
++ # Check that at least one of the options in 'actlist' was given as an argument
++ # to the command 'cmdname'
++ def ensure_action(self, cmdname, actlist):
++ given_opts = getattr(self, "_given_opts", [])
++ for action in actlist:
++ if action in given_opts:
++ return
++ raise Error, _("No action specified for command '%s'") % cmdname
++
++ # Check if there are any other arguments left after parsing the command line and
++ # raise an error if such arguments are found
++ def check_remaining_args(self):
++ if self.args:
++ raise Error, _("Invalid argument(s) '%s'" % str(self.args))
+
+ class OptionContainer:
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-recommends.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-recommends.patch
new file mode 100644
index 000000000..d607fc475
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-recommends.patch
@@ -0,0 +1,381 @@
+Handle recommended packages in core and rpm backends
+
+Identify and store recommended packages in the cache, add a query option
+to read them and ignore them if they are not present when installing.
+
+Initial identification code from Mark Hatle <mark.hatle@windriver.com>.
+
+Upstream-Status: Pending
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+diff --git a/smart/backends/rpm/base.py b/smart/backends/rpm/base.py
+index 9332ea0..4fcfbee 100644
+--- a/smart/backends/rpm/base.py
++++ b/smart/backends/rpm/base.py
+@@ -225,6 +225,52 @@ class RPMPackage(Package):
+ break
+ else:
+ return False
++ srecs = fk(self.recommends)
++ orecs = fk(other.recommends)
++ if srecs != orecs:
++ for srec in srecs:
++ if srec.name[0] == "/" or srec in orecs:
++ continue
++ for orec in orecs:
++ if (srec.name == orec.name and
++ srec.relation == orec.relation and
++ checkver(srec.version, orec.version)):
++ break
++ else:
++ return False
++ for orec in orecs:
++ if orec.name[0] == "/" or orec in srecs:
++ continue
++ for srec in srecs:
++ if (srec.name == orec.name and
++ srec.relation == orec.relation and
++ checkver(srec.version, orec.version)):
++ break
++ else:
++ return False
++ srecs = fk(self.recommends)
++ orecs = fk(other.recommends)
++ if srecs != orecs:
++ for srec in srecs:
++ if srec.name[0] == "/" or srec in orecs:
++ continue
++ for orec in orecs:
++ if (srec.name == orec.name and
++ srec.relation == orec.relation and
++ checkver(srec.version, orec.version)):
++ break
++ else:
++ return False
++ for orec in orecs:
++ if orec.name[0] == "/" or orec in srecs:
++ continue
++ for srec in srecs:
++ if (srec.name == orec.name and
++ srec.relation == orec.relation and
++ checkver(srec.version, orec.version)):
++ break
++ else:
++ return False
+ return True
+
+ def coexists(self, other):
+diff --git a/smart/ccache.c b/smart/ccache.c
+index 7193185..8b66515 100644
+--- a/smart/ccache.c
++++ b/smart/ccache.c
+@@ -500,6 +500,46 @@ Package_equals(PackageObject *self, PackageObject *other)
+ }
+ }
+
++ ilen = 0;
++ jlen = 0;
++ for (i = 0; i != PyList_GET_SIZE(self->recommends); i++) {
++ PyObject *item = PyList_GET_ITEM(self->recommends, i);
++ if (!PyObject_IsInstance(item, (PyObject *)&Depends_Type)) {
++ PyErr_SetString(PyExc_TypeError, "Depends instance expected");
++ return NULL;
++ }
++ if (STR(((DependsObject *)item)->name)[0] != '/')
++ ilen += 1;
++ }
++ for (j = 0; j != PyList_GET_SIZE(other->recommends); j++) {
++ PyObject *item = PyList_GET_ITEM(other->recommends, j);
++ if (!PyObject_IsInstance(item, (PyObject *)&Depends_Type)) {
++ PyErr_SetString(PyExc_TypeError, "Depends instance expected");
++ return NULL;
++ }
++ if (STR(((DependsObject *)item)->name)[0] != '/')
++ jlen += 1;
++ }
++ if (ilen != jlen) {
++ ret = Py_False;
++ goto exit;
++ }
++
++ ilen = PyList_GET_SIZE(self->recommends);
++ jlen = PyList_GET_SIZE(other->recommends);
++ for (i = 0; i != ilen; i++) {
++ PyObject *item = PyList_GET_ITEM(self->recommends, i);
++ if (STR(((DependsObject *)item)->name)[0] != '/') {
++ for (j = 0; j != jlen; j++)
++ if (item == PyList_GET_ITEM(other->recommends, j))
++ break;
++ if (j == jlen) {
++ ret = Py_False;
++ goto exit;
++ }
++ }
++ }
++
+ exit:
+ Py_INCREF(ret);
+ return ret;
+@@ -1813,6 +1853,59 @@ Loader_buildPackage(LoaderObject *self, PyObject *args)
+ }
+ }
+
++ /* if recargs: */
++ if (recargs) {
++ int i = 0;
++ int len = PyList_GET_SIZE(recargs);
++ /* pkg.recommends = [] */
++ Py_DECREF(pkgobj->recommends);
++ pkgobj->recommends = PyList_New(len);
++ /* for args in recargs: */
++ for (; i != len; i++) {
++ PyObject *args = PyList_GET_ITEM(recargs, i);
++ DependsObject *recobj;
++ PyObject *rec;
++
++ if (!PyTuple_Check(args)) {
++ PyErr_SetString(PyExc_TypeError,
++ "Item in recargs is not a tuple");
++ return NULL;
++ }
++
++ /* rec = cache._objmap.get(args) */
++ rec = PyDict_GetItem(cache->_objmap, args);
++ recobj = (DependsObject *)rec;
++
++ /* if not rec: */
++ if (!rec) {
++ if (!PyTuple_Check(args) || PyTuple_GET_SIZE(args) < 2) {
++ PyErr_SetString(PyExc_ValueError, "Invalid recargs tuple");
++ return NULL;
++ }
++ /* rec = args[0](*args[1:]) */
++ callargs = PyTuple_GetSlice(args, 1, PyTuple_GET_SIZE(args));
++ rec = PyObject_CallObject(PyTuple_GET_ITEM(args, 0), callargs);
++ Py_DECREF(callargs);
++ if (!rec) return NULL;
++ recobj = (DependsObject *)rec;
++
++ /* cache._objmap[args] = rec */
++ PyDict_SetItem(cache->_objmap, args, rec);
++ Py_DECREF(rec);
++
++ /* cache._recommends.append(rec) */
++ PyList_Append(cache->_recommends, rec);
++ }
++
++ /* relpkgs.append(rec.packages) */
++ PyList_Append(relpkgs, recobj->packages);
++
++ /* pkg.recommends.append(rec) */
++ Py_INCREF(rec);
++ PyList_SET_ITEM(pkgobj->recommends, i, rec);
++ }
++ }
++
+ /* if upgargs: */
+ if (upgargs) {
+ int i = 0;
+@@ -2592,6 +2685,16 @@ Cache_reset(CacheObject *self, PyObject *args)
+ if (PyList_Check(reqobj->providedby))
+ LIST_CLEAR(reqobj->providedby);
+ }
++ len = PyList_GET_SIZE(self->_recommends);
++ for (i = 0; i != len; i++) {
++ DependsObject *reqobj;
++ PyObject *req;
++ req = PyList_GET_ITEM(self->_recommends, i);
++ reqobj = (DependsObject *)req;
++ LIST_CLEAR(reqobj->packages);
++ if (PyList_Check(reqobj->providedby))
++ LIST_CLEAR(reqobj->providedby);
++ }
+ len = PyList_GET_SIZE(self->_upgrades);
+ for (i = 0; i != len; i++) {
+ DependsObject *upgobj;
+@@ -2834,6 +2937,30 @@ Cache__reload(CacheObject *self, PyObject *args)
+ }
+
+ /*
++ for rec in pkg.recommends:
++ rec.packages.append(pkg)
++ if rec not in recommends:
++ recommends[rec] = True
++ objmap[rec.getInitArgs()] = rec
++ */
++ if (PyList_Check(pkg->recommends)) {
++ klen = PyList_GET_SIZE(pkg->recommends);
++ for (k = 0; k != klen; k++) {
++ PyObject *rec = PyList_GET_ITEM(pkg->recommends, k);
++ PyList_Append(((DependsObject *)rec)->packages,
++ (PyObject *)pkg);
++ if (!PyDict_GetItem(recommends, rec)) {
++ PyDict_SetItem(recommends, rec, Py_True);
++ args = PyObject_CallMethod(rec, "getInitArgs",
++ NULL);
++ if (!args) return NULL;
++ PyDict_SetItem(objmap, args, rec);
++ Py_DECREF(args);
++ }
++ }
++ }
++
++ /*
+ for upg in pkg.upgrades:
+ upg.packages.append(pkg)
+ if upg not in upgrades:
+@@ -3097,6 +3224,47 @@ Cache_linkDeps(CacheObject *self, PyObject *args)
+ Py_DECREF(seq);
+ }
+
++ /* recnames = {} */
++ recnames = PyDict_New();
++ /* for rec in self._recommends: */
++ len = PyList_GET_SIZE(self->_recommends);
++ for (i = 0; i != len; i++) {
++ PyObject *rec = PyList_GET_ITEM(self->_recommends, i);
++
++ /* for name in rec.getMatchNames(): */
++ PyObject *names = PyObject_CallMethod(rec, "getMatchNames", NULL);
++ PyObject *seq = PySequence_Fast(names, "getMatchNames() returned "
++ "non-sequence object");
++ int nameslen;
++ if (!seq) return NULL;
++ nameslen = PySequence_Fast_GET_SIZE(seq);
++ for (j = 0; j != nameslen; j++) {
++ PyObject *name = PySequence_Fast_GET_ITEM(seq, j);
++
++ /* lst = recnames.get(name) */
++ lst = PyDict_GetItem(recnames, name);
++
++ /*
++ if lst:
++ lst.append(rec)
++ else:
++ recnames[name] = [rec]
++ */
++ if (lst) {
++ PyList_Append(lst, rec);
++ } else {
++ lst = PyList_New(1);
++ Py_INCREF(rec);
++ PyList_SET_ITEM(lst, 0, rec);
++ PyDict_SetItem(recnames, name, lst);
++ Py_DECREF(lst);
++ }
++ }
++
++ Py_DECREF(names);
++ Py_DECREF(seq);
++ }
++
+ /* upgnames = {} */
+ upgnames = PyDict_New();
+ /* for upg in self._upgrades: */
+@@ -3286,6 +3454,56 @@ Cache_linkDeps(CacheObject *self, PyObject *args)
+ }
+ }
+
++ /* lst = recnames.get(prv.name) */
++ lst = PyDict_GetItem(recnames, prv->name);
++
++ /* if lst: */
++ if (lst) {
++ /* for rec in lst: */
++ int reclen = PyList_GET_SIZE(lst);
++ for (j = 0; j != reclen; j++) {
++ DependsObject *rec = (DependsObject *)PyList_GET_ITEM(lst, j);
++ /* if rec.matches(prv): */
++ PyObject *ret = PyObject_CallMethod((PyObject *)rec, "matches",
++ "O", (PyObject *)prv);
++ if (!ret) return NULL;
++ if (PyObject_IsTrue(ret)) {
++ /*
++ if rec.providedby:
++ rec.providedby.append(prv)
++ else:
++ rec.providedby = [prv]
++ */
++ if (PyList_Check(rec->providedby)) {
++ PyList_Append(rec->providedby, (PyObject *)prv);
++ } else {
++ PyObject *_lst = PyList_New(1);
++ Py_INCREF(prv);
++ PyList_SET_ITEM(_lst, 0, (PyObject *)prv);
++ Py_DECREF(rec->providedby);
++ rec->providedby = _lst;
++ }
++
++ /*
++ if prv.recommendedby:
++ prv.recommendedby.append(prv)
++ else:
++ prv.recommendedby = [prv]
++ */
++ if (PyList_Check(prv->recommendedby)) {
++ PyList_Append(prv->recommendedby, (PyObject *)rec);
++ } else {
++ PyObject *_lst = PyList_New(1);
++ Py_INCREF(rec);
++ PyList_SET_ITEM(_lst, 0, (PyObject *)rec);
++ Py_DECREF(prv->recommendedby);
++ prv->recommendedby = _lst;
++ }
++ }
++ Py_DECREF(ret);
++ }
++ }
++
+ /* lst = upgnames.get(prv.name) */
+ lst = PyDict_GetItem(upgnames, prv->name);
+
+@@ -3821,6 +4094,21 @@ Cache__setstate__(CacheObject *self, PyObject *state)
+ }
+
+ /*
++ for rec in pkg.recommends:
++ rec.packages.append(pkg)
++ recommends[rec] = True
++ */
++ if (PyList_Check(pkgobj->recommends)) {
++ jlen = PyList_GET_SIZE(pkgobj->recommends);
++ for (j = 0; j != jlen; j++) {
++ PyObject *rec = PyList_GET_ITEM(pkgobj->recommends, j);
++ DependsObject *recobj = (DependsObject *)rec;
++ PyList_Append(recobj->packages, pkg);
++ PyDict_SetItem(recommends, rec, Py_True);
++ }
++ }
++
++ /*
+ for upg in pkg.upgrades:
+ upg.packages.append(pkg)
+ upgrades[upg] = True
+diff --git a/smart/commands/query.py b/smart/commands/query.py
+index 9265cd9..b6f5697 100644
+--- a/smart/commands/query.py
++++ b/smart/commands/query.py
+@@ -750,6 +750,22 @@ class TextOutput(NullOutput):
+ name = str(prvpkg)
+ print " ", "%s (%s)" % (name, prv)
+
++ def showRecommends(self, pkg, rec):
++ if self._firstrecommends:
++ self._firstrecommends = False
++ print " ", _("Recommends:")
++ print " ", rec
++
++ def showRecommendsProvidedBy(self, pkg, req, prv, prvpkg):
++ if self._firstrecommendsprovidedby:
++ self._firstrecommendsprovidedby = False
++ print " ", _("Provided By:")
++ if self.opts.hide_version:
++ name = prvpkg.name
++ else:
++ name = str(prvpkg)
++ print " ", "%s (%s)" % (name, prv)
++
+ def showUpgrades(self, pkg, upg):
+ if self._firstupgrades:
+ self._firstupgrades = False
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-set-noprogress-for-pycurl.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-set-noprogress-for-pycurl.patch
new file mode 100644
index 000000000..2885998ac
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-set-noprogress-for-pycurl.patch
@@ -0,0 +1,20 @@
+Set NOPROGRESS for pycurl just as same as default operation in pycurl module itself.
+If set NOPROGRESS with 0 for pycurl, it causes dead lock issue of Python GIL when
+call smart library by python gui just like pygtk.
+
+Upstream-Status: Pending
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+diff -u smart-1.4.1/smart.orig/fetcher.py smart-1.4.1/smart/fetcher.py
+--- smart-1.4.1/smart.orig/fetcher.py 2014-07-15 16:42:19.240437080 +0800
++++ smart-1.4.1/smart/fetcher.py 2014-07-15 17:02:37.812470289 +0800
+@@ -1720,7 +1720,7 @@
+ handle.setopt(pycurl.OPT_FILETIME, 1)
+ handle.setopt(pycurl.LOW_SPEED_LIMIT, 1)
+ handle.setopt(pycurl.LOW_SPEED_TIME, SOCKETTIMEOUT)
+- handle.setopt(pycurl.NOPROGRESS, 0)
++ handle.setopt(pycurl.NOPROGRESS, 1)
+ handle.setopt(pycurl.PROGRESSFUNCTION, progress)
+ handle.setopt(pycurl.WRITEDATA, local)
+ handle.setopt(pycurl.FOLLOWLOCATION, 1)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smartpm-rpm5-nodig.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smartpm-rpm5-nodig.patch
new file mode 100644
index 000000000..fefb29a66
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smartpm-rpm5-nodig.patch
@@ -0,0 +1,59 @@
+RPM5 has removed support for RPMVSF_NOSIGNATURES
+
+Patch smart to no longer use this flag
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff --git a/smart/backends/rpm/base.py b/smart/backends/rpm/base.py
+--- a/smart/backends/rpm/base.py
++++ b/smart/backends/rpm/base.py
+@@ -63,11 +63,11 @@ def getTS(new=False):
+ if sysconf.get("rpm-dbpath"):
+ rpm.addMacro('_dbpath', "/" + sysconf.get("rpm-dbpath"))
+ getTS.ts = rpm.ts(getTS.root)
+- if not sysconf.get("rpm-check-signatures", False):
+- if hasattr(rpm, '_RPMVSF_NOSIGNATURES'):
+- getTS.ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)
+- else:
+- raise Error, _("rpm requires checking signatures")
++ #if not sysconf.get("rpm-check-signatures", False):
++ # if hasattr(rpm, '_RPMVSF_NOSIGNATURES'):
++ # getTS.ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)
++ # else:
++ # raise Error, _("rpm requires checking signatures")
+ rpm_dbpath = sysconf.get("rpm-dbpath", "var/lib/rpm")
+ dbdir = rpm_join_dbpath(getTS.root, rpm_dbpath)
+ if not os.path.isdir(dbdir):
+@@ -89,11 +89,11 @@ def getTS(new=False):
+ if sysconf.get("rpm-dbpath"):
+ rpm.addMacro('_dbpath', "/" + sysconf.get("rpm-dbpath"))
+ ts = rpm.ts(getTS.root)
+- if not sysconf.get("rpm-check-signatures", False):
+- if hasattr(rpm, '_RPMVSF_NOSIGNATURES'):
+- ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)
+- else:
+- raise Error, _("rpm requires checking signatures")
++ #if not sysconf.get("rpm-check-signatures", False):
++ # if hasattr(rpm, '_RPMVSF_NOSIGNATURES'):
++ # ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)
++ # else:
++ # raise Error, _("rpm requires checking signatures")
+ return ts
+ else:
+ return getTS.ts
+diff --git a/smart/plugins/yumchannelsync.py b/smart/plugins/yumchannelsync.py
+--- a/smart/plugins/yumchannelsync.py
++++ b/smart/plugins/yumchannelsync.py
+@@ -56,8 +56,8 @@ def _getreleasever():
+
+ rpmroot = sysconf.get("rpm-root", "/")
+ ts = rpmUtils.transaction.initReadOnlyTransaction(root=rpmroot)
+- if hasattr(rpm, '_RPMVSF_NOSIGNATURES') and hasattr(rpm, '_RPMVSF_NODIGESTS'):
+- ts.pushVSFlags(~(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NODIGESTS))
++ #if hasattr(rpm, '_RPMVSF_NOSIGNATURES') and hasattr(rpm, '_RPMVSF_NODIGESTS'):
++ # ts.pushVSFlags(~(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NODIGESTS))
+ releasever = None
+ # HACK: we're hard-coding the most used distros, will add more if needed
+ idx = ts.dbMatch('provides', 'fedora-release')
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm_git.bb
new file mode 100644
index 000000000..d9a908db2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm_git.bb
@@ -0,0 +1,137 @@
+SUMMARY = "The Smart Package Manager"
+DESCRIPTION = "The Smart Package Manager project has the ambitious objective of creating \
+smart and portable algorithms for solving adequately the problem of managing software \
+upgrades and installation."
+
+HOMEPAGE = "http://labix.org/smart/"
+SECTION = "devel/python"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=393a5ca445f6965873eca0259a17f833"
+
+DEPENDS = "python rpm gettext-native python-rpm"
+SRCNAME = "smart"
+
+SRC_URI = "\
+ git://github.com/smartpm/smart.git \
+ file://smartpm-rpm5-nodig.patch \
+ file://smart-recommends.patch \
+ file://smart-improve-error-reporting.patch \
+ file://smart-channelsdir.patch \
+ file://smart-attempt.patch \
+ file://smart-attempt-fix.patch \
+ file://smart-add-for-rpm-ignoresize-check.patch \
+ file://smart-already-installed-message.patch \
+ file://smart-set-noprogress-for-pycurl.patch \
+ file://smart-cache.py-getPackages-matches-name-version.patch \
+ "
+
+SRCREV = "407a7eca766431257dcd1da15175cc36a1bb22d0"
+PV = "1.5+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+# Options - rpm, qt4, gtk
+PACKAGECONFIG ??= "rpm"
+
+RPM_RDEP = "${PN}-backend-rpm"
+QT_RDEP = "${PN}-interface-qt4"
+GTK_RDEP = "${PN}-interface-gtk"
+
+RPM_RDEP_class-native = ""
+QT_RDEP_class-native = ""
+GTK_RDEP_class-native = ""
+
+RPM_RDEP_class-nativesdk = ""
+QT_RDEP_class-nativesdk = ""
+GTK_RDEP_class-nativesdk = ""
+
+PACKAGECONFIG[rpm] = ",,rpm,${RPM_RDEP}"
+PACKAGECONFIG[qt4] = ",,qt4-x11,${QT_RDEP}"
+PACKAGECONFIG[gtk] = ",,gtk+,${GTK_RDEP}"
+
+inherit distutils
+
+do_install_append() {
+ # We don't support the following items
+ rm -rf ${D}${libdir}/python*/site-packages/smart/backends/slack
+ rm -rf ${D}${libdir}/python*/site-packages/smart/backends/arch
+ rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/qt
+
+ # Temporary, debian support in OE is missing the python module
+ rm -f ${D}${libdir}/python*/site-packages/smart/plugins/aptchannelsync.py*
+ rm -f ${D}${libdir}/python*/site-packages/smart/plugins/debdir.py*
+ rm -rf ${D}${libdir}/python*/site-packages/smart/backends/deb
+
+ # Disable automatic channel detection
+ rm -f ${D}${libdir}/python*/site-packages/smart/plugins/detectsys.py*
+
+ # Disable landscape support
+ rm -f ${D}${libdir}/python*/site-packages/smart/plugins/landscape.py*
+
+ # Disable urpmi channel support
+ rm -f ${D}${libdir}/python*/site-packages/smart/plugins/urpmichannelsync.py*
+
+ # Disable yum channel support
+ rm -f ${D}${libdir}/python*/site-packages/smart/plugins/yumchannelsync.py*
+
+ # Disable zypper channel support
+ rm -f ${D}${libdir}/python*/site-packages/smart/plugins/zyppchannelsync.py*
+
+ if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'rpm', 'rpm', '', d)}" ]; then
+ rm -f ${D}${libdir}/python*/site-packages/smart/plugins/rpmdir.py*
+ rm -rf ${D}${libdir}/python*/site-packages/smart/backends/rpm
+ fi
+
+ if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'qt4', 'qt4', '', d)}" ]; then
+ rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/qt4
+ fi
+
+ if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'gtk+', 'gtk', '', d)}" ]; then
+ rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/gtk
+ fi
+}
+
+add_native_wrapper() {
+ create_wrapper ${D}/${bindir}/smart \
+ RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
+ RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+ RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
+}
+
+do_install_append_class-native() {
+ sed -i -e 's|^#!.*/usr/bin/env python|#! /usr/bin/env nativepython|' ${D}${bindir}/smart
+ add_native_wrapper
+}
+
+do_install_append_class-nativesdk() {
+ add_native_wrapper
+}
+
+PACKAGES = "${PN}-dev ${PN}-dbg ${PN}-doc smartpm \
+ ${@bb.utils.contains('PACKAGECONFIG', 'rpm', '${PN}-backend-rpm', '', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'qt4', '${PN}-interface-qt4', '', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'gtk', '${PN}-interface-gtk', '', d)} \
+ ${PN}-interface-images ${PN}"
+
+RDEPENDS_smartpm = "${PN}"
+
+RDEPENDS_${PN} += "${PN}-backend-rpm python-codecs python-textutils python-xml python-fcntl \
+ python-pickle python-crypt python-compression python-shell \
+ python-resource python-netclient python-threading python-unixadmin python-pprint"
+RDEPENDS_${PN}_class-native = ""
+
+RDEPENDS_${PN}-backend-rpm = "python-rpm"
+
+RDEPENDS_${PN}-interface-qt4 = "qt4-x11 ${PN}-interface-images"
+RDEPENDS_${PN}-interface-gtk = "gtk+ ${PN}-interface-images"
+
+FILES_smartpm = "${bindir}/smart"
+
+FILES_${PN}-backend-rpm = "${libdir}/python*/site-packages/smart/backends/rpm"
+
+FILES_${PN}-interface-qt4 = "${libdir}/python*/site-packages/smart/interfaces/qt4"
+FILES_${PN}-interface-gtk = "${libdir}/python*/site-packages/smart/interfaces/gtk"
+FILES_${PN}-interface-images = "${datadir}/${baselib}/python*/site-packages/smart/interfaces/images"
+
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-smmap_0.9.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smmap_0.9.0.bb
new file mode 100644
index 000000000..5f9cf452e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smmap_0.9.0.bb
@@ -0,0 +1,23 @@
+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"
+
+SRC_URI = "http://pypi.python.org/packages/source/s/smmap/smmap-${PV}.tar.gz"
+SRC_URI[md5sum] = "d7932d5ace206bf4ae15198cf36fb6ab"
+SRC_URI[sha256sum] = "0e2b62b497bd5f0afebc002eda4d90df9d209c30ef257e8673c90a6b5c119d62"
+
+UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/smmap/"
+UPSTREAM_CHECK_REGEX = "/smmap/(?P<pver>(\d+[\.\-_]*)+)"
+
+S = "${WORKDIR}/smmap-${PV}"
+
+inherit setuptools
+
+RDEPENDS_${PN} += "python-codecs python-mmap python-lang"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python.inc b/import-layers/yocto-poky/meta/recipes-devtools/python/python.inc
new file mode 100644
index 000000000..f4818c6a8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python.inc
@@ -0,0 +1,32 @@
+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=dd98d01d471fac8d8dbdd975229dba03"
+
+SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "1dbcc848b4cd8399a8199d000f9f823c"
+SRC_URI[sha256sum] = "962b4c45af50124ea61f11a30deb4342fc0bc21126790fa1d7f6c79809413f46"
+
+# 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"
+
+PYTHON_MAJMIN = "2.7"
+
+inherit autotools
+
+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} \
+"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch
new file mode 100644
index 000000000..1257ca655
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch
@@ -0,0 +1,97 @@
+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>
+
+Index: Python-2.7.9/Makefile.pre.in
+===================================================================
+--- Python-2.7.9.orig/Makefile.pre.in
++++ Python-2.7.9/Makefile.pre.in
+@@ -234,6 +234,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
+ ##########################################################################
+ # Parser
+ PGEN= Parser/pgen$(EXE)
++HOSTPGEN= $(PGEN)$(EXE)
+
+ PSRCS= \
+ Parser/acceler.c \
+@@ -445,7 +446,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
+@@ -611,7 +612,7 @@ Modules/pwdmodule.o: $(srcdir)/Modules/p
+ $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS)
+ @$(MKDIR_P) Include
+ $(MAKE) $(PGEN)
+- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
++ $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
+ $(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS)
+ $(MAKE) $(GRAMMAR_H)
+ touch $(GRAMMAR_C)
+@@ -1043,27 +1044,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.9/setup.py
+===================================================================
+--- Python-2.7.9.orig/setup.py
++++ Python-2.7.9/setup.py
+@@ -334,6 +334,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
+@@ -558,6 +559,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/import-layers/yocto-poky/meta/recipes-devtools/python/python/03-fix-tkinter-detection.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/03-fix-tkinter-detection.patch
new file mode 100644
index 000000000..650ceb595
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python/05-enable-ctypes-cross-build.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/05-enable-ctypes-cross-build.patch
new file mode 100644
index 000000000..5cc874246
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch
new file mode 100644
index 000000000..e452cb6ac
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python/add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch
new file mode 100644
index 000000000..a97ff6b25
--- /dev/null
+++ b/import-layers/yocto-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.11/configure.ac
+===================================================================
+--- Python-2.7.11.orig/configure.ac
++++ Python-2.7.11/configure.ac
+@@ -33,7 +33,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/import-layers/yocto-poky/meta/recipes-devtools/python/python/add-md5module-support.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/add-md5module-support.patch
new file mode 100644
index 000000000..33fea7755
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python/avoid_parallel_make_races_on_pgen.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/avoid_parallel_make_races_on_pgen.patch
new file mode 100644
index 000000000..e9bae324f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/avoid_parallel_make_races_on_pgen.patch
@@ -0,0 +1,27 @@
+Upstream-Status: Pending
+
+Avoids parallel make races linking errors when making Parser/PGEN
+
+- Implements Richard Purdie's idea
+
+Signed-Off-By: Richard Purdie <richard.purdie@linuxfoundation.org>
+Signed-Off-By: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+Index: Python-2.7.9/Makefile.pre.in
+===================================================================
+--- Python-2.7.9.orig/Makefile.pre.in
++++ Python-2.7.9/Makefile.pre.in
+@@ -611,12 +611,10 @@ Modules/grpmodule.o: $(srcdir)/Modules/g
+
+ Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c $(srcdir)/Modules/posixmodule.h
+
+-$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS)
++$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS) $(PGEN)
+ @$(MKDIR_P) Include
+- $(MAKE) $(PGEN)
+ $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
+ $(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS)
+- $(MAKE) $(GRAMMAR_H)
+ touch $(GRAMMAR_C)
+
+ $(PGEN): $(PGENOBJS)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch
new file mode 100644
index 000000000..3347321fd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch
@@ -0,0 +1,39 @@
+_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.2/setup.py
+===================================================================
+--- Python-2.7.2.orig/setup.py 2012-04-05 23:18:38.500136647 +0300
++++ Python-2.7.2/setup.py 2012-04-05 23:19:35.888134969 +0300
+@@ -1634,8 +1634,10 @@
+ # Call the method for detecting whether _tkinter can be compiled
+ 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')
+
+ return missing
+
+diff --git Python-3.5.1.orig/setup.py Python-3.5.1/setup.py
+index b4633b9..d7588c0 100644
+--- Python-3.5.1.orig/setup.py
++++ Python-3.5.1/setup.py
+@@ -1536,7 +1536,7 @@ 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)
+
+ # tkinter module will not be avalaible as yocto
+ # doesn't have tk integrated (yet)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch
new file mode 100644
index 000000000..337e0e3e2
--- /dev/null
+++ b/import-layers/yocto-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.2/setup.py
+===================================================================
+--- Python-2.7.2.orig/setup.py 2012-04-05 22:29:18.049196608 +0300
++++ Python-2.7.2/setup.py 2012-04-05 22:29:57.505195453 +0300
+@@ -1522,8 +1522,9 @@
+ if 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 platform == 'darwin':
+ # _scproxy
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/builddir.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/builddir.patch
new file mode 100644
index 000000000..ad629a022
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python/cgi_py.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/cgi_py.patch
new file mode 100644
index 000000000..de504f9dc
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch
new file mode 100644
index 000000000..e6d6c65bb
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch
new file mode 100644
index 000000000..669112dab
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch
@@ -0,0 +1,33 @@
+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
+---
+diff -ruN a/Makefile.pre.in b/Makefile.pre.in
+--- a/Makefile.pre.in 2013-06-27 10:44:11.033840532 +0200
++++ b/Makefile.pre.in 2013-06-27 10:44:39.572635273 +0200
+@@ -709,14 +709,19 @@
+ # generated bytecode. This is sometimes a very shy bug needing a lot of
+ # sample data.
+
+-TESTOPTS= -l $(EXTRATESTOPTS)
++TESTOPTS= -l -v $(EXTRATESTOPTS)
+ TESTPROG= $(srcdir)/Lib/test/regrtest.py
+-TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS)
+-test: all 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: all platform
++
+ testall: all platform
+ -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
+ $(TESTPYTHON) $(srcdir)/Lib/compileall.py
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch
new file mode 100644
index 000000000..e4262d9ef
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python/host_include_contamination.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/host_include_contamination.patch
new file mode 100644
index 000000000..e0aafb218
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python/multilib.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/multilib.patch
new file mode 100644
index 000000000..0bfa0d2cf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/multilib.patch
@@ -0,0 +1,296 @@
+Rebased for python-2.7.9
+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
+@@ -736,6 +736,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.9/Include/pythonrun.h
+===================================================================
+--- Python-2.7.9.orig/Include/pythonrun.h
++++ Python-2.7.9/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.9/Lib/distutils/command/install.py
+===================================================================
+--- Python-2.7.9.orig/Lib/distutils/command/install.py
++++ Python-2.7.9/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.9/Lib/distutils/sysconfig.py
+===================================================================
+--- Python-2.7.9.orig/Lib/distutils/sysconfig.py
++++ Python-2.7.9/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.9/Lib/pydoc.py
+===================================================================
+--- Python-2.7.9.orig/Lib/pydoc.py
++++ Python-2.7.9/Lib/pydoc.py
+@@ -383,7 +383,7 @@ class Doc:
+
+ docloc = os.environ.get("PYTHONDOCS",
+ "http://docs.python.org/library")
+- basedir = os.path.join(sys.exec_prefix, "lib",
++ basedir = os.path.join(sys.exec_prefix, sys.lib,
+ "python"+sys.version[0:3])
+ if (isinstance(object, type(os)) and
+ (object.__name__ in ('errno', 'exceptions', 'gc', 'imp',
+Index: Python-2.7.9/Lib/site.py
+===================================================================
+--- Python-2.7.9.orig/Lib/site.py
++++ Python-2.7.9/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"))
+ if sys.platform == "darwin":
+ # for framework builds *only* we add the standard Apple
+ # locations.
+Index: Python-2.7.9/Lib/sysconfig.py
+===================================================================
+--- Python-2.7.9.orig/Lib/sysconfig.py
++++ Python-2.7.9/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.9/Lib/test/test_dl.py
+===================================================================
+--- Python-2.7.9.orig/Lib/test/test_dl.py
++++ Python-2.7.9/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.9/Lib/test/test_site.py
+===================================================================
+--- Python-2.7.9.orig/Lib/test/test_site.py
++++ Python-2.7.9/Lib/test/test_site.py
+@@ -241,12 +241,16 @@ class HelperFunctionsTests(unittest.Test
+ self.assertEqual(dirs[2], wanted)
+ elif os.sep == '/':
+ # OS X non-framwework builds, 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.9/Lib/trace.py
+===================================================================
+--- Python-2.7.9.orig/Lib/trace.py
++++ Python-2.7.9/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.9/Makefile.pre.in
+===================================================================
+--- Python-2.7.9.orig/Makefile.pre.in
++++ Python-2.7.9/Makefile.pre.in
+@@ -87,6 +87,7 @@ PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAG
+
+ # Machine-dependent subdirectories
+ MACHDEP= @MACHDEP@
++LIB= @LIB@
+
+ # Multiarch directory (may be empty)
+ MULTIARCH= @MULTIARCH@
+@@ -106,7 +107,7 @@ LIBDIR= @libdir@
+ MANDIR= @mandir@
+ INCLUDEDIR= @includedir@
+ CONFINCLUDEDIR= $(exec_prefix)/include
+-SCRIPTDIR= $(prefix)/lib
++SCRIPTDIR= $(prefix)/@LIB@
+
+ # Detailed destination directories
+ BINLIBDEST= $(LIBDIR)/python$(VERSION)
+@@ -598,6 +599,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
+@@ -640,7 +642,7 @@ $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES)
+ Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(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.9/Modules/getpath.c
+===================================================================
+--- Python-2.7.9.orig/Modules/getpath.c
++++ Python-2.7.9/Modules/getpath.c
+@@ -116,9 +116,11 @@
+ #define EXEC_PREFIX PREFIX
+ #endif
+
++#define LIB_PYTHON LIB "/python" VERSION
++
+ #ifndef PYTHONPATH
+-#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
+- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
++#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
++ EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
+ #endif
+
+ #ifndef LANDMARK
+@@ -129,7 +131,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.9/Python/getplatform.c
+===================================================================
+--- Python-2.7.9.orig/Python/getplatform.c
++++ Python-2.7.9/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.9/Python/sysmodule.c
+===================================================================
+--- Python-2.7.9.orig/Python/sysmodule.c
++++ Python-2.7.9/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/import-layers/yocto-poky/meta/recipes-devtools/python/python/parallel-makeinst-create-bindir.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/parallel-makeinst-create-bindir.patch
new file mode 100644
index 000000000..951cb466f
--- /dev/null
+++ b/import-layers/yocto-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
+@@ -1008,7 +1008,7 @@ LIBPL= $(LIBP)/config
+ LIBPC= $(LIBDIR)/pkgconfig
+
+ libainstall: all 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/import-layers/yocto-poky/meta/recipes-devtools/python/python/python-2.7.3-remove-bsdb-rpath.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/python-2.7.3-remove-bsdb-rpath.patch
new file mode 100644
index 000000000..216be0a44
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python/run-ptest b/import-layers/yocto-poky/meta/recipes-devtools/python/python/run-ptest
new file mode 100644
index 000000000..a2f9eed44
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch
new file mode 100644
index 000000000..6ccdb948b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python/setuptweaks.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/setuptweaks.patch
new file mode 100644
index 000000000..3a91b1916
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python/sitecustomize.py b/import-layers/yocto-poky/meta/recipes-devtools/python/python/sitecustomize.py
new file mode 100644
index 000000000..273901898
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/sitecustomize.py
@@ -0,0 +1,45 @@
+# 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
+
+def __enableDefaultEncoding():
+ import sys
+ try:
+ sys.setdefaultencoding( "utf8" )
+ except LookupError:
+ pass
+
+import sys
+try:
+ import rlcompleter, readline
+except ImportError:
+ pass
+else:
+ __enableDefaultEncoding()
+ __registerExitHandler()
+ __enableReadlineSupport()
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/use_sysroot_ncurses_instead_of_host.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/use_sysroot_ncurses_instead_of_host.patch
new file mode 100644
index 000000000..2c657861c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/use_sysroot_ncurses_instead_of_host.patch
@@ -0,0 +1,20 @@
+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
+
+
+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/import-layers/yocto-poky/meta/recipes-devtools/python/python3-native_3.5.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-native_3.5.1.bb
new file mode 100644
index 000000000..7bad11aaf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-native_3.5.1.bb
@@ -0,0 +1,79 @@
+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://000-cross-compile.patch \
+file://020-dont-compile-python-files.patch \
+file://030-fixup-include-dirs.patch \
+file://070-dont-clean-ipkg-install.patch \
+file://080-distutils-dont_adjust_files.patch \
+file://110-enable-zlib.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 \
+"
+SRC_URI[md5sum] = "e9ea6f2623fffcdd871b7b19113fde80"
+SRC_URI[sha256sum] = "c6d57c0c366d9060ab6c0cdf889ebf3d92711d466cc0119c441dbf2746f725c9"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=dd98d01d471fac8d8dbdd975229dba03"
+
+# 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"
+
+inherit native
+
+RPROVIDES += "python3-distutils-native python3-compression-native python3-textutils-native python3-core-native"
+
+EXTRA_OECONF_append = " --bindir=${bindir}/${PN} --without-ensurepip"
+
+EXTRA_OEMAKE = '\
+ BUILD_SYS="" \
+ HOST_SYS="" \
+ 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
+}
+
+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
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3-pip_8.0.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-pip_8.0.0.bb
new file mode 100644
index 000000000..834ecda6d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-pip_8.0.0.bb
@@ -0,0 +1,48 @@
+SUMMARY = "The PyPA recommended tool for installing Python packages"
+sHOMEPAGEsss = "https://pypi.python.org/pypi/pip"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=25fba45109565f87de20bae85bc39452"
+
+SRCNAME = "pip"
+DEPENDS += "python3 python3-setuptools-native"
+
+SRC_URI = " \
+ http://pypi.python.org/packages/source/p/${SRCNAME}/${SRCNAME}-${PV}.tar.gz \
+"
+SRC_URI[md5sum] = "5601c4323464add1482291634142894d"
+SRC_URI[sha256sum] = "90112b296152f270cb8dddcd19b7b87488d9e002e8cf622e14c4da9c2f6319b1"
+
+UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/pip"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit distutils3
+
+DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${libdir}/${PYTHON_DIR}/site-packages"
+
+do_install_prepend() {
+ install -d ${D}/${libdir}/${PYTHON_DIR}/site-packages
+}
+
+# Use setuptools site.py instead, avoid shared state issue
+do_install_append() {
+ rm ${D}/${libdir}/${PYTHON_DIR}/site-packages/site.py
+ rm ${D}/${libdir}/${PYTHON_DIR}/site-packages/__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 "./${SRCNAME}-${PV}-py${PYTHON_BASEVERSION}.egg" > ${D}${PYTHON_SITEPACKAGES_DIR}/${SRCNAME}-${PV}.pth
+}
+
+RDEPENDS_${PN} = "\
+ python3-compile \
+ python3-io \
+ python3-json \
+ python3-netserver \
+ python3-setuptools \
+ python3-unixadmin \
+ python3-xmlrpc \
+"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3-setuptools_19.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-setuptools_19.4.bb
new file mode 100644
index 000000000..fb2931c3f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-setuptools_19.4.bb
@@ -0,0 +1,37 @@
+require python-setuptools.inc
+
+DEPENDS += "python3"
+DEPENDS_class-native += "python3-native"
+
+inherit distutils3
+
+DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${libdir}/${PYTHON_DIR}/site-packages"
+
+# The installer puts the wrong path in the setuptools.pth file. Correct it.
+do_install_append() {
+ rm ${D}${PYTHON_SITEPACKAGES_DIR}/setuptools.pth
+ mv ${D}${bindir}/easy_install ${D}${bindir}/easy3_install
+ echo "./${SRCNAME}-${PV}-py${PYTHON_BASEVERSION}.egg" > ${D}${PYTHON_SITEPACKAGES_DIR}/setuptools.pth
+}
+
+RDEPENDS_${PN} = "\
+ python3-distutils \
+ python3-compression \
+"
+RDEPENDS_${PN}_class-target = "\
+ python3-ctypes \
+ python3-distutils \
+ python3-email \
+ python3-importlib \
+ python3-numbers \
+ python3-compression \
+ python3-shell \
+ python3-subprocess \
+ python3-textutils \
+ python3-pkgutil \
+ python3-threading \
+ python3-misc \
+ python3-unittest \
+ python3-xml \
+"
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/000-cross-compile.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/000-cross-compile.patch
new file mode 100644
index 000000000..28fe70adb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/000-cross-compile.patch
@@ -0,0 +1,85 @@
+We cross compile python. This patch uses tools from host/native
+python instead of in-tree tools
+
+-Khem
+
+Upstream-Status: Inappropriate[Configuration Specific]
+
+---
+ Makefile.pre.in | 25 +++++++++++++------------
+ 1 file changed, 13 insertions(+), 12 deletions(-)
+
+Index: Python-3.5.1/Makefile.pre.in
+===================================================================
+--- Python-3.5.1.orig/Makefile.pre.in
++++ Python-3.5.1/Makefile.pre.in
+@@ -220,6 +220,7 @@ LIBOBJS= @LIBOBJS@
+
+ PYTHON= python$(EXE)
+ BUILDPYTHON= python$(BUILDEXE)
++HOSTPYTHON= $(BUILDPYTHON)
+
+ PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
+ _PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@
+@@ -276,6 +277,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
+ ##########################################################################
+ # Parser
+ PGEN= Parser/pgen$(EXE)
++HOSTPGEN= $(PGEN)$(EXE)
+
+ PSRCS= \
+ Parser/acceler.c \
+@@ -506,7 +508,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)
+@@ -779,7 +781,7 @@ $(IO_OBJS): $(IO_H)
+
+ $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGEN)
+ @$(MKDIR_P) Include
+- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
++ $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
+ $(GRAMMAR_C): $(GRAMMAR_H)
+ touch $(GRAMMAR_C)
+
+@@ -968,7 +970,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Programs/pyth
+ ######################################################################
+
+ TESTOPTS= $(EXTRATESTOPTS)
+-TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) $(TESTPYTHONOPTS)
++TESTPYTHON= $(RUNSHARED) $(HOSTPYTHON) $(TESTPYTHONOPTS)
+ TESTRUNNER= $(TESTPYTHON) $(srcdir)/Tools/scripts/run_tests.py
+ TESTTIMEOUT= 3600
+
+@@ -1455,7 +1457,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
+@@ -1521,7 +1523,7 @@ config.status: $(srcdir)/configure
+
+ # 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
+@@ -1656,7 +1658,7 @@ funny:
+
+ # Perform some verification checks on any modified files.
+ patchcheck: all
+- $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
++ $(RUNSHARED) ./$(HOSTPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
+
+ # Dependencies
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch b/import-layers/yocto-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..b7e0ac635
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch
@@ -0,0 +1,38 @@
+From 045c99b5f1eb6e4e0d8ad1ef9f0ba6574f738150 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 d7fc9a0..47e60bc 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1270,12 +1270,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}
+ 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.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch
new file mode 100644
index 000000000..819ba69ed
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch
@@ -0,0 +1,48 @@
+Dont cross compile site packages
+
+-Khem
+
+Upstream-Status: Inappropriate[Embedded-Specific]
+
+---
+ Makefile.pre.in | 16 ----------------
+ 1 file changed, 16 deletions(-)
+
+Index: Python-3.5.0/Makefile.pre.in
+===================================================================
+--- Python-3.5.0.orig/Makefile.pre.in
++++ Python-3.5.0/Makefile.pre.in
+@@ -1262,33 +1262,6 @@ libinstall: build_all $(srcdir)/Lib/$(PL
+ $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
+ $(DESTDIR)$(LIBDEST)/distutils/tests ; \
+ fi
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -Wi $(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 -O $(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 -OO $(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 $(DESTDIR)$(LIBDEST)/compileall.py \
+- -d $(LIBDEST)/site-packages -f \
+- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
+- -d $(LIBDEST)/site-packages -f \
+- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -Wi -OO $(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
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch
new file mode 100644
index 000000000..fddfd2b2f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch
new file mode 100644
index 000000000..6beac7b80
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch
new file mode 100644
index 000000000..789929b71
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch
@@ -0,0 +1,36 @@
+consider opkg directories when cleaning up
+
+-Khem
+
+Upstream-Status: Inappropriate [OE specific]
+
+---
+ Makefile.pre.in | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1306,8 +1306,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
+@@ -1321,9 +1321,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 'fficonfig.py' -exec rm -f {} ';' || true
+ -rm -f Lib/lib2to3/*Grammar*.pickle
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch
new file mode 100644
index 000000000..b96419a63
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/110-enable-zlib.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/110-enable-zlib.patch
new file mode 100644
index 000000000..fb92a1916
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/110-enable-zlib.patch
@@ -0,0 +1,21 @@
+Enable zlib in python
+
+-Khem
+
+Upstream-Status: Inappropriate [OE-Specific]
+
+---
+ Modules/Setup.dist | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/Modules/Setup.dist
++++ b/Modules/Setup.dist
+@@ -354,7 +354,7 @@ _symtable symtablemodule.c
+ # Andrew Kuchling's zlib module.
+ # This require zlib 1.1.3 (or later).
+ # See http://www.gzip.org/zlib/
+-#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
++zlib zlibmodule.c -lz
+
+ # Interface to the Expat XML parser
+ #
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
new file mode 100644
index 000000000..8b93c1cf4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
@@ -0,0 +1,88 @@
+From d4dd67daa1555bf13272cc071706338572539bad 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>
+
+---
+diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
+index 573724d..418b478 100644
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -17,10 +17,11 @@ import sys
+ from .errors import DistutilsPlatformError
+
+ # These are needed in a couple of spots, so just compute them once.
+-PREFIX = os.path.normpath(sys.prefix)
+-EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
+-BASE_PREFIX = os.path.normpath(sys.base_prefix)
+-BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix)
++PREFIX = os.path.normpath(sys.prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
++EXEC_PREFIX = os.path.normpath(sys.exec_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
++BASE_PREFIX = os.path.normpath(sys.base_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
++BASE_EXEC_PREFIX= os.path.normpath(sys.base_exec_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
++
+
+ # Path to the base directory of the project. On Windows the binary may
+ # live in project/PCBuild/win32 or project/PCBuild/amd64.
+@@ -84,7 +85,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 +128,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 +140,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:
+@@ -233,7 +240,7 @@ def get_config_h_filename():
+ else:
+ inc_dir = get_python_inc(plat_specific=1)
+
+- return os.path.join(inc_dir, 'pyconfig.h')
++ return os.path.join(inc_dir, 'pyconfig.h'.replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") ))
+
+
+ def get_makefile_filename():
+@@ -242,7 +249,7 @@ def get_makefile_filename():
+ return os.path.join(_sys_home or project_base, "Makefile")
+ lib_dir = get_python_lib(plat_specific=0, standard_lib=1)
+ config_file = 'config-{}{}'.format(get_python_version(), build_flags)
+- return os.path.join(lib_dir, config_file, 'Makefile')
++ return os.path.join(lib_dir, config_file, 'Makefile').replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
+
+
+ def parse_config_h(fp, g=None):
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/130-readline-setup.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/130-readline-setup.patch
new file mode 100644
index 000000000..c805652d6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/150-fix-setupterm.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/150-fix-setupterm.patch
new file mode 100644
index 000000000..78d7c7867
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch
new file mode 100644
index 000000000..f29ae5337
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch
new file mode 100644
index 000000000..3347321fd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch
@@ -0,0 +1,39 @@
+_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.2/setup.py
+===================================================================
+--- Python-2.7.2.orig/setup.py 2012-04-05 23:18:38.500136647 +0300
++++ Python-2.7.2/setup.py 2012-04-05 23:19:35.888134969 +0300
+@@ -1634,8 +1634,10 @@
+ # Call the method for detecting whether _tkinter can be compiled
+ 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')
+
+ return missing
+
+diff --git Python-3.5.1.orig/setup.py Python-3.5.1/setup.py
+index b4633b9..d7588c0 100644
+--- Python-3.5.1.orig/setup.py
++++ Python-3.5.1/setup.py
+@@ -1536,7 +1536,7 @@ 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)
+
+ # tkinter module will not be avalaible as yocto
+ # doesn't have tk integrated (yet)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/cgi_py.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/cgi_py.patch
new file mode 100644
index 000000000..de504f9dc
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/configure.ac-fix-LIBPL.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/configure.ac-fix-LIBPL.patch
new file mode 100644
index 000000000..97214f9aa
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch
new file mode 100644
index 000000000..cd1a978eb
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/host_include_contamination.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/host_include_contamination.patch
new file mode 100644
index 000000000..ef2054d9a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python-3.3-multilib.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python-3.3-multilib.patch
new file mode 100644
index 000000000..44ec424cd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python-3.3-multilib.patch
@@ -0,0 +1,312 @@
+Upstream-Status: Pending
+
+get the sys.lib from python itself and do not use hardcoded value of 'lib'
+
+02/2015 Rebased for 3.4.2
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+Index: Python-3.5.0/Include/pythonrun.h
+===================================================================
+--- Python-3.5.0.orig/Include/pythonrun.h
++++ Python-3.5.0/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.0/Lib/distutils/command/install.py
+===================================================================
+--- Python-3.5.0.orig/Lib/distutils/command/install.py
++++ Python-3.5.0/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',
+@@ -30,7 +32,7 @@ WINDOWS_SCHEME = {
+ 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$abiflags/$dist_name',
+ 'scripts': '$base/bin',
+ 'data' : '$base',
+Index: Python-3.5.0/Lib/pydoc.py
+===================================================================
+--- Python-3.5.0.orig/Lib/pydoc.py
++++ Python-3.5.0/Lib/pydoc.py
+@@ -393,7 +393,7 @@ class Doc:
+
+ docloc = os.environ.get("PYTHONDOCS", self.PYTHONDOCS)
+
+- 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])
+ if (isinstance(object, type(os)) and
+ (object.__name__ in ('errno', 'exceptions', 'gc', 'imp',
+Index: Python-3.5.0/Lib/trace.py
+===================================================================
+--- Python-3.5.0.orig/Lib/trace.py
++++ Python-3.5.0/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.0/Makefile.pre.in
+===================================================================
+--- Python-3.5.0.orig/Makefile.pre.in
++++ Python-3.5.0/Makefile.pre.in
+@@ -101,6 +101,8 @@ PY_CORE_CFLAGS= $(PY_CFLAGS) $(PY_CFLAGS
+
+ # Machine-dependent subdirectories
+ MACHDEP= @MACHDEP@
++LIB= @LIB@
++ARCH= @ARCH@
+
+ # Multiarch directory (may be empty)
+ MULTIARCH= @MULTIARCH@
+@@ -120,7 +122,7 @@ LIBDIR= @libdir@
+ MANDIR= @mandir@
+ INCLUDEDIR= @includedir@
+ CONFINCLUDEDIR= $(exec_prefix)/include
+-SCRIPTDIR= $(prefix)/lib
++SCRIPTDIR= @libdir@
+ ABIFLAGS= @ABIFLAGS@
+
+ # Detailed destination directories
+@@ -729,6 +731,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
+@@ -798,7 +801,7 @@ $(OPCODE_H): $(srcdir)/Lib/opcode.py $(O
+ Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(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.0/Modules/getpath.c
+===================================================================
+--- Python-3.5.0.orig/Modules/getpath.c
++++ Python-3.5.0/Modules/getpath.c
+@@ -117,9 +117,11 @@
+ #define EXEC_PREFIX PREFIX
+ #endif
+
++#define LIB_PYTHON LIB "/python" VERSION
++
+ #ifndef PYTHONPATH
+-#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
+- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
++#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
++ EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
+ #endif
+
+ #ifndef LANDMARK
+@@ -130,6 +132,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. */
+
+Index: Python-3.5.0/Python/getplatform.c
+===================================================================
+--- Python-3.5.0.orig/Python/getplatform.c
++++ Python-3.5.0/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.0/Python/sysmodule.c
+===================================================================
+--- Python-3.5.0.orig/Python/sysmodule.c
++++ Python-3.5.0/Python/sysmodule.c
+@@ -1767,6 +1767,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.0/setup.py
+===================================================================
+--- Python-3.5.0.orig/setup.py
++++ Python-3.5.0/setup.py
+@@ -472,7 +472,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:
+@@ -530,8 +530,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:
+@@ -716,11 +715,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:
+Index: Python-3.5.0/Lib/sysconfig.py
+===================================================================
+--- Python-3.5.0.orig/Lib/sysconfig.py
++++ Python-3.5.0/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}',
++ 'stdlib': '{installed_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':
+ '{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',
++ 'stdlib': '{installed_base}/'+sys.lib+'/python',
++ 'platstdlib': '{base}/'+sys.lib+'/python',
+ 'purelib': '{base}/lib/python',
+- 'platlib': '{base}/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}',
++ '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-3.5.0/configure.ac
+===================================================================
+--- Python-3.5.0.orig/configure.ac
++++ Python-3.5.0/configure.ac
+@@ -858,6 +858,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"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python-config.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python-config.patch
new file mode 100644
index 000000000..f23b8b7df
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python3-setup.py-no-host-headers-libs.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python3-setup.py-no-host-headers-libs.patch
new file mode 100644
index 000000000..2bc8b8c46
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python3-setup.py-no-host-headers-libs.patch
@@ -0,0 +1,33 @@
+From 43238e1ac13e32984d015c92a5841f3de1fe1d15 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Tue, 18 Nov 2014 00:07:07 -0500
+Subject: [PATCH] setup.py: no host headers libs
+
+When we are cross-compiling, setup.py should never look in /usr
+or /usr/local to find headers or libraries.
+
+Upstream-Status: Inappropriate [Cross compile specific]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ setup.py | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index f020b28..e8339cd 100644
+--- a/setup.py
++++ b/setup.py
+@@ -444,10 +444,7 @@ class PyBuildExt(build_ext):
+ if not cross_compiling:
+ 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:
+ self.add_gcc_paths()
+- if not cross_compiling:
+ self.add_multiarch_paths()
+
+ # Add paths specified in the environment variables LDFLAGS and
+--
+2.0.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch
new file mode 100644
index 000000000..74490d93a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch
@@ -0,0 +1,28 @@
+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(-)
+
+diff --git a/configure.ac b/configure.ac
+index 989baf9..2890c96 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -67,7 +67,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])
+--
+2.0.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/setup.py-check-cross_compiling-when-get-FLAGS.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/setup.py-find-libraries-in-staging-dirs.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/setup.py-find-libraries-in-staging-dirs.patch
new file mode 100644
index 000000000..f26bd38b0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/setup.py-find-libraries-in-staging-dirs.patch
@@ -0,0 +1,30 @@
+Patch setup.py so that the detect_modules() function looks for required
+libraries and headers in STAGING_LIBDIR / STAGING_INCDIR.
+
+Without this patch, several extension modules are not built, even though
+their dependencies are present in the compiler's search paths.
+The result is the following warning, and ultimately incomplete packages:
+
+| The necessary bits to build these optional modules were not found:
+| _bz2 _curses_panel _dbm
+| _gdbm _lzma _sqlite3
+| nis readline zlib
+| To find the necessary bits, look in setup.py in detect_modules() for the module's name.
+
+Upstream-Status: Inappropriate [Cross compile specific]
+
+Signed-off-by: Dominic Sacré <dominic.sacre@gmx.de>
+
+Index: Python-3.4.3/setup.py
+===================================================================
+--- Python-3.4.3.orig/setup.py
++++ Python-3.4.3/setup.py
+@@ -521,6 +521,8 @@ class PyBuildExt(build_ext):
+ else:
+ lib_dirs = self.compiler.library_dirs[:]
+ inc_dirs = self.compiler.include_dirs[:]
++ lib_dirs.append(os.environ.get('STAGING_LIBDIR'))
++ inc_dirs.append(os.environ.get('STAGING_INCDIR'))
+ exts = []
+ missing = []
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/setuptweaks.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/setuptweaks.patch
new file mode 100644
index 000000000..3a91b1916
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch
new file mode 100644
index 000000000..802b1c720
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/sitecustomize.py b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/sitecustomize.py
new file mode 100644
index 000000000..4c8b5e2ba
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/sysconfig.py-add-_PYTHON_PROJECT_SRC.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/sysconfig.py-add-_PYTHON_PROJECT_SRC.patch
new file mode 100644
index 000000000..de07643f2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/sysconfig.py-add-_PYTHON_PROJECT_SRC.patch
@@ -0,0 +1,54 @@
+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(-)
+
+diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
+index a545ab9..74317d1 100644
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -554,7 +554,10 @@ def get_config_vars(*args):
+ _config_vars['exec_prefix'] = EXEC_PREFIX
+
+ # 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/Lib/sysconfig.py b/Lib/sysconfig.py
+index 7287f11..cc92998 100644
+--- a/Lib/sysconfig.py
++++ b/Lib/sysconfig.py
+@@ -562,7 +562,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 '..')
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/sysroot-include-headers.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/sysroot-include-headers.patch
new file mode 100644
index 000000000..785b5567f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/tweak-MULTIARCH-for-powerpc-linux-gnuspe.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/tweak-MULTIARCH-for-powerpc-linux-gnuspe.patch
new file mode 100644
index 000000000..8d037278b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/unixccompiler.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/unixccompiler.patch
new file mode 100644
index 000000000..7b90f1388
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/python/python3/use_packed_importlib.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/use_packed_importlib.patch
new file mode 100644
index 000000000..6c4b0cda9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/use_packed_importlib.patch
@@ -0,0 +1,31 @@
+
+Upstream-Status: Inappropriate [embedded specific]
+
+The binary _freeze_importlib is built and also used during build time to generate
+importlib*.h files, this is impossible to do on a cross-compile environment,
+this avoids executing the binary and forces it to use the packed importlib*.h files.
+
+
+Signed-Off-By: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+Index: Python-3.5.0/Makefile.pre.in
+===================================================================
+--- Python-3.5.0.orig/Makefile.pre.in
++++ Python-3.5.0/Makefile.pre.in
+@@ -700,12 +700,12 @@ Programs/_freeze_importlib.o: Programs/_
+ Programs/_freeze_importlib: Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN)
+ $(LINKCC) $(PY_LDFLAGS) -o $@ Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
+
+-Python/importlib_external.h: $(srcdir)/Lib/importlib/_bootstrap_external.py Programs/_freeze_importlib
+- ./Programs/_freeze_importlib \
++#Python/importlib_external.h: $(srcdir)/Lib/importlib/_bootstrap_external.py Programs/_freeze_importlib
++# ./Programs/_freeze_importlib \
+ $(srcdir)/Lib/importlib/_bootstrap_external.py Python/importlib_external.h
+
+-Python/importlib.h: $(srcdir)/Lib/importlib/_bootstrap.py Programs/_freeze_importlib
+- ./Programs/_freeze_importlib \
++#Python/importlib.h: $(srcdir)/Lib/importlib/_bootstrap.py Programs/_freeze_importlib
++# ./Programs/_freeze_importlib \
+ $(srcdir)/Lib/importlib/_bootstrap.py Python/importlib.h
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3_3.5.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python3_3.5.1.bb
new file mode 100644
index 000000000..2fbb3cbc3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3_3.5.1.bb
@@ -0,0 +1,226 @@
+require recipes-devtools/python/python.inc
+
+DEPENDS = "python3-native libffi bzip2 db gdbm openssl readline 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://000-cross-compile.patch \
+file://020-dont-compile-python-files.patch \
+file://030-fixup-include-dirs.patch \
+file://070-dont-clean-ipkg-install.patch \
+file://080-distutils-dont_adjust_files.patch \
+file://110-enable-zlib.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 \
+${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://python3-setup.py-no-host-headers-libs.patch \
+ file://sysconfig.py-add-_PYTHON_PROJECT_SRC.patch \
+ file://setup.py-check-cross_compiling-when-get-FLAGS.patch \
+ file://setup.py-find-libraries-in-staging-dirs.patch \
+ file://use_packed_importlib.patch \
+ file://configure.ac-fix-LIBPL.patch \
+ "
+SRC_URI[md5sum] = "e9ea6f2623fffcdd871b7b19113fde80"
+SRC_URI[sha256sum] = "c6d57c0c366d9060ab6c0cdf889ebf3d92711d466cc0119c441dbf2746f725c9"
+
+# exclude pre-releases for both python 2.x and 3.x
+UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>\d+(\.\d+)+).tar"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=dd98d01d471fac8d8dbdd975229dba03"
+
+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 ctypes cross compilation
+export CROSSPYTHONPATH = "${B}/build/lib.linux-${TARGET_ARCH}-${PYTHON_MAJMIN}:${S}/Lib:${S}/Lib/plat-linux"
+
+# No ctypes option for python 3
+PYTHONLSBOPTS = ""
+
+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} \
+ BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+ 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} \
+ BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+ 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} \
+ BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+ 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} \
+ BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+ 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
+
+ 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
+ # 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 \
+ ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile \
+ ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py
+}
+
+require python-${PYTHON_MAJMIN}-manifest.inc
+
+# manual dependency additions
+RPROVIDES_${PN}-core = "${PN}"
+RRECOMMENDS_${PN}-core = "${PN}-readline"
+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"
+RDEPENDS_${PN}-modules += "${PN}-misc"
+FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}"
+
+# catch manpage
+PACKAGES += "${PN}-man"
+FILES_${PN}-man = "${datadir}/man"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python_2.7.11.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python_2.7.11.bb
new file mode 100644
index 000000000..606f15362
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python_2.7.11.bb
@@ -0,0 +1,173 @@
+require python.inc
+DEPENDS = "python-native libffi bzip2 db 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://avoid_parallel_make_races_on_pgen.patch \
+ file://add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.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"
+
+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} \
+ BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+ 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} \
+ BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+ 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} \
+ BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+ 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
+}
+
+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 \
+ ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile \
+ ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py
+}
+
+require python-${PYTHON_MAJMIN}-manifest.inc
+
+# manual dependency additions
+RPROVIDES_${PN}-core = "${PN}"
+RRECOMMENDS_${PN}-core = "${PN}-readline"
+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"
+RDEPENDS_${PN}-ptest = "${PN}-modules"
+#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
+}
+
+# catch manpage
+PACKAGES += "${PN}-man"
+FILES_${PN}-man = "${datadir}/man"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/nativesdk-qemu-helper_1.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/qemu/nativesdk-qemu-helper_1.0.bb
new file mode 100644
index 000000000..51d1c5969
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/nativesdk-qemu-helper_1.0.bb
@@ -0,0 +1,47 @@
+SUMMARY = "Qemu helper scripts"
+LICENSE = "GPLv2"
+RDEPENDS_${PN} = "nativesdk-qemu"
+PR = "r9"
+
+
+LIC_FILES_CHKSUM = "file://${WORKDIR}/tunctl.c;endline=4;md5=ff3a09996bc5fff6bc5d4e0b4c28f999 \
+ file://${COREBASE}/scripts/runqemu;endline=18;md5=77fbe442a88b1bcdc29c3ba67733b21b"
+
+
+SRC_URI = "file://${COREBASE}/scripts/runqemu \
+ file://${COREBASE}/scripts/runqemu-internal \
+ 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 \
+ file://raw2flash.c \
+ "
+
+S = "${WORKDIR}"
+
+inherit nativesdk
+
+do_compile() {
+ ${CC} tunctl.c -o tunctl
+ ${CC} raw2flash.c -o raw2flash.spitz
+ ${CC} raw2flash.c -o flash2raw.spitz -Dflash2raw
+}
+
+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}/
+ install raw2flash.spitz ${D}${bindir}/
+ install flash2raw.spitz ${D}${bindir}/
+ ln -fs raw2flash.spitz ${D}${bindir}/raw2flash.akita
+ ln -fs raw2flash.spitz ${D}${bindir}/raw2flash.borzoi
+ ln -fs raw2flash.spitz ${D}${bindir}/raw2flash.terrier
+ ln -fs flash2raw.spitz ${D}${bindir}/flash2raw.akita
+ ln -fs flash2raw.spitz ${D}${bindir}/flash2raw.borzoi
+ ln -fs flash2raw.spitz ${D}${bindir}/flash2raw.terrier
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-helper-native_1.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-helper-native_1.0.bb
new file mode 100644
index 000000000..8d27c4db6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-helper-native_1.0.bb
@@ -0,0 +1,21 @@
+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}/
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-helper/raw2flash.c b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-helper/raw2flash.c
new file mode 100644
index 000000000..19faf629b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-helper/raw2flash.c
@@ -0,0 +1,370 @@
+/*
+ * Copyright (c) 2006 OpenedHand Ltd.
+ *
+ * This file is licensed under GNU GPL v2.
+ */
+#include <string.h>
+#include <unistd.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <stdlib.h>
+
+#define TFR(_) _
+#define VERBOSE
+#define PBAR_LEN 40
+
+#define PARTITION_START 0x00700000
+
+static const int ecc_pos8[] = {
+ 0x0, 0x1, 0x2,
+};
+
+static const int ecc_pos16[] = {
+ 0x0, 0x1, 0x2, 0x3, 0x6, 0x7,
+};
+
+static const int ecc_pos64[] = {
+ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
+};
+
+static const int ecc_akita[] = {
+ 0x05, 0x01, 0x02, 0x03, 0x06, 0x07, 0x15, 0x11,
+ 0x12, 0x13, 0x16, 0x17, 0x25, 0x21, 0x22, 0x23,
+ 0x26, 0x27, 0x35, 0x31, 0x32, 0x33, 0x36, 0x37,
+};
+
+struct jffs_marker_s {
+ int pos;
+ uint8_t value;
+};
+
+static const struct jffs_marker_s free_pos8[] = {
+ { 0x03, 0xff }, { 0x04, 0xff }, { 0x06, 0x85 }, { 0x07, 0x19 },
+ { -1 },
+};
+
+static const struct jffs_marker_s free_pos16[] = {
+ { 0x08, 0x85 }, { 0x09, 0x19 }, { 0x0a, 0x03 }, { 0x0b, 0x20 },
+ { 0x0c, 0x08 }, { 0x0d, 0x00 }, { 0x0e, 0x00 }, { 0x0f, 0x00 },
+ { -1 },
+};
+
+static const struct jffs_marker_s free_pos64[] = {
+ { 0x02, 0xff }, { 0x03, 0xff }, { 0x04, 0xff }, { 0x05, 0xff },
+ { 0x06, 0xff }, { 0x07, 0xff }, { 0x08, 0xff }, { 0x09, 0xff },
+ { 0x0a, 0xff }, { 0x0b, 0xff }, { 0x0c, 0xff }, { 0x0d, 0xff },
+ { 0x0e, 0xff }, { 0x0f, 0xff }, { 0x10, 0x85 }, { 0x11, 0x19 },
+ { 0x12, 0x03 }, { 0x13, 0x20 }, { 0x14, 0x08 }, { 0x15, 0x00 },
+ { 0x16, 0x00 }, { 0x17, 0x00 }, { 0x18, 0xff }, { 0x19, 0xff },
+ { 0x1a, 0xff }, { 0x1b, 0xff }, { 0x1c, 0xff }, { 0x1d, 0xff },
+ { 0x1e, 0xff }, { 0x1f, 0xff }, { 0x20, 0xff }, { 0x21, 0xff },
+ { 0x22, 0xff }, { 0x23, 0xff }, { 0x24, 0xff }, { 0x25, 0xff },
+ { 0x26, 0xff }, { 0x27, 0xff },
+ { -1 },
+};
+
+static const struct jffs_marker_s free_akita[] = {
+ { 0x08, 0x85 }, { 0x09, 0x19 }, { 0x0a, 0x03 }, { 0x0b, 0x20 },
+ { 0x0c, 0x08 }, { 0x0d, 0x00 }, { 0x0e, 0x00 }, { 0x0f, 0x00 },
+ { 0x10, 0xff },
+ { -1 },
+};
+
+#define LEN(array) (sizeof(array) / sizeof(*array))
+
+static const struct ecc_style_s {
+ int page_size;
+ int oob_size;
+ int eccbytes;
+ int eccsize;
+ const int *eccpos;
+ int romsize;
+ const struct jffs_marker_s *freepos;
+} spitz = {
+ 0x200, 0x10, 0x100, LEN(ecc_pos16), ecc_pos16, 0x01000000, free_pos16
+}, akita = {
+ 0x800, 0x40, 0x100, LEN(ecc_akita), ecc_akita, 0x08000000, free_akita
+}, borzoi = {
+ 0x800, 0x40, 0x100, LEN(ecc_akita), ecc_akita, 0x08000000, free_akita
+}, terrier = {
+ 0x800, 0x40, 0x100, LEN(ecc_akita), ecc_akita, 0x08000000, free_akita
+};
+
+struct ecc_state_s {
+ int count;
+ uint8_t cp;
+ uint8_t lp[2];
+ const struct ecc_style_s *style;
+};
+
+#ifndef flash2raw
+/*
+ * Pre-calculated 256-way 1 byte column parity. Table borrowed from Linux.
+ */
+static const uint8_t ecc_precalc_table[] = {
+ 0x00, 0x55, 0x56, 0x03, 0x59, 0x0c, 0x0f, 0x5a,
+ 0x5a, 0x0f, 0x0c, 0x59, 0x03, 0x56, 0x55, 0x00,
+ 0x65, 0x30, 0x33, 0x66, 0x3c, 0x69, 0x6a, 0x3f,
+ 0x3f, 0x6a, 0x69, 0x3c, 0x66, 0x33, 0x30, 0x65,
+ 0x66, 0x33, 0x30, 0x65, 0x3f, 0x6a, 0x69, 0x3c,
+ 0x3c, 0x69, 0x6a, 0x3f, 0x65, 0x30, 0x33, 0x66,
+ 0x03, 0x56, 0x55, 0x00, 0x5a, 0x0f, 0x0c, 0x59,
+ 0x59, 0x0c, 0x0f, 0x5a, 0x00, 0x55, 0x56, 0x03,
+ 0x69, 0x3c, 0x3f, 0x6a, 0x30, 0x65, 0x66, 0x33,
+ 0x33, 0x66, 0x65, 0x30, 0x6a, 0x3f, 0x3c, 0x69,
+ 0x0c, 0x59, 0x5a, 0x0f, 0x55, 0x00, 0x03, 0x56,
+ 0x56, 0x03, 0x00, 0x55, 0x0f, 0x5a, 0x59, 0x0c,
+ 0x0f, 0x5a, 0x59, 0x0c, 0x56, 0x03, 0x00, 0x55,
+ 0x55, 0x00, 0x03, 0x56, 0x0c, 0x59, 0x5a, 0x0f,
+ 0x6a, 0x3f, 0x3c, 0x69, 0x33, 0x66, 0x65, 0x30,
+ 0x30, 0x65, 0x66, 0x33, 0x69, 0x3c, 0x3f, 0x6a,
+ 0x6a, 0x3f, 0x3c, 0x69, 0x33, 0x66, 0x65, 0x30,
+ 0x30, 0x65, 0x66, 0x33, 0x69, 0x3c, 0x3f, 0x6a,
+ 0x0f, 0x5a, 0x59, 0x0c, 0x56, 0x03, 0x00, 0x55,
+ 0x55, 0x00, 0x03, 0x56, 0x0c, 0x59, 0x5a, 0x0f,
+ 0x0c, 0x59, 0x5a, 0x0f, 0x55, 0x00, 0x03, 0x56,
+ 0x56, 0x03, 0x00, 0x55, 0x0f, 0x5a, 0x59, 0x0c,
+ 0x69, 0x3c, 0x3f, 0x6a, 0x30, 0x65, 0x66, 0x33,
+ 0x33, 0x66, 0x65, 0x30, 0x6a, 0x3f, 0x3c, 0x69,
+ 0x03, 0x56, 0x55, 0x00, 0x5a, 0x0f, 0x0c, 0x59,
+ 0x59, 0x0c, 0x0f, 0x5a, 0x00, 0x55, 0x56, 0x03,
+ 0x66, 0x33, 0x30, 0x65, 0x3f, 0x6a, 0x69, 0x3c,
+ 0x3c, 0x69, 0x6a, 0x3f, 0x65, 0x30, 0x33, 0x66,
+ 0x65, 0x30, 0x33, 0x66, 0x3c, 0x69, 0x6a, 0x3f,
+ 0x3f, 0x6a, 0x69, 0x3c, 0x66, 0x33, 0x30, 0x65,
+ 0x00, 0x55, 0x56, 0x03, 0x59, 0x0c, 0x0f, 0x5a,
+ 0x5a, 0x0f, 0x0c, 0x59, 0x03, 0x56, 0x55, 0x00,
+};
+
+/* Update ECC parity count */
+static inline uint8_t ecc_digest(struct ecc_state_s *s, uint8_t sample) {
+ uint8_t idx = ecc_precalc_table[sample];
+
+ s->cp ^= idx & 0x3f;
+ if (idx & 0x40) {
+ s->lp[0] ^= ~(s->count & 0xff);
+ s->lp[1] ^= s->count & 0xff;
+ }
+ s->count ++;
+
+ return sample;
+}
+
+static void buffer_digest(struct ecc_state_s *ecc,
+ const uint8_t *buf, uint8_t *out) {
+ int i, lp_a[2];
+
+ ecc->lp[0] = 0x00;
+ ecc->lp[1] = 0x00;
+ ecc->cp = 0x00;
+ ecc->count = 0;
+ for (i = 0; i < ecc->style->eccbytes; i ++)
+ ecc_digest(ecc, buf[i]);
+
+# define BSHR(byte, from, to) ((ecc->lp[byte] >> (from - to)) & (1 << to))
+ lp_a[0] =
+ BSHR(0, 4, 0) | BSHR(0, 5, 2) |
+ BSHR(0, 6, 4) | BSHR(0, 7, 6) |
+ BSHR(1, 4, 1) | BSHR(1, 5, 3) |
+ BSHR(1, 6, 5) | BSHR(1, 7, 7);
+
+# define BSHL(byte, from, to) ((ecc->lp[byte] << (to - from)) & (1 << to))
+ lp_a[1] =
+ BSHL(0, 0, 0) | BSHL(0, 1, 2) |
+ BSHL(0, 2, 4) | BSHL(0, 3, 6) |
+ BSHL(1, 0, 1) | BSHL(1, 1, 3) |
+ BSHL(1, 2, 5) | BSHL(1, 3, 7);
+
+ out[0] = ~lp_a[1];
+ out[1] = ~lp_a[0];
+ out[2] = (~ecc->cp << 2) | 0x03;
+}
+
+static void jffs2_format(const struct ecc_state_s *ecc, uint8_t oob[]) {
+ const struct jffs_marker_s *byte;
+ for (byte = ecc->style->freepos; byte->pos >= 0; byte ++)
+ oob[byte->pos] = byte->value;
+}
+
+static void buffer_fill(const struct ecc_state_s *ecc, uint8_t buffer[],
+ int *len, int *partition, int count, uint8_t jffs_buffer[]) {
+ int ret;
+
+ switch (*partition) {
+ case 0:
+ if (count < PARTITION_START) {
+ memcpy(buffer, jffs_buffer + count,
+ ecc->style->eccbytes);
+ *len = ecc->style->eccbytes;
+ break;
+ }
+ *partition = 1;
+ case 1:
+ if (count - PARTITION_START < PARTITION_START) {
+ memcpy(buffer, jffs_buffer + count - PARTITION_START,
+ ecc->style->eccbytes);
+ *len = ecc->style->eccbytes;
+ break;
+ }
+
+ while (*len < ecc->style->eccbytes) {
+ ret = TFR(read(0, buffer + *len, 0x800 - *len));
+ if (ret <= 0)
+ break;
+ *len += ret;
+ }
+
+ if (*len == 0)
+ *partition = 2;
+ else if (*len < ecc->style->eccbytes) {
+ fprintf(stderr, "\nWarning: %i stray bytes\n", *len);
+ memset(buffer + *len, 0xff,
+ ecc->style->eccbytes - *len);
+ *len = ecc->style->eccbytes;
+ break;
+ } else
+ break;
+ case 2:
+ memset(buffer, 0xff, ecc->style->eccbytes);
+ *len = ecc->style->eccbytes;
+ break;
+ }
+}
+
+int main(int argc, char *argv[], char *envp[]) {
+ struct ecc_state_s ecc;
+ uint8_t buffer[0x1000], ecc_payload[0x40], regs[3], *jffs;
+ int ret, len, eccbyte, count, partition;
+
+ /* Check if we're called by "raw2flash.spitz" or similar */
+ len = strlen(argv[0]);
+ if (!strcasecmp(argv[0] + len - 5, "akita"))
+ ecc.style = &akita;
+ else if (!strcasecmp(argv[0] + len - 6, "borzoi"))
+ ecc.style = &borzoi;
+ else if (!strcasecmp(argv[0] + len - 7, "terrier"))
+ ecc.style = &terrier;
+ else
+ ecc.style = &spitz;
+
+# ifdef VERBOSE
+ fprintf(stderr, "[");
+# endif
+
+ /* Skip first 10 bytes */
+ TFR(read(0, buffer, 0x10));
+
+ len = 0;
+ jffs = (uint8_t *) malloc(PARTITION_START);
+ while (len < PARTITION_START) {
+ ret = TFR(read(0, jffs + len, PARTITION_START - len));
+ if (ret <= 0)
+ break;
+ len += ret;
+ }
+
+ /* Convert data from stdin */
+ partition = len = eccbyte = count = 0;
+ memset(ecc_payload, 0xff, ecc.style->oob_size);
+ jffs2_format(&ecc, ecc_payload);
+ while (count < ecc.style->romsize) {
+ buffer_fill(&ecc, buffer, &len, &partition, count, jffs);
+ buffer_digest(&ecc, buffer, regs);
+
+ ecc_payload[ecc.style->eccpos[eccbyte ++]] = regs[0];
+ ecc_payload[ecc.style->eccpos[eccbyte ++]] = regs[1];
+ ecc_payload[ecc.style->eccpos[eccbyte ++]] = regs[2];
+
+ TFR(write(1, buffer, ecc.style->eccbytes));
+ count += ecc.style->eccbytes;
+ len -= ecc.style->eccbytes;
+ memmove(buffer, buffer + ecc.style->eccbytes, len);
+
+ if (eccbyte >= ecc.style->eccsize) {
+ TFR(write(1, ecc_payload, ecc.style->oob_size));
+ eccbyte = 0;
+ memset(ecc_payload, 0xff, ecc.style->oob_size);
+ if (partition < 2)
+ jffs2_format(&ecc, ecc_payload);
+ }
+
+# ifdef VERBOSE
+ if (count * PBAR_LEN / ecc.style->romsize >
+ (count - ecc.style->eccbytes) *
+ PBAR_LEN / ecc.style->romsize)
+ fprintf(stderr, "#");
+# endif
+ }
+
+# ifdef VERBOSE
+ fprintf(stderr, "]\n");
+# endif
+ free(jffs);
+ return 0;
+}
+#else
+int main(int argc, char *argv[], char *envp[]) {
+ struct ecc_state_s ecc;
+ uint8_t buffer[0x1000];
+ int ret, len, count;
+
+ /* Check if we're called by "flash2raw.spitz" or similar */
+ len = strlen(argv[0]);
+ if (!strcasecmp(argv[0] + len - 5, "akita"))
+ ecc.style = &akita;
+ else if (!strcasecmp(argv[0] + len - 6, "borzoi"))
+ ecc.style = &borzoi;
+ else if (!strcasecmp(argv[0] + len - 7, "terrier"))
+ ecc.style = &terrier;
+ else
+ ecc.style = &spitz;
+
+# ifdef VERBOSE
+ fprintf(stderr, "[");
+# endif
+
+ /* Convert data from stdin */
+ count = 0;
+ while (count < ecc.style->romsize) {
+ len = 0;
+ while (len < ecc.style->page_size) {
+ ret = TFR(read(0, buffer + len,
+ ecc.style->page_size - len));
+ if (ret <= 0)
+ break;
+ len += ret;
+ }
+ if (len == 0)
+ break;
+ if (len < ecc.style->page_size) {
+ fprintf(stderr, "\nWarning: %i stray bytes\n", len);
+ }
+
+ TFR(write(1, buffer, ecc.style->page_size));
+
+ count += len;
+ len = 0;
+ while (len < ecc.style->oob_size) {
+ ret = TFR(read(0, buffer, ecc.style->oob_size - len));
+ if (ret <= 0)
+ break;
+ len += ret;
+ }
+
+# ifdef VERBOSE
+ if (count * PBAR_LEN / ecc.style->romsize >
+ (count - ecc.style->page_size) *
+ PBAR_LEN / ecc.style->romsize)
+ fprintf(stderr, "#");
+# endif
+ }
+
+# ifdef VERBOSE
+ fprintf(stderr, "]\n");
+# endif
+ return 0;
+}
+#endif
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-helper/tunctl.c b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-helper/tunctl.c
new file mode 100644
index 000000000..16e24a2ad
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-targets.inc b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-targets.inc
new file mode 100644
index 000000000..a3e46a894
--- /dev/null
+++ b/import-layers/yocto-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', True).split()
+ tos = d.getVar('HOST_OS', True)
+ 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/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu.inc b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu.inc
new file mode 100644
index 000000000..269c898c4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu.inc
@@ -0,0 +1,135 @@
+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 python"
+RDEPENDS_${PN}-ptest = "bash make"
+
+require qemu-targets.inc
+inherit autotools ptest
+BBCLASSEXTEND = "native nativesdk"
+
+PR = "r1"
+
+# QEMU_TARGETS is overridable variable
+QEMU_TARGETS ?= "arm aarch64 i386 mips mipsel mips64 mips64el ppc sh4 x86_64"
+
+SRC_URI = "\
+ file://powerpc_rom.bin \
+ file://disable-grabs.patch \
+ file://exclude-some-arm-EABI-obsolete-syscalls.patch \
+ file://wacom.patch \
+ file://add-ptest-in-makefile.patch \
+ file://run-ptest \
+ "
+
+SRC_URI_append_class-native = "\
+ file://fix-libcap-header-issue-on-some-distro.patch \
+ file://cpus.c-qemu_cpu_kick_thread_debugging.patch \
+ "
+
+EXTRA_OECONF += "--target-list=${@get_qemu_target_list(d)} --disable-werror --disable-bluez --disable-libiscsi --with-system-pixman --extra-cflags='${CFLAGS}'"
+
+EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disable-werror \
+ "
+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
+ # link with system dbus on Ubuntu 15.10
+ # FIXME: remove below 4 lines when oe dbus is upgraded
+ if [ -r /etc/lsb-release -a "$(lsb_release -is)$(lsb_release -rs)" = "Ubuntu15.10" ] ; then
+ libs=$(PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_PATH=$BHOST_PKGCONFIG_PATH PATH=/usr/bin:/bin pkg-config --libs dbus-1 || echo "")
+ [ -n "$libs" ] && export LDFLAGS="$libs $LDFLAGS"
+ fi
+ fi
+}
+
+KVMENABLE = "--enable-kvm"
+KVMENABLE_darwin = "--disable-kvm"
+KVMENABLE_mingw32 = "--disable-kvm"
+
+do_configure() {
+ # Handle distros such as CentOS 5 32-bit that do not have kvm support
+ KVMOPTS="--disable-kvm"
+ if [ "${PN}" != "qemu-native" -a "${PN}" != "nativesdk-qemu" ] \
+ || [ -f /usr/include/linux/kvm.h ] ; then
+ KVMOPTS="${KVMENABLE}"
+ fi
+
+ ${S}/configure --prefix=${prefix} --sysconfdir=${sysconfdir} --libexecdir=${libexecdir} --localstatedir=${localstatedir} --disable-strip ${EXTRA_OECONF} $KVMOPTS
+ test ! -e ${S}/target-i386/beginend_funcs.sh || chmod a+x ${S}/target-i386/beginend_funcs.sh
+}
+
+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 ${D}${PTEST_PATH}/tests
+}
+
+do_install () {
+ export STRIP="true"
+ autotools_do_install
+ install -d ${D}${datadir}/qemu
+ install -m 0755 ${WORKDIR}/powerpc_rom.bin ${D}${datadir}/qemu
+}
+
+# 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 \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'xen', 'xen', '', d)} \
+ "
+PACKAGECONFIG_class-native ??= "fdt alsa uuid"
+PACKAGECONFIG_class-nativesdk ??= "fdt sdl"
+NATIVEDEPS = ""
+NATIVEDEPS_class-native = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'libxext-native', '',d)}"
+PACKAGECONFIG[sdl] = "--enable-sdl,--disable-sdl,libsdl ${NATIVEDEPS},"
+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[uuid] = "--enable-uuid,--disable-uuid,util-linux,"
+PACKAGECONFIG[curses] = "--enable-curses,--disable-curses,ncurses,"
+PACKAGECONFIG[gtk+] = "--enable-gtk --enable-vte,--disable-gtk --disable-vte,gtk+ libvte,"
+PACKAGECONFIG[libcap-ng] = "--enable-cap-ng,--disable-cap-ng,libcap-ng,"
+PACKAGECONFIG[ssh2] = "--enable-libssh2,--disable-libssh2,libssh2,"
+PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,gcrypt,"
+PACKAGECONFIG[nettle] = "--enable-nettle,--disable-nettle,nettle"
+PACKAGECONFIG[libusb] = "--enable-libusb,--disable-libusb,libusb1"
+PACKAGECONFIG[fdt] = "--enable-fdt,--disable-fdt,dtc"
+PACKAGECONFIG[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"
+
+EXTRA_OECONF += "${@bb.utils.contains('PACKAGECONFIG', 'alsa', '--audio-drv-list=oss,alsa', '', d)}"
+
+INSANE_SKIP_${PN} = "arch"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-1568.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-1568.patch
new file mode 100644
index 000000000..56fd346ae
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-1568.patch
@@ -0,0 +1,46 @@
+From 4ab0359a8ae182a7ac5c99609667273167703fab Mon Sep 17 00:00:00 2001
+From: Prasad J Pandit <pjp@fedoraproject.org>
+Date: Mon, 11 Jan 2016 14:10:42 -0500
+Subject: [PATCH] ide: ahci: reset ncq object to unused on error
+
+When processing NCQ commands, AHCI device emulation prepares a
+NCQ transfer object; To which an aio control block(aiocb) object
+is assigned in 'execute_ncq_command'. In case, when the NCQ
+command is invalid, the 'aiocb' object is not assigned, and NCQ
+transfer object is left as 'used'. This leads to a use after
+free kind of error in 'bdrv_aio_cancel_async' via 'ahci_reset_port'.
+Reset NCQ transfer object to 'unused' to avoid it.
+
+[Maintainer edit: s/ACHI/AHCI/ in the commit message. --js]
+
+Reported-by: Qinghao Tang <luodalongde@gmail.com>
+Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
+Reviewed-by: John Snow <jsnow@redhat.com>
+Message-id: 1452282511-4116-1-git-send-email-ppandit@redhat.com
+Signed-off-by: John Snow <jsnow@redhat.com>
+
+Upstream-Status: Backport
+
+http://git.qemu.org/?p=qemu.git;a=commit;h=4ab0359a8ae182a7ac5c99609667273167703fab
+
+CVE: CVE-2016-1568
+[Yocto # 9013]
+
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ hw/ide/ahci.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+Index: qemu-2.5.0/hw/ide/ahci.c
+===================================================================
+--- qemu-2.5.0.orig/hw/ide/ahci.c
++++ qemu-2.5.0/hw/ide/ahci.c
+@@ -910,6 +910,7 @@ static void ncq_err(NCQTransferState *nc
+ ide_state->error = ABRT_ERR;
+ ide_state->status = READY_STAT | ERR_STAT;
+ ncq_tfs->drive->port_regs.scr_err |= (1 << ncq_tfs->tag);
++ ncq_tfs->used = 0;
+ }
+
+ static void ncq_finish(NCQTransferState *ncq_tfs)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-2197.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-2197.patch
new file mode 100644
index 000000000..946435c43
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-2197.patch
@@ -0,0 +1,59 @@
+From: Prasad J Pandit <address@hidden>
+
+When IDE AHCI emulation uses Frame Information Structures(FIS)
+engine for data transfer, the mapped FIS buffer address is stored
+in a static 'bounce.buffer'. When a request is made to map another
+memory region, address_space_map() returns NULL because
+'bounce.buffer' is in_use. It leads to a null pointer dereference
+error while doing 'dma_memory_unmap'. Add a check to avoid it.
+
+Reported-by: Zuozhi fzz <address@hidden>
+Signed-off-by: Prasad J Pandit <address@hidden>
+
+Upstream-Status: Backport
+https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg05740.html
+
+CVE: CVE-2016-2197
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ hw/ide/ahci.c | 16 ++++++++++------
+ 1 file changed, 10 insertions(+), 6 deletions(-)
+
+ Update as per review
+ -> https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg05715.html
+
+Index: qemu-2.5.0/hw/ide/ahci.c
+===================================================================
+--- qemu-2.5.0.orig/hw/ide/ahci.c
++++ qemu-2.5.0/hw/ide/ahci.c
+@@ -661,9 +661,11 @@ static bool ahci_map_fis_address(AHCIDev
+
+ static void ahci_unmap_fis_address(AHCIDevice *ad)
+ {
+- dma_memory_unmap(ad->hba->as, ad->res_fis, 256,
+- DMA_DIRECTION_FROM_DEVICE, 256);
+- ad->res_fis = NULL;
++ if (ad->res_fis) {
++ dma_memory_unmap(ad->hba->as, ad->res_fis, 256,
++ DMA_DIRECTION_FROM_DEVICE, 256);
++ ad->res_fis = NULL;
++ }
+ }
+
+ static bool ahci_map_clb_address(AHCIDevice *ad)
+@@ -677,9 +679,11 @@ static bool ahci_map_clb_address(AHCIDev
+
+ static void ahci_unmap_clb_address(AHCIDevice *ad)
+ {
+- dma_memory_unmap(ad->hba->as, ad->lst, 1024,
+- DMA_DIRECTION_FROM_DEVICE, 1024);
+- ad->lst = NULL;
++ if (ad->lst) {
++ dma_memory_unmap(ad->hba->as, ad->lst, 1024,
++ DMA_DIRECTION_FROM_DEVICE, 1024);
++ ad->lst = NULL;
++ }
+ }
+
+ static void ahci_write_fis_sdb(AHCIState *s, NCQTransferState *ncq_tfs)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-2198.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-2198.patch
new file mode 100644
index 000000000..f1201f061
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-2198.patch
@@ -0,0 +1,45 @@
+From: Prasad J Pandit <address@hidden>
+
+USB Ehci emulation supports host controller capability registers.
+But its mmio '.write' function was missing, which lead to a null
+pointer dereference issue. Add a do nothing 'ehci_caps_write'
+definition to avoid it; Do nothing because capability registers
+are Read Only(RO).
+
+Reported-by: Zuozhi Fzz <address@hidden>
+Signed-off-by: Prasad J Pandit <address@hidden>
+
+Upstream-Status: Backport
+https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg05899.html
+
+CVE: CVE-2016-2198
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ hw/usb/hcd-ehci.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+Index: qemu-2.5.0/hw/usb/hcd-ehci.c
+===================================================================
+--- qemu-2.5.0.orig/hw/usb/hcd-ehci.c
++++ qemu-2.5.0/hw/usb/hcd-ehci.c
+@@ -893,6 +893,11 @@ static uint64_t ehci_caps_read(void *ptr
+ return s->caps[addr];
+ }
+
++static void ehci_caps_write(void *ptr, hwaddr addr,
++ uint64_t val, unsigned size)
++{
++}
++
+ static uint64_t ehci_opreg_read(void *ptr, hwaddr addr,
+ unsigned size)
+ {
+@@ -2310,6 +2315,7 @@ static void ehci_frame_timer(void *opaqu
+
+ static const MemoryRegionOps ehci_mmio_caps_ops = {
+ .read = ehci_caps_read,
++ .write = ehci_caps_write,
+ .valid.min_access_size = 1,
+ .valid.max_access_size = 4,
+ .impl.min_access_size = 1,
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/Qemu-Arm-versatilepb-Add-memory-size-checking.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/Qemu-Arm-versatilepb-Add-memory-size-checking.patch
new file mode 100644
index 000000000..1a6cf5119
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/Qemu-Arm-versatilepb-Add-memory-size-checking.patch
@@ -0,0 +1,46 @@
+From 896fa02c24347e6e9259812cfda187b1d6ca6199 Mon Sep 17 00:00:00 2001
+From: Jiang Lu <lu.jiang@windriver.com>
+Date: Wed, 13 Nov 2013 10:38:08 +0800
+Subject: [PATCH] Qemu:Arm:versatilepb: Add memory size checking
+
+The machine can not work with memory over 256M, so add a checking
+at startup. If the memory size exceed 256M, just stop emulation then
+throw out warning about memory limitation.
+
+Upstream-Status: Pending
+
+Signed-off-by: Jiang Lu <lu.jiang@windriver.com>
+
+Updated it on 2014-01-15 for rebasing
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+Update it when upgrade qemu to 2.2.0
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
+---
+ hw/arm/versatilepb.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c
+index 6c69f4e..9278d90 100644
+--- a/hw/arm/versatilepb.c
++++ b/hw/arm/versatilepb.c
+@@ -204,6 +204,13 @@ static void versatile_init(MachineState *machine, int board_id)
+ exit(1);
+ }
+
++ if (machine->ram_size > (256 << 20)) {
++ fprintf(stderr,
++ "qemu: Too much memory for this machine: %d MB, maximum 256 MB\n",
++ ((unsigned int)ram_size / (1 << 20)));
++ exit(1);
++ }
++
+ cpuobj = object_new(object_class_get_name(cpu_oc));
+
+ /* By default ARM1176 CPUs have EL3 enabled. This board does not
+--
+2.1.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/add-ptest-in-makefile.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/add-ptest-in-makefile.patch
new file mode 100644
index 000000000..a99f72098
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/add-ptest-in-makefile.patch
@@ -0,0 +1,29 @@
+Upstream-Status: Pending
+
+Add subpackage -ptest which runs all unit test cases for qemu.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+ tests/Makefile | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/tests/Makefile b/tests/Makefile
+index 88f7105..3f40b4b 100644
+--- a/tests/Makefile
++++ b/tests/Makefile
+@@ -405,3 +405,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
++
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/configure-fix-Darwin-target-detection.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/configure-fix-Darwin-target-detection.patch
new file mode 100644
index 000000000..59cdc1c30
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/configure-fix-Darwin-target-detection.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Pending
+Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
+
+From 9ac096d8eccf2d56ece646320c282c8369f8337c Mon Sep 17 00:00:00 2001
+From: Cristian Iorga <cristian.iorga@intel.com>
+Date: Tue, 29 Jul 2014 18:35:59 +0300
+Subject: [PATCH] configure: fix Darwin target detection
+
+fix Darwin target detection for qemu
+cross-compilation.
+
+Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
+---
+ configure | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/configure b/configure
+index 283c71c..1c66a11 100755
+--- a/configure
++++ b/configure
+@@ -444,6 +444,8 @@ elif check_define __sun__ ; then
+ targetos='SunOS'
+ elif check_define __HAIKU__ ; then
+ targetos='Haiku'
++elif check_define __APPLE__ ; then
++ targetos='Darwin'
+ else
+ targetos=`uname -s`
+ fi
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/cpus.c-qemu_cpu_kick_thread_debugging.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/cpus.c-qemu_cpu_kick_thread_debugging.patch
new file mode 100644
index 000000000..682213254
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/disable-grabs.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/disable-grabs.patch
new file mode 100644
index 000000000..41726b1c8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/disable-grabs.patch
@@ -0,0 +1,72 @@
+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(-)
+
+diff --git a/ui/sdl.c b/ui/sdl.c
+index 39a42d6..9b8abe5 100644
+--- a/ui/sdl.c
++++ b/ui/sdl.c
+@@ -59,6 +59,10 @@ static SDL_Cursor *guest_sprite = NULL;
+ static SDL_PixelFormat host_format;
+ static int scaling_active = 0;
+ static Notifier mouse_mode_notifier;
++#ifndef True
++#define True 1
++#endif
++static doing_grabs = True;
+
+ static void sdl_update(DisplayChangeListener *dcl,
+ int x, int y, int w, int h)
+@@ -384,14 +388,16 @@ static void sdl_grab_start(void)
+ SDL_WarpMouse(guest_x, guest_y);
+ } 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();
+@@ -909,6 +915,8 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
+ * 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",
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/exclude-some-arm-EABI-obsolete-syscalls.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/exclude-some-arm-EABI-obsolete-syscalls.patch
new file mode 100644
index 000000000..171bda7e9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/exclude-some-arm-EABI-obsolete-syscalls.patch
@@ -0,0 +1,93 @@
+[PATCH] exclude some arm EABI obsolete syscalls
+
+Upstream-Status: Pending
+
+some syscalls are obsolete and no longer available for EABI, exclude them to
+fix the below error:
+ In file included from qemu-seccomp.c:16:0:
+ qemu-seccomp.c:28:7: error: '__NR_select' undeclared here (not in a function)
+ { SCMP_SYS(select), 252 },
+ ^
+ qemu-seccomp.c:36:7: error: '__NR_mmap' undeclared here (not in a function)
+ { SCMP_SYS(mmap), 247 },
+ ^
+ qemu-seccomp.c:57:7: error: '__NR_getrlimit' undeclared here (not in a function)
+ { SCMP_SYS(getrlimit), 245 },
+ ^
+ qemu-seccomp.c:96:7: error: '__NR_time' undeclared here (not in a function)
+ { SCMP_SYS(time), 245 },
+ ^
+ qemu-seccomp.c:185:7: error: '__NR_alarm' undeclared here (not in a function)
+ { SCMP_SYS(alarm), 241 },
+
+please refer source files:
+ arch/arm/include/uapi/asm/unistd.h
+or kernel header:
+ /usr/include/asm/unistd.h
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ qemu-seccomp.c | 14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/qemu-seccomp.c b/qemu-seccomp.c
+index caa926e..5a78502 100644
+--- a/qemu-seccomp.c
++++ b/qemu-seccomp.c
+@@ -25,15 +25,21 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
+ { SCMP_SYS(timer_settime), 255 },
+ { SCMP_SYS(timer_gettime), 254 },
+ { SCMP_SYS(futex), 253 },
++#if !defined(__ARM_EABI__)
+ { SCMP_SYS(select), 252 },
++ { SCMP_SYS(time), 245 },
++ { SCMP_SYS(alarm), 241 },
++ { SCMP_SYS(getrlimit), 245 },
++ { SCMP_SYS(mmap), 247 },
++ { SCMP_SYS(socketcall), 250 },
++ { SCMP_SYS(ipc), 245 },
++#endif
+ { SCMP_SYS(recvfrom), 251 },
+ { SCMP_SYS(sendto), 250 },
+- { SCMP_SYS(socketcall), 250 },
+ { SCMP_SYS(read), 249 },
+ { SCMP_SYS(io_submit), 249 },
+ { SCMP_SYS(brk), 248 },
+ { SCMP_SYS(clone), 247 },
+- { SCMP_SYS(mmap), 247 },
+ { SCMP_SYS(mprotect), 246 },
+ { SCMP_SYS(execve), 245 },
+ { SCMP_SYS(open), 245 },
+@@ -48,13 +54,11 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
+ { SCMP_SYS(bind), 245 },
+ { SCMP_SYS(listen), 245 },
+ { SCMP_SYS(semget), 245 },
+- { SCMP_SYS(ipc), 245 },
+ { SCMP_SYS(gettimeofday), 245 },
+ { SCMP_SYS(readlink), 245 },
+ { SCMP_SYS(access), 245 },
+ { SCMP_SYS(prctl), 245 },
+ { SCMP_SYS(signalfd), 245 },
+- { SCMP_SYS(getrlimit), 245 },
+ { SCMP_SYS(set_tid_address), 245 },
+ { SCMP_SYS(statfs), 245 },
+ { SCMP_SYS(unlink), 245 },
+@@ -93,7 +97,6 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
+ { SCMP_SYS(times), 245 },
+ { SCMP_SYS(exit), 245 },
+ { SCMP_SYS(clock_gettime), 245 },
+- { SCMP_SYS(time), 245 },
+ { SCMP_SYS(restart_syscall), 245 },
+ { SCMP_SYS(pwrite64), 245 },
+ { SCMP_SYS(nanosleep), 245 },
+@@ -182,7 +185,6 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
+ { SCMP_SYS(lstat64), 241 },
+ { SCMP_SYS(sendfile64), 241 },
+ { SCMP_SYS(ugetrlimit), 241 },
+- { SCMP_SYS(alarm), 241 },
+ { SCMP_SYS(rt_sigsuspend), 241 },
+ { SCMP_SYS(rt_sigqueueinfo), 241 },
+ { SCMP_SYS(rt_tgsigqueueinfo), 241 },
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/fix-libcap-header-issue-on-some-distro.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/fix-libcap-header-issue-on-some-distro.patch
new file mode 100644
index 000000000..13a6ea23b
--- /dev/null
+++ b/import-layers/yocto-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 "virtio-9p-marshal.h"
+ #include "hw/9pfs/virtio-9p-proxy.h"
+ #include "fsdev/virtio-9p-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/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/no-valgrind.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/no-valgrind.patch
new file mode 100644
index 000000000..91f728042
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/pathlimit.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/pathlimit.patch
new file mode 100644
index 000000000..57ab981c6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/powerpc_rom.bin b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/powerpc_rom.bin
new file mode 100644
index 000000000..c4044296c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/powerpc_rom.bin
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/qemu-enlarge-env-entry-size.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/qemu-enlarge-env-entry-size.patch
new file mode 100644
index 000000000..c7425ab8d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/run-ptest b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/run-ptest
new file mode 100644
index 000000000..f4b8e97e1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/run-ptest
@@ -0,0 +1,8 @@
+#!/bin/sh
+#
+#This script is used to run qemu test suites
+ptestdir=$(pwd)
+cd tests
+
+export SRC_PATH=$ptestdir
+make -k runtest-TESTS | sed '/: OK/ s/^/PASS: /g'
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/wacom.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/wacom.patch
new file mode 100644
index 000000000..cd06aa4ac
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu_2.5.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu_2.5.0.bb
new file mode 100644
index 000000000..e9d9a8dce
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu_2.5.0.bb
@@ -0,0 +1,24 @@
+require qemu.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
+ file://COPYING.LIB;endline=24;md5=c04def7ae38850e7d3ef548588159913"
+
+SRC_URI += "file://configure-fix-Darwin-target-detection.patch \
+ file://qemu-enlarge-env-entry-size.patch \
+ file://Qemu-Arm-versatilepb-Add-memory-size-checking.patch \
+ file://no-valgrind.patch \
+ file://CVE-2016-1568.patch \
+ file://CVE-2016-2197.patch \
+ file://CVE-2016-2198.patch \
+ file://pathlimit.patch \
+ "
+SRC_URI_prepend = "http://wiki.qemu-project.org/download/${BP}.tar.bz2"
+SRC_URI[md5sum] = "f469f2330bbe76e3e39db10e9ac4f8db"
+SRC_URI[sha256sum] = "3443887401619fe33bfa5d900a4f2d6a79425ae2b7e43d5b8c36eb7a683772d4"
+
+COMPATIBLE_HOST_class-target_mips64 = "null"
+
+do_install_append() {
+ # Prevent QA warnings about installed ${localstatedir}/run
+ if [ -d ${D}${localstatedir}/run ]; then rmdir ${D}${localstatedir}/run; fi
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb
new file mode 100644
index 000000000..7f4c6d934
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb
@@ -0,0 +1,50 @@
+SUMMARY = "QEMU wrapper script"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+S = "${WORKDIR}"
+
+inherit qemu
+
+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_PREPROCESS_FUNCS += "qemuwrapper_sysroot_preprocess"
+
+qemuwrapper_sysroot_preprocess () {
+ sysroot_stage_dir ${D}${bindir_crossscripts} ${SYSROOT_DESTDIR}${bindir_crossscripts}
+}
+
+INHIBIT_DEFAULT_DEPS = "1"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt-native.inc b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt-native.inc
new file mode 100644
index 000000000..5c4b0a217
--- /dev/null
+++ b/import-layers/yocto-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 = "--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/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt-native_0.64.bb b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt-native_0.64.bb
new file mode 100644
index 000000000..6bc7dcdb7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt-native_0.64.bb
@@ -0,0 +1,2 @@
+require quilt.inc
+require quilt-native.inc
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt.inc b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt.inc
new file mode 100644
index 000000000..4e393c4d8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt.inc
@@ -0,0 +1,64 @@
+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://install.patch \
+ file://run-ptest \
+ file://Makefile \
+ file://test.sh \
+"
+
+SRC_URI[md5sum] = "fc0310db5868a0873d602d4332a76d43"
+SRC_URI[sha256sum] = "c4bfd3282214a288e8d3e921ae4d52e73e24c4fead72b5446752adee99a7affd"
+
+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}"
+
+CACHED_CONFIGUREVARS += "ac_cv_path_BASH=/bin/bash"
+
+# 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 -cf - bin/ --exclude \*.in | ( cd ${D}${PTEST_PATH} && tar -xf - )
+ tar -cf - compat/ --exclude \*.in | ( cd ${D}${PTEST_PATH} && tar -xf - )
+ tar -cf - quilt/ --exclude \*.in | ( cd ${D}${PTEST_PATH} && tar -xf - )
+ tar -cf - test/ --exclude mail.test --exclude delete.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/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/Makefile b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/Makefile
new file mode 100644
index 000000000..7b3ac8a49
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/aclocal.patch b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/aclocal.patch
new file mode 100644
index 000000000..daf44295e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/aclocal.patch
@@ -0,0 +1,128 @@
+Upstream-Status: Pending
+
+Add the aclocal.m4 as acinclude.m4
+
+Index: quilt-0.47/acinclude.m4
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ quilt-0.47/acinclude.m4 2006-10-10 17:05:56.000000000 +0100
+@@ -0,0 +1,119 @@
++dnl Allow configure to specify a specific binary
++dnl 1: Environment variable
++dnl 2: binary name
++dnl 3: optional list of alternative binary names
++dnl 4: optional list of additional search directories
++AC_DEFUN([QUILT_COMPAT_PROG_PATH],[
++ m4_define([internal_$2_cmd],[esyscmd(ls compat/$2.in 2>/dev/null)])
++
++ AC_ARG_WITH($2, AC_HELP_STRING(
++ [--with-$2], [name of the $2 executable to use]
++ m4_if(internal_$2_cmd,[],[],[ (use --without-$2
++ to use an internal mechanism)])),
++ [
++ if test x"$withval" = xnone; then
++ AC_MSG_ERROR([Invalid configure argument. use --without-$2])
++ fi
++ if test x"$withval" != xno; then
++ AC_MSG_CHECKING(for $2)
++ $1="$withval"
++ if test -e "$$1"; then
++ if test ! -f "$$1" -a ! -h "$$1" || test ! -x "$$1"; then
++ AC_MSG_ERROR([$$1 is not an executable file])
++ fi
++ fi
++ AC_MSG_RESULT([$$1])
++ if test ! -e "$$1"; then
++ AC_MSG_WARN([$$1 does not exist])
++ fi
++ COMPAT_SYMLINKS="$COMPAT_SYMLINKS $2"
++ fi
++ ],[
++ m4_if([$3],[],[
++ AC_PATH_PROG($1,$2,,$PATH:$4)
++ ],[
++ AC_PATH_PROGS($1,$3,,$PATH:$4)
++ if test -n "$$1" -a "`expr "$$1" : '.*/\([[^/]]*\)$'`" != "$2"; then
++ COMPAT_SYMLINKS="$COMPAT_SYMLINKS $2"
++ fi
++ ])
++ m4_if([$4],[],[],[
++ if test -n "$$1"; then
++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++ for dir in "$4"; do
++ if test "`dirname $$1`" = "$dir"; then
++ COMPAT_SYMLINKS="$COMPAT_SYMLINKS $2"
++ break
++ fi
++ done
++ IFS="$as_save_IFS"
++ fi
++ ])
++ ])
++ if test -z "$$1"; then
++ m4_if(internal_$2_cmd,[],[
++ AC_MSG_ERROR([Please specify the location of $2 with the option '--with-$2'])
++ ],[
++ AC_MSG_WARN([Using internal $2 mechanism. Use option '--with-$2' to override])
++ COMPAT_PROGRAMS="$COMPAT_PROGRAMS $2"
++ $1=$2
++ INTERNAL_$1=1
++ ])
++ fi
++ AC_SUBST($1)
++])
++
++dnl Allow configure to specify a specific binary
++dnl This variant is for optional binaries.
++dnl 1: Environment variable
++dnl 2: binary name
++dnl 3: optional list of alternative binary names
++dnl 4: optional list of additional search directories
++AC_DEFUN([QUILT_COMPAT_PROG_PATH_OPT],[
++ AC_ARG_WITH($2, AC_HELP_STRING(
++ [--with-$2], [name of the $2 executable to use]),
++ [
++ if test x"$withval" != xno; then
++ AC_MSG_CHECKING(for $2)
++ $1="$withval"
++ if test -e "$$1"; then
++ if test ! -f "$$1" -a ! -h "$$1" || test ! -x "$$1"; then
++ AC_MSG_ERROR([$$1 is not an executable file])
++ fi
++ fi
++ AC_MSG_RESULT([$$1])
++ if test ! -e "$$1"; then
++ AC_MSG_WARN([$$1 does not exist])
++ fi
++ COMPAT_SYMLINKS="$COMPAT_SYMLINKS $2"
++ fi
++ ],[
++ m4_if([$3],[],[
++ AC_PATH_PROG($1,$2,,$PATH:$4)
++ ],[
++ AC_PATH_PROGS($1,$3,,$PATH:$4)
++ if test -n "$$1" -a "`expr "$$1" : '.*/\([[^/]]*\)$'`" != "$2"; then
++ COMPAT_SYMLINKS="$COMPAT_SYMLINKS $2"
++ fi
++ ])
++ m4_if([$4],[],[],[
++ if test -n "$$1"; then
++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++ for dir in "$4"; do
++ if test "`dirname $$1`" = "$dir"; then
++ COMPAT_SYMLINKS="$COMPAT_SYMLINKS $2"
++ break
++ fi
++ done
++ IFS="$as_save_IFS"
++ fi
++ ])
++ if test -z "$$1"; then
++ AC_MSG_WARN([$2 not found, some optional functionalities will be missing])
++ fi
++ ])
++ if test -z "$$1"; then
++ $1=$2
++ fi
++ AC_SUBST($1)
++])
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/gnu_patch_test_fix_target.patch b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/gnu_patch_test_fix_target.patch
new file mode 100644
index 000000000..672155bb6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/install.patch b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/install.patch
new file mode 100644
index 000000000..e2a7af655
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/install.patch
@@ -0,0 +1,13 @@
+Upstream-Status: Pending
+
+--- quilt-0.47/Makefile.in 2008-12-31 19:09:13.000000000 +0000
++++ quilt-0.47/Makefile.in.orig 2008-08-21 13:21:32.000000000 +0100
+@@ -13,7 +13,7 @@
+ mandir := @mandir@
+ localedir := $(datadir)/locale
+ emacsdir := $(datadir)/emacs/site-lisp
+-etcdir := $(subst /usr/etc,/etc,$(prefix)/etc)
++etcdir := @sysconfdir@
+
+ INSTALL := @INSTALL@
+ POD2MAN := @POD2MAN@
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/run-ptest b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/run-ptest
new file mode 100755
index 000000000..4b808aee4
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/test.sh b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/test.sh
new file mode 100755
index 000000000..6563e4a2f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt_0.64.bb b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt_0.64.bb
new file mode 100644
index 000000000..00f900a11
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt_0.64.bb
@@ -0,0 +1,16 @@
+require quilt.inc
+inherit gettext
+RDEPENDS_${PN} += "patch diffstat bzip2 util-linux"
+SRC_URI += "file://aclocal.patch \
+ file://gnu_patch_test_fix_target.patch \
+ "
+
+# fix build-distro specific perl path in the target perl scripts
+do_install_append() {
+ for perlscript in ${D}${datadir}/quilt/scripts/remove-trailing-ws ${D}${datadir}/quilt/scripts/dependency-graph ${D}${datadir}/quilt/scripts/edmail ${D}${bindir}/guards
+ do
+ if [ -f $perlscript ]; then
+ sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' $perlscript
+ fi
+ done
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/remake/remake.inc b/import-layers/yocto-poky/meta/recipes-devtools/remake/remake.inc
new file mode 100644
index 000000000..df889fcf9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/remake/remake.inc
@@ -0,0 +1,16 @@
+SUMMARY = "Makefile debugger which is gnumake compatible"
+DESCRIPTION = "remake is a patched and modernized version of GNU make \
+utility that adds improved error reporting, the ability to trace \
+execution in a comprehensible way, and a debugger."
+
+HOMEPAGE = "http://bashdb.sourceforge.net/remake/"
+SECTION = "devel"
+
+SRC_URI = "git://github.com/rocky/remake.git"
+
+inherit autotools gettext update-alternatives pkgconfig
+
+ALTERNATIVE_${PN} = "make"
+ALTERNATIVE_LINK_NAME[make] = "${bindir}/make"
+ALTERNATIVE_TARGET[make] = "${bindir}/remake"
+ALTERNATIVE_PRIORITY = "100"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/remake/remake/version-remake.texi.patch b/import-layers/yocto-poky/meta/recipes-devtools/remake/remake/version-remake.texi.patch
new file mode 100644
index 000000000..fa6329e06
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/remake/remake/version-remake.texi.patch
@@ -0,0 +1,16 @@
+Upstream-Status: Pending
+
+version-remake.texi is not there but it is required by remake.texi,
+just add it for getting the 'make remake.info' works.
+
+==============================================================
+diff --git a/doc/version-remake.texi b/doc/version-remake.texi
+new file mode 100644
+index 0000000..2a3b72b
+--- /dev/null
++++ b/doc/version-remake.texi
+@@ -0,0 +1,4 @@
++@set UPDATED 10 June 2012
++@set UPDATED-MONTH June 2012
++@set EDITION 3.82+dbg-0.9git
++@set VERSION 3.82+dbg-0.9git
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/remake/remake_4.1+dbg-1.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/remake/remake_4.1+dbg-1.1.bb
new file mode 100644
index 000000000..8eab7e3a0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/remake/remake_4.1+dbg-1.1.bb
@@ -0,0 +1,28 @@
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://tests/COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://glob/COPYING.LIB;md5=4a770b67e6be0f60da244beb2de0fce4"
+require remake.inc
+
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+)\+dbg.+)"
+SRC_URI += "file://version-remake.texi.patch \
+ "
+SRCREV = "cf54641d50a0165bb17622b3e9770f426ccbc561"
+S = "${WORKDIR}/git"
+
+DEPENDS += "readline guile"
+# Need to add "gettext-native" dependency to remake-native.
+# By default only "gettext-minimal-native" is added
+# when inherit gettext.
+DEPENDS_class-native += "gettext-native"
+PROVIDES += "virtual/make"
+
+do_configure_prepend() {
+ # remove the default LINGUAS since we are not going to generate languages
+ rm ${S}/po/LINGUAS
+ touch ${S}/po/LINGUAS
+ # create config.rpath which required by configure.ac
+ ( cd ${S}; autopoint || touch config.rpath )
+}
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-Disable-__sync_add_and_fetch_8-on-nios2.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-Disable-__sync_add_and_fetch_8-on-nios2.patch
new file mode 100644
index 000000000..e9b73b8bf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-Disable-__sync_add_and_fetch_8-on-nios2.patch
@@ -0,0 +1,30 @@
+From 06967a50f20095f5ca30b8214f4c98ba0f5262bf Mon Sep 17 00:00:00 2001
+From: Marek Vasut <marex@denx.de>
+Date: Sun, 3 Apr 2016 06:55:25 +0200
+Subject: [PATCH] Disable __sync_add_and_fetch_8 on nios2
+
+The NIOS2 softcore does not implement the __sync_add_and_fetch_8,
+so disable it accordingly.
+
+Signed-off-by: Marek Vasut <marex@denx.de>
+Upstream-Status: Submitted
+---
+ rpmio/bson.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/rpmio/bson.h b/rpmio/bson.h
+index 57023f1..60c7d02 100644
+--- a/rpmio/bson.h
++++ b/rpmio/bson.h
+@@ -880,7 +880,7 @@ BSON_END_DECLS
+ BSON_BEGIN_DECLS
+
+ /* Some architectures do not support __sync_add_and_fetch_8 */
+-#if (__mips == 32) || (defined(__PPC__) && !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8))
++#if (__mips == 32) || (__nios2__) || (defined(__PPC__) && !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8))
+ # define __BSON_NEED_ATOMIC_64 1
+ #endif
+
+--
+2.8.0.rc3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-define-EM_AARCH64.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-define-EM_AARCH64.patch
new file mode 100644
index 000000000..c9fb26868
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-define-EM_AARCH64.patch
@@ -0,0 +1,35 @@
+[PATCH] define EM_AARCH64
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+EM_AARCH64 maybe not be defined due to old version elf.h, and lead to
+that debugedit can not work on aarch64 elf object files, since there is
+no other dependence, except these two macro, define them to make
+debugedit work on aarch64 elf files.
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ tools/debugedit.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/tools/debugedit.c b/tools/debugedit.c
+index de693ed..d16a641 100644
+--- a/tools/debugedit.c
++++ b/tools/debugedit.c
+@@ -35,6 +35,13 @@
+
+ #include <gelf.h>
+
++#ifndef EM_AARCH64
++#define EM_AARCH64 183 /* ARM AARCH64 */
++#endif
++#ifndef R_AARCH64_ABS32
++#define R_AARCH64_ABS32 258
++#endif
++
+ /* some defines taken from the dwarf standard */
+
+ #define DW_TAG_compile_unit 0x11
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-rpm-Fix-build-on-musl.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-rpm-Fix-build-on-musl.patch
new file mode 100644
index 000000000..70dd4ff53
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-rpm-Fix-build-on-musl.patch
@@ -0,0 +1,294 @@
+From 0af17c2ae86c1e8e42b96f6dface08f535bb55ad Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 14 Feb 2016 08:33:24 +0000
+Subject: [PATCH] rpm: Fix build on musl
+
+Provide alternatives to assumptions about glibc
+on linux
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Updated to 5.4.16 (CVS)
+
+The patch will likely need additional rework before it can be accepted upsteam
+due to the way MUSL changes are patched in.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+---
+Upstream-Status: Pending
+
+ lib/poptALL.c | 2 ++
+ rpmio/fts.c | 4 ++++
+ rpmio/poptIO.c | 2 ++
+ rpmqv.c | 2 ++
+ system.h | 13 ++++++-------
+ tools/debugedit.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++
+ tools/rpm2cpio.c | 2 ++
+ tools/rpmcache.c | 2 ++
+ tools/rpmcmp.c | 2 ++
+ tools/rpmdeps-oecore.c | 2 ++
+ tools/rpmdeps.c | 2 ++
+ tools/rpmdigest.c | 2 ++
+ tools/rpmfind.c | 6 +++---
+ 13 files changed, 78 insertions(+), 10 deletions(-)
+
+Index: rpm-5.4.15/rpmio/fts.c
+===================================================================
+--- rpm-5.4.15.orig/rpmio/fts.c
++++ rpm-5.4.15/rpmio/fts.c
+@@ -124,6 +124,10 @@ static char sccsid[] = "@(#)fts.c 8.6 (B
+ # define __fxstat64(_stat_ver, _fd, _sbp) fstat((_fd), (_sbp))
+ #endif
+
++#ifndef _STAT_VER
++# define _STAT_VER 0
++#endif
++
+ #if !defined(_D_EXACT_NAMLEN)
+ # define _D_EXACT_NAMLEN(d) (strlen((d)->d_name))
+ #endif
+Index: rpm-5.4.15/tools/debugedit.c
+===================================================================
+--- rpm-5.4.15.orig/tools/debugedit.c
++++ rpm-5.4.15/tools/debugedit.c
+@@ -22,7 +22,12 @@
+ #include <byteswap.h>
+ #include <endian.h>
+ #include <errno.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#else
++#include <stdarg.h>
++void error(int, int, const char *, ...);
++#endif
+ #include <limits.h>
+ #include <string.h>
+ #include <stdlib.h>
+@@ -1535,6 +1540,48 @@ handle_build_id (DSO *dso, Elf_Data *bui
+ puts (hex);
+ }
+ }
++#ifndef __GLIBC__
++extern char *__progname;
++
++void (*error_print_progname)(void) = 0;
++unsigned int error_message_count = 0;
++int error_one_per_line = 0;
++
++static void eprint(int status, int e, const char *file, unsigned int line, const char *fmt, va_list ap)
++{
++ if (file && error_one_per_line) {
++ static const char *oldfile;
++ static unsigned int oldline;
++ if (line == oldline && strcmp(file, oldfile) == 0)
++ return;
++ oldfile = file;
++ oldline = line;
++ }
++ if (error_print_progname)
++ error_print_progname();
++ else
++ fprintf(stderr, "%s: ", __progname);
++ if (file)
++ fprintf(stderr, "%s:%u: ", file, line);
++ vfprintf(stderr, fmt, ap);
++ if (e)
++ fprintf(stderr, ": %s", strerror(e));
++ putc('\n', stderr);
++ fflush(stderr);
++ error_message_count++;
++ if (status)
++ exit(status);
++}
++
++void error(int status, int e, const char *fmt, ...)
++{
++ va_list ap;
++ va_start(ap,fmt);
++ eprint(status, e, 0, 0, fmt, ap);
++ va_end(ap);
++}
++
++#endif
+
+ /* It avoided the segment fault while file's bss offset have a large number.
+ See https://bugzilla.redhat.com/show_bug.cgi?id=1019707
+Index: rpm-5.4.15/tools/rpmfind.c
+===================================================================
+--- rpm-5.4.15.orig/tools/rpmfind.c
++++ rpm-5.4.15/tools/rpmfind.c
+@@ -1175,7 +1175,7 @@ find_parsenum(PLAN *plan, const char *op
+ * and endchar points to the beginning of the string we know we have
+ * a syntax error.
+ */
+-#if defined(__sun)
++#if defined(__sun) || !defined(__GLIBC_)
+ value = strtoll(str, &endchar, 10);
+ #else
+ value = strtoq(str, &endchar, 10);
+@@ -1215,7 +1215,7 @@ find_parsetime(PLAN *plan, const char *o
+ break;
+ }
+
+-#if defined(__sun)
++#if defined(__sun) || !defined(__GLIBC_)
+ value = strtoll(str, &unit, 10);
+ #else
+ value = strtoq(str, &unit, 10);
+@@ -1253,7 +1253,7 @@ find_parsetime(PLAN *plan, const char *o
+ str = unit + 1;
+ if (*str == '\0') /* EOS */
+ break;
+-#if defined(__sun)
++#if defined(__sun) || !defined(__GLIBC_)
+ value = strtoll(str, &unit, 10);
+ #else
+ value = strtoq(str, &unit, 10);
+Index: rpm-5.4.15/system.h
+===================================================================
+--- rpm-5.4.15.orig/system.h
++++ rpm-5.4.15/system.h
+@@ -372,16 +372,15 @@ extern int _tolower(int) __THROW /*@*/;
+ #define __progname __assert_program_name
+ #endif
+ #define setprogname(pn)
++/*@unchecked@*/
++extern const char *__progname;
+ #else
+-#define __progname program_name
+-#define setprogname(pn) \
+- { if ((__progname = strrchr(pn, '/')) != NULL) __progname++; \
+- else __progname = pn; \
+- }
+-#endif
++#define setprogname(pn)
++#define progname __progname
+
+ /*@unchecked@*/
+-extern const char *__progname;
++extern char *__progname;
++#endif
+
+ /* -- Retrofit missing prototypes (if needed). */
+ #ifdef __cplusplus
+Index: rpm-5.4.15/rpmio/poptIO.c
+===================================================================
+--- rpm-5.4.15.orig/rpmio/poptIO.c
++++ rpm-5.4.15/rpmio/poptIO.c
+@@ -65,7 +65,9 @@ extern int _rpmsvn_debug;
+ GENfree(rpmioP)
+ #endif /* __cplusplus */
+
++#ifdef __GLIBC__
+ const char *__progname;
++#endif
+
+ #if !defined(POPT_ARGFLAG_TOGGLE) /* XXX compat with popt < 1.15 */
+ #define POPT_ARGFLAG_TOGGLE 0
+Index: rpm-5.4.15/lib/poptALL.c
+===================================================================
+--- rpm-5.4.15.orig/lib/poptALL.c
++++ rpm-5.4.15/lib/poptALL.c
+@@ -4,7 +4,9 @@
+ */
+
+ #include "system.h"
++#ifdef __GLIBC__
+ extern const char *__progname;
++#endif
+
+ #if defined(RPM_VENDOR_WINDRIVER)
+ const char *__usrlibrpm = USRLIBRPM;
+Index: rpm-5.4.15/tools/rpm2cpio.c
+===================================================================
+--- rpm-5.4.15.orig/tools/rpm2cpio.c
++++ rpm-5.4.15/tools/rpm2cpio.c
+@@ -1,7 +1,9 @@
+ /* rpmarchive: spit out the main archive portion of a package */
+
+ #include "system.h"
++#ifdef __GLIBC__
+ const char *__progname;
++#endif
+
+ #include <rpmio.h>
+ #include <rpmiotypes.h> /* XXX fnpyKey */
+Index: rpm-5.4.15/tools/rpmcache.c
+===================================================================
+--- rpm-5.4.15.orig/tools/rpmcache.c
++++ rpm-5.4.15/tools/rpmcache.c
+@@ -3,7 +3,9 @@
+ */
+
+ #include "system.h"
++#ifdef __GLIBC__
+ const char *__progname;
++#endif
+
+ #include <fnmatch.h>
+ #include <fts.h>
+Index: rpm-5.4.15/tools/rpmdeps-oecore.c
+===================================================================
+--- rpm-5.4.15.orig/tools/rpmdeps-oecore.c
++++ rpm-5.4.15/tools/rpmdeps-oecore.c
+@@ -1,5 +1,7 @@
+ #include "system.h"
++#ifdef __GLIBC__
+ const char *__progname;
++#endif
+
+ #include <rpmio.h>
+ #include <rpmiotypes.h>
+Index: rpm-5.4.15/tools/rpmdeps.c
+===================================================================
+--- rpm-5.4.15.orig/tools/rpmdeps.c
++++ rpm-5.4.15/tools/rpmdeps.c
+@@ -1,5 +1,7 @@
+ #include "system.h"
++#ifdef __GLIBC__
+ const char *__progname;
++#endif
+
+ #include <rpmio.h>
+ #include <rpmiotypes.h>
+Index: rpm-5.4.15/tools/rpmdigest.c
+===================================================================
+--- rpm-5.4.15.orig/tools/rpmdigest.c
++++ rpm-5.4.15/tools/rpmdigest.c
+@@ -1,6 +1,8 @@
+ #include "system.h"
++#ifdef __GLIBC__
+ /*@unchecked@*/
+ extern const char * __progname;
++#endif
+
+ #define _RPMIOB_INTERNAL
+ #include <rpmiotypes.h>
+Index: rpm-5.4.15/tools/rpmcmp.c
+===================================================================
+--- rpm-5.4.15.orig/tools/rpmcmp.c
++++ rpm-5.4.15/tools/rpmcmp.c
+@@ -13,8 +13,10 @@
+
+ #include "debug.h"
+
++#ifdef __GLIBC__
+ const char *__progname;
+ #define progname __progname
++#endif
+
+ static int pointRpmEVR(ARGV_t av)
+ {
+Index: rpm-5.4.15/rpmqv.c
+===================================================================
+--- rpm-5.4.15.orig/rpmqv.c
++++ rpm-5.4.15/rpmqv.c
+@@ -1,5 +1,7 @@
+ #include "system.h"
++#ifdef __GLIBC__
+ extern const char *__progname;
++#endif
+
+ /* Copyright (C) 1998-2002 - Red Hat, Inc. */
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch
new file mode 100644
index 000000000..712825009
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch
@@ -0,0 +1,49 @@
+From 64851c6622aff64787a9fcea26cccde183b7c743 Mon Sep 17 00:00:00 2001
+From: "Roy.Li" <rongqing.li@windriver.com>
+Date: Tue, 11 Nov 2014 16:28:22 +0800
+Subject: [PATCH] using poptParseArgvString to parse the
+ _gpg_check_password_cmd
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Both __gpg_check_password_cmd and __gpg_sign_cmd include "%{_gpg_name}", but
+strace shows that gpg_name has a quote when run _gpg_check_password,
+but not when run __gpg_sign_cmd; for example, if gpg_name is "tester"
+
+ execve("/usr/bin/gpg", ["gpg", "--batch", "--no-verbose",
+ "--passphrase-fd", "3", "-u", "\"tester\"", "-so", "-"], [/* 20 vars */]) = 0
+
+ execve("/usr/bin/gpg", ["gpg", "--batch", "--no-verbose", "--no-armor",
+ "--passphrase-fd", "3", "--no-secmem-warning", "-u", "tester", "-sbo"..,) = 0
+
+it can be fixed by removing the quote around %{gpg_name} when define
+__gpg_check_password_cmd in macros/macros, like below, but if gpg_name includes
+space, it will not work.
+
+ %__gpg_check_password_cmd %{__gpg} \
+ gpg --batch --no-verbose --passphrase-fd 3 -u %{_gpg_name} -so -
+
+The poptParseArgvString function is used to parse _gpg_sign_cmd, so using
+poptParseArgvString to parse __gpg_check_password_cmd to fix this issue.
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ rpmdb/signature.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/rpmdb/signature.c b/rpmdb/signature.c
+index c35e0ab..016e8d1 100644
+--- a/rpmdb/signature.c
++++ b/rpmdb/signature.c
+@@ -529,7 +529,7 @@ int rpmCheckPassPhrase(const char * passPhrase)
+ (void) setenv("GNUPGHOME", gpg_path, 1);
+
+ cmd = rpmExpand("%{?__gpg_check_password_cmd}", NULL);
+- rc = argvSplit(&av, cmd, NULL);
++ rc = poptParseArgvString(cmd, NULL, (const char ***)&av);
+ if (!rc)
+ rc = execve(av[0], (char *const *)av+1, environ);
+
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/configure.ac-check-for-both-gpg2-and-gpg.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/configure.ac-check-for-both-gpg2-and-gpg.patch
new file mode 100644
index 000000000..7894a4263
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/configure.ac-check-for-both-gpg2-and-gpg.patch
@@ -0,0 +1,29 @@
+configure.ac: search for both gpg2 and gpg
+
+On some platforms the GnuPG binary is named 'gpg2' whereas others have 'gpg'.
+This patch increases compatibility by searching for 'gpg' in addition to
+'gpg2'.
+
+Upstream-Status: Pending
+
+Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 6746b4c..f6922ae 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -562,7 +562,7 @@ AC_PATH_PROG(__DIFF, diff, /bin/diff, $MYPATH)
+ AC_PATH_PROG(__DITTO, ditto, %{_bindir}/ditto, $MYPATH)
+ AC_PATH_PROG(__FILE, file, %{_bindir}/file, $MYPATH)
+ AC_PATH_PROG(__GIT, git, %{_bindir}/git, $MYPATH)
+-AC_PATH_PROG(__GPG, gpg2, %{_bindir}/gpg2, $MYPATH)
++AC_PATH_PROGS(__GPG, [gpg2 gpg], %{_bindir}/gpg2, $MYPATH)
+ AC_PATH_PROG(__GSR, gsr, %{_bindir}/gsr, $MYPATH)
+ AC_PATH_PROG(__GST_INSPECT, gst-inspect-0.10, %{_bindir}/gst-inspect-0.10, $MYPATH)
+ AC_PATH_PROG(__GZIP, gzip, /bin/gzip, $MYPATH)
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/dbconvert.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/dbconvert.patch
new file mode 100644
index 000000000..1fdbf0908
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/dbconvert.patch
@@ -0,0 +1,27 @@
+Upstream-Status: Inappropriate
+
+Hack to prevent unneeded demo app from building on older libc
+where it will break the build
+
+Index: rpm-5.4.14/tools/Makefile.am
+===================================================================
+--- rpm-5.4.14.orig/tools/Makefile.am
++++ rpm-5.4.14/tools/Makefile.am
+@@ -29,7 +29,7 @@ EXTRA_PROGRAMS = nix-copy-closure nix-en
+ xiu-instantiate xiu-store
+ noinst_PROGRAMS =
+
+-EXTRA_PROGRAMS += augtool cudftool dbconvert debugedit \
++EXTRA_PROGRAMS += augtool cudftool debugedit \
+ nix-build nix-channel nix-collect-garbage \
+ nix-log2xml nix-prefetch-url nix-pull nix-push \
+ xiu-echo xiu-hash \
+@@ -64,7 +64,7 @@ pkgbin_PROGRAMS = \
+ rpmcache rpmdigest rpmrepo rpmspecdump \
+ rpmcmp rpmdeps rpmdeps-oecore sqlite3 @WITH_KEYUTILS_RPMKEY@ @WITH_LIBELF_DEBUGEDIT@
+ if WITH_DB
+-pkgbin_PROGRAMS += dbconvert
++pkgbin_PROGRAMS +=
+ endif
+ dist_man_MANS = rpmgrep.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/debugedit-segv.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/debugedit-segv.patch
new file mode 100644
index 000000000..c83c8b5f3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/debugedit-segv.patch
@@ -0,0 +1,100 @@
+During the recalculation of the buildid, it's necessary to change the word
+back to the original endian. However, if we do this in-place, we've also
+affected the headers that we're also working on. The side effect of this is
+we can no longer rely on 'sh_type' as it may have been changed.
+
+This patch ensures that any time we translate the loaded data to the machine
+format, we only do it in a backup copy and never the original copy.
+
+Note: in all other places a backup copy was used, just not buildid processing.
+
+Also the process (...) function was modified to verify the data is not
+NULL as well. This is an extra check and is not strictly necessary.
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm/tools/debugedit.c
+===================================================================
+--- rpm.orig/tools/debugedit.c
++++ rpm/tools/debugedit.c
+@@ -1403,7 +1403,8 @@ static inline void process (hashFunction
+ const void *data, size_t size)
+ {
+ memchunk chunk = { .data = (void *) data, .size = size };
+- hashFunctionContextUpdateMC (ctx, &chunk);
++ if (data != NULL && size != 0)
++ hashFunctionContextUpdateMC (ctx, &chunk);
+ }
+
+ /* Compute a fresh build ID bit-string from the editted file contents. */
+@@ -1456,14 +1457,16 @@ handle_build_id (DSO *dso, Elf_Data *bui
+ GElf_Ehdr ehdr;
+ GElf_Phdr phdr;
+ GElf_Shdr shdr;
+- } u;
+- Elf_Data x = { .d_version = EV_CURRENT, .d_buf = &u };
+-
+- x.d_type = ELF_T_EHDR;
+- x.d_size = sizeof u.ehdr;
+- u.ehdr = dso->ehdr;
+- u.ehdr.e_phoff = u.ehdr.e_shoff = 0;
+- if (elf64_xlatetom (&x, &x, dso->ehdr.e_ident[EI_DATA]) == NULL)
++ } u1, u2;
++ Elf_Data src = { .d_version = EV_CURRENT, .d_buf = &u1 };
++ Elf_Data dest = { .d_version = EV_CURRENT, .d_buf = &u2 };
++
++ src.d_type = ELF_T_EHDR;
++ src.d_size = sizeof u1.ehdr;
++ dest.d_size = sizeof u2.ehdr;
++ u1.ehdr = dso->ehdr;
++ u1.ehdr.e_phoff = u1.ehdr.e_shoff = 0;
++ if (elf64_xlatetom (&dest, &src, dso->ehdr.e_ident[EI_DATA]) == NULL)
+ {
+ bad:
+ fprintf (stderr, "Failed to compute header checksum: %s\n",
+@@ -1471,29 +1474,31 @@ handle_build_id (DSO *dso, Elf_Data *bui
+ exit (1);
+ }
+
+- x.d_type = ELF_T_PHDR;
+- x.d_size = sizeof u.phdr;
++ src.d_type = ELF_T_PHDR;
++ src.d_size = sizeof u1.phdr;
++ dest.d_size = sizeof u2.phdr;
+ for (i = 0; i < dso->ehdr.e_phnum; ++i)
+ {
+- if (gelf_getphdr (dso->elf, i, &u.phdr) == NULL)
++ if (gelf_getphdr (dso->elf, i, &u1.phdr) == NULL)
+ goto bad;
+- if (elf64_xlatetom (&x, &x, dso->ehdr.e_ident[EI_DATA]) == NULL)
++ if (elf64_xlatetom (&dest, &src, dso->ehdr.e_ident[EI_DATA]) == NULL)
+ goto bad;
+- process (&ctx, x.d_buf, x.d_size);
++ process (&ctx, dest.d_buf, dest.d_size);
+ }
+
+- x.d_type = ELF_T_SHDR;
+- x.d_size = sizeof u.shdr;
++ src.d_type = ELF_T_SHDR;
++ src.d_size = sizeof u1.shdr;
++ dest.d_size = sizeof u2.shdr;
+ for (i = 0; i < dso->ehdr.e_shnum; ++i)
+ if (dso->scn[i] != NULL)
+ {
+- u.shdr = dso->shdr[i];
+- u.shdr.sh_offset = 0;
+- if (elf64_xlatetom (&x, &x, dso->ehdr.e_ident[EI_DATA]) == NULL)
++ u1.shdr = dso->shdr[i];
++ u1.shdr.sh_offset = 0;
++ if (elf64_xlatetom (&dest, &src, dso->ehdr.e_ident[EI_DATA]) == NULL)
+ goto bad;
+- process (&ctx, x.d_buf, x.d_size);
++ process (&ctx, dest.d_buf, dest.d_size);
+
+- if (u.shdr.sh_type != SHT_NOBITS)
++ if (u1.shdr.sh_type != SHT_NOBITS)
+ {
+ Elf_Data *d = elf_rawdata (dso->scn[i], NULL);
+ if (d == NULL)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/debugedit-valid-file-to-fix-segment-fault.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/debugedit-valid-file-to-fix-segment-fault.patch
new file mode 100644
index 000000000..804048253
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/debugedit-valid-file-to-fix-segment-fault.patch
@@ -0,0 +1,65 @@
+debugedit: fix segment fault while file's bss offset have a large number
+
+While ELF_C_RDWR_MMAP was used, elf_begin invoked mmap() to map file
+into memory. While the file's bss Offset has a large number, elf_update
+caculated file size by __elf64_updatenull_wrlock and the size was
+enlarged.
+
+In this situation, elf_update invoked ftruncate to enlarge the file,
+and memory size (elf->maximum_size) also was incorrectly updated.
+There was segment fault in elf_end which invoked munmap with the
+length is the enlarged file size, not the mmap's length.
+
+Before the above operations, invoke elf_begin/elf_update/elf_end
+with ELF_C_RDWR and ELF_F_LAYOUT set to enlarge the above file, it
+could make sure the file is safe for the following elf operations.
+
+Upstream-Status: Submitted [RPM5 maintainer]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ tools/debugedit.c | 25 +++++++++++++++++++++++++
+ 1 file changed, 25 insertions(+)
+
+Index: rpm-5.4.14/tools/debugedit.c
+===================================================================
+--- rpm-5.4.14.orig/tools/debugedit.c
++++ rpm-5.4.14/tools/debugedit.c
+@@ -1525,6 +1525,28 @@ handle_build_id (DSO *dso, Elf_Data *bui
+ }
+ }
+
++/* It avoided the segment fault while file's bss offset have a large number.
++ See https://bugzilla.redhat.com/show_bug.cgi?id=1019707
++ https://bugzilla.redhat.com/show_bug.cgi?id=1020842 for detail. */
++void valid_file(int fd)
++{
++ Elf *elf = elf_begin (fd, ELF_C_RDWR, NULL);
++ if (elf == NULL)
++ {
++ error (1, 0, "elf_begin: %s", elf_errmsg (-1));
++ return;
++ }
++
++ elf_flagelf (elf, ELF_C_SET, ELF_F_LAYOUT);
++
++ if (elf_update (elf, ELF_C_WRITE) < 0)
++ error (1, 0, "elf_update: %s", elf_errmsg (-1));
++
++ elf_end (elf);
++
++ return;
++}
++
+ int
+ main (int argc, char *argv[])
+ {
+@@ -1621,6 +1643,9 @@ main (int argc, char *argv[])
+ exit (1);
+ }
+
++ /* Make sure the file is valid. */
++ valid_file(fd);
++
+ dso = fdopen_dso (fd, file);
+ if (dso == NULL)
+ exit (1);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/header-include-fix.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/header-include-fix.patch
new file mode 100644
index 000000000..e72df45b5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/header-include-fix.patch
@@ -0,0 +1,36 @@
+Update two rpm headers to include other headers.
+
+Using rpmdb.h w/o including errno.h may result in a warning.
+
+Using rpmtag.h w/o also adding stdint.h will result in numerous failures
+about unknown types on modern compilers.
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Signed-off-by: Qing He <qing.he@intel.com>
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/rpmdb/rpmdb.h
+===================================================================
+--- rpm-5.4.14.orig/rpmdb/rpmdb.h
++++ rpm-5.4.14/rpmdb/rpmdb.h
+@@ -9,6 +9,7 @@
+
+ #include <assert.h>
+ #include <mire.h>
++#include <errno.h>
+
+ #include <rpmtypes.h>
+ #include <rpmtag.h> /* XXX Header typedef */
+Index: rpm-5.4.14/rpmdb/rpmtag.h
+===================================================================
+--- rpm-5.4.14.orig/rpmdb/rpmtag.h
++++ rpm-5.4.14/rpmdb/rpmtag.h
+@@ -7,6 +7,7 @@
+
+ #include <rpmiotypes.h>
+ #include <rpmsw.h>
++#include <stdint.h>
+
+ #ifdef __cplusplus
+ extern "C" {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/makefile-am-exec-hook.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/makefile-am-exec-hook.patch
new file mode 100644
index 000000000..5d936db5a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/makefile-am-exec-hook.patch
@@ -0,0 +1,33 @@
+rpm: Resolve parallel install issue when installing lua
+
+When lua is being installed on some systems that are being run with high levels
+of parallelization there are cases where install-data-am and install-exec-hook
+are processed at the same or a very short time apart. This causes
+install-pkgbinPROGRAMS, which is a dependency of both, to be run at around the
+same time This sometimes causes file contention and will sometimes be in a state
+where install-exec-hook is looking for a file that is being installed or both
+install-pkgbinPROGRAMS being run are installing the same file and fail because
+it cannon create a new file.
+
+This patch allows install-exec-hook to be called by install-data-am instead of
+install-exec-am. It also removed the dependency in install-data-hook on
+install-pkgbinPROGRAMS. This means install-pkgbinPROGRAMS will only be run once
+so there whould be any file contention.
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Signed-off-by: Morgan Little <morgan.little@windriver.com>
+
+Index: rpm-5.4.14/lua/Makefile.am
+===================================================================
+--- rpm-5.4.14.orig/lua/Makefile.am
++++ rpm-5.4.14/lua/Makefile.am
+@@ -326,7 +326,7 @@ clean-local:
+ # XXX Build & install as rpmlua/rpmluac with hardlinks to lua/luac post install.
+ # XXX CVS has lua/luac sub-directories in the Attic that collide with the
+ # XXX lua/luac executable names when using cvs update.
+-install-exec-hook: install-pkgbinPROGRAMS
++install-data-hook:
+ mkdir -p $(DESTDIR)$(pkgbindir)
+ $(__RM) -f $(DESTDIR)$(pkgbindir)/lua
+ $(__LN) $(DESTDIR)$(pkgbindir)/rpmlua $(DESTDIR)$(pkgbindir)/lua
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/no-ldflags-in-pkgconfig.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/no-ldflags-in-pkgconfig.patch
new file mode 100644
index 000000000..410623fab
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/no-ldflags-in-pkgconfig.patch
@@ -0,0 +1,14 @@
+Don't put LDFLAGS into the Libs.private, all it generally contains is a linker
+hash selection (harmless) and the absolute path to the libdir in the sysroot
+(actively harmful).
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/scripts/rpm.pc.in b/scripts/rpm.pc.in
+index 8293471..2ea469c 100644
+--- a/scripts/rpm.pc.in
++++ b/scripts/rpm.pc.in
+@@ -17 +17 @@ Libs: -L${libdir} -lrpmbuild${suffix} -lrpm${suffix} -lrpmdb${suffix} -lrpmio${s
+-Libs.private: @LDFLAGS@ @LIBS@
++Libs.private: @LIBS@
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/perfile_rpmdeps.sh b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/perfile_rpmdeps.sh
new file mode 100755
index 000000000..b72c9f026
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/perfile_rpmdeps.sh
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+: ${RPMDEPS:=rpmdeps}
+
+process() {
+ while read file_name ; do
+ printf "%s\t" ${file_name}
+ if [ ! -d $file_name ]; then
+ printf "%s " $($RPMDEPS $1 $file_name | sed -e 's,rpmlib(.*,,' -e 's,\([<>\=]\+ \+[^ ]*\),(\1),g')
+ fi
+ printf "\n"
+ done
+}
+
+usage() {
+ echo "$0 {-P|--provides} {-R|--requires} FILE ..."
+}
+
+while [ $# -gt 0 ]; do
+ case "$1" in
+ --rpmdeps)
+ RPMDEPS=$2
+ shift
+ shift
+ ;;
+ -R|--requires)
+ process_type=--requires
+ shift
+ ;;
+ -P|--provides)
+ process_type=--provides
+ shift
+ ;;
+ *)
+ break;
+ ;;
+ esac
+done
+
+if [ -z "$process_type" ]; then
+ usage
+ exit 1
+fi
+
+if [ $# -gt 0 ]; then
+ find "$@" | process $process_type
+ exit $?
+fi
+
+process $process_type
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/popt-disable-auto-stack-protector.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/popt-disable-auto-stack-protector.patch
new file mode 100644
index 000000000..bcad8dcb7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/popt-disable-auto-stack-protector.patch
@@ -0,0 +1,27 @@
+popt: Disable default stack protection on internal version of popt
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.15/popt/configure.ac
+===================================================================
+--- rpm-5.4.15.orig/popt/configure.ac
++++ rpm-5.4.15/popt/configure.ac
+@@ -123,7 +123,6 @@ AS_IF([test "x$popt_gcc_warnings" = xyes
+ popt_CFLAGS_ADD([-Wjump-misses-init],[POPT_CFLAGS])
+ popt_CFLAGS_ADD([-Wno-format-nonliteral],[POPT_CFLAGS])
+ popt_CFLAGS_ADD([-Wframe-larger-than=$MAX_STACK_SIZE],[POPT_CFLAGS])
+- popt_CFLAGS_ADD([-fstack-protector-all],[POPT_CFLAGS])
+ popt_CFLAGS_ADD([-fasynchronous-unwind-tables],[POPT_CFLAGS])
+ popt_CFLAGS_ADD([-fdiagnostics-show-option],[POPT_CFLAGS])
+ popt_CFLAGS_ADD([-funit-at-a-time],[POPT_CFLAGS])
+@@ -203,7 +202,7 @@ AC_SUBST([POPT_LDFLAGS])
+ # -fno-delete-null-pointer as the kernel does http://patchwork.kernel.org/patch/36060/
+ # GNU GCC (usually "gcc")
+ AS_IF([test "x$GCC" != x],
+- [ for c in -fno-delete-null-pointer-checks -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector -fexceptions
++ [ for c in -fno-delete-null-pointer-checks -fexceptions
+ do
+ popt_CFLAGS_ADD([$c], [POPT_CFLAGS])
+ done
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/python-rpm-rpmsense.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/python-rpm-rpmsense.patch
new file mode 100644
index 000000000..590f58d89
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/python-rpm-rpmsense.patch
@@ -0,0 +1,31 @@
+rpmmodule.c: Export a few additional RPMSENSE values
+
+We want to see the RPMSENSE_SCRIPT values for use with SMART. We also
+want to see the MISSINGOK value so we can avoid recommended packages causing
+failures.
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm/python/rpmmodule.c
+===================================================================
+--- rpm.orig/python/rpmmodule.c
++++ rpm/python/rpmmodule.c
+@@ -525,12 +525,15 @@ static int initModule(PyObject *m)
+ REGISTER_ENUM(RPMSENSE_PREREQ);
+ REGISTER_ENUM(RPMSENSE_PRETRANS);
+ REGISTER_ENUM(RPMSENSE_INTERP);
++#else
++ #if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_OE)
+ REGISTER_ENUM(RPMSENSE_SCRIPT_PRE);
+ REGISTER_ENUM(RPMSENSE_SCRIPT_POST);
+ REGISTER_ENUM(RPMSENSE_SCRIPT_PREUN);
+ REGISTER_ENUM(RPMSENSE_SCRIPT_POSTUN);
+ REGISTER_ENUM(RPMSENSE_SCRIPT_VERIFY);
+-#else
++ REGISTER_ENUM(RPMSENSE_MISSINGOK);
++ #endif
+ REGISTER_ENUM(RPMSENSE_NOTEQUAL);
+ #endif
+ REGISTER_ENUM(RPMSENSE_FIND_REQUIRES);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/pythondeps.sh b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/pythondeps.sh
new file mode 100755
index 000000000..083b174f1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/pythondeps.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+[ $# -ge 1 ] || {
+ cat > /dev/null
+ exit 0
+}
+
+case $1 in
+-R|--requires)
+ shift
+ grep "/usr/\(lib[^/]*\|share\)/python[^/]*/" >/dev/null && echo "python"
+ exit 0
+ ;;
+esac
+
+exit 0
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-atomic-ops.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-atomic-ops.patch
new file mode 100644
index 000000000..cc241f4f1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-atomic-ops.patch
@@ -0,0 +1,73 @@
+Some architectures do not have __sync_add_and_fetch_8 implemented.
+
+MIPS (32-bit) and some PPC systems do not have sync_add_and_fetch_8.
+
+Provide an alternative. This alternative function is based on code from:
+ https://github.com/mongodb/libbson/blob/master/src/bson/bson-atomic.c
+
+Code is under an Apache 2.0 License.
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.15/rpmio/bson.h
+===================================================================
+--- rpm-5.4.15.orig/rpmio/bson.h
++++ rpm-5.4.15/rpmio/bson.h
+@@ -879,10 +879,18 @@ BSON_END_DECLS
+
+ BSON_BEGIN_DECLS
+
++/* Some architectures do not support __sync_add_and_fetch_8 */
++#if (__mips == 32) || (defined(__PPC__) && !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8))
++# define __BSON_NEED_ATOMIC_64 1
++#endif
+
+ #if defined(__GNUC__)
+ # define bson_atomic_int_add(p, v) (__sync_add_and_fetch(p, v))
+-# define bson_atomic_int64_add(p, v) (__sync_add_and_fetch_8(p, v))
++#ifndef __BSON_NEED_ATOMIC_64
++# define bson_atomic_int64_add(p, v) (__sync_add_and_fetch_8(p, v))
++# else
++ int64_t bson_atomic_int64_add (volatile int64_t *p, int64_t n);
++# endif
+ # define bson_memory_barrier __sync_synchronize
+ #elif defined(_MSC_VER) || defined(_WIN32)
+ # define bson_atomic_int_add(p, v) (InterlockedExchangeAdd((long int *)(p), v))
+Index: rpm-5.4.15/rpmio/bson.c
+===================================================================
+--- rpm-5.4.15.orig/rpmio/bson.c
++++ rpm-5.4.15/rpmio/bson.c
+@@ -3863,13 +3863,30 @@ _bson_context_get_oid_seq64_threadsafe (
+ #elif defined BSON_OS_WIN32
+ uint64_t seq = InterlockedIncrement64 ((int64_t *)&context->seq64);
+ #else
+- uint64_t seq = __sync_fetch_and_add_8 (&context->seq64, 1);
++ uint64_t seq = bson_atomic_int64_add (&context->seq64, 1);
+ #endif
+
+ seq = BSON_UINT64_TO_BE (seq);
+ memcpy (&oid->bytes[4], &seq, 8);
+ }
+
++#ifdef __BSON_NEED_ATOMIC_64
++#include <pthread.h>
++static pthread_mutex_t gSync64 = PTHREAD_MUTEX_INITIALIZER;
++int64_t
++bson_atomic_int64_add (volatile int64_t *p,
++ int64_t n)
++{
++ int64_t ret;
++
++ pthread_mutex_lock (&gSync64);
++ *p += n;
++ ret = *p;
++ pthread_mutex_unlock (&gSync64);
++
++ return ret;
++}
++#endif
+
+ /**
+ * bson_context_new:
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-autogen-force.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-autogen-force.patch
new file mode 100644
index 000000000..258a7f6e7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-autogen-force.patch
@@ -0,0 +1,78 @@
+In order to enable musl or other libc support, force update the config.guess
+
+In order to reliably replace config.guess and config.sub, we need to remove
+them prior to the call to automake. Adding the --force-missing is likely
+not necessary, but matching normal OE autoreconf usage.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.15/autogen.sh
+===================================================================
+--- rpm-5.4.15.orig/autogen.sh
++++ rpm-5.4.15/autogen.sh
+@@ -73,7 +73,8 @@ rm -f aclocal.m4
+ aclocal -I m4
+ autoheader -I m4
+ echo "---> generate files via GNU automake (automake)"
+-automake -Wall -Wno-override -a -c
++rm -f config.guess config.sub
++automake -Wall -Wno-override -a -c --force-missing
+ echo "---> generate files via GNU autoconf (autoconf)"
+ autoconf -I m4
+ echo "<=== rpm"
+Index: rpm-5.4.15/beecrypt/autogen.sh
+===================================================================
+--- rpm-5.4.15.orig/beecrypt/autogen.sh
++++ rpm-5.4.15/beecrypt/autogen.sh
+@@ -25,6 +25,7 @@ libtoolize () {
+
+ libtoolize --force --copy
+ aclocal
+-automake -a -c
++rm -f config.guess config.sub
++automake -a -c --force-missing
+ autoconf
+ autoheader
+Index: rpm-5.4.15/libtpm/autogen.sh
+===================================================================
+--- rpm-5.4.15.orig/libtpm/autogen.sh
++++ rpm-5.4.15/libtpm/autogen.sh
+@@ -46,7 +46,8 @@ echo "---> generate files via GNU autoco
+ aclocal
+ autoheader
+ echo "---> generate files via GNU automake (automake)"
+-automake -Wall -Wno-override -a -c
++rm -f config.guess config.sub
++automake -Wall -Wno-override -a -c --force-missing
+ echo "---> generate files via GNU autoconf (autoconf)"
+ autoconf
+
+Index: rpm-5.4.15/neon/autogen.sh
+===================================================================
+--- rpm-5.4.15.orig/neon/autogen.sh
++++ rpm-5.4.15/neon/autogen.sh
+@@ -63,7 +63,8 @@ echo "---> generate files via GNU autoco
+ ${ACLOCAL:-aclocal} -I macros
+ ${AUTOHEADER:-autoheader}
+ echo "---> generate files via GNU automake (automake)"
+-${AUTOMAKE:-automake} -Wall -Wno-override -a -c
++rm -f config.guess config.sub
++${AUTOMAKE:-automake} -Wall -Wno-override -a -c --force-missing
+ echo "---> generate files via GNU autoconf (autoconf)"
+ ${AUTOCONF:-autoconf} -Wall
+
+Index: rpm-5.4.15/syck/autogen.sh
+===================================================================
+--- rpm-5.4.15.orig/syck/autogen.sh
++++ rpm-5.4.15/syck/autogen.sh
+@@ -40,6 +40,7 @@ echo "---> generate files via GNU autoco
+ aclocal
+ autoheader
+ echo "---> generate files via GNU automake (automake)"
+-automake -Wall -Wno-override -a -c
++rm -f config.guess config.sub
++automake -Wall -Wno-override -a -c --force-missing
+ echo "---> generate files via GNU autoconf (autoconf)"
+ autoconf
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-autogen.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-autogen.patch
new file mode 100644
index 000000000..8771235d3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-autogen.patch
@@ -0,0 +1,25 @@
+Remove the sanity checking from the rpm autogen.sh. This is required because
+we may have slightly different, but yet compatible versions. If we do end
+up breaking things, we'll deal with it at that time.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/syck/autogen.sh
+===================================================================
+--- rpm-5.4.14.orig/syck/autogen.sh
++++ rpm-5.4.14/syck/autogen.sh
+@@ -34,12 +34,6 @@ libtoolize () {
+ eval $_libtoolize $_libtoolize_args
+ }
+
+-# requirements sanity check
+-[ "`automake --version | head -1`" != "$AMV" ] && echo "$USAGE" # && exit 1
+-[ "`autoconf --version | head -1`" != "$ACV" ] && echo "$USAGE" # && exit 1
+-[ "`libtoolize --version | head -1`" != "$LTV" ] && echo "$USAGE" # && exit 1
+-[ "`gettextize --version | head -1 | sed -e 's;^.*/\\(gettextize\\);\\1;'`" != "$GTT" ] && echo "$USAGE" # && exit 1
+-
+ echo "---> generate files via GNU libtool (libtoolize)"
+ libtoolize --quiet --copy --force --install
+ echo "---> generate files via GNU autoconf (aclocal, autoheader)"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch
new file mode 100644
index 000000000..81fc84937
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch
@@ -0,0 +1,136 @@
+lib/rpmrc.c: Update --target processing to support full GNU canonical arch
+
+Prior to this patch, when using --target, RPM supported the format:
+ <arch>
+ <arch>-<os>
+ <arch>-<os>-gnu
+ <arch>-<arbitrary items>-<os>
+ <arch>-<arbitrary items>-<os>-gnu
+
+This patch changes the list of supported items to:
+ <arch>
+ <arch>-<os>
+ <arch>-<os>-gnu
+ <arch>-<vendor>-<os>
+ <arch>-<vendor>-<os>-<extension>
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/lib/rpmrc.c
+===================================================================
+--- rpm-5.4.14.orig/lib/rpmrc.c
++++ rpm-5.4.14/lib/rpmrc.c
+@@ -925,8 +925,8 @@ static void getMachineInfo(int type, /*@
+
+ static void rpmRebuildTargetVars(const char ** target, const char ** canontarget)
+ {
+-
+- char *ca = NULL, *co = NULL, *ct = NULL;
++ /* ca = arch, cv = vendor, co = os, ce = extension, ct = canon target */
++ char *ca = NULL, *cv = NULL, *co = NULL, *ce = NULL, *ct = NULL;
+ int x;
+
+ /* Rebuild the compat table to recalculate the current target arch. */
+@@ -936,23 +936,60 @@ static void rpmRebuildTargetVars(const c
+ rpmSetTables(RPM_MACHTABLE_BUILDARCH, RPM_MACHTABLE_BUILDOS);
+
+ if (target && *target) {
++ /* GNU canonical format is:
++ * <arch>-<vendor>-<os>[-extension]
++ *
++ * We support the both the GNU canonical format
++ * as well as the traditional RPM formats:
++ * <arch>
++ * <arch>-<os>[-gnu]
++ */
+ char *c;
+ /* Set arch and os from specified build target */
+ ca = xstrdup(*target);
+- if ((c = strchr(ca, '-')) != NULL) {
++ if ((c = strchr(ca, '-')) == NULL) {
++ /* Format is <arch> */
++ ;
++ } else {
+ *c++ = '\0';
+-
+- if ((co = strrchr(c, '-')) == NULL) {
+- co = c;
++ cv = c;
++
++ if ((c = strchr(c, '-')) == NULL) {
++ /* Format is <arch>-<os> */
++ co = cv;
++ cv = NULL;
+ } else {
+- if (!xstrcasecmp(co, "-gnu"))
+- *co = '\0';
+- if ((co = strrchr(c, '-')) == NULL)
+- co = c;
+- else
+- co++;
++ *c++ = '\0';
++ co = c;
++
++ if ((c = strchr(c, '-')) == NULL) {
++ /* Might be:
++ * <arch>-<vendor>-<os>
++ * <arch>-<os>-gnu
++ */
++ if (!xstrcasecmp(co, "gnu")) {
++ /* Format was <arch>-<os>-gnu */
++ ce = co;
++ co = cv;
++ cv = NULL;
++ }
++ } else {
++ /* Format was <arch>-<vendor>-<os>-<extension> */
++ *c++ = '\0';
++ ce = c;
++ }
+ }
++ if (cv != NULL) cv = xstrdup(cv);
+ if (co != NULL) co = xstrdup(co);
++ if (ce != NULL) {
++ /* We need to prefix it with a "-" */
++ char * lce = NULL;
++
++ lce = xmalloc(strlen(ce) + sizeof("-"));
++ sprintf(lce, "-%s", ce);
++
++ ce = lce;
++ }
+ }
+ } else {
+ const char *a = NULL;
+@@ -995,8 +1032,16 @@ static void rpmRebuildTargetVars(const c
+ addMacro(NULL, "_target", NULL, ct, RMIL_RPMRC);
+ delMacro(NULL, "_target_cpu");
+ addMacro(NULL, "_target_cpu", NULL, ca, RMIL_RPMRC);
++ if (cv) {
++ delMacro(NULL, "_target_vendor");
++ addMacro(NULL, "_target_vendor", NULL, cv, RMIL_RPMRC);
++ }
+ delMacro(NULL, "_target_os");
+ addMacro(NULL, "_target_os", NULL, co, RMIL_RPMRC);
++ if (ce) {
++ delMacro(NULL, "_gnu");
++ addMacro(NULL, "_gnu", NULL, ce, RMIL_RPMRC);
++ }
+
+ if (canontarget)
+ *canontarget = ct;
+@@ -1004,8 +1049,12 @@ static void rpmRebuildTargetVars(const c
+ ct = _free(ct);
+ ca = _free(ca);
+ /*@-usereleased@*/
++ cv = _free(cv);
++ /*@-usereleased@*/
+ co = _free(co);
+ /*@=usereleased@*/
++ ce = _free(ce);
++ /*@-usereleased@*/
+ }
+
+ void rpmFreeRpmrc(void)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-check-rootpath-reasonableness.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-check-rootpath-reasonableness.patch
new file mode 100644
index 000000000..3d8d645a7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-check-rootpath-reasonableness.patch
@@ -0,0 +1,96 @@
+rpm: check if the argument(rootpath) exists or be writable
+
+When user execute the command "rpm -qai --root=$dir",if $dir doesn't
+exist or is unwritable as result of making a typo in rootpath,then
+it will create dirent $dir and subdirectory.
+So we should add the check function to fix it before creating relational
+subdirectory,and warn the incorrect rootpath to user. It just checks the
+rootpath reasonableness when the user input the argument(--root=/-r=).
+
+Upstream-Status: Pending
+
+Signed-off-by: Zhixiong Chi <zchi@windriver.com>
+---
+ rpmqv.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 45 insertions(+)
+
+diff --git a/rpmqv.c b/rpmqv.c
+index 40c42bd..88d85ab 100644
+--- a/rpmqv.c
++++ b/rpmqv.c
+@@ -206,6 +206,8 @@ static struct poptOption optionsTable[] = {
+ POPT_TABLEEND
+ };
+
++static int _rpmqv_rootpath_state = 0;
++
+ #ifdef __MINT__
+ /* MiNT cannot dynamically increase the stack. */
+ long _stksize = 64 * 1024L;
+@@ -427,6 +429,41 @@ static void integrity_check(const char *progname, enum modes progmode_num)
+ }
+ #endif
+
++/*check if the rootdir is writable or exists */
++int access_file(const char *rootdir)
++{
++ int ret,rootdir_len;
++
++ if(rootdir == NULL) {
++ return -1;
++ }
++
++ rootdir_len = strlen(rootdir);
++ /*make sure that dirent argument trailing is "/" */
++ if(!(rootdir_len && rootdir[rootdir_len - 1] == '/')){
++ char *t = (char *)malloc(rootdir_len + 2);
++ *t = '\0';
++ (void)stpcpy(stpcpy(t,rootdir),"/");
++ ret = access(t,F_OK|W_OK);
++ free(t);
++ }else{
++ ret = access(rootdir,F_OK|W_OK);
++ }
++ return ret;
++}
++
++/*check if input the argument "--root/-r" */
++void check_argument_root(int argc,char * const argv[])
++{
++ int i;
++ for (i = 0; i < argc; i++) {
++ if(strncmp(argv[i],"--root=",7) == 0 || strncmp(argv[i],"-r=",3) == 0) {
++ _rpmqv_rootpath_state = 1;
++ break;
++ }
++ }
++}
++
+ /*@-bounds@*/ /* LCL: segfault */
+ /*@-mods@*/ /* FIX: shrug */
+ #if !defined(__GLIBC__) && !defined(__LCLINT__)
+@@ -476,6 +513,8 @@ int main(int argc, const char ** argv)
+ int xx;
+ #endif
+
++ check_argument_root(argc,(char *const *)argv);
++
+ #if !defined(__GLIBC__) && !defined(__LCLINT__)
+ environ = envp;
+ #else
+@@ -715,6 +754,12 @@ int main(int argc, const char ** argv)
+ argerror(_("arguments to --root (-r) must begin with a /"));
+ break;
+ }
++ if (_rpmqv_rootpath_state) {
++ if (access_file(rpmioRootDir)) {
++ fprintf(stderr, _("Invalid directory:%s, ensure it exists or be writable\n"),rpmioRootDir);
++ exit(EXIT_FAILURE);
++ }
++ }
+ }
+
+ #if defined(RPM_VENDOR_OPENPKG) /* integrity-checking */
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db-reduce.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db-reduce.patch
new file mode 100644
index 000000000..c86937653
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db-reduce.patch
@@ -0,0 +1,19 @@
+Upstream-Status: Inappropriate [configuration]
+
+Change cache size to reduce the usage of disk space from 62MB to 26MB.
+
+Signed-off-by: Mei Lei <lei.mei@intel.com>
+
+Index: rpm-5.4.14/rpmdb/DB_CONFIG.in
+===================================================================
+--- rpm-5.4.14.orig/rpmdb/DB_CONFIG.in
++++ rpm-5.4.14/rpmdb/DB_CONFIG.in
+@@ -29,7 +29,7 @@ set_thread_count 64
+
+ # ================ Memory Pool
+ #XXX initializing dbenv with set_cachesize has unimplemented prerequsites
+-#set_cachesize 0 1048576 0
++set_cachesize 0 1048576 0
+ set_mp_mmapsize 268435456
+
+ # ================ Locking
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db5-or-db6.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db5-or-db6.patch
new file mode 100644
index 000000000..5d08d279a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db5-or-db6.patch
@@ -0,0 +1,174 @@
+From 7bad268de8b32281e2a12ccd88038b3ec5eb1be3 Mon Sep 17 00:00:00 2001
+From: Yuanjie Huang <Yuanjie.Huang@windriver.com>
+Date: Tue, 15 Dec 2015 18:50:21 +0800
+Subject: [PATCH] Support both db5 and db6.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Yuanjie Huang <Yuanjie.Huang@windriver.com>
+---
+ configure.ac | 103 ++++++++++++++++++++++++++++++++++++++++++++++-------------
+ 1 file changed, 81 insertions(+), 22 deletions(-)
+
+Index: rpm/configure.ac
+===================================================================
+--- rpm.orig/configure.ac
++++ rpm/configure.ac
+@@ -871,8 +871,6 @@ else
+ MYPATH=$PATH
+ fi
+
+-DBXY=db61
+-
+ AC_PATH_PROG(__BASH, bash, %{_bindir}/bash, $MYPATH)
+ AC_PATH_PROG(__BZIP2, bzip2, %{_bindir}/bzip2, $MYPATH)
+ AC_PATH_PROG(__CAT, cat, /bin/cat, $MYPATH)
+@@ -884,22 +882,6 @@ AC_PATH_PROG(__CMAKE, cmake, %{_bindir}/
+ AC_PATH_PROG(__CPIO, cpio, /bin/cpio, $MYPATH)
+ AC_PATH_PROG(__CURL, curl, %{_bindir}/curl, $MYPATH)
+ AC_PATH_PROG(__CVS, cvs, %{_bindir}/cvs, $MYPATH)
+-AC_PATH_PROG(__DB_ARCHIVE, ${DBXY}_archive, %{_bindir}/${DBXY}_archive, $MYPATH)
+-AC_PATH_PROG(__DB_CHECKPOINT, ${DBXY}_checkpoint, %{_bindir}/${DBXY}_checkpoint, $MYPATH)
+-AC_PATH_PROG(__DB_DEADLOCK, ${DBXY}_deadlock, %{_bindir}/${DBXY}_deadlock, $MYPATH)
+-AC_PATH_PROG(__DB_DUMP, ${DBXY}_dump, %{_bindir}/${DBXY}_dump, $MYPATH)
+-AC_PATH_PROG(__DB_HOTBACKUP, ${DBXY}_hotbackup, %{_bindir}/${DBXY}_hotbackup, $MYPATH)
+-AC_PATH_PROG(__DB_LOAD, ${DBXY}_load, %{_bindir}/${DBXY}_load, $MYPATH)
+-AC_PATH_PROG(__DB_LOG_VERIFY, ${DBXY}_log_verify, %{_bindir}/${DBXY}_log_verify, $MYPATH)
+-AC_PATH_PROG(__DB_PRINTLOG, ${DBXY}_printlog, %{_bindir}/${DBXY}_printlog, $MYPATH)
+-AC_PATH_PROG(__DB_RECOVER, ${DBXY}_recover, %{_bindir}/${DBXY}_recover, $MYPATH)
+-AC_PATH_PROG(__DB_REPLICATE, ${DBXY}_replicate, %{_bindir}/${DBXY}_replicate, $MYPATH)
+-AC_PATH_PROG(__DBSQL, ${DBXY}sql, %{_bindir}/${DBXY}sql, $MYPATH)
+-AC_PATH_PROG(__DB_SQL_CODEGEN, ${DBXY}_sql_codegen, %{_bindir}/${DBXY}_sql_codegen, $MYPATH)
+-AC_PATH_PROG(__DB_STAT, ${DBXY}_stat, %{_bindir}/${DBXY}_stat, $MYPATH)
+-AC_PATH_PROG(__DB_TUNER, ${DBXY}_tuner, %{_bindir}/${DBXY}_tuner, $MYPATH)
+-AC_PATH_PROG(__DB_UPGRADE, ${DBXY}_upgrade, %{_bindir}/${DBXY}_upgrade, $MYPATH)
+-AC_PATH_PROG(__DB_VERIFY, ${DBXY}_verify, %{_bindir}/${DBXY}_verify, $MYPATH)
+ AC_PATH_PROG(__DIFF, diff, /bin/diff, $MYPATH)
+ AC_PATH_PROG(__DITTO, ditto, %{_bindir}/ditto, $MYPATH)
+ AC_PATH_PROG(__FILE, file, %{_bindir}/file, $MYPATH)
+@@ -2050,13 +2032,46 @@ RPM_CHECK_LIB(
+
+ dnl # Berkeley-DB & SQLite
+ DBLIBSRCS=""
++DBXY=db
++
+ # XXX won't handle --includedir override
+-CPPFLAGS="${CPPFLAGS} -I${prefix}/include/${DBXY}"
+-RPM_CHECK_LIB(
++CPPFLAGS_save="${CPPFLAGS}"
++CPPFLAGS="${CPPFLAGS_save}"
++with_db_save="${with_db}"
++
++AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
++#include <db.h>
++]],
++[[
++#if DB_VERSION_MAJOR < 6
++#error DB_VERSION_MAJOR is below 6
++#endif
++]])],
++[RPM_CHECK_LIB(
+ [Berkeley-DB], [db],
+ [db-6.1], [db_create], [db.h],
+- [yes,external], [db3],
++ [yes,external], [db6],
+ [ DBLIBSRCS="$DBLIBSRCS db3.c"
++ DBXY=db61
++ AM_CONDITIONAL(WITH_DB, [ true ])
++ AM_CONDITIONAL(WITH_DB_INTERNAL, [ test ".$RPM_CHECK_LIB_LOCATION" = .internal ])
++ if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then
++ AC_DEFINE(HAVE_DB_H, 1, [Have <db.h> header])
++ else
++ WITH_DB_SUBDIR=""
++ fi
++ ],
++ [ AM_CONDITIONAL(WITH_DB, [ false ])
++ AM_CONDITIONAL(WITH_DB_INTERNAL, [ false ])
++ ])],
++[with_db="${with_db_save}"
++ CPPFLAGS="${CPPFLAGS_save}"
++ RPM_CHECK_LIB(
++ [Berkeley-DB], [db],
++ [db-5.3], [db_create], [db.h],
++ [yes,external], [db53],
++ [ DBLIBSRCS="$DBLIBSRCS db3.c"
++ DBXY=db53
+ AM_CONDITIONAL(WITH_DB, [ true ])
+ AM_CONDITIONAL(WITH_DB_INTERNAL, [ test ".$RPM_CHECK_LIB_LOCATION" = .internal ])
+ if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then
+@@ -2068,6 +2083,11 @@ RPM_CHECK_LIB(
+ [ AM_CONDITIONAL(WITH_DB, [ false ])
+ AM_CONDITIONAL(WITH_DB_INTERNAL, [ false ])
+ ])
++])
++
++if test ".$ac_cv_lib_db_6_1_db_create" != .yes -a ".$ac_cv_lib_db_5_3_db_create" != .yes; then
++ CPPFLAGS="${CPPFLAGS_save}"
++fi
+
+ dnl # Sqlite external
+ RPM_CHECK_LIB(
+@@ -2078,10 +2098,11 @@ RPM_CHECK_LIB(
+ [])
+
+ dnl # Sqlite 3.8.3.1 from db-6.1.19
++if test ".$ac_cv_lib_db_6_1_db_create" = .yes; then
+ RPM_CHECK_LIB(
+ [Berkeley-DB (+SQLite3)], [dbsql],
+ [db_sql-6.1], [sqlite3_open], [dbsql.h],
+- [yes,external], [db3/sql],
++ [yes,external], [db6/sql],
+ [
+ AM_CONDITIONAL(WITH_DBSQL, [ true ])
+ AC_DEFINE(WITH_SQLITE, 1, [Define as 1 if building with SQLite library])
+@@ -2095,12 +2116,50 @@ RPM_CHECK_LIB(
+ ], [
+ AM_CONDITIONAL(WITH_DBSQL, [ false ])
+ ])
++elif test ".$ac_cv_lib_db_5_3_db_create" = .yes; then
++RPM_CHECK_LIB(
++ [Berkeley-DB (+SQLite3)], [dbsql],
++ [db_sql-5.3], [sqlite3_open], [dbsql.h],
++ [yes,external], [db53/sql],
++ [
++ AM_CONDITIONAL(WITH_DBSQL, [ true ])
++ AC_DEFINE(WITH_SQLITE, 1, [Define as 1 if building with SQLite library])
++ if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then
++ WITH_DB_CPPFLAGS="${WITH_DB_CPPFLAGS} -I\$(top_srcdir)/db/sql/generated"
++ WITH_DB_LIBS="${WITH_DBSQL_LIBS}"
++ DBLIBSRCS="$DBLIBSRCS sqlite.c"
++ else
++ WITH_DBSQL_SUBDIR=""
++ fi
++ ], [
++ AM_CONDITIONAL(WITH_DBSQL, [ false ])
++ ])
++else
++AM_CONDITIONAL(WITH_DBSQL, [ false ])
++fi
+
+ DBLIBOBJS=`echo $DBLIBSRCS | sed -e "s/\.c/\.lo/g"`
+
+ AC_SUBST(DBLIBSRCS)
+ AC_SUBST(DBLIBOBJS)
+
++AC_PATH_PROG(__DB_ARCHIVE, ${DBXY}_archive, %{_bindir}/${DBXY}_archive, $MYPATH)
++AC_PATH_PROG(__DB_CHECKPOINT, ${DBXY}_checkpoint, %{_bindir}/${DBXY}_checkpoint, $MYPATH)
++AC_PATH_PROG(__DB_DEADLOCK, ${DBXY}_deadlock, %{_bindir}/${DBXY}_deadlock, $MYPATH)
++AC_PATH_PROG(__DB_DUMP, ${DBXY}_dump, %{_bindir}/${DBXY}_dump, $MYPATH)
++AC_PATH_PROG(__DB_HOTBACKUP, ${DBXY}_hotbackup, %{_bindir}/${DBXY}_hotbackup, $MYPATH)
++AC_PATH_PROG(__DB_LOAD, ${DBXY}_load, %{_bindir}/${DBXY}_load, $MYPATH)
++AC_PATH_PROG(__DB_LOG_VERIFY, ${DBXY}_log_verify, %{_bindir}/${DBXY}_log_verify, $MYPATH)
++AC_PATH_PROG(__DB_PRINTLOG, ${DBXY}_printlog, %{_bindir}/${DBXY}_printlog, $MYPATH)
++AC_PATH_PROG(__DB_RECOVER, ${DBXY}_recover, %{_bindir}/${DBXY}_recover, $MYPATH)
++AC_PATH_PROG(__DB_REPLICATE, ${DBXY}_replicate, %{_bindir}/${DBXY}_replicate, $MYPATH)
++AC_PATH_PROG(__DBSQL, ${DBXY}sql, %{_bindir}/${DBXY}sql, $MYPATH)
++AC_PATH_PROG(__DB_SQL_CODEGEN, ${DBXY}_sql_codegen, %{_bindir}/${DBXY}_sql_codegen, $MYPATH)
++AC_PATH_PROG(__DB_STAT, ${DBXY}_stat, %{_bindir}/${DBXY}_stat, $MYPATH)
++AC_PATH_PROG(__DB_TUNER, ${DBXY}_tuner, %{_bindir}/${DBXY}_tuner, $MYPATH)
++AC_PATH_PROG(__DB_UPGRADE, ${DBXY}_upgrade, %{_bindir}/${DBXY}_upgrade, $MYPATH)
++AC_PATH_PROG(__DB_VERIFY, ${DBXY}_verify, %{_bindir}/${DBXY}_verify, $MYPATH)
++
+ AC_ARG_WITH(db-largefile, AS_HELP_STRING([--with-db-largefile], [build Berkeley-DB with LARGEFILE support]))
+ AC_ARG_WITH(db-mutex, AS_HELP_STRING([--with-db-mutex=ARG], [build Berkeley-DB with MUTEX type ARG]))
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db60.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db60.patch
new file mode 100644
index 000000000..b4df8b751
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db60.patch
@@ -0,0 +1,56 @@
+Set the DB 6 version to match oe-core db 6.0.30
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm/configure.ac
+===================================================================
+--- rpm.orig/configure.ac
++++ rpm/configure.ac
+@@ -2049,10 +2049,10 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ ]])],
+ [RPM_CHECK_LIB(
+ [Berkeley-DB], [db],
+- [db-6.1], [db_create], [db.h],
++ [db-6.0], [db_create], [db.h],
+ [yes,external], [db6],
+ [ DBLIBSRCS="$DBLIBSRCS db3.c"
+- DBXY=db61
++ DBXY=db60
+ AM_CONDITIONAL(WITH_DB, [ true ])
+ AM_CONDITIONAL(WITH_DB_INTERNAL, [ test ".$RPM_CHECK_LIB_LOCATION" = .internal ])
+ if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then
+@@ -2085,7 +2085,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ ])
+ ])
+
+-if test ".$ac_cv_lib_db_6_1_db_create" != .yes -a ".$ac_cv_lib_db_5_3_db_create" != .yes; then
++if test ".$ac_cv_lib_db_6_0_db_create" != .yes -a ".$ac_cv_lib_db_5_3_db_create" != .yes; then
+ CPPFLAGS="${CPPFLAGS_save}"
+ fi
+
+@@ -2097,11 +2097,11 @@ RPM_CHECK_LIB(
+ [ DBLIBSRCS="$DBLIBSRCS sqlite.c" ],
+ [])
+
+-dnl # Sqlite 3.8.3.1 from db-6.1.19
+-if test ".$ac_cv_lib_db_6_1_db_create" = .yes; then
++dnl # Sqlite 3.8.3.1 from db-6.0.30
++if test ".$ac_cv_lib_db_6_0_db_create" = .yes; then
+ RPM_CHECK_LIB(
+ [Berkeley-DB (+SQLite3)], [dbsql],
+- [db_sql-6.1], [sqlite3_open], [dbsql.h],
++ [db_sql-6.0], [sqlite3_open], [dbsql.h],
+ [yes,external], [db6/sql],
+ [
+ AM_CONDITIONAL(WITH_DBSQL, [ true ])
+@@ -2253,7 +2253,7 @@ AC_SUBST(WITH_RUBY_CPPFLAGS)
+ AC_SUBST(WITH_RUBY_SUBDIR)
+ AC_SUBST(WITH_RUBY_VENDORARCHDIR)
+
+-dnl # Java prerequisites (swiped from db-6.1.19/dist/aclocal_java et al)
++dnl # Java prerequisites (swiped from db-6.0.30/dist/aclocal_java et al)
+ WITH_JAVA=no
+ AC_ARG_WITH([java],
+ AS_HELP_STRING([--with-java], [build RPM with java support]),
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db_buffer_small.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db_buffer_small.patch
new file mode 100644
index 000000000..16b8e30a1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db_buffer_small.patch
@@ -0,0 +1,77 @@
+In certain cases with BerkleyDB 5.3.x we are getting the error:
+
+db3.c:1443: dbcursor->pget(-30999): BDB0063 DB_BUFFER_SMALL: User memory too small for return value
+
+See https://bugs.launchpad.net/rpm/+bug/934420 for more information.
+
+It appears to be some type of a bug in the BerkleyDB 5.3.x. In an attempt
+to workaround the problem, when we encounter this situation we attempt
+to adjust the size of the mmap buffer until the call works, or we
+end up trying 10 times. The new size is either the updated vp->size
+from the failed pget call, or the previous size + 1024.
+
+If DBI debugging is enabled, additional diagnostics are printed, otherwise
+a basic retry and success message is added to show that the failure was
+resolved.
+
+Upstream-Status: Inappropriate (workaround)
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/rpmdb/rpmdb.c
+===================================================================
+--- rpm-5.4.14.orig/rpmdb/rpmdb.c
++++ rpm-5.4.14/rpmdb/rpmdb.c
+@@ -2212,8 +2212,12 @@ static int rpmmiGet(dbiIndex dbi, DBC *
+ vp->flags |= DB_DBT_USERMEM;
+ rc = dbiGet(dbi, dbcursor, kp, vp, flags);
+ if (rc == DB_BUFFER_SMALL) {
++ int retry = 0;
++ size_t origlen = vp->size;
+ size_t uhlen = vp->size;
+- void * uh = mmap(NULL, uhlen, _prot, _flags, _fdno, _off);
++ void * uh;
++retry_get:
++ uh = mmap(NULL, uhlen, _prot, _flags, _fdno, _off);
+ if (uh == NULL || uh == (void *)-1)
+ fprintf(stderr,
+ "==> mmap(%p[%u], 0x%x, 0x%x, %d, 0x%x) error(%d): %s\n",
+@@ -2235,6 +2239,25 @@ static int rpmmiGet(dbiIndex dbi, DBC *
+ if (munmap(uh, uhlen) != 0)
+ fprintf(stderr, "==> munmap(%p[%u]) error(%d): %s\n",
+ uh, (unsigned)uhlen, errno, strerror(errno));
++ /* We want to be sure to limit the number of retry attempts to avoid a loop! */
++ if (rc == DB_BUFFER_SMALL && retry < 10) {
++ /* If we got a largr vp-size back, use that, otherwise increment the size by 1k */
++ uhlen = vp->size > uhlen ? vp->size : uhlen + 1024;
++ retry++;
++ if ((dbi)->dbi_debug)
++ fprintf(stderr, "==> DB_BUFFER_SMALL orig requested (%d), configured (%d), forcing larger buffer (%d), new size (%d)\n",
++ origlen, vp->ulen, uhlen, vp->size);
++ else
++ fprintf(stderr, "==> retry (%d) db3cpget (%d)\n", retry, uhlen);
++ goto retry_get;
++ }
++ }
++ if (retry) {
++ if ((dbi)->dbi_debug)
++ fprintf(stderr, "==> success orig requested (%d), configured buffer (%d), buffer (%d), size after dbiGet (%d)\n",
++ origlen, vp->ulen, uhlen, vp->size);
++ else
++ fprintf(stderr, "==> success\n");
+ }
+ }
+ } else
+Index: rpm-5.4.14/rpmdb/db3.c
+===================================================================
+--- rpm-5.4.14.orig/rpmdb/db3.c
++++ rpm-5.4.14/rpmdb/db3.c
+@@ -1509,7 +1509,7 @@ assert(db != NULL);
+ #endif
+ }
+
+-DBIDEBUG(dbi, (stderr, "<-- %s(%p,%p,%p,%p,%p,0x%x) rc %d %s%s\n", __FUNCTION__, dbi, dbcursor, key, pkey, data, flags, rc, _DBCFLAGS(flags), _KEYDATA(key, pkey, data, NULL)));
++DBIDEBUG(dbi, (stderr, "<-- %s(%p,%p,%p,%p,%p,0x%x) rc %d %s%s\n", __FUNCTION__, dbi, dbcursor, key, pkey, data, flags, rc, _DBCFLAGS(flags), _KEYDATA(key, pkey, rc == DB_BUFFER_SMALL ? NULL : data, NULL)));
+ return rc;
+ }
+ /*@=mustmod@*/
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-debug-platform.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-debug-platform.patch
new file mode 100644
index 000000000..2eb6e0f26
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-debug-platform.patch
@@ -0,0 +1,65 @@
+Debug the platform score generation...
+
+Index: rpm-5.4.14/lib/rpmrc.c
+===================================================================
+--- rpm-5.4.14.orig/lib/rpmrc.c
++++ rpm-5.4.14/lib/rpmrc.c
+@@ -465,6 +465,8 @@ static rpmRC rpmPlatform(const char * pl
+
+ rc = (rpmRC) rpmiobSlurp(platform, &iob);
+
++ fprintf(stderr, "D: rpmPlatform file %s\n", platform);
++
+ if (rc || iob == NULL) {
+ rc = RPMRC_FAIL;
+ goto exit;
+@@ -486,6 +488,7 @@ static rpmRC rpmPlatform(const char * pl
+ while (--t > p && xisspace(*t))
+ *t = '\0';
+ if (t > p) {
++ fprintf(stderr, "D: rpmPlatform mireAppend REGEX %s\n", p);
+ xx = mireAppend(RPMMIRE_REGEX, 0, p, NULL, &mi_re, &mi_nre);
+ }
+ continue;
+@@ -503,6 +506,11 @@ static rpmRC rpmPlatform(const char * pl
+ _gnu = rpmExpand("-", cvog->gnu, NULL);
+
+ addMacro(NULL, "_platform_gnu", NULL, (_gnu ? _gnu : ""), -1);
++ fprintf(stderr, "D: rpmPlatform addMacro %s-%s-%s(%s)\n",
++ rpmExpand("%{_platform_cpu}", NULL),
++ rpmExpand("%{_platform_vendor}", NULL),
++ rpmExpand("%{_platform_os}", NULL),
++ rpmExpand("%{_platform_gnu}", NULL));
+ #else
+ addMacro(NULL, "_host_cpu", NULL, cvog->cpu, -1);
+ addMacro(NULL, "_host_vendor", NULL, cvog->vendor, -1);
+@@ -510,6 +518,7 @@ static rpmRC rpmPlatform(const char * pl
+ #endif
+ }
+
++ fprintf(stderr, "D: rpmPlatform mireAppend STRCMP %s -- ", p);
+ #if !defined(RPM_VENDOR_OE) /* Skip the explicit-platform */
+ #if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */
+ /* do not use vendor and GNU attribution */
+@@ -519,6 +528,7 @@ static rpmRC rpmPlatform(const char * pl
+ (cvog && *cvog->gnu ? "-" : NULL),
+ (cvog ? cvog->gnu : NULL), NULL);
+ #endif
++ fprintf(stderr, "%s\n", p);
+ xx = mireAppend(RPMMIRE_STRCMP, 0, p, NULL, &mi_re, &mi_nre);
+ p = _free(p);
+ #endif
+@@ -688,9 +698,12 @@ int rpmPlatformScore(const char * platfo
+
+ if ((mire = (miRE) mi_re) != NULL)
+ for (i = 0; i < mi_nre; i++) {
+- if (mireRegexec(mire + i, platform, 0) >= 0)
++ if (mireRegexec(mire + i, platform, 0) >= 0) {
++ fprintf(stderr, "D: rpmPlatformScore %s (%d)\n", platform, i + 1);
+ return (i + 1);
++ }
+ }
++ fprintf(stderr, "D: rpmPlatformScore %s (%d)\n", platform, 0);
+ return 0;
+ }
+ /*@=onlytrans@*/
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-disable-auto-stack-protector.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-disable-auto-stack-protector.patch
new file mode 100644
index 000000000..124606c0d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-disable-auto-stack-protector.patch
@@ -0,0 +1,24 @@
+Make security switches manual settings
+
+RPM checks for the availability of the stack protector switch and
+transactional-memory support. If supported it unconditionally
+enables the compiler options which can cause errors if the support has
+not been built into the compiler.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.15/configure.ac
+===================================================================
+--- rpm-5.4.15.orig/configure.ac
++++ rpm-5.4.15/configure.ac
+@@ -425,7 +425,7 @@ dnl # rpm_CFLAGS_ADD([-fstack-arrays],[
+ dnl # build RPM instrumented for extra optimization/security (GCC only)
+ dnl # --- other optimizations
+ rpm_CFLAGS_ADD([-fexceptions], [RPM_CFLAGS])
+- rpm_CFLAGS_ADD([-D_FORTIFY_SOURCE=2 -fstack-protector], [RPM_CFLAGS])
++dnl rpm_CFLAGS_ADD([-D_FORTIFY_SOURCE=2 -fstack-protector], [RPM_CFLAGS])
+ dnl # rpm_CFLAGS_ADD([-fstack-protector-all],[RPM_CFLAGS])
+
+ if test \( ".`$CC --version 2>&1 | grep 'GCC'`" != . \); then
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-disable-blaketest.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-disable-blaketest.patch
new file mode 100644
index 000000000..adbef6df8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-disable-blaketest.patch
@@ -0,0 +1,28 @@
+rpmio: Disable building of the tblake2 test(s).
+
+There is some type of a dependency fault here that can occasionally result in:
+
+gcc: error: tblake2b.o: No such file or directory
+or
+gcc: error: tblake2bp.o: No such file or directory
+
+These items are simply test cases that are not packaged, so they can be
+safely disabled to resolve the dependency issue.
+
+Upstream-Status: Inappropriate [workaround]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.15/rpmio/Makefile.am
+===================================================================
+--- rpm-5.4.15.orig/rpmio/Makefile.am
++++ rpm-5.4.15/rpmio/Makefile.am
+@@ -29,7 +29,7 @@ EXTRA_PROGRAMS += bsdiff bspatch pcrsed
+ tmire todbc toid tperl tpython tput trpmio tsexp tsvn tsw ttcl \
+ dumpasn1 lookup3 trel twitter github tmicrojson duk
+
+-noinst_PROGRAMS += b2sum tset tblake2b tblake2bp tblake2s tblake2sp tgfs
++#noinst_PROGRAMS += b2sum tset tblake2b tblake2bp tblake2s tblake2sp tgfs
+ if WITH_LIBGIT2
+ noinst_PROGRAMS += tgit
+ else
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fileclass.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fileclass.patch
new file mode 100644
index 000000000..b1db6fff7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fileclass.patch
@@ -0,0 +1,36 @@
+rpmfc.c: Always generate per-file information
+
+Even when the per-file dependency generate is disabled, we want to generate
+per file classification and other associated data.
+
+Note: this is a temporary workaround. Eventually we will want to have a way
+to seed per-file dependency and other information in order to generate a
+package from previously determined information.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/lib/rpmfc.c
+===================================================================
+--- rpm-5.4.14.orig/lib/rpmfc.c
++++ rpm-5.4.14/lib/rpmfc.c
+@@ -1734,7 +1734,6 @@ rpmRC rpmfcGenerateDepends(void * _spec,
+ /* ... then generate dependencies using %{__find_requires} et al. */
+ rc = rpmfcGenerateDependsHelper(spec, pkg, fi);
+ printDeps(pkg->header);
+- return rc;
+ }
+
+ /* Generate scriptlet Dependencies. */
+@@ -1762,8 +1761,8 @@ rpmRC rpmfcGenerateDepends(void * _spec,
+ av[ac] = NULL;
+
+ fc = rpmfcNew();
+- fc->skipProv = !pkg->autoProv;
+- fc->skipReq = !pkg->autoReq;
++ fc->skipProv = !pkg->autoProv || !internaldeps;
++ fc->skipReq = !pkg->autoReq || !internaldeps;
+ fc->tracked = 0;
+
+ { const char * buildRootURL;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fix-logio-cp.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fix-logio-cp.patch
new file mode 100644
index 000000000..290ec1aa1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fix-logio-cp.patch
@@ -0,0 +1,30 @@
+Occasionally the cp -p fails with a non-zero return code. This will cause
+the system abort the build.
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm/rpmdb/Makefile.am
+===================================================================
+--- rpm.orig/rpmdb/Makefile.am
++++ rpm/rpmdb/Makefile.am
+@@ -234,11 +234,14 @@ lcov-report:
+ #lcov-upload: lcov
+ # rsync -rvz -e ssh --delete lcov/* ???
+
++$(builddir)/logio_recover_template: $(srcdir)/logio_recover_template
++ @if test ".$(builddir)" != ".$(srcdir)"; then \
++ cp -fp $(srcdir)/logio_recover_template \
++ $(builddir)/logio_recover_template ; \
++ fi
++
+ logio_BUILT = logio_auto.c logio_autop.c logio_auto.h logio_template
+-$(logio_BUILT): logio.awk logio.src logio_recover_template
+- @test -e $(builddir)/logio_recover_template || \
+- cp -p $(srcdir)/logio_recover_template \
+- $(builddir)/logio_recover_template
++$(logio_BUILT): logio.awk logio.src $(builddir)/logio_recover_template
+ @rm -f $(logio_BUILT)
+ @$(AWK) -f $(srcdir)/logio.awk \
+ -v header_file=logio_auto.h \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fix-lua-tests-compilation-failure.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fix-lua-tests-compilation-failure.patch
new file mode 100644
index 000000000..1a08243ab
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fix-lua-tests-compilation-failure.patch
@@ -0,0 +1,43 @@
+Upstream-Status: Pending
+
+Subject: lua: fix to build test libs correctly
+
+This patch fixes errors like below.
+
+ | gcc: error: lib21.c: No such file or directory
+ | gcc: fatal error: no input files
+
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ lua/tests/libs/Makefile.am | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/lua/tests/libs/Makefile.am b/lua/tests/libs/Makefile.am
+index 19d1a0b..1e5de72 100644
+--- a/lua/tests/libs/Makefile.am
++++ b/lua/tests/libs/Makefile.am
+@@ -28,16 +28,16 @@ clean:
+ rm -f lib1.so lib11.so lib2.so lib21.so lib2-v2.so
+
+ lib1.so: lib1.c
+- $(CC) $(CFLAGS) -o lib1.so lib1.c
++ $(CC) $(CFLAGS) -o lib1.so $(top_srcdir)/lua/tests/libs/lib1.c
+
+ lib11.so: lib11.c
+- $(CC) $(CFLAGS) -o lib11.so lib11.c
++ $(CC) $(CFLAGS) -o lib11.so $(top_srcdir)/lua/tests/libs/lib11.c
+
+ lib2.so: lib2.c
+- $(CC) $(CFLAGS) -o lib2.so lib2.c
++ $(CC) $(CFLAGS) -o lib2.so $(top_srcdir)/lua/tests/libs/lib2.c
+
+ lib21.so: lib21.c
+- $(CC) $(CFLAGS) -o lib21.so lib21.c
++ $(CC) $(CFLAGS) -o lib21.so $(top_srcdir)/lua/tests/libs/lib21.c
+
+ lib2-v2.so: lib2.so
+ mv lib2.so ./lib2-v2.so
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fix-parseEmbedded.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fix-parseEmbedded.patch
new file mode 100644
index 000000000..c57f24cd7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fix-parseEmbedded.patch
@@ -0,0 +1,27 @@
+Fix an issue where parseEmbedded is not defined, but is still used.
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm/rpmio/macro.c
+===================================================================
+--- rpm.orig/rpmio/macro.c
++++ rpm/rpmio/macro.c
+@@ -1616,8 +1616,6 @@ exit:
+ * @retval *avp invocation args
+ * @return script string
+ */
+-#if defined(WITH_AUGEAS) || defined(WITH_FICL) || defined(WITH_MOZJS) || defined(WITH_JNIEMBED) || defined(WITH_PERLEMBED) || defined(WITH_PYTHONEMBED) || defined(WITH_RUBYEMBED) || defined(WITH_MRUBY_EMBED) || defined(WITH_SQLITE) || defined(WITH_SQUIRREL) || defined(WITH_TCL)
+-
+ static char _FIXME_embedded_interpreter_eval_returned_null[] =
+ "FIXME: embedded interpreter eval returned null.";
+
+@@ -1668,7 +1666,6 @@ bingo:
+ script[nb] = '\0';
+ return script;
+ }
+-#endif
+
+ /**
+ * The main macro recursion loop.
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-gnu-atomic.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-gnu-atomic.patch
new file mode 100644
index 000000000..36a418fc6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-gnu-atomic.patch
@@ -0,0 +1,64 @@
+configure.ac: Check if the current compiler supports the transactions
+
+Some distributions appear to have compilers that are built without support
+for transactions, even though they are GCC 4.7 or newer.
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.15/configure.ac
+===================================================================
+--- rpm-5.4.15.orig/configure.ac
++++ rpm-5.4.15/configure.ac
+@@ -425,9 +425,34 @@ dnl # --- other optimizations
+ rpm_CFLAGS_ADD([-D_FORTIFY_SOURCE=2 -fstack-protector], [RPM_CFLAGS])
+ dnl # rpm_CFLAGS_ADD([-fstack-protector-all],[RPM_CFLAGS])
+
+- if test \( ".`$CC --version 2>&1 | grep 'GCC'`" != . \); then
+- rpm_CFLAGS_ADD([-fgnu-tm], [RPM_CFLAGS])
+- fi
++dnl # Check if the current gcc supports -fgnu-tm and __transaction_atomic
++AC_MSG_CHECKING([If the compiler supports __transaction_atomic])
++save_CFLAGS="$CFLAGS"
++save_LDFLAGS="$LDFLAGS"
++CFLAGS="${CFLAGS} -fgnu-tm -litm"
++LDFLAGS="${LDFLAGS} -litm"
++AC_LINK_IFELSE([AC_LANG_SOURCE([[
++int
++main()
++{
++#if !__clang__ && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 7) || (__GNUC__ > 4)) /* XXX gud enuf? */
++ int i = 0;
++ __transaction_atomic { i++; }
++#else
++# error Compiler does not support __transaction_atomic
++#endif
++ return 0;
++}
++]])], [
++ AC_DEFINE([HAVE_GNUC_TM_ATOMIC], [1],
++ [Define to 1 if the compiler supports __transaction_atomic.])
++ AC_MSG_RESULT([yes])
++], [
++ CFLAGS="$save_CFLAGS"
++ LDFLAGS="$save_LDFLAGS"
++ AC_MSG_RESULT([no])
++])
++
+
+ dnl # --- options below are added to RPM_CFLAGS but _NOT_ added to CFLAGS
+ CPPFLAGS="$CPPFLAGS $RPM_CPPFLAGS"
+Index: rpm-5.4.15/rpmio/rpmutil.h
+===================================================================
+--- rpm-5.4.15.orig/rpmio/rpmutil.h
++++ rpm-5.4.15/rpmio/rpmutil.h
+@@ -105,7 +105,7 @@
+ # define RPM_GNUC_INTERNAL
+ #endif
+
+-#if !__clang__ && __GNUC__ == 4 && __GNUC_MINOR__ >= 7 /* XXX gud enuf? */
++#ifdef HAVE_GNUC_TM_ATOMIC
+ # define RPM_GNUC_TM_SAFE __attribute__((transaction_safe))
+ # define RPM_GNUC_TM_PURE __attribute__((transaction_pure))
+ # define RPM_GNUC_TM_CALLABLE __attribute__((transaction_callable))
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-hardlink-segfault-fix.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-hardlink-segfault-fix.patch
new file mode 100644
index 000000000..057925fb6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-hardlink-segfault-fix.patch
@@ -0,0 +1,43 @@
+We need to sanity check that the nlink size and our linksLeft counter
+do match. If an rpm is badly constructed with identical inode values
+for multiple hardlinked files, such an rpm will otherwise access memory
+out of array bounds and cause memory corruption and crashes.
+
+The fix is to add in the sanity check and exit if bad circumstances
+are found. We need to fix the caller to check the return code too.
+
+RP 2014/6/10
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Index: rpm-5.4.14/lib/fsm.c
+===================================================================
+--- rpm-5.4.14.orig/lib/fsm.c
++++ rpm-5.4.14/lib/fsm.c
+@@ -495,6 +495,11 @@ static int saveHardLink(/*@special@*/ /*
+ }
+
+ if (fsm->goal == IOSM_PKGBUILD) --fsm->li->linksLeft;
++ if (fsm->li->linksLeft > st->st_nlink) {
++ rpmlog(RPMLOG_ERR, _("Corrupted hardlinks found (count %d does not match %d), exiting.\n"), fsm->li->linksLeft, st->st_nlink);
++ return -1;
++ }
++
+ fsm->li->filex[fsm->li->linksLeft] = fsm->ix;
+ /*@-observertrans -dependenttrans@*/
+ fsm->li->nsuffix[fsm->li->linksLeft] = fsm->nsuffix;
+@@ -1878,8 +1883,13 @@ if (!(fsmGetFi(fsm)->mapflags & IOSM_PAY
+ fsm->postpone = iosmFileActionSkipped(fsm->action);
+ if (fsm->goal == IOSM_PKGINSTALL || fsm->goal == IOSM_PKGBUILD) {
+ /*@-evalorder@*/ /* FIX: saveHardLink can modify fsm */
+- if (S_ISREG(st->st_mode) && st->st_nlink > 1)
++ if (S_ISREG(st->st_mode) && st->st_nlink > 1) {
+ fsm->postpone = saveHardLink(fsm);
++ if (fsm->postpone < 0) {
++ rc = RPMRC_FAIL;
++ break;
++ }
++ }
+ /*@=evalorder@*/
+ }
+ if (fsmGetFi(fsm)->mapflags & IOSM_PAYLOAD_LIST) fsm->postpone = 1;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-keccak-sse-intrin.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-keccak-sse-intrin.patch
new file mode 100644
index 000000000..72884d4ad
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-keccak-sse-intrin.patch
@@ -0,0 +1,27 @@
+rpm - rpmio/keccak.c: make SSE/MMX dependent upon gcc config
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.15/rpmio/keccak.c
+===================================================================
+--- rpm-5.4.15.orig/rpmio/keccak.c
++++ rpm-5.4.15/rpmio/keccak.c
+@@ -17,9 +17,13 @@ http://keccak.noekeon.org/
+ #if OPTIMIZED == 64
+ /* ===== "KeccakOpt64-settings.h" */
+ #define Unrolling 18
+-//#define UseBebigokimisa
+-#define UseSSE
+-//#define UseMMX
++#if defined(__SSE2__)
++ #define UseSSE
++#elif defined(__MMX__)
++ #define UseMMX
++#else
++ #define UseBebigokimisa
++#endif
+ /* ===== */
+ #endif
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-lib-transaction.c-fix-file-conflicts-for-mips64-N32.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-lib-transaction.c-fix-file-conflicts-for-mips64-N32.patch
new file mode 100644
index 000000000..1a48db63c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-lib-transaction.c-fix-file-conflicts-for-mips64-N32.patch
@@ -0,0 +1,52 @@
+From 67ec7531e6297200eaa97ef917d49b0a75876cb4 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 2 Dec 2015 00:56:07 -0800
+Subject: [PATCH] lib/transaction.c: fix file conflicts for MIPS64 N32
+
+The following error can occur:
+ smart install libc6-2.22-r0.1@lib32_mips32r2octeon3 libc6-dbg-2.22-r0.1@lib32_mips32r2octeon3
+error: file /sbin/ldconfig conflicts between attempted installs of libc6-2.22-r0.1.lib32_mips32r2octeon3 and libc6-2.22-r0.1.octeon3_n32
+error: file /sbin/.debug/ldconfig conflicts between attempted installs of libc6-dbg-2.22-r0.1.lib32_mips32r2octeon3 and libc6-dbg-2.22-r0.1.octeon3_n32
+
+This was because:
+transactions_color = 001 (ELF32) & 010 (ELF64) & 100 (ELF32 N32 MIPS64)
+FColor = Current file color (001) & transaction_color (111)
+oFcolor = Previous file color (100) & transaction_color (111)
+
+There are two places where the conflict comparisons occur. In both places
+the 'else' clause was too restrictive (opposite of the 'positive' clause).
+This caused the system to only permit a binary comparison - "new preferred" or
+"old preferred". It did not permissing "neither preferred". By removing the
+else comparison the system will now perform a 'last-in-wins' resolution when
+"neither is preferred".
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+---
+ lib/transaction.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+Index: rpm-5.4.14/lib/transaction.c
+===================================================================
+--- rpm-5.4.14.orig/lib/transaction.c
++++ rpm-5.4.14/lib/transaction.c
+@@ -154,7 +154,7 @@ static int handleInstInstalledFile(const
+ fi->actions[fx] = FA_SKIPCOLOR;
+ #endif
+ rConflicts = 0;
+- } else if (FColor & prefcolor) {
++ } else {
+ #ifdef REFERENCE
+ rpmfsSetAction(fs, fx, FA_CREATE);
+ #else
+@@ -420,7 +420,7 @@ assert(otherFi != NULL);
+ fi->actions[i] = FA_SKIPCOLOR;
+ rConflicts = 0;
+ } else
+- if (FColor == 0 && oFColor == 0) {
++ {
+ /* ... otherwise, do both, last in wins. */
+ otherFi->actions[otherFileNum] = FA_CREATE;
+ fi->actions[i] = FA_CREATE;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-libsql-fix.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-libsql-fix.patch
new file mode 100644
index 000000000..e87e02b69
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-libsql-fix.patch
@@ -0,0 +1,22 @@
+During installation, the libtool relink attempts to link to -lrpm...
+The problem is that it hasn't been installed yet! So small change causes
+the libtool to instead use the build version.
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/lib/Makefile.am
+===================================================================
+--- rpm-5.4.14.orig/lib/Makefile.am
++++ rpm-5.4.14/lib/Makefile.am
+@@ -120,6 +120,9 @@ librpm.la: $(librpm_la_OBJECTS) $(librpm
+ #libsql_la_SOURCES = libsql.c
+ #libsql_la_LIBADD = librpm.la $(RPMDB_LDADD_COMMON)
+
++# pkglib libraries needs to have usrlib libraries already installed!
++install-pkglibLTLIBRARIES: install-usrlibLTLIBRARIES
++
+ install-data-hook:
+ if !ENABLE_BUILD_LAFILES
+ -for l in $(usrlib_LTLIBRARIES); do \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-log-auto-rm.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-log-auto-rm.patch
new file mode 100644
index 000000000..3153f7a38
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-log-auto-rm.patch
@@ -0,0 +1,15 @@
+
+Upstream-Status: Inappropriate [configuration]
+
+Index: rpm-5.4.14/rpmdb/DB_CONFIG.in
+===================================================================
+--- rpm-5.4.14.orig/rpmdb/DB_CONFIG.in
++++ rpm-5.4.14/rpmdb/DB_CONFIG.in
+@@ -4,6 +4,7 @@ set_data_dir .
+ set_create_dir .
+ set_lg_dir ./log
+ set_tmp_dir ./tmp
++set_flags db_log_autoremove on
+
+ # -- thread_count must be >= 8
+ set_thread_count 64
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-lsb-compatibility.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-lsb-compatibility.patch
new file mode 100644
index 000000000..a87518ba3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-lsb-compatibility.patch
@@ -0,0 +1,24 @@
+Enable platform tag matching workaround in OE.
+
+When installing some LSB packages the 'platform' field in the package
+appears to be invalid. Instead of relying solely on the platform comparison
+we also want to generate a perceived platform based on the valid rpm contents
+of arch and os.
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/lib/depends.c
+===================================================================
+--- rpm-5.4.14.orig/lib/depends.c
++++ rpm-5.4.14/lib/depends.c
+@@ -595,7 +595,7 @@ int rpmtsAddInstallElement(rpmts ts, Hea
+ platform = rpmExpand(arch, "-unknown-", os, NULL);
+
+ rc = rpmPlatformScore(platform, platpat, nplatpat);
+-#if defined(RPM_VENDOR_MANDRIVA)
++#if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_OE)
+ /*
+ * If no match on platform tag, we'll try again with arch tag
+ * in case platform tag is inconsistent with it, which is the case
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-lua.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-lua.patch
new file mode 100644
index 000000000..a9930d670
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-lua.patch
@@ -0,0 +1,33 @@
+Add support for cross compiling lua
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/configure.ac
+===================================================================
+--- rpm-5.4.14.orig/configure.ac
++++ rpm-5.4.14/configure.ac
+@@ -121,6 +121,9 @@ AC_PROG_YACC
+
+ AC_PATH_PROG(AS, as, as)
+
++CC_FOR_BUILD=${CC_FOR_BUILD-\$(CC)}
++AC_SUBST(CC_FOR_BUILD)
++
+ dnl # GCC specifics
+ AC_PROG_GCC_TRADITIONAL
+ AC_ARG_ENABLE(build-pic,
+Index: rpm-5.4.14/lua/Makefile.am
+===================================================================
+--- rpm-5.4.14.orig/lua/Makefile.am
++++ rpm-5.4.14/lua/Makefile.am
+@@ -41,7 +41,7 @@ rpmluac_LDADD = liblua.la
+
+ # --- bin2c doesn't need anything but a compiler
+ bin2c$(EXEEXT): bin2c.c
+- $(CC) -o $@ $<
++ $(CC_FOR_BUILD) -o $@ $<
+
+ liblua_la_SOURCES =
+ liblua_la_CFLAGS = @WITH_LUA_SUBDIR_DEF@
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-macros.in-disable-external-key-server.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-macros.in-disable-external-key-server.patch
new file mode 100644
index 000000000..a08412aa9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-macros.in-disable-external-key-server.patch
@@ -0,0 +1,31 @@
+disable external key server
+
+Upstream-Status: Pending
+
+When RPM experiences a signed package, with a signature that it does NOT know.
+By default it will send the -fingerprint- (and only the 16 digit fingerprint) to
+an external HKP server, trying to get the key down.
+
+This is probably not a reasonable default behavior for the system to do, instead
+it should simply fail the key lookup. If someone wants to enable the HKP server
+it's easy enough to do by enabling the necessary macros.
+
+Signed-off-by: yzhu1 <yanjun.zhu@windriver.com>
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Index: rpm/macros/macros.in
+===================================================================
+--- rpm.orig/macros/macros.in
++++ rpm/macros/macros.in
+@@ -563,10 +563,10 @@ $_arbitrary_tags_tests Foo:Bar
+
+ # Horowitz Key Protocol server configuration
+ #
+-%_hkp_keyserver hkp://keys.rpm5.org
++#%_hkp_keyserver hkp://keys.rpm5.org
+ #%_hkp_keyserver hkp://keys.n3npq.net
+ #%_hkp_keyserver hkp://pool.sks-keyservers.net
+-%_hkp_keyserver_query %{_hkp_keyserver}/pks/lookup?op=get&search=
++#%_hkp_keyserver_query %{_hkp_keyserver}/pks/lookup?op=get&search=
+
+
+ # NSS_InitContext() parameter configuration
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-macros.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-macros.patch
new file mode 100644
index 000000000..c7ab2d2bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-macros.patch
@@ -0,0 +1,64 @@
+macros/macros.in: Revert settings to the same as RPM 5.4.0
+
+Enable a reasonable set of rpmdeps dependency helper macros. These sets
+were used by RPM 5.4.0.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/macros/macros.in
+===================================================================
+--- rpm-5.4.14.orig/macros/macros.in
++++ rpm-5.4.14/macros/macros.in
+@@ -1022,7 +1022,7 @@ $_arbitrary_tags_tests Foo:Bar
+
+ #==============================================================================
+ # ---- rpmbuild macros.
+-#%%{load:%{_usrlibrpm}/macros.rpmbuild}
++%{load:%{_usrlibrpm}/macros.rpmbuild}
+
+ #------------------------------------------------------------------------
+ # cmake(...) configuration
+@@ -1038,15 +1038,15 @@ $_arbitrary_tags_tests Foo:Bar
+
+ #------------------------------------------------------------------------
+ # perl(...) configuration
+-#%%{load:%{_usrlibrpm}/macros.d/perl}
++%{load:%{_usrlibrpm}/macros.d/perl}
+
+ #------------------------------------------------------------------------
+ # python(...) configuration.
+-#%%{load:%{_usrlibrpm}/macros.d/python}
++%{load:%{_usrlibrpm}/macros.d/python}
+
+ #------------------------------------------------------------------------
+ # php(...) configuration.
+-#%%{load:%{_usrlibrpm}/macros.d/php}
++%{load:%{_usrlibrpm}/macros.d/php}
+
+ #------------------------------------------------------------------------
+ # java(...) configuration.
+@@ -1054,11 +1054,11 @@ $_arbitrary_tags_tests Foo:Bar
+
+ #------------------------------------------------------------------------
+ # libtool(...) configuration.
+-#%%{load:%{_usrlibrpm}/macros.d/libtool}
++%{load:%{_usrlibrpm}/macros.d/libtool}
+
+ #------------------------------------------------------------------------
+ # pkgconfig(...) configuration.
+-#%%{load:%{_usrlibrpm}/macros.d/pkgconfig}
++%{load:%{_usrlibrpm}/macros.d/pkgconfig}
+
+ #------------------------------------------------------------------------
+ # mono(...) configuration.
+@@ -1070,7 +1070,7 @@ $_arbitrary_tags_tests Foo:Bar
+
+ #------------------------------------------------------------------------
+ # tcl(...) configuration.
+-#%%{load:%{_usrlibrpm}/macros.d/tcl}
++%{load:%{_usrlibrpm}/macros.d/tcl}
+
+ #------------------------------------------------------------------------
+ # typelib(...) configuration.
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-mongodb-sasl.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-mongodb-sasl.patch
new file mode 100644
index 000000000..6c3e4718b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-mongodb-sasl.patch
@@ -0,0 +1,69 @@
+Fix errors when building with sasl2 disabled
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm/rpmio/mongoc.c
+===================================================================
+--- rpm.orig/rpmio/mongoc.c
++++ rpm/rpmio/mongoc.c
+@@ -39,8 +39,10 @@
+ # include <winerror.h>
+ #endif
+
++#ifdef HAVE_LIBSASL2
+ #include <sasl/sasl.h>
+ #include <sasl/saslutil.h>
++#endif
+
+ #include <openssl/bio.h>
+ #include <openssl/ssl.h>
+@@ -14228,6 +14230,7 @@ mongoc_read_prefs_copy (const mongoc_rea
+ return ret;
+ }
+
++#ifdef MONGOC_ENABLE_SASL
+ /*==============================================================*/
+ /* --- mongoc-sasl.c */
+
+@@ -14555,6 +14558,7 @@ _mongoc_sasl_step (mongoc_sasl_t *sasl,
+
+ return true;
+ }
++#endif
+
+ /*==============================================================*/
+ /* --- mongoc-socket.c */
+Index: rpm/rpmio/mongoc.h
+===================================================================
+--- rpm.orig/rpmio/mongoc.h
++++ rpm/rpmio/mongoc.h
+@@ -38,8 +38,10 @@
+ # include <sys/un.h>
+ #endif
+
++#ifdef HAVE_LIBSASL2
+ #include <sasl/sasl.h>
+ #include <sasl/saslutil.h>
++#endif
+
+ #include <openssl/bio.h>
+ #include <openssl/ssl.h>
+@@ -2455,6 +2457,8 @@ BSON_END_DECLS
+ /*==============================================================*/
+ /* --- mongoc-sasl-private.h */
+
++#ifdef MONGOC_ENABLE_SASL
++
+ BSON_BEGIN_DECLS
+
+
+@@ -2498,6 +2502,7 @@ bool _mongoc_sasl_step (mong
+
+
+ BSON_END_DECLS
++#endif
+
+ /*==============================================================*/
+ /* --- mongoc-ssl-private.h */
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-no-loopmsg.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-no-loopmsg.patch
new file mode 100644
index 000000000..e58cc13a6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-no-loopmsg.patch
@@ -0,0 +1,19 @@
+lib/order.c: Make the dependency loop messages into debug msgs
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/lib/order.c
+===================================================================
+--- rpm-5.4.14.orig/lib/order.c
++++ rpm-5.4.14/lib/order.c
+@@ -2175,7 +2175,7 @@ rescan:
+ const char * dp;
+ rpmlogLvl msglvl = (anaconda || (rpmtsDFlags(ts) & RPMDEPS_FLAG_DEPLOOPS))
+ ? RPMLOG_WARNING : RPMLOG_ERR;
+-#if defined(RPM_VENDOR_MANDRIVA) /* loop-detection-optional-loglevel */
++#if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_OE) /* loop-detection-optional-loglevel */
+ // Report loops as debug-level message by default (7 = RPMLOG_DEBUG), overridable
+ msglvl = rpmExpandNumeric("%{?_loop_detection_loglevel}%{?!_loop_detection_loglevel:7}");
+ #endif
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-no-perl-urpm.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-no-perl-urpm.patch
new file mode 100644
index 000000000..58182296c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-no-perl-urpm.patch
@@ -0,0 +1,47 @@
+Disable perl-URPM support
+
+This causes a configure failure when perl-URPM is not used.
+
+| configure.ac:1159: required file `perl-URPM/Makefile.PL.in' not found
+| configure.ac:1159: required file `perl-URPM/Makefile.in' not found
+
+Upstream-Status: Inappropriate [disable feature]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/configure.ac
+===================================================================
+--- rpm-5.4.14.orig/configure.ac
++++ rpm-5.4.14/configure.ac
+@@ -1186,30 +1186,10 @@ AC_SUBST(WITH_PERL_SUBDIR)
+ AC_SUBST(WITH_PERL_SUBPACKAGE)
+ AC_SUBST(WITH_PERL_LIBS)
+
+-dnl # optional Perl-URPM language bindings
++dnl # disable Perl-URPM language bindings
+ WITH_PERL_URPM_SUBDIR=""
+ WITH_PERL_URPM_SUBPACKAGE=0
+ WITH_PERL_URPM_LIBS=""
+-if test ".$WITH_PTHREADS" = .yes; then
+- WITH_PERL_URPM_LIBS="$LIBS"
+-fi
+-AC_ARG_WITH(perl-urpm, AS_HELP_STRING([--with-perl-urpm], [build with Perl URPM language bindings]), [
+- if test ".$withval" != .no; then
+- PERL_URPM_INSTALLDIRS=""
+- if test "$withval" == "vendor"; then
+- PERL_URPM_INSTALLDIRS="'INSTALLDIRS' => 'vendor',"
+- fi
+- if test "$withval" == "site"; then
+- PERL_URPM_INSTALLDIRS="'INSTALLDIRS' => 'site',"
+- fi
+- AC_DEFINE_UNQUOTED([PERL_URPM_INSTALLDIRS], [$PERL_URPM_INSTALLDIRS], [Perl install directory (vendor/site)])
+- AC_SUBST(PERL_URPM_INSTALLDIRS)
+- WITH_PERL_URPM_SUBDIR=perl-URPM
+- WITH_PERL_URPM_SUBPACKAGE=1
+- AC_CONFIG_FILES([perl-URPM/Makefile.PL])
+- AC_CONFIG_FILES([perl-URPM/Makefile])
+- fi
+-])
+ AC_SUBST(WITH_PERL_URPM_SUBDIR)
+ AC_SUBST(WITH_PERL_URPM_SUBPACKAGE)
+ AC_SUBST(WITH_PERL_URPM_LIBS)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-opendb-before-verifyscript-to-avoid-null-point.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-opendb-before-verifyscript-to-avoid-null-point.patch
new file mode 100644
index 000000000..e2191245f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-opendb-before-verifyscript-to-avoid-null-point.patch
@@ -0,0 +1,24 @@
+rpm: opendb before rpmverifyscript to avoid null point input
+
+If the command is "rpm -V" and the return value of (headerIsEntry(h, RPMTAG_VERIFYSCRIPT)
+|| headerIsEntry(h, RPMTAG_SANITYCHECK)) located in /lib/verify.c is true, it will call
+rpmpsmStage function(rpmVerifyScript->rpmpsmScriptStage->rpmpsmStage) and occur segment
+fault because of null point(rpmtsGetRdb(ts) == NULL and rpmtsGetRdb(ts)->db_txn).
+So we open rpmdb to avoid bad input when find headerIsEntry true.
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
+Index: rpm-5.4.14/lib/verify.c
+===================================================================
+--- rpm-5.4.14.orig/lib/verify.c 2015-07-22 22:09:59.992895355 +0800
++++ rpm-5.4.14/lib/verify.c 2015-08-13 10:20:33.752177906 +0800
+@@ -613,6 +613,8 @@
+ {
+ FD_t fdo = fdDup(STDOUT_FILENO);
+
++ rpmtsOpenDB(ts, O_RDONLY); /*Open the DB to avoid null point input in function rpmpsmStage()*/
++
+ rc = rpmfiSetHeader(fi, h);
+ if ((rc = rpmVerifyScript(qva, ts, fi, fdo)) != 0)
+ ec += rc;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-ossp-uuid.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-ossp-uuid.patch
new file mode 100644
index 000000000..691aba9ea
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-ossp-uuid.patch
@@ -0,0 +1,23 @@
+Fix integration of ossp-uuid
+
+We need to avoid including the util-linux uuid library, instead
+we need ossp-uuid. There is a related hack in do_configure to
+make sure that we use the right .pc file as well.
+
+Upstream-Status: Inappropriate [disable feature]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/configure.ac
+===================================================================
+--- rpm-5.4.14.orig/configure.ac
++++ rpm-5.4.14/configure.ac
+@@ -1951,7 +1951,7 @@ grep -v 'define HAVE_UNISTD_H' confdefs.
+ esac
+ RPM_CHECK_LIB(
+ [OSSP uuid], [uuid],
+- [ossp-uuid uuid], [uuid_import], [uuid.h],
++ [ossp-uuid], [uuid_import], [uuid.h],
+ [no,external:none], [],
+ [ dnl # enable OSSP uuid native API support for embedded Lua
+ if test ".$WITH_LUA" = .yes; then
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-packageorigin.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-packageorigin.patch
new file mode 100644
index 000000000..57fc6ce88
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-packageorigin.patch
@@ -0,0 +1,25 @@
+Add the ability to query the packageorigin
+
+Written by jbj at rpm5.org
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/rpmdb/hdrfmt.c
+===================================================================
+--- rpm-5.4.14.orig/rpmdb/hdrfmt.c
++++ rpm-5.4.14/rpmdb/hdrfmt.c
+@@ -2409,8 +2409,10 @@ static int pkgoriginTag(Header h, HE_t h
+ int rc = 1;
+
+ he->tag = RPMTAG_PACKAGEORIGIN;
+- if (!headerGet(h, he, HEADERGET_NOEXTENSION)
+- && (origin = headerGetOrigin(h)) != NULL)
++ /* XXX two sources for tag data: what search precedence? */
++ if (headerGet(h, he, HEADERGET_NOEXTENSION))
++ rc = 0;
++ else if ((origin = headerGetOrigin(h)) != NULL)
+ {
+ he->t = RPM_STRING_TYPE;
+ he->p.str = xstrdup(origin);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-payload-use-hashed-inode.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-payload-use-hashed-inode.patch
new file mode 100644
index 000000000..af643b1c6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-payload-use-hashed-inode.patch
@@ -0,0 +1,126 @@
+If we run builds on a filesystem with 64 bit inodes like XFS, we need to
+map the inode numbers to something 32 bit since the cpio header only allows
+for 32 bit inode values. If we don't do this:
+
+#define SET_NUM_FIELD(phys, val, space) \
+ sprintf(space, "%8.8lx", (unsigned long) (val)); \
+ memcpy(phys, space, 8)
+
+from cpio.c will print larger that 8 character values and then truncate the
+LSBs. This generates cpio files where hardlinked files may have the same
+inode number. The resulting rpms are then corrupted.
+
+There is a separate patch for the crash the identical inode numbers causes
+when extracting the rpm.
+
+Patch taken from http://git.pld-linux.org/?p=packages/rpm.git;a=commitdiff;h=10526c23aac60b7b636e4c93862887dbef8e8f15
+
+RP 2014/6/10
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Index: rpm-5.4.14/build/files.c
+===================================================================
+--- rpm-5.4.14.orig/build/files.c
++++ rpm-5.4.14/build/files.c
+@@ -1328,6 +1328,26 @@ static rpmuint32_t getDigestAlgo(Header
+ return dalgo;
+ }
+
++static int isHardLink(FileListRec flp, FileListRec tlp)
++{
++ return ((S_ISREG(flp->fl_mode) && S_ISREG(tlp->fl_mode)) &&
++ ((flp->fl_nlink > 1) && (flp->fl_nlink == tlp->fl_nlink)) &&
++ (flp->fl_ino == tlp->fl_ino) &&
++ (flp->fl_dev == tlp->fl_dev));
++}
++
++static int seenHardLink(FileList fl, FileListRec flp, ino_t *fileid)
++{
++ FileListRec ilp;
++ for (ilp = fl->fileList; ilp < flp; ilp++) {
++ if (isHardLink(flp, ilp)) {
++ *fileid = ilp - fl->fileList;
++ return 1;
++ }
++ }
++ return 0;
++}
++
+ /**
+ * Add file entries to header.
+ * @todo Should directories have %doc/%config attributes? (#14531)
+@@ -1374,6 +1394,7 @@ memset(buf, 0, sizeof(buf)); /* XXX valg
+
+ for (i = 0, flp = fl->fileList; i < fl->fileListRecsUsed; i++, flp++) {
+ const char *s;
++ ino_t fileid = flp - fl->fileList;
+
+ /* Merge duplicate entries. */
+ while (i < (fl->fileListRecsUsed - 1) &&
+@@ -1436,6 +1457,13 @@ memset(buf, 0, sizeof(buf)); /* XXX valg
+ /* Leave room for both dirname and basename NUL's */
+ dpathlen += (strlen(flp->diskURL) + 2);
+
++ /* Excludes and dupes have been filtered out by now. */
++ if (S_ISREG(flp->fl_mode)) {
++ if (flp->fl_nlink == 1 || !seenHardLink(fl, flp, &fileid)) {
++ fl->totalFileSize += flp->fl_size;
++ }
++ }
++
+ /*
+ * Make the header, the OLDFILENAMES will get converted to a
+ * compressed file list write before we write the actual package to
+@@ -1518,7 +1546,11 @@ memset(buf, 0, sizeof(buf)); /* XXX valg
+
+ /* XXX Hash instead of 64b->32b truncate to prevent aliasing. */
+ { ino_t _ino = flp->fl_ino;
++ /* don't use hash here, as hash collisions which happen on large packages
++ cause bus errors in rpmbuild
+ ui32 = hashFunctionString(0, &_ino, sizeof(_ino));
++ */
++ ui32 = fileid + 1;
+ }
+ he->tag = RPMTAG_FILEINODES;
+ he->t = RPM_UINT32_TYPE;
+@@ -1751,39 +1783,6 @@ if (_rpmbuildFlags & 4) {
+ IOSM_MAP_TYPE | IOSM_MAP_MODE | IOSM_MAP_UID | IOSM_MAP_GID;
+ if (isSrc)
+ fi->fmapflags[i] |= IOSM_FOLLOW_SYMLINKS;
+-
+- if (S_ISREG(flp->fl_mode)) {
+- int bingo = 1;
+- /* Hard links need be tallied only once. */
+- if (flp->fl_nlink > 1) {
+- FileListRec jlp = flp + 1;
+- int j = i + 1;
+- for (; (unsigned)j < fi->fc; j++, jlp++) {
+- /* follow outer loop logic */
+- while (((jlp - fl->fileList) < (fl->fileListRecsUsed - 1)) &&
+- !strcmp(jlp->fileURL, jlp[1].fileURL))
+- jlp++;
+- if (jlp->flags & RPMFILE_EXCLUDE) {
+- j--;
+- /*@innercontinue@*/ continue;
+- }
+- if (jlp->flags & RPMFILE_GHOST)
+- /*@innercontinue@*/ continue;
+- if (!S_ISREG(jlp->fl_mode))
+- /*@innercontinue@*/ continue;
+- if (flp->fl_nlink != jlp->fl_nlink)
+- /*@innercontinue@*/ continue;
+- if (flp->fl_ino != jlp->fl_ino)
+- /*@innercontinue@*/ continue;
+- if (flp->fl_dev != jlp->fl_dev)
+- /*@innercontinue@*/ continue;
+- bingo = 0; /* don't tally hardlink yet. */
+- /*@innerbreak@*/ break;
+- }
+- }
+- if (bingo)
+- fl->totalFileSize += flp->fl_size;
+- }
+ }
+
+ ui32 = fl->totalFileSize;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-pkgconfigdeps.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-pkgconfigdeps.patch
new file mode 100644
index 000000000..656de86d7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-pkgconfigdeps.patch
@@ -0,0 +1,37 @@
+pkgconfigdeps.sh: Change to restricting pkgconfig to the local directory
+
+Using PKG_CONFIG_PATH will allow pkg-config to fall back to the system paths,
+we don't want this as it may lead to inaccurate results in some corner cases.
+
+PKG_CONFIG_LIBDIR will ensure pkg-config stays within the install directory.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm/scripts/pkgconfigdeps.sh
+===================================================================
+--- rpm.orig/scripts/pkgconfigdeps.sh
++++ rpm/scripts/pkgconfigdeps.sh
+@@ -18,8 +18,8 @@ case $1 in
+ *.pc)
+ # Query the dependencies of the package.
+ DIR=$(dirname ${filename})
+- PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig"
+- export PKG_CONFIG_PATH
++ PKG_CONFIG_LIBDIR="$DIR:$DIR/../../share/pkgconfig"
++ export PKG_CONFIG_LIBDIR
+ $pkgconfig --print-provides "$filename" 2> /dev/null | while read n r v ; do
+ [ -n "$n" ] || continue
+ # We have a dependency. Make a note that we need the pkgconfig
+@@ -42,8 +42,8 @@ case $1 in
+ [ -n "$oneshot" ] && echo "$oneshot"; oneshot=""
+ # Query the dependencies of the package.
+ DIR=$(dirname ${filename})
+- PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig"
+- export PKG_CONFIG_PATH
++ PKG_CONFIG_LIBDIR="$DIR:$DIR/../../share/pkgconfig"
++ export PKG_CONFIG_LIBDIR
+ $pkgconfig --print-requires "$filename" 2> /dev/null | while read n r v ; do
+ [ -n "$n" ] || continue
+ if [ -n "$r" ] && [ -n "$v" ]; then
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-platform-file-fix.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-platform-file-fix.patch
new file mode 100644
index 000000000..200964f39
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-platform-file-fix.patch
@@ -0,0 +1,28 @@
+Don't add the first line of /etc/rpm/platform to the list of patterns
+to match when computing an arch score, use it just for getting
+information about the platform (cpu/vendor/os). Fixes #3864.
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Index: rpm-5.4.14/lib/rpmrc.c
+===================================================================
+--- rpm-5.4.14.orig/lib/rpmrc.c
++++ rpm-5.4.14/lib/rpmrc.c
+@@ -510,6 +510,7 @@ static rpmRC rpmPlatform(const char * pl
+ #endif
+ }
+
++#if !defined(RPM_VENDOR_OE) /* Skip the explicit-platform */
+ #if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */
+ /* do not use vendor and GNU attribution */
+ p = rpmExpand("%{_host_cpu}-%{_host_os}", NULL);
+@@ -520,7 +521,8 @@ static rpmRC rpmPlatform(const char * pl
+ #endif
+ xx = mireAppend(RPMMIRE_STRCMP, 0, p, NULL, &mi_re, &mi_nre);
+ p = _free(p);
+-
++#endif
++
+ init_platform++;
+ }
+ rc = (init_platform ? RPMRC_OK : RPMRC_FAIL);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-platform.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-platform.patch
new file mode 100644
index 000000000..3b40fea0e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-platform.patch
@@ -0,0 +1,137 @@
+Fix up platform and related sysinfo file loading.
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+This ensures that RPM knows the compatible set of package types at all times.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/lib/depends.c
+===================================================================
+--- rpm-5.4.14.orig/lib/depends.c
++++ rpm-5.4.14/lib/depends.c
+@@ -250,7 +250,7 @@ static int rpmtsAddUpgrades(rpmts ts, rp
+ he->p.ptr = _free(he->p.ptr);
+ }
+
+-#if defined(RPM_VENDOR_WINDRIVER)
++#if defined(RPM_VENDOR_WINDRIVER) && !defined(RPM_VENDOR_OE)
+ /*
+ * If we're capable of installing multiple colors
+ * but at least one of the packages are white (0), we
+@@ -507,7 +507,7 @@ assert(lastx >= 0 && lastx < ts->orderCo
+ return 0;
+ }
+
+-#if defined(RPM_VENDOR_WINDRIVER)
++#if defined(RPM_VENDOR_WINDRIVER) && !defined(RPM_VENDOR_OE)
+ /* Is "compat" compatible w/ arch? */
+ int _isCompatibleArch(const char * arch, const char * compat)
+ {
+@@ -663,7 +663,7 @@ assert(he->p.str != NULL);
+
+ if (arch == NULL || (parch = rpmteA(p)) == NULL)
+ continue;
+-#if defined(RPM_VENDOR_WINDRIVER)
++#if defined(RPM_VENDOR_WINDRIVER) && !defined(RPM_VENDOR_OE)
+ /* XXX hackery for alias matching. */
+ if (!_isCompatibleArch(arch, parch))
+ continue;
+@@ -829,6 +829,12 @@ int rpmtsAddEraseElement(rpmts ts, Heade
+ return rc;
+ }
+
++#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_OE)
++#define _ETC_RPM_SYSINFO "%{_etcrpm}/sysinfo"
++#else
++#define _ETC_RPM_SYSINFO SYSCONFIGDIR "/sysinfo"
++#endif
++
+ /*@only@*/ /*@null@*/ /*@unchecked@*/
+ static char *sysinfo_path = NULL;
+
+@@ -1311,7 +1317,7 @@ retry:
+ sysinfo_path = rpmExpand("%{?_rpmds_sysinfo_path}", NULL);
+ if (!(sysinfo_path != NULL && *sysinfo_path == '/')) {
+ sysinfo_path = _free(sysinfo_path);
+- sysinfo_path = xstrdup(SYSCONFIGDIR "/sysinfo");
++ sysinfo_path = rpmExpand(_ETC_RPM_SYSINFO, NULL);
+ }
+ }
+
+Index: rpm-5.4.14/lib/rpmds.c
+===================================================================
+--- rpm-5.4.14.orig/lib/rpmds.c
++++ rpm-5.4.14/lib/rpmds.c
+@@ -1759,7 +1759,7 @@ int rpmdsSysinfo(rpmPRCO PRCO, const cha
+ /*@-observertrans @*/
+ _sysinfo_path = _free(_sysinfo_path);
+ /*@=observertrans @*/
+- _sysinfo_path = xstrdup(_ETC_RPM_SYSINFO);
++ _sysinfo_path = rpmExpand(_ETC_RPM_SYSINFO, NULL);
+ }
+ }
+ /*@=modobserver@*/
+Index: rpm-5.4.14/lib/rpmrc.c
+===================================================================
+--- rpm-5.4.14.orig/lib/rpmrc.c
++++ rpm-5.4.14/lib/rpmrc.c
+@@ -38,7 +38,13 @@
+ static const char * configTarget = NULL;
+
+ /*@observer@*/ /*@unchecked@*/
+-static const char * platform = SYSCONFIGDIR "/platform";
++#if defined(RPM_VENDOR_WINDRIVER)
++#define _ETC_RPM_PLATFORM "%{_etcrpm}/platform"
++#else
++#define _ETC_RPM_PLATFORM SYSCONFIGDIR "/platform"
++#endif
++
++static const char * _platform = NULL;
+
+ /*@only@*/ /*@relnull@*/ /*@unchecked@*/
+ void * platpat = NULL;
+@@ -694,16 +700,17 @@ static void defaultMachine(/*@out@*/ con
+ int rc;
+
+ while (!gotDefaults) {
+-#if defined(RPM_VENDOR_WINDRIVER)
+- const char * _platform = rpmGetPath(__etcrpm, "/platform", NULL);
+-#else
+- const char * _platform = platform;
+-#endif
++ if (_platform == NULL) {
++ _platform = rpmExpand("%{?_rpmrc_platform_path}", NULL);
++ /* XXX may need to validate path existence somewhen. */
++ if (!(_platform != NULL && *_platform == '/')) {
++ _platform = _free(_platform);
++ _platform = rpmExpand(_ETC_RPM_PLATFORM, NULL);
++ }
++ }
+ CVOG_t cvog = NULL;
+ #if defined(RPM_VENDOR_OPENPKG) /* larger-utsname */
+ const char *cp;
+-#endif
+-#if defined(RPM_VENDOR_OPENPKG) /* larger-utsname */
+ /* utsname fields on some platforms (like HP-UX) are very small
+ (just about 8 characters). This is too small for OpenPKG, so cheat! */
+ rc = uname(&un_real);
+@@ -780,9 +787,7 @@ static void defaultMachine(/*@out@*/ con
+ if (cp != NULL && cp != _platform)
+ cp = _free(cp);
+ #endif
+-#if defined(RPM_VENDOR_WINDRIVER)
+ _platform = _free(_platform);
+-#endif
+
+ if (configTarget && !parseCVOG(configTarget, &cvog) && cvog != NULL) {
+ gotDefaults = 1;
+@@ -1101,6 +1106,8 @@ int rpmReadConfigFiles(/*@unused@*/ cons
+
+ #ifdef PREMACROFILES
+ if (rpmReadRC(PREMACROFILES)) return -1;
++#else
++ if (rpmReadRC(NULL)) return -1;
+ #endif
+
+ /* Reset umask to its default umask(2) value. */
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch
new file mode 100644
index 000000000..b9675c71b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch
@@ -0,0 +1,105 @@
+Fix up platform and related sysinfo file loading (part 2).
+
+We need to ensure that we set the _gnu flag somehow. We do this by reading
+from the platform file, and setting a new _platform_gnu and related vars.
+
+The default values of _host_cpu, _host_vendor and _host_os are changed to
+reference either the automatically determined _target_... or _platform_...
+values. The macros file uses the configure time defaults in _platform_...
+versions have not been defined. This preserves existing behavior, but
+ensures reasonable defaults are always available.
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/lib/rpmrc.c
+===================================================================
+--- rpm-5.4.14.orig/lib/rpmrc.c
++++ rpm-5.4.14/lib/rpmrc.c
+@@ -328,10 +328,15 @@ static void setDefaults(void)
+ /*@modifies rpmGlobalMacroContext, internalState @*/
+ {
+
+-#if defined(RPM_VENDOR_WINDRIVER)
++#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_OE)
+ addMacro(NULL, "_usrlibrpm", NULL, __usrlibrpm, RMIL_DEFAULT);
+ addMacro(NULL, "_etcrpm", NULL, __etcrpm, RMIL_DEFAULT);
+ addMacro(NULL, "_vendor", NULL, "%{?_host_vendor}%{!?_host_vendor:wrs}", RMIL_DEFAULT);
++
++ addMacro(NULL, "_host_cpu", NULL, "%{?_platform_cpu}%{!?_platform_cpu:%{?_target_cpu}}", RMIL_DEFAULT);
++ addMacro(NULL, "_host_vendor", NULL, "%{?_platform_vendor}%{!?_platform_cpu:%{?_target_vendor}}", RMIL_DEFAULT);
++ addMacro(NULL, "_host_os", NULL, "%{?_platform_os}%{!?_platform_os:%{?_target_os}}", RMIL_DEFAULT);
++ addMacro(NULL, "_host_gnu", NULL, "%{?_platform_gnu}%{!?_platform_gnu:%{?_gnu}}", RMIL_DEFAULT);
+ #endif
+
+ addMacro(NULL, "_usr", NULL, USRPREFIX, RMIL_DEFAULT);
+@@ -487,9 +492,22 @@ static rpmRC rpmPlatform(const char * pl
+ }
+
+ if (!parseCVOG(p, &cvog) && cvog != NULL) {
++#if defined(RPM_VENDOR_OE)
++ char * _gnu = NULL;
++
++ addMacro(NULL, "_platform_cpu", NULL, cvog->cpu, -1);
++ addMacro(NULL, "_platform_vendor", NULL, cvog->vendor, -1);
++ addMacro(NULL, "_platform_os", NULL, cvog->os, -1);
++
++ if (cvog->gnu && cvog->gnu[0] != '\0')
++ _gnu = rpmExpand("-", cvog->gnu, NULL);
++
++ addMacro(NULL, "_platform_gnu", NULL, (_gnu ? _gnu : ""), -1);
++#else
+ addMacro(NULL, "_host_cpu", NULL, cvog->cpu, -1);
+ addMacro(NULL, "_host_vendor", NULL, cvog->vendor, -1);
+ addMacro(NULL, "_host_os", NULL, cvog->os, -1);
++#endif
+ }
+
+ #if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */
+Index: rpm-5.4.14/macros/macros.in
+===================================================================
+--- rpm-5.4.14.orig/macros/macros.in
++++ rpm-5.4.14/macros/macros.in
+@@ -900,9 +900,9 @@ $_arbitrary_tags_tests Foo:Bar
+ %_os @RPMCANONOS@
+ %_gnu @RPMCANONGNU@
+
+-%_host_platform %{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_gnu}
+-%_build_platform %{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_gnu}
+-%_target_platform %{_target_cpu}-%{_target_vendor}-%{_target_os}%{?_gnu}
++%_host_platform %{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}
++%_build_platform %{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}
++%_target_platform %{_target_cpu}-%{_target_vendor}-%{_target_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}
+
+ #==============================================================================
+ # ---- configure macros.
+@@ -945,9 +945,10 @@ $_arbitrary_tags_tests Foo:Bar
+ %_build_os %{_host_os}
+ %_host @host@
+ %_host_alias @host_alias@%{nil}
+-%_host_cpu @host_cpu@
+-%_host_vendor @host_vendor@
+-%_host_os @host_os@
++%_host_cpu %{?_platform_cpu}%{!?_platform_cpu:%{_arch}}
++%_host_vendor %{?_platform_vendor}%{!?_platform_vendor:%{_vendor}}
++%_host_os %{?_platform_os}%{!?_platform_os:%{_os}}
++%_host_gnu %{?_platform_gnu}%{!?_platform_gnu:%{_gnu}}
+ %_target %{_host}
+ %_target_alias %{_host_alias}
+ %_target_cpu %{_host_cpu}
+Index: rpm-5.4.14/python/rpmmodule.c
+===================================================================
+--- rpm-5.4.14.orig/python/rpmmodule.c
++++ rpm-5.4.14/python/rpmmodule.c
+@@ -65,8 +65,8 @@ static PyObject * archScore(PyObject * s
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", kwlist, &arch))
+ return NULL;
+
+-#if defined(RPM_VENDOR_WINDRIVER)
+- platform = rpmExpand(arch, "-%{_host_vendor}", "-%{_host_os}%{?_gnu}", NULL);
++#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_OE)
++ platform = rpmExpand(arch, "-%{_host_vendor}", "-%{_host_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}", NULL);
+ #else
+ platform = rpmExpand(arch, "-", "%{_vendor}", "-", "%{_os}", NULL);
+ #endif
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-py-init.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-py-init.patch
new file mode 100644
index 000000000..92ef1dc50
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-py-init.patch
@@ -0,0 +1,29 @@
+python/rpmmodules.c: Change the way the python module loads the RPM config
+
+In order to support the RPM_VENDOR_WINDRIVER enhancement of dynamic
+runtime relocation paths, we need to call rpmcliInit instead of
+rpmReadConfigFiles. The rpmcliInit will end up calling rpmReadConfigFiles
+after the necessary relocation processing (if enabled).
+
+Code derived from changes suggested by Paul Eggleton.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm/python/rpmmodule.c
+===================================================================
+--- rpm.orig/python/rpmmodule.c
++++ rpm/python/rpmmodule.c
+@@ -382,9 +382,8 @@ static int initModule(PyObject *m)
+ /* XXX add --noparentdirs --nolinktos to rpmtsCheck() */
+ global_depFlags = (RPMDEPS_FLAG_NOPARENTDIRS | RPMDEPS_FLAG_NOLINKTOS);
+
+- /* failure to initialize rpm (crypto and all) is rather fatal too... */
+- if (rpmReadConfigFiles(NULL, NULL) == -1)
+- return 0;
++ const char *argv[1] = {"rpmmodule", 0};
++ rpmcliInit(1, argv, NULL);
+
+ d = PyModule_GetDict(m);
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-python-AddErase.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-python-AddErase.patch
new file mode 100644
index 000000000..df6f4722e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-python-AddErase.patch
@@ -0,0 +1,35 @@
+rpm/python: The RPM5 API requires a hdrNum to be passed in
+
+The former behavior of passing in -1 as the hdrNum resulting in erase
+operations that did not complete, but also did not error. Changing to
+using the header instance resolves this problem.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.15/python/rpmts-py.c
+===================================================================
+--- rpm-5.4.15.orig/python/rpmts-py.c
++++ rpm-5.4.15/python/rpmts-py.c
+@@ -241,12 +241,19 @@ static PyObject *
+ rpmts_AddErase(rpmtsObject * s, PyObject * args)
+ {
+ Header h;
++ uint32_t hdrNum;
+
+ if (!PyArg_ParseTuple(args, "O&:AddErase", hdrFromPyObject, &h))
+ return NULL;
+
+-SPEW((stderr, "*** %s(%p,%p) ts %p\n", __FUNCTION__, s, h, s->ts));
++ hdrNum = headerGetInstance(h);
++
++SPEW((stderr, "*** %s(%p,%p) ts %p hdrNum %ld\n", __FUNCTION__, s, h, s->ts, hdrNum));
++#ifdef REFERENCE /* this doesn't work, RPM5 requires a unique hdrNum */
+ return PyBool_FromLong(rpmtsAddEraseElement(s->ts, h, -1) == 0);
++#else
++ return PyBool_FromLong(rpmtsAddEraseElement(s->ts, h, hdrNum) == 0);
++#endif
+ }
+
+ static int
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-python-restore-origin.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-python-restore-origin.patch
new file mode 100644
index 000000000..7a473db1a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-python-restore-origin.patch
@@ -0,0 +1,49 @@
+Fix an issue where the PACKAGEORIGIN is not properly stored.
+
+Restore the rpmtsCallback fdSetOpen call and related code.
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm/python/rpmts-py.c
+===================================================================
+--- rpm.orig/python/rpmts-py.c
++++ rpm/python/rpmts-py.c
+@@ -672,6 +672,8 @@ rpmtsCallback(const void * hd, const rpm
+ Header h = (Header) hd;
+ struct rpmtsCallbackType_s * cbInfo = data;
+ PyObject * pkgObj = (PyObject *) pkgKey;
++ PyObject * oh = NULL;
++ const char * origin = NULL;
+ PyObject * args, * result;
+ static FD_t fd;
+
+@@ -693,8 +695,16 @@ rpmtsCallback(const void * hd, const rpm
+ pkgObj = Py_None;
+ Py_INCREF(pkgObj);
+ }
+- } else
++ } else {
+ Py_INCREF(pkgObj);
++ /* XXX yum has (h, rpmloc) tuple as pkgKey. Extract the path. */
++ if (!(PyTuple_Check(pkgObj) && PyArg_ParseTuple(pkgObj, "|Os", &oh, &origin)))
++ origin = NULL;
++ /* XXX clean up the path, yum paths start "//..." */
++ if (origin && origin[0] == '/' && origin[1] == '/')
++ origin++;
++ }
++
+
+ PyEval_RestoreThread(cbInfo->_save);
+
+@@ -723,6 +733,9 @@ SPEW((stderr, "\t%p = fdDup(%d)\n", fd,
+
+ fcntl(Fileno(fd), F_SETFD, FD_CLOEXEC);
+
++ if (origin != NULL)
++ (void) fdSetOpen(fd, origin, 0, 0);
++
+ return fd;
+ } else
+ if (what == RPMCALLBACK_INST_CLOSE_FILE) {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-python-tagname.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-python-tagname.patch
new file mode 100644
index 000000000..dfb551377
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-python-tagname.patch
@@ -0,0 +1,24 @@
+rpm-python-module: Change the extension tag from PyCObject to PyInt
+
+Use the tagValue to determine the custom PyInt value to use for the extension
+tag. Without this, any custom tag extensions will be returned in a format
+that the tagNumFromPyObject and related functions like hdr_subscript will
+failed to process. Usually the failure is error: expected a string or integer
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.15/python/rpmmodule.c
+===================================================================
+--- rpm-5.4.15.orig/python/rpmmodule.c
++++ rpm-5.4.15/python/rpmmodule.c
+@@ -316,7 +316,7 @@ static void addRpmTags(PyObject *module)
+ {
+ if (ext->name == NULL || ext->type != HEADER_EXT_TAG)
+ continue;
+- PyDict_SetItemString(d, (char *) ext->name, to=PyCObject_FromVoidPtr((void *)ext, NULL));
++ PyDict_SetItemString(d, (char *) ext->name, to=PyInt_FromLong(tagValue(ext->name)));
+ Py_XDECREF(to);
+ PyDict_SetItem(dict, to, o=PyString_FromString(ext->name + 7));
+ Py_XDECREF(o);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-realpath.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-realpath.patch
new file mode 100644
index 000000000..a810123ba
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-realpath.patch
@@ -0,0 +1,24 @@
+chroot: realpath is required before expanding _dbpath
+
+_usr turned out to be a relative path to support dyanmic config, but it's
+being used somewhere as a indicator to locate substrings, so we must get
+the real path of it in advance.
+
+Upstream-Status: Inappropriate (OpenEmbedded specific)
+
+Signed-off-by: Ming Liu <ming.liu@windriver.com>
+
+diff -urpN a/rpmio/rpmrpc.c b/rpmio/rpmrpc.c
+--- a/rpmio/rpmrpc.c
++++ b/rpmio/rpmrpc.c
+@@ -257,7 +257,9 @@ int Open(const char * path, int flags, m
+ /* XXX if the open(2) fails, try to strip a possible chroot(2) prefix. */
+ if (fdno < 0 && errno == ENOENT) {
+ const char *dbpath = rpmExpand("%{?_dbpath}/", NULL);
+- const char * fn = strstr(path + 1, dbpath);
++ char resolved_dbpath[PATH_MAX];
++ realpath(dbpath, resolved_dbpath);
++ const char * fn = strstr(path + 1, resolved_dbpath);
+ if (fn)
+ fdno = open(fn, flags, mode);
+ dbpath = _free(dbpath);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-reloc-macros.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-reloc-macros.patch
new file mode 100644
index 000000000..59fe524df
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-reloc-macros.patch
@@ -0,0 +1,31 @@
+macros: Use dyanmic config vs hard coded settings
+
+When the dynamic, runtime relocation is enables we need to make sure that the
+RPM macro file does not override the dynamic settings. Fix this by forcing the
+dynamic version to be used in all cases.
+
+Upstream-Status: Inappropriate (OpenEmbedded specific)
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/macros/macros.in
+===================================================================
+--- rpm-5.4.14.orig/macros/macros.in
++++ rpm-5.4.14/macros/macros.in
+@@ -27,11 +27,12 @@
+ #==============================================================================
+ # ---- filesystem macros.
+ #
+-%_usr @usrprefix@
++%_usr %{_usrlibrpm}/../..
+ %_usrsrc %{_usr}/src
+-%_var @varprefix@
+-%_usrlibrpm @USRLIBRPM@
+-%_etcrpm @SYSCONFIGDIR@
++%_var %{_usr}/../var
++# The dynamic relocation code sets the following two items
++#%_usrlibrpm @USRLIBRPM@
++#%_etcrpm @SYSCONFIGDIR@
+
+ %__objext @objext@
+ %__libext @libext@
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-resolvedep.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-resolvedep.patch
new file mode 100644
index 000000000..526106d1e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-resolvedep.patch
@@ -0,0 +1,40 @@
+lib/rpmts.c: Ensure that we check both providename and filepaths
+
+When looking up a missing dependencies, such as /bin/sh, we need to lookup
+in both the providename and filepaths DB, not just the filepaths DB.
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/lib/rpmts.c
+===================================================================
+--- rpm-5.4.14.orig/lib/rpmts.c
++++ rpm-5.4.14/lib/rpmts.c
+@@ -410,8 +410,8 @@ fprintf(stderr, "--> %s(%p,%p,%p)\n", __
+ if (sdb == NULL)
+ continue;
+
+- /* Look for a matching Provides: in suggested universe. */
+- rpmtag = (*keyp == '/' ? RPMTAG_FILEPATHS : RPMTAG_PROVIDENAME);
++ rpmtag = RPMTAG_PROVIDENAME;
++ do {
+ mi = rpmmiInit(sdb, rpmtag, keyp, keylen);
+ while ((h = rpmmiNext(mi)) != NULL) {
+ size_t hnamelen;
+@@ -446,6 +446,15 @@ fprintf(stderr, "--> %s(%p,%p,%p)\n", __
+ bhnamelen = hnamelen;
+ }
+ mi = rpmmiFree(mi);
++
++ if (bh == NULL && *keyp == '/' && rpmtag == RPMTAG_PROVIDENAME) {
++ rpmtag = RPMTAG_FILEPATHS;
++ continue;
++ }
++
++ break;
++ } while (1);
++
+ }
+
+ /* Is there a suggested resolution? */
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmdb-grammar.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmdb-grammar.patch
new file mode 100644
index 000000000..71dae4939
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmdb-grammar.patch
@@ -0,0 +1,124 @@
+Disable various items that do not cross compile well.
+
+Upstream-Status: Inappropriate [Configuration]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm/rpmdb/Makefile.am
+===================================================================
+--- rpm.orig/rpmdb/Makefile.am
++++ rpm/rpmdb/Makefile.am
+@@ -34,10 +34,10 @@ EXTRA_DIST = \
+ db3.c sqlite.c db_emu.h librpmdb.vers bdb.sql libsqldb.c \
+ logio.awk logio.src logio_recover_template logio_template logio.c \
+ logio_rec.c logio_auto.c logio_autop.c logio_auto.h \
+- qf.l qf.y qf.inp tqf.l tqf.y tqf.inp grammar.y scanner.l json1.js
++ tqf.l tqf.y tqf.inp grammar.y scanner.l json1.js
+
+-EXTRA_PROGRAMS = qfcalc qfgraph logio tjfn tqf # tbdb
+-noinst_PROGRAMS = json
++EXTRA_PROGRAMS = qfcalc qfgraph logio # tjfn tqf tbdb
++noinst_PROGRAMS = # json
+
+ RPMMISC_LDADD_COMMON = \
+ $(top_builddir)/misc/librpmmisc.la \
+@@ -321,54 +321,39 @@ BUILT_SOURCES += .syntastic_c_config
+ .syntastic_c_config: Makefile
+ @echo $(COMPILE) | tr ' ' '\n' | sed -e '1d' > $@
+
+-tjfn_SOURCES = tjfn.c
+-tjfn_LDADD = $(mylibs)
+-
+-LEX = flex
+-LFLAGS= -d -T -v -8 -b --yylineno --reentrant --bison-bridge --perf-report
+-YACC = bison
+-YFLAGS= -Dapi.pure -t -d -v --report=all
+-
+-BUILT_SOURCES += Jgrammar.c Jgrammar.h Jscanner.c
+-Jgrammar.c: grammar.y
+- $(YACC) $(YFLAGS) -o $@ $<
+-Jscanner.c: scanner.l
+- $(LEX) -R -o $@ $<
+-json_SOURCES = Jgrammar.c Jscanner.c json.c
+-
+-testjson: json1.js json
+- ./json json1.js
+-
+-BUILT_SOURCES += Qgrammar.c Qgrammar.h Qscanner.c
+-Qgrammar.c: qf.y
+- $(YACC) $(YFLAGS) -o $@ $<
+-Qscanner.c: qf.l
+- $(LEX) -R -o $@ $<
+-qfcalc_SOURCES = Qgrammar.c Qscanner.c interpreter.c
+-qfgraph_SOURCES = Qgrammar.c Qscanner.c graph.c
+-
+-testqf: qfcalc qfgraph
+- ./qfcalc < qf.inp
+- ./qfgraph < qf.inp
+-
+-BUILT_SOURCES += Tgrammar.c Tgrammar.h Tscanner.c
+-Tgrammar.c Tgrammar.h: tqf.y
+- $(YACC) $(YFLAGS) -o $@ $<
+-Tscanner.c Tscanner.h: tqf.l
+- $(LEX) --prefix="Tyy" $(LFLAGS) -o $@ $<
+-tqf_SOURCES = Tgrammar.c Tscanner.c tgraph.c
+-tqf_CFLAGS = $(CFLAGS) -fsanitize=address # -DTSCANNER_MAIN
+-tqf_LDADD = ../lib/librpm.la \
+- ./librpmdb.la \
+- ../popt/libpopt.la
+-
+-testdir = $(abs_top_builddir)/tests
+-foo: tqf
+- -../libtool --mode=execute \
+- ./tqf \
+- --dbpath=$(testdir) \
+- -r $(testdir)/fodder/*.rpm \
+- $(testdir)/fodder/fmtmod.qf
++#tjfn_SOURCES = tjfn.c
++#tjfn_LDADD = $(mylibs)
++#
++#LFLAGS= -d -T -v -8 -b --yylineno --reentrant --bison-bridge --perf-report
++#
++#BUILT_SOURCES += Jgrammar.c Jgrammar.h Jscanner.c
++#Jgrammar.c Jgrammar.h: grammar.y
++# $(YACC) $(YFLAGS) -t -d -v -o $@ $<
++#Jscanner.c: scanner.l
++# $(LEX) -R -o $@ $<
++#json_SOURCES = Jgrammar.c Jscanner.c json.c
++#
++#testjson: json1.js json
++# ./json json1.js
++#
++#BUILT_SOURCES += Tgrammar.c Tgrammar.h Tscanner.c
++#Tgrammar.c Tgrammar.h: tqf.y
++# $(YACC) $(YFLAGS) -t -d -v -o $@ $<
++#Tscanner.c Tscanner.h: tqf.l
++# $(LEX) --prefix="Tyy" $(LFLAGS) -o $@ $<
++#tqf_SOURCES = Tgrammar.c Tscanner.c tgraph.c
++#tqf_CFLAGS = $(CFLAGS) -fsanitize=address # -DTSCANNER_MAIN
++#tqf_LDADD = ../lib/librpm.la \
++# ./librpmdb.la \
++# ../popt/libpopt.la
++
++#testdir = $(abs_top_builddir)/tests
++#foo: tqf
++# -../libtool --mode=execute \
++# ./tqf \
++# --dbpath=$(testdir) \
++# -r $(testdir)/fodder/*.rpm \
++# $(testdir)/fodder/fmtmod.qf
+
+ #tbdb_SOURCES = tbdb.c bdb.c
+ #tbdb_LDADD = $(mylibs)
+Index: rpm/configure.ac
+===================================================================
+--- rpm.orig/configure.ac
++++ rpm/configure.ac
+@@ -119,6 +119,7 @@ AC_PROG_MAKE_SET
+ AC_PROG_LIBTOOL
+ AC_PROG_RANLIB
+ AC_PROG_YACC
++AM_PROG_LEX
+
+ AC_PATH_PROG(AS, as, as)
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmfc.c-fix-for-N32-MIPS64.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmfc.c-fix-for-N32-MIPS64.patch
new file mode 100644
index 000000000..b9a2cbce2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmfc.c-fix-for-N32-MIPS64.patch
@@ -0,0 +1,34 @@
+From 16dc683aa50be9789d1674734b06a8a955ff22ad Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Thu, 26 Nov 2015 01:36:40 -0800
+Subject: [PATCH] lib/rpmfc.c: fix for N32 MIPS64
+
+It is 'N32 MIPS64', not 'N32 MIPS32' as command file shows:
+$ file image/usr/bin/getent
+getent: ELF 32-bit MSB executable, MIPS, N32 MIPS64 [snip]
+
+And "rpm -qp --filecolor" was wrong (it was 1, but should be 4).
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ lib/rpmfc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/rpmfc.c b/lib/rpmfc.c
+index fde00c7..49779f8 100644
+--- a/lib/rpmfc.c
++++ b/lib/rpmfc.c
+@@ -575,7 +575,7 @@ static struct rpmfcTokens_s rpmfcTokens[] = {
+ { " not stripped", RPMFC_NOTSTRIPPED },
+ { " archive", RPMFC_ARCHIVE },
+
+- { "MIPS, N32 MIPS32", RPMFC_ELFMIPSN32|RPMFC_INCLUDE },
++ { "MIPS, N32 MIPS64", RPMFC_ELFMIPSN32|RPMFC_INCLUDE },
+ { "ELF 32-bit", RPMFC_ELF32|RPMFC_INCLUDE },
+ { "ELF 64-bit", RPMFC_ELF64|RPMFC_INCLUDE },
+
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmio-headers.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmio-headers.patch
new file mode 100644
index 000000000..93645766c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmio-headers.patch
@@ -0,0 +1,19 @@
+Fix a typo in the rpmio Makefile.am
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm/rpmio/Makefile.am
+===================================================================
+--- rpm.orig/rpmio/Makefile.am
++++ rpm/rpmio/Makefile.am
+@@ -121,7 +121,7 @@ luaLPATHdir = ${pkgsharedir)/lua
+
+ pkgincdir = $(pkgincludedir)$(WITH_PATH_VERSIONED_SUFFIX)
+ pkginc_HEADERS = argv.h mire.h rpmzlog.h yarn.h \
+- rpmbf.h rpmcb.h rpmio.h rpmlog.h rpmiotypes.h rpmmacro.h
++ rpmbf.h rpmcb.h rpmio.h rpmlog.h rpmiotypes.h rpmmacro.h \
+ rpmpgp.h rpmsw.h rpmutil.h
+ noinst_HEADERS = \
+ ar.h bcon.h bson.h cpio.h crc.h envvar.h fnmatch.h fts.h glob.h iosm.h \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmpgp-popt.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmpgp-popt.patch
new file mode 100644
index 000000000..915d7efe6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmpgp-popt.patch
@@ -0,0 +1,26 @@
+rpmpgp.h: We do not require the popt header in order to use rpmpgp functions
+
+This can cause failures if the internal libpopt is used, as it's header is
+not exported.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/rpmio/rpmpgp.h
+===================================================================
+--- rpm-5.4.14.orig/rpmio/rpmpgp.h
++++ rpm-5.4.14/rpmio/rpmpgp.h
+@@ -11,11 +11,11 @@
+ */
+
+ #include <string.h>
+-#include <popt.h>
+ #include <rpmiotypes.h>
+ #include <yarn.h>
+
+ #if defined(_RPMPGP_INTERNAL)
++#include <popt.h>
+ #include <rpmsw.h>
+
+ /*@unchecked@*/
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-scriptletexechelper.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-scriptletexechelper.patch
new file mode 100644
index 000000000..b55fe22c6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-scriptletexechelper.patch
@@ -0,0 +1,159 @@
+Enable a cross-install scriptlet helper.
+
+The helper is called from outside of the chroot with the arguments:
+
+<root> <prog> <script> <arg1> [<arg2> ... <argN>]
+
+The helper script is used by oe-core to facilitate shell script actions that
+can not be run from within a chroot on a foreign target system during a
+cross install.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm/lib/psm.c
+===================================================================
+--- rpm.orig/lib/psm.c
++++ rpm/lib/psm.c
+@@ -846,6 +846,9 @@ static rpmRC runScript(rpmpsm psm, Heade
+ pid_t pid;
+ int xx;
+ int i;
++#ifdef RPM_VENDOR_OE
++ const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL);
++#endif
+
+ #ifdef __clang__
+ #pragma clang diagnostic push
+@@ -923,14 +926,29 @@ assert(he->p.str != NULL);
+ (F_ISSET(psm, UNORDERED) ? "a" : ""));
+
+ if (Phe->p.argv == NULL) {
+- argv = (const char **) alloca(5 * sizeof(*argv));
+- argv[0] = "/bin/sh";
+- argc = 1;
++ argv = (const char **) alloca(7 * sizeof(*argv));
++ argc = 0;
++ } else {
++ argv = (const char **) alloca((Phe->c + 6) * sizeof(*argv));
++ argc = 0;
++ }
++
++#ifdef RPM_VENDOR_OE
++ if (scriptletWrapper && *scriptletWrapper) {
++ argv[argc++] = scriptletWrapper;
++ argv[argc] = rpmtsRootDir(ts);
++ if (!argv[argc] || !*argv[argc])
++ argv[argc] = "/";
++ argc++;
++ }
++#endif
++
++ if (Phe->p.argv == NULL) {
++ argv[argc++] = "/bin/sh";
+ ldconfig_done = 0;
+ } else {
+- argv = (const char **) alloca((Phe->c + 4) * sizeof(*argv));
+- memcpy(argv, Phe->p.argv, Phe->c * sizeof(*argv));
+- argc = Phe->c;
++ memcpy((argv + argc), Phe->p.argv, Phe->c * sizeof(*argv));
++ argc += Phe->c;
+ ldconfig_done = (ldconfig_path && !strcmp(argv[0], ldconfig_path)
+ ? 1 : 0);
+ }
+@@ -981,7 +999,12 @@ assert(he->p.str != NULL);
+ goto exit;
+
+ if (rpmIsDebug() &&
+- (!strcmp(argv[0], "/bin/sh") || !strcmp(argv[0], "/bin/bash")))
++ (!strcmp(argv[0], "/bin/sh") || !strcmp(argv[0], "/bin/bash"))
++#ifdef RPM_VENDOR_OE
++ || (scriptletWrapper && *scriptletWrapper && !strcmp(argv[1], "/bin/sh"))
++ || (scriptletWrapper && *scriptletWrapper && !strcmp(argv[1], "/bin/bash"))
++#endif
++ )
+ {
+ static const char set_x[] = "set -x\n";
+ nw = Fwrite(set_x, sizeof(set_x[0]), sizeof(set_x)-1, fd);
+@@ -1116,12 +1139,22 @@ assert(he->p.str != NULL);
+
+ { const char * rootDir = rpmtsRootDir(ts);
+ if (!rpmtsChrootDone(ts) && rootDir != NULL &&
++#ifdef RPM_VENDOR_OE
++ !(scriptletWrapper && *scriptletWrapper) &&
++#endif
+ !(rootDir[0] == '/' && rootDir[1] == '\0'))
+ {
+ /*@-modobserver@*/
+ xx = Chroot(rootDir);
+ /*@=modobserver@*/
+ }
++#ifdef RPM_VENDOR_OE
++ if (!rpmtsChrootDone(ts) && rootDir != NULL &&
++ (scriptletWrapper && *scriptletWrapper) &&
++ !(rootDir[0] == '/' && rootDir[1] == '\0'))
++ xx = Chdir(rootDir);
++ else
++#endif
+ xx = Chdir("/");
+ rpmlog(RPMLOG_DEBUG, D_("%s: %s(%s)\texecv(%s) pid %d\n"),
+ psm->stepName, sln, NVRA,
+@@ -3052,6 +3085,13 @@ assert(psm->te != NULL);
+ case PSM_SCRIPT: /* Run current package scriptlets. */
+ /* XXX running %verifyscript/%sanitycheck doesn't have psm->te */
+ { rpmtxn _parent = (psm && psm->te ? psm->te->txn : NULL);
++
++#ifdef RPM_VENDOR_OE
++ const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL);
++ if (scriptletWrapper && *scriptletWrapper)
++ rc = rpmpsmNext(psm, PSM_CHROOT_OUT);
++#endif
++
+ xx = rpmtxnBegin(rpmtsGetRdb(ts), _parent, NULL);
+ rc = runInstScript(psm);
+ if (rc)
+@@ -3059,11 +3099,24 @@ assert(psm->te != NULL);
+ else
+ xx = rpmtxnCommit(rpmtsGetRdb(ts)->db_txn);
+ rpmtsGetRdb(ts)->db_txn = NULL;
++#ifdef RPM_VENDOR_OE
++ if (scriptletWrapper && *scriptletWrapper)
++ rc = rpmpsmNext(psm, PSM_CHROOT_IN);
++#endif
+ } break;
+ case PSM_TRIGGERS:
+ /* Run triggers in other package(s) this package sets off. */
+ if (rpmtsFlags(ts) & RPMTRANS_FLAG_TEST) break;
++#ifdef RPM_VENDOR_OE
++ const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL);
++ if (scriptletWrapper && *scriptletWrapper)
++ rc = rpmpsmNext(psm, PSM_CHROOT_OUT);
++#endif
+ rc = runTriggers(psm);
++#ifdef RPM_VENDOR_OE
++ if (scriptletWrapper && *scriptletWrapper)
++ rc = rpmpsmNext(psm, PSM_CHROOT_IN);
++#endif
+ break;
+ case PSM_IMMED_TRIGGERS:
+ /* Run triggers in this package other package(s) set off. */
+@@ -3073,7 +3126,18 @@ assert(psm->te != NULL);
+ F_SET(psm, GOTTRIGGERS);
+ }
+ if (psm->triggers != NULL)
++#ifdef RPM_VENDOR_OE
++ {
++ const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL);
++ if (scriptletWrapper && *scriptletWrapper)
++ rc = rpmpsmNext(psm, PSM_CHROOT_OUT);
++#endif
+ rc = runImmedTriggers(psm);
++#ifdef RPM_VENDOR_OE
++ if (scriptletWrapper && *scriptletWrapper)
++ rc = rpmpsmNext(psm, PSM_CHROOT_IN);
++ }
++#endif
+ break;
+
+ case PSM_RPMIO_FLAGS:
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-showrc.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-showrc.patch
new file mode 100644
index 000000000..ec38b95f2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-showrc.patch
@@ -0,0 +1,26 @@
+Workaround for a memory leak in --showrc.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/lib/rpmrc.c
+===================================================================
+--- rpm-5.4.14.orig/lib/rpmrc.c
++++ rpm-5.4.14/lib/rpmrc.c
+@@ -1228,11 +1228,15 @@ int rpmShowRC(FILE * fp)
+ if (DNEVR != NULL)
+ fprintf(fp, " %s\n", DNEVR+2);
+ }
++#if 0
+ (void)rpmdsFree(ds);
+ ds = NULL;
++#endif
+ fprintf(fp, "\n");
+ }
++#if 0
+ PRCO = rpmdsFreePRCO(PRCO);
++#endif
+ }
+
+ if (rpmIsVerbose()) {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-syck-fix-gram.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-syck-fix-gram.patch
new file mode 100644
index 000000000..d6493c197
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-syck-fix-gram.patch
@@ -0,0 +1,1081 @@
+Fix the syck/lib/gram.y
+
+This resolves a problem during compilation:
+
+../../../rpm/syck/lib/gram.y:66:27: error: 'parser' undeclared (first use in this function)
+ ((SyckParser *)parser)->root = syck_hdlr_add_node( (SyckParser *)parser, $1 );
+ ^
+../../../rpm/syck/lib/gram.y:66:27: note: each undeclared identifier is reported only once for each function it appears in
+../../../rpm/syck/lib/syck.c: In function 'syck_parse':
+../../../rpm/syck/lib/syck.c:516:5: warning: implicit declaration of function 'syckparse' [-Wimplicit-function-declaration]
+ syckparse( p );
+ ^
+
+This patch was generated by reverting the grammer back to a previous
+version.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm/syck/lib/gram.y
+===================================================================
+--- rpm.orig/syck/lib/gram.y
++++ rpm/syck/lib/gram.y
+@@ -9,18 +9,10 @@
+
+ %start doc
+ %pure-parser
+-%parse-param {void* parser}
+-%lex-param {void* parser}
+
+
+ %{
+
+-#define YYDEBUG 1
+-#define YYERROR_VERBOSE 1
+-#ifndef YYSTACK_USE_ALLOCA
+-#define YYSTACK_USE_ALLOCA 0
+-#endif
+-
+ #include "system.h"
+ #include "syck.h"
+ #include "debug.h"
+@@ -28,6 +20,9 @@
+ void apply_seq_in_map( SyckParser *parser, SyckNode *n )
+ /*@*/;
+
++#define YYPARSE_PARAM parser
++#define YYLEX_PARAM parser
++
+ #define NULL_NODE(parser, node) \
+ SyckNode *node = syck_new_str( "", scalar_plain ); \
+ if ( ((SyckParser *)parser)->taguri_expansion == 1 ) \
+Index: rpm/syck/lib/Makefile.am
+===================================================================
+--- rpm.orig/syck/lib/Makefile.am
++++ rpm/syck/lib/Makefile.am
+@@ -49,25 +49,25 @@ SYCK_SPLINT_SRCS = \
+ token.c \
+ implicit.c
+
+-#gram.c: gram.y
+-# $(YACC) -d -t -v -p syck -o $@ $<
+-# -@if test -f gram.c; then \
+-# { echo "/*@-globs -mods -modnomods -moduncon -modunconnomods @*/";\
+-# echo "/*@-noeffect -noeffectuncon @*/";\
+-# echo "/*@-nullassign @*/";\
+-# echo "/*@-readonlytrans @*/";\
+-# echo "/*@-uniondef @*/";\
+-# echo "/*@-warnlintcomments @*/";\
+-# cat gram.c;\
+-# echo "/*@=warnlintcomments @*/";\
+-# echo "/*@=uniondef @*/";\
+-# echo "/*@=readonlytrans @*/";\
+-# echo "/*@=nullassign @*/";\
+-# echo "/*@=noeffect =noeffectuncon @*/";\
+-# echo "/*@=globs =mods =modnomods =moduncon =modunconnomods @*/";\
+-# } > _gram.c ;\
+-# mv -f _gram.c gram.c; \
+-# fi
++gram.c: gram.y
++ $(YACC) -d -t -v -p syck -o $@ $<
++ -@if test -f gram.c; then \
++ { echo "/*@-globs -mods -modnomods -moduncon -modunconnomods @*/";\
++ echo "/*@-noeffect -noeffectuncon @*/";\
++ echo "/*@-nullassign @*/";\
++ echo "/*@-readonlytrans @*/";\
++ echo "/*@-uniondef @*/";\
++ echo "/*@-warnlintcomments @*/";\
++ cat gram.c;\
++ echo "/*@=warnlintcomments @*/";\
++ echo "/*@=uniondef @*/";\
++ echo "/*@=readonlytrans @*/";\
++ echo "/*@=nullassign @*/";\
++ echo "/*@=noeffect =noeffectuncon @*/";\
++ echo "/*@=globs =mods =modnomods =moduncon =modunconnomods @*/";\
++ } > _gram.c ;\
++ mv -f _gram.c gram.c; \
++ fi
+
+ BUILT_SOURCES = gram.c gram.h
+
+Index: rpm/syck/lib/implicit.c
+===================================================================
+--- rpm.orig/syck/lib/implicit.c
++++ rpm/syck/lib/implicit.c
+@@ -19,11 +19,6 @@
+ #define YYLIMIT limit
+ #define YYFILL(n)
+
+-#ifdef __clang__
+-#pragma clang diagnostic push
+-#pragma clang diagnostic ignored "-Wempty-body"
+-#endif
+-
+ void
+ try_tag_implicit( SyckNode *n, int taguri )
+ {
+@@ -3000,8 +2995,4 @@ yy270: ++YYCURSOR;
+
+ }
+
+-#ifdef __clang__
+-#pragma clang diagnostic pop
+-#endif
+-
+ /*@=noret@*/
+Index: rpm/syck/lib/syck.c
+===================================================================
+--- rpm.orig/syck/lib/syck.c
++++ rpm/syck/lib/syck.c
+@@ -519,7 +519,7 @@ syck_parse( SyckParser *p )
+ }
+
+ void
+-syck_default_error_handler( SyckParser *p, const char *msg )
++syck_default_error_handler( SyckParser *p, char *msg )
+ {
+ printf( "Error at [Line %d, Col %ld]: %s\n",
+ p->linect,
+Index: rpm/syck/lib/syck.h
+===================================================================
+--- rpm.orig/syck/lib/syck.h
++++ rpm/syck/lib/syck.h
+@@ -175,7 +175,7 @@ typedef struct _syck_str SyckIoStr;
+ typedef struct _syck_level SyckLevel;
+
+ typedef SYMID (*SyckNodeHandler)(SyckParser *p, SyckNode *n);
+-typedef void (*SyckErrorHandler)(SyckParser *p, const char *);
++typedef void (*SyckErrorHandler)(SyckParser *p, char *);
+ typedef SyckNode * (*SyckBadAnchorHandler)(SyckParser *p, char *);
+ typedef long (*SyckIoFileRead)(char *, SyckIoFile *, long, long);
+ typedef long (*SyckIoStrRead)(char *, SyckIoStr *, long, long);
+@@ -546,7 +546,7 @@ long syck_parser_readlen( SyckParser *p,
+ SYMID syck_parse( SyckParser *p )
+ /*@globals fileSystem @*/
+ /*@modifies p, fileSystem @*/;
+-void syck_default_error_handler( SyckParser *p, const char * )
++void syck_default_error_handler( SyckParser *p, char * )
+ /*@globals fileSystem @*/
+ /*@modifies p, fileSystem @*/;
+ SYMID syck_yaml2byte_handler( SyckParser *p, SyckNode *n )
+@@ -619,7 +619,7 @@ long syck_seq_count( SyckNode *seq )
+ /*
+ * Lexer prototypes
+ */
+-void syckerror( void *, const char *msg )
++void syckerror( char *msg )
+ /*@*/;
+ /* XXX union YYSTYPE *sycklval has issues on Mac OS X. */
+ int sycklex( void *_sycklval, SyckParser *parser )
+Index: rpm/syck/lib/token.c
+===================================================================
+--- rpm.orig/syck/lib/token.c
++++ rpm/syck/lib/token.c
+@@ -270,11 +270,11 @@ sycklex( void * _sycklval, SyckParser *p
+ return sycklex_yaml_utf8( sycklval, parser );
+
+ case syck_yaml_utf16:
+- syckerror( parser, "UTF-16 is not currently supported in Syck.\nPlease contribute code to help this happen!" );
++ syckerror( "UTF-16 is not currently supported in Syck.\nPlease contribute code to help this happen!" );
+ break;
+
+ case syck_yaml_utf32:
+- syckerror( parser, "UTF-32 is not currently supported in Syck.\nPlease contribute code to help this happen!" );
++ syckerror( "UTF-32 is not currently supported in Syck.\nPlease contribute code to help this happen!" );
+ break;
+
+ case syck_bytecode_utf8:
+@@ -2739,15 +2739,14 @@ syckwrap(void)
+ }
+
+ void
+-syckerror( void *p, const char *msg )
++syckerror( char *msg )
+ {
+- SyckParser * parser = (SyckParser *)p;
+ /*@-mods@*/
+- if ( parser->error_handler == NULL )
+- parser->error_handler = syck_default_error_handler;
++ if ( syck_parser_ptr->error_handler == NULL )
++ syck_parser_ptr->error_handler = syck_default_error_handler;
+
+- parser->root = parser->root_on_error;
++ syck_parser_ptr->root = syck_parser_ptr->root_on_error;
+ /*@=mods@*/
+- (parser->error_handler)(parser, msg);
++ (syck_parser_ptr->error_handler)(syck_parser_ptr, msg);
+ }
+
+Index: rpm/syck/lib/bytecode.c
+===================================================================
+--- rpm.orig/syck/lib/bytecode.c
++++ rpm/syck/lib/bytecode.c
+@@ -1,10 +1,10 @@
+-/* Generated by re2c 0.9.12 on Tue Mar 14 00:14:53 2006 */
++/* Generated by re2c 0.13.5 on Tue Feb 23 12:04:00 2016 */
+ #line 1 "bytecode.re"
+ /*
+ * bytecode.re
+ *
+ * $Author: why $
+- * $Date: 2005-09-20 08:21:06 +0300 (Tue, 20 Sep 2005) $
++ * $Date: 2005/09/20 05:21:06 $
+ *
+ * Copyright (C) 2003 why the lucky stiff
+ */
+@@ -27,14 +27,11 @@
+ #define YYLINEPTR parser->lineptr
+ #define YYLINECTPTR parser->linectptr
+ #define YYLINE parser->linect
+-#define YYFILL(n) (void) syck_parser_read(parser)
++#define YYFILL(n) syck_parser_read(parser)
+
+-/*@unchecked@*/ /*@null@*/
+ extern SyckParser *syck_parser_ptr;
+
+-/*@null@*/
+-char *get_inline( SyckParser *parser )
+- /*@modifies parser @*/;
++char *get_inline( SyckParser *parser );
+
+ /*
+ * Repositions the cursor at `n' offset from the token start.
+@@ -137,14 +134,12 @@ char *get_inline( SyckParser *parser )
+ */
+ int
+ sycklex_bytecode_utf8( YYSTYPE *sycklval, SyckParser *parser )
+- /*@globals syck_parser_ptr @*/
+- /*@modifies sycklval, parser, syck_parser_ptr @*/
+ {
+ SyckLevel *lvl;
+ syck_parser_ptr = parser;
+ if ( YYCURSOR == NULL )
+ {
+- (void) syck_parser_read( parser );
++ syck_parser_read( parser );
+ }
+
+ if ( parser->force_token != 0 )
+@@ -171,42 +166,37 @@ sycklex_bytecode_utf8( YYSTYPE *sycklval
+ #line 165 "<stdout>"
+ {
+ YYCTYPE yych;
+- unsigned int yyaccept = 0;
+- goto yy0;
+- /*@notreached@*/
+- ++YYCURSOR;
+-yy0:
+- if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
++
++ if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
+ yych = *YYCURSOR;
+- switch(yych){
++ switch (yych) {
+ case 0x00: goto yy2;
+ case 'D': goto yy3;
+ default: goto yy5;
+ }
+-yy2: YYCURSOR = YYMARKER;
+- switch(yyaccept){
+- case 0: goto yy4;
+- }
+-yy3: yyaccept = 0;
++yy2:
++ YYCURSOR = YYMARKER;
++ goto yy4;
++yy3:
+ yych = *(YYMARKER = ++YYCURSOR);
+- switch(yych){
+- case 0x0A: goto yy6;
+- case 0x0D: goto yy8;
++ switch (yych) {
++ case '\n': goto yy6;
++ case '\r': goto yy8;
+ default: goto yy4;
+ }
+ yy4:
+ #line 199 "bytecode.re"
+-{ YYPOS(0);
++ { YYPOS(0);
+ goto Document;
+ }
+-#line 195 "<stdout>"
+-yy5: yych = *++YYCURSOR;
++#line 191 "<stdout>"
++yy5:
++ yych = *++YYCURSOR;
+ goto yy4;
+-yy6: ++YYCURSOR;
+- goto yy7;
+-yy7:
++yy6:
++ ++YYCURSOR;
+ #line 186 "bytecode.re"
+-{ if ( lvl->status == syck_lvl_header )
++ { if ( lvl->status == syck_lvl_header )
+ {
+ CHK_NL(YYCURSOR);
+ goto Directive;
+@@ -218,10 +208,11 @@ yy7:
+ return 0;
+ }
+ }
+-#line 214 "<stdout>"
+-yy8: ++YYCURSOR;
+- switch((yych = *YYCURSOR)) {
+- case 0x0A: goto yy6;
++#line 210 "<stdout>"
++yy8:
++ ++YYCURSOR;
++ switch ((yych = *YYCURSOR)) {
++ case '\n': goto yy6;
+ default: goto yy2;
+ }
+ }
+@@ -239,19 +230,15 @@ Document:
+ YYTOKEN = YYCURSOR;
+
+
+-#line 235 "<stdout>"
++#line 232 "<stdout>"
+ {
+ YYCTYPE yych;
+- goto yy9;
+- /*@notreached@*/
+- ++YYCURSOR;
+-yy9:
+- if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
++ if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
+ yych = *YYCURSOR;
+- switch(yych){
++ switch (yych) {
+ case 0x00: goto yy30;
+- case 0x0A: goto yy27;
+- case 0x0D: goto yy29;
++ case '\n': goto yy27;
++ case '\r': goto yy29;
+ case 'A': goto yy19;
+ case 'D': goto yy12;
+ case 'E': goto yy16;
+@@ -264,71 +251,73 @@ yy9:
+ case 'c': goto yy25;
+ default: goto yy11;
+ }
+-yy11:yy12: yych = *++YYCURSOR;
+- switch(yych){
+- case 0x0A: goto yy41;
+- case 0x0D: goto yy44;
++yy11:
++yy12:
++ yych = *++YYCURSOR;
++ switch (yych) {
++ case '\n': goto yy41;
++ case '\r': goto yy44;
+ default: goto yy11;
+ }
+-yy13: yych = *++YYCURSOR;
+- switch(yych){
+- case 0x0A: goto yy41;
+- case 0x0D: goto yy43;
++yy13:
++ yych = *++YYCURSOR;
++ switch (yych) {
++ case '\n': goto yy41;
++ case '\r': goto yy43;
+ default: goto yy11;
+ }
+-yy14: yych = *++YYCURSOR;
+- switch(yych){
+- case 0x0A: goto yy38;
+- case 0x0D: goto yy40;
++yy14:
++ yych = *++YYCURSOR;
++ switch (yych) {
++ case '\n': goto yy38;
++ case '\r': goto yy40;
+ default: goto yy11;
+ }
+-yy15: yych = *++YYCURSOR;
+- switch(yych){
+- case 0x0A: goto yy35;
+- case 0x0D: goto yy37;
++yy15:
++ yych = *++YYCURSOR;
++ switch (yych) {
++ case '\n': goto yy35;
++ case '\r': goto yy37;
+ default: goto yy11;
+ }
+-yy16: yych = *++YYCURSOR;
+- switch(yych){
+- case 0x0A: goto yy32;
+- case 0x0D: goto yy34;
++yy16:
++ yych = *++YYCURSOR;
++ switch (yych) {
++ case '\n': goto yy32;
++ case '\r': goto yy34;
+ default: goto yy11;
+ }
+-yy17: ++YYCURSOR;
+- goto yy18;
+-yy18:
++yy17:
++ ++YYCURSOR;
+ #line 288 "bytecode.re"
+-{ ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_str);
++ { ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_str);
+ goto Scalar;
+ }
+-#line 296 "<stdout>"
+-yy19: ++YYCURSOR;
+- goto yy20;
+-yy20:
++#line 295 "<stdout>"
++yy19:
++ ++YYCURSOR;
+ #line 292 "bytecode.re"
+-{ ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_open);
++ { ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_open);
+ sycklval->name = get_inline( parser );
+ syck_hdlr_remove_anchor( parser, sycklval->name );
+ CHK_NL(YYCURSOR);
+ return YAML_ANCHOR;
+ }
+-#line 307 "<stdout>"
+-yy21: ++YYCURSOR;
+- goto yy22;
+-yy22:
++#line 305 "<stdout>"
++yy21:
++ ++YYCURSOR;
+ #line 299 "bytecode.re"
+-{ ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_str);
++ { ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_str);
+ sycklval->name = get_inline( parser );
+ POP_LEVEL();
+ if ( *( YYCURSOR - 1 ) == '\n' ) YYCURSOR--;
+ return YAML_ALIAS;
+ }
+-#line 318 "<stdout>"
+-yy23: ++YYCURSOR;
+- goto yy24;
+-yy24:
++#line 315 "<stdout>"
++yy23:
++ ++YYCURSOR;
+ #line 306 "bytecode.re"
+-{ char *qstr;
++ { char *qstr;
+ ADD_BYTE_LEVEL(lvl, lvl->spaces + 1, syck_lvl_open);
+ qstr = get_inline( parser );
+ CHK_NL(YYCURSOR);
+@@ -387,18 +376,16 @@ yy24:
+ sycklval->name = qstr;
+ return YAML_TAGURI;
+ }
+-#line 382 "<stdout>"
+-yy25: ++YYCURSOR;
+- goto yy26;
+-yy26:
++#line 378 "<stdout>"
++yy25:
++ ++YYCURSOR;
+ #line 366 "bytecode.re"
+-{ goto Comment; }
+-#line 388 "<stdout>"
+-yy27: ++YYCURSOR;
+- goto yy28;
+-yy28:
++ { goto Comment; }
++#line 383 "<stdout>"
++yy27:
++ ++YYCURSOR;
+ #line 368 "bytecode.re"
+-{ CHK_NL(YYCURSOR);
++ { CHK_NL(YYCURSOR);
+ if ( lvl->status == syck_lvl_seq )
+ {
+ return YAML_INDENT;
+@@ -410,26 +397,25 @@ yy28:
+ }
+ goto Document;
+ }
+-#line 405 "<stdout>"
+-yy29: yych = *++YYCURSOR;
+- switch(yych){
+- case 0x0A: goto yy27;
++#line 399 "<stdout>"
++yy29:
++ yych = *++YYCURSOR;
++ switch (yych) {
++ case '\n': goto yy27;
+ default: goto yy11;
+ }
+-yy30: ++YYCURSOR;
+- goto yy31;
+-yy31:
++yy30:
++ ++YYCURSOR;
+ #line 381 "bytecode.re"
+-{ ENSURE_YAML_IEND(lvl, -1);
++ { ENSURE_YAML_IEND(lvl, -1);
+ YYPOS(0);
+ return 0;
+ }
+-#line 419 "<stdout>"
+-yy32: ++YYCURSOR;
+- goto yy33;
+-yy33:
++#line 413 "<stdout>"
++yy32:
++ ++YYCURSOR;
+ #line 252 "bytecode.re"
+-{ if ( lvl->status == syck_lvl_seq && lvl->ncount == 0 )
++ { if ( lvl->status == syck_lvl_seq && lvl->ncount == 0 )
+ {
+ lvl->ncount++;
+ YYPOS(0);
+@@ -464,17 +450,17 @@ yy33:
+ CHK_NL(YYCURSOR);
+ return YAML_IEND;
+ }
+-#line 459 "<stdout>"
+-yy34: yych = *++YYCURSOR;
+- switch(yych){
+- case 0x0A: goto yy32;
++#line 452 "<stdout>"
++yy34:
++ yych = *++YYCURSOR;
++ switch (yych) {
++ case '\n': goto yy32;
+ default: goto yy11;
+ }
+-yy35: ++YYCURSOR;
+- goto yy36;
+-yy36:
++yy35:
++ ++YYCURSOR;
+ #line 237 "bytecode.re"
+-{ int complex = 0;
++ { int complex = 0;
+ if ( lvl->ncount % 2 == 0 && ( lvl->status == syck_lvl_map || lvl->status == syck_lvl_seq ) )
+ {
+ complex = 1;
+@@ -488,17 +474,17 @@ yy36:
+ }
+ return YAML_IOPEN;
+ }
+-#line 483 "<stdout>"
+-yy37: yych = *++YYCURSOR;
+- switch(yych){
+- case 0x0A: goto yy35;
++#line 476 "<stdout>"
++yy37:
++ yych = *++YYCURSOR;
++ switch (yych) {
++ case '\n': goto yy35;
+ default: goto yy11;
+ }
+-yy38: ++YYCURSOR;
+- goto yy39;
+-yy39:
++yy38:
++ ++YYCURSOR;
+ #line 222 "bytecode.re"
+-{ int complex = 0;
++ { int complex = 0;
+ if ( lvl->ncount % 2 == 0 && ( lvl->status == syck_lvl_map || lvl->status == syck_lvl_seq ) )
+ {
+ complex = 1;
+@@ -512,29 +498,31 @@ yy39:
+ }
+ return YAML_IOPEN;
+ }
+-#line 507 "<stdout>"
+-yy40: yych = *++YYCURSOR;
+- switch(yych){
+- case 0x0A: goto yy38;
++#line 500 "<stdout>"
++yy40:
++ yych = *++YYCURSOR;
++ switch (yych) {
++ case '\n': goto yy38;
+ default: goto yy11;
+ }
+-yy41: ++YYCURSOR;
+- goto yy42;
+-yy42:
++yy41:
++ ++YYCURSOR;
+ #line 217 "bytecode.re"
+-{ ENSURE_YAML_IEND(lvl, -1);
++ { ENSURE_YAML_IEND(lvl, -1);
+ YYPOS(0);
+ return 0;
+ }
+-#line 521 "<stdout>"
+-yy43: yych = *++YYCURSOR;
+- switch(yych){
+- case 0x0A: goto yy41;
++#line 514 "<stdout>"
++yy43:
++ yych = *++YYCURSOR;
++ switch (yych) {
++ case '\n': goto yy41;
+ default: goto yy11;
+ }
+-yy44: ++YYCURSOR;
+- switch((yych = *YYCURSOR)) {
+- case 0x0A: goto yy41;
++yy44:
++ ++YYCURSOR;
++ switch ((yych = *YYCURSOR)) {
++ case '\n': goto yy41;
+ default: goto yy11;
+ }
+ }
+@@ -548,28 +536,22 @@ Directive:
+ YYTOKEN = YYCURSOR;
+
+
+-#line 543 "<stdout>"
++#line 538 "<stdout>"
+ {
+ YYCTYPE yych;
+- unsigned int yyaccept = 0;
+- goto yy45;
+- /*@notreached@*/
+- ++YYCURSOR;
+-yy45:
+- if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
++ if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+- switch(yych){
++ switch (yych) {
+ case 0x00: goto yy47;
+ case 'V': goto yy48;
+ default: goto yy50;
+ }
+-yy47: YYCURSOR = YYMARKER;
+- switch(yyaccept){
+- case 0: goto yy49;
+- }
+-yy48: yyaccept = 0;
++yy47:
++ YYCURSOR = YYMARKER;
++ goto yy49;
++yy48:
+ yych = *(YYMARKER = ++YYCURSOR);
+- switch(yych){
++ switch (yych) {
+ case '.':
+ case '/':
+ case '0':
+@@ -619,7 +601,8 @@ yy48: yyaccept = 0;
+ case '\\':
+ case ']':
+ case '^':
+- case '_': case 'a':
++ case '_':
++ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+@@ -649,17 +632,18 @@ yy48: yyaccept = 0;
+ }
+ yy49:
+ #line 399 "bytecode.re"
+-{ YYCURSOR = YYTOKEN;
++ { YYCURSOR = YYTOKEN;
+ return YAML_DOCSEP;
+ }
+-#line 646 "<stdout>"
+-yy50: yych = *++YYCURSOR;
++#line 637 "<stdout>"
++yy50:
++ yych = *++YYCURSOR;
+ goto yy49;
+-yy51: ++YYCURSOR;
+- if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
++yy51:
++ ++YYCURSOR;
++ if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+- goto yy52;
+-yy52: switch(yych){
++ switch (yych) {
+ case '.':
+ case '/':
+ case '0':
+@@ -671,7 +655,8 @@ yy52: switch(yych){
+ case '6':
+ case '7':
+ case '8':
+- case '9': case ';':
++ case '9':
++ case ';':
+ case '<':
+ case '=':
+ case '>':
+@@ -707,7 +692,8 @@ yy52: switch(yych){
+ case '\\':
+ case ']':
+ case '^':
+- case '_': case 'a':
++ case '_':
++ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+@@ -736,8 +722,9 @@ yy52: switch(yych){
+ case ':': goto yy53;
+ default: goto yy47;
+ }
+-yy53: yych = *++YYCURSOR;
+- switch(yych){
++yy53:
++ yych = *++YYCURSOR;
++ switch (yych) {
+ case '.':
+ case '/':
+ case '0':
+@@ -787,7 +774,8 @@ yy53: yych = *++YYCURSOR;
+ case '\\':
+ case ']':
+ case '^':
+- case '_': case 'a':
++ case '_':
++ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+@@ -815,13 +803,13 @@ yy53: yych = *++YYCURSOR;
+ case 'z': goto yy54;
+ default: goto yy47;
+ }
+-yy54: ++YYCURSOR;
+- if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
++yy54:
++ ++YYCURSOR;
++ if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+- goto yy55;
+-yy55: switch(yych){
+- case 0x0A: goto yy56;
+- case 0x0D: goto yy58;
++ switch (yych) {
++ case '\n': goto yy56;
++ case '\r': goto yy58;
+ case '.':
+ case '/':
+ case '0':
+@@ -871,7 +859,8 @@ yy55: switch(yych){
+ case '\\':
+ case ']':
+ case '^':
+- case '_': case 'a':
++ case '_':
++ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+@@ -899,16 +888,16 @@ yy55: switch(yych){
+ case 'z': goto yy54;
+ default: goto yy47;
+ }
+-yy56: ++YYCURSOR;
+- goto yy57;
+-yy57:
++yy56:
++ ++YYCURSOR;
+ #line 396 "bytecode.re"
+-{ CHK_NL(YYCURSOR);
++ { CHK_NL(YYCURSOR);
+ goto Directive; }
+-#line 899 "<stdout>"
+-yy58: ++YYCURSOR;
+- switch((yych = *YYCURSOR)) {
+- case 0x0A: goto yy56;
++#line 895 "<stdout>"
++yy58:
++ ++YYCURSOR;
++ switch ((yych = *YYCURSOR)) {
++ case '\n': goto yy56;
+ default: goto yy47;
+ }
+ }
+@@ -922,40 +911,40 @@ Comment:
+ YYTOKEN = YYCURSOR;
+
+
+-#line 916 "<stdout>"
++#line 913 "<stdout>"
+ {
+ YYCTYPE yych;
+- goto yy59;
+- /*@notreached@*/
+- ++YYCURSOR;
+-yy59:
+- if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
++ if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+- switch(yych){
++ switch (yych) {
+ case 0x00: goto yy61;
+- case 0x0A: goto yy62;
+- case 0x0D: goto yy64;
++ case '\n': goto yy62;
++ case '\r': goto yy64;
+ default: goto yy66;
+ }
+-yy61:yy62: ++YYCURSOR;
+- goto yy63;
++yy61:
++yy62:
++ ++YYCURSOR;
+ yy63:
+ #line 412 "bytecode.re"
+-{ CHK_NL(YYCURSOR);
++ { CHK_NL(YYCURSOR);
+ goto Document; }
+-#line 936 "<stdout>"
+-yy64: ++YYCURSOR;
+- switch((yych = *YYCURSOR)) {
+- case 0x0A: goto yy67;
++#line 931 "<stdout>"
++yy64:
++ ++YYCURSOR;
++ switch ((yych = *YYCURSOR)) {
++ case '\n': goto yy67;
+ default: goto yy65;
+ }
+ yy65:
+ #line 415 "bytecode.re"
+-{ goto Comment; }
+-#line 945 "<stdout>"
+-yy66: yych = *++YYCURSOR;
++ { goto Comment; }
++#line 941 "<stdout>"
++yy66:
++ yych = *++YYCURSOR;
+ goto yy65;
+-yy67: ++YYCURSOR;
++yy67:
++ ++YYCURSOR;
+ yych = *YYCURSOR;
+ goto yy63;
+ }
+@@ -977,23 +966,20 @@ Scalar2:
+ tok = YYCURSOR;
+
+
+-#line 970 "<stdout>"
++#line 968 "<stdout>"
+ {
+ YYCTYPE yych;
+- goto yy68;
+- /*@notreached@*/
+- ++YYCURSOR;
+-yy68:
+- if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
++ if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
+ yych = *YYCURSOR;
+- switch(yych){
++ switch (yych) {
+ case 0x00: goto yy74;
+- case 0x0A: goto yy70;
+- case 0x0D: goto yy72;
++ case '\n': goto yy70;
++ case '\r': goto yy72;
+ default: goto yy76;
+ }
+-yy70: ++YYCURSOR;
+- switch((yych = *YYCURSOR)) {
++yy70:
++ ++YYCURSOR;
++ switch ((yych = *YYCURSOR)) {
+ case 'C': goto yy78;
+ case 'N': goto yy80;
+ case 'Z': goto yy83;
+@@ -1001,50 +987,51 @@ yy70: ++YYCURSOR;
+ }
+ yy71:
+ #line 461 "bytecode.re"
+-{ YYCURSOR = tok;
++ { YYCURSOR = tok;
+ goto ScalarEnd;
+ }
+-#line 996 "<stdout>"
+-yy72: ++YYCURSOR;
+- switch((yych = *YYCURSOR)) {
+- case 0x0A: goto yy77;
++#line 992 "<stdout>"
++yy72:
++ ++YYCURSOR;
++ switch ((yych = *YYCURSOR)) {
++ case '\n': goto yy77;
+ default: goto yy73;
+ }
+ yy73:
+ #line 469 "bytecode.re"
+-{ CAT(str, cap, idx, tok[0]);
++ { CAT(str, cap, idx, tok[0]);
+ goto Scalar2;
+ }
+-#line 1007 "<stdout>"
+-yy74: ++YYCURSOR;
+- goto yy75;
+-yy75:
++#line 1004 "<stdout>"
++yy74:
++ ++YYCURSOR;
+ #line 465 "bytecode.re"
+-{ YYCURSOR = tok;
++ { YYCURSOR = tok;
+ goto ScalarEnd;
+ }
+-#line 1015 "<stdout>"
+-yy76: yych = *++YYCURSOR;
++#line 1011 "<stdout>"
++yy76:
++ yych = *++YYCURSOR;
+ goto yy73;
+-yy77: yych = *++YYCURSOR;
+- switch(yych){
++yy77:
++ yych = *++YYCURSOR;
++ switch (yych) {
+ case 'C': goto yy78;
+ case 'N': goto yy80;
+ case 'Z': goto yy83;
+ default: goto yy71;
+ }
+-yy78: ++YYCURSOR;
+- goto yy79;
+-yy79:
++yy78:
++ ++YYCURSOR;
+ #line 435 "bytecode.re"
+-{ CHK_NL(tok+1);
++ { CHK_NL(tok+1);
+ goto Scalar2; }
+-#line 1031 "<stdout>"
+-yy80: ++YYCURSOR;
+- if(YYLIMIT == YYCURSOR) YYFILL(1);
++#line 1028 "<stdout>"
++yy80:
++ ++YYCURSOR;
++ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+- goto yy81;
+-yy81: switch(yych){
++ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+@@ -1059,7 +1046,7 @@ yy81: switch(yych){
+ }
+ yy82:
+ #line 438 "bytecode.re"
+-{ CHK_NL(tok+1);
++ { CHK_NL(tok+1);
+ if ( tok + 2 < YYCURSOR )
+ {
+ char *count = tok + 2;
+@@ -1076,16 +1063,15 @@ yy82:
+ }
+ goto Scalar2;
+ }
+-#line 1068 "<stdout>"
+-yy83: ++YYCURSOR;
+- goto yy84;
+-yy84:
++#line 1065 "<stdout>"
++yy83:
++ ++YYCURSOR;
+ #line 456 "bytecode.re"
+-{ CHK_NL(tok+1);
++ { CHK_NL(tok+1);
+ CAT(str, cap, idx, '\0');
+ goto Scalar2;
+ }
+-#line 1077 "<stdout>"
++#line 1073 "<stdout>"
+ }
+ #line 473 "bytecode.re"
+
+@@ -1122,50 +1108,48 @@ Inline:
+ tok = YYCURSOR;
+
+
+-#line 1114 "<stdout>"
++#line 1110 "<stdout>"
+ {
+ YYCTYPE yych;
+- goto yy85;
+- /*@notreached@*/
+- ++YYCURSOR;
+-yy85:
+- if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
++ if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+- switch(yych){
++ switch (yych) {
+ case 0x00: goto yy91;
+- case 0x0A: goto yy87;
+- case 0x0D: goto yy89;
++ case '\n': goto yy87;
++ case '\r': goto yy89;
+ default: goto yy93;
+ }
+-yy87: ++YYCURSOR;
+- goto yy88;
++yy87:
++ ++YYCURSOR;
+ yy88:
+ #line 508 "bytecode.re"
+-{ CHK_NL(YYCURSOR);
++ { CHK_NL(YYCURSOR);
+ return str; }
+-#line 1134 "<stdout>"
+-yy89: ++YYCURSOR;
+- switch((yych = *YYCURSOR)) {
+- case 0x0A: goto yy94;
++#line 1127 "<stdout>"
++yy89:
++ ++YYCURSOR;
++ switch ((yych = *YYCURSOR)) {
++ case '\n': goto yy94;
+ default: goto yy90;
+ }
+ yy90:
+ #line 515 "bytecode.re"
+-{ CAT(str, cap, idx, tok[0]);
++ { CAT(str, cap, idx, tok[0]);
+ goto Inline;
+ }
+-#line 1145 "<stdout>"
+-yy91: ++YYCURSOR;
+- goto yy92;
+-yy92:
++#line 1139 "<stdout>"
++yy91:
++ ++YYCURSOR;
+ #line 511 "bytecode.re"
+-{ YYCURSOR = tok;
++ { YYCURSOR = tok;
+ return str;
+ }
+-#line 1153 "<stdout>"
+-yy93: yych = *++YYCURSOR;
++#line 1146 "<stdout>"
++yy93:
++ yych = *++YYCURSOR;
+ goto yy90;
+-yy94: ++YYCURSOR;
++yy94:
++ ++YYCURSOR;
+ yych = *YYCURSOR;
+ goto yy88;
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-tag-generate-endian-conversion-fix.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-tag-generate-endian-conversion-fix.patch
new file mode 100644
index 000000000..5fb40b6fe
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-tag-generate-endian-conversion-fix.patch
@@ -0,0 +1,50 @@
+fix a endian incompatible error in generating rpm tag
+
+A flaw was found in the way rpm generating arbitrary tags, which leads to a
+incorrect query result, this issue is introduced by a incompatible endianess
+when the generating process is executed on different architectures.
+
+This patch resolves it by taking the byte order that host uses.
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Signed-off-by: Ming Liu <ming.liu@windriver.com>
+---
+ tagname.c | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+Index: rpm-5.4.14/rpmdb/tagname.c
+===================================================================
+--- rpm-5.4.14.orig/rpmdb/tagname.c
++++ rpm-5.4.14/rpmdb/tagname.c
+@@ -3,6 +3,19 @@
+ */
+
+ #include "system.h"
++#include <endian.h>
++
++/* Don't redefine this macro if it already exists */
++#ifndef le32toh
++#ifdef __USE_BSD
++#include <byteswap.h>
++#if __BYTE_ORDER == __LITTLE_ENDIAN
++#define le32toh(x) (x)
++#else
++#define le32toh(x) __bswap_32(x)
++#endif
++#endif /* __USE_BSD */
++#endif /* le32toh */
+
+ #include <rpmio_internal.h> /* XXX DIGEST_CTX, xtolower, xstrcasecmp */
+ #include <rpmmacro.h>
+@@ -152,7 +165,10 @@ static rpmTag _tagGenerate(const char *s
+ xx = rpmDigestUpdate(ctx, s, nb);
+ xx = rpmDigestFinal(ctx, &digest, &digestlen, 0);
+ if (digest && digestlen > 4) {
++ /* The tag is stored in a uniform byte order for cross-endian compatibility.
++ Swap to the host uses. */
+ memcpy(&tag, digest + (digestlen - 4), 4);
++ tag = le32toh(tag);
+ tag = (rpmTag) (tag & 0x3fffffff);
+ tag = (rpmTag) (tag | 0x40000000);
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-tagname-type.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-tagname-type.patch
new file mode 100644
index 000000000..9eb675ba2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-tagname-type.patch
@@ -0,0 +1,25 @@
+rpmdb/tagname.c: Add the 0x54aafb71 (filenames) type to rpmTagGetType
+
+There is already a workaround in the _tagName function to show that the
+special 'filenames' item is value. This adds a similar patch to the
+_tagType to return the proper type, otherwise it comes back as a simple
+RPM_STRING_ARRAY_TYPE which limits the response to the first element.
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.15/rpmdb/tagname.c
+===================================================================
+--- rpm-5.4.15.orig/rpmdb/tagname.c
++++ rpm-5.4.15/rpmdb/tagname.c
+@@ -353,6 +353,9 @@ static unsigned int _tagType(rpmTag tag)
+ case RPMDBI_RECNO:
+ case RPMDBI_HEAP:
+ break;
++ /* XXX make sure that h.['filenames'] in python "works". */
++ case 0x54aafb71:
++ return (RPM_STRING_ARRAY_TYPE + RPM_ARRAY_RETURN_TYPE);
+ default:
+ if (_rpmTags.byValue == NULL)
+ break;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-tools-mtree-LDFLAGS.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-tools-mtree-LDFLAGS.patch
new file mode 100644
index 000000000..72d350929
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-tools-mtree-LDFLAGS.patch
@@ -0,0 +1,24 @@
+Source: None
+Upstream-Status: Submitted [RPM5 maintainer]
+Author: Khem Raj <raj.khem@gmail.com>
+Date: 2011-03-03
+Description:
+This patch fixes build issue found when compiling rpm-native on ubuntu
+11.04-alpha. Problem is that linker does not get correct set of dependent
+libraries when linking mtree binary which results in undefined symbols
+in librpmio.so. This patch adds correct flags to mtree_LDADD to account
+for rpmio deps
+
+Index: rpm-5.4.14/tools/Makefile.am
+===================================================================
+--- rpm-5.4.14.orig/tools/Makefile.am
++++ rpm-5.4.14/tools/Makefile.am
+@@ -186,7 +186,7 @@ grep_LDADD = $(RPMIO_LDADD_COMMON)
+
+ mtree_SOURCES = rpmmtree.c
+ mtree_LDFLAGS = @LDFLAGS_STATIC@ $(LDFLAGS)
+-mtree_LDADD = $(RPM_LDADD_COMMON)
++mtree_LDADD = $(RPMIO_LDADD_COMMON)
+
+ rpmrepo_SOURCES = rpmrepo.c
+ rpmrepo_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/scripts -I$(top_builddir)/scripts $(CPPFLAGS)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-uuid-include.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-uuid-include.patch
new file mode 100644
index 000000000..713f84ee2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-uuid-include.patch
@@ -0,0 +1,40 @@
+A patch to fix a problem when compiling with uuid.
+
+When attempting to build with uuid and all tests compiling will error because
+uuid.h doesn't exist in the rpm tarball. Fix this by changing the include to
+use the one in ossp which solves the issue.
+
+The recipe already depends on ossp so ossp/uuid.h will be there when rpm-native
+is built.
+
+Upstream-Status: Pending
+
+Signed-off-by: Morgan Little <morgan.little@windriver.com>
+
+
+Index: rpm-5.4.14/lua/local/luuid.c
+===================================================================
+--- rpm-5.4.14.orig/lua/local/luuid.c
++++ rpm-5.4.14/lua/local/luuid.c
+@@ -21,7 +21,7 @@
+
+ #ifdef LUA_USE_UUID
+
+-#include "uuid.h"
++#include <ossp/uuid.h>
+
+ /* Lua method: <uuid> = uuid.generate(<version>[, <uuid-namespace>, <data>]) */
+ static int luuid_generate(lua_State *L)
+Index: rpm-5.4.14/rpmio/rpmuuid.c
+===================================================================
+--- rpm-5.4.14.orig/rpmio/rpmuuid.c
++++ rpm-5.4.14/rpmio/rpmuuid.c
+@@ -16,7 +16,7 @@
+ #include "rpmlog.h"
+ #include "rpmuuid.h"
+ #ifdef WITH_UUID
+-#include "uuid.h"
++#include <ossp/uuid.h>
+ #endif
+ #include "debug.h"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm2cpio b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm2cpio
new file mode 100755
index 000000000..6bcef6a4c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm2cpio
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# Prevent gawk >= 4.0.x from getting funny ideas wrt UTF in printf()
+LANG=C
+
+pkg=$1
+if [ "$pkg" = "" -o ! -e "$pkg" ]; then
+ echo "no package supplied" 1>&2
+ exit 1
+fi
+
+leadsize=96
+o=`expr $leadsize + 8`
+set `od -j $o -N 8 -t u1 $pkg`
+il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`
+dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`
+# echo "sig il: $il dl: $dl"
+
+sigsize=`expr 8 + 16 \* $il + $dl`
+o=`expr $o + $sigsize + \( 8 - \( $sigsize \% 8 \) \) \% 8 + 8`
+set `od -j $o -N 8 -t u1 $pkg`
+il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`
+dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`
+# echo "hdr il: $il dl: $dl"
+
+hdrsize=`expr 8 + 16 \* $il + $dl`
+o=`expr $o + $hdrsize`
+comp=`dd if=$pkg ibs=$o skip=1 count=1 2>/dev/null | dd bs=3 count=1 2> /dev/null`
+
+gz="`echo . | awk '{ printf("%c%c", 0x1f, 0x8b); }'`"
+lzma="`echo . | awk '{ printf("%cLZ", 0xff); }'`"
+xz="`echo . | awk '{ printf("%c7z", 0xfd); }'`"
+case "$comp" in
+ BZh) dd if="$pkg" ibs=$o skip=1 2>/dev/null | bunzip2 ;;
+ "$gz"*) dd if="$pkg" ibs=$o skip=1 2>/dev/null | gunzip ;;
+ "$xz"*) dd if="$pkg" ibs=$o skip=1 2>/dev/null | xzcat ;;
+ "$lzma"*) dd if="$pkg" ibs=$o skip=1 2>/dev/null | unlzma ;;
+ *) echo "Unrecognized rpm file: $pkg"; exit 1 ;;
+esac
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmatch.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmatch.patch
new file mode 100644
index 000000000..9bbf580e4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmatch.patch
@@ -0,0 +1,34 @@
+Create a compatable macro if rpmatch() is not provided by the C library.
+
+This uses an existing configure check.
+
+This is needed for uclibc since it does not have the above function
+implemented.
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Updated to rpm 5.4.15+.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm/system.h
+===================================================================
+--- rpm.orig/system.h
++++ rpm/system.h
+@@ -358,6 +358,14 @@ extern int _tolower(int) __THROW /*@*/;
+ #include <libgen.h>
+ #endif
+
++#ifndef HAVE_RPMATCH
++#define rpmatch(line) \
++ ( (line == NULL)? -1 : \
++ (*line == 'y' || *line == 'Y')? 1 : \
++ (*line == 'n' || *line == 'N')? 0 : \
++ -1 )
++#endif
++
+ /* -- Retrofit glibc __progname */
+ #if defined __GLIBC__ && __GLIBC__ >= 2
+ #if __GLIBC_MINOR__ >= 1
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmdb-more-verbose-error-logging-in-rpmTempFile.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmdb-more-verbose-error-logging-in-rpmTempFile.patch
new file mode 100644
index 000000000..809e54e9c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmdb-more-verbose-error-logging-in-rpmTempFile.patch
@@ -0,0 +1,53 @@
+rpmdb: more verbose error logging in rpmTempFile()
+
+Upstream-Status: Inappropriate [debugging]
+
+Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
+
+diff --git a/rpmdb/signature.c b/rpmdb/signature.c
+index dce6c4e..a1d0f06 100644
+--- a/rpmdb/signature.c
++++ b/rpmdb/signature.c
+@@ -37,6 +37,7 @@ int rpmTempFile(const char * prefix, const char ** fnptr, void * fdptr)
+ int temput;
+ FD_t fd = NULL;
+ unsigned int ran;
++ int ret = 0;
+
+ if (!prefix) prefix = "";
+
+@@ -44,8 +45,11 @@ int rpmTempFile(const char * prefix, const char ** fnptr, void * fdptr)
+ if (!_initialized) {
+ _initialized = 1;
+ tempfn = rpmGenPath(prefix, tpmacro, NULL);
+- if (rpmioMkpath(tempfn, 0755, (uid_t) -1, (gid_t) -1))
+- goto errxit;
++ ret = rpmioMkpath(tempfn, 0755, (uid_t) -1, (gid_t) -1);
++ if (ret) {
++ rpmlog(RPMLOG_ERR, _("error creating temporary directory %s: %d\n"), tempfn, ret);
++ goto errxit;
++ }
+ }
+
+ /* XXX should probably use mkstemp here */
+@@ -68,12 +72,16 @@ int rpmTempFile(const char * prefix, const char ** fnptr, void * fdptr)
+ #endif
+
+ temput = urlPath(tempfn, &tfn);
+- if (*tfn == '\0') goto errxit;
++ if (*tfn == '\0') {
++ rpmlog(RPMLOG_ERR, _("error creating tempfile: empty filename\n"));
++ goto errxit;
++ }
+
+ switch (temput) {
+ case URL_IS_DASH:
+ case URL_IS_HKP:
+ case URL_IS_MONGO: /* XXX FIXME */
++ rpmlog(RPMLOG_ERR, _("error creating temporary file, invalid uri type: %d\n"), temput);
+ goto errxit;
+ /*@notreached@*/ /*@switchbreak@*/ break;
+ case URL_IS_HTTPS:
+--
+2.6.6
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmdeps-oecore.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmdeps-oecore.patch
new file mode 100644
index 000000000..9bdd1d490
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmdeps-oecore.patch
@@ -0,0 +1,194 @@
+Add an "rpmdeps-oecore" binary which allows batch processing of individual file
+dependencies in a similar manner to rpmdeps --provides --requires -v, prefixing
+each line of output with the filename that has the dependency.
+
+This is much faster than individually calling rpmdeps on each file.
+
+This binary is used by package.bbclass.
+
+Upstream-Status: Inappropriate [OE Specific]
+
+RP 2012/2/7
+
+---
+ tools/Makefile.am | 6 ++-
+ tools/rpmdeps-oecore.c | 147 ++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 152 insertions(+), 1 deletions(-)
+ create mode 100644 tools/rpmdeps-oecore.c
+
+Index: rpm-5.4.14/tools/Makefile.am
+===================================================================
+--- rpm-5.4.14.orig/tools/Makefile.am
++++ rpm-5.4.14/tools/Makefile.am
+@@ -62,7 +62,7 @@ pkgbin_PROGRAMS = \
+ @WITH_AUGEAS_AUGTOOL@ chroot cp @WITH_CUDF_CUDFTOOL@ find mtree \
+ @WITH_SEMANAGE_SEMODULE@ wget \
+ rpmcache rpmdigest rpmrepo rpmspecdump \
+- rpmcmp rpmdeps sqlite3 @WITH_KEYUTILS_RPMKEY@ @WITH_LIBELF_DEBUGEDIT@
++ rpmcmp rpmdeps rpmdeps-oecore sqlite3 @WITH_KEYUTILS_RPMKEY@ @WITH_LIBELF_DEBUGEDIT@
+ if WITH_DB
+ pkgbin_PROGRAMS += dbconvert
+ endif
+@@ -172,6 +172,10 @@ rpmdeps_SOURCES = rpmdeps.c
+ rpmdeps_LDFLAGS = @LDFLAGS_STATIC@ $(LDFLAGS)
+ rpmdeps_LDADD = $(RPM_LDADD_COMMON)
+
++rpmdeps_oecore_SOURCES = rpmdeps-oecore.c
++rpmdeps_oecore_LDFLAGS = @LDFLAGS_STATIC@ $(LDFLAGS)
++rpmdeps_oecore_LDADD = $(RPM_LDADD_COMMON)
++
+ rpmdigest_SOURCES = rpmdigest.c
+ rpmdigest_LDFLAGS = @LDFLAGS_STATIC@ $(LDFLAGS)
+ rpmdigest_LDADD = $(RPMIO_LDADD_COMMON)
+Index: rpm-5.4.14/tools/rpmdeps-oecore.c
+===================================================================
+--- /dev/null
++++ rpm-5.4.14/tools/rpmdeps-oecore.c
+@@ -0,0 +1,147 @@
++#include "system.h"
++const char *__progname;
++
++#include <rpmio.h>
++#include <rpmiotypes.h>
++#include <rpmcb.h>
++#include <argv.h>
++#include <rpmtypes.h>
++#include <rpmtag.h>
++
++#include <rpmds.h>
++#define _RPMFC_INTERNAL /* XXX for debugging */
++#include <rpmfc.h>
++
++#include <rpmcli.h>
++
++#include "debug.h"
++
++/*@unchecked@*/
++char *progname;
++
++#define RPMDEP_RPMFC 1
++
++static int rpmdepPrint(char *filename, rpmds ds, FILE * fp)
++{
++ if (fp == NULL) fp = stderr;
++
++ ds = rpmdsInit(ds);
++ while (rpmdsNext(ds) >= 0) {
++ fprintf(fp, "%s %s: %s\n", filename, rpmdsType(ds), rpmdsDNEVR(ds)+2);
++ }
++ return 0;
++}
++
++static struct poptOption optionsTable[] = {
++
++ { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmcliAllPoptTable, 0,
++ N_("Common options:"),
++ NULL },
++
++ POPT_AUTOALIAS
++ POPT_AUTOHELP
++ POPT_TABLEEND
++};
++
++
++int
++main(int argc, char *argv[])
++{
++ poptContext optCon;
++ ARGV_t av = NULL;
++ rpmfc fc = NULL;
++ FILE * fp = NULL;
++ int flags = 0;
++ int ac = 0;
++ int ec = 1;
++ int xx;
++ int i;
++ char buf[BUFSIZ];
++ int nddict;
++ const char * s;
++ char * se;
++ const char * fn;
++ const char * N;
++ const char * EVR;
++ evrFlags Flags;
++ unsigned char deptype;
++ int ix;
++ rpmds ds;
++
++/*@-modobserver@*/
++ if ((progname = strrchr(argv[0], '/')) != NULL)
++ progname++;
++ else
++ progname = argv[0];
++/*@=modobserver@*/
++
++ optCon = rpmcliInit(argc, argv, optionsTable);
++ if (optCon == NULL)
++ goto exit;
++
++ av = poptGetArgs(optCon);
++ ac = argvCount(av);
++
++ if (ac == 0) {
++ av = NULL;
++ xx = argvFgets(&av, NULL);
++ ac = argvCount(av);
++ }
++
++ /* Make sure file names are sorted. */
++ xx = argvSort(av, NULL);
++
++ /* Build file class dictionary. */
++ fc = rpmfcNew();
++ xx = rpmfcClassify(fc, av, NULL);
++
++ /* Build file/package dependency dictionary. */
++ xx = rpmfcApply(fc);
++
++ /* Generate per-file indices into package dependencies. */
++ nddict = argvCount(fc->ddict);
++
++ for (i = 0; i < nddict; i++) {
++ s = fc->ddict[i];
++
++ /* Parse out (file#,deptype,N,EVR,Flags) */
++ ix = strtol(s, &se, 10);
++ assert(se != NULL);
++ deptype = *se++;
++ se++;
++ N = se;
++ while (*se && *se != ' ')
++ se++;
++ *se++ = '\0';
++ EVR = se;
++ while (*se && *se != ' ')
++ se++;
++ *se++ = '\0';
++ Flags = strtol(se, NULL, 16);
++
++ switch (deptype) {
++ default:
++ /*@switchbreak@*/ break;
++ case 'P':
++ ds = rpmdsSingle(RPMTAG_PROVIDENAME, N, EVR, Flags);
++ rpmdepPrint((char *)fc->fn[ix], ds, stdout);
++ (void)rpmdsFree(ds);
++ ds = NULL;
++ /*@switchbreak@*/ break;
++ case 'R':
++ ds = rpmdsSingle(RPMTAG_REQUIRENAME, N, EVR, Flags);
++ rpmdepPrint((char *)fc->fn[ix], ds, stdout);
++ (void)rpmdsFree(ds);
++ ds = NULL;
++ /*@switchbreak@*/ break;
++ }
++ }
++
++ fc = rpmfcFree(fc);
++
++ ec = 0;
++
++exit:
++ optCon = rpmcliFini(optCon);
++ return ec;
++}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmqv.c-check-_gpg_passphrase-before-ask-for-input.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmqv.c-check-_gpg_passphrase-before-ask-for-input.patch
new file mode 100644
index 000000000..c68681c1e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmqv.c-check-_gpg_passphrase-before-ask-for-input.patch
@@ -0,0 +1,70 @@
+From bb48dbc88a58bc05a43d71a3375fb05358119ec5 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Sun, 20 Mar 2016 20:20:16 -0700
+Subject: [PATCH] rpmqv.c: check _gpg_passphrase before ask for input
+
+rpm always asked for pass phrasae when add signature, which made it
+can't work non-interactively, this patch fix the problem. It will work
+non-interactively if _gpg_passphrase is defined, and work as before if
+not.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ macros/macros.in | 7 +++++--
+ rpmqv.c | 17 ++++++++++-------
+ 2 files changed, 15 insertions(+), 9 deletions(-)
+
+diff --git a/macros/macros.in b/macros/macros.in
+index 2e5b07d..01b3aad 100644
+--- a/macros/macros.in
++++ b/macros/macros.in
+@@ -520,15 +520,18 @@ $_arbitrary_tags_tests Foo:Bar
+ # Macro(s) to hold the arguments passed to GPG/PGP for package
+ # signing and verification.
+ #
++
++%_gpg_passphrase_way %{?_gpg_passphrase:--passphrase "%{_gpg_passphrase}"}%{!?_gpg_passphrase:--passphrase-fd 3}
++
+ %__gpg_check_password_cmd %{__gpg} \
+- gpg --batch --no-verbose --passphrase-fd 3 -u "%{_gpg_name}" -so -
++ gpg --batch --no-verbose %{_gpg_passphrase_way} -u "%{_gpg_name}" -so -
+ #%__pgp_check_password_cmd %{__pgp} \
+ # pgp +batchmode=on +verbose=0 "%{_pgp_name}" -sf
+ #%__pgp5_check_password_cmd %{__pgp} \
+ # pgps +batchmode=on +verbose=0 +armor=off "%{_pgp_name}" -f
+
+ %__gpg_sign_cmd %{__gpg} \
+- gpg --batch --no-verbose --no-armor --passphrase-fd 3 --no-secmem-warning \
++ gpg --batch --no-verbose --no-armor %{_gpg_passphrase_way} --no-secmem-warning \
+ -u "%{_gpg_name}" -sbo %{__signature_filename} %{__plaintext_filename}
+ #%__pgp_sign_cmd %{__pgp} \
+ # pgp +batchmode=on +verbose=0 +armor=off \
+diff --git a/rpmqv.c b/rpmqv.c
+index b306486..7604396 100644
+--- a/rpmqv.c
++++ b/rpmqv.c
+@@ -831,13 +831,16 @@ int main(int argc, const char ** argv)
+ #endif
+ )
+ {
+- passPhrase = Getpass(_("Enter pass phrase: "));
+- if (rpmCheckPassPhrase(passPhrase)) {
+- fprintf(stderr, _("Pass phrase check failed\n"));
+- ec = EXIT_FAILURE;
+- goto exit;
++ passPhrase = rpmExpand("%{?_gpg_passphrase}", NULL);
++ if (passPhrase == NULL || passPhrase[0] == '\0') {
++ passPhrase = Getpass(_("Enter pass phrase: "));
++ if (rpmCheckPassPhrase(passPhrase)) {
++ fprintf(stderr, _("Pass phrase check failed\n"));
++ ec = EXIT_FAILURE;
++ goto exit;
++ }
++ fprintf(stderr, _("Pass phrase is good.\n"));
+ }
+- fprintf(stderr, _("Pass phrase is good.\n"));
+ /* XXX Getpass() should realloc instead. */
+ passPhrase = xstrdup(passPhrase);
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmqv_cc_b_gone.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmqv_cc_b_gone.patch
new file mode 100644
index 000000000..b2437a872
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmqv_cc_b_gone.patch
@@ -0,0 +1,50 @@
+From e8bae261615e19ff8a28683765c9539cfb22a086 Mon Sep 17 00:00:00 2001
+From: Joe Slater <jslater@windriver.com>
+Date: Thu, 17 Jul 2014 18:14:54 -0700
+Subject: [PATCH 1/9] rpm: compile rpmqv.c instead of rpmqv.cc
+
+Some versions of gcc, 4.4.5 for example, will put a reference to __gxx_personality_v0
+into rpm.o and rpmbuild.o. This means we must link with g++, and the Makefile we
+generate does not.
+
+So, go back to using rpmqv.c (which is currently identical to rpmqv.cc).
+
+Upstream-Status: Inappropriate [other]
+
+ When linking with g++ is really necessary, the upstream package will do that.
+
+Also instead of symlinking files in two places, which can and does race in
+parallel builds, simply refer to the file's full location [RB]
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+---
+ Makefile.am | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 1dade0a..55f8669 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -201,15 +201,13 @@ rpm_SOURCES = build.c
+ rpm_LDFLAGS = @LDFLAGS_STATIC@ $(LDFLAGS)
+ rpm_LDADD = rpm.o $(myLDADD)
+ rpm.o: $(top_srcdir)/rpmqv.c
+- ln -sf $< rpmqv.cc
+- $(COMPILE) -DIAM_RPMBT -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV -o $@ -c rpmqv.cc
++ $(COMPILE) -DIAM_RPMBT -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV -o $@ -c $^
+
+ rpmbuild_SOURCES = build.c
+ rpmbuild_LDFLAGS = @LDFLAGS_STATIC@ $(LDFLAGS)
+ rpmbuild_LDADD = rpmbuild.o $(myLDADD)
+ rpmbuild.o: $(top_srcdir)/rpmqv.c
+- ln -sf $< rpmqv.cc
+- $(COMPILE) -DIAM_RPMBT -o $@ -c rpmqv.cc
++ $(COMPILE) -DIAM_RPMBT -o $@ -c $^
+
+ .syntastic_c_config: Makefile
+ @echo $(COMPILE) | tr ' ' '\n' | sed -e '1d' > $@
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/uclibc-support.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/uclibc-support.patch
new file mode 100644
index 000000000..dc7b0488a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/uclibc-support.patch
@@ -0,0 +1,63 @@
+Define the x* wrappers for uclibc as well
+
+Upstream-Status: Submitted [RPM5 maintainer]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: rpm/rpmio/rpmio.h
+===================================================================
+--- rpm.orig/rpmio/rpmio.h
++++ rpm/rpmio/rpmio.h
+@@ -23,7 +23,8 @@
+ */
+ /*@{*/
+ #if !defined(__LCLINT__) && !defined(__UCLIBC__) && defined(__GLIBC__) && \
+- (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2))
++ (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) && \
++ !defined(__UCLIBC__)
+ #define USE_COOKIE_SEEK_POINTER 1
+ typedef _IO_off64_t _libio_off_t;
+ typedef _libio_off_t * _libio_pos_t;
+Index: rpm/system.h
+===================================================================
+--- rpm.orig/system.h
++++ rpm/system.h
+@@ -489,7 +489,7 @@ extern void muntrace (void)
+ #endif /* defined(__LCLINT__) */
+
+ /* Memory allocation via macro defs to get meaningful locations from mtrace() */
+-#if defined(__GNUC__)
++#if defined(__GNUC__) || defined(__UCLIBC__)
+ #define xmalloc(_size) (malloc(_size) ? : vmefail(_size))
+ #define xcalloc(_nmemb, _size) (calloc((_nmemb), (_size)) ? : vmefail(_size))
+ #define xrealloc(_ptr, _size) (realloc((_ptr), (_size)) ? : vmefail(_size))
+Index: rpm/lib/librpm.vers
+===================================================================
+--- rpm.orig/lib/librpm.vers
++++ rpm/lib/librpm.vers
+@@ -406,6 +406,10 @@ LIBRPM_0
+ specedit;
+ strict_erasures;
+ XrpmtsiInit;
++ xmalloc;
++ xrealloc;
++ xcalloc;
++ xstrdup;
+ local:
+ *;
+ };
+Index: rpm/rpmio/librpmio.vers
+===================================================================
+--- rpm.orig/rpmio/librpmio.vers
++++ rpm/rpmio/librpmio.vers
+@@ -1455,6 +1455,10 @@ LIBRPMIO_0
+ _mongoc_write_result_init;
+ _mongoc_write_result_merge;
+ _mongoc_write_result_merge_legacy;
++ xmalloc;
++ xrealloc;
++ xcalloc;
++ xstrdup;
+ local:
+ *;
+ };
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm_5.4+cvs.bb b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm_5.4+cvs.bb
new file mode 100644
index 000000000..0991f6d52
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm_5.4+cvs.bb
@@ -0,0 +1,730 @@
+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}-libs = "Libraries for manipulating RPM packages"
+DESCRIPTION_${PN}-libs = "This package contains the RPM shared libraries."
+
+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_${PN}-common = "Common RPM paths, scripts, documentation and configuration"
+DESCRIPTION_${PN}-common = "The rpm-common package contains paths, scripts, documentation \
+and configuration common between RPM Package Manager."
+
+SUMMARY_${PN}-build = "Scripts and executable programs used to build packages"
+DESCRIPTION_${PN}-build = "The rpm-build packagec ontains the scripts and executable programs \
+that are used to build packages using the RPM Package Manager."
+
+SUMMARY_python-rpm = "Python bindings for apps which will manupulate RPM packages"
+DESCRIPTION_python-rpm = "The rpm-python package contains a module that permits applications \
+written in the Python programming language to use the interface \
+supplied by the RPM Package Manager libraries."
+
+SUMMARY_perl-module-rpm = "Perl bindings for apps which will manipulate RPM packages"
+DESCRIPTION_perl-modules-rpm = "The perl-modules-rpm package contains a module that permits applications \
+written in the Perl programming language to use the interface \
+supplied by the RPM Package Manager libraries."
+
+HOMEPAGE = "http://rpm5.org/"
+LICENSE = "LGPLv2.1 & Apache-2.0"
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1"
+LIC_FILES_CHKSUM += "file://rpmio/mongo.c;begin=5;end=18;md5=d8327ba2c71664c059143e6d333b8901"
+
+# We must have gettext-native, we need gettextize, which may not be provided
+DEPENDS = "libpcre attr acl ossp-uuid file byacc-native gettext-native"
+DEPENDS_append_class-native = " file-replacement-native"
+
+# Apply various fixups that are unique to the CVS environment
+do_fixup_unpack () {
+ # 'ln' isn't reliable, and 'mv' could break later builds
+ rm -rf ${S}/syck ; cp -r ${WORKDIR}/syck ${S}/.
+ rm -rf ${S}/lua ; cp -r ${WORKDIR}/lua ${S}/.
+ rm -rf ${S}/popt ; cp -r ${WORKDIR}/popt ${S}/.
+ rm -rf ${S}/beecrypt ; cp -r ${WORKDIR}/beecrypt ${S}/.
+}
+
+addtask fixup_unpack after do_unpack before do_patch
+
+# This recipe is really designed for development... to Try out the latest
+# community work in progress.
+DEFAULT_PREFERENCE = "-1"
+
+S = "${WORKDIR}/rpm"
+
+# rpm2cpio is a shell script, which is part of the rpm src.rpm. It is needed
+# in order to extract the distribution SRPM into a format we can extract...
+SRC_URI = "cvs://anonymous@rpm5.org/cvs;tag=rpm-5_4;module=rpm \
+ cvs://anonymous@rpm5.org/cvs;tag=rpm-5_4;module=syck \
+ cvs://anonymous@rpm5.org/cvs;tag=rpm-5_4;module=lua \
+ cvs://anonymous@rpm5.org/cvs;tag=rpm-5_4;module=popt \
+ cvs://anonymous@rpm5.org/cvs;tag=rpm-5_4;module=beecrypt \
+ file://perfile_rpmdeps.sh \
+ file://pythondeps.sh \
+"
+
+# Bug fixes
+SRC_URI += " \
+ file://header-include-fix.patch \
+ file://rpm-libsql-fix.patch \
+ file://rpm-platform.patch \
+ file://rpm-platform2.patch \
+ file://rpm-tools-mtree-LDFLAGS.patch \
+ file://rpm-canonarch.patch \
+ file://rpm-no-loopmsg.patch \
+ file://rpm-resolvedep.patch \
+ file://rpm-packageorigin.patch \
+ file://uclibc-support.patch \
+ file://rpmatch.patch \
+ file://makefile-am-exec-hook.patch \
+ file://python-rpm-rpmsense.patch \
+ file://debugedit-segv.patch \
+ file://debugedit-valid-file-to-fix-segment-fault.patch \
+ file://rpm-platform-file-fix.patch \
+ file://rpm-lsb-compatibility.patch \
+ file://rpm-tag-generate-endian-conversion-fix.patch \
+ file://rpm-hardlink-segfault-fix.patch \
+ file://rpm-payload-use-hashed-inode.patch \
+ file://rpm-fix-logio-cp.patch \
+ file://0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch \
+ file://rpm-opendb-before-verifyscript-to-avoid-null-point.patch \
+ file://0001-define-EM_AARCH64.patch \
+ file://rpm-rpmfc.c-fix-for-N32-MIPS64.patch \
+ file://rpm-lib-transaction.c-fix-file-conflicts-for-mips64-N32.patch \
+ file://rpm-mongodb-sasl.patch \
+ file://rpm-fix-parseEmbedded.patch \
+ file://rpm-rpmio-headers.patch \
+ file://rpm-python-restore-origin.patch \
+ file://rpm-keccak-sse-intrin.patch \
+ file://rpm-atomic-ops.patch \
+ file://rpm-gnu-atomic.patch \
+ file://rpm-tagname-type.patch \
+ file://rpm-python-tagname.patch \
+ file://rpm-python-AddErase.patch \
+ file://rpm-rpmpgp-popt.patch \
+ file://0001-Disable-__sync_add_and_fetch_8-on-nios2.patch \
+"
+
+# OE specific changes
+SRC_URI += " \
+ file://rpm-log-auto-rm.patch \
+ file://rpm-db-reduce.patch \
+ file://rpm-autogen.patch \
+ file://rpm-showrc.patch \
+ file://rpm-fileclass.patch \
+ file://rpm-scriptletexechelper.patch \
+ file://rpmdeps-oecore.patch \
+ file://rpm-no-perl-urpm.patch \
+ file://rpm-macros.patch \
+ file://rpm-lua.patch \
+ file://rpm-ossp-uuid.patch \
+ file://rpm-uuid-include.patch \
+ file://rpm-pkgconfigdeps.patch \
+ file://no-ldflags-in-pkgconfig.patch \
+ file://dbconvert.patch \
+ file://rpm-db_buffer_small.patch \
+ file://rpm-py-init.patch \
+ file://rpm-reloc-macros.patch \
+ file://rpm-db5-or-db6.patch \
+ file://rpm-db60.patch \
+ file://rpmqv_cc_b_gone.patch \
+ file://rpm-realpath.patch \
+ file://rpm-check-rootpath-reasonableness.patch \
+ file://rpm-macros.in-disable-external-key-server.patch \
+ file://configure.ac-check-for-both-gpg2-and-gpg.patch \
+ file://rpm-disable-auto-stack-protector.patch \
+ file://popt-disable-auto-stack-protector.patch \
+ file://rpm-syck-fix-gram.patch \
+ file://rpm-rpmdb-grammar.patch \
+ file://rpm-disable-blaketest.patch \
+ file://rpm-autogen-force.patch \
+"
+
+SRC_URI_append_libc-musl = "\
+ file://0001-rpm-Fix-build-on-musl.patch \
+"
+# Uncomment the following line to enable platform score debugging
+# This is useful when identifying issues with Smart being unable
+# to process certain package feeds.
+#SRC_URI += "file://rpm-debug-platform.patch"
+
+inherit autotools gettext
+
+acpaths = "-I ${S}/db/dist/aclocal -I ${S}/db/dist/aclocal_java"
+
+# The local distribution macro directory
+distromacrodir = "${libdir}/rpm/poky"
+
+# Specify the default rpm macros in terms of adjustable variables
+rpm_macros = "%{_usrlibrpm}/macros:%{_usrlibrpm}/${DISTRO}/macros:%{_usrlibrpm}/${DISTRO}/%{_target}/macros:%{_etcrpm}/macros.*:%{_etcrpm}/macros:%{_etcrpm}/%{_target}/macros:~/.oerpmmacros"
+rpm_macros_class-native = "%{_usrlibrpm}/macros:%{_usrlibrpm}/${DISTRO}/macros:%{_usrlibrpm}/${DISTRO}/%{_target}/macros:~/.oerpmmacros"
+rpm_macros_class-nativesdk = "%{_usrlibrpm}/macros:%{_usrlibrpm}/${DISTRO}/macros:%{_usrlibrpm}/${DISTRO}/%{_target}/macros:~/.oerpmmacros"
+
+# sqlite lua tcl augeas nss gcrypt neon xz xar keyutils perl selinux
+
+# Set the digest algorithm used for verifying file integrity
+# If this value changes, and two different packages have different values
+# the "same file" validation (two packages have a non-conflict file)
+# will fail. This may lead to upgrade problems. You should treat this
+# value as a distribution wide setting, and only change it when you intend
+# a full system upgrade!
+#
+# Defined file digest algorithm values (note: not all are available!):
+# 1 MD5 (legacy RPM default)
+# 2 SHA1
+# 3 RIPEMD-160
+# 5 MD2
+# 6 TIGER-192
+# 8 SHA256
+# 9 SHA384
+# 10 SHA512
+# 11 SHA224
+# 104 MD4
+# 105 RIPEMD-128
+# 106 CRC-32
+# 107 ADLER-32
+# 108 CRC-64 (ECMA-182 polynomial, untested uint64_t problems)
+# 109 Jenkins lookup3.c hashlittle()
+# 111 RIPEMD-256
+# 112 RIPEMD-320
+# 188 BLAKE2B
+# 189 BLAKE2BP
+# 190 BLAKE2S
+# 191 BLAKE2SP
+RPM_FILE_DIGEST_ALGO ?= "1"
+
+# All packages build with RPM5 contain a non-repudiable signature.
+# The purpose of this signature is not to show authenticity of a package,
+# but instead act as a secondary package wide validation that shows it
+# wasn't damaged by accident in transport. (When later you sign the package,
+# this signature may or may not be replaced as there are three signature
+# slots, one for DSA/RSA, one for ECSDA, and one reserved.)
+#
+# There is a known issue w/ RSA signatures that if they start with an 0x00
+# the signing and validation may fail.
+#
+# The following is the list of choices for the non-rpudiable signature
+# (note: not all of these are implemented):
+# DSA (default)
+# RSA (implies SHA1)
+# ECDSA (implies SHA256)
+# DSA/SHA1
+# DSA/SHA224
+# DSA/SHA256
+# DSA/SHA384
+# DSA/SHA512
+# RSA/SHA1
+# RSA/SHA224
+# RSA/SHA256
+# RSA/SHA384
+# RSA/SHA512
+# ECDSA/SHA224 (using NIST P-224)
+# ECDSA/SHA256 (using NIST P-256)
+# ECDSA/SHA384 (using NIST P-384)
+# ECDSA/SHA512 (using NIST P-521)
+RPM_SELF_SIGN_ALGO ?= "DSA"
+
+# Note: perl and sqlite w/o db specified does not currently work.
+# tcl, augeas, nss, gcrypt, xar and keyutils support is untested.
+PACKAGECONFIG ??= "db bzip2 zlib popt openssl libelf python"
+
+# Note: switching to internal popt may not work, as it will generate
+# a shared library which will intentionally not be packaged.
+#
+# If you intend to use the internal version, additional work may be required.
+PACKAGECONFIG[popt] = "--with-popt=external,--with-popt=internal,popt,"
+
+PACKAGECONFIG[bzip2] = "--with-bzip2,--without-bzip2,bzip2,"
+PACKAGECONFIG[xz] = "--with-xz,--without-xz,xz,"
+PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib,"
+PACKAGECONFIG[xar] = "--with-xar,--without-xar,xar,"
+
+WITH_PYTHON = " --with-python=${PYTHON_BASEVERSION} \
+ --with-python-inc-dir=${STAGING_INCDIR}/python${PYTHON_BASEVERSION} \
+ --with-python-lib-dir=${libdir}/python${PYTHON_BASEVERSION}/site-packages \
+ --without-pythonembed"
+PACKAGECONFIG[python] = "${WITH_PYTHON},--without-python,python,"
+
+# Perl modules are not built, but they could be enabled fairly easily
+# the perl module creation and installation would need to be patched.
+# (currently has host perl contamination issues)
+WITH_PERL = "--with-perl --without-perlembed --without-perl-urpm"
+WITHOUT_PERL = "--without-perl --without-perl-urpm"
+PACKAGECONFIG[perl] = "${WITH_PERL},${WITHOUT_PERL},perl,"
+
+# The --with-dbsql will only tell RPM to check for support, db
+# may or may not be built w/ the dbsql support.
+WITH_DB = "--with-db --with-dbsql --without-db-tools-integrated"
+PACKAGECONFIG[db] = "${WITH_DB},--without-db,db,"
+
+PACKAGECONFIG[sqlite] = "--with-sqlite,--without-sqlite,sqlite3,"
+
+# This switch simply disables external beecrypt, RPM5 always uses beecrypt
+# for base64 processing and various digest algorithms.
+# Beecrypt is only the preferred crypto engine if it's the only engine enabled.
+PACKAGECONFIG[beecrypt] = "--with-beecrypt=external,--with-beecrypt=internal,beecrypt,"
+
+# --with-usecrypto= setting defined the item as the preferred system
+# crypto engine, which will take priority over the included beecrypt
+PACKAGECONFIG[openssl] = "--with-openssl --with-usecrypto=openssl,--without-openssl,openssl,"
+PACKAGECONFIG[nss] = "--with-nss --with-usecrypto=nss,--without-nss,nss,"
+PACKAGECONFIG[gcrypt] = "--with-gcrypt --with-usecrypto=gcrypt,--without-gcrypt,gcrypt,"
+
+PACKAGECONFIG[keyutils] = "--with-keyutils,--without-keyutils,keyutils,"
+PACKAGECONFIG[libelf] = "--with-libelf,--without-libelf,elfutils,"
+
+WITH_SELINUX = "--with-selinux --with-sepol --with-semanage"
+WITHOUT_SELINUX = "--without-selinux --without-sepol --without-semanage"
+PACKAGECONFIG[selinux] = "${WITH_SELINUX},${WITHOUT_SELINUX},libselinux,"
+
+WITH_NEON = "--with-neon --with-libproxy --with-expat --without-gssapi"
+WITHOUT_NEON = "--without-neon --without-libproxy --without-expat --without-gssapi"
+PACKAGECONFIG[neon] = "${WITH_NEON},${WITHOUT_NEON},neon expat,"
+
+PACKAGECONFIG[lua] = "--with-lua,--without-lua,expat,"
+PACKAGECONFIG[tcl] = "--with-tcl,--without-tcl,tcl,"
+
+PACKAGECONFIG[augeas] = "--with-augeas,--without-augeas,augeas,"
+
+EXTRA_OECONF += "--verbose \
+ --sysconfdir=${sysconfdir} \
+ --with-file \
+ --with-path-magic=%{_usrlibrpm}/../../share/misc/magic.mgc \
+ --with-syck=internal \
+ --without-readline \
+ --without-libtasn1 \
+ --without-pakchois \
+ --without-gnutls \
+ --with-pcre \
+ --enable-utf8 \
+ --with-uuid \
+ --with-attr \
+ --with-acl \
+ --with-pthreads \
+ --without-cudf \
+ --without-ficl \
+ --without-aterm \
+ --without-nix \
+ --without-bash \
+ --without-rc \
+ --without-js \
+ --without-gpsee \
+ --without-ruby \
+ --without-squirrel \
+ --without-sasl2 \
+ --with-build-extlibdep \
+ --with-build-maxextlibdep \
+ --without-valgrind \
+ --disable-openmp \
+ --enable-build-pic \
+ --enable-build-versionscript \
+ --enable-build-warnings \
+ --enable-build-debug \
+ --enable-maintainer-mode \
+ --with-path-macros=${rpm_macros} \
+ --with-path-lib=${libdir}/rpm \
+ --with-bugreport=http://bugzilla.yoctoproject.org \
+ --program-prefix= \
+ YACC=byacc"
+
+CFLAGS_append = " -DRPM_VENDOR_WINDRIVER -DRPM_VENDOR_POKY -DRPM_VENDOR_OE"
+
+LDFLAGS_append_libc-uclibc = "-lrt -lpthread"
+
+PACKAGES = "${PN}-dbg ${PN} ${PN}-doc ${PN}-libs ${PN}-dev ${PN}-staticdev ${PN}-common ${PN}-build python-rpm perl-module-rpm ${PN}-locale"
+
+SOLIBS = "5.4.so"
+
+# Based on %files section in the rpm.spec
+
+FILES_${PN} = "${bindir}/rpm \
+ ${bindir}/rpmconstant \
+ ${libdir}/rpm/rpm.* \
+ ${libdir}/rpm/tgpg \
+ ${libdir}/rpm/macros \
+ ${libdir}/rpm/rpmpopt \
+ ${libdir}/rpm/rpm2cpio \
+ ${libdir}/rpm/vcheck \
+ ${libdir}/rpm/helpers \
+ ${libdir}/rpm/qf \
+ ${libdir}/rpm/cpuinfo.yaml \
+ ${libdir}/rpm/bin/mtree \
+ ${libdir}/rpm/bin/rpmkey \
+ ${libdir}/rpm/bin/rpmrepo \
+ ${libdir}/rpm/bin/rpmrepo.real \
+ ${libdir}/rpm/bin/rpmspecdump \
+ ${libdir}/rpm/bin/rpmspecdump.real \
+ ${libdir}/rpm/bin/wget \
+ ${localstatedir}/cache \
+ ${localstatedir}/cache/rpm \
+ ${localstatedir}/cache/wdj \
+ ${localstatedir}/lib \
+ ${localstatedir}/lib/rpm \
+ ${localstatedir}/lib/wdj \
+ ${bindir}/rpm.real \
+ ${bindir}/rpmconstant.real \
+ ${bindir}/rpm2cpio.real \
+ "
+
+FILES_${PN}-common = "${bindir}/rpm2cpio \
+ ${bindir}/gendiff \
+ ${sysconfdir}/rpm \
+ ${localstatedir}/spool/repackage \
+ "
+
+FILES_${PN}-libs = "${libdir}/librpm-*.so \
+ ${libdir}/librpmconstant-*.so \
+ ${libdir}/librpmdb-*.so \
+ ${libdir}/librpmio-*.so \
+ ${libdir}/librpmmisc-*.so \
+ ${libdir}/librpmbuild-*.so \
+ "
+
+FILES_${PN}-build = "${prefix}/src/rpm \
+ ${bindir}/rpmbuild \
+ ${bindir}/rpmbuild.real \
+ ${libdir}/rpm/brp-* \
+ ${libdir}/rpm/check-files \
+ ${libdir}/rpm/cross-build \
+ ${libdir}/rpm/find-debuginfo.sh \
+ ${libdir}/rpm/find-lang.sh \
+ ${libdir}/rpm/find-prov.pl \
+ ${libdir}/rpm/find-provides.perl \
+ ${libdir}/rpm/find-req.pl \
+ ${libdir}/rpm/find-requires.perl \
+ ${libdir}/rpm/getpo.sh \
+ ${libdir}/rpm/http.req \
+ ${libdir}/rpm/javadeps.sh \
+ ${libdir}/rpm/mono-find-provides \
+ ${libdir}/rpm/mono-find-requires \
+ ${libdir}/rpm/executabledeps.sh \
+ ${libdir}/rpm/libtooldeps.sh \
+ ${libdir}/rpm/osgideps.pl \
+ ${libdir}/rpm/perldeps.pl \
+ ${libdir}/rpm/perl.prov \
+ ${libdir}/rpm/perl.req \
+ ${libdir}/rpm/php.prov \
+ ${libdir}/rpm/php.req \
+ ${libdir}/rpm/pkgconfigdeps.sh \
+ ${libdir}/rpm/pythondeps.sh \
+ ${libdir}/rpm/bin/debugedit \
+ ${libdir}/rpm/bin/debugedit.real \
+ ${libdir}/rpm/bin/rpmcache \
+ ${libdir}/rpm/bin/rpmcache.real \
+ ${libdir}/rpm/bin/rpmcmp \
+ ${libdir}/rpm/bin/rpmcmp.real \
+ ${libdir}/rpm/bin/rpmdeps \
+ ${libdir}/rpm/bin/rpmdeps.real \
+ ${libdir}/rpm/bin/rpmdeps-oecore \
+ ${libdir}/rpm/bin/rpmdeps-oecore.real \
+ ${libdir}/rpm/bin/rpmdigest \
+ ${libdir}/rpm/bin/rpmdigest.real \
+ ${libdir}/rpm/bin/abi-compliance-checker.pl \
+ ${libdir}/rpm/bin/api-sanity-autotest.pl \
+ ${libdir}/rpm/bin/chroot \
+ ${libdir}/rpm/bin/cp \
+ ${libdir}/rpm/bin/dbsql \
+ ${libdir}/rpm/bin/find \
+ ${libdir}/rpm/bin/install-sh \
+ ${libdir}/rpm/bin/lua \
+ ${libdir}/rpm/bin/luac \
+ ${libdir}/rpm/bin/mkinstalldirs \
+ ${libdir}/rpm/bin/rpmlua \
+ ${libdir}/rpm/bin/rpmluac \
+ ${libdir}/rpm/bin/sqlite3 \
+ ${libdir}/rpm/macros.d/cmake \
+ ${libdir}/rpm/macros.d/java \
+ ${libdir}/rpm/macros.d/libtool \
+ ${libdir}/rpm/macros.d/mandriva \
+ ${libdir}/rpm/macros.d/mono \
+ ${libdir}/rpm/macros.d/perl \
+ ${libdir}/rpm/macros.d/php \
+ ${libdir}/rpm/macros.d/pkgconfig \
+ ${libdir}/rpm/macros.d/python \
+ ${libdir}/rpm/macros.d/ruby \
+ ${libdir}/rpm/macros.d/selinux \
+ ${libdir}/rpm/macros.d/tcl \
+ ${libdir}/rpm/macros.rpmbuild \
+ ${libdir}/rpm/u_pkg.sh \
+ ${libdir}/rpm/vpkg-provides.sh \
+ ${libdir}/rpm/vpkg-provides2.sh \
+ ${libdir}/rpm/perfile_rpmdeps.sh \
+ ${distromacrodir} \
+ "
+RDEPENDS_${PN} = "base-files run-postinsts"
+RDEPENDS_${PN}_class-native = ""
+RDEPENDS_${PN}_class-nativesdk = ""
+RDEPENDS_${PN}-build = "file bash perl"
+
+RDEPENDS_python-rpm = "${PN} python"
+
+FILES_python-rpm = "${libdir}/python*/site-packages/rpm"
+PROVIDES += "python-rpm"
+
+FILES_perl-module-rpm = "${libdir}/perl/*/* \
+ "
+
+RDEPENDS_${PN}-dev += "bash"
+
+FILES_${PN}-dev = "${includedir}/rpm \
+ ${libdir}/librpm.la \
+ ${libdir}/librpm.so \
+ ${libdir}/librpmconstant.la \
+ ${libdir}/librpmconstant.so \
+ ${libdir}/librpmdb.la \
+ ${libdir}/librpmdb.so \
+ ${libdir}/librpmio.la \
+ ${libdir}/librpmio.so \
+ ${libdir}/librpmmisc.la \
+ ${libdir}/librpmmisc.so \
+ ${libdir}/librpmbuild.la \
+ ${libdir}/librpmbuild.so \
+ ${libdir}/rpm/lib/liblua.la \
+ ${libdir}/pkgconfig/rpm.pc \
+ ${libdir}/rpm/rpmdb_loadcvt \
+ "
+
+FILES_${PN}-staticdev = " \
+ ${libdir}/librpm.a \
+ ${libdir}/librpmconstant.a \
+ ${libdir}/librpmdb.a \
+ ${libdir}/librpmio.a \
+ ${libdir}/librpmmisc.a \
+ ${libdir}/librpmbuild.a \
+ ${libdir}/rpm/lib/liblua.a \
+ ${libdir}/python*/site-packages/rpm/*.a \
+ "
+
+do_configure() {
+ # Disable tests!
+ echo "all:" > ${S}/tests/Makefile.am
+ sed -e 's/@__MKDIR_P@/%{__mkdir} -p/' -i ${S}/macros/macros.in
+
+ ( cd ${S}; ${S}/autogen.sh )
+
+ # NASTY hack to make sure configure files the right pkg-config file...
+ sed -e 's/pkg-config --exists uuid/pkg-config --exists ossp-uuid/g' \
+ -e 's/pkg-config uuid/pkg-config ossp-uuid/g' -i ${S}/configure
+
+ ( cd ${S}/syck ; set +e ; rm -- -l* ; make distclean ) || :
+
+ export varprefix=${localstatedir}
+ oe_runconf
+}
+
+do_install_append() {
+ # Configure -distribution wide- package crypto settings
+ # If these change, effectively all packages have to be upgraded!
+ sed -i -e 's,%_build_file_digest_algo.*,%_build_sign ${RPM_FILE_DIGEST_ALGO},' ${D}/${libdir}/rpm/macros.rpmbuild
+ sed -i -e 's,%_build_sign.*,%_build_sign ${RPM_SELF_SIGN_ALGO},' ${D}/${libdir}/rpm/macros.rpmbuild
+
+ sed -i -e 's,%__scriptlet_requires,#%%__scriptlet_requires,' ${D}/${libdir}/rpm/macros
+ sed -i -e 's,%__perl_provides,#%%__perl_provides,' ${D}/${libdir}/rpm/macros ${D}/${libdir}/rpm/macros.d/*
+ sed -i -e 's,%__perl_requires,#%%__perl_requires,' ${D}/${libdir}/rpm/macros ${D}/${libdir}/rpm/macros.d/*
+ sed -i -e 's,%_repackage_all_erasures[^_].*,%_repackage_all_erasures 0,' ${D}/${libdir}/rpm/macros
+ sed -i -e 's,^#%_openall_before_chroot.*,%_openall_before_chroot\t1,' ${D}/${libdir}/rpm/macros
+
+ # Enable MIPS64 N32 transactions. (This is a no-op on non-MIPS targets.)
+ sed -i -e 's,%_transaction_color[^_].*,%_transaction_color 7,' ${D}/${libdir}/rpm/macros
+
+ # Enable Debian style arbitrary tags...
+ sed -i -e 's,%_arbitrary_tags[^_].*,%_arbitrary_tags %{_arbitrary_tags_debian},' ${D}/${libdir}/rpm/macros
+
+ install -m 0755 ${WORKDIR}/pythondeps.sh ${D}/${libdir}/rpm/pythondeps.sh
+ install -m 0755 ${WORKDIR}/perfile_rpmdeps.sh ${D}/${libdir}/rpm/perfile_rpmdeps.sh
+
+ # Remove unpackaged files (based on list in rpm.spec)
+ rm -f ${D}/${libdir}/rpm/{Specfile.pm,cpanflute,cpanflute2,rpmdiff,rpmdiff.cgi,sql.prov,sql.req,tcl.req,trpm}
+
+ rm -f ${D}/${mandir}/man8/rpmcache.8*
+ rm -f ${D}/${mandir}/man8/rpmgraph.8*
+ rm -f ${D}/${mandir}/*/man8/rpmcache.8*
+ rm -f ${D}/${mandir}/*/man8/rpmgraph.8*
+ rm -rf ${D}/${mandir}/{fr,ko}
+
+ rm -f ${D}/${includedir}/popt.h
+ rm -f ${D}/${libdir}/libpopt.*
+ rm -f ${D}/${libdir}/pkgconfig/popt.pc
+ rm -f ${D}/${datadir}/locale/*/LC_MESSAGES/popt.mo
+ rm -f ${D}/${mandir}/man3/popt.3
+
+ rm -f ${D}/${mandir}/man1/xar.1*
+ rm -f ${D}/${bindir}/xar
+ rm -rf ${D}/${includedir}/xar
+ rm -f ${D}/${libdir}/libxar*
+
+ rm -f ${D}/${bindir}/lz*
+ rm -f ${D}/${bindir}/unlzma
+ rm -f ${D}/${bindir}/unxz
+ rm -f ${D}/${bindir}/xz*
+ rm -rf ${D}/${includedir}/lzma*
+ rm -f ${D}/${mandir}/man1/lz*.1
+ rm -f ${D}/${libdir}/pkgconfig/liblzma*
+
+ rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/*.a
+ rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/*.la
+ rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/rpm/*.a
+ rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/rpm/*.la
+
+ #find ${D}/${libdir}/perl5 -type f -a \( -name perllocal.pod -o -name .packlist \
+ # -o \( -name '*.bs' -a -empty \) \) -exec rm -f {} ';'
+ #find ${D}/${libdir}/perl5 -type d -depth -exec rmdir {} 2>/dev/null ';'
+
+ rm -f ${D}/${libdir}/rpm/dbconvert.sh
+
+ rm -f ${D}/${libdir}/rpm/libsqldb.*
+
+ # We don't want, nor need the Mandriva multiarch items
+ rm -f ${D}/${bindir}/multiarch-dispatch
+ rm -f ${D}/${bindir}/multiarch-platform
+ rm -f ${D}/${libdir}/rpm/check-multiarch-files
+ rm -f ${D}/${libdir}/rpm/mkmultiarch
+ rm -f ${D}/${includedir}/multiarch-dispatch.h
+
+ rm -f ${D}/${libdir}/rpm/gstreamer.sh
+ rm -f ${D}/${libdir}/rpm/gem_helper.rb
+ rm -f ${D}/${libdir}/rpm/rubygems.rb
+ rm -f ${D}/${libdir}/rpm/kmod-deps.sh
+ rm -f ${D}/${libdir}/rpm/pythoneggs.py
+ rm -f ${D}/${libdir}/rpm/macros.d/kernel
+ rm -f ${D}/${libdir}/rpm/macros.d/gstreamer
+ rm -f ${D}/${libdir}/rpm/bin/mgo
+ rm -f ${D}/${libdir}/rpm/bin/dbconvert
+ rm -f ${D}/${libdir}/rpm/bin/pom2spec
+
+ rm -rf ${D}/var/lib/wdj ${D}/var/cache/wdj
+ rm -f ${D}/${libdir}/rpm/bin/api-sanity-checker.pl
+
+}
+
+do_install_append_class-target() {
+ # Create and install distribution specific macros
+ mkdir -p ${D}/${distromacrodir}
+ cat << EOF > ${D}/${distromacrodir}/macros
+%_defaultdocdir ${docdir}
+
+%_prefix ${prefix}
+%_exec_prefix ${exec_prefix}
+%_datarootdir ${datadir}
+%_bindir ${bindir}
+%_sbindir ${sbindir}
+%_libexecdir %{_libdir}/%{name}
+%_datadir ${datadir}
+%_sysconfdir ${sysconfdir}
+%_sharedstatedir ${sharedstatedir}
+%_localstatedir ${localstatedir}
+%_lib lib
+%_libdir %{_exec_prefix}/%{_lib}
+%_includedir ${includedir}
+%_oldincludedir ${oldincludedir}
+%_infodir ${infodir}
+%_mandir ${mandir}
+%_localedir %{_libdir}/locale
+EOF
+
+ # Create and install multilib specific macros
+ ${@multilib_rpmmacros(d)}
+}
+
+do_install_append_class-native () {
+ sed -i -e 's|^#!.*/usr/bin/python|#! /usr/bin/env nativepython|' ${D}/${libdir}/python2.7/site-packages/rpm/transaction.py
+}
+
+do_install_append_class-nativesdk () {
+ sed -i -e 's|^#!.*/usr/bin/python|#! /usr/bin/env python|' ${D}/${libdir}/python2.7/site-packages/rpm/transaction.py
+}
+
+def multilib_rpmmacros(d):
+ localdata = d.createCopy()
+ # We need to clear the TOOLCHAIN_OPTIONS (--sysroot)
+ localdata.delVar('TOOLCHAIN_OPTIONS')
+
+ # Set 'localdata' values to be consistent with 'd' values.
+ localdata.setVar('distromacrodir', d.getVar('distromacrodir', True))
+ localdata.setVar('WORKDIR', d.getVar('WORKDIR', True))
+
+ ret = gen_arch_macro(localdata)
+
+ variants = d.getVar("MULTILIB_VARIANTS", True) or ""
+ for item in variants.split():
+ # Load overrides from 'd' to avoid having to reset the value...
+ localdata = d.createCopy()
+ overrides = d.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
+ localdata.setVar("OVERRIDES", overrides)
+ localdata.setVar("MLPREFIX", item + "-")
+ bb.data.update_data(localdata)
+ ret += gen_arch_macro(localdata)
+ return ret
+
+def gen_arch_macro(d):
+ # Generate shell script to produce the file as part of do_install
+ val = "mkdir -p ${D}/${distromacrodir}/${TARGET_ARCH}-${TARGET_OS}\n"
+ val += "cat << EOF > ${D}/${distromacrodir}/${TARGET_ARCH}-${TARGET_OS}/macros\n"
+ val += "%_lib ${baselib}\n"
+ val += "%_libdir ${libdir}\n"
+ val += "%_localedir ${localedir}\n"
+ val += "\n"
+ val += "# Toolchain configuration\n"
+ val += "%TOOLCHAIN_OPTIONS %{nil}\n"
+ val += "%__ar ${@d.getVar('AR', True).replace('$','%')}\n"
+ val += "%__as ${@d.getVar('AS', True).replace('$','%')}\n"
+ val += "%__cc ${@d.getVar('CC', True).replace('$','%')}\n"
+ val += "%__cpp ${@d.getVar('CPP', True).replace('$','%')}\n"
+ val += "%__cxx ${@d.getVar('CXX', True).replace('$','%')}\n"
+ val += "%__ld ${@d.getVar('LD', True).replace('$','%')}\n"
+ val += "%__nm ${@d.getVar('NM', True).replace('$','%')}\n"
+ val += "%__objcopy ${@d.getVar('OBJCOPY', True).replace('$','%')}\n"
+ val += "%__objdump ${@d.getVar('OBJDUMP', True).replace('$','%')}\n"
+ val += "%__ranlib ${@d.getVar('RANLIB', True).replace('$','%')}\n"
+ val += "%__strip ${@d.getVar('STRIP', True).replace('$','%')}\n"
+ val += "EOF\n"
+ val += "\n"
+ return d.expand(val)
+
+
+add_native_wrapper() {
+ create_wrapper ${D}/${bindir}/rpm \
+ RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
+ RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+ RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
+
+ create_wrapper ${D}/${bindir}/rpm2cpio \
+ RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
+ RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+ RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
+
+ create_wrapper ${D}/${bindir}/rpmbuild \
+ RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
+ RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+ RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
+
+ create_wrapper ${D}/${bindir}/rpmconstant \
+ RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
+ RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+ RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
+
+ for rpm_binary in ${D}/${libdir}/rpm/bin/rpm* ${D}/${libdir}/rpm/bin/debugedit; do
+ create_wrapper $rpm_binary \
+ RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
+ RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+ RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
+ done
+}
+
+do_install_append_class-native() {
+ add_native_wrapper
+}
+
+do_install_append_class-nativesdk() {
+ add_native_wrapper
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm_5.4.16.bb b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm_5.4.16.bb
new file mode 100644
index 000000000..f2c12d2de
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm_5.4.16.bb
@@ -0,0 +1,740 @@
+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}-libs = "Libraries for manipulating RPM packages"
+DESCRIPTION_${PN}-libs = "This package contains the RPM shared libraries."
+
+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_${PN}-common = "Common RPM paths, scripts, documentation and configuration"
+DESCRIPTION_${PN}-common = "The rpm-common package contains paths, scripts, documentation \
+and configuration common between RPM Package Manager."
+
+SUMMARY_${PN}-build = "Scripts and executable programs used to build packages"
+DESCRIPTION_${PN}-build = "The rpm-build packagec ontains the scripts and executable programs \
+that are used to build packages using the RPM Package Manager."
+
+SUMMARY_python-rpm = "Python bindings for apps which will manupulate RPM packages"
+DESCRIPTION_python-rpm = "The rpm-python package contains a module that permits applications \
+written in the Python programming language to use the interface \
+supplied by the RPM Package Manager libraries."
+
+SUMMARY_perl-module-rpm = "Perl bindings for apps which will manipulate RPM packages"
+DESCRIPTION_perl-modules-rpm = "The perl-modules-rpm package contains a module that permits applications \
+written in the Perl programming language to use the interface \
+supplied by the RPM Package Manager libraries."
+
+HOMEPAGE = "http://rpm5.org/"
+LICENSE = "LGPLv2.1 & Apache-2.0"
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1"
+LIC_FILES_CHKSUM += "file://rpmio/mongo.c;begin=5;end=18;md5=d8327ba2c71664c059143e6d333b8901"
+
+# We must have gettext-native, we need gettextize, which may not be provided
+DEPENDS = "libpcre attr acl ossp-uuid file byacc-native gettext-native"
+DEPENDS_append_class-native = " file-replacement-native"
+
+# rpm2cpio is a shell script, which is part of the rpm src.rpm. It is needed
+# in order to extract the distribution SRPM into a format we can extract...
+
+# There is no official 5.4.16 release yet, so start w/ 5.4.15 and patch it
+# based on CVS
+S = "${WORKDIR}/rpm-5.4.15"
+
+SRC_URI = "http://www.rpm5.org/files/rpm/rpm-5.4/rpm-5.4.15-0.20140824.src.rpm;name=srpm;extract=rpm-5.4.15.tar.gz \
+ http://downloads.yoctoproject.org/releases/rpm5/rpm-5.4.15-to-5.4.16-20160225.patch.gz;name=rpm-patch \
+ http://downloads.yoctoproject.org/releases/rpm5/syck-5.4.15-to-5.4.16-20160225.patch.gz;name=syck-patch \
+ http://downloads.yoctoproject.org/releases/rpm5/beecrypt-5.4.15-to-5.4.16-20160225.patch.gz;name=beecrypt-patch \
+ http://downloads.yoctoproject.org/releases/rpm5/lua-5.4.15-to-5.4.16-20160225.patch.gz;name=lua-patch \
+ file://perfile_rpmdeps.sh \
+ file://pythondeps.sh \
+"
+
+SRC_URI[srpm.md5sum] = "d53782842ac11b3100a43fb2958c9bc0"
+SRC_URI[srpm.sha256sum] = "d4ae5e9ed5df8ab9931b660f491418d20ab5c4d72eb17ed9055b80b71ef6c4ee"
+
+SRC_URI[rpm-patch.md5sum] = "8b7deb1c9574d3d47ed8ba8c690fd8bf"
+SRC_URI[rpm-patch.sha256sum] = "1c1983d001b04eaa23eb2c8d9598b9d0899acb0a89f54a2d4c4e974086fd17a5"
+
+SRC_URI[syck-patch.md5sum] = "f31d7a32105a364688354419ec3559e4"
+SRC_URI[syck-patch.sha256sum] = "4dd1d04489206d8b5d1970f2a8d143a002f2895cefbe15d73459785096545e8a"
+
+SRC_URI[beecrypt-patch.md5sum] = "9e71ee3ccb0a52985a071dd250279132"
+SRC_URI[beecrypt-patch.sha256sum] ="df7c0708a7fab9bdf6d46194519b42e736f99cb0599dcc1c3c1bf1b228705cde"
+
+SRC_URI[lua-patch.md5sum] = "ca10d03d83b1fc1c31a0b50819534cd7"
+SRC_URI[lua-patch.sha256sum] = "6bde435cc827a7d4b2520e8f3e1c9bd2ca74375de0a4402aa99ef4d48eab9a7e"
+
+# Bug fixes
+SRC_URI += " \
+ file://header-include-fix.patch \
+ file://rpm-libsql-fix.patch \
+ file://rpm-platform.patch \
+ file://rpm-platform2.patch \
+ file://rpm-tools-mtree-LDFLAGS.patch \
+ file://rpm-canonarch.patch \
+ file://rpm-no-loopmsg.patch \
+ file://rpm-resolvedep.patch \
+ file://rpm-packageorigin.patch \
+ file://uclibc-support.patch \
+ file://rpmatch.patch \
+ file://makefile-am-exec-hook.patch \
+ file://python-rpm-rpmsense.patch \
+ file://debugedit-segv.patch \
+ file://debugedit-valid-file-to-fix-segment-fault.patch \
+ file://rpm-platform-file-fix.patch \
+ file://rpm-lsb-compatibility.patch \
+ file://rpm-tag-generate-endian-conversion-fix.patch \
+ file://rpm-hardlink-segfault-fix.patch \
+ file://rpm-payload-use-hashed-inode.patch \
+ file://rpm-fix-logio-cp.patch \
+ file://0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch \
+ file://rpm-opendb-before-verifyscript-to-avoid-null-point.patch \
+ file://0001-define-EM_AARCH64.patch \
+ file://rpm-rpmfc.c-fix-for-N32-MIPS64.patch \
+ file://rpm-lib-transaction.c-fix-file-conflicts-for-mips64-N32.patch \
+ file://rpm-mongodb-sasl.patch \
+ file://rpm-fix-parseEmbedded.patch \
+ file://rpm-rpmio-headers.patch \
+ file://rpm-python-restore-origin.patch \
+ file://rpm-keccak-sse-intrin.patch \
+ file://rpm-atomic-ops.patch \
+ file://rpm-gnu-atomic.patch \
+ file://rpm-tagname-type.patch \
+ file://rpm-python-tagname.patch \
+ file://rpm-python-AddErase.patch \
+ file://rpm-rpmpgp-popt.patch \
+ file://rpm-fix-lua-tests-compilation-failure.patch \
+ file://rpmqv.c-check-_gpg_passphrase-before-ask-for-input.patch \
+ file://0001-Disable-__sync_add_and_fetch_8-on-nios2.patch \
+"
+
+# OE specific changes
+SRC_URI += " \
+ file://rpm-log-auto-rm.patch \
+ file://rpm-db-reduce.patch \
+ file://rpm-autogen.patch \
+ file://rpm-showrc.patch \
+ file://rpm-fileclass.patch \
+ file://rpm-scriptletexechelper.patch \
+ file://rpmdeps-oecore.patch \
+ file://rpm-no-perl-urpm.patch \
+ file://rpm-macros.patch \
+ file://rpm-lua.patch \
+ file://rpm-ossp-uuid.patch \
+ file://rpm-uuid-include.patch \
+ file://rpm-pkgconfigdeps.patch \
+ file://no-ldflags-in-pkgconfig.patch \
+ file://dbconvert.patch \
+ file://rpm-db_buffer_small.patch \
+ file://rpm-py-init.patch \
+ file://rpm-reloc-macros.patch \
+ file://rpm-db5-or-db6.patch \
+ file://rpm-db60.patch \
+ file://rpmqv_cc_b_gone.patch \
+ file://rpm-realpath.patch \
+ file://rpm-check-rootpath-reasonableness.patch \
+ file://rpm-macros.in-disable-external-key-server.patch \
+ file://configure.ac-check-for-both-gpg2-and-gpg.patch \
+ file://rpm-disable-auto-stack-protector.patch \
+ file://popt-disable-auto-stack-protector.patch \
+ file://rpm-syck-fix-gram.patch \
+ file://rpm-rpmdb-grammar.patch \
+ file://rpm-disable-blaketest.patch \
+ file://rpm-autogen-force.patch \
+ file://rpmdb-more-verbose-error-logging-in-rpmTempFile.patch \
+"
+
+SRC_URI_append_libc-musl = "\
+ file://0001-rpm-Fix-build-on-musl.patch \
+"
+# Uncomment the following line to enable platform score debugging
+# This is useful when identifying issues with Smart being unable
+# to process certain package feeds.
+#SRC_URI += "file://rpm-debug-platform.patch"
+
+UPSTREAM_CHECK_REGEX = "rpm-(?P<pver>(\d+[\.\-_]*)+)-.*$"
+
+inherit autotools gettext
+
+acpaths = "-I ${S}/db/dist/aclocal -I ${S}/db/dist/aclocal_java"
+
+# The local distribution macro directory
+distromacrodir = "${libdir}/rpm/poky"
+
+# Specify the default rpm macros in terms of adjustable variables
+rpm_macros = "%{_usrlibrpm}/macros:%{_usrlibrpm}/${DISTRO}/macros:%{_usrlibrpm}/${DISTRO}/%{_target}/macros:%{_etcrpm}/macros.*:%{_etcrpm}/macros:%{_etcrpm}/%{_target}/macros:~/.oerpmmacros"
+rpm_macros_class-native = "%{_usrlibrpm}/macros:%{_usrlibrpm}/${DISTRO}/macros:%{_usrlibrpm}/${DISTRO}/%{_target}/macros:~/.oerpmmacros"
+rpm_macros_class-nativesdk = "%{_usrlibrpm}/macros:%{_usrlibrpm}/${DISTRO}/macros:%{_usrlibrpm}/${DISTRO}/%{_target}/macros:~/.oerpmmacros"
+
+# sqlite lua tcl augeas nss gcrypt neon xz xar keyutils perl selinux
+
+# Set the digest algorithm used for verifying file integrity
+# If this value changes, and two different packages have different values
+# the "same file" validation (two packages have a non-conflict file)
+# will fail. This may lead to upgrade problems. You should treat this
+# value as a distribution wide setting, and only change it when you intend
+# a full system upgrade!
+#
+# Defined file digest algorithm values (note: not all are available!):
+# 1 MD5 (legacy RPM default)
+# 2 SHA1
+# 3 RIPEMD-160
+# 5 MD2
+# 6 TIGER-192
+# 8 SHA256
+# 9 SHA384
+# 10 SHA512
+# 11 SHA224
+# 104 MD4
+# 105 RIPEMD-128
+# 106 CRC-32
+# 107 ADLER-32
+# 108 CRC-64 (ECMA-182 polynomial, untested uint64_t problems)
+# 109 Jenkins lookup3.c hashlittle()
+# 111 RIPEMD-256
+# 112 RIPEMD-320
+# 188 BLAKE2B
+# 189 BLAKE2BP
+# 190 BLAKE2S
+# 191 BLAKE2SP
+RPM_FILE_DIGEST_ALGO ?= "1"
+
+# All packages build with RPM5 contain a non-repudiable signature.
+# The purpose of this signature is not to show authenticity of a package,
+# but instead act as a secondary package wide validation that shows it
+# wasn't damaged by accident in transport. (When later you sign the package,
+# this signature may or may not be replaced as there are three signature
+# slots, one for DSA/RSA, one for ECSDA, and one reserved.)
+#
+# There is a known issue w/ RSA signatures that if they start with an 0x00
+# the signing and validation may fail.
+#
+# The following is the list of choices for the non-rpudiable signature
+# (note: not all of these are implemented):
+# DSA (default)
+# RSA (implies SHA1)
+# ECDSA (implies SHA256)
+# DSA/SHA1
+# DSA/SHA224
+# DSA/SHA256
+# DSA/SHA384
+# DSA/SHA512
+# RSA/SHA1
+# RSA/SHA224
+# RSA/SHA256
+# RSA/SHA384
+# RSA/SHA512
+# ECDSA/SHA224 (using NIST P-224)
+# ECDSA/SHA256 (using NIST P-256)
+# ECDSA/SHA384 (using NIST P-384)
+# ECDSA/SHA512 (using NIST P-521)
+RPM_SELF_SIGN_ALGO ?= "DSA"
+
+# Note: perl and sqlite w/o db specified does not currently work.
+# tcl, augeas, nss, gcrypt, xar and keyutils support is untested.
+PACKAGECONFIG ??= "db bzip2 zlib popt openssl libelf python"
+
+# Note: switching to internal popt may not work, as it will generate
+# a shared library which will intentionally not be packaged.
+#
+# If you intend to use the internal version, additional work may be required.
+PACKAGECONFIG[popt] = "--with-popt=external,--with-popt=internal,popt,"
+
+PACKAGECONFIG[bzip2] = "--with-bzip2,--without-bzip2,bzip2,"
+PACKAGECONFIG[xz] = "--with-xz,--without-xz,xz,"
+PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib,"
+PACKAGECONFIG[xar] = "--with-xar,--without-xar,xar,"
+
+WITH_PYTHON = " --with-python=${PYTHON_BASEVERSION} \
+ --with-python-inc-dir=${STAGING_INCDIR}/python${PYTHON_BASEVERSION} \
+ --with-python-lib-dir=${libdir}/python${PYTHON_BASEVERSION}/site-packages \
+ --without-pythonembed"
+PACKAGECONFIG[python] = "${WITH_PYTHON},--without-python,python,"
+
+# Perl modules are not built, but they could be enabled fairly easily
+# the perl module creation and installation would need to be patched.
+# (currently has host perl contamination issues)
+WITH_PERL = "--with-perl --without-perlembed --without-perl-urpm"
+WITHOUT_PERL = "--without-perl --without-perl-urpm"
+PACKAGECONFIG[perl] = "${WITH_PERL},${WITHOUT_PERL},perl,"
+
+# The --with-dbsql will only tell RPM to check for support, db
+# may or may not be built w/ the dbsql support.
+WITH_DB = "--with-db --with-dbsql --without-db-tools-integrated"
+PACKAGECONFIG[db] = "${WITH_DB},--without-db,db,"
+
+PACKAGECONFIG[sqlite] = "--with-sqlite,--without-sqlite,sqlite3,"
+
+# This switch simply disables external beecrypt, RPM5 always uses beecrypt
+# for base64 processing and various digest algorithms.
+# Beecrypt is only the preferred crypto engine if it's the only engine enabled.
+PACKAGECONFIG[beecrypt] = "--with-beecrypt=external,--with-beecrypt=internal,beecrypt,"
+
+# --with-usecrypto= setting defined the item as the preferred system
+# crypto engine, which will take priority over the included beecrypt
+PACKAGECONFIG[openssl] = "--with-openssl --with-usecrypto=openssl,--without-openssl,openssl,"
+PACKAGECONFIG[nss] = "--with-nss --with-usecrypto=nss,--without-nss,nss,"
+PACKAGECONFIG[gcrypt] = "--with-gcrypt --with-usecrypto=gcrypt,--without-gcrypt,gcrypt,"
+
+PACKAGECONFIG[keyutils] = "--with-keyutils,--without-keyutils,keyutils,"
+PACKAGECONFIG[libelf] = "--with-libelf,--without-libelf,elfutils,"
+
+WITH_SELINUX = "--with-selinux --with-sepol --with-semanage"
+WITHOUT_SELINUX = "--without-selinux --without-sepol --without-semanage"
+PACKAGECONFIG[selinux] = "${WITH_SELINUX},${WITHOUT_SELINUX},libselinux,"
+
+WITH_NEON = "--with-neon --with-libproxy --with-expat --without-gssapi"
+WITHOUT_NEON = "--without-neon --without-libproxy --without-expat --without-gssapi"
+PACKAGECONFIG[neon] = "${WITH_NEON},${WITHOUT_NEON},neon expat,"
+
+PACKAGECONFIG[lua] = "--with-lua,--without-lua,expat,"
+PACKAGECONFIG[tcl] = "--with-tcl,--without-tcl,tcl,"
+
+PACKAGECONFIG[augeas] = "--with-augeas,--without-augeas,augeas,"
+
+EXTRA_OECONF += "--verbose \
+ --sysconfdir=${sysconfdir} \
+ --with-file \
+ --with-path-magic=%{_usrlibrpm}/../../share/misc/magic.mgc \
+ --with-syck=internal \
+ --without-readline \
+ --without-libtasn1 \
+ --without-pakchois \
+ --without-gnutls \
+ --with-pcre \
+ --enable-utf8 \
+ --with-uuid \
+ --with-attr \
+ --with-acl \
+ --with-pthreads \
+ --without-cudf \
+ --without-ficl \
+ --without-aterm \
+ --without-nix \
+ --without-bash \
+ --without-rc \
+ --without-js \
+ --without-gpsee \
+ --without-ruby \
+ --without-squirrel \
+ --without-sasl2 \
+ --without-tomcrypt \
+ --with-build-extlibdep \
+ --with-build-maxextlibdep \
+ --without-valgrind \
+ --disable-openmp \
+ --enable-build-pic \
+ --enable-build-versionscript \
+ --enable-build-warnings \
+ --enable-build-debug \
+ --enable-maintainer-mode \
+ --with-path-macros=${rpm_macros} \
+ --with-path-lib=${libdir}/rpm \
+ --with-bugreport=http://bugzilla.yoctoproject.org \
+ --program-prefix= \
+ YACC=byacc"
+
+CFLAGS_append = " -DRPM_VENDOR_WINDRIVER -DRPM_VENDOR_POKY -DRPM_VENDOR_OE"
+
+LDFLAGS_append_libc-uclibc = "-lrt -lpthread"
+
+PACKAGES = "${PN}-dbg ${PN} ${PN}-doc ${PN}-libs ${PN}-dev ${PN}-staticdev ${PN}-common ${PN}-build python-rpm perl-module-rpm ${PN}-locale"
+
+SOLIBS = "5.4.so"
+
+# Based on %files section in the rpm.spec
+
+FILES_${PN} = "${bindir}/rpm \
+ ${bindir}/rpmconstant \
+ ${libdir}/rpm/rpm.* \
+ ${libdir}/rpm/tgpg \
+ ${libdir}/rpm/macros \
+ ${libdir}/rpm/rpmpopt \
+ ${libdir}/rpm/rpm2cpio \
+ ${libdir}/rpm/vcheck \
+ ${libdir}/rpm/helpers \
+ ${libdir}/rpm/qf \
+ ${libdir}/rpm/cpuinfo.yaml \
+ ${libdir}/rpm/bin/mtree \
+ ${libdir}/rpm/bin/rpmkey \
+ ${libdir}/rpm/bin/rpmrepo \
+ ${libdir}/rpm/bin/rpmrepo.real \
+ ${libdir}/rpm/bin/rpmspecdump \
+ ${libdir}/rpm/bin/rpmspecdump.real \
+ ${libdir}/rpm/bin/wget \
+ ${localstatedir}/cache \
+ ${localstatedir}/cache/rpm \
+ ${localstatedir}/cache/wdj \
+ ${localstatedir}/lib \
+ ${localstatedir}/lib/rpm \
+ ${localstatedir}/lib/wdj \
+ ${bindir}/rpm.real \
+ ${bindir}/rpmconstant.real \
+ ${bindir}/rpm2cpio.real \
+ "
+
+FILES_${PN}-common = "${bindir}/rpm2cpio \
+ ${bindir}/gendiff \
+ ${sysconfdir}/rpm \
+ ${localstatedir}/spool/repackage \
+ "
+
+FILES_${PN}-libs = "${libdir}/librpm-*.so \
+ ${libdir}/librpmconstant-*.so \
+ ${libdir}/librpmdb-*.so \
+ ${libdir}/librpmio-*.so \
+ ${libdir}/librpmmisc-*.so \
+ ${libdir}/librpmbuild-*.so \
+ "
+
+FILES_${PN}-build = "${prefix}/src/rpm \
+ ${bindir}/rpmbuild \
+ ${bindir}/rpmbuild.real \
+ ${libdir}/rpm/brp-* \
+ ${libdir}/rpm/check-files \
+ ${libdir}/rpm/cross-build \
+ ${libdir}/rpm/find-debuginfo.sh \
+ ${libdir}/rpm/find-lang.sh \
+ ${libdir}/rpm/find-prov.pl \
+ ${libdir}/rpm/find-provides.perl \
+ ${libdir}/rpm/find-req.pl \
+ ${libdir}/rpm/find-requires.perl \
+ ${libdir}/rpm/getpo.sh \
+ ${libdir}/rpm/http.req \
+ ${libdir}/rpm/javadeps.sh \
+ ${libdir}/rpm/mono-find-provides \
+ ${libdir}/rpm/mono-find-requires \
+ ${libdir}/rpm/executabledeps.sh \
+ ${libdir}/rpm/libtooldeps.sh \
+ ${libdir}/rpm/osgideps.pl \
+ ${libdir}/rpm/perldeps.pl \
+ ${libdir}/rpm/perl.prov \
+ ${libdir}/rpm/perl.req \
+ ${libdir}/rpm/php.prov \
+ ${libdir}/rpm/php.req \
+ ${libdir}/rpm/pkgconfigdeps.sh \
+ ${libdir}/rpm/pythondeps.sh \
+ ${libdir}/rpm/bin/debugedit \
+ ${libdir}/rpm/bin/debugedit.real \
+ ${libdir}/rpm/bin/rpmcache \
+ ${libdir}/rpm/bin/rpmcache.real \
+ ${libdir}/rpm/bin/rpmcmp \
+ ${libdir}/rpm/bin/rpmcmp.real \
+ ${libdir}/rpm/bin/rpmdeps \
+ ${libdir}/rpm/bin/rpmdeps.real \
+ ${libdir}/rpm/bin/rpmdeps-oecore \
+ ${libdir}/rpm/bin/rpmdeps-oecore.real \
+ ${libdir}/rpm/bin/rpmdigest \
+ ${libdir}/rpm/bin/rpmdigest.real \
+ ${libdir}/rpm/bin/abi-compliance-checker.pl \
+ ${libdir}/rpm/bin/api-sanity-autotest.pl \
+ ${libdir}/rpm/bin/chroot \
+ ${libdir}/rpm/bin/cp \
+ ${libdir}/rpm/bin/dbsql \
+ ${libdir}/rpm/bin/find \
+ ${libdir}/rpm/bin/install-sh \
+ ${libdir}/rpm/bin/lua \
+ ${libdir}/rpm/bin/luac \
+ ${libdir}/rpm/bin/mkinstalldirs \
+ ${libdir}/rpm/bin/rpmlua \
+ ${libdir}/rpm/bin/rpmluac \
+ ${libdir}/rpm/bin/sqlite3 \
+ ${libdir}/rpm/macros.d/cmake \
+ ${libdir}/rpm/macros.d/java \
+ ${libdir}/rpm/macros.d/libtool \
+ ${libdir}/rpm/macros.d/mandriva \
+ ${libdir}/rpm/macros.d/mono \
+ ${libdir}/rpm/macros.d/perl \
+ ${libdir}/rpm/macros.d/php \
+ ${libdir}/rpm/macros.d/pkgconfig \
+ ${libdir}/rpm/macros.d/python \
+ ${libdir}/rpm/macros.d/ruby \
+ ${libdir}/rpm/macros.d/selinux \
+ ${libdir}/rpm/macros.d/tcl \
+ ${libdir}/rpm/macros.rpmbuild \
+ ${libdir}/rpm/u_pkg.sh \
+ ${libdir}/rpm/vpkg-provides.sh \
+ ${libdir}/rpm/vpkg-provides2.sh \
+ ${libdir}/rpm/perfile_rpmdeps.sh \
+ ${distromacrodir} \
+ "
+RDEPENDS_${PN} = "base-files run-postinsts"
+RDEPENDS_${PN}_class-native = ""
+RDEPENDS_${PN}_class-nativesdk = ""
+RDEPENDS_${PN}-build = "file bash perl"
+
+RDEPENDS_python-rpm = "${PN} python"
+
+FILES_python-rpm = "${libdir}/python*/site-packages/rpm"
+PROVIDES += "python-rpm"
+
+FILES_perl-module-rpm = "${libdir}/perl/*/* \
+ "
+
+RDEPENDS_${PN}-dev += "bash"
+
+FILES_${PN}-dev = "${includedir}/rpm \
+ ${libdir}/librpm.la \
+ ${libdir}/librpm.so \
+ ${libdir}/librpmconstant.la \
+ ${libdir}/librpmconstant.so \
+ ${libdir}/librpmdb.la \
+ ${libdir}/librpmdb.so \
+ ${libdir}/librpmio.la \
+ ${libdir}/librpmio.so \
+ ${libdir}/librpmmisc.la \
+ ${libdir}/librpmmisc.so \
+ ${libdir}/librpmbuild.la \
+ ${libdir}/librpmbuild.so \
+ ${libdir}/rpm/lib/liblua.la \
+ ${libdir}/pkgconfig/rpm.pc \
+ ${libdir}/rpm/rpmdb_loadcvt \
+ ${libdir}/rpm/include \
+ "
+
+FILES_${PN}-staticdev = " \
+ ${libdir}/librpm.a \
+ ${libdir}/librpmconstant.a \
+ ${libdir}/librpmdb.a \
+ ${libdir}/librpmio.a \
+ ${libdir}/librpmmisc.a \
+ ${libdir}/librpmbuild.a \
+ ${libdir}/rpm/lib/liblua.a \
+ ${libdir}/python*/site-packages/rpm/*.a \
+ "
+
+do_configure() {
+ # Disable tests!
+ echo "all:" > ${S}/tests/Makefile.am
+ sed -e 's/@__MKDIR_P@/%{__mkdir} -p/' -i ${S}/macros/macros.in
+
+ ( cd ${S}; ${S}/autogen.sh )
+
+ # NASTY hack to make sure configure files the right pkg-config file...
+ sed -e 's/pkg-config --exists uuid/pkg-config --exists ossp-uuid/g' \
+ -e 's/pkg-config uuid/pkg-config ossp-uuid/g' -i ${S}/configure
+
+ ( cd ${S}/syck ; set +e ; rm -- -l* ; make distclean ) || :
+
+ export varprefix=${localstatedir}
+ oe_runconf
+}
+
+do_install_append() {
+ # Configure -distribution wide- package crypto settings
+ # If these change, effectively all packages have to be upgraded!
+ sed -i -e 's,%_build_file_digest_algo.*,%_build_sign ${RPM_FILE_DIGEST_ALGO},' ${D}/${libdir}/rpm/macros.rpmbuild
+ sed -i -e 's,%_build_sign.*,%_build_sign ${RPM_SELF_SIGN_ALGO},' ${D}/${libdir}/rpm/macros.rpmbuild
+
+ sed -i -e 's,%__scriptlet_requires,#%%__scriptlet_requires,' ${D}/${libdir}/rpm/macros
+ sed -i -e 's,%__perl_provides,#%%__perl_provides,' ${D}/${libdir}/rpm/macros ${D}/${libdir}/rpm/macros.d/*
+ sed -i -e 's,%__perl_requires,#%%__perl_requires,' ${D}/${libdir}/rpm/macros ${D}/${libdir}/rpm/macros.d/*
+ sed -i -e 's,%_repackage_all_erasures[^_].*,%_repackage_all_erasures 0,' ${D}/${libdir}/rpm/macros
+ sed -i -e 's,^#%_openall_before_chroot.*,%_openall_before_chroot\t1,' ${D}/${libdir}/rpm/macros
+
+ # Enable MIPS64 N32 transactions. (This is a no-op on non-MIPS targets.)
+ sed -i -e 's,%_transaction_color[^_].*,%_transaction_color 7,' ${D}/${libdir}/rpm/macros
+
+ # Enable Debian style arbitrary tags...
+ sed -i -e 's,%_arbitrary_tags[^_].*,%_arbitrary_tags %{_arbitrary_tags_debian},' ${D}/${libdir}/rpm/macros
+
+ install -m 0755 ${WORKDIR}/pythondeps.sh ${D}/${libdir}/rpm/pythondeps.sh
+ install -m 0755 ${WORKDIR}/perfile_rpmdeps.sh ${D}/${libdir}/rpm/perfile_rpmdeps.sh
+
+ # Remove unpackaged files (based on list in rpm.spec)
+ rm -f ${D}/${libdir}/rpm/{Specfile.pm,cpanflute,cpanflute2,rpmdiff,rpmdiff.cgi,sql.prov,sql.req,tcl.req,trpm}
+
+ rm -f ${D}/${mandir}/man8/rpmcache.8*
+ rm -f ${D}/${mandir}/man8/rpmgraph.8*
+ rm -f ${D}/${mandir}/*/man8/rpmcache.8*
+ rm -f ${D}/${mandir}/*/man8/rpmgraph.8*
+ rm -rf ${D}/${mandir}/{fr,ko}
+
+ rm -f ${D}/${includedir}/popt.h
+ rm -f ${D}/${libdir}/libpopt.*
+ rm -f ${D}/${libdir}/pkgconfig/popt.pc
+ rm -f ${D}/${datadir}/locale/*/LC_MESSAGES/popt.mo
+ rm -f ${D}/${mandir}/man3/popt.3
+
+ rm -f ${D}/${mandir}/man1/xar.1*
+ rm -f ${D}/${bindir}/xar
+ rm -rf ${D}/${includedir}/xar
+ rm -f ${D}/${libdir}/libxar*
+
+ rm -f ${D}/${bindir}/lz*
+ rm -f ${D}/${bindir}/unlzma
+ rm -f ${D}/${bindir}/unxz
+ rm -f ${D}/${bindir}/xz*
+ rm -rf ${D}/${includedir}/lzma*
+ rm -f ${D}/${mandir}/man1/lz*.1
+ rm -f ${D}/${libdir}/pkgconfig/liblzma*
+
+ rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/*.a
+ rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/*.la
+ rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/rpm/*.a
+ rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/rpm/*.la
+
+ #find ${D}/${libdir}/perl5 -type f -a \( -name perllocal.pod -o -name .packlist \
+ # -o \( -name '*.bs' -a -empty \) \) -exec rm -f {} ';'
+ #find ${D}/${libdir}/perl5 -type d -depth -exec rmdir {} 2>/dev/null ';'
+
+ rm -f ${D}/${libdir}/rpm/dbconvert.sh
+
+ rm -f ${D}/${libdir}/rpm/libsqldb.*
+
+ # We don't want, nor need the Mandriva multiarch items
+ rm -f ${D}/${bindir}/multiarch-dispatch
+ rm -f ${D}/${bindir}/multiarch-platform
+ rm -f ${D}/${libdir}/rpm/check-multiarch-files
+ rm -f ${D}/${libdir}/rpm/mkmultiarch
+ rm -f ${D}/${includedir}/multiarch-dispatch.h
+
+ rm -f ${D}/${libdir}/rpm/gstreamer.sh
+ rm -f ${D}/${libdir}/rpm/gem_helper.rb
+ rm -f ${D}/${libdir}/rpm/rubygems.rb
+ rm -f ${D}/${libdir}/rpm/kmod-deps.sh
+ rm -f ${D}/${libdir}/rpm/pythoneggs.py
+ rm -f ${D}/${libdir}/rpm/macros.d/kernel
+ rm -f ${D}/${libdir}/rpm/macros.d/gstreamer
+ rm -f ${D}/${libdir}/rpm/bin/mgo
+ rm -f ${D}/${libdir}/rpm/bin/dbconvert
+ rm -f ${D}/${libdir}/rpm/bin/pom2spec
+
+ rm -rf ${D}/var/lib/wdj ${D}/var/cache/wdj
+ rm -f ${D}/${libdir}/rpm/bin/api-sanity-checker.pl
+
+}
+
+do_install_append_class-target() {
+ # Create and install distribution specific macros
+ mkdir -p ${D}/${distromacrodir}
+ cat << EOF > ${D}/${distromacrodir}/macros
+%_defaultdocdir ${docdir}
+
+%_prefix ${prefix}
+%_exec_prefix ${exec_prefix}
+%_datarootdir ${datadir}
+%_bindir ${bindir}
+%_sbindir ${sbindir}
+%_libexecdir %{_libdir}/%{name}
+%_datadir ${datadir}
+%_sysconfdir ${sysconfdir}
+%_sharedstatedir ${sharedstatedir}
+%_localstatedir ${localstatedir}
+%_lib lib
+%_libdir %{_exec_prefix}/%{_lib}
+%_includedir ${includedir}
+%_oldincludedir ${oldincludedir}
+%_infodir ${infodir}
+%_mandir ${mandir}
+%_localedir %{_libdir}/locale
+EOF
+
+ # Create and install multilib specific macros
+ ${@multilib_rpmmacros(d)}
+}
+
+do_install_append_class-native () {
+ sed -i -e 's|^#!.*/usr/bin/python|#! /usr/bin/env nativepython|' ${D}/${libdir}/python2.7/site-packages/rpm/transaction.py
+}
+
+do_install_append_class-nativesdk () {
+ sed -i -e 's|^#!.*/usr/bin/python|#! /usr/bin/env python|' ${D}/${libdir}/python2.7/site-packages/rpm/transaction.py
+}
+
+def multilib_rpmmacros(d):
+ localdata = d.createCopy()
+ # We need to clear the TOOLCHAIN_OPTIONS (--sysroot)
+ localdata.delVar('TOOLCHAIN_OPTIONS')
+
+ # Set 'localdata' values to be consistent with 'd' values.
+ localdata.setVar('distromacrodir', d.getVar('distromacrodir', True))
+ localdata.setVar('WORKDIR', d.getVar('WORKDIR', True))
+
+ ret = gen_arch_macro(localdata)
+
+ variants = d.getVar("MULTILIB_VARIANTS", True) or ""
+ for item in variants.split():
+ # Load overrides from 'd' to avoid having to reset the value...
+ localdata = d.createCopy()
+ overrides = d.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
+ localdata.setVar("OVERRIDES", overrides)
+ localdata.setVar("MLPREFIX", item + "-")
+ bb.data.update_data(localdata)
+ ret += gen_arch_macro(localdata)
+ return ret
+
+def gen_arch_macro(d):
+ # Generate shell script to produce the file as part of do_install
+ val = "mkdir -p ${D}/${distromacrodir}/${TARGET_ARCH}-${TARGET_OS}\n"
+ val += "cat << EOF > ${D}/${distromacrodir}/${TARGET_ARCH}-${TARGET_OS}/macros\n"
+ val += "%_lib ${baselib}\n"
+ val += "%_libdir ${libdir}\n"
+ val += "%_localedir ${localedir}\n"
+ val += "\n"
+ val += "# Toolchain configuration\n"
+ val += "%TOOLCHAIN_OPTIONS %{nil}\n"
+ val += "%__ar ${@d.getVar('AR', True).replace('$','%')}\n"
+ val += "%__as ${@d.getVar('AS', True).replace('$','%')}\n"
+ val += "%__cc ${@d.getVar('CC', True).replace('$','%')}\n"
+ val += "%__cpp ${@d.getVar('CPP', True).replace('$','%')}\n"
+ val += "%__cxx ${@d.getVar('CXX', True).replace('$','%')}\n"
+ val += "%__ld ${@d.getVar('LD', True).replace('$','%')}\n"
+ val += "%__nm ${@d.getVar('NM', True).replace('$','%')}\n"
+ val += "%__objcopy ${@d.getVar('OBJCOPY', True).replace('$','%')}\n"
+ val += "%__objdump ${@d.getVar('OBJDUMP', True).replace('$','%')}\n"
+ val += "%__ranlib ${@d.getVar('RANLIB', True).replace('$','%')}\n"
+ val += "%__strip ${@d.getVar('STRIP', True).replace('$','%')}\n"
+ val += "EOF\n"
+ val += "\n"
+ return d.expand(val)
+
+
+add_native_wrapper() {
+ create_wrapper ${D}/${bindir}/rpm \
+ RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
+ RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+ RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
+
+ create_wrapper ${D}/${bindir}/rpm2cpio \
+ RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
+ RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+ RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
+
+ create_wrapper ${D}/${bindir}/rpmbuild \
+ RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
+ RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+ RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
+
+ create_wrapper ${D}/${bindir}/rpmconstant \
+ RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
+ RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+ RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
+
+ for rpm_binary in ${D}/${libdir}/rpm/bin/rpm* ${D}/${libdir}/rpm/bin/debugedit; do
+ create_wrapper $rpm_binary \
+ RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
+ RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+ RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
+ done
+}
+
+do_install_append_class-native() {
+ add_native_wrapper
+}
+
+do_install_append_class-nativesdk() {
+ add_native_wrapper
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpmresolve/rpmresolve.c b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpmresolve/rpmresolve.c
new file mode 100644
index 000000000..c0b4d567f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpmresolve/rpmresolve.c
@@ -0,0 +1,426 @@
+/* OpenEmbedded RPM resolver 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.
+
+*/
+
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+#include <rpmdb.h>
+#include <rpmtypes.h>
+#include <rpmtag.h>
+#include <rpmts.h>
+#include <rpmmacro.h>
+#include <rpmcb.h>
+#include <rpmlog.h>
+#include <argv.h>
+#include <mire.h>
+
+int debugmode;
+FILE *outf;
+
+int getPackageStr(rpmts ts, const char *NVRA, rpmTag tag, char **value)
+{
+ int rc = -1;
+ rpmmi mi = rpmmiInit(rpmtsGetRdb(ts), RPMTAG_NVRA, NVRA, 0);
+ Header h;
+ if ((h = rpmmiNext(mi)) != NULL) {
+ HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he));
+ he->tag = tag;
+ rc = (headerGet(h, he, 0) != 1);
+ if(rc==0)
+ *value = strdup((char *)he->p.ptr);
+ }
+ (void)rpmmiFree(mi);
+ return rc;
+}
+
+int loadTs(rpmts **ts, int *tsct, const char *dblistfn)
+{
+ int count = 0;
+ int sz = 5;
+ int rc = 0;
+ int listfile = 1;
+ struct stat st_buf;
+
+ rc = stat(dblistfn, &st_buf);
+ if(rc != 0) {
+ perror("stat");
+ return 1;
+ }
+ if(S_ISDIR(st_buf.st_mode))
+ listfile = 0;
+
+ if(listfile) {
+ if(debugmode)
+ printf("DEBUG: reading database list file '%s'\n", dblistfn);
+ *ts = malloc(sz * sizeof(rpmts));
+ FILE *f = fopen(dblistfn, "r" );
+ if(f) {
+ char line[2048];
+ while(fgets(line, sizeof(line), f)) {
+ int len = strlen(line) - 1;
+ if(len > 0)
+ // Trim trailing whitespace
+ while(len > 0 && isspace(line[len]))
+ line[len--] = '\0';
+
+ if(len > 0) {
+ // Expand array if needed
+ if(count == sz) {
+ sz += 5;
+ *ts = (rpmts *)realloc(*ts, sz);
+ }
+
+ if(debugmode)
+ printf("DEBUG: opening database '%s'\n", line);
+ char *dbpathm = malloc(strlen(line) + 10);
+ sprintf(dbpathm, "_dbpath %s", line);
+ rpmDefineMacro(NULL, dbpathm, RMIL_CMDLINE);
+ free(dbpathm);
+
+ rpmts tsi = rpmtsCreate();
+ (*ts)[count] = tsi;
+ rc = rpmtsOpenDB(tsi, O_RDONLY);
+ if( rc ) {
+ fprintf(stderr, "Failed to open database %s\n", line);
+ rc = -1;
+ break;
+ }
+
+ count++;
+ }
+ }
+ fclose(f);
+ *tsct = count;
+ }
+ else {
+ perror(dblistfn);
+ rc = -1;
+ }
+ }
+ else {
+ if(debugmode)
+ printf("DEBUG: opening database '%s'\n", dblistfn);
+ // Load from single database
+ *ts = malloc(sizeof(rpmts));
+ char *dbpathm = malloc(strlen(dblistfn) + 10);
+ sprintf(dbpathm, "_dbpath %s", dblistfn);
+ rpmDefineMacro(NULL, dbpathm, RMIL_CMDLINE);
+ free(dbpathm);
+
+ rpmts tsi = rpmtsCreate();
+ (*ts)[0] = tsi;
+ rc = rpmtsOpenDB(tsi, O_RDONLY);
+ if( rc ) {
+ fprintf(stderr, "Failed to open database %s\n", dblistfn);
+ rc = -1;
+ }
+ *tsct = 1;
+ }
+
+ return rc;
+}
+
+int processPackages(rpmts *ts, int tscount, const char *packagelistfn, int ignoremissing)
+{
+ int rc = 0;
+ int count = 0;
+ int sz = 100;
+ int i = 0;
+ int missing = 0;
+
+ FILE *f = fopen(packagelistfn, "r" );
+ if(f) {
+ char line[255];
+ while(fgets(line, sizeof(line), f)) {
+ int len = strlen(line) - 1;
+ if(len > 0)
+ // Trim trailing whitespace
+ while(len > 0 && isspace(line[len]))
+ line[len--] = '\0';
+
+ if(len > 0) {
+ int found = 0;
+ for(i=0; i<tscount; i++) {
+ ARGV_t keys = NULL;
+ rpmdb db = rpmtsGetRdb(ts[i]);
+ rc = rpmdbMireApply(db, RPMTAG_NAME,
+ RPMMIRE_STRCMP, line, &keys);
+ if (keys) {
+ int nkeys = argvCount(keys);
+ if( nkeys == 1 ) {
+ char *value = NULL;
+ rc = getPackageStr(ts[i], keys[0], RPMTAG_PACKAGEORIGIN, &value);
+ if(rc == 0)
+ fprintf(outf, "%s\n", value);
+ else
+ fprintf(stderr, "Failed to get package origin for %s\n", line);
+ found = 1;
+ }
+ else if( nkeys > 1 ) {
+ int keyindex = 0;
+ fprintf(stderr, "Multiple matches for %s:\n", line);
+ for( keyindex=0; keyindex<nkeys; keyindex++) {
+ char *value = NULL;
+ rc = getPackageStr(ts[i], keys[keyindex], RPMTAG_PACKAGEORIGIN, &value);
+ if(rc == 0)
+ fprintf(stderr, " %s\n", value);
+ else
+ fprintf(stderr, " (%s)\n", keys[keyindex]);
+ }
+ }
+ }
+ if(found)
+ break;
+ }
+
+ if( !found ) {
+ if( ignoremissing ) {
+ fprintf(stderr, "Unable to resolve package %s - ignoring\n", line);
+ }
+ else {
+ fprintf(stderr, "Unable to resolve package %s\n", line);
+ missing = 1;
+ }
+ }
+ }
+ count++;
+ }
+ fclose(f);
+
+ if( missing ) {
+ fprintf(stderr, "ERROR: some packages were missing\n");
+ rc = 1;
+ }
+ }
+ else {
+ perror(packagelistfn);
+ rc = -1;
+ }
+
+ return rc;
+}
+
+int lookupProvider(rpmts ts, const char *req, char **provider)
+{
+ int rc = 0;
+ rpmmi provmi = rpmmiInit(rpmtsGetRdb(ts), RPMTAG_PROVIDENAME, req, 0);
+ if(provmi) {
+ Header h;
+ if ((h = rpmmiNext(provmi)) != NULL) {
+ HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he));
+ he->tag = RPMTAG_NAME;
+ rc = (headerGet(h, he, 0) != 1);
+ if(rc==0)
+ *provider = strdup((char *)he->p.ptr);
+ }
+ (void)rpmmiFree(provmi);
+ }
+ else {
+ rc = -1;
+ }
+ return rc;
+}
+
+int printDepList(rpmts *ts, int tscount)
+{
+ int rc = 0;
+
+ if( tscount > 1 )
+ fprintf(stderr, ">1 database specified with dependency list, using first only\n");
+
+ /* Get list of names */
+ rpmdb db = rpmtsGetRdb(ts[0]);
+ ARGV_t names = NULL;
+ rc = rpmdbMireApply(db, RPMTAG_NAME,
+ RPMMIRE_STRCMP, NULL, &names);
+ int nnames = argvCount(names);
+
+ /* Get list of NVRAs */
+ ARGV_t keys = NULL;
+ rc = rpmdbMireApply(db, RPMTAG_NVRA,
+ RPMMIRE_STRCMP, NULL, &keys);
+ if (keys) {
+ int i, j;
+ HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he));
+ int nkeys = argvCount(keys);
+ for(i=0; i<nkeys; i++) {
+ rpmmi mi = rpmmiInit(db, RPMTAG_NVRA, keys[i], 0);
+ Header h;
+ if ((h = rpmmiNext(mi)) != NULL) {
+ /* Get name of package */
+ he->tag = RPMTAG_NAME;
+ rc = (headerGet(h, he, 0) != 1);
+ char *name = strdup((char *)he->p.ptr);
+ /* Get its requires */
+ he->tag = RPMTAG_REQUIRENAME;
+ if (rc = (headerGet(h, he, 0) != 1)) {
+ if (debugmode) {
+ printf("DEBUG: %s requires null\n", name);
+ }
+ rc = 0;
+ free(name);
+ (void)rpmmiFree(mi);
+ continue;
+ }
+ ARGV_t reqs = (ARGV_t)he->p.ptr;
+ /* Get its requireflags */
+ he->tag = RPMTAG_REQUIREFLAGS;
+ rc = (headerGet(h, he, 0) != 1);
+ rpmuint32_t *reqflags = (rpmuint32_t *)he->p.ui32p;
+ for(j=0; j<he->c; j++) {
+ int k;
+ char *prov = NULL;
+ for(k=0; k<nnames; k++) {
+ if(strcmp(names[k], reqs[j]) == 0) {
+ prov = names[k];
+ break;
+ }
+ }
+ if(prov) {
+ if((int)reqflags[j] & 0x80000)
+ fprintf(outf, "%s|%s [REC]\n", name, prov);
+ else
+ fprintf(outf, "%s|%s\n", name, prov);
+ }
+ else {
+ rc = lookupProvider(ts[0], reqs[j], &prov);
+ if(rc==0 && prov) {
+ if((int)reqflags[j] & 0x80000)
+ fprintf(outf, "%s|%s [REC]\n", name, prov);
+ else
+ fprintf(outf, "%s|%s\n", name, prov);
+ free(prov);
+ }
+ }
+ }
+ free(name);
+ }
+ (void)rpmmiFree(mi);
+ }
+ }
+
+ return rc;
+}
+
+void usage()
+{
+ fprintf(stderr, "OpenEmbedded rpm resolver utility\n");
+ fprintf(stderr, "syntax: rpmresolve [-i] [-d] [-t] <dblistfile> <packagelistfile>\n");
+}
+
+int main(int argc, char **argv)
+{
+ rpmts *ts = NULL;
+ int tscount = 0;
+ int rc = 0;
+ int i;
+ int c;
+ int ignoremissing = 0;
+ int deplistmode = 0;
+ char *outfile = NULL;
+
+ debugmode = 0;
+ outf = stdout;
+
+ opterr = 0;
+ while ((c = getopt (argc, argv, "itdo:")) != -1) {
+ switch (c) {
+ case 'i':
+ ignoremissing = 1;
+ break;
+ case 't':
+ deplistmode = 1;
+ break;
+ case 'd':
+ debugmode = 1;
+ break;
+ case 'o':
+ outfile = strdup(optarg);
+ break;
+ case '?':
+ if(isprint(optopt))
+ fprintf(stderr, "Unknown option `-%c'.\n", optopt);
+ else
+ fprintf(stderr, "Unknown option character `\\x%x'.\n",
+ optopt);
+ usage();
+ return 1;
+ default:
+ abort();
+ }
+ }
+
+ if( argc - optind < 1 ) {
+ usage();
+ return 1;
+ }
+
+ if( outfile ) {
+ if(debugmode)
+ printf("DEBUG: Using output file %s\n", outfile);
+ outf = fopen(outfile, "w");
+ }
+
+ const char *dblistfn = argv[optind];
+
+ rpmcliInit(argc, argv, NULL);
+
+ if(debugmode)
+ rpmSetVerbosity(RPMLOG_DEBUG);
+
+ rpmDefineMacro(NULL, "__dbi_txn create nofsync", RMIL_CMDLINE);
+
+ rc = loadTs(&ts, &tscount, dblistfn);
+ if( rc )
+ return 1;
+ if( tscount == 0 ) {
+ fprintf(stderr, "Please specify database list file or database location\n");
+ return 1;
+ }
+
+ if(deplistmode) {
+ rc = printDepList(ts, tscount);
+ }
+ else {
+ if( argc - optind < 2 ) {
+ fprintf(stderr, "Please specify package list file\n");
+ }
+ else {
+ const char *pkglistfn = argv[optind+1];
+ rc = processPackages(ts, tscount, pkglistfn, ignoremissing);
+ }
+ }
+
+ for(i=0; i<tscount; i++)
+ (void)rpmtsFree(ts[i]);
+ free(ts);
+
+ if( outfile ) {
+ fclose(outf);
+ free(outfile);
+ }
+
+ return rc;
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpmresolve_1.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpmresolve_1.0.bb
new file mode 100644
index 000000000..0c13a6710
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpmresolve_1.0.bb
@@ -0,0 +1,29 @@
+SUMMARY = "OpenEmbedded RPM resolver utility"
+DESCRIPTION = "OpenEmbedded RPM resolver - performs RPM database lookups in batches to avoid \
+ repeated invocations of rpm on the command line."
+DEPENDS = "rpm"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+PR = "r2"
+
+SRC_URI = "file://rpmresolve.c"
+
+S = "${WORKDIR}"
+
+do_compile() {
+ ${CC} ${CFLAGS} -ggdb -I${STAGING_INCDIR}/rpm ${LDFLAGS} rpmresolve.c -o rpmresolve -lrpmbuild -lrpm -lrpmio -lrpmdb
+}
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 rpmresolve ${D}${bindir}
+}
+
+do_install_append_class-native() {
+ create_wrapper ${D}/${bindir}/rpmresolve \
+ RPM_USRLIBRPM=${STAGING_LIBDIR_NATIVE}/rpm \
+ RPM_ETCRPM=${STAGING_ETCDIR_NATIVE}/rpm \
+ RPM_LOCALEDIRRPM=${STAGING_DATADIR_NATIVE}/locale
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rsync/files/makefile-no-rebuild.patch b/import-layers/yocto-poky/meta/recipes-devtools/rsync/files/makefile-no-rebuild.patch
new file mode 100644
index 000000000..3d27fe72c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/rsync/files/rsyncd.conf b/import-layers/yocto-poky/meta/recipes-devtools/rsync/files/rsyncd.conf
new file mode 100644
index 000000000..845f5b33f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync-2.6.9/rsync-2.6.9-fname-obo.patch b/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync-2.6.9/rsync-2.6.9-fname-obo.patch
new file mode 100644
index 000000000..bea325ea0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync-2.6.9/rsync-2.6.9-fname-obo.patch
@@ -0,0 +1,71 @@
+Upstream-Status: Backport [ The patch is rsync-2.6.9 specific ]
+CVE: CVE-2007-4091
+
+The patch is from https://issues.rpath.com/browse/RPL-1647 and is used to
+address http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2007-4091
+
+Date: Tue May 10 10:07:36 2011 +0800
+Dexuan Cui <dexuan.cui@intel.com>
+
+diff --git a/sender.c b/sender.c
+index 6fcaa65..053a8f1 100644
+--- a/sender.c
++++ b/sender.c
+@@ -123,6 +123,7 @@ void successful_send(int ndx)
+ char fname[MAXPATHLEN];
+ struct file_struct *file;
+ unsigned int offset;
++ size_t l = 0;
+
+ if (ndx < 0 || ndx >= the_file_list->count)
+ return;
+@@ -133,6 +134,20 @@ void successful_send(int ndx)
+ file->dir.root, "/", NULL);
+ } else
+ offset = 0;
++
++ l = offset + 1;
++ if (file) {
++ if (file->dirname)
++ l += strlen(file->dirname);
++ if (file->basename)
++ l += strlen(file->basename);
++ }
++
++ if (l >= sizeof(fname)) {
++ rprintf(FERROR, "Overlong pathname\n");
++ exit_cleanup(RERR_FILESELECT);
++ }
++
+ f_name(file, fname + offset);
+ if (remove_source_files) {
+ if (do_unlink(fname) == 0) {
+@@ -224,6 +239,7 @@ void send_files(struct file_list *flist, int f_out, int f_in)
+ enum logcode log_code = log_before_transfer ? FLOG : FINFO;
+ int f_xfer = write_batch < 0 ? batch_fd : f_out;
+ int i, j;
++ size_t l = 0;
+
+ if (verbose > 2)
+ rprintf(FINFO, "send_files starting\n");
+@@ -259,6 +275,20 @@ void send_files(struct file_list *flist, int f_out, int f_in)
+ fname[offset++] = '/';
+ } else
+ offset = 0;
++
++ l = offset + 1;
++ if (file) {
++ if (file->dirname)
++ l += strlen(file->dirname);
++ if (file->basename)
++ l += strlen(file->basename);
++ }
++
++ if (l >= sizeof(fname)) {
++ rprintf(FERROR, "Overlong pathname\n");
++ exit_cleanup(RERR_FILESELECT);
++ }
++
+ fname2 = f_name(file, fname + offset);
+
+ if (verbose > 2)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync-2.6.9/rsyncd.conf b/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync-2.6.9/rsyncd.conf
new file mode 100644
index 000000000..845f5b33f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync-2.6.9/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/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync.inc b/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync.inc
new file mode 100644
index 000000000..c65f27031
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync.inc
@@ -0,0 +1,23 @@
+SUMMARY = "File synchronization tool"
+HOMEPAGE = "http://rsync.samba.org/"
+BUGTRACKER = "http://rsync.samba.org/bugzilla.html"
+SECTION = "console/network"
+
+# GPLv2+ (<< 3.0.0), GPLv3+ (>= 3.0.0)
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+# needs to add acl and attr
+DEPENDS = "popt"
+
+SRC_URI = "http://rsync.samba.org/ftp/rsync/src/rsync-${PV}.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=""'
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync_2.6.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync_2.6.9.bb
new file mode 100644
index 000000000..6854c77f7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync_2.6.9.bb
@@ -0,0 +1,28 @@
+SUMMARY = "File synchronization tool"
+HOMEPAGE = "http://rsync.samba.org/"
+BUGTRACKER = "http://rsync.samba.org/bugzilla.html"
+SECTION = "console/network"
+
+# needs to add acl and attr
+DEPENDS = "popt"
+
+SRC_URI = "http://rsync.samba.org/ftp/rsync/src/rsync-${PV}.tar.gz \
+ file://rsync-2.6.9-fname-obo.patch \
+ file://rsyncd.conf"
+
+SRC_URI[md5sum] = "996d8d8831dbca17910094e56dcb5942"
+SRC_URI[sha256sum] = "ca437301becd890e73300bc69a39189ff1564baa761948ff149b3dd7bde633f9"
+
+inherit autotools
+
+do_install_append() {
+ install -d ${D}${sysconfdir}
+ install -m 0644 ${WORKDIR}/rsyncd.conf ${D}${sysconfdir}
+}
+
+EXTRA_OEMAKE='STRIP=""'
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6d5a9d4c4d3af25cd68fd83e8a8cb09c"
+
+PR = "r4"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync_3.1.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync_3.1.2.bb
new file mode 100644
index 000000000..9637ed4e7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync_3.1.2.bb
@@ -0,0 +1,26 @@
+require rsync.inc
+
+SRC_URI += "file://makefile-no-rebuild.patch"
+
+SRC_URI[md5sum] = "0f758d7e000c0f7f7d3792610fad70cb"
+SRC_URI[sha256sum] = "ecfa62a7fa3c4c18b9eccd8c16eaddee4bd308a76ea50b5c02a5840f09c0a1c2"
+
+PACKAGECONFIG ??= "acl attr"
+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/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby.inc b/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby.inc
new file mode 100644
index 000000000..313e75222
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby.inc
@@ -0,0 +1,38 @@
+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=837b32593517ae48b9c3b5c87a5d288c \
+ file://BSDL;md5=19aaf65c88a40b508d17ae4be539c4b5\
+ file://GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263\
+ file://LEGAL;md5=c440adb575ba4e6e2344c2630b6a5584\
+"
+
+DEPENDS = "ruby-native zlib openssl tcl libyaml db 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 \
+"
+
+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/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby/extmk.patch b/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby/extmk.patch
new file mode 100644
index 000000000..8b6845034
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby/extmk.patch
@@ -0,0 +1,13 @@
+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
+@@ -354,8 +354,8 @@
+ $ruby = '$(topdir)/miniruby' + EXEEXT
+ end
+ $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
+ $ruby << " -I./- -I'$(top_srcdir)/ext' -rpurelib.rb"
+ ENV["RUBYLIB"] = "-"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby_2.2.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby_2.2.2.bb
new file mode 100644
index 000000000..671502356
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby_2.2.2.bb
@@ -0,0 +1,46 @@
+require ruby.inc
+
+SRC_URI[md5sum] = "326e99ddc75381c7b50c85f7089f3260"
+SRC_URI[sha256sum] = "5ffc0f317e429e6b29d4a98ac521c3ce65481bfd22a8cf845fa02a7b113d9b44"
+
+# 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.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}"
+
+PACKAGECONFIG[valgrind] = "--with-valgrind=yes, --with-valgrind=no, valgrind"
+PACKAGECONFIG[gpm] = "--with-gmp=yes, --with-gmp=no, gmp"
+PACKAGECONFIG[ipv6] = ",--enable-wide-getaddrinfo,"
+
+EXTRA_OECONF = "\
+ --disable-versioned-paths \
+ --disable-rpath \
+ --disable-dtrace \
+ --enable-shared \
+ --enable-load-relative \
+"
+
+EXTRA_OEMAKE = " \
+ LIBRUBYARG='-lruby-static' \
+"
+
+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/import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts b/import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
new file mode 100755
index 000000000..53a8e1db0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
@@ -0,0 +1,92 @@
+#!/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-posinsts.
+
+# 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"
+
+ [ -d $pi_dir ] && break
+
+ case $pm in
+ "deb")
+ if [ -s "#LOCALSTATEDIR#/lib/dpkg/status" ]; then
+ pm_installed=true
+ break
+ fi
+ ;;
+
+ "ipk")
+ if [ -s "/var/lib/opkg/status" ]; then
+ pm_installed=true
+ break
+ fi
+ ;;
+ esac
+done
+
+remove_rcsd_link () {
+ if [ -n "`which update-rc.d`" ]; then
+ update-rc.d -f run-postinsts remove
+ fi
+}
+
+if [ -z "$pi_dir" ]; then
+ remove_rcsd_link
+ exit 0
+fi
+
+[ -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/import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.init b/import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.init
new file mode 100644
index 000000000..473a1f7f6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.init
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+run-postinsts
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.service b/import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.service
new file mode 100644
index 000000000..85a043949
--- /dev/null
+++ b/import-layers/yocto-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 disable run-postinsts.service
+RemainAfterExit=No
+TimeoutSec=0
+
+[Install]
+WantedBy=sysinit.target
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts_1.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts_1.0.bb
new file mode 100644
index 000000000..11c94e57d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts_1.0.bb
@@ -0,0 +1,45 @@
+SUMMARY = "Runs postinstall scripts on first boot of the target device"
+SECTION = "devel"
+PR = "r9"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+ 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/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common-0.6.3/autohell.patch b/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common-0.6.3/autohell.patch
new file mode 100644
index 000000000..1f39b0330
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common-0.6.3/autohell.patch
@@ -0,0 +1,61 @@
+Patch obtained from OpenEmbedded.
+
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- sgml-common-0.6.3/bin/Makefile.am~autohell.patch 2001-01-30 15:42:21.000000000 +0100
++++ sgml-common-0.6.3/bin/Makefile.am 2004-06-17 11:51:11.000000000 +0200
+@@ -1,6 +1,5 @@
+ primitive_scripts = sgmlwhich
+
+-bindir = $(prefix)/bin
+ bin_SCRIPTS = install-catalog $(primitive_scripts)
+
+ EXTRA_DIST = install-catalog.in $(primitive_scripts)
+--- /dev/null 2003-09-23 19:59:22.000000000 +0200
++++ sgml-common-0.6.3/bin/sgmlwhich.in 2004-06-17 11:51:11.000000000 +0200
+@@ -0,0 +1,7 @@
++#!/bin/sh
++# Location of the main configuration file for consistency with non-LSB platforms
++# Send any comments to Eric Bischoff <eric@caldera.de>
++# This program is under GPL license. See LICENSE file for details.
++
++echo "@sysconfdir@/sgml/sgml.conf"
++# Simple, isn't it? ;-)
+--- /dev/null 2003-09-23 19:59:22.000000000 +0200
++++ sgml-common-0.6.3/config/sgml.conf.in 2004-06-17 11:51:11.000000000 +0200
+@@ -0,0 +1,2 @@
++SGML_BASE_DIR=@datadir@/sgml
++SGML_CATALOGS_DIR=@sysconfdir@/sgml
+--- sgml-common-0.6.3/configure.in~autohell.patch 2001-05-25 18:40:54.000000000 +0200
++++ sgml-common-0.6.3/configure.in 2004-06-17 11:53:22.000000000 +0200
+@@ -3,11 +3,6 @@
+
+ AM_INIT_AUTOMAKE(sgml-common, 0.6.3)
+
+-docdir='$(prefix)/doc'
+-AC_SUBST(docdir)
+-
+-dnl Checks for programs.
+-
+ dnl Checks for libraries.
+
+ dnl Checks for header files.
+@@ -18,6 +13,5 @@
+
+ AC_OUTPUT(Makefile \
+ bin/Makefile bin/install-catalog \
+- config/Makefile \
+- doc/Makefile doc/HTML/Makefile doc/man/Makefile doc/refentry/Makefile \
++ config/Makefile config/sgml.conf bin/sgmlwhich \
+ sgml-iso-entities/Makefile xml-iso-entities/Makefile)
+
+--- sgml-common-0.6.3/Makefile.am~no-docs 2001-05-25 18:22:01.000000000 +0200
++++ sgml-common-0.6.3/Makefile.am 2004-06-17 11:49:09.000000000 +0200
+@@ -1,4 +1,4 @@
+-SUBDIRS = bin config doc sgml-iso-entities xml-iso-entities
++SUBDIRS = bin config sgml-iso-entities xml-iso-entities
+
+ sgmlcodir = $(prefix)/share/sgml
+ sgmlco_DATA = xml.dcl
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common-0.6.3/license.patch b/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common-0.6.3/license.patch
new file mode 100644
index 000000000..54b3f5449
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common-0.6.3/license.patch
@@ -0,0 +1,29 @@
+The COPYING file sgml-common ships with is just a symlink to
+/usr/share/automake/COPYING, which means we can't verify it
+using our normal means. We workaround this by using this patch
+to create our own license file.
+
+Upstream was notified about this on 2011-01-24. When upgrading
+this recipe, this should be fixed and you should remove this
+patch.
+
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+diff -urN sgml-common-0.6.3.orig/LICENSE-GPLv2 sgml-common-0.6.3/LICENSE-GPLv2
+--- sgml-common-0.6.3.orig/LICENSE-GPLv2 1969-12-31 16:00:00.000000000 -0800
++++ sgml-common-0.6.3/LICENSE-GPLv2 2011-01-28 17:05:17.299528001 -0800
+@@ -0,0 +1,12 @@
++Copyright (C) 1997 Christian Schwarz <schwarz@debian.org>.
++Copyright (C) 2001-2004 Ardo van Rangelrooij <ardo@debian.org>
++
++This is free software; you may 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 is distributed in the hope that it will be useful, but without
++any warranty; without even the implied warranty of merchantability or
++fitness for a particular purpose. See the GNU General Public License
++for more details.
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common-native_0.6.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common-native_0.6.3.bb
new file mode 100644
index 000000000..597536570
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common-native_0.6.3.bb
@@ -0,0 +1,71 @@
+SUMMARY = "Base utilities for working with SGML and XML"
+DESCRIPTION = "The sgml-common package gathers very basic \
+stuff necessary to work with SGML and XML, such as xml.dcl, \
+a SGML declaration of XML; iso-entities, a list of the basic \
+SGML ISO entities; and install-catalog, a script used to \
+add entries to (or remove entries from) centralized catalogs \
+whose entries are pointers to SGML open catalogs, \
+as defined by OASIS."
+HOMEPAGE = "http://sources.redhat.com/docbook-tools/"
+LICENSE = "GPLv2+"
+# See the comments in license.patch when upgrading this recipe.
+# This is inteded to be a temporary workaround.
+LIC_FILES_CHKSUM = "file://LICENSE-GPLv2;md5=ab8a50abe86dfc859e148baae043c89b"
+SECTION = "base"
+
+PR = "r1"
+
+require sgml-common_${PV}.bb
+inherit native
+
+S = "${WORKDIR}/sgml-common-${PV}"
+
+SYSROOT_PREPROCESS_FUNCS += "sgml_common_native_mangle"
+SSTATEPOSTINSTFUNCS += "sgml_common_sstate_postinst"
+CLEANFUNCS += "sgml_common_sstate_clean"
+
+
+do_install_append() {
+ # install-catalog script contains hard-coded references to
+ # {sysconfdir}. Change it to ${D}${sysconfdir}.
+ sed -i -e "s|${sysconfdir}/sgml|${D}${sysconfdir}/sgml|g" ${D}${bindir}/install-catalog
+
+ ${D}${bindir}/install-catalog \
+ --add ${D}${sysconfdir}/sgml/sgml-ent.cat \
+ ${D}${datadir}/sgml/sgml-iso-entities-8879.1986/catalog
+
+ # The sgml-docbook.cat will be regenerated by sstate_postinst
+ rm -f ${D}${sysconfdir}/sgml/sgml-docbook.cat
+}
+
+sgml_common_native_mangle () {
+ # Revert back to ${sysconfdir} path in install-catalog
+ sed -i -e "s|${D}${sysconfdir}/sgml|${sysconfdir}/sgml|g" ${SYSROOT_DESTDIR}${STAGING_BINDIR}/install-catalog
+ # Change path from ${D}${datadir}/sgml/sgml-iso-entities-8879.1986/catalog to ${datadir}/sgml/sgml-iso-entities-8879.1986/catalog in sgml-ent.cat
+ sed -i -e "s|${D}${datadir}/sgml/sgml-iso-entities-8879.1986/catalog|${datadir}/sgml/sgml-iso-entities-8879.1986/catalog|g" ${SYSROOT_DESTDIR}${sysconfdir}/sgml/sgml-ent.cat
+ # Remove ${D} path from catalog file created by install-catalog script
+ sed -i -e "s|${D}||g" ${SYSROOT_DESTDIR}${sysconfdir}/sgml/catalog
+}
+
+sgml_common_sstate_postinst() {
+ if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
+ then
+ ${bindir}/install-catalog --add ${sysconfdir}/sgml/sgml-docbook.cat ${sysconfdir}/sgml/sgml-ent.cat
+ if [ -e ${sysconfdir}/sgml/sgml-docbook.bak ]; then
+ for catalog in `awk '{print $2}' ${sysconfdir}/sgml/sgml-docbook.bak`; do
+ if [ ! `grep $catalog ${sysconfdir}/sgml/sgml-docbook.cat 1> /dev/null 2>&1` ]; then
+ ${bindir}/install-catalog \
+ --add ${sysconfdir}/sgml/sgml-docbook.cat $catalog
+ fi
+ done
+ fi
+ fi
+}
+
+sgml_common_sstate_clean () {
+ # Ensure that the catalog file sgml-docbook.cat is properly
+ # updated when the package is removed from sstate cache.
+ if [ -f ${sysconfdir}/sgml/sgml-docbook.cat ]; then
+ sed -i '/\/sgml\/sgml-ent.cat/d' ${sysconfdir}/sgml/sgml-docbook.cat
+ fi
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common_0.6.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common_0.6.3.bb
new file mode 100644
index 000000000..6098673a3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common_0.6.3.bb
@@ -0,0 +1,68 @@
+SUMMARY = "Base utilities for working with SGML and XML"
+DESCRIPTION = "The sgml-common package gathers very basic \
+stuff necessary to work with SGML and XML, such as xml.dcl, \
+a SGML declaration of XML; iso-entities, a list of the basic \
+SGML ISO entities; and install-catalog, a script used to \
+add entries to (or remove entries from) centralized catalogs \
+whose entries are pointers to SGML open catalogs, \
+as defined by OASIS."
+HOMEPAGE = "http://sources.redhat.com/docbook-tools/"
+LICENSE = "GPLv2+"
+# See the comments in license.patch when upgrading this recipe.
+# This is inteded to be a temporary workaround.
+LIC_FILES_CHKSUM = "file://LICENSE-GPLv2;md5=ab8a50abe86dfc859e148baae043c89b"
+SECTION = "base"
+
+PR = "r1"
+
+SRC_URI = "ftp://sources.redhat.com/pub/docbook-tools/new-trials/SOURCES/sgml-common-${PV}.tgz \
+ file://autohell.patch \
+ file://license.patch"
+
+SRC_URI[md5sum] = "103c9828f24820df86e55e7862e28974"
+SRC_URI[sha256sum] = "7dc418c1d361123ffc5e45d61f1b97257940a8eb35d0bfbbc493381cc5b1f959"
+
+inherit autotools
+
+do_compile_append() {
+ # install-catalog script contains hardcoded references to /etc/sgml
+ sed -i -e 's|\([ "]\+\)/etc/sgml|\1${sysconfdir}/sgml|g' bin/install-catalog
+}
+
+FILES_${PN} += "${datadir}/sgml"
+
+pkg_postinst_${PN}() {
+ if [ "x$D" = "x" ]; then
+ install-catalog \
+ --add ${sysconfdir}/sgml/sgml-ent.cat \
+ ${datadir}/sgml/sgml-iso-entities-8879.1986/catalog
+
+ install-catalog \
+ --add ${sysconfdir}/sgml/sgml-docbook.cat \
+ ${sysconfdir}/sgml/sgml-ent.cat
+ else
+ if ! grep -q ${datadir}/sgml/sgml-iso-entities-8879.1986/catalog $D${sysconfdir}/sgml/sgml-ent.cat; then
+ echo "CATALOG ${datadir}/sgml/sgml-iso-entities-8879.1986/catalog" >> $D${sysconfdir}/sgml/sgml-ent.cat
+ fi
+ if ! grep -q ${sysconfdir}/sgml/sgml-ent.cat $D${sysconfdir}/sgml/catalog; then
+ echo "CATALOG ${sysconfdir}/sgml/sgml-ent.cat" >> $D${sysconfdir}/sgml/catalog
+ fi
+
+ if ! grep -q ${sysconfdir}/sgml/sgml-ent.cat $D${sysconfdir}/sgml/sgml-docbook.cat; then
+ echo "CATALOG ${sysconfdir}/sgml/sgml-ent.cat" >> $D${sysconfdir}/sgml/sgml-docbook.cat
+ fi
+ if ! grep -q ${sysconfdir}/sgml/sgml-docbook.cat $D${sysconfdir}/sgml/catalog; then
+ echo "CATALOG ${sysconfdir}/sgml/sgml-docbook.cat" >> $D${sysconfdir}/sgml/catalog
+ fi
+ fi
+}
+
+pkg_postrm_${PN}() {
+ install-catalog \
+ --remove ${sysconfdir}/sgml/sgml-ent.cat \
+ ${datadir}/sgml/sgml-iso-entities-8879.1986/catalog
+
+ install-catalog \
+ --remove ${sysconfdir}/sgml/sgml-docbook.cat \
+ ${sysconfdir}/sgml/sgml-ent.cat
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/sgmlspl/sgmlspl-native_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/sgmlspl/sgmlspl-native_git.bb
new file mode 100644
index 000000000..01581c14c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/sgmlspl/sgmlspl-native_git.bb
@@ -0,0 +1,21 @@
+SUMMARY = "A simple post-processor for SGMLS and NSGMLS"
+HOMEPAGE = "https://github.com/gitpan/SGMLSpm"
+SECTION = "libs"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=18810669f13b87348459e611d31ab760"
+
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
+SRC_URI = "git://github.com/gitpan/SGMLSpm \
+ "
+
+SRCREV = "71595b9b5e36bfc00046995e058926bd27793fef"
+
+PV = "1.1+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+inherit native cpan
+
+do_install_append() {
+ ln -s sgmlspl.pl ${D}${bindir}/sgmlspl
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/squashfs-tools/squashfs-tools/0001-mksquashfs.c-get-inline-functions-work-with-C99.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/squashfs-tools/squashfs-tools/fix-compat.patch b/import-layers/yocto-poky/meta/recipes-devtools/squashfs-tools/squashfs-tools/fix-compat.patch
new file mode 100644
index 000000000..d54514691
--- /dev/null
+++ b/import-layers/yocto-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
+@@ -1286,6 +1286,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
+@@ -38,6 +38,10 @@
+ #include <limits.h>
+ #include <ctype.h>
+
++#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/import-layers/yocto-poky/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
new file mode 100644
index 000000000..33ed09ae8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
@@ -0,0 +1,39 @@
+# 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://fix-compat.patch \
+"
+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/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-Move-gcc-compat-macros-to-gcc_compat.h.patch b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-Move-gcc-compat-macros-to-gcc_compat.h.patch
new file mode 100644
index 000000000..aa61e15c8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-Move-gcc-compat-macros-to-gcc_compat.h.patch
@@ -0,0 +1,176 @@
+From f32126ba790dd4e61d43a2140b24f02426297bb6 Mon Sep 17 00:00:00 2001
+From: "Dmitry V. Levin" <ldv@altlinux.org>
+Date: Thu, 31 Dec 2015 14:19:41 +0000
+Subject: [PATCH] Move gcc compat macros to gcc_compat.h
+
+* defs.h: Include "gcc_compat.h".
+(GNUC_PREREQ, ATTRIBUTE_NORETURN, ATTRIBUTE_FORMAT,
+ATTRIBUTE_ALIGNED, ATTRIBUTE_PACKED, ATTRIBUTE_MALLOC,
+ATTRIBUTE_NOINLINE, ATTRIBUTE_ALLOC_SIZE): Move ...
+* gcc_compat.h: ... here.
+* Makefile.am (strace_SOURCES): Add gcc_compat.h.
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport
+
+ Makefile.am | 1 +
+ defs.h | 43 +----------------------------------
+ gcc_compat.h | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 75 insertions(+), 42 deletions(-)
+ create mode 100644 gcc_compat.h
+
+diff --git a/Makefile.am b/Makefile.am
+index ab52778..d43608d 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -97,6 +97,7 @@ strace_SOURCES = \
+ flock.c \
+ flock.h \
+ futex.c \
++ gcc_compat.h \
+ get_robust_list.c \
+ getcpu.c \
+ getcwd.c \
+diff --git a/defs.h b/defs.h
+index 283ab1f..bae212c 100644
+--- a/defs.h
++++ b/defs.h
+@@ -55,6 +55,7 @@
+ #include <sys/syscall.h>
+
+ #include "mpers_type.h"
++#include "gcc_compat.h"
+
+ #ifndef HAVE_STRERROR
+ const char *strerror(int);
+@@ -68,48 +69,6 @@ const char *strerror(int);
+ extern char *stpcpy(char *dst, const char *src);
+ #endif
+
+-#if defined __GNUC__ && defined __GNUC_MINOR__
+-# define GNUC_PREREQ(maj, min) \
+- ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+-#else
+-# define __attribute__(x) /* empty */
+-# define GNUC_PREREQ(maj, min) 0
+-#endif
+-
+-#if GNUC_PREREQ(2, 5)
+-# define ATTRIBUTE_NORETURN __attribute__((__noreturn__))
+-#else
+-# define ATTRIBUTE_NORETURN /* empty */
+-#endif
+-
+-#if GNUC_PREREQ(2, 7)
+-# define ATTRIBUTE_FORMAT(args) __attribute__((__format__ args))
+-# define ATTRIBUTE_ALIGNED(arg) __attribute__((__aligned__(arg)))
+-# define ATTRIBUTE_PACKED __attribute__((__packed__))
+-#else
+-# define ATTRIBUTE_FORMAT(args) /* empty */
+-# define ATTRIBUTE_ALIGNED(arg) /* empty */
+-# define ATTRIBUTE_PACKED /* empty */
+-#endif
+-
+-#if GNUC_PREREQ(3, 0)
+-# define ATTRIBUTE_MALLOC __attribute__((__malloc__))
+-#else
+-# define ATTRIBUTE_MALLOC /* empty */
+-#endif
+-
+-#if GNUC_PREREQ(3, 1)
+-# define ATTRIBUTE_NOINLINE __attribute__((__noinline__))
+-#else
+-# define ATTRIBUTE_NOINLINE /* empty */
+-#endif
+-
+-#if GNUC_PREREQ(4, 3)
+-# define ATTRIBUTE_ALLOC_SIZE(args) __attribute__((__alloc_size__ args))
+-#else
+-# define ATTRIBUTE_ALLOC_SIZE(args) /* empty */
+-#endif
+-
+ #ifndef offsetof
+ # define offsetof(type, member) \
+ (((char *) &(((type *) NULL)->member)) - ((char *) (type *) NULL))
+diff --git a/gcc_compat.h b/gcc_compat.h
+new file mode 100644
+index 0000000..1f2c835
+--- /dev/null
++++ b/gcc_compat.h
+@@ -0,0 +1,73 @@
++/*
++ * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
++ * 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 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.
++ */
++
++#ifndef GCC_COMPAT_H_
++#define GCC_COMPAT_H_
++
++#if defined __GNUC__ && defined __GNUC_MINOR__
++# define GNUC_PREREQ(maj, min) \
++ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
++#else
++# define __attribute__(x) /* empty */
++# define GNUC_PREREQ(maj, min) 0
++#endif
++
++#if GNUC_PREREQ(2, 5)
++# define ATTRIBUTE_NORETURN __attribute__((__noreturn__))
++#else
++# define ATTRIBUTE_NORETURN /* empty */
++#endif
++
++#if GNUC_PREREQ(2, 7)
++# define ATTRIBUTE_FORMAT(args) __attribute__((__format__ args))
++# define ATTRIBUTE_ALIGNED(arg) __attribute__((__aligned__(arg)))
++# define ATTRIBUTE_PACKED __attribute__((__packed__))
++#else
++# define ATTRIBUTE_FORMAT(args) /* empty */
++# define ATTRIBUTE_ALIGNED(arg) /* empty */
++# define ATTRIBUTE_PACKED /* empty */
++#endif
++
++#if GNUC_PREREQ(3, 0)
++# define ATTRIBUTE_MALLOC __attribute__((__malloc__))
++#else
++# define ATTRIBUTE_MALLOC /* empty */
++#endif
++
++#if GNUC_PREREQ(3, 1)
++# define ATTRIBUTE_NOINLINE __attribute__((__noinline__))
++#else
++# define ATTRIBUTE_NOINLINE /* empty */
++#endif
++
++#if GNUC_PREREQ(4, 3)
++# define ATTRIBUTE_ALLOC_SIZE(args) __attribute__((__alloc_size__ args))
++#else
++# define ATTRIBUTE_ALLOC_SIZE(args) /* empty */
++#endif
++
++#endif
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-arc-metag-nios2-or1k-tile-fix-build.patch b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-arc-metag-nios2-or1k-tile-fix-build.patch
new file mode 100644
index 000000000..a9d32037b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-arc-metag-nios2-or1k-tile-fix-build.patch
@@ -0,0 +1,117 @@
+From dd1a80c8d213eed95fe55b7ebcb07ee165dd8e4b Mon Sep 17 00:00:00 2001
+From: "Dmitry V. Levin" <ldv@altlinux.org>
+Date: Thu, 24 Dec 2015 15:40:55 +0000
+Subject: [PATCH] arc, metag, nios2, or1k, tile: fix build
+
+Fix build regression introduced by commit
+34683e3926d8c2daa368afb805da422ee7043396.
+
+* linux/32/syscallent.h: Add sys_ prefix to ARCH_mmap and mmap.
+* linux/arc/syscallent.h: Add sys_ prefix to ARCH_mmap and mmap_pgoff.
+* linux/nios2/syscallent.h: Likewise.
+* linux/or1k/syscallent.h: Likewise.
+* linux/tile/syscallent1.h: Add sys_ prefix to ARCH_mmap and sys_mmap_4koff.
+* pathtrace.c (pathtrace_match): Handle SEN_ARCH_mmap.
+* NEWS: Mention this build fix.
+
+Reported-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
+Signed-off-by: Marek Vasut <marex@denx.de>
+Upstream-Status: Backport
+---
+ NEWS | 3 +++
+ linux/32/syscallent.h | 6 +++---
+ linux/arc/syscallent.h | 2 +-
+ linux/nios2/syscallent.h | 2 +-
+ linux/or1k/syscallent.h | 2 +-
+ linux/tile/syscallent1.h | 2 +-
+ pathtrace.c | 1 +
+ 7 files changed, 11 insertions(+), 7 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index fe40ca4..09263eb 100644
+--- a/NEWS
++++ b/NEWS
+@@ -1,3 +1,9 @@
++Noteworthy changes in release ?.?? (????-??-??)
++===============================================
++
++* Bug fixes
++ * Fixed build on arc, metag, nios2, or1k, and tile architectures.
++
+ Noteworthy changes in release 4.11 (2015-12-21)
+ ===============================================
+
+diff --git a/linux/32/syscallent.h b/linux/32/syscallent.h
+index 5f997e7..e6f895c 100644
+--- a/linux/32/syscallent.h
++++ b/linux/32/syscallent.h
+@@ -1,5 +1,5 @@
+-#ifndef ARCH_mmap
+-# define ARCH_mmap mmap
++#ifndef sys_ARCH_mmap
++# define sys_ARCH_mmap sys_mmap
+ #endif
+ [ 0] = { 2, 0, SEN(io_setup), "io_setup" },
+ [ 1] = { 1, 0, SEN(io_destroy), "io_destroy" },
+@@ -276,5 +276,5 @@
+ [283] = { 2, 0, SEN(membarrier), "membarrier", },
+ [284] = { 3, TM, SEN(mlock2), "mlock2" },
+
+-#undef ARCH_mmap
++#undef sys_ARCH_mmap
+ #undef ARCH_WANT_SYNC_FILE_RANGE2
+diff --git a/linux/arc/syscallent.h b/linux/arc/syscallent.h
+index 5847dc4..1100008 100644
+--- a/linux/arc/syscallent.h
++++ b/linux/arc/syscallent.h
+@@ -1,4 +1,4 @@
+-#define ARCH_mmap mmap_pgoff
++#define sys_ARCH_mmap sys_mmap_pgoff
+ #include "32/syscallent.h"
+ [244] = { 3, 0, SEN(printargs), "arc_cacheflush"},
+ [245] = { 1, 0, SEN(printargs), "arc_settls" },
+diff --git a/linux/nios2/syscallent.h b/linux/nios2/syscallent.h
+index 8a4b70e..01efe3a 100644
+--- a/linux/nios2/syscallent.h
++++ b/linux/nios2/syscallent.h
+@@ -1,4 +1,4 @@
+-#define ARCH_mmap mmap_pgoff
++#define sys_ARCH_mmap sys_mmap_pgoff
+ #include "32/syscallent.h"
+ [244] = {4, 0, SEN(cacheflush), "cacheflush"},
+ [245 ... 259] = { },
+diff --git a/linux/or1k/syscallent.h b/linux/or1k/syscallent.h
+index ed84b3b..351fe25 100644
+--- a/linux/or1k/syscallent.h
++++ b/linux/or1k/syscallent.h
+@@ -1,4 +1,4 @@
+-#define ARCH_mmap mmap_pgoff
++#define sys_ARCH_mmap sys_mmap_pgoff
+ #include "32/syscallent.h"
+ [244] = { 3, NF, SEN(or1k_atomic), "or1k_atomic" },
+ [245 ... 259] = { },
+diff --git a/linux/tile/syscallent1.h b/linux/tile/syscallent1.h
+index c86f059..28dbab4 100644
+--- a/linux/tile/syscallent1.h
++++ b/linux/tile/syscallent1.h
+@@ -1,4 +1,4 @@
+-#define ARCH_mmap mmap_4koff
++#define sys_ARCH_mmap sys_mmap_4koff
+ #define ARCH_WANT_SYNC_FILE_RANGE2 1
+ #include "32/syscallent.h"
+ [244] = { 1, 0, SEN(printargs), "cmpxchg_badaddr" },
+diff --git a/pathtrace.c b/pathtrace.c
+index d530ec2..e72cdf7 100644
+--- a/pathtrace.c
++++ b/pathtrace.c
+@@ -216,6 +216,7 @@ pathtrace_match(struct tcb *tcp)
+ case SEN_mmap:
+ case SEN_mmap_4koff:
+ case SEN_mmap_pgoff:
++ case SEN_ARCH_mmap:
+ /* x, x, x, x, fd */
+ return fdmatch(tcp, tcp->u_arg[4]);
+
+--
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-scm_rights-fd.test-rewrite-without-fork.patch b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-scm_rights-fd.test-rewrite-without-fork.patch
new file mode 100644
index 000000000..c4e645b81
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-scm_rights-fd.test-rewrite-without-fork.patch
@@ -0,0 +1,198 @@
+From 3fdcdd47c6a67585123a0a0c8fffabcc9f79a3a2 Mon Sep 17 00:00:00 2001
+From: "Dmitry V. Levin" <ldv@altlinux.org>
+Date: Tue, 12 Jan 2016 14:47:12 +0000
+Subject: [PATCH] scm_rights-fd.test: rewrite without fork
+
+* tests/scm_rights.c (main): Rewrite without fork.
+Place all objects passed to sendmsg and recvmsg at the end
+of memory pages followed by inaccessible pages.
+* tests/scm_rights-fd.test: Update.
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport
+
+ tests/scm_rights-fd.test | 12 ++---
+ tests/scm_rights.c | 122 ++++++++++++++++++++++-------------------------
+ 2 files changed, 63 insertions(+), 71 deletions(-)
+
+diff --git a/tests/scm_rights-fd.test b/tests/scm_rights-fd.test
+index a32ef36..48c5028 100755
+--- a/tests/scm_rights-fd.test
++++ b/tests/scm_rights-fd.test
+@@ -49,18 +49,18 @@ touch -- "$file" ||
+ framework_skip_ 'failed to create a file'
+
+ run_prog ./scm_rights /dev/zero
+-run_strace_merge -y -x -enetwork $args "$file"
++run_strace -y -x -enetwork $args "$file"
+
++sample='\\xf1\\xf2\\xf3\\xf4\\xf5\\xf6\\xf7\\xf8\\xf9\\xfa\\xfb\\xfc\\xfd\\xfe\\xff'
+ n='[1-9][0-9]*'
+-msg='\{msg_name\(0\)=NULL, msg_iov\(1\)=\[\{"\\x00\\x00\\x00\\x00[^"]*", '"$n"'\}\], msg_controllen='"$n"
+-rights='\{cmsg_len='"$n"', cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, \[3</dev/null>, 4</dev/zero>, 5</[^}>]*/(A\\n){127}Z>\]\}'
++msg='\{msg_name\(0\)=NULL, msg_iov\(1\)=\[\{"'"$sample"'", 15\}\], msg_controllen='"$n"
++rights='\{cmsg_len='"$n"', cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, \[4</dev/null>, 5</dev/zero>, 6</[^}>]*/(A\\n){127}Z>\]\}'
+ creds='\{cmsg_len='"$n"', cmsg_level=SOL_SOCKET, cmsg_type=SCM_CREDENTIALS, \{pid='"$n"', uid=[0-9]+, gid=[0-9]+\}\}'
+-prefix='[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +'
+ EXPECTED="$LOG.expected"
+
+ cat > "$EXPECTED" << __EOF__
+-${prefix}sendmsg\\(1<socket:\\[[0-9]+\\]>, $msg, \\[$rights\\], msg_flags=0\\}, 0\\) += $n
+-${prefix}recvmsg\\(0<socket:\\[[0-9]+\\]>, $msg, \\[$creds, $rights\\], msg_flags=0\\}, 0\\) += $n
++sendmsg\\(3<socket:\\[[0-9]+\\]>, $msg, \\[$rights\\], msg_flags=0\\}, 0\\) = 15
++recvmsg\\(0<socket:\\[[0-9]+\\]>, $msg, \\[$creds, $rights\\], msg_flags=0\\}, 0\\) = 15
+ __EOF__
+
+ match_grep "$LOG" "$EXPECTED"
+diff --git a/tests/scm_rights.c b/tests/scm_rights.c
+index 1e5e850..00af4d5 100644
+--- a/tests/scm_rights.c
++++ b/tests/scm_rights.c
+@@ -27,26 +27,39 @@
+
+ #include "tests.h"
+ #include <assert.h>
+-#include <string.h>
+-#include <stdlib.h>
+-#include <unistd.h>
+ #include <errno.h>
+ #include <fcntl.h>
++#include <stdlib.h>
++#include <string.h>
++#include <unistd.h>
+ #include <sys/socket.h>
+-#include <sys/wait.h>
+
+ int main(int ac, const char **av)
+ {
+- int i;
+- int data = 0;
+- struct iovec iov = {
+- .iov_base = &data,
+- .iov_len = sizeof(iov)
+- };
++ assert(ac > 0);
++ int fds[ac];
++
++ static const char sample[] =
++ "\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
++ const unsigned int data_size = sizeof(sample) - 1;
++ void *data = tail_alloc(data_size);
++ memcpy(data, sample, data_size);
++
++ struct iovec *iov = tail_alloc(sizeof(struct iovec));
++ iov->iov_base = data;
++ iov->iov_len = data_size;
+
+- while ((i = open("/dev/null", O_RDWR)) < 3)
++ struct msghdr *mh = tail_alloc(sizeof(struct msghdr));
++ memset(mh, 0, sizeof(*mh));
++ mh->msg_iov = iov;
++ mh->msg_iovlen = 1;
++
++ int i;
++ while ((i = open("/dev/null", O_RDWR)) <= ac + 2)
+ assert(i >= 0);
+- (void) close(3);
++ while (i > 2)
++ assert(close(i--) == 0);
++ assert(close(0) == 0);
+
+ int sv[2];
+ if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv))
+@@ -55,60 +68,39 @@ int main(int ac, const char **av)
+ if (setsockopt(sv[0], SOL_SOCKET, SO_PASSCRED, &one, sizeof(one)))
+ perror_msg_and_skip("setsockopt");
+
+- pid_t pid = fork();
+- if (pid < 0)
+- perror_msg_and_fail("fork");
+-
+- if (pid) {
+- assert(close(sv[0]) == 0);
+- assert(dup2(sv[1], 1) == 1);
+- assert(close(sv[1]) == 0);
+-
+- int fds[ac];
+- assert((fds[0] = open("/dev/null", O_RDWR)) == 3);
+- for (i = 1; i < ac; ++i)
+- assert((fds[i] = open(av[i], O_RDONLY)) == i + 3);
+-
+- union {
+- struct cmsghdr cmsg;
+- char buf[CMSG_LEN(sizeof(fds))];
+- } control;
+-
+- control.cmsg.cmsg_level = SOL_SOCKET;
+- control.cmsg.cmsg_type = SCM_RIGHTS;
+- control.cmsg.cmsg_len = CMSG_LEN(sizeof(fds));
+- memcpy(CMSG_DATA(&control.cmsg), fds, sizeof(fds));
+-
+- struct msghdr mh = {
+- .msg_iov = &iov,
+- .msg_iovlen = 1,
+- .msg_control = &control,
+- .msg_controllen = sizeof(control)
+- };
+-
+- assert(sendmsg(1, &mh, 0) == sizeof(iov));
+- assert(close(1) == 0);
+-
+- int status;
+- assert(waitpid(pid, &status, 0) == pid);
+- assert(status == 0);
+- } else {
+- assert(close(sv[1]) == 0);
+- assert(dup2(sv[0], 0) == 0);
+- assert(close(sv[0]) == 0);
+-
+- struct cmsghdr control[4 + ac * sizeof(int) / sizeof(struct cmsghdr)];
+-
+- struct msghdr mh = {
+- .msg_iov = &iov,
+- .msg_iovlen = 1,
+- .msg_control = control,
+- .msg_controllen = sizeof(control)
+- };
+-
+- assert(recvmsg(0, &mh, 0) == sizeof(iov));
+- assert(close(0) == 0);
++ assert((fds[0] = open("/dev/null", O_RDWR)) == 4);
++ for (i = 1; i < ac; ++i)
++ assert((fds[i] = open(av[i], O_RDONLY)) == i + 4);
++
++ unsigned int cmsg_size = CMSG_SPACE(sizeof(fds));
++ struct cmsghdr *cmsg = tail_alloc(cmsg_size);
++ memset(cmsg, 0, cmsg_size);
++ cmsg->cmsg_level = SOL_SOCKET;
++ cmsg->cmsg_type = SCM_RIGHTS;
++ cmsg->cmsg_len = CMSG_LEN(sizeof(fds));
++ memcpy(CMSG_DATA(cmsg), fds, sizeof(fds));
++
++ mh->msg_control = cmsg;
++ mh->msg_controllen = cmsg_size;
++
++ assert(sendmsg(sv[1], mh, 0) == (int) data_size);
++
++ assert(close(sv[1]) == 0);
++ assert(open("/dev/null", O_RDWR) == sv[1]);
++
++ for (i = 0; i < ac; ++i) {
++ assert(close(fds[i]) == 0);
++ fds[i] = 0;
+ }
+
++ cmsg_size += CMSG_SPACE(sizeof(struct ucred));
++ cmsg = tail_alloc(cmsg_size);
++ memset(cmsg, 0, cmsg_size);
++ mh->msg_control = cmsg;
++ mh->msg_controllen = cmsg_size;
++
++ assert(recvmsg(0, mh, 0) == (int) data_size);
++ assert(close(0) == 0);
++
+ return 0;
+ }
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-tests-introduce-libtests.patch b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-tests-introduce-libtests.patch
new file mode 100644
index 000000000..1575ecd22
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-tests-introduce-libtests.patch
@@ -0,0 +1,306 @@
+From 87e6b230fff800eb768b68b2e5173ebbe83fd3ef Mon Sep 17 00:00:00 2001
+From: "Dmitry V. Levin" <ldv@altlinux.org>
+Date: Sat, 2 Jan 2016 12:05:14 +0000
+Subject: [PATCH] tests: introduce libtests
+
+Introduce tests/libtests.a with common functions for use in tests.
+
+* tests/tests.h: New file.
+* tests/error_msg.c: Likewise.
+* tests/tail_alloc.c: Likewise.
+* tests/get_page_size.c: Likewise.
+* tests/Makefile.am (libtests_a_SOURCES, libtests_a_CPPFLAGS,
+check_LIBRARIES, LDADD): New variables.
+(clock_xettime_LDADD, filter_unavailable_LDADD, mq_LDADD,
+pc_LDADD, times_LDADD): Add $(LDADD).
+* tests/.gitignore: Add libtests.a.
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport
+
+ tests/.gitignore | 1 +
+ tests/Makefile.am | 20 ++++++++++----
+ tests/error_msg.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ tests/get_page_size.c | 13 +++++++++
+ tests/tail_alloc.c | 52 ++++++++++++++++++++++++++++++++++++
+ tests/tests.h | 62 ++++++++++++++++++++++++++++++++++++++++++
+ 6 files changed, 217 insertions(+), 5 deletions(-)
+ create mode 100644 tests/error_msg.c
+ create mode 100644 tests/get_page_size.c
+ create mode 100644 tests/tail_alloc.c
+ create mode 100644 tests/tests.h
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 386a2c2..62d0e56 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -40,6 +40,16 @@ AM_CPPFLAGS = $(ARCH_MFLAGS) \
+ -I$(top_srcdir)
+ AM_LDFLAGS = $(ARCH_MFLAGS)
+
++libtests_a_SOURCES = \
++ get_page_size.c \
++ error_msg.c \
++ tail_alloc.c \
++ tests.h \
++ # end of libtests_a_SOURCES
++libtests_a_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
++check_LIBRARIES = libtests.a
++LDADD = libtests.a
++
+ check_PROGRAMS = \
+ _newselect \
+ adjtimex \
+@@ -146,19 +156,19 @@ check_PROGRAMS = \
+ xettimeofday \
+ # end of check_PROGRAMS
+
+-clock_xettime_LDADD = -lrt
+-filter_unavailable_LDADD = -lpthread
++clock_xettime_LDADD = -lrt $(LDADD)
++filter_unavailable_LDADD = -lpthread $(LDADD)
+ fstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
+ fstatat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
+ ftruncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
+ lstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
+ mmap64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
+-mq_LDADD = -lrt
++mq_LDADD = -lrt $(LDADD)
+ newfstatat_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
+-pc_LDADD = $(dl_LIBS)
++pc_LDADD = $(dl_LIBS) $(LDADD)
+ stat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
+ statfs_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
+-times_LDADD = -lrt
++times_LDADD = -lrt $(LDADD)
+ truncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
+ uio_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
+ stack_fcall_SOURCES = stack-fcall.c \
+diff --git a/tests/error_msg.c b/tests/error_msg.c
+new file mode 100644
+index 0000000..3fd3411
+--- /dev/null
++++ b/tests/error_msg.c
+@@ -0,0 +1,74 @@
++/*
++ * Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
++ * 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 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.
++ */
++
++#include "tests.h"
++#include <errno.h>
++#include <stdarg.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++
++void
++perror_msg_and_fail(const char *fmt, ...)
++{
++ int err_no = errno;
++ va_list p;
++
++ va_start(p, fmt);
++ vfprintf(stderr, fmt, p);
++ if (err_no)
++ fprintf(stderr, ": %s\n", strerror(err_no));
++ else
++ putc('\n', stderr);
++ exit(1);
++}
++
++void
++error_msg_and_skip(const char *fmt, ...)
++{
++ va_list p;
++
++ va_start(p, fmt);
++ vfprintf(stderr, fmt, p);
++ putc('\n', stderr);
++ exit(77);
++}
++
++void
++perror_msg_and_skip(const char *fmt, ...)
++{
++ int err_no = errno;
++ va_list p;
++
++ va_start(p, fmt);
++ vfprintf(stderr, fmt, p);
++ if (err_no)
++ fprintf(stderr, ": %s\n", strerror(err_no));
++ else
++ putc('\n', stderr);
++ exit(77);
++}
+diff --git a/tests/get_page_size.c b/tests/get_page_size.c
+new file mode 100644
+index 0000000..aeea861
+--- /dev/null
++++ b/tests/get_page_size.c
+@@ -0,0 +1,13 @@
++#include "tests.h"
++#include <unistd.h>
++
++size_t
++get_page_size(void)
++{
++ static size_t page_size;
++
++ if (!page_size)
++ page_size = sysconf(_SC_PAGESIZE);
++
++ return page_size;
++}
+diff --git a/tests/tail_alloc.c b/tests/tail_alloc.c
+new file mode 100644
+index 0000000..2b8b14e
+--- /dev/null
++++ b/tests/tail_alloc.c
+@@ -0,0 +1,52 @@
++/*
++ * Copyright (c) 2015-2016 Dmitry V. Levin <ldv@altlinux.org>
++ * 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 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.
++ */
++
++#include "tests.h"
++#include <string.h>
++#include <sys/mman.h>
++
++void *
++tail_alloc(const size_t size)
++{
++ const size_t page_size = get_page_size();
++ const size_t len = (size + page_size - 1) & -page_size;
++ const size_t alloc_size = len + 2 * page_size;
++
++ void *p = mmap(NULL, alloc_size, PROT_READ | PROT_WRITE,
++ MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
++ if (MAP_FAILED == p)
++ perror_msg_and_fail("mmap(%zu)", alloc_size);
++
++ void *start_work = p + page_size;
++ void *tail_guard = start_work + len;
++
++ if (munmap(p, page_size) || munmap(tail_guard, page_size))
++ perror_msg_and_fail("munmap");
++
++ memset(start_work, 0xff, len);
++ return tail_guard - size;
++}
+diff --git a/tests/tests.h b/tests/tests.h
+new file mode 100644
+index 0000000..91fa24e
+--- /dev/null
++++ b/tests/tests.h
+@@ -0,0 +1,62 @@
++/*
++ * Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
++ * 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 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.
++ */
++
++#ifndef TESTS_H_
++# define TESTS_H_
++
++# ifdef HAVE_CONFIG_H
++# include "config.h"
++# endif
++
++# include <sys/types.h>
++# include "gcc_compat.h"
++
++/* Cached sysconf(_SC_PAGESIZE). */
++size_t get_page_size(void);
++
++/* Print message and strerror(errno) to stderr, then exit(1). */
++void perror_msg_and_fail(const char *, ...)
++ ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN;
++/* Print message to stderr, then exit(77). */
++void error_msg_and_skip(const char *, ...)
++ ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN;
++/* Print message and strerror(errno) to stderr, then exit(77). */
++void perror_msg_and_skip(const char *, ...)
++ ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN;
++
++/*
++ * Allocate memory that ends on the page boundary.
++ * Pages allocated by this call are preceeded by an unmapped page
++ * and followed also by an unmapped page.
++ */
++void *tail_alloc(const size_t)
++ ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((1));
++
++# define SKIP_MAIN_UNDEFINED(arg) \
++ int main(void) { error_msg_and_skip("undefined: %s", arg); }
++
++#endif
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-tests-scm_rights.c-use-libtests.patch b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-tests-scm_rights.c-use-libtests.patch
new file mode 100644
index 000000000..3fbab8b66
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-tests-scm_rights.c-use-libtests.patch
@@ -0,0 +1,54 @@
+From 339a15b619b479c63cafba21d5fc359e613d9ee8 Mon Sep 17 00:00:00 2001
+From: "Dmitry V. Levin" <ldv@altlinux.org>
+Date: Mon, 4 Jan 2016 23:53:31 +0000
+Subject: [PATCH] tests/scm_rights.c: use libtests
+
+* tests/scm_rights.c (main): Use perror_msg_and_fail and perror_msg_and_skip.
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport
+
+ tests/scm_rights.c | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/tests/scm_rights.c b/tests/scm_rights.c
+index c41444f..1e5e850 100644
+--- a/tests/scm_rights.c
++++ b/tests/scm_rights.c
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
++ * Copyright (c) 2014-2016 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+@@ -25,6 +25,7 @@
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
++#include "tests.h"
+ #include <assert.h>
+ #include <string.h>
+ #include <stdlib.h>
+@@ -48,12 +49,15 @@ int main(int ac, const char **av)
+ (void) close(3);
+
+ int sv[2];
+- assert(socketpair(AF_UNIX, SOCK_STREAM, 0, sv) == 0);
++ if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv))
++ perror_msg_and_skip("socketpair");
+ int one = 1;
+- assert(setsockopt(sv[0], SOL_SOCKET, SO_PASSCRED, &one, sizeof(one)) == 0);
++ if (setsockopt(sv[0], SOL_SOCKET, SO_PASSCRED, &one, sizeof(one)))
++ perror_msg_and_skip("setsockopt");
+
+ pid_t pid = fork();
+- assert(pid >= 0);
++ if (pid < 0)
++ perror_msg_and_fail("fork");
+
+ if (pid) {
+ assert(close(sv[0]) == 0);
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/Makefile-ptest.patch b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/Makefile-ptest.patch
new file mode 100644
index 000000000..824031e86
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/Makefile-ptest.patch
@@ -0,0 +1,53 @@
+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 0209bac..b969e25 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -36,7 +36,7 @@ AC_INIT([strace],
+ AC_CONFIG_SRCDIR([strace.c])
+ AC_CONFIG_AUX_DIR([.])
+ AC_CONFIG_HEADERS([config.h])
+-AM_INIT_AUTOMAKE([foreign nostdinc dist-xz no-dist-gzip silent-rules parallel-tests])
++AM_INIT_AUTOMAKE([foreign nostdinc dist-xz no-dist-gzip silent-rules serial-tests])
+ AM_MAINTAINER_MODE
+ AC_CANONICAL_HOST
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 0f23b4b..429f7e9 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -332,3 +332,21 @@ ksysent.h: $(srcdir)/ksysent.sed
+
+ BUILT_SOURCES = ksysent.h
+ CLEANFILES = ksysent.h $(TESTS:=.tmp)
++
++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 net-fd scm_rights-fd sigaction; do sed -i -e 's/$$srcdir/./g' $(DESTDIR)/$(TESTDIR)/$$i.test; done
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/disable-git-version-gen.patch b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/disable-git-version-gen.patch
new file mode 100644
index 000000000..7bc143635
--- /dev/null
+++ b/import-layers/yocto-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>
+
+Index: strace-4.10/configure.ac
+===================================================================
+--- strace-4.10.orig/configure.ac
++++ strace-4.10/configure.ac
+@@ -1,7 +1,7 @@
+ dnl Process this file with autoconf to create configure. Use autoreconf.
+ 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])
+ AC_CONFIG_SRCDIR([strace.c])
+ AC_CONFIG_AUX_DIR([.])
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/more-robust-test-for-m32-mx32-compile-support.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/run-ptest b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/run-ptest
new file mode 100755
index 000000000..133cf92d0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+make -C tests -k runtest-TESTS
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/update-gawk-paths.patch b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/update-gawk-paths.patch
new file mode 100644
index 000000000..bfc7f3441
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/update-gawk-paths.patch
@@ -0,0 +1,118 @@
+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/caps.awk | 2 +-
+ tests/match.awk | 2 +-
+ tests/net-yy-accept.awk | 2 +-
+ tests/net-yy-connect.awk | 2 +-
+ tests/sigaction.awk | 2 +-
+ tests/uid.awk | 2 +-
+ tests/unix-yy-accept.awk | 2 +-
+ tests/unix-yy-connect.awk | 2 +-
+ 9 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/mpers.awk b/mpers.awk
+index 73bf0b0..50e6c16 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 Dmitry V. Levin <ldv@altlinux.org>
+diff --git a/tests/caps.awk b/tests/caps.awk
+index bad8b0f..845f37c 100644
+--- a/tests/caps.awk
++++ b/tests/caps.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/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/net-yy-accept.awk b/tests/net-yy-accept.awk
+index fed3e30..e916ab0 100644
+--- a/tests/net-yy-accept.awk
++++ b/tests/net-yy-accept.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # Copyright (c) 2014 Masatake YAMATO <yamato@redhat.com>
+ # Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+diff --git a/tests/net-yy-connect.awk b/tests/net-yy-connect.awk
+index f4dcf91..b3cec8c 100644
+--- a/tests/net-yy-connect.awk
++++ b/tests/net-yy-connect.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # Copyright (c) 2014 Masatake YAMATO <yamato@redhat.com>
+ # Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+diff --git a/tests/sigaction.awk b/tests/sigaction.awk
+index 5c6b6d0..3e14464 100644
+--- a/tests/sigaction.awk
++++ b/tests/sigaction.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/uid.awk b/tests/uid.awk
+index a56c5be..67b0749 100644
+--- a/tests/uid.awk
++++ b/tests/uid.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/unix-yy-accept.awk b/tests/unix-yy-accept.awk
+index 4ed60e4..2a9d9c0 100644
+--- a/tests/unix-yy-accept.awk
++++ b/tests/unix-yy-accept.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # Copyright (c) 2014 Masatake YAMATO <yamato@redhat.com>
+ # Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+diff --git a/tests/unix-yy-connect.awk b/tests/unix-yy-connect.awk
+index 262bf2e..c809dfa 100644
+--- a/tests/unix-yy-connect.awk
++++ b/tests/unix-yy-connect.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # Copyright (c) 2014 Masatake YAMATO <yamato@redhat.com>
+ # Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/use-asm-sgidefs.h.patch b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/use-asm-sgidefs.h.patch
new file mode 100644
index 000000000..db83d1130
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/use-asm-sgidefs.h.patch
@@ -0,0 +1,51 @@
+From 2995245d7e3f46e8b3995002995ebd28beca7d55 Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Fri, 5 Feb 2016 14:00:00 -0800
+Subject: [PATCH] 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>
+---
+ configure.ac | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 1524b9b..287e03d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -196,20 +196,20 @@ AC_SUBST(arch_mx32)
+ if test "$arch" = mips; then
+ AC_CACHE_CHECK([for _MIPS_SIM], [st_cv__MIPS_SIM],
+ [AC_COMPUTE_INT([st_cv__MIPS_SIM], [_MIPS_SIM],
+- [#include <sgidefs.h>],
++ [#include <asm/sgidefs.h>],
+ [AC_MSG_ERROR([_MIPS_SIM cannot be determined])])])
+
+ AC_CACHE_CHECK([for MIPS ABI], [st_cv_mips_abi],
+ [AC_COMPILE_IFELSE(
+- [AC_LANG_PROGRAM([[#include <sgidefs.h>]],
++ [AC_LANG_PROGRAM([[#include <asm/sgidefs.h>]],
+ [[int i[_MIPS_SIM == _MIPS_SIM_ABI32 ? 1 : - 1];]])],
+ [st_cv_mips_abi=o32],
+ [AC_COMPILE_IFELSE(
+- [AC_LANG_PROGRAM([[#include <sgidefs.h>]],
++ [AC_LANG_PROGRAM([[#include <asm/sgidefs.h>]],
+ [[int i[_MIPS_SIM == _MIPS_SIM_NABI32 ? 1 : - 1];]])],
+ [st_cv_mips_abi=n32],
+ [AC_COMPILE_IFELSE(
+- [AC_LANG_PROGRAM([[#include <sgidefs.h>]],
++ [AC_LANG_PROGRAM([[#include <asm/sgidefs.h>]],
+ [[int i[_MIPS_SIM == _MIPS_SIM_ABI64 ? 1 : - 1];]])],
+ [st_cv_mips_abi=n64],
+ [st_cv_mips_abi=unknown])])])])
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace_4.11.bb b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace_4.11.bb
new file mode 100644
index 000000000..739138802
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace_4.11.bb
@@ -0,0 +1,51 @@
+SUMMARY = "System call tracing tool"
+HOMEPAGE = "http://strace.sourceforge.net"
+SECTION = "console/utils"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=124500c21e856f0912df29295ba104c7"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/strace/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://use-asm-sgidefs.h.patch \
+ file://0001-arc-metag-nios2-or1k-tile-fix-build.patch \
+ file://Makefile-ptest.patch \
+ file://0001-tests-scm_rights.c-use-libtests.patch \
+ file://0001-scm_rights-fd.test-rewrite-without-fork.patch \
+ file://0001-Move-gcc-compat-macros-to-gcc_compat.h.patch \
+ file://0001-tests-introduce-libtests.patch \
+ file://run-ptest \
+ "
+
+SRC_URI[md5sum] = "a15d2555a7febb56d00c6e1a51c655dc"
+SRC_URI[sha256sum] = "e86a5f6cd8f941f67f3e4b28f4e60f3d9185c951cf266404533210a2e5cd8152"
+
+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/' ${D}/${PTEST_PATH}/${TESTDIR}/Makefile
+}
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/0001-Fix-libtool-name-in-configure.ac.patch b/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/0001-Fix-libtool-name-in-configure.ac.patch
new file mode 100644
index 000000000..5a1b10b2e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/disable_macos.patch b/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/disable_macos.patch
new file mode 100644
index 000000000..ec3be496f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/serf.m4-Regex-modified-to-allow-D-in-paths.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion_1.9.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion_1.9.3.bb
new file mode 100644
index 000000000..a19a675c5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion_1.9.3.bb
@@ -0,0 +1,53 @@
+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 pythonnative
+
+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 \
+ "
+SRC_URI[md5sum] = "243036eb28b50ce517fc228eb3250add"
+SRC_URI[sha256sum] = "8bbf6bb125003d88ee1c22935a36b7b1ab7d957e0c8b5fbfe5cb6310b6e86ae0"
+
+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/import-layers/yocto-poky/meta/recipes-devtools/swabber/swabber-native_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/swabber/swabber-native_git.bb
new file mode 100644
index 000000000..2f313bb46
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/swabber/swabber-native_git.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Tool to monitor and report on host system file usage"
+HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/swabber"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
+
+SRCREV = "2d1fe36fb0a4fdaae8823a9818a6785182d75e66"
+PV = "0.0+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+SRC_URI = "git://git.yoctoproject.org/swabber"
+
+inherit native
+
+do_configure () {
+ :
+}
+
+do_install() {
+ oe_runmake 'DESTDIR=${D}' install
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/swig/swig.inc b/import-layers/yocto-poky/meta/recipes-devtools/swig/swig.inc
new file mode 100644
index 000000000..9da40df55
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/swig/swig.inc
@@ -0,0 +1,63 @@
+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 python"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz"
+
+inherit autotools pythonnative
+
+EXTRA_OECONF = " \
+ --with-python=${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-python3 \
+ --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', True) + "/" + d.getVar('BPN', True) + "/" + d.getVar('PV', True)
+ return os.path.relpath(swiglib, d.getVar('bindir', True))
+
+do_install_append_class-native() {
+ create_wrapper ${D}${bindir}/swig SWIG_LIB='`dirname $''realpath`'/${@swiglib_relpath(d)}
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/swig/swig/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/swig/swig/0001-configure-use-pkg-config-for-pcre-detection.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/swig/swig_3.0.8.bb b/import-layers/yocto-poky/meta/recipes-devtools/swig/swig_3.0.8.bb
new file mode 100644
index 000000000..c1b820e0d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/swig/swig_3.0.8.bb
@@ -0,0 +1,8 @@
+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 \
+ "
+SRC_URI[md5sum] = "c96a1d5ecb13d38604d7e92148c73c97"
+SRC_URI[sha256sum] = "58a475dbbd4a4d7075e5fe86d4e54c9edde39847cdb96a3053d87cb64a23a453"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0001-linux-syslinux-support-ext2-3-4-device.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0002-linux-syslinux-implement-open_ext2_fs.patch b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0002-linux-syslinux-implement-open_ext2_fs.patch
new file mode 100644
index 000000000..77cf06045
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0003-linux-syslinux-implement-install_to_ext2.patch b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0003-linux-syslinux-implement-install_to_ext2.patch
new file mode 100644
index 000000000..84ba10526
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0004-linux-syslinux-add-ext_file_read-and-ext_file_write.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0005-linux-syslinux-implement-handle_adv_on_ext.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0006-linux-syslinux-implement-write_to_ext-and-add-syslin.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0007-linux-syslinux-implement-ext_construct_sectmap_fs.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0008-libinstaller-syslinuxext-implement-syslinux_patch_bo.patch b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0008-libinstaller-syslinuxext-implement-syslinux_patch_bo.patch
new file mode 100644
index 000000000..2400c98d6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0009-linux-syslinux-implement-install_bootblock.patch b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0009-linux-syslinux-implement-install_bootblock.patch
new file mode 100644
index 000000000..cd89d9248
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0010-gcc46-compatibility.patch b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0010-gcc46-compatibility.patch
new file mode 100644
index 000000000..6279258c2
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0011-mk-MMD-does-not-take-any-arguments.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/syslinux-fix-parallel-building-issue.patch b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/syslinux-fix-parallel-building-issue.patch
new file mode 100644
index 000000000..312b1e8ae
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/syslinux-libupload-depend-lib.patch b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/syslinux-libupload-depend-lib.patch
new file mode 100644
index 000000000..c0714b517
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/syslinux-libupload-depend-lib.patch
@@ -0,0 +1,34 @@
+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(+)
+
+diff --git a/com32/Makefile b/com32/Makefile
+index 9a1721b..f172db2 100644
+--- a/com32/Makefile
++++ b/com32/Makefile
+@@ -21,3 +21,4 @@ rosh: lib libutil
+ samples: libutil elflink/ldlinux
+ sysdump: libupload gpllib
+ gpllib: lib
++libupload: lib
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/syslinux-remove-clean-script.patch b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/syslinux-remove-clean-script.patch
new file mode 100644
index 000000000..7c003e165
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux_6.03.bb b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux_6.03.bb
new file mode 100644
index 000000000..ab8a51a23
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux_6.03.bb
@@ -0,0 +1,89 @@
+SUMMARY = "Multi-purpose linux bootloader"
+HOMEPAGE = "http://syslinux.zytor.com/"
+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 \
+ "
+
+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/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/0001-canonicalize_file_name-is-specific-to-glibc.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/fix_ranlib.patch b/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/fix_ranlib.patch
new file mode 100644
index 000000000..5d704567c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/fix_ranlib.patch
@@ -0,0 +1,14 @@
+Upstream-Status: Inappropriate [poky-specific fix]
+
+--- a/Makefile.inc
++++ b/Makefile.inc
+@@ -57,6 +57,9 @@
+ ifeq ($(NO_UUID),)
+ LIBS += -luuid
+ endif
++ ifneq ($(RANLIB),)
++ RANLIB += $@
++ endif
+ endif
+
+ ifneq ($(OPSYS),Windows)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/ldflags.patch b/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/ldflags.patch
new file mode 100644
index 000000000..c03c55d22
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init b/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init
new file mode 100755
index 000000000..6303280aa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init
@@ -0,0 +1,75 @@
+#!/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: "
+ count=0
+ while [ -n "`/bin/pidof $DAEMON_PATH`" -a $count -lt 10 ] ; do
+ killproc $DAEMON_PATH >& /dev/null
+ sleep 1
+ RETVAL=$?
+ if [ $RETVAL != 0 -o -n "`/bin/pidof $DAEMON_PATH`" ] ; then
+ sleep 3
+ fi
+ count=`expr $count + 1`
+ done
+ 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/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service b/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service
new file mode 100644
index 000000000..fd9a6c4d5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Target Communication Framework agent
+After=network.target
+
+[Service]
+Type=forking
+ExecStart=@SBINDIR@/tcf-agent -d -L- -l0
+
+[Install]
+WantedBy=multi-user.target
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent_git.bb
new file mode 100644
index 000000000..ab2fcd7ab
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent_git.bb
@@ -0,0 +1,52 @@
+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 = "b9a735e9c7cf82f80d412b7ab15d08b89d5a4ccc"
+PV = "1.3.0+git${SRCPV}"
+
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
+SRC_URI = "git://git.eclipse.org/gitroot/tcf/org.eclipse.tcf.agent.git;branch=1.3_mars_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,`"
+MAKE_OS = "`echo ${TARGET_OS} | sed s,^linux.*,GNU/Linux,`"
+
+EXTRA_OEMAKE = "MACHINE=${MAKE_ARCH} OPSYS=${MAKE_OS} 'CC=${CC}' 'AR=${AR}'"
+
+# They don't build on ARM and we don't need them actually.
+CFLAGS += "-DSERVICE_RunControl=0 -DSERVICE_Breakpoints=0 \
+ -DSERVICE_Memory=0 -DSERVICE_Registers=0 -DSERVICE_MemoryMap=0 \
+ -DSERVICE_StackTrace=0 -DSERVICE_Symbols=0 -DSERVICE_LineNumbers=0 \
+ -DSERVICE_Expressions=0"
+
+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/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/alter-includedir.patch b/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/alter-includedir.patch
new file mode 100644
index 000000000..c8530e1f5
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/fix_issue_with_old_distro_glibc.patch b/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/fix_issue_with_old_distro_glibc.patch
new file mode 100644
index 000000000..5b5de0730
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/fix_non_native_build_issue.patch b/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/fix_non_native_build_issue.patch
new file mode 100644
index 000000000..c60eb7537
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/no_packages.patch b/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/no_packages.patch
new file mode 100644
index 000000000..ab6cc4316
--- /dev/null
+++ b/import-layers/yocto-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>
+
+Index: unix/Makefile.in
+===================================================================
+--- unix.orig/Makefile.in 2013-11-10 23:38:12.235425891 -0800
++++ unix/Makefile.in 2013-11-10 23:38:12.231425891 -0800
+@@ -611,7 +611,7 @@
+ # Start of rules
+ #--------------------------------------------------------------------------
+
+-all: binaries libraries doc packages
++all: binaries libraries doc
+
+ binaries: ${LIB_FILE} $(STUB_LIB_FILE) ${TCL_EXE}
+
+@@ -653,12 +653,12 @@
+ #tclConfig.h: $(UNIX_DIR)/tclConfig.h.in
+ # $(SHELL) config.status
+
+-clean: clean-packages
++clean:
+ rm -f *.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
+@@ -706,7 +706,7 @@
+ # 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)
+@@ -771,7 +771,7 @@
+ 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/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/run-ptest b/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/run-ptest
new file mode 100644
index 000000000..dadba655f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/tcl-add-soname.patch b/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/tcl-add-soname.patch
new file mode 100644
index 000000000..96276eab0
--- /dev/null
+++ b/import-layers/yocto-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} -shared ${CFLAGS} ${LDFLAGS}'
+ 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} -shared ${CFLAGS} ${LDFLAGS}'
+ 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/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/tcl-remove-hardcoded-install-path.patch b/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/tcl-remove-hardcoded-install-path.patch
new file mode 100644
index 000000000..16f7c8051
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl_8.6.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl_8.6.4.bb
new file mode 100644
index 000000000..8e92b3e24
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl_8.6.4.bb
@@ -0,0 +1,102 @@
+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] = "d7cbb91f1ded1919370a30edd1534304"
+SRC_URI[sha256sum] = "9e6ed94c981c1d0c5f5fefb8112d06c6bf4d050a7327e95e71d417c416519c8d"
+
+SRC_URI_class-native = "${BASE_SRC_URI}"
+
+S = "${WORKDIR}/${BPN}${PV}/unix"
+
+VER = "${PV}"
+
+inherit autotools ptest binconfig
+
+DEPENDS_class-native = "zlib-native"
+
+EXTRA_OECONF = "--enable-threads --disable-rpath --libdir=${libdir}"
+
+do_configure() {
+ cd ${S}
+ gnu-configize
+ cd ${B}
+ oe_runconf
+}
+
+do_compile_prepend() {
+ echo > ${S}/../compat/fixstrtod.c
+}
+
+do_install() {
+ autotools_do_install 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
+ sed -i "s,-L${libdir},-L=${libdir},g" tclConfig.sh
+ sed -i "s,-I${includedir},-I=${includedir},g" tclConfig.sh
+ install -d ${D}${bindir_crossscripts}
+ install -m 0755 tclConfig.sh ${D}${bindir_crossscripts}
+ install -m 0755 tclConfig.sh ${D}${libdir}
+ cd ..
+ 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_PREPROCESS_FUNCS += "tcl_sysroot_preprocess"
+tcl_sysroot_preprocess () {
+ sysroot_stage_dir ${D}${bindir_crossscripts} ${SYSROOT_DESTDIR}${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"
+
+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"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/alternate_rpc_ports.patch b/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/alternate_rpc_ports.patch
new file mode 100644
index 000000000..ff745d477
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/fix_compile_warning.patch b/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/fix_compile_warning.patch
new file mode 100644
index 000000000..aada01411
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/fix_pid_race_parent_writes_child_pid.patch b/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/fix_pid_race_parent_writes_child_pid.patch
new file mode 100644
index 000000000..46b187e5f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/relative_max_socket_path_len.patch b/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/relative_max_socket_path_len.patch
new file mode 100644
index 000000000..219dd35ae
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/rename_fh_cache.patch b/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/rename_fh_cache.patch
new file mode 100644
index 000000000..e6d89530f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/tcp_no_delay.patch b/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/tcp_no_delay.patch
new file mode 100644
index 000000000..b3521c63e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/unfs3_parallel_build.patch b/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/unfs3_parallel_build.patch
new file mode 100644
index 000000000..6f64dd5b3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3_0.9.22.r497.bb b/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3_0.9.22.r497.bb
new file mode 100644
index 000000000..eba1139e5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3_0.9.22.r497.bb
@@ -0,0 +1,38 @@
+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_append_libc-musl = " libtirpc "
+DEPENDS_append_class-nativesdk += "flex-nativesdk"
+
+MOD_PV = "497"
+S = "${WORKDIR}/trunk"
+SRC_URI = "svn://svn.code.sf.net/p/unfs3/code;module=trunk;rev=${MOD_PV};protocol=http \
+ 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 \
+ "
+SRC_URI[md5sum] = "3687acc4ee992e536472365dd99712a7"
+SRC_URI[sha256sum] = "274b43ada9c6eea1da26eb7010d72889c5278984ba0b50dff4e093057d4d64f8"
+
+BBCLASSEXTEND = "native nativesdk"
+
+inherit autotools
+EXTRA_OECONF_append_class-native = " --sbindir=${bindir}"
+CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc"
+
+# 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/import-layers/yocto-poky/meta/recipes-devtools/unifdef/unifdef_2.11.bb b/import-layers/yocto-poky/meta/recipes-devtools/unifdef/unifdef_2.11.bb
new file mode 100644
index 000000000..1d13b9a6b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/unifdef/unifdef_2.11.bb
@@ -0,0 +1,17 @@
+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"
+
+do_install() {
+ oe_runmake install DESTDIR=${D} prefix=${prefix}
+}
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/vala/vala.inc b/import-layers/yocto-poky/meta/recipes-devtools/vala/vala.inc
new file mode 100644
index 000000000..2a8875f01
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/vala/vala.inc
@@ -0,0 +1,51 @@
+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 libxslt-native glib-2.0"
+
+# 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',1).split('.')[0]}.${@d.getVar('PV',1).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
+}
+
+# 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}/
+}
+
+
+SYSROOT_PREPROCESS_FUNCS_append_class-target += "vapigen_sysroot_preprocess"
+
+vapigen_sysroot_preprocess() {
+ # Put vapigen wrapper into target sysroot so that it can be used when building vapi files.
+ sysroot_stage_dir ${D}${bindir} ${SYSROOT_DESTDIR}${bindir}
+
+ # Also, tweak the vapigen name in vapigen pkgconfig file, so that it picks up our
+ # wrapper.
+ sed -i \
+ -e "s|vapigen=.*|vapigen=${bindir}/vapigen-wrapper|" \
+ ${SYSROOT_DESTDIR}${datadir}/pkgconfig/vapigen-${SHRT_VER}.pc
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/vala/vala/0001-git-version-gen-don-t-append-dirty-if-we-re-not-in-g.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/vala/vala/0001-vapigen.m4-use-PKG_CONFIG_SYSROOT_DIR.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/vala/vala_0.30.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/vala/vala_0.30.1.bb
new file mode 100644
index 000000000..6394afcc1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/vala/vala_0.30.1.bb
@@ -0,0 +1,8 @@
+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 \
+"
+
+SRC_URI[md5sum] = "cc2eb2384fc10038b643753d734a5a51"
+SRC_URI[sha256sum] = "23add78e5c6a5e6df019d4a885c9c79814c9e0b957519ec8a4f4d826c4e5df2c"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0001-Remove-tests-that-fail-to-build-on-some-PPC32-config.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0001-fix-build-for-musl-targets.patch b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0001-fix-build-for-musl-targets.patch
new file mode 100644
index 000000000..dc6feff7f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0001-fix-build-for-musl-targets.patch
@@ -0,0 +1,69 @@
+From 1b1a024efd18d44294e184e792c1e039cab02bfe Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 14 Feb 2016 09:14:12 +0000
+Subject: [PATCH] fix build for musl targets
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ configure.ac | 2 --
+ coregrind/vg_preloaded.c | 2 +-
+ include/pub_tool_redir.h | 7 +++++--
+ 3 files changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 9366dc7..679f514 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1066,8 +1066,6 @@ case "${GLIBC_VERSION}" in
+ ;;
+ 2.0|2.1|*)
+ AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}])
+- AC_MSG_ERROR([Valgrind requires glibc version 2.2 or later,])
+- AC_MSG_ERROR([Darwin libc, Bionic libc or Solaris libc])
+ ;;
+ esac
+
+diff --git a/coregrind/vg_preloaded.c b/coregrind/vg_preloaded.c
+index 2ea7a7a..e49c832 100644
+--- a/coregrind/vg_preloaded.c
++++ b/coregrind/vg_preloaded.c
+@@ -56,7 +56,7 @@
+ void VG_NOTIFY_ON_LOAD(freeres)( void );
+ void VG_NOTIFY_ON_LOAD(freeres)( void )
+ {
+-# if !defined(__UCLIBC__) \
++# if !defined(__UCLIBC__) && defined(__GLIBC__) \
+ && !defined(VGPV_arm_linux_android) \
+ && !defined(VGPV_x86_linux_android) \
+ && !defined(VGPV_mips32_linux_android) \
+diff --git a/include/pub_tool_redir.h b/include/pub_tool_redir.h
+index bac00d7..fbb2ef2 100644
+--- a/include/pub_tool_redir.h
++++ b/include/pub_tool_redir.h
+@@ -242,8 +242,7 @@
+ /* --- Soname of the standard C library. --- */
+
+ #if defined(VGO_linux) || defined(VGO_solaris)
+-# define VG_Z_LIBC_SONAME libcZdsoZa // libc.so*
+-
++# define VG_Z_LIBC_SONAME libcZdZa // libc.*
+ #elif defined(VGO_darwin) && (DARWIN_VERS <= DARWIN_10_6)
+ # define VG_Z_LIBC_SONAME libSystemZdZaZddylib // libSystem.*.dylib
+
+@@ -274,7 +273,11 @@
+ /* --- Soname of the pthreads library. --- */
+
+ #if defined(VGO_linux)
++# if defined(__GLIBC__) || defined(__UCLIBC__)
+ # define VG_Z_LIBPTHREAD_SONAME libpthreadZdsoZd0 // libpthread.so.0
++# else
++# define VG_Z_LIBPTHREAD_SONAME libcZdZa // libc.*
++#endif
+ #elif defined(VGO_darwin)
+ # define VG_Z_LIBPTHREAD_SONAME libSystemZdZaZddylib // libSystem.*.dylib
+ #elif defined(VGO_solaris)
+--
+2.7.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0002-remove-rpath.patch b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0002-remove-rpath.patch
new file mode 100644
index 000000000..e9112da0c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0002-remove-rpath.patch
@@ -0,0 +1,35 @@
+From f96cf1f4eaa72860ab8b5e18ad10fdc704d78c5f Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Tue, 15 Dec 2015 15:01:34 +0200
+Subject: [PATCH 2/5] remove rpath
+
+Upstream-Status: Inappropriate [embedded config]
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+---
+ none/tests/Makefile.am | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am
+index 54f2a7e..25b0f49 100644
+--- a/none/tests/Makefile.am
++++ b/none/tests/Makefile.am
+@@ -326,7 +326,6 @@ threadederrno_CFLAGS += --std=c99
+ endif
+ tls_SOURCES = tls.c tls2.c
+ tls_DEPENDENCIES = tls.so tls2.so
+-tls_LDFLAGS = -Wl,-rpath,$(abs_top_builddir)/none/tests
+ tls_LDADD = tls.so tls2.so -lpthread
+ tls_so_SOURCES = tls_so.c
+ tls_so_DEPENDENCIES = tls2.so
+@@ -334,7 +333,7 @@ if VGCONF_OS_IS_DARWIN
+ tls_so_LDFLAGS = -dynamic -dynamiclib -all_load -fpic
+ tls_so_LDADD = `pwd`/tls2.so
+ else
+- tls_so_LDFLAGS = -Wl,-rpath,$(abs_top_builddir)/none/tests -shared -fPIC
++ tls_so_LDFLAGS = -shared -fPIC
+ tls_so_LDADD = tls2.so
+ endif
+ tls_so_CFLAGS = $(AM_CFLAGS) -fPIC
+--
+2.6.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0004-Fix-out-of-tree-builds.patch b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0004-Fix-out-of-tree-builds.patch
new file mode 100644
index 000000000..ed313d644
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0004-Fix-out-of-tree-builds.patch
@@ -0,0 +1,175 @@
+From 38ae233b6893a4eec7f9ed6d8ad02392bca8eaed 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 | 64 ++++++++++++++++++++++++++++++------------------------------
+ 1 file changed, 32 insertions(+), 32 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 8ab7f9b..9366dc7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -377,44 +377,44 @@ 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}"
+ ;;
+ *)
+ AC_MSG_RESULT([unsupported (${kernel})])
+@@ -426,13 +426,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}"
+ ;;
+
+ *)
+@@ -1015,29 +1015,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)
+@@ -1046,8 +1046,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)
+@@ -1057,7 +1057,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)
+@@ -1079,11 +1079,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.6.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch
new file mode 100644
index 000000000..f5ac989fb
--- /dev/null
+++ b/import-layers/yocto-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 1;
+ }
+ }
+ }
+ # 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 0;
+ }
+
+ 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/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/11_mips-link-tool.patch b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/11_mips-link-tool.patch
new file mode 100644
index 000000000..ecb33b8cb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/11_mips-link-tool.patch
@@ -0,0 +1,37 @@
+Debian fix for MIPS: mmap(0x400000, 32768) failed in UME with error 22 (Invalid argument)
+
+ https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=777704
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+
+
+Description: Disable the MIPS linker workarounds when using -Ttext-section
+Origin: vendor
+Bug-Debian: http://bugs.debian.org/777704
+Author: James Cowgill <james410@cowgill.org.uk>
+Last-Update: 2015-04-25
+
+--- a/coregrind/link_tool_exe_linux.in
++++ b/coregrind/link_tool_exe_linux.in
+@@ -76,12 +76,13 @@
+ my $arch = substr($x, 0, index($x, "'"));
+
+ my $extra_args;
+-if (($arch eq 'mips') || ($arch eq 'mipsel')
+- || ($arch eq 'mipsisa32r2el')) {
+- $extra_args = "-static -Wl,--section-start=.reginfo=$ala";
+-} elsif (($arch eq 'mips64') || ($arch eq 'mips64el') ||
+- ($arch eq 'mipsisa64el')) {
+- $extra_args = "-static -Wl,--section-start=.MIPS.options=$ala";
++if ($arch =~ /^mips/ && "@FLAG_T_TEXT@" eq '-Ttext') {
++ # We only need to use the special mips options when using -Ttext
++ if ($arch =~ /^mips(64|isa64)/) {
++ $extra_args = "-static -Wl,--section-start=.MIPS.options=$ala";
++ } else {
++ $extra_args = "-static -Wl,--section-start=.reginfo=$ala";
++ }
+ } else {
+ $extra_args = "-static -Wl,@FLAG_T_TEXT@=$ala";
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch
new file mode 100644
index 000000000..07774f38a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/avoid-neon-for-targets-which-don-t-support-it.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/fixed-perl-path.patch b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/fixed-perl-path.patch
new file mode 100644
index 000000000..b054d05f7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/fixed-perl-path.patch
@@ -0,0 +1,53 @@
+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]
+
+diff --git a/cachegrind/cg_annotate.in b/cachegrind/cg_annotate.in
+index 9dc9565..cc4ef05 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 951066e..84c2dde 100644
+--- 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 e6ffdbf..fb45906 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 2188a31..83ad024 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/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/run-ptest b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/run-ptest
new file mode 100755
index 000000000..f9a72ec4a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/run-ptest
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# run-ptest - 'ptest' test infrastructure shell script that
+# wraps the valgrind regression script vg_regtest.
+# Must be run in the /usr/lib/valgrind/ptest directory.
+#
+# Dave Lerner <dave.lerner@windriver.com>
+###############################################################
+VALGRINDLIB=@libdir@/valgrind
+tests/vg_regtest --all \
+ --valgrind=/usr/bin/valgrind --valgrind-lib=$VALGRINDLIB \
+ --yocto-ptest
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind_3.11.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind_3.11.0.bb
new file mode 100644
index 000000000..51c88bf7a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind_3.11.0.bb
@@ -0,0 +1,118 @@
+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=1;endline=29;md5=ebb8e640ef633f940c425686c873f9fa \
+ file://include/valgrind.h;beginline=1;endline=56;md5=4b5e24908e53016ea561c45f4234a327 \
+ 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 = "http://www.valgrind.org/downloads/valgrind-${PV}.tar.bz2 \
+ file://fixed-perl-path.patch \
+ file://Added-support-for-PPC-instructions-mfatbu-mfatbl.patch \
+ file://run-ptest \
+ file://11_mips-link-tool.patch \
+ file://0002-remove-rpath.patch \
+ 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 \
+"
+SRC_URI_append_libc-musl = "\
+ file://0001-fix-build-for-musl-targets.patch \
+"
+SRC_URI[md5sum] = "4ea62074da73ae82e0162d6550d3f129"
+SRC_URI[sha256sum] = "6c396271a8c1ddd5a6fb9abe714ea1e8a86fce85b30ab26b4266aeb4c2413b42"
+
+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'
+
+inherit autotools ptest
+
+EXTRA_OECONF = "--enable-tls --without-mpicc"
+EXTRA_OECONF += "${@['--enable-only32bit','--enable-only64bit'][d.getVar('SITEINFO_BITS', True) != '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}"
+
+EXTRA_OEMAKE = "-w"
+
+# 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}"
+
+CFLAGS_append_libc-uclibc = " -D__UCLIBC__ "
+
+do_install_append () {
+ install -m 644 ${B}/default.supp ${D}/${libdir}/valgrind/
+}
+
+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, and QA
+# check complains about it
+INSANE_SKIP_${PN}-ptest += "file-rdeps"
+
+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/import-layers/yocto-poky/meta/recipes-devtools/xmlto/files/catalog.xml b/import-layers/yocto-poky/meta/recipes-devtools/xmlto/files/catalog.xml
new file mode 100644
index 000000000..6b8833d87
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/xmlto/xmlto-0.0.28/configure.in-drop-the-test-of-xmllint-and-xsltproc.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-devtools/xmlto/xmlto_0.0.28.bb b/import-layers/yocto-poky/meta/recipes-devtools/xmlto/xmlto_0.0.28.bb
new file mode 100644
index 000000000..71f873f9e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/xmlto/xmlto_0.0.28.bb
@@ -0,0 +1,38 @@
+SUMMARY = "A shell-script tool for converting XML files to various formats"
+HOMEPAGE = "https://fedorahosted.org/xmlto/"
+SECTION = "docs/xmlto"
+LICENSE = "GPLv2"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+
+SRC_URI = "https://fedorahosted.org/releases/x/m/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
+
+# xmlto needs getopt/xmllint/xsltproc/bash at runtime
+RDEPENDS_${PN} = "docbook-xml-dtd4 \
+ docbook-xsl-stylesheets \
+ util-linux \
+ libxml2 \
+ bash \
+"
+RDEPENDS_${PN}_append_class-target = " \
+ libxslt-bin \
+"
+
+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/import-layers/yocto-poky/meta/recipes-devtools/yasm/yasm_1.3.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/yasm/yasm_1.3.0.bb
new file mode 100644
index 000000000..78702ed20
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/yasm/yasm_1.3.0.bb
@@ -0,0 +1,14 @@
+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"
+
+inherit autotools gettext
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/zisofs-tools/zisofs-tools-native_1.0.8.bb b/import-layers/yocto-poky/meta/recipes-devtools/zisofs-tools/zisofs-tools-native_1.0.8.bb
new file mode 100644
index 000000000..021c05839
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/zisofs-tools/zisofs-tools-native_1.0.8.bb
@@ -0,0 +1,20 @@
+# zisofs-tools-native OE build file
+# Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+SUMMARY = "Utilities for creating compressed CD-ROM filesystems"
+HOMEPAGE = "http://freecode.com/projects/zisofs-tools"
+SECTION = "console/utils"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+DEPENDS = "zlib-native"
+
+SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/zisofs-tools/zisofs-tools-${PV}.tar.bz2/2d0ed8c9a1f60b45f949b136f9be1f6c/zisofs-tools-${PV}.tar.bz2"
+
+SRC_URI[md5sum] = "2d0ed8c9a1f60b45f949b136f9be1f6c"
+SRC_URI[sha256sum] = "ae4e53e4914934d41660248fb59d3c8761f1f1fd180d5ec993c17ddb3afd04f3"
+
+inherit native
+
+do_install() {
+ oe_runmake install INSTALLROOT=${D} bindir=${bindir}
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/at/at/0001-remove-glibc-assumption.patch b/import-layers/yocto-poky/meta/recipes-extended/at/at/0001-remove-glibc-assumption.patch
new file mode 100644
index 000000000..53ae28b5e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/at/at/0001-remove-glibc-assumption.patch
@@ -0,0 +1,57 @@
+From 7f811d9c4ebc9444e613e251c31d6bf537a24dc1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 16:35:30 -0700
+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: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.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.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/at/at/atd.init b/import-layers/yocto-poky/meta/recipes-extended/at/at/atd.init
new file mode 100644
index 000000000..eca379b3c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/at/at/atd.service b/import-layers/yocto-poky/meta/recipes-extended/at/at/atd.service
new file mode 100644
index 000000000..6dc844504
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/at/at/configure-add-enable-pam.patch b/import-layers/yocto-poky/meta/recipes-extended/at/at/configure-add-enable-pam.patch
new file mode 100644
index 000000000..1e5efef12
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/at/at/configure-fix-with-without-selinux.patch b/import-layers/yocto-poky/meta/recipes-extended/at/at/configure-fix-with-without-selinux.patch
new file mode 100644
index 000000000..389af1e07
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/at/at/configure-fix-with-without-selinux.patch
@@ -0,0 +1,53 @@
+From c02354af7f3d9426da31503abfae70952c699a9d Mon Sep 17 00:00:00 2001
+From: Wenzong Fan <wenzong.fan@windriver.com>
+Date: Fri, 18 Mar 2016 03:23:11 -0400
+Subject: [PATCH] configure: fix with/without selinux
+
+Problem:
+without-selinux doesn't work since WITH_SELINUX is always be defined no
+matter which option is given: with-selinux, without-selinux.
+
+Fix:
+Disable selinux support if without-selinux is given; otherwise check
+libselinux to determine if selinux support should be enabled.
+
+Upstream-Status: Submitted [at@packages.debian.org]
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ configure.ac | 19 +++++++++++++++----
+ 1 file changed, 15 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 5a43419..8c9de62 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -240,10 +240,21 @@ AC_ARG_WITH(daemon_username,
+ AC_SUBST(DAEMON_USERNAME)
+
+ AC_ARG_WITH(selinux,
+-[ --with-selinux Define to run with selinux],
+-AC_DEFINE(WITH_SELINUX, 1, [Define if you are building with_selinux]),
+-)
+-AC_CHECK_LIB(selinux, is_selinux_enabled, SELINUXLIB=-lselinux)
++[ --with-selinux Define to run with selinux (default=check)],
++[],
++[with_selinux=check])
++
++if test "x$with_selinux" != xno; then
++ AC_CHECK_LIB([selinux], [is_selinux_enabled],
++ [SELINUXLIB=-lselinux
++ AC_DEFINE(WITH_SELINUX, 1, [Define if you are building with_selinux])
++ ],
++ [if test "x$with_selinux" != xcheck; then
++ AC_MSG_FAILURE([--with-selinux is given, but test for selinux failed])
++ fi
++ ]
++ )
++fi
+ AC_SUBST(SELINUXLIB)
+ AC_SUBST(WITH_SELINUX)
+
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/at/at/file_replacement_with_gplv2.patch b/import-layers/yocto-poky/meta/recipes-extended/at/at/file_replacement_with_gplv2.patch
new file mode 100644
index 000000000..d5ef0032b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/at/at/fix_parallel_build_error.patch b/import-layers/yocto-poky/meta/recipes-extended/at/at/fix_parallel_build_error.patch
new file mode 100644
index 000000000..100f8898e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/at/at/makefile-fix-parallel.patch b/import-layers/yocto-poky/meta/recipes-extended/at/at/makefile-fix-parallel.patch
new file mode 100644
index 000000000..932a4c0bf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/at/at/makefile-fix-parallel.patch
@@ -0,0 +1,35 @@
+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(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 2a9b918..aa7c04a 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -75,7 +75,9 @@ at: $(ATOBJECTS)
+ atd: $(RUNOBJECTS)
+ $(CC) $(LDFLAGS) -o atd $(RUNOBJECTS) $(LIBS) $(PAMLIB)
+
+-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
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/at/at/pam.conf.patch b/import-layers/yocto-poky/meta/recipes-extended/at/at/pam.conf.patch
new file mode 100644
index 000000000..b5ceb9ae8
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/at/at/posixtm.c b/import-layers/yocto-poky/meta/recipes-extended/at/at/posixtm.c
new file mode 100644
index 000000000..5514ba4fe
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/at/at/posixtm.h b/import-layers/yocto-poky/meta/recipes-extended/at/at/posixtm.h
new file mode 100644
index 000000000..e91749d73
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/at/at_3.1.18.bb b/import-layers/yocto-poky/meta/recipes-extended/at/at_3.1.18.bb
new file mode 100644
index 000000000..93044f53e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/at/at_3.1.18.bb
@@ -0,0 +1,70 @@
+SUMMARY = "Delayed job execution and batch processing"
+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 \
+ ${@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 = "${DEBIAN_MIRROR}/main/a/at/at_${PV}.orig.tar.gz;subdir=${BP} \
+ 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 \
+ file://configure-fix-with-without-selinux.patch \
+ "
+
+PAM_SRC_URI = "file://pam.conf.patch \
+ file://configure-add-enable-pam.patch"
+
+SRC_URI[md5sum] = "f67a7aab557cd5b4a1311079a08acebe"
+SRC_URI[sha256sum] = "dbd5c8cb8edd53ef467363c3af0391c08769f1dbbd4d5002c59a4cd4cac11d52"
+
+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.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" = "pam" ]; then
+ install -D -m 0644 ${WORKDIR}/${BP}/pam.conf ${D}${sysconfdir}/pam.d/atd
+ fi
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/augeas/augeas.inc b/import-layers/yocto-poky/meta/recipes-extended/augeas/augeas.inc
new file mode 100644
index 000000000..23d12cadf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/augeas/augeas.inc
@@ -0,0 +1,30 @@
+SUMMARY = "Augeas configuration API"
+HOMEPAGE = "http://augeas.net/"
+BUGTRACKER = "https://fedorahosted.org/augeas/report/1"
+
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=bbb461211a33b134d42ed5ee802b37ff"
+
+SRC_URI = "http://download.augeas.net/${BP}.tar.gz \
+ file://add-missing-argz-conditional.patch \
+ file://sepbuildfix.patch \
+ file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+ "
+
+DEPENDS = "readline libxml2"
+
+inherit autotools pkgconfig
+
+PACKAGES =+ "${PN}-lenses lib${BPN}"
+
+FILES_${PN}-lenses = "${datadir}/augeas/lenses"
+FILES_lib${BPN} = "${libdir}/lib*${SOLIBS}"
+
+RDEPENDS_lib${BPN} += "${PN}-lenses"
+RRECOMMENDS_lib${BPN} += "${PN}"
+
+LEAD_SONAME = "libaugeas.so"
+
+do_install_append() {
+ rm -fr ${D}${datadir}/vim
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/augeas/augeas/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-poky/meta/recipes-extended/augeas/augeas/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..9a19876aa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/augeas/augeas/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: augeas-1.2.0/gnulib/lib/Makefile.am
+===================================================================
+--- augeas-1.2.0.orig/gnulib/lib/Makefile.am
++++ augeas-1.2.0/gnulib/lib/Makefile.am
+@@ -463,7 +463,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/import-layers/yocto-poky/meta/recipes-extended/augeas/augeas/add-missing-argz-conditional.patch b/import-layers/yocto-poky/meta/recipes-extended/augeas/augeas/add-missing-argz-conditional.patch
new file mode 100644
index 000000000..abbdbaa63
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/augeas/augeas/add-missing-argz-conditional.patch
@@ -0,0 +1,20 @@
+Add missing GL_GENERATE_ARGZ_H conditional
+
+- GL_GENERATE_ARGZ_H is used in gnulib/lib/Makefile.am
+
+Upstream-Status: Pending
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Index: augeas-1.0.0/configure.ac
+===================================================================
+--- augeas-1.0.0.orig/configure.ac
++++ augeas-1.0.0/configure.ac
+@@ -55,6 +55,8 @@ AC_ARG_WITH([failmalloc],
+
+ AM_CONDITIONAL([WITH_FAILMALLOC], [test x$with_failmalloc != xno])
+
++AM_CONDITIONAL([GL_GENERATE_ARGZ_H], [test -n "$ARGZ_H"])
++
+ dnl --enable-debug=(yes|no)
+ AC_ARG_ENABLE([debug],
+ [AC_HELP_STRING([--enable-debug=no/yes],
diff --git a/import-layers/yocto-poky/meta/recipes-extended/augeas/augeas/sepbuildfix.patch b/import-layers/yocto-poky/meta/recipes-extended/augeas/augeas/sepbuildfix.patch
new file mode 100644
index 000000000..b82a3ee2c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/augeas/augeas/sepbuildfix.patch
@@ -0,0 +1,22 @@
+Ensure that builds in separate builddirs (${B} != ${S}) correctly install the
+lenses files.
+
+Upstream-Status: Pending
+
+RP 2013/4/17
+
+Index: augeas-1.0.0/Makefile.am
+===================================================================
+--- augeas-1.0.0.orig/Makefile.am 2012-11-02 15:20:11.000000000 +0000
++++ augeas-1.0.0/Makefile.am 2013-04-17 10:36:24.033400125 +0000
+@@ -5,8 +5,8 @@
+ lensdir=$(datadir)/augeas/lenses/dist
+ lenstestdir=$(datadir)/augeas/lenses/dist/tests
+
+-dist_lens_DATA=$(wildcard lenses/*.aug)
+-dist_lenstest_DATA=$(wildcard lenses/tests/*.aug)
++dist_lens_DATA=$(wildcard $(top_srcdir)/lenses/*.aug)
++dist_lenstest_DATA=$(wildcard $(top_srcdir)lenses/tests/*.aug)
+
+ EXTRA_DIST=augeas.spec build/aux/move-if-change Makefile.am HACKING
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/augeas/augeas_1.4.0.bb b/import-layers/yocto-poky/meta/recipes-extended/augeas/augeas_1.4.0.bb
new file mode 100644
index 000000000..1064ad4f4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/augeas/augeas_1.4.0.bb
@@ -0,0 +1,4 @@
+require augeas.inc
+
+SRC_URI[md5sum] = "a2536a9c3d744dc09d234228fe4b0c93"
+SRC_URI[sha256sum] = "659fae7ac229029e60a869a3b88c616cfd51cf2fba286cdfe3af3a052cb35b30"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/build-tests.patch b/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/build-tests.patch
new file mode 100644
index 000000000..91341ee69
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/build-tests.patch
@@ -0,0 +1,44 @@
+Add 'ptest' target to Makefile, to run tests without checking dependencies.
+
+Signed-off-by: Anders Roxell <anders.roxell@enea.com>
+Upstream-Status: Pending
+---
+diff -dNaur bash-3.2.48/Makefile.in.orig bash-3.2.48/Makefile.in
+--- bash-3.2.48/Makefile.in.orig 2006-08-17 23:03:35.000000000 +0500
++++ bash-3.2.48/Makefile.in 2013-07-02 20:20:07.512709327 +0500
+@@ -803,17 +803,31 @@
+ fi
+
+ recho$(EXEEXT): $(SUPPORT_SRC)recho.c
+- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -o $@ $(SUPPORT_SRC)recho.c ${LIBS_FOR_BUILD}
++ @$(CC) $(CCFLAGS) -o $@ $<
+
+ zecho$(EXEEXT): $(SUPPORT_SRC)zecho.c
+- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -o $@ $(SUPPORT_SRC)zecho.c ${LIBS_FOR_BUILD}
++ @$(CC) $(CCFLAGS) -o $@ $<
+
+ printenv$(EXEEXT): $(SUPPORT_SRC)printenv.c
+- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -o $@ $(SUPPORT_SRC)printenv.c ${LIBS_FOR_BUILD}
++ @$(CC) $(CCFLAGS) -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} )
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/dont-include-target-CFLAGS-in-host-LDFLAGS.patch b/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/dont-include-target-CFLAGS-in-host-LDFLAGS.patch
new file mode 100644
index 000000000..ee756dc9e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/dont-include-target-CFLAGS-in-host-LDFLAGS.patch
@@ -0,0 +1,33 @@
+From 933bd886af49667e88e2385409449ab598813dab Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Wed, 15 Jul 2015 00:54:33 -0700
+Subject: [PATCH] dont include target CFLAGS in host LDFLAGS
+
+Building the host tool 'mkbuiltins' will fail if the target CFLAGS
+contains an option which isn't supported by the host's gcc. To prevent
+the issue, define LDFLAGS_FOR_BUILD based on CFLAGS_FOR_BUILD instead
+of CFLAGS.
+
+Upstream-Status: Inappropriate [required for bash 3.2.57 (GPLv2) recipe only]
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ builtins/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/builtins/Makefile.in b/builtins/Makefile.in
+index e027f7a..ebfddf3 100644
+--- a/builtins/Makefile.in
++++ b/builtins/Makefile.in
+@@ -63,7 +63,7 @@ LOCAL_DEFS = @LOCAL_DEFS@
+
+ LIBS = @LIBS@
+ LDFLAGS = @LDFLAGS@ $(LOCAL_LDFLAGS) $(CFLAGS)
+-LDFLAGS_FOR_BUILD = $(LDFLAGS)
++LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ $(LOCAL_LDFLAGS) $(CFLAGS_FOR_BUILD)
+ LOCAL_LDFLAGS = @LOCAL_LDFLAGS@
+ #LIBS_FOR_BUILD = @LIBS_FOR_BUILD@
+ LIBS_FOR_BUILD = $(LIBS)
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/mkbuiltins_have_stringize.patch b/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/mkbuiltins_have_stringize.patch
new file mode 100644
index 000000000..c4229a7ed
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/mkbuiltins_have_stringize.patch
@@ -0,0 +1,29 @@
+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
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+--- 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/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/run-ptest b/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/run-ptest
new file mode 100644
index 000000000..8dd3b9981
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+make -k THIS_SH=/bin/bash BUILD_DIR=. runtest
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/test-output.patch b/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/test-output.patch
new file mode 100644
index 000000000..2b09b7d97
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/test-output.patch
@@ -0,0 +1,25 @@
+Add FAIL/PASS output to test output.
+
+Signed-off-by: Björn Stenberg <bjst@enea.com>
+Upstream-Status: Pending
+---
+diff -uNr a/tests/run-all b/tests/run-all
+--- a/tests/run-all 1999-10-08 17:07:46.000000000 +0200
++++ b/tests/run-all 2012-10-27 21:04:18.663331887 +0200
+@@ -22,7 +22,15 @@
+ case $x in
+ $0|run-minimal|run-gprof) ;;
+ *.orig|*~) ;;
+- *) echo $x ; sh $x ;;
++ *) echo $x
++ output=`sh $x`
++ if [ -n "$output" ]; then
++ echo "$output"
++ echo "FAIL: $x"
++ else
++ echo "PASS: $x"
++ fi
++ ;;
+ esac
+ done
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash.inc b/import-layers/yocto-poky/meta/recipes-extended/bash/bash.inc
new file mode 100644
index 000000000..93ca00b25
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash.inc
@@ -0,0 +1,65 @@
+SUMMARY = "An sh-compatible command language interpreter"
+HOMEPAGE = "http://tiswww.case.edu/php/chet/bash/bashtop.html"
+SECTION = "base/shell"
+
+DEPENDS = "ncurses bison-native"
+
+inherit autotools gettext texinfo update-alternatives ptest
+
+EXTRA_AUTORECONF += "--exclude=autoheader"
+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} = "sh"
+ALTERNATIVE_LINK_NAME[sh] = "${base_bindir}/sh"
+ALTERNATIVE_TARGET[sh] = "${base_bindir}/bash"
+ALTERNATIVE_PRIORITY = "100"
+
+RDEPENDS_${PN} += "base-files"
+RDEPENDS_${PN}_class-nativesdk = ""
+RDEPENDS_${PN}-ptest += "make"
+
+USERADD_PACKAGES = "${PN}-ptest"
+USERADD_PARAM_${PN}-ptest = "--create-home --user-group test"
+
+do_configure_prepend () {
+ if [ ! -e ${S}/acinclude.m4 ]; then
+ cat ${S}/aclocal.m4 > ${S}/acinclude.m4
+ fi
+}
+
+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 host path in bashbug
+ sed -i -e "s,--sysroot=${STAGING_DIR_TARGET},,g" \
+ -e "s,-I${WORKDIR}/\S* ,,g" ${D}${bindir}/bashbug
+}
+
+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,${S},,g" -e "s,${B},,g" -e "s,${STAGING_DIR_NATIVE},,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
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash/build-tests.patch b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/build-tests.patch
new file mode 100644
index 000000000..73a81b60d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/bash/bash/execute_cmd.patch b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/execute_cmd.patch
new file mode 100644
index 000000000..81f8f0a9c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/execute_cmd.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+--- execute_cmd.c.orig Fri Jun 3 13:34:42 2011
++++ execute_cmd.c Fri Jun 3 13:36:41 2011
+@@ -2202,7 +2202,11 @@
+ /* 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, 0, 255);
+ if (lstdin > 0)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash/fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch
new file mode 100644
index 000000000..7f099ae0c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch
@@ -0,0 +1,169 @@
+From 2c30dff8ea8b17ad5ba9881e35ad1eba9c515f13 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 26 Nov 2015 22:09:07 -0500
+Subject: [PATCH] fix run-coproc/run-heredoc/run-execscript/run-test/ failed
+
+FAIL: run-coproc
+update test case:tests/coproc.right, tests/coproc.tests
+git://git.sv.gnu.org/bash.git bash-4.4-testing
+
+FAIL: run-heredoc
+update test case: tests/heredoc.right tests/heredoc3.sub
+git://git.sv.gnu.org/bash.git bash-4.4-testing
+
+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/coproc.right | 5 +----
+ tests/coproc.tests | 30 +++++++++++++++++++++++++-----
+ tests/heredoc.right | 5 ++---
+ tests/heredoc3.sub | 3 ++-
+ tests/run-execscript | 3 ++-
+ tests/run-test | 3 ++-
+ 6 files changed, 34 insertions(+), 15 deletions(-)
+
+diff --git a/tests/coproc.right b/tests/coproc.right
+index 6d9deaa..94b001c 100644
+--- a/tests/coproc.right
++++ b/tests/coproc.right
+@@ -1,11 +1,8 @@
+-84575
+ 63 60
+ a b c
+-84577
+ 63 60
+ flop
+-./coproc.tests: line 22: 84577 Terminated coproc REFLECT { cat -; }
+-84579
++coproc.tests: REFLECT: status 143
+ 63 60
+ FOO
+ 63 60
+diff --git a/tests/coproc.tests b/tests/coproc.tests
+index 8be3563..d347eb7 100644
+--- a/tests/coproc.tests
++++ b/tests/coproc.tests
+@@ -1,6 +1,13 @@
++: ${TMPDIR:=/tmp}
++TMPOUT=${TMPDIR}/coproc-wait-$BASHPID
++
+ coproc { echo a b c; sleep 2; }
+
+-echo $COPROC_PID
++case $COPROC_PID in
++[0-9]*) ;;
++*) echo COPROC_PID not integer ;;
++esac
++
+ echo ${COPROC[@]}
+
+ read LINE <&${COPROC[0]}
+@@ -10,7 +17,11 @@ wait $COPROC_PID
+
+ coproc REFLECT { cat - ; }
+
+-echo $REFLECT_PID
++case $REFLECT_PID in
++[0-9]*) ;;
++*) echo REFLECT_PID not integer ;;
++esac
++
+ echo ${REFLECT[@]}
+
+ echo flop >&${REFLECT[1]}
+@@ -18,12 +29,21 @@ read LINE <&${REFLECT[0]}
+
+ echo $LINE
+
+-kill $REFLECT_PID
+-wait $REFLECT_PID
++{ sleep 1; kill $REFLECT_PID; } &
++wait $REFLECT_PID >$TMPOUT 2>&1 || echo "coproc.tests: REFLECT: status $?"
++grep 'Terminated.*coproc.*REFLECT' < $TMPOUT >/dev/null 2>&1 || {
++ echo "coproc.tests: wait for REFLECT failed" >&2
++}
++rm -f $TMPOUT
++exec 2>&1
+
+ coproc xcase -n -u
+
+-echo $COPROC_PID
++case $COPROC_PID in
++[0-9]*) ;;
++*) echo COPROC_PID not integer ;;
++esac
++
+ echo ${COPROC[@]}
+
+ echo foo >&${COPROC[1]}
+diff --git a/tests/heredoc.right b/tests/heredoc.right
+index 6abaa1f..8df91c5 100644
+--- a/tests/heredoc.right
++++ b/tests/heredoc.right
+@@ -76,15 +76,14 @@ ENDEND
+ end ENDEND
+ hello
+ end hello
+-x star x
+ end x*x
+ helloEND
+ end helloEND
+ hello
+ \END
+ end hello<NL>\END
+-./heredoc3.sub: line 74: warning: here-document at line 72 delimited by end-of-file (wanted `EOF')
+-./heredoc3.sub: line 75: syntax error: unexpected end of file
++./heredoc3.sub: line 75: warning: here-document at line 73 delimited by end-of-file (wanted `EOF')
++./heredoc3.sub: line 76: syntax error: unexpected end of file
+ comsub here-string
+ ./heredoc.tests: line 105: warning: here-document at line 103 delimited by end-of-file (wanted `EOF')
+ hi
+diff --git a/tests/heredoc3.sub b/tests/heredoc3.sub
+index 73a111e..9d3d846 100644
+--- a/tests/heredoc3.sub
++++ b/tests/heredoc3.sub
+@@ -49,9 +49,10 @@ hello
+ END
+ echo end hello
+
+-cat <<x*x & touch 'x*x'
++cat <<x*x >/dev/null & touch 'x*x'
+ x star x
+ x*x
++wait $!
+ echo end 'x*x'
+ rm 'x*x'
+
+diff --git a/tests/run-execscript b/tests/run-execscript
+index f97ab21..0d00a1b 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 > /tmp/xx 2>&1
++rm -f /tmp/xx
++su -c "${THIS_SH} ./execscript > /tmp/xx 2>&1" test
+ diff /tmp/xx exec.right && rm -f /tmp/xx
+diff --git a/tests/run-test b/tests/run-test
+index b2482c3..2e8f049 100644
+--- a/tests/run-test
++++ b/tests/run-test
+@@ -1,4 +1,5 @@
+ unset GROUPS UID 2>/dev/null
+
+-${THIS_SH} ./test.tests >/tmp/xx 2>&1
++rm -f /tmp/xx
++su -c "${THIS_SH} ./test.tests >/tmp/xx 2>&1" test
+ diff /tmp/xx test.right && rm -f /tmp/xx
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch
new file mode 100644
index 000000000..a9391d6ca
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/bash/bash/run-ptest b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/run-ptest
new file mode 100644
index 000000000..2098fa46b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+make -k THIS_SH=/bin/bash BUILD_DIR=`pwd` srcdir=`pwd` runtest
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash/test-output.patch b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/test-output.patch
new file mode 100644
index 000000000..2b09b7d97
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/test-output.patch
@@ -0,0 +1,25 @@
+Add FAIL/PASS output to test output.
+
+Signed-off-by: Björn Stenberg <bjst@enea.com>
+Upstream-Status: Pending
+---
+diff -uNr a/tests/run-all b/tests/run-all
+--- a/tests/run-all 1999-10-08 17:07:46.000000000 +0200
++++ b/tests/run-all 2012-10-27 21:04:18.663331887 +0200
+@@ -22,7 +22,15 @@
+ case $x in
+ $0|run-minimal|run-gprof) ;;
+ *.orig|*~) ;;
+- *) echo $x ; sh $x ;;
++ *) echo $x
++ output=`sh $x`
++ if [ -n "$output" ]; then
++ echo "$output"
++ echo "FAIL: $x"
++ else
++ echo "PASS: $x"
++ fi
++ ;;
+ esac
+ done
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash_3.2.48.bb b/import-layers/yocto-poky/meta/recipes-extended/bash/bash_3.2.48.bb
new file mode 100644
index 000000000..d42b292b0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash_3.2.48.bb
@@ -0,0 +1,46 @@
+require bash.inc
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fd5d9bcabd8ed5a54a01ce8d183d592a"
+
+PR = "r11"
+
+SRC_URI = "${GNU_MIRROR}/bash/bash-${PV}.tar.gz;name=tarball \
+ ${GNU_MIRROR}/bash/bash-3.2-patches/bash32-049;apply=yes;striplevel=0;name=patch049 \
+ ${GNU_MIRROR}/bash/bash-3.2-patches/bash32-050;apply=yes;striplevel=0;name=patch050 \
+ ${GNU_MIRROR}/bash/bash-3.2-patches/bash32-051;apply=yes;striplevel=0;name=patch051 \
+ ${GNU_MIRROR}/bash/bash-3.2-patches/bash32-052;apply=yes;striplevel=0;name=patch052 \
+ ${GNU_MIRROR}/bash/bash-3.2-patches/bash32-053;apply=yes;striplevel=0;name=patch053 \
+ ${GNU_MIRROR}/bash/bash-3.2-patches/bash32-054;apply=yes;striplevel=0;name=patch054 \
+ ${GNU_MIRROR}/bash/bash-3.2-patches/bash32-055;apply=yes;striplevel=0;name=patch055 \
+ ${GNU_MIRROR}/bash/bash-3.2-patches/bash32-056;apply=yes;striplevel=0;name=patch056 \
+ ${GNU_MIRROR}/bash/bash-3.2-patches/bash32-057;apply=yes;striplevel=0;name=patch057 \
+ file://mkbuiltins_have_stringize.patch \
+ file://build-tests.patch \
+ file://test-output.patch \
+ file://run-ptest \
+ file://dont-include-target-CFLAGS-in-host-LDFLAGS.patch \
+ "
+
+SRC_URI[tarball.md5sum] = "338dcf975a93640bb3eaa843ca42e3f8"
+SRC_URI[tarball.sha256sum] = "128d281bd5682ba5f6953122915da71976357d7a76490d266c9173b1d0426348"
+SRC_URI[patch049.md5sum] = "af571a2d164d5abdcae4499e94e8892c"
+SRC_URI[patch049.sha256sum] = "b1217ed94bdb95dc878fa5cabbf8a164435eb0d9da23a392198f48566ee34a2f"
+SRC_URI[patch050.md5sum] = "8443d4385d73ec835abe401d90591377"
+SRC_URI[patch050.sha256sum] = "081bb03c580ecee63ba03b40beb3caf509eca29515b2e8dd3c078503609a1642"
+SRC_URI[patch051.md5sum] = "15c6653042e9814aa87120098fc7a849"
+SRC_URI[patch051.sha256sum] = "354886097cd95b4def77028f32ee01e2e088d58a98184fede9d3ce9320e218ef"
+SRC_URI[patch052.md5sum] = "691023a944bbb9003cc92ad462d91fa1"
+SRC_URI[patch052.sha256sum] = "a0eccf9ceda50871db10d21efdd74b99e35efbd55c970c400eeade012816bb61"
+SRC_URI[patch053.md5sum] = "eb97d1c9230a55283d9dac69d3de2e46"
+SRC_URI[patch053.sha256sum] = "fe6f0e96e0b966eaed9fb5e930ca12891f4380f30f9e0a773d200ff2063a864e"
+SRC_URI[patch054.md5sum] = "1107744058c43b247f597584b88ba0a6"
+SRC_URI[patch054.sha256sum] = "c6dab911e85688c542ce75afc175dbb4e5011de5102758e19a4a80dac1e79359"
+SRC_URI[patch055.md5sum] = "05d201176d3499e2dfa4a73d09d42f05"
+SRC_URI[patch055.sha256sum] = "c0e816700837942ed548da74e5917f74b70cbbbb10c9f2caf73e8e06a0713d0a"
+SRC_URI[patch056.md5sum] = "222eaa3a2c26f54a15aa5e08817a534a"
+SRC_URI[patch056.sha256sum] = "063a8d8d74e4407bf07a32b965b8ef6d213a66abdb6af26cc3584a437a56bbb4"
+SRC_URI[patch057.md5sum] = "47d98e3e042892495c5efe54ec6e5913"
+SRC_URI[patch057.sha256sum] = "5fc689394d515990f5ea74e2df765fc6e5e42ca44b4591b2c6f9be4b0cadf0f0"
+
+PARALLEL_MAKE = ""
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash_4.3.30.bb b/import-layers/yocto-poky/meta/recipes-extended/bash/bash_4.3.30.bb
new file mode 100644
index 000000000..4426cf00a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash_4.3.30.bb
@@ -0,0 +1,47 @@
+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 \
+ ${GNU_MIRROR}/bash/bash-4.3-patches/bash43-031;apply=yes;striplevel=0;name=patch031 \
+ ${GNU_MIRROR}/bash/bash-4.3-patches/bash43-032;apply=yes;striplevel=0;name=patch032 \
+ ${GNU_MIRROR}/bash/bash-4.3-patches/bash43-033;apply=yes;striplevel=0;name=patch033 \
+ ${GNU_MIRROR}/bash/bash-4.3-patches/bash43-034;apply=yes;striplevel=0;name=patch034 \
+ ${GNU_MIRROR}/bash/bash-4.3-patches/bash43-035;apply=yes;striplevel=0;name=patch035 \
+ ${GNU_MIRROR}/bash/bash-4.3-patches/bash43-036;apply=yes;striplevel=0;name=patch036 \
+ ${GNU_MIRROR}/bash/bash-4.3-patches/bash43-037;apply=yes;striplevel=0;name=patch037 \
+ ${GNU_MIRROR}/bash/bash-4.3-patches/bash43-038;apply=yes;striplevel=0;name=patch038 \
+ ${GNU_MIRROR}/bash/bash-4.3-patches/bash43-039;apply=yes;striplevel=0;name=patch039 \
+ 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 \
+ "
+
+SRC_URI[tarball.md5sum] = "a27b3ee9be83bd3ba448c0ff52b28447"
+SRC_URI[tarball.sha256sum] = "317881019bbf2262fb814b7dd8e40632d13c3608d2f237800a8828fbb8a640dd"
+
+SRC_URI[patch031.md5sum] = "236df1ac1130a033ed0dbe2d2115f28f"
+SRC_URI[patch031.sha256sum] = "cd529f59dd0f2fdd49d619fe34691da6f0affedf87cc37cd460a9f3fe812a61d"
+SRC_URI[patch032.md5sum] = "2360f7e79cfb28526f80021025ea5909"
+SRC_URI[patch032.sha256sum] = "889357d29a6005b2c3308ca5b6286cb223b5e9c083219e5db3156282dd554f4a"
+SRC_URI[patch033.md5sum] = "b551c4ee7b8713759e4143499d0bbd48"
+SRC_URI[patch033.sha256sum] = "fb2a7787a13fbe027a7335aca6eb3c21cdbd813e9edc221274b6a9d8692eaa16"
+SRC_URI[patch034.md5sum] = "c9a56fbe0348e05a886dff97f2872b74"
+SRC_URI[patch034.sha256sum] = "f1694f04f110defe1330a851cc2768e7e57ddd2dfdb0e3e350ca0e3c214ff889"
+SRC_URI[patch035.md5sum] = "e564e8ab44ed1ca3a4e315a9f6cabdc9"
+SRC_URI[patch035.sha256sum] = "370d85e51780036f2386dc18c5efe996eba8e652fc1973f0f4f2ab55a993c1e3"
+SRC_URI[patch036.md5sum] = "b00ff66c41a7c0f06e191200981980b0"
+SRC_URI[patch036.sha256sum] = "ac5f82445b36efdb543dbfae64afed63f586d7574b833e9aa9cd5170bc5fd27c"
+SRC_URI[patch037.md5sum] = "be2a7b05f6ae560313f3c9d5f7127bda"
+SRC_URI[patch037.sha256sum] = "33f170dd7400ab3418d749c55c6391b1d161ef2de7aced1873451b3a3fca5813"
+SRC_URI[patch038.md5sum] = "61e0522830b24fbe8c0d1b010f132470"
+SRC_URI[patch038.sha256sum] = "adbeaa500ca7a82535f0e88d673661963f8a5fcdc7ad63445e68bf5b49786367"
+SRC_URI[patch039.md5sum] = "a4775487abe958536751c8ce53cdf6f9"
+SRC_URI[patch039.sha256sum] = "ab94dced2215541097691f60c3eb323cc28ef2549463e6a5334bbcc1e61e74ec"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bc/bc_1.06.bb b/import-layers/yocto-poky/meta/recipes-extended/bc/bc_1.06.bb
new file mode 100644
index 000000000..d8c8a860f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/bc/files/fix-segment-fault.patch b/import-layers/yocto-poky/meta/recipes-extended/bc/files/fix-segment-fault.patch
new file mode 100644
index 000000000..20c0da2eb
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/blktool/blktool/0001-fix-typos-in-manpage.patch b/import-layers/yocto-poky/meta/recipes-extended/blktool/blktool/0001-fix-typos-in-manpage.patch
new file mode 100644
index 000000000..fee368dac
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/blktool/blktool/0002-fix-string-error.patch b/import-layers/yocto-poky/meta/recipes-extended/blktool/blktool/0002-fix-string-error.patch
new file mode 100644
index 000000000..d08aba5f0
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/blktool/blktool/0003-Fix-3-d-argument-for-BLKROSET-it-must-be-const-int.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/blktool/blktool_4-7.bb b/import-layers/yocto-poky/meta/recipes-extended/blktool/blktool_4-7.bb
new file mode 100644
index 000000000..d6250a90c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/blktool/blktool_4-7.bb
@@ -0,0 +1,27 @@
+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 = "${DEBIAN_MIRROR}/main/b/blktool/blktool_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_REGEX = "(?P<pver>((\d+\.*)+)-((\d+\.*)+))\.(diff|debian\.tar)\.(gz|xz)"
+
+S = "${WORKDIR}/${BPN}-4.orig"
+
+inherit autotools pkgconfig
diff --git a/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc.inc b/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc.inc
new file mode 100644
index 000000000..f9f8d6b5f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc.inc
@@ -0,0 +1,21 @@
+SUMMARY = "Berkeley LALR Yacc parser generator"
+DESCRIPTION = "A parser generator utility that reads a grammar specification from a file and generates an LR(1) \
+parser for it. The parsers consist of a set of LALR(1) parsing tables and a driver routine written in the C \
+programming language."
+SECTION = "devel"
+LICENSE = "PD"
+
+SRC_URI = "ftp://invisible-island.net/byacc/byacc-${PV}.tgz \
+ file://byacc-open.patch"
+
+EXTRA_OECONF += "--program-transform-name='s,^,b,'"
+
+BBCLASSEXTEND = "native"
+
+inherit autotools
+
+do_configure() {
+ install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S}
+ install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S}
+ oe_runconf
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc/byacc-open.patch b/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc/byacc-open.patch
new file mode 100644
index 000000000..005831130
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc/byacc-open.patch
@@ -0,0 +1,25 @@
+Ubuntu defaults to passing _FORTIFY_SOURCE=2 which breaks byacc as it doesn't
+pass enough arguments to open():
+
+ inlined from 'open_tmpfile' at byacc-20150711/main.c:588:5:
+ /usr/include/x86_64-linux-gnu/bits/fcntl2.h:50:24: error: call to '__open_missing_mode' declared with attribute error:
+ open with O_CREAT in second argument needs 3 arguments
+
+Add a mode of 0666 to fix this.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/main.c b/main.c
+index 620ce3f..82071a4 100644
+--- a/main.c
++++ b/main.c
+@@ -526,7 +526,7 @@ my_mkstemp(char *temp)
+ }
+ if ((name = tempnam(dname, fname)) != 0)
+ {
+- fd = open(name, O_CREAT | O_EXCL | O_RDWR);
++ fd = open(name, O_CREAT | O_EXCL | O_RDWR, 0666);
+ strcpy(temp, name);
+ }
+ else
diff --git a/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc_20150711.bb b/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc_20150711.bb
new file mode 100644
index 000000000..e5b5451f2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc_20150711.bb
@@ -0,0 +1,11 @@
+# Sigh. This is one of those places where everyone licenses it differently. Someone
+# even apply UCB to it (Free/Net/OpenBSD). The maintainer states that:
+# "I've found no reliable source which states that byacc must bear a UCB copyright."
+# Setting to PD as this is what the upstream has it as.
+
+LICENSE = "PD"
+LIC_FILES_CHKSUM = "file://package/debian/copyright;md5=c52fb2d1b3f75b3b7534927807a1b714"
+require byacc.inc
+
+SRC_URI[md5sum] = "2700401030583c4e9169ac7ea7d08de8"
+SRC_URI[sha256sum] = "c354e4ee14c4a1bf11e55dde9275011d14887ef066406a088b6fa56caf039248"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2-1.0.6/Makefile.am b/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2-1.0.6/Makefile.am
new file mode 100644
index 000000000..05d389fc7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2-1.0.6/Makefile.am
@@ -0,0 +1,72 @@
+
+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:
+ cp $(srcdir)/Makefile $(DESTDIR)/
+ 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/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2-1.0.6/configure.ac b/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2-1.0.6/configure.ac
new file mode 100644
index 000000000..e2bf1bf11
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2-1.0.6/fix-bunzip2-qt-returns-0-for-corrupt-archives.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2-1.0.6/run-ptest b/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2-1.0.6/run-ptest
new file mode 100644
index 000000000..3b20fce1e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2-1.0.6/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+make -k runtest
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2_1.0.6.bb b/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2_1.0.6.bb
new file mode 100644
index 000000000..f717d85f4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2_1.0.6.bb
@@ -0,0 +1,43 @@
+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"
+
+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
+
+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 () {
+ cp -f ${B}/Makefile ${D}${PTEST_PATH}/Makefile
+ 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/import-layers/yocto-poky/meta/recipes-extended/chkconfig/chkconfig-alternatives-native_1.3.59.bb b/import-layers/yocto-poky/meta/recipes-extended/chkconfig/chkconfig-alternatives-native_1.3.59.bb
new file mode 100644
index 000000000..c0f7f1674
--- /dev/null
+++ b/import-layers/yocto-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,' 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/import-layers/yocto-poky/meta/recipes-extended/chkconfig/chkconfig/replace_caddr_t.patch b/import-layers/yocto-poky/meta/recipes-extended/chkconfig/chkconfig/replace_caddr_t.patch
new file mode 100644
index 000000000..96d193879
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/chkconfig/chkconfig_1.3.58.bb b/import-layers/yocto-poky/meta/recipes-extended/chkconfig/chkconfig_1.3.58.bb
new file mode 100644
index 000000000..e8390264c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/chkconfig/chkconfig_1.3.58.bb
@@ -0,0 +1,67 @@
+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 = "http://fedorahosted.org/releases/c/h/chkconfig"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5574c6965ae5f583e55880e397fbb018"
+
+DEPENDS = "libnewt popt"
+PROVIDES += "virtual/update-alternatives"
+
+PR = "r7"
+
+SRC_URI = "http://fedorahosted.org/releases/c/h/chkconfig/${BPN}-${PV}.tar.bz2 \
+ file://replace_caddr_t.patch \
+ "
+
+SRC_URI[md5sum] = "c2039ca67f2749fe0c06ef7c6f8ee246"
+SRC_URI[sha256sum] = "18b497d25b2cada955c72810e45fcad8280d105f17cf45e2970f18271211de68"
+
+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/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.12/0001-Fix-CVE-2015-1197.patch b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.12/0001-Fix-CVE-2015-1197.patch
new file mode 100644
index 000000000..5c999197f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.12/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/avoid_heap_overflow.patch b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/avoid_heap_overflow.patch
new file mode 100644
index 000000000..a31573510
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/avoid_heap_overflow.patch
@@ -0,0 +1,26 @@
+Upstream-Status: Inappropriate [bugfix: http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-0624]
+CVE: CVE-2010-0624
+
+This patch avoids heap overflow reported by :
+http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-0624
+
+This is a clean patch for the GPLv2 tar recipe.
+
+the GPLv2 tar recipe patch is also applicable to this GPLv2 cpio
+recipe, as they share code.
+
+Nitin A Kamble <nitin.a.kamble@intel.com> 2011/04/25
+
+Index: tar-1.17/lib/rtapelib.c
+===================================================================
+--- tar-1.17.orig/lib/rtapelib.c
++++ tar-1.17/lib/rtapelib.c
+@@ -570,7 +570,7 @@ rmt_read__ (int handle, char *buffer, si
+
+ sprintf (command_buffer, "R%lu\n", (unsigned long) length);
+ if (do_command (handle, command_buffer) == -1
+- || (status = get_status (handle)) == SAFE_READ_ERROR)
++ || ((status = get_status (handle)) == SAFE_READ_ERROR) || (status > length))
+ return SAFE_READ_ERROR;
+
+ for (counter = 0; counter < status; counter += rlen, buffer += rlen)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/fix-memory-overrun.patch b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/fix-memory-overrun.patch
new file mode 100644
index 000000000..0148e7079
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/fix-memory-overrun.patch
@@ -0,0 +1,217 @@
+cpio: Fix memory overrun on reading improperly created link records
+
+Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
+
+http://git.savannah.gnu.org/cgit/cpio.git/commit/?id=746f3ff670dcfcdd28fcc990e79cd6fccc7ae48d
+
+ * src/copyin.c (get_link_name): New function.
+ (list_file, copyin_link): use get_link_name
+
+ * tests/symlink-bad-length.at: New file.
+ * tests/symlink-long.at: New file.
+ * tests/Makefile.am: Add new files.
+ * tests/testsuite.at: Likewise.
+
+ See http://lists.gnu.org/archive/html/bug-cpio/2014-11/msg00007.html
+
+Upstream-Status: Backport
+
+Signed-off-by: Sergey Poznyakoff <gray@gnu.org.ua>
+
+diff -Nurp cpio-2.8.orig/src/copyin.c cpio-2.8/src/copyin.c
+--- cpio-2.8.orig/src/copyin.c 2007-06-07 19:58:03.000000000 +0800
++++ cpio-2.8/src/copyin.c 2014-12-08 11:30:01.159791484 +0800
+@@ -126,6 +126,28 @@ tape_skip_padding (int in_file_des, int
+ }
+
+
++static char *
++get_link_name (struct cpio_file_stat *file_hdr, int in_file_des)
++{
++ off_t n = file_hdr->c_filesize + 1;
++ char *link_name;
++
++ if (n == 0 || n > SIZE_MAX)
++ {
++ error (0, 0, _("%s: stored filename length too big"), file_hdr->c_name);
++ link_name = NULL;
++ }
++ else
++ {
++ link_name = xmalloc (n);
++ tape_buffered_read (link_name, in_file_des, file_hdr->c_filesize);
++ link_name[file_hdr->c_filesize] = '\0';
++ tape_skip_padding (in_file_des, file_hdr->c_filesize);
++ }
++ return link_name;
++}
++
++
+ static void
+ list_file(struct cpio_file_stat* file_hdr, int in_file_des)
+ {
+@@ -136,21 +158,16 @@ list_file(struct cpio_file_stat* file_hd
+ {
+ if (archive_format != arf_tar && archive_format != arf_ustar)
+ {
+- char *link_name = NULL; /* Name of hard and symbolic links. */
+-
+- link_name = (char *) xmalloc ((unsigned int) file_hdr->c_filesize + 1);
+- link_name[file_hdr->c_filesize] = '\0';
+- tape_buffered_read (link_name, in_file_des, file_hdr->c_filesize);
+- long_format (file_hdr, link_name);
+- free (link_name);
+- tape_skip_padding (in_file_des, file_hdr->c_filesize);
+- return;
++ char *link_name = get_link_name (file_hdr, in_file_des);
++ if (link_name)
++ {
++ long_format (file_hdr, link_name);
++ free (link_name);
++ }
+ }
+ else
+- {
+ long_format (file_hdr, file_hdr->c_tar_linkname);
+- return;
+- }
++ return;
+ }
+ else
+ #endif
+@@ -732,10 +749,7 @@ copyin_link(struct cpio_file_stat *file_
+
+ if (archive_format != arf_tar && archive_format != arf_ustar)
+ {
+- link_name = (char *) xmalloc ((unsigned int) file_hdr->c_filesize + 1);
+- link_name[file_hdr->c_filesize] = '\0';
+- tape_buffered_read (link_name, in_file_des, file_hdr->c_filesize);
+- tape_skip_padding (in_file_des, file_hdr->c_filesize);
++ link_name = get_link_name (file_hdr, in_file_des);
+ }
+ else
+ {
+diff -Nurp cpio-2.8.orig/tests/Makefile.am cpio-2.8/tests/Makefile.am
+--- cpio-2.8.orig/tests/Makefile.am 2006-10-24 18:32:13.000000000 +0800
++++ cpio-2.8/tests/Makefile.am 2014-12-08 11:30:52.387789482 +0800
+@@ -45,6 +45,8 @@ TESTSUITE_AT = \
+ testsuite.at\
+ inout.at\
+ symlink.at\
++ symlink-bad-length.at\
++ symlink-long.at\
+ version.at
+
+ TESTSUITE = $(srcdir)/testsuite
+diff -Nurp cpio-2.8.orig/tests/symlink-bad-length.at cpio-2.8/tests/symlink-bad-length.at
+--- cpio-2.8.orig/tests/symlink-bad-length.at 1970-01-01 08:00:00.000000000 +0800
++++ cpio-2.8/tests/symlink-bad-length.at 2014-12-08 11:33:25.283783507 +0800
+@@ -0,0 +1,49 @@
++# Process this file with autom4te to create testsuite. -*- Autotest -*-
++# Copyright (C) 2014 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; if not, write to the Free Software
++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
++# 02110-1301 USA.
++
++# Cpio v2.11 did segfault with badly set symlink length.
++# References:
++# http://lists.gnu.org/archive/html/bug-cpio/2014-11/msg00007.html
++
++AT_SETUP([symlink-bad-length])
++AT_KEYWORDS([symlink-long copyout])
++
++AT_DATA([ARCHIVE.base64],
++[x3EjAIBAtIEtJy8nAQAAAHRUYW0FAAAADQBGSUxFAABzb21lIGNvbnRlbnQKAMdxIwBgQ/+hLScv
++JwEAAAB0VEhuBQD/////TElOSwAARklMRcdxAAAAAAAAAAAAAAEAAAAAAAAACwAAAAAAVFJBSUxF
++UiEhIQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
++])
++
++AT_CHECK([
++base64 -d ARCHIVE.base64 > ARCHIVE || AT_SKIP_TEST
++cpio -ntv < ARCHIVE
++test $? -eq 2
++],
++[0],
++[-rw-rw-r-- 1 10029 10031 13 Nov 25 13:52 FILE
++],[cpio: LINK: stored filename length too big
++cpio: premature end of file
++])
++
++AT_CLEANUP
+diff -Nurp cpio-2.8.orig/tests/symlink-long.at cpio-2.8/tests/symlink-long.at
+--- cpio-2.8.orig/tests/symlink-long.at 1970-01-01 08:00:00.000000000 +0800
++++ cpio-2.8/tests/symlink-long.at 2014-12-08 11:34:28.807781024 +0800
+@@ -0,0 +1,46 @@
++# Process this file with autom4te to create testsuite. -*- Autotest -*-
++# Copyright (C) 2014 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; if not, write to the Free Software
++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
++# 02110-1301 USA.
++
++# Cpio v2.11.90 changed the way symlink name is read from archive.
++# References:
++# http://lists.gnu.org/archive/html/bug-cpio/2014-11/msg00007.html
++
++AT_SETUP([symlink-long])
++AT_KEYWORDS([symlink-long copyout])
++
++AT_CHECK([
++
++# len(dirname) > READBUFSIZE
++dirname=
++for i in {1..52}; do
++ dirname="xxxxxxxxx/$dirname"
++ mkdir "$dirname"
++done
++ln -s "$dirname" x || AT_SKIP_TEST
++
++echo x | cpio -o > ar
++list=`cpio -tv < ar | sed 's|.*-> ||'`
++test "$list" = "$dirname" && echo success || echo fail
++],
++[0],
++[success
++],[2 blocks
++2 blocks
++])
++
++AT_CLEANUP
+diff -Nurp cpio-2.8.orig/tests/testsuite.at cpio-2.8/tests/testsuite.at
+--- cpio-2.8.orig/tests/testsuite.at 2006-10-24 18:32:13.000000000 +0800
++++ cpio-2.8/tests/testsuite.at 2014-12-08 11:34:56.515779942 +0800
+@@ -31,3 +31,5 @@ m4_include([version.at])
+
+ m4_include([inout.at])
+ m4_include([symlink.at])
++m4_include([symlink-bad-length.at])
++m4_include([symlink-long.at])
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/m4extensions.patch b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/m4extensions.patch
new file mode 100644
index 000000000..e16585dd3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/m4extensions.patch
@@ -0,0 +1,31 @@
+Upstream-Status: Inappropriate [licensing]
+
+# Define AC_USE_SYSTEM_EXTENSIONS only if it was previously undefined.
+# This is needed to configure correctly with newer versions of autoconf.
+
+diff -urN cpio-2.8.orig/m4/extensions.m4 cpio-2.8/m4/extensions.m4
+--- cpio-2.8.orig/m4/extensions.m4 2006-10-12 04:34:45.000000000 -0700
++++ cpio-2.8/m4/extensions.m4 2010-07-23 14:37:36.000000000 -0700
+@@ -1,4 +1,4 @@
+-# serial 4 -*- Autoconf -*-
++# serial 5 -*- Autoconf -*-
+ # Enable extensions on systems that normally disable them.
+
+ # Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+@@ -16,6 +16,7 @@
+ # ------------------------
+ # Enable extensions on systems that normally disable them,
+ # typically due to standards-conformance issues.
++m4_ifdef([AC_USE_SYSTEM_EXTENSIONS], [], [
+ AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
+ [
+ AC_BEFORE([$0], [AC_COMPILE_IFELSE])
+@@ -48,7 +49,7 @@
+ AC_DEFINE([__EXTENSIONS__])
+ AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+ AC_DEFINE([_TANDEM_SOURCE])
+-])
++])])
+
+ # gl_USE_SYSTEM_EXTENSIONS
+ # ------------------------
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/statdef.patch b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/statdef.patch
new file mode 100644
index 000000000..a00799fea
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/statdef.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Inappropriate [licensing]
+
+# Avoid multiple stat definitions
+# Patch taken from cpio mailing list posting 2010-03-19
+
+diff -urN cpio-2.11.orig/src/filetypes.h cpio-2.11/src/filetypes.h
+--- cpio-2.11.orig/src/filetypes.h 2010-02-12 02:19:23.000000000 -0800
++++ cpio-2.11/src/filetypes.h 2010-07-23 13:17:25.000000000 -0700
+@@ -82,4 +82,6 @@
+ #define lstat stat
+ #endif
+ int lstat ();
++#ifndef stat
+ int stat ();
++#endif
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_2.12.bb b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_2.12.bb
new file mode 100644
index 000000000..e7439996b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_2.12.bb
@@ -0,0 +1,12 @@
+include 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/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_2.8.bb b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_2.8.bb
new file mode 100644
index 000000000..624906b13
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_2.8.bb
@@ -0,0 +1,19 @@
+require cpio_v2.inc
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b7f772ea3a2489231cb4872656cac34b"
+
+PR = "r4"
+
+SRC_URI += " \
+ file://statdef.patch \
+ file://m4extensions.patch \
+ file://avoid_heap_overflow.patch \
+ file://fix-memory-overrun.patch \
+ "
+
+SRC_URI[md5sum] = "0caa356e69e149fb49b76bacc64615a1"
+SRC_URI[sha256sum] = "1b203248874c3b5a728b351f06513e5282f73e0170b7f207fbf8c39f28f6b4ad"
+
+# Required to build with gcc 4.3 and later:
+CFLAGS += "-fgnu89-inline"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_v2.inc b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_v2.inc
new file mode 100644
index 000000000..1bdc6176c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_v2.inc
@@ -0,0 +1,41 @@
+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"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cracklib/cracklib/0001-packlib.c-support-dictionary-byte-order-dependent.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/cracklib/cracklib/0002-craklib-fix-testnum-and-teststr-failed.patch b/import-layers/yocto-poky/meta/recipes-extended/cracklib/cracklib/0002-craklib-fix-testnum-and-teststr-failed.patch
new file mode 100644
index 000000000..6210e8212
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/cracklib/cracklib_2.9.5.bb b/import-layers/yocto-poky/meta/recipes-extended/cracklib/cracklib_2.9.5.bb
new file mode 100644
index 000000000..3bd3f9367
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cracklib/cracklib_2.9.5.bb
@@ -0,0 +1,47 @@
+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 python"
+RDEPEND_${PN}-python += "python"
+
+PACKAGES += "${PN}-python"
+
+EXTRA_OECONF = "--with-python --libdir=${base_libdir}"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/cracklib/cracklib-${PV}.tar.gz \
+ file://0001-packlib.c-support-dictionary-byte-order-dependent.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 pythonnative python-dir
+
+do_install_append_class-target() {
+ create-cracklib-dict -o ${D}${datadir}/cracklib/pw_dict ${D}${datadir}/cracklib/cracklib-small
+}
+
+do_install_append() {
+ src_dir="${D}${base_libdir}/${PYTHON_DIR}/site-packages"
+ rm -f $src_dir/test_cracklib.py*
+
+ if [ "${base_libdir}" != "${libdir}" ] ; then
+ # Move python files from ${base_libdir} to ${libdir} since used --libdir=${base_libdir}
+ install -d -m 0755 ${D}${PYTHON_SITEPACKAGES_DIR}/
+ mv $src_dir/* ${D}${PYTHON_SITEPACKAGES_DIR}
+ rm -fr ${D}${base_libdir}/${PYTHON_DIR}
+ fi
+}
+
+BBCLASSEXTEND = "native nativesdk"
+
+FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR}/cracklib.py* \
+ ${PYTHON_SITEPACKAGES_DIR}/_cracklib.*"
+
+FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/_cracklib.a"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie/crond.init b/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie/crond.init
new file mode 100755
index 000000000..53b8514ca
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie/crond.service b/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie/crond.service
new file mode 100644
index 000000000..d435a6eb3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie/crond_pam_config.patch b/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie/crond_pam_config.patch
new file mode 100644
index 000000000..675872c3c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie/crond_pam_config.patch
@@ -0,0 +1,19 @@
+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>
+--- cronie-1.4.7/pam/crond.orig 2010-12-16 16:59:02.000000000 +0800
++++ cronie-1.4.7/pam/crond 2011-07-20 09:47:16.080819203 +0800
+@@ -4,7 +4,7 @@
+ #
+ # No PAM authentication called, auth modules not needed
+ account required pam_access.so
+-account include password-auth
++account include common-account
+ session required pam_loginuid.so
+-session include password-auth
+-auth include password-auth
++session include common-session-noninteractive
++auth include common-auth
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie/crontab b/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie/crontab
new file mode 100644
index 000000000..22c4feb2d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie_1.5.0.bb b/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie_1.5.0.bb
new file mode 100644
index 000000000..697501ac1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie_1.5.0.bb
@@ -0,0 +1,81 @@
+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://fedorahosted.org/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"
+
+SRC_URI = "https://fedorahosted.org/releases/c/r/cronie/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] = "9db75e1884d83a45e002d145c6c54d45"
+SRC_URI[sha256sum] = "9cf0e3f4f5042a9c09413d62c8e0c055e12401f70b112465f0f81f2c84ebfb3f"
+
+inherit autotools update-rc.d useradd systemd
+
+PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '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/import-layers/yocto-poky/meta/recipes-extended/cups/cups.inc b/import-layers/yocto-poky/meta/recipes-extended/cups/cups.inc
new file mode 100644
index 000000000..4b2d21409
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cups/cups.inc
@@ -0,0 +1,116 @@
+SUMMARY = "An Internet printing system for Unix"
+SECTION = "console/utils"
+LICENSE = "GPLv2 & LGPLv2"
+DEPENDS = "gnutls libpng jpeg dbus dbus-glib zlib libusb"
+
+SRC_URI = "https://www.cups.org/software/${PV}/${BP}-source.tar.bz2 \
+ file://use_echo_only_in_init.patch \
+ file://0001-don-t-try-to-run-generated-binaries.patch \
+ file://cups_serverbin.patch \
+ "
+
+UPSTREAM_CHECK_URI = "http://www.cups.org/software.php"
+UPSTREAM_CHECK_REGEX = "cups-(?P<pver>\d+\.\d+(\.\d+)?)-source.tar"
+
+LEAD_SONAME = "libcupsdriver.so"
+
+CLEANBROKEN = "1"
+
+inherit autotools-brokensep binconfig useradd systemd
+
+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.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', 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 \
+ "
+
+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
+}
+
+python do_package_append() {
+ import subprocess
+ # Change permissions back the way they were, they probably had a reason...
+ workdir = d.getVar('WORKDIR', True)
+ subprocess.call('chmod 0511 %s/install/cups/var/run/cups/certs' % workdir, shell=True)
+}
+
+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/import-layers/yocto-poky/meta/recipes-extended/cups/cups/0001-don-t-try-to-run-generated-binaries.patch b/import-layers/yocto-poky/meta/recipes-extended/cups/cups/0001-don-t-try-to-run-generated-binaries.patch
new file mode 100644
index 000000000..5379eb6aa
--- /dev/null
+++ b/import-layers/yocto-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.0.0/ppdc/Makefile
+===================================================================
+--- cups-2.0.0.orig/ppdc/Makefile
++++ cups-2.0.0/ppdc/Makefile
+@@ -242,8 +242,8 @@ genstrings: genstrings.o libcupsppdc.a
+ $(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
+
+
+ #
+@@ -260,9 +260,9 @@ ppdc-static: ppdc.o libcupsppdc.a ../cu
+ $(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
+
+
+ #
+@@ -288,17 +288,17 @@ ppdi-static: ppdc-static ppdi.o libcups
+ $(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/import-layers/yocto-poky/meta/recipes-extended/cups/cups/cups_serverbin.patch b/import-layers/yocto-poky/meta/recipes-extended/cups/cups/cups_serverbin.patch
new file mode 100644
index 000000000..f7b44a7bc
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/cups/cups/use_echo_only_in_init.patch b/import-layers/yocto-poky/meta/recipes-extended/cups/cups/use_echo_only_in_init.patch
new file mode 100644
index 000000000..696f1374d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/cups/cups_2.1.3.bb b/import-layers/yocto-poky/meta/recipes-extended/cups/cups_2.1.3.bb
new file mode 100644
index 000000000..aef211d91
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cups/cups_2.1.3.bb
@@ -0,0 +1,6 @@
+require cups.inc
+
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=6c5a350596fba02754bd96eb6df3afd0"
+
+SRC_URI[md5sum] = "62b8fafd590e75f72316915790b0850a"
+SRC_URI[sha256sum] = "36a70d43584aea2617da914b9331e23341c3501a8254c4d2eae9c11ec01fd4d3"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cwautomacros/cwautomacros_20110201.bb b/import-layers/yocto-poky/meta/recipes-extended/cwautomacros/cwautomacros_20110201.bb
new file mode 100644
index 000000000..65a99fc28
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-2.8.1/diffutils_fix_for_automake-1.12.patch b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-2.8.1/diffutils_fix_for_automake-1.12.patch
new file mode 100644
index 000000000..cc05d1dc0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-2.8.1/diffutils_fix_for_automake-1.12.patch
@@ -0,0 +1,27 @@
+Upstream-Status: Pending
+
+automake 1.12 has depricated automatic de-ANSI-fication support
+
+this patch avoids these kinds of errors:
+
+| configure.ac:90: error: automatic de-ANSI-fication support has been removed
+| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/aclocal-1.12/protos.m4:12: AM_C_PROTOTYPES is expanded from...
+| /srv/home/nitin/builds/build-gcc47/tmp/work/i586-poky-linux/diffutils-2.8.1-r4/diffutils-2.8.1/m4/prereq.m4:110: jm_PREREQ_QUOTEARG is expanded from...
+| configure.ac:90: the top level
+| autom4te: m4 failed with exit status: 1
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/04
+
+Index: diffutils-2.8.1/m4/prereq.m4
+===================================================================
+--- diffutils-2.8.1.orig/m4/prereq.m4
++++ diffutils-2.8.1/m4/prereq.m4
+@@ -115,7 +115,6 @@ AC_DEFUN([jm_PREREQ_QUOTEARG],
+ AC_HEADER_STDC
+ AC_C_BACKSLASH_A
+ AC_MBSTATE_T
+- AM_C_PROTOTYPES
+ ])
+
+ AC_DEFUN([jm_PREREQ_REGEX],
diff --git a/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-3.3/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-3.3/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..ba1a4bab4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-3.3/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/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-3.3/run-ptest b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-3.3/run-ptest
new file mode 100644
index 000000000..695c5e8a7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-3.3/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+make -C tests check-TESTS
diff --git a/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils.inc b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils.inc
new file mode 100644
index 000000000..243341aa9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils.inc
@@ -0,0 +1,18 @@
+SUMMARY = "Diffutils contains tools used for finding differences between files"
+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
+
+# diffutils assumes non-glibc compilation with uclibc and
+# this causes it to generate its own implementations of
+# standard functionality. regex.c actually breaks compilation
+# because it uses __mempcpy, there are other things (TBD:
+# see diffutils.mk in buildroot)
+EXTRA_OECONF_libc-uclibc = "--without-included-regex"
+
+ALTERNATIVE_${PN} = "diff cmp"
+ALTERNATIVE_PRIORITY = "100"
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils_2.8.1.bb b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils_2.8.1.bb
new file mode 100644
index 000000000..bf425bbb3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils_2.8.1.bb
@@ -0,0 +1,16 @@
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+require diffutils.inc
+
+PR = "r7.0"
+
+SRC_URI = "${GNU_MIRROR}/diffutils/diffutils-${PV}.tar.gz \
+ file://diffutils_fix_for_automake-1.12.patch"
+
+SRC_URI[md5sum] = "71f9c5ae19b60608f6c7f162da86a428"
+SRC_URI[sha256sum] = "c5001748b069224dd98bf1bb9ee877321c7de8b332c8aad5af3e2a7372d23f5a"
+
+do_configure_prepend () {
+ chmod u+w ${S}/po/Makefile.in.in
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils_3.3.bb b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils_3.3.bb
new file mode 100644
index 000000000..5008690ea
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils_3.3.bb
@@ -0,0 +1,37 @@
+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 \
+"
+
+EXTRA_OECONF += "--without-libsigsegv-prefix"
+
+do_configure_prepend () {
+ # Need to remove gettext macros with weird mix of versions
+ for i in codeset.m4 gettext_gl.m4 intlmacosx.m4 inttypes-pri.m4 lib-ld_gl.m4 lib-prefix_gl.m4 po_gl.m4 ssize_t.m4 wchar_t.m4 wint_t.m4; do
+ rm -f ${S}/m4/$i
+ done
+}
+
+SRC_URI[md5sum] = "99180208ec2a82ce71f55b0d7389f1b3"
+SRC_URI[sha256sum] = "a25e89a8ab65fded1731e4186be1bb25cda967834b6df973599cdcd5abdfc19c"
+
+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|^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/import-layers/yocto-poky/meta/recipes-extended/ed/ed_0.5.bb b/import-layers/yocto-poky/meta/recipes-extended/ed/ed_0.5.bb
new file mode 100644
index 000000000..e2df13f4b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ed/ed_0.5.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Line-oriented text editor"
+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
+
+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/import-layers/yocto-poky/meta/recipes-extended/ed/ed_1.9.bb b/import-layers/yocto-poky/meta/recipes-extended/ed/ed_1.9.bb
new file mode 100644
index 000000000..f2ec42ad1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ed/ed_1.9.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Line-oriented text editor"
+HOMEPAGE = "http://www.gnu.org/software/ed/"
+
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949 \
+ file://ed.h;endline=20;md5=375a20cc2545ac1115eeb7b323c60ae3 \
+ file://main.c;endline=17;md5=14dbb325c1f2d4daf50e0aa5c5038e96"
+
+SECTION = "base"
+
+# LSB states that ed should be in /bin/
+bindir = "${base_bindir}"
+
+SRC_URI = "${GNU_MIRROR}/ed/ed-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "565b6d1d5a9a8816b9b304fc4ed9405d"
+SRC_URI[sha256sum] = "d5b372cfadf073001823772272fceac2cfa87552c5cd5a8efc1c8aae61f45a88"
+
+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/import-layers/yocto-poky/meta/recipes-extended/ethtool/ethtool/avoid_parallel_tests.patch b/import-layers/yocto-poky/meta/recipes-extended/ethtool/ethtool/avoid_parallel_tests.patch
new file mode 100644
index 000000000..bf66267e8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ethtool/ethtool/avoid_parallel_tests.patch
@@ -0,0 +1,19 @@
+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)
+
+diff -ruN a/configure.ac b/configure.ac
+--- a/configure.ac 2014-05-28 18:19:13.513980977 +0200
++++ b/configure.ac 2014-05-28 18:19:21.129660215 +0200
+@@ -2,7 +2,7 @@
+ AC_INIT(ethtool, 3.14, 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/import-layers/yocto-poky/meta/recipes-extended/ethtool/ethtool/run-ptest b/import-layers/yocto-poky/meta/recipes-extended/ethtool/ethtool/run-ptest
new file mode 100644
index 000000000..1e245da11
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ethtool/ethtool/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+make -k runtest-TESTS
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ethtool/ethtool_4.2.bb b/import-layers/yocto-poky/meta/recipes-extended/ethtool/ethtool_4.2.bb
new file mode 100644
index 000000000..95df784c4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ethtool/ethtool_4.2.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] = "5b55f7cd76e901dfc2738ac22cab96ca"
+SRC_URI[sha256sum] = "f84226db8dd18afaf91d8d00f5cb8f87ec3d7f787d2a3605de08d6dfa95ab8ef"
+
+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/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/findutils-fix-doc-build-error.patch b/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/findutils-fix-doc-build-error.patch
new file mode 100644
index 000000000..2076e4409
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/findutils-fix-doc-build-error.patch
@@ -0,0 +1,53 @@
+From 33cba24cba7b0973a702e9627bd5b93962948ae4 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Tue, 17 Sep 2013 16:11:16 +0800
+Subject: [PATCH] findutils: fix doc build error
+
+Upstream-Status: Backport
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ doc/find.texi | 6 +++---
+ 1 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/doc/find.texi b/doc/find.texi
+index 5b5f0cf..b3d9c6b 100644
+--- a/doc/find.texi
++++ b/doc/find.texi
+@@ -63,7 +63,7 @@ translation approved by the Foundation.
+
+ @page
+ @vskip 0pt plus 1filll
+-@insertcopying{}
++@insertcopying
+ @end titlepage
+
+ @contents
+@@ -1466,6 +1466,7 @@ no output is ever sent to it.
+ * Escapes::
+ * Format Directives::
+ * Time Formats::
++* Formatting Flags::
+ @end menu
+
+ @node Escapes
+@@ -1534,7 +1535,6 @@ from the novel you are reading.
+ * Size Directives::
+ * Location Directives::
+ * Time Directives::
+-* Formatting Flags::
+ @end menu
+
+ @node Name Directives
+@@ -1780,7 +1780,7 @@ setting the TZ environment variable). This is a GNU extension.
+ @end table
+
+ @node Formatting Flags
+-@subsubsection Formatting Flags
++@subsection Formatting Flags
+
+ The @samp{%m} and @samp{%d} directives support the @samp{#}, @samp{0}
+ and @samp{+} flags, but the other directives do not, even if they
+--
+1.7.4.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/findutils_fix_for_automake-1.12.patch b/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/findutils_fix_for_automake-1.12.patch
new file mode 100644
index 000000000..2d0ddb43f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/findutils_fix_for_automake-1.12.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Pending
+
+automake 1.12 has depricated automatic de-ANSI-fication support
+
+this patch avoids these kinds of errors:
+
+| configure.in:75: error: automatic de-ANSI-fication support has been removed
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/04
+
+Index: findutils-4.2.31/configure.in
+===================================================================
+--- findutils-4.2.31.orig/configure.in
++++ findutils-4.2.31/configure.in
+@@ -72,7 +72,6 @@ dnl gl_EARLY calls AC_GNU_SOURCE anyway.
+
+
+ AC_ISC_POSIX
+-AM_C_PROTOTYPES
+
+ AC_PROG_INSTALL
+ AC_PROG_RANLIB
diff --git a/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/gnulib-extension.patch b/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/gnulib-extension.patch
new file mode 100644
index 000000000..65bd64277
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/gnulib-extension.patch
@@ -0,0 +1,56 @@
+Upstream-Status: Inappropriate [legacy version]
+
+the old AC_USE_SYSTEM_EXTENSIONS won't work with AC_GNU_SOURCE
+
+against 4.2.31
+07/08/2010 - qhe
+
+diff --git a/gnulib/m4/extensions.m4 b/gnulib/m4/extensions.m4
+index 143a9e5..0f27ceb 100644
+--- a/gnulib/m4/extensions.m4
++++ b/gnulib/m4/extensions.m4
+@@ -12,44 +12,6 @@
+ # enough in this area it's likely we'll need to redefine
+ # AC_USE_SYSTEM_EXTENSIONS for quite some time.
+
+-# AC_USE_SYSTEM_EXTENSIONS
+-# ------------------------
+-# Enable extensions on systems that normally disable them,
+-# typically due to standards-conformance issues.
+-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
+-[
+- AC_BEFORE([$0], [AC_COMPILE_IFELSE])
+- AC_BEFORE([$0], [AC_RUN_IFELSE])
+-
+- AC_REQUIRE([AC_GNU_SOURCE])
+- AC_REQUIRE([AC_AIX])
+- AC_REQUIRE([AC_MINIX])
+-
+- AH_VERBATIM([__EXTENSIONS__],
+-[/* Enable extensions on Solaris. */
+-#ifndef __EXTENSIONS__
+-# undef __EXTENSIONS__
+-#endif
+-#ifndef _POSIX_PTHREAD_SEMANTICS
+-# undef _POSIX_PTHREAD_SEMANTICS
+-#endif
+-#ifndef _TANDEM_SOURCE
+-# undef _TANDEM_SOURCE
+-#endif])
+- AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
+- [ac_cv_safe_to_define___extensions__],
+- [AC_COMPILE_IFELSE(
+- [AC_LANG_PROGRAM([
+-# define __EXTENSIONS__ 1
+- AC_INCLUDES_DEFAULT])],
+- [ac_cv_safe_to_define___extensions__=yes],
+- [ac_cv_safe_to_define___extensions__=no])])
+- test $ac_cv_safe_to_define___extensions__ = yes &&
+- AC_DEFINE([__EXTENSIONS__])
+- AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+- AC_DEFINE([_TANDEM_SOURCE])
+-])
+-
+ # gl_USE_SYSTEM_EXTENSIONS
+ # ------------------------
+ # Enable extensions on systems that normally disable them,
diff --git a/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils.inc b/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils.inc
new file mode 100644
index 000000000..bfedf874b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils.inc
@@ -0,0 +1,23 @@
+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"
+
+# diffutils assumes non-glibc compilation with uclibc and
+# this causes it to generate its own implementations of
+# standard functionality. regex.c actually breaks compilation
+# because it uses __mempcpy, there are other things (TBD:
+# see diffutils.mk in buildroot)
+EXTRA_OECONF_libc-uclibc = "--without-included-regex"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils_4.2.31.bb b/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils_4.2.31.bb
new file mode 100644
index 000000000..7dee01883
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils_4.2.31.bb
@@ -0,0 +1,14 @@
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+PR = "r4"
+
+require findutils.inc
+
+SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz \
+ file://gnulib-extension.patch \
+ file://findutils_fix_for_automake-1.12.patch \
+ file://findutils-fix-doc-build-error.patch \
+ "
+
+SRC_URI[md5sum] = "a0e31a0f18a49709bf5a449867c8049a"
+SRC_URI[sha256sum] = "e0d34b8faca0b3cca0703f6c6b498afbe72f0ba16c35980c10ec9ef7724d6204"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils_4.6.0.bb b/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils_4.6.0.bb
new file mode 100644
index 000000000..072d3b3c0
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/foomatic/foomatic-filters_4.0.17.bb b/import-layers/yocto-poky/meta/recipes-extended/foomatic/foomatic-filters_4.0.17.bb
new file mode 100644
index 000000000..0cffedd66
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/foomatic/foomatic-filters_4.0.17.bb
@@ -0,0 +1,39 @@
+SUMMARY = "OpenPrinting printer support - filters"
+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[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/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk-3.1.5/gawk-3.1.5_fix_for_automake-1.12.patch b/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk-3.1.5/gawk-3.1.5_fix_for_automake-1.12.patch
new file mode 100644
index 000000000..b3e7987ce
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk-3.1.5/gawk-3.1.5_fix_for_automake-1.12.patch
@@ -0,0 +1,41 @@
+Upstream-Status: Pending
+
+automake 1.12 has depricated automatic de-ANSI-fication support
+
+this patch avoids these kinds of errors:
+
+| configure.ac:127: error: automatic de-ANSI-fication support has been removed
+| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/aclocal-1.12/protos.m4:12: AM_C_PROTOTYPES is expanded from...
+| configure.ac:127: the top level
+| autom4te: m4 failed with exit status: 1
+...
+| Makefile.am:27: error: automatic de-ANSI-fication support has been removed
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/04
+
+Index: gawk-3.1.5/configure.ac
+===================================================================
+--- gawk-3.1.5.orig/configure.ac
++++ gawk-3.1.5/configure.ac
+@@ -124,7 +124,6 @@ fi
+
+ dnl check for C compiler for automake
+ AM_PROG_CC_STDC
+-AM_C_PROTOTYPES
+
+ dnl Cygwin doesn't like to get libs with full paths
+ dnl since that overrides linking against DLLs.
+Index: gawk-3.1.5/Makefile.am
+===================================================================
+--- gawk-3.1.5.orig/Makefile.am
++++ gawk-3.1.5/Makefile.am
+@@ -24,7 +24,7 @@
+ ## process this file with automake to produce Makefile.in
+
+ # Automatic de-ANSI-fication if needed, make .bz2 files also.
+-AUTOMAKE_OPTIONS = ansi2knr dist-bzip2
++AUTOMAKE_OPTIONS = dist-bzip2
+
+ # This undocumented variable insures that aclocal runs
+ # correctly after changing configure.ac
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk-4.1.3/run-ptest b/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk-4.1.3/run-ptest
new file mode 100644
index 000000000..d23f0bf6d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk-4.1.3/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/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk_3.1.5.bb b/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk_3.1.5.bb
new file mode 100644
index 000000000..7c92bded3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk_3.1.5.bb
@@ -0,0 +1,41 @@
+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 = "www.gnu.org/software/gawk"
+BUGTRACKER = "bug-gawk@gnu.org"
+SECTION = "console/utils"
+
+# gawk <= 3.1.5: GPLv2
+# gawk >= 3.1.6: GPLv3
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+
+RDEPENDS_gawk += "gawk-common"
+RDEPENDS_pgawk += "gawk-common"
+PR = "r2"
+
+SRC_URI = "${GNU_MIRROR}/gawk/gawk-${PV}.tar.gz \
+ file://gawk-3.1.5_fix_for_automake-1.12.patch"
+
+SRC_URI[md5sum] = "4760325489479cac17fe0114b8f62f30"
+SRC_URI[sha256sum] = "463dcb9d0ca398b1d4f5a332f6cd9cec56441265fca616f2ea1b44d459e9f0f8"
+
+inherit autotools gettext texinfo update-alternatives
+
+PACKAGES += "gawk-common pgawk"
+
+FILES_${PN} = "${bindir}/gawk* ${bindir}/igawk"
+FILES_gawk-common += "${datadir}/awk/* ${libexecdir}/awk/*"
+FILES_pgawk = "${bindir}/pgawk*"
+
+ALTERNATIVE_${PN} = "awk"
+ALTERNATIVE_TARGET[awk] = "${bindir}/gawk"
+ALTERNATIVE_PRIORITY = "100"
+
+CFLAGS += "-D PROTOTYPES"
+
+do_install_append() {
+ # remove the link since we don't package it
+ rm ${D}${bindir}/awk
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk_4.1.3.bb b/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk_4.1.3.bb
new file mode 100644
index 000000000..6ca7f3ef4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk_4.1.3.bb
@@ -0,0 +1,46 @@
+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] = "55d37f4069502677f25d1340df8eec97"
+SRC_URI[sha256sum] = "524effa5b9ecd4ed940f2581c5d3c1df4e4bd7e6f768aa033c1916f47dfc6e29"
+
+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; \
+ do cp ${S}/test/$i* ${D}${PTEST_PATH}/test; \
+ done
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/files/0001-Bug-696497-Fix-support-for-building-with-no-jbig2-de.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/files/0001-Bug-696497-Fix-support-for-building-with-no-jbig2-de.patch
new file mode 100644
index 000000000..d586a1d6d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/files/0001-Bug-696497-Fix-support-for-building-with-no-jbig2-de.patch
@@ -0,0 +1,81 @@
+From 1d19998091154f89b8294e4594a05986b4c2f822 Mon Sep 17 00:00:00 2001
+From: Chris Liddell <chris.liddell@artifex.com>
+Date: Wed, 13 Jan 2016 02:08:42 -0500
+Subject: [PATCH 1/2] Bug 696497: Fix support for building with no jbig2
+ decoder
+
+Author: Chris Liddell <chris.liddell@artifex.com>
+
+Upstream-Status: Backport
+http://bugs.ghostscript.com/show_bug.cgi?id=696497
+http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=b0f5a975
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ base/lib.mak | 9 +++++++++
+ psi/int.mak | 23 ++++++++++++++++++-----
+ 2 files changed, 27 insertions(+), 5 deletions(-)
+
+diff --git a/base/lib.mak b/base/lib.mak
+index 241df2f..daa7056 100644
+--- a/base/lib.mak
++++ b/base/lib.mak
+@@ -1732,6 +1732,10 @@ $(GLD)sjbig2_jbig2dec.dev : $(LIB_MAK) $(ECHOGS_XE) \
+ $(SETMOD) $(GLD)sjbig2_jbig2dec $(sjbig2_jbig2dec)
+ $(ADDMOD) $(GLD)sjbig2_jbig2dec -include $(GLD)jbig2dec.dev
+
++$(GLD)sjbig2_.dev : $(LIB_MAK) $(ECHOGS_XE) \
++ $(LIB_MAK) $(MAKEDIRS)
++ $(SETMOD) $(GLD)sjbig2_
++
+ # jbig2dec.dev is defined in jbig2.mak
+
+ $(GLOBJ)sjbig2.$(OBJ) : $(GLSRC)sjbig2.c $(AK) \
+@@ -1739,6 +1743,11 @@ $(GLOBJ)sjbig2.$(OBJ) : $(GLSRC)sjbig2.c $(AK) \
+ $(sjbig2_h) $(strimpl_h) $(MAKEDIRS)
+ $(GLJBIG2CC) $(GLO_)sjbig2.$(OBJ) $(C_) $(GLSRC)sjbig2.c
+
++$(GLOBJ)snojbig2.$(OBJ) : $(GLSRC)snojbig2.c $(AK) \
++ $(stdint__h) $(memory__h) $(stdio__h) $(gserrors_h) $(gdebug_h) \
++ $(strimpl_h) $(LIB_MAK) $(MAKEDIRS)
++ $(GLJBIG2CC) $(GLO_)snojbig2.$(OBJ) $(C_) $(GLSRC)snojbig2.c
++
+ # luratech version
+ sjbig2_luratech=$(GLOBJ)sjbig2_luratech.$(OBJ)
+
+diff --git a/psi/int.mak b/psi/int.mak
+index 6149a3b..f9d667d 100644
+--- a/psi/int.mak
++++ b/psi/int.mak
+@@ -1254,11 +1254,24 @@ $(PSOBJ)zfaes.$(OBJ) : $(PSSRC)zfaes.c $(OP) $(memory__h)\
+ # this can be turned on and off with a FEATURE_DEV
+
+ fjbig2_=$(PSOBJ)zfjbig2_$(JBIG2_LIB).$(OBJ)
+-$(PSD)jbig2.dev : $(INT_MAK) $(ECHOGS_XE) $(fjbig2_) $(GLD)sjbig2.dev\
+- $(MAKEDIRS)
+- $(SETMOD) $(PSD)jbig2 $(fjbig2_)
+- $(ADDMOD) $(PSD)jbig2 -include $(GLD)sjbig2
+- $(ADDMOD) $(PSD)jbig2 -oper zfjbig2
++
++$(PSD)jbig2_jbig2dec.dev : $(ECHOGS_XE) $(fjbig2_) $(GLD)sjbig2.dev\
++ $(INT_MAK) $(MAKEDIRS)
++ $(SETMOD) $(PSD)jbig2_jbig2dec $(fjbig2_)
++ $(ADDMOD) $(PSD)jbig2_jbig2dec -include $(GLD)sjbig2
++ $(ADDMOD) $(PSD)jbig2_jbig2dec -oper zfjbig2
++
++$(PSD)jbig2_luratech.dev : $(ECHOGS_XE) $(fjbig2_) $(GLD)sjbig2.dev\
++ $(INT_MAK) $(MAKEDIRS)
++ $(SETMOD) $(PSD)jbig2_luratech $(fjbig2_)
++ $(ADDMOD) $(PSD)jbig2_luratech -include $(GLD)sjbig2
++ $(ADDMOD) $(PSD)jbig2_luratech -oper zfjbig2
++
++$(PSD)jbig2_.dev : $(ECHOGS_XE) $(INT_MAK) $(MAKEDIRS)
++ $(SETMOD) $(PSD)jbig2_
++
++$(PSD)jbig2.dev : $(PSD)jbig2_$(JBIG2_LIB).dev $(INT_MAK) $(MAKEDIRS)
++ $(CP_) $(PSD)jbig2_$(JBIG2_LIB).dev $(PSD)jbig2.dev
+
+ $(PSOBJ)zfjbig2_jbig2dec.$(OBJ) : $(PSSRC)zfjbig2.c $(OP) $(memory__h)\
+ $(gsstruct_h) $(gstypes_h) $(ialloc_h) $(idict_h) $(ifilter_h)\
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/files/0002-Bug-696497-part-2-fix-support-for-building-with-a-JP.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/files/0002-Bug-696497-part-2-fix-support-for-building-with-a-JP.patch
new file mode 100644
index 000000000..fcfc479fb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/files/0002-Bug-696497-part-2-fix-support-for-building-with-a-JP.patch
@@ -0,0 +1,48 @@
+From 3b43f93ec02611c4d554612953f5b64765b8683b Mon Sep 17 00:00:00 2001
+From: Chris Liddell <chris.liddell@artifex.com>
+Date: Wed, 13 Jan 2016 02:14:55 -0500
+Subject: [PATCH 2/2] Bug 696497 (part 2): fix support for building with a JPX
+ decoder
+
+Author: Chris Liddell <chris.liddell@artifex.com>
+
+Upstream-Status: Backport
+http://bugs.ghostscript.com/show_bug.cgi?id=696497
+http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=b0f5a975
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ base/lib.mak | 3 +++
+ psi/int.mak | 3 +++
+ 2 files changed, 6 insertions(+)
+
+diff --git a/base/lib.mak b/base/lib.mak
+index daa7056..8853dd5 100644
+--- a/base/lib.mak
++++ b/base/lib.mak
+@@ -1774,6 +1774,9 @@ $(GLOBJ)sjpx.$(OBJ) : $(GLSRC)sjpx.c $(AK) \
+ $(gdebug_h) $(strimpl_h) $(sjpx_h) $(MAKEDIRS)
+ $(GLJASCC) $(GLO_)sjpx.$(OBJ) $(C_) $(GLSRC)sjpx.c
+
++$(GLD)sjpx_.dev : $(LIB_MAK) $(ECHOGS_XE) $(LIB_MAK) $(MAKEDIRS)
++ $(SETMOD) $(GLD)sjpx_
++
+ # luratech version
+ sjpx_luratech=$(GLOBJ)sjpx_luratech.$(OBJ)
+ $(GLD)sjpx_luratech.dev : $(LIB_MAK) $(ECHOGS_XE) \
+diff --git a/psi/int.mak b/psi/int.mak
+index f9d667d..db01b65 100644
+--- a/psi/int.mak
++++ b/psi/int.mak
+@@ -1290,6 +1290,9 @@ $(PSD)jpx.dev : $(INT_MAK) $(ECHOGS_XE) $(PSD)jpx_$(JPX_LIB).dev\
+ $(MAKEDIRS)
+ $(CP_) $(PSD)jpx_$(JPX_LIB).dev $(PSD)jpx.dev
+
++$(PSD)jpx_.dev : $(ECHOGS_XE) $(INT_MAK) $(MAKEDIRS)
++ $(SETMOD) $(PSD)jpx_
++
+ fjpx_luratech=$(PSOBJ)zfjpx_luratech.$(OBJ)
+
+ $(PSOBJ)zfjpx.$(OBJ) : $(PSSRC)zfjpx.c $(OP) $(memory__h)\
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/files/do-not-check-local-libpng-source.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/files/do-not-check-local-libpng-source.patch
new file mode 100644
index 000000000..b445a6c9e
--- /dev/null
+++ b/import-layers/yocto-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 ab30a97..b762fd7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -955,11 +955,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 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
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/aarch64/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/aarch64/objarch.h
new file mode 100644
index 000000000..a05de29de
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/arm/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/arm/objarch.h
new file mode 100644
index 000000000..e8772cd95
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/armeb/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/armeb/objarch.h
new file mode 100644
index 000000000..359097f35
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/base-genht.c-add-a-preprocessor-define-to-allow-fope.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/cups-no-gcrypt.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/cups-no-gcrypt.patch
new file mode 100644
index 000000000..a1c9368cc
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-genarch.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-genarch.patch
new file mode 100644
index 000000000..e28a949bf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-genarch.patch
@@ -0,0 +1,28 @@
+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
+#
+
+diff -Nru ghostscript-8.64.orig/base/lib.mak ghostscript-8.64/base/lib.mak
+--- ghostscript-8.64.orig/base/lib.mak 2010-02-10 10:30:02.000000000 +0800
++++ ghostscript-8.64/base/lib.mak 2010-02-10 10:56:21.000000000 +0800
+@@ -67,8 +67,8 @@
+ stdpre_h=$(GLSRC)stdpre.h $(stdpn_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/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-prevent_recompiling.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-prevent_recompiling.patch
new file mode 100644
index 000000000..bc29be507
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-prevent_recompiling.patch
@@ -0,0 +1,100 @@
+ust 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>
+
+diff --git a/base/unix-aux.mak b/base/unix-aux.mak
+index a91fb26..c991d11 100644
+--- a/base/unix-aux.mak
++++ b/base/unix-aux.mak
+@@ -69,46 +69,46 @@ $(GLOBJ)gp_sysv.$(OBJ): $(GLSRC)gp_sysv.c $(stdio__h) $(time__h) $(AK)\
+ $(MAKEDIRS)
+ $(GLCC) $(GLO_)gp_sysv.$(OBJ) $(C_) $(GLSRC)gp_sysv.c
+
+-# -------------------------- Auxiliary programs --------------------------- #
+-
+-$(ECHOGS_XE): $(GLSRC)echogs.c $(AK) $(stdpre_h) $(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) $(MAKEDIRS)
+- $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENARCH_XE) $(GLSRC)genarch.c $(AUXEXTRALIBS)
+-
+-$(GENCONF_XE): $(GLSRC)genconf.c $(AK) $(GENCONF_DEPS) $(MAKEDIRS)
+- $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENCONF_XE) $(GLSRC)genconf.c $(AUXEXTRALIBS)
+-
+-$(GENDEV_XE): $(GLSRC)gendev.c $(AK) $(GENDEV_DEPS) $(MAKEDIRS)
+- $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENDEV_XE) $(GLSRC)gendev.c $(AUXEXTRALIBS)
+-
+-$(GENHT_XE): $(GLSRC)genht.c $(AK) $(GENHT_DEPS) $(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) $(MAKEDIRS)
+- $(CCAUX_) $(GENOPT) $(CFLAGS) $(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) $(MAKEDIRS)
+- $(CCAUX_) $(GENOPT) $(CFLAGS) $(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) $(MAKEDIRS)
+- $(CP_) $(MKROMFS_XE)_$(SHARE_ZLIB) $(MKROMFS_XE)
++## -------------------------- Auxiliary programs --------------------------- #
++#
++#$(ECHOGS_XE): $(GLSRC)echogs.c $(AK) $(stdpre_h) $(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) $(MAKEDIRS)
++# $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENARCH_XE) $(GLSRC)genarch.c $(AUXEXTRALIBS)
++#
++#$(GENCONF_XE): $(GLSRC)genconf.c $(AK) $(GENCONF_DEPS) $(MAKEDIRS)
++# $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENCONF_XE) $(GLSRC)genconf.c $(AUXEXTRALIBS)
++#
++#$(GENDEV_XE): $(GLSRC)gendev.c $(AK) $(GENDEV_DEPS) $(MAKEDIRS)
++# $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENDEV_XE) $(GLSRC)gendev.c $(AUXEXTRALIBS)
++#
++#$(GENHT_XE): $(GLSRC)genht.c $(AK) $(GENHT_DEPS) $(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) $(MAKEDIRS)
++# $(CCAUX_) $(GENOPT) $(CFLAGS) $(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) $(MAKEDIRS)
++# $(CCAUX_) $(GENOPT) $(CFLAGS) $(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) $(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
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.15-parallel-make.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.15-parallel-make.patch
new file mode 100644
index 000000000..797b8947c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.15-parallel-make.patch
@@ -0,0 +1,40 @@
+From be1e1b33191afdcfe3c2ecc4ff3e361a5859e9c6 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Fri, 30 Jan 2015 00:40:22 -0800
+Subject: [PATCH] contrib.mak: fix for parallel build
+
+Fixed:
+rm: cannot remove `/usr/share/ghostscript/9.15/lib': Is a directory
+
+Create lib before install to fix the race issue.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ contrib/contrib.mak | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/contrib/contrib.mak b/contrib/contrib.mak
+index 08a80d1..de2e20d 100644
+--- a/contrib/contrib.mak
++++ b/contrib/contrib.mak
+@@ -947,6 +947,7 @@ $(DEVOBJ)dviprlib.$(OBJ) : $(JAPSRC)dviprlib.c $(JAPSRC)dviprlib.h
+ $(DEVCC) $(O_)$@ $(C_) $(JAPSRC)dviprlib.c
+
+ extra-dmprt-install:
++ 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
+@@ -1088,6 +1089,7 @@ $(DEVOBJ)gdevalps.$(OBJ) : $(JAPSRC)gdevalps.c $(PDEVH)
+ ### ----------------- Additional .upp files ---------------- ###
+
+ extra-upp-install:
++ mkdir -p $(DESTDIR)$(gsdatadir)$(D)lib
+ for f in $(CONTRIBSRC)uniprint$(D)*.upp; do \
+ $(INSTALL_DATA) $$f $(DESTDIR)$(gsdatadir)$(D)lib || exit 1; \
+ done
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.16-Werror-return-type.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.16-Werror-return-type.patch
new file mode 100644
index 000000000..d78648200
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-native-fix-disable-system-libtiff.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-native-fix-disable-system-libtiff.patch
new file mode 100644
index 000000000..9158117d0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-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>
+Upstream-Status: Pending
+---
+ configure.ac | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
+@@ -1055,6 +1055,7 @@ Disabling tiff output devices.])
+ esac
+
+ if test $SHARE_LIBTIFF -eq 0; then
++ if test -e $LIBTIFFDIR/configure; then
+ echo
+ echo "Running libtiff configure script..."
+ olddir=`pwd`
+@@ -1069,6 +1070,10 @@ if test $SHARE_LIBTIFF -eq 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)
+--
+1.8.1.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/i586/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/i586/objarch.h
new file mode 100644
index 000000000..5817b7a6d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/i686 b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/i686
new file mode 120000
index 000000000..87aaca590
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/i686
@@ -0,0 +1 @@
+i586 \ No newline at end of file
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/microblazeeb/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/microblazeeb/objarch.h
new file mode 100644
index 000000000..63232fdfa
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/microblazeel/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/microblazeel/objarch.h
new file mode 100644
index 000000000..3ec810168
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips/objarch.h
new file mode 100644
index 000000000..b8b637cca
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips/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/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64/objarch.h
new file mode 100644
index 000000000..0d0a16bfa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64/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/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64el/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64el/objarch.h
new file mode 100644
index 000000000..a05de29de
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64el/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/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64eln32/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64eln32/objarch.h
new file mode 100644
index 000000000..a05de29de
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64eln32/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/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64n32/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64n32/objarch.h
new file mode 100644
index 000000000..0d0a16bfa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64n32/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/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mipsel/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mipsel/objarch.h
new file mode 100644
index 000000000..29f90ddf8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mipsel/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/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/nios2/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/nios2/objarch.h
new file mode 100644
index 000000000..3ec810168
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/png_mak.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/png_mak.patch
new file mode 100644
index 000000000..da900ead3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/png_mak.patch
@@ -0,0 +1,21 @@
+ghostscript: add dependency for pnglibconf.h
+
+When using parallel make jobs, we need to be sure that
+pnglibconf.h is created before we try to reference it,
+so add a rule to png.mak.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <jslater@windriver.com>
+
+--- a/base/png.mak
++++ b/base/png.mak
+@@ -81,6 +81,8 @@ png.config-clean :
+ $(pnglibconf_h) : $(PNGSRC)scripts$(D)pnglibconf.h.prebuilt
+ $(CP_) $(PNGSRC)scripts$(D)pnglibconf.h.prebuilt $(pnglibconf_h)
+
++$(MAKEDIRS) : $(pnglibconf_h)
++
+ PDEP=$(AK) $(pnglibconf_h) $(MAKEDIRS)
+
+ png_1=$(PNGOBJ)png.$(OBJ) $(PNGOBJ)pngmem.$(OBJ) $(PNGOBJ)pngerror.$(OBJ) $(PNGOBJ)pngset.$(OBJ)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/powerpc/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/powerpc/objarch.h
new file mode 100644
index 000000000..359097f35
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/powerpc64/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/powerpc64/objarch.h
new file mode 100644
index 000000000..0d0a16bfa
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/x86-64/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/x86-64/objarch.h
new file mode 100644
index 000000000..a05de29de
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript_9.18.bb b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript_9.18.bb
new file mode 100644
index 000000000..d4222c773
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript_9.18.bb
@@ -0,0 +1,107 @@
+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=b17cea54743435ab2a581c237bea294a"
+
+DEPENDS = "ghostscript-native tiff jpeg fontconfig cups libpng"
+DEPENDS_class-native = "libpng-native"
+
+SRC_URI_BASE = "http://downloads.ghostscript.com/public/ghostscript-${PV}.tar.gz \
+ file://ghostscript-9.15-parallel-make.patch \
+ file://ghostscript-9.16-Werror-return-type.patch \
+ file://png_mak.patch \
+ file://0001-Bug-696497-Fix-support-for-building-with-no-jbig2-de.patch \
+ file://0002-Bug-696497-part-2-fix-support-for-building-with-a-JP.patch \
+ file://do-not-check-local-libpng-source.patch \
+"
+
+SRC_URI = "${SRC_URI_BASE} \
+ file://ghostscript-9.02-prevent_recompiling.patch \
+ file://ghostscript-9.02-genarch.patch \
+ file://objarch.h \
+ file://cups-no-gcrypt.patch \
+ "
+
+SRC_URI_class-native = "${SRC_URI_BASE} \
+ file://ghostscript-native-fix-disable-system-libtiff.patch \
+ file://base-genht.c-add-a-preprocessor-define-to-allow-fope.patch \
+ "
+
+SRC_URI[md5sum] = "33a47567d7a591c00a253caddd12a88a"
+SRC_URI[sha256sum] = "5fc93079749a250be5404c465943850e3ed5ffbc0d5c07e10c7c5ee8afbbdb1b"
+
+EXTRA_OECONF = "--without-x --with-system-libtiff --without-jbig2dec \
+ --with-fontpath=${datadir}/fonts \
+ --without-libidn --with-cups-serverbin=${exec_prefix}/lib/cups \
+ --with-cups-datadir=${datadir}/cups \
+ ${@base_conditional('SITEINFO_ENDIANNESS', 'le', '--enable-little-endian', '--enable-big-endian', d)} \
+ "
+
+EXTRA_OECONF_append_mips = " --with-large_color_index=0"
+EXTRA_OECONF_append_mipsel = " --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"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gperf/gperf.inc b/import-layers/yocto-poky/meta/recipes-extended/gperf/gperf.inc
new file mode 100644
index 000000000..a8ce230f6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/gperf/gperf.inc
@@ -0,0 +1,22 @@
+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}/gperf/gperf-${PV}.tar.gz"
+
+inherit autotools
+
+# autoreconf couldn't find acinclude.m4 when stepping into subdirectory. Instead of
+# duplicating acinclude.m4 in every subdirectory, use absolute include path to aclocal
+EXTRA_AUTORECONF += " -I ${S}"
+
+do_configure_prepend() {
+ if [ ! -e ${S}/acinclude.m4 ]; then
+ cat ${S}/aclocal.m4 > ${S}/acinclude.m4
+ fi
+}
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gperf/gperf_3.0.3.bb b/import-layers/yocto-poky/meta/recipes-extended/gperf/gperf_3.0.3.bb
new file mode 100644
index 000000000..772886121
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/gperf/gperf_3.0.3.bb
@@ -0,0 +1,10 @@
+require gperf.inc
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a5f84abb0070adf8a0925d7d534b6e0a \
+ file://src/main.cc;beginline=8;endline=19;md5=72a3034a19e72f08ee48ef8244a121fd"
+
+PR = "r1"
+
+SRC_URI[md5sum] = "cc20e58975a38075440423c8fb85fd00"
+SRC_URI[sha256sum] = "63287527c8d9e27e801cf0804436f3494bd569db05d49dcdd2a942ae72fa9055"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gperf/gperf_3.0.4.bb b/import-layers/yocto-poky/meta/recipes-extended/gperf/gperf_3.0.4.bb
new file mode 100644
index 000000000..64003fc0b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/gperf/gperf_3.0.4.bb
@@ -0,0 +1,5 @@
+require gperf.inc
+
+
+SRC_URI[md5sum] = "c1f1db32fb6598d6a93e6e88796a8632"
+SRC_URI[sha256sum] = "767112a204407e62dbc3106647cf839ed544f3cf5d0f0523aaa2508623aad63e"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/Makevars b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/Makevars
new file mode 100644
index 000000000..8b09f53b0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/Makevars
@@ -0,0 +1,25 @@
+# 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 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/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/fix-for-texinfo-5.1.patch b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/fix-for-texinfo-5.1.patch
new file mode 100644
index 000000000..5a4149cfc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/fix-for-texinfo-5.1.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Inappropriate [Poky Specific this is gplv2 version]
+
+Signed-off-by Saul Wold <sgw@linux.intel.com>
+
+Index: grep-2.5.1a/doc/grep.texi
+===================================================================
+--- grep-2.5.1a.orig/doc/grep.texi
++++ grep-2.5.1a/doc/grep.texi
+@@ -288,7 +288,7 @@ This version number should be included i
+ Print a usage message briefly summarizing these command-line options
+ and the bug-reporting address, then exit.
+
+-@itemx --binary-files=@var{type}
++@item --binary-files=@var{type}
+ @opindex --binary-files
+ @cindex binary files
+ If the first few bytes of a file indicate that the file contains binary
diff --git a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/fix64-int-to-pointer.patch b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/fix64-int-to-pointer.patch
new file mode 100644
index 000000000..3b91520fb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/fix64-int-to-pointer.patch
@@ -0,0 +1,17 @@
+Always use locale.h as HAVE_LOCALE_H is no longer handled by ./configure
+Upstream-Status: Inappropriate [ old version that will not be maintained ]
+Signed-off-by: Alex DAMIAN <alexandru.damian@intel.com>
+
+diff --recursive --unified grep-2.5.1a-orig/lib/hard-locale.c grep-2.5.1a/lib/hard-locale.c
+--- grep-2.5.1a-orig/lib/hard-locale.c 2001-03-04 07:33:12.000000000 +0200
++++ grep-2.5.1a/lib/hard-locale.c 2013-03-11 17:05:52.086444891 +0200
+@@ -38,9 +38,7 @@
+ # endif
+ #endif
+
+-#if HAVE_LOCALE_H
+ # include <locale.h>
+-#endif
+
+ #if HAVE_STRING_H
+ # include <string.h>
diff --git a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/gettext.patch b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/gettext.patch
new file mode 100644
index 000000000..57463355a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/gettext.patch
@@ -0,0 +1,15 @@
+Enable operation with later versions of gettext.
+
+Upstream-Status: Inappropriate
+RP 2012/10/19
+
+Index: grep-2.5.1a/configure.in
+===================================================================
+--- grep-2.5.1a.orig/configure.in 2012-10-19 12:57:51.646970204 +0000
++++ grep-2.5.1a/configure.in 2012-10-19 12:59:49.946968803 +0000
+@@ -140,4 +140,4 @@
+ AC_CHECK_LIB(pcre, pcre_exec)
+ fi
+
+-AC_OUTPUT(Makefile lib/Makefile lib/posix/Makefile src/Makefile tests/Makefile po/Makefile.in intl/Makefile doc/Makefile m4/Makefile vms/Makefile bootstrap/Makefile, [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile; echo timestamp > stamp-h])
++AC_OUTPUT(Makefile lib/Makefile lib/posix/Makefile src/Makefile tests/Makefile po/Makefile.in intl/Makefile doc/Makefile m4/Makefile vms/Makefile bootstrap/Makefile, [echo timestamp > stamp-h])
diff --git a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep-CVE-2012-5667.patch b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep-CVE-2012-5667.patch
new file mode 100644
index 000000000..721f2a0a6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep-CVE-2012-5667.patch
@@ -0,0 +1,33 @@
+The patch to fix CVE-2012-5667
+Reference: https://bugzilla.redhat.com/attachment.cgi?id=686605&action=diff
+
+Multiple integer overflows in GNU Grep before 2.11 might allow
+context-dependent attackers to execute arbitrary code via vectors
+involving a long input line that triggers a heap-based buffer overflow.
+
+http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2012-5667
+
+Upstream-Status: Inappropriate [other]
+This version of GNU Grep has been abandoned upstream and they are no longer
+accepting patches. This is not a backport.
+CVE: CVE-2012-5667
+
+Signed-off-by Ming Liu <ming.liu@windriver.com>
+---
+ grep.c | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+--- a/src/grep.c 2013-05-15 13:39:33.359191769 +0800
++++ a/src/grep.c 2013-05-15 13:50:22.609191882 +0800
+@@ -306,6 +306,11 @@ fillbuf (size_t save, struct stats const
+ int cc = 1;
+ char *readbuf;
+ size_t readsize;
++ const size_t max_save = INT_MAX / 2;
++
++ /* Limit the amount of saved data to INT_MAX to fix CVE-2012-5667 */
++ if (save > max_save)
++ error (2, 0, _("line too long"));
+
+ /* Offset from start of buffer to start of old stuff
+ that we want to save. */
diff --git a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep-egrep-fgrep-Fix-LSB-NG-cases.patch b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep-egrep-fgrep-Fix-LSB-NG-cases.patch
new file mode 100644
index 000000000..327ee5640
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep-egrep-fgrep-Fix-LSB-NG-cases.patch
@@ -0,0 +1,1342 @@
+From c884dd12ec062569335702848fc5f29f436c28fa Mon Sep 17 00:00:00 2001
+From: Li xin <lixin.fnst@cn.fujitsu.com>
+Date: Mon, 25 May 2015 10:15:57 +0900
+Subject: [PATCH] grep egrep fgrep: Fix LSB NG cases.
+
+The LSB core test requires grep egrep and fgrep can
+perform pattern matching in searches without regard
+to case if -i option is specified.
+
+Upstream-Status: backport.
+
+Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
+---
+ lib/posix/regex.h | 4 +
+ src/dfa.c | 22 +-
+ src/grep.c | 96 ++++---
+ src/search.c | 833 +++++++++++++++++++++++++++++++++++++++++++++---------
+ 4 files changed, 768 insertions(+), 187 deletions(-)
+
+diff --git a/lib/posix/regex.h b/lib/posix/regex.h
+index 63c2fef..7bb2b0e 100644
+--- a/lib/posix/regex.h
++++ b/lib/posix/regex.h
+@@ -109,6 +109,10 @@ typedef unsigned long int reg_syntax_t;
+ If not set, \{, \}, {, and } are literals. */
+ #define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
+
++/* If this bit is set, then ignore case when matching.
++ If not set, then case is significant. */
++#define RE_ICASE (RE_INVALID_INTERVAL_ORD << 1)
++
+ /* If this bit is set, +, ? and | aren't recognized as operators.
+ If not set, they are. */
+ #define RE_LIMITED_OPS (RE_INTERVALS << 1)
+diff --git a/src/dfa.c b/src/dfa.c
+index 590bfa7..27c876a 100644
+--- a/src/dfa.c
++++ b/src/dfa.c
+@@ -414,7 +414,7 @@ update_mb_len_index (unsigned char const *p, int len)
+
+ /* This function fetch a wide character, and update cur_mb_len,
+ used only if the current locale is a multibyte environment. */
+-static wchar_t
++static wint_t
+ fetch_wc (char const *eoferr)
+ {
+ wchar_t wc;
+@@ -423,7 +423,7 @@ fetch_wc (char const *eoferr)
+ if (eoferr != 0)
+ dfaerror (eoferr);
+ else
+- return -1;
++ return WEOF;
+ }
+
+ cur_mb_len = mbrtowc(&wc, lexptr, lexleft, &mbs);
+@@ -459,7 +459,7 @@ fetch_wc (char const *eoferr)
+ static void
+ parse_bracket_exp_mb ()
+ {
+- wchar_t wc, wc1, wc2;
++ wint_t wc, wc1, wc2;
+
+ /* Work area to build a mb_char_classes. */
+ struct mb_char_classes *work_mbc;
+@@ -496,7 +496,7 @@ parse_bracket_exp_mb ()
+ work_mbc->invert = 0;
+ do
+ {
+- wc1 = -1; /* mark wc1 is not initialized". */
++ wc1 = WEOF; /* mark wc1 is not initialized". */
+
+ /* Note that if we're looking at some other [:...:] construct,
+ we just treat it as a bunch of ordinary characters. We can do
+@@ -586,7 +586,7 @@ parse_bracket_exp_mb ()
+ work_mbc->coll_elems[work_mbc->ncoll_elems++] = elem;
+ }
+ }
+- wc = -1;
++ wc1 = wc = WEOF;
+ }
+ else
+ /* We treat '[' as a normal character here. */
+@@ -600,7 +600,7 @@ parse_bracket_exp_mb ()
+ wc = fetch_wc(("Unbalanced ["));
+ }
+
+- if (wc1 == -1)
++ if (wc1 == WEOF)
+ wc1 = fetch_wc(_("Unbalanced ["));
+
+ if (wc1 == L'-')
+@@ -630,17 +630,17 @@ parse_bracket_exp_mb ()
+ }
+ REALLOC_IF_NECESSARY(work_mbc->range_sts, wchar_t,
+ range_sts_al, work_mbc->nranges + 1);
+- work_mbc->range_sts[work_mbc->nranges] = wc;
++ work_mbc->range_sts[work_mbc->nranges] = (wchar_t)wc;
+ REALLOC_IF_NECESSARY(work_mbc->range_ends, wchar_t,
+ range_ends_al, work_mbc->nranges + 1);
+- work_mbc->range_ends[work_mbc->nranges++] = wc2;
++ work_mbc->range_ends[work_mbc->nranges++] = (wchar_t)wc2;
+ }
+- else if (wc != -1)
++ else if (wc != WEOF)
+ /* build normal characters. */
+ {
+ REALLOC_IF_NECESSARY(work_mbc->chars, wchar_t, chars_al,
+ work_mbc->nchars + 1);
+- work_mbc->chars[work_mbc->nchars++] = wc;
++ work_mbc->chars[work_mbc->nchars++] = (wchar_t)wc;
+ }
+ }
+ while ((wc = wc1) != L']');
+@@ -2552,6 +2552,8 @@ match_mb_charset (struct dfa *d, int s, position pos, int index)
+ }
+
+ /* match with a character? */
++ if (case_fold)
++ wc = towlower (wc);
+ for (i = 0; i<work_mbc->nchars; i++)
+ {
+ if (wc == work_mbc->chars[i])
+diff --git a/src/grep.c b/src/grep.c
+index 2fb2fac..3fd4b47 100644
+--- a/src/grep.c
++++ b/src/grep.c
+@@ -30,6 +30,12 @@
+ # include <sys/time.h>
+ # include <sys/resource.h>
+ #endif
++#if defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H && defined HAVE_MBRTOWC
++/* We can handle multibyte string. */
++# define MBS_SUPPORT
++# include <wchar.h>
++# include <wctype.h>
++#endif
+ #include <stdio.h>
+ #include "system.h"
+ #include "getopt.h"
+@@ -255,19 +261,6 @@ reset (int fd, char const *file, struct stats *stats)
+ bufbeg[-1] = eolbyte;
+ bufdesc = fd;
+
+- if (fstat (fd, &stats->stat) != 0)
+- {
+- error (0, errno, "fstat");
+- return 0;
+- }
+- if (directories == SKIP_DIRECTORIES && S_ISDIR (stats->stat.st_mode))
+- return 0;
+-#ifndef DJGPP
+- if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode) || S_ISSOCK(stats->stat.st_mode)))
+-#else
+- if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode)))
+-#endif
+- return 0;
+ if (S_ISREG (stats->stat.st_mode))
+ {
+ if (file)
+@@ -558,33 +551,6 @@ prline (char const *beg, char const *lim, int sep)
+ {
+ size_t match_size;
+ size_t match_offset;
+- if(match_icase)
+- {
+- /* Yuck, this is tricky */
+- char *buf = (char*) xmalloc (lim - beg);
+- char *ibeg = buf;
+- char *ilim = ibeg + (lim - beg);
+- int i;
+- for (i = 0; i < lim - beg; i++)
+- ibeg[i] = tolower (beg[i]);
+- while ((match_offset = (*execute) (ibeg, ilim-ibeg, &match_size, 1))
+- != (size_t) -1)
+- {
+- char const *b = beg + match_offset;
+- if (b == lim)
+- break;
+- fwrite (beg, sizeof (char), match_offset, stdout);
+- printf ("\33[%sm", grep_color);
+- fwrite (b, sizeof (char), match_size, stdout);
+- fputs ("\33[00m", stdout);
+- beg = b + match_size;
+- ibeg = ibeg + match_offset + match_size;
+- }
+- fwrite (beg, 1, lim - beg, stdout);
+- free (buf);
+- lastout = lim;
+- return;
+- }
+ while (lim-beg && (match_offset = (*execute) (beg, lim - beg, &match_size, 1))
+ != (size_t) -1)
+ {
+@@ -601,6 +567,7 @@ prline (char const *beg, char const *lim, int sep)
+ fputs ("\33[00m", stdout);
+ beg = b + match_size;
+ }
++ fputs ("\33[K", stdout);
+ }
+ fwrite (beg, 1, lim - beg, stdout);
+ if (ferror (stdout))
+@@ -623,7 +590,7 @@ prpending (char const *lim)
+ size_t match_size;
+ --pending;
+ if (outleft
+- || (((*execute) (lastout, nl - lastout, &match_size, 0) == (size_t) -1)
++ || (((*execute) (lastout, nl + 1 - lastout, &match_size, 0) == (size_t) -1)
+ == !out_invert))
+ prline (lastout, nl + 1, '-');
+ else
+@@ -895,6 +862,19 @@ grepfile (char const *file, struct stats *stats)
+ }
+ else
+ {
++ if (stat (file, &stats->stat) != 0)
++ {
++ suppressible_error (file, errno);
++ return 1;
++ }
++ if (directories == SKIP_DIRECTORIES && S_ISDIR (stats->stat.st_mode))
++ return 1;
++#ifndef DJGPP
++ if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode) || S_ISSOCK(stats->stat.st_mode) || S_ISFIFO(stats->stat.st_mode)))
++#else
++ if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode)))
++#endif
++ return 1;
+ while ((desc = open (file, O_RDONLY)) < 0 && errno == EINTR)
+ continue;
+
+@@ -1681,9 +1661,6 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"))
+ out_invert ^= 1;
+ match_lines = match_words = 0;
+ }
+- else
+- /* Strip trailing newline. */
+- --keycc;
+ }
+ else
+ if (optind < argc)
+@@ -1697,6 +1674,37 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"))
+ if (!install_matcher (matcher) && !install_matcher ("default"))
+ abort ();
+
++#ifdef MBS_SUPPORT
++ if (MB_CUR_MAX != 1 && match_icase)
++ {
++ wchar_t wc;
++ mbstate_t cur_state, prev_state;
++ int i, len = strlen(keys);
++
++ memset(&cur_state, 0, sizeof(mbstate_t));
++ for (i = 0; i <= len ;)
++ {
++ size_t mbclen;
++ mbclen = mbrtowc(&wc, keys + i, len - i, &cur_state);
++ if (mbclen == (size_t) -1 || mbclen == (size_t) -2 || mbclen == 0)
++ {
++ /* An invalid sequence, or a truncated multibyte character.
++ We treat it as a singlebyte character. */
++ mbclen = 1;
++ }
++ else
++ {
++ if (iswupper((wint_t)wc))
++ {
++ wc = towlower((wint_t)wc);
++ wcrtomb(keys + i, wc, &cur_state);
++ }
++ }
++ i += mbclen;
++ }
++ }
++#endif /* MBS_SUPPORT */
++
+ (*compile)(keys, keycc);
+
+ if ((argc - optind > 1 && !no_filenames) || with_filenames)
+diff --git a/src/search.c b/src/search.c
+index 7bd233f..3c6a485 100644
+--- a/src/search.c
++++ b/src/search.c
+@@ -18,9 +18,13 @@
+
+ /* Written August 1992 by Mike Haertel. */
+
++#ifndef _GNU_SOURCE
++# define _GNU_SOURCE 1
++#endif
+ #ifdef HAVE_CONFIG_H
+ # include <config.h>
+ #endif
++#include <assert.h>
+ #include <sys/types.h>
+ #if defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H && defined HAVE_MBRTOWC
+ /* We can handle multibyte string. */
+@@ -31,7 +35,7 @@
+
+ #include "system.h"
+ #include "grep.h"
+-#include "regex.h"
++#include <regex.h>
+ #include "dfa.h"
+ #include "kwset.h"
+ #include "error.h"
+@@ -39,6 +43,9 @@
+ #ifdef HAVE_LIBPCRE
+ # include <pcre.h>
+ #endif
++#ifdef HAVE_LANGINFO_CODESET
++# include <langinfo.h>
++#endif
+
+ #define NCHAR (UCHAR_MAX + 1)
+
+@@ -70,9 +77,10 @@ static kwset_t kwset;
+ call the regexp matcher at all. */
+ static int kwset_exact_matches;
+
+-#if defined(MBS_SUPPORT)
+-static char* check_multibyte_string PARAMS ((char const *buf, size_t size));
+-#endif
++/* UTF-8 encoding allows some optimizations that we can't otherwise
++ assume in a multibyte encoding. */
++static int using_utf8;
++
+ static void kwsinit PARAMS ((void));
+ static void kwsmusts PARAMS ((void));
+ static void Gcompile PARAMS ((char const *, size_t));
+@@ -84,6 +92,15 @@ static void Pcompile PARAMS ((char const *, size_t ));
+ static size_t Pexecute PARAMS ((char const *, size_t, size_t *, int));
+
+ void
++check_utf8 (void)
++{
++#ifdef HAVE_LANGINFO_CODESET
++ if (strcmp (nl_langinfo (CODESET), "UTF-8") == 0)
++ using_utf8 = 1;
++#endif
++}
++
++void
+ dfaerror (char const *mesg)
+ {
+ error (2, 0, mesg);
+@@ -141,38 +158,6 @@ kwsmusts (void)
+ }
+ }
+
+-#ifdef MBS_SUPPORT
+-/* This function allocate the array which correspond to "buf".
+- Then this check multibyte string and mark on the positions which
+- are not singlebyte character nor the first byte of a multibyte
+- character. Caller must free the array. */
+-static char*
+-check_multibyte_string(char const *buf, size_t size)
+-{
+- char *mb_properties = malloc(size);
+- mbstate_t cur_state;
+- int i;
+- memset(&cur_state, 0, sizeof(mbstate_t));
+- memset(mb_properties, 0, sizeof(char)*size);
+- for (i = 0; i < size ;)
+- {
+- size_t mbclen;
+- mbclen = mbrlen(buf + i, size - i, &cur_state);
+-
+- if (mbclen == (size_t) -1 || mbclen == (size_t) -2 || mbclen == 0)
+- {
+- /* An invalid sequence, or a truncated multibyte character.
+- We treat it as a singlebyte character. */
+- mbclen = 1;
+- }
+- mb_properties[i] = mbclen;
+- i += mbclen;
+- }
+-
+- return mb_properties;
+-}
+-#endif
+-
+ static void
+ Gcompile (char const *pattern, size_t size)
+ {
+@@ -181,7 +166,8 @@ Gcompile (char const *pattern, size_t size)
+ size_t total = size;
+ char const *motif = pattern;
+
+- re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE);
++ check_utf8 ();
++ re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE | (match_icase ? RE_ICASE : 0));
+ dfasyntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE, match_icase, eolbyte);
+
+ /* For GNU regex compiler we have to pass the patterns separately to detect
+@@ -218,6 +204,10 @@ Gcompile (char const *pattern, size_t size)
+ motif = sep;
+ } while (sep && total != 0);
+
++ /* Strip trailing newline. */
++ if (size && pattern[size - 1] == '\n')
++ size--;
++
+ /* In the match_words and match_lines cases, we use a different pattern
+ for the DFA matcher that will quickly throw out cases that won't work.
+ Then if DFA succeeds we do some hairy stuff using the regex matcher
+@@ -233,7 +223,7 @@ Gcompile (char const *pattern, size_t size)
+ static char const line_end[] = "\\)$";
+ static char const word_beg[] = "\\(^\\|[^[:alnum:]_]\\)\\(";
+ static char const word_end[] = "\\)\\([^[:alnum:]_]\\|$\\)";
+- char *n = malloc (sizeof word_beg - 1 + size + sizeof word_end);
++ char *n = xmalloc (sizeof word_beg - 1 + size + sizeof word_end);
+ size_t i;
+ strcpy (n, match_lines ? line_beg : word_beg);
+ i = strlen (n);
+@@ -257,14 +247,15 @@ Ecompile (char const *pattern, size_t size)
+ size_t total = size;
+ char const *motif = pattern;
+
++ check_utf8 ();
+ if (strcmp (matcher, "awk") == 0)
+ {
+- re_set_syntax (RE_SYNTAX_AWK);
++ re_set_syntax (RE_SYNTAX_AWK | (match_icase ? RE_ICASE : 0));
+ dfasyntax (RE_SYNTAX_AWK, match_icase, eolbyte);
+ }
+ else
+ {
+- re_set_syntax (RE_SYNTAX_POSIX_EGREP);
++ re_set_syntax (RE_SYNTAX_POSIX_EGREP | (match_icase ? RE_ICASE : 0));
+ dfasyntax (RE_SYNTAX_POSIX_EGREP, match_icase, eolbyte);
+ }
+
+@@ -301,6 +292,10 @@ Ecompile (char const *pattern, size_t size)
+ motif = sep;
+ } while (sep && total != 0);
+
++ /* Strip trailing newline. */
++ if (size && pattern[size - 1] == '\n')
++ size--;
++
+ /* In the match_words and match_lines cases, we use a different pattern
+ for the DFA matcher that will quickly throw out cases that won't work.
+ Then if DFA succeeds we do some hairy stuff using the regex matcher
+@@ -316,7 +311,7 @@ Ecompile (char const *pattern, size_t size)
+ static char const line_end[] = ")$";
+ static char const word_beg[] = "(^|[^[:alnum:]_])(";
+ static char const word_end[] = ")([^[:alnum:]_]|$)";
+- char *n = malloc (sizeof word_beg - 1 + size + sizeof word_end);
++ char *n = xmalloc (sizeof word_beg - 1 + size + sizeof word_end);
+ size_t i;
+ strcpy (n, match_lines ? line_beg : word_beg);
+ i = strlen(n);
+@@ -339,15 +334,34 @@ EGexecute (char const *buf, size_t size, size_t *match_size, int exact)
+ char eol = eolbyte;
+ int backref, start, len;
+ struct kwsmatch kwsm;
+- size_t i;
++ size_t i, ret_val;
++ static int use_dfa;
++ static int use_dfa_checked = 0;
+ #ifdef MBS_SUPPORT
+- char *mb_properties = NULL;
++ int mb_cur_max = MB_CUR_MAX;
++ mbstate_t mbs;
++ memset (&mbs, '\0', sizeof (mbstate_t));
+ #endif /* MBS_SUPPORT */
+
++ if (!use_dfa_checked)
++ {
++ char *grep_use_dfa = getenv ("GREP_USE_DFA");
++ if (!grep_use_dfa)
++ {
+ #ifdef MBS_SUPPORT
+- if (MB_CUR_MAX > 1 && kwset)
+- mb_properties = check_multibyte_string(buf, size);
++ /* Turn off DFA when processing multibyte input. */
++ use_dfa = (MB_CUR_MAX == 1);
++#else
++ use_dfa = 1;
+ #endif /* MBS_SUPPORT */
++ }
++ else
++ {
++ use_dfa = atoi (grep_use_dfa);
++ }
++
++ use_dfa_checked = 1;
++ }
+
+ buflim = buf + size;
+
+@@ -358,47 +372,120 @@ EGexecute (char const *buf, size_t size, size_t *match_size, int exact)
+ if (kwset)
+ {
+ /* Find a possible match using the KWset matcher. */
+- size_t offset = kwsexec (kwset, beg, buflim - beg, &kwsm);
++#ifdef MBS_SUPPORT
++ size_t bytes_left = 0;
++#endif /* MBS_SUPPORT */
++ size_t offset;
++#ifdef MBS_SUPPORT
++ /* kwsexec doesn't work with match_icase and multibyte input. */
++ if (match_icase && mb_cur_max > 1)
++ /* Avoid kwset */
++ offset = 0;
++ else
++#endif /* MBS_SUPPORT */
++ offset = kwsexec (kwset, beg, buflim - beg, &kwsm);
+ if (offset == (size_t) -1)
+- {
++ goto failure;
+ #ifdef MBS_SUPPORT
+- if (MB_CUR_MAX > 1)
+- free(mb_properties);
+-#endif
+- return (size_t)-1;
++ if (mb_cur_max > 1 && !using_utf8)
++ {
++ bytes_left = offset;
++ while (bytes_left)
++ {
++ size_t mlen = mbrlen (beg, bytes_left, &mbs);
++ if (mlen == (size_t) -1 || mlen == 0)
++ {
++ /* Incomplete character: treat as single-byte. */
++ memset (&mbs, '\0', sizeof (mbstate_t));
++ beg++;
++ bytes_left--;
++ continue;
++ }
++
++ if (mlen == (size_t) -2)
++ /* Offset points inside multibyte character:
++ * no good. */
++ break;
++
++ beg += mlen;
++ bytes_left -= mlen;
++ }
+ }
++ else
++#endif /* MBS_SUPPORT */
+ beg += offset;
+ /* Narrow down to the line containing the candidate, and
+ run it through DFA. */
+ end = memchr(beg, eol, buflim - beg);
+ end++;
+ #ifdef MBS_SUPPORT
+- if (MB_CUR_MAX > 1 && mb_properties[beg - buf] == 0)
++ if (mb_cur_max > 1 && bytes_left)
+ continue;
+-#endif
++#endif /* MBS_SUPPORT */
+ while (beg > buf && beg[-1] != eol)
+ --beg;
+- if (kwsm.index < kwset_exact_matches)
+- goto success;
+- if (dfaexec (&dfa, beg, end - beg, &backref) == (size_t) -1)
++ if (
++#ifdef MBS_SUPPORT
++ !(match_icase && mb_cur_max > 1) &&
++#endif /* MBS_SUPPORT */
++ (kwsm.index < kwset_exact_matches))
++ goto success_in_beg_and_end;
++ if (use_dfa &&
++ dfaexec (&dfa, beg, end - beg, &backref) == (size_t) -1)
+ continue;
+ }
+ else
+ {
+ /* No good fixed strings; start with DFA. */
+- size_t offset = dfaexec (&dfa, beg, buflim - beg, &backref);
++#ifdef MBS_SUPPORT
++ size_t bytes_left = 0;
++#endif /* MBS_SUPPORT */
++ size_t offset = 0;
++ if (use_dfa)
++ offset = dfaexec (&dfa, beg, buflim - beg, &backref);
+ if (offset == (size_t) -1)
+ break;
+ /* Narrow down to the line we've found. */
++#ifdef MBS_SUPPORT
++ if (mb_cur_max > 1 && !using_utf8)
++ {
++ bytes_left = offset;
++ while (bytes_left)
++ {
++ size_t mlen = mbrlen (beg, bytes_left, &mbs);
++ if (mlen == (size_t) -1 || mlen == 0)
++ {
++ /* Incomplete character: treat as single-byte. */
++ memset (&mbs, '\0', sizeof (mbstate_t));
++ beg++;
++ bytes_left--;
++ continue;
++ }
++
++ if (mlen == (size_t) -2)
++ /* Offset points inside multibyte character:
++ * no good. */
++ break;
++
++ beg += mlen;
++ bytes_left -= mlen;
++ }
++ }
++ else
++#endif /* MBS_SUPPORT */
+ beg += offset;
+ end = memchr (beg, eol, buflim - beg);
+ end++;
++#ifdef MBS_SUPPORT
++ if (mb_cur_max > 1 && bytes_left)
++ continue;
++#endif /* MBS_SUPPORT */
+ while (beg > buf && beg[-1] != eol)
+ --beg;
+ }
+ /* Successful, no backreferences encountered! */
+- if (!backref)
+- goto success;
++ if (use_dfa && !backref)
++ goto success_in_beg_and_end;
+ }
+ else
+ end = beg + size;
+@@ -413,14 +500,11 @@ EGexecute (char const *buf, size_t size, size_t *match_size, int exact)
+ end - beg - 1, &(patterns[i].regs))))
+ {
+ len = patterns[i].regs.end[0] - start;
+- if (exact)
+- {
+- *match_size = len;
+- return start;
+- }
++ if (exact && !match_words)
++ goto success_in_start_and_len;
+ if ((!match_lines && !match_words)
+ || (match_lines && len == end - beg - 1))
+- goto success;
++ goto success_in_beg_and_end;
+ /* If -w, check if the match aligns with word boundaries.
+ We do this iteratively because:
+ (a) the line may contain more than one occurence of the
+@@ -431,10 +515,114 @@ EGexecute (char const *buf, size_t size, size_t *match_size, int exact)
+ if (match_words)
+ while (start >= 0)
+ {
+- if ((start == 0 || !WCHAR ((unsigned char) beg[start - 1]))
+- && (len == end - beg - 1
+- || !WCHAR ((unsigned char) beg[start + len])))
+- goto success;
++ int lword_match = 0;
++ if (start == 0)
++ lword_match = 1;
++ else
++ {
++ assert (start > 0);
++#ifdef MBS_SUPPORT
++ if (mb_cur_max > 1)
++ {
++ const char *s;
++ size_t mr;
++ wchar_t pwc;
++
++ /* Locate the start of the multibyte character
++ before the match position (== beg + start). */
++ if (using_utf8)
++ {
++ /* UTF-8 is a special case: scan backwards
++ until we find a 7-bit character or a
++ lead byte. */
++ s = beg + start - 1;
++ while (s > buf
++ && (unsigned char) *s >= 0x80
++ && (unsigned char) *s <= 0xbf)
++ --s;
++ }
++ else
++ {
++ /* Scan forwards to find the start of the
++ last complete character before the
++ match position. */
++ size_t bytes_left = start - 1;
++ s = beg;
++ while (bytes_left > 0)
++ {
++ mr = mbrlen (s, bytes_left, &mbs);
++ if (mr == (size_t) -1 || mr == 0)
++ {
++ memset (&mbs, '\0', sizeof (mbs));
++ s++;
++ bytes_left--;
++ continue;
++ }
++ if (mr == (size_t) -2)
++ {
++ memset (&mbs, '\0', sizeof (mbs));
++ break;
++ }
++ s += mr;
++ bytes_left -= mr;
++ }
++ }
++ mr = mbrtowc (&pwc, s, beg + start - s, &mbs);
++ if (mr == (size_t) -2 || mr == (size_t) -1 ||
++ mr == 0)
++ {
++ memset (&mbs, '\0', sizeof (mbstate_t));
++ lword_match = 1;
++ }
++ else if (!(iswalnum (pwc) || pwc == L'_')
++ && mr == beg + start - s)
++ lword_match = 1;
++ }
++ else
++#endif /* MBS_SUPPORT */
++ if (!WCHAR ((unsigned char) beg[start - 1]))
++ lword_match = 1;
++ }
++
++ if (lword_match)
++ {
++ int rword_match = 0;
++ if (start + len == end - beg - 1)
++ rword_match = 1;
++ else
++ {
++#ifdef MBS_SUPPORT
++ if (mb_cur_max > 1)
++ {
++ wchar_t nwc;
++ int mr;
++
++ mr = mbtowc (&nwc, beg + start + len,
++ end - beg - start - len - 1);
++ if (mr <= 0)
++ {
++ memset (&mbs, '\0', sizeof (mbstate_t));
++ rword_match = 1;
++ }
++ else if (!iswalnum (nwc) && nwc != L'_')
++ rword_match = 1;
++ }
++ else
++#endif /* MBS_SUPPORT */
++ if (!WCHAR ((unsigned char) beg[start + len]))
++ rword_match = 1;
++ }
++
++ if (rword_match)
++ {
++ if (!exact)
++ /* Returns the whole line. */
++ goto success_in_beg_and_end;
++ else
++ /* Returns just this word match. */
++ goto success_in_start_and_len;
++ }
++ }
+ if (len > 0)
+ {
+ /* Try a shorter length anchored at the same place. */
+@@ -461,26 +649,154 @@ EGexecute (char const *buf, size_t size, size_t *match_size, int exact)
+ }
+ } /* for Regex patterns. */
+ } /* for (beg = end ..) */
+-#ifdef MBS_SUPPORT
+- if (MB_CUR_MAX > 1 && mb_properties)
+- free (mb_properties);
+-#endif /* MBS_SUPPORT */
++
++ failure:
+ return (size_t) -1;
+
+- success:
+-#ifdef MBS_SUPPORT
+- if (MB_CUR_MAX > 1 && mb_properties)
+- free (mb_properties);
+-#endif /* MBS_SUPPORT */
+- *match_size = end - beg;
+- return beg - buf;
++ success_in_beg_and_end:
++ len = end - beg;
++ start = beg - buf;
++ /* FALLTHROUGH */
++
++ success_in_start_and_len:
++ *match_size = len;
++ return start;
+ }
+
++#ifdef MBS_SUPPORT
++static int f_i_multibyte; /* whether we're using the new -Fi MB method */
++static struct
++{
++ wchar_t **patterns;
++ size_t count, maxlen;
++ unsigned char *match;
++} Fimb;
++#endif
++
+ static void
+ Fcompile (char const *pattern, size_t size)
+ {
++ int mb_cur_max = MB_CUR_MAX;
+ char const *beg, *lim, *err;
+
++ check_utf8 ();
++#ifdef MBS_SUPPORT
++ /* Support -F -i for UTF-8 input. */
++ if (match_icase && mb_cur_max > 1)
++ {
++ mbstate_t mbs;
++ wchar_t *wcpattern = xmalloc ((size + 1) * sizeof (wchar_t));
++ const char *patternend = pattern;
++ size_t wcsize;
++ kwset_t fimb_kwset = NULL;
++ char *starts = NULL;
++ wchar_t *wcbeg, *wclim;
++ size_t allocated = 0;
++
++ memset (&mbs, '\0', sizeof (mbs));
++# ifdef __GNU_LIBRARY__
++ wcsize = mbsnrtowcs (wcpattern, &patternend, size, size, &mbs);
++ if (patternend != pattern + size)
++ wcsize = (size_t) -1;
++# else
++ {
++ char *patterncopy = xmalloc (size + 1);
++
++ memcpy (patterncopy, pattern, size);
++ patterncopy[size] = '\0';
++ patternend = patterncopy;
++ wcsize = mbsrtowcs (wcpattern, &patternend, size, &mbs);
++ if (patternend != patterncopy + size)
++ wcsize = (size_t) -1;
++ free (patterncopy);
++ }
++# endif
++ if (wcsize + 2 <= 2)
++ {
++fimb_fail:
++ free (wcpattern);
++ free (starts);
++ if (fimb_kwset)
++ kwsfree (fimb_kwset);
++ free (Fimb.patterns);
++ Fimb.patterns = NULL;
++ }
++ else
++ {
++ if (!(fimb_kwset = kwsalloc (NULL)))
++ error (2, 0, _("memory exhausted"));
++
++ starts = xmalloc (mb_cur_max * 3);
++ wcbeg = wcpattern;
++ do
++ {
++ int i;
++ size_t wclen;
++
++ if (Fimb.count >= allocated)
++ {
++ if (allocated == 0)
++ allocated = 128;
++ else
++ allocated *= 2;
++ Fimb.patterns = xrealloc (Fimb.patterns,
++ sizeof (wchar_t *) * allocated);
++ }
++ Fimb.patterns[Fimb.count++] = wcbeg;
++ for (wclim = wcbeg;
++ wclim < wcpattern + wcsize && *wclim != L'\n'; ++wclim)
++ *wclim = towlower (*wclim);
++ *wclim = L'\0';
++ wclen = wclim - wcbeg;
++ if (wclen > Fimb.maxlen)
++ Fimb.maxlen = wclen;
++ if (wclen > 3)
++ wclen = 3;
++ if (wclen == 0)
++ {
++ if ((err = kwsincr (fimb_kwset, "", 0)) != 0)
++ error (2, 0, err);
++ }
++ else
++ for (i = 0; i < (1 << wclen); i++)
++ {
++ char *p = starts;
++ int j, k;
++
++ for (j = 0; j < wclen; ++j)
++ {
++ wchar_t wc = wcbeg[j];
++ if (i & (1 << j))
++ {
++ wc = towupper (wc);
++ if (wc == wcbeg[j])
++ continue;
++ }
++ k = wctomb (p, wc);
++ if (k <= 0)
++ goto fimb_fail;
++ p += k;
++ }
++ if ((err = kwsincr (fimb_kwset, starts, p - starts)) != 0)
++ error (2, 0, err);
++ }
++ if (wclim < wcpattern + wcsize)
++ ++wclim;
++ wcbeg = wclim;
++ }
++ while (wcbeg < wcpattern + wcsize);
++ f_i_multibyte = 1;
++ kwset = fimb_kwset;
++ free (starts);
++ Fimb.match = xmalloc (Fimb.count);
++ if ((err = kwsprep (kwset)) != 0)
++ error (2, 0, err);
++ return;
++ }
++ }
++#endif /* MBS_SUPPORT */
++
++
+ kwsinit ();
+ beg = pattern;
+ do
+@@ -499,6 +815,76 @@ Fcompile (char const *pattern, size_t size)
+ error (2, 0, err);
+ }
+
++#ifdef MBS_SUPPORT
++static int
++Fimbexec (const char *buf, size_t size, size_t *plen, int exact)
++{
++ size_t len, letter, i;
++ int ret = -1;
++ mbstate_t mbs;
++ wchar_t wc;
++ int patterns_left;
++
++ assert (match_icase && f_i_multibyte == 1);
++ assert (MB_CUR_MAX > 1);
++
++ memset (&mbs, '\0', sizeof (mbs));
++ memset (Fimb.match, '\1', Fimb.count);
++ letter = len = 0;
++ patterns_left = 1;
++ while (patterns_left && len <= size)
++ {
++ size_t c;
++
++ patterns_left = 0;
++ if (len < size)
++ {
++ c = mbrtowc (&wc, buf + len, size - len, &mbs);
++ if (c + 2 <= 2)
++ return ret;
++
++ wc = towlower (wc);
++ }
++ else
++ {
++ c = 1;
++ wc = L'\0';
++ }
++
++ for (i = 0; i < Fimb.count; i++)
++ {
++ if (Fimb.match[i])
++ {
++ if (Fimb.patterns[i][letter] == L'\0')
++ {
++ /* Found a match. */
++ *plen = len;
++ if (!exact && !match_words)
++ return 0;
++ else
++ {
++ /* For -w or exact look for longest match. */
++ ret = 0;
++ Fimb.match[i] = '\0';
++ continue;
++ }
++ }
++
++ if (Fimb.patterns[i][letter] == wc)
++ patterns_left = 1;
++ else
++ Fimb.match[i] = '\0';
++ }
++ }
++
++ len += c;
++ letter++;
++ }
++
++ return ret;
++}
++#endif /* MBS_SUPPORT */
++
+ static size_t
+ Fexecute (char const *buf, size_t size, size_t *match_size, int exact)
+ {
+@@ -506,88 +892,268 @@ Fexecute (char const *buf, size_t size, size_t *match_size, int exact)
+ register size_t len;
+ char eol = eolbyte;
+ struct kwsmatch kwsmatch;
++ size_t ret_val;
+ #ifdef MBS_SUPPORT
+- char *mb_properties;
+- if (MB_CUR_MAX > 1)
+- mb_properties = check_multibyte_string (buf, size);
++ int mb_cur_max = MB_CUR_MAX;
++ mbstate_t mbs;
++ memset (&mbs, '\0', sizeof (mbstate_t));
++ const char *last_char = NULL;
+ #endif /* MBS_SUPPORT */
+
+- for (beg = buf; beg <= buf + size; ++beg)
++ for (beg = buf; beg < buf + size; ++beg)
+ {
+- size_t offset = kwsexec (kwset, beg, buf + size - beg, &kwsmatch);
++ size_t offset;
++ offset = kwsexec (kwset, beg, buf + size - beg, &kwsmatch);
++
+ if (offset == (size_t) -1)
+- {
++ goto failure;
+ #ifdef MBS_SUPPORT
+- if (MB_CUR_MAX > 1)
+- free(mb_properties);
+-#endif /* MBS_SUPPORT */
+- return offset;
++ if (mb_cur_max > 1 && !using_utf8)
++ {
++ size_t bytes_left = offset;
++ while (bytes_left)
++ {
++ size_t mlen = mbrlen (beg, bytes_left, &mbs);
++
++ last_char = beg;
++ if (mlen == (size_t) -1 || mlen == 0)
++ {
++ /* Incomplete character: treat as single-byte. */
++ memset (&mbs, '\0', sizeof (mbstate_t));
++ beg++;
++ bytes_left--;
++ continue;
++ }
++
++ if (mlen == (size_t) -2)
++ /* Offset points inside multibyte character: no good. */
++ break;
++
++ beg += mlen;
++ bytes_left -= mlen;
++ }
++
++ if (bytes_left)
++ continue;
+ }
+-#ifdef MBS_SUPPORT
+- if (MB_CUR_MAX > 1 && mb_properties[offset+beg-buf] == 0)
+- continue; /* It is a part of multibyte character. */
++ else
+ #endif /* MBS_SUPPORT */
+ beg += offset;
+- len = kwsmatch.size[0];
+- if (exact)
+- {
+- *match_size = len;
+ #ifdef MBS_SUPPORT
+- if (MB_CUR_MAX > 1)
+- free (mb_properties);
++ /* For f_i_multibyte, the string at beg now matches first 3 chars of
++ one of the search strings (less if there are shorter search strings).
++ See if this is a real match. */
++ if (f_i_multibyte
++ && Fimbexec (beg, buf + size - beg, &kwsmatch.size[0], exact))
++ goto next_char;
+ #endif /* MBS_SUPPORT */
+- return beg - buf;
+- }
++ len = kwsmatch.size[0];
++ if (exact && !match_words)
++ goto success_in_beg_and_len;
+ if (match_lines)
+ {
+ if (beg > buf && beg[-1] != eol)
+- continue;
++ goto next_char;
+ if (beg + len < buf + size && beg[len] != eol)
+- continue;
++ goto next_char;
+ goto success;
+ }
+ else if (match_words)
+- for (try = beg; len; )
+- {
+- if (try > buf && WCHAR((unsigned char) try[-1]))
+- break;
+- if (try + len < buf + size && WCHAR((unsigned char) try[len]))
+- {
+- offset = kwsexec (kwset, beg, --len, &kwsmatch);
+- if (offset == (size_t) -1)
+- {
++ {
++ while (len)
++ {
++ int word_match = 0;
++ if (beg > buf)
++ {
+ #ifdef MBS_SUPPORT
+- if (MB_CUR_MAX > 1)
+- free (mb_properties);
++ if (mb_cur_max > 1)
++ {
++ const char *s;
++ int mr;
++ wchar_t pwc;
++
++ if (using_utf8)
++ {
++ s = beg - 1;
++ while (s > buf
++ && (unsigned char) *s >= 0x80
++ && (unsigned char) *s <= 0xbf)
++ --s;
++ }
++ else
++ s = last_char;
++ mr = mbtowc (&pwc, s, beg - s);
++ if (mr <= 0)
++ memset (&mbs, '\0', sizeof (mbstate_t));
++ else if ((iswalnum (pwc) || pwc == L'_')
++ && mr == (int) (beg - s))
++ goto next_char;
++ }
++ else
+ #endif /* MBS_SUPPORT */
+- return offset;
+- }
+- try = beg + offset;
+- len = kwsmatch.size[0];
+- }
+- else
+- goto success;
+- }
++ if (WCHAR ((unsigned char) beg[-1]))
++ goto next_char;
++ }
++#ifdef MBS_SUPPORT
++ if (mb_cur_max > 1)
++ {
++ wchar_t nwc;
++ int mr;
++
++ mr = mbtowc (&nwc, beg + len, buf + size - beg - len);
++ if (mr <= 0)
++ {
++ memset (&mbs, '\0', sizeof (mbstate_t));
++ word_match = 1;
++ }
++ else if (!iswalnum (nwc) && nwc != L'_')
++ word_match = 1;
++ }
++ else
++#endif /* MBS_SUPPORT */
++ if (beg + len >= buf + size || !WCHAR ((unsigned char) beg[len]))
++ word_match = 1;
++ if (word_match)
++ {
++ if (!exact)
++ /* Returns the whole line now we know there's a word match. */
++ goto success;
++ else
++ /* Returns just this word match. */
++ goto success_in_beg_and_len;
++ }
++ if (len > 0)
++ {
++ /* Try a shorter length anchored at the same place. */
++ --len;
++ offset = kwsexec (kwset, beg, len, &kwsmatch);
++
++ if (offset == -1)
++ goto next_char; /* Try a different anchor. */
++#ifdef MBS_SUPPORT
++ if (mb_cur_max > 1 && !using_utf8)
++ {
++ size_t bytes_left = offset;
++ while (bytes_left)
++ {
++ size_t mlen = mbrlen (beg, bytes_left, &mbs);
++
++ last_char = beg;
++ if (mlen == (size_t) -1 || mlen == 0)
++ {
++ /* Incomplete character: treat as single-byte. */
++ memset (&mbs, '\0', sizeof (mbstate_t));
++ beg++;
++ bytes_left--;
++ continue;
++ }
++
++ if (mlen == (size_t) -2)
++ {
++ /* Offset points inside multibyte character:
++ * no good. */
++ break;
++ }
++
++ beg += mlen;
++ bytes_left -= mlen;
++ }
++
++ if (bytes_left)
++ {
++ memset (&mbs, '\0', sizeof (mbstate_t));
++ goto next_char; /* Try a different anchor. */
++ }
++ }
++ else
++#endif /* MBS_SUPPORT */
++ beg += offset;
++#ifdef MBS_SUPPORT
++ /* The string at beg now matches first 3 chars of one of
++ the search strings (less if there are shorter search
++ strings). See if this is a real match. */
++ if (f_i_multibyte
++ && Fimbexec (beg, len - offset, &kwsmatch.size[0],
++ exact))
++ goto next_char;
++#endif /* MBS_SUPPORT */
++ len = kwsmatch.size[0];
++ }
++ }
++ }
+ else
+ goto success;
+- }
+-
++next_char:;
+ #ifdef MBS_SUPPORT
+- if (MB_CUR_MAX > 1)
+- free (mb_properties);
++ /* Advance to next character. For MB_CUR_MAX == 1 case this is handled
++ by ++beg above. */
++ if (mb_cur_max > 1)
++ {
++ if (using_utf8)
++ {
++ unsigned char c = *beg;
++ if (c >= 0xc2)
++ {
++ if (c < 0xe0)
++ ++beg;
++ else if (c < 0xf0)
++ beg += 2;
++ else if (c < 0xf8)
++ beg += 3;
++ else if (c < 0xfc)
++ beg += 4;
++ else if (c < 0xfe)
++ beg += 5;
++ }
++ }
++ else
++ {
++ size_t l = mbrlen (beg, buf + size - beg, &mbs);
++
++ last_char = beg;
++ if (l + 2 >= 2)
++ beg += l - 1;
++ else
++ memset (&mbs, '\0', sizeof (mbstate_t));
++ }
++ }
+ #endif /* MBS_SUPPORT */
++ }
++
++ failure:
+ return -1;
+
+ success:
++#ifdef MBS_SUPPORT
++ if (mb_cur_max > 1 && !using_utf8)
++ {
++ end = beg + len;
++ while (end < buf + size)
++ {
++ size_t mlen = mbrlen (end, buf + size - end, &mbs);
++ if (mlen == (size_t) -1 || mlen == (size_t) -2 || mlen == 0)
++ {
++ memset (&mbs, '\0', sizeof (mbstate_t));
++ mlen = 1;
++ }
++ if (mlen == 1 && *end == eol)
++ break;
++
++ end += mlen;
++ }
++ }
++ else
++#endif /* MBS_SUPPORT */
+ end = memchr (beg + len, eol, (buf + size) - (beg + len));
++
+ end++;
+ while (buf < beg && beg[-1] != eol)
+ --beg;
+- *match_size = end - beg;
+-#ifdef MBS_SUPPORT
+- if (MB_CUR_MAX > 1)
+- free (mb_properties);
+-#endif /* MBS_SUPPORT */
++ len = end - beg;
++ /* FALLTHROUGH */
++
++ success_in_beg_and_len:
++ *match_size = len;
+ return beg - buf;
+ }
+
+@@ -701,8 +1267,9 @@ Pexecute (char const *buf, size_t size, size_t *match_size, int exact)
+ char eol = eolbyte;
+ if (!exact)
+ {
+- end = memchr (end, eol, buflim - end);
+- end++;
++ while (end < buflim)
++ if (*end++ == eol)
++ break;
+ while (buf < beg && beg[-1] != eol)
+ --beg;
+ }
+--
+1.8.4.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep_fix_for_automake-1.12.patch b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep_fix_for_automake-1.12.patch
new file mode 100644
index 000000000..3ccce5fc3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep_fix_for_automake-1.12.patch
@@ -0,0 +1,52 @@
+Upstream-Status: Pending
+
+automake 1.12 has depricated automatic de-ANSI-fication support
+
+this patch avoids these kinds of errors:
+
+| configure.in:33: error: automatic de-ANSI-fication support has been removed
+| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/aclocal-1.12/protos.m4:12: AM_C_PROTOTYPES is expanded from...
+| configure.in:33: the top level
+| autom4te: m4 failed with exit status: 1
+...
+| lib/Makefile.am:2: error: automatic de-ANSI-fication support has been removed
+| src/Makefile.am:2: error: automatic de-ANSI-fication support has been removed
+| autoreconf: automake failed with exit status: 1
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/04
+
+Index: grep-2.5.1a/configure.in
+===================================================================
+--- grep-2.5.1a.orig/configure.in
++++ grep-2.5.1a/configure.in
+@@ -30,7 +30,6 @@ AC_PROG_RANLIB
+
+ dnl Checks for typedefs, structures, and compiler characteristics.
+ AC_SYS_LARGEFILE
+-AM_C_PROTOTYPES
+ AC_TYPE_SIZE_T
+ AC_CHECK_TYPE(ssize_t, int)
+ AC_C_CONST
+Index: grep-2.5.1a/lib/Makefile.am
+===================================================================
+--- grep-2.5.1a.orig/lib/Makefile.am
++++ grep-2.5.1a/lib/Makefile.am
+@@ -1,5 +1,5 @@
+ #
+-AUTOMAKE_OPTIONS = ../src/ansi2knr
++AUTOMAKE_OPTIONS =
+
+ SUBDIRS = posix
+
+Index: grep-2.5.1a/src/Makefile.am
+===================================================================
+--- grep-2.5.1a.orig/src/Makefile.am
++++ grep-2.5.1a/src/Makefile.am
+@@ -1,5 +1,5 @@
+ ## Process this file with automake to create Makefile.in
+-AUTOMAKE_OPTIONS = ansi2knr no-dependencies
++AUTOMAKE_OPTIONS = no-dependencies
+
+ LN = ln
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/uclibc-fix.patch b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/uclibc-fix.patch
new file mode 100644
index 000000000..de054fc75
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/uclibc-fix.patch
@@ -0,0 +1,55 @@
+Upstream-Status: Inappropriate [licensing]
+
+# Fix to use mempcpy instead of __mempcpy. This is needed for uclibc which
+# doesn't define __mempcpy, only mempcpy. Since both uclibc and glibc have
+# mempcpy, we'll just use that instead.
+# Patch source: OpenEmbedded
+
+Index: grep-2.5.1/intl/localealias.c
+===================================================================
+--- grep-2.5.1.orig/intl/localealias.c 2002-03-14 00:39:06.000000000 +1100
++++ grep-2.5.1/intl/localealias.c 2007-05-17 13:53:58.000000000 +1000
+@@ -65,7 +65,7 @@
+ # define strcasecmp __strcasecmp
+
+ # ifndef mempcpy
+-# define mempcpy __mempcpy
++# error "mempcpy not detected"
+ # endif
+ # define HAVE_MEMPCPY 1
+ # define HAVE___FSETLOCKING 1
+Index: grep-2.5.1/lib/getopt.c
+===================================================================
+--- grep-2.5.1.orig/lib/getopt.c 2001-03-04 16:33:12.000000000 +1100
++++ grep-2.5.1/lib/getopt.c 2007-05-17 13:51:44.000000000 +1000
+@@ -326,7 +326,7 @@
+ nonoption_flags_len = nonoption_flags_max_len = 0;
+ else
+ {
+- memset (__mempcpy (new_str, __getopt_nonoption_flags,
++ memset (mempcpy (new_str, __getopt_nonoption_flags,
+ nonoption_flags_max_len),
+ '\0', top + 1 - nonoption_flags_max_len);
+ nonoption_flags_max_len = top + 1;
+@@ -437,7 +437,7 @@
+ if (__getopt_nonoption_flags == NULL)
+ nonoption_flags_max_len = -1;
+ else
+- memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
++ memset (mempcpy (__getopt_nonoption_flags, orig_str, len),
+ '\0', nonoption_flags_max_len - len);
+ }
+ }
+Index: grep-2.5.1/lib/regex.c
+===================================================================
+--- grep-2.5.1.orig/lib/regex.c 2001-04-03 04:04:45.000000000 +1000
++++ grep-2.5.1/lib/regex.c 2007-05-17 13:51:48.000000000 +1000
+@@ -7842,7 +7842,7 @@
+ if (msg_size > errbuf_size)
+ {
+ #if defined HAVE_MEMPCPY || defined _LIBC
+- *((char *) __mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
++ *((char *) mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
+ #else
+ memcpy (errbuf, msg, errbuf_size - 1);
+ errbuf[errbuf_size - 1] = 0;
diff --git a/import-layers/yocto-poky/meta/recipes-extended/grep/grep/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/grep/grep_2.23.bb b/import-layers/yocto-poky/meta/recipes-extended/grep/grep_2.23.bb
new file mode 100644
index 000000000..13ff32dd8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/grep/grep_2.23.bb
@@ -0,0 +1,43 @@
+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] = "f46aa9d0d2577b9212a104348a286787"
+SRC_URI[sha256sum] = "54fc478ee1ce17780109820ef30730c9e18715a949f7d5c6afc673adb2a56ecf"
+
+inherit autotools gettext texinfo
+
+EXTRA_OECONF = "--disable-perl-regexp"
+
+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
+
+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/import-layers/yocto-poky/meta/recipes-extended/grep/grep_2.5.1a.bb b/import-layers/yocto-poky/meta/recipes-extended/grep/grep_2.5.1a.bb
new file mode 100644
index 000000000..5a2da2832
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/grep/grep_2.5.1a.bb
@@ -0,0 +1,56 @@
+SUMMARY = "Pattern matching utilities"
+DESCRIPTION = "The GNU versions of commonly used grep utilities. The grep command searches one or more input \
+files for lines containing a match to a specified pattern."
+SECTION = "console/utils"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
+
+PR = "r2"
+
+SRC_URI = "${GNU_MIRROR}/grep/grep-${PV}.tar.bz2 \
+ file://uclibc-fix.patch \
+ file://grep_fix_for_automake-1.12.patch \
+ file://gettext.patch \
+ file://fix64-int-to-pointer.patch \
+ file://Makevars \
+ file://grep-CVE-2012-5667.patch \
+ file://fix-for-texinfo-5.1.patch \
+ file://grep-egrep-fgrep-Fix-LSB-NG-cases.patch \
+ "
+
+SRC_URI[md5sum] = "52202fe462770fa6be1bb667bd6cf30c"
+SRC_URI[sha256sum] = "38c8a2bb9223d1fb1b10bdd607cf44830afc92fd451ac4cd07619bf92bdd3132"
+
+inherit autotools gettext texinfo
+
+EXTRA_OECONF_INCLUDED_REGEX = "--without-included-regex"
+EXTRA_OECONF_INCLUDED_REGEX_libc-musl = "--with-included-regex"
+
+EXTRA_OECONF = "--disable-perl-regexp \
+ ${EXTRA_OECONF_INCLUDED_REGEX}"
+
+CFLAGS += "-D PROTOTYPES"
+do_configure_prepend () {
+ rm -f ${S}/m4/init.m4
+ cp -f ${WORKDIR}/Makevars ${S}/po/
+}
+
+do_install () {
+ autotools_do_install
+ 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}/
+}
+
+inherit update-alternatives
+
+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/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/groff-1.18.1.4-fix-bindir.patch b/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/groff-1.18.1.4-fix-bindir.patch
new file mode 100644
index 000000000..559ae7289
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/groff-1.18.1.4-fix-bindir.patch
@@ -0,0 +1,39 @@
+Upstream-Status: Inappropriate [embedded]
+
+Signed-off-by: Ming Liu <ming.liu@windriver.com>
+---
+ Makefile.sub | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+--- a/contrib/groffer/Makefile.sub
++++ b/contrib/groffer/Makefile.sub
+@@ -38,16 +38,16 @@ groffer: groffer.sh groffer2.sh version.
+ $(RM) $@;
+ sed \
+ -e "s|@g@|$(g)|g" \
+- -e "s|@BINDIR@|$(DESTDIR)$(bindir)|g" \
++ -e "s|@BINDIR@|$(bindir)|g" \
+ -e "s|@libdir@|$(DESTDIR)$(libdir)|g" \
+ -e "s|@VERSION@|$(version)$(revision)|g" \
+ $(srcdir)/groffer.sh >$@;
+ chmod +x $@
+
+ install_data: groffer
+- -test -d $(DESTDIR)$(bindir) || $(mkinstalldirs) $(DESTDIR)$(bindir)
+- -$(RM) $(DESTDIR)$(bindir)/groffer
+- $(INSTALL_SCRIPT) groffer $(DESTDIR)$(bindir)/groffer
++ -test -d $(bindir) || $(mkinstalldirs) $(bindir)
++ -$(RM) $(bindir)/groffer
++ $(INSTALL_SCRIPT) groffer $(bindir)/groffer
+ -test -d $(DESTDIR)$(libdir)/groff/groffer || \
+ $(mkinstalldirs) $(DESTDIR)$(libdir)/groff/groffer
+ -$(RM) $(DESTDIR)$(libdir)/groff/groffer/groffer2.sh
+@@ -58,7 +58,7 @@ install_data: groffer
+ $(DESTDIR)$(libdir)/groff/groffer/version.sh
+
+ uninstall_sub:
+- -$(RM) $(DESTDIR)$(bindir)/groffer
++ -$(RM) $(bindir)/groffer
+ -$(RM) $(DESTDIR)$(libdir)/groff/groffer/groffer2.sh
+ -$(RM) $(DESTDIR)$(libdir)/groff/groffer/version.sh
+ -rmdir $(DESTDIR)$(libdir)/groff/groffer
diff --git a/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/groff-1.18.1.4-remove-mom.patch b/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/groff-1.18.1.4-remove-mom.patch
new file mode 100644
index 000000000..c24eff9af
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/groff-1.18.1.4-remove-mom.patch
@@ -0,0 +1,39 @@
+
+Upstream-Status: Inappropriate [embedded]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+---
+ groff-1.18.1.4/Makefile.in | 7 +------
+ 1 file changed, 1 insertion(+), 6 deletions(-)
+
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -460,27 +460,22 @@ OTHERDIRS=\
+ src/roff/grog \
+ src/roff/nroff \
+ contrib/mm \
+ contrib/pic2graph \
+ contrib/eqn2graph \
+- contrib/groffer \
+- contrib/mom \
+- doc
++ contrib/groffer
+ ALLDIRS=$(INCDIRS) $(LIBDIRS) $(PROGDIRS) \
+ $(DEVDIRS) $(OTHERDEVDIRS) $(TTYDEVDIRS) $(OTHERDIRS)
+ EXTRADIRS=\
+ font/devps/generate \
+ font/devdvi/generate \
+ font/devlj4/generate \
+- src/xditview \
+ doc
+ NOMAKEDIRS=\
+ arch/djgpp \
+ contrib/mm/examples \
+ contrib/mm/mm \
+- contrib/mom/examples \
+- contrib/mom/momdoc \
+ src/libs/snprintf
+ DISTDIRS=\
+ $(INCDIRS) $(LIBDIRS) $(PROGDIRS) $(DEVDIRS) $(OTHERDEVDIRS) \
+ $(ALLTTYDEVDIRS) $(OTHERDIRS) $(EXTRADIRS) $(NOMAKEDIRS)
+ TARGETS=all install install_bin install_data clean distclean mostlyclean \
diff --git a/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/man-local.patch b/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/man-local.patch
new file mode 100644
index 000000000..e3f1aa6a4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/man-local.patch
@@ -0,0 +1,36 @@
+Upstream-Status: Inappropriate [embedded]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: groff-1.18.1.4/tmac/man.local
+===================================================================
+--- groff-1.18.1.4.orig/tmac/man.local 2000-10-26 22:15:17.000000000 +0800
++++ groff-1.18.1.4/tmac/man.local 2010-08-24 14:17:52.070006664 +0800
+@@ -1,2 +1,27 @@
+ .\" This file is loaded after an-old.tmac.
+ .\" Put any local modifications to an-old.tmac here.
++.
++.if n \{\
++. \" Debian: Map \(oq to ' rather than ` in nroff mode for devices other
++. \" than utf8.
++. if !'\*[.T]'utf8' \
++. tr \[oq]'
++.
++. \" Debian: Disable the use of SGR (ANSI colour) escape sequences by
++. \" grotty.
++. if '\V[GROFF_SGR]'' \
++. output x X tty: sgr 0
++.
++. \" Debian: Map \- to the Unicode HYPHEN-MINUS character, to make
++. \" searching in man pages easier.
++. if '\*[.T]'utf8' \
++. char \- \N'45'
++.
++. \" Debian: Many UTF-8 man pages use "-" instead of "\-" for dashes such
++. \" as those in command-line options. This is a bug in those pages, but
++. \" too many fonts are missing the Unicode HYPHEN character, so we render
++. \" this as the ASCII-compatible HYPHEN-MINUS instead.
++. if '\*[.T]'utf8' \
++. char - \N'45'
++.\}
++
diff --git a/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/mdoc-local.patch b/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/mdoc-local.patch
new file mode 100644
index 000000000..409c1a5a1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/mdoc-local.patch
@@ -0,0 +1,36 @@
+
+Upstream-Status: Inappropriate [embedded]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: groff-1.18.1.4/tmac/mdoc.local
+===================================================================
+--- groff-1.18.1.4.orig/tmac/mdoc.local 2001-03-23 08:17:51.000000000 +0800
++++ groff-1.18.1.4/tmac/mdoc.local 2010-08-24 14:20:22.014006846 +0800
+@@ -1,2 +1,26 @@
+ .\" This file is loaded after doc.tmac.
+ .\" Put any local modifications to doc.tmac here.
++.
++.if n \{\
++. \" Debian: Map \(oq to ' rather than ` in nroff mode for devices other
++. \" than utf8.
++. if !'\*[.T]'utf8' \
++. tr \[oq]'
++.
++. \" Debian: Disable the use of SGR (ANSI colour) escape sequences by
++. \" grotty.
++. if '\V[GROFF_SGR]'' \
++. output x X tty: sgr 0
++.
++. \" Debian: Map \- to the Unicode HYPHEN-MINUS character, to make
++. \" searching in man pages easier.
++. if '\*[.T]'utf8' \
++. char \- \N'45'
++.
++. \" Debian: Many UTF-8 man pages use "-" instead of "\-" for dashes such
++. \" as those in command-line options. This is a bug in those pages, but
++. \" too many fonts are missing the Unicode HYPHEN character, so we render
++. \" this as the ASCII-compatible HYPHEN-MINUS instead.
++. if '\*[.T]'utf8' \
++. char - \N'45'
++.\}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.22.3/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.22.3/groff-1.22.2-correct-man.local-install-path.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/groff/groff_1.18.1.4.bb b/import-layers/yocto-poky/meta/recipes-extended/groff/groff_1.18.1.4.bb
new file mode 100644
index 000000000..bd786a30a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/groff/groff_1.18.1.4.bb
@@ -0,0 +1,49 @@
+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 = "console/utils"
+HOMEPAGE = "http://www.gnu.org/software/groff/"
+LICENSE = "GPLv2"
+PR = "r1"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=e43fc16fccd8519fba405f0a0ff6e8a3"
+
+SRC_URI = "${GNU_MIRROR}/${BPN}/old/${BP}.tar.gz \
+ file://groff-1.18.1.4-remove-mom.patch;striplevel=1 \
+ file://man-local.patch \
+ file://mdoc-local.patch \
+ file://groff-1.18.1.4-fix-bindir.patch \
+"
+
+inherit autotools texinfo
+
+EXTRA_OECONF="--without-x --prefix=${D} --exec-prefix=${D} --bindir=${D}${bindir} --datadir=${D}${datadir} --mandir=${D}${datadir}/man --infodir=${D}${datadir}info --with-appresdir=${D}${datadir}"
+
+SRC_URI[md5sum] = "ceecb81533936d251ed015f40e5f7287"
+SRC_URI[sha256sum] = "ff3c7c3b6cae5e8cc5062a144de5eff0022e8e970e1774529cc2d5dde46ce50d"
+PARALLEL_MAKE = ""
+
+do_configure (){
+ oe_runconf
+}
+
+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; do
+ if [ -f ${D}${bindir}/$i ]; then
+ sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/$i
+ fi
+ done
+
+ mkdir -p ${D}${sysconfdir}/groff
+ cp -rf ${D}${datadir}/groff/site-tmac/* ${D}${sysconfdir}/groff/
+ cp -rf ${D}${datadir}/groff/site-tmac/* ${D}${datadir}/groff/${PV}/tmac/
+}
+
+pkg_postinst_${PN}() {
+ ln -s tbl $D${bindir}/gtbl
+ echo "export GROFF_FONT_PATH=/usr/share/groff/${PV}/font" >> $D${sysconfdir}/profile
+ echo "export GROFF_TMAC_PATH=/usr/share/groff/${PV}/tmac" >> $D${sysconfdir}/profile
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/groff/groff_1.22.3.bb b/import-layers/yocto-poky/meta/recipes-extended/groff/groff_1.22.3.bb
new file mode 100644
index 000000000..4bffa814f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/groff/groff_1.22.3.bb
@@ -0,0 +1,70 @@
+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 \
+"
+
+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 = ""
+
+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
+}
+
+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/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip-1.3.12/dup-def-fix.patch b/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip-1.3.12/dup-def-fix.patch
new file mode 100644
index 000000000..d9e8d212b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip-1.3.12/dup-def-fix.patch
@@ -0,0 +1,48 @@
+gzip uses gnulib, whose header conflict with glibc. This patch rename some function to avoid conflict.
+
+Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
+
+Upstream-Status: Inappropriate [licensing]
+
+Index: gzip-1.3.12/gzip.c
+===================================================================
+--- gzip-1.3.12.orig/gzip.c 2010-08-13 10:29:38.000000000 +0800
++++ gzip-1.3.12/gzip.c 2010-08-13 10:29:44.000000000 +0800
+@@ -1637,7 +1637,7 @@
+ }
+ }
+
+- if (futimens (ofd, ofname, timespec) != 0)
++ if (futimens_gnulib (ofd, ofname, timespec) != 0)
+ {
+ int e = errno;
+ WARN ((stderr, "%s: ", program_name));
+Index: gzip-1.3.12/lib/utimens.c
+===================================================================
+--- gzip-1.3.12.orig/lib/utimens.c 2010-08-13 10:33:47.000000000 +0800
++++ gzip-1.3.12/lib/utimens.c 2010-08-13 10:34:02.000000000 +0800
+@@ -75,7 +75,7 @@
+ Return 0 on success, -1 (setting errno) on failure. */
+
+ int
+-futimens (int fd ATTRIBUTE_UNUSED,
++futimens_gnulib (int fd ATTRIBUTE_UNUSED,
+ char const *file, struct timespec const timespec[2])
+ {
+ /* Some Linux-based NFS clients are buggy, and mishandle time stamps
+@@ -185,5 +185,5 @@
+ int
+ utimens (char const *file, struct timespec const timespec[2])
+ {
+- return futimens (-1, file, timespec);
++ return futimens_gnulib (-1, file, timespec);
+ }
+Index: gzip-1.3.12/lib/utimens.h
+===================================================================
+--- gzip-1.3.12.orig/lib/utimens.h 2010-08-13 10:14:57.000000000 +0800
++++ gzip-1.3.12/lib/utimens.h 2010-08-13 10:21:45.000000000 +0800
+@@ -1,3 +1,3 @@
+ #include <time.h>
+-int futimens (int, char const *, struct timespec const [2]);
++int futimens_gnulib (int, char const *, struct timespec const [2]);
+ int utimens (char const *, struct timespec const [2]);
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip-1.3.12/m4-extensions-fix.patch b/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip-1.3.12/m4-extensions-fix.patch
new file mode 100644
index 000000000..6b2f69870
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip-1.3.12/m4-extensions-fix.patch
@@ -0,0 +1,56 @@
+remove AC_USE_SYSTEM_EXTENSIONS to fix the autoconf error "AC_REQUIRE: circular
+dependency of AC_GNU_SOURCE"
+
+Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
+
+Upstream-Status: Inappropriate [licensing]
+
+Index: gzip-1.3.12/m4/extensions.m4
+===================================================================
+--- gzip-1.3.12.orig/m4/extensions.m4 2010-08-16 14:18:16.000000000 +0800
++++ gzip-1.3.12/m4/extensions.m4 2010-08-16 14:21:54.000000000 +0800
+@@ -12,44 +12,6 @@
+ # enough in this area it's likely we'll need to redefine
+ # AC_USE_SYSTEM_EXTENSIONS for quite some time.
+
+-# AC_USE_SYSTEM_EXTENSIONS
+-# ------------------------
+-# Enable extensions on systems that normally disable them,
+-# typically due to standards-conformance issues.
+-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
+-[
+- AC_BEFORE([$0], [AC_COMPILE_IFELSE])
+- AC_BEFORE([$0], [AC_RUN_IFELSE])
+-
+- AC_REQUIRE([AC_GNU_SOURCE])
+- AC_REQUIRE([AC_AIX])
+- AC_REQUIRE([AC_MINIX])
+-
+- AH_VERBATIM([__EXTENSIONS__],
+-[/* Enable extensions on Solaris. */
+-#ifndef __EXTENSIONS__
+-# undef __EXTENSIONS__
+-#endif
+-#ifndef _POSIX_PTHREAD_SEMANTICS
+-# undef _POSIX_PTHREAD_SEMANTICS
+-#endif
+-#ifndef _TANDEM_SOURCE
+-# undef _TANDEM_SOURCE
+-#endif])
+- AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
+- [ac_cv_safe_to_define___extensions__],
+- [AC_COMPILE_IFELSE(
+- [AC_LANG_PROGRAM([
+-# define __EXTENSIONS__ 1
+- AC_INCLUDES_DEFAULT])],
+- [ac_cv_safe_to_define___extensions__=yes],
+- [ac_cv_safe_to_define___extensions__=no])])
+- test $ac_cv_safe_to_define___extensions__ = yes &&
+- AC_DEFINE([__EXTENSIONS__])
+- AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+- AC_DEFINE([_TANDEM_SOURCE])
+-])
+-
+ # gl_USE_SYSTEM_EXTENSIONS
+ # ------------------------
+ # Enable extensions on systems that normally disable them,
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip-1.6/wrong-path-fix.patch b/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip-1.6/wrong-path-fix.patch
new file mode 100644
index 000000000..92863d6c4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip-1.6/wrong-path-fix.patch
@@ -0,0 +1,31 @@
+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
+
+Index: gzip-1.3.12/Makefile.am
+===================================================================
+diff -urpN a/Makefile.am b/Makefile.am
+--- a/Makefile.am 2013-11-30 10:06:09.402234871 +0800
++++ b/Makefile.am 2013-11-30 10:13:42.952236025 +0800
+@@ -81,9 +81,8 @@ gzip.doc.gz: gzip.doc $(bin_PROGRAMS)
+ SUFFIXES = .in
+ .in:
+ $(AM_V_GEN)sed \
+- -e 's|/bin/sh|$(SHELL)|g' \
+ -e 's|[@]bindir@|'\''$(bindir)'\''|g' \
+- -e 's|[@]GREP@|$(GREP)|g' \
++ -e 's|[@]GREP@|$(base_bindir)/grep|g' \
+ -e 's|[@]VERSION@|$(VERSION)|g' \
+ $(srcdir)/$@.in >$@-t \
+ && chmod a+x $@-t \
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip.inc b/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip.inc
new file mode 100644
index 000000000..6e8188347
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip.inc
@@ -0,0 +1,38 @@
+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
+}
+
+do_install_append_libc-musl () {
+ rm ${D}${libdir}/charset.alias
+ rmdir ${D}${libdir}
+}
+
+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/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip_1.3.12.bb b/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip_1.3.12.bb
new file mode 100644
index 000000000..e4062827b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip_1.3.12.bb
@@ -0,0 +1,15 @@
+require gzip.inc
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
+ file://gzip.h;endline=22;md5=c0934ad1900d927f86556153d4c76d23 \
+ file://lzw.h;endline=19;md5=c273e09a02edd9801cc74d39683049e9 "
+
+SRC_URI = "${GNU_MIRROR}/gzip/gzip-${PV}.tar.gz \
+ file://m4-extensions-fix.patch \
+ file://dup-def-fix.patch"
+
+SRC_URI[md5sum] = "b5bac2d21840ae077e0217bc5e4845b1"
+SRC_URI[sha256sum] = "3f565be05f7f3d1aff117c030eb7c738300510b7d098cedea796ca8e4cd587af"
+
+PR = "r2"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip_1.6.bb b/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip_1.6.bb
new file mode 100644
index 000000000..b347f0bb8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip_1.6.bb
@@ -0,0 +1,17 @@
+require gzip.inc
+
+LICENSE = "GPLv3+"
+
+SRC_URI = "${GNU_MIRROR}/gzip/${BP}.tar.gz"
+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"
+NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}"
+
+BBCLASSEXTEND = "native"
+
+SRC_URI[md5sum] = "38603cb2843bf5681ff41aab3bcd6a20"
+SRC_URI[sha256sum] = "97eb83b763d9e5ad35f351fe5517e6b71521d7aac7acf3e3cacdb6b1496d8f7e"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/hdparm/hdparm_9.48.bb b/import-layers/yocto-poky/meta/recipes-extended/hdparm/hdparm_9.48.bb
new file mode 100644
index 000000000..ec3d26f42
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/hdparm/hdparm_9.48.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Utility for viewing/manipulating IDE disk drive/driver parameters"
+DESCRIPTION = "hdparm is a Linux shell utility for viewing \
+and manipulating various IDE drive and driver parameters."
+SECTION = "console/utils"
+LICENSE = "BSD"
+LICENSE_wiper = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=910a8a42c962d238619c75fdb78bdb24 \
+ 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 stat"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/hdparm/${BP}.tar.gz "
+
+SRC_URI[md5sum] = "213efdbe7471fad3408198918e164354"
+SRC_URI[sha256sum] = "ce97b4a71cb04146f54cf6f69787e7f97ddfda9836dc803b459d3b3df3a4fbee"
+
+EXTRA_OEMAKE = '-e MAKEFLAGS= STRIP="echo"'
+
+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/import-layers/yocto-poky/meta/recipes-extended/images/core-image-full-cmdline.bb b/import-layers/yocto-poky/meta/recipes-extended/images/core-image-full-cmdline.bb
new file mode 100644
index 000000000..4d69073d9
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/images/core-image-kernel-dev.bb b/import-layers/yocto-poky/meta/recipes-extended/images/core-image-kernel-dev.bb
new file mode 100644
index 000000000..26b88c9e8
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/images/core-image-lsb-dev.bb b/import-layers/yocto-poky/meta/recipes-extended/images/core-image-lsb-dev.bb
new file mode 100644
index 000000000..d2dc9e2b5
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/images/core-image-lsb-sdk.bb b/import-layers/yocto-poky/meta/recipes-extended/images/core-image-lsb-sdk.bb
new file mode 100644
index 000000000..c3b6e7c82
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/images/core-image-lsb-sdk.bb
@@ -0,0 +1,9 @@
+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"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/images/core-image-lsb.bb b/import-layers/yocto-poky/meta/recipes-extended/images/core-image-lsb.bb
new file mode 100644
index 000000000..ab61c6e6d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/images/core-image-testmaster-initramfs.bb b/import-layers/yocto-poky/meta/recipes-extended/images/core-image-testmaster-initramfs.bb
new file mode 100644
index 000000000..ad1407c7a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/images/core-image-testmaster-initramfs.bb
@@ -0,0 +1,20 @@
+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"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/images/core-image-testmaster.bb b/import-layers/yocto-poky/meta/recipes-extended/images/core-image-testmaster.bb
new file mode 100644
index 000000000..78295c5f0
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0001-configure-Add-option-to-enable-disable-libnfnetlink.patch b/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0001-configure-Add-option-to-enable-disable-libnfnetlink.patch
new file mode 100644
index 000000000..b711b7aa3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0001-configure-Add-option-to-enable-disable-libnfnetlink.patch
@@ -0,0 +1,37 @@
+[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>
+---
+diff -Naur iptables-1.6.0-old/configure.ac iptables-1.6.0/configure.ac
+--- iptables-1.6.0-old/configure.ac 2015-12-28 18:40:35.255417976 +0200
++++ iptables-1.6.0/configure.ac 2015-12-29 13:01:12.388840200 +0200
+@@ -63,6 +63,9 @@
+ 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"])
+
+ libiptc_LDFLAGS2="";
+ AX_CHECK_LINKER_FLAGS([-Wl,--no-as-needed],
+@@ -123,9 +126,10 @@
+ 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])
diff --git a/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0001-fix-build-with-musl.patch b/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0001-fix-build-with-musl.patch
new file mode 100644
index 000000000..f1f85a6fa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0001-fix-build-with-musl.patch
@@ -0,0 +1,46 @@
+[PATCH] fix build with musl
+
+Define additional TCOPTS if not there
+u_initX types are in sys/types.h be explicit about it
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+diff -Naur iptables-1.6.0-origin/extensions/libxt_TCPOPTSTRIP.c iptables-1.6.0/extensions/libxt_TCPOPTSTRIP.c
+--- iptables-1.6.0-origin/extensions/libxt_TCPOPTSTRIP.c 2015-12-09 14:55:06.000000000 +0200
++++ iptables-1.6.0/extensions/libxt_TCPOPTSTRIP.c 2015-12-29 14:44:32.585327077 +0200
+@@ -12,6 +12,21 @@
+ #ifndef TCPOPT_MD5SIG
+ # define TCPOPT_MD5SIG 19
+ #endif
++#ifndef TCPOPT_MAXSEG
++#define TCPOPT_MAXSEG 2
++#endif
++#ifndef TCPOPT_WINDOW
++#define TCPOPT_WINDOW 3
++#endif
++#ifndef TCPOPT_SACK_PERMITTED
++#define TCPOPT_SACK_PERMITTED 4
++#endif
++#ifndef TCPOPT_SACK
++#define TCPOPT_SACK 5
++#endif
++#ifndef TCPOPT_TIMESTAMP
++#define TCPOPT_TIMESTAMP 8
++#endif
+
+ enum {
+ O_STRIP_OPTION = 0,
+diff -Naur iptables-1.6.0-origin/include/linux/netfilter_ipv4/ip_tables.h iptables-1.6.0/include/linux/netfilter_ipv4/ip_tables.h
+--- iptables-1.6.0-origin/include/linux/netfilter_ipv4/ip_tables.h 2015-12-09 14:55:06.000000000 +0200
++++ iptables-1.6.0/include/linux/netfilter_ipv4/ip_tables.h 2015-12-29 14:40:21.250469195 +0200
+@@ -15,6 +15,7 @@
+ #ifndef _IPTABLES_H
+ #define _IPTABLES_H
+
++#include <sys/types.h>
+ #include <linux/types.h>
+
+ #include <linux/netfilter_ipv4.h>
diff --git a/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch b/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch
new file mode 100644
index 000000000..89ad8f666
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch
@@ -0,0 +1,34 @@
+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>
+
+diff --git a/configure.ac b/configure.ac
+index 5d7e62b..e331ee7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -88,8 +88,12 @@ if test "$ac_cv_header_linux_ip_vs_h" != "yes"; then
+ blacklist_modules="$blacklist_modules ipvs";
+ fi;
+
+-PKG_CHECK_MODULES([libnetfilter_conntrack], [libnetfilter_conntrack >= 1.0.4],
++nfconntrack=0
++AS_IF([test "x$enable_libnfnetlink" = "xyes"], [
++ PKG_CHECK_MODULES([libnetfilter_conntrack], [libnetfilter_conntrack >= 1.0.4],
+ [nfconntrack=1], [nfconntrack=0])
++ ])
++
+ AM_CONDITIONAL([HAVE_LIBNETFILTER_CONNTRACK], [test "$nfconntrack" = 1])
+
+ if test "$nfconntrack" -ne 1; then
diff --git a/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/types.h-add-defines-that-are-required-for-if_packet.patch b/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/types.h-add-defines-that-are-required-for-if_packet.patch
new file mode 100644
index 000000000..24ee29e2d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/types.h-add-defines-that-are-required-for-if_packet.patch
@@ -0,0 +1,49 @@
+From 19593491f43b70c1a71c3b9b8f4ff4fd14500014 Mon Sep 17 00:00:00 2001
+From: Bruce Ashfield <bruce.ashfield@windriver.com>
+Date: Fri, 23 Mar 2012 14:27:20 -0400
+Subject: [PATCH] types.h: add defines that are required for if_packet.h
+
+The iptables local linux/types.h overrides the kernel/sysroot
+types.h. As such, we need to provide some defines that are required
+to build against 3.2+ kernel headers.
+
+ifndef protection is provided for the defines to ensure that
+configuration that already have these defines are still buildable.
+
+This commit is temporary until a new version of iptables can be
+used that contains the defines.
+
+This is similar to the commit in the iptables git repository:
+
+ https://git.netfilter.org/cgi-bin/gitweb.cgi?p=iptables.git;a=commit;h=dbe77cc974cee656eae37e75039dd1a410a4535b
+
+Upstream-Status: Backport
+
+Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
+---
+ include/linux/types.h | 10 ++++++++++
+ 1 files changed, 10 insertions(+), 0 deletions(-)
+
+diff --git a/include/linux/types.h b/include/linux/types.h
+index 8b483c8..ebf6432 100644
+--- a/include/linux/types.h
++++ b/include/linux/types.h
+@@ -34,5 +34,15 @@ typedef __u64 __bitwise __be64;
+ typedef __u16 __bitwise __sum16;
+ typedef __u32 __bitwise __wsum;
+
++#ifndef __aligned_u64
++#define __aligned_u64 __u64 __attribute__((aligned(8)))
++#endif
++#ifndef __aligned_be64
++#define __aligned_be64 __be64 __attribute__((aligned(8)))
++#endif
++#ifndef __aligned_le64
++#define __aligned_le64 __le64 __attribute__((aligned(8)))
++#endif
++
+ #endif /* __ASSEMBLY__ */
+ #endif /* _LINUX_TYPES_H */
+--
+1.7.0.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables_1.6.0.bb b/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables_1.6.0.bb
new file mode 100644
index 000000000..fbbe4186b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables_1.6.0.bb
@@ -0,0 +1,50 @@
+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://types.h-add-defines-that-are-required-for-if_packet.patch \
+ file://0001-configure-Add-option-to-enable-disable-libnfnetlink.patch \
+ file://0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch \
+ "
+SRC_URI_append_libc-musl = " file://0001-fix-build-with-musl.patch"
+
+SRC_URI[md5sum] = "27ba3451cb622467fc9267a176f19a31"
+SRC_URI[sha256sum] = "4bb72a0a0b18b5a9e79e87631ddc4084528e5df236bc7624472dcaa8480f1c60"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--with-kernel=${STAGING_INCDIR} \
+ "
+PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', '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/import-layers/yocto-poky/meta/recipes-extended/iputils/files/0001-Fix-header-inclusion-for-musl.patch b/import-layers/yocto-poky/meta/recipes-extended/iputils/files/0001-Fix-header-inclusion-for-musl.patch
new file mode 100644
index 000000000..20ef07e44
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/iputils/files/0001-Fix-header-inclusion-for-musl.patch
@@ -0,0 +1,92 @@
+From be0bb81d72fea4d20da74f4f2236aa145684f332 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 6 Jan 2016 14:14:22 -0800
+Subject: [PATCH] Fix header inclusion for musl
+
+Fix errors e.g.
+
+In file included from tracepath.c:17:0:
+/usr/include/linux/errqueue.h:33:18:
+error: array type has incomplete element type 'struct timespec'
+ struct timespec ts[3];
+ ^
+tracepath.c: In function 'main':
+tracepath.c:329:16: error: 'INT_MAX' undeclared (first use in this
+function)
+ overhead, INT_MAX);
+ ^
+tracepath.c:329:16: note: each undeclared identifier is reported only
+once for each function it appears in
+Makefile:131: recipe for target 'tracepath.o' failed
+make: *** [tracepath.o] Error 1
+
+ping_common.c: In function 'main_loop':
+ping_common.c:756:15: error: 'HZ' undeclared (first use in this
+function)
+ if (1000 % HZ == 0 ? next <= 1000 / HZ : (next < INT_MAX / HZ &&
+next * HZ <= 1000)) {
+
+protocols/timed.h is not needed and is absent in musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ clockdiff.c | 1 -
+ ping_common.c | 1 +
+ tracepath.c | 2 ++
+ tracepath6.c | 1 +
+ 4 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/clockdiff.c b/clockdiff.c
+index 7c1ea1b..1d6341e 100644
+--- a/clockdiff.c
++++ b/clockdiff.c
+@@ -14,7 +14,6 @@
+ #include <netinet/ip.h>
+ #include <netinet/ip_icmp.h>
+ #define TSPTYPES
+-#include <protocols/timed.h>
+ #include <fcntl.h>
+ #include <netdb.h>
+ #include <arpa/inet.h>
+diff --git a/ping_common.c b/ping_common.c
+index 7f82851..3ce699d 100644
+--- a/ping_common.c
++++ b/ping_common.c
+@@ -2,6 +2,7 @@
+ #include <ctype.h>
+ #include <sched.h>
+ #include <math.h>
++#include <asm-generic/param.h>
+
+ int options;
+
+diff --git a/tracepath.c b/tracepath.c
+index 89e6d16..c9d6ddd 100644
+--- a/tracepath.c
++++ b/tracepath.c
+@@ -12,6 +12,8 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
++#include <limits.h>
++#include <time.h>
+ #include <sys/socket.h>
+ #include <linux/types.h>
+ #include <linux/errqueue.h>
+diff --git a/tracepath6.c b/tracepath6.c
+index 126fadf..9d5745c 100644
+--- a/tracepath6.c
++++ b/tracepath6.c
+@@ -12,6 +12,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
++#include <limits.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <netinet/icmp6.h>
+--
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/iputils/files/0001-Intialize-struct-elements-by-name.patch b/import-layers/yocto-poky/meta/recipes-extended/iputils/files/0001-Intialize-struct-elements-by-name.patch
new file mode 100644
index 000000000..6da01dc61
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/iputils/files/0001-Intialize-struct-elements-by-name.patch
@@ -0,0 +1,52 @@
+From 000629f74908a2a95f6104444c77ad93cf40d62d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 13 Jan 2016 08:50:50 +0000
+Subject: [PATCH] Intialize struct elements by name
+
+makes it portable across glibc and musl
+
+Fixes errors
+
+| ping.c: In function 'send_probe':
+| ping.c:735:19: warning: initialization makes integer from pointer
+without a cast [-Wint-conversion]
+| &iov, 1, &cmsg, 0, 0 };
+| ^
+| ping.c:735:19: note: (near initialization for 'm.__pad1')
+| ping.c:735:19: error: initializer element is not computable at load
+time
+| ping.c:735:19: note: (near initialization for 'm.__pad1')
+| make: *** [ping.o] Error 1
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ ping.c | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/ping.c b/ping.c
+index 4989760..e67f381 100644
+--- a/ping.c
++++ b/ping.c
+@@ -731,8 +731,15 @@ int send_probe()
+
+ do {
+ static struct iovec iov = {outpack, 0};
+- static struct msghdr m = { &whereto, sizeof(whereto),
+- &iov, 1, &cmsg, 0, 0 };
++ static struct msghdr m = {
++ .msg_name = &whereto,
++ .msg_namelen = sizeof(whereto),
++ .msg_iov = &iov,
++ .msg_iovlen = 1,
++ .msg_control = &cmsg,
++ .msg_controllen = 0,
++ .msg_flags= 0,
++ };
+ m.msg_controllen = cmsg_len;
+ iov.iov_len = cc;
+
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/iputils/files/debian/targets.diff b/import-layers/yocto-poky/meta/recipes-extended/iputils/files/debian/targets.diff
new file mode 100644
index 000000000..2cb5576c6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/iputils/files/debian/targets.diff
@@ -0,0 +1,15 @@
+Upstream-Status: Inappropriate [disable feature]
+
+Index: iputils-s20121221/Makefile
+===================================================================
+--- iputils-s20121221.orig/Makefile
++++ iputils-s20121221/Makefile
+@@ -106,7 +106,7 @@ endif
+ endif
+
+ # -------------------------------------
+-IPV4_TARGETS=tracepath ping clockdiff rdisc arping tftpd rarpd
++IPV4_TARGETS=tracepath ping clockdiff arping
+ IPV6_TARGETS=tracepath6 traceroute6 ping6
+ TARGETS=$(IPV4_TARGETS) $(IPV6_TARGETS)
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/iputils/files/debian/use_gethostbyname2.diff b/import-layers/yocto-poky/meta/recipes-extended/iputils/files/debian/use_gethostbyname2.diff
new file mode 100644
index 000000000..d3b18868c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/iputils/files/debian/use_gethostbyname2.diff
@@ -0,0 +1,31 @@
+Upstream-Status: Pending [from other distro Debian]
+
+Index: iputils-s20121221/tracepath.c
+===================================================================
+--- iputils-s20121221.orig/tracepath.c
++++ iputils-s20121221/tracepath.c
+@@ -370,9 +370,9 @@ main(int argc, char **argv)
+ }
+ #endif
+
+- he = gethostbyname(p);
++ he = gethostbyname2(argv[0], AF_INET);
+ if (he == NULL) {
+- herror("gethostbyname");
++ herror("gethostbyname2");
+ exit(1);
+ }
+
+Index: iputils-s20121221/ping.c
+===================================================================
+--- iputils-s20121221.orig/ping.c
++++ iputils-s20121221/ping.c
+@@ -279,7 +279,7 @@ main(int argc, char **argv)
+ #else
+ idn = target;
+ #endif
+- hp = gethostbyname(idn);
++ hp = gethostbyname2(idn, AF_INET);
+ if (!hp) {
+ fprintf(stderr, "ping: unknown host %s\n", target);
+ exit(2);
diff --git a/import-layers/yocto-poky/meta/recipes-extended/iputils/files/nsgmls-path-fix.patch b/import-layers/yocto-poky/meta/recipes-extended/iputils/files/nsgmls-path-fix.patch
new file mode 100644
index 000000000..92bf946f2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/iputils/files/nsgmls-path-fix.patch
@@ -0,0 +1,27 @@
+Fix nsgmls path issue
+
+Upstream-Status: Pending
+
+Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
+
+Index: iputils-s20101006/doc/Makefile
+===================================================================
+--- iputils-s20101006.orig/doc/Makefile 2011-09-13 20:42:27.000000000 +0800
++++ iputils-s20101006/doc/Makefile 2011-09-13 21:01:52.000000000 +0800
+@@ -27,10 +27,15 @@
+ # docbook2man produces utterly ugly output and I did not find
+ # any way to customize this but hacking backend perl script a little.
+ # Well, hence...
++# nsgmls seems append path to search directory according to the sysid path.
++# e.g. if input ../index.db, it would search $search_directory/../ rather than
++# $search_directory, which leads searching failure. Fixing nsgmls probably
++# introduce some side effects, so use this ugly hack: running nsgmls in current
++# directory, and running docbook2man in tmp directory.
+
+ $(MANFILES): index.db
+ @-mkdir tmp.db2man
+- @set -e; cd tmp.db2man; nsgmls ../$< | sgmlspl ../docbook2man-spec.pl ; mv $@ ..
++ @set -e; nsgmls $< >tmp.db2man/output; cd tmp.db2man; cat output | sgmlspl ../docbook2man-spec.pl ; mv $@ ..
+ @-rm -rf tmp.db2man
+
+ clean:
diff --git a/import-layers/yocto-poky/meta/recipes-extended/iputils/iputils_s20151218.bb b/import-layers/yocto-poky/meta/recipes-extended/iputils/iputils_s20151218.bb
new file mode 100644
index 000000000..715045470
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/iputils/iputils_s20151218.bb
@@ -0,0 +1,76 @@
+SUMMARY = "Network monitoring tools"
+DESCRIPTION = "Utilities for the IP protocol, including traceroute6, \
+tracepath, tracepath6, ping, ping6 and arping."
+HOMEPAGE = "http://www.skbuff.net/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 docbook-utils-native sgmlspl-native libcap libgcrypt"
+
+
+SRC_URI = "http://www.skbuff.net/iputils/${BPN}-${PV}.tar.bz2 \
+ file://debian/use_gethostbyname2.diff \
+ file://debian/targets.diff \
+ file://nsgmls-path-fix.patch \
+ file://0001-Fix-header-inclusion-for-musl.patch \
+ file://0001-Intialize-struct-elements-by-name.patch \
+ "
+
+SRC_URI[md5sum] = "8aaa7395f27dff9f57ae016d4bc753ce"
+SRC_URI[sha256sum] = "549f58d71951e52b46595829134d4e330642f522f50026917fadc349a54825a1"
+
+UPSTREAM_CHECK_REGEX = "iputils-(?P<pver>s\d+).tar"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+do_compile () {
+ oe_runmake 'CC=${CC} -D_GNU_SOURCE' VPATH="${STAGING_LIBDIR}:${STAGING_DIR_HOST}/${base_libdir}" all man
+}
+
+do_install () {
+ install -m 0755 -d ${D}${base_bindir} ${D}${mandir}/man8
+ # SUID root programs
+ install -m 4555 ping ${D}${base_bindir}/ping
+ install -m 4555 ping6 ${D}${base_bindir}/ping6
+ install -m 4555 traceroute6 ${D}${base_bindir}/
+ install -m 4555 clockdiff ${D}${base_bindir}/
+ # Other programgs
+ for i in arping tracepath tracepath6; do
+ install -m 0755 $i ${D}${base_bindir}/
+ done
+ # Manual pages for things we build packages for
+ for i in tracepath.8 traceroute6.8 ping.8 arping.8; do
+ install -m 0644 doc/$i ${D}${mandir}/man8/ || true
+ done
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN}-ping = "ping"
+ALTERNATIVE_LINK_NAME[ping] = "${base_bindir}/ping"
+
+ALTERNATIVE_${PN}-ping6 = "ping6"
+ALTERNATIVE_LINK_NAME[ping6] = "${base_bindir}/ping6"
+
+PACKAGES += "${PN}-ping ${PN}-ping6 ${PN}-arping ${PN}-tracepath ${PN}-tracepath6 ${PN}-traceroute6 ${PN}-clockdiff"
+
+ALLOW_EMPTY_${PN} = "1"
+RDEPENDS_${PN} += "${PN}-ping ${PN}-ping6 ${PN}-arping ${PN}-tracepath ${PN}-tracepath6 ${PN}-traceroute6 ${PN}-clockdiff"
+
+FILES_${PN} = ""
+FILES_${PN}-ping = "${base_bindir}/ping.${BPN}"
+FILES_${PN}-ping6 = "${base_bindir}/ping6.${BPN}"
+FILES_${PN}-arping = "${base_bindir}/arping"
+FILES_${PN}-tracepath = "${base_bindir}/tracepath"
+FILES_${PN}-tracepath6 = "${base_bindir}/tracepath6"
+FILES_${PN}-traceroute6 = "${base_bindir}/traceroute6"
+FILES_${PN}-clockdiff = "${base_bindir}/clockdiff"
+FILES_${PN}-doc = "${mandir}/man8"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/less/less_481.bb b/import-layers/yocto-poky/meta/recipes-extended/less/less_481.bb
new file mode 100644
index 000000000..0fcd81968
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/less/less_481.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=48c26a307f91af700e1f00585f215aaf"
+DEPENDS = "ncurses"
+
+SRC_URI = "http://www.greenwoodsoftware.com/${BPN}/${BPN}-${PV}.tar.gz \
+ "
+
+SRC_URI[md5sum] = "50ef46065c65257141a7340123527767"
+SRC_URI[sha256sum] = "3fa38f2cf5e9e040bb44fffaa6c76a84506e379e47f5a04686ab78102090dda5"
+
+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/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/00_arches.patch b/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/00_arches.patch
new file mode 100644
index 000000000..9d6447d98
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/destdir.patch b/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/destdir.patch
new file mode 100644
index 000000000..dad9601c4
--- /dev/null
+++ b/import-layers/yocto-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.106/Makefile
+===================================================================
+--- libaio-0.3.106.orig/Makefile 2004-02-26 07:25:10.000000000 -0800
++++ libaio-0.3.106/Makefile 2006-10-14 09:19:07.000000000 -0700
+@@ -15,7 +15,7 @@
+ @$(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)
+
+
+ clean:
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/generic-arch-dectection-for-padding-defines.patch b/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/generic-arch-dectection-for-padding-defines.patch
new file mode 100644
index 000000000..bba7e554a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/libaio_fix_for_mips_syscalls.patch b/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/libaio_fix_for_mips_syscalls.patch
new file mode 100644
index 000000000..9c6850c08
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/libaio_fix_for_x32.patch b/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/libaio_fix_for_x32.patch
new file mode 100644
index 000000000..508f5a12f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/system-linkage.patch b/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/system-linkage.patch
new file mode 100644
index 000000000..0b1f47569
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio_0.3.110.bb b/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio_0.3.110.bb
new file mode 100644
index 000000000..2adfa0aa4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio_0.3.110.bb
@@ -0,0 +1,24 @@
+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 = "${DEBIAN_MIRROR}/main/liba/libaio/libaio_${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"
+
+EXTRA_OEMAKE =+ "prefix=${prefix} includedir=${includedir} libdir=${libdir}"
+
+do_install () {
+ oe_runmake install DESTDIR=${D}
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/0001-Set-xattrs-after-setting-times.patch b/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/0001-Set-xattrs-after-setting-times.patch
new file mode 100644
index 000000000..6d74e867e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/0001-Set-xattrs-after-setting-times.patch
@@ -0,0 +1,59 @@
+From 545ded56095c570426fe102ff2192889681ea75c Mon Sep 17 00:00:00 2001
+From: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
+Date: Mon, 29 Feb 2016 14:38:25 +0200
+Subject: [PATCH] Set xattrs after setting times
+
+With Integrity Measurement Architecture (IMA) enabled in Linux
+kernel the security.ima extended attribute gets overwritten
+when setting times on a file with a futimens() call. So it's safer
+to set xattrs after times.
+
+Upstream-Status: Submitted [https://github.com/libarchive/libarchive/pull/664]
+
+Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
+
+---
+ libarchive/archive_write_disk_posix.c | 21 +++++++++++----------
+ 1 file changed, 11 insertions(+), 10 deletions(-)
+
+diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c
+index 0fc6193..27c9c1e 100644
+--- a/libarchive/archive_write_disk_posix.c
++++ b/libarchive/archive_write_disk_posix.c
+@@ -1620,16 +1620,6 @@ _archive_write_disk_finish_entry(struct archive *_a)
+ }
+
+ /*
+- * Security-related extended attributes (such as
+- * security.capability on Linux) have to be restored last,
+- * since they're implicitly removed by other file changes.
+- */
+- if (a->todo & TODO_XATTR) {
+- int r2 = set_xattrs(a);
+- if (r2 < ret) ret = r2;
+- }
+-
+- /*
+ * Some flags prevent file modification; they must be restored after
+ * file contents are written.
+ */
+@@ -1648,6 +1638,17 @@ _archive_write_disk_finish_entry(struct archive *_a)
+ }
+
+ /*
++ * Security-related extended attributes (such as
++ * security.capability or security.ima on Linux) have to be restored last,
++ * since they're implicitly removed by other file changes like setting
++ * times.
++ */
++ if (a->todo & TODO_XATTR) {
++ int r2 = set_xattrs(a);
++ if (r2 < ret) ret = r2;
++ }
++
++ /*
+ * Mac extended metadata includes ACLs.
+ */
+ if (a->todo & TODO_MAC_METADATA) {
+--
+2.5.0
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/libarchive-CVE-2013-0211.patch b/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/libarchive-CVE-2013-0211.patch
new file mode 100644
index 000000000..19523f4b8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/libarchive-CVE-2013-0211.patch
@@ -0,0 +1,39 @@
+From 2f55d6bd308ea61975558c2469ae349dba297e89 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Sat, 22 Feb 2014 14:35:59 +0800
+Subject: [PATCH] Fix CVE-2013-0211
+
+This patch comes from:https://github.com/libarchive/libarchive/commit/22531545514043e04633e1c015c7540b9de9dbe4
+
+Upstream-Status: Backport
+CVE: CVE-2013-0211
+
+Signed-off-by: Baogen shang <baogen.shang@windriver.com>
+
+Update the patch because of uprev on 20140222
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ libarchive/archive_write.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/libarchive/archive_write.c b/libarchive/archive_write.c
+index a3d1a33..a323588 100644
+--- a/libarchive/archive_write.c
++++ b/libarchive/archive_write.c
+@@ -671,8 +671,12 @@ static ssize_t
+ _archive_write_data(struct archive *_a, const void *buff, size_t s)
+ {
+ struct archive_write *a = (struct archive_write *)_a;
++ const size_t max_write = INT_MAX;
+ archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC,
+ ARCHIVE_STATE_DATA, "archive_write_data");
++ /* In particular, this catches attempts to pass negative values. */
++ if (s > max_write)
++ s = max_write;
+ archive_clear_error(&a->archive);
+ return ((a->format_write_data)(a, buff, s));
+ }
+--
+1.8.2.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/libarchive-CVE-2015-2304.patch b/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/libarchive-CVE-2015-2304.patch
new file mode 100644
index 000000000..5c2439635
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/libarchive-CVE-2015-2304.patch
@@ -0,0 +1,152 @@
+From 59357157706d47c365b2227739e17daba3607526 Mon Sep 17 00:00:00 2001
+From: Alessandro Ghedini <alessandro@ghedini.me>
+Date: Sun, 1 Mar 2015 12:07:45 +0100
+Subject: [PATCH] Add ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS option
+
+This fixes a directory traversal in the cpio tool.
+
+
+Upstream-Status: backport
+CVE: CVE-2015-2304
+
+Signed-off-by: Li Zhou <li.zhou@windriver.com>
+---
+ cpio/bsdcpio.1 | 3 ++-
+ cpio/cpio.c | 2 ++
+ libarchive/archive.h | 2 ++
+ libarchive/archive_write_disk.3 | 3 +++
+ libarchive/archive_write_disk_posix.c | 14 +++++++++++---
+ libarchive/test/test_write_disk_secure.c | 23 +++++++++++++++++++++++
+ 6 files changed, 43 insertions(+), 4 deletions(-)
+
+diff --git a/cpio/bsdcpio.1 b/cpio/bsdcpio.1
+index f966aa0..e52546e 100644
+--- a/cpio/bsdcpio.1
++++ b/cpio/bsdcpio.1
+@@ -156,7 +156,8 @@ See above for description.
+ .It Fl Fl insecure
+ (i and p mode only)
+ Disable security checks during extraction or copying.
+-This allows extraction via symbolic links and path names containing
++This allows extraction via symbolic links, absolute paths,
++and path names containing
+ .Sq ..
+ in the name.
+ .It Fl J , Fl Fl xz
+diff --git a/cpio/cpio.c b/cpio/cpio.c
+index 0acde11..b267e9b 100644
+--- a/cpio/cpio.c
++++ b/cpio/cpio.c
+@@ -171,6 +171,7 @@ main(int argc, char *argv[])
+ cpio->extract_flags |= ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER;
+ cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_SYMLINKS;
+ cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NODOTDOT;
++ cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS;
+ cpio->extract_flags |= ARCHIVE_EXTRACT_PERM;
+ cpio->extract_flags |= ARCHIVE_EXTRACT_FFLAGS;
+ cpio->extract_flags |= ARCHIVE_EXTRACT_ACL;
+@@ -256,6 +257,7 @@ main(int argc, char *argv[])
+ case OPTION_INSECURE:
+ cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_SYMLINKS;
+ cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT;
++ cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS;
+ break;
+ case 'L': /* GNU cpio */
+ cpio->option_follow_links = 1;
+diff --git a/libarchive/archive.h b/libarchive/archive.h
+index 1f0fc38..ef635ac 100644
+--- a/libarchive/archive.h
++++ b/libarchive/archive.h
+@@ -649,6 +649,8 @@ __LA_DECL int archive_read_set_passphrase_callback(struct archive *,
+ /* Default: Do not use HFS+ compression if it was not compressed. */
+ /* This has no effect except on Mac OS v10.6 or later. */
+ #define ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED (0x8000)
++/* Default: Do not reject entries with absolute paths */
++#define ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS (0x10000)
+
+ __LA_DECL int archive_read_extract(struct archive *, struct archive_entry *,
+ int flags);
+diff --git a/libarchive/archive_write_disk.3 b/libarchive/archive_write_disk.3
+index fa925cc..a2e7afa 100644
+--- a/libarchive/archive_write_disk.3
++++ b/libarchive/archive_write_disk.3
+@@ -177,6 +177,9 @@ The default is to not refuse such paths.
+ Note that paths ending in
+ .Pa ..
+ always cause an error, regardless of this flag.
++.It Cm ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS
++Refuse to extract an absolute path.
++The default is to not refuse such paths.
+ .It Cm ARCHIVE_EXTRACT_SPARSE
+ Scan data for blocks of NUL bytes and try to recreate them with holes.
+ This results in sparse files, independent of whether the archive format
+diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c
+index ab3bdac..c1290eb 100644
+--- a/libarchive/archive_write_disk_posix.c
++++ b/libarchive/archive_write_disk_posix.c
+@@ -2509,8 +2509,9 @@ cleanup_pathname_win(struct archive_write_disk *a)
+ /*
+ * Canonicalize the pathname. In particular, this strips duplicate
+ * '/' characters, '.' elements, and trailing '/'. It also raises an
+- * error for an empty path, a trailing '..' or (if _SECURE_NODOTDOT is
+- * set) any '..' in the path.
++ * error for an empty path, a trailing '..', (if _SECURE_NODOTDOT is
++ * set) any '..' in the path or (if ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS
++ * is set) if the path is absolute.
+ */
+ static int
+ cleanup_pathname(struct archive_write_disk *a)
+@@ -2529,8 +2530,15 @@ cleanup_pathname(struct archive_write_disk *a)
+ cleanup_pathname_win(a);
+ #endif
+ /* Skip leading '/'. */
+- if (*src == '/')
++ if (*src == '/') {
++ if (a->flags & ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS) {
++ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
++ "Path is absolute");
++ return (ARCHIVE_FAILED);
++ }
++
+ separator = *src++;
++ }
+
+ /* Scan the pathname one element at a time. */
+ for (;;) {
+diff --git a/libarchive/test/test_write_disk_secure.c b/libarchive/test/test_write_disk_secure.c
+index 31c5bfd..2c94206 100644
+--- a/libarchive/test/test_write_disk_secure.c
++++ b/libarchive/test/test_write_disk_secure.c
+@@ -178,6 +178,29 @@ DEFINE_TEST(test_write_disk_secure)
+ assert(S_ISDIR(st.st_mode));
+ archive_entry_free(ae);
+
++ /*
++ * Without security checks, we should be able to
++ * extract an absolute path.
++ */
++ assert((ae = archive_entry_new()) != NULL);
++ archive_entry_copy_pathname(ae, "/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp");
++ archive_entry_set_mode(ae, S_IFREG | 0777);
++ assert(0 == archive_write_header(a, ae));
++ assert(0 == archive_write_finish_entry(a));
++ assertFileExists("/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp");
++ assert(0 == unlink("/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp"));
++
++ /* But with security checks enabled, this should fail. */
++ assert(archive_entry_clear(ae) != NULL);
++ archive_entry_copy_pathname(ae, "/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp");
++ archive_entry_set_mode(ae, S_IFREG | 0777);
++ archive_write_disk_set_options(a, ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS);
++ failure("Extracting an absolute path should fail here.");
++ assertEqualInt(ARCHIVE_FAILED, archive_write_header(a, ae));
++ archive_entry_free(ae);
++ assert(0 == archive_write_finish_entry(a));
++ assertFileNotExists("/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp");
++
+ assertEqualInt(ARCHIVE_OK, archive_write_free(a));
+
+ /* Test the entries on disk. */
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/mkdir.patch b/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/mkdir.patch
new file mode 100644
index 000000000..509a2957a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/mkdir.patch
@@ -0,0 +1,45 @@
+Add missing mkdir calls so that out-of-tree builds work.
+
+Upstream-Status: Submitted (https://github.com/libarchive/libarchive/pull/534)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/Makefile.am b/Makefile.am
+index 3fa2d22..5ecca52 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -508,6 +508,7 @@ libarchive_test_LDADD= $(LTLIBICONV)
+ # Building it automatically provides a sanity-check on libarchive_test_SOURCES
+ # above.
+ libarchive/test/list.h: Makefile
++ $(MKDIR_P) libarchive/test
+ cat $(top_srcdir)/libarchive/test/test_*.c | grep DEFINE_TEST > libarchive/test/list.h
+
+ libarchive_TESTS_ENVIRONMENT= LIBARCHIVE_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/libarchive/test LRZIP=NOCONFIG
+@@ -835,6 +836,7 @@ bsdtar_test_CPPFLAGS=\
+ $(PLATFORMCPPFLAGS)
+
+ tar/test/list.h: Makefile
++ $(MKDIR_P) tar/test
+ cat $(top_srcdir)/tar/test/test_*.c | grep DEFINE_TEST > tar/test/list.h
+
+ if BUILD_BSDTAR
+@@ -975,6 +977,7 @@ bsdcpio_test_CPPFLAGS= \
+ bsdcpio_test_LDADD=libarchive_fe.la
+
+ cpio/test/list.h: Makefile
++ $(MKDIR_P) cpio/test
+ cat $(top_srcdir)/cpio/test/test_*.c | grep DEFINE_TEST > cpio/test/list.h
+
+ if BUILD_BSDCPIO
+diff --git a/configure.ac b/configure.ac
+index 38bd299..7bdb00c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -102,6 +102,7 @@ AC_USE_SYSTEM_EXTENSIONS
+ AC_LIBTOOL_WIN32_DLL
+ AC_PROG_LIBTOOL
+ AC_CHECK_TOOL([STRIP],[strip])
++AC_PROG_MKDIR_P
+
+ #
+ # Options for building bsdtar.
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/pkgconfig.patch b/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/pkgconfig.patch
new file mode 100644
index 000000000..346af9135
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/pkgconfig.patch
@@ -0,0 +1,25 @@
+Use pkg-config for the libxml2 dependency, not the -config script.
+
+Upstream-Status: Pending
+
+RP 2014/5/22
+
+Index: libarchive-3.1.2/configure.ac
+===================================================================
+--- libarchive-3.1.2.orig/configure.ac 2013-02-09 17:23:03.000000000 +0000
++++ libarchive-3.1.2/configure.ac 2014-05-13 15:26:45.446499108 +0000
+@@ -329,10 +329,10 @@
+ AS_HELP_STRING([--without-expat], [Don't build support for xar through expat]))
+
+ if test "x$with_xml2" != "xno"; then
+- AC_PATH_PROG([XML2_CONFIG], [xml2-config],, [${PATH}])
+- if test "x$XML2_CONFIG" != "x"; then
+- CPPFLAGS="${CPPFLAGS} `${XML2_CONFIG} --cflags`"
+- LIBS="${LIBS} `${XML2_CONFIG} --libs`"
++ PKG_CHECK_MODULES(PKG_XML2, [libxml-2.0],,)
++ if test "x$PKG_XML2_CFLAGS" != "x"; then
++ CPPFLAGS="${CPPFLAGS} ${PKG_XML2_CFLAGS}"
++ LIBS="${LIBS} ${PKG_XML2_LIBS}"
+ AC_CHECK_LIB(xml2,xmlInitParser,[true],AC_MSG_FAILURE(Missing xml2 library))
+ else
+ AC_CHECK_LIB(xml2,xmlInitParser)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive_3.1.2.bb b/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive_3.1.2.bb
new file mode 100644
index 000000000..ed677ac31
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive_3.1.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=b4e3ffd607d6686c6cb2f63394370841"
+
+DEPENDS = "e2fsprogs-native"
+
+PACKAGECONFIG ?= "zlib bz2"
+
+PACKAGECONFIG_append_class-target = "\
+ libxml2 \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'acl', 'acl', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'xattr', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'largefile', 'largefile', '', d)} \
+"
+
+PACKAGECONFIG_append_class-nativesdk = " largefile"
+
+PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
+PACKAGECONFIG[xattr] = "--enable-xattr,--disable-xattr,attr,"
+PACKAGECONFIG[largefile] = "--enable-largefile,--disable-largefile,,"
+PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib,"
+PACKAGECONFIG[bz2] = "--with-bz2lib,--without-bz2lib,bzip2,"
+PACKAGECONFIG[xz] = "--with-lzmadec --with-lzma,--without-lzmadec --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,"
+
+SRC_URI = "http://libarchive.org/downloads/libarchive-${PV}.tar.gz \
+ file://libarchive-CVE-2013-0211.patch \
+ file://pkgconfig.patch \
+ file://libarchive-CVE-2015-2304.patch \
+ file://mkdir.patch \
+ file://0001-Set-xattrs-after-setting-times.patch \
+ "
+
+SRC_URI[md5sum] = "efad5a503f66329bb9d2f4308b5de98a"
+SRC_URI[sha256sum] = "eb87eacd8fe49e8d90c8fdc189813023ccc319c5e752b01fb6ad0cc7b2c53d5e"
+
+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 = "100"
+
+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/import-layers/yocto-poky/meta/recipes-extended/libidn/libidn/avoid_AM_PROG_MKDIR_P_warning_error_with_automake_1.12.patch b/import-layers/yocto-poky/meta/recipes-extended/libidn/libidn/avoid_AM_PROG_MKDIR_P_warning_error_with_automake_1.12.patch
new file mode 100644
index 000000000..3476bb959
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/libidn/libidn/dont-depend-on-help2man.patch b/import-layers/yocto-poky/meta/recipes-extended/libidn/libidn/dont-depend-on-help2man.patch
new file mode 100644
index 000000000..0863530f2
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/libidn/libidn/libidn_fix_for_automake-1.12.patch b/import-layers/yocto-poky/meta/recipes-extended/libidn/libidn/libidn_fix_for_automake-1.12.patch
new file mode 100644
index 000000000..20afd257b
--- /dev/null
+++ b/import-layers/yocto-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.24/configure.ac
+===================================================================
+--- libidn-1.24.orig/configure.ac
++++ libidn-1.24/configure.ac
+@@ -34,6 +34,10 @@ AC_SUBST(LT_CURRENT, 17)
+ AC_SUBST(LT_REVISION, 7)
+ 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/import-layers/yocto-poky/meta/recipes-extended/libidn/libidn_0.6.14.bb b/import-layers/yocto-poky/meta/recipes-extended/libidn/libidn_0.6.14.bb
new file mode 100644
index 000000000..c681560d8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libidn/libidn_0.6.14.bb
@@ -0,0 +1,36 @@
+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+ & GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a \
+ file://COPYING.LIB;md5=a6f89e2100d9b6cdffcea4f398e37343 \
+ file://lib/idna.h;beginline=6;endline=18;md5=1336e848ca7b8e25767c3c7e8fa38a89 \
+ file://src/idn.c;beginline=6;endline=18;md5=56c89e359652a71cda128d75f0ffdac4"
+PR = "r1"
+
+inherit pkgconfig autotools gettext texinfo
+
+SRC_URI = "http://alpha.gnu.org/gnu/libidn/${BPN}-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "040f012a45feb56168853998bb87ad4d"
+SRC_URI[sha256sum] = "98910c2ad664bdf4eed2c2fff88e24f8882636ec9d26669366ff03b469c05ae3"
+
+do_configure_prepend() {
+ # this version of libidn copies AC_USE_SYSTEM_EXTENSIONS from
+ # autoconf CVS because atm the autoconf it uses is a bit old
+ # now with cross autotool, that macro is already there and this
+ # local definition causes circular dependency. Actually AC_GNU_SOURCE
+ # is identical to AC_USE_SYSTEM_EXTENSIONS. So remove all local
+ # references to the latter here.
+ sed -i -e "/AC_REQUIRE(\[gl_USE_SYSTEM_EXTENSIONS/d" ${S}/lib/gl/m4/gnulib-comp.m4
+ rm -f ${S}/lib/gl/m4/extensions.m4
+}
+
+do_install_append() {
+ rm -rf ${D}${libdir}/Libidn.dll
+ rm -rf ${D}${datadir}/emacs
+}
+
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libidn/libidn_1.32.bb b/import-layers/yocto-poky/meta/recipes-extended/libidn/libidn_1.32.bb
new file mode 100644
index 000000000..4d6e88529
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libidn/libidn_1.32.bb
@@ -0,0 +1,37 @@
+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=7c0b3828d1b153663be9a04ad4f7975f \
+ file://src/idn.c;endline=20;md5=f4235f2a2cb2b65786b2979fb3cf7fbf"
+
+inherit pkgconfig autotools gettext texinfo
+
+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 \
+"
+
+SRC_URI[md5sum] = "4dd8356ba577287ea7076bfa1554b534"
+SRC_URI[sha256sum] = "ba5d5afee2beff703a34ee094668da5c6ea5afa38784cebba8924105e185c4f5"
+
+# 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}/*"
+
+EXTRA_OECONF = "--disable-csharp"
+
+do_install_append() {
+ rm -rf ${D}${datadir}/emacs
+}
+
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libsolv/libsolv/0001-CMakeLists.txt-fix-MAN_INSTALL_DIR.patch b/import-layers/yocto-poky/meta/recipes-extended/libsolv/libsolv/0001-CMakeLists.txt-fix-MAN_INSTALL_DIR.patch
new file mode 100644
index 000000000..972ecc9c5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libsolv/libsolv/0001-CMakeLists.txt-fix-MAN_INSTALL_DIR.patch
@@ -0,0 +1,37 @@
+From 280f0d37c642d68bad2a2e49ef437953474d99e6 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 6 Apr 2016 23:15:02 -0700
+Subject: [PATCH] CMakeLists.txt: fix MAN_INSTALL_DIR
+
+It checks ${CMAKE_INSTALL_PREFIX}/share/man when configure, but it may
+not exist when crosscompile, for example, when CMAKE_INSTALL_PREFIX="/",
+it is OK, but when CMAKE_INSTALL_PREFIX="/some/path/else", then it
+doesn't exist, and the man dir would be set to "/usr/man" which is
+incorrect.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ CMakeLists.txt | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index fd1426b..747db22 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -57,10 +57,7 @@ else (DEFINED INCLUDE)
+ ENDIF (DEFINED INCLUDE)
+ MESSAGE (STATUS "Header files will be installed in ${INCLUDE_INSTALL_DIR}")
+ SET (BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin")
+-SET (MAN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/man")
+-IF (IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/share/man" AND NOT IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/man")
+- SET (MAN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/man")
+-ENDIF (IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/share/man" AND NOT IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/man")
++SET (MAN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/man")
+ MESSAGE(STATUS "Man pages will be installed in ${MAN_INSTALL_DIR}")
+
+ ####################################################################
+--
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libsolv/libsolv_git.bb b/import-layers/yocto-poky/meta/recipes-extended/libsolv/libsolv_git.bb
new file mode 100644
index 000000000..fb81c8a5f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libsolv/libsolv_git.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"
+
+PV = "0.6.19"
+
+SRC_URI = "git://github.com/openSUSE/libsolv.git \
+ file://0001-CMakeLists.txt-fix-MAN_INSTALL_DIR.patch \
+"
+SRCREV = "4c5af401a89858d4cebbfe40c59a0031ff9db5b0"
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)"
+
+S = "${WORKDIR}/git"
+
+inherit cmake
+
+EXTRA_OECMAKE = "-DLIB=${baselib}"
+
+PACKAGES =+ "${PN}-tools ${PN}ext"
+
+FILES_${PN}-dev += "${datadir}/cmake/Modules/FindLibSolv.cmake"
+FILES_${PN}-tools = "${bindir}/*"
+FILES_${PN}ext = "${libdir}/${PN}ext.so.*"
+
+BBCLASSEXTEND =+ "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/0001-Add-missing-rwlock_unlocks-in-xprt_register.patch b/import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/0001-Add-missing-rwlock_unlocks-in-xprt_register.patch
new file mode 100644
index 000000000..50613ba31
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/0001-Add-missing-rwlock_unlocks-in-xprt_register.patch
@@ -0,0 +1,62 @@
+Subject: [PATCH] Add missing rwlock_unlocks in xprt_register
+
+It looks like in b2c9430f46c4ac848957fb8adaac176a3f6ac03f when svc_run
+switched to poll, an early return was added, but the rwlock was not
+unlocked.
+
+I observed that rpcbind built against libtirpc-1.0.1 would handle only
+one request before hanging, and tracked it down to a missing
+rwlock_unlock here.
+
+Fixes: b2c9430f46c4 ('Use poll() instead of select() in svc_run()')
+
+Upstream-Status: Backport
+
+Signed-off-by: Michael Forney <mforney@mforney.org>
+Signed-off-by: Steve Dickson <steved@redhat.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ src/svc.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/src/svc.c b/src/svc.c
+index 9c41445..b59467b 100644
+--- a/src/svc.c
++++ b/src/svc.c
+@@ -99,7 +99,7 @@ xprt_register (xprt)
+ {
+ __svc_xports = (SVCXPRT **) calloc (_rpc_dtablesize(), sizeof (SVCXPRT *));
+ if (__svc_xports == NULL)
+- return;
++ goto unlock;
+ }
+ if (sock < _rpc_dtablesize())
+ {
+@@ -120,14 +120,14 @@ xprt_register (xprt)
+ svc_pollfd[i].fd = sock;
+ svc_pollfd[i].events = (POLLIN | POLLPRI |
+ POLLRDNORM | POLLRDBAND);
+- return;
++ goto unlock;
+ }
+
+ new_svc_pollfd = (struct pollfd *) realloc (svc_pollfd,
+ sizeof (struct pollfd)
+ * (svc_max_pollfd + 1));
+ if (new_svc_pollfd == NULL) /* Out of memory */
+- return;
++ goto unlock;
+ svc_pollfd = new_svc_pollfd;
+ ++svc_max_pollfd;
+
+@@ -135,6 +135,7 @@ xprt_register (xprt)
+ svc_pollfd[svc_max_pollfd - 1].events = (POLLIN | POLLPRI |
+ POLLRDNORM | POLLRDBAND);
+ }
++unlock:
+ rwlock_unlock (&svc_fd_lock);
+ }
+
+--
+2.5.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/Use-netbsd-queue.h.patch b/import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/Use-netbsd-queue.h.patch
new file mode 100644
index 000000000..f93223feb
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/libtirpc-0.2.1-fortify.patch b/import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/libtirpc-0.2.1-fortify.patch
new file mode 100644
index 000000000..4a785d344
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/libtirpc-0.2.1-fortify.patch
@@ -0,0 +1,26 @@
+Fix a possible overflow (reported by _FORTIFY_SOURCE=2)
+
+Ported from Gentoo
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: libtirpc-0.2.1/src/getrpcport.c
+===================================================================
+--- libtirpc-0.2.1.orig/src/getrpcport.c
++++ libtirpc-0.2.1/src/getrpcport.c
+@@ -54,11 +54,11 @@ getrpcport(host, prognum, versnum, proto
+
+ if ((hp = gethostbyname(host)) == NULL)
+ return (0);
++ if (hp->h_length != sizeof(addr.sin_addr.s_addr))
++ return (0);
+ memset(&addr, 0, sizeof(addr));
+ addr.sin_family = AF_INET;
+ addr.sin_port = 0;
+- if (hp->h_length > sizeof(addr))
+- hp->h_length = sizeof(addr);
+ memcpy(&addr.sin_addr.s_addr, hp->h_addr, (size_t)hp->h_length);
+ /* Inconsistent interfaces need casts! :-( */
+ return (pmap_getport(&addr, (u_long)prognum, (u_long)versnum,
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/remove-des-functionality.patch b/import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/remove-des-functionality.patch
new file mode 100644
index 000000000..512e93497
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/remove-des-functionality.patch
@@ -0,0 +1,144 @@
+uclibc and musl does not provide des functionality. Lets disable it.
+
+Upstream-Status: Inappropriate [uclibc and musl specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+diff -Naur libtirpc-1.0.1-orig/src/Makefile.am libtirpc-1.0.1/src/Makefile.am
+--- libtirpc-1.0.1-orig/src/Makefile.am 2015-10-30 17:15:14.000000000 +0200
++++ libtirpc-1.0.1/src/Makefile.am 2015-12-21 15:56:17.094702429 +0200
+@@ -22,9 +22,8 @@
+ pmap_prot.c pmap_prot2.c pmap_rmt.c rpc_prot.c rpc_commondata.c \
+ rpc_callmsg.c rpc_generic.c rpc_soc.c rpcb_clnt.c rpcb_prot.c \
+ rpcb_st_xdr.c svc.c svc_auth.c svc_dg.c svc_auth_unix.c svc_auth_none.c \
+- svc_auth_des.c \
+ svc_generic.c svc_raw.c svc_run.c svc_simple.c svc_vc.c getpeereid.c \
+- auth_time.c auth_des.c authdes_prot.c debug.c
++ debug.c
+
+ ## XDR
+ libtirpc_la_SOURCES += xdr.c xdr_rec.c xdr_array.c xdr_float.c xdr_mem.c xdr_reference.c xdr_stdio.c xdr_sizeof.c
+@@ -41,8 +40,8 @@
+ libtirpc_la_CFLAGS = -DHAVE_RPCSEC_GSS $(GSSAPI_CFLAGS)
+ endif
+
+-libtirpc_la_SOURCES += key_call.c key_prot_xdr.c getpublickey.c
+-libtirpc_la_SOURCES += netname.c netnamer.c rpcdname.c rtime.c
++#libtirpc_la_SOURCES += key_call.c key_prot_xdr.c getpublickey.c
++#libtirpc_la_SOURCES += netname.c netnamer.c rpcdname.c rtime.c
+
+ CLEANFILES = cscope.* *~
+ DISTCLEANFILES = Makefile.in
+diff -Naur libtirpc-1.0.1-orig/src/rpc_soc.c libtirpc-1.0.1/src/rpc_soc.c
+--- libtirpc-1.0.1-orig/src/rpc_soc.c 2015-10-30 17:15:14.000000000 +0200
++++ libtirpc-1.0.1/src/rpc_soc.c 2015-12-21 15:56:17.095702416 +0200
+@@ -61,7 +61,6 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <fcntl.h>
+-#include <rpcsvc/nis.h>
+
+ #include "rpc_com.h"
+
+@@ -522,86 +521,6 @@
+ }
+
+ /*
+- * Create the client des authentication object. Obsoleted by
+- * authdes_seccreate().
+- */
+-AUTH *
+-authdes_create(servername, window, syncaddr, ckey)
+- char *servername; /* network name of server */
+- u_int window; /* time to live */
+- struct sockaddr *syncaddr; /* optional hostaddr to sync with */
+- des_block *ckey; /* optional conversation key to use */
+-{
+- AUTH *nauth;
+- char hostname[NI_MAXHOST];
+-
+- if (syncaddr) {
+- /*
+- * Change addr to hostname, because that is the way
+- * new interface takes it.
+- */
+- switch (syncaddr->sa_family) {
+- case AF_INET:
+- if (getnameinfo(syncaddr, sizeof(struct sockaddr_in), hostname,
+- sizeof hostname, NULL, 0, 0) != 0)
+- goto fallback;
+- break;
+- case AF_INET6:
+- if (getnameinfo(syncaddr, sizeof(struct sockaddr_in6), hostname,
+- sizeof hostname, NULL, 0, 0) != 0)
+- goto fallback;
+- break;
+- default:
+- goto fallback;
+- }
+- nauth = authdes_seccreate(servername, window, hostname, ckey);
+- return (nauth);
+- }
+-fallback:
+- return authdes_seccreate(servername, window, NULL, ckey);
+-}
+-
+-/*
+- * Create the client des authentication object. Obsoleted by
+- * authdes_pk_seccreate().
+- */
+-extern AUTH *authdes_pk_seccreate(const char *, netobj *, u_int, const char *,
+- const des_block *, nis_server *);
+-
+-AUTH *
+-authdes_pk_create(servername, pkey, window, syncaddr, ckey)
+- char *servername; /* network name of server */
+- netobj *pkey; /* public key */
+- u_int window; /* time to live */
+- struct sockaddr *syncaddr; /* optional hostaddr to sync with */
+- des_block *ckey; /* optional conversation key to use */
+-{
+- AUTH *nauth;
+- char hostname[NI_MAXHOST];
+-
+- if (syncaddr) {
+- /*
+- * Change addr to hostname, because that is the way
+- * new interface takes it.
+- */
+- switch (syncaddr->sa_family) {
+- case AF_INET:
+- if (getnameinfo(syncaddr, sizeof(struct sockaddr_in), hostname,
+- sizeof hostname, NULL, 0, 0) != 0)
+- goto fallback;
+- break;
+- default:
+- goto fallback;
+- }
+- nauth = authdes_pk_seccreate(servername, pkey, window, hostname, ckey, NULL);
+- return (nauth);
+- }
+-fallback:
+- return authdes_pk_seccreate(servername, pkey, window, NULL, ckey, NULL);
+-}
+-
+-
+-/*
+ * Create a client handle for a unix connection. Obsoleted by clnt_vc_create()
+ */
+ CLIENT *
+diff -Naur libtirpc-1.0.1-orig/src/svc_auth.c libtirpc-1.0.1/src/svc_auth.c
+--- libtirpc-1.0.1-orig/src/svc_auth.c 2015-10-30 17:15:14.000000000 +0200
++++ libtirpc-1.0.1/src/svc_auth.c 2015-12-21 15:56:17.095702416 +0200
+@@ -114,9 +114,6 @@
+ case AUTH_SHORT:
+ dummy = _svcauth_short(rqst, msg);
+ return (dummy);
+- case AUTH_DES:
+- dummy = _svcauth_des(rqst, msg);
+- return (dummy);
+ #ifdef HAVE_RPCSEC_GSS
+ case RPCSEC_GSS:
+ dummy = _svcauth_gss(rqst, msg, no_dispatch);
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc_1.0.1.bb b/import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc_1.0.1.bb
new file mode 100644
index 000000000..e321d479e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc_1.0.1.bb
@@ -0,0 +1,40 @@
+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;name=libtirpc \
+ ${GENTOO_MIRROR}/${BPN}-glibc-nfs.tar.xz;name=glibc-nfs \
+ file://libtirpc-0.2.1-fortify.patch \
+ file://0001-Add-missing-rwlock_unlocks-in-xprt_register.patch \
+ "
+
+SRC_URI_append_libc-uclibc = " file://remove-des-functionality.patch \
+ "
+
+SRC_URI_append_libc-musl = " file://remove-des-functionality.patch \
+ file://Use-netbsd-queue.h.patch \
+ "
+
+SRC_URI[libtirpc.md5sum] = "36ce1c0ff80863bb0839d54aa0b94014"
+SRC_URI[libtirpc.sha256sum] = "5156974f31be7ccbc8ab1de37c4739af6d9d42c87b1d5caf4835dda75fcbb89e"
+SRC_URI[glibc-nfs.md5sum] = "5ae500b9d0b6b72cb875bc04944b9445"
+SRC_URI[glibc-nfs.sha256sum] = "2677cfedf626f3f5a8f6e507aed5bb8f79a7453b589d684dbbc086e755170d83"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--disable-gssapi"
+
+do_configure_prepend () {
+ cp -r ${S}/../tirpc ${S}
+}
+
+do_install_append() {
+ chown root:root ${D}${sysconfdir}/netconfig
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libuser/libuser/0001-Check-for-issetugid.patch b/import-layers/yocto-poky/meta/recipes-extended/libuser/libuser/0001-Check-for-issetugid.patch
new file mode 100644
index 000000000..79756b9a0
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/libuser/libuser/0002-remove-unused-execinfo.h.patch b/import-layers/yocto-poky/meta/recipes-extended/libuser/libuser/0002-remove-unused-execinfo.h.patch
new file mode 100644
index 000000000..4bc0219f1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/libuser/libuser_0.62.bb b/import-layers/yocto-poky/meta/recipes-extended/libuser/libuser_0.62.bb
new file mode 100644
index 000000000..1369ae8f2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libuser/libuser_0.62.bb
@@ -0,0 +1,31 @@
+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://fedorahosted.org/libuser/"
+BUGTRACKER = "https://fedorahosted.org/libuser/newticket"
+
+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://fedorahosted.org/releases/l/i/libuser/libuser-${PV}.tar.xz \
+ file://0001-Check-for-issetugid.patch \
+ file://0002-remove-unused-execinfo.h.patch \
+ "
+
+SRC_URI[md5sum] = "63e5e5c551e99dc5302b40b80bd6d4f2"
+SRC_URI[sha256sum] = "a58ff4fabb01a25043b142185a33eeea961109dd60d4b40b6a9df4fa3cace20b"
+
+DEPENDS = "popt libpam glib-2.0 docbook-utils-native linuxdoc-tools-native python"
+
+inherit autotools gettext pythonnative python-dir pkgconfig
+
+EXTRA_OEMAKE = "PYTHON_CPPFLAGS=-I${STAGING_INCDIR}/${PYTHON_DIR}"
+
+PACKAGES += "${PN}-python "
+
+FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR}"
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/index.html.lighttpd b/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/index.html.lighttpd
new file mode 100644
index 000000000..f5f1c377b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/index.html.lighttpd
@@ -0,0 +1 @@
+<html><body><h1>It works!</h1></body></html>
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd b/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd
new file mode 100644
index 000000000..bf89a60b7
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd.conf b/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd.conf
new file mode 100644
index 000000000..6e8402d24
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd.service b/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd.service
new file mode 100644
index 000000000..66a907aa1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/pkgconfig.patch b/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/pkgconfig.patch
new file mode 100644
index 000000000..e395f928c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/pkgconfig.patch
@@ -0,0 +1,33 @@
+Use pkg-config for pcre dependency instead of -config script.
+
+Upstream-Status: Pending
+
+RP 2014/5/22
+
+
+Index: lighttpd-1.4.35/configure.ac
+===================================================================
+--- lighttpd-1.4.35.orig/configure.ac 2014-03-06 14:08:00.000000000 +0000
++++ lighttpd-1.4.35/configure.ac 2014-05-13 16:58:30.758471169 +0000
+@@ -309,16 +309,14 @@
+ AC_MSG_RESULT([$WITH_PCRE])
+
+ if test "$WITH_PCRE" != "no"; then
+- AC_PATH_PROG(PCRECONFIG, pcre-config)
+-
+- if test x"$PCRECONFIG" != x; then
+- PCRE_LIB=`$PCRECONFIG --libs`
+- CPPFLAGS="$CPPFLAGS `$PCRECONFIG --cflags`"
++ PKG_CHECK_MODULES(PCREPKG, [libpcre], [
++ PCRE_LIB=${PCREPKG_LIBS}
++ CPPFLAGS="$CPPFLAGS ${PCREPKG_CFLAGS}"
+ AC_DEFINE([HAVE_LIBPCRE], [1], [libpcre])
+ AC_DEFINE([HAVE_PCRE_H], [1], [pcre.h])
+- else
++ ], [
+ AC_MSG_ERROR([pcre-config not found, install the pcre-devel package or build with --without-pcre])
+- fi
++ ])
+ fi
+
+ AC_SUBST(PCRE_LIB)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd_1.4.39.bb b/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd_1.4.39.bb
new file mode 100644
index 000000000..378accbf1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd_1.4.39.bb
@@ -0,0 +1,76 @@
+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"
+DEPENDS = "zlib libpcre"
+RDEPENDS_${PN} += " \
+ lighttpd-module-access \
+ lighttpd-module-accesslog \
+ lighttpd-module-indexfile \
+ lighttpd-module-dirlisting \
+ lighttpd-module-staticfile \
+"
+
+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://pkgconfig.patch \
+ "
+
+SRC_URI[md5sum] = "63c7563be1c7a7a9819a51f07f1af8b2"
+SRC_URI[sha256sum] = "7eb9a1853c3d6dd5851682b0733a729ba4158d6bdff80974d5ef5f1f6887365b"
+
+PACKAGECONFIG ??= "openssl"
+PACKAGECONFIG[openssl] = "--with-openssl, --without-openssl, openssl"
+
+EXTRA_OECONF = " \
+ --without-bzip2 \
+ --without-ldap \
+ --without-lua \
+ --without-memcache \
+ --with-pcre \
+ --without-webdav-props \
+ --without-webdav-locks \
+ --disable-static \
+"
+
+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/import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch b/import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch
new file mode 100644
index 000000000..2e931a287
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch
@@ -0,0 +1,147 @@
+From 68f29ab490cf987aa34b5f4caf1784b58a021308 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 | 71 +++++++++++++++++++++++++++++++++++++++++++++++++----------
+ 1 file changed, 59 insertions(+), 12 deletions(-)
+
+diff --git a/logrotate.c b/logrotate.c
+index d3deb6a..cf8bf2c 100644
+--- a/logrotate.c
++++ b/logrotate.c
+@@ -1157,6 +1157,53 @@ 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;
++}
++
+ int prerotateSingleLog(struct logInfo *log, int logNum, struct logState *state,
+ struct logNames *rotNames)
+ {
+@@ -1523,15 +1570,15 @@ int prerotateSingleLog(struct logInfo *log, int logNum, struct logState *state,
+ }
+
+ 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;
+ }
+@@ -1669,21 +1716,21 @@ int rotateSingleLog(struct logInfo *log, int logNum, struct logState *state,
+ 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], tmpFilename,
+ strerror(errno));
+ hasErrors = 1;
+@@ -2063,7 +2110,7 @@ int rotateLogSet(struct logInfo *log, int force)
+ return hasErrors;
+ }
+
+-static int writeState(char *stateFilename)
++static int writeState(struct logInfo *log, char *stateFilename)
+ {
+ struct logState *p;
+ FILE *f;
+@@ -2227,7 +2274,7 @@ static int writeState(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",
+@@ -2525,7 +2572,7 @@ int main(int argc, const char **argv)
+ rc |= rotateLogSet(log, force);
+
+ if (!debug)
+- rc |= writeState(stateFile);
++ rc |= writeState(log, stateFile);
+
+ return (rc != 0);
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch b/import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch
new file mode 100644
index 000000000..793d70259
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate/update-the-manual.patch b/import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate/update-the-manual.patch
new file mode 100644
index 000000000..50d037d5a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate/update-the-manual.patch
@@ -0,0 +1,38 @@
+From e0b0fe30e9c49234994a20a86aacfaf80e690087 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 | 10 ++++------
+ 1 file changed, 4 insertions(+), 6 deletions(-)
+
+diff --git a/logrotate.8 b/logrotate.8
+index e4e5f48..84407d0 100644
+--- a/logrotate.8
++++ b/logrotate.8
+@@ -405,12 +405,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.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate_3.9.1.bb b/import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate_3.9.1.bb
new file mode 100644
index 000000000..5f1a601ae
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate_3.9.1.bb
@@ -0,0 +1,63 @@
+SUMMARY = "Rotates, compresses, removes and mails system log files"
+SECTION = "console/utils"
+HOMEPAGE = "https://fedorahosted.org/logrotate/"
+LICENSE = "GPLv2"
+
+# TODO: logrotate 3.8.8 adds autotools/automake support, update recipe to use it.
+# TODO: Document coreutils dependency. Why not RDEPENDS? Why not busybox?
+
+DEPENDS="coreutils popt"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=18810669f13b87348459e611d31ab760"
+
+SRC_URI = "https://fedorahosted.org/releases/l/o/logrotate/logrotate-${PV}.tar.gz \
+ file://act-as-mv-when-rotate.patch \
+ file://update-the-manual.patch \
+ file://disable-check-different-filesystems.patch \
+ "
+
+SRC_URI[md5sum] = "4492b145b6d542e4a2f41e77fa199ab0"
+SRC_URI[sha256sum] = "022769e3288c80981559a8421703c88e8438b447235e36dd3c8e97cd94c52545"
+
+PACKAGECONFIG ?= "\
+ ${@bb.utils.contains('DISTRO_FEATURES', 'acl', 'acl', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', '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"
+
+do_compile_prepend() {
+ # Make sure the recompile is OK
+ rm -f ${B}/.depend
+}
+
+do_install(){
+ oe_runmake install DESTDIR=${D} PREFIX=${D} MANDIR=${mandir}
+ mkdir -p ${D}${sysconfdir}/logrotate.d
+ mkdir -p ${D}${sysconfdir}/cron.daily
+ mkdir -p ${D}${localstatedir}/lib
+ install -p -m 644 examples/logrotate-default ${D}${sysconfdir}/logrotate.conf
+ install -p -m 755 examples/logrotate.cron ${D}${sysconfdir}/cron.daily/logrotate
+ touch ${D}${localstatedir}/lib/logrotate.status
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb/init-functions b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb/init-functions
new file mode 100755
index 000000000..7c1dce24c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb/lsb_killproc b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb/lsb_killproc
new file mode 100755
index 000000000..866c1a9c6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb/lsb_log_message b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb/lsb_log_message
new file mode 100755
index 000000000..10343b081
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb/lsb_pidofproc b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb/lsb_pidofproc
new file mode 100755
index 000000000..6d1fd0f24
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb/lsb_pidofproc
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+. /etc/init.d/functions
+
+pidofproc $*
+exit $?
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb/lsb_start_daemon b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb/lsb_start_daemon
new file mode 100755
index 000000000..de62c2344
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb_4.1.bb b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb_4.1.bb
new file mode 100644
index 000000000..ece0eab0f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb_4.1.bb
@@ -0,0 +1,132 @@
+SUMMARY = "LSB support for OpenEmbedded"
+SECTION = "console/utils"
+HOMEPAGE = "http://prdownloads.sourceforge.net/lsb"
+LICENSE = "GPLv2+"
+PR = "r2"
+
+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://init-functions \
+ file://lsb_killproc \
+ file://lsb_log_message \
+ file://lsb_pidofproc \
+ file://lsb_start_daemon \
+ "
+
+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} mandir=${D}/${datadir}/man/ DESTDIR=${D}
+
+ # this 2 dirs are needed by package lsb-dist-checker
+ mkdir -p ${D}${sysconfdir}/opt
+ mkdir -p ${D}${localstatedir}/opt
+
+ mkdir -p ${D}${base_bindir}
+ mkdir -p ${D}/${baselib}
+ mkdir -p ${D}${sysconfdir}/lsb-release.d
+ printf "LSB_VERSION=\"core-4.1-noarch:" > ${D}${sysconfdir}/lsb-release
+
+ if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ];then
+ printf "core-4.1-ia32" >> ${D}${sysconfdir}/lsb-release
+ else
+ printf "core-4.1-${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}/lib/lsb
+ install -m 0755 ${WORKDIR}/init-functions ${D}/lib/lsb
+
+ # creat links for LSB test
+ install -d ${D}/usr/lib/lsb
+ ln -sf ${sbindir}/chkconfig ${D}/usr/lib/lsb/install_initd
+ ln -sf ${sbindir}/chkconfig ${D}/usr/lib/lsb/remove_initd
+
+ if [ "${TARGET_ARCH}" = "x86_64" ];then
+ cd ${D}
+ if [ "${baselib}" != "lib64" ]; then
+ ln -sf ${baselib} lib64
+ fi
+ cd ${D}/${baselib}
+ 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}/${baselib}
+ 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
+ cd ${D}
+ if [ "${baselib}" != "lib64" ]; then
+ ln -sf ${baselib} lib64
+ fi
+ cd ${D}/${baselib}
+ 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}/${baselib}
+ ln -sf ld.so.1 ld-lsb-ppc32.so.2
+ ln -sf ld.so.1 ld-lsb-ppc32.so.3
+ fi
+}
+FILES_${PN} += "/lib64 \
+ ${base_libdir} \
+ /usr/lib/lsb \
+ ${base_libdir}/lsb/* \
+ /lib/lsb/* \
+ "
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbinitscripts/0001-functions-avoid-exit-1-which-causes-init-scripts-to-.patch b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbinitscripts/0001-functions-avoid-exit-1-which-causes-init-scripts-to-.patch
new file mode 100644
index 000000000..0809c9be9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbinitscripts/0001-functions-avoid-exit-1-which-causes-init-scripts-to-.patch
@@ -0,0 +1,23 @@
+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(-)
+
+diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions
+index 6850046..11223f7 100644
+--- a/rc.d/init.d/functions
++++ b/rc.d/init.d/functions
+@@ -597,5 +597,5 @@ if [ "$_use_systemctl" = "1" ]; then
+ fi
+ fi
+
+-strstr "$(cat /proc/cmdline)" "rc.debug" && set -x
++strstr "$(cat /proc/cmdline)" "rc.debug" && set -x || true
+
+--
+2.1.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbinitscripts/functions.patch b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbinitscripts/functions.patch
new file mode 100644
index 000000000..a756d047e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbinitscripts/functions.patch
@@ -0,0 +1,26 @@
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: initscripts-9.43/rc.d/init.d/functions
+===================================================================
+--- initscripts-9.43.orig/rc.d/init.d/functions
++++ initscripts-9.43/rc.d/init.d/functions
+@@ -13,6 +13,7 @@ umask 022
+ PATH="/sbin:/usr/sbin:/bin:/usr/bin"
+ export PATH
+
++
+ if [ $PPID -ne 1 -a -z "$SYSTEMCTL_SKIP_REDIRECT" ] && \
+ ( /bin/mountpoint -q /cgroup/systemd || /bin/mountpoint -q /sys/fs/cgroup/systemd ) ; then
+ case "$0" in
+@@ -54,7 +55,7 @@ systemctl_redirect () {
+ [ -z "${COLUMNS:-}" ] && COLUMNS=80
+
+ if [ -z "${CONSOLETYPE:-}" ]; then
+- if [ -c "/dev/stderr" -a -r "/dev/stderr" ]; then
++ if [ -c "/dev/stderr" -a -r "/dev/stderr" -a -e /sbin/consoletype ]; then
+ CONSOLETYPE="$(/sbin/consoletype < /dev/stderr 2>/dev/null)"
+ else
+ CONSOLETYPE="serial"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbinitscripts_9.64.bb b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbinitscripts_9.64.bb
new file mode 100644
index 000000000..727305015
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbinitscripts_9.64.bb
@@ -0,0 +1,33 @@
+SUMMARY = "SysV init scripts which are only used in an LSB image"
+SECTION = "base"
+LICENSE = "GPLv2"
+DEPENDS = "popt glib-2.0"
+
+RDEPENDS_${PN} += "util-linux"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=ebf4e8b49780ab187d51bd26aaa022c6"
+
+S="${WORKDIR}/initscripts-${PV}"
+SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/initscripts/initscripts-${PV}.tar.bz2/9cce2ae1009750e84be37c09a028757e/initscripts-${PV}.tar.bz2 \
+ file://functions.patch \
+ file://0001-functions-avoid-exit-1-which-causes-init-scripts-to-.patch \
+ "
+
+SRC_URI[md5sum] = "9cce2ae1009750e84be37c09a028757e"
+SRC_URI[sha256sum] = "48b59ce8157cfc58bbd4b1dfa58ad1087245761ae11c2033b66ae3864ea7e1cf"
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_${PN} = "functions"
+ALTERNATIVE_LINK_NAME[functions] = "${sysconfdir}/init.d/functions"
+
+# 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/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest/LSB_Test.sh b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest/LSB_Test.sh
new file mode 100644
index 000000000..b9971a17d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest/LSB_Test.sh
@@ -0,0 +1,526 @@
+#!/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/${LSB_RELEASE}/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.23"
+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/${LSB_RELEASE}/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"
+RPM_INSTALL_CMD_NOSCRIPTS="rpm --quiet --nodeps --replacepkgs --noscripts --nosignature -i"
+
+# 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/qt3
+/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/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest/packages_list b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest/packages_list
new file mode 100644
index 000000000..27d8352d9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest/packages_list
@@ -0,0 +1,50 @@
+LSB_RELEASE="released-4.1.0"
+LSB_ARCH="lsbarch"
+
+BASE_PACKAGES_LIST="lsb-setup-4.1.0-1.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-4.1.4-5.targetarch.rpm \
+ lsb-libchk-4.1.4-5.targetarch.rpm \
+ lsb-qm-2.2-12.lsb4.targetarch.rpm \
+ lsb-task-dist-testkit-4.1.9-1.noarch.rpm \
+ lsb-test-core-4.1.15-1.targetarch.rpm \
+ lsb-test-cpp-t2c-4.1.0-1.targetarch.rpm \
+ lsb-test-desktop-4.1.9-1.targetarch.rpm \
+ lsb-test-desktop-t2c-4.1.3-3.targetarch.rpm \
+ lsb-test-libstdcpp-4.1.0-18.lsb4.targetarch.rpm \
+ lsb-test-olver-core-4.1.4-1.targetarch.rpm \
+ lsb-test-perl-4.1.8-1.noarch.rpm \
+ lsb-test-printing-4.1.2-1.targetarch.rpm \
+ lsb-test-python-4.1.5-1.targetarch.rpm \
+ lsb-test-qt3-azov-4.1.1-3.targetarch.rpm \
+ lsb-test-qt4-azov-4.1.3-1.targetarch.rpm \
+ lsb-test-xts5-5.1.5-45.lsb4.targetarch.rpm \
+ lsb-test-alsa-t2c-4.1.0-1.targetarch.rpm \
+ lsb-test-core-t2c-4.1.2-3.targetarch.rpm \
+ lsb-test-xml2-azov-4.1.0-1.targetarch.rpm \
+ "
+
+APP_PACKAGES_LIST="lsb-python-2.4.6-7.lsb4.targetarch.rpm \
+ lsb-apache-2.2.14-8.lsb4.targetarch.rpm \
+ lsb-tcl-8.5.7-8.lsb4.targetarch.rpm \
+ lsb-expect-5.43.0-13.lsb4.targetarch.rpm \
+ lsb-groff-1.20.1-7.lsb4.targetarch.rpm \
+ lsb-raptor-1.4.19-5.lsb4.targetarch.rpm \
+ lsb-xpdf-1.01-14.lsb4.targetarch.rpm \
+ lsb-samba-3.4.3-9.lsb4.targetarch.rpm \
+ lsb-rsync-3.0.6-6.lsb4.targetarch.rpm \
+ "
+
+APP_TESTFILES_LIST="expect-tests.tar \
+ tcl-tests.tar \
+ raptor-tests.tar \
+ test1.pdf \
+ test2.pdf \
+ "
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest/session b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest/session
new file mode 100644
index 000000000..85ca2efe9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest/session
@@ -0,0 +1,194 @@
+[GENERAL]
+VERBOSE_LEVEL: 1
+ARCHITECTURE: targetarch
+USE_INTERNET: 1
+STD_VERSION: LSB 4.1
+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
+
+[qt3-azov]
+RUN: 1
+VERSION: local|*
+
+[qt3-azov|local|*]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/qt3-azov
+AUTOREPLY_X11_FONT_PATH: [default]
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/qt3-azov/results
+
+[qt4-azov]
+RUN: 1
+VERSION: local|*
+
+[qt4-azov|local|*]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/qt4-azov
+AUTOREPLY_X11_FONT_PATH: [default]
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/qt4-azov/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/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest_1.0.bb b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest_1.0.bb
new file mode 100644
index 000000000..ea12502dc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest_1.0.bb
@@ -0,0 +1,49 @@
+SUMMARY = "Automates Linux Standard Base (LSB) tests"
+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} = "rpm"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 ${S}/LSB_Test.sh ${D}${bindir}
+ install -d ${D}/opt/lsb-test
+ 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/import-layers/yocto-poky/meta/recipes-extended/lsof/lsof_4.89.bb b/import-layers/yocto-poky/meta/recipes-extended/lsof/lsof_4.89.bb
new file mode 100644
index 000000000..c10337beb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lsof/lsof_4.89.bb
@@ -0,0 +1,60 @@
+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."
+SECTION = "devel"
+LICENSE = "BSD"
+
+SRC_URI = "ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_${PV}.tar.bz2"
+
+SRC_URI[md5sum] = "1b9cd34f3fb86856a125abbf2be3a386"
+SRC_URI[sha256sum] = "81ac2fc5fdc944793baf41a14002b6deb5a29096b387744e28f8c30a360a3718"
+
+UPSTREAM_CHECK_URI = "http://www.mirrorservice.org/sites/lsof.itap.purdue.edu/pub/tools/unix/lsof"
+
+LOCALSRC = "file://${WORKDIR}/lsof_${PV}/lsof_${PV}_src.tar"
+S = "${WORKDIR}/lsof_${PV}_src"
+
+LIC_FILES_CHKSUM = "file://${S}/00README;beginline=645;endline=679;md5=964df275d26429ba3b39dbb9f205172a"
+
+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}"
+
+EXTRA_OEMAKE = ""
+
+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 4755 lsof ${D}${sbindir}/lsof
+ install -m 0644 lsof.8 ${D}${mandir}/man8/lsof.8
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0001-ltp-Don-t-link-against-libfl.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0001-ltp-Don-t-link-against-libfl.patch
new file mode 100644
index 000000000..585b7cbc6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0001-ltp-Don-t-link-against-libfl.patch
@@ -0,0 +1,30 @@
+From 14985fccf7428eaa0b45decc22bfd20fd780f621 Mon Sep 17 00:00:00 2001
+From: Chong Lu <Chong.Lu@windriver.com>
+Date: Tue, 11 Mar 2014 14:47:22 +0800
+Subject: [PATCH 01/32] ltp: Don't link against libfl
+
+We have already defined yywrap function in scan.l file. After this, we no longer need to
+link against libfl and so no longer get errors about undefined references to yylex.
+
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ pan/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/pan/Makefile b/pan/Makefile
+index 4cc6466..a4b575b 100644
+--- a/pan/Makefile
++++ b/pan/Makefile
+@@ -31,7 +31,7 @@ CPPFLAGS += -Wno-error
+
+ CPPFLAGS += -I$(abs_srcdir)
+
+-LDLIBS += -lm $(LEXLIB)
++LDLIBS += -lm
+
+ LFLAGS += -l
+
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0002-Add-knob-to-control-whether-numa-support-should-be-c.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0002-Add-knob-to-control-whether-numa-support-should-be-c.patch
new file mode 100644
index 000000000..68725dc7a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0002-Add-knob-to-control-whether-numa-support-should-be-c.patch
@@ -0,0 +1,43 @@
+From 867ad5d5d64b9b27ee32148027532db0a00f6433 Mon Sep 17 00:00:00 2001
+From: "Roy.Li" <rongqing.li@windriver.com>
+Date: Thu, 7 Jan 2016 17:33:26 +0000
+Subject: [PATCH 02/32] Add knob to control whether numa support should be
+ checked
+
+otherwise undeterministic dependency will be generated
+during build depending upong numa being staged or not
+
+signed-off-by: Roy.Li <rongqing.li@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ m4/ltp-numa.m4 | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/m4/ltp-numa.m4 b/m4/ltp-numa.m4
+index 60ae07b..ed7078d 100644
+--- a/m4/ltp-numa.m4
++++ b/m4/ltp-numa.m4
+@@ -24,7 +24,13 @@ dnl ----------------------------
+ dnl
+ AC_DEFUN([LTP_CHECK_SYSCALL_NUMA],
+ [dnl
+-AC_CHECK_HEADERS([linux/mempolicy.h numa.h numaif.h],[
++AC_MSG_CHECKING([for numa])
++AC_ARG_WITH(
++ [numa],
++ AC_HELP_STRING([--without-numa],
++ [without numa support]),
++ [],
++ [AC_CHECK_HEADERS([linux/mempolicy.h numa.h numaif.h],[
+ LTP_SYSCALL_NUMA_HEADERS=yes
+ AC_CHECK_LIB(numa,numa_alloc_onnode,[have_numa_alloc_onnode="yes"])
+ if test "x$have_numa_alloc_onnode" = "xyes"; then
+@@ -48,3 +54,5 @@ if test "x$have_mpol_constants" = "xyes"; then
+ AC_DEFINE(HAVE_MPOL_CONSTANTS,1,[define to 1 if you have all constants required to use mbind tests])
+ fi
+ )])
++AC_MSG_RESULT([$with_numa])
++])
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0003-Add-knob-to-control-tirpc-support.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0003-Add-knob-to-control-tirpc-support.patch
new file mode 100644
index 000000000..bf1176fc4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0003-Add-knob-to-control-tirpc-support.patch
@@ -0,0 +1,45 @@
+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>
+---
+ 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/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch
new file mode 100644
index 000000000..2de936304
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch
@@ -0,0 +1,147 @@
+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>
+---
+ 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(-)
+
+diff --git a/Makefile b/Makefile
+index 297f8e7..906b280 100644
+--- a/Makefile
++++ b/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
+diff --git a/testcases/kernel/Makefile b/testcases/kernel/Makefile
+index 50a12fa..4f1987f 100644
+--- a/testcases/kernel/Makefile
++++ b/testcases/kernel/Makefile
+@@ -47,13 +47,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
+diff --git a/testcases/kernel/sched/Makefile b/testcases/kernel/sched/Makefile
+index 6245ed0..aa4eb7f 100644
+--- a/testcases/kernel/sched/Makefile
++++ b/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
+diff --git a/testcases/kernel/syscalls/Makefile b/testcases/kernel/syscalls/Makefile
+index 8acb395..b749126 100644
+--- a/testcases/kernel/syscalls/Makefile
++++ b/testcases/kernel/syscalls/Makefile
+@@ -28,5 +28,10 @@ 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
+
+ include $(top_srcdir)/include/mk/generic_trunk_target.mk
+diff --git a/testcases/network/nfsv4/acl/Makefile b/testcases/network/nfsv4/acl/Makefile
+index 8bc78c2..c36cf50 100644
+--- a/testcases/network/nfsv4/acl/Makefile
++++ b/testcases/network/nfsv4/acl/Makefile
+@@ -26,4 +26,8 @@ include $(top_srcdir)/include/mk/env_pre.mk
+
+ LDLIBS += $(ACL_LIBS)
+
++ifeq ($(LIBC),musl)
++FILTER_OUT_MAKE_TARGETS := acl1
++endif
++
+ include $(top_srcdir)/include/mk/generic_leaf_target.mk
+diff --git a/testcases/network/rpc/basic_tests/Makefile b/testcases/network/rpc/basic_tests/Makefile
+index 3160813..9bdf5d0 100644
+--- a/testcases/network/rpc/basic_tests/Makefile
++++ b/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
+diff --git a/testcases/realtime/func/pi-tests/Makefile b/testcases/realtime/func/pi-tests/Makefile
+index 7a7a57a..5808866 100644
+--- a/testcases/realtime/func/pi-tests/Makefile
++++ b/testcases/realtime/func/pi-tests/Makefile
+@@ -27,5 +27,9 @@ include $(top_srcdir)/include/mk/env_pre.mk
+ 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
+diff --git a/testcases/realtime/stress/pi-tests/Makefile b/testcases/realtime/stress/pi-tests/Makefile
+index 5edc3b4..aa5987a 100644
+--- a/testcases/realtime/stress/pi-tests/Makefile
++++ b/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
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch
new file mode 100644
index 000000000..8dab1ed2e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch
@@ -0,0 +1,45 @@
+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>
+---
+ 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/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0006-sendfile-Use-off64_t-instead-of-__off64_t.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0006-sendfile-Use-off64_t-instead-of-__off64_t.patch
new file mode 100644
index 000000000..56a48abcc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0006-sendfile-Use-off64_t-instead-of-__off64_t.patch
@@ -0,0 +1,31 @@
+From fb8b895385a641d74f2186fe5f20a872209692ed Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 18:24:20 +0000
+Subject: [PATCH 06/32] sendfile: Use off64_t instead of __off64_t
+
+__off64_t is specific to glibc where as off64_t is widely available
+Add _GNU_SOURCE for off64_t defines from sys/types.h
+Fixes
+<command-line>:0:7: error: unknown type name 'off64_t'
+sendfile02.c:97:18: note: in expansion of macro 'OFF_T'
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/syscalls/sendfile/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/testcases/kernel/syscalls/sendfile/Makefile b/testcases/kernel/syscalls/sendfile/Makefile
+index df7b63f..1bd1b57 100644
+--- a/testcases/kernel/syscalls/sendfile/Makefile
++++ b/testcases/kernel/syscalls/sendfile/Makefile
+@@ -21,6 +21,6 @@ top_srcdir ?= ../../../..
+ include $(top_srcdir)/include/mk/testcases.mk
+ include $(abs_srcdir)/../utils/newer_64.mk
+
+-%_64: CPPFLAGS += -D_FILE_OFFSET_BITS=64 -DOFF_T=__off64_t
++%_64: CPPFLAGS += -D_FILE_OFFSET_BITS=64 -DOFF_T=off64_t -D_GNU_SOURCE
+
+ include $(top_srcdir)/include/mk/generic_leaf_target.mk
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0007-replace-SIGCLD-with-SIGCHLD.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0007-replace-SIGCLD-with-SIGCHLD.patch
new file mode 100644
index 000000000..4be906ec7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0007-replace-SIGCLD-with-SIGCHLD.patch
@@ -0,0 +1,394 @@
+From 405c03171e4bf0edd698cb602cf7bd7fe1d0401a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 19:33:53 +0000
+Subject: [PATCH 07/32] replace SIGCLD with SIGCHLD
+
+its defined to use SIGCHLD anyway in
+
+bits/signum.h:#define SIGCLD SIGCHLD /* Same as SIGCHLD
+(System V). */
+
+plus it helps these tests compile with musl which adheres to posix
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/tst_sig.c | 8 ++++----
+ testcases/kernel/connectors/pec/pec_listener.c | 1 +
+ testcases/kernel/fs/doio/doio.c | 4 ++--
+ testcases/kernel/fs/doio/growfiles.c | 2 +-
+ testcases/kernel/syscalls/fcntl/fcntl11.c | 8 ++++----
+ testcases/kernel/syscalls/fcntl/fcntl17.c | 8 ++++----
+ testcases/kernel/syscalls/fcntl/fcntl19.c | 8 ++++----
+ testcases/kernel/syscalls/fcntl/fcntl20.c | 8 ++++----
+ testcases/kernel/syscalls/fcntl/fcntl21.c | 8 ++++----
+ testcases/kernel/syscalls/kill/kill02.c | 6 +++---
+ testcases/kernel/syscalls/kill/kill12.c | 8 ++++----
+ testcases/kernel/syscalls/mkdir/mkdir09.c | 12 ++++++------
+ testcases/kernel/syscalls/sighold/sighold02.c | 2 +-
+ testcases/network/tcp_cmds/perf_lan/pingpong.c | 2 +-
+ testcases/network/tcp_cmds/perf_lan/pingpong6.c | 2 +-
+ 15 files changed, 44 insertions(+), 43 deletions(-)
+
+diff --git a/lib/tst_sig.c b/lib/tst_sig.c
+index 3af5ffd..36565e1 100644
+--- a/lib/tst_sig.c
++++ b/lib/tst_sig.c
+@@ -49,7 +49,7 @@
+ fork_flag - set to FORK or NOFORK depending upon whether the
+ calling program executes a fork() system call. It
+ is normally the case that the calling program treats
+- SIGCLD as an expected signal if fork() is being used.
++ SIGCHLD as an expected signal if fork() is being used.
+
+ handler - a pointer to the unexpected signal handler to
+ be executed after an unexpected signal has been
+@@ -82,7 +82,7 @@ static void (*tst_setup_signal(int, void (*)(int))) (int);
+
+ /****************************************************************************
+ * tst_sig() : set-up to catch unexpected signals. fork_flag is set to NOFORK
+- * if SIGCLD is to be an "unexpected signal", otherwise it is set to
++ * if SIGCHLD is to be an "unexpected signal", otherwise it is set to
+ * FORK. cleanup points to a cleanup routine to be executed before
+ * tst_exit is called (cleanup is set to NULL if no cleanup is desired).
+ * handler is a pointer to the signal handling routine (if handler is
+@@ -117,7 +117,7 @@ void tst_sig(int fork_flag, void (*handler) (), void (*cleanup) ())
+ for (sig = 1; sig < NSIG; sig++) {
+ /*
+ * SIGKILL is never unexpected.
+- * SIGCLD is only unexpected when
++ * SIGCHLD is only unexpected when
+ * no forking is being done.
+ * SIGINFO is used for file quotas and should be expected
+ */
+@@ -205,7 +205,7 @@ void tst_sig(int fork_flag, void (*handler) (), void (*cleanup) ())
+ #endif
+ break;
+
+- case SIGCLD:
++ case SIGCHLD:
+ if (fork_flag == FORK)
+ continue;
+
+diff --git a/testcases/kernel/connectors/pec/pec_listener.c b/testcases/kernel/connectors/pec/pec_listener.c
+index a1beb13..002750a 100644
+--- a/testcases/kernel/connectors/pec/pec_listener.c
++++ b/testcases/kernel/connectors/pec/pec_listener.c
+@@ -20,6 +20,7 @@
+ /* */
+ /******************************************************************************/
+
++#define _GNU_SOURCE
+ #include <sys/socket.h>
+ #include <sys/poll.h>
+ #include <sys/types.h>
+diff --git a/testcases/kernel/fs/doio/doio.c b/testcases/kernel/fs/doio/doio.c
+index 4b0dec5..5f65ef9 100644
+--- a/testcases/kernel/fs/doio/doio.c
++++ b/testcases/kernel/fs/doio/doio.c
+@@ -573,7 +573,7 @@ int main(int argc, char **argv)
+ case SIGTSTP:
+ case SIGSTOP:
+ case SIGCONT:
+- case SIGCLD:
++ case SIGCHLD:
+ case SIGBUS:
+ case SIGSEGV:
+ case SIGQUIT:
+@@ -615,7 +615,7 @@ int main(int argc, char **argv)
+ }
+
+ sigemptyset(&block_mask);
+- sigaddset(&block_mask, SIGCLD);
++ sigaddset(&block_mask, SIGCHLD);
+ sigprocmask(SIG_BLOCK, &block_mask, &omask);
+
+ /*
+diff --git a/testcases/kernel/fs/doio/growfiles.c b/testcases/kernel/fs/doio/growfiles.c
+index 09e7f35..bbad230 100644
+--- a/testcases/kernel/fs/doio/growfiles.c
++++ b/testcases/kernel/fs/doio/growfiles.c
+@@ -1640,7 +1640,7 @@ int set_sig(void)
+ #ifdef SIGRESTART
+ case SIGRESTART:
+ #endif /* SIGRESTART */
+- case SIGCLD:
++ case SIGCHLD:
+ break;
+
+ default:
+diff --git a/testcases/kernel/syscalls/fcntl/fcntl11.c b/testcases/kernel/syscalls/fcntl/fcntl11.c
+index fa6ce53..2de2b6c 100644
+--- a/testcases/kernel/syscalls/fcntl/fcntl11.c
++++ b/testcases/kernel/syscalls/fcntl/fcntl11.c
+@@ -105,10 +105,10 @@ void setup(void)
+ memset(&act, 0, sizeof(act));
+ act.sa_handler = catch_child;
+ sigemptyset(&act.sa_mask);
+- sigaddset(&act.sa_mask, SIGCLD);
+- if ((sigaction(SIGCLD, &act, NULL)) < 0)
++ sigaddset(&act.sa_mask, SIGCHLD);
++ if ((sigaction(SIGCHLD, &act, NULL)) < 0)
+ tst_brkm(TBROK | TERRNO, cleanup,
+- "sigaction(SIGCLD, ..) failed");
++ "sigaction(SIGCHLD, ..) failed");
+ }
+
+ void do_child(void)
+@@ -227,7 +227,7 @@ void stop_child(void)
+ {
+ struct flock fl;
+
+- signal(SIGCLD, SIG_DFL);
++ signal(SIGCHLD, SIG_DFL);
+ fl.l_type = STOP;
+ parent_put(&fl);
+ wait(0);
+diff --git a/testcases/kernel/syscalls/fcntl/fcntl17.c b/testcases/kernel/syscalls/fcntl/fcntl17.c
+index 5b03e39..6598b20 100644
+--- a/testcases/kernel/syscalls/fcntl/fcntl17.c
++++ b/testcases/kernel/syscalls/fcntl/fcntl17.c
+@@ -150,9 +150,9 @@ int setup(void)
+ memset(&act, 0, sizeof(act));
+ act.sa_handler = catch_child;
+ sigemptyset(&act.sa_mask);
+- sigaddset(&act.sa_mask, SIGCLD);
+- if (sigaction(SIGCLD, &act, NULL) < 0) {
+- tst_resm(TFAIL, "SIGCLD signal setup failed, errno: %d", errno);
++ sigaddset(&act.sa_mask, SIGCHLD);
++ if (sigaction(SIGCHLD, &act, NULL) < 0) {
++ tst_resm(TFAIL, "SIGCHLD signal setup failed, errno: %d", errno);
+ return 1;
+ }
+ return 0;
+@@ -381,7 +381,7 @@ void stop_children(void)
+ {
+ int arg;
+
+- signal(SIGCLD, SIG_DFL);
++ signal(SIGCHLD, SIG_DFL);
+ arg = STOP;
+ child_free(child_pipe1[1], arg);
+ child_free(child_pipe2[1], arg);
+diff --git a/testcases/kernel/syscalls/fcntl/fcntl19.c b/testcases/kernel/syscalls/fcntl/fcntl19.c
+index a542cfc..88c91d6 100644
+--- a/testcases/kernel/syscalls/fcntl/fcntl19.c
++++ b/testcases/kernel/syscalls/fcntl/fcntl19.c
+@@ -112,9 +112,9 @@ void setup(void)
+ memset(&act, 0, sizeof(act));
+ act.sa_handler = catch_child;
+ sigemptyset(&act.sa_mask);
+- sigaddset(&act.sa_mask, SIGCLD);
+- if ((sigaction(SIGCLD, &act, NULL)) < 0) {
+- tst_resm(TFAIL, "SIGCLD signal setup failed, errno: %d", errno);
++ sigaddset(&act.sa_mask, SIGCHLD);
++ if ((sigaction(SIGCHLD, &act, NULL)) < 0) {
++ tst_resm(TFAIL, "SIGCHLD signal setup failed, errno: %d", errno);
+ fail = 1;
+ }
+ }
+@@ -265,7 +265,7 @@ void stop_child(void)
+ {
+ struct flock fl;
+
+- signal(SIGCLD, SIG_DFL);
++ signal(SIGCHLD, SIG_DFL);
+ fl.l_type = STOP;
+ parent_put(&fl);
+ wait(0);
+diff --git a/testcases/kernel/syscalls/fcntl/fcntl20.c b/testcases/kernel/syscalls/fcntl/fcntl20.c
+index aa06bab..99fd783 100644
+--- a/testcases/kernel/syscalls/fcntl/fcntl20.c
++++ b/testcases/kernel/syscalls/fcntl/fcntl20.c
+@@ -109,9 +109,9 @@ void setup(void)
+ memset(&act, 0, sizeof(act));
+ act.sa_handler = catch_child;
+ sigemptyset(&act.sa_mask);
+- sigaddset(&act.sa_mask, SIGCLD);
+- if (sigaction(SIGCLD, &act, NULL) == -1)
+- tst_brkm(TFAIL | TERRNO, cleanup, "SIGCLD signal setup failed");
++ sigaddset(&act.sa_mask, SIGCHLD);
++ if (sigaction(SIGCHLD, &act, NULL) == -1)
++ tst_brkm(TFAIL | TERRNO, cleanup, "SIGCHLD signal setup failed");
+ }
+
+ void cleanup(void)
+@@ -264,7 +264,7 @@ void stop_child(void)
+ {
+ struct flock fl;
+
+- signal(SIGCLD, SIG_DFL);
++ signal(SIGCHLD, SIG_DFL);
+ fl.l_type = STOP;
+ parent_put(&fl);
+ wait(0);
+diff --git a/testcases/kernel/syscalls/fcntl/fcntl21.c b/testcases/kernel/syscalls/fcntl/fcntl21.c
+index 5307021..8f1a67c 100644
+--- a/testcases/kernel/syscalls/fcntl/fcntl21.c
++++ b/testcases/kernel/syscalls/fcntl/fcntl21.c
+@@ -110,9 +110,9 @@ void setup(void)
+ memset(&act, 0, sizeof(act));
+ act.sa_handler = catch_child;
+ sigemptyset(&act.sa_mask);
+- sigaddset(&act.sa_mask, SIGCLD);
+- if ((sigaction(SIGCLD, &act, NULL)) < 0) {
+- tst_resm(TFAIL, "SIGCLD signal setup failed, errno: %d", errno);
++ sigaddset(&act.sa_mask, SIGCHLD);
++ if ((sigaction(SIGCHLD, &act, NULL)) < 0) {
++ tst_resm(TFAIL, "SIGCHLD signal setup failed, errno: %d", errno);
+ fail = 1;
+ }
+ }
+@@ -272,7 +272,7 @@ void stop_child(void)
+ {
+ struct flock fl;
+
+- signal(SIGCLD, SIG_DFL);
++ signal(SIGCHLD, SIG_DFL);
+ fl.l_type = STOP;
+ parent_put(&fl);
+ wait(0);
+diff --git a/testcases/kernel/syscalls/kill/kill02.c b/testcases/kernel/syscalls/kill/kill02.c
+index 9d6cc68..08360dd 100644
+--- a/testcases/kernel/syscalls/kill/kill02.c
++++ b/testcases/kernel/syscalls/kill/kill02.c
+@@ -701,7 +701,7 @@ void setup(void)
+
+ /*
+ * Set to catch unexpected signals.
+- * SIGCLD is set to be ignored because we do not wait for termination status.
++ * SIGCHLD is set to be ignored because we do not wait for termination status.
+ * SIGUSR1 is set to be ignored because this is the signal we are using for
+ * the test and we are not concerned with the parent getting it.
+ */
+@@ -713,9 +713,9 @@ void setup(void)
+ "signal(SIGUSR1, SIG_IGN) failed");
+ }
+
+- if (signal(SIGCLD, SIG_IGN) == SIG_ERR) {
++ if (signal(SIGCHLD, SIG_IGN) == SIG_ERR) {
+ tst_brkm(TBROK | TERRNO, NULL,
+- "signal(SIGCLD, SIG_IGN) failed");
++ "signal(SIGCHLD, SIG_IGN) failed");
+ }
+
+ TEST_PAUSE;
+diff --git a/testcases/kernel/syscalls/kill/kill12.c b/testcases/kernel/syscalls/kill/kill12.c
+index 7a47a4a..d7c4147 100644
+--- a/testcases/kernel/syscalls/kill/kill12.c
++++ b/testcases/kernel/syscalls/kill/kill12.c
+@@ -98,7 +98,7 @@ int main(int argc, char **argv)
+
+ exno = 1;
+
+- if (sigset(SIGCLD, chsig) == SIG_ERR) {
++ if (sigset(SIGCHLD, chsig) == SIG_ERR) {
+ fprintf(temp, "\tsigset failed, errno = %d\n", errno);
+ fail_exit();
+ }
+@@ -128,7 +128,7 @@ int main(int argc, char **argv)
+ sleep(1);
+
+ kill(pid, sig); /* child should ignroe this sig */
+- kill(pid, SIGCLD); /* child should exit */
++ kill(pid, SIGCHLD); /* child should exit */
+
+ #ifdef BCS
+ while ((npid = wait(&status)) != pid
+@@ -222,14 +222,14 @@ void do_child(void)
+ int exno = 1;
+
+ #ifdef UCLINUX
+- if (sigset(SIGCLD, chsig) == SIG_ERR) {
++ if (sigset(SIGCHLD, chsig) == SIG_ERR) {
+ fprintf(temp, "\tsigset failed, errno = %d\n", errno);
+ fail_exit();
+ }
+ #endif
+
+ sigset(sig, SIG_IGN); /* set to ignore signal */
+- kill(getppid(), SIGCLD); /* tell parent we are ready */
++ kill(getppid(), SIGCHLD); /* tell parent we are ready */
+ while (!chflag)
+ sleep(1); /* wait for parent */
+
+diff --git a/testcases/kernel/syscalls/mkdir/mkdir09.c b/testcases/kernel/syscalls/mkdir/mkdir09.c
+index 41c20e9..07b4fb8 100644
+--- a/testcases/kernel/syscalls/mkdir/mkdir09.c
++++ b/testcases/kernel/syscalls/mkdir/mkdir09.c
+@@ -122,10 +122,10 @@ int main(int argc, char *argv[])
+
+ }
+
+- /* Set up to catch SIGCLD signal */
+- if (signal(SIGCLD, chld) == SIG_ERR) {
++ /* Set up to catch SIGCHLD signal */
++ if (signal(SIGCHLD, chld) == SIG_ERR) {
+ tst_brkm(TFAIL, cleanup,
+- "Error setting up SIGCLD signal, ERRNO = %d", errno);
++ "Error setting up SIGCHLD signal, ERRNO = %d", errno);
+
+ }
+
+@@ -236,9 +236,9 @@ int runtest(void)
+ tst_brkm(TFAIL, cleanup,
+ "Error resetting SIGTERM signal, ERRNO = %d", errno);
+ }
+- if (signal(SIGCLD, SIG_DFL) == SIG_ERR) {
++ if (signal(SIGCHLD, SIG_DFL) == SIG_ERR) {
+ tst_brkm(TFAIL, cleanup,
+- "Error resetting SIGCLD signal, ERRNO = %d", errno);
++ "Error resetting SIGCHLD signal, ERRNO = %d", errno);
+ }
+
+ if (test_time) {
+@@ -372,7 +372,7 @@ void term(int sig)
+
+ void chld(int sig)
+ {
+- /* Routine to handle SIGCLD signal. */
++ /* Routine to handle SIGCHLD signal. */
+
+ sigchld++;
+ if (jump) {
+diff --git a/testcases/kernel/syscalls/sighold/sighold02.c b/testcases/kernel/syscalls/sighold/sighold02.c
+index e3076fb..be01874 100644
+--- a/testcases/kernel/syscalls/sighold/sighold02.c
++++ b/testcases/kernel/syscalls/sighold/sighold02.c
+@@ -77,7 +77,7 @@ static int sigs_map[NUMSIGS];
+ static int skip_sig(int sig)
+ {
+ switch (sig) {
+- case SIGCLD:
++ case SIGCHLD:
+ case SIGKILL:
+ case SIGALRM:
+ case SIGSTOP:
+diff --git a/testcases/network/tcp_cmds/perf_lan/pingpong.c b/testcases/network/tcp_cmds/perf_lan/pingpong.c
+index 1196312..5b06798 100644
+--- a/testcases/network/tcp_cmds/perf_lan/pingpong.c
++++ b/testcases/network/tcp_cmds/perf_lan/pingpong.c
+@@ -182,7 +182,7 @@ int main(int argc, char *argv[])
+
+ /* Setup traps */
+ signal(SIGINT, finish);
+- signal(SIGCLD, finish);
++ signal(SIGCHLD, finish);
+
+ /* Fork a child process to continue sending packets */
+ tst_resm(TINFO, "Create a child process to continue to send packets");
+diff --git a/testcases/network/tcp_cmds/perf_lan/pingpong6.c b/testcases/network/tcp_cmds/perf_lan/pingpong6.c
+index 9747f58..0a0fb1d 100644
+--- a/testcases/network/tcp_cmds/perf_lan/pingpong6.c
++++ b/testcases/network/tcp_cmds/perf_lan/pingpong6.c
+@@ -153,7 +153,7 @@ char *argv[];
+
+ /* Setup traps */
+ signal(SIGINT, finish);
+- signal(SIGCLD, finish);
++ signal(SIGCHLD, finish);
+
+ /* Fork a child process to continue sending packets */
+ printf("Create a child process to continue to send packets \n");
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch
new file mode 100644
index 000000000..d12307420
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch
@@ -0,0 +1,285 @@
+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>
+
+---
+ 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,9 +172,14 @@ 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)
++#if defined(__GLIBC__)
++#if __GLIBC_PREREQ(2,6)
++ *cpu_id = sched_getcpu();
++#endif
++#else
+ *cpu_id = sched_getcpu();
+ #endif
++#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/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0009-Guard-error.h-with-__GLIBC__.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0009-Guard-error.h-with-__GLIBC__.patch
new file mode 100644
index 000000000..e58e5a96b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0009-Guard-error.h-with-__GLIBC__.patch
@@ -0,0 +1,270 @@
+From 4ba19d64e95a874995d0b554b891b5ec35bd9495 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 19:45:35 +0000
+Subject: [PATCH 09/32] Guard error.h with __GLIBC__
+
+error API is specific to glibc so use the guard to make it conditional
+on glibc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/syscalls/faccessat/faccessat01.c | 2 ++
+ testcases/kernel/syscalls/fallocate/fallocate01.c | 2 ++
+ testcases/kernel/syscalls/fchmodat/fchmodat01.c | 2 ++
+ testcases/kernel/syscalls/fchownat/fchownat01.c | 2 ++
+ testcases/kernel/syscalls/fchownat/fchownat02.c | 2 ++
+ testcases/kernel/syscalls/fstatat/fstatat01.c | 2 ++
+ testcases/kernel/syscalls/futimesat/futimesat01.c | 2 ++
+ testcases/kernel/syscalls/linkat/linkat01.c | 2 ++
+ testcases/kernel/syscalls/linkat/linkat02.c | 2 ++
+ testcases/kernel/syscalls/mkdirat/mkdirat01.c | 2 ++
+ testcases/kernel/syscalls/mknodat/mknodat01.c | 2 ++
+ testcases/kernel/syscalls/mknodat/mknodat02.c | 2 ++
+ testcases/kernel/syscalls/openat/openat01.c | 2 ++
+ testcases/kernel/syscalls/readlinkat/readlinkat01.c | 2 ++
+ testcases/kernel/syscalls/renameat/renameat01.c | 2 ++
+ testcases/kernel/syscalls/symlinkat/symlinkat01.c | 2 ++
+ testcases/kernel/syscalls/unlinkat/unlinkat01.c | 2 ++
+ 17 files changed, 34 insertions(+)
+
+diff --git a/testcases/kernel/syscalls/faccessat/faccessat01.c b/testcases/kernel/syscalls/faccessat/faccessat01.c
+index 7f0e87a..c72dcf0 100644
+--- a/testcases/kernel/syscalls/faccessat/faccessat01.c
++++ b/testcases/kernel/syscalls/faccessat/faccessat01.c
+@@ -37,7 +37,9 @@
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <unistd.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/testcases/kernel/syscalls/fallocate/fallocate01.c b/testcases/kernel/syscalls/fallocate/fallocate01.c
+index e72b123..643c0e2 100644
+--- a/testcases/kernel/syscalls/fallocate/fallocate01.c
++++ b/testcases/kernel/syscalls/fallocate/fallocate01.c
+@@ -96,7 +96,9 @@
+ #include <fcntl.h>
+ #include <sys/syscall.h>
+ #include <unistd.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <inttypes.h>
+ #include <sys/utsname.h>
+
+diff --git a/testcases/kernel/syscalls/fchmodat/fchmodat01.c b/testcases/kernel/syscalls/fchmodat/fchmodat01.c
+index 19e9ad5..ae6d807 100644
+--- a/testcases/kernel/syscalls/fchmodat/fchmodat01.c
++++ b/testcases/kernel/syscalls/fchmodat/fchmodat01.c
+@@ -37,7 +37,9 @@
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <unistd.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/testcases/kernel/syscalls/fchownat/fchownat01.c b/testcases/kernel/syscalls/fchownat/fchownat01.c
+index b361253..a5218af 100644
+--- a/testcases/kernel/syscalls/fchownat/fchownat01.c
++++ b/testcases/kernel/syscalls/fchownat/fchownat01.c
+@@ -28,7 +28,9 @@
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <unistd.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/testcases/kernel/syscalls/fchownat/fchownat02.c b/testcases/kernel/syscalls/fchownat/fchownat02.c
+index 6b0304c..8d2863f 100644
+--- a/testcases/kernel/syscalls/fchownat/fchownat02.c
++++ b/testcases/kernel/syscalls/fchownat/fchownat02.c
+@@ -26,7 +26,9 @@
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <unistd.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/testcases/kernel/syscalls/fstatat/fstatat01.c b/testcases/kernel/syscalls/fstatat/fstatat01.c
+index 61531c6..e99fbd2 100644
+--- a/testcases/kernel/syscalls/fstatat/fstatat01.c
++++ b/testcases/kernel/syscalls/fstatat/fstatat01.c
+@@ -48,7 +48,9 @@
+ #include <sys/stat.h>
+ #include <sys/time.h>
+ #include <fcntl.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/testcases/kernel/syscalls/futimesat/futimesat01.c b/testcases/kernel/syscalls/futimesat/futimesat01.c
+index ae8d4fe..316dd78 100644
+--- a/testcases/kernel/syscalls/futimesat/futimesat01.c
++++ b/testcases/kernel/syscalls/futimesat/futimesat01.c
+@@ -37,7 +37,9 @@
+ #include <sys/stat.h>
+ #include <sys/time.h>
+ #include <fcntl.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/testcases/kernel/syscalls/linkat/linkat01.c b/testcases/kernel/syscalls/linkat/linkat01.c
+index fc0687b..83cbfe7 100644
+--- a/testcases/kernel/syscalls/linkat/linkat01.c
++++ b/testcases/kernel/syscalls/linkat/linkat01.c
+@@ -49,7 +49,9 @@
+ #include <sys/time.h>
+ #include <fcntl.h>
+ #include <unistd.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/testcases/kernel/syscalls/linkat/linkat02.c b/testcases/kernel/syscalls/linkat/linkat02.c
+index e9a752a..8d7e431 100644
+--- a/testcases/kernel/syscalls/linkat/linkat02.c
++++ b/testcases/kernel/syscalls/linkat/linkat02.c
+@@ -23,7 +23,9 @@
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <unistd.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/testcases/kernel/syscalls/mkdirat/mkdirat01.c b/testcases/kernel/syscalls/mkdirat/mkdirat01.c
+index 7e15947..1dbc038 100644
+--- a/testcases/kernel/syscalls/mkdirat/mkdirat01.c
++++ b/testcases/kernel/syscalls/mkdirat/mkdirat01.c
+@@ -30,7 +30,9 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/testcases/kernel/syscalls/mknodat/mknodat01.c b/testcases/kernel/syscalls/mknodat/mknodat01.c
+index 26e5538..f034f05 100644
+--- a/testcases/kernel/syscalls/mknodat/mknodat01.c
++++ b/testcases/kernel/syscalls/mknodat/mknodat01.c
+@@ -29,7 +29,9 @@
+ #include <sys/types.h>
+ #include <fcntl.h>
+ #include <sys/stat.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/testcases/kernel/syscalls/mknodat/mknodat02.c b/testcases/kernel/syscalls/mknodat/mknodat02.c
+index f6368fa..7d0f7c0 100644
+--- a/testcases/kernel/syscalls/mknodat/mknodat02.c
++++ b/testcases/kernel/syscalls/mknodat/mknodat02.c
+@@ -29,7 +29,9 @@
+ #include <sys/types.h>
+ #include <fcntl.h>
+ #include <sys/stat.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/testcases/kernel/syscalls/openat/openat01.c b/testcases/kernel/syscalls/openat/openat01.c
+index 85f9a91..4ee0117 100644
+--- a/testcases/kernel/syscalls/openat/openat01.c
++++ b/testcases/kernel/syscalls/openat/openat01.c
+@@ -29,7 +29,9 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/testcases/kernel/syscalls/readlinkat/readlinkat01.c b/testcases/kernel/syscalls/readlinkat/readlinkat01.c
+index 97a49e8..b162853 100644
+--- a/testcases/kernel/syscalls/readlinkat/readlinkat01.c
++++ b/testcases/kernel/syscalls/readlinkat/readlinkat01.c
+@@ -29,7 +29,9 @@
+ #include <sys/stat.h>
+ #include <sys/time.h>
+ #include <fcntl.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/testcases/kernel/syscalls/renameat/renameat01.c b/testcases/kernel/syscalls/renameat/renameat01.c
+index f4cd51b..105a05b 100644
+--- a/testcases/kernel/syscalls/renameat/renameat01.c
++++ b/testcases/kernel/syscalls/renameat/renameat01.c
+@@ -42,7 +42,9 @@
+ #include <sys/stat.h>
+ #include <sys/time.h>
+ #include <fcntl.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/testcases/kernel/syscalls/symlinkat/symlinkat01.c b/testcases/kernel/syscalls/symlinkat/symlinkat01.c
+index 5c238d8..cb7a7e8 100644
+--- a/testcases/kernel/syscalls/symlinkat/symlinkat01.c
++++ b/testcases/kernel/syscalls/symlinkat/symlinkat01.c
+@@ -37,7 +37,9 @@
+ #include <sys/stat.h>
+ #include <sys/time.h>
+ #include <fcntl.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/testcases/kernel/syscalls/unlinkat/unlinkat01.c b/testcases/kernel/syscalls/unlinkat/unlinkat01.c
+index 31fe4e7..26f6d9a 100644
+--- a/testcases/kernel/syscalls/unlinkat/unlinkat01.c
++++ b/testcases/kernel/syscalls/unlinkat/unlinkat01.c
+@@ -37,7 +37,9 @@
+ #include <sys/stat.h>
+ #include <sys/time.h>
+ #include <fcntl.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch
new file mode 100644
index 000000000..5b0c444be
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch
@@ -0,0 +1,73 @@
+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>
+---
+ 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/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0011-Rename-sigset-variable-to-sigset1.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0011-Rename-sigset-variable-to-sigset1.patch
new file mode 100644
index 000000000..945280c62
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0011-Rename-sigset-variable-to-sigset1.patch
@@ -0,0 +1,136 @@
+From aff0e2a8f011fa80b472355355a7e8cdacd50189 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 19:53:30 +0000
+Subject: [PATCH 11/32] Rename sigset variable to sigset1
+
+sigset API from signal.h is shadowed by this name conflict
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/mem/shmt/shmt04.c | 10 +++++-----
+ testcases/kernel/mem/shmt/shmt06.c | 10 +++++-----
+ testcases/kernel/syscalls/sigprocmask/sigprocmask01.c | 10 +++++-----
+ 3 files changed, 15 insertions(+), 15 deletions(-)
+
+diff --git a/testcases/kernel/mem/shmt/shmt04.c b/testcases/kernel/mem/shmt/shmt04.c
+index 7203e9e..fce87d6 100644
+--- a/testcases/kernel/mem/shmt/shmt04.c
++++ b/testcases/kernel/mem/shmt/shmt04.c
+@@ -56,7 +56,7 @@ int TST_TOTAL = 2; /* Total number of test cases. */
+ /**************/
+
+ key_t key;
+-sigset_t sigset;
++sigset_t sigset1;
+
+ #define SIZE 16*1024
+
+@@ -71,9 +71,9 @@ int main(void)
+
+ key = (key_t) getpid();
+
+- sigemptyset(&sigset);
+- sigaddset(&sigset, SIGUSR1);
+- sigprocmask(SIG_BLOCK, &sigset, NULL);
++ sigemptyset(&sigset1);
++ sigaddset(&sigset1, SIGUSR1);
++ sigprocmask(SIG_BLOCK, &sigset1, NULL);
+
+ pid = fork();
+ switch (pid) {
+@@ -148,7 +148,7 @@ int child(void)
+ char *cp;
+ int sig;
+
+- sigwait(&sigset, &sig);
++ sigwait(&sigset1, &sig);
+ chld_pid = getpid();
+ /*--------------------------------------------------------*/
+
+diff --git a/testcases/kernel/mem/shmt/shmt06.c b/testcases/kernel/mem/shmt/shmt06.c
+index a3c9ca3..77b0fc9 100644
+--- a/testcases/kernel/mem/shmt/shmt06.c
++++ b/testcases/kernel/mem/shmt/shmt06.c
+@@ -57,7 +57,7 @@ int TST_TOTAL = 2; /* Total number of test cases. */
+ /**************/
+
+ key_t key;
+-sigset_t sigset;
++sigset_t sigset1;
+
+ int child();
+ static int rm_shm(int);
+@@ -70,9 +70,9 @@ int main(void)
+
+ key = (key_t) getpid();
+
+- sigemptyset(&sigset);
+- sigaddset(&sigset, SIGUSR1);
+- sigprocmask(SIG_BLOCK, &sigset, NULL);
++ sigemptyset(&sigset1);
++ sigaddset(&sigset1, SIGUSR1);
++ sigprocmask(SIG_BLOCK, &sigset1, NULL);
+
+ pid = fork();
+ switch (pid) {
+@@ -147,7 +147,7 @@ int child(void)
+ char *cp;
+ int sig;
+
+- sigwait(&sigset, &sig);
++ sigwait(&sigset1, &sig);
+ chld_pid = getpid();
+
+ if ((shmid = shmget(key, SIZE, 0)) < 0) {
+diff --git a/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c b/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c
+index 20fca52..6fb1d57 100644
+--- a/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c
++++ b/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c
+@@ -91,7 +91,7 @@ int TST_TOTAL = 1;
+ int sig_catch = 0; /* variable to blocked/unblocked signals */
+
+ struct sigaction sa_new; /* struct to hold signal info */
+-sigset_t sigset; /* signal set to hold signal lists */
++sigset_t sigset1; /* signal set to hold signal lists */
+ sigset_t sigset2;
+
+ int main(int ac, char **av)
+@@ -112,7 +112,7 @@ int main(int ac, char **av)
+ * so that, signal will not be delivered to
+ * the test process.
+ */
+- TEST(sigprocmask(SIG_BLOCK, &sigset, 0));
++ TEST(sigprocmask(SIG_BLOCK, &sigset1, 0));
+
+ /* Get the process id of test process */
+ my_pid = getpid();
+@@ -165,7 +165,7 @@ int main(int ac, char **av)
+ */
+ errno = 0;
+ if (sigprocmask(SIG_UNBLOCK,
+- &sigset, 0) == -1) {
++ &sigset1, 0) == -1) {
+ tst_brkm(TFAIL, cleanup,
+ "sigprocmask() failed "
+ "to unblock signal, "
+@@ -212,7 +212,7 @@ void setup(void)
+ * Initialise the signal sets with the list that
+ * excludes/includes all system-defined signals.
+ */
+- if (sigemptyset(&sigset) == -1) {
++ if (sigemptyset(&sigset1) == -1) {
+ tst_brkm(TFAIL, cleanup,
+ "sigemptyset() failed, errno=%d : %s",
+ errno, strerror(errno));
+@@ -235,7 +235,7 @@ void setup(void)
+ * Add specified signal (SIGINT) to the signal set
+ * which excludes system-defined signals.
+ */
+- if (sigaddset(&sigset, SIGINT) == -1) {
++ if (sigaddset(&sigset1, SIGINT) == -1) {
+ tst_brkm(TFAIL, cleanup,
+ "sigaddset() failed, errno=%d : %s",
+ errno, strerror(errno));
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0012-fsstress.c-Replace-__int64_t-with-int64_t.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0012-fsstress.c-Replace-__int64_t-with-int64_t.patch
new file mode 100644
index 000000000..e1532c1fc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0012-fsstress.c-Replace-__int64_t-with-int64_t.patch
@@ -0,0 +1,351 @@
+From 54e098a366a1d773c4d7d4124f2f5aab976681c3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 19:58:08 +0000
+Subject: [PATCH 12/32] fsstress.c: Replace __int64_t with int64_t
+
+int64_t is defined in ISO C99
+include limits.h to get defintions of PATH_MAX
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/fs/fsstress/fsstress.c | 31 +++++++++---------
+ testcases/network/nfs/nfs_fsstress/fsstress.c | 47 ++++++++++++++-------------
+ 2 files changed, 40 insertions(+), 38 deletions(-)
+
+diff --git a/testcases/kernel/fs/fsstress/fsstress.c b/testcases/kernel/fs/fsstress/fsstress.c
+index 2f89903..89f0b19 100644
+--- a/testcases/kernel/fs/fsstress/fsstress.c
++++ b/testcases/kernel/fs/fsstress/fsstress.c
+@@ -36,6 +36,7 @@
+ #ifdef HAVE_SYS_PRCTL_H
+ # include <sys/prctl.h>
+ #endif
++#include <limits.h>
+
+ #define XFS_ERRTAG_MAX 17
+
+@@ -1572,7 +1573,7 @@ void bulkstat_f(int opno, long r)
+ __u64 last;
+ __s32 nent;
+ xfs_bstat_t *t;
+- __int64_t total;
++ int64_t total;
+ xfs_fsop_bulkreq_t bsr;
+
+ last = 0;
+@@ -1764,14 +1765,14 @@ int setdirect(int fd)
+
+ void dread_f(int opno, long r)
+ {
+- __int64_t align;
++ int64_t align;
+ char *buf = NULL;
+ struct dioattr diob;
+ int e;
+ pathname_t f;
+ int fd;
+ size_t len;
+- __int64_t lr;
++ int64_t lr;
+ off64_t off;
+ struct stat64 stb;
+ int v;
+@@ -1835,8 +1836,8 @@ void dread_f(int opno, long r)
+ return;
+ }
+ #endif
+- align = (__int64_t) diob.d_miniosz;
+- lr = ((__int64_t) random() << 32) + random();
++ align = (int64_t) diob.d_miniosz;
++ lr = ((int64_t) random() << 32) + random();
+ off = (off64_t) (lr % stb.st_size);
+ off -= (off % align);
+ lseek64(fd, off, SEEK_SET);
+@@ -1865,14 +1866,14 @@ void dread_f(int opno, long r)
+
+ void dwrite_f(int opno, long r)
+ {
+- __int64_t align;
++ int64_t align;
+ char *buf = NULL;
+ struct dioattr diob;
+ int e;
+ pathname_t f;
+ int fd;
+ size_t len;
+- __int64_t lr;
++ int64_t lr;
+ off64_t off;
+ struct stat64 stb;
+ int v;
+@@ -1925,8 +1926,8 @@ void dwrite_f(int opno, long r)
+ return;
+ }
+ #endif
+- align = (__int64_t) diob.d_miniosz;
+- lr = ((__int64_t) random() << 32) + random();
++ align = (int64_t) diob.d_miniosz;
++ lr = ((int64_t) random() << 32) + random();
+ off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
+ off -= (off % align);
+ lseek64(fd, off, SEEK_SET);
+@@ -2224,7 +2225,7 @@ void read_f(int opno, long r)
+ pathname_t f;
+ int fd;
+ size_t len;
+- __int64_t lr;
++ int64_t lr;
+ off64_t off;
+ struct stat64 stb;
+ int v;
+@@ -2262,7 +2263,7 @@ void read_f(int opno, long r)
+ close(fd);
+ return;
+ }
+- lr = ((__int64_t) random() << 32) + random();
++ lr = ((int64_t) random() << 32) + random();
+ off = (off64_t) (lr % stb.st_size);
+ lseek64(fd, off, SEEK_SET);
+ len = (random() % (getpagesize() * 32)) + 1;
+@@ -2509,7 +2510,7 @@ void truncate_f(int opno, long r)
+ {
+ int e;
+ pathname_t f;
+- __int64_t lr;
++ int64_t lr;
+ off64_t off;
+ struct stat64 stb;
+ int v;
+@@ -2530,7 +2531,7 @@ void truncate_f(int opno, long r)
+ free_pathname(&f);
+ return;
+ }
+- lr = ((__int64_t) random() << 32) + random();
++ lr = ((int64_t) random() << 32) + random();
+ off = lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE);
+ off %= maxfsize;
+ e = truncate64_path(&f, off) < 0 ? errno : 0;
+@@ -2626,7 +2627,7 @@ void write_f(int opno, long r)
+ pathname_t f;
+ int fd;
+ size_t len;
+- __int64_t lr;
++ int64_t lr;
+ off64_t off;
+ struct stat64 stb;
+ int v;
+@@ -2656,7 +2657,7 @@ void write_f(int opno, long r)
+ close(fd);
+ return;
+ }
+- lr = ((__int64_t) random() << 32) + random();
++ lr = ((int64_t) random() << 32) + random();
+ off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
+ off %= maxfsize;
+ lseek64(fd, off, SEEK_SET);
+diff --git a/testcases/network/nfs/nfs_fsstress/fsstress.c b/testcases/network/nfs/nfs_fsstress/fsstress.c
+index ac91262..a34c416 100644
+--- a/testcases/network/nfs/nfs_fsstress/fsstress.c
++++ b/testcases/network/nfs/nfs_fsstress/fsstress.c
+@@ -31,6 +31,7 @@
+ */
+
+ #include "global.h"
++#include <limits.h>
+
+ #define XFS_ERRTAG_MAX 17
+
+@@ -1368,7 +1369,7 @@ void allocsp_f(int opno, long r)
+ pathname_t f;
+ int fd;
+ struct flock64 fl;
+- __int64_t lr;
++ int64_t lr;
+ off64_t off;
+ struct stat64 stb;
+ int v;
+@@ -1398,7 +1399,7 @@ void allocsp_f(int opno, long r)
+ close(fd);
+ return;
+ }
+- lr = ((__int64_t) random() << 32) + random();
++ lr = ((int64_t) random() << 32) + random();
+ off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
+ off %= maxfsize;
+ fl.l_whence = SEEK_SET;
+@@ -1519,7 +1520,7 @@ void bulkstat_f(int opno, long r)
+ __uint64_t last;
+ int nent;
+ xfs_bstat_t *t;
+- __int64_t total;
++ int64_t total;
+ xfs_fsop_bulkreq_t bsr;
+
+ last = 0;
+@@ -1708,14 +1709,14 @@ int setdirect(int fd)
+
+ void dread_f(int opno, long r)
+ {
+- __int64_t align;
++ int64_t align;
+ char *buf;
+ struct dioattr diob;
+ int e;
+ pathname_t f;
+ int fd;
+ size_t len;
+- __int64_t lr;
++ int64_t lr;
+ off64_t off;
+ struct stat64 stb;
+ int v;
+@@ -1775,8 +1776,8 @@ void dread_f(int opno, long r)
+ return;
+ }
+ #endif
+- align = (__int64_t) diob.d_miniosz;
+- lr = ((__int64_t) random() << 32) + random();
++ align = (int64_t) diob.d_miniosz;
++ lr = ((int64_t) random() << 32) + random();
+ off = (off64_t) (lr % stb.st_size);
+ off -= (off % align);
+ lseek64(fd, off, SEEK_SET);
+@@ -1798,14 +1799,14 @@ void dread_f(int opno, long r)
+
+ void dwrite_f(int opno, long r)
+ {
+- __int64_t align;
++ int64_t align;
+ char *buf;
+ struct dioattr diob;
+ int e;
+ pathname_t f;
+ int fd;
+ size_t len;
+- __int64_t lr;
++ int64_t lr;
+ off64_t off;
+ struct stat64 stb;
+ int v;
+@@ -1854,8 +1855,8 @@ void dwrite_f(int opno, long r)
+ return;
+ }
+ #endif
+- align = (__int64_t) diob.d_miniosz;
+- lr = ((__int64_t) random() << 32) + random();
++ align = (int64_t) diob.d_miniosz;
++ lr = ((int64_t) random() << 32) + random();
+ off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
+ off -= (off % align);
+ lseek64(fd, off, SEEK_SET);
+@@ -1917,7 +1918,7 @@ void freesp_f(int opno, long r)
+ pathname_t f;
+ int fd;
+ struct flock64 fl;
+- __int64_t lr;
++ int64_t lr;
+ off64_t off;
+ struct stat64 stb;
+ int v;
+@@ -1947,7 +1948,7 @@ void freesp_f(int opno, long r)
+ close(fd);
+ return;
+ }
+- lr = ((__int64_t) random() << 32) + random();
++ lr = ((int64_t) random() << 32) + random();
+ off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
+ off %= maxfsize;
+ fl.l_whence = SEEK_SET;
+@@ -2145,7 +2146,7 @@ void read_f(int opno, long r)
+ pathname_t f;
+ int fd;
+ size_t len;
+- __int64_t lr;
++ int64_t lr;
+ off64_t off;
+ struct stat64 stb;
+ int v;
+@@ -2183,7 +2184,7 @@ void read_f(int opno, long r)
+ close(fd);
+ return;
+ }
+- lr = ((__int64_t) random() << 32) + random();
++ lr = ((int64_t) random() << 32) + random();
+ off = (off64_t) (lr % stb.st_size);
+ lseek64(fd, off, SEEK_SET);
+ len = (random() % (getpagesize() * 32)) + 1;
+@@ -2281,7 +2282,7 @@ void resvsp_f(int opno, long r)
+ pathname_t f;
+ int fd;
+ struct flock64 fl;
+- __int64_t lr;
++ int64_t lr;
+ off64_t off;
+ struct stat64 stb;
+ int v;
+@@ -2311,7 +2312,7 @@ void resvsp_f(int opno, long r)
+ close(fd);
+ return;
+ }
+- lr = ((__int64_t) random() << 32) + random();
++ lr = ((int64_t) random() << 32) + random();
+ off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
+ off %= maxfsize;
+ fl.l_whence = SEEK_SET;
+@@ -2428,7 +2429,7 @@ void truncate_f(int opno, long r)
+ {
+ int e;
+ pathname_t f;
+- __int64_t lr;
++ int64_t lr;
+ off64_t off;
+ struct stat64 stb;
+ int v;
+@@ -2449,7 +2450,7 @@ void truncate_f(int opno, long r)
+ free_pathname(&f);
+ return;
+ }
+- lr = ((__int64_t) random() << 32) + random();
++ lr = ((int64_t) random() << 32) + random();
+ off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
+ off %= maxfsize;
+ e = truncate64_path(&f, off) < 0 ? errno : 0;
+@@ -2491,7 +2492,7 @@ void unresvsp_f(int opno, long r)
+ pathname_t f;
+ int fd;
+ struct flock64 fl;
+- __int64_t lr;
++ int64_t lr;
+ off64_t off;
+ struct stat64 stb;
+ int v;
+@@ -2521,7 +2522,7 @@ void unresvsp_f(int opno, long r)
+ close(fd);
+ return;
+ }
+- lr = ((__int64_t) random() << 32) + random();
++ lr = ((int64_t) random() << 32) + random();
+ off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
+ off %= maxfsize;
+ fl.l_whence = SEEK_SET;
+@@ -2543,7 +2544,7 @@ void write_f(int opno, long r)
+ pathname_t f;
+ int fd;
+ size_t len;
+- __int64_t lr;
++ int64_t lr;
+ off64_t off;
+ struct stat64 stb;
+ int v;
+@@ -2573,7 +2574,7 @@ void write_f(int opno, long r)
+ close(fd);
+ return;
+ }
+- lr = ((__int64_t) random() << 32) + random();
++ lr = ((int64_t) random() << 32) + random();
+ off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
+ off %= maxfsize;
+ lseek64(fd, off, SEEK_SET);
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0013-include-fcntl.h-for-getting-O_-definitions.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0013-include-fcntl.h-for-getting-O_-definitions.patch
new file mode 100644
index 000000000..4266e4fc3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0013-include-fcntl.h-for-getting-O_-definitions.patch
@@ -0,0 +1,67 @@
+From 1ef8c32317064438ec3b37a114f5d82957f4e0c6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 20:05:54 +0000
+Subject: [PATCH 13/32] include fcntl.h for getting O_* definitions
+
+musl exposes this issue, with glibc fcntl.h is included via some other
+header and this problem remained latent
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/ipc/ipc_stress/shmem_test_03.c | 1 +
+ testcases/kernel/syscalls/mq_notify/mq_notify01.c | 1 +
+ testcases/network/tcp_cmds/sendfile/testsf_c.c | 1 +
+ testcases/network/tcp_cmds/sendfile/testsf_s.c | 1 +
+ 4 files changed, 4 insertions(+)
+
+diff --git a/testcases/kernel/ipc/ipc_stress/shmem_test_03.c b/testcases/kernel/ipc/ipc_stress/shmem_test_03.c
+index c1b11fd..8be156f 100644
+--- a/testcases/kernel/ipc/ipc_stress/shmem_test_03.c
++++ b/testcases/kernel/ipc/ipc_stress/shmem_test_03.c
+@@ -72,6 +72,7 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <limits.h>
++#include <fcntl.h>
+ #include <sys/file.h>
+ #include <sys/ipc.h>
+ #include <sys/mman.h>
+diff --git a/testcases/kernel/syscalls/mq_notify/mq_notify01.c b/testcases/kernel/syscalls/mq_notify/mq_notify01.c
+index 4728c70..5c7846c 100644
+--- a/testcases/kernel/syscalls/mq_notify/mq_notify01.c
++++ b/testcases/kernel/syscalls/mq_notify/mq_notify01.c
+@@ -41,6 +41,7 @@
+ #include <mqueue.h>
+ #include <signal.h>
+ #include <stdlib.h>
++#include <fcntl.h>
+
+ #include "../utils/include_j_h.h"
+
+diff --git a/testcases/network/tcp_cmds/sendfile/testsf_c.c b/testcases/network/tcp_cmds/sendfile/testsf_c.c
+index 449784f..38d3274 100644
+--- a/testcases/network/tcp_cmds/sendfile/testsf_c.c
++++ b/testcases/network/tcp_cmds/sendfile/testsf_c.c
+@@ -9,6 +9,7 @@
+ #include <sys/types.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <fcntl.h>
+ #include <sys/file.h>
+ #include <arpa/inet.h>
+ #include <netinet/in.h>
+diff --git a/testcases/network/tcp_cmds/sendfile/testsf_s.c b/testcases/network/tcp_cmds/sendfile/testsf_s.c
+index 17e98ad..bce8dd1 100644
+--- a/testcases/network/tcp_cmds/sendfile/testsf_s.c
++++ b/testcases/network/tcp_cmds/sendfile/testsf_s.c
+@@ -6,6 +6,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
++#include <fcntl.h>
+ #include <sys/file.h>
+ #include <errno.h>
+ #include <sys/signal.h>
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0014-hyperthreading-Include-sys-types.h-for-pid_t-definit.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0014-hyperthreading-Include-sys-types.h-for-pid_t-definit.patch
new file mode 100644
index 000000000..84d81e9f9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0014-hyperthreading-Include-sys-types.h-for-pid_t-definit.patch
@@ -0,0 +1,56 @@
+From d63fefa86dac437c47b9ebbea0a82a1240aaba2c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 20:09:56 +0000
+Subject: [PATCH 14/32] hyperthreading: Include sys/types.h for pid_t
+ definition
+
+If sys/types.h is not included then it will not define pid_t_needed
+and therefore typedef wont be included and we get errors about pid_t
+being not known
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.h | 1 +
+ testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.h | 1 +
+ testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h | 1 +
+ 3 files changed, 3 insertions(+)
+
+diff --git a/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.h b/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.h
+index 1ec9794..9084aa7 100644
+--- a/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.h
++++ b/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.h
+@@ -3,6 +3,7 @@
+ #define _HTUTILS_H_
+
+ #include <stdlib.h>
++#include <sys/types.h>
+
+ int is_cmdline_para(const char *para);
+
+diff --git a/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.h b/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.h
+index 1ec9794..c03a124 100644
+--- a/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.h
++++ b/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.h
+@@ -2,6 +2,7 @@
+ #ifndef _HTUTILS_H_
+ #define _HTUTILS_H_
+
++#include <sys/types.h>
+ #include <stdlib.h>
+
+ int is_cmdline_para(const char *para);
+diff --git a/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h b/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h
+index 2977ad0..6b484e1 100644
+--- a/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h
++++ b/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h
+@@ -3,6 +3,7 @@
+ #define _HTUTILS_H_
+
+ #include <stdlib.h>
++#include <sys/types.h>
+
+ int is_cmdline_para(const char *para);
+
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0015-mincore01-Rename-PAGESIZE-to-pagesize.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0015-mincore01-Rename-PAGESIZE-to-pagesize.patch
new file mode 100644
index 000000000..963536f99
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0015-mincore01-Rename-PAGESIZE-to-pagesize.patch
@@ -0,0 +1,64 @@
+From f091839532f3afe0a58e8ba0b45615c899a43a47 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 20:12:09 +0000
+Subject: [PATCH 15/32] mincore01: Rename PAGESIZE to pagesize
+
+PAGESIZE conflicts with system headers on musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/syscalls/mincore/mincore01.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/testcases/kernel/syscalls/mincore/mincore01.c b/testcases/kernel/syscalls/mincore/mincore01.c
+index 97a3d95..fa426d1 100644
+--- a/testcases/kernel/syscalls/mincore/mincore01.c
++++ b/testcases/kernel/syscalls/mincore/mincore01.c
+@@ -45,7 +45,7 @@
+ #include "test.h"
+ #include "safe_macros.h"
+
+-static int PAGESIZE;
++static int pagesize;
+ static rlim_t STACK_LIMIT = 10485760;
+
+ static void cleanup(void);
+@@ -146,7 +146,7 @@ static void setup4(struct test_case_t *tc)
+ }
+
+ tc->addr = global_pointer;
+- tc->len = as_lim.rlim_cur - (rlim_t)global_pointer + PAGESIZE;
++ tc->len = as_lim.rlim_cur - (rlim_t)global_pointer + pagesize;
+ tc->vector = global_vec;
+
+ /*
+@@ -161,7 +161,7 @@ static void setup(void)
+ char *buf;
+ int fd;
+
+- PAGESIZE = getpagesize();
++ pagesize = getpagesize();
+
+ tst_sig(NOFORK, DEF_HANDLER, cleanup);
+
+@@ -170,7 +170,7 @@ static void setup(void)
+ TEST_PAUSE;
+
+ /* global_pointer will point to a mmapped area of global_len bytes */
+- global_len = PAGESIZE * 2;
++ global_len = pagesize * 2;
+
+ buf = SAFE_MALLOC(cleanup, global_len);
+ memset(buf, 42, global_len);
+@@ -186,7 +186,7 @@ static void setup(void)
+ PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+
+ global_vec = SAFE_MALLOC(cleanup,
+- (global_len + PAGESIZE - 1) / PAGESIZE);
++ (global_len + pagesize - 1) / pagesize);
+
+ SAFE_CLOSE(cleanup, fd);
+ }
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0016-ustat-Change-header-from-ustat.h-to-sys-ustat.h.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0016-ustat-Change-header-from-ustat.h-to-sys-ustat.h.patch
new file mode 100644
index 000000000..1b5b93a4e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0016-ustat-Change-header-from-ustat.h-to-sys-ustat.h.patch
@@ -0,0 +1,45 @@
+From 2b9be924bbad8a1f84ae553fdd1aa8391aa8d2f4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 20:15:07 +0000
+Subject: [PATCH 16/32] ustat: Change header from ustat.h to sys/ustat.h
+
+makes it portable for musl, on glibc ustat.h is just including
+sys/ustat.h too
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/syscalls/ustat/ustat01.c | 2 +-
+ testcases/kernel/syscalls/ustat/ustat02.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/testcases/kernel/syscalls/ustat/ustat01.c b/testcases/kernel/syscalls/ustat/ustat01.c
+index 01b7688..494647b 100644
+--- a/testcases/kernel/syscalls/ustat/ustat01.c
++++ b/testcases/kernel/syscalls/ustat/ustat01.c
+@@ -20,8 +20,8 @@
+ */
+
+ #include <unistd.h>
+-#include <ustat.h>
+ #include <errno.h>
++#include <sys/ustat.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include "test.h"
+diff --git a/testcases/kernel/syscalls/ustat/ustat02.c b/testcases/kernel/syscalls/ustat/ustat02.c
+index 4e66236..edada31 100644
+--- a/testcases/kernel/syscalls/ustat/ustat02.c
++++ b/testcases/kernel/syscalls/ustat/ustat02.c
+@@ -21,8 +21,8 @@
+ */
+
+ #include <unistd.h>
+-#include <ustat.h>
+ #include <errno.h>
++#include <sys/ustat.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include "test.h"
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0017-replace-sigval_t-with-union-sigval.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0017-replace-sigval_t-with-union-sigval.patch
new file mode 100644
index 000000000..ed25802a0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0017-replace-sigval_t-with-union-sigval.patch
@@ -0,0 +1,88 @@
+From c882bcd18820b44a685f0d5edd7aaff77a88c912 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 20:17:55 +0000
+Subject: [PATCH 17/32] replace sigval_t with union sigval
+
+This makes it compatible across musl and glibc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c | 2 +-
+ testcases/kernel/syscalls/timer_gettime/timer_gettime01.c | 2 +-
+ testcases/kernel/timers/timer_create/timer_create02.c | 4 ++--
+ testcases/kernel/timers/timer_create/timer_create03.c | 4 ++--
+ 4 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c b/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c
+index d186c1f..bc03544 100644
+--- a/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c
++++ b/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c
+@@ -54,7 +54,7 @@ int main(int ac, char **av)
+
+ setup();
+
+- ev.sigev_value = (sigval_t) 0;
++ ev.sigev_value = (union sigval) 0;
+ ev.sigev_signo = SIGALRM;
+ ev.sigev_notify = SIGEV_SIGNAL;
+ TEST(ltp_syscall(__NR_timer_create, CLOCK_REALTIME, &ev, &timer));
+diff --git a/testcases/kernel/syscalls/timer_gettime/timer_gettime01.c b/testcases/kernel/syscalls/timer_gettime/timer_gettime01.c
+index b583aee..9371a6a 100644
+--- a/testcases/kernel/syscalls/timer_gettime/timer_gettime01.c
++++ b/testcases/kernel/syscalls/timer_gettime/timer_gettime01.c
+@@ -55,7 +55,7 @@ int main(int ac, char **av)
+
+ setup();
+
+- ev.sigev_value = (sigval_t) 0;
++ ev.sigev_value = (union sigval) 0;
+ ev.sigev_signo = SIGALRM;
+ ev.sigev_notify = SIGEV_SIGNAL;
+ TEST(ltp_syscall(__NR_timer_create, CLOCK_REALTIME, &ev, &timer));
+diff --git a/testcases/kernel/timers/timer_create/timer_create02.c b/testcases/kernel/timers/timer_create/timer_create02.c
+index 7f528ed..1127400 100644
+--- a/testcases/kernel/timers/timer_create/timer_create02.c
++++ b/testcases/kernel/timers/timer_create/timer_create02.c
+@@ -142,7 +142,7 @@ void setup_test(int option)
+ {
+ switch (option) {
+ case 0:
+- evp.sigev_value = (sigval_t) 0;
++ evp.sigev_value = (union sigval) 0;
+ evp.sigev_signo = SIGALRM;
+ evp.sigev_notify = SIGEV_SIGNAL;
+ evp_ptr = &evp;
+@@ -151,7 +151,7 @@ void setup_test(int option)
+ evp_ptr = NULL;
+ break;
+ case 2:
+- evp.sigev_value = (sigval_t) 0;
++ evp.sigev_value = (union sigval) 0;
+ evp.sigev_signo = SIGALRM; /* any will do */
+ evp.sigev_notify = SIGEV_NONE;
+ evp_ptr = &evp;
+diff --git a/testcases/kernel/timers/timer_create/timer_create03.c b/testcases/kernel/timers/timer_create/timer_create03.c
+index 291fcfa..8b01bf7 100644
+--- a/testcases/kernel/timers/timer_create/timer_create03.c
++++ b/testcases/kernel/timers/timer_create/timer_create03.c
+@@ -129,7 +129,7 @@ void setup_test(int option)
+ {
+ switch (option) {
+ case 0:
+- evp.sigev_value = (sigval_t) 0;
++ evp.sigev_value = (union sigval) 0;
+ evp.sigev_signo = SIGALRM;
+ evp.sigev_notify = SIGEV_SIGNAL;
+ evp_ptr = &evp;
+@@ -138,7 +138,7 @@ void setup_test(int option)
+ evp_ptr = NULL;
+ break;
+ case 2:
+- evp.sigev_value = (sigval_t) 0;
++ evp.sigev_value = (union sigval) 0;
+ evp.sigev_signo = SIGALRM; /* any will do */
+ evp.sigev_notify = SIGEV_NONE;
+ evp_ptr = &evp;
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0018-guard-mallocopt-with-__GLIBC__.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0018-guard-mallocopt-with-__GLIBC__.patch
new file mode 100644
index 000000000..5198fe9f4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0018-guard-mallocopt-with-__GLIBC__.patch
@@ -0,0 +1,32 @@
+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>
+---
+ 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/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0019-tomoyo-Replace-canonicalize_file_name-with-realpath.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0019-tomoyo-Replace-canonicalize_file_name-with-realpath.patch
new file mode 100644
index 000000000..0a4c5f0b3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0019-tomoyo-Replace-canonicalize_file_name-with-realpath.patch
@@ -0,0 +1,32 @@
+From 721e94985b9cff3e2724af7ea5be7d005bc12dec Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jan 2016 06:55:27 +0000
+Subject: [PATCH 19/32] tomoyo: Replace canonicalize_file_name() with
+ realpath()
+
+canonicalize_file_name() API is specific to glibc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/security/tomoyo/tomoyo_filesystem_test.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/testcases/kernel/security/tomoyo/tomoyo_filesystem_test.c b/testcases/kernel/security/tomoyo/tomoyo_filesystem_test.c
+index da4af0f..5c1a3ca 100644
+--- a/testcases/kernel/security/tomoyo/tomoyo_filesystem_test.c
++++ b/testcases/kernel/security/tomoyo/tomoyo_filesystem_test.c
+@@ -274,9 +274,9 @@ int main(int argc, char *argv[])
+ /* Test mount(). */
+ {
+ static char buf[4096];
+- char *dev_ram_path = canonicalize_file_name("/dev/ram0");
++ char *dev_ram_path = realpath("/dev/ram0", NULL);
+ if (!dev_ram_path)
+- dev_ram_path = canonicalize_file_name("/dev/ram");
++ dev_ram_path = realpath("/dev/ram", NULL);
+ if (!dev_ram_path) {
+ dev_ram_path = "/dev/ram0";
+ mknod(dev_ram_path, S_IFBLK, MKDEV(1, 0));
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch
new file mode 100644
index 000000000..0e4e4586c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch
@@ -0,0 +1,48 @@
+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>
+---
+ 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/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch
new file mode 100644
index 000000000..c8cbe580c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch
@@ -0,0 +1,71 @@
+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>
+---
+ 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(-)
+
+diff --git a/testcases/kernel/syscalls/mremap/mremap01.c b/testcases/kernel/syscalls/mremap/mremap01.c
+index d63d1e4..24ca174 100644
+--- a/testcases/kernel/syscalls/mremap/mremap01.c
++++ b/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"
+
+diff --git a/testcases/kernel/syscalls/mremap/mremap02.c b/testcases/kernel/syscalls/mremap/mremap02.c
+index 5a51b9a..a530a6b 100644
+--- a/testcases/kernel/syscalls/mremap/mremap02.c
++++ b/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"
+
+diff --git a/testcases/kernel/syscalls/mremap/mremap03.c b/testcases/kernel/syscalls/mremap/mremap03.c
+index 12e3829..9b39f8b 100644
+--- a/testcases/kernel/syscalls/mremap/mremap03.c
++++ b/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"
+
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0022-include-sys-types.h.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0022-include-sys-types.h.patch
new file mode 100644
index 000000000..413b44ac7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0022-include-sys-types.h.patch
@@ -0,0 +1,29 @@
+From 7ac6fd51991ac61d1d7594f601d87842060ee284 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jan 2016 07:06:11 +0000
+Subject: [PATCH 22/32] include sys/types.h
+
+Fixes
+
+error: unknown type name 'uint'
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/ipc/ipc_stress/shmem_test_04.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/testcases/kernel/ipc/ipc_stress/shmem_test_04.c b/testcases/kernel/ipc/ipc_stress/shmem_test_04.c
+index 72c2e60..e7e5f61 100644
+--- a/testcases/kernel/ipc/ipc_stress/shmem_test_04.c
++++ b/testcases/kernel/ipc/ipc_stress/shmem_test_04.c
+@@ -65,6 +65,7 @@
+ #include <signal.h>
+ #include <stdint.h>
+ #include <sys/mman.h>
++#include <sys/types.h>
+
+ #ifdef _LINUX_
+ typedef unsigned long ulong_t;
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch
new file mode 100644
index 000000000..4680c03d4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch
@@ -0,0 +1,48 @@
+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>
+---
+ 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/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch
new file mode 100644
index 000000000..03c67a52f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch
@@ -0,0 +1,68 @@
+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>
+---
+ 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/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0025-mc_gethost-include-sys-types.h.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0025-mc_gethost-include-sys-types.h.patch
new file mode 100644
index 000000000..aad3cb037
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0025-mc_gethost-include-sys-types.h.patch
@@ -0,0 +1,28 @@
+From 9d14edfc12eefac900dd54729a88b3ccf91c1c43 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jan 2016 07:18:15 +0000
+Subject: [PATCH 25/32] mc_gethost: include sys/types.h
+
+Fix build on musl
+error: unknown type name 'u_char'
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/network/multicast/mc_gethost/mc_gethost.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/testcases/network/multicast/mc_gethost/mc_gethost.c b/testcases/network/multicast/mc_gethost/mc_gethost.c
+index 5b9a790..c799e2a 100644
+--- a/testcases/network/multicast/mc_gethost/mc_gethost.c
++++ b/testcases/network/multicast/mc_gethost/mc_gethost.c
+@@ -6,6 +6,7 @@
+
+ #include <sys/param.h>
+ #include <sys/socket.h>
++#include <sys/types.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+ #include <arpa/nameser.h>
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0026-crash01-Define-_GNU_SOURCE.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0026-crash01-Define-_GNU_SOURCE.patch
new file mode 100644
index 000000000..58b8ed4d4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0026-crash01-Define-_GNU_SOURCE.patch
@@ -0,0 +1,29 @@
+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>
+---
+ 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/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch
new file mode 100644
index 000000000..b47d0977e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch
@@ -0,0 +1,29 @@
+From 4a74b275acc8158850f2500928a1467c3482c986 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jan 2016 07:23:11 +0000
+Subject: [PATCH 27/32] sysconf01: Use _SC_2_C_VERSION conditionally
+
+_SC_2_C_VERSION is not available on musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/syscalls/sysconf/sysconf01.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/testcases/kernel/syscalls/sysconf/sysconf01.c b/testcases/kernel/syscalls/sysconf/sysconf01.c
+index 8542e77..e806943 100644
+--- a/testcases/kernel/syscalls/sysconf/sysconf01.c
++++ b/testcases/kernel/syscalls/sysconf/sysconf01.c
+@@ -102,7 +102,9 @@ int main(void)
+ test_sysconf(_SC_ATEXIT_MAX);
+ test_sysconf(_SC_2_C_BIND);
+ test_sysconf(_SC_2_C_DEV);
++#ifdef __GLIBC__
+ test_sysconf(_SC_2_C_VERSION);
++#endif
+ /* 21 - 25 */
+ test_sysconf(_SC_2_CHAR_TERM);
+ test_sysconf(_SC_2_FORT_DEV);
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch
new file mode 100644
index 000000000..fc82ff923
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch
@@ -0,0 +1,43 @@
+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>
+---
+ include/lapi/rt_sigaction.h | 2 +-
+ testcases/kernel/syscalls/rt_sigsuspend/Makefile | 3 +++
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/include/lapi/rt_sigaction.h b/include/lapi/rt_sigaction.h
+index 3a5a763..870918c 100644
+--- a/include/lapi/rt_sigaction.h
++++ b/include/lapi/rt_sigaction.h
+@@ -34,7 +34,7 @@
+ #define INVAL_SA_PTR ((void *)-1)
+
+ 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;
+diff --git a/testcases/kernel/syscalls/rt_sigsuspend/Makefile b/testcases/kernel/syscalls/rt_sigsuspend/Makefile
+index 37bc3a9..2ca7f7c 100644
+--- a/testcases/kernel/syscalls/rt_sigsuspend/Makefile
++++ b/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
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0029-trace_shed-Fix-build-with-musl.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0029-trace_shed-Fix-build-with-musl.patch
new file mode 100644
index 000000000..f7ece9e18
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0029-trace_shed-Fix-build-with-musl.patch
@@ -0,0 +1,32 @@
+From 2f8a57f66a94210d34dd0361659a8297cf3d813f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jan 2016 07:29:24 +0000
+Subject: [PATCH 29/32] trace_shed: Fix build with musl
+
+Errors on musl are
+
+trace_sched.c:425:16: error: invalid operands to binary & (have
+'thread_sched_t * {aka struct <anonymous> *}' and 'int')
+ thrd_ndx, WEXITSTATUS(status));
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/sched/tool/trace_sched.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/testcases/kernel/sched/tool/trace_sched.c b/testcases/kernel/sched/tool/trace_sched.c
+index 7815686..30dca5f 100644
+--- a/testcases/kernel/sched/tool/trace_sched.c
++++ b/testcases/kernel/sched/tool/trace_sched.c
+@@ -422,7 +422,7 @@ int main(int argc, /* number of input parameters. */
+ if (status == (thread_sched_t *) - 1) {
+ fprintf(stderr,
+ "thread [%d] - process exited with errors %d\n",
+- thrd_ndx, WEXITSTATUS(status));
++ thrd_ndx, WEXITSTATUS((int)status));
+ exit(-1);
+ } else {
+ exp_prio[thrd_ndx] = status->exp_prio;
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch
new file mode 100644
index 000000000..d2d6d76fd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch
@@ -0,0 +1,33 @@
+From 77c95dacffe90382a1f131c801ac569120d95949 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jan 2016 07:32:24 +0000
+Subject: [PATCH 30/32] lib: Use PTHREAD_MUTEX_RECURSIVE in place of
+ PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP for non-glibc
+
+e.g. musl does not implement the _NP mutex types
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/tst_res.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/lib/tst_res.c b/lib/tst_res.c
+index 5c1c58c..3244b5e 100644
+--- a/lib/tst_res.c
++++ b/lib/tst_res.c
+@@ -104,8 +104,11 @@ int TEST_ERRNO;
+ assert(strlen(buf) > 0); \
+ } while (0)
+
++#ifdef __GLIBC__
+ static pthread_mutex_t tmutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
+-
++#else
++static pthread_mutex_t tmutex = { PTHREAD_MUTEX_RECURSIVE };
++#endif
+ /*
+ * Define local function prototypes.
+ */
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0031-vma03-fix-page-size-offset-as-per-page-size-alignmen.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0031-vma03-fix-page-size-offset-as-per-page-size-alignmen.patch
new file mode 100644
index 000000000..473ca4c65
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0031-vma03-fix-page-size-offset-as-per-page-size-alignmen.patch
@@ -0,0 +1,33 @@
+From 293ff1da06748ed4c69be6ece262d42e562e7298 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jan 2016 07:36:19 +0000
+Subject: [PATCH 31/32] vma03: fix page size offset as per page size alignment
+
+the offset the param of mmap2() doesn't align the page size, but,
+this param allow must be a multiple of the page size as returned
+by sysconf(_SC_PAGE_SIZE).meanwhile offset * 4096 must be a
+multiple of the system page size, so modify the input param of offset
+pgoff = (ULONG_MAX - 1)&(~((pgsz-1)>>12));
+
+Signed-off-by: Chuang Dong <Chuang.Dong@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/mem/vma/vma03.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/testcases/kernel/mem/vma/vma03.c b/testcases/kernel/mem/vma/vma03.c
+index ad8a7b4..a539233 100644
+--- a/testcases/kernel/mem/vma/vma03.c
++++ b/testcases/kernel/mem/vma/vma03.c
+@@ -85,7 +85,7 @@ int main(int argc, char *argv[])
+ if (fd == -1)
+ tst_brkm(TBROK | TERRNO, NULL, "open %s", TESTFILE);
+
+- pgoff = ULONG_MAX - 1;
++ pgoff = (ULONG_MAX - 1)&(~((pgsz-1)>>12));
+ map = mmap2(NULL, pgsz, PROT_READ | PROT_WRITE, MAP_PRIVATE,
+ fd, pgoff);
+ if (map == MAP_FAILED)
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0032-regen.sh-Include-asm-unistd.h-explicitly.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0032-regen.sh-Include-asm-unistd.h-explicitly.patch
new file mode 100644
index 000000000..5c6bf919f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0032-regen.sh-Include-asm-unistd.h-explicitly.patch
@@ -0,0 +1,30 @@
+From 4f1905ff09c730091674818bd1b48ee221347101 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jan 2016 08:30:29 +0000
+Subject: [PATCH 32/32] regen.sh: Include asm/unistd.h explicitly
+
+on musl this is not included indirectly and it results in errors like
+testcases/kernel/include/linux_syscall_numbers.h:1035:25: error:
+'__NR_SYSCALL_BASE' undeclared (first use in this function)
+| # define __NR_readdir (__NR_SYSCALL_BASE+ 89)
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/include/regen.sh | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/testcases/kernel/include/regen.sh b/testcases/kernel/include/regen.sh
+index f93f49b..ee790af 100755
+--- a/testcases/kernel/include/regen.sh
++++ b/testcases/kernel/include/regen.sh
+@@ -32,6 +32,7 @@ cat << EOF > "${output_pid}"
+
+ #include <errno.h>
+ #include <sys/syscall.h>
++#include <asm/unistd.h>
+ #include "cleanup.c"
+
+ #define ltp_syscall(NR, ...) ({ \\
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0033-shmat1-Cover-GNU-specific-code-under-__USE_GNU.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0033-shmat1-Cover-GNU-specific-code-under-__USE_GNU.patch
new file mode 100644
index 000000000..868e1cf1f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0033-shmat1-Cover-GNU-specific-code-under-__USE_GNU.patch
@@ -0,0 +1,41 @@
+From 5e3dea669e5b0b769f322d54a3bb9f320b5327da Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 22 Mar 2016 15:47:14 +0000
+Subject: [PATCH 26/26] shmat1: Cover GNU specific code under __USE_GNU
+
+on x86, we use uc_mcontext element from sigcontext
+which is marked gnu-specific in glibc, this patch
+adds this condition around the code
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ testcases/kernel/mem/mtest06/shmat1.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/testcases/kernel/mem/mtest06/shmat1.c b/testcases/kernel/mem/mtest06/shmat1.c
+index 0d6d7a4..bee69f6 100644
+--- a/testcases/kernel/mem/mtest06/shmat1.c
++++ b/testcases/kernel/mem/mtest06/shmat1.c
+@@ -111,7 +111,7 @@ int done_shmat = 0; /* disallow read and writes before shmat */
+ static void sig_handler(int signal, /* signal number, set to handle SIGALRM */
+ int code, struct ucontext *ut)
+ { /* contains pointer to sigcontext structure */
+-#ifdef __i386__
++#if defined(__i386__) && defined(__USE_GNU)
+ unsigned long except; /* exception type. */
+ int ret = 0; /* exit code from signal handler. */
+ struct sigcontext *scp = /* pointer to sigcontext structure */
+@@ -122,7 +122,7 @@ static void sig_handler(int signal, /* signal number, set to handle SIGALRM
+ fprintf(stdout, "Test ended, success\n");
+ exit(0);
+ }
+-#ifdef __i386__
++#if defined(__i386__) && defined(__USE_GNU)
+ else {
+ except = scp->trapno;
+ fprintf(stderr, "signal caught - [%d] ", signal);
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0034-periodic_output.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0034-periodic_output.patch
new file mode 100644
index 000000000..59caefe43
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0034-periodic_output.patch
@@ -0,0 +1,43 @@
+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
+
+diff -ruN a/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh b/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh
+--- a/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh 2013-11-08 15:54:09.515049081 +0100
++++ b/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh 2013-11-08 22:32:15.587370406 +0100
+@@ -37,7 +37,8 @@
+ exit 0
+ fi
+
+-RUN_TIME=$(( 60 * 60 ))
++ONE_MINUTE=60
++RUN_TIME=60
+
+ cleanup()
+ {
+@@ -62,7 +63,7 @@
+ # $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 @@
+ 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
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch
new file mode 100644
index 000000000..32ae8aa27
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch
@@ -0,0 +1,23 @@
+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>
+Upstream-Status: Pending
+
+diff --git a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
+index ffbe006..e81bf74 100755
+--- a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
++++ b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
+@@ -220,8 +220,8 @@ test_proc_kill()
+
+ $TEST_PATH/memcg_process $2 -s $3 &
+ pid=$!
+- sleep 1
+ echo $pid > tasks
++ sleep 1
+
+ kill -s USR1 $pid 2> /dev/null
+ sleep 1
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp_20160126.bb b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp_20160126.bb
new file mode 100644
index 000000000..097c16d57
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp_20160126.bb
@@ -0,0 +1,109 @@
+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=216e43b72efbe4ed9017cc19c4c68b01 \
+ file://testcases/realtime/COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
+ file://tools/netpipe-2.4/COPYING;md5=9e3781bb5fe787aa80e1f51f5006b6fa \
+ file://tools/netpipe-2.4-ipv6/COPYING;md5=9e3781bb5fe787aa80e1f51f5006b6fa \
+ file://tools/top-LTP/proc/COPYING;md5=aefc88eb8a41672fbfcfe6b69ab8c49c \
+ 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_mips64 = " -D__SANE_USERSPACE_TYPES__"
+SRCREV = "fce797676b14f50406718e7ef640b50da66c9b36"
+
+SRC_URI = "git://github.com/linux-test-project/ltp.git \
+ file://0001-ltp-Don-t-link-against-libfl.patch \
+ file://0002-Add-knob-to-control-whether-numa-support-should-be-c.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://0006-sendfile-Use-off64_t-instead-of-__off64_t.patch \
+ file://0007-replace-SIGCLD-with-SIGCHLD.patch \
+ file://0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch \
+ file://0009-Guard-error.h-with-__GLIBC__.patch \
+ file://0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch \
+ file://0011-Rename-sigset-variable-to-sigset1.patch \
+ file://0012-fsstress.c-Replace-__int64_t-with-int64_t.patch \
+ file://0013-include-fcntl.h-for-getting-O_-definitions.patch \
+ file://0014-hyperthreading-Include-sys-types.h-for-pid_t-definit.patch \
+ file://0015-mincore01-Rename-PAGESIZE-to-pagesize.patch \
+ file://0016-ustat-Change-header-from-ustat.h-to-sys-ustat.h.patch \
+ file://0017-replace-sigval_t-with-union-sigval.patch \
+ file://0018-guard-mallocopt-with-__GLIBC__.patch \
+ file://0019-tomoyo-Replace-canonicalize_file_name-with-realpath.patch \
+ file://0020-getdents-define-getdents-getdents64-only-for-glibc.patch \
+ file://0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch \
+ file://0022-include-sys-types.h.patch \
+ file://0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch \
+ file://0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch \
+ file://0025-mc_gethost-include-sys-types.h.patch \
+ file://0026-crash01-Define-_GNU_SOURCE.patch \
+ file://0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch \
+ file://0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch \
+ file://0029-trace_shed-Fix-build-with-musl.patch \
+ file://0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch \
+ file://0031-vma03-fix-page-size-offset-as-per-page-size-alignmen.patch \
+ file://0032-regen.sh-Include-asm-unistd.h-explicitly.patch \
+ file://0033-shmat1-Cover-GNU-specific-code-under-__USE_GNU.patch \
+ file://0034-periodic_output.patch \
+ file://0035-fix-test_proc_kill-hang.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 "
+
+# The makefiles make excessive use of make -C and several include testcases.mk
+# which triggers a build of the syscall header. To reproduce, build ltp,
+# then delete the header, then "make -j XX" and watch regen.sh run multiple
+# times. Its easier to generate this once here instead.
+do_compile_prepend () {
+ ( make -C ${B}/testcases/kernel include/linux_syscall_numbers.h )
+}
+
+do_install(){
+ install -d ${D}/opt/ltp/
+ oe_runmake DESTDIR=${D} SKIP_IDCHECK=1 install
+
+ # Copy POSIX test suite into ${D}/opt/ltp/testcases by manual
+ cp -r testcases/open_posix_testsuite ${D}/opt/ltp/testcases
+}
+
+RDEPENDS_${PN} = "perl e2fsprogs-mke2fs python-core libaio bash gawk expect ldd"
+
+FILES_${PN}-staticdev += "/opt/ltp/lib/libmem.a"
+
+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/*"
+
+# Avoid generated binaries stripping. Otherwise some of the ltp tests such as ldd01 & nm01 fails
+INHIBIT_PACKAGE_STRIP = "1"
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+# However, test_arch_stripped is already stripped, so...
+INSANE_SKIP_${PN} += "already-stripped"
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0001-Don-t-reuse-weak-symbol-optopt-to-fix-FTBFS-on-mips.patch b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0001-Don-t-reuse-weak-symbol-optopt-to-fix-FTBFS-on-mips.patch
new file mode 100644
index 000000000..77da33321
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0001-Don-t-reuse-weak-symbol-optopt-to-fix-FTBFS-on-mips.patch
@@ -0,0 +1,59 @@
+From: Luk Claes <luk@debian.org>
+Date: Sat, 4 Jul 2009 10:54:53 +0200
+Subject: Don't reuse weak symbol optopt to fix FTBFS on mips*
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/h/heirloom-mailx/heirloom-mailx_12.5-5.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+---
+ getopt.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/getopt.c b/getopt.c
+index 83ce628..82e983c 100644
+--- a/getopt.c
++++ b/getopt.c
+@@ -43,7 +43,7 @@ typedef int ssize_t;
+ char *optarg;
+ int optind = 1;
+ int opterr = 1;
+-int optopt;
++int optoptc;
+
+ static void
+ error(const char *s, int c)
+@@ -69,7 +69,7 @@ error(const char *s, int c)
+ *bp++ = *s++;
+ while (*msg)
+ *bp++ = *msg++;
+- *bp++ = optopt;
++ *bp++ = optoptc;
+ *bp++ = '\n';
+ write(2, buf, bp - buf);
+ ac_free(buf);
+@@ -101,13 +101,13 @@ getopt(int argc, char *const argv[], const char *optstring)
+ }
+ curp = &argv[optind][1];
+ }
+- optopt = curp[0] & 0377;
++ optoptc = curp[0] & 0377;
+ while (optstring[0]) {
+ if (optstring[0] == ':') {
+ optstring++;
+ continue;
+ }
+- if ((optstring[0] & 0377) == optopt) {
++ if ((optstring[0] & 0377) == optoptc) {
+ if (optstring[1] == ':') {
+ if (curp[1] != '\0') {
+ optarg = (char *)&curp[1];
+@@ -127,7 +127,7 @@ getopt(int argc, char *const argv[], const char *optstring)
+ optind++;
+ optarg = 0;
+ }
+- return optopt;
++ return optoptc;
+ }
+ optstring++;
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0002-Patched-out-SSL2-support-since-it-is-no-longer-suppo.patch b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0002-Patched-out-SSL2-support-since-it-is-no-longer-suppo.patch
new file mode 100644
index 000000000..6bad433ea
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0002-Patched-out-SSL2-support-since-it-is-no-longer-suppo.patch
@@ -0,0 +1,41 @@
+From: Hilko Bengen <bengen@debian.org>
+Date: Wed, 27 Apr 2011 00:18:42 +0200
+Subject: Patched out SSL2 support since it is no longer supported by OpenSSL.
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/h/heirloom-mailx/heirloom-mailx_12.5-5.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+---
+ mailx.1 | 2 +-
+ openssl.c | 4 +---
+ 2 files changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/mailx.1 b/mailx.1
+index 417ea04..a02e430 100644
+--- a/mailx.1
++++ b/mailx.1
+@@ -3575,7 +3575,7 @@ Only applicable if SSL/TLS support is built using OpenSSL.
+ .TP
+ .B ssl-method
+ Selects a SSL/TLS protocol version;
+-valid values are `ssl2', `ssl3', and `tls1'.
++valid values are `ssl3', and `tls1'.
+ If unset, the method is selected automatically,
+ if possible.
+ .TP
+diff --git a/openssl.c b/openssl.c
+index b4e33fc..44fe4e5 100644
+--- a/openssl.c
++++ b/openssl.c
+@@ -216,9 +216,7 @@ ssl_select_method(const char *uhp)
+
+ cp = ssl_method_string(uhp);
+ if (cp != NULL) {
+- if (equal(cp, "ssl2"))
+- method = SSLv2_client_method();
+- else if (equal(cp, "ssl3"))
++ if (equal(cp, "ssl3"))
+ method = SSLv3_client_method();
+ else if (equal(cp, "tls1"))
+ method = TLSv1_client_method();
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0003-Fixed-Lintian-warning-warning-macro-N-not-defined.patch b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0003-Fixed-Lintian-warning-warning-macro-N-not-defined.patch
new file mode 100644
index 000000000..13b73ae59
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0003-Fixed-Lintian-warning-warning-macro-N-not-defined.patch
@@ -0,0 +1,25 @@
+From: Hilko Bengen <bengen@debian.org>
+Date: Sat, 14 Apr 2012 20:22:43 +0200
+Subject: Fixed Lintian warning (warning: macro `N' not defined)
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/h/heirloom-mailx/heirloom-mailx_12.5-5.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+---
+ mailx.1 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mailx.1 b/mailx.1
+index a02e430..b0723bd 100644
+--- a/mailx.1
++++ b/mailx.1
+@@ -3781,7 +3781,7 @@ you could examine the first message by giving the command:
+ .sp
+ .fi
+ which might cause
+-.N mailx
++.I mailx
+ to respond with, for example:
+ .nf
+ .sp
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0011-outof-Introduce-expandaddr-flag.patch b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0011-outof-Introduce-expandaddr-flag.patch
new file mode 100644
index 000000000..13b955c4b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0011-outof-Introduce-expandaddr-flag.patch
@@ -0,0 +1,71 @@
+From 9984ae5cb0ea0d61df1612b06952a61323c083d9 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Mon, 17 Nov 2014 11:13:38 +0100
+Subject: [PATCH 1/4] outof: Introduce expandaddr flag
+
+Document that address expansion is disabled unless the expandaddr
+binary option is set.
+
+This has been assigned CVE-2014-7844 for BSD mailx, but it is not
+a vulnerability in Heirloom mailx because this feature was documented.
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/h/heirloom-mailx/heirloom-mailx_12.5-5.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+CVE: CVE-2014-7844
+---
+ mailx.1 | 14 ++++++++++++++
+ names.c | 3 +++
+ 2 files changed, 17 insertions(+)
+
+diff --git a/mailx.1 b/mailx.1
+index 70a7859..22a171b 100644
+--- a/mailx.1
++++ b/mailx.1
+@@ -656,6 +656,14 @@ but any reply returned to the machine
+ will have the system wide alias expanded
+ as all mail goes through sendmail.
+ .SS "Recipient address specifications"
++If the
++.I expandaddr
++option is not set (the default), recipient addresses must be names of
++local mailboxes or Internet mail addresses.
++.PP
++If the
++.I expandaddr
++option is set, the following rules apply:
+ When an address is used to name a recipient
+ (in any of To, Cc, or Bcc),
+ names of local mail folders
+@@ -2391,6 +2399,12 @@ and exits immediately.
+ If this option is set,
+ \fImailx\fR starts even with an empty mailbox.
+ .TP
++.B expandaddr
++Causes
++.I mailx
++to expand message recipient addresses, as explained in the section,
++Recipient address specifications.
++.TP
+ .B flipr
+ Exchanges the
+ .I Respond
+diff --git a/names.c b/names.c
+index 66e976b..c69560f 100644
+--- a/names.c
++++ b/names.c
+@@ -268,6 +268,9 @@ outof(struct name *names, FILE *fo, struct header *hp)
+ FILE *fout, *fin;
+ int ispipe;
+
++ if (value("expandaddr") == NULL)
++ return names;
++
+ top = names;
+ np = names;
+ time(&now);
+--
+1.9.3
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0012-unpack-Disable-option-processing-for-email-addresses.patch b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0012-unpack-Disable-option-processing-for-email-addresses.patch
new file mode 100644
index 000000000..8cdbfd8b0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0012-unpack-Disable-option-processing-for-email-addresses.patch
@@ -0,0 +1,79 @@
+From e34e2ac67b80497080ebecccec40c3b61456167d Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Mon, 17 Nov 2014 11:14:06 +0100
+Subject: [PATCH 2/4] unpack: Disable option processing for email addresses
+ when calling sendmail
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/h/heirloom-mailx/heirloom-mailx_12.5-5.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+---
+ extern.h | 2 +-
+ names.c | 8 ++++++--
+ sendout.c | 2 +-
+ 3 files changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/extern.h b/extern.h
+index 6b85ba0..8873fe8 100644
+--- a/extern.h
++++ b/extern.h
+@@ -396,7 +396,7 @@ struct name *outof(struct name *names, FILE *fo, struct header *hp);
+ int is_fileaddr(char *name);
+ struct name *usermap(struct name *names);
+ struct name *cat(struct name *n1, struct name *n2);
+-char **unpack(struct name *np);
++char **unpack(struct name *smopts, struct name *np);
+ struct name *elide(struct name *names);
+ int count(struct name *np);
+ struct name *delete_alternates(struct name *np);
+diff --git a/names.c b/names.c
+index c69560f..45bbaed 100644
+--- a/names.c
++++ b/names.c
+@@ -549,7 +549,7 @@ cat(struct name *n1, struct name *n2)
+ * Return an error if the name list won't fit.
+ */
+ char **
+-unpack(struct name *np)
++unpack(struct name *smopts, struct name *np)
+ {
+ char **ap, **top;
+ struct name *n;
+@@ -564,7 +564,7 @@ unpack(struct name *np)
+ * the terminating 0 pointer. Additional spots may be needed
+ * to pass along -f to the host mailer.
+ */
+- extra = 2;
++ extra = 3 + count(smopts);
+ extra++;
+ metoo = value("metoo") != NULL;
+ if (metoo)
+@@ -581,6 +581,10 @@ unpack(struct name *np)
+ *ap++ = "-m";
+ if (verbose)
+ *ap++ = "-v";
++ for (; smopts != NULL; smopts = smopts->n_flink)
++ if ((smopts->n_type & GDEL) == 0)
++ *ap++ = smopts->n_name;
++ *ap++ = "--";
+ for (; n != NULL; n = n->n_flink)
+ if ((n->n_type & GDEL) == 0)
+ *ap++ = n->n_name;
+diff --git a/sendout.c b/sendout.c
+index 7b7f2eb..c52f15d 100644
+--- a/sendout.c
++++ b/sendout.c
+@@ -835,7 +835,7 @@ start_mta(struct name *to, struct name *mailargs, FILE *input,
+ #endif /* HAVE_SOCKETS */
+
+ if ((smtp = value("smtp")) == NULL) {
+- args = unpack(cat(mailargs, to));
++ args = unpack(mailargs, to);
+ if (debug || value("debug")) {
+ printf(catgets(catd, CATSET, 181,
+ "Sendmail arguments:"));
+--
+1.9.3
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0013-fio.c-Unconditionally-require-wordexp-support.patch b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0013-fio.c-Unconditionally-require-wordexp-support.patch
new file mode 100644
index 000000000..5558d8639
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0013-fio.c-Unconditionally-require-wordexp-support.patch
@@ -0,0 +1,113 @@
+From 2bae8ecf04ec2ba6bb9f0af5b80485dd0edb427d Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Mon, 17 Nov 2014 12:48:25 +0100
+Subject: [PATCH 3/4] fio.c: Unconditionally require wordexp support
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/h/heirloom-mailx/heirloom-mailx_12.5-5.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+---
+ fio.c | 67 +++++--------------------------------------------------------------
+ 1 file changed, 5 insertions(+), 62 deletions(-)
+
+diff --git a/fio.c b/fio.c
+index 65e8f10..1529236 100644
+--- a/fio.c
++++ b/fio.c
+@@ -43,12 +43,15 @@ static char sccsid[] = "@(#)fio.c 2.76 (gritter) 9/16/09";
+ #endif /* not lint */
+
+ #include "rcv.h"
++
++#ifndef HAVE_WORDEXP
++#error wordexp support is required
++#endif
++
+ #include <sys/stat.h>
+ #include <sys/file.h>
+ #include <sys/wait.h>
+-#ifdef HAVE_WORDEXP
+ #include <wordexp.h>
+-#endif /* HAVE_WORDEXP */
+ #include <unistd.h>
+
+ #if defined (USE_NSS)
+@@ -481,7 +484,6 @@ next:
+ static char *
+ globname(char *name)
+ {
+-#ifdef HAVE_WORDEXP
+ wordexp_t we;
+ char *cp;
+ sigset_t nset;
+@@ -527,65 +529,6 @@ globname(char *name)
+ }
+ wordfree(&we);
+ return cp;
+-#else /* !HAVE_WORDEXP */
+- char xname[PATHSIZE];
+- char cmdbuf[PATHSIZE]; /* also used for file names */
+- int pid, l;
+- char *cp, *shell;
+- int pivec[2];
+- extern int wait_status;
+- struct stat sbuf;
+-
+- if (pipe(pivec) < 0) {
+- perror("pipe");
+- return name;
+- }
+- snprintf(cmdbuf, sizeof cmdbuf, "echo %s", name);
+- if ((shell = value("SHELL")) == NULL)
+- shell = SHELL;
+- pid = start_command(shell, 0, -1, pivec[1], "-c", cmdbuf, NULL);
+- if (pid < 0) {
+- close(pivec[0]);
+- close(pivec[1]);
+- return NULL;
+- }
+- close(pivec[1]);
+-again:
+- l = read(pivec[0], xname, sizeof xname);
+- if (l < 0) {
+- if (errno == EINTR)
+- goto again;
+- perror("read");
+- close(pivec[0]);
+- return NULL;
+- }
+- close(pivec[0]);
+- if (wait_child(pid) < 0 && WTERMSIG(wait_status) != SIGPIPE) {
+- fprintf(stderr, catgets(catd, CATSET, 81,
+- "\"%s\": Expansion failed.\n"), name);
+- return NULL;
+- }
+- if (l == 0) {
+- fprintf(stderr, catgets(catd, CATSET, 82,
+- "\"%s\": No match.\n"), name);
+- return NULL;
+- }
+- if (l == sizeof xname) {
+- fprintf(stderr, catgets(catd, CATSET, 83,
+- "\"%s\": Expansion buffer overflow.\n"), name);
+- return NULL;
+- }
+- xname[l] = 0;
+- for (cp = &xname[l-1]; *cp == '\n' && cp > xname; cp--)
+- ;
+- cp[1] = '\0';
+- if (strchr(xname, ' ') && stat(xname, &sbuf) < 0) {
+- fprintf(stderr, catgets(catd, CATSET, 84,
+- "\"%s\": Ambiguous.\n"), name);
+- return NULL;
+- }
+- return savestr(xname);
+-#endif /* !HAVE_WORDEXP */
+ }
+
+ /*
+--
+1.9.3
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0014-globname-Invoke-wordexp-with-WRDE_NOCMD.patch b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0014-globname-Invoke-wordexp-with-WRDE_NOCMD.patch
new file mode 100644
index 000000000..ae14b8acf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0014-globname-Invoke-wordexp-with-WRDE_NOCMD.patch
@@ -0,0 +1,31 @@
+From 73fefa0c1ac70043ec84f2d8b8f9f683213f168d Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Mon, 17 Nov 2014 13:11:32 +0100
+Subject: [PATCH 4/4] globname: Invoke wordexp with WRDE_NOCMD (CVE-2004-2771)
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/h/heirloom-mailx/heirloom-mailx_12.5-5.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+CVE: CVE-2004-2771
+---
+ fio.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/fio.c b/fio.c
+index 1529236..774a204 100644
+--- a/fio.c
++++ b/fio.c
+@@ -497,7 +497,7 @@ globname(char *name)
+ sigemptyset(&nset);
+ sigaddset(&nset, SIGCHLD);
+ sigprocmask(SIG_BLOCK, &nset, NULL);
+- i = wordexp(name, &we, 0);
++ i = wordexp(name, &we, WRDE_NOCMD);
+ sigprocmask(SIG_UNBLOCK, &nset, NULL);
+ switch (i) {
+ case 0:
+--
+1.9.3
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0015-usr-sbin-sendmail.patch b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0015-usr-sbin-sendmail.patch
new file mode 100644
index 000000000..2b5991425
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0015-usr-sbin-sendmail.patch
@@ -0,0 +1,38 @@
+Description: Sendmail is at /usr/sbin/sendmail
+ As per Debian Policy §11.6
+Author: Ryan Kavanagh <rak@debian.org>
+Origin: Debian
+Forwarded: no
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: heirloom-mailx-12.5/Makefile
+===================================================================
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/h/heirloom-mailx/heirloom-mailx_12.5-5.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+
+--- heirloom-mailx-12.5.orig/Makefile 2011-04-26 17:23:22.000000000 -0400
++++ heirloom-mailx-12.5/Makefile 2015-01-27 13:20:04.733542801 -0500
+@@ -13,7 +13,7 @@
+
+ MAILRC = $(SYSCONFDIR)/nail.rc
+ MAILSPOOL = /var/mail
+-SENDMAIL = /usr/lib/sendmail
++SENDMAIL = /usr/sbin/sendmail
+
+ DESTDIR =
+
+Index: heirloom-mailx-12.5/mailx.1
+===================================================================
+--- heirloom-mailx-12.5.orig/mailx.1 2015-01-27 13:18:49.000000000 -0500
++++ heirloom-mailx-12.5/mailx.1 2015-01-27 13:20:32.382336867 -0500
+@@ -4922,7 +4922,7 @@
+ which just acts as a proxy.
+ .PP
+ \fIMailx\fR immediately contacts the SMTP server (or
+-.IR \%/usr/lib/sendmail )
++.IR \%/usr/sbin/sendmail )
+ even when operating in
+ .I disconnected
+ mode.
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mailx/files/explicitly.disable.krb5.support.patch b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/explicitly.disable.krb5.support.patch
new file mode 100644
index 000000000..b74fd0472
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/explicitly.disable.krb5.support.patch
@@ -0,0 +1,46 @@
+krb5 support is autodetected from sysroot making builds undeterministic
+feel free to improve this to support explicitly enabling/disabling it
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+--- a/makeconfig 2013-07-21 15:06:11.177792334 +0200
++++ b/makeconfig 2013-07-21 15:07:20.028793994 +0200
+@@ -424,36 +424,6 @@
+ }
+ !
+
+-<$tmp2.c link_check gssapi 'for GSSAPI in libgss' \
+- '#define USE_GSSAPI' '-lgss' ||
+- <$tmp2.c link_check gssapi 'for GSSAPI in libgssapi_krb5' \
+- '#define USE_GSSAPI' '-lgssapi_krb5' ||
+- link_check gssapi 'for GSSAPI in libgssapi_krb5, old-style' \
+- '#define USE_GSSAPI
+-#define GSSAPI_OLD_STYLE' '-lgssapi_krb5' <<\! || \
+- link_check gssapi 'for GSSAPI in libgssapi' \
+- '#define USE_GSSAPI
+-#define GSSAPI_REG_INCLUDE' '-lgssapi' <<\%
+-#include <gssapi/gssapi.h>
+-#include <gssapi/gssapi_generic.h>
+-
+-int main(void)
+-{
+- gss_import_name(0, 0, gss_nt_service_name, 0);
+- gss_init_sec_context(0,0,0,0,0,0,0,0,0,0,0,0,0);
+- return 0;
+-}
+-!
+-#include <gssapi.h>
+-
+-int main(void)
+-{
+- gss_import_name(0, 0, GSS_C_NT_HOSTBASED_SERVICE, 0);
+- gss_init_sec_context(0,0,0,0,0,0,0,0,0,0,0,0,0);
+- return 0;
+-}
+-%
+-
+ cat >$tmp2.c <<\!
+ #include "config.h"
+ #ifdef HAVE_NL_LANGINFO
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mailx/mailx_12.5-5.bb b/import-layers/yocto-poky/meta/recipes-extended/mailx/mailx_12.5-5.bb
new file mode 100644
index 000000000..4a32d2f68
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mailx/mailx_12.5-5.bb
@@ -0,0 +1,52 @@
+SUMMARY = "mailx is the traditional command-line-mode mail user agent"
+
+DESCRIPTION = "Mailx is derived from Berkeley Mail and is intended provide the \
+functionality of the POSIX mailx command with additional support \
+for MIME, IMAP, POP3, SMTP, and S/MIME."
+
+HOMEPAGE = "http://heirloom.sourceforge.net/mailx.html"
+SECTION = "console/network"
+LICENSE = "BSD & MPL-1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4202a0a62910cf94f7af8a3436a2a2dd"
+
+DEPENDS = "openssl"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/h/heirloom-mailx/heirloom-mailx_12.5.orig.tar.gz;name=archive \
+ file://0001-Don-t-reuse-weak-symbol-optopt-to-fix-FTBFS-on-mips.patch \
+ file://0002-Patched-out-SSL2-support-since-it-is-no-longer-suppo.patch \
+ file://0003-Fixed-Lintian-warning-warning-macro-N-not-defined.patch \
+ file://0011-outof-Introduce-expandaddr-flag.patch \
+ file://0012-unpack-Disable-option-processing-for-email-addresses.patch \
+ file://0013-fio.c-Unconditionally-require-wordexp-support.patch \
+ file://0014-globname-Invoke-wordexp-with-WRDE_NOCMD.patch \
+ file://0015-usr-sbin-sendmail.patch \
+ file://explicitly.disable.krb5.support.patch \
+ "
+
+SRC_URI[archive.md5sum] = "29a6033ef1412824d02eb9d9213cb1f2"
+SRC_URI[archive.sha256sum] = "015ba4209135867f37a0245d22235a392b8bbed956913286b887c2e2a9a421ad"
+
+# 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}/heirloom-mailx-12.5"
+
+inherit autotools-brokensep
+
+CFLAGS_append = " -D_BSD_SOURCE -DDEBIAN -I${S}/EXT"
+
+# "STRIP=true" means that 'true' command will be used to 'strip' files which will achieve the effect of not stripping them
+# mailx's Makefile doesn't allow a more straightforward way to avoid stripping
+EXTRA_OEMAKE = "SENDMAIL=${sbindir}/sendmail IPv6=-DHAVE_IPv6_FUNCS PREFIX=/usr UCBINSTALL=/usr/bin/install STRIP=true"
+
+# The makeconfig can't run parallelly, otherwise the checking results
+# might be incorrect and lead to errors:
+# fio.c:56:17: fatal error: ssl.h: No such file or directory
+# #include <ssl.h>
+PARALLEL_MAKE = ""
+
+# Causes gcc to get stuck and eat all available memory in qemuarm builds
+# http://errors.yoctoproject.org/Errors/Details/20488/
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man-pages/man-pages_4.04.bb b/import-layers/yocto-poky/meta/recipes-extended/man-pages/man-pages_4.04.bb
new file mode 100644
index 000000000..65df0aad3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man-pages/man-pages_4.04.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=8f2a3d43057d458e5066714980567a60"
+SRC_URI = "${KERNELORG_MIRROR}/linux/docs/${BPN}/Archive/${BP}.tar.gz"
+
+SRC_URI[md5sum] = "901cd52e0ee2a9d7508ae1ab15d5e835"
+SRC_URI[sha256sum] = "bff072462baea8d1b8e4568759324c5ed6c760716fe830bca71129cc09e00668"
+
+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/import-layers/yocto-poky/meta/recipes-extended/man/man/configure_sed.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/configure_sed.patch
new file mode 100644
index 000000000..d49e6831d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/configure_sed.patch
@@ -0,0 +1,32 @@
+man: replace ',' with '#'
+
+Sometimes, the parameters of CC/BUILD_CC contains the ',', which
+cause the sed command failed, so replace the ',' with '#'
+
+Upstream-Status: Pending
+
+Signed-off-by: Yue Tao <Yue.Tao@windriver.com>
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ configure | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index 9f62cf9..9a565ae 100755
+--- a/configure
++++ b/configure
+@@ -1321,9 +1321,9 @@ do
+ echo "Creating $infile from $infile.in"
+ sed -e '
+ s,@version@,$version,
+-s,@CC@,$CC,
++s#@CC@#$CC#
+ s,@EXEEXT@,$EXEEXT,
+-s,@BUILD_CC@,$BUILD_CC,
++s#@BUILD_CC@#$BUILD_CC#
+ s,@INSTALL@,$INSTALL,
+ s,@DEFS@,$DEFS,
+ s,@LIBS@,$LIBS,
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5g-nonrootbuild.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5g-nonrootbuild.patch
new file mode 100644
index 000000000..6f834bd01
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5g-nonrootbuild.patch
@@ -0,0 +1,16 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+diff -u -r man-1.5g.old/configure man-1.5g/configure
+--- man-1.5g.old/configure Wed Apr 7 04:16:05 1999
++++ man-1.5g/configure Mon May 15 15:22:44 2000
+@@ -791,7 +791,7 @@
+ read mode
+ if test "$mode" != ""; then man_mode=$mode; fi
+ fi
+- man_install_flags="-m $man_mode -o $man_user -g $man_group"
++ man_install_flags=""
+ fi
+
+ # What sections do we anticipate?
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5h1-gencat.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5h1-gencat.patch
new file mode 100644
index 000000000..044b14c50
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5h1-gencat.patch
@@ -0,0 +1,14 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- gencat/genlib.c 2006-08-02 20:11:44.000000000 +0200
++++ gencat/genlib.c.oden 2008-12-21 19:18:50.000000000 +0100
+@@ -47,6 +47,7 @@ up-to-date. Many thanks.
+ 01/14/91 4 nazgul Off by one on number specified entries
+ */
+
++#undef _GNU_SOURCE
+ #include <stdio.h>
+ #include <stdlib.h>
+ #ifdef SYSV
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5h1-make.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5h1-make.patch
new file mode 100644
index 000000000..8631eb2c5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5h1-make.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.5g/man/Makefile.in.mike Fri Apr 9 13:35:54 1999
++++ man-1.5g/man/Makefile.in Fri Apr 9 13:36:45 1999
+@@ -1,8 +1,8 @@
+ # only executed from a subdir
+ MAN1 = man whatis apropos
+-MAN5 = man.conf
++MAN5 = man.config
+ MAN8 = makewhatis
+-ALL = man.1 whatis.1 apropos.1 man.conf.5
++ALL = man.1 whatis.1 apropos.1 man.config.5
+ MAYBE8 = makewhatis
+
+ .SUFFIXES: .man .1 .5 .8
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5i2-initial.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5i2-initial.patch
new file mode 100644
index 000000000..fe56c0706
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5i2-initial.patch
@@ -0,0 +1,19 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.5i2/src/makewhatis.sh.initial Tue Jul 3 15:38:39 2001
++++ man-1.5i2/src/makewhatis.sh Tue Jul 3 15:39:39 2001
+@@ -81,8 +81,10 @@
+ continue;;
+ -s) setsections=1
+ continue;;
+- -u) findarg="-newer /var/cache/man/whatis"
+- update=1
++ -u) if [ -e /var/cache/man/whatis ]; then
++ findarg="-newer /var/cache/man/whatis"
++ update=1
++ fi
+ continue;;
+ -v) verbose=1
+ continue;;
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5i2-newline.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5i2-newline.patch
new file mode 100644
index 000000000..611df5d25
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5i2-newline.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- src/man.c 2008-12-21 19:17:31.000000000 +0100
++++ src/man.c.oden 2008-12-21 19:17:38.000000000 +0100
+@@ -391,7 +391,7 @@ again:
+ beg++;
+
+ end = beg;
+- while (*end != ' ' && *end != '\t' && *end != '\n' && *end != '\0')
++ while (*end != ' ' && *end != '\t' && *end != '\n' && *end != '\0' && (end-buf)<BUFSIZE)
+ end++; /* note that buf is NUL-terminated */
+ *end = '\0';
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5i2-overflow.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5i2-overflow.patch
new file mode 100644
index 000000000..52d2881a8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5i2-overflow.patch
@@ -0,0 +1,16 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.5i2/src/man.c.overflow Mon Jun 25 00:01:45 2001
++++ man-1.5i2/src/man.c Mon Jun 25 00:01:45 2001
+@@ -381,6 +381,9 @@
+ strcat(name, "/");
+ strcat(name, beg);
+ }
++ /* If this is too long, bad things have already happened. *
++ * we should quit IMMEDIATELY. */
++ if(strlen(name)>sizeof(ultname)) _exit(1);
+
+ goto again;
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5j-i18n.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5j-i18n.patch
new file mode 100644
index 000000000..2ae09c0ea
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5j-i18n.patch
@@ -0,0 +1,16 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.5j/msgs/inst.sh.i18n Wed Apr 25 10:40:50 2001
++++ man-1.5j/msgs/inst.sh Wed Apr 25 10:41:17 2001
+@@ -27,8 +27,7 @@
+ for j in $M; do
+ if [ -f $j ]; then
+ i=`echo $j | sed -e 's/mess.//; s/.cat//'`
+- dest=`echo $locdir | sed -e "s/%N/man/; s/%L/$i/"`
+- dest=${PREFIX}$dest
++ dest=${PREFIX}/`echo $locdir | sed -e "s/%N/man/; s/%L/$i/"`
+ echo "mkdir -p `dirname $dest`"
+ mkdir -p `dirname $dest`;
+ echo "install -c -m 644 $j $dest"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5j-nocache.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5j-nocache.patch
new file mode 100644
index 000000000..751dddd53
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5j-nocache.patch
@@ -0,0 +1,16 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.5j/src/man.conf.in.nocache Thu Nov 22 15:07:12 2001
++++ man-1.5j/src/man.conf.in Thu Nov 22 15:07:12 2001
+@@ -81,6 +81,9 @@
+ #
+ #NOCACHE
+ #
++# NOCACHE keeps man from creating cache pages
++NOCACHE
++#
+ # Useful paths - note that COL should not be defined when
+ # NROFF is defined as "groff -Tascii" or "groff -Tlatin1";
+ # not only is it superfluous, but it actually damages the output.
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5j-utf8.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5j-utf8.patch
new file mode 100644
index 000000000..33d3e4c97
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5j-utf8.patch
@@ -0,0 +1,61 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.5j/configure.utf8 Thu Nov 22 15:02:35 2001
++++ man-1.5j/configure Thu Nov 22 15:03:15 2001
+@@ -408,9 +408,9 @@
+ Fgawk=/bin/gawk
+ Fawk=/bin/gawk
+ Fmawk=missing
+- troff=""
+- nroff=""
+- jnroff=""
++ troff=/usr/bin/troff
++ nroff=/usr/bin/nroff
++ jnroff=/usr/bin/nroff
+ eqn=""
+ neqn=""
+ jneqn=""
+@@ -453,6 +453,8 @@
+ done
+ done
+ Fgroff=/usr/bin/groff
++ Fnroff=/usr/bin/nroff
++ Fjnroff=/usr/bin/nroff
+ Fgeqn=/usr/bin/geqn
+ Fgtbl=/usr/bin/gtbl
+ Fcol=/usr/bin/col
+@@ -485,25 +487,25 @@
+ then
+ if test $Fnroff = "missing"
+ then
+- nroff="nroff -Tlatin1 -mandoc"
++ nroff="nroff -Tutf8 -mandoc"
+ else
+- nroff="$Fnroff -Tlatin1 -mandoc"
++ nroff="$Fnroff -Tutf8 -mandoc"
+ fi
+ troff="troff -mandoc"
+ echo "Warning: could not find groff"
+ else
+ if test $Fnroff = "missing"
+ then
+- nroff="$Fgroff -Tlatin1 -mandoc"
++ nroff="$Fgroff -Tutf8 -mandoc"
+ else
+- nroff="$Fnroff -Tlatin1 -mandoc"
++ nroff="$Fnroff -Tutf8 -mandoc"
+ fi
+ troff="$Fgroff -Tps -mandoc"
+- jnroff="$Fgroff -Tnippon -mandocj"
++ jnroff="$Fjnroff -Tutf8 -mandocj"
+ fi
+ eqn="$Fgeqn -Tps"
+- neqn="$Fgeqn -Tlatin1"
+- jneqn="$Fgeqn -Tnippon"
++ neqn="$Fgeqn -Tutf8"
++ jneqn="$Fgeqn -Tutf8"
+ tbl="$Fgtbl"
+ col="$Fcol"
+ vgrind="$Fvgrind"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5k-confpath.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5k-confpath.patch
new file mode 100644
index 000000000..b5746c2df
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5k-confpath.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- configure 2006-05-01 19:56:14.000000000 +0200
++++ configure.oden 2008-12-21 19:16:50.000000000 +0100
+@@ -198,7 +198,7 @@
+ confdir="${confprefix}/share/misc"
+ fi
+ fi
+-conffilename="man.conf"
++conffilename="man.config"
+
+ if test "$RANDOM" = "$RANDOM"; then
+ # Plain old Bourne shell.
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5k-nonascii.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5k-nonascii.patch
new file mode 100644
index 000000000..d662d9b6a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5k-nonascii.patch
@@ -0,0 +1,18 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- ./src/apropos.sh.nonascii 2001-11-23 00:30:42.000000000 +0100
++++ ./src/apropos.sh 2002-08-13 15:44:53.000000000 +0200
+@@ -18,9 +18,9 @@
+
+ # When man pages in your favorite locale look to grep like binary files
+ # (and you use GNU grep) you may want to add the 'a' option to *grepopt1.
+-aproposgrepopt1='i'
++aproposgrepopt1='ia'
+ aproposgrepopt2=''
+-whatisgrepopt1='iw'
++whatisgrepopt1='iwa'
+ whatisgrepopt2='^'
+ grepopt1=$%apropos_or_whatis%grepopt1
+ grepopt2=$%apropos_or_whatis%grepopt2
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5k-sofix.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5k-sofix.patch
new file mode 100644
index 000000000..50b925288
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5k-sofix.patch
@@ -0,0 +1,24 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.5j/src/man.c.sofix Thu Nov 22 14:51:44 2001
++++ man-1.5j/src/man.c Thu Nov 22 14:52:44 2001
+@@ -300,7 +300,7 @@
+
+ if (strlen(name0) >= sizeof(ultname))
+ return name0;
+- strcpy(ultname, name0);
++ strncpy(ultname, name0, BUFSIZE-32);
+ name = ultname;
+
+ again:
+@@ -332,7 +332,7 @@
+ * .so files - we could glob for all possible extensions,
+ * for now: only try .gz
+ */
+- else if (fp == NULL && get_expander(".gz") &&
++ if (fp == NULL && get_expander(".gz") &&
+ strlen(name)+strlen(".gz") < BUFSIZE) {
+ strcat(name, ".gz");
+ fp = fopen (name, "r");
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-bug11621.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-bug11621.patch
new file mode 100644
index 000000000..051299906
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-bug11621.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- ./configure.ad 2003-12-11 19:17:10.000000000 +0100
++++ ./configure 2003-12-11 19:17:27.000000000 +0100
+@@ -26,7 +26,7 @@
+ # (Indeed, -r may cause the terminal to get into funny states.
+ # Very inconvenient. For viewing pages in strange locales, set LC_*.)
+ #
+-DEFAULTLESSOPT="-is"
++DEFAULTLESSOPT="-isr"
+ #
+ # Note that not creating any cat directories (/var/cache/man or so)
+ # and not making man suid or sgid is recommended.
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-buildroot.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-buildroot.patch
new file mode 100644
index 000000000..bc97f56b9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-buildroot.patch
@@ -0,0 +1,52 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- ./configure.less 2003-12-11 19:18:15.000000000 +0100
++++ ./configure 2003-12-11 19:20:03.000000000 +0100
+@@ -401,18 +401,13 @@
+
+ if test "$ans" = "false"
+ then
+- for i in more less cmp cat awk gawk mawk
+- do
+- eval F$i="missing"
+- for j in $DEFPATH
+- do
+- if test -f $j/$i
+- then
+- eval F$i=$j/$i
+- break
+- fi
+- done
+- done
++ Fmore=/bin/more
++ Fless=/usr/bin/less
++ Fcmp=/usr/bin/cmp
++ Fcat=/bin/cat
++ Fgawk=/bin/gawk
++ Fawk=/bin/gawk
++ Fmawk=missing
+ troff=""
+ nroff=""
+ jnroff=""
+@@ -457,6 +452,19 @@
+ fi
+ done
+ done
++ Fgroff=/usr/bin/groff
++ Fgeqn=/usr/bin/geqn
++ Fgtbl=/usr/bin/gtbl
++ Fcol=/usr/bin/col
++ Fgrefer=/usr/bin/grefer
++ Fgpic=/usr/bin/gpic
++ Fmore=/bin/more
++ Fless=/usr/bin/less
++ Fcmp=/usr/bin/cmp
++ Fcat=/bin/cat
++ Fgawk=/bin/gawk
++
++
+ for i in eqn tbl refer pic
+ do
+ if test `eval echo \\$Fg$i` = "missing"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-no-color-for-printing.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-no-color-for-printing.patch
new file mode 100644
index 000000000..c85ff1d8c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-no-color-for-printing.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.5m2/configure.color 2006-09-16 18:27:37.000000000 +0200
++++ man-1.5m2/configure 2006-09-16 18:28:44.000000000 +0200
+@@ -539,6 +539,8 @@
+ troff="$troff -c"
+ nroff="$nroff -c"
+ jnroff="$jnroff -c"
++else
++ troff="$troff -c"
+ fi
+
+ if [ x$default = x ]; then
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-sigpipe.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-sigpipe.patch
new file mode 100644
index 000000000..8af78eab7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-sigpipe.patch
@@ -0,0 +1,30 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.5m2/src/util.c_sigpipe 2006-12-09 13:43:21.000000000 +0100
++++ man-1.5m2/src/util.c 2006-12-09 13:53:13.000000000 +0100
+@@ -116,11 +116,14 @@
+ static int
+ system1 (const char *command) {
+ void (*prev_handler)(int) = signal (SIGINT,catch_int);
++ signal (SIGPIPE,SIG_IGN);
+ int ret = system(command);
+
+ /* child terminated with signal? */
+ if (WIFSIGNALED(ret) &&
+- (WTERMSIG(ret) == SIGINT || WTERMSIG(ret) == SIGQUIT))
++ (WTERMSIG(ret) == SIGINT ||
++ WTERMSIG(ret) == SIGPIPE ||
++ WTERMSIG(ret) == SIGQUIT))
+ exit(1);
+
+ /* or we caught an interrupt? */
+@@ -128,6 +131,7 @@
+ exit(1);
+
+ signal(SIGINT,prev_handler);
++ signal(SIGPIPE,SIG_DFL);
+ return ret;
+ }
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-i18n_whatis.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-i18n_whatis.patch
new file mode 100644
index 000000000..e321325d6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-i18n_whatis.patch
@@ -0,0 +1,145 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+diff -Naur man-1.6e.orig/src/apropos.sh man-1.6e/src/apropos.sh
+--- man-1.6e.orig/src/apropos.sh 2007-05-18 13:49:31.000000000 -0300
++++ man-1.6e/src/apropos.sh 2007-05-18 14:24:33.000000000 -0300
+@@ -60,16 +60,56 @@
+ esac
+ done
+
++# list of languages to look for
++LANG_LIST=`echo $LANGUAGE:$LC_ALL:$LC_MESSAGES:$LANG | tr ':' ' '`
++DIR_LIST=""
++for d in /var/cache/man $manpath /usr/lib
++do
++ for l in $LANG_LIST
++ do
++ if [ -d $d/$l ]
++ then
++ # check that the path is not already in the list
++ if ! echo "$DIR_LIST" | grep " $d/$l\b" > /dev/null
++ then
++ DIR_LIST="$DIR_LIST $d/$l"
++ fi
++ fi
++ done
++ DIR_LIST="$DIR_LIST $d"
++ # check that the path is not already in the list
++ if ! echo "$DIR_LIST" | grep " $d\b" > /dev/null
++ then
++ DIR_LIST="$DIR_LIST $d/$l"
++ fi
++done
++
+ while [ "$1" != "" ]
+ do
+ found=0
+- for d in /var/cache/man $manpath /usr/lib
++ # in order not to display lines in more than one language for
++ # a same man page; we check that a given man page name
++ # hasn't already been displayed
++ BAZ=""
++ for d in $DIR_LIST
+ do
+ if [ -f $d/whatis ]
+ then
+- if grep -"$grepopt1" "$grepopt2""$1" $d/whatis
++ if FOO=`grep -"$grepopt1" "$grepopt2""$1" $d/whatis`
+ then
+- found=1
++ # the LC_ALL=C is needed in case the text is
++ # in a different encoding than the locale
++ BAR=`echo -e "$FOO" | LC_ALL=C sed 's/ - .*$//' | tr ' []' '_' | sort -u`
++ for i in $BAR
++ do
++ if ! echo "$BAZ" | grep "$i" > /dev/null
++ then
++ BAZ="$BAZ $i"
++ i="^`echo $i | sed 's:_\+:\\\(\[_ \]\\\|\\\[\\\|\\\]\\\)\\\+:g'`"
++ echo -e "$FOO" | grep "$i"
++ found=1
++ fi
++ done
+ # Some people are satisfied with a single occurrence
+ # But it is better to give all
+ # break
+diff -Naur man-1.6e.orig/src/makewhatis.sh man-1.6e/src/makewhatis.sh
+--- man-1.6e.orig/src/makewhatis.sh 2007-05-18 13:49:31.000000000 -0300
++++ man-1.6e/src/makewhatis.sh 2007-05-18 13:50:07.000000000 -0300
+@@ -41,12 +41,32 @@
+
+ program=`basename $0`
+
++# this allows to define language specific values fro NAME, DESCRIPTION
++# if not defined, using those default values
++if [ -z "$MAN_NAME" ]
++then
++ MAN_NAME="ĐМЕ|NOM|JMÉNO|NAVN|ΟΝΟΜΑ|NOMBRE|NIME|IZENA|NIMI|IME|\
++NÉV|NOME|ĺŤĺ‰Ť|이름|NAAM|NAZWA|NUME|ĐМЯ|MENO|ĐťĐĐ—Đ’Đ|ĺŤç§°|ĺŤç¨±"
++fi
++if [ -z "$MAN_DESCRIPTION" ]
++then
++ MAN_DESCRIPTION="ОПĐСĐĐťĐĐ•|DESCRIPCIĂ“|POPIS|BESKRIVELSE|BESCHREIBUNG|\
++ΠΕΡΙΓΡΑΦΗ|DESCRIPCIĂ“N|KIRJELDUS|AZALPENA|KUVAUS|OPIS|LEĂŤRĂS|DESCRIZIONE|\
++説ćŽ|설명|BESCHRIJVING|DESCRIÇĂO|DESCRIERE|ОПĐС|描述"
++fi
++# make them into awk regexp
++MAN_NAME="^(${MAN_NAME})";
++MAN_DESCRIPTION="^(${MAN_DESCRIPTION})";
++
+ # In case both /usr/man and /usr/share/man exist, the former is local
+ # and should be first.
+ # It is a bug to add /var/cache/man to DEFCATPATH.
+ dm=
+ for d in /usr/share/man /usr/man /usr/X11R6/man /usr/local/man
+ do
++ if [ -n "$LANG" -a -d "$d/$LANG" ]; then
++ if [ x$dm = x ]; then dm="$d/$LANG"; else dm=$dm:"$d/$LANG"; fi
++ fi
+ if [ -d $d ]; then
+ if [ x$dm = x ]; then dm=$d; else dm=$dm:$d; fi
+ fi
+@@ -55,6 +75,9 @@
+ dc=
+ for d in /var/cache/man /usr/share/man/preformat /usr/man/preformat /usr/share/man /usr/man
+ do
++ if [ -n "$LANG" -a -d "$d/$LANG" ]; then
++ if [ x$dc = x ]; then dm="$d/$LANG"; else dm=$dc:"$d/$LANG"; fi
++ fi
+ if [ -d $d ]; then
+ if [ x$dc = x ]; then dc=$d; else dc=$dc:$d; fi
+ fi
+@@ -194,7 +217,7 @@
+ section=$i
+ curdir=$mandir/${pages}$i
+ export section verbose curdir
+- find $mandir/${pages}$i/. -name '*' $findarg0 $findarg -print | $AWK '
++ find $mandir/${pages}$i/. -name '*' $findarg0 $findarg -print | LC_ALL=C $AWK -v MAN_NAME="$MAN_NAME" -v MAN_DESCRIPTION="$MAN_DESCRIPTION" '
+
+ function readline() {
+ if (use_zcat || use_bzcat) {
+@@ -261,13 +284,7 @@
+ gsub(/.\b/, "");
+ if (($1 ~ /^\.[Ss][Hh]/ &&
+ ($2 ~ /[Nn][Aa][Mm][Ee]/ ||
+- $2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
+- $2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
+- $2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
+- $2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^ĚľÁ°/ ||
+- $2 ~ /^ĚľľÎ/ || $2 ~ /^Ŕ̸§/ || $2 ~ /^NAZWA/ ||
+- $2 ~ /^îáú÷áîéĺ/ || $2 ~ /^ĂűłĆ/ || $2 ~ /^¦WşŮ/ ||
+- $2 ~ /^NOME/ || $2 ~ /^NAAM/ || $2 ~ /^ČĚĹ/)) ||
++ $2 ~ MAN_NAME )) ||
+ (pages == "cat" && $1 ~ /^NAME/)) {
+ if (!insh) {
+ insh = 1;
+@@ -278,6 +295,7 @@
+ if ($1 ~ /^\.[Ss][HhYS]/ ||
+ (pages == "cat" &&
+ ($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
++ $1 ~ MAN_DESCRIPTION ||
+ $1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
+ $1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
+ $0 ~ /^[^ ]/))) {
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-mandirs.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-mandirs.patch
new file mode 100644
index 000000000..b240064c9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-mandirs.patch
@@ -0,0 +1,31 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.6e.orig/src/man.conf.in 2005-08-20 20:26:06.000000000 -0300
++++ man-1.6e/src/man.conf.in 2007-05-18 10:30:29.000000000 -0300
+@@ -36,11 +36,12 @@
+ #
+ # Every automatically generated MANPATH includes these fields
+ #
+-MANPATH /usr/man
+ MANPATH /usr/share/man
++MANPATH /usr/X11R6/man
+ MANPATH /usr/local/man
+ MANPATH /usr/local/share/man
+-MANPATH /usr/X11R6/man
++MANPATH /usr/kerberos/man
++MANPATH /usr/man
+ #
+ # Uncomment if you want to include one of these by default
+ #
+@@ -67,6 +68,9 @@
+ MANPATH_MAP /usr/X11R6/bin /usr/X11R6/man
+ MANPATH_MAP /usr/bin/X11 /usr/X11R6/man
+ MANPATH_MAP /usr/bin/mh /usr/share/man
++MANPATH_MAP /usr/kerberos/bin /usr/kerberos/man
++MANPATH_MAP /usr/kerberos/sbin /usr/kerberos/man
++
+ #
+ # NOAUTOPATH keeps man from automatically adding directories that look like
+ # manual page directories to the path.
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-new_sections.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-new_sections.patch
new file mode 100644
index 000000000..fb9773c64
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-new_sections.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.6e.orig/configure 2006-05-01 14:56:14.000000000 -0300
++++ man-1.6e/configure 2007-05-18 14:35:43.000000000 -0300
+@@ -960,7 +960,7 @@
+
+ # What sections do we anticipate?
+
+-tmpsections="1 1p 8 2 3 3p 4 5 6 7 9 0p tcl n l p o"
++tmpsections="1 1p 8 2 3 3p 3pm 4 5 6 7 9 0p tcl n l p o"
+
+ if [ x$default = x ]; then
+ echo ""
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-ro_usr.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-ro_usr.patch
new file mode 100644
index 000000000..1d1cb0c72
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-ro_usr.patch
@@ -0,0 +1,33 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+Index: man-1.6f/src/makewhatis.sh
+===================================================================
+--- man-1.6f.orig/src/makewhatis.sh 2010-12-29 13:42:34.000000000 -0800
++++ man-1.6f/src/makewhatis.sh 2010-12-29 13:42:35.667428347 -0800
+@@ -124,7 +124,7 @@
+ continue;;
+ -s) setsections=1
+ continue;;
+- -u) findarg="-ctime 0"
++ -u) findarg="-newer /var/cache/man/whatis"
+ update=1
+ continue;;
+ -v) verbose=1
+@@ -165,14 +165,7 @@
+ # first truncate all the whatis files that will be created new,
+ # then only update - we might visit the same directory twice
+ if [ x$update = x ]; then
+- for pages in man cat
+- do
+- eval path="\$$pages"path
+- for mandir in $path
+- do
+- cp /dev/null $mandir/whatis
+- done
+- done
++ cp /dev/null /var/cache/man/whatis
+ fi
+
+ for pages in man cat
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-security.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-security.patch
new file mode 100644
index 000000000..312a882f0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-security.patch
@@ -0,0 +1,62 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+diff -Naur man-1.6e.orig/src/makewhatis.sh man-1.6e/src/makewhatis.sh
+--- man-1.6e.orig/src/makewhatis.sh 2006-07-19 01:58:08.000000000 -0300
++++ man-1.6e/src/makewhatis.sh 2007-05-18 10:18:31.000000000 -0300
+@@ -45,7 +45,7 @@
+ # and should be first.
+ # It is a bug to add /var/cache/man to DEFCATPATH.
+ dm=
+-for d in /usr/man /usr/share/man /usr/X11R6/man /usr/local/man
++for d in /usr/share/man /usr/man /usr/X11R6/man /usr/local/man
+ do
+ if [ -d $d ]; then
+ if [ x$dm = x ]; then dm=$d; else dm=$dm:$d; fi
+@@ -53,7 +53,7 @@
+ done
+ DEFMANPATH=$dm
+ dc=
+-for d in /usr/man/preformat /usr/man /usr/share/man/preformat /usr/share/man
++for d in /var/cache/man /usr/share/man/preformat /usr/man/preformat /usr/share/man /usr/man
+ do
+ if [ -d $d ]; then
+ if [ x$dc = x ]; then dc=$d; else dc=$dc:$d; fi
+@@ -76,12 +76,12 @@
+ # We try here to be careful (and avoid preconstructed symlinks)
+ # in case makewhatis is run as root, by creating a subdirectory of /tmp.
+
+-TMPFILEDIR=/tmp/whatis.tmp.dir.$$
+-rm -rf $TMPFILEDIR
+-if ! mkdir -m 0700 $TMPFILEDIR; then
+- echo Could not create $TMPFILEDIR
+- exit 1;
++TMPFILEDIR=`mktemp -d /tmp/makewhatisXXXXXX`
++if [ $? -ne 0 ]; then
++ echo "$0: Can't create temp file, exiting..."
++ exit 1
+ fi
++chmod 0700 $TMPFILEDIR
+ TMPFILE=$TMPFILEDIR/w
+
+ # make sure TMPFILEDIR is deleted if program is killed or terminates
+diff -Naur man-1.6e.orig/src/man.c man-1.6e/src/man.c
+--- man-1.6e.orig/src/man.c 2006-05-01 17:34:22.000000000 -0300
++++ man-1.6e/src/man.c 2007-05-18 10:11:33.000000000 -0300
+@@ -1234,7 +1234,6 @@
+ #endif
+
+
+-#if 0
+ {
+ /* There are no known cases of buffer overflow caused by
+ excessively long environment variables. In case you find one,
+@@ -1257,7 +1256,6 @@
+ MAN_ICONV_PATH, MAN_ICONV_OPT, MAN_ICONV_INPUT_CHARSET,
+ MAN_ICONV_OUTPUT_CHARSET, NLSPATH, PATH */
+ }
+-#endif
+
+
+ #ifndef __FreeBSD__
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-use_i18n_vars_in_a_std_way.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-use_i18n_vars_in_a_std_way.patch
new file mode 100644
index 000000000..568f74210
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-use_i18n_vars_in_a_std_way.patch
@@ -0,0 +1,160 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+diff -Naur man-1.6e.orig/catopen/catopen.c man-1.6e/catopen/catopen.c
+--- man-1.6e.orig/catopen/catopen.c 2005-08-20 20:26:06.000000000 -0300
++++ man-1.6e/catopen/catopen.c 2007-05-18 11:31:05.000000000 -0300
+@@ -9,22 +9,63 @@
+ extern char *index (const char *, int); /* not always in <string.h> */
+ extern char *my_malloc(int); /* in util.c */
+
++/* if the program has sgid/suid privileges then getenv doesn't return
++ * NLSPATH; so we set here a good default value.
++ */
+ #ifndef DEFAULT_NLSPATH
+ # if __GLIBC__ >= 2
+-# define DEFAULT_NLSPATH "/usr/share/locale/%L/%N"
++# define DEFAULT_NLSPATH "/usr/share/locale/%L/%N:/usr/share/locale/%l_%t/%N:/usr/share/locale/%l/%N"
+ # else
+ # define DEFAULT_NLSPATH "/usr/lib/locale/%N/%L"
+ # endif
+ #endif
+
+-static nl_catd my_catopenpath(char *name, char *path);
++static nl_catd my_catopenpath(char *name, char *path, char *lang);
+
+ static /* this source included in gripes.c */
+ nl_catd
+ my_catopen(char *name, int oflag) {
+- nl_catd fd;
++ nl_catd fd = (nl_catd) -1;
++
++ /* using first the my_catopenpath, which looks with LANGUAGE
++ * and only if it fails ressort to catopen, it gives better i18n
++ */
++ {
++ char *nlspath, *lang, *s;
+
+- fd = catopen(name, oflag);
++ /*
++ * "If NLSPATH does not exist in the environment, or if a
++ * message catalog cannot be opened in any of the paths specified
++ * by NLSPATH, then an implementation defined default path is used"
++ */
++ nlspath = getenv("NLSPATH");
++ if (!nlspath)
++ nlspath = DEFAULT_NLSPATH;
++
++ lang = getenv("LANGUAGE");
++ if (!lang)
++ lang = getenv("LC_ALL");
++ if (!lang)
++ lang = getenv("LC_MESSAGES");
++ if (!lang)
++ lang = getenv("LANG");
++ if (!lang)
++ lang = "";
++
++ while(*lang && (fd == (nl_catd) -1)) {
++ s = index(lang, ':');
++ if (s) *s = 0;
++ fd = my_catopenpath(name, nlspath, lang);
++ if (s) lang=s+1;
++ else lang = "";
++ }
++ if (fd == (nl_catd) -1)
++ fd = my_catopenpath(name, nlspath, "en");
++ }
++
++ /* still not found, use the system catopen */
++ if (fd == (nl_catd) -1)
++ fd = catopen(name, oflag);
+
+ if (fd == (nl_catd) -1 && oflag) {
+ oflag = 0;
+@@ -32,8 +73,6 @@
+ }
+
+ if (fd == (nl_catd) -1) {
+- char *nlspath;
+-
+ /* The libc catopen fails - let us see if we can do better */
+ /* The quotes below are from X/Open, XPG 1987, Vol. 3. */
+
+@@ -58,17 +97,6 @@
+ #endif
+ }
+
+- /*
+- * "If NLSPATH does not exist in the environment, or if a
+- * message catalog cannot be opened in any of the paths specified
+- * by NLSPATH, then an implementation defined default path is used"
+- */
+-
+- nlspath = getenv("NLSPATH");
+- if (nlspath)
+- fd = my_catopenpath(name, nlspath);
+- if (fd == (nl_catd) -1)
+- fd = my_catopenpath(name, DEFAULT_NLSPATH);
+ }
+ return fd;
+ }
+@@ -90,15 +118,13 @@
+ *
+ */
+ static nl_catd
+-my_catopenpath(char *name, char *nlspath) {
+- int fd;
++my_catopenpath(char *name, char *nlspath, char *lang) {
+ nl_catd cfd = (nl_catd) -1;
+- char *path0, *path, *s, *file, *lang, *lang_l, *lang_t, *lang_c;
++ char *path0, *path, *s, *file, *lang_l, *lang_t, *lang_c;
+ int langsz, namesz, sz, lang_l_sz, lang_t_sz, lang_c_sz;
+
+ namesz = strlen(name);
+
+- lang = getenv("LANG");
+ if (!lang)
+ lang = "";
+ langsz = strlen(lang);
+@@ -194,14 +220,9 @@
+ path = s+1;
+ } else
+ path = 0;
+- fd = open(file, O_RDONLY);
+- if (fd != -1) {
+- /* we found the right catalog - but we don't know the
+- type of nl_catd, so close it again and ask libc */
+- close(fd);
+- cfd = catopen(file, 0);
+- break;
+- }
++ cfd = catopen(file, 0);
++ if (cfd != (nl_catd) -1)
++ break;
+ }
+
+ free(path0);
+diff -Naur man-1.6e.orig/src/manpath.c man-1.6e/src/manpath.c
+--- man-1.6e.orig/src/manpath.c 2006-08-03 18:18:33.000000000 -0300
++++ man-1.6e/src/manpath.c 2007-05-18 11:02:48.000000000 -0300
+@@ -282,13 +282,14 @@
+ /* We cannot use "lang = setlocale(LC_MESSAGES, NULL)" or so:
+ the return value of setlocale is an opaque string. */
+ /* POSIX prescribes the order: LC_ALL, LC_MESSAGES, LANG */
+- if((lang = getenv("LC_ALL")) != NULL)
++ /* LANGUAGE is GNU/Linux and overrules all */
++ if((lang = getenv("LANGUAGE")) != NULL)
+ split2(dir, lang, add_to_mandirlist_x, perrs);
+- if((lang = getenv("LC_MESSAGES")) != NULL)
++ else if((lang = getenv("LC_ALL")) != NULL)
+ split2(dir, lang, add_to_mandirlist_x, perrs);
+- if((lang = getenv("LANG")) != NULL)
++ else if((lang = getenv("LC_MESSAGES")) != NULL)
+ split2(dir, lang, add_to_mandirlist_x, perrs);
+- if((lang = getenv("LANGUAGE")) != NULL)
++ else if((lang = getenv("LANG")) != NULL)
+ split2(dir, lang, add_to_mandirlist_x, perrs);
+ add_to_mandirlist_x(dir, 0, perrs);
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-whatis2.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-whatis2.patch
new file mode 100644
index 000000000..fc4ed3135
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-whatis2.patch
@@ -0,0 +1,59 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+Index: man-1.6f/src/makewhatis.sh
+===================================================================
+--- man-1.6f.orig/src/makewhatis.sh 2010-12-29 13:51:45.000000000 -0800
++++ man-1.6f/src/makewhatis.sh 2010-12-29 13:59:35.399799412 -0800
+@@ -164,10 +164,15 @@
+ fi
+ catpath=`echo ${catpath} | tr : ' '`
+
++#WHATIS_DIR=$DESTDIR/var/cache/man/`echo $here|sed -e 's!.*/man/!!g'`
++WHATIS_DIR=$DESTDIR/var/cache/man/$LANG
++[[ -d $WHATIS_DIR ]] || mkdir -p $WHATIS_DIR/
++
+ # first truncate all the whatis files that will be created new,
+ # then only update - we might visit the same directory twice
+ if [ x$update = x ]; then
+- cp /dev/null /var/cache/man/whatis
++ mkdir -p $WHATIS_DIR/
++ /bin/echo -n > $WHATIS_DIR/whatis
+ fi
+
+ for pages in man cat
+@@ -180,13 +185,7 @@
+ echo "about to enter $mandir" > /dev/stderr
+ fi
+
+- # kludge for Slackware's /usr/man/preformat
+- if [ $mandir = /usr/man/preformat ]
+- then
+- mandir1=/usr/man
+- else
+- mandir1=$mandir
+- fi
++ mandir1=$WHATIS_DIR
+
+ # if $mandir is on a readonly partition, and the whatis file
+ # is not a symlink, then let's skip trying to update it
+@@ -207,11 +206,6 @@
+ fi
+ fi
+
+- if [ -s ${mandir}/whatis -a $pages = man -a x$update = x ]; then
+- if [ x$verbose != x ]; then
+- echo skipping $mandir - we did it already > /dev/stderr
+- fi
+- else
+ here=`pwd`
+ cd $mandir
+ for i in $sections
+@@ -447,7 +447,6 @@
+
+ chmod 644 ${mandir1}/whatis
+ rm $TMPFILE
+- fi
+ done
+ done
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-compile-warnings.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-compile-warnings.patch
new file mode 100644
index 000000000..4631d2d06
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-compile-warnings.patch
@@ -0,0 +1,105 @@
+Fix a build error when building man.config.5 (a remnant of a long
+ago previous patch). Optimized the manpages Makefile for parallel
+builds. Also, fix compile warnings in a couple other files.
+
+Upstream-Status: Pending
+
+Signed-off-by: Bill Randle <william.c.randle@intel.com>
+
+--- man-1.6g/man/Makefile.in.orig 2016-03-28 17:31:08.723949180 -0700
++++ man-1.6g/man/Makefile.in 2016-03-28 17:46:12.866910386 -0700
+@@ -5,6 +5,13 @@
+ ALL = man.1 whatis.1 apropos.1 man.config.5
+ MAYBE8 = makewhatis
+
++SUBDIRS := $(shell echo @languages@)
++
++.PHONY: subdirs $(SUBDIRS)
++
++man.config.man: man.conf.man
++ @cp $< $@
++
+ .SUFFIXES: .man .1 .5 .8
+
+ .man.1:
+@@ -19,11 +26,11 @@
+ INSTALL = @INSTALL@ -c -m 644
+
+ # Where to put the manual pages.
+-mandir = $(DESTDIR)$(PREFIX)@mandir@$(SLANG)
++mandir := $(DESTDIR)$(PREFIX)@mandir@$(SLANG)
+
+ all: $(ALL)
+ for i in $(MAYBE8); \
+- do if test -f $$i.man; then make -f ../Makefile $$i.8; fi; done
++ do if test -f $$i.man; then $(MAKE) -f ../Makefile $$i.8; fi; done
+
+ install: $(ALL)
+ mkdir -p $(mandir)/man1 $(mandir)/man5 $(mandir)/man8
+@@ -38,24 +45,27 @@
+ rm -f core *.in *.@man1ext@ *.@man5ext@ *.@man8ext@ *~
+
+ spotless:
++ rm -f man.config.man
+
+ subdirs:
+- @for i in @languages@; do if test -d $$i; then echo; \
+- echo "==== Making the `cat $$i.txt` man pages. ===="; \
+- cd $$i; make -f ../Makefile; cd ..; \
+- else echo "==== No $$i man pages found. ===="; fi; done
++subdirs: $(SUBDIRS)
++$(SUBDIRS):
++ if test -d $@; then echo; \
++ echo "==== Making the `cat $@.txt` man pages. ===="; \
++ $(MAKE) -C $@ -f ../Makefile all; \
++ else echo "==== No $@ man pages found. ===="; fi
+
+ installsubdirs:
+ @for i in @languages@; do if test -d $$i; then echo; \
+ echo "==== Installing the `cat $$i.txt` man pages. ===="; \
+ cd $$i; SLANG=/$$i; if test $$SLANG = /en; then SLANG= ; fi; \
+- export SLANG; make -f ../Makefile install; cd ..; \
++ export SLANG; $(MAKE) -f ../Makefile install; cd ..; \
+ else echo "==== No $$i man pages found. ===="; fi; done
+
+ cleansubdirs:
+- @for i in ??; do cd $$i; make -f ../Makefile clean; cd ..; done
++ @for i in ??; do $(MAKE) -C $$i -f ../Makefile clean; done
+ rm -f core *~
+
+ spotlesssubdirs:
+- for i in ??; do cd $$i; make -f ../Makefile spotless; cd ..; done
++ for i in ??; do $(MAKE) -C $$i -f ../Makefile spotless; done
+ rm -f Makefile
+
+--- man-1.6g/src/gripes.c.orig 2006-11-21 11:53:44.000000000 -0800
++++ man-1.6g/src/gripes.c 2016-03-30 16:32:31.601103487 -0700
+@@ -7,8 +7,6 @@
+
+ extern char *msg[];
+
+-static char *mantexts = "man"; /* e.g. /usr/lib/locale/%L/man.cat */
+-
+ #ifdef NONLS
+
+ static char *
+@@ -30,6 +28,8 @@
+ #include <nl_types.h>
+ #include "../catopen/catopen.c"
+
++static char *mantexts = "man"; /* e.g. /usr/lib/locale/%L/man.cat */
++
+ nl_catd catfd = (nl_catd) -1;
+ int cat_is_open = 0;
+
+--- man-1.6g/src/manfile.c.orig 2005-08-20 16:26:06.000000000 -0700
++++ man-1.6g/src/manfile.c 2016-03-29 09:10:21.527841285 -0700
+@@ -299,7 +299,7 @@
+ const char *((*tocat)(const char *man_filename, const char *ext,
+ int flags))) {
+ char **sl;
+- struct manpage *res;
++ struct manpage *res = 0;
+
+ standards = (flags & (FHS | FSSTND | DO_HP | DO_IRIX));
+ to_cat_filename = tocat;
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-configure.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-configure.patch
new file mode 100644
index 000000000..106cc9878
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-configure.patch
@@ -0,0 +1,68 @@
+Use BUILD_CC and target include files for configuration tests.
+If cross-compiling, force pathnames for helper programs, since
+autodiscovery by the configure script will not work.
+
+Upstream-Status: Pending
+
+Signed-off-by: Bill Randle <william.c.randle at intel.com>
+
+--- man-1.6g/configure.orig 2016-03-28 17:46:12.734910976 -0700
++++ man-1.6g/configure 2016-03-30 21:47:45.110572908 -0700
+@@ -216,7 +216,8 @@
+ INCLUDEDIR=${INCLUDEDIR-/usr/include}
+
+ rm -f conftest conftest.c
+-compile="$CC $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1"
++# since we are interested in target feature support, use that sysroot
++compile="$BUILD_CC -isystem/${PKG_CONFIG_SYSROOT_DIR}/usr/include $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1"
+
+ # Check for various header files.
+
+@@ -455,19 +456,23 @@
+ fi
+ done
+ done
+- Fgroff=/usr/bin/groff
+- Fnroff=/usr/bin/nroff
+- Fjnroff=/usr/bin/nroff
+- Fgeqn=/usr/bin/geqn
+- Fgtbl=/usr/bin/gtbl
+- Fcol=/usr/bin/col
+- Fgrefer=/usr/bin/grefer
+- Fgpic=/usr/bin/gpic
+- Fmore=/bin/more
+- Fless=/usr/bin/less
+- Fcmp=/usr/bin/cmp
+- Fcat=/bin/cat
+- Fgawk=/bin/gawk
++ if [ $BUILD_CC != $CC ]; then
++ # cross compiling => target fs not available, so force defaults
++ Fgroff=/usr/bin/groff
++ Fnroff=/usr/bin/nroff
++ Fjnroff=/usr/bin/nroff
++ Fgeqn=/usr/bin/eqn
++ Fgneqn=/usr/bin/neqn
++ Fgtbl=/usr/bin/tbl
++ Fcol=/usr/bin/col
++ Fgrefer=/usr/bin/refer
++ Fgpic=/usr/bin/pic
++ Fmore=/bin/more
++ Fless=/usr/bin/less
++ Fcmp=/usr/bin/cmp
++ Fcat=/bin/cat
++ Fgawk=/usr/bin/gawk
++ fi
+
+
+ for i in eqn tbl refer pic
+@@ -507,8 +512,8 @@
+ jnroff="$Fjnroff -Tutf8 -mandocj"
+ fi
+ eqn="$Fgeqn -Tps"
+- neqn="$Fgeqn -Tutf8"
+- jneqn="$Fgeqn -Tutf8"
++ neqn="$Fgneqn -Tutf8"
++ jneqn="$Fgneqn -Tutf8"
+ tbl="$Fgtbl"
+ col="$Fcol"
+ vgrind="$Fvgrind"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-parallel.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-parallel.patch
new file mode 100644
index 000000000..72a88b898
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-parallel.patch
@@ -0,0 +1,30 @@
+The Makefile for man has a rule to create two generated targets with
+a program run from the shell. Because the rule was run twice, with
+parallel make, the generated files were being overwritten at the same
+time they were being compiled. This patch forces the rule to be run
+only once.
+
+Upstream-Status: Pending
+
+Signed-off-by: Bill Randle <william.c.randle at intel.com>
+
+--- man-1.6g/src/Makefile.in.orig 2010-12-31 12:28:46.000000000 -0800
++++ man-1.6g/src/Makefile.in 2016-03-28 09:09:16.845458798 -0700
+@@ -43,8 +43,10 @@
+ makemsg:
+ $(BUILD_CC) -o makemsg makemsg.c
+
+-msg.c gripedefs.h: ../msgs/mess.en makemsg
++msg.c gripedefs.h: genfiles-stamp
++genfiles-stamp: ../msgs/mess.en makemsg
+ ./makemsg ../msgs/mess.en gripedefs.h msg.c
++ touch genfiles-stamp
+
+ # glob.c does not have prototypes
+ glob.o: glob.c ndir.h
+@@ -117,4 +119,4 @@
+
+ spotless: clean
+ rm -f Makefile config.status paths.h version.h man.conf
+- rm -f gripedefs.h msg.c mess.*.cat
++ rm -f gripedefs.h msg.c mess.*.cat genfiles-stamp
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-whatis3.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-whatis3.patch
new file mode 100644
index 000000000..633445685
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-whatis3.patch
@@ -0,0 +1,20 @@
+Do not use absolute path for awk while getting the path of awk
+when running makewhatis.
+This can avoid errors if path of awk changes.
+
+Upstream-Status: Submitted [man-1.6g]
+
+Signed-off-by: Jian Liu <jian.liu@windriver.com>
+
+diff -Nur man-1.6g.orig/src/makewhatis.sh man-1.6g/src/makewhatis.sh
+--- man-1.6g.orig/src/makewhatis.sh 2015-02-25 16:13:12.657611419 +0800
++++ man-1.6g/src/makewhatis.sh 2015-02-25 16:14:49.334694815 +0800
+@@ -67,7 +67,7 @@
+ # but that leads to problems and bugs.
+
+ # AWK=/usr/bin/gawk
+-AWK=@awk@
++AWK=`which awk`
+
+ # Find a place for our temporary files. If security is not a concern, use
+ # TMPFILE=/tmp/whatis$$; TMPFILEDIR=none
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man.1.gz b/import-layers/yocto-poky/meta/recipes-extended/man/man/man.1.gz
new file mode 100644
index 000000000..c36804515
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man.1.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man.7.gz b/import-layers/yocto-poky/meta/recipes-extended/man/man/man.7.gz
new file mode 100644
index 000000000..e85af8242
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man.7.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man.conf b/import-layers/yocto-poky/meta/recipes-extended/man/man/man.conf
new file mode 100644
index 000000000..fc10be275
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man.conf
@@ -0,0 +1,141 @@
+#
+# Generated automatically from man.conf.in by the
+# configure script.
+#
+# man.conf from man-1.5p
+#
+# For more information about this file, see the man pages man(1)
+# and man.conf(5).
+#
+# This file is read by man to configure the default manpath (also used
+# when MANPATH contains an empty substring), to find out where the cat
+# pages corresponding to given man pages should be stored,
+# and to map each PATH element to a manpath element.
+# It may also record the pathname of the man binary. [This is unused.]
+# The format is:
+#
+# MANBIN pathname
+# MANPATH manpath_element [corresponding_catdir]
+# MANPATH_MAP path_element manpath_element
+#
+# If no catdir is given, it is assumed to be equal to the mandir
+# (so that this dir has both man1 etc. and cat1 etc. subdirs).
+# This is the traditional Unix setup.
+# Certain versions of the FSSTND recommend putting formatted versions
+# of /usr/.../man/manx/page.x into /var/catman/.../catx/page.x.
+# The keyword FSSTND will cause this behaviour.
+# Certain versions of the FHS recommend putting formatted versions of
+# /usr/.../share/man/[locale/]manx/page.x into
+# /var/cache/man/.../[locale/]catx/page.x.
+# The keyword FHS will cause this behaviour (and overrides FSSTND).
+# Explicitly given catdirs override.
+#
+# FSSTND
+FHS
+#
+# This file is also read by man in order to find how to call nroff, less, etc.,
+# and to determine the correspondence between extensions and decompressors.
+#
+# MANBIN /usr/local/bin/man
+#
+# Every automatically generated MANPATH includes these fields
+#
+MANPATH /usr/man
+MANPATH /usr/share/man
+MANPATH /usr/local/man
+MANPATH /usr/local/share/man
+MANPATH /usr/X11R6/man
+#
+# Uncomment if you want to include one of these by default
+#
+# MANPATH /opt/*/man
+# MANPATH /usr/lib/*/man
+# MANPATH /usr/share/*/man
+# MANPATH /usr/kerberos/man
+#
+# Set up PATH to MANPATH mapping
+#
+# If people ask for "man foo" and have "/dir/bin/foo" in their PATH
+# and the docs are found in "/dir/man", then no mapping is required.
+#
+# The below mappings are superfluous when the right hand side is
+# in the mandatory manpath already, but will keep man from statting
+# lots of other nearby files and directories.
+#
+MANPATH_MAP /bin /usr/share/man
+MANPATH_MAP /sbin /usr/share/man
+MANPATH_MAP /usr/bin /usr/share/man
+MANPATH_MAP /usr/sbin /usr/share/man
+MANPATH_MAP /usr/local/bin /usr/local/share/man
+MANPATH_MAP /usr/local/sbin /usr/local/share/man
+MANPATH_MAP /usr/X11R6/bin /usr/X11R6/man
+MANPATH_MAP /usr/bin/X11 /usr/X11R6/man
+MANPATH_MAP /usr/bin/mh /usr/share/man
+#
+# NOAUTOPATH keeps man from automatically adding directories that look like
+# manual page directories to the path.
+#
+#NOAUTOPATH
+#
+# NOCACHE keeps man from creating cache pages ("cat pages")
+# (generally one enables/disable cat page creation by creating/deleting
+# the directory they would live in - man never does mkdir)
+#
+#NOCACHE
+#
+# Useful paths - note that COL should not be defined when
+# NROFF is defined as "groff -Tascii" or "groff -Tlatin1";
+# not only is it superfluous, but it actually damages the output.
+# For use with utf-8, NROFF should be "nroff -mandoc" without -T option.
+# (Maybe - but today I need -Tlatin1 to prevent double conversion to utf8.)
+#
+# If you have a new troff (version 1.18.1?) and its colored output
+# causes problems, add the -c option to TROFF, NROFF, JNROFF.
+#
+TROFF /usr/bin/groff -Tps -mandoc
+NROFF /usr/bin/nroff -Tlatin1 -mandoc
+JNROFF /usr/bin/groff -Tnippon -mandocj
+EQN /usr/bin/eqn -Tps
+NEQN /usr/bin/eqn -Tlatin1
+JNEQN /usr/bin/eqn -Tnippon
+TBL /usr/bin/tbl
+# COL /usr/bin/col
+REFER /usr/bin/refer
+PIC /usr/bin/pic
+VGRIND
+GRAP
+PAGER /usr/bin/less -isR
+CAT /bin/cat
+#
+# The command "man -a xyzzy" will show all man pages for xyzzy.
+# When CMP is defined man will try to avoid showing the same
+# text twice. (But compressed pages compare unequal.)
+#
+CMP /usr/bin/cmp -s
+#
+# Compress cat pages
+#
+COMPRESS /bin/bzip2
+COMPRESS_EXT .bz2
+#
+# Default manual sections (and order) to search if -S is not specified
+# and the MANSECT environment variable is not set.
+#
+MANSECT 1:1p:8:2:3:3p:4:5:6:7:9:0p:tcl:n:l:p:o
+#
+# Default options to use when man is invoked without options
+# This is mainly for the benefit of those that think -a should be the default
+# Note that some systems have /usr/man/allman, causing pages to be shown twice.
+#
+#MANDEFOPTIONS -a
+#
+# Decompress with given decompressor when input file has given extension
+# The command given must act as a filter.
+#
+.gz /bin/gunzip -c
+.bz2 /usr/bin/bunzip2 -c
+.xz /usr/bin/unxz -c
+.z
+.Z /bin/zcat
+.F
+.Y
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/manpath.5.gz b/import-layers/yocto-poky/meta/recipes-extended/man/man/manpath.5.gz
new file mode 100644
index 000000000..c012ff897
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/manpath.5.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man_1.6g.bb b/import-layers/yocto-poky/meta/recipes-extended/man/man_1.6g.bb
new file mode 100644
index 000000000..e78aa18cb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man_1.6g.bb
@@ -0,0 +1,86 @@
+SUMMARY = "Online documentation tools"
+DESCRIPTION = "A set of documentation tools: man, apropos and whatis"
+SECTION = "console/utils"
+HOMEPAGE = "http://primates.ximian.com/~flucifredi/man"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
+
+PR = "r1"
+
+DEPENDS = "groff less"
+
+def compress_pkg(d):
+ if "compress_doc" in (d.getVar("INHERIT", True) or "").split():
+ compress = d.getVar("DOC_COMPRESS", True)
+ if compress == "gz":
+ return "gzip"
+ elif compress == "bz2":
+ return "bzip2"
+ elif compress == "xz":
+ return "xz"
+ return ""
+
+RDEPENDS_${PN} += "${@compress_pkg(d)}"
+
+SRC_URI = "http://pkgs.fedoraproject.org/lookaside/pkgs/man2html/${BP}.tar.gz/ba154d5796928b841c9c69f0ae376660/${BP}.tar.gz \
+ file://man-1.5k-confpath.patch;striplevel=0 \
+ file://man-1.5h1-make.patch \
+ file://man-1.5k-nonascii.patch \
+ file://man-1.6e-security.patch \
+ file://man-1.6e-mandirs.patch \
+ file://man-1.5m2-bug11621.patch \
+ file://man-1.5k-sofix.patch \
+ file://man-1.5m2-buildroot.patch \
+ file://man-1.6e-ro_usr.patch \
+ file://man-1.5i2-newline.patch;striplevel=0 \
+ file://man-1.5j-utf8.patch \
+ file://man-1.5i2-overflow.patch \
+ file://man-1.5j-nocache.patch \
+ file://man-1.5i2-initial.patch \
+ file://man-1.5h1-gencat.patch;striplevel=0 \
+ file://man-1.5g-nonrootbuild.patch \
+ file://man-1.5j-i18n.patch \
+ file://man-1.6e-whatis2.patch \
+ file://man-1.6e-use_i18n_vars_in_a_std_way.patch \
+ file://man-1.5m2-no-color-for-printing.patch \
+ file://man-1.5m2-sigpipe.patch \
+ file://man-1.6e-i18n_whatis.patch \
+ file://man-1.6e-new_sections.patch \
+ file://man.1.gz;unpack=false \
+ file://man.7.gz;unpack=false \
+ file://man.conf \
+ file://manpath.5.gz;unpack=false \
+ file://man-1.6g-whatis3.patch \
+ file://configure_sed.patch \
+ file://man-1.6g-parallel.patch \
+ file://man-1.6g-compile-warnings.patch \
+ file://man-1.6g-configure.patch \
+"
+
+SRC_URI[md5sum] = "ba154d5796928b841c9c69f0ae376660"
+SRC_URI[sha256sum] = "ccdcb8c3f4e0080923d7e818f0e4a202db26c46415eaef361387c20995b8959f"
+
+CFLAGS += "-DSYSV"
+
+do_configure () {
+ ${S}/configure -default -confdir /etc +sgid +fhs +lang all
+}
+
+
+do_install() {
+ oe_runmake install DESTDIR=${D}
+}
+
+do_install_append(){
+ mkdir -p ${D}${sysconfdir}
+ mkdir -p ${D}${datadir}/man/man5
+ mkdir -p ${D}${datadir}/man/man7
+ cp ${WORKDIR}/man.conf ${D}${sysconfdir}/man.config
+ cp ${WORKDIR}/man.1.gz ${D}${datadir}/man/man1/
+ cp ${WORKDIR}/man.7.gz ${D}${datadir}/man/man7/
+ cp ${WORKDIR}/manpath.5.gz ${D}${datadir}/man/man5/
+}
+
+
+RDEPENDS_${PN} = "less groff"
+FILES_${PN} += "${datadir}/locale ${sysconfdir}/man.config"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mc/mc/mc-CTRL.patch b/import-layers/yocto-poky/meta/recipes-extended/mc/mc/mc-CTRL.patch
new file mode 100644
index 000000000..ee4ba9f26
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mc/mc/mc-CTRL.patch
@@ -0,0 +1,31 @@
+Fix build with musl by ensuring CTRL is defined.
+
+musl does not define CTRL in <termios.h>, we could include <sys/ttydefaults.h>
+explicitly but it's easier just to ensure CTRL is defined.
+
+This patch is taken from Sabotage Linux, the license statement for patches and
+build scripts in Sabotage Linux says:
+
+ To the extent possible under law, Christian Neukirchen has waived
+ all copyright and related or neighboring rights to this work.
+
+ http://creativecommons.org/publicdomain/zero/1.0/
+
+Therefore this should be good to include in OpenEmbedded.
+
+Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
+
+Upstream-Status: Accepted (should be included in v4.8.14)
+
+diff -u mc-4.8.1.7.org/lib/tty/tty-ncurses.c mc-4.8.1.7/lib/tty/tty-ncurses.c
+--- mc-4.8.1.7.org/lib/tty/tty-ncurses.c
++++ mc-4.8.1.7/lib/tty/tty-ncurses.c
+@@ -65,7 +65,7 @@
+
+ /*** file scope macro definitions ****************************************************************/
+
+-#if defined(_AIX) && !defined(CTRL)
++#if !defined(CTRL)
+ #define CTRL(x) ((x) & 0x1f)
+ #endif
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mc/mc_4.7.5.2.bb b/import-layers/yocto-poky/meta/recipes-extended/mc/mc_4.7.5.2.bb
new file mode 100644
index 000000000..b38964d82
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mc/mc_4.7.5.2.bb
@@ -0,0 +1,47 @@
+SUMMARY = "Midnight Commander is an ncurses based file manager"
+HOMEPAGE = "http://www.midnight-commander.org/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+SECTION = "console/utils"
+DEPENDS = "ncurses glib-2.0"
+RDEPENDS_${PN} = "ncurses-terminfo"
+
+PR = "r3"
+
+SRC_URI = "http://www.midnight-commander.org/downloads/${BPN}-${PV}.tar.bz2 \
+ file://mc-CTRL.patch \
+ "
+
+SRC_URI[md5sum] = "bdae966244496cd4f6d282d80c9cf3c6"
+SRC_URI[sha256sum] = "a68338862bb30017eb65ed569a58e80ab66ae8cef11c886440c9e9f4d1efc6ab"
+
+inherit autotools gettext pkgconfig
+
+EXTRA_OECONF = "--with-screen=ncurses --without-gpm-mouse --without-x --without-samba"
+
+do_install_append () {
+ sed -i -e '1s,#!.*perl,#!${bindir}/env perl,' ${D}${libexecdir}/mc/extfs.d/*
+ sed -i -e '1s,#!.*python,#!${bindir}/env python,' ${D}${libexecdir}/mc/extfs.d/*
+}
+
+PACKAGES =+ "${BPN}-helpers-perl ${BPN}-helpers-python ${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-python = "Midnight Commander Python-based helper scripts"
+FILES_${BPN}-helpers-python = "${libexecdir}/mc/extfs.d/s3+ ${libexecdir}/mc/extfs.d/uc1541"
+RDEPENDS_${BPN}-helpers-python = "python"
+
+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/import-layers/yocto-poky/meta/recipes-extended/mc/mc_4.8.15.bb b/import-layers/yocto-poky/meta/recipes-extended/mc/mc_4.8.15.bb
new file mode 100644
index 000000000..6c3a16aab
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mc/mc_4.8.15.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 \
+ "
+SRC_URI[md5sum] = "db48ce26ba425a61edc51930e94227fd"
+SRC_URI[sha256sum] = "f74e3da70410975cdeb27ee9a66d1dd812250b6d3ede364bca728dd5a48e5471"
+
+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"
+
+do_install_append () {
+ sed -i -e '1s,#!.*perl,#!${bindir}/env perl,' ${D}${libexecdir}/mc/extfs.d/*
+ sed -i -e '1s,#!.*python,#!${bindir}/env python,' ${D}${libexecdir}/mc/extfs.d/*
+}
+
+PACKAGES =+ "${BPN}-helpers-perl ${BPN}-helpers-python ${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-python = "Midnight Commander Python-based helper scripts"
+FILES_${BPN}-helpers-python = "${libexecdir}/mc/extfs.d/s3+ ${libexecdir}/mc/extfs.d/uc1541"
+RDEPENDS_${BPN}-helpers-python = "python"
+
+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/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-some-type-comparison-problems.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-some-type-comparison-problems.patch
new file mode 100644
index 000000000..ee482b5ca
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-some-type-comparison-problems.patch
@@ -0,0 +1,50 @@
+From 835baf02fd42012bbc0603dffb1f80c6ecf0fb9e Mon Sep 17 00:00:00 2001
+From: Xiao Ni <xni@redhat.com>
+Date: Mon, 8 Feb 2016 11:18:52 +0200
+Subject: [PATCH] Fix some type comparison problems
+
+As 26714713cd2bad9e0bf7f4669f6cc4659ceaab6c said, 32 bit signed
+timestamps will overflow in the year 2038. It already changed the
+utime and ctime in struct mdu_array_info_s from int to unsigned
+int. So we need to change the values that compared with them to
+unsigned int too.
+
+Upstream-Status: Backport
+
+Signed-off-by : Xiao Ni <xni@redhat.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+
+ Monitor.c | 2 +-
+ util.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Monitor.c b/Monitor.c
+index f19c2e5..6df80f9 100644
+--- a/Monitor.c
++++ b/Monitor.c
+@@ -33,7 +33,7 @@
+ struct state {
+ char *devname;
+ char devnm[32]; /* to sync with mdstat info */
+- long utime;
++ unsigned int utime;
+ int err;
+ char *spare_group;
+ int active, working, failed, spare, raid;
+diff --git a/util.c b/util.c
+index 3e6d293..96a806d 100644
+--- a/util.c
++++ b/util.c
+@@ -1267,7 +1267,7 @@ struct supertype *guess_super_type(int fd, enum guess_types guess_type)
+ */
+ struct superswitch *ss;
+ struct supertype *st;
+- time_t besttime = 0;
++ unsigned int besttime = 0;
+ int bestsuper = -1;
+ int i;
+
+--
+2.4.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch
new file mode 100644
index 000000000..deb748638
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch
@@ -0,0 +1,33 @@
+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>
+---
+ 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 [ -d $(SYSROOT)/usr/include/corosync ] || 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/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-typo-in-comparision.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-typo-in-comparision.patch
new file mode 100644
index 000000000..df70b1cf4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-typo-in-comparision.patch
@@ -0,0 +1,86 @@
+From 18d360d74271a066a849bc1fba4f10dbb23ed251 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 8 Sep 2015 08:17:42 +0000
+Subject: [PATCH] Fix typo in comparision
+
+error: comparison of array 'devnm' equal to a null pointer is always false
+
+User bitwise '&' operator as it is a mask
+
+Fixes
+error: use of logical '&&' with constant operand
+
+Remove extraneous parens
+
+error: equality comparison with extraneous parentheses
+
+Remove dead code
+
+restripe.c:465:21: error: explicitly assigning value of variable of type 'int' to itself
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ mdmon.h | 2 +-
+ mdopen.c | 2 +-
+ restripe.c | 3 ---
+ super-intel.c | 2 +-
+ 4 files changed, 3 insertions(+), 6 deletions(-)
+
+diff --git a/mdmon.h b/mdmon.h
+index aa750c6..0b08c3d 100644
+--- a/mdmon.h
++++ b/mdmon.h
+@@ -101,7 +101,7 @@ static inline int is_resync_complete(struct mdinfo *array)
+ break;
+ case 10:
+ l = array->array.layout;
+- ncopies = (l & 0xff) * ((l >> 8) && 0xff);
++ ncopies = (l & 0xff) * ((l >> 8) & 0xff);
+ sync_size = array->component_size * array->array.raid_disks;
+ sync_size /= ncopies;
+ break;
+diff --git a/mdopen.c b/mdopen.c
+index 28410f4..c5ee2a6 100644
+--- a/mdopen.c
++++ b/mdopen.c
+@@ -318,7 +318,7 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy,
+ else if (num < 0) {
+ /* need to choose a free number. */
+ char *_devnm = find_free_devnm(use_mdp);
+- if (devnm == NULL) {
++ if (_devnm == NULL) {
+ pr_err("No avail md devices - aborting\n");
+ return -1;
+ }
+diff --git a/restripe.c b/restripe.c
+index 4d92190..cfe9666 100644
+--- a/restripe.c
++++ b/restripe.c
+@@ -461,9 +461,6 @@ int raid6_check_disks(int data_disks, int start, int chunk_size,
+ curr_broken_disk = diskD;
+ }
+
+- if((Px == 0) && (Qx == 0))
+- curr_broken_disk = curr_broken_disk;
+-
+ if(curr_broken_disk >= data_disks + 2)
+ broken_status = 2;
+
+diff --git a/super-intel.c b/super-intel.c
+index 3f812d6..1838012 100644
+--- a/super-intel.c
++++ b/super-intel.c
+@@ -10027,7 +10027,7 @@ enum imsm_reshape_type imsm_analyze_change(struct supertype *st,
+ geo->size = max_size;
+ }
+
+- if ((direction == ROLLBACK_METADATA_CHANGES)) {
++ if (direction == ROLLBACK_METADATA_CHANGES) {
+ /* accept size for rollback only
+ */
+ } else {
+--
+2.5.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-mdadm.h-bswap-is-already-defined-in-uclibc.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-mdadm.h-bswap-is-already-defined-in-uclibc.patch
new file mode 100644
index 000000000..139547398
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-mdadm.h-bswap-is-already-defined-in-uclibc.patch
@@ -0,0 +1,55 @@
+From cf14a9987ea1040457ce53bc2ab7d096818cb780 Mon Sep 17 00:00:00 2001
+From: "Maxin B. John" <maxin.john@intel.com>
+Date: Fri, 5 Feb 2016 18:06:32 +0200
+Subject: [PATCH] mdadm.h: bswap is already defined in uclibc
+
+Fixes this build error:
+
+| In file included from mdadm.c:28:0:
+| mdadm.h:142:0: error: "bswap_16" redefined [-Werror]
+| #define bswap_16(x) (((x) & 0x00ffU) << 8 | \
+| ^
+
+Upstream-Status: Submitted
+
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ mdadm.h | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/mdadm.h b/mdadm.h
+index dd02be7..230e60f 100755
+--- a/mdadm.h
++++ b/mdadm.h
+@@ -139,12 +139,20 @@ struct dlm_lksb {
+ * and there is no standard conversion function so... */
+ /* And dietlibc doesn't think byteswap is ok, so.. */
+ /* #include <byteswap.h> */
++
++#ifndef bswap_16
+ #define bswap_16(x) (((x) & 0x00ffU) << 8 | \
+ ((x) & 0xff00U) >> 8)
++#endif
++
++#ifndef bswap_32
+ #define bswap_32(x) (((x) & 0x000000ffU) << 24 | \
+ ((x) & 0xff000000U) >> 24 | \
+ ((x) & 0x0000ff00U) << 8 | \
+ ((x) & 0x00ff0000U) >> 8)
++#endif
++
++#ifndef bswap_64
+ #define bswap_64(x) (((x) & 0x00000000000000ffULL) << 56 | \
+ ((x) & 0xff00000000000000ULL) >> 56 | \
+ ((x) & 0x000000000000ff00ULL) << 40 | \
+@@ -153,6 +161,7 @@ struct dlm_lksb {
+ ((x) & 0x0000ff0000000000ULL) >> 24 | \
+ ((x) & 0x00000000ff000000ULL) << 8 | \
+ ((x) & 0x000000ff00000000ULL) >> 8)
++#endif
+
+ #if !defined(__KLIBC__)
+ #if BYTE_ORDER == LITTLE_ENDIAN
+--
+2.4.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-util.c-include-poll.h-instead-of-sys-poll.h.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-util.c-include-poll.h-instead-of-sys-poll.h.patch
new file mode 100644
index 000000000..d5cf00374
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-util.c-include-poll.h-instead-of-sys-poll.h.patch
@@ -0,0 +1,45 @@
+From 2645673a7ea948a1297d5b8f0daab29b898f044f Mon Sep 17 00:00:00 2001
+From: "Maxin B. John" <maxin.john@intel.com>
+Date: Fri, 5 Feb 2016 17:14:04 +0200
+Subject: [PATCH] util.c: include poll.h instead of sys/poll.h
+
+This fixes a compile warning when building with musl:
+
+ In file included from util.c:27:0:
+ |
+ qemux86-64/usr/include/sys/poll.h:1:2:
+ error: #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
+ [-Werror=cpp]
+ | #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
+ | ^
+
+Upstream-Status: Accepted
+
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ util.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/util.c b/util.c
+index 970d484..3e6d293 100644
+--- a/util.c
++++ b/util.c
+@@ -24,7 +24,6 @@
+
+ #include "mdadm.h"
+ #include "md_p.h"
+-#include <sys/poll.h>
+ #include <sys/socket.h>
+ #include <sys/utsname.h>
+ #include <sys/wait.h>
+@@ -32,6 +31,7 @@
+ #include <sys/resource.h>
+ #include <sys/vfs.h>
+ #include <linux/magic.h>
++#include <poll.h>
+ #include <ctype.h>
+ #include <dirent.h>
+ #include <signal.h>
+--
+2.4.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/gcc-4.9.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/gcc-4.9.patch
new file mode 100644
index 000000000..54bf1d79a
--- /dev/null
+++ b/import-layers/yocto-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-3.3/super-intel.c
+===================================================================
+--- mdadm-3.3.orig/super-intel.c 2014-05-02 15:08:21.154319651 -0700
++++ mdadm-3.3/super-intel.c 2014-05-02 15:09:31.470985794 -0700
+@@ -5060,7 +5060,7 @@
+ 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/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-3.2.2_fix_for_x32.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-3.2.2_fix_for_x32.patch
new file mode 100644
index 000000000..40acc148e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-3.2.2_fix_for_x32.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Accepted
+
+By hardcoding CC's definition in the Makefile, all the gcc parameters
+set by tune settings are lost. Causing compile failure with x32 toolchain
+
+As the bitbake defined CC is good, there is no need to redfine CC in the
+make file, hence making the CC definition in the Makefile conditional.
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/07
+
+Index: mdadm-3.3/Makefile
+===================================================================
+--- mdadm-3.3.orig/Makefile 2013-09-03 07:47:47.000000000 +0300
++++ mdadm-3.3/Makefile 2013-10-16 16:44:23.542295487 +0300
+@@ -41,7 +41,7 @@
+
+ KLIBC_GCC = gcc -nostdinc -iwithprefix include -I$(KLIBC)/klibc/include -I$(KLIBC)/linux/include -I$(KLIBC)/klibc/arch/i386/include -I$(KLIBC)/klibc/include/bits32
+
+-CC = $(CROSS_COMPILE)gcc
++CC ?= $(CROSS_COMPILE)gcc
+ CXFLAGS ?= -ggdb
+ CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter
+ ifdef WARN_UNUSED
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch
new file mode 100644
index 000000000..c656d073e
--- /dev/null
+++ b/import-layers/yocto-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-3.3.4/monitor.c
+===================================================================
+--- mdadm-3.3.4.orig/monitor.c
++++ mdadm-3.3.4/monitor.c
+@@ -257,9 +257,12 @@ static int read_and_act(struct active_ar
+ mdi->curr_state = read_dev_state(mdi->state_fd);
+ }
+ }
+-
+ 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/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch
new file mode 100644
index 000000000..267c007c2
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/run-ptest b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/run-ptest
new file mode 100644
index 000000000..5b276090f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/mdadm/mdadm_3.4.bb b/import-layers/yocto-poky/meta/recipes-extended/mdadm/mdadm_3.4.bb
new file mode 100644
index 000000000..142dfddbf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/mdadm_3.4.bb
@@ -0,0 +1,75 @@
+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://mdadm-3.2.2_fix_for_x32.patch \
+ file://gcc-4.9.patch \
+ file://mdadm-3.3.2_x32_abi_time_t.patch \
+ file://0001-Fix-typo-in-comparision.patch \
+ file://mdadm-fix-ptest-build-errors.patch \
+ file://0001-util.c-include-poll.h-instead-of-sys-poll.h.patch \
+ file://0001-mdadm.h-bswap-is-already-defined-in-uclibc.patch \
+ file://0001-Fix-some-type-comparison-problems.patch \
+ file://0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch \
+ file://run-ptest \
+ "
+SRC_URI[md5sum] = "04b8b21f637540350f8517c7e68d3c63"
+SRC_URI[sha256sum] = "27d0be4627d38a12ddcd1c1c3721d649d4e89e1093914497e22b57245cda8808"
+
+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_mips64 = ' -D__SANE_USERSPACE_TYPES__'
+CFLAGS_append_mips64n32 = ' -D__SANE_USERSPACE_TYPES__'
+
+do_compile() {
+ oe_runmake SYSROOT="${STAGING_DIR_TARGET}"
+}
+
+do_install() {
+ export STRIP=""
+ autotools_do_install
+}
+
+FILES_${PN} += "${base_libdir}/udev/rules.d/*.rules"
+
+inherit ptest
+
+do_compile_ptest() {
+ oe_runmake test
+}
+
+do_install_ptest() {
+ cp -a ${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 /sbin/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/import-layers/yocto-poky/meta/recipes-extended/mingetty/mingetty_1.08.bb b/import-layers/yocto-poky/meta/recipes-extended/mingetty/mingetty_1.08.bb
new file mode 100644
index 000000000..3c16228b0
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/minicom/minicom/0001-Fix-build-issus-surfaced-due-to-musl.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/minicom/minicom/0001-fix-minicom-h-v-return-value-is-not-0.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/minicom/minicom/allow.to.disable.lockdev.patch b/import-layers/yocto-poky/meta/recipes-extended/minicom/minicom/allow.to.disable.lockdev.patch
new file mode 100644
index 000000000..f5c08896f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/minicom/minicom_2.7.bb b/import-layers/yocto-poky/meta/recipes-extended/minicom/minicom_2.7.bb
new file mode 100644
index 000000000..3118686e1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/minicom/minicom_2.7.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Text-based modem control and terminal emulation program"
+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] = "7044ca3e291268c33294f171d426dc2d"
+SRC_URI[sha256sum] = "9ac3a663b82f4f5df64114b4792b9926b536c85f59de0f2d2b321c7626a904f4"
+
+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
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mktemp/files/disable-strip.patch b/import-layers/yocto-poky/meta/recipes-extended/mktemp/files/disable-strip.patch
new file mode 100644
index 000000000..e06869e3a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/mktemp/files/fix-parallel-make.patch b/import-layers/yocto-poky/meta/recipes-extended/mktemp/files/fix-parallel-make.patch
new file mode 100644
index 000000000..f3b6dcc34
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/mktemp/mktemp_1.7.bb b/import-layers/yocto-poky/meta/recipes-extended/mktemp/mktemp_1.7.bb
new file mode 100644
index 000000000..9accc6eed
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mktemp/mktemp_1.7.bb
@@ -0,0 +1,34 @@
+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 () {
+ install -d ${D}${base_bindir}
+ mv ${D}${bindir}/mktemp ${D}${base_bindir}/mktemp
+ rmdir ${D}${bindir}
+}
+
+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/import-layers/yocto-poky/meta/recipes-extended/msmtp/msmtp_1.6.3.bb b/import-layers/yocto-poky/meta/recipes-extended/msmtp/msmtp_1.6.3.bb
new file mode 100644
index 000000000..6dbd78f9f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/msmtp/msmtp_1.6.3.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] = "6d9384c09405db9476beaa2237c56705"
+SRC_URI[sha256sum] = "f982be069c0772c3ee83925f552f5dac5fb307d2d1c68202f9926bb13b757355"
+
+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/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/musl-fixes.patch b/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/musl-fixes.patch
new file mode 100644
index 000000000..f694d594b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp1.patch b/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp1.patch
new file mode 100644
index 000000000..12eed17af
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp1.patch
@@ -0,0 +1,638 @@
+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(-)
+
+diff --git a/netstat.c b/netstat.c
+index 1fb9e0c..5d1a4a1 100644
+--- a/netstat.c
++++ b/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
+@@ -105,7 +106,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);
+@@ -118,6 +119,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 */
+@@ -148,6 +171,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;
+@@ -990,6 +1014,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];
+@@ -1549,7 +1932,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 */
+@@ -1574,6 +1957,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'},
+@@ -1604,7 +1988,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;
+@@ -1696,10 +2080,12 @@ int main
+ case 't':
+ flag_tcp++;
+ break;
+-
+ case 'u':
+ flag_udp++;
+ break;
++ case 'S':
++ flag_sctp++;
++ break;
+ case 'w':
+ flag_raw++;
+ break;
+@@ -1717,13 +2103,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) {
+@@ -1751,7 +2137,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;
+@@ -1804,7 +2190,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 */
+@@ -1843,6 +2229,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)
+diff --git a/statistics.c b/statistics.c
+index 03600d7..eb8d7dc 100644
+--- a/statistics.c
++++ b/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_("%u 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_tcp, int flag_udp)
+
+ 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;
+ }
+
+--
+1.8.5.2.233.g932f7e4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp2-quiet.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp3-addrs.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-config.h b/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-config.h
new file mode 100644
index 000000000..6d39c2a8c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-config.make b/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-config.make
new file mode 100644
index 000000000..ec516f27e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools_1.60-26.bb b/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools_1.60-26.bb
new file mode 100644
index 000000000..63b2051ba
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools_1.60-26.bb
@@ -0,0 +1,109 @@
+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 \
+ "
+
+# 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"
+
+LDFLAGS_append_libc-uclibc = " -lintl "
+
+# 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
+}
+
+do_compile() {
+ # net-tools use COPTS/LOPTS to allow adding custom options
+ export COPTS="$CFLAGS"
+ export LOPTS="$LDFLAGS"
+ unset CFLAGS
+ unset LDFLAGS
+
+ oe_runmake
+}
+
+do_install() {
+ export COPTS="$CFLAGS"
+ export LOPTS="$LDFLAGS"
+ unset CFLAGS
+ unset LDFLAGS
+ oe_runmake 'BASEDIR=${D}' install
+}
+
+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}"
+python __anonymous() {
+ for prog in d.getVar('base_sbindir_progs', True).split():
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir', True), prog))
+ for prog in d.getVar('base_bindir_progs', True).split():
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir', True), prog))
+}
+ALTERNATIVE_PRIORITY = "100"
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/newt/files/Makefile.in-Add-tinfo-library-to-the-linking-librari.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/newt/files/cross_ar.patch b/import-layers/yocto-poky/meta/recipes-extended/newt/files/cross_ar.patch
new file mode 100644
index 000000000..03007aa4f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/newt/files/cross_ar.patch
@@ -0,0 +1,58 @@
+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(-)
+
+diff --git a/Makefile.in b/Makefile.in
+--- a/Makefile.in
++++ b/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) $(LIBNEWTSH)
+ $(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
+
+diff --git a/configure.ac b/configure.ac
+index 92e6da8..cd83d57 100644
+--- a/configure.ac
++++ b/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
+
+ # Are we using GNU ld?
+ AC_MSG_CHECKING([for GNU ld])
+--
+1.8.1.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/newt/files/fix_SHAREDDIR.patch b/import-layers/yocto-poky/meta/recipes-extended/newt/files/fix_SHAREDDIR.patch
new file mode 100644
index 000000000..b0a1e8c10
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/newt/files/pie-flags.patch b/import-layers/yocto-poky/meta/recipes-extended/newt/files/pie-flags.patch
new file mode 100644
index 000000000..8883e26ad
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/newt/files/remove_slang_include.patch b/import-layers/yocto-poky/meta/recipes-extended/newt/files/remove_slang_include.patch
new file mode 100644
index 000000000..a2634ec75
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/newt/files/remove_slang_include.patch
@@ -0,0 +1,16 @@
+
+Upstream-Status: Pending
+
+Index: git/Makefile.in
+===================================================================
+--- git.orig/Makefile.in
++++ git/Makefile.in
+@@ -5,7 +5,7 @@ CC = @CC@
+ CPP = @CPP@
+ CFLAGS = @CFLAGS@
+ LDFLAGS = @LDFLAGS@
+-CPPFLAGS = -D_GNU_SOURCE -I/usr/include/slang @CPPFLAGS@
++CPPFLAGS = -D_GNU_SOURCE @CPPFLAGS@
+ GNU_LD = @GNU_LD@
+
+ VERSION = @VERSION@
diff --git a/import-layers/yocto-poky/meta/recipes-extended/newt/libnewt-python_0.52.18.bb b/import-layers/yocto-poky/meta/recipes-extended/newt/libnewt-python_0.52.18.bb
new file mode 100644
index 000000000..ba047574f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/newt/libnewt-python_0.52.18.bb
@@ -0,0 +1,28 @@
+require recipes-extended/newt/libnewt_${PV}.bb
+
+SUMMARY .= " - python"
+DEPENDS = "libnewt python"
+RDEPENDS_${PN} += "python-core"
+
+inherit pythonnative python-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/import-layers/yocto-poky/meta/recipes-extended/newt/libnewt_0.52.18.bb b/import-layers/yocto-poky/meta/recipes-extended/newt/libnewt_0.52.18.bb
new file mode 100644
index 000000000..9a2964be1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/newt/libnewt_0.52.18.bb
@@ -0,0 +1,59 @@
+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://fedorahosted.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://fedorahosted.org/releases/n/e/newt/newt-${PV}.tar.gz \
+ file://remove_slang_include.patch \
+ file://fix_SHAREDDIR.patch \
+ file://cross_ar.patch \
+ file://Makefile.in-Add-tinfo-library-to-the-linking-librari.patch \
+ file://pie-flags.patch \
+"
+
+SRC_URI[md5sum] = "685721bee1a318570704b19dcf31d268"
+SRC_URI[sha256sum] = "771b0e634ede56ae6a6acd910728bb5832ac13ddb0d1d27919d2498dab70c91e"
+
+S = "${WORKDIR}/newt-${PV}"
+
+EXTRA_OECONF = "--without-tcl --without-python"
+
+inherit autotools-brokensep
+
+CLEANBROKEN = "1"
+
+export STAGING_INCDIR
+export STAGING_LIBDIR
+export CPPFLAGS
+
+export BUILD_SYS
+export HOST_SYS
+
+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/import-layers/yocto-poky/meta/recipes-extended/packagegroups/packagegroup-core-full-cmdline.bb b/import-layers/yocto-poky/meta/recipes-extended/packagegroups/packagegroup-core-full-cmdline.bb
new file mode 100644
index 000000000..1d7e6089e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/packagegroups/packagegroup-core-full-cmdline.bb
@@ -0,0 +1,162 @@
+#
+# 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"
+LICENSE = "MIT"
+
+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", True).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 \
+ mc-helpers-python \
+ mktemp \
+ ncurses \
+ net-tools \
+ pax \
+ 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 = "\
+ byacc \
+ 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 \
+ dbus-glib \
+ python-dbus \
+ elfutils \
+ gzip \
+ less \
+ libcap \
+ libevent \
+ logrotate \
+ nfs-utils \
+ pciutils \
+ libpcre \
+ rpcbind \
+ sysfsutils \
+ tcp-wrappers \
+ tzdata \
+ "
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb b/import-layers/yocto-poky/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb
new file mode 100644
index 000000000..a29c3d762
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb
@@ -0,0 +1,283 @@
+#
+# Copyright (C) 2010 Intel Corporation
+#
+
+SUMMARY = "Linux Standard Base (LSB)"
+DESCRIPTION = "Packages required to satisfy the Linux Standard Base (LSB) specification"
+PR = "r10"
+LICENSE = "MIT"
+
+inherit packagegroup distro_features_check
+
+# The libxt, libxtst and others require x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+#
+# We will skip parsing this packagegeoup for non-glibc systems
+#
+python __anonymous () {
+ if d.getVar('TCLIBC', True) != "glibc":
+ raise bb.parse.SkipPackage("incompatible with %s C library" %
+ d.getVar('TCLIBC', True))
+}
+
+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 \
+ mc-helpers-python \
+ mdadm \
+ minicom \
+ neon \
+ 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 \
+ mailx \
+ make \
+ man \
+ man-pages \
+ mktemp \
+ msmtp \
+ patch \
+ pax \
+ procps \
+ psmisc \
+ sed \
+ shadow \
+ tar \
+ time \
+ util-linux \
+ xdg-utils \
+ \
+ glibc \
+ libgcc \
+ libpam \
+ libxml2 \
+ ncurses \
+ zlib \
+ nspr \
+ libpng12 \
+ 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 \
+"
+
+def get_libqt3(d):
+ if 'linuxstdbase' in d.getVar('DISTROOVERRIDES', False) or "":
+ if 'qt3' in d.getVar('BBFILE_COLLECTIONS', False) or "":
+ return 'libqt-mt3'
+
+ bb.warn('The meta-qt3 layer should be added, this layer provides Qt 3.x' \
+ 'libraries. Its intended use is for passing LSB tests as Qt3 is' \
+ 'a requirement for LSB.')
+ return ''
+
+QT4PKGS = " \
+ libqtcore4 \
+ libqtgui4 \
+ libqtsql4 \
+ libqtsvg4 \
+ libqtxml4 \
+ libqtnetwork4 \
+ qt4-plugin-sqldriver-sqlite \
+ ${@bb.utils.contains("DISTRO_FEATURES", "opengl", "libqtopengl4", "", d)} \
+ "
+QT4PKGS_mips64 = ""
+QT4PKGS_mips64n32 = ""
+
+def get_libqt4(d):
+ if 'linuxstdbase' in d.getVar('DISTROOVERRIDES', False) or "":
+ if 'qt4' in d.getVar('BBFILE_COLLECTIONS', False) or "":
+ return d.getVar('QT4PKGS', False)
+
+ bb.warn('The meta-qt4 layer should be added, this layer provides Qt 4.x' \
+ 'libraries. Its intended use is for passing LSB tests as Qt4 is' \
+ 'a requirement for LSB.')
+ return ''
+
+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 \
+ ${@get_libqt4(d)} \
+ ${@get_libqt3(d)} \
+"
+
+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 \
+ libclass-isa-perl \
+ libenv-perl \
+ libdumpvalue-perl \
+ libfile-checktree-perl \
+ libi18n-collate-perl \
+ libpod-plainer-perl \
+"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/0001-Add-support-for-defining-missing-funcitonality.patch b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/0001-Add-support-for-defining-missing-funcitonality.patch
new file mode 100644
index 000000000..c55b64813
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/99_pam b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/99_pam
new file mode 100644
index 000000000..97e990d10
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/99_pam
@@ -0,0 +1 @@
+d root root 0755 /var/run/sepermit none
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/crypt_configure.patch b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/crypt_configure.patch
new file mode 100644
index 000000000..bec82a5f1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/crypt_configure.patch
@@ -0,0 +1,31 @@
+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>
+
+Index: Linux-PAM-1.1.6/configure.in
+===================================================================
+--- Linux-PAM-1.1.6.org/configure.ac
++++ Linux-PAM-1.1.6/configure.ac
+@@ -400,7 +400,9 @@ AS_IF([test "x$ac_cv_header_xcrypt_h" =
+ [crypt_libs="crypt"])
+
+ BACKUP_LIBS=$LIBS
+-AC_SEARCH_LIBS([crypt],[$crypt_libs], LIBCRYPT="-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)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/fixsepbuild.patch b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/fixsepbuild.patch
new file mode 100644
index 000000000..8a9c3b2fa
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/include_paths_header.patch b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/include_paths_header.patch
new file mode 100644
index 000000000..e4eb95669
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/libpam-xtests-remove-bash-dependency.patch b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/libpam-xtests-remove-bash-dependency.patch
new file mode 100644
index 000000000..680029ae0
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/libpam-xtests.patch b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/libpam-xtests.patch
new file mode 100644
index 000000000..be687457f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/libpam-xtests.patch
@@ -0,0 +1,35 @@
+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>
+--- Linux-PAM-1.1.4/xtests/Makefile.am.orig 2011-07-19 17:00:09.619980001 +0800
++++ Linux-PAM-1.1.4/xtests/Makefile.am 2011-07-19 16:54:00.229979998 +0800
+@@ -7,7 +7,7 @@
+ AM_LDFLAGS = -L$(top_builddir)/libpam -lpam \
+ -L$(top_builddir)/libpam_misc -lpam_misc
+
+-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 @@
+
+ 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/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam-no-innetgr.patch b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam-no-innetgr.patch
new file mode 100644
index 000000000..5e551ac48
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam-no-innetgr.patch
@@ -0,0 +1,97 @@
+innetgr may not be there so make sure that when innetgr is not present
+then we inform about it and not use it.
+
+-Khem
+
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+Index: Linux-PAM-1.1.3/modules/pam_group/pam_group.c
+===================================================================
+--- Linux-PAM-1.1.3.orig/modules/pam_group/pam_group.c
++++ Linux-PAM-1.1.3/modules/pam_group/pam_group.c
+@@ -659,7 +659,11 @@ static int check_account(pam_handle_t *p
+ }
+ /* If buffer starts with @, we are using netgroups */
+ if (buffer[0] == '@')
+- good &= innetgr (&buffer[1], NULL, user, NULL);
++#ifdef HAVE_INNETGR
++ good &= innetgr (&buffer[1], NULL, user, NULL);
++#else
++ pam_syslog (pamh, LOG_ERR, "pam_group does not have netgroup support");
++#endif
+ /* otherwise, if the buffer starts with %, it's a UNIX group */
+ else if (buffer[0] == '%')
+ good &= pam_modutil_user_in_group_nam_nam(pamh, user, &buffer[1]);
+Index: Linux-PAM-1.1.3/modules/pam_time/pam_time.c
+===================================================================
+--- Linux-PAM-1.1.3.orig/modules/pam_time/pam_time.c
++++ Linux-PAM-1.1.3/modules/pam_time/pam_time.c
+@@ -555,9 +555,13 @@ check_account(pam_handle_t *pamh, const
+ }
+ /* If buffer starts with @, we are using netgroups */
+ if (buffer[0] == '@')
+- good &= innetgr (&buffer[1], NULL, user, NULL);
++#ifdef HAVE_INNETGR
++ good &= innetgr (&buffer[1], NULL, user, NULL);
++#else
++ pam_syslog (pamh, LOG_ERR, "pam_time does not have netgroup support");
++#endif
+ else
+- good &= logic_field(pamh, user, buffer, count, is_same);
++ good &= logic_field(pamh, user, buffer, count, is_same);
+ D(("with user: %s", good ? "passes":"fails" ));
+
+ /* here we get the time field */
+Index: Linux-PAM-1.1.3/modules/pam_succeed_if/pam_succeed_if.c
+===================================================================
+--- Linux-PAM-1.1.3.orig/modules/pam_succeed_if/pam_succeed_if.c
++++ Linux-PAM-1.1.3/modules/pam_succeed_if/pam_succeed_if.c
+@@ -231,18 +231,27 @@ evaluate_notingroup(pam_handle_t *pamh,
+ }
+ /* Return PAM_SUCCESS if the (host,user) is in the netgroup. */
+ static int
+-evaluate_innetgr(const char *host, const char *user, const char *group)
++evaluate_innetgr(const pam_handle_t* pamh, const char *host, const char *user, const char *group)
+ {
++#ifdef HAVE_INNETGR
+ if (innetgr(group, host, user, NULL) == 1)
+ return PAM_SUCCESS;
++#else
++ pam_syslog (pamh, LOG_ERR, "pam_succeed_if does not have netgroup support");
++#endif
++
+ return PAM_AUTH_ERR;
+ }
+ /* Return PAM_SUCCESS if the (host,user) is NOT in the netgroup. */
+ static int
+-evaluate_notinnetgr(const char *host, const char *user, const char *group)
++evaluate_notinnetgr(const pam_handle_t* pamh, const char *host, const char *user, const char *group)
+ {
++#ifdef HAVE_INNETGR
+ if (innetgr(group, host, user, NULL) == 0)
+ return PAM_SUCCESS;
++#else
++ pam_syslog (pamh, LOG_ERR, "pam_succeed_if does not have netgroup support");
++#endif
+ return PAM_AUTH_ERR;
+ }
+
+@@ -361,14 +370,14 @@ evaluate(pam_handle_t *pamh, int debug,
+ const void *rhost;
+ if (pam_get_item(pamh, PAM_RHOST, &rhost) != PAM_SUCCESS)
+ rhost = NULL;
+- return evaluate_innetgr(rhost, user, right);
++ return evaluate_innetgr(pamh, rhost, user, right);
+ }
+ /* (Rhost, user) is not in this group. */
+ if (strcasecmp(qual, "notinnetgr") == 0) {
+ const void *rhost;
+ if (pam_get_item(pamh, PAM_RHOST, &rhost) != PAM_SUCCESS)
+ rhost = NULL;
+- return evaluate_notinnetgr(rhost, user, right);
++ return evaluate_notinnetgr(pamh, rhost, user, right);
+ }
+ /* Fail closed. */
+ return PAM_SERVICE_ERR;
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam-security-abstract-securetty-handling.patch b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam-security-abstract-securetty-handling.patch
new file mode 100644
index 000000000..f1834f6ce
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam-security-abstract-securetty-handling.patch
@@ -0,0 +1,200 @@
+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>
+===================================================================
+diff -urpN a/modules/pam_securetty/Makefile.am b/modules/pam_securetty/Makefile.am
+--- a/modules/pam_securetty/Makefile.am 2013-07-05 11:08:23.224483237 +0800
++++ b/modules/pam_securetty/Makefile.am 2013-07-05 11:15:21.304486456 +0800
+@@ -24,6 +24,10 @@ endif
+ securelib_LTLIBRARIES = pam_securetty.la
+ pam_securetty_la_LIBADD = -L$(top_builddir)/libpam -lpam
+
++pam_securetty_la_SOURCES = \
++ pam_securetty.c \
++ tty_secure.c
++
+ if ENABLE_REGENERATE_MAN
+ noinst_DATA = README
+ README: pam_securetty.8.xml
+diff -urpN a/modules/pam_securetty/pam_securetty.c b/modules/pam_securetty/pam_securetty.c
+--- a/modules/pam_securetty/pam_securetty.c 2013-07-05 11:07:50.064483568 +0800
++++ b/modules/pam_securetty/pam_securetty.c 2013-07-05 11:12:23.994483344 +0800
+@@ -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;
+diff -urpN a/modules/pam_securetty/tty_secure.c b/modules/pam_securetty/tty_secure.c
+--- a/modules/pam_securetty/tty_secure.c 1970-01-01 08:30:00.000000000 +0830
++++ b/modules/pam_securetty/tty_secure.c 2013-07-05 11:14:21.534482900 +0800
+@@ -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/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam-unix-nullok-secure.patch b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam-unix-nullok-secure.patch
new file mode 100644
index 000000000..3241e8295
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam-unix-nullok-secure.patch
@@ -0,0 +1,240 @@
+From 9bdc197474795f2d000c2bc04f58f7cef8898f21 Mon Sep 17 00:00:00 2001
+From: Amarnath Valluri <amarnath.valluri@intel.com>
+Date: Wed, 15 Jul 2015 13:07:20 +0300
+Subject: [PATCH] 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>
+
+v2:
+ - Forward ported from v1.1.6 to v1.2.1
+
+Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
+---
+ modules/pam_unix/Makefile.am | 3 ++-
+ modules/pam_unix/README | 11 ++++++++++-
+ modules/pam_unix/pam_unix.8 | 9 ++++++++-
+ modules/pam_unix/pam_unix.8.xml | 19 ++++++++++++++++++-
+ modules/pam_unix/support.c | 40 +++++++++++++++++++++++++++++++++++-----
+ modules/pam_unix/support.h | 8 ++++++--
+ 6 files changed, 79 insertions(+), 11 deletions(-)
+
+diff --git a/modules/pam_unix/Makefile.am b/modules/pam_unix/Makefile.am
+index 56ed591..9a372ac 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@ $(NIS_LIBS)
++ @LIBCRYPT@ @LIBSELINUX@ $(NIS_LIBS) \
++ ../pam_securetty/tty_secure.lo
+
+ securelib_LTLIBRARIES = pam_unix.la
+
+diff --git a/modules/pam_unix/README b/modules/pam_unix/README
+index 3935dba..7880d91 100644
+--- a/modules/pam_unix/README
++++ b/modules/pam_unix/README
+@@ -67,7 +67,16 @@ nullok
+
+ The default action of this module is to not permit the user access to a
+ service if their official password is blank. The nullok argument overrides
+- this default.
++ this default and allows any user with a blank password to access the
++ service.
++
++nullok_secure
++
++ The default action of this module is to not permit the user access to a
++ service if their official password is blank. The nullok_secure 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.
+
+ try_first_pass
+
+diff --git a/modules/pam_unix/pam_unix.8 b/modules/pam_unix/pam_unix.8
+index 339178b..a4bd906 100644
+--- a/modules/pam_unix/pam_unix.8
++++ b/modules/pam_unix/pam_unix.8
+@@ -92,7 +92,14 @@ Turns off informational messages namely messages about session open and close vi
+ .RS 4
+ The default action of this module is to not permit the user access to a service if their official password is blank\&. The
+ \fBnullok\fR
+-argument overrides this default\&.
++argument overrides this default and allows any user with a blank password to access the service\&.
++.RE
++.PP
++\fBnullok_secure\fR
++.RS 4
++The default action of this module is to not permit the user access to a service if their official password is blank\&. The
++\fBnullok_secure\fR
++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\&.
+ .RE
+ .PP
+ \fBtry_first_pass\fR
+diff --git a/modules/pam_unix/pam_unix.8.xml b/modules/pam_unix/pam_unix.8.xml
+index a8b64bb..1ced6f4 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 abccd82..2361957 100644
+--- a/modules/pam_unix/support.c
++++ b/modules/pam_unix/support.c
+@@ -189,13 +189,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;
++ }
+ }
+ }
+
+@@ -566,6 +575,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 */
+
+@@ -593,7 +603,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";
+@@ -678,6 +697,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);
+@@ -764,7 +794,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 3729ce0..43cdbea 100644
+--- a/modules/pam_unix/support.h
++++ b/modules/pam_unix/support.h
+@@ -99,8 +99,9 @@ typedef struct {
+ #define UNIX_MIN_PASS_LEN 27 /* min length for password */
+ #define UNIX_QUIET 28 /* Don't print informational messages */
+ #define UNIX_DES 29 /* DES, default */
++#define UNIX_NULLOK_SECURE 30 /* NULL passwords allowed only on secure ttys */
+ /* -------------- */
+-#define UNIX_CTRLS_ 30 /* number of ctrl arguments defined */
++#define UNIX_CTRLS_ 31 /* 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))
+
+@@ -118,7 +119,7 @@ static const UNIX_Ctrls unix_args[UNIX_CTRLS_] =
+ /* UNIX_NOT_SET_PASS */ {"not_set_pass", _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_MIN_PASS_LEN */ {"minlen=", _ALL_ON_, 0400000000, 0},
+ /* UNIX_QUIET */ {"quiet", _ALL_ON_, 01000000000, 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)
+@@ -171,6 +173,8 @@ extern int _unix_read_password(pam_handle_t * pamh
+ ,const char *prompt2
+ ,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);
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-account b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-account
new file mode 100644
index 000000000..316b17337
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-auth b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-auth
new file mode 100644
index 000000000..460b69f19
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-password b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-password
new file mode 100644
index 000000000..389605732
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-session b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-session
new file mode 100644
index 000000000..a4a551f71
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-session-noninteractive b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-session-noninteractive
new file mode 100644
index 000000000..b110bb2b4
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/other b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/other
new file mode 100644
index 000000000..ec970ecbe
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/use-utmpx.patch b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/use-utmpx.patch
new file mode 100644
index 000000000..dd04bbb84
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/use-utmpx.patch
@@ -0,0 +1,233 @@
+utmp() may not be configured in and use posix compliant utmpx always
+UTMP is SVID legacy, UTMPX is mandated by POSIX
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Index: Linux-PAM-1.2.1/libpam/pam_modutil_getlogin.c
+===================================================================
+--- Linux-PAM-1.2.1.orig/libpam/pam_modutil_getlogin.c
++++ Linux-PAM-1.2.1/libpam/pam_modutil_getlogin.c
+@@ -10,8 +10,7 @@
+
+ #include <stdlib.h>
+ #include <unistd.h>
+-#include <utmp.h>
+-
++#include <utmpx.h>
+ #define _PAMMODUTIL_GETLOGIN "_pammodutil_getlogin"
+
+ const char *
+@@ -22,7 +21,7 @@ pam_modutil_getlogin(pam_handle_t *pamh)
+ const void *void_curr_tty;
+ const char *curr_tty;
+ char *curr_user;
+- struct utmp *ut, line;
++ struct utmpx *ut, line;
+
+ status = pam_get_data(pamh, _PAMMODUTIL_GETLOGIN, &logname);
+ if (status == PAM_SUCCESS) {
+@@ -48,10 +47,10 @@ pam_modutil_getlogin(pam_handle_t *pamh)
+ }
+ logname = NULL;
+
+- setutent();
++ setutxent();
+ strncpy(line.ut_line, curr_tty, sizeof(line.ut_line));
+
+- if ((ut = getutline(&line)) == NULL) {
++ if ((ut = getutxline(&line)) == NULL) {
+ goto clean_up_and_go_home;
+ }
+
+@@ -74,7 +73,7 @@ pam_modutil_getlogin(pam_handle_t *pamh)
+
+ clean_up_and_go_home:
+
+- endutent();
++ endutxent();
+
+ return logname;
+ }
+Index: Linux-PAM-1.2.1/modules/pam_issue/pam_issue.c
+===================================================================
+--- Linux-PAM-1.2.1.orig/modules/pam_issue/pam_issue.c
++++ Linux-PAM-1.2.1/modules/pam_issue/pam_issue.c
+@@ -25,7 +25,7 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <sys/utsname.h>
+-#include <utmp.h>
++#include <utmpx.h>
+ #include <time.h>
+ #include <syslog.h>
+
+@@ -246,13 +246,13 @@ read_issue_quoted(pam_handle_t *pamh, FI
+ case 'U':
+ {
+ unsigned int users = 0;
+- struct utmp *ut;
+- setutent();
+- while ((ut = getutent())) {
++ struct utmpx *ut;
++ setutxent();
++ while ((ut = getutxent())) {
+ if (ut->ut_type == USER_PROCESS)
+ ++users;
+ }
+- endutent();
++ endutxent();
+ if (c == 'U')
+ snprintf (buf, sizeof buf, "%u %s", users,
+ (users == 1) ? "user" : "users");
+Index: Linux-PAM-1.2.1/modules/pam_lastlog/pam_lastlog.c
+===================================================================
+--- Linux-PAM-1.2.1.orig/modules/pam_lastlog/pam_lastlog.c
++++ Linux-PAM-1.2.1/modules/pam_lastlog/pam_lastlog.c
+@@ -15,8 +15,9 @@
+ #include <errno.h>
+ #ifdef HAVE_UTMP_H
+ # include <utmp.h>
+-#else
+-# include <lastlog.h>
++#endif
++#ifdef HAVE_UTMPX_H
++# include <utmpx.h>
+ #endif
+ #include <pwd.h>
+ #include <stdlib.h>
+@@ -27,6 +28,12 @@
+ #include <syslog.h>
+ #include <unistd.h>
+
++#ifndef HAVE_UTMP_H
++#define UT_LINESIZE 32
++#define UT_HOSTSIZE 32
++#define UT_NAMESIZE 256
++#endif
++
+ #if defined(hpux) || defined(sunos) || defined(solaris)
+ # ifndef _PATH_LASTLOG
+ # define _PATH_LASTLOG "/usr/adm/lastlog"
+@@ -38,7 +45,7 @@
+ # define UT_LINESIZE 12
+ # endif /* UT_LINESIZE */
+ #endif
+-#if defined(hpux)
++#if defined(hpux) || !defined HAVE_UTMP_H
+ struct lastlog {
+ time_t ll_time;
+ char ll_line[UT_LINESIZE];
+@@ -447,8 +454,8 @@ last_login_failed(pam_handle_t *pamh, in
+ {
+ int retval;
+ int fd;
+- struct utmp ut;
+- struct utmp utuser;
++ struct utmpx ut;
++ struct utmpx utuser;
+ int failed = 0;
+ char the_time[256];
+ char *date = NULL;
+Index: Linux-PAM-1.2.1/modules/pam_limits/pam_limits.c
+===================================================================
+--- Linux-PAM-1.2.1.orig/modules/pam_limits/pam_limits.c
++++ Linux-PAM-1.2.1/modules/pam_limits/pam_limits.c
+@@ -33,7 +33,7 @@
+ #include <sys/resource.h>
+ #include <limits.h>
+ #include <glob.h>
+-#include <utmp.h>
++#include <utmpx.h>
+ #ifndef UT_USER /* some systems have ut_name instead of ut_user */
+ #define UT_USER ut_user
+ #endif
+@@ -227,7 +227,7 @@ static int
+ check_logins (pam_handle_t *pamh, const char *name, int limit, int ctrl,
+ struct pam_limit_s *pl)
+ {
+- struct utmp *ut;
++ struct utmpx *ut;
+ int count;
+
+ if (ctrl & PAM_DEBUG_ARG) {
+@@ -242,7 +242,7 @@ check_logins (pam_handle_t *pamh, const
+ return LOGIN_ERR;
+ }
+
+- setutent();
++ setutxent();
+
+ /* Because there is no definition about when an application
+ actually adds a utmp entry, some applications bizarrely do the
+@@ -260,7 +260,7 @@ check_logins (pam_handle_t *pamh, const
+ count = 1;
+ }
+
+- while((ut = getutent())) {
++ while((ut = getutxent())) {
+ #ifdef USER_PROCESS
+ if (ut->ut_type != USER_PROCESS) {
+ continue;
+@@ -296,7 +296,7 @@ check_logins (pam_handle_t *pamh, const
+ break;
+ }
+ }
+- endutent();
++ endutxent();
+ if (count > limit) {
+ if (name) {
+ pam_syslog(pamh, LOG_WARNING,
+Index: Linux-PAM-1.2.1/modules/pam_timestamp/pam_timestamp.c
+===================================================================
+--- Linux-PAM-1.2.1.orig/modules/pam_timestamp/pam_timestamp.c
++++ Linux-PAM-1.2.1/modules/pam_timestamp/pam_timestamp.c
+@@ -56,7 +56,7 @@
+ #include <time.h>
+ #include <sys/time.h>
+ #include <unistd.h>
+-#include <utmp.h>
++#include <utmpx.h>
+ #include <syslog.h>
+ #include <paths.h>
+ #include "hmacsha1.h"
+@@ -197,15 +197,15 @@ timestamp_good(time_t then, time_t now,
+ static int
+ check_login_time(const char *ruser, time_t timestamp)
+ {
+- struct utmp utbuf, *ut;
++ struct utmpx utbuf, *ut;
+ time_t oldest_login = 0;
+
+- setutent();
++ setutxent();
+ while(
+ #ifdef HAVE_GETUTENT_R
+- !getutent_r(&utbuf, &ut)
++ !getutxent_r(&utbuf, &ut)
+ #else
+- (ut = getutent()) != NULL
++ (ut = getutxent()) != NULL
+ #endif
+ ) {
+ if (ut->ut_type != USER_PROCESS) {
+@@ -218,7 +218,7 @@ check_login_time(const char *ruser, time
+ oldest_login = ut->ut_tv.tv_sec;
+ }
+ }
+- endutent();
++ endutxent();
+ if(oldest_login == 0 || timestamp < oldest_login) {
+ return PAM_AUTH_ERR;
+ }
+Index: Linux-PAM-1.2.1/modules/pam_unix/support.c
+===================================================================
+--- Linux-PAM-1.2.1.orig/modules/pam_unix/support.c
++++ Linux-PAM-1.2.1/modules/pam_unix/support.c
+@@ -13,7 +13,6 @@
+ #include <pwd.h>
+ #include <shadow.h>
+ #include <limits.h>
+-#include <utmp.h>
+ #include <errno.h>
+ #include <signal.h>
+ #include <ctype.h>
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pam/libpam_1.2.1.bb b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam_1.2.1.bb
new file mode 100644
index 000000000..341ea2411
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam_1.2.1.bb
@@ -0,0 +1,171 @@
+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] = "9dc53067556d2dd567808fd509519dd6"
+SRC_URI[sha256sum] = "342b1211c0d3b203a7df2540a5b03a428a087bd8a48c17e49ae268f992b334d9"
+
+SRC_URI_append_libc-uclibc = " file://pam-no-innetgr.patch \
+ file://use-utmpx.patch"
+
+SRC_URI_append_libc-musl = " file://pam-no-innetgr.patch \
+ file://0001-Add-support-for-defining-missing-funcitonality.patch \
+ file://include_paths_header.patch \
+ "
+
+DEPENDS = "bison flex flex-native cracklib"
+
+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', True) 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, True)
+ if of:
+ nf = of + " " + nf
+ d.setVar('FILES_' + pn, nf)
+
+ def pam_plugin_hook(file, pkg, pattern, format, basename):
+ pn = d.getVar('PN', True)
+ libpam_suffix = d.getVar('libpam_suffix', True)
+
+ rdeps = d.getVar('RDEPENDS_' + pkg, True)
+ if rdeps:
+ rdeps = rdeps + " " + pn + "-" + libpam_suffix
+ else:
+ rdeps = pn + "-" + libpam_suffix
+ d.setVar('RDEPENDS_' + pkg, rdeps)
+
+ provides = d.getVar('RPROVIDES_' + pkg, True)
+ if provides:
+ provides = provides + " " + pkg + "-" + libpam_suffix
+ else:
+ provides = pkg + "-" + libpam_suffix
+ d.setVar('RPROVIDES_' + pkg, provides)
+
+ mlprefix = d.getVar('MLPREFIX', True) or ''
+ dvar = bb.data.expand('${WORKDIR}/package', d, True)
+ 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
+}
+
+python do_pam_sanity () {
+ if not bb.utils.contains('DISTRO_FEATURES', 'pam', True, False, d):
+ bb.warn("Building libpam but 'pam' isn't in DISTRO_FEATURES, PAM won't work correctly")
+}
+addtask pam_sanity before do_configure
+
+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/import-layers/yocto-poky/meta/recipes-extended/parted/files/0001-Include-fcntl.h-in-platform_defs.h.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/parted/files/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/parted/files/Makefile b/import-layers/yocto-poky/meta/recipes-extended/parted/files/Makefile
new file mode 100644
index 000000000..ee90be081
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/parted/files/fix-compile-failure-while-dis.patch b/import-layers/yocto-poky/meta/recipes-extended/parted/files/fix-compile-failure-while-dis.patch
new file mode 100644
index 000000000..68ab715f3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/parted/files/fix-doc-mandir.patch b/import-layers/yocto-poky/meta/recipes-extended/parted/files/fix-doc-mandir.patch
new file mode 100644
index 000000000..0711d4e29
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/parted/files/no_check.patch b/import-layers/yocto-poky/meta/recipes-extended/parted/files/no_check.patch
new file mode 100644
index 000000000..58d8db442
--- /dev/null
+++ b/import-layers/yocto-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-1.9.0/configure.ac
+===================================================================
+--- parted-1.9.0.orig/configure.ac 2009-07-23 18:52:08.000000000 +0100
++++ parted-1.9.0/configure.ac 2010-02-02 14:13:56.013905093 +0000
+@@ -477,7 +477,7 @@
+ AM_CONDITIONAL([BUILD_LINUX], [test "$OS" = linux])
+
+ 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/import-layers/yocto-poky/meta/recipes-extended/parted/files/run-ptest b/import-layers/yocto-poky/meta/recipes-extended/parted/files/run-ptest
new file mode 100644
index 000000000..695c5e8a7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/parted/files/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+make -C tests check-TESTS
diff --git a/import-layers/yocto-poky/meta/recipes-extended/parted/files/syscalls.patch b/import-layers/yocto-poky/meta/recipes-extended/parted/files/syscalls.patch
new file mode 100644
index 000000000..e9bbe9a95
--- /dev/null
+++ b/import-layers/yocto-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-1.9.0/libparted/arch/linux.c
+===================================================================
+--- parted-1.9.0.orig/libparted/arch/linux.c 2009-07-23 18:52:08.000000000 +0100
++++ parted-1.9.0/libparted/arch/linux.c 2010-02-02 14:14:16.523904768 +0000
+@@ -17,6 +17,8 @@
+
+ #define PROC_DEVICES_BUFSIZ 16384
+
++#include <linux/version.h>
++
+ #include <config.h>
+ #include <arch/linux.h>
+
+@@ -1477,12 +1479,14 @@
+
+ #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)
+@@ -1490,11 +1494,20 @@
+ 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/import-layers/yocto-poky/meta/recipes-extended/parted/parted_3.2.bb b/import-layers/yocto-poky/meta/recipes-extended/parted/parted_3.2.bb
new file mode 100644
index 000000000..30c00c861
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/parted/parted_3.2.bb
@@ -0,0 +1,47 @@
+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://run-ptest \
+ file://Makefile \
+"
+
+SRC_URI[md5sum] = "0247b6a7b314f8edeb618159fa95f9cb"
+SRC_URI[sha256sum] = "858b589c22297cacdf437f3baff6f04b333087521ab274f7ab677cb8c6bb78e4"
+
+EXTRA_OECONF = "--disable-device-mapper"
+LDFLAGS_append_libc-uclibc = " -liconv "
+
+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 python"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pax/pax/0001-Fix-build-with-musl.patch b/import-layers/yocto-poky/meta/recipes-extended/pax/pax/0001-Fix-build-with-musl.patch
new file mode 100644
index 000000000..61bf2de5e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pax/pax/0001-Fix-build-with-musl.patch
@@ -0,0 +1,1287 @@
+From 47c4db8d37248d968fac7ee4a71ca64398890723 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 6 Jan 2016 11:57:21 -0800
+Subject: [PATCH] Fix build with musl
+
+Remove BSDisms
+Remove fts, and link to libfts thats provided externally
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Inappropriate[musl specific]
+
+ lib/Makefile.am | 4 +-
+ lib/fts.c | 1025 -------------------------------------------------------
+ lib/fts.h | 131 -------
+ lib/vis.h | 13 +-
+ src/Makefile.am | 2 +-
+ src/extern.h | 2 -
+ src/file_subs.c | 2 +-
+ src/tables.c | 2 +-
+ 8 files changed, 14 insertions(+), 1167 deletions(-)
+ delete mode 100644 lib/fts.c
+ delete mode 100644 lib/fts.h
+
+diff --git a/lib/Makefile.am b/lib/Makefile.am
+index 56d0859..7f5045a 100644
+--- a/lib/Makefile.am
++++ b/lib/Makefile.am
+@@ -8,8 +8,8 @@ AUTOMAKE_OPTIONS = 1.7 gnits
+ CLEANFILES = *~
+
+ noinst_LIBRARIES = libbsdfunc.a
+-noinst_HEADERS = vis.h bsdfunc.h fts.h
++noinst_HEADERS = vis.h bsdfunc.h
+
+ AM_CFLAGS = @EXTRA_CFLAGS@
+
+-libbsdfunc_a_SOURCES = vis.c strlcpy.c strmode.c fts.c
++libbsdfunc_a_SOURCES = vis.c strlcpy.c strmode.c
+diff --git a/lib/fts.c b/lib/fts.c
+deleted file mode 100644
+index 45e90ca..0000000
+--- a/lib/fts.c
++++ /dev/null
+@@ -1,1025 +0,0 @@
+-/*-
+- * Copyright (c) 1990, 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.
+- * 4. 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.
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-#include <config.h>
+-#endif
+-
+-#include <sys/stat.h>
+-#include <fcntl.h>
+-#include <dirent.h>
+-#include <errno.h>
+-#include <fts.h>
+-#include <stdlib.h>
+-#include <string.h>
+-#include <unistd.h>
+-
+-/* Largest alignment size needed, minus one.
+- Usually long double is the worst case. */
+-#ifndef ALIGNBYTES
+-#define ALIGNBYTES (__alignof__ (long double) - 1)
+-#endif
+-/* Align P to that size. */
+-#ifndef ALIGN
+-#define ALIGN(p) (((unsigned long int) (p) + ALIGNBYTES) & ~ALIGNBYTES)
+-#endif
+-
+-
+-static FTSENT *fts_alloc (FTS *, const char *, int);
+-static FTSENT *fts_build (FTS *, int);
+-static void fts_lfree (FTSENT *);
+-static void fts_load (FTS *, FTSENT *);
+-static size_t fts_maxarglen (char * const *);
+-static void fts_padjust (FTS *, FTSENT *);
+-static int fts_palloc (FTS *, size_t);
+-static FTSENT *fts_sort (FTS *, FTSENT *, int);
+-static u_short fts_stat (FTS *, FTSENT *, int);
+-static int fts_safe_changedir (FTS *, FTSENT *, int, const char *);
+-
+-#ifndef MAX
+-#define MAX(a, b) (a > b ? a : b)
+-#endif
+-
+-#define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2])))
+-
+-#define CLR(opt) (sp->fts_options &= ~(opt))
+-#define ISSET(opt) (sp->fts_options & (opt))
+-#define SET(opt) (sp->fts_options |= (opt))
+-
+-#define FCHDIR(sp, fd) (!ISSET(FTS_NOCHDIR) && fchdir(fd))
+-
+-#define BREAD 3 /* fts_read */
+-
+-FTS *
+-fts_open(argv, koptions, compar)
+- char * const *argv;
+- register int koptions;
+- int (*compar) (const FTSENT **, const FTSENT **);
+-{
+- register FTS *sp;
+- register FTSENT *p, *root;
+- register int nitems;
+- FTSENT *parent, *tmp;
+- int len;
+-
+-tmp = NULL; /* stop compiler whinging */
+- /* Options check. */
+- if (koptions & ~FTS_OPTIONMASK) {
+- errno = EINVAL;
+- return (NULL);
+- }
+-
+- /* Allocate/initialize the stream */
+- if ((sp = malloc((u_int)sizeof(FTS))) == NULL)
+- return (NULL);
+- memset(sp, 0, sizeof(FTS));
+- sp->fts_compar = (int (*) (const void *, const void *)) compar;
+- sp->fts_options = koptions;
+-
+- /* Logical walks turn on NOCHDIR; symbolic links are too hard. */
+- if (ISSET(FTS_LOGICAL))
+- SET(FTS_NOCHDIR);
+-
+- /*
+- * Start out with 1K of path space, and enough, in any case,
+- * to hold the user's paths.
+- */
+-#ifndef MAXPATHLEN
+-#define MAXPATHLEN 1024
+-#endif
+- if (fts_palloc(sp, MAX(fts_maxarglen(argv), MAXPATHLEN)))
+- goto mem1;
+-
+- /* Allocate/initialize root's parent. */
+- if ((parent = fts_alloc(sp, "", 0)) == NULL)
+- goto mem2;
+- parent->fts_level = FTS_ROOTPARENTLEVEL;
+-
+- /* Allocate/initialize root(s). */
+- for (root = NULL, nitems = 0; *argv != NULL; ++argv, ++nitems) {
+- /* Don't allow zero-length paths. */
+- if ((len = strlen(*argv)) == 0) {
+- errno = ENOENT;
+- goto mem3;
+- }
+-
+- p = fts_alloc(sp, *argv, len);
+- p->fts_level = FTS_ROOTLEVEL;
+- p->fts_parent = parent;
+- p->fts_accpath = p->fts_name;
+- p->fts_info = fts_stat(sp, p, ISSET(FTS_COMFOLLOW));
+-
+- /* Command-line "." and ".." are real directories. */
+- if (p->fts_info == FTS_DOT)
+- p->fts_info = FTS_D;
+-
+- /*
+- * If comparison routine supplied, traverse in sorted
+- * order; otherwise traverse in the order specified.
+- */
+- if (compar) {
+- p->fts_link = root;
+- root = p;
+- } else {
+- p->fts_link = NULL;
+- if (root == NULL)
+- tmp = root = p;
+- else {
+- tmp->fts_link = p;
+- tmp = p;
+- }
+- }
+- }
+- if (compar && nitems > 1)
+- root = fts_sort(sp, root, nitems);
+-
+- /*
+- * Allocate a dummy pointer and make fts_read think that we've just
+- * finished the node before the root(s); set p->fts_info to FTS_INIT
+- * so that everything about the "current" node is ignored.
+- */
+- if ((sp->fts_cur = fts_alloc(sp, "", 0)) == NULL)
+- goto mem3;
+- sp->fts_cur->fts_link = root;
+- sp->fts_cur->fts_info = FTS_INIT;
+-
+- /*
+- * If using chdir(2), grab a file descriptor pointing to dot to ensure
+- * that we can get back here; this could be avoided for some paths,
+- * but almost certainly not worth the effort. Slashes, symbolic links,
+- * and ".." are all fairly nasty problems. Note, if we can't get the
+- * descriptor we run anyway, just more slowly.
+- */
+- if (!ISSET(FTS_NOCHDIR)
+- && (sp->fts_rfd = open(".", O_RDONLY, 0)) < 0)
+- SET(FTS_NOCHDIR);
+-
+- return (sp);
+-
+-mem3: fts_lfree(root);
+- free(parent);
+-mem2: free(sp->fts_path);
+-mem1: free(sp);
+- return (NULL);
+-}
+-
+-static void
+-fts_load(sp, p)
+- FTS *sp;
+- register FTSENT *p;
+-{
+- register int len;
+- register char *cp;
+-
+- /*
+- * Load the stream structure for the next traversal. Since we don't
+- * actually enter the directory until after the preorder visit, set
+- * the fts_accpath field specially so the chdir gets done to the right
+- * place and the user can access the first node. From fts_open it's
+- * known that the path will fit.
+- */
+- len = p->fts_pathlen = p->fts_namelen;
+- memmove(sp->fts_path, p->fts_name, len + 1);
+- if ((cp = strrchr(p->fts_name, '/')) && (cp != p->fts_name || cp[1])) {
+- len = strlen(++cp);
+- memmove(p->fts_name, cp, len + 1);
+- p->fts_namelen = len;
+- }
+- p->fts_accpath = p->fts_path = sp->fts_path;
+- sp->fts_dev = p->fts_dev;
+-}
+-
+-int
+-fts_close(sp)
+- FTS *sp;
+-{
+- register FTSENT *freep, *p;
+- int saved_errno;
+-
+- /*
+- * This still works if we haven't read anything -- the dummy structure
+- * points to the root list, so we step through to the end of the root
+- * list which has a valid parent pointer.
+- */
+- if (sp->fts_cur) {
+- for (p = sp->fts_cur; p->fts_level >= FTS_ROOTLEVEL;) {
+- freep = p;
+- p = p->fts_link != NULL ? p->fts_link : p->fts_parent;
+- free(freep);
+- }
+- free(p);
+- }
+-
+- /* Free up child linked list, sort array, path buffer. */
+- if (sp->fts_child)
+- fts_lfree(sp->fts_child);
+- if (sp->fts_array)
+- free(sp->fts_array);
+- free(sp->fts_path);
+-
+- /* Return to original directory, save errno if necessary. */
+- if (!ISSET(FTS_NOCHDIR)) {
+- saved_errno = fchdir(sp->fts_rfd) ? errno : 0;
+- (void)close(sp->fts_rfd);
+-
+- /* Set errno and return. */
+- if (saved_errno != 0) {
+- /* Free up the stream pointer. */
+- free(sp);
+- errno = saved_errno;
+- return (-1);
+- }
+- }
+-
+- /* Free up the stream pointer. */
+- free(sp);
+- return (0);
+-}
+-
+-/*
+- * Special case of "/" at the end of the path so that slashes aren't
+- * appended which would cause paths to be written as "....//foo".
+- */
+-#define NAPPEND(p) \
+- (p->fts_path[p->fts_pathlen - 1] == '/' \
+- ? p->fts_pathlen - 1 : p->fts_pathlen)
+-
+-FTSENT *
+-fts_read(sp)
+- register FTS *sp;
+-{
+- register FTSENT *p, *tmp;
+- register int instr;
+- register char *t;
+- int saved_errno;
+-
+- /* If finished or unrecoverable error, return NULL. */
+- if (sp->fts_cur == NULL || ISSET(FTS_STOP))
+- return (NULL);
+-
+- /* Set current node pointer. */
+- p = sp->fts_cur;
+-
+- /* Save and zero out user instructions. */
+- instr = p->fts_instr;
+- p->fts_instr = FTS_NOINSTR;
+-
+- /* Any type of file may be re-visited; re-stat and re-turn. */
+- if (instr == FTS_AGAIN) {
+- p->fts_info = fts_stat(sp, p, 0);
+- return (p);
+- }
+-
+- /*
+- * Following a symlink -- SLNONE test allows application to see
+- * SLNONE and recover. If indirecting through a symlink, have
+- * keep a pointer to current location. If unable to get that
+- * pointer, follow fails.
+- */
+- if (instr == FTS_FOLLOW &&
+- (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) {
+- p->fts_info = fts_stat(sp, p, 1);
+- if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) {
+- if ((p->fts_symfd = open(".", O_RDONLY, 0)) < 0) {
+- p->fts_errno = errno;
+- p->fts_info = FTS_ERR;
+- } else
+- p->fts_flags |= FTS_SYMFOLLOW;
+- }
+- return (p);
+- }
+-
+- /* Directory in pre-order. */
+- if (p->fts_info == FTS_D) {
+- /* If skipped or crossed mount point, do post-order visit. */
+- if (instr == FTS_SKIP ||
+- (ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev)) {
+- if (p->fts_flags & FTS_SYMFOLLOW)
+- (void)close(p->fts_symfd);
+- if (sp->fts_child) {
+- fts_lfree(sp->fts_child);
+- sp->fts_child = NULL;
+- }
+- p->fts_info = FTS_DP;
+- return (p);
+- }
+-
+- /* Rebuild if only read the names and now traversing. */
+- if (sp->fts_child != NULL && ISSET(FTS_NAMEONLY)) {
+- CLR(FTS_NAMEONLY);
+- fts_lfree(sp->fts_child);
+- sp->fts_child = NULL;
+- }
+-
+- /*
+- * Cd to the subdirectory.
+- *
+- * If have already read and now fail to chdir, whack the list
+- * to make the names come out right, and set the parent errno
+- * so the application will eventually get an error condition.
+- * Set the FTS_DONTCHDIR flag so that when we logically change
+- * directories back to the parent we don't do a chdir.
+- *
+- * If haven't read do so. If the read fails, fts_build sets
+- * FTS_STOP or the fts_info field of the node.
+- */
+- if (sp->fts_child != NULL) {
+- if (fts_safe_changedir(sp, p, -1, p->fts_accpath)) {
+- p->fts_errno = errno;
+- p->fts_flags |= FTS_DONTCHDIR;
+- for (p = sp->fts_child; p != NULL;
+- p = p->fts_link)
+- p->fts_accpath =
+- p->fts_parent->fts_accpath;
+- }
+- } else if ((sp->fts_child = fts_build(sp, BREAD)) == NULL) {
+- if (ISSET(FTS_STOP))
+- return (NULL);
+- return (p);
+- }
+- p = sp->fts_child;
+- sp->fts_child = NULL;
+- goto name;
+- }
+-
+- /* Move to the next node on this level. */
+-next: tmp = p;
+- if ((p = p->fts_link) != NULL) {
+- free(tmp);
+-
+- /*
+- * If reached the top, return to the original directory (or
+- * the root of the tree), and load the paths for the next root.
+- */
+- if (p->fts_level == FTS_ROOTLEVEL) {
+- if (FCHDIR(sp, sp->fts_rfd)) {
+- SET(FTS_STOP);
+- return (NULL);
+- }
+- fts_load(sp, p);
+- return (sp->fts_cur = p);
+- }
+-
+- /*
+- * User may have called fts_set on the node. If skipped,
+- * ignore. If followed, get a file descriptor so we can
+- * get back if necessary.
+- */
+- if (p->fts_instr == FTS_SKIP)
+- goto next;
+- if (p->fts_instr == FTS_FOLLOW) {
+- p->fts_info = fts_stat(sp, p, 1);
+- if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) {
+- if ((p->fts_symfd =
+- open(".", O_RDONLY, 0)) < 0) {
+- p->fts_errno = errno;
+- p->fts_info = FTS_ERR;
+- } else
+- p->fts_flags |= FTS_SYMFOLLOW;
+- }
+- p->fts_instr = FTS_NOINSTR;
+- }
+-
+-name: t = sp->fts_path + NAPPEND(p->fts_parent);
+- *t++ = '/';
+- memmove(t, p->fts_name, p->fts_namelen + 1);
+- return (sp->fts_cur = p);
+- }
+-
+- /* Move up to the parent node. */
+- p = tmp->fts_parent;
+- free(tmp);
+-
+- if (p->fts_level == FTS_ROOTPARENTLEVEL) {
+- /*
+- * Done; free everything up and set errno to 0 so the user
+- * can distinguish between error and EOF.
+- */
+- free(p);
+- errno = 0;
+- return (sp->fts_cur = NULL);
+- }
+-
+- /* NUL terminate the pathname. */
+- sp->fts_path[p->fts_pathlen] = '\0';
+-
+- /*
+- * Return to the parent directory. If at a root node or came through
+- * a symlink, go back through the file descriptor. Otherwise, cd up
+- * one directory.
+- */
+- if (p->fts_level == FTS_ROOTLEVEL) {
+- if (FCHDIR(sp, sp->fts_rfd)) {
+- SET(FTS_STOP);
+- return (NULL);
+- }
+- } else if (p->fts_flags & FTS_SYMFOLLOW) {
+- if (FCHDIR(sp, p->fts_symfd)) {
+- saved_errno = errno;
+- (void)close(p->fts_symfd);
+- errno = saved_errno;
+- SET(FTS_STOP);
+- return (NULL);
+- }
+- (void)close(p->fts_symfd);
+- } else if (!(p->fts_flags & FTS_DONTCHDIR) &&
+- fts_safe_changedir(sp, p->fts_parent, -1, "..")) {
+- SET(FTS_STOP);
+- return (NULL);
+- }
+- p->fts_info = p->fts_errno ? FTS_ERR : FTS_DP;
+- return (sp->fts_cur = p);
+-}
+-
+-/*
+- * Fts_set takes the stream as an argument although it's not used in this
+- * implementation; it would be necessary if anyone wanted to add global
+- * semantics to fts using fts_set. An error return is allowed for similar
+- * reasons.
+- */
+-/* ARGSUSED */
+-int
+-fts_set(sp, p, instr)
+- FTS __attribute__((__unused__)) *sp;
+- FTSENT *p;
+- int instr;
+-{
+-sp = NULL; /* stop compiler whinging */
+- if (instr != 0 && instr != FTS_AGAIN && instr != FTS_FOLLOW &&
+- instr != FTS_NOINSTR && instr != FTS_SKIP) {
+- errno = EINVAL;
+- return (1);
+- }
+- p->fts_instr = instr;
+- return (0);
+-}
+-
+-/*
+- * This is the tricky part -- do not casually change *anything* in here. The
+- * idea is to build the linked list of entries that are used by fts_children
+- * and fts_read. There are lots of special cases.
+- *
+- * The real slowdown in walking the tree is the stat calls. If FTS_NOSTAT is
+- * set and it's a physical walk (so that symbolic links can't be directories),
+- * we can do things quickly. First, if it's a 4.4BSD file system, the type
+- * of the file is in the directory entry. Otherwise, we assume that the number
+- * of subdirectories in a node is equal to the number of links to the parent.
+- * The former skips all stat calls. The latter skips stat calls in any leaf
+- * directories and for any files after the subdirectories in the directory have
+- * been found, cutting the stat calls by about 2/3.
+- */
+-static FTSENT *
+-fts_build(sp, type)
+- register FTS *sp;
+- int type;
+-{
+- register struct dirent *dp;
+- register FTSENT *p, *head;
+- register int nitems;
+- FTSENT *cur, *tail;
+- DIR *dirp;
+- void *oldaddr;
+- int cderrno, descend, len, level, nlinks, saved_errno,
+- nostat, doadjust;
+- size_t maxlen;
+- char *cp;
+-
+- /* Set current node pointer. */
+- cur = sp->fts_cur;
+-
+- /*
+- * Open the directory for reading. If this fails, we're done.
+- * If being called from fts_read, set the fts_info field.
+- */
+- if ((dirp = opendir(cur->fts_accpath)) == NULL) {
+- if (type == BREAD) {
+- cur->fts_info = FTS_DNR;
+- cur->fts_errno = errno;
+- }
+- return (NULL);
+- }
+-
+- /*
+- * Nlinks is the number of possible entries of type directory in the
+- * directory if we're cheating on stat calls, 0 if we're not doing
+- * any stat calls at all, -1 if we're doing stats on everything.
+- */
+- nlinks = -1;
+- nostat = 0;
+-
+- /*
+- * If we're going to need to stat anything or we want to descend
+- * and stay in the directory, chdir. If this fails we keep going,
+- * but set a flag so we don't chdir after the post-order visit.
+- * We won't be able to stat anything, but we can still return the
+- * names themselves. Note, that since fts_read won't be able to
+- * chdir into the directory, it will have to return different path
+- * names than before, i.e. "a/b" instead of "b". Since the node
+- * has already been visited in pre-order, have to wait until the
+- * post-order visit to return the error. There is a special case
+- * here, if there was nothing to stat then it's not an error to
+- * not be able to stat. This is all fairly nasty. If a program
+- * needed sorted entries or stat information, they had better be
+- * checking FTS_NS on the returned nodes.
+- */
+- cderrno = 0;
+- if (nlinks || type == BREAD) {
+- if (fts_safe_changedir(sp, cur, dirfd(dirp), NULL)) {
+- if (nlinks && type == BREAD)
+- cur->fts_errno = errno;
+- cur->fts_flags |= FTS_DONTCHDIR;
+- descend = 0;
+- cderrno = errno;
+- (void)closedir(dirp);
+- dirp = NULL;
+- } else
+- descend = 1;
+- } else
+- descend = 0;
+-
+- /*
+- * Figure out the max file name length that can be stored in the
+- * current path -- the inner loop allocates more path as necessary.
+- * We really wouldn't have to do the maxlen calculations here, we
+- * could do them in fts_read before returning the path, but it's a
+- * lot easier here since the length is part of the dirent structure.
+- *
+- * If not changing directories set a pointer so that can just append
+- * each new name into the path.
+- */
+- len = NAPPEND(cur);
+- if (ISSET(FTS_NOCHDIR)) {
+- cp = sp->fts_path + len;
+- *cp++ = '/';
+- } else {
+- /* GCC, you're too verbose. */
+- cp = NULL;
+- }
+- len++;
+- maxlen = sp->fts_pathlen - len;
+-
+- level = cur->fts_level + 1;
+-
+- /* Read the directory, attaching each entry to the `link' pointer. */
+- doadjust = 0;
+- for (head = tail = NULL, nitems = 0; dirp && (dp = readdir(dirp));) {
+- if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name))
+- continue;
+-
+- if ((p = fts_alloc(sp, dp->d_name, (int)_D_EXACT_NAMLEN (dp))) == NULL)
+- goto mem1;
+- if (_D_EXACT_NAMLEN (dp) >= maxlen) {/* include space for NUL */
+- oldaddr = sp->fts_path;
+- if (fts_palloc(sp, _D_EXACT_NAMLEN (dp) + len + 1)) {
+- /*
+- * No more memory for path or structures. Save
+- * errno, free up the current structure and the
+- * structures already allocated.
+- */
+-mem1: saved_errno = errno;
+- if (p)
+- free(p);
+- fts_lfree(head);
+- (void)closedir(dirp);
+- cur->fts_info = FTS_ERR;
+- SET(FTS_STOP);
+- errno = saved_errno;
+- return (NULL);
+- }
+- /* Did realloc() change the pointer? */
+- if (oldaddr != sp->fts_path) {
+- doadjust = 1;
+- if (ISSET(FTS_NOCHDIR))
+- cp = sp->fts_path + len;
+- }
+- maxlen = sp->fts_pathlen - len;
+- }
+-
+- if (len + _D_EXACT_NAMLEN (dp) >= 0x10000) {
+- /*
+- * In an FTSENT, fts_pathlen is a u_short so it is
+- * possible to wraparound here. If we do, free up
+- * the current structure and the structures already
+- * allocated, then error out with ENAMETOOLONG.
+- */
+- free(p);
+- fts_lfree(head);
+- (void)closedir(dirp);
+- cur->fts_info = FTS_ERR;
+- SET(FTS_STOP);
+- errno = ENAMETOOLONG;
+- return (NULL);
+- }
+- p->fts_level = level;
+- p->fts_parent = sp->fts_cur;
+- p->fts_pathlen = len + _D_EXACT_NAMLEN (dp);
+-
+-#if defined FTS_WHITEOUT && 0
+- if (dp->d_type == DT_WHT)
+- p->fts_flags |= FTS_ISW;
+-#endif
+-
+- if (cderrno) {
+- if (nlinks) {
+- p->fts_info = FTS_NS;
+- p->fts_errno = cderrno;
+- } else
+- p->fts_info = FTS_NSOK;
+- p->fts_accpath = cur->fts_accpath;
+- } else if (nlinks == 0
+-#if defined DT_DIR && defined _DIRENT_HAVE_D_TYPE
+- || (nostat &&
+- dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN)
+-#endif
+- ) {
+- p->fts_accpath =
+- ISSET(FTS_NOCHDIR) ? p->fts_path : p->fts_name;
+- p->fts_info = FTS_NSOK;
+- } else {
+- /* Build a file name for fts_stat to stat. */
+- if (ISSET(FTS_NOCHDIR)) {
+- p->fts_accpath = p->fts_path;
+- memmove(cp, p->fts_name, p->fts_namelen + 1);
+- } else
+- p->fts_accpath = p->fts_name;
+- /* Stat it. */
+- p->fts_info = fts_stat(sp, p, 0);
+-
+- /* Decrement link count if applicable. */
+- if (nlinks > 0 && (p->fts_info == FTS_D ||
+- p->fts_info == FTS_DC || p->fts_info == FTS_DOT))
+- --nlinks;
+- }
+-
+- /* We walk in directory order so "ls -f" doesn't get upset. */
+- p->fts_link = NULL;
+- if (head == NULL)
+- head = tail = p;
+- else {
+- tail->fts_link = p;
+- tail = p;
+- }
+- ++nitems;
+- }
+- if (dirp)
+- (void)closedir(dirp);
+-
+- /*
+- * If realloc() changed the address of the path, adjust the
+- * addresses for the rest of the tree and the dir list.
+- */
+- if (doadjust)
+- fts_padjust(sp, head);
+-
+- /*
+- * If not changing directories, reset the path back to original
+- * state.
+- */
+- if (ISSET(FTS_NOCHDIR)) {
+- if (len == sp->fts_pathlen || nitems == 0)
+- --cp;
+- *cp = '\0';
+- }
+-
+- /*
+- * If descended after called from fts_children or after called from
+- * fts_read and nothing found, get back. At the root level we use
+- * the saved fd; if one of fts_open()'s arguments is a relative path
+- * to an empty directory, we wind up here with no other way back. If
+- * can't get back, we're done.
+- */
+- if (descend && nitems == 0 &&
+- (cur->fts_level == FTS_ROOTLEVEL ?
+- FCHDIR(sp, sp->fts_rfd) :
+- fts_safe_changedir(sp, cur->fts_parent, -1, ".."))) {
+- cur->fts_info = FTS_ERR;
+- SET(FTS_STOP);
+- return (NULL);
+- }
+-
+- /* If didn't find anything, return NULL. */
+- if (!nitems) {
+- if (type == BREAD)
+- cur->fts_info = FTS_DP;
+- return (NULL);
+- }
+-
+- /* Sort the entries. */
+- if (sp->fts_compar && nitems > 1)
+- head = fts_sort(sp, head, nitems);
+- return (head);
+-}
+-
+-static u_short
+-fts_stat(sp, p, follow)
+- FTS *sp;
+- register FTSENT *p;
+- int follow;
+-{
+- register FTSENT *t;
+- register dev_t dev;
+- register ino_t ino;
+- struct stat *sbp;
+- int saved_errno;
+-
+- /* If user needs stat info, stat buffer already allocated. */
+- sbp = p->fts_statp;
+-
+-#if defined FTS_WHITEOUT && 0
+- /* check for whiteout */
+- if (p->fts_flags & FTS_ISW) {
+- if (sbp != &sb) {
+- memset(sbp, '\0', sizeof (*sbp));
+- sbp->st_mode = S_IFWHT;
+- }
+- return (FTS_W);
+- }
+-#endif
+-
+- /*
+- * If doing a logical walk, or application requested FTS_FOLLOW, do
+- * a stat(2). If that fails, check for a non-existent symlink. If
+- * fail, set the errno from the stat call.
+- */
+- if (ISSET(FTS_LOGICAL) || follow) {
+- if (stat(p->fts_accpath, sbp)) {
+- saved_errno = errno;
+- if (!lstat(p->fts_accpath, sbp)) {
+- errno = 0;
+- return (FTS_SLNONE);
+- }
+- p->fts_errno = saved_errno;
+- goto err;
+- }
+- } else if (lstat(p->fts_accpath, sbp)) {
+- p->fts_errno = errno;
+-err: memset(sbp, 0, sizeof(struct stat));
+- return (FTS_NS);
+- }
+-
+- if (S_ISDIR(sbp->st_mode)) {
+- /*
+- * Set the device/inode. Used to find cycles and check for
+- * crossing mount points. Also remember the link count, used
+- * in fts_build to limit the number of stat calls. It is
+- * understood that these fields are only referenced if fts_info
+- * is set to FTS_D.
+- */
+- dev = p->fts_dev = sbp->st_dev;
+- ino = p->fts_ino = sbp->st_ino;
+- p->fts_nlink = sbp->st_nlink;
+-
+- if (ISDOT(p->fts_name))
+- return (FTS_DOT);
+-
+- /*
+- * Cycle detection is done by brute force when the directory
+- * is first encountered. If the tree gets deep enough or the
+- * number of symbolic links to directories is high enough,
+- * something faster might be worthwhile.
+- */
+- for (t = p->fts_parent;
+- t->fts_level >= FTS_ROOTLEVEL; t = t->fts_parent)
+- if (ino == t->fts_ino && dev == t->fts_dev) {
+- p->fts_cycle = t;
+- return (FTS_DC);
+- }
+- return (FTS_D);
+- }
+- if (S_ISLNK(sbp->st_mode))
+- return (FTS_SL);
+- if (S_ISREG(sbp->st_mode))
+- return (FTS_F);
+- return (FTS_DEFAULT);
+-}
+-
+-static FTSENT *
+-fts_sort(sp, head, nitems)
+- FTS *sp;
+- FTSENT *head;
+- register int nitems;
+-{
+- register FTSENT **ap, *p;
+-
+- /*
+- * Construct an array of pointers to the structures and call qsort(3).
+- * Reassemble the array in the order returned by qsort. If unable to
+- * sort for memory reasons, return the directory entries in their
+- * current order. Allocate enough space for the current needs plus
+- * 40 so don't realloc one entry at a time.
+- */
+- if (nitems > sp->fts_nitems) {
+- struct _ftsent **a;
+-
+- sp->fts_nitems = nitems + 40;
+- if ((a = realloc(sp->fts_array,
+- (size_t)(sp->fts_nitems * sizeof(FTSENT *)))) == NULL) {
+- free(sp->fts_array);
+- sp->fts_array = NULL;
+- sp->fts_nitems = 0;
+- return (head);
+- }
+- sp->fts_array = a;
+- }
+- for (ap = sp->fts_array, p = head; p; p = p->fts_link)
+- *ap++ = p;
+- qsort((void *)sp->fts_array, nitems, sizeof(FTSENT *), sp->fts_compar);
+- for (head = *(ap = sp->fts_array); --nitems; ++ap)
+- ap[0]->fts_link = ap[1];
+- ap[0]->fts_link = NULL;
+- return (head);
+-}
+-
+-static FTSENT *
+-fts_alloc(sp, name, namelen)
+- FTS *sp;
+- const char *name;
+- register int namelen;
+-{
+- register FTSENT *p;
+- size_t len;
+-
+- /*
+- * The file name is a variable length array and no stat structure is
+- * necessary if the user has set the nostat bit. Allocate the FTSENT
+- * structure, the file name and the stat structure in one chunk, but
+- * be careful that the stat structure is reasonably aligned. Since the
+- * fts_name field is declared to be of size 1, the fts_name pointer is
+- * namelen + 2 before the first possible address of the stat structure.
+- */
+- len = sizeof(FTSENT) + namelen;
+- len += sizeof(struct stat) + ALIGNBYTES;
+- if ((p = malloc(len)) == NULL)
+- return (NULL);
+-
+- /* Copy the name and guarantee NUL termination. */
+- memmove(p->fts_name, name, namelen);
+- p->fts_name[namelen] = '\0';
+-
+- p->fts_statp = (struct stat *)ALIGN(p->fts_name + namelen + 2);
+- p->fts_namelen = namelen;
+- p->fts_path = sp->fts_path;
+- p->fts_errno = 0;
+- p->fts_flags = 0;
+- p->fts_instr = FTS_NOINSTR;
+- p->fts_number = 0;
+- p->fts_pointer = NULL;
+- return (p);
+-}
+-
+-static void
+-fts_lfree(head)
+- register FTSENT *head;
+-{
+- register FTSENT *p;
+-
+- /* Free a linked list of structures. */
+- while ((p = head)) {
+- head = head->fts_link;
+- free(p);
+- }
+-}
+-
+-/*
+- * Allow essentially unlimited paths; find, rm, ls should all work on any tree.
+- * Most systems will allow creation of paths much longer than MAXPATHLEN, even
+- * though the kernel won't resolve them. Add the size (not just what's needed)
+- * plus 256 bytes so don't realloc the path 2 bytes at a time.
+- */
+-static int
+-fts_palloc(sp, more)
+- FTS *sp;
+- size_t more;
+-{
+- char *p;
+-
+- sp->fts_pathlen += more + 256;
+- /*
+- * Check for possible wraparound. In an FTS, fts_pathlen is
+- * a signed int but in an FTSENT it is an unsigned short.
+- * We limit fts_pathlen to USHRT_MAX to be safe in both cases.
+- */
+- if (sp->fts_pathlen < 0 || sp->fts_pathlen >= 0x10000) {
+- if (sp->fts_path) {
+- free(sp->fts_path);
+- sp->fts_path = NULL;
+- }
+- sp->fts_path = NULL;
+- errno = ENAMETOOLONG;
+- return (1);
+- }
+- p = realloc(sp->fts_path, sp->fts_pathlen);
+- if (p == NULL) {
+- free(sp->fts_path);
+- sp->fts_path = NULL;
+- return 1;
+- }
+- sp->fts_path = p;
+- return 0;
+-}
+-
+-/*
+- * When the path is realloc'd, have to fix all of the pointers in structures
+- * already returned.
+- */
+-static void
+-fts_padjust(sp, head)
+- FTS *sp;
+- FTSENT *head;
+-{
+- FTSENT *p;
+- char *addr = sp->fts_path;
+-
+-#define ADJUST(p) do { \
+- if ((p)->fts_accpath != (p)->fts_name) { \
+- (p)->fts_accpath = \
+- (char *)addr + ((p)->fts_accpath - (p)->fts_path); \
+- } \
+- (p)->fts_path = addr; \
+-} while (0)
+- /* Adjust the current set of children. */
+- for (p = sp->fts_child; p; p = p->fts_link)
+- ADJUST(p);
+-
+- /* Adjust the rest of the tree, including the current level. */
+- for (p = head; p->fts_level >= FTS_ROOTLEVEL;) {
+- ADJUST(p);
+- p = p->fts_link ? p->fts_link : p->fts_parent;
+- }
+-}
+-
+-static size_t
+-fts_maxarglen(argv)
+- char * const *argv;
+-{
+- size_t len, max;
+-
+- for (max = 0; *argv; ++argv)
+- if ((len = strlen(*argv)) > max)
+- max = len;
+- return (max + 1);
+-}
+-
+-/*
+- * Change to dir specified by fd or p->fts_accpath without getting
+- * tricked by someone changing the world out from underneath us.
+- * Assumes p->fts_dev and p->fts_ino are filled in.
+- */
+-static int
+-fts_safe_changedir(sp, p, fd, path)
+- FTS *sp;
+- FTSENT *p;
+- int fd;
+- const char *path;
+-{
+- int ret, oerrno, newfd;
+- struct stat sb;
+-
+- newfd = fd;
+- if (ISSET(FTS_NOCHDIR))
+- return (0);
+- if (fd < 0 && (newfd = open(path, O_RDONLY, 0)) < 0)
+- return (-1);
+- if (fstat(newfd, &sb)) {
+- ret = -1;
+- goto bail;
+- }
+- if (p->fts_dev != sb.st_dev || p->fts_ino != sb.st_ino) {
+- errno = ENOENT; /* disinformation */
+- ret = -1;
+- goto bail;
+- }
+- ret = fchdir(newfd);
+-bail:
+- oerrno = errno;
+- if (fd < 0)
+- (void)close(newfd);
+- errno = oerrno;
+- return (ret);
+-}
+diff --git a/lib/fts.h b/lib/fts.h
+deleted file mode 100644
+index 58846b9..0000000
+--- a/lib/fts.h
++++ /dev/null
+@@ -1,131 +0,0 @@
+-/*
+- * Copyright (c) 1989, 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.
+- * 4. 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.
+- *
+- * @(#)fts.h 8.3 (Berkeley) 8/14/94
+- */
+-
+-#ifndef _FTS_H
+-#define _FTS_H 1
+-
+-#include <features.h>
+-#include <sys/types.h>
+-
+-typedef struct {
+- struct _ftsent *fts_cur; /* current node */
+- struct _ftsent *fts_child; /* linked list of children */
+- struct _ftsent **fts_array; /* sort array */
+- dev_t fts_dev; /* starting device # */
+- char *fts_path; /* path for this descent */
+- int fts_rfd; /* fd for root */
+- int fts_pathlen; /* sizeof(path) */
+- int fts_nitems; /* elements in the sort array */
+- int (*fts_compar) (const void *, const void *); /* compare fn */
+-
+-#define FTS_COMFOLLOW 0x0001 /* follow command line symlinks */
+-#define FTS_LOGICAL 0x0002 /* logical walk */
+-#define FTS_NOCHDIR 0x0004 /* don't change directories */
+-#define FTS_NOSTAT 0x0008 /* don't get stat info */
+-#define FTS_PHYSICAL 0x0010 /* physical walk */
+-#define FTS_SEEDOT 0x0020 /* return dot and dot-dot */
+-#define FTS_XDEV 0x0040 /* don't cross devices */
+-#define FTS_WHITEOUT 0x0080 /* return whiteout information */
+-#define FTS_OPTIONMASK 0x00ff /* valid user option mask */
+-
+-#define FTS_NAMEONLY 0x0100 /* (private) child names only */
+-#define FTS_STOP 0x0200 /* (private) unrecoverable error */
+- int fts_options; /* fts_open options, global flags */
+-} FTS;
+-
+-typedef struct _ftsent {
+- struct _ftsent *fts_cycle; /* cycle node */
+- struct _ftsent *fts_parent; /* parent directory */
+- struct _ftsent *fts_link; /* next file in directory */
+- long fts_number; /* local numeric value */
+- void *fts_pointer; /* local address value */
+- char *fts_accpath; /* access path */
+- char *fts_path; /* root path */
+- int fts_errno; /* errno for this node */
+- int fts_symfd; /* fd for symlink */
+- u_short fts_pathlen; /* strlen(fts_path) */
+- u_short fts_namelen; /* strlen(fts_name) */
+-
+- ino_t fts_ino; /* inode */
+- dev_t fts_dev; /* device */
+- nlink_t fts_nlink; /* link count */
+-
+-#define FTS_ROOTPARENTLEVEL -1
+-#define FTS_ROOTLEVEL 0
+- short fts_level; /* depth (-1 to N) */
+-
+-#define FTS_D 1 /* preorder directory */
+-#define FTS_DC 2 /* directory that causes cycles */
+-#define FTS_DEFAULT 3 /* none of the above */
+-#define FTS_DNR 4 /* unreadable directory */
+-#define FTS_DOT 5 /* dot or dot-dot */
+-#define FTS_DP 6 /* postorder directory */
+-#define FTS_ERR 7 /* error; errno is set */
+-#define FTS_F 8 /* regular file */
+-#define FTS_INIT 9 /* initialized only */
+-#define FTS_NS 10 /* stat(2) failed */
+-#define FTS_NSOK 11 /* no stat(2) requested */
+-#define FTS_SL 12 /* symbolic link */
+-#define FTS_SLNONE 13 /* symbolic link without target */
+-#define FTS_W 14 /* whiteout object */
+- u_short fts_info; /* user flags for FTSENT structure */
+-
+-#define FTS_DONTCHDIR 0x01 /* don't chdir .. to the parent */
+-#define FTS_SYMFOLLOW 0x02 /* followed a symlink to get here */
+- u_short fts_flags; /* private flags for FTSENT structure */
+-
+-#define FTS_AGAIN 1 /* read node again */
+-#define FTS_FOLLOW 2 /* follow symbolic link */
+-#define FTS_NOINSTR 3 /* no instructions */
+-#define FTS_SKIP 4 /* discard node */
+- u_short fts_instr; /* fts_set() instructions */
+-
+- struct stat *fts_statp; /* stat(2) information */
+- char fts_name[1]; /* file name */
+-} FTSENT;
+-
+-__BEGIN_DECLS
+-
+-#define fts_children pax_fts_children
+-#define fts_close pax_fts_close
+-#define fts_open pax_fts_open
+-#define fts_read pax_fts_read
+-#define fts_set pax_fts_set
+-
+-FTSENT *fts_children (FTS *, int);
+-int fts_close (FTS *);
+-FTS *fts_open (char * const *, int,
+- int (*)(const FTSENT **, const FTSENT **));
+-FTSENT *fts_read (FTS *);
+-int fts_set (FTS *, FTSENT *, int) __THROW;
+-__END_DECLS
+-
+-#endif /* fts.h */
+diff --git a/lib/vis.h b/lib/vis.h
+index d34d342..71fa5f4 100644
+--- a/lib/vis.h
++++ b/lib/vis.h
+@@ -73,14 +73,19 @@
+ */
+ #define UNVIS_END 1 /* no more characters */
+
+-#include <sys/cdefs.h>
++#ifndef __P
++#define __P(x) x
++#endif
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ char *vis __P((char *, int, int, int));
+ int strvis __P((char *, const char *, int));
+ int strvisx __P((char *, const char *, size_t, int));
+ int strunvis __P((char *, const char *));
+ int unvis __P((char *, char, int *, int));
+-__END_DECLS
+-
++#ifdef __cplusplus
++}
++#endif
+ #endif /* !_VIS_H_ */
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 5ef52a3..227cdef 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -22,4 +22,4 @@ pax_SOURCES = ar_io.c ar_subs.c buf_subs.c cache.c cpio.c\
+ file_subs.c ftree.c gen_subs.c getoldopt.c options.c\
+ pat_rep.c pax.c sel_subs.c tables.c tar.c tty_subs.c
+
+-pax_LDADD = $(top_builddir)/lib/libbsdfunc.a
++pax_LDADD = $(top_builddir)/lib/libbsdfunc.a -lfts
+diff --git a/src/extern.h b/src/extern.h
+index 361fa81..3ed365d 100644
+--- a/src/extern.h
++++ b/src/extern.h
+@@ -37,8 +37,6 @@
+ * External references from each source file
+ */
+
+-#include <sys/cdefs.h>
+-
+ /*
+ * ar_io.c
+ */
+diff --git a/src/file_subs.c b/src/file_subs.c
+index 5590ff1..15bc339 100644
+--- a/src/file_subs.c
++++ b/src/file_subs.c
+@@ -52,7 +52,7 @@
+ #include "extern.h"
+
+ static int
+-mk_link __P((register char *,register struct stat *,register char *, int));
++mk_link (register char *,register struct stat *,register char *, int);
+
+ /*
+ * routines that deal with file operations such as: creating, removing;
+diff --git a/src/tables.c b/src/tables.c
+index 2275bf7..8fddca4 100644
+--- a/src/tables.c
++++ b/src/tables.c
+@@ -39,7 +39,7 @@
+ #include <sys/time.h>
+ #include <sys/stat.h>
+ #include <sys/param.h>
+-#include <sys/fcntl.h>
++#include <fcntl.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
+--
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pax/pax/0001-use-strtoll-instead-of-strtoq.patch b/import-layers/yocto-poky/meta/recipes-extended/pax/pax/0001-use-strtoll-instead-of-strtoq.patch
new file mode 100644
index 000000000..58ac9ce4a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pax/pax/0001-use-strtoll-instead-of-strtoq.patch
@@ -0,0 +1,33 @@
+From b1f50320332c9c90fa33ab136ef0ec2d12cda461 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 6 Jan 2016 12:30:52 -0800
+Subject: [PATCH] use strtoll instead of strtoq
+
+Use LLONG_MAX instead of LONG_LONG_MAX
+LONG_LONG_MAX is GNU specific
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/options.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/options.c b/src/options.c
+index da8b4cf..c663b4e 100644
+--- a/src/options.c
++++ b/src/options.c
+@@ -1547,8 +1547,8 @@ str_offt (char *val)
+
+ #if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
+ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+- num = strtoq (val, &expr, 0);
+- if ((num == LONG_LONG_MAX) || (num <= 0) || (expr == val))
++ num = strtoll (val, &expr, 0);
++ if ((num == LLONG_MAX) || (num <= 0) || (expr == val))
+ #else
+ num = strtol (val, &expr, 0);
+ if ((num == LONG_MAX) || (num <= 0) || (expr == val))
+--
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pax/pax/fix_for_compile_with_gcc-4.6.0.patch b/import-layers/yocto-poky/meta/recipes-extended/pax/pax/fix_for_compile_with_gcc-4.6.0.patch
new file mode 100644
index 000000000..88779c3bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pax/pax/fix_for_compile_with_gcc-4.6.0.patch
@@ -0,0 +1,25 @@
+Upstream-Status: Pending
+
+This patch fixes this compiler error with gcc 4.6.0
+
+Nitin A Kamble <nitin.a.kamble@intel.com> 2011/05/08
+
+| fts.c: In function 'pax_fts_set':
+| fts.c:469:7: error: parameter 'sp' set but not used [-Werror=unused-but-set-parameter]
+| cc1: all warnings being treated as errors
+|
+| make[2]: *** [fts.o] Error 1
+
+Index: pax-3.4/lib/fts.c
+===================================================================
+--- pax-3.4.orig/lib/fts.c
++++ pax-3.4/lib/fts.c
+@@ -466,7 +466,7 @@ name: t = sp->fts_path + NAPPEND(p->fts
+ /* ARGSUSED */
+ int
+ fts_set(sp, p, instr)
+- FTS *sp;
++ FTS __attribute__((__unused__)) *sp;
+ FTSENT *p;
+ int instr;
+ {
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pax/pax/pax-3.4_fix_for_x32.patch b/import-layers/yocto-poky/meta/recipes-extended/pax/pax/pax-3.4_fix_for_x32.patch
new file mode 100644
index 000000000..80878f38b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pax/pax/pax-3.4_fix_for_x32.patch
@@ -0,0 +1,185 @@
+Upstream-Status: Pending
+
+Author: H.J. Lu <hjl.tools@gmail.com>
+Date: Tue Dec 6 10:34:53 2011 -0800
+
+ Fix pax-3.4 build for x32
+
+ off_t is 8byte for x32. We need to check both _FILE_OFFSET_BITS and
+ size of off_t to see if file offset is 64bit. This patch adds
+ AC_CHECK_SIZEOF(off_t) and checks SIZEOF_OFF_T == 8.
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/06
+
+Index: pax-3.4/configure.in
+===================================================================
+--- pax-3.4.orig/configure.in
++++ pax-3.4/configure.in
+@@ -33,4 +33,7 @@ dnl Checks for header files.
+ dnl Checks for typedefs, structures, and compiler characteristics.
+ AC_C_CONST
+
++AC_CHECK_SIZEOF(off_t)
++AC_CHECK_SIZEOF(long)
++
+ AC_OUTPUT([Makefile lib/Makefile src/Makefile])
+Index: pax-3.4/src/ar_io.c
+===================================================================
+--- pax-3.4.orig/src/ar_io.c
++++ pax-3.4/src/ar_io.c
+@@ -378,7 +378,8 @@ ar_close(void)
+ * could have written anything yet.
+ */
+ if (frmt == NULL) {
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ (void)fprintf(listf, "%s: unknown format, %qu bytes skipped.\n",
+ #else
+ (void)fprintf(listf, "%s: unknown format, %lu bytes skipped.\n",
+@@ -391,7 +392,8 @@ ar_close(void)
+
+ if (strcmp(NM_CPIO, argv0) == 0)
+ (void)fprintf(listf,
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ "%qu blocks\n",
+ #else
+ "%lu blocks\n",
+@@ -399,7 +401,8 @@ ar_close(void)
+ (rdcnt ? rdcnt : wrcnt) / 5120);
+ else if (strcmp(NM_TAR, argv0) != 0)
+ (void)fprintf(listf,
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ "%s: %s vol %d, %lu files, %qu bytes read, %qu bytes written.\n",
+ #else
+ "%s: %s vol %d, %lu files, %lu bytes read, %lu bytes written.\n",
+Index: pax-3.4/src/cpio.c
+===================================================================
+--- pax-3.4.orig/src/cpio.c
++++ pax-3.4/src/cpio.c
+@@ -218,7 +218,8 @@ rd_ln_nm (ARCHD *arcn)
+ */
+ if ((arcn->sb.st_size == 0) ||
+ (arcn->sb.st_size >= (off_t) sizeof(arcn->ln_name))) {
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ paxwarn (1, "Cpio link name length is invalid: %qu",
+ arcn->sb.st_size);
+ #else
+Index: pax-3.4/src/gen_subs.c
+===================================================================
+--- pax-3.4.orig/src/gen_subs.c
++++ pax-3.4/src/gen_subs.c
+@@ -133,7 +133,8 @@ ls_list (ARCHD *arcn, time_t now, FILE *
+ * print device id's for devices, or sizes for other nodes
+ */
+ if ((arcn->type == PAX_CHR) || (arcn->type == PAX_BLK))
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ (void) fprintf (fp, "%4lu,%4lu ", (unsigned long) MAJOR (sbp->st_rdev),
+ (unsigned long) MINOR (sbp->st_rdev));
+ #else
+@@ -142,7 +143,8 @@ ls_list (ARCHD *arcn, time_t now, FILE *
+ #endif
+ else
+ {
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ (void) fprintf (fp, "%9qu ", sbp->st_size);
+ #else
+ (void) fprintf (fp, "%9lu ", sbp->st_size);
+@@ -334,7 +336,8 @@ ul_asc (u_long val, char *str, int len,
+ return (0);
+ }
+
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ /*
+ * asc_uqd()
+ * convert hex/octal character string into a u_quad_t. We do not have to
+Index: pax-3.4/src/options.c
+===================================================================
+--- pax-3.4.orig/src/options.c
++++ pax-3.4/src/options.c
+@@ -1545,7 +1545,8 @@ str_offt (char *val)
+ char *expr;
+ off_t num, t;
+
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ num = strtoq (val, &expr, 0);
+ if ((num == LONG_LONG_MAX) || (num <= 0) || (expr == val))
+ #else
+Index: pax-3.4/src/tar.c
+===================================================================
+--- pax-3.4.orig/src/tar.c
++++ pax-3.4/src/tar.c
+@@ -58,7 +58,8 @@
+ static unsigned long tar_chksm (char *, int);
+ static char *name_split (char *, int);
+ static int ul_oct (u_long, char *, int, int);
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ static int uqd_oct (u_quad_t, char *, int, int);
+ #endif
+
+@@ -196,7 +197,8 @@ ul_oct (u_long val, register char *str,
+ return (0);
+ }
+
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ /*
+ * uqd_oct()
+ * convert an u_quad_t to an octal string. one of many oddball field
+@@ -427,7 +429,8 @@ tar_rd (ARCHD *arcn, char *buf)
+ 0xfff);
+ arcn->sb.st_uid = (uid_t) asc_ul (hd->uid, sizeof (hd->uid), OCT);
+ arcn->sb.st_gid = (gid_t) asc_ul (hd->gid, sizeof (hd->gid), OCT);
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ arcn->sb.st_size = (off_t) asc_uqd (hd->size, sizeof (hd->size), OCT);
+ #else
+ arcn->sb.st_size = (off_t) asc_ul (hd->size, sizeof (hd->size), OCT);
+@@ -659,7 +662,8 @@ tar_wr (register ARCHD * arcn)
+ * data follows this file, so set the pad
+ */
+ hd->linkflag = AREGTYPE;
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ if (uqd_oct ((u_quad_t) arcn->sb.st_size, hd->size,
+ sizeof (hd->size), 1))
+ #else
+@@ -834,7 +838,8 @@ ustar_rd (ARCHD *arcn, char *buf)
+ */
+ arcn->sb.st_mode = (mode_t) (asc_ul (hd->mode, sizeof (hd->mode), OCT) &
+ 0xfff);
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ arcn->sb.st_size = (off_t) asc_uqd (hd->size, sizeof (hd->size), OCT);
+ #else
+ arcn->sb.st_size = (off_t) asc_ul (hd->size, sizeof (hd->size), OCT);
+@@ -1081,7 +1086,8 @@ ustar_wr (register ARCHD * arcn)
+ else
+ hd->typeflag = REGTYPE;
+ arcn->pad = TAR_PAD (arcn->sb.st_size);
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ if (uqd_oct ((u_quad_t) arcn->sb.st_size, hd->size,
+ sizeof (hd->size), 3))
+ {
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pax/pax_3.4.bb b/import-layers/yocto-poky/meta/recipes-extended/pax/pax_3.4.bb
new file mode 100644
index 000000000..9d1abfbb5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pax/pax_3.4.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Portable Archive eXchange"
+DESCRIPTION = "pax (Portable Archive eXchange) is the POSIX standard archive tool"
+HOMEPAGE = "http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/bin/pax/"
+BUGTRACKER = "http://www.openbsd.org/query-pr.html"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4b0b674dfdc56daa3832d4069b820ea0 \
+ file://src/pax.h;endline=40;md5=309d3e241c1d82069228e5a51e9b8d60 \
+ file://src/cpio.h;endline=40;md5=c3b4bbff6133a83387968617bbae8ac4 \
+ file://lib/vis.h;endline=40;md5=b283f759abd4a5ad7e014b80f51fc053"
+
+SECTION = "base"
+PR = "r2"
+
+DEPENDS_append_libc-musl = " fts "
+
+SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/${BPN}/${BP}.tar.bz2/fbd9023b590b45ac3ade95870702a0d6/${BP}.tar.bz2 \
+ file://fix_for_compile_with_gcc-4.6.0.patch \
+ file://pax-3.4_fix_for_x32.patch"
+
+SRC_URI_append_libc-musl = " file://0001-Fix-build-with-musl.patch \
+ file://0001-use-strtoll-instead-of-strtoq.patch \
+ "
+
+SRC_URI[md5sum] = "fbd9023b590b45ac3ade95870702a0d6"
+SRC_URI[sha256sum] = "ac3c06048e02828077cf7757d3d142241429238893b91d529af29a2e8cc5623b"
+
+inherit autotools
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pbzip2/pbzip2_1.1.13.bb b/import-layers/yocto-poky/meta/recipes-extended/pbzip2/pbzip2_1.1.13.bb
new file mode 100644
index 000000000..06d37adc3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/perl/libconvert-asn1-perl_0.27.bb b/import-layers/yocto-poky/meta/recipes-extended/perl/libconvert-asn1-perl_0.27.bb
new file mode 100644
index 000000000..170e7ecde
--- /dev/null
+++ b/import-layers/yocto-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
+
+EXTRA_PERLFLAGS = "-I ${PERLHOSTLIB}"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/perl/libtimedate-perl_2.30.bb b/import-layers/yocto-poky/meta/recipes-extended/perl/libtimedate-perl_2.30.bb
new file mode 100644
index 000000000..c8fcde45f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/perl/libtimedate-perl_2.30.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Perl modules useful for manipulating date and time information"
+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
+
+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/import-layers/yocto-poky/meta/recipes-extended/perl/libxml-namespacesupport-perl_1.11.bb b/import-layers/yocto-poky/meta/recipes-extended/perl/libxml-namespacesupport-perl_1.11.bb
new file mode 100644
index 000000000..9a9e71011
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/perl/libxml-namespacesupport-perl_1.11.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Perl module for supporting simple generic namespaces"
+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+"
+PR = "r3"
+
+LIC_FILES_CHKSUM = "file://META.yml;beginline=22;endline=22;md5=3b2b564dae8b9af9e8896e85c07dcbe5"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/P/PE/PERIGRIN/XML-NamespaceSupport-${PV}.tar.gz"
+SRC_URI[md5sum] = "222cca76161cd956d724286d36b607da"
+SRC_URI[sha256sum] = "6d8151f0a3f102313d76b64bfd1c2d9ed46bfe63a16f038e7d860fda287b74ea"
+
+
+S = "${WORKDIR}/XML-NamespaceSupport-${PV}"
+
+inherit cpan
+
+BBCLASSEXTEND="native"
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/perl/libxml-sax-base-perl_1.08.bb b/import-layers/yocto-poky/meta/recipes-extended/perl/libxml-sax-base-perl_1.08.bb
new file mode 100644
index 000000000..14a337057
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/perl/libxml-sax-base-perl_1.08.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Base class SAX Drivers and Filters"
+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] = "38c8c3247dfd080712596118d70dbe32"
+SRC_URI[sha256sum] = "666270318b15f88b8427e585198abbc19bc2e6ccb36dc4c0a4f2d9807330219e"
+
+S = "${WORKDIR}/XML-SAX-Base-${PV}"
+
+inherit cpan
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/perl/libxml-sax-perl_0.99.bb b/import-layers/yocto-poky/meta/recipes-extended/perl/libxml-sax-perl_0.99.bb
new file mode 100644
index 000000000..45d396639
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/perl/libxml-sax-perl_0.99.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Perl module for using and building Perl SAX2 XML processors"
+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
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz.inc b/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz.inc
new file mode 100644
index 000000000..86f434c10
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz.inc
@@ -0,0 +1,41 @@
+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"
+
+SRC_URI = "http://zlib.net/${BPN}/${BP}.tar.gz"
+
+PROVIDES_class-native += "gzip-native"
+
+DEPENDS = "zlib"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+inherit update-alternatives
+
+do_install_class-target() {
+ # 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
+}
+
+do_install() {
+ install -d ${D}${bindir}
+ install ${B}/pigz ${D}${bindir}/gzip
+ ln -nsf gzip ${D}${bindir}/gunzip
+ ln -nsf gzip ${D}${bindir}/zcat
+}
+
+ALTERNATIVE_PRIORITY = "80"
+ALTERNATIVE_${PN} = "gunzip gzip zcat"
+ALTERNATIVE_${PN}_class-nativesdk = ""
+ALTERNATIVE_LINK_NAME[gunzip] = "${base_bindir}/gunzip"
+ALTERNATIVE_LINK_NAME[gzip] = "${base_bindir}/gzip"
+ALTERNATIVE_LINK_NAME[zcat] = "${base_bindir}/zcat"
+ALTERNATIVE_TARGET = "${base_bindir}/pigz"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz/link-order.patch b/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz/link-order.patch
new file mode 100644
index 000000000..4becc0e3f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz/link-order.patch
@@ -0,0 +1,38 @@
+This patch avoids underlinking issues since we pass -lz via LDFLAGS but it appears
+before pigz.o which needs symbols from libz however due to order linker happily discards libz
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: pigz-2.3.3/Makefile
+===================================================================
+--- pigz-2.3.3.orig/Makefile 2015-01-19 20:12:31.000000000 -0800
++++ pigz-2.3.3/Makefile 2015-01-28 09:11:50.266669184 -0800
+@@ -5,7 +5,7 @@
+ # use gcc and gmake on Solaris
+
+ pigz: pigz.o yarn.o try.o ${ZOPFLI}deflate.o ${ZOPFLI}blocksplitter.o ${ZOPFLI}tree.o ${ZOPFLI}lz77.o ${ZOPFLI}cache.o ${ZOPFLI}hash.o ${ZOPFLI}util.o ${ZOPFLI}squeeze.o ${ZOPFLI}katajainen.o
+- $(CC) $(LDFLAGS) -o pigz $^ -lpthread -lm
++ $(CC) -o pigz $^ $(LDFLAGS) -lz -lpthread -lm
+ ln -f pigz unpigz
+
+ pigz.o: pigz.c yarn.h try.h ${ZOPFLI}deflate.h ${ZOPFLI}util.h
+@@ -35,7 +35,7 @@
+ dev: pigz pigzt pigzn
+
+ pigzt: pigzt.o yarnt.o try.o ${ZOPFLI}deflate.o ${ZOPFLI}blocksplitter.o ${ZOPFLI}tree.o ${ZOPFLI}lz77.o ${ZOPFLI}cache.o ${ZOPFLI}hash.o ${ZOPFLI}util.o ${ZOPFLI}squeeze.o ${ZOPFLI}katajainen.o
+- $(CC) $(LDFLAGS) -o pigzt $^ -lpthread -lm
++ $(CC) -o pigzt $^ $(LDFLAGS) -lz -lpthread -lm
+
+ pigzt.o: pigz.c yarn.h try.h
+ $(CC) $(CFLAGS) -DDEBUG -g -c -o pigzt.o pigz.c
+@@ -44,7 +44,7 @@
+ $(CC) $(CFLAGS) -DDEBUG -g -c -o yarnt.o yarn.c
+
+ pigzn: pigzn.o tryn.o ${ZOPFLI}deflate.o ${ZOPFLI}blocksplitter.o ${ZOPFLI}tree.o ${ZOPFLI}lz77.o ${ZOPFLI}cache.o ${ZOPFLI}hash.o ${ZOPFLI}util.o ${ZOPFLI}squeeze.o ${ZOPFLI}katajainen.o
+- $(CC) $(LDFLAGS) -o pigzn $^ -lm
++ $(CC) -o pigzn $^ $(LDFLAGS) -lz -lm
+
+ pigzn.o: pigz.c try.h
+ $(CC) $(CFLAGS) -DDEBUG -DNOTHREAD -g -c -o pigzn.o pigz.c
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz_2.3.3.bb b/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz_2.3.3.bb
new file mode 100644
index 000000000..080be2bbc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz_2.3.3.bb
@@ -0,0 +1,12 @@
+require pigz.inc
+LIC_FILES_CHKSUM = "file://pigz.c;beginline=7;endline=21;md5=a21d4075cb00ab4ca17fce5e7534ca95"
+
+SRC_URI += "file://link-order.patch"
+
+SRC_URI[md5sum] = "01d7a16cce77929cc1a78aa1bdfb68cb"
+SRC_URI[sha256sum] = "4e8b67b432ce7907575a549f3e1cac4709781ba0f6b48afea9f59369846b509c"
+
+NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}"
+
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pixz/pixz/0001-configure-Detect-headers-before-using-them.patch b/import-layers/yocto-poky/meta/recipes-extended/pixz/pixz/0001-configure-Detect-headers-before-using-them.patch
new file mode 100644
index 000000000..12bae28dc
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/pixz/pixz/0002-endian-Use-macro-bswap_64-instead-of-__bswap_64.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/pixz/pixz/936d8068ae19d95260d3058f41dd6cf718101cd6.patch b/import-layers/yocto-poky/meta/recipes-extended/pixz/pixz/936d8068ae19d95260d3058f41dd6cf718101cd6.patch
new file mode 100644
index 000000000..e3489db5b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/pixz/pixz_1.0.6.bb b/import-layers/yocto-poky/meta/recipes-extended/pixz/pixz_1.0.6.bb
new file mode 100644
index 000000000..0e51472ae
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pixz/pixz_1.0.6.bb
@@ -0,0 +1,24 @@
+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"
+
+EXTRA_OECONF += "--without-manpage"
+CFLAGS_append_libc-musl = " -D_GNU_SOURCE"
+CACHED_CONFIGUREVARS += "ac_cv_file_src_pixz_1=no"
+
+inherit autotools pkgconfig
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/procps/procps/sysctl.conf b/import-layers/yocto-poky/meta/recipes-extended/procps/procps/sysctl.conf
new file mode 100644
index 000000000..34e7488bf
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/procps/procps_3.3.11.bb b/import-layers/yocto-poky/meta/recipes-extended/procps/procps_3.3.11.bb
new file mode 100644
index 000000000..c6dccc677
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/procps/procps_3.3.11.bb
@@ -0,0 +1,66 @@
+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://gitorious.org/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] = "6cc5b94c1c5b8cbc89ad345a7b522f74"
+SRC_URI[sha256sum] = "e9493169a2d2adc0bc045538707310c8e877b385e4e296143b62607d2bb044ed"
+
+S = "${WORKDIR}/procps-ng-${PV}"
+
+EXTRA_OECONF = "--enable-skill --disable-modern-top"
+
+CPPFLAGS += "-I${S}"
+
+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"
+base_bindir_progs += "kill pidof ps watch"
+base_sbindir_progs += "sysctl"
+
+ALTERNATIVE_PRIORITY = "200"
+
+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', True).split():
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir', True), prog))
+
+ for prog in d.getVar('base_sbindir_progs', True).split():
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir', True), prog))
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/psmisc/files/0001-Typo-in-fuser-makes-M-on-all-the-time.patch b/import-layers/yocto-poky/meta/recipes-extended/psmisc/files/0001-Typo-in-fuser-makes-M-on-all-the-time.patch
new file mode 100644
index 000000000..e57d60f6a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/psmisc/files/0001-Typo-in-fuser-makes-M-on-all-the-time.patch
@@ -0,0 +1,46 @@
+From 3638cc55b4d08851faba46635d737b24d016665b Mon Sep 17 00:00:00 2001
+From: Brad Jorsch <anomie@users.sourceforge.net>
+Date: Fri, 28 Feb 2014 21:55:02 +1100
+Subject: [PATCH] Typo in fuser makes -M on all the time
+
+Brad found that fuser had the -M option on all the time.
+A simple but significant typo caused this, thanks the the patch.
+
+Bug-Debian: http://bugs.debian.org/740275
+
+Upstream-Status: Backport
+
+Signed-off-by: Craig Small <csmall@enc.com.au>
+---
+ ChangeLog | 4 ++++
+ src/fuser.c | 2 +-
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index fd1cccf..e5f784c 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,7 @@
++Changes in 22.22
++================
++ * Fixed typo in fuser which has -M on Debian #740275
++
+ Changes in 22.21
+ ================
+ * Missing comma in fuser(1) added Debian #702391
+diff --git a/src/fuser.c b/src/fuser.c
+index b485f65..389b302 100644
+--- a/src/fuser.c
++++ b/src/fuser.c
+@@ -1174,7 +1174,7 @@ int main(int argc, char *argv[])
+ usage(_("No process specification given"));
+
+ /* Check if -M flag was used and if so check mounts */
+- if (opts * OPT_ISMOUNTPOINT) {
++ if (opts & OPT_ISMOUNTPOINT) {
+ check_mountpoints(&mounts, &names_head, &names_tail);
+ }
+
+--
+1.8.4.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/psmisc/files/0002-Include-limits.h-for-PATH_MAX.patch b/import-layers/yocto-poky/meta/recipes-extended/psmisc/files/0002-Include-limits.h-for-PATH_MAX.patch
new file mode 100644
index 000000000..c8afcac8a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/psmisc/files/0002-Include-limits.h-for-PATH_MAX.patch
@@ -0,0 +1,29 @@
+From aa66afecd8ba9cc4139f25ab15ec315173413a7d Mon Sep 17 00:00:00 2001
+From: Paul Barker <paul@paulbarker.me.uk>
+Date: Wed, 20 Aug 2014 10:31:37 +0000
+Subject: [PATCH] Include <limits.h> for PATH_MAX
+
+When building against musl libc, PATH_MAX is defined in <limits.h>.
+
+Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
+
+Upstream-Status: Accepted (Should be in next release after 22.21)
+---
+ src/pstree.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/pstree.c b/src/pstree.c
+index 071e6c4..0d28260 100644
+--- a/src/pstree.c
++++ b/src/pstree.c
+@@ -41,6 +41,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/ioctl.h>
++#include <limits.h>
+
+ #include "i18n.h"
+ #include "comm.h"
+--
+2.0.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/psmisc/psmisc.inc b/import-layers/yocto-poky/meta/recipes-extended/psmisc/psmisc.inc
new file mode 100644
index 000000000..68e06561f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/psmisc/psmisc.inc
@@ -0,0 +1,44 @@
+SUMMARY = "Utilities for managing processes on your system"
+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
+
+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/import-layers/yocto-poky/meta/recipes-extended/psmisc/psmisc/0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch b/import-layers/yocto-poky/meta/recipes-extended/psmisc/psmisc/0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch
new file mode 100644
index 000000000..b57a006bc
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/psmisc/psmisc_22.21.bb b/import-layers/yocto-poky/meta/recipes-extended/psmisc/psmisc_22.21.bb
new file mode 100644
index 000000000..1c6473ebf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/psmisc/psmisc_22.21.bb
@@ -0,0 +1,12 @@
+require psmisc.inc
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
+
+SRC_URI[md5sum] = "935c0fd6eb208288262b385fa656f1bf"
+SRC_URI[sha256sum] = "97323cad619210845b696d7d722c383852b2acb5c49b5b0852c4f29c77a8145a"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/psmisc/psmisc-${PV}.tar.gz \
+ file://0001-Typo-in-fuser-makes-M-on-all-the-time.patch \
+ file://0002-Include-limits.h-for-PATH_MAX.patch \
+ file://0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch \
+ "
diff --git a/import-layers/yocto-poky/meta/recipes-extended/quota/quota/0001-Do-not-accidentaly-override-commandline-passed-CFLAG.patch b/import-layers/yocto-poky/meta/recipes-extended/quota/quota/0001-Do-not-accidentaly-override-commandline-passed-CFLAG.patch
new file mode 100644
index 000000000..6add4708a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/quota/quota/0001-Do-not-accidentaly-override-commandline-passed-CFLAG.patch
@@ -0,0 +1,33 @@
+From 776757a23e9930588950c7fcbc7827ec7a3e51c4 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= <tchvatal@suse.com>
+Date: Mon, 4 Jan 2016 15:48:19 +0100
+Subject: [PATCH] Do not accidentaly override commandline passed CFLAGS.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Backport
+
+Signed-off-by: Tomáš Chvátal <tchvatal@suse.com>
+Signed-off-by: Jan Kara <jack@suse.cz>
+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 3ba1386..1552c15 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -53,7 +53,7 @@ AS_IF([test "x${prefix}" = "xNONE"], [
+ # ================
+ # Check for cflags
+ # ================
+-CFLAGS="-D_GNU_SOURCE -Wall -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
++CFLAGS="$CFLAGS -D_GNU_SOURCE -Wall -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
+ AC_ARG_ENABLE([werror],
+ [AS_HELP_STRING([--enable-werror], [Treat all warnings as errors, useful for development])],
+ [enable_werror="$enableval"],
+--
+2.4.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/quota/quota/0001-Fix-build-with-disabled-ldap.patch b/import-layers/yocto-poky/meta/recipes-extended/quota/quota/0001-Fix-build-with-disabled-ldap.patch
new file mode 100644
index 000000000..a79e47796
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/quota/quota/0001-Fix-build-with-disabled-ldap.patch
@@ -0,0 +1,93 @@
+From 39fd30ce57e3c34c3649866bf9345a71f0b78667 Mon Sep 17 00:00:00 2001
+From: Jan Kara <jack@suse.cz>
+Date: Mon, 4 Jan 2016 15:10:53 +0100
+Subject: [PATCH] Fix build with disabled ldap
+
+Upstream-Status: Backport
+
+Reported-by: Tomas Chvatal <tchvatal@suse.com>
+Signed-off-by: Jan Kara <jack@suse.cz>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ warnquota.c | 36 ++++++++++++++++++------------------
+ 1 file changed, 18 insertions(+), 18 deletions(-)
+
+diff --git a/warnquota.c b/warnquota.c
+index 3734f0e..e9868c1 100644
+--- a/warnquota.c
++++ b/warnquota.c
+@@ -109,13 +109,13 @@ struct configparams {
+ char *user_signature;
+ char *group_message;
+ char *group_signature;
++ time_t cc_before;
++#ifdef USE_LDAP_MAIL_LOOKUP
+ int use_ldap_mail; /* 0 */
++ int ldap_is_setup; /* 0 */
+ int ldap_starttls; /* 0 */
+ int ldap_tls; /* LDAP_OPT_X_TLS_NEVER */
+ int ldap_vers; /* LDAP_VERSION3 */
+- time_t cc_before;
+-#ifdef USE_LDAP_MAIL_LOOKUP
+- int ldap_is_setup; /* 0 */
+ char ldap_host[CNF_BUFFER];
+ int ldap_port;
+ char ldap_uri[CNF_BUFFER];
+@@ -729,13 +729,13 @@ static int readconfigfile(const char *filename, struct configparams *config)
+ }
+ maildev[0] = 0;
+ config->user_signature = config->user_message = config->group_signature = config->group_message = NULL;
++ config->cc_before = -1;
++
++#ifdef USE_LDAP_MAIL_LOOKUP
+ config->use_ldap_mail = 0;
+ config->ldap_starttls = 0;
+ config->ldap_tls = LDAP_OPT_X_TLS_NEVER;
+ config->ldap_vers = LDAP_VERSION3;
+- config->cc_before = -1;
+-
+-#ifdef USE_LDAP_MAIL_LOOKUP
+ config->ldap_port = config->ldap_is_setup = 0;
+ config->ldap_host[0] = 0;
+ config->ldap_uri[0] = 0;
+@@ -820,6 +820,18 @@ static int readconfigfile(const char *filename, struct configparams *config)
+ create_eoln(config->group_signature);
+ verify_format(config->group_signature, "GROUP_SIGNATURE");
+ }
++ else if (!strcmp(var, "CC_BEFORE")) {
++ int num;
++ char unit[10];
++
++ if (sscanf(value, "%d%s", &num, unit) != 2)
++ goto cc_parse_err;
++ if (str2timeunits(num, unit, &config->cc_before) < 0) {
++cc_parse_err:
++ die(1, _("Cannot parse time at CC_BEFORE variable (line %d).\n"), line);
++ }
++ }
++#ifdef USE_LDAP_MAIL_LOOKUP
+ else if (!strcmp(var, "LDAP_MAIL")) {
+ if(strcasecmp(value, "true") == 0)
+ config->use_ldap_mail = 1;
+@@ -846,18 +858,6 @@ static int readconfigfile(const char *filename, struct configparams *config)
+ else
+ config->ldap_starttls = 0;
+ }
+- else if (!strcmp(var, "CC_BEFORE")) {
+- int num;
+- char unit[10];
+-
+- if (sscanf(value, "%d%s", &num, unit) != 2)
+- goto cc_parse_err;
+- if (str2timeunits(num, unit, &config->cc_before) < 0) {
+-cc_parse_err:
+- die(1, _("Cannot parse time at CC_BEFORE variable (line %d).\n"), line);
+- }
+- }
+-#ifdef USE_LDAP_MAIL_LOOKUP
+ else if (!strcmp(var, "LDAP_HOST"))
+ sstrncpy(config->ldap_host, value, CNF_BUFFER);
+ else if (!strcmp(var, "LDAP_PORT"))
+--
+2.4.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/quota/quota/fcntl.patch b/import-layers/yocto-poky/meta/recipes-extended/quota/quota/fcntl.patch
new file mode 100644
index 000000000..27e60fd07
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/quota/quota/fcntl.patch
@@ -0,0 +1,113 @@
+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/quotaops.c
+===================================================================
+--- quota-tools.orig/quotaops.c
++++ quota-tools/quotaops.c
+@@ -34,7 +34,9 @@
+
+ #include "config.h"
+
++#if defined(RPC)
+ #include <rpc/rpc.h>
++#endif
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/file.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"
+Index: quota-tools/setquota.c
+===================================================================
+--- quota-tools.orig/setquota.c
++++ quota-tools/setquota.c
+@@ -7,7 +7,9 @@
+
+ #include "config.h"
+
++#if defined(RPC)
+ #include <rpc/rpc.h>
++#endif
+ #include <sys/types.h>
+ #include <errno.h>
+ #include <stdio.h>
diff --git a/import-layers/yocto-poky/meta/recipes-extended/quota/quota/remove_non_posix_types.patch b/import-layers/yocto-poky/meta/recipes-extended/quota/quota/remove_non_posix_types.patch
new file mode 100644
index 000000000..06ff13cb9
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/quota/quota/replace_getrpcbynumber_r.patch b/import-layers/yocto-poky/meta/recipes-extended/quota/quota/replace_getrpcbynumber_r.patch
new file mode 100644
index 000000000..9ca2ffc0d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/quota/quota/replace_getrpcbynumber_r.patch
@@ -0,0 +1,20 @@
+Replace getrpcbynumber_r with getrpcbynumber
+musl and uclibc dont implement it
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Index: quota-tools/svc_socket.c
+===================================================================
+--- quota-tools.orig/svc_socket.c
++++ quota-tools/svc_socket.c
+@@ -55,7 +55,8 @@ static int svc_socket (u_long number, in
+ addr.sin_family = AF_INET;
+
+ if (!port) {
+- 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,
diff --git a/import-layers/yocto-poky/meta/recipes-extended/quota/quota_4.03.bb b/import-layers/yocto-poky/meta/recipes-extended/quota/quota_4.03.bb
new file mode 100644
index 000000000..4a980464b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/quota/quota_4.03.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://0001-Fix-build-with-disabled-ldap.patch \
+ file://0001-Do-not-accidentaly-override-commandline-passed-CFLAG.patch \
+ file://fcntl.patch \
+ file://remove_non_posix_types.patch \
+ "
+SRC_URI_append_libc-musl = " file://replace_getrpcbynumber_r.patch"
+
+SRC_URI[md5sum] = "6b09f9c93515c25a528be5754cdfb6f5"
+SRC_URI[sha256sum] = "9c6c4d9ae7bf30506dd2aa3d8056c4ff2f8d087930d7c721616f5c093bdc674b"
+
+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 += "-I${STAGING_INCDIR}/tirpc"
+LDFLAGS += "-ltirpc"
+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/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/0001-Avoid-use-of-glibc-sys-cdefs.h-header.patch b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/0001-Avoid-use-of-glibc-sys-cdefs.h-header.patch
new file mode 100644
index 000000000..eeef9f152
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/0001-Avoid-use-of-glibc-sys-cdefs.h-header.patch
@@ -0,0 +1,221 @@
+From 2a44d862233f2126581e290d568e1c8b8f2eb9f5 Mon Sep 17 00:00:00 2001
+From: Carlo Landmeter <clandmeter@gmail.com>
+Date: Thu, 19 Feb 2015 15:28:45 +0000
+Subject: [PATCH] Avoid use of glibc sys/cdefs.h header
+
+Upstream-Status: Pending
+---
+ src/check_bound.c | 2 +-
+ src/pmap_svc.c | 10 +++++-----
+ src/rpcb_svc.c | 10 +++++-----
+ src/rpcb_svc_4.c | 14 +++++++-------
+ src/rpcb_svc_com.c | 46 +++++++++++++++++++++++-----------------------
+ src/rpcbind.c | 12 ++++++------
+ src/util.c | 2 +-
+ src/warmstart.c | 4 ++--
+ 8 files changed, 50 insertions(+), 50 deletions(-)
+
+diff --git a/src/check_bound.c b/src/check_bound.c
+index c70b845..5d21730 100644
+--- a/src/check_bound.c
++++ b/src/check_bound.c
+@@ -70,7 +70,7 @@ static struct fdlist *fdhead; /* Link list of the check fd's */
+ static struct fdlist *fdtail;
+ static char *nullstring = "";
+
+-static bool_t check_bound __P((struct fdlist *, char *uaddr));
++static bool_t check_bound (struct fdlist *, char *uaddr);
+
+ /*
+ * Returns 1 if the given address is bound for the given addr & transport
+diff --git a/src/pmap_svc.c b/src/pmap_svc.c
+index ad28b93..9c7d409 100644
+--- a/src/pmap_svc.c
++++ b/src/pmap_svc.c
+@@ -60,11 +60,11 @@ static char sccsid[] = "@(#)pmap_svc.c 1.23 89/04/05 Copyr 1984 Sun Micro";
+ #include "rpcbind.h"
+ #include "xlog.h"
+ #include <rpc/svc_soc.h> /* svc_getcaller routine definition */
+-static struct pmaplist *find_service_pmap __P((rpcprog_t, rpcvers_t,
+- rpcprot_t));
+-static bool_t pmapproc_change __P((struct svc_req *, SVCXPRT *, u_long));
+-static bool_t pmapproc_getport __P((struct svc_req *, SVCXPRT *));
+-static bool_t pmapproc_dump __P((struct svc_req *, SVCXPRT *));
++static struct pmaplist *find_service_pmap (rpcprog_t, rpcvers_t,
++ rpcprot_t);
++static bool_t pmapproc_change (struct svc_req *, SVCXPRT *, u_long);
++static bool_t pmapproc_getport (struct svc_req *, SVCXPRT *);
++static bool_t pmapproc_dump (struct svc_req *, SVCXPRT *);
+
+ /*
+ * Called for all the version 2 inquiries.
+diff --git a/src/rpcb_svc.c b/src/rpcb_svc.c
+index bd92201..6c7f7fe 100644
+--- a/src/rpcb_svc.c
++++ b/src/rpcb_svc.c
+@@ -53,10 +53,10 @@
+ #include "rpcbind.h"
+ #include "xlog.h"
+
+-static void *rpcbproc_getaddr_3_local __P((void *, struct svc_req *, SVCXPRT *,
+- rpcvers_t));
+-static void *rpcbproc_dump_3_local __P((void *, struct svc_req *, SVCXPRT *,
+- rpcvers_t));
++static void *rpcbproc_getaddr_3_local (void *, struct svc_req *, SVCXPRT *,
++ rpcvers_t);
++static void *rpcbproc_dump_3_local (void *, struct svc_req *, SVCXPRT *,
++ rpcvers_t);
+
+ /*
+ * Called by svc_getreqset. There is a separate server handle for
+@@ -75,7 +75,7 @@ rpcb_service_3(struct svc_req *rqstp, SVCXPRT *transp)
+ } argument;
+ char *result;
+ xdrproc_t xdr_argument, xdr_result;
+- void *(*local) __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
++ void *(*local) (void *, struct svc_req *, SVCXPRT *, rpcvers_t);
+ rpcprog_t setprog = 0;
+
+ rpcbs_procinfo(RPCBVERS_3_STAT, rqstp->rq_proc);
+diff --git a/src/rpcb_svc_4.c b/src/rpcb_svc_4.c
+index b673452..6764c0a 100644
+--- a/src/rpcb_svc_4.c
++++ b/src/rpcb_svc_4.c
+@@ -54,13 +54,13 @@
+ #include "rpcbind.h"
+ #include "xlog.h"
+
+-static void *rpcbproc_getaddr_4_local __P((void *, struct svc_req *, SVCXPRT *,
+- rpcvers_t));
+-static void *rpcbproc_getversaddr_4_local __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
++static void *rpcbproc_getaddr_4_local (void *, struct svc_req *, SVCXPRT *,
++ rpcvers_t);
++static void *rpcbproc_getversaddr_4_local (void *, struct svc_req *, SVCXPRT *, rpcvers_t);
+ static void *rpcbproc_getaddrlist_4_local
+- __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
+-static void free_rpcb_entry_list __P((rpcb_entry_list_ptr *));
+-static void *rpcbproc_dump_4_local __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
++ (void *, struct svc_req *, SVCXPRT *, rpcvers_t);
++static void free_rpcb_entry_list (rpcb_entry_list_ptr *);
++static void *rpcbproc_dump_4_local (void *, struct svc_req *, SVCXPRT *, rpcvers_t);
+
+ /*
+ * Called by svc_getreqset. There is a separate server handle for
+@@ -78,7 +78,7 @@ rpcb_service_4(struct svc_req *rqstp, SVCXPRT *transp)
+ } argument;
+ char *result;
+ xdrproc_t xdr_argument, xdr_result;
+- void *(*local) __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
++ void *(*local) (void *, struct svc_req *, SVCXPRT *, rpcvers_t);
+ rpcprog_t setprog = 0;
+
+ rpcbs_procinfo(RPCBVERS_4_STAT, rqstp->rq_proc);
+diff --git a/src/rpcb_svc_com.c b/src/rpcb_svc_com.c
+index ff9ce6b..8aef9e5 100644
+--- a/src/rpcb_svc_com.c
++++ b/src/rpcb_svc_com.c
+@@ -100,29 +100,29 @@ struct finfo {
+ static struct finfo FINFO[NFORWARD];
+
+
+-static bool_t xdr_encap_parms __P((XDR *, struct encap_parms *));
+-static bool_t xdr_rmtcall_args __P((XDR *, struct r_rmtcall_args *));
+-static bool_t xdr_rmtcall_result __P((XDR *, struct r_rmtcall_args *));
+-static bool_t xdr_opaque_parms __P((XDR *, struct r_rmtcall_args *));
+-static int find_rmtcallfd_by_netid __P((char *));
+-static SVCXPRT *find_rmtcallxprt_by_fd __P((int));
+-static int forward_register __P((u_int32_t, struct netbuf *, int, char *,
+- rpcproc_t, rpcvers_t, u_int32_t *));
+-static struct finfo *forward_find __P((u_int32_t));
+-static int free_slot_by_xid __P((u_int32_t));
+-static int free_slot_by_index __P((int));
+-static int netbufcmp __P((struct netbuf *, struct netbuf *));
+-static struct netbuf *netbufdup __P((struct netbuf *));
+-static void netbuffree __P((struct netbuf *));
+-static int check_rmtcalls __P((struct pollfd *, int));
+-static void xprt_set_caller __P((SVCXPRT *, struct finfo *));
+-static void send_svcsyserr __P((SVCXPRT *, struct finfo *));
+-static void handle_reply __P((int, SVCXPRT *));
+-static void find_versions __P((rpcprog_t, char *, rpcvers_t *, rpcvers_t *));
+-static rpcblist_ptr find_service __P((rpcprog_t, rpcvers_t, char *));
+-static char *getowner __P((SVCXPRT *, char *, size_t));
+-static int add_pmaplist __P((RPCB *));
+-static int del_pmaplist __P((RPCB *));
++static bool_t xdr_encap_parms (XDR *, struct encap_parms *);
++static bool_t xdr_rmtcall_args (XDR *, struct r_rmtcall_args *);
++static bool_t xdr_rmtcall_result (XDR *, struct r_rmtcall_args *);
++static bool_t xdr_opaque_parms (XDR *, struct r_rmtcall_args *);
++static int find_rmtcallfd_by_netid (char *);
++static SVCXPRT *find_rmtcallxprt_by_fd (int);
++static int forward_register (u_int32_t, struct netbuf *, int, char *,
++ rpcproc_t, rpcvers_t, u_int32_t *);
++static struct finfo *forward_find (u_int32_t);
++static int free_slot_by_xid (u_int32_t);
++static int free_slot_by_index (int);
++static int netbufcmp (struct netbuf *, struct netbuf *);
++static struct netbuf *netbufdup (struct netbuf *);
++static void netbuffree (struct netbuf *);
++static int check_rmtcalls (struct pollfd *, int);
++static void xprt_set_caller (SVCXPRT *, struct finfo *);
++static void send_svcsyserr (SVCXPRT *, struct finfo *);
++static void handle_reply (int, SVCXPRT *);
++static void find_versions (rpcprog_t, char *, rpcvers_t *, rpcvers_t *);
++static rpcblist_ptr find_service (rpcprog_t, rpcvers_t, char *);
++static char *getowner (SVCXPRT *, char *, size_t);
++static int add_pmaplist (RPCB *);
++static int del_pmaplist (RPCB *);
+
+ /*
+ * Set a mapping of program, version, netid
+diff --git a/src/rpcbind.c b/src/rpcbind.c
+index 045daa1..137011b 100644
+--- a/src/rpcbind.c
++++ b/src/rpcbind.c
+@@ -135,13 +135,13 @@ char *tcp_uaddr; /* Universal TCP address */
+ static char servname[] = "rpcbind";
+ static char superuser[] = "superuser";
+
+-int main __P((int, char *[]));
++int main (int, char *[]);
+
+-static int init_transport __P((struct netconfig *));
+-static void rbllist_add __P((rpcprog_t, rpcvers_t, struct netconfig *,
+- struct netbuf *));
+-static void terminate __P((int));
+-static void parseargs __P((int, char *[]));
++static int init_transport (struct netconfig *);
++static void rbllist_add (rpcprog_t, rpcvers_t, struct netconfig *,
++ struct netbuf *);
++static void terminate (int);
++static void parseargs (int, char *[]);
+
+ int
+ main(int argc, char *argv[])
+diff --git a/src/util.c b/src/util.c
+index a6c835b..33b9e4f 100644
+--- a/src/util.c
++++ b/src/util.c
+@@ -70,7 +70,7 @@ static struct sockaddr_in *local_in4;
+ static struct sockaddr_in6 *local_in6;
+ #endif
+
+-static int bitmaskcmp __P((void *, void *, void *, int));
++static int bitmaskcmp (void *, void *, void *, int);
+
+ /*
+ * For all bits set in "mask", compare the corresponding bits in
+diff --git a/src/warmstart.c b/src/warmstart.c
+index b6eb73e..42dd3af 100644
+--- a/src/warmstart.c
++++ b/src/warmstart.c
+@@ -58,8 +58,8 @@
+ #define PMAPFILE RPCBIND_STATEDIR "/portmap.xdr"
+ #endif
+
+-static bool_t write_struct __P((char *, xdrproc_t, void *));
+-static bool_t read_struct __P((char *, xdrproc_t, void *));
++static bool_t write_struct (char *, xdrproc_t, void *);
++static bool_t read_struct (char *, xdrproc_t, void *);
+
+ static bool_t
+ write_struct(char *filename, xdrproc_t structproc, void *list)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/0001-handle_reply-Don-t-use-the-xp_auth-pointer-directly.patch b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/0001-handle_reply-Don-t-use-the-xp_auth-pointer-directly.patch
new file mode 100644
index 000000000..16b763ef0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/0001-handle_reply-Don-t-use-the-xp_auth-pointer-directly.patch
@@ -0,0 +1,43 @@
+From 9194122389f2a56b1cd1f935e64307e2e963c2da Mon Sep 17 00:00:00 2001
+From: Steve Dickson <steved@redhat.com>
+Date: Mon, 2 Nov 2015 17:05:18 -0500
+Subject: [PATCH] handle_reply: Don't use the xp_auth pointer directly
+
+In the latest libtirpc version to access the xp_auth
+one must use the SVC_XP_AUTH macro. To be backwards
+compatible a couple ifdefs were added to use the
+macro when it exists.
+
+Upstream-Status: Backport
+
+Signed-off-by: Steve Dickson <steved@redhat.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ src/rpcb_svc_com.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/rpcb_svc_com.c b/src/rpcb_svc_com.c
+index 4ae93f1..22d6c84 100644
+--- a/src/rpcb_svc_com.c
++++ b/src/rpcb_svc_com.c
+@@ -1295,10 +1295,17 @@ handle_reply(int fd, SVCXPRT *xprt)
+ a.rmt_localvers = fi->versnum;
+
+ xprt_set_caller(xprt, fi);
++#if defined(SVC_XP_AUTH)
++ SVC_XP_AUTH(xprt) = svc_auth_none;
++#else
+ xprt->xp_auth = &svc_auth_none;
++#endif
+ svc_sendreply(xprt, (xdrproc_t) xdr_rmtcall_result, (char *) &a);
++#if !defined(SVC_XP_AUTH)
+ SVCAUTH_DESTROY(xprt->xp_auth);
+ xprt->xp_auth = NULL;
++#endif
++
+ done:
+ if (buffer)
+ free(buffer);
+--
+2.4.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/cve-2015-7236.patch b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/cve-2015-7236.patch
new file mode 100644
index 000000000..741a99035
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/cve-2015-7236.patch
@@ -0,0 +1,84 @@
+commit 06f7ebb1dade2f0dbf872ea2bedf17cff4734bdd
+Author: Olaf Kirch <okir@...e.de>
+Date: Thu Aug 6 16:27:20 2015 +0200
+
+ Fix memory corruption in PMAP_CALLIT code
+
+ - A PMAP_CALLIT call comes in on IPv4 UDP
+ - rpcbind duplicates the caller's address to a netbuf and stores it in
+ FINFO[0].caller_addr. caller_addr->buf now points to a memory region A
+ with a size of 16 bytes
+ - rpcbind forwards the call to the local service, receives a reply
+ - when processing the reply, it does this in xprt_set_caller:
+ xprt->xp_rtaddr = *FINFO[0].caller_addr
+ It sends out the reply, and then frees the netbuf caller_addr and
+ caller_addr.buf.
+ However, it does not clear xp_rtaddr, so xp_rtaddr.buf now refers
+ to memory region A, which is free.
+ - When the next call comes in on the UDP/IPv4 socket, svc_dg_recv will
+ be called, which will set xp_rtaddr to the client's address.
+ It will reuse the buffer inside xp_rtaddr, ie it will write a
+ sockaddr_in to region A
+
+ Some time down the road, an incoming TCP connection is accepted,
+ allocating a fresh SVCXPRT. The memory region A is inside the
+ new SVCXPRT
+
+ - While processing the TCP call, another UDP call comes in, again
+ overwriting region A with the client's address
+ - TCP client closes connection. In svc_destroy, we now trip over
+ the garbage left in region A
+
+ We ran into the case where a commercial scanner was triggering
+ occasional rpcbind segfaults. The core file that was captured showed
+ a corrupted xprt->xp_netid pointer that was really a sockaddr_in.
+
+ Signed-off-by: Olaf Kirch <okir@...e.de>
+
+ Upstream-Status: Backport
+ CVE: CVE-2015-7236
+
+ Signed-off-by: Li Zhou <li.zhou@windriver.com>
+---
+ src/rpcb_svc_com.c | 23 ++++++++++++++++++++++-
+ 1 file changed, 22 insertions(+), 1 deletion(-)
+
+Index: rpcbind-0.1.6+git20080930/src/rpcb_svc_com.c
+===================================================================
+--- rpcbind-0.1.6+git20080930.orig/src/rpcb_svc_com.c
++++ rpcbind-0.1.6+git20080930/src/rpcb_svc_com.c
+@@ -1298,12 +1298,33 @@ check_rmtcalls(struct pollfd *pfds, int
+ return (ncallbacks_found);
+ }
+
++/*
++ * This is really a helper function defined in libtirpc, but unfortunately, it hasn't
++ * been exported yet.
++ */
++static struct netbuf *
++__rpc_set_netbuf(struct netbuf *nb, const void *ptr, size_t len)
++{
++ if (nb->len != len) {
++ if (nb->len)
++ mem_free(nb->buf, nb->len);
++ nb->buf = mem_alloc(len);
++ if (nb->buf == NULL)
++ return NULL;
++
++ nb->maxlen = nb->len = len;
++ }
++ memcpy(nb->buf, ptr, len);
++ return nb;
++}
++
+ static void
+ xprt_set_caller(SVCXPRT *xprt, struct finfo *fi)
+ {
++ const struct netbuf *caller = fi->caller_addr;
+ u_int32_t *xidp;
+
+- *(svc_getrpccaller(xprt)) = *(fi->caller_addr);
++ __rpc_set_netbuf(svc_getrpccaller(xprt), caller->buf, caller->len);
+ xidp = __rpcb_get_dg_xidp(xprt);
+ *xidp = fi->caller_xid;
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/init.d b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/init.d
new file mode 100644
index 000000000..67499aa82
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/musl-sunrpc.patch b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/musl-sunrpc.patch
new file mode 100644
index 000000000..6fbc6364c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/musl-sunrpc.patch
@@ -0,0 +1,30 @@
+The musl implementation of getaddrinfo and getservbyname does not
+aliases. As a workaround we use "sunprc" instead of "portmapper"
+
+ported from alpine linux
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: rpcbind-0.2.2/src/rpcbind.c
+===================================================================
+--- rpcbind-0.2.2.orig/src/rpcbind.c
++++ rpcbind-0.2.2/src/rpcbind.c
+@@ -491,7 +491,7 @@ init_transport(struct netconfig *nconf)
+ if ((aicode = getaddrinfo(hosts[nhostsbak],
+ servname, &hints, &res)) != 0) {
+ if ((aicode = getaddrinfo(hosts[nhostsbak],
+- "portmapper", &hints, &res)) != 0) {
++ "sunrpc", &hints, &res)) != 0) {
+ syslog(LOG_ERR,
+ "cannot get local address for %s: %s",
+ nconf->nc_netid, gai_strerror(aicode));
+@@ -564,7 +564,7 @@ init_transport(struct netconfig *nconf)
+ if ((strcmp(nconf->nc_netid, "local") != 0) &&
+ (strcmp(nconf->nc_netid, "unix") != 0)) {
+ if ((aicode = getaddrinfo(NULL, servname, &hints, &res))!= 0) {
+- if ((aicode = getaddrinfo(NULL, "portmapper", &hints, &res))!= 0) {
++ if ((aicode = getaddrinfo(NULL, "sunrpc", &hints, &res))!= 0) {
+ printf("cannot get local address for %s: %s", nconf->nc_netid, gai_strerror(aicode));
+ syslog(LOG_ERR,
+ "cannot get local address for %s: %s",
diff --git a/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/remove-sys-queue.patch b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/remove-sys-queue.patch
new file mode 100644
index 000000000..84fc974fd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/remove-sys-queue.patch
@@ -0,0 +1,22 @@
+musl does not provide this header and here is reasoning
+http://wiki.musl-libc.org/wiki/FAQ#Q:_why_is_sys.2Fqueue.h_not_included_.3F
+
+So include it only when __GLIBC__ is defined which is true for uclibc and glibc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: rpcbind-0.2.2/src/util.c
+===================================================================
+--- rpcbind-0.2.2.orig/src/util.c
++++ rpcbind-0.2.2/src/util.c
+@@ -41,7 +41,9 @@
+
+ #include <sys/types.h>
+ #include <sys/socket.h>
++#ifdef __GLIBC__
+ #include <sys/queue.h>
++#endif
+ #include <net/if.h>
+ #include <netinet/in.h>
+ #include <ifaddrs.h>
diff --git a/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.conf b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.conf
new file mode 100644
index 000000000..2a4dfbcfb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.conf
@@ -0,0 +1,3 @@
+# Optional arguments passed to rpcbind.
+#
+RPCBIND_OPTS=""
diff --git a/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.service b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.service
new file mode 100644
index 000000000..9cdade495
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.socket b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.socket
new file mode 100644
index 000000000..d63c1d972
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind_0.2.3.bb b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind_0.2.3.bb
new file mode 100644
index 000000000..c19a1976a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind_0.2.3.bb
@@ -0,0 +1,73 @@
+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://0001-Avoid-use-of-glibc-sys-cdefs.h-header.patch \
+ file://remove-sys-queue.patch \
+ file://0001-handle_reply-Don-t-use-the-xp_auth-pointer-directly.patch \
+ ${UCLIBCPATCHES} \
+ ${MUSLPATCHES} \
+ file://rpcbind.conf \
+ file://rpcbind.socket \
+ file://rpcbind.service \
+ file://cve-2015-7236.patch \
+ "
+MUSLPATCHES_libc-musl = "file://musl-sunrpc.patch"
+
+UCLIBCPATCHES ?= ""
+MUSLPATCHES ?= ""
+
+SRC_URI[md5sum] = "c8875246b2688a1adfbd6ad43480278d"
+SRC_URI[sha256sum] = "9897823a9d820ea011d9ea02054d5ab99469b9ca5346265fee380713c8fed27b"
+
+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.contains('DISTRO_FEATURES', 'systemd', '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/import-layers/yocto-poky/meta/recipes-extended/screen/screen/0001-Fix-stack-overflow-due-to-too-deep-recursion.patch b/import-layers/yocto-poky/meta/recipes-extended/screen/screen/0001-Fix-stack-overflow-due-to-too-deep-recursion.patch
new file mode 100644
index 000000000..4ac820fde
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/screen/screen/0001-Fix-stack-overflow-due-to-too-deep-recursion.patch
@@ -0,0 +1,58 @@
+Bug: 45713
+
+How to reproduce:
+Run this command inside screen
+$ printf '\x1b[10000000T'
+
+screen will recursively call MScrollV to depth n/256.
+This is time consuming and will overflow stack if n is huge.
+
+Fixes CVE-2015-6806
+
+Upstream-Status: Backport
+CVE: CVE-2015-6806
+
+Signed-off-by: Kuang-che Wu <kcwu@csie.org>
+Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+diff -Naur screen-4.3.1-orig/ansi.c screen-4.3.1/ansi.c
+--- screen-4.3.1-orig/ansi.c 2015-06-29 00:22:55.000000000 +0300
++++ screen-4.3.1/ansi.c 2015-10-06 13:13:58.297648039 +0300
+@@ -2502,13 +2502,13 @@
+ return;
+ if (n > 0)
+ {
++ if (ye - ys + 1 < n)
++ n = ye - ys + 1;
+ if (n > 256)
+ {
+ MScrollV(p, n - 256, ys, ye, bce);
+ n = 256;
+ }
+- if (ye - ys + 1 < n)
+- n = ye - ys + 1;
+ #ifdef COPY_PASTE
+ if (compacthist)
+ {
+@@ -2562,15 +2562,15 @@
+ }
+ else
+ {
+- if (n < -256)
+- {
+- MScrollV(p, n + 256, ys, ye, bce);
+- n = -256;
+- }
+ n = -n;
+ if (ye - ys + 1 < n)
+ n = ye - ys + 1;
+
++ if (n > 256)
++ {
++ MScrollV(p, - (n - 256), ys, ye, bce);
++ n = 256;
++ }
+ ml = p->w_mlines + ye;
+ /* Clear lines */
+ for (i = ye; i > ye - n; i--, ml--)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/screen/screen/0001-fix-for-multijob-build.patch b/import-layers/yocto-poky/meta/recipes-extended/screen/screen/0001-fix-for-multijob-build.patch
new file mode 100644
index 000000000..40ecef00b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/screen/screen/0001-fix-for-multijob-build.patch
@@ -0,0 +1,58 @@
+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>
+---
+From c0de6dd7970b2c7b426a5c39dcbc31c2bef87232 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= <amade@asmblr.net>
+Date: Thu, 2 Jan 2014 18:18:06 +0100
+Subject: [PATCH] fix for multijob build
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+make sure that comm.sh script generates comm.h header before doing
+anything else
+
+Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
+---
+ Makefile.in | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index ce86cbc..dea16d8 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_window.o: list_generic.h list_window.c window.h 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
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/screen/screen/0002-comm.h-now-depends-on-term.h.patch b/import-layers/yocto-poky/meta/recipes-extended/screen/screen/0002-comm.h-now-depends-on-term.h.patch
new file mode 100644
index 000000000..b5d71cc1b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/screen/screen/0002-comm.h-now-depends-on-term.h.patch
@@ -0,0 +1,33 @@
+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(-)
+
+diff --git a/src/Makefile.in b/src/Makefile.in
+index e791e79..d4f7c0b 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -113,7 +113,7 @@ term.h: term.c term.sh
+
+ kmapdef.c: term.h
+
+-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
+
+ docs:
+--
+2.4.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/screen/screen/Avoid-mis-identifying-systems-as-SVR4.patch b/import-layers/yocto-poky/meta/recipes-extended/screen/screen/Avoid-mis-identifying-systems-as-SVR4.patch
new file mode 100644
index 000000000..e184aa1f3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/screen/screen/Provide-cross-compile-alternatives-for-AC_TRY_RUN.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/screen/screen/Remove-redundant-compiler-sanity-checks.patch b/import-layers/yocto-poky/meta/recipes-extended/screen/screen/Remove-redundant-compiler-sanity-checks.patch
new file mode 100644
index 000000000..cc62c12e0
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/screen/screen/Skip-host-file-system-checks-when-cross-compiling.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/screen/screen/fix-parallel-make.patch b/import-layers/yocto-poky/meta/recipes-extended/screen/screen/fix-parallel-make.patch
new file mode 100644
index 000000000..e0caf5d83
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/screen/screen/fix-parallel-make.patch
@@ -0,0 +1,19 @@
+This fixes the parallel make install failure
+
+Upstream-Status: Pending
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: screen-4.0.3/Makefile.in
+===================================================================
+--- screen-4.0.3.orig/Makefile.in
++++ screen-4.0.3/Makefile.in
+@@ -70,7 +70,7 @@ screen: $(OFILES)
+ .c.o:
+ $(CC) -c -I. -I$(srcdir) $(M_CFLAGS) $(DEFS) $(OPTIONS) $(CFLAGS) $<
+
+-install_bin: .version screen
++install_bin: .version screen installdirs
+ -if [ -f $(DESTDIR)$(bindir)/$(SCREEN) ] && [ ! -f $(DESTDIR)$(bindir)/$(SCREEN).old ]; \
+ then mv $(DESTDIR)$(bindir)/$(SCREEN) $(DESTDIR)$(bindir)/$(SCREEN).old; fi
+ $(INSTALL_PROGRAM) screen $(DESTDIR)$(bindir)/$(SCREEN)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/screen/screen/screen.pam b/import-layers/yocto-poky/meta/recipes-extended/screen/screen/screen.pam
new file mode 100644
index 000000000..ff657fa07
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/screen/screen/screen.pam
@@ -0,0 +1,2 @@
+#%PAM-1.0
+auth include common-auth
diff --git a/import-layers/yocto-poky/meta/recipes-extended/screen/screen_4.3.1.bb b/import-layers/yocto-poky/meta/recipes-extended/screen/screen_4.3.1.bb
new file mode 100644
index 000000000..00d878b2c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/screen/screen_4.3.1.bb
@@ -0,0 +1,53 @@
+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 \
+ file://fix-parallel-make.patch \
+ ${@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://0001-fix-for-multijob-build.patch \
+ file://0002-comm.h-now-depends-on-term.h.patch \
+ file://0001-Fix-stack-overflow-due-to-too-deep-recursion.patch \
+ "
+
+SRC_URI[md5sum] = "5bb3b0ff2674e29378c31ad3411170ad"
+SRC_URI[sha256sum] = "fa4049f8aee283de62e283d427f2cfd35d6c369b40f7f45f947dbfd915699d63"
+
+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.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" = "pam" ]; 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/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/Makevars b/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/Makevars
new file mode 100644
index 000000000..8b09f53b0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/Makevars
@@ -0,0 +1,25 @@
+# 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 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/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/fix_return_type.patch b/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/fix_return_type.patch
new file mode 100644
index 000000000..836551ea1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/fix_return_type.patch
@@ -0,0 +1,18 @@
+Upstream-Status: Pending
+
+Change the getline return type to match its declaration.
+
+Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
+
+diff -urN sed-4.1.2-orig/lib/getline.c sed-4.1.2/lib/getline.c
+--- sed-4.1.2-orig/lib/getline.c 2010-08-31 08:47:50.070094024 +0800
++++ sed-4.1.2/lib/getline.c 2010-08-31 08:48:50.982178172 +0800
+@@ -30,7 +30,7 @@
+ necessary. Returns the number of characters read (not including the
+ null terminator), or -1 on error or EOF. */
+
+-size_t
++ssize_t
+ getline (lineptr, n, stream)
+ char **lineptr;
+ size_t *n;
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/sed-4.1.2_fix_for_automake-1.12.patch b/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/sed-4.1.2_fix_for_automake-1.12.patch
new file mode 100644
index 000000000..80594068a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/sed-4.1.2_fix_for_automake-1.12.patch
@@ -0,0 +1,37 @@
+Upstream-Status: Pending
+
+automake-1.12.x has deprecated use of @mkdir_p@, fix the issue by using @MKDIR_P@ instead.
+
+Avoid this build issue:
+| make[1]: mkdir_p@: Command not found
+| make[1]: *** [install-data-yes] Error 127
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/07/13
+
+Index: sed-4.1.2/intl/Makefile.in
+===================================================================
+--- sed-4.1.2.orig/intl/Makefile.in
++++ sed-4.1.2/intl/Makefile.in
+@@ -40,7 +40,7 @@ subdir = intl
+ INSTALL = @INSTALL@
+ INSTALL_DATA = @INSTALL_DATA@
+ mkinstalldirs = $(mkdir_p)
+-mkdir_p = @mkdir_p@
++mkdir_p = @MKDIR_P@
+
+ l = @INTL_LIBTOOL_SUFFIX_PREFIX@
+
+Index: sed-4.1.2/po/Makefile.in.in
+===================================================================
+--- sed-4.1.2.orig/po/Makefile.in.in
++++ sed-4.1.2/po/Makefile.in.in
+@@ -29,7 +29,7 @@ gettextsrcdir = $(datadir)/gettext/po
+ INSTALL = /srv/home/nitin/builds2/build0/tmp/sysroots/x86_64-linux/usr/bin/install -c
+ INSTALL_DATA = ${INSTALL} -m 644
+ mkinstalldirs = $(mkdir_p)
+-mkdir_p = @mkdir_p@
++mkdir_p = @MKDIR_P@
+
+ CC = i586-poky-linux-gcc -m32 -march=i586 --sysroot=/srv/home/nitin/builds2/build0/tmp/sysroots/qemux86
+ GMSGFMT = /srv/home/nitin/builds2/build0/tmp/sysroots/x86_64-linux/usr/bin/msgfmt
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.2.2/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.2.2/run-ptest b/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.2.2/run-ptest
new file mode 100644
index 000000000..7c0f62770
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.2.2/sed-add-ptest.patch b/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.2.2/sed-add-ptest.patch
new file mode 100644
index 000000000..105e8b745
--- /dev/null
+++ b/import-layers/yocto-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 -cf - $(TESTDIR) --exclude *.o | ( 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/import-layers/yocto-poky/meta/recipes-extended/sed/sed_4.1.2.bb b/import-layers/yocto-poky/meta/recipes-extended/sed/sed_4.1.2.bb
new file mode 100644
index 000000000..40e3a53ce
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sed/sed_4.1.2.bb
@@ -0,0 +1,35 @@
+SUMMARY = "Stream EDitor (text filtering utility)"
+HOMEPAGE = "http://www.gnu.org/software/sed/"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://sed/sed.h;beginline=1;endline=17;md5=e00ffd1837f298439a214fd197f6a407"
+SECTION = "console/utils"
+PR = "r7"
+
+SRC_URI = "${GNU_MIRROR}/sed/sed-${PV}.tar.gz \
+ file://fix_return_type.patch \
+ file://sed-4.1.2_fix_for_automake-1.12.patch \
+ file://Makevars"
+
+SRC_URI[md5sum] = "928f0e06422f414091917401f1a834d0"
+SRC_URI[sha256sum] = "638e837ba765d5da0a30c98b57c2953cecea96827882f594612acace93ceeeab"
+
+inherit autotools texinfo update-alternatives gettext
+
+do_configure_prepend () {
+ cp ${WORKDIR}/Makevars ${S}/po/
+}
+
+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"
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sed/sed_4.2.2.bb b/import-layers/yocto-poky/meta/recipes-extended/sed/sed_4.2.2.bb
new file mode 100644
index 000000000..5aa7d8a07
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sed/sed_4.2.2.bb
@@ -0,0 +1,46 @@
+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}
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-Disable-use-of-syslog-for-sysroot.patch b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-Disable-use-of-syslog-for-sysroot.patch
new file mode 100644
index 000000000..a6f604b65
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-Do-not-read-login.defs-before-doing-chroot.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch
new file mode 100644
index 000000000..85dde8e1b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch
@@ -0,0 +1,109 @@
+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
+@@ -1893,6 +1893,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
+@@ -1907,36 +1936,33 @@ 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));
+- 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));
++ 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/import-layers/yocto-poky/meta/recipes-extended/shadow/files/allow-for-setting-password-in-clear-text.patch b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/allow-for-setting-password-in-clear-text.patch
new file mode 100644
index 000000000..68da25f40
--- /dev/null
+++ b/import-layers/yocto-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
+@@ -773,6 +773,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);
+@@ -1047,6 +1048,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'},
+@@ -1059,9 +1061,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) {
+@@ -1227,6 +1229,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/import-layers/yocto-poky/meta/recipes-extended/shadow/files/check_size_of_uid_t_and_gid_t_using_AC_CHECK_SIZEOF.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/shadow/files/fix-installation-failure-with-subids-disabled.patch b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/fix-installation-failure-with-subids-disabled.patch
new file mode 100644
index 000000000..02cb91aaf
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/shadow/files/login.defs_shadow-sysroot b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/login.defs_shadow-sysroot
new file mode 100644
index 000000000..8a68dd341
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/shadow/files/login_defs_pam.sed b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/login_defs_pam.sed
new file mode 100644
index 000000000..0a1f3be4a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/chfn b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/chfn
new file mode 100644
index 000000000..baf7698bb
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/chpasswd b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/chpasswd
new file mode 100644
index 000000000..9e3efa68b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/chsh b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/chsh
new file mode 100644
index 000000000..8fb169f64
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/login b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/login
new file mode 100644
index 000000000..b34005853
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/newusers b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/newusers
new file mode 100644
index 000000000..4aa3dde48
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/passwd b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/passwd
new file mode 100644
index 000000000..f53499243
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/su b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/su
new file mode 100644
index 000000000..8d590a32e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/shadow/files/securetty b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/securetty
new file mode 100644
index 000000000..2be341a21
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/shadow/files/shadow-4.1.3-dots-in-usernames.patch b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/shadow-4.1.3-dots-in-usernames.patch
new file mode 100644
index 000000000..a7bb0a929
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/shadow/files/shadow-update-pam-conf.patch b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/shadow-update-pam-conf.patch
new file mode 100644
index 000000000..15f8044fa
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/shadow/files/usermod-fix-compilation-failure-with-subids-disabled.patch b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/usermod-fix-compilation-failure-with-subids-disabled.patch
new file mode 100644
index 000000000..37dc153fc
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/shadow/shadow-securetty_4.2.1.bb b/import-layers/yocto-poky/meta/recipes-extended/shadow/shadow-securetty_4.2.1.bb
new file mode 100644
index 000000000..c78f888cf
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/shadow/shadow-sysroot_4.2.1.bb b/import-layers/yocto-poky/meta/recipes-extended/shadow/shadow-sysroot_4.2.1.bb
new file mode 100644
index 000000000..697569c47
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/shadow-sysroot_4.2.1.bb
@@ -0,0 +1,34 @@
+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 755 ${S}/login.defs_shadow-sysroot ${D}${sysconfdir}/login.defs
+}
+
+sysroot_stage_all() {
+ sysroot_stage_dir ${D} ${SYSROOT_DESTDIR}
+}
+
+# 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/import-layers/yocto-poky/meta/recipes-extended/shadow/shadow.inc b/import-layers/yocto-poky/meta/recipes-extended/shadow/shadow.inc
new file mode 100644
index 000000000..d024b01dc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/shadow.inc
@@ -0,0 +1,196 @@
+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 = "shadow-native"
+DEPENDS_class-native = ""
+DEPENDS_class-nativesdk = ""
+
+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 \
+ ${@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 \
+ "
+
+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-uclibc = " --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.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
+PACKAGECONFIG_class-native = ""
+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"
+ALTERNATIVE_LINK_NAME[chpasswd] = "${sbindir}/chpasswd"
+ALTERNATIVE_LINK_NAME[vipw] = "${base_sbindir}/vipw"
+ALTERNATIVE_LINK_NAME[vigr] = "${base_sbindir}/vigr"
+
+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"
+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"
+
+pkg_postinst_${PN} () {
+ if [ "x$D" != "x" ]; then
+ rootarg="--root $D"
+ else
+ rootarg=""
+ fi
+
+ pwconv $rootarg || exit 1
+ grpconv $rootarg || exit 1
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/shadow_4.2.1.bb b/import-layers/yocto-poky/meta/recipes-extended/shadow/shadow_4.2.1.bb
new file mode 100644
index 000000000..5675cb8cc
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/slang/slang/0001-Fix-error-conflicting-types-for-posix_close.patch b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/0001-Fix-error-conflicting-types-for-posix_close.patch
new file mode 100644
index 000000000..57ebfe432
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/0001-Fix-error-conflicting-types-for-posix_close.patch
@@ -0,0 +1,39 @@
+From 96eb7e29822151823a66a1eb59f1fa4aead5ae08 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 31 Aug 2015 06:33:21 +0000
+Subject: [PATCH] Fix error: conflicting types for 'posix_close'
+
+Exposed while compiling on musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/slposio.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/slposio.c b/src/slposio.c
+index 9ce9697..9ff9bfe 100644
+--- a/src/slposio.c
++++ b/src/slposio.c
+@@ -363,7 +363,7 @@ static int posix_close_fd (int *fd)
+ return 0;
+ }
+
+-static int posix_close (SLFile_FD_Type *f)
++static int posix_closex (SLFile_FD_Type *f)
+ {
+ int status = do_close (f);
+
+@@ -1001,7 +1001,7 @@ static SLang_Intrin_Fun_Type Fd_Name_Table [] =
+ MAKE_INTRINSIC_2("write", posix_write, V, F, B),
+ MAKE_INTRINSIC_1("dup_fd", posix_dup, V, F),
+ MAKE_INTRINSIC_2("dup2_fd", posix_dup2, I, F, I),
+- MAKE_INTRINSIC_1("close", posix_close, I, F),
++ MAKE_INTRINSIC_1("close", posix_closex, I, F),
+ MAKE_INTRINSIC_1("_close", posix_close_fd, I, I),
+ #if defined(TTYNAME_R)
+ MAKE_INTRINSIC_0("ttyname", posix_ttyname, V),
+--
+2.5.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/slang/slang/change-char-type-to-signed-char-in-macros.patch b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/change-char-type-to-signed-char-in-macros.patch
new file mode 100644
index 000000000..2ea1ffda5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/change-char-type-to-signed-char-in-macros.patch
@@ -0,0 +1,218 @@
+slang: change char type to signed char in macros
+
+C language has 3 distinct char types:
+ char
+ unsigned char
+ signed char
+A char has the same range of values as signed char on X86,
+but same as unsigned char on ARM which made Slang's typecast()
+and array_sort() unable to work for char value on ARM, since
+Slang is assuming "char" as "signed char".
+
+Now we change "char" as "signed char" explicitly in
+util/mkslarith2.sl, and use it to regenerate src/slarith2.inc
+
+Upstream-Status: Submitted
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ src/slarith2.inc | 72 ++++++++++++++++++++++++-------------------------
+ src/util/mkslarith2.sl | 2 -
+ 2 files changed, 37 insertions(+), 37 deletions(-)
+
+--- a/src/util/mkslarith2.sl
++++ b/src/util/mkslarith2.sl
+@@ -1,7 +1,7 @@
+ #!/usr/bin/env slsh
+
+ private variable CTypes =
+- ["char", "unsigned char", "short", "unsigned short", "int", "unsigned int",
++ ["signed char", "unsigned char", "short", "unsigned short", "int", "unsigned int",
+ "long", "unsigned long", "long long", "unsigned long long",
+ "float", "double", "long double"];
+ private variable Is_Int_Type =
+--- a/src/slarith2.inc
++++ b/src/slarith2.inc
+@@ -1,43 +1,43 @@
+ /* DO NOT EDIT -- this file was generated by src/util/mkslarith2.sl */
+-/* ------------ char ---------- */
+-DEFUN_1(copy_char_to_char,char,char)
++/* ------------ signed char ---------- */
++DEFUN_1(copy_char_to_char,signed char,signed char)
+ #define char_to_char NULL
+ #define copy_char_to_uchar copy_char_to_char
+ #define char_to_uchar NULL
+-DEFUN_1(copy_char_to_short,char,short)
++DEFUN_1(copy_char_to_short,signed char,short)
+ #define char_to_short NULL
+-DEFUN_1(copy_char_to_ushort,char,unsigned short)
++DEFUN_1(copy_char_to_ushort,signed char,unsigned short)
+ #define char_to_ushort NULL
+-DEFUN_1(copy_char_to_int,char,int)
+-DEFUN_2(char_to_int,char,int,copy_char_to_int)
+-DEFUN_1(copy_char_to_uint,char,unsigned int)
+-DEFUN_2(char_to_uint,char,unsigned int,copy_char_to_uint)
+-DEFUN_1(copy_char_to_long,char,long)
+-DEFUN_2(char_to_long,char,long,copy_char_to_long)
+-DEFUN_1(copy_char_to_ulong,char,unsigned long)
+-DEFUN_2(char_to_ulong,char,unsigned long,copy_char_to_ulong)
++DEFUN_1(copy_char_to_int,signed char,int)
++DEFUN_2(char_to_int,signed char,int,copy_char_to_int)
++DEFUN_1(copy_char_to_uint,signed char,unsigned int)
++DEFUN_2(char_to_uint,signed char,unsigned int,copy_char_to_uint)
++DEFUN_1(copy_char_to_long,signed char,long)
++DEFUN_2(char_to_long,signed char,long,copy_char_to_long)
++DEFUN_1(copy_char_to_ulong,signed char,unsigned long)
++DEFUN_2(char_to_ulong,signed char,unsigned long,copy_char_to_ulong)
+ #if defined(HAVE_LONG_LONG)
+-DEFUN_1(copy_char_to_llong,char,long long)
+-DEFUN_2(char_to_llong,char,long long,copy_char_to_llong)
++DEFUN_1(copy_char_to_llong,signed char,long long)
++DEFUN_2(char_to_llong,signed char,long long,copy_char_to_llong)
+ #endif /* defined(HAVE_LONG_LONG) */
+ #if defined(HAVE_LONG_LONG)
+-DEFUN_1(copy_char_to_ullong,char,unsigned long long)
+-DEFUN_2(char_to_ullong,char,unsigned long long,copy_char_to_ullong)
++DEFUN_1(copy_char_to_ullong,signed char,unsigned long long)
++DEFUN_2(char_to_ullong,signed char,unsigned long long,copy_char_to_ullong)
+ #endif /* defined(HAVE_LONG_LONG) */
+ #if SLANG_HAS_FLOAT
+-DEFUN_1(copy_char_to_float,char,float)
+-DEFUN_2(char_to_float,char,float,copy_char_to_float)
++DEFUN_1(copy_char_to_float,signed char,float)
++DEFUN_2(char_to_float,signed char,float,copy_char_to_float)
+ #endif /* SLANG_HAS_FLOAT */
+ #if SLANG_HAS_FLOAT
+-DEFUN_1(copy_char_to_double,char,double)
+-DEFUN_2(char_to_double,char,double,copy_char_to_double)
++DEFUN_1(copy_char_to_double,signed char,double)
++DEFUN_2(char_to_double,signed char,double,copy_char_to_double)
+ #endif /* SLANG_HAS_FLOAT */
+ #if defined(HAVE_LONG_DOUBLE)
+-DEFUN_1(copy_char_to_ldouble,char,long double)
+-DEFUN_2(char_to_ldouble,char,long double,copy_char_to_ldouble)
++DEFUN_1(copy_char_to_ldouble,signed char,long double)
++DEFUN_2(char_to_ldouble,signed char,long double,copy_char_to_ldouble)
+ #endif /* defined(HAVE_LONG_DOUBLE) */
+ #if SLANG_HAS_FLOAT
+-TO_DOUBLE_FUN(char_to_one_double,char)
++TO_DOUBLE_FUN(char_to_one_double,signed char)
+ #endif
+
+ /* ------------ unsigned char ---------- */
+@@ -82,7 +82,7 @@ TO_DOUBLE_FUN(uchar_to_one_double,unsign
+ #endif
+
+ /* ------------ short ---------- */
+-DEFUN_1(copy_short_to_char,short,char)
++DEFUN_1(copy_short_to_char,short,signed char)
+ #define short_to_char NULL
+ DEFUN_1(copy_short_to_uchar,short,unsigned char)
+ #define short_to_uchar NULL
+@@ -123,7 +123,7 @@ TO_DOUBLE_FUN(short_to_one_double,short)
+ #endif
+
+ /* ------------ unsigned short ---------- */
+-DEFUN_1(copy_ushort_to_char,unsigned short,char)
++DEFUN_1(copy_ushort_to_char,unsigned short,signed char)
+ #define ushort_to_char NULL
+ DEFUN_1(copy_ushort_to_uchar,unsigned short,unsigned char)
+ #define ushort_to_uchar NULL
+@@ -164,7 +164,7 @@ TO_DOUBLE_FUN(ushort_to_one_double,unsig
+ #endif
+
+ /* ------------ int ---------- */
+-DEFUN_1(copy_int_to_char,int,char)
++DEFUN_1(copy_int_to_char,int,signed char)
+ #define int_to_char NULL
+ DEFUN_1(copy_int_to_uchar,int,unsigned char)
+ #define int_to_uchar NULL
+@@ -205,7 +205,7 @@ TO_DOUBLE_FUN(int_to_one_double,int)
+ #endif
+
+ /* ------------ unsigned int ---------- */
+-DEFUN_1(copy_uint_to_char,unsigned int,char)
++DEFUN_1(copy_uint_to_char,unsigned int,signed char)
+ #define uint_to_char NULL
+ DEFUN_1(copy_uint_to_uchar,unsigned int,unsigned char)
+ #define uint_to_uchar NULL
+@@ -246,7 +246,7 @@ TO_DOUBLE_FUN(uint_to_one_double,unsigne
+ #endif
+
+ /* ------------ long ---------- */
+-DEFUN_1(copy_long_to_char,long,char)
++DEFUN_1(copy_long_to_char,long,signed char)
+ #define long_to_char NULL
+ DEFUN_1(copy_long_to_uchar,long,unsigned char)
+ #define long_to_uchar NULL
+@@ -287,7 +287,7 @@ TO_DOUBLE_FUN(long_to_one_double,long)
+ #endif
+
+ /* ------------ unsigned long ---------- */
+-DEFUN_1(copy_ulong_to_char,unsigned long,char)
++DEFUN_1(copy_ulong_to_char,unsigned long,signed char)
+ #define ulong_to_char NULL
+ DEFUN_1(copy_ulong_to_uchar,unsigned long,unsigned char)
+ #define ulong_to_uchar NULL
+@@ -329,7 +329,7 @@ TO_DOUBLE_FUN(ulong_to_one_double,unsign
+
+ /* ------------ long long ---------- */
+ #if defined(HAVE_LONG_LONG)
+-DEFUN_1(copy_llong_to_char,long long,char)
++DEFUN_1(copy_llong_to_char,long long,signed char)
+ #define llong_to_char NULL
+ DEFUN_1(copy_llong_to_uchar,long long,unsigned char)
+ #define llong_to_uchar NULL
+@@ -372,7 +372,7 @@ TO_DOUBLE_FUN(llong_to_one_double,long l
+
+ /* ------------ unsigned long long ---------- */
+ #if defined(HAVE_LONG_LONG)
+-DEFUN_1(copy_ullong_to_char,unsigned long long,char)
++DEFUN_1(copy_ullong_to_char,unsigned long long,signed char)
+ #define ullong_to_char NULL
+ DEFUN_1(copy_ullong_to_uchar,unsigned long long,unsigned char)
+ #define ullong_to_uchar NULL
+@@ -415,7 +415,7 @@ TO_DOUBLE_FUN(ullong_to_one_double,unsig
+
+ /* ------------ float ---------- */
+ #if SLANG_HAS_FLOAT
+-DEFUN_1(copy_float_to_char,float,char)
++DEFUN_1(copy_float_to_char,float,signed char)
+ #define float_to_char NULL
+ DEFUN_1(copy_float_to_uchar,float,unsigned char)
+ #define float_to_uchar NULL
+@@ -458,7 +458,7 @@ TO_DOUBLE_FUN(float_to_one_double,float)
+
+ /* ------------ double ---------- */
+ #if SLANG_HAS_FLOAT
+-DEFUN_1(copy_double_to_char,double,char)
++DEFUN_1(copy_double_to_char,double,signed char)
+ #define double_to_char NULL
+ DEFUN_1(copy_double_to_uchar,double,unsigned char)
+ #define double_to_uchar NULL
+@@ -501,7 +501,7 @@ TO_DOUBLE_FUN(double_to_one_double,doubl
+
+ /* ------------ long double ---------- */
+ #if defined(HAVE_LONG_DOUBLE)
+-DEFUN_1(copy_ldouble_to_char,long double,char)
++DEFUN_1(copy_ldouble_to_char,long double,signed char)
+ #define ldouble_to_char NULL
+ DEFUN_1(copy_ldouble_to_uchar,long double,unsigned char)
+ #define ldouble_to_uchar NULL
+@@ -545,7 +545,7 @@ TO_DOUBLE_FUN(ldouble_to_one_double,long
+ #if SLANG_HAS_FLOAT
+ static To_Double_Fun_Table_Type To_Double_Fun_Table [MAX_ARITHMETIC_TYPES] =
+ {
+- {sizeof(char), char_to_one_double},
++ {sizeof(signed char), char_to_one_double},
+ {sizeof(unsigned char), uchar_to_one_double},
+ {sizeof(short), short_to_one_double},
+ {sizeof(unsigned short), ushort_to_one_double},
+@@ -583,7 +583,7 @@ static To_Double_Fun_Table_Type To_Doubl
+
+ static Binary_Matrix_Type Binary_Matrix [MAX_ARITHMETIC_TYPES][MAX_ARITHMETIC_TYPES] =
+ {
+- /* char */
++ /* signed char */
+ {
+ {(FVOID_STAR)copy_char_to_char, char_to_char},
+ {(FVOID_STAR)copy_char_to_uchar, char_to_uchar},
diff --git a/import-layers/yocto-poky/meta/recipes-extended/slang/slang/fix-check-pcre.patch b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/fix-check-pcre.patch
new file mode 100644
index 000000000..0c1553a66
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/fix-check-pcre.patch
@@ -0,0 +1,108 @@
+fix the pcre existence checking
+
+when check if there is pcre, the configure file always check
+the host dir. now we make it work by adding correct prefix for
+cross-compile environment.
+
+When enable pcre-module, we see a QA warning because rpaths
+hardcoded into the build, rpaths are not needed, so lets turn
+this off.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ configure | 60 ++++++------------------------------------------------------
+ 1 files changed, 6 insertions(+), 54 deletions(-)
+
+diff --git a/configure b/configure
+index f1586c3..d22814f 100755
+--- a/configure
++++ b/configure
+@@ -6991,6 +6991,7 @@ $as_echo_n "checking for the pcre library and header files ... " >&6; }
+ /usr/include/pcre,/usr/lib \
+ /usr/pcre/include,/usr/pcre/lib \
+ /usr/include,/usr/lib \
++ /usr/include,/usr/lib64 \
+ /opt/include/pcre,/opt/lib \
+ /opt/pcre/include,/opt/pcre/lib \
+ /opt/include,/opt/lib"
+@@ -7021,14 +7022,14 @@ $as_echo_n "checking for the pcre library and header files ... " >&6; }
+ xincdir=`echo $include_and_lib | tr ',' ' ' | awk '{print $1}'`
+ xlibdir=`echo $include_and_lib | tr ',' ' ' | awk '{print $2}'`
+ found=0
+- if test -r $xincdir/$xincfile
++ if test -r $PKG_CONFIG_SYSROOT_DIR/$xincdir/$xincfile
+ then
+ for E in $exts
+ do
+- if test -r "$xlibdir/$xlibfile.$E"
++ if test -r "$PKG_CONFIG_SYSROOT_DIR/$xlibdir/$xlibfile.$E"
+ then
+- jd_pcre_include_dir="$xincdir"
+- jd_pcre_library_dir="$xlibdir"
++ jd_pcre_include_dir="$PKG_CONFIG_SYSROOT_DIR/$xincdir"
++ jd_pcre_library_dir="$PKG_CONFIG_SYSROOT_DIR/$xlibdir"
+ jd_with_pcre_library="yes"
+ found=1
+ break
+@@ -7054,56 +7055,7 @@ $as_echo "yes: $jd_pcre_library_dir and $jd_pcre_include_dir" >&6; }
+ then
+ PCRE_LIB=""
+ else
+-
+-if test "X$jd_pcre_library_dir" != "X"
+-then
+- if test "X$RPATH" = "X"
+- then
+-
+-case "$host_os" in
+- *linux*|*solaris* )
+- if test "X$GCC" = Xyes
+- then
+- if test "X$ac_R_nospace" = "Xno"
+- then
+- RPATH="-Wl,-R,"
+- else
+- RPATH="-Wl,-R"
+- fi
+- else
+- if test "X$ac_R_nospace" = "Xno"
+- then
+- RPATH="-R "
+- else
+- RPATH="-R"
+- fi
+- fi
+- ;;
+- *osf*|*openbsd*)
+- if test "X$GCC" = Xyes
+- then
+- RPATH="-Wl,-rpath,"
+- else
+- RPATH="-rpath "
+- fi
+- ;;
+- *netbsd*)
+- if test "X$GCC" = Xyes
+- then
+- RPATH="-Wl,-R"
+- fi
+- ;;
+-esac
+-
+- if test "X$RPATH" != "X"
+- then
+- RPATH="$RPATH$jd_pcre_library_dir"
+- fi
+- else
+- RPATH="$RPATH:$jd_pcre_library_dir"
+- fi
+-fi
+-
++ RPATH=""
+ fi
+
+ PCRE_INC=-I$jd_pcre_include_dir
+--
+1.7.4.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/slang/slang/rpathfix.patch b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/rpathfix.patch
new file mode 100644
index 000000000..50cac9264
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/rpathfix.patch
@@ -0,0 +1,70 @@
+Without this patch we see rpaths hardcoded into the build which results in QA
+warnings. These rpaths are not needed so lets turn this off.
+
+Upstream-Status: Inappropriate
+(but could be turned into a proper configure option)
+
+RP 2012/03/14
+
+Index: slang-2.2.4/configure
+===================================================================
+--- slang-2.2.4.orig/configure 2012-03-14 23:40:01.283560679 +0000
++++ slang-2.2.4/configure 2012-03-14 23:41:18.023558900 +0000
+@@ -6081,56 +6081,7 @@
+ ELF_CFLAGS="$ELF_CFLAGS $IEEE_CFLAGS"
+ CFLAGS="$CFLAGS $IEEE_CFLAGS"
+
+-
+-if test "X$libdir" != "X"
+-then
+- if test "X$RPATH" = "X"
+- then
+-
+-case "$host_os" in
+- *linux*|*solaris* )
+- if test "X$GCC" = Xyes
+- then
+- if test "X$ac_R_nospace" = "Xno"
+- then
+- RPATH="-Wl,-R,"
+- else
+- RPATH="-Wl,-R"
+- fi
+- else
+- if test "X$ac_R_nospace" = "Xno"
+- then
+- RPATH="-R "
+- else
+- RPATH="-R"
+- fi
+- fi
+- ;;
+- *osf*|*openbsd*)
+- if test "X$GCC" = Xyes
+- then
+- RPATH="-Wl,-rpath,"
+- else
+- RPATH="-rpath "
+- fi
+- ;;
+- *netbsd*)
+- if test "X$GCC" = Xyes
+- then
+- RPATH="-Wl,-R"
+- fi
+- ;;
+-esac
+-
+- if test "X$RPATH" != "X"
+- then
+- RPATH="$RPATH$libdir"
+- fi
+- else
+- RPATH="$RPATH:$libdir"
+- fi
+-fi
+-
++RPATH=""
+
+ # The cast to long int works around a bug in the HP C Compiler
+ # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
diff --git a/import-layers/yocto-poky/meta/recipes-extended/slang/slang/slang-fix-the-iconv-existence-checking.patch b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/slang-fix-the-iconv-existence-checking.patch
new file mode 100644
index 000000000..958fe983c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/slang-fix-the-iconv-existence-checking.patch
@@ -0,0 +1,116 @@
+From 4588f4a0287787788eb86fb16f326cbaa7454e1d Mon Sep 17 00:00:00 2001
+From: Zheng Junling <zhengjunling@huawei.com>
+Date: Mon, 16 Jun 2014 12:51:25 +0000
+Subject: [PATCH] slang: fix the iconv existence checking
+
+When checking whether there is iconv, the configure file always check
+the host env.
+
+Now we make it working properly by adding correct prefix for cross-
+compiling environment.
+
+When enabling iconv-module, we see a QA warning because rpaths hardcoded
+into the build. And rpaths are not needed, so let's turn this off.
+
+This patch is generated by referencing the existing "fix-check-pcre"
+patch.
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Zheng Junling <zhengjunling@huawei.com>
+---
+ configure | 60 ++++++------------------------------------------------------
+ 1 file changed, 6 insertions(+), 54 deletions(-)
+
+diff --git a/configure b/configure
+index 7a96256..91632f3 100755
+--- a/configure
++++ b/configure
+@@ -7909,6 +7909,7 @@ $as_echo_n "checking for the iconv library and header files ... " >&6; }
+ /usr/include/iconv,/usr/lib \
+ /usr/iconv/include,/usr/iconv/lib \
+ /usr/include,/usr/lib \
++ /usr/include,/usr/lib64 \
+ /opt/include/iconv,/opt/lib \
+ /opt/iconv/include,/opt/iconv/lib \
+ /opt/include,/opt/lib"
+@@ -7939,14 +7940,14 @@ $as_echo_n "checking for the iconv library and header files ... " >&6; }
+ xincdir=`echo $include_and_lib | tr ',' ' ' | awk '{print $1}'`
+ xlibdir=`echo $include_and_lib | tr ',' ' ' | awk '{print $2}'`
+ found=0
+- if test -r $xincdir/$xincfile
++ if test -r $PKG_CONFIG_SYSROOT_DIR/$xincdir/$xincfile
+ then
+ for E in $exts
+ do
+- if test -r "$xlibdir/$xlibfile.$E"
++ if test -r "$PKG_CONFIG_SYSROOT_DIR/$xlibdir/$xlibfile.$E"
+ then
+- jd_iconv_include_dir="$xincdir"
+- jd_iconv_library_dir="$xlibdir"
++ jd_iconv_include_dir="$PKG_CONFIG_SYSROOT_DIR/$xincdir"
++ jd_iconv_library_dir="$PKG_CONFIG_SYSROOT_DIR/$xlibdir"
+ jd_with_iconv_library="yes"
+ found=1
+ break
+@@ -7972,56 +7973,7 @@ $as_echo "yes: $jd_iconv_library_dir and $jd_iconv_include_dir" >&6; }
+ then
+ ICONV_LIB=""
+ else
+-
+-if test "X$jd_iconv_library_dir" != "X"
+-then
+- if test "X$RPATH" = "X"
+- then
+-
+-case "$host_os" in
+- *linux*|*solaris* )
+- if test "X$GCC" = Xyes
+- then
+- if test "X$ac_R_nospace" = "Xno"
+- then
+- RPATH="-Wl,-R,"
+- else
+- RPATH="-Wl,-R"
+- fi
+- else
+- if test "X$ac_R_nospace" = "Xno"
+- then
+- RPATH="-R "
+- else
+- RPATH="-R"
+- fi
+- fi
+- ;;
+- *osf*|*openbsd*)
+- if test "X$GCC" = Xyes
+- then
+- RPATH="-Wl,-rpath,"
+- else
+- RPATH="-rpath "
+- fi
+- ;;
+- *netbsd*)
+- if test "X$GCC" = Xyes
+- then
+- RPATH="-Wl,-R"
+- fi
+- ;;
+-esac
+-
+- if test "X$RPATH" != "X"
+- then
+- RPATH="$RPATH$jd_iconv_library_dir"
+- fi
+- else
+- RPATH="$RPATH:$jd_iconv_library_dir"
+- fi
+-fi
+-
++ RPATH=""
+ fi
+
+ ICONV_INC=-I$jd_iconv_include_dir
+--
+1.8.3.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/slang/slang/sprintf-bug-concerning-8-bit-characters.patch b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/sprintf-bug-concerning-8-bit-characters.patch
new file mode 100644
index 000000000..420001b08
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/sprintf-bug-concerning-8-bit-characters.patch
@@ -0,0 +1,42 @@
+Upstream-Status: Backport
+
+From 3a05d1a920140e9f2c72791c12f664213feb46df Mon Sep 17 00:00:00 2001
+From: Manfred Hanke <Manfred.Hanke@tngtech.com>
+Date: Thu, 20 Jun 2013 10:24:12 +0200
+Subject: [PATCH] sprintf bug (concerning %c for 8-bit character in non-UTF8
+ mode) fixed
+
+char *str points to SLuchar_Type utf8_buf[], which had too small scope
+
+src/test/strops.sl failed in the following environment:
+ - compiler: gcc (Debian 4.7.2-5) 4.7.2
+ - CFLAGS: -g -O2
+ - libc: GNU C Library (Debian EGLIBC 2.13-38) stable release version 2.13
+ - kernel: 3.2.0-4-686-pae #1 SMP Debian 3.2.39-2 i686 GNU/Linux
+---
+ src/slstrops.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/slstrops.c b/src/slstrops.c
+index ce6acb0..cbbbb01 100644
+--- a/src/slstrops.c
++++ b/src/slstrops.c
+@@ -1884,6 +1884,7 @@ static char *SLdo_sprintf (char *fmt) /*{{{*/
+ #endif
+ unsigned char uch;
+ int use_long = 0, use_alt_format = 0;
++ SLuchar_Type utf8_buf[SLUTF8_MAX_MBLEN+1];
+
+ while (1)
+ {
+@@ -2071,7 +2072,6 @@ static char *SLdo_sprintf (char *fmt) /*{{{*/
+ #endif
+ {
+ SLwchar_Type wc;
+- SLuchar_Type utf8_buf[SLUTF8_MAX_MBLEN+1];
+
+ if (-1 == SLang_pop_wchar (&wc))
+ return out;
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/slang/slang_2.2.4.bb b/import-layers/yocto-poky/meta/recipes-extended/slang/slang_2.2.4.bb
new file mode 100644
index 000000000..237e9f252
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/slang/slang_2.2.4.bb
@@ -0,0 +1,54 @@
+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 = "pcre ncurses"
+PR = "r12"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a52a18a472d4f7e45479b06563717c02"
+
+
+SRC_URI = "http://www.jedsoft.org/releases/slang/old/slang-${PV}.tar.bz2 \
+ file://rpathfix.patch \
+ file://fix-check-pcre.patch \
+ file://change-char-type-to-signed-char-in-macros.patch \
+ file://sprintf-bug-concerning-8-bit-characters.patch \
+ file://slang-fix-the-iconv-existence-checking.patch \
+ file://0001-Fix-error-conflicting-types-for-posix_close.patch \
+ "
+UPSTREAM_CHECK_URI = "http://www.jedsoft.org/releases/slang/"
+
+inherit autotools-brokensep
+
+CLEANBROKEN = "1"
+
+SRC_URI[md5sum] = "7fcfd447e378f07dd0c0bae671fe6487"
+SRC_URI[sha256sum] = "9a8257a9a2a55099af858b13338dc8f3a06dd2069f46f0df2c9c3bb84a01d5db"
+
+EXTRA_OECONF += " --without-z --without-png --without-onig --x-includes=${STAGING_DIR_HOST}/usr/include/X11 --x-libraries=${STAGING_DIR_HOST}/usr/lib"
+
+do_configure_prepend() {
+ # 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.
+ cd ${S}/autoconf && gnu-configize --force && mv autoconf/config.* .
+ cd ${B}
+}
+
+do_install() {
+ oe_runmake install DESTDIR=${D} -e 'INST_LIB_DIR=${STAGING_DIR_HOST}/usr/lib'
+}
+
+FILES_${PN} += "${libdir}/${BPN}/v2/modules/ ${datadir}/slsh/"
+
+PARALLEL_MAKE = ""
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/stat/stat-3.3/fix-error-return.patch b/import-layers/yocto-poky/meta/recipes-extended/stat/stat-3.3/fix-error-return.patch
new file mode 100644
index 000000000..032995db8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/stat/stat-3.3/fix-error-return.patch
@@ -0,0 +1,16 @@
+This patch fixies the wrong return code of stat -h.
+
+Upstream-Status: Pending
+Signed-off-by: Zhangle Yang <zhangle.yang@windriver.com>
+
+--- stat-3.3/stat.c.orig 2013-08-22 10:49:45.000000000 +0800
++++ stat-3.3/stat.c 2013-08-22 10:50:31.000000000 +0800
+@@ -845,7 +845,7 @@
+ fprintf(stderr, "\t\t%%S - Security ID in SE-Linux\n");
+ fprintf(stderr, "\t\t%%C - Security context in SE-Linux\n");
+ fprintf(stderr, "\t\t%%d - Free file nodes in file system\n");
+- exit(1);
++ exit(0);
+ }
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/stat/stat_3.3.bb b/import-layers/yocto-poky/meta/recipes-extended/stat/stat_3.3.bb
new file mode 100644
index 000000000..a5ece0744
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/stat/stat_3.3.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Command line file status display utility"
+DESCRIPTION = "Displays all information about a file that the stat() call provides and all information about a filesystem that statfs() provides."
+SECTION = "console/utils"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=39886b077fd072e876e5c4c16310b631 \
+ file://GPL;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+SRC_URI = "http://www.ibiblio.org/pub/Linux/utils/file/${BP}.tar.gz \
+ file://fix-error-return.patch"
+
+SRC_URI[md5sum] = "37e247e8e400ad9205f1b0500b728fd3"
+SRC_URI[sha256sum] = "7071f0384a423a938dd542c1f08547a02824f6359acd3ef3f944b2c4c2d1ee09"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+do_install() {
+ install -d ${D}${base_bindir} ${D}${mandir}/man1
+ install -m 755 stat ${D}${base_bindir}/stat.stat
+ install -m 644 stat.1 ${D}${mandir}/man1
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_${PN} = "stat"
+ALTERNATIVE_PRIORITY[stat] = "200"
+ALTERNATIVE_LINK_NAME[stat] = "${base_bindir}/stat"
+ALTERNATIVE_TARGET[stat] = "${base_bindir}/stat.stat"
+
+ALTERNATIVE_${PN}-doc = "stat.1"
+ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1"
+
+BBCLASSEXTEND = "native"
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/stress/files/texinfo.patch b/import-layers/yocto-poky/meta/recipes-extended/stress/files/texinfo.patch
new file mode 100644
index 000000000..5ac595192
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/stress/files/texinfo.patch
@@ -0,0 +1,79 @@
+--- 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/import-layers/yocto-poky/meta/recipes-extended/stress/stress_1.0.4.bb b/import-layers/yocto-poky/meta/recipes-extended/stress/stress_1.0.4.bb
new file mode 100644
index 000000000..e9179d3e1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/sudo/files/sudo.pam b/import-layers/yocto-poky/meta/recipes-extended/sudo/files/sudo.pam
new file mode 100644
index 000000000..515eab0c6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/sudo/sudo.inc b/import-layers/yocto-poky/meta/recipes-extended/sudo/sudo.inc
new file mode 100644
index 000000000..a25876b7f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sudo/sudo.inc
@@ -0,0 +1,40 @@
+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=c16e542408abda013d672be8eb88d174 \
+ file://plugins/sudoers/redblack.c;beginline=1;endline=41;md5=cfe41112f96c19a074934d128f45c693 \
+ 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 () {
+ 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/import-layers/yocto-poky/meta/recipes-extended/sudo/sudo/0001-Include-sys-types.h-for-id_t-definition.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/sudo/sudo_1.8.15.bb b/import-layers/yocto-poky/meta/recipes-extended/sudo/sudo_1.8.15.bb
new file mode 100644
index 000000000..042043ece
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sudo/sudo_1.8.15.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] = "7cf6b9b76d0478a572432bed481dd7b5"
+SRC_URI[sha256sum] = "4316381708324da8b6cb151f655c1a11855207c7c02244d8ffdea5104d7cc308"
+
+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.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" = "pam" ]; 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/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/0001-Fix-build-with-musl.patch b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/0001-Fix-build-with-musl.patch
new file mode 100644
index 000000000..9567946c0
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/no-strip-install.patch b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/no-strip-install.patch
new file mode 100644
index 000000000..00fba7101
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/no-strip-install.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: sysklogd-1.5/Makefile
+===================================================================
+--- sysklogd-1.5.orig/Makefile 2009-06-09 13:02:41.000000000 +0200
++++ sysklogd-1.5/Makefile 2009-06-09 13:03:06.000000000 +0200
+@@ -127,8 +127,8 @@
+ 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} -m ${MAN_PERMS} sysklogd.8 ${MANDIR}/man8/sysklogd.8
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/no-vectorization.patch b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/no-vectorization.patch
new file mode 100644
index 000000000..c1cc042c9
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/sysklogd b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/sysklogd
new file mode 100755
index 000000000..258f88280
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/syslog.conf b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/syslog.conf
new file mode 100644
index 000000000..0849de126
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/sysklogd/sysklogd.inc b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/sysklogd.inc
new file mode 100644
index 000000000..1e363db6e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/sysklogd.inc
@@ -0,0 +1,66 @@
+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 update-alternatives
+
+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://sysklogd \
+ file://syslog.conf \
+ "
+
+SRC_URI_append_e500v2 = " file://no-vectorization.patch"
+
+INITSCRIPT_NAME = "syslog"
+CONFFILES_${PN} = "${sysconfdir}/syslog.conf.${BPN}"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+CFLAGS_append = " -DSYSV"
+
+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
+}
+
+# sysklogd package has no internal systemd support, so we weigh busybox's
+# sysklogd utility over it in case of systemd
+ALTERNATIVE_PRIORITY = "${@bb.utils.contains('DISTRO_FEATURES','systemd','10','100',d)}"
+
+ALTERNATIVE_${PN} = "syslogd klogd syslog-init syslog-conf"
+
+ALTERNATIVE_LINK_NAME[syslogd] = "${base_sbindir}/syslogd"
+ALTERNATIVE_LINK_NAME[klogd] = "${base_sbindir}/klogd"
+ALTERNATIVE_LINK_NAME[syslog-init] = "${sysconfdir}/init.d/syslog"
+ALTERNATIVE_LINK_NAME[syslog-conf] = "${sysconfdir}/syslog.conf"
+
+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/import-layers/yocto-poky/meta/recipes-extended/sysklogd/sysklogd_1.5.1.bb b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/sysklogd_1.5.1.bb
new file mode 100644
index 000000000..975ecc2b6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat.inc b/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat.inc
new file mode 100644
index 000000000..c35329193
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat.inc
@@ -0,0 +1,57 @@
+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"
+
+inherit autotools-brokensep gettext systemd
+
+EXTRA_OECONF += "--disable-sensors"
+EXTRA_OEMAKE += 'LFLAGS=""'
+
+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
+ install -d ${D}/etc/default/volatiles
+ install -m 0644 ${WORKDIR}/99_sysstat ${D}/etc/default/volatiles
+
+ 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}"
+LDFLAGS_append_libc-uclibc = " -lintl"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat/0001-Include-needed-headers-explicitly.patch b/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat/0001-Include-needed-headers-explicitly.patch
new file mode 100644
index 000000000..c12652307
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat/0001-Include-needed-headers-explicitly.patch
@@ -0,0 +1,62 @@
+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(+)
+
+diff --git a/common.c b/common.c
+index a23155b..ad86446 100644
+--- a/common.c
++++ b/common.c
+@@ -20,6 +20,7 @@
+ */
+
+ #include <stdio.h>
++#include <limits.h>
+ #include <string.h>
+ #include <stdlib.h>
+ #include <time.h>
+diff --git a/ioconf.c b/ioconf.c
+index 7d88c5d..6d67691 100644
+--- a/ioconf.c
++++ b/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"
+diff --git a/sa_common.c b/sa_common.c
+index b7351d9..c9e3299 100644
+--- a/sa_common.c
++++ b/sa_common.c
+@@ -20,6 +20,7 @@
+ */
+
+ #include <stdio.h>
++#include <limits.h>
+ #include <string.h>
+ #include <stdlib.h>
+ #include <time.h>
+--
+2.5.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat/99_sysstat b/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat/99_sysstat
new file mode 100644
index 000000000..0b0ec30de
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat/99_sysstat
@@ -0,0 +1 @@
+d root root 0755 /var/log/sa none
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat/sysstat.service b/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat/sysstat.service
new file mode 100644
index 000000000..aff07109f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat_11.2.0.bb b/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat_11.2.0.bb
new file mode 100644
index 000000000..7a8eb96ad
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat_11.2.0.bb
@@ -0,0 +1,8 @@
+require sysstat.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
+
+SRC_URI += "file://0001-Include-needed-headers-explicitly.patch"
+
+SRC_URI[md5sum] = "e8b615775ad98780e3f0675b91eddb19"
+SRC_URI[sha256sum] = "9806b9a662568796d3fb93ecd01ecea10d815e668337a646494953bff4bc4155"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/avoid_heap_overflow.patch b/import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/avoid_heap_overflow.patch
new file mode 100644
index 000000000..af5026f52
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/avoid_heap_overflow.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Inappropriate [bugfix: http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-0624]
+CVE: CVE-2010-0624
+
+This patch avoids heap overflow reported by :
+http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-0624
+
+This is a clean patch for the GPLv2 tar recipe.
+
+Nitin A Kamble <nitin.a.kamble@intel.com> 2011/04/25
+
+Index: tar-1.17/lib/rtapelib.c
+===================================================================
+--- tar-1.17.orig/lib/rtapelib.c
++++ tar-1.17/lib/rtapelib.c
+@@ -570,7 +570,7 @@ rmt_read__ (int handle, char *buffer, si
+
+ sprintf (command_buffer, "R%lu\n", (unsigned long) length);
+ if (do_command (handle, command_buffer) == -1
+- || (status = get_status (handle)) == SAFE_READ_ERROR)
++ || ((status = get_status (handle)) == SAFE_READ_ERROR) || (status > length))
+ return SAFE_READ_ERROR;
+
+ for (counter = 0; counter < status; counter += rlen, buffer += rlen)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/gcc43build.patch b/import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/gcc43build.patch
new file mode 100644
index 000000000..f8059a0a8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/gcc43build.patch
@@ -0,0 +1,37 @@
+Upstream-Status: Inappropriate [licensing]
+
+# Fix errors when built with gcc 4.3
+# Patch taken from Debian bug #452096
+
+diff -urN tar-1.17.orig/lib/argp-fmtstream.h tar-1.17/lib/argp-fmtstream.h
+--- tar-1.17.orig/lib/argp-fmtstream.h 2006-01-11 12:24:05.000000000 -0800
++++ tar-1.17/lib/argp-fmtstream.h 2010-07-22 22:36:12.000000000 -0700
+@@ -198,7 +198,11 @@
+ #endif
+
+ #ifndef ARGP_FS_EI
+-#define ARGP_FS_EI extern inline
++ #if defined __GNUC_STDC_INLINE__
++ #define ARGP_FS_EI extern inline __attribute__((__gnu_inline__))
++ #else
++ #define ARGP_FS_EI extern inline
++ #endif
+ #endif
+
+ ARGP_FS_EI size_t
+diff -urN tar-1.17.orig/lib/argp.h tar-1.17/lib/argp.h
+--- tar-1.17.orig/lib/argp.h 2007-03-30 00:09:11.000000000 -0700
++++ tar-1.17/lib/argp.h 2010-07-22 22:38:44.000000000 -0700
+@@ -580,7 +580,11 @@
+ # endif
+
+ # ifndef ARGP_EI
+-# define ARGP_EI extern __inline__
++# if defined __GNUC_STDC_INLINE__
++# define ARGP_EI extern __inline__ __attribute__((__gnu_inline__))
++# else
++# define ARGP_EI extern __inline__
++# endif
+ # endif
+
+ ARGP_EI void
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/m4extensions.patch b/import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/m4extensions.patch
new file mode 100644
index 000000000..30534c29c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/m4extensions.patch
@@ -0,0 +1,30 @@
+Upstream-Status: Inappropriate [licensing]
+
+# Define AC_USE_SYSTEM_EXTENSIONS only if it was previously undefined.
+# This is needed to configure correctly with newer versions of autoconf.
+
+--- tar-1.17/m4/extensions.m4.orig 2010-07-22 22:21:35.000000000 -0700
++++ tar-1.17/m4/extensions.m4 2010-07-22 22:23:41.000000000 -0700
+@@ -1,4 +1,4 @@
+-# serial 4 -*- Autoconf -*-
++# serial 5 -*- Autoconf -*-
+ # Enable extensions on systems that normally disable them.
+
+ # Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+@@ -16,6 +16,7 @@
+ # ------------------------
+ # Enable extensions on systems that normally disable them,
+ # typically due to standards-conformance issues.
++m4_ifdef([AC_USE_SYSTEM_EXTENSIONS], [], [
+ AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
+ [
+ AC_BEFORE([$0], [AC_COMPILE_IFELSE])
+@@ -48,7 +49,7 @@
+ AC_DEFINE([__EXTENSIONS__])
+ AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+ AC_DEFINE([_TANDEM_SOURCE])
+-])
++])])
+
+ # gl_USE_SYSTEM_EXTENSIONS
+ # ------------------------
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tar/tar.inc b/import-layers/yocto-poky/meta/recipes-extended/tar/tar.inc
new file mode 100644
index 000000000..93e4da114
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/tar/tar/musl_dirent.patch b/import-layers/yocto-poky/meta/recipes-extended/tar/tar/musl_dirent.patch
new file mode 100644
index 000000000..b0dc16c3d
--- /dev/null
+++ b/import-layers/yocto-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" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_struct_dirent_d_ino="guessing no" ;;
+ esac
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tar/tar/remove-gets.patch b/import-layers/yocto-poky/meta/recipes-extended/tar/tar/remove-gets.patch
new file mode 100644
index 000000000..0b8be39ee
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tar/tar/remove-gets.patch
@@ -0,0 +1,22 @@
+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
+Index: tar-1.27/gnu/stdio.in.h
+===================================================================
+--- tar-1.27.orig/gnu/stdio.in.h 2013-06-29 08:54:26.000000000 +0300
++++ tar-1.27/gnu/stdio.in.h 2013-10-16 15:22:46.977204737 +0300
+@@ -710,10 +710,12 @@
+ /* 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
+ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+ #endif
++#endif
+
+
+ #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tar/tar_1.17.bb b/import-layers/yocto-poky/meta/recipes-extended/tar/tar_1.17.bb
new file mode 100644
index 000000000..b9ca2063d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tar/tar_1.17.bb
@@ -0,0 +1,14 @@
+require tar.inc
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+
+PR = "r3"
+
+SRC_URI += "file://m4extensions.patch \
+ file://gcc43build.patch \
+ file://avoid_heap_overflow.patch \
+ "
+
+SRC_URI[md5sum] = "c6c4f1c075dbf0f75c29737faa58f290"
+SRC_URI[sha256sum] = "19f9021dda51a16295e4706e80870e71f87107675e51c176a491eba0fc4ca492"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tar/tar_1.28.bb b/import-layers/yocto-poky/meta/recipes-extended/tar/tar_1.28.bb
new file mode 100644
index 000000000..518e62206
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tar/tar_1.28.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] = "8f32b2bc1ed7ddf4cf4e4a39711341b0"
+SRC_URI[sha256sum] = "60e4bfe0602fef34cd908d91cf638e17eeb09394d7b98c2487217dc4d3147562"
+
+do_install_append_libc-musl() {
+ rm -f ${D}${libdir}/charset.alias
+ rmdir ${D}${libdir}
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/00_man_quoting.diff b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/00_man_quoting.diff
new file mode 100644
index 000000000..16d6719cb
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/01_man_portability.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/01_man_portability.patch
new file mode 100644
index 000000000..9a735bff6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/05_wildcard_matching.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/05_wildcard_matching.patch
new file mode 100644
index 000000000..9e188027f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/06_fix_gethostbyname.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/06_fix_gethostbyname.patch
new file mode 100644
index 000000000..725f4b595
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/10_usagi-ipv6.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/10_usagi-ipv6.patch
new file mode 100644
index 000000000..96d47c39f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_tcpd_blacklist.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_tcpd_blacklist.patch
new file mode 100644
index 000000000..226106f4f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_usagi_fix.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_usagi_fix.patch
new file mode 100644
index 000000000..260e8d313
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/12_makefile_config.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/12_makefile_config.patch
new file mode 100644
index 000000000..e8289e44d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/12_makefile_config.patch
@@ -0,0 +1,83 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/Makefile tcp_wrappers_7.6/Makefile
+--- tcp_wrappers_7.6.orig/Makefile 2003-08-21 01:43:39.000000000 +0200
++++ tcp_wrappers_7.6/Makefile 2003-08-21 01:43:35.000000000 +0200
+@@ -45,7 +45,7 @@
+ #
+ # 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
+ #
+@@ -512,6 +519,7 @@
+ # (examples: allow, deny, banners, twist and spawn).
+ #
+ #STYLE = -DPROCESS_OPTIONS # Enable language extensions.
++STYLE = -DPROCESS_OPTIONS
+
+ ################################################################
+ # Optional: Changing the default disposition of logfile records
+@@ -535,6 +543,7 @@
+ # 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.
+
+@@ -631,6 +640,7 @@
+ # lookups altogether, see the next section.
+
+ PARANOID= -DPARANOID
++PARANOID=
+
+ ########################################
+ # Optional: turning off hostname lookups
+@@ -644,6 +654,7 @@
+ # mode (see previous section) and comment out the following definition.
+
+ HOSTNAME= -DALWAYS_HOSTNAME
++HOSTNAME=
+
+ #############################################
+ # Optional: Turning on host ADDRESS checking
+@@ -670,6 +681,7 @@
+ # Solaris 2.x, and Linux. See your system documentation for details.
+ #
+ # KILL_OPT= -DKILL_IP_OPTIONS
++KILL_OPT= -DKILL_IP_OPTIONS
+
+ ## End configuration options
+ ############################
+@@ -677,9 +689,10 @@
+ # 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) \
+@@ -712,10 +725,11 @@
+
+ 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)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/13_shlib_weaksym.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/13_shlib_weaksym.patch
new file mode 100644
index 000000000..bd1396bc7
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/14_cidr_support.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/14_cidr_support.patch
new file mode 100644
index 000000000..eb5685c57
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/15_match_clarify.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/15_match_clarify.patch
new file mode 100644
index 000000000..3ca687411
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/expand_remote_port.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/expand_remote_port.patch
new file mode 100644
index 000000000..308737797
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/have_strerror.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/have_strerror.patch
new file mode 100644
index 000000000..4cc554fc3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/ldflags.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/ldflags.patch
new file mode 100644
index 000000000..3ba214d24
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/makefile-fix-parallel.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/makefile-fix-parallel.patch
new file mode 100644
index 000000000..797352579
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/man_fromhost.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/man_fromhost.patch
new file mode 100644
index 000000000..19bd7d3c0
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/musl-decls.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/musl-decls.patch
new file mode 100644
index 000000000..eee640e8a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rename_strings_variable.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rename_strings_variable.patch
new file mode 100644
index 000000000..7650600ab
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/restore_sigalarm.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/restore_sigalarm.patch
new file mode 100644
index 000000000..5875b81b2
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rfc931.diff b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rfc931.diff
new file mode 100644
index 000000000..723f4f136
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.8 b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.8
new file mode 100644
index 000000000..875616b9e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.patch
new file mode 100644
index 000000000..fc2afeef1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/sig_fix.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/sig_fix.patch
new file mode 100644
index 000000000..9d7ea042b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/siglongjmp.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/siglongjmp.patch
new file mode 100644
index 000000000..76dd6340b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/socklen_t.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/socklen_t.patch
new file mode 100644
index 000000000..8e46df8e1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/tcpdchk_libwrapped.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/tcpdchk_libwrapped.patch
new file mode 100644
index 000000000..be29bdcfa
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/try-from.8 b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/try-from.8
new file mode 100644
index 000000000..9c8f30543
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb
new file mode 100644
index 000000000..5fdbbced7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb
@@ -0,0 +1,132 @@
+SUMMARY = "Security tool that is a wrapper for TCP daemons"
+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 \
+ "
+
+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-uclibc = "-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/import-layers/yocto-poky/meta/recipes-extended/texi2html/texi2html_5.0.bb b/import-layers/yocto-poky/meta/recipes-extended/texi2html/texi2html_5.0.bb
new file mode 100644
index 000000000..eac289e3b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/texi2html/texi2html_5.0.bb
@@ -0,0 +1,28 @@
+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 \
+ "
+
+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"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy-native.bb b/import-layers/yocto-poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy-native.bb
new file mode 100644
index 000000000..1254bc89b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/COPYING b/import-layers/yocto-poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/COPYING
new file mode 100644
index 000000000..531cbe723
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/template.py b/import-layers/yocto-poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/template.py
new file mode 100644
index 000000000..8b7033ecc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/template.py
@@ -0,0 +1,122 @@
+#! /usr/bin/env python2.7
+
+# 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/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/check-locale-h.patch b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/check-locale-h.patch
new file mode 100644
index 000000000..f4d66600a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/check-locale-h.patch
@@ -0,0 +1,28 @@
+fix the macro check
+
+Upstream-Status: Pending
+
+configure does not check if locale.h exists, but check setlocale,
+if setlocale exist, the locale.h should exist.
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ lib/system.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/system.h b/lib/system.h
+index 946eb3c..c70037b 100644
+--- a/lib/system.h
++++ b/lib/system.h
+@@ -42,7 +42,7 @@ extern char *substring (const char *, const char *);
+ #include <ctype.h>
+
+ /* All systems nowadays probably have these functions, but ... */
+-#ifdef HAVE_LOCALE_H
++#ifdef HAVE_SETLOCALE
+ #include <locale.h>
+ #endif
+ #ifndef HAVE_SETLOCALE
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/do-compile-native-tools.patch b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/do-compile-native-tools.patch
new file mode 100644
index 000000000..81ebe26cf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/do-compile-native-tools.patch
@@ -0,0 +1,49 @@
+From 458e9450cecf703f55536e609365162719585900 Mon Sep 17 00:00:00 2001
+From: "Roy.Li" <rongqing.li@windriver.com>
+Date: Wed, 10 Sep 2014 17:03:29 +0800
+Subject: [PATCH] do not compile host tools, since we have native
+
+Upstream-Status: Pending
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ configure.ac | 23 +----------------------
+ 1 file changed, 1 insertion(+), 22 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index b46130d..cf58654 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -90,28 +90,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.
+- 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]])
+
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/using-native-makeinfo.patch b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/using-native-makeinfo.patch
new file mode 100644
index 000000000..2297051dd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/using-native-makeinfo.patch
@@ -0,0 +1,24 @@
+From 9b0df7d6d3c18cfac82c291d60a5357d1bc8d9d0 Mon Sep 17 00:00:00 2001
+From: "Roy.Li" <rongqing.li@windriver.com>
+Date: Wed, 10 Sep 2014 17:10:03 +0800
+Subject: [PATCH] using native makeinfo
+
+Upstream-Status: Pending
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ doc/Makefile.am | 2 +-
+
+diff --git a/doc/Makefile.am b/doc/Makefile.am
+index 63df818..b6ceb34 100644
+--- a/doc/Makefile.am
++++ b/doc/Makefile.am
+@@ -19,7 +19,7 @@ man_MANS = info.1 infokey.1 install-info.1 makeinfo.1 texindex.1 texi2dvi.1 \
+
+ # Use the programs built in our distribution, taking account of possible
+ # cross-compiling.
+-MAKEINFO = $(top_builddir)/$(native_tools)/makeinfo/makeinfo
++MAKEINFO = makeinfo
+ INSTALL_INFO = $(top_builddir)/$(native_tools)/util/install-info
+
+ TXI_XLATE = txi-cs.tex txi-de.tex txi-en.tex txi-es.tex txi-fr.tex \
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/disable-native-tools.patch b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/disable-native-tools.patch
new file mode 100644
index 000000000..ab6f1658a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/dont-depend-on-help2man.patch b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/dont-depend-on-help2man.patch
new file mode 100644
index 000000000..0ce47ecdb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/dont-depend-on-help2man.patch
@@ -0,0 +1,64 @@
+From 6f1f3912fcb900b3a3e6cbe3360306fade333497 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Thu, 6 Aug 2015 14:55:08 +0300
+Subject: [PATCH] dont-depend-on-help2man
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.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 7198a6b..4bba550 100644
+--- a/doc/Makefile.am
++++ b/doc/Makefile.am
+@@ -40,7 +40,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)
+
+ if INSTALL_WARNINGS
+diff --git a/man/Makefile.am b/man/Makefile.am
+index a08d603..bdfc9a4 100644
+--- 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.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/link-zip.patch b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/link-zip.patch
new file mode 100644
index 000000000..0b6e9fd7e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/texinfo-4.12-zlib.patch b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/texinfo-4.12-zlib.patch
new file mode 100644
index 000000000..41bd220ba
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/texinfo-4.12-zlib.patch
@@ -0,0 +1,233 @@
+From 20e1d8a9481dc13dd1d4d168b90e0ed2ff097b98 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Thu, 6 Aug 2015 14:29:57 +0300
+Subject: [PATCH] texinfo-4.12-zlib
+
+Upstream-Status: Pending
+---
+ install-info/Makefile.in | 2 +-
+ install-info/install-info.c | 67 +++++++++++++++++++++++++++------------------
+ 2 files changed, 42 insertions(+), 27 deletions(-)
+
+diff --git a/install-info/Makefile.in b/install-info/Makefile.in
+index ad73abb..eaa2153 100644
+--- a/install-info/Makefile.in
++++ b/install-info/Makefile.in
+@@ -241,7 +241,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 b454c15..4e39122 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,12 +768,12 @@ 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))
+ {
+ /* Empty files don't set errno. Calling code can check for
+ this, so make sure errno == 0 just in case it isn't already. */
+- if (nread == 0)
++ if (nread >= 0)
+ errno = 0;
+ return 0;
+ }
+@@ -838,35 +839,40 @@ open_possibly_compressed_file (char *filename,
+ *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;
+@@ -885,7 +891,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);
+@@ -893,14 +900,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)
+@@ -919,8 +932,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.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/use_host_makedoc.patch b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/use_host_makedoc.patch
new file mode 100644
index 000000000..5b7f32d9a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo_4.8.bb b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo_4.8.bb
new file mode 100644
index 000000000..13678e093
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo_4.8.bb
@@ -0,0 +1,55 @@
+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 = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+PROVIDES_append_class-native = " texinfo-4.8-replacement-native"
+
+DEPENDS = "zlib ncurses texinfo-4.8-replacement-native"
+DEPENDS_class-native = "zlib-native ncurses-native"
+
+TARGET_PATCH = "file://use_host_makedoc.patch \
+ file://using-native-makeinfo.patch \
+"
+TARGET_PATCH_class-native = ""
+
+SRC_URI = "${GNU_MIRROR}/texinfo/${BP}.tar.gz \
+ file://check-locale-h.patch \
+ file://do-compile-native-tools.patch \
+ ${TARGET_PATCH} \
+ "
+
+SRC_URI[md5sum] = "4e9a1a591ed236003d0d4b008bf07eef"
+SRC_URI[sha256sum] = "1f3cdeebe65fdf510f55d765ab1031b54416aa5bc2635b6a54ef9bcb2367c917"
+
+tex_texinfo = "texmf/tex/texinfo"
+
+inherit gettext autotools
+
+do_install_append() {
+ mkdir -p ${D}${datadir}/${tex_texinfo}
+ install -p -m644 ${S}/doc/texinfo.tex ${S}/doc/txi-??.tex ${D}${datadir}/${tex_texinfo}
+}
+
+do_install_append_class-native() {
+ install -m 755 info/makedoc ${D}${bindir}
+ install -m 755 makeinfo/makeinfo ${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"
+FILES_${PN}-doc = "${infodir}/texinfo* \
+ ${datadir}/${tex_texinfo} \
+ ${mandir}/man1 ${mandir}/man5"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo_6.0.bb b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo_6.0.bb
new file mode 100644
index 000000000..8638bb1d0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo_6.0.bb
@@ -0,0 +1,82 @@
+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", True)
+ 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] = "e1a2ef5dce5018b53f0f6eed45b247a7"
+SRC_URI[sha256sum] = "83d3183290f34e7f958d209d0b20022c6fe9e921eb6fe94c27d988827d4878d2"
+
+tex_texinfo = "texmf/tex/texinfo"
+
+inherit gettext autotools
+
+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"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/time/time-1.7/debian.patch b/import-layers/yocto-poky/meta/recipes-extended/time/time-1.7/debian.patch
new file mode 100644
index 000000000..23ea0e3eb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/time/time-1.7/debian.patch
@@ -0,0 +1,1301 @@
+Upstream-Status: Backport
+
+--- time-1.7.orig/configure.in
++++ time-1.7/configure.in
+@@ -1,11 +1,8 @@
+ dnl Process this file with autoconf to produce a configure script.
+ AC_INIT(time.c)
+-VERSION=1.7
+-AC_SUBST(VERSION)
+-PACKAGE=time
+-AC_SUBST(PACKAGE)
++AM_INIT_AUTOMAKE(time, 1.7)
+
+-AC_ARG_PROGRAM
++AM_MAINTAINER_MODE
+
+ dnl Checks for programs.
+ AC_PROG_CC
+@@ -15,7 +12,7 @@
+ dnl Checks for header files.
+ AC_HEADER_STDC
+ AC_HEADER_SYS_WAIT
+-AC_CHECK_HEADERS(unistd.h string.h sys/rusage.h)
++AC_CHECK_HEADERS(unistd.h string.h sys/rusage.h sys/resource.h)
+
+ dnl Checks for typedefs, structures, and compiler characteristics.
+ AC_C_CONST
+--- time-1.7.orig/version.texi
++++ time-1.7/version.texi
+@@ -1,3 +1,3 @@
+-@set UPDATED 12 June 1996
++@set UPDATED 9 May 2002
+ @set EDITION 1.7
+ @set VERSION 1.7
+--- time-1.7.orig/time.c
++++ time-1.7/time.c
+@@ -147,6 +147,10 @@
+ NULL
+ };
+
++
++/* If true, do not show the exit message */
++static boolean quiet;
++
+ /* If true, show an English description next to each statistic. */
+ static boolean verbose;
+
+@@ -172,6 +176,7 @@
+ {"help", no_argument, NULL, 'h'},
+ {"output-file", required_argument, NULL, 'o'},
+ {"portability", no_argument, NULL, 'p'},
++ {"quiet", no_argument,NULL, 'q'},
+ {"verbose", no_argument, NULL, 'v'},
+ {"version", no_argument, NULL, 'V'},
+ {NULL, no_argument, NULL, 0}
+@@ -333,7 +338,8 @@
+ else if (WIFSIGNALED (resp->waitstatus))
+ fprintf (fp, "Command terminated by signal %d\n",
+ WTERMSIG (resp->waitstatus));
+- else if (WIFEXITED (resp->waitstatus) && WEXITSTATUS (resp->waitstatus))
++ else if (WIFEXITED (resp->waitstatus) && WEXITSTATUS (resp->waitstatus)
++ && !quiet)
+ fprintf (fp, "Command exited with non-zero status %d\n",
+ WEXITSTATUS (resp->waitstatus));
+
+@@ -523,6 +529,7 @@
+ char *format; /* Format found in environment. */
+
+ /* Initialize the option flags. */
++ quiet = false;
+ verbose = false;
+ outfile = NULL;
+ outfp = stderr;
+@@ -536,7 +543,7 @@
+ if (format)
+ output_format = format;
+
+- while ((optc = getopt_long (argc, argv, "+af:o:pvV", longopts, (int *) 0))
++ while ((optc = getopt_long (argc, argv, "+af:o:pqvV", longopts, (int *) 0))
+ != EOF)
+ {
+ switch (optc)
+@@ -555,6 +562,9 @@
+ case 'p':
+ output_format = posix_format;
+ break;
++ case 'q':
++ quiet = true;
++ break;
+ case 'v':
+ verbose = true;
+ break;
+@@ -642,9 +652,9 @@
+ fflush (outfp);
+
+ if (WIFSTOPPED (res.waitstatus))
+- exit (WSTOPSIG (res.waitstatus));
++ exit (WSTOPSIG (res.waitstatus) + 128);
+ else if (WIFSIGNALED (res.waitstatus))
+- exit (WTERMSIG (res.waitstatus));
++ exit (WTERMSIG (res.waitstatus) + 128);
+ else if (WIFEXITED (res.waitstatus))
+ exit (WEXITSTATUS (res.waitstatus));
+ }
+@@ -657,7 +667,7 @@
+ fprintf (stream, "\
+ Usage: %s [-apvV] [-f format] [-o file] [--append] [--verbose]\n\
+ [--portability] [--format=format] [--output=file] [--version]\n\
+- [--help] command [arg...]\n",
++ [--quiet] [--help] command [arg...]\n",
+ program_name);
+ exit (status);
+ }
+--- time-1.7.orig/resuse.h
++++ time-1.7/resuse.h
+@@ -36,19 +36,8 @@
+ # include <sys/rusage.h>
+ #else
+ # define TV_MSEC tv_usec / 1000
+-# if HAVE_WAIT3
++# if HAVE_SYS_RESOURCE_H
+ # include <sys/resource.h>
+-# else
+-/* Process resource usage structure. */
+-struct rusage
+-{
+- struct timeval ru_utime; /* User time used. */
+- struct timeval ru_stime; /* System time used. */
+- int ru_maxrss, ru_ixrss, ru_idrss, ru_isrss,
+- ru_minflt, ru_majflt, ru_nswap, ru_inblock,
+- ru_oublock, ru_msgsnd, ru_msgrcv, ru_nsignals,
+- ru_nvcsw, ru_nivcsw;
+-};
+ # endif
+ #endif
+
+--- time-1.7.orig/time.texi
++++ time-1.7/time.texi
+@@ -11,6 +11,12 @@
+ @finalout
+ @end iftex
+
++@dircategory Individual utilities
++@direntry
++* time: (time). Run programs and summarize
++ system resource usage.
++@end direntry
++
+ @ifinfo
+ This file documents the the GNU @code{time} command for running programs
+ and summarizing the system resources they use.
+@@ -185,6 +191,10 @@
+ sys %S
+ @end example
+
++@item -q
++@itemx --quiet
++Suppress non-zero error code from the executed program.
++
+ @item -v
+ @itemx --verbose
+ @cindex format
+--- time-1.7.orig/time.info
++++ time-1.7/time.info
+@@ -1,5 +1,10 @@
+-This is Info file ./time.info, produced by Makeinfo-1.55 from the input
+-file time.texi.
++This is time.info, produced by makeinfo version 4.1 from time.texi.
++
++INFO-DIR-SECTION Individual utilities
++START-INFO-DIR-ENTRY
++* time: (time). Run programs and summarize
++ system resource usage.
++END-INFO-DIR-ENTRY
+
+ This file documents the the GNU `time' command for running programs
+ and summarizing the system resources they use.
+@@ -31,7 +36,7 @@
+
+ * Resource Measurement:: Measuring program resource use.
+
+- -- The Detailed Node Listing --
++ --- The Detailed Node Listing ---
+
+ Measuring Program Resource Use
+
+@@ -58,14 +63,14 @@
+ The `time' command runs another program, then displays information
+ about the resources used by that program, collected by the system while
+ the program was running. You can select which information is reported
+-and the format in which it is shown (*note Setting Format::.), or have
++and the format in which it is shown (*note Setting Format::), or have
+ `time' save the information in a file instead of displaying it on the
+-screen (*note Redirecting::.).
++screen (*note Redirecting::).
+
+ The resources that `time' can report on fall into the general
+ categories of time, memory, and I/O and IPC calls. Some systems do not
+ provide much information about program resource use; `time' reports
+-unavailable information as zero values (*note Accuracy::.).
++unavailable information as zero values (*note Accuracy::).
+
+ The format of the `time' command is:
+
+@@ -132,6 +137,10 @@
+ user %U
+ sys %S
+
++`-q'
++`--quiet'
++ Suppress non-zero error code from the executed program.
++
+ `-v'
+ `--verbose'
+ Use the built-in verbose format, which displays each available
+@@ -174,7 +183,7 @@
+ The resource specifiers, which are a superset of those recognized by
+ the `tcsh' builtin `time' command, are listed below. Not all resources
+ are measured by all versions of Unix, so some of the values might be
+-reported as zero (*note Accuracy::.).
++reported as zero (*note Accuracy::).
+
+ * Menu:
+
+@@ -308,11 +317,11 @@
+ `-o FILE'
+ `--output=FILE'
+ Write the resource use statistics to FILE. By default, this
+- *overwrites* the file, destroying the file's previous contents.
++ _overwrites_ the file, destroying the file's previous contents.
+
+ `-a'
+ `--append'
+- *Append* the resource use information to the output file instead
++ _Append_ the resource use information to the output file instead
+ of overwriting it. This option is only useful with the `-o' or
+ `--output' option.
+
+@@ -437,7 +446,7 @@
+
+ `-a'
+ `--append'
+- *Append* the resource use information to the output file instead
++ _Append_ the resource use information to the output file instead
+ of overwriting it.
+
+ `-f FORMAT'
+@@ -462,17 +471,17 @@
+
+ 
+ Tag Table:
+-Node: Top934
+-Node: Resource Measurement1725
+-Node: Setting Format3678
+-Node: Format String4907
+-Node: Time Resources6214
+-Node: Memory Resources6844
+-Node: I/O Resources7549
+-Node: Command Info8747
+-Node: Redirecting8964
+-Node: Examples9754
+-Node: Accuracy12064
+-Node: Invoking time13586
++Node: Top1115
++Node: Resource Measurement1908
++Node: Setting Format3858
++Node: Format String5164
++Node: Time Resources6470
++Node: Memory Resources7100
++Node: I/O Resources7805
++Node: Command Info9003
++Node: Redirecting9220
++Node: Examples10010
++Node: Accuracy12320
++Node: Invoking time13842
+ 
+ End Tag Table
+--- time-1.7.orig/time.html
++++ time-1.7/time.html
+@@ -0,0 +1,1021 @@
++<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
++ "http://www.w3.org/TR/html40/loose.dtd">
++<HTML>
++<!-- Created on September, 1 2003 by texi2html 1.66 -->
++<!--
++Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
++ Karl Berry <karl@freefriends.org>
++ Olaf Bachmann <obachman@mathematik.uni-kl.de>
++ and many others.
++Maintained by: Many creative people <dev@texi2html.cvshome.org>
++Send bugs and suggestions to <users@texi2html.cvshome.org>
++
++-->
++<HEAD>
++<TITLE>Measuring Program Resource Use</TITLE>
++
++<META NAME="description" CONTENT="Measuring Program Resource Use">
++<META NAME="keywords" CONTENT="Measuring Program Resource Use">
++<META NAME="resource-type" CONTENT="document">
++<META NAME="distribution" CONTENT="global">
++<META NAME="Generator" CONTENT="texi2html 1.66">
++
++</HEAD>
++
++<BODY LANG="en" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
++
++<A NAME="SEC_Top"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H1>Measuring Program Resource Use</H1>
++
++<P>
++
++This file documents the the GNU <CODE>time</CODE> command for running programs
++and summarizing the system resources they use.
++This is edition 1.7, for version 1.7.
++</P>
++<P>
++
++</P>
++<TABLE BORDER="0" CELLSPACING="0">
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC1">1. Measuring Program Resource Use</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Measuring program resource use.</TD></TR>
++<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP">
++</TH></TR>
++<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP"> -- The Detailed Node Listing ---
++</TH></TR>
++<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP">
++</TH></TR>
++<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP">Measuring Program Resource Use
++</TH></TR>
++<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP">
++</TH></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC2">1.1 Setting the Output Format</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Selecting the information reported by <CODE>time</CODE>.</TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC3">1.2 The Format String</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The information <CODE>time</CODE> can report.</TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC8">1.3 Redirecting Output</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Writing the information to a file.</TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC9">1.4 Examples</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Examples of using <CODE>time</CODE>.</TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC10">1.5 Accuracy</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Limitations on the accuracy of <CODE>time</CODE> output.</TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC11">1.6 Running the <CODE>time</CODE> Command</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Summary of the options to the <CODE>time</CODE> command.</TD></TR>
++<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP">
++</TH></TR>
++<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP">The Format String
++</TH></TR>
++<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP">
++</TH></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC4">1.2.1 Time Resources</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC5">1.2.2 Memory Resources</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC6">1.2.3 I/O Resources</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC7">1.2.4 Command Info</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
++</TABLE>
++<P>
++
++<HR SIZE=1>
++<A NAME="SEC1"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC2"> &gt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<A NAME="Resource Measurement"></A>
++<H1> 1. Measuring Program Resource Use </H1>
++<!--docid::SEC1::-->
++<P>
++
++The <CODE>time</CODE> command runs another program, then displays information
++about the resources used by that program, collected by the system while
++the program was running. You can select which information is reported
++and the format in which it is shown (see section <A HREF="time.html#SEC2">1.1 Setting the Output Format</A>), or have
++<CODE>time</CODE> save the information in a file instead of displaying it on the
++screen (see section <A HREF="time.html#SEC8">1.3 Redirecting Output</A>).
++</P>
++<P>
++
++The resources that <CODE>time</CODE> can report on fall into the general
++categories of time, memory, and I/O and IPC calls. Some systems do not
++provide much information about program resource use; <CODE>time</CODE>
++reports unavailable information as zero values (see section <A HREF="time.html#SEC10">1.5 Accuracy</A>).
++</P>
++<P>
++
++The format of the <CODE>time</CODE> command is:
++</P>
++<P>
++
++<TABLE><tr><td>&nbsp;</td><td class=example><pre>time [option<small>...</small>] <VAR>command</VAR> [<VAR>arg</VAR><small>...</small>]
++</pre></td></tr></table><P>
++
++<A NAME="IDX1"></A>
++<CODE>time</CODE> runs the program <VAR>command</VAR>, with any given arguments
++<VAR>arg</VAR><small>...</small>. When <VAR>command</VAR> finishes, <CODE>time</CODE> displays
++information about resources used by <VAR>command</VAR>.
++</P>
++<P>
++
++Here is an example of using <CODE>time</CODE> to measure the time and other
++resources used by running the program <CODE>grep</CODE>:
++</P>
++<P>
++
++<TABLE><tr><td>&nbsp;</td><td class=example><pre>eg$ time grep nobody /etc/aliases
++nobody:/dev/null
++etc-files:nobody
++misc-group:nobody
++0.07user 0.50system 0:06.69elapsed 8%CPU (0avgtext+489avgdata 324maxresident)k
++46inputs+7outputs (43major+251minor)pagefaults 0swaps
++</pre></td></tr></table><P>
++
++Mail suggestions and bug reports for GNU <CODE>time</CODE> to
++<CODE>bug-gnu-utils@prep.ai.mit.edu</CODE>. Please include the version of
++<CODE>time</CODE>, which you can get by running `<SAMP>time --version</SAMP>', and the
++operating system and C compiler you used.
++</P>
++<P>
++
++<TABLE BORDER="0" CELLSPACING="0">
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC2">1.1 Setting the Output Format</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Selecting the information reported by <CODE>time</CODE>.</TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC3">1.2 The Format String</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The information <CODE>time</CODE> can report.</TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC8">1.3 Redirecting Output</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Writing the information to a file.</TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC9">1.4 Examples</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Examples of using <CODE>time</CODE>.</TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC10">1.5 Accuracy</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Limitations on the accuracy of <CODE>time</CODE> output.</TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC11">1.6 Running the <CODE>time</CODE> Command</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Summary of the options to the <CODE>time</CODE> command.</TD></TR>
++</TABLE>
++<P>
++
++<A NAME="Setting Format"></A>
++<HR SIZE="6">
++<A NAME="SEC2"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC3"> &gt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H2> 1.1 Setting the Output Format </H2>
++<!--docid::SEC2::-->
++<P>
++
++<CODE>time</CODE> uses a <EM>format string</EM> to determine which information to
++display about the resources used by the command it runs. See section <A HREF="time.html#SEC3">1.2 The Format String</A>, for the interpretation of the format string contents.
++</P>
++<P>
++
++You can specify a format string with the command line options listed
++below. If no format is specified on the command line, but the
++<CODE>TIME</CODE> environment variable is set, its value is used as the format
++string. Otherwise, the default format built into <CODE>time</CODE> is used:
++</P>
++<P>
++
++<TABLE><tr><td>&nbsp;</td><td class=example><pre>%Uuser %Ssystem %Eelapsed %PCPU (%Xtext+%Ddata %Mmax)k
++%Iinputs+%Ooutputs (%Fmajor+%Rminor)pagefaults %Wswaps
++</pre></td></tr></table><P>
++
++The command line options to set the format are:
++</P>
++<P>
++
++</P>
++<DL COMPACT>
++<DT><CODE>-f <VAR>format</VAR></CODE>
++<DD><DT><CODE>--format=<VAR>format</VAR></CODE>
++<DD>Use <VAR>format</VAR> as the format string.
++<P>
++
++</P>
++<DT><CODE>-p</CODE>
++<DD><DT><CODE>--portability</CODE>
++<DD>Use the following format string, for conformance with POSIX standard
++1003.2:
++<P>
++
++<TABLE><tr><td>&nbsp;</td><td class=example><pre>real %e
++user %U
++sys %S
++</pre></td></tr></table><P>
++
++</P>
++<DT><CODE>-q</CODE>
++<DD><DT><CODE>--quiet</CODE>
++<DD>Suppress non-zero error code from the executed program.
++<P>
++
++</P>
++<DT><CODE>-v</CODE>
++<DD><DT><CODE>--verbose</CODE>
++<DD><A NAME="IDX2"></A>
++Use the built-in verbose format, which displays each available piece of
++information on the program's resource use on its own line, with an
++English description of its meaning.
++</DL>
++<P>
++
++<A NAME="Format String"></A>
++<HR SIZE="6">
++<A NAME="SEC3"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC2"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC4"> &gt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H2> 1.2 The Format String </H2>
++<!--docid::SEC3::-->
++<P>
++
++<A NAME="IDX3"></A>
++<A NAME="IDX4"></A>
++The <EM>format string</EM> controls the contents of the <CODE>time</CODE> output.
++It consists of <EM>resource specifiers</EM> and <EM>escapes</EM>, interspersed
++with plain text.
++</P>
++<P>
++
++A backslash introduces an <EM>escape</EM>, which is translated
++into a single printing character upon output. The valid escapes are
++listed below. An invalid escape is output as a question mark followed
++by a backslash.
++</P>
++<P>
++
++</P>
++<DL COMPACT>
++<DT><CODE>\t</CODE>
++<DD>a tab character
++<P>
++
++</P>
++<DT><CODE>\n</CODE>
++<DD>a newline
++<P>
++
++</P>
++<DT><CODE>\\</CODE>
++<DD>a literal backslash
++</DL>
++<P>
++
++<CODE>time</CODE> always prints a newline after printing the resource use
++information, so normally format strings do not end with a newline
++character (or `<SAMP>\n</SAMP>').
++</P>
++<P>
++
++A resource specifier consists of a percent sign followed by another
++character. An invalid resource specifier is output as a question mark
++followed by the invalid character. Use `<SAMP>%%</SAMP>' to output a literal
++percent sign.
++</P>
++<P>
++
++The resource specifiers, which are a superset of those recognized by the
++<CODE>tcsh</CODE> builtin <CODE>time</CODE> command, are listed below. Not all
++resources are measured by all versions of Unix, so some of the values
++might be reported as zero (see section <A HREF="time.html#SEC10">1.5 Accuracy</A>).
++</P>
++<P>
++
++<TABLE BORDER="0" CELLSPACING="0">
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC4">1.2.1 Time Resources</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC5">1.2.2 Memory Resources</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC6">1.2.3 I/O Resources</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC7">1.2.4 Command Info</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
++</TABLE>
++<P>
++
++<A NAME="Time Resources"></A>
++<HR SIZE="6">
++<A NAME="SEC4"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC3"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC5"> &gt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H3> 1.2.1 Time Resources </H3>
++<!--docid::SEC4::-->
++<P>
++
++</P>
++<DL COMPACT>
++<DT><CODE>E</CODE>
++<DD>Elapsed real (wall clock) time used by the process, in
++[hours:]minutes:seconds.
++<P>
++
++</P>
++<DT><CODE>e</CODE>
++<DD>Elapsed real (wall clock) time used by the process, in
++seconds.
++<P>
++
++</P>
++<DT><CODE>S</CODE>
++<DD>Total number of CPU-seconds used by the system on behalf of the process
++(in kernel mode), in seconds.
++<P>
++
++</P>
++<DT><CODE>U</CODE>
++<DD>Total number of CPU-seconds that the process used directly (in user
++mode), in seconds.
++<P>
++
++</P>
++<DT><CODE>P</CODE>
++<DD>Percentage of the CPU that this job got. This is just user + system
++times divied by the total running time.
++</DL>
++<P>
++
++<A NAME="Memory Resources"></A>
++<HR SIZE="6">
++<A NAME="SEC5"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC4"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC6"> &gt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H3> 1.2.2 Memory Resources </H3>
++<!--docid::SEC5::-->
++<P>
++
++</P>
++<DL COMPACT>
++<DT><CODE>M</CODE>
++<DD>Maximum resident set size of the process during its lifetime, in
++Kilobytes.
++<P>
++
++</P>
++<DT><CODE>t</CODE>
++<DD>Average resident set size of the process, in Kilobytes.
++<P>
++
++</P>
++<DT><CODE>K</CODE>
++<DD>Average total (data+stack+text) memory use of the process, in Kilobytes.
++<P>
++
++</P>
++<DT><CODE>D</CODE>
++<DD>Average size of the process's unshared data area, in Kilobytes.
++<P>
++
++</P>
++<DT><CODE>p</CODE>
++<DD>Average size of the process's unshared stack, in Kilobytes.
++<P>
++
++</P>
++<DT><CODE>X</CODE>
++<DD>Average size of the process's shared text, in Kilobytes.
++<P>
++
++</P>
++<DT><CODE>Z</CODE>
++<DD>System's page size, in bytes. This is a per-system constant, but
++varies between systems.
++</DL>
++<P>
++
++<A NAME="I/O Resources"></A>
++<HR SIZE="6">
++<A NAME="SEC6"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC5"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC7"> &gt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H3> 1.2.3 I/O Resources </H3>
++<!--docid::SEC6::-->
++<P>
++
++</P>
++<DL COMPACT>
++<DT><CODE>F</CODE>
++<DD>Number of major, or I/O-requiring, page faults that occurred while the
++process was running. These are faults where the page has actually
++migrated out of primary memory.
++<P>
++
++</P>
++<DT><CODE>R</CODE>
++<DD>Number of minor, or recoverable, page faults. These are pages that are
++not valid (so they fault) but which have not yet been claimed by other
++virtual pages. Thus the data in the page is still valid but the system
++tables must be updated.
++<P>
++
++</P>
++<DT><CODE>W</CODE>
++<DD>Number of times the process was swapped out of main memory.
++<P>
++
++</P>
++<DT><CODE>c</CODE>
++<DD>Number of times the process was context-switched involuntarily (because
++the time slice expired).
++<P>
++
++</P>
++<DT><CODE>w</CODE>
++<DD>Number of times that the program was context-switched voluntarily, for
++instance while waiting for an I/O operation to complete.
++<P>
++
++</P>
++<DT><CODE>I</CODE>
++<DD>Number of file system inputs by the process.
++<P>
++
++</P>
++<DT><CODE>O</CODE>
++<DD>Number of file system outputs by the process.
++<P>
++
++</P>
++<DT><CODE>r</CODE>
++<DD>Number of socket messages received by the process.
++<P>
++
++</P>
++<DT><CODE>s</CODE>
++<DD>Number of socket messages sent by the process.
++<P>
++
++</P>
++<DT><CODE>k</CODE>
++<DD>Number of signals delivered to the process.
++</DL>
++<P>
++
++<A NAME="Command Info"></A>
++<HR SIZE="6">
++<A NAME="SEC7"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC6"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC8"> &gt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H3> 1.2.4 Command Info </H3>
++<!--docid::SEC7::-->
++<P>
++
++</P>
++<DL COMPACT>
++<DT><CODE>C</CODE>
++<DD>Name and command line arguments of the command being timed.
++<P>
++
++</P>
++<DT><CODE>x</CODE>
++<DD>Exit status of the command.
++</DL>
++<P>
++
++<A NAME="Redirecting"></A>
++<HR SIZE="6">
++<A NAME="SEC8"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC7"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC9"> &gt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H2> 1.3 Redirecting Output </H2>
++<!--docid::SEC8::-->
++<P>
++
++By default, <CODE>time</CODE> writes the resource use statistics to the
++standard error stream. The options below make it write the statistics
++to a file instead. Doing this can be useful if the program you're
++running writes to the standard error or you're running <CODE>time</CODE>
++noninteractively or in the background.
++</P>
++<P>
++
++</P>
++<DL COMPACT>
++<DT><CODE>-o <VAR>file</VAR></CODE>
++<DD><DT><CODE>--output=<VAR>file</VAR></CODE>
++<DD>Write the resource use statistics to <VAR>file</VAR>. By default, this
++<EM>overwrites</EM> the file, destroying the file's previous contents.
++<P>
++
++</P>
++<DT><CODE>-a</CODE>
++<DD><DT><CODE>--append</CODE>
++<DD><EM>Append</EM> the resource use information to the output file instead
++of overwriting it. This option is only useful with the `<SAMP>-o</SAMP>' or
++`<SAMP>--output</SAMP>' option.
++</DL>
++<P>
++
++<A NAME="Examples"></A>
++<HR SIZE="6">
++<A NAME="SEC9"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC8"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC10"> &gt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H2> 1.4 Examples </H2>
++<!--docid::SEC9::-->
++<P>
++
++Run the command `<SAMP>wc /etc/hosts</SAMP>' and show the default information:
++</P>
++<P>
++
++<TABLE><tr><td>&nbsp;</td><td class=example><pre>eg$ time wc /etc/hosts
++ 35 111 1134 /etc/hosts
++0.00user 0.01system 0:00.04elapsed 25%CPU (0avgtext+0avgdata 0maxresident)k
++1inputs+1outputs (0major+0minor)pagefaults 0swaps
++</pre></td></tr></table><P>
++
++Run the command `<SAMP>ls -Fs</SAMP>' and show just the user, system, and
++wall-clock time:
++</P>
++<P>
++
++<TABLE><tr><td>&nbsp;</td><td class=example><pre>eg$ time -f &quot;\t%E real,\t%U user,\t%S sys&quot; ls -Fs
++total 16
++1 account/ 1 db/ 1 mail/ 1 run/
++1 backups/ 1 emacs/ 1 msgs/ 1 rwho/
++1 crash/ 1 games/ 1 preserve/ 1 spool/
++1 cron/ 1 log/ 1 quotas/ 1 tmp/
++ 0:00.03 real, 0.00 user, 0.01 sys
++</pre></td></tr></table><P>
++
++Edit the file `<TT>.bashrc</TT>' and have <CODE>time</CODE> append the elapsed time
++and number of signals to the file `<TT>log</TT>', reading the format string
++from the environment variable <CODE>TIME</CODE>:
++</P>
++<P>
++
++<TABLE><tr><td>&nbsp;</td><td class=example><pre>eg$ export TIME=&quot;\t%E,\t%k&quot; # If using bash or ksh
++eg$ setenv TIME &quot;\t%E,\t%k&quot; # If using csh or tcsh
++eg$ time -a -o log emacs .bashrc
++eg$ cat log
++ 0:16.55, 726
++</pre></td></tr></table><P>
++
++Run the command `<SAMP>sleep 4</SAMP>' and show all of the information about it
++verbosely:
++</P>
++<P>
++
++<TABLE><tr><td>&nbsp;</td><td class=example><pre>eg$ time -v sleep 4
++ Command being timed: &quot;sleep 4&quot;
++ User time (seconds): 0.00
++ System time (seconds): 0.05
++ Percent of CPU this job got: 1%
++ Elapsed (wall clock) time (h:mm:ss or m:ss): 0:04.26
++ Average shared text size (kbytes): 36
++ Average unshared data size (kbytes): 24
++ Average stack size (kbytes): 0
++ Average total size (kbytes): 60
++ Maximum resident set size (kbytes): 32
++ Average resident set size (kbytes): 24
++ Major (requiring I/O) page faults: 3
++ Minor (reclaiming a frame) page faults: 0
++ Voluntary context switches: 11
++ Involuntary context switches: 0
++ Swaps: 0
++ File system inputs: 3
++ File system outputs: 1
++ Socket messages sent: 0
++ Socket messages received: 0
++ Signals delivered: 1
++ Page size (bytes): 4096
++ Exit status: 0
++</pre></td></tr></table><P>
++
++<A NAME="Accuracy"></A>
++<HR SIZE="6">
++<A NAME="SEC10"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC9"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC11"> &gt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H2> 1.5 Accuracy </H2>
++<!--docid::SEC10::-->
++<P>
++
++The elapsed time is not collected atomically with the execution of the
++program; as a result, in bizarre circumstances (if the <CODE>time</CODE>
++command gets stopped or swapped out in between when the program being
++timed exits and when <CODE>time</CODE> calculates how long it took to run), it
++could be much larger than the actual execution time.
++</P>
++<P>
++
++When the running time of a command is very nearly zero, some values
++(e.g., the percentage of CPU used) may be reported as either zero (which
++is wrong) or a question mark.
++</P>
++<P>
++
++Most information shown by <CODE>time</CODE> is derived from the <CODE>wait3</CODE>
++system call. The numbers are only as good as those returned by
++<CODE>wait3</CODE>. Many systems do not measure all of the resources that
++<CODE>time</CODE> can report on; those resources are reported as zero. The
++systems that measure most or all of the resources are based on 4.2 or
++4.3BSD. Later BSD releases use different memory management code that
++measures fewer resources.
++</P>
++<P>
++
++On systems that do not have a <CODE>wait3</CODE> call that returns status
++information, the <CODE>times</CODE> system call is used instead. It provides
++much less information than <CODE>wait3</CODE>, so on those systems <CODE>time</CODE>
++reports most of the resources as zero.
++</P>
++<P>
++
++The `<SAMP>%I</SAMP>' and `<SAMP>%O</SAMP>' values are allegedly only &quot;real&quot; input
++and output and do not include those supplied by caching devices. The
++meaning of &quot;real&quot; I/O reported by `<SAMP>%I</SAMP>' and `<SAMP>%O</SAMP>' may be
++muddled for workstations, especially diskless ones.
++</P>
++<P>
++
++<A NAME="Invoking time"></A>
++<HR SIZE="6">
++<A NAME="SEC11"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC10"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H2> 1.6 Running the <CODE>time</CODE> Command </H2>
++<!--docid::SEC11::-->
++<P>
++
++The format of the <CODE>time</CODE> command is:
++</P>
++<P>
++
++<TABLE><tr><td>&nbsp;</td><td class=example><pre>time [option<small>...</small>] <VAR>command</VAR> [<VAR>arg</VAR><small>...</small>]
++</pre></td></tr></table><P>
++
++<A NAME="IDX5"></A>
++<CODE>time</CODE> runs the program <VAR>command</VAR>, with any given arguments
++<VAR>arg</VAR><small>...</small>. When <VAR>command</VAR> finishes, <CODE>time</CODE> displays
++information about resources used by <VAR>command</VAR> (on the standard error
++output, by default). If <VAR>command</VAR> exits with non-zero status or is
++terminated by a signal, <CODE>time</CODE> displays a warning message and the
++exit status or signal number.
++</P>
++<P>
++
++Options to <CODE>time</CODE> must appear on the command line before
++<VAR>command</VAR>. Anything on the command line after <VAR>command</VAR> is
++passed as arguments to <VAR>command</VAR>.
++</P>
++<P>
++
++</P>
++<DL COMPACT>
++<DT><CODE>-o <VAR>file</VAR></CODE>
++<DD><DT><CODE>--output=<VAR>file</VAR></CODE>
++<DD>Write the resource use statistics to <VAR>file</VAR>.
++<P>
++
++</P>
++<DT><CODE>-a</CODE>
++<DD><DT><CODE>--append</CODE>
++<DD><EM>Append</EM> the resource use information to the output file instead
++of overwriting it.
++<P>
++
++</P>
++<DT><CODE>-f <VAR>format</VAR></CODE>
++<DD><DT><CODE>--format=<VAR>format</VAR></CODE>
++<DD>Use <VAR>format</VAR> as the format string.
++<P>
++
++</P>
++<DT><CODE>--help</CODE>
++<DD>Print a summary of the command line options to <CODE>time</CODE> and exit.
++<P>
++
++</P>
++<DT><CODE>-p</CODE>
++<DD><DT><CODE>--portability</CODE>
++<DD>Use the POSIX format.
++<P>
++
++</P>
++<DT><CODE>-v</CODE>
++<DD><DT><CODE>--verbose</CODE>
++<DD><A NAME="IDX6"></A>
++Use the built-in verbose format.
++<P>
++
++</P>
++<DT><CODE>-V</CODE>
++<DD><DT><CODE>--version</CODE>
++<DD><A NAME="IDX7"></A>
++Print the version number of <CODE>time</CODE> and exit.
++</DL>
++<P>
++
++<HR SIZE="6">
++<A NAME="SEC_Contents"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H1>Table of Contents</H1>
++<BLOCKQUOTE>
++<A NAME="TOC1" HREF="time.html#SEC1">1. Measuring Program Resource Use</A>
++<BR>
++<BLOCKQUOTE>
++<A NAME="TOC2" HREF="time.html#SEC2">1.1 Setting the Output Format</A>
++<BR>
++<A NAME="TOC3" HREF="time.html#SEC3">1.2 The Format String</A>
++<BR>
++<BLOCKQUOTE>
++<A NAME="TOC4" HREF="time.html#SEC4">1.2.1 Time Resources</A>
++<BR>
++<A NAME="TOC5" HREF="time.html#SEC5">1.2.2 Memory Resources</A>
++<BR>
++<A NAME="TOC6" HREF="time.html#SEC6">1.2.3 I/O Resources</A>
++<BR>
++<A NAME="TOC7" HREF="time.html#SEC7">1.2.4 Command Info</A>
++<BR>
++</BLOCKQUOTE>
++<A NAME="TOC8" HREF="time.html#SEC8">1.3 Redirecting Output</A>
++<BR>
++<A NAME="TOC9" HREF="time.html#SEC9">1.4 Examples</A>
++<BR>
++<A NAME="TOC10" HREF="time.html#SEC10">1.5 Accuracy</A>
++<BR>
++<A NAME="TOC11" HREF="time.html#SEC11">1.6 Running the <CODE>time</CODE> Command</A>
++<BR>
++</BLOCKQUOTE>
++</BLOCKQUOTE>
++<HR SIZE=1>
++<A NAME="SEC_OVERVIEW"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H1>Short Table of Contents</H1>
++<BLOCKQUOTE>
++<A NAME="TOC1" HREF="time.html#SEC1">1. Measuring Program Resource Use</A>
++<BR>
++
++</BLOCKQUOTE>
++<HR SIZE=1>
++<A NAME="SEC_About"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H1>About this document</H1>
++This document was generated
++by
++using <A HREF="http://texi2html.cvshome.org"><I>texi2html</I></A>
++<P></P>
++The buttons in the navigation panels have the following meaning:
++<P></P>
++<table border = "1">
++<TR>
++<TH> Button </TH>
++<TH> Name </TH>
++<TH> Go to </TH>
++<TH> From 1.2.3 go to</TH>
++</TR>
++<TR>
++<TD ALIGN="CENTER">
++ [ &lt; ] </TD>
++<TD ALIGN="CENTER">
++Back
++</TD>
++<TD>
++previous section in reading order
++</TD>
++<TD>
++1.2.2
++</TD>
++</TR>
++<TR>
++<TD ALIGN="CENTER">
++ [ &gt; ] </TD>
++<TD ALIGN="CENTER">
++Forward
++</TD>
++<TD>
++next section in reading order
++</TD>
++<TD>
++1.2.4
++</TD>
++</TR>
++<TR>
++<TD ALIGN="CENTER">
++ [ &lt;&lt; ] </TD>
++<TD ALIGN="CENTER">
++FastBack
++</TD>
++<TD>
++beginning of this chapter or previous chapter
++</TD>
++<TD>
++1
++</TD>
++</TR>
++<TR>
++<TD ALIGN="CENTER">
++ [ Up ] </TD>
++<TD ALIGN="CENTER">
++Up
++</TD>
++<TD>
++up section
++</TD>
++<TD>
++1.2
++</TD>
++</TR>
++<TR>
++<TD ALIGN="CENTER">
++ [ &gt;&gt; ] </TD>
++<TD ALIGN="CENTER">
++FastForward
++</TD>
++<TD>
++next chapter
++</TD>
++<TD>
++2
++</TD>
++</TR>
++<TR>
++<TD ALIGN="CENTER">
++ [Top] </TD>
++<TD ALIGN="CENTER">
++Top
++</TD>
++<TD>
++cover (top) of document
++</TD>
++<TD>
++ &nbsp;
++</TD>
++</TR>
++<TR>
++<TD ALIGN="CENTER">
++ [Contents] </TD>
++<TD ALIGN="CENTER">
++Contents
++</TD>
++<TD>
++table of contents
++</TD>
++<TD>
++ &nbsp;
++</TD>
++</TR>
++<TR>
++<TD ALIGN="CENTER">
++ [Index] </TD>
++<TD ALIGN="CENTER">
++Index
++</TD>
++<TD>
++concept index
++</TD>
++<TD>
++ &nbsp;
++</TD>
++</TR>
++<TR>
++<TD ALIGN="CENTER">
++ [ ? ] </TD>
++<TD ALIGN="CENTER">
++About
++</TD>
++<TD>
++this page
++</TD>
++<TD>
++ &nbsp;
++</TD>
++</TR>
++</TABLE>
++ <P>
++ where the <STRONG> Example </STRONG> assumes that the current position
++ is at <STRONG> Subsubsection One-Two-Three </STRONG> of a document of
++ the following structure:</P>
++ <UL>
++ <LI> 1. Section One
++ <UL>
++ <LI>1.1 Subsection One-One
++ <UL>
++ <LI>...</LI>
++ </UL>
++ <LI>1.2 Subsection One-Two
++ <UL>
++ <LI>1.2.1 Subsubsection One-Two-One</LI>
++ <LI>1.2.2 Subsubsection One-Two-Two</LI>
++ <LI>1.2.3 Subsubsection One-Two-Three &nbsp; &nbsp;
++ <STRONG>&lt;== Current Position </STRONG></LI>
++ <LI>1.2.4 Subsubsection One-Two-Four</LI>
++ </UL>
++ </LI>
++ <LI>1.3 Subsection One-Three
++ <UL>
++ <LI>...</LI>
++ </UL>
++ </LI>
++ <LI>1.4 Subsection One-Four</LI>
++ </UL>
++ </LI>
++ </UL>
++
++<HR SIZE=1>
++<BR>
++<FONT SIZE="-1">
++This document was generated
++by <I>root</I> on <I>September, 1 2003</I>
++using <A HREF="http://texi2html.cvshome.org"><I>texi2html</I></A>
++</FONT>
++
++</BODY>
++</HTML>
diff --git a/import-layers/yocto-poky/meta/recipes-extended/time/time.inc b/import-layers/yocto-poky/meta/recipes-extended/time/time.inc
new file mode 100644
index 000000000..85862177b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/time/time.inc
@@ -0,0 +1,12 @@
+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 = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
+
+inherit texinfo update-alternatives
+
+ALTERNATIVE_${PN} = "time"
+ALTERNATIVE_PRIORITY = "100"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/time/time_1.7.bb b/import-layers/yocto-poky/meta/recipes-extended/time/time_1.7.bb
new file mode 100644
index 000000000..92c5353d0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/time/time_1.7.bb
@@ -0,0 +1,11 @@
+require time.inc
+
+PR = "r2"
+
+SRC_URI = "${GNU_MIRROR}/time/time-${PV}.tar.gz \
+ file://debian.patch"
+
+SRC_URI[md5sum] = "e38d2b8b34b1ca259cf7b053caac32b3"
+SRC_URI[sha256sum] = "e37ea79a253bf85a85ada2f7c632c14e481a5fd262a362f6f4fd58e68601496d"
+
+inherit autotools
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tzcode/tzcode-native_2016c.bb b/import-layers/yocto-poky/meta/recipes-extended/tzcode/tzcode-native_2016c.bb
new file mode 100644
index 000000000..06b92ea6e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tzcode/tzcode-native_2016c.bb
@@ -0,0 +1,25 @@
+# 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=76ae2becfcb9a685041c6f166b44c2c2"
+
+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"
+
+SRC_URI[tzcode.md5sum] = "ffb82ab0b588138759902b4627a6a80d"
+SRC_URI[tzcode.sha256sum] = "344b1bd486935bca2b7baa47db3b99b32211c45f31ec0d1ead8bacd103c5a416"
+SRC_URI[tzdata.md5sum] = "0330ccd16140d3b6438a18dae9b34b93"
+SRC_URI[tzdata.sha256sum] = "8700d981e6f2007ac037dabb5d2b12f390e8629bbc30e564bc21cf0c069a2d48"
+
+S = "${WORKDIR}"
+
+inherit native
+
+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/import-layers/yocto-poky/meta/recipes-extended/tzdata/tzdata_2016c.bb b/import-layers/yocto-poky/meta/recipes-extended/tzdata/tzdata_2016c.bb
new file mode 100644
index 000000000..5eb85b7e9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tzdata/tzdata_2016c.bb
@@ -0,0 +1,212 @@
+SUMMARY = "Timezone data"
+HOMEPAGE = "http://www.iana.org/time-zones"
+SECTION = "base"
+LICENSE = "PD & BSD & BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=76ae2becfcb9a685041c6f166b44c2c2"
+
+DEPENDS = "tzcode-native"
+
+SRC_URI = "http://www.iana.org/time-zones/repository/releases/tzdata${PV}.tar.gz;name=tzdata"
+
+SRC_URI[tzdata.md5sum] = "0330ccd16140d3b6438a18dae9b34b93"
+SRC_URI[tzdata.sha256sum] = "8700d981e6f2007ac037dabb5d2b12f390e8629bbc30e564bc21cf0c069a2d48"
+
+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}/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/Bankok \
+ ${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/iso3166.tab \
+ ${datadir}/zoneinfo/Etc/*"
+
+CONFFILES_${PN} += "${@ "${sysconfdir}/timezone" if bb.utils.to_boolean(d.getVar('INSTALL_TIMEZONE_FILE', True)) else "" }"
+CONFFILES_${PN} += "${sysconfdir}/localtime"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/06-unzip60-alt-iconv-utf8_CVE-2015-1315.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/09-cve-2014-8139-crc-overflow.patch b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/09-cve-2014-8139-crc-overflow.patch
new file mode 100644
index 000000000..0e497cc65
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/10-cve-2014-8140-test-compr-eb.patch b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/10-cve-2014-8140-test-compr-eb.patch
new file mode 100644
index 000000000..c989df189
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/10-cve-2014-8140-test-compr-eb.patch
@@ -0,0 +1,34 @@
+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>
+
+--- a/extract.c
++++ b/extract.c
+@@ -2232,10 +2232,17 @@
+ 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! */
+
+ if (
+ #ifdef INT_16BIT
diff --git a/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/11-cve-2014-8141-getzip64data.patch b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/11-cve-2014-8141-getzip64data.patch
new file mode 100644
index 000000000..c48c23f30
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/CVE-2015-7696.patch b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/CVE-2015-7696.patch
new file mode 100644
index 000000000..87eed965d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/CVE-2015-7697.patch b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/CVE-2015-7697.patch
new file mode 100644
index 000000000..a8f293674
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/avoid-strip.patch b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/avoid-strip.patch
new file mode 100644
index 000000000..8f30e4267
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/cve-2014-9636.patch b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/cve-2014-9636.patch
new file mode 100644
index 000000000..5fcd318b2
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/define-ldflags.patch b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/define-ldflags.patch
new file mode 100644
index 000000000..659c6e331
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip_6.0.bb b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip_6.0.bb
new file mode 100644
index 000000000..9efe75628
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip_6.0.bb
@@ -0,0 +1,57 @@
+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 = "ftp://ftp.info-zip.org/pub/infozip/src/unzip60.tgz \
+ 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 \
+"
+
+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/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/0001-Fix-build-issues-found-with-non-glibc-C-libraries.patch b/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/0001-Fix-build-issues-found-with-non-glibc-C-libraries.patch
new file mode 100644
index 000000000..8afed5c0d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/0001-Fix-build-issues-found-with-non-glibc-C-libraries.patch
@@ -0,0 +1,99 @@
+From 83ec34df357218a1c9cfc13a23d3367d333652c3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 30 Dec 2015 01:01:15 +0000
+Subject: [PATCH] Fix build issues found with non glibc C libraries
+
+Add time.h for getting time_t definition
+limits.h for PATH_MAX
+linux/param.h for EXEC_PAGESIZE
+Replace deprecated MNTTAB with _PATH_MNTTAB
+include ext2_mnt.h for MNTOPT_USRQUOTA and MNTOPT_GRPQUOTA and
+MNTTYPE_EXT2
+Include sys/types.h for u_char definition
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+
+Upstream-Status: Submitted
+
+ include/extern.h | 1 +
+ src/configfile.c | 1 +
+ src/memory.c | 3 +++
+ src/net.c | 1 +
+ src/shutdown.c | 3 ++-
+ 5 files changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/include/extern.h b/include/extern.h
+index 21db11b..04b16bc 100644
+--- a/include/extern.h
++++ b/include/extern.h
+@@ -3,6 +3,7 @@
+
+ #include <netinet/in.h>
+ #include <stdio.h>
++#include <time.h>
+
+ #include "logmessage.h"
+ #include "xmalloc.h"
+diff --git a/src/configfile.c b/src/configfile.c
+index be5d7b3..7c1d1dd 100644
+--- a/src/configfile.c
++++ b/src/configfile.c
+@@ -16,6 +16,7 @@
+ #include <errno.h>
+ #include <string.h>
+ #include <dirent.h>
++#include <limits.h>
+ #include <sys/stat.h>
+
+ #include "extern.h"
+diff --git a/src/memory.c b/src/memory.c
+index e9607e4..b5e08aa 100644
+--- a/src/memory.c
++++ b/src/memory.c
+@@ -21,6 +21,9 @@
+ #include <sys/stat.h>
+ #include <sys/param.h>
+ #include <sys/mman.h>
++#ifdef __linux__
++#include <linux/param.h>
++#endif
+
+ #include "extern.h"
+ #include "watch_err.h"
+diff --git a/src/net.c b/src/net.c
+index 21823ae..8930caf 100644
+--- a/src/net.c
++++ b/src/net.c
+@@ -17,6 +17,7 @@
+ #include <string.h>
+ #include <unistd.h> /* for gethostname() etc */
+ #include <netdb.h> /* for gethostbyname() */
++#include <sys/types.h>
+ #include <sys/param.h> /* for MAXHOSTNAMELEN */
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+diff --git a/src/shutdown.c b/src/shutdown.c
+index 74aafa5..46b99cf 100644
+--- a/src/shutdown.c
++++ b/src/shutdown.c
+@@ -25,6 +25,7 @@
+
+ #include "watch_err.h"
+ #include "extern.h"
++#include "ext2_mnt.h"
+
+ #if defined __GLIBC__
+ #include "ext2_mnt.h"
+@@ -123,7 +124,7 @@ static void mnt_off()
+ FILE *fp;
+ struct mntent *mnt;
+
+- fp = setmntent(MNTTAB, "r");
++ fp = setmntent(_PATH_MNTTAB, "r");
+ /* in some rare cases fp might be NULL so be careful */
+ while (fp != NULL && ((mnt = getmntent(fp)) != (struct mntent *)0)) {
+ /* First check if swap */
+--
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/fix-ping-failure.patch b/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/fix-ping-failure.patch
new file mode 100644
index 000000000..14ab9c56a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/fix-ping-failure.patch
@@ -0,0 +1,79 @@
+Fix ping mode failure
+
+Upstream-Status: Pending
+
+When watchdog works on ping mode, the system will be rebooted since
+watchdog can not receive the expected ECOREPLY on a setting interval.
+
+Ping mode uses a raw socket to send a ECO packet, then uses select()
+to wait and recvfrom() to receive the ECOREPLY packet, if select()
+shows the data is ready, and the data is not the expected ECOREPLY,
+and waiting time is not overdue, it will continue use select() and
+recvfrom().
+
+Problem is that the raw socket can receive any icmp packets, if we do
+not set filters, and there are many icmp packets on socket, this
+program will not find its interested ECOREPLY packet in a special
+interval, which makes the ping mode fail.
+
+
+Other program is that watchdog sometime can not reach the call of
+recvfrom to try to receive packets since tv_sec of struct timeval
+of select parameter is 0.
+
+The timeout of select() is the result of ping interval minusing the
+time of calling gettimeofday spending, when ping interval is 1 second,
+and the call of gettimeofday() spends several useconds, the tv_sec of
+struct timeval of select parameter must be 0, at that condition, we
+should it is valid of tv_sec of struct timeval of select parameter be 0
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ src/net.c | 2 +-
+ src/watchdog.c | 5 ++++-
+ 2 files changed, 5 insertions(+), 2 deletions(-)
+
+Index: watchdog-5.14/src/watchdog.c
+===================================================================
+--- watchdog-5.14.orig/src/watchdog.c
++++ watchdog-5.14/src/watchdog.c
+@@ -24,6 +24,7 @@
+ #include <sys/types.h>
+ #include <sys/ioctl.h>
+ #include <linux/oom.h>
++#include <linux/icmp.h>
+ #include <linux/watchdog.h>
+ #include <string.h>
+
+Index: watchdog-5.14/src/net.c
+===================================================================
+--- watchdog-5.14.orig/src/net.c
++++ watchdog-5.14/src/net.c
+@@ -11,7 +11,8 @@
+ #include <errno.h>
+ #include <sys/time.h>
+ #include <netinet/ip.h>
+-#include <netinet/ip_icmp.h>
++#include <linux/icmp.h>
++//#include <netinet/ip_icmp.h>
+ #include <fcntl.h>
+ #include <string.h>
+ #include <unistd.h> /* for gethostname() etc */
+@@ -179,6 +180,9 @@ int open_netcheck(struct list *tlist)
+ {
+ struct list *act;
+ int hold = 0;
++ struct icmp_filter filt;
++ filt.data = ~(1<<ICMP_ECHOREPLY);
++
+
+ if (tlist != NULL) {
+ for (act = tlist; act != NULL; act = act->next) {
+@@ -202,6 +206,7 @@ int open_netcheck(struct list *tlist)
+ fatal_error(EX_SYSERR, "error opening socket (%s)", strerror(errno));
+ }
+
++ setsockopt(net->sock_fp, SOL_RAW, ICMP_FILTER, (char*)&filt, sizeof(filt));
+ /* this is necessary for broadcast pings to work */
+ (void)setsockopt(net->sock_fp, SOL_SOCKET, SO_BROADCAST, (char *)&hold, sizeof(hold));
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/fixsepbuild.patch b/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/fixsepbuild.patch
new file mode 100644
index 000000000..2fad3a112
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/fixsepbuild.patch
@@ -0,0 +1,27 @@
+Fix out of tree build support:
+
+| installing /etc/watchdog.conf
+| /bin/mkdir -p '/media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/image/usr/share/man/man5'
+| /bin/mkdir -p '/media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/image/usr/share/man/man8'
+| /usr/bin/install -c -m 644 /media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/watchdog-5.13/watchdog.conf.5 '/media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/image/usr/share/man/man5'
+| /usr/bin/install -c -m 644 /media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/watchdog-5.13/watchdog.8 /media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/watchdog-5.13/wd_keepalive.8 /media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/watchdog-5.13/wd_identify.8 '/media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/image/usr/share/man/man8'
+| /usr/bin/install: cannot stat `watchdog.conf': No such file or directory
+| make[2]: *** [install-etc-local] Error 1
+
+Upstream-Status: Pending
+
+RP 2013/03/21
+
+Index: watchdog-5.13/Makefile.am
+===================================================================
+--- watchdog-5.13.orig/Makefile.am 2013-02-01 11:15:44.000000000 +0000
++++ watchdog-5.13/Makefile.am 2013-03-21 11:59:35.637139031 +0000
+@@ -16,7 +16,7 @@
+ else \
+ echo "installing $(CONFIG_FILENAME)"; \
+ $(mkinstalldirs) `dirname $(DESTDIR)$(CONFIG_FILENAME)`; \
+- $(INSTALL_DATA) watchdog.conf $(DESTDIR)$(CONFIG_FILENAME); \
++ $(INSTALL_DATA) $(srcdir)/watchdog.conf $(DESTDIR)$(CONFIG_FILENAME); \
+ fi
+
+ install-data-local: install-etc-local
diff --git a/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/watchdog-conf.patch b/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/watchdog-conf.patch
new file mode 100644
index 000000000..e68ad545c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/watchdog-conf.patch
@@ -0,0 +1,14 @@
+Signed-off-by: Diego Rondini <diego.ml@zoho.com>
+Upstream-Status: Inappropriate
+
+--- watchdog-5.13.orig/watchdog.conf 2013-02-01 12:15:44.000000000 +0100
++++ watchdog-5.13/watchdog.conf 2014-11-13 10:59:43.233943000 +0100
+@@ -20,7 +20,7 @@
+ #test-binary =
+ #test-timeout =
+
+-#watchdog-device = /dev/watchdog
++watchdog-device = /dev/watchdog
+
+ # Defaults compiled into the binary
+ #temperature-device =
diff --git a/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/watchdog-init.patch b/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/watchdog-init.patch
new file mode 100644
index 000000000..b2765f190
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog_5.14.bb b/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog_5.14.bb
new file mode 100644
index 000000000..733023897
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog_5.14.bb
@@ -0,0 +1,40 @@
+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://fixsepbuild.patch \
+ file://fix-ping-failure.patch \
+ file://watchdog-init.patch \
+ file://watchdog-conf.patch \
+ file://0001-Fix-build-issues-found-with-non-glibc-C-libraries.patch \
+"
+
+SRC_URI[md5sum] = "5b2dba0c593942f4acc100bca0d560c4"
+SRC_URI[sha256sum] = "620b2f49e9879f2e85c73d4c1f422f9101e6b38e824fea2414befd8bb6866ad1"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/watchdog/files/watchdog/"
+UPSTREAM_CHECK_REGEX = "/watchdog/(?P<pver>(\d+[\.\-_]*)+)/"
+
+inherit autotools
+inherit update-rc.d
+
+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_NAME = "watchdog.sh"
+INITSCRIPT_PARAMS = "start 15 1 2 3 4 5 . stop 85 0 6 ."
+
+RRECOMMENDS_${PN} = "kernel-module-softdog"
+
+do_install_append() {
+ install -D ${S}/redhat/watchdog.init ${D}/${sysconfdir}/init.d/watchdog.sh
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/wget/wget.inc b/import-layers/yocto-poky/meta/recipes-extended/wget/wget.inc
new file mode 100644
index 000000000..dc381a628
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/wget/wget.inc
@@ -0,0 +1,29 @@
+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=d32239bcb673463ab874e80d47fae504"
+DEPENDS = "gnutls zlib libpcre"
+
+INC_PR = "r16"
+
+inherit autotools gettext texinfo update-alternatives pkgconfig
+
+EXTRA_OECONF = "--enable-ipv6 --with-ssl=gnutls --disable-rpath --disable-iri \
+ --without-libgnutls-prefix ac_cv_header_uuid_uuid_h=no"
+
+ALTERNATIVE_${PN} = "wget"
+ALTERNATIVE_${PN}_class-nativesdk = ""
+ALTERNATIVE_PRIORITY = "100"
+
+RRECOMMENDS_${PN} += "ca-certificates"
+
+BBCLASSEXTEND += "nativesdk"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[libuuid] = "--with-libuuid, --without-libuuid,util-linux"
+
+# 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/import-layers/yocto-poky/meta/recipes-extended/wget/wget/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/wget/wget_1.17.1.bb b/import-layers/yocto-poky/meta/recipes-extended/wget/wget_1.17.1.bb
new file mode 100644
index 000000000..dca5d1f71
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/wget/wget_1.17.1.bb
@@ -0,0 +1,8 @@
+SRC_URI = "${GNU_MIRROR}/wget/wget-${PV}.tar.gz \
+ file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+ "
+
+SRC_URI[md5sum] = "a6a908c9ae0e6a4194c628974cc3f05a"
+SRC_URI[sha256sum] = "029fbb93bdc1c0c5a7507b6076a6ec2f8d34204a85aa87e5b2f61a9405b290f5"
+
+require wget.inc
diff --git a/import-layers/yocto-poky/meta/recipes-extended/which/which-2.18/automake-foreign.patch b/import-layers/yocto-poky/meta/recipes-extended/which/which-2.18/automake-foreign.patch
new file mode 100644
index 000000000..495cdc6cf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/which/which-2.18/automake-foreign.patch
@@ -0,0 +1,28 @@
+Subject: [PATCH] automake foreign strictness
+
+Use foreign strictness to avoid automake errors.
+
+Upstream-Status: Inappropriate [upstream no longer active]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ configure.ac | 5 +++--
+ 1 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index b30b6f5..bd3222c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1,6 +1,7 @@
+ dnl Process this file with autoconf to produce a configure script.
+-AC_INIT(which.c)
+-AM_INIT_AUTOMAKE(which, 2.18)
++AC_INIT([which],[2.18])
++AC_CONFIG_SRCDIR(which.c)
++AM_INIT_AUTOMAKE([foreign])
+ AM_CONFIG_HEADER(config.h)
+ AM_MAINTAINER_MODE
+
+--
+1.7.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/which/which-2.18/fix_name_conflict_group_member.patch b/import-layers/yocto-poky/meta/recipes-extended/which/which-2.18/fix_name_conflict_group_member.patch
new file mode 100644
index 000000000..fb9b1a408
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/which/which-2.18/fix_name_conflict_group_member.patch
@@ -0,0 +1,53 @@
+Upstream-Status: Inappropriate [this is 2.18(GPLv2) specific]
+
+# glibc also implements the function group_member. To avoid name conflict,
+# here let us append a "_" to which's version.
+#
+# Signed-off-by Dexuan Cui <dexuan.cui@intel.com>, 2010-08-20
+# (this patch is licensed under GPLv2)
+
+--- which-2.18/bash.c
++++ which-2.18/bash.c
+@@ -45,7 +45,12 @@
+ * - changed all occurences of 'gid_t' into 'GID_T'.
+ * - exported functions needed in which.c
+ */
+-static int group_member (GID_T gid);
++
++/*
++ * glibc also implements the function group_member. To avoid name conflict,
++ * here let us append a "_" to which's version.
++ */
++static int _group_member (GID_T gid);
+ static char* extract_colon_unit (char const* string, int *p_index);
+
+ /*===========================================================================
+@@ -200,8 +205,8 @@
+
+ /* From bash-2.05b / general.c / line 805 */
+ /* Return non-zero if GID is one that we have in our groups list. */
+-int
+-group_member (GID_T gid)
++static int
++_group_member (GID_T gid)
+ {
+ #if defined (HAVE_GETGROUPS)
+ register int i;
+@@ -290,7 +295,7 @@
+ return (X_BIT (u_mode_bits (finfo.st_mode))) ? (FS_EXISTS | FS_EXECABLE) : FS_EXISTS;
+
+ /* Otherwise, if we are in the owning group, the group permissions apply. */
+- if (group_member (finfo.st_gid))
++ if (_group_member (finfo.st_gid))
+ return (X_BIT (g_mode_bits (finfo.st_mode))) ? (FS_EXISTS | FS_EXECABLE) : FS_EXISTS;
+
+ /* Otherwise, if we are in the other group, the other permissions apply. */
+@@ -331,7 +336,7 @@
+ /* Given a string containing units of information separated by colons,
+ return the next one pointed to by (P_INDEX), or NULL if there are no more.
+ Advance (P_INDEX) to the character after the colon. */
+-char*
++static char*
+ extract_colon_unit (char const* string, int* p_index)
+ {
+ int i, start, len;
diff --git a/import-layers/yocto-poky/meta/recipes-extended/which/which-2.21/automake.patch b/import-layers/yocto-poky/meta/recipes-extended/which/which-2.21/automake.patch
new file mode 100644
index 000000000..4d0f2e4d7
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/which/which_2.18.bb b/import-layers/yocto-poky/meta/recipes-extended/which/which_2.18.bb
new file mode 100644
index 000000000..eb6cc9967
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/which/which_2.18.bb
@@ -0,0 +1,34 @@
+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 = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+PR = "r2"
+
+SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/which/which-2.18.tar.gz/42d51938e48b91f6e19fabf216f5c3e9/which-${PV}.tar.gz \
+ file://fix_name_conflict_group_member.patch \
+ file://automake-foreign.patch \
+"
+
+SRC_URI[md5sum] = "42d51938e48b91f6e19fabf216f5c3e9"
+SRC_URI[sha256sum] = "9445cd7e02ec0c26a44fd56098464ded064ba5d93dd2e15ec12410ba56b2e544"
+
+DEPENDS = "cwautomacros-native"
+
+inherit autotools texinfo update-alternatives
+
+do_configure_prepend() {
+ OLD="@ACLOCAL_CWFLAGS@"
+ NEW="-I ${STAGING_DIR_NATIVE}/${datadir}/cwautomacros/m4"
+ sed -i "s#${OLD}#${NEW}#g" `grep -rl ${OLD} ${S}`
+}
+
+ALTERNATIVE_${PN} = "which"
+ALTERNATIVE_PRIORITY = "100"
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/which/which_2.21.bb b/import-layers/yocto-poky/meta/recipes-extended/which/which_2.21.bb
new file mode 100644
index 000000000..a7687f6fe
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/which/which_2.21.bb
@@ -0,0 +1,32 @@
+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"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/xdg-utils/xdg-utils/0001-Don-t-build-the-in-script-manual.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/xdg-utils/xdg-utils/0001-Reinstate-xdg-terminal.patch b/import-layers/yocto-poky/meta/recipes-extended/xdg-utils/xdg-utils/0001-Reinstate-xdg-terminal.patch
new file mode 100644
index 000000000..e9defadea
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/xdg-utils/xdg-utils_1.1.1.bb b/import-layers/yocto-poky/meta/recipes-extended/xdg-utils/xdg-utils_1.1.1.bb
new file mode 100644
index 000000000..c1472cf97
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/xdg-utils/xdg-utils_1.1.1.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Basic desktop integration functions"
+
+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] = "2d0aec6037769a5f138ff404b1bb4b15"
+SRC_URI[sha256sum] = "b0dd63a2576e0bb16f1aa78d6ddf7d6784784a098d4df17161cd6a17c7bc4125"
+
+UPSTREAM_CHECK_REGEX = "xdg-utils-(?P<pver>((\d+[\.\-_]*)+)((rc|alpha|beta)\d+)?)\.(tar\.gz|tgz)"
+
+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/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/0001-configure-Use-HAVE_SYS_RESOURCE_H-to-guard-sys-resou.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/Disable-services-from-inetd.conf-if-a-service-with-t.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/Various-fixes-from-the-previous-maintainer.patch b/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/Various-fixes-from-the-previous-maintainer.patch
new file mode 100644
index 000000000..8e59cdcaa
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd-CVE-2013-4342.patch b/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd-CVE-2013-4342.patch
new file mode 100644
index 000000000..c44c5a113
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd-CVE-2013-4342.patch
@@ -0,0 +1,33 @@
+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>
+---
+ 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/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd-should-be-able-to-listen-on-IPv6-even-in-ine.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd.conf b/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd.conf
new file mode 100644
index 000000000..9e6ea2577
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd.default b/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd.default
new file mode 100644
index 000000000..20a38e3f3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd.init b/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd.init
new file mode 100644
index 000000000..777c2c8b4
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd.service b/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd.service
new file mode 100644
index 000000000..d5fdc5bc2
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd_2.3.15.bb b/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd_2.3.15.bb
new file mode 100644
index 000000000..6bfaabe82
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd_2.3.15.bb
@@ -0,0 +1,77 @@
+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 \
+ "
+
+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/import-layers/yocto-poky/meta/recipes-extended/xz/xz_5.2.2.bb b/import-layers/yocto-poky/meta/recipes-extended/xz/xz_5.2.2.bb
new file mode 100644
index 000000000..d118f3a74
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/xz/xz_5.2.2.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] = "7cf6a8544a7dae8e8106fdf7addfa28c"
+SRC_URI[sha256sum] = "73df4d5d34f0468bd57d09f2d8af363e95ed6cc3a4a86129d2f2c366259902a2"
+
+inherit autotools gettext
+
+PACKAGES =+ "liblzma"
+
+FILES_liblzma = "${libdir}/liblzma*${SOLIBS}"
+
+BBCLASSEXTEND = "native nativesdk"
+
+export CONFIG_SHELL="/bin/sh"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/zip/zip.inc b/import-layers/yocto-poky/meta/recipes-extended/zip/zip.inc
new file mode 100644
index 000000000..6221c5e13
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/zip/zip.inc
@@ -0,0 +1,26 @@
+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"
+
+SRC_URI = "ftp://ftp.info-zip.org/pub/infozip/src/zip${@d.getVar('PV',1).replace('.', '')}.tgz"
+
+EXTRA_OEMAKE = "'CC=${CC}' 'BIND=${CC}' 'AS=${CC} -c' 'CPP=${CPP}' \
+ 'CFLAGS=-I. -DUNIX ${CFLAGS}' 'INSTALL=install' \
+ 'BINFLAGS=0755' 'INSTALL_D=install -d'"
+
+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"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/zip/zip_3.0.bb b/import-layers/yocto-poky/meta/recipes-extended/zip/zip_3.0.bb
new file mode 100644
index 000000000..383da4b89
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/zip/zip_3.0.bb
@@ -0,0 +1,18 @@
+require zip.inc
+
+PR="r2"
+
+# zip-2.32 still uses directory name of zip-2.30
+S = "${WORKDIR}/zip30"
+
+SRC_URI[md5sum] = "7b74551e63f8ee6aab6fbc86676c0d37"
+SRC_URI[sha256sum] = "f0e8bb1f9b7eb0b01285495a2699df3a4b766784c1765a8f1aeedf63c0806369"
+
+# exclude version 2.3.2 which triggers a false positive
+UPSTREAM_CHECK_REGEX = "^zip(?P<pver>(?!232).+)\.tgz"
+
+# zip.inc sets CFLAGS, but what Makefile actually uses is
+# CFLAGS_NOOPT. It will also force -O3 optimization, overriding
+# whatever we set.
+#
+EXTRA_OEMAKE_append = " 'CFLAGS_NOOPT=-I. -DUNIX ${CFLAGS}'"
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/epiphany/epiphany_3.18.4.bb b/import-layers/yocto-poky/meta/recipes-gnome/epiphany/epiphany_3.18.4.bb
new file mode 100644
index 000000000..869569c51
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/epiphany/epiphany_3.18.4.bb
@@ -0,0 +1,26 @@
+SUMMARY = "WebKit based web browser for GNOME"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+DEPENDS = "libsoup-2.4 webkitgtk gtk+3 iso-codes ca-certificates avahi libnotify gcr libwnck3 \
+ gsettings-desktop-schemas gnome-desktop3 libxml2-native intltool-native"
+
+inherit gnomebase gsettings distro_features_check upstream-version-is-even
+# libwnck3 is x11 only
+REQUIRED_DISTRO_FEATURES = "x11"
+
+SRC_URI += "file://0001-yelp.m4-drop-the-check-for-itstool.patch"
+SRC_URI[archive.md5sum] = "172b78256100e8d3c629764abd0e1495"
+SRC_URI[archive.sha256sum] = "be699d484371111abae754e669187215df73e21533f461e513b79537d7a1c1c1"
+
+EXTRA_OECONF += " --disable-nss --with-distributor-name=${DISTRO}"
+
+do_configure_prepend() {
+ touch ${S}/gnome-doc-utils.make
+ sed -i -e s:help::g ${S}/Makefile.am
+}
+
+FILES_${PN} += "${datadir}/appdata ${datadir}/dbus-1 ${datadir}/gnome-shell/search-providers"
+RDEPENDS_${PN} = "iso-codes adwaita-icon-theme"
+RRECOMMENDS_${PN} = "ca-certificates"
+
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/epiphany/files/0001-yelp.m4-drop-the-check-for-itstool.patch b/import-layers/yocto-poky/meta/recipes-gnome/epiphany/files/0001-yelp.m4-drop-the-check-for-itstool.patch
new file mode 100644
index 000000000..2585d7f74
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/epiphany/files/0001-yelp.m4-drop-the-check-for-itstool.patch
@@ -0,0 +1,33 @@
+From 30f03a256efe375a4d5c3a24bf4168ebf380e3ab Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 30 Jul 2015 15:13:23 +0300
+Subject: [PATCH] yelp.m4: drop the check for itstool
+
+It isn't used for anything during build, so there's no need to provide
+it as a recipe.
+
+Upstream-Status: Inappropriate [tarball-specific issue]
+---
+ m4/yelp.m4 | 6 ------
+ 1 file changed, 6 deletions(-)
+
+diff --git a/m4/yelp.m4 b/m4/yelp.m4
+index 5db847f..1b6ede4 100644
+--- a/m4/yelp.m4
++++ b/m4/yelp.m4
+@@ -27,12 +27,6 @@ AC_ARG_WITH([help-dir],
+ HELP_DIR="$with_help_dir"
+ AC_SUBST(HELP_DIR)
+
+-AC_ARG_VAR([ITSTOOL], [Path to the `itstool` command])
+-AC_CHECK_PROG([ITSTOOL], [itstool], [itstool])
+-if test x"$ITSTOOL" = x; then
+- AC_MSG_ERROR([itstool not found])
+-fi
+-
+ AC_ARG_VAR([XMLLINT], [Path to the `xmllint` command])
+ AC_CHECK_PROG([XMLLINT], [xmllint], [xmllint])
+ if test x"$XMLLINT" = x; then
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gcr/gcr_3.18.0.bb b/import-layers/yocto-poky/meta/recipes-gnome/gcr/gcr_3.18.0.bb
new file mode 100644
index 000000000..32523a64a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gcr/gcr_3.18.0.bb
@@ -0,0 +1,41 @@
+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 = "gtk+3 p11-kit glib-2.0 libgcrypt"
+
+inherit autotools 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[archive.md5sum] = "b959bac99e17c9bb0990a15c9be11aed"
+SRC_URI[archive.sha256sum] = "d4d16da5af55148a694055835ccd07ad34daf0ad03bdad929bf7cad15637ce00"
+
+FILES_${PN} += " \
+ ${datadir}/dbus-1 \
+ ${datadir}/gcr-3 \
+"
+
+# http://errors.yoctoproject.org/Errors/Details/20229/
+ARM_INSTRUCTION_SET = "arm"
+
+# on x86-64 the introspection binary goes into
+# an infinite loop under qemu during compilation,
+# printing the following:
+#
+# gcrypt-Message: select() error: Bad address
+#
+# gcrypt-Message: select() error: Bad address
+#
+# gcrypt-Message: select() error: Bad address
+#
+# This will be investigated later.
+EXTRA_OECONF_append_x86-64 = " --disable-introspection"
+
+# Gcr-3.broken: poky/build-mips64/tmp/work/mips64-poky-linux/libgpg-error/1.19-r0/libgpg-error-1.19/src/posix-lock.c:119: get_lock_object: Assertion `!"sizeof lock obj"' failed.
+# qemu: uncaught target signal 6 (Aborted) - core dumped
+EXTRA_OECONF_append_mips64 = " --disable-introspection"
+
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/extending-libinstall-dependencies.patch b/import-layers/yocto-poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/extending-libinstall-dependencies.patch
new file mode 100644
index 000000000..edbdced43
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/fatal-loader.patch b/import-layers/yocto-poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/fatal-loader.patch
new file mode 100644
index 000000000..70146c618
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/fatal-loader.patch
@@ -0,0 +1,79 @@
+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>
+
+diff --git a/gdk-pixbuf/queryloaders.c b/gdk-pixbuf/queryloaders.c
+index a9ca015..395674a 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;
+@@ -360,7 +365,8 @@ int main (int argc, char **argv)
+ gint len = strlen (dent);
+ if (len > SOEXT_LEN &&
+ strcmp (dent + len - SOEXT_LEN, SOEXT) == 0) {
+- query_module (contents, path, dent);
++ if (!query_module (contents, path, dent))
++ success = FALSE;
+ }
+ }
+ g_dir_close (dir);
+@@ -378,7 +384,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);
+ }
+@@ -394,5 +401,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;
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/hardcoded_libtool.patch b/import-layers/yocto-poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/hardcoded_libtool.patch
new file mode 100644
index 000000000..ecca62a71
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/run-ptest b/import-layers/yocto-poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/run-ptest
new file mode 100644
index 000000000..8f9072386
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.32.3.bb b/import-layers/yocto-poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.32.3.bb
new file mode 100644
index 000000000..ba94eecbd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.32.3.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"
+
+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 \
+ "
+
+SRC_URI[md5sum] = "9275076639baa24a342f3e02c402920e"
+SRC_URI[sha256sum] = "2b6771f1ac72f687a8971e59810b8dc658e65e7d3086bd2e676e618fd541d031"
+
+inherit autotools pkgconfig gettext pixbufcache ptest-gnome upstream-version-is-even gobject-introspection
+
+LIBV = "2.10.0"
+
+GDK_PIXBUF_LOADERS ?= "png jpeg"
+
+PACKAGECONFIG ??= "${GDK_PIXBUF_LOADERS}"
+PACKAGECONFIG_linuxstdbase = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '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"
+
+# Use GIO to sniff image format instead of trying all loaders
+PACKAGECONFIG[gio-sniff] = "--enable-gio-sniffing,--disable-gio-sniffing,,shared-mime-info"
+PACKAGECONFIG[x11] = "--with-x11,--without-x11,virtual/libx11"
+
+PACKAGES =+ "${PN}-xlib"
+
+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}-dev += " \
+ ${bindir}/gdk-pixbuf-csource \
+ ${bindir}/gdk-pixbuf-pixdata \
+ ${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", True)
+
+ 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_gdk-pixbuf-ptest", " " + 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}/${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"
+
+SSTATEPREINSTFUNCS_append_class-native = " gdkpixbuf_sstate_preinst"
+SYSROOT_PREPROCESS_FUNCS_append_class-native = " gdkpixbuf_sstate_preinst"
+
+gdkpixbuf_sstate_preinst() {
+ if [ "${BB_CURRENTTASK}" = "populate_sysroot" ]; then
+ rm -rf ${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/*
+ fi
+}
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gnome-desktop/gnome-desktop3_3.18.2.bb b/import-layers/yocto-poky/meta/recipes-gnome/gnome-desktop/gnome-desktop3_3.18.2.bb
new file mode 100644
index 000000000..ee460d988
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gnome-desktop/gnome-desktop3_3.18.2.bb
@@ -0,0 +1,24 @@
+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] = "9a5875247abdb99bad93f1c4230d1d6d"
+SRC_URI[archive.sha256sum] = "ddd46d022de137543a71f50c7392b32f9b98d5d3f2b53040b35f5802de2e7b56"
+
+DEPENDS += "gsettings-desktop-schemas gconf libxrandr virtual/libx11 gtk+3 glib-2.0 gnome-doc-utils gnome-common startup-notification xkeyboard-config iso-codes"
+
+inherit distro_features_check
+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/import-layers/yocto-poky/meta/recipes-gnome/gnome/adwaita-icon-theme_3.18.0.bb b/import-layers/yocto-poky/meta/recipes-gnome/gnome/adwaita-icon-theme_3.18.0.bb
new file mode 100644
index 000000000..81c88458d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gnome/adwaita-icon-theme_3.18.0.bb
@@ -0,0 +1,37 @@
+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
+
+DEPENDS += "intltool-native"
+
+MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz \
+ "
+
+SRC_URI[md5sum] = "ec1fa3fde83ad166ae7075a97dc1ec4b"
+SRC_URI[sha256sum] = "5e9ce726001fdd8ee93c394fdc3cdb9e1603bbed5b7c62df453ccf521ec50e58"
+
+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 ${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 = "${prefix}/share/icons/Adwaita/*/*/*.symbolic.png"
+FILES_${PN}-hires = "${prefix}/share/icons/Adwaita/256x256/"
+FILES_${PN} = "${prefix}/share/icons/Adwaita/ \
+ ${prefix}/share/pkgconfig/adwaita-icon-theme.pc"
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gnome/gconf/remove_plus_from_invalid_characters_list.patch b/import-layers/yocto-poky/meta/recipes-gnome/gnome/gconf/remove_plus_from_invalid_characters_list.patch
new file mode 100644
index 000000000..59a7ca780
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-gnome/gnome/gconf/unable-connect-dbus.patch b/import-layers/yocto-poky/meta/recipes-gnome/gnome/gconf/unable-connect-dbus.patch
new file mode 100644
index 000000000..f758a4bcc
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-gnome/gnome/gconf_3.2.6.bb b/import-layers/yocto-poky/meta/recipes-gnome/gnome/gconf_3.2.6.bb
new file mode 100644
index 000000000..9e9f71428
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gnome/gconf_3.2.6.bb
@@ -0,0 +1,54 @@
+SUMMARY = "GNOME configuration system"
+SECTION = "x11/gnome"
+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 \
+"
+
+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 or uclibc
+PACKAGECONFIG_class-native = ""
+PACKAGECONFIG_libc-uclibc = ""
+
+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/import-layers/yocto-poky/meta/recipes-gnome/gnome/gnome-common_3.18.0.bb b/import-layers/yocto-poky/meta/recipes-gnome/gnome/gnome-common_3.18.0.bb
new file mode 100644
index 000000000..06f3bb34c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gnome/gnome-common_3.18.0.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Common macros for building GNOME applications"
+HOMEPAGE = "http://www.gnome.org/"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+SECTION = "x11/gnome"
+inherit gnomebase allarch
+
+SRC_URI[archive.md5sum] = "933258d9c23e218eb6eec9cc1951b053"
+SRC_URI[archive.sha256sum] = "22569e370ae755e04527b76328befc4c73b62bfd4a572499fde116b8318af8cf"
+
+EXTRA_AUTORECONF = ""
+DEPENDS = ""
+
+FILES_${PN} += "${datadir}/aclocal"
+FILES_${PN}-dev = ""
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gnome/gnome-doc-utils.inc b/import-layers/yocto-poky/meta/recipes-gnome/gnome/gnome-doc-utils.inc
new file mode 100644
index 000000000..8adfac7d7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gnome/gnome-doc-utils.inc
@@ -0,0 +1,30 @@
+SUMMARY = "A collection of documentation utilities for the Gnome project"
+DESCRIPTION = "The GNOME Documentation Build Utilities (gnome-doc- \
+utils) were created to make it easier for application developers to \
+include and create documentation in their releases. They include the \
+xml2po tool which makes it easier to translate and keep up to date \
+translations of documentation."
+LICENSE = "GPLv2 & LGPLv2.1"
+DEPENDS = "libxml2 libxslt libxslt-native gnome-doc-utils-native glib-2.0"
+DEPENDS_class-native = "libxml2-native libxslt-native intltool-native glib-2.0-native"
+
+inherit gnomebase gettext python-dir pythonnative autotools-brokensep
+
+CLEANBROKEN = "1"
+
+EXTRA_OECONF += "--disable-scrollkeeper"
+
+do_install_append() {
+ chown -R root:root ${D}
+}
+
+do_install_append_class-native () {
+ sed -i -e 's|^#!.*/usr/bin/env python|#! /usr/bin/env nativepython|' ${D}${bindir}/xml2po
+}
+
+FILES_${PN} += "${datadir}/xml* ${PYTHON_SITEPACKAGES_DIR}/*"
+
+RDEPENDS_${PN} = "bash"
+RDEPENDS_${PN}_class-native = ""
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gnome/gnome-doc-utils/sysrooted-pkg-config.patch b/import-layers/yocto-poky/meta/recipes-gnome/gnome/gnome-doc-utils/sysrooted-pkg-config.patch
new file mode 100644
index 000000000..416d69864
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gnome/gnome-doc-utils/sysrooted-pkg-config.patch
@@ -0,0 +1,35 @@
+In cross environment we have to prepend the sysroot to the path found by
+pkgconfig since the path returned from pkgconfig does not have sysroot prefixed
+it ends up using the files from host system. Now usually people have gnome installed
+so the build succeeds but if you dont have gnome installed on build host then
+it wont find the files on host system and packages using gnome-doc-utils wont
+compile.
+
+This should work ok with non sysrooted builds too since in those cases PKG_CONFIG_SYSROOT_DIR
+will be empty
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Index: gnome-doc-utils-0.20.10/tools/gnome-doc-utils.make
+===================================================================
+--- gnome-doc-utils-0.20.10.orig/tools/gnome-doc-utils.make
++++ gnome-doc-utils-0.20.10/tools/gnome-doc-utils.make
+@@ -133,11 +133,11 @@ _DOC_ABS_SRCDIR = @abs_srcdir@
+ _xml2po ?= `which xml2po`
+ _xml2po_mode = $(if $(DOC_ID),mallard,docbook)
+
+-_db2html ?= `$(PKG_CONFIG) --variable db2html gnome-doc-utils`
+-_db2omf ?= `$(PKG_CONFIG) --variable db2omf gnome-doc-utils`
+-_chunks ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/chunks.xsl
+-_credits ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/credits.xsl
+-_ids ?= $(shell $(PKG_CONFIG) --variable xmldir gnome-doc-utils)/gnome/xslt/docbook/utils/ids.xsl
++_db2html ?= ${PKG_CONFIG_SYSROOT_DIR}`$(PKG_CONFIG) --variable db2html gnome-doc-utils`
++_db2omf ?= ${PKG_CONFIG_SYSROOT_DIR}`$(PKG_CONFIG) --variable db2omf gnome-doc-utils`
++_chunks ?= ${PKG_CONFIG_SYSROOT_DIR}`$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/chunks.xsl
++_credits ?= ${PKG_CONFIG_SYSROOT_DIR}`$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/credits.xsl
++_ids ?= ${PKG_CONFIG_SYSROOT_DIR}$(shell $(PKG_CONFIG) --variable xmldir gnome-doc-utils)/gnome/xslt/docbook/utils/ids.xsl
+
+ if ENABLE_SK
+ _ENABLE_SK = true
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gnome/gnome-doc-utils/use-usr-bin-env-for-python-in-xml2po.patch b/import-layers/yocto-poky/meta/recipes-gnome/gnome/gnome-doc-utils/use-usr-bin-env-for-python-in-xml2po.patch
new file mode 100644
index 000000000..0e196c063
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gnome/gnome-doc-utils/use-usr-bin-env-for-python-in-xml2po.patch
@@ -0,0 +1,30 @@
+We can't use #!/full/path/to/python -u as this can be longer than shebang
+allows for. In order to be appropraite for upstream more work would be
+needed to make sure that the main xml2po code doesn't rely on python
+being invoked with -u (force stdin/out/err to be used raw).
+
+Upstream-Status: Inappropriate [Would break behavior on Windows]
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Index: gnome-doc-utils-0.20.10/xml2po/xml2po/Makefile.am
+===================================================================
+--- gnome-doc-utils-0.20.10.orig/xml2po/xml2po/Makefile.am
++++ gnome-doc-utils-0.20.10/xml2po/xml2po/Makefile.am
+@@ -7,7 +7,6 @@ CLEANFILES = xml2po
+
+ xml2po: xml2po.py.in
+ $(AM_V_GEN)sed -e "s/^VERSION =.*/VERSION = \"@VERSION@\"/" \
+- -e "s+^#!.*python.*+#!$(PYTHON)+" \
+ < $(srcdir)/xml2po.py.in > xml2po
+ $(AM_V_at)chmod +x xml2po
+
+Index: gnome-doc-utils-0.20.10/xml2po/xml2po/xml2po.py.in
+===================================================================
+--- gnome-doc-utils-0.20.10.orig/xml2po/xml2po/xml2po.py.in
++++ gnome-doc-utils-0.20.10/xml2po/xml2po/xml2po.py.in
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python -u
++#!/usr/bin/env python
+ # -*- encoding: utf-8 -*-
+ # Copyright (c) 2004, 2005, 2006 Danilo Ĺ egan <danilo@gnome.org>.
+ # Copyright (c) 2009 Claude Paroz <claude@2xlibre.net>.
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gnome/gnome-doc-utils/xsltproc_nonet.patch b/import-layers/yocto-poky/meta/recipes-gnome/gnome/gnome-doc-utils/xsltproc_nonet.patch
new file mode 100644
index 000000000..9346494e9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gnome/gnome-doc-utils/xsltproc_nonet.patch
@@ -0,0 +1,95 @@
+This adds the -nonet option to xsltproc invocations, which fixes
+compile errors when building the gnome-doc-utils docs.
+
+Upstream-Status: Inappropriate [configuration]
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Index: gnome-doc-utils-0.20.10/doc/xslt/Makefile.am
+===================================================================
+--- gnome-doc-utils-0.20.10.orig/doc/xslt/Makefile.am
++++ gnome-doc-utils-0.20.10/doc/xslt/Makefile.am
+@@ -21,14 +21,14 @@ all: $(xsldoc_docs) $(xsldoc_xmls)
+
+ $(xsldoc_docs): $(xsldoc_xsls) xsldoc.awk xsldoc-fill.xsl
+ $(AM_V_GEN)$(GDU_AWK) -f "$(srcdir)/xsldoc.awk" "$(filter %/$(basename $(notdir $@)).xsl,$(xsldoc_xsls))" \
+- | xsltproc -o "$@" \
++ | xsltproc -nonet -o "$@" \
+ --stringparam basename "$(basename $(notdir $@))" \
+ --stringparam xsl_file "$(filter %/$(basename $(notdir $@)).xsl,$(xsldoc_xsls))" \
+ "$(srcdir)/xsldoc-fill.xsl" -
+
+ $(xsldoc_xmls): xsldoc-docbook.xsl
+ $(xsldoc_xmls): C/%.xml : C/%.xsldoc
+- $(AM_V_GEN)xsltproc -o "$@" \
++ $(AM_V_GEN)xsltproc -nonet -o "$@" \
+ --stringparam basename "$(basename $(notdir $@))" \
+ --stringparam xsl_file "$(filter %/$(basename $(notdir $@)).xsl,$(xsldoc_xsls))" \
+ "$(srcdir)/xsldoc-docbook.xsl" "$<"
+@@ -62,7 +62,7 @@ gnome-doc-xslt-check-includes:
+ gnome-doc-xslt-check-xsldoc: $(xsldoc_docs)
+ @echo "Running xsldoc checks";
+ @(echo "<xsldoc>"; cat $(xsldoc_docs); echo "</xsldoc>") \
+- | xsltproc "$(srcdir)/xsldoc-check.xsl" - 1> /dev/null
++ | xsltproc -nonet "$(srcdir)/xsldoc-check.xsl" - 1> /dev/null
+
+ .PHONY: clean-xsldoc
+ clean-local: clean_xsldoc
+Index: gnome-doc-utils-0.20.10/tools/gnome-doc-utils.make
+===================================================================
+--- gnome-doc-utils-0.20.10.orig/tools/gnome-doc-utils.make
++++ gnome-doc-utils-0.20.10/tools/gnome-doc-utils.make
+@@ -37,7 +37,7 @@ $(DOC_H_FILE): $(DOC_H_DOCS);
+ list='$(DOC_H_DOCS)'; for doc in $$list; do \
+ xmlpath="`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`:$(srcdir)/`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`"; \
+ if ! test -f "$$doc"; then doc="$(srcdir)/$$doc"; fi; \
+- xsltproc --path "$$xmlpath" $(_credits) $$doc; \
++ xsltproc -nonet --path "$$xmlpath" $(_credits) $$doc; \
+ done | sort | uniq \
+ | awk 'BEGIN{s=""}{n=split($$0,w,"<");if(s!=""&&s!=substr(w[1],1,length(w[1])-1)){print s};if(n>1){print $$0;s=""}else{s=$$0}};END{if(s!=""){print s}}' \
+ | sed -e 's/\\/\\\\/' -e 's/"/\\"/' -e 's/\(.*\)/\t"\1",/' >> $@.tmp
+@@ -50,7 +50,7 @@ $(DOC_H_FILE): $(DOC_H_DOCS);
+ docid=`echo "$$doc" | sed -e 's/.*\/\([^/]*\)\.xml/\1/' \
+ | sed -e 's/[^a-zA-Z_]/_/g' | tr 'a-z' 'A-Z'`; \
+ echo $$xmlpath; \
+- ids=`xsltproc --xinclude --path "$$xmlpath" $(_ids) $$doc`; \
++ ids=`xsltproc -nonet --xinclude --path "$$xmlpath" $(_ids) $$doc`; \
+ for id in $$ids; do \
+ echo '#define HELP_'`echo $$docid`'_'`echo $$id \
+ | sed -e 's/[^a-zA-Z_]/_/g' | tr 'a-z' 'A-Z'`' "'$$id'"' >> $@.tmp; \
+@@ -197,7 +197,7 @@ $(_DOC_OMF_DB) : $(DOC_MODULE)-%.omf : %
+ echo "The file '$(_skcontentslist)' does not exist." >&2; \
+ echo "Please check your ScrollKeeper installation." >&2; \
+ exit 1; }
+- $(GDU_V_DB2OMF)xsltproc -o $@ $(call db2omf_args,$@,$<,'docbook') || { rm -f "$@"; exit 1; }
++ $(GDU_V_DB2OMF)xsltproc -nonet -o $@ $(call db2omf_args,$@,$<,'docbook') || { rm -f "$@"; exit 1; }
+
+ ## @ _DOC_OMF_HTML
+ ## The OMF files for HTML output
+@@ -212,7 +212,7 @@ if ENABLE_SK
+ echo "Please check your ScrollKeeper installation." >&2; \
+ exit 1; }
+ endif
+- $(GDU_V_DB2OMF)xsltproc -o $@ $(call db2omf_args,$@,$<,'xhtml') || { rm -f "$@"; exit 1; }
++ $(GDU_V_DB2OMF)xsltproc -nonet -o $@ $(call db2omf_args,$@,$<,'xhtml') || { rm -f "$@"; exit 1; }
+
+ ## @ _DOC_OMF_ALL
+ ## All OMF output files to be built
+@@ -267,7 +267,7 @@ _DOC_C_FIGURES = $(if $(DOC_FIGURES),
+ ## All HTML documentation in the C locale
+ # FIXME: probably have to shell escape to determine the file names
+ _DOC_C_HTML = $(foreach f, \
+- $(shell xsltproc --xinclude \
++ $(shell xsltproc -nonet --xinclude \
+ --stringparam db.chunk.basename "$(DOC_MODULE)" \
+ $(_chunks) "C/$(DOC_MODULE).xml"), \
+ C/$(f).xhtml)
+@@ -393,7 +393,7 @@ _DOC_HTML_ALL = $(if $(filter html HTML,
+ _DOC_HTML_TOPS = $(foreach lc,C $(_DOC_REAL_LINGUAS),$(lc)/$(DOC_MODULE).xhtml)
+
+ $(_DOC_HTML_TOPS): $(_DOC_C_DOCS) $(_DOC_LC_DOCS)
+- $(GDU_V_DB2HTM)xsltproc -o $@ --xinclude --param db.chunk.chunk_top "false()" --stringparam db.chunk.basename "$(DOC_MODULE)" --stringparam db.chunk.extension ".xhtml" $(_db2html) $(patsubst %.xhtml,%.xml,$@)
++ $(GDU_V_DB2HTM)xsltproc -nonet -o $@ --xinclude --param db.chunk.chunk_top "false()" --stringparam db.chunk.basename "$(DOC_MODULE)" --stringparam db.chunk.extension ".xhtml" $(_db2html) $(patsubst %.xhtml,%.xml,$@)
+
+
+ ################################################################################
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gnome/gnome-doc-utils_0.20.10.bb b/import-layers/yocto-poky/meta/recipes-gnome/gnome/gnome-doc-utils_0.20.10.bb
new file mode 100644
index 000000000..78cc005f9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gnome/gnome-doc-utils_0.20.10.bb
@@ -0,0 +1,11 @@
+require gnome-doc-utils.inc
+LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=eb723b61539feef013de476e68b5c50a \
+ file://COPYING.LGPL;md5=a6f89e2100d9b6cdffcea4f398e37343"
+
+SRC_URI += "file://xsltproc_nonet.patch \
+ file://use-usr-bin-env-for-python-in-xml2po.patch \
+ file://sysrooted-pkg-config.patch \
+ "
+
+SRC_URI[archive.md5sum] = "3c64ad7bacd617b04999e4a168afaac5"
+SRC_URI[archive.sha256sum] = "cb0639ffa9550b6ddf3b62f3b1add92fb92ab4690d351f2353cffe668be8c4a6"
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gnome/libart-lgpl/libart_lgpl-2.3.21-crosscompile.patch b/import-layers/yocto-poky/meta/recipes-gnome/gnome/libart-lgpl/libart_lgpl-2.3.21-crosscompile.patch
new file mode 100644
index 000000000..0261f58c9
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-gnome/gnome/libart-lgpl_2.3.21.bb b/import-layers/yocto-poky/meta/recipes-gnome/gnome/libart-lgpl_2.3.21.bb
new file mode 100644
index 000000000..95581b297
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-Prefix-pkg-config-paths-with-PKG_CONFIG_SYSROOT_DIR-.patch b/import-layers/yocto-poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-Prefix-pkg-config-paths-with-PKG_CONFIG_SYSROOT_DIR-.patch
new file mode 100644
index 000000000..5026d8177
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-Prefix-pkg-config-paths-with-PKG_CONFIG_SYSROOT_DIR-.patch
@@ -0,0 +1,97 @@
+From a57604e205e6535acd9989444ad1f5f5038f4fba 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 1/4] 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 9aca664..09b9360 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_HDRS=$(shell "${PKG_CONFIG}" --variable=includedir gio-unix-2.0)/gio-unix-2.0/gio/*.h
++GIO_UNIX_HDRS=$(PKG_CONFIG_SYSROOT_DIR)$(shell "${PKG_CONFIG}" --variable=includedir gio-unix-2.0)/gio-unix-2.0/gio/*.h
+ GIO_UNIX_PACKAGES = gio-unix-2.0
+ else
+ GIO_UNIX_HDRS=
+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/import-layers/yocto-poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-configure.ac-add-host-gi-gi-cross-wrapper-and-gi-ldd.patch b/import-layers/yocto-poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-configure.ac-add-host-gi-gi-cross-wrapper-and-gi-ldd.patch
new file mode 100644
index 000000000..6afefabc7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-configure.ac-add-host-gi-gi-cross-wrapper-and-gi-ldd.patch
@@ -0,0 +1,204 @@
+From c6e4f83c373b577166a7e46130ce8ff025ee8515 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] 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(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 437c673..1eb3545 100644
+--- a/Makefile.am
++++ b/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
+
+diff --git a/common.mk b/common.mk
+index e26c637..9f3a65f 100644
+--- a/common.mk
++++ b/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) \
+diff --git a/configure.ac b/configure.ac
+index b11596b..d78ae52 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -347,6 +347,48 @@ fi
+
+ AC_SUBST(EXTRA_LINK_FLAGS)
+
++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
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index bdd0fa7..75dd3c9 100644
+--- a/tests/Makefile.am
++++ b/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=
+--
+2.6.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-giscanner-add-a-use-ldd-wrapper-option.patch b/import-layers/yocto-poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-giscanner-add-a-use-ldd-wrapper-option.patch
new file mode 100644
index 000000000..f923dcccf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-giscanner-add-a-use-ldd-wrapper-option.patch
@@ -0,0 +1,48 @@
+From 291a92f200981a772b2d03739dffb5926a82c5a5 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 1/2] 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 e37d3e3..b8fff5f 100755
+--- a/giscanner/scannermain.py
++++ b/giscanner/scannermain.py
+@@ -121,6 +121,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 1ad75ee..41117c6 100644
+--- a/giscanner/shlibs.py
++++ b/giscanner/shlibs.py
+@@ -100,7 +100,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.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-giscanner-add-use-binary-wrapper-option.patch b/import-layers/yocto-poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-giscanner-add-use-binary-wrapper-option.patch
new file mode 100644
index 000000000..e1241a949
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-giscanner-add-use-binary-wrapper-option.patch
@@ -0,0 +1,52 @@
+From 2322f36056265f809aaffb74fcf5ac0c83129752 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 2/4] 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 b36284d..e37d3e3 100755
+--- a/giscanner/scannermain.py
++++ b/giscanner/scannermain.py
+@@ -118,6 +118,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")
+@@ -406,6 +409,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.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.46.0.bb b/import-layers/yocto-poky/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.46.0.bb
new file mode 100644
index 000000000..9b16147da
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.46.0.bb
@@ -0,0 +1,163 @@
+HOMEPAGE = "http://gnome.org"
+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.46/${BPN}-${PV}.tar.xz \
+ file://0001-Prefix-pkg-config-paths-with-PKG_CONFIG_SYSROOT_DIR-.patch \
+ file://0001-giscanner-add-use-binary-wrapper-option.patch \
+ file://0001-giscanner-add-a-use-ldd-wrapper-option.patch \
+ file://0001-configure.ac-add-host-gi-gi-cross-wrapper-and-gi-ldd.patch \
+ "
+SRC_URI[md5sum] = "adb40a31c7c80b65b0f4c8fd71b493dc"
+SRC_URI[sha256sum] = "6658bd3c2b8813eb3e2511ee153238d09ace9d309e4574af27443d87423e4233"
+
+inherit autotools pkgconfig gtk-doc pythonnative qemu gobject-introspection-data
+BBCLASSEXTEND = "native"
+
+# necessary to let the call for python-config from configure.ac succeed
+export BUILD_SYS
+export HOST_SYS
+export STAGING_INCDIR
+export STAGING_LIBDIR
+
+# needed for writing out the qemu wrapper script
+export STAGING_DIR_HOST
+export B
+
+DEPENDS_append = " libffi zlib glib-2.0 python"
+
+# 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"
+
+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 nativepython,' ${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 --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 python,' ${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 \
+ --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)} \
+ "
+
+
+do_compile_prepend_class-target() {
+ # 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"
+
+# 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_PREPROCESS_FUNCS_append_class-target += "gi_binaries_sysroot_preprocess"
+
+gi_binaries_sysroot_preprocess() {
+ sysroot_stage_dir ${D}${bindir} ${SYSROOT_DESTDIR}${bindir}
+
+ # Also, tweak the binary names in 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
+}
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas_3.19.3.bb b/import-layers/yocto-poky/meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas_3.19.3.bb
new file mode 100644
index 000000000..25fdabade
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas_3.19.3.bb
@@ -0,0 +1,14 @@
+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
+
+SRC_URI[archive.md5sum] = "fdc92abcffe46821be423193b275cf8b"
+SRC_URI[archive.sha256sum] = "9084989b75ca9b3fc5984c8a0d297a93d3d124f51cadd2bdaaaa75a783c80635"
+
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+.inc b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+.inc
new file mode 100644
index 000000000..5bbfe6b8e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+.inc
@@ -0,0 +1,97 @@
+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 docbook-utils-native \
+ cairo gdk-pixbuf"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'directfb', 'directfb', '', 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"
+
+inherit autotools gtk-doc pkgconfig update-alternatives gtk-immodules-cache gobject-introspection
+
+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"
+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/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+/doc-fixes.patch b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+/doc-fixes.patch
new file mode 100644
index 000000000..74e479fd1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+/hardcoded_libtool.patch b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+/hardcoded_libtool.patch
new file mode 100644
index 000000000..1ae728e70
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+/hardcoded_libtool.patch
@@ -0,0 +1,35 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Updated to apply to gtk+-2.24.15
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+diff -Nurd gtk+-2.24.15/configure.ac gtk+-2.24.15/configure.ac
+--- gtk+-2.24.15/configure.ac 2013-01-12 20:52:54.000000000 +0200
++++ gtk+-2.24.15/configure.ac 2013-02-12 21:33:30.689925967 +0200
+@@ -415,7 +415,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
+@@ -774,7 +774,7 @@
+ 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/'`
+@@ -1574,7 +1574,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_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/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+/strict-prototypes.patch b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+/strict-prototypes.patch
new file mode 100644
index 000000000..96e1f5fea
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+/toggle-font.diff b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+/toggle-font.diff
new file mode 100644
index 000000000..340d12008
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+/xsettings.patch b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+/xsettings.patch
new file mode 100644
index 000000000..d0a970ad4
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3.inc b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3.inc
new file mode 100644
index 000000000..bd29300d5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3.inc
@@ -0,0 +1,113 @@
+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 \
+ docbook-utils-native gdk-pixbuf-native libepoxy"
+
+LICENSE = "LGPLv2 & LGPLv2+ & LGPLv2.1+"
+
+inherit autotools pkgconfig gtk-doc update-alternatives gtk-immodules-cache gsettings distro_features_check upstream-version-is-even gobject-introspection
+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
+}
+
+EXTRA_OECONF += " \
+ --disable-glibtest \
+ --disable-xinerama \
+ --enable-modules \
+ --disable-cups \
+ --disable-colord \
+"
+
+do_compile_prepend() {
+ export GIR_EXTRA_LIBS_PATH="${B}/gdk/.libs"
+}
+
+PACKAGECONFIG ??= "${@bb.utils.contains("DISTRO_FEATURES", "x11", "x11", "", d)} \
+ ${@bb.utils.contains("DISTRO_FEATURES", "opengl x11", "glx", "", d)} \
+ ${@bb.utils.contains("DISTRO_FEATURES", "wayland", "wayland", "", d)}"
+
+PACKAGECONFIG[x11] = "--enable-x11-backend,--disable-x11-backend,at-spi2-atk fontconfig libx11 libxext libxcursor libxi libxdamage libxrandr libxrender libxcomposite libxfixes"
+PACKAGECONFIG[glx] = "--enable-glx,--disable-glx,,libgl"
+PACKAGECONFIG[wayland] = "--enable-wayland-backend,--disable-wayland-backend,wayland 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"
+
+# The demo uses PNG files and mime type sniffing, so ensure that these
+# dependencies are present.
+RDEPENDS_${PN}-demo += "gdk-pixbuf-loader-png shared-mime-info"
+
+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 \
+ ${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 \
+ "
+
+RRECOMMENDS_${PN} = "adwaita-icon-theme-symbolic"
+
+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', True)):
+ d.setVar(d.expand('PKG_${PN}'), '${MLPREFIX}libgtk-3.0')
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/Do-not-try-to-initialize-GL-without-libGL.patch b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/Do-not-try-to-initialize-GL-without-libGL.patch
new file mode 100644
index 000000000..c8c480c5e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/Do-not-try-to-initialize-GL-without-libGL.patch
@@ -0,0 +1,60 @@
+From fc22058a10db913534f11348f86681fe9e1838e5 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] 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 | 7 +++++++
+ gdk/x11/gdkvisual-x11.c | 5 +++++
+ 2 files changed, 12 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 729a62e..58cc1ac 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -328,6 +328,13 @@ AC_ARG_ENABLE(mir-backend,
+ [enable the Mir gdk backend])],
+ [backend_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
+ enable_win32_backend=yes
+diff --git a/gdk/x11/gdkvisual-x11.c b/gdk/x11/gdkvisual-x11.c
+index f3b062d..c8243f4 100644
+--- a/gdk/x11/gdkvisual-x11.c
++++ b/gdk/x11/gdkvisual-x11.c
+@@ -345,7 +345,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.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/Dont-force-csd.patch b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/Dont-force-csd.patch
new file mode 100644
index 000000000..32d8a8479
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/Dont-force-csd.patch
@@ -0,0 +1,118 @@
+window: Check if we can use CSD before enabling them
+
+Upstream-Status: Backport
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+
+From c5e5ee67490e7e7af56052d8f8beb75db002c2f1 Mon Sep 17 00:00:00 2001
+From: Emmanuele Bassi <ebassi@gnome.org>
+Date: Wed, 3 Jun 2015 14:07:29 +0100
+Subject: window: Check if we can use CSD before enabling them
+
+The change in 03213b9509fc1df16c66194ea168aed6c15110e9 changed the rules
+as to when CSD can be enabled, but it also unconditionally enables CSD
+with the implicit assumption that client-side shadows were the real
+issue, and that we could work around that by drawing our own borders.
+This also means that setting a titlebar for a GtkWindow will enable CSD
+unconditionally.
+
+In reality, some window managers (like Matchbox) *only* support
+server-side decorations, and will ignore all hints to the contrary, to
+the point of drawing decorations at random locations on top of the
+window.
+
+Since CSD are enabled unconditionally, the GTK_CSD environment variable
+is also not a suitable escape hatch.
+
+In the grand tradition of asking ourselves if we should do something
+just because we can, we should split the environment checks from the
+checks on what the user requested; by doing that, we can also check
+when enabling client-side decorations, and ideally bail out if needed.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=750343
+
+diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
+index 423c6bd..9fe882f 100644
+--- a/gtk/gtkwindow.c
++++ b/gtk/gtkwindow.c
+@@ -4056,6 +4056,32 @@ gtk_window_supports_client_shadow (GtkWindow *window)
+ return TRUE;
+ }
+
++static gboolean
++gtk_window_can_use_csd (GtkWindow *window)
++{
++ const gchar *csd_env;
++
++#ifdef GDK_WINDOWING_BROADWAY
++ if (GDK_IS_BROADWAY_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window))))
++ return TRUE;
++#endif
++
++#ifdef GDK_WINDOWING_WAYLAND
++ if (GDK_IS_WAYLAND_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window))))
++ return TRUE;
++#endif
++
++#ifdef GDK_WINDOWING_MIR
++ if (GDK_IS_MIR_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window))))
++ return TRUE;
++#endif
++
++ csd_env = g_getenv ("GTK_CSD");
++
++ /* If GTK_CSD is unset we default to CSD support */
++ return csd_env == NULL || (strcmp (csd_env, "1") == 0);
++}
++
+ static void
+ gtk_window_enable_csd (GtkWindow *window)
+ {
+@@ -4063,6 +4089,10 @@ gtk_window_enable_csd (GtkWindow *window)
+ GtkWidget *widget = GTK_WIDGET (window);
+ GdkVisual *visual;
+
++ /* If the environment does not support CSD, then there's no point in enabling them */
++ if (!gtk_window_can_use_csd (window))
++ return;
++
+ /* We need a visual with alpha for client shadows */
+ if (priv->use_client_shadow)
+ {
+@@ -5839,7 +5869,6 @@ static gboolean
+ gtk_window_should_use_csd (GtkWindow *window)
+ {
+ GtkWindowPrivate *priv = window->priv;
+- const gchar *csd_env;
+
+ if (priv->csd_requested)
+ return TRUE;
+@@ -5850,24 +5879,7 @@ gtk_window_should_use_csd (GtkWindow *window)
+ if (priv->type == GTK_WINDOW_POPUP)
+ return FALSE;
+
+-#ifdef GDK_WINDOWING_BROADWAY
+- if (GDK_IS_BROADWAY_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window))))
+- return TRUE;
+-#endif
+-
+-#ifdef GDK_WINDOWING_WAYLAND
+- if (GDK_IS_WAYLAND_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window))))
+- return TRUE;
+-#endif
+-
+-#ifdef GDK_WINDOWING_MIR
+- if (GDK_IS_MIR_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window))))
+- return TRUE;
+-#endif
+-
+- csd_env = g_getenv ("GTK_CSD");
+-
+- return (g_strcmp0 (csd_env, "1") == 0);
++ return gtk_window_can_use_csd (window);
+ }
+
+ static void
+--
+cgit v0.10.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/hardcoded_libtool.patch b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/hardcoded_libtool.patch
new file mode 100644
index 000000000..3b4beeb71
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3/hardcoded_libtool.patch
@@ -0,0 +1,35 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+
+Index: gtk+-3.8.2/configure.ac
+===================================================================
+--- gtk+-3.8.2.orig/configure.ac
++++ gtk+-3.8.2/configure.ac
+@@ -531,7 +531,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
+@@ -793,7 +793,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/'`
+@@ -1528,7 +1528,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/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3_3.18.8.bb b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3_3.18.8.bb
new file mode 100644
index 000000000..b76c0cc1c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+3_3.18.8.bb
@@ -0,0 +1,19 @@
+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://hardcoded_libtool.patch \
+ file://Dont-force-csd.patch \
+ file://Do-not-try-to-initialize-GL-without-libGL.patch \
+ "
+
+SRC_URI[md5sum] = "9671acb41dc13561d19233f1a75cf184"
+SRC_URI[sha256sum] = "1c53ef1bb55364698f7183ecd185b547f92f4a3a7abfafd531400232e2e052f8"
+
+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/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+_2.24.29.bb b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+_2.24.29.bb
new file mode 100644
index 000000000..cf55d2070
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk+_2.24.29.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] = "1b7a3689f65617387b5b54520f4439e8"
+SRC_URI[sha256sum] = "0741c59600d3d810a223866453dc2bbb18ce4723828681ba24aa6519c37631b8"
+
+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', True)):
+ d.setVar(d.expand('PKG_${PN}'), '${MLPREFIX}libgtk-2.0')
+}
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.18.8.bb b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.18.8.bb
new file mode 100644
index 000000000..793f14a54
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.18.8.bb
@@ -0,0 +1,60 @@
+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] = "9671acb41dc13561d19233f1a75cf184"
+SRC_URI[sha256sum] = "1c53ef1bb55364698f7183ecd185b547f92f4a3a7abfafd531400232e2e052f8"
+
+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 upstream-version-is-even
+
+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/import-layers/yocto-poky/meta/recipes-gnome/gtk+/gtk-icon-utils/Remove-Gdk-dependency-from-gtk-encode-symbolic-svg.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-gnome/gtk-doc-stub/files/0001-Revert-Import-introspection-stub-machinery-too.patch b/import-layers/yocto-poky/meta/recipes-gnome/gtk-doc-stub/files/0001-Revert-Import-introspection-stub-machinery-too.patch
new file mode 100644
index 000000000..80b0521d4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gtk-doc-stub/files/0001-Revert-Import-introspection-stub-machinery-too.patch
@@ -0,0 +1,305 @@
+From d636be29bf95396b4e27fcd17ff84cb7091cca91 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 8 Oct 2015 15:37:40 +0300
+Subject: [PATCH] Revert "Import introspection stub machinery too"
+
+This reverts commit 3dfd0a09de696ec8c544762747f8a0f77153622e.
+As we provide the full introspection support, we need to remove
+the stubs from this package that conflict with it.
+
+Upstream-Status: Pending [review on oe-core list]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ Makefile | 4 --
+ Makefile.introspection | 163 -------------------------------------------------
+ introspection.m4 | 96 -----------------------------
+ 3 files changed, 263 deletions(-)
+ delete mode 100644 Makefile.introspection
+ delete mode 100644 introspection.m4
+
+diff --git a/Makefile b/Makefile
+index 7cb6ce5..ad4231a 100644
+--- a/Makefile
++++ b/Makefile
+@@ -23,7 +23,3 @@ install: $(bin_programs)
+
+ mkdir -p $(DESTDIR)$(datarootdir)/aclocal/
+ install -m 0644 $(srcdir)/gtk-doc.m4 $(DESTDIR)$(datarootdir)/aclocal/gtk-doc.m4
+-
+- mkdir -p $(DESTDIR)$(datarootdir)/gobject-introspection-1.0
+- install -m 0644 $(srcdir)/Makefile.introspection $(DESTDIR)$(datarootdir)/gobject-introspection-1.0/Makefile.introspection
+- install -m 0644 $(srcdir)/introspection.m4 $(DESTDIR)$(datarootdir)/aclocal/introspection.m4
+diff --git a/Makefile.introspection b/Makefile.introspection
+deleted file mode 100644
+index 755dd15..0000000
+--- a/Makefile.introspection
++++ /dev/null
+@@ -1,163 +0,0 @@
+-# -*- Mode: make -*-
+-# Copyright 2009-2010 Johan Dahlin
+-#
+-# This file is free software; the author(s) gives unlimited
+-# permission to copy and/or distribute it, with or without
+-# modifications, as long as this notice is preserved.
+-#
+-# * Input variables:
+-#
+-# INTROSPECTION_GIRS - List of GIRS that should be generated
+-# INTROSPECTION_SCANNER - Command to invoke scanner, normally set by
+-# GOBJECT_INTROSPECTION_REQUIRE/CHECK() in introspection.m4
+-# INTROSPECTION_SCANNER_ARGS - Additional args to pass in to the scanner
+-# INTROSPECTION_SCANNER_ENV - Environment variables to set before running
+-# the scanner
+-# INTROSPECTION_COMPILER - Command to invoke compiler, normally set by
+-# GOBJECT_INTROSPECTION_REQUIRE/CHECK() in introspection.m4
+-# INTROSPECTION_COMPILER_ARGS - Additional args to pass in to the compiler
+-#
+-# * Simple tutorial
+-#
+-# Add this to configure.ac:
+-# -Wno-portability to AM_INIT_AUTOMAKE
+-# GOBJECT_INTROSPECTION_CHECK([0.6.7])
+-#
+-# Add this to Makefile.am where your library/program is built:
+-# include $(INTROSPECTION_MAKEFILE)
+-# INTROSPECTION_GIRS = YourLib-1.0.gir
+-# YourLib_1_0_gir_NAMESPACE = YourLib
+-# YourLib_1_0_gir_VERSION = 1.0
+-# YourLib_1_0_gir_LIBS = libyourlib.la
+-# YourLib_1_0_gir_FILES = $(libyourlib_1_0_SOURCES)
+-# girdir = $(datadir)/gir-1.0
+-# dist_gir_DATA = YourLib-1.0.gir
+-# typelibdir = $(libdir)/girepository-1.0
+-# typelib_DATA = YourLib-1.0.typelib
+-# CLEANFILES = $(dist_gir_DATA) $(typelib_DATA)
+-#
+-
+-# Make sure the required variables are set, these should under normal
+-# circumstances come from introspection.m4
+-$(if $(INTROSPECTION_SCANNER),,$(error Need to define INTROSPECTION_SCANNER))
+-$(if $(INTROSPECTION_COMPILER),,$(error Need to define INTROSPECTION_COMPILER))
+-
+-# Private functions
+-
+-## Transform the gir filename to something which can reference through a variable
+-## without automake/make complaining, eg Gtk-2.0.gir -> Gtk_2_0_gir
+-_gir_name = $(subst /,_,$(subst -,_,$(subst .,_,$(1))))
+-
+-# Namespace and Version is either fetched from the gir filename
+-# or the _NAMESPACE/_VERSION variable combo
+-_gir_namespace = $(or $($(_gir_name)_NAMESPACE),$(firstword $(subst -, ,$(notdir $(1)))))
+-_gir_version = $(or $($(_gir_name)_VERSION),$(lastword $(subst -, ,$(1:.gir=))))
+-
+-# _PROGRAM is an optional variable which needs it's own --program argument
+-_gir_program = $(if $($(_gir_name)_PROGRAM),--program=$($(_gir_name)_PROGRAM))
+-
+-# Variables which provides a list of things
+-_gir_libraries = $(foreach lib,$($(_gir_name)_LIBS),--library=$(lib))
+-_gir_packages = $(foreach pkg,$($(_gir_name)_PACKAGES),--pkg=$(pkg))
+-_gir_includes = $(foreach include,$($(_gir_name)_INCLUDES),--include=$(include))
+-_gir_export_packages = $(foreach pkg,$($(_gir_name)_EXPORT_PACKAGES),--pkg-export=$(pkg))
+-
+-# Reuse the LIBTOOL variable from automake if it's set, but
+-# work around MSYS weirdness: When running g-ir-scanner, MSYS changes
+-# a command-line argument --libtool="/bin/sh ../../libtool" into
+-# --libtool=c:/opt/msys/1.0/bin/libtool. So just use sh.exe without path
+-# because we already "know" where the libtool configure produced is.
+-_gir_libtool = $(if $(findstring MINGW32,$(shell uname -s)),--libtool="$(top_builddir)/libtool",$(if $(LIBTOOL),--libtool="$(LIBTOOL)"))
+-
+-# Macros for AM_SILENT_RULES prettiness
+-_gir_verbosity = $(if $(AM_DEFAULT_VERBOSITY),$(AM_DEFAULT_VERBOSITY),1)
+-
+-_gir_silent_scanner_prefix = $(_gir_silent_scanner_prefix_$(V))
+-_gir_silent_scanner_prefix_ = $(_gir_silent_scanner_prefix_$(_gir_verbosity))
+-_gir_silent_scanner_prefix_0 = @echo " GISCAN $(1)";
+-_gir_silent_scanner_opts = $(_gir_silent_scanner_opts_$(V))
+-_gir_silent_scanner_opts_ = $(_gir_silent_scanner_opts_$(_gir_verbosity))
+-_gir_silent_scanner_opts_0 = --quiet
+-
+-_gir_silent_compiler = $(_gir_silent_compiler_$(V))
+-_gir_silent_compiler_ = $(_gir_silent_compiler_$(_gir_verbosity))
+-_gir_silent_compiler_0 = @echo " GICOMP $(1)";
+-
+-#
+-# Creates a GIR by scanning C headers/sources
+-# $(1) - Name of the gir file (output)
+-#
+-# If output is Gtk-2.0.gir then you should name the variables like
+-# Gtk_2_0_gir_NAMESPACE, Gtk_2_0_gir_VERSION etc.
+-# Required variables:
+-# FILES - C sources and headers which should be scanned
+-#
+-# One of these variables are required:
+-# LIBS - Library where the symbol represented in the gir can be found
+-# PROGRAM - Program where the symbol represented in the gir can be found
+-#
+-# Optional variables
+-# NAMESPACE - Namespace of the gir, first letter capital,
+-# rest should be lower case, for instance: 'Gtk', 'Clutter', 'ClutterGtk'.
+-# If not present the namespace will be fetched from the gir filename,
+-# the part before the first dash. For 'Gtk-2.0', namespace will be 'Gtk'.
+-# VERSION - Version of the gir, if not present, will be fetched from gir
+-# filename, the part after the first dash. For 'Gtk-2.0', version will be '2.0'.
+-# LIBTOOL - Command to invoke libtool, usually set by automake
+-# SCANNERFLAGS - Flags to pass in to the scanner, see g-ir-scanner(1) for a list
+-# CFLAGS - Flags to pass in to the parser when scanning headers
+-# LDFLAGS - Linker flags used by the scanner
+-# PACKAGES - list of pkg-config names which cflags are required to parse
+-# the headers of this gir
+-# INCLUDES - Gir files to include without the .gir suffix, for instance
+-# GLib-2.0, Gtk-2.0. This is needed for all libraries which you depend on that
+-# provides introspection information.
+-# EXPORT_PACKAGES - list of pkg-config names that are provided by this gir.
+-# By default the names in the PACKAGES variable will be used.
+-#
+-
+-define introspection-scanner
+-
+-# Basic sanity check, to make sure required variables are set
+-$(if $($(_gir_name)_FILES),,$(error Need to define $(_gir_name)_FILES))
+-$(if $(or $(findstring --header-only,$($(_gir_name)_SCANNERFLAGS)),
+- $($(_gir_name)_LIBS),
+- $($(_gir_name)_PROGRAM)),,
+- $(error Need to define $(_gir_name)_LIBS or $(_gir_name)_PROGRAM))
+-
+-# Only dependencies we know are actually filenames goes into _FILES, make
+-# sure these are built before running the scanner. Libraries and programs
+-# needs to be added manually.
+-$(1): $$($(_gir_name)_FILES)
+- @ $(MKDIR_P) $(dir $(1))
+- $(_gir_silent_scanner_prefix) $(INTROSPECTION_SCANNER_ENV) $(INTROSPECTION_SCANNER) $(_gir_silent_scanner_opts) \
+- $(INTROSPECTION_SCANNER_ARGS) \
+- --namespace=$(_gir_namespace) \
+- --nsversion=$(_gir_version) \
+- $(_gir_libtool) \
+- $(_gir_packages) \
+- $(_gir_includes) \
+- $(_gir_export_packages) \
+- $(_gir_program) \
+- $(_gir_libraries) \
+- $($(_gir_name)_SCANNERFLAGS) \
+- $($(_gir_name)_CFLAGS) \
+- $($(_gir_name)_LDFLAGS) \
+- $$^ \
+- --output $(1)
+-endef
+-
+-$(foreach gir,$(INTROSPECTION_GIRS),$(eval $(call introspection-scanner,$(gir))))
+-
+-#
+-# Compiles a gir into a typelib
+-# $(1): gir filename (input)
+-# $(2): typelib filename (output)
+-#
+-define introspection-compiler
+-$(_gir_silent_compiler) $(INTROSPECTION_COMPILER) $(INTROSPECTION_COMPILER_ARGS) --includedir=. $(1) -o $(2)
+-endef
+-
+-# Simple rule to compile a typelib.
+-%.typelib: %.gir
+- $(call introspection-compiler,$<,$@)
+diff --git a/introspection.m4 b/introspection.m4
+deleted file mode 100644
+index d89c3d9..0000000
+--- a/introspection.m4
++++ /dev/null
+@@ -1,96 +0,0 @@
+-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 Canonicalize enable_introspection
+- enable_introspection=$found_introspection
+- ],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/import-layers/yocto-poky/meta/recipes-gnome/gtk-doc-stub/gtk-doc-stub_git.bb b/import-layers/yocto-poky/meta/recipes-gnome/gtk-doc-stub/gtk-doc-stub_git.bb
new file mode 100644
index 000000000..84e49c13a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gtk-doc-stub/gtk-doc-stub_git.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Stub implementation of gtk-doc"
+DESCRIPTION = "Stub implementation of gtk-doc, as we don't want to build the API documentation"
+SECTION = "x11/base"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+PROVIDES = "gtk-doc"
+
+SRCREV = "1dea266593edb766d6d898c79451ef193eb17cfa"
+PV = "1.1+git${SRCPV}"
+
+SRC_URI = "git://git.gnome.org/${BPN} \
+ file://0001-Revert-Import-introspection-stub-machinery-too.patch \
+ "
+
+S = "${WORKDIR}/git"
+
+do_configure() {
+ ./configure --prefix=${prefix} \
+ --sysconfdir=${sysconfdir} \
+ --bindir=${bindir} \
+ --libdir=${libdir} \
+ --datadir=${datadir} \
+ --datarootdir=${datadir}
+}
+
+do_install() {
+ oe_runmake install DESTDIR="${D}"
+}
+
+FILES_${PN} += "${datadir}"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gtk-engines/gtk-engines-2.20.2/glib-2.32.patch b/import-layers/yocto-poky/meta/recipes-gnome/gtk-engines/gtk-engines-2.20.2/glib-2.32.patch
new file mode 100644
index 000000000..f0b878d37
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gtk-engines/gtk-engines-2.20.2/glib-2.32.patch
@@ -0,0 +1,23 @@
+From 8d49a386f467cbf8e0842d2218126f643e50f834 Mon Sep 17 00:00:00 2001
+From: Dominique Leuenberger <dimstar@opensuse.org>
+Date: Sun, 27 Nov 2011 14:24:57 +0000
+Subject: Fix build with glib 2.31: Only glib.h can be #include'd. Fixes bug #664914
+
+Upstream-Status: Backport
+
+---
+diff --git a/engines/clearlooks/src/animation.c b/engines/clearlooks/src/animation.c
+index 1f7a41f..56a9286 100644
+--- a/engines/clearlooks/src/animation.c
++++ b/engines/clearlooks/src/animation.c
+@@ -28,7 +28,7 @@
+ #include "animation.h"
+
+ #ifdef HAVE_WORKING_ANIMATION
+-#include <glib/gtimer.h>
++#include <glib.h>
+
+ struct _AnimationInfo {
+ GTimer *timer;
+--
+cgit v0.9.0.2
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gtk-engines/gtk-engines-2.20.2/substitute-tests.patch b/import-layers/yocto-poky/meta/recipes-gnome/gtk-engines/gtk-engines-2.20.2/substitute-tests.patch
new file mode 100644
index 000000000..5c557ba68
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gtk-engines/gtk-engines-2.20.2/substitute-tests.patch
@@ -0,0 +1,37 @@
+Upstream-Status: Pending
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+diff -Nurd gtk-engines-2.20.2/configure.ac gtk-engines-2.20.2/configure.ac
+--- gtk-engines-2.20.2/configure.ac 2010-10-01 15:42:37.000000000 +0300
++++ gtk-engines-2.20.2/configure.ac 2013-08-20 02:50:27.930510565 +0300
+@@ -166,6 +166,9 @@
+
+ AC_SUBST(DEVELOPMENT_CFLAGS)
+
++AC_SUBST([exported_symbols_tests], [[$(EXPORTED_SYMBOLS_TESTS)]])
++AC_SUBST([torture_test_tests], [[$(TORTURE_TEST_TESTS)]])
++
+ AM_CONFIG_HEADER([engines/support/config.h])
+
+ AC_CONFIG_FILES([
+diff -Nurd gtk-engines-2.20.2/test/Makefile.am gtk-engines-2.20.2/test/Makefile.am
+--- gtk-engines-2.20.2/test/Makefile.am 2010-09-19 18:18:21.000000000 +0300
++++ gtk-engines-2.20.2/test/Makefile.am 2013-08-20 02:50:36.842510865 +0300
+@@ -66,7 +66,7 @@
+ # Prefix with exported_
+ EXPORTED_SYMBOLS_TESTS = $(patsubst %,exported_%,$(BUILD_ENGINES))
+
+-TESTS += $(EXPORTED_SYMBOLS_TESTS)
++TESTS += @exported_symbols_tests@
+
+
+ #############################################################
+@@ -88,7 +88,7 @@
+ TORTURE_TEST_TESTS = torture_buildin $(patsubst %,torture_%,$(TORTURE_TEST_ENGINES))
+
+ # Add TORTURE_TEST_ENGINES to list of tests
+-TESTS += $(TORTURE_TEST_TESTS)
++TESTS += @torture_test_tests@
+
+ # Possible other tests:
+ # - An extensive theme switch tests that loads/unloads the engine
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/gtk-engines/gtk-engines_2.20.2.bb b/import-layers/yocto-poky/meta/recipes-gnome/gtk-engines/gtk-engines_2.20.2.bb
new file mode 100644
index 000000000..c0ac911a6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/gtk-engines/gtk-engines_2.20.2.bb
@@ -0,0 +1,55 @@
+SUMMARY = "GTK+ theme engines"
+HOMEPAGE = "http://www.gnome.org/"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=2d5025d4aa3495befef8f17206a5b0a1"
+
+SECTION = "x11/base"
+DEPENDS = "intltool-native gtk+ gettext-native"
+
+PR = "r3"
+
+PACKAGES += "${PN}-schemas"
+PACKAGES_DYNAMIC += "^gtk-engine-.* ^gtk-theme-.*"
+
+RDEPENDS_gtk-theme-redmond = "gtk-engine-redmond95"
+RDEPENDS_gtk-theme-metal = "gtk-engine-metal"
+RDEPENDS_gtk-theme-mist = "gtk-engine-mist"
+RDEPENDS_gtk-theme-crux = "gtk-engine-crux-engine"
+RDEPENDS_gtk-theme-lighthouseblue = "gtk-engine-lighthouseblue"
+RDEPENDS_gtk-theme-thinice = "gtk-engine-thinice"
+RDEPENDS_gtk-theme-industrial = "gtk-engine-industrial"
+RDEPENDS_gtk-theme-clearlooks = "gtk-engine-clearlooks"
+
+FILES_${PN} = ""
+FILES_${PN}-dev += "${libdir}/gtk-2.0/*/engines/*.la"
+FILES_${PN}-schemas = "${datadir}/gtk-engines/*.xml"
+
+CFLAGS_prepend = "-DHAVE_ANIMATION "
+
+RDEPENDS_${PN}-dev = ""
+
+inherit gnomebase
+GNOME_COMPRESS_TYPE="bz2"
+
+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+)+)"
+
+python populate_packages_prepend() {
+ engines_root = os.path.join(d.getVar('libdir', True), "gtk-2.0/2.10.0/engines")
+ themes_root = os.path.join(d.getVar('datadir', True), "themes")
+
+ do_split_packages(d, engines_root, '^lib(.*)\.so$', 'gtk-engine-%s', 'GTK %s theme engine', extra_depends='')
+ do_split_packages(d, themes_root, '(.*)', 'gtk-theme-%s', 'GTK theme %s', allow_dirs=True, extra_depends='')
+ # TODO: mark theme packages as arch all
+}
+
+SRC_URI += "file://glib-2.32.patch \
+ file://substitute-tests.patch"
+SRC_URI[archive.md5sum] = "5deb287bc6075dc21812130604c7dc4f"
+SRC_URI[archive.sha256sum] = "15b680abca6c773ecb85253521fa100dd3b8549befeecc7595b10209d62d66b5"
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/hicolor-icon-theme/hicolor-icon-theme_0.15.bb b/import-layers/yocto-poky/meta/recipes-gnome/hicolor-icon-theme/hicolor-icon-theme_0.15.bb
new file mode 100644
index 000000000..a704632ca
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/hicolor-icon-theme/hicolor-icon-theme_0.15.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] = "6aa2b3993a883d85017c7cc0cfc0fb73"
+SRC_URI[sha256sum] = "9cc45ac3318c31212ea2d8cb99e64020732393ee7630fa6c1810af5f987033cc"
+
+inherit allarch autotools
+
+FILES_${PN} += "${datadir}/icons"
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/json-glib/json-glib_1.0.4.bb b/import-layers/yocto-poky/meta/recipes-gnome/json-glib/json-glib_1.0.4.bb
new file mode 100644
index 000000000..3ce38cec5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/json-glib/json-glib_1.0.4.bb
@@ -0,0 +1,18 @@
+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] = "3131b0417ecde3da1ae72acceaa375cf"
+SRC_URI[archive.sha256sum] = "80f3593cb6bd13f1465828e46a9f740e2e9bd3cd2257889442b3e62bd6de05cd"
+
+inherit gnomebase gettext lib_package gobject-introspection
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/libglade/libglade-2.6.4/glade-cruft.patch b/import-layers/yocto-poky/meta/recipes-gnome/libglade/libglade-2.6.4/glade-cruft.patch
new file mode 100644
index 000000000..c5d586465
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/libglade/libglade-2.6.4/glade-cruft.patch
@@ -0,0 +1,102 @@
+Upstream-Status: Pending
+
+diff -ur libglade-2.4.0~/configure.in libglade-2.4.0/configure.in
+--- libglade-2.4.0~/configure.in 2004-05-17 12:38:31.000000000 +0100
++++ libglade-2.4.0/configure.in 2004-07-28 16:53:09.000000000 +0100
+@@ -147,6 +147,18 @@
+ AM_CONDITIONAL(HAVE_PYTHON, $have_python)
+ AC_SUBST(PYTHON)
+
++AC_MSG_CHECKING([for cruft in libgtk])
++AC_TRY_LINK([
++#include <gtk/gtk.h>
++#include <stdio.h>
++], [ gtk_tree_get_type (); return 0; ],
++ [ AC_MSG_RESULT(yes)
++ have_cruft=yes ],
++ [ AC_MSG_RESULT(no)
++ AC_DEFINE(DISABLE_CRUFT,,[leave out support for old, broken widgets])
++ have_cruft=no ])
++AC_SUBST(DISABLE_CRUFT)
++
+ dnl add debugging options ...
+ changequote(,)dnl
+ if test "x$GCC" = xyes; then
+Only in libglade-2.4.0: configure.in.orig
+diff -ur libglade-2.4.0~/glade/glade-gtk.c libglade-2.4.0/glade/glade-gtk.c
+--- libglade-2.4.0~/glade/glade-gtk.c 2004-03-13 13:47:35.000000000 +0000
++++ libglade-2.4.0/glade/glade-gtk.c 2004-07-28 16:53:52.000000000 +0100
+@@ -213,6 +213,8 @@
+ gtk_clist_column_titles_hide (GTK_CLIST (w));
+ }
+
++#ifndef DISABLE_CRUFT
++
+ static void
+ tree_set_selection_mode (GladeXML *xml, GtkWidget *w,
+ const char *name, const char *value)
+@@ -238,6 +240,8 @@
+ gtk_tree_set_view_lines (GTK_TREE (w), BOOL (value));
+ }
+
++#endif
++
+ static void
+ list_set_selection_mode (GladeXML *xml, GtkWidget *w,
+ const char *name, const char *value)
+@@ -254,6 +258,7 @@
+ gtk_check_menu_item_set_show_toggle (GTK_CHECK_MENU_ITEM (w), BOOL (value));
+ }
+
++#ifndef DISABLE_CRUFT
+ static void
+ text_set_text (GladeXML *xml, GtkWidget *w,
+ const char *name, const char *value)
+@@ -262,6 +267,7 @@
+
+ gtk_editable_insert_text (GTK_EDITABLE (w), value, -1, &pos);
+ }
++#endif
+
+ static void
+ radio_menu_item_set_group (GladeXML *xml, GtkWidget *w,
+@@ -1125,13 +1131,17 @@
+ glade_register_custom_prop (GTK_TYPE_CLIST, "selection_mode", clist_set_selection_mode);
+ glade_register_custom_prop (GTK_TYPE_CLIST, "shadow_type", clist_set_shadow_type);
+ glade_register_custom_prop (GTK_TYPE_CLIST, "show_titles", clist_set_show_titles);
++#ifndef DISABLE_CRUFT
+ glade_register_custom_prop (GTK_TYPE_TREE, "selection_mode", tree_set_selection_mode);
+ glade_register_custom_prop (GTK_TYPE_TREE, "view_mode", tree_set_view_mode);
+ glade_register_custom_prop (GTK_TYPE_TREE, "view_line", tree_set_view_line);
++#endif
+ glade_register_custom_prop (GTK_TYPE_LIST, "selection_mode", list_set_selection_mode);
+ glade_register_custom_prop (GTK_TYPE_CHECK_MENU_ITEM, "always_show_toggle",
+ check_menu_item_set_always_show_toggle);
++#ifndef DISABLE_CRUFT
+ glade_register_custom_prop (GTK_TYPE_TEXT, "text", text_set_text);
++#endif
+ glade_register_custom_prop (GTK_TYPE_RADIO_MENU_ITEM, "group",
+ radio_menu_item_set_group);
+ glade_register_custom_prop (GTK_TYPE_TOOLBAR, "tooltips", toolbar_set_tooltips);
+@@ -1288,8 +1298,10 @@
+ glade_standard_build_children, NULL);
+ glade_register_widget (GTK_TYPE_TEAROFF_MENU_ITEM, glade_standard_build_widget,
+ NULL, NULL);
++#ifndef DISABLE_CRUFT
+ glade_register_widget (GTK_TYPE_TEXT, glade_standard_build_widget,
+ NULL, NULL);
++#endif
+ glade_register_widget (GTK_TYPE_TEXT_VIEW, glade_standard_build_widget,
+ NULL, NULL);
+ glade_register_widget (GTK_TYPE_TIPS_QUERY, glade_standard_build_widget,
+@@ -1304,8 +1316,10 @@
+ glade_standard_build_children, NULL);
+ glade_register_widget (GTK_TYPE_TOOL_BUTTON, glade_standard_build_widget,
+ NULL, NULL);
++#ifndef DISABLE_CRUFT
+ glade_register_widget (GTK_TYPE_TREE, glade_standard_build_widget,
+ NULL, NULL);
++#endif
+ glade_register_widget (GTK_TYPE_TREE_VIEW, glade_standard_build_widget,
+ NULL, NULL);
+ glade_register_widget (GTK_TYPE_VBUTTON_BOX, glade_standard_build_widget,
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/libglade/libglade-2.6.4/no-xml2.patch b/import-layers/yocto-poky/meta/recipes-gnome/libglade/libglade-2.6.4/no-xml2.patch
new file mode 100644
index 000000000..dc4c092fd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/libglade/libglade-2.6.4/no-xml2.patch
@@ -0,0 +1,501 @@
+Upstream-Status: Inappropriate [configuration]
+
+diff -urN libglade-2.4.2.orig/configure.in libglade-2.4.2/configure.in
+--- libglade-2.4.2.orig/configure.in 2005-02-11 12:42:58.000000000 +0100
++++ libglade-2.4.2/configure.in 2005-03-22 01:22:00.000000000 +0100
+@@ -52,11 +52,33 @@
+ AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+
+ PKG_CHECK_MODULES(LIBGLADE, [dnl
+- libxml-2.0 >= required_libxml_version dnl
+ atk >= required_atk_version dnl
+ gtk+-2.0 >= required_gtk_version dnl
+ glib-2.0 >= required_glib_version])
+
++disable_xml2=no
++AC_ARG_WITH([libxml2],
++ AC_HELP_STRING([--without-libxml2], [Don't use libxml2, use Glib's GMarkupParser instead]),
++ [disable_xml2=yes],
++ [disable_xml2=no])
++
++AC_MSG_CHECKING([if we are using libxml2])
++if test "x$disable_xml2" == "xno"; then
++ AC_MSG_RESULT(yes)
++ PKG_CHECK_MODULES(XML2, libxml-2.0 >= 2.4.10)
++ PKGCFG_REQUIRE_LIBXML2="libxml-2.0"
++ LIBGLADE_CFLAGS="$LIBGLADE_CFLAGS $XML2_CFLAGS"
++ LIBGLADE_LIBS="$LIBGLADE_LIBS $XML2_LIBS"
++else
++ LIBGLADE_CFLAGS="$LIBGLADE_CFLAGS -DUSE_GMARKUP_PARSER"
++ PKGCFG_REQUIRE_LIBXML2=""
++ AC_MSG_RESULT(no)
++fi
++
++AC_SUBST(XML2_LIBS)
++AC_SUBST(XML2_CFLAGS)
++AC_SUBST(PKGCFG_REQUIRE_LIBXML2)
++
+ AC_MSG_CHECKING([for native Win32])
+ case "$host" in
+ *-*-mingw*)
+@@ -116,6 +138,21 @@
+ fi
+ fi
+
++if test "x$disable_xml2" == "xyes"; then
++ echo "*****************************************************"
++ echo " You chose to disable libxml2 and use Glib's"
++ echo " GMarkupParser instead."
++ echo
++ echo " Please bear in mind that using libglade with"
++ echo " GMarkupParser is an experimental feature only."
++ echo
++ echo " Please post problems or success stories to"
++ echo " the glade-devel mailing list. Thank you."
++ echo "*****************************************************"
++fi
++
++
++
+ GTK_DOC_CHECK(1.0)
+
+ dnl gettext stuff ... there is no message catalog for libglade -- libglade
+diff -urN libglade-2.4.2.orig/glade/glade-parser.c libglade-2.4.2/glade/glade-parser.c
+--- libglade-2.4.2.orig/glade/glade-parser.c 2004-11-11 11:56:13.000000000 +0100
++++ libglade-2.4.2/glade/glade-parser.c 2005-03-22 01:20:00.000000000 +0100
+@@ -34,7 +34,15 @@
+ # define dgettext(Domain, String) (String)
+ #endif
+
+-#include <libxml/parser.h>
++#ifdef USE_GMARKUP_PARSER
++# include <zlib.h>
++#else
++# include <libxml/parser.h>
++#endif
++
++#ifdef USE_GMARKUP_PARSER
++# define xmlChar gchar
++#endif
+
+ #include "glade-parser.h"
+ #include "glade-private.h"
+@@ -508,7 +516,9 @@
+ case PARSER_START:
+ if (!strcmp(name, "glade-interface")) {
+ state->state = PARSER_GLADE_INTERFACE;
+-#if 0
++
++#ifndef USE_GMARKUP_PARSER
++ #if 0
+ /* check for correct XML namespace */
+ for (i = 0; attrs && attrs[i] != NULL; i += 2) {
+ if (!strcmp(attrs[i], "xmlns") &&
+@@ -518,7 +528,9 @@
+ g_warning("unknown attribute `%s' for <glade-interface>",
+ attrs[i]);
+ }
++ #endif
+ #endif
++
+ } else {
+ g_warning("Expected <glade-interface>. Got <%s>.", name);
+ state->prev_state = state->state;
+@@ -1063,12 +1075,18 @@
+ }
+ }
+
++#ifndef USE_GMARKUP_PARSER
++
+ static xmlEntityPtr
+ glade_parser_get_entity(GladeParseState *state, const xmlChar *name)
+ {
+ return xmlGetPredefinedEntity(name);
+ }
+
++#endif /* !defined(USE_GMARKUP_PARSER) */
++
++#ifndef USE_GMARKUP_PARSER
++
+ static void
+ glade_parser_warning(GladeParseState *state, const char *msg, ...)
+ {
+@@ -1079,6 +1097,10 @@
+ va_end(args);
+ }
+
++#endif /* !defined(USE_GMARKUP_PARSER) */
++
++#ifndef USE_GMARKUP_PARSER
++
+ static void
+ glade_parser_error(GladeParseState *state, const char *msg, ...)
+ {
+@@ -1089,6 +1111,10 @@
+ va_end(args);
+ }
+
++#endif /* !defined(USE_GMARKUP_PARSER) */
++
++#ifndef USE_GMARKUP_PARSER
++
+ static void
+ glade_parser_fatal_error(GladeParseState *state, const char *msg, ...)
+ {
+@@ -1099,6 +1125,10 @@
+ va_end(args);
+ }
+
++#endif /* !defined(USE_GMARKUP_PARSER) */
++
++#ifndef USE_GMARKUP_PARSER
++
+ static xmlSAXHandler glade_parser = {
+ (internalSubsetSAXFunc)NULL, /* internalSubset */
+ (isStandaloneSAXFunc)NULL, /* isStandalone */
+@@ -1126,6 +1156,82 @@
+ (fatalErrorSAXFunc)glade_parser_fatal_error, /* fatalError */
+ };
+
++#else /* USE_GMARKUP_PARSER */
++
++static void
++glade_parser_start_element_wrapper(GMarkupParseContext *context,
++ const gchar *name,
++ const gchar **attr_names,
++ const gchar **attr_values,
++ gpointer state,
++ GError **error)
++{
++ guint i = 0;
++
++ /* Pack attribute names/values from two separate
++ * arrays (GMarkupParser style) into one single
++ * array (libxml SAXParser style). This is not
++ * very efficient, but we do it to make the
++ * GMarkupParser code as little invasive as
++ * possible. */
++
++ while (attr_names[i] != NULL) {
++ ++i;
++ }
++
++ if (1)
++ {
++ const gchar *attr[(i*2)+1];
++ guint j, k;
++
++ for (j=0, k=0; k < i; j += 2)
++ {
++ attr[j] = attr_names[k];
++ attr[j+1] = attr_values[k];
++ ++k;
++ }
++ attr[i*2] = NULL;
++
++ glade_parser_start_element((GladeParseState*)state, name, attr);
++ }
++}
++
++static void
++glade_parser_end_element_wrapper(GMarkupParseContext *context,
++ const gchar *name,
++ gpointer state,
++ GError **err)
++{
++ glade_parser_end_element((GladeParseState*)state, name);
++}
++
++static void
++glade_parser_characters_wrapper(GMarkupParseContext *context,
++ const gchar *chars,
++ gsize len,
++ gpointer state,
++ GError **err)
++{
++ glade_parser_characters((GladeParseState*)state, chars, (int) len);
++}
++
++static void
++glade_parser_error(GMarkupParseContext *context, GError *err, gpointer data)
++{
++ g_log("Glade-Parser", G_LOG_LEVEL_CRITICAL, "%s", err->message);
++}
++
++static const GMarkupParser glade_parser = {
++ glade_parser_start_element_wrapper, /* element open */
++ glade_parser_end_element_wrapper, /* element close */
++ glade_parser_characters_wrapper, /* text content */
++ NULL, /* passthrough */
++ glade_parser_error, /* parse error */
++};
++
++#endif /* USE_GMARKUP_PARSER */
++
++
+ static void
+ widget_info_free(GladeWidgetInfo *info)
+ {
+@@ -1191,6 +1297,9 @@
+ *
+ * Returns: the GladeInterface structure for the XML file.
+ */
++
++#ifndef USE_GMARKUP_PARSER
++
+ GladeInterface *
+ glade_parser_parse_file(const gchar *file, const gchar *domain)
+ {
+@@ -1222,6 +1331,31 @@
+ return state.interface;
+ }
+
++#else /* defined(USE_GMARKUP_PARSER) */
++
++GladeInterface *
++glade_parser_parse_file(const gchar *file, const gchar *domain)
++{
++ GladeInterface *interface;
++ GError *err = NULL;
++ gchar *content = NULL;
++ gsize clen;
++
++ if (!g_file_get_contents(file, &content, &clen, &err)) {
++ g_warning("could not load glade file: %s", err->message);
++ g_error_free(err);
++ return NULL;
++ }
++
++ interface = glade_parser_parse_buffer(content, (gint) clen, domain);
++
++ g_free(content);
++
++ return interface;
++}
++
++#endif /* USE_GMARKUP_PARSER */
++
+ /**
+ * glade_parser_parse_buffer
+ * @buffer: a buffer in memory containing XML data.
+@@ -1237,6 +1371,9 @@
+ *
+ * Returns: the GladeInterface structure for the XML buffer.
+ */
++
++#ifndef USE_GMARKUP_PARSER
++
+ GladeInterface *
+ glade_parser_parse_buffer(const gchar *buffer, gint len, const gchar *domain)
+ {
+@@ -1263,6 +1400,161 @@
+ return state.interface;
+ }
+
++#else /* defined(USE_GMARKUP_PARSER) */
++
++
++static GladeInterface *
++glade_parser_parse_buffer_internal(const gchar *buffer, gint len, const gchar *domain)
++{
++ GMarkupParseContext *context;
++ GladeParseState state = { 0 };
++ GError *err = NULL;
++
++ state.interface = NULL;
++ if (domain)
++ state.domain = domain;
++ else
++ state.domain = textdomain(NULL);
++
++ /* FIXME: This strstr() is not safe, as it ignores the len
++ * argument and assumes the buffer is NUL-terminated */
++ if (strstr(buffer, "<?xml") == NULL) {
++ g_warning("No XML header found in document!");
++ return NULL;
++ }
++
++ context = g_markup_parse_context_new(&glade_parser, (GMarkupParseFlags) 0, &state, NULL);
++
++ glade_parser_start_document(&state);
++
++ if (!g_markup_parse_context_parse(context, buffer, (gssize) len, &err)) {
++ g_warning("document not well formed: %s", err->message);
++ g_error_free(err);
++ if (state.interface)
++ glade_interface_destroy (state.interface);
++ return NULL;
++ }
++
++ glade_parser_end_document(&state);
++
++ if (state.state != PARSER_FINISH) {
++ g_warning("did not finish in PARSER_FINISH state!");
++
++ if (state.interface)
++ glade_interface_destroy(state.interface);
++
++ return NULL;
++ }
++
++ return state.interface;
++}
++
++struct _gzip_rfc1952_hdr
++{
++ guint8 id1, id2, cm, flags;
++ guint32 mtime;
++ guint8 xflags;
++ guint8 os;
++};
++
++static GladeInterface *
++glade_parser_parse_gzipped_buffer(const gchar *buffer, gint len, const gchar *domain)
++{
++ struct _gzip_rfc1952_hdr *hdr = (struct _gzip_rfc1952_hdr*)buffer;
++ struct z_stream_s zstream;
++ GladeInterface *interface;
++ const guint8 *cbuf; /* start of compressed data */
++ guint8 *decompress_buf;
++ gulong decompress_len = 0;
++ gint ret;
++
++ g_assert(hdr != NULL && hdr->id1 == 0x1f && hdr->id2 == 0x8b);
++
++ if (hdr->cm != Z_DEFLATED) {
++ g_warning("Unknown decompression method %u", (guint) hdr->cm);
++ return NULL;
++ }
++
++ /* Uncompressed size (modulo 2^32) is last
++ * 4 bytes of gzipped file, and little endian.
++ * See RFC 1952 */
++ decompress_len = GUINT32_FROM_LE(*((guint32*)(((guint8*)buffer) + len - 4)));
++
++ /* paranoid mode: glade files > 5MB are unlikely */
++ g_return_val_if_fail(decompress_len < 5*1024*1024, NULL);
++
++ decompress_buf = g_malloc0(decompress_len + 1); /* +1 for NUL-terminator */
++
++ /* find start of compressed data, skipping header stuff */
++ cbuf = (guint8*)buffer + 10;
++ if (hdr->flags & 0x04) {
++ guint16 xlen = GUINT16_FROM_LE(*((guint16*)cbuf));
++ cbuf += xlen + 2;
++ }
++ if (hdr->flags & 0x08) {
++ guint16 onamelen = strlen(cbuf);
++ cbuf += onamelen + 1;
++ }
++ if (hdr->flags & 0x10) {
++ guint16 commentlen = strlen(cbuf);
++ cbuf += commentlen + 1;
++ }
++ if (hdr->flags & 0x02)
++ {
++ cbuf += 2; /* skip header CRC16 */
++ }
++
++ zstream.next_in = (void*)cbuf;
++ zstream.avail_in = (uLongf) len - ((void*)cbuf-(void*)buffer) - 4 - 4 +1;
++ zstream.next_out = decompress_buf;
++ zstream.avail_out= decompress_len;
++ zstream.zalloc = Z_NULL;
++ zstream.zfree = Z_NULL;
++ zstream.opaque = Z_NULL;
++
++ ret = inflateInit2(&zstream, -MAX_WBITS);
++
++ if (ret != Z_OK) {
++ g_warning("inflateInit2() failed. zlib error code: %d", ret);
++ g_free(decompress_buf);
++ return NULL;
++ }
++
++ ret = inflate(&zstream, Z_FINISH);
++
++ if (ret != Z_STREAM_END) {
++ g_warning("zlib decompression failed. zlib error code: %d", ret);
++ g_free(decompress_buf);
++ return NULL;
++ }
++
++ interface = glade_parser_parse_buffer_internal(decompress_buf, decompress_len, domain);
++
++ g_free(decompress_buf);
++
++ return interface;
++}
++
++GladeInterface *
++glade_parser_parse_buffer(const gchar *buffer, gint len, const gchar *domain)
++{
++ g_return_val_if_fail(buffer != NULL, NULL);
++ g_return_val_if_fail(len > 0, NULL);
++
++ /* Check if buffer is gzipped */
++ if (buffer[0] == 0x1f && buffer[1] == (gchar)0x8b) {
++ return glade_parser_parse_gzipped_buffer(buffer, len, domain);
++ }
++
++ /* Buffer is cleartext. */
++ return glade_parser_parse_buffer_internal(buffer, len, domain);
++}
++
++#endif /* USE_GMARKUP_PARSER */
++
++
++#ifndef USE_GMARKUP_PARSER
++
+ static void
+ dump_widget(xmlNode *parent, GladeWidgetInfo *info, gint indent)
+ {
+@@ -1382,6 +1674,8 @@
+ xmlNodeAddContent(widget, " ");
+ }
+
++#endif /* !defined(USE_GMARKUP_PARSER) */
++
+ /**
+ * glade_interface_dump
+ * @interface: the GladeInterface
+@@ -1390,6 +1684,9 @@
+ * This function dumps the contents of a GladeInterface into a file as
+ * XML. It is intended mainly as a debugging tool.
+ */
++
++#ifndef USE_GMARKUP_PARSER
++
+ void
+ glade_interface_dump(GladeInterface *interface, const gchar *filename)
+ {
+@@ -1428,6 +1725,17 @@
+ xmlFreeDoc(doc);
+ }
+
++#else /* defined(USE_GMARKUP_PARSER) */
++
++void
++glade_interface_dump(GladeInterface *interface, const gchar *filename)
++{
++ g_warning("glade_interface_dump() is only available with libxml2.");
++}
++
++#endif /* USE_GMARKUP_PARSER */
++
++
+ #if 0
+ int
+ main(int argc, char **argv) {
+diff -urN libglade-2.4.2.orig/libglade-2.0.pc.in libglade-2.4.2/libglade-2.0.pc.in
+--- libglade-2.4.2.orig/libglade-2.0.pc.in 2001-12-12 15:28:23.000000000 +0100
++++ libglade-2.4.2/libglade-2.0.pc.in 2005-03-22 01:20:00.000000000 +0100
+@@ -11,7 +11,7 @@
+ Name: Libglade
+ Description: a library for dynamically loading GLADE interface files
+ Version: @VERSION@
+-Requires: gtk+-2.0 libxml-2.0
++Requires: gtk+-2.0 @PKGCFG_REQUIRE_LIBXML2@
+ Libs: -L${libdir} -lglade-2.0
+ Cflags: -I${includedir}/libglade-2.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/libglade/libglade-2.6.4/python_environment.patch b/import-layers/yocto-poky/meta/recipes-gnome/libglade/libglade-2.6.4/python_environment.patch
new file mode 100644
index 000000000..b5b2ec453
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/libglade/libglade-2.6.4/python_environment.patch
@@ -0,0 +1,14 @@
+Using @PYTHON@ for this path would result in the build system python being
+referred to. Instead we want to locate python from the environment.
+
+Upstream-Status: Inappropriate [configuration]
+
+diff -ruN libglade-2.6.4-orig//libglade-convert.in libglade-2.6.4/libglade-convert.in
+--- libglade-2.6.4-orig//libglade-convert.in 2011-09-22 10:18:28.991164003 +0800
++++ libglade-2.6.4/libglade-convert.in 2011-09-22 10:18:55.431164003 +0800
+@@ -1,4 +1,4 @@
+-#!@PYTHON@
++#!/usr/bin/env python
+ # -*- mode: python -*-
+
+ # yes, this requires python 2.x and an XML parser module (eg. PyExpat)
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/libglade/libglade_2.6.4.bb b/import-layers/yocto-poky/meta/recipes-gnome/libglade/libglade_2.6.4.bb
new file mode 100644
index 000000000..553e19c60
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/libglade/libglade_2.6.4.bb
@@ -0,0 +1,31 @@
+SUMMARY = "Runtime support for the GTK+ interface builder"
+HOMEPAGE = "http://library.gnome.org/devel/libglade/"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+
+LICENSE = "LGPLv2 & LGPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=55ca817ccb7d5b5b66355690e9abc605 \
+ file://glade/glade.h;endline=22;md5=a04f461c964ba4b57a172d1fbcd8f8fc \
+ file://glade/glade-gtk.c;endline=22;md5=766f993433e2642fec87936d319990ff"
+
+SECTION = "libs"
+PR = "r5"
+DEPENDS = "zlib gdk-pixbuf gtk+"
+
+inherit autotools pkgconfig gnomebase gtk-doc distro_features_check
+ANY_OF_DISTRO_FEATURES = "${GTK2DISTROFEATURES}"
+GNOME_COMPRESS_TYPE="bz2"
+
+SRC_URI += "file://glade-cruft.patch file://no-xml2.patch file://python_environment.patch"
+
+SRC_URI[archive.md5sum] = "d1776b40f4e166b5e9c107f1c8fe4139"
+SRC_URI[archive.sha256sum] = "64361e7647839d36ed8336d992fd210d3e8139882269bed47dc4674980165dec"
+
+EXTRA_OECONF += "--without-libxml2"
+
+CFLAGS += "-lz"
+
+PACKAGES += " ${PN}-data"
+FILES_${PN} = "${libdir}/lib*.so.*"
+FILES_${PN}-data = "${datadir}/xml/libglade/glade-2.0.dtd"
+FILES_${PN}-dev += "${bindir}/libglade-convert"
+#RDEPENDS_${PN} = "${PN}-data"
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/libgudev/libgudev_230.bb b/import-layers/yocto-poky/meta/recipes-gnome/libgudev/libgudev_230.bb
new file mode 100644
index 000000000..6a105023b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/libgudev/libgudev_230.bb
@@ -0,0 +1,14 @@
+SUMMARY = "GObject wrapper for libudev"
+
+SRC_URI[archive.md5sum] = "e4dee8f3f349e9372213d33887819a4d"
+SRC_URI[archive.sha256sum] = "a2e77faced0c66d7498403adefcc0707105e03db71a2b2abd620025b86347c18"
+
+DEPENDS = "glib-2.0 udev"
+
+RCONFLICTS_${PN} = "systemd (<= 220)"
+
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
+
+inherit gnomebase gobject-introspection
+
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/libnotify/libnotify_0.7.6.bb b/import-layers/yocto-poky/meta/recipes-gnome/libnotify/libnotify_0.7.6.bb
new file mode 100644
index 000000000..ce8e5ae21
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/libnotify/libnotify_0.7.6.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Library for sending desktop notifications to a notification daemon"
+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] = "a4997019d08f46f3bf57b78e6f795a59"
+SRC_URI[archive.sha256sum] = "0ef61ca400d30e28217979bfa0e73a7406b19c32dd76150654ec5b2bdf47d837"
+
+# 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/import-layers/yocto-poky/meta/recipes-gnome/librsvg/librsvg/gtk-option.patch b/import-layers/yocto-poky/meta/recipes-gnome/librsvg/librsvg/gtk-option.patch
new file mode 100644
index 000000000..6c23071cd
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-gnome/librsvg/librsvg_2.40.13.bb b/import-layers/yocto-poky/meta/recipes-gnome/librsvg/librsvg_2.40.13.bb
new file mode 100644
index 000000000..2ac52f779
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/librsvg/librsvg_2.40.13.bb
@@ -0,0 +1,45 @@
+SUMMARY = "Library for rendering SVG files"
+HOMEPAGE = "http://ftp.gnome.org/pub/GNOME/sources/librsvg/"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+
+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 autotools pkgconfig gnomebase gtk-doc pixbufcache upstream-version-is-even gobject-introspection
+
+SRC_URI += "file://gtk-option.patch"
+
+SRC_URI[archive.md5sum] = "ad03780e12c56e52474d8edf86976c73"
+SRC_URI[archive.sha256sum] = "4d6ea93ec05f5dabe7262d711d246a0a99b2311e215360dd3dcabd6afe3b9804"
+
+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"
+
+PIXBUF_PACKAGES = "librsvg-gtk"
+
+PIXBUFCACHE_SYSROOT_DEPS_append_class-native = " harfbuzz-native:do_populate_sysroot_setscene pango-native:do_populate_sysroot_setscene icu-native:do_populate_sysroot_setscene"
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/libsecret/libsecret_0.18.4.bb b/import-layers/yocto-poky/meta/recipes-gnome/libsecret/libsecret_0.18.4.bb
new file mode 100644
index 000000000..beaaba03e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/libsecret/libsecret_0.18.4.bb
@@ -0,0 +1,25 @@
+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
+
+DEPENDS += "glib-2.0 libgcrypt gettext-native intltool-native"
+
+EXTRA_OECONF += "--disable-manpages"
+
+SRC_URI[archive.md5sum] = "5190da1ee686437046bc10068f120d1d"
+SRC_URI[archive.sha256sum] = "0f29b51698198e6999c91f4adce3119c8c457f546b133a85baea5ea9010a19ed"
+
+# 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
+}
+
+# Secret-1: poky/build-mips64/tmp/work/mips64-poky-linux/libgpg-error/1.19-r0/libgpg-error-1.19/src/posix-lock.c:119: get_lock_object: Assertion `!"sizeof lock obj"' failed.
+# qemu: uncaught target signal 6 (Aborted) - core dumped
+EXTRA_OECONF_append_mips64 = " --disable-introspection"
+
diff --git a/import-layers/yocto-poky/meta/recipes-gnome/libwnck/libwnck3_3.14.1.bb b/import-layers/yocto-poky/meta/recipes-gnome/libwnck/libwnck3_3.14.1.bb
new file mode 100644
index 000000000..495894b89
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-gnome/libwnck/libwnck3_3.14.1.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Window navigation construction toolkit"
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"
+
+BPN = "libwnck"
+
+SECTION = "x11/libs"
+DEPENDS = "gtk+3 gdk-pixbuf-native libxres"
+
+PACKAGECONFIG ??= "startup-notification"
+PACKAGECONFIG[startup-notification] = "--enable-startup-notification,--disable-startup-notification,startup-notification"
+
+inherit gnomebase gobject-introspection
+SRC_URI[archive.md5sum] = "d96c0b74c4dc5fdae758964098603c90"
+SRC_URI[archive.sha256sum] = "bb643c9c423c8aa79c59973ce27ce91d3b180d1e9907902278fb79391f52befa"
+
+inherit distro_features_check
+# libxres means x11 only
+REQUIRED_DISTRO_FEATURES = "x11"
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/builder/builder_0.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/builder/builder_0.1.bb
new file mode 100644
index 000000000..0a64c31ab
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/builder/files/builder_session.sh b/import-layers/yocto-poky/meta/recipes-graphics/builder/files/builder_session.sh
new file mode 100644
index 000000000..001a03357
--- /dev/null
+++ b/import-layers/yocto-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 leafpad text editor
+ xdg-mime default leafpad.desktop text/plain
+fi
+
+cd /home/builder/poky
+. ./oe-init-build-env
+
+matchbox-terminal&
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/cairo/cairo-fpu.inc b/import-layers/yocto-poky/meta/recipes-graphics/cairo/cairo-fpu.inc
new file mode 100644
index 000000000..ef72e8904
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/cairo/cairo-fpu.inc
@@ -0,0 +1,6 @@
+
+def get_cairo_fpu_setting(bb, d):
+ if d.getVar('TARGET_FPU', True) in [ 'soft' ]:
+ return "--disable-some-floating-point"
+ return ""
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/cairo/cairo.inc b/import-layers/yocto-poky/meta/recipes-graphics/cairo/cairo.inc
new file mode 100644
index 000000000..c7e686d5a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/cairo/cairo.inc
@@ -0,0 +1,46 @@
+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}-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.contains('DISTRO_FEATURES', 'directfb', '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"
+
+#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
+
+# 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/import-layers/yocto-poky/meta/recipes-graphics/cairo/cairo_1.14.6.bb b/import-layers/yocto-poky/meta/recipes-graphics/cairo/cairo_1.14.6.bb
new file mode 100644
index 000000000..20b46689f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/cairo/cairo_1.14.6.bb
@@ -0,0 +1,45 @@
+require cairo.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=e73e999e0c72b5ac9012424fa157ad77"
+
+SRC_URI = "http://cairographics.org/releases/cairo-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "23a0b2f0235431d35238df1d3a517fdb"
+SRC_URI[sha256sum] = "613cb38447b76a93ff7235e17acd55a78b52ea84a9df128c3f2257f8eaa7b252"
+
+UPSTREAM_CHECK_REGEX = "cairo-(?P<pver>\d+(\.\d+)+)\.tar"
+
+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/import-layers/yocto-poky/meta/recipes-graphics/cantarell-fonts/cantarell-fonts_git.bb b/import-layers/yocto-poky/meta/recipes-graphics/cantarell-fonts/cantarell-fonts_git.bb
new file mode 100644
index 000000000..127f0a1c3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/cantarell-fonts/cantarell-fonts_git.bb
@@ -0,0 +1,24 @@
+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.21+git${SRCPV}"
+
+SRCREV = "611c169df5287c059d63b0c8f0570647c75c9189"
+SRC_URI = "git://git.gnome.org/cantarell-fonts;protocol=git;branch=master"
+
+S = "${WORKDIR}/git"
+
+inherit autotools allarch fontcache
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[fontforge] = "--enable-source-rebuild=yes,--enable-source-rebuild=no,fontforge-native"
+FILES_${PN} = "${datadir}/fonts ${datadir}/fontconfig"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-1.0.inc b/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-1.0.inc
new file mode 100644
index 000000000..c6ecd0804
--- /dev/null
+++ b/import-layers/yocto-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.contains('DISTRO_FEATURES', 'wayland', '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/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-1.0/0001-build-Use-AC_COMPILE_IFELSE.patch b/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-1.0/0001-build-Use-AC_COMPILE_IFELSE.patch
new file mode 100644
index 000000000..c4edff395
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-1.0/0001-build-Use-AC_COMPILE_IFELSE.patch
@@ -0,0 +1,105 @@
+From 483a4bb00e7dd2f14d86e167c8013c8638723c33 Mon Sep 17 00:00:00 2001
+From: Emmanuele Bassi <ebassi@gnome.org>
+Date: Thu, 18 Feb 2016 17:19:09 +0000
+Subject: [PATCH] build: Use AC_COMPILE_IFELSE
+
+Instead of AC_TRY_COMPILE, which has been deprecated by newer autoconf.
+---
+Upstream-Status: Backport
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+ configure.ac | 66 ++++++++++++++++++++++++++++++------------------------------
+ 1 file changed, 33 insertions(+), 33 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 4d72e0c..8ca3f94 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -348,24 +348,25 @@ AS_IF([test "x$enable_wayland" != xno],
+ # We need to manually check for Wayland support in Cogl because
+ # the windowing systems are not exposed in the pkg-config file
+ saved_CFLAGS="${CFLAGS}"
+- CFLAGS="`$PKG_CONFIG --cflags $CLUTTER_BASE_PC_FILES`"
++ CFLAGS="`$PKG_CONFIG --cflags cogl-1.0`"
+
+ AC_MSG_CHECKING([for Wayland Cogl backend])
+- AC_TRY_COMPILE([#include <cogl/cogl.h>],
+- [
+- #ifndef COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT
+- #error "No Wayland support in Cogl"
+- #endif
+- int main (void) { return 0; }
+- ],
+- [
+- AC_MSG_RESULT(yes)
+- have_cogl_wayland=yes
+- ],
+- [
+- AC_MSG_RESULT(no)
+- have_cogl_wayland=no
+- ])
++
++ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
++#include <cogl/cogl.h>
++]],
++[[
++#ifndef COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT
++#error Cogl compiled without Wayland support
++#endif
++]])], [
++ AC_MSG_RESULT(yes)
++ have_cogl_wayland=yes
++ ], [
++ AC_MSG_RESULT(no)
++ have_cogl_wayland=no
++ ])
++
+ CFLAGS="${saved_CFLAGS}"
+ AS_IF([test "x$have_cogl_wayland" = xyes],
+ [
+@@ -499,26 +500,25 @@ AS_IF([test "x$enable_mir" = "xyes"],
+ # We need to manually check for Mir support in Cogl because
+ # the windowing systems are not exposed in the pkg-config file
+ saved_CFLAGS="${CFLAGS}"
+- CFLAGS="`$PKG_CONFIG --cflags $CLUTTER_BASE_PC_FILES`"
++ CFLAGS="`$PKG_CONFIG --cflags cogl-1.0`"
+
+ AC_MSG_CHECKING([for Mir Cogl backend])
+- AC_TRY_COMPILE([#include <cogl/cogl.h>],
+- [
+- #ifndef COGL_HAS_EGL_PLATFORM_MIR_SUPPORT
+- #error "No Mir support in Cogl"
+- #endif
+- int main (void) { return 0; }
+- ],
+- [
+- AC_MSG_RESULT(yes)
+- have_cogl_mir=yes
+- ],
+- [
+- AC_MSG_RESULT(no)
+- have_cogl_mir=no
+- ])
+
+- CFLAGS="${saved_CFLAGS}"
++ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
++#include <cogl/cogl.h>
++]],
++[[
++#ifndef COGL_HAS_EGL_PLATFORM_MIR_SUPPORT
++#error Cogl compiled without Mir support
++#endif
++]])], [
++ AC_MSG_RESULT(yes)
++ have_cogl_mir=yes
++ ], [
++ AC_MSG_RESULT(no)
++ have_cogl_mir=no
++ ])
++
+ AS_IF([test "x$have_cogl_mir" = xno], [AC_MSG_ERROR("*** Cogl is missing Mir support.")])
+
+ PKG_CHECK_EXISTS([mirclient],
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-1.0/install-examples.patch b/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-1.0/install-examples.patch
new file mode 100644
index 000000000..3b6a70ef0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-1.0/install-examples.patch
@@ -0,0 +1,18 @@
+Install the examples to $libdir/clutter/.
+
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+Upstream-Status: Inappropriate
+
+diff --git a/examples/Makefile.am b/examples/Makefile.am
+index 4b9b449..232cd19 100644
+--- a/examples/Makefile.am
++++ b/examples/Makefile.am
+@@ -38,6 +38,7 @@ 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/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-1.0/run-installed-tests-with-tap-output.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-1.0/run-ptest b/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-1.0/run-ptest
new file mode 100644
index 000000000..98877e522
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-1.0/run-ptest
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+gnome-desktop-testing-runner clutter
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-1.0_1.24.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-1.0_1.24.2.bb
new file mode 100644
index 000000000..c53b3e71b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-1.0_1.24.2.bb
@@ -0,0 +1,10 @@
+require clutter-1.0.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
+
+SRC_URI[archive.md5sum] = "3b98e1b33719982a5736ae42cbf7183e"
+SRC_URI[archive.sha256sum] = "9631c98cb4bcbfec15e1bbe9eaa6eef0f127201552fce40d7d28f2133803cd63"
+SRC_URI += "file://install-examples.patch \
+ file://run-installed-tests-with-tap-output.patch \
+ file://0001-build-Use-AC_COMPILE_IFELSE.patch \
+ file://run-ptest"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-gst-3.0.inc b/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-gst-3.0.inc
new file mode 100644
index 000000000..4c877982b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-gst-3.0/0001-Install-example-binary-needed-for-core-image-clutter.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-gst-3.0_3.0.16.bb b/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-gst-3.0_3.0.16.bb
new file mode 100644
index 000000000..fcf5242c5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-gst-3.0_3.0.16.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] = "ca24eb92a0d34fc9e66fd686a965d51c"
+SRC_URI[archive.sha256sum] = "803e8b7265e63e0581e21fd0c6064792dfe951512e9f515e9e7a9b452caaf9f0"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-gtk-1.0.inc b/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-gtk-1.0.inc
new file mode 100644
index 000000000..05c4e5f5c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-gtk-1.0_1.6.6.bb b/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-gtk-1.0_1.6.6.bb
new file mode 100644
index 000000000..23257bb9c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/clutter/clutter-gtk-1.0_1.6.6.bb
@@ -0,0 +1,6 @@
+require clutter-gtk-1.0.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34"
+
+SRC_URI[archive.md5sum] = "79dc3d7a8645f87d83a9ccca8a08aa8e"
+SRC_URI[archive.sha256sum] = "9440a68600f58d00fe0af35383738943e8ead9907f4cf507a102d96822434a28"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/cogl/cogl-1.0.inc b/import-layers/yocto-poky/meta/recipes-graphics/cogl/cogl-1.0.inc
new file mode 100644
index 000000000..690ea3b86
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/cogl/cogl-1.0.inc
@@ -0,0 +1,75 @@
+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"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/cogl/cogl-1.0/test-backface-culling.c-fix-may-be-used-uninitialize.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/cogl/cogl-1.0_1.22.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/cogl/cogl-1.0_1.22.0.bb
new file mode 100644
index 000000000..ed10c7a39
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/cogl/cogl-1.0_1.22.0.bb
@@ -0,0 +1,7 @@
+require cogl-1.0.inc
+
+SRC_URI += "file://test-backface-culling.c-fix-may-be-used-uninitialize.patch"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=1b1a508d91d25ca607c83f92f3e31c84"
+SRC_URI[archive.md5sum] = "ab684ec96848d79d22757fb3064820c8"
+SRC_URI[archive.sha256sum] = "689dfb5d14fc1106e9d2ded0f7930dcf7265d0bc84fa846b4f03941633eeaa91"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb-examples/configure.in-Fix-string-argument-syntax.patch b/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb-examples/configure.in-Fix-string-argument-syntax.patch
new file mode 100644
index 000000000..0717ea6f8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb-examples/configure.in-Fix-string-argument-syntax.patch
@@ -0,0 +1,28 @@
+From 88077ed156a714f32bb408f422278d61611ffd41 Mon Sep 17 00:00:00 2001
+From: Otavio Salvador <otavio@ossystems.com.br>
+Date: Sat, 26 Jul 2014 16:57:46 -0300
+Subject: [PATCH] configure.in: Fix string argument syntax
+
+Upstream-Status: Submitted
+
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+---
+ configure.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.in b/configure.in
+index bfe1b82..e939bbd 100644
+--- a/configure.in
++++ b/configure.in
+@@ -65,7 +65,7 @@ fi)
+
+ DIRECTFB_REQUIRED_VERSION=1.4.14
+
+-PKG_CHECK_MODULES(DIRECTFB, directfb >= $DIRECTFB_REQUIRED_VERSION,[ WATER=`$PKG_CONFIG --variable=water directfb` ],
++PKG_CHECK_MODULES([DIRECTFB], directfb >= $DIRECTFB_REQUIRED_VERSION,[ WATER=`$PKG_CONFIG --variable=water directfb` ],
+ AC_MSG_ERROR([$DIRECTFB_PKG_ERRORS
+ *** DirectFB $DIRECTFB_REQUIRED_VERSION or newer is required. The latest version
+ *** of DirectFB is available from http://www.directfb.org/.]))
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb-examples_1.7.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb-examples_1.7.0.bb
new file mode 100644
index 000000000..7907c5c0d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb-examples_1.7.0.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Example DirectFB applications"
+DESCRIPTION = "The DirectFB-examples package contains a set of simple DirectFB \
+ applications that can be used to test and demonstrate various DirectFB \
+ features"
+DEPENDS = "directfb"
+SECTION = "libs"
+LICENSE = "MIT"
+
+SRC_URI = " \
+ http://downloads.yoctoproject.org/mirror/sources/DirectFB-examples-${PV}.tar.gz \
+ file://configure.in-Fix-string-argument-syntax.patch \
+ "
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=ecf6fd2b19915afc4da56043926ca18f"
+
+S = "${WORKDIR}/DirectFB-examples-${PV}"
+
+inherit autotools pkgconfig
+
+SRC_URI[md5sum] = "8b60c867af295481c32a8c7fc5802307"
+SRC_URI[sha256sum] = "9a2104cc4da8123c8371813551b66b943198979f745cbebc034bb5e10844122a"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb.inc b/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb.inc
new file mode 100644
index 000000000..f6b7cbe1a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb.inc
@@ -0,0 +1,79 @@
+SUMMARY = "Graphics abstraction library for the Linux Framebuffer Device"
+DESCRIPTION = "DirectFB is a thin library that provides developers \
+with hardware graphics acceleration, input device handling and \
+abstraction, an integrated windowing system with support for \
+translucent windows and multiple display layers on top of the \
+Linux framebuffer device."
+SECTION = "libs"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=dcf3c825659e82539645da41a7908589"
+
+HOMEPAGE = "http://directfb.org"
+DEPENDS = "jpeg libpng freetype zlib tslib sysfsutils"
+
+SRC_URI = "http://downloads.yoctoproject.org/mirror/sources/DirectFB-${PV}.tar.gz \
+ file://configurefix.patch \
+ file://fusion.patch \
+ file://bashism.patch \
+ file://0001-gfx-direct-Aboid-usng-VLAs-and-printf-formats.patch \
+ file://compar_fn_t.patch \
+ file://union-sigval.patch \
+ file://use-PTHREAD_MUTEX_RECURSIVE.patch \
+ "
+
+S = "${WORKDIR}/DirectFB-${PV}"
+
+LDFLAGS_append =" -lts -lm"
+
+# Workaround for linking issues seen with armv7a + gold
+LDFLAGS_append_arm = "${@base_contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd ', '', d)}"
+
+BINCONFIG = "${bindir}/directfb-config"
+
+inherit autotools binconfig-disabled pkgconfig
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[jpeg2000] = "--enable-jpeg2000,--disable-jpeg2000,jasper"
+PACKAGECONFIG[drmkms] = "--enable-drmkms,--disable-drmkms,libdrm"
+PACKAGECONFIG[tiff] = "--enable-tiff,--disable-tiff,tiff"
+PACKAGECONFIG[webp] = "--enable-webp,--disable-webp,libwebp"
+
+EXTRA_OECONF = "\
+ --with-gfxdrivers=none \
+ --enable-freetype=yes \
+ --enable-zlib \
+ --disable-imlib2 \
+ --disable-mesa \
+ --disable-sdl \
+ --disable-vnc \
+ --disable-x11 \
+"
+
+#Once -fno-omit-frame-pointer option of gcc is added into TARGET_CLFAGS as default
+#this will cause directfb build failure on x86 arch, so filter out it.
+TARGET_CFLAGS_remove_x86 = "-fno-omit-frame-pointer"
+
+#PACKAGES_DYNAMIC += "^directfb-inputdrivers-.*"
+#
+#python populate_packages_prepend () {
+# inputdrivers_libdir = d.expand('${libdir}/directfb-${RV}/inputdrivers')
+# do_split_packages(d, inputdrivers_libdir, '*.so$', 'directfb-inputdrivers-%s', 'Directfb plugin for %s')
+#}
+
+# NOTE: monolithic packaging for now, should improve that eventually
+
+FILES_${PN}-dev += "\
+ ${bindir}/directfb-config \
+ ${libdir}/directfb-${RV}/systems/*.la \
+ ${libdir}/directfb-${RV}/inputdrivers/*.la \
+ ${libdir}/directfb-${RV}/interfaces/*/*.la \
+ ${libdir}/directfb-${RV}/wm/*.la \
+"
+
+FILES_${PN} += "\
+ ${libdir}/directfb-${RV}/systems/*.so \
+ ${libdir}/directfb-${RV}/inputdrivers/*.so \
+ ${libdir}/directfb-${RV}/interfaces/*/*.so \
+ ${libdir}/directfb-${RV}/wm/*.so \
+ ${datadir}/directfb-${PV} \
+"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/0001-gfx-direct-Aboid-usng-VLAs-and-printf-formats.patch b/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/0001-gfx-direct-Aboid-usng-VLAs-and-printf-formats.patch
new file mode 100644
index 000000000..76e0f7530
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/0001-gfx-direct-Aboid-usng-VLAs-and-printf-formats.patch
@@ -0,0 +1,61 @@
+From f43ef44806ffb8e3b35d99070dde9b6cc1714d3d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 8 Sep 2015 21:32:20 +0000
+Subject: [PATCH] gfx,direct: Aboid usng VLAs and printf formats
+
+VLAs are flagged by clang when using non-POD types, therefore replace
+the usage with alloca which is exact same allocation on stack
+
+ __attribute__((__format__ (__printf__))) is not portable as used here
+ therefore disable the check for clang here, we lose no functionality
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ lib/direct/util.h | 2 +-
+ src/gfx/util.cpp | 8 ++++----
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/lib/direct/util.h b/lib/direct/util.h
+index 72941e9..8e7fa4a 100644
+--- a/lib/direct/util.h
++++ b/lib/direct/util.h
+@@ -98,7 +98,7 @@
+ #define D_CONST_FUNC
+ #endif
+
+-#if __GNUC__ >= 3
++#if __GNUC__ >= 3 && !defined __clang__
+ #define D_FORMAT_PRINTF(n) __attribute__((__format__ (__printf__, n, n+1)))
+ #define D_FORMAT_VPRINTF(n) __attribute__((__format__ (__printf__, n, 0)))
+ #else
+diff --git a/src/gfx/util.cpp b/src/gfx/util.cpp
+index 40032bc..d1015d4 100644
+--- a/src/gfx/util.cpp
++++ b/src/gfx/util.cpp
+@@ -294,8 +294,8 @@ dfb_gfx_copy_regions_stereo( CoreSurface *source,
+ {
+ unsigned int i, n = 0;
+ DFBRectangle rect = { 0, 0, source->config.size.w, source->config.size.h };
+- DFBRectangle rects[num];
+- DFBPoint points[num];
++ DFBRectangle *rects = (DFBRectangle*)alloca( sizeof(struct DFBRectangle) * num);
++ DFBPoint *points = (DFBPoint*)alloca( sizeof(struct DFBPoint) * num);
+
+ for (i=0; i<num; i++) {
+ DFB_REGION_ASSERT( &regions[i] );
+@@ -351,8 +351,8 @@ dfb_gfx_copy_regions_client( CoreSurface *source,
+ {
+ unsigned int i, n = 0;
+ DFBRectangle rect = { 0, 0, source->config.size.w, source->config.size.h };
+- DFBRectangle rects[num];
+- DFBPoint points[num];
++ DFBRectangle *rects = (DFBRectangle*)alloca( sizeof(struct DFBRectangle) * num);
++ DFBPoint *points = (DFBPoint*)alloca( sizeof(struct DFBPoint) * num);
+ CoreGraphicsStateClient *client = _client ? _client : &StateClient::Get()->client;
+ CardState *state = client->state;
+ CardState backup;
+--
+2.5.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/bashism.patch b/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/bashism.patch
new file mode 100644
index 000000000..2ef4e9385
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/bashism.patch
@@ -0,0 +1,18 @@
+${x//y/} is a bash syntax. Replace with something dash compatible
+
+RP 2015/5/3
+Upstream-Status: Pending
+
+Index: DirectFB-1.7.7/configure.in
+===================================================================
+--- DirectFB-1.7.7.orig/configure.in
++++ DirectFB-1.7.7/configure.in
+@@ -2696,7 +2696,7 @@ AM_CONDITIONAL(BUILD_TOOLS, test "$with_
+ AM_CONDITIONAL(CROSS_COMPILING, test "$cross_compiling" = "yes")
+
+ CFLAGS="$CFLAGS $DFB_INTERNAL_CFLAGS"
+-CXXFLAGS="$CXXFLAGS ${CFLAGS//-Werror-implicit-function-declaration/}"
++CXXFLAGS="$CXXFLAGS $(printf '%s\n' "$CFLAGS" | sed 's/-Werror-implicit-function-declaration//g')"
+ DFB_LDFLAGS="$LDFLAGS $ZLIB_LIBS"
+
+ CFLAGS="$CFLAGS $CFLAGS_STD"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/compar_fn_t.patch b/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/compar_fn_t.patch
new file mode 100644
index 000000000..ee4d900ba
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/compar_fn_t.patch
@@ -0,0 +1,62 @@
+test for __compar_fn_t and if not defined by libc then define it
+help make directfb compile with musl
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: DirectFB-1.7.7/configure.in
+===================================================================
+--- DirectFB-1.7.7.orig/configure.in
++++ DirectFB-1.7.7/configure.in
+@@ -112,6 +112,17 @@ AC_CHECK_SIZEOF(long)
+ AC_CHECK_SIZEOF(long long)
+ AC_CHECK_FUNCS(fork)
+
++AC_CACHE_CHECK([for compar_fn_t in stdlib.h],ccache_cv_COMPAR_FN_T, [
++ AC_TRY_COMPILE(
++ [#include <stdlib.h>],
++ [void test_fn(void) { qsort(NULL, 0, 0, (__compar_fn_t)NULL); }],
++ ccache_cv_COMPAR_FN_T=yes,
++ ccache_cv_COMPAR_FN_T=no)])
++if test x"$ccache_cv_COMPAR_FN_T" = x"yes"; then
++ AC_DEFINE(HAVE_COMPAR_FN_T, 1,
++ Define to 1 if you have the `__compar_fn_t' typedef.)
++fi
++
+ AC_PATH_PROGS(PERL, perl5 perl)
+
+ AC_PATH_PROG(MAN2HTML, man2html, no)
+Index: DirectFB-1.7.7/inputdrivers/lirc/lirc.c
+===================================================================
+--- DirectFB-1.7.7.orig/inputdrivers/lirc/lirc.c
++++ DirectFB-1.7.7/inputdrivers/lirc/lirc.c
+@@ -59,6 +59,11 @@
+
+ #include <core/input_driver.h>
+
++#if HAVE_COMPAR_FN_T
++#define COMPAR_FN_T __compar_fn_t
++#else
++typedef int (*COMPAR_FN_T)(const void *, const void *);
++#endif
+
+ DFB_INPUT_DRIVER( lirc )
+
+@@ -97,7 +102,7 @@ static DFBInputDeviceKeySymbol lirc_pars
+ qsort ( keynames,
+ D_ARRAY_SIZE( keynames ),
+ sizeof(keynames[0]),
+- (__compar_fn_t) keynames_sort_compare );
++ (COMPAR_FN_T) keynames_sort_compare );
+ keynames_sorted = true;
+ }
+
+@@ -124,7 +129,7 @@ static DFBInputDeviceKeySymbol lirc_pars
+ symbol_name = bsearch( name, keynames,
+ D_ARRAY_SIZE( keynames ),
+ sizeof(keynames[0]),
+- (__compar_fn_t) keynames_compare );
++ (COMPAR_FN_T) keynames_compare );
+ if (symbol_name)
+ return symbol_name->symbol;
+ break;
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/configurefix.patch b/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/configurefix.patch
new file mode 100644
index 000000000..dd8c01905
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/configurefix.patch
@@ -0,0 +1,60 @@
+Libtool needs these set correctly else we end up with pointless rpaths
+such as the QA warnings:
+
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/dfblayer contains probably-redundant RPATH /usr/libWARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/dfbmaster contains probably-redundant RPATH /usr/libWARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/mkdgifft contains probably-redundant RPATH /usr/libWARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/dfbdump contains probably-redundant RPATH /usr/libWARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/dfbinput contains probably-redundant RPATH /usr/libWARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/dfbfx contains probably-redundant RPATH /usr/libWARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/dfbscreen contains probably-redundant RPATH /usr/libWARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/mkdgiff contains probably-redundant RPATH /usr/libWARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/dfbinspector contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/mkdfiff contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/dfbinfo contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/dfbpenmount contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/dfbg contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/libfusion-1.4.so.6 contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/libdirectfb-1.4.so.6.0.9 contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/libdirectfb-1.4.so.6 contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/libfusion-1.4.so.6.0.9 contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/systems/libdirectfb_fbdev.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/systems/libdirectfb_devmem.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/systems/libdirectfb_dummy.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/interfaces/IDirectFBVideoProvider/libidirectfbvideoprovider_v4l.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/interfaces/IDirectFBVideoProvider/libidirectfbvideoprovider_gif.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/interfaces/ICoreResourceManager/libicoreresourcemanager_test.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_jpeg.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_png.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_dfiff.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_gif.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/interfaces/IDirectFBFont/libidirectfbfont_ft2.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/interfaces/IDirectFBFont/libidirectfbfont_dgiff.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/wm/libdirectfbwm_default.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_zytronic.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_penmount.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_linux_input.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_serialmouse.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_mutouch.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_tslib.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_joystick.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_sonypi.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_lirc.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_wm97xx_ts.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_ps2mouse.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_keyboard.so contains probably-redundant RPATH /usr/lib
+
+Upstream-Status: Pending
+
+RP 2012/03/16
+
+Index: DirectFB-1.4.15/configure.in
+===================================================================
+--- DirectFB-1.4.15.orig/configure.in 2012-03-16 13:32:23.692402879 +0000
++++ DirectFB-1.4.15/configure.in 2012-03-16 13:33:22.312400960 +0000
+@@ -97,13 +97,6 @@
+ AC_CHECK_SIZEOF(long long)
+ AC_CHECK_FUNCS(fork)
+
+-
+-## Work around libstuhl during cross build...
+-if test "$host" != "$build"; then
+- sys_lib_dlsearch_path_spec=""
+- sys_lib_search_path_spec=""
+-fi
+-
+ AC_PATH_PROGS(PERL, perl5 perl)
+
+ AC_PATH_PROG(MAN2HTML, man2html, no)
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/fusion.patch b/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/fusion.patch
new file mode 100644
index 000000000..1f81a6796
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/fusion.patch
@@ -0,0 +1,36 @@
+directfb: Fix for hangs in direct_test, fusion_skirmish on exit
+
+Upstream-Status: Pending
+Signed-off-by: Lauren Post <lauren.post@freescale.com>
+
+--- a/lib/fusion/fusion.c 2013-01-18 22:57:11.000000000 +0800
++++ b/lib/fusion/fusion.c 2013-07-04 10:42:56.502699119 +0800
+@@ -2853,9 +2853,14 @@
+ direct_mutex_lock( &world->event_dispatcher_mutex );
+
+ while (1) {
+- if (!world->event_dispatcher_buffers)
++ if (!world->event_dispatcher_buffers){
+ direct_waitqueue_wait( &world->event_dispatcher_cond, &world->event_dispatcher_mutex );
+-
++ if (world->dispatch_stop) {
++ D_DEBUG_AT( Fusion_Main_Dispatch, " -> IGNORING (dispatch_stop!)\n" );
++ direct_mutex_unlock( &world->event_dispatcher_mutex );
++ return NULL;
++ }
++ }
+ buf = (FusionEventDispatcherBuffer *)world->event_dispatcher_buffers;
+ D_MAGIC_ASSERT( buf, FusionEventDispatcherBuffer );
+
+@@ -2872,6 +2877,11 @@
+ //D_INFO("waiting...\n");
+ D_ASSERT( buf->read_pos == buf->write_pos );
+ direct_waitqueue_wait( &world->event_dispatcher_cond, &world->event_dispatcher_mutex );
++ if (world->dispatch_stop) {
++ D_DEBUG_AT( Fusion_Main_Dispatch, " -> IGNORING (dispatch_stop!)\n" );
++ direct_mutex_unlock( &world->event_dispatcher_mutex );
++ return NULL;
++ }
+ }
+
+ buf = (FusionEventDispatcherBuffer *)world->event_dispatcher_buffers;
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/union-sigval.patch b/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/union-sigval.patch
new file mode 100644
index 000000000..29f45c797
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/union-sigval.patch
@@ -0,0 +1,19 @@
+This patch is taken from gentoo musl overlay
+sigval_t is glibc only construct, we use a union of sigval
+which pretty much is same effect as sigval_t
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+diff -Naur DirectFB-1.7.6.orig/lib/direct/os/linux/glibc/system.c DirectFB-1.7.6/lib/direct/os/linux/glibc/system.c
+--- DirectFB-1.7.6.orig/lib/direct/os/linux/glibc/system.c 2014-07-15 02:54:58.000000000 -0400
++++ DirectFB-1.7.6/lib/direct/os/linux/glibc/system.c 2015-07-18 16:55:35.077989166 -0400
+@@ -111,7 +111,7 @@
+ void
+ direct_trap( const char *domain, int sig )
+ {
+- sigval_t val;
++ union sigval val;
+
+ if (direct_config->delay_trap_ms) {
+ D_LOG( Direct_Trap, VERBOSE, "NOT RAISING signal %d from %s, waiting for %dms... attach gdb --pid=%d\n", sig, domain, direct_config->delay_trap_ms, getpid() );
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/use-PTHREAD_MUTEX_RECURSIVE.patch b/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/use-PTHREAD_MUTEX_RECURSIVE.patch
new file mode 100644
index 000000000..ac48f68db
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb/use-PTHREAD_MUTEX_RECURSIVE.patch
@@ -0,0 +1,116 @@
+Remove use of DIRECT_RECURSIVE_MUTEX_INITIALIZER its not portable
+use portable way to initialize recursive mutex using pthread_once() and direct_recursive_mutex_init()
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Index: DirectFB-1.7.7/lib/direct/os/linux/glibc/mutex.h
+===================================================================
+--- DirectFB-1.7.7.orig/lib/direct/os/linux/glibc/mutex.h
++++ DirectFB-1.7.7/lib/direct/os/linux/glibc/mutex.h
+@@ -46,7 +46,6 @@ struct __D_DirectMutex {
+ /**********************************************************************************************************************/
+
+ #define DIRECT_MUTEX_INITIALIZER(name) { PTHREAD_MUTEX_INITIALIZER }
+-#define DIRECT_RECURSIVE_MUTEX_INITIALIZER(name) { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP }
+
+ #endif
+
+Index: DirectFB-1.7.7/lib/direct/trace.c
+===================================================================
+--- DirectFB-1.7.7.orig/lib/direct/trace.c
++++ DirectFB-1.7.7/lib/direct/trace.c
+@@ -89,8 +89,15 @@ struct __D_DirectTraceBuffer {
+ /**************************************************************************************************/
+
+ static DirectLink *buffers;
+-static DirectMutex buffers_lock = DIRECT_RECURSIVE_MUTEX_INITIALIZER(buffers_lock);
+
++static pthread_once_t buffers_lock_init_once = PTHREAD_ONCE_INIT;
++static DirectMutex buffers_lock;
++
++static void
++buffers_lock_init( void )
++{
++ direct_recursive_mutex_init(&buffers_lock);
++}
+ /**************************************************************************************************/
+
+ __dfb_no_instrument_function__
+@@ -113,6 +120,7 @@ get_trace_buffer( void )
+
+ D_MAGIC_SET( buffer, DirectTraceBuffer );
+
++ pthread_once(&buffers_lock_init_once, buffers_lock_init);
+ direct_mutex_lock( &buffers_lock );
+ direct_list_append( &buffers, &buffer->link );
+ direct_mutex_unlock( &buffers_lock );
+@@ -138,8 +146,14 @@ typedef struct {
+ } SymbolTable;
+
+ static DirectLink *tables = NULL;
+-static DirectMutex tables_lock = DIRECT_RECURSIVE_MUTEX_INITIALIZER(tables_lock);
++static pthread_once_t tables_lock_init_once = PTHREAD_ONCE_INIT;
++static DirectMutex tables_lock;
+
++static void
++tables_lock_init( void )
++{
++ direct_recursive_mutex_init(&tabless_lock);
++}
+
+ __dfb_no_instrument_function__
+ static void
+@@ -370,6 +384,7 @@ direct_trace_lookup_symbol( const char *
+ Symbol *symbol;
+ SymbolTable *table;
+
++ pthread_once(&tables_lock_init_once, tables_lock_init);
+ direct_mutex_lock( &tables_lock );
+
+ table = find_table( filename );
+@@ -514,6 +529,7 @@ direct_trace_print_stacks()
+ DirectTraceBuffer *b;
+ DirectTraceBuffer *buffer = get_trace_buffer();
+
++ pthread_once(&buffers_lock_init_once, buffers_lock_init);
+ direct_mutex_lock( &buffers_lock );
+
+ if (buffer && buffer->level)
+@@ -611,6 +627,7 @@ direct_trace_free_buffer( DirectTraceBuf
+ D_MAGIC_ASSERT( buffer, DirectTraceBuffer );
+
+ if (buffer->thread) {
++ pthread_once(&buffers_lock_init_once, buffers_lock_init);
+ direct_mutex_lock( &buffers_lock );
+ direct_list_remove( &buffers, &buffer->link );
+ direct_mutex_unlock( &buffers_lock );
+Index: DirectFB-1.7.7/src/directfb.c
+===================================================================
+--- DirectFB-1.7.7.orig/src/directfb.c
++++ DirectFB-1.7.7/src/directfb.c
+@@ -99,6 +99,15 @@ const unsigned int directfb_micro_versio
+ const unsigned int directfb_binary_age = DIRECTFB_BINARY_AGE;
+ const unsigned int directfb_interface_age = DIRECTFB_INTERFACE_AGE;
+
++static pthread_once_t lock_init_once = PTHREAD_ONCE_INIT;
++static DirectMutex lock;
++
++static void
++lock_init( void )
++{
++ direct_recursive_mutex_init(&lock);
++}
++
+ const char *
+ DirectFBCheckVersion( unsigned int required_major,
+ unsigned int required_minor,
+@@ -215,8 +224,7 @@ DirectFBCreate( IDirectFB **interface_pt
+ if (dfb_config->remote.host)
+ return CreateRemote( dfb_config->remote.host, dfb_config->remote.port, interface_ptr );
+
+- static DirectMutex lock = DIRECT_RECURSIVE_MUTEX_INITIALIZER(lock);
+-
++ pthread_once(&lock_init_once, lock_init);
+ direct_mutex_lock( &lock );
+
+ if (!dfb_config->no_singleton && idirectfb_singleton) {
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb_1.7.7.bb b/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb_1.7.7.bb
new file mode 100644
index 000000000..c6c070eda
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/directfb/directfb_1.7.7.bb
@@ -0,0 +1,8 @@
+require directfb.inc
+
+RV = "1.7-7"
+
+LEAD_SONAME = "libdirectfb-1.7.so.0"
+
+SRC_URI[md5sum] = "152cf1863b1a3a28aa1370e9053440bf"
+SRC_URI[sha256sum] = "b785c638dc31b8fe3a7c81be1475c89b2255ab3d67b777c747d3fbc52f8027a3"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/drm/libdrm/fix_O_CLOEXEC_undeclared.patch b/import-layers/yocto-poky/meta/recipes-graphics/drm/libdrm/fix_O_CLOEXEC_undeclared.patch
new file mode 100644
index 000000000..286e548bc
--- /dev/null
+++ b/import-layers/yocto-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 <stdio.h>
+ #include <stdlib.h>
+ #include <sys/stat.h>
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/drm/libdrm/installtests.patch b/import-layers/yocto-poky/meta/recipes-graphics/drm/libdrm/installtests.patch
new file mode 100644
index 000000000..30e0a61fd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/drm/libdrm/installtests.patch
@@ -0,0 +1,15 @@
+tests: also install tests app
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Yu Ke <ke.yu@intel.com>
+
+Index: libdrm-2.4.66/tests/Makefile.am
+===================================================================
+--- libdrm-2.4.66.orig/tests/Makefile.am
++++ libdrm-2.4.66/tests/Makefile.am
+@@ -73,3 +73,4 @@ TESTS += \
+ endif
+
+ check_PROGRAMS += $(TESTS)
++bin_PROGRAMS = $(check_PROGRAMS)
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/drm/libdrm_2.4.67.bb b/import-layers/yocto-poky/meta/recipes-graphics/drm/libdrm_2.4.67.bb
new file mode 100644
index 000000000..ddd697f34
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/drm/libdrm_2.4.67.bb
@@ -0,0 +1,45 @@
+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 udev libpciaccess"
+
+SRC_URI = "http://dri.freedesktop.org/libdrm/${BP}.tar.bz2 \
+ file://installtests.patch \
+ file://fix_O_CLOEXEC_undeclared.patch \
+ "
+
+SRC_URI[md5sum] = "b844c6af34e613ebf52f80b3cd8d7055"
+SRC_URI[sha256sum] = "ee5b71e1113be37544d0752681c12f040c01f782e2933df7d7bc21fd0d10cebe"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF += "--disable-cairo-tests \
+ --enable-omap-experimental-api \
+ --enable-install-test-programs \
+ --disable-manpages \
+ --disable-valgrind \
+ "
+
+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"
+
+RRECOMMENDS_${PN}-drivers = "${PN}-radeon ${PN}-nouveau ${PN}-omap ${PN}-intel \
+ ${PN}-exynos ${PN}-freedreno ${PN}-amdgpu"
+
+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.*"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/eglinfo/eglinfo-fb_1.0.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/eglinfo/eglinfo-fb_1.0.0.bb
new file mode 100644
index 000000000..455d31e87
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/eglinfo/eglinfo-fb_1.0.0.bb
@@ -0,0 +1,6 @@
+EGLINFO_PLATFORM ?= "fb"
+EGLINFO_BINARY_NAME ?= "eglinfo-fb"
+
+include eglinfo.inc
+
+SUMMARY += "(Framebuffer version)"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/eglinfo/eglinfo-x11_1.0.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/eglinfo/eglinfo-x11_1.0.0.bb
new file mode 100644
index 000000000..3427fdf42
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/eglinfo/eglinfo-x11_1.0.0.bb
@@ -0,0 +1,12 @@
+EGLINFO_PLATFORM ?= "x11"
+EGLINFO_BINARY_NAME ?= "eglinfo-x11"
+
+include eglinfo.inc
+
+DEPENDS += "virtual/libx11"
+
+inherit distro_features_check
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+SUMMARY += "(X11 version)"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/eglinfo/eglinfo.inc b/import-layers/yocto-poky/meta/recipes-graphics/eglinfo/eglinfo.inc
new file mode 100644
index 000000000..d0c0c2761
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/eglinfo/eglinfo.inc
@@ -0,0 +1,31 @@
+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"
+
+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/import-layers/yocto-poky/meta/recipes-graphics/eglinfo/files/0001-Add-STAGING_INCDIR-to-searchpath-for-egl-headers.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/fontconfig/fontconfig/0001-Revert-changes-made-to-FcConfigAppFontAddDir-recentl.patch b/import-layers/yocto-poky/meta/recipes-graphics/fontconfig/fontconfig/0001-Revert-changes-made-to-FcConfigAppFontAddDir-recentl.patch
new file mode 100644
index 000000000..f2fd5d473
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/fontconfig/fontconfig/0001-Revert-changes-made-to-FcConfigAppFontAddDir-recentl.patch
@@ -0,0 +1,132 @@
+From 46ec6a52d4cc447cc3ff4a13b2067ecb76c9db2e Mon Sep 17 00:00:00 2001
+From: Behdad Esfahbod <behdad@behdad.org>
+Date: Fri, 26 Jun 2015 17:02:13 -0700
+Subject: [PATCH] Revert changes made to FcConfigAppFontAddDir() recently
+
+In 32ac7c75e8db0135ef37cf86f92d8b9be000c8bb the behavior of
+FcConfigAppFontAddFile/Dir() were changed to return false
+if not fonts were found. While this is welldefined and useful
+for AddFile(), it's quite problematic for AddDir(). For example,
+if the directory is empty, is that a failure or success? Worse,
+the false value from AddDir() was being propagated all the way
+to FcInit() returning false now. This only happened upon memory
+allocation failure before, and some clients assert that FcInit()
+is successful.
+
+With this change, AddDir() is reverted back to what it was.
+AddFont() change (which was actually in fcdir.c) from the original
+commit is left in.
+
+Upstream-Status: backport
+
+Signed-off-by: Li Zhou <li.zhou@windriver.com>
+---
+ doc/fcconfig.fncs | 2 +-
+ src/fccfg.c | 29 +++++++++++------------------
+ src/fcint.h | 3 ---
+ src/fcstr.c | 8 --------
+ 4 files changed, 12 insertions(+), 30 deletions(-)
+
+Index: fontconfig-2.11.94/doc/fcconfig.fncs
+===================================================================
+--- fontconfig-2.11.94.orig/doc/fcconfig.fncs
++++ fontconfig-2.11.94/doc/fcconfig.fncs
+@@ -232,7 +232,7 @@ the current configuration is used.
+ @DESC@
+ Scans the specified directory for fonts, adding each one found to the
+ application-specific set of fonts. Returns FcFalse
+-if the fonts cannot be added (due to allocation failure or no fonts found).
++if the fonts cannot be added (due to allocation failure).
+ Otherwise returns FcTrue. If <parameter>config</parameter> is NULL,
+ the current configuration is used.
+ @@
+Index: fontconfig-2.11.94/src/fccfg.c
+===================================================================
+--- fontconfig-2.11.94.orig/src/fccfg.c
++++ fontconfig-2.11.94/src/fccfg.c
+@@ -368,7 +368,6 @@ FcConfigAddDirList (FcConfig *config, Fc
+ FcStrList *dirlist;
+ FcChar8 *dir;
+ FcCache *cache;
+- FcBool ret = FcFalse;
+
+ dirlist = FcStrListCreate (dirSet);
+ if (!dirlist)
+@@ -383,10 +382,9 @@ FcConfigAddDirList (FcConfig *config, Fc
+ continue;
+ FcConfigAddCache (config, cache, set, dirSet);
+ FcDirCacheUnload (cache);
+- ret = FcTrue;
+ }
+ FcStrListDone (dirlist);
+- return ret;
++ return FcTrue;
+ }
+
+ /*
+@@ -2199,7 +2197,6 @@ FcConfigAppFontAddFile (FcConfig *con
+ FcStrSet *subdirs;
+ FcStrList *sublist;
+ FcChar8 *subdir;
+- FcBool ret = FcFalse;
+
+ if (!config)
+ {
+@@ -2229,19 +2226,16 @@ FcConfigAppFontAddFile (FcConfig *con
+ FcStrSetDestroy (subdirs);
+ return FcFalse;
+ }
+- if (subdirs->num == 0)
+- ret = FcTrue;
+- else if ((sublist = FcStrListCreate (subdirs)))
++ if ((sublist = FcStrListCreate (subdirs)))
+ {
+ while ((subdir = FcStrListNext (sublist)))
+ {
+- if (FcConfigAppFontAddDir (config, subdir))
+- ret = FcTrue;
++ FcConfigAppFontAddDir (config, subdir);
+ }
+ FcStrListDone (sublist);
+ }
+ FcStrSetDestroy (subdirs);
+- return ret;
++ return FcTrue;
+ }
+
+ FcBool
+@@ -2250,7 +2244,6 @@ FcConfigAppFontAddDir (FcConfig *con
+ {
+ FcFontSet *set;
+ FcStrSet *dirs;
+- FcBool ret = FcTrue;
+
+ if (!config)
+ {
+@@ -2269,8 +2262,8 @@ FcConfigAppFontAddDir (FcConfig *con
+ set = FcFontSetCreate ();
+ if (!set)
+ {
+- ret = FcFalse;
+- goto bail;
++ FcStrSetDestroy (dirs);
++ return FcFalse;
+ }
+ FcConfigSetFonts (config, set, FcSetApplication);
+ }
+@@ -2278,10 +2271,12 @@ FcConfigAppFontAddDir (FcConfig *con
+ FcStrSetAddFilename (dirs, dir);
+
+ if (!FcConfigAddDirList (config, FcSetApplication, dirs))
+- ret = FcFalse;
+-bail:
++ {
++ FcStrSetDestroy (dirs);
++ return FcFalse;
++ }
+ FcStrSetDestroy (dirs);
+- return ret;
++ return FcTrue;
+ }
+
+ void
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/fontconfig/fontconfig/revert-static-pkgconfig.patch b/import-layers/yocto-poky/meta/recipes-graphics/fontconfig/fontconfig/revert-static-pkgconfig.patch
new file mode 100644
index 000000000..fca1e6594
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/fontconfig/fontconfig_2.11.94.bb b/import-layers/yocto-poky/meta/recipes-graphics/fontconfig/fontconfig_2.11.94.bb
new file mode 100644
index 000000000..b427947a9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/fontconfig/fontconfig_2.11.94.bb
@@ -0,0 +1,50 @@
+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=1199;endline=1214;md5=0326cfeb4a7333dd4dd25fbbc4b9f27f"
+
+SECTION = "libs"
+
+DEPENDS = "expat freetype zlib"
+
+SRC_URI = "http://fontconfig.org/release/fontconfig-${PV}.tar.gz \
+ file://revert-static-pkgconfig.patch \
+ file://0001-Revert-changes-made-to-FcConfigAppFontAddDir-recentl.patch \
+ "
+SRC_URI[md5sum] = "479be870c7f83f15f87bac085b61d641"
+SRC_URI[sha256sum] = "73f6d323c7bcfbde25d78397675191d55b8f4139132c6a9444410f3a2d8a9a95"
+
+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
+
+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/import-layers/yocto-poky/meta/recipes-graphics/freetype/freetype/use-right-libtool.patch b/import-layers/yocto-poky/meta/recipes-graphics/freetype/freetype/use-right-libtool.patch
new file mode 100644
index 000000000..20838813d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/freetype/freetype_2.6.3.bb b/import-layers/yocto-poky/meta/recipes-graphics/freetype/freetype_2.6.3.bb
new file mode 100644
index 000000000..3ed907012
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/freetype/freetype_2.6.3.bb
@@ -0,0 +1,46 @@
+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=d479e83797f699fe873b38dadd0fcd4c \
+ file://docs/GPLv2.TXT;md5=8ef380476f642c20ebf40fecb0add2ec"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/freetype/freetype-${PV}.tar.bz2 \
+ file://use-right-libtool.patch"
+
+SRC_URI[md5sum] = "0037b25a8c090bc8a1218e867b32beb1"
+SRC_URI[sha256sum] = "371e707aa522acf5b15ce93f11183c725b8ed1ee8546d7b3af549863045863a2"
+
+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"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/fstests/fstests_git.bb b/import-layers/yocto-poky/meta/recipes-graphics/fstests/fstests_git.bb
new file mode 100644
index 000000000..95c33f410
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/fstests/fstests_git.bb
@@ -0,0 +1,18 @@
+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}"
+
+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/import-layers/yocto-poky/meta/recipes-graphics/glew/glew/no-strip.patch b/import-layers/yocto-poky/meta/recipes-graphics/glew/glew/no-strip.patch
new file mode 100644
index 000000000..e411f11cb
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/glew/glew_1.13.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/glew/glew_1.13.0.bb
new file mode 100644
index 000000000..a25c405f3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/glew/glew_1.13.0.bb
@@ -0,0 +1,40 @@
+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"
+SECTION = "x11"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=2ac251558de685c6b9478d89be3149c2"
+
+DEPENDS = "virtual/libx11 virtual/libgl libglu libxext libxi libxmu"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/project/glew/glew/${PV}/glew-${PV}.tgz \
+ file://no-strip.patch"
+
+SRC_URI[md5sum] = "7cbada3166d2aadfc4169c4283701066"
+SRC_URI[sha256sum] = "aa25dc48ed84b0b64b8d41cdd42c8f40f149c37fa2ffa39cd97f42c78d128bc7"
+
+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 = "x11"
+
+# Override SYSTEM 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 = "SYSTEM='linux' \
+ CC='${CC}' LD='${CC}' STRIP='' \
+ LDFLAGS.EXTRA='${LDFLAGS}' \
+ POPT='${CFLAGS}' \
+ GLEW_PREFIX='${prefix}' BINDIR='${bindir}' \
+ LIBDIR='${libdir}' INCDIR='${includedir}/GL'"
+
+do_compile() {
+ oe_runmake
+}
+
+do_install() {
+ oe_runmake 'DESTDIR=${D}' install.all
+}
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/harfbuzz/harfbuzz_1.2.3.bb b/import-layers/yocto-poky/meta/recipes-graphics/harfbuzz/harfbuzz_1.2.3.bb
new file mode 100644
index 000000000..cfe885fe7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/harfbuzz/harfbuzz_1.2.3.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] = "da8d97e262e6ef8288e1ae76369421bd"
+SRC_URI[sha256sum] = "8216d2404aaab7fde87be0365a90d64aa6c55928e104557cfcb37b54a096cb8c"
+
+inherit autotools pkgconfig lib_package
+
+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/import-layers/yocto-poky/meta/recipes-graphics/images/core-image-clutter.bb b/import-layers/yocto-poky/meta/recipes-graphics/images/core-image-clutter.bb
new file mode 100644
index 000000000..b0f25cf1b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/images/core-image-directfb.bb b/import-layers/yocto-poky/meta/recipes-graphics/images/core-image-directfb.bb
new file mode 100644
index 000000000..5641195e8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/images/core-image-directfb.bb
@@ -0,0 +1,17 @@
+SUMMARY = "An image that uses DirectFB instead of X11"
+LICENSE = "MIT"
+
+
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+ file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+inherit core-image distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "directfb"
+CONFLICT_DISTRO_FEATURES = "x11"
+
+IMAGE_INSTALL += "\
+ ${CORE_IMAGE_BASE_INSTALL} \
+ packagegroup-core-full-cmdline \
+ packagegroup-core-directfb \
+"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/images/core-image-weston.bb b/import-layers/yocto-poky/meta/recipes-graphics/images/core-image-weston.bb
new file mode 100644
index 000000000..52e271dac
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/images/core-image-weston.bb
@@ -0,0 +1,11 @@
+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"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/images/core-image-x11.bb b/import-layers/yocto-poky/meta/recipes-graphics/images/core-image-x11.bb
new file mode 100644
index 000000000..8455bb8ca
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/jpeg/libjpeg-turbo_8d+1.4.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/jpeg/libjpeg-turbo_8d+1.4.2.bb
new file mode 100644
index 000000000..485943194
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/jpeg/libjpeg-turbo_8d+1.4.2.bb
@@ -0,0 +1,41 @@
+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=12;md5=cad955d15145c3fdceec6855e078e953 \
+ file://jpeglib.h;endline=14;md5=dfc803dc51ae21178d1376ec73c4454d \
+ file://djpeg.c;endline=9;md5=e93a8f2061e8a0ac71c7a485c10489e2 \
+"
+
+DEPENDS = "nasm-native"
+
+BASEPV = "${@d.getVar('PV',True).split('+')[1]}"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${BASEPV}.tar.gz"
+SRC_URI[md5sum] = "86b0d5f7507c2e6c21c00219162c3c44"
+SRC_URI[sha256sum] = "521bb5d3043e7ac063ce3026d9a59cc2ab2e9636c655a2515af5f4706122233e"
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/libjpeg-turbo/files/"
+UPSTREAM_CHECK_REGEX = "/libjpeg-turbo/files/(?P<pver>(\d+[\.\-_]*)+)/"
+
+S = "${WORKDIR}/${BPN}-${BASEPV}"
+
+# Drop-in replacement for jpeg
+PROVIDES = "jpeg"
+RPROVIDES_${PN} += "jpeg"
+RREPLACES_${PN} += "jpeg"
+RCONFLICTS_${PN} += "jpeg"
+
+inherit autotools pkgconfig
+
+# Work around missing x32 ABI support
+EXTRA_OECONF_append_class-target = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", "--without-simd", "", 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/import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy/0001-select-platforms-based-on-configuration-results.patch b/import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy/0001-select-platforms-based-on-configuration-results.patch
new file mode 100644
index 000000000..674c8e833
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy/0001-select-platforms-based-on-configuration-results.patch
@@ -0,0 +1,128 @@
+From 3a93150bc0aec86afdb7d053247dc2448925e09a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Wed, 6 May 2015 10:45:22 +0200
+Subject: [PATCH 1/2] select platforms based on configuration results
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Submitted [1]
+
+[1] https://github.com/anholt/libepoxy/pull/52
+
+Signed-off-by: Andreas MĂĽller <schnitzeltony@googlemail.com>
+---
+ configure.ac | 13 +++++--------
+ src/dispatch_common.c | 9 ++++++---
+ src/dispatch_common.h | 9 +++++----
+ 3 files changed, 16 insertions(+), 15 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index a52fc58..bdd70da 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -58,6 +58,10 @@ AC_CHECK_HEADER([KHR/khrplatform.h],
+ # uintptr_t to a void *") by default. Kill that.
+ XORG_TESTSET_CFLAG(CWARNFLAGS, [-Wno-int-conversion])
+
++PKG_CHECK_MODULES(X11, [x11], [x11=yes], [x11=no])
++
++AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes)
++
+ has_znow=yes
+
+ case $host_os in
+@@ -86,7 +90,7 @@ case $host_os in
+ ;;
+ *)
+ build_egl=yes
+- build_glx=yes
++ build_glx=$x11
+ build_wgl=no
+ # On platforms with dlopen, we load everything dynamically and
+ # don't link against a specific window system or GL implementation.
+@@ -144,13 +148,6 @@ esac
+
+ AC_SUBST([VISIBILITY_CFLAGS])
+
+-PKG_CHECK_MODULES(X11, [x11], [x11=yes], [x11=no])
+-if test x$x11 = xno -a x$build_glx = xyes; then
+- AC_MSG_ERROR([libX11 headers (libx11-dev) required to build with GLX support])
+-fi
+-
+-AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes)
+-
+ PKG_CHECK_MODULES(GL, [gl], [gl=yes], [gl=no])
+
+ AC_CONFIG_FILES([
+diff --git a/src/dispatch_common.c b/src/dispatch_common.c
+index 4e34d6e..2ab84ed 100644
+--- a/src/dispatch_common.c
++++ b/src/dispatch_common.c
+@@ -615,10 +615,13 @@ epoxy_get_proc_address(const char *name)
+ #elif defined(__APPLE__)
+ return epoxy_gl_dlsym(name);
+ #else
++#if PLATFORM_HAS_GLX
+ if (epoxy_current_context_is_glx()) {
+ return glXGetProcAddressARB((const GLubyte *)name);
+- } else {
++ } else
++#endif /* PLATFORM_HAS_GLX */
+ #if PLATFORM_HAS_EGL
++ {
+ GLenum egl_api = epoxy_egl_get_current_gl_context_api();
+
+ switch (egl_api) {
+@@ -628,10 +631,10 @@ epoxy_get_proc_address(const char *name)
+ case EGL_NONE:
+ break;
+ }
+-#endif
+ }
++#endif /* PLATFORM_HAS_EGL */
+ errx(1, "Couldn't find current GLX or EGL context.\n");
+-#endif
++#endif /* _WIN32 | __APPLE__*/
+ }
+
+ void
+diff --git a/src/dispatch_common.h b/src/dispatch_common.h
+index 6b8503a..82681e4 100644
+--- a/src/dispatch_common.h
++++ b/src/dispatch_common.h
+@@ -21,12 +21,13 @@
+ * IN THE SOFTWARE.
+ */
+
++#include <config.h>
+ #include <stdbool.h>
+
+ #ifdef _WIN32
+ #define PLATFORM_HAS_EGL 0
+ #define PLATFORM_HAS_GLX 0
+-#define PLATFORM_HAS_WGL 1
++#define PLATFORM_HAS_WGL BUILD_WGL
+ #define EPOXY_IMPORTEXPORT __declspec(dllexport)
+ #elif defined(__APPLE__)
+ #define PLATFORM_HAS_EGL 0
+@@ -34,13 +35,13 @@
+ #define PLATFORM_HAS_WGL 0
+ #define EPOXY_IMPORTEXPORT
+ #elif defined(ANDROID)
+-#define PLATFORM_HAS_EGL 1
++#define PLATFORM_HAS_EGL BUILD_EGL
+ #define PLATFORM_HAS_GLX 0
+ #define PLATFORM_HAS_WGL 0
+ #define EPOXY_IMPORTEXPORT
+ #else
+-#define PLATFORM_HAS_EGL 1
+-#define PLATFORM_HAS_GLX 1
++#define PLATFORM_HAS_EGL BUILD_EGL
++#define PLATFORM_HAS_GLX BUILD_GLX
+ #define PLATFORM_HAS_WGL 0
+ #define EPOXY_IMPORTEXPORT
+ #endif
+--
+1.9.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy/0002-add-an-option-to-disable-glx-support.patch b/import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy/0002-add-an-option-to-disable-glx-support.patch
new file mode 100644
index 000000000..262d6845f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy/0002-add-an-option-to-disable-glx-support.patch
@@ -0,0 +1,42 @@
+From 24868cbfb9dda5f6929dd277c47d35df016e8754 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Wed, 6 May 2015 11:05:48 +0200
+Subject: [PATCH 2/2] add an option to disable glx support
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+this option would help us in yocto to get deterministic build results
+
+Upstream-Status: Submitted [1]
+
+[1] https://github.com/anholt/libepoxy/pull/52
+
+Signed-off-by: Andreas MĂĽller <schnitzeltony@googlemail.com>
+---
+ configure.ac | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index bdd70da..6c7153d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -58,7 +58,14 @@ AC_CHECK_HEADER([KHR/khrplatform.h],
+ # uintptr_t to a void *") by default. Kill that.
+ XORG_TESTSET_CFLAG(CWARNFLAGS, [-Wno-int-conversion])
+
+-PKG_CHECK_MODULES(X11, [x11], [x11=yes], [x11=no])
++AC_ARG_ENABLE([glx],
++ [AS_HELP_STRING([--disable-glx],
++ [disable if you don't want x11/glx support])],
++ [],
++ [enable_glx=yes]
++ )
++
++PKG_CHECK_MODULES(X11, [x11], [x11=$enable_glx], [x11=no])
+
+ AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes)
+
+--
+1.9.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy/no-need-for-python3.patch b/import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy/no-need-for-python3.patch
new file mode 100644
index 000000000..4b8fea58d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy/no-need-for-python3.patch
@@ -0,0 +1,20 @@
+There is no need to use python3 by this package (the python scripts
+that are using during configuration only need python2.7+)
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Gary Thomas <gary@mlbassoc.com>
+--
+Index: git/configure.ac
+===================================================================
+--- git.orig/configure.ac
++++ git/configure.ac
+@@ -40,7 +40,7 @@ m4_ifndef([XORG_MACROS_VERSION],
+ XORG_MACROS_VERSION(1.8)
+ XORG_DEFAULT_OPTIONS
+
+-AC_CHECK_PROGS([PYTHON], [python3 python2 python])
++AC_CHECK_PROGS([PYTHON], [python2 python])
+
+ # Initialize libtool
+ AC_DISABLE_STATIC
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy_git.bb b/import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy_git.bb
new file mode 100644
index 000000000..6c247ccaf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/libepoxy/libepoxy_git.bb
@@ -0,0 +1,27 @@
+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 = " \
+ git://github.com/anholt/libepoxy.git \
+ file://0001-select-platforms-based-on-configuration-results.patch \
+ file://0002-add-an-option-to-disable-glx-support.patch \
+ file://no-need-for-python3.patch \
+"
+SRCREV="e2c33af5bfcfc9d168f9e776156dd47c33f428b3"
+PV = "1.3.1"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig distro_features_check
+# depends on virtual/egl
+REQUIRED_DISTRO_FEATURES = "opengl"
+
+DEPENDS = "util-macros virtual/egl"
+
+PACKAGECONFIG[x11] = "--enable-glx, --disable-glx, virtual/libx11"
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/libfakekey/libfakekey_git.bb b/import-layers/yocto-poky/meta/recipes-graphics/libfakekey/libfakekey_git.bb
new file mode 100644
index 000000000..c60ddea74
--- /dev/null
+++ b/import-layers/yocto-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 = "e327ff049b8503af2dadffa84370a0860b9fb682"
+PV = "0.0+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/import-layers/yocto-poky/meta/recipes-graphics/libmatchbox/libmatchbox/libpng.patch b/import-layers/yocto-poky/meta/recipes-graphics/libmatchbox/libmatchbox/libpng.patch
new file mode 100644
index 000000000..8cd507f79
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/libmatchbox/libmatchbox/libpng.patch
@@ -0,0 +1,69 @@
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From 19c3d242034748b3c60765683e1ff4e2df970205 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Tue, 10 Dec 2013 11:37:32 +0000
+Subject: [PATCH] configure: improve libpng detection
+
+Instead of looking for "libpng12" explicitly though pkg-config and then falling
+back to library hunting, just use pkg-config to find "libpng" which is provided
+by both libpng12 and libpng16.
+
+This also makes the libpng detection deterministic.
+
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+---
+ configure.ac | 29 +++++------------------------
+ 1 file changed, 5 insertions(+), 24 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 8a28076..65d7c79 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -34,7 +34,7 @@ AC_ARG_ENABLE(jpeg,
+ enable_jpeg=$enableval, enable_jpeg=no)
+
+ AC_ARG_ENABLE(png,
+- [ --disable-png disable png support [default=no]],
++ [ --disable-png disable PNG support [default=enabled]],
+ enable_png=$enableval, enable_png=yes )
+
+ AC_ARG_ENABLE(doxygen-docs,
+@@ -156,29 +156,10 @@ fi
+ dnl ------ Check for PNG ---------------------------------------------------
+
+ if test x$enable_png != xno; then
+- AC_MSG_CHECKING(for libpng12)
+- if test x$PKG_CONFIG != xno && $PKG_CONFIG --exists libpng12; then
+- AC_MSG_RESULT(yes)
+- PNG_LIBS=`$PKG_CONFIG --libs libpng12`
+- PNG_CFLAGS=`$PKG_CONFIG --cflags libpng12`
+- AC_DEFINE(USE_PNG, [1], [Use Png])
+- SUPPORTS_PNG=1
+- PNG_REQUIRED="libpng12"
+- else
+- AC_MSG_RESULT(no)
+- # AC_CHECK_HEADERS(png.h, [ have_png_h="yes" ], [ have_png_h="no" ] )
+- AC_CHECK_LIB([png], [png_create_read_struct], [have_png="yes"], [have_png="no"])
+-
+- if test x$have_png=xyes && test x$have_png_h=xyes; then
+- AC_DEFINE(USE_PNG, [1], [Use Png])
+- SUPPORTS_PNG=1
+- PNG_LIBS="-lpng -lz"
+- MB_EXTRA_LIBS="$MB_EXTRA_LIBS $PNG_LIBS"
+- else
+- AC_MSG_WARN([*** Cannot find PNG, disabling support])
+- enable_png=no
+- fi
+- fi
++ PKG_CHECK_MODULES(PNG, libpng)
++ AC_DEFINE(USE_PNG, [1], [Use PNG])
++ SUPPORTS_PNG=1
++ PNG_REQUIRED="libpng"
+ fi
+
+
+--
+1.8.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/libmatchbox/libmatchbox_1.11.bb b/import-layers/yocto-poky/meta/recipes-graphics/libmatchbox/libmatchbox_1.11.bb
new file mode 100644
index 000000000..f2eb67560
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/libmatchbox/libmatchbox_1.11.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+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34 \
+ file://libmb/mbexp.c;endline=20;md5=28c0aef3b23e308464f5dae6a11b0d2f \
+ file://libmb/mbdotdesktop.c;endline=21;md5=5a287156b3207e851c1d68d09c439b51"
+
+DEPENDS = "virtual/libx11 libxext"
+
+SRC_URI = "http://downloads.yoctoproject.org/releases/matchbox/${BPN}/${PV}/${BPN}-${PV}.tar.bz2 \
+ file://libpng.patch"
+
+SRC_URI[md5sum] = "fc6cc807f55a3e7c752d8013176875d7"
+SRC_URI[sha256sum] = "254cab52e304a3512c8df4be59d690cf3921bbb68a28ede7fe26b93534217b53"
+
+inherit autotools pkgconfig distro_features_check
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+PACKAGECONFIG ??= "jpeg png xft xsettings"
+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"
+PACKAGECONFIG[xsettings] = "--enable-xsettings,--disable-xsettings,libxsettings-client"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/libsdl/libsdl-1.2.15/libsdl-1.2.15-xdata32.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/libsdl/libsdl-1.2.15/pkgconfig.patch b/import-layers/yocto-poky/meta/recipes-graphics/libsdl/libsdl-1.2.15/pkgconfig.patch
new file mode 100644
index 000000000..913baa92a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/libsdl/libsdl_1.2.15.bb b/import-layers/yocto-poky/meta/recipes-graphics/libsdl/libsdl_1.2.15.bb
new file mode 100644
index 000000000..9c0ec541e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/libsdl/libsdl_1.2.15.bb
@@ -0,0 +1,70 @@
+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 \
+ "
+
+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.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'directfb', 'directfb', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'opengl', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+PACKAGECONFIG_class-native = "x11"
+PACKAGECONFIG_class-nativesdk = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '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"
+
+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/import-layers/yocto-poky/meta/recipes-graphics/libsdl2/libsdl2/linkage.patch b/import-layers/yocto-poky/meta/recipes-graphics/libsdl2/libsdl2/linkage.patch
new file mode 100644
index 000000000..60185b131
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/libsdl2/libsdl2/linkage.patch
@@ -0,0 +1,46 @@
+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
+RP
+2016/1/16
+
+
+Index: SDL2-2.0.4/configure.in
+===================================================================
+--- SDL2-2.0.4.orig/configure.in
++++ SDL2-2.0.4/configure.in
+@@ -3464,23 +3464,23 @@ done
+
+ VERSION_OBJECTS=`echo $VERSION_SOURCES`
+ VERSION_DEPENDS=`echo $VERSION_SOURCES`
+-VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'`
++VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.lo,g'`
+ VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.rc,\\\\
+-\\$(objects)/\\2.o: \\1/\\2.rc\\\\
++\\$(objects)/\\2.lo: \\1/\\2.rc\\\\
+ \\$(WINDRES) \\$< \\$@,g"`
+
+ SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES`
+ SDLMAIN_DEPENDS=`echo $SDLMAIN_SOURCES`
+-SDLMAIN_OBJECTS=`echo "$SDLMAIN_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'`
++SDLMAIN_OBJECTS=`echo "$SDLMAIN_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
+ SDLMAIN_DEPENDS=`echo "$SDLMAIN_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\
+-\\$(objects)/\\2.o: \\1/\\2.c\\\\
++\\$(objects)/\\2.lo: \\1/\\2.c\\\\
+ \\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
+
+ SDLTEST_OBJECTS=`echo $SDLTEST_SOURCES`
+ SDLTEST_DEPENDS=`echo $SDLTEST_SOURCES`
+-SDLTEST_OBJECTS=`echo "$SDLTEST_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'`
++SDLTEST_OBJECTS=`echo "$SDLTEST_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
+ SDLTEST_DEPENDS=`echo "$SDLTEST_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\
+-\\$(objects)/\\2.o: \\1/\\2.c\\\\
++\\$(objects)/\\2.lo: \\1/\\2.c\\\\
+ \\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
+
+ # Set runtime shared library paths as needed
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/libsdl2/libsdl2_2.0.4.bb b/import-layers/yocto-poky/meta/recipes-graphics/libsdl2/libsdl2_2.0.4.bb
new file mode 100644
index 000000000..428230711
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/libsdl2/libsdl2_2.0.4.bb
@@ -0,0 +1,66 @@
+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=b2304ad7e91711027590d3f102a754b7"
+
+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 \
+ file://linkage.patch"
+
+S = "${WORKDIR}/SDL2-${PV}"
+
+SRC_URI[md5sum] = "44fc4a023349933e7f5d7a582f7b886e"
+SRC_URI[sha256sum] = "da55e540bf6331824153805d58b590a29c39d2d506c6d02fa409aedeab21174b"
+
+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.contains('DISTRO_FEATURES', 'opengl', 'opengl', '', d)}"
+
+PACKAGECONFIG ??= " \
+ ${PACKAGECONFIG_GL} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'directfb', 'directfb', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland gles2', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', 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 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/import-layers/yocto-poky/meta/recipes-graphics/libxsettings-client/libxsettings-client/MIT-style-license b/import-layers/yocto-poky/meta/recipes-graphics/libxsettings-client/libxsettings-client/MIT-style-license
new file mode 100644
index 000000000..628de9830
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/libxsettings-client/libxsettings-client/MIT-style-license
@@ -0,0 +1,22 @@
+/*
+ * Copyright © 2001 Red Hat, Inc.
+ *
+ * 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 Red Hat not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. Red Hat makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT
+ * 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.
+ *
+ * Author: Owen Taylor, Red Hat, Inc.
+ */
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/libxsettings-client/libxsettings-client/link-x11.patch b/import-layers/yocto-poky/meta/recipes-graphics/libxsettings-client/libxsettings-client/link-x11.patch
new file mode 100644
index 000000000..d08d0d5b9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/libxsettings-client/libxsettings-client/link-x11.patch
@@ -0,0 +1,13 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: Xsettings-client-0.10/Makefile.am
+===================================================================
+--- Xsettings-client-0.10.orig/Makefile.am 2008-02-07 14:49:54.000000000 +0000
++++ Xsettings-client-0.10/Makefile.am 2008-02-07 14:50:00.000000000 +0000
+@@ -9,4 +9,4 @@
+
+ libXsettings_client_la_SOURCES= $(source_c) $(source_h)
+
+-libXsettings_client_la_LIBADD = @X_LIBS@
+\ No newline at end of file
++libXsettings_client_la_LIBADD = @X_LIBS@ -lX11
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/libxsettings-client/libxsettings-client/obsolete_automake_macros.patch b/import-layers/yocto-poky/meta/recipes-graphics/libxsettings-client/libxsettings-client/obsolete_automake_macros.patch
new file mode 100644
index 000000000..905d08e61
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/libxsettings-client/libxsettings-client/obsolete_automake_macros.patch
@@ -0,0 +1,14 @@
+Upstream-Status: Pending
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+diff -Nurd Xsettings-client-0.10/configure.ac Xsettings-client-0.10/configure.ac
+--- Xsettings-client-0.10/configure.ac 2003-03-28 12:39:51.000000000 +0200
++++ Xsettings-client-0.10/configure.ac 2013-01-11 07:37:21.491597743 +0200
+@@ -1,7 +1,7 @@
+ # Process this file with autoconf to produce a configure script.
+ AC_INIT(xsettings-client.c)
+ AM_INIT_AUTOMAKE(Xsettings-client, 0.10)
+-AM_CONFIG_HEADER(config.h)
++AC_CONFIG_HEADERS(config.h)
+
+ CFLAGS="-Os -Wall"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/libxsettings-client/libxsettings-client_0.10.bb b/import-layers/yocto-poky/meta/recipes-graphics/libxsettings-client/libxsettings-client_0.10.bb
new file mode 100644
index 000000000..67c5e2777
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/libxsettings-client/libxsettings-client_0.10.bb
@@ -0,0 +1,40 @@
+SUMMARY = "utility functions for the Xsettings protocol"
+DESCRIPTION = "Libraries used for applications making use of the Xsettings configuration \
+setting propagation protocol. Controls setting of double click timeout, drag-and-drop \
+threshold, and default foreground and background colors for all applications running within a \
+desktop."
+HOMEPAGE = "http://matchbox-project.org/sources/optional-dependencies/"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+SECTION = "x/libs"
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7cfac9d2d4dc3694cc7eb605cf32a69b \
+ file://xsettings-client.h;endline=22;md5=7cfac9d2d4dc3694cc7eb605cf32a69b \
+ file://xsettings-common.h;endline=22;md5=7cfac9d2d4dc3694cc7eb605cf32a69b"
+DEPENDS = "virtual/libx11"
+
+PR = "r5"
+
+headers = "xsettings-common.h xsettings-client.h"
+
+SRC_URI = "http://downloads.yoctoproject.org/releases/matchbox/optional-dependencies/Xsettings-client-0.10.tar.gz \
+ file://MIT-style-license \
+ file://link-x11.patch;apply=yes \
+ file://obsolete_automake_macros.patch \
+"
+
+SRC_URI[md5sum] = "c14aa9db6c097e0306dac97fb7da1add"
+SRC_URI[sha256sum] = "f274a4bc969ae192994a856b7f786c6fce96bae77f96c1c2b71dd97599e06e43"
+
+S = "${WORKDIR}/Xsettings-client-0.10"
+
+inherit autotools gettext distro_features_check
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+do_configure_prepend() {
+ # This package doesn't ship with its own COPYING file and
+ # autotools will install a GPLv2 one instead of the actual MIT-style license here.
+ # Add the correct license here to avoid confusion.
+ cp -f ${WORKDIR}/MIT-style-license ${S}/COPYING
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/matchbox-session/matchbox-session/matchbox-session b/import-layers/yocto-poky/meta/recipes-graphics/matchbox-session/matchbox-session/matchbox-session
new file mode 100644
index 000000000..4d6caa0c5
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/matchbox-session/matchbox-session_0.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/matchbox-session/matchbox-session_0.1.bb
new file mode 100644
index 000000000..cbaf05436
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/matchbox-wm/matchbox-wm/kbdconfig b/import-layers/yocto-poky/meta/recipes-graphics/matchbox-wm/matchbox-wm/kbdconfig
new file mode 100644
index 000000000..239da8f57
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/matchbox-wm/matchbox-wm_git.bb b/import-layers/yocto-poky/meta/recipes-graphics/matchbox-wm/matchbox-wm_git.bb
new file mode 100644
index 000000000..aa768280a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/matchbox-wm/matchbox-wm_git.bb
@@ -0,0 +1,40 @@
+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 = "8178e70d5c742c4cd63b51df228cc8aa3594d518"
+PV = "1.2+git${SRCPV}"
+
+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/import-layers/yocto-poky/meta/recipes-graphics/menu-cache/menu-cache_1.0.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/menu-cache/menu-cache_1.0.1.bb
new file mode 100644
index 000000000..eb80cd3bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/menu-cache/menu-cache_1.0.1.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 intltool-native libfm-extra"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/lxde/menu-cache-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "a856ba860b16fdc8c69ee784bc4ade36"
+SRC_URI[sha256sum] = "0ac72649919946070258320aafc320467dd040bcef7b3a225e2ab7241ddffd59"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/lxde/files/menu-cache/1.0/"
+
+inherit autotools gettext pkgconfig gtk-doc
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/replace_glibc_check_with_linux.patch b/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/replace_glibc_check_with_linux.patch
new file mode 100644
index 000000000..e4461ef17
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/replace_glibc_check_with_linux.patch
@@ -0,0 +1,17 @@
+endianness check is OS wide and not specific to libc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: mesa-11.1.1/src/gallium/include/pipe/p_config.h
+===================================================================
+--- mesa-11.1.1.orig/src/gallium/include/pipe/p_config.h
++++ mesa-11.1.1/src/gallium/include/pipe/p_config.h
+@@ -130,7 +130,7 @@
+ * Endian detection.
+ */
+
+-#ifdef __GLIBC__
++#if defined(__linux__)
+ #include <endian.h>
+
+ #if __BYTE_ORDER == __LITTLE_ENDIAN
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/libglu_9.0.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/mesa/libglu_9.0.0.bb
new file mode 100644
index 000000000..010998d92
--- /dev/null
+++ b/import-layers/yocto-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 = "ftp://ftp.freedesktop.org/pub/mesa/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"
+
+# Remove the mesa-glu dependency in mesa-glu-dev, as mesa-glu is empty
+RDEPENDS_${PN}-dev = ""
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0001-mesa-demos-Add-missing-data-files.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0002-Correctly-implement-with-AC_WITH-glut-so-that-withou.patch b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0002-Correctly-implement-with-AC_WITH-glut-so-that-withou.patch
new file mode 100644
index 000000000..09054cb75
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0002-Correctly-implement-with-AC_WITH-glut-so-that-withou.patch
@@ -0,0 +1,57 @@
+From 36829a8d7ad2888515fbee95c2a70b3d636d7538 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Wed, 9 Jul 2014 14:30:33 +0200
+Subject: [PATCH 2/9] Correctly implement with AC_WITH(glut) so that
+ --without-glut works.
+
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+Upstream-Status: Submitted (https://patchwork.freedesktop.org/patch/64417/)
+
+---
+ configure.ac | 26 +++++++++++++++-----------
+ 1 file changed, 15 insertions(+), 11 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index c4ee12b..9445424 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -67,21 +67,25 @@ DEMO_CFLAGS="$DEMO_CFLAGS $GL_CFLAGS"
+ DEMO_LIBS="$DEMO_LIBS $GL_LIBS"
+
+ dnl Check for GLUT
+-GLUT_CFLAGS=""
+-GLUT_LIBS=-lglut
+-glut_enabled=yes
++glut_enabled=no
+ AC_ARG_WITH([glut],
+ [AS_HELP_STRING([--with-glut=DIR],
+ [glut install directory])],
+ [GLUT_CFLAGS="-I$withval/include"
+- GLUT_LIBS="-L$withval/lib -lglut"])
+-AC_CHECK_HEADER([GL/glut.h],
+- [],
+- [glut_enabled=no])
+-AC_CHECK_LIB([glut],
+- [glutInit],
+- [],
+- [glut_enabled=no])
++ GLUT_LIBS="-L$withval/lib -lglut"],
++ [GLUT_CFLAGS=""
++ GLUT_LIBS="-lglut"]
++ )
++AS_IF([test "x$with_glut" != xno],
++ [AC_CHECK_HEADER([GL/glut.h],
++ [],
++ [glut_enabled=no])
++ AC_CHECK_LIB([glut],
++ [glutInit],
++ [],
++ [glut_enabled=no])
++ glut_enabled=yes
++])
+
+ dnl Check for FreeGLUT 2.6 or later
+ AC_EGREP_HEADER([glutInitContextProfile],
+--
+2.0.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch
new file mode 100644
index 000000000..6b58c2b77
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch
@@ -0,0 +1,424 @@
+From b25e9c675cf560b8b037dc855c6b3b1d09957867 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 3/9] 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>
+---
+ configure.ac | 49 ++++++++++++++++++++---------
+ src/Makefile.am | 14 ++++++---
+ src/demos/Makefile.am | 73 ++++++++++++++++++++++++-------------------
+ src/egl/Makefile.am | 8 +++--
+ src/egl/opengles1/Makefile.am | 44 +++++++++++++++-----------
+ src/egl/opengles2/Makefile.am | 33 ++++++++++---------
+ 6 files changed, 135 insertions(+), 86 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 9445424..bc4c8d1 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..754c47c 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -23,14 +23,18 @@
+ # 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 +39,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 7a9828d..3455e75 100644
+--- a/src/egl/opengles1/Makefile.am
++++ b/src/egl/opengles1/Makefile.am
+@@ -36,28 +36,43 @@ AM_LDFLAGS = \
+ $(EGL_LIBS) \
+ -lm
+
++noinst_PROGRAMS =
++
+ if HAVE_EGL
+ if HAVE_GLESV1
+-noinst_PROGRAMS = \
+- bindtex \
+- clear \
++noinst_PROGRAMS += \
+ drawtex_screen \
++ gears_screen \
++ torus_screen \
++ tri_screen
++
++drawtex_screen_SOURCES = drawtex.c
++gears_screen_SOURCES = gears.c
++torus_screen_SOURCES = torus.c
++tri_screen_SOURCES = tri.c
++
++drawtex_screen_LDADD = ../eglut/libeglut_screen.la
++gears_screen_LDADD = ../eglut/libeglut_screen.la
++torus_screen_LDADD = ../eglut/libeglut_screen.la
++tri_screen_LDADD = ../eglut/libeglut_screen.la
++
++if HAVE_X11
++noinst_PROGRAMS += \
++ clear
++
++bin_PROGRAMS = \
++ bindtex \
+ drawtex_x11 \
+ eglfbdev \
+ es1_info \
+- gears_screen \
+ gears_x11 \
+ msaa \
+ pbuffer\
+ render_tex \
+ texture_from_pixmap \
+- torus_screen \
+ torus_x11 \
+- tri_screen \
+ tri_x11 \
+ two_win
+-endif
+-endif
+
+ bindtex_LDADD = $(X11_LIBS)
+ es1_info_LDADD = $(X11_LIBS)
+@@ -71,22 +86,15 @@ two_win_LDADD = $(X11_LIBS)
+ clear_LDADD = ../eglut/libeglut_x11.la $(EGL_LIBS) $(X11_LIBS)
+ clear_LDFLAGS =
+
+-drawtex_screen_SOURCES = drawtex.c
+-gears_screen_SOURCES = gears.c
+-torus_screen_SOURCES = torus.c
+-tri_screen_SOURCES = tri.c
+-
+ drawtex_x11_SOURCES = drawtex.c
+ gears_x11_SOURCES = gears.c
+ torus_x11_SOURCES = torus.c
+ tri_x11_SOURCES = tri.c
+
+-drawtex_screen_LDADD = ../eglut/libeglut_screen.la
+-gears_screen_LDADD = ../eglut/libeglut_screen.la
+-torus_screen_LDADD = ../eglut/libeglut_screen.la
+-tri_screen_LDADD = ../eglut/libeglut_screen.la
+-
+ 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 41c1b80..74af460 100644
+--- a/src/egl/opengles2/Makefile.am
++++ b/src/egl/opengles2/Makefile.am
+@@ -36,26 +36,29 @@ AM_LDFLAGS = \
+ if HAVE_EGL
+ if HAVE_GLESV2
+ bin_PROGRAMS = \
+- es2_info \
+- es2gears_screen \
+- es2gears_x11 \
+- es2tri
++ es2gears_screen
++
++es2gears_screen_SOURCES = es2gears.c
++es2gears_screen_LDADD = ../eglut/libeglut_screen.la
++
+ if HAVE_WAYLAND
+ bin_PROGRAMS += es2gears_wayland
+-endif
+-endif
+-endif
+
+-es2_info_LDADD = $(X11_LIBS)
+-es2tri_LDADD = $(X11_LIBS)
++es2gears_wayland_SOURCES = es2gears.c
++es2gears_wayland_LDADD = ../eglut/libeglut_wayland.la
++endif
+
+-es2gears_screen_SOURCES = es2gears.c
++if HAVE_X11
++bin_PROGRAMS += \
++ es2tri \
++ es2_info \
++ es2gears_x11
+
++es2_info_LDADD = $(X11_LIBS)
+ es2gears_x11_SOURCES = es2gears.c
+-
+-es2gears_screen_LDADD = ../eglut/libeglut_screen.la
+-
+ 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.0.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0005-Fix-build-when-EGL_MESA_screen_surface-extension-isn.patch b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0005-Fix-build-when-EGL_MESA_screen_surface-extension-isn.patch
new file mode 100644
index 000000000..aac2a3729
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0005-Fix-build-when-EGL_MESA_screen_surface-extension-isn.patch
@@ -0,0 +1,267 @@
+From 453353a221de9c64479f4372565d2cd8591b36cc Mon Sep 17 00:00:00 2001
+From: Frank Binns <frank.binns@imgtec.com>
+Date: Fri, 29 Jun 2012 11:26:04 +0100
+Subject: [PATCH 5/9] Fix build when EGL_MESA_screen_surface extension isn't
+ present
+
+The EGL demos won't build against EGL implementations that don't support
+the EGL_MESA_screen_surface extension. Fix this, in most cases, by
+wrapping relevant bits of code in #ifdef EGL_MESA_screen_surface.
+
+Signed-off-by: Frank Binns <frank.binns@imgtec.com>
+
+Applied and fixed up in Yocto by...
+
+Integrated-by: Tom Zanussi <tom.zanussi@linux.intel.com>
+
+Upstream-Status: Pending
+---
+ src/egl/eglut/eglut.c | 9 +++++++--
+ src/egl/eglut/eglut_screen.c | 14 ++++++++++++++
+ src/egl/opengl/demo1.c | 2 ++
+ src/egl/opengl/demo2.c | 7 ++++++-
+ src/egl/opengl/demo3.c | 7 ++++++-
+ 5 files changed, 35 insertions(+), 4 deletions(-)
+
+diff --git a/src/egl/eglut/eglut.c b/src/egl/eglut/eglut.c
+index 2ee6f15..f6a2ad4 100644
+--- a/src/egl/eglut/eglut.c
++++ b/src/egl/eglut/eglut.c
+@@ -76,8 +76,9 @@ _eglutNow(void)
+ static void
+ _eglutDestroyWindow(struct eglut_window *win)
+ {
+- if (_eglut->surface_type != EGL_PBUFFER_BIT &&
+- _eglut->surface_type != EGL_SCREEN_BIT_MESA)
++
++ if (_eglut->surface_type == EGL_WINDOW_BIT ||
++ _eglut->surface_type == EGL_PIXMAP_BIT)
+ eglDestroySurface(_eglut->dpy, win->surface);
+
+ _eglutNativeFiniWindow(win);
+@@ -175,7 +176,9 @@ _eglutCreateWindow(const char *title, int x, int y, int w, int h)
+ win->config, win->native.u.pixmap, NULL);
+ break;
+ case EGL_PBUFFER_BIT:
++#ifdef EGL_MESA_screen_surface
+ case EGL_SCREEN_BIT_MESA:
++#endif
+ win->surface = win->native.u.surface;
+ break;
+ default:
+@@ -289,8 +292,10 @@ eglutDestroyWindow(int win)
+ if (window->index != win)
+ return;
+
++#ifdef EGL_MESA_screen_surface
+ /* XXX it causes some bug in st/egl KMS backend */
+ if ( _eglut->surface_type != EGL_SCREEN_BIT_MESA)
++#endif
+ eglMakeCurrent(_eglut->dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+
+ _eglutDestroyWindow(_eglut->current);
+diff --git a/src/egl/eglut/eglut_screen.c b/src/egl/eglut/eglut_screen.c
+index 021a8f1..094a4e2 100644
+--- a/src/egl/eglut/eglut_screen.c
++++ b/src/egl/eglut/eglut_screen.c
+@@ -35,26 +35,33 @@
+
+ #define MAX_MODES 100
+
++#ifdef EGL_MESA_screen_surface
+ static EGLScreenMESA kms_screen;
+ static EGLModeMESA kms_mode;
+ static EGLint kms_width, kms_height;
++#endif
+
+ void
+ _eglutNativeInitDisplay(void)
+ {
++#ifdef EGL_MESA_screen_surface
+ _eglut->native_dpy = EGL_DEFAULT_DISPLAY;
+ _eglut->surface_type = EGL_SCREEN_BIT_MESA;
++#endif
+ }
+
+ void
+ _eglutNativeFiniDisplay(void)
+ {
++#ifdef EGL_MESA_screen_surface
+ kms_screen = 0;
+ kms_mode = 0;
+ kms_width = 0;
+ kms_height = 0;
++#endif
+ }
+
++#ifdef EGL_MESA_screen_surface
+ static void
+ init_kms(void)
+ {
+@@ -94,19 +101,23 @@ init_kms(void)
+ kms_width = width;
+ kms_height = height;
+ }
++#endif
+
+ void
+ _eglutNativeInitWindow(struct eglut_window *win, const char *title,
+ int x, int y, int w, int h)
+ {
++#ifdef EGL_MESA_screen_surface
+ EGLint surf_attribs[16];
+ EGLint i;
++#endif
+ const char *exts;
+
+ exts = eglQueryString(_eglut->dpy, EGL_EXTENSIONS);
+ if (!exts || !strstr(exts, "EGL_MESA_screen_surface"))
+ _eglutFatal("EGL_MESA_screen_surface is not supported\n");
+
++#ifdef EGL_MESA_screen_surface
+ init_kms();
+
+ i = 0;
+@@ -128,14 +139,17 @@ _eglutNativeInitWindow(struct eglut_window *win, const char *title,
+
+ win->native.width = kms_width;
+ win->native.height = kms_height;
++#endif
+ }
+
+ void
+ _eglutNativeFiniWindow(struct eglut_window *win)
+ {
++#ifdef EGL_MESA_screen_surface
+ eglShowScreenSurfaceMESA(_eglut->dpy,
+ kms_screen, EGL_NO_SURFACE, 0);
+ eglDestroySurface(_eglut->dpy, win->native.u.surface);
++#endif
+ }
+
+ void
+diff --git a/src/egl/opengl/demo1.c b/src/egl/opengl/demo1.c
+index d892734..3a3564c 100644
+--- a/src/egl/opengl/demo1.c
++++ b/src/egl/opengl/demo1.c
+@@ -18,6 +18,7 @@
+ static void
+ TestScreens(EGLDisplay dpy)
+ {
++#ifdef EGL_MESA_screen_surface
+ #define MAX 8
+ EGLScreenMESA screens[MAX];
+ EGLint numScreens;
+@@ -28,6 +29,7 @@ TestScreens(EGLDisplay dpy)
+ for (i = 0; i < numScreens; i++) {
+ printf(" Screen %d handle: %d\n", i, (int) screens[i]);
+ }
++#endif
+ }
+
+ /**
+diff --git a/src/egl/opengl/demo2.c b/src/egl/opengl/demo2.c
+index 505b474..bfef59e 100644
+--- a/src/egl/opengl/demo2.c
++++ b/src/egl/opengl/demo2.c
+@@ -16,6 +16,7 @@
+
+ /*#define FRONTBUFFER*/
+
++#ifdef EGL_MESA_screen_surface
+ static void _subset_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2,
+ GLfloat r, GLfloat g, GLfloat b)
+ {
+@@ -95,12 +96,13 @@ TestScreens(EGLDisplay dpy)
+ printf(" Screen %d handle: %d\n", i, (int) screens[i]);
+ }
+ }
+-
++#endif
+
+ int
+ main(int argc, char *argv[])
+ {
+ int maj, min;
++#ifdef EGL_MESA_screen_surface
+ EGLContext ctx;
+ EGLSurface pbuffer, screen_surf;
+ EGLConfig configs[10];
+@@ -115,6 +117,7 @@ main(int argc, char *argv[])
+ EGLModeMESA mode;
+ EGLScreenMESA screen;
+ EGLint count;
++#endif
+
+ EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
+ assert(d);
+@@ -132,6 +135,7 @@ main(int argc, char *argv[])
+ exit(1);
+ }
+
++#ifdef EGL_MESA_screen_surface
+ eglGetConfigs(d, configs, 10, &numConfigs);
+ printf("Got %d EGL configs:\n", numConfigs);
+ for (i = 0; i < numConfigs; i++) {
+@@ -211,6 +215,7 @@ main(int argc, char *argv[])
+ eglDestroySurface(d, pbuffer);
+ eglDestroyContext(d, ctx);
+ eglTerminate(d);
++#endif
+
+ return 0;
+ }
+diff --git a/src/egl/opengl/demo3.c b/src/egl/opengl/demo3.c
+index f84ca23..31b5d8b 100644
+--- a/src/egl/opengl/demo3.c
++++ b/src/egl/opengl/demo3.c
+@@ -46,7 +46,7 @@ GLubyte OpenGL_bits[] = {
+ 0x3e, 0x00, 0x00, 0xf8, 0x0c, 0x00,
+ };
+
+-
++#ifdef EGL_MESA_screen_surface
+ static void Init(void)
+ {
+
+@@ -551,11 +551,13 @@ write_ppm(const char *filename, const GLubyte *buffer, int width, int height)
+ fclose(f);
+ }
+ }
++#endif
+
+ int
+ main(int argc, char *argv[])
+ {
+ int maj, min;
++#ifdef EGL_MESA_screen_surface
+ EGLContext ctx;
+ EGLSurface screen_surf;
+ EGLConfig configs[10];
+@@ -566,6 +568,7 @@ main(int argc, char *argv[])
+ const GLubyte *bitmap;
+ EGLint screenAttribs[32];
+ EGLint i;
++#endif
+
+ EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
+ assert(d);
+@@ -583,6 +586,7 @@ main(int argc, char *argv[])
+ exit(1);
+ }
+
++#ifdef EGL_MESA_screen_surface
+ eglGetConfigs(d, configs, 10, &numConfigs);
+ eglGetScreensMESA(d, &screen, 1, &count);
+ eglGetModesMESA(d, screen, &mode, 1, &count);
+@@ -642,6 +646,7 @@ main(int argc, char *argv[])
+ eglDestroySurface(d, screen_surf);
+ eglDestroyContext(d, ctx);
+ eglTerminate(d);
++#endif
+
+ return 0;
+ }
+--
+2.0.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0006-Query-display-for-EGL_MESA_screen_surface-extension-.patch b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0006-Query-display-for-EGL_MESA_screen_surface-extension-.patch
new file mode 100644
index 000000000..12e0805f1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0006-Query-display-for-EGL_MESA_screen_surface-extension-.patch
@@ -0,0 +1,41 @@
+From 6a19dba1d275579c73e7763b0554410ff4e1e650 Mon Sep 17 00:00:00 2001
+From: Frank Binns <frank.binns@imgtec.com>
+Date: Fri, 29 Jun 2012 12:00:26 +0100
+Subject: [PATCH 6/9] Query display for EGL_MESA_screen_surface extension
+ before using it
+
+This code makes heavy use of the EGL_MESA_screen_surface extension so
+check the display to determine if it's supported by the underlying EGL
+implementation. If it doesn't then bail.
+
+Signed-off-by: Frank Binns <frank.binns@imgtec.com>
+
+Applied and fixed up in Yocto by...
+
+Integrated-by: Tom Zanussi <tom.zanussi@linux.intel.com>
+
+Upstream-Status: Pending
+---
+ src/egl/opengl/demo1.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/egl/opengl/demo1.c b/src/egl/opengl/demo1.c
+index 3a3564c..06e2138 100644
+--- a/src/egl/opengl/demo1.c
++++ b/src/egl/opengl/demo1.c
+@@ -110,6 +110,12 @@ main(int argc, char *argv[])
+ printf("EGL version = %d.%d\n", maj, min);
+ printf("EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR));
+
++ if (!strstr(eglQueryString(d, EGL_EXTENSIONS),
++ "EGL_MESA_screen_surface")) {
++ printf("EGL_MESA_screen_surface is not supported\n");
++ exit(1);
++ }
++
+ eglGetConfigs(d, NULL, 0, &numConfigs);
+ configs = malloc(sizeof(*configs) *numConfigs);
+ eglGetConfigs(d, configs, numConfigs, &numConfigs);
+--
+2.0.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0007-Install-few-more-test-programs.patch b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0007-Install-few-more-test-programs.patch
new file mode 100644
index 000000000..89d2fac4f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0007-Install-few-more-test-programs.patch
@@ -0,0 +1,74 @@
+From d930b2da57f7c9efb80c8cef8f8adad15bbbc0d3 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 7/9] Install few more test programs
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.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 0c7228f..87b2f1a 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 = \
+ demo1 \
+ demo2 \
+ demo3 \
+diff --git a/src/egl/opengles1/Makefile.am b/src/egl/opengles1/Makefile.am
+index 3455e75..516e516 100644
+--- a/src/egl/opengles1/Makefile.am
++++ b/src/egl/opengles1/Makefile.am
+@@ -36,11 +36,11 @@ AM_LDFLAGS = \
+ $(EGL_LIBS) \
+ -lm
+
+-noinst_PROGRAMS =
++bin_PROGRAMS =
+
+ if HAVE_EGL
+ if HAVE_GLESV1
+-noinst_PROGRAMS += \
++bin_PROGRAMS += \
+ drawtex_screen \
+ gears_screen \
+ torus_screen \
+@@ -57,10 +57,8 @@ torus_screen_LDADD = ../eglut/libeglut_screen.la
+ tri_screen_LDADD = ../eglut/libeglut_screen.la
+
+ if HAVE_X11
+-noinst_PROGRAMS += \
+- clear
+-
+-bin_PROGRAMS = \
++bin_PROGRAMS += \
++ clear \
+ bindtex \
+ drawtex_x11 \
+ eglfbdev \
+diff --git a/src/egl/openvg/Makefile.am b/src/egl/openvg/Makefile.am
+index 7318a43..b545225 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 = \
+ lion_screen \
+ sp_screen \
+ $(EGL_X11_DEMOS)
+--
+2.0.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0010-sharedtex_mt-fix-rendering-thread-hang.patch b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0010-sharedtex_mt-fix-rendering-thread-hang.patch
new file mode 100644
index 000000000..04e1b446f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos/0010-sharedtex_mt-fix-rendering-thread-hang.patch
@@ -0,0 +1,43 @@
+From 525fa9ded72d22b53c5eb366f61e2ac1d407a2db Mon Sep 17 00:00:00 2001
+From: Awais Belal <awais_belal@mentor.com>
+Date: Thu, 8 Oct 2015 13:49:31 +0500
+Subject: [PATCH] sharedtex_mt: fix rendering thread hang
+
+XNextEvent is a blocking call which locks up the display mutex
+this causes the rendering threads to hang when they try call
+glXSwapBuffers() as that tries to take the same mutex in
+underlying calls through XCopyArea().
+So we only go to XNextEvent when it has at least one event
+and we wouldn't lock indefinitely.
+
+Signed-off-by: Awais Belal <awais_belal@mentor.com>
+Upstream-Status: Backport (2b304e765695d385fd3bf414e6e444020bedb0a8)
+
+---
+ src/xdemos/sharedtex_mt.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/xdemos/sharedtex_mt.c b/src/xdemos/sharedtex_mt.c
+index a90903a..1d503c4 100644
+--- a/src/xdemos/sharedtex_mt.c
++++ b/src/xdemos/sharedtex_mt.c
+@@ -420,9 +420,14 @@ Resize(struct window *h, unsigned int width, unsigned int height)
+ static void
+ EventLoop(void)
+ {
++ int i;
++ XEvent event;
+ while (1) {
+- int i;
+- XEvent event;
++ /* Do we have an event? */
++ if (XPending(gDpy) == 0) {
++ usleep(10000);
++ continue;
++ }
+ XNextEvent(gDpy, &event);
+ for (i = 0; i < NumWindows; i++) {
+ struct window *h = &Windows[i];
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos_8.2.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos_8.2.0.bb
new file mode 100644
index 000000000..557b8c65d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-demos_8.2.0.bb
@@ -0,0 +1,60 @@
+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 = "ftp://ftp.freedesktop.org/pub/mesa/demos/${PV}/${BPN}-${PV}.tar.bz2 \
+ file://0001-mesa-demos-Add-missing-data-files.patch \
+ file://0002-Correctly-implement-with-AC_WITH-glut-so-that-withou.patch \
+ file://0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch \
+ file://0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch \
+ file://0005-Fix-build-when-EGL_MESA_screen_surface-extension-isn.patch \
+ file://0006-Query-display-for-EGL_MESA_screen_surface-extension-.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://0010-sharedtex_mt-fix-rendering-thread-hang.patch \
+"
+SRC_URI[md5sum] = "72613a2c8c013716db02e3ff59d29061"
+SRC_URI[sha256sum] = "e4bfecb5816ddd4b7b37c1bc876b63f1f7f06fda5879221a9774d0952f90ba92"
+
+inherit autotools pkgconfig distro_features_check
+# depends on virtual/egl, virtual/libgl ...
+REQUIRED_DISTRO_FEATURES = "opengl"
+
+PACKAGECONFIG ?= "drm osmesa freetype2 gbm egl gles1 gles2 \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 glew glu', '', d)}"
+
+# The Wayland code doesn't work with Wayland 1.0, so disable it for now
+#${@bb.utils.contains('DISTRO_FEATURES', 'wayland', '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,"
+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"
+
+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/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-gl_11.1.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-gl_11.1.1.bb
new file mode 100644
index 000000000..fc2bca998
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-gl_11.1.1.bb
@@ -0,0 +1,13 @@
+require mesa_${PV}.bb
+
+SUMMARY += " (OpenGL only, no EGL/GLES)"
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/mesa:"
+
+PROVIDES = "virtual/libgl virtual/mesa"
+
+S = "${WORKDIR}/mesa-${PV}"
+
+PACKAGECONFIG ??= "dri ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+
+EXCLUDE_FROM_WORLD = "1"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa.inc b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa.inc
new file mode 100644
index 000000000..442479ae6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa.inc
@@ -0,0 +1,188 @@
+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=6a23445982a7a972ac198e93cc1cb3de"
+
+PE = "2"
+
+DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native udev"
+
+PROVIDES = "virtual/libgl virtual/libgles1 virtual/libgles2 virtual/egl virtual/mesa"
+
+inherit autotools pkgconfig pythonnative gettext distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "opengl"
+
+EXTRA_OECONF = "--enable-shared-glapi"
+
+PACKAGECONFIG ??= "egl gles dri ${MESA_CRYPTO} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}\
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)}\
+ "
+
+X11_DEPS = "xf86driproto glproto virtual/libx11 libxext libxxf86vm libxdamage libxfixes"
+PACKAGECONFIG[x11] = "--enable-glx-tls,--disable-glx,${X11_DEPS}"
+PACKAGECONFIG[xvmc] = "--enable-xvmc,--disable-xvmc,libxvmc"
+PACKAGECONFIG[wayland] = ",,wayland-native wayland"
+
+DRIDRIVERS = "swrast"
+DRIDRIVERS_append_x86 = ",radeon,r200,nouveau,i965,i915"
+DRIDRIVERS_append_x86-64 = ",radeon,r200,nouveau,i965,i915"
+PACKAGECONFIG[dri] = "--enable-dri --with-dri-drivers=${DRIDRIVERS} --enable-gbm, --disable-dri, dri2proto libdrm"
+PACKAGECONFIG[dri3] = "--enable-dri3, --disable-dri3, dri3proto presentproto libxshmfence"
+
+PACKAGECONFIG[gles] = "--enable-gles1 --enable-gles2, --disable-gles1 --disable-gles2"
+
+EGL_PLATFORMS = "drm"
+EGL_PLATFORMS .="${@bb.utils.contains('PACKAGECONFIG', 'x11', ',x11', '', d)}"
+EGL_PLATFORMS .="${@bb.utils.contains('PACKAGECONFIG', 'wayland', ',wayland', '', d)}"
+PACKAGECONFIG[egl] = "--enable-egl --with-egl-platforms=${EGL_PLATFORMS}, --disable-egl"
+
+GALLIUMDRIVERS = "swrast"
+GALLIUMDRIVERS_LLVM33 = "${@bb.utils.contains('PACKAGECONFIG', 'r600', 'radeonsi,r600', '', d)}"
+PACKAGECONFIG[r600] = ""
+GALLIUMDRIVERS_LLVM33_ENABLED = "${@base_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] = "--with-gallium-drivers=${GALLIUMDRIVERS}, --without-gallium-drivers"
+MESA_LLVM_RELEASE ?= "3.3"
+PACKAGECONFIG[gallium-llvm] = "--enable-gallium-llvm --enable-llvm-shared-libs, --disable-gallium-llvm, llvm${MESA_LLVM_RELEASE} \
+ ${@'elfutils' if ${GALLIUMDRIVERS_LLVM33_ENABLED} else ''}"
+export WANT_LLVM_RELEASE = "${MESA_LLVM_RELEASE}"
+PACKAGECONFIG[xa] = "--enable-xa, --disable-xa"
+
+# Mesa requires one of the following crypto implementation, pick one of them
+MESA_CRYPTO ??= "openssl"
+PACKAGECONFIG[openssl] = "--with-sha1=libcrypto,,openssl"
+PACKAGECONFIG[nettle] = "--with-sha1=libnettle,,nettle"
+PACKAGECONFIG[gcrypt] = "--with-sha1=libgcrypt,,libgcrypt"
+
+# llvmpipe is slow if compiled with -fomit-frame-pointer (e.g. -O2)
+FULL_OPTIMIZATION_append = " -fno-omit-frame-pointer"
+
+# Multiple virtual/gl providers being built breaks staging
+EXCLUDE_FROM_WORLD = "1"
+
+# Remove the mesa dependency on mesa-dev, as mesa is empty
+RDEPENDS_${PN}-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 \
+ libxvmcsoftpipe libxvmcsoftpipe-dev \
+ libxatracker libxatracker-dev \
+ mesa-megadriver \
+ "
+
+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
+}
+
+# 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', True) 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 = os.path.join(d.getVar('libdir', True), "dri")
+ dri_pkgs = os.listdir(d.getVar('PKGD', True) + 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', True), "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_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_libxvmcsoftpipe = "${libdir}/libXvMCsoftpipe.so.*"
+FILES_libxatracker = "${libdir}/libxatracker.so.*"
+
+FILES_${PN}-dev = "${libdir}/pkgconfig/dri.pc"
+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}/osmesa.h ${libdir}/pkgconfig/osmesa.pc"
+FILES_libwayland-egl-dev = "${libdir}/pkgconfig/wayland-egl.pc ${libdir}/libwayland-egl.*"
+FILES_libxvmcsoftpipe-dev = "${libdir}/libXvMCsoftpipe.so ${libdir}/libXvMCsoftpipe.la"
+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/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa_11.1.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa_11.1.1.bb
new file mode 100644
index 000000000..502afcfd8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa_11.1.1.bb
@@ -0,0 +1,16 @@
+require ${BPN}.inc
+
+SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/${PV}/mesa-${PV}.tar.xz \
+ file://replace_glibc_check_with_linux.patch \
+"
+
+SRC_URI[md5sum] = "1043dfb907beecb2a761272455960427"
+SRC_URI[sha256sum] = "64db074fc514136b5fb3890111f0d50604db52f0b1e94ba3fcb0fe8668a7fd20"
+
+#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/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa_git.bb b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa_git.bb
new file mode 100644
index 000000000..c0345178c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa_git.bb
@@ -0,0 +1,22 @@
+require ${BPN}.inc
+
+DEFAULT_PREFERENCE = "-1"
+
+SRCREV = "ea0d1f575c214c09ba3df12644a960e86e031766"
+PV = "10.5.4+git${SRCPV}"
+
+SRC_URI = "git://anongit.freedesktop.org/git/mesa/mesa;branch=10.5"
+
+S = "${WORKDIR}/git"
+
+DEPENDS += "python-mako-native"
+
+inherit pythonnative
+
+#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/import-layers/yocto-poky/meta/recipes-graphics/mini-x-session/files/mini-x-session b/import-layers/yocto-poky/meta/recipes-graphics/mini-x-session/files/mini-x-session
new file mode 100644
index 000000000..dca655a91
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/mini-x-session/mini-x-session_0.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/mini-x-session/mini-x-session_0.1.bb
new file mode 100644
index 000000000..4e89d631c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/mx/mx-1.0/fix-build-dir.patch b/import-layers/yocto-poky/meta/recipes-graphics/mx/mx-1.0/fix-build-dir.patch
new file mode 100644
index 000000000..3c8a83202
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/mx/mx-1.0/fix-build-dir.patch
@@ -0,0 +1,46 @@
+Fix build for S != B
+
+This patch is specific to version 1.4.x
+Upstream-Status: Submitted @ https://github.com/clutter-project/mx/issues/81
+Signed-off-by: Tomas Frydrych <tomas@sleepfive.com>
+--
+Index: git/docs/reference/libmx-gtk/Makefile.am
+===================================================================
+--- git.orig/docs/reference/libmx-gtk/Makefile.am 2013-05-08 15:07:02.027154788 +0100
++++ git/docs/reference/libmx-gtk/Makefile.am 2013-05-08 15:14:33.684318650 +0100
+@@ -1,3 +1,6 @@
++EXTRA_DIST=
++CLEANFILES=
++
+ ## Process this file with automake to produce Makefile.in
+
+ # We require automake 1.6 at least.
+@@ -77,7 +80,7 @@
+ GTKDOC_LIBS=$(MX_LIBS) $(top_builddir)/mx-gtk/libmx-gtk-$(MX_API_VERSION).la
+
+ # This includes the standard gtk-doc make rules, copied by gtkdocize.
+-include $(top_srcdir)/gtk-doc.make
++include $(top_builddir)/gtk-doc.make
+
+ # Other files to distribute
+ EXTRA_DIST += version.xml.in
+Index: git/docs/reference/libmx/Makefile.am
+===================================================================
+--- git.orig/docs/reference/libmx/Makefile.am 2013-05-08 15:07:02.027154788 +0100
++++ git/docs/reference/libmx/Makefile.am 2013-05-08 15:14:24.456378135 +0100
+@@ -1,3 +1,6 @@
++EXTRA_DIST=
++CLEANFILES=
++
+ ## Process this file with automake to produce Makefile.in
+
+ # We require automake 1.6 at least.
+@@ -106,7 +109,7 @@
+ GTKDOC_LIBS=$(MX_LIBS) $(top_builddir)/mx/libmx-$(MX_API_VERSION).la
+
+ # This includes the standard gtk-doc make rules, copied by gtkdocize.
+-include $(top_srcdir)/gtk-doc.make
++include $(top_builddir)/gtk-doc.make
+
+ # Other files to distribute
+ EXTRA_DIST += version.xml.in
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mx/mx-1.0/fix-test-includes.patch b/import-layers/yocto-poky/meta/recipes-graphics/mx/mx-1.0/fix-test-includes.patch
new file mode 100644
index 000000000..82c93dd60
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/mx/mx-1.0_1.4.7.bb b/import-layers/yocto-poky/meta/recipes-graphics/mx/mx-1.0_1.4.7.bb
new file mode 100644
index 000000000..5545c1e81
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/mx/mx-1.0_1.4.7.bb
@@ -0,0 +1,17 @@
+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-build-dir.patch \
+ 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/import-layers/yocto-poky/meta/recipes-graphics/mx/mx.inc b/import-layers/yocto-poky/meta/recipes-graphics/mx/mx.inc
new file mode 100644
index 000000000..4f1095793
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/mx/mx.inc
@@ -0,0 +1,22 @@
+SUMMARY = "Clutter based UI widget library"
+LICENSE = "LGPLv2.1"
+
+inherit clutter autotools-brokensep distro_features_check gobject-introspection
+# depends on clutter-1.0 which depends on cogl-1.0
+REQUIRED_DISTRO_FEATURES = "opengl"
+
+DEPENDS = "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-doc \
+ --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/import-layers/yocto-poky/meta/recipes-graphics/packagegroups/packagegroup-core-clutter.bb b/import-layers/yocto-poky/meta/recipes-graphics/packagegroups/packagegroup-core-clutter.bb
new file mode 100644
index 000000000..5734b2785
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/packagegroups/packagegroup-core-clutter.bb
@@ -0,0 +1,23 @@
+#
+# Copyright (C) 2007 OpenedHand Ltd.
+#
+
+SUMMARY = "Clutter package groups"
+LICENSE = "MIT"
+
+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/import-layers/yocto-poky/meta/recipes-graphics/packagegroups/packagegroup-core-directfb.bb b/import-layers/yocto-poky/meta/recipes-graphics/packagegroups/packagegroup-core-directfb.bb
new file mode 100644
index 000000000..a657a1a4e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/packagegroups/packagegroup-core-directfb.bb
@@ -0,0 +1,16 @@
+SUMMARY = "DirectFB without X11"
+LICENSE = "MIT"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup
+
+TOUCH = ' ${@bb.utils.contains("MACHINE_FEATURES", "touchscreen", "tslib tslib-calibrate tslib-tests", "",d)}'
+
+RDEPENDS_${PN} = " \
+ directfb \
+ directfb-examples \
+ pango \
+ fontconfig \
+ ${TOUCH} \
+"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11-base.bb b/import-layers/yocto-poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11-base.bb
new file mode 100644
index 000000000..17301a052
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11-base.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Basic X11 session"
+DESCRIPTION = "Packages required to set up a basic working X11 session"
+LICENSE = "MIT"
+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 \
+ pointercal \
+ matchbox-terminal \
+ matchbox-wm \
+ mini-x-session \
+ liberation-fonts \
+ "
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11-xserver.bb b/import-layers/yocto-poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11-xserver.bb
new file mode 100644
index 000000000..c53f1b758
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11-xserver.bb
@@ -0,0 +1,21 @@
+#
+# Copyright (C) 2011 Intel Corporation
+#
+
+SUMMARY = "X11 display server"
+LICENSE = "MIT"
+PR = "r40"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup distro_features_check
+# rdepends on XSERVER
+REQUIRED_DISTRO_FEATURES = "x11"
+
+XSERVER ?= "xserver-xorg xf86-video-fbdev xf86-input-evdev"
+XSERVERCODECS ?= ""
+
+RDEPENDS_${PN} = "\
+ ${XSERVER} \
+ ${XSERVERCODECS} \
+ "
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11.bb b/import-layers/yocto-poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11.bb
new file mode 100644
index 000000000..3537d8cbb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11.bb
@@ -0,0 +1,34 @@
+#
+# Copyright (C) 2011 Intel Corporation
+#
+
+LICENSE = "MIT"
+PR = "r40"
+
+inherit packagegroup distro_features_check
+# rdepends on x11-common
+REQUIRED_DISTRO_FEATURES = "x11"
+
+PACKAGES = "${PN} ${PN}-utils"
+
+# xserver-common, x11-common
+VIRTUAL-RUNTIME_xserver_common ?= "x11-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 \
+ "
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/pango/pango/0001-Drop-introspection-macros-from-acinclude.m4.patch b/import-layers/yocto-poky/meta/recipes-graphics/pango/pango/0001-Drop-introspection-macros-from-acinclude.m4.patch
new file mode 100644
index 000000000..812da21c5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/pango/pango/0001-Drop-introspection-macros-from-acinclude.m4.patch
@@ -0,0 +1,121 @@
+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: Pending [review on oe-core list]
+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/import-layers/yocto-poky/meta/recipes-graphics/pango/pango/run-ptest b/import-layers/yocto-poky/meta/recipes-graphics/pango/pango/run-ptest
new file mode 100644
index 000000000..fa87a7577
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/pango/pango/run-ptest
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+gnome-desktop-testing-runner pango
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/pango/pango_1.38.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/pango/pango_1.38.1.bb
new file mode 100644
index 000000000..7fc65fd43
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/pango/pango_1.38.1.bb
@@ -0,0 +1,52 @@
+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 \
+"
+
+SRC_URI[archive.md5sum] = "7fde35d4a127b55ce8bbcefe109bc80d"
+SRC_URI[archive.sha256sum] = "1320569f6c6d75d6b66172b2d28e59c56ee864ee9df202b76799c4506a214eb7"
+
+DEPENDS = "glib-2.0 glib-2.0-native fontconfig freetype virtual/libiconv cairo harfbuzz"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+PACKAGECONFIG[x11] = "--with-xft,--without-xft,virtual/libx11 libxft"
+
+EXTRA_AUTORECONF = ""
+
+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 ${@base_contains('DISTRO_FEATURES', 'ptest', 'true', 'false', d)}; then
+ make CC="${BUILD_CC}" CFLAGS="" 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/import-layers/yocto-poky/meta/recipes-graphics/piglit/piglit/0001-tests-Fix-missing-include-of-Xutil.h.patch b/import-layers/yocto-poky/meta/recipes-graphics/piglit/piglit/0001-tests-Fix-missing-include-of-Xutil.h.patch
new file mode 100644
index 000000000..c27cc04f0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/piglit/piglit/0001-tests-Fix-missing-include-of-Xutil.h.patch
@@ -0,0 +1,28 @@
+Upstream-Status: Backport
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+
+From e40e0a25f996d2e205c4bdec2c8a5cc7f74e5065 Mon Sep 17 00:00:00 2001
+From: Otavio Salvador <otavio@ossystems.com.br>
+Date: Mon, 15 Jun 2015 16:25:30 -0300
+Subject: tests: Fix missing include of Xutil.h
+
+The EGL tests rely on Xutil.h being included. Some EGL implementation
+does not explitly include it by default and then the build fails.
+
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+Reviewed-by: Neil Roberts <neil@linux.intel.com>
+
+diff --git a/tests/egl/egl-configless-context.c b/tests/egl/egl-configless-context.c
+index 0504a26..154b55c 100644
+--- a/tests/egl/egl-configless-context.c
++++ b/tests/egl/egl-configless-context.c
+@@ -32,6 +32,7 @@
+ /* Chunks of code in this file are taken from egl-util.c */
+
+ #include <X11/Xlib.h>
++#include <X11/Xutil.h>
+
+ #include "piglit-util-gl.h"
+ #include "piglit-util-egl.h"
+--
+cgit v0.10.2
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/piglit/piglit_git.bb b/import-layers/yocto-poky/meta/recipes-graphics/piglit/piglit_git.bb
new file mode 100644
index 000000000..607f236c2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/piglit/piglit_git.bb
@@ -0,0 +1,43 @@
+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-tests-Fix-missing-include-of-Xutil.h.patch"
+
+# From 2015-02-19
+SRCREV = "c4585427913e4cb28994b4bfb11d49778273aa2c"
+# (when PV goes above 1.0 remove the trailing r)
+PV = "1.0+gitr${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "virtual/libx11 libxrender waffle virtual/libgl libglu python-mako-native python-numpy-native"
+
+inherit cmake pythonnative distro_features_check
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+# 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
+}
+
+RDEPENDS_${PN} = "waffle python python-mako python-json python-subprocess \
+ python-argparse python-importlib python-unixadmin python-xml \
+ python-multiprocessing python-textutils python-netserver python-shell \
+ mesa-demos bash \
+ "
+
+INSANE_SKIP_${PN} += "dev-so"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/pong-clock/pong-clock/pong-clock-no-flicker.c b/import-layers/yocto-poky/meta/recipes-graphics/pong-clock/pong-clock/pong-clock-no-flicker.c
new file mode 100644
index 000000000..41cebc58a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/pong-clock/pong-clock_1.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/pong-clock/pong-clock_1.0.bb
new file mode 100644
index 000000000..0e1a7928f
--- /dev/null
+++ b/import-layers/yocto-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
+# 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} -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/import-layers/yocto-poky/meta/recipes-graphics/startup-notification/startup-notification-0.12/obsolete_automake_macros.patch b/import-layers/yocto-poky/meta/recipes-graphics/startup-notification/startup-notification-0.12/obsolete_automake_macros.patch
new file mode 100644
index 000000000..9e86f2b2e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/startup-notification/startup-notification_0.12.bb b/import-layers/yocto-poky/meta/recipes-graphics/startup-notification/startup-notification_0.12.bb
new file mode 100644
index 000000000..6c1b93cd0
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/tslib/tslib/ts.conf b/import-layers/yocto-poky/meta/recipes-graphics/tslib/tslib/ts.conf
new file mode 100644
index 000000000..1b0da937e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/tslib/tslib/ts.conf
@@ -0,0 +1,25 @@
+# Uncomment if you wish to use the linux input layer event interface
+module_raw input
+
+# Uncomment if you're using a Sharp Zaurus SL-5500/SL-5000d
+# module_raw collie
+
+# Uncomment if you're using a Sharp Zaurus SL-C700/C750/C760/C860
+# module_raw corgi
+
+# Uncomment if you're using a device with a UCB1200/1300/1400 TS interface
+# module_raw ucb1x00
+
+# Uncomment if you're using an HP iPaq h3600 or similar
+# module_raw h3600
+
+# Uncomment if you're using a Hitachi Webpad
+# module_raw mk712
+
+# Uncomment if you're using an IBM Arctic II
+# module_raw arctic2
+
+module pthres pmin=1
+module variance delta=30
+module dejitter delta=100
+module linear
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/tslib/tslib/tslib.sh b/import-layers/yocto-poky/meta/recipes-graphics/tslib/tslib/tslib.sh
new file mode 100644
index 000000000..7068e8d92
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/tslib/tslib/tslib.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+if [ -e /dev/input/touchscreen0 ]; then
+ TSLIB_TSDEVICE=/dev/input/touchscreen0
+
+ export TSLIB_TSDEVICE
+fi
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/tslib/tslib_1.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/tslib/tslib_1.1.bb
new file mode 100644
index 000000000..b0264c3b3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/tslib/tslib_1.1.bb
@@ -0,0 +1,53 @@
+SUMMARY = "An abstraction layer for touchscreen panel events"
+DESCRIPTION = "Tslib is an abstraction layer for touchscreen panel \
+events, as well as a filter stack for the manipulation of those events. \
+Tslib is generally used on embedded devices to provide a common user \
+space interface to touchscreen functionality."
+HOMEPAGE = "http://tslib.berlios.de/"
+
+AUTHOR = "Russell King w/ plugins by Chris Larson et. al."
+SECTION = "base"
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f30a9716ef3762e3467a2f62bf790f0a"
+
+SRC_URI = "https://github.com/kergoth/tslib/releases/download/${PV}/tslib-${PV}.tar.xz;downloadfilename=tslib-${PV}.tar.xz \
+ file://ts.conf \
+ file://tslib.sh \
+"
+
+SRC_URI[md5sum] = "14771f8607b341bb4b297819d37e837d"
+SRC_URI[sha256sum] = "fe35e5f710ea933b118f710e2ce4403ac076fe69926b570333867d4de082a51c"
+
+UPSTREAM_CHECK_URI = "https://github.com/kergoth/tslib/releases"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--enable-shared --disable-h3600 --enable-input --disable-corgi --disable-collie --disable-mk712 --disable-arctic2 --disable-ucb1x00"
+
+do_install_prepend() {
+ install -m 0644 ${WORKDIR}/ts.conf ${S}/etc/ts.conf
+}
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/profile.d/
+ install -m 0755 ${WORKDIR}/tslib.sh ${D}${sysconfdir}/profile.d/
+}
+
+# People should consider using udev's /dev/input/touchscreen0 symlink
+# instead of detect-stylus
+#RDEPENDS_tslib-conf_weird-machine = "detect-stylus"
+RPROVIDES_tslib-conf = "libts-0.0-conf"
+
+PACKAGES =+ "tslib-conf tslib-tests tslib-calibrate"
+DEBIAN_NOAUTONAME_tslib-conf = "1"
+DEBIAN_NOAUTONAME_tslib-tests = "1"
+DEBIAN_NOAUTONAME_tslib-calibrate = "1"
+
+RDEPENDS_${PN} = "tslib-conf"
+RRECOMMENDS_${PN} = "pointercal"
+
+FILES_${PN}-dev += "${libdir}/ts/*.la"
+FILES_tslib-conf = "${sysconfdir}/ts.conf ${sysconfdir}/profile.d/tslib.sh ${datadir}/tslib"
+FILES_${PN} = "${libdir}/*.so.* ${libdir}/ts/*.so*"
+FILES_tslib-calibrate += "${bindir}/ts_calibrate"
+FILES_tslib-tests = "${bindir}/ts_harvest ${bindir}/ts_print ${bindir}/ts_print_raw ${bindir}/ts_test"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/ttf-fonts/liberation-fonts/30-liberation-aliases.conf b/import-layers/yocto-poky/meta/recipes-graphics/ttf-fonts/liberation-fonts/30-liberation-aliases.conf
new file mode 100644
index 000000000..06094503c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/ttf-fonts/liberation-fonts_1.04.bb b/import-layers/yocto-poky/meta/recipes-graphics/ttf-fonts/liberation-fonts_1.04.bb
new file mode 100644
index 000000000..bda82e7ef
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/ttf-fonts/liberation-fonts_1.04.bb
@@ -0,0 +1,40 @@
+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://fedorahosted.org/liberation-fonts/"
+BUGTRACKER = "https://bugzilla.redhat.com/"
+
+RECIPE_NO_UPDATE_REASON = "2.x depends on fontforge package, which is not yet provided in oe-core"
+
+SECTION = "x11/fonts"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+PR = "r4"
+PE = "1"
+
+inherit allarch fontcache
+
+FONT_PACKAGES = "${PN}"
+
+SRC_URI = "https://fedorahosted.org/releases/l/i/liberation-fonts/liberation-fonts-${PV}.tar.gz \
+ file://30-liberation-aliases.conf"
+
+SRC_URI[md5sum] = "4846797ef0fc70b0cbaede2514677c58"
+SRC_URI[sha256sum] = "0e0d0957c85b758561a3d4aef4ebcd2c39959e5328429d96ae106249d83531a1"
+
+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.txt ${D}${datadir}/doc/${BPN}/
+}
+
+PACKAGES = "${PN}"
+FILES_${PN} += "${sysconfdir} ${datadir}"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/ttf-fonts/ttf-bitstream-vera_1.10.bb b/import-layers/yocto-poky/meta/recipes-graphics/ttf-fonts/ttf-bitstream-vera_1.10.bb
new file mode 100644
index 000000000..b2e4cef39
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/ttf-fonts/ttf-bitstream-vera_1.10.bb
@@ -0,0 +1,38 @@
+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"
+
+do_install () {
+ install -d ${D}${prefix}/share/fonts/ttf/
+ for i in *.ttf; do
+ install -m 644 $i ${D}${prefix}/share/fonts/ttf/${i}
+ done
+
+ # fontconfig ships this too. not sure what to do about it.
+ #install -d ${D}${sysconfdir}/fonts
+ #install -m 644 local.conf ${D}${sysconfdir}/fonts/local.conf
+
+
+ install -d ${D}${prefix}/share/doc/${BPN}/
+ for i in *.TXT; do
+ install -m 644 $i ${D}${prefix}/share/doc/${BPN}/$i
+ done
+}
+
+FILES_${PN} = "/etc ${datadir}/fonts"
+
+SRC_URI[md5sum] = "bb22bd5b4675f5dbe17c6963d8c00ed6"
+SRC_URI[sha256sum] = "db5b27df7bbb318036ebdb75acd3e98f1bd6eb6608fb70a67d478cd243d178dc"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/waffle/waffle/0001-third_party-threads-Use-PTHREAD_MUTEX_RECURSIVE-by-d.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/waffle/waffle_1.5.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/waffle/waffle_1.5.2.bb
new file mode 100644
index 000000000..f7db1bc95
--- /dev/null
+++ b/import-layers/yocto-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)}"
+
+# I say virtual/libgl, actually wants gl.pc
+PACKAGECONFIG[glx] = "-Dwaffle_has_glx=1,-Dwaffle_has_glx=0,virtual/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/libgl wayland"
+
+# I say virtual/libgl, actually wants gbm.pc egl.pc
+PACKAGECONFIG[gbm] = "-Dwaffle_has_gbm=1,-Dwaffle_has_gbm=0,virtual/libgl udev"
+
+# I say virtual/libgl, actually wants egl.pc
+PACKAGECONFIG[x11-egl] = "-Dwaffle_has_x11_egl=1,-Dwaffle_has_x11_egl=0,virtual/libgl libxcb"
+
+FILES_${PN}-dev += "${datadir}/cmake/Modules/FindWaffle.cmake \
+ ${libdir}/cmake/Waffle/"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/wayland/libinput/touchpad-serial-synaptics-need-to-fake-new-touches-on-TRIPLETAP.patch b/import-layers/yocto-poky/meta/recipes-graphics/wayland/libinput/touchpad-serial-synaptics-need-to-fake-new-touches-on-TRIPLETAP.patch
new file mode 100644
index 000000000..97c63bd37
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/wayland/libinput/touchpad-serial-synaptics-need-to-fake-new-touches-on-TRIPLETAP.patch
@@ -0,0 +1,72 @@
+This is a workaround upstream suggests for use with kernel 4.1.
+
+Upstream-Status: Inappropriate [temporary work-around]
+Signed-Off-By: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+
+
+From: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Mon Aug 3 18:23:12 PDT 2015
+Subject: [PATCH v3 libinput] touchpad: serial synaptics need to fake new touches on TRIPLETAP
+
+On the 4.1 kernels synaptics pretends to have 3 slots (the serial fw only does
+2). This was added to avoid cursor jumps but has since been reverted for 4.2
+(kernel commit dbf3c37086, 4.1.3 is still buggy). In some cases a TRIPLETAP
+may be triggered without slot 2 ever activating.
+
+While there are still those kernels out there, work around this bug by opening
+a new touch point where none exists if the fake finger count exceeds the slot
+count.
+
+Reported-by: Jan Alexander Steffens <jan.steffens at gmail.com>
+Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
+Tested-by: Jan Alexander Steffens <jan.steffens at gmail.com>
+Reviewed-by: Hans de Goede <hdegoede at redhat.com>
+---
+Changes to v2:
+- split out the handling instead of having a tmp state variable, see Hans'
+ comments from v2
+
+Mainly sending this to the list again so I have a link to point people to.
+If you're on 4.1.x add this patch to your distribution package.
+
+ src/evdev-mt-touchpad.c | 22 ++++++++++++++++------
+ 1 file changed, 16 insertions(+), 6 deletions(-)
+
+diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
+index a683d9a..5ef03d5 100644
+--- a/src/evdev-mt-touchpad.c
++++ b/src/evdev-mt-touchpad.c
+@@ -369,13 +369,23 @@ tp_restore_synaptics_touches(struct tp_dispatch *tp,
+ for (i = 0; i < tp->num_slots; i++) {
+ struct tp_touch *t = tp_get_touch(tp, i);
+
+- if (t->state != TOUCH_END)
++ switch(t->state) {
++ case TOUCH_HOVERING:
++ case TOUCH_BEGIN:
++ case TOUCH_UPDATE:
+ continue;
+-
+- /* new touch, move it through begin to update immediately */
+- tp_new_touch(tp, t, time);
+- tp_begin_touch(tp, t, time);
+- t->state = TOUCH_UPDATE;
++ case TOUCH_NONE:
++ /* new touch, move it through to begin immediately */
++ tp_new_touch(tp, t, time);
++ tp_begin_touch(tp, t, time);
++ break;
++ case TOUCH_END:
++ /* touch just ended ,we need need to restore it to update */
++ tp_new_touch(tp, t, time);
++ tp_begin_touch(tp, t, time);
++ t->state = TOUCH_UPDATE;
++ break;
++ }
+ }
+ }
+
+--
+2.4.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/wayland/libinput_1.1.4.bb b/import-layers/yocto-poky/meta/recipes-graphics/wayland/libinput_1.1.4.bb
new file mode 100644
index 000000000..4167679c2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/wayland/libinput_1.1.4.bb
@@ -0,0 +1,22 @@
+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 \
+ file://touchpad-serial-synaptics-need-to-fake-new-touches-on-TRIPLETAP.patch \
+"
+SRC_URI[md5sum] = "0945318141c1a9f52857bbf65d175f32"
+SRC_URI[sha256sum] = "302cb76209b9c57a5a318e178f9bc446eede8ea79386103b5291cbfaa5fab5b6"
+
+inherit autotools pkgconfig
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[libunwind] = "--with-libunwind,--without-libunwind,libunwind"
+PACKAGECONFIG[gui] = "--enable-event-gui,--disable-event-gui,cairo gtk+3"
+
+FILES_${PN} += "${libdir}/udev/"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/wayland/mtdev_1.1.5.bb b/import-layers/yocto-poky/meta/recipes-graphics/wayland/mtdev_1.1.5.bb
new file mode 100644
index 000000000..ccd0ebbfc
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/wayland/wayland_1.9.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/wayland/wayland_1.9.0.bb
new file mode 100644
index 000000000..d12ac186c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/wayland/wayland_1.9.0.bb
@@ -0,0 +1,41 @@
+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"
+
+SRC_URI = "http://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz"
+SRC_URI[md5sum] = "5e141b3f2a7005d6c89d6f233c87c317"
+SRC_URI[sha256sum] = "9c8770720aa0034479735f58a4dc4ca9b172ecfede28f5134312e135b7301efa"
+
+EXTRA_OECONF_class-native = "--disable-documentation --disable-libraries"
+
+inherit autotools pkgconfig
+
+BBCLASSEXTEND = "native nativesdk"
+
+DEPENDS = "expat libffi wayland-native"
+
+EXTRA_OECONF = "--disable-documentation --with-host-scanner"
+
+# 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"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston-init.bb b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston-init.bb
new file mode 100644
index 000000000..653541e3c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston-init.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Startup script and systemd unit file for the Weston Wayland compositor"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690"
+
+SRC_URI = "file://init \
+ file://weston.service"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -d ${D}/${sysconfdir}/init.d
+ install -m755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/weston
+
+ install -d ${D}${systemd_system_unitdir}
+ install -m0644 ${WORKDIR}/weston.service ${D}${systemd_system_unitdir}
+}
+
+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/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston-init/init b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston-init/init
new file mode 100644
index 000000000..2e938f430
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston-init/init
@@ -0,0 +1,60 @@
+#!/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
+
+ # This is all a nasty hack
+ if test -z "$XDG_RUNTIME_DIR"; then
+ export XDG_RUNTIME_DIR=/run/user/root
+ mkdir --parents $XDG_RUNTIME_DIR
+ chmod 0700 $XDG_RUNTIME_DIR
+ fi
+
+ openvt -s weston -- $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/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston-init/weston.service b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston-init/weston.service
new file mode 100644
index 000000000..4f1f7ff10
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston-init/weston.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Weston Wayland compositor startup
+RequiresMountsFor=/run
+
+[Service]
+User=root
+EnvironmentFile=-/etc/default/weston
+Environment="XDG_RUNTIME_DIR=/run/user/root"
+ExecStartPre=/bin/mkdir -p /run/user/root
+ExecStartPre=/bin/chmod 0700 /run/user/root
+ExecStart=/usr/bin/openvt -v -e /usr/bin/weston -- $OPTARGS
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/0001-make-error-portable.patch b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/0001-make-error-portable.patch
new file mode 100644
index 000000000..148848d8d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/0001-make-error-portable.patch
@@ -0,0 +1,80 @@
+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 ++
+ src/weston-error.h | 20 ++++++++++++++++++++
+ src/weston-launch.c | 2 +-
+ 3 files changed, 23 insertions(+), 1 deletion(-)
+ create mode 100644 src/weston-error.h
+
+diff --git a/configure.ac b/configure.ac
+index 263fc22..f52cd62 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -57,6 +57,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])
+
+ COMPOSITOR_MODULES="wayland-server >= 1.7.93 pixman-1 >= 0.25.2"
+diff --git a/src/weston-error.h b/src/weston-error.h
+new file mode 100644
+index 0000000..2089d02
+--- /dev/null
++++ b/src/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
++
+diff --git a/src/weston-launch.c b/src/weston-launch.c
+index 10c66de..3e6d30a 100644
+--- a/src/weston-launch.c
++++ b/src/weston-launch.c
+@@ -30,7 +30,6 @@
+ #include <poll.h>
+ #include <errno.h>
+
+-#include <error.h>
+ #include <getopt.h>
+
+ #include <sys/types.h>
+@@ -56,6 +55,7 @@
+ #endif
+
+ #include "weston-launch.h"
++#include "weston-error.h"
+
+ #define DRM_MAJOR 226
+
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/explicit-enable-disable-systemd.patch b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/explicit-enable-disable-systemd.patch
new file mode 100644
index 000000000..a40eaf186
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/explicit-enable-disable-systemd.patch
@@ -0,0 +1,70 @@
+From 8e1efcd40b3bad81c83744e2e120d70c2b567ef2 Mon Sep 17 00:00:00 2001
+From: Frederico Cadete <frederico@cadete.eu>
+Date: Mon, 28 Sep 2015 00:30:10 +0200
+Subject: configure.ac: add explicit enable/disable for systemd-login support
+
+Otherwise, auto-enable depending on whether the system has the necessary
+libraries.
+
+[Updated help text as per pq suggestion -- bwh]
+
+Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
+Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
+Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
+
+Upstream-Status: Backport
+Backported from Weston git:
+http://cgit.freedesktop.org/wayland/weston/commit/?id=8e1efc
+
+Signed-off-by: Joshua Lock <joshua.lock@collabora.co.uk>
+
+diff --git a/configure.ac b/configure.ac
+index a9cd429..67e80d0 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -380,18 +380,30 @@ 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])])
+
+-PKG_CHECK_MODULES(SYSTEMD_LOGIN,
+- [libsystemd >= 209],
+- [have_systemd_login_209=yes;have_systemd_login=yes],
+- [have_systemd_login_209=no;have_systemd_login=no])
+-
+-# Older versions of systemd package systemd-login separately. Fall back on that
+-AS_IF([test x$have_systemd_login != xyes],[
+- PKG_CHECK_MODULES(SYSTEMD_LOGIN,
+- [libsystemd-login >= 198],
+- [have_systemd_login=yes],
+- [have_systemd_login=no])
+- ])
++AC_ARG_ENABLE(systemd-login,
++ AS_HELP_STRING([--enable-systemd-login],
++ [Enable logind support]),,
++ enable_systemd_login=auto)
++if test x$enable_systemd_login != xno; then
++ PKG_CHECK_MODULES(SYSTEMD_LOGIN,
++ [libsystemd >= 209],
++ [have_systemd_login_209=yes;have_systemd_login=yes],
++ [have_systemd_login_209=no;have_systemd_login=no])
++
++ # Older versions of systemd package systemd-login separately. Fall back on that
++ AS_IF([test x$have_systemd_login != xyes],[
++ PKG_CHECK_MODULES(SYSTEMD_LOGIN,
++ [libsystemd-login >= 198],
++ [have_systemd_login=yes],
++ [have_systemd_login=no])
++ ])
++else
++ have_systemd_login=no
++fi
++
++if test "x$have_systemd_login" = "xno" -a "x$enable_systemd_login" = "xyes"; then
++ AC_MSG_ERROR([systemd-login support explicitly enabled, but can't find libsystemd>=209 or libsystemd-login])
++fi
+
+ AS_IF([test "x$have_systemd_login" = "xyes"],
+ [AC_DEFINE([HAVE_SYSTEMD_LOGIN], [1], [Have systemd-login])])
+--
+cgit v0.10.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/libsystemd.patch b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/libsystemd.patch
new file mode 100644
index 000000000..2d28d5689
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/libsystemd.patch
@@ -0,0 +1,53 @@
+From 5eb025a867b42f8bc7bc73279eac8de58e51a13e Mon Sep 17 00:00:00 2001
+From: Frederico Cadete <frederico@cadete.eu>
+Date: Mon, 28 Sep 2015 00:30:09 +0200
+Subject: configure.ac: add support for new versions of systemd
+
+Starting from systemd version 209, a single libsystemd.pc is provided.
+For previous versions, fall back on libsystemd-login.pc.
+
+Signed-off-by: Frederico Cadete <frederico@cadete.eu>
+Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
+Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
+
+Upstream-Status: Backport
+Backported from Weston git:
+http://cgit.freedesktop.org/wayland/weston/commit/?id=5eb025
+
+Signed-off-by: Joshua Lock <joshua.lock@collabora.co.uk>
+
+diff --git a/configure.ac b/configure.ac
+index 045291c..a9cd429 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -380,14 +380,23 @@ 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])])
+
+-PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd-login >= 198],
+- [have_systemd_login=yes], [have_systemd_login=no])
++PKG_CHECK_MODULES(SYSTEMD_LOGIN,
++ [libsystemd >= 209],
++ [have_systemd_login_209=yes;have_systemd_login=yes],
++ [have_systemd_login_209=no;have_systemd_login=no])
++
++# Older versions of systemd package systemd-login separately. Fall back on that
++AS_IF([test x$have_systemd_login != xyes],[
++ PKG_CHECK_MODULES(SYSTEMD_LOGIN,
++ [libsystemd-login >= 198],
++ [have_systemd_login=yes],
++ [have_systemd_login=no])
++ ])
++
+ AS_IF([test "x$have_systemd_login" = "xyes"],
+ [AC_DEFINE([HAVE_SYSTEMD_LOGIN], [1], [Have systemd-login])])
+ AM_CONDITIONAL(HAVE_SYSTEMD_LOGIN, test "x$have_systemd_login" = "xyes")
+
+-PKG_CHECK_MODULES(SYSTEMD_LOGIN_209, [libsystemd-login >= 209],
+- [have_systemd_login_209=yes], [have_systemd_login_209=no])
+ AS_IF([test "x$have_systemd_login_209" = "xyes"],
+ [AC_DEFINE([HAVE_SYSTEMD_LOGIN_209], [1], [Have systemd-login >= 209])])
+
+--
+cgit v0.10.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/make-lcms-explicitly-configurable.patch b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/make-lcms-explicitly-configurable.patch
new file mode 100644
index 000000000..35e6d6ff5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/make-lcms-explicitly-configurable.patch
@@ -0,0 +1,43 @@
+weston-1.5.0/configure.ac: make lcms explicitly configurable
+
+The lcms package is outside of openembedded-core, so make it
+explicitly configurable. Make it deterministic, so that if lcms
+dependencies are missing, autoconf throws a fatal error. Follow
+upstream style to make it more likely to be merged.
+
+Upstream-Status: Pending
+
+Index: weston-1.5.0/configure.ac
+===================================================================
+--- weston-1.5.0.orig/configure.ac
++++ weston-1.5.0/configure.ac
+@@ -491,12 +491,24 @@ AC_ARG_ENABLE(demo-clients-install,
+ enable_demo_clients_install=no)
+ AM_CONDITIONAL(INSTALL_DEMO_CLIENTS, [test "x$enable_demo_clients_install" = "xyes"])
+
+-PKG_CHECK_MODULES(LCMS, lcms2,
+- [have_lcms=yes], [have_lcms=no])
+-if test "x$have_lcms" = xyes; then
+- AC_DEFINE(HAVE_LCMS, 1, [Have lcms support])
++AC_ARG_ENABLE(lcms,
++ AS_HELP_STRING([--disable-lcms],
++ [Disable lcms support]),,
++ enable_lcms=auto)
++AM_CONDITIONAL(HAVE_LCMS, [test "x$enable_lcms" = xyes])
++if test "x$enable_lcms" != "xno"; then
++ PKG_CHECK_MODULES(LCMS,
++ lcms2,
++ [have_lcms=yes],
++ [have_lcms=no])
++ if test "x$have_lcms" = "xno" -a "x$enable_lcms" = "xyes"; then
++ AC_MSG_ERROR([lcms support explicitly requested, but lcms couldn't be found])
++ fi
++ if test "x$have_lcms" = "xyes"; then
++ enable_lcms=yes
++ AC_DEFINE(HAVE_LCMS, 1, [Have lcms support])
++ fi
+ fi
+-AM_CONDITIONAL(HAVE_LCMS, [test "x$have_lcms" = xyes])
+
+ AC_PATH_PROG([wayland_scanner], [wayland-scanner])
+ if test x$wayland_scanner = x; then
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/make-libwebp-explicitly-configurable.patch b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/make-libwebp-explicitly-configurable.patch
new file mode 100644
index 000000000..ad07d4fc2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/make-libwebp-explicitly-configurable.patch
@@ -0,0 +1,37 @@
+
+The libwebp package is outside of openembedded-core, so make it
+explicitly configurable. Make it deterministic, so that if libwebp
+dependencies are missing, autoconf throws a fatal error.
+
+Upstream-Status: Pending
+
+Index: weston-1.5.0/configure.ac
+===================================================================
+--- weston-1.5.0.orig/configure.ac
++++ weston-1.5.0/configure.ac
+@@ -268,9 +268,22 @@ fi
+
+ PKG_CHECK_MODULES(PIXMAN, [pixman-1])
+ PKG_CHECK_MODULES(PNG, [libpng])
+-PKG_CHECK_MODULES(WEBP, [libwebp], [have_webp=yes], [have_webp=no])
+-AS_IF([test "x$have_webp" = "xyes"],
+- [AC_DEFINE([HAVE_WEBP], [1], [Have webp])])
++AC_ARG_ENABLE(webp,
++ AS_HELP_STRING([--disable-webp],
++ [Disable libwebp support]),,
++ enable_webp=auto)
++AM_CONDITIONAL(HAVE_WEBP, [test "x$enable_webp" = xyes])
++AS_IF([test "x$enable_webp" != "xno"],
++ PKG_CHECK_MODULES(WEBP,
++ [libwebp],
++ [have_webp=yes],
++ [have_webp=no])
++ AS_IF([test "x$have_webp" = "xno" -a "x$enable_webp" = "xyes"],
++ AC_MSG_ERROR([libwebp support explicitly request, but lipwebp could not be found]))
++ AS_IF([test "x$have_webp" = "xyes"],
++ [enable_webp=yes]
++ [AC_DEFINE([HAVE_WEBP], [1], [Have webp])])
++)
+
+ AC_ARG_ENABLE(vaapi-recorder, [ --enable-vaapi-recorder],,
+ enable_vaapi_recorder=auto)
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/weston.desktop b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/weston.desktop
new file mode 100644
index 000000000..1086ae8bf
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/weston.png b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/weston.png
new file mode 100644
index 000000000..ea8b7e0e2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston/weston.png
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston_1.9.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston_1.9.0.bb
new file mode 100644
index 000000000..16a788d2a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/wayland/weston_1.9.0.bb
@@ -0,0 +1,103 @@
+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://src/compositor.c;endline=23;md5=1d535fed266cf39f6d8c0647f52ac331"
+
+SRC_URI = "http://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \
+ file://weston.png \
+ file://weston.desktop \
+ file://make-lcms-explicitly-configurable.patch \
+ file://make-libwebp-explicitly-configurable.patch \
+ file://0001-make-error-portable.patch \
+ file://libsystemd.patch \
+ file://explicit-enable-disable-systemd.patch \
+"
+SRC_URI[md5sum] = "66bbba12f546570b4d97f676bc79a28e"
+SRC_URI[sha256sum] = "9c1b03f3184fa0b0dfdf67e215048085156e1a2ca344af6613fed36794ac48cf"
+
+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 libinput virtual/egl pango wayland-native"
+
+EXTRA_OECONF = "--enable-setuid-install \
+ --enable-simple-clients \
+ --enable-clients \
+ --enable-demo-clients-install \
+ --disable-rpi-compositor \
+ --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', 'x11', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'launch', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
+ "
+#
+# 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,libpam 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] = "--enable-webp,--disable-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
+PACKAGECONFIG[xwayland] = "--enable-xwayland,--disable-xwayland,libxcb libxcursor cairo"
+# colord CMS support
+PACKAGECONFIG[colord] = "--enable-colord,--disable-colord,colord"
+
+do_install_append() {
+ # Weston doesn't need the .la files to load modules, so wipe them
+ rm -f ${D}/${libdir}/weston/*.la
+
+ # If X11, ship a desktop file to launch it
+ if [ "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}" = "x11" ]; 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
+}
+
+PACKAGES += "${PN}-examples"
+
+FILES_${PN} = "${bindir}/weston ${bindir}/weston-terminal ${bindir}/weston-info ${bindir}/weston-launch ${bindir}/wcap-decode ${libexecdir} ${libdir}/${BPN}/*.so ${datadir}"
+FILES_${PN}-examples = "${bindir}/*"
+
+RDEPENDS_${PN} += "xkeyboard-config"
+RRECOMMENDS_${PN} = "liberation-fonts"
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "--system weston-launch"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/Xserver.in b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/Xserver.in
new file mode 100644
index 000000000..b8eed7610
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/Xserver.in
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+
+XSERVER=/usr/bin/Xorg
+
+. /etc/profile
+
+ARGS=" -br -pn @BLANK_ARGS@"
+
+DISPLAY=':0'
+
+exec xinit /etc/X11/Xsession -- $XSERVER $DISPLAY $ARGS $*
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xdefaults b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xdefaults
new file mode 100644
index 000000000..f5b69dd51
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xdefaults
@@ -0,0 +1,3 @@
+Rxvt*scrollBar_right: true
+Rxvt*font: xft:Mono:pixelsize=9
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession
new file mode 100644
index 000000000..0b73127ae
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/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/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/12keymap.sh b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/12keymap.sh
new file mode 100644
index 000000000..a9d102c74
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/12keymap.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# kdrive 1.4 does not have default keymap in server
+#xmodmap - </etc/X11/default.xmodmap
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/13xdgbasedirs.sh b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/13xdgbasedirs.sh
new file mode 100644
index 000000000..91594b9e3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/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 "$XGD_RUNTIME_DIR" ]; then
+ XDG_RUNTIME_DIR="/tmp"
+ export XDG_RUNTIME_DIR
+fi
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/89xdgautostart.sh b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/89xdgautostart.sh
new file mode 100644
index 000000000..3d7008ca4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/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/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/90XWindowManager.sh b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/90XWindowManager.sh
new file mode 100644
index 000000000..b936dedf3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/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/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/default.xmodmap b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/default.xmodmap
new file mode 100644
index 000000000..05a13fa3c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/etc/X11/default.xmodmap
@@ -0,0 +1,260 @@
+keycode 8 =
+keycode 9 = Escape
+keycode 10 = 1 exclam
+keycode 11 = 2 at
+keycode 12 = 3 numbersign
+keycode 13 = 4 dollar
+keycode 14 = 5 percent
+keycode 15 = 6 asciicircum
+keycode 16 = 7 ampersand braceleft
+keycode 17 = 8 asterisk bracketleft
+keycode 18 = 9 parenleft bracketright
+keycode 19 = 0 parenright braceright
+keycode 20 = minus underscore backslash
+keycode 21 = equal plus
+keycode 22 = BackSpace
+keycode 23 = Tab
+keycode 24 = q Q q
+keycode 25 = w W w
+keycode 26 = e E
+keycode 27 = r R r
+keycode 28 = t T t
+keycode 29 = y Y y
+keycode 30 = u U u
+keycode 31 = i I i
+keycode 32 = o O o
+keycode 33 = p P p
+keycode 34 = bracketleft braceleft
+keycode 35 = bracketright braceright asciitilde
+keycode 36 = Return
+keycode 37 = Control_L
+keycode 38 = a A
+keycode 39 = s S s
+keycode 40 = d D
+keycode 41 = f F
+keycode 42 = g G g
+keycode 43 = h H h
+keycode 44 = j J j
+keycode 45 = k K k
+keycode 46 = l L l
+keycode 47 = semicolon colon
+keycode 48 = apostrophe quotedbl
+keycode 49 = grave asciitilde
+keycode 50 = Shift_L
+keycode 51 = backslash bar
+keycode 52 = z Z z
+keycode 53 = x X x
+keycode 54 = c C
+keycode 55 = v V v
+keycode 56 = b B
+keycode 57 = n N n
+keycode 58 = m M m
+keycode 59 = comma less
+keycode 60 = period greater
+keycode 61 = slash question
+keycode 62 = Shift_R
+keycode 63 = KP_Multiply
+keycode 64 = Alt_L
+keycode 65 = space
+keycode 66 = Caps_Lock
+keycode 67 = F1 F11
+keycode 68 = F2 F12
+keycode 69 = F3 F13
+keycode 70 = F4 F14
+keycode 71 = F5 F15
+keycode 72 = F6 F16
+keycode 73 = F7 F17
+keycode 74 = F8 F18
+keycode 75 = F9 F19
+keycode 76 = F10 F20
+keycode 77 = Num_Lock
+keycode 78 = Scroll_Lock
+keycode 79 = KP_7
+keycode 80 = KP_8
+keycode 81 = KP_9
+keycode 82 = KP_Subtract
+keycode 83 = KP_4
+keycode 84 = KP_5
+keycode 85 = KP_6
+keycode 86 = KP_Add
+keycode 87 = KP_1
+keycode 88 = KP_2
+keycode 89 = KP_3
+keycode 90 = KP_0
+keycode 91 = KP_Decimal
+keycode 92 =
+keycode 93 =
+keycode 94 = less greater bar
+keycode 95 = F11
+keycode 96 = F12
+keycode 97 =
+keycode 98 =
+keycode 99 =
+keycode 100 =
+keycode 101 =
+keycode 102 =
+keycode 103 =
+keycode 104 = KP_Enter
+keycode 105 = Control_R
+keycode 106 = KP_Divide
+keycode 107 =
+keycode 108 = Mode_switch
+keycode 109 = Break
+keycode 110 = Home
+keycode 111 = Up
+keycode 112 = Prior
+keycode 113 = Left
+keycode 114 = Right
+keycode 115 = End
+keycode 116 = Down
+keycode 117 = Next
+keycode 118 = Insert
+keycode 119 = Delete
+keycode 120 = Menu
+keycode 121 = F13
+keycode 122 = F14
+keycode 123 = Help
+keycode 124 = Execute
+keycode 125 = F17
+keycode 126 = KP_Subtract
+keycode 127 = Pause
+keycode 128 =
+keycode 129 =
+keycode 130 =
+keycode 131 =
+keycode 132 =
+keycode 133 =
+keycode 134 =
+keycode 135 =
+keycode 136 =
+keycode 137 =
+keycode 138 =
+keycode 139 =
+keycode 140 =
+keycode 141 =
+keycode 142 =
+keycode 143 =
+keycode 144 =
+keycode 145 =
+keycode 146 =
+keycode 147 =
+keycode 148 =
+keycode 149 =
+keycode 150 =
+keycode 151 =
+keycode 152 =
+keycode 153 =
+keycode 154 =
+keycode 155 =
+keycode 156 =
+keycode 157 =
+keycode 158 =
+keycode 159 =
+keycode 160 =
+keycode 161 =
+keycode 162 =
+keycode 163 =
+keycode 164 =
+keycode 165 =
+keycode 166 =
+keycode 167 =
+keycode 168 =
+keycode 169 =
+keycode 170 =
+keycode 171 =
+keycode 172 =
+keycode 173 =
+keycode 174 =
+keycode 175 =
+keycode 176 =
+keycode 177 =
+keycode 178 =
+keycode 179 =
+keycode 180 =
+keycode 181 =
+keycode 182 =
+keycode 183 =
+keycode 184 =
+keycode 185 =
+keycode 186 =
+keycode 187 =
+keycode 188 =
+keycode 189 =
+keycode 190 =
+keycode 191 =
+keycode 192 =
+keycode 193 =
+keycode 194 =
+keycode 195 =
+keycode 196 =
+keycode 197 =
+keycode 198 =
+keycode 199 =
+keycode 200 =
+keycode 201 =
+keycode 202 =
+keycode 203 =
+keycode 204 =
+keycode 205 =
+keycode 206 =
+keycode 207 =
+keycode 208 =
+keycode 209 =
+keycode 210 =
+keycode 211 =
+keycode 212 =
+keycode 213 =
+keycode 214 =
+keycode 215 =
+keycode 216 =
+keycode 217 =
+keycode 218 =
+keycode 219 =
+keycode 220 =
+keycode 221 =
+keycode 222 =
+keycode 223 =
+keycode 224 =
+keycode 225 =
+keycode 226 =
+keycode 227 =
+keycode 228 =
+keycode 229 =
+keycode 230 =
+keycode 231 =
+keycode 232 =
+keycode 233 =
+keycode 234 =
+keycode 235 =
+keycode 236 =
+keycode 237 =
+keycode 238 =
+keycode 239 =
+keycode 240 =
+keycode 241 =
+keycode 242 =
+keycode 243 =
+keycode 244 =
+keycode 245 =
+keycode 246 =
+keycode 247 =
+keycode 248 =
+keycode 249 =
+keycode 250 =
+keycode 251 =
+keycode 252 =
+keycode 253 =
+keycode 254 =
+
+add shift = Shift_L
+add shift = Shift_R
+add shift = Menu
+add lock = Caps_Lock
+add control = Control_L
+add control = Control_R
+add mod1 = Alt_L
+add mod2 = Num_Lock
+!mod3
+add mod4 = Mode_switch
+!mod5
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/gplv2-license.patch b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/gplv2-license.patch
new file mode 100644
index 000000000..eff975e34
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common/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/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common_0.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common_0.1.bb
new file mode 100644
index 000000000..6d7c347c0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/x11-common_0.1.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Common X11 scripts and configuration files"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+SECTION = "x11"
+PR = "r47"
+
+inherit distro_features_check
+# rdepends on xdypinfo xmodmap xinit
+REQUIRED_DISTRO_FEATURES = "x11"
+
+SRC_URI = "file://etc \
+ file://Xserver.in \
+ file://gplv2-license.patch"
+
+S = "${WORKDIR}"
+
+PACKAGECONFIG ??= "blank"
+# dpms and screen saver will be on only if 'blank' is in PACKAGECONFIG
+PACKAGECONFIG[blank] = ""
+
+do_install() {
+ cp -R ${S}/etc ${D}${sysconfdir}
+ sed -e 's/@BLANK_ARGS@/${@bb.utils.contains('PACKAGECONFIG', 'blank', '', '-s 0 -dpms', d)}/' \
+ ${S}/Xserver.in > ${D}${sysconfdir}/X11/Xserver
+
+ chmod -R 755 ${D}${sysconfdir}
+}
+
+RDEPENDS_${PN} = "dbus-x11 xmodmap xdpyinfo xtscal xinit formfactor"
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init.bb b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init.bb
new file mode 100644
index 000000000..b68d40e1b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init.bb
@@ -0,0 +1,52 @@
+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://Xusername \
+ file://gplv2-license.patch \
+ file://xserver-nodm.service \
+ file://xserver-nodm.conf \
+"
+
+S = "${WORKDIR}"
+
+# Since we refer to ROOTLESS_X which is normally enabled per-machine
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit update-rc.d systemd
+
+do_install() {
+ install -d ${D}${sysconfdir}/init.d
+ install xserver-nodm ${D}${sysconfdir}/init.d
+
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ install -d ${D}${sysconfdir}/default
+ install xserver-nodm.conf ${D}${sysconfdir}/default/xserver-nodm
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/xserver-nodm.service ${D}${systemd_unitdir}/system
+ if [ "${ROOTLESS_X}" = "1" ] ; then
+ sed -i 's!^HOME=.*!HOME=/home/xuser!' ${D}${sysconfdir}/default/xserver-nodm
+ sed -i 's!^User=.*!User=xuser!' ${D}${systemd_unitdir}/system/xserver-nodm.service
+ else
+ sed -i 's!^HOME=.*!HOME=${ROOT_HOME}!' ${D}${sysconfdir}/default/xserver-nodm
+ sed -i '/^User=/d' ${D}${systemd_unitdir}/system/xserver-nodm.service
+ fi
+ fi
+
+ if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
+ if [ "${ROOTLESS_X}" = "1" ] ; then
+ install -d ${D}${sysconfdir}/X11
+ install Xusername ${D}${sysconfdir}/X11
+ fi
+ fi
+}
+
+RDEPENDS_${PN} = "${@base_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"
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/Xusername b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/Xusername
new file mode 100644
index 000000000..7060e5ec1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/Xusername
@@ -0,0 +1 @@
+xuser
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/gplv2-license.patch b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/gplv2-license.patch
new file mode 100644
index 000000000..eff975e34
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm
new file mode 100755
index 000000000..bfa0a8d6c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm
@@ -0,0 +1,65 @@
+#!/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
+ username=root
+ echo "Starting Xserver"
+ if [ -f /etc/X11/Xusername ]; then
+ username=`cat /etc/X11/Xusername`
+ # 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/X11/Xserver&' $username
+ # 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/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf
new file mode 100644
index 000000000..3c0582a87
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf
@@ -0,0 +1 @@
+HOME=/home/root
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.service b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.service
new file mode 100644
index 000000000..62d979f1d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Xserver startup without a display manager
+
+[Service]
+User=root
+EnvironmentFile=/etc/default/xserver-nodm
+ExecStart=/etc/X11/Xserver
+
+[Install]
+Alias=display-manager.service
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xcursor-transparent-theme/xcursor-transparent-theme_git.bb b/import-layers/yocto-poky/meta/recipes-graphics/xcursor-transparent-theme/xcursor-transparent-theme_git.bb
new file mode 100644
index 000000000..b871d89f9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xcursor-transparent-theme/xcursor-transparent-theme_git.bb
@@ -0,0 +1,19 @@
+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"
+
+S = "${WORKDIR}/git"
+
+inherit autotools allarch
+
+FILES_${PN} = "${datadir}/icons/xcursor-transparent/cursors/*"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xinput-calibrator/pointercal-xinput/pointercal.xinput b/import-layers/yocto-poky/meta/recipes-graphics/xinput-calibrator/pointercal-xinput/pointercal.xinput
new file mode 100644
index 000000000..9633fc5f3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xinput-calibrator/pointercal-xinput/pointercal.xinput
@@ -0,0 +1 @@
+# replace with valid machine specific pointercal.xinput
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xinput-calibrator/pointercal-xinput_0.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/xinput-calibrator/pointercal-xinput_0.0.bb
new file mode 100644
index 000000000..65348c376
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/30xinput_calibrate.sh b/import-layers/yocto-poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/30xinput_calibrate.sh
new file mode 100644
index 000000000..529072678
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/Allow-xinput_calibrator_pointercal.sh-to-be-run-as-n.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/add-geometry-input-when-calibrating.patch b/import-layers/yocto-poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/add-geometry-input-when-calibrating.patch
new file mode 100644
index 000000000..9351331be
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/add-geometry-input-when-calibrating.patch
@@ -0,0 +1,33 @@
+Upstream-Status: Inappropriate [no longer maintained]
+
+From 93abf28d602da637376b78de8c88b7ab5cf13b4f Mon Sep 17 00:00:00 2001
+From: Jonathan David <jonathan.david@ni.com>
+Date: Mon, 30 Nov 2015 12:12:20 -0600
+Subject: [PATCH] add geometry input when calibrating
+
+Send monitor geometry to xinput_calibrator when running the script
+
+Signed-off-by: Jonathan David <jonathan.david@ni.com>
+---
+ scripts/xinput_calibrator_pointercal.sh | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/scripts/xinput_calibrator_pointercal.sh b/scripts/xinput_calibrator_pointercal.sh
+index 0ada7da..6a3aded 100755
+--- a/scripts/xinput_calibrator_pointercal.sh
++++ b/scripts/xinput_calibrator_pointercal.sh
+@@ -37,7 +37,10 @@ done
+
+ [ "$USER" != "root" ] && CALFILE=$USER_CALFILE
+
+-CALDATA=`$BINARY --output-type xinput -v | tee $LOGFILE | grep ' xinput set' | sed 's/^ //g; s/$/;/g'`
++read RESOLUTION <<< $(xrandr | awk -F '[[:space:]+]' '/ connected/ \
++ { if ($3 != "primary") print $3; if ($3 == "primary") print $4 }')
++
++CALDATA=`$BINARY --geometry $RESOLUTION --output-type xinput -v | tee $LOGFILE | grep ' xinput set' | sed 's/^ //g; s/$/;/g'`
+ if [ ! -z "$CALDATA" ] ; then
+ echo $CALDATA > $CALFILE
+ echo "Calibration data stored in $CALFILE (log in $LOGFILE)"
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator_git.bb b/import-layers/yocto-poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator_git.bb
new file mode 100644
index 000000000..ac5b70cba
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator_git.bb
@@ -0,0 +1,38 @@
+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"
+
+PV = "0.7.5+git${SRCPV}"
+PR = "r6"
+
+inherit autotools pkgconfig distro_features_check
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+SRCREV = "c01c5af807cb4b0157b882ab07a893df9a810111"
+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 \
+ file://add-geometry-input-when-calibrating.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/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/mkfontdir_1.0.7.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/mkfontdir_1.0.7.bb
new file mode 100644
index 000000000..a453e2487
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/mkfontscale_1.1.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/mkfontscale_1.1.2.bb
new file mode 100644
index 000000000..31cf18676
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/rgb_1.0.6.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/rgb_1.0.6.bb
new file mode 100644
index 000000000..87268046e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/x11perf_1.6.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/x11perf_1.6.0.bb
new file mode 100644
index 000000000..4e9355880
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/x11perf_1.6.0.bb
@@ -0,0 +1,19 @@
+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"
+
+FILES_${PN} += "${libdir}/X11/x11perfcomp/*"
+
+SRC_URI[md5sum] = "f0b24e4d8beb622a419e8431e1c03cd7"
+SRC_URI[sha256sum] = "e87098dec1947572d70c62697a7b70bde1ab5668237d4660080eade6bc096751"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xauth_1.0.9.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xauth_1.0.9.bb
new file mode 100644
index 000000000..b173f4fe8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xauth_1.0.9.bb
@@ -0,0 +1,12 @@
+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] = "7d6003f32838d5b688e2c8a131083271"
+SRC_URI[sha256sum] = "56ce1523eb48b1f8a4f4244fe1c3d8e6af1a3b7d4b0e6063582421b0b68dc28f"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xdpyinfo/disable-xkb.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xdpyinfo/disable-xkb.patch
new file mode 100644
index 000000000..1e8199cc6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xdpyinfo_1.3.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xdpyinfo_1.3.2.bb
new file mode 100644
index 000000000..af04bb6e3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xev/diet-x11.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xev/diet-x11.patch
new file mode 100644
index 000000000..6130959f8
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xev_1.2.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xev_1.2.2.bb
new file mode 100644
index 000000000..f151b579e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xeyes_1.1.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xeyes_1.1.1.bb
new file mode 100644
index 000000000..84d0cb804
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xhost_1.0.7.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xhost_1.0.7.bb
new file mode 100644
index 000000000..825737f39
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xhost_1.0.7.bb
@@ -0,0 +1,17 @@
+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"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xinit_1.3.4.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xinit_1.3.4.bb
new file mode 100644
index 000000000..93185188e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xinput_1.6.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xinput_1.6.2.bb
new file mode 100644
index 000000000..25cd047bc
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xkbcomp_1.3.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xkbcomp_1.3.1.bb
new file mode 100644
index 000000000..1c9835987
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xkbcomp_1.3.1.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] = "a4d8353daf6cb0a9c47379b7413c42c6"
+SRC_URI[sha256sum] = "0304dc9e0d4ac10831a9ef5d5419722375ddbc3eac3ff4413094d57bc1f1923d"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xmodmap_1.0.9.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xmodmap_1.0.9.bb
new file mode 100644
index 000000000..2deac6a05
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xorg-app-common.inc b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xorg-app-common.inc
new file mode 100644
index 000000000..3529cb26e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xprop_1.2.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xprop_1.2.2.bb
new file mode 100644
index 000000000..d78bf0451
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xrandr_1.4.3.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xrandr_1.4.3.bb
new file mode 100644
index 000000000..41bd42069
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xrandr_1.4.3.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] = "441fdb98d2abc6051108b7075d948fc7"
+SRC_URI[sha256sum] = "7154ac3486b86923692f2d6cdb2991a2ee72bc32af2c4379a6f1c068f204be1b"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xset/disable-xkb.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xset/disable-xkb.patch
new file mode 100644
index 000000000..97d13a30d
--- /dev/null
+++ b/import-layers/yocto-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>
+
+diff --git a/configure.ac b/configure.ac
+index 81c3ae4..26601bf 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -52,11 +52,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, AC_HELP_STRING([--without-xf86misc],[Disable xf86misc support.]),
+ [USE_XF86MISC="$withval"], [USE_XF86MISC="yes"])
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xset_1.2.3.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xset_1.2.3.bb
new file mode 100644
index 000000000..f683b7603
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xvinfo_1.1.3.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xvinfo_1.1.3.bb
new file mode 100644
index 000000000..2965ef7f8
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xwininfo_1.1.3.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-app/xwininfo_1.1.3.bb
new file mode 100644
index 000000000..0c23d1943
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-evdev_2.10.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-evdev_2.10.1.bb
new file mode 100644
index 000000000..cf77ad209
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-evdev_2.10.1.bb
@@ -0,0 +1,20 @@
+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] = "96d89d9406a02f5e36bdaa4edd9a243a"
+SRC_URI[sha256sum] = "af9c2b47f5b272ae56b45da6bd84610fc9a3d80a4b32c8215842a39d862de017"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-keyboard_1.8.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-keyboard_1.8.1.bb
new file mode 100644
index 000000000..6fe51accb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-keyboard_1.8.1.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] = "96ccc43d389b970afbd3893875dfd678"
+SRC_URI[sha256sum] = "1ac8ff39bf9da7d2fc7fd6c24515726e8138340c0518ab8c606e008cf93ca211"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-keyboard_git.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-keyboard_git.bb
new file mode 100644
index 000000000..dfb08f724
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-keyboard_git.bb
@@ -0,0 +1,16 @@
+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."
+
+SRCREV = "3e28d68b50d291938734e9684b8296ca864f3892"
+PV = "1.3.2+git${SRCPV}"
+PR = "${INC_PR}.0"
+
+SRC_URI = "git://anongit.freedesktop.org/git/xorg/driver/xf86-input-keyboard"
+S = "${WORKDIR}/git"
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-libinput_0.16.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-libinput_0.16.0.bb
new file mode 100644
index 000000000..0252baff1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-libinput_0.16.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] = "2c8cb520f88da7bafaceebc0b34ea1d4"
+SRC_URI[sha256sum] = "fdade531e91e79acf6dce8ac55fa4f65abe3f1358c5d3d777ae48dbc74b76f49"
+
+FILES_${PN} += "${datadir}/X11/xorg.conf.d"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-mouse/unbreak.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-mouse/unbreak.patch
new file mode 100644
index 000000000..6930864ed
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-mouse/unbreak.patch
@@ -0,0 +1,21 @@
+Unbreak the linux mouse driver by using config.h
+
+RP - 4/11/07
+
+Upstream-Status: Pending
+
+Index: git/src/lnx_mouse.c
+===================================================================
+--- git.orig/src/lnx_mouse.c 2008-11-04 23:46:05.000000000 +0000
++++ git/src/lnx_mouse.c 2008-11-04 23:46:15.000000000 +0000
+@@ -3,8 +3,8 @@
+ * Copyright 1999 by The XFree86 Project, Inc.
+ */
+
+-#ifdef HAVE_XORG_CONFIG_H
+-#include <xorg-config.h>
++#ifdef HAVE_CONFIG_H
++#include <config.h>
+ #endif
+
+ #include <X11/X.h>
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-mouse_1.9.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-mouse_1.9.1.bb
new file mode 100644
index 000000000..1f0b78a15
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-mouse_1.9.1.bb
@@ -0,0 +1,15 @@
+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] = "77085b649c5c0b333565ba562f573951"
+SRC_URI[sha256sum] = "3485d375779c08406f0789feedde15933dc703158a086ddac638598f479fc5ce"
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-mouse_git.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-mouse_git.bb
new file mode 100644
index 000000000..d79a2e4dd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-mouse_git.bb
@@ -0,0 +1,18 @@
+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."
+
+SRCREV = "ea5cfe804e112f320f14ad896c7802d53551d3e6"
+PV = "1.3.0+git${SRCPV}"
+PR = "${INC_PR}.0"
+
+SRC_URI = "git://anongit.freedesktop.org/git/xorg/driver/xf86-input-mouse \
+ file://unbreak.patch"
+S = "${WORKDIR}/git"
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-synaptics_1.8.3.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-synaptics_1.8.3.bb
new file mode 100644
index 000000000..b47c82cc6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-synaptics_1.8.3.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] = "4e3c8bed1ab4a67db2160c2c3d7e2a34"
+SRC_URI[sha256sum] = "d39f100c74f3673778b53f17bab7690161925e25dd998a15dd8cc69b52e83f01"
+
+DEPENDS += "libxi mtdev libxtst libevdev"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-synaptics_git.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-synaptics_git.bb
new file mode 100644
index 000000000..140f633b4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-synaptics_git.bb
@@ -0,0 +1,18 @@
+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."
+
+SRCREV = "934bc0012f948c52aadc8eda912f7728fb7394a2"
+PV = "0.15.2+git${SRCPV}"
+PR = "${INC_PR}.1"
+
+SRC_URI = "git://anongit.freedesktop.org/git/xorg/driver/xf86-input-synaptics"
+S = "${WORKDIR}/git"
+
+DEPENDS += "libxi mtdev libxtst"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-vmmouse_13.1.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-input-vmmouse_13.1.0.bb
new file mode 100644
index 000000000..8615b48da
--- /dev/null
+++ b/import-layers/yocto-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} += "${nonarch_base_libdir}/udev/rules.d/ ${datadir}/X11/xorg.conf.d"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-cirrus_1.5.3.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-cirrus_1.5.3.bb
new file mode 100644
index 000000000..c49847760
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-fbdev_0.4.4.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-fbdev_0.4.4.bb
new file mode 100644
index 000000000..52e9bd1df
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/0001-gen8-Fix-the-YUV-RGB-shader.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/0001-gen8-Fix-the-YUV-RGB-shader.patch
new file mode 100644
index 000000000..35762192f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/0001-gen8-Fix-the-YUV-RGB-shader.patch
@@ -0,0 +1,65 @@
+From c43617b739e358064396912c7a7a8028ca91d201 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@linux.intel.com>
+Date: Thu, 16 Apr 2015 20:40:39 +0300
+Subject: [PATCH] gen8: Fix the YUV->RGB shader
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Use the correct register (Yn_01) with first half of the
+Y samples instead of using the register (Yn_23) with the
+second half twice when computing the green channel.
+
+Also use the Yn_01 register name instead of Yn for the red
+channel as well, just for a bit of extra consistency.
+
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89807
+Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
+Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+Upstream-Status: Backport
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+---
+ src/render_program/exa_wm_yuv_rgb.g8a | 4 ++--
+ src/render_program/exa_wm_yuv_rgb.g8b | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/render_program/exa_wm_yuv_rgb.g8a b/src/render_program/exa_wm_yuv_rgb.g8a
+index 7def093..34973ba 100644
+--- a/src/render_program/exa_wm_yuv_rgb.g8a
++++ b/src/render_program/exa_wm_yuv_rgb.g8a
+@@ -76,7 +76,7 @@ add (16) Cbn<1>F Cb<8,8,1>F -0.501961F { compr align1 };
+ /*
+ * R = Y + Cr * 1.596
+ */
+-mov (8) acc0<1>F Yn<8,8,1>F { compr align1 };
++mov (8) acc0<1>F Yn_01<8,8,1>F { compr align1 };
+ mac.sat(8) src_sample_r_01<1>F Crn_01<8,8,1>F 1.596F { compr align1 };
+
+ mov (8) acc0<1>F Yn_23<8,8,1>F { compr align1 };
+@@ -84,7 +84,7 @@ mac.sat(8) src_sample_r_23<1>F Crn_23<8,8,1>F 1.596F { compr align1 };
+ /*
+ * G = Crn * -0.813 + Cbn * -0.392 + Y
+ */
+-mov (8) acc0<1>F Yn_23<8,8,1>F { compr align1 };
++mov (8) acc0<1>F Yn_01<8,8,1>F { compr align1 };
+ mac (8) acc0<1>F Crn_01<8,8,1>F -0.813F { compr align1 };
+ mac.sat(8) src_sample_g_01<1>F Cbn_01<8,8,1>F -0.392F { compr align1 };
+
+diff --git a/src/render_program/exa_wm_yuv_rgb.g8b b/src/render_program/exa_wm_yuv_rgb.g8b
+index 4494953..2cd6fc4 100644
+--- a/src/render_program/exa_wm_yuv_rgb.g8b
++++ b/src/render_program/exa_wm_yuv_rgb.g8b
+@@ -6,7 +6,7 @@
+ { 0x80600048, 0x21c03ae8, 0x3e8d02c0, 0x3fcc49ba },
+ { 0x00600001, 0x24003ae0, 0x008d0320, 0x00000000 },
+ { 0x80600048, 0x21e03ae8, 0x3e8d02e0, 0x3fcc49ba },
+- { 0x00600001, 0x24003ae0, 0x008d0320, 0x00000000 },
++ { 0x00600001, 0x24003ae0, 0x008d0300, 0x00000000 },
+ { 0x00600048, 0x24003ae0, 0x3e8d02c0, 0xbf5020c5 },
+ { 0x80600048, 0x22003ae8, 0x3e8d0340, 0xbec8b439 },
+ { 0x00600001, 0x24003ae0, 0x008d0320, 0x00000000 },
+--
+2.5.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/0001-uxa-fix-the-call-to-PixmapSyncDirtyHelper-broken-by-.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/0001-uxa-fix-the-call-to-PixmapSyncDirtyHelper-broken-by-.patch
new file mode 100644
index 000000000..29924bb90
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/0001-uxa-fix-the-call-to-PixmapSyncDirtyHelper-broken-by-.patch
@@ -0,0 +1,30 @@
+From 2c5063938cc809f624e56efd4673041fa8141e81 Mon Sep 17 00:00:00 2001
+From: Martin Peres <martin.peres@linux.intel.com>
+Date: Thu, 9 Jul 2015 11:26:38 +0300
+Subject: [PATCH] uxa: fix the call to PixmapSyncDirtyHelper, broken by
+ xserver's 90db5ed
+
+[ickle: switch to HAS_DIRTYTRACKING_ROTATION as suggested by Dave Airlie]
+Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
+
+Upstream-Status: Backport
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+---
+ src/compat-api.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/compat-api.h b/src/compat-api.h
+index aa93bee..293e9d7 100644
+--- a/src/compat-api.h
++++ b/src/compat-api.h
+@@ -247,3 +247,7 @@ static inline void FreePixmap(PixmapPtr pixmap)
+ #endif
+
+ #endif
++
++#if HAS_DIRTYTRACKING_ROTATION
++#define PixmapSyncDirtyHelper(d, dd) PixmapSyncDirtyHelper(d)
++#endif
+--
+2.5.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/always_include_xorg_server.h.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/disable-x11-dri3.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/disable-x11-dri3.patch
new file mode 100644
index 000000000..dda508dcf
--- /dev/null
+++ b/import-layers/yocto-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
+@@ -251 +251 @@ fi
+-PKG_CHECK_MODULES(X11_DRI3, [xcb-dri3 xcb-sync xcb-present x11-xcb xshmfence x11 xrender xext libdrm], [x11_dri3="yes"], [x11_dri3="no"])
++#PKG_CHECK_MODULES(X11_DRI3, [xcb-dri3 xcb-sync xcb-present x11-xcb xshmfence x11 xrender xext libdrm], [x11_dri3="yes"], [x11_dri3="no"])
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/sna-Protect-against-ABI-breakage-in-recent-versions-.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/sna-Protect-against-ABI-breakage-in-recent-versions-.patch
new file mode 100644
index 000000000..589d52e0f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/sna-Protect-against-ABI-breakage-in-recent-versions-.patch
@@ -0,0 +1,70 @@
+From 7fe2b2948652443ff43d907855bd7a051d54d309 Mon Sep 17 00:00:00 2001
+From: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Thu, 19 Mar 2015 23:14:17 +0000
+Subject: [PATCH] sna: Protect against ABI breakage in recent versions of
+ libdrm
+
+commit 7fe2b2948652443ff43d907855bd7a051d54d309 upstream.
+
+Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+Upstream-Status: Backport
+Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
+
+diff --git a/src/sna/kgem.c b/src/sna/kgem.c
+index 11f0828f2bbc..6f16cbac87f2 100644
+--- a/src/sna/kgem.c
++++ b/src/sna/kgem.c
+@@ -182,6 +182,15 @@ struct local_i915_gem_caching {
+ #define LOCAL_IOCTL_I915_GEM_SET_CACHING DRM_IOW(DRM_COMMAND_BASE + LOCAL_I915_GEM_SET_CACHING, struct local_i915_gem_caching)
+ #define LOCAL_IOCTL_I915_GEM_GET_CACHING DRM_IOW(DRM_COMMAND_BASE + LOCAL_I915_GEM_GET_CACHING, struct local_i915_gem_caching)
+
++struct local_i915_gem_mmap {
++ uint32_t handle;
++ uint32_t pad;
++ uint64_t offset;
++ uint64_t size;
++ uint64_t addr_ptr;
++};
++#define LOCAL_IOCTL_I915_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP, struct local_i915_gem_mmap)
++
+ struct local_i915_gem_mmap2 {
+ uint32_t handle;
+ uint32_t pad;
+@@ -514,15 +523,15 @@ retry_wc:
+
+ static void *__kgem_bo_map__cpu(struct kgem *kgem, struct kgem_bo *bo)
+ {
+- struct drm_i915_gem_mmap mmap_arg;
++ struct local_i915_gem_mmap arg;
+ int err;
+
+ retry:
+- VG_CLEAR(mmap_arg);
+- mmap_arg.handle = bo->handle;
+- mmap_arg.offset = 0;
+- mmap_arg.size = bytes(bo);
+- if ((err = do_ioctl(kgem->fd, DRM_IOCTL_I915_GEM_MMAP, &mmap_arg))) {
++ VG_CLEAR(arg);
++ arg.handle = bo->handle;
++ arg.offset = 0;
++ arg.size = bytes(bo);
++ if ((err = do_ioctl(kgem->fd, LOCAL_IOCTL_I915_GEM_MMAP, &arg))) {
+ assert(err != EINVAL);
+
+ if (__kgem_throttle_retire(kgem, 0))
+@@ -536,10 +545,10 @@ retry:
+ return NULL;
+ }
+
+- VG(VALGRIND_MAKE_MEM_DEFINED(mmap_arg.addr_ptr, bytes(bo)));
++ VG(VALGRIND_MAKE_MEM_DEFINED(arg.addr_ptr, bytes(bo)));
+
+ DBG(("%s: caching CPU vma for %d\n", __FUNCTION__, bo->handle));
+- return bo->map__cpu = (void *)(uintptr_t)mmap_arg.addr_ptr;
++ return bo->map__cpu = (void *)(uintptr_t)arg.addr_ptr;
+ }
+
+ static int gem_write(int fd, uint32_t handle,
+--
+2.4.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/udev-fstat.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/udev-fstat.patch
new file mode 100644
index 000000000..0e675ee9f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/udev-fstat.patch
@@ -0,0 +1,59 @@
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From 12af8a575d1518d40416f83195049157c3a062a5 Mon Sep 17 00:00:00 2001
+From: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Tue, 24 Feb 2015 15:25:40 +0000
+Subject: sna: udev integration depends on fstat and sys/stat.h
+
+src/sna/sna_driver.c: In function 'sna_handle_uevents':
+src/sna/sna_driver.c:759:2: error: implicit declaration of function 'fstat' [-Werror=implicit-function-declaration]
+
+Also take the opportunity to include udev support in the configure
+summary.
+
+Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+diff --git a/configure.ac b/configure.ac
+index 7476e2b..de3a4b3 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -197,11 +197,15 @@ AC_ARG_ENABLE(udev,
+
+ if test "x$UDEV" != "xno"; then
+ PKG_CHECK_MODULES(UDEV, [libudev], [udev="yes"], [udev="no"])
++ AC_CHECK_HEADERS([sys/stat.h], [], [udev="no"])
+ if test "x$UDEV" = "xyes" -a "x$udev" != "xyes"; then
+ AC_MSG_ERROR([udev support requested but not found (libudev)])
+ fi
+ if test "x$udev" = "xyes"; then
+ AC_DEFINE(HAVE_UDEV,1,[Enable udev-based monitor hotplug detection])
++ udev_msg=" yes"
++ else
++ udev_msg=" no"
+ fi
+ fi
+
+@@ -911,6 +915,7 @@ echo " Support for Kernel Mode Setting? $KMS"
+ echo " Support for legacy User Mode Setting (for i810)? $UMS"
+ echo " Support for Direct Rendering Infrastructure:$dri_msg"
+ echo " Support for Xv motion compensation (XvMC and libXvMC):$xvmc_msg"
++echo " Support for display hotplug notifications (udev):$udev_msg"
+ echo " Build additional tools and utilities?$tools_msg"
+ if test -n "$xp_msg"; then
+ echo " Experimental support:$xp_msg"
+diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
+index 8c0d0b5..bc20ef0 100644
+--- a/src/sna/sna_driver.c
++++ b/src/sna/sna_driver.c
+@@ -740,6 +740,8 @@ sna_wakeup_handler(WAKEUPHANDLER_ARGS_DECL)
+ }
+
+ #if HAVE_UDEV
++#include <sys/stat.h>
++
+ static void
+ sna_handle_uevents(int fd, void *closure)
+ {
+--
+cgit v0.10.2
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-intel_2.99.917.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-intel_2.99.917.bb
new file mode 100644
index 000000000..d75b44f17
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-intel_2.99.917.bb
@@ -0,0 +1,42 @@
+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"
+
+SRC_URI += "file://disable-x11-dri3.patch \
+ file://always_include_xorg_server.h.patch \
+ file://sna-Protect-against-ABI-breakage-in-recent-versions-.patch \
+ file://udev-fstat.patch \
+ file://0001-uxa-fix-the-call-to-PixmapSyncDirtyHelper-broken-by-.patch \
+ file://0001-gen8-Fix-the-YUV-RGB-shader.patch \
+ "
+
+SRC_URI[md5sum] = "fa196a66e52c0c624fe5d350af7a5e7b"
+SRC_URI[sha256sum] = "00b781eea055582820a123c47b62411bdf6aabf4f03dc0568faec55faf9667c9"
+
+DEPENDS += "virtual/libx11 drm libpciaccess pixman"
+
+PACKAGECONFIG ??= "xvmc sna 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 += '${@base_conditional( "ROOTLESS_X", "1", " --enable-kms-only", "", d )}'
+
+COMPATIBLE_HOST = '(i.86|x86_64).*-linux'
+
+FILES_${PN} += "${datadir}/polkit-1"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omap_0.4.4.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omap_0.4.4.bb
new file mode 100644
index 000000000..78954497a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omap_0.4.4.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] = "a364e151a537948f75bb8c9b840a31da"
+SRC_URI[sha256sum] = "a7192690b8638f5c8d611a1bae07cc13081e22edd4070f37a2f5c3f8d79e7ebc"
+
+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.SkipPackage("'opengl' not in DISTRO_FEATURES")
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0001-Prevents-omapfb-from-from-crashing-when-pixelclock-o.patch b/import-layers/yocto-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..c4cf16eb0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0001-Prevents-omapfb-from-from-crashing-when-pixelclock-o.patch
@@ -0,0 +1,35 @@
+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.
+---
+ 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/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0001-Revert-Set-a-large-CRTC-upper-limit-to-not-prune-lar.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0002-Revert-Set-virtual-size-when-configuring-framebuffer.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0003-force-plain-mode.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0003-force-plain-mode.patch
new file mode 100644
index 000000000..67ea7c1a5
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0004-blacklist-tv-out.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0004-blacklist-tv-out.patch
new file mode 100644
index 000000000..b0ac9a44c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0005-Attempt-to-fix-VRFB.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0006-omapfb-port-to-new-xserver-video-API.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0007-always_include_xorg_server.h.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb_git.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb_git.bb
new file mode 100644
index 000000000..7ebb960f1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-vesa_2.3.4.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-vesa_2.3.4.bb
new file mode 100644
index 000000000..fa251b50e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-vmware/0002-add-option-for-vmwgfx.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-vmware/0002-add-option-for-vmwgfx.patch
new file mode 100644
index 000000000..6039d089a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-vmware/0002-add-option-for-vmwgfx.patch
@@ -0,0 +1,98 @@
+Upstream-Status:Submitted
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From f103d6f570671c649ccd7b225e6d6c9f14371888 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Wed, 25 Jun 2014 16:16:44 +0100
+Subject: [PATCH 2/2] add option for vmwgfx
+
+---
+ configure.ac | 49 ++++++++++++++++++++-----------------------------
+ 1 file changed, 20 insertions(+), 29 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index be40ed7..8e15307 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,39 +116,28 @@ 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
++ 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])
++ # 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])
++ AC_MSG_RESULT([yes])
+ 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
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-vmware_13.1.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-vmware_13.1.0.bb
new file mode 100644
index 000000000..8c891e6ae
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xf86-video-vmware_13.1.0.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] = "0cba22fed4cb639d5c4276f7892c543d"
+SRC_URI[sha256sum] = "3c1d244e4b1b77e92126957965cdc9fb82de4c215c0706a3a8aaff6939e4a0cc"
+
+COMPATIBLE_HOST = '(i.86.*-linux|x86_64.*-linux)'
+
+PACKAGECONFIG ?= ""
+PACKAGECONFIG[vmwgfx] = "--enable-vmwgfx, --disable-vmwgfx, libdrm virtual/mesa"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xorg-driver-common.inc b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xorg-driver-common.inc
new file mode 100644
index 000000000..57a4c827d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xorg-driver-common.inc
@@ -0,0 +1,40 @@
+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', True) or ''
+ abi = "%sxorg-abi-%s-%s" % (mlprefix, name, output.split(".")[0])
+
+ pn = d.getVar("PN", True)
+ d.appendVar('RDEPENDS_' + pn, ' ' + abi)
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xorg-driver-input.inc b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xorg-driver-input.inc
new file mode 100644
index 000000000..c4dba1b19
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xorg-driver-input.inc
@@ -0,0 +1,12 @@
+include 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/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xorg-driver-video.inc b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xorg-driver-video.inc
new file mode 100644
index 000000000..38281e0f2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-driver/xorg-driver-video.inc
@@ -0,0 +1,8 @@
+include 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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/encodings/nocompiler.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/encodings/nocompiler.patch
new file mode 100644
index 000000000..f330c185a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/encodings_1.0.4.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/encodings_1.0.4.bb
new file mode 100644
index 000000000..90846d818
--- /dev/null
+++ b/import-layers/yocto-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 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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/font-alias-1.0.3/nocompiler.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/font-alias-1.0.3/nocompiler.patch
new file mode 100644
index 000000000..0b9fb8ccc
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/font-alias_1.0.3.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/font-alias_1.0.3.bb
new file mode 100644
index 000000000..15e101596
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/font-util_1.3.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/font-util_1.3.1.bb
new file mode 100644
index 000000000..228512498
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/font-util_1.3.1.bb
@@ -0,0 +1,25 @@
+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_PREPROCESS_FUNCS += "fontutil_sysroot_preprocess"
+fontutil_sysroot_preprocess () {
+ sysroot_stage_dir ${D}${datadir}/fonts/ ${SYSROOT_DESTDIR}${datadir}/fonts/
+}
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-font-common.inc b/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-font-common.inc
new file mode 100644
index 000000000..d5267f59a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-font-common.inc
@@ -0,0 +1,42 @@
+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 mkfontdir-native mkfontscale-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}"
+
+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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts.bb
new file mode 100644
index 000000000..9bcd1b2fa
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-1.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-1.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-10.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-10.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-11.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-11.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-13.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-13.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-14.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-14.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-15.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-15.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-16.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-16.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-2.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-2.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-3.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-3.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-4.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-4.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-5.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-5.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-7.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-7.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-8.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-8.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-9.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-9.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-KOI8-R.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-KOI8-R.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13.pcf.gz b/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13.pcf.gz
new file mode 100644
index 000000000..2df635537
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-1.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-1.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-10.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-10.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-13.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-13.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-14.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-14.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-15.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-15.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-16.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-16.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-2.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-2.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-3.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-3.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-4.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-4.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-5.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-5.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-7.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-7.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-8.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-8.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-9.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-9.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B.pcf.gz b/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B.pcf.gz
new file mode 100644
index 000000000..d4c3184c7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-1.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-1.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-10.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-10.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-13.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-13.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-14.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-14.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-15.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-15.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-16.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-16.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-2.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-2.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-3.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-3.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-4.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-4.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-5.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-5.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-7.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-7.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-9.pcf.gz b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-9.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O.pcf.gz b/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O.pcf.gz
new file mode 100644
index 000000000..4a546ddb1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/cursor.pcf.gz b/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/cursor.pcf.gz
new file mode 100644
index 000000000..72eb72bbe
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/cursor.pcf.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/fonts.dir b/import-layers/yocto-poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/fonts.dir
new file mode 100644
index 000000000..0a2718f7b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libdmx_1.1.3.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libdmx_1.1.3.bb
new file mode 100644
index 000000000..e623cee42
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libfontenc_1.1.3.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libfontenc_1.1.3.bb
new file mode 100644
index 000000000..a181f05c2
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libice_1.0.9.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libice_1.0.9.bb
new file mode 100644
index 000000000..5049b7ee0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libice_1.0.9.bb
@@ -0,0 +1,27 @@
+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 ??= ""
+PACKAGECONFIG[arc4] = "ac_cv_lib_bsd_arc4random_buf=yes,ac_cv_lib_bsd_arc4random_buf=no,libbsd"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libpciaccess/0001-Include-config.h-before-anything-else-in-.c.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libpciaccess/0001-Include-config.h-before-anything-else-in-.c.patch
new file mode 100644
index 000000000..e92fc0d95
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libpciaccess/0001-Include-config.h-before-anything-else-in-.c.patch
@@ -0,0 +1,187 @@
+From b14696a55796e739624bbda4f772427032efff2a Mon Sep 17 00:00:00 2001
+From: Julien Cristau <jcristau@debian.org>
+Date: Sun, 26 Apr 2015 15:20:57 +0200
+Subject: [PATCH 1/4] Include config.h before anything else in *.c
+
+Debian bug#749008 <https://bugs.debian.org/749008>
+
+Reported-by: Michael Tautschnig <mt@debian.org>
+Signed-off-by: Julien Cristau <jcristau@debian.org>
+Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+---
+Upstream-Status: Backport
+
+ src/common_capability.c | 3 +++
+ src/common_init.c | 3 +++
+ src/common_interface.c | 3 +++
+ src/common_io.c | 3 +++
+ src/common_iterator.c | 3 +++
+ src/common_map.c | 3 +++
+ src/common_vgaarb_stub.c | 3 +++
+ src/linux_devmem.c | 5 +++--
+ src/openbsd_pci.c | 3 +++
+ src/solx_devfs.c | 3 +++
+ src/x86_pci.c | 4 +++-
+ 11 files changed, 33 insertions(+), 3 deletions(-)
+
+diff --git a/src/common_capability.c b/src/common_capability.c
+index 488743d..15d395d 100644
+--- a/src/common_capability.c
++++ b/src/common_capability.c
+@@ -31,6 +31,9 @@
+ *
+ * \author Ian Romanick <idr@us.ibm.com>
+ */
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
+
+ #include <stdlib.h>
+ #include <stdio.h>
+diff --git a/src/common_init.c b/src/common_init.c
+index b1c0c3e..f7b59bd 100644
+--- a/src/common_init.c
++++ b/src/common_init.c
+@@ -28,6 +28,9 @@
+ *
+ * \author Ian Romanick <idr@us.ibm.com>
+ */
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
+
+ #include <stdlib.h>
+ #include <errno.h>
+diff --git a/src/common_interface.c b/src/common_interface.c
+index 59778cf..cb95e90 100644
+--- a/src/common_interface.c
++++ b/src/common_interface.c
+@@ -28,6 +28,9 @@
+ *
+ * \author Ian Romanick <idr@us.ibm.com>
+ */
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
+
+ #include <stdlib.h>
+ #include <string.h>
+diff --git a/src/common_io.c b/src/common_io.c
+index f5c9e45..e9586ad 100644
+--- a/src/common_io.c
++++ b/src/common_io.c
+@@ -22,6 +22,9 @@
+ * Author:
+ * Adam Jackson <ajax@redhat.com>
+ */
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
+
+ #include <stdlib.h>
+ #include <string.h>
+diff --git a/src/common_iterator.c b/src/common_iterator.c
+index ccf656d..2beb180 100644
+--- a/src/common_iterator.c
++++ b/src/common_iterator.c
+@@ -28,6 +28,9 @@
+ *
+ * \author Ian Romanick <idr@us.ibm.com>
+ */
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
+
+ #include <stdlib.h>
+ #include <string.h>
+diff --git a/src/common_map.c b/src/common_map.c
+index 8757151..f1854bb 100644
+--- a/src/common_map.c
++++ b/src/common_map.c
+@@ -21,6 +21,9 @@
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
+
+ #include <sys/types.h>
+ #include <sys/mman.h>
+diff --git a/src/common_vgaarb_stub.c b/src/common_vgaarb_stub.c
+index 9394273..c1708f6 100644
+--- a/src/common_vgaarb_stub.c
++++ b/src/common_vgaarb_stub.c
+@@ -23,6 +23,9 @@
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
+
+ #include <stdio.h>
+ #include "pciaccess.h"
+diff --git a/src/linux_devmem.c b/src/linux_devmem.c
+index 10e3bde..0d0567c 100644
+--- a/src/linux_devmem.c
++++ b/src/linux_devmem.c
+@@ -32,8 +32,9 @@
+ *
+ * \author Ian Romanick <idr@us.ibm.com>
+ */
+-
+-#define _GNU_SOURCE
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
+
+ #include <stdlib.h>
+ #include <string.h>
+diff --git a/src/openbsd_pci.c b/src/openbsd_pci.c
+index 4d1b5cd..b8ce318 100644
+--- a/src/openbsd_pci.c
++++ b/src/openbsd_pci.c
+@@ -13,6 +13,9 @@
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
+
+ #include <sys/param.h>
+ #include <sys/ioctl.h>
+diff --git a/src/solx_devfs.c b/src/solx_devfs.c
+index f572393..cf96467 100644
+--- a/src/solx_devfs.c
++++ b/src/solx_devfs.c
+@@ -25,6 +25,9 @@
+ /*
+ * Solaris devfs interfaces
+ */
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
+
+ #include <stdlib.h>
+ #include <strings.h>
+diff --git a/src/x86_pci.c b/src/x86_pci.c
+index 49c1cab..32daa04 100644
+--- a/src/x86_pci.c
++++ b/src/x86_pci.c
+@@ -18,8 +18,10 @@
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
+
+-#define _GNU_SOURCE
+ #include <unistd.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libpciaccess/0002-Fix-quoting-issue.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libpciaccess/0002-Fix-quoting-issue.patch
new file mode 100644
index 000000000..16d69a82a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libpciaccess/0002-Fix-quoting-issue.patch
@@ -0,0 +1,34 @@
+From 765e0a38cb8c40f8865af5cb356ffe6039ffb08f Mon Sep 17 00:00:00 2001
+From: Thomas Klausner <wiz@NetBSD.org>
+Date: Sun, 22 Mar 2015 21:38:23 +0100
+Subject: [PATCH 2/4] Fix quoting issue.
+
+m4 has '[]' as quoting characters, so if we want '[]' to
+end up in the configure script, we need to quote them again.
+
+Reported by Greg Troxel <gdt@ir.bbn.com>.
+
+Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
+Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+---
+Upstream-Status: Backport
+
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index e67e9e1..888330b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -76,7 +76,7 @@ case $host_os in
+ ;;
+ *netbsd*)
+ case $host in
+- *i[3-9]86*)
++ *i[[3-9]]86*)
+ PCIACCESS_LIBS="$PCIACCESS_LIBS -li386"
+ ;;
+ *x86_64*|*amd64*)
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libpciaccess/0003-linux_sysfs.c-Include-limits.h-for-PATH_MAX.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libpciaccess/0003-linux_sysfs.c-Include-limits.h-for-PATH_MAX.patch
new file mode 100644
index 000000000..f513c8e59
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libpciaccess/0003-linux_sysfs.c-Include-limits.h-for-PATH_MAX.patch
@@ -0,0 +1,32 @@
+From 6bd2f7f92eae713663f4e13f6e2cb23526607b8c Mon Sep 17 00:00:00 2001
+From: Felix Janda <felix.janda@posteo.de>
+Date: Fri, 1 May 2015 16:36:50 +0200
+Subject: [PATCH 3/4] linux_sysfs.c: Include <limits.h> for PATH_MAX
+
+Fixes compilation with musl libc.
+
+Tested-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+Signed-off-by: Felix Janda <felix.janda@posteo.de>
+Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+---
+Upstream-Status: Backport
+
+ src/linux_sysfs.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/linux_sysfs.c b/src/linux_sysfs.c
+index 50d94cf..3f95e53 100644
+--- a/src/linux_sysfs.c
++++ b/src/linux_sysfs.c
+@@ -45,6 +45,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
++#include <limits.h>
+ #include <sys/mman.h>
+ #include <dirent.h>
+ #include <errno.h>
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libpciaccess/0004-Don-t-include-sys-io.h-on-arm.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libpciaccess_0.13.4.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libpciaccess_0.13.4.bb
new file mode 100644
index 000000000..ffa6a609f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libpciaccess_0.13.4.bb
@@ -0,0 +1,21 @@
+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://0001-Include-config.h-before-anything-else-in-.c.patch \
+ file://0002-Fix-quoting-issue.patch \
+ file://0003-linux_sysfs.c-Include-limits.h-for-PATH_MAX.patch \
+ file://0004-Don-t-include-sys-io.h-on-arm.patch \
+"
+
+SRC_URI[md5sum] = "ace78aec799b1cf6dfaea55d3879ed9f"
+SRC_URI[sha256sum] = "07f864654561e4ac8629a0ef9c8f07fbc1f8592d1b6c418431593e9ba2cf2fcf"
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=277aada5222b9a22fbf3471ff3687068"
+
+REQUIRED_DISTRO_FEATURES = ""
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libpthread-stubs_0.3.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libpthread-stubs_0.3.bb
new file mode 100644
index 000000000..5514c7f5e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libpthread-stubs_0.3.bb
@@ -0,0 +1,25 @@
+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"
+
+#DEPENDS = "xcb-proto xproto libxau libxslt-native"
+# DEPENDS += "xsltproc-native gperf-native"
+
+ALLOW_EMPTY_${PN} = "1"
+
+SRC_URI = "http://xcb.freedesktop.org/dist/libpthread-stubs-${PV}.tar.bz2"
+
+SRC_URI[md5sum] = "e8fa31b42e13f87e8f5a7a2b731db7ee"
+SRC_URI[sha256sum] = "35b6d54e3cc6f3ba28061da81af64b9a92b7b757319098172488a660e3d87299"
+
+inherit autotools pkgconfig
+
+RDEPENDS_${PN}-dev = ""
+RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libsm_1.2.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libsm_1.2.2.bb
new file mode 100644
index 000000000..192513636
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libsm_1.2.2.bb
@@ -0,0 +1,28 @@
+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"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11-diet_1.6.3.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11-diet_1.6.3.bb
new file mode 100644
index 000000000..c0d014825
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11-diet_1.6.3.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] = "2e36b73f8a42143142dda8129f02e4e0"
+SRC_URI[sha256sum] = "cf31a7c39f2f52e8ebd0db95640384e63451f9b014eed2bb7f5de03e8adc8111"
+
+EXTRA_OECONF += "--disable-xlocale"
+
+PACKAGECONFIG ??= ""
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11.inc b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11.inc
new file mode 100644
index 000000000..b04eafbdf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11.inc
@@ -0,0 +1,41 @@
+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"
+
+# Multiple libx11 derivatives from from this file and are selected by virtual/libx11
+# A world build should only build the correct version, not all of them.
+EXCLUDE_FROM_WORLD = "1"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11/X18NCMSstubs.diff b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11/X18NCMSstubs.diff
new file mode 100644
index 000000000..744cedc77
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11/disable_tests.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11/disable_tests.patch
new file mode 100644
index 000000000..c1b6cde53
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11/fix-disable-xlocale.diff b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11/fix-disable-xlocale.diff
new file mode 100644
index 000000000..a7c3984fd
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11/fix-utf8-wrong-define.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11/fix-utf8-wrong-define.patch
new file mode 100644
index 000000000..c6347f5be
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11/libX11-Add-missing-NULL-check.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11/libX11-Add-missing-NULL-check.patch
new file mode 100644
index 000000000..f2abf7c7a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11/libX11-Add-missing-NULL-check.patch
@@ -0,0 +1,72 @@
+From 4d85d5f3bd8afac893738fd88e19d8cb5cf998ff Mon Sep 17 00:00:00 2001
+From: Drew Moseley <drew_moseley@mentor.com>
+Date: Sun, 27 Jul 2014 13:10:07 -0400
+Subject: [PATCH] libX11: Add missing NULL check on im and im->methods
+
+Upstream-Status: Backport (c827edcd1c4a7f920aa25208083b5b58d60d2b44)
+Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
+
+---
+ src/xlibi18n/ICWrap.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff -ru libX11-1.6.2-orig/src/xlibi18n/ICWrap.c libX11-1.6.2/src/xlibi18n/ICWrap.c
+--- libX11-1.6.2-orig/src/xlibi18n/ICWrap.c 2014-07-27 13:38:29.586666449 -0400
++++ libX11-1.6.2/src/xlibi18n/ICWrap.c 2014-07-27 13:41:39.671609030 -0400
+@@ -169,7 +169,7 @@
+ va_list var;
+ int total_count;
+ XIMArg *args;
+- char *ret;
++ char *ret = NULL;
+
+ /*
+ * so count the stuff dangling here
+@@ -185,7 +185,8 @@
+ _XIMVaToNestedList(var, total_count, &args);
+ va_end(var);
+
+- ret = (*im->methods->set_values) (im, args);
++ if (im && im->methods)
++ ret = (*im->methods->set_values) (im, args);
+ Xfree(args);
+ return ret;
+ }
+@@ -196,7 +197,7 @@
+ va_list var;
+ int total_count;
+ XIMArg *args;
+- char *ret;
++ char *ret = NULL;
+
+ /*
+ * so count the stuff dangling here
+@@ -212,7 +213,8 @@
+ _XIMVaToNestedList(var, total_count, &args);
+ va_end(var);
+
+- ret = (*im->methods->get_values) (im, args);
++ if (im && im->methods)
++ ret = (*im->methods->get_values) (im, args);
+ Xfree(args);
+ return ret;
+ }
+@@ -228,7 +230,7 @@
+ va_list var;
+ int total_count;
+ XIMArg *args;
+- XIC ic;
++ XIC ic = NULL;
+
+ /*
+ * so count the stuff dangling here
+@@ -244,7 +246,8 @@
+ _XIMVaToNestedList(var, total_count, &args);
+ va_end(var);
+
+- ic = (XIC) (*im->methods->create_ic) (im, args);
++ if (im && im->methods)
++ ic = (XIC) (*im->methods->create_ic) (im, args);
+ Xfree(args);
+ if (ic) {
+ ic->core.next = im->core.ic_chain;
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11_1.6.3.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11_1.6.3.bb
new file mode 100644
index 000000000..8e531c745
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libx11_1.6.3.bb
@@ -0,0 +1,11 @@
+require libx11.inc
+inherit gettext
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI += "file://disable_tests.patch \
+ file://libX11-Add-missing-NULL-check.patch \
+ "
+
+SRC_URI[md5sum] = "2e36b73f8a42143142dda8129f02e4e0"
+SRC_URI[sha256sum] = "cf31a7c39f2f52e8ebd0db95640384e63451f9b014eed2bb7f5de03e8adc8111"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxau_1.0.8.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxau_1.0.8.bb
new file mode 100644
index 000000000..2ef8bfa8b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxcalibrate/fix-xcb.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxcalibrate/fix-xcb.patch
new file mode 100644
index 000000000..d6148834a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxcalibrate_git.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxcalibrate_git.bb
new file mode 100644
index 000000000..455e869c7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxcalibrate_git.bb
@@ -0,0 +1,22 @@
+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"
+
+S = "${WORKDIR}/git"
+
+FILES_${PN}-locale += "${datadir}/X11/locale"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxcb/disable-check.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxcb/disable-check.patch
new file mode 100644
index 000000000..5641c0fe9
--- /dev/null
+++ b/import-layers/yocto-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>
+
+
+diff --git a/configure.ac b/configure.ac
+index 6d7c9a5..22cceb9 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -21,7 +21,8 @@ AC_USE_SYSTEM_EXTENSIONS
+
+ AM_PATH_PYTHON([2.6])
+
+-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)
+
+ AC_CONFIG_HEADERS([src/config.h])
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxcb/gcc-mips-pr68302-mips-workaround.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxcb/gcc-mips-pr68302-mips-workaround.patch
new file mode 100644
index 000000000..698d038f9
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxcb/xcbincludedir.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxcb/xcbincludedir.patch
new file mode 100644
index 000000000..46297c33c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxcb_1.11.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxcb_1.11.1.bb
new file mode 100644
index 000000000..0856c190a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxcb_1.11.1.bb
@@ -0,0 +1,36 @@
+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 \
+ "
+SRC_URI[md5sum] = "f97a65e6158775de518ac391935634c2"
+SRC_URI[sha256sum] = "b720fd6c7d200e5371affdb3f049cc8f88cff9aed942ff1b824d95eedbf69d30"
+
+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 = ""
+
+python populate_packages_prepend () {
+ do_split_packages(d, '${libdir}', '^libxcb-(.*)\.so\..*$', 'libxcb-%s', 'XCB library module for %s', allow_links=True)
+}
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxcomposite/change-include-order.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxcomposite/change-include-order.patch
new file mode 100644
index 000000000..60331f6e7
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxcomposite_0.4.4.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxcomposite_0.4.4.bb
new file mode 100644
index 000000000..70257194a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxcursor_1.1.14.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxcursor_1.1.14.bb
new file mode 100644
index 000000000..a8e4f24b6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxcursor_1.1.14.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"
+
+PE = "1"
+
+XORG_PN = "libXcursor"
+
+SRC_URI[md5sum] = "1e7c17afbbce83e2215917047c57d1b3"
+SRC_URI[sha256sum] = "9bc6acb21ca14da51bda5bc912c8955bc6e5e433f0ab00c5e8bef842596c33df"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxdamage_1.1.4.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxdamage_1.1.4.bb
new file mode 100644
index 000000000..c3d70043c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxdmcp_1.1.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxdmcp_1.1.2.bb
new file mode 100644
index 000000000..f4e30d93d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxext_1.3.3.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxext_1.3.3.bb
new file mode 100644
index 000000000..efa8b65ac
--- /dev/null
+++ b/import-layers/yocto-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 libxau libxdmcp"
+PROVIDES = "xext"
+
+PE = "1"
+
+XORG_PN = "libXext"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "52df7c4c1f0badd9f82ab124fb32eb97"
+SRC_URI[sha256sum] = "b518d4d332231f313371fdefac59e3776f4f0823bcb23cf7c7305bfb57b16e35"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxext_git.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxext_git.bb
new file mode 100644
index 000000000..b799186ef
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxext_git.bb
@@ -0,0 +1,24 @@
+require xorg-lib-common.inc
+
+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."
+
+DEPENDS += "xproto virtual/libx11 xextproto libxau libxdmcp"
+PROVIDES = "xext"
+SRCREV = "d1f3bc77a48c8e42771579e3fdf3370b35d3209d"
+PE = "1"
+PV = "1.0.99.1+gitr${SRCPV}"
+
+XORG_PN = "libXext"
+
+SRC_URI = "git://anongit.freedesktop.org/git/xorg/lib/${XORG_PN}"
+S = "${WORKDIR}/git/"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxfixes_5.0.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxfixes_5.0.1.bb
new file mode 100644
index 000000000..6e2740c9a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxfixes_5.0.1.bb
@@ -0,0 +1,22 @@
+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] = "b985b85f8b9386c85ddcfe1073906b4d"
+SRC_URI[sha256sum] = "63bec085084fa3caaee5180490dd871f1eb2020ba9e9b39a30f93693ffc34767"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxfont_1.5.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxfont_1.5.1.bb
new file mode 100644
index 000000000..1b6e33c71
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxfont_1.5.1.bb
@@ -0,0 +1,22 @@
+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] = "96f76ba94b4c909230bac1e2dcd551c4"
+SRC_URI[sha256sum] = "b70898527c73f9758f551bbab612af611b8a0962202829568d94f3edf4d86098"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxft_2.3.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxft_2.3.2.bb
new file mode 100644
index 000000000..a967cdc58
--- /dev/null
+++ b/import-layers/yocto-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', True):
+ d.setVar('PKG_${PN}', '${MLPREFIX}libxft2')
+}
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxi_1.7.6.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxi_1.7.6.bb
new file mode 100644
index 000000000..752347969
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxi_1.7.6.bb
@@ -0,0 +1,21 @@
+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] = "510e555ecfffa8d2298a0f42b725e563"
+SRC_URI[sha256sum] = "1f32a552cec0f056c0260bdb32e853cec0673d2f40646ce932ad5a9f0205b7ac"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxinerama_1.1.3.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxinerama_1.1.3.bb
new file mode 100644
index 000000000..027c8043d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxinerama_1.1.3.bb
@@ -0,0 +1,20 @@
+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"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxkbcommon_0.5.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxkbcommon_0.5.0.bb
new file mode 100644
index 000000000..de22a8197
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxkbcommon_0.5.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://COPYING;md5=09457b156e3155972abebcaaaa0cb434"
+LICENSE = "MIT & MIT-style"
+
+DEPENDS = "util-macros flex-native bison-native"
+
+SRC_URI = "http://xkbcommon.org/download/${BPN}-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "2e1faeafcc609c30af3a561a91e84158"
+SRC_URI[sha256sum] = "90bd7824742b9a6f52a6cf80e2cadd6f5349cf600a358d08260772615b89d19c"
+
+UPSTREAM_CHECK_URI = "http://xkbcommon.org/"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--disable-docs"
+
+PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,libxcb xkeyboard-config,"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxkbfile_1.0.9.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxkbfile_1.0.9.bb
new file mode 100644
index 000000000..39a344cca
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxmu_1.1.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxmu_1.1.2.bb
new file mode 100644
index 000000000..003baec6e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxmu_1.1.2.bb
@@ -0,0 +1,32 @@
+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"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxpm_3.5.11.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxpm_3.5.11.bb
new file mode 100644
index 000000000..545874cdd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxpm_3.5.11.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] = "769ee12a43611cdebd38094eaf83f3f0"
+SRC_URI[sha256sum] = "c5bdafa51d1ae30086fac01ab83be8d47fe117b238d3437f8e965434090e041c"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxrandr_1.5.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxrandr_1.5.0.bb
new file mode 100644
index 000000000..abbbae552
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxrandr_1.5.0.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] = "309762867e41c6fd813da880d8a1bc93"
+SRC_URI[sha256sum] = "6f864959b7fc35db11754b270d71106ef5b5cf363426aa58589cb8ac8266de58"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxrender_0.9.9.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxrender_0.9.9.bb
new file mode 100644
index 000000000..9fde04061
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxrender_0.9.9.bb
@@ -0,0 +1,23 @@
+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 xdmcp"
+
+PE = "1"
+
+XORG_PN = "libXrender"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "5db92962b124ca3a8147daae4adbd622"
+SRC_URI[sha256sum] = "fc2fe57980a14092426dffcd1f2d9de0987b9d40adea663bd70d6342c0e9be1a"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxres_1.0.7.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxres_1.0.7.bb
new file mode 100644
index 000000000..8c04c44f8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxres_1.0.7.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] = "45ef29206a6b58254c81bea28ec6c95f"
+SRC_URI[sha256sum] = "26899054aa87f81b17becc68e8645b240f140464cf90c42616ebb263ec5fa0e5"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxscrnsaver_1.2.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxscrnsaver_1.2.2.bb
new file mode 100644
index 000000000..354e5de7f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxshmfence_1.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxshmfence_1.2.bb
new file mode 100644
index 000000000..ae34b1fe4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxshmfence_1.2.bb
@@ -0,0 +1,17 @@
+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[md5sum] = "66662e76899112c0f99e22f2fc775a7e"
+SRC_URI[sha256sum] = "d21b2d1fd78c1efbe1f2c16dae1cb23f8fd231dcf891465b8debe636a9054b0c"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxt/libxt_fix_for_x32.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxt/libxt_fix_for_x32.patch
new file mode 100644
index 000000000..ce6c756df
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxt_1.1.5.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxt_1.1.5.bb
new file mode 100644
index 000000000..c1ed0bb31
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxt_1.1.5.bb
@@ -0,0 +1,33 @@
+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"
+
+BBCLASSEXTEND = "native"
+
+EXTRA_OECONF += "--disable-xkb"
+
+SRC_URI[md5sum] = "8f5b5576fbabba29a05f3ca2226f74d3"
+SRC_URI[sha256sum] = "46eeb6be780211fdd98c5109286618f6707712235fdd19df4ce1e6954f349f1a"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxtst_1.2.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxtst_1.2.2.bb
new file mode 100644
index 000000000..1b0bcf391
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxtst_1.2.2.bb
@@ -0,0 +1,20 @@
+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] = "25c6b366ac3dc7a12c5d79816ce96a59"
+SRC_URI[sha256sum] = "ef0a7ffd577e5f1a25b1663b375679529663a1880151beaa73e9186c8309f6d9"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxv_1.0.10.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxv_1.0.10.bb
new file mode 100644
index 000000000..f02b8b64f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxv_1.0.10.bb
@@ -0,0 +1,18 @@
+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] = "e0af49d7d758b990e6fef629722d4aca"
+SRC_URI[sha256sum] = "55fe92f8686ce8612e2c1bfaf58c057715534419da700bda8d517b1d97914525"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxvmc_1.0.9.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxvmc_1.0.9.bb
new file mode 100644
index 000000000..41e8498a6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxvmc_1.0.9.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] = "eba6b738ed5fdcd8f4203d7c8a470c79"
+SRC_URI[sha256sum] = "0703d7dff6ffc184f1735ca5d4eb9dbb402b522e08e008f2f96aee16c40a5756"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxxf86dga_1.1.4.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxxf86dga_1.1.4.bb
new file mode 100644
index 000000000..695a39637
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxxf86misc_1.0.3.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxxf86misc_1.0.3.bb
new file mode 100644
index 000000000..af6f1f76a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxxf86vm_1.1.4.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/libxxf86vm_1.1.4.bb
new file mode 100644
index 000000000..35f87d271
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/pixman/0001-ARM-qemu-related-workarounds-in-cpu-features-detecti.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/pixman/0001-v3-test-add-a-check-for-FE_DIVBYZERO.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/pixman/0001-v3-test-add-a-check-for-FE_DIVBYZERO.patch
new file mode 100644
index 000000000..6b7c1e62a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/pixman/0001-v3-test-add-a-check-for-FE_DIVBYZERO.patch
@@ -0,0 +1,65 @@
+From fcd5eb9bd0e8674a6f4987a8fce7dc1ba8f9320c Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Thu, 17 Sep 2015 03:08:36 +0200
+Subject: [PATCH] [v3] test: add a check for FE_DIVBYZERO
+
+Some architectures, such as Microblaze and Nios2, currently do not
+implement FE_DIVBYZERO, even though they have <fenv.h> and
+feenableexcept(). This commit adds a configure.ac check to verify
+whether FE_DIVBYZERO is defined or not, and if not, disables the
+problematic code in test/utils.c.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Signed-off-by: Marek Vasut <marex@denx.de>
+Upstream-Status: Backport [commit 4297e9058]
+---
+Changes v1 -> v2:
+
+ * Use the ac_cv_have_decl_FE_DIVBYZERO variable, which is
+ automatically set by AC_CHECK_DECL, to decide whether or not
+ HAVE_FEDIVBYZERO should be defined.
+
+Changes v2 -> v3:
+
+ * Use action-if-yes of AC_CHECK_DECL as suggested in
+ http://lists.freedesktop.org/archives/pixman/2014-February/003176.html
+---
+ configure.ac | 5 +++++
+ test/utils.c | 2 ++
+ 2 files changed, 7 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index f93cc30..424bfd3 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -891,6 +891,11 @@ if test x$have_feenableexcept = xyes; then
+ AC_DEFINE(HAVE_FEENABLEEXCEPT, 1, [Whether we have feenableexcept()])
+ fi
+
++AC_CHECK_DECL([FE_DIVBYZERO],
++ [AC_DEFINE(HAVE_FEDIVBYZERO, 1, [Whether we have FE_DIVBYZERO])],
++ [],
++ [[#include <fenv.h>]])
++
+ AC_CHECK_FUNC(gettimeofday, have_gettimeofday=yes, have_gettimeofday=no)
+ AC_CHECK_HEADER(sys/time.h, have_sys_time_h=yes, have_sys_time_h=no)
+ if test x$have_gettimeofday = xyes && test x$have_sys_time_h = xyes; then
+diff --git a/test/utils.c b/test/utils.c
+index 222d4d5..8657966 100644
+--- a/test/utils.c
++++ b/test/utils.c
+@@ -966,9 +966,11 @@ enable_divbyzero_exceptions (void)
+ {
+ #ifdef HAVE_FENV_H
+ #ifdef HAVE_FEENABLEEXCEPT
++#ifdef HAVE_FEDIVBYZERO
+ feenableexcept (FE_DIVBYZERO);
++#endif
+ #endif
+ #endif
+ }
+
+ void
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/pixman/asm_include.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/pixman/asm_include.patch
new file mode 100644
index 000000000..b52a5707d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/pixman/mips-export-revert.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/pixman/mips-export-revert.patch
new file mode 100644
index 000000000..14a5fd209
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/pixman/mips-export-revert.patch
@@ -0,0 +1,22 @@
+Revert a commit in pixman 0.32.6 which breaks compliation on MIPS machines with
+errors such as:
+
+pixman-0.32.6/pixman/pixman-mips-dspr2-asm.S:4267:
+Error: invalid operands `mflo $14,$ac3'
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+--- b/pixman/pixman-mips-dspr2-asm.h
++++ a/pixman/pixman-mips-dspr2-asm.h
+@@ -72,10 +72,7 @@
+ #define LEAF_MIPS32R2(symbol) \
+ .globl symbol; \
+ .align 2; \
+-#ifdef __ELF__
+- .hidden symbol; \
+ .type symbol, @function; \
+-#endif
+ .ent symbol, 0; \
+ symbol: .frame sp, 0, ra; \
+ .set push; \
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/pixman_0.32.8.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/pixman_0.32.8.bb
new file mode 100644
index 000000000..553ce369b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/pixman_0.32.8.bb
@@ -0,0 +1,42 @@
+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://mips-export-revert.patch \
+ file://asm_include.patch \
+ file://0001-v3-test-add-a-check-for-FE_DIVBYZERO.patch \
+"
+
+SRC_URI[md5sum] = "18d6b62abdb7bc0f8e6b0ddf48986b2c"
+SRC_URI[sha256sum] = "5c63dbb3523fc4d86ed4186677815918a941b7cb390d5eec4f55cb5d66b59fb1"
+
+REQUIRED_DISTRO_FEATURES = ""
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xcb-util-image/clang.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xcb-util-image/clang.patch
new file mode 100644
index 000000000..11e90940a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xcb-util-image_0.4.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xcb-util-image_0.4.0.bb
new file mode 100644
index 000000000..c6bb5a61c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xcb-util-keysyms_0.4.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xcb-util-keysyms_0.4.0.bb
new file mode 100644
index 000000000..bca64ed61
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xcb-util-renderutil_0.3.9.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xcb-util-renderutil_0.3.9.bb
new file mode 100644
index 000000000..25c22e5fa
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xcb-util-wm_0.4.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xcb-util-wm_0.4.1.bb
new file mode 100644
index 000000000..39f138329
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xcb-util.inc b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xcb-util.inc
new file mode 100644
index 000000000..99d04f9d4
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xcb-util_0.4.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xcb-util_0.4.0.bb
new file mode 100644
index 000000000..206f07a65
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xkeyboard-config_2.16.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xkeyboard-config_2.16.bb
new file mode 100644
index 000000000..16a1f4f31
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xkeyboard-config_2.16.bb
@@ -0,0 +1,31 @@
+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] = "bf6aa31195584cfce01b2194c3e5ea26"
+SRC_URI[sha256sum] = "1e8a1f212c96b7f71ca0b05da361cac1816d27baae1d8e03e7b53049b58d1d58"
+
+SECTION = "x11/libs"
+DEPENDS = "intltool-native virtual/gettext 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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xorg-lib-common.inc b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xorg-lib-common.inc
new file mode 100644
index 000000000..6f4e44454
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xtrans_1.3.5.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-lib/xtrans_1.3.5.bb
new file mode 100644
index 000000000..d5b7f1a2c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/bigreqsproto_1.1.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/bigreqsproto_1.1.2.bb
new file mode 100644
index 000000000..f798a4353
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/calibrateproto/fix.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/calibrateproto/fix.patch
new file mode 100644
index 000000000..ff8cb25cd
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/calibrateproto_git.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/calibrateproto_git.bb
new file mode 100644
index 000000000..b88d15792
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/calibrateproto_git.bb
@@ -0,0 +1,19 @@
+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"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/compositeproto_0.4.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/compositeproto_0.4.2.bb
new file mode 100644
index 000000000..adfee2630
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/damageproto_1.2.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/damageproto_1.2.1.bb
new file mode 100644
index 000000000..75d026810
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/dmxproto_2.3.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/dmxproto_2.3.1.bb
new file mode 100644
index 000000000..d960e5d4c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/dri2proto_2.8.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/dri2proto_2.8.bb
new file mode 100644
index 000000000..f4c40c571
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/dri2proto_git.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/dri2proto_git.bb
new file mode 100644
index 000000000..9074f48d4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/dri2proto_git.bb
@@ -0,0 +1,18 @@
+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."
+
+SRCREV = "66c56ab10d917e3f47f93178d7eac6430970d3c4"
+PV = "1.99.3+git${SRCPV}"
+PR = "r2"
+
+SRC_URI = "git://anongit.freedesktop.org/git/xorg/proto/dri2proto"
+
+LIC_FILES_CHKSUM="file://COPYING;md5=2e396fa91834f8786032cad2da5638f3"
+
+S = "${WORKDIR}/git"
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/dri3proto_1.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/dri3proto_1.0.bb
new file mode 100644
index 000000000..bed97b3f4
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/fixesproto_5.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/fixesproto_5.0.bb
new file mode 100644
index 000000000..39fb88d84
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/fontsproto_2.1.3.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/fontsproto_2.1.3.bb
new file mode 100644
index 000000000..27fc28174
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/glproto_1.4.17.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/glproto_1.4.17.bb
new file mode 100644
index 000000000..eb03d33c2
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/inputproto_2.3.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/inputproto_2.3.1.bb
new file mode 100644
index 000000000..7e8e0c155
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/inputproto_2.3.1.bb
@@ -0,0 +1,20 @@
+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] = "6caebead4b779ba031727f66a7ffa358"
+SRC_URI[sha256sum] = "5a47ee62053a6acef3a83f506312494be1461068d0b9269d818839703b95c1d1"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/inputproto_git.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/inputproto_git.bb
new file mode 100644
index 000000000..6520f3bb0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/inputproto_git.bb
@@ -0,0 +1,19 @@
+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."
+
+PR = "r1"
+PE = "1"
+SRCREV = "7203036522ba9d4b224d282d6afc2d0b947711ee"
+PV = "1.9.99.12+git${SRCPV}"
+
+SRC_URI = "git://anongit.freedesktop.org/git/xorg/proto/inputproto"
+S = "${WORKDIR}/git"
+
+inherit gettext
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/kbproto_1.0.7.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/kbproto_1.0.7.bb
new file mode 100644
index 000000000..46f5c92b6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/presentproto_git.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/presentproto_git.bb
new file mode 100644
index 000000000..dbb6f32bc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/presentproto_git.bb
@@ -0,0 +1,24 @@
+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 = "24f3a56e541b0a9e6c6ee76081f441221a120ef9"
+PV = "1.0+git${SRCPV}"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=47e508ca280fde97906eacb77892c3ac"
+
+SRC_URI = "git://anongit.freedesktop.org/git/xorg/proto/presentproto"
+S = "${WORKDIR}/git"
+
+PR = "r1"
+
+inherit autotools
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/randrproto_1.5.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/randrproto_1.5.0.bb
new file mode 100644
index 000000000..b59e52513
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/recordproto_1.14.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/recordproto_1.14.2.bb
new file mode 100644
index 000000000..ad2317c26
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/renderproto_0.11.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/renderproto_0.11.1.bb
new file mode 100644
index 000000000..ff800ec83
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/resourceproto_1.2.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/resourceproto_1.2.0.bb
new file mode 100644
index 000000000..08b610aea
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/scrnsaverproto_1.2.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/scrnsaverproto_1.2.2.bb
new file mode 100644
index 000000000..ab07f518c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/videoproto_2.3.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/videoproto_2.3.2.bb
new file mode 100644
index 000000000..53aa7593b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/videoproto_2.3.2.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] = "e658641595327d3990eab70fdb55ca8b"
+SRC_URI[sha256sum] = "8dae168cb820fcd32f564879afb3f24d27c176300d9af66819a18265539bd4b6"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xcb-proto.inc b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xcb-proto.inc
new file mode 100644
index 000000000..8703d6391
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xcb-proto.inc
@@ -0,0 +1,26 @@
+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-X"
+
+SRC_URI = "http://xcb.freedesktop.org/dist/xcb-proto-${PV}.tar.bz2 \
+ file://no-python-native.patch"
+
+inherit autotools pkgconfig
+
+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"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xcb-proto/no-python-native.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xcb-proto/no-python-native.patch
new file mode 100644
index 000000000..f808e1963
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xcb-proto/no-python-native.patch
@@ -0,0 +1,27 @@
+Upstream uses AM_PATH_PYTHON to find a python binary and ask it where to install
+libraries. This means we either need to depend on python-native (large build
+dependency, early in the build) or use the host python (pythondir reflects the
+host and not the target, breaks builds).
+
+The third option is to just hardcode the path where the module goes, as most
+callers of the code use pkg-config to find where it was installed anyway.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/configure.ac b/configure.ac
+index d140bfe..c7b68da 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -14,7 +14,10 @@ if test "$XMLLINT" = "no"; then
+ AC_MSG_WARN([xmllint not found; unable to validate against schema.])
+ fi
+
+-AM_PATH_PYTHON([2.5])
++pythondir="${libdir}/xcb-proto"
++AC_SUBST(pythondir)
++PYTHON="python"
++AC_SUBST(PYTHON)
+
+ xcbincludedir='${datadir}/xcb'
+ AC_SUBST(xcbincludedir)
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xcb-proto_1.11.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xcb-proto_1.11.bb
new file mode 100644
index 000000000..5bc5a112e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xcb-proto_1.11.bb
@@ -0,0 +1,9 @@
+include xcb-proto.inc
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d763b081cb10c223435b01e00dc0aba7 \
+ file://src/dri2.xml;beginline=2;endline=28;md5=f8763b13ff432e8597e0d610cf598e65"
+
+
+SRC_URI[md5sum] = "6bf2797445dc6d43e9e4707c082eff9c"
+SRC_URI[sha256sum] = "b4aceee6502a0ce45fc39b33c541a2df4715d00b72e660ebe8c5bb444771e32e"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xcb-proto_git.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xcb-proto_git.bb
new file mode 100644
index 000000000..2ea4d0421
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xcb-proto_git.bb
@@ -0,0 +1,9 @@
+DEFAULT_PREFERENCE = "-1"
+
+include xcb-proto.inc
+SRCREV = "d81ca233e98be8fa59e8c90d262c0516944c5a66"
+PV = "1.2+gitr${SRCPV}"
+PR = "r4"
+
+SRC_URI = "git://anongit.freedesktop.org/git/xcb/proto"
+S = "${WORKDIR}/git"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xcmiscproto_1.2.2.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xcmiscproto_1.2.2.bb
new file mode 100644
index 000000000..0751b94c9
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xextproto_7.3.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xextproto_7.3.0.bb
new file mode 100644
index 000000000..dd0bd951b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xf86dgaproto_2.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xf86dgaproto_2.1.bb
new file mode 100644
index 000000000..86f3ce328
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xf86driproto_2.1.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xf86driproto_2.1.1.bb
new file mode 100644
index 000000000..b3f9210cc
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xf86miscproto_0.9.3.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xf86miscproto_0.9.3.bb
new file mode 100644
index 000000000..d4663ea88
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xf86vidmodeproto_2.3.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xf86vidmodeproto_2.3.1.bb
new file mode 100644
index 000000000..0f31900a9
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xineramaproto_1.2.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xineramaproto_1.2.1.bb
new file mode 100644
index 000000000..d00774ece
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xineramaproto_1.2.1.bb
@@ -0,0 +1,17 @@
+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"
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xorg-proto-common.inc b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xorg-proto-common.inc
new file mode 100644
index 000000000..7a417c974
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xproto/xproto_fix_for_x32.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xproto/xproto_fix_for_x32.patch
new file mode 100644
index 000000000..540ad27d4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xproto/xproto_fix_for_x32.patch
@@ -0,0 +1,22 @@
+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
+
+--- xproto-7.0.22/Xmd.h.x32 2009-07-11 04:19:50.000000000 -0700
++++ xproto-7.0.22/Xmd.h 2011-11-30 17:14:19.290395893 -0800
+@@ -62,7 +62,6 @@ SOFTWARE.
+ defined(__ia64__) || defined(ia64) || \
+ defined(__sparc64__) || \
+ defined(__s390x__) || \
+- defined(__amd64__) || defined(amd64) || \
+ defined(__powerpc64__)
+ # define LONG64 /* 32/64-bit architecture */
+ # endif
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xproto_7.0.28.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xproto_7.0.28.bb
new file mode 100644
index 000000000..7427a7d53
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-proto/xproto_7.0.28.bb
@@ -0,0 +1,20 @@
+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] = "3ce2f230c5d8fa929f326ad1f0fa40a8"
+SRC_URI[sha256sum] = "29e85568d1f68ceef8a2c081dad9bc0e5500a53cfffde24b564dc43d46ddf6ca"
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-util/gccmakedep_1.0.3.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-util/gccmakedep_1.0.3.bb
new file mode 100644
index 000000000..be3a66744
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-util/makedepend_1.0.5.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-util/makedepend_1.0.5.bb
new file mode 100644
index 000000000..84a967a81
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-util/util-macros_1.19.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-util/util-macros_1.19.0.bb
new file mode 100644
index 000000000..26cf50f2f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-util/util-macros_1.19.0.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] = "40e1caa49a71a26e0aa68ddd00203717"
+SRC_URI[sha256sum] = "0d4df51b29023daf2f63aebf3ebc638ea88efedfd560ab5866741ab3f92acaa1"
+
+# ${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/import-layers/yocto-poky/meta/recipes-graphics/xorg-util/xorg-util-common.inc b/import-layers/yocto-poky/meta/recipes-graphics/xorg-util/xorg-util-common.inc
new file mode 100644
index 000000000..18d022c49
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/10-preload-modules.conf b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/10-preload-modules.conf
new file mode 100644
index 000000000..7ceb6fd63
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/10-preload-modules.conf
@@ -0,0 +1,9 @@
+Section "Module"
+ Load "fbdevhw"
+ Load "fb"
+ Load "shadow"
+ Load "shadowfb"
+ Load "vbe"
+ Load "vgahw"
+EndSection
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuarm/xorg.conf b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuarm/xorg.conf
new file mode 100644
index 000000000..629ae214e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuarm/xorg.conf
@@ -0,0 +1,69 @@
+
+Section "Files"
+EndSection
+
+Section "InputDevice"
+ Identifier "Generic Keyboard"
+ Driver "evdev"
+ Option "CoreKeyboard"
+ Option "Device" "/dev/input/by-path/platform-i8042-serio-0-event-kbd"
+ Option "XkbRules" "xorg"
+ Option "XkbModel" "evdev"
+ Option "XkbLayout" "us"
+EndSection
+
+Section "InputDevice"
+ Identifier "Configured Mouse"
+ Driver "mouse"
+ Option "CorePointer"
+ Option "Device" "/dev/input/mice"
+ Option "Protocol" "ImPS/2"
+ Option "ZAxisMapping" "4 5"
+ Option "Emulate3Buttons" "true"
+EndSection
+
+Section "InputDevice"
+ Identifier "Qemu Tablet"
+ Driver "evdev"
+ Option "CorePointer"
+ Option "Device" "/dev/input/touchscreen0"
+ Option "USB" "on"
+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"
+ InputDevice "Generic Keyboard"
+ # InputDevice "Configured Mouse"
+ InputDevice "QEMU Tablet"
+ Option "AllowEmptyInput" "no"
+EndSection
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemumips/xorg.conf b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemumips/xorg.conf
new file mode 100644
index 000000000..e6c8b514e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemumips/xorg.conf
@@ -0,0 +1,70 @@
+
+Section "Files"
+EndSection
+
+Section "InputDevice"
+ Identifier "Generic Keyboard"
+ Driver "evdev"
+ Option "CoreKeyboard"
+ Option "Device" "/dev/input/by-path/platform-i8042-serio-0-event-kbd"
+ Option "XkbRules" "xorg"
+ Option "XkbModel" "evdev"
+ Option "XkbLayout" "us"
+EndSection
+
+Section "InputDevice"
+ Identifier "Configured Mouse"
+ Driver "mouse"
+ Option "CorePointer"
+ Option "Device" "/dev/input/mice"
+ Option "Protocol" "ImPS/2"
+ Option "ZAxisMapping" "4 5"
+ Option "Emulate3Buttons" "true"
+EndSection
+
+Section "InputDevice"
+ Identifier "Qemu Tablet"
+ Driver "evdev"
+ Option "CorePointer"
+ Option "Device" "/dev/input/touchscreen0"
+ Option "USB" "on"
+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"
+ InputDevice "Generic Keyboard"
+ # InputDevice "Configured Mouse"
+ InputDevice "QEMU Tablet"
+ Option "AllowEmptyInput" "no"
+EndSection
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemumips64/xorg.conf b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemumips64/xorg.conf
new file mode 100644
index 000000000..629ae214e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemumips64/xorg.conf
@@ -0,0 +1,69 @@
+
+Section "Files"
+EndSection
+
+Section "InputDevice"
+ Identifier "Generic Keyboard"
+ Driver "evdev"
+ Option "CoreKeyboard"
+ Option "Device" "/dev/input/by-path/platform-i8042-serio-0-event-kbd"
+ Option "XkbRules" "xorg"
+ Option "XkbModel" "evdev"
+ Option "XkbLayout" "us"
+EndSection
+
+Section "InputDevice"
+ Identifier "Configured Mouse"
+ Driver "mouse"
+ Option "CorePointer"
+ Option "Device" "/dev/input/mice"
+ Option "Protocol" "ImPS/2"
+ Option "ZAxisMapping" "4 5"
+ Option "Emulate3Buttons" "true"
+EndSection
+
+Section "InputDevice"
+ Identifier "Qemu Tablet"
+ Driver "evdev"
+ Option "CorePointer"
+ Option "Device" "/dev/input/touchscreen0"
+ Option "USB" "on"
+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"
+ InputDevice "Generic Keyboard"
+ # InputDevice "Configured Mouse"
+ InputDevice "QEMU Tablet"
+ Option "AllowEmptyInput" "no"
+EndSection
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuppc/xorg.conf b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuppc/xorg.conf
new file mode 100644
index 000000000..629ae214e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuppc/xorg.conf
@@ -0,0 +1,69 @@
+
+Section "Files"
+EndSection
+
+Section "InputDevice"
+ Identifier "Generic Keyboard"
+ Driver "evdev"
+ Option "CoreKeyboard"
+ Option "Device" "/dev/input/by-path/platform-i8042-serio-0-event-kbd"
+ Option "XkbRules" "xorg"
+ Option "XkbModel" "evdev"
+ Option "XkbLayout" "us"
+EndSection
+
+Section "InputDevice"
+ Identifier "Configured Mouse"
+ Driver "mouse"
+ Option "CorePointer"
+ Option "Device" "/dev/input/mice"
+ Option "Protocol" "ImPS/2"
+ Option "ZAxisMapping" "4 5"
+ Option "Emulate3Buttons" "true"
+EndSection
+
+Section "InputDevice"
+ Identifier "Qemu Tablet"
+ Driver "evdev"
+ Option "CorePointer"
+ Option "Device" "/dev/input/touchscreen0"
+ Option "USB" "on"
+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"
+ InputDevice "Generic Keyboard"
+ # InputDevice "Configured Mouse"
+ InputDevice "QEMU Tablet"
+ Option "AllowEmptyInput" "no"
+EndSection
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemush4/xorg.conf b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemush4/xorg.conf
new file mode 100644
index 000000000..629ae214e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemush4/xorg.conf
@@ -0,0 +1,69 @@
+
+Section "Files"
+EndSection
+
+Section "InputDevice"
+ Identifier "Generic Keyboard"
+ Driver "evdev"
+ Option "CoreKeyboard"
+ Option "Device" "/dev/input/by-path/platform-i8042-serio-0-event-kbd"
+ Option "XkbRules" "xorg"
+ Option "XkbModel" "evdev"
+ Option "XkbLayout" "us"
+EndSection
+
+Section "InputDevice"
+ Identifier "Configured Mouse"
+ Driver "mouse"
+ Option "CorePointer"
+ Option "Device" "/dev/input/mice"
+ Option "Protocol" "ImPS/2"
+ Option "ZAxisMapping" "4 5"
+ Option "Emulate3Buttons" "true"
+EndSection
+
+Section "InputDevice"
+ Identifier "Qemu Tablet"
+ Driver "evdev"
+ Option "CorePointer"
+ Option "Device" "/dev/input/touchscreen0"
+ Option "USB" "on"
+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"
+ InputDevice "Generic Keyboard"
+ # InputDevice "Configured Mouse"
+ InputDevice "QEMU Tablet"
+ Option "AllowEmptyInput" "no"
+EndSection
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemux86-64/xorg.conf b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemux86-64/xorg.conf
new file mode 100644
index 000000000..bbda9eaa6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemux86-64/xorg.conf
@@ -0,0 +1,64 @@
+
+Section "Files"
+EndSection
+
+Section "InputDevice"
+ Identifier "Generic Keyboard"
+ Driver "evdev"
+ Option "CoreKeyboard"
+ Option "Device" "/dev/input/by-path/platform-i8042-serio-0-event-kbd"
+ Option "XkbRules" "xorg"
+ Option "XkbModel" "evdev"
+ Option "XkbLayout" "us"
+EndSection
+
+Section "InputDevice"
+ Identifier "Configured Mouse"
+ Driver "vmmouse"
+ Option "CorePointer"
+ Option "Device" "/dev/input/mice"
+ Option "Protocol" "ImPS/2"
+ Option "ZAxisMapping" "4 5"
+ Option "Emulate3Buttons" "true"
+EndSection
+
+Section "InputDevice"
+ Identifier "Qemu Tablet"
+ Driver "evdev"
+ Option "CorePointer"
+ Option "Device" "/dev/input/touchscreen0"
+ Option "USB" "on"
+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"
+ InputDevice "Generic Keyboard"
+ # InputDevice "Configured Mouse"
+ InputDevice "QEMU Tablet"
+ Option "AllowEmptyInput" "no"
+EndSection
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemux86/xorg.conf b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemux86/xorg.conf
new file mode 100644
index 000000000..bbda9eaa6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemux86/xorg.conf
@@ -0,0 +1,64 @@
+
+Section "Files"
+EndSection
+
+Section "InputDevice"
+ Identifier "Generic Keyboard"
+ Driver "evdev"
+ Option "CoreKeyboard"
+ Option "Device" "/dev/input/by-path/platform-i8042-serio-0-event-kbd"
+ Option "XkbRules" "xorg"
+ Option "XkbModel" "evdev"
+ Option "XkbLayout" "us"
+EndSection
+
+Section "InputDevice"
+ Identifier "Configured Mouse"
+ Driver "vmmouse"
+ Option "CorePointer"
+ Option "Device" "/dev/input/mice"
+ Option "Protocol" "ImPS/2"
+ Option "ZAxisMapping" "4 5"
+ Option "Emulate3Buttons" "true"
+EndSection
+
+Section "InputDevice"
+ Identifier "Qemu Tablet"
+ Driver "evdev"
+ Option "CorePointer"
+ Option "Device" "/dev/input/touchscreen0"
+ Option "USB" "on"
+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"
+ InputDevice "Generic Keyboard"
+ # InputDevice "Configured Mouse"
+ InputDevice "QEMU Tablet"
+ Option "AllowEmptyInput" "no"
+EndSection
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/xorg.conf b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/xorg.conf
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/xorg.conf
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bb
new file mode 100644
index 000000000..e07c204c7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bb
@@ -0,0 +1,31 @@
+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"
+
+SRC_URI_append_libc-musl = "\
+ file://10-preload-modules.conf \
+"
+
+S = "${WORKDIR}"
+
+CONFFILES_${PN} = "${sysconfdir}/X11/xorg.conf"
+CONFFILES_${PN}_append_libc-musl = " ${sysconfdir}/X11/xorg.conf.d/10-preload-modules.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
+}
+
+do_install_append_libc-musl () {
+ install -Dm 0644 ${WORKDIR}/10-preload-modules.conf ${D}/${sysconfdir}/X11/xorg.conf.d/10-preload-modules.conf
+}
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc
new file mode 100644
index 000000000..f4c5469b5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc
@@ -0,0 +1,177 @@
+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 libxfont 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_xf86-video-modesetting = "xorg-driver-abi"
+
+XSERVER_RRECOMMENDS = "xkeyboard-config rgb xserver-xf86-config xkbcomp"
+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 \
+"
+
+PACKAGECONFIG ??= "dri2 udev ${XORG_CRYPTO} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'dri glx', '', d)} \
+ ${@bb.utils.contains("DISTRO_FEATURES", "wayland", "xwayland", "", d)} \
+ ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "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[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 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)
+ output = p.communicate()[0]
+ mlprefix = d.getVar('MLPREFIX', True) or ''
+ return "%sxorg-abi-%s-%s" % (mlprefix, name, output.split(".")[0])
+
+ pn = d.getVar("PN", True)
+ d.appendVar("RPROVIDES_" + pn, " " + get_abi("input"))
+ d.appendVar("RPROVIDES_" + pn, " " + get_abi("video"))
+}
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/configure.ac-Use-libsystemd-in-REQUIRED_LIBS-check.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/configure.ac-Use-libsystemd-in-REQUIRED_LIBS-check.patch
new file mode 100644
index 000000000..cd3099952
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/configure.ac-Use-libsystemd-in-REQUIRED_LIBS-check.patch
@@ -0,0 +1,50 @@
+From 0c2153d468229f56e6fef71d2f002e0cae14aa55 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Mon, 16 Nov 2015 16:18:40 +0200
+Subject: [PATCH] configure.ac: Use libsystemd in REQUIRED_LIBS check
+
+REQUIRED_LIBS needs to be set to the correct systemd library,
+otherwise the later check will either fail or use the wrong
+pc file.
+
+Upstream-Status: Submitted [xorg-devel@lists.x.org]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac | 13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 96c0242..f63eca1 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -837,9 +837,16 @@ AC_ARG_WITH([systemd-daemon],
+ [support systemd socket activation (default: auto)]),
+ [WITH_SYSTEMD_DAEMON=$withval], [WITH_SYSTEMD_DAEMON=auto])
+ PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd-daemon],
+- [HAVE_SYSTEMD_DAEMON=yes],
++ [REQUIRED_SYSTEMD_DAEMON=libsystemd-daemon],
+ [PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd],
+- [HAVE_SYSTEMD_DAEMON=yes], [HAVE_SYSTEMD_DAEMON=no])])
++ [REQUIRED_SYSTEMD_DAEMON=libsystemd],
++ [REQUIRED_SYSTEMD_DAEMON=])])
++if test "x$REQUIRED_SYSTEMD_DAEMON" = x; then
++ HAVE_SYSTEMD_DAEMON=no
++else
++ HAVE_SYSTEMD_DAEMON=yes
++fi
++
+ if test "x$WITH_SYSTEMD_DAEMON" = xauto; then
+ WITH_SYSTEMD_DAEMON="$HAVE_SYSTEMD_DAEMON"
+ fi
+@@ -848,7 +855,7 @@ if test "x$WITH_SYSTEMD_DAEMON" = xyes; then
+ AC_MSG_ERROR([systemd support requested but no library has been found])
+ fi
+ AC_DEFINE(HAVE_SYSTEMD_DAEMON, 1, [Define to 1 if libsystemd-daemon is available])
+- REQUIRED_LIBS="$REQUIRED_LIBS libsystemd-daemon"
++ REQUIRED_LIBS="$REQUIRED_LIBS $REQUIRED_SYSTEMD_DAEMON"
+ fi
+ AM_CONDITIONAL([HAVE_SYSTEMD_DAEMON], [test "x$HAVE_SYSTEMD_DAEMON" = "xyes"])
+
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/macro_tweak.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/macro_tweak.patch
new file mode 100644
index 000000000..ec0eea6ca
--- /dev/null
+++ b/import-layers/yocto-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>
+
+diff --git a/xorg-server.m4 b/xorg-server.m4
+index bdecf62..040fdb8 100644
+--- a/xorg-server.m4
++++ b/xorg-server.m4
+@@ -28,10 +28,12 @@ dnl
+ # Checks for the $1 define in xorg-server.h (from the sdk). If it
+ # is defined, then add $1 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/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/modesetting_libdrm_requirements.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/modesetting_libdrm_requirements.patch
new file mode 100644
index 000000000..5f186cb84
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/modesetting_libdrm_requirements.patch
@@ -0,0 +1,30 @@
+From bf23db42a4e5943129501223a47b48884cdeb62f Mon Sep 17 00:00:00 2001
+From: Adam Jackson <ajax@redhat.com>
+Date: Wed, 27 Jan 2016 11:50:13 -0500
+Subject: modesetting: Require sufficiently new libdrm
+
+Bugzilla: https://bugs.freedesktop.org/93883
+Signed-off-by: Adam Jackson <ajax@redhat.com>
+Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+Reviewed-by: Julien Cristau <jcristau@debian.org>
+
+Upstream-Status: Backport
+Signed-off-by: Johannes Pointner <johannes.pointner@gmail.com>
+
+diff --git a/configure.ac b/configure.ac
+index ac3bb64..312fc69 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2035,8 +2035,7 @@ if test "x$XORG" = xyes; then
+
+ if test "x$DRM" = xyes; then
+ dnl 2.4.46 is required for cursor hotspot support.
+- PKG_CHECK_EXISTS(libdrm >= 2.4.46)
+- XORG_DRIVER_MODESETTING=yes
++ PKG_CHECK_EXISTS(libdrm >= 2.4.46, XORG_DRIVER_MODESETTING=yes, XORG_DRIVER_MODESETTING=no)
+ fi
+
+ AC_SUBST([XORG_LIBS])
+--
+cgit v0.10.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/musl-arm-inb-outb.patch b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/musl-arm-inb-outb.patch
new file mode 100644
index 000000000..4be441fb7
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.18.0.bb b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.18.0.bb
new file mode 100644
index 000000000..eb79b4046
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.18.0.bb
@@ -0,0 +1,30 @@
+require xserver-xorg.inc
+
+SRC_URI += "file://configure.ac-Use-libsystemd-in-REQUIRED_LIBS-check.patch \
+ file://musl-arm-inb-outb.patch \
+ file://modesetting_libdrm_requirements.patch \
+ "
+SRC_URI[md5sum] = "3c1c1057d3ad27380d8dd87ffcc182cd"
+SRC_URI[sha256sum] = "195670819695d9cedd8dde95fbe069be0d0f488a77797a2d409f9f702daf312e"
+
+# 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/import-layers/yocto-poky/meta/recipes-graphics/xrestop/xrestop_0.4.bb b/import-layers/yocto-poky/meta/recipes-graphics/xrestop/xrestop_0.4.bb
new file mode 100644
index 000000000..ce5df0393
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-graphics/xtscal/xtscal/30xTs_Calibrate.sh b/import-layers/yocto-poky/meta/recipes-graphics/xtscal/xtscal/30xTs_Calibrate.sh
new file mode 100644
index 000000000..fa43617bd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xtscal/xtscal/30xTs_Calibrate.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+. /etc/formfactor/config
+
+if [ "$HAVE_TOUCHSCREEN" = "1" ]; then
+ n=1
+ while [ ! -z $TSLIB_TSDEVICE ] && [ ! -f /etc/pointercal ] && [ $n -le 5 ]
+ do
+ /usr/bin/xtscal
+ sleep 1
+ n=$(($n+1))
+ done
+fi
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xtscal/xtscal/change-cross.patch b/import-layers/yocto-poky/meta/recipes-graphics/xtscal/xtscal/change-cross.patch
new file mode 100644
index 000000000..1da771786
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xtscal/xtscal/change-cross.patch
@@ -0,0 +1,18 @@
+Upstream-Status: Pending
+
+--- tmp/main.c.orig 2007-01-02 15:39:54.000000000 +0000
++++ tmp/main.c 2007-01-02 15:39:54.000000000 +0000
+@@ -131,9 +131,10 @@
+ {
+ XRenderFillRectangles (dpy, PictOpSrc, pict, &rect_color, rectangles, 2);
+
+- XFillArc (dpy, crosshair_w, crosshair_gc, (CROSSHAIR_SIZE / 2) - (WIDTH / 2) - 1,
+- (CROSSHAIR_SIZE / 2) - (WIDTH / 2) - 1,
+- WIDTH + 1, WIDTH + 1, 0, 360 * 64);
++ XFillRectangle (dpy, crosshair_w, crosshair_gc,
++ (CROSSHAIR_SIZE / 2) - (WIDTH / 2),
++ (CROSSHAIR_SIZE / 2) - (WIDTH / 2),
++ WIDTH, WIDTH);
+ }
+
+ void
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xtscal/xtscal/cleanup.patch b/import-layers/yocto-poky/meta/recipes-graphics/xtscal/xtscal/cleanup.patch
new file mode 100644
index 000000000..f7b0854c3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xtscal/xtscal/cleanup.patch
@@ -0,0 +1,621 @@
+---
+ Makefile.am | 9 --
+ configure.ac | 3
+ gpe-dist.am | 12 ---
+ h3600_ts.h | 216 -----------------------------------------------------------
+ main.c | 210 ++-------------------------------------------------------
+ xtscal.in | 19 -----
+ 6 files changed, 14 insertions(+), 455 deletions(-)
+
+Upstream-Status: Pending
+
+Index: xtscal-0.6.3/xtscal.in
+===================================================================
+--- xtscal-0.6.3.orig/xtscal.in 2004-09-10 20:10:36.000000000 +0100
++++ /dev/null 1970-01-01 00:00:00.000000000 +0000
+@@ -1,19 +0,0 @@
+-#!/bin/sh
+-
+-module_id() {
+- # Get model name
+- echo `grep "^Hardware" /proc/cpuinfo | sed -e "s/.*: *//" | tr a-z A-Z`
+-}
+-
+-case `module_id` in
+- "HP IPAQ H3100" | "HP IPAQ H3800" )
+- ARGS="-rotate 90" ;;
+- "HP IPAQ H3600" | "HP IPAQ H3700" | "HP IPAQ H3900" | *COLLIE | *POODLE)
+- ARGS="-rotate 270" ;;
+- # H2200: works without rotation
+-esac
+-
+-# the things we do for autoconf
+-prefix=@prefix@
+-exec_prefix=@exec_prefix@
+-exec @libexecdir@/xtscal.bin $ARGS $*
+Index: xtscal-0.6.3/main.c
+===================================================================
+--- xtscal-0.6.3.orig/main.c 2007-07-01 01:12:52.000000000 +0100
++++ xtscal-0.6.3/main.c 2007-07-01 01:12:55.000000000 +0100
+@@ -22,12 +22,10 @@
+ #include <X11/Xlib.h>
+
+ #include <X11/extensions/Xrender.h>
+-#include <X11/extensions/Xrandr.h>
+ #include <X11/Xft/Xft.h>
+ #include <X11/extensions/xcalibrate.h>
+ #include <X11/keysym.h>
+
+-#include "h3600_ts.h"
+ #include "calibrate.h"
+
+ Display *dpy;
+@@ -45,15 +43,11 @@ XftColor xftcol;
+ XftDraw *xftdraw;
+ XftFont *xftfont;
+ int screen_x, screen_y;
+-int ts_fd;
+ int samples;
+ Pixmap bg_pixmap;
+ int flag_debug;
+-int rotation = 0;
+ int error_base, event_base;
+
+-int using_xcalibrate;
+-
+ int moving;
+
+ #define CROSSHAIR_SIZE 25
+@@ -63,7 +57,6 @@ int moving;
+ #define ENOUGH 5
+ #define MAX_SAMPLES 40
+
+-#define RAW_DEVICE "/dev/h3600_tsraw"
+ #define FONTNAME "sans-10"
+
+ struct point
+@@ -287,12 +280,8 @@ sort_by_y (const void* a, const void *b)
+ void
+ set_calibration (calibration *cal)
+ {
+- TS_CAL tc;
+- int xtrans, ytrans, xscale, yscale, xyscale, yxscale;
+ calibration ocal = *cal;
+
+- if (using_xcalibrate)
+- {
+ FILE *fp;
+ if (flag_debug)
+ printf ("constants are: %d %d %d %d %d %d %d\n", cal->a[1], cal->a[2], cal->a[0], cal->a[4], cal->a[5], cal->a[3], cal->a[6]);
+@@ -304,29 +293,6 @@ set_calibration (calibration *cal)
+ }
+ fprintf (fp, "%d %d %d %d %d %d %d\n", cal->a[1], cal->a[2], cal->a[0], cal->a[4], cal->a[5], cal->a[3], cal->a[6]);
+ fclose (fp);
+- return;
+- }
+-
+- xtrans = cal->a[0] / cal->a[6];
+- ytrans = cal->a[3] / cal->a[6];
+- xscale = cal->a[1] * 256 / cal->a[6];
+- yscale = cal->a[5] * 256 / cal->a[6];
+- xyscale = cal->a[2] * 256 / cal->a[6];
+- yxscale = cal->a[4] * 256 / cal->a[6];
+-
+- tc.xtrans = xtrans;
+- tc.ytrans = ytrans;
+- tc.xscale = xscale;
+- tc.yscale = yscale;
+- tc.xyswap = 0;
+-
+- printf ("%d %d %d %d %d\n", tc.xscale, tc.xtrans, tc.yscale, tc.ytrans, tc.xyswap);
+-
+- if (ioctl (ts_fd, TS_SET_CAL, (void *)&tc) != 0)
+- {
+- perror ("TS_SET_CAL");
+- exit (1);
+- }
+ }
+
+ void
+@@ -398,80 +364,13 @@ handle_ts_event (int x, int y, int press
+ }
+
+ void
+-read_ts (void)
+-{
+- TS_EVENT ts_ev;
+- int r;
+-
+- r = read (ts_fd, &ts_ev, sizeof (ts_ev));
+- if (r == sizeof (ts_ev))
+- handle_ts_event (ts_ev.x, ts_ev.y, ts_ev.pressure);
+-}
+-
+-void
+-do_cal (char **args)
+-{
+- TS_CAL tc;
+-
+- tc.xscale = atoi (args[0]);
+- tc.xtrans = atoi (args[1]);
+- tc.yscale = atoi (args[2]);
+- tc.ytrans = atoi (args[3]);
+- tc.xyswap = atoi (args[4]);
+-
+- if (flag_debug)
+- fprintf (stderr, "setting: %d %d %d %d %d\n",
+- tc.xtrans, tc.ytrans, tc.xscale, tc.yscale, tc.xyswap);
+-
+- if (ioctl (ts_fd, TS_SET_CAL, (void *)&tc) != 0)
+- {
+- perror ("TS_SET_CAL");
+- exit (1);
+- }
+-
+- exit (0);
+-}
+-
+-void
+-show_cal (void)
+-{
+- TS_CAL tc;
+-
+- if (ioctl (ts_fd, TS_GET_CAL, (void *)&tc) != 0)
+- {
+- perror ("TS_GET_CAL");
+- exit (1);
+- }
+-
+- printf ("%d %d %d %d %d\n", tc.xscale, tc.xtrans, tc.yscale, tc.ytrans, tc.xyswap);
+-}
+-
+-void
+ usage (const char *name)
+ {
+- fprintf (stderr, "usage: %s -view\n", name);
+- fprintf (stderr, " %s [-rotate <0 | 90 | 180 | 270>]\n", name);
+- fprintf (stderr, " %s -cal <xs> <xt> <ys> <yt> <xyswap>\n", name);
+-
++ fprintf (stderr, "usage: %s [-debug]\n", name);
+ exit (1);
+ }
+
+ int
+-xrr_supported (void)
+-{
+- int xrr_event_base, xrr_error_base;
+- int xrr_major, xrr_minor;
+-
+- if (XRRQueryExtension (dpy, &xrr_event_base, &xrr_error_base) == False
+- || XRRQueryVersion (dpy, &xrr_major, &xrr_minor) == 0
+- || xrr_major != 1
+- || xrr_minor < 1)
+- return 0;
+-
+- return 1;
+-}
+-
+-int
+ main (int argc, char *argv[])
+ {
+ XSetWindowAttributes attributes;
+@@ -480,31 +379,11 @@ main (int argc, char *argv[])
+ int max_fd;
+ GC bg_gc;
+ int i;
+- int have_xrandr;
+
+ for (i = 1; i < argc; i++)
+ {
+- if (!strcmp (argv[i], "-view"))
+- {
+- show_cal ();
+- exit (0);
+- }
+- else if (!strcmp (argv[i], "-debug"))
++ if (!strcmp (argv[i], "-debug"))
+ flag_debug = 1;
+- else if (!strcmp (argv[i], "-cal"))
+- {
+- if (argc > (i + 5))
+- do_cal (argv + i + 1);
+- else
+- usage (argv[0]);
+- }
+- else if (!strcmp (argv[i], "-rotate"))
+- {
+- if (argc > (i + 1))
+- rotation = atoi (argv[++i]);
+- else
+- usage (argv[0]);
+- }
+ else
+ usage (argv[0]);
+ }
+@@ -531,48 +410,11 @@ main (int argc, char *argv[])
+ fprintf (stderr, "failed to set raw mode: error %d\n", r);
+ exit (1);
+ }
+-
+- using_xcalibrate = 1;
+- }
+-
+- have_xrandr = xrr_supported ();
+- if (have_xrandr)
+- {
+- XRRScreenConfiguration *rr_screen;
+- Rotation current_rotation;
+-
+- if (flag_debug)
+- fprintf (stderr, "XRANDR is supported\n");
+-
+- rr_screen = XRRGetScreenInfo (dpy, RootWindow (dpy, screen));
+-
+- XRRRotations (dpy, screen, &current_rotation);
+-
+- XRRFreeScreenConfigInfo (rr_screen);
+-
+- if (flag_debug)
+- fprintf (stderr, "Current RANDR rotation is %d\n", current_rotation);
+-
+- switch (current_rotation)
+- {
+- case RR_Rotate_270:
+- rotation += 90;
+- case RR_Rotate_180:
+- rotation += 90;
+- case RR_Rotate_90:
+- rotation += 90;
+- rotation %= 360;
+- case RR_Rotate_0:
+- break;
+- default:
+- fprintf (stderr, "Unknown RANDR rotation: %d\n", current_rotation);
+- break;
+- }
+ }
+ else
+ {
+- if (flag_debug)
+- fprintf (stderr, "XRANDR not supported\n");
++ perror ("XCALIBRATE extension missing");
++ exit (1);
+ }
+
+ attributes.override_redirect = flag_debug ? False : True;
+@@ -666,45 +508,17 @@ main (int argc, char *argv[])
+
+ for (i = 0; i < NR_POINTS; i++)
+ {
+- switch (rotation)
+- {
+- case 0:
+- cal.xfb[i] = cal.xscr[i];
+- cal.yfb[i] = cal.yscr[i];
+- break;
+- case 90:
+- cal.xfb[i] = cal.yscr[i];
+- cal.yfb[i] = screen_x - cal.xscr[i];
+- break;
+- case 180:
+- cal.xfb[i] = screen_x - cal.xscr[i];
+- cal.yfb[i] = screen_y - cal.yscr[i];
+- break;
+- case 270:
+- cal.xfb[i] = screen_y - cal.yscr[i];
+- cal.yfb[i] = cal.xscr[i];
+- break;
+- }
++ cal.xfb[i] = cal.xscr[i];
++ cal.yfb[i] = cal.yscr[i];
++ XCalibrateScreenToCoord (dpy, &cal.xfb[i], &cal.yfb[i]);
+
+ if (flag_debug)
+- printf ("rotation %d: (%d,%d) -> (%d,%d)\n", rotation,
++ printf ("rotation conversion: (%d,%d) -> (%d,%d)\n",
+ cal.xscr[i], cal.yscr[i], cal.xfb[i], cal.yfb[i]);
+ }
+
+ next_event ();
+
+- if (!using_xcalibrate)
+- {
+- ts_fd = open (RAW_DEVICE, O_RDONLY);
+- if (ts_fd < 0)
+- {
+- perror (RAW_DEVICE);
+- exit (1);
+- }
+- }
+-
+- max_fd = (xfd > ts_fd) ? xfd : ts_fd;
+-
+ for (;;)
+ {
+ fd_set fds;
+@@ -713,12 +527,8 @@ main (int argc, char *argv[])
+
+ FD_ZERO (&fds);
+ FD_SET (xfd, &fds);
+- if (ts_fd != -1)
+- FD_SET (ts_fd, &fds);
+
+- select (max_fd + 1, &fds, NULL, NULL, NULL);
+-
+- if (ts_fd != -1 && FD_ISSET (ts_fd, &fds))
+- read_ts ();
++ select (xfd + 1, &fds, NULL, NULL, NULL);
+ }
+ }
++
+Index: xtscal-0.6.3/configure.ac
+===================================================================
+--- xtscal-0.6.3.orig/configure.ac 2004-09-10 20:11:12.000000000 +0100
++++ xtscal-0.6.3/configure.ac 2007-07-01 01:12:55.000000000 +0100
+@@ -9,8 +9,7 @@ AM_INIT_AUTOMAKE([foreign dist-bzip2])
+ # Checks for programs.
+ AC_PROG_CC
+
+-PKG_CHECK_MODULES(XTSCAL, x11 xft xext xrandr xcalibrate)
++PKG_CHECK_MODULES(XTSCAL, x11 xft xext xcalibrate)
+
+ AC_CONFIG_FILES([Makefile])
+-AC_CONFIG_FILES([xtscal])
+ AC_OUTPUT
+Index: xtscal-0.6.3/gpe-dist.am
+===================================================================
+--- xtscal-0.6.3.orig/gpe-dist.am 2004-06-02 23:07:13.000000000 +0100
++++ /dev/null 1970-01-01 00:00:00.000000000 +0000
+@@ -1,12 +0,0 @@
+-CVSTAG := $(shell echo $(PACKAGE)-$(VERSION) | tr [a-z.] [A-Z_])
+-
+-dist-upload: dist
+- scp $(PACKAGE)-$(VERSION).tar.bz2 $(USER)@handhelds.org:/home/ftp/pub/projects/gpe/source/
+-
+-tag:
+- cvs tag $(CVSTAG)
+-
+-retag:
+- cvs tag -F $(CVSTAG)
+-
+-source: tag dist-upload
+Index: xtscal-0.6.3/h3600_ts.h
+===================================================================
+--- xtscal-0.6.3.orig/h3600_ts.h 2003-07-05 17:27:10.000000000 +0100
++++ /dev/null 1970-01-01 00:00:00.000000000 +0000
+@@ -1,216 +0,0 @@
+-/*
+-*
+-* Driver for the H3600 Touch Screen and other Atmel controlled devices.
+-*
+-* Copyright 2000 Compaq Computer Corporation.
+-*
+-* Use consistent with the GNU GPL is permitted,
+-* provided that this copyright notice is
+-* preserved in its entirety in all copies and derived works.
+-*
+-* COMPAQ COMPUTER CORPORATION MAKES NO WARRANTIES, EXPRESSED OR IMPLIED,
+-* AS TO THE USEFULNESS OR CORRECTNESS OF THIS CODE OR ITS
+-* FITNESS FOR ANY PARTICULAR PURPOSE.
+-*
+-* Author: Charles Flynn.
+-*
+-*/
+-
+-
+-#ifndef __H3600_TS_H__
+-#define __H3600_TS_H__
+-
+-#include <linux/ioctl.h>
+-
+-enum h3600_ts_minor_devices {
+- TS_MINOR = 0,
+- TSRAW_MINOR = 1,
+- KEY_MINOR = 2
+-};
+-
+-typedef struct h3600_ts_calibration {
+- int xscale;
+- int xtrans;
+- int yscale;
+- int ytrans;
+- int xyswap;
+-} TS_CAL;
+-
+-typedef struct h3600_ts_event {
+- unsigned short pressure;
+- unsigned short x;
+- unsigned short y;
+- unsigned short pad;
+-} TS_EVENT;
+-
+-/* Deprecated - do not use */
+-typedef struct h3600_ts_return {
+- unsigned short pressure;
+- unsigned short x;
+- unsigned short y;
+- unsigned short pad;
+-} TS_RET;
+-
+-enum power_button_mode {
+- PBM_SUSPEND = 0,
+- PBM_GENERATE_KEYPRESS = 1
+-};
+-
+-
+-/* ++++++++++++++ +++++++++++++++++++++++++++++++++++++ */
+-
+-typedef struct therm_dev {
+- short data;
+-} THERM_DEV;
+-
+-#define H3600_BATT_CHEM_ALKALINE 0x01
+-#define H3600_BATT_CHEM_NICD 0x02
+-#define H3600_BATT_CHEM_NIMH 0x03
+-#define H3600_BATT_CHEM_LION 0x04
+-#define H3600_BATT_CHEM_LIPOLY 0x05
+-#define H3600_BATT_CHEM_NOT_INSTALLED 0x06
+-#define H3600_BATT_CHEM_UNKNOWN 0xff
+-
+-/* These should match the apm_bios.h definitions */
+-#define H3600_AC_STATUS_AC_OFFLINE 0x00
+-#define H3600_AC_STATUS_AC_ONLINE 0x01
+-#define H3600_AC_STATUS_AC_BACKUP 0x02 /* What does this mean? */
+-#define H3600_AC_STATUS_AC_UNKNOWN 0xff
+-
+-/* These bitfields are rarely "or'd" together */
+-#define H3600_BATT_STATUS_HIGH 0x01
+-#define H3600_BATT_STATUS_LOW 0x02
+-#define H3600_BATT_STATUS_CRITICAL 0x04
+-#define H3600_BATT_STATUS_CHARGING 0x08
+-#define H3600_BATT_STATUS_CHARGE_MAIN 0x10
+-#define H3600_BATT_STATUS_DEAD 0x20 /* Battery will not charge */
+-#define H3600_BATT_NOT_INSTALLED 0x20 /* For expansion pack batteries */
+-#define H3600_BATT_STATUS_FULL 0x40 /* Battery fully charged (and connected to AC) */
+-#define H3600_BATT_STATUS_NOBATT 0x80
+-#define H3600_BATT_STATUS_UNKNOWN 0xff
+-
+-struct battery_data {
+- unsigned char chemistry;
+- unsigned char status;
+- unsigned short voltage; /* Voltage for battery #0; unknown for battery #1 */
+- unsigned short percentage; /* Percentage of full charge */
+- unsigned short life; /* Life remaining in minutes */
+-};
+-
+-struct h3600_battery {
+- unsigned char ac_status;
+- unsigned char battery_count; /* How many batteries we have */
+- struct battery_data battery[2];
+-};
+-
+-/* -------- EEPROM and SPI Interfaces ---------------*/
+-
+-#define EEPROM_RD_BUFSIZ 6 /* EEPROM reads are 16 bits */
+-#define EEPROM_WR_BUFSIZ 5 /* Allow room for 8bit 'addr' field in buffer*/
+-#define SPI_RD_BUFSIZ 16 /* SPI reads are 8 bits */
+-#define SPI_WR_BUFSIZ 7
+-
+-/* The EEPROM is where internal programs are stored on the Amtel.
+- You probably don't want to read or write these values */
+-
+-typedef struct h3600_eeprom_read_request {
+- unsigned char addr; /* 8bit Address Offset 0-255 */
+- unsigned char len; /* Number of 16bit words to read 0-128 */
+- unsigned short buff[EEPROM_RD_BUFSIZ];
+-} EEPROM_READ;
+-
+-typedef struct h3600_eeprom_write_request {
+- unsigned char len; /* used only to compute the number of bytes to send */
+- unsigned char addr; /* 0-128 */
+- unsigned short buff[EEPROM_WR_BUFSIZ];
+-} EEPROM_WRITE;
+-
+-/* The SPI bus connects to EEPROMs located on sleeves plugged into
+- the iPAQ. You may want to read these values */
+-
+-typedef struct h3600_spi_read_request {
+- unsigned short addr; /* 16bit Address Offset 0-128 */
+- unsigned char len; /* Number of bytes to read */
+- unsigned char buff[SPI_RD_BUFSIZ];
+-} SPI_READ;
+-
+-#define SPI_READ_STATUS_BYTE 0xffff /* Use this address to read the status byte */
+-
+-typedef struct h3600_spi_write_request {
+- unsigned short len; /* used only to compute the number of bytes to send */
+- unsigned short addr; /* this 16bit address accesses a single byte */
+- unsigned char buff[SPI_WR_BUFSIZ];
+-} SPI_WRITE;
+-
+-
+-/* -------- end of EEPROM and SPI Interfaces ---------------*/
+-
+-/* User space structures for IOCTL calls */
+-
+-typedef struct h3600_ts_version {
+- unsigned char host_version[8]; /* ascii "x.yy" */
+- unsigned char pack_version[8]; /* ascii "x.yy" */
+- unsigned char boot_type; /* TODO ?? */
+-} VER_RET;
+-
+-typedef struct h3600_ts_led {
+- unsigned char OffOnBlink; /* 0=off 1=on 2=Blink */
+- unsigned char TotalTime; /* Units of 5 seconds */
+- unsigned char OnTime; /* units of 100m/s */
+- unsigned char OffTime; /* units of 100m/s */
+-} LED_IN;
+-
+-enum flite_mode {
+- FLITE_MODE1 = 1,
+- FLITE_AUTO_MODE = 1, /* for reference only */
+- FLITE_MANUAL_MODE = 2, /* Use this normally? */
+- FLITE_GET_LIGHT_SENSOR = 3 /* Returns light reading in "brightness" field */
+-};
+-enum flite_pwr {
+- FLITE_PWR_OFF = 0,
+- FLITE_PWR_ON = 1
+-};
+-
+-typedef struct h3600_ts_flite {
+- unsigned char mode;
+- unsigned char pwr;
+- unsigned char brightness;
+-} FLITE_IN;
+-
+-/*************************** Updated "universal" structures *******************/
+-
+-/* Sets backlight for both H3100 and H3600 models - technically "frontlight" for H3600 */
+-struct h3600_ts_backlight {
+- enum flite_pwr power; /* 0 = off, 1 = on */
+- unsigned char brightness; /* 0 - 255 */
+-};
+-
+-struct h3600_ts_contrast { /* Only useful on H3100 model */
+- unsigned char contrast; /* 0 - 255 */
+-};
+-
+-/* IOCTL cmds user or kernel space */
+-
+-/* Use 'f' as magic number */
+-#define IOC_H3600_TS_MAGIC 'f'
+-
+-/* TODO: Some of these IOWR values are just plain wrong */
+-#define GET_VERSION _IOR(IOC_H3600_TS_MAGIC, 1, struct h3600_ts_version )
+-#define READ_EEPROM _IOWR(IOC_H3600_TS_MAGIC, 2, struct h3600_eeprom_read_request)
+-#define WRITE_EEPROM _IOWR(IOC_H3600_TS_MAGIC, 3, struct h3600_eeprom_write_request)
+-#define GET_THERMAL _IOR(IOC_H3600_TS_MAGIC, 4, struct therm_dev)
+-#define LED_ON _IOW(IOC_H3600_TS_MAGIC, 5, struct h3600_ts_led)
+-#define GET_BATTERY_STATUS _IOR(IOC_H3600_TS_MAGIC, 6, struct h3600_battery)
+-#define FLITE_ON _IOW(IOC_H3600_TS_MAGIC, 7, struct h3600_ts_flite)
+-#define READ_SPI _IOWR(IOC_H3600_TS_MAGIC, 8, struct h3600_spi_read_request)
+-#define WRITE_SPI _IOWR(IOC_H3600_TS_MAGIC, 9, struct h3600_spi_write_request)
+-#define TS_GET_CAL _IOR(IOC_H3600_TS_MAGIC, 10, struct h3600_ts_calibration)
+-#define TS_SET_CAL _IOW(IOC_H3600_TS_MAGIC, 11, struct h3600_ts_calibration)
+-
+-/* New IOCTL interfaces - defined to be more user friendly */
+-#define TS_GET_BACKLIGHT _IOR(IOC_H3600_TS_MAGIC, 20, struct h3600_ts_backlight)
+-#define TS_SET_BACKLIGHT _IOW(IOC_H3600_TS_MAGIC, 20, struct h3600_ts_backlight)
+-#define TS_GET_CONTRAST _IOR(IOC_H3600_TS_MAGIC, 21, struct h3600_ts_contrast)
+-#define TS_SET_CONTRAST _IOW(IOC_H3600_TS_MAGIC, 21, struct h3600_ts_contrast)
+-
+-#endif
+Index: xtscal-0.6.3/Makefile.am
+===================================================================
+--- xtscal-0.6.3.orig/Makefile.am 2004-06-02 23:07:13.000000000 +0100
++++ xtscal-0.6.3/Makefile.am 2007-07-02 12:51:02.000000000 +0100
+@@ -1,11 +1,8 @@
+-libexec_PROGRAMS = xtscal.bin
+-bin_SCRIPTS = xtscal
++bin_PROGRAMS = xtscal
+
+-xtscal_bin_SOURCES = main.c calibrate.c calibrate.h h3600_ts.h
++xtscal_SOURCES = main.c calibrate.c calibrate.h
+
+-xtscal_bin_LDADD = @XTSCAL_LIBS@
++xtscal_LDADD = @XTSCAL_LIBS@
+
+ INCLUDES = @XTSCAL_CFLAGS@ -DNR_POINTS=5
+
+-include gpe-dist.am
+-
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xtscal/xtscal/dso_linking_change_build_fix.patch b/import-layers/yocto-poky/meta/recipes-graphics/xtscal/xtscal/dso_linking_change_build_fix.patch
new file mode 100644
index 000000000..3e4533f78
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xtscal/xtscal/dso_linking_change_build_fix.patch
@@ -0,0 +1,27 @@
+after gcc linking has changed, all the libraries must be explicitely specified
+This patch avoids this linking error:
+
+| ccache i586-poky-linux-gcc -march=i586 --sysroot=/disk0/pokybuild/build1/tmp/sysroots/i586-poky-linux -fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 -ggdb -feliminate-unused-debug-types -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o xtscal main.o calibrate.o -lX11 -lXft -lXext -lXcalibrate^M
+| /disk0/pokybuild/build1/tmp/sysroots/x86_64-linux/usr/libexec/i586-poky-linux/gcc/i586-poky-linux/4.5.1/ld: ^?: invalid DSO for symbol `XRenderChangePicture' definition^M
+| /disk0/pokybuild/build1/tmp/sysroots/i586-poky-linux/usr/lib/libXrender.so.1: could not read symbols: Bad value^M
+| collect2: ld returned 1 exit status^M
+| make: *** [xtscal] Error 1
+
+Nitin A Kamble <nitin.a.kamble@intel.com>
+Date: 2011/01/11
+
+Upstream-Status: Pending
+
+Index: xtscal-0.6.3/configure.ac
+===================================================================
+--- xtscal-0.6.3.orig/configure.ac
++++ xtscal-0.6.3/configure.ac
+@@ -9,7 +9,7 @@ AM_INIT_AUTOMAKE([foreign dist-bzip2])
+ # Checks for programs.
+ AC_PROG_CC
+
+-PKG_CHECK_MODULES(XTSCAL, x11 xft xext xcalibrate)
++PKG_CHECK_MODULES(XTSCAL, x11 xft xext xcalibrate xrender)
+
+ AC_CONFIG_FILES([Makefile])
+ AC_OUTPUT
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xtscal/xtscal_0.6.3.bb b/import-layers/yocto-poky/meta/recipes-graphics/xtscal/xtscal_0.6.3.bb
new file mode 100644
index 000000000..4bfddf06b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xtscal/xtscal_0.6.3.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Touchscreen calibration utility"
+
+DESCRIPTION = "Basic touchscreen calibration utility"
+
+HOMEPAGE = "http://gpe.linuxtogo.org"
+BUGTRACKER = "http://bugs.linuxtogo.org"
+LICENSE = "GPLv2 & GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://main.c;endline=10;md5=8721bcb08ae9f24e5fe4c82941873c87"
+
+SECTION = "x11/base"
+
+DEPENDS = "virtual/libx11 libxft libxcalibrate"
+
+PR = "r13"
+
+SRC_URI = "${GPE_MIRROR}/xtscal-${PV}.tar.bz2 \
+ file://change-cross.patch \
+ file://cleanup.patch \
+ file://dso_linking_change_build_fix.patch \
+ file://30xTs_Calibrate.sh"
+
+SRC_URI[md5sum] = "9bcab80b474d5454477d1ca166a68c34"
+SRC_URI[sha256sum] = "27b9dc2203de9b1706ca39fa6ca80ecab8807909ec901c4a345b8e41178800a1"
+
+inherit autotools pkgconfig distro_features_check
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/X11/Xsession.d/
+ install -m 0755 ${WORKDIR}/30xTs_Calibrate.sh ${D}${sysconfdir}/X11/Xsession.d/
+}
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/xvideo-tests/xvideo-tests_git.bb b/import-layers/yocto-poky/meta/recipes-graphics/xvideo-tests/xvideo-tests_git.bb
new file mode 100644
index 000000000..51839ddf7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/xvideo-tests/xvideo-tests_git.bb
@@ -0,0 +1,17 @@
+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"
+
+S = "${WORKDIR}/git"
+
+inherit autotools distro_features_check
+
+# The libxv requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/blktrace/blktrace/0001-include-sys-types.h-for-dev_t-definition.patch b/import-layers/yocto-poky/meta/recipes-kernel/blktrace/blktrace/0001-include-sys-types.h-for-dev_t-definition.patch
new file mode 100644
index 000000000..a4b7157b4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/blktrace/blktrace/0001-include-sys-types.h-for-dev_t-definition.patch
@@ -0,0 +1,30 @@
+From 6b5bbdfaac7f216fe8a02c4cf29e5eb2aee5a409 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 15 Sep 2015 00:01:00 +0000
+Subject: [PATCH] include sys/types.h for dev_t definition
+
+Avoids the build failures when sys/types.h does not get included
+indirectly through other headers.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ blktrace.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/blktrace.h b/blktrace.h
+index 380aec7..944fc08 100644
+--- a/blktrace.h
++++ b/blktrace.h
+@@ -5,6 +5,7 @@
+ #include <limits.h>
+ #include <byteswap.h>
+ #include <endian.h>
++#include <sys/types.h>
+
+ #include "blktrace_api.h"
+ #include "rbtree.h"
+--
+2.5.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/blktrace/blktrace/ldflags.patch b/import-layers/yocto-poky/meta/recipes-kernel/blktrace/blktrace/ldflags.patch
new file mode 100644
index 000000000..dea1aa202
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/blktrace/blktrace/ldflags.patch
@@ -0,0 +1,106 @@
+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>
+
+--- 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
+@@ -23,19 +24,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
+
+--- 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
+--- 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
+--- git.orig/iowatcher/Makefile
++++ git/iowatcher/Makefile
+@@ -1,5 +1,6 @@
+ C = gcc
+ CFLAGS = -Wall -O0 -g -W
++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
++ $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) -lm $(LDFLAGS)
+
+ depend:
+ @$(CC) -MM $(ALL_CFLAGS) *.c 1> .depend
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/blktrace/blktrace_git.bb b/import-layers/yocto-poky/meta/recipes-kernel/blktrace/blktrace_git.bb
new file mode 100644
index 000000000..957cb7096
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/blktrace/blktrace_git.bb
@@ -0,0 +1,41 @@
+SUMMARY = "Generates traces of I/O traffic on block devices"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
+
+DEPENDS = "libaio"
+
+SRCREV = "43fc870ce04e963def45dfc0d1ed4ea21ef10d4b"
+
+PV = "1.1.0+git${SRCPV}"
+
+SRC_URI = "git://git.kernel.dk/blktrace.git \
+ file://ldflags.patch \
+ file://0001-include-sys-types.h-for-dev_t-definition.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/import-layers/yocto-poky/meta/recipes-kernel/cryptodev/cryptodev-linux_1.8.bb b/import-layers/yocto-poky/meta/recipes-kernel/cryptodev/cryptodev-linux_1.8.bb
new file mode 100644
index 000000000..c55577c66
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/cryptodev/cryptodev-linux_1.8.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/import-layers/yocto-poky/meta/recipes-kernel/cryptodev/cryptodev-module_1.8.bb b/import-layers/yocto-poky/meta/recipes-kernel/cryptodev/cryptodev-module_1.8.bb
new file mode 100644
index 000000000..552eb6aba
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/cryptodev/cryptodev-module_1.8.bb
@@ -0,0 +1,17 @@
+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 \
+"
+
+EXTRA_OEMAKE='KERNEL_DIR="${STAGING_KERNEL_DIR}" PREFIX="${D}"'
+
+RCONFLICTS_${PN} = "ocf-linux"
+RREPLACES_${PN} = "ocf-linux"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/cryptodev/cryptodev-tests_1.8.bb b/import-layers/yocto-poky/meta/recipes-kernel/cryptodev/cryptodev-tests_1.8.bb
new file mode 100644
index 000000000..c4005242a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/cryptodev/cryptodev-tests_1.8.bb
@@ -0,0 +1,21 @@
+require cryptodev.inc
+
+SUMMARY = "A test suite for /dev/crypto device driver"
+
+DEPENDS += "openssl"
+
+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}/tests_cryptodev/*"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/cryptodev/cryptodev.inc b/import-layers/yocto-poky/meta/recipes-kernel/cryptodev/cryptodev.inc
new file mode 100644
index 000000000..ade7ef9ce
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/cryptodev/cryptodev.inc
@@ -0,0 +1,13 @@
+HOMEPAGE = "http://cryptodev-linux.org/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+SRC_URI = "http://download.gna.org/cryptodev-linux/cryptodev-linux-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "02644cc4cd02301e0b503a332eb2f0b5"
+SRC_URI[sha256sum] = "67fabde9fb67b286a96c4f45b594b0eccd0f761b495705c18f2ae9461b831376"
+
+S = "${WORKDIR}/cryptodev-linux-${PV}"
+
+CLEANBROKEN = "1"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/cryptodev/files/0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch b/import-layers/yocto-poky/meta/recipes-kernel/cryptodev/files/0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch
new file mode 100644
index 000000000..3f0298b0b
--- /dev/null
+++ b/import-layers/yocto-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(-)
+
+diff --git a/Makefile b/Makefile
+index 31c4b3f..2ecf2a9 100644
+--- a/Makefile
++++ b/Makefile
+@@ -34,6 +34,9 @@ modules_install:
+ @echo "Installing cryptodev.h in $(PREFIX)/usr/include/crypto ..."
+ @install -D crypto/cryptodev.h $(PREFIX)/usr/include/crypto/cryptodev.h
+
++install_tests:
++ make -C tests install DESTDIR=$(PREFIX)
++
+ clean:
+ make -C $(KERNEL_DIR) SUBDIRS=`pwd` clean
+ rm -f $(hostprogs) *~
+@@ -42,6 +45,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
+diff --git a/tests/Makefile b/tests/Makefile
+index c9f04e8..cd202af 100644
+--- a/tests/Makefile
++++ b/tests/Makefile
+@@ -19,6 +19,12 @@ example-async-hmac-objs := async_hmac.o
+ example-async-speed-objs := async_speed.o
+ example-hashcrypt-speed-objs := hashcrypt_speed.c
+
++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
+@@ -28,6 +34,8 @@ check: $(hostprogs)
+ ./cipher-gcm
+ ./cipher-aead
+
++testprogs: $(hostprogs)
++
+ clean:
+ rm -f *.o *~ $(hostprogs)
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/cryptodev/files/0001-Disable-installing-header-file-provided-by-another-p.patch b/import-layers/yocto-poky/meta/recipes-kernel/cryptodev/files/0001-Disable-installing-header-file-provided-by-another-p.patch
new file mode 100644
index 000000000..a580fc68e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/cryptodev/files/0001-Disable-installing-header-file-provided-by-another-p.patch
@@ -0,0 +1,28 @@
+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 | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index d66ef26..8e97c6a 100644
+--- a/Makefile
++++ b/Makefile
+@@ -23,8 +23,6 @@ install: modules_install
+
+ modules_install:
+ make -C $(KERNEL_DIR) SUBDIRS=`pwd` modules_install
+- @echo "Installing cryptodev.h in $(PREFIX)/usr/include/crypto ..."
+- @install -D crypto/cryptodev.h $(PREFIX)/usr/include/crypto/cryptodev.h
+
+ clean:
+ make -C $(KERNEL_DIR) SUBDIRS=`pwd` clean
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/dtc/dtc.inc b/import-layers/yocto-poky/meta/recipes-kernel/dtc/dtc.inc
new file mode 100644
index 000000000..0c409b0c0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/dtc/dtc.inc
@@ -0,0 +1,22 @@
+SUMMARY = "Device Tree Compiler"
+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 \
+ "
+
+EXTRA_OEMAKE='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"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/dtc/dtc/make_install.patch b/import-layers/yocto-poky/meta/recipes-kernel/dtc/dtc/make_install.patch
new file mode 100644
index 000000000..1120617e7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/dtc/dtc/make_install.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: git/Makefile
+===================================================================
+--- git.orig/Makefile 2011-11-02 14:52:17.243104779 -0700
++++ git/Makefile 2011-11-02 15:06:01.555104982 -0700
+@@ -161,8 +161,8 @@
+ $(INSTALL) -d $(DESTDIR)$(BINDIR)
+ $(INSTALL) $(BIN) $(SCRIPTS) $(DESTDIR)$(BINDIR)
+ $(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)
+ $(INSTALL) -d $(DESTDIR)$(INCLUDEDIR)
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/dtc/dtc_git.bb b/import-layers/yocto-poky/meta/recipes-kernel/dtc/dtc_git.bb
new file mode 100644
index 000000000..4446142a3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/dtc/dtc_git.bb
@@ -0,0 +1,11 @@
+require dtc.inc
+
+LIC_FILES_CHKSUM = "file://GPL;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://libfdt/libfdt.h;beginline=3;endline=52;md5=fb360963151f8ec2d6c06b055bcbb68c"
+
+SRCREV = "302fca9f4c283e1994cf0a5a9ce1cf43ca15e6d2"
+PV = "1.4.1+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb b/import-layers/yocto-poky/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb
new file mode 100644
index 000000000..445d03a87
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Tools for managing Yocto Project style branched kernels"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://git/tools/kgit;beginline=5;endline=9;md5=d8d1d729a70cd5f52972f8884b80743d"
+
+DEPENDS = "git-native"
+
+SRCREV = "17d89d1861b532bbf1a81c1f024953e440db8de7"
+PR = "r12"
+PV = "0.2+git${SRCPV}"
+
+inherit native
+
+SRC_URI = "git://git.yoctoproject.org/yocto-kernel-tools.git"
+S = "${WORKDIR}"
+
+do_compile() {
+ :
+}
+
+do_install() {
+ cd ${S}/git
+ make DESTDIR=${D}${bindir} install
+}
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools.inc b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools.inc
new file mode 100644
index 000000000..758a3a78b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools.inc
@@ -0,0 +1,33 @@
+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"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/kexec/kexec-tools-${PV}.tar.gz \
+ file://kdump \
+ file://kdump.conf \
+"
+
+PR = "r1"
+
+inherit autotools
+
+COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|powerpc.*|mips.*)-(linux|freebsd.*)'
+
+INSANE_SKIP_${PN} = "arch"
+
+do_compile_prepend() {
+ # 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
+}
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0001-purgatory-Pass-r-directly-to-linker.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0001-vmcore-dmesg-Define-_GNU_SOURCE.patch b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0001-vmcore-dmesg-Define-_GNU_SOURCE.patch
new file mode 100644
index 000000000..90c2f6e0e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0001-vmcore-dmesg-Define-_GNU_SOURCE.patch
@@ -0,0 +1,31 @@
+From d811875a41b4628040abaada3da29b7b9592e757 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 9 Jan 2016 17:16:16 -0800
+Subject: [PATCH] vmcore-dmesg: Define _GNU_SOURCE
+
+loff_t is guarded with _GNU_SOURCE on some C library implementations
+e.g. musl since this type is not defined by POSIX. Define _GNU_SOURCE to
+include this define, it should help compiling on musl while nothing
+changes for glibc based systems since there _GNU_SOURCE is already
+defined
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ vmcore-dmesg/vmcore-dmesg.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/vmcore-dmesg/vmcore-dmesg.c b/vmcore-dmesg/vmcore-dmesg.c
+index 0364636..a8f56df 100644
+--- a/vmcore-dmesg/vmcore-dmesg.c
++++ b/vmcore-dmesg/vmcore-dmesg.c
+@@ -1,4 +1,5 @@
+ #define _XOPEN_SOURCE 600
++#define _GNU_SOURCE
+ #define _LARGEFILE_SOURCE 1
+ #define _FILE_OFFSET_BITS 64
+ #include <endian.h>
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0002-powerpc-change-the-memory-size-limit.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/kdump b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/kdump
new file mode 100755
index 000000000..3fb133fb3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/kdump
@@ -0,0 +1,163 @@
+#! /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
+KDUMP_KVER="`uname -r`"
+KDUMP_KIMAGE="/boot/bzImage-${KDUMP_KVER}"
+KDUMP_CMDLINE="`cat /proc/cmdline`"
+KDUMP_CMDLINE_APPEND="kdump_needed maxcpus=1 irqpoll reset_devices"
+KDUMP_VMCORE_PATH="/var/crash/`date +"%Y-%m-%d"`"
+
+#get right kernel image
+march="`uname -m`"
+case ${march} in
+ x86*|i?86)
+ ;;
+ *)
+ KDUMP_KIMAGE="/boot/uImage-${KDUMP_KVER}"
+ ;;
+esac
+
+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
+fi
+
+do_check()
+{
+ #check makedumpfile
+ if [ ! -e ${MAKEDUMPFILE} -o ! -x ${MAKEDUMPFILE} ] ;then
+ echo "No makedumpfile found."
+ return 1;
+ fi
+
+ #check kexec
+ if [ ! -e ${KEXEC} -o ! -x ${KEXEC} ] ;then
+ echo "No kexec found."
+ return 1;
+ fi
+
+ #check whether kdump kernel image exists on the system
+ if [ ! -f ${KDUMP_KIMAGE} ]; then
+ echo "No kdump kernel image found."
+ return 1
+ fi
+}
+
+do_save_vmcore()
+{
+ 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 "crashkenrel=" 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
+
+ #handle kdump cmdline parameters, remove some useless options
+ kcmdline=""
+ for x in `cat /proc/cmdline`; do
+ case $x in
+ crashkernel*)
+ ;;
+ *)
+ kcmdline="${kcmdline} $x"
+ ;;
+ esac
+ done
+
+ KDUMP_CMDLINE="${kcmdline} ${KDUMP_CMDLINE_APPEND}"
+
+ #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/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/kdump.conf b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/kdump.conf
new file mode 100644
index 000000000..42a2435b9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/kdump.conf
@@ -0,0 +1,18 @@
+#the kdump kernel version string.
+#KDUMP_KVER="`uname -r`"
+
+#this will be passed to the kdump kernel as kdump kernel command line, it
+#usually comes from /proc/cmdline
+#KDUMP_CMDLINE="`cat /proc/cmdline`"
+
+# append arguments to the kdump commandline
+#KDUMP_CMDLINE_APPEND="kdump_needed maxcpus=1 irqpoll reset_devices"
+
+#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/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/kexec-aarch64.patch b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/kexec-aarch64.patch
new file mode 100644
index 000000000..b03f58257
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/kexec-aarch64.patch
@@ -0,0 +1,801 @@
+From: Geoff Levand <geoff@infradead.org>
+Date: Mon, 15 Jul 2013 23:32:36 +0000 (-0700)
+Subject: Add arm64 support
+X-Git-Url: https://git.linaro.org/gitweb?p=people%2Fgeoff%2Fkexec-tools.git;a=commitdiff_plain;h=fbf5ac6c2c70ec0f6da2b9ff563e573999752c01
+
+Add arm64 support
+
+Signed-off-by: Geoff Levand <geoff@infradead.org>
+
+Get patch from:
+https://fedorapeople.org/~hrw/aarch64/for-fedora/kexec-aarch64.patch
+
+Upstream-Status: Pending
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+
+---
+ configure.ac | 3
+ kexec/Makefile | 1
+ kexec/arch/arm64/Makefile | 13 +
+ kexec/arch/arm64/crashdump-arm64.c | 305 ++++++++++++++++++++++++++++++++
+ kexec/arch/arm64/include/arch/options.h | 26 ++
+ kexec/arch/arm64/kexec-arm64.c | 177 ++++++++++++++++++
+ kexec/arch/arm64/kexec-arm64.h | 20 ++
+ kexec/arch/arm64/kexec-elf-arm64.c | 114 +++++++++++
+ kexec/kexec-syscall.h | 9
+ kexec/kexec.c | 2
+ purgatory/arch/arm64/Makefile | 7
+ 11 files changed, 675 insertions(+), 2 deletions(-)
+
+Index: kexec-tools-2.0.10/configure.ac
+===================================================================
+--- kexec-tools-2.0.10.orig/configure.ac
++++ kexec-tools-2.0.10/configure.ac
+@@ -36,6 +36,9 @@ case $target_cpu in
+ ARCH="ppc64"
+ SUBARCH="LE"
+ ;;
++ aarch64* )
++ ARCH="arm64"
++ ;;
+ arm* )
+ ARCH="arm"
+ ;;
+Index: kexec-tools-2.0.10/kexec/Makefile
+===================================================================
+--- kexec-tools-2.0.10.orig/kexec/Makefile
++++ kexec-tools-2.0.10/kexec/Makefile
+@@ -71,6 +71,7 @@ KEXEC_SRCS += $($(ARCH)_FS2DT)
+
+ include $(srcdir)/kexec/arch/alpha/Makefile
+ include $(srcdir)/kexec/arch/arm/Makefile
++include $(srcdir)/kexec/arch/arm64/Makefile
+ include $(srcdir)/kexec/arch/i386/Makefile
+ include $(srcdir)/kexec/arch/ia64/Makefile
+ include $(srcdir)/kexec/arch/m68k/Makefile
+Index: kexec-tools-2.0.10/kexec/arch/arm64/Makefile
+===================================================================
+--- /dev/null
++++ kexec-tools-2.0.10/kexec/arch/arm64/Makefile
+@@ -0,0 +1,13 @@
++
++arm64_KEXEC_SRCS += \
++ kexec/arch/arm64/kexec-arm64.c \
++ kexec/arch/arm64/kexec-elf-arm64.c \
++ kexec/arch/arm64/crashdump-arm64.c
++
++arm64_ARCH_REUSE_INITRD =
++arm64_ADD_SEGMENT =
++arm64_VIRT_TO_PHYS =
++
++dist += $(arm64_KEXEC_SRCS) \
++ kexec/arch/arm64/Makefile \
++ kexec/arch/arm64/kexec-arm64.h
+Index: kexec-tools-2.0.10/kexec/arch/arm64/crashdump-arm64.c
+===================================================================
+--- /dev/null
++++ kexec-tools-2.0.10/kexec/arch/arm64/crashdump-arm64.c
+@@ -0,0 +1,305 @@
++/*
++ * 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).
++ */
++
++#include "../../kexec.h"
++#include "../../kexec-elf.h"
++#include "../../crashdump.h"
++
++int is_crashkernel_mem_reserved(void)
++{
++ return 0;
++}
++
++#if 0
++/*
++ * Used to save various memory ranges/regions needed for the captured
++ * kernel to boot. (lime memmap= option in other archs)
++ */
++static struct memory_range crash_memory_ranges[CRASH_MAX_MEMORY_RANGES];
++struct memory_ranges usablemem_rgns = {
++ .size = 0,
++ .ranges = crash_memory_ranges,
++};
++
++/* memory range reserved for crashkernel */
++static struct memory_range crash_reserved_mem;
++
++static struct crash_elf_info elf_info = {
++ .class = ELFCLASS32,
++ .data = ELFDATA2LSB,
++ .machine = EM_ARM,
++ .page_offset = PAGE_OFFSET,
++};
++
++unsigned long phys_offset;
++
++/**
++ * crash_range_callback() - callback called for each iomem region
++ * @data: not used
++ * @nr: not used
++ * @str: name of the memory region
++ * @base: start address of the memory region
++ * @length: size of the memory region
++ *
++ * This function is called once for each memory region found in /proc/iomem. It
++ * locates system RAM and crashkernel reserved memory and places these to
++ * variables: @crash_memory_ranges and @crash_reserved_mem. Number of memory
++ * regions is placed in @crash_memory_nr_ranges.
++ */
++static int crash_range_callback(void *UNUSED(data), int UNUSED(nr),
++ char *str, unsigned long base,
++ unsigned long length)
++{
++ struct memory_range *range;
++
++ if (usablemem_rgns.size >= CRASH_MAX_MEMORY_RANGES)
++ return 1;
++
++ range = usablemem_rgns.ranges + usablemem_rgns.size;
++
++ if (strncmp(str, "System RAM\n", 11) == 0) {
++ range->start = base;
++ range->end = base + length - 1;
++ range->type = RANGE_RAM;
++ usablemem_rgns.size++;
++ } else if (strncmp(str, "Crash kernel\n", 13) == 0) {
++ crash_reserved_mem.start = base;
++ crash_reserved_mem.end = base + length - 1;
++ crash_reserved_mem.type = RANGE_RAM;
++ }
++
++ return 0;
++}
++
++/**
++ * crash_exclude_range() - excludes memory region reserved for crashkernel
++ *
++ * Function locates where crashkernel reserved memory is and removes that region
++ * from the available memory regions.
++ */
++static void crash_exclude_range(void)
++{
++ const struct memory_range *range = &crash_reserved_mem;
++ int i;
++
++ for (i = 0; i < usablemem_rgns.size; i++) {
++ struct memory_range *r = usablemem_rgns.ranges + i;
++
++ /*
++ * We assume that crash area is fully contained in
++ * some larger memory area.
++ */
++ if (r->start <= range->start && r->end >= range->end) {
++ struct memory_range *new;
++ /*
++ * Let's split this area into 2 smaller ones and
++ * remove excluded range from between. First create
++ * new entry for the remaining area.
++ */
++ new = usablemem_rgns.ranges + usablemem_rgns.size;
++ new->start = range->end + 1;
++ new->end = r->end;
++ usablemem_rgns.size++;
++ /*
++ * Next update this area to end before excluded range.
++ */
++ r->end = range->start - 1;
++ break;
++ }
++ }
++}
++
++static int range_cmp(const void *a1, const void *a2)
++{
++ const struct memory_range *r1 = a1;
++ const struct memory_range *r2 = a2;
++
++ if (r1->start > r2->start)
++ return 1;
++ if (r1->start < r2->start)
++ return -1;
++
++ return 0;
++}
++
++/**
++ * crash_get_memory_ranges() - read system physical memory
++ *
++ * Function reads through system physical memory and stores found memory regions
++ * in @crash_memory_ranges. Number of memory regions found is placed in
++ * @crash_memory_nr_ranges. Regions are sorted in ascending order.
++ *
++ * Returns %0 in case of success and %-1 otherwise (errno is set).
++ */
++static int crash_get_memory_ranges(void)
++{
++ /*
++ * First read all memory regions that can be considered as
++ * system memory including the crash area.
++ */
++ kexec_iomem_for_each_line(NULL, crash_range_callback, NULL);
++
++ if (usablemem_rgns.size < 1) {
++ errno = EINVAL;
++ return -1;
++ }
++
++ /*
++ * Exclude memory reserved for crashkernel (this may result a split memory
++ * region).
++ */
++ crash_exclude_range();
++
++ /*
++ * Make sure that the memory regions are sorted.
++ */
++ qsort(usablemem_rgns.ranges, usablemem_rgns.size,
++ sizeof(*usablemem_rgns.ranges), range_cmp);
++
++ return 0;
++}
++
++/**
++ * cmdline_add_elfcorehdr() - adds elfcorehdr= to @cmdline
++ * @cmdline: buffer where parameter is placed
++ * @elfcorehdr: physical address of elfcorehdr
++ *
++ * Function appends 'elfcorehdr=start' at the end of the command line given in
++ * @cmdline. Note that @cmdline must be at least %COMMAND_LINE_SIZE bytes long
++ * (inclunding %NUL).
++ */
++static void cmdline_add_elfcorehdr(char *cmdline, unsigned long elfcorehdr)
++{
++ char buf[COMMAND_LINE_SIZE];
++ int buflen;
++
++ buflen = snprintf(buf, sizeof(buf), "%s elfcorehdr=%#lx",
++ cmdline, elfcorehdr);
++ if (buflen < 0)
++ die("Failed to construct elfcorehdr= command line parameter\n");
++ if (buflen >= sizeof(buf))
++ die("Command line overflow\n");
++
++ (void) strncpy(cmdline, buf, COMMAND_LINE_SIZE);
++ cmdline[COMMAND_LINE_SIZE - 1] = '\0';
++}
++
++/**
++ * cmdline_add_mem() - adds mem= parameter to kernel command line
++ * @cmdline: buffer where parameter is placed
++ * @size: size of the kernel reserved memory (in bytes)
++ *
++ * This function appends 'mem=size' at the end of the command line given in
++ * @cmdline. Note that @cmdline must be at least %COMMAND_LINE_SIZE bytes long
++ * (including %NUL).
++ */
++static void cmdline_add_mem(char *cmdline, unsigned long size)
++{
++ char buf[COMMAND_LINE_SIZE];
++ int buflen;
++
++ buflen = snprintf(buf, sizeof(buf), "%s mem=%ldK", cmdline, size >> 10);
++ if (buflen < 0)
++ die("Failed to construct mem= command line parameter\n");
++ if (buflen >= sizeof(buf))
++ die("Command line overflow\n");
++
++ (void) strncpy(cmdline, buf, COMMAND_LINE_SIZE);
++ cmdline[COMMAND_LINE_SIZE - 1] = '\0';
++}
++
++static unsigned long long range_size(const struct memory_range *r)
++{
++ return r->end - r->start + 1;
++}
++
++static void dump_memory_ranges(void)
++{
++ int i;
++
++ if (!kexec_debug)
++ return;
++
++ dbgprintf("crashkernel: [%#llx - %#llx] (%ldM)\n",
++ crash_reserved_mem.start, crash_reserved_mem.end,
++ (unsigned long)range_size(&crash_reserved_mem) >> 20);
++
++ for (i = 0; i < usablemem_rgns.size; i++) {
++ struct memory_range *r = usablemem_rgns.ranges + i;
++ dbgprintf("memory range: [%#llx - %#llx] (%ldM)\n",
++ r->start, r->end, (unsigned long)range_size(r) >> 20);
++ }
++}
++
++/**
++ * load_crashdump_segments() - loads additional segments needed for kdump
++ * @info: kexec info structure
++ * @mod_cmdline: kernel command line
++ *
++ * This function loads additional segments which are needed for the dump capture
++ * kernel. It also updates kernel command line passed in @mod_cmdline to have
++ * right parameters for the dump capture kernel.
++ *
++ * Return %0 in case of success and %-1 in case of error.
++ */
++int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline)
++{
++ unsigned long elfcorehdr;
++ unsigned long bufsz;
++ void *buf;
++ int err;
++
++ /*
++ * First fetch all the memory (RAM) ranges that we are going to pass to
++ * the crashdump kernel during panic.
++ */
++ err = crash_get_memory_ranges();
++ if (err)
++ return err;
++
++ /*
++ * Now that we have memory regions sorted, we can use first memory
++ * region as PHYS_OFFSET.
++ */
++ phys_offset = usablemem_rgns.ranges->start;
++ dbgprintf("phys_offset: %#lx\n", phys_offset);
++
++ err = crash_create_elf32_headers(info, &elf_info,
++ usablemem_rgns.ranges,
++ usablemem_rgns.size, &buf, &bufsz,
++ ELF_CORE_HEADER_ALIGN);
++ if (err)
++ return err;
++
++ /*
++ * We allocate ELF core header from the end of the memory area reserved
++ * for the crashkernel. We align the header to SECTION_SIZE (which is
++ * 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.
++ */
++ elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 << 20,
++ crash_reserved_mem.start,
++ crash_reserved_mem.end, -1, 0);
++
++ dbgprintf("elfcorehdr: %#lx\n", elfcorehdr);
++ cmdline_add_elfcorehdr(mod_cmdline, elfcorehdr);
++
++ /*
++ * Add 'mem=size' parameter to dump capture kernel command line. This
++ * prevents the dump capture kernel from using any other memory regions
++ * which belong to the primary kernel.
++ */
++ cmdline_add_mem(mod_cmdline, elfcorehdr - crash_reserved_mem.start);
++
++ dump_memory_ranges();
++ dbgprintf("kernel command line: \"%s\"\n", mod_cmdline);
++
++ return 0;
++}
++
++#endif
++
+Index: kexec-tools-2.0.10/kexec/arch/arm64/include/arch/options.h
+===================================================================
+--- /dev/null
++++ kexec-tools-2.0.10/kexec/arch/arm64/include/arch/options.h
+@@ -0,0 +1,26 @@
++#ifndef KEXEC_ARCH_ARM64_OPTIONS_H
++#define KEXEC_ARCH_ARM64_OPTIONS_H
++
++//#define OPT_ARCH_MAX ((OPT_MAX)+0)
++
++#define OPT_APPEND ((OPT_MAX)+0)
++#define OPT_RAMDISK ((OPT_MAX)+1)
++#define OPT_DTB ((OPT_MAX)+2)
++
++#define OPT_ARCH_MAX ((OPT_MAX)+3)
++
++
++#define KEXEC_ARCH_OPTIONS \
++ KEXEC_OPTIONS \
++ { "append", 1, NULL, OPT_APPEND }, \
++ { "command-line", 1, NULL, OPT_APPEND }, \
++ { "dtb", 1, NULL, OPT_DTB }, \
++ { "initrd", 1, NULL, OPT_RAMDISK }, \
++ { "ramdisk", 1, NULL, OPT_RAMDISK }, \
++
++#define KEXEC_ARCH_OPT_STR KEXEC_OPT_STR /* Only accept long arch options. */
++
++#define KEXEC_ALL_OPTIONS KEXEC_ARCH_OPTIONS
++#define KEXEC_ALL_OPT_STR KEXEC_ARCH_OPT_STR
++
++#endif /* KEXEC_ARCH_ARM64_OPTIONS_H */
+Index: kexec-tools-2.0.10/kexec/arch/arm64/kexec-arm64.c
+===================================================================
+--- /dev/null
++++ kexec-tools-2.0.10/kexec/arch/arm64/kexec-arm64.c
+@@ -0,0 +1,177 @@
++/*
++ * ARM64 kexec support.
++ */
++
++#define _GNU_SOURCE
++
++#include <errno.h>
++#include <stddef.h>
++
++//#include <linux/kexec.h>
++
++#include "../../kexec.h"
++#include "../../kexec-syscall.h"
++#include "kexec-arm64.h"
++
++
++void arch_usage(void)
++{
++ fprintf(stderr, "%s:%d: ->\n", __func__, __LINE__);
++
++ printf(
++" --append=STRING Set the kernel command line to STRING.\n"
++" --command-line=STRING Set the kernel command line to STRING.\n"
++" --dtb=FILE Use FILE as the device tree blob.\n"
++" --initrd=FILE Use FILE as the kernel initial ramdisk.\n"
++" --ramdisk=FILE Use FILE as the kernel initial ramdisk.\n");
++
++ fprintf(stderr, "%s:%d: <-\n", __func__, __LINE__);
++}
++
++int arch_process_options(int UNUSED(argc), char **UNUSED(argv))
++{
++ fprintf(stderr, "%s:%d: do\n", __func__, __LINE__);
++ return 0;
++}
++
++const struct arch_map_entry arches[] = {
++ { "aarch64", KEXEC_ARCH_ARM64 },
++ { NULL, 0 },
++};
++
++void arch_update_purgatory(struct kexec_info *UNUSED(info))
++{
++ fprintf(stderr, "%s:%d: do\n", __func__, __LINE__);
++}
++
++unsigned long virt_to_phys(unsigned long addr)
++{
++ fprintf(stderr, "%s:%d: %016lx -> %016lx\n", __func__, __LINE__, addr,
++ addr + 0x080000000UL);
++ return addr + 0x080000000UL;
++}
++
++void add_segment(struct kexec_info *info, const void *buf, size_t bufsz,
++ unsigned long base, size_t memsz)
++{
++ fprintf(stderr, "%s:%d: ->\n", __func__, __LINE__);
++ add_segment_phys_virt(info, buf, bufsz, base, memsz, 1);
++ fprintf(stderr, "%s:%d: <-\n", __func__, __LINE__);
++}
++
++static int get_memory_ranges_1(struct memory_range **range, int *ranges,
++ unsigned long kexec_flags)
++{
++ static struct memory_range memory_range[KEXEC_SEGMENT_MAX];
++ const char *iomem;
++ int range_count = 0;
++ char line[MAX_LINE];
++ FILE *fp;
++
++ iomem = proc_iomem();
++ fp = fopen(iomem, "r");
++
++ if (!fp) {
++ fprintf(stderr, "Cannot open %s: %s\n",
++ iomem, strerror(errno));
++ return -1;
++ }
++
++ dbgprintf("memory ranges:\n");
++
++ while(fgets(line, sizeof(line), fp) != 0) {
++ struct memory_range r;
++ char *str;
++ int consumed;
++
++ if (range_count >= KEXEC_SEGMENT_MAX)
++ break;
++
++ if (sscanf(line, "%Lx-%Lx : %n", &r.start, &r.end, &consumed)
++ != 2)
++ continue;
++
++ str = line + consumed;
++ r.end++;
++
++ if (memcmp(str, "System RAM\n", 11)) {
++ dbgprintf(" Skip: %016Lx - %016Lx : %s", r.start, r.end,
++ str);
++ continue;
++ }
++
++ r.type = RANGE_RAM;
++ memory_range[range_count] = r;
++ range_count++;
++
++ dbgprintf(" Add: %016Lx - %016Lx : %s", r.start, r.end, str);
++ }
++
++ fclose(fp);
++ *range = memory_range;
++ *ranges = range_count;
++
++ return 0;
++}
++
++static int get_memory_ranges_2(struct memory_range **range, int *ranges,
++ unsigned long UNUSED(kexec_flags))
++{
++ static struct memory_range memory_range[2];
++
++ memory_range[0].start = 0x080000000;
++ memory_range[0].end = 0x100000000;
++ memory_range[0].type = RANGE_RAM;
++
++ memory_range[1].start = 0x900000000;
++ memory_range[1].end = 0x880000000;
++ memory_range[1].type = RANGE_RAM;
++
++ *range = memory_range;
++ *ranges = sizeof(memory_range) / sizeof(memory_range[0]);
++
++ return 0;
++}
++
++int get_memory_ranges(struct memory_range **range, int *ranges,
++ unsigned long kexec_flags)
++{
++ /* FIXME: Should get this info from device tree. */
++
++ return get_memory_ranges_1(range, ranges, kexec_flags);
++}
++
++struct file_type file_type[] = {
++ { "elf-arm64", elf_arm64_probe, elf_arm64_load, elf_arm64_usage },
++};
++
++int file_types = sizeof(file_type) / sizeof(file_type[0]);
++
++int arch_compat_trampoline(struct kexec_info *info)
++{
++ fprintf(stderr, "%s:%d: do\n", __func__, __LINE__);
++ return 0;
++}
++
++void arch_reuse_initrd(void)
++{
++}
++
++int machine_verify_elf_rel(struct mem_ehdr *ehdr)
++{
++ (void)ehdr;
++
++ fprintf(stderr, "%s:%d: do\n", __func__, __LINE__);
++ return 0;
++}
++
++void machine_apply_elf_rel(struct mem_ehdr *ehdr, unsigned long r_type,
++ void *location, unsigned long address, unsigned long value)
++{
++ (void)ehdr;
++ (void)r_type;
++ (void)location;
++ (void)address;
++ (void)value;
++ fprintf(stderr, "%s:%d: do\n", __func__, __LINE__);
++}
+Index: kexec-tools-2.0.10/kexec/arch/arm64/kexec-arm64.h
+===================================================================
+--- /dev/null
++++ kexec-tools-2.0.10/kexec/arch/arm64/kexec-arm64.h
+@@ -0,0 +1,20 @@
++/*
++ * ARM64 kexec support.
++ */
++
++#if !defined(KEXEC_ARM64_H)
++#define KEXEC_ARM64_H
++
++/* #include <linux/kexec.h> FIXME: this is broken */
++#include <sys/types.h>
++
++#include "../../kexec.h"
++
++#define KEXEC_SEGMENT_MAX 16 /* FIXME: this should come from <linux/kexec.h> */
++
++int elf_arm64_probe(const char *buf, off_t len);
++int elf_arm64_load(int argc, char **argv, const char *buf, off_t len,
++ struct kexec_info *info);
++void elf_arm64_usage(void);
++
++#endif
+\ No newline at end of file
+Index: kexec-tools-2.0.10/kexec/arch/arm64/kexec-elf-arm64.c
+===================================================================
+--- /dev/null
++++ kexec-tools-2.0.10/kexec/arch/arm64/kexec-elf-arm64.c
+@@ -0,0 +1,114 @@
++/*
++ * ARM64 kexec support.
++ */
++
++#define _GNU_SOURCE
++
++#include <elf.h>
++#include <getopt.h>
++
++#include "../../kexec-syscall.h"
++
++#include "kexec-arm64.h"
++#include "arch/options.h"
++
++#if !defined(EM_AARCH64)
++# define EM_AARCH64 183
++#endif
++
++int elf_arm64_probe(const char *buf, off_t len)
++{
++ int result;
++ struct mem_ehdr ehdr;
++
++ fprintf(stderr, "%s:%d: ->\n", __func__, __LINE__);
++
++ result = build_elf_exec_info(buf, len, &ehdr, 0);
++
++ if (result < 0) {
++ dbgprintf("Not an ELF executable\n");
++ goto out;
++ }
++
++ if (ehdr.e_machine != EM_AARCH64) {
++ dbgprintf("Not an AARCH64 executable\n");
++ result = -1;
++ goto out;
++ }
++
++ result = 0;
++
++out:
++ free_elf_info(&ehdr);
++ fprintf(stderr, "%s:%d: <-\n", __func__, __LINE__);
++ return result;
++}
++
++int elf_arm64_load(int argc, char **argv, const char *buf, off_t len,
++ struct kexec_info *info)
++{
++ static const struct option options[] = {
++ KEXEC_ARCH_OPTIONS
++ { 0 }
++ };
++ static const char short_options[] = KEXEC_OPT_STR "";
++ const char *command_line = NULL;
++ unsigned int command_line_len = 0;
++ const char *ramdisk = NULL;
++ const char *dtb = NULL;
++ int opt;
++ struct mem_ehdr ehdr;
++ int result;
++
++ fprintf(stderr, "%s:%d: ->\n", __func__, __LINE__);
++
++ while ((opt = getopt_long(argc, argv, short_options, options, 0))
++ != -1) {
++ switch (opt) {
++ default:
++ if (opt < OPT_MAX) /* Ignore core options */
++ break;
++ case OPT_APPEND:
++ command_line = optarg;
++ command_line_len = strlen(command_line) + 1;
++ break;
++ case OPT_RAMDISK:
++ ramdisk = optarg;
++ break;
++ case OPT_DTB:
++ dtb = optarg;
++ break;
++ }
++ }
++
++ fprintf(stderr, "%s:%d: command_line: %s\n", __func__, __LINE__, command_line);
++ fprintf(stderr, "%s:%d: ramdisk: %s\n", __func__, __LINE__, ramdisk);
++ fprintf(stderr, "%s:%d: dtb: %s\n", __func__, __LINE__, dtb);
++
++ if (info->kexec_flags & KEXEC_ON_CRASH) {
++ fprintf(stderr, "kexec: kdump not yet supported on arm64\n");
++ return -1;
++ }
++
++ result = build_elf_exec_info(buf, len, &ehdr, 0);
++
++ if (result < 0) {
++ free_elf_info(&ehdr);
++ fprintf(stderr, "%s:%d: free_elf_info failed\n", __func__,
++ __LINE__);
++ return result;
++ }
++
++ elf_exec_build_load(info, &ehdr, buf, len, 0);
++
++ info->entry = (void*)0x80080000UL; // FIXME
++
++ fprintf(stderr, "%s:%d: <-\n", __func__, __LINE__);
++ return 0;
++}
++
++void elf_arm64_usage(void)
++{
++ fprintf(stderr, "%s:%d: ->\n", __func__, __LINE__);
++ fprintf(stderr, "%s:%d: <-\n", __func__, __LINE__);
++}
+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
+@@ -39,8 +39,8 @@
+ #ifdef __s390__
+ #define __NR_kexec_load 277
+ #endif
+-#ifdef __arm__
+-#define __NR_kexec_load __NR_SYSCALL_BASE + 347
++#if defined(__arm__) || defined(__arm64__)
++#define __NR_kexec_load __NR_SYSCALL_BASE + 347
+ #endif
+ #if defined(__mips__)
+ #define __NR_kexec_load 4311
+@@ -108,6 +108,8 @@ static inline long kexec_file_load(int k
+ #define KEXEC_ARCH_PPC64 (21 << 16)
+ #define KEXEC_ARCH_IA_64 (50 << 16)
+ #define KEXEC_ARCH_ARM (40 << 16)
++#define KEXEC_ARCH_ARM64 (183 << 16)
++/* #define KEXEC_ARCH_AARCH64 (183 << 16) */
+ #define KEXEC_ARCH_S390 (22 << 16)
+ #define KEXEC_ARCH_SH (42 << 16)
+ #define KEXEC_ARCH_MIPS_LE (10 << 16)
+@@ -153,5 +155,8 @@ static inline long kexec_file_load(int k
+ #ifdef __m68k__
+ #define KEXEC_ARCH_NATIVE KEXEC_ARCH_68K
+ #endif
++#if defined(__arm64__)
++#define KEXEC_ARCH_NATIVE KEXEC_ARCH_ARM64
++#endif
+
+ #endif /* KEXEC_SYSCALL_H */
+Index: kexec-tools-2.0.10/kexec/kexec.c
+===================================================================
+--- kexec-tools-2.0.10.orig/kexec/kexec.c
++++ kexec-tools-2.0.10/kexec/kexec.c
+@@ -664,6 +664,8 @@ static int my_load(const char *type, int
+ memset(&info, 0, sizeof(info));
+ info.kexec_flags = kexec_flags;
+
++ fprintf(stderr, "%s:%d: do\n", __func__, __LINE__);
++
+ result = 0;
+ if (argc - fileind <= 0) {
+ fprintf(stderr, "No kernel specified\n");
+Index: kexec-tools-2.0.10/purgatory/arch/arm64/Makefile
+===================================================================
+--- /dev/null
++++ kexec-tools-2.0.10/purgatory/arch/arm64/Makefile
+@@ -0,0 +1,7 @@
++#
++# Purgatory arm64
++#
++
++arm64_PURGATORY_SRCS =
++
++dist += purgatory/arch/arm64/Makefile $(arm64_PURGATORY_SRCS)
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/kexec-tools-Refine-kdump-device_tree-sort.patch b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/kexec-tools-Refine-kdump-device_tree-sort.patch
new file mode 100644
index 000000000..e198eb6e9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/kexec-tools-Refine-kdump-device_tree-sort.patch
@@ -0,0 +1,48 @@
+kexec-tools: Refine kdump device_tree sort
+
+The commit b02d735bf was to rearrange the device-tree entries, and
+assumed that these entries are sorted in the ascending order. but
+acctually when I was validating kexec and kdump, the order of
+serial node still is changed. So the patch is to sort these entries
+by the directory name in ascending order.
+
+Upstream-Status: Pending
+
+Signed-off-by: Yang Wei <Wei.Yang@windriver.com>
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ kexec/arch/ppc/fs2dt.c | 13 ++++++++++---
+ kexec/fs2dt.c | 13 ++++++++++---
+ 2 files changed, 20 insertions(+), 6 deletions(-)
+
+Index: kexec-tools-2.0.10/kexec/arch/ppc/fs2dt.c
+===================================================================
+--- kexec-tools-2.0.10.orig/kexec/arch/ppc/fs2dt.c
++++ kexec-tools-2.0.10/kexec/arch/ppc/fs2dt.c
+@@ -296,6 +296,9 @@ static int comparefunc(const void *dentr
+ {
+ char *str1 = (*(struct dirent **)dentry1)->d_name;
+ char *str2 = (*(struct dirent **)dentry2)->d_name;
++ char* ptr1 = strchr(str1, '@');
++ char* ptr2 = strchr(str2, '@');
++ int len1, len2;
+
+ /*
+ * strcmp scans from left to right and fails to idetify for some
+@@ -303,9 +306,13 @@ static int comparefunc(const void *dentr
+ * Therefore, we get the wrong sorted order like memory@10000000 and
+ * memory@f000000.
+ */
+- if (strchr(str1, '@') && strchr(str2, '@') &&
+- (strlen(str1) > strlen(str2)))
+- return 1;
++ if (ptr1 && ptr2) {
++ len1 = ptr1 - str1;
++ len2 = ptr2 - str2;
++ if (!strncmp(str1, str2, len1 >len2 ? len1: len2) &&
++ (strlen(str1) > strlen(str2)))
++ return 1;
++ }
+
+ return strcmp(str1, str2);
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/kexec-x32.patch b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/kexec-x32.patch
new file mode 100644
index 000000000..26d18eb6f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools_2.0.11.bb b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools_2.0.11.bb
new file mode 100644
index 000000000..c1c97af9e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools_2.0.11.bb
@@ -0,0 +1,37 @@
+require kexec-tools.inc
+export LDFLAGS = "-L${STAGING_LIBDIR}"
+EXTRA_OECONF = " --with-zlib=yes"
+
+SRC_URI += "file://kexec-tools-Refine-kdump-device_tree-sort.patch \
+ file://kexec-aarch64.patch \
+ file://kexec-x32.patch \
+ file://0002-powerpc-change-the-memory-size-limit.patch \
+ file://0001-purgatory-Pass-r-directly-to-linker.patch \
+ file://0001-vmcore-dmesg-Define-_GNU_SOURCE.patch \
+ "
+
+SRC_URI[md5sum] = "86de066859f289048f1b286af6f03f78"
+SRC_URI[sha256sum] = "84f652ebf1de3f7b9de757a50cdbf6d5639d88c1d5b5ef9f525edde5ef9590c2"
+
+PACKAGES =+ "kexec kdump vmcore-dmesg"
+
+ALLOW_EMPTY_${PN} = "1"
+RRECOMMENDS_${PN} = "kexec kdump vmcore-dmesg"
+
+FILES_kexec = "${sbindir}/kexec"
+FILES_kdump = "${sbindir}/kdump ${sysconfdir}/init.d/kdump \
+ ${sysconfdir}/sysconfig/kdump.conf"
+FILES_vmcore-dmesg = "${sbindir}/vmcore-dmesg"
+
+inherit update-rc.d
+
+INITSCRIPT_PACKAGES = "kdump"
+INITSCRIPT_NAME_kdump = "kdump"
+INITSCRIPT_PARAMS_kdump = "start 56 2 3 4 5 . stop 56 0 1 6 ."
+
+do_install_append () {
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/kdump ${D}${sysconfdir}/init.d/kdump
+ install -d ${D}${sysconfdir}/sysconfig
+ install -m 0644 ${WORKDIR}/kdump.conf ${D}${sysconfdir}/sysconfig
+}
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb b/import-layers/yocto-poky/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
new file mode 100644
index 000000000..c2c258910
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
@@ -0,0 +1,50 @@
+SUMMARY = "Wrapper script for the Linux kernel module dependency indexer"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+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"
+
+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
+if [ ! -r ${PKGDATA_DIR}/kernel-depmod/kernel-abiversion ]; then
+ echo "Unable to read: ${PKGDATA_DIR}/kernel-depmod/kernel-abiversion" >&2
+else
+ kernelabi=\$(cat ${PKGDATA_DIR}/kernel-depmod/kernel-abiversion)
+ if [ "\$kernelabi" != "\$4" ]; then
+ echo "Error: Kernel version \$4 does not match kernel-abiversion (\$kernelabi)" >&2
+ exit 1
+ fi
+fi
+
+if [ ! -r ${PKGDATA_DIR}/kernel-depmod/System.map-\$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_PREPROCESS_FUNCS += "depmodwrapper_sysroot_preprocess"
+
+depmodwrapper_sysroot_preprocess () {
+ sysroot_stage_dir ${D}${bindir_crossscripts} ${SYSROOT_DESTDIR}${bindir_crossscripts}
+}
+
+inherit nopackages
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod-native_git.bb b/import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod-native_git.bb
new file mode 100644
index 000000000..f0e274ed7
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod.inc b/import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod.inc
new file mode 100644
index 000000000..0bcdcf673
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod.inc
@@ -0,0 +1,43 @@
+# 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"
+
+DEPENDS += "pkgconfig-native"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
+ file://libkmod/COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
+ "
+inherit autotools gtk-doc
+
+SRCREV = "42f32b8ae45ad8e3a1da29c9b20af9b5e2e9e676"
+# Lookout for PV bump too when SRCREV is changed
+PV = "22+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 --disable-manpages --with-zlib"
+
+PACKAGECONFIG[debug] = "--enable-debug,--disable-debug"
+PACKAGECONFIG[logging] = " --enable-logging,--disable-logging"
+
+do_configure_prepend () {
+ gtkdocize --docdir ${S}/libkmod/docs || touch ${S}/libkmod/docs/gtk-doc.make
+}
+
+do_configure_append () {
+ sed -i 's#}libtool#}${TARGET_SYS}-libtool#' ${B}/doltlibtool
+}
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch b/import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch
new file mode 100644
index 000000000..feafcb9b7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch
@@ -0,0 +1,29 @@
+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(-)
+
+diff --git a/configure.ac b/configure.ac
+index eb0f9d1..a539968 100644
+--- a/configure.ac
++++ b/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])
+
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod/depmod-search.conf b/import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod/depmod-search.conf
new file mode 100644
index 000000000..527c0bb6e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch b/import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch
new file mode 100644
index 000000000..8161d6128
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch
@@ -0,0 +1,38 @@
+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(+)
+
+diff --git a/libkmod/libkmod-internal.h b/libkmod/libkmod-internal.h
+index 0180124..100b40f 100644
+--- a/libkmod/libkmod-internal.h
++++ b/libkmod/libkmod-internal.h
+@@ -9,6 +9,10 @@
+ #include "macro.h"
+ #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, ...) {}
+
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod/ptest.patch b/import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod/ptest.patch
new file mode 100644
index 000000000..831dbcb90
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod/run-ptest b/import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod/run-ptest
new file mode 100755
index 000000000..598dd2cb5
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod_git.bb b/import-layers/yocto-poky/meta/recipes-kernel/kmod/kmod_git.bb
new file mode 100644
index 000000000..69185b245
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-kernel/latencytop/latencytop-0.5/0001-Rectify-the-function-signatures-to-fix-prototype-mis.patch b/import-layers/yocto-poky/meta/recipes-kernel/latencytop/latencytop-0.5/0001-Rectify-the-function-signatures-to-fix-prototype-mis.patch
new file mode 100644
index 000000000..b24813346
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/latencytop/latencytop-0.5/0001-Rectify-the-function-signatures-to-fix-prototype-mis.patch
@@ -0,0 +1,64 @@
+From db112739dc4f608a968b8104b382955dc3d96ca3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 7 Sep 2015 07:40:10 +0000
+Subject: [PATCH] Rectify the function signatures to fix prototype mismatches
+
+clang is less forgiving when it comes to coding standards, correct the
+function signatures to reflect the function logic
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ fsync.c | 7 ++++---
+ latencytop.h | 2 +-
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/fsync.c b/fsync.c
+index 82dff0e..5cefba9 100644
+--- a/fsync.c
++++ b/fsync.c
+@@ -51,7 +51,7 @@ struct fsync_files {
+ static GList *fsync_data;
+
+
+-static chain_file(struct fsync_process *proc, char *filename)
++static void chain_file(struct fsync_process *proc, char *filename)
+ {
+ struct fsync_files *file;
+ GList *item;
+@@ -75,7 +75,7 @@ static chain_file(struct fsync_process *proc, char *filename)
+ proc->files = g_list_append(proc->files, file);
+ }
+
+-static report_file(char *process, char *file)
++static void report_file(char *process, char *file)
+ {
+ struct fsync_process *proc;
+ GList *item;
+@@ -157,9 +157,10 @@ int enable_fsync_tracer(void)
+ write_to_file("/sys/kernel/debug/tracing/current_tracer", "fsync");
+ write_to_file("/sys/kernel/debug/tracing/iter_ctrl", "ftrace_printk");
+ write_to_file("/sys/kernel/debug/tracing/tracing_on", "1");
++ return ret;
+ }
+
+-int disable_fsync_tracer(void)
++void disable_fsync_tracer(void)
+ {
+ write_to_file("/sys/kernel/debug/tracing/tracing_on", "0");
+ }
+diff --git a/latencytop.h b/latencytop.h
+index 5394d73..9d107a8 100644
+--- a/latencytop.h
++++ b/latencytop.h
+@@ -54,5 +54,5 @@ extern char *translate(char *line);
+ extern void init_translations(char *filename);
+ extern int fsync_display(int duration);
+ extern int enable_fsync_tracer(void);
+-extern int disable_fsync_tracer(void);
++extern void disable_fsync_tracer(void);
+ extern void update_list(void);
+--
+2.5.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-fsync.patch b/import-layers/yocto-poky/meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-fsync.patch
new file mode 100644
index 000000000..7848ccf2a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-fsync.patch
@@ -0,0 +1,49 @@
+linux: sysfs: use tracing_on as tracing_enabled is deprecated
+
+tracing_enabled use in the kernel is being deprecated as per commit
+6752ab4a9c30 [tracing: Deprecate tracing_enabled for tracing_on] in
+the linux mainline kernel. tracing_enabled use will generate a warning
+and may no longer function as expected, therefore move to use tracing_on.
+
+Upstream-Status: Pending
+
+Signed-off-by: Dennis Hall <dennis.hall@windriver.com>
+
+Index: latencytop-0.5/fsync.c
+===================================================================
+--- latencytop-0.5.orig/fsync.c 2012-08-03 10:45:49.000000000 -0400
++++ latencytop-0.5/fsync.c 2012-08-03 10:48:39.000000000 -0400
+@@ -149,19 +149,19 @@
+ * cd /sys/kernel/debug/tracing
+ * echo fsync > current_tracer
+ * echo ftrace_printk > iter_ctrl
+- * echo 1 > tracing_enabled
++ * echo 1 > tracing_on
+ */
+ ret = system("/bin/mount -t debugfs none /sys/kernel/debug/");
+ if (!ret)
+ return -1;
+ write_to_file("/sys/kernel/debug/tracing/current_tracer", "fsync");
+ write_to_file("/sys/kernel/debug/tracing/iter_ctrl", "ftrace_printk");
+- write_to_file("/sys/kernel/debug/tracing/tracing_enabled", "1");
++ write_to_file("/sys/kernel/debug/tracing/tracing_on", "1");
+ }
+
+ int disable_fsync_tracer(void)
+ {
+- write_to_file("/sys/kernel/debug/tracing/tracing_enabled", "0");
++ write_to_file("/sys/kernel/debug/tracing/tracing_on", "0");
+ }
+
+
+@@ -339,8 +339,8 @@
+ if (curduration > 5)
+ curduration = 5;
+ /* clear the ftrace buffer */
+- write_to_file("/sys/kernel/debug/tracing/tracing_enabled", "0");
+- write_to_file("/sys/kernel/debug/tracing/tracing_enabled", "1");
++ write_to_file("/sys/kernel/debug/tracing/tracing_on", "0");
++ write_to_file("/sys/kernel/debug/tracing/tracing_on", "1");
+ key = select(1, &rfds, NULL, NULL, &end);
+ parse_ftrace();
+ print_global_list();
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-makefile.patch b/import-layers/yocto-poky/meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-makefile.patch
new file mode 100644
index 000000000..af19b3772
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-makefile.patch
@@ -0,0 +1,39 @@
+diff --git a/Makefile.orig b/Makefile
+index 16a2369..fa797a2 100644
+--- a/Makefile.orig
++++ b/Makefile
+@@ -1,10 +1,11 @@
+-# FIXME: Use autoconf ?
+-HAS_GTK_GUI = 1
++# Upstream-Status: Inappropriate [configuration]
++# Signed-off-by: Jack Mitchell <jack.mitchell@dbbroadcast.co.uk>
+
+ DESTDIR =
+ SBINDIR = /usr/sbin
+ XCFLAGS = -W -g `pkg-config --cflags glib-2.0` -D_FORTIFY_SOURCE=2 -Wno-sign-compare
+-LDF = -Wl,--as-needed `pkg-config --libs glib-2.0` -lncursesw
++LDF = -Wl,--as-needed `pkg-config --libs glib-2.0` -lncurses $(LDFLAGS)
++CC ?= gcc
+
+ OBJS= latencytop.o text_display.o translate.o fsync.o
+
+@@ -26,16 +27,17 @@ endif
+
+ # We write explicity this "implicit rule"
+ %.o : %.c
+- gcc -c $(CFLAGS) $(XCFLAGS) $< -o $@
++ $(CC) -c $(CFLAGS) $(XCFLAGS) $< -o $@
+
+ latencytop: $(OBJS) latencytop.h Makefile
+- gcc $(CFLAGS) $(OBJS) $(LDF) -o latencytop
++ $(CC) $(CFLAGS) $(OBJS) $(LDF) -o latencytop
+
+ clean:
+ rm -f *~ latencytop DEADJOE *.o
+
+ install: latencytop
+ mkdir -p $(DESTDIR)/usr/share/latencytop
++ mkdir -p $(DESTDIR)/$(SBINDIR)
+ install -m 0644 latencytop.trans $(DESTDIR)/usr/share/latencytop/latencytop.trans
+ install -m 0644 *.png $(DESTDIR)/usr/share/latencytop/
+ install -m 0755 latencytop $(DESTDIR)$(SBINDIR)/
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/latencytop/latencytop_0.5.bb b/import-layers/yocto-poky/meta/recipes-kernel/latencytop/latencytop_0.5.bb
new file mode 100644
index 000000000..f31f1bb7a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/latencytop/latencytop_0.5.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Linux tool for measuring and fixing latency"
+HOMEPAGE = "http://www.latencytop.org/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://latencytop.c;endline=23;md5=ee9ea9b1415356e5734adad4a87dc7fa"
+
+DEPENDS = "virtual/libintl ncurses glib-2.0"
+
+PR = "r3"
+
+SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/${BPN}/${BP}.tar.gz/73bb3371c6ee0b0e68e25289027e865c/${BP}.tar.gz \
+ file://latencytop-makefile.patch \
+ file://latencytop-fsync.patch \
+ file://0001-Rectify-the-function-signatures-to-fix-prototype-mis.patch \
+"
+
+SRC_URI[md5sum] = "73bb3371c6ee0b0e68e25289027e865c"
+SRC_URI[sha256sum] = "9e7f72fbea7bd918e71212a1eabaad8488d2c602205d2e3c95d62cd57e9203ef"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+
+PACKAGECONFIG[x11] = ",,gtk+"
+
+EXTRA_OEMAKE_X = "${@bb.utils.contains('PACKAGECONFIG', 'x11', 'HAS_GTK_GUI=1', '', d)}"
+
+#CFLAGS += "${LDFLAGS}"
+
+do_install() {
+ oe_runmake install DESTDIR=${D} ${EXTRA_OEMAKE_X}
+}
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/libpfm/files/0001-Makefile-Add-LDFLAGS-variable-to-SLDFLAGS.patch b/import-layers/yocto-poky/meta/recipes-kernel/libpfm/files/0001-Makefile-Add-LDFLAGS-variable-to-SLDFLAGS.patch
new file mode 100644
index 000000000..d59a7f7d8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/libpfm/files/0001-Makefile-Add-LDFLAGS-variable-to-SLDFLAGS.patch
@@ -0,0 +1,31 @@
+From 272a8a069a8f5f06a1e5dfa0ef12f5f92984728b Mon Sep 17 00:00:00 2001
+From: Noor <noor_ahsan@mentor.com>
+Date: Wed, 12 Aug 2015 20:54:00 +0500
+Subject: [PATCH] Makefile: Add LDFLAGS variable to SLDFLAGS.
+
+* Add LDFLAGS variable to SLDFLAGS so that extra linker
+ flags can be sent via this variable.
+
+Upstream-Status: Submitted [perfmon2-libpfm4-commits@lists.sourceforge.net]
+
+Signed-off-by: Noor Ahsan <noor_ahsan@mentor.com>
+---
+ lib/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/Makefile b/lib/Makefile
+index 1cc8765..4bd92ef 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -187,7 +187,7 @@ CFLAGS += -DCONFIG_PFMLIB_CELL
+ endif
+
+ ifeq ($(SYS),Linux)
+-SLDFLAGS=-shared -Wl,-soname -Wl,$(VLIBPFM)
++SLDFLAGS=$(LDFLAGS) -shared -Wl,-soname -Wl,$(VLIBPFM)
+ SLIBPFM=libpfm.so.$(VERSION).$(REVISION).$(AGE)
+ VLIBPFM=libpfm.so.$(VERSION)
+ SOLIBEXT=so
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/libpfm/libpfm4_4.6.0.bb b/import-layers/yocto-poky/meta/recipes-kernel/libpfm/libpfm4_4.6.0.bb
new file mode 100644
index 000000000..0b024ad61
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/libpfm/libpfm4_4.6.0.bb
@@ -0,0 +1,32 @@
+SUMMARY = "Monitoring tools exploiting the performance monitoring events"
+DESCRIPTION = "This package provides a library, called libpfm4 which is used to develop \
+monitoring tools exploiting the performance monitoring events such as those \
+provided by the Performance Monitoring Unit (PMU) of modern processors."
+HOMEPAGE = "http://perfmon2.sourceforge.net/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=144822&atid=759953&source=navbar"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0de488f3bd4424e308e2e399cb99c788"
+
+SECTION = "devel"
+
+COMPATIBLE_HOST = "powerpc64"
+
+SRC_URI = "http://downloads.sourceforge.net/project/perfmon2/${BPN}/libpfm-${PV}.tar.gz \
+ file://0001-Makefile-Add-LDFLAGS-variable-to-SLDFLAGS.patch \
+ "
+
+SRC_URI[md5sum] = "5077b9022440e4951d96f2d0e73bd487"
+SRC_URI[sha256sum] = "5ab1e5b0472550f9037a8800834f6bc3b927690070f69fac0b67284b4b05fd5f"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/perfmon2/files/libpfm4/"
+
+EXTRA_OEMAKE = "DESTDIR=\"${D}\" PREFIX=\"${prefix}\" LIBDIR=\"${libdir}\" LDCONFIG=\"true\""
+EXTRA_OEMAKE_append_powerpc = " ARCH=\"powerpc\""
+EXTRA_OEMAKE_append_powerpc64 = " ARCH=\"powerpc\" BITMODE=\"64\""
+
+S = "${WORKDIR}/libpfm-${PV}"
+
+do_install () {
+ oe_runmake install
+}
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
new file mode 100644
index 000000000..a4e64d549
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
@@ -0,0 +1,556 @@
+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-hfi1_firmware \
+ & Firmware-i2400m \
+ & Firmware-i915 \
+ & Firmware-ibt_firmware \
+ & Firmware-it913x \
+ & Firmware-iwlwifi_firmware \
+ & Firmware-IntcSST2 \
+ & Firmware-kaweth \
+ & Firmware-Marvell \
+ & Firmware-moxa \
+ & Firmware-mwl8335 \
+ & Firmware-myri10ge_firmware \
+ & Firmware-nvidia \
+ & Firmware-OLPC \
+ & Firmware-ath9k-htc \
+ & Firmware-phanfw \
+ & Firmware-qat \
+ & 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-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 \
+"
+
+LIC_FILES_CHKSUM = "\
+ file://LICENCE.Abilis;md5=b5ee3f410780e56711ad48eadc22b8bc \
+ file://LICENCE.adsp_sst;md5=615c45b91a5a4a9fe046d6ab9a2df728 \
+ file://LICENCE.agere;md5=af0133de6b4a9b2522defd5f188afd31 \
+ file://LICENSE.amdgpu;md5=a8592c24c2672062e03c7392fc7fe3bc \
+ 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://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.mwl8335;md5=9a6271ee0e644404b2ff3c61fd070983 \
+ file://LICENCE.myri10ge_firmware;md5=42e32fb89f6b959ca222e25ac8df8fed \
+ 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://LICENCE.qla1280;md5=d6895732e622d950609093223a2c4f5d \
+ file://LICENCE.qla2xxx;md5=f5ce8529ec5c17cb7f911d2721d90e91 \
+ file://LICENSE.QualcommAtheros_ar3k;md5=b5fe244fb2b532311de1472a3bc06da5 \
+ file://LICENSE.QualcommAtheros_ath10k;md5=b5fe244fb2b532311de1472a3bc06da5 \
+ file://LICENCE.r8a779x_usb3;md5=4c1671656153025d7076105a5da7e498 \
+ file://LICENSE.radeon;md5=6c7f97c6c62bdd9596d0238bb205118c \
+ file://LICENCE.ralink_a_mediatek_company_firmware;md5=728f1a85fd53fd67fa8d7afb080bc435 \
+ file://LICENCE.ralink-firmware.txt;md5=ab2c269277c45476fb449673911a2dfd \
+ file://LICENCE.rtlwifi_firmware.txt;md5=00d06cfd3eddd5a2698948ead2ad54a5 \
+ file://LICENCE.siano;md5=602c79ae3f98f1e73d880fd9f940a418 \
+ 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 \
+"
+
+# 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-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-mwl8335] = "LICENCE.mwl8335"
+NO_GENERIC_LICENSE[Firmware-myri10ge_firmware] = "LICENCE.myri10ge_firmware"
+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-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-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"
+
+SRCREV = "5f8ca0c1db6106a2d6d7e85eee778917ff03c3de"
+PE = "1"
+PV = "0.0+git${SRCPV}"
+
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git"
+
+S = "${WORKDIR}/git"
+
+inherit allarch update-alternatives
+
+CLEANBROKEN = "1"
+
+do_compile() {
+ :
+}
+
+do_install() {
+ install -d ${D}/lib/firmware/
+ cp -r * ${D}/lib/firmware/
+
+ # Avoid Makefile to be deployed
+ rm ${D}/lib/firmware/Makefile
+
+ # Remove unbuild firmware which needs cmake and bash
+ rm ${D}/lib/firmware/carl9170fw -rf
+
+ # Remove pointless bash script
+ rm ${D}/lib/firmware/configure
+
+ # Libertas sd8686
+ ln -sf libertas/sd8686_v9.bin ${D}/lib/firmware/sd8686.bin
+ ln -sf libertas/sd8686_v9_helper.bin ${D}/lib/firmware/sd8686_helper.bin
+
+ # fixup wl12xx location, after 2.6.37 the kernel searches a different location for it
+ ( cd ${D}/lib/firmware ; ln -sf ti-connectivity/* . )
+}
+
+
+PACKAGES =+ "${PN}-ralink-license ${PN}-ralink \
+ ${PN}-radeon-license ${PN}-radeon \
+ ${PN}-marvell-license ${PN}-sd8686 ${PN}-sd8688 ${PN}-sd8787 ${PN}-sd8797 \
+ ${PN}-ti-connectivity-license ${PN}-wl12xx ${PN}-wl18xx \
+ ${PN}-vt6656-license ${PN}-vt6656 \
+ ${PN}-rtl-license ${PN}-rtl8192cu ${PN}-rtl8192ce ${PN}-rtl8192su \
+ ${PN}-broadcom-license ${PN}-bcm4329 ${PN}-bcm4330 ${PN}-bcm4334 ${PN}-bcm43340 ${PN}-bcm4339 ${PN}-bcm4354 \
+ ${PN}-atheros-license ${PN}-ar9170 ${PN}-ath6k ${PN}-ath9k \
+ ${PN}-ar3k-license ${PN}-ar3k ${PN}-ath10k-license ${PN}-ath10k \
+ \
+ ${PN}-iwlwifi-license ${PN}-iwlwifi-135-6 \
+ ${PN}-iwlwifi-3160-7 ${PN}-iwlwifi-3160-8 ${PN}-iwlwifi-3160-9 \
+ ${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}-i915-license ${PN}-i915 \
+ ${PN}-adsp-sst-license ${PN}-adsp-sst \
+ ${PN}-license \
+ "
+
+# For atheros
+LICENSE_${PN}-ar9170 = "Firmware-atheros_firmware"
+LICENSE_${PN}-ath6k = "Firmware-atheros_firmware"
+LICENSE_${PN}-ath9k = "Firmware-atheros_firmware"
+
+FILES_${PN}-atheros-license = "/lib/firmware/LICENCE.atheros_firmware"
+FILES_${PN}-ar9170 = " \
+ /lib/firmware/ar9170*.fw \
+"
+FILES_${PN}-ath6k = " \
+ /lib/firmware/ath6k \
+"
+FILES_${PN}-ath9k = " \
+ /lib/firmware/ar9271.fw \
+ /lib/firmware/ar7010*.fw \
+ /lib/firmware/htc_9271.fw \
+ /lib/firmware/htc_7010.fw \
+"
+
+RDEPENDS_${PN}-ar9170 += "${PN}-atheros-license"
+RDEPENDS_${PN}-ath6k += "${PN}-atheros-license"
+RDEPENDS_${PN}-ath9k += "${PN}-atheros-license"
+
+# For QualCommAthos
+LICENSE_${PN}-ar3k = "Firmware-qualcommAthos_ar3k"
+LICENSE_${PN}-ath10k = "Firmware-qualcommAthos_ath10k"
+
+FILES_${PN}-ar3k-license = "/lib/firmware/LICENSE.QualcommAtheros_ar3k"
+FILES_${PN}-ar3k = " \
+ /lib/firmware/ar3k \
+"
+
+FILES_${PN}-ath10k-license = "/lib/firmware/LICENSE.QualcommAtheros_ath10k"
+FILES_${PN}-ath10k = " \
+ /lib/firmware/ath10k \
+"
+
+RDEPENDS_${PN}-ar3k += "${PN}-ar3k-license"
+RDEPENDS_${PN}-ath10k += "${PN}-ath10k-license"
+
+# For ralink
+LICENSE_${PN}-ralink = "Firmware-ralink-firmware"
+
+FILES_${PN}-ralink-license = "/lib/firmware/LICENCE.ralink-firmware.txt"
+FILES_${PN}-ralink = " \
+ /lib/firmware/rt*.bin \
+"
+
+RDEPENDS_${PN}-ralink += "${PN}-ralink-license"
+
+# For radeon
+LICENSE_${PN}-radeon = "Firmware-radeon"
+
+FILES_${PN}-radeon-license = "/lib/firmware/LICENSE.radeon"
+FILES_${PN}-radeon = " \
+ /lib/firmware/radeon \
+"
+
+RDEPENDS_${PN}-radeon += "${PN}-radeon-license"
+
+# For marvell
+LICENSE_${PN}-sd8686 = "Firmware-Marvell"
+LICENSE_${PN}-sd8688 = "Firmware-Marvell"
+LICENSE_${PN}-sd8787 = "Firmware-Marvell"
+LICENSE_${PN}-sd8797 = "Firmware-Marvell"
+
+FILES_${PN}-marvell-license = "/lib/firmware/LICENCE.Marvell"
+FILES_${PN}-sd8686 = " \
+ /lib/firmware/libertas/sd8686_v9* \
+ /lib/firmware/sd8686* \
+"
+FILES_${PN}-sd8688 = " \
+ /lib/firmware/libertas/sd8688* \
+ /lib/firmware/mrvl/sd8688* \
+"
+FILES_${PN}-sd8787 = " \
+ /lib/firmware/mrvl/sd8787_uapsta.bin \
+"
+FILES_${PN}-sd8797 = " \
+ /lib/firmware/mrvl/sd8797_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"
+
+# For rtl
+LICENSE_${PN}-rtl8192cu = "Firmware-rtlwifi_firmware"
+LICENSE_${PN}-rtl8192ce = "Firmware-rtlwifi_firmware"
+LICENSE_${PN}-rtl8192su = "Firmware-rtlwifi_firmware"
+
+FILES_${PN}-rtl-license = " \
+ /lib/firmware/LICENCE.rtlwifi_firmware.txt \
+"
+FILES_${PN}-rtl8192cu = " \
+ /lib/firmware/rtlwifi/rtl8192cufw*.bin \
+"
+FILES_${PN}-rtl8192ce = " \
+ /lib/firmware/rtlwifi/rtl8192cfw*.bin \
+"
+FILES_${PN}-rtl8192su = " \
+ /lib/firmware/rtlwifi/rtl8712u.bin \
+"
+
+RDEPENDS_${PN}-rtl8192ce += "${PN}-rtl-license"
+RDEPENDS_${PN}-rtl8192cu += "${PN}-rtl-license"
+RDEPENDS_${PN}-rtl8192su = "${PN}-rtl-license"
+
+# For ti-connectivity
+LICENSE_${PN}-wl12xx = "Firmware-ti-connectivity"
+LICENSE_${PN}-wl18xx = "Firmware-ti-connectivity"
+
+FILES_${PN}-ti-connectivity-license = "/lib/firmware/LICENCE.ti-connectivity"
+FILES_${PN}-wl12xx = " \
+ /lib/firmware/wl12* \
+ /lib/firmware/TI* \
+ /lib/firmware/ti-connectivity \
+"
+FILES_${PN}-wl18xx = " \
+ /lib/firmware/wl18* \
+ /lib/firmware/TI* \
+ /lib/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"
+
+FILES_${PN}-vt6656-license = "/lib/firmware/LICENCE.via_vt6656"
+FILES_${PN}-vt6656 = " \
+ /lib/firmware/vntwusb.fw \
+"
+
+RDEPENDS_${PN}-vt6656 = "${PN}-vt6656-license"
+
+# For broadcom
+#
+# WARNING: The ALTERNATIVE_* variables are not using ${PN} because of
+# a bug in bitbake; when this is fixed and bitbake learns how to proper
+# pass variable flags with expansion we can rework this patch.
+
+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}-bcm4339 = "Firmware-broadcom_bcm43xx"
+LICENSE_${PN}-bcm4354 = "Firmware-broadcom_bcm43xx"
+
+FILES_${PN}-broadcom-license = " \
+ /lib/firmware/LICENCE.broadcom_bcm43xx \
+"
+FILES_${PN}-bcm4329 = " \
+ /lib/firmware/brcm/brcmfmac4329-sdio.bin \
+"
+FILES_${PN}-bcm4330 = " \
+ /lib/firmware/brcm/brcmfmac4330-sdio.bin \
+"
+FILES_${PN}-bcm4334 = " \
+ /lib/firmware/brcm/brcmfmac4334-sdio.bin \
+"
+FILES_${PN}-bcm43340 = " \
+ /lib/firmware/brcm/brcmfmac43340-sdio.bin \
+"
+FILES_${PN}-bcm4339 = " \
+ /lib/firmware/brcm/brcmfmac4339-sdio.bin \
+"
+FILES_${PN}-bcm4354 = " \
+ /lib/firmware/brcm/brcmfmac4354-sdio.bin \
+"
+
+ALTERNATIVE_LINK_NAME[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac-sdio.bin"
+
+ALTERNATIVE_linux-firmware-bcm4334 = "brcmfmac-sdio.bin"
+ALTERNATIVE_TARGET_linux-firmware-bcm4334[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac4334-sdio.bin"
+ALTERNATIVE_linux-firmware-bcm43340 = "brcmfmac-sdio.bin"
+ALTERNATIVE_TARGET_linux-firmware-bcm43340[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac43340-sdio.bin"
+ALTERNATIVE_linux_firmware-bcm4354 = "brcmfmac-sdio.bin"
+ALTERNATIVE_TARGET_linux-firmware-bcm4354[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac4354-sdio.bin"
+ALTERNATIVE_linux-firmware-bcm4329 = "brcmfmac-sdio.bin"
+ALTERNATIVE_TARGET_linux-firmware-bcm4329[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac4329-sdio.bin"
+ALTERNATIVE_linux-firmware-bcm4330 = "brcmfmac-sdio.bin"
+ALTERNATIVE_TARGET_linux-firmware-bcm4330[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac4330-sdio.bin"
+ALTERNATIVE_linux-firmware-bcm4339 = "brcmfmac-sdio.bin"
+ALTERNATIVE_TARGET_linux-firmware-bcm4339[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac4339-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}-bcm4339 += "${PN}-broadcom-license"
+RDEPENDS_${PN}-bcm4354 += "${PN}-broadcom-license"
+
+# For iwlwifi
+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-6000-4 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-6000g2a-5 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-6000g2a-6 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-6000g2a-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"
+
+
+FILES_${PN}-iwlwifi-license = "/lib/firmware/LICENCE.iwlwifi_firmware"
+FILES_${PN}-iwlwifi-135-6 = "/lib/firmware/iwlwifi-135-6.ucode"
+FILES_${PN}-iwlwifi-3160-7 = "/lib/firmware/iwlwifi-3160-7.ucode"
+FILES_${PN}-iwlwifi-3160-8 = "/lib/firmware/iwlwifi-3160-8.ucode"
+FILES_${PN}-iwlwifi-3160-9 = "/lib/firmware/iwlwifi-3160-9.ucode"
+FILES_${PN}-iwlwifi-6000-4 = "/lib/firmware/iwlwifi-6000-4.ucode"
+FILES_${PN}-iwlwifi-6000g2a-5 = "/lib/firmware/iwlwifi-6000g2a-5.ucode"
+FILES_${PN}-iwlwifi-6000g2a-6 = "/lib/firmware/iwlwifi-6000g2a-6.ucode"
+FILES_${PN}-iwlwifi-6000g2b-5 = "/lib/firmware/iwlwifi-6000g2b-5.ucode"
+FILES_${PN}-iwlwifi-6000g2b-6 = "/lib/firmware/iwlwifi-6000g2b-6.ucode"
+FILES_${PN}-iwlwifi-6050-4 = "/lib/firmware/iwlwifi-6050-4.ucode"
+FILES_${PN}-iwlwifi-6050-5 = "/lib/firmware/iwlwifi-6050-5.ucode"
+FILES_${PN}-iwlwifi-7260 = "/lib/firmware/iwlwifi-7260-*.ucode"
+FILES_${PN}-iwlwifi-7265 = "/lib/firmware/iwlwifi-7265-*.ucode"
+FILES_${PN}-iwlwifi-7265d = "/lib/firmware/iwlwifi-7265D-*.ucode"
+FILES_${PN}-iwlwifi-8000c = "/lib/firmware/iwlwifi-8000C-*.ucode"
+FILES_${PN}-iwlwifi-8265 = "/lib/firmware/iwlwifi-8265-*.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-6000-4 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-6000g2a-5 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-6000g2a-6 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-6000g2a-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"
+
+# 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"
+
+LICENSE_${PN}-i915 = "Firmware-i915"
+FILES_${PN}-i915-license = "/lib/firmware/LICENSE.i915"
+FILES_${PN}-i915 = "/lib/firmware/i915"
+RDEPENDS_${PN}-i915 = "${PN}-i915-license"
+
+FILES_${PN}-adsp-sst-license = "/lib/firmware/LICENCE.adsp_sst"
+LICENSE_${PN}-adsp-sst = "Firmware-adsp_sst"
+FILES_${PN}-adsp-sst = "/lib/firmware/intel/dsp_fw*"
+RDEPENDS_${PN}-adsp-sst = "${PN}-adsp-sst-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-mwl8335 \
+ & Firmware-myri10ge_firmware \
+ & Firmware-nvidia \
+ & Firmware-OLPC \
+ & Firmware-ath9k-htc \
+ & Firmware-phanfw \
+ & Firmware-qat \
+ & Firmware-qla1280 \
+ & Firmware-qla2xxx \
+ & Firmware-r8a779x_usb3 \
+ & Firmware-radeon \
+ & Firmware-ralink_a_mediatek_company_firmware \
+ & Firmware-siano \
+ & Firmware-tda7706-firmware \
+ & Firmware-ti-connectivity \
+ & Firmware-ti-keystone \
+ & Firmware-ueagle-atm4-firmware \
+ & Firmware-wl1251 \
+ & Firmware-xc4000 \
+ & Firmware-xc5000 \
+ & Firmware-xc5000c \
+"
+
+FILES_${PN}-license += "/lib/firmware/LICEN*"
+FILES_${PN} += "/lib/firmware/*"
+RDEPENDS_${PN} += "${PN}-license"
+
+# Make linux-firmware depend on all of the split-out packages.
+python populate_packages_prepend () {
+ firmware_pkgs = oe.utils.packages_filter_out_system(d)
+ d.appendVar('RDEPENDS_linux-firmware', ' ' + ' '.join(firmware_pkgs))
+}
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc b/import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
new file mode 100644
index 000000000..2ba6ed51d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
@@ -0,0 +1,78 @@
+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 DEPENDS += "virtual/kernel" 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",True).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
+
+KORG_ARCHIVE_COMPRESSION ?= "xz"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/kernel/v${HEADER_FETCH_VER}/linux-${PV}.tar.${KORG_ARCHIVE_COMPRESSION}"
+
+S = "${WORKDIR}/linux-${PV}"
+
+# For the kernel, we don't want the '-e MAKEFLAGS=' in EXTRA_OEMAKE.
+EXTRA_OEMAKE = ""
+
+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
+}
+
+BBCLASSEXTEND = "nativesdk"
+
+#DEPENDS = "cross-linkage"
+RDEPENDS_${PN}-dev = ""
+RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
+
+INHIBIT_DEFAULT_DEPS = "1"
+DEPENDS += "unifdef-native"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch b/import-layers/yocto-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..6ad479863
--- /dev/null
+++ b/import-layers/yocto-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,89 @@
+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.4/include/uapi/linux/libc-compat.h
+===================================================================
+--- linux-4.4.orig/include/uapi/linux/libc-compat.h
++++ linux-4.4/include/uapi/linux/libc-compat.h
+@@ -48,13 +48,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 netinet/in.h header. */
++/* Coordinate with libc netinet/in.h header. */
+ #if defined(_NETINET_IN_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_IN_ADDR 0
+ #define __UAPI_DEF_IN_IPPROTO 0
+@@ -64,15 +63,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
+@@ -80,10 +71,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
+@@ -93,7 +84,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
+@@ -115,7 +106,7 @@
+ /* If we did not see any headers from any supported C libraries,
+ * or we are being included in the kernel, then define everything
+ * that we need. */
+-#else /* !defined(__GLIBC__) */
++#else /* __KERNEL__ */
+
+ /* Definitions for in.h */
+ #define __UAPI_DEF_IN_ADDR 1
+@@ -138,6 +129,6 @@
+ /* Definitions for xattr.h */
+ #define __UAPI_DEF_XATTR 1
+
+-#endif /* __GLIBC__ */
++#endif /* __KERNEL__ */
+
+ #endif /* _UAPI_LIBC_COMPAT_H */
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch b/import-layers/yocto-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..c61709374
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch
@@ -0,0 +1,59 @@
+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(-)
+
+diff --git a/include/uapi/linux/if_ether.h b/include/uapi/linux/if_ether.h
+index aa63ed0..e94da57 100644
+--- a/include/uapi/linux/if_ether.h
++++ b/include/uapi/linux/if_ether.h
+@@ -22,6 +22,7 @@
+ #define _UAPI_LINUX_IF_ETHER_H
+
+ #include <linux/types.h>
++#include <linux/libc-compat.h>
+
+ /*
+ * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
+@@ -134,11 +135,12 @@
+ * This is an Ethernet frame header.
+ */
+
++#if __UAPI_DEF_ETHHDR
+ struct ethhdr {
+ unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
+ unsigned char h_source[ETH_ALEN]; /* source ether addr */
+ __be16 h_proto; /* packet type ID field */
+ } __attribute__((packed));
+-
++#endif
+
+ #endif /* _UAPI_LINUX_IF_ETHER_H */
+diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
+index afe15c2..7d0c78a 100644
+--- a/include/uapi/linux/libc-compat.h
++++ b/include/uapi/linux/libc-compat.h
+@@ -50,6 +50,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 netinet/in.h header. */
+ #if defined(_NETINET_IN_H)
+
+--
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch b/import-layers/yocto-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..6d9e8d864
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch
@@ -0,0 +1,32 @@
+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(+)
+
+diff --git a/include/uapi/linux/kernel.h b/include/uapi/linux/kernel.h
+index 321e399..e8ff821 100644
+--- a/include/uapi/linux/kernel.h
++++ b/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
+--
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.4.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.4.bb
new file mode 100644
index 000000000..3763dc0d3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.4.bb
@@ -0,0 +1,9 @@
+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 \
+ "
+SRC_URI[md5sum] = "9a78fa2eb6c68ca5a40ed5af08142599"
+SRC_URI[sha256sum] = "401d7c8fef594999a460d10c72c5a94e9c2e1022f16795ec51746b0d165418b2"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux/kernel-devsrc.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux/kernel-devsrc.bb
new file mode 100644
index 000000000..196c8c7a2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux/kernel-devsrc.bb
@@ -0,0 +1,76 @@
+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"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+
+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"
+
+# Define where the kernel headers are installed on the target as well as where
+# they are staged.
+KERNEL_SRC_PATH = "/usr/src/kernel"
+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 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
+
+ # 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
+
+ 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/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-dtb.inc b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-dtb.inc
new file mode 100644
index 000000000..651a19e4a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-dtb.inc
@@ -0,0 +1,74 @@
+# Support for device tree generation
+FILES_kernel-devicetree = "/${KERNEL_IMAGEDEST}/devicetree*"
+
+python __anonymous () {
+ d.appendVar("PACKAGES", " kernel-devicetree")
+}
+
+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_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_BASE_NAME=`basename ${DTB} .dtb`
+ DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
+ DTB_PATH=`get_real_dtb_path_in_kernel "${DTB}"`
+ install -m 0644 ${DTB_PATH} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.dtb
+ done
+}
+
+do_deploy_append() {
+ for DTB in ${KERNEL_DEVICETREE}; do
+ DTB=`normalize_dtb "${DTB}"`
+ DTB_BASE_NAME=`basename ${DTB} .dtb`
+ DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
+ DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_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
+ ln -sf ${DTB_NAME}.dtb ${DEPLOYDIR}/${DTB_SYMLINK_NAME}.dtb
+ done
+}
+
+pkg_postinst_kernel-devicetree () {
+ cd /${KERNEL_IMAGEDEST}
+ for DTB in ${KERNEL_DEVICETREE}
+ do
+ DTB_BASE_NAME=`basename ${DTB} | awk -F "." '{print $1}'`
+ DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
+ update-alternatives --install /${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.dtb ${DTB_BASE_NAME}.dtb /boot/devicetree-${DTB_SYMLINK_NAME}.dtb ${KERNEL_PRIORITY} || true
+ done
+}
+
+pkg_postrm_kernel-devicetree () {
+ cd /${KERNEL_IMAGEDEST}
+ for DTB in ${KERNEL_DEVICETREE}
+ do
+ DTB_BASE_NAME=`basename ${DTB} | awk -F "." '{print $1}'`
+ DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
+ update-alternatives --remove ${DTB_BASE_NAME}.dtb /boot/devicetree-${DTB_SYMLINK_NAME}.dtb ${KERNEL_PRIORITY} || true
+ done
+}
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-dummy.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-dummy.bb
new file mode 100644
index 000000000..cc0e4e64a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-dummy.bb
@@ -0,0 +1,54 @@
+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"
+FILES_kernel-modules = ""
+ALLOW_EMPTY_kernel-modules = "1"
+DESCRIPTION_kernel-modules = "Kernel modules meta package"
+
+#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/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-dummy/COPYING.GPL b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-dummy/COPYING.GPL
new file mode 100644
index 000000000..d511905c1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-dev.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-dev.bb
new file mode 100644
index 000000000..308526345
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-dev.bb
@@ -0,0 +1,51 @@
+# 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
+
+# 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("PREFERRED_PROVIDER_virtual/kernel", True) != "linux-yocto-dev":
+ raise bb.parse.SkipPackage("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-dev to enable it")
+}
+
+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.6-rc+"
+LINUX_VERSION_EXTENSION ?= "-yoctodev-${LINUX_KERNEL_TYPE}"
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+COMPATIBLE_MACHINE = "(qemuarm|qemux86|qemuppc|qemumips|qemumips64|qemux86-64)"
+
+# Functionality flags
+KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/taskstats/taskstats.scc"
+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"
+KERNEL_FEATURES_append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " cfg/x32.scc", "" ,d)}"
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-rt_4.1.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-rt_4.1.bb
new file mode 100644
index 000000000..a13895727
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-rt_4.1.bb
@@ -0,0 +1,27 @@
+KBRANCH ?= "standard/preempt-rt/base"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+SRCREV_machine ?= "28d8cfdbcb18a6eef202099cca66430fd3b6eae0"
+SRCREV_meta ?= "a4f88c3fad887e1c559d03ae1b531ca267137b69"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.1.git;branch=${KBRANCH};name=machine \
+ git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.1;destsuffix=${KMETA}"
+
+LINUX_VERSION ?= "4.1.18"
+
+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)"
+
+# 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/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb
new file mode 100644
index 000000000..d81ca1387
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb
@@ -0,0 +1,27 @@
+KBRANCH ?= "standard/preempt-rt"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+SRCREV_machine ?= "2bc112a6ccd16800a4c45e47ccb3018a1042abdf"
+SRCREV_meta ?= "bcc65090840f51a6ac937297be5c22fe268d01ab"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.4.git;branch=${KBRANCH};name=machine \
+ git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.4;destsuffix=${KMETA}"
+
+LINUX_VERSION ?= "4.4.3"
+
+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)"
+
+# 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/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.1.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.1.bb
new file mode 100644
index 000000000..28c72132a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.1.bb
@@ -0,0 +1,23 @@
+KBRANCH ?= "standard/tiny/common-pc"
+LINUX_KERNEL_TYPE = "tiny"
+KCONFIG_MODE = "--allnoconfig"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+LINUX_VERSION ?= "4.1.18"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+SRCREV_machine ?= "91f62d4a0a31919d9b2ccdaf881130f99b61fc5e"
+SRCREV_meta ?= "a4f88c3fad887e1c559d03ae1b531ca267137b69"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.1.git;branch=${KBRANCH};name=machine \
+ git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.1;destsuffix=${KMETA}"
+
+COMPATIBLE_MACHINE = "(qemux86$)"
+
+# Functionality flags
+KERNEL_FEATURES = ""
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.4.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.4.bb
new file mode 100644
index 000000000..684e88098
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.4.bb
@@ -0,0 +1,23 @@
+KBRANCH ?= "standard/tiny/common-pc"
+LINUX_KERNEL_TYPE = "tiny"
+KCONFIG_MODE = "--allnoconfig"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+LINUX_VERSION ?= "4.4.3"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+SRCREV_machine ?= "1a72cec834de2c80b5563f8afbeea7664fd5ee05"
+SRCREV_meta ?= "bcc65090840f51a6ac937297be5c22fe268d01ab"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.4.git;branch=${KBRANCH};name=machine \
+ git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.4;destsuffix=${KMETA}"
+
+COMPATIBLE_MACHINE = "(qemux86$)"
+
+# Functionality flags
+KERNEL_FEATURES = ""
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto.inc b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto.inc
new file mode 100644
index 000000000..6b161fc06
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto.inc
@@ -0,0 +1,57 @@
+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"
+
+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}"
+
+# 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"
+
+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"
+
+LINUX_VERSION_EXTENSION ?= "-yocto-${LINUX_KERNEL_TYPE}"
+
+# Pick up shared functions
+inherit kernel
+inherit kernel-yocto
+require linux-dtb.inc
+
+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_link_vmlinux after do_compile before do_install
+addtask validate_branches before do_patch after do_kernel_checkout
+addtask kernel_configcheck after do_configure before do_compile
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto_4.1.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto_4.1.bb
new file mode 100644
index 000000000..aecb517ed
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto_4.1.bb
@@ -0,0 +1,42 @@
+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 ?= "232e2d88841c7e20857350275d80f5585ed93734"
+SRCREV_machine_qemuarm64 ?= "91f62d4a0a31919d9b2ccdaf881130f99b61fc5e"
+SRCREV_machine_qemumips ?= "7d3690c0762f11e038f14310a50ca1cdc813cc22"
+SRCREV_machine_qemuppc ?= "91f62d4a0a31919d9b2ccdaf881130f99b61fc5e"
+SRCREV_machine_qemux86 ?= "91f62d4a0a31919d9b2ccdaf881130f99b61fc5e"
+SRCREV_machine_qemux86-64 ?= "91f62d4a0a31919d9b2ccdaf881130f99b61fc5e"
+SRCREV_machine_qemumips64 ?= "b71e4cd7d45f03048ad31e2a36dfe5a43f021b51"
+SRCREV_machine ?= "91f62d4a0a31919d9b2ccdaf881130f99b61fc5e"
+SRCREV_meta ?= "a4f88c3fad887e1c559d03ae1b531ca267137b69"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.1.git;name=machine;branch=${KBRANCH}; \
+ git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.1;destsuffix=${KMETA}"
+
+LINUX_VERSION ?= "4.1.18"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+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/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto_4.4.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto_4.4.bb
new file mode 100644
index 000000000..3c5ee1bd4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/linux/linux-yocto_4.4.bb
@@ -0,0 +1,42 @@
+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 ?= "ec9167bcb0ccd4897177c5e235af68b5890aa326"
+SRCREV_machine_qemuarm64 ?= "1a72cec834de2c80b5563f8afbeea7664fd5ee05"
+SRCREV_machine_qemumips ?= "900f98d3ab6498bc7f4ff6b7a489db3bca4e6417"
+SRCREV_machine_qemuppc ?= "1a72cec834de2c80b5563f8afbeea7664fd5ee05"
+SRCREV_machine_qemux86 ?= "1a72cec834de2c80b5563f8afbeea7664fd5ee05"
+SRCREV_machine_qemux86-64 ?= "1a72cec834de2c80b5563f8afbeea7664fd5ee05"
+SRCREV_machine_qemumips64 ?= "4b08dfb1fb3bc7659e8f3e13665597d9a9f0816d"
+SRCREV_machine ?= "1a72cec834de2c80b5563f8afbeea7664fd5ee05"
+SRCREV_meta ?= "bcc65090840f51a6ac937297be5c22fe268d01ab"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.4.git;name=machine;branch=${KBRANCH}; \
+ git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.4;destsuffix=${KMETA}"
+
+LINUX_VERSION ?= "4.4.3"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+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/import-layers/yocto-poky/meta/recipes-kernel/lttng/babeltrace/0001-Fix-invalid-pointer-free-with-trace-collection.patch b/import-layers/yocto-poky/meta/recipes-kernel/lttng/babeltrace/0001-Fix-invalid-pointer-free-with-trace-collection.patch
new file mode 100644
index 000000000..3e2c4e1e6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/lttng/babeltrace/0001-Fix-invalid-pointer-free-with-trace-collection.patch
@@ -0,0 +1,44 @@
+From e4cad900994cf286d971796a947fea782dfc6651 Mon Sep 17 00:00:00 2001
+From: Francis Giraldeau <francis.giraldeau@gmail.com>
+Date: Mon, 15 Jun 2015 11:43:02 -0400
+Subject: [PATCH] Fix invalid pointer free with trace collection
+
+Upstream-Status: Submitted
+
+Patch proposed by Li RongQing related to bug# 790
+
+Signed-off-by: Mikael Beckius <mikael.beckius@windriver.com>
+Signed-off-by: Francis Giraldeau <francis.giraldeau@gmail.com>
+---
+ lib/context.c | 8 +++-----
+ 1 file changed, 3 insertions(+), 5 deletions(-)
+
+diff --git a/lib/context.c b/lib/context.c
+index 45aab34..8d3770f 100644
+--- a/lib/context.c
++++ b/lib/context.c
+@@ -79,7 +79,7 @@ int bt_context_add_trace(struct bt_context *ctx, const char *path,
+ struct bt_trace_descriptor *td;
+ struct bt_format *fmt;
+ struct bt_trace_handle *handle;
+- int ret, closeret;
++ int ret;
+
+ if (!ctx || !format_name || (!path && !stream_list))
+ return -EINVAL;
+@@ -159,10 +159,8 @@ int bt_context_add_trace(struct bt_context *ctx, const char *path,
+ return handle->id;
+
+ error:
+- closeret = fmt->close_trace(td);
+- if (closeret) {
+- fprintf(stderr, "Error in close_trace callback\n");
+- }
++ if (handle)
++ bt_context_remove_trace(ctx, handle->id);
+ end:
+ return ret;
+ }
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/lttng/babeltrace/0001-lttng-live-Include-sys-param.h-for-MAXNAMLEN-definti.patch b/import-layers/yocto-poky/meta/recipes-kernel/lttng/babeltrace/0001-lttng-live-Include-sys-param.h-for-MAXNAMLEN-definti.patch
new file mode 100644
index 000000000..eb16cd1d2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/lttng/babeltrace/0001-lttng-live-Include-sys-param.h-for-MAXNAMLEN-definti.patch
@@ -0,0 +1,29 @@
+From 8331b87845cafdda40e59a682f2ca8120ed0c472 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 31 Dec 2015 08:17:40 +0000
+Subject: [PATCH] lttng-live: Include sys/param.h for MAXNAMLEN defintion
+
+exposed on musl based systems
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: pending
+
+ formats/lttng-live/lttng-live.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/formats/lttng-live/lttng-live.h b/formats/lttng-live/lttng-live.h
+index 4ab641d..808ed2b 100644
+--- a/formats/lttng-live/lttng-live.h
++++ b/formats/lttng-live/lttng-live.h
+@@ -25,6 +25,7 @@
+ */
+
+ #include <stdint.h>
++#include <sys/param.h>
+ #include "lttng-viewer-abi.h"
+
+ #define LTTNG_DEFAULT_NETWORK_VIEWER_PORT 5344
+--
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/lttng/babeltrace_1.3.1.bb b/import-layers/yocto-poky/meta/recipes-kernel/lttng/babeltrace_1.3.1.bb
new file mode 100644
index 000000000..176602632
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/lttng/babeltrace_1.3.1.bb
@@ -0,0 +1,24 @@
+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
+
+SRCREV = "6e2b9096c77138593097335b9b27202d98918089"
+
+SRC_URI = "git://git.efficios.com/babeltrace.git;branch=stable-1.3 \
+ file://0001-Fix-invalid-pointer-free-with-trace-collection.patch \
+ file://0001-lttng-live-Include-sys-param.h-for-MAXNAMLEN-definti.patch \
+"
+
+S = "${WORKDIR}/git"
+
+do_configure_prepend () {
+ ( cd ${S}; ${S}/bootstrap )
+}
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-modules_git.bb b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-modules_git.bb
new file mode 100644
index 000000000..2eb1a51bc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-modules_git.bb
@@ -0,0 +1,33 @@
+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=362844633a08753bd96ab322a6c7f9f6 \
+ file://gpl-2.0.txt;md5=751419260aa954499f7abaabaa882bbe \
+ file://lgpl-2.1.txt;md5=243b725d71bb5df4a1e5920b344b86ad"
+
+inherit module
+
+SRCREV = "45e0ebd91f995cc73c2b0d5c60cf9d12e8c838bf"
+PV = "2.7.1+git${SRCPV}"
+
+COMPATIBLE_HOST = '(x86_64|i.86|powerpc|aarch64|mips|nios2|arm).*-linux'
+
+SRC_URI = "git://git.lttng.org/lttng-modules.git;branch=stable-2.7"
+
+export INSTALL_MOD_DIR="kernel/lttng-modules"
+
+EXTRA_OEMAKE += "KERNELDIR='${STAGING_KERNEL_DIR}'"
+
+S = "${WORKDIR}/git"
+
+do_install_append() {
+ # Delete empty directories to avoid QA failures if no modules were built
+ find ${D}/lib -depth -type d -empty -exec rmdir {} \;
+}
+
+python do_package_prepend() {
+ if not os.path.exists(os.path.join(d.getVar('D', True), 'lib/modules')):
+ bb.warn("%s: no modules were created; this may be due to CONFIG_TRACEPOINTS not being enabled in your kernel." % d.getVar('PN', True))
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools/Revert-Build-look-for-python-3.0-when-building-pytho.patch b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools/Revert-Build-look-for-python-3.0-when-building-pytho.patch
new file mode 100644
index 000000000..d05c04c66
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools/Revert-Build-look-for-python-3.0-when-building-pytho.patch
@@ -0,0 +1,30 @@
+From: Otavio Salvador <otavio@ossystems.com.br>
+Date: Fri, 4 Dec 2015 16:11:41 +0000
+Subject: [PATCH] Revert "Build: look for python >= 3.0 when building python bindings"
+Organization: O.S. Systems Software LTDA.
+
+This reverts commit 227703a2ceada3c104edd56756d48455ca4c271a.
+
+Upstream-Status: Pending
+
+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 4dee4b4..6608bcd 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -339,7 +339,7 @@ AM_CONDITIONAL([PYTHON_BINDING], [test "x${enable_python_binding:-yes}" = xyes])
+
+ if test "x${enable_python_binding:-yes}" = xyes; then
+ AX_PKG_SWIG($swig_version, [], [ AC_MSG_ERROR([SWIG $swig_version or newer is needed]) ])
+- AM_PATH_PYTHON([3.0])
++ AM_PATH_PYTHON
+
+ AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for python, bypassing python-config])
+ AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config])
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools/run-ptest b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools/run-ptest
new file mode 100755
index 000000000..e758815c7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools/run-ptest
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+make -C tests installcheck
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools/runtest-2.4.0.patch b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools/runtest-2.4.0.patch
new file mode 100644
index 000000000..958bce48e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools/runtest-2.4.0.patch
@@ -0,0 +1,27 @@
+diff --git a/Makefile.am b/Makefile.am
+index 584f59b..c2bcabd 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -12,3 +12,9 @@ dist_doc_DATA = LICENSE \
+ dist_noinst_DATA = CodingStyle
+
+ EXTRA_DIST = extras/lttng-bash_completion gpl-2.0.txt lgpl-2.1.txt
++
++install-ptest:
++ cp -r $(srcdir)/tests $(DESTDIR)
++ for m in $$(find $(DESTDIR)/tests -name Makefile); do \
++ sed -i -e 's|^Makefile:|_Makefile:|' $$m; \
++ done
+diff --git a/tests/run.sh b/tests/run.sh
+index c6c50fd..6455359 100755
+--- a/tests/run.sh
++++ b/tests/run.sh
+@@ -19,4 +19,7 @@
+
+ [ -z "$1" ] && echo "Error: No testlist. Please specify a testlist to run." && exit 1
+
+-prove --merge --exec '' - < $1
++prove --merge -v --exec '' - < $1 | sed \
++ -e 's|^ok \(.*\)|PASS: \1|' \
++ -e 's|^not ok \(.*\)|FAIL: \1|' \
++ | egrep -h 'PASS|FAIL'
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools/stop-using-SIGUNUSED.patch b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools/stop-using-SIGUNUSED.patch
new file mode 100644
index 000000000..bd4f7d1d1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools/stop-using-SIGUNUSED.patch
@@ -0,0 +1,51 @@
+From 1f54181c2df1fb92c3323a6dbf8273fb66b883b6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Galarneau?=
+ <jeremie.galarneau@efficios.com>
+Date: Sat, 17 Oct 2015 19:41:47 -0400
+Subject: [PATCH] Port: Don't use SIGUNUSED which is not defined on Solaris
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+Organization: O.S. Systems Software LTDA.
+
+Upstream-Status: Backport [2.8.0]
+
+Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+---
+ src/common/runas.c | 18 +++++-------------
+ 1 file changed, 5 insertions(+), 13 deletions(-)
+
+diff --git a/src/common/runas.c b/src/common/runas.c
+index 57f7382..0825470 100644
+--- a/src/common/runas.c
++++ b/src/common/runas.c
+@@ -530,21 +530,13 @@ int run_as_rmdir_recursive(const char *path, uid_t uid, gid_t gid)
+ static
+ int reset_sighandler(void)
+ {
+- int sig, ret = 0;
++ int sig;
+
+- for (sig = SIGHUP; sig <= SIGUNUSED; sig++) {
+- /* Skip unblockable signals. */
+- if (sig == SIGKILL || sig == SIGSTOP) {
+- continue;
+- }
+- if (signal(sig, SIG_DFL) == SIG_ERR) {
+- PERROR("reset signal %d", sig);
+- ret = -1;
+- goto end;
+- }
++ DBG("Resetting run_as worker signal handlers to default");
++ for (sig = 1; sig <= 31; sig++) {
++ (void) signal(sig, SIG_DFL);
+ }
+-end:
+- return ret;
++ return 0;
+ }
+
+ static
+--
+2.6.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools_git.bb b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools_git.bb
new file mode 100644
index 000000000..8bd09892c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-tools_git.bb
@@ -0,0 +1,82 @@
+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"
+RDEPENDS_${PN} = "libgcc"
+RDEPENDS_${PN}-ptest += "make perl bash"
+
+SRCREV = "a90f2c1e10b759782653a81815625e9d1bbb75ca"
+PV = "2.7.1+git${SRCPV}"
+
+PYTHON_OPTION = "am_cv_python_pyexecdir='${libdir}/python${PYTHON_BASEVERSION}/site-packages' \
+ am_cv_python_pythondir='${libdir}/python${PYTHON_BASEVERSION}/site-packages' \
+ PYTHON_INCLUDE='-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}' \
+"
+PACKAGECONFIG ??= "lttng-ust"
+PACKAGECONFIG[python] = "--enable-python-bindings ${PYTHON_OPTION},,python swig-native"
+PACKAGECONFIG[lttng-ust] = "--enable-lttng-ust, --disable-lttng-ust, lttng-ust"
+PACKAGECONFIG[kmod] = "--enable-kmod, --disable-kmod, kmod"
+PACKAGECONFIG_remove_libc-musl = "lttng-ust"
+
+SRC_URI = "git://git.lttng.org/lttng-tools.git;branch=stable-2.7 \
+ file://Revert-Build-look-for-python-3.0-when-building-pytho.patch \
+ file://stop-using-SIGUNUSED.patch \
+ file://runtest-2.4.0.patch \
+ file://run-ptest"
+
+S = "${WORKDIR}/git"
+
+inherit autotools-brokensep ptest pkgconfig useradd
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "tracing"
+
+FILES_${PN} += "${libdir}/lttng/libexec/* ${datadir}/xml/lttng \
+ ${libdir}/python${PYTHON_BASEVERSION}/site-packages/*"
+FILES_${PN}-staticdev += "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*.a"
+FILES_${PN}-dev += "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*.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_configure_prepend () {
+ # Delete a shipped m4 file that overrides our patched one
+ rm -f ${S}/config/libxml.m4
+}
+
+do_install_ptest () {
+ chmod +x ${D}${PTEST_PATH}/tests/utils/utils.sh
+ for i in `find ${D}${PTEST_PATH} -perm /u+x -type f`; do
+ sed -e "s:\$TESTDIR.*/src/bin/lttng/\$LTTNG_BIN:\$LTTNG_BIN:g" \
+ -e "s:\$TESTDIR/../src/bin/lttng-sessiond/\$SESSIOND_BIN:\$SESSIOND_BIN:g" \
+ -e "s:\$DIR/../src/bin/lttng-sessiond/\$SESSIOND_BIN:\$SESSIOND_BIN:g" \
+ -e "s:\$TESTDIR/../src/bin/lttng-consumerd/:${libdir}/lttng/libexec/:g" \
+ -e "s:\$DIR/../src/bin/lttng-consumerd/:${libdir}/lttng/libexec/:g" \
+ -e "s:\$TESTDIR/../src/bin/lttng-relayd/\$RELAYD_BIN:\$RELAYD_BIN:g" \
+ -e "s:\$DIR/../src/bin/lttng-sessiond/lttng-sessiond:\$SESSIOND_BIN:g" \
+ -e "s:\$DIR/../src/bin/lttng-relayd/\$RELAYD_BIN:\$RELAYD_BIN:g" \
+ -e "s:\$DIR/../bin/lttng-relayd/\$RELAYD_BIN:\$RELAYD_BIN:g" \
+ -i $i
+ done
+
+ # Update libdir references in copied .la files
+ for i in `find ${D}${PTEST_PATH} -type f -name *.la`; do
+ sed -i -e 's#${S}/tests/#${STAGING_DIR}${PTEST_PATH}#g' $i
+ done
+
+ sed -e "s:src/bin:bin:g" -e "s:lt-::g" \
+ -i ${D}${PTEST_PATH}/tests/utils/utils.sh
+ sed -e "s:ini_config:\.libs\/ini_config:" \
+ -i ${D}${PTEST_PATH}/tests/unit/ini_config/test_ini_config
+}
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-add-support-for-aarch64_be.patch b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-add-support-for-aarch64_be.patch
new file mode 100644
index 000000000..9b37a4a33
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-add-support-for-aarch64_be.patch
@@ -0,0 +1,17 @@
+lttng-ust: add support for aarch64_be
+
+Upstream-Status: Pending
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+
+diff --ruN a/configure.ac b/configure.ac
+--- a/configure.ac 2016-02-18 14:54:54.651713647 +0100
++++ b/configure.ac 2016-02-18 14:56:11.057865297 +0100
+@@ -240,6 +240,7 @@
+ s390x) NO_UNALIGNED_ACCESS=1 ;;
+ arm*) NO_UNALIGNED_ACCESS=1 ;;
+ aarch64) NO_UNALIGNED_ACCESS=1 ;;
++ aarch64_be) NO_UNALIGNED_ACCESS=1 ;;
+ mips*) NO_UNALIGNED_ACCESS=1 ;;
+ tile*) NO_UNALIGNED_ACCESS=1 ;;
+ *)
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-doc-examples-disable.patch b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-doc-examples-disable.patch
new file mode 100644
index 000000000..b68a9899c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-doc-examples-disable.patch
@@ -0,0 +1,18 @@
+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: doc/Makefile.am
+===================================================================
+--- a/doc/Makefile.am
++++ b/doc/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . examples
++SUBDIRS = .
+
+ dist_man_MANS = man/lttng-gen-tp.1 \
+ man/lttng-ust.3 \
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-ust_git.bb b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-ust_git.bb
new file mode 100644
index 000000000..15d925d29
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/lttng/lttng-ust_git.bb
@@ -0,0 +1,34 @@
+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
+
+DEPENDS = "liburcu util-linux"
+RDEPENDS_${PN}-bin = "python-core"
+
+# For backwards compatibility after rename
+RPROVIDES_${PN} = "lttng2-ust"
+RREPLACES_${PN} = "lttng2-ust"
+RCONFLICTS_${PN} = "lttng2-ust"
+
+SRCREV = "f89c1a3cf2b06a4970b9154c00ff6409870aefb5"
+PE = "2"
+PV = "2.7.1+git${SRCPV}"
+
+SRC_URI = "git://git.lttng.org/lttng-ust.git;branch=stable-2.7 \
+ file://lttng-ust-doc-examples-disable.patch \
+ file://lttng-ust-add-support-for-aarch64_be.patch \
+ "
+
+S = "${WORKDIR}/git"
+
+do_configure_prepend () {
+ ( cd ${S}; ${S}/bootstrap )
+}
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/modutils-initscripts/files/PD.patch b/import-layers/yocto-poky/meta/recipes-kernel/modutils-initscripts/files/PD.patch
new file mode 100644
index 000000000..21ac49cbd
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-kernel/modutils-initscripts/files/modutils.sh b/import-layers/yocto-poky/meta/recipes-kernel/modutils-initscripts/files/modutils.sh
new file mode 100755
index 000000000..a78adf572
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-kernel/modutils-initscripts/modutils-initscripts.bb b/import-layers/yocto-poky/meta/recipes-kernel/modutils-initscripts/modutils-initscripts.bb
new file mode 100644
index 000000000..db670cfbb
--- /dev/null
+++ b/import-layers/yocto-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/
+}
+
+DEPENDS_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/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile.inc b/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile.inc
new file mode 100644
index 000000000..cf3ad435c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile.inc
@@ -0,0 +1,61 @@
+SUMMARY = "System-Wide Profiler"
+DESCRIPTION = "OProfile is a system-wide profiler for Linux systems, capable \
+of profiling all running code at low overhead."
+HOMEPAGE = "http://oprofile.sourceforge.net/news/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=16191&atid=116191"
+
+LICENSE = "LGPLv2.1+ & GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://libopagent/opagent.h;beginline=5;endline=26;md5=4f16f72c7a493d8a4704aa18d03d15c6 \
+ "
+SECTION = "devel"
+
+DEPENDS = "popt binutils"
+RDEPENDS_${PN} = "binutils-symlinks"
+RRECOMMENDS_${PN} = "kernel-vmlinux"
+
+FILES_${PN} = "${bindir} ${libdir}/${BPN}/lib*${SOLIBS} ${datadir}/${BPN}"
+FILES_${PN}-dev += "${libdir}/${BPN}/lib*${SOLIBSDEV} ${libdir}/${BPN}/lib*.la"
+FILES_${PN}-staticdev += "${libdir}/${BPN}/lib*.a"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \
+ file://acinclude.m4 \
+ file://automake-foreign.patch \
+ file://oprofile-cross-compile-tests.patch \
+ file://run-ptest \
+ file://root-home-dir.patch \
+ file://0001-Add-rmb-definition-for-NIOS2-architecture.patch"
+
+SRC_URI_append_libc-musl = " file://musl.patch"
+
+inherit autotools pkgconfig ptest
+
+EXTRA_OECONF = "--with-kernel=${STAGING_DIR_HOST}${prefix} --without-x ac_cv_prog_XSLTPROC="
+do_configure () {
+ cp ${WORKDIR}/acinclude.m4 ${S}/
+ autotools_do_configure
+}
+
+EXTRA_OEMAKE = "SRCDIR=${PTEST_PATH}/libutil++/tests"
+do_compile_ptest() {
+ oe_runmake check
+}
+
+do_install_ptest() {
+ subdirs="libdb/tests libutil++/tests libregex/tests libutil/tests libop/tests libdb/tests "
+ for tooltest in ${subdirs}
+ do
+ find ${tooltest} -perm /u=x -type f| cpio -pvdu ${D}${PTEST_PATH}
+ done
+
+ # needed by some libop tests
+ cp -r events ${D}${PTEST_PATH}
+
+ # needed by libregex regex_test
+ cp libregex/stl.pat ${D}${PTEST_PATH}/libregex
+ cp libregex/tests/mangled-name ${D}${PTEST_PATH}/libregex/tests
+
+ # needed by litutil++ file_manip_tests
+ cp ${S}/libutil++/tests/file_manip_tests.cpp \
+ libutil++/tests/file_manip_tests.o ${D}${PTEST_PATH}/libutil++/tests
+}
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile/0001-Add-rmb-definition-for-NIOS2-architecture.patch b/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile/0001-Add-rmb-definition-for-NIOS2-architecture.patch
new file mode 100644
index 000000000..ae8562a23
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile/0001-Add-rmb-definition-for-NIOS2-architecture.patch
@@ -0,0 +1,30 @@
+From 34b0d9b1a32fb404a30327a7ae8931c7c75583bf Mon Sep 17 00:00:00 2001
+From: Marek Vasut <marex@denx.de>
+Date: Tue, 9 Feb 2016 02:00:29 +0100
+Subject: [PATCH] Add rmb() definition for NIOS2 architecture
+
+Signed-off-by: Marek Vasut <marex@denx.de>
+Upstream-Status: Submitted [ http://marc.info/?l=oprofile-list&m=145501915931874&w=2 ]
+---
+ libperf_events/operf_utils.h | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/libperf_events/operf_utils.h b/libperf_events/operf_utils.h
+index 32954cc..8270e53 100644
+--- a/libperf_events/operf_utils.h
++++ b/libperf_events/operf_utils.h
+@@ -178,6 +178,11 @@ void op_release_resources(void);
+ #define cpu_relax() asm volatile("" ::: "memory")
+ #endif
+
++#ifdef __nios2__
++#define rmb() asm volatile("" ::: "memory")
++#define cpu_relax() asm volatile("" ::: "memory")
++#endif
++
+ #ifdef __tile__
+ #include <asm/unistd.h>
+ #define rmb() __insn_mf()
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile/acinclude.m4 b/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile/acinclude.m4
new file mode 100644
index 000000000..95ecd91b5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile/acinclude.m4
@@ -0,0 +1,581 @@
+dnl AX_KERNEL_OPTION(option, action-if-found, action-if-not-found)
+dnl see if autoconf.h defines the option
+AC_DEFUN([AX_KERNEL_OPTION], [
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-I$KINC -O2 -D__KERNEL__"
+AC_TRY_COMPILE( [#include <linux/config.h>],
+[
+#ifndef $1
+break_me_hard(\\\);
+#endif
+],[$2],[$3],)
+CFLAGS=$SAVE_CFLAGS
+])
+
+dnl Handle the 2.4 module inside module/
+AC_DEFUN([AX_CONFIG_MODULE],
+[
+if test ! -f $KINC/linux/autoconf.h; then
+ AC_MSG_ERROR([no suitably configured kernel include tree found])
+fi
+
+dnl --- Get Linux kernel version and compile parameters ---
+
+AC_SUBST(KVERS)
+AC_MSG_CHECKING([for kernel version])
+dnl it's like this to handle mandrake's fubar version.h - bug #471448
+eval KVERS=`gcc -I$KINC -E -dM $KINC/linux/version.h | grep -w UTS_RELEASE | awk '{print $[]3}'`
+AC_MSG_RESULT([$KVERS])
+case "$KVERS" in
+2.2.*|2.4.*) ;;
+*) AC_MSG_ERROR([Unsupported kernel version])
+esac
+
+dnl Check for the minimal kernel version supported
+AC_MSG_CHECKING([kernel version])
+AX_KERNEL_VERSION(2, 2, 10, <=, AC_MSG_RESULT([ok]), AC_MSG_ERROR([check html documentation install section]))
+
+dnl linux/spinlock.h added at some point in past
+AC_MSG_CHECKING([for $KINC/linux/spinlock.h])
+if test -f $KINC/linux/spinlock.h; then
+ EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DHAVE_LINUX_SPINLOCK_HEADER"
+ AC_MSG_RESULT([yes])
+else
+ AC_MSG_RESULT([no])
+fi
+
+AC_MSG_CHECKING([for rtc_lock])
+gcc -I$KINC -E $KINC/linux/mc146818rtc.h | grep rtc_lock >/dev/null
+if test "$?" -eq 0; then
+ EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DRTC_LOCK"
+ AC_MSG_RESULT([yes])
+else
+ AC_MSG_RESULT([no])
+fi
+
+arch="unknown"
+AC_MSG_CHECKING(for x86-64 architecture)
+AX_KERNEL_OPTION(CONFIG_X86_64, x8664=1, x8664=0)
+AX_MSG_RESULT_YN($x8664)
+BUILD_HAMMER=no
+if test "$x8664" -eq 1; then
+ arch="x86"
+ BUILD_HAMMER=yes
+else
+ AC_MSG_CHECKING(for x86 architecture)
+ AX_KERNEL_OPTION(CONFIG_X86, x86=1, x86=0)
+ AX_KERNEL_OPTION(CONFIG_X86_WP_WORKS_OK, x86=1, x86=$x86)
+ AX_MSG_RESULT_YN($x86)
+ test "$x86" = 1 && arch="x86"
+
+ if test "$arch" = "unknown"; then
+ AC_MSG_CHECKING(for ia64 architecture)
+ AX_KERNEL_OPTION(CONFIG_IA64, ia64=1, ia64=0)
+ AX_MSG_RESULT_YN($ia64)
+ test "$ia64" = 1 && arch="ia64"
+ fi
+
+fi
+AC_SUBST(BUILD_HAMMER)
+
+test "$arch" = "unknown" && AC_MSG_ERROR(Unsupported architecture)
+
+dnl check to see if kernel verion appropriate for arch
+AC_MSG_CHECKING(arch/kernel version combination)
+case "$arch" in
+ia64)
+ AX_KERNEL_VERSION(2, 4, 18, <, AC_MSG_RESULT([ok]),
+ AC_MSG_ERROR([unsupported arch/kernel])) ;;
+*) AC_MSG_RESULT([ok])
+esac
+
+dnl for now we do not support PREEMPT patch
+AC_MSG_CHECKING([for preempt patch])
+AX_KERNEL_OPTION(CONFIG_PREEMPT,preempt=1,preempt=0)
+AX_MSG_RESULT_YN([$preempt])
+test "$preempt" = 0 || AC_MSG_ERROR([unsupported kernel configuration : CONFIG_PREEMPT])
+
+AC_SUBST(KINC)
+
+MODINSTALLDIR=/lib/modules/$KVERS
+
+OPROFILE_MODULE_ARCH=$arch
+AC_SUBST(OPROFILE_MODULE_ARCH)
+]
+)
+
+dnl AX_MSG_RESULT_YN(a)
+dnl results "yes" iff a==1, "no" else
+AC_DEFUN([AX_MSG_RESULT_YN], [x=no
+test "x$1" = "x1" && x=yes
+AC_MSG_RESULT($x)])
+
+dnl AX_MALLOC_ATTRIBUTE - see if gcc will take __attribute__((malloc))
+AC_DEFUN([AX_MALLOC_ATTRIBUTE],
+[
+AC_MSG_CHECKING([whether malloc attribute is understood])
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-Werror $CFLAGS"
+AC_TRY_COMPILE(,[
+void monkey() __attribute__((malloc));
+],AC_MSG_RESULT([yes]); AC_DEFINE(MALLOC_ATTRIBUTE_OK, 1, [whether malloc attribute is understood]), AC_MSG_RESULT([no]))
+CFLAGS=$SAVE_CFLAGS
+]
+)
+
+dnl builtin_expect is used in module we can't add that in config.h
+AC_DEFUN([AX_BUILTIN_EXPECT],
+[
+AC_MSG_CHECKING([whether __builtin_expect is understood])
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-Werror $CFLAGS"
+AC_TRY_LINK(,[
+int i;
+if (__builtin_expect(i, 0)) { }
+],
+AC_MSG_RESULT([yes]); EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DEXPECT_OK",
+AC_MSG_RESULT([no]);)
+CFLAGS=$SAVE_CFLAGS
+]
+)
+
+dnl AX_EXTRA_DIRS - Let user specify extra dirs for include/libs
+AC_DEFUN([AX_EXTRA_DIRS],
+[
+AC_ARG_WITH(extra-includes,
+[ --with-extra-includes=DIR add extra include paths],
+ use_extra_includes="$withval",
+ use_extra_includes=NO
+)
+if test -n "$use_extra_includes" && \
+ test "$use_extra_includes" != "NO"; then
+ ac_save_ifs=$IFS
+ IFS=':'
+ for dir in $use_extra_includes; do
+ extra_includes="$extra_includes -I$dir"
+ done
+ IFS=$ac_save_ifs
+ CPPFLAGS="$CPPFLAGS $extra_includes"
+fi
+
+AC_ARG_WITH(extra-libs,
+[ --with-extra-libs=DIR add extra library paths],
+ use_extra_libs=$withval,
+ use_extra_libs=NO
+)
+if test -n "$use_extra_libs" && \
+ test "$use_extra_libs" != "NO"; then
+ ac_save_ifs=$IFS
+ IFS=':'
+ for dir in $use_extra_libs; do
+ extra_libraries="$extra_libraries -L$dir"
+ done
+ IFS=$ac_save_ifs
+ LDFLAGS="$LDFLAGS $extra_libraries"
+fi
+]
+)
+
+dnl AX_POPT_CONST - check popt prototype
+AC_DEFUN([AX_POPT_CONST],
+[
+AC_MSG_CHECKING([popt prototype])
+SAVE_CXXFLAGS=$CXXFLAGS
+CXXFLAGS="-Werror $CXXFLAGS"
+AC_TRY_COMPILE([#include <popt.h>],
+[
+int c; char **v;
+poptGetContext(0, c, v, 0, 0);
+],
+AC_MSG_RESULT([takes char **]);,
+AC_MSG_RESULT([takes const char **]); AC_DEFINE(CONST_POPT, 1, [whether popt prototype takes a const char **]))
+CXXFLAGS="$SAVE_CXXFLAGS"
+]
+)
+
+dnl AX_CHECK_SSTREAM - check if local sstream is needed to compile OK
+AC_DEFUN([AX_CHECK_SSTREAM],
+[
+AC_MSG_CHECKING([whether to use included sstream])
+AC_TRY_COMPILE([#include <sstream>], [],
+AC_MSG_RESULT([no]);,
+AC_MSG_RESULT([yes]); OP_CXXFLAGS="$OP_CXXFLAGS -I\${top_srcdir}/include")
+]
+)
+
+dnl AX_CHECK_TYPEDEF(typedef_name, type, action-if-true, action-if-false)
+dnl exec action-if-true if typedef_name is a typedef to type else exec
+dnl action-if-false
+dnl currently work only with type typedef'ed in stddef.h
+AC_DEFUN([AX_CHECK_TYPEDEF], [
+dnl AC_LANG_PUSH(C) not in autoconf 2.13
+AC_LANG_SAVE
+AC_LANG_C
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-Werror $CFLAGS"
+
+AC_TRY_COMPILE(
+ [
+ #include <stddef.h>
+ ],
+ [
+ typedef void (*fct1)($1);
+ typedef void (*fct2)($2);
+ fct1 f1 = 0;
+ fct2 f2 = 0;
+ if (f1 == f2) {}
+ ],
+[$3],[$4])
+
+CFLAGS=$SAVE_CFLAGS
+AC_LANG_RESTORE
+])
+
+
+dnl AX_TYPEDEFED_NAME(typedef_name, candidate_list, var_name)
+dnl set var_name to the typedef name of $1 which must be in canditate_list
+dnl else produce a fatal error
+AC_DEFUN([AX_TYPEDEFED_NAME], [
+ AC_MSG_CHECKING([type of $1])
+ for f in $2; do
+ AX_CHECK_TYPEDEF($1, $f, $3="$f", $3="")
+ if test -n "${$3}"; then
+ break
+ fi
+ done
+ if test -n "${$3}"; then
+ AC_MSG_RESULT([${$3}])
+ else
+ AC_MSG_ERROR([not found])
+ fi
+])
+
+dnl find a binary in the path
+AC_DEFUN([QT_FIND_PATH],
+[
+ AC_MSG_CHECKING([for $1])
+ AC_CACHE_VAL(qt_cv_path_$1,
+ [
+ qt_cv_path_$1="NONE"
+ if test -n "$$2"; then
+ qt_cv_path_$1="$$2";
+ else
+ dirs="$3"
+ qt_save_IFS=$IFS
+ IFS=':'
+ for dir in $PATH; do
+ dirs="$dirs $dir"
+ done
+ IFS=$qt_save_IFS
+
+ for dir in $dirs; do
+ if test -x "$dir/$1"; then
+ if test -n "$5"; then
+ evalstr="$dir/$1 $5 2>&1 "
+ if eval $evalstr; then
+ qt_cv_path_$1="$dir/$1"
+ break
+ fi
+ else
+ qt_cv_path_$1="$dir/$1"
+ break
+ fi
+ fi
+ done
+ fi
+ ])
+
+ if test -z "$qt_cv_path_$1" || test "$qt_cv_path_$1" = "NONE"; then
+ AC_MSG_RESULT(not found)
+ $4
+ else
+ AC_MSG_RESULT($qt_cv_path_$1)
+ $2=$qt_cv_path_$1
+ fi
+])
+
+dnl Find the uic compiler on the path or in qt_cv_dir
+AC_DEFUN([QT_FIND_UIC],
+[
+ QT_FIND_PATH(uic, ac_uic, $qt_cv_dir/bin)
+ if test -z "$ac_uic" -a "$FATAL" = 1; then
+ AC_MSG_ERROR([uic binary not found in \$PATH or $qt_cv_dir/bin !])
+ fi
+])
+
+dnl Find the right moc in path/qt_cv_dir
+AC_DEFUN([QT_FIND_MOC],
+[
+ QT_FIND_PATH(moc2, ac_moc2, $qt_cv_dir/bin)
+ QT_FIND_PATH(moc, ac_moc1, $qt_cv_dir/bin)
+
+ if test -n "$ac_moc1" -a -n "$ac_moc2"; then
+ dnl found both. Prefer Qt3's if it exists else moc2
+ $ac_moc1 -v 2>&1 | grep "Qt 3" >/dev/null
+ if test "$?" = 0; then
+ ac_moc=$ac_moc1;
+ else
+ ac_moc=$ac_moc2;
+ fi
+ else
+ if test -n "$ac_moc1"; then
+ ac_moc=$ac_moc1;
+ else
+ ac_moc=$ac_moc2;
+ fi
+ fi
+
+ if test -z "$ac_moc" -a "$FATAL" = 1; then
+ AC_MSG_ERROR([moc binary not found in \$PATH or $qt_cv_dir/bin !])
+ fi
+])
+
+dnl check a particular libname
+AC_DEFUN([QT_TRY_LINK],
+[
+ SAVE_LIBS="$LIBS"
+ LIBS="$LIBS $1"
+ AC_TRY_LINK([
+ #include <qglobal.h>
+ #include <qstring.h>
+ ],
+ [
+ QString s("mangle_failure");
+ #if (QT_VERSION < 221)
+ break_me_(\\\);
+ #endif
+ ],
+ qt_cv_libname=$1,
+ )
+ LIBS="$SAVE_LIBS"
+])
+
+dnl check we can do a compile
+AC_DEFUN([QT_CHECK_COMPILE],
+[
+ AC_MSG_CHECKING([for Qt library name])
+
+ AC_CACHE_VAL(qt_cv_libname,
+ [
+ AC_LANG_CPLUSPLUS
+ SAVE_CXXFLAGS=$CXXFLAGS
+ CXXFLAGS="$CXXFLAGS $QT_INCLUDES $QT_LDFLAGS"
+
+ for libname in -lqt-mt -lqt3 -lqt2 -lqt;
+ do
+ QT_TRY_LINK($libname)
+ if test -n "$qt_cv_libname"; then
+ break;
+ fi
+ done
+
+ CXXFLAGS=$SAVE_CXXFLAGS
+ ])
+
+ if test -z "$qt_cv_libname"; then
+ AC_MSG_RESULT([failed])
+ if test "$FATAL" = 1 ; then
+ AC_MSG_ERROR([Cannot compile a simple Qt executable. Check you have the right \$QTDIR !])
+ fi
+ else
+ AC_MSG_RESULT([$qt_cv_libname])
+ fi
+])
+
+dnl get Qt version we're using
+AC_DEFUN([QT_GET_VERSION],
+[
+ AC_CACHE_CHECK([Qt version],lyx_cv_qtversion,
+ [
+ AC_LANG_CPLUSPLUS
+ SAVE_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $QT_INCLUDES"
+
+ cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+#include <qglobal.h>
+"%%%"QT_VERSION_STR"%%%"
+EOF
+ lyx_cv_qtversion=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | \
+ grep '^"%%%"' 2>/dev/null | \
+ sed -e 's/"%%%"//g' -e 's/"//g'`
+ rm -f conftest.$ac_ext
+ CPPFLAGS=$SAVE_CPPFLAGS
+ ])
+
+ QT_VERSION=$lyx_cv_qtversion
+ AC_SUBST(QT_VERSION)
+])
+
+dnl start here
+AC_DEFUN([QT_DO_IT_ALL],
+[
+ dnl Please leave this alone. I use this file in
+ dnl oprofile.
+ FATAL=0
+
+ AC_ARG_WITH(qt-dir, [ --with-qt-dir where the root of Qt is installed ],
+ [ qt_cv_dir=`eval echo "$withval"/` ])
+
+ AC_ARG_WITH(qt-includes, [ --with-qt-includes where the Qt includes are. ],
+ [ qt_cv_includes=`eval echo "$withval"` ])
+
+ AC_ARG_WITH(qt-libraries, [ --with-qt-libraries where the Qt library is installed.],
+ [ qt_cv_libraries=`eval echo "$withval"` ])
+
+ dnl pay attention to $QTDIR unless overridden
+ if test -z "$qt_cv_dir"; then
+ qt_cv_dir=$QTDIR
+ fi
+
+ dnl derive inc/lib if needed
+ if test -n "$qt_cv_dir"; then
+ if test -z "$qt_cv_includes"; then
+ qt_cv_includes=$qt_cv_dir/include
+ fi
+ if test -z "$qt_cv_libraries"; then
+ qt_cv_libraries=$qt_cv_dir/lib
+ fi
+ fi
+
+ dnl flags for compilation
+ QT_INCLUDES=
+ QT_LDFLAGS=
+ if test -n "$qt_cv_includes"; then
+ QT_INCLUDES="-I$qt_cv_includes"
+ fi
+ if test -n "$qt_cv_libraries"; then
+ QT_LDFLAGS="-L$qt_cv_libraries"
+ fi
+ AC_SUBST(QT_INCLUDES)
+ AC_SUBST(QT_LDFLAGS)
+
+ QT_FIND_MOC
+ MOC=$ac_moc
+ AC_SUBST(MOC)
+ QT_FIND_UIC
+ UIC=$ac_uic
+ AC_SUBST(UIC)
+
+ QT_CHECK_COMPILE
+
+ QT_LIB=$qt_cv_libname;
+ AC_SUBST(QT_LIB)
+
+ if test -n "$qt_cv_libname"; then
+ QT_GET_VERSION
+ fi
+])
+
+dnl AX_CXXFLAGS_OPTIONS(var-name, option)
+dnl add option to var-name if $CXX support it.
+AC_DEFUN([AX_CHECK_PRECOMPILED_HEADER], [
+AC_MSG_CHECKING([whether ${CXX} support precompiled header])
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+SAVE_CXXFLAGS=$CXXFLAGS
+dnl we consider than if -Winvalid-pch is accepted pch will works ...
+CXXFLAGS=-Winvalid-pch
+dnl but we don't want -Winvalid-pch else compilation will fail due -Werror and
+dnl the fact than some pch will be invalid for the given compilation option
+AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); $1="${$1} -include bits/stdc++.h", AC_MSG_RESULT([no]))
+CXXFLAGS=$SAVE_CXXFLAGS
+AC_LANG_RESTORE
+])
+
+dnl AX_CHECK_DOCBOOK
+AC_DEFUN([AX_CHECK_DOCBOOK], [
+# It's just rude to go over the net to build
+XSLTPROC_FLAGS=--nonet
+DOCBOOK_ROOT=
+if test ! -f /etc/xml/catalog; then
+ for i in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh /usr/share/sgml/docbook/xsl-stylesheets/;
+ do
+ if test -d "$i"; then
+ DOCBOOK_ROOT=$i
+ fi
+ done
+
+ # Last resort - try net
+ if test -z "$DOCBOOK_ROOT"; then
+ XSLTPROC_FLAGS=
+ fi
+else
+ XML_CATALOG=/etc/xml/catalog
+ CAT_ENTRY_START='<!--'
+ CAT_ENTRY_END='-->'
+fi
+
+AC_CHECK_PROG(XSLTPROC,xsltproc,xsltproc,)
+XSLTPROC_WORKS=no
+if test -n "$XSLTPROC"; then
+ AC_MSG_CHECKING([whether xsltproc works])
+
+ if test -n "$XML_CATALOG"; then
+ DB_FILE="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"
+ else
+ DB_FILE="$DOCBOOK_ROOT/docbook.xsl"
+ fi
+
+ $XSLTPROC $XSLTPROC_FLAGS $DB_FILE >/dev/null 2>&1 << END
+<?xml version="1.0" encoding='ISO-8859-1'?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+<book id="test">
+</book>
+END
+ if test "$?" = 0; then
+ XSLTPROC_WORKS=yes
+ fi
+ AC_MSG_RESULT($XSLTPROC_WORKS)
+fi
+AM_CONDITIONAL(have_xsltproc, test "$XSLTPROC_WORKS" = "yes")
+
+AC_SUBST(XML_CATALOG)
+AC_SUBST(XSLTPROC_FLAGS)
+AC_SUBST(DOCBOOK_ROOT)
+AC_SUBST(CAT_ENTRY_START)
+AC_SUBST(CAT_ENTRY_END)
+])
+
+dnl AX_CFLAGS_OPTIONS(var-name, option)
+dnl add option to var-name if $CC support it.
+AC_DEFUN([AX_CFLAGS_OPTION], [
+AC_MSG_CHECKING([whether ${CC} $2 is understood])
+AC_LANG_SAVE
+AC_LANG_C
+SAVE_CFLAGS=$CFLAGS
+CFLAGS=$2
+AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); $1="${$1} $2",AC_MSG_RESULT([no]))
+CFLAGS=$SAVE_CFLAGS
+AC_LANG_RESTORE
+])
+
+
+dnl AX_CXXFLAGS_OPTIONS(var-name, option)
+dnl add option to var-name if $CXX support it.
+AC_DEFUN([AX_CXXFLAGS_OPTION], [
+AC_MSG_CHECKING([whether ${CXX} $2 is understood])
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+SAVE_CXXFLAGS=$CXXFLAGS
+CXXFLAGS=$2
+AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); $1="${$1} $2",AC_MSG_RESULT([no]))
+CXXFLAGS=$SAVE_CXXFLAGS
+AC_LANG_RESTORE
+])
+
+dnl AX_COPY_IF_CHANGE(source, dest)
+dnl copy source to dest if they don't compare equally or if dest doesn't exist
+AC_DEFUN([AX_COPY_IF_CHANGE], [
+if test -r $2; then
+ if cmp $1 $2 > /dev/null; then
+ echo $2 is unchanged
+ else
+ cp -f $1 $2
+ fi
+else
+ cp -f $1 $2
+fi
+])
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile/automake-foreign.patch b/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile/automake-foreign.patch
new file mode 100644
index 000000000..b9bb6c577
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile/automake-foreign.patch
@@ -0,0 +1,12 @@
+oprofile doesn't want GNU-levels of automake strictness so tell it to be "foreign".
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/configure.ac b/configure.ac
+index 5740585..cf6c316 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -16 +16 @@ AC_CONFIG_SRCDIR([libop/op_config.h])
+-AM_INIT_AUTOMAKE
++AM_INIT_AUTOMAKE([foreign])
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile/musl.patch b/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile/musl.patch
new file mode 100644
index 000000000..51db40845
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile/musl.patch
@@ -0,0 +1,46 @@
+Fix glibc-isms so that oprofile builds with musl.
+
+Patch taken from openwrt (https://github.com/openwrt-mirror/openwrt/blob/master/package/devel/oprofile/patches/100-musl.patch)
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+--- a/pe_profiling/operf.cpp
++++ b/pe_profiling/operf.cpp
+@@ -857,11 +857,14 @@ static int __delete_old_previous_sample_
+ int tflag __attribute__((unused)),
+ struct FTW *ftwbuf __attribute__((unused)))
+ {
++ int err;
++
+ if (remove(fpath)) {
++ err = errno;
+ perror("sample data removal error");
+- return FTW_STOP;
++ return err;
+ } else {
+- return FTW_CONTINUE;
++ return 0;
+ }
+ }
+
+@@ -896,7 +899,7 @@ static void convert_sample_data(void)
+ return;
+
+ if (!operf_options::append) {
+- int flags = FTW_DEPTH | FTW_ACTIONRETVAL;
++ int flags = FTW_DEPTH;
+ errno = 0;
+ if (nftw(previous_sampledir.c_str(), __delete_old_previous_sample_data, 32, flags) !=0 &&
+ errno != ENOENT) {
+--- a/libop/op_events.c
++++ b/libop/op_events.c
+@@ -83,7 +83,7 @@ static int parse_hex(char const * str)
+ static u64 parse_long_hex(char const * str)
+ {
+ u64 value;
+- if (sscanf(str, "%Lx", &value) != 1)
++ if (sscanf(str, "0x%llx", &value) != 1)
+ parse_error("expected long hexadecimal value");
+
+ fflush(stderr);
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile/oprofile-cross-compile-tests.patch b/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile/oprofile-cross-compile-tests.patch
new file mode 100644
index 000000000..aefa9548e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile/oprofile-cross-compile-tests.patch
@@ -0,0 +1,98 @@
+Prevent running check tests on host if cross compiling
+
+This patch enables running the 'make check' tests on the target
+in a cross-compiled environment. If not cross-compiling, then 'make
+ check' builds and executes the tests; no change from this patch.
+In a cross-compiling environment, the make variable CROSS_COMPILE is
+set which bypasses assiging tests to the makekfile variable TESTS.
+Since TESTS is empty, the 'make check' process never tries to run the
+tests on the hosts. On the target, the tests must be run manually.
+
+Also, in the libutil++ tests, a makefile variable SRCDIR is passed into
+the compilation phase, pointing to the runtime location of the test
+'file-manip-tests'. The mechanism used for a host test, based on
+'topdir' doesn't work. Instead, if CROSS_COMPILE is set, the
+makefile takes the path of SRCDIR from the build environment and not
+from an expression based on the host path 'topdir'.
+
+Upstream-Status: Pending
+
+Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
+
+diff --git a/configure.ac b/configure.ac
+index 41ece64..ce5a16f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -392,6 +392,7 @@ AC_ARG_ENABLE(account-check,
+ enable_account_check=$enableval, enable_account_check=yes)
+
+ AM_CONDITIONAL(CHECK_ACCOUNT, test "x$enable_account_check" = "xyes")
++AM_CONDITIONAL(CROSS_COMPILE, test "x$cross_compiling" = "xyes")
+
+ AC_SUBST(OP_CFLAGS)
+ AC_SUBST(OP_CXXFLAGS)
+diff --git a/libdb/tests/Makefile.am b/libdb/tests/Makefile.am
+index 8a69003..d820090 100644
+--- a/libdb/tests/Makefile.am
++++ b/libdb/tests/Makefile.am
+@@ -13,4 +13,6 @@ check_PROGRAMS = db_test
+ db_test_SOURCES = db_test.c
+ db_test_LDADD = ../libodb.a ../../libutil/libutil.a
+
++if ! CROSS_COMPILE
+ TESTS = ${check_PROGRAMS}
++endif
+diff --git a/libop/tests/Makefile.am b/libop/tests/Makefile.am
+index 8a79eb5..6d417c4 100644
+--- a/libop/tests/Makefile.am
++++ b/libop/tests/Makefile.am
+@@ -33,4 +33,6 @@ load_events_files_tests_LDADD = ${COMMON_LIBS}
+ mangle_tests_SOURCES = mangle_tests.c
+ mangle_tests_LDADD = ${COMMON_LIBS}
+
++if ! CROSS_COMPILE
+ TESTS = ${check_PROGRAMS} utf8_checker.sh
++endif
+diff --git a/libregex/tests/Makefile.am b/libregex/tests/Makefile.am
+index 6f19838..1d176f9 100644
+--- a/libregex/tests/Makefile.am
++++ b/libregex/tests/Makefile.am
+@@ -18,4 +18,6 @@ java_test_LDADD = \
+
+ EXTRA_DIST = mangled-name.in
+
++if ! CROSS_COMPILE
+ TESTS = ${check_PROGRAMS}
++endif
+diff --git a/libutil++/tests/Makefile.am b/libutil++/tests/Makefile.am
+index 51af031..a01ea2d 100644
+--- a/libutil++/tests/Makefile.am
++++ b/libutil++/tests/Makefile.am
+@@ -1,7 +1,9 @@
+
+ REALPATH= readlink -f
+
++if ! CROSS_COMPILE
+ SRCDIR := $(shell $(REALPATH) $(topdir)/libutil++/tests/ )
++endif
+
+ AM_CPPFLAGS = \
+ -I ${top_srcdir}/libutil++ -D SRCDIR="\"$(SRCDIR)/\"" @OP_CPPFLAGS@
+@@ -46,4 +48,6 @@ cached_value_tests_LDADD = ${COMMON_LIBS}
+ utility_tests_SOURCES = utility_tests.cpp
+ utility_tests_LDADD = ${COMMON_LIBS}
+
++if ! CROSS_COMPILE
+ TESTS = ${check_PROGRAMS}
++endif
+diff --git a/libutil/tests/Makefile.am b/libutil/tests/Makefile.am
+index dfcd6ec..e8831b5 100644
+--- a/libutil/tests/Makefile.am
++++ b/libutil/tests/Makefile.am
+@@ -12,4 +12,6 @@ file_tests_LDADD = ../libutil.a
+ string_tests_SOURCES = string_tests.c
+ string_tests_LDADD = ../libutil.a
+
++if ! CROSS_COMPILE
+ TESTS = ${check_PROGRAMS}
++endif
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile/root-home-dir.patch b/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile/root-home-dir.patch
new file mode 100644
index 000000000..3eaf6a794
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile/root-home-dir.patch
@@ -0,0 +1,44 @@
+oprofile: Determine the root home directory dynamically
+
+This commit detects the root home directory dynamically with changes to
+the oprofile gui app source.
+
+The commit replaces an earlier fix that detected and adjusted a
+'non-standard' root home directory at build time. The advantage of this
+patch is that the oprofile tools are adjusted to the current run-time
+path to ~root, not the build time path.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
+
+Index: oprofile-1.0.0/doc/oprofile.html
+===================================================================
+--- oprofile-1.0.0.orig/doc/oprofile.html 2014-11-03 17:55:31.511034857 +0000
++++ oprofile-1.0.0/doc/oprofile.html 2014-11-03 17:57:26.415037988 +0000
+@@ -1563,8 +1563,8 @@
+ <span class="emphasis"><em>must</em></span> stop it in a controlled manner in order to process
+ the profile data it has collected. Use <code class="code">kill -SIGINT &lt;operf-PID&gt;</code>
+ for this purpose. It is recommended that when running <span class="command"><strong>operf</strong></span>
+- with this option, your current working directory should be <code class="filename">/root</code> or a subdirectory
+- of <code class="filename">/root</code> to avoid storing sample data files in locations accessible by regular users.
++ with this option, your current working directory should be <code class="filename">~root</code> or a subdirectory
++ of <code class="filename">~root</code> to avoid storing sample data files in locations accessible by regular users.
+ </p>
+ </dd>
+ <dt>
+Index: oprofile-1.0.0/doc/oprofile.xml
+===================================================================
+--- oprofile-1.0.0.orig/doc/oprofile.xml 2014-11-03 17:55:31.515034857 +0000
++++ oprofile-1.0.0/doc/oprofile.xml 2014-11-03 17:58:03.719039005 +0000
+@@ -654,8 +654,8 @@
+ <emphasis>must</emphasis> stop it in a controlled manner in order to process
+ the profile data it has collected. Use <code>kill -SIGINT &lt;operf-PID&gt;</code>
+ for this purpose. It is recommended that when running <command>operf</command>
+- with this option, your current working directory should be <filename>/root</filename> or a subdirectory
+- of <filename>/root</filename> to avoid storing sample data files in locations accessible by regular users.
++ with this option, your current working directory should be <filename>~root</filename> or a subdirectory
++ of <filename>~root</filename> to avoid storing sample data files in locations accessible by regular users.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile/run-ptest b/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile/run-ptest
new file mode 100644
index 000000000..4814be652
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile/run-ptest
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+saved_dir=$PWD
+for dir in */tests ; do
+ cd $dir
+ for atest in * ; do
+ if [ \( -x $atest \) -a \( -f $atest \) ] ; then
+ ./$atest > ${atest}.stdout 2> ${atest}.stderr
+ if [ $? = 0 ] ; then
+ echo "PASS: $dir $atest"
+ rm ${atest}.stdout ${atest}.stderr
+ else
+ echo "FAIL: ${dir}/${atest}"
+ fi
+ fi
+ done
+ cd $saved_dir
+done
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile_1.1.0.bb b/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile_1.1.0.bb
new file mode 100644
index 000000000..92a94ad0d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofile_1.1.0.bb
@@ -0,0 +1,10 @@
+require oprofile.inc
+
+DEPENDS += "virtual/kernel"
+DEPENDS_append_powerpc64 = " libpfm4"
+
+SRC_URI[md5sum] = "248c4c069f9476f427fa7195563f9867"
+SRC_URI[sha256sum] = "cf759a6de1a6033d5dfc93bda129a9f2e128aecc4238cc657feb0801d1b0366c"
+
+S = "${WORKDIR}/oprofile-${PV}"
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofileui-server/init b/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofileui-server/init
new file mode 100755
index 000000000..2544ea4ac
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofileui-server/init
@@ -0,0 +1,37 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: oprofile-server
+# Required-Start: $network
+# Required-Stop: $network
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: OProfileUI server
+# Description:
+### END INIT INFO
+
+. /etc/init.d/functions
+
+case "$1" in
+ start)
+ echo "Starting OProfileUI server"
+ . /etc/profile
+ /usr/bin/oprofile-server &
+ ;;
+
+ stop)
+ echo "Stopping OProfileUI server"
+ killproc oprofile-server
+ ;;
+
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+
+ *)
+ echo "usage: $0 { start | stop | restart }"
+ ;;
+esac
+
+exit 0
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofileui-server/oprofileui-server.service b/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofileui-server/oprofileui-server.service
new file mode 100644
index 000000000..1a2cbe62e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofileui-server/oprofileui-server.service
@@ -0,0 +1,6 @@
+[Unit]
+Description=OProfileUI Server
+After=network.target
+
+[Service]
+ExecStart=/bin/sh -c ". @SYSCONFDIR@/profile; @BINDIR@/oprofile-server"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofileui-server_git.bb b/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofileui-server_git.bb
new file mode 100644
index 000000000..cc3477bc7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofileui-server_git.bb
@@ -0,0 +1,34 @@
+require oprofileui.inc
+
+SRCREV = "389e1875af4721d52c7e65cf9cfffb69b0ed6a59"
+PV = "0.0+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+SRC_URI = "git://git.yoctoproject.org/oprofileui \
+ file://init \
+ file://oprofileui-server.service "
+
+DEPENDS += "intltool-native gettext-native"
+
+EXTRA_OECONF += "--disable-client --enable-server"
+
+RDEPENDS_${PN} = "oprofile avahi-daemon"
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/oprofileui-server
+
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/oprofileui-server.service ${D}${systemd_unitdir}/system/
+ sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \
+ -e 's,@BINDIR@,${bindir},g' ${D}${systemd_unitdir}/system/oprofileui-server.service
+}
+
+inherit update-rc.d systemd
+
+INITSCRIPT_NAME = "oprofileui-server"
+INITSCRIPT_PARAMS = "start 99 5 2 . stop 20 0 1 6 ."
+
+SYSTEMD_SERVICE_${PN} = "oprofileui-server.service"
+SYSTEMD_AUTO_ENABLE = "disable"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofileui.inc b/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofileui.inc
new file mode 100644
index 000000000..8fcf014a9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofileui.inc
@@ -0,0 +1,16 @@
+SUMMARY = "User Interface for the System-Wide Profiler"
+DESCRIPTION = "User interface for the OProfile tool"
+HOMEPAGE = "http://labs.o-hand.com/oprofileui/"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+SECTION = "x11"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+DEPENDS = "glib-2.0 avahi intltool-native"
+
+inherit autotools pkgconfig gettext
+
+EXTRA_OECONF = "--with-avahi"
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofileui_git.bb b/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofileui_git.bb
new file mode 100644
index 000000000..86f3d8e50
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/oprofile/oprofileui_git.bb
@@ -0,0 +1,20 @@
+require oprofileui.inc
+
+DEPENDS += "gtk+ libglade libxml2 avahi-ui gconf gettext-native"
+
+inherit distro_features_check
+ANY_OF_DISTRO_FEATURES = "${GTK2DISTROFEATURES}"
+
+SRCREV = "389e1875af4721d52c7e65cf9cfffb69b0ed6a59"
+PV = "0.0+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+SRC_URI = "git://git.yoctoproject.org/oprofileui"
+
+EXTRA_OECONF += "--enable-client --disable-server"
+
+PACKAGES =+ "oprofileui-viewer"
+
+FILES_oprofileui-viewer = "${bindir}/oparchconv ${bindir}/oprofile-viewer ${datadir}/applications/ ${datadir}/oprofileui/ ${datadir}/icons"
+RDEPENDS_oprofileui-viewer = "oprofile"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/perf/perf-features.inc b/import-layers/yocto-poky/meta/recipes-kernel/perf/perf-features.inc
new file mode 100644
index 000000000..b8859ab7d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/perf/perf-features.inc
@@ -0,0 +1,22 @@
+PERF_FEATURES_ENABLE ?= "perf-scripting perf-tui"
+
+def perf_feature_enabled(feature, trueval, falseval, d):
+ """
+ Check which perf features are enabled.
+
+ The PERF_FEATURES_ENABLE variable lists the perf features to
+ enable. Override it if you want something different from what's
+ listed above, which is the default. If empty, the build won't
+ enable any features (which may be exactly what you want, just a
+ barebones perf without any extra baggage, what you get if you
+ specify an empty feature list).
+
+ Available perf features:
+ perf-scripting: enable support for Perl and Python bindings
+ perf-tui: enable support for the perf TUI (via libnewt)
+
+ """
+ enabled_features = d.getVar("PERF_FEATURES_ENABLE", True) or ""
+ if feature in enabled_features:
+ return trueval
+ return falseval
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/perf/perf.bb b/import-layers/yocto-poky/meta/recipes-kernel/perf/perf.bb
new file mode 100644
index 000000000..3d6ffb30f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/perf/perf.bb
@@ -0,0 +1,220 @@
+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."
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
+
+PR = "r9"
+
+require perf-features.inc
+
+BUILDPERF_libc-uclibc = "no"
+
+# 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
+TUI_DEPENDS = "${@perf_feature_enabled('perf-tui', 'libnewt slang', '',d)}"
+SCRIPTING_DEPENDS = "${@perf_feature_enabled('perf-scripting', 'perl python', '',d)}"
+LIBUNWIND_DEPENDS = "${@perf_feature_enabled('perf-libunwind', 'libunwind', '',d)}"
+
+DEPENDS = " \
+ virtual/${MLPREFIX}libc \
+ ${MLPREFIX}elfutils \
+ ${MLPREFIX}binutils \
+ ${TUI_DEPENDS} \
+ ${SCRIPTING_DEPENDS} \
+ ${LIBUNWIND_DEPENDS} \
+ bison flex xz \
+"
+
+do_configure[depends] += "virtual/kernel:do_shared_workdir"
+
+PROVIDES = "virtual/perf"
+
+inherit linux-kernel-base kernel-arch pythonnative
+
+# needed for building the tools/perf Python bindings
+inherit python-dir
+export STAGING_INCDIR
+export STAGING_LIBDIR
+export BUILD_SYS
+export HOST_SYS
+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 perlnative 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
+
+B = "${WORKDIR}/${BPN}-${PV}"
+SPDX_S = "${S}/tools/perf"
+
+SCRIPTING_DEFINES = "${@perf_feature_enabled('perf-scripting', '', 'NO_LIBPERL=1 NO_LIBPYTHON=1',d)}"
+TUI_DEFINES = "${@perf_feature_enabled('perf-tui', '', 'NO_NEWT=1',d)}"
+LIBUNWIND_DEFINES = "${@perf_feature_enabled('perf-libunwind', '', 'NO_LIBUNWIND=1 NO_LIBDW_DWARF_UNWIND=1',d)}"
+LIBNUMA_DEFINES = "${@perf_feature_enabled('perf-libnuma', '', 'NO_LIBNUMA=1',d)}"
+
+# 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}" \
+ EXTRA_CFLAGS="-ldw" \
+ perfexecdir=${libexecdir} \
+ NO_GTK2=1 ${TUI_DEFINES} NO_DWARF=1 ${LIBUNWIND_DEFINES} \
+ ${SCRIPTING_DEFINES} ${LIBNUMA_DEFINES} \
+'
+
+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)}' \
+"
+
+
+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 [ "${@perf_feature_enabled('perf-scripting', 1, 0, d)}" = "1" ] && grep -q install-python_ext ${S}/tools/perf/Makefile*; then
+ oe_runmake DESTDIR=${D} install-python_ext
+ fi
+}
+
+do_configure_prepend () {
+ # Fix for rebuilding
+ rm -rf ${B}/
+ mkdir -p ${B}/
+
+ # 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
+ # 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' \
+ ${S}/tools/perf/config/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
+ 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
+ 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", True).split("-")[0])
+}
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+
+PACKAGES =+ "${PN}-archive ${PN}-tests ${PN}-perl ${PN}-python"
+
+RDEPENDS_${PN} += "elfutils bash"
+RDEPENDS_${PN}-archive =+ "bash"
+RDEPENDS_${PN}-python =+ "bash python python-modules"
+RDEPENDS_${PN}-perl =+ "bash perl perl-modules"
+RDEPENDS_${PN}-tests =+ "python"
+
+RSUGGESTS_SCRIPTING = "${@perf_feature_enabled('perf-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 = "${libdir}/python*/site-packages ${libdir}/perf/perf-core/scripts/python"
+FILES_${PN}-python += "${libexecdir}/perf-core/scripts/python/*"
+FILES_${PN}-perl = "${libdir}/perf/perf-core/scripts/perl"
+
+
+INHIBIT_PACKAGE_DEBUG_SPLIT="1"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/powertop/powertop/0001-include-rquired-headers-for-typedefs.patch b/import-layers/yocto-poky/meta/recipes-kernel/powertop/powertop/0001-include-rquired-headers-for-typedefs.patch
new file mode 100644
index 000000000..0fd63106d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/powertop/powertop/0001-include-rquired-headers-for-typedefs.patch
@@ -0,0 +1,47 @@
+From 0856d8145d187a7e5a49625247abe43a13f95acc Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 15 Sep 2015 19:36:28 +0000
+Subject: [PATCH] include rquired headers for typedefs
+
+timeval struct needs to include sys/time.h and sprintf() usage requires
+to include stdio.h headers from system
+
+Fixes
+src/perf/perf_bundle.cpp:141:2: error: use of undeclared identifier 'sprintf'; did you mean 'vswprintf'?
+src/devices/devfreq.h:35:18: error: field has incomplete type 'struct timeval'
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/devices/devfreq.h | 1 +
+ src/perf/perf_bundle.cpp | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/src/devices/devfreq.h b/src/devices/devfreq.h
+index 16a60fb..4bede7c 100644
+--- a/src/devices/devfreq.h
++++ b/src/devices/devfreq.h
+@@ -25,6 +25,7 @@
+ #ifndef _INCLUDE_GUARD_DEVFREQ_H
+ #define _INCLUDE_GUARD_DEVFREQ_H
+
++#include <sys/time.h>
+ #include "device.h"
+ #include "../parameters/parameters.h"
+
+diff --git a/src/perf/perf_bundle.cpp b/src/perf/perf_bundle.cpp
+index cf1ae11..232f894 100644
+--- a/src/perf/perf_bundle.cpp
++++ b/src/perf/perf_bundle.cpp
+@@ -27,6 +27,7 @@
+ #include <algorithm>
+ #include <string.h>
+ #include <stdint.h>
++#include <stdio.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+--
+2.5.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/powertop/powertop_2.8.bb b/import-layers/yocto-poky/meta/recipes-kernel/powertop/powertop_2.8.bb
new file mode 100644
index 000000000..1f2dfb83d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/powertop/powertop_2.8.bb
@@ -0,0 +1,36 @@
+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-${PV}.tar.gz \
+ file://0001-include-rquired-headers-for-typedefs.patch \
+"
+
+SRC_URI[md5sum] = "c55fedb69203e480801b18bd7b886241"
+SRC_URI[sha256sum] = "a87b563f73106babfa3e74dcf92f252938c061e309ace20a361358bbfa579c5a"
+
+UPSTREAM_CHECK_URI = "https://01.org/powertop/downloads"
+
+inherit autotools gettext pkgconfig
+
+# we need to explicitly link with libintl in uClibc systems
+EXTRA_LDFLAGS ?= ""
+EXTRA_LDFLAGS_libc-uclibc = "-lintl"
+LDFLAGS += "${EXTRA_LDFLAGS}"
+
+# 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/import-layers/yocto-poky/meta/recipes-kernel/sysprof/files/define-NT_GNU_BUILD_ID.patch b/import-layers/yocto-poky/meta/recipes-kernel/sysprof/files/define-NT_GNU_BUILD_ID.patch
new file mode 100644
index 000000000..dcc2cbe67
--- /dev/null
+++ b/import-layers/yocto-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/elfparser.h 2011-07-16 18:57:41.000000000 -0700
++++ git/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/import-layers/yocto-poky/meta/recipes-kernel/sysprof/files/gui-argument.patch b/import-layers/yocto-poky/meta/recipes-kernel/sysprof/files/gui-argument.patch
new file mode 100644
index 000000000..d2c053e68
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/sysprof/files/gui-argument.patch
@@ -0,0 +1,35 @@
+Add the ability to explicitly enable/disable GUI support
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+Upstream-Status: Pending
+
+--- git.orig/configure.ac
++++ git/configure.ac
+@@ -62,12 +62,24 @@ KMICRO=`uname -r | cut -d"." -f 3 | cut
+ # Pkgconfig dependencies
+
+ core_dep="glib-2.0 >= 2.6.0"
+-gui_dep="gtk+-2.0 > 2.6.0 gdk-pixbuf-2.0 pangoft2 libglade-2.0"
+
+ PKG_CHECK_MODULES(CORE_DEP, $core_dep, [], AC_MSG_ERROR([sysprof dependencies not satisfied]))
+
+-build_gui=yes
+-PKG_CHECK_MODULES(GUI_DEP, $gui_dep, [], build_gui=no)
++gui_dep="gtk+-2.0 > 2.6.0 gdk-pixbuf-2.0 pangoft2 libglade-2.0"
++
++AC_ARG_ENABLE([gui],
++ [AS_HELP_STRING([--disable-gui],
++ [Disable GUI functionality (requires gtk+, gdk-pixbuf, pangoft2, libglade) @<:@default=auto@:>@])],
++ [],
++ [enable_gui=auto])
++
++build_gui=no
++AS_IF([test "x$enable_gui" != xno],
++ [PKG_CHECK_MODULES(GUI_DEP, $gui_dep, build_gui=yes,
++ [if test "x$enable_gui" != xauto; then
++ AC_MSG_FAILURE(
++ [--enable-gui was given, but gui dependencies were not satisfied])
++ fi])])
+
+ AM_CONDITIONAL([BUILD_GUI], [test "$build_gui" = yes])
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/sysprof/files/rmb-arm.patch b/import-layers/yocto-poky/meta/recipes-kernel/sysprof/files/rmb-arm.patch
new file mode 100644
index 000000000..c53ac6427
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/sysprof/files/rmb-arm.patch
@@ -0,0 +1,21 @@
+
+Upstream-Status: Pending
+
+Index: git/util.h
+===================================================================
+--- git.orig/util.h 2010-12-07 22:41:57.156243001 -0600
++++ git/util.h 2010-12-07 22:43:47.616243002 -0600
+@@ -37,4 +37,13 @@
+ #define cpu_relax() asm volatile("" ::: "memory");
+ #endif
+
++#ifdef __arm__
++/*
++ * Use the __kuser_memory_barrier helper in the CPU helper page. See
++ * arch/arm/kernel/entry-armv.S in the kernel source for details.
++ */
++#define rmb() ((void(*)(void))0xffff0fa0)()
++#define cpu_relax() asm volatile("":::"memory")
++#endif
++
+ #endif
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/sysprof/files/rmb-mips.patch b/import-layers/yocto-poky/meta/recipes-kernel/sysprof/files/rmb-mips.patch
new file mode 100644
index 000000000..e055b8ad8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/sysprof/files/rmb-mips.patch
@@ -0,0 +1,22 @@
+Upstream-Status: Pending
+
+Index: git/util.h
+===================================================================
+--- git.orig/util.h 2010-12-08 01:22:44.486243001 -0600
++++ git/util.h 2010-12-08 01:23:27.836243001 -0600
+@@ -37,4 +37,15 @@
+ #define cpu_relax() asm volatile("" ::: "memory");
+ #endif
+
++#ifdef __mips__
++#define rmb() asm volatile( \
++ ".set mips2\n\t" \
++ "sync\n\t" \
++ ".set mips0" \
++ : /* no output */ \
++ : /* no input */ \
++ : "memory")
++#define cpu_relax() asm volatile("" ::: "memory")
++#endif
++
+ #endif
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/sysprof/sysprof_git.bb b/import-layers/yocto-poky/meta/recipes-kernel/sysprof/sysprof_git.bb
new file mode 100644
index 000000000..84c6aad39
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/sysprof/sysprof_git.bb
@@ -0,0 +1,31 @@
+SUMMARY = "System-wide Performance Profiler for Linux"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+DEPENDS = "glib-2.0"
+
+SRCREV = "cd44ee6644c3641507fb53b8a2a69137f2971219"
+PV = "1.2.0+git${SRCPV}"
+
+SRC_URI = "git://git.gnome.org/sysprof \
+ file://define-NT_GNU_BUILD_ID.patch \
+ file://gui-argument.patch \
+ "
+
+SRC_URI_append_arm = " file://rmb-arm.patch"
+SRC_URI_append_armeb = " file://rmb-arm.patch"
+SRC_URI_append_mips = " file://rmb-mips.patch"
+SRC_URI_append_mips64 = " file://rmb-mips.patch"
+SRC_URI_append_mips64n32 = " file://rmb-mips.patch"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
+
+PACKAGECONFIG ?= "${@bb.utils.contains_any('DISTRO_FEATURES', '${GTK2DISTROFEATURES}', 'gui', '', d)}"
+PACKAGECONFIG[gui] = "--enable-gui,--disable-gui,gtk+ gdk-pixbuf pango libglade"
+
+# We do not yet work for aarch64.
+#
+COMPATIBLE_HOST = "^(?!aarch64).*"
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb
new file mode 100644
index 000000000..3686c2f76
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb
@@ -0,0 +1,42 @@
+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"
+
+EXTRA_OEMAKE = ""
+
+# 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/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/configure-allow-to-disable-libvirt.patch b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/configure-allow-to-disable-libvirt.patch
new file mode 100644
index 000000000..b4f2fbc06
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/docproc-build-fix.patch b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/docproc-build-fix.patch
new file mode 100644
index 000000000..33a89940a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/docproc-build-fix.patch
@@ -0,0 +1,19 @@
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
+
+Index: git/doc/SystemTap_Tapset_Reference/Makefile.am
+===================================================================
+--- git.orig/doc/SystemTap_Tapset_Reference/Makefile.am 2012-04-13 08:43:46.263339003 -0500
++++ git/doc/SystemTap_Tapset_Reference/Makefile.am 2012-04-13 09:31:22.470083915 -0500
+@@ -27,6 +27,10 @@
+ noinst_PROGRAMS = docproc
+ SRCTREE=$(abs_top_srcdir)/
+ DOCPROC=$(abs_builddir)/docproc
++docproc_LINK = $(CC_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@
++
++docproc.o: $(srcdir)/docproc.c
++ $(CC_FOR_BUILD) -c $(CFLAGS_FOR_BUILD) -o $@ $(srcdir)/docproc.c
+
+ all: $(PDFDOCS) stamp-htmldocs stamp-mandocs
+ tapsets.xml: docproc $(shell find $(SRCTREE)/tapset -name '*.stp')
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/obsolete_automake_macros.patch b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/obsolete_automake_macros.patch
new file mode 100644
index 000000000..988cda4f0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/obsolete_automake_macros.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+Index: git/configure.ac
+===================================================================
+--- git.orig/configure.ac
++++ git/configure.ac
+@@ -19,7 +19,6 @@ AC_PROG_LN_S
+ AC_PROG_CC
+ AC_PROG_CXX
+ AC_PROG_CPP
+-AM_PROG_CC_STDC
+ AM_PROG_CC_C_O
+ AC_PROG_RANLIB
+ AC_OBJEXT
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/system_map_location.patch b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/system_map_location.patch
new file mode 100644
index 000000000..013af5c3a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/system_map_location.patch
@@ -0,0 +1,23 @@
+systemtap: Cross compilation fix
+
+This is a cross compilation fix. It allows systemtap to find
+the kernel map file in the right place, i.e. in the kernel build tree.
+Without this fix it takes a map file from the build host, if available.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mikhail Durnev <mikhail_durnev@mentor.com>
+
+Index: git/session.cxx
+===================================================================
+--- git.orig/session.cxx
++++ git/session.cxx
+@@ -1634,7 +1634,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 = kernel_build_tree + "/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/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/x32_abi_time.patch b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap/x32_abi_time.patch
new file mode 100644
index 000000000..28a7eae40
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap_git.bb b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap_git.bb
new file mode 100644
index 000000000..97064b838
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap_git.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Script-directed dynamic tracing and performance analysis tool for Linux"
+
+require systemtap_git.inc
+
+DEPENDS = "elfutils sqlite3 systemtap-native"
+DEPENDS_class-native = "elfutils-native sqlite3-native gettext-native"
+DEPENDS_class-nativesdk = "nativesdk-elfutils nativesdk-sqlite3 nativesdk-gettext"
+
+RDEPENDS_${PN} += "python bash"
+RDEPENDS_${PN}_class-native += "python-native"
+RDEPENDS_${PN}_class-nativesdk += "python-native"
+
+EXTRA_OECONF += "--with-libelf=${STAGING_DIR_TARGET} --without-rpm \
+ --without-nss --without-avahi --without-dyninst \
+ --disable-server --disable-grapher --enable-prologues \
+ 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 ??= ""
+PACKAGECONFIG[libvirt] = "--enable-libvirt,--disable-libvirt,libvirt"
+
+inherit autotools gettext pkgconfig
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap_git.inc b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap_git.inc
new file mode 100644
index 000000000..656f15f80
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/systemtap/systemtap_git.inc
@@ -0,0 +1,24 @@
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+SRCREV = "7009f2f782e52d6105fe68d6ea2a9820a1099c06"
+PV = "2.9"
+
+SRC_URI = "git://sourceware.org/git/systemtap.git \
+ file://docproc-build-fix.patch \
+ file://obsolete_automake_macros.patch \
+ file://system_map_location.patch \
+ file://configure-allow-to-disable-libvirt.patch \
+ file://x32_abi_time.patch \
+ "
+
+# systemtap doesn't support mips
+COMPATIBLE_HOST = '(x86_64|i.86|powerpc|arm|aarch64).*-linux'
+
+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/import-layers/yocto-poky/meta/recipes-kernel/trace-cmd/kernelshark_git.bb b/import-layers/yocto-poky/meta/recipes-kernel/trace-cmd/kernelshark_git.bb
new file mode 100644
index 000000000..563182c89
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/trace-cmd/kernelshark_git.bb
@@ -0,0 +1,32 @@
+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=${@oe.path.relative(prefix, 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
+ rmdir ${D}${libdir}
+}
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/trace-cmd/trace-cmd.inc b/import-layers/yocto-poky/meta/recipes-kernel/trace-cmd/trace-cmd.inc
new file mode 100644
index 000000000..3ad06fad8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/trace-cmd/trace-cmd.inc
@@ -0,0 +1,12 @@
+SRCREV = "9be5d74805830a291615f2f34a27c903f6a37b1e"
+PV = "2.6"
+
+inherit pkgconfig
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/trace-cmd:"
+
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git;branch=trace-cmd-stable-v2.6 \
+ file://blktrace-api-compatibility.patch \
+"
+
+S = "${WORKDIR}/git"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/trace-cmd/trace-cmd/blktrace-api-compatibility.patch b/import-layers/yocto-poky/meta/recipes-kernel/trace-cmd/trace-cmd/blktrace-api-compatibility.patch
new file mode 100644
index 000000000..320db6a32
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-kernel/trace-cmd/trace-cmd_git.bb b/import-layers/yocto-poky/meta/recipes-kernel/trace-cmd/trace-cmd_git.bb
new file mode 100644
index 000000000..dd9a8a0de
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/trace-cmd/trace-cmd_git.bb
@@ -0,0 +1,33 @@
+SUMMARY = "User interface to Ftrace"
+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=bbb461211a33b134d42ed5ee802b37ff \
+ 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=${@oe.path.relative(prefix, 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/import-layers/yocto-poky/meta/recipes-lsb4/libpng/libpng12_1.2.56.bb b/import-layers/yocto-poky/meta/recipes-lsb4/libpng/libpng12_1.2.56.bb
new file mode 100644
index 000000000..10c350ac2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-lsb4/libpng/libpng12_1.2.56.bb
@@ -0,0 +1,36 @@
+SUMMARY = "PNG image format decoding library"
+HOMEPAGE = "http://www.libpng.org/"
+SECTION = "libs"
+LICENSE = "Libpng"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e7f289af309d98b46321d0f9892def16 \
+ file://png.h;beginline=19;endline=109;md5=10c940148fe379a535b310c1c54e609c"
+DEPENDS = "zlib"
+
+PN = "libpng12"
+S = "${WORKDIR}/libpng-${PV}"
+
+SRC_URI = "${GENTOO_MIRROR}/libpng-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "868562bd1c58b76ed8703f135a2e439a"
+SRC_URI[sha256sum] = "24ce54581468b937734a6ecc86f7e121bc46a90d76a0d948dca08f32ee000dbe"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/libpng/files/libpng12/"
+UPSTREAM_CHECK_REGEX = "/libpng12/(?P<pver>(\d+[\.\-_]*)+)/"
+
+BINCONFIG_GLOB = "${PN}-config"
+
+inherit autotools binconfig pkgconfig
+
+do_install_append() {
+ # The follow link files link to corresponding png12*.h and libpng12* files
+ # They conflict with higher verison, so drop them
+ unlink ${D}/${includedir}/png.h
+ unlink ${D}/${includedir}/pngconf.h
+
+ unlink ${D}/${libdir}/libpng.la
+ unlink ${D}/${libdir}/libpng.so
+ unlink ${D}/${libdir}/libpng.a || true
+ unlink ${D}/${libdir}/pkgconfig/libpng.pc
+
+ unlink ${D}/${bindir}/libpng-config
+}
diff --git a/import-layers/yocto-poky/meta/recipes-lsb4/perl/libclass-isa-perl_0.36.bb b/import-layers/yocto-poky/meta/recipes-lsb4/perl/libclass-isa-perl_0.36.bb
new file mode 100644
index 000000000..f93841dc7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-lsb4/perl/libclass-isa-perl_0.36.bb
@@ -0,0 +1,31 @@
+SUMMARY = "Perl module for reporting the search path for a class's ISA tree"
+DESCRIPTION = "Suppose you have a class (like Food::Fish::Fishstick) that is derived, \
+via its @ISA, from one or more superclasses (as Food::Fish::Fishstick is from Food::Fish,\
+Life::Fungus, and Chemicals), and some of those superclasses may themselves each be\
+derived, via its @ISA, from one or more superclasses (as above).\
+\
+When, then, you call a method in that class ($fishstick->calories), Perl first searches\
+there for that method, but if it's not there, it goes searching in its superclasses, and\
+so on, in a depth-first (or maybe "height-first" is the word) search. In the above example,\
+it'd first look in Food::Fish, then Food, then Matter, then Life::Fungus, then Life, then\
+Chemicals.\
+\
+This library, Class::ISA, provides functions that return that list -- the list\
+(in order) of names of classes Perl would search to find a method, with no duplicates."
+
+HOMEPAGE = "http://search.cpan.org/dist/Class-ISA/"
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+
+LIC_FILES_CHKSUM = "file://README;beginline=107;endline=111;md5=6a5c6842a63cfe4dab1f66e2350e4d25"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/S/SM/SMUELLER/Class-ISA-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "3a2ad203c8dc87d6c9de16215d00af47"
+SRC_URI[sha256sum] = "8816f34e9a38e849a10df756030dccf9fe061a196c11ac3faafd7113c929b964"
+
+S = "${WORKDIR}/Class-ISA-${PV}"
+
+inherit cpan
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-lsb4/perl/libdumpvalue-perl_1.17.bb b/import-layers/yocto-poky/meta/recipes-lsb4/perl/libdumpvalue-perl_1.17.bb
new file mode 100644
index 000000000..9a7461463
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-lsb4/perl/libdumpvalue-perl_1.17.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Perl module for provides screen dump of Perl data"
+
+HOMEPAGE = "http://search.cpan.org/~flora/Dumpvalue/"
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=f736bec5ada1fc5e39b2a8e7e06bbcbb"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/F/FL/FLORA/Dumpvalue-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "6ede9f693d4a9c4555541cb1a1cc2006"
+SRC_URI[sha256sum] = "9ea74606b545f769a787ec2ae229549a2ad0a8e3cd4b14eff2ce3841836b3bdb"
+
+S = "${WORKDIR}/Dumpvalue-${PV}"
+
+inherit cpan
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-lsb4/perl/libenv-perl_1.04.bb b/import-layers/yocto-poky/meta/recipes-lsb4/perl/libenv-perl_1.04.bb
new file mode 100644
index 000000000..dd8e1159e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-lsb4/perl/libenv-perl_1.04.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Perl module that imports environment variables as scalars or arrays"
+DESCRIPTION = "Perl maintains environment variables in a special hash named %ENV. \
+For when this access method is inconvenient, the Perl module Env allows environment \
+variables to be treated as scalar or array variables."
+
+HOMEPAGE = "http://search.cpan.org/~flora/Env/"
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=76c1cbf18db56b3340d91cb947943bd3"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/F/FL/FLORA/Env-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "fdba5c0690e66972c96fee112cf5f25c"
+SRC_URI[sha256sum] = "d94a3d412df246afdc31a2199cbd8ae915167a3f4684f7b7014ce1200251ebb0"
+
+S = "${WORKDIR}/Env-${PV}"
+
+inherit cpan
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-lsb4/perl/libfile-checktree-perl_4.41.bb b/import-layers/yocto-poky/meta/recipes-lsb4/perl/libfile-checktree-perl_4.41.bb
new file mode 100644
index 000000000..ce37c72ca
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-lsb4/perl/libfile-checktree-perl_4.41.bb
@@ -0,0 +1,32 @@
+SUMMARY = "Perl module that run many filetest checks on a tree"
+DESCRIPTION = "The validate() routine takes a single multiline string consisting \
+of directives, each containing a filename plus a file test to try on it. (The file \
+test may also be a "cd", causing subsequent relative filenames to be interpreted \
+relative to that directory.) After the file test you may put || die to make it a \
+fatal error if the file test fails. The default is || warn. The file test may \
+optionally have a "!' prepended to test for the opposite condition. If you do a \
+cd and then list some relative filenames, you may want to indent them slightly for \
+readability. If you supply your own die() or warn() message, you can use $file to \
+interpolate the filename. \
+\
+Filetests may be bunched: "-rwx" tests for all of -r, -w, and -x. Only the first failed \
+test of the bunch will produce a warning. \
+\
+The routine returns the number of warnings issued."
+
+HOMEPAGE = "http://search.cpan.org/~flora/File-CheckTree/"
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=c6fcacc5df80e037060300a7f4b93bf9"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/F/FL/FLORA/File-CheckTree-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "519c82aa7e5b7f752b4da14a6c8ad740"
+SRC_URI[sha256sum] = "fc99ab6bb5af4664832715974b5a19e328071dc9202ab72e5d5a594ebd46a729"
+
+S = "${WORKDIR}/File-CheckTree-${PV}"
+
+inherit cpan
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-lsb4/perl/libi18n-collate-perl_1.02.bb b/import-layers/yocto-poky/meta/recipes-lsb4/perl/libi18n-collate-perl_1.02.bb
new file mode 100644
index 000000000..f1839e0cf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-lsb4/perl/libi18n-collate-perl_1.02.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Perl module that compare 8-bit scalar data according to the current locale"
+DESCRIPTION = "This module provides you with objects that will collate according to \
+your national character set, provided that the POSIX setlocale() function is supported \
+on your system."
+
+HOMEPAGE = "http://search.cpan.org/~flora/I18N-Collate/"
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=ff6d629144a6ec1ea8c300f75760184f"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/F/FL/FLORA/I18N-Collate-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "72ddb6d1c59cfdf31aa3b04799b86af0"
+SRC_URI[sha256sum] = "9174506bc903eda89690394e3f45558ab7e013114227896d8569d6164648fe37"
+
+S = "${WORKDIR}/I18N-Collate-${PV}"
+
+inherit cpan
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-lsb4/perl/libpod-plainer-perl_1.04.bb b/import-layers/yocto-poky/meta/recipes-lsb4/perl/libpod-plainer-perl_1.04.bb
new file mode 100644
index 000000000..a3e58f031
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-lsb4/perl/libpod-plainer-perl_1.04.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Perl extension for converting Pod to old-style Pod"
+DESCRIPTION = "Pod::Plainer uses Pod::Parser which takes Pod with the (new) 'C<< .. >>' \
+constructs and returns the old(er) style with just 'C<>'; '<' and '>' are replaced by \
+'E<lt>' and 'E<gt>'. \
+\
+This can be used to pre-process Pod before using tools which do not recognise the new style Pods."
+
+HOMEPAGE = "http://search.cpan.org/dist/Pod-Plainer/"
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+
+LIC_FILES_CHKSUM = "file://README;beginline=27;md5=227cf83970fc61264845825d9d2bf6f8"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/R/RM/RMBARKER/Pod-Plainer-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "f502eacd1a40894b9dfea55fc2cd5e7d"
+SRC_URI[sha256sum] = "1bbfbf7d1d4871e5a83bab2137e22d089078206815190eb1d5c1260a3499456f"
+
+S = "${WORKDIR}/Pod-Plainer-${PV}"
+
+inherit cpan
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-fpu.inc b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-fpu.inc
new file mode 100644
index 000000000..50402307c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-fpu.inc
@@ -0,0 +1,6 @@
+
+def get_alsa_fpu_setting(bb, d):
+ if d.getVar('TARGET_FPU', True) in [ 'soft' ]:
+ return "--with-softfloat"
+ return ""
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-lib/0001-topology-Add-missing-include-sys-stat.h.patch b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-lib/0001-topology-Add-missing-include-sys-stat.h.patch
new file mode 100644
index 000000000..0ead0cdaf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-lib/0001-topology-Add-missing-include-sys-stat.h.patch
@@ -0,0 +1,35 @@
+From 3f1dba9a821b53b42001605f9a126a958804884f Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Mon, 9 Nov 2015 13:37:26 +0100
+Subject: [PATCH] topology: Add missing include sys/stat.h
+
+Necessary for proper definitions of S_IRUSR & co. Otherwise it
+results in compile errors with old glibc and uclibc:
+ parser.c: In function 'snd_tplg_build_file':
+ parser.c:262: error: 'S_IRUSR' undeclared (first use in this function)
+ parser.c:262: error: (Each undeclared identifier is reported only once
+ parser.c:262: error: for each function it appears in.)
+
+Upstream-Status: Backport
+
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ src/topology/parser.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/topology/parser.c b/src/topology/parser.c
+index 80a0ae0..18bb9c7 100644
+--- a/src/topology/parser.c
++++ b/src/topology/parser.c
+@@ -16,6 +16,7 @@
+ Liam Girdwood <liam.r.girdwood@linux.intel.com>
+ */
+
++#include <sys/stat.h>
+ #include "list.h"
+ #include "tplg_local.h"
+
+--
+2.4.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-lib/Check-if-wordexp-function-is-supported.patch b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-lib/Check-if-wordexp-function-is-supported.patch
new file mode 100644
index 000000000..795e48ab2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-lib/Check-if-wordexp-function-is-supported.patch
@@ -0,0 +1,51 @@
+From 3408f8e78776b12f131e433749721602f87e0a70 Mon Sep 17 00:00:00 2001
+From: "Hong H. Pham" <hong.pham@windriver.com>
+Date: Fri, 29 Aug 2014 17:13:55 +0300
+Subject: [PATCH] Check if wordexp function is supported
+
+eglibc could be configured to build without wordexp, so it is not enough
+to check if wordexp.h exists (the header file could be installed, but it's
+possible that the wordexp() function is not supported). An additional
+check if wordexp() is supported by the system C library is needed.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Hong H. Pham <hong.pham@windriver.com>
+Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
+---
+ configure.ac | 5 ++++-
+ src/userfile.c | 2 +-
+ 2 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 9490d39..b08a90a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -295,7 +295,10 @@ fi
+ AC_SUBST(ALSA_DEPLIBS)
+
+ dnl Check for headers
+-AC_CHECK_HEADERS([wordexp.h endian.h sys/endian.h sys/shm.h])
++AC_CHECK_HEADERS([wordexp.h endian.h sys/endian.h sys/shm.h],
++ dnl Make sure wordexp is supported by the C library
++ AC_CHECK_FUNCS([wordexp])
++)
+
+ dnl Check for resmgr support...
+ AC_MSG_CHECKING(for resmgr support)
+diff --git a/src/userfile.c b/src/userfile.c
+index 72779da..e9d13e6 100644
+--- a/src/userfile.c
++++ b/src/userfile.c
+@@ -32,7 +32,7 @@
+ * stores the first matchine one. The returned string is strdup'ed.
+ */
+
+-#ifdef HAVE_WORDEXP_H
++#if (defined(HAVE_WORDEXP_H) && defined(HAVE_WORDEXP))
+ #include <wordexp.h>
+ #include <assert.h>
+ int snd_user_file(const char *file, char **result)
+--
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-lib/avoid-including-sys-poll.h-directly.patch b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-lib/avoid-including-sys-poll.h-directly.patch
new file mode 100644
index 000000000..161619b27
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-lib/avoid-including-sys-poll.h-directly.patch
@@ -0,0 +1,183 @@
+From 7dcf46969e85c881c901df4b49309e9091cad16a Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Tue, 9 Feb 2016 14:01:18 -0800
+Subject: [PATCH] avoid including <sys/poll.h> directly
+
+Fixes compiler warnings when building with musl libc.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ aserver/aserver.c | 2 +-
+ include/asoundlib-head.h | 2 +-
+ include/asoundlib.h | 2 +-
+ include/local.h | 2 +-
+ src/control/control.c | 2 +-
+ src/control/control_shm.c | 2 +-
+ src/pcm/pcm_direct.c | 2 +-
+ src/pcm/pcm_mmap.c | 2 +-
+ src/pcm/pcm_share.c | 2 +-
+ src/pcm/pcm_shm.c | 2 +-
+ src/seq/seq.c | 2 +-
+ src/shmarea.c | 2 +-
+ 12 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/aserver/aserver.c b/aserver/aserver.c
+index 1579da7..ef64248 100644
+--- a/aserver/aserver.c
++++ b/aserver/aserver.c
+@@ -20,7 +20,7 @@
+
+ #include <sys/shm.h>
+ #include <sys/socket.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/un.h>
+ #include <sys/uio.h>
+ #include <stdio.h>
+diff --git a/include/asoundlib-head.h b/include/asoundlib-head.h
+index 1ec611e..21e32c6 100644
+--- a/include/asoundlib-head.h
++++ b/include/asoundlib-head.h
+@@ -35,6 +35,6 @@
+ #include <string.h>
+ #include <fcntl.h>
+ #include <assert.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <errno.h>
+ #include <stdarg.h>
+diff --git a/include/asoundlib.h b/include/asoundlib.h
+index 3c2766e..a546194 100644
+--- a/include/asoundlib.h
++++ b/include/asoundlib.h
+@@ -35,7 +35,7 @@
+ #include <string.h>
+ #include <fcntl.h>
+ #include <assert.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <errno.h>
+ #include <stdarg.h>
+ #include <endian.h>
+diff --git a/include/local.h b/include/local.h
+index b429f5d..e05898f 100644
+--- a/include/local.h
++++ b/include/local.h
+@@ -47,7 +47,7 @@
+ #error Header defining endianness not defined
+ #endif
+ #include <stdarg.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/types.h>
+ #include <errno.h>
+ #include <linux/types.h>
+diff --git a/src/control/control.c b/src/control/control.c
+index 4a28cf6..071c5db 100644
+--- a/src/control/control.c
++++ b/src/control/control.c
+@@ -48,7 +48,7 @@ and IEC958 structure.
+ #include <string.h>
+ #include <fcntl.h>
+ #include <signal.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include "control_local.h"
+
+ /**
+diff --git a/src/control/control_shm.c b/src/control/control_shm.c
+index bd07d4a..9a2e268 100644
+--- a/src/control/control_shm.c
++++ b/src/control/control_shm.c
+@@ -27,7 +27,7 @@
+ #include <fcntl.h>
+ #include <sys/shm.h>
+ #include <sys/socket.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/un.h>
+ #include <sys/uio.h>
+ #include <sys/mman.h>
+diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c
+index fd3877c..52ac093 100644
+--- a/src/pcm/pcm_direct.c
++++ b/src/pcm/pcm_direct.c
+@@ -30,7 +30,7 @@
+ #include <grp.h>
+ #include <sys/ioctl.h>
+ #include <sys/mman.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/shm.h>
+ #include <sys/sem.h>
+ #include <sys/wait.h>
+diff --git a/src/pcm/pcm_mmap.c b/src/pcm/pcm_mmap.c
+index 5c4fbe1..2cfa7db 100644
+--- a/src/pcm/pcm_mmap.c
++++ b/src/pcm/pcm_mmap.c
+@@ -22,7 +22,7 @@
+ #include <stdio.h>
+ #include <malloc.h>
+ #include <string.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/mman.h>
+ #ifdef HAVE_SYS_SHM_H
+ #include <sys/shm.h>
+diff --git a/src/pcm/pcm_share.c b/src/pcm/pcm_share.c
+index 5d8aaf2..21a57fc 100644
+--- a/src/pcm/pcm_share.c
++++ b/src/pcm/pcm_share.c
+@@ -34,7 +34,7 @@
+ #include <signal.h>
+ #include <math.h>
+ #include <sys/socket.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <pthread.h>
+ #include "pcm_local.h"
+
+diff --git a/src/pcm/pcm_shm.c b/src/pcm/pcm_shm.c
+index a815ac6..4ee958c 100644
+--- a/src/pcm/pcm_shm.c
++++ b/src/pcm/pcm_shm.c
+@@ -36,7 +36,7 @@
+ #include <sys/ioctl.h>
+ #include <sys/shm.h>
+ #include <sys/socket.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/un.h>
+ #include <sys/mman.h>
+ #include <netinet/in.h>
+diff --git a/src/seq/seq.c b/src/seq/seq.c
+index 620ca3f..681cef1 100644
+--- a/src/seq/seq.c
++++ b/src/seq/seq.c
+@@ -777,7 +777,7 @@ void event_filter(snd_seq_t *seq, snd_seq_event_t *ev)
+
+ */
+
+-#include <sys/poll.h>
++#include <poll.h>
+ #include "seq_local.h"
+
+ /****************************************************************************
+diff --git a/src/shmarea.c b/src/shmarea.c
+index 9843aa8..eaa71f0 100644
+--- a/src/shmarea.c
++++ b/src/shmarea.c
+@@ -27,7 +27,7 @@
+ #include <malloc.h>
+ #include <string.h>
+ #include <errno.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/mman.h>
+ #include <sys/shm.h>
+ #include "list.h"
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-lib_1.1.0.bb b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-lib_1.1.0.bb
new file mode 100644
index 000000000..a73da2882
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-lib_1.1.0.bb
@@ -0,0 +1,51 @@
+SUMMARY = "ALSA sound library"
+HOMEPAGE = "http://www.alsa-project.org"
+BUGTRACKER = "https://bugtrack.alsa-project.org/alsa-bug/login_page.php"
+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"
+
+# configure.in sets -D__arm__ on the command line for any arm system
+# (not just those with the ARM instruction set), this should be removed,
+# (or replaced by a permitted #define).
+#FIXME: remove the following
+ARM_INSTRUCTION_SET = "arm"
+
+SRC_URI = "ftp://ftp.alsa-project.org/pub/lib/${BP}.tar.bz2 \
+ file://Check-if-wordexp-function-is-supported.patch \
+ file://avoid-including-sys-poll.h-directly.patch \
+ file://0001-topology-Add-missing-include-sys-stat.h.patch \
+"
+SRC_URI[md5sum] = "69515ca73c3c4a212ef45160dea846c1"
+SRC_URI[sha256sum] = "dfde65d11e82b68f82e562ab6228c1fb7c78854345d3c57e2c68a9dd3dae1f15"
+
+inherit autotools pkgconfig
+
+require alsa-fpu.inc
+EXTRA_OECONF += "${@get_alsa_fpu_setting(bb, d)} "
+
+EXTRA_OECONF = "--disable-python"
+
+EXTRA_OECONF_append_libc-uclibc = " --with-versioned=no "
+
+PACKAGES =+ "alsa-server libasound alsa-conf-base alsa-conf alsa-doc"
+FILES_${PN} += "${libdir}/${BPN}/smixer/*.so"
+FILES_${PN}-dev += "${libdir}/${BPN}/smixer/*.la"
+FILES_libasound = "${libdir}/libasound.so.*"
+FILES_alsa-server = "${bindir}/*"
+FILES_alsa-conf = "${datadir}/alsa/"
+FILES_alsa-conf-base = "\
+${datadir}/alsa/alsa.conf \
+${datadir}/alsa/cards/aliases.conf \
+${datadir}/alsa/pcm/default.conf \
+${datadir}/alsa/pcm/dmix.conf \
+${datadir}/alsa/pcm/dsnoop.conf"
+
+RDEPENDS_libasound = "alsa-conf-base alsa-conf"
+# upgrade path
+RPROVIDES_${PN}-dev = "alsa-dev"
+RREPLACES_${PN}-dev = "alsa-dev"
+RCONFLICTS_${PN}-dev = "alsa-dev"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-plugins/0001-pph-include-config.h-from-rate_speexrate.c.patch b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-plugins/0001-pph-include-config.h-from-rate_speexrate.c.patch
new file mode 100644
index 000000000..8e5b6a2a2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-plugins/0001-pph-include-config.h-from-rate_speexrate.c.patch
@@ -0,0 +1,35 @@
+From 4350314c941489833a8baa930e16512e55f72a13 Mon Sep 17 00:00:00 2001
+From: Tanu Kaskinen <tanuk@iki.fi>
+Date: Wed, 27 Jan 2016 13:22:38 +0200
+Subject: [PATCH] pph: include config.h from rate_speexrate.c
+
+Fixes compilation against libspeexdsp 1.2rc3.
+
+rate_speexrate.c includes speex_resampler.h, which depends on config.h
+by referencing the HAVE_SPEEX_SPEEXDSP_TYPES_H macro. AFAIK it's not
+a good idea to include config.h from headers (I don't know/remember
+why, though), which is why I include config.h from rate_speexrate.c
+instead of speex_resampler.h.
+
+Upstream-Status: Accepted [expected in 1.1.1]
+
+Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
+---
+ pph/rate_speexrate.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/pph/rate_speexrate.c b/pph/rate_speexrate.c
+index 0a1325c..8fc4cef 100644
+--- a/pph/rate_speexrate.c
++++ b/pph/rate_speexrate.c
+@@ -28,6 +28,7 @@
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
++#include "config.h"
+ #include <stdio.h>
+ #include <alsa/asoundlib.h>
+ #include <alsa/pcm_rate.h>
+--
+2.7.0.rc3
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-plugins_1.1.0.bb b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-plugins_1.1.0.bb
new file mode 100644
index 000000000..fec657530
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-plugins_1.1.0.bb
@@ -0,0 +1,105 @@
+SUMMARY = "ALSA Plugins"
+HOMEPAGE = "http://alsa-project.org"
+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 \
+ file://0001-pph-include-config.h-from-rate_speexrate.c.patch \
+"
+SRC_URI[md5sum] = "b123e42ed881b9adbc99e4040f257c39"
+SRC_URI[sha256sum] = "3b83c329953bef99f5fe25ae04ec4a455fe6514939f3b45a5321966652b2c9ee"
+
+DEPENDS += "alsa-lib"
+
+inherit autotools pkgconfig
+
+PACKAGECONFIG ??= "\
+ samplerate \
+ speexdsp \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', '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 = bb.data.expand('${libdir}/alsa-lib/', d)
+ 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/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-tools/0001-as10k1-Make-output_tram_line-static-inline.patch b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-tools/0001-as10k1-Make-output_tram_line-static-inline.patch
new file mode 100644
index 000000000..d049a30d2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-tools/0001-as10k1-Make-output_tram_line-static-inline.patch
@@ -0,0 +1,31 @@
+From 1e5926df74a35fe2cd90bc59f5264a8715c94048 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 7 Sep 2015 08:16:59 +0000
+Subject: [PATCH] as10k1: Make output_tram_line() static inline
+
+The function is not used in any other file, its better to make it static
+inline so compiler has a better chance of optimizing here
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ as10k1/as10k1.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/as10k1/as10k1.c b/as10k1/as10k1.c
+index 96af0c3..d0766fd 100644
+--- a/as10k1/as10k1.c
++++ b/as10k1/as10k1.c
+@@ -366,7 +366,7 @@ void as_exit(const char *message)
+ exit(1);
+ }
+
+-inline void output_tram_line( struct list_head *line_head, int type){
++static inline void output_tram_line( struct list_head *line_head, int type){
+
+ struct tram *tram_sym;
+ struct list_head *entry;
+--
+2.5.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-tools/autotools.patch b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-tools/autotools.patch
new file mode 100644
index 000000000..319f25d27
--- /dev/null
+++ b/import-layers/yocto-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.0
+ 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/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-tools/gitcompile_hdajacksensetest b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-tools/gitcompile_hdajacksensetest
new file mode 100755
index 000000000..58328bd3a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-tools/makefile_no_gtk.patch b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-tools/makefile_no_gtk.patch
new file mode 100644
index 000000000..9bd6848ed
--- /dev/null
+++ b/import-layers/yocto-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.0
+ 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/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-tools_1.1.0.bb b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-tools_1.1.0.bb
new file mode 100644
index 000000000..9e633f1f7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-tools_1.1.0.bb
@@ -0,0 +1,42 @@
+SUMMARY = "Advanced tools for certain ALSA sound card drivers"
+HOMEPAGE = "http://www.alsa-project.org"
+BUGTRACKER = "https://bugtrack.alsa-project.org/alsa-bug/login_page.php"
+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 \
+ file://0001-as10k1-Make-output_tram_line-static-inline.patch \
+ "
+
+SRC_URI[md5sum] = "b476a5afaa3ea3230855553ad59d259d"
+SRC_URI[sha256sum] = "7d34558c590a50294b36576d257316a1ac5cd951eb8cd7d330e09f8cc757ab51"
+
+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}/"
+
+ cp ${WORKDIR}/gitcompile_hdajacksensetest ${S}/hdajacksensetest/gitcompile
+}
+
+FILES_${PN} += "${datadir}/ld10k1"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-utils-scripts_1.1.0.bb b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-utils-scripts_1.1.0.bb
new file mode 100644
index 000000000..a98f9b90b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-utils-scripts_1.1.0.bb
@@ -0,0 +1,21 @@
+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 \
+ "
+
+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}/
+}
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-utils/0001-alsabat-rename-to-avoid-naming-conflict.patch b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-utils/0001-alsabat-rename-to-avoid-naming-conflict.patch
new file mode 100644
index 000000000..b6d7d4f0d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-utils/0001-alsabat-rename-to-avoid-naming-conflict.patch
@@ -0,0 +1,153 @@
+From 28c29dece6c434e7d3d01e805555ba7ddf6fba65 Mon Sep 17 00:00:00 2001
+From: "Lu, Han" <han.lu@intel.com>
+Date: Wed, 3 Feb 2016 14:20:33 +0800
+Subject: [PATCH] alsabat: rename to avoid naming conflict
+
+alsa-utils as well as bareos-bat (as well a some Bacula packages)
+all contain a program called /usr/bin/bat, which causes conflicts on
+various distributions ("basic audio tester" vs "bareos administration
+tool"("bacula administration tool")).
+Rename to avoid conflict.
+
+Signed-off-by: Lu, Han <han.lu@intel.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+
+Upstream-Status: Accepted [expected in version 1.1.1]
+
+Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
+---
+ bat/Makefile.am | 10 +++++-----
+ bat/{bat.1 => alsabat.1} | 43 ++++++++++++++++++++++---------------------
+ bat/bat.c | 2 +-
+ 3 files changed, 28 insertions(+), 27 deletions(-)
+ rename bat/{bat.1 => alsabat.1} (72%)
+
+diff --git a/bat/Makefile.am b/bat/Makefile.am
+index 842ae6b..985f00c 100644
+--- a/bat/Makefile.am
++++ b/bat/Makefile.am
+@@ -1,9 +1,9 @@
+-bin_PROGRAMS = bat
+-man_MANS = bat.1
++bin_PROGRAMS = alsabat
++man_MANS = alsabat.1
+
+-EXTRA_DIST = bat.1
++EXTRA_DIST = alsabat.1
+
+-bat_SOURCES = \
++alsabat_SOURCES = \
+ bat.c \
+ common.c \
+ analyze.c \
+@@ -21,4 +21,4 @@ noinst_HEADERS = \
+ AM_CPPFLAGS = \
+ -Wall -I$(top_srcdir)/include
+
+-bat_LDADD = @FFTW_LIB@
++alsabat_LDADD = @FFTW_LIB@
+diff --git a/bat/bat.1 b/bat/alsabat.1
+similarity index 72%
+rename from bat/bat.1
+rename to bat/alsabat.1
+index e00fc27..8d0b9c0 100644
+--- a/bat/bat.1
++++ b/bat/alsabat.1
+@@ -1,23 +1,23 @@
+-.TH BAT 1 "20th October 2015"
++.TH ALSABAT 1 "20th October 2015"
+ .SH NAME
+-bat \- command\-line sound tester for ALSA sound card driver
++alsabat \- command\-line sound tester for ALSA sound card driver
+
+ .SH SYNOPSIS
+-\fBbat\fP [\fIflags\fP]
++\fBalsabat\fP [\fIflags\fP]
+
+ .SH DESCRIPTION
+-\fBBAT(Basic Audio Tester)\fP is a simple command\-line utility intended
+-to help automate audio driver and sound server testing with little human
+-interaction. BAT can be used to test audio quality, stress test features
+-and test audio before and after PM state changes.
++\fBALSABAT(ALSA Basic Audio Tester)\fP is a simple command\-line utility
++intended to help automate audio driver and sound server testing with little
++human interaction. ALSABAT can be used to test audio quality, stress test
++features and test audio before and after PM state changes.
+
+-BAT's design is relatively simple. BAT plays an audio stream and captures
+-the same stream in either a digital or analog loop back. It then compares
+-the captured stream using a FFT to the original to determine if the test
+-case passes or fails.
++ALSABAT's design is relatively simple. ALSABAT plays an audio stream and
++captures the same stream in either a digital or analog loop back. It then
++compares the captured stream using a FFT to the original to determine if
++the test case passes or fails.
+
+-BAT can either run wholly on the target machine being tested (standalone
+-mode) or can run as a client/server mode where by bat client runs on the
++ALSABAT can either run wholly on the target machine being tested (standalone
++mode) or can run as a client/server mode where by alsabat client runs on the
+ target and runs as a server on a separate tester machine. The client/server
+ mode still requires some manual interaction for synchronization, but this
+ is actively being developed for future releases.
+@@ -93,8 +93,8 @@ Frequencies with amplitude larger than threshold will be recognized as a
+ peak, and the frequency with largest peak value will be recognized as a
+ detected frequency.
+ .br
+-BAT then compares the detected frequency to target frequency, to decide
+-if the detecting passes or fails.
++ALSABAT then compares the detected frequency to target frequency, to
++decide if the detecting passes or fails.
+ .br
+ The default value is 3.0.
+ .TP
+@@ -117,18 +117,19 @@ Target WAV file to save capture test content.
+ .TP
+ \fI\-\-local\fP
+ Internal loopback mode.
+-Playback, capture and analysis internal to BAT only. This is intended for
+-developers to test new BAT features as no audio is routed outside of BAT.
++Playback, capture and analysis internal to ALSABAT only. This is intended
++for developers to test new ALSABAT features as no audio is routed outside
++of ALSABAT.
+
+ .SH EXAMPLES
+
+ .TP
+-\fBbat \-P plughw:0,0 \-C plughw:0,0 \-c 2 \-f S32_LE \-F 250\fR
++\fBalsabat \-P plughw:0,0 \-C plughw:0,0 \-c 2 \-f S32_LE \-F 250\fR
+ Generate and play a sine wave of 250 Hertz with 2 channel and S32_LE format,
+ and then capture and analyze.
+
+ .TP
+-\fBbat \-P plughw:0,0 \-C plughw:0,0 \-\-file 500Hz.wav\fR
++\fBalsabat \-P plughw:0,0 \-C plughw:0,0 \-\-file 500Hz.wav\fR
+ Play the RIFF WAV file "500Hz.wav" which contains 500 Hertz waveform LPCM
+ data, and then capture and analyze.
+
+@@ -152,7 +153,7 @@ Currently only support RIFF WAV format with PCM data. Please report any bugs to
+ the alsa-devel mailing list.
+
+ .SH AUTHOR
+-\fBbat\fP is by Liam Girdwood <liam.r.girdwood@linux.intel.com>, Bernard Gautier
+-<bernard.gautier@intel.com> and Han Lu <han.lu@intel.com>.
++\fBalsabat\fP is by Liam Girdwood <liam.r.girdwood@linux.intel.com>, Bernard
++Gautier <bernard.gautier@intel.com> and Han Lu <han.lu@intel.com>.
+ This document is by Liam Girdwood <liam.r.girdwood@linux.intel.com> and Han Lu
+ <han.lu@intel.com>.
+diff --git a/bat/bat.c b/bat/bat.c
+index 086b9fa..ddb60b7 100644
+--- a/bat/bat.c
++++ b/bat/bat.c
+@@ -272,7 +272,7 @@ static void test_capture(struct bat *bat)
+ static void usage(struct bat *bat)
+ {
+ fprintf(bat->log,
+-_("Usage: bat [-options]...\n"
++_("Usage: alsabat [-options]...\n"
+ "\n"
+ " -h, --help this help\n"
+ " -D pcm device for both playback and capture\n"
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-utils/0001-alsactl-don-t-let-systemd-unit-restore-the-volume-wh.patch b/import-layers/yocto-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..e578dfe74
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-utils/0001-alsactl-don-t-let-systemd-unit-restore-the-volume-wh.patch
@@ -0,0 +1,56 @@
+From 8c3e0ef9625066c2bb67ee3d2b8cd37fd44eadac 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 cac8094..ff865dc 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 2884098..bac3ccc 100644
+--- a/alsactl/alsa-restore.service.in
++++ b/alsactl/alsa-restore.service.in
+@@ -8,6 +8,7 @@ Description=Save/Restore Sound Card State
+ ConditionPathExists=!@daemonswitch@
+ ConditionPathExistsGlob=/dev/snd/control*
+ After=alsa-state.service
++ConditionPathExists=@localstatedir@/lib/alsa/asound.state
+
+ [Service]
+ Type=oneshot
+--
+2.7.0.rc3
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-utils_1.1.0.bb b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-utils_1.1.0.bb
new file mode 100644
index 000000000..af4048818
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/alsa/alsa-utils_1.1.0.bb
@@ -0,0 +1,102 @@
+SUMMARY = "ALSA sound utilities"
+HOMEPAGE = "http://www.alsa-project.org"
+BUGTRACKER = "https://bugtrack.alsa-project.org/alsa-bug/login_page.php"
+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"
+PACKAGECONFIG[bat] = "--enable-bat,--disable-bat,fftw"
+PACKAGECONFIG[udev] = "--with-udev-rules-dir=`pkg-config --variable=udevdir udev`/rules.d,,udev"
+PACKAGECONFIG[xmlto] = "--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 \
+ file://0001-alsabat-rename-to-avoid-naming-conflict.patch \
+ "
+
+SRC_URI[md5sum] = "b9d6102fbbd0b68040bb77023ed30c0c"
+SRC_URI[sha256sum] = "3b1c3135b76e14532d3dd23fb15759ddd7daf9ffbc183f7a9a0a3a86374748f1"
+
+# lazy hack. needs proper fixing in gettext.m4, see
+# http://bugs.openembedded.org/show_bug.cgi?id=2348
+# please close bug and remove this comment when properly fixed
+#
+EXTRA_OECONF_append_libc-uclibc = " --disable-nls"
+
+inherit autotools gettext pkgconfig
+
+# 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
+
+ if ${@bb.utils.contains('PACKAGECONFIG', 'udev', 'false', 'true', d)}; then
+ # This is where alsa-utils will install its rules if we don't tell it anything else.
+ rm -rf ${D}/lib/udev
+ rmdir --ignore-fail-on-non-empty ${D}/lib
+ fi
+}
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/ffmpeg/ffmpeg_3.0.bb b/import-layers/yocto-poky/meta/recipes-multimedia/ffmpeg/ffmpeg_3.0.bb
new file mode 100644
index 000000000..1dfbb9b04
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/ffmpeg/ffmpeg_3.0.bb
@@ -0,0 +1,139 @@
+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 = "GPLv2+"
+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"
+
+SRC_URI[md5sum] = "ef9b6634bb7c920efc940b4d55adf7b2"
+SRC_URI[sha256sum] = "12f32cee41c74435f608c30793fd616bdf53467bb513278e273e135a4c58e470"
+
+# 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', '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[faac] = "--enable-libfaac,--disable-libfaac,faac"
+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[schroedinger] = "--enable-libschroedinger,--disable-libschroedinger,schroedinger"
+PACKAGECONFIG[speex] = "--enable-libspeex,--disable-libspeex,speex"
+PACKAGECONFIG[theora] = "--enable-libtheora,--disable-libtheora,libtheora"
+PACKAGECONFIG[vaapi] = "--enable-vaapi,--disable-vaapi,libva"
+PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx"
+PACKAGECONFIG[x11] = "--enable-x11grab,--disable-x11grab,virtual/libx11 libxfixes libxext xproto virtual/libsdl"
+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', [ 'faac', 'openssl' ], 'yes', '', d)}"
+
+EXTRA_OECONF = " \
+ --disable-stripping \
+ --enable-pic \
+ --enable-shared \
+ --enable-pthreads \
+ ${@bb.utils.contains('USE_NONFREE', 'yes', '--enable-nonfree', '', d)} \
+ \
+ --cross-prefix=${TARGET_PREFIX} \
+ \
+ --ld="${CCLD}" \
+ --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 \
+"
+
+do_configure() {
+ ${S}/configure ${EXTRA_OECONF}
+}
+
+PACKAGES_DYNAMIC += "^lib(av(codec|device|filter|format|util|resample)|swscale|swresample|postproc).*"
+
+# 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"
+
+python populate_packages_prepend() {
+ av_libdir = d.expand('${libdir}')
+ av_pkgconfig = d.expand('${libdir}/pkgconfig')
+
+ # Runtime package
+ do_split_packages(d, av_libdir, '^lib(.*)\.so\..*',
+ output_pattern='lib%s',
+ description='libav %s library',
+ extra_depends='',
+ prepend=True,
+ allow_links=True)
+
+ # Development packages (-dev, -staticdev)
+ do_split_packages(d, av_libdir, '^lib(.*)\.so$',
+ output_pattern='lib%s-dev',
+ description='libav %s development package',
+ extra_depends='${PN}-dev',
+ prepend=True,
+ allow_links=True)
+ do_split_packages(d, av_pkgconfig, '^lib(.*)\.pc$',
+ output_pattern='lib%s-dev',
+ description='libav %s development package',
+ extra_depends='${PN}-dev',
+ prepend=True)
+ do_split_packages(d, av_libdir, '^lib(.*)\.a$',
+ output_pattern='lib%s-staticdev',
+ description='libav %s development package - static library',
+ extra_depends='${PN}-dev',
+ prepend=True,
+ allow_links=True)
+
+}
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/flac/flac_1.3.1.bb b/import-layers/yocto-poky/meta/recipes-multimedia/flac/flac_1.3.1.bb
new file mode 100644
index 000000000..f25271f87
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/flac/flac_1.3.1.bb
@@ -0,0 +1,42 @@
+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=0a853b81d9d43d8aad3b53b05cfcc37e \
+ file://COPYING.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://src/flac/main.c;beginline=1;endline=18;md5=d03a766558d233f9cc3ac5dfafd49deb \
+ file://COPYING.LGPL;md5=fbc093901857fcd118f065f900982c24 \
+ file://src/plugin_common/all.h;beginline=1;endline=18;md5=7c8a3b9e1e66ed0aba765bc6f35da85d \
+ file://COPYING.Xiph;md5=a2c4b71c0198682376d483eb5bcc9197 \
+ 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] = "b9922c9a0378c88d3e901b234f852698"
+SRC_URI[sha256sum] = "4773c0099dba767d963fd92143263be338c48702172e8754b9bc5103efe1c56c"
+
+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/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/files/0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/Add-error-signal-emission-for-missing-plugins.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/Add-error-signal-emission-for-missing-plugins.patch
new file mode 100644
index 000000000..712d46daa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/Add-error-signal-emission-for-missing-plugins.patch
@@ -0,0 +1,252 @@
+From d64c7edb66f4a64ff49c4306cf77fd269b7079ab Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Mon, 16 Mar 2015 13:45:30 +0200
+Subject: [PATCH] Add error signal emission for missing plugins
+
+Add a missing plugins error signal to gst-player. Note that this error
+does not necessarily mean the playback has completely failed, but in
+practice the user experience will be bad (think, e.g. of a mp4 file
+where H.264 codec is missing: AAC playback still works...).
+
+Use the signal in gtk-play to show a infobar if plugins are missing.
+
+Submitted upstream at https://github.com/sdroege/gst-player/pull/11
+
+Upstream-Status: Submitted
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac | 2 +-
+ gtk/gtk-play.c | 54 +++++++++++++++++++++++++++++++++++++++++++++-
+ lib/gst/player/gstplayer.c | 22 +++++++++++++++++++
+ lib/gst/player/gstplayer.h | 3 ++-
+ 4 files changed, 78 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 90ab74c..6cdb4eb 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -53,7 +53,7 @@ AC_SUBST(LT_AGE)
+ PKG_PROG_PKG_CONFIG
+
+ PKG_CHECK_MODULES(GLIB, [glib-2.0 gobject-2.0])
+-PKG_CHECK_MODULES(GSTREAMER, [gstreamer-1.0 >= 1.4 gstreamer-video-1.0 >= 1.4])
++PKG_CHECK_MODULES(GSTREAMER, [gstreamer-1.0 >= 1.4 gstreamer-video-1.0 >= 1.4 gstreamer-pbutils-1.0])
+
+ GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
+ AC_SUBST(GLIB_PREFIX)
+diff --git a/gtk/gtk-play.c b/gtk/gtk-play.c
+index b92773b..e2b605a 100644
+--- a/gtk/gtk-play.c
++++ b/gtk/gtk-play.c
+@@ -30,6 +30,8 @@ typedef struct
+ GtkWidget *prev_button, *next_button;
+ GtkWidget *seekbar;
+ GtkWidget *video_area;
++ GtkWidget *info_label;
++ GtkWidget *info_bar;
+ GtkWidget *volume_button;
+ gulong seekbar_value_changed_signal_id;
+ gboolean playing;
+@@ -141,6 +143,13 @@ play_pause_clicked_cb (GtkButton * button, GtkPlay * play)
+ }
+
+ static void
++clear_missing_plugins (GtkPlay * play)
++{
++ gtk_label_set_text (GTK_LABEL (play->info_label), "");
++ gtk_widget_hide (play->info_bar);
++}
++
++static void
+ skip_prev_clicked_cb (GtkButton * button, GtkPlay * play)
+ {
+ GList *prev;
+@@ -155,6 +164,7 @@ skip_prev_clicked_cb (GtkButton * button, GtkPlay * play)
+
+ gtk_widget_set_sensitive (play->next_button, TRUE);
+ gst_player_set_uri (play->player, prev->data);
++ clear_missing_plugins (play);
+ gst_player_play (play->player);
+ set_title (play, prev->data);
+ gtk_widget_set_sensitive (play->prev_button, g_list_previous (prev) != NULL);
+@@ -175,6 +185,7 @@ skip_next_clicked_cb (GtkButton * button, GtkPlay * play)
+
+ gtk_widget_set_sensitive (play->prev_button, TRUE);
+ gst_player_set_uri (play->player, next->data);
++ clear_missing_plugins (play);
+ gst_player_play (play->player);
+ set_title (play, next->data);
+ gtk_widget_set_sensitive (play->next_button, g_list_next (next) != NULL);
+@@ -193,10 +204,16 @@ volume_changed_cb (GtkScaleButton * button, gdouble value, GtkPlay * play)
+ gst_player_set_volume (play->player, value);
+ }
+
++void
++info_bar_response_cb (GtkInfoBar * bar, gint response, GtkPlay * play)
++{
++ gtk_widget_hide (GTK_WIDGET (bar));
++}
++
+ static void
+ create_ui (GtkPlay * play)
+ {
+- GtkWidget *controls, *main_hbox, *main_vbox;
++ GtkWidget *controls, *main_hbox, *main_vbox, *info_bar, *content_area;
+
+ play->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ g_signal_connect (G_OBJECT (play->window), "delete-event",
+@@ -208,6 +225,20 @@ create_ui (GtkPlay * play)
+ g_signal_connect (play->video_area, "realize",
+ G_CALLBACK (video_area_realize_cb), play);
+
++ play->info_bar = gtk_info_bar_new ();
++ gtk_info_bar_set_message_type (GTK_INFO_BAR (play->info_bar),
++ GTK_MESSAGE_WARNING);
++ //gtk_info_bar_set_show_close_button (GTK_INFO_BAR (play->info_bar),
++ // TRUE);
++ gtk_widget_set_no_show_all (play->info_bar, TRUE);
++ g_signal_connect (play->info_bar, "response",
++ G_CALLBACK (info_bar_response_cb), play);
++
++ content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (play->info_bar));
++ play->info_label = gtk_label_new ("");
++ gtk_container_add (GTK_CONTAINER (content_area), play->info_label);
++ gtk_widget_show (play->info_label);
++
+ /* Unified play/pause button */
+ play->play_pause_button =
+ gtk_button_new_from_icon_name ("media-playback-pause",
+@@ -258,6 +289,7 @@ create_ui (GtkPlay * play)
+
+ main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+ gtk_box_pack_start (GTK_BOX (main_vbox), main_hbox, TRUE, TRUE, 0);
++ gtk_box_pack_start (GTK_BOX (main_vbox), play->info_bar, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (main_vbox), controls, FALSE, FALSE, 0);
+ gtk_container_add (GTK_CONTAINER (play->window), main_vbox);
+
+@@ -322,6 +354,7 @@ eos_cb (GstPlayer * unused, GtkPlay * play)
+ gtk_widget_set_sensitive (play->next_button, g_list_next (next) != NULL);
+
+ gst_player_set_uri (play->player, next->data);
++ clear_missing_plugins (play);
+ gst_player_play (play->player);
+ set_title (play, next->data);
+ } else {
+@@ -330,6 +363,24 @@ eos_cb (GstPlayer * unused, GtkPlay * play)
+ }
+ }
+
++static void
++error_cb (GstPlayer * player, GError * err, GtkPlay * play)
++{
++ char *message;
++
++ if (g_error_matches (err, gst_player_error_quark (),
++ GST_PLAYER_ERROR_MISSING_PLUGIN)) {
++ // add message to end of any existing message: there may be
++ // multiple missing plugins.
++ message = g_strdup_printf ("%s%s. ",
++ gtk_label_get_text (GTK_LABEL (play->info_label)), err->message);
++ gtk_label_set_text (GTK_LABEL (play->info_label), message);
++ g_free (message);
++
++ gtk_widget_show (play->info_bar);
++ }
++}
++
+ int
+ main (gint argc, gchar ** argv)
+ {
+@@ -422,6 +473,7 @@ main (gint argc, gchar ** argv)
+ g_signal_connect (play.player, "video-dimensions-changed",
+ G_CALLBACK (video_dimensions_changed_cb), &play);
+ g_signal_connect (play.player, "end-of-stream", G_CALLBACK (eos_cb), &play);
++ g_signal_connect (play.player, "error", G_CALLBACK (error_cb), &play);
+
+ /* We have file(s) that need playing. */
+ set_title (&play, g_list_first (play.uris)->data);
+diff --git a/lib/gst/player/gstplayer.c b/lib/gst/player/gstplayer.c
+index bd682d9..78e7ba1 100644
+--- a/lib/gst/player/gstplayer.c
++++ b/lib/gst/player/gstplayer.c
+@@ -47,6 +47,7 @@
+
+ #include <gst/gst.h>
+ #include <gst/video/video.h>
++#include <gst/pbutils/missing-plugins.h>
+
+ GST_DEBUG_CATEGORY_STATIC (gst_player_debug);
+ #define GST_CAT_DEFAULT gst_player_debug
+@@ -238,6 +239,7 @@ gst_player_class_init (GstPlayerClass * klass)
+ g_signal_new ("video-dimensions-changed", G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, 0, NULL,
+ NULL, NULL, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
++
+ }
+
+ static void
+@@ -619,6 +621,21 @@ error_cb (GstBus * bus, GstMessage * msg, gpointer user_data)
+ g_mutex_unlock (&self->priv->lock);
+ }
+
++static void
++element_cb (GstBus * bus, GstMessage * msg, gpointer user_data)
++{
++ GstPlayer *self = GST_PLAYER (user_data);
++
++ if (gst_is_missing_plugin_message (msg)) {
++ gchar *desc;
++
++ desc = gst_missing_plugin_message_get_description (msg);
++ emit_error (self, g_error_new (GST_PLAYER_ERROR,
++ GST_PLAYER_ERROR_MISSING_PLUGIN, "Missing plugin '%s'", desc));
++ g_free (desc);
++ }
++}
++
+ static gboolean
+ eos_dispatch (gpointer user_data)
+ {
+@@ -1059,6 +1076,8 @@ gst_player_main (gpointer data)
+ NULL, NULL);
+ g_source_attach (bus_source, self->priv->context);
+
++ g_signal_connect (G_OBJECT (bus), "message::element",
++ G_CALLBACK (element_cb), self);
+ g_signal_connect (G_OBJECT (bus), "message::error", G_CALLBACK (error_cb),
+ self);
+ g_signal_connect (G_OBJECT (bus), "message::eos", G_CALLBACK (eos_cb), self);
+@@ -1560,6 +1579,7 @@ gst_player_error_get_type (void)
+ static gsize id = 0;
+ static const GEnumValue values[] = {
+ {C_ENUM (GST_PLAYER_ERROR_FAILED), "GST_PLAYER_ERROR_FAILED", "failed"},
++ {C_ENUM (GST_PLAYER_ERROR_MISSING_PLUGIN), "GST_PLAYER_ERROR_MISSING_PLUGIN", "missing-plugin"},
+ {0, NULL, NULL}
+ };
+
+@@ -1577,6 +1597,8 @@ gst_player_error_get_name (GstPlayerError error)
+ switch (error) {
+ case GST_PLAYER_ERROR_FAILED:
+ return "failed";
++ case GST_PLAYER_ERROR_MISSING_PLUGIN:
++ return "missing-plugin";
+ }
+
+ g_assert_not_reached ();
+diff --git a/lib/gst/player/gstplayer.h b/lib/gst/player/gstplayer.h
+index c438513..35fb5bb 100644
+--- a/lib/gst/player/gstplayer.h
++++ b/lib/gst/player/gstplayer.h
+@@ -44,7 +44,8 @@ GType gst_player_error_get_type (void);
+ #define GST_TYPE_PLAYER_ERROR (gst_player_error_get_type ())
+
+ typedef enum {
+- GST_PLAYER_ERROR_FAILED = 0
++ GST_PLAYER_ERROR_FAILED = 0,
++ GST_PLAYER_ERROR_MISSING_PLUGIN
+ } GstPlayerError;
+
+ const gchar *gst_player_error_get_name (GstPlayerError error);
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/Fix-pause-play.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/Fix-pause-play.patch
new file mode 100644
index 000000000..783c42ad7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/Fix-pause-play.patch
@@ -0,0 +1,107 @@
+Fix pause/play
+
+The current player state is now notified via the state-changed signal,
+and in the GTK UI it was only used to keep track of the desired state.
+
+This is a backport of upstream commit 738479c7a0.
+
+Upstream-Status: Backport
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+---
+ gtk/gtk-play.c | 8 ++++++--
+ lib/gst/player/gstplayer.c | 12 ------------
+ lib/gst/player/gstplayer.h | 2 --
+ 3 files changed, 6 insertions(+), 16 deletions(-)
+
+diff --git a/gtk/gtk-play.c b/gtk/gtk-play.c
+index 6e7a098..e2b605a 100644
+--- a/gtk/gtk-play.c
++++ b/gtk/gtk-play.c
+@@ -34,6 +34,7 @@ typedef struct
+ GtkWidget *info_bar;
+ GtkWidget *volume_button;
+ gulong seekbar_value_changed_signal_id;
++ gboolean playing;
+ } GtkPlay;
+
+ /* Compat stubs */
+@@ -118,12 +119,13 @@ play_pause_clicked_cb (GtkButton * button, GtkPlay * play)
+ {
+ GtkWidget *image;
+
+- if (gst_player_is_playing (play->player)) {
++ if (play->playing) {
+ gst_player_pause (play->player);
+ image =
+ gtk_image_new_from_icon_name ("media-playback-start",
+ GTK_ICON_SIZE_BUTTON);
+ gtk_button_set_image (GTK_BUTTON (play->play_pause_button), image);
++ play->playing = FALSE;
+ } else {
+ gchar *title;
+
+@@ -136,6 +138,7 @@ play_pause_clicked_cb (GtkButton * button, GtkPlay * play)
+ title = gst_player_get_uri (play->player);
+ set_title (play, title);
+ g_free (title);
++ play->playing = TRUE;
+ }
+ }
+
+@@ -335,7 +338,7 @@ video_dimensions_changed_cb (GstPlayer * unused, gint width, gint height,
+ static void
+ eos_cb (GstPlayer * unused, GtkPlay * play)
+ {
+- if (gst_player_is_playing (play->player)) {
++ if (play->playing) {
+ GList *next = NULL;
+ gchar *uri;
+
+@@ -452,6 +455,7 @@ main (gint argc, gchar ** argv)
+ }
+
+ play.player = gst_player_new ();
++ play.playing = TRUE;
+
+ g_object_set (play.player, "dispatch-to-main-context", TRUE, NULL);
+
+diff --git a/lib/gst/player/gstplayer.c b/lib/gst/player/gstplayer.c
+index 069b284..78e7ba1 100644
+--- a/lib/gst/player/gstplayer.c
++++ b/lib/gst/player/gstplayer.c
+@@ -1422,18 +1422,6 @@ gst_player_set_uri (GstPlayer * self, const gchar * val)
+ g_object_set (self, "uri", val, NULL);
+ }
+
+-gboolean
+-gst_player_is_playing (GstPlayer * self)
+-{
+- gboolean val;
+-
+- g_return_val_if_fail (GST_IS_PLAYER (self), FALSE);
+-
+- g_object_get (self, "is-playing", &val, NULL);
+-
+- return val;
+-}
+-
+ GstClockTime
+ gst_player_get_position (GstPlayer * self)
+ {
+diff --git a/lib/gst/player/gstplayer.h b/lib/gst/player/gstplayer.h
+index 6933dd7..35fb5bb 100644
+--- a/lib/gst/player/gstplayer.h
++++ b/lib/gst/player/gstplayer.h
+@@ -93,8 +93,6 @@ gchar * gst_player_get_uri (GstPlayer * player);
+ void gst_player_set_uri (GstPlayer * player,
+ const gchar * uri);
+
+-gboolean gst_player_is_playing (GstPlayer * player);
+-
+ GstClockTime gst_player_get_position (GstPlayer * player);
+ GstClockTime gst_player_get_duration (GstPlayer * player);
+
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/filechooser.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/filechooser.patch
new file mode 100644
index 000000000..7bf1b034b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/filechooser.patch
@@ -0,0 +1,54 @@
+Upstream-Status: Submitted
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From 43d4b19ab611d844156e26c4840cc54ddb73ae03 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Thu, 26 Feb 2015 17:17:05 +0000
+Subject: [PATCH] gtk-play: show a file chooser if no URIs were passed
+
+---
+ gtk/gtk-play.c | 28 ++++++++++++++++++++++++++--
+ 1 file changed, 26 insertions(+), 2 deletions(-)
+
+diff --git a/gtk/gtk-play.c b/gtk/gtk-play.c
+index f015077..9766a72 100644
+--- a/gtk/gtk-play.c
++++ b/gtk/gtk-play.c
+@@ -319,8 +319,32 @@ main (gint argc, gchar ** argv)
+ // FIXME: Add support for playlists and stuff
+ /* Parse the list of the file names we have to play. */
+ if (!file_names) {
+- g_print ("Usage: %s FILE(s)|URI(s)\n", APP_NAME);
+- return 1;
++ GtkWidget *chooser;
++ int res;
++
++ chooser = gtk_file_chooser_dialog_new ("Select files to play", NULL,
++ GTK_FILE_CHOOSER_ACTION_OPEN,
++ "_Cancel", GTK_RESPONSE_CANCEL,
++ "_Open", GTK_RESPONSE_ACCEPT,
++ NULL);
++ g_object_set (chooser,
++ "local-only", FALSE,
++ "select-multiple", TRUE,
++ NULL);
++
++ res = gtk_dialog_run (GTK_DIALOG (chooser));
++ if (res == GTK_RESPONSE_ACCEPT) {
++ GSList *l;
++
++ l = gtk_file_chooser_get_uris (GTK_FILE_CHOOSER (chooser));
++ while (l) {
++ play.uris = g_list_append (play.uris, l->data);
++ l = g_slist_delete_link (l, l);
++ }
++ } else {
++ return 0;
++ }
++ gtk_widget_destroy (chooser);
+ } else {
+ guint i;
+
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/gst-player.desktop b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/gst-player.desktop
new file mode 100644
index 000000000..9fd207b38
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/gst-player.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=Media Player
+Comment=Basic media player
+Icon=audio-player
+TryExec=gtk-play
+Exec=gtk-play
+StartupNotify=true
+Terminal=false
+Type=Application
+Categories=GTK;AudioVideo;
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/gtk2.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/gtk2.patch
new file mode 100644
index 000000000..2cd18bbc9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/gtk2.patch
@@ -0,0 +1,71 @@
+As the rest of Sato is GTK+ 2, patch gtk-play to use GTK+ 2. When the rest of
+Sato has been ported to GTK+ 3 this patch can be dropped.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+
+diff --git a/configure.ac b/configure.ac
+index b8af13b..90ab74c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -60,7 +60,7 @@ AC_SUBST(GLIB_PREFIX)
+ GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-1.0`"
+ AC_SUBST(GST_PREFIX)
+
+-PKG_CHECK_MODULES(GTK, [gtk+-3.0], [have_gtk="yes"], [have_gtk="no"])
++PKG_CHECK_MODULES(GTK, [gtk+-2.0], [have_gtk="yes"], [have_gtk="no"])
+ AM_CONDITIONAL(HAVE_GTK, test "x$have_gtk" != "xno")
+
+ GOBJECT_INTROSPECTION_CHECK([1.31.1])
+diff --git a/gtk/gtk-play.c b/gtk/gtk-play.c
+index f015077..954d6fb 100644
+--- a/gtk/gtk-play.c
++++ b/gtk/gtk-play.c
+@@ -34,6 +34,46 @@ typedef struct
+ gulong seekbar_value_changed_signal_id;
+ } GtkPlay;
+
++/* Compat stubs */
++GtkWidget *
++gtk_box_new (GtkOrientation orientation,
++ gint spacing)
++{
++ switch (orientation) {
++ case GTK_ORIENTATION_HORIZONTAL:
++ return gtk_hbox_new (FALSE, spacing);
++ case GTK_ORIENTATION_VERTICAL:
++ return gtk_vbox_new (FALSE, spacing);
++ }
++}
++
++GtkWidget*
++gtk_button_new_from_icon_name (const gchar *icon_name,
++ GtkIconSize size)
++{
++ GtkWidget *button;
++ GtkWidget *image;
++
++ image = gtk_image_new_from_icon_name (icon_name, size);
++ button = g_object_new (GTK_TYPE_BUTTON,
++ "image", image,
++ NULL);
++ return button;
++}
++
++GtkWidget *
++gtk_scale_new_with_range (GtkOrientation orientation,
++ gdouble min,
++ gdouble max,
++ gdouble step)
++{
++ switch (orientation) {
++ case GTK_ORIENTATION_HORIZONTAL:
++ return gtk_hscale_new_with_range (min, max, step);
++ case GTK_ORIENTATION_VERTICAL:
++ return gtk_vscale_new_with_range (min, max, step);
++ }
++}
+
+ static void
+ set_title (GtkPlay * play, const gchar * title)
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player_git.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player_git.bb
new file mode 100644
index 000000000..8129169c5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player_git.bb
@@ -0,0 +1,39 @@
+SUMMARY = "GStreamer playback helper library and examples"
+LICENSE = "LGPL-2.0+"
+LIC_FILES_CHKSUM = "file://lib/gst/player/gstplayer.c;beginline=1;endline=19;md5=03aeca9d8295f811817909075a15ff65"
+
+DEPENDS = "glib-2.0 gstreamer1.0 gstreamer1.0-plugins-base gtk+"
+
+SRC_URI = "git://github.com/sdroege/gst-player.git \
+ file://filechooser.patch \
+ file://gtk2.patch \
+ file://Fix-pause-play.patch \
+ file://Add-error-signal-emission-for-missing-plugins.patch \
+ file://gst-player.desktop"
+
+SRCREV = "5386c5b984d40ef5434673ed62204e69aaf52645"
+
+S = "${WORKDIR}/git"
+
+inherit autotools gtk-doc lib_package pkgconfig distro_features_check gobject-introspection
+
+ANY_OF_DISTRO_FEATURES = "${GTK2DISTROFEATURES}"
+
+do_configure_prepend() {
+ touch ${S}/ChangeLog
+}
+
+EXTRA_OECONF += "ac_cv_path_VALGRIND=no ac_cv_path_GDB=no"
+
+do_install_append() {
+ install -m 0644 -D ${WORKDIR}/gst-player.desktop ${D}${datadir}/applications/gst-player.desktop
+}
+
+FILES_${PN}-bin += "${datadir}/applications/*.desktop"
+
+RDEPENDS_${PN}-bin = "gstreamer1.0-plugins-base-playback"
+RRECOMMENDS_${PN}-bin = "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)}"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-plugins-package.inc b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-plugins-package.inc
new file mode 100644
index 000000000..c24493e1e
--- /dev/null
+++ b/import-layers/yocto-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', True)
+ glibdir = d.getVar('libdir', True)
+
+ 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', True)
+ 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', True).split()
+ pkgdest = d.getVar('PKGDEST', True)
+ 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/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav.inc b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav.inc
new file mode 100644
index 000000000..363101e1a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav.inc
@@ -0,0 +1,46 @@
+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
+
+# 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"
+
+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}'"
+
+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/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-Disable-yasm-for-libav-when-disable-yasm.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/workaround-to-build-gst-libav-for-i586-with-gcc.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.6.3.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.6.3.bb
new file mode 100644
index 000000000..687230a8f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.6.3.bb
@@ -0,0 +1,20 @@
+include 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 \
+"
+
+SRC_URI[md5sum] = "cfe9a06913d4fd4067e9e47f6e05fac2"
+SRC_URI[sha256sum] = "857b9c060a0337de38c6d26238c47352433c02eabf26c2f860c854dbc35bd4ab"
+
+S = "${WORKDIR}/gst-libav-${PV}"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_git.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_git.bb
new file mode 100644
index 000000000..ebc8a5ef2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_git.bb
@@ -0,0 +1,38 @@
+DEFAULT_PREFERENCE = "-1"
+
+include 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/LICENSE.md;md5=acda96fe91ccaabc9cd9d541806a0d37 \
+ 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"
+
+# To build using the system libav/ffmpeg, append "libav" to PACKAGECONFIG
+# and remove the ffmpeg sources from SRC_URI below. However, first note the
+# warnings in gstreamer1.0-libav.inc
+SRC_URI = " \
+ git://anongit.freedesktop.org/gstreamer/gst-libav;name=base \
+ git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \
+ git://source.ffmpeg.org/ffmpeg;destsuffix=git/gst-libs/ext/libav;name=ffmpeg;branch=release/3.0 \
+ file://0001-Disable-yasm-for-libav-when-disable-yasm.patch \
+ file://workaround-to-build-gst-libav-for-i586-with-gcc.patch \
+"
+
+PV = "1.7.2+git${SRCPV}"
+
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
+
+SRCREV_base = "6c4878b6abc916b7f6f25b8926c4859119acf1ec"
+SRCREV_common = "b64f03f6090245624608beb5d2fff335e23a01c0"
+SRCREV_ffmpeg = "c40983a6f631d22fede713d535bb9c31d5c9740c"
+SRCREV_FORMAT = "base"
+
+S = "${WORKDIR}/git"
+
+do_configure_prepend() {
+ ${S}/autogen.sh --noconfigure
+}
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-meta-base.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-meta-base.bb
new file mode 100644
index 000000000..c542b13f0
--- /dev/null
+++ b/import-layers/yocto-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-souphttpsrc"
+
+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/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx.inc b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx.inc
new file mode 100644
index 000000000..0fff612ee
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx.inc
@@ -0,0 +1,43 @@
+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
+
+acpaths = "-I ${S}/common/m4 -I ${S}/m4"
+
+PR = "r1"
+
+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", True)
+ 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", True))
+}
+
+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/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx/0001-omx-fixed-type-error-in-printf-call.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx/0001-omx-fixed-type-error-in-printf-call.patch
new file mode 100644
index 000000000..a428ac9c9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx/0001-omx-fixed-type-error-in-printf-call.patch
@@ -0,0 +1,30 @@
+From f629e041e9f678fcd86ad764a15117dff63c271c Mon Sep 17 00:00:00 2001
+From: Carlos Rafael Giani <dv@pseudoterminal.org>
+Date: Sat, 27 Apr 2013 02:50:25 +0200
+Subject: [PATCH] omx: fixed type error in printf call
+
+%zu expects size_t
+
+Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=699008]
+
+Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
+---
+ omx/gstomx.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/omx/gstomx.c b/omx/gstomx.c
+index a2945ed..1eca7cc 100644
+--- a/omx/gstomx.c
++++ b/omx/gstomx.c
+@@ -1630,7 +1630,7 @@ gst_omx_port_allocate_buffers_unlocked (GstOMXPort * port,
+
+ GST_INFO_OBJECT (comp->parent,
+ "Allocating %d buffers of size %zu for %s port %u", n,
+- port->port_def.nBufferSize, comp->name, (guint) port->index);
++ (size_t) (port->port_def.nBufferSize), comp->name, (guint) port->index);
+
+ if (!port->buffers)
+ port->buffers = g_ptr_array_sized_new (n);
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.2.0.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.2.0.bb
new file mode 100644
index 000000000..74358a724
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.2.0.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] = "d24e8c0153c35dfefee3e26b1c2c35f8"
+SRC_URI[sha256sum] = "0b4874961e6488ad9e5808114bd486ea981c540907262caab1419355fd82d745"
+
+S = "${WORKDIR}/gst-omx-${PV}"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_git.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_git.bb
new file mode 100644
index 000000000..970554352
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_git.bb
@@ -0,0 +1,25 @@
+DEFAULT_PREFERENCE = "-1"
+
+include gstreamer1.0-omx.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
+ file://omx/gstomx.h;beginline=1;endline=21;md5=5c8e1fca32704488e76d2ba9ddfa935f"
+
+SRC_URI = " \
+ git://anongit.freedesktop.org/gstreamer/gst-omx;branch=master;name=gst-omx \
+ git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;branch=master;name=common \
+ file://0001-omx-fixed-type-error-in-printf-call.patch \
+"
+
+SRCREV_gst-omx = "a2db76b048db278ef0aa798e106b7594264e06c0"
+SRCREV_common = "5edcd857b2107cd8b78c16232dd10877513ec157"
+
+SRCREV_FORMAT = "gst-omx"
+
+S = "${WORKDIR}/git"
+
+do_configure_prepend() {
+ cd ${S}
+ ./autogen.sh --noconfigure
+ cd ${B}
+}
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad.inc b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad.inc
new file mode 100644
index 000000000..9e2b94ede
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad.inc
@@ -0,0 +1,148 @@
+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', '', 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.contains('DISTRO_FEATURES', 'directfb', 'directfb', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)} \
+ bz2 curl dash dtls hls neon 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[directfb] = "--enable-directfb,--disable-directfb,directfb"
+PACKAGECONFIG[dtls] = "--enable-dtls,--disable-dtls,openssl"
+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,--disable-hls,nettle"
+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[opus] = "--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[wayland] = "--enable-wayland --enable-egl,--disable-wayland --disable-egl,wayland virtual/egl"
+PACKAGECONFIG[webp] = "--enable-webp,--disable-webp,libwebp"
+
+# these plugins have not been ported to 1.0 (yet):
+# apexsink dc1394 lv2 linsys musepack nas timidity teletextdec sdl xvid wininet
+# acm gsettings sndio cdxaparse dccp faceoverlay hdvparse tta mve nuvdemux
+# patchdetect real sdi videomeasure gsettings
+
+# these plugins have no corresponding library in OE-core or meta-openembedded:
+# openni2 winks direct3d directsound winscreencap
+# apple_media android_media avc bs2b chromaprint daala dts gme gsm kate ladspa
+# libde265 mimic mpeg2enc mplex ofa openh264 opensles pvr soundtouch spandsp
+# spc vdpau wasapi x265 zbar
+
+# 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-shm \
+ --enable-vcd \
+ --disable-acm \
+ --disable-android_media \
+ --disable-apexsink \
+ --disable-apple_media \
+ --disable-avc \
+ --disable-bs2b \
+ --disable-chromaprint \
+ --disable-cocoa \
+ --disable-daala \
+ --disable-dc1394 \
+ --disable-direct3d \
+ --disable-directsound \
+ --disable-dts \
+ --disable-gme \
+ --disable-gsm \
+ --disable-kate \
+ --disable-ladspa \
+ --disable-libde265 \
+ --disable-libvisual \
+ --disable-linsys \
+ --disable-lv2 \
+ --disable-mimic \
+ --disable-mpeg2enc \
+ --disable-mplex \
+ --disable-musepack \
+ --disable-nas \
+ --disable-ofa \
+ --disable-openexr \
+ --disable-openh264 \
+ --disable-openjpeg \
+ --disable-openni2 \
+ --disable-opensles \
+ --disable-pvr \
+ --disable-qt \
+ --disable-sdl \
+ --disable-sdltest \
+ --disable-sndio \
+ --disable-soundtouch \
+ --disable-spandsp \
+ --disable-spc \
+ --disable-teletextdec \
+ --disable-timidity \
+ --disable-vdpau \
+ --disable-wasapi \
+ --disable-wildmidi \
+ --disable-wininet \
+ --disable-winks \
+ --disable-winscreencap \
+ --disable-x265 \
+ --disable-xvid \
+ --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"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch b/import-layers/yocto-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..154d340e4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch
@@ -0,0 +1,57 @@
+From cff6fbf555a072408c21da1e818209c9d3814dd3 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>
+
+---
+ gst-libs/gst/gl/Makefile.am | 2 +-
+ gst-libs/gst/insertbin/Makefile.am | 2 +-
+ gst-libs/gst/mpegts/Makefile.am | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/gst-libs/gst/gl/Makefile.am b/gst-libs/gst/gl/Makefile.am
+index f968357..7cc2c7a 100644
+--- a/gst-libs/gst/gl/Makefile.am
++++ b/gst-libs/gst/gl/Makefile.am
+@@ -149,7 +149,7 @@ GstGL-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstgl-@GST_API_VERSION@
+ --library=libgstgl-@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 gstreamer-video-@GST_API_VERSION@ \
+diff --git a/gst-libs/gst/insertbin/Makefile.am b/gst-libs/gst/insertbin/Makefile.am
+index 09eb97c..b746885 100644
+--- a/gst-libs/gst/insertbin/Makefile.am
++++ b/gst-libs/gst/insertbin/Makefile.am
+@@ -43,7 +43,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 2511d49..c1cbce6 100644
+--- a/gst-libs/gst/mpegts/Makefile.am
++++ b/gst-libs/gst/mpegts/Makefile.am
+@@ -78,7 +78,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.6.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-glimagesink-Downrank-to-marginal.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-glimagesink-Downrank-to-marginal.patch
new file mode 100644
index 000000000..1085e95e8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-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
+@@ -101,7 +101,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/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-gstreamer-gl.pc.in-don-t-append-GL_CFLAGS-to-CFLAGS.patch b/import-layers/yocto-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..e81b06570
--- /dev/null
+++ b/import-layers/yocto-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,27 @@
+From a93ca63d01e7cd1e40b5be576992f77fac364bd5 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Mon, 21 Mar 2016 18:21:17 +0200
+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>
+---
+ 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 5589e2a..b986450 100644
+--- a/pkgconfig/gstreamer-gl.pc.in
++++ b/pkgconfig/gstreamer-gl.pc.in
+@@ -10,4 +10,4 @@ Version: @VERSION@
+ Requires: gstreamer-base-@GST_API_VERSION@ gstreamer-@GST_API_VERSION@
+
+ Libs: -L${libdir} -lgstgl-@GST_API_VERSION@ @GL_LIBS@
+-Cflags: -I${includedir} @GL_CFLAGS@
++Cflags: -I${includedir}
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-glplugin-glwindow-fix-memory-leak-of-navigation-thre.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-glplugin-glwindow-fix-memory-leak-of-navigation-thre.patch
new file mode 100755
index 000000000..3491a15e6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-glplugin-glwindow-fix-memory-leak-of-navigation-thre.patch
@@ -0,0 +1,35 @@
+From 95cda7fbcf1a81289d9315c801c8e2b3d896f4cb Mon Sep 17 00:00:00 2001
+From: Haihua Hu <b55597@freescale.com>
+Date: Mon, 30 Nov 2015 09:36:09 +0800
+Subject: [PATCH 2/5] [glplugin] glwindow: fix memory leak of navigation
+ thread
+
+When exit navigation thread, call g_thread_join() to release
+the resource hold by it.
+
+Upstream-Status: Backport [1.7.1]
+
+bugzilla URL: https://bugzilla.gnome.org/show_bug.cgi?id=758820
+
+Signed-off-by: Haihua Hu <b55597@freescale.com>
+---
+ gst-libs/gst/gl/gstglwindow.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/gst-libs/gst/gl/gstglwindow.c b/gst-libs/gst/gl/gstglwindow.c
+index 44b74ca..42ef296 100644
+--- a/gst-libs/gst/gl/gstglwindow.c
++++ b/gst-libs/gst/gl/gstglwindow.c
+@@ -343,6 +343,9 @@ gst_gl_window_finalize (GObject * object)
+ while (window->nav_alive) {
+ g_cond_wait (&window->nav_destroy_cond, &window->nav_lock);
+ }
++ /* release resource hold by navigation thread */
++ g_thread_join(window->priv->navigation_thread);
++ window->priv->navigation_thread = NULL;
+ g_mutex_unlock (&window->nav_lock);
+ }
+
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/avoid-including-sys-poll.h-directly.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/configure-allow-to-disable-libssh2.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/configure-allow-to-disable-libssh2.patch
new file mode 100644
index 000000000..d52afd5d5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/configure-allow-to-disable-libssh2.patch
@@ -0,0 +1,64 @@
+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(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0e95c5c..12153b4 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1901,6 +1901,15 @@ AG_GST_CHECK_FEATURE(CHROMAPRINT, [chromaprint], chromaprint, [
+ ])
+
+ 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.21.0, [
+@@ -1915,12 +1924,14 @@ AG_GST_CHECK_FEATURE(CURL, [Curl plugin], curl, [
+ ])
+ 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)
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/ensure-valid-sentinels-for-gst_structure_get-etc.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/ensure-valid-sentinels-for-gst_structure_get-etc.patch
new file mode 100644
index 000000000..369ff93ac
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/ensure-valid-sentinels-for-gst_structure_get-etc.patch
@@ -0,0 +1,86 @@
+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(-)
+
+diff --git a/sys/decklink/gstdecklink.cpp b/sys/decklink/gstdecklink.cpp
+index 64637f1..bac956f 100644
+--- a/sys/decklink/gstdecklink.cpp
++++ b/sys/decklink/gstdecklink.cpp
+@@ -324,22 +324,22 @@ gst_decklink_mode_get_structure (GstDecklinkModeEnum e, BMDPixelFormat f)
+ "height", G_TYPE_INT, mode->height,
+ "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);
+
+ switch (f) {
+ 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 */
+diff --git a/sys/decklink/gstdecklinkaudiosrc.cpp b/sys/decklink/gstdecklinkaudiosrc.cpp
+index 9a701ee..26fb7ec 100644
+--- a/sys/decklink/gstdecklinkaudiosrc.cpp
++++ b/sys/decklink/gstdecklinkaudiosrc.cpp
+@@ -312,7 +312,7 @@ gst_decklink_audio_src_set_caps (GstBaseSrc * bsrc, GstCaps * caps)
+ 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) {
+diff --git a/sys/decklink/gstdecklinkvideosink.cpp b/sys/decklink/gstdecklinkvideosink.cpp
+index eebeff3..da6e486 100644
+--- a/sys/decklink/gstdecklinkvideosink.cpp
++++ b/sys/decklink/gstdecklinkvideosink.cpp
+@@ -158,7 +158,7 @@ reset_framerate (GstCapsFeatures * features, GstStructure * structure,
+ 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;
+ }
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/fix-maybe-uninitialized-warnings-when-compiling-with-Os.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.6.3.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.6.3.bb
new file mode 100644
index 000000000..8eb47c265
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.6.3.bb
@@ -0,0 +1,28 @@
+include gstreamer1.0-plugins-bad.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=73a5855a8119deb017f5f13cf327095d \
+ file://COPYING.LIB;md5=21682e4e8fea52413fd26c60acb907e5 \
+ file://gst/tta/crc32.h;beginline=12;endline=29;md5=27db269c575d1e5317fffca2d33b3b50 \
+ file://gst/tta/filters.h;beginline=12;endline=29;md5=8a08270656f2f8ad7bb3655b83138e5a"
+
+# Note: The mpg123 plugin was moved to gst-plugins-ugly prior to the 1.7.2
+# release, so this line should be removed during the update to 1.8.x
+# https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=08d8aefcdaaf89ecb6dd53ec1e4f95cd42d01664
+PACKAGECONFIG[mpg123] = "--enable-mpg123,--disable-mpg123,mpg123"
+
+# Note: The gsettings plug-in was dropped prior to the 1.7.2 release,
+# so this line should be removed during the update to 1.8.x
+# https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=914291808ad10621d6a74031f3d46d45eef5a3a3
+EXTRA_OECONF += "--disable-gsettings"
+
+SRC_URI = " \
+ http://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-${PV}.tar.xz \
+ file://configure-allow-to-disable-libssh2.patch \
+ file://0001-glimagesink-Downrank-to-marginal.patch \
+ file://0002-glplugin-glwindow-fix-memory-leak-of-navigation-thre.patch \
+"
+
+SRC_URI[md5sum] = "4857adcafe41e4b9b8805cf88303bd55"
+SRC_URI[sha256sum] = "971b29101d6a9c5e3fe94d99d977a227f58f0b2d29b6ca2c7f292052542b3a61"
+
+S = "${WORKDIR}/gst-plugins-bad-${PV}"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_git.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_git.bb
new file mode 100644
index 000000000..ef6581b2a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_git.bb
@@ -0,0 +1,65 @@
+DEFAULT_PREFERENCE = "-1"
+
+include gstreamer1.0-plugins-bad.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=73a5855a8119deb017f5f13cf327095d \
+ file://COPYING.LIB;md5=21682e4e8fea52413fd26c60acb907e5 \
+ file://gst/tta/crc32.h;beginline=12;endline=29;md5=27db269c575d1e5317fffca2d33b3b50 \
+ file://gst/tta/filters.h;beginline=12;endline=29;md5=8a08270656f2f8ad7bb3655b83138e5a"
+
+SRC_URI = " \
+ git://anongit.freedesktop.org/gstreamer/gst-plugins-bad;name=base \
+ git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \
+ 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 \
+"
+
+PV = "1.7.2+git${SRCPV}"
+
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
+
+SRCREV_base = "50ae46cc0f8827bf966920d9c221e5cf86e811ba"
+SRCREV_common = "a25397448942079002622be231e9ec49b985745a"
+SRCREV_FORMAT = "base"
+
+S = "${WORKDIR}/git"
+
+# over-ride the default hls PACKAGECONFIG in gstreamer1.0-plugins-bad.inc to
+# pass an additional --with-hls-crypto=XXX option (new in 1.7.x) and switch HLS
+# AES decryption from nettle to openssl (ie a shared dependency with dtls).
+# This should move back to the common .inc once the main recipe updates to 1.8.x
+PACKAGECONFIG[hls] = "--enable-hls --with-hls-crypto=openssl,--disable-hls,openssl"
+
+# The tinyalsa plugin was added prior to the 1.7.2 release
+# https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=c8bd74fa9a81398f57d976c478d2043f30188684
+PACKAGECONFIG[tinyalsa] = "--enable-tinyalsa,--disable-tinyalsa,tinyalsa"
+
+# The vulkan based video sink plugin was added prior to the 1.7.2 release
+# https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=5de6dd9f40629562acf90e35e1fa58464d66617d
+PACKAGECONFIG[vulkan] = "--enable-vulkan,--disable-vulkan,libxcb"
+
+# The dependency-less netsim plugin was added prior to the 1.7.2 release
+# https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=e3f9e854f08e82bfab11182c5a2aa6f9a0c73cd5
+EXTRA_OECONF += " \
+ --enable-netsim \
+"
+
+do_configure_prepend() {
+ ${S}/autogen.sh --noconfigure
+}
+
+# In 1.6.2, the "--enable-hls" configure option generated an installable package
+# called "gstreamer1.0-plugins-bad-fragmented". In 1.7.1 that HLS plugin package
+# has become "gstreamer1.0-plugins-bad-hls". See:
+# http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=efe62292a3d045126654d93239fdf4cc8e48ae08
+
+PACKAGESPLITFUNCS_append = " handle_hls_rename "
+
+python handle_hls_rename () {
+ d.setVar('RPROVIDES_gstreamer1.0-plugins-bad-hls', 'gstreamer1.0-plugins-bad-fragmented')
+ d.setVar('RREPLACES_gstreamer1.0-plugins-bad-hls', 'gstreamer1.0-plugins-bad-fragmented')
+ d.setVar('RCONFLICTS_gstreamer1.0-plugins-bad-hls', 'gstreamer1.0-plugins-bad-fragmented')
+}
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base.inc b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base.inc
new file mode 100644
index 000000000..7381458f4
--- /dev/null
+++ b/import-layers/yocto-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.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
+ gio-unix-2.0 ivorbis 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[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/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch b/import-layers/yocto-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..781e4d801
--- /dev/null
+++ b/import-layers/yocto-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
+@@ -37,7 +37,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
+@@ -52,7 +52,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
+@@ -106,7 +106,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
+@@ -64,7 +64,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
+@@ -94,7 +94,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
+@@ -64,7 +64,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
+@@ -71,7 +71,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
+@@ -31,7 +31,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
+@@ -44,7 +44,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
+@@ -113,7 +113,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/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-Makefile.am-prefix-calls-to-pkg-config-with-PKG_CONF.patch b/import-layers/yocto-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..85fcacb55
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-Makefile.am-prefix-calls-to-pkg-config-with-PKG_CONF.patch
@@ -0,0 +1,298 @@
+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(-)
+
+diff --git a/gst-libs/gst/allocators/Makefile.am b/gst-libs/gst/allocators/Makefile.am
+index bc7f53a..0ef5f86 100644
+--- a/gst-libs/gst/allocators/Makefile.am
++++ b/gst-libs/gst/allocators/Makefile.am
+@@ -34,7 +34,7 @@ GstAllocators-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstallocators-@
+ --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)" \
+@@ -58,7 +58,7 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
+ $(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)
+diff --git a/gst-libs/gst/app/Makefile.am b/gst-libs/gst/app/Makefile.am
+index dcc2fe0..dc076cb 100644
+--- a/gst-libs/gst/app/Makefile.am
++++ b/gst-libs/gst/app/Makefile.am
+@@ -47,8 +47,8 @@ GstApp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstapp-@GST_API_VERSIO
+ --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@ \
+diff --git a/gst-libs/gst/audio/Makefile.am b/gst-libs/gst/audio/Makefile.am
+index 2374196..295eb42 100644
+--- a/gst-libs/gst/audio/Makefile.am
++++ b/gst-libs/gst/audio/Makefile.am
+@@ -96,12 +96,12 @@ GstAudio-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstaudio-@GST_API_VE
+ -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@ \
+@@ -130,8 +130,8 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
+ --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)
+diff --git a/gst-libs/gst/fft/Makefile.am b/gst-libs/gst/fft/Makefile.am
+index f545354..1bb6243 100644
+--- a/gst-libs/gst/fft/Makefile.am
++++ b/gst-libs/gst/fft/Makefile.am
+@@ -61,7 +61,7 @@ GstFft-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstfft-@GST_API_VERSIO
+ --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)" \
+@@ -85,7 +85,7 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
+ $(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)
+diff --git a/gst-libs/gst/pbutils/Makefile.am b/gst-libs/gst/pbutils/Makefile.am
+index 91dc214..dc8e1d3 100644
+--- a/gst-libs/gst/pbutils/Makefile.am
++++ b/gst-libs/gst/pbutils/Makefile.am
+@@ -79,14 +79,14 @@ GstPbutils-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstpbutils-@GST_AP
+ --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/" \
+@@ -119,8 +119,8 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
+ $(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/" \
+diff --git a/gst-libs/gst/riff/Makefile.am b/gst-libs/gst/riff/Makefile.am
+index 3bd8fc0..0a115cc 100644
+--- a/gst-libs/gst/riff/Makefile.am
++++ b/gst-libs/gst/riff/Makefile.am
+@@ -41,8 +41,8 @@ libgstriff_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_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@ \
+@@ -73,8 +73,8 @@ libgstriff_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_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)
+diff --git a/gst-libs/gst/rtp/Makefile.am b/gst-libs/gst/rtp/Makefile.am
+index f5445c1..527c0b4 100644
+--- a/gst-libs/gst/rtp/Makefile.am
++++ b/gst-libs/gst/rtp/Makefile.am
+@@ -59,8 +59,8 @@ GstRtp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstrtp-@GST_API_VERSIO
+ --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@ \
+@@ -87,8 +87,8 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
+ $(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/gst-libs/gst/rtsp/Makefile.am b/gst-libs/gst/rtsp/Makefile.am
+index 9b0b258..4f6d9f8 100644
+--- a/gst-libs/gst/rtsp/Makefile.am
++++ b/gst-libs/gst/rtsp/Makefile.am
+@@ -66,7 +66,7 @@ GstRtsp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstrtsp-@GST_API_VERS
+ -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@ \
+@@ -96,7 +96,7 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
+ --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)
+diff --git a/gst-libs/gst/sdp/Makefile.am b/gst-libs/gst/sdp/Makefile.am
+index 0e149b8..9aa0512 100644
+--- a/gst-libs/gst/sdp/Makefile.am
++++ b/gst-libs/gst/sdp/Makefile.am
+@@ -28,7 +28,7 @@ GstSdp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstsdp-@GST_API_VERSIO
+ --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)" \
+@@ -52,7 +52,7 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
+ $(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)
+diff --git a/gst-libs/gst/tag/Makefile.am b/gst-libs/gst/tag/Makefile.am
+index cafafd3..ba99279 100644
+--- a/gst-libs/gst/tag/Makefile.am
++++ b/gst-libs/gst/tag/Makefile.am
+@@ -39,8 +39,8 @@ GstTag-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgsttag-@GST_API_VERSIO
+ --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@ \
+@@ -67,8 +67,8 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
+ $(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/gst-libs/gst/video/Makefile.am b/gst-libs/gst/video/Makefile.am
+index ac64eb3..342c8c6 100644
+--- a/gst-libs/gst/video/Makefile.am
++++ b/gst-libs/gst/video/Makefile.am
+@@ -108,8 +108,8 @@ GstVideo-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstvideo-@GST_API_VE
+ --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@ \
+@@ -136,8 +136,8 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
+ $(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)
+--
+2.6.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-riff-add-missing-include-directories-when-calling-in.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-ssaparse-enhance-SSA-text-lines-parsing.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0004-rtsp-drop-incorrect-reference-to-gstreamer-sdp-in-Ma.patch b/import-layers/yocto-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..42d99c1db
--- /dev/null
+++ b/import-layers/yocto-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
+@@ -74,7 +74,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/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0004-subparse-set-need_segment-after-sink-pad-received-GS.patch b/import-layers/yocto-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..7813915d8
--- /dev/null
+++ b/import-layers/yocto-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");
+ }
+
+@@ -1632,8 +1630,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/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0005-convertframe-Support-video-crop-when-convert-frame.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0005-convertframe-Support-video-crop-when-convert-frame.patch
new file mode 100755
index 000000000..096a6f4cb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0005-convertframe-Support-video-crop-when-convert-frame.patch
@@ -0,0 +1,143 @@
+From 5be6ed00aad028d9cbb4e0c63af0be69d335c71e Mon Sep 17 00:00:00 2001
+From: Song Bing <b06498@freescale.com>
+Date: Fri, 11 Dec 2015 21:42:00 +0800
+Subject: [PATCH] convertframe: Support video crop when convert frame
+
+Get thumbnail will user convertframe to convert video frame to
+desired video format and size. But haven't process crop meta on
+the video buffer. Add support video crop.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=759329
+
+Upstream-Status: Backport [1.7.1]
+
+---
+ gst-libs/gst/video/convertframe.c | 65 +++++++++++++++++++++++++++++++++------
+ 1 file changed, 56 insertions(+), 9 deletions(-)
+
+diff --git a/gst-libs/gst/video/convertframe.c b/gst-libs/gst/video/convertframe.c
+index aa9c3d3..942a51e 100644
+--- a/gst-libs/gst/video/convertframe.c
++++ b/gst-libs/gst/video/convertframe.c
+@@ -110,12 +110,23 @@ fail:
+ static GstElement *
+ build_convert_frame_pipeline (GstElement ** src_element,
+ GstElement ** sink_element, const GstCaps * from_caps,
+- const GstCaps * to_caps, GError ** err)
++ GstVideoCropMeta * cmeta, const GstCaps * to_caps, GError ** err)
+ {
+- GstElement *src = NULL, *csp = NULL, *vscale = NULL;
+- GstElement *sink = NULL, *encoder = NULL, *pipeline;
++ GstElement *vcrop = NULL, *csp = NULL, *csp2 = NULL, *vscale = NULL;
++ GstElement *src = NULL, *sink = NULL, *encoder = NULL, *pipeline;
++ GstVideoInfo info;
+ GError *error = NULL;
+
++ if (cmeta) {
++ if (!create_element ("videocrop", &vcrop, &error)) {
++ g_warning
++ ("build_convert_frame_pipeline: Buffer has crop metadata but videocrop element is not found. Cropping will be disabled");
++ } else {
++ if (!create_element ("videoconvert", &csp2, &error))
++ goto no_elements;
++ }
++ }
++
+ /* videoscale is here to correct for the pixel-aspect-ratio for us */
+ GST_DEBUG ("creating elements");
+ if (!create_element ("appsrc", &src, &error) ||
+@@ -133,15 +144,42 @@ build_convert_frame_pipeline (GstElement ** src_element,
+
+ GST_DEBUG ("adding elements");
+ gst_bin_add_many (GST_BIN (pipeline), src, csp, vscale, sink, NULL);
++ if (vcrop)
++ gst_bin_add_many (GST_BIN (pipeline), vcrop, csp2, NULL);
+
+ /* set caps */
+ g_object_set (src, "caps", from_caps, NULL);
++ if (vcrop) {
++ gst_video_info_from_caps (&info, from_caps);
++ g_object_set (vcrop, "left", cmeta->x, NULL);
++ g_object_set (vcrop, "top", cmeta->y, NULL);
++ g_object_set (vcrop, "right", GST_VIDEO_INFO_WIDTH (&info) - cmeta->width,
++ NULL);
++ g_object_set (vcrop, "bottom",
++ GST_VIDEO_INFO_HEIGHT (&info) - cmeta->height, NULL);
++ GST_DEBUG ("crop meta [x,y,width,height]: %d %d %d %d", cmeta->x, cmeta->y,
++ cmeta->width, cmeta->height);
++ }
+ g_object_set (sink, "caps", to_caps, NULL);
+
+ /* FIXME: linking is still way too expensive, profile this properly */
+- GST_DEBUG ("linking src->csp");
+- if (!gst_element_link_pads (src, "src", csp, "sink"))
+- goto link_failed;
++ if (vcrop) {
++ GST_DEBUG ("linking src->csp2");
++ if (!gst_element_link_pads (src, "src", csp2, "sink"))
++ goto link_failed;
++
++ GST_DEBUG ("linking csp2->vcrop");
++ if (!gst_element_link_pads (csp2, "src", vcrop, "sink"))
++ goto link_failed;
++
++ GST_DEBUG ("linking vcrop->csp");
++ if (!gst_element_link_pads (vcrop, "src", csp, "sink"))
++ goto link_failed;
++ } else {
++ GST_DEBUG ("linking src->csp");
++ if (!gst_element_link_pads (src, "src", csp, "sink"))
++ goto link_failed;
++ }
+
+ GST_DEBUG ("linking csp->vscale");
+ if (!gst_element_link_pads_full (csp, "src", vscale, "sink",
+@@ -193,8 +231,12 @@ no_elements:
+ {
+ if (src)
+ gst_object_unref (src);
++ if (vcrop)
++ gst_object_unref (vcrop);
+ if (csp)
+ gst_object_unref (csp);
++ if (csp2)
++ gst_object_unref (csp2);
+ if (vscale)
+ gst_object_unref (vscale);
+ if (sink)
+@@ -209,7 +251,11 @@ no_elements:
+ no_pipeline:
+ {
+ gst_object_unref (src);
++ if (vcrop)
++ gst_object_unref (vcrop);
+ gst_object_unref (csp);
++ if (csp2)
++ gst_object_unref (csp2);
+ gst_object_unref (vscale);
+ gst_object_unref (sink);
+
+@@ -282,7 +328,8 @@ gst_video_convert_sample (GstSample * sample, const GstCaps * to_caps,
+ }
+
+ pipeline =
+- build_convert_frame_pipeline (&src, &sink, from_caps, to_caps_copy, &err);
++ build_convert_frame_pipeline (&src, &sink, from_caps,
++ gst_buffer_get_video_crop_meta (buf), to_caps_copy, &err);
+ if (!pipeline)
+ goto no_pipeline;
+
+@@ -646,8 +693,8 @@ gst_video_convert_sample_async (GstSample * sample,
+ }
+
+ pipeline =
+- build_convert_frame_pipeline (&src, &sink, from_caps, to_caps_copy,
+- &error);
++ build_convert_frame_pipeline (&src, &sink, from_caps,
++ gst_buffer_get_video_crop_meta (buf), to_caps_copy, &error);
+ if (!pipeline)
+ goto no_pipeline;
+
+--
+2.5.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/encodebin-Need-more-buffers-in-output-queue-for-bett.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/encodebin-Need-more-buffers-in-output-queue-for-bett.patch
new file mode 100644
index 000000000..325671721
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/encodebin-Need-more-buffers-in-output-queue-for-bett.patch
@@ -0,0 +1,32 @@
+From 540e02c92c75e08b90326863dc787fa5cadf9da6 Mon Sep 17 00:00:00 2001
+From: Song Bing <b06498@freescale.com>
+Date: Fri, 13 Mar 2015 18:04:31 +0800
+Subject: [PATCH] encodebin: Need more buffers in output queue for better
+ performance
+
+Need more buffers in output queue for better performance
+
+Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=744191]
+
+Signed-off-by: Song Bing <b06498@freescale.com>
+---
+ gst/encoding/gstencodebin.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/gst/encoding/gstencodebin.c b/gst/encoding/gstencodebin.c
+index 6728e58..32daae4 100644
+--- a/gst/encoding/gstencodebin.c
++++ b/gst/encoding/gstencodebin.c
+@@ -1138,8 +1138,7 @@ _create_stream_group (GstEncodeBin * ebin, GstEncodingProfile * sprof,
+ * We only use a 1buffer long queue here, the actual queueing will be done
+ * in the input queue */
+ last = sgroup->outqueue = gst_element_factory_make ("queue", NULL);
+- g_object_set (sgroup->outqueue, "max-size-buffers", (guint32) 1,
+- "max-size-bytes", (guint32) 0, "max-size-time", (guint64) 0,
++ g_object_set (sgroup->outqueue, "max-size-time", (guint64) 0,
+ "silent", TRUE, NULL);
+
+ gst_bin_add (GST_BIN (ebin), sgroup->outqueue);
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/get-caps-from-src-pad-when-query-caps.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/get-caps-from-src-pad-when-query-caps.patch
new file mode 100644
index 000000000..284abbe94
--- /dev/null
+++ b/import-layers/yocto-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
+@@ -1708,6 +1708,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/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/make-gio_unix_2_0-dependency-configurable.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/make-gio_unix_2_0-dependency-configurable.patch
new file mode 100644
index 000000000..01e944ddd
--- /dev/null
+++ b/import-layers/yocto-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
+@@ -747,9 +747,16 @@ AC_SUBST(FT2_CFLAGS)
+ AC_SUBST(FT2_LIBS)
+
+ 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/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.6.3.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.6.3.bb
new file mode 100644
index 000000000..429dc9338
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.6.3.bb
@@ -0,0 +1,25 @@
+include 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"
+
+# Note: The dependency on freetype was dropped shortly after the 1.7.1 release
+# so these lines should be removed during the update to 1.8.x
+# http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=183610c035dd6955c9b3540b940aec50474af031
+DEPENDS += "freetype"
+EXTRA_OECONF += "--disable-freetypetest"
+
+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://encodebin-Need-more-buffers-in-output-queue-for-bett.patch \
+ file://0005-convertframe-Support-video-crop-when-convert-frame.patch \
+"
+
+SRC_URI[md5sum] = "3ddde0ad598ef69f58d6a2e87f8b460f"
+SRC_URI[sha256sum] = "b6154f8fdba4877e95efd94610ef0ada4f0171cd12eb829a3c3c97345d9c7a75"
+
+S = "${WORKDIR}/gst-plugins-base-${PV}"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_git.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_git.bb
new file mode 100644
index 000000000..38a9fcc29
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_git.bb
@@ -0,0 +1,27 @@
+DEFAULT_PREFERENCE = "-1"
+
+include 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 = " \
+ git://anongit.freedesktop.org/gstreamer/gst-plugins-base;name=base \
+ git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \
+ file://make-gio_unix_2_0-dependency-configurable.patch \
+"
+
+PV = "1.7.2+git${SRCPV}"
+
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
+
+SRCREV_base = "97e108bebaa58821f4566a74cbf0135e93407c01"
+SRCREV_common = "b64f03f6090245624608beb5d2fff335e23a01c0"
+SRCREV_FORMAT = "base"
+
+S = "${WORKDIR}/git"
+
+do_configure_prepend() {
+ ${S}/autogen.sh --noconfigure
+}
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good.inc b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good.inc
new file mode 100644
index 000000000..4621bf894
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good.inc
@@ -0,0 +1,53 @@
+require gstreamer1.0-plugins.inc
+
+LICENSE = "GPLv2+ & LGPLv2.1+"
+
+DEPENDS += "gstreamer1.0-plugins-base libcap zlib bzip2"
+
+inherit gettext
+
+PACKAGECONFIG ??= " \
+ ${GSTREAMER_ORC} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '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,libv4l2"
+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,--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/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-gstrtpmp4gpay-set-dafault-value-for-MPEG4-without-co.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-gstrtpmp4gpay-set-dafault-value-for-MPEG4-without-co.patch
new file mode 100755
index 000000000..d1973d439
--- /dev/null
+++ b/import-layers/yocto-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
+@@ -390,6 +390,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);
+
+@@ -400,7 +401,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");
+@@ -426,6 +426,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/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/avoid-including-sys-poll.h-directly.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/ensure-valid-sentinel-for-gst_structure_get.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.6.3.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.6.3.bb
new file mode 100644
index 000000000..0b4f43690
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.6.3.bb
@@ -0,0 +1,15 @@
+include 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 \
+"
+
+SRC_URI[md5sum] = "a1958df7aa498b42793e2f2048673815"
+SRC_URI[sha256sum] = "24b19db70b2a83461ebddfe20033db432dadfdb5d4b54ffb1dfa0d830134a177"
+
+S = "${WORKDIR}/gst-plugins-good-${PV}"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_git.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_git.bb
new file mode 100644
index 000000000..9cadc9afc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_git.bb
@@ -0,0 +1,28 @@
+DEFAULT_PREFERENCE = "-1"
+
+include 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 = " \
+ git://anongit.freedesktop.org/gstreamer/gst-plugins-good;name=base \
+ git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \
+ file://avoid-including-sys-poll.h-directly.patch \
+ file://ensure-valid-sentinel-for-gst_structure_get.patch \
+"
+
+PV = "1.7.2+git${SRCPV}"
+
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
+
+SRCREV_base = "1b6fdce67c15d59957e395b1957aa625322092d4"
+SRCREV_common = "b64f03f6090245624608beb5d2fff335e23a01c0"
+SRCREV_FORMAT = "base"
+
+S = "${WORKDIR}/git"
+
+do_configure_prepend() {
+ ${S}/autogen.sh --noconfigure
+}
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly.inc b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly.inc
new file mode 100644
index 000000000..aff223072
--- /dev/null
+++ b/import-layers/yocto-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 mad 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[mad] = "--enable-mad,--disable-mad,libmad"
+PACKAGECONFIG[mpeg2dec] = "--enable-mpeg2dec,--disable-mpeg2dec,mpeg2dec"
+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/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.6.3.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.6.3.bb
new file mode 100644
index 000000000..7edfb81d2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.6.3.bb
@@ -0,0 +1,13 @@
+include 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 \
+"
+
+SRC_URI[md5sum] = "dbd92afb3816cbfa90ab1f197144a2e2"
+SRC_URI[sha256sum] = "2fecf7b7c7882f8f62f1900048f4013f98c214fb3d3303d8d812245bb41fd064"
+
+S = "${WORKDIR}/gst-plugins-ugly-${PV}"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_git.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_git.bb
new file mode 100644
index 000000000..69afe4cfb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_git.bb
@@ -0,0 +1,41 @@
+DEFAULT_PREFERENCE = "-1"
+
+include 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 = " \
+ git://anongit.freedesktop.org/gstreamer/gst-plugins-ugly;name=base \
+ git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \
+"
+
+PV = "1.7.2+git${SRCPV}"
+
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
+
+SRCREV_base = "8bdb68edbc605e21314b608e7a39bdbaab7302b8"
+SRCREV_common = "b64f03f6090245624608beb5d2fff335e23a01c0"
+SRCREV_FORMAT = "base"
+
+S = "${WORKDIR}/git"
+
+# The mpg123 plugin was added prior to the 1.7.2 release
+# https://cgit.freedesktop.org/gstreamer/gst-plugins-ugly/commit/?id=43bd45ba991ef3247957ca37cdcb52f4b8c0acb1
+PACKAGECONFIG[mpg123] = "--enable-mpg123,--disable-mpg123,mpg123"
+
+do_configure_prepend() {
+ ${S}/autogen.sh --noconfigure
+}
+
+# In 1.7.2, the mpg123 plugin was moved from -bad to -ugly
+# https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=08d8aefcdaaf89ecb6dd53ec1e4f95cd42d01664
+# https://cgit.freedesktop.org/gstreamer/gst-plugins-ugly/commit/?id=43bd45ba991ef3247957ca37cdcb52f4b8c0acb1
+
+PACKAGESPLITFUNCS_append = " handle_mpg123_rename "
+
+python handle_mpg123_rename () {
+ d.setVar('RPROVIDES_gstreamer1.0-plugins-ugly-mpg123', 'gstreamer1.0-plugins-bad-mpg123')
+ d.setVar('RREPLACES_gstreamer1.0-plugins-ugly-mpg123', 'gstreamer1.0-plugins-bad-mpg123')
+ d.setVar('RCONFLICTS_gstreamer1.0-plugins-ugly-mpg123', 'gstreamer1.0-plugins-bad-mpg123')
+}
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins.inc b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins.inc
new file mode 100644
index 000000000..2dcec509d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins.inc
@@ -0,0 +1,40 @@
+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"
+
+inherit autotools pkgconfig upstream-version-is-even gobject-introspection
+
+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 \
+"
+
+SRC_URI_append = " file://0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch"
+
+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"
+
+PACKAGES_DYNAMIC = "^${PN}-.*"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server.inc b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server.inc
new file mode 100644
index 000000000..ae6d36477
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server.inc
@@ -0,0 +1,24 @@
+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 libcgroup 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"
+
+S = "${WORKDIR}/${PNREAL}-${PV}"
+
+inherit autotools pkgconfig upstream-version-is-even gobject-introspection
+
+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/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server/0001-Don-t-hardcode-libtool-name-when-using-introspection.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.6.2.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.6.2.bb
new file mode 100644
index 000000000..5bdae6cf9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.6.2.bb
@@ -0,0 +1,6 @@
+include gstreamer1.0-rtsp-server.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=6762ed442b3822387a51c92d928ead0d"
+
+SRC_URI[md5sum] = "a1cafefb5fc14ac5d7e7d8cdbdfa9694"
+SRC_URI[sha256sum] = "0f51f9879556c0950203c766b09a1b62f1f25b17f9a7d516e01b13ecf93c8858"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0.inc b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0.inc
new file mode 100644
index 000000000..10b4668e5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0.inc
@@ -0,0 +1,58 @@
+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
+
+# 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 \
+"
+
+PACKAGECONFIG ??= ""
+
+PACKAGECONFIG[check] = "--enable-check,--disable-check"
+PACKAGECONFIG[debug] = "--enable-debug,--disable-debug"
+PACKAGECONFIG[tests] = "--enable-tests,--disable-tests"
+PACKAGECONFIG[valgrind] = "--enable-valgrind,--disable-valgrind,valgrind,"
+
+EXTRA_OECONF = " \
+ --disable-dependency-tracking \
+ --disable-docbook \
+ --disable-examples \
+ --disable-gtk-doc \
+"
+
+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
+}
+
+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/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-Fix-crash-with-gst-inspect.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-Fix-crash-with-gst-inspect.patch
new file mode 100644
index 000000000..94f5cc56e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-Fix-crash-with-gst-inspect.patch
@@ -0,0 +1,28 @@
+From 6b26f3dbf9bf577d71534ab7410de66d06e46ba2 Mon Sep 17 00:00:00 2001
+From: Carlos Rafael Giani <dv@pseudoterminal.org>
+Date: Sat, 6 Apr 2013 23:52:11 +0200
+Subject: [PATCH] Fix crash with gst-inspect Chris Lord <chris@openedhand.com>
+
+Upstream-Status: Pending
+
+Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
+---
+ tools/gst-inspect.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/gst-inspect.c b/tools/gst-inspect.c
+index 23b7c44..b79b02e 100644
+--- a/tools/gst-inspect.c
++++ b/tools/gst-inspect.c
+@@ -1556,7 +1556,7 @@ main (int argc, char *argv[])
+ g_option_context_add_main_entries (ctx, options, GETTEXT_PACKAGE);
+ g_option_context_add_group (ctx, gst_init_get_option_group ());
+ if (!g_option_context_parse (ctx, &argc, &argv, &err)) {
+- g_printerr ("Error initializing: %s\n", err->message);
++ g_printerr ("Error initializing: %s\n", err ? err->message : "(null)");
+ return -1;
+ }
+ g_option_context_free (ctx);
+--
+1.8.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.6.3.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.6.3.bb
new file mode 100644
index 000000000..ba1b83b08
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.6.3.bb
@@ -0,0 +1,14 @@
+include 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 \
+ file://0001-Fix-crash-with-gst-inspect.patch \
+"
+
+SRC_URI[md5sum] = "b4cdeb2b9cb20dd6ac022a4f417eae0d"
+SRC_URI[sha256sum] = "22f9568d67b87cf700a111f381144bd37cb93790a77e4e331db01fe854a37f24"
+
+S = "${WORKDIR}/gstreamer-${PV}"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0_git.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0_git.bb
new file mode 100644
index 000000000..7715bb202
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0_git.bb
@@ -0,0 +1,30 @@
+DEFAULT_PREFERENCE = "-1"
+
+include gstreamer1.0.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=6762ed442b3822387a51c92d928ead0d \
+ file://gst/gst.h;beginline=1;endline=21;md5=e059138481205ee2c6fc1c079c016d0d"
+
+SRC_URI = " \
+ git://anongit.freedesktop.org/gstreamer/gstreamer;name=base \
+ git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \
+"
+
+PV = "1.7.2+git${SRCPV}"
+
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
+
+SRCREV_base = "9e33bfa2c7a5f43da2c49b0a8235fd43cba9feaf"
+SRCREV_common = "b64f03f6090245624608beb5d2fff335e23a01c0"
+SRCREV_FORMAT = "base"
+
+S = "${WORKDIR}/git"
+
+# The option to configure tracer hooks was added prior to the 1.7.2 release
+# https://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=e5ca47236e4df4683707f0bcf99181a937d358d5
+PACKAGECONFIG[gst-tracer-hooks] = "--enable-gst-tracer-hooks,--disable-gst-tracer-hooks,"
+PACKAGECONFIG[trace-historic] = "--enable-trace,--disable-trace,"
+
+do_configure_prepend() {
+ ${S}/autogen.sh --noconfigure
+}
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/lame/lame/lame-3.99.5_fix_for_automake-1.12.x.patch b/import-layers/yocto-poky/meta/recipes-multimedia/lame/lame/lame-3.99.5_fix_for_automake-1.12.x.patch
new file mode 100644
index 000000000..571a1d07a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/lame/lame/lame-3.99.5_fix_for_automake-1.12.x.patch
@@ -0,0 +1,59 @@
+Upstream-Status: Pending
+
+Fix this kind of errors with automake 1.12.x:
+| doc/man/Makefile.am:3: error: automatic de-ANSI-fication support has been removed
+| autoreconf: automake failed with exit status: 1
+
+Signed-Off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/07/13
+
+Index: lame-3.99.5/configure.in
+===================================================================
+--- lame-3.99.5.orig/configure.in
++++ lame-3.99.5/configure.in
+@@ -77,9 +77,6 @@ if test "${GCC}" = "yes"; then
+ AC_MSG_RESULT(${GCC_version})
+ fi
+
+-dnl more automake stuff
+-AM_C_PROTOTYPES
+-
+ AC_CHECK_HEADER(dmalloc.h)
+ if test "${ac_cv_header_dmalloc_h}" = "yes"; then
+ AM_WITH_DMALLOC
+Index: lame-3.99.5/doc/html/Makefile.am
+===================================================================
+--- lame-3.99.5.orig/doc/html/Makefile.am
++++ lame-3.99.5/doc/html/Makefile.am
+@@ -1,6 +1,6 @@
+ ## $Id: Makefile.am,v 1.7 2010/09/30 20:58:40 jaz001 Exp $
+
+-AUTOMAKE_OPTIONS = foreign ansi2knr
++AUTOMAKE_OPTIONS = foreign
+
+ docdir = $(datadir)/doc
+ pkgdocdir = $(docdir)/$(PACKAGE)
+Index: lame-3.99.5/libmp3lame/i386/Makefile.am
+===================================================================
+--- lame-3.99.5.orig/libmp3lame/i386/Makefile.am
++++ lame-3.99.5/libmp3lame/i386/Makefile.am
+@@ -1,6 +1,6 @@
+ ## $Id: Makefile.am,v 1.26 2011/04/04 09:42:34 aleidinger Exp $
+
+-AUTOMAKE_OPTIONS = foreign $(top_srcdir)/ansi2knr
++AUTOMAKE_OPTIONS = foreign
+
+ DEFS = @DEFS@ @CONFIG_DEFS@
+
+Index: lame-3.99.5/doc/man/Makefile.am
+===================================================================
+--- lame-3.99.5.orig/doc/man/Makefile.am
++++ lame-3.99.5/doc/man/Makefile.am
+@@ -1,6 +1,6 @@
+ ## $Id: Makefile.am,v 1.1 2000/10/22 11:39:44 aleidinger Exp $
+
+-AUTOMAKE_OPTIONS = foreign ansi2knr
++AUTOMAKE_OPTIONS = foreign
+
+ man_MANS = lame.1
+ EXTRA_DIST = ${man_MANS}
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/lame/lame/no-gtk1.patch b/import-layers/yocto-poky/meta/recipes-multimedia/lame/lame/no-gtk1.patch
new file mode 100644
index 000000000..e88d7f1bb
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-multimedia/lame/lame_3.99.5.bb b/import-layers/yocto-poky/meta/recipes-multimedia/lame/lame_3.99.5.bb
new file mode 100644
index 000000000..047761153
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/lame/lame_3.99.5.bb
@@ -0,0 +1,30 @@
+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 \
+"
+PR = "r1"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/lame/lame-${PV}.tar.gz \
+ file://no-gtk1.patch \
+ file://lame-3.99.5_fix_for_automake-1.12.x.patch "
+
+SRC_URI[md5sum] = "84835b313d4a8b68f5349816d33e07ce"
+SRC_URI[sha256sum] = "24346b4158e4af3bd9f2e194bb23eb473c75fb7377011523353196b19b9a23ff"
+
+inherit autotools pkgconfig
+
+PACKAGES += "libmp3lame libmp3lame-dev"
+FILES_${PN} = "${bindir}/lame"
+FILES_libmp3lame = "${libdir}/libmp3lame.so.*"
+FILES_libmp3lame-dev = "${includedir} ${libdir}/*"
+FILES_${PN}-dev = ""
+
+CACHED_CONFIGUREVARS_append_x86 = " ac_cv_header_emmintrin_h=no ac_cv_header_xmmintrin_h=no"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/liba52/liba52/buildcleanup.patch b/import-layers/yocto-poky/meta/recipes-multimedia/liba52/liba52/buildcleanup.patch
new file mode 100644
index 000000000..5168100f3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-multimedia/liba52/liba52_0.7.4.bb b/import-layers/yocto-poky/meta/recipes-multimedia/liba52/liba52_0.7.4.bb
new file mode 100644
index 000000000..8ff8889b6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-multimedia/libid3tag/libid3tag/addpkgconfig.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libid3tag/libid3tag/addpkgconfig.patch
new file mode 100644
index 000000000..38d40c363
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-multimedia/libid3tag/libid3tag/obsolete_automake_macros.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libid3tag/libid3tag/obsolete_automake_macros.patch
new file mode 100644
index 000000000..2845fb1d3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-multimedia/libid3tag/libid3tag_0.15.1b.bb b/import-layers/yocto-poky/meta/recipes-multimedia/libid3tag/libid3tag_0.15.1b.bb
new file mode 100644
index 000000000..05a8a4763
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libid3tag/libid3tag_0.15.1b.bb
@@ -0,0 +1,22 @@
+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 = "ftp://ftp.mars.org/pub/mpeg/libid3tag-${PV}.tar.gz \
+ file://addpkgconfig.patch \
+ file://obsolete_automake_macros.patch \
+"
+
+SRC_URI[md5sum] = "e5808ad997ba32c498803822078748c3"
+SRC_URI[sha256sum] = "63da4f6e7997278f8a3fef4c6a372d342f705051d1eeb6a46a86b03610e26151"
+
+S = "${WORKDIR}/libid3tag-${PV}"
+
+inherit autotools pkgconfig
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libmad/libmad/add-pkgconfig.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libmad/libmad/add-pkgconfig.patch
new file mode 100644
index 000000000..b49dc8c98
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libmad/libmad/add-pkgconfig.patch
@@ -0,0 +1,70 @@
+Here is a patch for adding pkg-config support to libmad.
+It would make life a bit easier for distro maintainers if this was applied.
+In case you didn't know, pkg-config is a tool for providing LDFLAGS and
+CFLAGS for packages using shared libraries. It's on freedesktop.org.
+Debian has already been distributing the pkg-config file mad.pc with
+libmad for some time, and people developing on debian (notably xmms2
+developers) have started relying on this support being present, causing
+some confusion for people installing from source and on some BSDs which
+do not provide mad.pc (google: pkgconfig libmad).
+
+EMH
+
+Upstream-Status: Inappropriate [configuration]
+
+--h31gzZEtNLTqOjlF
+Content-Type: text/plain; charset=us-ascii
+Content-Disposition: attachment; filename=&quot;libmad-0.15.1b-pkgconfig.patch&quot;
+
+diff -Naur libmad-0.15.1b.old/configure.ac libmad-0.15.1b/configure.ac
+--- libmad-0.15.1b.old/configure.ac 2004-01-23 10:41:32.000000000 +0100
++++ libmad-0.15.1b/configure.ac 2004-08-07 02:25:24.633462168 +0200
+@@ -429,5 +429,5 @@
+ dnl AC_SUBST(LTLIBOBJS)
+
+ AC_CONFIG_FILES([Makefile msvc++/Makefile \
+- libmad.list])
++ libmad.list mad.pc])
+ AC_OUTPUT
+diff -Naur libmad-0.15.1b.old/mad.pc.in libmad-0.15.1b/mad.pc.in
+--- libmad-0.15.1b.old/mad.pc.in 1970-01-01 01:00:00.000000000 +0100
++++ libmad-0.15.1b/mad.pc.in 2004-08-07 02:04:59.617692872 +0200
+@@ -0,0 +1,14 @@
++# libmad pkg-config source file
++
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++Name: mad
++Description: MPEG Audio Decoder
++Version: @VERSION@
++Requires:
++Conflicts:
++Libs: -L${libdir} -lmad -lm
++Cflags: -I${includedir}
+diff -Naur libmad-0.15.1b.old/Makefile.am libmad-0.15.1b/Makefile.am
+--- libmad-0.15.1b.old/Makefile.am 2004-02-17 03:02:03.000000000 +0100
++++ libmad-0.15.1b/Makefile.am 2004-08-07 02:03:19.859858368 +0200
+@@ -24,6 +24,9 @@
+ SUBDIRS =
+ DIST_SUBDIRS = msvc++
+
++pkgconfigdir = $(libdir)/pkgconfig
++pkgconfig_DATA = mad.pc
++
+ lib_LTLIBRARIES = libmad.la
+ include_HEADERS = mad.h
+
+@@ -34,7 +37,8 @@
+ minimad_LDADD = libmad.la
+
+ EXTRA_DIST = mad.h.sed \
+- CHANGES COPYRIGHT CREDITS README TODO VERSION
++ CHANGES COPYRIGHT CREDITS README TODO VERSION \
++ mad.pc.in
+
+ exported_headers = version.h fixed.h bit.h timer.h stream.h frame.h \
+ synth.h decoder.h
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libmad/libmad/automake-foreign.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libmad/libmad/automake-foreign.patch
new file mode 100644
index 000000000..3e544248d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libmad/libmad/automake-foreign.patch
@@ -0,0 +1,12 @@
+Pass foreign to AM_INIT_AUTOMAKE so it doesn't enforce GNU strictness.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/configure.ac b/configure.ac
+index e602fd3..e075b86 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -29 +29 @@ AC_CONFIG_SRCDIR([decoder.h])
+-AM_INIT_AUTOMAKE
++AM_INIT_AUTOMAKE([foreign])
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libmad/libmad/fix_for_mips_with_gcc-4.5.0.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libmad/libmad/fix_for_mips_with_gcc-4.5.0.patch
new file mode 100644
index 000000000..01c7aa3c8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libmad/libmad/fix_for_mips_with_gcc-4.5.0.patch
@@ -0,0 +1,33 @@
+gcc 4.4 did this: The MIPS port no longer recognizes the h asm constraint. It was necessary to remove this constraint in order to avoid generating unpredictable code sequences.
+
+so the libmad build with gcc-4.5.0 was failing.
+
+Found a solution here:
+
+http://us.generation-nt.com/answer/bug-568418-libmad0-dev-mpg321-compilation-errors-mips-mipsel-architectures-help-169033451.html
+
+Upstream-Status: Pending
+
+2010/07/29
+Nitin A Kamble <nitin.a.kamble@intel.com>
+
+Index: libmad-0.15.1b/fixed.h
+===================================================================
+--- libmad-0.15.1b.orig/fixed.h
++++ libmad-0.15.1b/fixed.h
+@@ -297,6 +297,15 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t
+
+ /* --- MIPS ---------------------------------------------------------------- */
+
++# elif defined(FPM_MIPS) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
++ typedef unsigned int u64_di_t __attribute__ ((mode (DI)));
++# define MAD_F_MLX(hi, lo, x, y) \
++ do { \
++ u64_di_t __ll = (u64_di_t) (x) * (y); \
++ hi = __ll >> 32; \
++ lo = __ll; \
++ } while (0)
++
+ # elif defined(FPM_MIPS)
+
+ /*
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libmad/libmad/no-force-mem.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libmad/libmad/no-force-mem.patch
new file mode 100644
index 000000000..d5e6d206e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libmad/libmad/no-force-mem.patch
@@ -0,0 +1,18 @@
+This option no longer exists in gcc 3.4.1
+
+RP - 18/07/2008
+
+Upstream-Status: Inappropriate [configuration]
+
+Index: libmad-0.15.1b/configure.ac
+===================================================================
+--- libmad-0.15.1b.orig/configure.ac 2008-07-18 15:45:30.000000000 +0100
++++ libmad-0.15.1b/configure.ac 2008-07-18 15:45:37.000000000 +0100
+@@ -140,7 +140,6 @@
+ case "$optimize" in
+ -O|"-O "*)
+ optimize="-O"
+- optimize="$optimize -fforce-mem"
+ optimize="$optimize -fforce-addr"
+ : #x optimize="$optimize -finline-functions"
+ : #- optimize="$optimize -fstrength-reduce"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libmad/libmad/obsolete_automake_macros.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libmad/libmad/obsolete_automake_macros.patch
new file mode 100644
index 000000000..cc87d299e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libmad/libmad/obsolete_automake_macros.patch
@@ -0,0 +1,14 @@
+Upstream-Status: Submitted [https://sourceforge.net/tracker/?group_id=12349&atid=112349]
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+diff -Nurd libmad-0.15.1b/configure.ac libmad-0.15.1b/configure.ac
+--- libmad-0.15.1b/configure.ac 2004-01-23 11:41:32.000000000 +0200
++++ libmad-0.15.1b/configure.ac 2013-01-03 08:28:23.718693697 +0200
+@@ -28,7 +28,7 @@
+
+ AM_INIT_AUTOMAKE
+
+-AM_CONFIG_HEADER([config.h])
++AC_CONFIG_HEADERS([config.h])
+
+ dnl System type.
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libmad/libmad_0.15.1b.bb b/import-layers/yocto-poky/meta/recipes-multimedia/libmad/libmad_0.15.1b.bb
new file mode 100644
index 000000000..d431abdaa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libmad/libmad_0.15.1b.bb
@@ -0,0 +1,36 @@
+SUMMARY = "MPEG Audio Decoder library"
+HOMEPAGE = "http://sourceforge.net/projects/mad/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=12349&atid=112349"
+LICENSE = "GPLv2+"
+LICENSE_FLAGS = "commercial"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://COPYRIGHT;md5=8e55eb14894e782b84488d5a239bc23d \
+ file://version.h;beginline=1;endline=8;md5=aa07311dd39288d4349f28e1de516454"
+SECTION = "libs"
+DEPENDS = "libid3tag"
+PR = "r3"
+
+SRC_URI = "ftp://ftp.mars.org/pub/mpeg/libmad-${PV}.tar.gz \
+ file://no-force-mem.patch \
+ file://add-pkgconfig.patch \
+ file://fix_for_mips_with_gcc-4.5.0.patch \
+ file://obsolete_automake_macros.patch \
+ file://automake-foreign.patch \
+"
+
+SRC_URI[md5sum] = "1be543bc30c56fb6bea1d7bf6a64e66c"
+SRC_URI[sha256sum] = "bbfac3ed6bfbc2823d3775ebb931087371e142bb0e9bb1bee51a76a6e0078690"
+
+S = "${WORKDIR}/libmad-${PV}"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "-enable-speed --enable-shared"
+EXTRA_OECONF_append_arm = " --enable-fpm=arm"
+
+do_configure_prepend () {
+# damn picky automake...
+ touch NEWS AUTHORS ChangeLog
+}
+
+ARM_INSTRUCTION_SET = "arm"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libogg/libogg_1.3.2.bb b/import-layers/yocto-poky/meta/recipes-multimedia/libogg/libogg_1.3.2.bb
new file mode 100644
index 000000000..0142e0f4f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libogg/libogg_1.3.2.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] = "5c3a34309d8b98640827e5d0991a4015"
+SRC_URI[sha256sum] = "3f687ccdd5ac8b52d76328fbbfebc70c459a40ea891dbf3dccb74a210826e79b"
+
+inherit autotools pkgconfig
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/configure-fix.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/configure-fix.patch
new file mode 100644
index 000000000..876e80ef7
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/disable-so-versioning.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/disable-so-versioning.patch
new file mode 100644
index 000000000..f408e4a62
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/dynamicloader-linking.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/dynamicloader-linking.patch
new file mode 100644
index 000000000..787953a99
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/makefile-docdir-fix.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/makefile-docdir-fix.patch
new file mode 100644
index 000000000..dbe8c41f7
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/parallel-make.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/parallel-make.patch
new file mode 100644
index 000000000..483ca1328
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-multimedia/libomxil/libomxil_0.9.3.bb b/import-layers/yocto-poky/meta/recipes-multimedia/libomxil/libomxil_0.9.3.bb
new file mode 100644
index 000000000..d83eb4570
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-multimedia/libpng/libpng_1.6.21.bb b/import-layers/yocto-poky/meta/recipes-multimedia/libpng/libpng_1.6.21.bb
new file mode 100644
index 000000000..58cef1ff3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libpng/libpng_1.6.21.bb
@@ -0,0 +1,25 @@
+SUMMARY = "PNG image format decoding library"
+HOMEPAGE = "http://www.libpng.org/"
+SECTION = "libs"
+LICENSE = "Libpng"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=06a1b6fde6d93170bb72201c8000bf3d \
+ file://png.h;endline=112;md5=9a8b5f83e1e8046df672deab87f235be"
+DEPENDS = "zlib"
+
+SRC_URI = "${GENTOO_MIRROR}/libpng-${PV}.tar.xz \
+ "
+SRC_URI[md5sum] = "3bacb4728f6694a64ad9052769d6a4ce"
+SRC_URI[sha256sum] = "6c8f1849eb9264219bf5d703601e5abe92a58651ecae927a03d1a1aa15ee2083"
+
+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"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libsamplerate/libsamplerate0_0.1.8.bb b/import-layers/yocto-poky/meta/recipes-multimedia/libsamplerate/libsamplerate0_0.1.8.bb
new file mode 100644
index 000000000..1c3768196
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libsamplerate/libsamplerate0_0.1.8.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Audio Sample Rate Conversion library"
+HOMEPAGE = "http://www.mega-nerd.com/SRC/"
+SECTION = "libs"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://src/samplerate.c;beginline=1;endline=17;md5=d0807c35fc906466d24a50463534815a"
+DEPENDS = "flac libsndfile1"
+PR = "r1"
+
+SRC_URI = "http://www.mega-nerd.com/SRC/libsamplerate-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "1c7fb25191b4e6e3628d198a66a84f47"
+SRC_URI[sha256sum] = "93b54bdf46d5e6d2354b7034395fe329c222a966790de34520702bb9642f1c06"
+
+UPSTREAM_CHECK_URI = "http://www.mega-nerd.com/SRC/download.html"
+
+S = "${WORKDIR}/libsamplerate-${PV}"
+
+inherit autotools pkgconfig
+
+PACKAGECONFIG[fftw] = ",--disable-fftw,fftw"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libsndfile/libsndfile1_1.0.26.bb b/import-layers/yocto-poky/meta/recipes-multimedia/libsndfile/libsndfile1_1.0.26.bb
new file mode 100644
index 000000000..80435d4b5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libsndfile/libsndfile1_1.0.26.bb
@@ -0,0 +1,26 @@
+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"
+
+SRC_URI[md5sum] = "ec810a0c60c08772a8a5552704b63393"
+SRC_URI[sha256sum] = "cd6520ec763d1a45573885ecb1f8e4e42505ac12180268482a44b28484a25092"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=e77fe93202736b47c07035910f47974a"
+
+S = "${WORKDIR}/libsndfile-${PV}"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'alsa', '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/import-layers/yocto-poky/meta/recipes-multimedia/libtheora/libtheora-1.1.1/no-docs.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libtheora/libtheora-1.1.1/no-docs.patch
new file mode 100644
index 000000000..359f3d1a7
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-multimedia/libtheora/libtheora_1.1.1.bb b/import-layers/yocto-poky/meta/recipes-multimedia/libtheora/libtheora_1.1.1.bb
new file mode 100644
index 000000000..664d8480a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/libtool2.patch b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/files/libtool2.patch
new file mode 100644
index 000000000..457202eae
--- /dev/null
+++ b/import-layers/yocto-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-3.9.5/configure.ac
+===================================================================
+--- tiff-3.9.5.orig/configure.ac
++++ tiff-3.9.5/configure.ac
+@@ -27,7 +27,7 @@ dnl Process this file with autoconf to p
+ AC_PREREQ(2.64)
+ AC_INIT([LibTIFF Software],[3.9.5],[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/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/tiff_4.0.6.bb b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/tiff_4.0.6.bb
new file mode 100644
index 000000000..e2e24e0fb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libtiff/tiff_4.0.6.bb
@@ -0,0 +1,47 @@
+SUMMARY = "Provides support for the Tag Image File Format (TIFF)"
+LICENSE = "BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=34da3db46fab7501992f9615d7e158cf"
+HOMEPAGE = "http://www.remotesensing.org/libtiff/"
+
+SRC_URI = "ftp://ftp.remotesensing.org/pub/libtiff/tiff-${PV}.tar.gz \
+ file://libtool2.patch \
+ "
+
+SRC_URI[md5sum] = "d1d2e940dea0b5ad435f21f03d96dd72"
+SRC_URI[sha256sum] = "4d57a50907b510e3049a4bba0d7888930fdfc16ce49f1bf693e5b6247370d68c"
+
+# exclude betas
+UPSTREAM_CHECK_REGEX = "tiff-(?P<pver>\d+(\.\d+)+).tar"
+
+inherit autotools
+
+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}/*"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/libvorbis/libvorbis_1.3.5.bb b/import-layers/yocto-poky/meta/recipes-multimedia/libvorbis/libvorbis_1.3.5.bb
new file mode 100644
index 000000000..636e0f307
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/libvorbis/libvorbis_1.3.5.bb
@@ -0,0 +1,17 @@
+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"
+SRC_URI[md5sum] = "28cb28097c07a735d6af56e598e1c90f"
+SRC_URI[sha256sum] = "54f94a9527ff0a88477be0a71c0bab09a4c3febe0ed878b24824906cd4b0e1d1"
+
+inherit autotools pkgconfig
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/mpeg2dec/mpeg2dec-0.4.1/altivec_h_needed.patch b/import-layers/yocto-poky/meta/recipes-multimedia/mpeg2dec/mpeg2dec-0.4.1/altivec_h_needed.patch
new file mode 100644
index 000000000..7dc56436f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/mpeg2dec/mpeg2dec-0.4.1/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 mpeg2dec-0.4.1-orig/configure.in mpeg2dec-0.4.1/configure.in
+--- mpeg2dec-0.4.1-orig/configure.in 2010-09-14 20:55:42.399687663 +0800
++++ mpeg2dec-0.4.1/configure.in 2010-09-14 20:56:43.403204648 +0800
+@@ -75,11 +75,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/import-layers/yocto-poky/meta/recipes-multimedia/mpeg2dec/mpeg2dec_0.4.1.bb b/import-layers/yocto-poky/meta/recipes-multimedia/mpeg2dec/mpeg2dec_0.4.1.bb
new file mode 100644
index 000000000..16669947f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/mpeg2dec/mpeg2dec_0.4.1.bb
@@ -0,0 +1,40 @@
+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=ead62602d4638329d3b5b86a55803154"
+
+PR = "r2"
+
+SRC_URI = "http://libmpeg2.sourceforge.net/files/mpeg2dec-${PV}.tar.gz \
+ file://altivec_h_needed.patch"
+
+SRC_URI[md5sum] = "7631b0a4bcfdd0d78c0bb0083080b0dc"
+SRC_URI[sha256sum] = "c74a76068f8ec36d4bb59a03bf1157be44118ca02252180e8b358b0b5e3edeee"
+
+UPSTREAM_CHECK_URI = "http://libmpeg2.sourceforge.net/downloads.html"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--enable-shared --disable-sdl"
+
+PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '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}/pkgconfig/libmpeg2.pc \
+ ${includedir}/mpeg2dec/mpeg2.h"
+FILES_libmpeg2-staticdev = "${libdir}/libmpeg2.a"
+FILES_libmpeg2convert-dev = "${libdir}/libmpeg2convert.so \
+ ${libdir}/libmpeg2convert.la \
+ ${libdir}/pkgconfig/libmpeg2convert.pc \
+ ${includedir}/mpeg2dec/mpeg2convert.h"
+FILES_libmpeg2convert-staticdev = "${libdir}/libmpeg2convert.a"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio.inc b/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio.inc
new file mode 100644
index 000000000..0b05ce4ca
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio.inc
@@ -0,0 +1,200 @@
+SUMMARY = "Sound server for Linux and Unix-like operating systems"
+HOMEPAGE = "http://www.pulseaudio.org"
+AUTHOR = "Lennart Poettering"
+SECTION = "libs/multimedia"
+LICENSE = "GPLv2+ & LGPLv2.1"
+LIC_FILES_CHKSUM = "file://GPL;md5=4325afd396febcb659c36b49533135d4 \
+ file://LGPL;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+ file://src/pulsecore/resampler.h;beginline=4;endline=21;md5=09794012ae16912c0270f3280cc8ff84"
+
+DEPENDS = "libatomic-ops libsndfile1 libtool"
+# optional
+DEPENDS += "udev alsa-lib glib-2.0 gconf"
+DEPENDS += "json-c gdbm speexdsp libxml-parser-perl-native libcap"
+
+inherit autotools bash-completion pkgconfig useradd gettext perlnative bluetooth systemd
+
+# *.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 \
+ --disable-xen \
+ --with-database=simple \
+ --without-fftw \
+ --without-zsh-completion-dir \
+ --with-udev-rules-dir=`pkg-config --variable=udevdir udev`/rules.d \
+ ac_cv_header_valgrind_memcheck_h=no \
+"
+
+# 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"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', '3g', 'ofono', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', 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"
+
+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 = "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/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-Revert-module-switch-on-port-available-Route-to-pref.patch b/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-Revert-module-switch-on-port-available-Route-to-pref.patch
new file mode 100644
index 000000000..1c1e2fbdb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-Revert-module-switch-on-port-available-Route-to-pref.patch
@@ -0,0 +1,268 @@
+From b8b9b3da94a0c27090ceba243fdf54fb518c5489 Mon Sep 17 00:00:00 2001
+From: Tanu Kaskinen <tanuk@iki.fi>
+Date: Mon, 1 Feb 2016 15:34:59 +0200
+Subject: [PATCH] Revert "module-switch-on-port-available: Route to preferred
+ profile"
+
+This reverts commit e87100d41ef6d14f8dc7f803582191d9f8d8f183.
+
+The reverted commit had some unwanted consequences:
+https://bugs.freedesktop.org/show_bug.cgi?id=93903
+https://bugs.freedesktop.org/show_bug.cgi?id=93946
+
+The first regression has a fix here:
+https://patchwork.freedesktop.org/patch/72053/
+
+The second regression, however, doesn't have a fix yet. Therefore,
+it's best to revert the offending patch for now.
+
+Upstream-Status: Inappropriate [Upstream plans to fix the issues
+properly.]
+
+Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
+---
+ src/modules/module-switch-on-port-available.c | 172 ++++++++++----------------
+ 1 file changed, 67 insertions(+), 105 deletions(-)
+
+diff --git a/src/modules/module-switch-on-port-available.c b/src/modules/module-switch-on-port-available.c
+index 5dd9786..8de68a3 100644
+--- a/src/modules/module-switch-on-port-available.c
++++ b/src/modules/module-switch-on-port-available.c
+@@ -74,25 +74,22 @@ static bool profile_good_for_input(pa_card_profile *profile) {
+ static int try_to_switch_profile(pa_device_port *port) {
+ pa_card_profile *best_profile = NULL, *profile;
+ void *state;
+- unsigned best_prio = 0;
+
+- pa_log_debug("Finding best profile for port %s, preferred = %s",
+- port->name, pa_strnull(port->preferred_profile));
++ pa_log_debug("Finding best profile");
+
+ PA_HASHMAP_FOREACH(profile, port->profiles, state) {
+ bool good = false;
+- const char *name;
+- unsigned prio = profile->priority;
++
++ if (best_profile && best_profile->priority >= profile->priority)
++ continue;
+
+ /* We make a best effort to keep other direction unchanged */
+ switch (port->direction) {
+ case PA_DIRECTION_OUTPUT:
+- name = profile->output_name;
+ good = profile_good_for_output(profile);
+ break;
+
+ case PA_DIRECTION_INPUT:
+- name = profile->input_name;
+ good = profile_good_for_input(profile);
+ break;
+ }
+@@ -100,15 +97,7 @@ static int try_to_switch_profile(pa_device_port *port) {
+ if (!good)
+ continue;
+
+- /* Give a high bonus in case this is the preferred profile */
+- if (port->preferred_profile && pa_streq(name ? name : profile->name, port->preferred_profile))
+- prio += 1000000;
+-
+- if (best_profile && best_prio >= prio)
+- continue;
+-
+ best_profile = profile;
+- best_prio = prio;
+ }
+
+ if (!best_profile) {
+@@ -124,125 +113,98 @@ static int try_to_switch_profile(pa_device_port *port) {
+ return 0;
+ }
+
+-struct port_pointers {
+- pa_device_port *port;
+- pa_sink *sink;
+- pa_source *source;
+- bool is_possible_profile_active;
+- bool is_preferred_profile_active;
+- bool is_port_active;
+-};
+-
+-static const char* profile_name_for_dir(pa_card_profile *cp, pa_direction_t dir) {
+- if (dir == PA_DIRECTION_OUTPUT && cp->output_name)
+- return cp->output_name;
+- if (dir == PA_DIRECTION_INPUT && cp->input_name)
+- return cp->input_name;
+- return cp->name;
+-}
+-
+-static struct port_pointers find_port_pointers(pa_device_port *port) {
+- struct port_pointers pp = { .port = port };
++static void find_sink_and_source(pa_card *card, pa_device_port *port, pa_sink **si, pa_source **so) {
++ pa_sink *sink = NULL;
++ pa_source *source = NULL;
+ uint32_t state;
+- pa_card *card;
+-
+- pa_assert(port);
+- pa_assert_se(card = port->card);
+
+ switch (port->direction) {
+ case PA_DIRECTION_OUTPUT:
+- PA_IDXSET_FOREACH(pp.sink, card->sinks, state)
+- if (port == pa_hashmap_get(pp.sink->ports, port->name))
++ PA_IDXSET_FOREACH(sink, card->sinks, state)
++ if (port == pa_hashmap_get(sink->ports, port->name))
+ break;
+ break;
+
+ case PA_DIRECTION_INPUT:
+- PA_IDXSET_FOREACH(pp.source, card->sources, state)
+- if (port == pa_hashmap_get(pp.source->ports, port->name))
++ PA_IDXSET_FOREACH(source, card->sources, state)
++ if (port == pa_hashmap_get(source->ports, port->name))
+ break;
+ break;
+ }
+
+- pp.is_possible_profile_active =
+- card->active_profile == pa_hashmap_get(port->profiles, card->active_profile->name);
+- pp.is_preferred_profile_active = pp.is_possible_profile_active && (!port->preferred_profile ||
+- pa_safe_streq(port->preferred_profile, profile_name_for_dir(card->active_profile, port->direction)));
+- pp.is_port_active = (pp.sink && pp.sink->active_port == port) || (pp.source && pp.source->active_port == port);
+-
+- return pp;
++ *si = sink;
++ *so = source;
+ }
+
+-/* Switches to a port, switching profiles if necessary or preferred */
+-static bool switch_to_port(pa_device_port *port) {
+- struct port_pointers pp = find_port_pointers(port);
++static pa_hook_result_t port_available_hook_callback(pa_core *c, pa_device_port *port, void* userdata) {
++ pa_card* card;
++ pa_sink *sink;
++ pa_source *source;
++ bool is_active_profile, is_active_port;
+
+- if (pp.is_port_active)
+- return true; /* Already selected */
++ if (port->available == PA_AVAILABLE_UNKNOWN)
++ return PA_HOOK_OK;
+
+- pa_log_debug("Trying to switch to port %s", port->name);
+- if (!pp.is_preferred_profile_active) {
+- if (try_to_switch_profile(port) < 0) {
+- if (pp.is_possible_profile_active)
+- return false;
+- }
+- else
+- /* Now that profile has changed, our sink and source pointers must be updated */
+- pp = find_port_pointers(port);
+- }
++ card = port->card;
+
+- if (pp.source)
+- pa_source_set_port(pp.source, port->name, false);
+- if (pp.sink)
+- pa_sink_set_port(pp.sink, port->name, false);
+- return true;
+-}
++ if (!card) {
++ pa_log_warn("Port %s does not have a card", port->name);
++ return PA_HOOK_OK;
++ }
+
+-/* Switches away from a port, switching profiles if necessary or preferred */
+-static bool switch_from_port(pa_device_port *port) {
+- struct port_pointers pp = find_port_pointers(port);
+- pa_device_port *p, *best_port = NULL;
+- void *state;
++ if (pa_idxset_size(card->sinks) == 0 && pa_idxset_size(card->sources) == 0)
++ /* This card is not initialized yet. We'll handle it in
++ sink_new / source_new callbacks later. */
++ return PA_HOOK_OK;
+
+- if (!pp.is_port_active)
+- return true; /* Already deselected */
++ find_sink_and_source(card, port, &sink, &source);
+
+- /* Try to find a good enough port to switch to */
+- PA_HASHMAP_FOREACH(p, port->card->ports, state)
+- if (p->direction == port->direction && p != port && p->available != PA_AVAILABLE_NO &&
+- (!best_port || best_port->priority < p->priority))
+- best_port = p;
++ is_active_profile = card->active_profile == pa_hashmap_get(port->profiles, card->active_profile->name);
++ is_active_port = (sink && sink->active_port == port) || (source && source->active_port == port);
+
+- pa_log_debug("Trying to switch away from port %s, found %s", port->name, best_port ? best_port->name : "no better option");
++ if (port->available == PA_AVAILABLE_NO && !is_active_port)
++ return PA_HOOK_OK;
+
+- if (best_port)
+- return switch_to_port(best_port);
++ if (port->available == PA_AVAILABLE_YES) {
++ if (is_active_port)
++ return PA_HOOK_OK;
+
+- return false;
+-}
++ if (!is_active_profile) {
++ if (try_to_switch_profile(port) < 0)
++ return PA_HOOK_OK;
+
++ pa_assert(card->active_profile == pa_hashmap_get(port->profiles, card->active_profile->name));
+
+-static pa_hook_result_t port_available_hook_callback(pa_core *c, pa_device_port *port, void* userdata) {
+- pa_assert(port);
++ /* Now that profile has changed, our sink and source pointers must be updated */
++ find_sink_and_source(card, port, &sink, &source);
++ }
+
+- if (!port->card) {
+- pa_log_warn("Port %s does not have a card", port->name);
+- return PA_HOOK_OK;
++ if (source)
++ pa_source_set_port(source, port->name, false);
++ if (sink)
++ pa_sink_set_port(sink, port->name, false);
+ }
+
+- if (pa_idxset_size(port->card->sinks) == 0 && pa_idxset_size(port->card->sources) == 0)
+- /* This card is not initialized yet. We'll handle it in
+- sink_new / source_new callbacks later. */
+- return PA_HOOK_OK;
++ if (port->available == PA_AVAILABLE_NO) {
++ if (sink) {
++ pa_device_port *p2 = pa_device_port_find_best(sink->ports);
++
++ if (p2 && p2->available != PA_AVAILABLE_NO)
++ pa_sink_set_port(sink, p2->name, false);
++ else {
++ /* Maybe try to switch to another profile? */
++ }
++ }
+
+- switch (port->available) {
+- case PA_AVAILABLE_YES:
+- switch_to_port(port);
+- break;
+- case PA_AVAILABLE_NO:
+- switch_from_port(port);
+- break;
+- default:
+- break;
++ if (source) {
++ pa_device_port *p2 = pa_device_port_find_best(source->ports);
++
++ if (p2 && p2->available != PA_AVAILABLE_NO)
++ pa_source_set_port(source, p2->name, false);
++ else {
++ /* Maybe try to switch to another profile? */
++ }
++ }
+ }
+
+ return PA_HOOK_OK;
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-card-add-pa_card_profile.ports.patch b/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-card-add-pa_card_profile.ports.patch
new file mode 100644
index 000000000..84c951940
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-card-add-pa_card_profile.ports.patch
@@ -0,0 +1,218 @@
+From d1c02971867bea10afcafc82c965414012c4d6bd Mon Sep 17 00:00:00 2001
+From: Tanu Kaskinen <tanuk@iki.fi>
+Date: Fri, 23 Oct 2015 12:23:13 +0300
+Subject: [PATCH 1/4] card: add pa_card_profile.ports
+
+Having ports accessible from pa_card_profile allows checking whether all ports
+of a profile are unavailable, and therefore helps with managing the profile
+availability (implemented in a later patch).
+
+http://bugzilla.yoctoproject.org/show_bug.cgi?id=8448
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+Rebased on 8.0.
+
+Upstream-Status: Denied [The patch set needs some work to be accepted.
+The review thread:
+http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/24301]
+
+Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
+---
+ src/modules/alsa/alsa-mixer.c | 4 +++-
+ src/modules/alsa/alsa-ucm.c | 1 +
+ src/modules/bluetooth/module-bluez4-device.c | 6 ++++++
+ src/modules/bluetooth/module-bluez5-device.c | 6 ++++++
+ src/pulsecore/card.c | 15 +++++++++++++++
+ src/pulsecore/card.h | 4 ++++
+ src/pulsecore/device-port.c | 7 ++++++-
+ 7 files changed, 41 insertions(+), 2 deletions(-)
+
+diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c
+index 1fe2a02..5b76b06 100644
+--- a/src/modules/alsa/alsa-mixer.c
++++ b/src/modules/alsa/alsa-mixer.c
+@@ -4783,8 +4783,10 @@ static pa_device_port* device_port_alsa_init(pa_hashmap *ports, /* card ports */
+ path->port = p;
+ }
+
+- if (cp)
++ if (cp) {
+ pa_hashmap_put(p->profiles, cp->name, cp);
++ pa_card_profile_add_port(cp, p);
++ }
+
+ if (extra) {
+ pa_hashmap_put(extra, p->name, p);
+diff --git a/src/modules/alsa/alsa-ucm.c b/src/modules/alsa/alsa-ucm.c
+index 42f3242..68fcc26 100644
+--- a/src/modules/alsa/alsa-ucm.c
++++ b/src/modules/alsa/alsa-ucm.c
+@@ -791,6 +791,7 @@ static void ucm_add_port_combination(
+ if (cp) {
+ pa_log_debug("Adding profile %s to port %s.", cp->name, port->name);
+ pa_hashmap_put(port->profiles, cp->name, cp);
++ pa_card_profile_add_port(cp, port);
+ }
+
+ if (hash) {
+diff --git a/src/modules/bluetooth/module-bluez4-device.c b/src/modules/bluetooth/module-bluez4-device.c
+index 9a921a5..adecb32 100644
+--- a/src/modules/bluetooth/module-bluez4-device.c
++++ b/src/modules/bluetooth/module-bluez4-device.c
+@@ -2180,6 +2180,7 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid
+ p->max_sink_channels = 2;
+ p->max_source_channels = 0;
+ pa_hashmap_put(output_port->profiles, p->name, p);
++ pa_card_profile_add_port(p, output_port);
+
+ d = PA_CARD_PROFILE_DATA(p);
+ *d = PA_BLUEZ4_PROFILE_A2DP;
+@@ -2191,6 +2192,7 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid
+ p->max_sink_channels = 0;
+ p->max_source_channels = 2;
+ pa_hashmap_put(input_port->profiles, p->name, p);
++ pa_card_profile_add_port(p, input_port);
+
+ d = PA_CARD_PROFILE_DATA(p);
+ *d = PA_BLUEZ4_PROFILE_A2DP_SOURCE;
+@@ -2203,6 +2205,8 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid
+ p->max_source_channels = 1;
+ pa_hashmap_put(input_port->profiles, p->name, p);
+ pa_hashmap_put(output_port->profiles, p->name, p);
++ pa_card_profile_add_port(p, input_port);
++ pa_card_profile_add_port(p, output_port);
+
+ d = PA_CARD_PROFILE_DATA(p);
+ *d = PA_BLUEZ4_PROFILE_HSP;
+@@ -2215,6 +2219,8 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid
+ p->max_source_channels = 1;
+ pa_hashmap_put(input_port->profiles, p->name, p);
+ pa_hashmap_put(output_port->profiles, p->name, p);
++ pa_card_profile_add_port(p, input_port);
++ pa_card_profile_add_port(p, output_port);
+
+ d = PA_CARD_PROFILE_DATA(p);
+ *d = PA_BLUEZ4_PROFILE_HFGW;
+diff --git a/src/modules/bluetooth/module-bluez5-device.c b/src/modules/bluetooth/module-bluez5-device.c
+index 84e6d55..b015c67 100644
+--- a/src/modules/bluetooth/module-bluez5-device.c
++++ b/src/modules/bluetooth/module-bluez5-device.c
+@@ -1790,6 +1790,7 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid
+ cp->max_sink_channels = 2;
+ cp->max_source_channels = 0;
+ pa_hashmap_put(output_port->profiles, cp->name, cp);
++ pa_card_profile_add_port(cp, output_port);
+
+ p = PA_CARD_PROFILE_DATA(cp);
+ *p = PA_BLUETOOTH_PROFILE_A2DP_SINK;
+@@ -1801,6 +1802,7 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid
+ cp->max_sink_channels = 0;
+ cp->max_source_channels = 2;
+ pa_hashmap_put(input_port->profiles, cp->name, cp);
++ pa_card_profile_add_port(cp, input_port);
+
+ p = PA_CARD_PROFILE_DATA(cp);
+ *p = PA_BLUETOOTH_PROFILE_A2DP_SOURCE;
+@@ -1813,6 +1815,8 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid
+ cp->max_source_channels = 1;
+ pa_hashmap_put(input_port->profiles, cp->name, cp);
+ pa_hashmap_put(output_port->profiles, cp->name, cp);
++ pa_card_profile_add_port(cp, input_port);
++ pa_card_profile_add_port(cp, output_port);
+
+ p = PA_CARD_PROFILE_DATA(cp);
+ *p = PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT;
+@@ -1825,6 +1829,8 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid
+ cp->max_source_channels = 1;
+ pa_hashmap_put(input_port->profiles, cp->name, cp);
+ pa_hashmap_put(output_port->profiles, cp->name, cp);
++ pa_card_profile_add_port(cp, input_port);
++ pa_card_profile_add_port(cp, output_port);
+
+ p = PA_CARD_PROFILE_DATA(cp);
+ *p = PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY;
+diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c
+index b6cbbf7..f92ac87 100644
+--- a/src/pulsecore/card.c
++++ b/src/pulsecore/card.c
+@@ -45,6 +45,7 @@ pa_card_profile *pa_card_profile_new(const char *name, const char *description,
+ c->name = pa_xstrdup(name);
+ c->description = pa_xstrdup(description);
+ c->available = PA_AVAILABLE_UNKNOWN;
++ c->ports = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
+
+ return c;
+ }
+@@ -52,6 +53,14 @@ pa_card_profile *pa_card_profile_new(const char *name, const char *description,
+ void pa_card_profile_free(pa_card_profile *c) {
+ pa_assert(c);
+
++ if (c->ports) {
++ pa_device_port *port;
++ void *state;
++ PA_HASHMAP_FOREACH(port, c->ports, state)
++ pa_hashmap_remove (port->profiles, c->name);
++ pa_hashmap_free(c->ports);
++ }
++
+ pa_xfree(c->input_name);
+ pa_xfree(c->output_name);
+ pa_xfree(c->name);
+@@ -59,6 +68,12 @@ void pa_card_profile_free(pa_card_profile *c) {
+ pa_xfree(c);
+ }
+
++void pa_card_profile_add_port(pa_card_profile *profile, pa_device_port *port) {
++ pa_assert(profile);
++
++ pa_hashmap_put(profile->ports, port->name, port);
++}
++
+ void pa_card_profile_set_available(pa_card_profile *c, pa_available_t available) {
+ pa_core *core;
+
+diff --git a/src/pulsecore/card.h b/src/pulsecore/card.h
+index 30bfc0e..fff9057 100644
+--- a/src/pulsecore/card.h
++++ b/src/pulsecore/card.h
+@@ -50,6 +50,8 @@ struct pa_card_profile {
+ unsigned priority;
+ pa_available_t available; /* PA_AVAILABLE_UNKNOWN, PA_AVAILABLE_NO or PA_AVAILABLE_YES */
+
++ pa_hashmap *ports; /* port name -> pa_device_port */
++
+ /* We probably want to have different properties later on here */
+ unsigned n_sinks;
+ unsigned n_sources;
+@@ -107,6 +109,8 @@ typedef struct pa_card_new_data {
+ pa_card_profile *pa_card_profile_new(const char *name, const char *description, size_t extra);
+ void pa_card_profile_free(pa_card_profile *c);
+
++void pa_card_profile_add_port(pa_card_profile *profile, pa_device_port *port);
++
+ /* The profile's available status has changed */
+ void pa_card_profile_set_available(pa_card_profile *c, pa_available_t available);
+
+diff --git a/src/pulsecore/device-port.c b/src/pulsecore/device-port.c
+index 5807d3e..d12dfbc 100644
+--- a/src/pulsecore/device-port.c
++++ b/src/pulsecore/device-port.c
+@@ -107,8 +107,13 @@ static void device_port_free(pa_object *o) {
+ if (p->proplist)
+ pa_proplist_free(p->proplist);
+
+- if (p->profiles)
++ if (p->profiles) {
++ pa_card_profile *profile;
++ void *state;
++ PA_HASHMAP_FOREACH(profile, p->profiles, state)
++ pa_hashmap_remove (profile->ports, p->name);
+ pa_hashmap_free(p->profiles);
++ }
+
+ pa_xfree(p->preferred_profile);
+ pa_xfree(p->name);
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-client-conf-Add-allow-autospawn-for-root.patch b/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-client-conf-Add-allow-autospawn-for-root.patch
new file mode 100644
index 000000000..bc3277583
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-client-conf-Add-allow-autospawn-for-root.patch
@@ -0,0 +1,97 @@
+From 1cb5647f76dc8cd7bacbce2a64fac9e6c2dc3b16 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 1002dbe..0058490 100644
+--- a/man/pulse-client.conf.5.xml.in
++++ b/man/pulse-client.conf.5.xml.in
+@@ -71,6 +71,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 83331f8..0474583 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 eac705a..131393a 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, 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 4bc445f..d6c3f6d 100644
+--- a/src/pulse/context.c
++++ b/src/pulse/context.c
+@@ -976,7 +976,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;
+--
+1.9.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-padsp-Make-it-compile-on-musl.patch b/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-padsp-Make-it-compile-on-musl.patch
new file mode 100644
index 000000000..85559950e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0002-alsa-bluetooth-fail-if-user-requested-profile-doesn-.patch b/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0002-alsa-bluetooth-fail-if-user-requested-profile-doesn-.patch
new file mode 100644
index 000000000..be3655b23
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0002-alsa-bluetooth-fail-if-user-requested-profile-doesn-.patch
@@ -0,0 +1,65 @@
+From 339eb179baa7810113f6456accc05b3a32c1cdba Mon Sep 17 00:00:00 2001
+From: Tanu Kaskinen <tanuk@iki.fi>
+Date: Fri, 23 Oct 2015 12:36:34 +0300
+Subject: [PATCH 2/4] alsa, bluetooth: fail if user-requested profile doesn't
+ exist
+
+If we can't fulfill the user request fully, I think we shouldn't
+fulfill it at all, to make it clear that the requested operation
+didn't succeed.
+
+http://bugzilla.yoctoproject.org/show_bug.cgi?id=8448
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+Upstream-Status: Denied [The patch set needs some work to be accepted.
+The review thread:
+http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/24301]
+
+Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
+---
+ src/modules/alsa/module-alsa-card.c | 10 ++++++++--
+ src/modules/bluetooth/module-bluez4-device.c | 6 ++++--
+ 2 files changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c
+index a7fec04..32f517e 100644
+--- a/src/modules/alsa/module-alsa-card.c
++++ b/src/modules/alsa/module-alsa-card.c
+@@ -754,8 +754,14 @@ int pa__init(pa_module *m) {
+ goto fail;
+ }
+
+- if ((profile = pa_modargs_get_value(u->modargs, "profile", NULL)))
+- pa_card_new_data_set_profile(&data, profile);
++ if ((profile = pa_modargs_get_value(u->modargs, "profile", NULL))) {
++ if (pa_hashmap_get(data.profiles, profile))
++ pa_card_new_data_set_profile(&data, profile);
++ else {
++ pa_log("No such profile: %s", profile);
++ goto fail;
++ }
++ }
+
+ u->card = pa_card_new(m->core, &data);
+ pa_card_new_data_done(&data);
+diff --git a/src/modules/bluetooth/module-bluez4-device.c b/src/modules/bluetooth/module-bluez4-device.c
+index b40c6a0..94e6988 100644
+--- a/src/modules/bluetooth/module-bluez4-device.c
++++ b/src/modules/bluetooth/module-bluez4-device.c
+@@ -2310,8 +2310,10 @@ static int add_card(struct userdata *u) {
+ if ((default_profile = pa_modargs_get_value(u->modargs, "profile", NULL))) {
+ if (pa_hashmap_get(data.profiles, default_profile))
+ pa_card_new_data_set_profile(&data, default_profile);
+- else
+- pa_log_warn("Profile '%s' not valid or not supported by device.", default_profile);
++ else {
++ pa_log("Profile '%s' not valid or not supported by device.", default_profile);
++ return -1;
++ }
+ }
+
+ u->card = pa_card_new(u->core, &data);
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0003-card-move-profile-selection-after-pa_card_new.patch b/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0003-card-move-profile-selection-after-pa_card_new.patch
new file mode 100644
index 000000000..0e7780154
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0003-card-move-profile-selection-after-pa_card_new.patch
@@ -0,0 +1,366 @@
+From 13e85dd1763e99d21a60323671b9a5df08bdae75 Mon Sep 17 00:00:00 2001
+From: Tanu Kaskinen <tanuk@iki.fi>
+Date: Fri, 23 Oct 2015 12:59:53 +0300
+Subject: [PATCH 3/4] card: move profile selection after pa_card_new()
+
+I want module-alsa-card to set the availability of unavailable
+profiles before the initial card profile gets selected, so that the
+selection logic can use correct availability information.
+module-alsa-card initializes the jack state after calling
+pa_card_new(), however, and the profile selection happens in
+pa_card_new(). This patch solves that by introducing pa_card_put() and
+moving the profile selection code there.
+
+An alternative solution would have been to move the jack
+initialization to happen before pa_card_new() and use pa_card_new_data
+instead of pa_card in the jack initialization code, but I disliked
+that idea (I want to get rid of the "new data" pattern eventually).
+
+The CARD_NEW hook is used when applying the initial profile policy, so
+that was moved to pa_card_put(). That required changing the hook data
+from pa_card_new_data to pa_card. module-card-restore now uses
+pa_card_set_profile() instead of pa_card_new_data_set_profile(). That
+required adding a state variable to pa_card, because
+pa_card_set_profile() needs to distinguish between setting the initial
+profile and setting the profile in other situations.
+
+The order in which the initial profile policy is applied is reversed
+in this patch. Previously the first one to set it won, now the last
+one to set it wins. I think this is better, because if you have N
+parties that want to set the profile, we avoid checking N times
+whether someone else has already set the profile.
+
+http://bugzilla.yoctoproject.org/show_bug.cgi?id=8448
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+Rebased on 8.0.
+
+Upstream-Status: Denied [The patch set needs some work to be accepted.
+The review thread:
+http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/24301]
+
+Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
+---
+ src/modules/alsa/module-alsa-card.c | 19 +++----
+ src/modules/bluetooth/module-bluez4-device.c | 18 +++----
+ src/modules/bluetooth/module-bluez5-device.c | 1 +
+ src/modules/macosx/module-coreaudio-device.c | 1 +
+ src/modules/module-card-restore.c | 24 +++++----
+ src/pulsecore/card.c | 81 +++++++++++++++-------------
+ src/pulsecore/card.h | 7 +++
+ 7 files changed, 86 insertions(+), 65 deletions(-)
+
+diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c
+index 9e8cde2..fe240f0 100644
+--- a/src/modules/alsa/module-alsa-card.c
++++ b/src/modules/alsa/module-alsa-card.c
+@@ -770,15 +770,6 @@ int pa__init(pa_module *m) {
+ goto fail;
+ }
+
+- if ((profile = pa_modargs_get_value(u->modargs, "profile", NULL))) {
+- if (pa_hashmap_get(data.profiles, profile))
+- pa_card_new_data_set_profile(&data, profile);
+- else {
+- pa_log("No such profile: %s", profile);
+- goto fail;
+- }
+- }
+-
+ u->card = pa_card_new(m->core, &data);
+ pa_card_new_data_done(&data);
+
+@@ -789,6 +780,16 @@ int pa__init(pa_module *m) {
+ u->card->set_profile = card_set_profile;
+
+ init_jacks(u);
++ pa_card_put(u->card);
++
++ if ((profile = pa_modargs_get_value(u->modargs, "profile", NULL))) {
++ u->card->active_profile = pa_hashmap_get(u->card->profiles, profile);
++ if (!u->card->active_profile) {
++ pa_log("No such profile: %s", profile);
++ goto fail;
++ }
++ }
++
+ init_profile(u);
+ init_eld_ctls(u);
+
+diff --git a/src/modules/bluetooth/module-bluez4-device.c b/src/modules/bluetooth/module-bluez4-device.c
+index dd18217..5d0d3db 100644
+--- a/src/modules/bluetooth/module-bluez4-device.c
++++ b/src/modules/bluetooth/module-bluez4-device.c
+@@ -2304,15 +2304,6 @@ static int add_card(struct userdata *u) {
+ *d = PA_BLUEZ4_PROFILE_OFF;
+ pa_hashmap_put(data.profiles, p->name, p);
+
+- if ((default_profile = pa_modargs_get_value(u->modargs, "profile", NULL))) {
+- if (pa_hashmap_get(data.profiles, default_profile))
+- pa_card_new_data_set_profile(&data, default_profile);
+- else {
+- pa_log("Profile '%s' not valid or not supported by device.", default_profile);
+- return -1;
+- }
+- }
+-
+ u->card = pa_card_new(u->core, &data);
+ pa_card_new_data_done(&data);
+
+@@ -2323,6 +2314,15 @@ static int add_card(struct userdata *u) {
+
+ u->card->userdata = u;
+ u->card->set_profile = card_set_profile;
++ pa_card_put(u->card);
++
++ if ((default_profile = pa_modargs_get_value(u->modargs, "profile", NULL))) {
++ u->card->active_profile = pa_hashmap_get(u->card->profiles, default_profile);
++ if (!u->card->active_profile) {
++ pa_log("Profile '%s' not valid or not supported by device.", default_profile);
++ return -1;
++ }
++ }
+
+ d = PA_CARD_PROFILE_DATA(u->card->active_profile);
+
+diff --git a/src/modules/bluetooth/module-bluez5-device.c b/src/modules/bluetooth/module-bluez5-device.c
+index b015c67..7b90a31 100644
+--- a/src/modules/bluetooth/module-bluez5-device.c
++++ b/src/modules/bluetooth/module-bluez5-device.c
+@@ -1959,6 +1959,7 @@ static int add_card(struct userdata *u) {
+
+ u->card->userdata = u;
+ u->card->set_profile = set_profile_cb;
++ pa_card_put(u->card);
+
+ p = PA_CARD_PROFILE_DATA(u->card->active_profile);
+ u->profile = *p;
+diff --git a/src/modules/macosx/module-coreaudio-device.c b/src/modules/macosx/module-coreaudio-device.c
+index 0c92d42..7190ee9 100644
+--- a/src/modules/macosx/module-coreaudio-device.c
++++ b/src/modules/macosx/module-coreaudio-device.c
+@@ -807,6 +807,7 @@ int pa__init(pa_module *m) {
+ pa_card_new_data_done(&card_new_data);
+ u->card->userdata = u;
+ u->card->set_profile = card_set_profile;
++ pa_card_put(u->card);
+
+ u->rtpoll = pa_rtpoll_new();
+ pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll);
+diff --git a/src/modules/module-card-restore.c b/src/modules/module-card-restore.c
+index f906843..dce6674 100644
+--- a/src/modules/module-card-restore.c
++++ b/src/modules/module-card-restore.c
+@@ -515,34 +515,38 @@ static pa_hook_result_t port_offset_change_callback(pa_core *c, pa_device_port *
+ return PA_HOOK_OK;
+ }
+
+-static pa_hook_result_t card_new_hook_callback(pa_core *c, pa_card_new_data *new_data, struct userdata *u) {
++static pa_hook_result_t card_new_hook_callback(pa_core *c, pa_card *card, struct userdata *u) {
+ struct entry *e;
+ void *state;
+ pa_device_port *p;
+ struct port_info *p_info;
+
+- pa_assert(new_data);
++ pa_assert(c);
++ pa_assert(card);
++ pa_assert(u);
+
+- if (!(e = entry_read(u, new_data->name)))
++ if (!(e = entry_read(u, card->name)))
+ return PA_HOOK_OK;
+
+ if (e->profile[0]) {
+- if (!new_data->active_profile) {
+- pa_card_new_data_set_profile(new_data, e->profile);
+- pa_log_info("Restored profile '%s' for card %s.", new_data->active_profile, new_data->name);
+- new_data->save_profile = true;
++ pa_card_profile *profile;
+
++ profile = pa_hashmap_get(card->profiles, e->profile);
++ if (profile) {
++ pa_card_set_profile(card, profile, true);
++ pa_log_info("Restored profile '%s' for card %s.", card->active_profile->name, card->name);
+ } else
+- pa_log_debug("Not restoring profile for card %s, because already set.", new_data->name);
++ pa_log_debug("Tried to restore profile %s for card %s, but the card doesn't have such profile.",
++ e->profile, card->name);
+ }
+
+ /* Always restore the latency offsets because their
+ * initial value is always 0 */
+
+- pa_log_info("Restoring port latency offsets for card %s.", new_data->name);
++ pa_log_info("Restoring port latency offsets for card %s.", card->name);
+
+ PA_HASHMAP_FOREACH(p_info, e->ports, state)
+- if ((p = pa_hashmap_get(new_data->ports, p_info->name))) {
++ if ((p = pa_hashmap_get(card->ports, p_info->name))) {
+ p->latency_offset = p_info->offset;
+ if (!p->preferred_profile && p_info->profile)
+ pa_device_port_set_preferred_profile(p, p_info->profile);
+diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c
+index f92ac87..1a6e705 100644
+--- a/src/pulsecore/card.c
++++ b/src/pulsecore/card.c
+@@ -148,6 +148,7 @@ pa_card *pa_card_new(pa_core *core, pa_card_new_data *data) {
+ pa_assert(!pa_hashmap_isempty(data->profiles));
+
+ c = pa_xnew0(pa_card, 1);
++ c->state = PA_CARD_STATE_INIT;
+
+ if (!(name = pa_namereg_register(core, data->name, PA_NAMEREG_CARD, c, data->namereg_fail))) {
+ pa_xfree(c);
+@@ -156,12 +157,6 @@ pa_card *pa_card_new(pa_core *core, pa_card_new_data *data) {
+
+ pa_card_new_data_set_name(data, name);
+
+- if (pa_hook_fire(&core->hooks[PA_CORE_HOOK_CARD_NEW], data) < 0) {
+- pa_xfree(c);
+- pa_namereg_unregister(core, name);
+- return NULL;
+- }
+-
+ c->core = core;
+ c->name = pa_xstrdup(data->name);
+ c->proplist = pa_proplist_copy(data->proplist);
+@@ -184,38 +179,43 @@ pa_card *pa_card_new(pa_core *core, pa_card_new_data *data) {
+ PA_HASHMAP_FOREACH(port, c->ports, state)
+ port->card = c;
+
+- if (data->active_profile)
+- if ((c->active_profile = pa_hashmap_get(c->profiles, data->active_profile)))
+- c->save_profile = data->save_profile;
++ pa_device_init_description(c->proplist, c);
++ pa_device_init_icon(c->proplist, true);
++ pa_device_init_intended_roles(c->proplist);
+
+- if (!c->active_profile) {
+- PA_HASHMAP_FOREACH(profile, c->profiles, state) {
+- if (profile->available == PA_AVAILABLE_NO)
+- continue;
++ return c;
++}
+
+- if (!c->active_profile || profile->priority > c->active_profile->priority)
+- c->active_profile = profile;
+- }
+- /* If all profiles are not available, then we still need to pick one */
+- if (!c->active_profile) {
+- PA_HASHMAP_FOREACH(profile, c->profiles, state)
+- if (!c->active_profile || profile->priority > c->active_profile->priority)
+- c->active_profile = profile;
+- }
+- pa_assert(c->active_profile);
++void pa_card_put(pa_card *card) {
++ pa_card_profile *profile;
++ void *state;
++
++ pa_assert(card);
++
++ PA_HASHMAP_FOREACH(profile, card->profiles, state) {
++ if (profile->available == PA_AVAILABLE_NO)
++ continue;
++
++ if (!card->active_profile || profile->priority > card->active_profile->priority)
++ card->active_profile = profile;
+ }
+
+- pa_device_init_description(c->proplist, c);
+- pa_device_init_icon(c->proplist, true);
+- pa_device_init_intended_roles(c->proplist);
++ /* If all profiles are unavailable, then we still need to pick one */
++ if (!card->active_profile) {
++ PA_HASHMAP_FOREACH(profile, card->profiles, state)
++ if (!card->active_profile || profile->priority > card->active_profile->priority)
++ card->active_profile = profile;
++ }
++ pa_assert(card->active_profile);
+
+- pa_assert_se(pa_idxset_put(core->cards, c, &c->index) >= 0);
++ pa_hook_fire(&card->core->hooks[PA_CORE_HOOK_CARD_NEW], card);
+
+- pa_log_info("Created %u \"%s\"", c->index, c->name);
+- pa_subscription_post(core, PA_SUBSCRIPTION_EVENT_CARD|PA_SUBSCRIPTION_EVENT_NEW, c->index);
++ pa_assert_se(pa_idxset_put(card->core->cards, card, &card->index) >= 0);
++ card->state = PA_CARD_STATE_LINKED;
+
+- pa_hook_fire(&core->hooks[PA_CORE_HOOK_CARD_PUT], c);
+- return c;
++ pa_log_info("Created %u \"%s\"", card->index, card->name);
++ pa_hook_fire(&card->core->hooks[PA_CORE_HOOK_CARD_PUT], card);
++ pa_subscription_post(card->core, PA_SUBSCRIPTION_EVENT_CARD|PA_SUBSCRIPTION_EVENT_NEW, card->index);
+ }
+
+ void pa_card_free(pa_card *c) {
+@@ -306,20 +306,27 @@ int pa_card_set_profile(pa_card *c, pa_card_profile *profile, bool save) {
+ return 0;
+ }
+
+- if ((r = c->set_profile(c, profile)) < 0)
++ /* If we're setting the initial profile, we shouldn't call set_profile(),
++ * because the implementations don't expect that (for historical reasons).
++ * We should just set c->active_profile, and the implementations will
++ * properly set up that profile after pa_card_put() has returned. It would
++ * be probably good to change this so that also the initial profile can be
++ * set up in set_profile(), but if set_profile() fails, that would need
++ * some better handling than what we do here currently. */
++ if (c->state != PA_CARD_STATE_INIT && (r = c->set_profile(c, profile)) < 0)
+ return r;
+
+- pa_subscription_post(c->core, PA_SUBSCRIPTION_EVENT_CARD|PA_SUBSCRIPTION_EVENT_CHANGE, c->index);
+-
+- pa_log_info("Changed profile of card %u \"%s\" to %s", c->index, c->name, profile->name);
+-
+ c->active_profile = profile;
+ c->save_profile = save;
+
+ if (save)
+ update_port_preferred_profile(c);
+
+- pa_hook_fire(&c->core->hooks[PA_CORE_HOOK_CARD_PROFILE_CHANGED], c);
++ if (c->state != PA_CARD_STATE_INIT) {
++ pa_log_info("Changed profile of card %u \"%s\" to %s", c->index, c->name, profile->name);
++ pa_hook_fire(&c->core->hooks[PA_CORE_HOOK_CARD_PROFILE_CHANGED], c);
++ pa_subscription_post(c->core, PA_SUBSCRIPTION_EVENT_CARD|PA_SUBSCRIPTION_EVENT_CHANGE, c->index);
++ }
+
+ return 0;
+ }
+diff --git a/src/pulsecore/card.h b/src/pulsecore/card.h
+index fff9057..a944301 100644
+--- a/src/pulsecore/card.h
++++ b/src/pulsecore/card.h
+@@ -34,6 +34,11 @@ typedef enum pa_available {
+ PA_AVAILABLE_YES = 2,
+ } pa_available_t;
+
++typedef enum pa_card_state {
++ PA_CARD_STATE_INIT,
++ PA_CARD_STATE_LINKED,
++} pa_card_state_t;
++
+ struct pa_card_profile {
+ pa_card *card;
+ char *name;
+@@ -66,6 +71,7 @@ struct pa_card_profile {
+
+ struct pa_card {
+ uint32_t index;
++ pa_card_state_t state;
+ pa_core *core;
+
+ char *name;
+@@ -120,6 +126,7 @@ void pa_card_new_data_set_profile(pa_card_new_data *data, const char *profile);
+ void pa_card_new_data_done(pa_card_new_data *data);
+
+ pa_card *pa_card_new(pa_core *c, pa_card_new_data *data);
++void pa_card_put(pa_card *c);
+ void pa_card_free(pa_card *c);
+
+ void pa_card_add_profile(pa_card *c, pa_card_profile *profile);
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0004-alsa-set-availability-for-some-unavailable-profiles.patch b/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0004-alsa-set-availability-for-some-unavailable-profiles.patch
new file mode 100644
index 000000000..e0efa70f3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0004-alsa-set-availability-for-some-unavailable-profiles.patch
@@ -0,0 +1,83 @@
+From 690d567e298f6687b61c82660b051df5b25482ee Mon Sep 17 00:00:00 2001
+From: Tanu Kaskinen <tanuk@iki.fi>
+Date: Fri, 23 Oct 2015 13:37:11 +0300
+Subject: [PATCH 4/4] alsa: set availability for (some) unavailable profiles
+
+The alsa card hasn't so far set any availability for profiles. That
+caused an issue with some HDMI hardware: the sound card has two HDMI
+outputs, but only the second of them is actually usable. The
+unavailable port is marked as unavailable and the available port is
+marked as available, but this information isn't propagated to the
+profile availability. Without profile availability information, the
+initial profile policy picks the unavailable one, since it has a
+higher priority value.
+
+This patch adds simple logic for marking some profiles unavailable:
+if the profile only contains unavailable ports, the profile is
+unavailable too. This can be improved in the future so that if a
+profile contains sinks or sources that only contain unavailable ports,
+the profile should be marked as unavailable. Implementing that
+requires adding more information about the sinks and sources to
+pa_card_profile, however.
+
+BugLink: https://bugzilla.yoctoproject.org/show_bug.cgi?id=8448
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+Rebased on 8.0.
+
+Upstream-Status: Denied [The patch set needs some work to be accepted.
+The review thread:
+http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/24301]
+
+Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
+---
+ src/modules/alsa/module-alsa-card.c | 25 +++++++++++++++++++++++++
+ 1 file changed, 25 insertions(+)
+
+diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c
+index fe240f0..bdbdc12 100644
+--- a/src/modules/alsa/module-alsa-card.c
++++ b/src/modules/alsa/module-alsa-card.c
+@@ -366,6 +366,8 @@ static int report_jack_state(snd_mixer_elem_t *melem, unsigned int mask) {
+ void *state;
+ pa_alsa_jack *jack;
+ struct temp_port_avail *tp, *tports;
++ pa_device_port *port;
++ pa_card_profile *profile;
+
+ pa_assert(u);
+
+@@ -412,6 +414,29 @@ static int report_jack_state(snd_mixer_elem_t *melem, unsigned int mask) {
+ pa_device_port_set_available(tp->port, tp->avail);
+
+ pa_xfree(tports);
++
++ /* Update profile availabilities. The logic could be improved; for now we
++ * only set obviously unavailable profiles (those that contain only
++ * unavailable ports) to PA_AVAILABLE_NO and all others to
++ * PA_AVAILABLE_UNKNOWN. */
++ PA_HASHMAP_FOREACH(profile, u->card->profiles, state) {
++ void *state2;
++ pa_available_t available = PA_AVAILABLE_NO;
++
++ /* Don't touch the "off" profile. */
++ if (pa_hashmap_size(profile->ports) == 0)
++ continue;
++
++ PA_HASHMAP_FOREACH(port, profile->ports, state2) {
++ if (port->available != PA_AVAILABLE_NO) {
++ available = PA_AVAILABLE_UNKNOWN;
++ break;
++ }
++ }
++
++ pa_card_profile_set_available(profile, available);
++ }
++
+ return 0;
+ }
+
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/volatiles.04_pulse b/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio/volatiles.04_pulse
new file mode 100644
index 000000000..5b1998032
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio_8.0.bb b/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio_8.0.bb
new file mode 100644
index 000000000..b01ba8f68
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/pulseaudio/pulseaudio_8.0.bb
@@ -0,0 +1,19 @@
+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-card-add-pa_card_profile.ports.patch \
+ file://0002-alsa-bluetooth-fail-if-user-requested-profile-doesn-.patch \
+ file://0003-card-move-profile-selection-after-pa_card_new.patch \
+ file://0004-alsa-set-availability-for-some-unavailable-profiles.patch \
+ file://0001-Revert-module-switch-on-port-available-Route-to-pref.patch \
+"
+SRC_URI[md5sum] = "8678442ba0bb4b4c33ac6f62542962df"
+SRC_URI[sha256sum] = "690eefe28633466cfd1ab9d85ebfa9376f6b622deec6bfee5091ac9737cd1989"
+
+do_compile_prepend() {
+ mkdir -p ${S}/libltdl
+ cp ${STAGING_LIBDIR}/libltdl* ${S}/libltdl
+}
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/sbc/sbc_1.3.bb b/import-layers/yocto-poky/meta/recipes-multimedia/sbc/sbc_1.3.bb
new file mode 100644
index 000000000..2d7f31bc1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/sbc/sbc_1.3.bb
@@ -0,0 +1,16 @@
+SUMMARY = "SBC Audio Codec"
+DESCRIPTION = "Bluetooth low-complexity, subband codec (SBC) library."
+HOMEPAGE = "https://www.bluez.org"
+SECTION = "libs"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
+ 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
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/speex/speex_1.2rc2.bb b/import-layers/yocto-poky/meta/recipes-multimedia/speex/speex_1.2rc2.bb
new file mode 100644
index 000000000..f7d23dbd7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/speex/speex_1.2rc2.bb
@@ -0,0 +1,19 @@
+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.us.xiph.org/releases/speex/speex-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "6ae7db3bab01e1d4b86bacfa8ca33e81"
+SRC_URI[sha256sum] = "caa27c7247ff15c8521c2ae0ea21987c9e9710a8f2d3448e8b79da9806bce891"
+
+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/import-layers/yocto-poky/meta/recipes-multimedia/speex/speexdsp/0001-Don-t-rely-on-HAVE_STDINT_H-et-al.-being-defined.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-multimedia/speex/speexdsp_1.2rc3.bb b/import-layers/yocto-poky/meta/recipes-multimedia/speex/speexdsp_1.2rc3.bb
new file mode 100644
index 000000000..6b1acedbe
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-multimedia/tremor/tremor/obsolete_automake_macros.patch b/import-layers/yocto-poky/meta/recipes-multimedia/tremor/tremor/obsolete_automake_macros.patch
new file mode 100644
index 000000000..7e5102903
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/tremor/tremor/obsolete_automake_macros.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Submitted [https://trac.xiph.org/ticket/1922]
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+Index: configure.in
+===================================================================
+--- configure.in (revision 18764)
++++ configure.in (working copy)
+@@ -9,7 +9,7 @@
+ AC_CANONICAL_HOST
+ AC_CANONICAL_TARGET
+
+-AM_CONFIG_HEADER([config.h])
++AC_CONFIG_HEADERS([config.h])
+
+ AM_INIT_AUTOMAKE(libvorbisidec,1.2.1)
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/tremor/tremor/tremor-arm-thumb2.patch b/import-layers/yocto-poky/meta/recipes-multimedia/tremor/tremor/tremor-arm-thumb2.patch
new file mode 100644
index 000000000..204954222
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/tremor/tremor/tremor-arm-thumb2.patch
@@ -0,0 +1,104 @@
+From: Xin Ouyang <Xin.Ouyang@windriver.com>
+Date: Mon, 16 Jul 2012 13:29:34 +0800
+Subject: [PATCH] tremor: add IT instructions for arm thumb2 tune flags.
+
+Upstream-Status: Pending
+
+In Thumb-2, most instructions do not have a built in condition code (except for
+conditional branches). Instead, short sequences of instructions which are to be
+executed conditionally can be preceded by a special "IT instruction" which
+describes the condition and which of the following instructions should be
+executed if the condition is false respectively.
+
+For the ARM/Thumb IT(If-Then) instruction:
+http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0489c/Cjabicci.html
+
+Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
+---
+ asm_arm.h | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/asm_arm.h b/asm_arm.h
+index c3bda00..823c54f 100755
+--- a/asm_arm.h
++++ b/asm_arm.h
+@@ -108,9 +108,11 @@ static inline void XNPROD31(ogg_int32_t a, ogg_int32_t b,
+ static inline ogg_int32_t CLIP_TO_15(ogg_int32_t x) {
+ int tmp;
+ asm volatile("subs %1, %0, #32768\n\t"
++ "itt pl\n\t"
+ "movpl %0, #0x7f00\n\t"
+ "orrpl %0, %0, #0xff\n"
+ "adds %1, %0, #32768\n\t"
++ "it mi\n\t"
+ "movmi %0, #0x8000"
+ : "+r"(x),"=r"(tmp)
+ :
+@@ -139,10 +141,12 @@ static inline void lsp_loop_asm(ogg_uint32_t *qip,ogg_uint32_t *pip,
+
+ "ldmdb r0!,{r1,r3};"
+ "subs r1,r1,%4;" //ilsp[j]-wi
++ "it mi;"
+ "rsbmi r1,r1,#0;" //labs(ilsp[j]-wi)
+ "umull %0,r2,r1,%0;" //qi*=labs(ilsp[j]-wi)
+
+ "subs r1,r3,%4;" //ilsp[j+1]-wi
++ "it mi;"
+ "rsbmi r1,r1,#0;" //labs(ilsp[j+1]-wi)
+ "umull %1,r3,r1,%1;" //pi*=labs(ilsp[j+1]-wi)
+
+@@ -167,6 +171,7 @@ static inline void lsp_loop_asm(ogg_uint32_t *qip,ogg_uint32_t *pip,
+ "mov r0,#0x4000;\n"
+
+ "subs r1,r1,%4;\n" //ilsp[j]-wi
++ "it mi;\n"
+ "rsbmi r1,r1,#0;\n" //labs(ilsp[j]-wi)
+ "umull %0,r2,r1,%0;\n" //qi*=labs(ilsp[j]-wi)
+ "umull %1,r3,r0,%1;\n" //pi*=labs(ilsp[j+1]-wi)
+@@ -190,18 +195,23 @@ static inline void lsp_loop_asm(ogg_uint32_t *qip,ogg_uint32_t *pip,
+ "mov r2,#0;"
+ "orr r1,%0,%1;"
+ "tst r1,#0xff000000;"
++ "itt ne;"
+ "addne r2,r2,#8;"
+ "movne r1,r1,lsr #8;"
+ "tst r1,#0x00f00000;"
++ "itt ne;"
+ "addne r2,r2,#4;"
+ "movne r1,r1,lsr #4;"
+ "tst r1,#0x000c0000;"
++ "itt ne;"
+ "addne r2,r2,#2;"
+ "movne r1,r1,lsr #2;"
+ "tst r1,#0x00020000;"
++ "itt ne;"
+ "addne r2,r2,#1;"
+ "movne r1,r1,lsr #1;"
+ "tst r1,#0x00010000;"
++ "it ne;"
+ "addne r2,r2,#1;"
+ "mov %0,%0,lsr r2;"
+ "mov %1,%1,lsr r2;"
+@@ -222,15 +232,19 @@ static inline void lsp_norm_asm(ogg_uint32_t *qip,ogg_int32_t *qexpp){
+ ogg_int32_t qexp=*qexpp;
+
+ asm("tst %0,#0x0000ff00;"
++ "itt eq;"
+ "moveq %0,%0,lsl #8;"
+ "subeq %1,%1,#8;"
+ "tst %0,#0x0000f000;"
++ "itt eq;"
+ "moveq %0,%0,lsl #4;"
+ "subeq %1,%1,#4;"
+ "tst %0,#0x0000c000;"
++ "itt eq;"
+ "moveq %0,%0,lsl #2;"
+ "subeq %1,%1,#2;"
+ "tst %0,#0x00008000;"
++ "itt eq;"
+ "moveq %0,%0,lsl #1;"
+ "subeq %1,%1,#1;"
+ : "+r"(qi),"+r"(qexp)
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/tremor/tremor_20150107.bb b/import-layers/yocto-poky/meta/recipes-multimedia/tremor/tremor_20150107.bb
new file mode 100644
index 000000000..937894a73
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/tremor/tremor_20150107.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Fixed-point decoder"
+DESCRIPTION = "tremor is a fixed point implementation of the vorbis codec."
+SECTION = "libs"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=db1b7a668b2a6f47b2af88fb008ad555 \
+ file://os.h;beginline=3;endline=14;md5=5c0af5e1bedef3ce8178c89f48cd6f1f"
+DEPENDS = "libogg"
+SRCDATE = "${PV}"
+PR = "r1"
+
+# SVN support for upstream version check isn't implemented yet
+RECIPE_UPSTREAM_VERSION = "20150107"
+RECIPE_UPSTREAM_DATE = "Jan 07, 2015"
+CHECK_DATE = "Aug 12, 2015"
+
+SRC_URI = "svn://svn.xiph.org/trunk;module=Tremor;rev=19427;protocol=http \
+ file://obsolete_automake_macros.patch;striplevel=0 \
+ file://tremor-arm-thumb2.patch \
+"
+
+S = "${WORKDIR}/Tremor"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--enable-shared"
+
+ARM_INSTRUCTION_SET = "arm"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/webp/libwebp_0.5.0.bb b/import-layers/yocto-poky/meta/recipes-multimedia/webp/libwebp_0.5.0.bb
new file mode 100644
index 000000000..c89adac5d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/webp/libwebp_0.5.0.bb
@@ -0,0 +1,49 @@
+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] = "ba81eb9bf23e3c69a2f5cc8dcdb5938f"
+SRC_URI[sha256sum] = "5cd3bb7b623aff1f4e70bd611dc8dbabbf7688fd5eb225b32e02e09e37dfb274"
+
+UPSTREAM_CHECK_URI = "http://downloads.webmproject.org/releases/webp/index.html"
+
+EXTRA_OECONF = " \
+ --disable-experimental \
+ --disable-wic \
+ --enable-libwebpmux \
+ --enable-libwebpdemux \
+ --enable-threading \
+"
+
+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/import-layers/yocto-poky/meta/recipes-multimedia/x264/x264/don-t-default-to-cortex-a9-with-neon.patch b/import-layers/yocto-poky/meta/recipes-multimedia/x264/x264/don-t-default-to-cortex-a9-with-neon.patch
new file mode 100644
index 000000000..bf72fca68
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/x264/x264/don-t-default-to-cortex-a9-with-neon.patch
@@ -0,0 +1,29 @@
+-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>
+
+diff --git a/configure b/configure
+index 2916036..f4ece40 100755
+--- a/configure
++++ b/configure
+@@ -773,9 +773,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
+- echo $CFLAGS | grep -Eq '(-mcpu|-march|-mfpu)' || CFLAGS="$CFLAGS -mcpu=cortex-a8 -mfpu=neon"
+-
+ if cc_check '' '' '__asm__("rev ip, ip");' ; then define HAVE_ARMV6
+ cc_check '' '' '__asm__("movt r0, #0");' && define HAVE_ARMV6T2
+ cc_check '' '' '__asm__("vadd.i16 q0, q0, q0");' && define HAVE_NEON
+@@ -788,8 +785,6 @@ if [ $asm = auto -a $ARCH = ARM ] ; then
+ fi
+
+ if [ $asm = auto -a $ARCH = AARCH64 ] ; then
+- # set flags so neon is built by default
+- echo $CFLAGS | grep -Eq '(-mcpu|-march|-mfpu|-arch)' || CFLAGS="$CFLAGS -arch arm64 -mfpu=neon"
+
+ if cc_check '' '' '__asm__("cmeq v0.8h, v0.8h, #0");' ; then define HAVE_NEON
+ ASFLAGS="$ASFLAGS -c"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/x264/x264_git.bb b/import-layers/yocto-poky/meta/recipes-multimedia/x264/x264_git.bb
new file mode 100644
index 000000000..0a6990980
--- /dev/null
+++ b/import-layers/yocto-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 = "yasm-native"
+
+SRC_URI = "git://git.videolan.org/x264.git \
+ file://don-t-default-to-cortex-a9-with-neon.patch \
+ "
+
+SRCREV = "c8a773ebfca148ef04f5a60d42cbd7336af0baf6"
+
+PV = "r2491+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)}"
+
+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 \
+ --enable-pic \
+ ${X264_DISABLE_ASM} \
+ '
+
+do_configure() {
+ ./configure ${EXTRA_OECONF}
+}
+
+# Get rid of -e
+EXTRA_OEMAKE = ""
+AS = "${TARGET_PREFIX}gcc"
+
+do_install() {
+ oe_runmake install DESTDIR=${D}
+}
+
+# PIC can't be enabled for 32-bit x86
+INSANE_SKIP_${PN}_append_x86 = " textrel"
+
diff --git a/import-layers/yocto-poky/meta/recipes-rt/README b/import-layers/yocto-poky/meta/recipes-rt/README
new file mode 100644
index 000000000..7d7558de4
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-rt/images/core-image-rt-sdk.bb b/import-layers/yocto-poky/meta/recipes-rt/images/core-image-rt-sdk.bb
new file mode 100644
index 000000000..db7d58183
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-rt/images/core-image-rt-sdk.bb
@@ -0,0 +1,12 @@
+require recipes-core/images/core-image-minimal.bb
+
+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/import-layers/yocto-poky/meta/recipes-rt/images/core-image-rt.bb b/import-layers/yocto-poky/meta/recipes-rt/images/core-image-rt.bb
new file mode 100644
index 000000000..cab6f8b74
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-rt/images/core-image-rt.bb
@@ -0,0 +1,9 @@
+require recipes-core/images/core-image-minimal.bb
+
+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/import-layers/yocto-poky/meta/recipes-rt/rt-tests/files/0001-Makefile-Set-CC-AR-variable-only-if-it-doesn-t-have-.patch b/import-layers/yocto-poky/meta/recipes-rt/rt-tests/files/0001-Makefile-Set-CC-AR-variable-only-if-it-doesn-t-have-.patch
new file mode 100644
index 000000000..00fcc7d72
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-rt/rt-tests/files/0001-Makefile-Set-CC-AR-variable-only-if-it-doesn-t-have-.patch
@@ -0,0 +1,30 @@
+From 9640dde4241e1314b8e8ea35b0c8dab0b30ae51f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 3 Jan 2016 10:50:56 -0800
+Subject: [PATCH] Makefile: Set CC/AR variable only if it doesn't have a value
+
+This helps it compile with clang or any other compilers besides gcc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 1e4b7d1..2c2d396 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,6 +1,6 @@
+ VERSION = 0.96
+-CC=$(CROSS_COMPILE)gcc
+-AR=$(CROSS_COMPILE)ar
++CC?=$(CROSS_COMPILE)gcc
++AR?=$(CROSS_COMPILE)ar
+
+ OBJDIR = bld
+
+--
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-rt/rt-tests/files/rt_bmark.py b/import-layers/yocto-poky/meta/recipes-rt/rt-tests/files/rt_bmark.py
new file mode 100755
index 000000000..e2280e43e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-rt/rt-tests/files/rt_bmark.py
@@ -0,0 +1,412 @@
+#!/usr/bin/python
+# -*- 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.split("\n"):
+ 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("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.split("\n"):
+ 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 xrange(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/import-layers/yocto-poky/meta/recipes-rt/rt-tests/files/run-ptest b/import-layers/yocto-poky/meta/recipes-rt/rt-tests/files/run-ptest
new file mode 100644
index 000000000..8e6d3e358
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-rt/rt-tests/files/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+python ./rt_bmark.py
diff --git a/import-layers/yocto-poky/meta/recipes-rt/rt-tests/hwlatdetect_0.96.bb b/import-layers/yocto-poky/meta/recipes-rt/rt-tests/hwlatdetect_0.96.bb
new file mode 100644
index 000000000..962069e3d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-rt/rt-tests/hwlatdetect_0.96.bb
@@ -0,0 +1,23 @@
+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
+
+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}
+}
+
+FILES_${PN} += "${libdir}/python${PYTHON_BASEVERSION}/dist-packages/hwlatdetect.py"
+RDEPENDS_${PN} = "python python-subprocess python-textutils"
+RRECOMMENDS_${PN} = "kernel-module-hwlat-detector"
diff --git a/import-layers/yocto-poky/meta/recipes-rt/rt-tests/rt-tests.inc b/import-layers/yocto-poky/meta/recipes-rt/rt-tests/rt-tests.inc
new file mode 100644
index 000000000..76f9b3a34
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-rt/rt-tests/rt-tests.inc
@@ -0,0 +1,13 @@
+# Version v0.96
+PV = "0.96"
+SRCREV = "24f8c0175e04bab78e7555698e34d7002b01c87f"
+
+SRC_URI = "git://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git"
+
+S = "${WORKDIR}/git"
+
+# need to append rt-tests' default CFLAGS to ours
+CFLAGS += "-I${S}/src/include -D_GNU_SOURCE -Wall -Wno-nonnull"
+
+# calling 'uname -m' is broken on crossbuilds
+EXTRA_OEMAKE = "NUMA=0"
diff --git a/import-layers/yocto-poky/meta/recipes-rt/rt-tests/rt-tests_0.96.bb b/import-layers/yocto-poky/meta/recipes-rt/rt-tests/rt-tests_0.96.bb
new file mode 100644
index 000000000..2f96fea9b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-rt/rt-tests/rt-tests_0.96.bb
@@ -0,0 +1,33 @@
+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://0001-Makefile-Set-CC-AR-variable-only-if-it-doesn-t-have-.patch \
+ file://run-ptest \
+ file://rt_bmark.py \
+ "
+# Do not install hwlatdetect
+EXTRA_OEMAKE += "PYLIB='' CROSS_COMPILE=${TARGET_PREFIX}"
+
+CFLAGS_prepend = "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
+
+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 python python-subprocess python-multiprocessing python-datetime python-re python-lang"
+
+FILES_${PN} += "${prefix}/src/backfire"
diff --git a/import-layers/yocto-poky/meta/recipes-sato/gtk-engines/gtk-sato-engine.inc b/import-layers/yocto-poky/meta/recipes-sato/gtk-engines/gtk-sato-engine.inc
new file mode 100644
index 000000000..93538ed01
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/gtk-engines/gtk-sato-engine.inc
@@ -0,0 +1,25 @@
+SUMMARY = "Sato theme engine for GTK+"
+HOMEPAGE = "http://www.o-hand.com"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "LGPLv2.1 & LGPLv2+"
+
+SECTION = "x11/base"
+DEPENDS = "gtk+"
+RDEPENDS_gtk-theme-sato = "gtk-sato-engine"
+
+inherit distro_features_check
+ANY_OF_DISTRO_FEATURES = "${GTK2DISTROFEATURES}"
+
+PACKAGES += "gtk-theme-sato"
+FILES_${PN} = "${libdir}/gtk-2.0/*/engines/*.so "
+FILES_${PN}-dev = "${libdir}/gtk-2.0/*/engines/*.la"
+FILES_gtk-theme-sato = "${datadir}/icons ${datadir}/themes"
+
+inherit autotools-brokensep pkgconfig
+
+do_configure_prepend() {
+ for i in `ls gtk-common`; do
+ ln -sf ../gtk-common/$i gtk2-engine/$i
+ done
+}
diff --git a/import-layers/yocto-poky/meta/recipes-sato/gtk-engines/gtk-sato-engine_git.bb b/import-layers/yocto-poky/meta/recipes-sato/gtk-engines/gtk-sato-engine_git.bb
new file mode 100644
index 000000000..da4d98ad4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/gtk-engines/gtk-sato-engine_git.bb
@@ -0,0 +1,14 @@
+require gtk-sato-engine.inc
+
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+ file://src/sato-utils.h;endline=24;md5=708f28cfe7fe028d497aaf4389b80b62 \
+ file://src/sato-main.c;endline=24;md5=b5e5dddebca570275becb51b526e4c5a"
+
+SRCREV = "4740ad8d53aba4368ce3e03b06cfdc69eb86dcdc"
+PV = "0.3.3+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/${BPN}"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OECONF += "${@bb.utils.contains('MACHINE_FEATURES', 'qvga', '--with-mode=qvga', '',d)}"
diff --git a/import-layers/yocto-poky/meta/recipes-sato/images/core-image-sato-dev.bb b/import-layers/yocto-poky/meta/recipes-sato/images/core-image-sato-dev.bb
new file mode 100644
index 000000000..7fa69d099
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-sato/images/core-image-sato-sdk-ptest.bb b/import-layers/yocto-poky/meta/recipes-sato/images/core-image-sato-sdk-ptest.bb
new file mode 100644
index 000000000..93e5a4eb6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/images/core-image-sato-sdk-ptest.bb
@@ -0,0 +1,6 @@
+require core-image-sato-sdk.bb
+
+DESCRIPTION += "Also includes ptest packages."
+
+IMAGE_FEATURES += "ptest-pkgs"
+
diff --git a/import-layers/yocto-poky/meta/recipes-sato/images/core-image-sato-sdk.bb b/import-layers/yocto-poky/meta/recipes-sato/images/core-image-sato-sdk.bb
new file mode 100644
index 000000000..d7cc52b52
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-sato/images/core-image-sato.bb b/import-layers/yocto-poky/meta/recipes-sato/images/core-image-sato.bb
new file mode 100644
index 000000000..e3246d2b6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/images/core-image-sato.bb
@@ -0,0 +1,11 @@
+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
+
+IMAGE_INSTALL += "packagegroup-core-x11-sato-games"
diff --git a/import-layers/yocto-poky/meta/recipes-sato/leafpad/files/leafpad.desktop b/import-layers/yocto-poky/meta/recipes-sato/leafpad/files/leafpad.desktop
new file mode 100644
index 000000000..c7e2d5bb5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/leafpad/files/leafpad.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=Notes
+Exec=/usr/bin/leafpad
+Comment=Text Editor
+Icon=accessories-text-editor
+Terminal=false
+Type=Application
+Categories=GTK;Utility;TextEditor;
+X-MB-SingleInstance=true
+StartupNotify=true
diff --git a/import-layers/yocto-poky/meta/recipes-sato/leafpad/files/owl-menu.patch b/import-layers/yocto-poky/meta/recipes-sato/leafpad/files/owl-menu.patch
new file mode 100644
index 000000000..2ebf74a6f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/leafpad/files/owl-menu.patch
@@ -0,0 +1,63 @@
+Upstream-Status: Inappropriate [enable feature]
+
+--- tmp/src/menu.c.orig 2007-04-23 12:08:41.000000000 +0100
++++ tmp/src/menu.c 2007-04-23 12:08:41.000000000 +0100
+@@ -152,7 +152,7 @@
+ }
+
+ accel_group = gtk_accel_group_new();
+- ifactory = gtk_item_factory_new(GTK_TYPE_MENU_BAR, "<main>", accel_group);
++ ifactory = gtk_item_factory_new(GTK_TYPE_MENU, "<main>", accel_group);
+ gtk_item_factory_set_translate_func(ifactory, menu_translate, NULL, NULL);
+ gtk_item_factory_create_items(ifactory, nmenu_items, menu_items, NULL);
+ gtk_window_add_accel_group(GTK_WINDOW(window), accel_group);
+
+--- tmp/src/window.c.orig 2007-04-23 12:14:07.000000000 +0100
++++ tmp/src/window.c 2007-04-23 12:14:07.000000000 +0100
+@@ -18,6 +18,8 @@
+ */
+
+ #include "leafpad.h"
++#include <libowl/owlwindowmenu.h>
++
+ /*
+ static void cb_scroll_event(GtkAdjustment *adj, GtkWidget *view)
+ {
+@@ -52,7 +54,6 @@
+ gtk_container_add(GTK_CONTAINER(window), vbox);
+
+ menubar = create_menu_bar(window);
+- gtk_box_pack_start(GTK_BOX(vbox), menubar, FALSE, FALSE, 0);
+
+ sw = gtk_scrolled_window_new(NULL, NULL);
+ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
+
+--- tmp/src/main.c.orig 2007-04-23 12:15:03.000000000 +0100
++++ tmp/src/main.c 2007-04-23 12:15:03.000000000 +0100
+@@ -244,6 +244,7 @@
+ Conf *conf;
+ GtkItemFactory *ifactory;
+ gchar *stdin_data = NULL;
++ GtkWidget *menu;
+
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ bind_textdomain_codeset(PACKAGE, "UTF-8");
+@@ -293,7 +294,10 @@
+ conf->autoindent);
+
+ gtk_widget_show_all(pub->mw->window);
++ owl_set_window_menu (GTK_WINDOW(pub->mw->window),
++ GTK_MENU(pub->mw->menubar));
++
+ g_free(conf->fontname);
+ g_free(conf);
+
+
+--- tmp/src/Makefile.am.orig 2007-04-23 12:17:54.000000000 +0100
++++ tmp/src/Makefile.am 2007-04-23 12:17:54.000000000 +0100
+@@ -27,4 +27,4 @@
+ i18n.h
+
+ leafpad_CFLAGS = $(GTK_CFLAGS) $(GNOMEPRINT_CFLAGS)
+-leafpad_LDADD = $(GTK_LIBS) $(INTLLIBS) $(GNOMEPRINT_LIBS)
++leafpad_LDADD = $(GTK_LIBS) $(INTLLIBS) $(GNOMEPRINT_LIBS) -lowl
diff --git a/import-layers/yocto-poky/meta/recipes-sato/leafpad/leafpad_0.8.18.1.bb b/import-layers/yocto-poky/meta/recipes-sato/leafpad/leafpad_0.8.18.1.bb
new file mode 100644
index 000000000..093b89f77
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/leafpad/leafpad_0.8.18.1.bb
@@ -0,0 +1,35 @@
+SUMMARY = "Simple GTK+ Text Editor"
+HOMEPAGE = "http://tarot.freeshell.org/leafpad/"
+
+LICENSE = "GPLv2 & GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://src/leafpad.h;endline=20;md5=d3d6a89f5e61e8b13bdea537511ba1fa \
+ file://src/utils.c;endline=20;md5=0d2cc6584ba3202448bb274f62739571"
+
+DEPENDS = "gtk+ intltool-native libowl gettext-native"
+# The libowl requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+SRC_URI = "${SAVANNAH_NONGNU_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \
+ file://leafpad.desktop"
+
+SRC_URI[md5sum] = "254a72fc67505e3aa52884c729cd7b97"
+SRC_URI[sha256sum] = "959d22ae07f22803bc66ff40d373a854532a6e4732680bf8a96a3fbcb9f80a2c"
+PR = "r2"
+
+SRC_URI_append_poky = " file://owl-menu.patch;apply=yes "
+
+inherit autotools pkgconfig distro_features_check
+
+EXTRA_OECONF = " --enable-chooser --disable-emacs --disable-print"
+
+do_install_append () {
+ install -d ${D}/${datadir}
+ install -d ${D}/${datadir}/applications
+ install -m 0644 ${WORKDIR}/leafpad.desktop ${D}/${datadir}/applications
+}
+
+FILES_${PN} += "${datadir}/applications/leafpad.desktop"
+
+PACKAGES += "leafpad-stock-icons"
+FILES_leafpad-stock-icons = "${datadir}/icons/hicolor/"
diff --git a/import-layers/yocto-poky/meta/recipes-sato/libowl/libowl_git.bb b/import-layers/yocto-poky/meta/recipes-sato/libowl/libowl_git.bb
new file mode 100644
index 000000000..9cc47dbd5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/libowl/libowl_git.bb
@@ -0,0 +1,23 @@
+SUMMARY = "OpenedHand Widget Library"
+HOMEPAGE = "http://www.o-hand.com"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "GPLv2 & LGPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://libowl/owlpaned.h;endline=20;md5=7fef844c4cc01b10541a7ab6ab5971af \
+ file://libowl/owltreemodelslice.h;endline=20;md5=a5421f2cdae8debe5e4c48c09a02beb9 \
+ file://libowl/owlcolourswatch.h;endline=24;md5=063c415c58719d536990ca8f606b5730"
+
+SECTION = "libs"
+DEPENDS = "gtk+"
+SRCREV = "6ebc8ac8f8575278dd40a535cadefa26374e44b1"
+PV = "0.1+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/${BPN}"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig distro_features_check
+
+# Requires gdk/gdkx.h which is provided by gtk when x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
diff --git a/import-layers/yocto-poky/meta/recipes-sato/matchbox-config-gtk/files/no-handed.patch b/import-layers/yocto-poky/meta/recipes-sato/matchbox-config-gtk/files/no-handed.patch
new file mode 100644
index 000000000..825694962
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/matchbox-config-gtk/files/no-handed.patch
@@ -0,0 +1,35 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: appearance/mb-appearance.c
+===================================================================
+--- appearance/mb-appearance.c (revision 1614)
++++ appearance/mb-appearance.c (working copy)
+@@ -300,11 +300,13 @@
+ 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
+ }
+ }
+
+@@ -395,12 +397,13 @@
+ gtk_container_add (GTK_CONTAINER (align), font_button);
+
+ /* Left/Right Handed */
+-
++#if 0
+ frame = new_frame (_("Orientation"), &align);
+ gtk_box_pack_start (GTK_BOX (box), frame, TRUE, TRUE, 0);
+ handed_check = gtk_check_button_new_with_mnemonic (_("_Left-handed"));
+ g_signal_connect (handed_check, "toggled", G_CALLBACK (on_handed_set), NULL);
+ gtk_container_add (GTK_CONTAINER (align), handed_check);
++#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);
diff --git a/import-layers/yocto-poky/meta/recipes-sato/matchbox-config-gtk/matchbox-config-gtk_git.bb b/import-layers/yocto-poky/meta/recipes-sato/matchbox-config-gtk/matchbox-config-gtk_git.bb
new file mode 100644
index 000000000..5f73a4c48
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/matchbox-config-gtk/matchbox-config-gtk_git.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+"
+RDEPENDS_${PN} = "settings-daemon"
+
+SRCREV = "3ed74dfb7c57be088a5ab36e446c0ccde9fa1028"
+PV = "0.0+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+SRC_URI = "git://git.yoctoproject.org/${BPN} \
+ file://no-handed.patch;striplevel=0"
+
+inherit autotools pkgconfig distro_features_check
+
+# The settings-daemon requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
diff --git a/import-layers/yocto-poky/meta/recipes-sato/matchbox-desktop-sato/matchbox-desktop-sato_git.bb b/import-layers/yocto-poky/meta/recipes-sato/matchbox-desktop-sato/matchbox-desktop-sato_git.bb
new file mode 100644
index 000000000..1979cbb76
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/matchbox-desktop-sato/matchbox-desktop-sato_git.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Matchbox desktop folders for the Sato environment"
+HOMEPAGE = "http://matchbox-project.org"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+
+SECTION = "x11"
+DEPENDS = ""
+RCONFLICTS_${PN} = "matchbox-common"
+
+SRCREV = "810b0b08eb79e4685202da2ec347b990bb467e07"
+PV = "0.1+git${SRCPV}"
+PR = "r1"
+
+SRC_URI = "git://git.yoctoproject.org/${BPN}"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
+
+FILES_${PN} += "${datadir}"
diff --git a/import-layers/yocto-poky/meta/recipes-sato/matchbox-desktop/files/0001-Do-nothing-on-delete-event-when-not-STANDALONE.patch b/import-layers/yocto-poky/meta/recipes-sato/matchbox-desktop/files/0001-Do-nothing-on-delete-event-when-not-STANDALONE.patch
new file mode 100644
index 000000000..46397dc8a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/matchbox-desktop/files/0001-Do-nothing-on-delete-event-when-not-STANDALONE.patch
@@ -0,0 +1,60 @@
+From 5fe37ef38500f858a22ecdf9bf69bf06e213bf68 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Tue, 22 Mar 2016 12:41:35 +0200
+Subject: [PATCH] Do nothing on delete-event when not STANDALONE
+
+This prevents an opportunistic alt-F4 from closing the desktop.
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+
+Upstream-Status: Backport
+---
+ src/desktop.c | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/src/desktop.c b/src/desktop.c
+index d4fc2fb..94b4ddf 100644
+--- a/src/desktop.c
++++ b/src/desktop.c
+@@ -122,6 +122,15 @@ load_items (TakuMenu *menu)
+
+ }
+
++#ifndef STANDALONE
++static gboolean
++delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer user_data)
++{
++ /* prevent default handler from destroying the window */
++ return TRUE;
++}
++#endif
++
+ static void
+ workarea_changed (int x, int y, int w, int h)
+ {
+@@ -144,11 +153,11 @@ create_desktop (void)
+ gtk_icon_size_register ("taku-icon", 64, 64);
+
+ window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+- g_signal_connect (window, "delete-event", G_CALLBACK (gtk_main_quit), NULL);
+ gtk_widget_set_name (window, "TakuWindow");
+ gtk_window_set_title (GTK_WINDOW (window), _("Desktop"));
+
+ #ifndef STANDALONE
++ g_signal_connect (window, "delete-event", G_CALLBACK (delete_event_cb), NULL);
+ gtk_window_set_type_hint (GTK_WINDOW (window), GDK_WINDOW_TYPE_HINT_DESKTOP);
+ gtk_window_set_skip_taskbar_hint (GTK_WINDOW (window), TRUE);
+
+@@ -156,6 +165,7 @@ create_desktop (void)
+ screen_w = gdk_screen_get_width (screen);
+ screen_h = gdk_screen_get_height (screen);
+ #else
++ g_signal_connect (window, "delete-event", G_CALLBACK (gtk_main_quit), NULL);
+ screen_w = 640;
+ screen_h = 480;
+ #endif
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-sato/matchbox-desktop/matchbox-desktop_git.bb b/import-layers/yocto-poky/meta/recipes-sato/matchbox-desktop/matchbox-desktop_git.bb
new file mode 100644
index 000000000..dbe8c1145
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/matchbox-desktop/matchbox-desktop_git.bb
@@ -0,0 +1,27 @@
+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://libtaku/eggsequence.h;endline=20;md5=b91f68f7642a1459fa1f4c9df94a8f15 \
+ file://src/desktop.c;endline=20;md5=36c9bf295e6007f3423095f405af5a2d \
+ file://src/main.c;endline=19;md5=2044244f97a195c25b7dc602ac7e9a00"
+
+DEPENDS = "gtk+ startup-notification dbus"
+SECTION = "x11/wm"
+SRCREV = "71e3e6e04271e9d5a14f1c231ef100c7f320134d"
+PV = "2.0+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/${BPN}-2 \
+ file://0001-Do-nothing-on-delete-event-when-not-STANDALONE.patch \
+ "
+
+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"
diff --git a/import-layers/yocto-poky/meta/recipes-sato/matchbox-keyboard/files/0001-desktop-file-Hide-the-keyboard-from-app-list.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-sato/matchbox-keyboard/files/80matchboxkeyboard.sh b/import-layers/yocto-poky/meta/recipes-sato/matchbox-keyboard/files/80matchboxkeyboard.sh
new file mode 100644
index 000000000..6cf188b2d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-sato/matchbox-keyboard/matchbox-keyboard_git.bb b/import-layers/yocto-poky/meta/recipes-sato/matchbox-keyboard/matchbox-keyboard_git.bb
new file mode 100644
index 000000000..eba1970ee
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/matchbox-keyboard/matchbox-keyboard_git.bb
@@ -0,0 +1,54 @@
+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 gtk+ matchbox-panel-2"
+
+SRCREV = "ebc330eac8b9d38e9aef9f01e7241c904bd01073"
+PV = "0.0+git${SRCPV}"
+PR = "r4"
+
+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 --enable-gtk-im --enable-applet"
+
+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"
+
+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}/matchbox-panel/*.la
+}
+
+GTKIMMODULES_PACKAGES = "${PN}-im"
+
+RDEPENDS_${PN} = "formfactor dbus-wait"
+RRECOMMENDS_${PN} = "${PN}-applet"
diff --git a/import-layers/yocto-poky/meta/recipes-sato/matchbox-panel-2/files/0001-showdesktop-Make-sure-active-state-is-initialized.patch b/import-layers/yocto-poky/meta/recipes-sato/matchbox-panel-2/files/0001-showdesktop-Make-sure-active-state-is-initialized.patch
new file mode 100644
index 000000000..3bab6d292
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/matchbox-panel-2/files/0001-showdesktop-Make-sure-active-state-is-initialized.patch
@@ -0,0 +1,50 @@
+From a0b5fca04da208990f3c40e65dbb045da4cdb35e Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Sun, 20 Mar 2016 13:24:37 +0200
+Subject: [PATCH] showdesktop: Make sure active state is initialized
+
+There are cases (in qemu at least) where set_active()
+is never called on startup. Make sure we initialize the active
+state so the icon gets loaded and the applet is not confused
+about the current state.
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+
+Upstream-Status: Backport
+---
+ applets/showdesktop/showdesktop.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/applets/showdesktop/showdesktop.c b/applets/showdesktop/showdesktop.c
+index 61dd5c2..33c13e1 100644
+--- a/applets/showdesktop/showdesktop.c
++++ b/applets/showdesktop/showdesktop.c
+@@ -181,6 +181,12 @@ button_clicked_cb (GtkButton *button,
+ &xev);
+ }
+
++static void
++realize_cb (GtkWidget *button, ShowDesktopApplet *applet)
++{
++ sync_applet (applet);
++}
++
+ G_MODULE_EXPORT GtkWidget *
+ mb_panel_applet_create (const char *id,
+ GtkOrientation orientation)
+@@ -216,6 +222,10 @@ mb_panel_applet_create (const char *id,
+ "clicked",
+ G_CALLBACK (button_clicked_cb),
+ applet);
++ g_signal_connect (button,
++ "realize",
++ G_CALLBACK (realize_cb),
++ applet);
+
+ g_object_weak_ref (G_OBJECT (button),
+ (GWeakNotify) show_desktop_applet_free,
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-sato/matchbox-panel-2/files/silence-warnings.patch b/import-layers/yocto-poky/meta/recipes-sato/matchbox-panel-2/files/silence-warnings.patch
new file mode 100644
index 000000000..45ba9a031
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/matchbox-panel-2/files/silence-warnings.patch
@@ -0,0 +1,64 @@
+Don't warn if the machine doesn't actually have a battery, or if the applets
+string contains consecutive separators.
+
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/applets/battery/battery-acpi.c b/applets/battery/battery-acpi.c
+index 6515cb0..c44dd12 100644
+--- a/applets/battery/battery-acpi.c
++++ b/applets/battery/battery-acpi.c
+@@ -14,8 +14,6 @@ int batt_state, ac_state;
+ int pm_support(void)
+ {
+ if(check_acpi_support() == NOT_SUPPORTED){
+- g_warning("No ACPI support\n");
+-
+ return 0;
+ }
+
+@@ -32,8 +30,9 @@ const char* pm_battery_icon(void)
+ const char *icon;
+ battery_t *binfo;
+
++ /* No battery available (not present, disabled, or something
++ else. Silently do nothing. */
+ if (batt_state != SUCCESS) {
+- g_warning("Couldnt initialize ACPI battery\n");
+ return NULL;
+ }
+
+diff --git a/applets/battery/battery-apm.c b/applets/battery/battery-apm.c
+index 5467438..2f39cb6 100644
+--- a/applets/battery/battery-apm.c
++++ b/applets/battery/battery-apm.c
+@@ -10,8 +10,6 @@
+ int pm_support(void)
+ {
+ if (1 == apm_exists ()) {
+- g_warning ("No APM support");
+-
+ return 0;
+ }
+
+diff --git a/matchbox-panel/mb-panel.c b/matchbox-panel/mb-panel.c
+index 2d8cafd..828a36d 100644
+--- a/matchbox-panel/mb-panel.c
++++ b/matchbox-panel/mb-panel.c
+@@ -110,10 +110,15 @@ load_applets (const char *applets_desc,
+ applets = g_strsplit (applets_desc, ",", -1);
+
+ for (i = 0; applets[i]; i++) {
++ char *s;
+ char **bits;
+ GtkWidget *applet;
+
+- bits = g_strsplit (applets[i], ":", 2);
++ s = applets[i];
++ if (s == NULL || s[0] == '\0')
++ continue;
++
++ bits = g_strsplit (s, ":", 2);
+
+ applet = load_applet (bits[0],
+ bits[1],
diff --git a/import-layers/yocto-poky/meta/recipes-sato/matchbox-panel-2/matchbox-panel-2_git.bb b/import-layers/yocto-poky/meta/recipes-sato/matchbox-panel-2/matchbox-panel-2_git.bb
new file mode 100644
index 000000000..98c3ae487
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/matchbox-panel-2/matchbox-panel-2_git.bb
@@ -0,0 +1,39 @@
+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=b0a64fbef3097d79f8264e6907a98f03"
+
+DEPENDS = "gnome-common gtk+ startup-notification dbus dbus-glib"
+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 = "26a3a67b41c50e0ae163d8fe86ccf7a0f0a671ae"
+PV = "2.0+git${SRCPV}"
+
+RPROVIDES_${PN} = "matchbox-panel"
+RREPLACES_${PN} = "matchbox-panel"
+RCONFLICTS_${PN} = "matchbox-panel"
+
+SRC_URI = "git://git.yoctoproject.org/${BPN} \
+ file://0001-showdesktop-Make-sure-active-state-is-initialized.patch \
+ file://silence-warnings.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 "
+FILES_${PN}-dev += "${libdir}/matchbox-panel/*.la"
+
+inherit autotools pkgconfig distro_features_check
diff --git a/import-layers/yocto-poky/meta/recipes-sato/matchbox-sato/matchbox-session-sato/session b/import-layers/yocto-poky/meta/recipes-sato/matchbox-sato/matchbox-session-sato/session
new file mode 100644
index 000000000..42ce483d3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/matchbox-sato/matchbox-session-sato/session
@@ -0,0 +1,33 @@
+#!/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
+
+# Tell GTK+3 we really want server side decorations, even with
+# GtkHeaderBar using applications: Without that mb-panel will render
+# on top of the client side decorations.
+export GTK_CSD=0
+
+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 --titlebar --start-applets $START_APPLETS --end-applets $END_APPLETS &
+
+exec matchbox-window-manager -theme Sato -use_desktop_mode decorated -use_cursor $SHOWCURSOR $@
diff --git a/import-layers/yocto-poky/meta/recipes-sato/matchbox-sato/matchbox-session-sato_0.1.bb b/import-layers/yocto-poky/meta/recipes-sato/matchbox-sato/matchbox-session-sato_0.1.bb
new file mode 100644
index 000000000..76de18ae9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/matchbox-sato/matchbox-session-sato_0.1.bb
@@ -0,0 +1,51 @@
+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"
+DEPENDS = "gconf-native"
+RDEPENDS_${PN} = "formfactor gtk-sato-engine matchbox-theme-sato gtk-theme-sato matchbox-panel-2 matchbox-desktop-sato 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"
+S = "${WORKDIR}"
+
+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 ${D}/${sysconfdir}/matchbox
+ sed -f "$SCRIPT" ${S}/session > ${D}/${sysconfdir}/matchbox/session
+ chmod +x ${D}/${sysconfdir}/matchbox/session
+}
+
+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 Sato
+ set_value string icon_theme Sato
+ set_value bool touchscreen true
+ set_value string font_name "Sans 9"
+}
diff --git a/import-layers/yocto-poky/meta/recipes-sato/matchbox-terminal/matchbox-terminal_git.bb b/import-layers/yocto-poky/meta/recipes-sato/matchbox-terminal/matchbox-terminal_git.bb
new file mode 100644
index 000000000..c8cbd57a6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/matchbox-terminal/matchbox-terminal_git.bb
@@ -0,0 +1,20 @@
+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+ vte"
+SECTION = "x11/utils"
+SRCREV = "452bca253492a97a587f440289b9ab27d217353e"
+PV = "0.0+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/${BPN}"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig distro_features_check
+
+ANY_OF_DISTRO_FEATURES = "${GTK2DISTROFEATURES}"
diff --git a/import-layers/yocto-poky/meta/recipes-sato/matchbox-theme-sato/matchbox-theme-sato.inc b/import-layers/yocto-poky/meta/recipes-sato/matchbox-theme-sato/matchbox-theme-sato.inc
new file mode 100644
index 000000000..d947e1ab0
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-sato/matchbox-theme-sato/matchbox-theme-sato_0.1.bb b/import-layers/yocto-poky/meta/recipes-sato/matchbox-theme-sato/matchbox-theme-sato_0.1.bb
new file mode 100644
index 000000000..f6786dda5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/matchbox-theme-sato/matchbox-theme-sato_0.1.bb
@@ -0,0 +1,8 @@
+require matchbox-theme-sato.inc
+
+PR = "r1"
+
+SRC_URI = "http://pokylinux.org/releases/sato/matchbox-theme-sato-0.1.tar.gz"
+
+SRC_URI[md5sum] = "72ae272ef7803141a3dcb69e670cff97"
+SRC_URI[sha256sum] = "5b59f9646edbfb907a309332db3bd6fa7080dc1fe24df549480cfae7d974a3fb"
diff --git a/import-layers/yocto-poky/meta/recipes-sato/matchbox-theme-sato/matchbox-theme-sato_git.bb b/import-layers/yocto-poky/meta/recipes-sato/matchbox-theme-sato/matchbox-theme-sato_git.bb
new file mode 100644
index 000000000..0d3569de9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/matchbox-theme-sato/matchbox-theme-sato_git.bb
@@ -0,0 +1,12 @@
+require matchbox-theme-sato.inc
+
+SRCREV = "f72cf4ed7d71ad9e47b0f2d3dbc593bc2f3e76f8"
+PV = "0.2+git${SRCPV}"
+
+DEFAULT_PREFERENCE = "-1"
+
+SRC_URI = "git://git.yoctoproject.org/matchbox-sato"
+
+EXTRA_OECONF += "${@bb.utils.contains('MACHINE_FEATURES', 'qvga', '--with-mode=qvga', '',d)}"
+
+S = "${WORKDIR}/git"
diff --git a/import-layers/yocto-poky/meta/recipes-sato/packagegroups/packagegroup-core-x11-sato.bb b/import-layers/yocto-poky/meta/recipes-sato/packagegroups/packagegroup-core-x11-sato.bb
new file mode 100644
index 000000000..8ba49231d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/packagegroups/packagegroup-core-x11-sato.bb
@@ -0,0 +1,62 @@
+#
+# Copyright (C) 2007-2008 OpenedHand Ltd.
+#
+
+SUMMARY = "Sato desktop"
+LICENSE = "MIT"
+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"
+NETWORK_MANAGER_libc-uclibc = ""
+
+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 \
+ sato-icon-theme \
+ settings-daemon \
+ gtk-sato-engine \
+ 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 = "\
+ leafpad \
+ gst-player-bin \
+ matchbox-terminal \
+ sato-screenshot \
+ ${FILEMANAGER} \
+ ${WEB} \
+ "
+
+SUMMARY_${PN}-games = "Sato desktop - games"
+RDEPENDS_${PN}-games = "\
+ oh-puzzles \
+ "
diff --git a/import-layers/yocto-poky/meta/recipes-sato/pcmanfm/files/emblem-symbolic-link.png b/import-layers/yocto-poky/meta/recipes-sato/pcmanfm/files/emblem-symbolic-link.png
new file mode 100644
index 000000000..b8e559456
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/pcmanfm/files/emblem-symbolic-link.png
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-sato/pcmanfm/files/gnome-fs-directory.png b/import-layers/yocto-poky/meta/recipes-sato/pcmanfm/files/gnome-fs-directory.png
new file mode 100644
index 000000000..05921a668
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/pcmanfm/files/gnome-fs-directory.png
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-sato/pcmanfm/files/gnome-fs-regular.png b/import-layers/yocto-poky/meta/recipes-sato/pcmanfm/files/gnome-fs-regular.png
new file mode 100644
index 000000000..ce77a8e62
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/pcmanfm/files/gnome-fs-regular.png
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-sato/pcmanfm/files/gnome-mime-text-plain.png b/import-layers/yocto-poky/meta/recipes-sato/pcmanfm/files/gnome-mime-text-plain.png
new file mode 100644
index 000000000..bfe4bad56
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/pcmanfm/files/gnome-mime-text-plain.png
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-sato/pcmanfm/files/no-desktop.patch b/import-layers/yocto-poky/meta/recipes-sato/pcmanfm/files/no-desktop.patch
new file mode 100644
index 000000000..ae54dbd56
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-sato/pcmanfm/pcmanfm_1.2.4.bb b/import-layers/yocto-poky/meta/recipes-sato/pcmanfm/pcmanfm_1.2.4.bb
new file mode 100644
index 000000000..a6b0aacd2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/pcmanfm/pcmanfm_1.2.4.bb
@@ -0,0 +1,42 @@
+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+ startup-notification libfm intltool-native gettext-native"
+DEPENDS_append_poky = " libowl"
+
+
+COMPATIBLE_HOST = '(x86_64.*|i.86.*|aarch64.*|arm.*|mips.*|powerpc.*|sh.*)-(linux|freebsd.*)'
+
+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] = "19764c2f59653724c8713e0064fa6829"
+SRC_URI[sha256sum] = "38cdbb5f01d24483b41b8e6846e4aa66a5751bb3982a8618899e88a853dbe313"
+
+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"
+
+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/import-layers/yocto-poky/meta/recipes-sato/pulseaudio-sato/pulseaudio-client-conf-sato/50-sato.conf b/import-layers/yocto-poky/meta/recipes-sato/pulseaudio-sato/pulseaudio-client-conf-sato/50-sato.conf
new file mode 100644
index 000000000..97492e7a5
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-sato/pulseaudio-sato/pulseaudio-client-conf-sato_1.bb b/import-layers/yocto-poky/meta/recipes-sato/pulseaudio-sato/pulseaudio-client-conf-sato_1.bb
new file mode 100644
index 000000000..e27339fb4
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-sato/puzzles/files/0001-Use-labs-instead-of-abs.patch b/import-layers/yocto-poky/meta/recipes-sato/puzzles/files/0001-Use-labs-instead-of-abs.patch
new file mode 100644
index 000000000..f43d1df6c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-sato/puzzles/files/0001-rect-Fix-compiler-errors-about-uninitialized-use-of-.patch b/import-layers/yocto-poky/meta/recipes-sato/puzzles/files/0001-rect-Fix-compiler-errors-about-uninitialized-use-of-.patch
new file mode 100644
index 000000000..0b971c432
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/puzzles/files/0001-rect-Fix-compiler-errors-about-uninitialized-use-of-.patch
@@ -0,0 +1,32 @@
+From 78d6d1706c21ad467520075ff7a8bf15cfbd68b3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 30 Dec 2015 22:13:16 +0000
+Subject: [PATCH] rect: Fix compiler errors about uninitialized use of
+ variables
+
+error: 'r2.x' may be used uninitialized in this function
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ rect.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/rect.c b/rect.c
+index 55667c0..fa3a786 100644
+--- a/rect.c
++++ b/rect.c
+@@ -1317,7 +1317,8 @@ static char *new_game_desc(const game_params *params_in, random_state *rs,
+ if (ndirs > 0) {
+ int which, dir;
+ struct rect r1, r2;
+-
++ memset(&r1, 0, sizeof(struct rect));
++ memset(&r2, 0, sizeof(struct rect));
+ which = random_upto(rs, ndirs);
+ dir = dirs[which];
+
+--
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch b/import-layers/yocto-poky/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch
new file mode 100644
index 000000000..c134acde2
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-sato/puzzles/files/oh-puzzles-owl-menu.patch b/import-layers/yocto-poky/meta/recipes-sato/puzzles/files/oh-puzzles-owl-menu.patch
new file mode 100644
index 000000000..7e2c3ab75
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/puzzles/files/oh-puzzles-owl-menu.patch
@@ -0,0 +1,203 @@
+This patch enable owl menu, which is hidden in the title bar to save space on
+small screen. It has not been used for a long time, rebase needed.
+
+Upstream-Status: Inappropriate [enable feature]
+
+Index: src/gtk.c
+===================================================================
+--- src/gtk.c (revision 22)
++++ src/gtk.c (working copy)
+@@ -28,6 +28,8 @@
+ #include <gdk/gdkx.h>
+ #include <gdk-pixbuf/gdk-pixbuf.h>
+
++#include <libowl/owlwindowmenu.h>
++
+ #include <librsvg/rsvg.h>
+
+ #include <X11/Xlib.h>
+@@ -1237,6 +1239,7 @@
+ }
+ }
+
++#if 0
+ static void
+ add_widget (GtkUIManager *merge,
+ GtkWidget *widget,
+@@ -1247,10 +1250,11 @@
+ gtk_box_pack_start (box, widget, FALSE, FALSE, 0);
+
+ toplevel = gtk_widget_get_toplevel (GTK_WIDGET (box));
+- gtk_widget_show_all (toplevel);
+ }
++#endif
+
+ static GtkActionEntry toplevel_actions[] = {
++ { "Top", NULL, "" },
+ { "Game", NULL, N_("Game") },
+ { "Settings", NULL, N_("Settings") },
+ { "Help", NULL, N_("Help") },
+@@ -1303,11 +1307,13 @@
+ frontend *fe)
+ {
+ GString *xml;
++ GError *error = NULL;
+ gboolean presets = FALSE;
+ GSList *radio_group = NULL;
+ int i;
+
+- xml = g_string_new ("<ui><menubar><placeholder name=\"TypePlaceholder\">"
++ xml = g_string_new ("<ui><menubar><menu name=\"TopMenu\" action=\"Top\">"
++ "<placeholder name=\"TypePlaceholder\">"
+ "<menu name=\"SettingsMenu\" action=\"Settings\">");
+
+ for (i = 0; i < midend_num_presets(fe->me); i++) {
+@@ -1359,8 +1365,14 @@
+ "<menuitem name=\"CustomMenu\" action=\"Custom\"/>");
+ }
+
+- g_string_append (xml, "</menu></placeholder></menubar></ui>");
+- gtk_ui_manager_add_ui_from_string (merge, xml->str, -1, NULL);
++ g_string_append (xml, "</menu></placeholder></menu></menubar></ui>");
++
++ gtk_ui_manager_add_ui_from_string (merge, xml->str, -1, &error);
++ if (error != NULL) {
++ g_warning ("Error adding custom: %s", error->message);
++ g_error_free (error);
++ }
++
+ g_string_free (xml, TRUE);
+ }
+
+@@ -1434,6 +1446,7 @@
+ new_window(char *arg, char **error)
+ {
+ frontend *fe;
++ GError *err = NULL;
+ GtkBox *vbox;
+ GtkUIManager *merge;
+ GtkActionGroup *actions;
+@@ -1496,8 +1509,6 @@
+ gtk_window_add_accel_group(GTK_WINDOW(fe->window), fe->accelgroup);
+
+ merge = gtk_ui_manager_new ();
+- g_signal_connect (G_OBJECT (merge), "add_widget",
+- G_CALLBACK (add_widget), vbox);
+
+ actions = gtk_action_group_new ("PuzzleActions");
+ gtk_action_group_add_actions (actions, toplevel_actions,
+@@ -1509,22 +1520,39 @@
+
+ gtk_ui_manager_insert_action_group (merge, actions, 0);
+
+- gtk_ui_manager_add_ui_from_file (merge, DATADIR "/oh-puzzles/ui/menu.xml", NULL);
++ gtk_ui_manager_add_ui_from_file (merge, DATADIR "/oh-puzzles/ui/menu.xml",
++ &err);
++ if (err != NULL) {
++ g_warning ("Error making UI: %s", err->message);
++ g_error_free (err);
++ err = NULL;
++ }
+
+ if (thegame.can_solve) {
+- char *str = "<ui><menubar><menu name=\"GameMenu\" action=\"Game\">"
++ char *str = "<ui><menubar><menu name=\"TopMenu\" action=\"Top\">"
++ "<menu name=\"GameMenu\" action=\"Game\">"
+ "<placeholder name=\"SolvePlaceholder\">"
+ "<separator name=\"SolveSep\"/>"
+ "<menuitem name=\"SolveMenu\" action=\"Solve\"/>"
+- "</placeholder></menu></menubar></ui>";
++ "</placeholder></menu></menu></menubar></ui>";
+
+- gtk_ui_manager_add_ui_from_string (merge, str, -1, NULL);
++ gtk_ui_manager_add_ui_from_string (merge, str, -1, &err);
++ if (err != NULL) {
++ g_warning ("Error adding solve. %s", err->message);
++ g_error_free (err);
++ }
+ }
+
+ if ((n = midend_num_presets(fe->me)) > 0 || thegame.can_configure) {
+ generate_settings_menu (merge, actions, fe);
+ }
+
++ /* Do this so that the menu is packed now instead of in the idle loop */
++ gtk_ui_manager_ensure_update (merge);
++
++ owl_set_window_menu_item (GTK_WINDOW (fe->window),
++ GTK_MENU_ITEM (gtk_ui_manager_get_widget (merge, "/menubar/TopMenu")));
++
+ setup_colours (fe);
+ setup_pixbufs (fe);
+
+@@ -1572,7 +1600,7 @@
+ GDK_BUTTON_RELEASE_MASK |
+ GDK_BUTTON_MOTION_MASK);
+
+- /* The window is shown once the menubar has been added */
++ gtk_widget_show_all (fe->window);
+ return fe;
+ }
+
+Index: src/menu.xml
+===================================================================
+--- src/menu.xml (revision 22)
++++ src/menu.xml (working copy)
+@@ -1,26 +1,25 @@
+ <ui>
+ <menubar>
+-<menu name="GameMenu" action="Game">
+- <menuitem name="NewMenu" action="New"/>
+- <menuitem name="RestartMenu" action="Restart"/>
+-<!-- <menuitem name="SpecificMenu" action="Specific"/> -->
+- <menuitem name="RandomMenu" action="Random"/>
+- <separator name="GameSep1"/>
+- <menuitem name="LoadMenu" action="Load"/>
+- <menuitem name="SaveMenu" action="Save"/>
+- <separator name="GameSep2"/>
+- <menuitem name="UndoMenu" action="Undo"/>
+- <menuitem name="RedoMenu" action="Redo"/>
+- <placeholder name="CopyPlaceholder"/>
+- <placeholder name="SolvePlaceholder"/>
+- <separator name="GameSep3"/>
+- <menuitem name="QuitMenu" action="Quit"/>
+-</menu>
++<menu name="TopMenu" action="Top">
++ <menu name="GameMenu" action="Game">
++ <menuitem name="NewMenu" action="New"/>
++ <menuitem name="RestartMenu" action="Restart"/>
++ <!-- <menuitem name="SpecificMenu" action="Specific"/> -->
++ <menuitem name="RandomMenu" action="Random"/>
++ <separator name="GameSep1"/>
++ <menuitem name="LoadMenu" action="Load"/>
++ <menuitem name="SaveMenu" action="Save"/>
++ <separator name="GameSep2"/>
++ <menuitem name="UndoMenu" action="Undo"/>
++ <menuitem name="RedoMenu" action="Redo"/>
++ <placeholder name="CopyPlaceholder"/>
++ <placeholder name="SolvePlaceholder"/>
++ </menu>
+
+-<placeholder name="TypePlaceholder"/>
+-
+-<menu name="HelpMenu" action="Help">
++ <placeholder name="TypePlaceholder"/>
+ <menuitem name="AboutMenu" action="About"/>
++ <menuitem name="QuitMenu" action="Quit"/>
++
+ </menu>
+ </menubar>
+ </ui>
+Index: src/Makefile.am
+===================================================================
+--- src/Makefile.am (revision 22)
++++ src/Makefile.am (working copy)
+@@ -10,7 +10,7 @@
+ lightup loopy map mines net netslide pattern pegs rect samegame \
+ sixteen slant solo tents twiddle untangle
+
+-libpuzzles_la_LIBADD = $(PUZZLES_LIBS)
++libpuzzles_la_LIBADD = $(PUZZLES_LIBS) -lowl
+ libpuzzles_la_SOURCES = combi.c \
+ configuration.c \
+ drawing.c \
diff --git a/import-layers/yocto-poky/meta/recipes-sato/puzzles/oh-puzzles_git.bb b/import-layers/yocto-poky/meta/recipes-sato/puzzles/oh-puzzles_git.bb
new file mode 100644
index 000000000..dfa68a659
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/puzzles/oh-puzzles_git.bb
@@ -0,0 +1,73 @@
+SUMMARY = "Portable Puzzle Collection"
+HOMEPAGE = "http://o-hand.com/"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENCE;md5=f56ec6772dd1c7c367067bbea8ea1675 \
+ file://src/tree234.h;endline=28;md5=a188e6d250430ca094a54a82f48472a7 \
+ file://src/tree234.c;endline=28;md5=b4feb1976feebf8f1379093ed52f2945"
+
+SECTION = "x11"
+DEPENDS = "gtk+ gconf intltool-native librsvg gettext-native"
+
+# libowl requires x11 in DISTRO_FEATURES
+DEPENDS_append_poky = " ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'libowl', '', d)}"
+
+# Requires gdk/gdkx.h which is provided by gtk when x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+SRCREV = "92f1a20e4b72eed7a35b00984d9793b51dc2fb3b"
+PV = "0.2+git${SRCPV}"
+PR = "r10"
+
+SRC_URI = "git://git.yoctoproject.org/${BPN}"
+SRC_URI_append_poky = " file://oh-puzzles-owl-menu.patch;striplevel=0 "
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig distro_features_check
+
+bindir = "/usr/games"
+
+EXTRA_OEMAKE += "GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1"
+
+do_install_append () {
+ install -d ${D}/${datadir}/applications/
+
+ cd ${D}/${prefix}/games
+ for prog in *; do
+ if [ -x $prog ]; then
+ # Convert prog to Title Case
+ title=$(echo $prog | sed 's/\(^\| \)./\U&/g')
+ echo "making ${D}/${datadir}/applications/$prog.desktop"
+ cat <<STOP > ${D}/${datadir}/applications/$prog.desktop
+[Desktop Entry]
+Name=$title
+Exec=${prefix}/games/$prog
+Icon=applications-games
+Terminal=false
+Type=Application
+Categories=Game;
+StartupNotify=true
+X-MB-SingleInstance=true
+Comment=Play $title.
+STOP
+ fi
+ done
+}
+
+PACKAGES += "${PN}-extra"
+RDEPENDS_${PN}-extra += "oh-puzzles"
+
+FILES_${PN} = "/usr/share/pixmaps /usr/share/oh-puzzles/"
+FILES_${PN}-extra = "/usr/games/ /usr/share/applications /etc/gconf/schemas"
+
+python __anonymous () {
+ var = bb.data.expand("FILES_${PN}", d, 1)
+ data = d.getVar(var, True)
+ for name in ("bridges", "fifteen", "inertia", "map", "samegame", "slant"):
+ data = data + " /usr/games/%s" % name
+ data = data + " /usr/share/applications/%s.desktop" % name
+ data = data + " /etc/gconf/schemas/%s.schemas" % name
+ d.setVar(var, data)
+}
diff --git a/import-layers/yocto-poky/meta/recipes-sato/puzzles/puzzles_git.bb b/import-layers/yocto-poky/meta/recipes-sato/puzzles/puzzles_git.bb
new file mode 100644
index 000000000..346f43bc9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/puzzles/puzzles_git.bb
@@ -0,0 +1,66 @@
+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=33bcd4bce8f3c197f2aefbdbd2d299bc"
+
+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-rect-Fix-compiler-errors-about-uninitialized-use-of-.patch \
+ file://0001-palisade-Fix-warnings-with-clang-on-arm.patch \
+"
+SRCREV = "346584bf6e38232be8773c24fd7dedcbd7b3d9ed"
+PE = "1"
+PV = "0.0+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+inherit autotools-brokensep distro_features_check pkgconfig
+
+PACKAGECONFIG ??= "gtk2"
+PACKAGECONFIG[gtk2] = "--with-gtk=2,,gtk+,"
+PACKAGECONFIG[gtk3] = "--with-gtk=3,,gtk+3,"
+
+do_configure_prepend () {
+ ./mkfiles.pl
+}
+
+FILES_${PN} = "${prefix}/bin/* ${datadir}/applications/*"
+
+do_install () {
+ rm -rf ${D}/*
+ export prefix=${D}
+ export DESTDIR=${D}
+ install -d ${D}/${prefix}/bin/
+ oe_runmake install
+
+
+ install -d ${D}/${datadir}/applications/
+
+ # Create desktop shortcuts
+ cd ${D}/${prefix}/bin
+ for prog in *; do
+ if [ -x $prog ]; then
+ # Convert prog to Title Case
+ title=$(echo $prog | sed 's/\(^\| \)./\U&/g')
+ echo "making ${D}/${datadir}/applications/$prog.desktop"
+ cat <<STOP > ${D}/${datadir}/applications/$prog.desktop
+[Desktop Entry]
+Name=$title
+Exec=${prefix}/bin/$prog
+Icon=applications-games
+Terminal=false
+Type=Application
+Categories=Game;
+StartupNotify=true
+X-MB-SingleInstance=true
+STOP
+ fi
+ done
+}
diff --git a/import-layers/yocto-poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode.inc b/import-layers/yocto-poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode.inc
new file mode 100644
index 000000000..4d5daa661
--- /dev/null
+++ b/import-layers/yocto-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 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/import-layers/yocto-poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode/rxvt.desktop b/import-layers/yocto-poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode/rxvt.desktop
new file mode 100644
index 000000000..882ea4113
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode/rxvt.png b/import-layers/yocto-poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode/rxvt.png
new file mode 100644
index 000000000..e56fa2e9c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode/rxvt.png
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode/xwc.patch b/import-layers/yocto-poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode/xwc.patch
new file mode 100644
index 000000000..16efeef49
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode_9.20.bb b/import-layers/yocto-poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode_9.20.bb
new file mode 100644
index 000000000..3480ec74b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode_9.20.bb
@@ -0,0 +1,8 @@
+require rxvt-unicode.inc
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://src/main.C;beginline=1;endline=31;md5=775485398a09fa7aee6f90464af88432"
+
+SRC_URI[md5sum] = "4a5b823f08d21036f94a6c51e94d025b"
+SRC_URI[sha256sum] = "e73e13fe64b59fd3c8e6e20c00f149d388741f141b8155e4700d3ed40aa94b4e"
diff --git a/import-layers/yocto-poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode_9.22.bb b/import-layers/yocto-poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode_9.22.bb
new file mode 100644
index 000000000..bfa8a614d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-sato/sato-icon-theme/sato-icon-theme/0001-Inherit-the-GNOME-icon-theme.patch b/import-layers/yocto-poky/meta/recipes-sato/sato-icon-theme/sato-icon-theme/0001-Inherit-the-GNOME-icon-theme.patch
new file mode 100644
index 000000000..2c176ee90
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/sato-icon-theme/sato-icon-theme/0001-Inherit-the-GNOME-icon-theme.patch
@@ -0,0 +1,31 @@
+From b9f02989310a3c920589f1aa646bcbf16b2572a0 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Wed, 13 Jun 2012 11:07:33 +0100
+Subject: [PATCH] Inherit the GNOME icon theme
+
+If the GNOME icon theme isn't installed this is a no-op, but if it is then
+you'll get fallback from Sato to GNOME for icons that are not in Sato.
+
+As applications that use the full GNOME icon theme depend on gnome-icon-theme,
+this just works.
+
+Upstream-Status: Backport
+---
+ index.theme | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/index.theme b/index.theme
+index c4b03a7..688fbbf 100644
+--- a/index.theme
++++ b/index.theme
+@@ -1,6 +1,7 @@
+ [Icon Theme]
+ Name=Sato
+ Comment=Sato icon theme
++Inherits=Adwaita
+
+ Directories=16x16/apps,16x16/status,16x16/stock,16x16/places,16x16/mimetypes,16x16/devices,16x16/actions,22x22/apps,22x22/status,22x22/stock,22x22/places,22x22/mimetypes,22x22/devices,22x22/actions,32x32/apps,32x32/status,32x32/stock,32x32/places,32x32/mimetypes,32x32/devices,32x32/actions,48x48/apps,48x48/status,48x48/stock,48x48/places,48x48/mimetypes,48x48/devices,48x48/actions,64x64/apps,64x64/status,64x64/stock,64x64/places,64x64/mimetypes,64x64/devices,64x64/actions,
+
+--
+1.7.10
+
diff --git a/import-layers/yocto-poky/meta/recipes-sato/sato-icon-theme/sato-icon-theme_0.4.1.bb b/import-layers/yocto-poky/meta/recipes-sato/sato-icon-theme/sato-icon-theme_0.4.1.bb
new file mode 100644
index 000000000..ced735f00
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/sato-icon-theme/sato-icon-theme_0.4.1.bb
@@ -0,0 +1,40 @@
+SUMMARY = "Sato icon theme"
+HOMEPAGE = "http://www.o-hand.com"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "CC-BY-SA-3.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=56a830bbe6e4697fe6cbbae01bb7c2b2"
+SECTION = "x11"
+
+PR = "r6"
+
+DEPENDS = "icon-naming-utils-native libxml-simple-perl-native"
+
+SRC_URI = "http://pokylinux.org/releases/sato/${BPN}-${PV}.tar.gz \
+ file://0001-Inherit-the-GNOME-icon-theme.patch"
+
+SRC_URI[md5sum] = "86a847f3128a43a9cf23b7029a656f50"
+SRC_URI[sha256sum] = "0b0a2807a6a96918ac799a86094ec3e8e2c892be0fd679a4232c2a77f2f61732"
+
+inherit autotools pkgconfig allarch gtk-icon-cache perlnative
+
+# The configure script uses pkg-config to find native binaries to execute, so
+# tell it to use our pkg-config-native wrapper.
+export PKG_CONFIG = "pkg-config-native"
+
+FILES_${PN} += "${datadir}/icons/Sato"
+
+do_install_append() {
+ find ${D}${datadir}/icons/Sato/ -maxdepth 1 -type d -exec ln -s preferences-system.png {}/apps/preferences-desktop.png \;
+ find ${D}${datadir}/icons/Sato/ -maxdepth 1 -type d -exec ln -s file-manager.png {}/apps/system-file-manager.png \;
+ find ${D}${datadir}/icons/Sato/ -maxdepth 1 -type d -exec ln -s ../apps/terminal.png {}/places/computer.png \;
+}
+
+# Explictly setting "Sato" as the default icon theme to avoid flickering from
+# the desktop and settings daemon racing. This shouldn't be done here but in the sato image
+pkg_postinst_${PN} () {
+ mkdir -p $D/etc/gtk-2.0
+
+ grep -s -q -e ^gtk-icon-theme-name.*\"Sato\" $D/etc/gtk-2.0/gtkrc || \
+ echo 'gtk-icon-theme-name = "Sato"' >> $D/etc/gtk-2.0/gtkrc
+}
diff --git a/import-layers/yocto-poky/meta/recipes-sato/sato-screenshot/sato-screenshot_git.bb b/import-layers/yocto-poky/meta/recipes-sato/sato-screenshot/sato-screenshot_git.bb
new file mode 100644
index 000000000..1b2b65dfc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/sato-screenshot/sato-screenshot_git.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"
+SRCREV = "3a9688e8a01b63a78f402b4e7c0b8b005fcdfa29"
+PV = "0.1+git${SRCPV}"
+PR = "r2"
+
+SRC_URI = "git://git.yoctoproject.org/screenshot"
+
+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/import-layers/yocto-poky/meta/recipes-sato/settings-daemon/files/70settings-daemon.sh b/import-layers/yocto-poky/meta/recipes-sato/settings-daemon/files/70settings-daemon.sh
new file mode 100644
index 000000000..95374135f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/settings-daemon/files/70settings-daemon.sh
@@ -0,0 +1 @@
+/usr/bin/settings-daemon &
diff --git a/import-layers/yocto-poky/meta/recipes-sato/settings-daemon/files/addsoundkeys.patch b/import-layers/yocto-poky/meta/recipes-sato/settings-daemon/files/addsoundkeys.patch
new file mode 100644
index 000000000..baf06d6b8
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-sato/settings-daemon/files/dso_linking_change_build_fix.patch b/import-layers/yocto-poky/meta/recipes-sato/settings-daemon/files/dso_linking_change_build_fix.patch
new file mode 100644
index 000000000..594374467
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/settings-daemon/files/dso_linking_change_build_fix.patch
@@ -0,0 +1,31 @@
+Upstream-Status: Inappropriate [configuration]
+
+after gcc linking has changed, all the libraries must be explicitely specified to for linking.
+This patch avoids this linking error:
+
+| make all-am^M
+| make[1]: Entering directory `/disk0/pokybuild/build1/tmp/work/i586-poky-linux/settings-daemon-0.0+svnr2059-r3/settings-daemon'^M
+| ccache i586-poky-linux-gcc -march=i586 --sysroot=/disk0/pokybuild/build1/tmp/sysroots/i586-poky-linux -Wall -fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 -ggdb -feliminate-unused-debug-types -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o settings-daemon settings_daemon-xsettings-common.o settings_daemon-xsettings-manager.o settings_daemon-settings-daemon.o -pthread -lgconf-2 -ldbus-glib-1 -ldbus-1 -lpthread -lgdk-x11-2.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0^M
+| /disk0/pokybuild/build1/tmp/sysroots/x86_64-linux/usr/libexec/i586-poky-linux/gcc/i586-poky-linux/4.5.1/ld: *^A: invalid DSO for symbol `XCreateSimpleWindow' definition^M
+| /disk0/pokybuild/build1/tmp/sysroots/i586-poky-linux/usr/lib/libX11.so.6: could not read symbols: Bad value^M
+| collect2: ld returned 1 exit status^M
+| make[1]: *** [settings-daemon] Error 1^M
+| make[1]: Leaving directory `/disk0/pokybuild/build1/tmp/work/i586-poky-linux/settings-daemon-0.0+svnr2059-r3/settings-daemon'^M
+| make: *** [all] Error 2^M
+
+Nitin A Kamble <nitin.a.kamble@intel.com>
+Date: 2011/01/11
+
+Index: settings-daemon/configure.ac
+===================================================================
+--- settings-daemon.orig/configure.ac
++++ settings-daemon/configure.ac
+@@ -14,7 +14,7 @@ AC_PROG_CC
+
+
+ dnl TODO: make gconf optional
+-PKG_CHECK_MODULES(APP, [gconf-2.0 gdk-x11-2.0])
++PKG_CHECK_MODULES(APP, [gconf-2.0 gdk-x11-2.0 x11])
+
+
+ AC_SUBST(APP_CFLAGS)
diff --git a/import-layers/yocto-poky/meta/recipes-sato/settings-daemon/settings-daemon_git.bb b/import-layers/yocto-poky/meta/recipes-sato/settings-daemon/settings-daemon_git.bb
new file mode 100644
index 000000000..c0615530a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/settings-daemon/settings-daemon_git.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+"
+SECTION = "x11"
+SRCREV = "9a99528b02255450db81176abd9bbcc1dab9a4c1"
+PV = "0.0+git${SRCPV}"
+
+
+SRC_URI = "git://git.yoctoproject.org/xsettings-daemon \
+ file://addsoundkeys.patch;apply=yes \
+ file://70settings-daemon.sh \
+ file://dso_linking_change_build_fix.patch"
+
+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/import-layers/yocto-poky/meta/recipes-sato/shutdown-desktop/shutdown-desktop.bb b/import-layers/yocto-poky/meta/recipes-sato/shutdown-desktop/shutdown-desktop.bb
new file mode 100644
index 000000000..ebdd6d123
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/shutdown-desktop/shutdown-desktop.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Provides an icon to shut down the system cleanly"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+ 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/import-layers/yocto-poky/meta/recipes-sato/shutdown-desktop/shutdown-desktop/shutdown.desktop b/import-layers/yocto-poky/meta/recipes-sato/shutdown-desktop/shutdown-desktop/shutdown.desktop
new file mode 100644
index 000000000..662659afc
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-sato/webkit/files/0001-FindGObjectIntrospection.cmake-prefix-variables-obta.patch b/import-layers/yocto-poky/meta/recipes-sato/webkit/files/0001-FindGObjectIntrospection.cmake-prefix-variables-obta.patch
new file mode 100644
index 000000000..fae3b0b2e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/webkit/files/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/import-layers/yocto-poky/meta/recipes-sato/webkit/files/0001-OptionsGTK.cmake-drop-the-hardcoded-introspection-gt.patch b/import-layers/yocto-poky/meta/recipes-sato/webkit/files/0001-OptionsGTK.cmake-drop-the-hardcoded-introspection-gt.patch
new file mode 100644
index 000000000..3d004db29
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/webkit/files/0001-OptionsGTK.cmake-drop-the-hardcoded-introspection-gt.patch
@@ -0,0 +1,35 @@
+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>
+---
+ Source/cmake/OptionsGTK.cmake | 6 ------
+ 1 file changed, 6 deletions(-)
+
+diff --git a/Source/cmake/OptionsGTK.cmake b/Source/cmake/OptionsGTK.cmake
+index e5f1f5b..4698036 100644
+--- a/Source/cmake/OptionsGTK.cmake
++++ b/Source/cmake/OptionsGTK.cmake
+@@ -443,12 +443,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 ()
+-
+ set(DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR ${DERIVED_SOURCES_DIR}/webkitdom)
+ set(DERIVED_SOURCES_WEBKITGTK_DIR ${DERIVED_SOURCES_DIR}/webkitgtk)
+ set(DERIVED_SOURCES_WEBKITGTK_API_DIR ${DERIVED_SOURCES_WEBKITGTK_DIR}/webkit)
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-sato/webkit/files/0001-When-building-introspection-files-add-CMAKE_C_FLAGS-.patch b/import-layers/yocto-poky/meta/recipes-sato/webkit/files/0001-When-building-introspection-files-add-CMAKE_C_FLAGS-.patch
new file mode 100644
index 000000000..44b43cdbb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/webkit/files/0001-When-building-introspection-files-add-CMAKE_C_FLAGS-.patch
@@ -0,0 +1,40 @@
+From bae9f73b2c693b5aa156fed717d6481b60682786 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] 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/WebKit2/PlatformGTK.cmake | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Source/WebKit2/PlatformGTK.cmake b/Source/WebKit2/PlatformGTK.cmake
+index 706f1e8..14a1c3b 100644
+--- a/Source/WebKit2/PlatformGTK.cmake
++++ b/Source/WebKit2/PlatformGTK.cmake
+@@ -884,7 +884,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=
+ LD_LIBRARY_PATH="${INTROSPECTION_ADDITIONAL_LIBRARY_PATH}"
+ ${INTROSPECTION_SCANNER}
+ --quiet
+@@ -930,7 +930,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}"
+ LD_LIBRARY_PATH="${INTROSPECTION_ADDITIONAL_LIBRARY_PATH}"
+ ${INTROSPECTION_SCANNER}
+--
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/0001-Enable-backtrace-on-linux-when-using-glibc.patch b/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/0001-Enable-backtrace-on-linux-when-using-glibc.patch
new file mode 100644
index 000000000..d7e4ef626
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/0001-Enable-backtrace-on-linux-when-using-glibc.patch
@@ -0,0 +1,39 @@
+From 0b68ad206d2d90df78d91cad4da19152084014cf Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 16 Sep 2015 05:15:04 +0000
+Subject: [PATCH] Enable backtrace on linux when using glibc
+
+We dont have backtrace() implemented on non-glibc libc's on linux
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Accepted
+
+ Source/WTF/wtf/Assertions.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Source/WTF/wtf/Assertions.cpp b/Source/WTF/wtf/Assertions.cpp
+index 191d53f..a4d86b5 100644
+--- a/Source/WTF/wtf/Assertions.cpp
++++ b/Source/WTF/wtf/Assertions.cpp
+@@ -68,7 +68,7 @@
+ #include <unistd.h>
+ #endif
+
+-#if OS(DARWIN) || (OS(LINUX) && !defined(__UCLIBC__))
++#if OS(DARWIN) || (OS(LINUX) && defined(__GLIBC__) && !defined(__UCLIBC__))
+ #include <cxxabi.h>
+ #include <dlfcn.h>
+ #include <execinfo.h>
+@@ -225,7 +225,7 @@ void WTFReportArgumentAssertionFailure(const char* file, int line, const char* f
+
+ void WTFGetBacktrace(void** stack, int* size)
+ {
+-#if OS(DARWIN) || (OS(LINUX) && !defined(__UCLIBC__))
++#if OS(DARWIN) || (OS(LINUX) && defined(__GLIBC__) && !defined(__UCLIBC__))
+ *size = backtrace(stack, *size);
+ #elif OS(WINDOWS)
+ // The CaptureStackBackTrace function is available in XP, but it is not defined
+--
+2.5.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/0001-Fix-build-with-non-glibc-libraries-on-linux.patch b/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/0001-Fix-build-with-non-glibc-libraries-on-linux.patch
new file mode 100644
index 000000000..77ebf37ef
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/0001-Fix-build-with-non-glibc-libraries-on-linux.patch
@@ -0,0 +1,61 @@
+From 30e2ef302a329850ba55c7c458c98cbf396186ec Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 31 Dec 2015 21:47:34 +0000
+Subject: [PATCH] Fix build with non-glibc libraries on linux
+
+qualify isnan() calls with std namespace
+malloc_trim is glibc specific API so guard it with __GLIBC__
+let ctype be used on non-glibc ( musl ) C library
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Accepted
+
+ Source/JavaScriptCore/runtime/Options.cpp | 2 +-
+ Source/WTF/wtf/DisallowCType.h | 2 +-
+ Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp | 2 ++
+ 3 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/Source/JavaScriptCore/runtime/Options.cpp b/Source/JavaScriptCore/runtime/Options.cpp
+index fe830b4..c49aade 100644
+--- a/Source/JavaScriptCore/runtime/Options.cpp
++++ b/Source/JavaScriptCore/runtime/Options.cpp
+@@ -610,7 +610,7 @@ bool Option::operator==(const Option& other) const
+ case Options::Type::unsignedType:
+ return m_entry.unsignedVal == other.m_entry.unsignedVal;
+ case Options::Type::doubleType:
+- return (m_entry.doubleVal == other.m_entry.doubleVal) || (isnan(m_entry.doubleVal) && isnan(other.m_entry.doubleVal));
++ return (m_entry.doubleVal == other.m_entry.doubleVal) || (std::isnan(m_entry.doubleVal) && std::isnan(other.m_entry.doubleVal));
+ case Options::Type::int32Type:
+ return m_entry.int32Val == other.m_entry.int32Val;
+ case Options::Type::optionRangeType:
+diff --git a/Source/WTF/wtf/DisallowCType.h b/Source/WTF/wtf/DisallowCType.h
+index d85e767..dc6bcab 100644
+--- a/Source/WTF/wtf/DisallowCType.h
++++ b/Source/WTF/wtf/DisallowCType.h
+@@ -40,7 +40,7 @@
+ // are used from wx headers. On GTK+ for Mac many GTK+ files include <libintl.h>
+ // or <glib/gi18n-lib.h>, which in turn include <xlocale/_ctype.h> which uses
+ // isacii().
+-#if !(OS(DARWIN) && PLATFORM(GTK)) && !PLATFORM(EFL) && !defined(_LIBCPP_VERSION)
++#if !(OS(DARWIN) && PLATFORM(GTK)) && !PLATFORM(EFL) && !defined(_LIBCPP_VERSION) && defined(__GLIBC__)
+
+ #include <ctype.h>
+
+diff --git a/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp b/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp
+index ea61909..1495642 100644
+--- a/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp
++++ b/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp
+@@ -202,7 +202,9 @@ void MemoryPressureHandler::respondToMemoryPressure(Critical critical, Synchrono
+ void MemoryPressureHandler::platformReleaseMemory(Critical)
+ {
+ ReliefLogger log("Run malloc_trim");
++#ifdef __GLIBC__
+ malloc_trim(0);
++#endif
+ }
+
+ void MemoryPressureHandler::ReliefLogger::platformLog()
+--
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/clang.patch b/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/clang.patch
new file mode 100644
index 000000000..e5267138b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk/clang.patch
@@ -0,0 +1,25 @@
+Clang's builtin for clear_cache accepts char* and errors out when using void*,
+using char* work on both gcc and clang since char* is auto-converted to void* in gcc case
+
+Source/JavaScriptCore/assembler/ARM64Assembler.h:2857:33: error: cannot initialize a parameter of type 'char *' with an rvalue of type 'void *'
+ __builtin___clear_cache(reinterpret_cast<void*>(begin), reinterpret_cast<void*>(end));
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+1 error generated.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Accepted
+
+Index: webkitgtk-2.8.5/Source/JavaScriptCore/assembler/ARM64Assembler.h
+===================================================================
+--- webkitgtk-2.8.5.orig/Source/JavaScriptCore/assembler/ARM64Assembler.h
++++ webkitgtk-2.8.5/Source/JavaScriptCore/assembler/ARM64Assembler.h
+@@ -2854,7 +2854,7 @@ public:
+ #if OS(LINUX) && COMPILER(GCC)
+ static inline void linuxPageFlush(uintptr_t begin, uintptr_t end)
+ {
+- __builtin___clear_cache(reinterpret_cast<void*>(begin), reinterpret_cast<void*>(end));
++ __builtin___clear_cache(reinterpret_cast<char*>(begin), reinterpret_cast<char*>(end));
+ }
+ #endif
+
diff --git a/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk_2.10.7.bb b/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk_2.10.7.bb
new file mode 100644
index 000000000..8eb6b9f3b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-sato/webkit/webkitgtk_2.10.7.bb
@@ -0,0 +1,88 @@
+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/WebKit/LICENSE;md5=4646f90082c40bcf298c285f8bab0b12 \
+ 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://clang.patch \
+ file://0001-Enable-backtrace-on-linux-when-using-glibc.patch \
+ file://0001-Fix-build-with-non-glibc-libraries-on-linux.patch \
+ 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 \
+ "
+SRC_URI[md5sum] = "84832b9d8329413b4f1d87df5f7e8efe"
+SRC_URI[sha256sum] = "990d62c82ed6dede31a6ff0a82d847f16b812842ff3e1093d17113627652864e"
+
+inherit cmake lib_package pkgconfig perlnative pythonnative distro_features_check upstream-version-is-even gobject-introspection
+
+# depends on libxt
+REQUIRED_DISTRO_FEATURES = "x11"
+
+DEPENDS = "zlib libsoup-2.4 curl libxml2 cairo libxslt libxt libidn gnutls \
+ gtk+3 gstreamer1.0 gstreamer1.0-plugins-base flex-native gperf-native sqlite3 \
+ pango icu bison-native gnome-common gawk intltool-native libwebp \
+ atk udev harfbuzz jpeg libpng pulseaudio librsvg libtheora libvorbis libxcomposite libxtst \
+ ruby-native libnotify gstreamer1.0-plugins-bad \
+ "
+
+PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'x11', 'x11', 'wayland' ,d)} \
+ ${@base_contains('DISTRO_FEATURES', 'opengl', 'webgl', '' ,d)} \
+ enchant \
+ gtk2 \
+ 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[libsecret] = "-DENABLE_CREDENTIAL_STORAGE=ON,-DENABLE_CREDENTIAL_STORAGE=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)} \
+ -DENABLE_GTKDOC=OFF \
+ -DENABLE_MINIBROWSER=ON \
+ "
+
+# 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 ARMv5/6 anymore, apparently they test only on v7 onwards
+EXTRA_OECMAKE_append_armv5 = " -DENABLE_JIT=OFF "
+EXTRA_OECMAKE_append_armv6 = " -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 "
+
+# JIT not supported on MIPS either
+EXTRA_OECMAKE_append_mips = " -DENABLE_JIT=OFF "
+EXTRA_OECMAKE_append_mips64 = " -DENABLE_JIT=OFF "
+
+FILES_${PN} += "${libdir}/webkit2gtk-4.0/injected-bundle/libwebkit2gtkinjectedbundle.so"
+
+# http://errors.yoctoproject.org/Errors/Details/20370/
+ARM_INSTRUCTION_SET = "arm"
+
+# Invalid data memory access: 0x00000000
+# ...
+# qemu: uncaught target signal 11 (Segmentation fault) - core dumped
+# Segmentation fault
+EXTRA_OECMAKE_append_powerpc = " -DENABLE_INTROSPECTION=OFF "
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/apr/apr-util/configfix.patch b/import-layers/yocto-poky/meta/recipes-support/apr/apr-util/configfix.patch
new file mode 100644
index 000000000..dbb114880
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/apr/apr-util/configure_fixes.patch b/import-layers/yocto-poky/meta/recipes-support/apr/apr-util/configure_fixes.patch
new file mode 100644
index 000000000..91e244ce2
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/apr/apr-util/run-ptest b/import-layers/yocto-poky/meta/recipes-support/apr/apr-util/run-ptest
new file mode 100644
index 000000000..ae19a1d11
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/apr/apr-util_1.5.4.bb b/import-layers/yocto-poky/meta/recipes-support/apr/apr-util_1.5.4.bb
new file mode 100644
index 000000000..2b8676fef
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/apr/apr-util_1.5.4.bb
@@ -0,0 +1,95 @@
+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=519e0a18e03f7c023070568c14b077bb \
+ 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] = "866825c04da827c6e5f53daff5569f42"
+SRC_URI[sha256sum] = "976a12a59bc286d634a21d7be0841cc74289ea9077aa1af46be19d1a6e844c19"
+
+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
+
+PR = "r1"
+
+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/import-layers/yocto-poky/meta/recipes-support/apr/apr/Fix-packet-discards-HTTP-redirect.patch b/import-layers/yocto-poky/meta/recipes-support/apr/apr/Fix-packet-discards-HTTP-redirect.patch
new file mode 100644
index 000000000..6805b8b6e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/apr/apr/Fix-packet-discards-HTTP-redirect.patch
@@ -0,0 +1,32 @@
+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>
+---
+ 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 c133a26..e8faf15 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.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/apr/apr/cleanup.patch b/import-layers/yocto-poky/meta/recipes-support/apr/apr/cleanup.patch
new file mode 100644
index 000000000..b6784e015
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/apr/apr/cleanup.patch
@@ -0,0 +1,43 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: apr-1.4.2/build/buildcheck.sh
+===================================================================
+--- apr-1.4.2.orig/build/buildcheck.sh 2009-11-13 08:27:16.000000000 +0800
++++ apr-1.4.2/build/buildcheck.sh 2010-11-26 15:44:00.000000000 +0800
+@@ -32,35 +32,4 @@
+ echo "buildconf: autoconf version $ac_version (ok)"
+ fi
+
+-# Sample libtool --version outputs:
+-# ltmain.sh (GNU libtool) 1.3.3 (1.385.2.181 1999/07/02 15:49:11)
+-# ltmain.sh (GNU libtool 1.1361 2004/01/02 23:10:52) 1.5a
+-# output is multiline from 1.5 onwards
+-
+-# Require libtool 1.4 or newer
+-libtool=`build/PrintPath glibtool1 glibtool libtool libtool15 libtool14`
+-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."
+-echo " You need libtool version 1.4 or newer installed"
+-echo " to build APR from SVN."
+-exit 1
+-fi
+-lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'`
+-IFS=.; set $lt_version; IFS=' '
+-lt_status="good"
+-if test "$1" = "1"; then
+- if test "$2" -lt "4"; then
+- lt_status="bad"
+- fi
+-fi
+-if test $lt_status = "good"; then
+- echo "buildconf: libtool version $lt_pversion (ok)"
+- exit 0
+-fi
+-
+-echo "buildconf: libtool version $lt_pversion found."
+-echo " You need libtool version 1.4 or newer installed"
+-echo " to build APR from SVN."
+-
+-exit 1
++exit 0
diff --git a/import-layers/yocto-poky/meta/recipes-support/apr/apr/configfix.patch b/import-layers/yocto-poky/meta/recipes-support/apr/apr/configfix.patch
new file mode 100644
index 000000000..605c4f632
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/apr/apr/configfix.patch
@@ -0,0 +1,53 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: apr-1.3.3/apr-config.in
+===================================================================
+--- apr-1.3.3.orig/apr-config.in 2009-01-12 15:16:31.000000000 +0000
++++ apr-1.3.3/apr-config.in 2009-01-12 15:19:25.000000000 +0000
+@@ -152,14 +152,7 @@
+ 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 +167,14 @@
+ 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"
diff --git a/import-layers/yocto-poky/meta/recipes-support/apr/apr/configure.in-fix-LTFLAGS-to-make-it-work-with-ccache.patch b/import-layers/yocto-poky/meta/recipes-support/apr/apr/configure.in-fix-LTFLAGS-to-make-it-work-with-ccache.patch
new file mode 100644
index 000000000..7521eeb46
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/apr/apr/configure.in-fix-LTFLAGS-to-make-it-work-with-ccache.patch
@@ -0,0 +1,36 @@
+From d439093aa07a486f559206ac9e5808a6a18218cd 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] 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 5a4a988..9d57ae6 100644
+--- a/configure.in
++++ b/configure.in
+@@ -246,7 +246,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.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/apr/apr/configure_fixes.patch b/import-layers/yocto-poky/meta/recipes-support/apr/apr/configure_fixes.patch
new file mode 100644
index 000000000..051400059
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/apr/apr/configure_fixes.patch
@@ -0,0 +1,68 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: apr-1.3.3/configure.in
+===================================================================
+--- apr-1.3.3.orig/configure.in
++++ apr-1.3.3/configure.in
+@@ -794,39 +794,6 @@ AC_CHECK_FUNCS([mmap munmap shm_open shm
+ create_area])
+
+ APR_CHECK_DEFINE(MAP_ANON, sys/mman.h)
+-AC_CHECK_FILE(/dev/zero)
+-
+-# Not all systems can mmap /dev/zero (such as HP-UX). Check for that.
+-if test "$ac_cv_func_mmap" = "yes" &&
+- test "$ac_cv_file__dev_zero" = "yes"; then
+- AC_MSG_CHECKING(for mmap that can map /dev/zero)
+- AC_TRY_RUN([
+-#include <sys/types.h>
+-#include <sys/stat.h>
+-#include <fcntl.h>
+-#ifdef HAVE_SYS_MMAN_H
+-#include <sys/mman.h>
+-#endif
+- int main()
+- {
+- int fd;
+- void *m;
+- fd = open("/dev/zero", O_RDWR);
+- if (fd < 0) {
+- return 1;
+- }
+- m = mmap(0, sizeof(void*), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
+- if (m == (void *)-1) { /* aka MAP_FAILED */
+- return 2;
+- }
+- if (munmap(m, sizeof(void*)) < 0) {
+- return 3;
+- }
+- return 0;
+- }], [], [ac_cv_file__dev_zero=no], [ac_cv_file__dev_zero=no])
+-
+- AC_MSG_RESULT($ac_cv_file__dev_zero)
+-fi
+
+ # Now we determine which one is our anonymous shmem preference.
+ haveshmgetanon="0"
+@@ -1518,13 +1485,14 @@ else
+ bigendian=0
+ fi
+
+-APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>
+-#include <sys/uio.h>],struct iovec,0)
+-if test "$ac_cv_sizeof_struct_iovec" = "0"; then
+- have_iovec=0
+-else
+- have_iovec=1
+-fi
++#APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>
++##include <sys/uio.h>],struct iovec,0)
++#if test "$ac_cv_sizeof_struct_iovec" = "0"; then
++# have_iovec=0
++#else
++# have_iovec=1
++#fi
++have_iovec=1
+
+ AC_SUBST(voidp_size)
+ AC_SUBST(short_value)
diff --git a/import-layers/yocto-poky/meta/recipes-support/apr/apr/run-ptest b/import-layers/yocto-poky/meta/recipes-support/apr/apr/run-ptest
new file mode 100644
index 000000000..ae19a1d11
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/apr/apr/upgrade-and-fix-1.5.1.patch b/import-layers/yocto-poky/meta/recipes-support/apr/apr/upgrade-and-fix-1.5.1.patch
new file mode 100644
index 000000000..16499f5ac
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/apr/apr/upgrade-and-fix-1.5.1.patch
@@ -0,0 +1,45 @@
+Makefile.in: fix cross compiling failed
+
+The tools/gen_test_char was invoked at build time,
+and it didn't work for the cross compiling, so we
+compile it with $BUILD_CC.
+
+Remove the 'tools' dir creation, it always existed.
+And it caused gen_test_char unexpected rebuilt at
+do_install time.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ Makefile.in | 10 ++--------
+ 1 file changed, 2 insertions(+), 8 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index a2a5194..5fe028f 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -46,7 +46,6 @@ 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 \
+ include/private/apr_escape_test_char.h
+ DISTCLEAN_TARGETS = config.cache config.log config.status \
+ include/apr.h include/arch/unix/apr_private.h \
+@@ -129,13 +128,8 @@ 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
+- $(APR_MKDIR) tools
+- $(LT_COMPILE)
+-
+-tools/gen_test_char@EXEEXT@: $(OBJECTS_gen_test_char)
+- $(LINK_PROG) $(OBJECTS_gen_test_char) $(ALL_LIBS)
++tools/gen_test_char@EXEEXT@: tools/gen_test_char.c
++ $(BUILD_CC) $(CFLAGS_FOR_BUILD) $< -o $@
+
+ include/private/apr_escape_test_char.h: tools/gen_test_char@EXEEXT@
+ $(APR_MKDIR) include/private
diff --git a/import-layers/yocto-poky/meta/recipes-support/apr/apr_1.5.2.bb b/import-layers/yocto-poky/meta/recipes-support/apr/apr_1.5.2.bb
new file mode 100644
index 000000000..db1530530
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/apr/apr_1.5.2.bb
@@ -0,0 +1,109 @@
+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://configure_fixes.patch \
+ file://cleanup.patch \
+ file://configfix.patch \
+ file://run-ptest \
+ file://upgrade-and-fix-1.5.1.patch \
+ file://Fix-packet-discards-HTTP-redirect.patch \
+ file://configure.in-fix-LTFLAGS-to-make-it-work-with-ccache.patch \
+"
+
+SRC_URI[md5sum] = "4e9769f3349fe11fc0a5e1b224c236aa"
+SRC_URI[sha256sum] = "7d03ed29c22a7152be45b8e50431063736df9e1daa1ddf93f6a547ba7a28f67a"
+
+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"
+
+# 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 = ""
+
+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}
+ ./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,${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/import-layers/yocto-poky/meta/recipes-support/argp-standalone/argp-standalone_1.3.bb b/import-layers/yocto-poky/meta/recipes-support/argp-standalone/argp-standalone_1.3.bb
new file mode 100644
index 000000000..d61c8be24
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/argp-standalone/argp-standalone_1.3.bb
@@ -0,0 +1,29 @@
+# Copyright (C) 2015 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+DESCRIPTION = "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__"
+
+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/import-layers/yocto-poky/meta/recipes-support/argp-standalone/files/0001-throw-in-funcdef.patch b/import-layers/yocto-poky/meta/recipes-support/argp-standalone/files/0001-throw-in-funcdef.patch
new file mode 100644
index 000000000..a6e2759c5
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/argp-standalone/files/0002-isprint.patch b/import-layers/yocto-poky/meta/recipes-support/argp-standalone/files/0002-isprint.patch
new file mode 100644
index 000000000..1c07eea3c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/argp-standalone/files/out_of_tree_build.patch b/import-layers/yocto-poky/meta/recipes-support/argp-standalone/files/out_of_tree_build.patch
new file mode 100644
index 000000000..b7777cbd9
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/aspell/aspell_0.60.6.1.bb b/import-layers/yocto-poky/meta/recipes-support/aspell/aspell_0.60.6.1.bb
new file mode 100644
index 000000000..5a23754b7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/aspell/aspell_0.60.6.1.bb
@@ -0,0 +1,29 @@
+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"
+
+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/import-layers/yocto-poky/meta/recipes-support/atk/at-spi2-atk_2.18.1.bb b/import-layers/yocto-poky/meta/recipes-support/atk/at-spi2-atk_2.18.1.bb
new file mode 100644
index 000000000..b8a93f3dc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/atk/at-spi2-atk_2.18.1.bb
@@ -0,0 +1,21 @@
+SUMMARY = "AT-SPI 2 Toolkit Bridge"
+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] = "d7040a55df975865ab0d74a4b325afb5"
+SRC_URI[sha256sum] = "c4b15f9386d34d464ddad5f6cc85669742c016df87141ceee93513245979c12d"
+
+DEPENDS = "dbus glib-2.0 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/import-layers/yocto-poky/meta/recipes-support/atk/at-spi2-core/0001-nls.m4-Take-it-from-gettext-0.15.patch b/import-layers/yocto-poky/meta/recipes-support/atk/at-spi2-core/0001-nls.m4-Take-it-from-gettext-0.15.patch
new file mode 100644
index 000000000..69a51d566
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/atk/at-spi2-core/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/import-layers/yocto-poky/meta/recipes-support/atk/at-spi2-core_2.18.3.bb b/import-layers/yocto-poky/meta/recipes-support/atk/at-spi2-core_2.18.3.bb
new file mode 100644
index 000000000..eced59750
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/atk/at-spi2-core_2.18.3.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Assistive Technology Service Provider Interface (dbus core)"
+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-nls.m4-Take-it-from-gettext-0.15.patch \
+ "
+
+SRC_URI[md5sum] = "fc18801e56f6ce6914126f837d42f556"
+SRC_URI[sha256sum] = "ada26add94155f97d0f601a20cb7a0e3fd3ba1588c3520b7288316494027d629"
+
+DEPENDS = "dbus glib-2.0 virtual/libx11 libxi libxtst intltool-native gettext-native"
+
+inherit autotools gtk-doc pkgconfig distro_features_check upstream-version-is-even gobject-introspection
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+EXTRA_OECONF = "--disable-xevie --with-dbus-daemondir=${bindir}"
+
+FILES_${PN} += "${datadir}/dbus-1/services/*.service \
+ ${datadir}/dbus-1/accessibility-services/*.service"
diff --git a/import-layers/yocto-poky/meta/recipes-support/atk/atk_2.18.0.bb b/import-layers/yocto-poky/meta/recipes-support/atk/atk_2.18.0.bb
new file mode 100644
index 000000000..3c0e82df6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/atk/atk_2.18.0.bb
@@ -0,0 +1,21 @@
+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 upstream-version-is-even gobject-introspection
+
+SRC_URI[archive.md5sum] = "fd3678f35004b4c92e3da39356996054"
+SRC_URI[archive.sha256sum] = "ce6c48d77bf951083029d5a396dd552d836fff3c1715d3a7022e917e46d0c92b"
+
+BBCLASSEXTEND = "native"
+
+EXTRA_OECONF = "--disable-glibtest \
+ "
diff --git a/import-layers/yocto-poky/meta/recipes-support/attr/acl.inc b/import-layers/yocto-poky/meta/recipes-support/attr/acl.inc
new file mode 100644
index 000000000..198fb4fed
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/attr/acl.inc
@@ -0,0 +1,41 @@
+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://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 \
+"
+
+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 -cf - test/ --exclude nfs | ( 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/
+}
+
+RDEPENDS_${PN}-ptest = "acl bash coreutils perl perl-module-filehandle perl-module-getopt-std perl-module-posix shadow"
diff --git a/import-layers/yocto-poky/meta/recipes-support/attr/acl/acl-fix-the-order-of-expected-output-of-getfacl.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/attr/acl/add-missing-configure.ac.patch b/import-layers/yocto-poky/meta/recipes-support/attr/acl/add-missing-configure.ac.patch
new file mode 100644
index 000000000..eb6979fa3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/attr/acl/add-missing-configure.ac.patch
@@ -0,0 +1,59 @@
+Upstream-Status: Backport [configure.ac is missing from tarball]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: acl-2.2.52/configure.ac
+===================================================================
+--- /dev/null
++++ acl-2.2.52/configure.ac
+@@ -0,0 +1,50 @@
++
++# 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/import-layers/yocto-poky/meta/recipes-support/attr/acl/run-ptest b/import-layers/yocto-poky/meta/recipes-support/attr/acl/run-ptest
new file mode 100644
index 000000000..3b31cc99a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/attr/acl/run-ptest
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+gpasswd -a daemon bin
+make -C test -k tests root-tests |sed \
+ -e 's|^\[.*\] \(.*\) -- ok$|PASS: \1|' \
+ -e 's|^\[.*\] \(.*\) -- failed|FAIL: \1|'
+gpasswd -d daemon bin
diff --git a/import-layers/yocto-poky/meta/recipes-support/attr/acl/test-fix-insufficient-quoting-of.patch b/import-layers/yocto-poky/meta/recipes-support/attr/acl/test-fix-insufficient-quoting-of.patch
new file mode 100644
index 000000000..0b350be56
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/attr/acl/test-fix-insufficient-quoting-of.patch
@@ -0,0 +1,108 @@
+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>
+---
+ test/cp.test | 2 +-
+ test/misc.test | 6 +++---
+ test/sbits-restore.test | 6 +++---
+ 3 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/test/cp.test b/test/cp.test
+index 0867f63..a927195 100644
+--- a/test/cp.test
++++ b/test/cp.test
+@@ -9,7 +9,7 @@ The cp utility should only copy ACLs if `-p' is given.
+ > -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
+diff --git a/test/misc.test b/test/misc.test
+index 6e98053..29372b7 100644
+--- a/test/misc.test
++++ b/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
+diff --git a/test/sbits-restore.test b/test/sbits-restore.test
+index de21340..5899b0a 100644
+--- a/test/sbits-restore.test
++++ b/test/sbits-restore.test
+@@ -13,10 +13,10 @@ Ensure setting of SUID/SGID/sticky via --restore works
+ $ 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
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/attr/acl/test-fixups-on-SELinux-machines-for-root-testcases.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/attr/acl_2.2.52.bb b/import-layers/yocto-poky/meta/recipes-support/attr/acl_2.2.52.bb
new file mode 100644
index 000000000..ecdbdb6b7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/attr/acl_2.2.52.bb
@@ -0,0 +1,9 @@
+require acl.inc
+
+SRC_URI += "file://add-missing-configure.ac.patch"
+
+SRC_URI[md5sum] = "a61415312426e9c2212bd7dc7929abda"
+SRC_URI[sha256sum] = "179074bb0580c06c4b4137be4c5a92a701583277967acdb5546043c7874e0d23"
+
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/attr/attr.inc b/import-layers/yocto-poky/meta/recipes-support/attr/attr.inc
new file mode 100644
index 000000000..68609784d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/attr/attr.inc
@@ -0,0 +1,39 @@
+SUMMARY = "Utilities for manipulating filesystem extended attributes"
+HOMEPAGE = "http://savannah.nongnu.org/projects/attr/"
+SECTION = "libs"
+
+DEPENDS = "ncurses 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 -cf - test/ --exclude ext | ( 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
+}
+
+RDEPENDS_${PN}-ptest = "attr coreutils perl-module-filehandle perl-module-getopt-std perl-module-posix"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/attr/attr_2.4.47.bb b/import-layers/yocto-poky/meta/recipes-support/attr/attr_2.4.47.bb
new file mode 100644
index 000000000..44eee3964
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/attr/attr_2.4.47.bb
@@ -0,0 +1,12 @@
+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_append += "file://attr-Missing-configure.ac.patch \
+ file://dont-use-decl-macros.patch \
+ "
+
+SRC_URI[md5sum] = "84f58dec00b60f2dc8fd1c9709291cc7"
+SRC_URI[sha256sum] = "25772f653ac5b2e3ceeb89df50e4688891e21f723c460636548971652af0a859"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/attr/ea-acl.inc b/import-layers/yocto-poky/meta/recipes-support/attr/ea-acl.inc
new file mode 100644
index 000000000..370e16f4a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/attr/ea-acl.inc
@@ -0,0 +1,52 @@
+# this build system is mostly shared by attr and acl
+
+SRC_URI += "file://relative-libdir.patch;striplevel=0 \
+ "
+
+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_OEMAKE = "PKG_LIB_DIR=${base_libdir} PKG_DEVLIB_DIR=${libdir}"
+
+do_install () {
+ oe_runmake install install-lib install-dev DIST_ROOT="${D}"
+}
+
+PACKAGES =+ "lib${BPN}"
+
+FILES_lib${BPN} = "${base_libdir}/lib*${SOLIBS}"
+
+BBCLASSEXTEND = "native"
+# Only append ldflags for target recipe and if USE_NLS is enabled
+LDFLAGS_append_libc-uclibc_class-target = "${@['', ' -lintl '][(d.getVar('USE_NLS', True) == 'yes')]}"
+EXTRA_OECONF_append_libc-uclibc_class-target = "${@['', ' --disable-gettext '][(d.getVar('USE_NLS', True) == 'no')]}"
+
+fix_symlink () {
+ if [ "${BB_CURRENTTASK}" != "populate_sysroot" -a "${BB_CURRENTTASK}" != "populate_sysroot_setscene" ]
+ then
+ return
+ fi
+
+ if test "${libdir}" = "${base_libdir}" ; then
+ return
+ fi
+ # Remove bad symlinks & create the correct symlinks
+ if test -L ${libdir}/lib${BPN}.so ; then
+ rm -rf ${libdir}/lib${BPN}.so
+ ln -sf ${base_libdir}/lib${BPN}.so ${libdir}/lib${BPN}.so
+ fi
+ if test -L ${base_libdir}/lib${BPN}.a ; then
+ rm -rf ${base_libdir}/lib${BPN}.a
+ ln -sf ${libdir}/lib${BPN}.a ${base_libdir}/lib${BPN}.a
+ fi
+ if test -L ${base_libdir}/lib${BPN}.la ; then
+ rm -rf ${base_libdir}/lib${BPN}.la
+ ln -sf ${libdir}/lib${BPN}.la ${base_libdir}/lib${BPN}.la
+ fi
+}
+SSTATEPOSTINSTFUNCS_class-native += "fix_symlink"
diff --git a/import-layers/yocto-poky/meta/recipes-support/attr/files/attr-Missing-configure.ac.patch b/import-layers/yocto-poky/meta/recipes-support/attr/files/attr-Missing-configure.ac.patch
new file mode 100644
index 000000000..20fcc3cee
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/attr/files/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/import-layers/yocto-poky/meta/recipes-support/attr/files/dont-use-decl-macros.patch b/import-layers/yocto-poky/meta/recipes-support/attr/files/dont-use-decl-macros.patch
new file mode 100644
index 000000000..9d4b8929e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/attr/files/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/import-layers/yocto-poky/meta/recipes-support/attr/files/relative-libdir.patch b/import-layers/yocto-poky/meta/recipes-support/attr/files/relative-libdir.patch
new file mode 100644
index 000000000..b72bf184d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/attr/files/run-ptest b/import-layers/yocto-poky/meta/recipes-support/attr/files/run-ptest
new file mode 100644
index 000000000..a6c6867f2
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/bash-completion/bash-completion_2.1.bb b/import-layers/yocto-poky/meta/recipes-support/bash-completion/bash-completion_2.1.bb
new file mode 100644
index 000000000..8b257d2d1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/bash-completion/bash-completion_2.1.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="http://bash-completion.alioth.debian.org/files/${BPN}-${PV}.tar.bz2"
+
+SRC_URI[md5sum] = "4e2a9f11a4042a38ee79ddcd048e8b9e"
+SRC_URI[sha256sum] = "2b606804a7d5f823380a882e0f7b6c8a37b0e768e72c3d4107c51fbe8a46ae4f"
+UPSTREAM_CHECK_REGEX = "bash-completion-(?P<pver>(?!2008).+)\.tar"
+
+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 cal dmesg eject hexdump hwclock ionice look renice rtcwake su; do
+ rm ${D}${datadir}/${BPN}/completions/$i
+ done
+
+ # Delete files for networkmanager
+ rm ${D}${datadir}/${BPN}/completions/nmcli
+}
+
+RDEPENDS_${PN} = "bash"
+
+# Some recipes are providing ${PN}-bash-completion packages
+PACKAGES =+ "${PN}-extra"
+FILES_${PN}-extra = "${datadir}/${BPN}/completions/ \
+ ${datadir}/${BPN}/helpers/"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/bdwgc/bdwgc/0001-configure.ac-add-check-for-NO_GETCONTEXT-definition.patch b/import-layers/yocto-poky/meta/recipes-support/bdwgc/bdwgc/0001-configure.ac-add-check-for-NO_GETCONTEXT-definition.patch
new file mode 100644
index 000000000..8ef774f0f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/bdwgc/bdwgc/0001-configure.ac-add-check-for-NO_GETCONTEXT-definition.patch
@@ -0,0 +1,29 @@
+configure.ac: add check for NO_GETCONTEXT definition
+
+Signed-off-by: Samuel Martin <s.martin49@gmail.com>
+[yann.morin.1998@free.fr: add a comment, change variable name, use
+ AS_IF, remove debug traces, use AC_CHECK_FUNCS (as suggested by
+ Thomas)]
+Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
+Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+---
+Upstream-Status: Pending
+ configure.ac | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- bdwgc-7.2f.orig/configure.ac 2014-06-01 19:00:47.000000000 +0200
++++ bdwgc-7.2f/configure.ac 2014-12-23 14:13:11.585716713 +0100
+@@ -365,6 +365,12 @@
+ AC_MSG_RESULT($ac_cv_fno_strict_aliasing)
+ fi
+
++# Check for getcontext (uClibc can be configured without it, for example)
++AC_CHECK_FUNCS([getcontext])
++AS_IF([test "$ac_cv_func_getcontext" = "no"],
++ [CFLAGS="$CFLAGS -DNO_GETCONTEXT"
++ CPPFLAGS="$CPPFLAGS -DNO_GETCONTEXT"])
++
+ case "$host" in
+ # While IRIX 6 has libdl for the O32 and N32 ABIs, it's missing for N64
+ # and unnecessary everywhere.
diff --git a/import-layers/yocto-poky/meta/recipes-support/bdwgc/bdwgc/0001-fix-build-with-musl.patch b/import-layers/yocto-poky/meta/recipes-support/bdwgc/bdwgc/0001-fix-build-with-musl.patch
new file mode 100644
index 000000000..ab907fca0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/bdwgc/bdwgc/0001-fix-build-with-musl.patch
@@ -0,0 +1,35 @@
+From 829a89e7f5785239a9384e3afd46c900f9d76ada Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 31 Aug 2015 19:55:32 +0000
+Subject: [PATCH] fix build with musl
+
+signal.h already includes bits/sigcontext.h
+Documentation seems to indicate that if you need the definitions in
+sigcontext.h, you are supposed to include signal.h and not sigcontext.h.
+
+a good fix should be to remove glibc
+specific understanding, in those ifdef's
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ os_dep.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/os_dep.c b/os_dep.c
+index 08c501d..5cb7873 100644
+--- a/os_dep.c
++++ b/os_dep.c
+@@ -41,7 +41,7 @@
+ # else /* __GLIBC__ < 2 */
+ /* libc5 doesn't have <sigcontext.h>: go directly with the kernel */
+ /* one. Check LINUX_VERSION_CODE to see which we should reference. */
+-# include <asm/sigcontext.h>
++# include <signal.h>
+ # endif /* __GLIBC__ < 2 */
+ # endif
+ #endif /* LINUX && !POWERPC */
+--
+2.5.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/bdwgc/bdwgc/0002-Altera-NIOS2-support.patch b/import-layers/yocto-poky/meta/recipes-support/bdwgc/bdwgc/0002-Altera-NIOS2-support.patch
new file mode 100644
index 000000000..c73c5400c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/bdwgc/bdwgc/0002-Altera-NIOS2-support.patch
@@ -0,0 +1,71 @@
+From 2571df0e30b4976d7a12dbc6fbec4f1c4027924d Mon Sep 17 00:00:00 2001
+From: Marek Vasut <marex@denx.de>
+Date: Thu, 28 Jan 2016 04:13:13 +0100
+Subject: [PATCH] Altera NIOS2 support
+
+Add simple nios2 configuration support.
+
+* include/private/gcconfig.h (NIOS2): New macro.
+* include/private/gcconfig.h (mach_type_known, CPP_WORDSZ, MACH_TYPE,
+OS_TYPE, DYNAMIC_LOADING, _end, __data_start, DATASTART, DATAEND,
+ALIGNMENT, HBLKSIZE, HBLKSIZE, LINUX_STACKBOTTOM, NO_GETCONTEXT):
+Define for NIOS2.
+
+Signed-off-by: Marek Vasut <marex@denx.de>
+Upstream-Status: Backport [ https://github.com/ivmai/bdwgc.git 2571df0e30b4976d7a12dbc6fbec4f1c4027924d ]
+---
+ include/private/gcconfig.h | 24 +++++++++++++++++++++++-
+ 1 file changed, 23 insertions(+), 1 deletion(-)
+
+diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h
+index c467c26..92d4727 100644
+--- a/include/private/gcconfig.h
++++ b/include/private/gcconfig.h
+@@ -181,6 +181,10 @@
+ # endif
+ # define mach_type_known
+ # endif
++# if defined(__NIOS2__) || defined(__NIOS2) || defined(__nios2__)
++# define NIOS2 /* Altera NIOS2 */
++# define mach_type_known
++# endif
+ # if defined(DGUX) && (defined(i386) || defined(__i386__))
+ # define I386
+ # ifndef _USING_DGUX
+@@ -1658,6 +1662,24 @@
+ # endif
+ # endif
+
++# ifdef NIOS2
++# define CPP_WORDSZ 32
++# define MACH_TYPE "NIOS2"
++# ifdef LINUX
++# define OS_TYPE "LINUX"
++# define DYNAMIC_LOADING
++ extern int _end[];
++ extern int __data_start[];
++# define DATASTART ((ptr_t)(__data_start))
++# define DATAEND ((ptr_t)(_end))
++# define ALIGNMENT 4
++# ifndef HBLKSIZE
++# define HBLKSIZE 4096
++# endif
++# define LINUX_STACKBOTTOM
++# endif /* Linux */
++# endif
++
+ # ifdef HP_PA
+ # define MACH_TYPE "HP_PA"
+ # ifdef __LP64__
+@@ -2622,6 +2644,7 @@
+ #if ((defined(UNIX_LIKE) && (defined(DARWIN) || defined(HURD) \
+ || defined(OPENBSD) || defined(ARM32) \
+- || defined(MIPS) || defined(AVR32))) \
++ || defined(MIPS) || defined(AVR32) \
++ || defined(NIOS2))) \
+ || (defined(LINUX) && (defined(SPARC) || defined(M68K))) \
+ || ((defined(RTEMS) || defined(PLATFORM_ANDROID)) && defined(I386))) \
+ && !defined(NO_GETCONTEXT)
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/bdwgc/bdwgc_7.4.2.bb b/import-layers/yocto-poky/meta/recipes-support/bdwgc/bdwgc_7.4.2.bb
new file mode 100644
index 000000000..8d4dab399
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/bdwgc/bdwgc_7.4.2.bb
@@ -0,0 +1,43 @@
+SUMMARY = "A garbage collector for C and C++"
+
+DESCRIPTION = "The Boehm-Demers-Weiser conservative garbage collector can be\
+ used as a garbage collecting replacement for C malloc or C++ new. It allows\
+ you to allocate memory basically as you normally would, without explicitly\
+ deallocating memory that is no longer useful. The collector automatically\
+ recycles memory when it determines that it can no longer be otherwise\
+ accessed.\
+ The collector is also used by a number of programming language\
+ implementations that either use C as intermediate code, want to facilitate\
+ easier interoperation with C libraries, or just prefer the simple collector\
+ interface.\
+ Alternatively, the garbage collector may be used as a leak detector for C\
+ or C++ programs, though that is not its primary goal.\
+ Empirically, this collector works with most unmodified C programs, simply\
+ by replacing malloc with GC_malloc calls, replacing realloc with GC_realloc\
+ calls, and removing free calls."
+
+HOMEPAGE = "http://www.hboehm.info/gc/"
+SECTION = "devel"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://README.QUICK;md5=55f5088f90a982fed7af9a4897047ef7"
+
+SRCREV = "e31cdc288ffbee5bf25f948e19deb5a7ce846971"
+SRC_URI = "git://github.com/ivmai/bdwgc.git;branch=release-7_4 \
+ file://0001-fix-build-with-musl.patch \
+ file://0001-configure.ac-add-check-for-NO_GETCONTEXT-definition.patch \
+ file://0002-Altera-NIOS2-support.patch \
+ "
+
+FILES_${PN}-doc = "${datadir}"
+
+S = "${WORKDIR}/git"
+
+ARM_INSTRUCTION_SET = "arm"
+
+inherit autotools pkgconfig
+
+# by default use external libatomic-ops
+PACKAGECONFIG ??= "libatomic-ops"
+PACKAGECONFIG[libatomic-ops] = "--with-libatomic-ops=yes,--with-libatomic-ops=no,libatomic-ops"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/beecrypt/beecrypt/add-option-dev-dsp.patch b/import-layers/yocto-poky/meta/recipes-support/beecrypt/beecrypt/add-option-dev-dsp.patch
new file mode 100644
index 000000000..b3298ce2d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/beecrypt/beecrypt/beecrypt-enable-ptest-support.patch b/import-layers/yocto-poky/meta/recipes-support/beecrypt/beecrypt/beecrypt-enable-ptest-support.patch
new file mode 100644
index 000000000..3e5513fce
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/beecrypt/beecrypt/disable-icu-check.patch b/import-layers/yocto-poky/meta/recipes-support/beecrypt/beecrypt/disable-icu-check.patch
new file mode 100644
index 000000000..91b1fa6ef
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/beecrypt/beecrypt/fix-for-gcc-4.7.patch b/import-layers/yocto-poky/meta/recipes-support/beecrypt/beecrypt/fix-for-gcc-4.7.patch
new file mode 100644
index 000000000..8144e39be
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/beecrypt/beecrypt/fix-security.patch b/import-layers/yocto-poky/meta/recipes-support/beecrypt/beecrypt/fix-security.patch
new file mode 100644
index 000000000..6cb0c0020
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/beecrypt/beecrypt/run-ptest b/import-layers/yocto-poky/meta/recipes-support/beecrypt/beecrypt/run-ptest
new file mode 100644
index 000000000..2ee294d99
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/beecrypt/beecrypt_4.2.1.bb b/import-layers/yocto-poky/meta/recipes-support/beecrypt/beecrypt_4.2.1.bb
new file mode 100644
index 000000000..1e626f154
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/boost/bjam-native_1.60.0.bb b/import-layers/yocto-poky/meta/recipes-support/boost/bjam-native_1.60.0.bb
new file mode 100644
index 000000000..32646d707
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/boost/bjam-native_1.60.0.bb
@@ -0,0 +1,18 @@
+include boost-${PV}.inc
+
+SUMMARY = "Portable Boost.Jam build tool for boost"
+SECTION = "devel"
+
+inherit native
+
+SRC_URI += "file://bjam-native-build-bjam.debug.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/import-layers/yocto-poky/meta/recipes-support/boost/boost-1.60.0.inc b/import-layers/yocto-poky/meta/recipes-support/boost/boost-1.60.0.inc
new file mode 100644
index 000000000..a38693e25
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/boost/boost-1.60.0.inc
@@ -0,0 +1,19 @@
+# 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",1).split("."))}"
+BOOST_MAJ = "${@"_".join(d.getVar("PV",1).split(".")[0:2])}"
+BOOST_P = "boost_${BOOST_VER}"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/boost/${BOOST_P}.tar.bz2"
+
+SRC_URI[md5sum] = "65a840e1a0b13a558ff19eeb2c4f0cbe"
+SRC_URI[sha256sum] = "686affff989ac2488f79a97b9479efb9f2abae035b5ed4d8226de6857933fd3b"
+
+S = "${WORKDIR}/${BOOST_P}"
diff --git a/import-layers/yocto-poky/meta/recipes-support/boost/boost.inc b/import-layers/yocto-poky/meta/recipes-support/boost/boost.inc
new file mode 100644
index 000000000..982446c06
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/boost/boost.inc
@@ -0,0 +1,195 @@
+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 \
+ date_time \
+ filesystem \
+ graph \
+ iostreams \
+ log \
+ program_options \
+ random \
+ regex \
+ serialization \
+ signals \
+ system \
+ timer \
+ test \
+ thread \
+ "
+
+# optional boost-python library
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[python] = ",,python python3"
+BOOST_LIBS += "${@bb.utils.contains('PACKAGECONFIG', 'python', 'python python3', '', d)}"
+inherit python-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', True).split( ):
+ # BJAM does not know '--with-python3' (only --with-python)
+ if lib != "python3":
+ extras.append("--with-%s" % lib)
+ pkg = "boost-%s" % lib.replace("_", "-")
+ packages.append(pkg)
+ if lib == "python":
+ # special: python*.so matches python3.so !!
+ if not d.getVar("FILES_%s" % pkg, True):
+ d.setVar("FILES_%s" % pkg, "${libdir}/libboost_%s.so.*" % lib)
+ else:
+ if not d.getVar("FILES_%s" % pkg, True):
+ 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_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} = ""
+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}"
+RRECOMMENDS_${PN} += "${BOOST_PACKAGES}"
+RRECOMMENDS_${PN}_class-native = ""
+ALLOW_EMPTY_${PN} = "1"
+
+# 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
+def get_boost_parallel_make(d):
+ pm = d.getVar('PARALLEL_MAKE', True)
+ if pm:
+ # look for '-j' and throw other options (e.g. '-l') away
+ # because they might have different meaning in bjam
+ pm = pm.split()
+ while pm:
+ v = None
+ opt = pm.pop(0)
+ if opt == '-j':
+ v = pm.pop(0)
+ elif opt.startswith('-j'):
+ v = opt[2:].strip()
+ else:
+ v = None
+
+ if v:
+ v = min(64, int(v))
+ return '-j' + str(v)
+
+ return ""
+
+BOOST_PARALLEL_MAKE = "${@get_boost_parallel_make(d)}"
+BJAM_OPTS = '${BOOST_PARALLEL_MAKE} -d+2 -q \
+ ${BJAM_TOOLS} \
+ -sBOOST_BUILD_USER_CONFIG=${S}/tools/build/example/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'
+
+do_boostconfig() {
+ cp -f boost/config/platform/linux.hpp boost/config/platform/linux-gnueabi.hpp
+
+ # D2194:Fixing the failure of "error: duplicate initialization of gcc with the following parameters" during compilation.
+ sed -i "/^using gcc : 4.3.1/d" ${S}/tools/build/example/user-config.jam
+ sed -i "/^using python : ${PYTHON_BASEVERSION}"/d ${S}/tools/build/example/user-config.jam
+ echo 'using gcc : 4.3.1 : ${CXX} : <cflags>"${CFLAGS}" <cxxflags>"${CXXFLAGS}" <linkflags>"${LDFLAGS}" ;' >> ${S}/tools/build/example/user-config.jam
+ echo "using python : ${PYTHON_BASEVERSION} : : ${STAGING_INCDIR}/python${PYTHON_BASEVERSION} ;" >> ${S}/tools/build/example/user-config.jam
+ echo "using python : 3.5 : : ${STAGING_INCDIR}/python3.5m ;" >> ${S}/tools/build/example/user-config.jam
+
+ CC="${BUILD_CC}" CFLAGS="${BUILD_CFLAGS}" ./bootstrap.sh --with-bjam=bjam --with-toolset=gcc --with-python-root=${PYTHON_ROOT}
+ sed -i '/^using python/d' project-config.jam
+}
+
+do_boostconfig[dirs] = "${S}"
+addtask do_boostconfig after do_patch before do_configure
+
+do_compile() {
+ set -ex
+ bjam ${BJAM_OPTS} --prefix=${prefix} \
+ --exec-prefix=${exec_prefix} \
+ --libdir=${libdir} \
+ --includedir=${includedir}
+}
+
+do_install() {
+ set -ex
+ 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/import-layers/yocto-poky/meta/recipes-support/boost/boost/0001-Do-not-qualify-fenv.h-names-that-might-be-macros.patch b/import-layers/yocto-poky/meta/recipes-support/boost/boost/0001-Do-not-qualify-fenv.h-names-that-might-be-macros.patch
new file mode 100644
index 000000000..df7e71fea
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/boost/boost/0001-Do-not-qualify-fenv.h-names-that-might-be-macros.patch
@@ -0,0 +1,45 @@
+From f50e7bc9fed323c5705c0ed992c03e80eeec1dd6 Mon Sep 17 00:00:00 2001
+From: Jonathan Wakely <jwakely@redhat.com>
+Date: Mon, 14 Sep 2015 15:05:24 +0100
+Subject: [PATCH] Do not qualify <fenv.h> names that might be macros.
+
+The patch was imported from the boost-test git repository
+(https://github.com/boostorg/test) as of commit id
+f50e7bc9fed323c5705c0ed992c03e80eeec1dd6.
+
+Upstream-Status: Accepted [commit f50e7bc9fed in develop branch]
+
+Signed-off-by: Lukas Bulwahn <lukas.bulwahn@oss.bmw-carit.de>
+---
+ include/boost/test/impl/execution_monitor.ipp | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/include/boost/test/impl/execution_monitor.ipp b/include/boost/test/impl/execution_monitor.ipp
+index b3e873e..a7bdce2 100644
+--- a/include/boost/test/impl/execution_monitor.ipp
++++ b/include/boost/test/impl/execution_monitor.ipp
+@@ -1380,8 +1380,8 @@ enable( unsigned mask )
+
+ return ~old_cw & BOOST_FPE_ALL;
+ #elif defined(__GLIBC__) && defined(__USE_GNU) && !defined(BOOST_CLANG) && !defined(BOOST_NO_FENV_H)
+- ::feclearexcept(BOOST_FPE_ALL);
+- int res = ::feenableexcept( mask );
++ feclearexcept(BOOST_FPE_ALL);
++ int res = feenableexcept( mask );
+ return res == -1 ? (unsigned)BOOST_FPE_INV : (unsigned)res;
+ #else
+ /* Not Implemented */
+@@ -1417,8 +1417,8 @@ disable( unsigned mask )
+
+ return ~old_cw & BOOST_FPE_ALL;
+ #elif defined(__GLIBC__) && defined(__USE_GNU) && !defined(BOOST_CLANG) && !defined(BOOST_NO_FENV_H)
+- ::feclearexcept(BOOST_FPE_ALL);
+- int res = ::fedisableexcept( mask );
++ feclearexcept(BOOST_FPE_ALL);
++ int res = fedisableexcept( mask );
+ return res == -1 ? (unsigned)BOOST_FPE_INV : (unsigned)res;
+ #else
+ /* Not Implemented */
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/boost/boost/arm-intrinsics.patch b/import-layers/yocto-poky/meta/recipes-support/boost/boost/arm-intrinsics.patch
new file mode 100644
index 000000000..fe85c69a8
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/boost/boost/consider-hardfp.patch b/import-layers/yocto-poky/meta/recipes-support/boost/boost/consider-hardfp.patch
new file mode 100644
index 000000000..66808a69d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/boost/boost/consider-hardfp.patch
@@ -0,0 +1,19 @@
+When using soft-float, on ARM we should not expect the FE_* symbols
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: boost_1_60_0/boost/test/execution_monitor.hpp
+===================================================================
+--- boost_1_60_0.orig/boost/test/execution_monitor.hpp
++++ boost_1_60_0/boost/test/execution_monitor.hpp
+@@ -484,7 +484,8 @@ enum masks {
+ BOOST_FPE_UNDERFLOW = EM_UNDERFLOW|EM_DENORMAL,
+
+ BOOST_FPE_ALL = MCW_EM,
+-#elif defined(BOOST_NO_FENV_H) || defined(BOOST_CLANG)
++#elif defined(BOOST_NO_FENV_H) || defined(BOOST_CLANG) \
++ || defined(__ARM_PCS)
+ BOOST_FPE_ALL = 1,
+ #else
+ BOOST_FPE_DIVBYZERO = FE_DIVBYZERO,
diff --git a/import-layers/yocto-poky/meta/recipes-support/boost/boost_1.60.0.bb b/import-layers/yocto-poky/meta/recipes-support/boost/boost_1.60.0.bb
new file mode 100644
index 000000000..4d824c85b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/boost/boost_1.60.0.bb
@@ -0,0 +1,8 @@
+include boost-${PV}.inc
+include boost.inc
+
+SRC_URI += "\
+ file://arm-intrinsics.patch \
+ file://0001-Do-not-qualify-fenv.h-names-that-might-be-macros.patch;striplevel=2 \
+ file://consider-hardfp.patch \
+"
diff --git a/import-layers/yocto-poky/meta/recipes-support/boost/files/bjam-native-build-bjam.debug.patch b/import-layers/yocto-poky/meta/recipes-support/boost/files/bjam-native-build-bjam.debug.patch
new file mode 100644
index 000000000..9f8b7eac0
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/ca-certificates/ca-certificates/0001-update-ca-certificates-don-t-use-Debianisms-in-run-p.patch b/import-layers/yocto-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..4b4b287d4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/ca-certificates/ca-certificates/0001-update-ca-certificates-don-t-use-Debianisms-in-run-p.patch
@@ -0,0 +1,30 @@
+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
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton@intel.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/import-layers/yocto-poky/meta/recipes-support/ca-certificates/ca-certificates/0001-update-ca-certificates-remove-c-rehash.patch b/import-layers/yocto-poky/meta/recipes-support/ca-certificates/ca-certificates/0001-update-ca-certificates-remove-c-rehash.patch
new file mode 100644
index 000000000..bf027233d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/ca-certificates/ca-certificates/0001-update-ca-certificates-remove-c-rehash.patch
@@ -0,0 +1,46 @@
+Upstream-Status: Pending
+
+From 111e905fe931da1a3800accfc675cc01c8ee080c Mon Sep 17 00:00:00 2001
+From: Ulf Samuelsson <ulf@emagii.com>
+Date: Tue, 28 Feb 2012 06:42:58 +0100
+Subject: [PATCH] update-ca-certificates: remove c rehash
+
+Updated earlier patch to apply clean on 2012-02-12
+Signed-off-by: Ulf Samuelsson <ulf@emagii.com>
+---
+ sbin/update-ca-certificates | 20 ++++++++++----------
+ 1 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/sbin/update-ca-certificates b/sbin/update-ca-certificates
+index 5375950..c567e3d 100755
+--- a/sbin/update-ca-certificates
++++ b/sbin/update-ca-certificates
+@@ -132,16 +132,16 @@ rm -f "$CERTBUNDLE"
+ ADDED_CNT=$(wc -l < "$ADDED")
+ REMOVED_CNT=$(wc -l < "$REMOVED")
+
+-if [ "$ADDED_CNT" -gt 0 ] || [ "$REMOVED_CNT" -gt 0 ]
+-then
+- # only run if set of files has changed
+- if [ "$verbose" = 0 ]
+- then
+- c_rehash . > /dev/null
+- else
+- c_rehash .
+- fi
+-fi
++#if [ "$ADDED_CNT" -gt 0 ] || [ "$REMOVED_CNT" -gt 0 ]
++#then
++# # only run if set of files has changed
++# if [ "$verbose" = 0 ]
++# then
++# c_rehash . > /dev/null
++# else
++# c_rehash .
++# fi
++#fi
+
+ chmod 0644 "$TEMPBUNDLE"
+ mv -f "$TEMPBUNDLE" "$CERTBUNDLE"
+--
+1.7.4.1
diff --git a/import-layers/yocto-poky/meta/recipes-support/ca-certificates/ca-certificates/0002-update-ca-certificates-use-SYSROOT.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/ca-certificates/ca-certificates/default-sysroot.patch b/import-layers/yocto-poky/meta/recipes-support/ca-certificates/ca-certificates/default-sysroot.patch
new file mode 100644
index 000000000..f8b0791be
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/ca-certificates/ca-certificates/sbindir.patch b/import-layers/yocto-poky/meta/recipes-support/ca-certificates/ca-certificates/sbindir.patch
new file mode 100644
index 000000000..a113fa8b1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/ca-certificates/ca-certificates/update-ca-certificates-support-Toybox.patch b/import-layers/yocto-poky/meta/recipes-support/ca-certificates/ca-certificates/update-ca-certificates-support-Toybox.patch
new file mode 100644
index 000000000..6e2171f75
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/ca-certificates/ca-certificates_20160104.bb b/import-layers/yocto-poky/meta/recipes-support/ca-certificates/ca-certificates_20160104.bb
new file mode 100644
index 000000000..e0f193913
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/ca-certificates/ca-certificates_20160104.bb
@@ -0,0 +1,80 @@
+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 = "ca-certificates-native"
+DEPENDS_class-native = ""
+
+SRCREV = "f54715702c5c0581c9461f78fd84e2c8d2ec243c"
+
+SRC_URI = "git://anonscm.debian.org/collab-maint/ca-certificates.git \
+ file://0001-update-ca-certificates-remove-c-rehash.patch \
+ 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"
+
+S = "${WORKDIR}/git"
+
+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} () {
+ SYSROOT="$D" update-ca-certificates
+}
+
+CONFFILES_${PN} += "${sysconfdir}/ca-certificates.conf"
+
+# Postinsts don't seem to be run for nativesdk packages when populating SDKs.
+CONFFILES_${PN}_append_class-nativesdk = " ${sysconfdir}/ssl/certs/ca-certificates.crt"
+do_install_append_class-nativesdk () {
+ SYSROOT="${D}${SDKPATHNATIVE}" update-ca-certificates
+}
+
+do_install_append_class-native () {
+ SYSROOT="${D}${base_prefix}" ${D}${sbindir}/update-ca-certificates
+}
+
+BBCLASSEXTEND += "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/consolekit/consolekit/add-polkit-configure-argument.patch b/import-layers/yocto-poky/meta/recipes-support/consolekit/consolekit/add-polkit-configure-argument.patch
new file mode 100644
index 000000000..ad879d466
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/consolekit/consolekit/sepbuildfix.patch b/import-layers/yocto-poky/meta/recipes-support/consolekit/consolekit/sepbuildfix.patch
new file mode 100644
index 000000000..f2f9b9c68
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/consolekit/consolekit_0.4.6.bb b/import-layers/yocto-poky/meta/recipes-support/consolekit/consolekit_0.4.6.bb
new file mode 100644
index 000000000..2974e3664
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/consolekit/consolekit_0.4.6.bb
@@ -0,0 +1,50 @@
+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.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '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} += "${localstatedir}/log/ConsoleKit ${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/run from package as console-kit-daemon will populate it on startup
+ rm -fr "${D}${localstatedir}/run"
+}
diff --git a/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/createrepo-dbpath.patch b/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/createrepo-dbpath.patch
new file mode 100644
index 000000000..72755981a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/createrepo-dbpath.patch
@@ -0,0 +1,61 @@
+createrepo: Implement --dbpath command line option
+
+--dbpath option allows to specify path to the directory
+with rpm database. By default createrepo uses or creates
+rpm database in /var/lib/rpm/
+
+Upstream-Status: Pending
+
+Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
+
+--- createrepo-0.4.11.orig/genpkgmetadata.py 2015-03-30 22:18:19.904000000 +0300
++++ createrepo-0.4.11/genpkgmetadata.py 2015-03-30 22:28:49.208000000 +0300
+@@ -65,6 +65,7 @@
+ -p, --pretty = output xml files in pretty format.
+ --update = update existing metadata (if present)
+ -d, --database = generate the sqlite databases.
++ --dbpath <dir> = specify path to rpm db directory.
+ """)
+
+ sys.exit(retval)
+@@ -72,10 +73,13 @@
+ class MetaDataGenerator:
+ def __init__(self, cmds):
+ self.cmds = cmds
+- self.ts = rpm.TransactionSet()
+ self.pkgcount = 0
+ self.files = []
+
++ if self.cmds['dbpath']:
++ rpm.addMacro("_dbpath", self.cmds['dbpath'])
++ self.ts = rpm.TransactionSet()
++
+ def _os_path_walk(self, top, func, arg):
+ """Directory tree walk with callback function.
+ copy of os.path.walk, fixes the link/stating problem
+@@ -435,6 +439,7 @@
+ cmds['dir-pattern-match'] = ['.*bin\/.*', '^\/etc\/.*']
+ cmds['skip-symlinks'] = False
+ cmds['pkglist'] = []
++ cmds['dbpath'] = None
+
+ try:
+ gopts, argsleft = getopt.getopt(args, 'phqVvndg:s:x:u:c:o:CSi:', ['help', 'exclude=',
+@@ -442,7 +447,7 @@
+ 'baseurl=', 'groupfile=', 'checksum=',
+ 'version', 'pretty', 'split', 'outputdir=',
+ 'noepoch', 'checkts', 'database', 'update',
+- 'skip-symlinks', 'pkglist='])
++ 'skip-symlinks', 'pkglist=', 'dbpath='])
+ except getopt.error, e:
+ errorprint(_('Options Error: %s.') % e)
+ usage()
+@@ -516,6 +521,8 @@
+ cmds['skip-symlinks'] = True
+ elif arg in ['-i', '--pkglist']:
+ cmds['pkglist'] = a
++ elif arg == '--dbpath':
++ cmds['dbpath'] = os.path.realpath(a)
+
+ except ValueError, e:
+ errorprint(_('Options Error: %s') % e)
diff --git a/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/createrepo-rpm549.patch b/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/createrepo-rpm549.patch
new file mode 100644
index 000000000..bc7200d07
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/createrepo-rpm549.patch
@@ -0,0 +1,22 @@
+dumpMetadata.py: Fix for RPM5 - 5.4.9 integration
+
+RPM5 no longer has a switch to disable signature validation. (Due to security
+validation concerns.)
+
+Upstream-Status: Inappropriate [other]
+ createrepo does not support RPM5 upstream
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff -u createrepo-0.4.11.orig/dumpMetadata.py createrepo-0.4.11/dumpMetadata.py
+--- createrepo-0.4.11.orig/dumpMetadata.py 2012-06-05 10:12:55.687964222 -0500
++++ createrepo-0.4.11/dumpMetadata.py 2012-06-05 10:40:08.154060600 -0500
+@@ -92,7 +92,7 @@
+ fdno = package # let's assume this is an fdno and go with it :)
+ except OSError:
+ raise MDError, "Error opening file"
+- ts.setVSFlags((rpm._RPMVSF_NOSIGNATURES|rpm.RPMVSF_NOMD5|rpm.RPMVSF_NEEDPAYLOAD))
++ ts.setVSFlags((rpm.RPMVSF_NOMD5|rpm.RPMVSF_NEEDPAYLOAD))
+ try:
+ hdr = ts.hdrFromFdno(fdno)
+ except rpm.error:
diff --git a/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/dumpMetadata-disable-signature-validation.patch b/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/dumpMetadata-disable-signature-validation.patch
new file mode 100644
index 000000000..905531f84
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/dumpMetadata-disable-signature-validation.patch
@@ -0,0 +1,31 @@
+dumpMetadata: disable signature validation
+
+Makes it possible to work on RPM repositories that contain signed packages
+without the need of importing the public part of the signing key into the RPM
+database.
+
+Upstream-Status: Pending
+
+Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
+---
+ dumpMetadata.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/dumpMetadata.py b/dumpMetadata.py
+index e40e8ac..ca6a82d 100644
+--- a/dumpMetadata.py
++++ b/dumpMetadata.py
+@@ -92,7 +92,9 @@ def returnHdr(ts, package):
+ fdno = package # let's assume this is an fdno and go with it :)
+ except OSError:
+ raise MDError, "Error opening file"
+- ts.setVSFlags((rpm.RPMVSF_NOMD5|rpm.RPMVSF_NEEDPAYLOAD))
++ ts.setVSFlags((rpm.RPMVSF_NOMD5|rpm.RPMVSF_NEEDPAYLOAD|
++ rpm.RPMVSF_NODSA|rpm.RPMVSF_NORSA|
++ rpm.RPMVSF_NODSAHEADER|rpm.RPMVSF_NORSAHEADER))
+ try:
+ hdr = ts.hdrFromFdno(fdno)
+ except rpm.error:
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/fix-native-install.patch b/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/fix-native-install.patch
new file mode 100644
index 000000000..d8202a4f7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/fix-native-install.patch
@@ -0,0 +1,163 @@
+Upstream-Status: Inappropriate [configuration]
+
+Date: Jan 31, 2011
+
+There are two fixes:
+ 1. -native needs to customize prefix
+ 2. needs to change python reference in binaries
+
+Signed-off-by: Qing He <qing.he@intel.com>
+
+diff --git a/Makefile b/Makefile
+index b2d1a32..3c3639f 100644
+--- a/Makefile
++++ b/Makefile
+@@ -3,22 +3,22 @@ VERSION = 0.4.11
+ SHELL = /bin/sh
+ top_srcdir = .
+ srcdir = .
+-prefix = /usr
+-exec_prefix = ${prefix}
+-
+-bindir = ${exec_prefix}/bin
+-sbindir = ${exec_prefix}/sbin
+-libexecdir = ${exec_prefix}/libexec
+-datadir = ${prefix}/share
+-sysconfdir = ${prefix}/etc
+-sharedstatedir = ${prefix}/com
+-localstatedir = ${prefix}/var
+-libdir = ${exec_prefix}/lib
+-infodir = ${prefix}/info
++prefix ?= /usr
++exec_prefix ?= ${prefix}
++
++bindir ?= ${exec_prefix}/bin
++sbindir ?= ${exec_prefix}/sbin
++libexecdir ?= ${exec_prefix}/libexec
++datadir ?= ${prefix}/share
++sysconfdir ?= ${prefix}/etc
++sharedstatedir ?= ${prefix}/com
++localstatedir ?= ${prefix}/var
++libdir ?= ${exec_prefix}/lib
++infodir ?= ${prefix}/info
+ docdir =
+-includedir = ${prefix}/include
++includedir ?= ${prefix}/include
+ oldincludedir = /usr/include
+-mandir = ${prefix}/share/man
++mandir ?= ${prefix}/share/man
+
+ pkgdatadir = $(datadir)/$(PACKAGE)
+ pkglibdir = $(libdir)/$(PACKAGE)
+diff --git a/bin/Makefile b/bin/Makefile
+index 52c1f50..e30610e 100644
+--- a/bin/Makefile
++++ b/bin/Makefile
+@@ -1,22 +1,22 @@
+ SHELL = /bin/sh
+ top_srcdir = ..
+ srcdir = ../bin
+-prefix = /usr
+-exec_prefix = ${prefix}
+-
+-bindir = ${exec_prefix}/bin
+-sbindir = ${exec_prefix}/sbin
+-libexecdir = ${exec_prefix}/libexec
+-datadir = ${prefix}/share
+-sysconfdir = ${prefix}/etc
+-sharedstatedir = ${prefix}/com
+-localstatedir = ${prefix}/var
+-libdir = ${exec_prefix}/lib
+-infodir = ${prefix}/info
++prefix ?= /usr
++exec_prefix ?= ${prefix}
++
++bindir ?= ${exec_prefix}/bin
++sbindir ?= ${exec_prefix}/sbin
++libexecdir ?= ${exec_prefix}/libexec
++datadir ?= ${prefix}/share
++sysconfdir ?= ${prefix}/etc
++sharedstatedir ?= ${prefix}/com
++localstatedir ?= ${prefix}/var
++libdir ?= ${exec_prefix}/lib
++infodir ?= ${prefix}/info
+ docdir =
+-includedir = ${prefix}/include
++includedir ?= ${prefix}/include
+ oldincludedir = /usr/include
+-mandir = ${prefix}/man
++mandir ?= ${prefix}/man
+
+ pkgdatadir = $(datadir)/$(PACKAGE)
+ pkglibdir = $(libdir)/$(PACKAGE)
+@@ -40,8 +40,11 @@ all: $(srcdir)/$(PACKAGE)
+
+
+ install: all installdirs
+- $(INSTALL_BIN) $(srcdir)/$(PACKAGE) $(DESTDIR)$(bindir)/$(PACKAGE)
+- $(INSTALL_BIN) $(srcdir)/modifyrepo $(DESTDIR)$(bindir)/modifyrepo
++ sed -e "s|@DATADIR@|$(datadir)|" $(srcdir)/$(PACKAGE) > $(srcdir)/$(PACKAGE).tmp
++ sed -e "s|@DATADIR@|$(datadir)|" $(srcdir)/modifyrepo > $(srcdir)/modifyrepo.tmp
++ $(INSTALL_BIN) $(srcdir)/$(PACKAGE).tmp $(DESTDIR)$(bindir)/$(PACKAGE)
++ $(INSTALL_BIN) $(srcdir)/modifyrepo.tmp $(DESTDIR)$(bindir)/modifyrepo
++ rm -f $(srcdir)/$(PACKAGE).tmp $(srcdir)/modifyrepo.tmp
+
+
+ uninstall:
+diff --git a/bin/createrepo b/bin/createrepo
+index b0de515..eaacb39 100755
+--- a/bin/createrepo
++++ b/bin/createrepo
+@@ -1,2 +1,2 @@
+ #!/bin/sh
+-exec /usr/share/createrepo/genpkgmetadata.py "$@"
++exec @DATADIR@/createrepo/genpkgmetadata.py "$@"
+diff --git a/bin/modifyrepo b/bin/modifyrepo
+index c9732d8..6f7c1d4 100755
+--- a/bin/modifyrepo
++++ b/bin/modifyrepo
+@@ -1,2 +1,2 @@
+ #!/bin/sh
+-exec /usr/share/createrepo/modifyrepo.py "$@"
++exec @DATADIR@/createrepo/modifyrepo.py "$@"
+diff --git a/docs/Makefile b/docs/Makefile
+index 0a41179..e128c85 100644
+--- a/docs/Makefile
++++ b/docs/Makefile
+@@ -1,22 +1,22 @@
+ SHELL = /bin/sh
+ top_srcdir = ..
+ srcdir = ../docs
+-prefix = /usr
+-exec_prefix = ${prefix}
+-
+-bindir = ${exec_prefix}/bin
+-sbindir = ${exec_prefix}/sbin
+-libexecdir = ${exec_prefix}/libexec
+-datadir = ${prefix}/share
+-sysconfdir = ${prefix}/etc
+-sharedstatedir = ${prefix}/com
+-localstatedir = ${prefix}/var
+-libdir = ${exec_prefix}/lib
+-infodir = ${prefix}/info
++prefix ?= /usr
++exec_prefix ?= ${prefix}
++
++bindir ?= ${exec_prefix}/bin
++sbindir ?= ${exec_prefix}/sbin
++libexecdir ?= ${exec_prefix}/libexec
++datadir ?= ${prefix}/share
++sysconfdir ?= ${prefix}/etc
++sharedstatedir ?= ${prefix}/com
++localstatedir ?= ${prefix}/var
++libdir ?= ${exec_prefix}/lib
++infodir ?= ${prefix}/info
+ docdir =
+-includedir = ${prefix}/include
++includedir ?= ${prefix}/include
+ oldincludedir = /usr/include
+-mandir = ${datadir}/man
++mandir ?= ${datadir}/man
+
+ pkgdatadir = $(datadir)/$(PACKAGE)
+ pkglibdir = $(libdir)/$(PACKAGE)
diff --git a/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/fixstat.patch b/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/fixstat.patch
new file mode 100644
index 000000000..d34eb56a8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/fixstat.patch
@@ -0,0 +1,19 @@
+When reading the mtime from disk, the system can get a floating point
+value. Convert this to an int for comparision purposes, else some
+packages always get reindexed as the value in the index is an int.
+RP 2016/3/2
+Upstream-Status: Pending
+
+Index: createrepo-0.4.11/readMetadata.py
+===================================================================
+--- createrepo-0.4.11.orig/readMetadata.py
++++ createrepo-0.4.11/readMetadata.py
+@@ -126,7 +126,7 @@ class MetadataIndex(object):
+ if self.opts.get('verbose'):
+ print _("Size (%i -> %i) changed for file %s") % (size,st.st_size,filepath)
+ return
+- if st.st_mtime != mtime:
++ if int(st.st_mtime) != mtime:
+ if self.opts.get('verbose'):
+ print _("Modification time changed for %s") % filepath
+ return
diff --git a/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/python-scripts-should-use-interpreter-from-env.patch b/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/python-scripts-should-use-interpreter-from-env.patch
new file mode 100644
index 000000000..80205a150
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/python-scripts-should-use-interpreter-from-env.patch
@@ -0,0 +1,47 @@
+Author: Andrei Gherzan <andrei@gherzan.ro>
+
+Python interpreter should be use from PATH - native python - and not the one from
+host.
+
+Upstream-Status: Inappropriate [configuration]
+
+Index: createrepo-0.4.11/genpkgmetadata.py
+===================================================================
+--- createrepo-0.4.11.orig/genpkgmetadata.py 2012-04-10 17:14:05.278649384 +0300
++++ createrepo-0.4.11/genpkgmetadata.py 2012-04-10 17:14:22.290648886 +0300
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python -t
++#! /usr/bin/env python
+ # primary functions and glue for generating the repository metadata
+ #
+
+Index: createrepo-0.4.11/modifyrepo.py
+===================================================================
+--- createrepo-0.4.11.orig/modifyrepo.py 2012-04-10 17:14:09.106649272 +0300
++++ createrepo-0.4.11/modifyrepo.py 2012-04-10 17:14:27.818648725 +0300
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#! /usr/bin/env python
+ # $Id$
+ #
+ # This tools is used to insert arbitrary metadata into an RPM repository.
+Index: createrepo-0.4.11/dumpMetadata.py
+===================================================================
+--- createrepo-0.4.11.orig/dumpMetadata.py 2012-04-10 17:19:23.874640068 +0300
++++ createrepo-0.4.11/dumpMetadata.py 2012-04-10 17:19:34.502639756 +0300
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python -t
++#! /usr/bin/env python
+ # base classes and functions for dumping out package Metadata
+ #
+ # This program is free software; you can redistribute it and/or modify
+Index: createrepo-0.4.11/readMetadata.py
+===================================================================
+--- createrepo-0.4.11.orig/readMetadata.py 2012-04-10 17:19:19.626640193 +0300
++++ createrepo-0.4.11/readMetadata.py 2012-04-10 17:19:40.198639590 +0300
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python -t
++#! /usr/bin/env python
+
+ # 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
diff --git a/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/recommends.patch b/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/recommends.patch
new file mode 100644
index 000000000..dc5de2b5b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/recommends.patch
@@ -0,0 +1,71 @@
+createrepo: implement recommends support
+
+Record against the corresponding requires entry in the output metadata
+if a dependency relationship is marked with the RPMSENSE_MISSINGOK flag
+(indicating it is a recommendation, rather than a hard dependency).
+
+Upstream-Status: Pending
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+diff --git a/dumpMetadata.py b/dumpMetadata.py
+index 70bb2d8..e40e8ac 100644
+--- a/dumpMetadata.py
++++ b/dumpMetadata.py
+@@ -319,6 +319,23 @@ class RpmMetaData:
+ reqs.append(0)
+ return reqs
+
++ def _checkMissingOk(self, flags):
++ reqs=[]
++ if flags is None:
++ return reqs
++
++ if type(flags) is not types.ListType:
++ flags = [flags]
++ for flag in flags:
++ newflag = flag
++ if flag is not None:
++ newflag = flag & rpm.RPMSENSE_MISSINGOK
++ if newflag:
++ reqs.append(1)
++ else:
++ reqs.append(0)
++ return reqs
++
+
+ def _correctVersion(self, vers):
+ returnvers = []
+@@ -537,9 +554,10 @@ class RpmMetaData:
+ tmpflags = self.hdr[rpm.RPMTAG_REQUIREFLAGS]
+ flags = self._correctFlags(tmpflags)
+ prereq = self._checkPreReq(tmpflags)
++ missingok = self._checkMissingOk(tmpflags)
+ ver = self._correctVersion(self.hdr[rpm.RPMTAG_REQUIREVERSION])
+ if names is not None:
+- lst = zip(names, flags, ver, prereq)
++ lst = zip(names, flags, ver, prereq, missingok)
+ return self._uniq(lst)
+
+ def obsoletesList(self):
+@@ -692,7 +710,7 @@ def generateXML(doc, node, formatns, rpmObj, sumtype):
+ depsList = rpmObj.depsList()
+ if len(depsList) > 0:
+ rpconode = format.newChild(formatns, 'requires', None)
+- for (name, flags, (e,v,r), prereq) in depsList:
++ for (name, flags, (e,v,r), prereq, missingok) in depsList:
+ entry = rpconode.newChild(formatns, 'entry', None)
+ entry.newProp('name', name)
+ if flags != 0:
+@@ -711,6 +729,8 @@ def generateXML(doc, node, formatns, rpmObj, sumtype):
+ entry.newProp('rel', str(r))
+ if prereq == 1:
+ entry.newProp('pre', str(prereq))
++ if missingok:
++ entry.newProp('missingok', '1')
+
+ for file in rpmObj.usefulFiles():
+ files = format.newChild(None, 'file', None)
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/rpm-createsolvedb.py b/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/rpm-createsolvedb.py
new file mode 100755
index 000000000..a5b61bade
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo/rpm-createsolvedb.py
@@ -0,0 +1,64 @@
+#!/usr/bin/env python
+#
+# This script generates a solution database for a directory containing rpm packages
+# but tries to be efficient about this, only doing so when the packages have changed
+# in some way.
+#
+# It is assumed something already went through and removed all the solvedb.done stamp files
+# in advance.
+#
+# First argument - the rpm binary to use
+# Subsequent arguments - paths to process solution databases for
+#
+
+import sys, os
+import hashlib
+import stat
+import subprocess
+
+if len(sys.argv) < 1:
+ print("Error, rpm command not specified")
+ sys.exit(1)
+
+if len(sys.argv) < 2:
+ print("Error, no paths specified")
+ sys.exit(1)
+
+paths = sys.argv[2:]
+
+for path in paths:
+ if os.path.exists(path + "/solvedb.done"):
+ continue
+ data = ""
+ manifest = []
+ for root, dirs, files in os.walk(path):
+ for file in files:
+ f = os.path.join(root, file)
+ if f.startswith(path + "/" + "solvedb"):
+ continue
+ data = data + str(os.stat(f)[stat.ST_MTIME])
+ manifest.append(f)
+ checksum = hashlib.md5(data).hexdigest()
+
+ if os.path.exists(path + "/solvedb.checksum") and open(path + "/solvedb.checksum", "r").read() == checksum:
+ open(path + "/solvedb.done", "w")
+ continue
+
+ if os.path.exists(path + "/solvedb"):
+ subprocess.call("rm -rf %s" % (path + "/solvedb"), shell=True)
+ os.mkdir(path + "/solvedb")
+ m = open(path + "/solvedb/manifest", "w")
+ m.write("# Dynamically generated solve manifest\n")
+ for f in manifest:
+ m.write(f + "\n")
+ m.close()
+
+ cmd = sys.argv[1] + ' -i --replacepkgs --replacefiles --oldpackage -D "_dbpath ' + path + '/solvedb" --justdb \
+ --noaid --nodeps --noorder --noscripts --notriggers --noparentdirs --nolinktos --stats \
+ --ignoresize --nosignature --nodigest -D "__dbi_txn create nofsync" \
+ ' + path + '/solvedb/manifest'
+ subprocess.call(cmd, shell=True)
+
+ open(path + "/solvedb.checksum", "w").write(checksum)
+ open(path + "/solvedb.done", "w")
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo_0.4.11.bb b/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo_0.4.11.bb
new file mode 100644
index 000000000..2a3231b3a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/createrepo/createrepo_0.4.11.bb
@@ -0,0 +1,51 @@
+SUMMARY = "Creates metadata indexes for RPM package repositories"
+HOMEPAGE = "http://createrepo.baseurl.org/"
+
+RECIPE_NO_UPDATE_REASON = "Versions after 0.9.* use YUM, so we hold at 0.4.11"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=18810669f13b87348459e611d31ab760"
+
+DEPENDS_class-native += "libxml2-native rpm-native"
+RDEPENDS_${PN}_class-target = "libxml2-python"
+
+PR = "r9"
+
+SRC_URI = "http://createrepo.baseurl.org/download/${BP}.tar.gz \
+ file://fix-native-install.patch \
+ file://python-scripts-should-use-interpreter-from-env.patch \
+ file://createrepo-rpm549.patch \
+ file://recommends.patch \
+ file://createrepo-dbpath.patch \
+ file://dumpMetadata-disable-signature-validation.patch \
+ file://rpm-createsolvedb.py \
+ file://fixstat.patch \
+ "
+
+SRC_URI[md5sum] = "3e9ccf4abcffe3f49af078c83611eda2"
+SRC_URI[sha256sum] = "a73ae11a0dcde8bde36d900bc3f7f8f1083ba752c70a5c61b72d1e1e7608f21b"
+
+BBCLASSEXTEND = "native"
+
+do_install () {
+ oe_runmake -e 'DESTDIR=${D}' install
+ install -m 0755 ${WORKDIR}/rpm-createsolvedb.py ${D}${bindir}/
+}
+
+# Wrap the python script since the native python is
+# ${bindir}/python-native/python, and the "#! /usr/bin/env python" can't
+# find it since it is not in PATH.
+do_install_append_class-native () {
+ # Not all the python scripts should be wrapped since some of
+ # them are modules (be imported).
+ for i in ${D}${datadir}/createrepo/genpkgmetadata.py \
+ ${D}${datadir}/createrepo/modifyrepo.py \
+ ${D}${bindir}/rpm-createsolvedb.py ; do
+ sed -i -e 's|^#!.*/usr/bin/env python|#! /usr/bin/env nativepython|' $i
+ done
+
+ create_wrapper ${D}/${bindir}/createrepo \
+ RPM_USRLIBRPM=${STAGING_LIBDIR_NATIVE}/rpm \
+ RPM_ETCRPM=${STAGING_ETCDIR_NATIVE}/rpm \
+ RPM_LOCALEDIRRPM=${STAGING_DATADIR_NATIVE}/locale
+}
diff --git a/import-layers/yocto-poky/meta/recipes-support/curl/curl/configure_ac.patch b/import-layers/yocto-poky/meta/recipes-support/curl/curl/configure_ac.patch
new file mode 100644
index 000000000..b8bd304d7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/curl/curl/configure_ac.patch
@@ -0,0 +1,13 @@
+Upstream-Status: Pending
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -281,7 +281,7 @@ dnl ************************************
+
+ CURL_CHECK_COMPILER
+ CURL_SET_COMPILER_BASIC_OPTS
+-CURL_SET_COMPILER_DEBUG_OPTS
++dnl CURL_SET_COMPILER_DEBUG_OPTS
+ CURL_SET_COMPILER_OPTIMIZE_OPTS
+ CURL_SET_COMPILER_WARNING_OPTS
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/curl/curl_7.47.1.bb b/import-layers/yocto-poky/meta/recipes-support/curl/curl_7.47.1.bb
new file mode 100644
index 000000000..c2173d8a0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/curl/curl_7.47.1.bb
@@ -0,0 +1,68 @@
+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"
+
+# curl likes to set -g0 in CFLAGS, so we stop it
+# from mucking around with debug options
+#
+SRC_URI += " file://configure_ac.patch"
+
+SRC_URI[md5sum] = "9ea3123449439bbd960cd25cf98796fb"
+SRC_URI[sha256sum] = "ddc643ab9382e24bbe4747d43df189a0a6ce38fcb33df041b9cb0b3cd47ae98f"
+
+inherit autotools pkgconfig binconfig multilib_header
+
+PACKAGECONFIG ??= "${@bb.utils.contains("DISTRO_FEATURES", "ipv6", "ipv6", "", d)} gnutls proxy zlib"
+PACKAGECONFIG_class-native = "ipv6 proxy ssl zlib"
+PACKAGECONFIG_class-nativesdk = "ipv6 proxy ssl zlib"
+
+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[ldap] = "--enable-ldap,--disable-ldap,"
+PACKAGECONFIG[ldaps] = "--enable-ldaps,--disable-ldaps,"
+PACKAGECONFIG[libidn] = "--with-libidn,--without-libidn,libidn"
+PACKAGECONFIG[libssh2] = "--with-libssh2,--without-libssh2,libssh2"
+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[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 \
+ --without-nghttp2 \
+"
+
+do_install_append() {
+ oe_multilib_header curl/curlbuild.h
+}
+
+do_install_append_class-target() {
+ # cleanup buildpaths from curl-config
+ sed -i -e 's,${STAGING_DIR_HOST},,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/import-layers/yocto-poky/meta/recipes-support/db/db/Makefile-let-libdb-6.0.la-depend-os_map.l.patch b/import-layers/yocto-poky/meta/recipes-support/db/db/Makefile-let-libdb-6.0.la-depend-os_map.l.patch
new file mode 100644
index 000000000..d4c6bb8e0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/db/db/Makefile-let-libdb-6.0.la-depend-os_map.l.patch
@@ -0,0 +1,32 @@
+From 2902dda6e3f7b2cd5796a96af20deece610e2eb9 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 16 Nov 2015 22:20:49 -0800
+Subject: [PATCH] build_unix/Makefile: let libdb-6.0.la depend os_map.lo
+
+Fixed parallel issue:
+libtool: link: `os_map.lo' is not a valid libtool object
+Makefile:867: recipe for target 'libdb-6.0.la' failed
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ dist/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/dist/Makefile.in b/dist/Makefile.in
+index 0a42375..d9e05b9 100644
+--- a/dist/Makefile.in
++++ b/dist/Makefile.in
+@@ -863,7 +863,7 @@ $(libdb_version): $(C_OBJS)
+ $(LN) -s $(libdb_version) $(libdb)
+
+ # Shared C library.
+-$(libso_target): $(C_OBJS) bt_rec@o@
++$(libso_target): $(C_OBJS) bt_rec@o@ os_map@o@
+ $(SOLINK) $(SOFLAGS) $(LDFLAGS) -o $@ $(C_OBJS) \
+ $(LIBCSO_LIBS)
+ $(RM) $(libdb)
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/db/db/Makefile-let-libso_target-depend-on-bt_rec.patch b/import-layers/yocto-poky/meta/recipes-support/db/db/Makefile-let-libso_target-depend-on-bt_rec.patch
new file mode 100644
index 000000000..329bff5d3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/db/db/Makefile-let-libso_target-depend-on-bt_rec.patch
@@ -0,0 +1,30 @@
+From c640ff9340f358a00835816d0fea03d27a7be978 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Tue, 31 Mar 2015 00:56:44 -0700
+Subject: [PATCH] Makefile: let libso_target depend on bt_rec
+
+Fixed parallel issue:
+libtool: link: `bt_rec.lo' is not a valid libtool object
+Makefile:867: recipe for target 'libdb-6.0.la' failed
+make: *** [libdb-6.0.la] Error 1
+
+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 e451f70..0a42375 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -863,7 +863,7 @@ $(libdb_version): $(C_OBJS)
+ $(LN) -s $(libdb_version) $(libdb)
+
+ # Shared C library.
+-$(libso_target): $(C_OBJS)
++$(libso_target): $(C_OBJS) bt_rec@o@
+ $(SOLINK) $(SOFLAGS) $(LDFLAGS) -o $@ $(C_OBJS) \
+ $(LIBCSO_LIBS)
+ $(RM) $(libdb)
diff --git a/import-layers/yocto-poky/meta/recipes-support/db/db/arm-thumb-mutex_db5.patch b/import-layers/yocto-poky/meta/recipes-support/db/db/arm-thumb-mutex_db5.patch
new file mode 100644
index 000000000..34e8db84d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/db/db/arm-thumb-mutex_db5.patch
@@ -0,0 +1,48 @@
+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
+
+--- db-5.1.19/src/dbinc/mutex_int.h.orig 2011-01-05 19:21:42.181805366 -0600
++++ db-5.1.19/src/dbinc/mutex_int.h 2011-01-05 19:24:53.141853117 -0600
+@@ -474,6 +474,25 @@
+
+ #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 @@
+ ); \
+ __r & 1; \
+ })
++#endif
+
+ #define MUTEX_UNSET(tsl) (*(volatile tsl_t *)(tsl) = 0)
+ #define MUTEX_INIT(tsl) (MUTEX_UNSET(tsl), 0)
diff --git a/import-layers/yocto-poky/meta/recipes-support/db/db/fix-parallel-build.patch b/import-layers/yocto-poky/meta/recipes-support/db/db/fix-parallel-build.patch
new file mode 100644
index 000000000..2c7f1e186
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/db/db/fix-parallel-build.patch
@@ -0,0 +1,19 @@
+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>
+
+--- dist.orig/Makefile.in 2012-05-11 19:57:48.000000000 +0200
++++ dist/Makefile.in 2013-10-31 18:17:11.875532522 +0100
+@@ -1034,7 +1034,7 @@
+ 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/import-layers/yocto-poky/meta/recipes-support/db/db_5.3.28.bb b/import-layers/yocto-poky/meta/recipes-support/db/db_5.3.28.bb
new file mode 100644
index 000000000..c724f049f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/db/db_5.3.28.bb
@@ -0,0 +1,117 @@
+# 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"
+VIRTUAL_NAME ?= "virtual/db"
+RCONFLICTS_${PN} = "db3"
+
+SRC_URI = "http://download.oracle.com/berkeley-db/db-${PV}.tar.gz"
+SRC_URI += "file://arm-thumb-mutex_db5.patch;patchdir=.. \
+ file://fix-parallel-build.patch \
+ "
+
+SRC_URI[md5sum] = "b99454564d5b4479750567031d66fe24"
+SRC_URI[sha256sum] = "e0a992d740709892e81f9d93f06daf305cf73fb81b545afe72478043172c3628"
+
+LIC_FILES_CHKSUM = "file://../LICENSE;md5=ed1158e31437f4f87cdd4ab2b8613955"
+
+inherit autotools
+
+# Put virtual/db in any appropriate provider of a
+# relational database, use it as a dependency in
+# place of a specific db and use:
+#
+# PREFERRED_PROVIDER_virtual/db
+#
+# to select the correct db in the build (distro) .conf
+PROVIDES += "${VIRTUAL_NAME}"
+
+# bitbake isn't quite clever enough to deal with sleepycat,
+# the distribution sits in the expected directory, but all
+# the builds must occur from a sub-directory. The following
+# persuades bitbake to go to the right place
+S = "${WORKDIR}/db-${PV}/dist"
+B = "${WORKDIR}/db-${PV}/build_unix"
+SPDX_S = "${WORKDIR}/db-${PV}"
+
+# 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}"
+EXTRA_OEMAKE_class-target = "LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool"
+
+# Cancel the site stuff - it's set for db3 and destroys the
+# configure.
+CONFIG_SITE = ""
+do_configure() {
+ gnu-configize --force ${S}
+ export STRIP="true"
+ oe_runconf
+}
+
+do_compile_prepend() {
+ sed -i -e 's|hardcode_into_libs=yes|hardcode_into_libs=no|' \
+ ${B}/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/import-layers/yocto-poky/meta/recipes-support/db/db_6.0.30.bb b/import-layers/yocto-poky/meta/recipes-support/db/db_6.0.30.bb
new file mode 100644
index 000000000..50a469b08
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/db/db_6.0.30.bb
@@ -0,0 +1,124 @@
+# Version 6 of the Berkeley DB from Oracle (formerly 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 DB6 can both be installed on the
+# same system at the same time if really necessary.
+SECTION = "libs"
+SUMMARY = "Berkeley Database v6"
+HOMEPAGE = "http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html"
+LICENSE = "AGPL-3.0"
+VIRTUAL_NAME ?= "virtual/db"
+RCONFLICTS_${PN} = "db3"
+
+# Note, when upgraded to 6.1.x, a patch in RPM will need to be removed to activate db 6.1 support.
+
+SRC_URI = "http://download.oracle.com/berkeley-db/db-${PV}.tar.gz"
+SRC_URI += "file://arm-thumb-mutex_db5.patch;patchdir=.. \
+ file://fix-parallel-build.patch \
+ file://Makefile-let-libso_target-depend-on-bt_rec.patch \
+ file://Makefile-let-libdb-6.0.la-depend-os_map.l.patch;patchdir=.. \
+ "
+
+SRC_URI[md5sum] = "ad28eb86ad3203b5422844db179c585b"
+SRC_URI[sha256sum] = "608e4b1cf390e9bf54c0ef00c5bd9ca76d36e2261b9f4d33d54516f3f6a20fd2"
+
+# Exclude NC versions which lack AES encryption
+UPSTREAM_CHECK_REGEX = "db-(?P<pver>\d+\.\d+(\.\d+)?).tar"
+UPSTREAM_CHECK_URI = "http://www.oracle.com/technetwork/products/berkeleydb/downloads/index-082944.html"
+
+LIC_FILES_CHKSUM = "file://../LICENSE;md5=1ec8b0b17cc31513fe35ab10716f8490"
+
+inherit autotools
+
+# Put virtual/db in any appropriate provider of a
+# relational database, use it as a dependency in
+# place of a specific db and use:
+#
+# PREFERRED_PROVIDER_virtual/db
+#
+# to select the correct db in the build (distro) .conf
+PROVIDES += "${VIRTUAL_NAME}"
+
+# bitbake isn't quite clever enough to deal with sleepycat,
+# the distribution sits in the expected directory, but all
+# the builds must occur from a sub-directory. The following
+# persuades bitbake to go to the right place
+S = "${WORKDIR}/db-${PV}/dist"
+B = "${WORKDIR}/db-${PV}/build_unix"
+SPDX_S = "${WORKDIR}/db-${PV}"
+
+# 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 = "-6*.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)
+DB6_CONFIG ?= "--enable-o_direct --disable-cryptography --disable-queue --disable-replication --disable-verify --disable-compat185 --disable-sql"
+
+EXTRA_OECONF = "${DB6_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
+ARM_MUTEX = "--with-mutex=ARM/gcc-assembly"
+MUTEX = ""
+MUTEX_arm = "${ARM_MUTEX}"
+MUTEX_armeb = "${ARM_MUTEX}"
+EXTRA_OECONF += "${MUTEX}"
+EXTRA_OEMAKE_class-target = "LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool"
+
+# Cancel the site stuff - it's set for db3 and destroys the
+# configure.
+CONFIG_SITE = ""
+do_configure() {
+ gnu-configize --force ${S}
+ export STRIP="true"
+ oe_runconf
+}
+
+do_compile_prepend() {
+ sed -i -e 's|hardcode_into_libs=yes|hardcode_into_libs=no|' \
+ ${B}/libtool
+}
+
+do_install_append() {
+ mkdir -p ${D}/${includedir}/db60
+ mv ${D}/${includedir}/db.h ${D}/${includedir}/db60/.
+ mv ${D}/${includedir}/db_cxx.h ${D}/${includedir}/db60/.
+ ln -s db60/db.h ${D}/${includedir}/db.h
+ ln -s db60/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/import-layers/yocto-poky/meta/recipes-support/debianutils/debianutils_4.7.bb b/import-layers/yocto-poky/meta/recipes-support/debianutils/debianutils_4.7.bb
new file mode 100644
index 000000000..6a1d5bf83
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/debianutils/debianutils_4.7.bb
@@ -0,0 +1,48 @@
+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/20160204T040501Z/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] = "00186f527b35e2cecd4db593c6d512d0"
+SRC_URI[sha256sum] = "a269cacd40f52f2fa5d5636357714a49e8538459c16d77772efaa23711fe53d9"
+
+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"
+
+
+ALTERNATIVE_PRIORITY="30"
+ALTERNATIVE_${PN} = "add-shell installkernel remove-shell savelog tempfile which"
+ALTERNATIVE_${PN}-run-parts = "run-parts"
+
+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"
diff --git a/import-layers/yocto-poky/meta/recipes-support/enchant/enchant_1.6.0.bb b/import-layers/yocto-poky/meta/recipes-support/enchant/enchant_1.6.0.bb
new file mode 100644
index 000000000..97a47614c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/enchant/enchant_1.6.0.bb
@@ -0,0 +1,32 @@
+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 = "aspell 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"
+
+EXTRA_OECONF = "--with-aspell-prefix=${STAGING_DIR_HOST}${prefix} \
+ --enable-aspell 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"
+
+RDEPENDS_${PN} += "aspell"
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/gdbm/files/ptest.patch b/import-layers/yocto-poky/meta/recipes-support/gdbm/files/ptest.patch
new file mode 100644
index 000000000..65236fb48
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gdbm/files/ptest.patch
@@ -0,0 +1,36 @@
+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
+
+diff -ur a/Makefile.am b/Makefile.am
+--- a/Makefile.am 2011-08-16 10:13:10.000000000 +0200
++++ b/Makefile.am 2013-04-12 18:02:16.473715873 +0200
+@@ -31,3 +31,8 @@
+ d=`date '+%d/%m/%Y'`; \
+ sed 's|/\*@DIST_DATE@\*/|"'"$$d"'"|' $(srcdir)/src/version.c > \
+ $(distdir)/src/version.c
++
++install-ptest:
++ @for subdir in $(SUBDIRS); do \
++ $(MAKE) -C $$subdir DESTDIR=$(DESTDIR)/$$subdir $@; \
++ done
+diff -ur a/tests/Makefile.am b/tests/Makefile.am
+--- a/tests/Makefile.am 2011-11-11 19:39:42.000000000 +0100
++++ b/tests/Makefile.am 2013-04-12 18:30:57.066301037 +0200
+@@ -132,4 +132,14 @@
+ 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
diff --git a/import-layers/yocto-poky/meta/recipes-support/gdbm/files/run-ptest b/import-layers/yocto-poky/meta/recipes-support/gdbm/files/run-ptest
new file mode 100755
index 000000000..615da8444
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm-1.8.3/ldflags.patch b/import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm-1.8.3/ldflags.patch
new file mode 100644
index 000000000..d3cb43b9b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm-1.8.3/ldflags.patch
@@ -0,0 +1,22 @@
+Obey LDFLAGS
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+Upstream-Status: Inappropriate [old version]
+
+--- gdbm-1.8.3.orig/Makefile.in
++++ gdbm-1.8.3/Makefile.in
+@@ -156,12 +156,12 @@ install-compat:
+
+ libgdbm.la: $(LOBJS) gdbm.h
+ rm -f libgdbm.la
+- $(LIBTOOL) --mode=link $(CC) -o libgdbm.la -rpath $(libdir) \
++ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o libgdbm.la -rpath $(libdir) \
+ -version-info $(SHLIB_VER) $(LOBJS)
+
+ libgdbm_compat.la: $(C_LOBJS) gdbm.h
+ rm -f libgdbm_compat.la
+- $(LIBTOOL) --mode=link $(CC) -o libgdbm_compat.la -rpath $(libdir) \
++ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o libgdbm_compat.la -rpath $(libdir) \
+ -version-info $(SHLIB_VER) $(C_LOBJS)
+
+ gdbm.h: gdbm.proto gdbmerrno.h gdbm.proto2
diff --git a/import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm-1.8.3/libtool-mode.patch b/import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm-1.8.3/libtool-mode.patch
new file mode 100644
index 000000000..0f9d04f4a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm-1.8.3/libtool-mode.patch
@@ -0,0 +1,22 @@
+Upstream-Status: Pending
+
+--- gdbm-1.8.3/Makefile.in.orig 2006-02-16 15:17:25.000000000 +0000
++++ gdbm-1.8.3/Makefile.in 2006-02-16 15:18:08.000000000 +0000
+@@ -131,7 +131,7 @@
+ $(srcdir)/mkinstalldirs $(DESTDIR)$(libdir) \
+ $(DESTDIR)$(includedir) $(DESTDIR)$(man3dir) \
+ $(DESTDIR)$(infodir)
+- $(LIBTOOL) $(INSTALL) -c libgdbm.la $(DESTDIR)$(libdir)/libgdbm.la
++ $(LIBTOOL) --mode=install $(INSTALL) -c libgdbm.la $(DESTDIR)$(libdir)/libgdbm.la
+ $(INSTALL_DATA) gdbm.h \
+ $(DESTDIR)$(includedir)/gdbm.h
+ $(INSTALL_DATA) $(srcdir)/gdbm.3 \
+@@ -142,7 +142,7 @@
+ install-compat:
+ $(srcdir)/mkinstalldirs $(DESTDIR)$(libdir) \
+ $(DESTDIR)$(includedir)
+- $(LIBTOOL) $(INSTALL) -c libgdbm_compat.la \
++ $(LIBTOOL) --mode=install $(INSTALL) -c libgdbm_compat.la \
+ $(DESTDIR)$(libdir)/libgdbm_compat.la
+ $(INSTALL_DATA) $(srcdir)/dbm.h \
+ $(DESTDIR)$(includedir)/dbm.h
diff --git a/import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm-1.8.3/makefile.patch b/import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm-1.8.3/makefile.patch
new file mode 100644
index 000000000..369145c41
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm-1.8.3/makefile.patch
@@ -0,0 +1,60 @@
+Upstream-Status: Pending
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+
+--- gdbm-1.8.3/Makefile.in~makefile
++++ gdbm-1.8.3/Makefile.in
+@@ -22,6 +22,7 @@
+ TEXI2DVI = texi2dvi
+
+ DEFS =
++DESTDIR =
+
+ # Where the system [n]dbm routines are...
+ LIBS = @LIBS@ -lc
+@@ -127,26 +128,26 @@
+ progs: $(PROGS)
+
+ install: libgdbm.la gdbm.h gdbm.info
+- $(srcdir)/mkinstalldirs $(INSTALL_ROOT)$(libdir) \
+- $(INSTALL_ROOT)$(includedir) $(INSTALL_ROOT)$(man3dir) \
+- $(INSTALL_ROOT)$(infodir)
+- $(LIBTOOL) $(INSTALL) -c libgdbm.la $(INSTALL_ROOT)$(libdir)/libgdbm.la
+- $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) gdbm.h \
+- $(INSTALL_ROOT)$(includedir)/gdbm.h
+- $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/gdbm.3 \
+- $(INSTALL_ROOT)$(man3dir)/gdbm.3
+- $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/gdbm.info \
+- $(INSTALL_ROOT)$(infodir)/gdbm.info
++ $(srcdir)/mkinstalldirs $(DESTDIR)$(libdir) \
++ $(DESTDIR)$(includedir) $(DESTDIR)$(man3dir) \
++ $(DESTDIR)$(infodir)
++ $(LIBTOOL) $(INSTALL) -c libgdbm.la $(DESTDIR)$(libdir)/libgdbm.la
++ $(INSTALL_DATA) gdbm.h \
++ $(DESTDIR)$(includedir)/gdbm.h
++ $(INSTALL_DATA) $(srcdir)/gdbm.3 \
++ $(DESTDIR)$(man3dir)/gdbm.3
++ $(INSTALL_DATA) $(srcdir)/gdbm.info \
++ $(DESTDIR)$(infodir)/gdbm.info
+
+ install-compat:
+- $(srcdir)/mkinstalldirs $(INSTALL_ROOT)$(libdir) \
+- $(INSTALL_ROOT)$(includedir)
++ $(srcdir)/mkinstalldirs $(DESTDIR)$(libdir) \
++ $(DESTDIR)$(includedir)
+ $(LIBTOOL) $(INSTALL) -c libgdbm_compat.la \
+- $(INSTALL_ROOT)$(libdir)/libgdbm_compat.la
+- $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/dbm.h \
+- $(INSTALL_ROOT)$(includedir)/dbm.h
+- $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/ndbm.h \
+- $(INSTALL_ROOT)$(includedir)/ndbm.h
++ $(DESTDIR)$(libdir)/libgdbm_compat.la
++ $(INSTALL_DATA) $(srcdir)/dbm.h \
++ $(DESTDIR)$(includedir)/dbm.h
++ $(INSTALL_DATA) $(srcdir)/ndbm.h \
++ $(DESTDIR)$(includedir)/ndbm.h
+
+ #libgdbm.a: $(OBJS) gdbm.h
+ # rm -f libgdbm.a
diff --git a/import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm_1.11.bb b/import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm_1.11.bb
new file mode 100644
index 000000000..adf8c5bd3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm_1.11.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] = "72c832680cf0999caedbe5b265c8c1bd"
+SRC_URI[sha256sum] = "8d912f44f05d0b15a4a5d96a76f852e905d051bb88022fcdfd98b43be093e3c3"
+
+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/import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm_1.8.3.bb b/import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm_1.8.3.bb
new file mode 100644
index 000000000..b253dc144
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gdbm/gdbm_1.8.3.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Key/value database library with extensible hashing"
+HOMEPAGE = "http://www.gnu.org/software/gdbm/"
+SECTION = "libs"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d8e20eece214df8ef953ed5857862150"
+
+PR = "r4"
+
+SRC_URI = "${GNU_MIRROR}/gdbm/gdbm-${PV}.tar.gz \
+ file://makefile.patch \
+ file://libtool-mode.patch \
+ file://ldflags.patch"
+
+SRC_URI[md5sum] = "1d1b1d5c0245b1c00aff92da751e9aa1"
+SRC_URI[sha256sum] = "cc340338a2e28b40058ab9eb5354a21d53f88a1582ea21ba0bb185c37a281dc9"
+
+inherit autotools texinfo
+
+BBCLASSEXTEND = "native nativesdk"
+
+do_install_append () {
+ oe_runmake install-compat DESTDIR=${D}
+ install -d ${D}${includedir}/gdbm
+ install -m 0644 ${S}/dbm.h ${D}${includedir}/
+ install -m 0644 ${S}/ndbm.h ${D}${includedir}/
+ # Create a symlink to ndbm.h and gdbm.h in include/gdbm to let other packages to find
+ # these headers
+ ln -sf ../ndbm.h ${D}/${includedir}/gdbm/ndbm.h
+ ln -sf ../gdbm.h ${D}/${includedir}/gdbm/gdbm.h
+}
diff --git a/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/Use-__gnu_inline__-attribute.patch b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/Use-__gnu_inline__-attribute.patch
new file mode 100644
index 000000000..627d71aba
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/Use-__gnu_inline__-attribute.patch
@@ -0,0 +1,36 @@
+From 3cb33502bafd04b8ad4ca3454fab16d5ff313297 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Tue, 22 Sep 2015 13:16:23 +0300
+Subject: [PATCH] Use __gnu_inline__ attribute
+
+gcc5 uses C11 inline rules. This means the old "extern inline"
+semantics are not available without a special attribute.
+
+See: https://gcc.gnu.org/gcc-5/porting_to.html
+
+Upstream-Status: Inappropriate [Fixed in current versions]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ gmp-h.in | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/gmp-h.in b/gmp-h.in
+index eed6fe4..361dd1d 100644
+--- a/gmp-h.in
++++ b/gmp-h.in
+@@ -419,8 +419,11 @@ typedef __mpq_struct *mpq_ptr;
+ /* gcc has __inline__ in all modes, including strict ansi. Give a prototype
+ for an inline too, so as to correctly specify "dllimport" on windows, in
+ case the function is called rather than inlined. */
++
++/* Use __gnu_inline__ attribute: later gcc uses different "extern inline"
++ behaviour */
+ #ifdef __GNUC__
+-#define __GMP_EXTERN_INLINE extern __inline__
++#define __GMP_EXTERN_INLINE extern __inline__ __attribute__ ((__gnu_inline__))
+ #define __GMP_INLINE_PROTOTYPES 1
+ #endif
+
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/avoid-h-asm-constraint-for-MIPS.patch b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/avoid-h-asm-constraint-for-MIPS.patch
new file mode 100644
index 000000000..6da0be9ca
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/avoid-h-asm-constraint-for-MIPS.patch
@@ -0,0 +1,57 @@
+From d50686de0406a88ef9112f5252103f799982e84a Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Thu, 4 Feb 2016 14:00:00 -0800
+Subject: [PATCH] avoid h asm constraint for MIPS
+
+The h asm constrain (to extract the high part of a multiplication
+result) has not been recognised since gcc 4.4:
+
+ https://gcc.gnu.org/gcc-4.4/changes.html
+
+Drop the MIPS umul_ppmm() implementations which rely on "=h" and fall
+back to the older implementations (which use explicit mfhi and mflo
+instructions to move the high and low parts of the multiplication
+result into their destinations).
+
+Upstream-Status: Inappropriate [upstream has a different solution]
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ longlong.h | 10 ----------
+ 1 file changed, 10 deletions(-)
+
+diff --git a/longlong.h b/longlong.h
+index b53fbee..0193abb 100644
+--- a/longlong.h
++++ b/longlong.h
+@@ -1011,27 +1011,17 @@ extern UWtype __MPN(udiv_qrnnd) _PROTO ((UWtype *, UWtype, UWtype, UWtype));
+ #endif /* __m88000__ */
+
+ #if defined (__mips) && W_TYPE_SIZE == 32
+-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
+-#define umul_ppmm(w1, w0, u, v) \
+- __asm__ ("multu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
+-#else
+ #define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("multu %2,%3\n\tmflo %0\n\tmfhi %1" \
+ : "=d" (w0), "=d" (w1) : "d" (u), "d" (v))
+-#endif
+ #define UMUL_TIME 10
+ #define UDIV_TIME 100
+ #endif /* __mips */
+
+ #if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64
+-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
+-#define umul_ppmm(w1, w0, u, v) \
+- __asm__ ("dmultu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
+-#else
+ #define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("dmultu %2,%3\n\tmflo %0\n\tmfhi %1" \
+ : "=d" (w0), "=d" (w1) : "d" (u), "d" (v))
+-#endif
+ #define UMUL_TIME 20
+ #define UDIV_TIME 140
+ #endif /* __mips */
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/gmp_fix_for_automake-1.12.patch b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/gmp_fix_for_automake-1.12.patch
new file mode 100644
index 000000000..63aed05ec
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/gmp_fix_for_automake-1.12.patch
@@ -0,0 +1,56 @@
+automake 1.12 has depricated automatic de-ANSI-fication support
+
+this patch avoids these kinds of errors:
+
+| configure.in:2240: error: automatic de-ANSI-fication support has been removed
+| Makefile.am:28: error: automatic de-ANSI-fication support has been removed
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/02
+
+
+This patch was removed in f181c6ce8b3 when gmp 4.2.1 was mistakenly
+dropped.
+
+Upstream is not interested in patches for ancient versions.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+
+Index: gmp-4.2.1/configure.in
+===================================================================
+--- gmp-4.2.1.orig/configure.in
++++ gmp-4.2.1/configure.in
+@@ -67,7 +67,7 @@ dnl
+ dnl Note that there's a copy of these options in the top-level Makefile.am,
+ dnl so update there too if changing anything.
+ dnl
+-AM_INIT_AUTOMAKE([1.8 gnu no-dependencies $(top_builddir)/ansi2knr])
++AM_INIT_AUTOMAKE([1.8 gnu no-dependencies])
+ AM_CONFIG_HEADER(config.h:config.in)
+ AM_MAINTAINER_MODE
+
+@@ -2022,9 +2022,6 @@ fi
+ echo " MPN_PATH=\"$path\""
+
+
+-# Automake ansi2knr support.
+-AM_C_PROTOTYPES
+-
+ GMP_PROG_AR
+ GMP_PROG_NM
+
+Index: gmp-4.2.1/Makefile.am
+===================================================================
+--- gmp-4.2.1.orig/Makefile.am
++++ gmp-4.2.1/Makefile.am
+@@ -27,7 +27,7 @@
+ # Makefiles in subdirectories, but here we must omit it so automake gives
+ # the actual ansi2knr build rule, not "cd $(top_builddir) && make ansi2knr".
+ #
+-AUTOMAKE_OPTIONS = 1.8 gnu no-dependencies ansi2knr
++AUTOMAKE_OPTIONS = 1.8 gnu no-dependencies
+
+
+ # Libtool -version-info for libgmp.la and libmp.la. See "Versioning" in the
diff --git a/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.0/0001-Append-the-user-provided-flags-to-the-auto-detected-.patch b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.0/0001-Append-the-user-provided-flags-to-the-auto-detected-.patch
new file mode 100644
index 000000000..325ffe491
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.0/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/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.0/amd64.patch b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.0/amd64.patch
new file mode 100644
index 000000000..564d12d42
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.0/amd64.patch
@@ -0,0 +1,18 @@
+Upstream-Status: Pending
+
+Index: gmp-5.0.3/longlong.h
+===================================================================
+--- gmp-5.0.3.orig/longlong.h
++++ gmp-5.0.3/longlong.h
+@@ -994,8 +994,10 @@ extern UWtype __MPN(udiv_qrnnd) _PROTO (
+ 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 /* x86_64 */
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.0/use-includedir.patch b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.0/use-includedir.patch
new file mode 100644
index 000000000..74904a253
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.0/use-includedir.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Index: gmp-4.2.4/Makefile.am
+===================================================================
+--- gmp-4.2.4.orig/Makefile.am 2008-09-10 19:31:27.000000000 +0000
++++ gmp-4.2.4/Makefile.am 2009-07-06 20:19:19.000000000 +0000
+@@ -106,7 +106,7 @@
+ # but anyone knowledgable 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 $(MPBSD_HEADERS_OPTION)
+ lib_LTLIBRARIES = libgmp.la $(GMPXX_LTLIBRARIES_OPTION) $(MPBSD_LTLIBRARIES_OPTION)
diff --git a/import-layers/yocto-poky/meta/recipes-support/gmp/gmp.inc b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp.inc
new file mode 100644
index 000000000..abac8cf33
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/gmp/gmp_4.2.1.bb b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp_4.2.1.bb
new file mode 100644
index 000000000..5e8ee29f3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp_4.2.1.bb
@@ -0,0 +1,17 @@
+require gmp.inc
+
+LICENSE = "LGPLv2.1+ & GPLv2+"
+LICENSE_${PN} = "LGPLv2.1+"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=892f569a555ba9c07a568a7c0c4fa63a \
+ file://COPYING.LIB;md5=fbc093901857fcd118f065f900982c24 \
+ file://gmp-h.in;beginline=6;endline=21;md5=e056f74a12c3277d730dbcfb85d2ca34"
+
+SRC_URI = "https://gmplib.org/download/${BPN}/archive/${BP}.tar.bz2 \
+ file://Use-__gnu_inline__-attribute.patch \
+ file://gmp_fix_for_automake-1.12.patch \
+ file://avoid-h-asm-constraint-for-MIPS.patch \
+"
+
+SRC_URI[md5sum] = "091c56e0e1cca6b09b17b69d47ef18e3"
+SRC_URI[sha256sum] = "d07ffcb37eecec35c5ec72516d10b35fdf6e6fef1fcf1dcd37e30b8cbf8bf941"
diff --git a/import-layers/yocto-poky/meta/recipes-support/gmp/gmp_6.1.0.bb b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp_6.1.0.bb
new file mode 100644
index 000000000..de827f5b7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp_6.1.0.bb
@@ -0,0 +1,33 @@
+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 \
+ "
+
+SRC_URI[md5sum] = "86ee6e54ebfc4a90b643a65e402c4048"
+SRC_URI[sha256sum] = "498449a994efeba527885c10405993427995d3f86b8768d8cdf8d9dd7c6b73e8"
+
+acpaths = ""
+
+EXTRA_OECONF += " --enable-cxx=detect"
+
+PACKAGES =+ "libgmpxx"
+FILES_libgmpxx = "${libdir}/libgmpxx${SOLIBS}"
+
+do_install_append_class-target() {
+ sed -i "s|--sysroot=${STAGING_DIR_HOST}||g" ${D}${includedir}/gmp.h
+}
+
+SSTATE_SCAN_FILES += "gmp.h"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnome-desktop-testing/gnome-desktop-testing/0001-gsystem-subprocess.c-Enable-GNU-extensions-in-system.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/gnome-desktop-testing/gnome-desktop-testing/update-output-syntax.patch b/import-layers/yocto-poky/meta/recipes-support/gnome-desktop-testing/gnome-desktop-testing/update-output-syntax.patch
new file mode 100644
index 000000000..5a178e2ef
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/gnome-desktop-testing/gnome-desktop-testing_2014.1.bb b/import-layers/yocto-poky/meta/recipes-support/gnome-desktop-testing/gnome-desktop-testing_2014.1.bb
new file mode 100644
index 000000000..ccb3d3b7d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4242.patch b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4242.patch
new file mode 100644
index 000000000..f0667741c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4242.patch
@@ -0,0 +1,63 @@
+From e2202ff2b704623efc6277fb5256e4e15bac5676 Mon Sep 17 00:00:00 2001
+From: Werner Koch <wk@gnupg.org>
+Date: Thu, 25 Jul 2013 11:17:52 +0200
+Subject: [PATCH] Mitigate a flush+reload cache attack on RSA secret
+ exponents.
+
+commit e2202ff2b704623efc6277fb5256e4e15bac5676 from
+git://git.gnupg.org/libgcrypt.git
+
+* mpi/mpi-pow.c (gcry_mpi_powm): Always perfrom the mpi_mul for
+exponents in secure memory.
+
+Upstream-Status: Backport
+CVE: CVE-2013-4242
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+--
+
+The attack is published as http://eprint.iacr.org/2013/448 :
+
+Flush+Reload: a High Resolution, Low Noise, L3 Cache Side-Channel
+Attack by Yuval Yarom and Katrina Falkner. 18 July 2013.
+
+ Flush+Reload is a cache side-channel attack that monitors access to
+ data in shared pages. In this paper we demonstrate how to use the
+ attack to extract private encryption keys from GnuPG. The high
+ resolution and low noise of the Flush+Reload attack enables a spy
+ program to recover over 98% of the bits of the private key in a
+ single decryption or signing round. Unlike previous attacks, the
+ attack targets the last level L3 cache. Consequently, the spy
+ program and the victim do not need to share the execution core of
+ the CPU. The attack is not limited to a traditional OS and can be
+ used in a virtualised environment, where it can attack programs
+ executing in a different VM.
+
+Index: gnupg-1.4.7/mpi/mpi-pow.c
+===================================================================
+--- gnupg-1.4.7.orig/mpi/mpi-pow.c
++++ gnupg-1.4.7/mpi/mpi-pow.c
+@@ -212,7 +212,13 @@ mpi_powm( MPI res, MPI base, MPI exponen
+ tp = rp; rp = xp; xp = tp;
+ rsize = xsize;
+
+- if( (mpi_limb_signed_t)e < 0 ) {
++ /* To mitigate the Yarom/Falkner flush+reload cache
++ * side-channel attack on the RSA secret exponent, we do
++ * the multiplication regardless of the value of the
++ * high-bit of E. But to avoid this performance penalty
++ * we do it only if the exponent has been stored in secure
++ * memory and we can thus assume it is a secret exponent. */
++ if (esec || (mpi_limb_signed_t)e < 0) {
+ /*mpihelp_mul( xp, rp, rsize, bp, bsize );*/
+ if( bsize < KARATSUBA_THRESHOLD ) {
+ mpihelp_mul( xp, rp, rsize, bp, bsize );
+@@ -227,6 +233,8 @@ mpi_powm( MPI res, MPI base, MPI exponen
+ mpihelp_divrem(xp + msize, 0, xp, xsize, mp, msize);
+ xsize = msize;
+ }
++ }
++ if ( (mpi_limb_signed_t)e < 0 ) {
+
+ tp = rp; rp = xp; xp = tp;
+ rsize = xsize;
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4351.patch b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4351.patch
new file mode 100644
index 000000000..b50a32f40
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4351.patch
@@ -0,0 +1,45 @@
+Upstream-Status: Backport
+CVE: CVE-2013-4351
+
+Index: gnupg-1.4.7/g10/getkey.c
+===================================================================
+--- gnupg-1.4.7.orig/g10/getkey.c 2007-03-05 16:54:41.000000000 +0800
++++ gnupg-1.4.7/g10/getkey.c 2013-11-28 14:41:59.640212240 +0800
+@@ -1454,7 +1454,11 @@
+
+ if(flags)
+ key_usage |= PUBKEY_USAGE_UNKNOWN;
++ if (!key_usage)
++ key_usage |= PUBKEY_USAGE_NONE;
+ }
++ else if (p)
++ key_usage |= PUBKEY_USAGE_NONE;
+
+ /* We set PUBKEY_USAGE_UNKNOWN to indicate that this key has a
+ capability that we do not handle. This serves to distinguish
+Index: gnupg-1.4.7/g10/keygen.c
+===================================================================
+--- gnupg-1.4.7.orig/g10/keygen.c 2007-02-05 00:27:40.000000000 +0800
++++ gnupg-1.4.7/g10/keygen.c 2013-11-28 14:43:05.016670092 +0800
+@@ -209,9 +209,6 @@
+ if (use & PUBKEY_USAGE_AUTH)
+ buf[0] |= 0x20;
+
+- if (!buf[0])
+- return;
+-
+ build_sig_subpkt (sig, SIGSUBPKT_KEY_FLAGS, buf, 1);
+ }
+
+Index: gnupg-1.4.7/include/cipher.h
+===================================================================
+--- gnupg-1.4.7.orig/include/cipher.h 2006-04-21 20:39:49.000000000 +0800
++++ gnupg-1.4.7/include/cipher.h 2013-11-28 14:49:24.159322744 +0800
+@@ -52,6 +52,7 @@
+ #define PUBKEY_USAGE_CERT 4 /* key is also good to certify other keys*/
+ #define PUBKEY_USAGE_AUTH 8 /* key is good for authentication */
+ #define PUBKEY_USAGE_UNKNOWN 128 /* key has an unknown usage bit */
++#define PUBKEY_USAGE_NONE 256 /* No usage given. */
+
+ #define DIGEST_ALGO_MD5 1
+ #define DIGEST_ALGO_SHA1 2
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4576.patch b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4576.patch
new file mode 100644
index 000000000..5dcde1f9c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4576.patch
@@ -0,0 +1,154 @@
+Upstream-Status: Backport
+CVE: CVE-2013-4576
+
+Index: gnupg-1.4.7/cipher/dsa.c
+===================================================================
+--- gnupg-1.4.7.orig/cipher/dsa.c 2006-12-12 02:27:21.000000000 +0800
++++ gnupg-1.4.7/cipher/dsa.c 2014-01-23 11:30:17.300915919 +0800
+@@ -287,6 +287,8 @@
+ MPI kinv;
+ MPI tmp;
+
++ mpi_normalize (hash);
++
+ /* select a random k with 0 < k < q */
+ k = gen_k( skey->q );
+
+Index: gnupg-1.4.7/cipher/elgamal.c
+===================================================================
+--- gnupg-1.4.7.orig/cipher/elgamal.c 2006-12-12 03:08:05.000000000 +0800
++++ gnupg-1.4.7/cipher/elgamal.c 2014-01-23 11:30:17.300915919 +0800
+@@ -376,6 +376,9 @@
+ {
+ MPI t1 = mpi_alloc_secure( mpi_get_nlimbs( skey->p ) );
+
++ mpi_normalize (a);
++ mpi_normalize (b);
++
+ /* output = b/(a^x) mod p */
+ mpi_powm( t1, a, skey->x, skey->p );
+ mpi_invm( t1, t1, skey->p );
+Index: gnupg-1.4.7/cipher/random.c
+===================================================================
+--- gnupg-1.4.7.orig/cipher/random.c 2006-11-03 18:09:39.000000000 +0800
++++ gnupg-1.4.7/cipher/random.c 2014-01-23 11:31:53.993495462 +0800
+@@ -273,6 +273,18 @@
+ }
+
+
++/* Randomize the MPI */
++void
++randomize_mpi (MPI mpi, size_t nbits, int level)
++{
++ unsigned char *buffer;
++
++ buffer = get_random_bits (nbits, level, mpi_is_secure (mpi));
++ mpi_set_buffer (mpi, buffer, (nbits+7)/8, 0);
++ xfree (buffer);
++}
++
++
+ int
+ random_is_faked()
+ {
+Index: gnupg-1.4.7/cipher/random.h
+===================================================================
+--- gnupg-1.4.7.orig/cipher/random.h 2006-02-09 19:29:29.000000000 +0800
++++ gnupg-1.4.7/cipher/random.h 2014-01-23 11:30:17.300915919 +0800
+@@ -32,6 +32,7 @@
+ int random_is_faked(void);
+ void random_disable_locking (void);
+ void randomize_buffer( byte *buffer, size_t length, int level );
++void randomize_mpi (MPI mpi, size_t nbits, int level);
+ byte *get_random_bits( size_t nbits, int level, int secure );
+ void fast_random_poll( void );
+
+Index: gnupg-1.4.7/cipher/rsa.c
+===================================================================
+--- gnupg-1.4.7.orig/cipher/rsa.c 2006-12-12 03:09:00.000000000 +0800
++++ gnupg-1.4.7/cipher/rsa.c 2014-01-23 11:35:04.330639125 +0800
+@@ -301,9 +301,26 @@
+ #if 0
+ mpi_powm( output, input, skey->d, skey->n );
+ #else
+- MPI m1 = mpi_alloc_secure( mpi_get_nlimbs(skey->n)+1 );
+- MPI m2 = mpi_alloc_secure( mpi_get_nlimbs(skey->n)+1 );
+- MPI h = mpi_alloc_secure( mpi_get_nlimbs(skey->n)+1 );
++ int nlimbs = mpi_get_nlimbs (skey->n)+1;
++ MPI m1 = mpi_alloc_secure (nlimbs);
++ MPI m2 = mpi_alloc_secure (nlimbs);
++ MPI h = mpi_alloc_secure (nlimbs);
++# if 1
++ MPI bdata= mpi_alloc_secure (nlimbs);
++ MPI r = mpi_alloc_secure (nlimbs);
++# endif
++
++ /* Remove superfluous leading zeroes from INPUT. */
++ mpi_normalize (input);
++
++# if 1
++ /* Blind: bdata = (data * r^e) mod n */
++ randomize_mpi (r, mpi_get_nbits (skey->n), 0);
++ mpi_fdiv_r (r, r, skey->n);
++ mpi_powm (bdata, r, skey->e, skey->n);
++ mpi_mulm (bdata, bdata, input, skey->n);
++ input = bdata;
++# endif
+
+ /* m1 = c ^ (d mod (p-1)) mod p */
+ mpi_sub_ui( h, skey->p, 1 );
+@@ -321,8 +338,15 @@
+ /* m = m2 + h * p */
+ mpi_mul ( h, h, skey->p );
+ mpi_add ( output, m1, h );
+- /* ready */
+-
++
++# if 1
++ mpi_free (bdata);
++ /* Unblind: output = (output * r^(-1)) mod n */
++ mpi_invm (r, r, skey->n);
++ mpi_mulm (output, output, r, skey->n);
++ mpi_free (r);
++# endif
++
+ mpi_free ( h );
+ mpi_free ( m1 );
+ mpi_free ( m2 );
+@@ -397,6 +421,7 @@
+ rsa_decrypt( int algo, MPI *result, MPI *data, MPI *skey )
+ {
+ RSA_secret_key sk;
++ MPI input;
+
+ if( algo != 1 && algo != 2 )
+ return G10ERR_PUBKEY_ALGO;
+@@ -407,8 +432,14 @@
+ sk.p = skey[3];
+ sk.q = skey[4];
+ sk.u = skey[5];
+- *result = mpi_alloc_secure( mpi_get_nlimbs( sk.n ) );
+- secret( *result, data[0], &sk );
++
++ /* Mitigates side-channel attacks (CVE-2013-4576). */
++ input = mpi_alloc (0);
++ mpi_normalize (data[0]);
++ mpi_fdiv_r (input, data[0], sk.n);
++ *result = mpi_alloc_secure (mpi_get_nlimbs (sk.n));
++ secret (*result, input, &sk);
++ mpi_free (input);
+ return 0;
+ }
+
+Index: gnupg-1.4.7/g10/gpgv.c
+===================================================================
+--- gnupg-1.4.7.orig/g10/gpgv.c 2006-12-13 19:25:04.000000000 +0800
++++ gnupg-1.4.7/g10/gpgv.c 2014-01-23 11:30:17.300915919 +0800
+@@ -390,6 +390,7 @@
+ void random_dump_stats(void) {}
+ int quick_random_gen( int onoff ) { return -1;}
+ void randomize_buffer( byte *buffer, size_t length, int level ) {}
++void randomize_mpi (MPI mpi, size_t nbits, int level) {}
+ int random_is_faked() { return -1;}
+ byte *get_random_bits( size_t nbits, int level, int secure ) { return NULL;}
+ void set_random_seed_file( const char *name ) {}
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/GnuPG1-CVE-2012-6085.patch b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/GnuPG1-CVE-2012-6085.patch
new file mode 100644
index 000000000..362717636
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/GnuPG1-CVE-2012-6085.patch
@@ -0,0 +1,64 @@
+commit f0b33b6fb8e0586e9584a7a409dcc31263776a67
+Author: Werner Koch <wk@gnupg.org>
+Date: Thu Dec 20 09:43:41 2012 +0100
+
+ gpg: Import only packets which are allowed in a keyblock.
+
+ * g10/import.c (valid_keyblock_packet): New.
+ (read_block): Store only valid packets.
+ --
+
+ A corrupted key, which for example included a mangled public key
+ encrypted packet, used to corrupt the keyring. This change skips all
+ packets which are not allowed in a keyblock.
+
+ GnuPG-bug-id: 1455
+
+ (cherry-picked from commit f795a0d59e197455f8723c300eebf59e09853efa)
+
+Upstream-Status: Backport
+CVE: CVE-2012-6085
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+diff --git a/g10/import.c b/g10/import.c
+index bfe02eb..a57b32e 100644
+--- a/g10/import.c
++++ b/g10/import.c
+@@ -384,6 +384,27 @@ import_print_stats (void *hd)
+ }
+
+
++/* Return true if PKTTYPE is valid in a keyblock. */
++static int
++valid_keyblock_packet (int pkttype)
++{
++ switch (pkttype)
++ {
++ case PKT_PUBLIC_KEY:
++ case PKT_PUBLIC_SUBKEY:
++ case PKT_SECRET_KEY:
++ case PKT_SECRET_SUBKEY:
++ case PKT_SIGNATURE:
++ case PKT_USER_ID:
++ case PKT_ATTRIBUTE:
++ case PKT_RING_TRUST:
++ return 1;
++ default:
++ return 0;
++ }
++}
++
++
+ /****************
+ * Read the next keyblock from stream A.
+ * PENDING_PKT should be initialzed to NULL
+@@ -461,7 +482,7 @@ read_block( IOBUF a, PACKET **pending_pkt, KBNODE *ret_root )
+ }
+ in_cert = 1;
+ default:
+- if( in_cert ) {
++ if (in_cert && valid_keyblock_packet (pkt->pkttype)) {
+ if( !root )
+ root = new_kbnode( pkt );
+ else
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/configure.patch b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/configure.patch
new file mode 100644
index 000000000..e005ac658
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/configure.patch
@@ -0,0 +1,17 @@
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: gnupg-1.4.7/configure.ac
+===================================================================
+--- gnupg-1.4.7.orig/configure.ac
++++ gnupg-1.4.7/configure.ac
+@@ -827,7 +827,6 @@ else
+ AC_SUBST(USE_NLS)
+ AC_SUBST(USE_INCLUDED_LIBINTL)
+ AC_SUBST(BUILD_INCLUDED_LIBINTL)
+- AM_PO_SUBDIRS
+ fi
+
+ if test "$try_extensions" = yes || test x"$card_support" = xyes ; then
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/curl_typeof_fix_backport.patch b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/curl_typeof_fix_backport.patch
new file mode 100644
index 000000000..e5fb24aa6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/curl_typeof_fix_backport.patch
@@ -0,0 +1,27 @@
+
+This has been discussed in a couple of different bug reported
+upstream:
+
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=486250
+http://bugs.sourcemage.org/show_bug.cgi?id=14446
+
+Fix:
+http://lists.gnupg.org/pipermail/gnupg-devel/2008-April/024344.html
+
+Upstream-Status: Backport [Debian]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: gnupg-1.4.7/keyserver/gpgkeys_curl.c
+===================================================================
+--- gnupg-1.4.7.orig/keyserver/gpgkeys_curl.c
++++ gnupg-1.4.7/keyserver/gpgkeys_curl.c
+@@ -286,7 +286,7 @@ main(int argc,char *argv[])
+ curl_easy_setopt(curl,CURLOPT_VERBOSE,1);
+ }
+
+- curl_easy_setopt(curl,CURLOPT_SSL_VERIFYPEER,opt->flags.check_cert);
++ curl_easy_setopt(curl,CURLOPT_SSL_VERIFYPEER,(long)opt->flags.check_cert);
+ curl_easy_setopt(curl,CURLOPT_CAINFO,opt->ca_cert_file);
+
+ if(proxy)
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/long-long-thumb.patch b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/long-long-thumb.patch
new file mode 100644
index 000000000..2855cab24
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/long-long-thumb.patch
@@ -0,0 +1,19 @@
+Orignal Patch came from OpenWrt via OE-Classic
+https://dev.openwrt.org/browser/packages/utils/gnupg/patches/001-mips_gcc4.4
+which is no longer a valid revision!
+
+Upstream-Status: Inappropriate [configuration]
+
+
+--- gnupg/mpi/longlong.h~ 2006-02-14 10:09:55.000000000 +0000
++++ gnupg/mpi/longlong.h 2008-10-27 13:11:09.000000000 +0000
+@@ -181,7 +181,7 @@
+ /***************************************
+ ************** ARM ******************
+ ***************************************/
+-#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 %1, %4, %5\n" \
+ "adc %0, %2, %3" \
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/mips_gcc4.4.patch b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/mips_gcc4.4.patch
new file mode 100644
index 000000000..9a03b2b70
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg-1.4.7/mips_gcc4.4.patch
@@ -0,0 +1,50 @@
+
+From Openembedded-Classic
+
+ gnupg-1.4.10: Readd the ARM Thumb patch as debian has no thumb support
+
+
+Upstream-Status: Inappropriate [embedded-specific]
+
+Index: gnupg-1.4.10/mpi/longlong.h
+===================================================================
+--- gnupg-1.4.10.orig/mpi/longlong.h 2008-12-11 17:39:43.000000000 +0100
++++ gnupg-1.4.10/mpi/longlong.h 2010-03-27 14:27:53.000000000 +0100
+@@ -706,18 +706,35 @@
+ #endif /* __m88110__ */
+ #endif /* __m88000__ */
+
++/* Test for gcc >= maj.min, as per __GNUC_PREREQ in glibc */
++#if defined (__GNUC__) && defined (__GNUC_MINOR__)
++#define __GNUC_PREREQ(maj, min) \
++ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
++#else
++#define __GNUC_PREREQ(maj, min) 0
++#endif
++
+ /***************************************
+ ************** MIPS *****************
+ ***************************************/
+ #if defined (__mips__) && W_TYPE_SIZE == 32
+-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
++#if __GNUC_PREREQ (4,4)
++#define umul_ppmm(w1, w0, u, v) \
++ do { \
++ UDItype __ll = (UDItype)(u) * (v); \
++ w1 = __ll >> 32; \
++ w0 = __ll; \
++ } while (0)
++#endif
++#if !defined (umul_ppmm) && __GNUC_PREREQ (2,7)
+ #define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("multu %2,%3" \
+ : "=l" ((USItype)(w0)), \
+ "=h" ((USItype)(w1)) \
+ : "d" ((USItype)(u)), \
+ "d" ((USItype)(v)))
+-#else
++#endif
++#if !defined (umul_ppmm)
+ #define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("multu %2,%3 \n" \
+ "mflo %0 \n" \
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg/autogen.sh-fix-find-version-for-beta-checking.patch b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg/autogen.sh-fix-find-version-for-beta-checking.patch
new file mode 100644
index 000000000..4241bc3a2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg/autogen.sh-fix-find-version-for-beta-checking.patch
@@ -0,0 +1,31 @@
+From 717f994be2466d378e6611a4739c606db6d0dc46 Mon Sep 17 00:00:00 2001
+From: Wenzong Fan <wenzong.fan@windriver.com>
+Date: Sun, 25 Oct 2015 22:44:47 -0400
+Subject: [PATCH] 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>
+---
+ autogen.sh | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/autogen.sh b/autogen.sh
+index 7effd56..d673432 100755
+--- a/autogen.sh
++++ b/autogen.sh
+@@ -228,7 +228,6 @@ if [ "$myhost" = "find-version" ]; then
+ rvd=$((0x$(echo ${rev} | head -c 4)))
+ else
+ ingit=no
+- beta=yes
+ tmp="-unknown"
+ rev="0000000"
+ rvd="0"
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg/dirmngr-uses-libgpg-error.patch b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg/dirmngr-uses-libgpg-error.patch
new file mode 100644
index 000000000..7af1955d5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg/dirmngr-uses-libgpg-error.patch
@@ -0,0 +1,16 @@
+Upstream-Status: Pending
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+Index: gnupg-2.1.0/dirmngr/Makefile.am
+===================================================================
+--- gnupg-2.1.0.orig/dirmngr/Makefile.am
++++ gnupg-2.1.0/dirmngr/Makefile.am
+@@ -78,7 +78,8 @@ endif
+ dirmngr_LDADD = $(libcommontlsnpth) $(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
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg/pkgconfig.patch b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg/pkgconfig.patch
new file mode 100644
index 000000000..f958603ca
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg/pkgconfig.patch
@@ -0,0 +1,90 @@
+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
+
+Index: gnupg-2.1.0/m4/gnupg-pth.m4
+===================================================================
+--- gnupg-2.1.0.orig/m4/gnupg-pth.m4
++++ gnupg-2.1.0/m4/gnupg-pth.m4
+@@ -17,33 +17,9 @@ dnl implied warranty of MERCHANTABILITY
+ # 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)
+ ])
+-
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg/use-pkgconfig-instead-of-npth-config.patch b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg/use-pkgconfig-instead-of-npth-config.patch
new file mode 100644
index 000000000..c6dbf1b75
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg/use-pkgconfig-instead-of-npth-config.patch
@@ -0,0 +1,72 @@
+Upstream-Status: Inappropriate [openembedded specific]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+
+Index: gnupg-2.1.0/m4/npth.m4
+===================================================================
+--- gnupg-2.1.0.orig/m4/npth.m4
++++ gnupg-2.1.0/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])
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg_1.4.7.bb b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg_1.4.7.bb
new file mode 100644
index 000000000..b4ccbfed6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg_1.4.7.bb
@@ -0,0 +1,104 @@
+SUMMARY = "GNU Privacy Guard - encryption and signing tools"
+HOMEPAGE = "http://www.gnupg.org/"
+DEPENDS = "zlib bzip2 readline"
+SECTION = "console/utils"
+
+LICENSE = "GPLv2"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
+
+PR = "r9"
+
+SRC_URI = "ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-${PV}.tar.bz2 \
+ file://long-long-thumb.patch \
+ file://configure.patch \
+ file://mips_gcc4.4.patch \
+ file://GnuPG1-CVE-2012-6085.patch \
+ file://curl_typeof_fix_backport.patch \
+ file://CVE-2013-4351.patch \
+ file://CVE-2013-4576.patch \
+ file://CVE-2013-4242.patch \
+ "
+
+SRC_URI[md5sum] = "b06a141cca5cd1a55bbdd25ab833303c"
+SRC_URI[sha256sum] = "69d18b7d193f62ca27ed4febcb4c9044aa0c95305d3258fe902e2fae5fc6468d"
+
+inherit autotools gettext texinfo
+
+# --with-egd-socket=NAME use NAME for the EGD socket
+# --with-photo-viewer=FIXED_VIEWER set a fixed photo ID viewer
+# --with-included-zlib use the zlib code included here
+# --with-capabilities use linux capabilities default=no
+# --with-mailprog=NAME use "NAME -t" for mail transport
+# --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib
+# --without-libiconv-prefix don't search for libiconv in includedir and libdir
+# --with-included-gettext use the GNU gettext library included here
+# --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib
+# --without-libintl-prefix don't search for libintl in includedir and libdir
+# --without-readline do not support fancy command line editing
+# --with-included-regex use the included GNU regex library
+# --with-zlib=DIR use libz in DIR
+# --with-bzip2=DIR look for bzip2 in DIR
+# --enable-static-rnd=egd|unix|linux|auto
+# --disable-dev-random disable the use of dev random
+# --disable-asm do not use assembler modules
+# --enable-m-guard enable memory guard facility
+# --enable-selinux-support
+# enable SELinux support
+# --disable-card-support disable OpenPGP card support
+# --disable-gnupg-iconv disable the new iconv code
+# --enable-backsigs enable the experimental backsigs code
+# --enable-minimal build the smallest gpg binary possible
+# --disable-rsa disable the RSA public key algorithm
+# --disable-idea disable the IDEA cipher
+# --disable-cast5 disable the CAST5 cipher
+# --disable-blowfish disable the BLOWFISH cipher
+# --disable-aes disable the AES, AES192, and AES256 ciphers
+# --disable-twofish disable the TWOFISH cipher
+# --disable-sha256 disable the SHA-256 digest
+# --disable-sha512 disable the SHA-384 and SHA-512 digests
+# --disable-bzip2 disable the BZIP2 compression algorithm
+# --disable-exec disable all external program execution
+# --disable-photo-viewers disable photo ID viewers
+# --disable-keyserver-helpers disable all external keyserver support
+# --disable-ldap disable LDAP keyserver interface
+# --disable-hkp disable HKP keyserver interface
+# --disable-http disable HTTP key fetching interface
+# --disable-finger disable Finger key fetching interface
+# --disable-mailto disable email keyserver interface
+# --disable-keyserver-path disable the exec-path option for keyserver helpers
+# --enable-key-cache=SIZE Set key cache to SIZE (default 4096)
+# --disable-largefile omit support for large files
+# --disable-dns-srv disable the use of DNS SRV in HKP and HTTP
+# --disable-nls do not use Native Language Support
+# --disable-regex do not handle regular expressions in trust sigs
+
+EXTRA_OECONF = "--disable-ldap \
+ --with-zlib=${STAGING_LIBDIR}/.. \
+ --with-bzip2=${STAGING_LIBDIR}/.. \
+ --disable-selinux-support \
+ --with-readline=${STAGING_LIBDIR}/.. \
+ ac_cv_sys_symbol_underscore=no \
+ "
+
+# Force gcc's traditional handling of inline to avoid issues with gcc 5
+CFLAGS += "-fgnu89-inline"
+
+do_install () {
+ autotools_do_install
+ install -d ${D}${docdir}/${BPN}
+ mv ${D}${datadir}/${BPN}/* ${D}/${docdir}/${BPN}/ || :
+ mv ${D}${prefix}/doc/* ${D}/${docdir}/${BPN}/ || :
+}
+
+# split out gpgv from main package
+RDEPENDS_${PN} = "gpgv"
+PACKAGES =+ "gpgv"
+FILES_gpgv = "${bindir}/gpgv"
+
+# Exclude debug files from the main packages
+FILES_${PN} = "${bindir}/* ${datadir}/${BPN} ${libexecdir}/${BPN}/*"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[curl] = "--with-libcurl=${STAGING_LIBDIR},--without-libcurl,curl"
+PACKAGECONFIG[libusb] = "--with-libusb=${STAGING_LIBDIR},--without-libusb,libusb-compat"
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg_2.1.11.bb b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg_2.1.11.bb
new file mode 100644
index 000000000..8e2189bca
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gnupg/gnupg_2.1.11.bb
@@ -0,0 +1,45 @@
+SUMMARY = "GNU Privacy Guard - encryption and signing tools (2.x)"
+HOMEPAGE = "http://www.gnupg.org/"
+LICENSE = "GPLv3 & LGPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949 \
+ file://COPYING.LIB;md5=6a6a8e020838b23406c81b19c1d46df6"
+
+DEPENDS = "npth libassuan libksba zlib bzip2 readline libgcrypt"
+
+inherit autotools gettext texinfo pkgconfig
+
+SRC_URI = "ftp://ftp.gnupg.org/gcrypt/${BPN}/${BPN}-${PV}.tar.bz2 \
+ file://pkgconfig.patch \
+ file://use-pkgconfig-instead-of-npth-config.patch \
+ file://dirmngr-uses-libgpg-error.patch \
+ file://autogen.sh-fix-find-version-for-beta-checking.patch \
+ "
+
+SRC_URI[md5sum] = "873302c475c4c90badb67daac90ebd5d"
+SRC_URI[sha256sum] = "b7b0fb2c8c5d47d7ec916d4a1097c0ddcb94a12bb1c0ac424ad86b1ee316b61a"
+
+EXTRA_OECONF = "--disable-ldap \
+ --disable-ccid-driver \
+ --with-zlib=${STAGING_LIBDIR}/.. \
+ --with-bzip2=${STAGING_LIBDIR}/.. \
+ --with-readline=${STAGING_LIBDIR}/.. \
+ "
+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
+}
+
+RDEPENDS_${PN} = "gnutls"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[sqlite3] = "--enable-sqlite, --disable-sqlite, sqlite3"
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls.inc b/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls.inc
new file mode 100644
index 000000000..e7c91eb80
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls.inc
@@ -0,0 +1,57 @@
+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://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://COPYING.LESSER;md5=a6f89e2100d9b6cdffcea4f398e37343"
+
+DEPENDS = "nettle gmp virtual/libiconv"
+DEPENDS_append_libc-musl = " argp-standalone"
+
+SHRT_VER = "${@d.getVar('PV', True).split('.')[0]}.${@d.getVar('PV', True).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
+
+PACKAGECONFIG ??= "libidn zlib"
+
+PACKAGECONFIG[docs] = "--enable-doc,--disable-doc"
+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"
+PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib"
+
+EXTRA_OECONF = " \
+ --disable-crywrap \
+ --disable-libdane \
+ --disable-guile \
+ --disable-rpath \
+ --enable-local-libopts \
+ --enable-openssl-compatibility \
+ --with-libpthread-prefix=${STAGING_DIR_HOST}${prefix} \
+"
+
+LDFLAGS_append_libc-musl = " -largp"
+LDFLAGS_append_libc-uclibc = " -luargp -pthread"
+
+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.*"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls/0001-configure.ac-fix-sed-command.patch b/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls/0001-configure.ac-fix-sed-command.patch
new file mode 100644
index 000000000..c5b95eb5b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls/0001-configure.ac-fix-sed-command.patch
@@ -0,0 +1,32 @@
+From 67c638c7e209554d9b19627e9402a20fdabead21 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 4 Dec 2015 13:19:28 +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(-)
+
+diff --git a/configure.ac b/configure.ac
+index e634236..dc9e6a8 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -549,7 +549,7 @@ if test "$enable_tools" != "no" || test "$enable_doc" != "no"; then
+ dnl replace libopts-generated files with distributed backups, if present
+ missing_baks=
+ for i in ${srcdir}/src/*-args.c.bak ${srcdir}/src/*-args.h.bak; do
+- nam=`echo $i|sed 's/.bak//g'`
++ nam=`echo $i|sed 's/\.bak$//'`
+ if test -f $i;then
+ cp -f $i $nam
+ else
+--
+2.6.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls/correct_rpl_gettimeofday_signature.patch b/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls/correct_rpl_gettimeofday_signature.patch
new file mode 100644
index 000000000..5e452c52e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls/correct_rpl_gettimeofday_signature.patch
@@ -0,0 +1,67 @@
+From ae3370788ed3447bba16969d9eb1bf1b9631e1b7 Mon Sep 17 00:00:00 2001
+From: Valentin Popa <valentin.popa@intel.com>
+Date: Fri, 25 Apr 2014 13:58:55 +0300
+Subject: [PATCH] Correct rpl_gettimeofday signature
+
+Currently we fail on uclibc like below
+
+| In file included from /home/kraj/work/angstrom/sources/openembedded-core/build/tmp-uclibc/sysroots/qemuarm/usr/include/sys/procfs.h:32:0,
+| from /home/kraj/work/angstrom/sources/openembedded-core/build/tmp-uclibc/sysroots/qemuarm/usr/include/sys/ucontext.h:26,
+| from /home/kraj/work/angstrom/sources/openembedded-core/build/tmp-uclibc/sysroots/qemuarm/usr/include/signal.h:392,
+| from ../../gl/signal.h:52,
+| from ../../gl/sys/select.h:58,
+| from /home/kraj/work/angstrom/sources/openembedded-core/build/tmp-uclibc/sysroots/qemuarm/usr/include/sys/types.h:220,
+| from ../../gl/sys/types.h:28,
+| from ../../lib/includes/gnutls/gnutls.h:46,
+| from ex-cxx.cpp:3:
+| ../../gl/sys/time.h:396:66: error: conflicting declaration 'void* restrict'
+| ../../gl/sys/time.h:396:50: error: 'restrict' has a previous declaration as 'timeval* restrict'
+| make[4]: *** [ex-cxx.o] Error 1
+| make[4]: *** Waiting for unfinished jobs....
+
+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
+
+This only happens of uclibc since this code is not excercised with
+eglibc otherwise we will have same issue there too
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gl/sys_time.in.h | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/gl/sys_time.in.h b/gl/sys_time.in.h
+index 84a17c9..6ceadc3 100644
+--- a/gl/sys_time.in.h
++++ b/gl/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);
+ #elif defined GNULIB_POSIXCHECK
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls/use-pkg-config-to-locate-zlib.patch b/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls/use-pkg-config-to-locate-zlib.patch
new file mode 100644
index 000000000..0e1b7c8f7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls/use-pkg-config-to-locate-zlib.patch
@@ -0,0 +1,67 @@
+From cee80af1fe93f5b76765afeebfcc3b902768f5d6 Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Tue, 26 May 2015 21:41:24 -0700
+Subject: [PATCH] use pkg-config to locate zlib
+
+AC_LIB_HAVE_LINKFLAGS can sometimes find host libs and is therefore not
+robust when cross-compiling. Remove it for zlib and use PKG_CHECK_MODULES
+instead.
+
+Removing AC_LIB_HAVE_LINKFLAGS for zlib also removes the --with-libz-prefix
+configure option. If zlib support is enabled, then failure to find zlib via
+pkg-config is now treated as a fatal error.
+
+Change based on ChromeOS gnutls 2.12.23 cross-compile fixes patch:
+
+ https://chromium-review.googlesource.com/#/c/271661/
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ configure.ac | 24 ++++++++++--------------
+ 1 file changed, 10 insertions(+), 14 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 1b561d5..0c787dc 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -508,25 +508,21 @@ AC_ARG_WITH(zlib, AS_HELP_STRING([--without-zlib],
+ AC_MSG_CHECKING([whether to include zlib compression support])
+ if test x$ac_zlib != xno; then
+ AC_MSG_RESULT(yes)
+- AC_LIB_HAVE_LINKFLAGS(z,, [#include <zlib.h>], [compress (0, 0, 0, 0);])
+- if test x$ac_cv_libz != xyes; then
+- AC_MSG_WARN(
+-***
+-*** ZLIB was not found. You will not be able to use ZLIB compression.)
+- fi
+ else
+ AC_MSG_RESULT(no)
+ fi
+
+-PKG_CHECK_EXISTS(zlib, ZLIB_HAS_PKGCONFIG=y, ZLIB_HAS_PKGCONFIG=n)
+-
+ if test x$ac_zlib != xno; then
+- if test "$ZLIB_HAS_PKGCONFIG" = "y" ; then
+- if test "x$GNUTLS_REQUIRES_PRIVATE" = x; then
+- GNUTLS_REQUIRES_PRIVATE="Requires.private: zlib"
+- else
+- GNUTLS_REQUIRES_PRIVATE="$GNUTLS_REQUIRES_PRIVATE, zlib"
+- fi
++ PKG_CHECK_MODULES(ZLIB, zlib)
++ HAVE_LIBZ=yes
++ AC_DEFINE([HAVE_LIBZ], [1], [zlib is enabled])
++ AC_SUBST(HAVE_LIBZ)
++ LTLIBZ=$ZLIB_LIBS
++ AC_SUBST(LTLIBZ)
++ if test "x$GNUTLS_REQUIRES_PRIVATE" = x; then
++ GNUTLS_REQUIRES_PRIVATE="Requires.private: zlib"
++ else
++ GNUTLS_REQUIRES_PRIVATE="$GNUTLS_REQUIRES_PRIVATE, zlib"
+ fi
+ fi
+ AC_SUBST(GNUTLS_REQUIRES_PRIVATE)
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls_3.4.9.bb b/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls_3.4.9.bb
new file mode 100644
index 000000000..b652f6fac
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gnutls/gnutls_3.4.9.bb
@@ -0,0 +1,8 @@
+require gnutls.inc
+
+SRC_URI += "file://correct_rpl_gettimeofday_signature.patch \
+ file://0001-configure.ac-fix-sed-command.patch \
+ file://use-pkg-config-to-locate-zlib.patch \
+ "
+SRC_URI[md5sum] = "1b3b6d55d0e2b6d01a54f53129f1da9b"
+SRC_URI[sha256sum] = "48594fadba33d450f796ec69526cf2bce6ff9bc3dc90fbd7bf38dc3601f57c3f"
diff --git a/import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1/dont-depend-on-help2man.patch b/import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1/dont-depend-on-help2man.patch
new file mode 100644
index 000000000..2ac89f3b3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1_4.7.bb b/import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1_4.7.bb
new file mode 100644
index 000000000..7f0856945
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gnutls/libtasn1_4.7.bb
@@ -0,0 +1,20 @@
+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 \
+ "
+
+SRC_URI[md5sum] = "12d10ca4ae0a3b95f7aa06a076da39ec"
+SRC_URI[sha256sum] = "a40780dc93fc6d819170240e8ece25352058a85fd1d2347ce0f143667d8f11c9"
+
+inherit autotools texinfo binconfig lib_package
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme/gpgme.pc b/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme/gpgme.pc
new file mode 100644
index 000000000..30a4d56d6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme/gpgme.pc
@@ -0,0 +1,10 @@
+prefix=/usr
+libdir=${prefix}/lib
+includedir=${prefix}/include
+
+Name: gpgme
+Description: GNU Privacy Guard Made Easy
+Version: 1.4.3
+Requires:
+Libs: -L${libdir} -lgpgme -lassuan -lgpg-error
+Cflags: -I${includedir}
diff --git a/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme/pkgconfig.patch b/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme/pkgconfig.patch
new file mode 100644
index 000000000..e2f1f4ffb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme/pkgconfig.patch
@@ -0,0 +1,279 @@
+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
+
+diff --git a/configure.ac b/configure.ac
+index 298a22b..c778b61 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -622,6 +622,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/Makefile lang/cl/Makefile lang/cl/gpgme.asd])
+ AC_OUTPUT
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 58922f9..40d0dca 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -20,11 +20,13 @@
+
+ # Note: moc_kdpipeiodevice should actually be a dependecy below.
+ EXTRA_DIST = gpgme-config.in gpgme.m4 libgpgme.vers ChangeLog-2011 \
+- gpgme.h.in versioninfo.rc.in gpgme.def moc_kdpipeiodevice.cpp
++ gpgme.h.in versioninfo.rc.in gpgme.def moc_kdpipeiodevice.cpp gpgme.pc.in gpgme-pthread.pc.in
+
+ bin_SCRIPTS = gpgme-config
+ m4datadir = $(datadir)/aclocal
+ m4data_DATA = gpgme.m4
++pkgconfigdir = $(libdir)/pkgconfig
++pkgconfig_DATA = gpgme.pc gpgme-pthread.pc
+ nodist_include_HEADERS = gpgme.h
+
+ bin_PROGRAMS = gpgme-tool
+diff --git a/src/gpgme-pthread.pc.in b/src/gpgme-pthread.pc.in
+new file mode 100644
+index 0000000..980a48e
+--- /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 (threaded version)
++Version: @VERSION@
++Libs: -L${libdir} -lgpgme-pthread -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
diff --git a/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme_1.6.0.bb b/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme_1.6.0.bb
new file mode 100644
index 000000000..86eda239b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gpgme/gpgme_1.6.0.bb
@@ -0,0 +1,40 @@
+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=5027eec93a996272a9a0a6a86cf35775 \
+ file://src/engine.h;endline=22;md5=4b6d8ba313d9b564cc4d4cfb1640af9d"
+
+SRC_URI = "ftp://ftp.gnupg.org/gcrypt/gpgme/${BP}.tar.bz2 \
+ file://gpgme.pc \
+ file://pkgconfig.patch \
+ "
+
+SRC_URI[md5sum] = "60d730d22e8065fd5de309e8b98e304b"
+SRC_URI[sha256sum] = "b09de4197ac280b102080e09eaec6211d081efff1963bf7821cf8f4f9916099d"
+
+DEPENDS = "libgpg-error libassuan"
+
+BINCONFIG = "${bindir}/gpgme-config"
+
+inherit autotools texinfo binconfig-disabled pkgconfig
+
+PACKAGES =+ "${PN}-pthread"
+FILES_${PN}-pthread = "${libdir}/libgpgme-pthread.so.*"
+FILES_${PN}-dev += "${datadir}/common-lisp/source/gpgme/*"
+
+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
+}
+
+do_install_append () {
+ install -d ${D}${libdir}/pkgconfig
+ install -m 0644 ${WORKDIR}/gpgme.pc ${D}${libdir}/pkgconfig/
+}
diff --git a/import-layers/yocto-poky/meta/recipes-support/icu/icu.inc b/import-layers/yocto-poky/meta/recipes-support/icu/icu.inc
new file mode 100644
index 000000000..cc6f222a5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/icu/icu.inc
@@ -0,0 +1,51 @@
+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 = ""
+
+S = "${WORKDIR}/icu/source"
+SPDX_S = "${WORKDIR}/icu"
+STAGING_ICU_DIR_NATIVE = "${STAGING_DATADIR_NATIVE}/${BPN}/${PV}"
+
+CPPFLAGS_append_libc-uclibc = " -DU_TIMEZONE=0"
+
+BINCONFIG = "${bindir}/icu-config"
+
+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}"
+
+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}
+}
+
+PACKAGES =+ "libicudata libicuuc libicui18n libicule libiculx libicutu libicuio"
+
+FILES_${PN}-dev += "${libdir}/${BPN}/"
+
+FILES_libicudata = "${libdir}/libicudata.so.*"
+FILES_libicuuc = "${libdir}/libicuuc.so.*"
+FILES_libicui18n = "${libdir}/libicui18n.so.*"
+FILES_libicule = "${libdir}/libicule.so.*"
+FILES_libiculx = "${libdir}/libiculx.so.*"
+FILES_libicutu = "${libdir}/libicutu.so.*"
+FILES_libicuio = "${libdir}/libicuio.so.*"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/icu/icu/0001-Disable-LDFLAGSICUDT-for-Linux.patch b/import-layers/yocto-poky/meta/recipes-support/icu/icu/0001-Disable-LDFLAGSICUDT-for-Linux.patch
new file mode 100644
index 000000000..2968d571b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/icu/icu/fix-install-manx.patch b/import-layers/yocto-poky/meta/recipes-support/icu/icu/fix-install-manx.patch
new file mode 100644
index 000000000..ec63f50c4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/icu/icu/fix-install-manx.patch
@@ -0,0 +1,48 @@
+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>
+
+
+diff --git a/Makefile.in b/Makefile.in
+index 9db6c52..3441afa 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -71,7 +71,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 \
+@@ -82,10 +82,10 @@ 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
+-dist: dist-recursive dist-local
++distclean : distclean-recursive
++dist: dist-recursive
+ check: all check-recursive
+ check-recursive: all
+ xcheck: all xcheck-recursive
+@@ -352,7 +352,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) \
diff --git a/import-layers/yocto-poky/meta/recipes-support/icu/icu/icu-pkgdata-large-cmd.patch b/import-layers/yocto-poky/meta/recipes-support/icu/icu/icu-pkgdata-large-cmd.patch
new file mode 100644
index 000000000..6e4065922
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/icu/icu/icu-pkgdata-large-cmd.patch
@@ -0,0 +1,29 @@
+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>
+---
+ tools/pkgdata/pkgdata.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/pkgdata/pkgdata.cpp b/tools/pkgdata/pkgdata.cpp
+--- a/tools/pkgdata/pkgdata.cpp
++++ b/tools/pkgdata/pkgdata.cpp
+@@ -1019,7 +1019,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,
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/icu/icu/icu-release-56-1-flagparser-fix.patch b/import-layers/yocto-poky/meta/recipes-support/icu/icu/icu-release-56-1-flagparser-fix.patch
new file mode 100644
index 000000000..1519d8469
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/icu/icu/icu-release-56-1-flagparser-fix.patch
@@ -0,0 +1,24 @@
+icu: Ticket #11959: pkgdata dies when compiled with lots'o'flags
+
+See: http://bugs.icu-project.org/trac/ticket/11959
+
+The patch avoids premature failure which results in a segfault.
+
+Upstream-Status: Backport of r38081
+Signed-off-by: Mike Crowe <mac@mcrowe.com>
+
+Index: source/tools/toolutil/flagparser.c
+===================================================================
+--- source/tools/toolutil/flagparser.c (revision 38046)
++++ source/tools/toolutil/flagparser.c (working copy)
+@@ -96,8 +96,8 @@
+ uprv_free(buffer);
+
+ T_FileStream_close(f);
+-
+- if (U_FAILURE(*status)) {
++
++ if (U_FAILURE(*status) && *status != U_BUFFER_OVERFLOW_ERROR) {
+ return -1;
+ }
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/icu/icu_56.1.bb b/import-layers/yocto-poky/meta/recipes-support/icu/icu_56.1.bb
new file mode 100644
index 000000000..db0de106b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/icu/icu_56.1.bb
@@ -0,0 +1,29 @@
+require icu.inc
+
+LIC_FILES_CHKSUM = "file://../license.html;md5=64eff4aadff4d104d6d437c4fde0e6d7"
+
+def icu_download_version(d):
+ pvsplit = d.getVar('PV', True).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://icu-release-56-1-flagparser-fix.patch \
+ "
+
+SRC_URI_append_class-target = "\
+ file://0001-Disable-LDFLAGSICUDT-for-Linux.patch \
+ "
+SRC_URI[md5sum] = "c4a2d71ff56aec5ebfab2a3f059be99d"
+SRC_URI[sha256sum] = "3a64e9105c734dcf631c0b3ed60404531bce6c0f5a64bfe1a6402a4cc2314816"
+
+UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)/"
+UPSTREAM_CHECK_URI = "http://download.icu-project.org/files/icu4c/"
diff --git a/import-layers/yocto-poky/meta/recipes-support/iso-codes/iso-codes_3.65.bb b/import-layers/yocto-poky/meta/recipes-support/iso-codes/iso-codes_3.65.bb
new file mode 100644
index 000000000..0b78dc45e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/iso-codes/iso-codes_3.65.bb
@@ -0,0 +1,15 @@
+SUMMARY = "ISO language, territory, currency, script codes and their translations"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=fbc093901857fcd118f065f900982c24"
+
+SRC_URI = "https://pkg-isocodes.alioth.debian.org/downloads/iso-codes-${PV}.tar.xz"
+SRC_URI[md5sum] = "890a08d4f962748e0a0758a8aa471896"
+SRC_URI[sha256sum] = "834de5193c8489eedeaf6509457a9b13476702386ae1f3ed4f391a349d630320"
+
+# 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/import-layers/yocto-poky/meta/recipes-support/libassuan/libassuan/libassuan-add-pkgconfig-support.patch b/import-layers/yocto-poky/meta/recipes-support/libassuan/libassuan/libassuan-add-pkgconfig-support.patch
new file mode 100644
index 000000000..b6ccdda6a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libassuan/libassuan/libassuan-add-pkgconfig-support.patch
@@ -0,0 +1,158 @@
+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>
+
+Index: libassuan-2.1.2/Makefile.am
+===================================================================
+--- libassuan-2.1.2.orig/Makefile.am
++++ libassuan-2.1.2/Makefile.am
+@@ -24,10 +24,13 @@ AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gz
+ # (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 \
+ 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
+
+ SUBDIRS = m4 src doc tests
+
+Index: libassuan-2.1.2/libassuan.pc.in
+===================================================================
+--- /dev/null
++++ libassuan-2.1.2/libassuan.pc.in
+@@ -0,0 +1,14 @@
++prefix=@prefix@
++exec_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.1.2/configure.ac
+===================================================================
+--- libassuan-2.1.2.orig/configure.ac
++++ libassuan-2.1.2/configure.ac
+@@ -439,7 +439,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
+
+ echo "
+Index: libassuan-2.1.2/src/libassuan.m4
+===================================================================
+--- libassuan-2.1.2.orig/src/libassuan.m4
++++ libassuan-2.1.2/src/libassuan.m4
+@@ -15,18 +15,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
+@@ -37,51 +25,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
+@@ -96,7 +45,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([[
+@@ -137,12 +86,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/import-layers/yocto-poky/meta/recipes-support/libassuan/libassuan_2.4.2.bb b/import-layers/yocto-poky/meta/recipes-support/libassuan/libassuan_2.4.2.bb
new file mode 100644
index 000000000..f376d631e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libassuan/libassuan_2.4.2.bb
@@ -0,0 +1,30 @@
+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=0f465544183405055ec179869fc5b5ba \
+ file://src/assuan-defs.h;endline=20;md5=20cd55535260ca1779edae5c7b80b21e"
+
+DEPENDS = "libgpg-error"
+
+SRC_URI = "ftp://ftp.gnupg.org/gcrypt/libassuan/libassuan-${PV}.tar.bz2 \
+ file://libassuan-add-pkgconfig-support.patch"
+
+SRC_URI[md5sum] = "70151995c2330ae1261c0a7ca34cf478"
+SRC_URI[sha256sum] = "bb06dc81380b74bf1b64d5849be5c0409a336f3b4c45f20ac688e86d1b5bcb20"
+
+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"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libatomic-ops/libatomic-ops/0001-Add-initial-nios2-architecture-support.patch b/import-layers/yocto-poky/meta/recipes-support/libatomic-ops/libatomic-ops/0001-Add-initial-nios2-architecture-support.patch
new file mode 100644
index 000000000..c05107594
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libatomic-ops/libatomic-ops/0001-Add-initial-nios2-architecture-support.patch
@@ -0,0 +1,70 @@
+From 4b005ee56898309e8afba9b3c48cf94f0f5f78e4 Mon Sep 17 00:00:00 2001
+From: Marek Vasut <marex@denx.de>
+Date: Tue, 15 Mar 2016 10:09:26 +0300
+Subject: [PATCH] Add initial nios2 architecture support
+
+* src/Makefile.am (nobase_private_HEADERS): Add nios2.h.
+* src/atomic_ops.h: Include nios2.h if __nios2__.
+* src/atomic_ops/sysdeps/gcc/nios2.h: New file.
+
+Signed-off-by: Marek Vasut <marex@denx.de>
+Upstream-Status: Backport [ https://github.com/ivmai/libatomic_ops.git 4b005ee56898309e8afba9b3c48cf94f0f5f78e4 ]
+---
+ src/Makefile.am | 1 +
+ src/atomic_ops.h | 3 +++
+ src/atomic_ops/sysdeps/gcc/nios2.h | 17 +++++++++++++++++
+ 3 files changed, 21 insertions(+)
+ create mode 100644 src/atomic_ops/sysdeps/gcc/nios2.h
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index fc09b27..d463427 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -79,6 +79,7 @@ nobase_private_HEADERS = atomic_ops/ao_version.h \
+ atomic_ops/sysdeps/gcc/ia64.h \
+ atomic_ops/sysdeps/gcc/m68k.h \
+ atomic_ops/sysdeps/gcc/mips.h \
++ atomic_ops/sysdeps/gcc/nios2.h \
+ atomic_ops/sysdeps/gcc/powerpc.h \
+ atomic_ops/sysdeps/gcc/s390.h \
+ atomic_ops/sysdeps/gcc/sh.h \
+diff --git a/src/atomic_ops.h b/src/atomic_ops.h
+index 33fe00e..ec02ba4 100644
+--- a/src/atomic_ops.h
++++ b/src/atomic_ops.h
+@@ -262,6 +262,9 @@
+ # if defined(__m68k__)
+ # include "atomic_ops/sysdeps/gcc/m68k.h"
+ # endif /* __m68k__ */
++# if defined(__nios2__)
++# include "atomic_ops/sysdeps/gcc/nios2.h"
++# endif /* __nios2__ */
+ # if defined(__powerpc__) || defined(__ppc__) || defined(__PPC__) \
+ || defined(__powerpc64__) || defined(__ppc64__)
+ # include "atomic_ops/sysdeps/gcc/powerpc.h"
+diff --git a/src/atomic_ops/sysdeps/gcc/nios2.h b/src/atomic_ops/sysdeps/gcc/nios2.h
+new file mode 100644
+index 0000000..f402cbb
+--- /dev/null
++++ b/src/atomic_ops/sysdeps/gcc/nios2.h
+@@ -0,0 +1,17 @@
++/*
++ * Copyright (C) 2016 Marek Vasut <marex@denx.de>
++ *
++ * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
++ * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
++ *
++ * Permission is hereby granted to use or copy this program
++ * for any purpose, provided the above notices are retained on all copies.
++ * Permission to modify the code and to distribute modified code is granted,
++ * provided the above notices are retained, and a notice that the code was
++ * modified is included with the above copyright notice.
++ */
++
++#include "../test_and_set_t_is_ao_t.h"
++#include "generic.h"
++
++#define AO_T_IS_INT
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/libatomic-ops/libatomic-ops_7.4.2.bb b/import-layers/yocto-poky/meta/recipes-support/libatomic-ops/libatomic-ops_7.4.2.bb
new file mode 100644
index 000000000..fdb70d8ef
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libatomic-ops/libatomic-ops_7.4.2.bb
@@ -0,0 +1,32 @@
+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 \
+ "
+
+SRC_URI = "\
+ http://www.ivmaisoft.com/_bin/atomic_ops/libatomic_ops-${PV}.tar.gz \
+ file://0001-Add-initial-nios2-architecture-support.patch \
+ "
+
+SRC_URI[md5sum] = "1d6538604b314d2fccdf86915e5c0857"
+SRC_URI[sha256sum] = "04fa615f62992547bcbda562260e28b504bc4c06e2f985f267f3ade30304b5dd"
+
+S = "${WORKDIR}/libatomic_ops-${PV}"
+
+ALLOW_EMPTY_${PN} = "1"
+
+ARM_INSTRUCTION_SET = "arm"
+
+inherit autotools pkgconfig
+
+do_install_append() {
+ # those contain only docs, not necessary for now.
+ install -m 0755 -d ${D}${docdir}
+ mv ${D}${datadir}/libatomic_ops ${D}${docdir}/${BPN}
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libbsd/libbsd_0.8.2.bb b/import-layers/yocto-poky/meta/recipes-support/libbsd/libbsd_0.8.2.bb
new file mode 100644
index 000000000..3335386d8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libbsd/libbsd_0.8.2.bb
@@ -0,0 +1,43 @@
+# 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=145ec05a217d8f879f29cfc5f83084be"
+SECTION = "libs"
+
+SRC_URI = " \
+ http://libbsd.freedesktop.org/releases/${BPN}-${PV}.tar.xz \
+"
+
+SRC_URI[md5sum] = "cdee252ccff978b50ad2336278c506c9"
+SRC_URI[sha256sum] = "b2f644cae94a6e2fe109449c20ad79a0f6ee4faec2205b07eefa0020565e250a"
+
+inherit autotools pkgconfig
diff --git a/import-layers/yocto-poky/meta/recipes-support/libcap-ng/libcap-ng/python.patch b/import-layers/yocto-poky/meta/recipes-support/libcap-ng/libcap-ng/python.patch
new file mode 100644
index 000000000..59591eb46
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/libcap-ng/libcap-ng_0.7.7.bb b/import-layers/yocto-poky/meta/recipes-support/libcap-ng/libcap-ng_0.7.7.bb
new file mode 100644
index 000000000..571546766
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libcap-ng/libcap-ng_0.7.7.bb
@@ -0,0 +1,38 @@
+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 pythonnative
+
+SRC_URI[md5sum] = "3d7d126b29e2869a0257c17c8b0d9b2e"
+SRC_URI[sha256sum] = "615549ce39b333f6b78baee0c0b4ef18bc726c6bf1cca123dfd89dd963f6d06b"
+
+DEPENDS += "swig-native python"
+
+EXTRA_OECONF += "--without-python3"
+
+EXTRA_OEMAKE += "PYLIBVER='python${PYTHON_BASEVERSION}' 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/import-layers/yocto-poky/meta/recipes-support/libcap/libcap_2.24.bb b/import-layers/yocto-poky/meta/recipes-support/libcap/libcap_2.24.bb
new file mode 100644
index 000000000..a701019bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libcap/libcap_2.24.bb
@@ -0,0 +1,76 @@
+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"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/libs/security/linux-privs/${BPN}2/${BPN}-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "d43ab9f680435a7fff35b4ace8d45b80"
+SRC_URI[sha256sum] = "cee4568f78dc851d726fc93f25f4ed91cc223b1fe8259daa4a77158d174e6c65"
+
+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
+
+ # disable gperf detection
+ sed -e '/shell gperf/cifeq (,yes)' -i libcap/Makefile
+}
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)}"
+PACKAGECONFIG_class-native ??= ""
+
+PACKAGECONFIG[attr] = "LIBATTR=yes,LIBATTR=no,attr"
+PACKAGECONFIG[pam] = "PAM_CAP=yes,PAM_CAP=no,libpam"
+
+EXTRA_OEMAKE = " \
+ INDENT= \
+ lib=${@os.path.basename('${libdir}')} \
+ RAISE_SETFCAP=no \
+ DYNAMIC=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 ${EXTRA_OECONF}
+}
+
+do_install() {
+ oe_runmake install \
+ ${EXTRA_OECONF} \
+ DESTDIR="${D}" \
+ prefix="${prefix}" \
+ SBINDIR="${D}${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/import-layers/yocto-poky/meta/recipes-support/libcheck/libcheck_0.10.0.bb b/import-layers/yocto-poky/meta/recipes-support/libcheck/libcheck_0.10.0.bb
new file mode 100644
index 000000000..c0b459f66
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libcheck/libcheck_0.10.0.bb
@@ -0,0 +1,24 @@
+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 = "${SOURCEFORGE_MIRROR}/check/check-${PV}.tar.gz \
+ "
+
+SRC_URI[md5sum] = "53c5e5c77d090e103a17f3ed7fd7d8b8"
+SRC_URI[sha256sum] = "f5f50766aa6f8fe5a2df752666ca01a950add45079aa06416b83765b1cf71052"
+
+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"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libcroco/libcroco_0.6.11.bb b/import-layers/yocto-poky/meta/recipes-support/libcroco/libcroco_0.6.11.bb
new file mode 100644
index 000000000..9df792320
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libcroco/libcroco_0.6.11.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"
+EXTRA_OECONF += "--enable-Bsymbolic=auto"
+
+BINCONFIG = "${bindir}/croco-0.6-config"
+
+inherit autotools pkgconfig gnomebase gtk-doc binconfig-disabled
+
+SRC_URI[archive.md5sum] = "dabc1911dfbfa85f8e6859ca47863168"
+SRC_URI[archive.sha256sum] = "132b528a948586b0dfa05d7e9e059901bca5a3be675b6071a90a90b81ae5a056"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libdaemon/libdaemon/fix-includes.patch b/import-layers/yocto-poky/meta/recipes-support/libdaemon/libdaemon/fix-includes.patch
new file mode 100644
index 000000000..1027ae8e6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/libdaemon/libdaemon_0.14.bb b/import-layers/yocto-poky/meta/recipes-support/libdaemon/libdaemon_0.14.bb
new file mode 100644
index 000000000..070ee1890
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/libevdev/libevdev_1.4.6.bb b/import-layers/yocto-poky/meta/recipes-support/libevdev/libevdev_1.4.6.bb
new file mode 100644
index 000000000..c8163e3bf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libevdev/libevdev_1.4.6.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] = "9b3f25bd8fb0f8efa4944d34668dddc0"
+SRC_URI[sha256sum] = "7b2ae1a0c7f9f7a96198ddc8fd167f090f233d6cbd8168b847e4f968445132d3"
+
+inherit autotools pkgconfig
diff --git a/import-layers/yocto-poky/meta/recipes-support/libevent/libevent/run-ptest b/import-layers/yocto-poky/meta/recipes-support/libevent/libevent/run-ptest
new file mode 100644
index 000000000..d521688e7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libevent/libevent/run-ptest
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+fail=0
+for test in ./test/*
+do
+ $test
+ if [ $? -eq 0 ]
+ then
+ fail=1
+ fi
+done
+
+if [ $fail -eq 0 ]
+then
+ echo "PASS: libevent"
+else
+ echo "FAIL: libevent"
+fi
diff --git a/import-layers/yocto-poky/meta/recipes-support/libevent/libevent_2.0.22.bb b/import-layers/yocto-poky/meta/recipes-support/libevent/libevent_2.0.22.bb
new file mode 100644
index 000000000..df8a31c58
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libevent/libevent_2.0.22.bb
@@ -0,0 +1,41 @@
+SUMMARY = "An asynchronous event notification library"
+HOMEPAGE = "http://libevent.org/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=50884&atid=461322"
+SECTION = "libs"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=45c5316ff684bcfe2f9f86d8b1279559"
+
+SRC_URI = " \
+ ${SOURCEFORGE_MIRROR}/levent/${BP}-stable.tar.gz \
+ file://run-ptest \
+"
+
+SRC_URI[md5sum] = "c4c56f986aa985677ca1db89630a2e11"
+SRC_URI[sha256sum] = "71c2c49f0adadacfdbe6332a372c38cf9c8b7895bb73dabeaa53cdcc1d4e1fa3"
+
+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.0.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/import-layers/yocto-poky/meta/recipes-support/libexif/libexif_0.6.21.bb b/import-layers/yocto-poky/meta/recipes-support/libexif/libexif_0.6.21.bb
new file mode 100644
index 000000000..cff4caede
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/libffi/libffi/0001-mips-Use-compiler-internal-define-for-linux.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/libffi/libffi/not-win32.patch b/import-layers/yocto-poky/meta/recipes-support/libffi/libffi/not-win32.patch
new file mode 100644
index 000000000..1e90125ed
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libffi/libffi/not-win32.patch
@@ -0,0 +1,22 @@
+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>
+
+--- a/configure.ac~ 2014-11-12 11:56:51.000000000 +0000
++++ b/configure.ac 2016-02-04 14:02:53.765710532 +0000
+@@ -593,5 +593,5 @@
+ # 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 \ No newline at end of file
diff --git a/import-layers/yocto-poky/meta/recipes-support/libffi/libffi_3.2.1.bb b/import-layers/yocto-poky/meta/recipes-support/libffi/libffi_3.2.1.bb
new file mode 100644
index 000000000..72e25fb9d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libffi/libffi_3.2.1.bb
@@ -0,0 +1,26 @@
+SUMMARY = "A portable foreign function interface library"
+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 \
+ "
+
+SRC_URI[md5sum] = "83b89587607e3eb65c70d361f13bab43"
+SRC_URI[sha256sum] = "d06ebb8e1d9a22d19e38d63fdb83954253f39bedc5d46232a05645685722ca37"
+
+EXTRA_OECONF += "--disable-builddir"
+
+inherit autotools texinfo
+
+FILES_${PN}-dev += "${libdir}/libffi-${PV}"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libfm/libfm-extra/0001-nls.m4-Take-it-from-gettext-0.15.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/libfm/libfm-extra_1.2.4.bb b/import-layers/yocto-poky/meta/recipes-support/libfm/libfm-extra_1.2.4.bb
new file mode 100644
index 000000000..f20496803
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libfm/libfm-extra_1.2.4.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 intltool-native gettext-native"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/pcmanfm/libfm-${PV}.tar.xz \
+ file://0001-nls.m4-Take-it-from-gettext-0.15.patch \
+ "
+
+SRC_URI[md5sum] = "74997d75e7e87dc73398746fd373bf52"
+SRC_URI[sha256sum] = "7804f6f28cb3d1bc8ffb3151ab7ff0c063b27c5f9b06c682eb903e01cf25502f"
+
+S = "${WORKDIR}/libfm-${PV}"
+
+EXTRA_OECONF = "--with-extra-only --with-gtk=no"
+
+inherit autotools pkgconfig gtk-doc
+
+do_configure[dirs] =+ "${S}/m4"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libfm/libfm_1.2.4.bb b/import-layers/yocto-poky/meta/recipes-support/libfm/libfm_1.2.4.bb
new file mode 100644
index 000000000..866b11a9a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libfm/libfm_1.2.4.bb
@@ -0,0 +1,36 @@
+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 pango gtk+ menu-cache intltool-native libexif libfm-extra gettext-native"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/pcmanfm/libfm-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "74997d75e7e87dc73398746fd373bf52"
+SRC_URI[sha256sum] = "7804f6f28cb3d1bc8ffb3151ab7ff0c063b27c5f9b06c682eb903e01cf25502f"
+
+inherit autotools pkgconfig gtk-doc distro_features_check
+ANY_OF_DISTRO_FEATURES = "${GTK2DISTROFEATURES}"
+
+do_configure[dirs] =+ "${S}/m4"
+
+PACKAGES += "${PN}-mime"
+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}${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/import-layers/yocto-poky/meta/recipes-support/libgcrypt/files/add-pkgconfig-support.patch b/import-layers/yocto-poky/meta/recipes-support/libgcrypt/files/add-pkgconfig-support.patch
new file mode 100644
index 000000000..67ddfc640
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libgcrypt/files/add-pkgconfig-support.patch
@@ -0,0 +1,151 @@
+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
+
+Index: libgcrypt-1.2.4/configure.ac
+===================================================================
+--- libgcrypt-1.2.4.orig/configure.ac 2008-03-19 22:14:50.000000000 +0000
++++ libgcrypt-1.2.4/configure.ac 2008-03-19 22:14:58.000000000 +0000
+@@ -807,6 +807,7 @@
+ doc/Makefile
+ src/Makefile
+ src/gcrypt.h
++src/libgcrypt.pc
+ src/libgcrypt-config
+ tests/Makefile
+ w32-dll/Makefile
+Index: libgcrypt-1.2.4/src/libgcrypt.pc.in
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ libgcrypt-1.2.4/src/libgcrypt.pc.in 2008-03-19 22:14:58.000000000 +0000
+@@ -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}
+Index: libgcrypt-1.6.1/src/libgcrypt.m4
+===================================================================
+--- libgcrypt-1.6.1.orig/src/libgcrypt.m4 2013-12-16 17:44:32.000000000 +0000
++++ libgcrypt-1.6.1/src/libgcrypt.m4 2014-05-13 21:25:37.478389833 +0000
+@@ -22,17 +22,7 @@
+ 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_prefix != x ; then
+- if test x${LIBGCRYPT_CONFIG+set} != xset ; then
+- LIBGCRYPT_CONFIG=$libgcrypt_config_prefix/bin/libgcrypt-config
+- fi
+- fi
+
+- AC_PATH_TOOL(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/'`
+@@ -42,48 +32,13 @@
+ 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
+@@ -96,10 +51,8 @@
+ 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([[
+@@ -113,8 +66,6 @@
+ fi
+ fi
+ else
+- LIBGCRYPT_CFLAGS=""
+- LIBGCRYPT_LIBS=""
+ ifelse([$3], , :, [$3])
+ fi
+ AC_SUBST(LIBGCRYPT_CFLAGS)
diff --git a/import-layers/yocto-poky/meta/recipes-support/libgcrypt/files/fix-ICE-failure-on-mips-with-option-O-and-g.patch b/import-layers/yocto-poky/meta/recipes-support/libgcrypt/files/fix-ICE-failure-on-mips-with-option-O-and-g.patch
new file mode 100644
index 000000000..582e62f70
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libgcrypt/files/fix-ICE-failure-on-mips-with-option-O-and-g.patch
@@ -0,0 +1,71 @@
+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]
+
+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 bd05064..28c2438 100644
+--- a/tests/bench-slope.c
++++ b/tests/bench-slope.c
+@@ -1197,7 +1197,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},
+ };
+@@ -1349,7 +1349,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.1.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/libgcrypt/files/libgcrypt-fix-building-error-with-O2-in-sysroot-path.patch b/import-layers/yocto-poky/meta/recipes-support/libgcrypt/files/libgcrypt-fix-building-error-with-O2-in-sysroot-path.patch
new file mode 100644
index 000000000..a3e540369
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libgcrypt/files/libgcrypt-fix-building-error-with-O2-in-sysroot-path.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Pending
+
+libgcrypt: fix building error with '-O2' in sysroot path
+
+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>
+---
+ cipher/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cipher/Makefile.am b/cipher/Makefile.am
+index 76cdc96..9a89792 100644
+--- a/cipher/Makefile.am
++++ b/cipher/Makefile.am
+@@ -69,7 +69,7 @@ rfc2268.c \
+ camellia.c camellia.h camellia-glue.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.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/libgcrypt/libgcrypt.inc b/import-layers/yocto-poky/meta/recipes-support/libgcrypt/libgcrypt.inc
new file mode 100644
index 000000000..5478253e0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libgcrypt/libgcrypt.inc
@@ -0,0 +1,47 @@
+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 libcap"
+
+SRC_URI = "ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-${PV}.tar.gz \
+ file://add-pkgconfig-support.patch \
+ file://libgcrypt-fix-building-error-with-O2-in-sysroot-path.patch \
+ file://fix-ICE-failure-on-mips-with-option-O-and-g.patch \
+"
+
+BINCONFIG = "${bindir}/libgcrypt-config"
+
+inherit autotools texinfo binconfig-disabled pkgconfig
+
+EXTRA_OECONF = "--disable-asm --with-capabilities"
+
+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"
+
+ARM_INSTRUCTION_SET = "arm"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libgcrypt/libgcrypt_1.6.5.bb b/import-layers/yocto-poky/meta/recipes-support/libgcrypt/libgcrypt_1.6.5.bb
new file mode 100644
index 000000000..717a23f1c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libgcrypt/libgcrypt_1.6.5.bb
@@ -0,0 +1,4 @@
+require libgcrypt.inc
+
+SRC_URI[md5sum] = "f24fcb684932d4b5ed85f2f05cb1d9f8"
+SRC_URI[sha256sum] = "202bf109ccf2d614565c849f3e5687b94cde972167b35261e094252367627bc6"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libgpg-error/libgpg-error/0001-libgpg-error-Add-nios2-support.patch b/import-layers/yocto-poky/meta/recipes-support/libgpg-error/libgpg-error/0001-libgpg-error-Add-nios2-support.patch
new file mode 100644
index 000000000..dab1c13b6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libgpg-error/libgpg-error/0001-libgpg-error-Add-nios2-support.patch
@@ -0,0 +1,46 @@
+From b2af652f43991e4ce6297917da542a9eb5135939 Mon Sep 17 00:00:00 2001
+From: Marek Vasut <marex@denx.de>
+Date: Thu, 17 Sep 2015 03:28:06 +0200
+Subject: [PATCH] libgpg-error: Add nios2 support
+
+Add configuration for the NIOS2 processor.
+
+Signed-off-by: Marek Vasut <marex@denx.de>
+Upstream-Status: Submitted
+---
+ src/syscfg/lock-obj-pub.nios2-unknown-linux-gnu.h | 23 +++++++++++++++++++++++
+ 1 file changed, 23 insertions(+)
+ create mode 100644 src/syscfg/lock-obj-pub.nios2-unknown-linux-gnu.h
+
+diff --git a/src/syscfg/lock-obj-pub.nios2-unknown-linux-gnu.h b/src/syscfg/lock-obj-pub.nios2-unknown-linux-gnu.h
+new file mode 100644
+index 0000000..3a24571
+--- /dev/null
++++ b/src/syscfg/lock-obj-pub.nios2-unknown-linux-gnu.h
+@@ -0,0 +1,23 @@
++## lock-obj-pub.nios2-unknown-linux-gnu.h
++## File created by gen-posix-lock-obj - DO NOT EDIT
++## To be included by mkheader into gpg-error.h
++
++typedef struct
++{
++ long _vers;
++ union {
++ volatile char _priv[24];
++ long _x_align;
++ long *_xp_align;
++ } u;
++} gpgrt_lock_t;
++
++#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
++ 0,0,0,0,0,0,0,0, \
++ 0,0,0,0,0,0,0,0}}}
++##
++## Local Variables:
++## mode: c
++## buffer-read-only: t
++## End:
++##
+--
+2.5.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/libgpg-error/libgpg-error/pkgconfig.patch b/import-layers/yocto-poky/meta/recipes-support/libgpg-error/libgpg-error/pkgconfig.patch
new file mode 100644
index 000000000..9ffeedbe5
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/libgpg-error/libgpg-error_1.21.bb b/import-layers/yocto-poky/meta/recipes-support/libgpg-error/libgpg-error_1.21.bb
new file mode 100644
index 000000000..0dd16025a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libgpg-error/libgpg-error_1.21.bb
@@ -0,0 +1,53 @@
+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=93d3155af141ae3b369a5d09ca9d6234 \
+ file://src/init.c;endline=20;md5=8f5a9b59634f4aebcd0ec9d3ebd53bfe"
+
+
+SECTION = "libs"
+
+SRC_URI = "ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-${PV}.tar.bz2 \
+ file://pkgconfig.patch \
+ file://0001-libgpg-error-Add-nios2-support.patch \
+ "
+SRC_URI[md5sum] = "ab0b5aba6d0a185b41d07bda804fd8b2"
+SRC_URI[sha256sum] = "b7dbdb3cad63a740e9f0c632a1da32d4afdb694ec86c8625c98ea0691713b84d"
+
+BINCONFIG = "${bindir}/gpg-error-config"
+
+inherit autotools binconfig-disabled pkgconfig gettext
+CPPFLAGS += "-P"
+do_compile_prepend() {
+ TARGET_FILE=linux-gnu
+ if [ ${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 ;;
+ mips64el) TUPLE=mipsel-unknown-linux-gnu ;;
+ mips64) TUPLE=mips-unknown-linux-gnu ;;
+ x86_64) TUPLE=x86_64-pc-linux-gnu ;;
+ *) TUPLE=${TARGET_ARCH}-unknown-linux-gnu ;;
+ esac
+
+ cp ${S}/src/syscfg/lock-obj-pub.$TUPLE.h \
+ ${S}/src/syscfg/lock-obj-pub.$TARGET_FILE.h
+}
+
+do_install_append() {
+ # we don't have common lisp in OE
+ rm -rf "${D}${datadir}/common-lisp/"
+}
+
+FILES_${PN}-dev += "${bindir}/gpg-error"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libical/libical/Remove-cmake-check-for-Perl.patch b/import-layers/yocto-poky/meta/recipes-support/libical/libical/Remove-cmake-check-for-Perl.patch
new file mode 100644
index 000000000..c5c0cb076
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libical/libical/Remove-cmake-check-for-Perl.patch
@@ -0,0 +1,33 @@
+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(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index d5aad80..5cc9863 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -91,8 +91,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)
+
+ # MSVC specific definitions
+ if(WIN32)
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/libical/libical_2.0.0.bb b/import-layers/yocto-poky/meta/recipes-support/libical/libical_2.0.0.bb
new file mode 100644
index 000000000..1042e6fa3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libical/libical_2.0.0.bb
@@ -0,0 +1,27 @@
+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 \
+ "
+DEPENDS = "icu"
+
+SRC_URI[md5sum] = "6bf8e5f5a3ba88baf390d0134e05d76e"
+SRC_URI[sha256sum] = "654c11f759c19237be39f6ad401d917e5a05f36f1736385ed958e60cf21456da"
+UPSTREAM_CHECK_URI = "https://github.com/libical/libical/releases"
+
+inherit cmake
+
+FILES_${PN}-dev += "${libdir}/cmake/*"
+
+#
+# Turn specific library paths in the pkgconfig file into standard library entries
+#
+do_install_append () {
+ sed -i -e "s#${STAGING_LIBDIR}/lib\([a-z0-9]*\)\.so#-l\1#g" ${D}${libdir}/pkgconfig/libical.pc
+}
diff --git a/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv-1.11.1/autoconf.patch b/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv-1.11.1/autoconf.patch
new file mode 100644
index 000000000..3cbf549d4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv-1.11.1/autoconf.patch
@@ -0,0 +1,50 @@
+It adds the variables that are needed
+for autoconf 2.65 to reconfigure libiconv and defines the m4 macros
+directory. Its imported from OE.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: libiconv-1.11.1/configure.ac
+===================================================================
+--- libiconv-1.11.1.orig/configure.ac
++++ libiconv-1.11.1/configure.ac
+@@ -23,7 +23,7 @@ AC_CONFIG_AUX_DIR(build-aux)
+ AM_INIT_AUTOMAKE(libiconv, 1.11)
+ AC_CONFIG_HEADERS(config.h lib/config.h)
+ AC_PROG_MAKE_SET
+-
++AC_CONFIG_MACRO_DIR([m4])
+ dnl checks for basic programs
+
+ AC_PROG_CC
+Index: libiconv-1.11.1/libcharset/configure.ac
+===================================================================
+--- libiconv-1.11.1.orig/libcharset/configure.ac
++++ libiconv-1.11.1/libcharset/configure.ac
+@@ -16,17 +16,17 @@ dnl along with the GNU CHARSET Library;
+ dnl write to the Free Software Foundation, Inc., 51 Franklin Street,
+ dnl Fifth Floor, Boston, MA 02110-1301, USA.
+
+-AC_PREREQ(2.13)
++AC_PREREQ(2.61)
++AC_INIT([libcharset],[1.4] )
++AC_CONFIG_SRCDIR([lib/localcharset.c])
+
+-PACKAGE=libcharset
+-VERSION=1.4
+-
+-AC_INIT(lib/localcharset.c)
+ AC_CONFIG_AUX_DIR(build-aux)
+ AC_CONFIG_HEADER(config.h)
+ AC_PROG_MAKE_SET
+-AC_SUBST(PACKAGE)
+-AC_SUBST(VERSION)
++dnl AC_SUBST(PACKAGE)
++dnl AC_SUBST(VERSION)
++
++AC_CONFIG_MACRO_DIR([m4])
+
+ dnl checks for basic programs
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv-1.11.1/shared_preloadable_libiconv_linux.patch b/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv-1.11.1/shared_preloadable_libiconv_linux.patch
new file mode 100644
index 000000000..fb07f7366
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv-1.11.1/shared_preloadable_libiconv_linux.patch
@@ -0,0 +1,26 @@
+With libtool generating shared and static version of libraries needs -fPIC flags
+without this it will not generate the commands to create shared linked library
+Its more enforced by libtool 2.4. I have not checked it with older libtool
+libiconv 1.11.x is relatively old release and libtool 2.4 did not exist when it
+was released these kind of problem are more likely
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: libiconv-1.11.1/lib/Makefile.in
+===================================================================
+--- libiconv-1.11.1.orig/lib/Makefile.in
++++ libiconv-1.11.1/lib/Makefile.in
+@@ -70,9 +70,9 @@ preloadable_libiconv.so : preloadable_li
+
+ preloadable_libiconv_linux.so : $(SOURCES)
+ if test -n "@GCC@"; then \
+- $(LIBTOOL_LINK) $(CC) $(LDFLAGS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS) $(DEFS) -fPIC -DPIC -DLIBICONV_PLUG $(SOURCES) -shared -o preloadable_libiconv_linux.so; \
++ $(LIBTOOL_LINK) $(CC) $(LDFLAGS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS) $(DEFS) -fPIC -DPIC -DLIBICONV_PLUG $(SOURCES) -rpath $(libdir) -o libpreload_iconv.la && cp .libs/libpreload_iconv.so preloadable_libiconv_linux.so; \
+ else \
+- $(LIBTOOL_LINK) $(CC) $(LDFLAGS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS) $(DEFS) -KPIC -DPIC -DLIBICONV_PLUG $(SOURCES) -shared -o preloadable_libiconv_linux.so; \
++ $(LIBTOOL_LINK) $(CC) $(LDFLAGS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS) $(DEFS) -KPIC -DPIC -DLIBICONV_PLUG $(SOURCES) -rpath $(libdir) -o libpreload_iconv.la && cp .libs/libpreload_iconv.so preloadable_libiconv_linux.so; \
+ fi
+
+ preloadable_libiconv_solaris.so : $(SOURCES)
diff --git a/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv-1.14/add-relocatable-module.patch b/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv-1.14/add-relocatable-module.patch
new file mode 100644
index 000000000..6af377b4c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv-1.14/add-relocatable-module.patch
@@ -0,0 +1,5008 @@
+This patch is needed to solve issues like
+| iconv.o: In function `main':
+| /home/james/stuff/beagle/tmp-eglibc/work/armv7a-vfp-neon-oe-linux-gnueabi/libiconv-1.14-r0/libiconv-1.14/src/./iconv.c:861: undefined reference to `relocate'
+| ../srclib/libicrt.a(progreloc.o): In function `prepare_relocate':
+| /home/james/stuff/beagle/tmp-eglibc/work/armv7a-vfp-neon-oe-linux-gnueabi/libiconv-1.14-r0/libiconv-1.14/srclib/progreloc.c:297: undefined reference to `compute_curr_prefix'
+| /home/james/stuff/beagle/tmp-eglibc/work/armv7a-vfp-neon-oe-linux-gnueabi/libiconv-1.14-r0/libiconv-1.14/srclib/progreloc.c:302: undefined reference to `set_relocation_prefix'
+| collect2: ld returned 1 exit status
+| make[1]: *** [install] Error 1
+
+Upstream-Status: Inappropriate [OE config specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+diff -Naurp libiconv-1.14.org//build-aux/arg-nonnull.h libiconv-1.14/build-aux/arg-nonnull.h
+--- libiconv-1.14.org//build-aux/arg-nonnull.h 1969-12-31 16:00:00.000000000 -0800
++++ libiconv-1.14/build-aux/arg-nonnull.h 2012-01-08 02:07:39.930484438 -0800
+@@ -0,0 +1,26 @@
++/* A C macro for declaring that specific arguments must not be NULL.
++ Copyright (C) 2009-2011 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
++ (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/>. */
++
++/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
++ that the values passed as arguments n, ..., m must be non-NULL pointers.
++ n = 1 stands for the first argument, n = 2 for the second argument etc. */
++#ifndef _GL_ARG_NONNULL
++# if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
++# define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
++# else
++# define _GL_ARG_NONNULL(params)
++# endif
++#endif
+diff -Naurp libiconv-1.14.org//build-aux/c++defs.h libiconv-1.14/build-aux/c++defs.h
+--- libiconv-1.14.org//build-aux/c++defs.h 1969-12-31 16:00:00.000000000 -0800
++++ libiconv-1.14/build-aux/c++defs.h 2012-01-08 02:07:39.942484438 -0800
+@@ -0,0 +1,271 @@
++/* C++ compatible function declaration macros.
++ Copyright (C) 2010-2011 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
++ (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/>. */
++
++#ifndef _GL_CXXDEFS_H
++#define _GL_CXXDEFS_H
++
++/* The three most frequent use cases of these macros are:
++
++ * For providing a substitute for a function that is missing on some
++ platforms, but is declared and works fine on the platforms on which
++ it exists:
++
++ #if @GNULIB_FOO@
++ # if !@HAVE_FOO@
++ _GL_FUNCDECL_SYS (foo, ...);
++ # endif
++ _GL_CXXALIAS_SYS (foo, ...);
++ _GL_CXXALIASWARN (foo);
++ #elif defined GNULIB_POSIXCHECK
++ ...
++ #endif
++
++ * For providing a replacement for a function that exists on all platforms,
++ but is broken/insufficient and needs to be replaced on some platforms:
++
++ #if @GNULIB_FOO@
++ # if @REPLACE_FOO@
++ # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
++ # undef foo
++ # define foo rpl_foo
++ # endif
++ _GL_FUNCDECL_RPL (foo, ...);
++ _GL_CXXALIAS_RPL (foo, ...);
++ # else
++ _GL_CXXALIAS_SYS (foo, ...);
++ # endif
++ _GL_CXXALIASWARN (foo);
++ #elif defined GNULIB_POSIXCHECK
++ ...
++ #endif
++
++ * For providing a replacement for a function that exists on some platforms
++ but is broken/insufficient and needs to be replaced on some of them and
++ is additionally either missing or undeclared on some other platforms:
++
++ #if @GNULIB_FOO@
++ # if @REPLACE_FOO@
++ # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
++ # undef foo
++ # define foo rpl_foo
++ # endif
++ _GL_FUNCDECL_RPL (foo, ...);
++ _GL_CXXALIAS_RPL (foo, ...);
++ # else
++ # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@
++ _GL_FUNCDECL_SYS (foo, ...);
++ # endif
++ _GL_CXXALIAS_SYS (foo, ...);
++ # endif
++ _GL_CXXALIASWARN (foo);
++ #elif defined GNULIB_POSIXCHECK
++ ...
++ #endif
++*/
++
++/* _GL_EXTERN_C declaration;
++ performs the declaration with C linkage. */
++#if defined __cplusplus
++# define _GL_EXTERN_C extern "C"
++#else
++# define _GL_EXTERN_C extern
++#endif
++
++/* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
++ declares a replacement function, named rpl_func, with the given prototype,
++ consisting of return type, parameters, and attributes.
++ Example:
++ _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
++ _GL_ARG_NONNULL ((1)));
++ */
++#define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
++ _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
++#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
++ _GL_EXTERN_C rettype rpl_func parameters_and_attributes
++
++/* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
++ declares the system function, named func, with the given prototype,
++ consisting of return type, parameters, and attributes.
++ Example:
++ _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
++ _GL_ARG_NONNULL ((1)));
++ */
++#define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
++ _GL_EXTERN_C rettype func parameters_and_attributes
++
++/* _GL_CXXALIAS_RPL (func, rettype, parameters);
++ declares a C++ alias called GNULIB_NAMESPACE::func
++ that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
++ Example:
++ _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
++ */
++#define _GL_CXXALIAS_RPL(func,rettype,parameters) \
++ _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
++#if defined __cplusplus && defined GNULIB_NAMESPACE
++# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
++ namespace GNULIB_NAMESPACE \
++ { \
++ rettype (*const func) parameters = ::rpl_func; \
++ } \
++ _GL_EXTERN_C int _gl_cxxalias_dummy
++#else
++# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
++ _GL_EXTERN_C int _gl_cxxalias_dummy
++#endif
++
++/* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
++ is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
++ except that the C function rpl_func may have a slightly different
++ declaration. A cast is used to silence the "invalid conversion" error
++ that would otherwise occur. */
++#if defined __cplusplus && defined GNULIB_NAMESPACE
++# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
++ namespace GNULIB_NAMESPACE \
++ { \
++ rettype (*const func) parameters = \
++ reinterpret_cast<rettype(*)parameters>(::rpl_func); \
++ } \
++ _GL_EXTERN_C int _gl_cxxalias_dummy
++#else
++# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
++ _GL_EXTERN_C int _gl_cxxalias_dummy
++#endif
++
++/* _GL_CXXALIAS_SYS (func, rettype, parameters);
++ declares a C++ alias called GNULIB_NAMESPACE::func
++ that redirects to the system provided function func, if GNULIB_NAMESPACE
++ is defined.
++ Example:
++ _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
++ */
++#if defined __cplusplus && defined GNULIB_NAMESPACE
++ /* If we were to write
++ rettype (*const func) parameters = ::func;
++ like above in _GL_CXXALIAS_RPL_1, the compiler could optimize calls
++ better (remove an indirection through a 'static' pointer variable),
++ but then the _GL_CXXALIASWARN macro below would cause a warning not only
++ for uses of ::func but also for uses of GNULIB_NAMESPACE::func. */
++# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
++ namespace GNULIB_NAMESPACE \
++ { \
++ static rettype (*func) parameters = ::func; \
++ } \
++ _GL_EXTERN_C int _gl_cxxalias_dummy
++#else
++# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
++ _GL_EXTERN_C int _gl_cxxalias_dummy
++#endif
++
++/* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
++ is like _GL_CXXALIAS_SYS (func, rettype, parameters);
++ except that the C function func may have a slightly different declaration.
++ A cast is used to silence the "invalid conversion" error that would
++ otherwise occur. */
++#if defined __cplusplus && defined GNULIB_NAMESPACE
++# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
++ namespace GNULIB_NAMESPACE \
++ { \
++ static rettype (*func) parameters = \
++ reinterpret_cast<rettype(*)parameters>(::func); \
++ } \
++ _GL_EXTERN_C int _gl_cxxalias_dummy
++#else
++# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
++ _GL_EXTERN_C int _gl_cxxalias_dummy
++#endif
++
++/* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
++ is like _GL_CXXALIAS_SYS (func, rettype, parameters);
++ except that the C function is picked among a set of overloaded functions,
++ namely the one with rettype2 and parameters2. Two consecutive casts
++ are used to silence the "cannot find a match" and "invalid conversion"
++ errors that would otherwise occur. */
++#if defined __cplusplus && defined GNULIB_NAMESPACE
++ /* The outer cast must be a reinterpret_cast.
++ The inner cast: When the function is defined as a set of overloaded
++ functions, it works as a static_cast<>, choosing the designated variant.
++ When the function is defined as a single variant, it works as a
++ reinterpret_cast<>. The parenthesized cast syntax works both ways. */
++# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
++ namespace GNULIB_NAMESPACE \
++ { \
++ static rettype (*func) parameters = \
++ reinterpret_cast<rettype(*)parameters>( \
++ (rettype2(*)parameters2)(::func)); \
++ } \
++ _GL_EXTERN_C int _gl_cxxalias_dummy
++#else
++# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
++ _GL_EXTERN_C int _gl_cxxalias_dummy
++#endif
++
++/* _GL_CXXALIASWARN (func);
++ causes a warning to be emitted when ::func is used but not when
++ GNULIB_NAMESPACE::func is used. func must be defined without overloaded
++ variants. */
++#if defined __cplusplus && defined GNULIB_NAMESPACE
++# define _GL_CXXALIASWARN(func) \
++ _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
++# define _GL_CXXALIASWARN_1(func,namespace) \
++ _GL_CXXALIASWARN_2 (func, namespace)
++/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
++ we enable the warning only when not optimizing. */
++# if !__OPTIMIZE__
++# define _GL_CXXALIASWARN_2(func,namespace) \
++ _GL_WARN_ON_USE (func, \
++ "The symbol ::" #func " refers to the system function. " \
++ "Use " #namespace "::" #func " instead.")
++# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
++# define _GL_CXXALIASWARN_2(func,namespace) \
++ extern __typeof__ (func) func
++# else
++# define _GL_CXXALIASWARN_2(func,namespace) \
++ _GL_EXTERN_C int _gl_cxxalias_dummy
++# endif
++#else
++# define _GL_CXXALIASWARN(func) \
++ _GL_EXTERN_C int _gl_cxxalias_dummy
++#endif
++
++/* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
++ causes a warning to be emitted when the given overloaded variant of ::func
++ is used but not when GNULIB_NAMESPACE::func is used. */
++#if defined __cplusplus && defined GNULIB_NAMESPACE
++# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
++ _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
++ GNULIB_NAMESPACE)
++# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
++ _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
++/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
++ we enable the warning only when not optimizing. */
++# if !__OPTIMIZE__
++# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
++ _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
++ "The symbol ::" #func " refers to the system function. " \
++ "Use " #namespace "::" #func " instead.")
++# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
++# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
++ extern __typeof__ (func) func
++# else
++# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
++ _GL_EXTERN_C int _gl_cxxalias_dummy
++# endif
++#else
++# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
++ _GL_EXTERN_C int _gl_cxxalias_dummy
++#endif
++
++#endif /* _GL_CXXDEFS_H */
+diff -Naurp libiconv-1.14.org//build-aux/snippet/arg-nonnull.h libiconv-1.14/build-aux/snippet/arg-nonnull.h
+--- libiconv-1.14.org//build-aux/snippet/arg-nonnull.h 2011-08-07 06:22:07.000000000 -0700
++++ libiconv-1.14/build-aux/snippet/arg-nonnull.h 1969-12-31 16:00:00.000000000 -0800
+@@ -1,26 +0,0 @@
+-/* A C macro for declaring that specific arguments must not be NULL.
+- Copyright (C) 2009-2011 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
+- (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/>. */
+-
+-/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
+- that the values passed as arguments n, ..., m must be non-NULL pointers.
+- n = 1 stands for the first argument, n = 2 for the second argument etc. */
+-#ifndef _GL_ARG_NONNULL
+-# if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
+-# define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
+-# else
+-# define _GL_ARG_NONNULL(params)
+-# endif
+-#endif
+diff -Naurp libiconv-1.14.org//build-aux/snippet/c++defs.h libiconv-1.14/build-aux/snippet/c++defs.h
+--- libiconv-1.14.org//build-aux/snippet/c++defs.h 2011-08-07 06:22:07.000000000 -0700
++++ libiconv-1.14/build-aux/snippet/c++defs.h 1969-12-31 16:00:00.000000000 -0800
+@@ -1,271 +0,0 @@
+-/* C++ compatible function declaration macros.
+- Copyright (C) 2010-2011 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
+- (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/>. */
+-
+-#ifndef _GL_CXXDEFS_H
+-#define _GL_CXXDEFS_H
+-
+-/* The three most frequent use cases of these macros are:
+-
+- * For providing a substitute for a function that is missing on some
+- platforms, but is declared and works fine on the platforms on which
+- it exists:
+-
+- #if @GNULIB_FOO@
+- # if !@HAVE_FOO@
+- _GL_FUNCDECL_SYS (foo, ...);
+- # endif
+- _GL_CXXALIAS_SYS (foo, ...);
+- _GL_CXXALIASWARN (foo);
+- #elif defined GNULIB_POSIXCHECK
+- ...
+- #endif
+-
+- * For providing a replacement for a function that exists on all platforms,
+- but is broken/insufficient and needs to be replaced on some platforms:
+-
+- #if @GNULIB_FOO@
+- # if @REPLACE_FOO@
+- # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+- # undef foo
+- # define foo rpl_foo
+- # endif
+- _GL_FUNCDECL_RPL (foo, ...);
+- _GL_CXXALIAS_RPL (foo, ...);
+- # else
+- _GL_CXXALIAS_SYS (foo, ...);
+- # endif
+- _GL_CXXALIASWARN (foo);
+- #elif defined GNULIB_POSIXCHECK
+- ...
+- #endif
+-
+- * For providing a replacement for a function that exists on some platforms
+- but is broken/insufficient and needs to be replaced on some of them and
+- is additionally either missing or undeclared on some other platforms:
+-
+- #if @GNULIB_FOO@
+- # if @REPLACE_FOO@
+- # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+- # undef foo
+- # define foo rpl_foo
+- # endif
+- _GL_FUNCDECL_RPL (foo, ...);
+- _GL_CXXALIAS_RPL (foo, ...);
+- # else
+- # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@
+- _GL_FUNCDECL_SYS (foo, ...);
+- # endif
+- _GL_CXXALIAS_SYS (foo, ...);
+- # endif
+- _GL_CXXALIASWARN (foo);
+- #elif defined GNULIB_POSIXCHECK
+- ...
+- #endif
+-*/
+-
+-/* _GL_EXTERN_C declaration;
+- performs the declaration with C linkage. */
+-#if defined __cplusplus
+-# define _GL_EXTERN_C extern "C"
+-#else
+-# define _GL_EXTERN_C extern
+-#endif
+-
+-/* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
+- declares a replacement function, named rpl_func, with the given prototype,
+- consisting of return type, parameters, and attributes.
+- Example:
+- _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
+- _GL_ARG_NONNULL ((1)));
+- */
+-#define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
+- _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
+-#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
+- _GL_EXTERN_C rettype rpl_func parameters_and_attributes
+-
+-/* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
+- declares the system function, named func, with the given prototype,
+- consisting of return type, parameters, and attributes.
+- Example:
+- _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
+- _GL_ARG_NONNULL ((1)));
+- */
+-#define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
+- _GL_EXTERN_C rettype func parameters_and_attributes
+-
+-/* _GL_CXXALIAS_RPL (func, rettype, parameters);
+- declares a C++ alias called GNULIB_NAMESPACE::func
+- that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
+- Example:
+- _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
+- */
+-#define _GL_CXXALIAS_RPL(func,rettype,parameters) \
+- _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
+-#if defined __cplusplus && defined GNULIB_NAMESPACE
+-# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
+- namespace GNULIB_NAMESPACE \
+- { \
+- rettype (*const func) parameters = ::rpl_func; \
+- } \
+- _GL_EXTERN_C int _gl_cxxalias_dummy
+-#else
+-# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
+- _GL_EXTERN_C int _gl_cxxalias_dummy
+-#endif
+-
+-/* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
+- is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
+- except that the C function rpl_func may have a slightly different
+- declaration. A cast is used to silence the "invalid conversion" error
+- that would otherwise occur. */
+-#if defined __cplusplus && defined GNULIB_NAMESPACE
+-# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
+- namespace GNULIB_NAMESPACE \
+- { \
+- rettype (*const func) parameters = \
+- reinterpret_cast<rettype(*)parameters>(::rpl_func); \
+- } \
+- _GL_EXTERN_C int _gl_cxxalias_dummy
+-#else
+-# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
+- _GL_EXTERN_C int _gl_cxxalias_dummy
+-#endif
+-
+-/* _GL_CXXALIAS_SYS (func, rettype, parameters);
+- declares a C++ alias called GNULIB_NAMESPACE::func
+- that redirects to the system provided function func, if GNULIB_NAMESPACE
+- is defined.
+- Example:
+- _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
+- */
+-#if defined __cplusplus && defined GNULIB_NAMESPACE
+- /* If we were to write
+- rettype (*const func) parameters = ::func;
+- like above in _GL_CXXALIAS_RPL_1, the compiler could optimize calls
+- better (remove an indirection through a 'static' pointer variable),
+- but then the _GL_CXXALIASWARN macro below would cause a warning not only
+- for uses of ::func but also for uses of GNULIB_NAMESPACE::func. */
+-# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
+- namespace GNULIB_NAMESPACE \
+- { \
+- static rettype (*func) parameters = ::func; \
+- } \
+- _GL_EXTERN_C int _gl_cxxalias_dummy
+-#else
+-# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
+- _GL_EXTERN_C int _gl_cxxalias_dummy
+-#endif
+-
+-/* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
+- is like _GL_CXXALIAS_SYS (func, rettype, parameters);
+- except that the C function func may have a slightly different declaration.
+- A cast is used to silence the "invalid conversion" error that would
+- otherwise occur. */
+-#if defined __cplusplus && defined GNULIB_NAMESPACE
+-# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
+- namespace GNULIB_NAMESPACE \
+- { \
+- static rettype (*func) parameters = \
+- reinterpret_cast<rettype(*)parameters>(::func); \
+- } \
+- _GL_EXTERN_C int _gl_cxxalias_dummy
+-#else
+-# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
+- _GL_EXTERN_C int _gl_cxxalias_dummy
+-#endif
+-
+-/* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
+- is like _GL_CXXALIAS_SYS (func, rettype, parameters);
+- except that the C function is picked among a set of overloaded functions,
+- namely the one with rettype2 and parameters2. Two consecutive casts
+- are used to silence the "cannot find a match" and "invalid conversion"
+- errors that would otherwise occur. */
+-#if defined __cplusplus && defined GNULIB_NAMESPACE
+- /* The outer cast must be a reinterpret_cast.
+- The inner cast: When the function is defined as a set of overloaded
+- functions, it works as a static_cast<>, choosing the designated variant.
+- When the function is defined as a single variant, it works as a
+- reinterpret_cast<>. The parenthesized cast syntax works both ways. */
+-# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
+- namespace GNULIB_NAMESPACE \
+- { \
+- static rettype (*func) parameters = \
+- reinterpret_cast<rettype(*)parameters>( \
+- (rettype2(*)parameters2)(::func)); \
+- } \
+- _GL_EXTERN_C int _gl_cxxalias_dummy
+-#else
+-# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
+- _GL_EXTERN_C int _gl_cxxalias_dummy
+-#endif
+-
+-/* _GL_CXXALIASWARN (func);
+- causes a warning to be emitted when ::func is used but not when
+- GNULIB_NAMESPACE::func is used. func must be defined without overloaded
+- variants. */
+-#if defined __cplusplus && defined GNULIB_NAMESPACE
+-# define _GL_CXXALIASWARN(func) \
+- _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
+-# define _GL_CXXALIASWARN_1(func,namespace) \
+- _GL_CXXALIASWARN_2 (func, namespace)
+-/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
+- we enable the warning only when not optimizing. */
+-# if !__OPTIMIZE__
+-# define _GL_CXXALIASWARN_2(func,namespace) \
+- _GL_WARN_ON_USE (func, \
+- "The symbol ::" #func " refers to the system function. " \
+- "Use " #namespace "::" #func " instead.")
+-# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+-# define _GL_CXXALIASWARN_2(func,namespace) \
+- extern __typeof__ (func) func
+-# else
+-# define _GL_CXXALIASWARN_2(func,namespace) \
+- _GL_EXTERN_C int _gl_cxxalias_dummy
+-# endif
+-#else
+-# define _GL_CXXALIASWARN(func) \
+- _GL_EXTERN_C int _gl_cxxalias_dummy
+-#endif
+-
+-/* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
+- causes a warning to be emitted when the given overloaded variant of ::func
+- is used but not when GNULIB_NAMESPACE::func is used. */
+-#if defined __cplusplus && defined GNULIB_NAMESPACE
+-# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
+- _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
+- GNULIB_NAMESPACE)
+-# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
+- _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
+-/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
+- we enable the warning only when not optimizing. */
+-# if !__OPTIMIZE__
+-# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
+- _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
+- "The symbol ::" #func " refers to the system function. " \
+- "Use " #namespace "::" #func " instead.")
+-# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+-# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
+- extern __typeof__ (func) func
+-# else
+-# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
+- _GL_EXTERN_C int _gl_cxxalias_dummy
+-# endif
+-#else
+-# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
+- _GL_EXTERN_C int _gl_cxxalias_dummy
+-#endif
+-
+-#endif /* _GL_CXXDEFS_H */
+diff -Naurp libiconv-1.14.org//build-aux/snippet/_Noreturn.h libiconv-1.14/build-aux/snippet/_Noreturn.h
+--- libiconv-1.14.org//build-aux/snippet/_Noreturn.h 2011-08-07 06:22:07.000000000 -0700
++++ libiconv-1.14/build-aux/snippet/_Noreturn.h 1969-12-31 16:00:00.000000000 -0800
+@@ -1,10 +0,0 @@
+-#ifndef _Noreturn
+-# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
+- || 0x5110 <= __SUNPRO_C)
+-# define _Noreturn __attribute__ ((__noreturn__))
+-# elif 1200 <= _MSC_VER
+-# define _Noreturn __declspec (noreturn)
+-# else
+-# define _Noreturn
+-# endif
+-#endif
+diff -Naurp libiconv-1.14.org//build-aux/snippet/warn-on-use.h libiconv-1.14/build-aux/snippet/warn-on-use.h
+--- libiconv-1.14.org//build-aux/snippet/warn-on-use.h 2011-08-07 06:22:07.000000000 -0700
++++ libiconv-1.14/build-aux/snippet/warn-on-use.h 1969-12-31 16:00:00.000000000 -0800
+@@ -1,109 +0,0 @@
+-/* A C macro for emitting warnings if a function is used.
+- Copyright (C) 2010-2011 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
+- (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/>. */
+-
+-/* _GL_WARN_ON_USE (function, "literal string") issues a declaration
+- for FUNCTION which will then trigger a compiler warning containing
+- the text of "literal string" anywhere that function is called, if
+- supported by the compiler. If the compiler does not support this
+- feature, the macro expands to an unused extern declaration.
+-
+- This macro is useful for marking a function as a potential
+- portability trap, with the intent that "literal string" include
+- instructions on the replacement function that should be used
+- instead. However, one of the reasons that a function is a
+- portability trap is if it has the wrong signature. Declaring
+- FUNCTION with a different signature in C is a compilation error, so
+- this macro must use the same type as any existing declaration so
+- that programs that avoid the problematic FUNCTION do not fail to
+- compile merely because they included a header that poisoned the
+- function. But this implies that _GL_WARN_ON_USE is only safe to
+- use if FUNCTION is known to already have a declaration. Use of
+- this macro implies that there must not be any other macro hiding
+- the declaration of FUNCTION; but undefining FUNCTION first is part
+- of the poisoning process anyway (although for symbols that are
+- provided only via a macro, the result is a compilation error rather
+- than a warning containing "literal string"). Also note that in
+- C++, it is only safe to use if FUNCTION has no overloads.
+-
+- For an example, it is possible to poison 'getline' by:
+- - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]],
+- [getline]) in configure.ac, which potentially defines
+- HAVE_RAW_DECL_GETLINE
+- - adding this code to a header that wraps the system <stdio.h>:
+- #undef getline
+- #if HAVE_RAW_DECL_GETLINE
+- _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but"
+- "not universally present; use the gnulib module getline");
+- #endif
+-
+- It is not possible to directly poison global variables. But it is
+- possible to write a wrapper accessor function, and poison that
+- (less common usage, like &environ, will cause a compilation error
+- rather than issue the nice warning, but the end result of informing
+- the developer about their portability problem is still achieved):
+- #if HAVE_RAW_DECL_ENVIRON
+- static inline char ***rpl_environ (void) { return &environ; }
+- _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
+- # undef environ
+- # define environ (*rpl_environ ())
+- #endif
+- */
+-#ifndef _GL_WARN_ON_USE
+-
+-# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
+-/* A compiler attribute is available in gcc versions 4.3.0 and later. */
+-# define _GL_WARN_ON_USE(function, message) \
+-extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
+-# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+-/* Verify the existence of the function. */
+-# define _GL_WARN_ON_USE(function, message) \
+-extern __typeof__ (function) function
+-# else /* Unsupported. */
+-# define _GL_WARN_ON_USE(function, message) \
+-_GL_WARN_EXTERN_C int _gl_warn_on_use
+-# endif
+-#endif
+-
+-/* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
+- is like _GL_WARN_ON_USE (function, "string"), except that the function is
+- declared with the given prototype, consisting of return type, parameters,
+- and attributes.
+- This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
+- not work in this case. */
+-#ifndef _GL_WARN_ON_USE_CXX
+-# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
+-# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
+-extern rettype function parameters_and_attributes \
+- __attribute__ ((__warning__ (msg)))
+-# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+-/* Verify the existence of the function. */
+-# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
+-extern rettype function parameters_and_attributes
+-# else /* Unsupported. */
+-# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
+-_GL_WARN_EXTERN_C int _gl_warn_on_use
+-# endif
+-#endif
+-
+-/* _GL_WARN_EXTERN_C declaration;
+- performs the declaration with C linkage. */
+-#ifndef _GL_WARN_EXTERN_C
+-# if defined __cplusplus
+-# define _GL_WARN_EXTERN_C extern "C"
+-# else
+-# define _GL_WARN_EXTERN_C extern
+-# endif
+-#endif
+diff -Naurp libiconv-1.14.org//build-aux/warn-on-use.h libiconv-1.14/build-aux/warn-on-use.h
+--- libiconv-1.14.org//build-aux/warn-on-use.h 1969-12-31 16:00:00.000000000 -0800
++++ libiconv-1.14/build-aux/warn-on-use.h 2012-01-08 02:07:39.950484439 -0800
+@@ -0,0 +1,109 @@
++/* A C macro for emitting warnings if a function is used.
++ Copyright (C) 2010-2011 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
++ (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/>. */
++
++/* _GL_WARN_ON_USE (function, "literal string") issues a declaration
++ for FUNCTION which will then trigger a compiler warning containing
++ the text of "literal string" anywhere that function is called, if
++ supported by the compiler. If the compiler does not support this
++ feature, the macro expands to an unused extern declaration.
++
++ This macro is useful for marking a function as a potential
++ portability trap, with the intent that "literal string" include
++ instructions on the replacement function that should be used
++ instead. However, one of the reasons that a function is a
++ portability trap is if it has the wrong signature. Declaring
++ FUNCTION with a different signature in C is a compilation error, so
++ this macro must use the same type as any existing declaration so
++ that programs that avoid the problematic FUNCTION do not fail to
++ compile merely because they included a header that poisoned the
++ function. But this implies that _GL_WARN_ON_USE is only safe to
++ use if FUNCTION is known to already have a declaration. Use of
++ this macro implies that there must not be any other macro hiding
++ the declaration of FUNCTION; but undefining FUNCTION first is part
++ of the poisoning process anyway (although for symbols that are
++ provided only via a macro, the result is a compilation error rather
++ than a warning containing "literal string"). Also note that in
++ C++, it is only safe to use if FUNCTION has no overloads.
++
++ For an example, it is possible to poison 'getline' by:
++ - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]],
++ [getline]) in configure.ac, which potentially defines
++ HAVE_RAW_DECL_GETLINE
++ - adding this code to a header that wraps the system <stdio.h>:
++ #undef getline
++ #if HAVE_RAW_DECL_GETLINE
++ _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but"
++ "not universally present; use the gnulib module getline");
++ #endif
++
++ It is not possible to directly poison global variables. But it is
++ possible to write a wrapper accessor function, and poison that
++ (less common usage, like &environ, will cause a compilation error
++ rather than issue the nice warning, but the end result of informing
++ the developer about their portability problem is still achieved):
++ #if HAVE_RAW_DECL_ENVIRON
++ static inline char ***rpl_environ (void) { return &environ; }
++ _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
++ # undef environ
++ # define environ (*rpl_environ ())
++ #endif
++ */
++#ifndef _GL_WARN_ON_USE
++
++# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
++/* A compiler attribute is available in gcc versions 4.3.0 and later. */
++# define _GL_WARN_ON_USE(function, message) \
++extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
++# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
++/* Verify the existence of the function. */
++# define _GL_WARN_ON_USE(function, message) \
++extern __typeof__ (function) function
++# else /* Unsupported. */
++# define _GL_WARN_ON_USE(function, message) \
++_GL_WARN_EXTERN_C int _gl_warn_on_use
++# endif
++#endif
++
++/* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
++ is like _GL_WARN_ON_USE (function, "string"), except that the function is
++ declared with the given prototype, consisting of return type, parameters,
++ and attributes.
++ This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
++ not work in this case. */
++#ifndef _GL_WARN_ON_USE_CXX
++# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
++# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
++extern rettype function parameters_and_attributes \
++ __attribute__ ((__warning__ (msg)))
++# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
++/* Verify the existence of the function. */
++# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
++extern rettype function parameters_and_attributes
++# else /* Unsupported. */
++# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
++_GL_WARN_EXTERN_C int _gl_warn_on_use
++# endif
++#endif
++
++/* _GL_WARN_EXTERN_C declaration;
++ performs the declaration with C linkage. */
++#ifndef _GL_WARN_EXTERN_C
++# if defined __cplusplus
++# define _GL_WARN_EXTERN_C extern "C"
++# else
++# define _GL_WARN_EXTERN_C extern
++# endif
++#endif
+diff -Naurp libiconv-1.14.org//srclib/allocator.h libiconv-1.14/srclib/allocator.h
+--- libiconv-1.14.org//srclib/allocator.h 2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/allocator.h 2012-01-08 02:07:40.050484444 -0800
+@@ -45,11 +45,10 @@ struct allocator
+ /* Call FREE to free memory, like 'free'. */
+ void (*free) (void *);
+
+- /* If nonnull, call DIE (SIZE) if MALLOC (SIZE) or REALLOC (...,
+- SIZE) fails. DIE should not return. SIZE should equal SIZE_MAX
+- if size_t overflow was detected while calculating sizes to be
+- passed to MALLOC or REALLOC. */
+- void (*die) (size_t);
++ /* If nonnull, call DIE if MALLOC or REALLOC fails. DIE should not
++ return. DIE can be used by code that detects memory overflow
++ while calculating sizes to be passed to MALLOC or REALLOC. */
++ void (*die) (void);
+ };
+
+ /* An allocator using the stdlib functions and a null DIE function. */
+diff -Naurp libiconv-1.14.org//srclib/canonicalize-lgpl.c libiconv-1.14/srclib/canonicalize-lgpl.c
+--- libiconv-1.14.org//srclib/canonicalize-lgpl.c 2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/canonicalize-lgpl.c 2012-01-08 02:07:40.094484446 -0800
+@@ -125,7 +125,7 @@ __realpath (const char *name, char *reso
+ #else
+ path_max = pathconf (name, _PC_PATH_MAX);
+ if (path_max <= 0)
+- path_max = 8192;
++ path_max = 1024;
+ #endif
+
+ if (resolved == NULL)
+diff -Naurp libiconv-1.14.org//srclib/careadlinkat.c libiconv-1.14/srclib/careadlinkat.c
+--- libiconv-1.14.org//srclib/careadlinkat.c 2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/careadlinkat.c 2012-01-08 02:07:40.102484445 -0800
+@@ -133,7 +133,6 @@ careadlinkat (int fd, char const *filena
+ if (buf == stack_buf)
+ {
+ char *b = (char *) alloc->allocate (link_size);
+- buf_size = link_size;
+ if (! b)
+ break;
+ memcpy (b, buf, link_size);
+@@ -157,11 +156,6 @@ careadlinkat (int fd, char const *filena
+ buf_size *= 2;
+ else if (buf_size < buf_size_max)
+ buf_size = buf_size_max;
+- else if (buf_size_max < SIZE_MAX)
+- {
+- errno = ENAMETOOLONG;
+- return NULL;
+- }
+ else
+ break;
+ buf = (char *) alloc->allocate (buf_size);
+@@ -169,7 +163,7 @@ careadlinkat (int fd, char const *filena
+ while (buf);
+
+ if (alloc->die)
+- alloc->die (buf_size);
++ alloc->die ();
+ errno = ENOMEM;
+ return NULL;
+ }
+diff -Naurp libiconv-1.14.org//srclib/errno.in.h libiconv-1.14/srclib/errno.in.h
+--- libiconv-1.14.org//srclib/errno.in.h 2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/errno.in.h 2012-01-08 02:07:40.122484446 -0800
+@@ -16,7 +16,7 @@
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+-#ifndef _@GUARD_PREFIX@_ERRNO_H
++#ifndef _GL_ERRNO_H
+
+ #if __GNUC__ >= 3
+ @PRAGMA_SYSTEM_HEADER@
+@@ -26,8 +26,8 @@
+ /* The include_next requires a split double-inclusion guard. */
+ #@INCLUDE_NEXT@ @NEXT_ERRNO_H@
+
+-#ifndef _@GUARD_PREFIX@_ERRNO_H
+-#define _@GUARD_PREFIX@_ERRNO_H
++#ifndef _GL_ERRNO_H
++#define _GL_ERRNO_H
+
+
+ /* On native Windows platforms, many macros are not defined. */
+@@ -147,16 +147,6 @@
+ # define GNULIB_defined_ENOTSUP 1
+ # endif
+
+-# ifndef ENETRESET
+-# define ENETRESET 2011
+-# define GNULIB_defined_ENETRESET 1
+-# endif
+-
+-# ifndef ECONNABORTED
+-# define ECONNABORTED 2012
+-# define GNULIB_defined_ECONNABORTED 1
+-# endif
+-
+ # ifndef ESTALE
+ # define ESTALE 2009
+ # define GNULIB_defined_ESTALE 1
+@@ -173,5 +163,5 @@
+ # endif
+
+
+-#endif /* _@GUARD_PREFIX@_ERRNO_H */
+-#endif /* _@GUARD_PREFIX@_ERRNO_H */
++#endif /* _GL_ERRNO_H */
++#endif /* _GL_ERRNO_H */
+diff -Naurp libiconv-1.14.org//srclib/error.c libiconv-1.14/srclib/error.c
+--- libiconv-1.14.org//srclib/error.c 2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/error.c 2012-01-08 02:07:40.134484448 -0800
+@@ -97,15 +97,11 @@ extern void __error_at_line (int status,
+ /* The gnulib override of fcntl is not needed in this file. */
+ # undef fcntl
+
+-# if !HAVE_DECL_STRERROR_R
++# if !HAVE_DECL_STRERROR_R && STRERROR_R_CHAR_P
+ # ifndef HAVE_DECL_STRERROR_R
+ "this configure-time declaration test was not run"
+ # endif
+-# if STRERROR_R_CHAR_P
+ char *strerror_r ();
+-# else
+-int strerror_r ();
+-# endif
+ # endif
+
+ /* The calling program should define program_name and set it to the
+diff -Naurp libiconv-1.14.org//srclib/fcntl.in.h libiconv-1.14/srclib/fcntl.in.h
+--- libiconv-1.14.org//srclib/fcntl.in.h 2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/fcntl.in.h 2012-01-08 02:07:40.154484449 -0800
+@@ -40,7 +40,7 @@
+ #else
+ /* Normal invocation convention. */
+
+-#ifndef _@GUARD_PREFIX@_FCNTL_H
++#ifndef _GL_FCNTL_H
+
+ #include <sys/types.h>
+ /* On some systems other than glibc, <sys/stat.h> is a prerequisite of
+@@ -55,8 +55,8 @@
+ /* The include_next requires a split double-inclusion guard. */
+ #@INCLUDE_NEXT@ @NEXT_FCNTL_H@
+
+-#ifndef _@GUARD_PREFIX@_FCNTL_H
+-#define _@GUARD_PREFIX@_FCNTL_H
++#ifndef _GL_FCNTL_H
++#define _GL_FCNTL_H
+
+ #ifndef __GLIBC__ /* Avoid namespace pollution on glibc systems. */
+ # include <unistd.h>
+@@ -320,6 +320,6 @@ _GL_WARN_ON_USE (openat, "openat is not
+ #endif
+
+
+-#endif /* _@GUARD_PREFIX@_FCNTL_H */
+-#endif /* _@GUARD_PREFIX@_FCNTL_H */
++#endif /* _GL_FCNTL_H */
++#endif /* _GL_FCNTL_H */
+ #endif
+diff -Naurp libiconv-1.14.org//srclib/intprops.h libiconv-1.14/srclib/intprops.h
+--- libiconv-1.14.org//srclib/intprops.h 2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/intprops.h 2012-01-08 02:07:40.174484450 -0800
+@@ -22,13 +22,14 @@
+
+ #include <limits.h>
+
+-/* Return an integer value, converted to the same type as the integer
+- expression E after integer type promotion. V is the unconverted value. */
+-#define _GL_INT_CONVERT(e, v) (0 * (e) + (v))
++/* Return a integer value, converted to the same type as the integer
++ expression E after integer type promotion. V is the unconverted value.
++ E should not have side effects. */
++#define _GL_INT_CONVERT(e, v) ((e) - (e) + (v))
+
+ /* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see
+ <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00406.html>. */
+-#define _GL_INT_NEGATE_CONVERT(e, v) (0 * (e) - (v))
++#define _GL_INT_NEGATE_CONVERT(e, v) ((e) - (e) - (v))
+
+ /* The extra casts in the following macros work around compiler bugs,
+ e.g., in Cray C 5.0.3.0. */
+@@ -52,7 +53,7 @@
+ #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
+
+ /* Return 1 if the integer expression E, after integer promotion, has
+- a signed type. */
++ a signed type. E should not have side effects. */
+ #define _GL_INT_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0)
+
+
+@@ -310,10 +311,13 @@
+ /* Return 1 if the expression A <op> B would overflow,
+ where OP_RESULT_OVERFLOW (A, B, MIN, MAX) does the actual test,
+ assuming MIN and MAX are the minimum and maximum for the result type.
+- Arguments should be free of side effects. */
++
++ This macro assumes that A | B is a valid integer if both A and B are,
++ which is true of all known practical hosts. If this is a problem
++ for you, please let us know how to fix it for your host. */
+ #define _GL_BINARY_OP_OVERFLOW(a, b, op_result_overflow) \
+ op_result_overflow (a, b, \
+- _GL_INT_MINIMUM (0 * (b) + (a)), \
+- _GL_INT_MAXIMUM (0 * (b) + (a)))
++ _GL_INT_MINIMUM ((a) | (b)), \
++ _GL_INT_MAXIMUM ((a) | (b)))
+
+ #endif /* _GL_INTPROPS_H */
+diff -Naurp libiconv-1.14.org//srclib/Makefile.gnulib libiconv-1.14/srclib/Makefile.gnulib
+--- libiconv-1.14.org//srclib/Makefile.gnulib 2012-01-08 02:05:18.754477606 -0800
++++ libiconv-1.14/srclib/Makefile.gnulib 2012-01-08 02:07:43.138484592 -0800
+@@ -9,7 +9,7 @@
+ # the same distribution terms as the rest of that program.
+ #
+ # Generated by gnulib-tool.
+-# Reproduce by: gnulib-tool --import --dir=. --local-dir=gnulib-local --lib=libicrt --source-base=srclib --m4-base=srcm4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --makefile-name=Makefile.gnulib --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files binary-io error gettext gettext-h libiconv-misc mbstate memmove progname relocatable-prog safe-read sigpipe stdio stdlib strerror unistd uniwidth/width unlocked-io xalloc
++# Reproduce by: gnulib-tool --import --dir=. --local-dir=gnulib-local --lib=libicrt --source-base=srclib --m4-base=srcm4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --makefile-name=Makefile.gnulib --no-libtool --macro-prefix=gl --no-vc-files binary-io error gettext gettext-h libiconv-misc mbstate memmove progname relocatable relocatable-prog safe-read sigpipe stdio stdlib strerror unistd uniwidth/width unlocked-io xalloc
+
+
+ MOSTLYCLEANFILES += core *.stackdump
+@@ -60,12 +60,60 @@ EXTRA_DIST += areadlink.h
+
+ ## end gnulib module areadlink
+
++## begin gnulib module arg-nonnull
++
++# The BUILT_SOURCES created by this Makefile snippet are not used via #include
++# statements but through direct file reference. Therefore this snippet must be
++# present in all Makefile.am that need it. This is ensured by the applicability
++# 'all' defined above.
++
++BUILT_SOURCES += arg-nonnull.h
++# The arg-nonnull.h that gets inserted into generated .h files is the same as
++# build-aux/arg-nonnull.h, except that it has the copyright header cut off.
++arg-nonnull.h: $(top_srcdir)/build-aux/arg-nonnull.h
++ $(AM_V_GEN)rm -f $@-t $@ && \
++ sed -n -e '/GL_ARG_NONNULL/,$$p' \
++ < $(top_srcdir)/build-aux/arg-nonnull.h \
++ > $@-t && \
++ mv $@-t $@
++MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t
++
++ARG_NONNULL_H=arg-nonnull.h
++
++EXTRA_DIST += $(top_srcdir)/build-aux/arg-nonnull.h
++
++## end gnulib module arg-nonnull
++
+ ## begin gnulib module binary-io
+
+ libicrt_a_SOURCES += binary-io.h
+
+ ## end gnulib module binary-io
+
++## begin gnulib module c++defs
++
++# The BUILT_SOURCES created by this Makefile snippet are not used via #include
++# statements but through direct file reference. Therefore this snippet must be
++# present in all Makefile.am that need it. This is ensured by the applicability
++# 'all' defined above.
++
++BUILT_SOURCES += c++defs.h
++# The c++defs.h that gets inserted into generated .h files is the same as
++# build-aux/c++defs.h, except that it has the copyright header cut off.
++c++defs.h: $(top_srcdir)/build-aux/c++defs.h
++ $(AM_V_GEN)rm -f $@-t $@ && \
++ sed -n -e '/_GL_CXXDEFS/,$$p' \
++ < $(top_srcdir)/build-aux/c++defs.h \
++ > $@-t && \
++ mv $@-t $@
++MOSTLYCLEANFILES += c++defs.h c++defs.h-t
++
++CXXDEFS_H=c++defs.h
++
++EXTRA_DIST += $(top_srcdir)/build-aux/c++defs.h
++
++## end gnulib module c++defs
++
+ ## begin gnulib module canonicalize-lgpl
+
+
+@@ -100,8 +148,7 @@ if GL_GENERATE_ERRNO_H
+ errno.h: errno.in.h $(top_builddir)/config.status
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+- sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+- -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
++ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \
+@@ -142,15 +189,14 @@ BUILT_SOURCES += fcntl.h
+ fcntl.h: fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+- sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+- -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
++ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \
+- -e 's/@''GNULIB_FCNTL''@/$(GNULIB_FCNTL)/g' \
+- -e 's/@''GNULIB_NONBLOCKING''@/$(GNULIB_NONBLOCKING)/g' \
+- -e 's/@''GNULIB_OPEN''@/$(GNULIB_OPEN)/g' \
+- -e 's/@''GNULIB_OPENAT''@/$(GNULIB_OPENAT)/g' \
++ -e 's|@''GNULIB_FCNTL''@|$(GNULIB_FCNTL)|g' \
++ -e 's|@''GNULIB_NONBLOCKING''@|$(GNULIB_NONBLOCKING)|g' \
++ -e 's|@''GNULIB_OPEN''@|$(GNULIB_OPEN)|g' \
++ -e 's|@''GNULIB_OPENAT''@|$(GNULIB_OPENAT)|g' \
+ -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \
+ -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \
+ -e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \
+@@ -297,7 +343,7 @@ EXTRA_DIST += $(top_srcdir)/build-aux/co
+ ## begin gnulib module relocatable-prog-wrapper
+
+
+-EXTRA_DIST += allocator.c allocator.h areadlink.c areadlink.h c-ctype.c c-ctype.h canonicalize-lgpl.c careadlinkat.c careadlinkat.h malloca.c malloca.h progname.c progname.h progreloc.c readlink.c relocatable.c relocatable.h relocwrapper.c setenv.c
++EXTRA_DIST += allocator.c allocator.h areadlink.c areadlink.h c-ctype.c c-ctype.h canonicalize-lgpl.c careadlinkat.c careadlinkat.h malloca.c malloca.h progname.c progname.h progreloc.c readlink.c relocatable.c relocatable.h relocwrapper.c setenv.c strerror.c
+
+ EXTRA_DIST += $(top_srcdir)/build-aux/install-reloc
+
+@@ -305,9 +351,10 @@ EXTRA_DIST += $(top_srcdir)/build-aux/in
+
+ ## begin gnulib module safe-read
+
+-libicrt_a_SOURCES += safe-read.c
+
+-EXTRA_DIST += safe-read.h
++EXTRA_DIST += safe-read.c safe-read.h
++
++EXTRA_libicrt_a_SOURCES += safe-read.c
+
+ ## end gnulib module safe-read
+
+@@ -320,24 +367,20 @@ BUILT_SOURCES += signal.h
+ signal.h: signal.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+- sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+- -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
++ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SIGNAL_H''@|$(NEXT_SIGNAL_H)|g' \
+- -e 's|@''GNULIB_PTHREAD_SIGMASK''@|$(GNULIB_PTHREAD_SIGMASK)|g' \
+- -e 's/@''GNULIB_SIGNAL_H_SIGPIPE''@/$(GNULIB_SIGNAL_H_SIGPIPE)/g' \
+- -e 's/@''GNULIB_SIGPROCMASK''@/$(GNULIB_SIGPROCMASK)/g' \
+- -e 's/@''GNULIB_SIGACTION''@/$(GNULIB_SIGACTION)/g' \
++ -e 's|@''GNULIB_SIGNAL_H_SIGPIPE''@|$(GNULIB_SIGNAL_H_SIGPIPE)|g' \
++ -e 's|@''GNULIB_SIGPROCMASK''@|$(GNULIB_SIGPROCMASK)|g' \
++ -e 's|@''GNULIB_SIGACTION''@|$(GNULIB_SIGACTION)|g' \
+ -e 's|@''HAVE_POSIX_SIGNALBLOCKING''@|$(HAVE_POSIX_SIGNALBLOCKING)|g' \
+- -e 's|@''HAVE_PTHREAD_SIGMASK''@|$(HAVE_PTHREAD_SIGMASK)|g' \
+ -e 's|@''HAVE_SIGSET_T''@|$(HAVE_SIGSET_T)|g' \
+ -e 's|@''HAVE_SIGINFO_T''@|$(HAVE_SIGINFO_T)|g' \
+ -e 's|@''HAVE_SIGACTION''@|$(HAVE_SIGACTION)|g' \
+ -e 's|@''HAVE_STRUCT_SIGACTION_SA_SIGACTION''@|$(HAVE_STRUCT_SIGACTION_SA_SIGACTION)|g' \
+ -e 's|@''HAVE_TYPE_VOLATILE_SIG_ATOMIC_T''@|$(HAVE_TYPE_VOLATILE_SIG_ATOMIC_T)|g' \
+ -e 's|@''HAVE_SIGHANDLER_T''@|$(HAVE_SIGHANDLER_T)|g' \
+- -e 's|@''REPLACE_PTHREAD_SIGMASK''@|$(REPLACE_PTHREAD_SIGMASK)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+@@ -368,87 +411,6 @@ EXTRA_libicrt_a_SOURCES += sigprocmask.c
+
+ ## end gnulib module sigprocmask
+
+-## begin gnulib module snippet/_Noreturn
+-
+-# Because this Makefile snippet defines a variable used by other
+-# gnulib Makefile snippets, it must be present in all Makefile.am that
+-# need it. This is ensured by the applicability 'all' defined above.
+-
+-_NORETURN_H=$(top_srcdir)/build-aux/snippet/_Noreturn.h
+-
+-EXTRA_DIST += $(top_srcdir)/build-aux/snippet/_Noreturn.h
+-
+-## end gnulib module snippet/_Noreturn
+-
+-## begin gnulib module snippet/arg-nonnull
+-
+-# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+-# statements but through direct file reference. Therefore this snippet must be
+-# present in all Makefile.am that need it. This is ensured by the applicability
+-# 'all' defined above.
+-
+-BUILT_SOURCES += arg-nonnull.h
+-# The arg-nonnull.h that gets inserted into generated .h files is the same as
+-# build-aux/snippet/arg-nonnull.h, except that it has the copyright header cut
+-# off.
+-arg-nonnull.h: $(top_srcdir)/build-aux/snippet/arg-nonnull.h
+- $(AM_V_GEN)rm -f $@-t $@ && \
+- sed -n -e '/GL_ARG_NONNULL/,$$p' \
+- < $(top_srcdir)/build-aux/snippet/arg-nonnull.h \
+- > $@-t && \
+- mv $@-t $@
+-MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t
+-
+-ARG_NONNULL_H=arg-nonnull.h
+-
+-EXTRA_DIST += $(top_srcdir)/build-aux/snippet/arg-nonnull.h
+-
+-## end gnulib module snippet/arg-nonnull
+-
+-## begin gnulib module snippet/c++defs
+-
+-# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+-# statements but through direct file reference. Therefore this snippet must be
+-# present in all Makefile.am that need it. This is ensured by the applicability
+-# 'all' defined above.
+-
+-BUILT_SOURCES += c++defs.h
+-# The c++defs.h that gets inserted into generated .h files is the same as
+-# build-aux/snippet/c++defs.h, except that it has the copyright header cut off.
+-c++defs.h: $(top_srcdir)/build-aux/snippet/c++defs.h
+- $(AM_V_GEN)rm -f $@-t $@ && \
+- sed -n -e '/_GL_CXXDEFS/,$$p' \
+- < $(top_srcdir)/build-aux/snippet/c++defs.h \
+- > $@-t && \
+- mv $@-t $@
+-MOSTLYCLEANFILES += c++defs.h c++defs.h-t
+-
+-CXXDEFS_H=c++defs.h
+-
+-EXTRA_DIST += $(top_srcdir)/build-aux/snippet/c++defs.h
+-
+-## end gnulib module snippet/c++defs
+-
+-## begin gnulib module snippet/warn-on-use
+-
+-BUILT_SOURCES += warn-on-use.h
+-# The warn-on-use.h that gets inserted into generated .h files is the same as
+-# build-aux/snippet/warn-on-use.h, except that it has the copyright header cut
+-# off.
+-warn-on-use.h: $(top_srcdir)/build-aux/snippet/warn-on-use.h
+- $(AM_V_GEN)rm -f $@-t $@ && \
+- sed -n -e '/^.ifndef/,$$p' \
+- < $(top_srcdir)/build-aux/snippet/warn-on-use.h \
+- > $@-t && \
+- mv $@-t $@
+-MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t
+-
+-WARN_ON_USE_H=warn-on-use.h
+-
+-EXTRA_DIST += $(top_srcdir)/build-aux/snippet/warn-on-use.h
+-
+-## end gnulib module snippet/warn-on-use
+-
+ ## begin gnulib module stat
+
+
+@@ -491,8 +453,7 @@ if GL_GENERATE_STDDEF_H
+ stddef.h: stddef.in.h $(top_builddir)/config.status
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+- sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+- -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
++ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \
+@@ -521,8 +482,7 @@ if GL_GENERATE_STDINT_H
+ stdint.h: stdint.in.h $(top_builddir)/config.status
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+- sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+- -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
++ sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@@ -570,63 +530,62 @@ BUILT_SOURCES += stdio.h
+ stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+- sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+- -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
++ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
+- -e 's/@''GNULIB_DPRINTF''@/$(GNULIB_DPRINTF)/g' \
+- -e 's/@''GNULIB_FCLOSE''@/$(GNULIB_FCLOSE)/g' \
+- -e 's/@''GNULIB_FFLUSH''@/$(GNULIB_FFLUSH)/g' \
+- -e 's/@''GNULIB_FGETC''@/$(GNULIB_FGETC)/g' \
+- -e 's/@''GNULIB_FGETS''@/$(GNULIB_FGETS)/g' \
+- -e 's/@''GNULIB_FOPEN''@/$(GNULIB_FOPEN)/g' \
+- -e 's/@''GNULIB_FPRINTF''@/$(GNULIB_FPRINTF)/g' \
+- -e 's/@''GNULIB_FPRINTF_POSIX''@/$(GNULIB_FPRINTF_POSIX)/g' \
+- -e 's/@''GNULIB_FPURGE''@/$(GNULIB_FPURGE)/g' \
+- -e 's/@''GNULIB_FPUTC''@/$(GNULIB_FPUTC)/g' \
+- -e 's/@''GNULIB_FPUTS''@/$(GNULIB_FPUTS)/g' \
+- -e 's/@''GNULIB_FREAD''@/$(GNULIB_FREAD)/g' \
+- -e 's/@''GNULIB_FREOPEN''@/$(GNULIB_FREOPEN)/g' \
+- -e 's/@''GNULIB_FSCANF''@/$(GNULIB_FSCANF)/g' \
+- -e 's/@''GNULIB_FSEEK''@/$(GNULIB_FSEEK)/g' \
+- -e 's/@''GNULIB_FSEEKO''@/$(GNULIB_FSEEKO)/g' \
+- -e 's/@''GNULIB_FTELL''@/$(GNULIB_FTELL)/g' \
+- -e 's/@''GNULIB_FTELLO''@/$(GNULIB_FTELLO)/g' \
+- -e 's/@''GNULIB_FWRITE''@/$(GNULIB_FWRITE)/g' \
+- -e 's/@''GNULIB_GETC''@/$(GNULIB_GETC)/g' \
+- -e 's/@''GNULIB_GETCHAR''@/$(GNULIB_GETCHAR)/g' \
+- -e 's/@''GNULIB_GETDELIM''@/$(GNULIB_GETDELIM)/g' \
+- -e 's/@''GNULIB_GETLINE''@/$(GNULIB_GETLINE)/g' \
+- -e 's/@''GNULIB_GETS''@/$(GNULIB_GETS)/g' \
+- -e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GNULIB_OBSTACK_PRINTF)/g' \
+- -e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GNULIB_OBSTACK_PRINTF_POSIX)/g' \
+- -e 's/@''GNULIB_PERROR''@/$(GNULIB_PERROR)/g' \
+- -e 's/@''GNULIB_POPEN''@/$(GNULIB_POPEN)/g' \
+- -e 's/@''GNULIB_PRINTF''@/$(GNULIB_PRINTF)/g' \
+- -e 's/@''GNULIB_PRINTF_POSIX''@/$(GNULIB_PRINTF_POSIX)/g' \
+- -e 's/@''GNULIB_PUTC''@/$(GNULIB_PUTC)/g' \
+- -e 's/@''GNULIB_PUTCHAR''@/$(GNULIB_PUTCHAR)/g' \
+- -e 's/@''GNULIB_PUTS''@/$(GNULIB_PUTS)/g' \
+- -e 's/@''GNULIB_REMOVE''@/$(GNULIB_REMOVE)/g' \
+- -e 's/@''GNULIB_RENAME''@/$(GNULIB_RENAME)/g' \
+- -e 's/@''GNULIB_RENAMEAT''@/$(GNULIB_RENAMEAT)/g' \
+- -e 's/@''GNULIB_SCANF''@/$(GNULIB_SCANF)/g' \
+- -e 's/@''GNULIB_SNPRINTF''@/$(GNULIB_SNPRINTF)/g' \
+- -e 's/@''GNULIB_SPRINTF_POSIX''@/$(GNULIB_SPRINTF_POSIX)/g' \
+- -e 's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GNULIB_STDIO_H_NONBLOCKING)/g' \
+- -e 's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GNULIB_STDIO_H_SIGPIPE)/g' \
+- -e 's/@''GNULIB_TMPFILE''@/$(GNULIB_TMPFILE)/g' \
+- -e 's/@''GNULIB_VASPRINTF''@/$(GNULIB_VASPRINTF)/g' \
+- -e 's/@''GNULIB_VDPRINTF''@/$(GNULIB_VDPRINTF)/g' \
+- -e 's/@''GNULIB_VFPRINTF''@/$(GNULIB_VFPRINTF)/g' \
+- -e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GNULIB_VFPRINTF_POSIX)/g' \
+- -e 's/@''GNULIB_VFSCANF''@/$(GNULIB_VFSCANF)/g' \
+- -e 's/@''GNULIB_VSCANF''@/$(GNULIB_VSCANF)/g' \
+- -e 's/@''GNULIB_VPRINTF''@/$(GNULIB_VPRINTF)/g' \
+- -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GNULIB_VPRINTF_POSIX)/g' \
+- -e 's/@''GNULIB_VSNPRINTF''@/$(GNULIB_VSNPRINTF)/g' \
+- -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GNULIB_VSPRINTF_POSIX)/g' \
++ -e 's|@''GNULIB_DPRINTF''@|$(GNULIB_DPRINTF)|g' \
++ -e 's|@''GNULIB_FCLOSE''@|$(GNULIB_FCLOSE)|g' \
++ -e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \
++ -e 's|@''GNULIB_FGETC''@|$(GNULIB_FGETC)|g' \
++ -e 's|@''GNULIB_FGETS''@|$(GNULIB_FGETS)|g' \
++ -e 's|@''GNULIB_FOPEN''@|$(GNULIB_FOPEN)|g' \
++ -e 's|@''GNULIB_FPRINTF''@|$(GNULIB_FPRINTF)|g' \
++ -e 's|@''GNULIB_FPRINTF_POSIX''@|$(GNULIB_FPRINTF_POSIX)|g' \
++ -e 's|@''GNULIB_FPURGE''@|$(GNULIB_FPURGE)|g' \
++ -e 's|@''GNULIB_FPUTC''@|$(GNULIB_FPUTC)|g' \
++ -e 's|@''GNULIB_FPUTS''@|$(GNULIB_FPUTS)|g' \
++ -e 's|@''GNULIB_FREAD''@|$(GNULIB_FREAD)|g' \
++ -e 's|@''GNULIB_FREOPEN''@|$(GNULIB_FREOPEN)|g' \
++ -e 's|@''GNULIB_FSCANF''@|$(GNULIB_FSCANF)|g' \
++ -e 's|@''GNULIB_FSEEK''@|$(GNULIB_FSEEK)|g' \
++ -e 's|@''GNULIB_FSEEKO''@|$(GNULIB_FSEEKO)|g' \
++ -e 's|@''GNULIB_FTELL''@|$(GNULIB_FTELL)|g' \
++ -e 's|@''GNULIB_FTELLO''@|$(GNULIB_FTELLO)|g' \
++ -e 's|@''GNULIB_FWRITE''@|$(GNULIB_FWRITE)|g' \
++ -e 's|@''GNULIB_GETC''@|$(GNULIB_GETC)|g' \
++ -e 's|@''GNULIB_GETCHAR''@|$(GNULIB_GETCHAR)|g' \
++ -e 's|@''GNULIB_GETDELIM''@|$(GNULIB_GETDELIM)|g' \
++ -e 's|@''GNULIB_GETLINE''@|$(GNULIB_GETLINE)|g' \
++ -e 's|@''GNULIB_GETS''@|$(GNULIB_GETS)|g' \
++ -e 's|@''GNULIB_OBSTACK_PRINTF''@|$(GNULIB_OBSTACK_PRINTF)|g' \
++ -e 's|@''GNULIB_OBSTACK_PRINTF_POSIX''@|$(GNULIB_OBSTACK_PRINTF_POSIX)|g' \
++ -e 's|@''GNULIB_PERROR''@|$(GNULIB_PERROR)|g' \
++ -e 's|@''GNULIB_POPEN''@|$(GNULIB_POPEN)|g' \
++ -e 's|@''GNULIB_PRINTF''@|$(GNULIB_PRINTF)|g' \
++ -e 's|@''GNULIB_PRINTF_POSIX''@|$(GNULIB_PRINTF_POSIX)|g' \
++ -e 's|@''GNULIB_PUTC''@|$(GNULIB_PUTC)|g' \
++ -e 's|@''GNULIB_PUTCHAR''@|$(GNULIB_PUTCHAR)|g' \
++ -e 's|@''GNULIB_PUTS''@|$(GNULIB_PUTS)|g' \
++ -e 's|@''GNULIB_REMOVE''@|$(GNULIB_REMOVE)|g' \
++ -e 's|@''GNULIB_RENAME''@|$(GNULIB_RENAME)|g' \
++ -e 's|@''GNULIB_RENAMEAT''@|$(GNULIB_RENAMEAT)|g' \
++ -e 's|@''GNULIB_SCANF''@|$(GNULIB_SCANF)|g' \
++ -e 's|@''GNULIB_SNPRINTF''@|$(GNULIB_SNPRINTF)|g' \
++ -e 's|@''GNULIB_SPRINTF_POSIX''@|$(GNULIB_SPRINTF_POSIX)|g' \
++ -e 's|@''GNULIB_STDIO_H_NONBLOCKING''@|$(GNULIB_STDIO_H_NONBLOCKING)|g' \
++ -e 's|@''GNULIB_STDIO_H_SIGPIPE''@|$(GNULIB_STDIO_H_SIGPIPE)|g' \
++ -e 's|@''GNULIB_TMPFILE''@|$(GNULIB_TMPFILE)|g' \
++ -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \
++ -e 's|@''GNULIB_VDPRINTF''@|$(GNULIB_VDPRINTF)|g' \
++ -e 's|@''GNULIB_VFPRINTF''@|$(GNULIB_VFPRINTF)|g' \
++ -e 's|@''GNULIB_VFPRINTF_POSIX''@|$(GNULIB_VFPRINTF_POSIX)|g' \
++ -e 's|@''GNULIB_VFSCANF''@|$(GNULIB_VFSCANF)|g' \
++ -e 's|@''GNULIB_VSCANF''@|$(GNULIB_VSCANF)|g' \
++ -e 's|@''GNULIB_VPRINTF''@|$(GNULIB_VPRINTF)|g' \
++ -e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \
++ -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \
++ -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \
+ < $(srcdir)/stdio.in.h | \
+ sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
+ -e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \
+@@ -691,43 +650,41 @@ BUILT_SOURCES += stdlib.h
+
+ # We need the following in order to create <stdlib.h> when the system
+ # doesn't have one that works with the given compiler.
+-stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
+- $(_NORETURN_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
++stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+- sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+- -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
++ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \
+- -e 's/@''GNULIB__EXIT''@/$(GNULIB__EXIT)/g' \
+- -e 's/@''GNULIB_ATOLL''@/$(GNULIB_ATOLL)/g' \
+- -e 's/@''GNULIB_CALLOC_POSIX''@/$(GNULIB_CALLOC_POSIX)/g' \
+- -e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GNULIB_CANONICALIZE_FILE_NAME)/g' \
+- -e 's/@''GNULIB_GETLOADAVG''@/$(GNULIB_GETLOADAVG)/g' \
+- -e 's/@''GNULIB_GETSUBOPT''@/$(GNULIB_GETSUBOPT)/g' \
+- -e 's/@''GNULIB_GRANTPT''@/$(GNULIB_GRANTPT)/g' \
+- -e 's/@''GNULIB_MALLOC_POSIX''@/$(GNULIB_MALLOC_POSIX)/g' \
+- -e 's/@''GNULIB_MBTOWC''@/$(GNULIB_MBTOWC)/g' \
+- -e 's/@''GNULIB_MKDTEMP''@/$(GNULIB_MKDTEMP)/g' \
+- -e 's/@''GNULIB_MKOSTEMP''@/$(GNULIB_MKOSTEMP)/g' \
+- -e 's/@''GNULIB_MKOSTEMPS''@/$(GNULIB_MKOSTEMPS)/g' \
+- -e 's/@''GNULIB_MKSTEMP''@/$(GNULIB_MKSTEMP)/g' \
+- -e 's/@''GNULIB_MKSTEMPS''@/$(GNULIB_MKSTEMPS)/g' \
+- -e 's/@''GNULIB_PTSNAME''@/$(GNULIB_PTSNAME)/g' \
+- -e 's/@''GNULIB_PUTENV''@/$(GNULIB_PUTENV)/g' \
+- -e 's/@''GNULIB_RANDOM_R''@/$(GNULIB_RANDOM_R)/g' \
+- -e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \
+- -e 's/@''GNULIB_REALPATH''@/$(GNULIB_REALPATH)/g' \
+- -e 's/@''GNULIB_RPMATCH''@/$(GNULIB_RPMATCH)/g' \
+- -e 's/@''GNULIB_SETENV''@/$(GNULIB_SETENV)/g' \
+- -e 's/@''GNULIB_STRTOD''@/$(GNULIB_STRTOD)/g' \
+- -e 's/@''GNULIB_STRTOLL''@/$(GNULIB_STRTOLL)/g' \
+- -e 's/@''GNULIB_STRTOULL''@/$(GNULIB_STRTOULL)/g' \
+- -e 's/@''GNULIB_SYSTEM_POSIX''@/$(GNULIB_SYSTEM_POSIX)/g' \
+- -e 's/@''GNULIB_UNLOCKPT''@/$(GNULIB_UNLOCKPT)/g' \
+- -e 's/@''GNULIB_UNSETENV''@/$(GNULIB_UNSETENV)/g' \
+- -e 's/@''GNULIB_WCTOMB''@/$(GNULIB_WCTOMB)/g' \
++ -e 's|@''GNULIB__EXIT''@|$(GNULIB__EXIT)|g' \
++ -e 's|@''GNULIB_ATOLL''@|$(GNULIB_ATOLL)|g' \
++ -e 's|@''GNULIB_CALLOC_POSIX''@|$(GNULIB_CALLOC_POSIX)|g' \
++ -e 's|@''GNULIB_CANONICALIZE_FILE_NAME''@|$(GNULIB_CANONICALIZE_FILE_NAME)|g' \
++ -e 's|@''GNULIB_GETLOADAVG''@|$(GNULIB_GETLOADAVG)|g' \
++ -e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \
++ -e 's|@''GNULIB_GRANTPT''@|$(GNULIB_GRANTPT)|g' \
++ -e 's|@''GNULIB_MALLOC_POSIX''@|$(GNULIB_MALLOC_POSIX)|g' \
++ -e 's|@''GNULIB_MBTOWC''@|$(GNULIB_MBTOWC)|g' \
++ -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \
++ -e 's|@''GNULIB_MKOSTEMP''@|$(GNULIB_MKOSTEMP)|g' \
++ -e 's|@''GNULIB_MKOSTEMPS''@|$(GNULIB_MKOSTEMPS)|g' \
++ -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \
++ -e 's|@''GNULIB_MKSTEMPS''@|$(GNULIB_MKSTEMPS)|g' \
++ -e 's|@''GNULIB_PTSNAME''@|$(GNULIB_PTSNAME)|g' \
++ -e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \
++ -e 's|@''GNULIB_RANDOM_R''@|$(GNULIB_RANDOM_R)|g' \
++ -e 's|@''GNULIB_REALLOC_POSIX''@|$(GNULIB_REALLOC_POSIX)|g' \
++ -e 's|@''GNULIB_REALPATH''@|$(GNULIB_REALPATH)|g' \
++ -e 's|@''GNULIB_RPMATCH''@|$(GNULIB_RPMATCH)|g' \
++ -e 's|@''GNULIB_SETENV''@|$(GNULIB_SETENV)|g' \
++ -e 's|@''GNULIB_STRTOD''@|$(GNULIB_STRTOD)|g' \
++ -e 's|@''GNULIB_STRTOLL''@|$(GNULIB_STRTOLL)|g' \
++ -e 's|@''GNULIB_STRTOULL''@|$(GNULIB_STRTOULL)|g' \
++ -e 's|@''GNULIB_SYSTEM_POSIX''@|$(GNULIB_SYSTEM_POSIX)|g' \
++ -e 's|@''GNULIB_UNLOCKPT''@|$(GNULIB_UNLOCKPT)|g' \
++ -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \
++ -e 's|@''GNULIB_WCTOMB''@|$(GNULIB_WCTOMB)|g' \
+ < $(srcdir)/stdlib.in.h | \
+ sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
+ -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \
+@@ -766,7 +723,6 @@ stdlib.h: stdlib.in.h $(top_builddir)/co
+ -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
+ -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+- -e '/definition of _Noreturn/r $(_NORETURN_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
+ } > $@-t && \
+@@ -793,15 +749,6 @@ EXTRA_libicrt_a_SOURCES += strerror.c
+
+ ## end gnulib module strerror
+
+-## begin gnulib module strerror-override
+-
+-
+-EXTRA_DIST += strerror-override.c strerror-override.h
+-
+-EXTRA_libicrt_a_SOURCES += strerror-override.c
+-
+-## end gnulib module strerror-override
+-
+ ## begin gnulib module string
+
+ BUILT_SOURCES += string.h
+@@ -811,52 +758,47 @@ BUILT_SOURCES += string.h
+ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+- sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+- -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
++ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \
+- -e 's/@''GNULIB_FFSL''@/$(GNULIB_FFSL)/g' \
+- -e 's/@''GNULIB_FFSLL''@/$(GNULIB_FFSLL)/g' \
+- -e 's/@''GNULIB_MBSLEN''@/$(GNULIB_MBSLEN)/g' \
+- -e 's/@''GNULIB_MBSNLEN''@/$(GNULIB_MBSNLEN)/g' \
+- -e 's/@''GNULIB_MBSCHR''@/$(GNULIB_MBSCHR)/g' \
+- -e 's/@''GNULIB_MBSRCHR''@/$(GNULIB_MBSRCHR)/g' \
+- -e 's/@''GNULIB_MBSSTR''@/$(GNULIB_MBSSTR)/g' \
+- -e 's/@''GNULIB_MBSCASECMP''@/$(GNULIB_MBSCASECMP)/g' \
+- -e 's/@''GNULIB_MBSNCASECMP''@/$(GNULIB_MBSNCASECMP)/g' \
+- -e 's/@''GNULIB_MBSPCASECMP''@/$(GNULIB_MBSPCASECMP)/g' \
+- -e 's/@''GNULIB_MBSCASESTR''@/$(GNULIB_MBSCASESTR)/g' \
+- -e 's/@''GNULIB_MBSCSPN''@/$(GNULIB_MBSCSPN)/g' \
+- -e 's/@''GNULIB_MBSPBRK''@/$(GNULIB_MBSPBRK)/g' \
+- -e 's/@''GNULIB_MBSSPN''@/$(GNULIB_MBSSPN)/g' \
+- -e 's/@''GNULIB_MBSSEP''@/$(GNULIB_MBSSEP)/g' \
+- -e 's/@''GNULIB_MBSTOK_R''@/$(GNULIB_MBSTOK_R)/g' \
+- -e 's/@''GNULIB_MEMCHR''@/$(GNULIB_MEMCHR)/g' \
+- -e 's/@''GNULIB_MEMMEM''@/$(GNULIB_MEMMEM)/g' \
+- -e 's/@''GNULIB_MEMPCPY''@/$(GNULIB_MEMPCPY)/g' \
+- -e 's/@''GNULIB_MEMRCHR''@/$(GNULIB_MEMRCHR)/g' \
+- -e 's/@''GNULIB_RAWMEMCHR''@/$(GNULIB_RAWMEMCHR)/g' \
+- -e 's/@''GNULIB_STPCPY''@/$(GNULIB_STPCPY)/g' \
+- -e 's/@''GNULIB_STPNCPY''@/$(GNULIB_STPNCPY)/g' \
+- -e 's/@''GNULIB_STRCHRNUL''@/$(GNULIB_STRCHRNUL)/g' \
+- -e 's/@''GNULIB_STRDUP''@/$(GNULIB_STRDUP)/g' \
+- -e 's/@''GNULIB_STRNCAT''@/$(GNULIB_STRNCAT)/g' \
+- -e 's/@''GNULIB_STRNDUP''@/$(GNULIB_STRNDUP)/g' \
+- -e 's/@''GNULIB_STRNLEN''@/$(GNULIB_STRNLEN)/g' \
+- -e 's/@''GNULIB_STRPBRK''@/$(GNULIB_STRPBRK)/g' \
+- -e 's/@''GNULIB_STRSEP''@/$(GNULIB_STRSEP)/g' \
+- -e 's/@''GNULIB_STRSTR''@/$(GNULIB_STRSTR)/g' \
+- -e 's/@''GNULIB_STRCASESTR''@/$(GNULIB_STRCASESTR)/g' \
+- -e 's/@''GNULIB_STRTOK_R''@/$(GNULIB_STRTOK_R)/g' \
+- -e 's/@''GNULIB_STRERROR''@/$(GNULIB_STRERROR)/g' \
+- -e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \
+- -e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \
+- -e 's/@''GNULIB_STRVERSCMP''@/$(GNULIB_STRVERSCMP)/g' \
++ -e 's|@''GNULIB_MBSLEN''@|$(GNULIB_MBSLEN)|g' \
++ -e 's|@''GNULIB_MBSNLEN''@|$(GNULIB_MBSNLEN)|g' \
++ -e 's|@''GNULIB_MBSCHR''@|$(GNULIB_MBSCHR)|g' \
++ -e 's|@''GNULIB_MBSRCHR''@|$(GNULIB_MBSRCHR)|g' \
++ -e 's|@''GNULIB_MBSSTR''@|$(GNULIB_MBSSTR)|g' \
++ -e 's|@''GNULIB_MBSCASECMP''@|$(GNULIB_MBSCASECMP)|g' \
++ -e 's|@''GNULIB_MBSNCASECMP''@|$(GNULIB_MBSNCASECMP)|g' \
++ -e 's|@''GNULIB_MBSPCASECMP''@|$(GNULIB_MBSPCASECMP)|g' \
++ -e 's|@''GNULIB_MBSCASESTR''@|$(GNULIB_MBSCASESTR)|g' \
++ -e 's|@''GNULIB_MBSCSPN''@|$(GNULIB_MBSCSPN)|g' \
++ -e 's|@''GNULIB_MBSPBRK''@|$(GNULIB_MBSPBRK)|g' \
++ -e 's|@''GNULIB_MBSSPN''@|$(GNULIB_MBSSPN)|g' \
++ -e 's|@''GNULIB_MBSSEP''@|$(GNULIB_MBSSEP)|g' \
++ -e 's|@''GNULIB_MBSTOK_R''@|$(GNULIB_MBSTOK_R)|g' \
++ -e 's|@''GNULIB_MEMCHR''@|$(GNULIB_MEMCHR)|g' \
++ -e 's|@''GNULIB_MEMMEM''@|$(GNULIB_MEMMEM)|g' \
++ -e 's|@''GNULIB_MEMPCPY''@|$(GNULIB_MEMPCPY)|g' \
++ -e 's|@''GNULIB_MEMRCHR''@|$(GNULIB_MEMRCHR)|g' \
++ -e 's|@''GNULIB_RAWMEMCHR''@|$(GNULIB_RAWMEMCHR)|g' \
++ -e 's|@''GNULIB_STPCPY''@|$(GNULIB_STPCPY)|g' \
++ -e 's|@''GNULIB_STPNCPY''@|$(GNULIB_STPNCPY)|g' \
++ -e 's|@''GNULIB_STRCHRNUL''@|$(GNULIB_STRCHRNUL)|g' \
++ -e 's|@''GNULIB_STRDUP''@|$(GNULIB_STRDUP)|g' \
++ -e 's|@''GNULIB_STRNCAT''@|$(GNULIB_STRNCAT)|g' \
++ -e 's|@''GNULIB_STRNDUP''@|$(GNULIB_STRNDUP)|g' \
++ -e 's|@''GNULIB_STRNLEN''@|$(GNULIB_STRNLEN)|g' \
++ -e 's|@''GNULIB_STRPBRK''@|$(GNULIB_STRPBRK)|g' \
++ -e 's|@''GNULIB_STRSEP''@|$(GNULIB_STRSEP)|g' \
++ -e 's|@''GNULIB_STRSTR''@|$(GNULIB_STRSTR)|g' \
++ -e 's|@''GNULIB_STRCASESTR''@|$(GNULIB_STRCASESTR)|g' \
++ -e 's|@''GNULIB_STRTOK_R''@|$(GNULIB_STRTOK_R)|g' \
++ -e 's|@''GNULIB_STRERROR''@|$(GNULIB_STRERROR)|g' \
++ -e 's|@''GNULIB_STRERROR_R''@|$(GNULIB_STRERROR_R)|g' \
++ -e 's|@''GNULIB_STRSIGNAL''@|$(GNULIB_STRSIGNAL)|g' \
++ -e 's|@''GNULIB_STRVERSCMP''@|$(GNULIB_STRVERSCMP)|g' \
+ < $(srcdir)/string.in.h | \
+- sed -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \
+- -e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \
+- -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
++ sed -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
+ -e 's|@''HAVE_MEMCHR''@|$(HAVE_MEMCHR)|g' \
+ -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
+ -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
+@@ -912,23 +854,22 @@ sys/stat.h: sys_stat.in.h $(top_builddir
+ $(AM_V_at)$(MKDIR_P) sys
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+- sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+- -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
++ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
+- -e 's/@''GNULIB_FCHMODAT''@/$(GNULIB_FCHMODAT)/g' \
+- -e 's/@''GNULIB_FSTATAT''@/$(GNULIB_FSTATAT)/g' \
+- -e 's/@''GNULIB_FUTIMENS''@/$(GNULIB_FUTIMENS)/g' \
+- -e 's/@''GNULIB_LCHMOD''@/$(GNULIB_LCHMOD)/g' \
+- -e 's/@''GNULIB_LSTAT''@/$(GNULIB_LSTAT)/g' \
+- -e 's/@''GNULIB_MKDIRAT''@/$(GNULIB_MKDIRAT)/g' \
+- -e 's/@''GNULIB_MKFIFO''@/$(GNULIB_MKFIFO)/g' \
+- -e 's/@''GNULIB_MKFIFOAT''@/$(GNULIB_MKFIFOAT)/g' \
+- -e 's/@''GNULIB_MKNOD''@/$(GNULIB_MKNOD)/g' \
+- -e 's/@''GNULIB_MKNODAT''@/$(GNULIB_MKNODAT)/g' \
+- -e 's/@''GNULIB_STAT''@/$(GNULIB_STAT)/g' \
+- -e 's/@''GNULIB_UTIMENSAT''@/$(GNULIB_UTIMENSAT)/g' \
++ -e 's|@''GNULIB_FCHMODAT''@|$(GNULIB_FCHMODAT)|g' \
++ -e 's|@''GNULIB_FSTATAT''@|$(GNULIB_FSTATAT)|g' \
++ -e 's|@''GNULIB_FUTIMENS''@|$(GNULIB_FUTIMENS)|g' \
++ -e 's|@''GNULIB_LCHMOD''@|$(GNULIB_LCHMOD)|g' \
++ -e 's|@''GNULIB_LSTAT''@|$(GNULIB_LSTAT)|g' \
++ -e 's|@''GNULIB_MKDIRAT''@|$(GNULIB_MKDIRAT)|g' \
++ -e 's|@''GNULIB_MKFIFO''@|$(GNULIB_MKFIFO)|g' \
++ -e 's|@''GNULIB_MKFIFOAT''@|$(GNULIB_MKFIFOAT)|g' \
++ -e 's|@''GNULIB_MKNOD''@|$(GNULIB_MKNOD)|g' \
++ -e 's|@''GNULIB_MKNODAT''@|$(GNULIB_MKNODAT)|g' \
++ -e 's|@''GNULIB_STAT''@|$(GNULIB_STAT)|g' \
++ -e 's|@''GNULIB_UTIMENSAT''@|$(GNULIB_UTIMENSAT)|g' \
+ -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \
+ -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \
+ -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \
+@@ -971,16 +912,15 @@ BUILT_SOURCES += time.h
+ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+- sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+- -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
++ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \
+- -e 's/@''GNULIB_MKTIME''@/$(GNULIB_MKTIME)/g' \
+- -e 's/@''GNULIB_NANOSLEEP''@/$(GNULIB_NANOSLEEP)/g' \
+- -e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \
+- -e 's/@''GNULIB_TIMEGM''@/$(GNULIB_TIMEGM)/g' \
+- -e 's/@''GNULIB_TIME_R''@/$(GNULIB_TIME_R)/g' \
++ -e 's|@''GNULIB_MKTIME''@|$(GNULIB_MKTIME)|g' \
++ -e 's|@''GNULIB_NANOSLEEP''@|$(GNULIB_NANOSLEEP)|g' \
++ -e 's|@''GNULIB_STRPTIME''@|$(GNULIB_STRPTIME)|g' \
++ -e 's|@''GNULIB_TIMEGM''@|$(GNULIB_TIMEGM)|g' \
++ -e 's|@''GNULIB_TIME_R''@|$(GNULIB_TIME_R)|g' \
+ -e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \
+ -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \
+ -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \
+@@ -1013,56 +953,55 @@ BUILT_SOURCES += unistd.h
+ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+- sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+- -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \
++ sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \
+- -e 's/@''GNULIB_CHOWN''@/$(GNULIB_CHOWN)/g' \
+- -e 's/@''GNULIB_CLOSE''@/$(GNULIB_CLOSE)/g' \
+- -e 's/@''GNULIB_DUP2''@/$(GNULIB_DUP2)/g' \
+- -e 's/@''GNULIB_DUP3''@/$(GNULIB_DUP3)/g' \
+- -e 's/@''GNULIB_ENVIRON''@/$(GNULIB_ENVIRON)/g' \
+- -e 's/@''GNULIB_EUIDACCESS''@/$(GNULIB_EUIDACCESS)/g' \
+- -e 's/@''GNULIB_FACCESSAT''@/$(GNULIB_FACCESSAT)/g' \
+- -e 's/@''GNULIB_FCHDIR''@/$(GNULIB_FCHDIR)/g' \
+- -e 's/@''GNULIB_FCHOWNAT''@/$(GNULIB_FCHOWNAT)/g' \
+- -e 's/@''GNULIB_FSYNC''@/$(GNULIB_FSYNC)/g' \
+- -e 's/@''GNULIB_FTRUNCATE''@/$(GNULIB_FTRUNCATE)/g' \
+- -e 's/@''GNULIB_GETCWD''@/$(GNULIB_GETCWD)/g' \
+- -e 's/@''GNULIB_GETDOMAINNAME''@/$(GNULIB_GETDOMAINNAME)/g' \
+- -e 's/@''GNULIB_GETDTABLESIZE''@/$(GNULIB_GETDTABLESIZE)/g' \
+- -e 's/@''GNULIB_GETGROUPS''@/$(GNULIB_GETGROUPS)/g' \
+- -e 's/@''GNULIB_GETHOSTNAME''@/$(GNULIB_GETHOSTNAME)/g' \
+- -e 's/@''GNULIB_GETLOGIN''@/$(GNULIB_GETLOGIN)/g' \
+- -e 's/@''GNULIB_GETLOGIN_R''@/$(GNULIB_GETLOGIN_R)/g' \
+- -e 's/@''GNULIB_GETPAGESIZE''@/$(GNULIB_GETPAGESIZE)/g' \
+- -e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \
+- -e 's/@''GNULIB_GROUP_MEMBER''@/$(GNULIB_GROUP_MEMBER)/g' \
+- -e 's/@''GNULIB_LCHOWN''@/$(GNULIB_LCHOWN)/g' \
+- -e 's/@''GNULIB_LINK''@/$(GNULIB_LINK)/g' \
+- -e 's/@''GNULIB_LINKAT''@/$(GNULIB_LINKAT)/g' \
+- -e 's/@''GNULIB_LSEEK''@/$(GNULIB_LSEEK)/g' \
+- -e 's/@''GNULIB_PIPE''@/$(GNULIB_PIPE)/g' \
+- -e 's/@''GNULIB_PIPE2''@/$(GNULIB_PIPE2)/g' \
+- -e 's/@''GNULIB_PREAD''@/$(GNULIB_PREAD)/g' \
+- -e 's/@''GNULIB_PWRITE''@/$(GNULIB_PWRITE)/g' \
+- -e 's/@''GNULIB_READ''@/$(GNULIB_READ)/g' \
+- -e 's/@''GNULIB_READLINK''@/$(GNULIB_READLINK)/g' \
+- -e 's/@''GNULIB_READLINKAT''@/$(GNULIB_READLINKAT)/g' \
+- -e 's/@''GNULIB_RMDIR''@/$(GNULIB_RMDIR)/g' \
+- -e 's/@''GNULIB_SLEEP''@/$(GNULIB_SLEEP)/g' \
+- -e 's/@''GNULIB_SYMLINK''@/$(GNULIB_SYMLINK)/g' \
+- -e 's/@''GNULIB_SYMLINKAT''@/$(GNULIB_SYMLINKAT)/g' \
+- -e 's/@''GNULIB_TTYNAME_R''@/$(GNULIB_TTYNAME_R)/g' \
+- -e 's/@''GNULIB_UNISTD_H_GETOPT''@/$(GNULIB_UNISTD_H_GETOPT)/g' \
+- -e 's/@''GNULIB_UNISTD_H_NONBLOCKING''@/$(GNULIB_UNISTD_H_NONBLOCKING)/g' \
+- -e 's/@''GNULIB_UNISTD_H_SIGPIPE''@/$(GNULIB_UNISTD_H_SIGPIPE)/g' \
+- -e 's/@''GNULIB_UNLINK''@/$(GNULIB_UNLINK)/g' \
+- -e 's/@''GNULIB_UNLINKAT''@/$(GNULIB_UNLINKAT)/g' \
+- -e 's/@''GNULIB_USLEEP''@/$(GNULIB_USLEEP)/g' \
+- -e 's/@''GNULIB_WRITE''@/$(GNULIB_WRITE)/g' \
++ -e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \
++ -e 's|@''GNULIB_CLOSE''@|$(GNULIB_CLOSE)|g' \
++ -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \
++ -e 's|@''GNULIB_DUP3''@|$(GNULIB_DUP3)|g' \
++ -e 's|@''GNULIB_ENVIRON''@|$(GNULIB_ENVIRON)|g' \
++ -e 's|@''GNULIB_EUIDACCESS''@|$(GNULIB_EUIDACCESS)|g' \
++ -e 's|@''GNULIB_FACCESSAT''@|$(GNULIB_FACCESSAT)|g' \
++ -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \
++ -e 's|@''GNULIB_FCHOWNAT''@|$(GNULIB_FCHOWNAT)|g' \
++ -e 's|@''GNULIB_FSYNC''@|$(GNULIB_FSYNC)|g' \
++ -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \
++ -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \
++ -e 's|@''GNULIB_GETDOMAINNAME''@|$(GNULIB_GETDOMAINNAME)|g' \
++ -e 's|@''GNULIB_GETDTABLESIZE''@|$(GNULIB_GETDTABLESIZE)|g' \
++ -e 's|@''GNULIB_GETGROUPS''@|$(GNULIB_GETGROUPS)|g' \
++ -e 's|@''GNULIB_GETHOSTNAME''@|$(GNULIB_GETHOSTNAME)|g' \
++ -e 's|@''GNULIB_GETLOGIN''@|$(GNULIB_GETLOGIN)|g' \
++ -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \
++ -e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \
++ -e 's|@''GNULIB_GETUSERSHELL''@|$(GNULIB_GETUSERSHELL)|g' \
++ -e 's|@''GNULIB_GROUP_MEMBER''@|$(GNULIB_GROUP_MEMBER)|g' \
++ -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \
++ -e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \
++ -e 's|@''GNULIB_LINKAT''@|$(GNULIB_LINKAT)|g' \
++ -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \
++ -e 's|@''GNULIB_PIPE''@|$(GNULIB_PIPE)|g' \
++ -e 's|@''GNULIB_PIPE2''@|$(GNULIB_PIPE2)|g' \
++ -e 's|@''GNULIB_PREAD''@|$(GNULIB_PREAD)|g' \
++ -e 's|@''GNULIB_PWRITE''@|$(GNULIB_PWRITE)|g' \
++ -e 's|@''GNULIB_READ''@|$(GNULIB_READ)|g' \
++ -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \
++ -e 's|@''GNULIB_READLINKAT''@|$(GNULIB_READLINKAT)|g' \
++ -e 's|@''GNULIB_RMDIR''@|$(GNULIB_RMDIR)|g' \
++ -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \
++ -e 's|@''GNULIB_SYMLINK''@|$(GNULIB_SYMLINK)|g' \
++ -e 's|@''GNULIB_SYMLINKAT''@|$(GNULIB_SYMLINKAT)|g' \
++ -e 's|@''GNULIB_TTYNAME_R''@|$(GNULIB_TTYNAME_R)|g' \
++ -e 's|@''GNULIB_UNISTD_H_GETOPT''@|$(GNULIB_UNISTD_H_GETOPT)|g' \
++ -e 's|@''GNULIB_UNISTD_H_NONBLOCKING''@|$(GNULIB_UNISTD_H_NONBLOCKING)|g' \
++ -e 's|@''GNULIB_UNISTD_H_SIGPIPE''@|$(GNULIB_UNISTD_H_SIGPIPE)|g' \
++ -e 's|@''GNULIB_UNLINK''@|$(GNULIB_UNLINK)|g' \
++ -e 's|@''GNULIB_UNLINKAT''@|$(GNULIB_UNLINKAT)|g' \
++ -e 's|@''GNULIB_USLEEP''@|$(GNULIB_USLEEP)|g' \
++ -e 's|@''GNULIB_WRITE''@|$(GNULIB_WRITE)|g' \
+ < $(srcdir)/unistd.in.h | \
+ sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \
+ -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \
+@@ -1198,6 +1137,25 @@ EXTRA_DIST += verify.h
+
+ ## end gnulib module verify
+
++## begin gnulib module warn-on-use
++
++BUILT_SOURCES += warn-on-use.h
++# The warn-on-use.h that gets inserted into generated .h files is the same as
++# build-aux/warn-on-use.h, except that it has the copyright header cut off.
++warn-on-use.h: $(top_srcdir)/build-aux/warn-on-use.h
++ $(AM_V_GEN)rm -f $@-t $@ && \
++ sed -n -e '/^.ifndef/,$$p' \
++ < $(top_srcdir)/build-aux/warn-on-use.h \
++ > $@-t && \
++ mv $@-t $@
++MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t
++
++WARN_ON_USE_H=warn-on-use.h
++
++EXTRA_DIST += $(top_srcdir)/build-aux/warn-on-use.h
++
++## end gnulib module warn-on-use
++
+ ## begin gnulib module xalloc
+
+ libicrt_a_SOURCES += xalloc.h xmalloc.c xstrdup.c
+diff -Naurp libiconv-1.14.org//srclib/pathmax.h libiconv-1.14/srclib/pathmax.h
+--- libiconv-1.14.org//srclib/pathmax.h 2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/pathmax.h 2012-01-08 02:07:40.218484451 -0800
+@@ -19,27 +19,6 @@
+ #ifndef _PATHMAX_H
+ # define _PATHMAX_H
+
+-/* POSIX:2008 defines PATH_MAX to be the maximum number of bytes in a filename,
+- including the terminating NUL byte.
+- <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html>
+- PATH_MAX is not defined on systems which have no limit on filename length,
+- such as GNU/Hurd.
+-
+- This file does *not* define PATH_MAX always. Programs that use this file
+- can handle the GNU/Hurd case in several ways:
+- - Either with a package-wide handling, or with a per-file handling,
+- - Either through a
+- #ifdef PATH_MAX
+- or through a fallback like
+- #ifndef PATH_MAX
+- # define PATH_MAX 8192
+- #endif
+- or through a fallback like
+- #ifndef PATH_MAX
+- # define PATH_MAX pathconf ("/", _PC_PATH_MAX)
+- #endif
+- */
+-
+ # include <unistd.h>
+
+ # include <limits.h>
+@@ -48,6 +27,11 @@
+ # define _POSIX_PATH_MAX 256
+ # endif
+
++# if !defined PATH_MAX && defined _PC_PATH_MAX && defined HAVE_PATHCONF
++# 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>
+@@ -57,13 +41,8 @@
+ # define PATH_MAX MAXPATHLEN
+ # endif
+
+-# ifdef __hpux
+-/* On HP-UX, PATH_MAX designates the maximum number of bytes in a filename,
+- *not* including the terminating NUL byte, and is set to 1023.
+- Additionally, when _XOPEN_SOURCE is defined to 500 or more, PATH_MAX is
+- not defined at all any more. */
+-# undef PATH_MAX
+-# define PATH_MAX 1024
++# ifndef PATH_MAX
++# define PATH_MAX _POSIX_PATH_MAX
+ # endif
+
+ #endif /* _PATHMAX_H */
+diff -Naurp libiconv-1.14.org//srclib/relocwrapper.c libiconv-1.14/srclib/relocwrapper.c
+--- libiconv-1.14.org//srclib/relocwrapper.c 2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/relocwrapper.c 2012-01-08 02:07:40.282484455 -0800
+@@ -29,6 +29,7 @@
+ -> relocatable
+ -> setenv
+ -> malloca
++ -> strerror
+ -> c-ctype
+
+ Macros that need to be set while compiling this file:
+diff -Naurp libiconv-1.14.org//srclib/safe-read.h libiconv-1.14/srclib/safe-read.h
+--- libiconv-1.14.org//srclib/safe-read.h 2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/safe-read.h 2012-01-08 02:07:40.298484455 -0800
+@@ -14,19 +14,6 @@
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+-/* Some system calls may be interrupted and fail with errno = EINTR in the
+- following situations:
+- - The process is stopped and restarted (signal SIGSTOP and SIGCONT, user
+- types Ctrl-Z) on some platforms: MacOS X.
+- - The process receives a signal for which a signal handler was installed
+- with sigaction() with an sa_flags field that does not contain
+- SA_RESTART.
+- - The process receives a signal for which a signal handler was installed
+- with signal() and for which no call to siginterrupt(sig,0) was done,
+- on some platforms: AIX, HP-UX, IRIX, OSF/1, Solaris.
+-
+- This module provides a wrapper around read() that handles EINTR. */
+-
+ #include <stddef.h>
+
+ #ifdef __cplusplus
+diff -Naurp libiconv-1.14.org//srclib/signal.in.h libiconv-1.14/srclib/signal.in.h
+--- libiconv-1.14.org//srclib/signal.in.h 2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/signal.in.h 2012-01-08 02:07:40.314484456 -0800
+@@ -20,49 +20,21 @@
+ #endif
+ @PRAGMA_COLUMNS@
+
+-#if defined __need_sig_atomic_t || defined __need_sigset_t || defined _GL_ALREADY_INCLUDING_SIGNAL_H || (defined _SIGNAL_H && !defined __SIZEOF_PTHREAD_MUTEX_T)
+-/* Special invocation convention:
+- - Inside glibc header files.
+- - On glibc systems we have a sequence of nested includes
+- <signal.h> -> <ucontext.h> -> <signal.h>.
+- In this situation, the functions are not yet declared, therefore we cannot
+- provide the C++ aliases.
+- - On glibc systems with GCC 4.3 we have a sequence of nested includes
+- <csignal> -> </usr/include/signal.h> -> <sys/ucontext.h> -> <signal.h>.
+- In this situation, some of the functions are not yet declared, therefore
+- we cannot provide the C++ aliases. */
++#if defined __need_sig_atomic_t || defined __need_sigset_t
++/* Special invocation convention inside glibc header files. */
+
+ # @INCLUDE_NEXT@ @NEXT_SIGNAL_H@
+
+ #else
+ /* Normal invocation convention. */
+
+-#ifndef _@GUARD_PREFIX@_SIGNAL_H
+-
+-#define _GL_ALREADY_INCLUDING_SIGNAL_H
+-
+-/* Define pid_t, uid_t.
+- Also, mingw defines sigset_t not in <signal.h>, but in <sys/types.h>.
+- On Solaris 10, <signal.h> includes <sys/types.h>, which eventually includes
+- us; so include <sys/types.h> now, before the second inclusion guard. */
+-#include <sys/types.h>
++#ifndef _GL_SIGNAL_H
+
+ /* The include_next requires a split double-inclusion guard. */
+ #@INCLUDE_NEXT@ @NEXT_SIGNAL_H@
+
+-#undef _GL_ALREADY_INCLUDING_SIGNAL_H
+-
+-#ifndef _@GUARD_PREFIX@_SIGNAL_H
+-#define _@GUARD_PREFIX@_SIGNAL_H
+-
+-/* MacOS X 10.3, FreeBSD 6.4, OpenBSD 3.8, OSF/1 4.0, Solaris 2.6 declare
+- pthread_sigmask in <pthread.h>, not in <signal.h>.
+- But avoid namespace pollution on glibc systems.*/
+-#if (@GNULIB_PTHREAD_SIGMASK@ || defined GNULIB_POSIXCHECK) \
+- && ((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __OpenBSD__ || defined __osf__ || defined __sun) \
+- && ! defined __GLIBC__
+-# include <pthread.h>
+-#endif
++#ifndef _GL_SIGNAL_H
++#define _GL_SIGNAL_H
+
+ /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+@@ -70,6 +42,10 @@
+
+ /* The definition of _GL_WARN_ON_USE is copied here. */
+
++/* Define pid_t, uid_t.
++ Also, mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */
++#include <sys/types.h>
++
+ /* On AIX, sig_atomic_t already includes volatile. C99 requires that
+ 'volatile sig_atomic_t' ignore the extra modifier, but C89 did not.
+ Hence, redefine this to a non-volatile type as needed. */
+@@ -124,34 +100,6 @@ typedef void (*sighandler_t) (int);
+ #endif
+
+
+-#if @GNULIB_PTHREAD_SIGMASK@
+-# if @REPLACE_PTHREAD_SIGMASK@
+-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+-# undef pthread_sigmask
+-# define pthread_sigmask rpl_pthread_sigmask
+-# endif
+-_GL_FUNCDECL_RPL (pthread_sigmask, int,
+- (int how, const sigset_t *new_mask, sigset_t *old_mask));
+-_GL_CXXALIAS_RPL (pthread_sigmask, int,
+- (int how, const sigset_t *new_mask, sigset_t *old_mask));
+-# else
+-# if !@HAVE_PTHREAD_SIGMASK@
+-_GL_FUNCDECL_SYS (pthread_sigmask, int,
+- (int how, const sigset_t *new_mask, sigset_t *old_mask));
+-# endif
+-_GL_CXXALIAS_SYS (pthread_sigmask, int,
+- (int how, const sigset_t *new_mask, sigset_t *old_mask));
+-# endif
+-_GL_CXXALIASWARN (pthread_sigmask);
+-#elif defined GNULIB_POSIXCHECK
+-# undef pthread_sigmask
+-# if HAVE_RAW_DECL_PTHREAD_SIGMASK
+-_GL_WARN_ON_USE (pthread_sigmask, "pthread_sigmask is not portable - "
+- "use gnulib module pthread_sigmask for portability");
+-# endif
+-#endif
+-
+-
+ #if @GNULIB_SIGPROCMASK@
+ # if !@HAVE_POSIX_SIGNALBLOCKING@
+
+@@ -423,6 +371,6 @@ _GL_WARN_ON_USE (sigaction, "sigaction i
+ #endif
+
+
+-#endif /* _@GUARD_PREFIX@_SIGNAL_H */
+-#endif /* _@GUARD_PREFIX@_SIGNAL_H */
++#endif /* _GL_SIGNAL_H */
++#endif /* _GL_SIGNAL_H */
+ #endif
+diff -Naurp libiconv-1.14.org//srclib/stat.c libiconv-1.14/srclib/stat.c
+--- libiconv-1.14.org//srclib/stat.c 2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/stat.c 2012-01-08 02:07:40.330484457 -0800
+@@ -38,7 +38,6 @@ orig_stat (const char *filename, struct
+ #include <stdbool.h>
+ #include <string.h>
+ #include "dosname.h"
+-#include "verify.h"
+
+ /* Store information about NAME into ST. Work around bugs with
+ trailing slashes. Mingw has other bugs (such as st_ino always
+@@ -64,12 +63,6 @@ rpl_stat (char const *name, struct stat
+ }
+ #endif /* REPLACE_FUNC_STAT_FILE */
+ #if REPLACE_FUNC_STAT_DIR
+- /* The only known systems where REPLACE_FUNC_STAT_DIR is needed also
+- have a constant PATH_MAX. */
+-# ifndef PATH_MAX
+-# error "Please port this replacement to your platform"
+-# endif
+-
+ if (result == -1 && errno == ENOENT)
+ {
+ /* Due to mingw's oddities, there are some directories (like
+@@ -84,7 +77,6 @@ rpl_stat (char const *name, struct stat
+ char fixed_name[PATH_MAX + 1] = {0};
+ size_t len = strlen (name);
+ bool check_dir = false;
+- verify (PATH_MAX <= 4096);
+ if (PATH_MAX <= len)
+ errno = ENAMETOOLONG;
+ else if (len)
+diff -Naurp libiconv-1.14.org//srclib/stddef.in.h libiconv-1.14/srclib/stddef.in.h
+--- libiconv-1.14.org//srclib/stddef.in.h 2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/stddef.in.h 2012-01-08 02:07:40.346484458 -0800
+@@ -38,9 +38,9 @@
+ remember if special invocation has ever been used to obtain wint_t,
+ in which case we need to clean up NULL yet again. */
+
+-# if !(defined _@GUARD_PREFIX@_STDDEF_H && defined _GL_STDDEF_WINT_T)
++# if !(defined _GL_STDDEF_H && defined _GL_STDDEF_WINT_T)
+ # ifdef __need_wint_t
+-# undef _@GUARD_PREFIX@_STDDEF_H
++# undef _GL_STDDEF_H
+ # define _GL_STDDEF_WINT_T
+ # endif
+ # @INCLUDE_NEXT@ @NEXT_STDDEF_H@
+@@ -49,14 +49,14 @@
+ #else
+ /* Normal invocation convention. */
+
+-# ifndef _@GUARD_PREFIX@_STDDEF_H
++# ifndef _GL_STDDEF_H
+
+ /* The include_next requires a split double-inclusion guard. */
+
+ # @INCLUDE_NEXT@ @NEXT_STDDEF_H@
+
+-# ifndef _@GUARD_PREFIX@_STDDEF_H
+-# define _@GUARD_PREFIX@_STDDEF_H
++# ifndef _GL_STDDEF_H
++# define _GL_STDDEF_H
+
+ /* On NetBSD 5.0, the definition of NULL lacks proper parentheses. */
+ #if @REPLACE_NULL@
+@@ -82,6 +82,6 @@
+ # define wchar_t int
+ #endif
+
+-# endif /* _@GUARD_PREFIX@_STDDEF_H */
+-# endif /* _@GUARD_PREFIX@_STDDEF_H */
++# endif /* _GL_STDDEF_H */
++# endif /* _GL_STDDEF_H */
+ #endif /* __need_XXX */
+diff -Naurp libiconv-1.14.org//srclib/stdint.in.h libiconv-1.14/srclib/stdint.in.h
+--- libiconv-1.14.org//srclib/stdint.in.h 2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/stdint.in.h 2012-01-08 02:07:40.358484458 -0800
+@@ -21,7 +21,7 @@
+ * <http://www.opengroup.org/susv3xbd/stdint.h.html>
+ */
+
+-#ifndef _@GUARD_PREFIX@_STDINT_H
++#ifndef _GL_STDINT_H
+
+ #if __GNUC__ >= 3
+ @PRAGMA_SYSTEM_HEADER@
+@@ -52,13 +52,13 @@
+ /* Other systems may have an incomplete or buggy <stdint.h>.
+ Include it before <inttypes.h>, since any "#include <stdint.h>"
+ in <inttypes.h> would reinclude us, skipping our contents because
+- _@GUARD_PREFIX@_STDINT_H is defined.
++ _GL_STDINT_H is defined.
+ The include_next requires a split double-inclusion guard. */
+ # @INCLUDE_NEXT@ @NEXT_STDINT_H@
+ #endif
+
+-#if ! defined _@GUARD_PREFIX@_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H
+-#define _@GUARD_PREFIX@_STDINT_H
++#if ! defined _GL_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H
++#define _GL_STDINT_H
+
+ /* <sys/types.h> defines some of the stdint.h types as well, on glibc,
+ IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>).
+@@ -270,36 +270,26 @@ typedef unsigned long int gl_uintptr_t;
+ /* Note: These types are compiler dependent. It may be unwise to use them in
+ public header files. */
+
+-/* If the system defines INTMAX_MAX, assume that intmax_t works, and
+- similarly for UINTMAX_MAX and uintmax_t. This avoids problems with
+- assuming one type where another is used by the system. */
+-
+-#ifndef INTMAX_MAX
+-# undef INTMAX_C
+-# undef intmax_t
+-# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
++#undef intmax_t
++#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+ typedef long long int gl_intmax_t;
+-# define intmax_t gl_intmax_t
+-# elif defined GL_INT64_T
+-# define intmax_t int64_t
+-# else
++# define intmax_t gl_intmax_t
++#elif defined GL_INT64_T
++# define intmax_t int64_t
++#else
+ typedef long int gl_intmax_t;
+-# define intmax_t gl_intmax_t
+-# endif
++# define intmax_t gl_intmax_t
+ #endif
+
+-#ifndef UINTMAX_MAX
+-# undef UINTMAX_C
+-# undef uintmax_t
+-# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
++#undef uintmax_t
++#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+ typedef unsigned long long int gl_uintmax_t;
+-# define uintmax_t gl_uintmax_t
+-# elif defined GL_UINT64_T
+-# define uintmax_t uint64_t
+-# else
++# define uintmax_t gl_uintmax_t
++#elif defined GL_UINT64_T
++# define uintmax_t uint64_t
++#else
+ typedef unsigned long int gl_uintmax_t;
+-# define uintmax_t gl_uintmax_t
+-# endif
++# define uintmax_t gl_uintmax_t
+ #endif
+
+ /* Verify that intmax_t and uintmax_t have the same size. Too much code
+@@ -441,23 +431,21 @@ typedef int _verify_intmax_size[sizeof (
+
+ /* 7.18.2.5. Limits of greatest-width integer types */
+
+-#ifndef INTMAX_MAX
+-# undef INTMAX_MIN
+-# ifdef INT64_MAX
+-# define INTMAX_MIN INT64_MIN
+-# define INTMAX_MAX INT64_MAX
+-# else
+-# define INTMAX_MIN INT32_MIN
+-# define INTMAX_MAX INT32_MAX
+-# endif
++#undef INTMAX_MIN
++#undef INTMAX_MAX
++#ifdef INT64_MAX
++# define INTMAX_MIN INT64_MIN
++# define INTMAX_MAX INT64_MAX
++#else
++# define INTMAX_MIN INT32_MIN
++# define INTMAX_MAX INT32_MAX
+ #endif
+
+-#ifndef UINTMAX_MAX
+-# ifdef UINT64_MAX
+-# define UINTMAX_MAX UINT64_MAX
+-# else
+-# define UINTMAX_MAX UINT32_MAX
+-# endif
++#undef UINTMAX_MAX
++#ifdef UINT64_MAX
++# define UINTMAX_MAX UINT64_MAX
++#else
++# define UINTMAX_MAX UINT32_MAX
+ #endif
+
+ /* 7.18.3. Limits of other integer types */
+@@ -580,27 +568,25 @@ typedef int _verify_intmax_size[sizeof (
+
+ /* 7.18.4.2. Macros for greatest-width integer constants */
+
+-#ifndef INTMAX_C
+-# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+-# define INTMAX_C(x) x##LL
+-# elif defined GL_INT64_T
+-# define INTMAX_C(x) INT64_C(x)
+-# else
+-# define INTMAX_C(x) x##L
+-# endif
++#undef INTMAX_C
++#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
++# define INTMAX_C(x) x##LL
++#elif defined GL_INT64_T
++# define INTMAX_C(x) INT64_C(x)
++#else
++# define INTMAX_C(x) x##L
+ #endif
+
+-#ifndef UINTMAX_C
+-# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+-# define UINTMAX_C(x) x##ULL
+-# elif defined GL_UINT64_T
+-# define UINTMAX_C(x) UINT64_C(x)
+-# else
+-# define UINTMAX_C(x) x##UL
+-# endif
++#undef UINTMAX_C
++#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
++# define UINTMAX_C(x) x##ULL
++#elif defined GL_UINT64_T
++# define UINTMAX_C(x) UINT64_C(x)
++#else
++# define UINTMAX_C(x) x##UL
+ #endif
+
+ #endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */
+
+-#endif /* _@GUARD_PREFIX@_STDINT_H */
+-#endif /* !defined _@GUARD_PREFIX@_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */
++#endif /* _GL_STDINT_H */
++#endif /* !defined _GL_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */
+diff -Naurp libiconv-1.14.org//srclib/stdio.in.h libiconv-1.14/srclib/stdio.in.h
+--- libiconv-1.14.org//srclib/stdio.in.h 2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/stdio.in.h 2012-01-08 02:07:40.378484459 -0800
+@@ -35,7 +35,7 @@
+ #else
+ /* Normal invocation convention. */
+
+-#ifndef _@GUARD_PREFIX@_STDIO_H
++#ifndef _GL_STDIO_H
+
+ #define _GL_ALREADY_INCLUDING_STDIO_H
+
+@@ -44,8 +44,8 @@
+
+ #undef _GL_ALREADY_INCLUDING_STDIO_H
+
+-#ifndef _@GUARD_PREFIX@_STDIO_H
+-#define _@GUARD_PREFIX@_STDIO_H
++#ifndef _GL_STDIO_H
++#define _GL_STDIO_H
+
+ /* Get va_list. Needed on many systems, including glibc 2.8. */
+ #include <stdarg.h>
+@@ -461,6 +461,25 @@ _GL_FUNCDECL_SYS (fseeko, int, (FILE *fp
+ _GL_CXXALIAS_SYS (fseeko, int, (FILE *fp, off_t offset, int whence));
+ # endif
+ _GL_CXXALIASWARN (fseeko);
++# if (@REPLACE_FSEEKO@ || !@HAVE_FSEEKO@) && !@GNULIB_FSEEK@
++ /* Provide an fseek function that is consistent with fseeko. */
++ /* In order to avoid that fseek gets defined as a macro here, the
++ developer can request the 'fseek' module. */
++# if !GNULIB_defined_fseek_function
++# undef fseek
++# define fseek rpl_fseek
++static inline int _GL_ARG_NONNULL ((1))
++rpl_fseek (FILE *fp, long offset, int whence)
++{
++# if @REPLACE_FSEEKO@
++ return rpl_fseeko (fp, offset, whence);
++# else
++ return fseeko (fp, offset, whence);
++# endif
++}
++# define GNULIB_defined_fseek_function 1
++# endif
++# endif
+ #elif defined GNULIB_POSIXCHECK
+ # define _GL_FSEEK_WARN /* Category 1, above. */
+ # undef fseek
+@@ -520,6 +539,25 @@ _GL_FUNCDECL_SYS (ftello, off_t, (FILE *
+ _GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp));
+ # endif
+ _GL_CXXALIASWARN (ftello);
++# if (@REPLACE_FTELLO@ || !@HAVE_FTELLO@) && !@GNULIB_FTELL@
++ /* Provide an ftell function that is consistent with ftello. */
++ /* In order to avoid that ftell gets defined as a macro here, the
++ developer can request the 'ftell' module. */
++# if !GNULIB_defined_ftell_function
++# undef ftell
++# define ftell rpl_ftell
++static inline long _GL_ARG_NONNULL ((1))
++rpl_ftell (FILE *f)
++{
++# if @REPLACE_FTELLO@
++ return rpl_ftello (f);
++# else
++ return ftello (f);
++# endif
++}
++# define GNULIB_defined_ftell_function 1
++# endif
++# endif
+ #elif defined GNULIB_POSIXCHECK
+ # define _GL_FTELL_WARN /* Category 1, above. */
+ # undef ftell
+@@ -1307,6 +1345,6 @@ _GL_WARN_ON_USE (vsprintf, "vsprintf is
+ #endif
+
+
+-#endif /* _@GUARD_PREFIX@_STDIO_H */
+-#endif /* _@GUARD_PREFIX@_STDIO_H */
++#endif /* _GL_STDIO_H */
++#endif /* _GL_STDIO_H */
+ #endif
+diff -Naurp libiconv-1.14.org//srclib/stdlib.in.h libiconv-1.14/srclib/stdlib.in.h
+--- libiconv-1.14.org//srclib/stdlib.in.h 2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/stdlib.in.h 2012-01-08 02:07:40.390484459 -0800
+@@ -28,13 +28,13 @@
+ #else
+ /* Normal invocation convention. */
+
+-#ifndef _@GUARD_PREFIX@_STDLIB_H
++#ifndef _GL_STDLIB_H
+
+ /* The include_next requires a split double-inclusion guard. */
+ #@INCLUDE_NEXT@ @NEXT_STDLIB_H@
+
+-#ifndef _@GUARD_PREFIX@_STDLIB_H
+-#define _@GUARD_PREFIX@_STDLIB_H
++#ifndef _GL_STDLIB_H
++#define _GL_STDLIB_H
+
+ /* NetBSD 5.0 mis-defines NULL. */
+ #include <stddef.h>
+@@ -89,7 +89,11 @@ struct random_data
+ # include <unistd.h>
+ #endif
+
+-/* The definition of _Noreturn is copied here. */
++#if 3 <= __GNUC__ || __GNUC__ == 2 && 8 <= __GNUC_MINOR__
++# define _GL_ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
++#else
++# define _GL_ATTRIBUTE_NORETURN
++#endif
+
+ /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+@@ -116,7 +120,7 @@ struct random_data
+ /* Terminate the current process with the given return code, without running
+ the 'atexit' handlers. */
+ # if !@HAVE__EXIT@
+-_GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status));
++_GL_FUNCDECL_SYS (_Exit, void, (int status) _GL_ATTRIBUTE_NORETURN);
+ # endif
+ _GL_CXXALIAS_SYS (_Exit, void, (int status));
+ _GL_CXXALIASWARN (_Exit);
+@@ -757,6 +761,6 @@ _GL_CXXALIASWARN (wctomb);
+ #endif
+
+
+-#endif /* _@GUARD_PREFIX@_STDLIB_H */
+-#endif /* _@GUARD_PREFIX@_STDLIB_H */
++#endif /* _GL_STDLIB_H */
++#endif /* _GL_STDLIB_H */
+ #endif
+diff -Naurp libiconv-1.14.org//srclib/strerror.c libiconv-1.14/srclib/strerror.c
+--- libiconv-1.14.org//srclib/strerror.c 2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/strerror.c 2012-01-08 02:07:40.406484461 -0800
+@@ -17,54 +17,340 @@
+
+ #include <config.h>
+
+-/* Specification. */
+ #include <string.h>
+
+-#include <errno.h>
+-#include <stdio.h>
+-#include <stdlib.h>
+-#include <string.h>
++#if REPLACE_STRERROR
++
++# include <errno.h>
++# include <stdio.h>
++
++# if GNULIB_defined_ESOCK /* native Windows platforms */
++# if HAVE_WINSOCK2_H
++# include <winsock2.h>
++# endif
++# endif
+
+-#include "intprops.h"
+-#include "strerror-override.h"
+-#include "verify.h"
++# include "intprops.h"
+
+ /* Use the system functions, not the gnulib overrides in this file. */
+-#undef sprintf
++# undef sprintf
++
++# undef strerror
++# if ! HAVE_DECL_STRERROR
++# define strerror(n) NULL
++# endif
+
+ char *
+-strerror (int n)
+-#undef strerror
++rpl_strerror (int n)
+ {
+- static char buf[STACKBUF_LEN];
+- size_t len;
++ char const *msg = NULL;
++ /* These error messages are taken from glibc/sysdeps/gnu/errlist.c. */
++ switch (n)
++ {
++# if GNULIB_defined_ETXTBSY
++ case ETXTBSY:
++ msg = "Text file busy";
++ break;
++# endif
++
++# if GNULIB_defined_ESOCK /* native Windows platforms */
++ /* EWOULDBLOCK is the same as EAGAIN. */
++ case EINPROGRESS:
++ msg = "Operation now in progress";
++ break;
++ case EALREADY:
++ msg = "Operation already in progress";
++ break;
++ case ENOTSOCK:
++ msg = "Socket operation on non-socket";
++ break;
++ case EDESTADDRREQ:
++ msg = "Destination address required";
++ break;
++ case EMSGSIZE:
++ msg = "Message too long";
++ break;
++ case EPROTOTYPE:
++ msg = "Protocol wrong type for socket";
++ break;
++ case ENOPROTOOPT:
++ msg = "Protocol not available";
++ break;
++ case EPROTONOSUPPORT:
++ msg = "Protocol not supported";
++ break;
++ case ESOCKTNOSUPPORT:
++ msg = "Socket type not supported";
++ break;
++ case EOPNOTSUPP:
++ msg = "Operation not supported";
++ break;
++ case EPFNOSUPPORT:
++ msg = "Protocol family not supported";
++ break;
++ case EAFNOSUPPORT:
++ msg = "Address family not supported by protocol";
++ break;
++ case EADDRINUSE:
++ msg = "Address already in use";
++ break;
++ case EADDRNOTAVAIL:
++ msg = "Cannot assign requested address";
++ break;
++ case ENETDOWN:
++ msg = "Network is down";
++ break;
++ case ENETUNREACH:
++ msg = "Network is unreachable";
++ break;
++ case ENETRESET:
++ msg = "Network dropped connection on reset";
++ break;
++ case ECONNABORTED:
++ msg = "Software caused connection abort";
++ break;
++ case ECONNRESET:
++ msg = "Connection reset by peer";
++ break;
++ case ENOBUFS:
++ msg = "No buffer space available";
++ break;
++ case EISCONN:
++ msg = "Transport endpoint is already connected";
++ break;
++ case ENOTCONN:
++ msg = "Transport endpoint is not connected";
++ break;
++ case ESHUTDOWN:
++ msg = "Cannot send after transport endpoint shutdown";
++ break;
++ case ETOOMANYREFS:
++ msg = "Too many references: cannot splice";
++ break;
++ case ETIMEDOUT:
++ msg = "Connection timed out";
++ break;
++ case ECONNREFUSED:
++ msg = "Connection refused";
++ break;
++ case ELOOP:
++ msg = "Too many levels of symbolic links";
++ break;
++ case EHOSTDOWN:
++ msg = "Host is down";
++ break;
++ case EHOSTUNREACH:
++ msg = "No route to host";
++ break;
++ case EPROCLIM:
++ msg = "Too many processes";
++ break;
++ case EUSERS:
++ msg = "Too many users";
++ break;
++ case EDQUOT:
++ msg = "Disk quota exceeded";
++ break;
++ case ESTALE:
++ msg = "Stale NFS file handle";
++ break;
++ case EREMOTE:
++ msg = "Object is remote";
++ break;
++# if HAVE_WINSOCK2_H
++ /* WSA_INVALID_HANDLE maps to EBADF */
++ /* WSA_NOT_ENOUGH_MEMORY maps to ENOMEM */
++ /* WSA_INVALID_PARAMETER maps to EINVAL */
++ case WSA_OPERATION_ABORTED:
++ msg = "Overlapped operation aborted";
++ break;
++ case WSA_IO_INCOMPLETE:
++ msg = "Overlapped I/O event object not in signaled state";
++ break;
++ case WSA_IO_PENDING:
++ msg = "Overlapped operations will complete later";
++ break;
++ /* WSAEINTR maps to EINTR */
++ /* WSAEBADF maps to EBADF */
++ /* WSAEACCES maps to EACCES */
++ /* WSAEFAULT maps to EFAULT */
++ /* WSAEINVAL maps to EINVAL */
++ /* WSAEMFILE maps to EMFILE */
++ /* WSAEWOULDBLOCK maps to EWOULDBLOCK */
++ /* WSAEINPROGRESS is EINPROGRESS */
++ /* WSAEALREADY is EALREADY */
++ /* WSAENOTSOCK is ENOTSOCK */
++ /* WSAEDESTADDRREQ is EDESTADDRREQ */
++ /* WSAEMSGSIZE is EMSGSIZE */
++ /* WSAEPROTOTYPE is EPROTOTYPE */
++ /* WSAENOPROTOOPT is ENOPROTOOPT */
++ /* WSAEPROTONOSUPPORT is EPROTONOSUPPORT */
++ /* WSAESOCKTNOSUPPORT is ESOCKTNOSUPPORT */
++ /* WSAEOPNOTSUPP is EOPNOTSUPP */
++ /* WSAEPFNOSUPPORT is EPFNOSUPPORT */
++ /* WSAEAFNOSUPPORT is EAFNOSUPPORT */
++ /* WSAEADDRINUSE is EADDRINUSE */
++ /* WSAEADDRNOTAVAIL is EADDRNOTAVAIL */
++ /* WSAENETDOWN is ENETDOWN */
++ /* WSAENETUNREACH is ENETUNREACH */
++ /* WSAENETRESET is ENETRESET */
++ /* WSAECONNABORTED is ECONNABORTED */
++ /* WSAECONNRESET is ECONNRESET */
++ /* WSAENOBUFS is ENOBUFS */
++ /* WSAEISCONN is EISCONN */
++ /* WSAENOTCONN is ENOTCONN */
++ /* WSAESHUTDOWN is ESHUTDOWN */
++ /* WSAETOOMANYREFS is ETOOMANYREFS */
++ /* WSAETIMEDOUT is ETIMEDOUT */
++ /* WSAECONNREFUSED is ECONNREFUSED */
++ /* WSAELOOP is ELOOP */
++ /* WSAENAMETOOLONG maps to ENAMETOOLONG */
++ /* WSAEHOSTDOWN is EHOSTDOWN */
++ /* WSAEHOSTUNREACH is EHOSTUNREACH */
++ /* WSAENOTEMPTY maps to ENOTEMPTY */
++ /* WSAEPROCLIM is EPROCLIM */
++ /* WSAEUSERS is EUSERS */
++ /* WSAEDQUOT is EDQUOT */
++ /* WSAESTALE is ESTALE */
++ /* WSAEREMOTE is EREMOTE */
++ case WSASYSNOTREADY:
++ msg = "Network subsystem is unavailable";
++ break;
++ case WSAVERNOTSUPPORTED:
++ msg = "Winsock.dll version out of range";
++ break;
++ case WSANOTINITIALISED:
++ msg = "Successful WSAStartup not yet performed";
++ break;
++ case WSAEDISCON:
++ msg = "Graceful shutdown in progress";
++ break;
++ case WSAENOMORE: case WSA_E_NO_MORE:
++ msg = "No more results";
++ break;
++ case WSAECANCELLED: case WSA_E_CANCELLED:
++ msg = "Call was canceled";
++ break;
++ case WSAEINVALIDPROCTABLE:
++ msg = "Procedure call table is invalid";
++ break;
++ case WSAEINVALIDPROVIDER:
++ msg = "Service provider is invalid";
++ break;
++ case WSAEPROVIDERFAILEDINIT:
++ msg = "Service provider failed to initialize";
++ break;
++ case WSASYSCALLFAILURE:
++ msg = "System call failure";
++ break;
++ case WSASERVICE_NOT_FOUND:
++ msg = "Service not found";
++ break;
++ case WSATYPE_NOT_FOUND:
++ msg = "Class type not found";
++ break;
++ case WSAEREFUSED:
++ msg = "Database query was refused";
++ break;
++ case WSAHOST_NOT_FOUND:
++ msg = "Host not found";
++ break;
++ case WSATRY_AGAIN:
++ msg = "Nonauthoritative host not found";
++ break;
++ case WSANO_RECOVERY:
++ msg = "Nonrecoverable error";
++ break;
++ case WSANO_DATA:
++ msg = "Valid name, no data record of requested type";
++ break;
++ /* WSA_QOS_* omitted */
++# endif
++# endif
++
++# if GNULIB_defined_ENOMSG
++ case ENOMSG:
++ msg = "No message of desired type";
++ break;
++# endif
++
++# if GNULIB_defined_EIDRM
++ case EIDRM:
++ msg = "Identifier removed";
++ break;
++# endif
++
++# if GNULIB_defined_ENOLINK
++ case ENOLINK:
++ msg = "Link has been severed";
++ break;
++# endif
++
++# if GNULIB_defined_EPROTO
++ case EPROTO:
++ msg = "Protocol error";
++ break;
++# endif
++
++# if GNULIB_defined_EMULTIHOP
++ case EMULTIHOP:
++ msg = "Multihop attempted";
++ break;
++# endif
++
++# if GNULIB_defined_EBADMSG
++ case EBADMSG:
++ msg = "Bad message";
++ break;
++# endif
++
++# if GNULIB_defined_EOVERFLOW
++ case EOVERFLOW:
++ msg = "Value too large for defined data type";
++ break;
++# endif
++
++# if GNULIB_defined_ENOTSUP
++ case ENOTSUP:
++ msg = "Not supported";
++ break;
++# endif
++
++# if GNULIB_defined_ESTALE
++ case ESTALE:
++ msg = "Stale NFS file handle";
++ break;
++# endif
++
++# if GNULIB_defined_EDQUOT
++ case EDQUOT:
++ msg = "Disk quota exceeded";
++ break;
++# endif
++
++# if GNULIB_defined_ECANCELED
++ case ECANCELED:
++ msg = "Operation canceled";
++ break;
++# endif
++ }
+
+- /* Cast away const, due to the historical signature of strerror;
+- callers should not be modifying the string. */
+- const char *msg = strerror_override (n);
+ if (msg)
+ return (char *) msg;
+
+- msg = strerror (n);
++ {
++ char *result = strerror (n);
+
+- /* Our strerror_r implementation might use the system's strerror
+- buffer, so all other clients of strerror have to see the error
+- copied into a buffer that we manage. This is not thread-safe,
+- even if the system strerror is, but portable programs shouldn't
+- be using strerror if they care about thread-safety. */
+- if (!msg || !*msg)
+- {
+- static char const fmt[] = "Unknown error %d";
+- verify (sizeof buf >= sizeof (fmt) + INT_STRLEN_BOUND (n));
+- sprintf (buf, fmt, n);
+- errno = EINVAL;
+- return buf;
+- }
++ if (result == NULL || result[0] == '\0')
++ {
++ static char const fmt[] = "Unknown error (%d)";
++ static char msg_buf[sizeof fmt + INT_STRLEN_BOUND (n)];
++ sprintf (msg_buf, fmt, n);
++ return msg_buf;
++ }
+
+- /* Fix STACKBUF_LEN if this ever aborts. */
+- len = strlen (msg);
+- if (sizeof buf <= len)
+- abort ();
+-
+- return memcpy (buf, msg, len + 1);
++ return result;
++ }
+ }
++
++#endif
+diff -Naurp libiconv-1.14.org//srclib/strerror-override.c libiconv-1.14/srclib/strerror-override.c
+--- libiconv-1.14.org//srclib/strerror-override.c 2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/strerror-override.c 1969-12-31 16:00:00.000000000 -0800
+@@ -1,279 +0,0 @@
+-/* strerror-override.c --- POSIX compatible system error routine
+-
+- Copyright (C) 2010-2011 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
+- (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/>. */
+-
+-/* Written by Bruno Haible <bruno@clisp.org>, 2010. */
+-
+-#include <config.h>
+-
+-#include "strerror-override.h"
+-
+-#include <errno.h>
+-
+-#if GNULIB_defined_ESOCK /* native Windows platforms */
+-# if HAVE_WINSOCK2_H
+-# include <winsock2.h>
+-# endif
+-#endif
+-
+-/* If ERRNUM maps to an errno value defined by gnulib, return a string
+- describing the error. Otherwise return NULL. */
+-const char *
+-strerror_override (int errnum)
+-{
+- /* These error messages are taken from glibc/sysdeps/gnu/errlist.c. */
+- switch (errnum)
+- {
+-#if REPLACE_STRERROR_0
+- case 0:
+- return "Success";
+-#endif
+-
+-#if GNULIB_defined_ETXTBSY
+- case ETXTBSY:
+- return "Text file busy";
+-#endif
+-
+-#if GNULIB_defined_ESOCK /* native Windows platforms */
+- /* EWOULDBLOCK is the same as EAGAIN. */
+- case EINPROGRESS:
+- return "Operation now in progress";
+- case EALREADY:
+- return "Operation already in progress";
+- case ENOTSOCK:
+- return "Socket operation on non-socket";
+- case EDESTADDRREQ:
+- return "Destination address required";
+- case EMSGSIZE:
+- return "Message too long";
+- case EPROTOTYPE:
+- return "Protocol wrong type for socket";
+- case ENOPROTOOPT:
+- return "Protocol not available";
+- case EPROTONOSUPPORT:
+- return "Protocol not supported";
+- case ESOCKTNOSUPPORT:
+- return "Socket type not supported";
+- case EOPNOTSUPP:
+- return "Operation not supported";
+- case EPFNOSUPPORT:
+- return "Protocol family not supported";
+- case EAFNOSUPPORT:
+- return "Address family not supported by protocol";
+- case EADDRINUSE:
+- return "Address already in use";
+- case EADDRNOTAVAIL:
+- return "Cannot assign requested address";
+- case ENETDOWN:
+- return "Network is down";
+- case ENETUNREACH:
+- return "Network is unreachable";
+- case ENETRESET:
+- return "Network dropped connection on reset";
+- case ECONNABORTED:
+- return "Software caused connection abort";
+- case ECONNRESET:
+- return "Connection reset by peer";
+- case ENOBUFS:
+- return "No buffer space available";
+- case EISCONN:
+- return "Transport endpoint is already connected";
+- case ENOTCONN:
+- return "Transport endpoint is not connected";
+- case ESHUTDOWN:
+- return "Cannot send after transport endpoint shutdown";
+- case ETOOMANYREFS:
+- return "Too many references: cannot splice";
+- case ETIMEDOUT:
+- return "Connection timed out";
+- case ECONNREFUSED:
+- return "Connection refused";
+- case ELOOP:
+- return "Too many levels of symbolic links";
+- case EHOSTDOWN:
+- return "Host is down";
+- case EHOSTUNREACH:
+- return "No route to host";
+- case EPROCLIM:
+- return "Too many processes";
+- case EUSERS:
+- return "Too many users";
+- case EDQUOT:
+- return "Disk quota exceeded";
+- case ESTALE:
+- return "Stale NFS file handle";
+- case EREMOTE:
+- return "Object is remote";
+-# if HAVE_WINSOCK2_H
+- /* WSA_INVALID_HANDLE maps to EBADF */
+- /* WSA_NOT_ENOUGH_MEMORY maps to ENOMEM */
+- /* WSA_INVALID_PARAMETER maps to EINVAL */
+- case WSA_OPERATION_ABORTED:
+- return "Overlapped operation aborted";
+- case WSA_IO_INCOMPLETE:
+- return "Overlapped I/O event object not in signaled state";
+- case WSA_IO_PENDING:
+- return "Overlapped operations will complete later";
+- /* WSAEINTR maps to EINTR */
+- /* WSAEBADF maps to EBADF */
+- /* WSAEACCES maps to EACCES */
+- /* WSAEFAULT maps to EFAULT */
+- /* WSAEINVAL maps to EINVAL */
+- /* WSAEMFILE maps to EMFILE */
+- /* WSAEWOULDBLOCK maps to EWOULDBLOCK */
+- /* WSAEINPROGRESS is EINPROGRESS */
+- /* WSAEALREADY is EALREADY */
+- /* WSAENOTSOCK is ENOTSOCK */
+- /* WSAEDESTADDRREQ is EDESTADDRREQ */
+- /* WSAEMSGSIZE is EMSGSIZE */
+- /* WSAEPROTOTYPE is EPROTOTYPE */
+- /* WSAENOPROTOOPT is ENOPROTOOPT */
+- /* WSAEPROTONOSUPPORT is EPROTONOSUPPORT */
+- /* WSAESOCKTNOSUPPORT is ESOCKTNOSUPPORT */
+- /* WSAEOPNOTSUPP is EOPNOTSUPP */
+- /* WSAEPFNOSUPPORT is EPFNOSUPPORT */
+- /* WSAEAFNOSUPPORT is EAFNOSUPPORT */
+- /* WSAEADDRINUSE is EADDRINUSE */
+- /* WSAEADDRNOTAVAIL is EADDRNOTAVAIL */
+- /* WSAENETDOWN is ENETDOWN */
+- /* WSAENETUNREACH is ENETUNREACH */
+- /* WSAENETRESET is ENETRESET */
+- /* WSAECONNABORTED is ECONNABORTED */
+- /* WSAECONNRESET is ECONNRESET */
+- /* WSAENOBUFS is ENOBUFS */
+- /* WSAEISCONN is EISCONN */
+- /* WSAENOTCONN is ENOTCONN */
+- /* WSAESHUTDOWN is ESHUTDOWN */
+- /* WSAETOOMANYREFS is ETOOMANYREFS */
+- /* WSAETIMEDOUT is ETIMEDOUT */
+- /* WSAECONNREFUSED is ECONNREFUSED */
+- /* WSAELOOP is ELOOP */
+- /* WSAENAMETOOLONG maps to ENAMETOOLONG */
+- /* WSAEHOSTDOWN is EHOSTDOWN */
+- /* WSAEHOSTUNREACH is EHOSTUNREACH */
+- /* WSAENOTEMPTY maps to ENOTEMPTY */
+- /* WSAEPROCLIM is EPROCLIM */
+- /* WSAEUSERS is EUSERS */
+- /* WSAEDQUOT is EDQUOT */
+- /* WSAESTALE is ESTALE */
+- /* WSAEREMOTE is EREMOTE */
+- case WSASYSNOTREADY:
+- return "Network subsystem is unavailable";
+- case WSAVERNOTSUPPORTED:
+- return "Winsock.dll version out of range";
+- case WSANOTINITIALISED:
+- return "Successful WSAStartup not yet performed";
+- case WSAEDISCON:
+- return "Graceful shutdown in progress";
+- case WSAENOMORE: case WSA_E_NO_MORE:
+- return "No more results";
+- case WSAECANCELLED: case WSA_E_CANCELLED:
+- return "Call was canceled";
+- case WSAEINVALIDPROCTABLE:
+- return "Procedure call table is invalid";
+- case WSAEINVALIDPROVIDER:
+- return "Service provider is invalid";
+- case WSAEPROVIDERFAILEDINIT:
+- return "Service provider failed to initialize";
+- case WSASYSCALLFAILURE:
+- return "System call failure";
+- case WSASERVICE_NOT_FOUND:
+- return "Service not found";
+- case WSATYPE_NOT_FOUND:
+- return "Class type not found";
+- case WSAEREFUSED:
+- return "Database query was refused";
+- case WSAHOST_NOT_FOUND:
+- return "Host not found";
+- case WSATRY_AGAIN:
+- return "Nonauthoritative host not found";
+- case WSANO_RECOVERY:
+- return "Nonrecoverable error";
+- case WSANO_DATA:
+- return "Valid name, no data record of requested type";
+- /* WSA_QOS_* omitted */
+-# endif
+-#endif
+-
+-#if GNULIB_defined_ENOMSG
+- case ENOMSG:
+- return "No message of desired type";
+-#endif
+-
+-#if GNULIB_defined_EIDRM
+- case EIDRM:
+- return "Identifier removed";
+-#endif
+-
+-#if GNULIB_defined_ENOLINK
+- case ENOLINK:
+- return "Link has been severed";
+-#endif
+-
+-#if GNULIB_defined_EPROTO
+- case EPROTO:
+- return "Protocol error";
+-#endif
+-
+-#if GNULIB_defined_EMULTIHOP
+- case EMULTIHOP:
+- return "Multihop attempted";
+-#endif
+-
+-#if GNULIB_defined_EBADMSG
+- case EBADMSG:
+- return "Bad message";
+-#endif
+-
+-#if GNULIB_defined_EOVERFLOW
+- case EOVERFLOW:
+- return "Value too large for defined data type";
+-#endif
+-
+-#if GNULIB_defined_ENOTSUP
+- case ENOTSUP:
+- return "Not supported";
+-#endif
+-
+-#if GNULIB_defined_ENETRESET
+- case ENETRESET:
+- return "Network dropped connection on reset";
+-#endif
+-
+-#if GNULIB_defined_ECONNABORTED
+- case ECONNABORTED:
+- return "Software caused connection abort";
+-#endif
+-
+-#if GNULIB_defined_ESTALE
+- case ESTALE:
+- return "Stale NFS file handle";
+-#endif
+-
+-#if GNULIB_defined_EDQUOT
+- case EDQUOT:
+- return "Disk quota exceeded";
+-#endif
+-
+-#if GNULIB_defined_ECANCELED
+- case ECANCELED:
+- return "Operation canceled";
+-#endif
+-
+- default:
+- return NULL;
+- }
+-}
+diff -Naurp libiconv-1.14.org//srclib/strerror-override.h libiconv-1.14/srclib/strerror-override.h
+--- libiconv-1.14.org//srclib/strerror-override.h 2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/strerror-override.h 1969-12-31 16:00:00.000000000 -0800
+@@ -1,52 +0,0 @@
+-/* strerror-override.h --- POSIX compatible system error routine
+-
+- Copyright (C) 2010-2011 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
+- (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/>. */
+-
+-#ifndef _GL_STRERROR_OVERRIDE_H
+-# define _GL_STRERROR_OVERRIDE_H
+-
+-# include <errno.h>
+-# include <stddef.h>
+-
+-/* Reasonable buffer size that should never trigger ERANGE; if this
+- proves too small, we intentionally abort(), to remind us to fix
+- this value. */
+-# define STACKBUF_LEN 256
+-
+-/* If ERRNUM maps to an errno value defined by gnulib, return a string
+- describing the error. Otherwise return NULL. */
+-# if REPLACE_STRERROR_0 \
+- || GNULIB_defined_ETXTBSY \
+- || GNULIB_defined_ESOCK \
+- || GNULIB_defined_ENOMSG \
+- || GNULIB_defined_EIDRM \
+- || GNULIB_defined_ENOLINK \
+- || GNULIB_defined_EPROTO \
+- || GNULIB_defined_EMULTIHOP \
+- || GNULIB_defined_EBADMSG \
+- || GNULIB_defined_EOVERFLOW \
+- || GNULIB_defined_ENOTSUP \
+- || GNULIB_defined_ENETRESET \
+- || GNULIB_defined_ECONNABORTED \
+- || GNULIB_defined_ESTALE \
+- || GNULIB_defined_EDQUOT \
+- || GNULIB_defined_ECANCELED
+-extern const char *strerror_override (int errnum);
+-# else
+-# define strerror_override(ignored) NULL
+-# endif
+-
+-#endif /* _GL_STRERROR_OVERRIDE_H */
+diff -Naurp libiconv-1.14.org//srclib/string.in.h libiconv-1.14/srclib/string.in.h
+--- libiconv-1.14.org//srclib/string.in.h 2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/string.in.h 2012-01-08 02:07:40.418484461 -0800
+@@ -16,7 +16,7 @@
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+-#ifndef _@GUARD_PREFIX@_STRING_H
++#ifndef _GL_STRING_H
+
+ #if __GNUC__ >= 3
+ @PRAGMA_SYSTEM_HEADER@
+@@ -26,8 +26,8 @@
+ /* The include_next requires a split double-inclusion guard. */
+ #@INCLUDE_NEXT@ @NEXT_STRING_H@
+
+-#ifndef _@GUARD_PREFIX@_STRING_H
+-#define _@GUARD_PREFIX@_STRING_H
++#ifndef _GL_STRING_H
++#define _GL_STRING_H
+
+ /* NetBSD 5.0 mis-defines NULL. */
+ #include <stddef.h>
+@@ -59,36 +59,6 @@
+ /* The definition of _GL_WARN_ON_USE is copied here. */
+
+
+-/* Find the index of the least-significant set bit. */
+-#if @GNULIB_FFSL@
+-# if !@HAVE_FFSL@
+-_GL_FUNCDECL_SYS (ffsl, int, (long int i));
+-# endif
+-_GL_CXXALIAS_SYS (ffsl, int, (long int i));
+-_GL_CXXALIASWARN (ffsl);
+-#elif defined GNULIB_POSIXCHECK
+-# undef ffsl
+-# if HAVE_RAW_DECL_FFSL
+-_GL_WARN_ON_USE (ffsl, "ffsl is not portable - use the ffsl module");
+-# endif
+-#endif
+-
+-
+-/* Find the index of the least-significant set bit. */
+-#if @GNULIB_FFSLL@
+-# if !@HAVE_FFSLL@
+-_GL_FUNCDECL_SYS (ffsll, int, (long long int i));
+-# endif
+-_GL_CXXALIAS_SYS (ffsll, int, (long long int i));
+-_GL_CXXALIASWARN (ffsll);
+-#elif defined GNULIB_POSIXCHECK
+-# undef ffsll
+-# if HAVE_RAW_DECL_FFSLL
+-_GL_WARN_ON_USE (ffsll, "ffsll is not portable - use the ffsll module");
+-# endif
+-#endif
+-
+-
+ /* Return the first instance of C within N bytes of S, or NULL. */
+ #if @GNULIB_MEMCHR@
+ # if @REPLACE_MEMCHR@
+@@ -1007,5 +977,5 @@ _GL_WARN_ON_USE (strverscmp, "strverscmp
+ #endif
+
+
+-#endif /* _@GUARD_PREFIX@_STRING_H */
+-#endif /* _@GUARD_PREFIX@_STRING_H */
++#endif /* _GL_STRING_H */
++#endif /* _GL_STRING_H */
+diff -Naurp libiconv-1.14.org//srclib/sys_stat.in.h libiconv-1.14/srclib/sys_stat.in.h
+--- libiconv-1.14.org//srclib/sys_stat.in.h 2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/sys_stat.in.h 2012-01-08 02:07:40.430484461 -0800
+@@ -34,7 +34,7 @@
+ #else
+ /* Normal invocation convention. */
+
+-#ifndef _@GUARD_PREFIX@_SYS_STAT_H
++#ifndef _GL_SYS_STAT_H
+
+ /* Get nlink_t. */
+ #include <sys/types.h>
+@@ -45,8 +45,8 @@
+ /* The include_next requires a split double-inclusion guard. */
+ #@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@
+
+-#ifndef _@GUARD_PREFIX@_SYS_STAT_H
+-#define _@GUARD_PREFIX@_SYS_STAT_H
++#ifndef _GL_SYS_STAT_H
++#define _GL_SYS_STAT_H
+
+ /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+@@ -653,6 +653,6 @@ _GL_WARN_ON_USE (utimensat, "utimensat i
+ #endif
+
+
+-#endif /* _@GUARD_PREFIX@_SYS_STAT_H */
+-#endif /* _@GUARD_PREFIX@_SYS_STAT_H */
++#endif /* _GL_SYS_STAT_H */
++#endif /* _GL_SYS_STAT_H */
+ #endif
+diff -Naurp libiconv-1.14.org//srclib/time.in.h libiconv-1.14/srclib/time.in.h
+--- libiconv-1.14.org//srclib/time.in.h 2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/time.in.h 2012-01-08 02:07:40.438484462 -0800
+@@ -28,13 +28,13 @@
+ without adding our own declarations. */
+ #if (defined __need_time_t || defined __need_clock_t \
+ || defined __need_timespec \
+- || defined _@GUARD_PREFIX@_TIME_H)
++ || defined _GL_TIME_H)
+
+ # @INCLUDE_NEXT@ @NEXT_TIME_H@
+
+ #else
+
+-# define _@GUARD_PREFIX@_TIME_H
++# define _GL_TIME_H
+
+ # @INCLUDE_NEXT@ @NEXT_TIME_H@
+
+diff -Naurp libiconv-1.14.org//srclib/unistd.in.h libiconv-1.14/srclib/unistd.in.h
+--- libiconv-1.14.org//srclib/unistd.in.h 2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/unistd.in.h 2012-01-08 02:07:40.450484462 -0800
+@@ -36,7 +36,7 @@
+ # define _GL_WINSOCK2_H_WITNESS
+
+ /* Normal invocation. */
+-#elif !defined _@GUARD_PREFIX@_UNISTD_H
++#elif !defined _GL_UNISTD_H
+
+ /* The include_next requires a split double-inclusion guard. */
+ #if @HAVE_UNISTD_H@
+@@ -51,8 +51,8 @@
+ # undef _GL_INCLUDING_WINSOCK2_H
+ #endif
+
+-#if !defined _@GUARD_PREFIX@_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H
+-#define _@GUARD_PREFIX@_UNISTD_H
++#if !defined _GL_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H
++#define _GL_UNISTD_H
+
+ /* NetBSD 5.0 mis-defines NULL. Also get size_t. */
+ #include <stddef.h>
+@@ -117,77 +117,78 @@
+ /* The definition of _GL_WARN_ON_USE is copied here. */
+
+
+-/* Hide some function declarations from <winsock2.h>. */
+-
+-#if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@
+-# if !defined _@GUARD_PREFIX@_SYS_SOCKET_H
+-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+-# undef socket
+-# define socket socket_used_without_including_sys_socket_h
+-# undef connect
+-# define connect connect_used_without_including_sys_socket_h
+-# undef accept
+-# define accept accept_used_without_including_sys_socket_h
+-# undef bind
+-# define bind bind_used_without_including_sys_socket_h
+-# undef getpeername
+-# define getpeername getpeername_used_without_including_sys_socket_h
+-# undef getsockname
+-# define getsockname getsockname_used_without_including_sys_socket_h
+-# undef getsockopt
+-# define getsockopt getsockopt_used_without_including_sys_socket_h
+-# undef listen
+-# define listen listen_used_without_including_sys_socket_h
+-# undef recv
+-# define recv recv_used_without_including_sys_socket_h
+-# undef send
+-# define send send_used_without_including_sys_socket_h
+-# undef recvfrom
+-# define recvfrom recvfrom_used_without_including_sys_socket_h
+-# undef sendto
+-# define sendto sendto_used_without_including_sys_socket_h
+-# undef setsockopt
+-# define setsockopt setsockopt_used_without_including_sys_socket_h
+-# undef shutdown
+-# define shutdown shutdown_used_without_including_sys_socket_h
+-# else
+- _GL_WARN_ON_USE (socket,
+- "socket() used without including <sys/socket.h>");
+- _GL_WARN_ON_USE (connect,
+- "connect() used without including <sys/socket.h>");
+- _GL_WARN_ON_USE (accept,
+- "accept() used without including <sys/socket.h>");
+- _GL_WARN_ON_USE (bind,
+- "bind() used without including <sys/socket.h>");
+- _GL_WARN_ON_USE (getpeername,
+- "getpeername() used without including <sys/socket.h>");
+- _GL_WARN_ON_USE (getsockname,
+- "getsockname() used without including <sys/socket.h>");
+- _GL_WARN_ON_USE (getsockopt,
+- "getsockopt() used without including <sys/socket.h>");
+- _GL_WARN_ON_USE (listen,
+- "listen() used without including <sys/socket.h>");
+- _GL_WARN_ON_USE (recv,
+- "recv() used without including <sys/socket.h>");
+- _GL_WARN_ON_USE (send,
+- "send() used without including <sys/socket.h>");
+- _GL_WARN_ON_USE (recvfrom,
+- "recvfrom() used without including <sys/socket.h>");
+- _GL_WARN_ON_USE (sendto,
+- "sendto() used without including <sys/socket.h>");
+- _GL_WARN_ON_USE (setsockopt,
+- "setsockopt() used without including <sys/socket.h>");
+- _GL_WARN_ON_USE (shutdown,
+- "shutdown() used without including <sys/socket.h>");
++#if @GNULIB_GETHOSTNAME@
++/* Get all possible declarations of gethostname(). */
++# if @UNISTD_H_HAVE_WINSOCK2_H@
++# if !defined _GL_SYS_SOCKET_H
++# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
++# undef socket
++# define socket socket_used_without_including_sys_socket_h
++# undef connect
++# define connect connect_used_without_including_sys_socket_h
++# undef accept
++# define accept accept_used_without_including_sys_socket_h
++# undef bind
++# define bind bind_used_without_including_sys_socket_h
++# undef getpeername
++# define getpeername getpeername_used_without_including_sys_socket_h
++# undef getsockname
++# define getsockname getsockname_used_without_including_sys_socket_h
++# undef getsockopt
++# define getsockopt getsockopt_used_without_including_sys_socket_h
++# undef listen
++# define listen listen_used_without_including_sys_socket_h
++# undef recv
++# define recv recv_used_without_including_sys_socket_h
++# undef send
++# define send send_used_without_including_sys_socket_h
++# undef recvfrom
++# define recvfrom recvfrom_used_without_including_sys_socket_h
++# undef sendto
++# define sendto sendto_used_without_including_sys_socket_h
++# undef setsockopt
++# define setsockopt setsockopt_used_without_including_sys_socket_h
++# undef shutdown
++# define shutdown shutdown_used_without_including_sys_socket_h
++# else
++ _GL_WARN_ON_USE (socket,
++ "socket() used without including <sys/socket.h>");
++ _GL_WARN_ON_USE (connect,
++ "connect() used without including <sys/socket.h>");
++ _GL_WARN_ON_USE (accept,
++ "accept() used without including <sys/socket.h>");
++ _GL_WARN_ON_USE (bind,
++ "bind() used without including <sys/socket.h>");
++ _GL_WARN_ON_USE (getpeername,
++ "getpeername() used without including <sys/socket.h>");
++ _GL_WARN_ON_USE (getsockname,
++ "getsockname() used without including <sys/socket.h>");
++ _GL_WARN_ON_USE (getsockopt,
++ "getsockopt() used without including <sys/socket.h>");
++ _GL_WARN_ON_USE (listen,
++ "listen() used without including <sys/socket.h>");
++ _GL_WARN_ON_USE (recv,
++ "recv() used without including <sys/socket.h>");
++ _GL_WARN_ON_USE (send,
++ "send() used without including <sys/socket.h>");
++ _GL_WARN_ON_USE (recvfrom,
++ "recvfrom() used without including <sys/socket.h>");
++ _GL_WARN_ON_USE (sendto,
++ "sendto() used without including <sys/socket.h>");
++ _GL_WARN_ON_USE (setsockopt,
++ "setsockopt() used without including <sys/socket.h>");
++ _GL_WARN_ON_USE (shutdown,
++ "shutdown() used without including <sys/socket.h>");
++# endif
+ # endif
+-# endif
+-# if !defined _@GUARD_PREFIX@_SYS_SELECT_H
+-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+-# undef select
+-# define select select_used_without_including_sys_select_h
+-# else
+- _GL_WARN_ON_USE (select,
+- "select() used without including <sys/select.h>");
++# if !defined _GL_SYS_SELECT_H
++# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
++# undef select
++# define select select_used_without_including_sys_select_h
++# else
++ _GL_WARN_ON_USE (select,
++ "select() used without including <sys/select.h>");
++# endif
+ # endif
+ # endif
+ #endif
+@@ -1061,7 +1062,6 @@ _GL_WARN_ON_USE (pipe2, "pipe2 is unport
+ specification <http://www.opengroup.org/susv3xsh/pread.html>. */
+ # if @REPLACE_PREAD@
+ # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+-# undef pread
+ # define pread rpl_pread
+ # endif
+ _GL_FUNCDECL_RPL (pread, ssize_t,
+@@ -1096,7 +1096,6 @@ _GL_WARN_ON_USE (pread, "pread is unport
+ <http://www.opengroup.org/susv3xsh/pwrite.html>. */
+ # if @REPLACE_PWRITE@
+ # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+-# undef pwrite
+ # define pwrite rpl_pwrite
+ # endif
+ _GL_FUNCDECL_RPL (pwrite, ssize_t,
+@@ -1417,5 +1416,5 @@ _GL_CXXALIASWARN (write);
+ #endif
+
+
+-#endif /* _@GUARD_PREFIX@_UNISTD_H */
+-#endif /* _@GUARD_PREFIX@_UNISTD_H */
++#endif /* _GL_UNISTD_H */
++#endif /* _GL_UNISTD_H */
+diff -Naurp libiconv-1.14.org//srclib/verify.h libiconv-1.14/srclib/verify.h
+--- libiconv-1.14.org//srclib/verify.h 2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srclib/verify.h 2012-01-08 02:07:40.494484464 -0800
+@@ -164,13 +164,10 @@
+ (!!sizeof (_GL_VERIFY_TYPE (R, DIAGNOSTIC)))
+
+ # ifdef __cplusplus
+-# if !GNULIB_defined_struct__gl_verify_type
+ template <int w>
+ struct _gl_verify_type {
+ unsigned int _gl_verify_error_if_negative: w;
+ };
+-# define GNULIB_defined_struct__gl_verify_type 1
+-# endif
+ # define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
+ _gl_verify_type<(R) ? 1 : -1>
+ # elif defined _GL_HAVE__STATIC_ASSERT
+@@ -209,7 +206,7 @@ template <int w>
+ # endif
+ # endif
+
+-/* @assert.h omit start@ */
++# ifdef _GL_VERIFY_H
+
+ /* Each of these macros verifies that its argument R is nonzero. To
+ be portable, R should be an integer constant expression. Unlike
+@@ -221,23 +218,15 @@ template <int w>
+ contexts, e.g., the top level. */
+
+ /* Verify requirement R at compile-time, as an integer constant expression.
+- Return 1. This is equivalent to verify_expr (R, 1).
+-
+- verify_true is obsolescent; please use verify_expr instead. */
+-
+-# define verify_true(R) _GL_VERIFY_TRUE (R, "verify_true (" #R ")")
++ Return 1. */
+
+-/* Verify requirement R at compile-time. Return the value of the
+- expression E. */
+-
+-# define verify_expr(R, E) \
+- (_GL_VERIFY_TRUE (R, "verify_expr (" #R ", " #E ")") ? (E) : (E))
++# define verify_true(R) _GL_VERIFY_TRUE (R, "verify_true (" #R ")")
+
+ /* Verify requirement R at compile-time, as a declaration without a
+ trailing ';'. */
+
+-# define verify(R) _GL_VERIFY (R, "verify (" #R ")")
++# define verify(R) _GL_VERIFY (R, "verify (" #R ")")
+
+-/* @assert.h omit end@ */
++# endif
+
+ #endif
+diff -Naurp libiconv-1.14.org//srcm4/canonicalize.m4 libiconv-1.14/srcm4/canonicalize.m4
+--- libiconv-1.14.org//srcm4/canonicalize.m4 2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/canonicalize.m4 2012-01-08 02:07:40.566484469 -0800
+@@ -1,4 +1,4 @@
+-# canonicalize.m4 serial 23
++# canonicalize.m4 serial 21
+
+ dnl Copyright (C) 2003-2007, 2009-2011 Free Software Foundation, Inc.
+
+@@ -10,6 +10,8 @@ dnl with or without modifications, as lo
+ # not provide or fix realpath.
+ AC_DEFUN([gl_FUNC_CANONICALIZE_FILENAME_MODE],
+ [
++ AC_LIBOBJ([canonicalize])
++
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_CHECK_FUNCS_ONCE([canonicalize_file_name])
+ AC_REQUIRE([gl_DOUBLE_SLASH_ROOT])
+@@ -28,14 +30,16 @@ AC_DEFUN([gl_CANONICALIZE_LGPL],
+ AC_REQUIRE([gl_CANONICALIZE_LGPL_SEPARATE])
+ if test $ac_cv_func_canonicalize_file_name = no; then
+ HAVE_CANONICALIZE_FILE_NAME=0
++ AC_LIBOBJ([canonicalize-lgpl])
+ if test $ac_cv_func_realpath = no; then
+ HAVE_REALPATH=0
+ elif test "$gl_cv_func_realpath_works" != yes; then
+ REPLACE_REALPATH=1
+ fi
+ elif test "$gl_cv_func_realpath_works" != yes; then
+- REPLACE_CANONICALIZE_FILE_NAME=1
++ AC_LIBOBJ([canonicalize-lgpl])
+ REPLACE_REALPATH=1
++ REPLACE_CANONICALIZE_FILE_NAME=1
+ fi
+ ])
+
+diff -Naurp libiconv-1.14.org//srcm4/errno_h.m4 libiconv-1.14/srcm4/errno_h.m4
+--- libiconv-1.14.org//srcm4/errno_h.m4 2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/errno_h.m4 2012-01-08 02:07:40.590484469 -0800
+@@ -1,4 +1,4 @@
+-# errno_h.m4 serial 10
++# errno_h.m4 serial 9
+ dnl Copyright (C) 2004, 2006, 2008-2011 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+@@ -34,12 +34,6 @@ booboo
+ #if !defined ENOTSUP
+ booboo
+ #endif
+-#if !defined ENETRESET
+-booboo
+-#endif
+-#if !defined ECONNABORTED
+-booboo
+-#endif
+ #if !defined ESTALE
+ booboo
+ #endif
+diff -Naurp libiconv-1.14.org//srcm4/error.m4 libiconv-1.14/srcm4/error.m4
+--- libiconv-1.14.org//srcm4/error.m4 2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/error.m4 2012-01-08 02:07:40.598484470 -0800
+@@ -1,4 +1,4 @@
+-#serial 14
++#serial 13
+
+ # Copyright (C) 1996-1998, 2001-2004, 2009-2011 Free Software Foundation, Inc.
+ #
+@@ -8,8 +8,16 @@
+
+ AC_DEFUN([gl_ERROR],
+ [
+- dnl We don't use AC_FUNC_ERROR_AT_LINE any more, because it is no longer
+- dnl maintained in Autoconf and because it invokes AC_LIBOBJ.
++ AC_FUNC_ERROR_AT_LINE
++ dnl Note: AC_FUNC_ERROR_AT_LINE does AC_LIBSOURCES([error.h, error.c]).
++ gl_PREREQ_ERROR
++])
++
++# Redefine AC_FUNC_ERROR_AT_LINE, because it is no longer maintained in
++# Autoconf.
++AC_DEFUN([AC_FUNC_ERROR_AT_LINE],
++[
++ AC_LIBSOURCES([error.h, error.c])dnl
+ AC_CACHE_CHECK([for error_at_line], [ac_cv_lib_error_at_line],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+@@ -17,6 +25,9 @@ AC_DEFUN([gl_ERROR],
+ [[error_at_line (0, 0, "", 0, "an error occurred");]])],
+ [ac_cv_lib_error_at_line=yes],
+ [ac_cv_lib_error_at_line=no])])
++ if test $ac_cv_lib_error_at_line = no; then
++ AC_LIBOBJ([error])
++ fi
+ ])
+
+ # Prerequisites of lib/error.c.
+diff -Naurp libiconv-1.14.org//srcm4/extensions.m4 libiconv-1.14/srcm4/extensions.m4
+--- libiconv-1.14.org//srcm4/extensions.m4 2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/extensions.m4 2012-01-08 02:07:40.606484471 -0800
+@@ -1,4 +1,4 @@
+-# serial 10 -*- Autoconf -*-
++# serial 9 -*- Autoconf -*-
+ # Enable extensions on systems that normally disable them.
+
+ # Copyright (C) 2003, 2006-2011 Free Software Foundation, Inc.
+@@ -67,10 +67,6 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
+ #ifndef _ALL_SOURCE
+ # undef _ALL_SOURCE
+ #endif
+-/* Enable general extensions on MacOS X. */
+-#ifndef _DARWIN_C_SOURCE
+-# undef _DARWIN_C_SOURCE
+-#endif
+ /* Enable GNU extensions on systems that have them. */
+ #ifndef _GNU_SOURCE
+ # undef _GNU_SOURCE
+@@ -99,7 +95,6 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
+ test $ac_cv_safe_to_define___extensions__ = yes &&
+ AC_DEFINE([__EXTENSIONS__])
+ AC_DEFINE([_ALL_SOURCE])
+- AC_DEFINE([_DARWIN_C_SOURCE])
+ AC_DEFINE([_GNU_SOURCE])
+ AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+ AC_DEFINE([_TANDEM_SOURCE])
+diff -Naurp libiconv-1.14.org//srcm4/gnulib-cache.m4 libiconv-1.14/srcm4/gnulib-cache.m4
+--- libiconv-1.14.org//srcm4/gnulib-cache.m4 2011-08-07 06:42:11.000000000 -0700
++++ libiconv-1.14/srcm4/gnulib-cache.m4 2012-01-08 02:07:43.154484593 -0800
+@@ -15,7 +15,7 @@
+
+
+ # Specification in the form of a command-line invocation:
+-# gnulib-tool --import --dir=. --local-dir=gnulib-local --lib=libicrt --source-base=srclib --m4-base=srcm4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --makefile-name=Makefile.gnulib --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files binary-io error gettext gettext-h libiconv-misc mbstate memmove progname relocatable-prog safe-read sigpipe stdio stdlib strerror unistd uniwidth/width unlocked-io xalloc
++# gnulib-tool --import --dir=. --local-dir=gnulib-local --lib=libicrt --source-base=srclib --m4-base=srcm4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --makefile-name=Makefile.gnulib --no-libtool --macro-prefix=gl --no-vc-files binary-io error gettext gettext-h libiconv-misc mbstate memmove progname relocatable relocatable-prog safe-read sigpipe stdio stdlib strerror unistd uniwidth/width unlocked-io xalloc
+
+ # Specification in the form of a few gnulib-tool.m4 macro invocations:
+ gl_LOCAL_DIR([gnulib-local])
+@@ -28,6 +28,7 @@ gl_MODULES([
+ mbstate
+ memmove
+ progname
++ relocatable
+ relocatable-prog
+ safe-read
+ sigpipe
+@@ -49,5 +50,4 @@ gl_LIB([libicrt])
+ gl_MAKEFILE_NAME([Makefile.gnulib])
+ gl_MACRO_PREFIX([gl])
+ gl_PO_DOMAIN([])
+-gl_WITNESS_C_DOMAIN([])
+ gl_VC_FILES([false])
+diff -Naurp libiconv-1.14.org//srcm4/gnulib-common.m4 libiconv-1.14/srcm4/gnulib-common.m4
+--- libiconv-1.14.org//srcm4/gnulib-common.m4 2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/gnulib-common.m4 2012-01-08 02:07:40.634484471 -0800
+@@ -1,4 +1,4 @@
+-# gnulib-common.m4 serial 29
++# gnulib-common.m4 serial 24
+ dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+@@ -12,19 +12,6 @@ AC_DEFUN([gl_COMMON], [
+ AC_REQUIRE([gl_COMMON_BODY])
+ ])
+ AC_DEFUN([gl_COMMON_BODY], [
+- AH_VERBATIM([_Noreturn],
+-[/* The _Noreturn keyword of draft C1X. */
+-#ifndef _Noreturn
+-# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
+- || 0x5110 <= __SUNPRO_C)
+-# define _Noreturn __attribute__ ((__noreturn__))
+-# elif 1200 <= _MSC_VER
+-# define _Noreturn __declspec (noreturn)
+-# else
+-# define _Noreturn
+-# endif
+-#endif
+-])
+ AH_VERBATIM([isoc99_inline],
+ [/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
+ the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
+@@ -47,20 +34,6 @@ AC_DEFUN([gl_COMMON_BODY], [
+ /* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name
+ is a misnomer outside of parameter lists. */
+ #define _UNUSED_PARAMETER_ _GL_UNUSED
+-
+-/* The __pure__ attribute was added in gcc 2.96. */
+-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+-# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+-#else
+-# define _GL_ATTRIBUTE_PURE /* empty */
+-#endif
+-
+-/* The __const__ attribute was added in gcc 2.95. */
+-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
+-# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
+-#else
+-# define _GL_ATTRIBUTE_CONST /* empty */
+-#endif
+ ])
+ dnl Preparation for running test programs:
+ dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not
+@@ -74,49 +47,16 @@ AC_DEFUN([gl_COMMON_BODY], [
+ # expands to a C preprocessor expression that evaluates to 1 or 0, depending
+ # whether a gnulib module that has been requested shall be considered present
+ # or not.
+-m4_define([gl_MODULE_INDICATOR_CONDITION], [1])
++AC_DEFUN([gl_MODULE_INDICATOR_CONDITION], [1])
+
+ # gl_MODULE_INDICATOR_SET_VARIABLE([modulename])
+ # sets the shell variable that indicates the presence of the given module to
+ # a C preprocessor expression that will evaluate to 1.
+ AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE],
+ [
+- gl_MODULE_INDICATOR_SET_VARIABLE_AUX(
+- [GNULIB_[]m4_translit([[$1]],
+- [abcdefghijklmnopqrstuvwxyz./-],
+- [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])],
+- [gl_MODULE_INDICATOR_CONDITION])
+-])
+-
+-# gl_MODULE_INDICATOR_SET_VARIABLE_AUX([variable])
+-# modifies the shell variable to include the gl_MODULE_INDICATOR_CONDITION.
+-# The shell variable's value is a C preprocessor expression that evaluates
+-# to 0 or 1.
+-AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX],
+-[
+- m4_if(m4_defn([gl_MODULE_INDICATOR_CONDITION]), [1],
+- [
+- dnl Simplify the expression VALUE || 1 to 1.
+- $1=1
+- ],
+- [gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([$1],
+- [gl_MODULE_INDICATOR_CONDITION])])
+-])
+-
+-# gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([variable], [condition])
+-# modifies the shell variable to include the given condition. The shell
+-# variable's value is a C preprocessor expression that evaluates to 0 or 1.
+-AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR],
+-[
+- dnl Simplify the expression 1 || CONDITION to 1.
+- if test "$[]$1" != 1; then
+- dnl Simplify the expression 0 || CONDITION to CONDITION.
+- if test "$[]$1" = 0; then
+- $1=$2
+- else
+- $1="($[]$1 || $2)"
+- fi
+- fi
++ GNULIB_[]m4_translit([[$1]],
++ [abcdefghijklmnopqrstuvwxyz./-],
++ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=gl_MODULE_INDICATOR_CONDITION
+ ])
+
+ # gl_MODULE_INDICATOR([modulename])
+@@ -211,35 +151,6 @@ m4_ifndef([AS_VAR_IF],
+ [m4_define([AS_VAR_IF],
+ [AS_IF([test x"AS_VAR_GET([$1])" = x""$2], [$3], [$4])])])
+
+-# gl_PROG_AR_RANLIB
+-# Determines the values for AR, ARFLAGS, RANLIB that fit with the compiler.
+-AC_DEFUN([gl_PROG_AR_RANLIB],
+-[
+- dnl Minix 3 comes with two toolchains: The Amsterdam Compiler Kit compiler
+- dnl as "cc", and GCC as "gcc". They have different object file formats and
+- dnl library formats. In particular, the GNU binutils programs ar, ranlib
+- dnl produce libraries that work only with gcc, not with cc.
+- AC_REQUIRE([AC_PROG_CC])
+- AC_EGREP_CPP([Amsterdam],
+- [
+-#ifdef __ACK__
+-Amsterdam
+-#endif
+- ],
+- [AR='cc -c.a'
+- ARFLAGS='-o'
+- RANLIB=':'
+- ],
+- [dnl Use the Automake-documented default values for AR and ARFLAGS.
+- AR='ar'
+- ARFLAGS='cru'
+- dnl Use the ranlib program if it is available.
+- AC_PROG_RANLIB
+- ])
+- AC_SUBST([AR])
+- AC_SUBST([ARFLAGS])
+-])
+-
+ # AC_PROG_MKDIR_P
+ # is a backport of autoconf-2.60's AC_PROG_MKDIR_P, with a fix
+ # for interoperability with automake-1.9.6 from autoconf-2.62.
+diff -Naurp libiconv-1.14.org//srcm4/gnulib-comp.m4 libiconv-1.14/srcm4/gnulib-comp.m4
+--- libiconv-1.14.org//srcm4/gnulib-comp.m4 2011-08-07 06:42:12.000000000 -0700
++++ libiconv-1.14/srcm4/gnulib-comp.m4 2012-01-08 02:07:43.922484630 -0800
+@@ -25,12 +25,14 @@ AC_DEFUN([gl_EARLY],
+ m4_pattern_allow([^gl_ES$])dnl a valid locale name
+ m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
+ m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
+- AC_REQUIRE([gl_PROG_AR_RANLIB])
++ AC_REQUIRE([AC_PROG_RANLIB])
+ AC_REQUIRE([AM_PROG_CC_C_O])
+ # Code from module alloca-opt:
+ # Code from module allocator:
+ # Code from module areadlink:
++ # Code from module arg-nonnull:
+ # Code from module binary-io:
++ # Code from module c++defs:
+ # Code from module canonicalize-lgpl:
+ # Code from module careadlinkat:
+ # Code from module dosname:
+@@ -46,7 +48,6 @@ AC_DEFUN([gl_EARLY],
+ # Code from module havelib:
+ # Code from module include_next:
+ # Code from module intprops:
+- # Code from module largefile:
+ # Code from module libiconv-misc:
+ # Code from module lstat:
+ # Code from module malloca:
+@@ -64,10 +65,6 @@ AC_DEFUN([gl_EARLY],
+ # Code from module signal:
+ # Code from module sigpipe:
+ # Code from module sigprocmask:
+- # Code from module snippet/_Noreturn:
+- # Code from module snippet/arg-nonnull:
+- # Code from module snippet/c++defs:
+- # Code from module snippet/warn-on-use:
+ # Code from module ssize_t:
+ # Code from module stat:
+ # Code from module stdbool:
+@@ -77,7 +74,6 @@ AC_DEFUN([gl_EARLY],
+ # Code from module stdlib:
+ # Code from module streq:
+ # Code from module strerror:
+- # Code from module strerror-override:
+ # Code from module string:
+ # Code from module sys_stat:
+ # Code from module time:
+@@ -87,6 +83,7 @@ AC_DEFUN([gl_EARLY],
+ # Code from module uniwidth/width:
+ # Code from module unlocked-io:
+ # Code from module verify:
++ # Code from module warn-on-use:
+ # Code from module xalloc:
+ # Code from module xreadlink:
+ ])
+@@ -109,9 +106,6 @@ AC_DEFUN([gl_INIT],
+ gl_source_base='srclib'
+ gl_FUNC_ALLOCA
+ gl_CANONICALIZE_LGPL
+-if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then
+- AC_LIBOBJ([canonicalize-lgpl])
+-fi
+ gl_MODULE_INDICATOR([canonicalize-lgpl])
+ gl_STDLIB_MODULE_INDICATOR([canonicalize_file_name])
+ gl_STDLIB_MODULE_INDICATOR([realpath])
+@@ -121,10 +115,6 @@ gl_ENVIRON
+ gl_UNISTD_MODULE_INDICATOR([environ])
+ gl_HEADER_ERRNO_H
+ gl_ERROR
+-if test $ac_cv_lib_error_at_line = no; then
+- AC_LIBOBJ([error])
+- gl_PREREQ_ERROR
+-fi
+ m4_ifdef([AM_XGETTEXT_OPTION],
+ [AM_][XGETTEXT_OPTION([--flag=error:3:c-format])
+ AM_][XGETTEXT_OPTION([--flag=error_at_line:5:c-format])])
+@@ -134,43 +124,26 @@ AM_GNU_GETTEXT_VERSION([0.18.1])
+ AC_SUBST([LIBINTL])
+ AC_SUBST([LTLIBINTL])
+ gl_FUNC_LSTAT
+-if test $REPLACE_LSTAT = 1; then
+- AC_LIBOBJ([lstat])
+- gl_PREREQ_LSTAT
+-fi
+ gl_SYS_STAT_MODULE_INDICATOR([lstat])
+ gl_MALLOCA
+ AC_TYPE_MBSTATE_T
+ gl_FUNC_MEMMOVE
+-if test $ac_cv_func_memmove = no; then
+- AC_LIBOBJ([memmove])
+- gl_PREREQ_MEMMOVE
+-fi
+ gl_MULTIARCH
+ gl_PATHMAX
+ AC_CHECK_DECLS([program_invocation_name], [], [], [#include <errno.h>])
+ AC_CHECK_DECLS([program_invocation_short_name], [], [], [#include <errno.h>])
+ gl_FUNC_READ
+-if test $REPLACE_READ = 1; then
+- AC_LIBOBJ([read])
+-fi
+ gl_UNISTD_MODULE_INDICATOR([read])
+ gl_FUNC_READLINK
+-if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
+- AC_LIBOBJ([readlink])
+- gl_PREREQ_READLINK
+-fi
+ gl_UNISTD_MODULE_INDICATOR([readlink])
+ gl_RELOCATABLE([$gl_source_base])
+-if test $RELOCATABLE = yes; then
+- AC_LIBOBJ([progreloc])
+-fi
+ gl_FUNC_READLINK_SEPARATE
+ gl_CANONICALIZE_LGPL_SEPARATE
+ gl_MALLOCA
+-gl_RELOCATABLE_LIBRARY
++gl_RELOCATABLE_LIBRARY_SEPARATE
+ gl_FUNC_SETENV_SEPARATE
+-gl_PREREQ_SAFE_READ
++gl_FUNC_STRERROR_SEPARATE
++gl_SAFE_READ
+ gl_SIGNAL_H
+ gl_SIGNAL_SIGPIPE
+ dnl Define the C macro GNULIB_SIGPIPE to 1.
+@@ -186,17 +159,9 @@ dnl Define the substituted variable GNUL
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ GNULIB_UNISTD_H_SIGPIPE=1
+ gl_SIGNALBLOCKING
+-if test $HAVE_POSIX_SIGNALBLOCKING = 0; then
+- AC_LIBOBJ([sigprocmask])
+- gl_PREREQ_SIGPROCMASK
+-fi
+ gl_SIGNAL_MODULE_INDICATOR([sigprocmask])
+ gt_TYPE_SSIZE_T
+ gl_FUNC_STAT
+-if test $REPLACE_STAT = 1; then
+- AC_LIBOBJ([stat])
+- gl_PREREQ_STAT
+-fi
+ gl_SYS_STAT_MODULE_INDICATOR([stat])
+ AM_STDBOOL_H
+ gl_STDDEF_H
+@@ -204,17 +169,7 @@ gl_STDINT_H
+ gl_STDIO_H
+ gl_STDLIB_H
+ gl_FUNC_STRERROR
+-if test $REPLACE_STRERROR = 1; then
+- AC_LIBOBJ([strerror])
+-fi
+-gl_MODULE_INDICATOR([strerror])
+ gl_STRING_MODULE_INDICATOR([strerror])
+-AC_REQUIRE([gl_HEADER_ERRNO_H])
+-AC_REQUIRE([gl_FUNC_STRERROR_0])
+-if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then
+- AC_LIBOBJ([strerror-override])
+- gl_PREREQ_SYS_H_WINSOCK2
+-fi
+ gl_HEADER_STRING_H
+ gl_HEADER_SYS_STAT_H
+ AC_PROG_MKDIR_P
+@@ -364,14 +319,13 @@ AC_DEFUN([gltests_LIBSOURCES], [
+ # This macro records the list of files which have been installed by
+ # gnulib-tool and may be removed by future gnulib-tool invocations.
+ AC_DEFUN([gl_FILE_LIST], [
++ build-aux/arg-nonnull.h
++ build-aux/c++defs.h
+ build-aux/config.libpath
+ build-aux/config.rpath
+ build-aux/install-reloc
+ build-aux/reloc-ldflags
+- build-aux/snippet/_Noreturn.h
+- build-aux/snippet/arg-nonnull.h
+- build-aux/snippet/c++defs.h
+- build-aux/snippet/warn-on-use.h
++ build-aux/warn-on-use.h
+ doc/relocatable.texi
+ lib/alloca.in.h
+ lib/allocator.c
+@@ -419,8 +373,6 @@ AC_DEFUN([gl_FILE_LIST], [
+ lib/stdio.in.h
+ lib/stdlib.in.h
+ lib/streq.h
+- lib/strerror-override.c
+- lib/strerror-override.h
+ lib/strerror.c
+ lib/string.in.h
+ lib/sys_stat.in.h
+@@ -463,7 +415,6 @@ AC_DEFUN([gl_FILE_LIST], [
+ m4/intmax.m4
+ m4/inttypes-pri.m4
+ m4/inttypes_h.m4
+- m4/largefile.m4
+ m4/lcmessage.m4
+ m4/lib-ld.m4
+ m4/lib-link.m4
+@@ -502,7 +453,6 @@ AC_DEFUN([gl_FILE_LIST], [
+ m4/stdlib_h.m4
+ m4/strerror.m4
+ m4/string_h.m4
+- m4/sys_socket_h.m4
+ m4/sys_stat_h.m4
+ m4/threadlib.m4
+ m4/time_h.m4
+diff -Naurp libiconv-1.14.org//srcm4/include_next.m4 libiconv-1.14/srcm4/include_next.m4
+--- libiconv-1.14.org//srcm4/include_next.m4 2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/include_next.m4 2012-01-08 02:07:40.650484472 -0800
+@@ -1,4 +1,4 @@
+-# include_next.m4 serial 20
++# include_next.m4 serial 18
+ dnl Copyright (C) 2006-2011 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+@@ -175,13 +175,11 @@ AC_DEFUN([gl_NEXT_HEADERS_INTERNAL],
+ [AC_CHECK_HEADERS_ONCE([$1])
+ ])
+
+-dnl FIXME: gl_next_header and gl_header_exists must be used unquoted
+-dnl until we can assume autoconf 2.64 or newer.
+ m4_foreach_w([gl_HEADER_NAME], [$1],
+ [AS_VAR_PUSHDEF([gl_next_header],
+ [gl_cv_next_]m4_defn([gl_HEADER_NAME]))
+ if test $gl_cv_have_include_next = yes; then
+- AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>'])
++ AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
+ else
+ AC_CACHE_CHECK(
+ [absolute name of <]m4_defn([gl_HEADER_NAME])[>],
+@@ -210,7 +208,7 @@ dnl until we can assume autoconf 2.64 or
+ dnl eval is necessary to expand gl_absname_cpp.
+ dnl Ultrix and Pyramid sh refuse to redirect output of eval,
+ dnl so use subshell.
+- AS_VAR_SET(gl_next_header,
++ AS_VAR_SET([gl_next_header],
+ ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
+ sed -n '\#/]m4_defn([gl_HEADER_NAME])[#{
+ s#.*"\(.*/]m4_defn([gl_HEADER_NAME])[\)".*#\1#
+@@ -220,20 +218,20 @@ dnl until we can assume autoconf 2.64 or
+ }'`'"'])
+ m4_if([$2], [check],
+ [else
+- AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>'])
++ AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
+ fi
+ ])
+ ])
+ fi
+ AC_SUBST(
+ AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])),
+- [AS_VAR_GET(gl_next_header)])
++ [AS_VAR_GET([gl_next_header])])
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'gl_HEADER_NAME'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+- gl_next_as_first_directive=AS_VAR_GET(gl_next_header)
++ gl_next_as_first_directive=AS_VAR_GET([gl_next_header])
+ fi
+ AC_SUBST(
+ AS_TR_CPP([NEXT_AS_FIRST_DIRECTIVE_]m4_defn([gl_HEADER_NAME])),
+diff -Naurp libiconv-1.14.org//srcm4/largefile.m4 libiconv-1.14/srcm4/largefile.m4
+--- libiconv-1.14.org//srcm4/largefile.m4 2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/largefile.m4 1969-12-31 16:00:00.000000000 -0800
+@@ -1,104 +0,0 @@
+-# Enable large files on systems where this is not the default.
+-
+-# Copyright 1992-1996, 1998-2011 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.
+-
+-# The following implementation works around a problem in autoconf <= 2.68;
+-# AC_SYS_LARGEFILE does not configure for large inodes on Mac OS X 10.5.
+-m4_version_prereq([2.69], [] ,[
+-
+-# _AC_SYS_LARGEFILE_TEST_INCLUDES
+-# -------------------------------
+-m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES],
+-[@%:@include <sys/types.h>
+- /* Check that off_t can represent 2**63 - 1 correctly.
+- We can't simply define LARGE_OFF_T to be 9223372036854775807,
+- since some C++ compilers masquerading as C compilers
+- incorrectly reject 9223372036854775807. */
+-@%:@define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+- int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721
+- && LARGE_OFF_T % 2147483647 == 1)
+- ? 1 : -1]];[]dnl
+-])
+-
+-
+-# _AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE,
+-# CACHE-VAR,
+-# DESCRIPTION,
+-# PROLOGUE, [FUNCTION-BODY])
+-# --------------------------------------------------------
+-m4_define([_AC_SYS_LARGEFILE_MACRO_VALUE],
+-[AC_CACHE_CHECK([for $1 value needed for large files], [$3],
+-[while :; do
+- m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])(
+- [AC_LANG_PROGRAM([$5], [$6])],
+- [$3=no; break])
+- m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])(
+- [AC_LANG_PROGRAM([@%:@define $1 $2
+-$5], [$6])],
+- [$3=$2; break])
+- $3=unknown
+- break
+-done])
+-case $$3 in #(
+- no | unknown) ;;
+- *) AC_DEFINE_UNQUOTED([$1], [$$3], [$4]);;
+-esac
+-rm -rf conftest*[]dnl
+-])# _AC_SYS_LARGEFILE_MACRO_VALUE
+-
+-
+-# AC_SYS_LARGEFILE
+-# ----------------
+-# By default, many hosts won't let programs access large files;
+-# one must use special compiler options to get large-file access to work.
+-# For more details about this brain damage please see:
+-# http://www.unix-systems.org/version2/whatsnew/lfs20mar.html
+-AC_DEFUN([AC_SYS_LARGEFILE],
+-[AC_ARG_ENABLE(largefile,
+- [ --disable-largefile omit support for large files])
+-if test "$enable_largefile" != no; then
+-
+- AC_CACHE_CHECK([for special C compiler options needed for large files],
+- ac_cv_sys_largefile_CC,
+- [ac_cv_sys_largefile_CC=no
+- if test "$GCC" != yes; then
+- ac_save_CC=$CC
+- while :; do
+- # IRIX 6.2 and later do not support large files by default,
+- # so use the C compiler's -n32 option if that helps.
+- AC_LANG_CONFTEST([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_INCLUDES])])
+- AC_COMPILE_IFELSE([], [break])
+- CC="$CC -n32"
+- AC_COMPILE_IFELSE([], [ac_cv_sys_largefile_CC=' -n32'; break])
+- break
+- done
+- CC=$ac_save_CC
+- rm -f conftest.$ac_ext
+- fi])
+- if test "$ac_cv_sys_largefile_CC" != no; then
+- CC=$CC$ac_cv_sys_largefile_CC
+- fi
+-
+- _AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64,
+- ac_cv_sys_file_offset_bits,
+- [Number of bits in a file offset, on hosts where this is settable.],
+- [_AC_SYS_LARGEFILE_TEST_INCLUDES])
+- if test $ac_cv_sys_file_offset_bits = unknown; then
+- _AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1,
+- ac_cv_sys_large_files,
+- [Define for large files, on AIX-style hosts.],
+- [_AC_SYS_LARGEFILE_TEST_INCLUDES])
+- fi
+-
+- AH_VERBATIM([_DARWIN_USE_64_BIT_INODE],
+-[/* Enable large inode numbers on Mac OS X. */
+-#ifndef _DARWIN_USE_64_BIT_INODE
+-# define _DARWIN_USE_64_BIT_INODE 1
+-#endif])
+-fi
+-])# AC_SYS_LARGEFILE
+-
+-])# m4_version_prereq 2.69
+diff -Naurp libiconv-1.14.org//srcm4/lstat.m4 libiconv-1.14/srcm4/lstat.m4
+--- libiconv-1.14.org//srcm4/lstat.m4 2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/lstat.m4 2012-01-08 02:07:40.722484476 -0800
+@@ -1,4 +1,4 @@
+-# serial 23
++# serial 21
+
+ # Copyright (C) 1997-2001, 2003-2011 Free Software Foundation, Inc.
+ #
+@@ -15,28 +15,24 @@ AC_DEFUN([gl_FUNC_LSTAT],
+ dnl "#define lstat stat", and lstat.c is a no-op.
+ AC_CHECK_FUNCS_ONCE([lstat])
+ if test $ac_cv_func_lstat = yes; then
+- AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
+- if test $gl_cv_func_lstat_dereferences_slashed_symlink = no; then
++ AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
++ if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then
++ dnl Note: AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK does AC_LIBOBJ([lstat]).
+ REPLACE_LSTAT=1
+ fi
++ # Prerequisites of lib/lstat.c.
++ AC_REQUIRE([AC_C_INLINE])
+ else
+ HAVE_LSTAT=0
+ fi
+ ])
+
+-# Prerequisites of lib/lstat.c.
+-AC_DEFUN([gl_PREREQ_LSTAT],
++# Redefine AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK, because it is no longer
++# maintained in Autoconf.
++AC_DEFUN([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
+ [
+- AC_REQUIRE([AC_C_INLINE])
+- :
+-])
+-
+-AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
+-[
+- dnl We don't use AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK any more, because it
+- dnl is no longer maintained in Autoconf and because it invokes AC_LIBOBJ.
+ AC_CACHE_CHECK([whether lstat correctly handles trailing slash],
+- [gl_cv_func_lstat_dereferences_slashed_symlink],
++ [ac_cv_func_lstat_dereferences_slashed_symlink],
+ [rm -f conftest.sym conftest.file
+ echo >conftest.file
+ if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then
+@@ -49,22 +45,25 @@ AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_
+ have to compile and use the lstat wrapper. */
+ return lstat ("conftest.sym/", &sbuf) == 0;
+ ]])],
+- [gl_cv_func_lstat_dereferences_slashed_symlink=yes],
+- [gl_cv_func_lstat_dereferences_slashed_symlink=no],
++ [ac_cv_func_lstat_dereferences_slashed_symlink=yes],
++ [ac_cv_func_lstat_dereferences_slashed_symlink=no],
+ [# When cross-compiling, be pessimistic so we will end up using the
+ # replacement version of lstat that checks for trailing slashes and
+ # calls lstat a second time when necessary.
+- gl_cv_func_lstat_dereferences_slashed_symlink=no
++ ac_cv_func_lstat_dereferences_slashed_symlink=no
+ ])
+ else
+ # If the 'ln -s' command failed, then we probably don't even
+ # have an lstat function.
+- gl_cv_func_lstat_dereferences_slashed_symlink=no
++ ac_cv_func_lstat_dereferences_slashed_symlink=no
+ fi
+ rm -f conftest.sym conftest.file
+ ])
+- test $gl_cv_func_lstat_dereferences_slashed_symlink = yes &&
++ test $ac_cv_func_lstat_dereferences_slashed_symlink = yes &&
+ AC_DEFINE_UNQUOTED([LSTAT_FOLLOWS_SLASHED_SYMLINK], [1],
+ [Define to 1 if `lstat' dereferences a symlink specified
+ with a trailing slash.])
++ if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then
++ AC_LIBOBJ([lstat])
++ fi
+ ])
+diff -Naurp libiconv-1.14.org//srcm4/memmove.m4 libiconv-1.14/srcm4/memmove.m4
+--- libiconv-1.14.org//srcm4/memmove.m4 2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/memmove.m4 2012-01-08 02:07:40.738484477 -0800
+@@ -1,4 +1,4 @@
+-# memmove.m4 serial 4
++# memmove.m4 serial 3
+ dnl Copyright (C) 2002, 2009-2011 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+@@ -6,7 +6,10 @@ dnl with or without modifications, as lo
+
+ AC_DEFUN([gl_FUNC_MEMMOVE],
+ [
+- AC_CHECK_FUNCS([memmove])
++ AC_REPLACE_FUNCS([memmove])
++ if test $ac_cv_func_memmove = no; then
++ gl_PREREQ_MEMMOVE
++ fi
+ ])
+
+ # Prerequisites of lib/memmove.c.
+diff -Naurp libiconv-1.14.org//srcm4/pathmax.m4 libiconv-1.14/srcm4/pathmax.m4
+--- libiconv-1.14.org//srcm4/pathmax.m4 2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/pathmax.m4 2012-01-08 02:07:40.758484478 -0800
+@@ -1,4 +1,4 @@
+-# pathmax.m4 serial 9
++# pathmax.m4 serial 8
+ dnl Copyright (C) 2002-2003, 2005-2006, 2009-2011 Free Software Foundation,
+ dnl Inc.
+ dnl This file is free software; the Free Software Foundation
+@@ -8,5 +8,6 @@ dnl with or without modifications, as lo
+ AC_DEFUN([gl_PATHMAX],
+ [
+ dnl Prerequisites of lib/pathmax.h.
++ AC_CHECK_FUNCS_ONCE([pathconf])
+ AC_CHECK_HEADERS_ONCE([sys/param.h])
+ ])
+diff -Naurp libiconv-1.14.org//srcm4/po.m4 libiconv-1.14/srcm4/po.m4
+--- libiconv-1.14.org//srcm4/po.m4 2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/po.m4 2012-01-08 02:07:40.766484477 -0800
+@@ -1,4 +1,4 @@
+-# po.m4 serial 17a
++# po.m4 serial 17 (gettext-0.18)
+ dnl Copyright (C) 1995-2011 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+@@ -118,8 +118,7 @@ changequote([,])dnl
+ 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"
+- gt_tab=`printf '\t'`
+- cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$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
+@@ -255,7 +254,6 @@ EOT
+ fi
+
+ # A sed script that extracts the value of VARIABLE from a Makefile.
+- tab=`printf '\t'`
+ sed_x_variable='
+ # Test if the hold space is empty.
+ x
+@@ -263,9 +261,9 @@ s/P/P/
+ x
+ ta
+ # Yes it was empty. Look if we have the expected variable definition.
+-/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=/{
++/^[ ]*VARIABLE[ ]*=/{
+ # Seen the first line of the variable definition.
+- s/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=//
++ s/^[ ]*VARIABLE[ ]*=//
+ ba
+ }
+ bd
+@@ -407,15 +405,14 @@ changequote([,])dnl
+ 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"
+- tab=`printf '\t'`
+ 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
+-${tab}@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
+-${tab}\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
++ @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
+@@ -425,8 +422,8 @@ EOF
+ frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
+ cat >> "$ac_file.tmp" <<EOF
+ $frobbedlang/\$(DOMAIN).resources.dll: $lang.po
+-${tab}@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
+-${tab}\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
++ @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
+diff -Naurp libiconv-1.14.org//srcm4/readlink.m4 libiconv-1.14/srcm4/readlink.m4
+--- libiconv-1.14.org//srcm4/readlink.m4 2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/readlink.m4 2012-01-08 02:07:40.790484479 -0800
+@@ -1,4 +1,4 @@
+-# readlink.m4 serial 11
++# readlink.m4 serial 10
+ dnl Copyright (C) 2003, 2007, 2009-2011 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+@@ -10,6 +10,8 @@ AC_DEFUN([gl_FUNC_READLINK],
+ AC_CHECK_FUNCS_ONCE([readlink])
+ if test $ac_cv_func_readlink = no; then
+ HAVE_READLINK=0
++ AC_LIBOBJ([readlink])
++ gl_PREREQ_READLINK
+ else
+ AC_CACHE_CHECK([whether readlink signature is correct],
+ [gl_cv_decl_readlink_works],
+@@ -38,8 +40,10 @@ AC_DEFUN([gl_FUNC_READLINK],
+ AC_DEFINE([READLINK_TRAILING_SLASH_BUG], [1], [Define to 1 if readlink
+ fails to recognize a trailing slash.])
+ REPLACE_READLINK=1
++ AC_LIBOBJ([readlink])
+ elif test "$gl_cv_decl_readlink_works" != yes; then
+ REPLACE_READLINK=1
++ AC_LIBOBJ([readlink])
+ fi
+ fi
+ ])
+diff -Naurp libiconv-1.14.org//srcm4/read.m4 libiconv-1.14/srcm4/read.m4
+--- libiconv-1.14.org//srcm4/read.m4 2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/read.m4 2012-01-08 02:07:40.782484478 -0800
+@@ -1,4 +1,4 @@
+-# read.m4 serial 2
++# read.m4 serial 1
+ dnl Copyright (C) 2011 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+@@ -14,6 +14,7 @@ AC_DEFUN([gl_FUNC_READ],
+ gl_NONBLOCKING_IO
+ if test $gl_cv_have_nonblocking != yes; then
+ REPLACE_READ=1
++ AC_LIBOBJ([read])
+ fi
+ ])
+ ])
+diff -Naurp libiconv-1.14.org//srcm4/relocatable-lib.m4 libiconv-1.14/srcm4/relocatable-lib.m4
+--- libiconv-1.14.org//srcm4/relocatable-lib.m4 2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/relocatable-lib.m4 2012-01-08 02:07:40.798484480 -0800
+@@ -1,4 +1,4 @@
+-# relocatable-lib.m4 serial 6
++# relocatable-lib.m4 serial 5
+ dnl Copyright (C) 2003, 2005-2007, 2009-2011 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+@@ -10,6 +10,9 @@ dnl Support for relocatable libraries.
+ AC_DEFUN([gl_RELOCATABLE_LIBRARY],
+ [
+ AC_REQUIRE([gl_RELOCATABLE_LIBRARY_BODY])
++ if test $RELOCATABLE = yes; then
++ AC_LIBOBJ([relocatable])
++ fi
+ ])
+ AC_DEFUN([gl_RELOCATABLE_LIBRARY_BODY],
+ [
+@@ -29,6 +32,13 @@ AC_DEFUN([gl_RELOCATABLE_LIBRARY_BODY],
+ fi
+ ])
+
++dnl Like gl_RELOCATABLE_LIBRARY, except prepare for separate compilation
++dnl (no AC_LIBOBJ).
++AC_DEFUN([gl_RELOCATABLE_LIBRARY_SEPARATE],
++[
++ AC_REQUIRE([gl_RELOCATABLE_LIBRARY_BODY])
++])
++
+ dnl Support for relocatable packages for which it is a nop.
+ AC_DEFUN([gl_RELOCATABLE_NOP],
+ [
+diff -Naurp libiconv-1.14.org//srcm4/relocatable.m4 libiconv-1.14/srcm4/relocatable.m4
+--- libiconv-1.14.org//srcm4/relocatable.m4 2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/relocatable.m4 2012-01-08 02:07:40.802484479 -0800
+@@ -1,4 +1,4 @@
+-# relocatable.m4 serial 17
++# relocatable.m4 serial 16
+ dnl Copyright (C) 2003, 2005-2007, 2009-2011 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+@@ -14,6 +14,9 @@ AC_DEFUN([gl_RELOCATABLE],
+ [
+ AC_REQUIRE([gl_RELOCATABLE_BODY])
+ gl_RELOCATABLE_LIBRARY
++ if test $RELOCATABLE = yes; then
++ AC_LIBOBJ([progreloc])
++ fi
+ : ${RELOCATABLE_CONFIG_H_DIR='$(top_builddir)'}
+ RELOCATABLE_SRC_DIR="\$(top_srcdir)/$gl_source_base"
+ RELOCATABLE_BUILD_DIR="\$(top_builddir)/$gl_source_base"
+diff -Naurp libiconv-1.14.org//srcm4/safe-read.m4 libiconv-1.14/srcm4/safe-read.m4
+--- libiconv-1.14.org//srcm4/safe-read.m4 2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/safe-read.m4 2012-01-08 02:07:40.810484480 -0800
+@@ -1,10 +1,17 @@
+-# safe-read.m4 serial 6
++# safe-read.m4 serial 5
+ dnl Copyright (C) 2002-2003, 2005-2006, 2009-2011 Free Software Foundation,
+ dnl 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.
+
++AC_DEFUN([gl_SAFE_READ],
++[
++ AC_LIBOBJ([safe-read])
++
++ gl_PREREQ_SAFE_READ
++])
++
+ # Prerequisites of lib/safe-read.c.
+ AC_DEFUN([gl_PREREQ_SAFE_READ],
+ [
+diff -Naurp libiconv-1.14.org//srcm4/setenv.m4 libiconv-1.14/srcm4/setenv.m4
+--- libiconv-1.14.org//srcm4/setenv.m4 2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/setenv.m4 2012-01-08 02:07:40.818484481 -0800
+@@ -1,4 +1,4 @@
+-# setenv.m4 serial 24
++# setenv.m4 serial 22
+ dnl Copyright (C) 2001-2004, 2006-2011 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+@@ -38,6 +38,9 @@ AC_DEFUN([gl_FUNC_SETENV],
+ REPLACE_SETENV=1
+ fi
+ fi
++ if test $HAVE_SETENV$REPLACE_SETENV != 10; then
++ AC_LIBOBJ([setenv])
++ fi
+ ])
+
+ # Like gl_FUNC_SETENV, except prepare for separate compilation
+@@ -62,9 +65,9 @@ AC_DEFUN([gl_FUNC_UNSETENV],
+ fi
+ AC_CHECK_FUNCS([unsetenv])
+ if test $ac_cv_func_unsetenv = no; then
+- HAVE_UNSETENV=0
++ AC_LIBOBJ([unsetenv])
++ gl_PREREQ_UNSETENV
+ else
+- HAVE_UNSETENV=1
+ dnl Some BSDs return void, failing to do error checking.
+ AC_CACHE_CHECK([for unsetenv() return type], [gt_cv_func_unsetenv_ret],
+ [AC_COMPILE_IFELSE(
+@@ -90,6 +93,7 @@ int unsetenv();
+ AC_DEFINE([VOID_UNSETENV], [1], [Define to 1 if unsetenv returns void
+ instead of int.])
+ REPLACE_UNSETENV=1
++ AC_LIBOBJ([unsetenv])
+ fi
+
+ dnl Solaris 10 unsetenv does not remove all copies of a name.
+@@ -122,6 +126,7 @@ int unsetenv();
+ [gl_cv_func_unsetenv_works="guessing no"])])
+ if test "$gl_cv_func_unsetenv_works" != yes; then
+ REPLACE_UNSETENV=1
++ AC_LIBOBJ([unsetenv])
+ fi
+ fi
+ ])
+diff -Naurp libiconv-1.14.org//srcm4/signalblocking.m4 libiconv-1.14/srcm4/signalblocking.m4
+--- libiconv-1.14.org//srcm4/signalblocking.m4 2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/signalblocking.m4 2012-01-08 02:07:40.834484482 -0800
+@@ -1,4 +1,4 @@
+-# signalblocking.m4 serial 12
++# signalblocking.m4 serial 10
+ dnl Copyright (C) 2001-2002, 2006-2011 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+@@ -12,14 +12,31 @@ dnl with or without modifications, as lo
+ AC_DEFUN([gl_SIGNALBLOCKING],
+ [
+ AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
+- AC_REQUIRE([gl_CHECK_TYPE_SIGSET_T])
+- if test $gl_cv_type_sigset_t = yes; then
++ signals_not_posix=
++ AC_EGREP_HEADER([sigset_t], [signal.h], , [signals_not_posix=1])
++ if test -z "$signals_not_posix"; then
+ AC_CHECK_FUNC([sigprocmask], [gl_cv_func_sigprocmask=1])
+ fi
+ if test -z "$gl_cv_func_sigprocmask"; then
+ HAVE_POSIX_SIGNALBLOCKING=0
++ AC_LIBOBJ([sigprocmask])
++ gl_PREREQ_SIGPROCMASK
+ fi
+ ])
+
+-# Prerequisites of lib/sigprocmask.c.
+-AC_DEFUN([gl_PREREQ_SIGPROCMASK], [:])
++# Prerequisites of the part of lib/signal.in.h and of lib/sigprocmask.c.
++AC_DEFUN([gl_PREREQ_SIGPROCMASK],
++[
++ AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
++ AC_CHECK_TYPES([sigset_t],
++ [gl_cv_type_sigset_t=yes], [gl_cv_type_sigset_t=no],
++ [#include <signal.h>
++/* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */
++#include <sys/types.h>])
++ if test $gl_cv_type_sigset_t != yes; then
++ HAVE_SIGSET_T=0
++ fi
++ dnl HAVE_SIGSET_T is 1 if the system lacks the sigprocmask function but has
++ dnl the sigset_t type.
++ AC_SUBST([HAVE_SIGSET_T])
++])
+diff -Naurp libiconv-1.14.org//srcm4/signal_h.m4 libiconv-1.14/srcm4/signal_h.m4
+--- libiconv-1.14.org//srcm4/signal_h.m4 2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/signal_h.m4 2012-01-08 02:07:40.826484480 -0800
+@@ -1,4 +1,4 @@
+-# signal_h.m4 serial 16
++# signal_h.m4 serial 12
+ dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+@@ -7,7 +7,6 @@ dnl with or without modifications, as lo
+ AC_DEFUN([gl_SIGNAL_H],
+ [
+ AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
+- AC_REQUIRE([gl_CHECK_TYPE_SIGSET_T])
+ gl_NEXT_HEADERS([signal.h])
+
+ # AIX declares sig_atomic_t to already include volatile, and C89 compilers
+@@ -28,25 +27,10 @@ AC_DEFUN([gl_SIGNAL_H],
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[#include <signal.h>
+- ]], [pthread_sigmask sigaction
+- sigaddset sigdelset sigemptyset sigfillset sigismember
++ ]], [sigaction sigaddset sigdelset sigemptyset sigfillset sigismember
+ sigpending sigprocmask])
+ ])
+
+-AC_DEFUN([gl_CHECK_TYPE_SIGSET_T],
+-[
+- AC_CHECK_TYPES([sigset_t],
+- [gl_cv_type_sigset_t=yes], [gl_cv_type_sigset_t=no],
+- [[
+- #include <signal.h>
+- /* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */
+- #include <sys/types.h>
+- ]])
+- if test $gl_cv_type_sigset_t != yes; then
+- HAVE_SIGSET_T=0
+- fi
+-])
+-
+ AC_DEFUN([gl_SIGNAL_MODULE_INDICATOR],
+ [
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+@@ -58,13 +42,11 @@ AC_DEFUN([gl_SIGNAL_MODULE_INDICATOR],
+
+ AC_DEFUN([gl_SIGNAL_H_DEFAULTS],
+ [
+- GNULIB_PTHREAD_SIGMASK=0; AC_SUBST([GNULIB_PTHREAD_SIGMASK])
+ GNULIB_SIGNAL_H_SIGPIPE=0; AC_SUBST([GNULIB_SIGNAL_H_SIGPIPE])
+ GNULIB_SIGPROCMASK=0; AC_SUBST([GNULIB_SIGPROCMASK])
+ GNULIB_SIGACTION=0; AC_SUBST([GNULIB_SIGACTION])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_POSIX_SIGNALBLOCKING=1; AC_SUBST([HAVE_POSIX_SIGNALBLOCKING])
+- HAVE_PTHREAD_SIGMASK=1; AC_SUBST([HAVE_PTHREAD_SIGMASK])
+ HAVE_SIGSET_T=1; AC_SUBST([HAVE_SIGSET_T])
+ HAVE_SIGINFO_T=1; AC_SUBST([HAVE_SIGINFO_T])
+ HAVE_SIGACTION=1; AC_SUBST([HAVE_SIGACTION])
+@@ -73,5 +55,4 @@ AC_DEFUN([gl_SIGNAL_H_DEFAULTS],
+ HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1;
+ AC_SUBST([HAVE_TYPE_VOLATILE_SIG_ATOMIC_T])
+ HAVE_SIGHANDLER_T=1; AC_SUBST([HAVE_SIGHANDLER_T])
+- REPLACE_PTHREAD_SIGMASK=0; AC_SUBST([REPLACE_PTHREAD_SIGMASK])
+ ])
+diff -Naurp libiconv-1.14.org//srcm4/stat.m4 libiconv-1.14/srcm4/stat.m4
+--- libiconv-1.14.org//srcm4/stat.m4 2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/stat.m4 2012-01-08 02:07:40.854484483 -0800
+@@ -1,4 +1,4 @@
+-# serial 8
++# serial 7
+
+ # Copyright (C) 2009-2011 Free Software Foundation, Inc.
+ #
+@@ -58,11 +58,9 @@ AC_DEFUN([gl_FUNC_STAT],
+ AC_DEFINE([REPLACE_FUNC_STAT_FILE], [1], [Define to 1 if stat needs
+ help when passed a file name with a trailing slash]);;
+ esac
+-])
+-
+-# Prerequisites of lib/stat.c.
+-AC_DEFUN([gl_PREREQ_STAT],
+-[
+- AC_REQUIRE([AC_C_INLINE])
+- :
++ if test $REPLACE_STAT = 1; then
++ AC_LIBOBJ([stat])
++ dnl Prerequisites of lib/stat.c.
++ AC_REQUIRE([AC_C_INLINE])
++ fi
+ ])
+diff -Naurp libiconv-1.14.org//srcm4/strerror.m4 libiconv-1.14/srcm4/strerror.m4
+--- libiconv-1.14.org//srcm4/strerror.m4 2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/strerror.m4 2012-01-08 02:07:40.890484484 -0800
+@@ -1,4 +1,4 @@
+-# strerror.m4 serial 16
++# strerror.m4 serial 9
+ dnl Copyright (C) 2002, 2007-2011 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+@@ -6,73 +6,63 @@ dnl with or without modifications, as lo
+
+ AC_DEFUN([gl_FUNC_STRERROR],
+ [
++ AC_REQUIRE([gl_FUNC_STRERROR_SEPARATE])
++ if test $REPLACE_STRERROR = 1; then
++ AC_LIBOBJ([strerror])
++ AC_DEFINE_UNQUOTED([REPLACE_STRERROR], [$REPLACE_STRERROR],
++ [Define this to 1 if strerror is broken.])
++ fi
++])
++
++# Like gl_FUNC_STRERROR, except prepare for separate compilation (no AC_LIBOBJ).
++AC_DEFUN([gl_FUNC_STRERROR_SEPARATE],
++[
+ AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+ AC_REQUIRE([gl_HEADER_ERRNO_H])
+- AC_REQUIRE([gl_FUNC_STRERROR_0])
+- m4_ifdef([gl_FUNC_STRERROR_R_WORKS], [
+- AC_REQUIRE([gl_FUNC_STRERROR_R_WORKS])
+- ])
+- if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
++ if test -z "$ERRNO_H"; then
+ AC_CACHE_CHECK([for working strerror function],
+ [gl_cv_func_working_strerror],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <string.h>
+ ]],
+- [[if (!*strerror (-2)) return 1;]])],
++ [[return !*strerror (-2);]])],
+ [gl_cv_func_working_strerror=yes],
+ [gl_cv_func_working_strerror=no],
+- [dnl Be pessimistic on cross-compiles for now.
+- gl_cv_func_working_strerror="guessing no"])
++ [dnl Assume crossbuild works if it compiles.
++ AC_COMPILE_IFELSE(
++ [AC_LANG_PROGRAM(
++ [[#include <string.h>
++ ]],
++ [[return !*strerror (-2);]])],
++ [gl_cv_func_working_strerror=yes],
++ [gl_cv_func_working_strerror=no])
++ ])
+ ])
+- if test "$gl_cv_func_working_strerror" != yes; then
++ if test $gl_cv_func_working_strerror = no; then
+ dnl The system's strerror() fails to return a string for out-of-range
+ dnl integers. Replace it.
+ REPLACE_STRERROR=1
+ fi
+- m4_ifdef([gl_FUNC_STRERROR_R_WORKS], [
+- dnl If the system's strerror_r or __xpg_strerror_r clobbers strerror's
+- dnl buffer, we must replace strerror.
+- case "$gl_cv_func_strerror_r_works" in
+- *no) REPLACE_STRERROR=1 ;;
+- esac
+- ])
+ else
+ dnl The system's strerror() cannot know about the new errno values we add
+- dnl to <errno.h>, or any fix for strerror(0). Replace it.
++ dnl to <errno.h>. Replace it.
+ REPLACE_STRERROR=1
+ fi
++ if test $REPLACE_STRERROR = 1; then
++ gl_PREREQ_STRERROR
++ fi
+ ])
+
+-dnl Detect if strerror(0) passes (that is, does not set errno, and does not
+-dnl return a string that matches strerror(-1)).
+-AC_DEFUN([gl_FUNC_STRERROR_0],
+-[
+- REPLACE_STRERROR_0=0
+- AC_CACHE_CHECK([whether strerror(0) succeeds],
+- [gl_cv_func_strerror_0_works],
+- [AC_RUN_IFELSE(
+- [AC_LANG_PROGRAM(
+- [[#include <string.h>
+- #include <errno.h>
+- ]],
+- [[int result = 0;
+- char *str;
+- errno = 0;
+- str = strerror (0);
+- if (!*str) result |= 1;
+- if (errno) result |= 2;
+- if (strstr (str, "nknown") || strstr (str, "ndefined"))
+- result |= 4;
+- return result;]])],
+- [gl_cv_func_strerror_0_works=yes],
+- [gl_cv_func_strerror_0_works=no],
+- [dnl Be pessimistic on cross-compiles for now.
+- gl_cv_func_strerror_0_works="guessing no"])
+- ])
+- if test "$gl_cv_func_strerror_0_works" != yes; then
+- REPLACE_STRERROR_0=1
+- AC_DEFINE([REPLACE_STRERROR_0], [1], [Define to 1 if strerror(0)
+- does not return a message implying success.])
++# Prerequisites of lib/strerror.c.
++AC_DEFUN([gl_PREREQ_STRERROR], [
++ AC_CHECK_DECLS([strerror])
++ AC_CHECK_HEADERS_ONCE([sys/socket.h])
++ if test $ac_cv_header_sys_socket_h != yes; then
++ dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
++ dnl the check for those headers unconditional; yet cygwin reports
++ dnl that the headers are present but cannot be compiled (since on
++ dnl cygwin, all socket information should come from sys/socket.h).
++ AC_CHECK_HEADERS([winsock2.h])
+ fi
+ ])
+diff -Naurp libiconv-1.14.org//srcm4/string_h.m4 libiconv-1.14/srcm4/string_h.m4
+--- libiconv-1.14.org//srcm4/string_h.m4 2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/string_h.m4 2012-01-08 02:07:40.894484485 -0800
+@@ -5,7 +5,7 @@
+ # gives unlimited permission to copy and/or distribute it,
+ # with or without modifications, as long as this notice is preserved.
+
+-# serial 21
++# serial 20
+
+ # Written by Paul Eggert.
+
+@@ -27,9 +27,9 @@ AC_DEFUN([gl_HEADER_STRING_H_BODY],
+ dnl guaranteed by C89.
+ gl_WARN_ON_USE_PREPARE([[#include <string.h>
+ ]],
+- [ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul
+- strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r
+- strerror_r strsignal strverscmp])
++ [memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul strdup
++ strncat strndup strnlen strpbrk strsep strcasestr strtok_r strerror_r
++ strsignal strverscmp])
+ ])
+
+ AC_DEFUN([gl_STRING_MODULE_INDICATOR],
+@@ -43,8 +43,6 @@ AC_DEFUN([gl_STRING_MODULE_INDICATOR],
+
+ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
+ [
+- GNULIB_FFSL=0; AC_SUBST([GNULIB_FFSL])
+- GNULIB_FFSLL=0; AC_SUBST([GNULIB_FFSLL])
+ GNULIB_MEMCHR=0; AC_SUBST([GNULIB_MEMCHR])
+ GNULIB_MEMMEM=0; AC_SUBST([GNULIB_MEMMEM])
+ GNULIB_MEMPCPY=0; AC_SUBST([GNULIB_MEMPCPY])
+@@ -82,8 +80,6 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
+ GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP])
+ HAVE_MBSLEN=0; AC_SUBST([HAVE_MBSLEN])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+- HAVE_FFSL=1; AC_SUBST([HAVE_FFSL])
+- HAVE_FFSLL=1; AC_SUBST([HAVE_FFSLL])
+ HAVE_MEMCHR=1; AC_SUBST([HAVE_MEMCHR])
+ HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM])
+ HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY])
+diff -Naurp libiconv-1.14.org//srcm4/sys_socket_h.m4 libiconv-1.14/srcm4/sys_socket_h.m4
+--- libiconv-1.14.org//srcm4/sys_socket_h.m4 2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/sys_socket_h.m4 1969-12-31 16:00:00.000000000 -0800
+@@ -1,177 +0,0 @@
+-# sys_socket_h.m4 serial 22
+-dnl Copyright (C) 2005-2011 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 From Simon Josefsson.
+-
+-AC_DEFUN([gl_HEADER_SYS_SOCKET],
+-[
+- AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
+- AC_REQUIRE([AC_CANONICAL_HOST])
+- AC_REQUIRE([AC_C_INLINE])
+-
+- dnl On OSF/1, the functions recv(), send(), recvfrom(), sendto() have
+- dnl old-style declarations (with return type 'int' instead of 'ssize_t')
+- dnl unless _POSIX_PII_SOCKET is defined.
+- case "$host_os" in
+- osf*)
+- AC_DEFINE([_POSIX_PII_SOCKET], [1],
+- [Define to 1 in order to get the POSIX compatible declarations
+- of socket functions.])
+- ;;
+- esac
+-
+- AC_CACHE_CHECK([whether <sys/socket.h> is self-contained],
+- [gl_cv_header_sys_socket_h_selfcontained],
+- [
+- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[]])],
+- [gl_cv_header_sys_socket_h_selfcontained=yes],
+- [gl_cv_header_sys_socket_h_selfcontained=no])
+- ])
+- if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
+- dnl If the shutdown function exists, <sys/socket.h> should define
+- dnl SHUT_RD, SHUT_WR, SHUT_RDWR.
+- AC_CHECK_FUNCS([shutdown])
+- if test $ac_cv_func_shutdown = yes; then
+- AC_CACHE_CHECK([whether <sys/socket.h> defines the SHUT_* macros],
+- [gl_cv_header_sys_socket_h_shut],
+- [
+- AC_COMPILE_IFELSE(
+- [AC_LANG_PROGRAM([[#include <sys/socket.h>]],
+- [[int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };]])],
+- [gl_cv_header_sys_socket_h_shut=yes],
+- [gl_cv_header_sys_socket_h_shut=no])
+- ])
+- if test $gl_cv_header_sys_socket_h_shut = no; then
+- SYS_SOCKET_H='sys/socket.h'
+- fi
+- fi
+- fi
+- # We need to check for ws2tcpip.h now.
+- gl_PREREQ_SYS_H_SOCKET
+- AC_CHECK_TYPES([struct sockaddr_storage, sa_family_t],,,[
+- /* sys/types.h is not needed according to POSIX, but the
+- sys/socket.h in i386-unknown-freebsd4.10 and
+- powerpc-apple-darwin5.5 required it. */
+-#include <sys/types.h>
+-#ifdef HAVE_SYS_SOCKET_H
+-#include <sys/socket.h>
+-#endif
+-#ifdef HAVE_WS2TCPIP_H
+-#include <ws2tcpip.h>
+-#endif
+-])
+- if test $ac_cv_type_struct_sockaddr_storage = no; then
+- HAVE_STRUCT_SOCKADDR_STORAGE=0
+- fi
+- if test $ac_cv_type_sa_family_t = no; then
+- HAVE_SA_FAMILY_T=0
+- fi
+- if test $ac_cv_type_struct_sockaddr_storage != no; then
+- AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family],
+- [],
+- [HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0],
+- [#include <sys/types.h>
+- #ifdef HAVE_SYS_SOCKET_H
+- #include <sys/socket.h>
+- #endif
+- #ifdef HAVE_WS2TCPIP_H
+- #include <ws2tcpip.h>
+- #endif
+- ])
+- fi
+- if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \
+- || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then
+- SYS_SOCKET_H='sys/socket.h'
+- fi
+- gl_PREREQ_SYS_H_WINSOCK2
+-
+- dnl Check for declarations of anything we want to poison if the
+- dnl corresponding gnulib module is not in use.
+- gl_WARN_ON_USE_PREPARE([[
+-/* Some systems require prerequisite headers. */
+-#include <sys/types.h>
+-#include <sys/socket.h>
+- ]], [socket connect accept bind getpeername getsockname getsockopt
+- listen recv send recvfrom sendto setsockopt shutdown accept4])
+-])
+-
+-AC_DEFUN([gl_PREREQ_SYS_H_SOCKET],
+-[
+- dnl Check prerequisites of the <sys/socket.h> replacement.
+- AC_REQUIRE([gl_CHECK_SOCKET_HEADERS])
+- gl_CHECK_NEXT_HEADERS([sys/socket.h])
+- if test $ac_cv_header_sys_socket_h = yes; then
+- HAVE_SYS_SOCKET_H=1
+- HAVE_WS2TCPIP_H=0
+- else
+- HAVE_SYS_SOCKET_H=0
+- if test $ac_cv_header_ws2tcpip_h = yes; then
+- HAVE_WS2TCPIP_H=1
+- else
+- HAVE_WS2TCPIP_H=0
+- fi
+- fi
+- AC_SUBST([HAVE_SYS_SOCKET_H])
+- AC_SUBST([HAVE_WS2TCPIP_H])
+-])
+-
+-# Common prerequisites of the <sys/socket.h> replacement and of the
+-# <sys/select.h> replacement.
+-# Sets and substitutes HAVE_WINSOCK2_H.
+-AC_DEFUN([gl_PREREQ_SYS_H_WINSOCK2],
+-[
+- m4_ifdef([gl_UNISTD_H_DEFAULTS], [AC_REQUIRE([gl_UNISTD_H_DEFAULTS])])
+- m4_ifdef([gl_SYS_IOCTL_H_DEFAULTS], [AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])])
+- AC_CHECK_HEADERS_ONCE([sys/socket.h])
+- if test $ac_cv_header_sys_socket_h != yes; then
+- dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
+- dnl the check for those headers unconditional; yet cygwin reports
+- dnl that the headers are present but cannot be compiled (since on
+- dnl cygwin, all socket information should come from sys/socket.h).
+- AC_CHECK_HEADERS([winsock2.h])
+- fi
+- if test "$ac_cv_header_winsock2_h" = yes; then
+- HAVE_WINSOCK2_H=1
+- UNISTD_H_HAVE_WINSOCK2_H=1
+- SYS_IOCTL_H_HAVE_WINSOCK2_H=1
+- else
+- HAVE_WINSOCK2_H=0
+- fi
+- AC_SUBST([HAVE_WINSOCK2_H])
+-])
+-
+-AC_DEFUN([gl_SYS_SOCKET_MODULE_INDICATOR],
+-[
+- dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+- AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
+- gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+- dnl Define it also as a C macro, for the benefit of the unit tests.
+- gl_MODULE_INDICATOR_FOR_TESTS([$1])
+-])
+-
+-AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS],
+-[
+- GNULIB_SOCKET=0; AC_SUBST([GNULIB_SOCKET])
+- GNULIB_CONNECT=0; AC_SUBST([GNULIB_CONNECT])
+- GNULIB_ACCEPT=0; AC_SUBST([GNULIB_ACCEPT])
+- GNULIB_BIND=0; AC_SUBST([GNULIB_BIND])
+- GNULIB_GETPEERNAME=0; AC_SUBST([GNULIB_GETPEERNAME])
+- GNULIB_GETSOCKNAME=0; AC_SUBST([GNULIB_GETSOCKNAME])
+- GNULIB_GETSOCKOPT=0; AC_SUBST([GNULIB_GETSOCKOPT])
+- GNULIB_LISTEN=0; AC_SUBST([GNULIB_LISTEN])
+- GNULIB_RECV=0; AC_SUBST([GNULIB_RECV])
+- GNULIB_SEND=0; AC_SUBST([GNULIB_SEND])
+- GNULIB_RECVFROM=0; AC_SUBST([GNULIB_RECVFROM])
+- GNULIB_SENDTO=0; AC_SUBST([GNULIB_SENDTO])
+- GNULIB_SETSOCKOPT=0; AC_SUBST([GNULIB_SETSOCKOPT])
+- GNULIB_SHUTDOWN=0; AC_SUBST([GNULIB_SHUTDOWN])
+- GNULIB_ACCEPT4=0; AC_SUBST([GNULIB_ACCEPT4])
+- HAVE_STRUCT_SOCKADDR_STORAGE=1; AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE])
+- HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1;
+- AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY])
+- HAVE_SA_FAMILY_T=1; AC_SUBST([HAVE_SA_FAMILY_T])
+- HAVE_ACCEPT4=1; AC_SUBST([HAVE_ACCEPT4])
+-])
+diff -Naurp libiconv-1.14.org//srcm4/warn-on-use.m4 libiconv-1.14/srcm4/warn-on-use.m4
+--- libiconv-1.14.org//srcm4/warn-on-use.m4 2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/warn-on-use.m4 2012-01-08 02:07:40.934484487 -0800
+@@ -1,4 +1,4 @@
+-# warn-on-use.m4 serial 4
++# warn-on-use.m4 serial 2
+ dnl Copyright (C) 2010-2011 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+@@ -27,8 +27,6 @@ AC_DEFUN([gl_WARN_ON_USE_PREPARE],
+ [AH_TEMPLATE([HAVE_RAW_DECL_]AS_TR_CPP(m4_defn([gl_decl])),
+ [Define to 1 if ]m4_defn([gl_decl])[ is declared even after
+ undefining macros.])])dnl
+-dnl FIXME: gl_Symbol must be used unquoted until we can assume
+-dnl autoconf 2.64 or newer.
+ for gl_func in m4_flatten([$2]); do
+ AS_VAR_PUSHDEF([gl_Symbol], [gl_cv_have_raw_decl_$gl_func])dnl
+ AC_CACHE_CHECK([whether $gl_func is declared without a macro],
+@@ -37,8 +35,8 @@ dnl autoconf 2.64 or newer.
+ [@%:@undef $gl_func
+ (void) $gl_func;])],
+ [AS_VAR_SET(gl_Symbol, [yes])], [AS_VAR_SET(gl_Symbol, [no])])])
+- AS_VAR_IF(gl_Symbol, [yes],
+- [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1])
++ AS_VAR_IF(gl_Symbol, [yes],
++ [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1])
+ dnl shortcut - if the raw declaration exists, then set a cache
+ dnl variable to allow skipping any later AC_CHECK_DECL efforts
+ eval ac_cv_have_decl_$gl_func=yes])
diff --git a/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv-1.14/autoconf.patch b/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv-1.14/autoconf.patch
new file mode 100644
index 000000000..5d34ce7c0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv-1.14/autoconf.patch
@@ -0,0 +1,50 @@
+It adds the variables that are needed
+for autoconf 2.65 to reconfigure libiconv and delete the m4 macros
+directory. Its imported from OE.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: libiconv-1.13.1/configure.ac
+===================================================================
+--- libiconv-1.13.1.orig/configure.ac
++++ libiconv-1.13.1/configure.ac
+@@ -23,7 +23,7 @@ AC_CONFIG_AUX_DIR([build-aux])
+ AM_INIT_AUTOMAKE([libiconv], [1.13.1])
+ AC_CONFIG_HEADERS([config.h lib/config.h])
+ AC_PROG_MAKE_SET
+-
++AC_CONFIG_MACRO_DIR([m4])
+ dnl checks for basic programs
+
+ AC_PROG_CC
+Index: libiconv-1.13.1/libcharset/configure.ac
+===================================================================
+--- libiconv-1.13.1.orig/libcharset/configure.ac
++++ libiconv-1.13.1/libcharset/configure.ac
+@@ -16,17 +16,17 @@ dnl along with the GNU CHARSET Library;
+ dnl write to the Free Software Foundation, Inc., 51 Franklin Street,
+ dnl Fifth Floor, Boston, MA 02110-1301, USA.
+
+-AC_PREREQ([2.13])
++AC_PREREQ(2.61)
++AC_INIT([libcharset],[1.4] )
++AC_CONFIG_SRCDIR([lib/localcharset.c])
+
+-PACKAGE=libcharset
+-VERSION=1.4
+-
+-AC_INIT([lib/localcharset.c])
+ AC_CONFIG_AUX_DIR([build-aux])
+ AC_CONFIG_HEADER([config.h])
+ AC_PROG_MAKE_SET
+-AC_SUBST([PACKAGE])
+-AC_SUBST([VERSION])
++dnl AC_SUBST(PACKAGE)
++dnl AC_SUBST(VERSION)
++
++AC_CONFIG_MACRO_DIR([m4])
+
+ dnl checks for basic programs
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv_1.11.1.bb b/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv_1.11.1.bb
new file mode 100644
index 000000000..6ce4b96e3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv_1.11.1.bb
@@ -0,0 +1,47 @@
+SUMMARY = "Character encoding support library"
+DESCRIPTION = "GNU libiconv - libiconv is for you if your application needs to support \
+multiple character encodings, but that support lacks from your system."
+HOMEPAGE = "http://www.gnu.org/software/libiconv"
+SECTION = "libs"
+NOTES = "Needs to be stripped down to: ascii iso8859-1 eucjp iso-2022jp gb utf8"
+PROVIDES = "virtual/libiconv"
+
+LICENSE = "LGPLv2.0"
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674 \
+ file://libcharset/COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674"
+
+SRC_URI = "${GNU_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \
+ file://autoconf.patch \
+ file://shared_preloadable_libiconv_linux.patch \
+ "
+
+SRC_URI[md5sum] = "d42b97f6ef5dd0ba4469d520ed732fed"
+SRC_URI[sha256sum] = "e78c347a1a0cb15f2648519e9799151f4b4a934b61ad9ee7424478efe2b8257f"
+
+S = "${WORKDIR}/libiconv-${PV}"
+
+inherit autotools pkgconfig gettext
+
+python __anonymous() {
+ if d.getVar("TCLIBC", True) == "glibc":
+ raise bb.parse.SkipPackage("libiconv is provided for use with uClibc only - glibc already provides iconv")
+}
+
+EXTRA_OECONF += "--enable-shared --enable-static --enable-relocatable"
+
+LEAD_SONAME = "libiconv.so"
+
+do_configure_prepend () {
+ rm -f ${S}/m4/libtool.m4 ${S}/m4/ltoptions.m4 ${S}/m4/ltsugar.m4 ${S}/m4/ltversion.m4 ${S}/m4/lt~obsolete.m4 ${S}/libcharset/m4/libtool.m4 ${S}/libcharset/m4/ltoptions.m4 ${S}/libcharset/m4/ltsugar.m4 ${S}/libcharset/m4/ltversion.m4 ${S}/libcharset/m4/lt~obsolete.m4
+}
+
+do_configure_append () {
+ # forcibly remove RPATH from libtool
+ sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' *libtool
+ sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=_NO_RPATH_|g' *libtool
+}
+
+do_install_append () {
+ rm -rf ${D}${libdir}/preloadable_libiconv.so
+ rm -rf ${D}${libdir}/charset.alias
+}
diff --git a/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv_1.14.bb b/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv_1.14.bb
new file mode 100644
index 000000000..1b6fe09bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libiconv/libiconv_1.14.bb
@@ -0,0 +1,51 @@
+SUMMARY = "Character encoding support library"
+DESCRIPTION = "GNU libiconv - libiconv is for you if your application needs to support \
+multiple character encodings, but that support lacks from your system."
+HOMEPAGE = "http://www.gnu.org/software/libiconv"
+SECTION = "libs"
+NOTES = "Needs to be stripped down to: ascii iso8859-1 eucjp iso-2022jp gb utf8"
+PROVIDES = "virtual/libiconv"
+PR = "r1"
+LICENSE = "LGPLv3"
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674 \
+ file://libcharset/COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674"
+
+SRC_URI = "${GNU_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \
+ file://autoconf.patch \
+ file://add-relocatable-module.patch \
+ "
+
+SRC_URI[md5sum] = "e34509b1623cec449dfeb73d7ce9c6c6"
+SRC_URI[sha256sum] = "72b24ded17d687193c3366d0ebe7cde1e6b18f0df8c55438ac95be39e8a30613"
+
+S = "${WORKDIR}/libiconv-${PV}"
+
+inherit autotools pkgconfig gettext
+
+python __anonymous() {
+ if d.getVar("TARGET_OS", True) != "linux":
+ return
+ if d.getVar("TCLIBC", True) == "glibc":
+ raise bb.parse.SkipPackage("libiconv is provided for use with uClibc only - glibc already provides iconv")
+}
+
+EXTRA_OECONF += "--enable-shared --enable-static --enable-relocatable"
+
+LEAD_SONAME = "libiconv.so"
+
+do_configure_prepend () {
+ rm -f ${S}/m4/libtool.m4 ${S}/m4/ltoptions.m4 ${S}/m4/ltsugar.m4 ${S}/m4/ltversion.m4 ${S}/m4/lt~obsolete.m4 ${S}/libcharset/m4/libtool.m4 ${S}/libcharset/m4/ltoptions.m4 ${S}/libcharset/m4/ltsugar.m4 ${S}/libcharset/m4/ltversion.m4 ${S}/libcharset/m4/lt~obsolete.m4
+}
+
+do_configure_append () {
+ # forcibly remove RPATH from libtool
+ sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' *libtool
+ sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=_NO_RPATH_|g' *libtool
+}
+
+do_install_append () {
+ rm -rf ${D}${libdir}/preloadable_libiconv.so
+ rm -rf ${D}${libdir}/charset.alias
+}
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libksba/libksba/ksba-add-pkgconfig-support.patch b/import-layers/yocto-poky/meta/recipes-support/libksba/libksba/ksba-add-pkgconfig-support.patch
new file mode 100644
index 000000000..d28dfd9eb
--- /dev/null
+++ b/import-layers/yocto-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.0/Makefile.am
+===================================================================
+--- libksba-1.3.0.orig/Makefile.am 2014-05-13 21:39:22.390385646 +0000
++++ libksba-1.3.0/Makefile.am 2014-05-13 21:39:22.462385646 +0000
+@@ -21,6 +21,9 @@
+ ACLOCAL_AMFLAGS = -I m4 -I gl/m4
+ AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gzip
+
++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.0/configure.ac
+===================================================================
+--- libksba-1.3.0.orig/configure.ac 2014-05-13 21:39:22.390385646 +0000
++++ libksba-1.3.0/configure.ac 2014-05-13 21:39:22.462385646 +0000
+@@ -400,6 +400,7 @@
+ src/Makefile
+ src/ksba-config
+ src/versioninfo.rc
++ksba.pc
+ tests/Makefile
+ doc/Makefile
+ ])
+Index: libksba-1.3.0/ksba.pc.in
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ libksba-1.3.0/ksba.pc.in 2014-05-13 21:39:22.462385646 +0000
+@@ -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.0/src/ksba.m4
+===================================================================
+--- libksba-1.3.0.orig/src/ksba.m4 2014-05-13 21:39:22.390385646 +0000
++++ libksba-1.3.0/src/ksba.m4 2014-05-13 21:49:03.650382696 +0000
+@@ -22,18 +22,7 @@
+ 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 @@
+ 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 @@
+ 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 @@
+ fi
+ fi
+ else
+- KSBA_CFLAGS=""
+- KSBA_LIBS=""
+ ifelse([$3], , :, [$3])
+ fi
+ AC_SUBST(KSBA_CFLAGS)
diff --git a/import-layers/yocto-poky/meta/recipes-support/libksba/libksba_1.3.3.bb b/import-layers/yocto-poky/meta/recipes-support/libksba/libksba_1.3.3.bb
new file mode 100644
index 000000000..bc2116419
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libksba/libksba_1.3.3.bb
@@ -0,0 +1,25 @@
+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
+
+SRC_URI = "ftp://ftp.gnupg.org/gcrypt/${BPN}/${BPN}-${PV}.tar.bz2 \
+ file://ksba-add-pkgconfig-support.patch"
+
+SRC_URI[md5sum] = "a5dd3c57fca254935f5cf8db26e39065"
+SRC_URI[sha256sum] = "0c7f5ffe34d0414f6951d9880a46fcc2985c487f7c36369b9f11ad41131c7786"
+
+do_configure_prepend () {
+ # Else these could be used in preference to those in aclocal-copy
+ rm -f ${S}/m4/gpg-error.m4
+}
diff --git a/import-layers/yocto-poky/meta/recipes-support/libmpc/libmpc.inc b/import-layers/yocto-poky/meta/recipes-support/libmpc/libmpc.inc
new file mode 100644
index 000000000..b3742543d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/libmpc/libmpc_1.0.3.bb b/import-layers/yocto-poky/meta/recipes-support/libmpc/libmpc_1.0.3.bb
new file mode 100644
index 000000000..4f1f5242f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libmpc/libmpc_1.0.3.bb
@@ -0,0 +1,15 @@
+require libmpc.inc
+
+DEPENDS = "gmp mpfr"
+
+LIC_FILES_CHKSUM = "file://COPYING.LESSER;md5=e6a600fd5e1d9cbde2d983680233ad02"
+SRC_URI = "http://www.multiprecision.org/mpc/download/mpc-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "d6a1d5f8ddea3abd2cc3e98f58352d26"
+SRC_URI[sha256sum] = "617decc6ea09889fb08ede330917a00b16809b8db88c29c31bfbb49cbf88ecc3"
+
+UPSTREAM_CHECK_URI = "http://www.multiprecision.org/index.php?prog=mpc&page=download"
+
+S = "${WORKDIR}/mpc-${PV}"
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/libnl/libnl/fix-pc-file.patch b/import-layers/yocto-poky/meta/recipes-support/libnl/libnl/fix-pc-file.patch
new file mode 100644
index 000000000..fe8b833a1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/libnl/libnl/fix-pktloc_syntax_h-race.patch b/import-layers/yocto-poky/meta/recipes-support/libnl/libnl/fix-pktloc_syntax_h-race.patch
new file mode 100644
index 000000000..79aa0bdf1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libnl/libnl/fix-pktloc_syntax_h-race.patch
@@ -0,0 +1,36 @@
+Upstream-Status: Inappropriate [configuration]
+
+libnl has progressed to 0.3.2 and there does not appear to be any
+"make -j" issues with this build after my limited testing on that
+newer version so we can assume this issue is fixed upstream
+
+Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
+
+Index: libnl-3.2.25/lib/Makefile.am
+===================================================================
+--- libnl-3.2.25.orig/lib/Makefile.am
++++ libnl-3.2.25/lib/Makefile.am
+@@ -46,9 +46,12 @@ CLEANFILES = \
+
+ # Hack to avoid using ylwrap. It does not function correctly in combination
+ # with --header-file=
++route/pktloc.lo: route/pktloc_syntax.h route/pktloc_grammar.h
++route/pktloc_grammar.h: route/pktloc_grammar.c
+ route/pktloc_grammar.c: route/pktloc_grammar.l
+ $(AM_V_GEN) $(MKDIR_P) route; $(FLEX) --header-file=route/pktloc_grammar.h $(LFLAGS) -o $@ $^
+
++route/pktloc_syntax.h: route/pktloc_syntax.c
+ route/pktloc_syntax.c: route/pktloc_syntax.y
+ $(AM_V_GEN) $(MKDIR_P) route; $(YACC) -d $(YFLAGS) -o $@ $^
+
+@@ -102,7 +105,9 @@ BUILT_SOURCES = \
+ route/cls/ematch_grammar.c \
+ route/cls/ematch_syntax.c \
+ route/pktloc_grammar.c \
+- route/pktloc_syntax.c
++ route/pktloc_syntax.c \
++ route/pktloc_syntax.h \
++ route/pktloc_grammar.h
+
+ EXTRA_DIST = \
+ route/pktloc_grammar.l \
diff --git a/import-layers/yocto-poky/meta/recipes-support/libnl/libnl_3.2.25.bb b/import-layers/yocto-poky/meta/recipes-support/libnl/libnl_3.2.25.bb
new file mode 100644
index 000000000..cabe84107
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libnl/libnl_3.2.25.bb
@@ -0,0 +1,42 @@
+SUMMARY = "A library for applications dealing with netlink sockets"
+HOMEPAGE = "http://www.infradead.org/~tgr/libnl/"
+SECTION = "libs/network"
+
+PE = "1"
+PR = "r1"
+
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
+
+DEPENDS = "flex-native bison-native"
+
+SRC_URI = "http://www.infradead.org/~tgr/${BPN}/files/${BP}.tar.gz \
+ file://fix-pktloc_syntax_h-race.patch \
+ file://fix-pc-file.patch \
+ "
+
+SRC_URI[md5sum] = "03f74d0cd5037cadc8cdfa313bbd195c"
+SRC_URI[sha256sum] = "8beb7590674957b931de6b7f81c530b85dc7c1ad8fbda015398bc1e8d1ce8ec5"
+
+inherit autotools pkgconfig
+
+FILES_${PN} = "${libdir}/libnl-3.so.* \
+ ${libdir}/libnl.so.* \
+ ${sysconfdir}"
+RREPLACES_${PN} = "libnl2"
+RCONFLICTS_${PN} = "libnl2"
+FILES_${PN}-staticdev += "${libdir}/libnl/cli/*/*.a"
+
+PACKAGES += "${PN}-cli ${PN}-route ${PN}-nf ${PN}-genl ${PN}-idiag"
+FILES_${PN}-cli = "${libdir}/libnl-cli-3.so.* \
+ ${libdir}/libnl/cli/*/*.so \
+ ${libdir}/libnl/cli/*/*.la \
+ ${sbindir}/nl-*"
+FILES_${PN}-route = "${libdir}/libnl-route-3.so.*"
+FILES_${PN}-idiag = "${libdir}/libnl-idiag-3.so.*"
+FILES_${PN}-nf = "${libdir}/libnl-nf-3.so.*"
+FILES_${PN}-genl = "${libdir}/libnl-genl-3.so.* \
+ ${libdir}/libnl-genl.so.* \
+ ${sbindir}/genl-ctrl-list"
+RREPLACES_${PN}-genl = "libnl-genl2 libnl-genl-3-200"
+RCONFLICTS_${PN}-genl = "libnl-genl2 libnl-genl-3-200"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libpcre/libpcre/Makefile b/import-layers/yocto-poky/meta/recipes-support/libpcre/libpcre/Makefile
new file mode 100644
index 000000000..708d807d0
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/libpcre/libpcre/fix-pcre-name-collision.patch b/import-layers/yocto-poky/meta/recipes-support/libpcre/libpcre/fix-pcre-name-collision.patch
new file mode 100644
index 000000000..89b44f6aa
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/libpcre/libpcre/pcre-cross.patch b/import-layers/yocto-poky/meta/recipes-support/libpcre/libpcre/pcre-cross.patch
new file mode 100644
index 000000000..83880f709
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/libpcre/libpcre/run-ptest b/import-layers/yocto-poky/meta/recipes-support/libpcre/libpcre/run-ptest
new file mode 100644
index 000000000..990d4a12a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libpcre/libpcre/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+make check-TESTS
diff --git a/import-layers/yocto-poky/meta/recipes-support/libpcre/libpcre_8.38.bb b/import-layers/yocto-poky/meta/recipes-support/libpcre/libpcre_8.38.bb
new file mode 100644
index 000000000..384c2fe79
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libpcre/libpcre_8.38.bb
@@ -0,0 +1,79 @@
+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=7e4937814aee14758c1c95b59c80c44d"
+SRC_URI = "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-${PV}.tar.bz2 \
+ file://pcre-cross.patch \
+ file://fix-pcre-name-collision.patch \
+ file://run-ptest \
+ file://Makefile \
+"
+
+SRC_URI[md5sum] = "00aabbfe56d5a48b270f999b508c5ad2"
+SRC_URI[sha256sum] = "b9e02d36e23024d6c02a2e5b25204b3a4fa6ade43e0a5f869f254f49535079df"
+
+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++"
+
+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
+}
diff --git a/import-layers/yocto-poky/meta/recipes-support/libproxy/libproxy/0001-test-Include-sys-select.h-for-select.patch b/import-layers/yocto-poky/meta/recipes-support/libproxy/libproxy/0001-test-Include-sys-select.h-for-select.patch
new file mode 100644
index 000000000..5ae52f2d4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libproxy/libproxy/0001-test-Include-sys-select.h-for-select.patch
@@ -0,0 +1,37 @@
+From f5f2c2289eb35eb804c1c35e46ca41b58e4cae01 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 6 Apr 2015 14:13:49 -0700
+Subject: [PATCH] test: Include <sys/select.h> for select()
+
+As per posix we need to include this file otherwise we end up with errors like
+
+/home/kraj/work/bleeding/openembedded-core/build/tmp-musl/work/mips32r2-oe-linux-musl/libproxy/0.4.11-r0/libproxy-0.4.11/libproxy/test/get-pac-test.cpp: In member function 'bool TestServer::loop()':
+/home/kraj/work/bleeding/openembedded-core/build/tmp-musl/work/mips32r2-oe-linux-musl/libproxy/0.4.11-r0/libproxy-0.4.11/libproxy/test/get-pac-test.cpp:80:4: error: 'fd_set' was not declared in this scope
+ fd_set fds;
+ ^
+/home/kraj/work/bleeding/openembedded-core/build/tmp-musl/work/mips32r2-oe-linux-musl/libproxy/0.4.11-r0/libproxy-0.4.11/libproxy/test/get-pac-test.cpp:89:14: error: 'fds' was not declared in this scope
+ FD_ZERO (&fds);
+<JIRA TICKET #1>, <JIRA TICKET #2>, <JIRA TICKET #n> : <one line summary of change>
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libproxy/test/get-pac-test.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libproxy/test/get-pac-test.cpp b/libproxy/test/get-pac-test.cpp
+index a61fc4b..bda4646 100644
+--- a/libproxy/test/get-pac-test.cpp
++++ b/libproxy/test/get-pac-test.cpp
+@@ -3,6 +3,7 @@
+ #include <sstream>
+ #include <string>
+
++#include <sys/select.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/libproxy/libproxy_0.4.11.bb b/import-layers/yocto-poky/meta/recipes-support/libproxy/libproxy_0.4.11.bb
new file mode 100644
index 000000000..8cc90bb8e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libproxy/libproxy_0.4.11.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Library providing automatic proxy configuration management"
+HOMEPAGE = "http://code.google.com/p/libproxy/"
+BUGTRACKER = "http://code.google.com/p/libproxy/issues/list"
+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 = "${DEBIAN_MIRROR}/main/libp/${BPN}/${BPN}_${PV}.orig.tar.gz \
+ file://0001-test-Include-sys-select.h-for-select.patch \
+ "
+
+SRC_URI[md5sum] = "3cd1ae2a4abecf44b3f24d6639d2cd84"
+SRC_URI[sha256sum] = "dc3f33de54163718f82b3e7c496a7de97f8862578414b8ecaad3cbfe4821864b"
+
+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} \
+"
+
+FILES_${PN} += "${libdir}/${BPN}/${PV}/modules"
+FILES_${PN}-dev += "${datadir}/cmake"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libsoup/libsoup-2.4_2.52.2.bb b/import-layers/yocto-poky/meta/recipes-support/libsoup/libsoup-2.4_2.52.2.bb
new file mode 100644
index 000000000..f6e3db2c9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libsoup/libsoup-2.4_2.52.2.bb
@@ -0,0 +1,34 @@
+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', True).split('.')[0]}.${@d.getVar('PV', True).split('.')[1]}"
+
+SRC_URI = "${GNOME_MIRROR}/libsoup/${SHRT_VER}/libsoup-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "e4757d09012ed93822b1ee41435fec24"
+SRC_URI[sha256sum] = "db55628b5c7d952945bb71b236469057c8dfb8dea0c271513579c6273c2093dc"
+
+S = "${WORKDIR}/libsoup-${PV}"
+
+inherit autotools gettext pkgconfig upstream-version-is-even gobject-introspection
+
+# libsoup-gnome is entirely deprecated and just stubs in 2.42 onwards. Disable by default.
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[gnome] = "--with-gnome,--without-gnome"
+
+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/import-layers/yocto-poky/meta/recipes-support/libunistring/libunistring/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/libunistring/libunistring/iconv-m4-remove-the-test-to-convert-euc-jp.patch b/import-layers/yocto-poky/meta/recipes-support/libunistring/libunistring/iconv-m4-remove-the-test-to-convert-euc-jp.patch
new file mode 100644
index 000000000..d4489165b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libunistring/libunistring/iconv-m4-remove-the-test-to-convert-euc-jp.patch
@@ -0,0 +1,40 @@
+From 8d99a368615656a835f5502326afd31cec2cebfe Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Mon, 16 Sep 2013 18:16:12 +0800
+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 | 11 -----------
+ 1 files changed, 0 insertions(+), 11 deletions(-)
+
+Index: libunistring-0.9.4/gnulib-m4/iconv.m4
+===================================================================
+--- libunistring-0.9.4.orig/gnulib-m4/iconv.m4 2014-11-03 17:41:29.755011917 +0000
++++ libunistring-0.9.4/gnulib-m4/iconv.m4 2014-11-03 17:43:03.795014480 +0000
+@@ -159,17 +159,6 @@
+ }
+ }
+ #endif
+- /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
+- provided. */
+- if (/* Try standardized names. */
+- iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
+- /* Try IRIX, OSF/1 names. */
+- && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
+- /* Try AIX names. */
+- && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
+- /* Try HP-UX names. */
+- && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
+- result |= 16;
+ return result;
+ }]])],
+ [am_cv_func_iconv_works=yes],
diff --git a/import-layers/yocto-poky/meta/recipes-support/libunistring/libunistring_0.9.6.bb b/import-layers/yocto-poky/meta/recipes-support/libunistring/libunistring_0.9.6.bb
new file mode 100644
index 000000000..bb701227f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libunistring/libunistring_0.9.6.bb
@@ -0,0 +1,28 @@
+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 = "GPLv3 & LGPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://COPYING.LIB;md5=6a6a8e020838b23406c81b19c1d46df6"
+
+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] = "dfae4ff5583649ed24d8f368f1d0543b"
+SRC_URI[sha256sum] = "9625eec2507f4789ebb6fc48ebda98be0e0168979a2f68aa8b680bf8eeabbd47"
+
+inherit autotools texinfo
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/0001-Fix-build-on-mips-musl.patch b/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/0001-Fix-build-on-mips-musl.patch
new file mode 100644
index 000000000..5426fcc5c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/0001-Fix-build-on-mips-musl.patch
@@ -0,0 +1,90 @@
+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(-)
+
+diff --git a/src/coredump/_UCD_internal.h b/src/coredump/_UCD_internal.h
+index 3c95a2a..80acc15 100644
+--- a/src/coredump/_UCD_internal.h
++++ b/src/coredump/_UCD_internal.h
+@@ -34,6 +34,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+ #ifdef HAVE_SYS_PROCFS_H
+ #include <sys/procfs.h> /* struct elf_prstatus */
+ #endif
++#include <sys/reg.h>
+ #include <errno.h>
+ #include <string.h>
+ #include <limits.h>
+@@ -44,6 +45,39 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+ #include "libunwind_i.h"
+
++#ifndef __GLIBC__
++#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;
+diff --git a/src/mips/getcontext.S b/src/mips/getcontext.S
+index d1dbd57..de9b681 100644
+--- a/src/mips/getcontext.S
++++ b/src/mips/getcontext.S
+@@ -24,12 +24,11 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ 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
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/0001-Invalid-dwarf-opcodes-can-cause-references-beyond-th.patch b/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/0001-Invalid-dwarf-opcodes-can-cause-references-beyond-th.patch
new file mode 100644
index 000000000..af972f84e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/0001-Invalid-dwarf-opcodes-can-cause-references-beyond-th.patch
@@ -0,0 +1,29 @@
+From 396b6c7ab737e2bff244d640601c436a26260ca1 Mon Sep 17 00:00:00 2001
+From: Arun Sharma <arun@sharma-home.net>
+Date: Fri, 19 Jun 2015 19:47:22 -0700
+Subject: [PATCH] Invalid dwarf opcodes can cause references beyond the end of
+ the array.
+
+Upstream-Status: backport
+
+Signed-off-by: Li Zhou <li.zhou@windriver.com>
+---
+ include/dwarf_i.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/dwarf_i.h b/include/dwarf_i.h
+index 1e6231e..4a02a7d 100644
+--- a/include/dwarf_i.h
++++ b/include/dwarf_i.h
+@@ -20,7 +20,7 @@
+ extern const uint8_t dwarf_to_unw_regnum_map[DWARF_REGNUM_MAP_LENGTH];
+ /* REG is evaluated multiple times; it better be side-effects free! */
+ # define dwarf_to_unw_regnum(reg) \
+- (((reg) <= DWARF_REGNUM_MAP_LENGTH) ? dwarf_to_unw_regnum_map[reg] : 0)
++ (((reg) < DWARF_REGNUM_MAP_LENGTH) ? dwarf_to_unw_regnum_map[reg] : 0)
+ #endif
+
+ #ifdef UNW_LOCAL_ONLY
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/0001-backtrace-Use-only-with-glibc-and-uclibc.patch b/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/0001-backtrace-Use-only-with-glibc-and-uclibc.patch
new file mode 100644
index 000000000..9aed419a1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/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/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/0001-disable-tests.patch b/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/0001-disable-tests.patch
new file mode 100644
index 000000000..7309ffd86
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/0001-disable-tests.patch
@@ -0,0 +1,31 @@
+From b07435a90bd636ee718e2238fb46c74a6dd5e069 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 22 Mar 2016 16:41:13 +0000
+Subject: [PATCH] disable tests
+
+Tests use getcontext() API which is
+not there on musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Inappropriate [MUSL-only]
+
+ Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index e24fe1e..15380e4 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -39,7 +39,7 @@ endif
+
+ nodist_include_HEADERS = include/libunwind-common.h
+
+-SUBDIRS = src tests doc
++SUBDIRS = src doc
+
+ noinst_HEADERS = include/dwarf.h include/dwarf_i.h include/dwarf-eh.h \
+ include/compiler.h include/libunwind_i.h include/mempool.h \
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/0001-x86-Stub-out-x86_local_resume.patch b/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/0001-x86-Stub-out-x86_local_resume.patch
new file mode 100644
index 000000000..371013aaa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/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/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/AArch64-port.patch b/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/AArch64-port.patch
new file mode 100644
index 000000000..228ec322d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/AArch64-port.patch
@@ -0,0 +1,2529 @@
+From ac6c0a6535975f1dc2da6e4e2766614baac2a14a Mon Sep 17 00:00:00 2001
+From: Yvan Roux <yvan.roux@linaro.org>
+Date: Sat, 11 May 2013 09:18:23 -0600
+Subject: [PATCH] AArch64 port.
+
+Upstream-Status: Backport
+
+---
+ Makefile.am | 6
+ README | 1
+ configure.ac | 6
+ include/libunwind-aarch64.h | 187 ++++++++++++++++++++++
+ include/libunwind.h.in | 4
+ include/tdep-aarch64/dwarf-config.h | 52 ++++++
+ include/tdep-aarch64/jmpbuf.h | 33 +++
+ include/tdep-aarch64/libunwind_i.h | 294 +++++++++++++++++++++++++++++++++++
+ include/tdep/dwarf-config.h | 4
+ include/tdep/jmpbuf.h | 2
+ include/tdep/libunwind_i.h.in | 4
+ src/Makefile.am | 39 ++++
+ src/aarch64/Gcreate_addr_space.c | 60 +++++++
+ src/aarch64/Gget_proc_info.c | 39 ++++
+ src/aarch64/Gget_save_loc.c | 100 +++++++++++
+ src/aarch64/Gglobal.c | 57 ++++++
+ src/aarch64/Ginit.c | 187 ++++++++++++++++++++++
+ src/aarch64/Ginit_local.c | 55 ++++++
+ src/aarch64/Ginit_remote.c | 45 +++++
+ src/aarch64/Gis_signal_frame.c | 64 +++++++
+ src/aarch64/Gregs.c | 113 +++++++++++++
+ src/aarch64/Gresume.c | 177 +++++++++++++++++++++
+ src/aarch64/Gstep.c | 129 +++++++++++++++
+ src/aarch64/Lcreate_addr_space.c | 5
+ src/aarch64/Lget_proc_info.c | 5
+ src/aarch64/Lget_save_loc.c | 5
+ src/aarch64/Lglobal.c | 5
+ src/aarch64/Linit.c | 5
+ src/aarch64/Linit_local.c | 5
+ src/aarch64/Linit_remote.c | 5
+ src/aarch64/Lis_signal_frame.c | 5
+ src/aarch64/Lregs.c | 5
+ src/aarch64/Lresume.c | 5
+ src/aarch64/Lstep.c | 5
+ src/aarch64/gen-offsets.c | 68 ++++++++
+ src/aarch64/init.h | 127 +++++++++++++++
+ src/aarch64/is_fpreg.c | 32 +++
+ src/aarch64/offsets.h | 49 +++++
+ src/aarch64/regname.c | 106 ++++++++++++
+ src/aarch64/siglongjmp.S | 12 +
+ src/aarch64/unwind_i.h | 43 +++++
+ src/coredump/_UCD_access_reg_linux.c | 5
+ src/ptrace/_UPT_reg_offset.c | 36 ++++
+ 43 files changed, 2184 insertions(+), 7 deletions(-)
+ create mode 100644 include/libunwind-aarch64.h
+ create mode 100644 include/tdep-aarch64/dwarf-config.h
+ create mode 100644 include/tdep-aarch64/jmpbuf.h
+ create mode 100644 include/tdep-aarch64/libunwind_i.h
+ create mode 100644 src/aarch64/Gcreate_addr_space.c
+ create mode 100644 src/aarch64/Gget_proc_info.c
+ create mode 100644 src/aarch64/Gget_save_loc.c
+ create mode 100644 src/aarch64/Gglobal.c
+ create mode 100644 src/aarch64/Ginit.c
+ create mode 100644 src/aarch64/Ginit_local.c
+ create mode 100644 src/aarch64/Ginit_remote.c
+ create mode 100644 src/aarch64/Gis_signal_frame.c
+ create mode 100644 src/aarch64/Gregs.c
+ create mode 100644 src/aarch64/Gresume.c
+ create mode 100644 src/aarch64/Gstep.c
+ create mode 100644 src/aarch64/Lcreate_addr_space.c
+ create mode 100644 src/aarch64/Lget_proc_info.c
+ create mode 100644 src/aarch64/Lget_save_loc.c
+ create mode 100644 src/aarch64/Lglobal.c
+ create mode 100644 src/aarch64/Linit.c
+ create mode 100644 src/aarch64/Linit_local.c
+ create mode 100644 src/aarch64/Linit_remote.c
+ create mode 100644 src/aarch64/Lis_signal_frame.c
+ create mode 100644 src/aarch64/Lregs.c
+ create mode 100644 src/aarch64/Lresume.c
+ create mode 100644 src/aarch64/Lstep.c
+ create mode 100644 src/aarch64/gen-offsets.c
+ create mode 100644 src/aarch64/init.h
+ create mode 100644 src/aarch64/is_fpreg.c
+ create mode 100644 src/aarch64/offsets.h
+ create mode 100644 src/aarch64/regname.c
+ create mode 100644 src/aarch64/siglongjmp.S
+ create mode 100644 src/aarch64/unwind_i.h
+
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -2,6 +2,9 @@ include_HEADERS = include/libunwind-dyna
+ include/libunwind-ptrace.h \
+ include/libunwind-coredump.h
+
++if ARCH_AARCH64
++include_HEADERS += include/libunwind-aarch64.h
++endif
+ if ARCH_ARM
+ include_HEADERS += include/libunwind-arm.h
+ endif
+@@ -41,6 +44,9 @@ SUBDIRS = src tests doc
+ noinst_HEADERS = include/dwarf.h include/dwarf_i.h include/dwarf-eh.h \
+ include/compiler.h include/libunwind_i.h include/mempool.h \
+ include/remote.h \
++ include/tdep-aarch64/dwarf-config.h \
++ include/tdep-aarch64/jmpbuf.h \
++ include/tdep-aarch64/libunwind_i.h \
+ include/tdep-arm/dwarf-config.h include/tdep-arm/ex_tables.h \
+ include/tdep-arm/jmpbuf.h include/tdep-arm/libunwind_i.h \
+ include/tdep-ia64/jmpbuf.h include/tdep-ia64/rse.h \
+--- a/README
++++ b/README
+@@ -9,6 +9,7 @@ several architecture/operating-system co
+ Linux/IA-64: Fully tested and supported.
+ Linux/PARISC: Works well, but C library missing unwind-info.
+ HP-UX/IA-64: Mostly works but known to have some serious limitations.
++ Linux/AArch64: Newly added.
+ Linux/PPC64: Newly added.
+ Linux/SuperH: Newly added.
+ FreeBSD/i386: Newly added.
+--- a/configure.ac
++++ b/configure.ac
+@@ -104,7 +104,7 @@ SET_ARCH([$target_cpu],[target_arch])
+
+ AC_ARG_ENABLE(coredump,
+ AS_HELP_STRING([--enable-coredump],[building libunwind-coredump library]),,
+- [AS_CASE([$host_arch], [arm*|mips*|sh*|x86*], [enable_coredump=yes], [enable_coredump=no])]
++ [AS_CASE([$host_arch], [aarch64*|arm*|mips*|sh*|x86*], [enable_coredump=yes], [enable_coredump=no])]
+ )
+
+ AC_MSG_CHECKING([if we should build libunwind-coredump])
+@@ -121,6 +121,7 @@ AC_MSG_RESULT([$target_os])
+
+ AM_CONDITIONAL(BUILD_COREDUMP, test x$enable_coredump = xyes)
+ AM_CONDITIONAL(REMOTE_ONLY, test x$target_arch != x$host_arch)
++AM_CONDITIONAL(ARCH_AARCH64, test x$target_arch = xaarch64)
+ AM_CONDITIONAL(ARCH_ARM, test x$target_arch = xarm)
+ AM_CONDITIONAL(ARCH_IA64, test x$target_arch = xia64)
+ AM_CONDITIONAL(ARCH_HPPA, test x$target_arch = xhppa)
+@@ -137,7 +138,7 @@ AM_CONDITIONAL(OS_FREEBSD, expr x$target
+ AC_MSG_CHECKING([for ELF helper width])
+ case "${target_arch}" in
+ (arm|hppa|ppc32|x86|sh) use_elf32=yes; AC_MSG_RESULT([32]);;
+-(ia64|ppc64|x86_64) use_elf64=yes; AC_MSG_RESULT([64]);;
++(aarch64|ia64|ppc64|x86_64) use_elf64=yes; AC_MSG_RESULT([64]);;
+ (mips) use_elfxx=yes; AC_MSG_RESULT([xx]);;
+ *) AC_MSG_ERROR([Unknown ELF target: ${target_arch}])
+ esac
+@@ -186,6 +187,7 @@ AS_HELP_STRING([--enable-cxx-exceptions]
+ # C++ exception handling doesn't work too well on x86
+ case $target_arch in
+ x86*) enable_cxx_exceptions=no;;
++ aarch64*) enable_cxx_exceptions=no;;
+ arm*) enable_cxx_exceptions=no;;
+ mips*) enable_cxx_exceptions=no;;
+ *) enable_cxx_exceptions=yes;;
+--- /dev/null
++++ b/include/libunwind-aarch64.h
+@@ -0,0 +1,187 @@
++/* libunwind - a platform-independent unwind library
++ Copyright (C) 2001-2004 Hewlett-Packard Co
++ Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
++ Copyright (C) 2013 Linaro Limited
++
++This file is part of libunwind.
++
++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. */
++
++#ifndef LIBUNWIND_H
++#define LIBUNWIND_H
++
++#if defined(__cplusplus) || defined(c_plusplus)
++extern "C" {
++#endif
++
++#include <inttypes.h>
++#include <stddef.h>
++#include <ucontext.h>
++
++#define UNW_TARGET aarch64
++#define UNW_TARGET_AARCH64 1
++
++#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */
++
++/* This needs to be big enough to accommodate "struct cursor", while
++ leaving some slack for future expansion. Changing this value will
++ require recompiling all users of this library. Stack allocation is
++ relatively cheap and unwind-state copying is relatively rare, so we
++ want to err on making it rather too big than too small. */
++
++#define UNW_TDEP_CURSOR_LEN 4096
++
++typedef uint64_t unw_word_t;
++typedef int64_t unw_sword_t;
++
++typedef long double unw_tdep_fpreg_t;
++
++typedef struct
++ {
++ /* no aarch64-specific auxiliary proc-info */
++ }
++unw_tdep_proc_info_t;
++
++typedef enum
++ {
++ /* 64-bit general registers. */
++ UNW_AARCH64_X0,
++ UNW_AARCH64_X1,
++ UNW_AARCH64_X2,
++ UNW_AARCH64_X3,
++ UNW_AARCH64_X4,
++ UNW_AARCH64_X5,
++ UNW_AARCH64_X6,
++ UNW_AARCH64_X7,
++ UNW_AARCH64_X8,
++
++ /* Temporary registers. */
++ UNW_AARCH64_X9,
++ UNW_AARCH64_X10,
++ UNW_AARCH64_X11,
++ UNW_AARCH64_X12,
++ UNW_AARCH64_X13,
++ UNW_AARCH64_X14,
++ UNW_AARCH64_X15,
++
++ /* Intra-procedure-call temporary registers. */
++ UNW_AARCH64_X16,
++ UNW_AARCH64_X17,
++
++ /* Callee-saved registers. */
++ UNW_AARCH64_X18,
++ UNW_AARCH64_X19,
++ UNW_AARCH64_X20,
++ UNW_AARCH64_X21,
++ UNW_AARCH64_X22,
++ UNW_AARCH64_X23,
++ UNW_AARCH64_X24,
++ UNW_AARCH64_X25,
++ UNW_AARCH64_X26,
++ UNW_AARCH64_X27,
++ UNW_AARCH64_X28,
++
++ /* 64-bit frame pointer. */
++ UNW_AARCH64_X29,
++
++ /* 64-bit link register. */
++ UNW_AARCH64_X30,
++
++ /* 64-bit stack pointer. */
++ UNW_AARCH64_SP = 31,
++ UNW_AARCH64_PC,
++ UNW_AARCH64_PSTATE,
++
++ /* 128-bit FP/Advanced SIMD registers. */
++ UNW_AARCH64_V0 = 64,
++ UNW_AARCH64_V1,
++ UNW_AARCH64_V2,
++ UNW_AARCH64_V3,
++ UNW_AARCH64_V4,
++ UNW_AARCH64_V5,
++ UNW_AARCH64_V6,
++ UNW_AARCH64_V7,
++ UNW_AARCH64_V8,
++ UNW_AARCH64_V9,
++ UNW_AARCH64_V10,
++ UNW_AARCH64_V11,
++ UNW_AARCH64_V12,
++ UNW_AARCH64_V13,
++ UNW_AARCH64_V14,
++ UNW_AARCH64_V15,
++ UNW_AARCH64_V16,
++ UNW_AARCH64_V17,
++ UNW_AARCH64_V18,
++ UNW_AARCH64_V19,
++ UNW_AARCH64_V20,
++ UNW_AARCH64_V21,
++ UNW_AARCH64_V22,
++ UNW_AARCH64_V23,
++ UNW_AARCH64_V24,
++ UNW_AARCH64_V25,
++ UNW_AARCH64_V26,
++ UNW_AARCH64_V27,
++ UNW_AARCH64_V28,
++ UNW_AARCH64_V29,
++ UNW_AARCH64_V30,
++ UNW_AARCH64_V31,
++
++ UNW_AARCH64_FPSR,
++ UNW_AARCH64_FPCR,
++
++ /* For AArch64, the CFA is the value of SP (x31) at the call site of the
++ previous frame. */
++ UNW_AARCH64_CFA = UNW_AARCH64_SP,
++
++ UNW_TDEP_LAST_REG = UNW_AARCH64_FPCR,
++
++ UNW_TDEP_IP = UNW_AARCH64_X30,
++ UNW_TDEP_SP = UNW_AARCH64_SP,
++ UNW_TDEP_EH = UNW_AARCH64_X0,
++
++ }
++aarch64_regnum_t;
++
++/* Use R0 through R3 to pass exception handling information. */
++#define UNW_TDEP_NUM_EH_REGS 4
++
++typedef struct unw_tdep_save_loc
++ {
++ /* Additional target-dependent info on a save location. */
++ }
++unw_tdep_save_loc_t;
++
++
++/* On AArch64, we can directly use ucontext_t as the unwind context. */
++typedef ucontext_t unw_tdep_context_t;
++
++#include "libunwind-common.h"
++#include "libunwind-dynamic.h"
++
++#define unw_tdep_getcontext(uc) (getcontext (uc), 0)
++#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg)
++
++extern int unw_tdep_is_fpreg (int);
++
++#if defined(__cplusplus) || defined(c_plusplus)
++}
++#endif
++
++#endif /* LIBUNWIND_H */
+--- a/include/libunwind.h.in
++++ b/include/libunwind.h.in
+@@ -3,7 +3,9 @@
+
+ #ifndef UNW_REMOTE_ONLY
+
+-#if defined __arm__
++#if defined __aarch64__
++#include "libunwind-aarch64.h"
++#elif defined __arm__
+ # include "libunwind-arm.h"
+ #elif defined __hppa__
+ # include "libunwind-hppa.h"
+--- /dev/null
++++ b/include/tdep-aarch64/dwarf-config.h
+@@ -0,0 +1,52 @@
++/* libunwind - a platform-independent unwind library
++ Copyright (C) 2008 CodeSourcery
++ Copyright (C) 2012 Tommi Rantala <tt.rantala@gmail.com>
++ Copyright (C) 2013 Linaro Limited
++
++This file is part of libunwind.
++
++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. */
++
++#ifndef dwarf_config_h
++#define dwarf_config_h
++
++/* This matches the value udes by GCC (see
++ gcc/config/aarch64/aarch64.h:DWARF_FRAME_REGISTERS. */
++#define DWARF_NUM_PRESERVED_REGS 97
++
++/* Return TRUE if the ADDR_SPACE uses big-endian byte-order. */
++#define dwarf_is_big_endian(addr_space) 0
++
++#define dwarf_to_unw_regnum(reg) (((reg) <= UNW_AARCH64_V31) ? (reg) : 0)
++
++/* Convert a pointer to a dwarf_cursor structure to a pointer to
++ unw_cursor_t. */
++#define dwarf_to_cursor(c) ((unw_cursor_t *) (c))
++
++typedef struct dwarf_loc
++ {
++ unw_word_t val;
++#ifndef UNW_LOCAL_ONLY
++ unw_word_t type; /* see DWARF_LOC_TYPE_* macros. */
++#endif
++ }
++dwarf_loc_t;
++
++#endif /* dwarf_config_h */
+--- /dev/null
++++ b/include/tdep-aarch64/jmpbuf.h
+@@ -0,0 +1,33 @@
++/* libunwind - a platform-independent unwind library
++ Copyright (C) 2008 CodeSourcery
++ Copyright (C) 2013 Linaro Limited
++
++This file is part of libunwind.
++
++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. */
++
++/* Use glibc's jump-buffer indices; NPTL peeks at SP: */
++
++/* FIXME for AArch64 */
++
++#define JB_SP 13
++#define JB_RP 14
++#define JB_MASK_SAVED 15
++#define JB_MASK 16
+--- /dev/null
++++ b/include/tdep-aarch64/libunwind_i.h
+@@ -0,0 +1,294 @@
++/* libunwind - a platform-independent unwind library
++ Copyright (C) 2001-2005 Hewlett-Packard Co
++ Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
++ Copyright (C) 2013 Linaro Limited
++
++This file is part of libunwind.
++
++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. */
++
++#ifndef AARCH64_LIBUNWIND_I_H
++#define AARCH64_LIBUNWIND_I_H
++
++/* Target-dependent definitions that are internal to libunwind but need
++ to be shared with target-independent code. */
++
++#include <stdlib.h>
++#include <libunwind.h>
++
++#include "elf64.h"
++#include "mempool.h"
++#include "dwarf.h"
++
++typedef struct
++ {
++ /* no aarch64-specific fast trace */
++ }
++unw_tdep_frame_t;
++
++#ifdef UNW_LOCAL_ONLY
++
++typedef unw_word_t aarch64_loc_t;
++
++#else /* !UNW_LOCAL_ONLY */
++
++typedef struct aarch64_loc
++ {
++ unw_word_t w0, w1;
++ }
++aarch64_loc_t;
++
++#endif /* !UNW_LOCAL_ONLY */
++
++struct unw_addr_space
++ {
++ struct unw_accessors acc;
++ int big_endian;
++ unw_caching_policy_t caching_policy;
++#ifdef HAVE_ATOMIC_OPS_H
++ AO_t cache_generation;
++#else
++ uint32_t cache_generation;
++#endif
++ unw_word_t dyn_generation; /* see dyn-common.h */
++ unw_word_t dyn_info_list_addr; /* (cached) dyn_info_list_addr */
++ struct dwarf_rs_cache global_cache;
++ struct unw_debug_frame_list *debug_frames;
++ };
++
++struct cursor
++ {
++ struct dwarf_cursor dwarf; /* must be first */
++ enum
++ {
++ AARCH64_SCF_NONE,
++ AARCH64_SCF_LINUX_RT_SIGFRAME,
++ }
++ sigcontext_format;
++ unw_word_t sigcontext_addr;
++ unw_word_t sigcontext_sp;
++ unw_word_t sigcontext_pc;
++ };
++
++#define DWARF_GET_LOC(l) ((l).val)
++
++#ifdef UNW_LOCAL_ONLY
++# define DWARF_NULL_LOC DWARF_LOC (0, 0)
++# define DWARF_IS_NULL_LOC(l) (DWARF_GET_LOC (l) == 0)
++# define DWARF_LOC(r, t) ((dwarf_loc_t) { .val = (r) })
++# define DWARF_IS_REG_LOC(l) 0
++# define DWARF_REG_LOC(c,r) (DWARF_LOC((unw_word_t) \
++ tdep_uc_addr((c)->as_arg, (r)), 0))
++# define DWARF_MEM_LOC(c,m) DWARF_LOC ((m), 0)
++# define DWARF_FPREG_LOC(c,r) (DWARF_LOC((unw_word_t) \
++ tdep_uc_addr((c)->as_arg, (r)), 0))
++
++static inline int
++dwarf_getfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t *val)
++{
++ if (!DWARF_GET_LOC (loc))
++ return -1;
++ *val = *(unw_fpreg_t *) DWARF_GET_LOC (loc);
++ return 0;
++}
++
++static inline int
++dwarf_putfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t val)
++{
++ if (!DWARF_GET_LOC (loc))
++ return -1;
++ *(unw_fpreg_t *) DWARF_GET_LOC (loc) = val;
++ return 0;
++}
++
++static inline int
++dwarf_get (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t *val)
++{
++ if (!DWARF_GET_LOC (loc))
++ return -1;
++ *val = *(unw_word_t *) DWARF_GET_LOC (loc);
++ return 0;
++}
++
++static inline int
++dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val)
++{
++ if (!DWARF_GET_LOC (loc))
++ return -1;
++ *(unw_word_t *) DWARF_GET_LOC (loc) = val;
++ return 0;
++}
++
++#else /* !UNW_LOCAL_ONLY */
++# define DWARF_LOC_TYPE_FP (1 << 0)
++# define DWARF_LOC_TYPE_REG (1 << 1)
++# define DWARF_NULL_LOC DWARF_LOC (0, 0)
++# define DWARF_IS_NULL_LOC(l) \
++ ({ dwarf_loc_t _l = (l); _l.val == 0 && _l.type == 0; })
++# define DWARF_LOC(r, t) ((dwarf_loc_t) { .val = (r), .type = (t) })
++# define DWARF_IS_REG_LOC(l) (((l).type & DWARF_LOC_TYPE_REG) != 0)
++# define DWARF_IS_FP_LOC(l) (((l).type & DWARF_LOC_TYPE_FP) != 0)
++# define DWARF_REG_LOC(c,r) DWARF_LOC((r), DWARF_LOC_TYPE_REG)
++# define DWARF_MEM_LOC(c,m) DWARF_LOC ((m), 0)
++# define DWARF_FPREG_LOC(c,r) DWARF_LOC((r), (DWARF_LOC_TYPE_REG \
++ | DWARF_LOC_TYPE_FP))
++
++static inline int
++dwarf_getfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t *val)
++{
++ char *valp = (char *) &val;
++ unw_word_t addr;
++ int ret;
++
++ if (DWARF_IS_NULL_LOC (loc))
++ return -UNW_EBADREG;
++
++ if (DWARF_IS_REG_LOC (loc))
++ return (*c->as->acc.access_fpreg) (c->as, DWARF_GET_LOC (loc),
++ val, 0, c->as_arg);
++
++ addr = DWARF_GET_LOC (loc);
++ if ((ret = (*c->as->acc.access_mem) (c->as, addr + 0, (unw_word_t *) valp,
++ 0, c->as_arg)) < 0)
++ return ret;
++
++ return (*c->as->acc.access_mem) (c->as, addr + 4, (unw_word_t *) valp + 1, 0,
++ c->as_arg);
++}
++
++static inline int
++dwarf_putfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t val)
++{
++ char *valp = (char *) &val;
++ unw_word_t addr;
++ int ret;
++
++ if (DWARF_IS_NULL_LOC (loc))
++ return -UNW_EBADREG;
++
++ if (DWARF_IS_REG_LOC (loc))
++ return (*c->as->acc.access_fpreg) (c->as, DWARF_GET_LOC (loc),
++ &val, 1, c->as_arg);
++
++ addr = DWARF_GET_LOC (loc);
++ if ((ret = (*c->as->acc.access_mem) (c->as, addr + 0, (unw_word_t *) valp,
++ 1, c->as_arg)) < 0)
++ return ret;
++
++ return (*c->as->acc.access_mem) (c->as, addr + 4, (unw_word_t *) valp + 1,
++ 1, c->as_arg);
++}
++
++static inline int
++dwarf_get (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t *val)
++{
++ if (DWARF_IS_NULL_LOC (loc))
++ return -UNW_EBADREG;
++
++ /* If a code-generator were to save a value of type unw_word_t in a
++ floating-point register, we would have to support this case. I
++ suppose it could happen with MMX registers, but does it really
++ happen? */
++ assert (!DWARF_IS_FP_LOC (loc));
++
++ if (DWARF_IS_REG_LOC (loc))
++ return (*c->as->acc.access_reg) (c->as, DWARF_GET_LOC (loc), val,
++ 0, c->as_arg);
++ else
++ return (*c->as->acc.access_mem) (c->as, DWARF_GET_LOC (loc), val,
++ 0, c->as_arg);
++}
++
++static inline int
++dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val)
++{
++ if (DWARF_IS_NULL_LOC (loc))
++ return -UNW_EBADREG;
++
++ /* If a code-generator were to save a value of type unw_word_t in a
++ floating-point register, we would have to support this case. I
++ suppose it could happen with MMX registers, but does it really
++ happen? */
++ assert (!DWARF_IS_FP_LOC (loc));
++
++ if (DWARF_IS_REG_LOC (loc))
++ return (*c->as->acc.access_reg) (c->as, DWARF_GET_LOC (loc), &val,
++ 1, c->as_arg);
++ else
++ return (*c->as->acc.access_mem) (c->as, DWARF_GET_LOC (loc), &val,
++ 1, c->as_arg);
++}
++
++#endif /* !UNW_LOCAL_ONLY */
++
++
++
++#define tdep_getcontext_trace unw_getcontext
++#define tdep_init_done UNW_OBJ(init_done)
++#define tdep_init UNW_OBJ(init)
++/* Platforms that support UNW_INFO_FORMAT_TABLE need to define
++ tdep_search_unwind_table. */
++#define tdep_search_unwind_table dwarf_search_unwind_table
++#define tdep_find_unwind_table dwarf_find_unwind_table
++#define tdep_uc_addr UNW_OBJ(uc_addr)
++#define tdep_get_elf_image UNW_ARCH_OBJ(get_elf_image)
++#define tdep_access_reg UNW_OBJ(access_reg)
++#define tdep_access_fpreg UNW_OBJ(access_fpreg)
++#define tdep_fetch_frame(c,ip,n) do {} while(0)
++#define tdep_cache_frame(c,rs) do {} while(0)
++#define tdep_reuse_frame(c,rs) do {} while(0)
++#define tdep_stash_frame(c,rs) do {} while(0)
++#define tdep_trace(cur,addr,n) (-UNW_ENOINFO)
++
++#ifdef UNW_LOCAL_ONLY
++# define tdep_find_proc_info(c,ip,n) \
++ dwarf_find_proc_info((c)->as, (ip), &(c)->pi, (n), \
++ (c)->as_arg)
++# define tdep_put_unwind_info(as,pi,arg) \
++ dwarf_put_unwind_info((as), (pi), (arg))
++#else
++# define tdep_find_proc_info(c,ip,n) \
++ (*(c)->as->acc.find_proc_info)((c)->as, (ip), &(c)->pi, (n), \
++ (c)->as_arg)
++# define tdep_put_unwind_info(as,pi,arg) \
++ (*(as)->acc.put_unwind_info)((as), (pi), (arg))
++#endif
++
++#define tdep_get_as(c) ((c)->dwarf.as)
++#define tdep_get_as_arg(c) ((c)->dwarf.as_arg)
++#define tdep_get_ip(c) ((c)->dwarf.ip)
++#define tdep_big_endian(as) ((as)->big_endian)
++
++extern int tdep_init_done;
++
++extern void tdep_init (void);
++extern int tdep_search_unwind_table (unw_addr_space_t as, unw_word_t ip,
++ unw_dyn_info_t *di, unw_proc_info_t *pi,
++ int need_unwind_info, void *arg);
++extern void *tdep_uc_addr (unw_tdep_context_t *uc, int reg);
++extern int tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip,
++ unsigned long *segbase, unsigned long *mapoff,
++ char *path, size_t pathlen);
++extern int tdep_access_reg (struct cursor *c, unw_regnum_t reg,
++ unw_word_t *valp, int write);
++extern int tdep_access_fpreg (struct cursor *c, unw_regnum_t reg,
++ unw_fpreg_t *valp, int write);
++
++#endif /* AARCH64_LIBUNWIND_I_H */
+--- a/include/tdep/dwarf-config.h
++++ b/include/tdep/dwarf-config.h
+@@ -1,7 +1,9 @@
+ /* Provide a real file - not a symlink - as it would cause multiarch conflicts
+ when multiple different arch releases are installed simultaneously. */
+
+-#if defined __arm__
++#if defined __aarch64__
++# include "tdep-aarch64/dwarf-config.h"
++#elif defined __arm__
+ # include "tdep-arm/dwarf-config.h"
+ #elif defined __hppa__
+ # include "tdep-hppa/dwarf-config.h"
+--- a/include/tdep/jmpbuf.h
++++ b/include/tdep/jmpbuf.h
+@@ -3,6 +3,8 @@
+
+ #ifndef UNW_REMOTE_ONLY
+
++#if defined __aarch64__
++# include "tdep-aarch64/jmpbuf.h"
+ #if defined __arm__
+ # include "tdep-arm/jmpbuf.h"
+ #elif defined __hppa__
+--- a/include/tdep/libunwind_i.h.in
++++ b/include/tdep/libunwind_i.h.in
+@@ -3,7 +3,9 @@
+
+ #ifndef UNW_REMOTE_ONLY
+
+-#if defined __arm__
++#if defined __aarch64__
++# include "tdep-aarch64/libunwind_i.h"
++#elif defined __arm__
+ # include "tdep-arm/libunwind_i.h"
+ #elif defined __hppa__
+ # include "tdep-hppa/libunwind_i.h"
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -170,6 +170,28 @@ libunwind_elfxx_la_SOURCES = elfxx.c
+ noinst_LTLIBRARIES += $(LIBUNWIND_ELF)
+ libunwind_la_LIBADD += $(LIBUNWIND_ELF)
+
++# The list of files that go into libunwind and libunwind-aarch64:
++noinst_HEADERS += aarch64/init.h aarch64/offsets.h aarch64/unwind_i.h
++libunwind_la_SOURCES_aarch64_common = $(libunwind_la_SOURCES_common) \
++ aarch64/is_fpreg.c aarch64/regname.c
++
++# The list of files that go into libunwind:
++libunwind_la_SOURCES_aarch64 = $(libunwind_la_SOURCES_aarch64_common) \
++ $(libunwind_la_SOURCES_local) \
++ aarch64/Lcreate_addr_space.c aarch64/Lget_proc_info.c \
++ aarch64/Lget_save_loc.c aarch64/Lglobal.c aarch64/Linit.c \
++ aarch64/Linit_local.c aarch64/Linit_remote.c \
++ aarch64/Lis_signal_frame.c aarch64/Lregs.c aarch64/Lresume.c \
++ aarch64/Lstep.c
++
++libunwind_aarch64_la_SOURCES_aarch64 = $(libunwind_la_SOURCES_aarch64_common) \
++ $(libunwind_la_SOURCES_generic) \
++ aarch64/Gcreate_addr_space.c aarch64/Gget_proc_info.c \
++ aarch64/Gget_save_loc.c aarch64/Gglobal.c aarch64/Ginit.c \
++ aarch64/Ginit_local.c aarch64/Ginit_remote.c \
++ aarch64/Gis_signal_frame.c aarch64/Gregs.c aarch64/Gresume.c \
++ aarch64/Gstep.c
++
+ # The list of files that go into libunwind and libunwind-arm:
+ noinst_HEADERS += arm/init.h arm/offsets.h arm/unwind_i.h
+ libunwind_la_SOURCES_arm_common = $(libunwind_la_SOURCES_common) \
+@@ -418,6 +440,18 @@ if OS_FREEBSD
+ libunwind_coredump_la_SOURCES += coredump/_UCD_access_reg_freebsd.c
+ endif
+
++if ARCH_AARCH64
++ lib_LTLIBRARIES += libunwind-aarch64.la
++ libunwind_la_SOURCES = $(libunwind_la_SOURCES_aarch64)
++ libunwind_aarch64_la_SOURCES = $(libunwind_aarch64_la_SOURCES_aarch64)
++ libunwind_aarch64_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
++ libunwind_aarch64_la_LIBADD = libunwind-dwarf-generic.la
++ libunwind_aarch64_la_LIBADD += libunwind-elf64.la
++if !REMOTE_ONLY
++ libunwind_aarch64_la_LIBADD += libunwind.la -lc
++endif
++ libunwind_setjmp_la_SOURCES += aarch64/siglongjmp.S
++else
+ if ARCH_ARM
+ lib_LTLIBRARIES += libunwind-arm.la
+ libunwind_la_SOURCES = $(libunwind_la_SOURCES_arm)
+@@ -545,6 +579,7 @@ endif # ARCH_MIPS
+ endif # ARCH_HPPA
+ endif # ARCH_IA64
+ endif # ARCH_ARM
++endif # ARCH_AARCH64
+
+ # libunwind-setjmp depends on libunwind-$(arch). Therefore must be added
+ # at the end.
+@@ -567,7 +602,8 @@ AM_CPPFLAGS = -I$(top_srcdir)/include -I
+ AM_CCASFLAGS = $(AM_CPPFLAGS)
+ noinst_HEADERS += unwind/unwind-internal.h
+
+-EXTRA_DIST = $(libunwind_la_SOURCES_arm) \
++EXTRA_DIST = $(libunwind_la_SOURCES_aarch64) \
++ $(libunwind_la_SOURCES_arm) \
+ $(libunwind_la_SOURCES_hppa) \
+ $(libunwind_la_SOURCES_ia64) \
+ $(libunwind_la_SOURCES_mips) \
+@@ -579,6 +615,7 @@ EXTRA_DIST = $(libunwind_la_SOURCES_arm)
+ $(libunwind_la_SOURCES_common) \
+ $(libunwind_la_SOURCES_local) \
+ $(libunwind_la_SOURCES_generic) \
++ $(libunwind_aarch64_la_SOURCES_aarch64) \
+ $(libunwind_arm_la_SOURCES_arm) \
+ $(libunwind_hppa_la_SOURCES_hppa) \
+ $(libunwind_ia64_la_SOURCES_ia64) \
+--- /dev/null
++++ b/src/aarch64/Gcreate_addr_space.c
+@@ -0,0 +1,60 @@
++/* libunwind - a platform-independent unwind library
++ Copyright (C) 2012 Tommi Rantala <tt.rantala@gmail.com>
++ Copyright (C) 2013 Linaro Limited
++
++This file is part of libunwind.
++
++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. */
++
++#include <string.h>
++#include <stdlib.h>
++
++#include "unwind_i.h"
++
++PROTECTED unw_addr_space_t
++unw_create_addr_space (unw_accessors_t *a, int byte_order)
++{
++#ifdef UNW_LOCAL_ONLY
++ return NULL;
++#else
++ unw_addr_space_t as;
++
++ /* AArch64 supports little-endian and big-endian. */
++ if (byte_order != 0 && byte_order != __LITTLE_ENDIAN
++ && byte_order != __BIG_ENDIAN)
++ return NULL;
++
++ as = malloc (sizeof (*as));
++ if (!as)
++ return NULL;
++
++ memset (as, 0, sizeof (*as));
++
++ as->acc = *a;
++
++ /* Default to little-endian for AArch64. */
++ if (byte_order == 0 || byte_order == __LITTLE_ENDIAN)
++ as->big_endian = 0;
++ else
++ as->big_endian = 1;
++
++ return as;
++#endif
++}
+--- /dev/null
++++ b/src/aarch64/Gget_proc_info.c
+@@ -0,0 +1,39 @@
++/* libunwind - a platform-independent unwind library
++ Copyright (C) 2008 CodeSourcery
++
++This file is part of libunwind.
++
++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. */
++
++#include "unwind_i.h"
++
++PROTECTED int
++unw_get_proc_info (unw_cursor_t *cursor, unw_proc_info_t *pi)
++{
++ struct cursor *c = (struct cursor *) cursor;
++ int ret;
++
++ ret = dwarf_make_proc_info (&c->dwarf);
++ if (ret < 0)
++ return ret;
++
++ *pi = c->dwarf.pi;
++ return 0;
++}
+--- /dev/null
++++ b/src/aarch64/Gget_save_loc.c
+@@ -0,0 +1,100 @@
++/* libunwind - a platform-independent unwind library
++ Copyright (C) 2008 CodeSourcery
++ Copyright (C) 2012 Tommi Rantala <tt.rantala@gmail.com>
++ Copyright (C) 2013 Linaro Limited
++
++This file is part of libunwind.
++
++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. */
++
++#include "unwind_i.h"
++
++PROTECTED int
++unw_get_save_loc (unw_cursor_t *cursor, int reg, unw_save_loc_t *sloc)
++{
++ struct cursor *c = (struct cursor *) cursor;
++ dwarf_loc_t loc;
++
++ switch (reg)
++ {
++ case UNW_AARCH64_X0:
++ case UNW_AARCH64_X1:
++ case UNW_AARCH64_X2:
++ case UNW_AARCH64_X3:
++ case UNW_AARCH64_X4:
++ case UNW_AARCH64_X5:
++ case UNW_AARCH64_X6:
++ case UNW_AARCH64_X7:
++ case UNW_AARCH64_X8:
++ case UNW_AARCH64_X9:
++ case UNW_AARCH64_X10:
++ case UNW_AARCH64_X11:
++ case UNW_AARCH64_X12:
++ case UNW_AARCH64_X13:
++ case UNW_AARCH64_X14:
++ case UNW_AARCH64_X15:
++ case UNW_AARCH64_X16:
++ case UNW_AARCH64_X17:
++ case UNW_AARCH64_X18:
++ case UNW_AARCH64_X19:
++ case UNW_AARCH64_X20:
++ case UNW_AARCH64_X21:
++ case UNW_AARCH64_X22:
++ case UNW_AARCH64_X23:
++ case UNW_AARCH64_X24:
++ case UNW_AARCH64_X25:
++ case UNW_AARCH64_X26:
++ case UNW_AARCH64_X27:
++ case UNW_AARCH64_X28:
++ case UNW_AARCH64_X29:
++ case UNW_AARCH64_X30:
++ case UNW_AARCH64_SP:
++ case UNW_AARCH64_PC:
++ case UNW_AARCH64_PSTATE:
++ loc = c->dwarf.loc[reg];
++ break;
++
++ default:
++ loc = DWARF_NULL_LOC; /* default to "not saved" */
++ break;
++ }
++
++ memset (sloc, 0, sizeof (*sloc));
++
++ if (DWARF_IS_NULL_LOC (loc))
++ {
++ sloc->type = UNW_SLT_NONE;
++ return 0;
++ }
++
++#if !defined(UNW_LOCAL_ONLY)
++ if (DWARF_IS_REG_LOC (loc))
++ {
++ sloc->type = UNW_SLT_REG;
++ sloc->u.regnum = DWARF_GET_LOC (loc);
++ }
++ else
++#endif
++ {
++ sloc->type = UNW_SLT_MEMORY;
++ sloc->u.addr = DWARF_GET_LOC (loc);
++ }
++ return 0;
++}
+--- /dev/null
++++ b/src/aarch64/Gglobal.c
+@@ -0,0 +1,57 @@
++/* libunwind - a platform-independent unwind library
++ Copyright (C) 2008 CodeSourcery
++ Copyright (C) 2012 Tommi Rantala <tt.rantala@gmail.com>
++ Copyright (C) 2013 Linaro Limited
++
++This file is part of libunwind.
++
++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. */
++
++#include "unwind_i.h"
++#include "dwarf_i.h"
++
++HIDDEN define_lock (aarch64_lock);
++HIDDEN int tdep_init_done;
++
++HIDDEN void
++tdep_init (void)
++{
++ intrmask_t saved_mask;
++
++ sigfillset (&unwi_full_mask);
++
++ lock_acquire (&aarch64_lock, saved_mask);
++ {
++ if (tdep_init_done)
++ /* another thread else beat us to it... */
++ goto out;
++
++ mi_init ();
++
++ dwarf_init ();
++
++#ifndef UNW_REMOTE_ONLY
++ aarch64_local_addr_space_init ();
++#endif
++ tdep_init_done = 1; /* signal that we're initialized... */
++ }
++ out:
++ lock_release (&aarch64_lock, saved_mask);
++}
+--- /dev/null
++++ b/src/aarch64/Ginit.c
+@@ -0,0 +1,187 @@
++/* libunwind - a platform-independent unwind library
++ Copyright (C) 2008 CodeSourcery
++ Copyright (C) 2012 Tommi Rantala <tt.rantala@gmail.com>
++ Copyright (C) 2013 Linaro Limited
++
++This file is part of libunwind.
++
++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. */
++
++#include <stdlib.h>
++#include <string.h>
++
++#include "unwind_i.h"
++
++#ifdef UNW_REMOTE_ONLY
++
++/* unw_local_addr_space is a NULL pointer in this case. */
++PROTECTED unw_addr_space_t unw_local_addr_space;
++
++#else /* !UNW_REMOTE_ONLY */
++
++static struct unw_addr_space local_addr_space;
++
++PROTECTED unw_addr_space_t unw_local_addr_space = &local_addr_space;
++
++static inline void *
++uc_addr (ucontext_t *uc, int reg)
++{
++ if (reg >= UNW_AARCH64_X0 && reg <= UNW_AARCH64_V31)
++ return &uc->uc_mcontext.regs[reg];
++ else
++ return NULL;
++}
++
++# ifdef UNW_LOCAL_ONLY
++
++HIDDEN void *
++tdep_uc_addr (ucontext_t *uc, int reg)
++{
++ return uc_addr (uc, reg);
++}
++
++# endif /* UNW_LOCAL_ONLY */
++
++HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
++
++/* XXX fix me: there is currently no way to locate the dyn-info list
++ by a remote unwinder. On ia64, this is done via a special
++ unwind-table entry. Perhaps something similar can be done with
++ DWARF2 unwind info. */
++
++static void
++put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
++{
++ /* it's a no-op */
++}
++
++static int
++get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
++ void *arg)
++{
++ *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
++ return 0;
++}
++
++static int
++access_mem (unw_addr_space_t as, unw_word_t addr, unw_word_t *val, int write,
++ void *arg)
++{
++ if (write)
++ {
++ Debug (16, "mem[%lx] <- %lx\n", addr, *val);
++ *(unw_word_t *) addr = *val;
++ }
++ else
++ {
++ *val = *(unw_word_t *) addr;
++ Debug (16, "mem[%lx] -> %lx\n", addr, *val);
++ }
++ return 0;
++}
++
++static int
++access_reg (unw_addr_space_t as, unw_regnum_t reg, unw_word_t *val, int write,
++ void *arg)
++{
++ unw_word_t *addr;
++ ucontext_t *uc = arg;
++
++ if (unw_is_fpreg (reg))
++ goto badreg;
++
++ if (!(addr = uc_addr (uc, reg)))
++ goto badreg;
++
++ if (write)
++ {
++ *(unw_word_t *) addr = *val;
++ Debug (12, "%s <- %lx\n", unw_regname (reg), *val);
++ }
++ else
++ {
++ *val = *(unw_word_t *) addr;
++ Debug (12, "%s -> %lx\n", unw_regname (reg), *val);
++ }
++ return 0;
++
++ badreg:
++ Debug (1, "bad register number %u\n", reg);
++ return -UNW_EBADREG;
++}
++
++static int
++access_fpreg (unw_addr_space_t as, unw_regnum_t reg, unw_fpreg_t *val,
++ int write, void *arg)
++{
++ ucontext_t *uc = arg;
++ unw_fpreg_t *addr;
++
++ if (!unw_is_fpreg (reg))
++ goto badreg;
++
++ if (!(addr = uc_addr (uc, reg)))
++ goto badreg;
++
++ if (write)
++ {
++ Debug (12, "%s <- %08lx.%08lx.%08lx\n", unw_regname (reg),
++ ((long *)val)[0], ((long *)val)[1], ((long *)val)[2]);
++ *(unw_fpreg_t *) addr = *val;
++ }
++ else
++ {
++ *val = *(unw_fpreg_t *) addr;
++ Debug (12, "%s -> %08lx.%08lx.%08lx\n", unw_regname (reg),
++ ((long *)val)[0], ((long *)val)[1], ((long *)val)[2]);
++ }
++ return 0;
++
++ badreg:
++ Debug (1, "bad register number %u\n", reg);
++ /* attempt to access a non-preserved register */
++ return -UNW_EBADREG;
++}
++
++static int
++get_static_proc_name (unw_addr_space_t as, unw_word_t ip,
++ char *buf, size_t buf_len, unw_word_t *offp,
++ void *arg)
++{
++ return _Uelf64_get_proc_name (as, getpid (), ip, buf, buf_len, offp);
++}
++
++HIDDEN void
++aarch64_local_addr_space_init (void)
++{
++ memset (&local_addr_space, 0, sizeof (local_addr_space));
++ local_addr_space.caching_policy = UNW_CACHE_GLOBAL;
++ local_addr_space.acc.find_proc_info = dwarf_find_proc_info;
++ local_addr_space.acc.put_unwind_info = put_unwind_info;
++ local_addr_space.acc.get_dyn_info_list_addr = get_dyn_info_list_addr;
++ local_addr_space.acc.access_mem = access_mem;
++ local_addr_space.acc.access_reg = access_reg;
++ local_addr_space.acc.access_fpreg = access_fpreg;
++ local_addr_space.acc.resume = aarch64_local_resume;
++ local_addr_space.acc.get_proc_name = get_static_proc_name;
++ unw_flush_cache (&local_addr_space, 0, 0);
++}
++
++#endif /* !UNW_REMOTE_ONLY */
+--- /dev/null
++++ b/src/aarch64/Ginit_local.c
+@@ -0,0 +1,55 @@
++/* libunwind - a platform-independent unwind library
++ Copyright (C) 2008 CodeSourcery
++ Copyright (C) 2011-2013 Linaro Limited
++
++This file is part of libunwind.
++
++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. */
++
++#include "unwind_i.h"
++#include "init.h"
++
++#ifdef UNW_REMOTE_ONLY
++
++PROTECTED int
++unw_init_local (unw_cursor_t *cursor, unw_context_t *uc)
++{
++ return -UNW_EINVAL;
++}
++
++#else /* !UNW_REMOTE_ONLY */
++
++PROTECTED int
++unw_init_local (unw_cursor_t *cursor, unw_context_t *uc)
++{
++ struct cursor *c = (struct cursor *) cursor;
++
++ if (!tdep_init_done)
++ tdep_init ();
++
++ Debug (1, "(cursor=%p)\n", c);
++
++ c->dwarf.as = unw_local_addr_space;
++ c->dwarf.as_arg = uc;
++
++ return common_init (c, 1);
++}
++
++#endif /* !UNW_REMOTE_ONLY */
+--- /dev/null
++++ b/src/aarch64/Ginit_remote.c
+@@ -0,0 +1,45 @@
++/* libunwind - a platform-independent unwind library
++ Copyright (C) 2008 CodeSourcery
++
++This file is part of libunwind.
++
++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. */
++
++#include "init.h"
++#include "unwind_i.h"
++
++PROTECTED int
++unw_init_remote (unw_cursor_t *cursor, unw_addr_space_t as, void *as_arg)
++{
++#ifdef UNW_LOCAL_ONLY
++ return -UNW_EINVAL;
++#else /* !UNW_LOCAL_ONLY */
++ struct cursor *c = (struct cursor *) cursor;
++
++ if (!tdep_init_done)
++ tdep_init ();
++
++ Debug (1, "(cursor=%p)\n", c);
++
++ c->dwarf.as = as;
++ c->dwarf.as_arg = as_arg;
++ return common_init (c, 0);
++#endif /* !UNW_LOCAL_ONLY */
++}
+--- /dev/null
++++ b/src/aarch64/Gis_signal_frame.c
+@@ -0,0 +1,64 @@
++/* libunwind - a platform-independent unwind library
++ Copyright (C) 2012 Tommi Rantala <tt.rantala@gmail.com>
++ Copyright (C) 2013 Linaro Limited
++
++This file is part of libunwind.
++
++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. */
++
++#include "unwind_i.h"
++
++/* The restorer stub will always have the form:
++
++ d2801168 movz x8, #0x8b
++ d4000001 svc #0x0
++*/
++
++PROTECTED int
++unw_is_signal_frame (unw_cursor_t *cursor)
++{
++#ifdef __linux__
++ struct cursor *c = (struct cursor *) cursor;
++ unw_word_t w0, ip;
++ unw_addr_space_t as;
++ unw_accessors_t *a;
++ void *arg;
++ int ret;
++
++ as = c->dwarf.as;
++ a = unw_get_accessors (as);
++ arg = c->dwarf.as_arg;
++
++ ip = c->dwarf.ip;
++
++ ret = (*a->access_mem) (as, ip, &w0, 0, arg);
++ if (ret < 0)
++ return ret;
++
++ /* FIXME: distinguish 32bit insn vs 64bit registers. */
++ if (w0 != 0xd4000001d2801168)
++ return 0;
++
++ return 1;
++
++#else
++ return -UNW_ENOINFO;
++#endif
++}
+--- /dev/null
++++ b/src/aarch64/Gregs.c
+@@ -0,0 +1,113 @@
++/* libunwind - a platform-independent unwind library
++ Copyright (C) 2008 CodeSourcery
++ Copyright (C) 2012 Tommi Rantala <tt.rantala@gmail.com>
++ Copyright (C) 2013 Linaro Limited
++
++This file is part of libunwind.
++
++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. */
++
++#include "unwind_i.h"
++
++HIDDEN int
++tdep_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t *valp,
++ int write)
++{
++ dwarf_loc_t loc = DWARF_NULL_LOC;
++ unsigned int mask;
++
++ switch (reg)
++ {
++ case UNW_AARCH64_X0:
++ case UNW_AARCH64_X1:
++ case UNW_AARCH64_X2:
++ case UNW_AARCH64_X3:
++ mask = 1 << reg;
++ if (write)
++ {
++ c->dwarf.eh_args[reg] = *valp;
++ c->dwarf.eh_valid_mask |= mask;
++ return 0;
++ }
++ else if ((c->dwarf.eh_valid_mask & mask) != 0)
++ {
++ *valp = c->dwarf.eh_args[reg];
++ return 0;
++ }
++ else
++ loc = c->dwarf.loc[reg];
++ break;
++
++ case UNW_AARCH64_X4:
++ case UNW_AARCH64_X5:
++ case UNW_AARCH64_X6:
++ case UNW_AARCH64_X7:
++ case UNW_AARCH64_X8:
++ case UNW_AARCH64_X9:
++ case UNW_AARCH64_X10:
++ case UNW_AARCH64_X11:
++ case UNW_AARCH64_X12:
++ case UNW_AARCH64_X13:
++ case UNW_AARCH64_X14:
++ case UNW_AARCH64_X15:
++ case UNW_AARCH64_X16:
++ case UNW_AARCH64_X17:
++ case UNW_AARCH64_X18:
++ case UNW_AARCH64_X19:
++ case UNW_AARCH64_X20:
++ case UNW_AARCH64_X21:
++ case UNW_AARCH64_X22:
++ case UNW_AARCH64_X23:
++ case UNW_AARCH64_X24:
++ case UNW_AARCH64_X25:
++ case UNW_AARCH64_X26:
++ case UNW_AARCH64_X27:
++ case UNW_AARCH64_X28:
++ case UNW_AARCH64_X29:
++ case UNW_AARCH64_X30:
++ case UNW_AARCH64_PC:
++ case UNW_AARCH64_PSTATE:
++ loc = c->dwarf.loc[reg];
++ break;
++
++ case UNW_AARCH64_SP:
++ if (write)
++ return -UNW_EREADONLYREG;
++ *valp = c->dwarf.cfa;
++ return 0;
++
++ default:
++ Debug (1, "bad register number %u\n", reg);
++ return -UNW_EBADREG;
++ }
++
++ if (write)
++ return dwarf_put (&c->dwarf, loc, *valp);
++ else
++ return dwarf_get (&c->dwarf, loc, valp);
++}
++
++HIDDEN int
++tdep_access_fpreg (struct cursor *c, unw_regnum_t reg, unw_fpreg_t *valp,
++ int write)
++{
++ Debug (1, "bad register number %u\n", reg);
++ return -UNW_EBADREG;
++}
+--- /dev/null
++++ b/src/aarch64/Gresume.c
+@@ -0,0 +1,177 @@
++/* libunwind - a platform-independent unwind library
++ Copyright (C) 2008 CodeSourcery
++ Copyright (C) 2011-2013 Linaro Limited
++ Copyright (C) 2012 Tommi Rantala <tt.rantala@gmail.com>
++
++This file is part of libunwind.
++
++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. */
++
++#include "unwind_i.h"
++#include "offsets.h"
++
++#ifndef UNW_REMOTE_ONLY
++
++HIDDEN inline int
++aarch64_local_resume (unw_addr_space_t as, unw_cursor_t *cursor, void *arg)
++{
++#ifdef __linux__
++ struct cursor *c = (struct cursor *) cursor;
++ unw_tdep_context_t *uc = c->dwarf.as_arg;
++
++ if (c->sigcontext_format == AARCH64_SCF_NONE)
++ {
++ /* Since there are no signals involved here we restore the non scratch
++ registers only. */
++ unsigned long regs[11];
++ regs[0] = uc->uc_mcontext.regs[19];
++ regs[1] = uc->uc_mcontext.regs[20];
++ regs[2] = uc->uc_mcontext.regs[21];
++ regs[3] = uc->uc_mcontext.regs[22];
++ regs[4] = uc->uc_mcontext.regs[23];
++ regs[5] = uc->uc_mcontext.regs[24];
++ regs[6] = uc->uc_mcontext.regs[25];
++ regs[7] = uc->uc_mcontext.regs[26];
++ regs[8] = uc->uc_mcontext.regs[27];
++ regs[9] = uc->uc_mcontext.regs[28];
++ regs[10] = uc->uc_mcontext.regs[30]; /* LR */
++ unsigned long sp = uc->uc_mcontext.sp;
++
++ struct regs_overlay {
++ char x[sizeof(regs)];
++ };
++
++ asm volatile (
++ "ldp x19, x20, [%0]\n"
++ "ldp x21, x22, [%0,16]\n"
++ "ldp x23, x24, [%0,32]\n"
++ "ldp x25, x26, [%0,48]\n"
++ "ldp x27, x28, [%0,64]\n"
++ "ldr x30, [%0,80]\n"
++ "mov sp, %1\n"
++ "ret \n"
++ :
++ : "r" (regs),
++ "r" (sp),
++ "m" (*(struct regs_overlay *)regs)
++ );
++ }
++ else
++ {
++ struct sigcontext *sc = (struct sigcontext *) c->sigcontext_addr;
++
++ if (c->dwarf.eh_valid_mask & 0x1) sc->regs[0] = c->dwarf.eh_args[0];
++ if (c->dwarf.eh_valid_mask & 0x2) sc->regs[1] = c->dwarf.eh_args[1];
++ if (c->dwarf.eh_valid_mask & 0x4) sc->regs[2] = c->dwarf.eh_args[2];
++ if (c->dwarf.eh_valid_mask & 0x8) sc->regs[3] = c->dwarf.eh_args[3];
++
++ sc->regs[4] = uc->uc_mcontext.regs[4];
++ sc->regs[5] = uc->uc_mcontext.regs[5];
++ sc->regs[6] = uc->uc_mcontext.regs[6];
++ sc->regs[7] = uc->uc_mcontext.regs[7];
++ sc->regs[8] = uc->uc_mcontext.regs[8];
++ sc->regs[9] = uc->uc_mcontext.regs[9];
++ sc->regs[10] = uc->uc_mcontext.regs[10];
++ sc->regs[11] = uc->uc_mcontext.regs[11];
++ sc->regs[12] = uc->uc_mcontext.regs[12];
++ sc->regs[13] = uc->uc_mcontext.regs[13];
++ sc->regs[14] = uc->uc_mcontext.regs[14];
++ sc->regs[15] = uc->uc_mcontext.regs[15];
++ sc->regs[16] = uc->uc_mcontext.regs[16];
++ sc->regs[17] = uc->uc_mcontext.regs[17];
++ sc->regs[18] = uc->uc_mcontext.regs[18];
++ sc->regs[19] = uc->uc_mcontext.regs[19];
++ sc->regs[20] = uc->uc_mcontext.regs[20];
++ sc->regs[21] = uc->uc_mcontext.regs[21];
++ sc->regs[22] = uc->uc_mcontext.regs[22];
++ sc->regs[23] = uc->uc_mcontext.regs[23];
++ sc->regs[24] = uc->uc_mcontext.regs[24];
++ sc->regs[25] = uc->uc_mcontext.regs[25];
++ sc->regs[26] = uc->uc_mcontext.regs[26];
++ sc->regs[27] = uc->uc_mcontext.regs[27];
++ sc->regs[28] = uc->uc_mcontext.regs[28];
++ sc->regs[29] = uc->uc_mcontext.regs[29];
++ sc->regs[30] = uc->uc_mcontext.regs[30];
++ sc->sp = uc->uc_mcontext.sp;
++ sc->pc = uc->uc_mcontext.pc;
++ sc->pstate = uc->uc_mcontext.pstate;
++
++ asm volatile (
++ "mov sp, %0\n"
++ "ret %1\n"
++ : : "r" (c->sigcontext_sp), "r" (c->sigcontext_pc)
++ );
++ }
++ unreachable();
++#else
++ printf ("%s: implement me\n", __FUNCTION__);
++#endif
++ return -UNW_EINVAL;
++}
++
++#endif /* !UNW_REMOTE_ONLY */
++
++static inline void
++establish_machine_state (struct cursor *c)
++{
++ unw_addr_space_t as = c->dwarf.as;
++ void *arg = c->dwarf.as_arg;
++ unw_fpreg_t fpval;
++ unw_word_t val;
++ int reg;
++
++ Debug (8, "copying out cursor state\n");
++
++ for (reg = 0; reg <= UNW_AARCH64_PSTATE; ++reg)
++ {
++ Debug (16, "copying %s %d\n", unw_regname (reg), reg);
++ if (unw_is_fpreg (reg))
++ {
++ if (tdep_access_fpreg (c, reg, &fpval, 0) >= 0)
++ as->acc.access_fpreg (as, reg, &fpval, 1, arg);
++ }
++ else
++ {
++ if (tdep_access_reg (c, reg, &val, 0) >= 0)
++ as->acc.access_reg (as, reg, &val, 1, arg);
++ }
++ }
++}
++
++PROTECTED int
++unw_resume (unw_cursor_t *cursor)
++{
++ struct cursor *c = (struct cursor *) cursor;
++
++ Debug (1, "(cursor=%p)\n", c);
++
++ if (!c->dwarf.ip)
++ {
++ /* This can happen easily when the frame-chain gets truncated
++ due to bad or missing unwind-info. */
++ Debug (1, "refusing to resume execution at address 0\n");
++ return -UNW_EINVAL;
++ }
++
++ establish_machine_state (c);
++
++ return (*c->dwarf.as->acc.resume) (c->dwarf.as, (unw_cursor_t *) c,
++ c->dwarf.as_arg);
++}
+--- /dev/null
++++ b/src/aarch64/Gstep.c
+@@ -0,0 +1,129 @@
++/* libunwind - a platform-independent unwind library
++ Copyright (C) 2008 CodeSourcery
++ Copyright (C) 2011-2013 Linaro Limited
++ Copyright (C) 2012 Tommi Rantala <tt.rantala@gmail.com>
++
++This file is part of libunwind.
++
++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. */
++
++#include "unwind_i.h"
++#include "offsets.h"
++
++PROTECTED int
++unw_handle_signal_frame (unw_cursor_t *cursor)
++{
++ struct cursor *c = (struct cursor *) cursor;
++ int ret;
++ unw_word_t sc_addr, sp, sp_addr = c->dwarf.cfa;
++ struct dwarf_loc sp_loc = DWARF_LOC (sp_addr, 0);
++
++ if ((ret = dwarf_get (&c->dwarf, sp_loc, &sp)) < 0)
++ return -UNW_EUNSPEC;
++
++ ret = unw_is_signal_frame (cursor);
++ Debug(1, "unw_is_signal_frame()=%d\n", ret);
++
++ /* Save the SP and PC to be able to return execution at this point
++ later in time (unw_resume). */
++ c->sigcontext_sp = c->dwarf.cfa;
++ c->sigcontext_pc = c->dwarf.ip;
++
++ if (ret)
++ {
++ c->sigcontext_format = AARCH64_SCF_LINUX_RT_SIGFRAME;
++ sc_addr = sp_addr + sizeof (siginfo_t) + LINUX_UC_MCONTEXT_OFF;
++ }
++ else
++ return -UNW_EUNSPEC;
++
++ c->sigcontext_addr = sc_addr;
++
++ /* Update the dwarf cursor.
++ Set the location of the registers to the corresponding addresses of the
++ uc_mcontext / sigcontext structure contents. */
++ c->dwarf.loc[UNW_AARCH64_X0] = DWARF_LOC (sc_addr + LINUX_SC_X0_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_X1] = DWARF_LOC (sc_addr + LINUX_SC_X1_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_X2] = DWARF_LOC (sc_addr + LINUX_SC_X2_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_X3] = DWARF_LOC (sc_addr + LINUX_SC_X3_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_X4] = DWARF_LOC (sc_addr + LINUX_SC_X4_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_X5] = DWARF_LOC (sc_addr + LINUX_SC_X5_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_X6] = DWARF_LOC (sc_addr + LINUX_SC_X6_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_X7] = DWARF_LOC (sc_addr + LINUX_SC_X7_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_X8] = DWARF_LOC (sc_addr + LINUX_SC_X8_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_X9] = DWARF_LOC (sc_addr + LINUX_SC_X9_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_X10] = DWARF_LOC (sc_addr + LINUX_SC_X10_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_X11] = DWARF_LOC (sc_addr + LINUX_SC_X11_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_X12] = DWARF_LOC (sc_addr + LINUX_SC_X12_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_X13] = DWARF_LOC (sc_addr + LINUX_SC_X13_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_X14] = DWARF_LOC (sc_addr + LINUX_SC_X14_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_X15] = DWARF_LOC (sc_addr + LINUX_SC_X15_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_X16] = DWARF_LOC (sc_addr + LINUX_SC_X16_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_X17] = DWARF_LOC (sc_addr + LINUX_SC_X17_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_X18] = DWARF_LOC (sc_addr + LINUX_SC_X18_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_X19] = DWARF_LOC (sc_addr + LINUX_SC_X19_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_X20] = DWARF_LOC (sc_addr + LINUX_SC_X20_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_X21] = DWARF_LOC (sc_addr + LINUX_SC_X21_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_X22] = DWARF_LOC (sc_addr + LINUX_SC_X22_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_X23] = DWARF_LOC (sc_addr + LINUX_SC_X23_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_X24] = DWARF_LOC (sc_addr + LINUX_SC_X24_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_X25] = DWARF_LOC (sc_addr + LINUX_SC_X25_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_X26] = DWARF_LOC (sc_addr + LINUX_SC_X26_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_X27] = DWARF_LOC (sc_addr + LINUX_SC_X27_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_X28] = DWARF_LOC (sc_addr + LINUX_SC_X28_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_X29] = DWARF_LOC (sc_addr + LINUX_SC_X29_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_X30] = DWARF_LOC (sc_addr + LINUX_SC_X30_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_SP] = DWARF_LOC (sc_addr + LINUX_SC_SP_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_PC] = DWARF_LOC (sc_addr + LINUX_SC_PC_OFF, 0);
++ c->dwarf.loc[UNW_AARCH64_PSTATE] = DWARF_LOC (sc_addr + LINUX_SC_PSTATE_OFF, 0);
++
++ /* Set SP/CFA and PC/IP. */
++ dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_SP], &c->dwarf.cfa);
++ dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_PC], &c->dwarf.ip);
++
++ c->dwarf.pi_valid = 0;
++
++ return 1;
++}
++
++PROTECTED int
++unw_step (unw_cursor_t *cursor)
++{
++ struct cursor *c = (struct cursor *) cursor;
++ int ret;
++
++ Debug (1, "(cursor=%p, ip=0x%016lx, cfa=0x%016lx))\n",
++ c, c->dwarf.ip, c->dwarf.cfa);
++
++ /* Check if this is a signal frame. */
++ if (unw_is_signal_frame (cursor))
++ return unw_handle_signal_frame (cursor);
++
++ ret = dwarf_step (&c->dwarf);
++ Debug(1, "dwarf_step()=%d\n", ret);
++
++ if (unlikely (ret == -UNW_ESTOPUNWIND))
++ return ret;
++
++ if (unlikely (ret < 0))
++ return 0;
++
++ return (c->dwarf.ip == 0) ? 0 : 1;
++}
+--- /dev/null
++++ b/src/aarch64/Lcreate_addr_space.c
+@@ -0,0 +1,5 @@
++#define UNW_LOCAL_ONLY
++#include <libunwind.h>
++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY)
++#include "Gcreate_addr_space.c"
++#endif
+--- /dev/null
++++ b/src/aarch64/Lget_proc_info.c
+@@ -0,0 +1,5 @@
++#define UNW_LOCAL_ONLY
++#include <libunwind.h>
++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY)
++#include "Gget_proc_info.c"
++#endif
+--- /dev/null
++++ b/src/aarch64/Lget_save_loc.c
+@@ -0,0 +1,5 @@
++#define UNW_LOCAL_ONLY
++#include <libunwind.h>
++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY)
++#include "Gget_save_loc.c"
++#endif
+--- /dev/null
++++ b/src/aarch64/Lglobal.c
+@@ -0,0 +1,5 @@
++#define UNW_LOCAL_ONLY
++#include <libunwind.h>
++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY)
++#include "Gglobal.c"
++#endif
+--- /dev/null
++++ b/src/aarch64/Linit.c
+@@ -0,0 +1,5 @@
++#define UNW_LOCAL_ONLY
++#include <libunwind.h>
++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY)
++#include "Ginit.c"
++#endif
+--- /dev/null
++++ b/src/aarch64/Linit_local.c
+@@ -0,0 +1,5 @@
++#define UNW_LOCAL_ONLY
++#include <libunwind.h>
++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY)
++#include "Ginit_local.c"
++#endif
+--- /dev/null
++++ b/src/aarch64/Linit_remote.c
+@@ -0,0 +1,5 @@
++#define UNW_LOCAL_ONLY
++#include <libunwind.h>
++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY)
++#include "Ginit_remote.c"
++#endif
+--- /dev/null
++++ b/src/aarch64/Lis_signal_frame.c
+@@ -0,0 +1,5 @@
++#define UNW_LOCAL_ONLY
++#include <libunwind.h>
++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY)
++#include "Gis_signal_frame.c"
++#endif
+--- /dev/null
++++ b/src/aarch64/Lregs.c
+@@ -0,0 +1,5 @@
++#define UNW_LOCAL_ONLY
++#include <libunwind.h>
++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY)
++#include "Gregs.c"
++#endif
+--- /dev/null
++++ b/src/aarch64/Lresume.c
+@@ -0,0 +1,5 @@
++#define UNW_LOCAL_ONLY
++#include <libunwind.h>
++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY)
++#include "Gresume.c"
++#endif
+--- /dev/null
++++ b/src/aarch64/Lstep.c
+@@ -0,0 +1,5 @@
++#define UNW_LOCAL_ONLY
++#include <libunwind.h>
++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY)
++#include "Gstep.c"
++#endif
+--- /dev/null
++++ b/src/aarch64/gen-offsets.c
+@@ -0,0 +1,68 @@
++#include <stdio.h>
++#include <stddef.h>
++#include <ucontext.h>
++#include <asm/sigcontext.h>
++
++#define UC(N,X) \
++ printf ("#define LINUX_UC_" N "_OFF\t0x%X\n", offsetof (ucontext_t, X))
++
++#define SC(N,X) \
++ printf ("#define LINUX_SC_" N "_OFF\t0x%X\n", offsetof (struct sigcontext, X))
++
++int
++main (void)
++{
++ printf (
++"/* Linux-specific definitions: */\n\n"
++
++"/* Define various structure offsets to simplify cross-compilation. */\n\n"
++
++"/* Offsets for AArch64 Linux \"ucontext_t\": */\n\n");
++
++ UC ("FLAGS", uc_flags);
++ UC ("LINK", uc_link);
++ UC ("STACK", uc_stack);
++ UC ("MCONTEXT", uc_mcontext);
++ UC ("SIGMASK", uc_sigmask);
++
++ printf ("\n/* Offsets for AArch64 Linux \"struct sigcontext\": */\n\n");
++
++ SC ("R0", regs[0]);
++ SC ("R1", regs[1]);
++ SC ("R2", regs[2]);
++ SC ("R3", regs[3]);
++ SC ("R4", regs[4]);
++ SC ("R5", regs[5]);
++ SC ("R6", regs[6]);
++ SC ("R7", regs[7]);
++ SC ("R8", regs[8]);
++ SC ("R9", regs[9]);
++ SC ("R10", regs[10]);
++ SC ("R11", regs[11]);
++ SC ("R12", regs[12]);
++ SC ("R13", regs[13]);
++ SC ("R14", regs[14]);
++ SC ("R15", regs[15]);
++ SC ("R16", regs[16]);
++ SC ("R17", regs[17]);
++ SC ("R18", regs[18]);
++ SC ("R19", regs[19]);
++ SC ("R20", regs[20]);
++ SC ("R21", regs[21]);
++ SC ("R22", regs[22]);
++ SC ("R23", regs[23]);
++ SC ("R24", regs[24]);
++ SC ("R25", regs[25]);
++ SC ("R26", regs[26]);
++ SC ("R27", regs[27]);
++ SC ("R28", regs[28]);
++ SC ("R29", regs[29]);
++ SC ("R30", regs[30]);
++ SC ("R31", regs[31]);
++
++ SC ("PC", pc);
++ SC ("SP", sp);
++ SC ("Fault", fault_address);
++ SC ("state", pstate);
++ return 0;
++}
+--- /dev/null
++++ b/src/aarch64/init.h
+@@ -0,0 +1,127 @@
++/* libunwind - a platform-independent unwind library
++ Copyright (C) 2012 Tommi Rantala <tt.rantala@gmail.com>
++ Copyright (C) 2013 Linaro Limited
++
++This file is part of libunwind.
++
++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. */
++
++#include "unwind_i.h"
++
++static inline int
++common_init (struct cursor *c, unsigned use_prev_instr)
++{
++ int ret, i;
++
++ c->dwarf.loc[UNW_AARCH64_X0] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X0);
++ c->dwarf.loc[UNW_AARCH64_X1] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X1);
++ c->dwarf.loc[UNW_AARCH64_X2] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X2);
++ c->dwarf.loc[UNW_AARCH64_X3] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X3);
++ c->dwarf.loc[UNW_AARCH64_X4] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X4);
++ c->dwarf.loc[UNW_AARCH64_X5] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X5);
++ c->dwarf.loc[UNW_AARCH64_X6] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X6);
++ c->dwarf.loc[UNW_AARCH64_X7] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X7);
++ c->dwarf.loc[UNW_AARCH64_X8] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X8);
++ c->dwarf.loc[UNW_AARCH64_X9] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X9);
++ c->dwarf.loc[UNW_AARCH64_X10] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X10);
++ c->dwarf.loc[UNW_AARCH64_X11] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X11);
++ c->dwarf.loc[UNW_AARCH64_X12] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X12);
++ c->dwarf.loc[UNW_AARCH64_X13] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X13);
++ c->dwarf.loc[UNW_AARCH64_X14] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X14);
++ c->dwarf.loc[UNW_AARCH64_X15] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X15);
++ c->dwarf.loc[UNW_AARCH64_X16] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X16);
++ c->dwarf.loc[UNW_AARCH64_X17] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X17);
++ c->dwarf.loc[UNW_AARCH64_X18] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X18);
++ c->dwarf.loc[UNW_AARCH64_X19] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X19);
++ c->dwarf.loc[UNW_AARCH64_X20] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X20);
++ c->dwarf.loc[UNW_AARCH64_X21] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X21);
++ c->dwarf.loc[UNW_AARCH64_X22] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X22);
++ c->dwarf.loc[UNW_AARCH64_X23] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X23);
++ c->dwarf.loc[UNW_AARCH64_X24] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X24);
++ c->dwarf.loc[UNW_AARCH64_X25] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X25);
++ c->dwarf.loc[UNW_AARCH64_X26] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X26);
++ c->dwarf.loc[UNW_AARCH64_X27] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X27);
++ c->dwarf.loc[UNW_AARCH64_X28] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X28);
++ c->dwarf.loc[UNW_AARCH64_X29] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X29);
++ c->dwarf.loc[UNW_AARCH64_X30] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X30);
++ c->dwarf.loc[UNW_AARCH64_SP] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_SP);
++ c->dwarf.loc[UNW_AARCH64_PC] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_PC);
++ c->dwarf.loc[UNW_AARCH64_PSTATE] = DWARF_REG_LOC (&c->dwarf,
++ UNW_AARCH64_PSTATE);
++ c->dwarf.loc[UNW_AARCH64_V0] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V0);
++ c->dwarf.loc[UNW_AARCH64_V1] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V1);
++ c->dwarf.loc[UNW_AARCH64_V2] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V2);
++ c->dwarf.loc[UNW_AARCH64_V3] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V3);
++ c->dwarf.loc[UNW_AARCH64_V4] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V4);
++ c->dwarf.loc[UNW_AARCH64_V5] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V5);
++ c->dwarf.loc[UNW_AARCH64_V6] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V6);
++ c->dwarf.loc[UNW_AARCH64_V7] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V7);
++ c->dwarf.loc[UNW_AARCH64_V8] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V8);
++ c->dwarf.loc[UNW_AARCH64_V9] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V9);
++ c->dwarf.loc[UNW_AARCH64_V10] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V10);
++ c->dwarf.loc[UNW_AARCH64_V11] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V11);
++ c->dwarf.loc[UNW_AARCH64_V12] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V12);
++ c->dwarf.loc[UNW_AARCH64_V13] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V13);
++ c->dwarf.loc[UNW_AARCH64_V14] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V14);
++ c->dwarf.loc[UNW_AARCH64_V15] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V15);
++ c->dwarf.loc[UNW_AARCH64_V16] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V16);
++ c->dwarf.loc[UNW_AARCH64_V17] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V17);
++ c->dwarf.loc[UNW_AARCH64_V18] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V18);
++ c->dwarf.loc[UNW_AARCH64_V19] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V19);
++ c->dwarf.loc[UNW_AARCH64_V20] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V20);
++ c->dwarf.loc[UNW_AARCH64_V21] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V21);
++ c->dwarf.loc[UNW_AARCH64_V22] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V22);
++ c->dwarf.loc[UNW_AARCH64_V23] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V23);
++ c->dwarf.loc[UNW_AARCH64_V24] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V24);
++ c->dwarf.loc[UNW_AARCH64_V25] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V25);
++ c->dwarf.loc[UNW_AARCH64_V26] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V26);
++ c->dwarf.loc[UNW_AARCH64_V27] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V27);
++ c->dwarf.loc[UNW_AARCH64_V28] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V28);
++ c->dwarf.loc[UNW_AARCH64_V29] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V29);
++ c->dwarf.loc[UNW_AARCH64_V30] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V30);
++ c->dwarf.loc[UNW_AARCH64_V31] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V31);
++
++ for (i = UNW_AARCH64_PSTATE + 1; i < UNW_AARCH64_V0; ++i)
++ c->dwarf.loc[i] = DWARF_NULL_LOC;
++
++ ret = dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_PC], &c->dwarf.ip);
++ if (ret < 0)
++ return ret;
++
++ ret = dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_SP], &c->dwarf.cfa);
++ if (ret < 0)
++ return ret;
++
++ c->sigcontext_format = AARCH64_SCF_NONE;
++ c->sigcontext_addr = 0;
++ c->sigcontext_sp = 0;
++ c->sigcontext_pc = 0;
++
++ c->dwarf.args_size = 0;
++ c->dwarf.ret_addr_column = 0;
++ c->dwarf.stash_frames = 0;
++ c->dwarf.use_prev_instr = use_prev_instr;
++ c->dwarf.pi_valid = 0;
++ c->dwarf.pi_is_dynamic = 0;
++ c->dwarf.hint = 0;
++ c->dwarf.prev_rs = 0;
++
++ return 0;
++}
+--- /dev/null
++++ b/src/aarch64/is_fpreg.c
+@@ -0,0 +1,32 @@
++/* libunwind - a platform-independent unwind library
++ Copyright (C) 2008 CodeSourcery
++ Copyright (C) 2013 Linaro Limited
++
++This file is part of libunwind.
++
++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. */
++
++#include "libunwind_i.h"
++
++PROTECTED int
++unw_is_fpreg (int regnum)
++{
++ return (regnum >= UNW_AARCH64_V0 && regnum <= UNW_AARCH64_V31);
++}
+--- /dev/null
++++ b/src/aarch64/offsets.h
+@@ -0,0 +1,49 @@
++/* Linux-specific definitions: */
++
++/* Define various structure offsets to simplify cross-compilation. */
++
++/* Offsets for AArch64 Linux "ucontext_t": */
++
++#define LINUX_UC_FLAGS_OFF 0x0
++#define LINUX_UC_LINK_OFF 0x8
++#define LINUX_UC_STACK_OFF 0x10
++#define LINUX_UC_SIGMASK_OFF 0x28
++#define LINUX_UC_MCONTEXT_OFF 0xb0
++
++/* Offsets for AArch64 Linux "struct sigcontext": */
++
++#define LINUX_SC_FAULTADDRESS_OFF 0x00
++#define LINUX_SC_X0_OFF 0x008
++#define LINUX_SC_X1_OFF 0x010
++#define LINUX_SC_X2_OFF 0x018
++#define LINUX_SC_X3_OFF 0x020
++#define LINUX_SC_X4_OFF 0x028
++#define LINUX_SC_X5_OFF 0x030
++#define LINUX_SC_X6_OFF 0x038
++#define LINUX_SC_X7_OFF 0x040
++#define LINUX_SC_X8_OFF 0x048
++#define LINUX_SC_X9_OFF 0x050
++#define LINUX_SC_X10_OFF 0x058
++#define LINUX_SC_X11_OFF 0x060
++#define LINUX_SC_X12_OFF 0x068
++#define LINUX_SC_X13_OFF 0x070
++#define LINUX_SC_X14_OFF 0x078
++#define LINUX_SC_X15_OFF 0x080
++#define LINUX_SC_X16_OFF 0x088
++#define LINUX_SC_X17_OFF 0x090
++#define LINUX_SC_X18_OFF 0x098
++#define LINUX_SC_X19_OFF 0x0a0
++#define LINUX_SC_X20_OFF 0x0a8
++#define LINUX_SC_X21_OFF 0x0b0
++#define LINUX_SC_X22_OFF 0x0b8
++#define LINUX_SC_X23_OFF 0x0c0
++#define LINUX_SC_X24_OFF 0x0c8
++#define LINUX_SC_X25_OFF 0x0d0
++#define LINUX_SC_X26_OFF 0x0d8
++#define LINUX_SC_X27_OFF 0x0e0
++#define LINUX_SC_X28_OFF 0x0e8
++#define LINUX_SC_X29_OFF 0x0f0
++#define LINUX_SC_X30_OFF 0x0f8
++#define LINUX_SC_SP_OFF 0x100
++#define LINUX_SC_PC_OFF 0x108
++#define LINUX_SC_PSTATE_OFF 0x110
+--- /dev/null
++++ b/src/aarch64/regname.c
+@@ -0,0 +1,106 @@
++/* libunwind - a platform-independent unwind library
++ Copyright (C) 2012 Tommi Rantala <tt.rantala@gmail.com>
++ Copyright (C) 2013 Linaro Limited
++
++This file is part of libunwind.
++
++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. */
++
++#include "unwind_i.h"
++
++static const char *const regname[] =
++ {
++ [UNW_AARCH64_X0] = "x0",
++ [UNW_AARCH64_X1] = "x1",
++ [UNW_AARCH64_X2] = "x2",
++ [UNW_AARCH64_X3] = "x3",
++ [UNW_AARCH64_X4] = "x4",
++ [UNW_AARCH64_X5] = "x5",
++ [UNW_AARCH64_X6] = "x6",
++ [UNW_AARCH64_X7] = "x7",
++ [UNW_AARCH64_X8] = "x8",
++ [UNW_AARCH64_X9] = "x9",
++ [UNW_AARCH64_X10] = "x10",
++ [UNW_AARCH64_X11] = "x11",
++ [UNW_AARCH64_X12] = "x12",
++ [UNW_AARCH64_X13] = "x13",
++ [UNW_AARCH64_X14] = "x14",
++ [UNW_AARCH64_X15] = "x15",
++ [UNW_AARCH64_X16] = "ip0",
++ [UNW_AARCH64_X17] = "ip1",
++ [UNW_AARCH64_X18] = "x18",
++ [UNW_AARCH64_X19] = "x19",
++ [UNW_AARCH64_X20] = "x20",
++ [UNW_AARCH64_X21] = "x21",
++ [UNW_AARCH64_X22] = "x22",
++ [UNW_AARCH64_X23] = "x23",
++ [UNW_AARCH64_X24] = "x24",
++ [UNW_AARCH64_X25] = "x25",
++ [UNW_AARCH64_X26] = "x26",
++ [UNW_AARCH64_X27] = "x27",
++ [UNW_AARCH64_X28] = "x28",
++ [UNW_AARCH64_X29] = "fp",
++ [UNW_AARCH64_X30] = "lr",
++ [UNW_AARCH64_SP] = "sp",
++ [UNW_AARCH64_PC] = "pc",
++ [UNW_AARCH64_V0] = "v0",
++ [UNW_AARCH64_V1] = "v1",
++ [UNW_AARCH64_V2] = "v2",
++ [UNW_AARCH64_V3] = "v3",
++ [UNW_AARCH64_V4] = "v4",
++ [UNW_AARCH64_V5] = "v5",
++ [UNW_AARCH64_V6] = "v6",
++ [UNW_AARCH64_V7] = "v7",
++ [UNW_AARCH64_V8] = "v8",
++ [UNW_AARCH64_V9] = "v9",
++ [UNW_AARCH64_V10] = "v10",
++ [UNW_AARCH64_V11] = "v11",
++ [UNW_AARCH64_V12] = "v12",
++ [UNW_AARCH64_V13] = "v13",
++ [UNW_AARCH64_V14] = "v14",
++ [UNW_AARCH64_V15] = "v15",
++ [UNW_AARCH64_V16] = "v16",
++ [UNW_AARCH64_V17] = "v17",
++ [UNW_AARCH64_V18] = "v18",
++ [UNW_AARCH64_V19] = "v19",
++ [UNW_AARCH64_V20] = "v20",
++ [UNW_AARCH64_V21] = "v21",
++ [UNW_AARCH64_V22] = "v22",
++ [UNW_AARCH64_V23] = "v23",
++ [UNW_AARCH64_V24] = "v24",
++ [UNW_AARCH64_V25] = "v25",
++ [UNW_AARCH64_V26] = "v26",
++ [UNW_AARCH64_V27] = "v27",
++ [UNW_AARCH64_V28] = "v28",
++ [UNW_AARCH64_V29] = "v29",
++ [UNW_AARCH64_V30] = "v30",
++ [UNW_AARCH64_V31] = "v31",
++ [UNW_AARCH64_FPSR] = "fpsr",
++ [UNW_AARCH64_FPCR] = "fpcr",
++ };
++
++PROTECTED const char *
++unw_regname (unw_regnum_t reg)
++{
++ if (reg < (unw_regnum_t) ARRAY_SIZE (regname) && regname[reg] != NULL)
++ return regname[reg];
++ else
++ return "???";
++}
+--- /dev/null
++++ b/src/aarch64/siglongjmp.S
+@@ -0,0 +1,12 @@
++ /* Dummy implementation for now. */
++
++ .global _UI_siglongjmp_cont
++ .global _UI_longjmp_cont
++
++_UI_siglongjmp_cont:
++_UI_longjmp_cont:
++ ret
++#ifdef __linux__
++ /* We do not need executable stack. */
++ .section .note.GNU-stack,"",%progbits
++#endif
+--- /dev/null
++++ b/src/aarch64/unwind_i.h
+@@ -0,0 +1,43 @@
++/* libunwind - a platform-independent unwind library
++ Copyright (C) 2008 CodeSourcery
++ Copyright (C) 2013 Linaro Limited
++
++This file is part of libunwind.
++
++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. */
++
++#ifndef unwind_i_h
++#define unwind_i_h
++
++#include <stdint.h>
++
++#include <libunwind-aarch64.h>
++
++#include "libunwind_i.h"
++
++#define aarch64_lock UNW_OBJ(lock)
++#define aarch64_local_resume UNW_OBJ(local_resume)
++#define aarch64_local_addr_space_init UNW_OBJ(local_addr_space_init)
++
++extern void aarch64_local_addr_space_init (void);
++extern int aarch64_local_resume (unw_addr_space_t as, unw_cursor_t *cursor,
++ void *arg);
++
++#endif /* unwind_i_h */
+--- a/src/coredump/_UCD_access_reg_linux.c
++++ b/src/coredump/_UCD_access_reg_linux.c
+@@ -39,7 +39,10 @@ _UCD_access_reg (unw_addr_space_t as,
+ return -UNW_EINVAL;
+ }
+
+-#if defined(UNW_TARGET_ARM)
++#if defined(UNW_TARGET_AARCH64)
++ if (regnum < 0 || regnum >= UNW_AARCH64_FPCR)
++ goto badreg;
++#elif defined(UNW_TARGET_ARM)
+ if (regnum < 0 || regnum >= 16)
+ goto badreg;
+ #elif defined(UNW_TARGET_SH)
+--- a/src/ptrace/_UPT_reg_offset.c
++++ b/src/ptrace/_UPT_reg_offset.c
+@@ -1,6 +1,7 @@
+ /* libunwind - a platform-independent unwind library
+ Copyright (C) 2003-2004 Hewlett-Packard Co
+ Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
++ Copyright (C) 2013 Linaro Limited
+
+ This file is part of libunwind.
+
+@@ -501,6 +502,41 @@ const int _UPT_reg_offset[UNW_REG_LAST +
+ [UNW_ARM_R15] = 0x3c,
+ #elif defined(UNW_TARGET_MIPS)
+ #elif defined(UNW_TARGET_SH)
++#elif defined(UNW_TARGET_AARCH64)
++ [UNW_AARCH64_X0] = 0x00,
++ [UNW_AARCH64_X1] = 0x08,
++ [UNW_AARCH64_X2] = 0x10,
++ [UNW_AARCH64_X3] = 0x18,
++ [UNW_AARCH64_X4] = 0x20,
++ [UNW_AARCH64_X5] = 0x28,
++ [UNW_AARCH64_X6] = 0x30,
++ [UNW_AARCH64_X7] = 0x38,
++ [UNW_AARCH64_X8] = 0x40,
++ [UNW_AARCH64_X9] = 0x48,
++ [UNW_AARCH64_X10] = 0x50,
++ [UNW_AARCH64_X11] = 0x58,
++ [UNW_AARCH64_X12] = 0x60,
++ [UNW_AARCH64_X13] = 0x68,
++ [UNW_AARCH64_X14] = 0x70,
++ [UNW_AARCH64_X15] = 0x78,
++ [UNW_AARCH64_X16] = 0x80,
++ [UNW_AARCH64_X17] = 0x88,
++ [UNW_AARCH64_X18] = 0x90,
++ [UNW_AARCH64_X19] = 0x98,
++ [UNW_AARCH64_X20] = 0xa0,
++ [UNW_AARCH64_X21] = 0xa8,
++ [UNW_AARCH64_X22] = 0xb0,
++ [UNW_AARCH64_X23] = 0xb8,
++ [UNW_AARCH64_X24] = 0xc0,
++ [UNW_AARCH64_X25] = 0xc8,
++ [UNW_AARCH64_X26] = 0xd0,
++ [UNW_AARCH64_X27] = 0xd8,
++ [UNW_AARCH64_X28] = 0xe0,
++ [UNW_AARCH64_X29] = 0xe8,
++ [UNW_AARCH64_X30] = 0xf0,
++ [UNW_AARCH64_SP] = 0xf8,
++ [UNW_AARCH64_PC] = 0x100,
++ [UNW_AARCH64_PSTATE] = 0x108
+ #else
+ # error Fix me.
+ #endif
diff --git a/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch b/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch
new file mode 100644
index 000000000..0dff2c86d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch
@@ -0,0 +1,62 @@
+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(-)
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index 497f7c2..9c15af1 100644
+--- a/acinclude.m4
++++ b/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)
+ ])
+diff --git a/include/libunwind_i.h b/include/libunwind_i.h
+index 23f615e..deabdfd 100644
+--- a/include/libunwind_i.h
++++ b/include/libunwind_i.h
+@@ -95,6 +95,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+ (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)
+--
+1.9.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/Fix-test-case-link-failure-on-PowerPC-systems-with-Altivec.patch b/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/Fix-test-case-link-failure-on-PowerPC-systems-with-Altivec.patch
new file mode 100644
index 000000000..dc0f5c1b4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/Fix-test-case-link-failure-on-PowerPC-systems-with-Altivec.patch
@@ -0,0 +1,28 @@
+Fix test case link failure on PowerPC systems with Altivec
+
+Upstream-Status:backport
+
+On systems where the system compiler supports Altivec by default,
+the libunwind Makefile will attempt to build an extra test case
+ppc64-test-altivec. Unfortunately, the link step will fail since
+the Makefile does not actually link against the libunwind library.
+
+Fixed by adding the appropriate LDADD macro.
+
+Signed-off-by: Ulrich Weigand <address@hidden>
+---
+ tests/Makefile.am | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 0e30536..9c76628 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -201,3 +201,4 @@ Lia64_test_rbs_LDADD = $(LIBUNWIND_local)
+ Lia64_test_readonly_LDADD = $(LIBUNWIND_local)
+ ia64_test_dyn1_LDADD = $(LIBUNWIND)
+ ia64_test_sig_LDADD = $(LIBUNWIND)
++ppc64_test_altivec_LDADD = $(LIBUNWIND)
+--
+1.8.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/Link-libunwind-to-libgcc_s-rather-than-libgcc.patch b/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/Link-libunwind-to-libgcc_s-rather-than-libgcc.patch
new file mode 100644
index 000000000..0e55c91b8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/Link-libunwind-to-libgcc_s-rather-than-libgcc.patch
@@ -0,0 +1,42 @@
+From 508ca17a7be01d1cc960d9a07d0af4513948fb8d Mon Sep 17 00:00:00 2001
+From: Thierry Reding <treding@nvidia.com>
+Date: Fri, 27 Jun 2014 08:40:33 +0200
+Subject: [PATCH] Link libunwind to libgcc_s rather than libgcc
+
+For some architectures, -lgcc and -lgcc_s are not equivalent. On ARM for
+example, libgcc_s.so.1 contains some symbols needed by libunwind which
+are not present in libgcc.
+
+This causes the following link error when building the X.Org X server
+with libunwind support:
+
+ CCLD Xorg
+ /usr/lib/libunwind.so: undefined reference to `__aeabi_unwind_cpp_pr0'
+ /usr/lib/libunwind.so: undefined reference to `__aeabi_unwind_cpp_pr1'
+
+Linking against libgcc_s explicitly solves this problem.
+
+Upstream-Status: Backport
+
+Signed-off-by: Thierry Reding <treding@nvidia.com>
+Signed-off-by: Jonathan Liu <net147@gmail.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index cffe19b..3beb5f2 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -258,7 +258,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[#ifndef __INTEL_COMPILER
+
+ if test x$GCC = xyes -a x$intel_compiler != xyes; then
+ CFLAGS="${CFLAGS} -fexceptions -Wall -Wsign-compare"
+- LIBCRTS="-lgcc"
++ LIBCRTS="-lgcc_s"
+ fi
+ AC_MSG_RESULT([$intel_compiler])
+
+--
+2.3.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/Support-building-with-older-compilers.patch b/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/Support-building-with-older-compilers.patch
new file mode 100644
index 000000000..268b702dc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind-1.1/Support-building-with-older-compilers.patch
@@ -0,0 +1,72 @@
+From 10b064ffe902d5af31bb49bd8e4f03c545f8d462 Mon Sep 17 00:00:00 2001
+From: Ladislav Michl <ladis@linux-mips.org>
+Date: Tue, 13 Nov 2012 11:19:47 +0100
+Subject: [PATCH] Support building with older compilers.
+
+Add a check for __builtin_unreachable.
+
+Upstream-Status: Pending
+---
+ configure.ac | 11 +++++++++++
+ include/libunwind_i.h | 6 ++++++
+ src/arm/Gresume.c | 2 +-
+ src/sh/Gresume.c | 2 +-
+ 4 files changed, 19 insertions(+), 2 deletions(-)
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -285,6 +285,17 @@ if test x$have__builtin___clear_cache =
+ fi
+ AC_MSG_RESULT([$have__builtin___clear_cache])
+
++AC_MSG_CHECKING([for __builtin_unreachable])
++AC_LINK_IFELSE(
++ [AC_LANG_PROGRAM([[]], [[__builtin_unreachable()]])],
++ [have__builtin_unreachable=yes],
++ [have__builtin_unreachable=no])
++if test x$have__builtin_unreachable = xyes; then
++ AC_DEFINE([HAVE__BUILTIN_UNREACHABLE], [1],
++ [Defined if __builtin_unreachable() is available])
++fi
++AC_MSG_RESULT([$have__builtin_unreachable])
++
+ AC_MSG_CHECKING([for __sync atomics])
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[]], [[
+--- a/include/libunwind_i.h
++++ b/include/libunwind_i.h
+@@ -72,6 +72,12 @@ WITH THE SOFTWARE OR THE USE OR OTHER DE
+ # endif
+ #endif
+
++#if defined(HAVE__BUILTIN_UNREACHABLE)
++# define unreachable() __builtin_unreachable()
++#else
++# define unreachable() do { } while (1)
++#endif
++
+ #ifdef DEBUG
+ # define UNW_DEBUG 1
+ #else
+--- a/src/arm/Gresume.c
++++ b/src/arm/Gresume.c
+@@ -96,7 +96,7 @@ arm_local_resume (unw_addr_space_t as, u
+ : : "r" (c->sigcontext_sp), "r" (c->sigcontext_pc)
+ );
+ }
+- __builtin_unreachable();
++ unreachable();
+ #else
+ printf ("%s: implement me\n", __FUNCTION__);
+ #endif
+--- a/src/sh/Gresume.c
++++ b/src/sh/Gresume.c
+@@ -109,7 +109,7 @@ sh_local_resume (unw_addr_space_t as, un
+ "r" (c->sigcontext_pc)
+ );
+ }
+- __builtin_unreachable();
++ unreachable();
+ #endif
+ return -UNW_EINVAL;
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind.inc b/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind.inc
new file mode 100644
index 000000000..1c342d392
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind.inc
@@ -0,0 +1,32 @@
+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://LICENSE;md5=3fced11d6df719b47505837a51c16ae5"
+DEPENDS += "libatomic-ops"
+
+inherit autotools
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[lzma] = "--enable-minidebuginfo,--disable-minidebuginfo,xz"
+
+EXTRA_OECONF_arm = "--enable-debug-frame"
+EXTRA_OECONF_aarch64 = "--enable-debug-frame"
+
+CFLAGS += "${ATOMICOPS}"
+ATOMICOPS_armv5 = "-DAO_USE_PTHREAD_DEFS=1"
+ATOMICOPS_armv4 = "-DAO_USE_PTHREAD_DEFS=1"
+ATOMICOPS ?= ""
+
+LDFLAGS_append_x86 = " -fuse-ld=gold"
+LDFLAGS_append_x86-64 = " -fuse-ld=gold"
+
+LDFLAGS_append_arm = " -fuse-ld=gold"
+LDFLAGS_append_aarch64 = " -fuse-ld=gold"
+
+LDFLAGS_append_powerpc = " -fuse-ld=gold -mbss-plt"
+LDFLAGS_append_powerpc64 = " -fuse-ld=gold -mbss-plt"
+
+SECURITY_LDFLAGS_append_libc-musl = " -lssp_nonshared -lssp"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind_1.1.bb b/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind_1.1.bb
new file mode 100644
index 000000000..aff84092a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libunwind/libunwind_1.1.bb
@@ -0,0 +1,22 @@
+require libunwind.inc
+
+SRC_URI = "${SAVANNAH_NONGNU_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \
+ file://Support-building-with-older-compilers.patch \
+ file://AArch64-port.patch \
+ file://Fix-test-case-link-failure-on-PowerPC-systems-with-Altivec.patch \
+ file://Link-libunwind-to-libgcc_s-rather-than-libgcc.patch \
+ file://0001-Invalid-dwarf-opcodes-can-cause-references-beyond-th.patch \
+ file://Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch \
+ file://0001-backtrace-Use-only-with-glibc-and-uclibc.patch \
+"
+SRC_URI_append_libc-musl = "\
+ file://0001-x86-Stub-out-x86_local_resume.patch \
+ file://0001-disable-tests.patch \
+ file://0001-Fix-build-on-mips-musl.patch \
+"
+SRC_URI[md5sum] = "fb4ea2f6fbbe45bf032cd36e586883ce"
+SRC_URI[sha256sum] = "9dfe0fcae2a866de9d3942c66995e4b460230446887dbdab302d41a8aee8d09a"
+
+# http://errors.yoctoproject.org/Errors/Details/20487/
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
diff --git a/import-layers/yocto-poky/meta/recipes-support/liburcu/liburcu/0001-Support-for-NIOS2-architecture.patch b/import-layers/yocto-poky/meta/recipes-support/liburcu/liburcu/0001-Support-for-NIOS2-architecture.patch
new file mode 100644
index 000000000..690872b4a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/liburcu/liburcu/0001-Support-for-NIOS2-architecture.patch
@@ -0,0 +1,144 @@
+From add566b913e1b5cd4974a2167157dc08d8245ab0 Mon Sep 17 00:00:00 2001
+From: Marek Vasut <marex@denx.de>
+Date: Tue, 9 Feb 2016 01:52:26 +0100
+Subject: [PATCH] Support for NIOS2 architecture
+
+Add support for the Altera NIOS2 CPU archirecture. The atomic operations
+are handled by the GCC. The memory barriers on this systems are entirely
+trivial too, since the CPU does not support SMP at all.
+
+Signed-off-by: Marek Vasut <marex@denx.de>
+Upstream-Status: Backport [ http://git.lttng.org/?p=userspace-rcu.git;a=commit;h=859050b3088aa3f0cb59d7f51ce24b9a0f18faa5 ]
+---
+ LICENSE | 1 +
+ README.md | 1 +
+ configure.ac | 1 +
+ urcu/arch/nios2.h | 40 ++++++++++++++++++++++++++++++++++++++++
+ urcu/uatomic/nios2.h | 32 ++++++++++++++++++++++++++++++++
+ 5 files changed, 75 insertions(+)
+ create mode 100644 urcu/arch/nios2.h
+ create mode 100644 urcu/uatomic/nios2.h
+
+diff --git a/LICENSE b/LICENSE
+index 3147094..a06fdcc 100644
+--- a/LICENSE
++++ b/LICENSE
+@@ -45,6 +45,7 @@ compiler.h
+ arch/s390.h
+ uatomic/alpha.h
+ uatomic/mips.h
++uatomic/nios2.h
+ uatomic/s390.h
+ system.h
+
+diff --git a/README.md b/README.md
+index f6b290f..6fe9c1e 100644
+--- a/README.md
++++ b/README.md
+@@ -43,6 +43,7 @@ Currently, the following architectures are supported:
+ - S390, S390x
+ - ARM 32/64
+ - MIPS
++ - NIOS2
+ - Alpha
+ - ia64
+ - Sparcv9 32/64
+diff --git a/configure.ac b/configure.ac
+index 39a7777..71a7d71 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -124,6 +124,7 @@ AS_CASE([$host_cpu],
+ [arm*], [ARCHTYPE="arm"],
+ [aarch64], [ARCHTYPE="aarch64"],
+ [mips*], [ARCHTYPE="mips"],
++ [nios2*], [ARCHTYPE="nios2"],
+ [tile*], [ARCHTYPE="tile"],
+ [hppa*], [ARCHTYPE="hppa"],
+ [ARCHTYPE="unknown"]
+diff --git a/urcu/arch/nios2.h b/urcu/arch/nios2.h
+new file mode 100644
+index 0000000..030d1bc
+--- /dev/null
++++ b/urcu/arch/nios2.h
+@@ -0,0 +1,40 @@
++#ifndef _URCU_ARCH_NIOS2_H
++#define _URCU_ARCH_NIOS2_H
++
++/*
++ * arch_nios2.h: trivial definitions for the NIOS2 architecture.
++ *
++ * Copyright (c) 2016 Marek Vasut <marex@denx.de>
++ *
++ * 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
++ */
++
++#include <urcu/compiler.h>
++#include <urcu/config.h>
++#include <urcu/syscall-compat.h>
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++#define cmm_mb() cmm_barrier()
++
++#ifdef __cplusplus
++}
++#endif
++
++#include <urcu/arch/generic.h>
++
++#endif /* _URCU_ARCH_NIOS2_H */
+diff --git a/urcu/uatomic/nios2.h b/urcu/uatomic/nios2.h
+new file mode 100644
+index 0000000..5b3c303
+--- /dev/null
++++ b/urcu/uatomic/nios2.h
+@@ -0,0 +1,32 @@
++#ifndef _URCU_UATOMIC_ARCH_NIOS2_H
++#define _URCU_UATOMIC_ARCH_NIOS2_H
++
++/*
++ * Atomic exchange operations for the NIOS2 architecture. Let GCC do it.
++ *
++ * Copyright (c) 2016 Marek Vasut <marex@denx.de>
++ *
++ * 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.
++ */
++
++#include <urcu/compiler.h>
++#include <urcu/system.h>
++#include <urcu/uatomic/generic.h>
++
++#endif /* _URCU_UATOMIC_ARCH_NIOS2_H */
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/liburcu/liburcu/0002-Support-for-aarch64_be.patch b/import-layers/yocto-poky/meta/recipes-support/liburcu/liburcu/0002-Support-for-aarch64_be.patch
new file mode 100644
index 000000000..a10ccd7d8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/liburcu/liburcu/0002-Support-for-aarch64_be.patch
@@ -0,0 +1,19 @@
+liburcu: add support for aarch64_be
+
+Upstream-Status: Pending
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+
+diff --git a/configure.ac b/configure.ac
+index 8ebfa8b..fe1c55d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -121,7 +121,7 @@ AS_CASE([$host_cpu],
+ [alpha*], [ARCHTYPE="alpha"],
+ [ia64], [ARCHTYPE="ia64"],
+ [arm*], [ARCHTYPE="arm"],
+- [aarch64], [ARCHTYPE="aarch64"],
++ [aarch64*], [ARCHTYPE="aarch64"],
+ [mips*], [ARCHTYPE="mips"],
+ [nios2*], [ARCHTYPE="nios2"],
+ [tile*], [ARCHTYPE="tile"],
diff --git a/import-layers/yocto-poky/meta/recipes-support/liburcu/liburcu_0.9.1.bb b/import-layers/yocto-poky/meta/recipes-support/liburcu/liburcu_0.9.1.bb
new file mode 100644
index 000000000..aadc32ff7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/liburcu/liburcu_0.9.1.bb
@@ -0,0 +1,21 @@
+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://urcu.h;beginline=4;endline=32;md5=4de0d68d3a997643715036d2209ae1d9 \
+ file://urcu/uatomic/x86.h;beginline=4;endline=21;md5=58e50bbd8a2f073bb5500e6554af0d0b"
+
+SRC_URI = " \
+ http://lttng.org/files/urcu/userspace-rcu-${PV}.tar.bz2 \
+ file://0001-Support-for-NIOS2-architecture.patch \
+ file://0002-Support-for-aarch64_be.patch \
+ "
+
+SRC_URI[md5sum] = "124eaeea06863271c0bdf2a0cc1d8e4b"
+SRC_URI[sha256sum] = "f8d278e9d95bec97c9ba954fc4c3fb584936bc0010713a8fe358b916bafd8715"
+
+S = "${WORKDIR}/userspace-rcu-${PV}"
+CFLAGS_append_libc-uclibc = " -D_GNU_SOURCE"
+inherit autotools
diff --git a/import-layers/yocto-poky/meta/recipes-support/libusb/libusb-compat/0001-usb.h-Include-sys-types.h.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/libusb/libusb-compat_0.1.5.bb b/import-layers/yocto-poky/meta/recipes-support/libusb/libusb-compat_0.1.5.bb
new file mode 100644
index 000000000..1ddbe238f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/libusb/libusb1/no-dll.patch b/import-layers/yocto-poky/meta/recipes-support/libusb/libusb1/no-dll.patch
new file mode 100644
index 000000000..6e6bb83d1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/libusb/libusb1_1.0.20.bb b/import-layers/yocto-poky/meta/recipes-support/libusb/libusb1_1.0.20.bb
new file mode 100644
index 000000000..4cad2d4be
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libusb/libusb1_1.0.20.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] = "1d4eb194eaaa2bcfbba28102768c7dbf"
+SRC_URI[sha256sum] = "cb057190ba0a961768224e4dc6883104c6f945b2bf2ef90d7da39e7c1834f7ff"
+
+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/import-layers/yocto-poky/meta/recipes-support/libxslt/libxslt/CVE-2015-7995.patch b/import-layers/yocto-poky/meta/recipes-support/libxslt/libxslt/CVE-2015-7995.patch
new file mode 100644
index 000000000..f4113efba
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libxslt/libxslt/CVE-2015-7995.patch
@@ -0,0 +1,34 @@
+From 7ca19df892ca22d9314e95d59ce2abdeff46b617 Mon Sep 17 00:00:00 2001
+From: Daniel Veillard <veillard@redhat.com>
+Date: Thu, 29 Oct 2015 19:33:23 +0800
+Subject: Fix for type confusion in preprocessing attributes
+
+CVE-2015-7995 http://www.openwall.com/lists/oss-security/2015/10/27/10
+We need to check that the parent node is an element before dereferencing
+its namespace
+
+Upstream-Status: Backport
+CVE: CVE-2015-7995
+
+https://git.gnome.org/browse/libxslt/commit/?id=7ca19df892ca22d9314e95d59ce2abdeff46b617
+
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ libxslt/preproc.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+Index: libxslt-1.1.28/libxslt/preproc.c
+===================================================================
+--- libxslt-1.1.28.orig/libxslt/preproc.c
++++ libxslt-1.1.28/libxslt/preproc.c
+@@ -2245,7 +2245,8 @@ xsltStylePreCompute(xsltStylesheetPtr st
+ } else if (IS_XSLT_NAME(inst, "attribute")) {
+ xmlNodePtr parent = inst->parent;
+
+- if ((parent == NULL) || (parent->ns == NULL) ||
++ if ((parent == NULL) ||
++ (parent->type != XML_ELEMENT_NODE) || (parent->ns == NULL) ||
+ ((parent->ns != inst->ns) &&
+ (!xmlStrEqual(parent->ns->href, inst->ns->href))) ||
+ (!xmlStrEqual(parent->name, BAD_CAST "attribute-set"))) {
diff --git a/import-layers/yocto-poky/meta/recipes-support/libxslt/libxslt/pkgconfig.patch b/import-layers/yocto-poky/meta/recipes-support/libxslt/libxslt/pkgconfig.patch
new file mode 100644
index 000000000..89d14c944
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libxslt/libxslt/pkgconfig.patch
@@ -0,0 +1,118 @@
+Use pkg-config to find gcrypt and libxml2.
+
+Upstream-Status: Pending [libxml2 is upstreamable]
+
+RP 2014/5/22
+
+Index: libxslt-1.1.28/configure.in
+===================================================================
+--- libxslt-1.1.28.orig/configure.in 2014-05-13 16:46:02.278474967 +0000
++++ libxslt-1.1.28/configure.in 2014-05-13 16:53:56.510472561 +0000
+@@ -376,6 +376,8 @@
+ AC_SUBST(PYTHON_SUBDIR)
+ AC_SUBST(PYTHON_LIBS)
+
++PKG_PROG_PKG_CONFIG
++
+ AC_ARG_WITH(crypto, [ --with-crypto Add crypto support to exslt (on)])
+ WITH_CRYPTO=0
+ if test "$with_crypto" = "no" ; then
+@@ -391,26 +393,13 @@
+ WITH_CRYPTO=1
+ ;;
+ *)
+- AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no)
+- if test "$LIBGCRYPT_CONFIG" != "no" ; then
+- LIBGCRYPT_VERSION=`$LIBGCRYPT_CONFIG --version`
+- if test VERSION_TO_NUMBER(echo $LIBGCRYPT_VERSION) -lt VERSION_TO_NUMBER(echo "1.1.42")
+- then
+- LIBGCRYPT_CFLAGS=""
+- LIBGCRYPT_LIBS=""
+- echo 'gcrypt library version < 1.1.42 - Crypto extensions will not be available.'
+- else
+- LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --cflags`
+- LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --libs`
+- AC_DEFINE(HAVE_GCRYPT, 1, [Define if gcrypt library is available.])
+- echo 'Crypto extensions will be available.'
++ PKG_CHECK_MODULES(LIBGCRYPT, [libgcrypt >= 1.1.42], [
++ AC_DEFINE(HAVE_GCRYPT, 1, [Define if gcrypt library is available.])
++ echo 'Crypto extensions will be available.'
+ WITH_CRYPTO=1
+- fi
+- else
+- LIBGCRYPT_CFLAGS=""
+- LIBGCRYPT_LIBS=""
+- echo 'Crypto extensions will not be available. Install libgcrypt and reconfigure to make available.'
+- fi
++ ], [
++ echo 'Crypto extensions will not be available. Install libgcrypt >= 1.1.42 and reconfigure to make available.'
++ ])
+ esac
+ fi
+ AC_SUBST(WITH_CRYPTO)
+@@ -471,24 +460,8 @@
+ dnl some tweaking - David Härdeman 30/10/2001
+ dnl
+
+-LIBXML_CONFIG_PREFIX=""
+ LIBXML_SRC=""
+
+-AC_ARG_WITH(libxml-prefix,
+- [ --with-libxml-prefix=[PFX] Specify location of libxml config],
+- LIBXML_CONFIG_PREFIX=$withval
+-)
+-
+-AC_ARG_WITH(libxml-include-prefix,
+- [ --with-libxml-include-prefix=[PFX] Specify location of libxml headers],
+- LIBXML_CFLAGS="-I$withval"
+-)
+-
+-AC_ARG_WITH(libxml-libs-prefix,
+- [ --with-libxml-libs-prefix=[PFX] Specify location of libxml libs],
+- LIBXML_LIBS="-L$withval"
+-)
+-
+ AC_ARG_WITH(libxml-src,
+ [ --with-libxml-src=[DIR] For libxml thats not installed yet (sets all three above)],
+ LIBXML_SRC="$withval"
+@@ -551,28 +524,9 @@
+ fi
+ fi
+
+-dnl
+-dnl make sure xml2-config is executable,
+-dnl test version and init our variables
+-dnl
+-
+-if ${XML_CONFIG} --libs print > /dev/null 2>&1
+-then
+- XMLVERS=`$XML_CONFIG --version`
+- if test VERSION_TO_NUMBER(echo $XMLVERS) -ge VERSION_TO_NUMBER(echo $LIBXML_REQUIRED_VERSION)
+- then
+- AC_MSG_RESULT($XMLVERS found)
+- else
+- AC_MSG_ERROR(Version $XMLVERS found. You need at least libxml2 $LIBXML_REQUIRED_VERSION for this version of libxslt)
+- fi
+- LIBXML_LIBS="$LIBXML_LIBS `$XML_CONFIG --libs`"
+- if test "x$LIBXML_SRC" = "x"; then
+- LIBXML_CFLAGS="$LIBXML_CFLAGS `$XML_CONFIG --cflags`"
+- fi
+-else
+- AC_MSG_ERROR([Could not find libxml2 anywhere, check ftp://xmlsoft.org/.])
+-fi
+-
++PKG_CHECK_MODULES(LIBXML, [libxml-2.0 >= $LIBXML_REQUIRED_VERSION],,
++ [AC_MSG_ERROR([Could not find libxml-2.0 >= $LIBXML_REQUIRED_VERSION anywhere, check ftp://xmlsoft.org/.])]
++)
+
+ AC_SUBST(CFLAGS)
+ AC_SUBST(CPPFLAGS)
+@@ -597,7 +551,7 @@
+
+ if test "$with_plugins" = "yes" ; then
+ AC_MSG_CHECKING([libxml2 module support])
+- WITH_MODULES="`$XML_CONFIG --modules`"
++ WITH_MODULES="`$PKG_CONFIG --variable=modules libxml-2.0`"
+ if test "${WITH_MODULES}" = "1"; then
+ AC_MSG_RESULT(yes)
+ else
diff --git a/import-layers/yocto-poky/meta/recipes-support/libxslt/libxslt/pkgconfig_fix.patch b/import-layers/yocto-poky/meta/recipes-support/libxslt/libxslt/pkgconfig_fix.patch
new file mode 100644
index 000000000..16a801010
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libxslt/libxslt/pkgconfig_fix.patch
@@ -0,0 +1,24 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: libxslt-1.1.27/libexslt.pc.in
+===================================================================
+--- libxslt-1.1.27.orig/libexslt.pc.in
++++ libxslt-1.1.27/libexslt.pc.in
+@@ -8,5 +8,5 @@ Name: libexslt
+ Version: @LIBEXSLT_VERSION@
+ Description: EXSLT Extension library
+ Requires: libxml-2.0
+-Libs: @EXSLT_LIBDIR@ @EXSLT_LIBS@
++Libs: -lexslt @EXSLT_LIBDIR@ @EXSLT_LIBS@
+ Cflags: @EXSLT_INCLUDEDIR@
+Index: libxslt-1.1.27/libxslt.pc.in
+===================================================================
+--- libxslt-1.1.27.orig/libxslt.pc.in
++++ libxslt-1.1.27/libxslt.pc.in
+@@ -8,5 +8,5 @@ Name: libxslt
+ Version: @VERSION@
+ Description: XSLT library version 2.
+ Requires: libxml-2.0
+-Libs: @XSLT_LIBDIR@ @XSLT_LIBS@ @EXTRA_LIBS@
++Libs: -lxslt @XSLT_LIBDIR@ @XSLT_LIBS@ @EXTRA_LIBS@
+ Cflags: @XSLT_INCLUDEDIR@
diff --git a/import-layers/yocto-poky/meta/recipes-support/libxslt/libxslt_1.1.28.bb b/import-layers/yocto-poky/meta/recipes-support/libxslt/libxslt_1.1.28.bb
new file mode 100644
index 000000000..23ac599de
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libxslt/libxslt_1.1.28.bb
@@ -0,0 +1,50 @@
+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 = "ftp://xmlsoft.org/libxslt/libxslt-${PV}.tar.gz \
+ file://pkgconfig_fix.patch \
+ file://pkgconfig.patch \
+ file://CVE-2015-7995.patch"
+
+SRC_URI[md5sum] = "9667bf6f9310b957254fdcf6596600b7"
+SRC_URI[sha256sum] = "5fc7151a57b89c03d7b825df5a0fae0a8d5f05674c0e7cf2937ecec4d54a028c"
+
+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.in
+
+ # 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/import-layers/yocto-poky/meta/recipes-support/libyaml/files/libyaml-CVE-2014-9130.patch b/import-layers/yocto-poky/meta/recipes-support/libyaml/files/libyaml-CVE-2014-9130.patch
new file mode 100644
index 000000000..61fa7e569
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libyaml/files/libyaml-CVE-2014-9130.patch
@@ -0,0 +1,33 @@
+# HG changeset patch
+# User Kirill Simonov <xi@resolvent.net>
+# Date 1417197312 21600
+# Node ID 2b9156756423e967cfd09a61d125d883fca6f4f2
+# Parent 053f53a381ff6adbbc93a31ab7fdee06a16c8a33
+Removed invalid simple key assertion (thank to Jonathan Gray).
+
+The patch comes from
+
+https://bitbucket.org/xi/libyaml/commits/2b9156756423e967cfd09a61d125d883fca6f4f2
+
+Upstream-Status: Backport
+CVE: CVE-2014-9130
+
+Signed-off-by: Yue Tao <yue.tao@windriver.com>
+
+diff -r 053f53a381ff -r 2b9156756423 src/scanner.c
+--- a/src/scanner.c Wed Mar 26 13:55:54 2014 -0500
++++ b/src/scanner.c Fri Nov 28 11:55:12 2014 -0600
+@@ -1106,13 +1106,6 @@
+ && parser->indent == (ptrdiff_t)parser->mark.column);
+
+ /*
+- * A simple key is required only when it is the first token in the current
+- * line. Therefore it is always allowed. But we add a check anyway.
+- */
+-
+- assert(parser->simple_key_allowed || !required); /* Impossible. */
+-
+- /*
+ * If the current position may start a simple key, save it.
+ */
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/libyaml/libyaml_0.1.6.bb b/import-layers/yocto-poky/meta/recipes-support/libyaml/libyaml_0.1.6.bb
new file mode 100644
index 000000000..b0155774d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/libyaml/libyaml_0.1.6.bb
@@ -0,0 +1,21 @@
+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 \
+ file://libyaml-CVE-2014-9130.patch \
+ "
+
+SRC_URI[md5sum] = "5fe00cda18ca5daeb43762b80c38e06e"
+SRC_URI[sha256sum] = "7da6971b4bd08a986dd2a61353bc422362bd0edcc67d7ebaac68c95f74182749"
+
+S = "${WORKDIR}/yaml-${PV}"
+
+inherit autotools
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-support/lz4/lz4.bb b/import-layers/yocto-poky/meta/recipes-support/lz4/lz4.bb
new file mode 100644
index 000000000..18e56d04c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/lz4/lz4.bb
@@ -0,0 +1,21 @@
+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"
+LIC_FILES_CHKSUM = "file://lib/LICENSE;md5=0b0d063f37a4477b54af2459477dcafd"
+
+SRCREV = "d86dc916771c126afb797637dda9f6421c0cb998"
+
+PV = "131+git${SRCPV}"
+
+SRC_URI = "git://github.com/Cyan4973/lz4.git"
+
+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/import-layers/yocto-poky/meta/recipes-support/lzo/lzo/0001-Use-memcpy-instead-of-reinventing-it.patch b/import-layers/yocto-poky/meta/recipes-support/lzo/lzo/0001-Use-memcpy-instead-of-reinventing-it.patch
new file mode 100644
index 000000000..db3a70e80
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/lzo/lzo/acinclude.m4 b/import-layers/yocto-poky/meta/recipes-support/lzo/lzo/acinclude.m4
new file mode 100644
index 000000000..c4d2ccd5b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/lzo/lzo/acinclude.m4
@@ -0,0 +1,358 @@
+
+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
+])#
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/lzo/lzo/run-ptest b/import-layers/yocto-poky/meta/recipes-support/lzo/lzo/run-ptest
new file mode 100644
index 000000000..2ea7745f7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/lzo/lzo/run-ptest
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+./lzotest -mavail -n10 -q /etc/services
+LZOTEST=./lzotest /bin/sh -e "./check.sh" "/etc"
+./align
+./chksum
+./simple
+./testmini
diff --git a/import-layers/yocto-poky/meta/recipes-support/lzo/lzo_2.09.bb b/import-layers/yocto-poky/meta/recipes-support/lzo/lzo_2.09.bb
new file mode 100644
index 000000000..2978617bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/lzo/lzo_2.09.bb
@@ -0,0 +1,35 @@
+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=355023835a9b9eeb70ab895395e951ff"
+
+SRC_URI = "http://www.oberhumer.com/opensource/lzo/download/lzo-${PV}.tar.gz \
+ file://0001-Use-memcpy-instead-of-reinventing-it.patch \
+ file://acinclude.m4 \
+ file://run-ptest \
+ "
+
+SRC_URI[md5sum] = "c7ffc9a103afe2d1bba0b015e7aa887f"
+SRC_URI[sha256sum] = "f294a7ced313063c057c504257f437c8335c41bfeed23531ee4e6a2b87bcb34c"
+
+inherit autotools ptest
+
+EXTRA_OECONF = "--enable-shared"
+
+do_configure_prepend () {
+ cp ${WORKDIR}/acinclude.m4 ${S}/
+}
+
+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/import-layers/yocto-poky/meta/recipes-support/lzop/lzop/0001-use-static-inlines-as-the-external-inline-definition.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/lzop/lzop/acinclude.m4 b/import-layers/yocto-poky/meta/recipes-support/lzop/lzop/acinclude.m4
new file mode 100644
index 000000000..0029c19c7
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/lzop/lzop/x32_abi_miniacc_h.patch b/import-layers/yocto-poky/meta/recipes-support/lzop/lzop/x32_abi_miniacc_h.patch
new file mode 100644
index 000000000..739be8231
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/lzop/lzop_1.03.bb b/import-layers/yocto-poky/meta/recipes-support/lzop/lzop_1.03.bb
new file mode 100644
index 000000000..07d628908
--- /dev/null
+++ b/import-layers/yocto-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 \
+ "
+SRC_URI[md5sum] = "006c5e27fb78cdd14a628fdfa5aa1905"
+SRC_URI[sha256sum] = "c1425b8c77d49f5a679d5a126c90ea6ad99585a55e335a613cae59e909dbb2c9"
+
+inherit autotools
+
+do_configure () {
+ ln -sf ../acinclude.m4 ${S}/acinclude.m4
+ autotools_do_configure
+}
+
+BBCLASSEXTEND += "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/mpfr/mpfr-3.1.3/long-long-thumb.patch b/import-layers/yocto-poky/meta/recipes-support/mpfr/mpfr-3.1.3/long-long-thumb.patch
new file mode 100644
index 000000000..ca7100eb2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/mpfr/mpfr-3.1.3/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/import-layers/yocto-poky/meta/recipes-support/mpfr/mpfr.inc b/import-layers/yocto-poky/meta/recipes-support/mpfr/mpfr.inc
new file mode 100644
index 000000000..7f3f9175d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/mpfr/mpfr.inc
@@ -0,0 +1,6 @@
+SUMMARY = "C library for multiple-precision floating-point computations with exact rounding"
+HOMEPAGE = "http://www.mpfr.org/"
+LICENSE = "LGPLv3+"
+SECTION = "devel"
+
+inherit autotools texinfo
diff --git a/import-layers/yocto-poky/meta/recipes-support/mpfr/mpfr_3.1.3.bb b/import-layers/yocto-poky/meta/recipes-support/mpfr/mpfr_3.1.3.bb
new file mode 100644
index 000000000..ee8a23893
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/mpfr/mpfr_3.1.3.bb
@@ -0,0 +1,19 @@
+require mpfr.inc
+
+LICENSE = "GPLv3 & LGPLv3"
+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] = "6969398cd2fbc56a6af570b5273c56a9"
+SRC_URI[sha256sum] = "6835a08bd992c8257641791e9a6a2b35b02336c8de26d0a8577953747e514a16"
+
+UPSTREAM_CHECK_URI = "http://www.mpfr.org/mpfr-current/"
+
+S = "${WORKDIR}/mpfr-${PV}"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-support/neon/neon/gnutls_4.3_fixup.patch b/import-layers/yocto-poky/meta/recipes-support/neon/neon/gnutls_4.3_fixup.patch
new file mode 100644
index 000000000..459f5e385
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/neon/neon/gnutls_4.3_fixup.patch
@@ -0,0 +1,68 @@
+replace deprecated GnuTLS functions with newer ones if available
+
+Upstream-Status: Pending
+
+Signed-off-by: Armin Kuster <akuster808@gmail.com>
+
+Index: neon-0.30.1/macros/neon.m4
+===================================================================
+--- neon-0.30.1.orig/macros/neon.m4
++++ neon-0.30.1/macros/neon.m4
+@@ -987,6 +987,10 @@ gnutls)
+ gnutls_certificate_get_x509_cas \
+ gnutls_x509_crt_sign2])
+
++ # gnutls 4.3 check
++ AC_CHECK_LIB(gnutls, gnutls_global_init)
++ AC_CHECK_FUNCS(gnutls_certificate_set_retrieve_function,,)
++
+ # fail if gnutls_x509_crt_sign2 is not found (it was introduced in 1.2.0, which is required)
+ if test x${ac_cv_func_gnutls_x509_crt_sign2} != xyes; then
+ AC_MSG_ERROR([GnuTLS version predates gnutls_x509_crt_sign2, newer version required (at least 1.2.0)])
+Index: neon-0.30.1/src/ne_gnutls.c
+===================================================================
+--- neon-0.30.1.orig/src/ne_gnutls.c
++++ neon-0.30.1/src/ne_gnutls.c
+@@ -553,7 +553,13 @@ dup_error:
+ static int provide_client_cert(gnutls_session_t session,
+ const gnutls_datum_t *req_ca_rdn, int nreqs,
+ const gnutls_pk_algorithm_t *sign_algos,
+- int sign_algos_length, gnutls_retr_st *st)
++ int sign_algos_length,
++#if HAVE_GNUTLS_CERTIFICATE_SET_RETRIEVE_FUNCTION
++ gnutls_retr2_st* st
++#else
++ gnutls_retr_st *st
++#endif
++ )
+ {
+ ne_session *sess = gnutls_session_get_ptr(session);
+
+@@ -617,8 +623,11 @@ static int provide_client_cert(gnutls_se
+ #endif
+ ) {
+ NE_DEBUG(NE_DBG_SSL, "Supplying client certificate.\n");
+-
++#if HAVE_GNUTLS_CERTIFICATE_SET_RETRIEVE_FUNCTION
++ st->cert_type = type;
++#else
+ st->type = type;
++#endif
+ st->ncerts = 1;
+ st->cert.x509 = &sess->client_cert->cert.subject;
+ st->key.x509 = sess->client_cert->pkey;
+@@ -649,8 +658,14 @@ ne_ssl_context *ne_ssl_context_create(in
+ ne_ssl_context *ctx = ne_calloc(sizeof *ctx);
+ gnutls_certificate_allocate_credentials(&ctx->cred);
+ if (flags == NE_SSL_CTX_CLIENT) {
++
++#if HAVE_GNUTLS_CERTIFICATE_SET_RETRIEVE_FUNCTION
++ gnutls_certificate_set_retrieve_function(ctx->cred,
++ provide_client_cert);
++#else
+ gnutls_certificate_client_set_retrieve_function(ctx->cred,
+ provide_client_cert);
++#endif
+ }
+ gnutls_certificate_set_verify_flags(ctx->cred,
+ GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT);
diff --git a/import-layers/yocto-poky/meta/recipes-support/neon/neon/pkgconfig.patch b/import-layers/yocto-poky/meta/recipes-support/neon/neon/pkgconfig.patch
new file mode 100644
index 000000000..239dba8e2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/neon/neon/pkgconfig.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Inappropriate [configuration]
+
+---
+ neon.pc.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- neon-0.30.1.orig/neon.pc.in
++++ neon-0.30.1/neon.pc.in
+@@ -7,5 +7,5 @@ Name: neon
+ Description: HTTP/WebDAV client library
+ Version: @NEON_VERSION@
+ Libs: -L${libdir} -lneon @NEON_PC_LIBS@
+-Libs.private: @NEON_LIBS@
++Libs.private: -L${libdir} -lz -lgcrypt -lgpg-error -lexpat -lgnutls
+ Cflags: -I${includedir}/neon @NEON_CFLAGS@
diff --git a/import-layers/yocto-poky/meta/recipes-support/neon/neon_0.30.1.bb b/import-layers/yocto-poky/meta/recipes-support/neon/neon_0.30.1.bb
new file mode 100644
index 000000000..b6cfd5076
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/neon/neon_0.30.1.bb
@@ -0,0 +1,38 @@
+SUMMARY = "An HTTP and WebDAV client library with a C interface"
+HOMEPAGE = "http://www.webdav.org/neon/"
+SECTION = "libs"
+LICENSE = "LGPLv2+"
+LIC_FILES_CHKSUM = "file://src/COPYING.LIB;md5=f30a9716ef3762e3467a2f62bf790f0a \
+ file://src/ne_utils.h;beginline=1;endline=20;md5=2caca609538eddaa6f6adf120a218037"
+
+SRC_URI = "http://www.webdav.org/${BPN}/${BPN}-${PV}.tar.gz \
+ file://pkgconfig.patch \
+ file://gnutls_4.3_fixup.patch"
+
+SRC_URI[md5sum] = "231adebe5c2f78fded3e3df6e958878e"
+SRC_URI[sha256sum] = "00c626c0dc18d094ab374dbd9a354915bfe4776433289386ed489c2ec0845cdd"
+
+inherit autotools binconfig-disabled lib_package pkgconfig
+
+# Enable gnutls or openssl, not both
+PACKAGECONFIG ?= "expat gnutls libproxy webdav zlib"
+PACKAGECONFIG_class-native = "expat gnutls webdav zlib"
+
+PACKAGECONFIG[expat] = "--with-expat,--without-expat,expat"
+PACKAGECONFIG[gnutls] = "--with-ssl=gnutls,,gnutls"
+PACKAGECONFIG[gssapi] = "--with-gssapi,--without-gssapi,krb5"
+PACKAGECONFIG[libproxy] = "--with-libproxy,--without-libproxy,libproxy"
+PACKAGECONFIG[libxml2] = "--with-libxml2,--without-libxml2,libxml2"
+PACKAGECONFIG[openssl] = "--with-ssl=openssl,,openssl"
+PACKAGECONFIG[webdav] = "--enable-webdav,--disable-webdav,"
+PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib"
+
+EXTRA_OECONF += "--enable-shared"
+
+do_compile_append() {
+ oe_runmake -C test
+}
+
+BINCONFIG = "${bindir}/neon-config"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-support/nettle/files/Add-target-to-only-build-tests-not-run-them.patch b/import-layers/yocto-poky/meta/recipes-support/nettle/files/Add-target-to-only-build-tests-not-run-them.patch
new file mode 100644
index 000000000..23da77792
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/nettle/files/Add-target-to-only-build-tests-not-run-them.patch
@@ -0,0 +1,46 @@
+From 46edf01cc98db9f9feec984897836dfdd26bdc8d Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Wed, 12 Aug 2015 23:27:27 +0300
+Subject: [PATCH] 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>
+---
+ Makefile.in | 3 +++
+ testsuite/Makefile.in | 2 ++
+ 2 files changed, 5 insertions(+)
+
+diff --git a/Makefile.in b/Makefile.in
+index 08efb7d..7909342 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -55,6 +55,9 @@ clean distclean mostlyclean maintainer-clean tags:
+ echo "Making $@ in $$d" ; (cd $$d && $(MAKE) $@); done
+ $(MAKE) $@-here
+
++buildtest:
++ echo "Making $@ in testsuite" ; (cd testsuite && $(MAKE) $@)
++
+ check-here:
+ true
+
+diff --git a/testsuite/Makefile.in b/testsuite/Makefile.in
+index 6bc1907..bb65bf0 100644
+--- a/testsuite/Makefile.in
++++ b/testsuite/Makefile.in
+@@ -116,6 +116,8 @@ $(TARGETS) $(EXTRA_TARGETS): testutils.$(OBJEXT) ../nettle-internal.$(OBJEXT) \
+ # 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 locating dlls on w*ndows.
+ check: $(TS_ALL)
+ LD_LIBRARY_PATH=../.lib PATH="../.lib:$$PATH" srcdir="$(srcdir)" \
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/nettle/files/run-ptest b/import-layers/yocto-poky/meta/recipes-support/nettle/files/run-ptest
new file mode 100644
index 000000000..b90bed66d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/nettle/files/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/import-layers/yocto-poky/meta/recipes-support/nettle/nettle-2.7.1/CVE-2015-8803_8805.patch b/import-layers/yocto-poky/meta/recipes-support/nettle/nettle-2.7.1/CVE-2015-8803_8805.patch
new file mode 100644
index 000000000..a956f426b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/nettle/nettle-2.7.1/CVE-2015-8803_8805.patch
@@ -0,0 +1,71 @@
+Upstream-Status: Backport
+https://git.lysator.liu.se/nettle/nettle/commit/c71d2c9d20eeebb985e3872e4550137209e3ce4d
+
+CVE: CVE-2015-8803
+CVE: CVE-2015-8805
+
+Same fix for both.
+
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+Index: nettle-2.7.1/ecc-256.c
+===================================================================
+--- nettle-2.7.1.orig/ecc-256.c
++++ nettle-2.7.1/ecc-256.c
+@@ -96,9 +96,19 @@ ecc_256_modp (const struct ecc_curve *ec
+ q2 += t + (q1 < t);
+
+ assert (q2 < 2);
++ /*
++ n-1 n-2 n-3 n-4
++ +---+---+---+---+
++ | u1| u0| u low |
++ +---+---+---+---+
++ - | q1(2^96-1)|
++ +-------+---+
++ |q2(2^.)|
++ +-------+
+
+- /* We multiply by two low limbs of p, 2^96 - 1, so we could use
+- shifts rather than mul. */
++ We multiply by two low limbs of p, 2^96 - 1, so we could use
++ shifts rather than mul.
++ */
+ t = mpn_submul_1 (rp + n - 4, ecc->p, 2, q1);
+ t += cnd_sub_n (q2, rp + n - 3, ecc->p, 1);
+ t += (-q2) & 0xffffffff;
+@@ -108,7 +118,10 @@ ecc_256_modp (const struct ecc_curve *ec
+ u0 -= t;
+ t = (u1 < cy);
+ u1 -= cy;
+- u1 += cnd_add_n (t, rp + n - 4, ecc->p, 3);
++
++ cy = cnd_add_n (t, rp + n - 4, ecc->p, 2);
++ u0 += cy;
++ u1 += (u0 < cy);
+ u1 -= (-t) & 0xffffffff;
+ }
+ rp[2] = u0;
+@@ -195,7 +208,7 @@ ecc_256_modq (const struct ecc_curve *ec
+
+ /* Conditional add of p */
+ u1 += t;
+- u2 += (t<<32) + (u0 < t);
++ u2 += (t<<32) + (u1 < t);
+
+ t = cnd_add_n (t, rp + n - 4, ecc->q, 2);
+ u1 += t;
+Index: nettle-2.7.1/ChangeLog
+===================================================================
+--- nettle-2.7.1.orig/ChangeLog
++++ nettle-2.7.1/ChangeLog
+@@ -1,3 +1,9 @@
++2015-12-10 Niels Möller <nisse@lysator.liu.se>
++
++ * ecc-256.c (ecc_256_modp): Fixed carry propagation bug. Problem
++ reported by Hanno Böck.
++ (ecc_256_modq): Fixed another carry propagation bug.
++
+ 2013-05-28 Niels Möller <nisse@lysator.liu.se>
+
+ * Released nettle-2.7.1.
diff --git a/import-layers/yocto-poky/meta/recipes-support/nettle/nettle-2.7.1/CVE-2015-8804.patch b/import-layers/yocto-poky/meta/recipes-support/nettle/nettle-2.7.1/CVE-2015-8804.patch
new file mode 100644
index 000000000..73723a998
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/nettle/nettle-2.7.1/CVE-2015-8804.patch
@@ -0,0 +1,272 @@
+Upstream-Status: Backport
+ https://git.lysator.liu.se/nettle/nettle/commit/fa269b6ad06dd13c901dbd84a12e52b918a09cd7
+
+CVE: CVE-2015-8804
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+Index: nettle-2.7.1/ChangeLog
+===================================================================
+--- nettle-2.7.1.orig/ChangeLog
++++ nettle-2.7.1/ChangeLog
+@@ -1,3 +1,11 @@
++2015-12-15 Niels Möller <nisse@lysator.liu.se>
++
++ * x86_64/ecc-384-modp.asm: Fixed carry propagation bug. Problem
++ reported by Hanno Böck. Simplified the folding to always use
++ non-negative carry, the old code attempted to add in a carry which
++ could be either positive or negative, but didn't get that case
++ right.
++
+ 2015-12-10 Niels Möller <nisse@lysator.liu.se>
+
+ * ecc-256.c (ecc_256_modp): Fixed carry propagation bug. Problem
+Index: nettle-2.7.1/x86_64/ecc-384-modp.asm
+===================================================================
+--- nettle-2.7.1.orig/x86_64/ecc-384-modp.asm
++++ nettle-2.7.1/x86_64/ecc-384-modp.asm
+@@ -20,7 +20,7 @@ C MA 02111-1301, USA.
+ .file "ecc-384-modp.asm"
+
+ define(<RP>, <%rsi>)
+-define(<D4>, <%rax>)
++define(<D5>, <%rax>)
+ define(<T0>, <%rbx>)
+ define(<T1>, <%rcx>)
+ define(<T2>, <%rdx>)
+@@ -35,8 +35,8 @@ define(<H4>, <%r13>)
+ define(<H5>, <%r14>)
+ define(<C2>, <%r15>)
+ define(<C0>, H5) C Overlap
+-define(<D0>, RP) C Overlap
+-define(<TMP>, H4) C Overlap
++define(<TMP>, RP) C Overlap
++
+
+ PROLOGUE(nettle_ecc_384_modp)
+ W64_ENTRY(2, 0)
+@@ -48,34 +48,38 @@ PROLOGUE(nettle_ecc_384_modp)
+ push %r14
+ push %r15
+
+- C First get top 2 limbs, which need folding twice
++ C First get top 2 limbs, which need folding twice.
++ C B^10 = B^6 + B^4 + 2^32 (B-1)B^4.
++ C We handle the terms as follow:
+ C
+- C H5 H4
+- C -H5
+- C ------
+- C H0 D4
++ C B^6: Folded immediatly.
+ C
+- C Then shift right, (H1,H0,D4) <-- (H0,D4) << 32
+- C and add
++ C B^4: Delayed, added in in the next folding.
+ C
+- C H5 H4
+- C H1 H0
+- C ----------
+- C C2 H1 H0
+-
+- mov 80(RP), D4
+- mov 88(RP), H0
+- mov D4, H4
+- mov H0, H5
+- sub H0, D4
+- sbb $0, H0
+-
+- mov D4, T2
+- mov H0, H1
+- shl $32, H0
+- shr $32, T2
++ C 2^32(B-1) B^4: Low half limb delayed until the next
++ C folding. Top 1.5 limbs subtracted and shifter now, resulting
++ C in 2.5 limbs. The low limb saved in D5, high 1.5 limbs added
++ C in.
++
++ mov 80(RP), H4
++ mov 88(RP), H5
++ C Shift right 32 bits, into H1, H0
++ mov H4, H0
++ mov H5, H1
++ mov H5, D5
+ shr $32, H1
+- or T2, H0
++ shl $32, D5
++ shr $32, H0
++ or D5, H0
++
++ C H1 H0
++ C - H1 H0
++ C --------
++ C H1 H0 D5
++ mov H0, D5
++ neg D5
++ sbb H1, H0
++ sbb $0, H1
+
+ xor C2, C2
+ add H4, H0
+@@ -114,118 +118,95 @@ PROLOGUE(nettle_ecc_384_modp)
+ adc H3, T5
+ adc $0, C0
+
+- C H3 H2 H1 H0 0
+- C - H4 H3 H2 H1 H0
+- C ---------------
+- C H3 H2 H1 H0 D0
+-
+- mov XREG(D4), XREG(D4)
+- mov H0, D0
+- neg D0
+- sbb H1, H0
+- sbb H2, H1
+- sbb H3, H2
+- sbb H4, H3
+- sbb $0, D4
+-
+- C Shift right. High bits are sign, to be added to C0.
+- mov D4, TMP
+- sar $32, TMP
+- shl $32, D4
+- add TMP, C0
+-
++ C Shift left, including low half of H4
+ mov H3, TMP
++ shl $32, H4
+ shr $32, TMP
+- shl $32, H3
+- or TMP, D4
++ or TMP, H4
+
+ mov H2, TMP
++ shl $32, H3
+ shr $32, TMP
+- shl $32, H2
+ or TMP, H3
+
+ mov H1, TMP
++ shl $32, H2
+ shr $32, TMP
+- shl $32, H1
+ or TMP, H2
+
+ mov H0, TMP
++ shl $32, H1
+ shr $32, TMP
+- shl $32, H0
+ or TMP, H1
+
+- mov D0, TMP
+- shr $32, TMP
+- shl $32, D0
+- or TMP, H0
++ shl $32, H0
++
++ C H4 H3 H2 H1 H0 0
++ C - H4 H3 H2 H1 H0
++ C ---------------
++ C H4 H3 H2 H1 H0 TMP
+
+- add D0, T0
++ mov H0, TMP
++ neg TMP
++ sbb H1, H0
++ sbb H2, H1
++ sbb H3, H2
++ sbb H4, H3
++ sbb $0, H4
++
++ add TMP, T0
+ adc H0, T1
+ adc H1, T2
+ adc H2, T3
+ adc H3, T4
+- adc D4, T5
++ adc H4, T5
+ adc $0, C0
+
+ C Remains to add in C2 and C0
+- C C0 C0<<32 (-2^32+1)C0
+- C C2 C2<<32 (-2^32+1)C2
+- C where C2 is always positive, while C0 may be -1.
++ C Set H1, H0 = (2^96 - 2^32 + 1) C0
+ mov C0, H0
+ mov C0, H1
+- mov C0, H2
+- sar $63, C0 C Get sign
+ shl $32, H1
+- sub H1, H0 C Gives borrow iff C0 > 0
++ sub H1, H0
+ sbb $0, H1
+- add C0, H2
+
++ C Set H3, H2 = (2^96 - 2^32 + 1) C2
++ mov C2, H2
++ mov C2, H3
++ shl $32, H3
++ sub H3, H2
++ sbb $0, H3
++ add C0, H2 C No carry. Could use lea trick
++
++ xor C0, C0
+ add H0, T0
+ adc H1, T1
+- adc $0, H2
+- adc $0, C0
+-
+- C Set (H1 H0) <-- C2 << 96 - C2 << 32 + 1
+- mov C2, H0
+- mov C2, H1
+- shl $32, H1
+- sub H1, H0
+- sbb $0, H1
+-
+- add H2, H0
+- adc C0, H1
+- adc C2, C0
+- mov C0, H2
+- sar $63, C0
+- add H0, T2
+- adc H1, T3
+- adc H2, T4
+- adc C0, T5
+- sbb C0, C0
++ adc H2, T2
++ adc H3, T3
++ adc C2, T4
++ adc D5, T5 C Value delayed from initial folding
++ adc $0, C0 C Use sbb and switch sign?
+
+ C Final unlikely carry
+ mov C0, H0
+ mov C0, H1
+- mov C0, H2
+- sar $63, C0
+ shl $32, H1
+ sub H1, H0
+ sbb $0, H1
+- add C0, H2
+
+ pop RP
+
+- sub H0, T0
++ add H0, T0
+ mov T0, (RP)
+- sbb H1, T1
++ adc H1, T1
+ mov T1, 8(RP)
+- sbb H2, T2
++ adc C0, T2
+ mov T2, 16(RP)
+- sbb C0, T3
++ adc $0, T3
+ mov T3, 24(RP)
+- sbb C0, T4
++ adc $0, T4
+ mov T4, 32(RP)
+- sbb C0, T5
++ adc $0, T5
+ mov T5, 40(RP)
+
+ pop %r15
diff --git a/import-layers/yocto-poky/meta/recipes-support/nettle/nettle.inc b/import-layers/yocto-poky/meta/recipes-support/nettle/nettle.inc
new file mode 100644
index 000000000..af51fb6c7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/nettle/nettle.inc
@@ -0,0 +1,37 @@
+SUMMARY = "A low level cryptographic library"
+HOMEPAGE = "http://www.lysator.liu.se/~nisse/nettle/"
+SECTION = "libs"
+
+DEPENDS += "gmp"
+
+SRC_URI = "http://www.lysator.liu.se/~nisse/archive/${BP}.tar.gz \
+ file://Add-target-to-only-build-tests-not-run-them.patch \
+ file://run-ptest \
+ "
+
+UPSTREAM_CHECK_REGEX = "nettle-(?P<pver>\d+(\.\d+)+)\.tar"
+
+inherit autotools ptest
+
+EXTRA_OECONF = "--disable-openssl"
+
+do_configure_prepend() {
+ if [ ! -e ${S}/acinclude.m4 -a -e ${S}/aclocal.m4 ]; then
+ cp ${S}/aclocal.m4 ${S}/acinclude.m4
+ fi
+}
+
+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/import-layers/yocto-poky/meta/recipes-support/nettle/nettle_2.7.1.bb b/import-layers/yocto-poky/meta/recipes-support/nettle/nettle_2.7.1.bb
new file mode 100644
index 000000000..d4df0a3a8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/nettle/nettle_2.7.1.bb
@@ -0,0 +1,18 @@
+require nettle.inc
+
+LICENSE = "LGPLv2.1 & GPLv2"
+LICENSE_${PN} = "LGPLv2.1+"
+
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+ file://serpent-decrypt.c;beginline=53;endline=67;md5=bcfd4745d53ca57f82907089898e390d \
+ file://serpent-set-key.c;beginline=56;endline=70;md5=bcfd4745d53ca57f82907089898e390d"
+
+SRC_URI[md5sum] = "003d5147911317931dd453520eb234a5"
+SRC_URI[sha256sum] = "bc71ebd43435537d767799e414fce88e521b7278d48c860651216e1fc6555b40"
+
+SRC_URI += "\
+ file://CVE-2015-8803_8805.patch \
+ file://CVE-2015-8804.patch \
+ "
+
+DISABLE_STATIC = ""
diff --git a/import-layers/yocto-poky/meta/recipes-support/nettle/nettle_3.2.bb b/import-layers/yocto-poky/meta/recipes-support/nettle/nettle_3.2.bb
new file mode 100644
index 000000000..2b7977974
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/nettle/nettle_3.2.bb
@@ -0,0 +1,11 @@
+require nettle.inc
+
+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"
+
+SRC_URI[md5sum] = "afb15b4764ebf1b4e6d06c62bd4d29e4"
+SRC_URI[sha256sum] = "ea4283def236413edab5a4cf9cf32adf540c8df1b9b67641cfc2302fca849d97"
diff --git a/import-layers/yocto-poky/meta/recipes-support/npth/npth/pkgconfig.patch b/import-layers/yocto-poky/meta/recipes-support/npth/npth/pkgconfig.patch
new file mode 100644
index 000000000..b6a12e730
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/npth/npth_1.2.bb b/import-layers/yocto-poky/meta/recipes-support/npth/npth_1.2.bb
new file mode 100644
index 000000000..1b3962e64
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/npth/npth_1.2.bb
@@ -0,0 +1,21 @@
+SUMMARY = "New GNU Portable Threads library"
+HOMEPAGE = "http://www.gnupg.org/software/pth/"
+SECTION = "libs"
+LICENSE = "LGPLv3+ & GPLv2+"
+LIC_FILES_CHKSUM = "\
+ file://COPYING;md5=751419260aa954499f7abaabaa882bbe\
+ file://COPYING.LESSER;md5=6a6a8e020838b23406c81b19c1d46df6\
+ "
+SRC_URI = "ftp://ftp.gnupg.org/gcrypt/npth/npth-${PV}.tar.bz2 \
+ file://pkgconfig.patch \
+ "
+
+SRC_URI[md5sum] = "226bac7374b9466c6ec26b1c34dab844"
+SRC_URI[sha256sum] = "6ddbdddb2cf49a4723f9d1ad6563c480d6760dcb63cb7726b8fc3bc2e1b6c08a"
+
+BINCONFIG = "${bindir}/npth-config"
+
+inherit autotools binconfig-disabled
+
+FILES_${PN} = "${libdir}/libnpth.so.*"
+FILES_${PN}-dev += "${bindir}/npth-config"
diff --git a/import-layers/yocto-poky/meta/recipes-support/nspr/nspr/0002-Add-nios2-support.patch b/import-layers/yocto-poky/meta/recipes-support/nspr/nspr/0002-Add-nios2-support.patch
new file mode 100644
index 000000000..23228067e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/nspr/nspr/fix-build-on-x86_64.patch b/import-layers/yocto-poky/meta/recipes-support/nspr/nspr/fix-build-on-x86_64.patch
new file mode 100644
index 000000000..c2b7258e5
--- /dev/null
+++ b/import-layers/yocto-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
+ ;;
+ m68k)
diff --git a/import-layers/yocto-poky/meta/recipes-support/nspr/nspr/nspr.pc.in b/import-layers/yocto-poky/meta/recipes-support/nspr/nspr/nspr.pc.in
new file mode 100644
index 000000000..c37d0bcbd
--- /dev/null
+++ b/import-layers/yocto-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: 4.9.5
+Libs: -L${libdir} -lplds4 -lplc4 -lnspr4 -lpthread -ldl
+Cflags:
diff --git a/import-layers/yocto-poky/meta/recipes-support/nspr/nspr/remove-rpath-from-tests.patch b/import-layers/yocto-poky/meta/recipes-support/nspr/nspr/remove-rpath-from-tests.patch
new file mode 100644
index 000000000..a7e7853de
--- /dev/null
+++ b/import-layers/yocto-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-4.8.9/mozilla/nsprpub/pr/tests/Makefile.in
+===================================================================
+--- nsprpub.orig/pr/tests/Makefile.in 2012-02-11 00:01:10.476220505 +0200
++++ nsprpub/pr/tests/Makefile.in 2012-02-10 23:57:40.000000000 +0200
+@@ -379,7 +379,7 @@
+ endif
+
+ 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/import-layers/yocto-poky/meta/recipes-support/nspr/nspr/remove-srcdir-from-configure-in.patch b/import-layers/yocto-poky/meta/recipes-support/nspr/nspr/remove-srcdir-from-configure-in.patch
new file mode 100644
index 000000000..bde715c5d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/nspr/nspr_4.12.bb b/import-layers/yocto-poky/meta/recipes-support/nspr/nspr_4.12.bb
new file mode 100644
index 000000000..168341bc0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/nspr/nspr_4.12.bb
@@ -0,0 +1,181 @@
+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://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'"
+
+UPSTREAM_CHECK_URI = "http://ftp.mozilla.org/pub/nspr/releases/"
+UPSTREAM_CHECK_REGEX = "v(?P<pver>\d+(\.\d+)+)/"
+
+SRC_URI[md5sum] = "0de760c1e00a92e180e611cf06ce9589"
+SRC_URI[sha256sum] = "e0b10a1e569153668ff8bdea6c7e491b389fab69c2f18285a1ebf7c2ea4269de"
+
+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
+
+do_compile_prepend() {
+ oe_runmake CROSS_COMPILE=1 CFLAGS="-DXP_UNIX" LDFLAGS="" CC=gcc -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 s:OEPREFIX:${prefix}:g ${D}${libdir}/pkgconfig/nspr.pc
+ sed -i s:OELIBDIR:${libdir}:g ${D}${libdir}/pkgconfig/nspr.pc
+ sed -i s:OEINCDIR:${includedir}:g ${D}${libdir}/pkgconfig/nspr.pc
+ sed -i 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/import-layers/yocto-poky/meta/recipes-support/nss-myhostname/nss-myhostname/0001-nss-myhostname-Check-for-nss.h-presense-before-use.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/nss-myhostname/nss-myhostname_0.3.bb b/import-layers/yocto-poky/meta/recipes-support/nss-myhostname/nss-myhostname_0.3.bb
new file mode 100644
index 000000000..de5b7cf59
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/nss/nss/0001-Fix-build-failure-on-opensuse-13.1.patch b/import-layers/yocto-poky/meta/recipes-support/nss/nss/0001-Fix-build-failure-on-opensuse-13.1.patch
new file mode 100644
index 000000000..cb3ad0068
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/nss/nss/0001-Fix-build-failure-on-opensuse-13.1.patch
@@ -0,0 +1,27 @@
+From 8758c6a4508a5ca01505a8d69a269c912ce10bee Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Mon, 18 Jan 2016 18:26:16 +0000
+Subject: [PATCH] Fix build failure on opensuse 13.1
+
+Upstream-Status: Inappropriate [gcc 4.8 specific issue]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ nss/cmd/modutil/install-ds.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/nss/cmd/modutil/install-ds.h b/nss/cmd/modutil/install-ds.h
+index 3a3afb3..433efe0 100644
+--- a/nss/cmd/modutil/install-ds.h
++++ b/nss/cmd/modutil/install-ds.h
+@@ -243,7 +243,7 @@ struct Pk11Install_Info_str {
+ Pk11Install_Info*
+ Pk11Install_Info_new();
+ void
+-Pk11Install_Info_init();
++Pk11Install_Info_init(Pk11Install_Info* _this);
+ void
+ Pk11Install_Info_delete(Pk11Install_Info* _this);
+ /*// Returns NULL for success, error message if parse error.*/
+--
+1.8.4.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/nss/nss/nss-fix-incorrect-shebang-of-perl.patch b/import-layers/yocto-poky/meta/recipes-support/nss/nss/nss-fix-incorrect-shebang-of-perl.patch
new file mode 100644
index 000000000..547594d5b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/nss/nss/nss-fix-nsinstall-build.patch b/import-layers/yocto-poky/meta/recipes-support/nss/nss/nss-fix-nsinstall-build.patch
new file mode 100644
index 000000000..866de07ea
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/nss/nss/nss-fix-nsinstall-build.patch
@@ -0,0 +1,35 @@
+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>
+===================================================
+diff --git a/nss/coreconf/nsinstall/Makefile b/nss/coreconf/nsinstall/Makefile
+index 1850bcb..5aee84f 100644
+--- a/nss/coreconf/nsinstall/Makefile
++++ b/nss/coreconf/nsinstall/Makefile
+@@ -18,6 +18,12 @@ 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 =
++
+ ifeq (,$(filter-out OS2 WIN%,$(OS_TARGET)))
+ PROGRAM =
+ else
diff --git a/import-layers/yocto-poky/meta/recipes-support/nss/nss/nss-fix-support-cross-compiling.patch b/import-layers/yocto-poky/meta/recipes-support/nss/nss/nss-fix-support-cross-compiling.patch
new file mode 100644
index 000000000..f0b3550bf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/nss/nss/nss-fix-support-cross-compiling.patch
@@ -0,0 +1,71 @@
+nss: fix support cross compiling
+
+Let some make variables be assigned from outside makefile.
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Upstream-Status: Inappropriate [configuration]
+---
+ nss/coreconf/Linux.mk | 12 +++++++++++-
+ nss/coreconf/arch.mk | 2 +-
+ nss/lib/freebl/Makefile | 6 ++++++
+ 3 files changed, 18 insertions(+), 2 deletions(-)
+
+diff --git a/nss/coreconf/Linux.mk b/nss/coreconf/Linux.mk
+--- a/nss/coreconf/Linux.mk
++++ b/nss/coreconf/Linux.mk
+@@ -16,11 +16,21 @@ ifeq ($(USE_PTHREADS),1)
+ IMPL_STRATEGY = _PTH
+ endif
+
++ifndef CC
+ CC = gcc
++endif
++
++ifdef CXX
++CCC = $(CXX)
++else
+ CCC = g++
++endif
++
++ifndef RANLIB
+ RANLIB = ranlib
++endif
+
+-DEFAULT_COMPILER = gcc
++DEFAULT_COMPILER = $(CC)
+
+ ifeq ($(OS_TARGET),Android)
+ ifndef ANDROID_NDK
+diff --git a/nss/coreconf/arch.mk b/nss/coreconf/arch.mk
+index 6557348..b722412 100644
+--- a/nss/coreconf/arch.mk
++++ b/nss/coreconf/arch.mk
+@@ -37,7 +37,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 0d293f1..678f506 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
+--
+1.8.1.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/nss/nss/nss-no-rpath-for-cross-compiling.patch b/import-layers/yocto-poky/meta/recipes-support/nss/nss/nss-no-rpath-for-cross-compiling.patch
new file mode 100644
index 000000000..7661dc93a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/nss/nss/nss.pc.in b/import-layers/yocto-poky/meta/recipes-support/nss/nss/nss.pc.in
new file mode 100644
index 000000000..200f635c6
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/nss/nss/signlibs.sh b/import-layers/yocto-poky/meta/recipes-support/nss/nss/signlibs.sh
new file mode 100644
index 000000000..a74e499f8
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/nss/nss_3.21.bb b/import-layers/yocto-poky/meta/recipes-support/nss/nss_3.21.bb
new file mode 100644
index 000000000..d2e24112d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/nss/nss_3.21.bb
@@ -0,0 +1,240 @@
+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"
+
+SRC_URI = "\
+ http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_21_RTM/src/${BP}.tar.gz \
+ file://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://0001-Fix-build-failure-on-opensuse-13.1.patch \
+ file://nss.pc.in \
+ file://signlibs.sh \
+"
+
+SRC_URI[md5sum] = "3c8b2ed880dd3a8d86c9e0151afe6eba"
+SRC_URI[sha256sum] = "3f7a5b027d7cdd5c0e4ff7544da33fdc6f56c2f8c27fff02938fd4a6fbe87239"
+
+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}
+}
+
+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="gcc"
+ 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!
+ #
+ export CC="${CC} -g"
+ make -C ./nss CCC="${CXX} -g" \
+ OS_TEST=${OS_TEST} \
+ RPATH="${RPATH}"
+}
+
+
+do_install_prepend_class-nativesdk() {
+ export LDFLAGS=""
+}
+
+do_install() {
+ export CROSS_COMPILE=1
+ export NATIVE_CC="gcc"
+ 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_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
+}
+
+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
+ exit 0
+ fi
+ signlibs.sh
+}
+
+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/import-layers/yocto-poky/meta/recipes-support/p11-kit/p11-kit_0.22.1.bb b/import-layers/yocto-poky/meta/recipes-support/p11-kit/p11-kit_0.22.1.bb
new file mode 100644
index 000000000..a4efff161
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/p11-kit/p11-kit_0.22.1.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Provides a way to load and enumerate PKCS#11 modules"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=02933887f609807fbb57aa4237d14a50"
+
+inherit autotools gettext pkgconfig upstream-version-is-even
+
+DEPENDS = "libtasn1 libffi"
+
+SRC_URI = "http://p11-glue.freedesktop.org/releases/${BP}.tar.gz"
+SRC_URI[md5sum] = "4e9bea1106628ffb820bdad24a819fac"
+SRC_URI[sha256sum] = "ef3a339fcf6aa0e32c8c23f79ba7191e57312be2bda8b24e6d121c2670539a5c"
+
+EXTRA_OECONF = "--without-trust-paths"
+
+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/import-layers/yocto-poky/meta/recipes-support/pinentry/pinentry_0.9.2.bb b/import-layers/yocto-poky/meta/recipes-support/pinentry/pinentry_0.9.2.bb
new file mode 100644
index 000000000..d6b713020
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/pinentry/pinentry_0.9.2.bb
@@ -0,0 +1,33 @@
+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
+
+DEPENDS = "gettext-native"
+
+SRC_URI = "ftp://ftp.gnupg.org/gcrypt/${BPN}/${BPN}-${PV}.tar.bz2"
+
+SRC_URI[md5sum] = "f51d454f921111b5156a2291cbf70278"
+SRC_URI[sha256sum] = "fd8bc1592ceb22bb492b07cb29b1b140bb882c859e6503b974254c0a4b4134d1"
+
+EXTRA_OECONF = "--disable-rpath \
+ --disable-dependency-tracking \
+ "
+
+PACKAGECONFIG ??= "ncurses libcap"
+
+PACKAGECONFIG[ncurses] = "--enable-ncurses --with-ncurses-include-dir=${STAGING_INCDIR}, --disable-ncurses, ncurses"
+PACKAGECONFIG[libcap] = "--with-libcap, --without-libcap, libcap"
+PACKAGECONFIG[qt4] = "--enable-pinentry-qt4, --disable-pinentry-qt4, qt4-x11"
+PACKAGECONFIG[qt4_clipboard] = "--enable-pinentry-qt4-clipboard --enable-pinentry-qt4, --disable-pinentry-qt4-clipboard, 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"
diff --git a/import-layers/yocto-poky/meta/recipes-support/popt/popt/disable_tests.patch b/import-layers/yocto-poky/meta/recipes-support/popt/popt/disable_tests.patch
new file mode 100644
index 000000000..016cf66a2
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/popt/popt/pkgconfig_fix.patch b/import-layers/yocto-poky/meta/recipes-support/popt/popt/pkgconfig_fix.patch
new file mode 100644
index 000000000..0bddbf8c9
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/popt/popt/popt_fix_for_automake-1.12.patch b/import-layers/yocto-poky/meta/recipes-support/popt/popt/popt_fix_for_automake-1.12.patch
new file mode 100644
index 000000000..91bca96a5
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/popt/popt_1.16.bb b/import-layers/yocto-poky/meta/recipes-support/popt/popt_1.16.bb
new file mode 100644
index 000000000..cb13a815e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/popt/popt_1.16.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Library for parsing command line options"
+HOMEPAGE = "http://rpm5.org/"
+SECTION = "libs"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=cb0613c30af2a8249b8dcc67d3edb06d"
+PR = "r3"
+
+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/import-layers/yocto-poky/meta/recipes-support/ptest-runner/ptest-runner_2.0.bb b/import-layers/yocto-poky/meta/recipes-support/ptest-runner/ptest-runner_2.0.bb
new file mode 100644
index 000000000..7081afbeb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/ptest-runner/ptest-runner_2.0.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 = "8bfdf946e784f4d5757bebee1fbc4b4a3d7a95c4"
+PV = "2.0+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 ${WORKDIR}/git/ptest-runner ${D}${bindir}/ptest-runner
+}
diff --git a/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/0001-If-the-libc-is-lacking-argp-use-libargp.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/0002-Add-argument-to-control-the-libargp-dependency.patch b/import-layers/yocto-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/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/default b/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/default
new file mode 100644
index 000000000..7aede9be0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/default
@@ -0,0 +1,3 @@
+# Specify rng device
+#RNG_DEVICE=/dev/hwrng
+RNG_DEVICE=/dev/urandom
diff --git a/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/init b/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/init
new file mode 100644
index 000000000..7cf78393a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/uclibc-libuargp-configure.patch b/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/uclibc-libuargp-configure.patch
new file mode 100644
index 000000000..e691315d1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/uclibc-libuargp-configure.patch
@@ -0,0 +1,63 @@
+In case of uclibc, use libuargp
+
+If we use uclibc for system libraries, select libuargp
+
+Upstream-Status: Pending
+
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+diff -Naur rng-tools-5-orig/configure.ac rng-tools-5/configure.ac
+--- rng-tools-5-orig/configure.ac 2016-02-24 18:11:24.023690235 +0200
++++ rng-tools-5/configure.ac 2016-02-24 18:14:49.763118138 +0200
+@@ -39,6 +39,13 @@
+ [with_libargp=check]
+ )
+
++AC_ARG_ENABLE([uclibc],
++ AS_HELP_STRING([--enable-uclibc], [Use uclibc for system libraries]),
++ use_uclibc=yes, use_uclibc=no)
++AM_CONDITIONAL(USE_UCLIBC, test "x$use_uclibc" = "xyes")
++AS_IF([test "x$use_uclibc" = "xyes"], [AC_DEFINE(USE_UCLIBC)])
++AH_TEMPLATE([USE_UCLIBC], [Defined if uclibc libraries are used.])
++
+ dnl Make sure anyone changing configure.ac/Makefile.am has a clue
+ AM_MAINTAINER_MODE
+
+@@ -101,7 +108,7 @@
+ [need_libargp=no],
+ [need_libargp=yes
+ if test "x$with_libargp" = "xno"; then
+- AC_MSG_FAILURE([libargp disabled and libc does not have argp])
++ AC_MSG_WARN([libargp disabled and libc does not have argp])
+ fi]
+ )
+ ],
+@@ -110,7 +117,7 @@
+
+ dnl Check for libargp
+ AS_IF(
+- [test "x$need_libargp" = "xyes"],
++ [test "x$need_libargp" = "xyes" -a "x$use_uclibc" = "xno"],
+ [
+ AC_CHECK_LIB(
+ [argp],
+@@ -120,6 +127,19 @@
+ )
+ ]
+ )
++
++dnl Check for libuargp
++AS_IF(
++ [test "x$use_uclibc" = "xyes"],
++ [
++ AC_CHECK_LIB(
++ [uargp],
++ [argp_parse],
++ [LIBS="$LIBS -luargp"],
++ [AC_MSG_FAILURE([libuargp not found])]
++ )
++ ]
++)
+
+ dnl -----------------
+ dnl Configure options
diff --git a/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/underquote.patch b/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/underquote.patch
new file mode 100644
index 000000000..142257181
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools/underquote.patch
@@ -0,0 +1,31 @@
+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
+
+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/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools_5.bb b/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools_5.bb
new file mode 100644
index 000000000..913a092fd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/rng-tools/rng-tools_5.bb
@@ -0,0 +1,46 @@
+SUMMARY = "Random number generator daemon"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0b6f033afe6db235e559456585dc8cdc"
+
+SRC_URI = "http://heanet.dl.sourceforge.net/sourceforge/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://uclibc-libuargp-configure.patch \
+ file://init \
+ file://default"
+
+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
+
+PACKAGECONFIG = "libgcrypt"
+PACKAGECONFIG_libc-musl = "libargp"
+PACKAGECONFIG_libc-uclibc = "libuargp"
+PACKAGECONFIG[libargp] = "--with-libargp,--without-libargp,argp-standalone,"
+PACKAGECONFIG[libuargp] = "--enable-uclibc,,,"
+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
+}
+
+INITSCRIPT_NAME = "rng-tools"
+INITSCRIPT_PARAMS = "start 30 2 3 4 5 . stop 30 0 6 1 ."
diff --git a/import-layers/yocto-poky/meta/recipes-support/serf/serf/env.patch b/import-layers/yocto-poky/meta/recipes-support/serf/serf/env.patch
new file mode 100644
index 000000000..9d073e9ab
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/serf/serf/norpath.patch b/import-layers/yocto-poky/meta/recipes-support/serf/serf/norpath.patch
new file mode 100644
index 000000000..380f5d00d
--- /dev/null
+++ b/import-layers/yocto-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.6/SConstruct
+===================================================================
+--- serf-1.3.6.orig/SConstruct 2014-07-17 19:57:57.724389150 +0000
++++ serf-1.3.6/SConstruct 2014-07-17 20:04:21.784399616 +0000
+@@ -218,8 +218,7 @@
+ else:
+ LIBNAMESTATIC = 'serf-${MAJOR}'
+
+-env.Append(RPATH=libdir,
+- PDB='${TARGET.filebase}.pdb')
++env.Append(PDB='${TARGET.filebase}.pdb')
+
+ #for i in env:
+ # print(str(env[i]))
+@@ -371,12 +370,6 @@
+ 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'),
+@@ -446,7 +439,6 @@
+ ENV={'PATH' : os.environ['PATH']}))
+
+ # Find the (dynamic) library in this directory
+-tenv.Replace(RPATH=thisdir)
+ tenv.Prepend(LIBS=[LIBNAMESTATIC, ],
+ LIBPATH=[thisdir, ])
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/serf/serf_1.3.8.bb b/import-layers/yocto-poky/meta/recipes-support/serf/serf_1.3.8.bb
new file mode 100644
index 000000000..b5059d546
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/serf/serf_1.3.8.bb
@@ -0,0 +1,26 @@
+SUMMARY = "High-Performance Asynchronous HTTP Client Library"
+SRC_URI = "${DEBIAN_MIRROR}/main/s/${BPN}/${BPN}_${PV}.orig.tar.gz \
+ file://norpath.patch \
+ file://env.patch"
+
+SRC_URI[md5sum] = "713beaf05d7f3329de121e218e2fcb93"
+SRC_URI[sha256sum] = "77134cd5010664ca023585bce50978bd4005906ed280ff889f591f86df7c59e4"
+
+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/import-layers/yocto-poky/meta/recipes-support/shared-mime-info/shared-mime-info.inc b/import-layers/yocto-poky/meta/recipes-support/shared-mime-info/shared-mime-info.inc
new file mode 100644
index 000000000..6eedb6d3f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/shared-mime-info/shared-mime-info.inc
@@ -0,0 +1,36 @@
+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"
+DEPENDS_class-native = "libxml2-native intltool-native glib-2.0-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"
diff --git a/import-layers/yocto-poky/meta/recipes-support/shared-mime-info/shared-mime-info/install-data-hook.patch b/import-layers/yocto-poky/meta/recipes-support/shared-mime-info/shared-mime-info/install-data-hook.patch
new file mode 100644
index 000000000..3c9f1ea43
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/shared-mime-info/shared-mime-info/install-data-hook.patch
@@ -0,0 +1,23 @@
+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>
+
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -44,7 +44,9 @@ $(pkgconfig_DATA): config.status
+ @INTLTOOL_XML_RULE@
+ @INTLTOOL_DESKTOP_RULE@
+
+-install-data-hook: install-binPROGRAMS
++# do NOT make this dependent on anything!
++#
++install-data-hook:
+ if ENABLE_UPDATE_MIMEDB
+ $(DESTDIR)"$(bindir)/update-mime-database" -V "$(DESTDIR)$(datadir)/mime"
+ endif
diff --git a/import-layers/yocto-poky/meta/recipes-support/shared-mime-info/shared-mime-info/parallelmake.patch b/import-layers/yocto-poky/meta/recipes-support/shared-mime-info/shared-mime-info/parallelmake.patch
new file mode 100644
index 000000000..84c4d0373
--- /dev/null
+++ b/import-layers/yocto-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.0/Makefile.am
+===================================================================
+--- shared-mime-info-1.0.orig/Makefile.am
++++ shared-mime-info-1.0/Makefile.am
+@@ -1,5 +1,3 @@
+-SUBDIRS=. po
+-
+ AM_CPPFLAGS = $(ALL_CFLAGS)
+
+ packagesdir = $(datadir)/mime/packages
+@@ -72,8 +70,7 @@ uninstall-hook:
+
+ all: $(defaultmakedeps)
+
+-create-pot:
+- $(AM_V_GEN) $(MAKE) -C po shared-mime-info.pot
++create-pot: po
+
+ check: create-pot freedesktop.org.xml update-mime-database check-translations
+ if test -e $(top_builddir)/freedesktop.org.xml; then \
diff --git a/import-layers/yocto-poky/meta/recipes-support/shared-mime-info/shared-mime-info_1.6.bb b/import-layers/yocto-poky/meta/recipes-support/shared-mime-info/shared-mime-info_1.6.bb
new file mode 100644
index 000000000..2cf50414c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/shared-mime-info/shared-mime-info_1.6.bb
@@ -0,0 +1,7 @@
+require shared-mime-info.inc
+
+SRC_URI += "file://parallelmake.patch \
+ file://install-data-hook.patch"
+
+SRC_URI[md5sum] = "10abc5c4e6b22223ff05c3bd70ff9e8f"
+SRC_URI[sha256sum] = "b2f8f85b6467933824180d0252bbcaee523f550a8fbc95cc4391bd43c03bc34c"
diff --git a/import-layers/yocto-poky/meta/recipes-support/sqlite/sqlite3.inc b/import-layers/yocto-poky/meta/recipes-support/sqlite/sqlite3.inc
new file mode 100644
index 000000000..5bff33b85
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/sqlite/sqlite3.inc
@@ -0,0 +1,53 @@
+SUMMARY = "Embeddable SQL database engine"
+HOMEPAGE = "http://www.sqlite.org"
+SECTION = "libs"
+
+PE = "3"
+
+def sqlite_download_version(d):
+ pvsplit = d.getVar('PV', True).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"
+
+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 \
+"
+
+# 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/import-layers/yocto-poky/meta/recipes-support/sqlite/sqlite3/fix-disable-static-shell.patch b/import-layers/yocto-poky/meta/recipes-support/sqlite/sqlite3/fix-disable-static-shell.patch
new file mode 100644
index 000000000..6f39ae266
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/sqlite/sqlite3/fix-disable-static-shell.patch
@@ -0,0 +1,61 @@
+From ede5db83e38cc8ad8c9be291cd8985f7ad99f291 Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Tue, 16 Feb 2016 14:00:00 -0800
+Subject: [PATCH] fix --disable-static-shell
+
+Upstream sqlite seems to be moving further and further away from
+allowing the sqlite3 command line tool to be dynamically linked with
+sqlite.
+
+The --disable-static-shell configure option added in 3.10.0 no longer
+has any effect in 3.11.0. For now patch things up and make it work.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ Makefile.am | 13 +++++++++++--
+ configure.ac | 2 +-
+ 2 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 0e09cfc..608c0fd 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -6,9 +6,18 @@ libsqlite3_la_SOURCES = sqlite3.c
+ libsqlite3_la_LDFLAGS = -no-undefined -version-info 8:6:8
+
+ bin_PROGRAMS = sqlite3
+-sqlite3_SOURCES = shell.c sqlite3.c sqlite3.h
+-sqlite3_LDADD = @READLINE_LIBS@
++sqlite3_SOURCES = shell.c sqlite3.h
++EXTRA_sqlite3_SOURCES = sqlite3.c
++sqlite3_LDADD = @EXTRA_SHELL_OBJ@ @READLINE_LIBS@
+ sqlite3_DEPENDENCIES = @EXTRA_SHELL_OBJ@
++
++# Warning: Adding SQLITE_ENABLE_EXPLAIN_COMMENTS to sqlite3_CFLAGS doesn't
++# actually have any effect if we link the sqlite3 command line tool with the
++# libsqlite3.so shared library (which will contain a version of sqlite3.c
++# compiled with the default AM_CFLAGS above). If SQLITE_ENABLE_EXPLAIN_COMMENTS
++# debug is required, then sqlite3 must not be configured with
++# --disable-static-shell
++
+ sqlite3_CFLAGS = $(AM_CFLAGS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS
+
+ include_HEADERS = sqlite3.h sqlite3ext.h
+diff --git a/configure.ac b/configure.ac
+index 8e7fd69..ada559e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -130,7 +130,7 @@ AC_ARG_ENABLE(static-shell, [AS_HELP_STRING(
+ [statically link libsqlite3 into shell tool [default=yes]])],
+ [], [enable_static_shell=yes])
+ if test x"$enable_static_shell" == "xyes"; then
+- EXTRA_SHELL_OBJ=sqlite3.$OBJEXT
++ EXTRA_SHELL_OBJ=sqlite3-sqlite3.$OBJEXT
+ else
+ EXTRA_SHELL_OBJ=libsqlite3.la
+ fi
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/sqlite/sqlite3_3.11.0.bb b/import-layers/yocto-poky/meta/recipes-support/sqlite/sqlite3_3.11.0.bb
new file mode 100644
index 000000000..992d20cd5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/sqlite/sqlite3_3.11.0.bb
@@ -0,0 +1,11 @@
+require sqlite3.inc
+
+LICENSE = "PD"
+LIC_FILES_CHKSUM = "file://sqlite3.h;endline=11;md5=65f0a57ca6928710b418c094b3570bb0"
+
+SRC_URI = "http://www.sqlite.org/2016/sqlite-autoconf-${SQLITE_PV}.tar.gz \
+ file://fix-disable-static-shell.patch \
+"
+
+SRC_URI[md5sum] = "a6cdc3e0a6e5087d620037ae0c48720d"
+SRC_URI[sha256sum] = "508d4dcbcf7a7181e95c717a1dc4ae3c0880b3d593be0c4b40abb6c3a0e201fb"
diff --git a/import-layers/yocto-poky/meta/recipes-support/taglib/taglib_1.9.1.bb b/import-layers/yocto-poky/meta/recipes-support/taglib/taglib_1.9.1.bb
new file mode 100644
index 000000000..d125308cc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/taglib/taglib_1.9.1.bb
@@ -0,0 +1,32 @@
+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"
+SRC_URI[md5sum] = "0d35df96822bbd564c5504cb3c2e4d86"
+SRC_URI[sha256sum] = "72d371cd1419a87ae200447a53bff2be219283071e80fd12337928cc967dc71a"
+
+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 = "-DLIB_SUFFIX=${@d.getVar('baselib', True).replace('lib', '')}"
+
+do_configure_prepend () {
+ rm -f ${S}/admin/ltmain.sh
+ rm -f ${S}/admin/libtool.m4.in
+ # Don't have a floating dependeny on boost
+ sed -i -e "s/atomic.hpp/atomic-not-exist.hpp/" ${S}/ConfigureChecks.cmake ${S}/taglib/toolkit/trefcounter.cpp
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/user-creation/files/system-xuser.conf b/import-layers/yocto-poky/meta/recipes-support/user-creation/files/system-xuser.conf
new file mode 100644
index 000000000..d42e3d1f5
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/recipes-support/user-creation/xuser-account_0.1.bb b/import-layers/yocto-poky/meta/recipes-support/user-creation/xuser-account_0.1.bb
new file mode 100644
index 000000000..13ba67733
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/user-creation/xuser-account_0.1.bb
@@ -0,0 +1,29 @@
+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}"
+GROUPADD_PARAM_${PN} = "--system shutdown"
+USERADD_PARAM_${PN} = "--create-home \
+ --groups video,tty,audio,input,shutdown,disk \
+ --user-group xuser"
+
+ALLOW_EMPTY_${PN} = "1"
diff --git a/import-layers/yocto-poky/meta/recipes-support/vte/vte-0.28.2/cve-2012-2738.patch b/import-layers/yocto-poky/meta/recipes-support/vte/vte-0.28.2/cve-2012-2738.patch
new file mode 100644
index 000000000..9b9980397
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/vte/vte-0.28.2/cve-2012-2738.patch
@@ -0,0 +1,136 @@
+Upstream-Status: Backport
+CVE: CVE-2012-2738
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From e524b0b3bd8fad844ffa73927c199545b892cdbd Mon Sep 17 00:00:00 2001
+From: Christian Persch <chpe@gnome.org>
+Date: Sat, 19 May 2012 19:36:09 +0200
+Subject: [PATCH 1/2] emulation: Limit integer arguments to 65535
+
+To guard against malicious sequences containing excessively big numbers,
+limit all parsed numbers to 16 bit range. Doing this here in the parsing
+routine is a catch-all guard; this doesn't preclude enforcing
+more stringent limits in the handlers themselves.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=676090
+---
+ src/table.c | 2 +-
+ src/vteseq.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/table.c b/src/table.c
+index 140e8c8..85cf631 100644
+--- a/src/table.c
++++ b/src/table.c
+@@ -550,7 +550,7 @@ _vte_table_extract_numbers(GValueArray **array,
+ if (G_UNLIKELY (*array == NULL)) {
+ *array = g_value_array_new(1);
+ }
+- g_value_set_long(&value, total);
++ g_value_set_long(&value, CLAMP (total, 0, G_MAXUSHORT));
+ g_value_array_append(*array, &value);
+ } while (i++ < arginfo->length);
+ g_value_unset(&value);
+diff --git a/src/vteseq.c b/src/vteseq.c
+index 7ef4c8c..10991db 100644
+--- a/src/vteseq.c
++++ b/src/vteseq.c
+@@ -557,7 +557,7 @@ vte_sequence_handler_multiple(VteTerminal *terminal,
+ GValueArray *params,
+ VteTerminalSequenceHandler handler)
+ {
+- vte_sequence_handler_multiple_limited(terminal, params, handler, G_MAXLONG);
++ vte_sequence_handler_multiple_limited(terminal, params, handler, G_MAXUSHORT);
+ }
+
+ static void
+--
+2.4.9 (Apple Git-60)
+
+
+From cf1ad453a8def873c49cf6d88162593402f32bb2 Mon Sep 17 00:00:00 2001
+From: Christian Persch <chpe@gnome.org>
+Date: Sat, 19 May 2012 20:04:12 +0200
+Subject: [PATCH 2/2] emulation: Limit repetitions
+
+Don't allow malicious sequences to cause excessive repetitions.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=676090
+---
+ src/vteseq.c | 25 ++++++++++++++++++-------
+ 1 file changed, 18 insertions(+), 7 deletions(-)
+
+diff --git a/src/vteseq.c b/src/vteseq.c
+index 10991db..209522f 100644
+--- a/src/vteseq.c
++++ b/src/vteseq.c
+@@ -1392,7 +1392,7 @@ vte_sequence_handler_dc (VteTerminal *terminal, GValueArray *params)
+ static void
+ vte_sequence_handler_DC (VteTerminal *terminal, GValueArray *params)
+ {
+- vte_sequence_handler_multiple(terminal, params, vte_sequence_handler_dc);
++ vte_sequence_handler_multiple_r(terminal, params, vte_sequence_handler_dc);
+ }
+
+ /* Delete a line at the current cursor position. */
+@@ -1785,7 +1785,7 @@ vte_sequence_handler_reverse_index (VteTerminal *terminal, GValueArray *params)
+ static void
+ vte_sequence_handler_RI (VteTerminal *terminal, GValueArray *params)
+ {
+- vte_sequence_handler_multiple(terminal, params, vte_sequence_handler_nd);
++ vte_sequence_handler_multiple_r(terminal, params, vte_sequence_handler_nd);
+ }
+
+ /* Save cursor (position). */
+@@ -2777,8 +2777,7 @@ vte_sequence_handler_insert_lines (VteTerminal *terminal, GValueArray *params)
+ {
+ GValue *value;
+ VteScreen *screen;
+- long param, end, row;
+- int i;
++ long param, end, row, i, limit;
+ screen = terminal->pvt->screen;
+ /* The default is one. */
+ param = 1;
+@@ -2796,7 +2795,13 @@ vte_sequence_handler_insert_lines (VteTerminal *terminal, GValueArray *params)
+ } else {
+ end = screen->insert_delta + terminal->row_count - 1;
+ }
+- /* Insert the new lines at the cursor. */
++
++ /* Only allow to insert as many lines as there are between this row
++ * and the end of the scrolling region. See bug #676090.
++ */
++ limit = end - row + 1;
++ param = MIN (param, limit);
++
+ for (i = 0; i < param; i++) {
+ /* Clear a line off the end of the region and add one to the
+ * top of the region. */
+@@ -2817,8 +2822,7 @@ vte_sequence_handler_delete_lines (VteTerminal *terminal, GValueArray *params)
+ {
+ GValue *value;
+ VteScreen *screen;
+- long param, end, row;
+- int i;
++ long param, end, row, i, limit;
+
+ screen = terminal->pvt->screen;
+ /* The default is one. */
+@@ -2837,6 +2841,13 @@ vte_sequence_handler_delete_lines (VteTerminal *terminal, GValueArray *params)
+ } else {
+ end = screen->insert_delta + terminal->row_count - 1;
+ }
++
++ /* Only allow to delete as many lines as there are between this row
++ * and the end of the scrolling region. See bug #676090.
++ */
++ limit = end - row + 1;
++ param = MIN (param, limit);
++
+ /* Clear them from below the current cursor. */
+ for (i = 0; i < param; i++) {
+ /* Insert a line at the end of the region and remove one from
+--
+2.4.9 (Apple Git-60)
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/vte/vte-0.28.2/obsolete_automake_macros.patch b/import-layers/yocto-poky/meta/recipes-support/vte/vte-0.28.2/obsolete_automake_macros.patch
new file mode 100644
index 000000000..6763d3754
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/vte/vte-0.28.2/obsolete_automake_macros.patch
@@ -0,0 +1,14 @@
+Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=691545]
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+diff -Nurd vte-0.28.2/gnome-pty-helper/configure.in vte-0.28.2/gnome-pty-helper/configure.in
+--- vte-0.28.2/gnome-pty-helper/configure.in 2010-07-15 20:08:44.000000000 +0300
++++ vte-0.28.2/gnome-pty-helper/configure.in 2013-01-11 14:50:34.971027440 +0200
+@@ -8,7 +8,6 @@
+ AC_ISC_POSIX
+ AC_PROG_CC
+ AC_STDC_HEADERS
+-AM_PROG_CC_STDC
+
+ if test -z "$enable_maintainer_mode"; then
+ enable_maintainer_mode=yes
diff --git a/import-layers/yocto-poky/meta/recipes-support/vte/vte.inc b/import-layers/yocto-poky/meta/recipes-support/vte/vte.inc
new file mode 100644
index 000000000..8565cc2ad
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/vte/vte.inc
@@ -0,0 +1,15 @@
+SUMMARY = "Virtual terminal emulator GTK+ widget library"
+BUGTRACKER = "https://bugzilla.gnome.org/buglist.cgi?product=vte"
+LICENSE = "LGPLv2.0"
+DEPENDS = " glib-2.0 gtk+ intltool-native ncurses"
+RDEPENDS_libvte = "vte-termcap"
+
+inherit gnome gtk-doc distro_features_check upstream-version-is-even gobject-introspection
+ANY_OF_DISTRO_FEATURES = "${GTK2DISTROFEATURES}"
+
+EXTRA_OECONF = "--disable-python"
+
+PACKAGES =+ "libvte vte-termcap"
+FILES_libvte = "${libdir}/*.so.* ${libexecdir}/gnome-pty-helper"
+FILES_vte-termcap = "${datadir}/vte/termcap-0.0"
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/vte/vte_0.28.2.bb b/import-layers/yocto-poky/meta/recipes-support/vte/vte_0.28.2.bb
new file mode 100644
index 000000000..74087ca83
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/vte/vte_0.28.2.bb
@@ -0,0 +1,16 @@
+require vte.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7"
+
+PR = "r6"
+
+SRC_URI += "file://obsolete_automake_macros.patch \
+ file://cve-2012-2738.patch \
+ "
+
+CFLAGS += "-D_GNU_SOURCE"
+
+SRC_URI[archive.md5sum] = "497f26e457308649e6ece32b3bb142ff"
+SRC_URI[archive.sha256sum] = "86cf0b81aa023fa93ed415653d51c96767f20b2d7334c893caba71e42654b0ae"
+
+RECIPE_NO_UPDATE_REASON = "matchbox-terminal needs to be ported over to new vte first"
diff --git a/import-layers/yocto-poky/meta/recipes.txt b/import-layers/yocto-poky/meta/recipes.txt
new file mode 100644
index 000000000..9e178d6ce
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/site/arm-32 b/import-layers/yocto-poky/meta/site/arm-32
new file mode 100644
index 000000000..81fd8d310
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/site/arm-64 b/import-layers/yocto-poky/meta/site/arm-64
new file mode 100644
index 000000000..90c09b2d5
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/site/arm-common b/import-layers/yocto-poky/meta/site/arm-common
new file mode 100644
index 000000000..a3c979fe0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/site/arm-common
@@ -0,0 +1,154 @@
+# 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_C99_VSNPRINTF=${rsync_cv_HAVE_C99_VSNPRINTF=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/import-layers/yocto-poky/meta/site/arm-darwin b/import-layers/yocto-poky/meta/site/arm-darwin
new file mode 100644
index 000000000..09ff097aa
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/site/arm-darwin8 b/import-layers/yocto-poky/meta/site/arm-darwin8
new file mode 100644
index 000000000..09ff097aa
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/site/arm-linux b/import-layers/yocto-poky/meta/site/arm-linux
new file mode 100644
index 000000000..e6b9a726f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/site/arm-linux
@@ -0,0 +1,159 @@
+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_bool=${ac_cv_sizeof_bool=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}
+ac_cv_func_mmap_fixed_mapped=${ac_cv_func_mmap_fixed_mapped=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/import-layers/yocto-poky/meta/site/arm-linux-uclibc b/import-layers/yocto-poky/meta/site/arm-linux-uclibc
new file mode 100644
index 000000000..6ae7c6e09
--- /dev/null
+++ b/import-layers/yocto-poky/meta/site/arm-linux-uclibc
@@ -0,0 +1,105 @@
+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_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_FTRUNCATE_NEEDS_ROOT=${samba_cv_FTRUNCATE_NEEDS_ROOT=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=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_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_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_QUOTACTL_4A=${samba_cv_HAVE_QUOTACTL_4A=yes}
+samba_cv_HAVE_ROOT=${samba_cv_HAVE_ROOT=no}
+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=no}
+samba_cv_HAVE_SENDFILE64=${samba_cv_HAVE_SENDFILE64=no}
+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_DIRENT64=${samba_cv_HAVE_STRUCT_DIRENT64=no}
+samba_cv_HAVE_STRUCT_FLOCK64=${samba_cv_HAVE_STRUCT_FLOCK64=yes}
+samba_cv_HAVE_STRUCT_IF_DQBLK=${samba_cv_HAVE_STRUCT_IF_DQBLK=no}
+samba_cv_HAVE_STRUCT_MEM_DQBLK=${samba_cv_HAVE_STRUCT_MEM_DQBLK=no}
+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=no}
+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_REPLACE_GETPASS=${samba_cv_REPLACE_GETPASS=yes}
+samba_cv_REPLACE_INET_NTOA=${samba_cv_REPLACE_INET_NTOA=no}
+samba_cv_RUN_QUOTA_TESTS=${samba_cv_RUN_QUOTA_TESTS=auto}
+samba_cv_SEEKDIR_RETURNS_VOID=${samba_cv_SEEKDIR_RETURNS_VOID=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_SYSQUOTA_FOUND=${samba_cv_SYSQUOTA_FOUND=yes}
+samba_cv_SYSQUOTA_WORKS=${samba_cv_SYSQUOTA_WORKS=yes}
+samba_cv_TRY_QUOTAS=${samba_cv_TRY_QUOTAS=no}
+samba_cv_TRY_SYS_QUOTAS=${samba_cv_TRY_SYS_QUOTAS=no}
+samba_cv_USE_SETRESUID=${samba_cv_USE_SETRESUID=yes}
+samba_cv_WITH_QUOTAS=${samba_cv_WITH_QUOTAS=auto}
+samba_cv_WITH_SYS_QUOTAS=${samba_cv_WITH_SYS_QUOTAS=auto}
+samba_cv_compiler_supports_ll=${samba_cv_compiler_supports_ll=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_unixsocket=${samba_cv_unixsocket=yes}
+samba_cv_volatile=${samba_cv_volatile=yes}
diff --git a/import-layers/yocto-poky/meta/site/armeb-linux b/import-layers/yocto-poky/meta/site/armeb-linux
new file mode 100644
index 000000000..6521ff584
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/site/armeb-linux-uclibc b/import-layers/yocto-poky/meta/site/armeb-linux-uclibc
new file mode 100644
index 000000000..731e857dc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/site/armeb-linux-uclibc
@@ -0,0 +1,38 @@
+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}
diff --git a/import-layers/yocto-poky/meta/site/common b/import-layers/yocto-poky/meta/site/common
new file mode 100644
index 000000000..5ccc14f8c
--- /dev/null
+++ b/import-layers/yocto-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=sed
diff --git a/import-layers/yocto-poky/meta/site/common-darwin b/import-layers/yocto-poky/meta/site/common-darwin
new file mode 100644
index 000000000..7d2d89874
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/site/common-glibc b/import-layers/yocto-poky/meta/site/common-glibc
new file mode 100644
index 000000000..1443f8e52
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/site/common-linux b/import-layers/yocto-poky/meta/site/common-linux
new file mode 100644
index 000000000..0a752a40e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/site/common-linux
@@ -0,0 +1,63 @@
+# 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}
+
+# 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}
diff --git a/import-layers/yocto-poky/meta/site/common-mingw b/import-layers/yocto-poky/meta/site/common-mingw
new file mode 100644
index 000000000..f337c36e7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/site/common-mingw
@@ -0,0 +1,2 @@
+# expat
+ac_cv_func_mmap_fixed_mapped=no
diff --git a/import-layers/yocto-poky/meta/site/common-musl b/import-layers/yocto-poky/meta/site/common-musl
new file mode 100644
index 000000000..26fc10331
--- /dev/null
+++ b/import-layers/yocto-poky/meta/site/common-musl
@@ -0,0 +1,52 @@
+# 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}
+
+# 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/import-layers/yocto-poky/meta/site/common-uclibc b/import-layers/yocto-poky/meta/site/common-uclibc
new file mode 100644
index 000000000..26fc10331
--- /dev/null
+++ b/import-layers/yocto-poky/meta/site/common-uclibc
@@ -0,0 +1,52 @@
+# 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}
+
+# 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/import-layers/yocto-poky/meta/site/endian-big b/import-layers/yocto-poky/meta/site/endian-big
new file mode 100644
index 000000000..b99e96c20
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/site/endian-little b/import-layers/yocto-poky/meta/site/endian-little
new file mode 100644
index 000000000..858db76b3
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/site/ix86-common b/import-layers/yocto-poky/meta/site/ix86-common
new file mode 100644
index 000000000..23b8e8bc2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/site/ix86-common
@@ -0,0 +1,227 @@
+# 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_ino_t=${ac_cv_sizeof_ino_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}
+ac_cv_func_mmap_fixed_mapped=${ac_cv_func_mmap_fixed_mapped=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_C99_VSNPRINTF=${rsync_cv_HAVE_C99_VSNPRINTF=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/import-layers/yocto-poky/meta/site/mips-common b/import-layers/yocto-poky/meta/site/mips-common
new file mode 100644
index 000000000..5858dfb15
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/site/mips-linux b/import-layers/yocto-poky/meta/site/mips-linux
new file mode 100644
index 000000000..72a54f95e
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/site/mips-linux-uclibc b/import-layers/yocto-poky/meta/site/mips-linux-uclibc
new file mode 100644
index 000000000..b23363e15
--- /dev/null
+++ b/import-layers/yocto-poky/meta/site/mips-linux-uclibc
@@ -0,0 +1,80 @@
+# 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/import-layers/yocto-poky/meta/site/mips64-linux b/import-layers/yocto-poky/meta/site/mips64-linux
new file mode 100644
index 000000000..ed0fbbe65
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/site/mips64-linux-uclibc b/import-layers/yocto-poky/meta/site/mips64-linux-uclibc
new file mode 100644
index 000000000..cbba5525f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/site/mips64-linux-uclibc
@@ -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
+
+# 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/import-layers/yocto-poky/meta/site/mips64el-linux b/import-layers/yocto-poky/meta/site/mips64el-linux
new file mode 100644
index 000000000..8b61eb0f3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/site/mips64el-linux
@@ -0,0 +1,82 @@
+# 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
+
+# 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/import-layers/yocto-poky/meta/site/mips64el-linux-uclibc b/import-layers/yocto-poky/meta/site/mips64el-linux-uclibc
new file mode 100644
index 000000000..6a0499d10
--- /dev/null
+++ b/import-layers/yocto-poky/meta/site/mips64el-linux-uclibc
@@ -0,0 +1,108 @@
+# 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
+
+# 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}
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+# samba
+# from samba 3.0.14a on 5/29/2005
+ac_cv_func_memcmp_working=${ac_cv_func_memcmp_working=yes}
+ac_cv_have_asprintf_decl=${ac_cv_have_asprintf_decl=yes}
+ac_cv_have_setresgid_decl=${ac_cv_have_setresgid_decl=yes}
+ac_cv_have_setresuid_decl=${ac_cv_have_setresuid_decl=yes}
+ac_cv_have_vasprintf_decl=${ac_cv_have_vasprintf_decl=yes}
+fu_cv_sys_stat_statvfs64=${fu_cv_sys_stat_statvfs64=yes}
+samba_cv_FTRUNCATE_NEEDS_ROOT=${samba_cv_FTRUNCATE_NEEDS_ROOT=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_READDIR=${samba_cv_HAVE_BROKEN_READDIR=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_EXPLICIT_LARGEFILE_SUPPORT=${samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=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_QUOTACTL_4A=${samba_cv_HAVE_QUOTACTL_4A=yes}
+samba_cv_HAVE_ROOT=${samba_cv_HAVE_ROOT=no}
+samba_cv_HAVE_SECURE_MKSTEMP=${samba_cv_HAVE_SECURE_MKSTEMP=yes}
+samba_cv_HAVE_SENDFILE64=${samba_cv_HAVE_SENDFILE64=yes}
+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_UNSIGNED_CHAR=${samba_cv_HAVE_UNSIGNED_CHAR=no}
+samba_cv_HAVE_WORKING_AF_LOCAL=${samba_cv_HAVE_WORKING_AF_LOCAL=no}
+samba_cv_HAVE_Werror=${samba_cv_HAVE_Werror=yes}
+samba_cv_REALPATH_TAKES_NULL=${samba_cv_REALPATH_TAKES_NULL=no}
+samba_cv_REPLACE_INET_NTOA=${samba_cv_REPLACE_INET_NTOA=no}
+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_NPROC_ONLN=${samba_cv_SYSCONF_SC_NPROC_ONLN=no}
+samba_cv_SYSQUOTA_FOUND=${samba_cv_SYSQUOTA_FOUND=yes}
+samba_cv_SYSQUOTA_WORKS=${samba_cv_SYSQUOTA_WORKS=yes}
+samba_cv_USE_SETRESUID=${samba_cv_USE_SETRESUID=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_sysquotas_file=${samba_cv_sysquotas_file=lib/sysquotas_4A.c}
+# This cached value needs a local patch to pick it up, upstream 3.0.14a
+# doesn't cache it.
+samba_cv_LINUX_LFS_SUPPORT=${samba_cv_LINUX_LFS_SUPPORT=yes}
diff --git a/import-layers/yocto-poky/meta/site/mipsel-linux b/import-layers/yocto-poky/meta/site/mipsel-linux
new file mode 100644
index 000000000..696b1beeb
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/site/mipsel-linux-uclibc b/import-layers/yocto-poky/meta/site/mipsel-linux-uclibc
new file mode 100644
index 000000000..f921cda4a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/site/mipsel-linux-uclibc
@@ -0,0 +1,100 @@
+# 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}
+
+# 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}
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+# samba
+# from samba 3.0.14a on 5/29/2005
+ac_cv_func_memcmp_working=${ac_cv_func_memcmp_working=yes}
+ac_cv_have_asprintf_decl=${ac_cv_have_asprintf_decl=yes}
+ac_cv_have_setresgid_decl=${ac_cv_have_setresgid_decl=yes}
+ac_cv_have_setresuid_decl=${ac_cv_have_setresuid_decl=yes}
+ac_cv_have_vasprintf_decl=${ac_cv_have_vasprintf_decl=yes}
+fu_cv_sys_stat_statvfs64=${fu_cv_sys_stat_statvfs64=yes}
+samba_cv_FTRUNCATE_NEEDS_ROOT=${samba_cv_FTRUNCATE_NEEDS_ROOT=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_READDIR=${samba_cv_HAVE_BROKEN_READDIR=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_EXPLICIT_LARGEFILE_SUPPORT=${samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=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_QUOTACTL_4A=${samba_cv_HAVE_QUOTACTL_4A=yes}
+samba_cv_HAVE_ROOT=${samba_cv_HAVE_ROOT=no}
+samba_cv_HAVE_SECURE_MKSTEMP=${samba_cv_HAVE_SECURE_MKSTEMP=yes}
+samba_cv_HAVE_SENDFILE64=${samba_cv_HAVE_SENDFILE64=yes}
+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_UNSIGNED_CHAR=${samba_cv_HAVE_UNSIGNED_CHAR=no}
+samba_cv_HAVE_WORKING_AF_LOCAL=${samba_cv_HAVE_WORKING_AF_LOCAL=no}
+samba_cv_HAVE_Werror=${samba_cv_HAVE_Werror=yes}
+samba_cv_REALPATH_TAKES_NULL=${samba_cv_REALPATH_TAKES_NULL=no}
+samba_cv_REPLACE_INET_NTOA=${samba_cv_REPLACE_INET_NTOA=no}
+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_NPROC_ONLN=${samba_cv_SYSCONF_SC_NPROC_ONLN=no}
+samba_cv_SYSQUOTA_FOUND=${samba_cv_SYSQUOTA_FOUND=yes}
+samba_cv_SYSQUOTA_WORKS=${samba_cv_SYSQUOTA_WORKS=yes}
+samba_cv_USE_SETRESUID=${samba_cv_USE_SETRESUID=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_sysquotas_file=${samba_cv_sysquotas_file=lib/sysquotas_4A.c}
+# This cached value needs a local patch to pick it up, upstream 3.0.14a
+# doesn't cache it.
+samba_cv_LINUX_LFS_SUPPORT=${samba_cv_LINUX_LFS_SUPPORT=yes}
diff --git a/import-layers/yocto-poky/meta/site/native b/import-layers/yocto-poky/meta/site/native
new file mode 100644
index 000000000..7dfb1cbee
--- /dev/null
+++ b/import-layers/yocto-poky/meta/site/native
@@ -0,0 +1 @@
+ac_cv_path_SED=sed
diff --git a/import-layers/yocto-poky/meta/site/nios2-linux b/import-layers/yocto-poky/meta/site/nios2-linux
new file mode 100644
index 000000000..95c09d3b4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/site/nios2-linux
@@ -0,0 +1,391 @@
+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_mutex=${db_cv_mutex=ARM/gcc-assembly}
+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_C99_VSNPRINTF=${rsync_cv_HAVE_C99_VSNPRINTF=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_bool=${ac_cv_sizeof_bool=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}
+ac_cv_func_mmap_fixed_mapped=${ac_cv_func_mmap_fixed_mapped=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/import-layers/yocto-poky/meta/site/powerpc-common b/import-layers/yocto-poky/meta/site/powerpc-common
new file mode 100644
index 000000000..efa299c66
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/site/powerpc-darwin b/import-layers/yocto-poky/meta/site/powerpc-darwin
new file mode 100644
index 000000000..085f50b03
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/site/powerpc-linux b/import-layers/yocto-poky/meta/site/powerpc-linux
new file mode 100644
index 000000000..a9f89cb5d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/site/powerpc32-linux b/import-layers/yocto-poky/meta/site/powerpc32-linux
new file mode 100644
index 000000000..06d961f5c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/site/powerpc32-linux
@@ -0,0 +1,272 @@
+ac_cv_func_setvbuf_reversed=no
+ac_cv_sizeof___int64=${ac_cv_sizeof___int64=0}
+ac_cv_sizeof_bool=${ac_cv_sizeof_bool=1}
+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/import-layers/yocto-poky/meta/site/powerpc64-linux b/import-layers/yocto-poky/meta/site/powerpc64-linux
new file mode 100644
index 000000000..d64e230af
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/site/sh-common b/import-layers/yocto-poky/meta/site/sh-common
new file mode 100644
index 000000000..5cbf36a79
--- /dev/null
+++ b/import-layers/yocto-poky/meta/site/sh-common
@@ -0,0 +1,235 @@
+# 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_C99_VSNPRINTF=${rsync_cv_HAVE_C99_VSNPRINTF=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}
+ac_cv_func_mmap_fixed_mapped=${ac_cv_func_mmap_fixed_mapped=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/import-layers/yocto-poky/meta/site/sparc-linux b/import-layers/yocto-poky/meta/site/sparc-linux
new file mode 100644
index 000000000..49d0d9a3d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/meta/site/x32-linux b/import-layers/yocto-poky/meta/site/x32-linux
new file mode 100644
index 000000000..308d6e21e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/site/x32-linux
@@ -0,0 +1,9 @@
+# general
+ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=16}
+ac_cv_sizeof_ino_t=${ac_cv_sizeof_ino_t=8}
+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/import-layers/yocto-poky/meta/site/x86_64-linux b/import-layers/yocto-poky/meta/site/x86_64-linux
new file mode 100644
index 000000000..ebdcf69f7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/site/x86_64-linux
@@ -0,0 +1,135 @@
+# 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_ino_t=${ac_cv_sizeof_ino_t=8}
+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/import-layers/yocto-poky/meta/site/x86_64-linux-uclibc b/import-layers/yocto-poky/meta/site/x86_64-linux-uclibc
new file mode 100644
index 000000000..2d269f78f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/site/x86_64-linux-uclibc
@@ -0,0 +1,91 @@
+# 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___int64=${ac_cv_sizeof___int64=0}
+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_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=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_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}
+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}
+
+# glib-2.0
+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
+
+# 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=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
+
+# startup-notification
+lf_cv_sane_realloc=${lf_cv_sane_realloc=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}
diff --git a/import-layers/yocto-poky/oe-init-build-env b/import-layers/yocto-poky/oe-init-build-env
new file mode 100755
index 000000000..5fe68d1e2
--- /dev/null
+++ b/import-layers/yocto-poky/oe-init-build-env
@@ -0,0 +1,67 @@
+#!/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"
+
+# Shutdown any bitbake server if the BBSERVER variable is not set
+if [ -z "$BBSERVER" ] && [ -f bitbake.lock ]; then
+ grep ":" bitbake.lock > /dev/null && BBSERVER=$(cat bitbake.lock) bitbake --status-only
+ if [ $? = 0 ]; then
+ echo "Shutting down bitbake memory resident server with bitbake -m"
+ BBSERVER=$(cat bitbake.lock) bitbake -m
+ fi
+fi
diff --git a/import-layers/yocto-poky/oe-init-build-env-memres b/import-layers/yocto-poky/oe-init-build-env-memres
new file mode 100755
index 000000000..9e1425ea8
--- /dev/null
+++ b/import-layers/yocto-poky/oe-init-build-env-memres
@@ -0,0 +1,90 @@
+#!/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-memres <portnumber> <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 <portnumber>
+# <builddir>" prior to sourcing this script.
+#
+if [ -z "$1" ]; then
+ echo "No port specified, using dynamically selected port"
+ port=-1
+else
+ port=$1
+ shift
+fi
+
+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"
+
+res=1
+if [ -e bitbake.lock ] && grep : bitbake.lock > /dev/null; then
+ BBSERVER=$(cat bitbake.lock) bitbake --status-only
+ res=$?
+fi
+
+if [ $res != 0 ]; then
+ bitbake --server-only -t xmlrpc -B localhost:$port
+fi
+
+if [ $port = -1 ]; then
+ export BBSERVER=localhost:-1
+ echo "Bitbake server started on demand as needed, use bitbake -m to shut it down"
+else
+ export BBSERVER=$(cat bitbake.lock)
+
+ if [ $res = 0 ]; then
+ echo "Using existing bitbake server at: $BBSERVER, use bitbake -m to shut it down"
+ else
+ echo "Bitbake server started at: $BBSERVER, use bitbake -m to shut it down"
+ fi
+fi
+unset port res
diff --git a/import-layers/yocto-poky/scripts/README b/import-layers/yocto-poky/scripts/README
new file mode 100644
index 000000000..1b8d12724
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/README
@@ -0,0 +1 @@
+This directory contains Various useful scripts for working with OE builds
diff --git a/import-layers/yocto-poky/scripts/bitbake-prserv-tool b/import-layers/yocto-poky/scripts/bitbake-prserv-tool
new file mode 100755
index 000000000..fa31b5258
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/bitbake-whatchanged b/import-layers/yocto-poky/scripts/bitbake-whatchanged
new file mode 100755
index 000000000..af54d16f8
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/bitbake-whatchanged
@@ -0,0 +1,339 @@
+#!/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) 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
+
+from __future__ import print_function
+import os
+import sys
+import getopt
+import shutil
+import re
+import warnings
+import subprocess
+from optparse import OptionParser
+
+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)
+
+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 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 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 = OptionParser(
+ version = "1.0",
+ usage = """%prog [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_option("-v", "--verbose", help = "print the verbose changes",
+ action = "store_true", dest = "verbose")
+
+ options, args = parser.parse_args(sys.argv)
+
+ verbose = options.verbose
+
+ if len(args) != 2:
+ parser.error("Incorrect number of arguments")
+ else:
+ recipe = args[1]
+
+ # 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'" % 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, 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 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 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, 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 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/import-layers/yocto-poky/scripts/buildhistory-collect-srcrevs b/import-layers/yocto-poky/scripts/buildhistory-collect-srcrevs
new file mode 100755
index 000000000..f3eb76bd0
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/buildhistory-collect-srcrevs
@@ -0,0 +1,117 @@
+#!/usr/bin/env python
+#
+# 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, srcrev))
+
+ for curdir, srcrevs in sorted(all_srcrevs.iteritems()):
+ 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/import-layers/yocto-poky/scripts/buildhistory-diff b/import-layers/yocto-poky/scripts/buildhistory-diff
new file mode 100755
index 000000000..dfebcddf7
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/buildhistory-diff
@@ -0,0 +1,100 @@
+#!/usr/bin/env python
+
+# 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 optparse
+from distutils.version import LooseVersion
+
+# Ensure PythonGit is installed (buildhistory_analysis needs it)
+try:
+ import git
+except ImportError:
+ print("Please install GitPython (python-git) 0.3.1 or later in order to use this script")
+ sys.exit(1)
+
+def main():
+ parser = optparse.OptionParser(
+ description = "Reports significant differences in the buildhistory repository.",
+ usage = """
+ %prog [options] [from-revision [to-revision]]
+(if not specified, from-revision defaults to build-minus-1, and to-revision defaults to HEAD)""")
+
+ parser.add_option("-p", "--buildhistory-dir",
+ help = "Specify path to buildhistory directory (defaults to buildhistory/ under cwd)",
+ action="store", dest="buildhistory_dir", default='buildhistory/')
+ parser.add_option("-v", "--report-version",
+ help = "Report changes in PKGE/PKGV/PKGR even when the values are still the default (PE/PV/PR)",
+ action="store_true", dest="report_ver", default=False)
+ parser.add_option("-a", "--report-all",
+ help = "Report all changes, not just the default significant ones",
+ action="store_true", dest="report_all", default=False)
+
+ options, args = parser.parse_args(sys.argv)
+
+ if len(args) > 3:
+ sys.stderr.write('Invalid argument(s) specified: %s\n\n' % ' '.join(args[3:]))
+ parser.print_help()
+ sys.exit(1)
+
+ 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 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)
+
+ 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)
+
+ import oe.buildhistory_analysis
+
+ fromrev = 'build-minus-1'
+ torev = 'HEAD'
+ if len(args) > 1:
+ if len(args) == 2 and '..' in args[1]:
+ revs = args[1].split('..')
+ fromrev = revs[0]
+ if revs[1]:
+ torev = revs[1]
+ else:
+ fromrev = args[1]
+ if len(args) > 2:
+ torev = args[2]
+
+ import gitdb
+ try:
+ changes = oe.buildhistory_analysis.process_changes(options.buildhistory_dir, fromrev, torev, options.report_all, options.report_ver)
+ except gitdb.exc.BadObject as e:
+ if len(args) == 1:
+ 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:
+ print('%s' % chg)
+
+ sys.exit(0)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/import-layers/yocto-poky/scripts/cleanup-workdir b/import-layers/yocto-poky/scripts/cleanup-workdir
new file mode 100755
index 000000000..01ebd526e
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/cleanup-workdir
@@ -0,0 +1,198 @@
+#!/usr/bin/env python
+
+# 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
+
+import os
+import sys
+import optparse
+import re
+import subprocess
+import shutil
+
+pkg_cur_dirs = {}
+obsolete_dirs = []
+parser = None
+
+def err_quit(msg):
+ print msg
+ parser.print_usage()
+ sys.exit(1)
+
+def parse_version(verstr):
+ elems = verstr.split(':')
+ epoch = elems[0]
+ if len(epoch) == 0:
+ return elems[1]
+ else:
+ return epoch + '_' + elems[1]
+
+def run_command(cmd):
+ pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
+ output = pipe.communicate()[0]
+ if pipe.returncode != 0:
+ print "Execute command '%s' failed." % cmd
+ sys.exit(1)
+ return output
+
+def get_cur_arch_dirs(workdir, arch_dirs):
+ pattern = workdir + '/(.*?)/'
+
+ cmd = "bitbake -e | grep ^SDK_ARCH="
+ output = run_command(cmd)
+ sdk_arch = output.split('"')[1]
+
+ # select thest 5 packages to get the dirs of current arch
+ pkgs = ['hicolor-icon-theme', 'base-files', 'acl-native', 'binutils-crosssdk-' + sdk_arch, 'nativesdk-autoconf']
+
+ for pkg in pkgs:
+ cmd = "bitbake -e " + pkg + " | grep ^IMAGE_ROOTFS="
+ output = run_command(cmd)
+ output = output.split('"')[1]
+ m = re.match(pattern, output)
+ arch_dirs.append(m.group(1))
+
+def main():
+ global parser
+ parser = optparse.OptionParser(
+ usage = """%prog
+
+%prog removes the obsolete packages' build directories in WORKDIR.
+This script must be ran under BUILDDIR after source file \"oe-init-build-env\".
+
+Any file or directory under WORKDIR which is not created by Yocto
+will be deleted. Be CAUTIOUS.""")
+
+ options, args = parser.parse_args(sys.argv)
+
+ builddir = run_command('echo $BUILDDIR').strip()
+ if len(builddir) == 0:
+ err_quit("Please source file \"oe-init-build-env\" first.\n")
+
+ if os.getcwd() != builddir:
+ err_quit("Please run %s under: %s\n" % (os.path.basename(args[0]), builddir))
+
+ print 'Updating bitbake caches...'
+ cmd = "bitbake -s"
+ output = run_command(cmd)
+
+ output = output.split('\n')
+ index = 0
+ while len(output[index]) > 0:
+ index += 1
+ alllines = output[index+1:]
+
+ for line in alllines:
+ # empty again means end of the versions output
+ if len(line) == 0:
+ break
+ line = line.strip()
+ line = re.sub('\s+', ' ', line)
+ elems = line.split(' ')
+ if len(elems) == 2:
+ version = parse_version(elems[1])
+ else:
+ version = parse_version(elems[2])
+ pkg_cur_dirs[elems[0]] = version
+
+ cmd = "bitbake -e"
+ output = run_command(cmd)
+
+ tmpdir = None
+ image_rootfs = None
+ output = output.split('\n')
+ for line in output:
+ if tmpdir and image_rootfs:
+ break
+
+ if not tmpdir:
+ m = re.match('TMPDIR="(.*)"', line)
+ if m:
+ tmpdir = m.group(1)
+
+ if not image_rootfs:
+ m = re.match('IMAGE_ROOTFS="(.*)"', line)
+ if m:
+ image_rootfs = m.group(1)
+
+ # won't fail just in case
+ if not tmpdir or not image_rootfs:
+ print "Can't get TMPDIR or IMAGE_ROOTFS."
+ return 1
+
+ pattern = tmpdir + '/(.*?)/(.*?)/'
+ m = re.match(pattern, image_rootfs)
+ if not m:
+ print "Can't get WORKDIR."
+ return 1
+
+ workdir = os.path.join(tmpdir, m.group(1))
+
+ # we only deal the dirs of current arch, total numbers of dirs are 6
+ cur_arch_dirs = [m.group(2)]
+ get_cur_arch_dirs(workdir, cur_arch_dirs)
+
+ for workroot, dirs, files in os.walk(workdir):
+ # For the files, they should NOT exist in WORKDIR. Remove them.
+ for f in files:
+ obsolete_dirs.append(os.path.join(workroot, f))
+
+ for d in dirs:
+ if d not in cur_arch_dirs:
+ continue
+
+ for pkgroot, pkgdirs, filenames in os.walk(os.path.join(workroot, d)):
+ for f in filenames:
+ obsolete_dirs.append(os.path.join(pkgroot, f))
+
+ for pkgdir in sorted(pkgdirs):
+ if pkgdir not in pkg_cur_dirs:
+ obsolete_dirs.append(os.path.join(pkgroot, pkgdir))
+ else:
+ for verroot, verdirs, verfiles in os.walk(os.path.join(pkgroot, pkgdir)):
+ for f in verfiles:
+ obsolete_dirs.append(os.path.join(pkgroot, f))
+ for v in sorted(verdirs):
+ if v not in pkg_cur_dirs[pkgdir]:
+ obsolete_dirs.append(os.path.join(pkgroot, pkgdir, v))
+ break
+
+ # just process the top dir of every package under tmp/work/*/,
+ # then jump out of the above os.walk()
+ break
+
+ # it is convenient to use os.walk() to get dirs and files at same time
+ # both of them have been dealed in the loop, so jump out
+ break
+
+ for d in obsolete_dirs:
+ print "Deleting %s" % d
+ shutil.rmtree(d, True)
+
+ if len(obsolete_dirs):
+ print '\nTotal %d items.' % len(obsolete_dirs)
+ else:
+ print '\nNo obsolete directory found under %s.' % workdir
+
+ return 0
+
+if __name__ == '__main__':
+ try:
+ ret = main()
+ except Exception:
+ ret = 2
+ import traceback
+ traceback.print_exc()
+ sys.exit(ret)
diff --git a/import-layers/yocto-poky/scripts/combo-layer b/import-layers/yocto-poky/scripts/combo-layer
new file mode 100755
index 000000000..91270415f
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/combo-layer
@@ -0,0 +1,924 @@
+#!/usr/bin/env python
+# 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
+from collections import OrderedDict
+from string import Template
+
+__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'}
+ 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):
+ """
+ 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 = os.tmpfile()
+ err = out
+ else:
+ err = os.tmpfile()
+ try:
+ subprocess.check_call(cmd, stdout=out, stderr=err, cwd=destdir, shell=isinstance(cmd, str))
+ except subprocess.CalledProcessError,e:
+ err.seek(0)
+ if printerr:
+ logger.error("%s" % err.read())
+ raise e
+
+ err.seek(0)
+ output = err.read()
+ logger.debug("output: %s" % output )
+ 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'):
+ 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() 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() 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, 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)
+ ln = f.readline()
+ of = None
+ in_patch = False
+ beyond_msg = False
+ pre_buf = ''
+ while ln:
+ if not beyond_msg:
+ if ln == '---\n':
+ if not of:
+ break
+ in_patch = False
+ beyond_msg = True
+ elif ln.startswith('--- '):
+ # 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', 'w')
+ of.write(pre_buf)
+ pre_buf = ''
+ elif in_patch and not ln[0] in '+-@ \n\r':
+ in_patch = False
+ if of:
+ if in_patch:
+ of.write(' ' + 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
+ generate the patch list
+ apply the generated patches
+ """
+ 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())
+
+ import uuid
+ patch_dir = "patch-%s" % uuid.uuid4()
+ if not os.path.exists(patch_dir):
+ os.mkdir(patch_dir)
+
+ # Step 1: update the component repos
+ if conf.nopull:
+ logger.info("Skipping pull (-n)")
+ else:
+ action_pull(conf, ['arg0'] + components)
+
+ 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
+ relpath = os.path.relpath(conf.conffile)
+ try:
+ output = runcmd("git status --porcelain %s" % relpath, printerr=False)
+ except:
+ # Outside the repository
+ output = None
+ if output:
+ logger.info("Committing updated configuration file")
+ if output.lstrip().startswith("M"):
+
+ # 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)
+ raw_msg = template.substitute(components = component_str)
+
+ # sanitize the string before using it in command line
+ msg = raw_msg.replace('"', '\\"')
+
+ runcmd('git commit -m "%s" %s' % (msg, relpath))
+
+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 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/import-layers/yocto-poky/scripts/combo-layer-hook-default.sh b/import-layers/yocto-poky/scripts/combo-layer-hook-default.sh
new file mode 100755
index 000000000..1e3a3b9bc
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/combo-layer.conf.example b/import-layers/yocto-poky/scripts/combo-layer.conf.example
new file mode 100644
index 000000000..90e2b5872
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/contrib/bb-perf/bb-matrix-plot.sh b/import-layers/yocto-poky/scripts/contrib/bb-perf/bb-matrix-plot.sh
new file mode 100755
index 000000000..136a25570
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/contrib/bb-perf/bb-matrix.sh b/import-layers/yocto-poky/scripts/contrib/bb-perf/bb-matrix.sh
new file mode 100755
index 000000000..106456584
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/contrib/bb-perf/buildstats.sh b/import-layers/yocto-poky/scripts/contrib/bb-perf/buildstats.sh
new file mode 100755
index 000000000..96158a965
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/contrib/bb-perf/buildstats.sh
@@ -0,0 +1,90 @@
+#!/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 a 'buildstats' path (created by bitbake when setting
+# USER_CLASSES ?= "buildstats" on local.conf) and task names, outputs
+# '<task> <recipe> <elapsed time>' for all recipes. Elapsed times are in
+# seconds, and task should be given without the 'do_' prefix.
+#
+# Some useful pipelines
+#
+# 1. Tasks with largest elapsed times
+# $ buildstats.sh -b <buildstats> | sort -k3 -n -r | head
+#
+# 2. Min, max, sum per task (in needs GNU datamash)
+# $ buildstats.sh -b <buildstats> | datamash -t' ' -g1 min 3 max 3 sum 3 | sort -k4 -n -r
+#
+# AUTHORS
+# Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
+#
+BS_DIR="tmp/buildstats"
+TASKS="compile:configure:fetch:install:patch:populate_lic:populate_sysroot:unpack"
+
+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")
+ -h Display this help message
+EOM
+}
+
+# Parse and validate arguments
+while getopts "b:t:h" OPT; do
+ case $OPT in
+ b)
+ BS_DIR="$OPTARG"
+ ;;
+ t)
+ TASKS="$OPTARG"
+ ;;
+ 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
+
+RECIPE_FIELD=1
+TIME_FIELD=4
+
+tasks=(${TASKS//:/ })
+for task in "${tasks[@]}"; do
+ task="do_${task}"
+ for file in $(find ${BS_DIR} -type f -name ${task}); do
+ recipe=$(sed -n -e "/$task/p" ${file} | cut -d ':' -f${RECIPE_FIELD})
+ time=$(sed -n -e "/$task/p" ${file} | cut -d ':' -f${TIME_FIELD} | cut -d ' ' -f2)
+ echo "${task} ${recipe} ${time}"
+ done
+done
diff --git a/import-layers/yocto-poky/scripts/contrib/bbvars.py b/import-layers/yocto-poky/scripts/contrib/bbvars.py
new file mode 100755
index 000000000..0896d6444
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/contrib/bbvars.py
@@ -0,0 +1,186 @@
+#!/usr/bin/env python
+
+# 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
+
+def usage():
+ print 'Usage: %s -d FILENAME [-d FILENAME]* -m METADIR [-m MATADIR]*' % os.path.basename(sys.argv[0])
+ print ' -d FILENAME documentation file to search'
+ print ' -h, --help display this help and exit'
+ print ' -m METADIR meta directory to search for recipes'
+ print ' -t FILENAME documentation config file (for doc tags)'
+ print ' -T Only display variables with doc tags (requires -t)'
+
+def recipe_bbvars(recipe):
+ ''' Return a unique set of every bbvar encountered in the recipe '''
+ prog = re.compile("[A-Z_]+")
+ vset = set()
+ try:
+ r = open(recipe)
+ except IOError as (errno, strerror):
+ print 'WARNING: Failed to open recipe ', recipe
+ print strerror
+
+ for line in r:
+ # Strip any comments from the line
+ line = line.rsplit('#')[0]
+ vset = vset.union(set(prog.findall(line)))
+ r.close()
+
+ bbvars = {}
+ for v in vset:
+ bbvars[v] = 1
+
+ return bbvars
+
+def collect_bbvars(metadir):
+ ''' Walk the metadir and collect the bbvars from each recipe found '''
+ bbvars = {}
+ for root,dirs,files in os.walk(metadir):
+ for name in files:
+ if name.find(".bb") >= 0:
+ for key in recipe_bbvars(os.path.join(root,name)).iterkeys():
+ if bbvars.has_key(key):
+ bbvars[key] = bbvars[key] + 1
+ else:
+ bbvars[key] = 1
+ return bbvars
+
+def bbvar_is_documented(var, docfiles):
+ prog = re.compile(".*($|[^A-Z_])%s([^A-Z_]|$)" % (var))
+ for doc in docfiles:
+ try:
+ f = open(doc)
+ except IOError as (errno, strerror):
+ print 'WARNING: Failed to open doc ', doc
+ print strerror
+ for line in f:
+ if prog.match(line):
+ return True
+ f.close()
+ return False
+
+def bbvar_doctag(var, docconf):
+ prog = re.compile('^%s\[doc\] *= *"(.*)"' % (var))
+ if docconf == "":
+ return "?"
+
+ try:
+ f = open(docconf)
+ except IOError as (errno, strerror):
+ return strerror
+
+ for line in f:
+ m = prog.search(line)
+ if m:
+ return m.group(1)
+
+ f.close()
+ return ""
+
+def main():
+ docfiles = []
+ metadirs = []
+ bbvars = {}
+ undocumented = []
+ docconf = ""
+ onlydoctags = False
+
+ # Collect and validate input
+ try:
+ opts, args = getopt.getopt(sys.argv[1:], "d:hm:t:T", ["help"])
+ except getopt.GetoptError, 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 == '-m':
+ if os.path.isdir(a):
+ metadirs.append(a)
+ else:
+ print 'ERROR: meta directory %s is not a directory' % (a)
+ sys.exit(4)
+ 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 len(metadirs) == 0:
+ print 'ERROR: no metadir specified'
+ usage()
+ sys.exit(6)
+
+ if onlydoctags and docconf == "":
+ print 'ERROR: no docconf specified'
+ usage()
+ sys.exit(7)
+
+ # Collect all the variable names from the recipes in the metadirs
+ for m in metadirs:
+ for key,cnt in collect_bbvars(m).iteritems():
+ if bbvars.has_key(key):
+ bbvars[key] = bbvars[key] + cnt
+ else:
+ bbvars[key] = cnt
+
+ # Check each var for documentation
+ varlen = 0
+ for v in bbvars.iterkeys():
+ if len(v) > varlen:
+ varlen = len(v)
+ if not bbvar_is_documented(v, docfiles):
+ 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%s' % (str("VARIABLE").ljust(varlen), str("COUNT").ljust(6), 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%s' % (v.ljust(varlen), str(bbvars[v]).ljust(6), doctag)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/import-layers/yocto-poky/scripts/contrib/build-perf-test.sh b/import-layers/yocto-poky/scripts/contrib/build-perf-test.sh
new file mode 100755
index 000000000..7d99228c7
--- /dev/null
+++ b/import-layers/yocto-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 -c fetchall
+ 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/import-layers/yocto-poky/scripts/contrib/ddimage b/import-layers/yocto-poky/scripts/contrib/ddimage
new file mode 100755
index 000000000..a503f11d0
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/contrib/ddimage
@@ -0,0 +1,104 @@
+#!/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..."
+dd if="$IMAGE" of="$DEVICE" bs="$BLOCKSIZE"
+sync
diff --git a/import-layers/yocto-poky/scripts/contrib/devtool-stress.py b/import-layers/yocto-poky/scripts/contrib/devtool-stress.py
new file mode 100755
index 000000000..8cf92ca2f
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/contrib/devtool-stress.py
@@ -0,0 +1,242 @@
+#!/usr/bin/env python
+
+# 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.recipecache.pkg_pn
+ (latest_versions, preferred_versions) = bb.providers.findProviders(tinfoil.config_data, tinfoil.cooker.recipecache, 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.recipecache.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
+
+ srctree = os.path.join(tmpdir, pn)
+ try:
+ bb.process.run('devtool extract %s %s' % (pn, srctree))
+ except bb.process.CmdError as exc:
+ 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
+ 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
+
+ srctree = os.path.join(tmpdir, pn)
+ try:
+ bb.process.run('devtool modify -x %s %s' % (pn, srctree))
+ except bb.process.CmdError as exc:
+ with open('stress_%s_modify.log' % pn, 'w') as f:
+ f.write(str(exc))
+ failed = 'modify'
+ reset = False
+
+ 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
+ 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')
+ 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>')
+
+ 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/import-layers/yocto-poky/scripts/contrib/dialog-power-control b/import-layers/yocto-poky/scripts/contrib/dialog-power-control
new file mode 100755
index 000000000..7550ea53b
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/contrib/documentation-audit.sh b/import-layers/yocto-poky/scripts/contrib/documentation-audit.sh
new file mode 100755
index 000000000..2144aac93
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/contrib/graph-tool b/import-layers/yocto-poky/scripts/contrib/graph-tool
new file mode 100755
index 000000000..6dc7d337f
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/contrib/graph-tool
@@ -0,0 +1,92 @@
+#!/usr/bin/env python
+
+# 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.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]
+ paths = list(get_path_networkx(args[0], fromnode, tonode))
+ if paths:
+ for path in paths:
+ print ' -> '.join(path)
+ else:
+ 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/import-layers/yocto-poky/scripts/contrib/list-packageconfig-flags.py b/import-layers/yocto-poky/scripts/contrib/list-packageconfig-flags.py
new file mode 100755
index 000000000..2f3b8b06a
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/contrib/list-packageconfig-flags.py
@@ -0,0 +1,179 @@
+#!/usr/bin/env python
+
+# 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.cache
+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.recipecache, 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.recipecache.pkg_pn
+
+ data_dict = {}
+ for fn in get_fnlist(bbhandler, pkg_pn, preferred):
+ data = bb.cache.Cache.loadDataFull(fn, bbhandler.cooker.collection.get_file_appends(fn), bbhandler.config_data)
+ 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", True)
+ 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.iteritems():
+ 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", True))
+ print fn
+ packageconfig = data_dict[fn].getVar("PACKAGECONFIG", True) or ''
+ if packageconfig.strip() == '':
+ packageconfig = 'None'
+ print('PACKAGECONFIG %s' % packageconfig)
+
+ for flag,flag_val in data_dict[fn].getVarFlags("PACKAGECONFIG").iteritems():
+ 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)
+
+ bbhandler = bb.tinfoil.Tinfoil()
+ 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/import-layers/yocto-poky/scripts/contrib/mkefidisk.sh b/import-layers/yocto-poky/scripts/contrib/mkefidisk.sh
new file mode 100755
index 000000000..333284ff5
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/contrib/mkefidisk.sh
@@ -0,0 +1,459 @@
+#!/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
+
+# 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 loop $HDDIMG $HDDIMG_MNT >$OUT 2>&1 || error "Failed to mount $HDDIMG"
+mount -o 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 gummiboot 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 gummiboot installation
+GUMMI_ENTRIES="$BOOTFS_MNT/loader/entries"
+GUMMI_CFG="$GUMMI_ENTRIES/boot.conf"
+if [ -d "$GUMMI_ENTRIES" ]; then
+ info "Configuring Gummiboot"
+ # remove the install target if it exists
+ rm $GUMMI_ENTRIES/install.conf >$OUT 2>&1
+
+ if [ ! -e "$GUMMI_CFG" ]; then
+ echo "ERROR: $GUMMI_CFG not found"
+ fi
+
+ sed -i "/initrd /d" $GUMMI_CFG
+ sed -i "s@ root=[^ ]*@ @" $GUMMI_CFG
+ sed -i "s@options *LABEL=boot @options LABEL=Boot root=$TARGET_ROOTFS ro rootwait console=ttyS0 console=tty0 @" $GUMMI_CFG
+fi
+
+# Ensure we have at least one EFI bootloader configured
+if [ ! -e $GRUB_CFG ] && [ ! -e $GUMMI_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
+echo "fs0:\EFI\BOOT\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/import-layers/yocto-poky/scripts/contrib/python/generate-manifest-2.7.py b/import-layers/yocto-poky/scripts/contrib/python/generate-manifest-2.7.py
new file mode 100755
index 000000000..d93c943c6
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/contrib/python/generate-manifest-2.7.py
@@ -0,0 +1,397 @@
+#!/usr/bin/env python
+
+# generate Python Manifest for the OpenEmbedded build system
+# (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
+# (C) 2007 Jeremy Laine
+# licensed under MIT, see COPYING.MIT
+#
+# June 22, 2011 -- Mark Hatle <mark.hatle@windriver.com>
+# * Updated to no longer generate special -dbg package, instead use the
+# single system -dbg
+# * Update version with ".1" to indicate this change
+
+import os
+import sys
+import time
+
+VERSION = "2.7.2"
+
+__author__ = "Michael 'Mickey' Lauer <mlauer@vanille-media.de>"
+__version__ = "20110222.2"
+
+class MakefileMaker:
+
+ def __init__( self, outfile ):
+ """initialize"""
+ self.packages = {}
+ self.targetPrefix = "${libdir}/python%s/" % VERSION[:3]
+ self.output = outfile
+ self.out( """
+# WARNING: This file is AUTO GENERATED: Manual edits will be lost next time I regenerate the file.
+# Generator: '%s' Version %s (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
+# Visit the Python for Embedded Systems Site => http://www.Vanille.de/projects/python.spy
+""" % ( sys.argv[0], __version__ ) )
+
+ #
+ # helper functions
+ #
+
+ def out( self, data ):
+ """print a line to the output file"""
+ self.output.write( "%s\n" % data )
+
+ def setPrefix( self, targetPrefix ):
+ """set a file prefix for addPackage files"""
+ self.targetPrefix = targetPrefix
+
+ def doProlog( self ):
+ self.out( """ """ )
+ self.out( "" )
+
+ def addPackage( self, name, description, dependencies, filenames ):
+ """add a package to the Makefile"""
+ if type( filenames ) == type( "" ):
+ filenames = filenames.split()
+ fullFilenames = []
+ for filename in filenames:
+ if filename[0] != "$":
+ fullFilenames.append( "%s%s" % ( self.targetPrefix, filename ) )
+ else:
+ fullFilenames.append( filename )
+ self.packages[name] = description, dependencies, fullFilenames
+
+ def doBody( self ):
+ """generate body of Makefile"""
+
+ global VERSION
+
+ #
+ # generate provides line
+ #
+
+ provideLine = 'PROVIDES+="'
+ for name in sorted(self.packages):
+ provideLine += "%s " % name
+ provideLine += '"'
+
+ self.out( provideLine )
+ self.out( "" )
+
+ #
+ # generate package line
+ #
+
+ packageLine = 'PACKAGES="${PN}-dbg '
+ for name in sorted(self.packages):
+ if name.startswith("${PN}-distutils"):
+ if name == "${PN}-distutils":
+ packageLine += "%s-staticdev %s " % (name, name)
+ elif name != '${PN}-dbg':
+ packageLine += "%s " % name
+ packageLine += '${PN}-modules"'
+
+ self.out( packageLine )
+ self.out( "" )
+
+ #
+ # generate package variables
+ #
+
+ for name, data in sorted(self.packages.iteritems()):
+ desc, deps, files = data
+
+ #
+ # write out the description, revision and dependencies
+ #
+ self.out( 'SUMMARY_%s="%s"' % ( name, desc ) )
+ self.out( 'RDEPENDS_%s="%s"' % ( name, deps ) )
+
+ line = 'FILES_%s="' % name
+
+ #
+ # check which directories to make in the temporary directory
+ #
+
+ dirset = {} # if python had a set-datatype this would be sufficient. for now, we're using a dict instead.
+ for target in files:
+ dirset[os.path.dirname( target )] = True
+
+ #
+ # generate which files to copy for the target (-dfR because whole directories are also allowed)
+ #
+
+ for target in files:
+ line += "%s " % target
+
+ line += '"'
+ self.out( line )
+ self.out( "" )
+
+ self.out( 'SUMMARY_${PN}-modules="All Python modules"' )
+ line = 'RDEPENDS_${PN}-modules="'
+
+ for name, data in sorted(self.packages.iteritems()):
+ if name not in ['${PN}-dev', '${PN}-distutils-staticdev']:
+ line += "%s " % name
+
+ self.out( "%s \"" % line )
+ self.out( 'ALLOW_EMPTY_${PN}-modules = "1"' )
+
+ def doEpilog( self ):
+ self.out( """""" )
+ self.out( "" )
+
+ def make( self ):
+ self.doProlog()
+ self.doBody()
+ self.doEpilog()
+
+if __name__ == "__main__":
+
+ if len( sys.argv ) > 1:
+ try:
+ os.unlink(sys.argv[1])
+ except Exception:
+ sys.exc_clear()
+ outfile = file( sys.argv[1], "w" )
+ else:
+ outfile = sys.stdout
+
+ m = MakefileMaker( outfile )
+
+ # Add packages here. Only specify dlopen-style library dependencies here, no ldd-style dependencies!
+ # Parameters: revision, name, description, dependencies, filenames
+ #
+
+ m.addPackage( "${PN}-core", "Python interpreter and core modules", "${PN}-lang ${PN}-re",
+ "__future__.* _abcoll.* abc.* ast.* copy.* copy_reg.* ConfigParser.* " +
+ "genericpath.* getopt.* linecache.* new.* " +
+ "os.* posixpath.* struct.* " +
+ "warnings.* site.* stat.* " +
+ "UserDict.* UserList.* UserString.* " +
+ "lib-dynload/binascii.so lib-dynload/_struct.so lib-dynload/time.so " +
+ "lib-dynload/xreadlines.so types.* platform.* ${bindir}/python* " +
+ "_weakrefset.* sysconfig.* _sysconfigdata.* config/Makefile " +
+ "${includedir}/python${PYTHON_MAJMIN}/pyconfig*.h " +
+ "${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py ")
+
+ m.addPackage( "${PN}-dev", "Python development package", "${PN}-core",
+ "${includedir} " +
+ "${libdir}/lib*${SOLIBSDEV} " +
+ "${libdir}/*.la " +
+ "${libdir}/*.a " +
+ "${libdir}/*.o " +
+ "${libdir}/pkgconfig " +
+ "${base_libdir}/*.a " +
+ "${base_libdir}/*.o " +
+ "${datadir}/aclocal " +
+ "${datadir}/pkgconfig " )
+
+ m.addPackage( "${PN}-2to3", "Python automated Python 2 to 3 code translator", "${PN}-core",
+ "${bindir}/2to3 lib2to3" ) # package
+
+ m.addPackage( "${PN}-idle", "Python Integrated Development Environment", "${PN}-core ${PN}-tkinter",
+ "${bindir}/idle idlelib" ) # package
+
+ m.addPackage( "${PN}-pydoc", "Python interactive help support", "${PN}-core ${PN}-lang ${PN}-stringold ${PN}-re",
+ "${bindir}/pydoc pydoc.* pydoc_data" )
+
+ m.addPackage( "${PN}-smtpd", "Python Simple Mail Transport Daemon", "${PN}-core ${PN}-netserver ${PN}-email ${PN}-mime",
+ "${bindir}/smtpd.* smtpd.*" )
+
+ m.addPackage( "${PN}-audio", "Python Audio Handling", "${PN}-core",
+ "wave.* chunk.* sndhdr.* lib-dynload/ossaudiodev.so lib-dynload/audioop.so audiodev.* sunaudio.* sunau.* toaiff.*" )
+
+ m.addPackage( "${PN}-bsddb", "Python bindings for the Berkeley Database", "${PN}-core",
+ "bsddb lib-dynload/_bsddb.so" ) # package
+
+ m.addPackage( "${PN}-codecs", "Python codecs, encodings & i18n support", "${PN}-core ${PN}-lang",
+ "codecs.* encodings gettext.* locale.* lib-dynload/_locale.so lib-dynload/_codecs* lib-dynload/_multibytecodec.so lib-dynload/unicodedata.so stringprep.* xdrlib.*" )
+
+ m.addPackage( "${PN}-compile", "Python bytecode compilation support", "${PN}-core",
+ "py_compile.* compileall.*" )
+
+ m.addPackage( "${PN}-compiler", "Python compiler support", "${PN}-core",
+ "compiler" ) # package
+
+ m.addPackage( "${PN}-compression", "Python high-level compression support", "${PN}-core ${PN}-zlib",
+ "gzip.* zipfile.* tarfile.* lib-dynload/bz2.so" )
+
+ m.addPackage( "${PN}-crypt", "Python basic cryptographic and hashing support", "${PN}-core",
+ "hashlib.* md5.* sha.* lib-dynload/crypt.so lib-dynload/_hashlib.so lib-dynload/_sha256.so lib-dynload/_sha512.so" )
+
+ m.addPackage( "${PN}-textutils", "Python option parsing, text wrapping and CSV support", "${PN}-core ${PN}-io ${PN}-re ${PN}-stringold",
+ "lib-dynload/_csv.so csv.* optparse.* textwrap.*" )
+
+ m.addPackage( "${PN}-curses", "Python curses support", "${PN}-core",
+ "curses lib-dynload/_curses.so lib-dynload/_curses_panel.so" ) # directory + low level module
+
+ m.addPackage( "${PN}-ctypes", "Python C types support", "${PN}-core",
+ "ctypes lib-dynload/_ctypes.so lib-dynload/_ctypes_test.so" ) # directory + low level module
+
+ m.addPackage( "${PN}-datetime", "Python calendar and time support", "${PN}-core ${PN}-codecs",
+ "_strptime.* calendar.* lib-dynload/datetime.so" )
+
+ m.addPackage( "${PN}-db", "Python file-based database support", "${PN}-core",
+ "anydbm.* dumbdbm.* whichdb.* " )
+
+ m.addPackage( "${PN}-debugger", "Python debugger", "${PN}-core ${PN}-io ${PN}-lang ${PN}-re ${PN}-stringold ${PN}-shell ${PN}-pprint",
+ "bdb.* pdb.*" )
+
+ m.addPackage( "${PN}-difflib", "Python helpers for computing deltas between objects", "${PN}-lang ${PN}-re",
+ "difflib.*" )
+
+ m.addPackage( "${PN}-distutils-staticdev", "Python distribution utilities (static libraries)", "${PN}-distutils",
+ "config/lib*.a" ) # package
+
+ m.addPackage( "${PN}-distutils", "Python Distribution Utilities", "${PN}-core ${PN}-email",
+ "config distutils" ) # package
+
+ m.addPackage( "${PN}-doctest", "Python framework for running examples in docstrings", "${PN}-core ${PN}-lang ${PN}-io ${PN}-re ${PN}-unittest ${PN}-debugger ${PN}-difflib",
+ "doctest.*" )
+
+ m.addPackage( "${PN}-email", "Python email support", "${PN}-core ${PN}-io ${PN}-re ${PN}-mime ${PN}-audio ${PN}-image ${PN}-netclient",
+ "imaplib.* email" ) # package
+
+ m.addPackage( "${PN}-fcntl", "Python's fcntl interface", "${PN}-core",
+ "lib-dynload/fcntl.so" )
+
+ m.addPackage( "${PN}-hotshot", "Python hotshot performance profiler", "${PN}-core",
+ "hotshot lib-dynload/_hotshot.so" )
+
+ m.addPackage( "${PN}-html", "Python HTML processing support", "${PN}-core",
+ "formatter.* htmlentitydefs.* htmllib.* markupbase.* sgmllib.* HTMLParser.* " )
+
+ m.addPackage( "${PN}-importlib", "Python import implementation library", "${PN}-core",
+ "importlib" )
+
+ m.addPackage( "${PN}-gdbm", "Python GNU database support", "${PN}-core",
+ "lib-dynload/gdbm.so" )
+
+ m.addPackage( "${PN}-image", "Python graphical image handling", "${PN}-core",
+ "colorsys.* imghdr.* lib-dynload/imageop.so lib-dynload/rgbimg.so" )
+
+ m.addPackage( "${PN}-io", "Python low-level I/O", "${PN}-core ${PN}-math ${PN}-textutils ${PN}-netclient ${PN}-contextlib",
+ "lib-dynload/_socket.so lib-dynload/_io.so lib-dynload/_ssl.so lib-dynload/select.so lib-dynload/termios.so lib-dynload/cStringIO.so " +
+ "pipes.* socket.* ssl.* tempfile.* StringIO.* io.* _pyio.*" )
+
+ m.addPackage( "${PN}-json", "Python JSON support", "${PN}-core ${PN}-math ${PN}-re ${PN}-codecs",
+ "json lib-dynload/_json.so" ) # package
+
+ m.addPackage( "${PN}-lang", "Python low-level language support", "${PN}-core",
+ "lib-dynload/_bisect.so lib-dynload/_collections.so lib-dynload/_heapq.so lib-dynload/_weakref.so lib-dynload/_functools.so " +
+ "lib-dynload/array.so lib-dynload/itertools.so lib-dynload/operator.so lib-dynload/parser.so " +
+ "atexit.* bisect.* code.* codeop.* collections.* dis.* functools.* heapq.* inspect.* keyword.* opcode.* symbol.* repr.* token.* " +
+ "tokenize.* traceback.* weakref.*" )
+
+ m.addPackage( "${PN}-logging", "Python logging support", "${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-stringold",
+ "logging" ) # package
+
+ m.addPackage( "${PN}-mailbox", "Python mailbox format support", "${PN}-core ${PN}-mime",
+ "mailbox.*" )
+
+ m.addPackage( "${PN}-math", "Python math support", "${PN}-core ${PN}-crypt",
+ "lib-dynload/cmath.so lib-dynload/math.so lib-dynload/_random.so random.* sets.*" )
+
+ m.addPackage( "${PN}-mime", "Python MIME handling APIs", "${PN}-core ${PN}-io",
+ "mimetools.* uu.* quopri.* rfc822.* MimeWriter.*" )
+
+ m.addPackage( "${PN}-mmap", "Python memory-mapped file support", "${PN}-core ${PN}-io",
+ "lib-dynload/mmap.so " )
+
+ m.addPackage( "${PN}-multiprocessing", "Python multiprocessing support", "${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-threading ${PN}-ctypes ${PN}-mmap",
+ "lib-dynload/_multiprocessing.so multiprocessing" ) # package
+
+ m.addPackage( "${PN}-netclient", "Python Internet Protocol clients", "${PN}-core ${PN}-crypt ${PN}-datetime ${PN}-io ${PN}-lang ${PN}-logging ${PN}-mime",
+ "*Cookie*.* " +
+ "base64.* cookielib.* ftplib.* gopherlib.* hmac.* httplib.* mimetypes.* nntplib.* poplib.* smtplib.* telnetlib.* urllib.* urllib2.* urlparse.* uuid.* rfc822.* mimetools.*" )
+
+ m.addPackage( "${PN}-netserver", "Python Internet Protocol servers", "${PN}-core ${PN}-netclient ${PN}-shell ${PN}-threading",
+ "cgi.* *HTTPServer.* SocketServer.*" )
+
+ m.addPackage( "${PN}-numbers", "Python number APIs", "${PN}-core ${PN}-lang ${PN}-re",
+ "decimal.* fractions.* numbers.*" )
+
+ m.addPackage( "${PN}-pickle", "Python serialisation/persistence support", "${PN}-core ${PN}-codecs ${PN}-io ${PN}-re",
+ "pickle.* shelve.* lib-dynload/cPickle.so pickletools.*" )
+
+ m.addPackage( "${PN}-pkgutil", "Python package extension utility support", "${PN}-core",
+ "pkgutil.*")
+
+ m.addPackage( "${PN}-plistlib", "Generate and parse Mac OS X .plist files", "${PN}-core ${PN}-datetime ${PN}-io",
+ "plistlib.*")
+
+ m.addPackage( "${PN}-pprint", "Python pretty-print support", "${PN}-core ${PN}-io",
+ "pprint.*" )
+
+ m.addPackage( "${PN}-profile", "Python basic performance profiling support", "${PN}-core ${PN}-textutils",
+ "profile.* pstats.* cProfile.* lib-dynload/_lsprof.so" )
+
+ m.addPackage( "${PN}-re", "Python Regular Expression APIs", "${PN}-core",
+ "re.* sre.* sre_compile.* sre_constants* sre_parse.*" ) # _sre is builtin
+
+ m.addPackage( "${PN}-readline", "Python readline support", "${PN}-core",
+ "lib-dynload/readline.so rlcompleter.*" )
+
+ m.addPackage( "${PN}-resource", "Python resource control interface", "${PN}-core",
+ "lib-dynload/resource.so" )
+
+ m.addPackage( "${PN}-shell", "Python shell-like functionality", "${PN}-core ${PN}-re",
+ "cmd.* commands.* dircache.* fnmatch.* glob.* popen2.* shlex.* shutil.*" )
+
+ m.addPackage( "${PN}-robotparser", "Python robots.txt parser", "${PN}-core ${PN}-netclient",
+ "robotparser.*")
+
+ m.addPackage( "${PN}-subprocess", "Python subprocess support", "${PN}-core ${PN}-io ${PN}-re ${PN}-fcntl ${PN}-pickle",
+ "subprocess.*" )
+
+ m.addPackage( "${PN}-sqlite3", "Python Sqlite3 database support", "${PN}-core ${PN}-datetime ${PN}-lang ${PN}-crypt ${PN}-io ${PN}-threading ${PN}-zlib",
+ "lib-dynload/_sqlite3.so sqlite3/dbapi2.* sqlite3/__init__.* sqlite3/dump.*" )
+
+ m.addPackage( "${PN}-sqlite3-tests", "Python Sqlite3 database support tests", "${PN}-core ${PN}-sqlite3",
+ "sqlite3/test" )
+
+ m.addPackage( "${PN}-stringold", "Python string APIs [deprecated]", "${PN}-core ${PN}-re",
+ "lib-dynload/strop.so string.* stringold.*" )
+
+ m.addPackage( "${PN}-syslog", "Python syslog interface", "${PN}-core",
+ "lib-dynload/syslog.so" )
+
+ m.addPackage( "${PN}-terminal", "Python terminal controlling support", "${PN}-core ${PN}-io",
+ "pty.* tty.*" )
+
+ m.addPackage( "${PN}-tests", "Python tests", "${PN}-core",
+ "test" ) # package
+
+ m.addPackage( "${PN}-threading", "Python threading & synchronization support", "${PN}-core ${PN}-lang",
+ "_threading_local.* dummy_thread.* dummy_threading.* mutex.* threading.* Queue.*" )
+
+ m.addPackage( "${PN}-tkinter", "Python Tcl/Tk bindings", "${PN}-core",
+ "lib-dynload/_tkinter.so lib-tk" ) # package
+
+ m.addPackage( "${PN}-unittest", "Python unit testing framework", "${PN}-core ${PN}-stringold ${PN}-lang ${PN}-io ${PN}-difflib ${PN}-pprint ${PN}-shell",
+ "unittest/" )
+
+ m.addPackage( "${PN}-unixadmin", "Python Unix administration support", "${PN}-core",
+ "lib-dynload/nis.so lib-dynload/grp.so lib-dynload/pwd.so getpass.*" )
+
+ m.addPackage( "${PN}-xml", "Python basic XML support", "${PN}-core ${PN}-re",
+ "lib-dynload/_elementtree.so lib-dynload/pyexpat.so xml xmllib.*" ) # package
+
+ m.addPackage( "${PN}-xmlrpc", "Python XML-RPC support", "${PN}-core ${PN}-xml ${PN}-netserver ${PN}-lang",
+ "xmlrpclib.* SimpleXMLRPCServer.* DocXMLRPCServer.*" )
+
+ m.addPackage( "${PN}-zlib", "Python zlib compression support", "${PN}-core",
+ "lib-dynload/zlib.so" )
+
+ m.addPackage( "${PN}-mailbox", "Python mailbox format support", "${PN}-core ${PN}-mime",
+ "mailbox.*" )
+
+ m.addPackage( "${PN}-argparse", "Python command line argument parser", "${PN}-core ${PN}-codecs ${PN}-textutils",
+ "argparse.*" )
+
+ m.addPackage( "${PN}-contextlib", "Python utilities for with-statement" +
+ "contexts.", "${PN}-core",
+ "${libdir}/python${PYTHON_MAJMIN}/contextlib.*" )
+
+ m.make()
diff --git a/import-layers/yocto-poky/scripts/contrib/python/generate-manifest-3.5.py b/import-layers/yocto-poky/scripts/contrib/python/generate-manifest-3.5.py
new file mode 100755
index 000000000..367b4b8b4
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/contrib/python/generate-manifest-3.5.py
@@ -0,0 +1,384 @@
+#!/usr/bin/env python
+
+# generate Python Manifest for the OpenEmbedded build system
+# (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
+# (C) 2007 Jeremy Laine
+# licensed under MIT, see COPYING.MIT
+#
+# June 22, 2011 -- Mark Hatle <mark.hatle@windriver.com>
+# * Updated to no longer generate special -dbg package, instead use the
+# single system -dbg
+# * Update version with ".1" to indicate this change
+#
+# 2014 Khem Raj <raj.khem@gmail.com>
+# Added python3 support
+#
+import os
+import sys
+import time
+
+VERSION = "3.5.0"
+
+__author__ = "Michael 'Mickey' Lauer <mlauer@vanille-media.de>"
+__version__ = "20140131"
+
+class MakefileMaker:
+
+ def __init__( self, outfile ):
+ """initialize"""
+ self.packages = {}
+ self.targetPrefix = "${libdir}/python%s/" % VERSION[:3]
+ self.output = outfile
+ self.out( """
+# WARNING: This file is AUTO GENERATED: Manual edits will be lost next time I regenerate the file.
+# Generator: '%s' Version %s (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
+# Visit the Python for Embedded Systems Site => http://www.Vanille.de/projects/python.spy
+""" % ( sys.argv[0], __version__ ) )
+
+ #
+ # helper functions
+ #
+
+ def out( self, data ):
+ """print a line to the output file"""
+ self.output.write( "%s\n" % data )
+
+ def setPrefix( self, targetPrefix ):
+ """set a file prefix for addPackage files"""
+ self.targetPrefix = targetPrefix
+
+ def doProlog( self ):
+ self.out( """ """ )
+ self.out( "" )
+
+ def addPackage( self, name, description, dependencies, filenames ):
+ """add a package to the Makefile"""
+ if type( filenames ) == type( "" ):
+ filenames = filenames.split()
+ fullFilenames = []
+ for filename in filenames:
+ if filename[0] != "$":
+ fullFilenames.append( "%s%s" % ( self.targetPrefix, filename ) )
+ else:
+ fullFilenames.append( filename )
+ self.packages[name] = description, dependencies, fullFilenames
+
+ def doBody( self ):
+ """generate body of Makefile"""
+
+ global VERSION
+
+ #
+ # generate provides line
+ #
+
+ provideLine = 'PROVIDES+="'
+ for name in sorted(self.packages):
+ provideLine += "%s " % name
+ provideLine += '"'
+
+ self.out( provideLine )
+ self.out( "" )
+
+ #
+ # generate package line
+ #
+
+ packageLine = 'PACKAGES="${PN}-dbg '
+ for name in sorted(self.packages):
+ if name.startswith("${PN}-distutils"):
+ if name == "${PN}-distutils":
+ packageLine += "%s-staticdev %s " % (name, name)
+ elif name != '${PN}-dbg':
+ packageLine += "%s " % name
+ packageLine += '${PN}-modules"'
+
+ self.out( packageLine )
+ self.out( "" )
+
+ #
+ # generate package variables
+ #
+
+ for name, data in sorted(self.packages.iteritems()):
+ desc, deps, files = data
+
+ #
+ # write out the description, revision and dependencies
+ #
+ self.out( 'SUMMARY_%s="%s"' % ( name, desc ) )
+ self.out( 'RDEPENDS_%s="%s"' % ( name, deps ) )
+
+ line = 'FILES_%s="' % name
+
+ #
+ # check which directories to make in the temporary directory
+ #
+
+ dirset = {} # if python had a set-datatype this would be sufficient. for now, we're using a dict instead.
+ for target in files:
+ dirset[os.path.dirname( target )] = True
+
+ #
+ # generate which files to copy for the target (-dfR because whole directories are also allowed)
+ #
+
+ for target in files:
+ line += "%s " % target
+
+ line += '"'
+ self.out( line )
+ self.out( "" )
+
+ self.out( 'SUMMARY_${PN}-modules="All Python modules"' )
+ line = 'RDEPENDS_${PN}-modules="'
+
+ for name, data in sorted(self.packages.iteritems()):
+ if name not in ['${PN}-dev', '${PN}-distutils-staticdev']:
+ line += "%s " % name
+
+ self.out( "%s \"" % line )
+ self.out( 'ALLOW_EMPTY_${PN}-modules = "1"' )
+
+ def doEpilog( self ):
+ self.out( """""" )
+ self.out( "" )
+
+ def make( self ):
+ self.doProlog()
+ self.doBody()
+ self.doEpilog()
+
+if __name__ == "__main__":
+
+ if len( sys.argv ) > 1:
+ try:
+ os.unlink(sys.argv[1])
+ except Exception:
+ sys.exc_clear()
+ outfile = file( sys.argv[1], "w" )
+ else:
+ outfile = sys.stdout
+
+ m = MakefileMaker( outfile )
+
+ # Add packages here. Only specify dlopen-style library dependencies here, no ldd-style dependencies!
+ # Parameters: revision, name, description, dependencies, filenames
+ #
+
+ m.addPackage( "${PN}-core", "Python interpreter and core modules", "${PN}-lang ${PN}-re ${PN}-reprlib ${PN}-codecs ${PN}-io ${PN}-math",
+ "__future__.* _abcoll.* abc.* ast.* copy.* copyreg.* ConfigParser.* " +
+ "genericpath.* getopt.* linecache.* new.* " +
+ "os.* posixpath.* struct.* " +
+ "warnings.* site.* stat.* " +
+ "UserDict.* UserList.* UserString.* " +
+ "lib-dynload/binascii.*.so lib-dynload/_struct.*.so lib-dynload/time.*.so " +
+ "lib-dynload/xreadlines.*.so types.* platform.* ${bindir}/python* " +
+ "_weakrefset.* sysconfig.* _sysconfigdata.* config/Makefile " +
+ "${includedir}/python${PYTHON_BINABI}/pyconfig*.h " +
+ "${libdir}/python${PYTHON_MAJMIN}/collections " +
+ "${libdir}/python${PYTHON_MAJMIN}/_collections_abc.* " +
+ "${libdir}/python${PYTHON_MAJMIN}/_sitebuiltins.* " +
+ "${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py ")
+
+ m.addPackage( "${PN}-dev", "Python development package", "${PN}-core",
+ "${includedir} " +
+ "${libdir}/lib*${SOLIBSDEV} " +
+ "${libdir}/*.la " +
+ "${libdir}/*.a " +
+ "${libdir}/*.o " +
+ "${libdir}/pkgconfig " +
+ "${base_libdir}/*.a " +
+ "${base_libdir}/*.o " +
+ "${datadir}/aclocal " +
+ "${datadir}/pkgconfig " )
+
+ m.addPackage( "${PN}-2to3", "Python automated Python 2 to 3 code translator", "${PN}-core",
+ "lib2to3" ) # package
+
+ m.addPackage( "${PN}-idle", "Python Integrated Development Environment", "${PN}-core ${PN}-tkinter",
+ "${bindir}/idle idlelib" ) # package
+
+ m.addPackage( "${PN}-pydoc", "Python interactive help support", "${PN}-core ${PN}-lang ${PN}-stringold ${PN}-re",
+ "${bindir}/pydoc pydoc.* pydoc_data" )
+
+ m.addPackage( "${PN}-smtpd", "Python Simple Mail Transport Daemon", "${PN}-core ${PN}-netserver ${PN}-email ${PN}-mime",
+ "${bindir}/smtpd.* smtpd.*" )
+
+ m.addPackage( "${PN}-audio", "Python Audio Handling", "${PN}-core",
+ "wave.* chunk.* sndhdr.* lib-dynload/ossaudiodev.*.so lib-dynload/audioop.*.so audiodev.* sunaudio.* sunau.* toaiff.*" )
+
+ m.addPackage( "${PN}-asyncio", "Python Asynchronous I/O, event loop, coroutines and tasks", "${PN}-core",
+ "asyncio" )
+
+ m.addPackage( "${PN}-codecs", "Python codecs, encodings & i18n support", "${PN}-core ${PN}-lang",
+ "codecs.* encodings gettext.* locale.* lib-dynload/_locale.*.so lib-dynload/_codecs* lib-dynload/_multibytecodec.*.so lib-dynload/unicodedata.*.so stringprep.* xdrlib.*" )
+
+ m.addPackage( "${PN}-compile", "Python bytecode compilation support", "${PN}-core",
+ "py_compile.* compileall.*" )
+
+ m.addPackage( "${PN}-compression", "Python high-level compression support", "${PN}-core ${PN}-codecs",
+ "gzip.* zipfile.* tarfile.* lib-dynload/bz2.*.so" )
+
+ m.addPackage( "${PN}-crypt", "Python basic cryptographic and hashing support", "${PN}-core",
+ "hashlib.* md5.* sha.* lib-dynload/crypt.*.so lib-dynload/_hashlib.*.so lib-dynload/_sha256.*.so lib-dynload/_sha512.*.so" )
+
+ m.addPackage( "${PN}-textutils", "Python option parsing, text wrapping and CSV support", "${PN}-core ${PN}-io ${PN}-re ${PN}-stringold",
+ "lib-dynload/_csv.*.so csv.* optparse.* textwrap.*" )
+
+ m.addPackage( "${PN}-curses", "Python curses support", "${PN}-core",
+ "curses lib-dynload/_curses.*.so lib-dynload/_curses_panel.*.so" ) # directory + low level module
+
+ m.addPackage( "${PN}-ctypes", "Python C types support", "${PN}-core",
+ "ctypes lib-dynload/_ctypes.*.so lib-dynload/_ctypes_test.*.so" ) # directory + low level module
+
+ m.addPackage( "${PN}-datetime", "Python calendar and time support", "${PN}-core ${PN}-codecs",
+ "_strptime.* calendar.* lib-dynload/datetime.*.so" )
+
+ m.addPackage( "${PN}-db", "Python file-based database support", "${PN}-core",
+ "anydbm.* dumbdbm.* whichdb.* dbm lib-dynload/_dbm.*.so" )
+
+ m.addPackage( "${PN}-debugger", "Python debugger", "${PN}-core ${PN}-io ${PN}-lang ${PN}-re ${PN}-stringold ${PN}-shell ${PN}-pprint ${PN}-importlib ${PN}-pkgutil",
+ "bdb.* pdb.*" )
+
+ m.addPackage( "${PN}-difflib", "Python helpers for computing deltas between objects", "${PN}-lang ${PN}-re",
+ "difflib.*" )
+
+ m.addPackage( "${PN}-distutils-staticdev", "Python distribution utilities (static libraries)", "${PN}-distutils",
+ "config/lib*.a" ) # package
+
+ m.addPackage( "${PN}-distutils", "Python Distribution Utilities", "${PN}-core ${PN}-email",
+ "config distutils" ) # package
+
+ m.addPackage( "${PN}-doctest", "Python framework for running examples in docstrings", "${PN}-core ${PN}-lang ${PN}-io ${PN}-re ${PN}-unittest ${PN}-debugger ${PN}-difflib",
+ "doctest.*" )
+
+ m.addPackage( "${PN}-email", "Python email support", "${PN}-core ${PN}-io ${PN}-re ${PN}-mime ${PN}-audio ${PN}-image ${PN}-netclient",
+ "imaplib.* email" ) # package
+
+ m.addPackage( "${PN}-fcntl", "Python's fcntl interface", "${PN}-core",
+ "lib-dynload/fcntl.*.so" )
+
+ m.addPackage( "${PN}-html", "Python HTML processing support", "${PN}-core",
+ "formatter.* htmlentitydefs.* htmllib.* markupbase.* sgmllib.* HTMLParser.* " )
+
+ m.addPackage( "${PN}-importlib", "Python import implementation library", "${PN}-core",
+ "importlib" )
+
+ m.addPackage( "${PN}-gdbm", "Python GNU database support", "${PN}-core",
+ "lib-dynload/_gdbm.*.so" )
+
+ m.addPackage( "${PN}-image", "Python graphical image handling", "${PN}-core",
+ "colorsys.* imghdr.* lib-dynload/imageop.*.so lib-dynload/rgbimg.*.so" )
+
+ m.addPackage( "${PN}-io", "Python low-level I/O", "${PN}-core ${PN}-math",
+ "lib-dynload/_socket.*.so lib-dynload/_io.*.so lib-dynload/_ssl.*.so lib-dynload/select.*.so lib-dynload/termios.*.so lib-dynload/cStringIO.*.so " +
+ "pipes.* socket.* ssl.* tempfile.* StringIO.* io.* _pyio.*" )
+
+ m.addPackage( "${PN}-json", "Python JSON support", "${PN}-core ${PN}-math ${PN}-re",
+ "json lib-dynload/_json.*.so" ) # package
+
+ m.addPackage( "${PN}-lang", "Python low-level language support", "${PN}-core",
+ "lib-dynload/_bisect.*.so lib-dynload/_collections.*.so lib-dynload/_heapq.*.so lib-dynload/_weakref.*.so lib-dynload/_functools.*.so " +
+ "lib-dynload/array.*.so lib-dynload/itertools.*.so lib-dynload/operator.*.so lib-dynload/parser.*.so " +
+ "atexit.* bisect.* code.* codeop.* collections.* _collections_abc.* dis.* functools.* heapq.* inspect.* keyword.* opcode.* symbol.* repr.* token.* " +
+ "tokenize.* traceback.* weakref.*" )
+
+ m.addPackage( "${PN}-logging", "Python logging support", "${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-stringold",
+ "logging" ) # package
+
+ m.addPackage( "${PN}-mailbox", "Python mailbox format support", "${PN}-core ${PN}-mime",
+ "mailbox.*" )
+
+ m.addPackage( "${PN}-math", "Python math support", "${PN}-core",
+ "lib-dynload/cmath.*.so lib-dynload/math.*.so lib-dynload/_random.*.so random.* sets.*" )
+
+ m.addPackage( "${PN}-mime", "Python MIME handling APIs", "${PN}-core ${PN}-io",
+ "mimetools.* uu.* quopri.* rfc822.* MimeWriter.*" )
+
+ m.addPackage( "${PN}-mmap", "Python memory-mapped file support", "${PN}-core ${PN}-io",
+ "lib-dynload/mmap.*.so " )
+
+ m.addPackage( "${PN}-multiprocessing", "Python multiprocessing support", "${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-threading ${PN}-ctypes ${PN}-mmap",
+ "lib-dynload/_multiprocessing.*.so multiprocessing" ) # package
+
+ m.addPackage( "${PN}-netclient", "Python Internet Protocol clients", "${PN}-core ${PN}-crypt ${PN}-datetime ${PN}-io ${PN}-lang ${PN}-logging ${PN}-mime",
+ "*Cookie*.* " +
+ "base64.* cookielib.* ftplib.* gopherlib.* hmac.* httplib.* mimetypes.* nntplib.* poplib.* smtplib.* telnetlib.* urllib uuid.* rfc822.* mimetools.*" )
+
+ m.addPackage( "${PN}-netserver", "Python Internet Protocol servers", "${PN}-core ${PN}-netclient ${PN}-shell ${PN}-threading",
+ "cgi.* *HTTPServer.* SocketServer.*" )
+
+ m.addPackage( "${PN}-numbers", "Python number APIs", "${PN}-core ${PN}-lang ${PN}-re",
+ "decimal.* fractions.* numbers.*" )
+
+ m.addPackage( "${PN}-pickle", "Python serialisation/persistence support", "${PN}-core ${PN}-codecs ${PN}-io ${PN}-re",
+ "pickle.* shelve.* lib-dynload/cPickle.*.so pickletools.*" )
+
+ m.addPackage( "${PN}-pkgutil", "Python package extension utility support", "${PN}-core",
+ "pkgutil.*")
+
+ m.addPackage( "${PN}-pprint", "Python pretty-print support", "${PN}-core ${PN}-io",
+ "pprint.*" )
+
+ m.addPackage( "${PN}-profile", "Python basic performance profiling support", "${PN}-core ${PN}-textutils",
+ "profile.* pstats.* cProfile.* lib-dynload/_lsprof.*.so" )
+
+ m.addPackage( "${PN}-re", "Python Regular Expression APIs", "${PN}-core",
+ "re.* sre.* sre_compile.* sre_constants* sre_parse.*" ) # _sre is builtin
+
+ m.addPackage( "${PN}-readline", "Python readline support", "${PN}-core",
+ "lib-dynload/readline.*.so rlcompleter.*" )
+
+ m.addPackage( "${PN}-reprlib", "Python alternate repr() implementation", "${PN}-core",
+ "reprlib.py" )
+
+ m.addPackage( "${PN}-resource", "Python resource control interface", "${PN}-core",
+ "lib-dynload/resource.*.so" )
+
+ m.addPackage( "${PN}-shell", "Python shell-like functionality", "${PN}-core ${PN}-re",
+ "cmd.* commands.* dircache.* fnmatch.* glob.* popen2.* shlex.* shutil.*" )
+
+ m.addPackage( "${PN}-subprocess", "Python subprocess support", "${PN}-core ${PN}-io ${PN}-re ${PN}-fcntl ${PN}-pickle",
+ "subprocess.*" )
+
+ m.addPackage( "${PN}-sqlite3", "Python Sqlite3 database support", "${PN}-core ${PN}-datetime ${PN}-lang ${PN}-crypt ${PN}-io ${PN}-threading",
+ "lib-dynload/_sqlite3.*.so sqlite3/dbapi2.* sqlite3/__init__.* sqlite3/dump.*" )
+
+ m.addPackage( "${PN}-sqlite3-tests", "Python Sqlite3 database support tests", "${PN}-core ${PN}-sqlite3",
+ "sqlite3/test" )
+
+ m.addPackage( "${PN}-stringold", "Python string APIs [deprecated]", "${PN}-core ${PN}-re",
+ "lib-dynload/strop.*.so string.* stringold.*" )
+
+ m.addPackage( "${PN}-syslog", "Python syslog interface", "${PN}-core",
+ "lib-dynload/syslog.*.so" )
+
+ m.addPackage( "${PN}-terminal", "Python terminal controlling support", "${PN}-core ${PN}-io",
+ "pty.* tty.*" )
+
+ m.addPackage( "${PN}-tests", "Python tests", "${PN}-core",
+ "test" ) # package
+
+ m.addPackage( "${PN}-threading", "Python threading & synchronization support", "${PN}-core ${PN}-lang",
+ "_threading_local.* dummy_thread.* dummy_threading.* mutex.* threading.* Queue.*" )
+
+ m.addPackage( "${PN}-tkinter", "Python Tcl/Tk bindings", "${PN}-core",
+ "lib-dynload/_tkinter.*.so lib-tk tkinter" ) # package
+
+ m.addPackage( "${PN}-unittest", "Python unit testing framework", "${PN}-core ${PN}-stringold ${PN}-lang ${PN}-io ${PN}-difflib ${PN}-pprint ${PN}-shell",
+ "unittest/" )
+
+ m.addPackage( "${PN}-unixadmin", "Python Unix administration support", "${PN}-core",
+ "lib-dynload/nis.*.so lib-dynload/grp.*.so lib-dynload/pwd.*.so getpass.*" )
+
+ m.addPackage( "${PN}-xml", "Python basic XML support", "${PN}-core ${PN}-re",
+ "lib-dynload/_elementtree.*.so lib-dynload/pyexpat.*.so xml xmllib.*" ) # package
+
+ m.addPackage( "${PN}-xmlrpc", "Python XML-RPC support", "${PN}-core ${PN}-xml ${PN}-netserver ${PN}-lang",
+ "xmlrpclib.* SimpleXMLRPCServer.* DocXMLRPCServer.* xmlrpc" )
+
+ m.addPackage( "${PN}-mailbox", "Python mailbox format support", "${PN}-core ${PN}-mime",
+ "mailbox.*" )
+
+ m.make()
diff --git a/import-layers/yocto-poky/scripts/contrib/serdevtry b/import-layers/yocto-poky/scripts/contrib/serdevtry
new file mode 100755
index 000000000..74bd7b716
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/contrib/test_build_time.sh b/import-layers/yocto-poky/scripts/contrib/test_build_time.sh
new file mode 100755
index 000000000..9e5725ae5
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/contrib/test_build_time_worker.sh b/import-layers/yocto-poky/scripts/contrib/test_build_time_worker.sh
new file mode 100755
index 000000000..8e20a9ea7
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/contrib/verify-homepage.py b/import-layers/yocto-poky/scripts/contrib/verify-homepage.py
new file mode 100755
index 000000000..265ff65d3
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/contrib/verify-homepage.py
@@ -0,0 +1,62 @@
+#!/usr/bin/env python
+
+# 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 urllib2
+
+
+# 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.recipecache.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.Cache.virtualfn2realfn(fn)
+ if realfn in checked:
+ continue
+ data = bb.cache.Cache.loadDataFull(realfn, bbhandler.cooker.collection.get_file_appends(realfn), bbhandler.config_data)
+ homepage = data.getVar("HOMEPAGE", True)
+ if homepage:
+ try:
+ urllib2.urlopen(homepage, timeout=5)
+ except Exception:
+ count = count + wgetHomepage(os.path.basename(realfn), homepage)
+ checked.append(realfn)
+ return count
+
+if __name__=='__main__':
+ bbhandler = bb.tinfoil.Tinfoil()
+ bbhandler.prepare()
+ logger.info("Start verifying HOMEPAGE:")
+ failcount = verifyHomepage(bbhandler)
+ logger.info("Finished verifying HOMEPAGE.")
+ logger.info("Summary: %s failed" % failcount)
diff --git a/import-layers/yocto-poky/scripts/cp-noerror b/import-layers/yocto-poky/scripts/cp-noerror
new file mode 100755
index 000000000..28eb90d4a
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/cp-noerror
@@ -0,0 +1,52 @@
+#!/usr/bin/env python
+#
+# 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, err:
+ errors.extend(err.args[0])
+ except EnvironmentError, why:
+ errors.append((srcname, dstname, str(why)))
+ try:
+ shutil.copystat(src, dst)
+ except OSError, 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/import-layers/yocto-poky/scripts/create-pull-request b/import-layers/yocto-poky/scripts/create-pull-request
new file mode 100755
index 000000000..479ad6efc
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/create-pull-request
@@ -0,0 +1,276 @@
+#!/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]
+ -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
+ -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
+ -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
+EOM
+}
+
+# Parse and validate arguments
+while getopts "b:cd: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"
+ 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
+ ;;
+ esac
+done
+
+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 [ -z "$REMOTE_URL" ]; then
+ echo "ERROR: Missing parameter -u, no git remote!"
+ usage
+ exit 1
+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/cgit.cgi/$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
+ 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="--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="$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"
+ 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
+
+# If the user specified a subject, 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/import-layers/yocto-poky/scripts/crosstap b/import-layers/yocto-poky/scripts/crosstap
new file mode 100755
index 000000000..58317cf91
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/crosstap
@@ -0,0 +1,148 @@
+#!/bin/bash
+#
+# Run a systemtap script on remote target
+#
+# Examples (run on build host, target is 192.168.1.xxx):
+# $ source oe-init-build-env"
+# $ cd ~/my/systemtap/scripts"
+#
+# $ crosstap root@192.168.1.xxx myscript.stp"
+# $ crosstap root@192.168.1.xxx myscript-with-args.stp 99 ninetynine"
+#
+# 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 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 <user@hostname> <sytemtap-script> [additional systemtap-script args]"
+}
+
+function setup_usage() {
+ echo ""
+ echo "'crosstap' requires a local sdk build of the target system"
+ echo "(or a build that includes 'tools-profile') in order to build"
+ echo "kernel modules that can probe the target system."
+ echo ""
+ echo "Practically speaking, that means you need to do the following:"
+ echo " - If you're running a pre-built image, download the release"
+ echo " and/or BSP tarballs used to build the image."
+ echo " - If you're working from git sources, just clone the metadata"
+ echo " and BSP layers needed to build the image you'll be booting."
+ echo " - Make sure you're properly set up to build a new image (see"
+ echo " the BSP README and/or the widely available basic documentation"
+ echo " that discusses how to build images)."
+ echo " - Build an -sdk version of the image e.g.:"
+ echo " $ bitbake core-image-sato-sdk"
+ echo " OR"
+ echo " - Build a non-sdk image but include the profiling tools:"
+ echo " [ edit local.conf and add 'tools-profile' to the end of"
+ echo " the EXTRA_IMAGE_FEATURES variable ]"
+ echo " $ bitbake core-image-sato"
+ echo ""
+ echo " [ NOTE that 'crosstap' needs to be able to ssh into the target"
+ echo " system, which isn't enabled by default in -minimal images. ]"
+ echo ""
+ echo "Once you've build the image on the host system, you're ready to"
+ echo "boot it (or the equivalent pre-built image) and use 'crosstap'"
+ echo "to probe it (you need to source the environment as usual first):"
+ echo ""
+ echo " $ source oe-init-build-env"
+ echo " $ cd ~/my/systemtap/scripts"
+ echo " $ crosstap root@192.168.1.xxx myscript.stp"
+ echo ""
+}
+
+function systemtap_target_arch() {
+ SYSTEMTAP_TARGET_ARCH=$1
+ case $SYSTEMTAP_TARGET_ARCH in
+ i?86)
+ SYSTEMTAP_TARGET_ARCH="i386"
+ ;;
+ x86?64*)
+ SYSTEMTAP_TARGET_ARCH="x86_64"
+ ;;
+ arm*)
+ SYSTEMTAP_TARGET_ARCH="arm"
+ ;;
+ powerpc*)
+ SYSTEMTAP_TARGET_ARCH="powerpc"
+ ;;
+ *)
+ ;;
+ esac
+}
+
+if [ $# -lt 2 ]; then
+ usage
+ exit 1
+fi
+
+if [ -z "$BUILDDIR" ]; then
+ echo "Error: Unable to find the BUILDDIR environment variable."
+ echo "Did you forget to source your build system environment setup script?"
+ exit 1
+fi
+
+pushd $PWD
+cd $BUILDDIR
+BITBAKE_VARS=`bitbake -e virtual/kernel`
+popd
+
+STAGING_BINDIR_TOOLCHAIN=$(echo "$BITBAKE_VARS" | grep ^STAGING_BINDIR_TOOLCHAIN \
+ | cut -d '=' -f2 | cut -d '"' -f2)
+STAGING_BINDIR_TOOLPREFIX=$(echo "$BITBAKE_VARS" | grep ^TARGET_PREFIX \
+ | cut -d '=' -f2 | cut -d '"' -f2)
+SYSTEMTAP_HOST_INSTALLDIR=$(echo "$BITBAKE_VARS" | grep ^STAGING_DIR_NATIVE \
+ | cut -d '=' -f2 | cut -d '"' -f2)
+TARGET_ARCH=$(echo "$BITBAKE_VARS" | grep ^TRANSLATED_TARGET_ARCH \
+ | cut -d '=' -f2 | cut -d '"' -f2)
+TARGET_KERNEL_BUILDDIR=$(echo "$BITBAKE_VARS" | grep ^B= \
+ | cut -d '=' -f2 | cut -d '"' -f2)
+
+systemtap_target_arch "$TARGET_ARCH"
+
+if [ ! -d $TARGET_KERNEL_BUILDDIR ] ||
+ [ ! -f $TARGET_KERNEL_BUILDDIR/vmlinux ]; then
+ echo -e "\nError: No target kernel build found."
+ echo -e "Did you forget to create a local build of your image?"
+ setup_usage
+ exit 1
+fi
+
+if [ ! -f $SYSTEMTAP_HOST_INSTALLDIR/usr/bin/stap ]; then
+ echo -e "\nError: Native (host) systemtap not found."
+ echo -e "Did you accidentally build a local non-sdk image? (or forget to"
+ echo -e "add 'tools-profile' to EXTRA_IMAGE_FEATURES in your local.conf)?"
+ setup_usage
+ exit 1
+fi
+
+target_user_hostname="$1"
+full_script_name="$2"
+script_name=$(basename "$2")
+script_base=${script_name%.*}
+shift 2
+
+${SYSTEMTAP_HOST_INSTALLDIR}/usr/bin/stap \
+ -a ${SYSTEMTAP_TARGET_ARCH} \
+ -B CROSS_COMPILE="${STAGING_BINDIR_TOOLCHAIN}/${STAGING_BINDIR_TOOLPREFIX}" \
+ -r ${TARGET_KERNEL_BUILDDIR} \
+ -I ${SYSTEMTAP_HOST_INSTALLDIR}/usr/share/systemtap/tapset \
+ -R ${SYSTEMTAP_HOST_INSTALLDIR}/usr/share/systemtap/runtime \
+ --remote=$target_user_hostname \
+ -m $script_base \
+ $full_script_name "$@"
+
+exit 0
diff --git a/import-layers/yocto-poky/scripts/devtool b/import-layers/yocto-poky/scripts/devtool
new file mode 100755
index 000000000..478039065
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/devtool
@@ -0,0 +1,342 @@
+#!/usr/bin/env python
+
+# 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)
+
+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:
+ for line in f:
+ res = externalsrc_re.match(line.rstrip())
+ if res:
+ pn = res.group(2) or os.path.splitext(os.path.basename(fn))[0].split('_')[0]
+ # 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',
+ pn,
+ bbfile))
+ if recipefile:
+ recipefile = recipefile[0]
+ workspace[pn] = {'srctree': res.group(3),
+ 'bbappend': fn,
+ 'recipefile': recipefile}
+ logger.debug('Found recipe %s' % workspace[pn])
+
+def create_unlockedsigs():
+ """ This function will make unlocked-sigs.inc match the recipes in the
+ workspace. This runs on every run of devtool, but it lets us ensure
+ the unlocked items are in sync with the workspace. """
+
+ confdir = os.path.join(basepath, 'conf')
+ unlockedsigs = os.path.join(confdir, 'unlocked-sigs.inc')
+ bb.utils.mkdirhier(confdir)
+ with open(os.path.join(confdir, 'unlocked-sigs.inc'), '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 workspace:
+ f.write(' ' + pn)
+ f.write('"')
+
+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')
+ # 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. 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 you can remove the path to this\n')
+ f.write('workspace layer from your conf/bblayers.conf file (and then delete the\n')
+ f.write('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
+ _, added = bb.utils.edit_bblayers_conf(bblayers_conf, workspacedir, config.workspace_path)
+ 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
+
+ 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:
+ tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
+ global_args.bbpath = tinfoil.config_data.getVar('BBPATH', True)
+ else:
+ tinfoil = None
+
+ for path in [scripts_path] + global_args.bbpath.split(':'):
+ pluginpath = os.path.join(path, 'lib', 'devtool')
+ scriptutils.load_plugins(logger, plugins, pluginpath)
+
+ if tinfoil:
+ tinfoil.shutdown()
+
+ subparsers = parser.add_subparsers(dest="subparser_name", title='subcommands', metavar='<subcommand>')
+
+ 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()
+ create_unlockedsigs()
+
+ try:
+ ret = args.func(args, config, basepath, workspace)
+ except DevtoolError as err:
+ if str(err):
+ logger.error(str(err))
+ ret = 1
+ 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/import-layers/yocto-poky/scripts/gen-lockedsig-cache b/import-layers/yocto-poky/scripts/gen-lockedsig-cache
new file mode 100755
index 000000000..0986a2165
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/gen-lockedsig-cache
@@ -0,0 +1,57 @@
+#!/usr/bin/env python
+
+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>")
+ sys.exit(1)
+
+print('Reading %s' % sys.argv[1])
+sigs = []
+with open(sys.argv[1]) as f:
+ for l in f.readlines():
+ if ":" in l:
+ sigs.append(l.split(":")[2].split()[0])
+
+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)
+
+ if os.path.exists(dst):
+ os.remove(dst)
+ if (os.stat(f).st_dev == os.stat(destdir).st_dev):
+ print('linking')
+ os.link(f, dst)
+ else:
+ print('copying')
+ shutil.copyfile(f, dst)
+
+print('Done!')
diff --git a/import-layers/yocto-poky/scripts/gen-site-config b/import-layers/yocto-poky/scripts/gen-site-config
new file mode 100755
index 000000000..7da7a0bd8
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/lib/argparse_oe.py b/import-layers/yocto-poky/scripts/lib/argparse_oe.py
new file mode 100644
index 000000000..bf3ebaddf
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/argparse_oe.py
@@ -0,0 +1,129 @@
+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)
+
+ def error(self, message):
+ sys.stderr.write('ERROR: %s\n' % message)
+ self.print_help()
+ sys.exit(2)
+
+ def error_subcommand(self, message, subcommand):
+ if subcommand:
+ for action in self._actions:
+ if isinstance(action, argparse._SubParsersAction):
+ for choice, subparser in action.choices.items():
+ if choice == subcommand:
+ subparser.error(message)
+ return
+ self.error(message)
+
+ def add_subparsers(self, *args, **kwargs):
+ 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)
+
+
+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)
+ for agroup in self._action_groups:
+ if agroup.title == 'optional arguments':
+ agroup.title = 'options'
+ break
+
+ 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)
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/__init__.py b/import-layers/yocto-poky/scripts/lib/bsp/__init__.py
new file mode 100644
index 000000000..8bbb6e153
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/__init__.py
@@ -0,0 +1,22 @@
+#
+# Yocto BSP tools library
+#
+# 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 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
+# Tom Zanussi <tom.zanussi (at] intel.com>
+#
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/engine.py b/import-layers/yocto-poky/scripts/lib/bsp/engine.py
new file mode 100644
index 000000000..66e2162ea
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/engine.py
@@ -0,0 +1,1947 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# 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 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 templating engine used by 'yocto-bsp' to
+# create BSPs. The BSP templates are simply the set of files expected
+# to appear in a generated BSP, marked up with a small set of tags
+# used to customize the output. The engine parses through the
+# templates and generates a Python program containing all the logic
+# and input elements needed to display and retrieve BSP-specific
+# information from the user. The resulting program uses those results
+# to generate the final BSP files.
+#
+# AUTHORS
+# Tom Zanussi <tom.zanussi (at] intel.com>
+#
+
+import os
+import sys
+from abc import ABCMeta, abstractmethod
+from tags import *
+import shlex
+import json
+import subprocess
+import shutil
+
+class Line():
+ """
+ Generic (abstract) container representing a line that will appear
+ in the BSP-generating program.
+ """
+ __metaclass__ = ABCMeta
+
+ def __init__(self, line):
+ self.line = line
+ self.generated_line = ""
+ self.prio = sys.maxint
+ self.discard = False
+
+ @abstractmethod
+ def gen(self, context = None):
+ """
+ Generate the final executable line that will appear in the
+ BSP-generation program.
+ """
+ pass
+
+ def escape(self, line):
+ """
+ Escape single and double quotes and backslashes until I find
+ something better (re.escape() escapes way too much).
+ """
+ return line.replace("\\", "\\\\").replace("\"", "\\\"").replace("'", "\\'")
+
+ def parse_error(self, msg, lineno, line):
+ raise SyntaxError("%s: %s" % (msg, line))
+
+
+class NormalLine(Line):
+ """
+ Container for normal (non-tag) lines.
+ """
+ def __init__(self, line):
+ Line.__init__(self, line)
+ self.is_filename = False
+ self.is_dirname = False
+ self.out_filebase = None
+
+ def gen(self, context = None):
+ if self.is_filename:
+ line = "current_file = \"" + os.path.join(self.out_filebase, self.escape(self.line)) + "\"; of = open(current_file, \"w\")"
+ elif self.is_dirname:
+ dirname = os.path.join(self.out_filebase, self.escape(self.line))
+ line = "if not os.path.exists(\"" + dirname + "\"): os.mkdir(\"" + dirname + "\")"
+ else:
+ line = "of.write(\"" + self.escape(self.line) + "\\n\")"
+ return line
+
+
+class CodeLine(Line):
+ """
+ Container for Python code tag lines.
+ """
+ def __init__(self, line):
+ Line.__init__(self, line)
+
+ def gen(self, context = None):
+ return self.line
+
+
+class Assignment:
+ """
+ Representation of everything we know about {{=name }} tags.
+ Instances of these are used by Assignment lines.
+ """
+ def __init__(self, start, end, name):
+ self.start = start
+ self.end = end
+ self.name = name
+
+
+class AssignmentLine(NormalLine):
+ """
+ Container for normal lines containing assignment tags. Assignment
+ tags must be in ascending order of 'start' value.
+ """
+ def __init__(self, line):
+ NormalLine.__init__(self, line)
+ self.assignments = []
+
+ def add_assignment(self, start, end, name):
+ self.assignments.append(Assignment(start, end, name))
+
+ def gen(self, context = None):
+ line = self.escape(self.line)
+
+ for assignment in self.assignments:
+ replacement = "\" + " + assignment.name + " + \""
+ idx = line.find(ASSIGN_TAG)
+ line = line[:idx] + replacement + line[idx + assignment.end - assignment.start:]
+ if self.is_filename:
+ return "current_file = \"" + os.path.join(self.out_filebase, line) + "\"; of = open(current_file, \"w\")"
+ elif self.is_dirname:
+ dirname = os.path.join(self.out_filebase, line)
+ return "if not os.path.exists(\"" + dirname + "\"): os.mkdir(\"" + dirname + "\")"
+ else:
+ return "of.write(\"" + line + "\\n\")"
+
+
+class InputLine(Line):
+ """
+ Base class for Input lines.
+ """
+ def __init__(self, props, tag, lineno):
+ Line.__init__(self, tag)
+ self.props = props
+ self.lineno = lineno
+
+ try:
+ self.prio = int(props["prio"])
+ except KeyError:
+ self.prio = sys.maxint
+
+ def gen(self, context = None):
+ try:
+ depends_on = self.props["depends-on"]
+ try:
+ depends_on_val = self.props["depends-on-val"]
+ except KeyError:
+ self.parse_error("No 'depends-on-val' for 'depends-on' property",
+ self.lineno, self.line)
+ except KeyError:
+ pass
+
+
+class EditBoxInputLine(InputLine):
+ """
+ Base class for 'editbox' Input lines.
+
+ props:
+ name: example - "Load address"
+ msg: example - "Please enter the load address"
+ result:
+ Sets the value of the variable specified by 'name' to
+ whatever the user typed.
+ """
+ def __init__(self, props, tag, lineno):
+ InputLine.__init__(self, props, tag, lineno)
+
+ def gen(self, context = None):
+ InputLine.gen(self, context)
+ name = self.props["name"]
+ if not name:
+ self.parse_error("No input 'name' property found",
+ self.lineno, self.line)
+ msg = self.props["msg"]
+ if not msg:
+ self.parse_error("No input 'msg' property found",
+ self.lineno, self.line)
+
+ try:
+ default_choice = self.props["default"]
+ except KeyError:
+ default_choice = ""
+
+ msg += " [default: " + default_choice + "]"
+
+ line = name + " = default(raw_input(\"" + msg + " \"), " + name + ")"
+
+ return line
+
+
+class GitRepoEditBoxInputLine(EditBoxInputLine):
+ """
+ Base class for 'editbox' Input lines for user input of remote git
+ repos. This class verifies the existence and connectivity of the
+ specified git repo.
+
+ props:
+ name: example - "Load address"
+ msg: example - "Please enter the load address"
+ result:
+ Sets the value of the variable specified by 'name' to
+ whatever the user typed.
+ """
+ def __init__(self, props, tag, lineno):
+ EditBoxInputLine.__init__(self, props, tag, lineno)
+
+ def gen(self, context = None):
+ EditBoxInputLine.gen(self, context)
+ name = self.props["name"]
+ if not name:
+ self.parse_error("No input 'name' property found",
+ self.lineno, self.line)
+ msg = self.props["msg"]
+ if not msg:
+ self.parse_error("No input 'msg' property found",
+ self.lineno, self.line)
+
+ try:
+ default_choice = self.props["default"]
+ except KeyError:
+ default_choice = ""
+
+ msg += " [default: " + default_choice + "]"
+
+ line = name + " = get_verified_git_repo(\"" + msg + "\"," + name + ")"
+
+ return line
+
+
+class FileEditBoxInputLine(EditBoxInputLine):
+ """
+ Base class for 'editbox' Input lines for user input of existing
+ files. This class verifies the existence of the specified file.
+
+ props:
+ name: example - "Load address"
+ msg: example - "Please enter the load address"
+ result:
+ Sets the value of the variable specified by 'name' to
+ whatever the user typed.
+ """
+ def __init__(self, props, tag, lineno):
+ EditBoxInputLine.__init__(self, props, tag, lineno)
+
+ def gen(self, context = None):
+ EditBoxInputLine.gen(self, context)
+ name = self.props["name"]
+ if not name:
+ self.parse_error("No input 'name' property found",
+ self.lineno, self.line)
+ msg = self.props["msg"]
+ if not msg:
+ self.parse_error("No input 'msg' property found",
+ self.lineno, self.line)
+
+ try:
+ default_choice = self.props["default"]
+ except KeyError:
+ default_choice = ""
+
+ msg += " [default: " + default_choice + "]"
+
+ line = name + " = get_verified_file(\"" + msg + "\"," + name + ", True)"
+
+ return line
+
+
+class BooleanInputLine(InputLine):
+ """
+ Base class for boolean Input lines.
+ props:
+ name: example - "keyboard"
+ msg: example - "Got keyboard?"
+ result:
+ Sets the value of the variable specified by 'name' to "yes" or "no"
+ example - keyboard = "yes"
+ """
+ def __init__(self, props, tag, lineno):
+ InputLine.__init__(self, props, tag, lineno)
+
+ def gen(self, context = None):
+ InputLine.gen(self, context)
+ name = self.props["name"]
+ if not name:
+ self.parse_error("No input 'name' property found",
+ self.lineno, self.line)
+ msg = self.props["msg"]
+ if not msg:
+ self.parse_error("No input 'msg' property found",
+ self.lineno, self.line)
+
+ try:
+ default_choice = self.props["default"]
+ except KeyError:
+ default_choice = ""
+
+ msg += " [default: " + default_choice + "]"
+
+ line = name + " = boolean(raw_input(\"" + msg + " \"), " + name + ")"
+
+ return line
+
+
+class ListInputLine(InputLine):
+ """
+ Base class for List-based Input lines. e.g. Choicelist, Checklist.
+ """
+ __metaclass__ = ABCMeta
+
+ def __init__(self, props, tag, lineno):
+ InputLine.__init__(self, props, tag, lineno)
+ self.choices = []
+
+ def gen_choicepair_list(self):
+ """Generate a list of 2-item val:desc lists from self.choices."""
+ if not self.choices:
+ return None
+
+ choicepair_list = list()
+
+ for choice in self.choices:
+ choicepair = []
+ choicepair.append(choice.val)
+ choicepair.append(choice.desc)
+ choicepair_list.append(choicepair)
+
+ return choicepair_list
+
+ def gen_degenerate_choicepair_list(self, choices):
+ """Generate a list of 2-item val:desc with val=desc from passed-in choices."""
+ choicepair_list = list()
+
+ for choice in choices:
+ choicepair = []
+ choicepair.append(choice)
+ choicepair.append(choice)
+ choicepair_list.append(choicepair)
+
+ return choicepair_list
+
+ def exec_listgen_fn(self, context = None):
+ """
+ Execute the list-generating function contained as a string in
+ the "gen" property.
+ """
+ retval = None
+ try:
+ fname = self.props["gen"]
+ modsplit = fname.split('.')
+ mod_fn = modsplit.pop()
+ mod = '.'.join(modsplit)
+
+ __import__(mod)
+ # python 2.7 has a better way to do this using importlib.import_module
+ m = sys.modules[mod]
+
+ fn = getattr(m, mod_fn)
+ if not fn:
+ self.parse_error("couldn't load function specified for 'gen' property ",
+ self.lineno, self.line)
+ retval = fn(context)
+ if not retval:
+ self.parse_error("function specified for 'gen' property returned nothing ",
+ self.lineno, self.line)
+ except KeyError:
+ pass
+
+ return retval
+
+ def gen_choices_str(self, choicepairs):
+ """
+ Generate a numbered list of choices from a list of choicepairs
+ for display to the user.
+ """
+ choices_str = ""
+
+ for i, choicepair in enumerate(choicepairs):
+ choices_str += "\t" + str(i + 1) + ") " + choicepair[1] + "\n"
+
+ return choices_str
+
+ def gen_choices_val_str(self, choicepairs):
+ """
+ Generate an array of choice values corresponding to the
+ numbered list generated by gen_choices_str().
+ """
+ choices_val_list = "["
+
+ for i, choicepair in enumerate(choicepairs):
+ choices_val_list += "\"" + choicepair[0] + "\","
+ choices_val_list += "]"
+
+ return choices_val_list
+
+ def gen_choices_val_list(self, choicepairs):
+ """
+ Generate an array of choice values corresponding to the
+ numbered list generated by gen_choices_str().
+ """
+ choices_val_list = []
+
+ for i, choicepair in enumerate(choicepairs):
+ choices_val_list.append(choicepair[0])
+
+ return choices_val_list
+
+ def gen_choices_list(self, context = None, checklist = False):
+ """
+ Generate an array of choice values corresponding to the
+ numbered list generated by gen_choices_str().
+ """
+ choices = self.exec_listgen_fn(context)
+ if choices:
+ if len(choices) == 0:
+ self.parse_error("No entries available for input list",
+ self.lineno, self.line)
+ choicepairs = self.gen_degenerate_choicepair_list(choices)
+ else:
+ if len(self.choices) == 0:
+ self.parse_error("No entries available for input list",
+ self.lineno, self.line)
+ choicepairs = self.gen_choicepair_list()
+
+ return choicepairs
+
+ def gen_choices(self, context = None, checklist = False):
+ """
+ Generate an array of choice values corresponding to the
+ numbered list generated by gen_choices_str(), display it to
+ the user, and process the result.
+ """
+ msg = self.props["msg"]
+ if not msg:
+ self.parse_error("No input 'msg' property found",
+ self.lineno, self.line)
+
+ try:
+ default_choice = self.props["default"]
+ except KeyError:
+ default_choice = ""
+
+ msg += " [default: " + default_choice + "]"
+
+ choicepairs = self.gen_choices_list(context, checklist)
+
+ choices_str = self.gen_choices_str(choicepairs)
+ choices_val_list = self.gen_choices_val_list(choicepairs)
+ if checklist:
+ choiceval = default(find_choicevals(raw_input(msg + "\n" + choices_str), choices_val_list), default_choice)
+ else:
+ choiceval = default(find_choiceval(raw_input(msg + "\n" + choices_str), choices_val_list), default_choice)
+
+ return choiceval
+
+
+def find_choiceval(choice_str, choice_list):
+ """
+ Take number as string and return val string from choice_list,
+ empty string if oob. choice_list is a simple python list.
+ """
+ choice_val = ""
+
+ try:
+ choice_idx = int(choice_str)
+ if choice_idx <= len(choice_list):
+ choice_idx -= 1
+ choice_val = choice_list[choice_idx]
+ except ValueError:
+ pass
+
+ return choice_val
+
+
+def find_choicevals(choice_str, choice_list):
+ """
+ Take numbers as space-separated string and return vals list from
+ choice_list, empty list if oob. choice_list is a simple python
+ list.
+ """
+ choice_vals = []
+
+ choices = choice_str.split()
+ for choice in choices:
+ choice_vals.append(find_choiceval(choice, choice_list))
+
+ return choice_vals
+
+
+def default(input_str, name):
+ """
+ Return default if no input_str, otherwise stripped input_str.
+ """
+ if not input_str:
+ return name
+
+ return input_str.strip()
+
+
+def verify_git_repo(giturl):
+ """
+ Verify that the giturl passed in can be connected to. This can be
+ used as a check for the existence of the given repo and/or basic
+ git remote connectivity.
+
+ Returns True if the connection was successful, fals otherwise
+ """
+ if not giturl:
+ return False
+
+ gitcmd = "git ls-remote %s > /dev/null 2>&1" % (giturl)
+ rc = subprocess.call(gitcmd, shell=True)
+ if rc == 0:
+ return True
+
+ return False
+
+
+def get_verified_git_repo(input_str, name):
+ """
+ Return git repo if verified, otherwise loop forever asking user
+ for filename.
+ """
+ msg = input_str.strip() + " "
+
+ giturl = default(raw_input(msg), name)
+
+ while True:
+ if verify_git_repo(giturl):
+ return giturl
+ giturl = default(raw_input(msg), name)
+
+
+def get_verified_file(input_str, name, filename_can_be_null):
+ """
+ Return filename if the file exists, otherwise loop forever asking
+ user for filename.
+ """
+ msg = input_str.strip() + " "
+
+ filename = default(raw_input(msg), name)
+
+ while True:
+ if not filename and filename_can_be_null:
+ return filename
+ if os.path.isfile(filename):
+ return filename
+ filename = default(raw_input(msg), name)
+
+
+def replace_file(replace_this, with_this):
+ """
+ Replace the given file with the contents of filename, retaining
+ the original filename.
+ """
+ try:
+ replace_this.close()
+ shutil.copy(with_this, replace_this.name)
+ except IOError:
+ pass
+
+
+def boolean(input_str, name):
+ """
+ Return lowercase version of first char in string, or value in name.
+ """
+ if not input_str:
+ return name
+
+ str = input_str.lower().strip()
+ if str and str[0] == "y" or str[0] == "n":
+ return str[0]
+ else:
+ return name
+
+
+def strip_base(input_str):
+ """
+ strip '/base' off the end of input_str, so we can use 'base' in
+ the branch names we present to the user.
+ """
+ if input_str and input_str.endswith("/base"):
+ return input_str[:-len("/base")]
+ return input_str.strip()
+
+
+deferred_choices = {}
+
+def gen_choices_defer(input_line, context, checklist = False):
+ """
+ Save the context hashed the name of the input item, which will be
+ passed to the gen function later.
+ """
+ name = input_line.props["name"]
+
+ try:
+ nameappend = input_line.props["nameappend"]
+ except KeyError:
+ nameappend = ""
+
+ try:
+ branches_base = input_line.props["branches_base"]
+ except KeyError:
+ branches_base = ""
+
+ filename = input_line.props["filename"]
+
+ closetag_start = filename.find(CLOSE_TAG)
+
+ if closetag_start != -1:
+ filename = filename[closetag_start + len(CLOSE_TAG):]
+
+ filename = filename.strip()
+ filename = os.path.splitext(filename)[0]
+
+ captured_context = capture_context(context)
+ context["filename"] = filename
+ captured_context["filename"] = filename
+ context["nameappend"] = nameappend
+ captured_context["nameappend"] = nameappend
+ context["branches_base"] = branches_base
+ captured_context["branches_base"] = branches_base
+
+ deferred_choice = (input_line, captured_context, checklist)
+ key = name + "_" + filename + "_" + nameappend
+ deferred_choices[key] = deferred_choice
+
+
+def invoke_deferred_choices(name):
+ """
+ Invoke the choice generation function using the context hashed by
+ 'name'.
+ """
+ deferred_choice = deferred_choices[name]
+ input_line = deferred_choice[0]
+ context = deferred_choice[1]
+ checklist = deferred_choice[2]
+
+ context["name"] = name
+
+ choices = input_line.gen_choices(context, checklist)
+
+ return choices
+
+
+class ChoicelistInputLine(ListInputLine):
+ """
+ Base class for choicelist Input lines.
+ props:
+ name: example - "xserver_choice"
+ msg: example - "Please select an xserver for this machine"
+ result:
+ Sets the value of the variable specified by 'name' to whichever Choice was chosen
+ example - xserver_choice = "xserver_vesa"
+ """
+ def __init__(self, props, tag, lineno):
+ ListInputLine.__init__(self, props, tag, lineno)
+
+ def gen(self, context = None):
+ InputLine.gen(self, context)
+
+ gen_choices_defer(self, context)
+ name = self.props["name"]
+ nameappend = context["nameappend"]
+ filename = context["filename"]
+
+ try:
+ default_choice = self.props["default"]
+ except KeyError:
+ default_choice = ""
+
+ line = name + " = default(invoke_deferred_choices(\"" + name + "_" + filename + "_" + nameappend + "\"), \"" + default_choice + "\")"
+
+ return line
+
+
+class ListValInputLine(InputLine):
+ """
+ Abstract base class for choice and checkbox Input lines.
+ """
+ def __init__(self, props, tag, lineno):
+ InputLine.__init__(self, props, tag, lineno)
+
+ try:
+ self.val = self.props["val"]
+ except KeyError:
+ self.parse_error("No input 'val' property found", self.lineno, self.line)
+
+ try:
+ self.desc = self.props["msg"]
+ except KeyError:
+ self.parse_error("No input 'msg' property found", self.lineno, self.line)
+
+
+class ChoiceInputLine(ListValInputLine):
+ """
+ Base class for choicelist item Input lines.
+ """
+ def __init__(self, props, tag, lineno):
+ ListValInputLine.__init__(self, props, tag, lineno)
+
+ def gen(self, context = None):
+ return None
+
+
+class ChecklistInputLine(ListInputLine):
+ """
+ Base class for checklist Input lines.
+ """
+ def __init__(self, props, tag, lineno):
+ ListInputLine.__init__(self, props, tag, lineno)
+
+ def gen(self, context = None):
+ InputLine.gen(self, context)
+
+ gen_choices_defer(self, context, True)
+ name = self.props["name"]
+ nameappend = context["nameappend"]
+ filename = context["filename"]
+
+ try:
+ default_choice = self.props["default"]
+ except KeyError:
+ default_choice = ""
+
+ line = name + " = default(invoke_deferred_choices(\"" + name + "_" + filename + "_" + nameappend + "\"), \"" + default_choice + "\")"
+
+ return line
+
+
+class CheckInputLine(ListValInputLine):
+ """
+ Base class for checklist item Input lines.
+ """
+ def __init__(self, props, tag, lineno):
+ ListValInputLine.__init__(self, props, tag, lineno)
+
+ def gen(self, context = None):
+ return None
+
+
+dirname_substitutions = {}
+
+class SubstrateBase(object):
+ """
+ Base class for both expanded and unexpanded file and dir container
+ objects.
+ """
+ def __init__(self, filename, filebase, out_filebase):
+ self.filename = filename
+ self.filebase = filebase
+ self.translated_filename = filename
+ self.out_filebase = out_filebase
+ self.raw_lines = []
+ self.expanded_lines = []
+ self.prev_choicelist = None
+
+ def parse_error(self, msg, lineno, line):
+ raise SyntaxError("%s: [%s: %d]: %s" % (msg, self.filename, lineno, line))
+
+ def expand_input_tag(self, tag, lineno):
+ """
+ Input tags consist of the word 'input' at the beginning,
+ followed by name:value property pairs which are converted into
+ a dictionary.
+ """
+ propstr = tag[len(INPUT_TAG):]
+
+ props = dict(prop.split(":", 1) for prop in shlex.split(propstr))
+ props["filename"] = self.filename
+
+ input_type = props[INPUT_TYPE_PROPERTY]
+ if not props[INPUT_TYPE_PROPERTY]:
+ self.parse_error("No input 'type' property found", lineno, tag)
+
+ if input_type == "boolean":
+ return BooleanInputLine(props, tag, lineno)
+ if input_type == "edit":
+ return EditBoxInputLine(props, tag, lineno)
+ if input_type == "edit-git-repo":
+ return GitRepoEditBoxInputLine(props, tag, lineno)
+ if input_type == "edit-file":
+ return FileEditBoxInputLine(props, tag, lineno)
+ elif input_type == "choicelist":
+ self.prev_choicelist = ChoicelistInputLine(props, tag, lineno)
+ return self.prev_choicelist
+ elif input_type == "choice":
+ if not self.prev_choicelist:
+ self.parse_error("Found 'choice' input tag but no previous choicelist",
+ lineno, tag)
+ choice = ChoiceInputLine(props, tag, lineno)
+ self.prev_choicelist.choices.append(choice)
+ return choice
+ elif input_type == "checklist":
+ return ChecklistInputLine(props, tag, lineno)
+ elif input_type == "check":
+ return CheckInputLine(props, tag, lineno)
+
+ def expand_assignment_tag(self, start, line, lineno):
+ """
+ Expand all tags in a line.
+ """
+ expanded_line = AssignmentLine(line.rstrip())
+
+ while start != -1:
+ end = line.find(CLOSE_TAG, start)
+ if end == -1:
+ self.parse_error("No close tag found for assignment tag", lineno, line)
+ else:
+ name = line[start + len(ASSIGN_TAG):end].strip()
+ expanded_line.add_assignment(start, end + len(CLOSE_TAG), name)
+ start = line.find(ASSIGN_TAG, end)
+
+ return expanded_line
+
+ def expand_tag(self, line, lineno):
+ """
+ Returns a processed tag line, or None if there was no tag
+
+ The rules for tags are very simple:
+ - No nested tags
+ - Tags start with {{ and end with }}
+ - An assign tag, {{=, can appear anywhere and will
+ be replaced with what the assignment evaluates to
+ - Any other tag occupies the whole line it is on
+ - if there's anything else on the tag line, it's an error
+ - if it starts with 'input', it's an input tag and
+ will only be used for prompting and setting variables
+ - anything else is straight Python
+ - tags are in effect only until the next blank line or tag or 'pass' tag
+ - we don't have indentation in tags, but we need some way to end a block
+ forcefully without blank lines or other tags - that's the 'pass' tag
+ - todo: implement pass tag
+ - directories and filenames can have tags as well, but only assignment
+ and 'if' code lines
+ - directories and filenames are the only case where normal tags can
+ coexist with normal text on the same 'line'
+ """
+ start = line.find(ASSIGN_TAG)
+ if start != -1:
+ return self.expand_assignment_tag(start, line, lineno)
+
+ start = line.find(OPEN_TAG)
+ if start == -1:
+ return None
+
+ end = line.find(CLOSE_TAG, 0)
+ if end == -1:
+ self.parse_error("No close tag found for open tag", lineno, line)
+
+ tag = line[start + len(OPEN_TAG):end].strip()
+
+ if not tag.lstrip().startswith(INPUT_TAG):
+ return CodeLine(tag)
+
+ return self.expand_input_tag(tag, lineno)
+
+ def append_translated_filename(self, filename):
+ """
+ Simply append filename to translated_filename
+ """
+ self.translated_filename = os.path.join(self.translated_filename, filename)
+
+ def get_substituted_file_or_dir_name(self, first_line, tag):
+ """
+ If file or dir names contain name substitutions, return the name
+ to substitute. Note that this is just the file or dirname and
+ doesn't include the path.
+ """
+ filename = first_line.find(tag)
+ if filename != -1:
+ filename += len(tag)
+ substituted_filename = first_line[filename:].strip()
+ this = substituted_filename.find(" this")
+ if this != -1:
+ head, tail = os.path.split(self.filename)
+ substituted_filename = substituted_filename[:this + 1] + tail
+ if tag == DIRNAME_TAG: # get rid of .noinstall in dirname
+ substituted_filename = substituted_filename.split('.')[0]
+
+ return substituted_filename
+
+ def get_substituted_filename(self, first_line):
+ """
+ If a filename contains a name substitution, return the name to
+ substitute. Note that this is just the filename and doesn't
+ include the path.
+ """
+ return self.get_substituted_file_or_dir_name(first_line, FILENAME_TAG)
+
+ def get_substituted_dirname(self, first_line):
+ """
+ If a dirname contains a name substitution, return the name to
+ substitute. Note that this is just the dirname and doesn't
+ include the path.
+ """
+ return self.get_substituted_file_or_dir_name(first_line, DIRNAME_TAG)
+
+ def substitute_filename(self, first_line):
+ """
+ Find the filename in first_line and append it to translated_filename.
+ """
+ substituted_filename = self.get_substituted_filename(first_line)
+ self.append_translated_filename(substituted_filename);
+
+ def substitute_dirname(self, first_line):
+ """
+ Find the dirname in first_line and append it to translated_filename.
+ """
+ substituted_dirname = self.get_substituted_dirname(first_line)
+ self.append_translated_filename(substituted_dirname);
+
+ def is_filename_substitution(self, line):
+ """
+ Do we have a filename subustition?
+ """
+ if line.find(FILENAME_TAG) != -1:
+ return True
+ return False
+
+ def is_dirname_substitution(self, line):
+ """
+ Do we have a dirname subustition?
+ """
+ if line.find(DIRNAME_TAG) != -1:
+ return True
+ return False
+
+ def translate_dirname(self, first_line):
+ """
+ Just save the first_line mapped by filename. The later pass
+ through the directories will look for a dirname.noinstall
+ match and grab the substitution line.
+ """
+ dirname_substitutions[self.filename] = first_line
+
+ def translate_dirnames_in_path(self, path):
+ """
+ Translate dirnames below this file or dir, not including tail.
+ dirname_substititions is keyed on actual untranslated filenames.
+ translated_path contains the subsititutions for each element.
+ """
+ remainder = path[len(self.filebase)+1:]
+ translated_path = untranslated_path = self.filebase
+
+ untranslated_dirs = remainder.split(os.sep)
+
+ for dir in untranslated_dirs:
+ key = os.path.join(untranslated_path, dir + '.noinstall')
+ try:
+ first_line = dirname_substitutions[key]
+ except KeyError:
+ translated_path = os.path.join(translated_path, dir)
+ untranslated_path = os.path.join(untranslated_path, dir)
+ continue
+ substituted_dir = self.get_substituted_dirname(first_line)
+ translated_path = os.path.join(translated_path, substituted_dir)
+ untranslated_path = os.path.join(untranslated_path, dir)
+
+ return translated_path
+
+ def translate_file_or_dir_name(self):
+ """
+ Originally we were allowed to use open/close/assign tags and python
+ code in the filename, which fit in nicely with the way we
+ processed the templates and generated code. Now that we can't
+ do that, we make those tags proper file contents and have this
+ pass substitute the nice but non-functional names with those
+ 'strange' ones, and then proceed as usual.
+
+ So, if files or matching dir<.noinstall> files contain
+ filename substitutions, this function translates them into the
+ corresponding 'strange' names, which future passes will expand
+ as they always have. The resulting pathname is kept in the
+ file or directory's translated_filename. Another way to think
+ about it is that self.filename is the input filename, and
+ translated_filename is the output filename before expansion.
+ """
+ # remove leaf file or dirname
+ head, tail = os.path.split(self.filename)
+ translated_path = self.translate_dirnames_in_path(head)
+ self.translated_filename = translated_path
+
+ # This is a dirname - does it have a matching .noinstall with
+ # a substitution? If so, apply the dirname subsititution.
+ if not os.path.isfile(self.filename):
+ key = self.filename + ".noinstall"
+ try:
+ first_line = dirname_substitutions[key]
+ except KeyError:
+ self.append_translated_filename(tail)
+ return
+ self.substitute_dirname(first_line)
+ return
+
+ f = open(self.filename)
+ first_line = f.readline()
+ f.close()
+
+ # This is a normal filename not needing translation, just use
+ # it as-is.
+ if not first_line or not first_line.startswith("#"):
+ self.append_translated_filename(tail)
+ return
+
+ # If we have a filename substitution (first line in the file
+ # is a FILENAME_TAG line) do the substitution now. If we have
+ # a dirname substitution (DIRNAME_TAG in dirname.noinstall
+ # meta-file), hash it so we can apply it when we see the
+ # matching dirname later. Otherwise we have a regular
+ # filename, just use it as-is.
+ if self.is_filename_substitution(first_line):
+ self.substitute_filename(first_line)
+ elif self.is_dirname_substitution(first_line):
+ self.translate_dirname(first_line)
+ else:
+ self.append_translated_filename(tail)
+
+ def expand_file_or_dir_name(self):
+ """
+ Expand file or dir names into codeline. Dirnames and
+ filenames can only have assignments or if statements. First
+ translate if statements into CodeLine + (dirname or filename
+ creation).
+ """
+ lineno = 0
+
+ line = self.translated_filename[len(self.filebase):]
+ if line.startswith("/"):
+ line = line[1:]
+ opentag_start = -1
+
+ start = line.find(OPEN_TAG)
+ while start != -1:
+ if not line[start:].startswith(ASSIGN_TAG):
+ opentag_start = start
+ break
+ start += len(ASSIGN_TAG)
+ start = line.find(OPEN_TAG, start)
+
+ if opentag_start != -1:
+ end = line.find(CLOSE_TAG, opentag_start)
+ if end == -1:
+ self.parse_error("No close tag found for open tag", lineno, line)
+ # we have a {{ tag i.e. code
+ tag = line[opentag_start + len(OPEN_TAG):end].strip()
+ if not tag.lstrip().startswith(IF_TAG):
+ self.parse_error("Only 'if' tags are allowed in file or directory names",
+ lineno, line)
+ self.expanded_lines.append(CodeLine(tag))
+
+ # everything after }} is the actual filename (possibly with assignments)
+ # everything before is the pathname
+ line = line[:opentag_start] + line[end + len(CLOSE_TAG):].strip()
+
+ assign_start = line.find(ASSIGN_TAG)
+ if assign_start != -1:
+ assignment_tag = self.expand_assignment_tag(assign_start, line, lineno)
+ if isinstance(self, SubstrateFile):
+ assignment_tag.is_filename = True
+ assignment_tag.out_filebase = self.out_filebase
+ elif isinstance(self, SubstrateDir):
+ assignment_tag.is_dirname = True
+ assignment_tag.out_filebase = self.out_filebase
+ self.expanded_lines.append(assignment_tag)
+ return
+
+ normal_line = NormalLine(line)
+ if isinstance(self, SubstrateFile):
+ normal_line.is_filename = True
+ normal_line.out_filebase = self.out_filebase
+ elif isinstance(self, SubstrateDir):
+ normal_line.is_dirname = True
+ normal_line.out_filebase = self.out_filebase
+ self.expanded_lines.append(normal_line)
+
+ def expand(self):
+ """
+ Expand the file or dir name first, eventually this ends up
+ creating the file or dir.
+ """
+ self.translate_file_or_dir_name()
+ self.expand_file_or_dir_name()
+
+
+class SubstrateFile(SubstrateBase):
+ """
+ Container for both expanded and unexpanded substrate files.
+ """
+ def __init__(self, filename, filebase, out_filebase):
+ SubstrateBase.__init__(self, filename, filebase, out_filebase)
+
+ def read(self):
+ if self.raw_lines:
+ return
+ f = open(self.filename)
+ self.raw_lines = f.readlines()
+
+ def expand(self):
+ """Expand the contents of all template tags in the file."""
+ SubstrateBase.expand(self)
+ self.read()
+
+ for lineno, line in enumerate(self.raw_lines):
+ # only first line can be a filename substitition
+ if lineno == 0 and line.startswith("#") and FILENAME_TAG in line:
+ continue # skip it - we've already expanded it
+ expanded_line = self.expand_tag(line, lineno + 1) # humans not 0-based
+ if not expanded_line:
+ expanded_line = NormalLine(line.rstrip())
+ self.expanded_lines.append(expanded_line)
+
+ def gen(self, context = None):
+ """Generate the code that generates the BSP."""
+ base_indent = 0
+
+ indent = new_indent = base_indent
+
+ for line in self.expanded_lines:
+ genline = line.gen(context)
+ if not genline:
+ continue
+ if isinstance(line, InputLine):
+ line.generated_line = genline
+ continue
+ if genline.startswith(OPEN_START):
+ if indent == 1:
+ base_indent = 1
+ if indent:
+ if genline == BLANKLINE_STR or (not genline.startswith(NORMAL_START)
+ and not genline.startswith(OPEN_START)):
+ indent = new_indent = base_indent
+ if genline.endswith(":"):
+ new_indent = base_indent + 1
+ line.generated_line = (indent * INDENT_STR) + genline
+ indent = new_indent
+
+
+class SubstrateDir(SubstrateBase):
+ """
+ Container for both expanded and unexpanded substrate dirs.
+ """
+ def __init__(self, filename, filebase, out_filebase):
+ SubstrateBase.__init__(self, filename, filebase, out_filebase)
+
+ def expand(self):
+ SubstrateBase.expand(self)
+
+ def gen(self, context = None):
+ """Generate the code that generates the BSP."""
+ indent = new_indent = 0
+ for line in self.expanded_lines:
+ genline = line.gen(context)
+ if not genline:
+ continue
+ if genline.endswith(":"):
+ new_indent = 1
+ else:
+ new_indent = 0
+ line.generated_line = (indent * INDENT_STR) + genline
+ indent = new_indent
+
+
+def expand_target(target, all_files, out_filebase):
+ """
+ Expand the contents of all template tags in the target. This
+ means removing tags and categorizing or creating lines so that
+ future passes can process and present input lines and generate the
+ corresponding lines of the Python program that will be exec'ed to
+ actually produce the final BSP. 'all_files' includes directories.
+ """
+ for root, dirs, files in os.walk(target):
+ for file in files:
+ if file.endswith("~") or file.endswith("#"):
+ continue
+ f = os.path.join(root, file)
+ sfile = SubstrateFile(f, target, out_filebase)
+ sfile.expand()
+ all_files.append(sfile)
+
+ for dir in dirs:
+ d = os.path.join(root, dir)
+ sdir = SubstrateDir(d, target, out_filebase)
+ sdir.expand()
+ all_files.append(sdir)
+
+
+def gen_program_machine_lines(machine, program_lines):
+ """
+ Use the input values we got from the command line.
+ """
+ line = "machine = \"" + machine + "\""
+ program_lines.append(line)
+
+ line = "layer_name = \"" + machine + "\""
+ program_lines.append(line)
+
+
+def sort_inputlines(input_lines):
+ """Sort input lines according to priority (position)."""
+ input_lines.sort(key = lambda l: l.prio)
+
+
+def find_parent_dependency(lines, depends_on):
+ for i, line in lines:
+ if isinstance(line, CodeLine):
+ continue
+ if line.props["name"] == depends_on:
+ return i
+
+ return -1
+
+
+def process_inputline_dependencies(input_lines, all_inputlines):
+ """If any input lines depend on others, put the others first."""
+ for line in input_lines:
+ if isinstance(line, InputLineGroup):
+ group_inputlines = []
+ process_inputline_dependencies(line.group, group_inputlines)
+ line.group = group_inputlines
+ all_inputlines.append(line)
+ continue
+
+ if isinstance(line, CodeLine) or isinstance(line, NormalLine):
+ all_inputlines.append(line)
+ continue
+
+ try:
+ depends_on = line.props["depends-on"]
+ depends_codeline = "if " + line.props["depends-on"] + " == \"" + line.props["depends-on-val"] + "\":"
+ all_inputlines.append(CodeLine(depends_codeline))
+ all_inputlines.append(line)
+ except KeyError:
+ all_inputlines.append(line)
+
+
+def conditional_filename(filename):
+ """
+ Check if the filename itself contains a conditional statement. If
+ so, return a codeline for it.
+ """
+ opentag_start = filename.find(OPEN_TAG)
+
+ if opentag_start != -1:
+ if filename[opentag_start:].startswith(ASSIGN_TAG):
+ return None
+ end = filename.find(CLOSE_TAG, opentag_start)
+ if end == -1:
+ print "No close tag found for open tag in filename %s" % filename
+ sys.exit(1)
+
+ # we have a {{ tag i.e. code
+ tag = filename[opentag_start + len(OPEN_TAG):end].strip()
+ if not tag.lstrip().startswith(IF_TAG):
+ print "Only 'if' tags are allowed in file or directory names, filename: %s" % filename
+ sys.exit(1)
+
+ return CodeLine(tag)
+
+ return None
+
+
+class InputLineGroup(InputLine):
+ """
+ InputLine that does nothing but group other input lines
+ corresponding to all the input lines in a SubstrateFile so they
+ can be generated as a group. prio is the only property used.
+ """
+ def __init__(self, codeline):
+ InputLine.__init__(self, {}, "", 0)
+ self.group = []
+ self.prio = sys.maxint
+ self.group.append(codeline)
+
+ def append(self, line):
+ self.group.append(line)
+ if line.prio < self.prio:
+ self.prio = line.prio
+
+ def len(self):
+ return len(self.group)
+
+
+def gather_inputlines(files):
+ """
+ Gather all the InputLines - we want to generate them first.
+ """
+ all_inputlines = []
+ input_lines = []
+
+ for file in files:
+ if isinstance(file, SubstrateFile):
+ group = None
+ basename = os.path.basename(file.translated_filename)
+
+ codeline = conditional_filename(basename)
+ if codeline:
+ group = InputLineGroup(codeline)
+
+ have_condition = False
+ condition_to_write = None
+ for line in file.expanded_lines:
+ if isinstance(line, CodeLine):
+ have_condition = True
+ condition_to_write = line
+ continue
+ if isinstance(line, InputLine):
+ if group:
+ if condition_to_write:
+ condition_to_write.prio = line.prio
+ condition_to_write.discard = True
+ group.append(condition_to_write)
+ condition_to_write = None
+ group.append(line)
+ else:
+ if condition_to_write:
+ condition_to_write.prio = line.prio
+ condition_to_write.discard = True
+ input_lines.append(condition_to_write)
+ condition_to_write = None
+ input_lines.append(line)
+ else:
+ if condition_to_write:
+ condition_to_write = None
+ if have_condition:
+ if not line.line.strip():
+ line.discard = True
+ input_lines.append(line)
+ have_condition = False
+
+ if group and group.len() > 1:
+ input_lines.append(group)
+
+ sort_inputlines(input_lines)
+ process_inputline_dependencies(input_lines, all_inputlines)
+
+ return all_inputlines
+
+
+def run_program_lines(linelist, codedump):
+ """
+ For a single file, print all the python code into a buf and execute it.
+ """
+ buf = "\n".join(linelist)
+
+ if codedump:
+ of = open("bspgen.out", "w")
+ of.write(buf)
+ of.close()
+ exec buf
+
+
+def gen_target(files, context = None):
+ """
+ Generate the python code for each file.
+ """
+ for file in files:
+ file.gen(context)
+
+
+def gen_program_header_lines(program_lines):
+ """
+ Generate any imports we need.
+ """
+ program_lines.append("current_file = \"\"")
+
+
+def gen_supplied_property_vals(properties, program_lines):
+ """
+ Generate user-specified entries for input values instead of
+ generating input prompts.
+ """
+ for name, val in properties.iteritems():
+ program_line = name + " = \"" + val + "\""
+ program_lines.append(program_line)
+
+
+def gen_initial_property_vals(input_lines, program_lines):
+ """
+ Generate null or default entries for input values, so we don't
+ have undefined variables.
+ """
+ for line in input_lines:
+ if isinstance(line, InputLineGroup):
+ gen_initial_property_vals(line.group, program_lines)
+ continue
+
+ if isinstance(line, InputLine):
+ try:
+ name = line.props["name"]
+ try:
+ default_val = "\"" + line.props["default"] + "\""
+ except:
+ default_val = "\"\""
+ program_line = name + " = " + default_val
+ program_lines.append(program_line)
+ except KeyError:
+ pass
+
+
+def gen_program_input_lines(input_lines, program_lines, context, in_group = False):
+ """
+ Generate only the input lines used for prompting the user. For
+ that, we only have input lines and CodeLines that affect the next
+ input line.
+ """
+ indent = new_indent = 0
+
+ for line in input_lines:
+ if isinstance(line, InputLineGroup):
+ gen_program_input_lines(line.group, program_lines, context, True)
+ continue
+ if not line.line.strip():
+ continue
+
+ genline = line.gen(context)
+ if not genline:
+ continue
+ if genline.endswith(":"):
+ new_indent += 1
+ else:
+ if indent > 1 or (not in_group and indent):
+ new_indent -= 1
+
+ line.generated_line = (indent * INDENT_STR) + genline
+ program_lines.append(line.generated_line)
+
+ indent = new_indent
+
+
+def gen_program_lines(target_files, program_lines):
+ """
+ Generate the program lines that make up the BSP generation
+ program. This appends the generated lines of all target_files to
+ program_lines, and skips input lines, which are dealt with
+ separately, or omitted.
+ """
+ for file in target_files:
+ if file.filename.endswith("noinstall"):
+ continue
+
+ for line in file.expanded_lines:
+ if isinstance(line, InputLine):
+ continue
+ if line.discard:
+ continue
+
+ program_lines.append(line.generated_line)
+
+
+def create_context(machine, arch, scripts_path):
+ """
+ Create a context object for use in deferred function invocation.
+ """
+ context = {}
+
+ context["machine"] = machine
+ context["arch"] = arch
+ context["scripts_path"] = scripts_path
+
+ return context
+
+
+def capture_context(context):
+ """
+ Create a context object for use in deferred function invocation.
+ """
+ captured_context = {}
+
+ captured_context["machine"] = context["machine"]
+ captured_context["arch"] = context["arch"]
+ captured_context["scripts_path"] = context["scripts_path"]
+
+ return captured_context
+
+
+def expand_targets(context, bsp_output_dir, expand_common=True):
+ """
+ Expand all the tags in both the common and machine-specific
+ 'targets'.
+
+ If expand_common is False, don't expand the common target (this
+ option is used to create special-purpose layers).
+ """
+ target_files = []
+
+ machine = context["machine"]
+ arch = context["arch"]
+ scripts_path = context["scripts_path"]
+
+ lib_path = scripts_path + '/lib'
+ bsp_path = lib_path + '/bsp'
+ arch_path = bsp_path + '/substrate/target/arch'
+
+ if expand_common:
+ common = os.path.join(arch_path, "common")
+ expand_target(common, target_files, bsp_output_dir)
+
+ arches = os.listdir(arch_path)
+ if arch not in arches or arch == "common":
+ print "Invalid karch, exiting\n"
+ sys.exit(1)
+
+ target = os.path.join(arch_path, arch)
+ expand_target(target, target_files, bsp_output_dir)
+
+ gen_target(target_files, context)
+
+ return target_files
+
+
+def yocto_common_create(machine, target, scripts_path, layer_output_dir, codedump, properties_file, properties_str="", expand_common=True):
+ """
+ Common layer-creation code
+
+ machine - user-defined machine name (if needed, will generate 'machine' var)
+ target - the 'target' the layer will be based on, must be one in
+ scripts/lib/bsp/substrate/target/arch
+ scripts_path - absolute path to yocto /scripts dir
+ layer_output_dir - dirname to create for layer
+ codedump - dump generated code to bspgen.out
+ properties_file - use values from this file if nonempty i.e no prompting
+ properties_str - use values from this string if nonempty i.e no prompting
+ expand_common - boolean, use the contents of (for bsp layers) arch/common
+ """
+ if os.path.exists(layer_output_dir):
+ print "\nlayer output dir already exists, exiting. (%s)" % layer_output_dir
+ sys.exit(1)
+
+ properties = None
+
+ if properties_file:
+ try:
+ infile = open(properties_file, "r")
+ except IOError:
+ print "Couldn't open properties file %s for reading, exiting" % properties_file
+ sys.exit(1)
+
+ properties = json.load(infile)
+
+ if properties_str and not properties:
+ properties = json.loads(properties_str)
+
+ os.mkdir(layer_output_dir)
+
+ context = create_context(machine, target, scripts_path)
+ target_files = expand_targets(context, layer_output_dir, expand_common)
+
+ input_lines = gather_inputlines(target_files)
+
+ program_lines = []
+
+ gen_program_header_lines(program_lines)
+
+ gen_initial_property_vals(input_lines, program_lines)
+
+ if properties:
+ gen_supplied_property_vals(properties, program_lines)
+
+ gen_program_machine_lines(machine, program_lines)
+
+ if not properties:
+ gen_program_input_lines(input_lines, program_lines, context)
+
+ gen_program_lines(target_files, program_lines)
+
+ run_program_lines(program_lines, codedump)
+
+
+def yocto_layer_create(layer_name, scripts_path, layer_output_dir, codedump, properties_file, properties=""):
+ """
+ Create yocto layer
+
+ layer_name - user-defined layer name
+ scripts_path - absolute path to yocto /scripts dir
+ layer_output_dir - dirname to create for layer
+ codedump - dump generated code to bspgen.out
+ properties_file - use values from this file if nonempty i.e no prompting
+ properties - use values from this string if nonempty i.e no prompting
+ """
+ yocto_common_create(layer_name, "layer", scripts_path, layer_output_dir, codedump, properties_file, properties, False)
+
+ print "\nNew layer created in %s.\n" % (layer_output_dir)
+ print "Don't forget to add it to your BBLAYERS (for details see %s/README)." % (layer_output_dir)
+
+
+def yocto_bsp_create(machine, arch, scripts_path, bsp_output_dir, codedump, properties_file, properties=None):
+ """
+ Create bsp
+
+ machine - user-defined machine name
+ arch - the arch the bsp will be based on, must be one in
+ scripts/lib/bsp/substrate/target/arch
+ scripts_path - absolute path to yocto /scripts dir
+ bsp_output_dir - dirname to create for BSP
+ codedump - dump generated code to bspgen.out
+ properties_file - use values from this file if nonempty i.e no prompting
+ properties - use values from this string if nonempty i.e no prompting
+ """
+ yocto_common_create(machine, arch, scripts_path, bsp_output_dir, codedump, properties_file, properties)
+
+ print "\nNew %s BSP created in %s" % (arch, bsp_output_dir)
+
+
+def print_dict(items, indent = 0):
+ """
+ Print the values in a possibly nested dictionary.
+ """
+ for key, val in items.iteritems():
+ print " "*indent + "\"%s\" :" % key,
+ if type(val) == dict:
+ print "{"
+ print_dict(val, indent + 1)
+ print " "*indent + "}"
+ else:
+ print "%s" % val
+
+
+def get_properties(input_lines):
+ """
+ Get the complete set of properties for all the input items in the
+ BSP, as a possibly nested dictionary.
+ """
+ properties = {}
+
+ for line in input_lines:
+ if isinstance(line, InputLineGroup):
+ statement = line.group[0].line
+ group_properties = get_properties(line.group)
+ properties[statement] = group_properties
+ continue
+
+ if not isinstance(line, InputLine):
+ continue
+
+ if isinstance(line, ChoiceInputLine):
+ continue
+
+ props = line.props
+ item = {}
+ name = props["name"]
+ for key, val in props.items():
+ if not key == "name":
+ item[key] = val
+ properties[name] = item
+
+ return properties
+
+
+def yocto_layer_list_properties(arch, scripts_path, properties_file, expand_common=True):
+ """
+ List the complete set of properties for all the input items in the
+ layer. If properties_file is non-null, write the complete set of
+ properties as a nested JSON object corresponding to a possibly
+ nested dictionary.
+ """
+ context = create_context("unused", arch, scripts_path)
+ target_files = expand_targets(context, "unused", expand_common)
+
+ input_lines = gather_inputlines(target_files)
+
+ properties = get_properties(input_lines)
+ if properties_file:
+ try:
+ of = open(properties_file, "w")
+ except IOError:
+ print "Couldn't open properties file %s for writing, exiting" % properties_file
+ sys.exit(1)
+
+ json.dump(properties, of, indent=1)
+ else:
+ print_dict(properties)
+
+
+def split_nested_property(property):
+ """
+ A property name of the form x.y describes a nested property
+ i.e. the property y is contained within x and can be addressed
+ using standard JSON syntax for nested properties. Note that if a
+ property name itself contains '.', it should be contained in
+ double quotes.
+ """
+ splittable_property = ""
+ in_quotes = False
+ for c in property:
+ if c == '.' and not in_quotes:
+ splittable_property += '\n'
+ continue
+ if c == '"':
+ in_quotes = not in_quotes
+ splittable_property += c
+
+ split_properties = splittable_property.split('\n')
+
+ if len(split_properties) > 1:
+ return split_properties
+
+ return None
+
+
+def find_input_line_group(substring, input_lines):
+ """
+ Find and return the InputLineGroup containing the specified substring.
+ """
+ for line in input_lines:
+ if isinstance(line, InputLineGroup):
+ if substring in line.group[0].line:
+ return line
+
+ return None
+
+
+def find_input_line(name, input_lines):
+ """
+ Find the input line with the specified name.
+ """
+ for line in input_lines:
+ if isinstance(line, InputLineGroup):
+ l = find_input_line(name, line.group)
+ if l:
+ return l
+
+ if isinstance(line, InputLine):
+ try:
+ if line.props["name"] == name:
+ return line
+ if line.props["name"] + "_" + line.props["nameappend"] == name:
+ return line
+ except KeyError:
+ pass
+
+ return None
+
+
+def print_values(type, values_list):
+ """
+ Print the values in the given list of values.
+ """
+ if type == "choicelist":
+ for value in values_list:
+ print "[\"%s\", \"%s\"]" % (value[0], value[1])
+ elif type == "boolean":
+ for value in values_list:
+ print "[\"%s\", \"%s\"]" % (value[0], value[1])
+
+
+def yocto_layer_list_property_values(arch, property, scripts_path, properties_file, expand_common=True):
+ """
+ List the possible values for a given input property. If
+ properties_file is non-null, write the complete set of properties
+ as a JSON object corresponding to an array of possible values.
+ """
+ context = create_context("unused", arch, scripts_path)
+ context["name"] = property
+
+ target_files = expand_targets(context, "unused", expand_common)
+
+ input_lines = gather_inputlines(target_files)
+
+ properties = get_properties(input_lines)
+
+ nested_properties = split_nested_property(property)
+ if nested_properties:
+ # currently the outer property of a nested property always
+ # corresponds to an input line group
+ input_line_group = find_input_line_group(nested_properties[0], input_lines)
+ if input_line_group:
+ input_lines[:] = input_line_group.group[1:]
+ # The inner property of a nested property name is the
+ # actual property name we want, so reset to that
+ property = nested_properties[1]
+
+ input_line = find_input_line(property, input_lines)
+ if not input_line:
+ print "Couldn't find values for property %s" % property
+ return
+
+ values_list = []
+
+ type = input_line.props["type"]
+ if type == "boolean":
+ values_list.append(["y", "n"])
+ elif type == "choicelist" or type == "checklist":
+ try:
+ gen_fn = input_line.props["gen"]
+ if nested_properties:
+ context["filename"] = nested_properties[0]
+ try:
+ context["branches_base"] = input_line.props["branches_base"]
+ except KeyError:
+ context["branches_base"] = None
+ values_list = input_line.gen_choices_list(context, False)
+ except KeyError:
+ for choice in input_line.choices:
+ choicepair = []
+ choicepair.append(choice.val)
+ choicepair.append(choice.desc)
+ values_list.append(choicepair)
+
+ if properties_file:
+ try:
+ of = open(properties_file, "w")
+ except IOError:
+ print "Couldn't open properties file %s for writing, exiting" % properties_file
+ sys.exit(1)
+
+ json.dump(values_list, of)
+
+ print_values(type, values_list)
+
+
+def yocto_bsp_list(args, scripts_path, properties_file):
+ """
+ Print available architectures, or the complete list of properties
+ defined by the BSP, or the possible values for a particular BSP
+ property.
+ """
+ if len(args) < 1:
+ return False
+
+ if args[0] == "karch":
+ lib_path = scripts_path + '/lib'
+ bsp_path = lib_path + '/bsp'
+ arch_path = bsp_path + '/substrate/target/arch'
+ print "Architectures available:"
+ for arch in os.listdir(arch_path):
+ if arch == "common" or arch == "layer":
+ continue
+ print " %s" % arch
+ return True
+ else:
+ arch = args[0]
+
+ if len(args) < 2 or len(args) > 3:
+ return False
+
+ if len(args) == 2:
+ if args[1] == "properties":
+ yocto_layer_list_properties(arch, scripts_path, properties_file)
+ else:
+ return False
+
+ if len(args) == 3:
+ if args[1] == "property":
+ yocto_layer_list_property_values(arch, args[2], scripts_path, properties_file)
+ else:
+ return False
+
+ return True
+
+
+def yocto_layer_list(args, scripts_path, properties_file):
+ """
+ Print the complete list of input properties defined by the layer,
+ or the possible values for a particular layer property.
+ """
+ if len(args) < 1:
+ return False
+
+ if len(args) < 1 or len(args) > 2:
+ return False
+
+ if len(args) == 1:
+ if args[0] == "properties":
+ yocto_layer_list_properties("layer", scripts_path, properties_file, False)
+ else:
+ return False
+
+ if len(args) == 2:
+ if args[0] == "property":
+ yocto_layer_list_property_values("layer", args[1], scripts_path, properties_file, False)
+ else:
+ return False
+
+ return True
+
+
+def map_standard_kbranch(need_new_kbranch, new_kbranch, existing_kbranch):
+ """
+ Return the linux-yocto bsp branch to use with the specified
+ kbranch. This handles the -standard variants for 3.4 and 3.8; the
+ other variants don't need mappings.
+ """
+ if need_new_kbranch == "y":
+ kbranch = new_kbranch
+ else:
+ kbranch = existing_kbranch
+
+ if kbranch.startswith("standard/common-pc-64"):
+ return "bsp/common-pc-64/common-pc-64-standard.scc"
+ if kbranch.startswith("standard/common-pc"):
+ return "bsp/common-pc/common-pc-standard.scc"
+ else:
+ return "ktypes/standard/standard.scc"
+
+
+def map_preempt_rt_kbranch(need_new_kbranch, new_kbranch, existing_kbranch):
+ """
+ Return the linux-yocto bsp branch to use with the specified
+ kbranch. This handles the -preempt-rt variants for 3.4 and 3.8;
+ the other variants don't need mappings.
+ """
+ if need_new_kbranch == "y":
+ kbranch = new_kbranch
+ else:
+ kbranch = existing_kbranch
+
+ if kbranch.startswith("standard/preempt-rt/common-pc-64"):
+ return "bsp/common-pc-64/common-pc-64-preempt-rt.scc"
+ if kbranch.startswith("standard/preempt-rt/common-pc"):
+ return "bsp/common-pc/common-pc-preempt-rt.scc"
+ else:
+ return "ktypes/preempt-rt/preempt-rt.scc"
+
+
+def map_tiny_kbranch(need_new_kbranch, new_kbranch, existing_kbranch):
+ """
+ Return the linux-yocto bsp branch to use with the specified
+ kbranch. This handles the -tiny variants for 3.4 and 3.8; the
+ other variants don't need mappings.
+ """
+ if need_new_kbranch == "y":
+ kbranch = new_kbranch
+ else:
+ kbranch = existing_kbranch
+
+ if kbranch.startswith("standard/tiny/common-pc"):
+ return "bsp/common-pc/common-pc-tiny.scc"
+ else:
+ return "ktypes/tiny/tiny.scc"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/help.py b/import-layers/yocto-poky/scripts/lib/bsp/help.py
new file mode 100644
index 000000000..85a09dd29
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/help.py
@@ -0,0 +1,1046 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# 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 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 Yocto BSP Tools.
+#
+# AUTHORS
+# Tom Zanussi <tom.zanussi (at] intel.com>
+#
+
+import subprocess
+import logging
+
+
+def subcommand_error(args):
+ logging.info("invalid subcommand %s" % args[0])
+
+
+def display_help(subcommand, subcommands):
+ """
+ Display help for subcommand.
+ """
+ if subcommand not in subcommands:
+ return False
+
+ help = subcommands.get(subcommand, subcommand_error)[2]
+ pager = subprocess.Popen('less', stdin=subprocess.PIPE)
+ pager.communicate(help)
+
+ return True
+
+
+def yocto_help(args, usage_str, subcommands):
+ """
+ Subcommand help dispatcher.
+ """
+ if len(args) == 1 or not display_help(args[1], subcommands):
+ print(usage_str)
+
+
+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:
+ logging.error("No subcommand specified, exiting")
+ parser.print_help()
+ elif args[0] == "help":
+ yocto_help(args, main_command_usage, subcommands)
+ elif args[0] not in subcommands:
+ logging.error("Unsupported subcommand %s, exiting\n" % (args[0]))
+ parser.print_help()
+ else:
+ usage = subcommands.get(args[0], subcommand_error)[1]
+ subcommands.get(args[0], subcommand_error)[0](args[1:], usage)
+
+
+##
+# yocto-bsp help and usage strings
+##
+
+yocto_bsp_usage = """
+
+ Create a customized Yocto BSP layer.
+
+ usage: yocto-bsp [--version] [--help] COMMAND [ARGS]
+
+ Current 'yocto-bsp' commands are:
+ create Create a new Yocto BSP
+ list List available values for options and BSP properties
+
+ See 'yocto-bsp help COMMAND' for more information on a specific command.
+"""
+
+yocto_bsp_help_usage = """
+
+ usage: yocto-bsp help <subcommand>
+
+ This command displays detailed help for the specified subcommand.
+"""
+
+yocto_bsp_create_usage = """
+
+ Create a new Yocto BSP
+
+ usage: yocto-bsp create <bsp-name> <karch> [-o <DIRNAME> | --outdir <DIRNAME>]
+ [-i <JSON PROPERTY FILE> | --infile <JSON PROPERTY_FILE>]
+ [-c | --codedump] [-s | --skip-git-check]
+
+ This command creates a Yocto BSP based on the specified parameters.
+ The new BSP will be a new Yocto BSP layer contained by default within
+ the top-level directory specified as 'meta-bsp-name'. The -o option
+ can be used to place the BSP layer in a directory with a different
+ name and location.
+
+ The value of the 'karch' parameter determines the set of files that
+ will be generated for the BSP, along with the specific set of
+ 'properties' that will be used to fill out the BSP-specific portions
+ of the BSP. The possible values for the 'karch' parameter can be
+ listed via 'yocto-bsp list karch'.
+
+ NOTE: Once created, you should add your new layer to your
+ bblayers.conf file in order for it to be subsequently seen and
+ modified by the yocto-kernel tool.
+
+ See 'yocto bsp help create' for more detailed instructions.
+"""
+
+yocto_bsp_create_help = """
+
+NAME
+ yocto-bsp create - Create a new Yocto BSP
+
+SYNOPSIS
+ yocto-bsp create <bsp-name> <karch> [-o <DIRNAME> | --outdir <DIRNAME>]
+ [-i <JSON PROPERTY FILE> | --infile <JSON PROPERTY_FILE>]
+ [-c | --codedump] [-s | --skip-git-check]
+
+DESCRIPTION
+ This command creates a Yocto BSP based on the specified
+ parameters. The new BSP will be a new Yocto BSP layer contained
+ by default within the top-level directory specified as
+ 'meta-bsp-name'. The -o option can be used to place the BSP layer
+ in a directory with a different name and location.
+
+ The value of the 'karch' parameter determines the set of files
+ that will be generated for the BSP, along with the specific set of
+ 'properties' that will be used to fill out the BSP-specific
+ portions of the BSP. The possible values for the 'karch' parameter
+ can be listed via 'yocto-bsp list karch'.
+
+ The BSP-specific properties that define the values that will be
+ used to generate a particular BSP can be specified on the
+ command-line using the -i option and supplying a JSON object
+ consisting of the set of name:value pairs needed by the BSP.
+
+ If the -i option is not used, the user will be interactively
+ prompted for each of the required property values, which will then
+ be used as values for BSP generation.
+
+ The set of properties available for a given architecture can be
+ listed using the 'yocto-bsp list' command.
+
+ Specifying -c causes the Python code generated and executed to
+ create the BSP to be dumped to the 'bspgen.out' file in the
+ current directory, and is useful for debugging.
+
+ NOTE: Once created, you should add your new layer to your
+ bblayers.conf file in order for it to be subsequently seen and
+ modified by the yocto-kernel tool.
+
+ For example, assuming your poky repo is at /path/to/poky, your new
+ BSP layer is at /path/to/poky/meta-mybsp, and your build directory
+ is /path/to/build:
+
+ $ gedit /path/to/build/conf/bblayers.conf
+
+ BBLAYERS ?= " \\
+ /path/to/poky/meta \\
+ /path/to/poky/meta-poky \\
+ /path/to/poky/meta-mybsp \\
+ "
+"""
+
+yocto_bsp_list_usage = """
+
+ usage: yocto-bsp list karch
+ yocto-bsp list <karch> properties
+ [-o <JSON PROPERTY FILE> | --outfile <JSON PROPERTY_FILE>]
+ yocto-bsp list <karch> property <xxx>
+ [-o <JSON PROPERTY FILE> | --outfile <JSON PROPERTY_FILE>]
+
+ This command enumerates the complete set of possible values for a
+ specified option or property needed by the BSP creation process.
+
+ The first form enumerates all the possible values that exist and can
+ be specified for the 'karch' parameter to the 'yocto bsp create'
+ command.
+
+ The second form enumerates all the possible properties that exist and
+ must have values specified for them in the 'yocto bsp create' command
+ for the given 'karch'.
+
+ The third form enumerates all the possible values that exist and can
+ be specified for any of the enumerable properties of the given
+ 'karch' in the 'yocto bsp create' command.
+
+ See 'yocto-bsp help list' for more details.
+"""
+
+yocto_bsp_list_help = """
+
+NAME
+ yocto-bsp list - List available values for options and BSP properties
+
+SYNOPSIS
+ yocto-bsp list karch
+ yocto-bsp list <karch> properties
+ [--o <JSON PROPERTY FILE> | -outfile <JSON PROPERTY_FILE>]
+ yocto-bsp list <karch> property <xxx>
+ [--o <JSON PROPERTY FILE> | -outfile <JSON PROPERTY_FILE>]
+
+DESCRIPTION
+ This command enumerates the complete set of possible values for a
+ specified option or property needed by the BSP creation process.
+
+ The first form enumerates all the possible values that exist and
+ can be specified for the 'karch' parameter to the 'yocto bsp
+ create' command. Example output for the 'list karch' command:
+
+ $ yocto-bsp list karch
+ Architectures available:
+ arm
+ powerpc
+ i386
+ mips
+ mips64
+ x86_64
+ qemu
+
+ The second form enumerates all the possible properties that exist
+ and must have values specified for them in the 'yocto bsp create'
+ command for the given 'karch'. This command is mainly meant to
+ allow the development user interface alternatives to the default
+ text-based prompting interface. If the -o option is specified,
+ the list of properties, in addition to being displayed, will be
+ written to the specified file as a JSON object. In this case, the
+ object will consist of the set of name:value pairs corresponding
+ to the (possibly nested) dictionary of properties defined by the
+ input statements used by the BSP. Some example output for the
+ 'list properties' command:
+
+ $ yocto-bsp list arm properties
+ "touchscreen" : {
+ "msg" : Does your BSP have a touchscreen? (y/N)
+ "default" : n
+ "type" : boolean
+ }
+ "uboot_loadaddress" : {
+ "msg" : Please specify a value for UBOOT_LOADADDRESS.
+ "default" : 0x80008000
+ "type" : edit
+ "prio" : 40
+ }
+ "kernel_choice" : {
+ "prio" : 10
+ "default" : linux-yocto_3.2
+ "depends-on" : use_default_kernel
+ "depends-on-val" : n
+ "msg" : Please choose the kernel to use in this BSP =>
+ "type" : choicelist
+ "gen" : bsp.kernel.kernels
+ }
+ "if kernel_choice == "linux-yocto_3.0":" : {
+ "base_kbranch_linux_yocto_3_0" : {
+ "prio" : 20
+ "default" : yocto/standard
+ "depends-on" : new_kbranch_linux_yocto_3_0
+ "depends-on-val" : y
+ "msg" : Please choose a machine branch to base this BSP on =>
+ "type" : choicelist
+ "gen" : bsp.kernel.all_branches
+ }
+ .
+ .
+ .
+
+ Each entry in the output consists of the name of the input element
+ e.g. "touchscreen", followed by the properties defined for that
+ element enclosed in braces. This information should provide
+ sufficient information to create a complete user interface with.
+ Two features of the scheme provide for conditional input. First,
+ if a Python "if" statement appears in place of an input element
+ name, the set of enclosed input elements apply and should be
+ presented to the user only if the 'if' statement evaluates to
+ true. The test in the if statement will always reference another
+ input element in the list, which means that the element being
+ tested should be presented to the user before the elements
+ enclosed by the if block. Secondly, in a similar way, some
+ elements contain "depends-on" and depends-on-val" tags, which mean
+ that the affected input element should only be presented to the
+ user if the element it depends on has already been presented to
+ the user and the user has selected the specified value for that
+ element.
+
+ The third form enumerates all the possible values that exist and
+ can be specified for any of the enumerable properties of the given
+ 'karch' in the 'yocto bsp create' command. If the -o option is
+ specified, the list of values for the given property, in addition
+ to being displayed, will be written to the specified file as a
+ JSON object. In this case, the object will consist of the set of
+ name:value pairs corresponding to the array of property values
+ associated with the property.
+
+ $ yocto-bsp list i386 property xserver_choice
+ ["xserver_vesa", "VESA xserver support"]
+ ["xserver_i915", "i915 xserver support"]
+
+ $ yocto-bsp list arm property base_kbranch_linux_yocto_3_0
+ Getting branches from remote repo git://git.yoctoproject.org/linux-yocto-3.0...
+ ["yocto/base", "yocto/base"]
+ ["yocto/eg20t", "yocto/eg20t"]
+ ["yocto/gma500", "yocto/gma500"]
+ ["yocto/pvr", "yocto/pvr"]
+ ["yocto/standard/arm-versatile-926ejs", "yocto/standard/arm-versatile-926ejs"]
+ ["yocto/standard/base", "yocto/standard/base"]
+ ["yocto/standard/cedartrail", "yocto/standard/cedartrail"]
+ .
+ .
+ .
+ ["yocto/standard/qemu-ppc32", "yocto/standard/qemu-ppc32"]
+ ["yocto/standard/routerstationpro", "yocto/standard/routerstationpro"]
+
+ The third form as well is meant mainly for developers of
+ alternative interfaces - it allows the developer to fetch the
+ possible values for a given input element on-demand. This
+ on-demand capability is especially valuable for elements that
+ require relatively expensive remote operations to fulfill, such as
+ the example that returns the set of branches available in a remote
+ git tree above.
+
+"""
+
+##
+# yocto-kernel help and usage strings
+##
+
+yocto_kernel_usage = """
+
+ Modify and list Yocto BSP kernel config items and patches.
+
+ usage: yocto-kernel [--version] [--help] COMMAND [ARGS]
+
+ Current 'yocto-kernel' commands are:
+ config list List the modifiable set of bare kernel config options for a BSP
+ config add Add or modify bare kernel config options for a BSP
+ config rm Remove bare kernel config options from a BSP
+ patch list List the patches associated with a BSP
+ patch add Patch the Yocto kernel for a BSP
+ patch rm Remove patches from a BSP
+ feature list List the features used by a BSP
+ feature add Have a BSP use a feature
+ feature rm Have a BSP stop using a feature
+ features list List the features available to BSPs
+ feature describe Describe a particular feature
+ feature create Create a new BSP-local feature
+ feature destroy Remove a BSP-local feature
+
+ See 'yocto-kernel help COMMAND' for more information on a specific command.
+
+"""
+
+
+yocto_kernel_help_usage = """
+
+ usage: yocto-kernel help <subcommand>
+
+ This command displays detailed help for the specified subcommand.
+"""
+
+yocto_kernel_config_list_usage = """
+
+ List the modifiable set of bare kernel config options for a BSP
+
+ usage: yocto-kernel config list <bsp-name>
+
+ This command lists the 'modifiable' config items for a BSP i.e. the
+ items which are eligible for modification or removal by other
+ yocto-kernel commands.
+
+ 'modifiable' config items are the config items contained a BSP's
+ user-config.cfg base config.
+"""
+
+
+yocto_kernel_config_list_help = """
+
+NAME
+ yocto-kernel config list - List the modifiable set of bare kernel
+ config options for a BSP
+
+SYNOPSIS
+ yocto-kernel config list <bsp-name>
+
+DESCRIPTION
+ This command lists the 'modifiable' config items for a BSP
+ i.e. the items which are eligible for modification or removal by
+ other yocto-kernel commands.
+"""
+
+
+yocto_kernel_config_add_usage = """
+
+ Add or modify bare kernel config options for a BSP
+
+ usage: yocto-kernel config add <bsp-name> [<CONFIG_XXX=x> ...]
+
+ This command adds one or more CONFIG_XXX=x items to a BSP's user-config.cfg
+ base config.
+"""
+
+
+yocto_kernel_config_add_help = """
+
+NAME
+ yocto-kernel config add - Add or modify bare kernel config options
+ for a BSP
+
+SYNOPSIS
+ yocto-kernel config add <bsp-name> [<CONFIG_XXX=x> ...]
+
+DESCRIPTION
+ This command adds one or more CONFIG_XXX=x items to a BSP's
+ foo.cfg base config.
+
+ NOTE: It's up to the user to determine whether or not the config
+ options being added make sense or not - this command does no
+ sanity checking or verification of any kind to ensure that a
+ config option really makes sense and will actually be set in in
+ the final config. For example, if a config option depends on
+ other config options, it will be turned off by kconfig if the
+ other options aren't set correctly.
+"""
+
+
+yocto_kernel_config_rm_usage = """
+
+ Remove bare kernel config options from a BSP
+
+ usage: yocto-kernel config rm <bsp-name>
+
+ This command removes (turns off) one or more CONFIG_XXX items from a
+ BSP's user-config.cfg base config.
+
+ The set of config items available to be removed by this command for a
+ BSP is listed and the user prompted for the specific items to remove.
+"""
+
+
+yocto_kernel_config_rm_help = """
+
+NAME
+ yocto-kernel config rm - Remove bare kernel config options from a
+ BSP
+
+SYNOPSIS
+ yocto-kernel config rm <bsp-name>
+
+DESCRIPTION
+ This command removes (turns off) one or more CONFIG_XXX items from a
+ BSP's user-config.cfg base config.
+
+ The set of config items available to be removed by this command
+ for a BSP is listed and the user prompted for the specific items
+ to remove.
+"""
+
+
+yocto_kernel_patch_list_usage = """
+
+ List the patches associated with the kernel for a BSP
+
+ usage: yocto-kernel patch list <bsp-name>
+
+ This command lists the patches associated with a BSP.
+
+ NOTE: this only applies to patches listed in the kernel recipe's
+ user-patches.scc file (and currently repeated in its SRC_URI).
+"""
+
+
+yocto_kernel_patch_list_help = """
+
+NAME
+ yocto-kernel patch list - List the patches associated with the kernel
+ for a BSP
+
+SYNOPSIS
+ yocto-kernel patch list <bsp-name>
+
+DESCRIPTION
+ This command lists the patches associated with a BSP.
+
+ NOTE: this only applies to patches listed in the kernel recipe's
+ user-patches.scc file (and currently repeated in its SRC_URI).
+"""
+
+
+yocto_kernel_patch_add_usage = """
+
+ Patch the Yocto kernel for a specific BSP
+
+ usage: yocto-kernel patch add <bsp-name> [<PATCH> ...]
+
+ This command adds one or more patches to a BSP's machine branch. The
+ patch will be added to the BSP's linux-yocto kernel user-patches.scc
+ file (and currently repeated in its SRC_URI) and will be guaranteed
+ to be applied in the order specified.
+"""
+
+
+yocto_kernel_patch_add_help = """
+
+NAME
+ yocto-kernel patch add - Patch the Yocto kernel for a specific BSP
+
+SYNOPSIS
+ yocto-kernel patch add <bsp-name> [<PATCH> ...]
+
+DESCRIPTION
+ This command adds one or more patches to a BSP's machine branch.
+ The patch will be added to the BSP's linux-yocto kernel
+ user-patches.scc file (and currently repeated in its SRC_URI) and
+ will be guaranteed to be applied in the order specified.
+
+ NOTE: It's up to the user to determine whether or not the patches
+ being added makes sense or not - this command does no sanity
+ checking or verification of any kind to ensure that a patch can
+ actually be applied to the BSP's kernel branch; it's assumed that
+ the user has already done that.
+"""
+
+
+yocto_kernel_patch_rm_usage = """
+
+ Remove a patch from the Yocto kernel for a specific BSP
+
+ usage: yocto-kernel patch rm <bsp-name>
+
+ This command removes one or more patches from a BSP's machine branch.
+ The patch will be removed from the BSP's linux-yocto kernel
+ user-patches.scc file (and currently repeated in its SRC_URI) and
+ kernel SRC_URI dir.
+
+ The set of patches available to be removed by this command for a BSP
+ is listed and the user prompted for the specific patches to remove.
+"""
+
+
+yocto_kernel_patch_rm_help = """
+
+NAME
+ yocto-kernel patch rm - Remove a patch from the Yocto kernel for a specific BSP
+
+SYNOPSIS
+ yocto-kernel patch rm <bsp-name>
+
+DESCRIPTION
+ This command removes one or more patches from a BSP's machine
+ branch. The patch will be removed from the BSP's linux-yocto
+ kernel user-patches.scc file (and currently repeated in its
+ SRC_URI).
+
+ The set of patches available to be removed by this command for a
+ BSP is listed and the user prompted for the specific patches to
+ remove.
+"""
+
+yocto_kernel_feature_list_usage = """
+
+ List the BSP features that are being used by a BSP
+
+ usage: yocto-kernel feature list <bsp-name>
+
+ This command lists the features being used by a BSP i.e. the features
+ which are eligible for modification or removal by other yocto-kernel
+ commands.
+
+ 'modifiable' features are the features listed in a BSP's
+ user-features.scc file.
+"""
+
+
+yocto_kernel_feature_list_help = """
+
+NAME
+ yocto-kernel feature list - List the modifiable set of features
+ being used by a BSP
+
+SYNOPSIS
+ yocto-kernel feature list <bsp-name>
+
+DESCRIPTION
+ This command lists the 'modifiable' features being used by a BSP
+ i.e. the features which are eligible for modification or removal
+ by other yocto-kernel commands.
+"""
+
+
+yocto_kernel_feature_add_usage = """
+
+ Add to or modify the list of features being used for a BSP
+
+ usage: yocto-kernel feature add <bsp-name> [/xxxx/yyyy/feature.scc ...]
+
+ This command adds one or more feature items to a BSP's kernel
+ user-features.scc file, which is the file used to manage features in
+ a yocto-bsp-generated BSP. Features to be added must be specified as
+ fully-qualified feature names.
+"""
+
+
+yocto_kernel_feature_add_help = """
+
+NAME
+ yocto-kernel feature add - Add to or modify the list of features
+ being used for a BSP
+
+SYNOPSIS
+ yocto-kernel feature add <bsp-name> [/xxxx/yyyy/feature.scc ...]
+
+DESCRIPTION
+ This command adds one or more feature items to a BSP's
+ user-features.scc file, which is the file used to manage features
+ in a yocto-bsp-generated BSP. Features to be added must be
+ specified as fully-qualified feature names.
+"""
+
+
+yocto_kernel_feature_rm_usage = """
+
+ Remove a feature from the list of features being used for a BSP
+
+ usage: yocto-kernel feature rm <bsp-name>
+
+ This command removes (turns off) one or more features from a BSP's
+ user-features.scc file, which is the file used to manage features in
+ a yocto-bsp-generated BSP.
+
+ The set of features available to be removed by this command for a BSP
+ is listed and the user prompted for the specific items to remove.
+"""
+
+
+yocto_kernel_feature_rm_help = """
+
+NAME
+ yocto-kernel feature rm - Remove a feature from the list of
+ features being used for a BSP
+
+SYNOPSIS
+ yocto-kernel feature rm <bsp-name>
+
+DESCRIPTION
+ This command removes (turns off) one or more features from a BSP's
+ user-features.scc file, which is the file used to manage features
+ in a yocto-bsp-generated BSP.
+
+ The set of features available to be removed by this command for a
+ BSP is listed and the user prompted for the specific items to
+ remove.
+"""
+
+
+yocto_kernel_available_features_list_usage = """
+
+ List the set of kernel features available to a BSP
+
+ usage: yocto-kernel features list <bsp-name>
+
+ This command lists the complete set of kernel features available to a
+ BSP. This includes the features contained in linux-yocto meta
+ branches as well as recipe-space features defined locally to the BSP.
+"""
+
+
+yocto_kernel_available_features_list_help = """
+
+NAME
+ yocto-kernel features list - List the set of kernel features
+ available to a BSP
+
+SYNOPSIS
+ yocto-kernel features list <bsp-name>
+
+DESCRIPTION
+ This command lists the complete set of kernel features available
+ to a BSP. This includes the features contained in linux-yocto
+ meta branches as well as recipe-space features defined locally to
+ the BSP.
+"""
+
+
+yocto_kernel_feature_describe_usage = """
+
+ Print the description and compatibility information for a given kernel feature
+
+ usage: yocto-kernel feature describe <bsp-name> [/xxxx/yyyy/feature.scc ...]
+
+ This command prints the description and compatibility of a specific
+ feature in the format 'description [compatibility].
+"""
+
+
+yocto_kernel_feature_describe_help = """
+
+NAME
+ yocto-kernel feature describe - print the description and
+ compatibility information for a given kernel feature
+
+SYNOPSIS
+ yocto-kernel feature describe <bsp-name> [/xxxx/yyyy/feature.scc ...]
+
+DESCRIPTION
+ This command prints the description and compatibility of a
+ specific feature in the format 'description [compatibility]. If
+ the feature doesn't define a description or compatibility, a
+ string with generic unknown values will be printed.
+"""
+
+
+yocto_kernel_feature_create_usage = """
+
+ Create a recipe-space kernel feature in a BSP
+
+ usage: yocto-kernel feature create <bsp-name> newfeature.scc \
+ "Feature Description" capabilities [<CONFIG_XXX=x> ...] [<PATCH> ...]
+
+ This command creates a new kernel feature from the bare config
+ options and patches specified on the command-line.
+"""
+
+
+yocto_kernel_feature_create_help = """
+
+NAME
+ yocto-kernel feature create - create a recipe-space kernel feature
+ in a BSP
+
+SYNOPSIS
+ yocto-kernel feature create <bsp-name> newfeature.scc \
+ "Feature Description" capabilities [<CONFIG_XXX=x> ...] [<PATCH> ...]
+
+DESCRIPTION
+ This command creates a new kernel feature from the bare config
+ options and patches specified on the command-line. The new
+ feature will be created in recipe-space, specifically in either
+ the kernel .bbappend's /files/cfg or /files/features subdirectory,
+ depending on whether or not the feature contains config items only
+ or config items along with patches. The named feature must end
+ with .scc and must not contain a feature directory to contain the
+ feature (this will be determined automatically), and a feature
+ description in double-quotes along with a capabilities string
+ (which for the time being can be one of: 'all' or 'board').
+"""
+
+
+yocto_kernel_feature_destroy_usage = """
+
+ Destroy a recipe-space kernel feature in a BSP
+
+ usage: yocto-kernel feature destroy <bsp-name> feature.scc
+
+ This command destroys a kernel feature defined in the specified BSP's
+ recipe-space kernel definition.
+"""
+
+
+yocto_kernel_feature_destroy_help = """
+
+NAME
+ yocto-kernel feature destroy <bsp-name> feature.scc - destroy a
+ recipe-space kernel feature in a BSP
+
+SYNOPSIS
+ yocto-kernel feature destroy <bsp-name> feature.scc
+
+DESCRIPTION
+ This command destroys a kernel feature defined in the specified
+ BSP's recipe-space kernel definition. The named feature must end
+ with .scc and must not contain a feature directory to contain the
+ feature (this will be determined automatically). If the kernel
+ feature is in use by a BSP, it can't be removed until the BSP
+ stops using it (see yocto-kernel feature rm to stop using it).
+"""
+
+##
+# yocto-layer help and usage strings
+##
+
+yocto_layer_usage = """
+
+ Create a generic Yocto layer.
+
+ usage: yocto-layer [--version] [--help] COMMAND [ARGS]
+
+ Current 'yocto-layer' commands are:
+ create Create a new generic Yocto layer
+ list List available values for input options and properties
+
+ See 'yocto-layer help COMMAND' for more information on a specific command.
+"""
+
+yocto_layer_help_usage = """
+
+ usage: yocto-layer help <subcommand>
+
+ This command displays detailed help for the specified subcommand.
+"""
+
+yocto_layer_create_usage = """
+
+ Create a new generic Yocto layer
+
+ usage: yocto-layer create <layer-name> [layer_priority]
+ [-o <DIRNAME> | --outdir <DIRNAME>]
+ [-i <JSON PROPERTY FILE> | --infile <JSON PROPERTY_FILE>]
+
+ This command creates a generic Yocto layer based on the specified
+ parameters. The new layer will be a new Yocto layer contained by
+ default within the top-level directory specified as
+ 'meta-layer-name'. The -o option can be used to place the layer in a
+ directory with a different name and location.
+
+ If layer_priority is specified, a simple layer will be created using
+ the given layer priority, and the user will not be prompted for
+ further input.
+
+ NOTE: Once created, you should add your new layer to your
+ bblayers.conf file in order for it to be subsequently seen and
+ modified by the yocto-kernel tool. Instructions for doing this can
+ be found in the README file generated in the layer's top-level
+ directory.
+
+ See 'yocto layer help create' for more detailed instructions.
+"""
+
+yocto_layer_create_help = """
+
+NAME
+ yocto-layer create - Create a new generic Yocto layer
+
+SYNOPSIS
+ yocto-layer create <layer-name> [layer_priority]
+ [-o <DIRNAME> | --outdir <DIRNAME>]
+ [-i <JSON PROPERTY FILE> | --infile <JSON PROPERTY_FILE>]
+
+DESCRIPTION
+ This command creates a generic Yocto layer based on the specified
+ parameters. The new layer will be a new Yocto layer contained by
+ default within the top-level directory specified as
+ 'meta-layer-name'. The -o option can be used to place the layer
+ in a directory with a different name and location.
+
+ If layer_priority is specified, a simple layer will be created
+ using the given layer priority, and the user will not be prompted
+ for further input.
+
+ The layer-specific properties that define the values that will be
+ used to generate the layer can be specified on the command-line
+ using the -i option and supplying a JSON object consisting of the
+ set of name:value pairs needed by the layer.
+
+ If the -i option is not used, the user will be interactively
+ prompted for each of the required property values, which will then
+ be used as values for layer generation.
+
+ The set of properties available can be listed using the
+ 'yocto-layer list' command.
+
+ Specifying -c causes the Python code generated and executed to
+ create the layer to be dumped to the 'bspgen.out' file in the
+ current directory, and is useful for debugging.
+
+ NOTE: Once created, you should add your new layer to your
+ bblayers.conf file in order for it to be subsequently seen and
+ modified by the yocto-kernel tool. Instructions for doing this
+ can be found in the README file generated in the layer's top-level
+ directory.
+
+ For example, assuming your poky repo is at /path/to/poky, your new
+ layer is at /path/to/poky/meta-mylayer, and your build directory
+ is /path/to/build:
+
+ $ gedit /path/to/build/conf/bblayers.conf
+
+ BBLAYERS ?= " \\
+ /path/to/poky/meta \\
+ /path/to/poky/meta-yocto \\
+ /path/to/poky/meta-mylayer \\
+ "
+"""
+
+yocto_layer_list_usage = """
+
+ usage: yocto-layer list properties
+ [-o <JSON PROPERTY FILE> | --outfile <JSON PROPERTY_FILE>]
+ yocto-layer list property <xxx>
+ [-o <JSON PROPERTY FILE> | --outfile <JSON PROPERTY_FILE>]
+
+ This command enumerates the complete set of possible values for a
+ specified option or property needed by the layer creation process.
+
+ The first form enumerates all the possible properties that exist and
+ must have values specified for them in the 'yocto-layer create'
+ command.
+
+ The second form enumerates all the possible values that exist and can
+ be specified for any of the enumerable properties in the 'yocto-layer
+ create' command.
+
+ See 'yocto-layer help list' for more details.
+"""
+
+yocto_layer_list_help = """
+
+NAME
+ yocto-layer list - List available values for layer input options and properties
+
+SYNOPSIS
+ yocto-layer list properties
+ [--o <JSON PROPERTY FILE> | -outfile <JSON PROPERTY_FILE>]
+ yocto-layer list property <xxx>
+ [--o <JSON PROPERTY FILE> | -outfile <JSON PROPERTY_FILE>]
+
+DESCRIPTION
+ This command enumerates the complete set of possible values for a
+ specified option or property needed by the layer creation process.
+
+ The first form enumerates all the possible properties that exist
+ and must have values specified for them in the 'yocto-layer
+ create' command. This command is mainly meant to aid the
+ development of user interface alternatives to the default
+ text-based prompting interface. If the -o option is specified,
+ the list of properties, in addition to being displayed, will be
+ written to the specified file as a JSON object. In this case, the
+ object will consist of the set of name:value pairs corresponding
+ to the (possibly nested) dictionary of properties defined by the
+ input statements used by the BSP. Some example output for the
+ 'list properties' command:
+
+ $ yocto-layer list properties
+ "example_bbappend_name" : {
+ "default" : example
+ "msg" : Please enter the name you'd like to use for your bbappend file:
+ "type" : edit
+ "prio" : 20
+ "filename" : /home/trz/yocto/yocto-layer-dev/scripts/lib/bsp/substrate/target/arch/layer/layer-questions.noinstall
+ }
+ "create_example_recipe" : {
+ "default" : n
+ "msg" : Would you like to have an example recipe created? (y/n)
+ "type" : boolean
+ "prio" : 20
+ "filename" : /home/trz/yocto/yocto-layer-dev/scripts/lib/bsp/substrate/target/arch/layer/layer-questions.noinstall
+ }
+ "example_recipe_name" : {
+ "default" : example
+ "msg" : Please enter the name you'd like to use for your example recipe:
+ "type" : edit
+ "prio" : 20
+ "filename" : /home/trz/yocto/yocto-layer-dev/scripts/lib/bsp/substrate/target/arch/layer/layer-questions.noinstall
+ }
+ "layer_priority" : {
+ "default" : 6
+ "msg" : Please enter the layer priority you'd like to use for the layer:
+ "type" : edit
+ "prio" : 20
+ "filename" : /home/trz/yocto/yocto-layer-dev/scripts/lib/bsp/substrate/target/arch/layer/layer-questions.noinstall
+ }
+ "create_example_bbappend" : {
+ "default" : n
+ "msg" : Would you like to have an example bbappend file created? (y/n)
+ "type" : boolean
+ "prio" : 20
+ "filename" : /home/trz/yocto/yocto-layer-dev/scripts/lib/bsp/substrate/target/arch/layer/layer-questions.noinstall
+ }
+ "example_bbappend_version" : {
+ "default" : 0.1
+ "msg" : Please enter the version number you'd like to use for your bbappend file (this should match the recipe you're appending to):
+ "type" : edit
+ "prio" : 20
+ "filename" : /home/trz/yocto/yocto-layer-dev/scripts/lib/bsp/substrate/target/arch/layer/layer-questions.noinstall
+ }
+
+ Each entry in the output consists of the name of the input element
+ e.g. "layer_priority", followed by the properties defined for that
+ element enclosed in braces. This information should provide
+ sufficient information to create a complete user interface. Two
+ features of the scheme provide for conditional input. First, if a
+ Python "if" statement appears in place of an input element name,
+ the set of enclosed input elements apply and should be presented
+ to the user only if the 'if' statement evaluates to true. The
+ test in the if statement will always reference another input
+ element in the list, which means that the element being tested
+ should be presented to the user before the elements enclosed by
+ the if block. Secondly, in a similar way, some elements contain
+ "depends-on" and depends-on-val" tags, which mean that the
+ affected input element should only be presented to the user if the
+ element it depends on has already been presented to the user and
+ the user has selected the specified value for that element.
+
+ The second form enumerates all the possible values that exist and
+ can be specified for any of the enumerable properties in the
+ 'yocto-layer create' command. If the -o option is specified, the
+ list of values for the given property, in addition to being
+ displayed, will be written to the specified file as a JSON object.
+ In this case, the object will consist of the set of name:value
+ pairs corresponding to the array of property values associated
+ with the property.
+
+ $ yocto-layer list property layer_priority
+ [no output - layer_priority is a text field that has no enumerable values]
+
+ The second form as well is meant mainly for developers of
+ alternative interfaces - it allows the developer to fetch the
+ possible values for a given input element on-demand. This
+ on-demand capability is especially valuable for elements that
+ require relatively expensive remote operations to fulfill, such as
+ the example that returns the set of branches available in a remote
+ git tree above.
+
+"""
+
+##
+# test code
+##
+
+test_bsp_properties = {
+ 'smp': 'yes',
+ 'touchscreen': 'yes',
+ 'keyboard': 'no',
+ 'xserver': 'yes',
+ 'xserver_choice': 'xserver-i915',
+ 'features': ['goodfeature', 'greatfeature'],
+ 'tunefile': 'tune-quark',
+}
+
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/kernel.py b/import-layers/yocto-poky/scripts/lib/bsp/kernel.py
new file mode 100644
index 000000000..ba68b60fc
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/kernel.py
@@ -0,0 +1,1071 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# 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 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 kernel-related functions used by
+# 'yocto-kernel' to manage kernel config items and patches for Yocto
+# BSPs.
+#
+# AUTHORS
+# Tom Zanussi <tom.zanussi (at] intel.com>
+#
+
+import sys
+import os
+import shutil
+from tags import *
+import glob
+import subprocess
+from engine import create_context
+
+
+def find_bblayers():
+ """
+ Find and return a sanitized list of the layers found in BBLAYERS.
+ """
+ try:
+ builddir = os.environ["BUILDDIR"]
+ except KeyError:
+ print "BUILDDIR not found, exiting. (Did you forget to source oe-init-build-env?)"
+ sys.exit(1)
+ bblayers_conf = os.path.join(builddir, "conf/bblayers.conf")
+
+ layers = []
+
+ bitbake_env_cmd = "bitbake -e"
+ bitbake_env_lines = subprocess.Popen(bitbake_env_cmd, shell=True,
+ stdout=subprocess.PIPE).stdout.read()
+
+ if not bitbake_env_lines:
+ print "Couldn't get '%s' output, exiting." % bitbake_env_cmd
+ sys.exit(1)
+
+ for line in bitbake_env_lines.split('\n'):
+ bblayers = get_line_val(line, "BBLAYERS")
+ if (bblayers):
+ break
+
+ if not bblayers:
+ print "Couldn't find BBLAYERS in %s output, exiting." % \
+ bitbake_env_cmd
+ sys.exit(1)
+
+ raw_layers = bblayers.split()
+
+ for layer in raw_layers:
+ if layer == 'BBLAYERS' or '=' in layer:
+ continue
+ layers.append(layer)
+
+ return layers
+
+
+def get_line_val(line, key):
+ """
+ Extract the value from the VAR="val" string
+ """
+ if line.startswith(key + "="):
+ stripped_line = line.split('=')[1]
+ stripped_line = stripped_line.replace('\"', '')
+ return stripped_line
+ return None
+
+
+def find_meta_layer():
+ """
+ Find and return the meta layer in BBLAYERS.
+ """
+ layers = find_bblayers()
+
+ for layer in layers:
+ if layer.endswith("meta"):
+ return layer
+
+ return None
+
+
+def find_bsp_layer(machine):
+ """
+ Find and return a machine's BSP layer in BBLAYERS.
+ """
+ layers = find_bblayers()
+
+ for layer in layers:
+ if layer.endswith(machine):
+ return layer
+
+ print "Unable to find the BSP layer for machine %s." % machine
+ print "Please make sure it is listed in bblayers.conf"
+ sys.exit(1)
+
+
+def gen_choices_str(choices):
+ """
+ Generate a numbered list of choices from a list of choices for
+ display to the user.
+ """
+ choices_str = ""
+
+ for i, choice in enumerate(choices):
+ choices_str += "\t" + str(i + 1) + ") " + choice + "\n"
+
+ return choices_str
+
+
+def open_user_file(scripts_path, machine, userfile, mode):
+ """
+ Find one of the user files (user-config.cfg, user-patches.scc)
+ associated with the machine (could be in files/,
+ linux-yocto-custom/, etc). Returns the open file if found, None
+ otherwise.
+
+ The caller is responsible for closing the file returned.
+ """
+ layer = find_bsp_layer(machine)
+ linuxdir = os.path.join(layer, "recipes-kernel/linux")
+ linuxdir_list = os.listdir(linuxdir)
+ for fileobj in linuxdir_list:
+ fileobj_path = os.path.join(linuxdir, fileobj)
+ if os.path.isdir(fileobj_path):
+ userfile_name = os.path.join(fileobj_path, userfile)
+ try:
+ f = open(userfile_name, mode)
+ return f
+ except IOError:
+ continue
+ return None
+
+
+def read_config_items(scripts_path, machine):
+ """
+ Find and return a list of config items (CONFIG_XXX) in a machine's
+ user-defined config fragment [${machine}-user-config.cfg].
+ """
+ config_items = []
+
+ f = open_user_file(scripts_path, machine, machine+"-user-config.cfg", "r")
+ lines = f.readlines()
+ for line in lines:
+ s = line.strip()
+ if s and not s.startswith("#"):
+ config_items.append(s)
+ f.close()
+
+ return config_items
+
+
+def write_config_items(scripts_path, machine, config_items):
+ """
+ Write (replace) the list of config items (CONFIG_XXX) in a
+ machine's user-defined config fragment [${machine}=user-config.cfg].
+ """
+ f = open_user_file(scripts_path, machine, machine+"-user-config.cfg", "w")
+ for item in config_items:
+ f.write(item + "\n")
+ f.close()
+
+ kernel_contents_changed(scripts_path, machine)
+
+
+def yocto_kernel_config_list(scripts_path, machine):
+ """
+ Display the list of config items (CONFIG_XXX) in a machine's
+ user-defined config fragment [${machine}-user-config.cfg].
+ """
+ config_items = read_config_items(scripts_path, machine)
+
+ print "The current set of machine-specific kernel config items for %s is:" % machine
+ print gen_choices_str(config_items)
+
+
+def yocto_kernel_config_rm(scripts_path, machine):
+ """
+ Display the list of config items (CONFIG_XXX) in a machine's
+ user-defined config fragment [${machine}-user-config.cfg], prompt the user
+ for one or more to remove, and remove them.
+ """
+ config_items = read_config_items(scripts_path, machine)
+
+ print "Specify the kernel config items to remove:"
+ input = raw_input(gen_choices_str(config_items))
+ rm_choices = input.split()
+ rm_choices.sort()
+
+ removed = []
+
+ for choice in reversed(rm_choices):
+ try:
+ idx = int(choice) - 1
+ except ValueError:
+ print "Invalid choice (%s), exiting" % choice
+ sys.exit(1)
+ if idx < 0 or idx >= len(config_items):
+ print "Invalid choice (%d), exiting" % (idx + 1)
+ sys.exit(1)
+ removed.append(config_items.pop(idx))
+
+ write_config_items(scripts_path, machine, config_items)
+
+ print "Removed items:"
+ for r in removed:
+ print "\t%s" % r
+
+
+def yocto_kernel_config_add(scripts_path, machine, config_items):
+ """
+ Add one or more config items (CONFIG_XXX) to a machine's
+ user-defined config fragment [${machine}-user-config.cfg].
+ """
+ new_items = []
+ dup_items = []
+
+ cur_items = read_config_items(scripts_path, machine)
+
+ for item in config_items:
+ if not item.startswith("CONFIG") or (not "=y" in item and not "=m" in item):
+ print "Invalid config item (%s), exiting" % item
+ sys.exit(1)
+ if item not in cur_items and item not in new_items:
+ new_items.append(item)
+ else:
+ dup_items.append(item)
+
+ if len(new_items) > 0:
+ cur_items.extend(new_items)
+ write_config_items(scripts_path, machine, cur_items)
+ print "Added item%s:" % ("" if len(new_items)==1 else "s")
+ for n in new_items:
+ print "\t%s" % n
+
+ if len(dup_items) > 0:
+ output="The following item%s already exist%s in the current configuration, ignoring %s:" % \
+ (("","s", "it") if len(dup_items)==1 else ("s", "", "them" ))
+ print output
+ for n in dup_items:
+ print "\t%s" % n
+
+def find_current_kernel(bsp_layer, machine):
+ """
+ Determine the kernel and version currently being used in the BSP.
+ """
+ machine_conf = os.path.join(bsp_layer, "conf/machine/" + machine + ".conf")
+
+ preferred_kernel = preferred_kernel_version = preferred_version_varname = None
+
+ f = open(machine_conf, "r")
+ lines = f.readlines()
+ for line in lines:
+ if line.strip().startswith("PREFERRED_PROVIDER_virtual/kernel"):
+ preferred_kernel = line.split()[-1]
+ preferred_kernel = preferred_kernel.replace('\"','')
+ preferred_version_varname = "PREFERRED_VERSION_" + preferred_kernel
+ if preferred_version_varname and line.strip().startswith(preferred_version_varname):
+ preferred_kernel_version = line.split()[-1]
+ preferred_kernel_version = preferred_kernel_version.replace('\"','')
+ preferred_kernel_version = preferred_kernel_version.replace('%','')
+
+ if preferred_kernel and preferred_kernel_version:
+ return preferred_kernel + "_" + preferred_kernel_version
+ elif preferred_kernel:
+ return preferred_kernel
+
+
+def find_filesdir(scripts_path, machine):
+ """
+ Find the name of the 'files' dir associated with the machine
+ (could be in files/, linux-yocto-custom/, etc). Returns the name
+ of the files dir if found, None otherwise.
+ """
+ layer = find_bsp_layer(machine)
+ filesdir = None
+ linuxdir = os.path.join(layer, "recipes-kernel/linux")
+ linuxdir_list = os.listdir(linuxdir)
+ for fileobj in linuxdir_list:
+ fileobj_path = os.path.join(linuxdir, fileobj)
+ if os.path.isdir(fileobj_path):
+ # this could be files/ or linux-yocto-custom/, we have no way of distinguishing
+ # so we take the first (and normally only) dir we find as the 'filesdir'
+ filesdir = fileobj_path
+
+ return filesdir
+
+
+def read_patch_items(scripts_path, machine):
+ """
+ Find and return a list of patch items in a machine's user-defined
+ patch list [${machine}-user-patches.scc].
+ """
+ patch_items = []
+
+ f = open_user_file(scripts_path, machine, machine+"-user-patches.scc", "r")
+ lines = f.readlines()
+ for line in lines:
+ s = line.strip()
+ if s and not s.startswith("#"):
+ fields = s.split()
+ if not fields[0] == "patch":
+ continue
+ patch_items.append(fields[1])
+ f.close()
+
+ return patch_items
+
+
+def write_patch_items(scripts_path, machine, patch_items):
+ """
+ Write (replace) the list of patches in a machine's user-defined
+ patch list [${machine}-user-patches.scc].
+ """
+ f = open_user_file(scripts_path, machine, machine+"-user-patches.scc", "w")
+ for item in patch_items:
+ f.write("patch " + item + "\n")
+ f.close()
+
+ kernel_contents_changed(scripts_path, machine)
+
+
+def yocto_kernel_patch_list(scripts_path, machine):
+ """
+ Display the list of patches in a machine's user-defined patch list
+ [${machine}-user-patches.scc].
+ """
+ patches = read_patch_items(scripts_path, machine)
+
+ print "The current set of machine-specific patches for %s is:" % machine
+ print gen_choices_str(patches)
+
+
+def yocto_kernel_patch_rm(scripts_path, machine):
+ """
+ Remove one or more patches from a machine's user-defined patch
+ list [${machine}-user-patches.scc].
+ """
+ patches = read_patch_items(scripts_path, machine)
+
+ print "Specify the patches to remove:"
+ input = raw_input(gen_choices_str(patches))
+ rm_choices = input.split()
+ rm_choices.sort()
+
+ removed = []
+
+ filesdir = find_filesdir(scripts_path, machine)
+ if not filesdir:
+ print "Couldn't rm patch(es) since we couldn't find a 'files' dir"
+ sys.exit(1)
+
+ for choice in reversed(rm_choices):
+ try:
+ idx = int(choice) - 1
+ except ValueError:
+ print "Invalid choice (%s), exiting" % choice
+ sys.exit(1)
+ if idx < 0 or idx >= len(patches):
+ print "Invalid choice (%d), exiting" % (idx + 1)
+ sys.exit(1)
+ filesdir_patch = os.path.join(filesdir, patches[idx])
+ if os.path.isfile(filesdir_patch):
+ os.remove(filesdir_patch)
+ removed.append(patches[idx])
+ patches.pop(idx)
+
+ write_patch_items(scripts_path, machine, patches)
+
+ print "Removed patches:"
+ for r in removed:
+ print "\t%s" % r
+
+
+def yocto_kernel_patch_add(scripts_path, machine, patches):
+ """
+ Add one or more patches to a machine's user-defined patch list
+ [${machine}-user-patches.scc].
+ """
+ existing_patches = read_patch_items(scripts_path, machine)
+
+ for patch in patches:
+ if os.path.basename(patch) in existing_patches:
+ print "Couldn't add patch (%s) since it's already been added" % os.path.basename(patch)
+ sys.exit(1)
+
+ filesdir = find_filesdir(scripts_path, machine)
+ if not filesdir:
+ print "Couldn't add patch (%s) since we couldn't find a 'files' dir to add it to" % os.path.basename(patch)
+ sys.exit(1)
+
+ new_patches = []
+
+ for patch in patches:
+ if not os.path.isfile(patch):
+ print "Couldn't find patch (%s), exiting" % patch
+ sys.exit(1)
+ basename = os.path.basename(patch)
+ filesdir_patch = os.path.join(filesdir, basename)
+ shutil.copyfile(patch, filesdir_patch)
+ new_patches.append(basename)
+
+ cur_items = read_patch_items(scripts_path, machine)
+ cur_items.extend(new_patches)
+ write_patch_items(scripts_path, machine, cur_items)
+
+ print "Added patches:"
+ for n in new_patches:
+ print "\t%s" % n
+
+
+def inc_pr(line):
+ """
+ Add 1 to the PR value in the given bbappend PR line. For the PR
+ lines in kernel .bbappends after modifications. Handles PRs of
+ the form PR := "${PR}.1" as well as PR = "r0".
+ """
+ idx = line.find("\"")
+
+ pr_str = line[idx:]
+ pr_str = pr_str.replace('\"','')
+ fields = pr_str.split('.')
+ if len(fields) > 1:
+ fields[1] = str(int(fields[1]) + 1)
+ pr_str = "\"" + '.'.join(fields) + "\"\n"
+ else:
+ pr_val = pr_str[1:]
+ pr_str = "\"" + "r" + str(int(pr_val) + 1) + "\"\n"
+ idx2 = line.find("\"", idx + 1)
+ line = line[:idx] + pr_str
+
+ return line
+
+
+def kernel_contents_changed(scripts_path, machine):
+ """
+ Do what we need to do to notify the system that the kernel
+ recipe's contents have changed.
+ """
+ layer = find_bsp_layer(machine)
+
+ kernel = find_current_kernel(layer, machine)
+ if not kernel:
+ print "Couldn't determine the kernel for this BSP, exiting."
+ sys.exit(1)
+
+ kernel_bbfile = os.path.join(layer, "recipes-kernel/linux/" + kernel + ".bbappend")
+ if not os.path.isfile(kernel_bbfile):
+ kernel_bbfile = os.path.join(layer, "recipes-kernel/linux/" + kernel + ".bb")
+ if not os.path.isfile(kernel_bbfile):
+ return
+ kernel_bbfile_prev = kernel_bbfile + ".prev"
+ shutil.copyfile(kernel_bbfile, kernel_bbfile_prev)
+
+ ifile = open(kernel_bbfile_prev, "r")
+ ofile = open(kernel_bbfile, "w")
+ ifile_lines = ifile.readlines()
+ for ifile_line in ifile_lines:
+ if ifile_line.strip().startswith("PR"):
+ ifile_line = inc_pr(ifile_line)
+ ofile.write(ifile_line)
+ ofile.close()
+ ifile.close()
+
+
+def kernels(context):
+ """
+ Return the list of available kernels in the BSP i.e. corresponding
+ to the kernel .bbappends found in the layer.
+ """
+ archdir = os.path.join(context["scripts_path"], "lib/bsp/substrate/target/arch/" + context["arch"])
+ kerndir = os.path.join(archdir, "recipes-kernel/linux")
+ bbglob = os.path.join(kerndir, "*.bbappend")
+
+ bbappends = glob.glob(bbglob)
+
+ kernels = []
+
+ for kernel in bbappends:
+ filename = os.path.splitext(os.path.basename(kernel))[0]
+ idx = filename.find(CLOSE_TAG)
+ if idx != -1:
+ filename = filename[idx + len(CLOSE_TAG):].strip()
+ kernels.append(filename)
+
+ kernels.append("custom")
+
+ return kernels
+
+
+def extract_giturl(file):
+ """
+ Extract the git url of the kernel repo from the kernel recipe's
+ SRC_URI.
+ """
+ url = None
+ f = open(file, "r")
+ lines = f.readlines()
+ for line in lines:
+ line = line.strip()
+ if line.startswith("SRC_URI"):
+ line = line[len("SRC_URI"):].strip()
+ if line.startswith("="):
+ line = line[1:].strip()
+ if line.startswith("\""):
+ line = line[1:].strip()
+ prot = "git"
+ for s in line.split(";"):
+ if s.startswith("git://"):
+ url = s
+ if s.startswith("protocol="):
+ prot = s.split("=")[1]
+ if url:
+ url = prot + url[3:]
+ return url
+
+
+def find_giturl(context):
+ """
+ Find the git url of the kernel repo from the kernel recipe's
+ SRC_URI.
+ """
+ name = context["name"]
+ filebase = context["filename"]
+ scripts_path = context["scripts_path"]
+
+ meta_layer = find_meta_layer()
+
+ kerndir = os.path.join(meta_layer, "recipes-kernel/linux")
+ bbglob = os.path.join(kerndir, "*.bb")
+ bbs = glob.glob(bbglob)
+ for kernel in bbs:
+ filename = os.path.splitext(os.path.basename(kernel))[0]
+ if filename in filebase:
+ giturl = extract_giturl(kernel)
+ return giturl
+
+ return None
+
+
+def read_features(scripts_path, machine):
+ """
+ Find and return a list of features in a machine's user-defined
+ features fragment [${machine}-user-features.scc].
+ """
+ features = []
+
+ f = open_user_file(scripts_path, machine, machine+"-user-features.scc", "r")
+ lines = f.readlines()
+ for line in lines:
+ s = line.strip()
+ if s and not s.startswith("#"):
+ feature_include = s.split()
+ features.append(feature_include[1].strip())
+ f.close()
+
+ return features
+
+
+def write_features(scripts_path, machine, features):
+ """
+ Write (replace) the list of feature items in a
+ machine's user-defined features fragment [${machine}=user-features.cfg].
+ """
+ f = open_user_file(scripts_path, machine, machine+"-user-features.scc", "w")
+ for item in features:
+ f.write("include " + item + "\n")
+ f.close()
+
+ kernel_contents_changed(scripts_path, machine)
+
+
+def yocto_kernel_feature_list(scripts_path, machine):
+ """
+ Display the list of features used in a machine's user-defined
+ features fragment [${machine}-user-features.scc].
+ """
+ features = read_features(scripts_path, machine)
+
+ print "The current set of machine-specific features for %s is:" % machine
+ print gen_choices_str(features)
+
+
+def yocto_kernel_feature_rm(scripts_path, machine):
+ """
+ Display the list of features used in a machine's user-defined
+ features fragment [${machine}-user-features.scc], prompt the user
+ for one or more to remove, and remove them.
+ """
+ features = read_features(scripts_path, machine)
+
+ print "Specify the features to remove:"
+ input = raw_input(gen_choices_str(features))
+ rm_choices = input.split()
+ rm_choices.sort()
+
+ removed = []
+
+ for choice in reversed(rm_choices):
+ try:
+ idx = int(choice) - 1
+ except ValueError:
+ print "Invalid choice (%s), exiting" % choice
+ sys.exit(1)
+ if idx < 0 or idx >= len(features):
+ print "Invalid choice (%d), exiting" % (idx + 1)
+ sys.exit(1)
+ removed.append(features.pop(idx))
+
+ write_features(scripts_path, machine, features)
+
+ print "Removed features:"
+ for r in removed:
+ print "\t%s" % r
+
+
+def yocto_kernel_feature_add(scripts_path, machine, features):
+ """
+ Add one or more features a machine's user-defined features
+ fragment [${machine}-user-features.scc].
+ """
+ new_items = []
+
+ for item in features:
+ if not item.endswith(".scc"):
+ print "Invalid feature (%s), exiting" % item
+ sys.exit(1)
+ new_items.append(item)
+
+ cur_items = read_features(scripts_path, machine)
+ cur_items.extend(new_items)
+
+ write_features(scripts_path, machine, cur_items)
+
+ print "Added features:"
+ for n in new_items:
+ print "\t%s" % n
+
+
+def find_feature_url(git_url):
+ """
+ Find the url of the kern-features.rc kernel for the kernel repo
+ specified from the BSP's kernel recipe SRC_URI.
+ """
+ feature_url = ""
+ if git_url.startswith("git://"):
+ git_url = git_url[len("git://"):].strip()
+ s = git_url.split("/")
+ if s[1].endswith(".git"):
+ s[1] = s[1][:len(s[1]) - len(".git")]
+ feature_url = "http://" + s[0] + "/cgit/cgit.cgi/" + s[1] + \
+ "/plain/meta/cfg/kern-features.rc?h=meta"
+
+ return feature_url
+
+
+def find_feature_desc(lines):
+ """
+ Find the feature description and compatibility in the passed-in
+ set of lines. Returns a string string of the form 'desc
+ [compat]'.
+ """
+ desc = "no description available"
+ compat = "unknown"
+
+ for line in lines:
+ idx = line.find("KFEATURE_DESCRIPTION")
+ if idx != -1:
+ desc = line[idx + len("KFEATURE_DESCRIPTION"):].strip()
+ if desc.startswith("\""):
+ desc = desc[1:]
+ if desc.endswith("\""):
+ desc = desc[:-1]
+ else:
+ idx = line.find("KFEATURE_COMPATIBILITY")
+ if idx != -1:
+ compat = line[idx + len("KFEATURE_COMPATIBILITY"):].strip()
+
+ return desc + " [" + compat + "]"
+
+
+def print_feature_descs(layer, feature_dir):
+ """
+ Print the feature descriptions for the features in feature_dir.
+ """
+ kernel_files_features = os.path.join(layer, "recipes-kernel/linux/files/" +
+ feature_dir)
+ for root, dirs, files in os.walk(kernel_files_features):
+ for file in files:
+ if file.endswith("~") or file.endswith("#"):
+ continue
+ if file.endswith(".scc"):
+ fullpath = os.path.join(layer, "recipes-kernel/linux/files/" +
+ feature_dir + "/" + file)
+ f = open(fullpath)
+ feature_desc = find_feature_desc(f.readlines())
+ print feature_dir + "/" + file + ": " + feature_desc
+
+
+def yocto_kernel_available_features_list(scripts_path, machine):
+ """
+ Display the list of all the kernel features available for use in
+ BSPs, as gathered from the set of feature sources.
+ """
+ layer = find_bsp_layer(machine)
+ kernel = find_current_kernel(layer, machine)
+ if not kernel:
+ print "Couldn't determine the kernel for this BSP, exiting."
+ sys.exit(1)
+
+ context = create_context(machine, "arch", scripts_path)
+ context["name"] = "name"
+ context["filename"] = kernel
+ giturl = find_giturl(context)
+ feature_url = find_feature_url(giturl)
+
+ feature_cmd = "wget -q -O - " + feature_url
+ tmp = subprocess.Popen(feature_cmd, shell=True, stdout=subprocess.PIPE).stdout.read()
+
+ print "The current set of kernel features available to %s is:\n" % machine
+
+ if tmp:
+ tmpline = tmp.split("\n")
+ in_kernel_options = False
+ for line in tmpline:
+ if not "=" in line:
+ if in_kernel_options:
+ break
+ if "kernel-options" in line:
+ in_kernel_options = True
+ continue
+ if in_kernel_options:
+ feature_def = line.split("=")
+ feature_type = feature_def[0].strip()
+ feature = feature_def[1].strip()
+ desc = get_feature_desc(giturl, feature)
+ print "%s: %s" % (feature, desc)
+
+ print "[local]"
+
+ print_feature_descs(layer, "cfg")
+ print_feature_descs(layer, "features")
+
+
+def find_feature_desc_url(git_url, feature):
+ """
+ Find the url of the kernel feature in the kernel repo specified
+ from the BSP's kernel recipe SRC_URI.
+ """
+ feature_desc_url = ""
+ if git_url.startswith("git://"):
+ git_url = git_url[len("git://"):].strip()
+ s = git_url.split("/")
+ if s[1].endswith(".git"):
+ s[1] = s[1][:len(s[1]) - len(".git")]
+ feature_desc_url = "http://" + s[0] + "/cgit/cgit.cgi/" + s[1] + \
+ "/plain/meta/cfg/kernel-cache/" + feature + "?h=meta"
+
+ return feature_desc_url
+
+
+def get_feature_desc(git_url, feature):
+ """
+ Return a feature description of the form 'description [compatibility]
+ BSPs, as gathered from the set of feature sources.
+ """
+ feature_desc_url = find_feature_desc_url(git_url, feature)
+ feature_desc_cmd = "wget -q -O - " + feature_desc_url
+ tmp = subprocess.Popen(feature_desc_cmd, shell=True, stdout=subprocess.PIPE).stdout.read()
+
+ return find_feature_desc(tmp.split("\n"))
+
+
+def yocto_kernel_feature_describe(scripts_path, machine, feature):
+ """
+ Display the description of a specific kernel feature available for
+ use in a BSP.
+ """
+ layer = find_bsp_layer(machine)
+
+ kernel = find_current_kernel(layer, machine)
+ if not kernel:
+ print "Couldn't determine the kernel for this BSP, exiting."
+ sys.exit(1)
+
+ context = create_context(machine, "arch", scripts_path)
+ context["name"] = "name"
+ context["filename"] = kernel
+ giturl = find_giturl(context)
+
+ desc = get_feature_desc(giturl, feature)
+
+ print desc
+
+
+def check_feature_name(feature_name):
+ """
+ Sanity-check the feature name for create/destroy. Return False if not OK.
+ """
+ if not feature_name.endswith(".scc"):
+ print "Invalid feature name (must end with .scc) [%s], exiting" % feature_name
+ return False
+
+ if "/" in feature_name:
+ print "Invalid feature name (don't specify directory) [%s], exiting" % feature_name
+ return False
+
+ return True
+
+
+def check_create_input(feature_items):
+ """
+ Sanity-check the create input. Return False if not OK.
+ """
+ if not check_feature_name(feature_items[0]):
+ return False
+
+ if feature_items[1].endswith(".patch") or feature_items[1].startswith("CONFIG_"):
+ print "Missing description and/or compatibilty [%s], exiting" % feature_items[1]
+ return False
+
+ if feature_items[2].endswith(".patch") or feature_items[2].startswith("CONFIG_"):
+ print "Missing description and/or compatibility [%s], exiting" % feature_items[1]
+ return False
+
+ return True
+
+
+def yocto_kernel_feature_create(scripts_path, machine, feature_items):
+ """
+ Create a recipe-space kernel feature in a BSP.
+ """
+ if not check_create_input(feature_items):
+ sys.exit(1)
+
+ feature = feature_items[0]
+ feature_basename = feature.split(".")[0]
+ feature_description = feature_items[1]
+ feature_compat = feature_items[2]
+
+ patches = []
+ cfg_items = []
+
+ for item in feature_items[3:]:
+ if item.endswith(".patch"):
+ patches.append(item)
+ elif item.startswith("CONFIG"):
+ if ("=y" in item or "=m" in item):
+ cfg_items.append(item)
+ else:
+ print "Invalid feature item (must be .patch or CONFIG_*) [%s], exiting" % item
+ sys.exit(1)
+
+ feature_dirname = "cfg"
+ if patches:
+ feature_dirname = "features"
+
+ filesdir = find_filesdir(scripts_path, machine)
+ if not filesdir:
+ print "Couldn't add feature (%s), no 'files' dir found" % feature
+ sys.exit(1)
+
+ featdir = os.path.join(filesdir, feature_dirname)
+ if not os.path.exists(featdir):
+ os.mkdir(featdir)
+
+ for patch in patches:
+ if not os.path.isfile(patch):
+ print "Couldn't find patch (%s), exiting" % patch
+ sys.exit(1)
+ basename = os.path.basename(patch)
+ featdir_patch = os.path.join(featdir, basename)
+ shutil.copyfile(patch, featdir_patch)
+
+ new_cfg_filename = os.path.join(featdir, feature_basename + ".cfg")
+ new_cfg_file = open(new_cfg_filename, "w")
+ for cfg_item in cfg_items:
+ new_cfg_file.write(cfg_item + "\n")
+ new_cfg_file.close()
+
+ new_feature_filename = os.path.join(featdir, feature_basename + ".scc")
+ new_feature_file = open(new_feature_filename, "w")
+ new_feature_file.write("define KFEATURE_DESCRIPTION \"" + feature_description + "\"\n")
+ new_feature_file.write("define KFEATURE_COMPATIBILITY " + feature_compat + "\n\n")
+
+ for patch in patches:
+ patch_dir, patch_file = os.path.split(patch)
+ new_feature_file.write("patch " + patch_file + "\n")
+
+ new_feature_file.write("kconf non-hardware " + feature_basename + ".cfg\n")
+ new_feature_file.close()
+
+ print "Added feature:"
+ print "\t%s" % feature_dirname + "/" + feature
+
+
+def feature_in_use(scripts_path, machine, feature):
+ """
+ Determine whether the specified feature is in use by the BSP.
+ Return True if so, False otherwise.
+ """
+ features = read_features(scripts_path, machine)
+ for f in features:
+ if f == feature:
+ return True
+ return False
+
+
+def feature_remove(scripts_path, machine, feature):
+ """
+ Remove the specified feature from the available recipe-space
+ features defined for the BSP.
+ """
+ features = read_features(scripts_path, machine)
+ new_features = []
+ for f in features:
+ if f == feature:
+ continue
+ new_features.append(f)
+ write_features(scripts_path, machine, new_features)
+
+
+def yocto_kernel_feature_destroy(scripts_path, machine, feature):
+ """
+ Remove a recipe-space kernel feature from a BSP.
+ """
+ if not check_feature_name(feature):
+ sys.exit(1)
+
+ if feature_in_use(scripts_path, machine, "features/" + feature) or \
+ feature_in_use(scripts_path, machine, "cfg/" + feature):
+ print "Feature %s is in use (use 'feature rm' to un-use it first), exiting" % feature
+ sys.exit(1)
+
+ filesdir = find_filesdir(scripts_path, machine)
+ if not filesdir:
+ print "Couldn't destroy feature (%s), no 'files' dir found" % feature
+ sys.exit(1)
+
+ feature_dirname = "features"
+ featdir = os.path.join(filesdir, feature_dirname)
+ if not os.path.exists(featdir):
+ print "Couldn't find feature directory (%s)" % feature_dirname
+ sys.exit(1)
+
+ feature_fqn = os.path.join(featdir, feature)
+ if not os.path.exists(feature_fqn):
+ feature_dirname = "cfg"
+ featdir = os.path.join(filesdir, feature_dirname)
+ if not os.path.exists(featdir):
+ print "Couldn't find feature directory (%s)" % feature_dirname
+ sys.exit(1)
+ feature_fqn = os.path.join(featdir, feature_filename)
+ if not os.path.exists(feature_fqn):
+ print "Couldn't find feature (%s)" % feature
+ sys.exit(1)
+
+ f = open(feature_fqn, "r")
+ lines = f.readlines()
+ for line in lines:
+ s = line.strip()
+ if s.startswith("patch ") or s.startswith("kconf "):
+ split_line = s.split()
+ filename = os.path.join(featdir, split_line[-1])
+ if os.path.exists(filename):
+ os.remove(filename)
+ f.close()
+ os.remove(feature_fqn)
+
+ feature_remove(scripts_path, machine, feature)
+
+ print "Removed feature:"
+ print "\t%s" % feature_dirname + "/" + feature
+
+
+def base_branches(context):
+ """
+ Return a list of the base branches found in the kernel git repo.
+ """
+ giturl = find_giturl(context)
+
+ print "Getting branches from remote repo %s..." % giturl
+
+ gitcmd = "git ls-remote %s *heads* 2>&1" % (giturl)
+ tmp = subprocess.Popen(gitcmd, shell=True, stdout=subprocess.PIPE).stdout.read()
+
+ branches = []
+
+ if tmp:
+ tmpline = tmp.split("\n")
+ for line in tmpline:
+ if len(line)==0:
+ break;
+ if not line.endswith("base"):
+ continue;
+ idx = line.find("refs/heads/")
+ kbranch = line[idx + len("refs/heads/"):]
+ if kbranch.find("/") == -1 and kbranch.find("base") == -1:
+ continue
+ idx = kbranch.find("base")
+ branches.append(kbranch[:idx - 1])
+
+ return branches
+
+
+def all_branches(context):
+ """
+ Return a list of all the branches found in the kernel git repo.
+ """
+ giturl = find_giturl(context)
+
+ print "Getting branches from remote repo %s..." % giturl
+
+ gitcmd = "git ls-remote %s *heads* 2>&1" % (giturl)
+ tmp = subprocess.Popen(gitcmd, shell=True, stdout=subprocess.PIPE).stdout.read()
+
+ branches = []
+
+ base_prefixes = None
+
+ try:
+ branches_base = context["branches_base"]
+ if branches_base:
+ base_prefixes = branches_base.split(":")
+ except KeyError:
+ pass
+
+ arch = context["arch"]
+
+ if tmp:
+ tmpline = tmp.split("\n")
+ for line in tmpline:
+ if len(line)==0:
+ break;
+ idx = line.find("refs/heads/")
+ kbranch = line[idx + len("refs/heads/"):]
+ kbranch_prefix = kbranch.rsplit("/", 1)[0]
+
+ if base_prefixes:
+ for base_prefix in base_prefixes:
+ if kbranch_prefix == base_prefix:
+ branches.append(kbranch)
+ continue
+
+ if (kbranch.find("/") != -1 and
+ (kbranch.find("standard") != -1 or kbranch.find("base") != -1) or
+ kbranch == "base"):
+ branches.append(kbranch)
+ continue
+
+ return branches
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/.gitignore b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/.gitignore
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/.gitignore
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/conf/machine/machine.conf b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/conf/machine/machine.conf
new file mode 100644
index 000000000..588367a05
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/conf/machine/machine.conf
@@ -0,0 +1,102 @@
+# yocto-bsp-filename {{=machine}}.conf
+#@TYPE: Machine
+#@NAME: {{=machine}}
+
+#@DESCRIPTION: Machine configuration for {{=machine}} systems
+
+{{ input type:"boolean" name:"xserver" prio:"50" msg:"Do you need support for X? (y/n)" default:"y" }}
+{{ if xserver == "y": }}
+PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
+XSERVER ?= "xserver-xorg \
+ xf86-input-evdev \
+ xf86-input-mouse \
+ xf86-video-fbdev \
+ xf86-input-keyboard"
+
+MACHINE_EXTRA_RRECOMMENDS = " kernel-modules kernel-devicetree"
+
+EXTRA_IMAGEDEPENDS += "u-boot"
+
+{{ input type:"choicelist" name:"tunefile" prio:"40" msg:"Which machine tuning would you like to use?" default:"tune_cortexa8" }}
+{{ input type:"choice" val:"tune_arm1136jf_s" msg:"arm1136jf-s tuning optimizations" }}
+{{ input type:"choice" val:"tune_arm920t" msg:"arm920t tuning optimizations" }}
+{{ input type:"choice" val:"tune_arm926ejs" msg:"arm926ejs tuning optimizations" }}
+{{ input type:"choice" val:"tune_arm9tdmi" msg:"arm9tdmi tuning optimizations" }}
+{{ input type:"choice" val:"tune_cortexa5" msg:"cortexa5 tuning optimizations" }}
+{{ input type:"choice" val:"tune_cortexa7" msg:"cortexa7 tuning optimizations" }}
+{{ input type:"choice" val:"tune_cortexa8" msg:"cortexa8 tuning optimizations" }}
+{{ input type:"choice" val:"tune_cortexa9" msg:"cortexa9 tuning optimizations" }}
+{{ input type:"choice" val:"tune_cortexa15" msg:"cortexa15 tuning optimizations" }}
+{{ input type:"choice" val:"tune_cortexm1" msg:"cortexm1 tuning optimizations" }}
+{{ input type:"choice" val:"tune_cortexm3" msg:"cortexm3 tuning optimizations" }}
+{{ input type:"choice" val:"tune_cortexr4" msg:"cortexr4 tuning optimizations" }}
+{{ input type:"choice" val:"tune_ep9312" msg:"ep9312 tuning optimizations" }}
+{{ input type:"choice" val:"tune_iwmmxt" msg:"iwmmxt tuning optimizations" }}
+{{ input type:"choice" val:"tune_strongarm1100" msg:"strongarm1100 tuning optimizations" }}
+{{ input type:"choice" val:"tune_xscale" msg:"xscale tuning optimizations" }}
+{{ if tunefile == "tune_arm1136jf_s": }}
+include conf/machine/include/tune-arm1136jf-s.inc
+{{ if tunefile == "tune_arm920t": }}
+include conf/machine/include/tune-arm920t.inc
+{{ if tunefile == "tune_arm926ejs": }}
+include conf/machine/include/tune-arm926ejs.inc
+{{ if tunefile == "tune_arm9tdmi": }}
+include conf/machine/include/tune-arm9tdmi.inc
+{{ if tunefile == "tune_cortexa5": }}
+include conf/machine/include/tune-cortexa5.inc
+{{ if tunefile == "tune_cortexa7": }}
+include conf/machine/include/tune-cortexa7.inc
+{{ if tunefile == "tune_cortexa8": }}
+DEFAULTTUNE ?= "cortexa8hf-neon"
+include conf/machine/include/tune-cortexa8.inc
+{{ if tunefile == "tune_cortexa9": }}
+include conf/machine/include/tune-cortexa9.inc
+{{ if tunefile == "tune_cortexa15": }}
+include conf/machine/include/tune-cortexa15.inc
+{{ if tunefile == "tune_cortexm1": }}
+include conf/machine/include/tune-cortexm1.inc
+{{ if tunefile == "tune_cortexm3": }}
+include conf/machine/include/tune-cortexm3.inc
+{{ if tunefile == "tune_cortexr4": }}
+include conf/machine/include/tune-cortexr4.inc
+{{ if tunefile == "tune_ep9312": }}
+include conf/machine/include/tune-ep9312.inc
+{{ if tunefile == "tune_iwmmxt": }}
+include conf/machine/include/tune-iwmmxt.inc
+{{ if tunefile == "tune_strongarm1100": }}
+include conf/machine/include/tune-strongarm1100.inc
+{{ if tunefile == "tune_xscale": }}
+include conf/machine/include/tune-xscale.inc
+
+IMAGE_FSTYPES += "tar.bz2 jffs2"
+EXTRA_IMAGECMD_jffs2 = "-lnp "
+
+SERIAL_CONSOLE = "115200 ttyO0"
+
+{{ if kernel_choice == "custom": preferred_kernel = "linux-yocto-custom" }}
+{{ if kernel_choice == "linux-yocto-dev": preferred_kernel = "linux-yocto-dev" }}
+{{ if kernel_choice == "custom" or kernel_choice == "linux-yocto-dev" : }}
+PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}"
+
+{{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": preferred_kernel = kernel_choice.split('_')[0] }}
+{{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": preferred_kernel_version = kernel_choice.split('_')[1] }}
+{{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": }}
+PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}"
+PREFERRED_VERSION_{{=preferred_kernel}} ?= "{{=preferred_kernel_version}}%"
+
+KERNEL_IMAGETYPE = "uImage"
+KERNEL_DEVICETREE = "am335x-bone.dtb am335x-boneblack.dtb"
+KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT}"
+
+SPL_BINARY = "MLO"
+UBOOT_SUFFIX = "img"
+{{ input type:"edit" name:"uboot_machine" prio:"40" msg:"Please specify a value for UBOOT_MACHINE:" default:"am335x_evm_config" }}
+UBOOT_MACHINE = "{{=uboot_machine}}"
+{{ input type:"edit" name:"uboot_entrypoint" prio:"40" msg:"Please specify a value for UBOOT_ENTRYPOINT:" default:"0x80008000" }}
+UBOOT_ENTRYPOINT = "{{=uboot_entrypoint}}"
+{{ input type:"edit" name:"uboot_loadaddress" prio:"40" msg:"Please specify a value for UBOOT_LOADADDRESS:" default:"0x80008000" }}
+UBOOT_LOADADDRESS = "{{=uboot_loadaddress}}"
+
+MACHINE_FEATURES = "usbgadget usbhost vfat alsa"
+
+IMAGE_BOOT_FILES ?= "u-boot.${UBOOT_SUFFIX} MLO"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall
new file mode 100644
index 000000000..b442d02d5
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall
@@ -0,0 +1 @@
+# yocto-bsp-dirname {{=machine}}
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf
new file mode 100644
index 000000000..bc52893e2
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf
@@ -0,0 +1,34 @@
+# yocto-bsp-filename {{ if xserver == "y": }} this
+Section "Module"
+ Load "extmod"
+ Load "dbe"
+ Load "glx"
+ Load "freetype"
+ Load "type1"
+ Load "record"
+ Load "dri"
+EndSection
+
+Section "Monitor"
+ Identifier "Builtin Default Monitor"
+EndSection
+
+Section "Device"
+ Identifier "Builtin Default fbdev Device 0"
+ Driver "omapfb"
+EndSection
+
+Section "Screen"
+ Identifier "Builtin Default fbdev Screen 0"
+ Device "Builtin Default fbdev Device 0"
+ Monitor "Builtin Default Monitor"
+EndSection
+
+Section "ServerLayout"
+ Identifier "Builtin Default Layout"
+ Screen "Builtin Default fbdev Screen 0"
+EndSection
+
+Section "ServerFlags"
+ Option "DontZap" "0"
+EndSection
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend
new file mode 100644
index 000000000..30830031e
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend
@@ -0,0 +1,2 @@
+# yocto-bsp-filename {{ if xserver == "y": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files.noinstall
new file mode 100644
index 000000000..1e0d92c55
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files.noinstall
@@ -0,0 +1 @@
+# yocto-bsp-dirname {{ if kernel_choice != "custom": }} files
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-non_hardware.cfg b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-non_hardware.cfg
new file mode 100644
index 000000000..9bfc90c6f
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-non_hardware.cfg
@@ -0,0 +1,31 @@
+# yocto-bsp-filename {{=machine}}-non_hardware.cfg
+#
+# Miscellaneous filesystems
+#
+CONFIG_NFS_DEF_FILE_IO_SIZE=1024
+
+#
+# Multiple Device Support
+#
+# CONFIG_MD is not set
+
+# Kernel Features
+#
+CONFIG_NO_HZ=y
+
+#
+# CPUIdle
+#
+CONFIG_CPU_IDLE=y
+CONFIG_CPU_IDLE_GOV_LADDER=y
+CONFIG_CPU_IDLE_GOV_MENU=y
+
+#
+# Kernel hacking
+#
+CONFIG_DEBUG_FS=y
+
+#
+# Power management options
+#
+CONFIG_PM_DEBUG=y
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-preempt-rt.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-preempt-rt.scc
new file mode 100644
index 000000000..ea6966ca4
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-preempt-rt.scc
@@ -0,0 +1,15 @@
+# yocto-bsp-filename {{=machine}}-preempt-rt.scc
+define KMACHINE {{=machine}}
+
+define KARCH arm
+
+include {{=map_preempt_rt_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
+{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
+branch {{=machine}}
+
+include {{=machine}}.scc
+
+# default policy for preempt-rt kernels
+include features/latencytop/latencytop.scc
+include features/profiling/profiling.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-standard.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-standard.scc
new file mode 100644
index 000000000..405972d98
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-standard.scc
@@ -0,0 +1,15 @@
+# yocto-bsp-filename {{=machine}}-standard.scc
+define KMACHINE {{=machine}}
+
+define KARCH arm
+
+include {{=map_standard_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
+{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
+branch {{=machine}}
+
+include {{=machine}}.scc
+
+# default policy for standard kernels
+include features/latencytop/latencytop.scc
+include features/profiling/profiling.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-tiny.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-tiny.scc
new file mode 100644
index 000000000..921b7e7e9
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-tiny.scc
@@ -0,0 +1,11 @@
+# yocto-bsp-filename {{=machine}}-tiny.scc
+define KMACHINE {{=machine}}
+
+define KARCH arm
+
+include {{=map_tiny_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
+{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
+branch {{=machine}}
+
+include {{=machine}}.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-user-config.cfg b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-user-config.cfg
new file mode 100644
index 000000000..47489e44e
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-user-config.cfg
@@ -0,0 +1 @@
+# yocto-bsp-filename {{=machine}}-user-config.cfg
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-user-features.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-user-features.scc
new file mode 100644
index 000000000..582759e61
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-user-features.scc
@@ -0,0 +1 @@
+# yocto-bsp-filename {{=machine}}-user-features.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-user-patches.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-user-patches.scc
new file mode 100644
index 000000000..97f747fa0
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-user-patches.scc
@@ -0,0 +1 @@
+# yocto-bsp-filename {{=machine}}-user-patches.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine.cfg b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine.cfg
new file mode 100644
index 000000000..a2e1ae0f7
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine.cfg
@@ -0,0 +1,321 @@
+# yocto-bsp-filename {{=machine}}.cfg
+#
+# System Type
+#
+CONFIG_ARCH_OMAP=y
+
+#
+# TI OMAP Implementations
+#
+# CONFIG_ARCH_OMAP2 is not set
+CONFIG_ARCH_OMAP3=y
+
+#
+# TI OMAP Common Features
+#
+CONFIG_ARCH_OMAP2PLUS=y
+
+#
+# OMAP Feature Selections
+#
+CONFIG_OMAP_32K_TIMER=y
+CONFIG_OMAP_32K_TIMER_HZ=128
+CONFIG_OMAP_DM_TIMER=y
+CONFIG_OMAP_RESET_CLOCKS=y
+CONFIG_OMAP_SMARTREFLEX=y
+CONFIG_OMAP_SMARTREFLEX_CLASS3=y
+CONFIG_OMAP_MBOX_FWK=m
+CONFIG_OMAP_MBOX_KFIFO_SIZE=256
+
+#
+# OMAP Board Type
+#
+CONFIG_MACH_OMAP3_BEAGLE=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMBEE=y
+CONFIG_ARM_ERRATA_430973=y
+
+#
+# Kernel Features
+#
+CONFIG_LEDS=y
+
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_OMAP=y
+CONFIG_SERIAL_OMAP_CONSOLE=y
+
+#
+# At least one emulation must be selected
+#
+CONFIG_VFP=y
+CONFIG_NEON=y
+
+#
+# Power management options
+#
+CONFIG_PM=y
+CONFIG_PM_RUNTIME=y
+
+#
+# Generic Driver Options
+#
+CONFIG_MTD=y
+CONFIG_MTD_CMDLINE_PARTS=y
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+CONFIG_MTD_CFI_INTELEXT=y
+
+#
+# Disk-On-Chip Device Drivers
+#
+CONFIG_MTD_NAND=y
+
+CONFIG_MTD_NAND_OMAP2=y
+
+CONFIG_MTD_UBI=y
+
+#
+# SCSI device support
+#
+CONFIG_SCSI=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_SMSC911X=y
+CONFIG_USB_NET_SMSC95XX=y
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_EVDEV=y
+
+#
+# Input Device Drivers
+#
+CONFIG_KEYBOARD_TWL4030=y
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_ADS7846=y
+
+#
+# Miscellaneous I2C Chip support
+#
+CONFIG_I2C=y
+CONFIG_I2C_OMAP=y
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+CONFIG_SPI_OMAP24XX=y
+
+#
+# I2C GPIO expanders:
+#
+CONFIG_GPIO_TWL4030=y
+
+#
+# SPI GPIO expanders:
+#
+CONFIG_OMAP_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
+
+#
+# Multifunction device drivers
+#
+CONFIG_TWL4030_CORE=y
+CONFIG_REGULATOR=y
+CONFIG_REGULATOR_DUMMY=y
+CONFIG_REGULATOR_TWL4030=y
+
+#
+# Graphics support
+#
+CONFIG_FB=y
+CONFIG_DRM=m
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+# CONFIG_FIRMWARE_EDID is not set
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+# CONFIG_FB_SYS_FOPS is not set
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+CONFIG_FB_MODE_HELPERS=y
+# CONFIG_FB_TILEBLITTING is not set
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_TMIO is not set
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
+# CONFIG_FB_BROADSHEET is not set
+# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
+CONFIG_OMAP2_VRAM=y
+CONFIG_OMAP2_VRFB=y
+CONFIG_OMAP2_DSS=y
+CONFIG_OMAP2_VRAM_SIZE=14
+CONFIG_OMAP2_DSS_DEBUG_SUPPORT=y
+# CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS is not set
+CONFIG_OMAP2_DSS_DPI=y
+# CONFIG_OMAP2_DSS_RFBI is not set
+CONFIG_OMAP2_DSS_VENC=y
+# CONFIG_OMAP2_DSS_SDI is not set
+CONFIG_OMAP2_DSS_DSI=y
+# CONFIG_OMAP2_DSS_FAKE_VSYNC is not set
+CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=0
+CONFIG_FB_OMAP2=y
+CONFIG_FB_OMAP2_DEBUG_SUPPORT=y
+CONFIG_FB_OMAP2_NUM_FBS=2
+
+#
+# OMAP2/3 Display Device Drivers
+#
+CONFIG_PANEL_GENERIC_DPI=y
+CONFIG_PANEL_DVI=y
+CONFIG_PANEL_SHARP_LS037V7DW01=y
+# CONFIG_PANEL_LGPHILIPS_LB035Q02 is not set
+# CONFIG_PANEL_TAAL is not set
+CONFIG_PANEL_TPO_TD043MTEA1=m
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+
+#
+# Display device support
+#
+CONFIG_DISPLAY_SUPPORT=y
+CONFIG_DUMMY_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
+CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+
+#
+# Console display driver support
+#
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_LOGO=y
+# CONFIG_VGA_CONSOLE is not set
+
+# DMA Devices
+CONFIG_DMADEVICES=y
+CONFIG_DMA_OMAP=y
+CONFIG_DMA_OF=y
+
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_SOC=y
+CONFIG_SND_OMAP_SOC=y
+CONFIG_SND_OMAP_SOC_OMAP_TWL4030=y
+
+#
+# USB Input Devices
+#
+CONFIG_USB=y
+CONFIG_USB_SUPPORT=y
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_OTG=y
+# CONFIG_USB_OTG_WHITELIST is not set
+
+#
+# USB Host Controller Drivers
+#
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_TT_NEWSCHED=y
+CONFIG_USB_EHCI_ROOT_HUB_TT=y
+CONFIG_USB_MUSB_HDRC=y
+CONFIG_USB_MUSB_OMAP2PLUS=y
+CONFIG_USB_OMAP=y
+
+#
+# OMAP 343x high speed USB support
+#
+CONFIG_USB_MUSB_OTG=y
+CONFIG_USB_GADGET_MUSB_HDRC=y
+CONFIG_USB_MUSB_HDRC_HCD=y
+CONFIG_USB_INVENTRA_DMA=y
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# may also be needed; see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=y
+
+#
+# USB Miscellaneous drivers
+#
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_DUALSPEED=y
+CONFIG_USB_OTG_UTILS=y
+CONFIG_TWL4030_USB=y
+
+# USB gadget modules
+CONFIG_USB_G_NCM=y
+CONFIG_USB_MASS_STORAGE=y
+
+CONFIG_MMC=y
+
+#
+# MMC/SD Host Controller Drivers
+#
+CONFIG_MMC_OMAP_HS=y
+
+#
+# Real Time Clock
+#
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_TWL4030=y
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_VFAT_FS=y
+
+#
+# Multimedia core support
+#
+
+# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set
+
+#
+# Advanced Power Management Emulation support
+#
+CONFIG_APM_EMULATION=y
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine.scc
new file mode 100644
index 000000000..828400df4
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine.scc
@@ -0,0 +1,8 @@
+# yocto-bsp-filename {{=machine}}.scc
+kconf hardware {{=machine}}.cfg
+kconf non-hardware {{machine}}-non_hardware.cfg
+
+include features/usb-net/usb-net.scc
+
+kconf hardware {{=machine}}-user-config.cfg
+include {{=machine}}-user-patches.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/kernel-list.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/kernel-list.noinstall
new file mode 100644
index 000000000..00cf36042
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/kernel-list.noinstall
@@ -0,0 +1,5 @@
+{{ if kernel_choice != "custom": }}
+{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (4.4) kernel? (y/n)" default:"y"}}
+
+{{ if kernel_choice != "custom" and use_default_kernel == "n": }}
+{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_4.4"}}
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-dev.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-dev.bbappend
new file mode 100644
index 000000000..c336007eb
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-dev.bbappend
@@ -0,0 +1,25 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-dev": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Would you like SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-features.scc \
+ "
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
new file mode 100644
index 000000000..0a47a4e37
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
@@ -0,0 +1,33 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_4.1": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-tiny.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-patches.scc \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
new file mode 100644
index 000000000..815c77b81
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
@@ -0,0 +1,33 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_4.4": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-tiny.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-patches.scc \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.4"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_4.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_4.1.bbappend
new file mode 100644
index 000000000..2d3d073f7
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_4.1.bbappend
@@ -0,0 +1,32 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_4.1": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.1" \ No newline at end of file
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_4.4.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_4.4.bbappend
new file mode 100644
index 000000000..b88a06c52
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_4.4.bbappend
@@ -0,0 +1,32 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_4.4": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.4"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/COPYING.MIT b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/COPYING.MIT
new file mode 100644
index 000000000..fb950dc69
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/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/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/README b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/README
new file mode 100644
index 000000000..928659f30
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/README
@@ -0,0 +1,118 @@
+This README file contains information on building the meta-{{=machine}}
+BSP layer, and booting the images contained in the /binary directory.
+Please see the corresponding sections below for details.
+
+
+Dependencies
+============
+
+This layer depends on:
+
+ URI: git://git.openembedded.org/bitbake
+ branch: master
+
+ URI: git://git.openembedded.org/openembedded-core
+ layers: meta
+ branch: master
+
+ URI: git://git.yoctoproject.org/xxxx
+ layers: xxxx
+ branch: master
+
+
+Patches
+=======
+
+Please submit any patches against this BSP to the Yocto mailing list
+(yocto@yoctoproject.org) and cc: the maintainer:
+
+Maintainer: XXX YYYYYY <xxx.yyyyyy@zzzzz.com>
+
+Please see the meta-xxxx/MAINTAINERS file for more details.
+
+
+Table of Contents
+=================
+
+ I. Building the meta-{{=machine}} BSP layer
+ II. Booting the images in /binary
+
+
+I. Building the meta-{{=machine}} BSP layer
+========================================
+
+--- replace with specific instructions for your layer ---
+
+In order to build an image with BSP support for a given release, you
+need to download the corresponding BSP tarball from the 'Board Support
+Package (BSP) Downloads' page of the Yocto Project website.
+
+Having done that, and assuming you extracted the BSP tarball contents
+at the top-level of your yocto build tree, you can build a
+{{=machine}} image by adding the location of the meta-{{=machine}}
+layer to bblayers.conf, along with any other layers needed (to access
+common metadata shared between BSPs) e.g.:
+
+ yocto/meta-xxxx \
+ yocto/meta-xxxx/meta-{{=machine}} \
+
+To enable the {{=machine}} layer, add the {{=machine}} MACHINE to local.conf:
+
+ MACHINE ?= "{{=machine}}"
+
+You should then be able to build a {{=machine}} image as such:
+
+ $ source oe-init-build-env
+ $ bitbake core-image-sato
+
+At the end of a successful build, you should have a live image that
+you can boot from a USB flash drive (see instructions on how to do
+that below, in the section 'Booting the images from /binary').
+
+As an alternative to downloading the BSP tarball, you can also work
+directly from the meta-xxxx git repository. For each BSP in the
+'meta-xxxx' repository, there are multiple branches, one corresponding
+to each major release starting with 'laverne' (0.90), in addition to
+the latest code which tracks the current master (note that not all
+BSPs are present in every release). Instead of extracting a BSP
+tarball at the top level of your yocto build tree, you can
+equivalently check out the appropriate branch from the meta-xxxx
+repository at the same location.
+
+
+II. Booting the images in /binary
+=================================
+
+--- replace with specific instructions for your platform ---
+
+This BSP contains bootable live images, which can be used to directly
+boot Yocto off of a USB flash drive.
+
+Under Linux, insert a USB flash drive. Assuming the USB flash drive
+takes device /dev/sdf, use dd to copy the live image to it. For
+example:
+
+# dd if=core-image-sato-{{=machine}}-20101207053738.hddimg of=/dev/sdf
+# sync
+# eject /dev/sdf
+
+This should give you a bootable USB flash device. Insert the device
+into a bootable USB socket on the target, and power on. This should
+result in a system booted to the Sato graphical desktop.
+
+If you want a terminal, use the arrows at the top of the UI to move to
+different pages of available applications, one of which is named
+'Terminal'. Clicking that should give you a root terminal.
+
+If you want to ssh into the system, you can use the root terminal to
+ifconfig the IP address and use that to ssh in. The root password is
+empty, so to log in type 'root' for the user name and hit 'Enter' at
+the Password prompt: and you should be in.
+
+----
+
+If you find you're getting corrupt images on the USB (it doesn't show
+the syslinux boot: prompt, or the boot: prompt contains strange
+characters), try doing this first:
+
+# dd if=/dev/zero of=/dev/sdf bs=1M count=512
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/README.sources b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/README.sources
new file mode 100644
index 000000000..3c4cb7b43
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/README.sources
@@ -0,0 +1,17 @@
+The sources for the packages comprising the images shipped with this
+BSP can be found at the following location:
+
+http://downloads.yoctoproject.org/mirror/sources/
+
+The metadata used to generate the images shipped with this BSP, in
+addition to the code contained in this BSP, can be found at the
+following location:
+
+http://www.yoctoproject.org/downloads/yocto-1.1/poky-edison-6.0.tar.bz2
+
+The metadata used to generate the images shipped with this BSP, in
+addition to the code contained in this BSP, can also be found at the
+following locations:
+
+git://git.yoctoproject.org/poky.git
+git://git.yoctoproject.org/meta-xxxx
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/binary/.gitignore b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/binary/.gitignore
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/binary/.gitignore
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/conf/layer.conf b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/conf/layer.conf
new file mode 100644
index 000000000..5529f4595
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/conf/layer.conf
@@ -0,0 +1,10 @@
+# We have a conf and classes directory, add to BBPATH
+BBPATH .= ":${LAYERDIR}"
+
+# We have a recipes-* directories, add to BBFILES
+BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
+ ${LAYERDIR}/recipes-*/*/*.bbappend"
+
+BBFILE_COLLECTIONS += "{{=machine}}"
+BBFILE_PATTERN_{{=machine}} = "^${LAYERDIR}/"
+BBFILE_PRIORITY_{{=machine}} = "6"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor/machine.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor/machine.noinstall
new file mode 100644
index 000000000..b442d02d5
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor/machine.noinstall
@@ -0,0 +1 @@
+# yocto-bsp-dirname {{=machine}}
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor/machine/machconfig b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor/machine/machconfig
new file mode 100644
index 000000000..3b85d3821
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor/machine/machconfig
@@ -0,0 +1,5 @@
+# Assume a USB mouse and keyboard are connected
+{{ input type:"boolean" name:"touchscreen" msg:"Does your BSP have a touchscreen? (y/n)" default:"n" }}
+HAVE_TOUCHSCREEN={{=touchscreen}}
+{{ input type:"boolean" name:"keyboard" msg:"Does your BSP have a keyboard? (y/n)" default:"y" }}
+HAVE_KEYBOARD={{=keyboard}}
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor_0.0.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor_0.0.bbappend
new file mode 100644
index 000000000..6d4804d12
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor_0.0.bbappend
@@ -0,0 +1,2 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/kernel-list.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/kernel-list.noinstall
new file mode 100644
index 000000000..663dddbb0
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/kernel-list.noinstall
@@ -0,0 +1,26 @@
+{{ if kernel_choice == "custom": }}
+{{ input type:"boolean" name:"custom_kernel_remote" prio:"20" msg:"Is the custom kernel you'd like to use in a remote git repo? (y/n)" default:"y"}}
+
+{{ if kernel_choice == "custom" and custom_kernel_remote == "y": }}
+{{ input type:"edit-git-repo" name:"custom_kernel_remote_path" prio:"20" msg:"Please enter the full URI to the remote git repo (the default corresponds to linux-stable v3.16.3)" default:"git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git"}}
+
+{{ if kernel_choice == "custom" and custom_kernel_remote == "n": }}
+{{ input type:"edit-git-repo" name:"custom_kernel_local_path" prio:"20" msg:"You've indicated that you're not using a remote git repo. Please enter the full path to the local git repo you want to use (the default assumes a local linux-stable v3.16.3)" default:"/home/trz/yocto/kernels/linux-stable.git"}}
+
+{{ if kernel_choice == "custom": }}
+{{ input type:"boolean" name:"custom_kernel_need_kbranch" prio:"20" msg:"Do you need to use a specific (non-master) branch? (y/n)" default:"n"}}
+
+{{ if kernel_choice == "custom" and custom_kernel_need_kbranch == "y": }}
+{{ input type:"edit" name:"custom_kernel_kbranch" prio:"20" msg:"Please enter the branch you want to use (the default branch corresponds to the linux-stable 'linux-3.16.y' branch):" default:"linux-3.16.y"}}
+
+{{ if kernel_choice == "custom": }}
+{{ input type:"edit" name:"custom_kernel_srcrev" prio:"20" msg:"Please enter the SRCREV (commit id) you'd like to use (use '${AUTOREV}' to track the current HEAD):" default:"${AUTOREV}"}}
+
+{{ if kernel_choice == "custom": }}
+{{ input type:"edit" name:"custom_kernel_linux_version" prio:"20" msg:"Please enter the Linux version of the kernel you've specified:" default:"3.16.3"}}
+
+{{ if kernel_choice == "custom": }}
+{{ input type:"edit" name:"custom_kernel_linux_version_extension" prio:"20" msg:"Please enter a Linux version extension if you want (it will show up at the end of the kernel name shown by uname):" default:"-custom"}}
+
+{{ if kernel_choice == "custom": }}
+{{ input type:"edit-file" name:"custom_kernel_defconfig" prio:"20" msg:"It's recommended (but not required) that custom kernels be built using a defconfig. Please enter the full path to the defconfig for your kernel (NOTE: if you don't specify a defconfig the kernel probably won't build or boot):" default:""}}
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom.bb b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom.bb
new file mode 100644
index 000000000..fda955b5e
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom.bb
@@ -0,0 +1,57 @@
+# yocto-bsp-filename {{ if kernel_choice == "custom": }} this
+# This file was derived from the linux-yocto-custom.bb recipe in
+# oe-core.
+#
+# linux-yocto-custom.bb:
+#
+# A yocto-bsp-generated 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.
+#
+# Warning:
+#
+# Building this kernel 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.
+#
+# example configuration addition:
+# SRC_URI += "file://smp.cfg"
+# example patch addition:
+# SRC_URI += "file://0001-linux-version-tweak.patch
+# example feature addition:
+# SRC_URI += "file://feature.scc"
+#
+
+inherit kernel
+require recipes-kernel/linux/linux-yocto.inc
+
+{{ if kernel_choice == "custom" and custom_kernel_remote == "y": }}
+SRC_URI = "{{=custom_kernel_remote_path}};protocol=git;bareclone=1;branch=${KBRANCH}"
+{{ if kernel_choice == "custom" and custom_kernel_remote == "n": }}
+SRC_URI = "git://{{=custom_kernel_local_path}};protocol=file;bareclone=1;branch=${KBRANCH}"
+
+SRC_URI += "file://defconfig"
+
+SRC_URI += "file://{{=machine}}.scc \
+ file://{{=machine}}.cfg \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-patches.scc \
+ "
+
+{{ if kernel_choice == "custom" and custom_kernel_need_kbranch == "y" and custom_kernel_kbranch and custom_kernel_kbranch != "master": }}
+KBRANCH = "{{=custom_kernel_kbranch}}"
+
+LINUX_VERSION ?= "{{=custom_kernel_linux_version}}"
+LINUX_VERSION_EXTENSION ?= "{{=custom_kernel_linux_version_extension}}"
+
+SRCREV="{{=custom_kernel_srcrev}}"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom.noinstall
new file mode 100644
index 000000000..017d206c2
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom.noinstall
@@ -0,0 +1 @@
+# yocto-bsp-dirname {{ if kernel_choice == "custom": }} linux-yocto-custom
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/defconfig b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/defconfig
new file mode 100644
index 000000000..ceb0ffa30
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/defconfig
@@ -0,0 +1,5 @@
+#
+# Placeholder for custom default kernel configuration. yocto-bsp will
+# replace this file with a user-specified defconfig.
+#
+{{ if custom_kernel_defconfig: replace_file(of, custom_kernel_defconfig) }}
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine-user-config.cfg b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine-user-config.cfg
new file mode 100644
index 000000000..922309d5a
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine-user-config.cfg
@@ -0,0 +1,9 @@
+# yocto-bsp-filename {{=machine}}-user-config.cfg
+#
+# Used by yocto-kernel to manage config options.
+#
+# yocto-kernel may change the contents of this file in any
+# way it sees fit, including removing comments like this,
+# so don't manually make any modifications you don't want
+# to lose.
+#
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine-user-patches.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine-user-patches.scc
new file mode 100644
index 000000000..6d1138f42
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine-user-patches.scc
@@ -0,0 +1,9 @@
+# yocto-bsp-filename {{=machine}}-user-patches.scc
+#
+# Used by yocto-kernel to manage patches.
+#
+# yocto-kernel may change the contents of this file in any
+# way it sees fit, including removing comments like this,
+# so don't manually make any modifications you don't want
+# to lose.
+#
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine.cfg b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine.cfg
new file mode 100644
index 000000000..1ba8201f1
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine.cfg
@@ -0,0 +1,4 @@
+# yocto-bsp-filename {{=machine}}.cfg
+#
+# A convenient place to add config options, nothing more.
+#
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine.scc
new file mode 100644
index 000000000..0b6b41337
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/linux-yocto-custom/machine.scc
@@ -0,0 +1,18 @@
+# yocto-bsp-filename {{=machine}}.scc
+#
+# The top-level 'feature' for the {{=machine}} custom kernel.
+#
+# Essentially this is a convenient top-level container or starting
+# point for adding lower-level config fragements and features.
+#
+
+# {{=machine}}.cfg in the linux-yocto-custom subdir is just a
+# convenient place for adding random config fragments.
+
+kconf hardware {{=machine}}.cfg
+
+# These are used by yocto-kernel to add config fragments and features.
+# Don't remove if you plan on using yocto-kernel with this BSP.
+
+kconf hardware {{=machine}}-user-config.cfg
+include {{=machine}}-user-patches.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/conf/machine/machine.conf b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/conf/machine/machine.conf
new file mode 100644
index 000000000..d5abe4f61
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/conf/machine/machine.conf
@@ -0,0 +1,77 @@
+# yocto-bsp-filename {{=machine}}.conf
+#@TYPE: Machine
+#@NAME: {{=machine}}
+
+#@DESCRIPTION: Machine configuration for {{=machine}} systems
+
+{{ if kernel_choice == "custom": preferred_kernel = "linux-yocto-custom" }}
+{{ if kernel_choice == "linux-yocto-dev": preferred_kernel = "linux-yocto-dev" }}
+{{ if kernel_choice == "custom" or kernel_choice == "linux-yocto-dev" : }}
+PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}"
+
+{{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": preferred_kernel = kernel_choice.split('_')[0] }}
+{{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": preferred_kernel_version = kernel_choice.split('_')[1] }}
+{{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": }}
+PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}"
+PREFERRED_VERSION_{{=preferred_kernel}} ?= "{{=preferred_kernel_version}}%"
+
+{{ input type:"choicelist" name:"tunefile" prio:"40" msg:"Which machine tuning would you like to use?" default:"tune_core2" }}
+{{ input type:"choice" val:"tune_i586" msg:"i586 tuning optimizations" }}
+{{ input type:"choice" val:"tune_atom" msg:"Atom tuning optimizations" }}
+{{ input type:"choice" val:"tune_core2" msg:"Core2 tuning optimizations" }}
+{{ if tunefile == "tune_i586": }}
+require conf/machine/include/tune-i586.inc
+{{ if tunefile == "tune_atom": }}
+require conf/machine/include/tune-atom.inc
+{{ if tunefile == "tune_core2": }}
+DEFAULTTUNE="core2-32"
+require conf/machine/include/tune-core2.inc
+
+require conf/machine/include/x86-base.inc
+
+MACHINE_FEATURES += "wifi efi pcbios"
+
+{{ input type:"boolean" name:"xserver" prio:"50" msg:"Do you need support for X? (y/n)" default:"y" }}
+
+{{ if xserver == "y" and (kernel_choice == "linux-yocto_4.4" or kernel_choice == "linux-yocto_4.1"): }}
+{{ input type:"choicelist" name:"xserver_choice" prio:"50" msg:"Please select an xserver for this machine:" default:"xserver_vesa" }}
+{{ input type:"choice" val:"xserver_vesa" msg:"VESA xserver support" }}
+{{ input type:"choice" val:"xserver_i915" msg:"i915 xserver support" }}
+{{ input type:"choice" val:"xserver_i965" msg:"i965 xserver support" }}
+{{ input type:"choice" val:"xserver_fbdev" msg:"fbdev xserver support" }}
+{{ input type:"choice" val:"xserver_modesetting" msg:"modesetting xserver support" }}
+
+{{ if xserver == "y" and kernel_choice == "custom": }}
+{{ input type:"choicelist" name:"xserver_choice" prio:"50" msg:"Please select an xserver for this machine:" default:"xserver_vesa" }}
+{{ input type:"choice" val:"xserver_vesa" msg:"VESA xserver support" }}
+{{ input type:"choice" val:"xserver_i915" msg:"i915 xserver support" }}
+{{ input type:"choice" val:"xserver_i965" msg:"i965 xserver support" }}
+{{ input type:"choice" val:"xserver_fbdev" msg:"fbdev xserver support" }}
+{{ input type:"choice" val:"xserver_modesetting" msg:"modesetting xserver support" }}
+
+{{ if xserver == "y" and kernel_choice != "linux-yocto_4.4" and kernel_choice != "linux-yocto_4.1" and kernel_choice != "custom": xserver_choice = "xserver_i915" }}
+
+{{ if xserver == "y": }}
+XSERVER ?= "${XSERVER_X86_BASE} \
+ ${XSERVER_X86_EXT} \
+{{ if xserver == "y" and xserver_choice == "xserver_vesa": }}
+ ${XSERVER_X86_VESA} \
+{{ if xserver == "y" and xserver_choice == "xserver_i915": }}
+ ${XSERVER_X86_I915} \
+{{ if xserver == "y" and xserver_choice == "xserver_i965": }}
+ ${XSERVER_X86_I965} \
+{{ if xserver == "y" and xserver_choice == "xserver_fbdev": }}
+ ${XSERVER_X86_FBDEV} \
+{{ if xserver == "y" and xserver_choice == "xserver_modesetting": }}
+ ${XSERVER_X86_MODESETTING} \
+{{ if xserver == "y": }}
+ "
+
+MACHINE_EXTRA_RRECOMMENDS += "linux-firmware v86d eee-acpi-scripts"
+
+EXTRA_OECONF_append_pn-matchbox-panel-2 = " --with-battery=acpi"
+
+GLIBC_ADDONS = "nptl"
+
+{{ if xserver == "y" and xserver_choice == "xserver_vesa": }}
+APPEND += "video=vesafb vga=0x318"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall
new file mode 100644
index 000000000..b442d02d5
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall
@@ -0,0 +1 @@
+# yocto-bsp-dirname {{=machine}}
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf
new file mode 100644
index 000000000..ac9a0f1bb
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf
@@ -0,0 +1 @@
+# yocto-bsp-filename {{ if xserver == "y": }} this
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend
new file mode 100644
index 000000000..30830031e
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend
@@ -0,0 +1,2 @@
+# yocto-bsp-filename {{ if xserver == "y": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files.noinstall
new file mode 100644
index 000000000..1e0d92c55
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files.noinstall
@@ -0,0 +1 @@
+# yocto-bsp-dirname {{ if kernel_choice != "custom": }} files
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-preempt-rt.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-preempt-rt.scc
new file mode 100644
index 000000000..7146e235a
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-preempt-rt.scc
@@ -0,0 +1,17 @@
+# yocto-bsp-filename {{=machine}}-preempt-rt.scc
+define KMACHINE {{=machine}}
+
+define KARCH i386
+
+include {{=map_preempt_rt_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
+{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
+branch {{=machine}}
+
+include {{=machine}}.scc
+
+# default policy for preempt-rt kernels
+include cfg/usb-mass-storage.scc
+include cfg/boot-live.scc
+include features/latencytop/latencytop.scc
+include features/profiling/profiling.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-standard.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-standard.scc
new file mode 100644
index 000000000..67a54be87
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-standard.scc
@@ -0,0 +1,17 @@
+# yocto-bsp-filename {{=machine}}-standard.scc
+define KMACHINE {{=machine}}
+
+define KARCH i386
+
+include {{=map_standard_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
+{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
+branch {{=machine}}
+
+include {{=machine}}.scc
+
+# default policy for standard kernels
+include cfg/usb-mass-storage.scc
+include cfg/boot-live.scc
+include features/latencytop/latencytop.scc
+include features/profiling/profiling.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-tiny.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-tiny.scc
new file mode 100644
index 000000000..91373b3a5
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-tiny.scc
@@ -0,0 +1,11 @@
+# yocto-bsp-filename {{=machine}}-tiny.scc
+define KMACHINE {{=machine}}
+
+define KARCH i386
+
+include {{=map_tiny_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
+{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
+branch {{=machine}}
+
+include {{=machine}}.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-user-config.cfg b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-user-config.cfg
new file mode 100644
index 000000000..69efdcc75
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-user-config.cfg
@@ -0,0 +1 @@
+# yocto-bsp-filename {{=machine}}-user-config.cfg \ No newline at end of file
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-user-features.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-user-features.scc
new file mode 100644
index 000000000..85be26de9
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-user-features.scc
@@ -0,0 +1 @@
+# yocto-bsp-filename {{=machine}}-user-features.scc \ No newline at end of file
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-user-patches.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-user-patches.scc
new file mode 100644
index 000000000..4c59daac4
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-user-patches.scc
@@ -0,0 +1 @@
+# yocto-bsp-filename {{=machine}}-user-patches.scc \ No newline at end of file
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine.cfg b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine.cfg
new file mode 100644
index 000000000..3b168b7e3
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine.cfg
@@ -0,0 +1,55 @@
+# yocto-bsp-filename {{=machine}}.cfg
+CONFIG_X86_32=y
+CONFIG_MATOM=y
+CONFIG_PRINTK=y
+
+# Basic hardware support for the box - network, USB, PCI, sound
+CONFIG_NETDEVICES=y
+CONFIG_ATA=y
+CONFIG_ATA_GENERIC=y
+CONFIG_ATA_SFF=y
+CONFIG_PCI=y
+CONFIG_MMC=y
+CONFIG_MMC_SDHCI=y
+CONFIG_USB_SUPPORT=y
+CONFIG_USB=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+CONFIG_R8169=y
+CONFIG_PATA_SCH=y
+CONFIG_MMC_SDHCI_PCI=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_PCIEPORTBUS=y
+CONFIG_NET=y
+CONFIG_USB_UHCI_HCD=y
+CONFIG_USB_OHCI_HCD=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_CHR_DEV_SG=y
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_HDA_INTEL=y
+CONFIG_SATA_AHCI=y
+CONFIG_AGP=y
+CONFIG_PM=y
+CONFIG_ACPI=y
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+CONFIG_INPUT=y
+
+# Make sure these are on, otherwise the bootup won't be fun
+CONFIG_EXT3_FS=y
+CONFIG_UNIX=y
+CONFIG_INET=y
+CONFIG_MODULES=y
+CONFIG_SHMEM=y
+CONFIG_TMPFS=y
+CONFIG_PACKET=y
+
+# Needed for booting (and using) USB memory sticks
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_ISO8859_1=y
+
+CONFIG_RD_GZIP=y
+
+# Needed for booting (and using) CD images
+CONFIG_BLK_DEV_SR=y
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine.scc
new file mode 100644
index 000000000..3d32f111b
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine.scc
@@ -0,0 +1,21 @@
+# yocto-bsp-filename {{=machine}}.scc
+kconf hardware {{=machine}}.cfg
+
+include features/intel-e1xxxx/intel-e100.scc
+include features/intel-e1xxxx/intel-e1xxxx.scc
+
+{{ if xserver == "y" and xserver_choice == "xserver_i915" or xserver_choice == "xserver_i965": }}
+include features/i915/i915.scc
+
+include features/serial/8250.scc
+include features/ericsson-3g/f5521gw.scc
+
+{{ if xserver == "y" and xserver_choice == "xserver_vesa": }}
+include cfg/vesafb.scc
+
+include cfg/usb-mass-storage.scc
+include cfg/boot-live.scc
+include features/power/intel.scc
+
+kconf hardware {{=machine}}-user-config.cfg
+include {{=machine}}-user-patches.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/kernel-list.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/kernel-list.noinstall
new file mode 100644
index 000000000..00cf36042
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/kernel-list.noinstall
@@ -0,0 +1,5 @@
+{{ if kernel_choice != "custom": }}
+{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (4.4) kernel? (y/n)" default:"y"}}
+
+{{ if kernel_choice != "custom" and use_default_kernel == "n": }}
+{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_4.4"}}
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-dev.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-dev.bbappend
new file mode 100644
index 000000000..c336007eb
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-dev.bbappend
@@ -0,0 +1,25 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-dev": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Would you like SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-features.scc \
+ "
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
new file mode 100644
index 000000000..0a47a4e37
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
@@ -0,0 +1,33 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_4.1": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-tiny.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-patches.scc \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
new file mode 100644
index 000000000..815c77b81
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
@@ -0,0 +1,33 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_4.4": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-tiny.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-patches.scc \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.4"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_4.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_4.1.bbappend
new file mode 100644
index 000000000..aecdff025
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_4.1.bbappend
@@ -0,0 +1,32 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_4.1": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard:standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard:standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_4.4.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_4.4.bbappend
new file mode 100644
index 000000000..dd4de311a
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_4.4.bbappend
@@ -0,0 +1,32 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_4.4": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard:standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard:standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.4"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/COPYING.MIT b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/COPYING.MIT
new file mode 100644
index 000000000..89de35479
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/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/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/README b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/README
new file mode 100644
index 000000000..ca6527cd8
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/README
@@ -0,0 +1,64 @@
+This README file contains information on the contents of the
+{{=layer_name}} layer.
+
+Please see the corresponding sections below for details.
+
+
+Dependencies
+============
+
+This layer depends on:
+
+ URI: git://git.openembedded.org/bitbake
+ branch: master
+
+ URI: git://git.openembedded.org/openembedded-core
+ layers: meta
+ branch: master
+
+ URI: git://git.yoctoproject.org/xxxx
+ layers: xxxx
+ branch: master
+
+
+Patches
+=======
+
+Please submit any patches against the {{=layer_name}} 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 {{=layer_name}} layer to your build
+ II. Misc
+
+
+I. Adding the {{=layer_name}} layer to your build
+=================================================
+
+--- replace with specific instructions for the {{=layer_name}} layer ---
+
+In order to use this layer, you need to make the build system aware of
+it.
+
+Assuming the {{=layer_name}} layer exists at the top-level of your
+yocto build tree, you can add it to the build system by adding the
+location of the {{=layer_name}} layer to bblayers.conf, along with any
+other layers needed. e.g.:
+
+ BBLAYERS ?= " \
+ /path/to/yocto/meta \
+ /path/to/yocto/meta-poky \
+ /path/to/yocto/meta-yocto-bsp \
+ /path/to/yocto/meta-{{=layer_name}} \
+ "
+
+
+II. Misc
+========
+
+--- replace with specific information about the {{=layer_name}} layer ---
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/conf/layer.conf b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/conf/layer.conf
new file mode 100644
index 000000000..bdffe1719
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/conf/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 += "{{=layer_name}}"
+BBFILE_PATTERN_{{=layer_name}} = "^${LAYERDIR}/"
+BBFILE_PRIORITY_{{=layer_name}} = "{{=layer_priority}}"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/layer-questions.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/layer-questions.noinstall
new file mode 100644
index 000000000..e2a89c3b5
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/layer-questions.noinstall
@@ -0,0 +1,14 @@
+{{ input type:"edit" name:"layer_priority" prio:"20" msg:"Please enter the layer priority you'd like to use for the layer:" default:"6"}}
+
+{{ input type:"boolean" name:"create_example_recipe" prio:"20" msg:"Would you like to have an example recipe created? (y/n)" default:"n"}}
+
+{{ if create_example_recipe == "y": }}
+{{ input type:"edit" name:"example_recipe_name" prio:"20" msg:"Please enter the name you'd like to use for your example recipe:" default:"example"}}
+
+{{ input type:"boolean" name:"create_example_bbappend" prio:"20" msg:"Would you like to have an example bbappend file created? (y/n)" default:"n"}}
+
+{{ if create_example_bbappend == "y": }}
+{{ input type:"edit" name:"example_bbappend_name" prio:"20" msg:"Please enter the name you'd like to use for your bbappend file:" default:"example"}}
+
+{{ if create_example_bbappend == "y": }}
+{{ input type:"edit" name:"example_bbappend_version" prio:"20" msg:"Please enter the version number you'd like to use for your bbappend file (this should match the recipe you're appending to):" default:"0.1"}}
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend.noinstall
new file mode 100644
index 000000000..3594e6583
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend.noinstall
@@ -0,0 +1 @@
+# yocto-bsp-dirname {{ if create_example_bbappend == "y": }} recipes-example-bbappend
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend/example-bbappend/example-bbappend-version.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend/example-bbappend/example-bbappend-version.bbappend
new file mode 100644
index 000000000..353133080
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend/example-bbappend/example-bbappend-version.bbappend
@@ -0,0 +1,9 @@
+# yocto-bsp-filename {{=example_bbappend_name}}_{{=example_bbappend_version}}.bbappend
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:"
+
+#
+# This .bbappend doesn't yet do anything - replace this text with
+# modifications to the example_0.1.bb recipe, or whatever recipe it is
+# that you want to modify with this .bbappend (make sure you change
+# the recipe name (PN) and version (PV) to match).
+#
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend/example-bbappend/example-bbappend-version.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend/example-bbappend/example-bbappend-version.noinstall
new file mode 100644
index 000000000..46df8a8e0
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend/example-bbappend/example-bbappend-version.noinstall
@@ -0,0 +1 @@
+# yocto-bsp-dirname {{=example_bbappend_name}}-{{=example_bbappend_version}}
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend/example-bbappend/example-bbappend-version/example.patch b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend/example-bbappend/example-bbappend-version/example.patch
new file mode 100644
index 000000000..2000a34da
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example-bbappend/example-bbappend/example-bbappend-version/example.patch
@@ -0,0 +1,12 @@
+#
+# This is a non-functional placeholder file, here for example purposes
+# only.
+#
+# If you had a patch for your recipe, you'd put it in this directory
+# and reference it from your recipe's SRC_URI:
+#
+# SRC_URI += "file://example.patch"
+#
+# Note that you could also rename the directory containing this patch
+# to remove the version number or simply rename it 'files'. Doing so
+# allows you to use the same directory for multiple recipes.
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example.noinstall
new file mode 100644
index 000000000..b0069b1a5
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example.noinstall
@@ -0,0 +1 @@
+# yocto-bsp-dirname {{ if create_example_recipe == "y": }} recipes-example
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1.bb b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1.bb
new file mode 100644
index 000000000..5fbf59443
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1.bb
@@ -0,0 +1,23 @@
+# yocto-bsp-filename {{=example_recipe_name}}_0.1.bb
+#
+# This file was derived from the 'Hello World!' example recipe in the
+# Yocto Project Development Manual.
+#
+
+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}
+}
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1.noinstall
new file mode 100644
index 000000000..c319c19c5
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1.noinstall
@@ -0,0 +1 @@
+# yocto-bsp-dirname {{=example_recipe_name}}-0.1
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1/example.patch b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1/example.patch
new file mode 100644
index 000000000..2000a34da
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1/example.patch
@@ -0,0 +1,12 @@
+#
+# This is a non-functional placeholder file, here for example purposes
+# only.
+#
+# If you had a patch for your recipe, you'd put it in this directory
+# and reference it from your recipe's SRC_URI:
+#
+# SRC_URI += "file://example.patch"
+#
+# Note that you could also rename the directory containing this patch
+# to remove the version number or simply rename it 'files'. Doing so
+# allows you to use the same directory for multiple recipes.
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1/helloworld.c b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1/helloworld.c
new file mode 100644
index 000000000..71f2e46b4
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/layer/recipes-example/example/example-recipe-0.1/helloworld.c
@@ -0,0 +1,8 @@
+#include <stdio.h>
+
+int main(int argc, char **argv)
+{
+ printf("Hello World!\n");
+
+ return 0;
+}
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/.gitignore b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/.gitignore
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/.gitignore
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/conf/machine/machine.conf b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/conf/machine/machine.conf
new file mode 100644
index 000000000..b319d626f
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/conf/machine/machine.conf
@@ -0,0 +1,39 @@
+# yocto-bsp-filename {{=machine}}.conf
+#@TYPE: Machine
+#@NAME: {{=machine}}
+
+#@DESCRIPTION: Machine configuration for {{=machine}} systems
+
+require conf/machine/include/tune-mips32.inc
+
+MACHINE_FEATURES = "screen keyboard pci usbhost ext2 ext3 serial"
+
+KERNEL_IMAGETYPE = "vmlinux"
+KERNEL_ALT_IMAGETYPE = "vmlinux.bin"
+KERNEL_IMAGE_STRIP_EXTRA_SECTIONS = ".comment"
+
+{{ if kernel_choice == "custom": preferred_kernel = "linux-yocto-custom" }}
+{{ if kernel_choice == "linux-yocto-dev": preferred_kernel = "linux-yocto-dev" }}
+{{ if kernel_choice == "custom" or kernel_choice == "linux-yocto-dev" : }}
+PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}"
+
+{{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": preferred_kernel = kernel_choice.split('_')[0] }}
+{{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": preferred_kernel_version = kernel_choice.split('_')[1] }}
+{{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": }}
+PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}"
+PREFERRED_VERSION_{{=preferred_kernel}} ?= "{{=preferred_kernel_version}}%"
+
+{{ input type:"boolean" name:"xserver" prio:"50" msg:"Do you need support for X? (y/n)" default:"y" }}
+{{ if xserver == "y": }}
+PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
+XSERVER ?= "xserver-xorg \
+ xf86-input-evdev \
+ xf86-video-fbdev"
+
+SERIAL_CONSOLE = "115200 ttyS0"
+USE_VT ?= "0"
+
+MACHINE_EXTRA_RRECOMMENDS = " kernel-modules"
+
+IMAGE_FSTYPES ?= "jffs2 tar.bz2"
+JFFS2_ERASEBLOCK = "0x10000"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files.noinstall
new file mode 100644
index 000000000..1e0d92c55
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files.noinstall
@@ -0,0 +1 @@
+# yocto-bsp-dirname {{ if kernel_choice != "custom": }} files
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-preempt-rt.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-preempt-rt.scc
new file mode 100644
index 000000000..a128255b3
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-preempt-rt.scc
@@ -0,0 +1,11 @@
+# yocto-bsp-filename {{=machine}}-preempt-rt.scc
+define KMACHINE {{=machine}}
+
+define KARCH mips
+
+include {{=map_preempt_rt_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
+{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
+branch {{=machine}}
+
+include {{=machine}}.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-standard.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-standard.scc
new file mode 100644
index 000000000..7c9dc52d2
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-standard.scc
@@ -0,0 +1,11 @@
+# yocto-bsp-filename {{=machine}}-standard.scc
+define KMACHINE {{=machine}}
+
+define KARCH mips
+
+include {{=map_standard_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
+{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
+branch {{=machine}}
+
+include {{=machine}}.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-tiny.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-tiny.scc
new file mode 100644
index 000000000..64f395bbc
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-tiny.scc
@@ -0,0 +1,11 @@
+# yocto-bsp-filename {{=machine}}-tiny.scc
+define KMACHINE {{=machine}}
+
+define KARCH mips
+
+include {{=map_tiny_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
+{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
+branch {{=machine}}
+
+include {{=machine}}.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-user-config.cfg b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-user-config.cfg
new file mode 100644
index 000000000..47489e44e
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-user-config.cfg
@@ -0,0 +1 @@
+# yocto-bsp-filename {{=machine}}-user-config.cfg
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-user-features.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-user-features.scc
new file mode 100644
index 000000000..85be26de9
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-user-features.scc
@@ -0,0 +1 @@
+# yocto-bsp-filename {{=machine}}-user-features.scc \ No newline at end of file
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-user-patches.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-user-patches.scc
new file mode 100644
index 000000000..97f747fa0
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-user-patches.scc
@@ -0,0 +1 @@
+# yocto-bsp-filename {{=machine}}-user-patches.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine.cfg b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine.cfg
new file mode 100644
index 000000000..2fe476691
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine.cfg
@@ -0,0 +1,2 @@
+# yocto-bsp-filename {{=machine}}.cfg
+CONFIG_MIPS=y
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine.scc
new file mode 100644
index 000000000..f39dc3edf
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine.scc
@@ -0,0 +1,8 @@
+# yocto-bsp-filename {{=machine}}.scc
+kconf hardware {{=machine}}.cfg
+
+include cfg/usb-mass-storage.scc
+include cfg/fs/vfat.scc
+
+kconf hardware {{=machine}}-user-config.cfg
+include {{=machine}}-user-patches.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/kernel-list.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/kernel-list.noinstall
new file mode 100644
index 000000000..00cf36042
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/kernel-list.noinstall
@@ -0,0 +1,5 @@
+{{ if kernel_choice != "custom": }}
+{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (4.4) kernel? (y/n)" default:"y"}}
+
+{{ if kernel_choice != "custom" and use_default_kernel == "n": }}
+{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_4.4"}}
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-dev.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-dev.bbappend
new file mode 100644
index 000000000..c336007eb
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-dev.bbappend
@@ -0,0 +1,25 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-dev": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Would you like SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-features.scc \
+ "
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
new file mode 100644
index 000000000..0a47a4e37
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
@@ -0,0 +1,33 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_4.1": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-tiny.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-patches.scc \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
new file mode 100644
index 000000000..815c77b81
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
@@ -0,0 +1,33 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_4.4": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-tiny.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-patches.scc \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.4"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_4.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_4.1.bbappend
new file mode 100644
index 000000000..1e99a04dc
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_4.1.bbappend
@@ -0,0 +1,32 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_4.1": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_4.4.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_4.4.bbappend
new file mode 100644
index 000000000..b88a06c52
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_4.4.bbappend
@@ -0,0 +1,32 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_4.4": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.4"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/.gitignore b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/.gitignore
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/.gitignore
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/conf/machine/machine.conf b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/conf/machine/machine.conf
new file mode 100644
index 000000000..3afc5e093
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/conf/machine/machine.conf
@@ -0,0 +1,39 @@
+# yocto-bsp-filename {{=machine}}.conf
+#@TYPE: Machine
+#@NAME: {{=machine}}
+
+#@DESCRIPTION: Machine configuration for {{=machine}} systems
+
+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"
+
+{{ if kernel_choice == "custom": preferred_kernel = "linux-yocto-custom" }}
+{{ if kernel_choice == "linux-yocto-dev": preferred_kernel = "linux-yocto-dev" }}
+{{ if kernel_choice == "custom" or kernel_choice == "linux-yocto-dev" : }}
+PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}"
+
+{{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": preferred_kernel = kernel_choice.split('_')[0] }}
+{{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": preferred_kernel_version = kernel_choice.split('_')[1] }}
+{{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": }}
+PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}"
+PREFERRED_VERSION_{{=preferred_kernel}} ?= "{{=preferred_kernel_version}}%"
+
+{{ input type:"boolean" name:"xserver" prio:"50" msg:"Do you need support for X? (y/n)" default:"y" }}
+{{ if xserver == "y": }}
+PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
+XSERVER ?= "xserver-xorg \
+ xf86-input-evdev \
+ xf86-video-fbdev"
+
+SERIAL_CONSOLE = "115200 ttyS0"
+USE_VT ?= "0"
+
+MACHINE_EXTRA_RRECOMMENDS = " kernel-modules"
+
+IMAGE_FSTYPES ?= "jffs2 tar.bz2"
+JFFS2_ERASEBLOCK = "0x10000"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files.noinstall
new file mode 100644
index 000000000..1e0d92c55
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files.noinstall
@@ -0,0 +1 @@
+# yocto-bsp-dirname {{ if kernel_choice != "custom": }} files
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-preempt-rt.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-preempt-rt.scc
new file mode 100644
index 000000000..a128255b3
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-preempt-rt.scc
@@ -0,0 +1,11 @@
+# yocto-bsp-filename {{=machine}}-preempt-rt.scc
+define KMACHINE {{=machine}}
+
+define KARCH mips
+
+include {{=map_preempt_rt_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
+{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
+branch {{=machine}}
+
+include {{=machine}}.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-standard.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-standard.scc
new file mode 100644
index 000000000..7c9dc52d2
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-standard.scc
@@ -0,0 +1,11 @@
+# yocto-bsp-filename {{=machine}}-standard.scc
+define KMACHINE {{=machine}}
+
+define KARCH mips
+
+include {{=map_standard_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
+{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
+branch {{=machine}}
+
+include {{=machine}}.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-tiny.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-tiny.scc
new file mode 100644
index 000000000..64f395bbc
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-tiny.scc
@@ -0,0 +1,11 @@
+# yocto-bsp-filename {{=machine}}-tiny.scc
+define KMACHINE {{=machine}}
+
+define KARCH mips
+
+include {{=map_tiny_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
+{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
+branch {{=machine}}
+
+include {{=machine}}.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-user-config.cfg b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-user-config.cfg
new file mode 100644
index 000000000..69efdcc75
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-user-config.cfg
@@ -0,0 +1 @@
+# yocto-bsp-filename {{=machine}}-user-config.cfg \ No newline at end of file
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-user-features.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-user-features.scc
new file mode 100644
index 000000000..85be26de9
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-user-features.scc
@@ -0,0 +1 @@
+# yocto-bsp-filename {{=machine}}-user-features.scc \ No newline at end of file
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-user-patches.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-user-patches.scc
new file mode 100644
index 000000000..4c59daac4
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-user-patches.scc
@@ -0,0 +1 @@
+# yocto-bsp-filename {{=machine}}-user-patches.scc \ No newline at end of file
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine.cfg b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine.cfg
new file mode 100644
index 000000000..0cc906bbf
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine.cfg
@@ -0,0 +1,66 @@
+# yocto-bsp-filename {{=machine}}.cfg
+#SOC
+CONFIG_CAVIUM_OCTEON_SOC=y
+CONFIG_CAVIUM_CN63XXP1=y
+CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE=2
+
+#Kernel
+CONFIG_SMP=y
+CONFIG_NR_CPUS=32
+#Executable file formats
+CONFIG_MIPS32_COMPAT=y
+CONFIG_MIPS32_O32=y
+CONFIG_MIPS32_N32=y
+
+
+#PCI
+CONFIG_PCI=y
+CONFIG_PCI_MSI=y
+
+#I2C
+CONFIG_I2C=y
+CONFIG_I2C_OCTEON=y
+
+CONFIG_HW_RANDOM_OCTEON=y
+
+#SPI
+CONFIG_SPI=y
+CONFIG_SPI_OCTEON=y
+
+#Misc
+CONFIG_EEPROM_AT24=y
+CONFIG_EEPROM_AT25=y
+CONFIG_OCTEON_WDT=y
+
+CONFIG_STAGING=y
+
+#Ethernet
+CONFIG_OCTEON_ETHERNET=y
+CONFIG_OCTEON_MGMT_ETHERNET=y
+CONFIG_MDIO_OCTEON=y
+
+#PHY
+CONFIG_MARVELL_PHY=y
+CONFIG_BROADCOM_PHY=y
+CONFIG_BCM87XX_PHY=y
+
+
+#USB
+CONFIG_USB=y
+CONFIG_OCTEON_USB=y
+CONFIG_USB_OCTEON_EHCI=y
+CONFIG_USB_OCTEON_OHCI=y
+CONFIG_USB_OCTEON2_COMMON=y
+
+CONFIG_MTD=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_CFI=y
+CONFIG_MTD_CFI_AMDSTD=y
+CONFIG_MTD_CMDLINE_PARTS=y
+
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=2
+CONFIG_SERIAL_8250_RUNTIME_UARTS=2
+CONFIG_SERIAL_8250_DW=y
+
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine.scc
new file mode 100644
index 000000000..f39dc3edf
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine.scc
@@ -0,0 +1,8 @@
+# yocto-bsp-filename {{=machine}}.scc
+kconf hardware {{=machine}}.cfg
+
+include cfg/usb-mass-storage.scc
+include cfg/fs/vfat.scc
+
+kconf hardware {{=machine}}-user-config.cfg
+include {{=machine}}-user-patches.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/kernel-list.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/kernel-list.noinstall
new file mode 100644
index 000000000..00cf36042
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/kernel-list.noinstall
@@ -0,0 +1,5 @@
+{{ if kernel_choice != "custom": }}
+{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (4.4) kernel? (y/n)" default:"y"}}
+
+{{ if kernel_choice != "custom" and use_default_kernel == "n": }}
+{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_4.4"}}
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-dev.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-dev.bbappend
new file mode 100644
index 000000000..c336007eb
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-dev.bbappend
@@ -0,0 +1,25 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-dev": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Would you like SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-features.scc \
+ "
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
new file mode 100644
index 000000000..0a47a4e37
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
@@ -0,0 +1,33 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_4.1": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-tiny.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-patches.scc \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
new file mode 100644
index 000000000..815c77b81
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
@@ -0,0 +1,33 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_4.4": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-tiny.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-patches.scc \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.4"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_4.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_4.1.bbappend
new file mode 100644
index 000000000..01a046c75
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_4.1.bbappend
@@ -0,0 +1,32 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_4.1": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/edgerouter" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/edgerouter" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_4.4.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_4.4.bbappend
new file mode 100644
index 000000000..57c90fa3a
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_4.4.bbappend
@@ -0,0 +1,32 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_4.4": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/edgerouter" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/edgerouter" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.4"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/.gitignore b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/.gitignore
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/.gitignore
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/machine.conf b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/machine.conf
new file mode 100644
index 000000000..583c5e44f
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/machine.conf
@@ -0,0 +1,87 @@
+# yocto-bsp-filename {{=machine}}.conf
+#@TYPE: Machine
+#@NAME: {{=machine}}
+
+#@DESCRIPTION: Machine configuration for {{=machine}} systems
+
+TARGET_FPU = ""
+
+{{ input type:"choicelist" name:"tunefile" prio:"40" msg:"Which machine tuning would you like to use?" default:"tune_ppce300c3" }}
+{{ input type:"choice" val:"tune_ppc476" msg:"ppc476 tuning optimizations" }}
+{{ input type:"choice" val:"tune_ppc603e" msg:"ppc603e tuning optimizations" }}
+{{ input type:"choice" val:"tune_ppc7400" msg:"ppc7400 tuning optimizations" }}
+{{ input type:"choice" val:"tune_ppce300c2" msg:"ppce300c2 tuning optimizations" }}
+{{ input type:"choice" val:"tune_ppce300c3" msg:"ppce300c3 tuning optimizations" }}
+{{ input type:"choice" val:"tune_ppce500" msg:"ppce500 tuning optimizations" }}
+{{ input type:"choice" val:"tune_ppce500mc" msg:"ppce500mc tuning optimizations" }}
+{{ input type:"choice" val:"tune_ppce500v2" msg:"ppce500v2 tuning optimizations" }}
+{{ input type:"choice" val:"tune_ppce5500" msg:"ppce5500 tuning optimizations" }}
+{{ input type:"choice" val:"tune_ppce6500" msg:"ppce6500 tuning optimizations" }}
+{{ input type:"choice" val:"tune_power5" msg:"power5 tuning optimizations" }}
+{{ input type:"choice" val:"tune_power6" msg:"power6 tuning optimizations" }}
+{{ input type:"choice" val:"tune_power7" msg:"power7 tuning optimizations" }}
+{{ if tunefile == "tune_ppc476": }}
+include conf/machine/include/tune-ppc476.inc
+{{ if tunefile == "tune_ppc603e": }}
+include conf/machine/include/tune-ppc603e.inc
+{{ if tunefile == "tune_ppc7400": }}
+include conf/machine/include/tune-ppc7400.inc
+{{ if tunefile == "tune_ppce300c2": }}
+include conf/machine/include/tune-ppce300c2.inc
+{{ if tunefile == "tune_ppce300c3": }}
+include conf/machine/include/tune-ppce300c3.inc
+{{ if tunefile == "tune_ppce500": }}
+include conf/machine/include/tune-ppce500.inc
+{{ if tunefile == "tune_ppce500mc": }}
+include conf/machine/include/tune-ppce500mc.inc
+{{ if tunefile == "tune_ppce500v2": }}
+include conf/machine/include/tune-ppce500v2.inc
+{{ if tunefile == "tune_ppce5500": }}
+include conf/machine/include/tune-ppce5500.inc
+{{ if tunefile == "tune_ppce6500": }}
+include conf/machine/include/tune-ppce6500.inc
+{{ if tunefile == "tune_power5": }}
+include conf/machine/include/tune-power5.inc
+{{ if tunefile == "tune_power6": }}
+include conf/machine/include/tune-power6.inc
+{{ if tunefile == "tune_power7": }}
+include conf/machine/include/tune-power7.inc
+
+KERNEL_IMAGETYPE = "uImage"
+
+EXTRA_IMAGEDEPENDS += "u-boot"
+UBOOT_MACHINE_{{=machine}} = "MPC8315ERDB_config"
+
+SERIAL_CONSOLE = "115200 ttyS0"
+
+MACHINE_FEATURES = "keyboard pci ext2 ext3 serial"
+
+{{ if kernel_choice == "custom": preferred_kernel = "linux-yocto-custom" }}
+{{ if kernel_choice == "linux-yocto-dev": preferred_kernel = "linux-yocto-dev" }}
+{{ if kernel_choice == "custom" or kernel_choice == "linux-yocto-dev" : }}
+PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}"
+
+{{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": preferred_kernel = kernel_choice.split('_')[0] }}
+{{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": preferred_kernel_version = kernel_choice.split('_')[1] }}
+{{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": }}
+PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}"
+PREFERRED_VERSION_{{=preferred_kernel}} ?= "{{=preferred_kernel_version}}%"
+
+{{ input type:"boolean" name:"xserver" prio:"50" msg:"Do you need support for X? (y/n)" default:"y" }}
+{{ if xserver == "y": }}
+PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
+XSERVER ?= "xserver-xorg \
+ xf86-input-evdev \
+ xf86-video-fbdev"
+
+PREFERRED_VERSION_u-boot ?= "v2016.01%"
+{{ input type:"edit" name:"uboot_entrypoint" prio:"40" msg:"Please specify a value for UBOOT_ENTRYPOINT:" default:"0x00000000" }}
+UBOOT_ENTRYPOINT = "{{=uboot_entrypoint}}"
+
+{{ input type:"edit" name:"kernel_devicetree" prio:"40" msg:"Please specify a [arch/powerpc/boot/dts/xxx] value for KERNEL_DEVICETREE:" default:"mpc8315erdb.dts" }}
+KERNEL_DEVICETREE = "${S}/arch/powerpc/boot/dts/{{=kernel_devicetree}}"
+
+MACHINE_EXTRA_RRECOMMENDS = " kernel-modules"
+
+IMAGE_FSTYPES ?= "jffs2 tar.bz2"
+JFFS2_ERASEBLOCK = "0x4000"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files.noinstall
new file mode 100644
index 000000000..1e0d92c55
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files.noinstall
@@ -0,0 +1 @@
+# yocto-bsp-dirname {{ if kernel_choice != "custom": }} files
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-preempt-rt.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-preempt-rt.scc
new file mode 100644
index 000000000..91ccfb830
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-preempt-rt.scc
@@ -0,0 +1,11 @@
+# yocto-bsp-filename {{=machine}}-preempt-rt.scc
+define KMACHINE {{=machine}}
+
+define KARCH powerpc
+
+include {{=map_preempt_rt_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
+{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
+branch {{=machine}}
+
+include {{=machine}}.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-standard.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-standard.scc
new file mode 100644
index 000000000..89b344fea
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-standard.scc
@@ -0,0 +1,11 @@
+# yocto-bsp-filename {{=machine}}-standard.scc
+define KMACHINE {{=machine}}
+
+define KARCH powerpc
+
+include {{=map_standard_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
+{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
+branch {{=machine}}
+
+include {{=machine}}.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-tiny.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-tiny.scc
new file mode 100644
index 000000000..2701fd8b5
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-tiny.scc
@@ -0,0 +1,11 @@
+# yocto-bsp-filename {{=machine}}-tiny.scc
+define KMACHINE {{=machine}}
+
+define KARCH powerpc
+
+include {{=map_tiny_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
+{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
+branch {{=machine}}
+
+include {{=machine}}.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-user-config.cfg b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-user-config.cfg
new file mode 100644
index 000000000..47489e44e
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-user-config.cfg
@@ -0,0 +1 @@
+# yocto-bsp-filename {{=machine}}-user-config.cfg
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-user-features.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-user-features.scc
new file mode 100644
index 000000000..582759e61
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-user-features.scc
@@ -0,0 +1 @@
+# yocto-bsp-filename {{=machine}}-user-features.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-user-patches.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-user-patches.scc
new file mode 100644
index 000000000..97f747fa0
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-user-patches.scc
@@ -0,0 +1 @@
+# yocto-bsp-filename {{=machine}}-user-patches.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine.cfg b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine.cfg
new file mode 100644
index 000000000..5bfe1fe4b
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine.cfg
@@ -0,0 +1,164 @@
+# yocto-bsp-filename {{=machine}}.cfg
+..........................................................................
+. WARNING
+.
+. This file is a kernel configuration fragment, and not a full kernel
+. configuration file. The final kernel configuration is made up of
+. an assembly of processed fragments, each of which is designed to
+. capture a specific part of the final configuration (e.g. platform
+. configuration, feature configuration, and board specific hardware
+. configuration). For more information on kernel configuration, please
+. consult the product documentation.
+.
+..........................................................................
+CONFIG_PPC32=y
+CONFIG_PPC_OF=y
+CONFIG_PPC_UDBG_16550=y
+
+#
+# Processor support
+#
+CONFIG_PPC_83xx=y
+
+#
+# Platform support
+#
+CONFIG_MPC831x_RDB=y
+# CONFIG_PPC_CHRP is not set
+# CONFIG_PPC_PMAC is not set
+
+#
+# Bus options
+#
+CONFIG_PCI=y
+
+#
+# Memory Technology Devices (MTD)
+#
+CONFIG_MTD=y
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_OF_PARTS=y
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+CONFIG_MTD_CFI_AMDSTD=y
+
+#
+# Mapping drivers for chip access
+#
+CONFIG_MTD_PHYSMAP_OF=y
+
+#
+# NAND Flash Device Drivers
+#
+CONFIG_MTD_NAND=y
+
+#
+# Ethernet (1000 Mbit)
+#
+CONFIG_GIANFAR=y
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=2
+
+#
+# Watchdog Device Drivers
+#
+CONFIG_8xxx_WDT=y
+
+#
+# I2C support
+#
+CONFIG_I2C=y
+CONFIG_I2C_CHARDEV=y
+
+#
+# I2C Hardware Bus support
+#
+CONFIG_I2C_MPC=y
+
+CONFIG_SENSORS_LM75=y
+
+CONFIG_MISC_DEVICES=y
+
+#
+# Miscellaneous I2C Chip support
+#
+CONFIG_EEPROM_AT24=y
+
+#
+# SPI support
+#
+CONFIG_SPI=y
+# CONFIG_SPI_DEBUG is not set
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_MPC8xxx=y
+
+#
+# SPI Protocol Masters
+#
+CONFIG_HWMON=y
+
+#
+# SCSI device support
+#
+CONFIG_SCSI=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_CHR_DEV_SG=y
+CONFIG_SCSI_LOGGING=y
+
+CONFIG_ATA=y
+CONFIG_ATA_VERBOSE_ERROR=y
+CONFIG_SATA_FSL=y
+CONFIG_ATA_SFF=y
+
+#
+# USB support
+#
+CONFIG_USB=m
+CONFIG_USB_DEVICEFS=y
+
+#
+# USB Host Controller Drivers
+#
+CONFIG_USB_EHCI_HCD=m
+CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_STORAGE=m
+
+#
+# Real Time Clock
+#
+CONFIG_RTC_CLASS=y
+
+#
+# I2C RTC drivers
+#
+CONFIG_RTC_DRV_DS1307=y
+
+CONFIG_KGDB_8250=m
+
+CONFIG_CRYPTO_DEV_TALITOS=m
+
+CONFIG_FSL_DMA=y
+
+CONFIG_MMC=y
+CONFIG_MMC_SPI=m
+
+CONFIG_USB_FSL_MPH_DR_OF=y
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine.scc
new file mode 100644
index 000000000..7aac8b080
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine.scc
@@ -0,0 +1,10 @@
+# yocto-bsp-filename {{=machine}}.scc
+kconf hardware {{=machine}}.cfg
+
+include cfg/usb-mass-storage.scc
+include cfg/fs/vfat.scc
+
+include cfg/dmaengine.scc
+
+kconf hardware {{=machine}}-user-config.cfg
+include {{=machine}}-user-patches.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/kernel-list.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/kernel-list.noinstall
new file mode 100644
index 000000000..00cf36042
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/kernel-list.noinstall
@@ -0,0 +1,5 @@
+{{ if kernel_choice != "custom": }}
+{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (4.4) kernel? (y/n)" default:"y"}}
+
+{{ if kernel_choice != "custom" and use_default_kernel == "n": }}
+{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_4.4"}}
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-dev.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-dev.bbappend
new file mode 100644
index 000000000..c336007eb
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-dev.bbappend
@@ -0,0 +1,25 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-dev": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Would you like SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-features.scc \
+ "
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
new file mode 100644
index 000000000..0a47a4e37
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
@@ -0,0 +1,33 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_4.1": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-tiny.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-patches.scc \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
new file mode 100644
index 000000000..815c77b81
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
@@ -0,0 +1,33 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_4.4": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-tiny.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-patches.scc \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.4"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_4.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_4.1.bbappend
new file mode 100644
index 000000000..1e99a04dc
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_4.1.bbappend
@@ -0,0 +1,32 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_4.1": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_4.4.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_4.4.bbappend
new file mode 100644
index 000000000..b88a06c52
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_4.4.bbappend
@@ -0,0 +1,32 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_4.4": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.4"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/machine.conf b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/machine.conf
new file mode 100644
index 000000000..67e1cbd99
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/machine.conf
@@ -0,0 +1,74 @@
+# yocto-bsp-filename {{=machine}}.conf
+#@TYPE: Machine
+#@NAME: {{=machine}}
+
+#@DESCRIPTION: Machine configuration for {{=machine}} systems
+
+{{ if kernel_choice == "custom": preferred_kernel = "linux-yocto-custom" }}
+{{ if kernel_choice == "linux-yocto-dev": preferred_kernel = "linux-yocto-dev" }}
+{{ if kernel_choice == "custom" or kernel_choice == "linux-yocto-dev" : }}
+PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}"
+
+{{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": preferred_kernel = kernel_choice.split('_')[0] }}
+{{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": preferred_kernel_version = kernel_choice.split('_')[1] }}
+{{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": }}
+PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}"
+PREFERRED_VERSION_{{=preferred_kernel}} ?= "{{=preferred_kernel_version}}%"
+
+{{ if qemuarch == "i386" or qemuarch == "x86_64": }}
+PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
+PREFERRED_PROVIDER_virtual/libgl ?= "mesa"
+PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa"
+PREFERRED_PROVIDER_virtual/libgles2 ?= "mesa"
+
+{{ input type:"choicelist" name:"qemuarch" prio:"5" msg:"Which qemu architecture would you like to use?" default:"i386" }}
+{{ input type:"choice" val:"i386" msg:"i386 (32-bit)" }}
+{{ input type:"choice" val:"x86_64" msg:"x86_64 (64-bit)" }}
+{{ input type:"choice" val:"arm" msg:"ARM (32-bit)" }}
+{{ input type:"choice" val:"powerpc" msg:"PowerPC (32-bit)" }}
+{{ input type:"choice" val:"mips" msg:"MIPS (32-bit)" }}
+{{ input type:"choice" val:"mips64" msg:"MIPS64 (64-bit)" }}
+{{ if qemuarch == "i386": }}
+require conf/machine/include/qemu.inc
+require conf/machine/include/tune-i586.inc
+{{ if qemuarch == "x86_64": }}
+require conf/machine/include/qemu.inc
+DEFAULTTUNE ?= "core2-64"
+require conf/machine/include/tune-core2.inc
+{{ if qemuarch == "arm": }}
+require conf/machine/include/qemu.inc
+require conf/machine/include/tune-arm926ejs.inc
+{{ if qemuarch == "powerpc": }}
+require conf/machine/include/qemu.inc
+require conf/machine/include/tune-ppc7400.inc
+{{ if qemuarch == "mips": }}
+require conf/machine/include/qemu.inc
+require conf/machine/include/tune-mips32.inc
+{{ if qemuarch == "mips64": }}
+require conf/machine/include/qemu.inc
+require conf/machine/include/tune-mips64.inc
+
+{{ if qemuarch == "i386" or qemuarch == "x86_64": }}
+MACHINE_FEATURES += "x86"
+KERNEL_IMAGETYPE = "bzImage"
+SERIAL_CONSOLE = "115200 ttyS0"
+XSERVER = "xserver-xorg \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'mesa-driver-swrast', '', d)} \
+ xf86-input-vmmouse \
+ xf86-input-keyboard \
+ xf86-input-evdev \
+ xf86-video-vmware"
+
+{{ if qemuarch == "arm": }}
+KERNEL_IMAGETYPE = "zImage"
+SERIAL_CONSOLE = "115200 ttyAMA0"
+
+{{ if qemuarch == "powerpc": }}
+KERNEL_IMAGETYPE = "vmlinux"
+SERIAL_CONSOLE = "115200 ttyS0"
+
+{{ if qemuarch == "mips" or qemuarch == "mips64": }}
+KERNEL_IMAGETYPE = "vmlinux"
+KERNEL_ALT_IMAGETYPE = "vmlinux.bin"
+SERIAL_CONSOLE = "115200 ttyS0"
+MACHINE_EXTRA_RRECOMMENDS = " kernel-modules"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-core/init-ifupdown/init-ifupdown/machine.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-core/init-ifupdown/init-ifupdown/machine.noinstall
new file mode 100644
index 000000000..b442d02d5
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-core/init-ifupdown/init-ifupdown/machine.noinstall
@@ -0,0 +1 @@
+# yocto-bsp-dirname {{=machine}}
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-core/init-ifupdown/init-ifupdown/machine/interfaces b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-core/init-ifupdown/init-ifupdown/machine/interfaces
new file mode 100644
index 000000000..16967763e
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-core/init-ifupdown/init-ifupdown/machine/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/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend
new file mode 100644
index 000000000..72d991c7e
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend
@@ -0,0 +1 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall
new file mode 100644
index 000000000..b442d02d5
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall
@@ -0,0 +1 @@
+# yocto-bsp-dirname {{=machine}}
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf
new file mode 100644
index 000000000..3bdde79e6
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf
@@ -0,0 +1,77 @@
+
+Section "Files"
+EndSection
+
+Section "InputDevice"
+ Identifier "Generic Keyboard"
+ Driver "evdev"
+ Option "CoreKeyboard"
+ Option "Device" "/dev/input/by-path/platform-i8042-serio-0-event-kbd"
+ Option "XkbRules" "xorg"
+ Option "XkbModel" "evdev"
+ Option "XkbLayout" "us"
+EndSection
+
+Section "InputDevice"
+ Identifier "Configured Mouse"
+{{ if qemuarch == "arm" or qemuarch == "powerpc" or qemuarch == "mips" or qemuarch == "mips64": }}
+ Driver "mouse"
+{{ if qemuarch == "i386" or qemuarch == "x86_64": }}
+ Driver "vmmouse"
+
+ Option "CorePointer"
+ Option "Device" "/dev/input/mice"
+ Option "Protocol" "ImPS/2"
+ Option "ZAxisMapping" "4 5"
+ Option "Emulate3Buttons" "true"
+EndSection
+
+Section "InputDevice"
+ Identifier "Qemu Tablet"
+ Driver "evdev"
+ Option "CorePointer"
+ Option "Device" "/dev/input/touchscreen0"
+ Option "USB" "on"
+EndSection
+
+Section "Device"
+ Identifier "Graphics Controller"
+{{ if qemuarch == "arm" or qemuarch == "powerpc" or qemuarch == "mips" or qemuarch == "mips64": }}
+ Driver "fbdev"
+{{ if qemuarch == "i386" or qemuarch == "x86_64": }}
+ Driver "vmware"
+
+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"
+ InputDevice "Generic Keyboard"
+ # InputDevice "Configured Mouse"
+ InputDevice "QEMU Tablet"
+ Option "AllowEmptyInput" "no"
+EndSection
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend
new file mode 100644
index 000000000..72d991c7e
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend
@@ -0,0 +1 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files.noinstall
new file mode 100644
index 000000000..0fb5283a8
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files.noinstall
@@ -0,0 +1 @@
+# yocto-bsp-dirname {{ if kernel_choice != "custom": }} files \ No newline at end of file
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-preempt-rt.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-preempt-rt.scc
new file mode 100644
index 000000000..a81b858c0
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-preempt-rt.scc
@@ -0,0 +1,11 @@
+# yocto-bsp-filename {{=machine}}-preempt-rt.scc
+define KMACHINE {{=machine}}
+
+define KARCH {{=qemuarch}}
+
+include {{=map_preempt_rt_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
+{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
+branch {{=machine}}
+
+include {{=machine}}.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-standard.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-standard.scc
new file mode 100644
index 000000000..14554da28
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-standard.scc
@@ -0,0 +1,20 @@
+# yocto-bsp-filename {{=machine}}-standard.scc
+define KMACHINE {{=machine}}
+
+define KARCH {{=qemuarch}}
+
+{{ if qemuarch == "i386" or qemuarch == "x86_64": }}
+include {{=map_standard_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
+{{ if qemuarch == "arm": }}
+include bsp/arm-versatile-926ejs/arm-versatile-926ejs-standard
+{{ if qemuarch == "powerpc": }}
+include bsp/qemu-ppc32/qemu-ppc32-standard
+{{ if qemuarch == "mips": }}
+include bsp/mti-malta32/mti-malta32-be-standard
+{{ if qemuarch == "mips64": }}
+include bsp/mti-malta64/mti-malta64-be-standard
+{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
+branch {{=machine}}
+
+include {{=machine}}.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-tiny.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-tiny.scc
new file mode 100644
index 000000000..41d4c6f40
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-tiny.scc
@@ -0,0 +1,11 @@
+# yocto-bsp-filename {{=machine}}-tiny.scc
+define KMACHINE {{=machine}}
+
+define KARCH {{=qemuarch}}
+
+include {{=map_tiny_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
+{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
+branch {{=machine}}
+
+include {{=machine}}.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-user-config.cfg b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-user-config.cfg
new file mode 100644
index 000000000..69efdcc75
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-user-config.cfg
@@ -0,0 +1 @@
+# yocto-bsp-filename {{=machine}}-user-config.cfg \ No newline at end of file
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-user-features.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-user-features.scc
new file mode 100644
index 000000000..582759e61
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-user-features.scc
@@ -0,0 +1 @@
+# yocto-bsp-filename {{=machine}}-user-features.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-user-patches.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-user-patches.scc
new file mode 100644
index 000000000..4c59daac4
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-user-patches.scc
@@ -0,0 +1 @@
+# yocto-bsp-filename {{=machine}}-user-patches.scc \ No newline at end of file
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine.cfg b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine.cfg
new file mode 100644
index 000000000..d560784b5
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine.cfg
@@ -0,0 +1 @@
+# yocto-bsp-filename {{=machine}}.cfg \ No newline at end of file
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine.scc
new file mode 100644
index 000000000..8301e05f7
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine.scc
@@ -0,0 +1,5 @@
+# yocto-bsp-filename {{=machine}}.scc
+kconf hardware {{=machine}}.cfg
+
+kconf hardware {{=machine}}-user-config.cfg
+include {{=machine}}-user-patches.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/kernel-list.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/kernel-list.noinstall
new file mode 100644
index 000000000..00cf36042
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/kernel-list.noinstall
@@ -0,0 +1,5 @@
+{{ if kernel_choice != "custom": }}
+{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (4.4) kernel? (y/n)" default:"y"}}
+
+{{ if kernel_choice != "custom" and use_default_kernel == "n": }}
+{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_4.4"}}
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-dev.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-dev.bbappend
new file mode 100644
index 000000000..7e3ce5ba1
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-dev.bbappend
@@ -0,0 +1,55 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-dev": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "arm": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base your new BSP branch on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "arm": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose an existing machine branch to use for this BSP:" default:"standard/arm-versatile-926ejs" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "powerpc": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "powerpc": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/qemuppc" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "i386": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "i386": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "x86_64": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "x86_64": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "mips": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "mips": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/mti-malta32" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "mips64": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "mips64": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/mti-malta64" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Would you like SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-features.scc \
+ "
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
new file mode 100644
index 000000000..14ee16f32
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
@@ -0,0 +1,62 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_4.1": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "arm": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"arm" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "arm": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"arm" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "powerpc": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "powerpc": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "i386": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "i386": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/common-pc" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "x86_64": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "x86_64": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "mips": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "mips": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "mips64": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "mips64": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-tiny.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-patches.scc \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
new file mode 100644
index 000000000..e256e08bd
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
@@ -0,0 +1,62 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_4.4": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "arm": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"arm" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "arm": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"arm" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "powerpc": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "powerpc": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "i386": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "i386": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/common-pc" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "x86_64": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "x86_64": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "mips": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "mips": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "mips64": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "mips64": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-tiny.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-patches.scc \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.4"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_4.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_4.1.bbappend
new file mode 100644
index 000000000..fce67b4aa
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_4.1.bbappend
@@ -0,0 +1,61 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_4.1": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "arm": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base your new BSP branch on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "arm": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose an existing machine branch to use for this BSP:" default:"standard/arm-versatile-926ejs" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "powerpc": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "powerpc": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/qemuppc" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "i386": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "i386": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "x86_64": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "x86_64": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "mips": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/mti-malta32" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "mips64": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/mti-malta64" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "mips": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "mips64": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Would you like SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_4.4.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_4.4.bbappend
new file mode 100644
index 000000000..409793228
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_4.4.bbappend
@@ -0,0 +1,61 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_4.4": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "arm": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base your new BSP branch on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "arm": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose an existing machine branch to use for this BSP:" default:"standard/arm-versatile-926ejs" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "powerpc": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "powerpc": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/qemuppc" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "i386": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "i386": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "x86_64": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "x86_64": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "mips": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/mti-malta32" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "mips64": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/mti-malta64" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "mips": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "mips64": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Would you like SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.4"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/.gitignore b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/.gitignore
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/.gitignore
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/conf/machine/machine.conf b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/conf/machine/machine.conf
new file mode 100644
index 000000000..e4b825104
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/conf/machine/machine.conf
@@ -0,0 +1,65 @@
+# yocto-bsp-filename {{=machine}}.conf
+#@TYPE: Machine
+#@NAME: {{=machine}}
+
+#@DESCRIPTION: Machine configuration for {{=machine}} systems
+
+{{ if kernel_choice == "custom": preferred_kernel = "linux-yocto-custom" }}
+{{ if kernel_choice == "linux-yocto-dev": preferred_kernel = "linux-yocto-dev" }}
+{{ if kernel_choice == "custom" or kernel_choice == "linux-yocto-dev" : }}
+PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}"
+
+{{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": preferred_kernel = kernel_choice.split('_')[0] }}
+{{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": preferred_kernel_version = kernel_choice.split('_')[1] }}
+{{ if kernel_choice != "custom" and kernel_choice != "linux-yocto-dev": }}
+PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}"
+PREFERRED_VERSION_{{=preferred_kernel}} ?= "{{=preferred_kernel_version}}%"
+
+{{ input type:"choicelist" name:"tunefile" prio:"40" msg:"Which machine tuning would you like to use?" default:"tune_core2" }}
+{{ input type:"choice" val:"tune_core2" msg:"Core2 tuning optimizations" }}
+{{ input type:"choice" val:"tune_corei7" msg:"Corei7 tuning optimizations" }}
+{{ if tunefile == "tune_core2": }}
+DEFAULTTUNE ?= "core2-64"
+require conf/machine/include/tune-core2.inc
+{{ if tunefile == "tune_corei7": }}
+DEFAULTTUNE ?= "corei7-64"
+require conf/machine/include/tune-corei7.inc
+
+require conf/machine/include/x86-base.inc
+
+MACHINE_FEATURES += "wifi efi pcbios"
+
+{{ input type:"boolean" name:"xserver" prio:"50" msg:"Do you need support for X? (y/n)" default:"y" }}
+
+{{ if xserver == "y": }}
+{{ input type:"choicelist" name:"xserver_choice" prio:"50" msg:"Please select an xserver for this machine:" default:"xserver_i915" }}
+
+{{ input type:"choice" val:"xserver_vesa" msg:"VESA xserver support" }}
+{{ input type:"choice" val:"xserver_i915" msg:"i915 xserver support" }}
+{{ input type:"choice" val:"xserver_i965" msg:"i965 xserver support" }}
+{{ input type:"choice" val:"xserver_fbdev" msg:"fbdev xserver support" }}
+{{ input type:"choice" val:"xserver_modesetting" msg:"modesetting xserver support" }}
+{{ if xserver == "y": }}
+XSERVER ?= "${XSERVER_X86_BASE} \
+ ${XSERVER_X86_EXT} \
+{{ if xserver == "y" and xserver_choice == "xserver_vesa": }}
+ ${XSERVER_X86_VESA} \
+{{ if xserver == "y" and xserver_choice == "xserver_i915": }}
+ ${XSERVER_X86_I915} \
+{{ if xserver == "y" and xserver_choice == "xserver_i965": }}
+ ${XSERVER_X86_I965} \
+{{ if xserver == "y" and xserver_choice == "xserver_fbdev": }}
+ ${XSERVER_X86_FBDEV} \
+{{ if xserver == "y" and xserver_choice == "xserver_modesetting": }}
+ ${XSERVER_X86_MODESETTING} \
+{{ if xserver == "y": }}
+ "
+
+MACHINE_EXTRA_RRECOMMENDS += "linux-firmware v86d eee-acpi-scripts"
+
+EXTRA_OECONF_append_pn-matchbox-panel-2 = " --with-battery=acpi"
+
+GLIBC_ADDONS = "nptl"
+
+{{ if xserver == "y" and xserver_choice == "xserver_vesa": }}
+APPEND += "video=vesafb vga=0x318"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall
new file mode 100644
index 000000000..b442d02d5
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/machine.noinstall
@@ -0,0 +1 @@
+# yocto-bsp-dirname {{=machine}}
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf
new file mode 100644
index 000000000..ac9a0f1bb
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/machine/xorg.conf
@@ -0,0 +1 @@
+# yocto-bsp-filename {{ if xserver == "y": }} this
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend
new file mode 100644
index 000000000..30830031e
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend
@@ -0,0 +1,2 @@
+# yocto-bsp-filename {{ if xserver == "y": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files.noinstall
new file mode 100644
index 000000000..1e0d92c55
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files.noinstall
@@ -0,0 +1 @@
+# yocto-bsp-dirname {{ if kernel_choice != "custom": }} files
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-preempt-rt.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-preempt-rt.scc
new file mode 100644
index 000000000..bbeeecd6b
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-preempt-rt.scc
@@ -0,0 +1,17 @@
+# yocto-bsp-filename {{=machine}}-preempt-rt.scc
+define KMACHINE {{=machine}}
+
+define KARCH x86_64
+
+include {{=map_preempt_rt_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
+{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
+branch {{=machine}}
+
+include {{=machine}}.scc
+
+# default policy for preempt-rt kernels
+include cfg/usb-mass-storage.scc
+include cfg/boot-live.scc
+include features/latencytop/latencytop.scc
+include features/profiling/profiling.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-standard.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-standard.scc
new file mode 100644
index 000000000..9c9cc9025
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-standard.scc
@@ -0,0 +1,17 @@
+# yocto-bsp-filename {{=machine}}-standard.scc
+define KMACHINE {{=machine}}
+
+define KARCH x86_64
+
+include {{=map_standard_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
+{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
+branch {{=machine}}
+
+include {{=machine}}.scc
+
+# default policy for standard kernels
+include cfg/usb-mass-storage.scc
+include cfg/boot-live.scc
+include features/latencytop/latencytop.scc
+include features/profiling/profiling.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-tiny.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-tiny.scc
new file mode 100644
index 000000000..b53706f8c
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-tiny.scc
@@ -0,0 +1,11 @@
+# yocto-bsp-filename {{=machine}}-tiny.scc
+define KMACHINE {{=machine}}
+
+define KARCH x86_64
+
+include {{=map_tiny_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
+{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
+branch {{=machine}}
+
+include {{=machine}}.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-user-config.cfg b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-user-config.cfg
new file mode 100644
index 000000000..47489e44e
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-user-config.cfg
@@ -0,0 +1 @@
+# yocto-bsp-filename {{=machine}}-user-config.cfg
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-user-features.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-user-features.scc
new file mode 100644
index 000000000..582759e61
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-user-features.scc
@@ -0,0 +1 @@
+# yocto-bsp-filename {{=machine}}-user-features.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-user-patches.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-user-patches.scc
new file mode 100644
index 000000000..97f747fa0
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-user-patches.scc
@@ -0,0 +1 @@
+# yocto-bsp-filename {{=machine}}-user-patches.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine.cfg b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine.cfg
new file mode 100644
index 000000000..3290ddefe
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine.cfg
@@ -0,0 +1,48 @@
+# yocto-bsp-filename {{=machine}}.cfg
+CONFIG_PRINTK=y
+
+# Basic hardware support for the box - network, USB, PCI, sound
+CONFIG_NETDEVICES=y
+CONFIG_ATA=y
+CONFIG_ATA_GENERIC=y
+CONFIG_ATA_SFF=y
+CONFIG_PCI=y
+CONFIG_MMC=y
+CONFIG_MMC_SDHCI=y
+CONFIG_USB_SUPPORT=y
+CONFIG_USB=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+CONFIG_R8169=y
+CONFIG_PATA_SCH=y
+CONFIG_MMC_SDHCI_PCI=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_PCIEPORTBUS=y
+CONFIG_NET=y
+CONFIG_USB_UHCI_HCD=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_CHR_DEV_SG=y
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_HDA_INTEL=y
+
+# Make sure these are on, otherwise the bootup won't be fun
+CONFIG_EXT3_FS=y
+CONFIG_UNIX=y
+CONFIG_INET=y
+CONFIG_MODULES=y
+CONFIG_SHMEM=y
+CONFIG_TMPFS=y
+CONFIG_PACKET=y
+
+CONFIG_I2C=y
+CONFIG_AGP=y
+CONFIG_PM=y
+CONFIG_ACPI=y
+CONFIG_INPUT=y
+
+# Needed for booting (and using) USB memory sticks
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_ISO8859_1=y
+
+CONFIG_RD_GZIP=y
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine.scc b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine.scc
new file mode 100644
index 000000000..9b7c291a8
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine.scc
@@ -0,0 +1,14 @@
+# yocto-bsp-filename {{=machine}}.scc
+kconf hardware {{=machine}}.cfg
+
+include features/serial/8250.scc
+{{ if xserver == "y" and xserver_choice == "xserver_vesa": }}
+include cfg/vesafb.scc
+{{ if xserver == "y" and xserver_choice == "xserver_i915" or xserver_choice == "xserver_i965": }}
+include features/i915/i915.scc
+
+include cfg/usb-mass-storage.scc
+include features/power/intel.scc
+
+kconf hardware {{=machine}}-user-config.cfg
+include {{=machine}}-user-patches.scc
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/kernel-list.noinstall b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/kernel-list.noinstall
new file mode 100644
index 000000000..00cf36042
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/kernel-list.noinstall
@@ -0,0 +1,5 @@
+{{ if kernel_choice != "custom": }}
+{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (4.4) kernel? (y/n)" default:"y"}}
+
+{{ if kernel_choice != "custom" and use_default_kernel == "n": }}
+{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_4.4"}}
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-dev.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-dev.bbappend
new file mode 100644
index 000000000..c336007eb
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-dev.bbappend
@@ -0,0 +1,25 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-dev": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Would you like SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-features.scc \
+ "
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
new file mode 100644
index 000000000..0a47a4e37
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
@@ -0,0 +1,33 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_4.1": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-tiny.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-patches.scc \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
new file mode 100644
index 000000000..815c77b81
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_4.4.bbappend
@@ -0,0 +1,33 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_4.4": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-tiny.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-patches.scc \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.4"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.1.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.1.bbappend
new file mode 100644
index 000000000..1e99a04dc
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.1.bbappend
@@ -0,0 +1,32 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_4.1": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.1"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.4.bbappend b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.4.bbappend
new file mode 100644
index 000000000..b88a06c52
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.4.bbappend
@@ -0,0 +1,32 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_4.4": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.4"
diff --git a/import-layers/yocto-poky/scripts/lib/bsp/tags.py b/import-layers/yocto-poky/scripts/lib/bsp/tags.py
new file mode 100644
index 000000000..371942788
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/bsp/tags.py
@@ -0,0 +1,49 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# 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 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 define common constants for the
+# Yocto BSP Tools.
+#
+# AUTHORS
+# Tom Zanussi <tom.zanussi (at] intel.com>
+#
+
+OPEN_TAG = "{{"
+CLOSE_TAG = "}}"
+ASSIGN_TAG = "{{="
+INPUT_TAG = "input"
+IF_TAG = "if"
+FILENAME_TAG = "yocto-bsp-filename"
+DIRNAME_TAG = "yocto-bsp-dirname"
+
+INDENT_STR = " "
+
+BLANKLINE_STR = "of.write(\"\\n\")"
+NORMAL_START = "of.write"
+OPEN_START = "current_file ="
+
+INPUT_TYPE_PROPERTY = "type"
+
+SRC_URI_FILE = "file://"
+
+GIT_CHECK_URI = "git://git.yoctoproject.org/linux-yocto-dev.git"
+
+
+
diff --git a/import-layers/yocto-poky/scripts/lib/devtool/__init__.py b/import-layers/yocto-poky/scripts/lib/devtool/__init__.py
new file mode 100644
index 000000000..ff97dfc94
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/devtool/__init__.py
@@ -0,0 +1,257 @@
+#!/usr/bin/env python
+
+# 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
+
+logger = logging.getLogger('devtool')
+
+
+class DevtoolError(Exception):
+ """Exception for handling devtool errors"""
+ pass
+
+
+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, basestring) and not "shell" in options:
+ options["shell"] = True
+
+ process = subprocess.Popen(
+ cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **options
+ )
+
+ buf = ''
+ while True:
+ out = process.stdout.read(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', True)
+ 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', True)
+ 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)
+ tinfoil.prepare(config_only)
+ tinfoil.logger.setLevel(logger.getEffectiveLevel())
+ finally:
+ os.chdir(orig_cwd)
+ return tinfoil
+
+def get_recipe_file(cooker, pn):
+ """Find recipe file corresponding a package name"""
+ import oe.recipeutils
+ recipefile = oe.recipeutils.pn_to_recipe(cooker, pn)
+ if not recipefile:
+ skipreasons = oe.recipeutils.get_unavailable_reasons(cooker, pn)
+ if skipreasons:
+ logger.error('\n'.join(skipreasons))
+ else:
+ logger.error("Unable to find any recipe file matching %s" % pn)
+ return recipefile
+
+def parse_recipe(config, tinfoil, pn, appends, filter_workspace=True):
+ """Parse recipe of a package"""
+ import oe.recipeutils
+ recipefile = get_recipe_file(tinfoil.cooker, pn)
+ if not recipefile:
+ # Error already logged
+ return None
+ if appends:
+ append_files = tinfoil.cooker.collection.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
+ return oe.recipeutils.parse_recipe(recipefile, append_files,
+ tinfoil.config_data)
+
+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.iteritems():
+ 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 d.getVar('B', True) == os.path.abspath(d.getVar('S', True)):
+ 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'):
+ """
+ Set up the git repository for the source tree
+ """
+ import bb.process
+ 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', '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)
+
+ 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
diff --git a/import-layers/yocto-poky/scripts/lib/devtool/build.py b/import-layers/yocto-poky/scripts/lib/devtool/build.py
new file mode 100644
index 000000000..48f6fe1be
--- /dev/null
+++ b/import-layers/yocto-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 = 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')
+ 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/import-layers/yocto-poky/scripts/lib/devtool/build_image.py b/import-layers/yocto-poky/scripts/lib/devtool/build_image.py
new file mode 100644
index 000000000..e51d76647
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/devtool/build_image.py
@@ -0,0 +1,154 @@
+# 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 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', True).split(':'):
+ if recipe in data.getVar('PACKAGES', True):
+ 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):
+ appendfile = os.path.join(config.workspace_path, 'appends',
+ '%s.bbappend' % image)
+
+ # remove <image>.bbappend to make sure setup_tinfoil doesn't
+ # break because of it
+ if os.path.isfile(appendfile):
+ os.unlink(appendfile)
+
+ tinfoil = setup_tinfoil(basepath=basepath)
+ 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()
+
+ 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', True)
+ else:
+ outputdir = rd.getVar('DEPLOY_DIR_IMAGE', True)
+
+ 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)
+ 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/import-layers/yocto-poky/scripts/lib/devtool/build_sdk.py b/import-layers/yocto-poky/scripts/lib/devtool/build_sdk.py
new file mode 100644
index 000000000..b89d65b0c
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/lib/devtool/deploy.py b/import-layers/yocto-poky/scripts/lib/devtool/deploy.py
new file mode 100644
index 000000000..66644ccb6
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/devtool/deploy.py
@@ -0,0 +1,304 @@
+# 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 os
+import subprocess
+import logging
+import tempfile
+import shutil
+import argparse_oe
+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 $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('freespace=`df -P $checkpath | sed "1d" | awk \'{ print $4 }\'`')
+ # 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')
+ lines.append(' find . -type f -exec mv {} /{} \;')
+ 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 re
+ import math
+ import oe.recipeutils
+
+ 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:
+ rd = oe.recipeutils.parse_recipe_simple(tinfoil.cooker, args.recipename, tinfoil.config_data)
+ except Exception as e:
+ raise DevtoolError('Exception parsing recipe %s: %s' %
+ (args.recipename, e))
+ recipe_outdir = rd.getVar('D', True)
+ 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)
+
+ 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'
+
+ # 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" % (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 \'sh %s %s %s %s\'' % (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))
+
+ 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'
+
+ 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" % (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 \'sh %s %s\'' % (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.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.set_defaults(func=undeploy)
diff --git a/import-layers/yocto-poky/scripts/lib/devtool/package.py b/import-layers/yocto-poky/scripts/lib/devtool/package.py
new file mode 100644
index 000000000..afb5809a3
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/devtool/package.py
@@ -0,0 +1,62 @@
+# 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)
+ try:
+ tinfoil.prepare(config_only=True)
+
+ image_pkgtype = config.get('Package', 'image_pkgtype', '')
+ if not image_pkgtype:
+ image_pkgtype = tinfoil.config_data.getVar('IMAGE_PKGTYPE', True)
+
+ deploy_dir_pkg = tinfoil.config_data.getVar('DEPLOY_DIR_%s' % image_pkgtype.upper(), True)
+ 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/import-layers/yocto-poky/scripts/lib/devtool/runqemu.py b/import-layers/yocto-poky/scripts/lib/devtool/runqemu.py
new file mode 100644
index 000000000..daee7fbbe
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/devtool/runqemu.py
@@ -0,0 +1,65 @@
+# 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)
+ machine = tinfoil.config_data.getVar('MACHINE', True)
+ bindir_native = tinfoil.config_data.getVar('STAGING_BINDIR_NATIVE', True)
+ 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:
+ exec_build_env_command(config.init_path, basepath, 'runqemu %s %s %s' % (machine, imagename, " ".join(args.args)), 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
+
+ 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/import-layers/yocto-poky/scripts/lib/devtool/sdk.py b/import-layers/yocto-poky/scripts/lib/devtool/sdk.py
new file mode 100644
index 000000000..46fd12bdb
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/devtool/sdk.py
@@ -0,0 +1,366 @@
+# 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):
+ # Fetch locked-sigs.inc file from remote/local destination
+ 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 ':' in updateserver:
+ is_remote = True
+ else:
+ is_remote = False
+
+ 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', True)
+ sstate_mirrors = tinfoil.config_data.getVar('SSTATE_MIRRORS', True)
+ site_conf_version = tinfoil.config_data.getVar('SITE_CONF_VERSION', True)
+ finally:
+ tinfoil.shutdown()
+
+ if not is_remote:
+ # devtool sdk-update /local/path/to/latest/sdk
+ new_locked_sig_file_path = os.path.join(updateserver, 'conf/locked-sigs.inc')
+ if not os.path.exists(new_locked_sig_file_path):
+ logger.error("%s doesn't exist or is not an extensible SDK" % updateserver)
+ return -1
+ else:
+ logger.debug("Found conf/locked-sigs.inc in %s" % updateserver)
+ update_dict = generate_update_dict(new_locked_sig_file_path, old_locked_sig_file_path)
+ logger.debug("update_dict = %s" % update_dict)
+ newsdk_path = updateserver
+ sstate_dir = os.path.join(newsdk_path, 'sstate-cache')
+ if not os.path.exists(sstate_dir):
+ logger.error("sstate-cache directory not found under %s" % newsdk_path)
+ return 1
+ sstate_objects = get_sstate_objects(update_dict, sstate_dir)
+ logger.debug("sstate_objects = %s" % sstate_objects)
+ if len(sstate_objects) == 0:
+ logger.info("No need to update.")
+ return 0
+ logger.info("Installing sstate objects into %s", basepath)
+ install_sstate_objects(sstate_objects, updateserver.rstrip('/'), basepath)
+ logger.info("Updating configuration files")
+ new_conf_dir = os.path.join(updateserver, 'conf')
+ shutil.rmtree(conf_dir)
+ shutil.copytree(new_conf_dir, conf_dir)
+ logger.info("Updating layers")
+ new_layers_dir = os.path.join(updateserver, 'layers')
+ shutil.rmtree(layers_dir)
+ ret = subprocess.call("cp -a %s %s" % (new_layers_dir, layers_dir), shell=True)
+ if ret != 0:
+ logger.error("Copying %s to %s failed" % (new_layers_dir, layers_dir))
+ return ret
+ else:
+ # devtool sdk-update http://myhost/sdk
+ 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", 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', True), 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
+
+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/import-layers/yocto-poky/scripts/lib/devtool/search.py b/import-layers/yocto-poky/scripts/lib/devtool/search.py
new file mode 100644
index 000000000..b44bed7f6
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/devtool/search.py
@@ -0,0 +1,88 @@
+# 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', True)
+ defsummary = tinfoil.config_data.getVar('SUMMARY', False) or ''
+
+ keyword_rc = re.compile(args.keyword)
+
+ 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:
+ rd = parse_recipe(config, tinfoil, fn, True)
+ summary = rd.getVar('SUMMARY', True)
+ if summary == rd.expand(defsummary):
+ summary = ''
+ print("%s %s" % (fn.ljust(20), summary))
+ 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 target recipes. Matches on recipe name, package name, description and installed files, and prints the recipe name on match.',
+ group='info')
+ parser_search.add_argument('keyword', help='Keyword to search for (regular expression syntax allowed)')
+ parser_search.set_defaults(func=search, no_workspace=True)
diff --git a/import-layers/yocto-poky/scripts/lib/devtool/standard.py b/import-layers/yocto-poky/scripts/lib/devtool/standard.py
new file mode 100644
index 000000000..77a82d559
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/devtool/standard.py
@@ -0,0 +1,1454 @@
+# Development tool - standard commands 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 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
+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, DevtoolError
+from devtool import parse_recipe
+
+logger = logging.getLogger('devtool')
+
+
+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 '://' in 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 args.srctree and '://' in 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')
+
+ if args.fetch:
+ if args.fetchuri:
+ raise DevtoolError('URI specified as positional argument as well as -f/--fetch')
+ else:
+ # FIXME should show a warning that -f/--fetch is deprecated here
+ 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)
+
+ # FIXME this ought to be in validate_pn but we're using that in other contexts
+ if '/' in args.recipename:
+ raise DevtoolError('"/" is not a valid character in recipe names')
+
+ 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
+
+ tempdir = tempfile.mkdtemp(prefix='devtool')
+ try:
+ try:
+ stdout, _ = exec_build_env_command(config.init_path, basepath, 'recipetool --color=%s create -o %s "%s" %s' % (color, tempdir, source, extracmdopts))
+ 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:\n%s' % (e.command, e.stdout))
+
+ 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))
+
+ if args.fetchuri and not args.no_git:
+ setup_git_repo(srctree, args.version, 'devtool')
+
+ 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()
+
+ tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
+ rd = oe.recipeutils.parse_recipe(recipefile, None, tinfoil.config_data)
+ if not rd:
+ return 1
+
+ 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')
+
+ _add_md5(config, recipename, appendfile)
+
+ logger.info('Recipe %s has been automatically created; further editing may be required to make it fully functional' % recipefile)
+
+ 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")
+
+ if pn in ['kernel-devsrc', 'package-index'] or pn.startswith('gcc-source'):
+ raise DevtoolError("The %s recipe is not supported by this tool" % pn)
+
+ if bb.data.inherits_class('image', d):
+ raise DevtoolError("The %s recipe is an image, and therefore is not "
+ "supported by this tool" % pn)
+
+ 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)
+
+ if bb.data.inherits_class('packagegroup', d):
+ raise DevtoolError("The %s recipe is a packagegroup, and therefore is "
+ "not supported by this tool" % pn)
+
+ 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)
+
+ if bb.data.inherits_class('externalsrc', d) and d.getVar('EXTERNALSRC', True):
+ 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 _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 _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 = {}
+ 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 = _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 = _prep_extract_operation(config, basepath, args.recipename)
+ if not tinfoil:
+ # Error already shown
+ return 1
+
+ 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, rd)
+ logger.info('Source tree extracted to %s' % srctree)
+
+ if initial_rev:
+ return 0
+ else:
+ return 1
+
+def sync(args, config, basepath, workspace):
+ """Entry point for the devtool 'sync' subcommand"""
+ import bb
+
+ tinfoil = _prep_extract_operation(config, basepath, args.recipename)
+ if not tinfoil:
+ # Error already shown
+ return 1
+
+ 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, rd)
+ logger.info('Source tree %s synchronized' % srctree)
+
+ if initial_rev:
+ return 0
+ else:
+ return 1
+
+class BbTaskExecutor(object):
+ """Class for executing bitbake tasks for a recipe
+
+ FIXME: This is very awkward. Unfortunately it's not currently easy to
+ properly execute tasks outside of bitbake itself, until then this has to
+ suffice if we are to handle e.g. linux-yocto's extra tasks
+ """
+
+ def __init__(self, rdata):
+ self.rdata = rdata
+ self.executed = []
+
+ def exec_func(self, func, report):
+ """Run bitbake task function"""
+ if not func in self.executed:
+ deps = self.rdata.getVarFlag(func, 'deps', False)
+ if deps:
+ for taskdepfunc in deps:
+ self.exec_func(taskdepfunc, True)
+ if report:
+ logger.info('Executing %s...' % func)
+ fn = self.rdata.getVar('FILE', True)
+ localdata = bb.build._task_data(fn, func, self.rdata)
+ try:
+ bb.build.exec_func(func, localdata)
+ except bb.build.FuncFailed as e:
+ raise DevtoolError(str(e))
+ self.executed.append(func)
+
+
+class PatchTaskExecutor(BbTaskExecutor):
+ def __init__(self, rdata):
+ self.check_git = False
+ super(PatchTaskExecutor, self).__init__(rdata)
+
+ def exec_func(self, func, report):
+ from oe.patch import GitApplyTree
+ srcsubdir = self.rdata.getVar('S', True)
+ haspatches = False
+ if func == 'do_patch':
+ patchdir = os.path.join(srcsubdir, 'patches')
+ if os.path.exists(patchdir):
+ if os.listdir(patchdir):
+ haspatches = True
+ else:
+ os.rmdir(patchdir)
+
+ super(PatchTaskExecutor, self).exec_func(func, report)
+ if self.check_git and os.path.exists(srcsubdir):
+ if func == 'do_patch':
+ 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:
+ bb.process.run('git add .; git commit -a -m "Committing changes from %s\n\n%s"' % (func, GitApplyTree.ignore_commit_prefix + ' - from %s' % func), cwd=srcsubdir)
+
+
+def _prep_extract_operation(config, basepath, recipename, tinfoil=None):
+ """HACK: Ugly workaround for making sure that requirements are met when
+ trying to extract a package. Returns the tinfoil instance to be used."""
+ if not tinfoil:
+ tinfoil = setup_tinfoil(basepath=basepath)
+
+ rd = parse_recipe(config, tinfoil, recipename, True)
+ if not rd:
+ return None
+
+ if bb.data.inherits_class('kernel-yocto', rd):
+ tinfoil.shutdown()
+ try:
+ stdout, _ = exec_build_env_command(config.init_path, basepath,
+ 'bitbake kern-tools-native')
+ tinfoil = setup_tinfoil(basepath=basepath)
+ except bb.process.ExecutionError as err:
+ raise DevtoolError("Failed to build kern-tools-native:\n%s" %
+ err.stdout)
+ return tinfoil
+
+
+def _extract_source(srctree, keep_temp, devbranch, sync, d):
+ """Extract sources of a recipe"""
+ import bb.event
+ import oe.recipeutils
+
+ def eventfilter(name, handler, event, d):
+ """Bitbake event filter for devtool extract operation"""
+ if name == 'base_eventhandler':
+ return True
+ else:
+ return False
+
+ if hasattr(bb.event, 'set_eventfilter'):
+ bb.event.set_eventfilter(eventfilter)
+
+ pn = d.getVar('PN', True)
+
+ _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)
+
+ if not sync:
+ # Prepare for shutil.move later on
+ bb.utils.mkdirhier(srctree)
+ os.rmdir(srctree)
+
+ # We don't want notes to be printed, they are too verbose
+ origlevel = bb.logger.getEffectiveLevel()
+ if logger.getEffectiveLevel() > logging.DEBUG:
+ bb.logger.setLevel(logging.WARNING)
+
+ initial_rev = None
+ tempdir = tempfile.mkdtemp(prefix='devtool')
+ try:
+ crd = d.createCopy()
+ # Make a subdir so we guard against WORKDIR==S
+ workdir = os.path.join(tempdir, 'workdir')
+ crd.setVar('WORKDIR', workdir)
+ crd.setVar('T', os.path.join(tempdir, 'temp'))
+ if not crd.getVar('S', True).startswith(workdir):
+ # Usually a shared workdir recipe (kernel, gcc)
+ # Try to set a reasonable default
+ if bb.data.inherits_class('kernel', d):
+ crd.setVar('S', '${WORKDIR}/source')
+ else:
+ crd.setVar('S', '${WORKDIR}/%s' % os.path.basename(d.getVar('S', True)))
+ if bb.data.inherits_class('kernel', d):
+ # We don't want to move the source to STAGING_KERNEL_DIR here
+ crd.setVar('STAGING_KERNEL_DIR', '${S}')
+
+ task_executor = PatchTaskExecutor(crd)
+
+ crd.setVar('EXTERNALSRC_forcevariable', '')
+
+ logger.info('Fetching %s...' % pn)
+ task_executor.exec_func('do_fetch', False)
+ logger.info('Unpacking...')
+ task_executor.exec_func('do_unpack', False)
+ if bb.data.inherits_class('kernel-yocto', d):
+ # Extra step for kernel to populate the source directory
+ logger.info('Doing kernel checkout...')
+ task_executor.exec_func('do_kernel_checkout', False)
+ srcsubdir = crd.getVar('S', True)
+
+ task_executor.check_git = True
+
+ # Move local source files into separate subdir
+ recipe_patches = [os.path.basename(patch) for patch in
+ oe.recipeutils.get_recipe_patches(crd)]
+ local_files = oe.recipeutils.get_recipe_local_files(crd)
+ local_files = [fname for fname in local_files if
+ os.path.exists(os.path.join(workdir, fname))]
+ 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]
+ # Force separate S so that patch files can be left out from srctree
+ srcsubdir = tempfile.mkdtemp(dir=workdir)
+ crd.setVar('S', srcsubdir)
+ # 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.path.exists(srcsubdir) or not os.listdir(srcsubdir):
+ logger.warning("no source unpacked to S, either the %s recipe "
+ "doesn't use any source or the correct source "
+ "directory could not be determined" % pn)
+
+ setup_git_repo(srcsubdir, crd.getVar('PV', True), devbranch)
+
+ (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srcsubdir)
+ initial_rev = stdout.rstrip()
+
+ crd.setVar('PATCHTOOL', 'git')
+
+ logger.info('Patching...')
+ task_executor.exec_func('do_patch', False)
+
+ bb.process.run('git tag -f devtool-patched', cwd=srcsubdir)
+
+ kconfig = None
+ if bb.data.inherits_class('kernel-yocto', d):
+ # Store generate and store kernel config
+ logger.info('Generating kernel config')
+ task_executor.exec_func('do_configure', False)
+ kconfig = os.path.join(crd.getVar('B', True), '.config')
+
+
+ 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 kconfig:
+ logger.info('Copying kernel config to srctree')
+ shutil.copy2(kconfig, srctree)
+
+ finally:
+ bb.logger.setLevel(origlevel)
+
+ if keep_temp:
+ logger.info('Preserving temporary directory %s' % tempdir)
+ else:
+ shutil.rmtree(tempdir)
+ return initial_rev
+
+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:
+ f.write('%s|%s|%s\n' % (recipename, os.path.relpath(fn, config.workspace_path), md5))
+
+ 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
+
+ if args.recipename in workspace:
+ raise DevtoolError("recipe %s is already in your workspace" %
+ args.recipename)
+
+ tinfoil = setup_tinfoil(basepath=basepath)
+ rd = parse_recipe(config, tinfoil, args.recipename, True)
+ if not rd:
+ return 1
+
+ pn = rd.getVar('PN', True)
+ 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)
+ if not args.no_extract:
+ tinfoil = _prep_extract_operation(config, basepath, pn, tinfoil)
+ if not tinfoil:
+ # Error already shown
+ return 1
+
+ recipefile = rd.getVar('FILE', True)
+ 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 = []
+ if not args.no_extract:
+ initial_rev = _extract_source(srctree, False, args.branch, False, rd)
+ 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()
+ 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 = ''
+ 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()
+
+ # Check that recipe isn't using a shared workdir
+ s = os.path.abspath(rd.getVar('S', True))
+ workdir = os.path.abspath(rd.getVar('WORKDIR', True))
+ 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(srctree, 'oe-local-files'))
+
+ 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_patch do_kernel_configme do_kernel_configcheck"\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)
+
+ _add_md5(config, pn, appendfile)
+
+ logger.info('Recipe %s now set up to build from %s' % (pn, srctree))
+
+ tinfoil.shutdown()
+
+ return 0
+
+def _get_patchset_revs(args, srctree, recipe_path):
+ """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
+
+ if args.initial_rev:
+ return args.initial_rev, args.initial_rev
+
+ # Parse initial rev from recipe
+ commits = []
+ initial_rev = None
+ with open(recipe_path, 'r') as f:
+ for line in f:
+ if line.startswith('# initial_rev:'):
+ initial_rev = line.split(':')[-1].strip()
+ elif line.startswith('# commit:'):
+ commits.append(line.split(':')[-1].strip())
+
+ 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 xrange(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:
+ 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
+
+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 xrange(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 _remove_source_files(args, files, destpath):
+ """Unlink existing patch files"""
+ for path in files:
+ if args.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):
+ logger.info('Removing file %s' % path)
+ # 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):
+ """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))
+
+ # 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)
+ found = False
+ for old_patch in existing_patches:
+ old_basename = seqpatch_re.match(old_patch).group(2)
+ if new_basename == old_basename:
+ updated[new_patch] = existing_patches.pop(old_patch)
+ found = True
+ # Rename patch files
+ if new_patch != old_patch:
+ os.rename(os.path.join(destdir, new_patch),
+ os.path.join(destdir, old_patch))
+ break
+ if not found:
+ 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, 'w') 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):
+ """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(srctree, '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 = _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(os.path.join(srctree, 'oe-local-files'))
+ bb.process.run(['cp', '-ax',
+ os.path.join(srctree, 'oe-local-files', '.'), 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:
+ updated[fname] = existing_files.pop(fname)
+ elif fname != '.gitignore':
+ added[fname] = None
+
+ removed = existing_files
+ return (updated, added, removed)
+
+
+def _update_recipe_srcrev(args, srctree, rd, config_data):
+ """Implement the 'srcrev' mode of update-recipe"""
+ import bb
+ import oe.recipeutils
+
+ recipefile = rd.getVar('FILE', True)
+ logger.info('Updating SRCREV in recipe %s' % os.path.basename(recipefile))
+
+ # 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
+ try:
+ local_files_dir = tempfile.mkdtemp(dir=tempdir)
+ upd_f, new_f, del_f = _export_local_files(srctree, rd, local_files_dir)
+ if not args.no_remove:
+ # Find list of existing patches in recipe file
+ patches_dir = tempfile.mkdtemp(dir=tempdir)
+ old_srcrev = (rd.getVar('SRCREV', False) or '')
+ upd_p, new_p, del_p = _export_patches(srctree, rd, old_srcrev,
+ patches_dir)
+
+ # Remove deleted local files and "overlapping" patches
+ remove_files = del_f.values() + upd_p.values()
+ if remove_files:
+ removedentries = _remove_file_entries(srcuri, remove_files)[0]
+ update_srcuri = True
+
+ if args.append:
+ files = dict((os.path.join(local_files_dir, key), val) for
+ key, val in upd_f.items() + new_f.items())
+ removevalues = {}
+ if update_srcuri:
+ removevalues = {'SRC_URI': removedentries}
+ patchfields['SRC_URI'] = '\\\n '.join(srcuri)
+ _, destpath = oe.recipeutils.bbappend_recipe(
+ rd, args.append, files, wildcardver=args.wildcard_version,
+ extralines=patchfields, removevalues=removevalues)
+ else:
+ files_dir = os.path.join(os.path.dirname(recipefile),
+ rd.getVar('BPN', True))
+ for basepath, path in upd_f.iteritems():
+ logger.info('Updating file %s' % basepath)
+ _move_file(os.path.join(local_files_dir, basepath), path)
+ update_srcuri= True
+ for basepath, path in new_f.iteritems():
+ logger.info('Adding new file %s' % basepath)
+ _move_file(os.path.join(local_files_dir, basepath),
+ os.path.join(files_dir, basepath))
+ srcuri.append('file://%s' % basepath)
+ update_srcuri = True
+ if update_srcuri:
+ patchfields['SRC_URI'] = ' '.join(srcuri)
+ oe.recipeutils.patch_recipe(rd, recipefile, patchfields)
+ 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(args, remove_files, destpath)
+ return True
+
+def _update_recipe_patch(args, config, workspace, srctree, rd, config_data):
+ """Implement the 'patch' mode of update-recipe"""
+ import bb
+ import oe.recipeutils
+
+ recipefile = rd.getVar('FILE', True)
+ append = workspace[args.recipename]['bbappend']
+ if not os.path.exists(append):
+ raise DevtoolError('unable to find workspace bbappend for recipe %s' %
+ args.recipename)
+
+ initial_rev, update_rev, changed_revs = _get_patchset_revs(args, srctree, append)
+ if not initial_rev:
+ raise DevtoolError('Unable to find initial revision - please specify '
+ 'it with --initial-rev')
+
+ tempdir = tempfile.mkdtemp(prefix='devtool')
+ try:
+ local_files_dir = tempfile.mkdtemp(dir=tempdir)
+ upd_f, new_f, del_f = _export_local_files(srctree, rd, local_files_dir)
+
+ remove_files = []
+ if not args.no_remove:
+ # Get all patches from source tree and check if any should be removed
+ all_patches_dir = tempfile.mkdtemp(dir=tempdir)
+ upd_p, new_p, del_p = _export_patches(srctree, rd, initial_rev,
+ all_patches_dir)
+ # Remove deleted local files and patches
+ remove_files = del_f.values() + del_p.values()
+
+ # Get updated patches from source tree
+ patches_dir = tempfile.mkdtemp(dir=tempdir)
+ upd_p, new_p, del_p = _export_patches(srctree, rd, update_rev,
+ patches_dir)
+ updatefiles = False
+ updaterecipe = False
+ destpath = None
+ srcuri = (rd.getVar('SRC_URI', False) or '').split()
+ if args.append:
+ files = dict((os.path.join(local_files_dir, key), val) for
+ key, val in upd_f.items() + new_f.items())
+ files.update(dict((os.path.join(patches_dir, key), val) for
+ key, val in upd_p.items() + 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}
+ _, destpath = oe.recipeutils.bbappend_recipe(
+ rd, args.append, files,
+ removevalues=removevalues)
+ else:
+ logger.info('No patches or local source files needed updating')
+ else:
+ # Update existing files
+ for basepath, path in upd_f.iteritems():
+ logger.info('Updating file %s' % basepath)
+ _move_file(os.path.join(local_files_dir, basepath), path)
+ updatefiles = True
+ for basepath, path in upd_p.iteritems():
+ patchfn = os.path.join(patches_dir, basepath)
+ if changed_revs is not None:
+ # Avoid updating patches that have not actually changed
+ with open(patchfn, 'r') as f:
+ firstlineitems = f.readline().split()
+ if len(firstlineitems) > 1 and len(firstlineitems[1]) == 40:
+ if not firstlineitems[1] in changed_revs:
+ continue
+ logger.info('Updating patch %s' % basepath)
+ _move_file(patchfn, path)
+ updatefiles = True
+ # Add any new files
+ files_dir = os.path.join(os.path.dirname(recipefile),
+ rd.getVar('BPN', True))
+ for basepath, path in new_f.iteritems():
+ logger.info('Adding new file %s' % basepath)
+ _move_file(os.path.join(local_files_dir, basepath),
+ os.path.join(files_dir, basepath))
+ srcuri.append('file://%s' % basepath)
+ updaterecipe = True
+ for basepath, path in new_p.iteritems():
+ logger.info('Adding new patch %s' % basepath)
+ _move_file(os.path.join(patches_dir, basepath),
+ os.path.join(files_dir, basepath))
+ srcuri.append('file://%s' % basepath)
+ updaterecipe = True
+ # Update recipe, if needed
+ if _remove_file_entries(srcuri, remove_files)[0]:
+ updaterecipe = True
+ if updaterecipe:
+ logger.info('Updating recipe %s' % os.path.basename(recipefile))
+ oe.recipeutils.patch_recipe(rd, recipefile,
+ {'SRC_URI': ' '.join(srcuri)})
+ elif not updatefiles:
+ # Neither patches nor recipe were updated
+ logger.info('No patches or files need updating')
+ return False
+ finally:
+ shutil.rmtree(tempdir)
+
+ _remove_source_files(args, remove_files, destpath)
+ return True
+
+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(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)
+
+ rd = parse_recipe(config, tinfoil, args.recipename, True)
+ if not rd:
+ return 1
+
+ srctree = workspace[args.recipename]['srctree']
+ if args.mode == 'auto':
+ mode = _guess_recipe_update_mode(srctree, rd)
+ else:
+ mode = args.mode
+
+ if mode == 'srcrev':
+ updated = _update_recipe_srcrev(args, srctree, rd, tinfoil.config_data)
+ elif mode == 'patch':
+ updated = _update_recipe_patch(args, config, workspace, srctree, rd, tinfoil.config_data)
+ else:
+ raise DevtoolError('update_recipe: invalid mode %s' % mode)
+
+ if updated:
+ rf = rd.getVar('FILE', True)
+ 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)
+
+ return 0
+
+
+def status(args, config, basepath, workspace):
+ """Entry point for the devtool 'status' subcommand"""
+ if workspace:
+ for recipe, value in workspace.iteritems():
+ 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(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:
+ check_workspace_recipe(workspace, args.recipename, checksrc=False)
+ elif not args.all:
+ raise DevtoolError("Recipe must be specified, or specify -a/--all to "
+ "reset all recipes")
+ if args.all:
+ recipes = workspace.keys()
+ else:
+ recipes = [args.recipename]
+
+ if recipes and not args.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:
+ 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)
+
+ 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)
+
+ preservedir(os.path.join(config.workspace_path, 'recipes', pn))
+ # We don't automatically create this dir next to appends, but the user can
+ preservedir(os.path.join(config.workspace_path, 'appends', pn))
+
+ srctree = workspace[pn]['srctree']
+ if os.path.isdir(srctree):
+ if os.listdir(srctree):
+ # 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'
+ % srctree)
+ else:
+ # This is unlikely, but if it's empty we can just remove it
+ os.rmdir(srctree)
+
+ 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('--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")
+ 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.set_defaults(func=add)
+
+ 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.set_defaults(func=modify)
+
+ 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('--keep-temp', action="store_true", help='Keep temporary directory (for debugging)')
+ parser_extract.set_defaults(func=extract, no_workspace=True)
+
+ 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)
+
+ 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.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 from your workspace (resetting its state)',
+ 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)
diff --git a/import-layers/yocto-poky/scripts/lib/devtool/upgrade.py b/import-layers/yocto-poky/scripts/lib/devtool/upgrade.py
new file mode 100644
index 000000000..a085f78c4
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/devtool/upgrade.py
@@ -0,0 +1,382 @@
+# Development tool - upgrade 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 upgrade plugin"""
+
+import os
+import sys
+import re
+import shutil
+import tempfile
+import logging
+import argparse
+import scriptutils
+import errno
+import bb
+import oe.recipeutils
+from devtool import standard
+from devtool import exec_build_env_command, setup_tinfoil, DevtoolError, parse_recipe, use_external_build
+
+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 _get_checksums(rf):
+ import re
+ checksums = {}
+ with open(rf) as f:
+ for line in f:
+ for cs in ['md5sum', 'sha256sum']:
+ m = re.match("^SRC_URI\[%s\].*=.*\"(.*)\"" % cs, line)
+ if m:
+ checksums[cs] = m.group(1)
+ return checksums
+
+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', True)
+ varfiles = oe.recipeutils.get_var_files(rf, [var], rd)
+ for var, fn in varfiles.iteritems():
+ 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):
+ 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))
+
+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, 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',True)
+ 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))
+ if rev:
+ f.write('\n# initial_rev: %s\n' % rev)
+ 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', True).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, 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', True)
+ 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
+ else:
+ __run('git checkout devtool-base -b devtool-%s' % newpv)
+
+ tmpdir = tempfile.mkdtemp(prefix='devtool')
+ try:
+ md5, sha256 = scriptutils.fetch_uri(tinfoil.config_data, uri, tmpdir, rev)
+ except bb.fetch2.FetchError as e:
+ raise DevtoolError(e)
+
+ tmpsrctree = _get_srctree(tmpdir)
+ srctree = os.path.abspath(srctree)
+
+ # 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')
+ for f in stdout.splitlines():
+ __run('git add "%s"' % f)
+
+ __run('git commit -q -m "Commit of upstream changes at version %s" --allow-empty' % 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 len(patches):
+ logger.warn('By user choice, the following patches will NOT be applied')
+ for patch in patches:
+ logger.warn("%s" % os.path.basename(patch))
+ else:
+ try:
+ __run('git checkout devtool-patched -b %s' % branch)
+ __run('git rebase %s' % rev)
+ if uri.startswith('git://'):
+ suffix = 'new'
+ else:
+ suffix = newpv
+ __run('git tag -f devtool-patched-%s' % suffix)
+ except bb.process.ExecutionError as e:
+ logger.warn('Command \'%s\' failed:\n%s' % (e.command, e.stdout))
+
+ if tmpsrctree:
+ if keep_temp:
+ logger.info('Preserving temporary directory %s' % tmpsrctree)
+ else:
+ shutil.rmtree(tmpsrctree)
+
+ return (rev, md5, sha256)
+
+def _create_new_recipe(newpv, md5, sha256, srcrev, srcbranch, workspace, tinfoil, rd):
+ """Creates the new recipe under workspace"""
+
+ bpn = rd.getVar('BPN', True)
+ path = os.path.join(workspace, 'recipes', bpn)
+ bb.utils.mkdirhier(path)
+ oe.recipeutils.copy_recipe_files(rd, path)
+
+ oldpv = rd.getVar('PV', True)
+ if not newpv:
+ newpv = oldpv
+ origpath = rd.getVar('FILE', True)
+ 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
+
+ if md5 and sha256:
+ newvalues['SRC_URI[md5sum]'] = md5
+ newvalues['SRC_URI[sha256sum]'] = sha256
+
+ rd = oe.recipeutils.parse_recipe(fullpath, None, tinfoil.config_data)
+ oe.recipeutils.patch_recipe(rd, fullpath, newvalues)
+
+ return fullpath
+
+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 not args.version and not args.srcrev:
+ raise DevtoolError("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")
+ 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)
+
+ tinfoil = setup_tinfoil(basepath=basepath, tracking=True)
+ rd = parse_recipe(config, tinfoil, args.recipename, True)
+ if not rd:
+ return 1
+
+ pn = rd.getVar('PN', True)
+ 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)
+
+ standard._check_compatible_recipe(pn, rd)
+ old_srcrev = rd.getVar('SRCREV', True)
+ 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")
+ if rd.getVar('PV', True) == args.version and old_srcrev == args.srcrev:
+ raise DevtoolError("Current and upgrade versions are the same version")
+
+ rf = None
+ try:
+ rev1 = standard._extract_source(srctree, False, 'devtool-orig', False, rd)
+ rev2, md5, sha256 = _extract_new_source(args.version, srctree, args.no_patch,
+ args.srcrev, args.branch, args.keep_temp,
+ tinfoil, rd)
+ rf = _create_new_recipe(args.version, md5, sha256, args.srcrev, args.srcbranch, config.workspace_path, tinfoil, rd)
+ 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,
+ config.workspace_path, rd)
+ standard._add_md5(config, pn, af)
+ logger.info('Upgraded source extracted to %s' % srctree)
+ logger.info('New recipe is %s' % rf)
+ 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)')
+ parser_upgrade.add_argument('--srcrev', '-S', help='Source revision to upgrade to (if 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')
+ 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)
diff --git a/import-layers/yocto-poky/scripts/lib/devtool/utilcmds.py b/import-layers/yocto-poky/scripts/lib/devtool/utilcmds.py
new file mode 100644
index 000000000..b761a80f8
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/devtool/utilcmds.py
@@ -0,0 +1,233 @@
+# 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 edit_recipe(args, config, basepath, workspace):
+ """Entry point for the devtool 'edit-recipe' subcommand"""
+ if args.any_recipe:
+ tinfoil = setup_tinfoil(config_only=False, basepath=basepath)
+ try:
+ rd = parse_recipe(config, tinfoil, args.recipename, True)
+ if not rd:
+ return 1
+ recipefile = rd.getVar('FILE', True)
+ finally:
+ tinfoil.shutdown()
+ else:
+ check_workspace_recipe(workspace, args.recipename)
+ recipefile = workspace[args.recipename]['recipefile']
+ if not recipefile:
+ raise DevtoolError("Recipe file for %s is not under the workspace" %
+ args.recipename)
+
+ return scriptutils.run_editor(recipefile)
+
+
+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', True)
+ s = rd.getVar('S', True)
+ 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', True) or '')
+ extra_oeconf = oe.utils.squashspaces(rd.getVar('EXTRA_OECONF', True) or '')
+ extra_oecmake = oe.utils.squashspaces(rd.getVar('EXTRA_OECMAKE', True) or '')
+ do_configure = rd.getVar('do_configure', True) 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', True)
+ pn = rd.getVar('PN', True)
+ 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 in your workspace',
+ description='Runs the default editor (as specified by the EDITOR variable) on the specified recipe. Note that the recipe file itself must be in the workspace (i.e. as a result of "devtool add" or "devtool upgrade"); you can override this with the -a/--any-recipe option.',
+ group='working')
+ parser_edit_recipe.add_argument('recipename', help='Recipe to edit')
+ parser_edit_recipe.add_argument('--any-recipe', '-a', action="store_true", help='Edit any recipe, not just where the recipe file itself is in the workspace')
+ parser_edit_recipe.set_defaults(func=edit_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/import-layers/yocto-poky/scripts/lib/recipetool/__init__.py b/import-layers/yocto-poky/scripts/lib/recipetool/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/recipetool/__init__.py
diff --git a/import-layers/yocto-poky/scripts/lib/recipetool/append.py b/import-layers/yocto-poky/scripts/lib/recipetool/append.py
new file mode 100644
index 000000000..558fd25ac
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/recipetool/append.py
@@ -0,0 +1,471 @@
+# 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', True)
+
+ # 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.iteritems():
+ 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().decode('string_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 _get_recipe_file(cooker, pn):
+ import oe.recipeutils
+ recipefile = oe.recipeutils.pn_to_recipe(cooker, pn)
+ if not recipefile:
+ skipreasons = oe.recipeutils.get_unavailable_reasons(cooker, pn)
+ if skipreasons:
+ logger.error('\n'.join(skipreasons))
+ else:
+ logger.error("Unable to find any recipe file matching %s" % pn)
+ return recipefile
+
+def _parse_recipe(pn, tinfoil):
+ import oe.recipeutils
+ recipefile = _get_recipe_file(tinfoil.cooker, pn)
+ if not recipefile:
+ # Error already logged
+ return None
+ append_files = tinfoil.cooker.collection.get_file_appends(recipefile)
+ rd = oe.recipeutils.parse_recipe(recipefile, append_files,
+ tinfoil.config_data)
+ 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', True)
+ src_uri = rd.getVar('SRC_URI', True)
+ 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', True).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.iteritems():
+ 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)
+ 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, True))
+ deps |= set((d.getVarFlag(func, "vardeps", True) or "").split())
+ funcdeps = []
+ for dep in deps:
+ if d.getVarFlag(dep, 'func', True):
+ 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', True), targetpath.lstrip('/')))
+ do_install = rd.getVar('do_install', True)
+ # 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, True))
+
+ # 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.iteritems():
+ 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', True)
+ workdir = rd.getVar('WORKDIR', True)
+
+ import bb.fetch
+ simplified = {}
+ src_uri = rd.getVar('SRC_URI', True).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.iteritems():
+ src_destdir = os.path.dirname(srcfile)
+ if not args.use_workdir:
+ if rd.getVar('S', True) == rd.getVar('STAGING_KERNEL_DIR', True):
+ 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/import-layers/yocto-poky/scripts/lib/recipetool/create.py b/import-layers/yocto-poky/scripts/lib/recipetool/create.py
new file mode 100644
index 000000000..bb9fb9b04
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/recipetool/create.py
@@ -0,0 +1,963 @@
+# Recipe creation tool - create 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.
+
+import sys
+import os
+import argparse
+import glob
+import fnmatch
+import re
+import json
+import logging
+import scriptutils
+import urlparse
+import hashlib
+
+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 RecipeHandler(object):
+ recipelibmap = {}
+ recipeheadermap = {}
+ recipecmakefilemap = {}
+ recipebinmap = {}
+
+ @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', True)
+ base_libdir = d.getVar('base_libdir', True)
+ libpaths = list(set([base_libdir, libdir]))
+ libname_re = re.compile('^lib(.+)\.so.*$')
+ pkglibmap = {}
+ for lib, item in shlib_providers.iteritems():
+ for path, pkg in item.iteritems():
+ 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', True)
+ for libname, pkg in pkglibmap.iteritems():
+ 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', True)
+ includedir = d.getVar('includedir', True)
+ cmakedir = os.path.join(d.getVar('libdir', True), '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', True)
+ staging_bindir_native = d.getVar('STAGING_BINDIR_NATIVE', True)
+ build_arch = d.getVar('BUILD_ARCH', True)
+ 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):
+ results = []
+ if recursive:
+ for root, _, files in os.walk(path):
+ 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, basestring):
+ 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)
+
+ def genfunction(self, 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"""
+ part = ''
+ if '.tar.' in srcfile:
+ namepart = srcfile.split('.tar.')[0].lower()
+ else:
+ namepart = os.path.splitext(srcfile)[0].lower()
+ splitval = namepart.rsplit('_', 1)
+ if len(splitval) == 1:
+ splitval = namepart.rsplit('-', 1)
+ pn = splitval[0].replace('_', '-')
+ if len(splitval) > 1:
+ if splitval[1][0] in '0123456789':
+ pv = splitval[1]
+ else:
+ pn = '-'.join(splitval).replace('_', '-')
+ pv = None
+ else:
+ pv = None
+ return (pn, pv)
+
+def determine_from_url(srcuri):
+ """Determine name and version from a URL"""
+ pn = None
+ pv = None
+ parseres = urlparse.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:
+ srcfile = os.path.basename(parseres.path.rstrip('/'))
+ pn, pv = determine_from_filename(srcfile)
+
+ 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}')
+ bb.data.update_data(localdata)
+ fetcher = bb.fetch2.Fetch([uri], localdata)
+ urldata = fetcher.ud
+ for u in urldata:
+ if urldata[u].method.supports_srcrev():
+ 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:
+ res = re.match('(https?)://([^;]+(\.git)?)(;.*)?$', uri)
+ if res:
+ # Need to switch the URI around so that the git fetcher is used
+ return 'git://%s;protocol=%s%s' % (res.group(2), res.group(1), res.group(4) or '')
+ return uri
+
+def create_recipe(args):
+ import bb.process
+ import tempfile
+ import shutil
+
+ pkgarch = ""
+ if args.machine:
+ pkgarch = "${MACHINE_ARCH}"
+
+ checksums = (None, None)
+ tempsrc = ''
+ srcsubdir = ''
+ srcrev = '${AUTOREV}'
+ if '://' in args.source:
+ # Fetch a URL
+ fetchuri = reformat_git_uri(urlparse.urldefrag(args.source)[0])
+ if args.binary:
+ # Assume the archive contains the directory structure verbatim
+ # so we need to extract to a subdirectory
+ fetchuri += ';subdir=%s' % os.path.splitext(os.path.basename(urlparse.urlsplit(fetchuri).path))[0]
+ srcuri = fetchuri
+ rev_re = re.compile(';rev=([^;]+)')
+ res = rev_re.search(srcuri)
+ if res:
+ srcrev = res.group(1)
+ srcuri = rev_re.sub('', srcuri)
+ tempsrc = tempfile.mkdtemp(prefix='recipetool-')
+ srctree = tempsrc
+ if fetchuri.startswith('npm://'):
+ # Check if npm is available
+ npm = bb.utils.which(tinfoil.config_data.getVar('PATH', True), 'npm')
+ if not npm:
+ logger.error('npm:// URL requested but npm is not available - you need to either build nodejs-native or install npm using your package manager')
+ sys.exit(1)
+ logger.info('Fetching %s...' % srcuri)
+ try:
+ checksums = scriptutils.fetch_uri(tinfoil.config_data, fetchuri, srctree, srcrev)
+ except bb.fetch2.BBFetchException as e:
+ logger.error(str(e).rstrip())
+ sys.exit(1)
+ dirlist = os.listdir(srctree)
+ if 'git.indirectionsymlink' in dirlist:
+ dirlist.remove('git.indirectionsymlink')
+ 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:
+ with open(singleitem, 'r') 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)
+ 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(args.source):
+ logger.error('Invalid source directory %s' % args.source)
+ sys.exit(1)
+ srctree = args.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 '://' in 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.join(srctree, args.src_subdir)
+ else:
+ srctree_use = 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.)')
+ lines_before.append('#')
+
+ licvalues = guess_license(srctree_use)
+ lic_files_chksum = []
+ if licvalues:
+ licenses = []
+ 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]))
+ lines_before.append('# WARNING: the following LICENSE and LIC_FILES_CHKSUM values are best guesses - it is')
+ lines_before.append('# your responsibility to verify that the values are complete and correct.')
+ if len(licvalues) > 1:
+ lines_before.append('#')
+ lines_before.append('# NOTE: multiple licenses have been detected; if that is correct you should separate')
+ lines_before.append('# these in the LICENSE value using & if the multiple licenses all apply, or | if there')
+ lines_before.append('# is a choice between the multiple licenses. If in doubt, check the accompanying')
+ lines_before.append('# documentation to determine which situation is applicable.')
+ else:
+ lines_before.append('# Unable to find any files that looked like license statements. Check the accompanying')
+ lines_before.append('# documentation and source headers and set LICENSE and LIC_FILES_CHKSUM accordingly.')
+ lines_before.append('#')
+ lines_before.append('# NOTE: LICENSE is being set to "CLOSED" to allow you to at least start building - if')
+ lines_before.append('# this is not accurate with respect to the licensing of the software being built (it')
+ lines_before.append('# will not be in most cases) you must specify the correct value before using this')
+ lines_before.append('# recipe for anything other than initial testing/development!')
+ licenses = ['CLOSED']
+ lines_before.append('LICENSE = "%s"' % ' '.join(licenses))
+ lines_before.append('LIC_FILES_CHKSUM = "%s"' % ' \\\n '.join(lic_files_chksum))
+ lines_before.append('')
+
+ 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 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
+
+
+ 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)
+ (md5value, sha256value) = checksums
+ if md5value:
+ lines_before.append('SRC_URI[md5sum] = "%s"' % md5value)
+ if sha256value:
+ lines_before.append('SRC_URI[sha256sum] = "%s"' % sha256value)
+ if srcuri and supports_srcrev(srcuri):
+ lines_before.append('')
+ lines_before.append('# Modify these as desired')
+ lines_before.append('PV = "%s+git${SRCPV}"' % (realpv or '1.0'))
+ lines_before.append('SRCREV = "%s"' % srcrev)
+ lines_before.append('')
+
+ if srcsubdir:
+ 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('')
+
+ # 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))
+ handlers = [item[0] for item in handlers]
+
+ # Apply the handlers
+ handled = []
+ handled.append(('license', licvalues))
+
+ if args.binary:
+ classes.append('bin_package')
+ handled.append('buildsystem')
+
+ extravalues = {}
+ for handler in handlers:
+ handler.process(srctree_use, classes, lines_before, lines_after, handled, extravalues)
+
+ extrafiles = extravalues.pop('extrafiles', {})
+
+ if not realpv:
+ realpv = extravalues.get('PV', None)
+ if realpv:
+ if not validate_pv(realpv):
+ realpv = None
+ else:
+ realpv = realpv.lower().split()[0]
+ if '_' in realpv:
+ realpv = realpv.replace('_', '-')
+ if not pn:
+ pn = extravalues.get('PN', None)
+ if 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 not outfile:
+ if not pn:
+ logger.error('Unable to determine short program name from source tree - please specify name with -N/--name or output file name with -o/--outfile')
+ # devtool looks for this specific exit code, so don't change it
+ sys.exit(15)
+ else:
+ if srcuri and srcuri.startswith(('git://', 'hg://', 'svn://')):
+ outfile = '%s_%s.bb' % (pn, srcuri.split(':', 1)[0])
+ 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.iteritems():
+ 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:
+ line = line.replace(realpv, '${PV}')
+ elif line.startswith('PV = '):
+ if realpv:
+ 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"')
+
+ 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 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
+ logger.info('Source extracted to %s' % args.extract_to)
+
+ if outfile == '-':
+ sys.stdout.write('\n'.join(outlines) + '\n')
+ else:
+ with open(outfile, 'w') as f:
+ f.write('\n'.join(outlines) + '\n')
+ logger.info('Recipe %s has been created; further editing may be required to make it fully functional' % outfile)
+
+ if tempsrc:
+ shutil.rmtree(tempsrc)
+
+ return 0
+
+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', True)
+ 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 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'
+ lictext = []
+ with open(licfile, 'r') 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()).decode("utf-8")
+ 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))
+ md5val = m.hexdigest()
+ except UnicodeEncodeError:
+ md5val = None
+ lictext = ''
+ license = crunched_md5sums.get(md5val, None)
+ return license, md5val, lictext
+
+def guess_license(srctree):
+ import bb
+ md5sums = get_license_md5sums(tinfoil.config_data)
+
+ licenses = []
+ licspecs = ['*LICEN[CS]E*', 'COPYING*', '*[Ll]icense*', 'LEGAL*', '[Ll]egal*', '*GPL*', 'README.lic*', 'COPYRIGHT*', '[Cc]opyright*']
+ 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.iteritems():
+ 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']))))
+ 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', True)
+ 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.iteritems():
+ 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_pkginfo(pkginfofile):
+ values = {}
+ with open(pkginfofile, 'r') as f:
+ indesc = False
+ for line in f:
+ if indesc:
+ if line.strip():
+ values['DESCRIPTION'] += ' ' + line.strip()
+ else:
+ indesc = False
+ else:
+ splitline = line.split(': ', 1)
+ key = line[0]
+ value = line[1]
+ if key == 'LICENSE':
+ for dep in value.split(','):
+ dep = dep.split()[0]
+ mapped = depmap.get(dep, '')
+ if mapped:
+ depends.append(mapped)
+ elif key == 'License':
+ values['LICENSE'] = value
+ elif key == 'Summary':
+ values['SUMMARY'] = value
+ elif key == 'Description':
+ values['DESCRIPTION'] = value
+ indesc = True
+ return values
+
+def convert_debian(debpath):
+ # FIXME extend this mapping - perhaps use distro_alias.inc?
+ depmap = {'libz-dev': 'zlib'}
+
+ values = {}
+ depends = []
+ with open(os.path.join(debpath, 'control')) as f:
+ indesc = False
+ for line in f:
+ if indesc:
+ if line.strip():
+ if line.startswith(' This package contains'):
+ indesc = False
+ else:
+ values['DESCRIPTION'] += ' ' + line.strip()
+ else:
+ indesc = False
+ else:
+ splitline = line.split(':', 1)
+ key = line[0]
+ value = line[1]
+ if key == 'Build-Depends':
+ for dep in value.split(','):
+ dep = dep.split()[0]
+ mapped = depmap.get(dep, '')
+ if mapped:
+ depends.append(mapped)
+ elif key == 'Section':
+ values['SECTION'] = value
+ elif key == 'Description':
+ values['SUMMARY'] = value
+ indesc = True
+
+ if depends:
+ values['DEPENDS'] = ' '.join(depends)
+
+ 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('-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')
+ parser_create.set_defaults(func=create_recipe)
+
diff --git a/import-layers/yocto-poky/scripts/lib/recipetool/create_buildsys.py b/import-layers/yocto-poky/scripts/lib/recipetool/create_buildsys.py
new file mode 100644
index 000000000..f84ec3dc6
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/recipetool/create_buildsys.py
@@ -0,0 +1,859 @@
+# 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.iteritems():
+ 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.iteritems():
+ 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') 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.iteritems():
+ 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') 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') 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*([^,]+)\)')
+
+ defines = {}
+ def subst_defines(value):
+ newvalue = value
+ for define, defval in defines.iteritems():
+ 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
+ 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 == 'AX_PKG_SWIG':
+ deps.append('swig')
+ elif keyword == 'AX_PROG_XSLTPROC':
+ deps.append('libxslt-native')
+ 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',
+ 'AX_PROG_XSLTPROC',
+ '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') 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 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'])
+ 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.iteritems():
+ 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') 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') 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)
+ pn = None
+ pv = None
+ for fileitem in filelist:
+ linecount = 0
+ with open(fileitem, 'r') as f:
+ for line in f:
+ if line.startswith('Name:') and not pn:
+ pn = line.split(':')[1].strip()
+ if line.startswith('Version:') and not pv:
+ pv = line.split(':')[1].strip()
+ if pv or pn:
+ if pv and not 'PV' in extravalues and validate_pv(pv):
+ extravalues['PV'] = pv
+ if pn and not 'PN' in extravalues:
+ extravalues['PN'] = pn
+ break
+
+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/import-layers/yocto-poky/scripts/lib/recipetool/create_buildsys_python.py b/import-layers/yocto-poky/scripts/lib/recipetool/create_buildsys_python.py
new file mode 100644
index 000000000..c3823307a
--- /dev/null
+++ b/import-layers/yocto-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 = [
+ 'Name',
+ 'Version',
+ '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$', ''),
+ ('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)
+
+ self.apply_info_replacements(info)
+
+ if uses_setuptools:
+ classes.append('setuptools')
+ else:
+ classes.append('distutils')
+
+ if 'Classifier' in info:
+ licenses = []
+ for classifier in info['Classifier']:
+ if classifier in self.classifier_license_map:
+ license = self.classifier_license_map[classifier]
+ licenses.append(license)
+
+ if licenses:
+ info['License'] = ' & '.join(licenses)
+
+
+ # Map PKG-INFO & setup.py fields to bitbake variables
+ bbinfo = {}
+ for field, values in info.iteritems():
+ if field in self.excluded_fields:
+ continue
+
+ if field not in self.bbvar_map:
+ continue
+
+ if isinstance(values, basestring):
+ value = values
+ else:
+ value = ' '.join(str(v) for v in values if v)
+
+ bbvar = self.bbvar_map[field]
+ if bbvar not in bbinfo and value:
+ bbinfo[bbvar] = value
+
+ comment_lic_line = None
+ for pos, line in enumerate(list(lines_before)):
+ if line.startswith('#') and 'LICENSE' in line:
+ comment_lic_line = pos
+ elif line.startswith('LICENSE =') and 'LICENSE' in bbinfo:
+ if line in ('LICENSE = "Unknown"', 'LICENSE = "CLOSED"'):
+ lines_before[pos] = 'LICENSE = "{}"'.format(bbinfo['LICENSE'])
+ if line == 'LICENSE = "CLOSED"' and comment_lic_line:
+ lines_before[comment_lic_line:pos] = [
+ '# WARNING: the following LICENSE value is a best guess - it is your',
+ '# responsibility to verify that the value is complete and correct.'
+ ]
+ del bbinfo['LICENSE']
+
+ src_uri_line = None
+ for pos, line in enumerate(lines_before):
+ if line.startswith('SRC_URI ='):
+ src_uri_line = pos
+
+ if bbinfo:
+ mdinfo = ['']
+ for k in sorted(bbinfo):
+ v = bbinfo[k]
+ mdinfo.append('{} = "{}"'.format(k, v))
+ if src_uri_line:
+ lines_before[src_uri_line-1:src_uri_line-1] = mdinfo
+ else:
+ lines_before.extend(mdinfo)
+
+ 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.iterkeys())))
+ for feature, feature_reqs in extras_req.iteritems():
+ 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 d.items():
+ 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, basestring):
+ 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, 'iteritems'):
+ for dkey, dvalue in value.iteritems():
+ 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:
+ mapped_deps.add(mapped)
+ else:
+ 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', True)
+
+ ldata = tinfoil.config_data.createCopy()
+ bb.parse.handle('classes/python-dir.bbclass', ldata, True)
+ python_sitedir = ldata.getVar('PYTHON_SITEPACKAGES_DIR', True)
+
+ 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.iterkeys():
+ for suffix in suffixes:
+ if fn.endswith(suffix):
+ break
+ else:
+ continue
+
+ if fn.startswith(dynload_dir + os.sep):
+ 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)
+ 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 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.iteritems():
+ 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, basestring):
+ return False
+ elif hasattr(value, 'itervalues'):
+ return any(has_non_literals(v) for v in value.itervalues())
+ 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/import-layers/yocto-poky/scripts/lib/recipetool/create_kernel.py b/import-layers/yocto-poky/scripts/lib/recipetool/create_kernel.py
new file mode 100644
index 000000000..c6e86bd2b
--- /dev/null
+++ b/import-layers/yocto-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', True), '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') 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', True)
+ 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/import-layers/yocto-poky/scripts/lib/recipetool/create_kmod.py b/import-layers/yocto-poky/scripts/lib/recipetool/create_kmod.py
new file mode 100644
index 000000000..fe39edb28
--- /dev/null
+++ b/import-layers/yocto-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)
+ 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') 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') 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/import-layers/yocto-poky/scripts/lib/recipetool/create_npm.py b/import-layers/yocto-poky/scripts/lib/recipetool/create_npm.py
new file mode 100644
index 000000000..b3ffcdbc5
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/recipetool/create_npm.py
@@ -0,0 +1,156 @@
+# 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
+
+logger = logging.getLogger('recipetool')
+
+
+tinfoil = None
+
+def tinfoil_init(instance):
+ global tinfoil
+ tinfoil = instance
+
+
+class NpmRecipeHandler(RecipeHandler):
+ lockdownpath = None
+
+ 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)
+ return None
+
+ def _shrinkwrap(self, srctree, localfilesdir, extravalues, lines_before):
+ try:
+ runenv = dict(os.environ, PATH=tinfoil.config_data.getVar('PATH', True))
+ 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):
+ runenv = dict(os.environ, PATH=tinfoil.config_data.getVar('PATH', True))
+ 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 process(self, srctree, classes, lines_before, lines_after, handled, extravalues):
+ import bb.utils
+ import oe
+ from collections import OrderedDict
+
+ if 'buildsystem' in handled:
+ return False
+
+ def read_package_json(fn):
+ with open(fn, 'r') as f:
+ return json.loads(f.read())
+
+ files = RecipeHandler.checkfiles(srctree, ['package.json'])
+ if files:
+ 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:
+ lines_before.append('SUMMARY = "%s"' % data['description'])
+ if 'homepage' in data:
+ lines_before.append('HOMEPAGE = "%s"' % data['homepage'])
+
+ # Shrinkwrap
+ localfilesdir = tempfile.mkdtemp(prefix='recipetool-npm')
+ self._shrinkwrap(srctree, localfilesdir, extravalues, lines_before)
+
+ # Lockdown
+ self._lockdown(srctree, localfilesdir, extravalues, lines_before)
+
+ # Split each npm module out to is own package
+ npmpackages = oe.package.npm_split_package_dirs(srctree)
+ for item in handled:
+ if isinstance(item, tuple):
+ if item[0] == 'license':
+ licvalues = item[1]
+ break
+ 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.iteritems():
+ _, 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.iteritems())
+ packages['${PN}'] = ''
+ pkglicenses = split_pkg_licenses(licvalues, packages, lines_after, licenses)
+ all_licenses = list(set([item for pkglicense in pkglicenses.values() for item in pkglicense]))
+ # Go back and update the LICENSE value since we have a bit more
+ # information than when that was written out (and we know all apply
+ # vs. there being a choice, so we can join them with &)
+ for i, line in enumerate(lines_before):
+ if line.startswith('LICENSE = '):
+ lines_before[i] = 'LICENSE = "%s"' % ' & '.join(all_licenses)
+ break
+
+ return True
+
+ return False
+
+def register_recipe_handlers(handlers):
+ handlers.append((NpmRecipeHandler(), 60))
diff --git a/import-layers/yocto-poky/scripts/lib/recipetool/newappend.py b/import-layers/yocto-poky/scripts/lib/recipetool/newappend.py
new file mode 100644
index 000000000..bdf0693ec
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/recipetool/newappend.py
@@ -0,0 +1,112 @@
+# 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 _provide_to_pn(cooker, provide):
+ """Get the name of the preferred recipe for the specified provide."""
+ import bb.providers
+ filenames = cooker.recipecache.providers[provide]
+ eligible, foundUnique = bb.providers.filterProviders(filenames, provide, cooker.expanded_data, cooker.recipecache)
+ filename = eligible[0]
+ pn = cooker.recipecache.pkg_fn[filename]
+ return pn
+
+
+def _get_recipe_file(cooker, pn):
+ import oe.recipeutils
+ recipefile = oe.recipeutils.pn_to_recipe(cooker, pn)
+ if not recipefile:
+ skipreasons = oe.recipeutils.get_unavailable_reasons(cooker, pn)
+ if skipreasons:
+ logger.error('\n'.join(skipreasons))
+ else:
+ logger.error("Unable to find any recipe file matching %s" % pn)
+ return recipefile
+
+
+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
+
+ pn = _provide_to_pn(tinfoil.cooker, args.target)
+ recipe_path = _get_recipe_file(tinfoil.cooker, pn)
+
+ 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(destlayerdir, 'conf', 'layer.conf'), os.path.dirname(appendpath))
+
+ layerdirs = [os.path.abspath(layerdir) for layerdir in rd.getVar('BBLAYERS', True).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])
+ 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/import-layers/yocto-poky/scripts/lib/recipetool/setvar.py b/import-layers/yocto-poky/scripts/lib/recipetool/setvar.py
new file mode 100644
index 000000000..657d2b6a7
--- /dev/null
+++ b/import-layers/yocto-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 = oe.recipeutils.parse_recipe(args.recipefile, None, tinfoil.config_data)
+ 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/import-layers/yocto-poky/scripts/lib/scriptpath.py b/import-layers/yocto-poky/scripts/lib/scriptpath.py
new file mode 100644
index 000000000..d00317e18
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/lib/scriptutils.py b/import-layers/yocto-poky/scripts/lib/scriptutils.py
new file mode 100644
index 000000000..aef19d3d7
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/scriptutils.py
@@ -0,0 +1,118 @@
+# 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
+
+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
+
+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()
+
+ logger.debug('Loading plugins from %s...' % pluginpath)
+ for fn in glob.glob(os.path.join(pluginpath, '*.py')):
+ name = os.path.splitext(os.path.basename(fn))[0]
+ if name != '__init__':
+ 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 fetch_uri(d, uri, destdir, srcrev=None):
+ """Fetch a URI to a local directory"""
+ import bb.data
+ bb.utils.mkdirhier(destdir)
+ localdata = bb.data.createCopy(d)
+ localdata.setVar('BB_STRICT_CHECKSUM', '')
+ localdata.setVar('SRCREV', srcrev)
+ ret = (None, None)
+ olddir = os.getcwd()
+ try:
+ fetcher = bb.fetch2.Fetch([uri], localdata)
+ for u in fetcher.ud:
+ ud = fetcher.ud[u]
+ ud.ignore_checksums = True
+ fetcher.download()
+ for u in fetcher.ud:
+ ud = fetcher.ud[u]
+ if ud.localpath.rstrip(os.sep) == localdata.getVar('DL_DIR', True).rstrip(os.sep):
+ raise Exception('Local path is download directory - please check that the URI "%s" is correct' % uri)
+ fetcher.unpack(destdir)
+ for u in fetcher.ud:
+ ud = fetcher.ud[u]
+ if ud.method.recommends_checksum(ud):
+ md5value = bb.utils.md5_file(ud.localpath)
+ sha256value = bb.utils.sha256_file(ud.localpath)
+ ret = (md5value, sha256value)
+ finally:
+ os.chdir(olddir)
+ return ret
+
+def run_editor(fn):
+ if isinstance(fn, basestring):
+ 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 OSError as exc:
+ logger.error("Execution of editor '%s' failed: %s", editor, exc)
+ return 1
diff --git a/import-layers/yocto-poky/scripts/lib/wic/__init__.py b/import-layers/yocto-poky/scripts/lib/wic/__init__.py
new file mode 100644
index 000000000..63c1d9c84
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/__init__.py
@@ -0,0 +1,4 @@
+import os, sys
+
+cur_path = os.path.dirname(__file__) or '.'
+sys.path.insert(0, cur_path + '/3rdparty')
diff --git a/import-layers/yocto-poky/scripts/lib/wic/__version__.py b/import-layers/yocto-poky/scripts/lib/wic/__version__.py
new file mode 100644
index 000000000..5452a4671
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/__version__.py
@@ -0,0 +1 @@
+VERSION = "2.00"
diff --git a/import-layers/yocto-poky/scripts/lib/wic/canned-wks/common.wks.inc b/import-layers/yocto-poky/scripts/lib/wic/canned-wks/common.wks.inc
new file mode 100644
index 000000000..5cf2fd1f3
--- /dev/null
+++ b/import-layers/yocto-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 --ondisk sda --fstype=ext4 --label platform --align 1024
diff --git a/import-layers/yocto-poky/scripts/lib/wic/canned-wks/directdisk-bootloader-config.cfg b/import-layers/yocto-poky/scripts/lib/wic/canned-wks/directdisk-bootloader-config.cfg
new file mode 100644
index 000000000..a16bd6ac6
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/canned-wks/directdisk-bootloader-config.cfg
@@ -0,0 +1,11 @@
+# This is an example configuration file for syslinux.
+PROMPT 0
+TIMEOUT 10
+
+ALLOWOPTIONS 1
+SERIAL 0 115200
+
+DEFAULT boot
+LABEL boot
+KERNEL /vmlinuz
+APPEND label=boot root=/dev/sda2 rootwait rootfstype=ext4 video=vesafb vga=0x318 console=tty0
diff --git a/import-layers/yocto-poky/scripts/lib/wic/canned-wks/directdisk-bootloader-config.wks b/import-layers/yocto-poky/scripts/lib/wic/canned-wks/directdisk-bootloader-config.wks
new file mode 100644
index 000000000..3529e05c8
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/lib/wic/canned-wks/directdisk-gpt.wks b/import-layers/yocto-poky/scripts/lib/wic/canned-wks/directdisk-gpt.wks
new file mode 100644
index 000000000..ea01cf375
--- /dev/null
+++ b/import-layers/yocto-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"
+
diff --git a/import-layers/yocto-poky/scripts/lib/wic/canned-wks/directdisk-multi-rootfs.wks b/import-layers/yocto-poky/scripts/lib/wic/canned-wks/directdisk-multi-rootfs.wks
new file mode 100644
index 000000000..8a81f8f51
--- /dev/null
+++ b/import-layers/yocto-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"
+
diff --git a/import-layers/yocto-poky/scripts/lib/wic/canned-wks/directdisk.wks b/import-layers/yocto-poky/scripts/lib/wic/canned-wks/directdisk.wks
new file mode 100644
index 000000000..6db74a78b
--- /dev/null
+++ b/import-layers/yocto-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"
+
diff --git a/import-layers/yocto-poky/scripts/lib/wic/canned-wks/mkefidisk.wks b/import-layers/yocto-poky/scripts/lib/wic/canned-wks/mkefidisk.wks
new file mode 100644
index 000000000..696e94e3d
--- /dev/null
+++ b/import-layers/yocto-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
+
+part swap --ondisk sda --size 44 --label swap1 --fstype=swap
+
+bootloader --timeout=10 --append="rootwait rootfstype=ext4 console=ttyPCH0,115200 console=tty0 vmalloc=256MB snd-hda-intel.enable_msi=0"
diff --git a/import-layers/yocto-poky/scripts/lib/wic/canned-wks/mkgummidisk.wks b/import-layers/yocto-poky/scripts/lib/wic/canned-wks/mkgummidisk.wks
new file mode 100644
index 000000000..66a22f60b
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/canned-wks/mkgummidisk.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=gummiboot" --ondisk sda --label msdos --active --align 1024
+
+part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024
+
+part swap --ondisk sda --size 44 --label swap1 --fstype=swap
+
+bootloader --timeout=10 --append="rootwait rootfstype=ext4 console=ttyPCH0,115200 console=tty0 vmalloc=256MB snd-hda-intel.enable_msi=0"
diff --git a/import-layers/yocto-poky/scripts/lib/wic/canned-wks/mkhybridiso.wks b/import-layers/yocto-poky/scripts/lib/wic/canned-wks/mkhybridiso.wks
new file mode 100644
index 000000000..9d34e9b47
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/lib/wic/canned-wks/qemux86-directdisk.wks b/import-layers/yocto-poky/scripts/lib/wic/canned-wks/qemux86-directdisk.wks
new file mode 100644
index 000000000..a6518a0f4
--- /dev/null
+++ b/import-layers/yocto-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 root=/dev/vda2 rw mem=256M ip=192.168.7.2::192.168.7.1:255.255.255.0 oprofile.timer=1 rootfstype=ext4 "
+
diff --git a/import-layers/yocto-poky/scripts/lib/wic/canned-wks/sdimage-bootpart.wks b/import-layers/yocto-poky/scripts/lib/wic/canned-wks/sdimage-bootpart.wks
new file mode 100644
index 000000000..7ffd632f4
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/lib/wic/conf.py b/import-layers/yocto-poky/scripts/lib/wic/conf.py
new file mode 100644
index 000000000..f7d56d046
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/conf.py
@@ -0,0 +1,103 @@
+#!/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.
+
+import os
+
+from wic.ksparser import KickStart, KickStartError
+from wic import msger
+from wic.utils import misc
+
+
+def get_siteconf():
+ wic_path = os.path.dirname(__file__)
+ eos = wic_path.find('scripts') + len('scripts')
+ scripts_path = wic_path[:eos]
+
+ return scripts_path + "/lib/image/config/wic.conf"
+
+class ConfigMgr(object):
+ DEFAULTS = {
+ 'common': {
+ "distro_name": "Default Distribution",
+ "plugin_dir": "/usr/lib/wic/plugins"}, # TODO use prefix also?
+ 'create': {
+ "tmpdir": '/var/tmp/wic',
+ "outdir": './wic-output',
+ "release": None,
+ "logfile": None,
+ "name_prefix": None,
+ "name_suffix": None}
+ }
+
+ # make the manager class as singleton
+ _instance = None
+ def __new__(cls, *args, **kwargs):
+ if not cls._instance:
+ cls._instance = super(ConfigMgr, cls).__new__(cls, *args, **kwargs)
+
+ return cls._instance
+
+ def __init__(self, ksconf=None, siteconf=None):
+ # reset config options
+ self.reset()
+
+ if not siteconf:
+ siteconf = get_siteconf()
+
+ # initial options from siteconf
+ self._siteconf = siteconf
+
+ if ksconf:
+ self._ksconf = ksconf
+
+ def reset(self):
+ self.__ksconf = None
+ self.__siteconf = None
+ self.create = {}
+
+ # initialize the values with defaults
+ for sec, vals in self.DEFAULTS.iteritems():
+ setattr(self, sec, vals)
+
+ def __set_ksconf(self, ksconf):
+ if not os.path.isfile(ksconf):
+ msger.error('Cannot find ks file: %s' % ksconf)
+
+ self.__ksconf = ksconf
+ self._parse_kickstart(ksconf)
+ def __get_ksconf(self):
+ return self.__ksconf
+ _ksconf = property(__get_ksconf, __set_ksconf)
+
+ def _parse_kickstart(self, ksconf=None):
+ if not ksconf:
+ return
+
+ try:
+ ksobj = KickStart(ksconf)
+ except KickStartError as err:
+ msger.error(str(err))
+
+ self.create['ks'] = ksobj
+ self.create['name'] = os.path.splitext(os.path.basename(ksconf))[0]
+
+ self.create['name'] = misc.build_name(ksconf,
+ self.create['release'],
+ self.create['name_prefix'],
+ self.create['name_suffix'])
+
+configmgr = ConfigMgr()
diff --git a/import-layers/yocto-poky/scripts/lib/wic/config/wic.conf b/import-layers/yocto-poky/scripts/lib/wic/config/wic.conf
new file mode 100644
index 000000000..a51bcb55e
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/config/wic.conf
@@ -0,0 +1,6 @@
+[common]
+; general settings
+distro_name = OpenEmbedded
+
+[create]
+; settings for create subcommand
diff --git a/import-layers/yocto-poky/scripts/lib/wic/creator.py b/import-layers/yocto-poky/scripts/lib/wic/creator.py
new file mode 100644
index 000000000..523129728
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/creator.py
@@ -0,0 +1,124 @@
+#!/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.
+
+import os, sys
+from optparse import OptionParser, SUPPRESS_HELP
+
+from wic import msger
+from wic.utils import errors
+from wic.conf import configmgr
+from wic.plugin import pluginmgr
+
+
+class Creator(object):
+ """${name}: create an image
+
+ Usage:
+ ${name} SUBCOMMAND <ksfile> [OPTS]
+
+ ${command_list}
+ ${option_list}
+ """
+
+ name = 'wic create(cr)'
+
+ def __init__(self, *args, **kwargs):
+ self._subcmds = {}
+
+ # get cmds from pluginmgr
+ # mix-in do_subcmd interface
+ for subcmd, klass in pluginmgr.get_plugins('imager').iteritems():
+ if not hasattr(klass, 'do_create'):
+ msger.warning("Unsupported subcmd: %s" % subcmd)
+ continue
+
+ func = getattr(klass, 'do_create')
+ self._subcmds[subcmd] = func
+
+ def get_optparser(self):
+ optparser = OptionParser()
+ optparser.add_option('-d', '--debug', action='store_true',
+ dest='debug',
+ help=SUPPRESS_HELP)
+ optparser.add_option('-v', '--verbose', action='store_true',
+ dest='verbose',
+ help=SUPPRESS_HELP)
+ optparser.add_option('', '--logfile', type='string', dest='logfile',
+ default=None,
+ help='Path of logfile')
+ optparser.add_option('-c', '--config', type='string', dest='config',
+ default=None,
+ help='Specify config file for wic')
+ optparser.add_option('-o', '--outdir', type='string', action='store',
+ dest='outdir', default=None,
+ help='Output directory')
+ optparser.add_option('', '--tmpfs', action='store_true', dest='enabletmpfs',
+ help='Setup tmpdir as tmpfs to accelerate, experimental'
+ ' feature, use it if you have more than 4G memory')
+ return optparser
+
+ def postoptparse(self, options):
+ abspath = lambda pth: os.path.abspath(os.path.expanduser(pth))
+
+ if options.verbose:
+ msger.set_loglevel('verbose')
+ if options.debug:
+ msger.set_loglevel('debug')
+
+ if options.logfile:
+ logfile_abs_path = abspath(options.logfile)
+ if os.path.isdir(logfile_abs_path):
+ raise errors.Usage("logfile's path %s should be file"
+ % options.logfile)
+ if not os.path.exists(os.path.dirname(logfile_abs_path)):
+ os.makedirs(os.path.dirname(logfile_abs_path))
+ msger.set_interactive(False)
+ msger.set_logfile(logfile_abs_path)
+ configmgr.create['logfile'] = options.logfile
+
+ if options.config:
+ configmgr.reset()
+ configmgr._siteconf = options.config
+
+ if options.outdir is not None:
+ configmgr.create['outdir'] = abspath(options.outdir)
+
+ cdir = 'outdir'
+ if os.path.exists(configmgr.create[cdir]) \
+ and not os.path.isdir(configmgr.create[cdir]):
+ msger.error('Invalid directory specified: %s' \
+ % configmgr.create[cdir])
+
+ if options.enabletmpfs:
+ configmgr.create['enabletmpfs'] = options.enabletmpfs
+
+ def main(self, argv=None):
+ if argv is None:
+ argv = sys.argv
+ else:
+ argv = argv[:] # don't modify caller's list
+
+ pname = argv[0]
+ if pname not in self._subcmds:
+ msger.error('Unknown plugin: %s' % pname)
+
+ optparser = self.get_optparser()
+ options, args = optparser.parse_args(argv)
+
+ self.postoptparse(options)
+
+ return self._subcmds[pname](options, *args[1:])
diff --git a/import-layers/yocto-poky/scripts/lib/wic/engine.py b/import-layers/yocto-poky/scripts/lib/wic/engine.py
new file mode 100644
index 000000000..76b93e82f
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/engine.py
@@ -0,0 +1,220 @@
+# 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 os
+import sys
+
+from wic import msger, creator
+from wic.utils import misc
+from wic.plugin import pluginmgr
+from wic.utils.oe import misc
+
+
+def verify_build_env():
+ """
+ Verify that the build environment is sane.
+
+ Returns True if it is, false otherwise
+ """
+ if not os.environ.get("BUILDDIR"):
+ print "BUILDDIR not found, exiting. (Did you forget to source oe-init-build-env?)"
+ sys.exit(1)
+
+ return True
+
+
+CANNED_IMAGE_DIR = "lib/wic/canned-wks" # relative to scripts
+SCRIPTS_CANNED_IMAGE_DIR = "scripts/" + CANNED_IMAGE_DIR
+
+def build_canned_image_list(path):
+ layers_path = misc.get_bitbake_var("BBLAYERS")
+ canned_wks_layer_dirs = []
+
+ if layers_path is not None:
+ for layer_path in layers_path.split():
+ cpath = os.path.join(layer_path, SCRIPTS_CANNED_IMAGE_DIR)
+ 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_source_plugins()
+
+ for plugin in plugins:
+ print " %s" % plugin
+
+
+def wic_create(wks_file, rootfs_dir, bootimg_dir, kernel_dir,
+ native_sysroot, scripts_path, image_output_dir,
+ compressor, debug):
+ """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
+ scripts_path - absolute path to /scripts dir
+ image_output_dir - dirname to create for image
+ compressor - compressor utility to compress the image
+
+ 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:
+ print "BUILDDIR not found, exiting. (Did you forget to source oe-init-build-env?)"
+ sys.exit(1)
+
+ if debug:
+ msger.set_loglevel('debug')
+
+ crobj = creator.Creator()
+
+ crobj.main(["direct", native_sysroot, kernel_dir, bootimg_dir, rootfs_dir,
+ wks_file, image_output_dir, oe_builddir, compressor or ""])
+
+ print "\nThe 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 len(args) < 1:
+ return False
+
+ if args == ["images"]:
+ list_canned_images(scripts_path)
+ return True
+ elif args == ["source-plugins"]:
+ list_source_plugins()
+ return True
+ elif len(args) == 2 and args[1] == "help":
+ wks_file = args[0]
+ fullpath = find_canned_image(scripts_path, wks_file)
+ if not fullpath:
+ print "No image named %s found, exiting. "\
+ "(Use 'wic list images' to list available images, or "\
+ "specify a fully-qualified OE kickstart (.wks) "\
+ "filename)\n" % wks_file
+ sys.exit(1)
+ list_canned_image_help(scripts_path, fullpath)
+ return True
+
+ return False
diff --git a/import-layers/yocto-poky/scripts/lib/wic/help.py b/import-layers/yocto-poky/scripts/lib/wic/help.py
new file mode 100644
index 000000000..405d25a87
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/help.py
@@ -0,0 +1,777 @@
+# 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.plugin import pluginmgr, PLUGIN_TYPES
+
+def subcommand_error(args):
+ logging.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)
+
+ return True
+
+
+def wic_help(args, usage_str, subcommands):
+ """
+ Subcommand help dispatcher.
+ """
+ if len(args) == 1 or not display_help(args[1], 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).iteritems():
+ 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:
+ logging.error("No subcommand specified, exiting")
+ parser.print_help()
+ return 1
+ elif args[0] == "help":
+ wic_help(args, main_command_usage, subcommands)
+ elif args[0] not in subcommands:
+ logging.error("Unsupported subcommand %s, exiting\n" % (args[0]))
+ parser.print_help()
+ return 1
+ else:
+ usage = subcommands.get(args[0], subcommand_error)[1]
+ subcommands.get(args[0], subcommand_error)[0](args[1:], 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>]
+ [-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.
+"""
+
+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]
+
+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.
+"""
+
+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_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_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.
+ The code that then needs to call the plugin methods uses
+ plugin.get_source_plugin_methods() to find the method(s) needed by
+ the call; this is done by filling up a dict with keys containing
+ the method names of interest - on success, these will be filled in
+ with the actual methods. Please see the implementation for
+ examples and 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.
+
+
+ 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.
+
+ --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:
+
+ 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.
+
+ --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.
+
+ --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.
+
+ --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.
+
+ * 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.
+
+"""
diff --git a/import-layers/yocto-poky/scripts/lib/wic/imager/__init__.py b/import-layers/yocto-poky/scripts/lib/wic/imager/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/imager/__init__.py
diff --git a/import-layers/yocto-poky/scripts/lib/wic/imager/baseimager.py b/import-layers/yocto-poky/scripts/lib/wic/imager/baseimager.py
new file mode 100644
index 000000000..760cf8a58
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/imager/baseimager.py
@@ -0,0 +1,192 @@
+#!/usr/bin/env python -tt
+#
+# Copyright (c) 2007 Red Hat Inc.
+# Copyright (c) 2009, 2010, 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.
+
+from __future__ import with_statement
+import os
+import tempfile
+import shutil
+
+from wic import msger
+from wic.utils.errors import CreatorError
+from wic.utils import runner
+
+class BaseImageCreator(object):
+ """Base class for image creation.
+
+ BaseImageCreator is the simplest creator class available; it will
+ create a system image according to the supplied kickstart file.
+
+ e.g.
+
+ import wic.imgcreate as imgcreate
+ ks = imgcreate.read_kickstart("foo.ks")
+ imgcreate.ImageCreator(ks, "foo").create()
+ """
+
+ def __del__(self):
+ self.cleanup()
+
+ def __init__(self, createopts=None):
+ """Initialize an ImageCreator instance.
+
+ ks -- a pykickstart.KickstartParser instance; this instance will be
+ used to drive the install by e.g. providing the list of packages
+ to be installed, the system configuration and %post scripts
+
+ name -- a name for the image; used for e.g. image filenames or
+ filesystem labels
+ """
+
+ self.__builddir = None
+
+ self.ks = None
+ self.name = "target"
+ self.tmpdir = "/var/tmp/wic"
+ self.workdir = "/var/tmp/wic/build"
+
+ # setup tmpfs tmpdir when enabletmpfs is True
+ self.enabletmpfs = False
+
+ if createopts:
+ # Mapping table for variables that have different names.
+ optmap = {"outdir" : "destdir",
+ }
+
+ # update setting from createopts
+ for key in createopts.keys():
+ if key in optmap:
+ option = optmap[key]
+ else:
+ option = key
+ setattr(self, option, createopts[key])
+
+ self.destdir = os.path.abspath(os.path.expanduser(self.destdir))
+
+ self._dep_checks = ["ls", "bash", "cp", "echo"]
+
+ # Output image file names
+ self.outimage = []
+
+ # No ks provided when called by convertor, so skip the dependency check
+ if self.ks:
+ # If we have btrfs partition we need to check necessary tools
+ for part in self.ks.partitions:
+ if part.fstype and part.fstype == "btrfs":
+ self._dep_checks.append("mkfs.btrfs")
+ break
+
+ # make sure the specified tmpdir and cachedir exist
+ if not os.path.exists(self.tmpdir):
+ os.makedirs(self.tmpdir)
+
+
+ #
+ # Hooks for subclasses
+ #
+ def _create(self):
+ """Create partitions for the disk image(s)
+
+ This is the hook where subclasses may create the partitions
+ that will be assembled into disk image(s).
+
+ There is no default implementation.
+ """
+ pass
+
+ def _cleanup(self):
+ """Undo anything performed in _create().
+
+ This is the hook where subclasses must undo anything which was
+ done in _create().
+
+ There is no default implementation.
+
+ """
+ pass
+
+ #
+ # Actual implementation
+ #
+ def __ensure_builddir(self):
+ if not self.__builddir is None:
+ return
+
+ try:
+ self.workdir = os.path.join(self.tmpdir, "build")
+ if not os.path.exists(self.workdir):
+ os.makedirs(self.workdir)
+ self.__builddir = tempfile.mkdtemp(dir=self.workdir,
+ prefix="imgcreate-")
+ except OSError as err:
+ raise CreatorError("Failed create build directory in %s: %s" %
+ (self.tmpdir, err))
+
+ def __setup_tmpdir(self):
+ if not self.enabletmpfs:
+ return
+
+ runner.show('mount -t tmpfs -o size=4G tmpfs %s' % self.workdir)
+
+ def __clean_tmpdir(self):
+ if not self.enabletmpfs:
+ return
+
+ runner.show('umount -l %s' % self.workdir)
+
+ def create(self):
+ """Create partitions for the disk image(s)
+
+ Create the partitions that will be assembled into disk
+ image(s).
+ """
+ self.__setup_tmpdir()
+ self.__ensure_builddir()
+
+ self._create()
+
+ def cleanup(self):
+ """Undo anything performed in create().
+
+ Note, make sure to call this method once finished with the creator
+ instance in order to ensure no stale files are left on the host e.g.:
+
+ creator = ImageCreator(ks, name)
+ try:
+ creator.create()
+ finally:
+ creator.cleanup()
+
+ """
+ if not self.__builddir:
+ return
+
+ self._cleanup()
+
+ shutil.rmtree(self.__builddir, ignore_errors=True)
+ self.__builddir = None
+
+ self.__clean_tmpdir()
+
+
+ def print_outimage_info(self):
+ msg = "The new image can be found here:\n"
+ self.outimage.sort()
+ for path in self.outimage:
+ msg += ' %s\n' % os.path.abspath(path)
+
+ msger.info(msg)
diff --git a/import-layers/yocto-poky/scripts/lib/wic/imager/direct.py b/import-layers/yocto-poky/scripts/lib/wic/imager/direct.py
new file mode 100644
index 000000000..a1b424965
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/imager/direct.py
@@ -0,0 +1,380 @@
+# 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' image creator class for 'wic'
+#
+# AUTHORS
+# Tom Zanussi <tom.zanussi (at] linux.intel.com>
+#
+
+import os
+import shutil
+
+from wic import msger
+from wic.utils import fs_related
+from wic.utils.oe.misc import get_bitbake_var
+from wic.utils.partitionedfs import Image
+from wic.utils.errors import CreatorError, ImageError
+from wic.imager.baseimager import BaseImageCreator
+from wic.plugin import pluginmgr
+from wic.utils.oe.misc import exec_cmd
+
+disk_methods = {
+ "do_install_disk":None,
+}
+
+class DirectImageCreator(BaseImageCreator):
+ """
+ Installs a system into a file containing a partitioned disk image.
+
+ DirectImageCreator is an advanced ImageCreator subclass; 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.
+ """
+
+ def __init__(self, oe_builddir, image_output_dir, rootfs_dir, bootimg_dir,
+ kernel_dir, native_sysroot, compressor, creatoropts=None):
+ """
+ Initialize a DirectImageCreator instance.
+
+ This method takes the same arguments as ImageCreator.__init__()
+ """
+ BaseImageCreator.__init__(self, creatoropts)
+
+ self.__image = None
+ self.__disks = {}
+ self.__disk_format = "direct"
+ self._disk_names = []
+ self.ptable_format = self.ks.bootloader.ptable
+
+ self.oe_builddir = oe_builddir
+ if image_output_dir:
+ self.tmpdir = image_output_dir
+ self.rootfs_dir = rootfs_dir
+ self.bootimg_dir = bootimg_dir
+ self.kernel_dir = kernel_dir
+ self.native_sysroot = native_sysroot
+ self.compressor = compressor
+
+ def __get_part_num(self, num, parts):
+ """calculate the real partition number, accounting for partitions not
+ in the partition table and logical partitions
+ """
+ realnum = 0
+ for pnum, part in enumerate(parts, 1):
+ if not part.no_table:
+ realnum += 1
+ if pnum == num:
+ if part.no_table:
+ return 0
+ if self.ptable_format == 'msdos' and realnum > 3:
+ # account for logical partition numbering, ex. sda5..
+ return realnum + 1
+ return realnum
+
+ 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._get_parts()):
+ shutil.copyfile(fstab_path, fstab_path + ".orig")
+
+ with open(fstab_path, "w") as fstab:
+ fstab.writelines(fstab_lines)
+
+ return fstab_path
+
+ def _update_fstab(self, fstab_lines, parts):
+ """Assume partition order same as in wks"""
+ updated = False
+ for num, part in enumerate(parts, 1):
+ pnum = self.__get_part_num(num, parts)
+ if not pnum or not part.mountpoint \
+ or part.mountpoint in ("/", "/boot"):
+ continue
+
+ # mmc device partitions are named mmcblk0p1, mmcblk0p2..
+ prefix = 'p' if part.disk.startswith('mmcblk') else ''
+ device_name = "/dev/%s%s%d" % (part.disk, prefix, pnum)
+
+ 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 set_bootimg_dir(self, bootimg_dir):
+ """
+ Accessor for bootimg_dir, the actual location used for the source
+ of the bootimg. Should be set by source plugins (only if they
+ change the default bootimg source) so the correct info gets
+ displayed for print_outimage_info().
+ """
+ self.bootimg_dir = bootimg_dir
+
+ def _get_parts(self):
+ if not self.ks:
+ raise CreatorError("Failed to get partition info, "
+ "please check your kickstart setting.")
+
+ # Set a default partition if no partition is given out
+ if not self.ks.partitions:
+ partstr = "part / --size 1900 --ondisk sda --fstype=ext3"
+ args = partstr.split()
+ part = self.ks.parse(args[1:])
+ if part not in self.ks.partitions:
+ self.ks.partitions.append(part)
+
+ # partitions list from kickstart file
+ return self.ks.partitions
+
+ def get_disk_names(self):
+ """ Returns a list of physical target disk names (e.g., 'sdb') which
+ will be created. """
+
+ if self._disk_names:
+ return self._disk_names
+
+ #get partition info from ks handler
+ parts = self._get_parts()
+
+ for i in range(len(parts)):
+ if parts[i].disk:
+ disk_name = parts[i].disk
+ else:
+ raise CreatorError("Failed to create disks, no --ondisk "
+ "specified in partition line of ks file")
+
+ if parts[i].mountpoint and not parts[i].fstype:
+ raise CreatorError("Failed to create disks, no --fstype "
+ "specified for partition with mountpoint "
+ "'%s' in the ks file")
+
+ self._disk_names.append(disk_name)
+
+ return self._disk_names
+
+ def _full_name(self, name, extention):
+ """ Construct full file name for a file we generate. """
+ return "%s-%s.%s" % (self.name, name, extention)
+
+ def _full_path(self, path, name, extention):
+ """ Construct full file path to a file we generate. """
+ return os.path.join(path, self._full_name(name, extention))
+
+ def get_default_source_plugin(self):
+ """
+ The default source plugin i.e. the plugin that's consulted for
+ overall image generation tasks outside of any particular
+ partition. For convenience, we just hang it off the
+ bootloader handler since it's the one non-partition object in
+ any setup. By default the default plugin is set to the same
+ plugin as the /boot partition; since we hang it off the
+ bootloader object, the default can be explicitly set using the
+ --source bootloader param.
+ """
+ return self.ks.bootloader.source
+
+ #
+ # 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.
+ """
+ parts = self._get_parts()
+
+ self.__image = Image(self.native_sysroot)
+
+ for part in parts:
+ # as a convenience, set source to the boot partition source
+ # instead of forcing it to be set via bootloader --source
+ if not self.ks.bootloader.source and part.mountpoint == "/boot":
+ self.ks.bootloader.source = part.source
+
+ fstab_path = self._write_fstab(self.rootfs_dir.get("ROOTFS_DIR"))
+
+ shutil.rmtree(self.workdir)
+ os.mkdir(self.workdir)
+
+ for part in 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 = part.rootfs_dir
+ if 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)))
+ # need to create the filesystems in order to get their
+ # sizes before we can add them and do the layout.
+ # Image.create() actually calls __format_disks() to create
+ # the disk images and carve out the partitions, then
+ # self.assemble() calls Image.assemble() which calls
+ # __write_partitition() for each partition to dd the fs
+ # into the partitions.
+ part.prepare(self, self.workdir, self.oe_builddir, self.rootfs_dir,
+ self.bootimg_dir, self.kernel_dir, self.native_sysroot)
+
+
+ self.__image.add_partition(int(part.size),
+ part.disk,
+ part.mountpoint,
+ part.source_file,
+ part.fstype,
+ part.label,
+ fsopts=part.fsopts,
+ boot=part.active,
+ align=part.align,
+ no_table=part.no_table,
+ part_type=part.part_type,
+ uuid=part.uuid)
+
+ if fstab_path:
+ shutil.move(fstab_path + ".orig", fstab_path)
+
+ self.__image.layout_partitions(self.ptable_format)
+
+ self.__imgdir = self.workdir
+ for disk_name, disk in self.__image.disks.items():
+ full_path = self._full_path(self.__imgdir, disk_name, "direct")
+ msger.debug("Adding disk %s as %s with size %s bytes" \
+ % (disk_name, full_path, disk['min_size']))
+ disk_obj = fs_related.DiskImage(full_path, disk['min_size'])
+ self.__disks[disk_name] = disk_obj
+ self.__image.add_disk(disk_name, disk_obj)
+
+ self.__image.create()
+
+ def assemble(self):
+ """
+ Assemble partitions into disk image(s)
+ """
+ for disk_name, disk in self.__image.disks.items():
+ full_path = self._full_path(self.__imgdir, disk_name, "direct")
+ msger.debug("Assembling disk %s as %s with size %s bytes" \
+ % (disk_name, full_path, disk['min_size']))
+ self.__image.assemble(full_path)
+
+ 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.get_default_source_plugin()
+ if source_plugin:
+ self._source_methods = pluginmgr.get_source_plugin_methods(source_plugin, disk_methods)
+ for disk_name, disk in self.__image.disks.items():
+ self._source_methods["do_install_disk"](disk, disk_name, self,
+ self.workdir,
+ self.oe_builddir,
+ self.bootimg_dir,
+ self.kernel_dir,
+ self.native_sysroot)
+ # Compress the image
+ if self.compressor:
+ for disk_name, disk in self.__image.disks.items():
+ full_path = self._full_path(self.__imgdir, disk_name, "direct")
+ msger.debug("Compressing disk %s with %s" % \
+ (disk_name, self.compressor))
+ exec_cmd("%s %s" % (self.compressor, full_path))
+
+ def print_outimage_info(self):
+ """
+ Print the image(s) and artifacts used, for the user.
+ """
+ msg = "The new image(s) can be found here:\n"
+
+ parts = self._get_parts()
+
+ for disk_name in self.__image.disks:
+ extension = "direct" + {"gzip": ".gz",
+ "bzip2": ".bz2",
+ "xz": ".xz",
+ "": ""}.get(self.compressor)
+ full_path = self._full_path(self.__imgdir, disk_name, extension)
+ msg += ' %s\n\n' % full_path
+
+ msg += 'The following build artifacts were used to create the image(s):\n'
+ for part in parts:
+ if part.rootfs_dir is None:
+ continue
+ if part.mountpoint == '/':
+ suffix = ':'
+ else:
+ suffix = '["%s"]:' % (part.mountpoint or part.label)
+ msg += ' ROOTFS_DIR%s%s\n' % (suffix.ljust(20), part.rootfs_dir)
+
+ msg += ' BOOTIMG_DIR: %s\n' % self.bootimg_dir
+ msg += ' KERNEL_DIR: %s\n' % self.kernel_dir
+ msg += ' NATIVE_SYSROOT: %s\n' % self.native_sysroot
+
+ msger.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
+ """
+ parts = self._get_parts()
+ for num, part in enumerate(parts, 1):
+ if part.mountpoint == "/":
+ if part.uuid:
+ return "PARTUUID=%s" % part.uuid
+ else:
+ suffix = 'p' if part.disk.startswith('mmcblk') else ''
+ pnum = self.__get_part_num(num, parts)
+ return "/dev/%s%s%-d" % (part.disk, suffix, pnum)
+
+ def _cleanup(self):
+ if not self.__image is None:
+ try:
+ self.__image.cleanup()
+ except ImageError, err:
+ msger.warning("%s" % err)
+
diff --git a/import-layers/yocto-poky/scripts/lib/wic/ksparser.py b/import-layers/yocto-poky/scripts/lib/wic/ksparser.py
new file mode 100644
index 000000000..8c3f80882
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/ksparser.py
@@ -0,0 +1,169 @@
+#!/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
+from argparse import ArgumentParser, ArgumentError, ArgumentTypeError
+
+from wic import msger
+from wic.partition import Partition
+from wic.utils.misc import find_canned
+
+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) * 1024L
+
+ 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 * 1024L
+ if arg.endswith("G"):
+ return size * 1024L * 1024L
+
+ 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
+
+class KickStart(object):
+ """"Kickstart parser implementation."""
+
+ 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')
+ part.add_argument('--active', action='store_true')
+ part.add_argument('--align', type=int)
+ part.add_argument("--extra-space", type=sizetype, default=10*1024L)
+ part.add_argument('--fsoptions', dest='fsopts')
+ part.add_argument('--fstype')
+ part.add_argument('--label')
+ part.add_argument('--no-table', action='store_true')
+ part.add_argument('--ondisk', '--ondrive', dest='disk')
+ part.add_argument("--overhead-factor", type=overheadtype, default=1.3)
+ part.add_argument('--part-type')
+ part.add_argument('--rootfs-dir')
+ part.add_argument('--size', type=sizetype, default=0)
+ part.add_argument('--source')
+ part.add_argument('--sourceparams')
+ part.add_argument('--use-uuid', action='store_true')
+ part.add_argument('--uuid')
+
+ 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:
+ msger.warning('bootloader config not specified, using defaults')
+ 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:
+ parsed = parser.parse_args(shlex.split(line))
+ except ArgumentError as err:
+ raise KickStartError('%s:%d: %s' % \
+ (confpath, lineno, err))
+ if line.startswith('part'):
+ 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/import-layers/yocto-poky/scripts/lib/wic/msger.py b/import-layers/yocto-poky/scripts/lib/wic/msger.py
new file mode 100644
index 000000000..b73755422
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/msger.py
@@ -0,0 +1,309 @@
+#!/usr/bin/env python -tt
+# vim: ai ts=4 sts=4 et sw=4
+#
+# Copyright (c) 2009, 2010, 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.
+
+import os
+import sys
+import re
+import time
+
+__ALL__ = ['set_mode',
+ 'get_loglevel',
+ 'set_loglevel',
+ 'set_logfile',
+ 'raw',
+ 'debug',
+ 'verbose',
+ 'info',
+ 'warning',
+ 'error',
+ 'ask',
+ 'pause',
+ ]
+
+# COLORs in ANSI
+INFO_COLOR = 32 # green
+WARN_COLOR = 33 # yellow
+ERR_COLOR = 31 # red
+ASK_COLOR = 34 # blue
+NO_COLOR = 0
+
+PREFIX_RE = re.compile('^<(.*?)>\s*(.*)', re.S)
+
+INTERACTIVE = True
+
+LOG_LEVEL = 1
+LOG_LEVELS = {
+ 'quiet': 0,
+ 'normal': 1,
+ 'verbose': 2,
+ 'debug': 3,
+ 'never': 4,
+}
+
+LOG_FILE_FP = None
+LOG_CONTENT = ''
+CATCHERR_BUFFILE_FD = -1
+CATCHERR_BUFFILE_PATH = None
+CATCHERR_SAVED_2 = -1
+
+def _general_print(head, color, msg=None, stream=None, level='normal'):
+ global LOG_CONTENT
+ if not stream:
+ stream = sys.stdout
+
+ if LOG_LEVELS[level] > LOG_LEVEL:
+ # skip
+ return
+
+ # encode raw 'unicode' str to utf8 encoded str
+ if msg and isinstance(msg, unicode):
+ msg = msg.encode('utf-8', 'ignore')
+
+ errormsg = ''
+ if CATCHERR_BUFFILE_FD > 0:
+ size = os.lseek(CATCHERR_BUFFILE_FD, 0, os.SEEK_END)
+ os.lseek(CATCHERR_BUFFILE_FD, 0, os.SEEK_SET)
+ errormsg = os.read(CATCHERR_BUFFILE_FD, size)
+ os.ftruncate(CATCHERR_BUFFILE_FD, 0)
+
+ # append error msg to LOG
+ if errormsg:
+ LOG_CONTENT += errormsg
+
+ # append normal msg to LOG
+ save_msg = msg.strip() if msg else None
+ if save_msg:
+ timestr = time.strftime("[%m/%d %H:%M:%S %Z] ", time.localtime())
+ LOG_CONTENT += timestr + save_msg + '\n'
+
+ if errormsg:
+ _color_print('', NO_COLOR, errormsg, stream, level)
+
+ _color_print(head, color, msg, stream, level)
+
+def _color_print(head, color, msg, stream, level):
+ colored = True
+ if color == NO_COLOR or \
+ not stream.isatty() or \
+ os.getenv('ANSI_COLORS_DISABLED') is not None:
+ colored = False
+
+ if head.startswith('\r'):
+ # need not \n at last
+ newline = False
+ else:
+ newline = True
+
+ if colored:
+ head = '\033[%dm%s:\033[0m ' %(color, head)
+ if not newline:
+ # ESC cmd to clear line
+ head = '\033[2K' + head
+ else:
+ if head:
+ head += ': '
+ if head.startswith('\r'):
+ head = head.lstrip()
+ newline = True
+
+ if msg is not None:
+ if isinstance(msg, unicode):
+ msg = msg.encode('utf8', 'ignore')
+
+ stream.write('%s%s' % (head, msg))
+ if newline:
+ stream.write('\n')
+
+ stream.flush()
+
+def _color_perror(head, color, msg, level='normal'):
+ if CATCHERR_BUFFILE_FD > 0:
+ _general_print(head, color, msg, sys.stdout, level)
+ else:
+ _general_print(head, color, msg, sys.stderr, level)
+
+def _split_msg(head, msg):
+ if isinstance(msg, list):
+ msg = '\n'.join(map(str, msg))
+
+ if msg.startswith('\n'):
+ # means print \n at first
+ msg = msg.lstrip()
+ head = '\n' + head
+
+ elif msg.startswith('\r'):
+ # means print \r at first
+ msg = msg.lstrip()
+ head = '\r' + head
+
+ match = PREFIX_RE.match(msg)
+ if match:
+ head += ' <%s>' % match.group(1)
+ msg = match.group(2)
+
+ return head, msg
+
+def get_loglevel():
+ return (k for k, v in LOG_LEVELS.items() if v == LOG_LEVEL).next()
+
+def set_loglevel(level):
+ global LOG_LEVEL
+ if level not in LOG_LEVELS:
+ # no effect
+ return
+
+ LOG_LEVEL = LOG_LEVELS[level]
+
+def set_interactive(mode=True):
+ global INTERACTIVE
+ if mode:
+ INTERACTIVE = True
+ else:
+ INTERACTIVE = False
+
+def log(msg=''):
+ # log msg to LOG_CONTENT then save to logfile
+ global LOG_CONTENT
+ if msg:
+ LOG_CONTENT += msg
+
+def raw(msg=''):
+ _general_print('', NO_COLOR, msg)
+
+def info(msg):
+ head, msg = _split_msg('Info', msg)
+ _general_print(head, INFO_COLOR, msg)
+
+def verbose(msg):
+ head, msg = _split_msg('Verbose', msg)
+ _general_print(head, INFO_COLOR, msg, level='verbose')
+
+def warning(msg):
+ head, msg = _split_msg('Warning', msg)
+ _color_perror(head, WARN_COLOR, msg)
+
+def debug(msg):
+ head, msg = _split_msg('Debug', msg)
+ _color_perror(head, ERR_COLOR, msg, level='debug')
+
+def error(msg):
+ head, msg = _split_msg('Error', msg)
+ _color_perror(head, ERR_COLOR, msg)
+ sys.exit(1)
+
+def ask(msg, default=True):
+ _general_print('\rQ', ASK_COLOR, '')
+ try:
+ if default:
+ msg += '(Y/n) '
+ else:
+ msg += '(y/N) '
+ if INTERACTIVE:
+ while True:
+ repl = raw_input(msg)
+ if repl.lower() == 'y':
+ return True
+ elif repl.lower() == 'n':
+ return False
+ elif not repl.strip():
+ # <Enter>
+ return default
+
+ # else loop
+ else:
+ if default:
+ msg += ' Y'
+ else:
+ msg += ' N'
+ _general_print('', NO_COLOR, msg)
+
+ return default
+ except KeyboardInterrupt:
+ sys.stdout.write('\n')
+ sys.exit(2)
+
+def choice(msg, choices, default=0):
+ if default >= len(choices):
+ return None
+ _general_print('\rQ', ASK_COLOR, '')
+ try:
+ msg += " [%s] " % '/'.join(choices)
+ if INTERACTIVE:
+ while True:
+ repl = raw_input(msg)
+ if repl in choices:
+ return repl
+ elif not repl.strip():
+ return choices[default]
+ else:
+ msg += choices[default]
+ _general_print('', NO_COLOR, msg)
+
+ return choices[default]
+ except KeyboardInterrupt:
+ sys.stdout.write('\n')
+ sys.exit(2)
+
+def pause(msg=None):
+ if INTERACTIVE:
+ _general_print('\rQ', ASK_COLOR, '')
+ if msg is None:
+ msg = 'press <ENTER> to continue ...'
+ raw_input(msg)
+
+def set_logfile(fpath):
+ global LOG_FILE_FP
+
+ def _savelogf():
+ if LOG_FILE_FP:
+ with open(LOG_FILE_FP, 'w') as log:
+ log.write(LOG_CONTENT)
+
+ if LOG_FILE_FP is not None:
+ warning('duplicate log file configuration')
+
+ LOG_FILE_FP = fpath
+
+ import atexit
+ atexit.register(_savelogf)
+
+def enable_logstderr(fpath):
+ global CATCHERR_BUFFILE_FD
+ global CATCHERR_BUFFILE_PATH
+ global CATCHERR_SAVED_2
+
+ if os.path.exists(fpath):
+ os.remove(fpath)
+ CATCHERR_BUFFILE_PATH = fpath
+ CATCHERR_BUFFILE_FD = os.open(CATCHERR_BUFFILE_PATH, os.O_RDWR|os.O_CREAT)
+ CATCHERR_SAVED_2 = os.dup(2)
+ os.dup2(CATCHERR_BUFFILE_FD, 2)
+
+def disable_logstderr():
+ global CATCHERR_BUFFILE_FD
+ global CATCHERR_BUFFILE_PATH
+ global CATCHERR_SAVED_2
+
+ raw(msg=None) # flush message buffer and print it.
+ os.dup2(CATCHERR_SAVED_2, 2)
+ os.close(CATCHERR_SAVED_2)
+ os.close(CATCHERR_BUFFILE_FD)
+ os.unlink(CATCHERR_BUFFILE_PATH)
+ CATCHERR_BUFFILE_FD = -1
+ CATCHERR_BUFFILE_PATH = None
+ CATCHERR_SAVED_2 = -1
diff --git a/import-layers/yocto-poky/scripts/lib/wic/partition.py b/import-layers/yocto-poky/scripts/lib/wic/partition.py
new file mode 100644
index 000000000..f40d1bc8b
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/partition.py
@@ -0,0 +1,414 @@
+# 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 os
+import tempfile
+import uuid
+
+from wic.utils.oe.misc import msger, parse_sourceparams
+from wic.utils.oe.misc import exec_cmd, exec_native_cmd
+from wic.plugin import pluginmgr
+
+partition_methods = {
+ "do_stage_partition":None,
+ "do_prepare_partition":None,
+ "do_configure_partition":None,
+}
+
+class Partition(object):
+
+ def __init__(self, args, lineno):
+ self.args = args
+ self.active = args.active
+ self.align = args.align
+ self.disk = args.disk
+ self.extra_space = args.extra_space
+ self.fsopts = args.fsopts
+ self.fstype = args.fstype
+ self.label = args.label
+ self.mountpoint = args.mountpoint
+ self.no_table = args.no_table
+ self.overhead_factor = args.overhead_factor
+ self.part_type = args.part_type
+ self.rootfs_dir = args.rootfs_dir
+ self.size = args.size
+ self.source = args.source
+ self.sourceparams = args.sourceparams
+ self.use_uuid = args.use_uuid
+ self.uuid = args.uuid
+ if args.use_uuid and not self.uuid:
+ self.uuid = str(uuid.uuid4())
+
+ 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.
+ """
+ msger.debug("Requested partition size for %s: %d" % \
+ (self.mountpoint, self.size))
+
+ if not self.size:
+ return 0
+
+ requested_blocks = self.size
+
+ msger.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 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 self.sourceparams:
+ self.sourceparams_dict = parse_sourceparams(self.sourceparams)
+
+ if not self.source:
+ if not self.size:
+ msger.error("The %s partition has a size of zero. Please "
+ "specify a non-zero --size for that partition." % \
+ self.mountpoint)
+ if self.fstype and self.fstype == "swap":
+ self.prepare_swap_partition(cr_workdir, oe_builddir,
+ native_sysroot)
+ self.source_file = "%s/fs.%s" % (cr_workdir, self.fstype)
+ elif self.fstype:
+ rootfs = "%s/fs_%s.%s.%s" % (cr_workdir, self.label,
+ self.lineno, self.fstype)
+ if os.path.isfile(rootfs):
+ os.remove(rootfs)
+ for prefix in ("ext", "btrfs", "vfat", "squashfs"):
+ if self.fstype.startswith(prefix):
+ method = getattr(self,
+ "prepare_empty_partition_" + prefix)
+ method(rootfs, oe_builddir, native_sysroot)
+ self.source_file = rootfs
+ break
+ return
+
+ plugins = pluginmgr.get_source_plugins()
+
+ if self.source not in plugins:
+ msger.error("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))
+
+ self._source_methods = pluginmgr.get_source_plugin_methods(\
+ self.source, partition_methods)
+ self._source_methods["do_configure_partition"](self, self.sourceparams_dict,
+ creator, cr_workdir,
+ oe_builddir,
+ bootimg_dir,
+ kernel_dir,
+ native_sysroot)
+ self._source_methods["do_stage_partition"](self, self.sourceparams_dict,
+ creator, cr_workdir,
+ oe_builddir,
+ bootimg_dir, kernel_dir,
+ native_sysroot)
+ self._source_methods["do_prepare_partition"](self, self.sourceparams_dict,
+ creator, cr_workdir,
+ oe_builddir,
+ bootimg_dir, kernel_dir, rootfs_dir,
+ native_sysroot)
+
+ def prepare_rootfs_from_fs_image(self, cr_workdir, oe_builddir,
+ rootfs_dir):
+ """
+ Handle an already-created partition e.g. xxx.ext3
+ """
+ rootfs = oe_builddir
+ du_cmd = "du -Lbks %s" % rootfs
+ out = exec_cmd(du_cmd)
+ rootfs_size = out.split()[0]
+
+ self.size = rootfs_size
+ self.source_file = rootfs
+
+ def prepare_rootfs(self, cr_workdir, oe_builddir, rootfs_dir,
+ native_sysroot):
+ """
+ Prepare content for a rootfs partition i.e. create a partition
+ and fill it from a /rootfs dir.
+
+ Currently handles ext2/3/4, btrfs and vfat.
+ """
+ p_prefix = os.environ.get("PSEUDO_PREFIX", "%s/usr" % native_sysroot)
+ p_localstatedir = os.environ.get("PSEUDO_LOCALSTATEDIR",
+ "%s/../pseudo" % rootfs_dir)
+ 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/usr/bin/pseudo " % native_sysroot
+
+ rootfs = "%s/rootfs_%s.%s.%s" % (cr_workdir, self.label,
+ self.lineno, self.fstype)
+ if os.path.isfile(rootfs):
+ os.remove(rootfs)
+
+ for prefix in ("ext", "btrfs", "vfat", "squashfs"):
+ if self.fstype.startswith(prefix):
+ 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 = out.split()[0]
+
+ break
+
+ 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])
+
+ 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
+
+ msger.debug("Added %d extra blocks to %s to get to %d total blocks" % \
+ (extra_blocks, self.mountpoint, rootfs_size))
+
+ dd_cmd = "dd if=/dev/zero of=%s bs=1024 seek=%d count=0 bs=1k" % \
+ (rootfs, rootfs_size)
+ exec_cmd(dd_cmd)
+
+ extra_imagecmd = "-i 8192"
+
+ label_str = ""
+ if self.label:
+ label_str = "-L %s" % self.label
+
+ mkfs_cmd = "mkfs.%s -F %s %s %s -d %s" % \
+ (self.fstype, extra_imagecmd, rootfs, label_str, rootfs_dir)
+ 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.
+
+ Currently handles ext2/3/4 and btrfs.
+ """
+ du_cmd = "du -ks %s" % rootfs_dir
+ out = exec_cmd(du_cmd)
+ actual_rootfs_size = int(out.split()[0])
+
+ 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
+
+ msger.debug("Added %d extra blocks to %s to get to %d total blocks" % \
+ (extra_blocks, self.mountpoint, rootfs_size))
+
+ dd_cmd = "dd if=/dev/zero of=%s bs=1024 seek=%d count=0 bs=1k" % \
+ (rootfs, rootfs_size)
+ exec_cmd(dd_cmd)
+
+ label_str = ""
+ if self.label:
+ label_str = "-L %s" % self.label
+
+ mkfs_cmd = "mkfs.%s -b %d -r %s %s %s" % \
+ (self.fstype, rootfs_size * 1024, rootfs_dir, label_str, rootfs)
+ exec_native_cmd(mkfs_cmd, native_sysroot, pseudo=pseudo)
+
+ def prepare_rootfs_vfat(self, rootfs, oe_builddir, rootfs_dir,
+ native_sysroot, pseudo):
+ """
+ Prepare content for a vfat rootfs partition.
+ """
+ du_cmd = "du -bks %s" % rootfs_dir
+ out = exec_cmd(du_cmd)
+ blocks = int(out.split()[0])
+
+ extra_blocks = self.get_extra_block_count(blocks)
+ if extra_blocks < self.extra_space:
+ extra_blocks = self.extra_space
+
+ blocks += extra_blocks
+
+ msger.debug("Added %d extra blocks to %s to get to %d total blocks" % \
+ (extra_blocks, self.mountpoint, blocks))
+
+ # Ensure total sectors is an integral number of sectors per
+ # track or mcopy will complain. Sectors are 512 bytes, and we
+ # generate images with 32 sectors per track. This calculation
+ # is done in blocks, thus the mod by 16 instead of 32. Apply
+ # sector count fix only when needed.
+ if blocks % 16 != 0:
+ blocks += (16 - (blocks % 16))
+
+ label_str = "-n boot"
+ if self.label:
+ label_str = "-n %s" % self.label
+
+ dosfs_cmd = "mkdosfs %s -S 512 -C %s %d" % (label_str, rootfs, blocks)
+ 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)
+
+ def prepare_rootfs_squashfs(self, rootfs, oe_builddir, rootfs_dir,
+ native_sysroot, pseudo):
+ """
+ Prepare content for a squashfs rootfs partition.
+ """
+ squashfs_cmd = "mksquashfs %s %s -noappend" % \
+ (rootfs_dir, rootfs)
+ 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.
+ """
+ dd_cmd = "dd if=/dev/zero of=%s bs=1k seek=%d count=0" % \
+ (rootfs, self.size)
+ exec_cmd(dd_cmd)
+
+ extra_imagecmd = "-i 8192"
+
+ label_str = ""
+ if self.label:
+ label_str = "-L %s" % self.label
+
+ mkfs_cmd = "mkfs.%s -F %s %s %s" % \
+ (self.fstype, extra_imagecmd, label_str, rootfs)
+ exec_native_cmd(mkfs_cmd, native_sysroot)
+
+ def prepare_empty_partition_btrfs(self, rootfs, oe_builddir,
+ native_sysroot):
+ """
+ Prepare an empty btrfs partition.
+ """
+ dd_cmd = "dd if=/dev/zero of=%s bs=1k seek=%d count=0" % \
+ (rootfs, self.size)
+ exec_cmd(dd_cmd)
+
+ label_str = ""
+ if self.label:
+ label_str = "-L %s" % self.label
+
+ mkfs_cmd = "mkfs.%s -b %d %s %s" % \
+ (self.fstype, self.size * 1024, label_str, rootfs)
+ exec_native_cmd(mkfs_cmd, native_sysroot)
+
+ def prepare_empty_partition_vfat(self, rootfs, oe_builddir,
+ native_sysroot):
+ """
+ Prepare an empty vfat partition.
+ """
+ blocks = self.size
+
+ label_str = "-n boot"
+ if self.label:
+ label_str = "-n %s" % self.label
+
+ dosfs_cmd = "mkdosfs %s -S 512 -C %s %d" % (label_str, rootfs, blocks)
+ exec_native_cmd(dosfs_cmd, native_sysroot)
+
+ chmod_cmd = "chmod 644 %s" % rootfs
+ exec_cmd(chmod_cmd)
+
+ def prepare_empty_partition_squashfs(self, cr_workdir, oe_builddir,
+ native_sysroot):
+ """
+ Prepare an empty squashfs partition.
+ """
+ msger.warning("Creating of an empty squashfs %s partition was attempted. " \
+ "Proceeding as requested." % self.mountpoint)
+
+ path = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
+ os.path.isfile(path) and os.remove(path)
+
+ # it is not possible to create a squashfs without source data,
+ # thus prepare an empty temp dir that is used as source
+ tmpdir = tempfile.mkdtemp()
+
+ squashfs_cmd = "mksquashfs %s %s -noappend" % \
+ (tmpdir, path)
+ exec_native_cmd(squashfs_cmd, native_sysroot)
+
+ os.rmdir(tmpdir)
+
+ # get the rootfs size in the right units for kickstart (kB)
+ du_cmd = "du -Lbks %s" % path
+ out = exec_cmd(du_cmd)
+ fs_size = out.split()[0]
+
+ self.size = fs_size
+
+ def prepare_swap_partition(self, cr_workdir, oe_builddir, native_sysroot):
+ """
+ Prepare a swap partition.
+ """
+ path = "%s/fs.%s" % (cr_workdir, self.fstype)
+
+ dd_cmd = "dd if=/dev/zero of=%s bs=1k seek=%d count=0" % \
+ (path, self.size)
+ exec_cmd(dd_cmd)
+
+ import uuid
+ label_str = ""
+ if self.label:
+ label_str = "-L %s" % self.label
+ mkswap_cmd = "mkswap %s -U %s %s" % (label_str, str(uuid.uuid1()), path)
+ exec_native_cmd(mkswap_cmd, native_sysroot)
+
diff --git a/import-layers/yocto-poky/scripts/lib/wic/plugin.py b/import-layers/yocto-poky/scripts/lib/wic/plugin.py
new file mode 100644
index 000000000..ccfdfcb93
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/plugin.py
@@ -0,0 +1,150 @@
+#!/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.
+
+import os, sys
+
+from wic import msger
+from wic import pluginbase
+from wic.utils import errors
+from wic.utils.oe.misc import get_bitbake_var
+
+__ALL__ = ['PluginMgr', 'pluginmgr']
+
+PLUGIN_TYPES = ["imager", "source"]
+
+PLUGIN_DIR = "/lib/wic/plugins" # relative to scripts
+SCRIPTS_PLUGIN_DIR = "scripts" + PLUGIN_DIR
+
+class PluginMgr(object):
+ plugin_dirs = {}
+
+ # make the manager class as singleton
+ _instance = None
+ def __new__(cls, *args, **kwargs):
+ if not cls._instance:
+ cls._instance = super(PluginMgr, cls).__new__(cls, *args, **kwargs)
+
+ return cls._instance
+
+ def __init__(self):
+ wic_path = os.path.dirname(__file__)
+ eos = wic_path.find('scripts') + len('scripts')
+ scripts_path = wic_path[:eos]
+ self.scripts_path = scripts_path
+ self.plugin_dir = scripts_path + PLUGIN_DIR
+ self.layers_path = None
+
+ def _build_plugin_dir_list(self, plugin_dir, ptype):
+ if self.layers_path is None:
+ self.layers_path = get_bitbake_var("BBLAYERS")
+ layer_dirs = []
+
+ if self.layers_path is not None:
+ for layer_path in self.layers_path.split():
+ path = os.path.join(layer_path, SCRIPTS_PLUGIN_DIR, ptype)
+ layer_dirs.append(path)
+
+ path = os.path.join(plugin_dir, ptype)
+ layer_dirs.append(path)
+
+ return layer_dirs
+
+ def append_dirs(self, dirs):
+ for path in dirs:
+ self._add_plugindir(path)
+
+ # load all the plugins AGAIN
+ self._load_all()
+
+ def _add_plugindir(self, path):
+ path = os.path.abspath(os.path.expanduser(path))
+
+ if not os.path.isdir(path):
+ return
+
+ if path not in self.plugin_dirs:
+ self.plugin_dirs[path] = False
+ # the value True/False means "loaded"
+
+ def _load_all(self):
+ for (pdir, loaded) in self.plugin_dirs.iteritems():
+ if loaded:
+ continue
+
+ sys.path.insert(0, pdir)
+ for mod in [x[:-3] for x in os.listdir(pdir) if x.endswith(".py")]:
+ if mod and mod != '__init__':
+ if mod in sys.modules:
+ #self.plugin_dirs[pdir] = True
+ msger.warning("Module %s already exists, skip" % mod)
+ else:
+ try:
+ pymod = __import__(mod)
+ self.plugin_dirs[pdir] = True
+ msger.debug("Plugin module %s:%s imported"\
+ % (mod, pymod.__file__))
+ except ImportError, err:
+ msg = 'Failed to load plugin %s/%s: %s' \
+ % (os.path.basename(pdir), mod, err)
+ msger.warning(msg)
+
+ del sys.path[0]
+
+ def get_plugins(self, ptype):
+ """ the return value is dict of name:class pairs """
+
+ if ptype not in PLUGIN_TYPES:
+ raise errors.CreatorError('%s is not valid plugin type' % ptype)
+
+ plugins_dir = self._build_plugin_dir_list(self.plugin_dir, ptype)
+
+ self.append_dirs(plugins_dir)
+
+ return pluginbase.get_plugins(ptype)
+
+ def get_source_plugins(self):
+ """
+ Return list of available source plugins.
+ """
+ plugins_dir = self._build_plugin_dir_list(self.plugin_dir, 'source')
+
+ self.append_dirs(plugins_dir)
+
+ return self.get_plugins('source')
+
+
+ def get_source_plugin_methods(self, source_name, methods):
+ """
+ The methods param is a dict with the method names to find. On
+ return, the dict values will be filled in with pointers to the
+ corresponding methods. If one or more methods are not found,
+ None is returned.
+ """
+ return_methods = None
+ for _source_name, klass in self.get_plugins('source').iteritems():
+ if _source_name == source_name:
+ for _method_name in methods.keys():
+ if not hasattr(klass, _method_name):
+ msger.warning("Unimplemented %s source interface for: %s"\
+ % (_method_name, _source_name))
+ return None
+ func = getattr(klass, _method_name)
+ methods[_method_name] = func
+ return_methods = methods
+ return return_methods
+
+pluginmgr = PluginMgr()
diff --git a/import-layers/yocto-poky/scripts/lib/wic/pluginbase.py b/import-layers/yocto-poky/scripts/lib/wic/pluginbase.py
new file mode 100644
index 000000000..ee8fe95c6
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/pluginbase.py
@@ -0,0 +1,108 @@
+#!/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.
+
+from wic import msger
+
+class _Plugin(object):
+ class __metaclass__(type):
+ def __init__(cls, name, bases, attrs):
+ if not hasattr(cls, 'plugins'):
+ cls.plugins = {}
+
+ elif 'wic_plugin_type' in attrs:
+ if attrs['wic_plugin_type'] not in cls.plugins:
+ cls.plugins[attrs['wic_plugin_type']] = {}
+
+ elif hasattr(cls, 'wic_plugin_type') and 'name' in attrs:
+ cls.plugins[cls.wic_plugin_type][attrs['name']] = cls
+
+ def show_plugins(cls):
+ for cls in cls.plugins[cls.wic_plugin_type]:
+ print cls
+
+ def get_plugins(cls):
+ return cls.plugins
+
+
+class ImagerPlugin(_Plugin):
+ wic_plugin_type = "imager"
+
+
+class SourcePlugin(_Plugin):
+ 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.
+ """
+ msger.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.
+ """
+ msger.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.
+ """
+ msger.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.
+ """
+ msger.debug("SourcePlugin: do_prepare_partition: part: %s" % part)
+
+def get_plugins(typen):
+ plugins = ImagerPlugin.get_plugins()
+ if typen in plugins:
+ return plugins[typen]
+ else:
+ return None
+
+__all__ = ['ImagerPlugin', 'SourcePlugin', 'get_plugins']
diff --git a/import-layers/yocto-poky/scripts/lib/wic/plugins/imager/direct_plugin.py b/import-layers/yocto-poky/scripts/lib/wic/plugins/imager/direct_plugin.py
new file mode 100644
index 000000000..6d3f46cc6
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/plugins/imager/direct_plugin.py
@@ -0,0 +1,102 @@
+# 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>
+#
+
+from wic.utils import errors
+from wic.conf import configmgr
+
+import wic.imager.direct as direct
+from wic.pluginbase import ImagerPlugin
+
+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'
+
+ @classmethod
+ def __rootfs_dir_to_dict(cls, rootfs_dirs):
+ """
+ Gets a string that contain 'connection=dir' splitted by
+ space and return a dict
+ """
+ krootfs_dir = {}
+ for rootfs_dir in rootfs_dirs.split(' '):
+ key, val = rootfs_dir.split('=')
+ krootfs_dir[key] = val
+
+ return krootfs_dir
+
+ @classmethod
+ def do_create(cls, opts, *args):
+ """
+ Create direct image, called from creator as 'direct' cmd
+ """
+ if len(args) != 8:
+ raise errors.Usage("Extra arguments given")
+
+ native_sysroot = args[0]
+ kernel_dir = args[1]
+ bootimg_dir = args[2]
+ rootfs_dir = args[3]
+
+ creatoropts = configmgr.create
+ ksconf = args[4]
+
+ image_output_dir = args[5]
+ oe_builddir = args[6]
+ compressor = args[7]
+
+ krootfs_dir = cls.__rootfs_dir_to_dict(rootfs_dir)
+
+ configmgr._ksconf = ksconf
+
+ creator = direct.DirectImageCreator(oe_builddir,
+ image_output_dir,
+ krootfs_dir,
+ bootimg_dir,
+ kernel_dir,
+ native_sysroot,
+ compressor,
+ creatoropts)
+
+ try:
+ creator.create()
+ creator.assemble()
+ creator.finalize()
+ creator.print_outimage_info()
+
+ except errors.CreatorError:
+ raise
+ finally:
+ creator.cleanup()
+
+ return 0
diff --git a/import-layers/yocto-poky/scripts/lib/wic/plugins/source/bootimg-efi.py b/import-layers/yocto-poky/scripts/lib/wic/plugins/source/bootimg-efi.py
new file mode 100644
index 000000000..a4734c9b3
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/plugins/source/bootimg-efi.py
@@ -0,0 +1,237 @@
+# 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 os
+import shutil
+
+from wic import msger
+from wic.pluginbase import SourcePlugin
+from wic.utils.misc import get_custom_config
+from wic.utils.oe.misc import exec_cmd, exec_native_cmd, get_bitbake_var, \
+ BOOTDD_EXTRA_SPACE
+
+class BootimgEFIPlugin(SourcePlugin):
+ """
+ Create EFI boot partition.
+ This plugin supports GRUB 2 and gummiboot bootloaders.
+ """
+
+ name = 'bootimg-efi'
+
+ @classmethod
+ def do_configure_grubefi(cls, hdddir, 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
+ msger.debug("Using custom configuration file "
+ "%s for grub.cfg" % configfile)
+ else:
+ msger.error("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"
+
+ msger.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_gummiboot(cls, hdddir, creator, cr_workdir):
+ """
+ Create loader-specific (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
+
+ msger.debug("Writing gummiboot 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 gummiboot
+ boot_conf = custom_cfg
+ msger.debug("Using custom configuration file "
+ "%s for gummiboots's boot.conf" % configfile)
+ else:
+ msger.error("configfile is specified but failed to "
+ "get it from %s." % configfile)
+
+ if not custom_cfg:
+ # Create gummiboot 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)
+
+ msger.debug("Writing gummiboot 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(hdddir, creator, cr_workdir)
+ elif source_params['loader'] == 'gummiboot':
+ cls.do_configure_gummiboot(hdddir, creator, cr_workdir)
+ else:
+ msger.error("unrecognized bootimg-efi loader: %s" % source_params['loader'])
+ except KeyError:
+ msger.error("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 bootimg_dir:
+ bootimg_dir = get_bitbake_var("HDDDIR")
+ if not bootimg_dir:
+ msger.error("Couldn't find HDDDIR, exiting\n")
+ # just so the result notes display it
+ creator.set_bootimg_dir(bootimg_dir)
+
+ 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)
+ cp_cmd = "cp %s/EFI/BOOT/* %s/EFI/BOOT" % (bootimg_dir, hdddir)
+ 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'] == 'gummiboot':
+ cp_cmd = "cp %s/EFI/BOOT/* %s/EFI/BOOT" % (bootimg_dir, hdddir)
+ exec_cmd(cp_cmd, True)
+ else:
+ msger.error("unrecognized bootimg-efi loader: %s" % source_params['loader'])
+ except KeyError:
+ msger.error("bootimg-efi requires a loader, none specified")
+
+ 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
+
+ msger.debug("Added %d extra blocks to %s to get to %d total blocks" % \
+ (extra_blocks, part.mountpoint, blocks))
+
+ # Ensure total sectors is an integral number of sectors per
+ # track or mcopy will complain. Sectors are 512 bytes, and we
+ # generate images with 32 sectors per track. This calculation is
+ # done in blocks, thus the mod by 16 instead of 32.
+ blocks += (16 - (blocks % 16))
+
+ # dosfs image, created by mkdosfs
+ bootimg = "%s/boot.img" % cr_workdir
+
+ dosfs_cmd = "mkdosfs -n efi -C %s %d" % (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 = bootimg_size
+ part.source_file = bootimg
diff --git a/import-layers/yocto-poky/scripts/lib/wic/plugins/source/bootimg-partition.py b/import-layers/yocto-poky/scripts/lib/wic/plugins/source/bootimg-partition.py
new file mode 100644
index 000000000..b76c1211a
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/plugins/source/bootimg-partition.py
@@ -0,0 +1,140 @@
+# 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 os
+import re
+
+from wic import msger
+from wic.pluginbase import SourcePlugin
+from wic.utils.oe.misc import exec_cmd, get_bitbake_var
+from glob import glob
+
+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_install_disk(cls, disk, disk_name, cr, workdir, oe_builddir,
+ bootimg_dir, kernel_dir, native_sysroot):
+ """
+ Called after all partitions have been prepared and assembled into a
+ disk image. Do nothing.
+ """
+ pass
+
+ @classmethod
+ def do_configure_partition(cls, part, source_params, cr, cr_workdir,
+ oe_builddir, bootimg_dir, kernel_dir,
+ native_sysroot):
+ """
+ Called before do_prepare_partition(). Possibly prepare
+ configuration files of some sort.
+
+ """
+ pass
+
+ @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" % cr_workdir
+ install_cmd = "install -d %s" % hdddir
+ exec_cmd(install_cmd)
+
+ if not bootimg_dir:
+ bootimg_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
+ if not bootimg_dir:
+ msger.error("Couldn't find DEPLOY_DIR_IMAGE, exiting\n")
+
+ msger.debug('Bootimg dir: %s' % bootimg_dir)
+
+ boot_files = get_bitbake_var("IMAGE_BOOT_FILES")
+
+ if not boot_files:
+ msger.error('No boot files defined, IMAGE_BOOT_FILES unset')
+
+ msger.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]:
+ msger.error('Malformed boot file entry: %s' % (src_entry))
+ else:
+ dst_entry = (src_entry, src_entry)
+
+ msger.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(bootimg_dir, src))
+
+ msger.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(bootimg_dir, src),
+ os.path.join(hdddir, dst))]
+
+ for task in install_task:
+ src_path, dst_path = task
+ msger.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)
+
+ msger.debug('Prepare boot partition using rootfs in %s' % (hdddir))
+ part.prepare_rootfs(cr_workdir, oe_builddir, hdddir,
+ native_sysroot)
+
diff --git a/import-layers/yocto-poky/scripts/lib/wic/plugins/source/bootimg-pcbios.py b/import-layers/yocto-poky/scripts/lib/wic/plugins/source/bootimg-pcbios.py
new file mode 100644
index 000000000..5b719bf3b
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/plugins/source/bootimg-pcbios.py
@@ -0,0 +1,210 @@
+# 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 os
+
+from wic.utils.errors import ImageError
+from wic import msger
+from wic.utils import runner
+from wic.utils.misc import get_custom_config
+from wic.pluginbase import SourcePlugin
+from wic.utils.oe.misc import exec_cmd, exec_native_cmd, \
+ get_bitbake_var, BOOTDD_EXTRA_SPACE
+
+class BootimgPcbiosPlugin(SourcePlugin):
+ """
+ Create MBR boot partition and install syslinux on it.
+ """
+
+ name = 'bootimg-pcbios'
+
+ @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.
+ """
+ mbrfile = "%s/syslinux/" % bootimg_dir
+ if creator.ptable_format == 'msdos':
+ mbrfile += "mbr.bin"
+ elif creator.ptable_format == 'gpt':
+ mbrfile += "gptmbr.bin"
+ else:
+ msger.error("Unsupported partition table: %s" % creator.ptable_format)
+
+ if not os.path.exists(mbrfile):
+ msger.error("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")
+ msger.debug("Installing MBR on disk %s as %s with size %s bytes" \
+ % (disk_name, full_path, disk['min_size']))
+
+ rcode = runner.show(['dd', 'if=%s' % mbrfile,
+ 'of=%s' % full_path, 'conv=notrunc'])
+ if rcode != 0:
+ raise ImageError("Unable to set MBR to %s" % full_path)
+
+ @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
+ msger.debug("Using custom configuration file "
+ "%s for syslinux.cfg" % bootloader.configfile)
+ else:
+ msger.error("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)
+
+ msger.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.
+ """
+ def _has_syslinux(dirname):
+ if dirname:
+ syslinux = "%s/syslinux" % dirname
+ if os.path.exists(syslinux):
+ return True
+ return False
+
+ if not _has_syslinux(bootimg_dir):
+ bootimg_dir = get_bitbake_var("STAGING_DATADIR")
+ if not bootimg_dir:
+ msger.error("Couldn't find STAGING_DATADIR, exiting\n")
+ if not _has_syslinux(bootimg_dir):
+ msger.error("Please build syslinux first\n")
+ # just so the result notes display it
+ creator.set_bootimg_dir(bootimg_dir)
+
+ staging_kernel_dir = kernel_dir
+
+ hdddir = "%s/hdd/boot" % cr_workdir
+
+ install_cmd = "install -m 0644 %s/bzImage %s/vmlinuz" \
+ % (staging_kernel_dir, hdddir)
+ exec_cmd(install_cmd)
+
+ install_cmd = "install -m 444 %s/syslinux/ldlinux.sys %s/ldlinux.sys" \
+ % (bootimg_dir, hdddir)
+ 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
+
+ msger.debug("Added %d extra blocks to %s to get to %d total blocks" % \
+ (extra_blocks, part.mountpoint, blocks))
+
+ # Ensure total sectors is an integral number of sectors per
+ # track or mcopy will complain. Sectors are 512 bytes, and we
+ # generate images with 32 sectors per track. This calculation is
+ # done in blocks, thus the mod by 16 instead of 32.
+ blocks += (16 - (blocks % 16))
+
+ # dosfs image, created by mkdosfs
+ bootimg = "%s/boot.img" % cr_workdir
+
+ dosfs_cmd = "mkdosfs -n boot -S 512 -C %s %d" % (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(out.split()[0])
+ part.source_file = bootimg
+
+
diff --git a/import-layers/yocto-poky/scripts/lib/wic/plugins/source/fsimage.py b/import-layers/yocto-poky/scripts/lib/wic/plugins/source/fsimage.py
new file mode 100644
index 000000000..f894e8936
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/plugins/source/fsimage.py
@@ -0,0 +1,73 @@
+# 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 os
+
+from wic import msger
+from wic.pluginbase import SourcePlugin
+from wic.utils.oe.misc import get_bitbake_var
+
+class FSImagePlugin(SourcePlugin):
+ """
+ Add an already existing filesystem image to the partition layout.
+ """
+
+ name = 'fsimage'
+
+ @classmethod
+ def do_install_disk(cls, disk, disk_name, cr, workdir, oe_builddir,
+ bootimg_dir, kernel_dir, native_sysroot):
+ """
+ Called after all partitions have been prepared and assembled into a
+ disk image. Do nothing.
+ """
+ pass
+
+ @classmethod
+ def do_configure_partition(cls, part, source_params, cr, cr_workdir,
+ oe_builddir, bootimg_dir, kernel_dir,
+ native_sysroot):
+ """
+ Called before do_prepare_partition(). Possibly prepare
+ configuration files of some sort.
+ """
+ pass
+
+ @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 bootimg_dir:
+ bootimg_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
+ if not bootimg_dir:
+ msger.error("Couldn't find DEPLOY_DIR_IMAGE, exiting\n")
+
+ msger.debug('Bootimg dir: %s' % bootimg_dir)
+
+ if 'file' not in source_params:
+ msger.error("No file specified\n")
+ return
+
+ src = os.path.join(bootimg_dir, source_params['file'])
+
+
+ msger.debug('Preparing partition using image %s' % (src))
+ part.prepare_rootfs_from_fs_image(cr_workdir, src, "")
diff --git a/import-layers/yocto-poky/scripts/lib/wic/plugins/source/isoimage-isohybrid.py b/import-layers/yocto-poky/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
new file mode 100644
index 000000000..bc9928314
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
@@ -0,0 +1,539 @@
+# 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 os
+import re
+import shutil
+import glob
+
+from wic import msger
+from wic.pluginbase import SourcePlugin
+from wic.utils.oe.misc import exec_cmd, exec_native_cmd, get_bitbake_var
+
+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
+
+ msger.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, cr_workdir):
+ """
+ Create loader-specific (grub-efi) config
+ """
+ splash = os.path.join(cr_workdir, "/EFI/boot/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
+
+ msger.debug("Writing grubefi config %s/EFI/BOOT/grub.cfg" \
+ % cr_workdir)
+ with open("%s/EFI/BOOT/grub.cfg" % cr_workdir, "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")
+ if not initrd:
+ initrd_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
+ if not initrd_dir:
+ msger.error("Couldn't find DEPLOY_DIR_IMAGE, exiting.\n")
+
+ image_name = get_bitbake_var("IMAGE_BASENAME")
+ if not image_name:
+ msger.error("Couldn't find IMAGE_BASENAME, exiting.\n")
+
+ image_type = get_bitbake_var("INITRAMFS_FSTYPES")
+ if not image_type:
+ msger.error("Couldn't find INITRAMFS_FSTYPES, exiting.\n")
+
+ machine_arch = get_bitbake_var("MACHINE_ARCH")
+ if not machine_arch:
+ msger.error("Couldn't find MACHINE_ARCH, exiting.\n")
+
+ initrd = glob.glob('%s/%s*%s.%s' % (initrd_dir, image_name, machine_arch, image_type))[0]
+
+ if 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:
+ msger.error("Couldn't find or build initrd, exiting.\n")
+
+ 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_stage_partition(cls, part, source_params, creator, cr_workdir,
+ oe_builddir, bootimg_dir, kernel_dir,
+ native_sysroot):
+ """
+ Special content staging called before do_prepare_partition().
+ It cheks if all necessary tools are available, if not
+ tries to instal them.
+ """
+ # Make sure parted is available in native sysroot
+ if not os.path.isfile("%s/usr/sbin/parted" % native_sysroot):
+ msger.info("Building parted-native...\n")
+ exec_cmd("bitbake parted-native")
+
+ # Make sure mkfs.ext2/3/4 is available in native sysroot
+ if not os.path.isfile("%s/sbin/mkfs.ext2" % native_sysroot):
+ msger.info("Building e2fsprogs-native...\n")
+ exec_cmd("bitbake e2fsprogs-native")
+
+ # Make sure syslinux is available in sysroot and in native sysroot
+ syslinux_dir = get_bitbake_var("STAGING_DATADIR")
+ if not syslinux_dir:
+ msger.error("Couldn't find STAGING_DATADIR, exiting.\n")
+ if not os.path.exists("%s/syslinux" % syslinux_dir):
+ msger.info("Building syslinux...\n")
+ exec_cmd("bitbake syslinux")
+ if not os.path.exists("%s/syslinux" % syslinux_dir):
+ msger.error("Please build syslinux first\n")
+
+ # Make sure syslinux is available in native sysroot
+ if not os.path.exists("%s/usr/bin/syslinux" % native_sysroot):
+ msger.info("Building syslinux-native...\n")
+ exec_cmd("bitbake syslinux-native")
+
+ #Make sure mkisofs is available in native sysroot
+ if not os.path.isfile("%s/usr/bin/mkisofs" % native_sysroot):
+ msger.info("Building cdrtools-native...\n")
+ exec_cmd("bitbake cdrtools-native")
+
+ # Make sure mkfs.vfat is available in native sysroot
+ if not os.path.isfile("%s/sbin/mkfs.vfat" % native_sysroot):
+ msger.info("Building dosfstools-native...\n")
+ exec_cmd("bitbake dosfstools-native")
+
+ # Make sure mtools is available in native sysroot
+ if not os.path.isfile("%s/usr/bin/mcopy" % native_sysroot):
+ msger.info("Building mtools-native...\n")
+ exec_cmd("bitbake mtools-native")
+
+ @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(cr_workdir):
+ shutil.rmtree(cr_workdir)
+
+ install_cmd = "install -d %s " % isodir
+ exec_cmd(install_cmd)
+
+ # Overwrite the name of the created image
+ msger.debug("%s" % source_params)
+ if 'image_name' in source_params and \
+ source_params['image_name'].strip():
+ creator.name = source_params['image_name'].strip()
+ msger.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:
+ msger.error("Couldn't find --rootfs-dir, exiting.\n")
+ 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:
+ msg = "Couldn't find --rootfs-dir=%s connection "
+ msg += "or it is not a valid path, exiting.\n"
+ msger.error(msg % part.rootfs_dir)
+
+ if not os.path.isdir(rootfs_dir):
+ rootfs_dir = get_bitbake_var("IMAGE_ROOTFS")
+ if not os.path.isdir(rootfs_dir):
+ msger.error("Couldn't find IMAGE_ROOTFS, exiting.\n")
+
+ part.rootfs_dir = rootfs_dir
+
+ # Prepare rootfs.img
+ hdd_dir = get_bitbake_var("HDDDIR")
+ img_iso_dir = get_bitbake_var("ISODIR")
+
+ rootfs_img = "%s/rootfs.img" % hdd_dir
+ if not os.path.isfile(rootfs_img):
+ 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)
+
+ # Prepare initial ramdisk
+ initrd = "%s/initrd" % hdd_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:
+ if source_params['loader'] == 'grub-efi':
+ # Builds grub.cfg if ISODIR didn't exist or
+ # didn't contains grub.cfg
+ bootimg_dir = img_iso_dir
+ if not os.path.exists("%s/EFI/BOOT" % bootimg_dir):
+ bootimg_dir = "%s/bootimg" % cr_workdir
+ if os.path.exists(bootimg_dir):
+ shutil.rmtree(bootimg_dir)
+ install_cmd = "install -d %s/EFI/BOOT" % bootimg_dir
+ exec_cmd(install_cmd)
+
+ if not os.path.isfile("%s/EFI/BOOT/boot.cfg" % bootimg_dir):
+ cls.do_configure_grubefi(part, creator, bootimg_dir)
+
+ # 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:
+ msger.error("Coludn't find target architecture\n")
+
+ if re.match("x86_64", target_arch):
+ grub_target = 'x86_64-efi'
+ grub_image = "bootx64.efi"
+ elif re.match('i.86', target_arch):
+ grub_target = 'i386-efi'
+ grub_image = "bootia32.efi"
+ else:
+ msger.error("grub-efi is incompatible with target %s\n" \
+ % target_arch)
+
+ if not os.path.isfile("%s/EFI/BOOT/%s" \
+ % (bootimg_dir, grub_image)):
+ grub_path = get_bitbake_var("STAGING_LIBDIR")
+ if not grub_path:
+ msger.error("Couldn't find STAGING_LIBDIR, exiting.\n")
+
+ grub_core = "%s/grub/%s" % (grub_path, grub_target)
+ if not os.path.exists(grub_core):
+ msger.info("Building grub-efi...\n")
+ exec_cmd("bitbake grub-efi")
+ if not os.path.exists(grub_core):
+ msger.error("Please build grub-efi first\n")
+
+ grub_cmd = "grub-mkimage -p '/EFI/BOOT' "
+ grub_cmd += "-d %s " % grub_core
+ grub_cmd += "-O %s -o %s/EFI/BOOT/%s " \
+ % (grub_target, bootimg_dir, grub_image)
+ grub_cmd += "part_gpt part_msdos ntfs ntfscomp fat ext2 "
+ grub_cmd += "normal chain boot configfile linux multiboot "
+ grub_cmd += "search efi_gop efi_uga font gfxterm gfxmenu "
+ grub_cmd += "terminal minicmd test iorw loadenv echo help "
+ grub_cmd += "reboot serial terminfo iso9660 loopback tar "
+ grub_cmd += "memdisk ls search_fs_uuid udf btrfs xfs lvm "
+ grub_cmd += "reiserfs ata "
+ exec_native_cmd(grub_cmd, native_sysroot)
+
+ else:
+ # TODO: insert gummiboot stuff
+ msger.error("unrecognized bootimg-efi loader: %s" \
+ % source_params['loader'])
+ except KeyError:
+ msger.error("bootimg-efi requires a loader, none specified")
+
+ if os.path.exists("%s/EFI/BOOT" % isodir):
+ shutil.rmtree("%s/EFI/BOOT" % isodir)
+
+ shutil.copytree(bootimg_dir+"/EFI/BOOT", isodir+"/EFI/BOOT")
+
+ # If exists, remove cr_workdir/bootimg temporary folder
+ if os.path.exists("%s/bootimg" % cr_workdir):
+ shutil.rmtree("%s/bootimg" % cr_workdir)
+
+ # 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
+ msg = "Added 100 extra blocks to %s to get to %d total blocks" \
+ % (part.mountpoint, blocks)
+ msger.debug(msg)
+
+ # Ensure total sectors is an integral number of sectors per
+ # track or mcopy will complain. Sectors are 512 bytes, and we
+ # generate images with 32 sectors per track. This calculation is
+ # done in blocks, thus the mod by 16 instead of 32.
+ blocks += (16 - (blocks % 16))
+
+ # 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:
+ msger.error("Couldn't find STAGING_DATADIR, exiting.\n")
+
+ 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
+
+ msger.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.
+ """
+
+ full_path = creator._full_path(workdir, disk_name, "direct")
+ iso_img = "%s.p1" % full_path
+ full_path_iso = creator._full_path(workdir, disk_name, "iso")
+
+ isohybrid_cmd = "isohybrid -u %s" % iso_img
+ msger.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.
+ msger.debug("Replaceing the image created by direct plugin\n")
+ os.remove(full_path)
+ shutil.copy2(iso_img, full_path_iso)
+ shutil.copy2(full_path_iso, full_path)
+
+ # Remove temporary ISO file
+ os.remove(iso_img)
diff --git a/import-layers/yocto-poky/scripts/lib/wic/plugins/source/rawcopy.py b/import-layers/yocto-poky/scripts/lib/wic/plugins/source/rawcopy.py
new file mode 100644
index 000000000..0472f536b
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/plugins/source/rawcopy.py
@@ -0,0 +1,88 @@
+# 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 os
+
+from wic import msger
+from wic.pluginbase import SourcePlugin
+from wic.utils.oe.misc import exec_cmd, get_bitbake_var
+
+class RawCopyPlugin(SourcePlugin):
+ """
+ Populate partition content from raw image file.
+ """
+
+ name = 'rawcopy'
+
+ @classmethod
+ def do_install_disk(cls, disk, disk_name, cr, workdir, oe_builddir,
+ bootimg_dir, kernel_dir, native_sysroot):
+ """
+ Called after all partitions have been prepared and assembled into a
+ disk image. Do nothing.
+ """
+ pass
+
+ @classmethod
+ def do_configure_partition(cls, part, source_params, cr, cr_workdir,
+ oe_builddir, bootimg_dir, kernel_dir,
+ native_sysroot):
+ """
+ Called before do_prepare_partition(). Possibly prepare
+ configuration files of some sort.
+ """
+ pass
+
+ @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 bootimg_dir:
+ bootimg_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
+ if not bootimg_dir:
+ msger.error("Couldn't find DEPLOY_DIR_IMAGE, exiting\n")
+
+ msger.debug('Bootimg dir: %s' % bootimg_dir)
+
+ if 'file' not in source_params:
+ msger.error("No file specified\n")
+ return
+
+ src = os.path.join(bootimg_dir, source_params['file'])
+ dst = os.path.join(cr_workdir, source_params['file'])
+
+ if 'skip' in source_params:
+ dd_cmd = "dd if=%s of=%s ibs=%s skip=1 conv=notrunc" % \
+ (src, dst, source_params['skip'])
+ else:
+ dd_cmd = "cp %s %s" % (src, dst)
+ exec_cmd(dd_cmd)
+
+ # get the size in the right units for kickstart (kB)
+ du_cmd = "du -Lbks %s" % dst
+ out = exec_cmd(du_cmd)
+ filesize = out.split()[0]
+
+ if int(filesize) > int(part.size):
+ part.size = filesize
+
+ part.source_file = dst
+
diff --git a/import-layers/yocto-poky/scripts/lib/wic/plugins/source/rootfs.py b/import-layers/yocto-poky/scripts/lib/wic/plugins/source/rootfs.py
new file mode 100644
index 000000000..425da8b22
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/plugins/source/rootfs.py
@@ -0,0 +1,83 @@
+# 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 os
+
+from wic import msger
+from wic.pluginbase import SourcePlugin
+from wic.utils.oe.misc import get_bitbake_var
+
+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 rootfs_dir
+
+ image_rootfs_dir = get_bitbake_var("IMAGE_ROOTFS", rootfs_dir)
+ if not os.path.isdir(image_rootfs_dir):
+ msg = "No valid artifact IMAGE_ROOTFS from image named"
+ msg += " %s has been found at %s, exiting.\n" % \
+ (rootfs_dir, image_rootfs_dir)
+ msger.error(msg)
+
+ return 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:
+ msg = "Couldn't find --rootfs-dir, exiting"
+ msger.error(msg)
+ 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:
+ msg = "Couldn't find --rootfs-dir=%s connection"
+ msg += " or it is not a valid path, exiting"
+ msger.error(msg % part.rootfs_dir)
+
+ real_rootfs_dir = cls.__get_rootfs_dir(rootfs_dir)
+
+ part.rootfs_dir = real_rootfs_dir
+ part.prepare_rootfs(cr_workdir, oe_builddir, real_rootfs_dir, native_sysroot)
+
diff --git a/import-layers/yocto-poky/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py b/import-layers/yocto-poky/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py
new file mode 100644
index 000000000..3d60e6f0f
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py
@@ -0,0 +1,177 @@
+# 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 distribute 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 mo details.
+#
+# 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
+# Adrian Freihofer <adrian.freihofer (at] neratec.com>
+#
+
+import os
+from wic import msger
+from wic.utils import syslinux
+from wic.utils import runner
+from wic.utils.oe import misc
+from wic.utils.errors import ImageError
+from wic.pluginbase import SourcePlugin
+
+
+# pylint: disable=no-init
+class RootfsPlugin(SourcePlugin):
+ """
+ Create root partition and install syslinux bootloader
+
+ This plugin creates a disk image containing a bootable root partition with
+ syslinux installed. The filesystem is ext2/3/4, no extra boot partition is
+ required.
+
+ Example kickstart file:
+ part / --source rootfs-pcbios-ext --ondisk sda --fstype=ext4 --label rootfs --align 1024
+ bootloader --source rootfs-pcbios-ext --timeout=0 --append="rootwait rootfstype=ext4"
+
+ The first line generates a root file system including a syslinux.cfg file
+ The "--source rootfs-pcbios-ext" in the second line triggers the installation
+ of ldlinux.sys into the image.
+ """
+
+ name = 'rootfs-pcbios-ext'
+
+ @staticmethod
+ def _get_rootfs_dir(rootfs_dir):
+ """
+ Find rootfs pseudo dir
+
+ If rootfs_dir is a directory consider it as rootfs directory.
+ Otherwise ask bitbake about the IMAGE_ROOTFS directory.
+ """
+ if os.path.isdir(rootfs_dir):
+ return rootfs_dir
+
+ image_rootfs_dir = misc.get_bitbake_var("IMAGE_ROOTFS", rootfs_dir)
+ if not os.path.isdir(image_rootfs_dir):
+ msg = "No valid artifact IMAGE_ROOTFS from image named"
+ msg += " %s has been found at %s, exiting.\n" % \
+ (rootfs_dir, image_rootfs_dir)
+ msger.error(msg)
+
+ return image_rootfs_dir
+
+ # pylint: disable=unused-argument
+ @classmethod
+ def do_configure_partition(cls, part, source_params, image_creator,
+ image_creator_workdir, oe_builddir, bootimg_dir,
+ kernel_dir, native_sysroot):
+ """
+ Creates syslinux config in rootfs directory
+
+ Called before do_prepare_partition()
+ """
+ bootloader = image_creator.ks.bootloader
+
+ syslinux_conf = ""
+ syslinux_conf += "PROMPT 0\n"
+
+ syslinux_conf += "TIMEOUT " + str(bootloader.timeout) + "\n"
+ syslinux_conf += "ALLOWOPTIONS 1\n"
+
+ # Derive SERIAL... line from from kernel boot parameters
+ syslinux_conf += syslinux.serial_console_form_kargs(options) + "\n"
+
+ syslinux_conf += "DEFAULT linux\n"
+ syslinux_conf += "LABEL linux\n"
+ syslinux_conf += " KERNEL /boot/bzImage\n"
+
+ syslinux_conf += " APPEND label=boot root=%s %s\n" % \
+ (image_creator.rootdev, bootloader.append)
+
+ syslinux_cfg = os.path.join(image_creator.rootfs_dir['ROOTFS_DIR'], "boot", "syslinux.cfg")
+ msger.debug("Writing syslinux config %s" % syslinux_cfg)
+ with open(syslinux_cfg, "w") as cfg:
+ cfg.write(syslinux_conf)
+
+ @classmethod
+ def do_prepare_partition(cls, part, source_params, image_creator,
+ image_creator_workdir, oe_builddir, bootimg_dir,
+ kernel_dir, krootfs_dir, native_sysroot):
+ """
+ Creates partition out of rootfs directory
+
+ Prepare content for a rootfs partition i.e. create a partition
+ and fill it from a /rootfs dir.
+ Install syslinux bootloader into root partition image file
+ """
+ def is_exe(exepath):
+ """Verify exepath is an executable file"""
+ return os.path.isfile(exepath) and os.access(exepath, os.X_OK)
+
+ # Make sure syslinux-nomtools is available in native sysroot or fail
+ native_syslinux_nomtools = os.path.join(native_sysroot, "usr/bin/syslinux-nomtools")
+ if not is_exe(native_syslinux_nomtools):
+ msger.info("building syslinux-native...")
+ misc.exec_cmd("bitbake syslinux-native")
+ if not is_exe(native_syslinux_nomtools):
+ msger.error("Couldn't find syslinux-nomtools (%s), exiting\n" %
+ native_syslinux_nomtools)
+
+ if part.rootfs is None:
+ if 'ROOTFS_DIR' not in krootfs_dir:
+ msger.error("Couldn't find --rootfs-dir, exiting")
+ rootfs_dir = krootfs_dir['ROOTFS_DIR']
+ else:
+ if part.rootfs in krootfs_dir:
+ rootfs_dir = krootfs_dir[part.rootfs]
+ elif part.rootfs:
+ rootfs_dir = part.rootfs
+ else:
+ msg = "Couldn't find --rootfs-dir=%s connection"
+ msg += " or it is not a valid path, exiting"
+ msger.error(msg % part.rootfs)
+
+ real_rootfs_dir = cls._get_rootfs_dir(rootfs_dir)
+
+ part.rootfs_dir = real_rootfs_dir
+ part.prepare_rootfs(image_creator_workdir, oe_builddir, real_rootfs_dir, native_sysroot)
+
+ # install syslinux into rootfs partition
+ syslinux_cmd = "syslinux-nomtools -d /boot -i %s" % part.source_file
+ misc.exec_native_cmd(syslinux_cmd, native_sysroot)
+
+ @classmethod
+ def do_install_disk(cls, disk, disk_name, image_creator, workdir, oe_builddir,
+ bootimg_dir, kernel_dir, native_sysroot):
+ """
+ Assemble partitions to disk image
+
+ Called after all partitions have been prepared and assembled into a
+ disk image. In this case, we install the MBR.
+ """
+ mbrfile = os.path.join(native_sysroot, "usr/share/syslinux/")
+ if image_creator.ptable_format == 'msdos':
+ mbrfile += "mbr.bin"
+ elif image_creator.ptable_format == 'gpt':
+ mbrfile += "gptmbr.bin"
+ else:
+ msger.error("Unsupported partition table: %s" % \
+ image_creator.ptable_format)
+
+ if not os.path.exists(mbrfile):
+ msger.error("Couldn't find %s. Has syslinux-native been baked?" % mbrfile)
+
+ full_path = disk['disk'].device
+ msger.debug("Installing MBR on disk %s as %s with size %s bytes" \
+ % (disk_name, full_path, disk['min_size']))
+
+ ret_code = runner.show(['dd', 'if=%s' % mbrfile, 'of=%s' % full_path, 'conv=notrunc'])
+ if ret_code != 0:
+ raise ImageError("Unable to set MBR to %s" % full_path)
diff --git a/import-layers/yocto-poky/scripts/lib/wic/test b/import-layers/yocto-poky/scripts/lib/wic/test
new file mode 100644
index 000000000..9daeafb98
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/test
@@ -0,0 +1 @@
+test
diff --git a/import-layers/yocto-poky/scripts/lib/wic/utils/__init__.py b/import-layers/yocto-poky/scripts/lib/wic/utils/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/utils/__init__.py
diff --git a/import-layers/yocto-poky/scripts/lib/wic/utils/errors.py b/import-layers/yocto-poky/scripts/lib/wic/utils/errors.py
new file mode 100644
index 000000000..d1b514dd9
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/utils/errors.py
@@ -0,0 +1,29 @@
+#!/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
+
+class CreatorError(WicError):
+ pass
+
+class Usage(WicError):
+ pass
+
+class ImageError(WicError):
+ pass
diff --git a/import-layers/yocto-poky/scripts/lib/wic/utils/fs_related.py b/import-layers/yocto-poky/scripts/lib/wic/utils/fs_related.py
new file mode 100644
index 000000000..2e74461a4
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/utils/fs_related.py
@@ -0,0 +1,84 @@
+#!/usr/bin/env python -tt
+#
+# Copyright (c) 2007, Red Hat, Inc.
+# Copyright (c) 2009, 2010, 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.
+
+from __future__ import with_statement
+import os
+import errno
+
+from wic.utils.oe.misc import exec_cmd
+
+def makedirs(dirname):
+ """A version of os.makedirs() that doesn't throw an
+ exception if the leaf directory already exists.
+ """
+ try:
+ os.makedirs(dirname)
+ except OSError, err:
+ if err.errno != errno.EEXIST:
+ raise
+
+class Disk:
+ """
+ Generic base object for a disk.
+ """
+ def __init__(self, size, device=None):
+ self._device = device
+ self._size = size
+
+ def create(self):
+ pass
+
+ def cleanup(self):
+ pass
+
+ def get_device(self):
+ return self._device
+ def set_device(self, path):
+ self._device = path
+ device = property(get_device, set_device)
+
+ def get_size(self):
+ return self._size
+ size = property(get_size)
+
+
+class DiskImage(Disk):
+ """
+ A Disk backed by a file.
+ """
+ def __init__(self, image_file, size):
+ Disk.__init__(self, size)
+ self.image_file = image_file
+
+ def exists(self):
+ return os.path.exists(self.image_file)
+
+ def create(self):
+ if self.device is not None:
+ return
+
+ blocks = self.size / 1024
+ if self.size - blocks * 1024:
+ blocks += 1
+
+ # create disk image
+ dd_cmd = "dd if=/dev/zero of=%s bs=1024 seek=%d count=1" % \
+ (self.image_file, blocks)
+ exec_cmd(dd_cmd)
+
+ self.device = self.image_file
diff --git a/import-layers/yocto-poky/scripts/lib/wic/utils/misc.py b/import-layers/yocto-poky/scripts/lib/wic/utils/misc.py
new file mode 100644
index 000000000..1415ae906
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/utils/misc.py
@@ -0,0 +1,95 @@
+#!/usr/bin/env python -tt
+#
+# Copyright (c) 2010, 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.
+
+import os
+import time
+import wic.engine
+
+def build_name(kscfg, release=None, prefix=None, suffix=None):
+ """Construct and return an image name string.
+
+ This is a utility function to help create sensible name and fslabel
+ strings. The name is constructed using the sans-prefix-and-extension
+ kickstart filename and the supplied prefix and suffix.
+
+ kscfg -- a path to a kickstart file
+ release -- a replacement to suffix for image release
+ prefix -- a prefix to prepend to the name; defaults to None, which causes
+ no prefix to be used
+ suffix -- a suffix to append to the name; defaults to None, which causes
+ a YYYYMMDDHHMM suffix to be used
+
+ Note, if maxlen is less then the len(suffix), you get to keep both pieces.
+
+ """
+ name = os.path.basename(kscfg)
+ idx = name.rfind('.')
+ if idx >= 0:
+ name = name[:idx]
+
+ if release is not None:
+ suffix = ""
+ if prefix is None:
+ prefix = ""
+ if suffix is None:
+ suffix = time.strftime("%Y%m%d%H%M")
+
+ if name.startswith(prefix):
+ name = name[len(prefix):]
+
+ prefix = "%s-" % prefix if prefix else ""
+ suffix = "-%s" % suffix if suffix else ""
+
+ ret = prefix + name + suffix
+
+ return ret
+
+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 = wic.engine.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.
+ """
+ scripts_path = os.path.abspath(os.path.dirname(__file__))
+ # Get the scripts path of poky
+ for x in range(0, 3):
+ scripts_path = os.path.dirname(scripts_path)
+
+ cfg_file = find_canned(scripts_path, boot_file)
+ if cfg_file:
+ with open(cfg_file, "r") as f:
+ config = f.read()
+ return config
+
+ return None
diff --git a/import-layers/yocto-poky/scripts/lib/wic/utils/oe/__init__.py b/import-layers/yocto-poky/scripts/lib/wic/utils/oe/__init__.py
new file mode 100644
index 000000000..0a81575a7
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/utils/oe/__init__.py
@@ -0,0 +1,22 @@
+#
+# OpenEmbedded wic utils library
+#
+# 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.
+#
+# AUTHORS
+# Tom Zanussi <tom.zanussi (at] linux.intel.com>
+#
diff --git a/import-layers/yocto-poky/scripts/lib/wic/utils/oe/misc.py b/import-layers/yocto-poky/scripts/lib/wic/utils/oe/misc.py
new file mode 100644
index 000000000..81239ac35
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/utils/oe/misc.py
@@ -0,0 +1,250 @@
+# 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 os
+from collections import defaultdict
+
+from wic import msger
+from wic.utils import runner
+
+# executable -> recipe pairs for exec_native_cmd
+NATIVE_RECIPES = {"mcopy": "mtools",
+ "mkdosfs": "dosfstools",
+ "mkfs.btrfs": "btrfs-tools",
+ "mkfs.ext2": "e2fsprogs",
+ "mkfs.ext3": "e2fsprogs",
+ "mkfs.ext4": "e2fsprogs",
+ "mkfs.vfat": "dosfstools",
+ "mksquashfs": "squashfs-tools",
+ "mkswap": "util-linux",
+ "parted": "parted",
+ "sgdisk": "gptfdisk",
+ "syslinux": "syslinux"
+ }
+
+def _exec_cmd(cmd_and_args, as_shell=False, catch=3):
+ """
+ Execute command, catching stderr, stdout
+
+ Need to execute as_shell if the command uses wildcards
+ """
+ msger.debug("_exec_cmd: %s" % cmd_and_args)
+ args = cmd_and_args.split()
+ msger.debug(args)
+
+ if as_shell:
+ ret, out = runner.runtool(cmd_and_args, catch)
+ else:
+ ret, out = runner.runtool(args, catch)
+ out = out.strip()
+ msger.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, catch=3):
+ """
+ Execute command, catching stderr, stdout
+
+ Exits if rc non-zero
+ """
+ ret, out = _exec_cmd(cmd_and_args, as_shell, catch)
+
+ if ret != 0:
+ msger.error("exec_cmd: %s returned '%s' instead of 0" % \
+ (cmd_and_args, ret))
+
+ return out
+
+def cmd_in_path(cmd, path):
+ import scriptpath
+
+ scriptpath.add_bitbake_lib_path()
+
+ return bb.utils.which(path, cmd) != "" or False
+
+def exec_native_cmd(cmd_and_args, native_sysroot, catch=3, 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()
+ msger.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)
+ msger.debug("exec_native_cmd: %s" % cmd_and_args)
+
+ # If the command isn't in the native sysroot say we failed.
+ if cmd_in_path(args[0], native_paths):
+ ret, out = _exec_cmd(native_cmd_and_args, True, catch)
+ else:
+ ret = 127
+
+ 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 bake it with 'bitbake %s-native' "\
+ "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
+ msger.error(msg)
+ if out:
+ msger.debug('"%s" output: %s' % (args[0], out))
+
+ if ret != 0:
+ msger.error("exec_cmd: '%s' returned '%s' instead of 0" % \
+ (cmd_and_args, ret))
+
+ 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):
+ """
+ Parse one line from bitbake -e output or from .env file.
+ Put result key-value pair into the storage.
+ """
+ if "=" not in line:
+ return
+ try:
+ key, val = line.split("=")
+ except ValueError:
+ return
+ key = key.strip()
+ val = val.strip()
+ if key.replace('_', '').isalnum():
+ self[image][key] = val.strip('"')
+
+ def get_var(self, var, image=None):
+ """
+ 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 = msger.get_loglevel()
+ msger.set_loglevel('normal')
+ ret, lines = _exec_cmd(cmd)
+ msger.set_loglevel(log_level)
+
+ if ret:
+ print "Couldn't get '%s' output." % cmd
+ print "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
+ images = [key for key in self if key]
+ if len(images) == 1:
+ self[None] = self[image]
+
+ return self[image].get(var)
+
+# Create BB_VARS singleton
+BB_VARS = BitbakeVars()
+
+def get_bitbake_var(var, image=None):
+ """
+ Provide old get_bitbake_var API by wrapping
+ get_var method of BB_VARS singleton.
+ """
+ return BB_VARS.get_var(var, image)
+
+def parse_sourceparams(sourceparams):
+ """
+ Split sourceparams string of the form key1=val1[,key2=val2,...]
+ into a dict. Also accepts valueless keys i.e. without =.
+
+ Returns dict of param key/val pairs (note that val may be None).
+ """
+ params_dict = {}
+
+ params = sourceparams.split(',')
+ if params:
+ for par in params:
+ if not par:
+ continue
+ if not '=' in par:
+ key = par
+ val = None
+ else:
+ key, val = par.split('=')
+ params_dict[key] = val
+
+ return params_dict
diff --git a/import-layers/yocto-poky/scripts/lib/wic/utils/partitionedfs.py b/import-layers/yocto-poky/scripts/lib/wic/utils/partitionedfs.py
new file mode 100644
index 000000000..ad596d26f
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/utils/partitionedfs.py
@@ -0,0 +1,360 @@
+#!/usr/bin/env python -tt
+#
+# Copyright (c) 2009, 2010, 2011 Intel, Inc.
+# Copyright (c) 2007, 2008 Red Hat, Inc.
+# Copyright (c) 2008 Daniel P. Berrange
+# Copyright (c) 2008 David P. Huff
+#
+# 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.
+
+import os
+from wic import msger
+from wic.utils.errors import ImageError
+from wic.utils.oe.misc import exec_cmd, exec_native_cmd
+
+# 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 Image(object):
+ """
+ Generic base object for an image.
+
+ An Image is a container for a set of DiskImages and associated
+ partitions.
+ """
+ def __init__(self, native_sysroot=None):
+ self.disks = {}
+ self.partitions = []
+ # Size of a sector used in calculations
+ self.sector_size = SECTOR_SIZE
+ self._partitions_layed_out = False
+ self.native_sysroot = native_sysroot
+
+ def __add_disk(self, disk_name):
+ """ Add a disk 'disk_name' to the internal list of disks. Note,
+ 'disk_name' is the name of the disk in the target system
+ (e.g., sdb). """
+
+ if disk_name in self.disks:
+ # We already have this disk
+ return
+
+ assert not self._partitions_layed_out
+
+ self.disks[disk_name] = \
+ {'disk': None, # Disk object
+ 'numpart': 0, # Number of allocate partitions
+ 'realpart': 0, # Number of partitions in the partition table
+ 'partitions': [], # Indexes to self.partitions
+ 'offset': 0, # Offset of next partition (in sectors)
+ # Minimum required disk size to fit all partitions (in bytes)
+ 'min_size': 0,
+ 'ptable_format': "msdos"} # Partition table format
+
+ def add_disk(self, disk_name, disk_obj):
+ """ Add a disk object which have to be partitioned. More than one disk
+ can be added. In case of multiple disks, disk partitions have to be
+ added for each disk separately with 'add_partition()". """
+
+ self.__add_disk(disk_name)
+ self.disks[disk_name]['disk'] = disk_obj
+
+ def __add_partition(self, part):
+ """ This is a helper function for 'add_partition()' which adds a
+ partition to the internal list of partitions. """
+
+ assert not self._partitions_layed_out
+
+ self.partitions.append(part)
+ self.__add_disk(part['disk_name'])
+
+ def add_partition(self, size, disk_name, mountpoint, source_file=None, fstype=None,
+ label=None, fsopts=None, boot=False, align=None, no_table=False,
+ part_type=None, uuid=None):
+ """ Add the next partition. Prtitions have to be added in the
+ first-to-last order. """
+
+ ks_pnum = len(self.partitions)
+
+ # Converting kB to sectors for parted
+ size = size * 1024 / self.sector_size
+
+ part = {'ks_pnum': ks_pnum, # Partition number in the KS file
+ 'size': size, # In sectors
+ 'mountpoint': mountpoint, # Mount relative to chroot
+ 'source_file': source_file, # partition contents
+ 'fstype': fstype, # Filesystem type
+ 'fsopts': fsopts, # Filesystem mount options
+ 'label': label, # Partition label
+ 'disk_name': disk_name, # physical disk name holding partition
+ 'device': None, # kpartx device node for partition
+ 'num': None, # Partition number
+ 'boot': boot, # Bootable flag
+ 'align': align, # Partition alignment
+ 'no_table' : no_table, # Partition does not appear in partition table
+ 'part_type' : part_type, # Partition type
+ 'uuid': uuid} # Partition UUID
+
+ self.__add_partition(part)
+
+ def layout_partitions(self, ptable_format="msdos"):
+ """ 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". """
+
+ msger.debug("Assigning %s partitions to disks" % ptable_format)
+
+ if self._partitions_layed_out:
+ return
+
+ self._partitions_layed_out = True
+
+ # Go through partitions in the order they are added in .ks file
+ for num in range(len(self.partitions)):
+ part = self.partitions[num]
+
+ if not self.disks.has_key(part['disk_name']):
+ raise ImageError("No disk %s for partition %s" \
+ % (part['disk_name'], part['mountpoint']))
+
+ if 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 ImageError("setting custom partition type is not " \
+ "implemented for msdos partitions")
+
+ # Get the disk where the partition is located
+ disk = self.disks[part['disk_name']]
+ disk['numpart'] += 1
+ if not part['no_table']:
+ disk['realpart'] += 1
+ disk['ptable_format'] = ptable_format
+
+ if disk['numpart'] == 1:
+ if ptable_format == "msdos":
+ overhead = MBR_OVERHEAD
+ elif ptable_format == "gpt":
+ overhead = GPT_OVERHEAD
+
+ # Skip one sector required for the partitioning scheme overhead
+ disk['offset'] += overhead
+
+ if disk['realpart'] > 3:
+ # Reserve a sector for EBR for every logical partition
+ # before alignment is performed.
+ if ptable_format == "msdos":
+ disk['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 = disk['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
+
+ msger.debug("Realignment for %s%s with %s sectors, original"
+ " offset %s, target alignment is %sK." %
+ (part['disk_name'], disk['numpart'], align_sectors,
+ disk['offset'], part['align']))
+
+ # increase the offset so we actually start the partition on right alignment
+ disk['offset'] += align_sectors
+
+ part['start'] = disk['offset']
+ disk['offset'] += part['size']
+
+ part['type'] = 'primary'
+ if not part['no_table']:
+ part['num'] = disk['realpart']
+ else:
+ part['num'] = 0
+
+ if disk['ptable_format'] == "msdos":
+ if disk['realpart'] > 3:
+ part['type'] = 'logical'
+ part['num'] = disk['realpart'] + 1
+
+ disk['partitions'].append(num)
+ msger.debug("Assigned %s to %s%d, sectors range %d-%d size %d "
+ "sectors (%d bytes)." \
+ % (part['mountpoint'], part['disk_name'], part['num'],
+ part['start'], part['start'] + part['size'] - 1,
+ part['size'], part['size'] * self.sector_size))
+
+ # Once all the partitions have been layed out, we can calculate the
+ # minumim disk sizes.
+ for disk in self.disks.values():
+ disk['min_size'] = disk['offset']
+ if disk['ptable_format'] == "gpt":
+ disk['min_size'] += GPT_OVERHEAD
+
+ disk['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
+ msger.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 __format_disks(self):
+ self.layout_partitions()
+
+ for dev in self.disks.keys():
+ disk = self.disks[dev]
+ msger.debug("Initializing partition table for %s" % \
+ (disk['disk'].device))
+ exec_native_cmd("parted -s %s mklabel %s" % \
+ (disk['disk'].device, disk['ptable_format']),
+ self.native_sysroot)
+
+ msger.debug("Creating partitions")
+
+ for part in self.partitions:
+ if part['num'] == 0:
+ continue
+
+ disk = self.disks[part['disk_name']]
+ if disk['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(disk['disk'].device, "extended",
+ None, part['start'] - 1,
+ disk['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"
+ elif part['fstype'] == "ontrackdm6aux3":
+ parted_fs_type = "ontrackdm6aux3"
+ 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'] % 2:
+ msger.debug("Substracting one sector from '%s' partition to " \
+ "get even number of sectors for the partition" % \
+ part['mountpoint'])
+ part['size'] -= 1
+
+ self.__create_partition(disk['disk'].device, part['type'],
+ parted_fs_type, part['start'], part['size'])
+
+ if part['part_type']:
+ msger.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'],
+ disk['disk'].device), self.native_sysroot)
+
+ if part['uuid']:
+ msger.debug("partition %d: set UUID to %s" % \
+ (part['num'], part['uuid']))
+ exec_native_cmd("sgdisk --partition-guid=%d:%s %s" % \
+ (part['num'], part['uuid'], disk['disk'].device),
+ self.native_sysroot)
+
+ if part['boot']:
+ flag_name = "legacy_boot" if disk['ptable_format'] == 'gpt' else "boot"
+ msger.debug("Set '%s' flag for partition '%s' on disk '%s'" % \
+ (flag_name, part['num'], disk['disk'].device))
+ exec_native_cmd("parted -s %s set %d %s on" % \
+ (disk['disk'].device, part['num'], flag_name),
+ self.native_sysroot)
+
+ # Parted defaults to enabling the lba flag for fat16 partitions,
+ # which causes compatibility issues with some firmware (and really
+ # isn't necessary).
+ if parted_fs_type == "fat16":
+ if disk['ptable_format'] == 'msdos':
+ msger.debug("Disable 'lba' flag for partition '%s' on disk '%s'" % \
+ (part['num'], disk['disk'].device))
+ exec_native_cmd("parted -s %s set %d lba off" % \
+ (disk['disk'].device, part['num']),
+ self.native_sysroot)
+
+ def cleanup(self):
+ if self.disks:
+ for dev in self.disks:
+ disk = self.disks[dev]
+ try:
+ disk['disk'].cleanup()
+ except:
+ pass
+
+ def assemble(self, image_file):
+ msger.debug("Installing partitions")
+
+ for part in self.partitions:
+ source = part['source_file']
+ if source:
+ # install source_file contents into a partition
+ cmd = "dd if=%s of=%s bs=%d seek=%d count=%d conv=notrunc" % \
+ (source, image_file, self.sector_size,
+ part['start'], part['size'])
+ exec_cmd(cmd)
+
+ msger.debug("Installed %s in partition %d, sectors %d-%d, "
+ "size %d sectors" % \
+ (source, part['num'], part['start'],
+ part['start'] + part['size'] - 1, part['size']))
+
+ os.rename(source, image_file + '.p%d' % part['num'])
+
+ def create(self):
+ for dev in self.disks.keys():
+ disk = self.disks[dev]
+ disk['disk'].create()
+
+ self.__format_disks()
+
+ return
diff --git a/import-layers/yocto-poky/scripts/lib/wic/utils/runner.py b/import-layers/yocto-poky/scripts/lib/wic/utils/runner.py
new file mode 100644
index 000000000..7431917ff
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/utils/runner.py
@@ -0,0 +1,110 @@
+#!/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.
+
+import os
+import subprocess
+
+from wic import msger
+
+def runtool(cmdln_or_args, catch=1):
+ """ wrapper for most of the subprocess calls
+ input:
+ cmdln_or_args: can be both args and cmdln str (shell=True)
+ catch: 0, quitely run
+ 1, only STDOUT
+ 2, only STDERR
+ 3, both STDOUT and STDERR
+ return:
+ (rc, output)
+ if catch==0: the output will always None
+ """
+
+ if catch not in (0, 1, 2, 3):
+ # invalid catch selection, will cause exception, that's good
+ return None
+
+ 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
+
+ if catch != 3:
+ dev_null = os.open("/dev/null", os.O_WRONLY)
+
+ if catch == 0:
+ sout = dev_null
+ serr = dev_null
+ elif catch == 1:
+ sout = subprocess.PIPE
+ serr = dev_null
+ elif catch == 2:
+ sout = dev_null
+ serr = subprocess.PIPE
+ elif catch == 3:
+ 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
+ out = ''.join(filter(None, [sout, serr]))
+ except OSError, err:
+ if err.errno == 2:
+ # [Errno 2] No such file or directory
+ msger.error('Cannot run command: %s, lost dependency?' % cmd)
+ else:
+ raise # relay
+ finally:
+ if catch != 3:
+ os.close(dev_null)
+
+ return (process.returncode, out)
+
+def show(cmdln_or_args):
+ # show all the message using msger.verbose
+
+ rcode, out = runtool(cmdln_or_args, catch=3)
+
+ if isinstance(cmdln_or_args, list):
+ cmd = ' '.join(cmdln_or_args)
+ else:
+ cmd = cmdln_or_args
+
+ msg = 'running command: "%s"' % cmd
+ if out:
+ out = out.strip()
+ if out:
+ msg += ', with output::'
+ msg += '\n +----------------'
+ for line in out.splitlines():
+ msg += '\n | %s' % line
+ msg += '\n +----------------'
+
+ msger.verbose(msg)
+ return rcode
+
+def outs(cmdln_or_args, catch=1):
+ # get the outputs of tools
+ return runtool(cmdln_or_args, catch)[1].strip()
+
+def quiet(cmdln_or_args):
+ return runtool(cmdln_or_args, catch=0)[0]
diff --git a/import-layers/yocto-poky/scripts/lib/wic/utils/syslinux.py b/import-layers/yocto-poky/scripts/lib/wic/utils/syslinux.py
new file mode 100644
index 000000000..aace2863c
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lib/wic/utils/syslinux.py
@@ -0,0 +1,58 @@
+# 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 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.
+#
+# AUTHOR
+# Adrian Freihofer <adrian.freihofer (at] neratec.com>
+
+
+import re
+from wic import msger
+
+
+def serial_console_form_kargs(kernel_args):
+ """
+ Create SERIAL... line from kernel parameters
+
+ syslinux needs a line SERIAL port [baudrate [flowcontrol]]
+ in the syslinux.cfg file. The config line is generated based
+ on kernel boot parameters. The the parameters of the first
+ ttyS console are considered for syslinux config.
+ @param kernel_args kernel command line
+ @return line for syslinux config file e.g. "SERIAL 0 115200"
+ """
+ syslinux_conf = ""
+ for param in kernel_args.split():
+ param_match = re.match("console=ttyS([0-9]+),?([0-9]*)([noe]?)([0-9]?)(r?)", param)
+ if param_match:
+ syslinux_conf += "SERIAL " + param_match.group(1)
+ # baudrate
+ if param_match.group(2):
+ syslinux_conf += " " + param_match.group(2)
+ # parity
+ if param_match.group(3) and param_match.group(3) != 'n':
+ msger.warning("syslinux does not support parity for console. {} is ignored."
+ .format(param_match.group(3)))
+ # number of bits
+ if param_match.group(4) and param_match.group(4) != '8':
+ msger.warning("syslinux supports 8 bit console configuration only. {} is ignored."
+ .format(param_match.group(4)))
+ # flow control
+ if param_match.group(5) and param_match.group(5) != '':
+ msger.warning("syslinux console flowcontrol configuration. {} is ignored."
+ .format(param_match.group(5)))
+ break
+
+ return syslinux_conf
diff --git a/import-layers/yocto-poky/scripts/lnr b/import-layers/yocto-poky/scripts/lnr
new file mode 100755
index 000000000..9dacebe09
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/lnr
@@ -0,0 +1,21 @@
+#! /usr/bin/env python
+
+# 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/import-layers/yocto-poky/scripts/multilib_header_wrapper.h b/import-layers/yocto-poky/scripts/multilib_header_wrapper.h
new file mode 100644
index 000000000..5a8754088
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/multilib_header_wrapper.h
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ *
+ */
+
+#include <bits/wordsize.h>
+
+#ifdef __WORDSIZE
+
+#if __WORDSIZE == 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 __WORDSIZE == 64
+#include <ENTER_HEADER_FILENAME_HERE-64.h>
+#else
+#error "Unknown __WORDSIZE detected"
+#endif /* matches #if __WORDSIZE == 32 */
+
+#else /* __WORDSIZE is not defined */
+
+#error "__WORDSIZE is not defined"
+
+#endif
+
diff --git a/import-layers/yocto-poky/scripts/native-intercept/chown b/import-layers/yocto-poky/scripts/native-intercept/chown
new file mode 100755
index 000000000..4f43271c2
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/native-intercept/chown
@@ -0,0 +1,2 @@
+#! /bin/sh
+echo "Intercept $0: $@ -- do nothing"
diff --git a/import-layers/yocto-poky/scripts/oe-buildenv-internal b/import-layers/yocto-poky/scripts/oe-buildenv-internal
new file mode 100755
index 000000000..e04db0398
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/oe-buildenv-internal
@@ -0,0 +1,121 @@
+#!/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
+
+# 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. This check can't go into
+# sanity.bbclass because bitbake's source code doesn't even pass
+# parsing stage when used with python v3, so we catch it here so we
+# can offer a meaningful error message.
+py_v3_check=$(/usr/bin/env python --version 2>&1 | grep "Python 3")
+if [ -n "$py_v3_check" ]; then
+ echo >&2 "Bitbake is not compatible with python v3"
+ echo >&2 "Please set up python v2 as your default python interpreter"
+ return 1
+fi
+unset py_v3_check
+
+# Similarly, we now 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_v26_check=$(python -c 'import sys; print sys.version_info >= (2,7,3)')
+if [ "$py_v26_check" != "True" ]; then
+ echo >&2 "BitBake requires Python 2.7.3 or later"
+ return 1
+fi
+unset py_v26_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"
+fi
+
+BITBAKEDIR=$(readlink -f "$BITBAKEDIR")
+BUILDDIR=$(readlink -f "$BUILDDIR")
+
+if [ ! -d "$BITBAKEDIR" ]; then
+ echo >&2 "Error: The bitbake directory ($BITBAKEDIR) does not exist! Please ensure a copy of bitbake exists at this location"
+ 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"
+
+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/import-layers/yocto-poky/scripts/oe-find-native-sysroot b/import-layers/yocto-poky/scripts/oe-find-native-sysroot
new file mode 100755
index 000000000..81d62b888
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/oe-find-native-sysroot
@@ -0,0 +1,81 @@
+#!/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
+#
+# 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 [ "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
+ OECORE_NATIVE_SYSROOT=`bitbake -e | grep ^STAGING_DIR_NATIVE | cut -d '"' -f2`
+ rm -f conf/sanity.conf
+ else
+ OECORE_NATIVE_SYSROOT=`bitbake -e | grep ^STAGING_DIR_NATIVE | cut -d '"' -f2`
+ 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 [ "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"
+ bitbake -e
+ exit 1
+fi
+
+# Set up pseudo command
+if [ ! -e "$OECORE_NATIVE_SYSROOT/usr/bin/pseudo" ]; then
+ echo "Error: Unable to find pseudo 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 wrong with your toolchain installation"
+ fi
+
+ if [ -z "$SKIP_STRICT_SYSROOT_CHECK" ]; then
+ exit 1
+ fi
+fi
+PSEUDO="$OECORE_NATIVE_SYSROOT/usr/bin/pseudo"
diff --git a/import-layers/yocto-poky/scripts/oe-git-proxy b/import-layers/yocto-poky/scripts/oe-git-proxy
new file mode 100755
index 000000000..124790240
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/oe-git-proxy
@@ -0,0 +1,159 @@
+#!/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>
+
+# 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
+ HOST_IP=$(gethostip -d $HOST)
+ if valid_ipv4 $HOST_IP; then
+ match_ipv4 $GLOB $HOST_IP
+ if [ $? -eq 0 ]; then
+ return 0
+ fi
+ fi
+ 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/import-layers/yocto-poky/scripts/oe-pkgdata-util b/import-layers/yocto-poky/scripts/oe-pkgdata-util
new file mode 100755
index 000000000..a04e44d35
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/oe-pkgdata-util
@@ -0,0 +1,525 @@
+#!/usr/bin/env python
+
+# 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.prepare(True)
+
+ tinfoil.logger.setLevel(logging.WARNING)
+ 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):
+ val = ""
+ with open(pkgdata_file, 'r') as f:
+ for line in f:
+ if line.startswith(valuename + ":"):
+ 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
+ if qvar == "PKGSIZE":
+ # append packagename
+ qvar = "%s_%s" % (args.valuename, mappedpkg)
+ # PKGSIZE is now in bytes, but we we want it in KB
+ pkgsize = (int(readvar(revlink, qvar)) + 1024 // 2) // 1024
+ value = "%d" % pkgsize
+ else:
+ value = readvar(revlink, qvar)
+ if args.prefix_name:
+ print('%s %s' % (pkg_name, value))
+ else:
+ print(value)
+
+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 = mappings.values()
+ else:
+ items = []
+ for pkg in pkgs:
+ items.extend(mappings.get(pkg, []))
+
+ print('\n'.join(items))
+
+def lookup_recipe(args):
+ # Handle both multiple arguments and multiple values within an arg (old syntax)
+ pkgs = []
+ for pkgitem in args.pkg:
+ pkgs.extend(pkgitem.split())
+
+ mappings = defaultdict(list)
+ for pkg in pkgs:
+ pkgfile = os.path.join(args.pkgdata_dir, 'runtime-reverse', pkg)
+ if os.path.exists(pkgfile):
+ with open(pkgfile, 'r') as f:
+ for line in f:
+ fields = line.rstrip().split(': ')
+ if fields[0] == 'PN':
+ mappings[pkg].append(fields[1])
+ break
+ 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)
+
+ items = []
+ for pkg in pkgs:
+ items.extend(mappings.get(pkg, []))
+ print('\n'.join(items))
+
+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
+
+ 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)
+ else:
+ 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)
+
+ 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)
+ 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)
+
+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>')
+
+ 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.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_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.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()
+ args.pkgdata_dir = tinfoil.config_data.getVar('PKGDATA_DIR', True)
+ 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/import-layers/yocto-poky/scripts/oe-publish-sdk b/import-layers/yocto-poky/scripts/oe-publish-sdk
new file mode 100755
index 000000000..55872f2f9
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/oe-publish-sdk
@@ -0,0 +1,155 @@
+#!/usr/bin/env python
+
+# 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 .; mv .git/hooks/post-update.sample .git/hooks/post-update; echo "*.pyc\n*.pyo" > .gitignore; fi; git add -A .; git config user.email "oe@oe.oe" && git config user.name "OE" && git commit -q -m "init repo" || true; git update-server-info' % (destination, destination)
+ else:
+ cmd = "ssh %s 'set -e; mkdir -p %s/layers; cd %s/layers; if [ ! -e .git ]; then git init .; mv .git/hooks/post-update.sample .git/hooks/post-update; echo '*.pyc\n*.pyo' > .gitignore; fi; git add -A .; git config user.email 'oe@oe.oe' && git config user.name 'OE' && git commit -q -m \"init repo\" || true; git update-server-info'" % (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/import-layers/yocto-poky/scripts/oe-selftest b/import-layers/yocto-poky/scripts/oe-selftest
new file mode 100755
index 000000000..5e23ef003
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/oe-selftest
@@ -0,0 +1,636 @@
+#!/usr/bin/env python
+
+# 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.
+
+# 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 unittest
+import logging
+import argparse
+import subprocess
+import time as t
+import re
+import fnmatch
+
+sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)) + '/lib')
+import scriptpath
+scriptpath.add_bitbake_lib_path()
+scriptpath.add_oe_lib_path()
+import argparse_oe
+
+import oeqa.selftest
+import oeqa.utils.ftools as ftools
+from oeqa.utils.commands import runCmd, get_bb_var, get_test_layer
+from oeqa.selftest.base import oeSelfTest, get_available_machines
+
+def logger_create():
+ log_file = "oe-selftest-" + t.strftime("%Y-%m-%d_%H:%M:%S") + ".log"
+ if os.path.exists("oe-selftest.log"): os.remove("oe-selftest.log")
+ os.symlink(log_file, "oe-selftest.log")
+
+ log = logging.getLogger("selftest")
+ log.setLevel(logging.DEBUG)
+
+ fh = logging.FileHandler(filename=log_file, 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
+
+log = logger_create()
+
+def get_args_parser():
+ description = "Script that runs unit tests agains 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)
+ group = parser.add_mutually_exclusive_group(required=True)
+ 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('-a', '--run-all-tests', required=False, action="store_true", dest="run_all_tests", default=False, help='Run all (unhidden) tests')
+ group.add_argument('-m', '--list-modules', required=False, action="store_true", dest="list_modules", default=False, help='List all available test modules.')
+ group.add_argument('--list-classes', required=False, action="store_true", dest="list_allclasses", default=False, help='List all available test classes.')
+ parser.add_argument('--coverage', action="store_true", help="Run code coverage when testing")
+ parser.add_argument('--coverage-source', dest="coverage_source", nargs="+", help="Specifiy the directories to take coverage from")
+ parser.add_argument('--coverage-include', dest="coverage_include", nargs="+", help="Specify extra patterns to include into the coverage measurement")
+ parser.add_argument('--coverage-omit', dest="coverage_omit", nargs="+", help="Specify with extra patterns to exclude from the coverage measurement")
+ group.add_argument('--run-tests-by', required=False, dest='run_tests_by', default=False, nargs='*',
+ help='run-tests-by <name|class|module|id|tag> <list of tests|classes|modules|ids|tags>')
+ group.add_argument('--list-tests-by', required=False, dest='list_tests_by', default=False, nargs='*',
+ help='list-tests-by <name|class|module|id|tag> <list of tests|classes|modules|ids|tags>')
+ group.add_argument('-l', '--list-tests', required=False, action="store_true", dest="list_tests", default=False,
+ help='List all available tests.')
+ group.add_argument('--list-tags', required=False, dest='list_tags', default=False, action="store_true",
+ help='List all tags that have been set to test cases.')
+ parser.add_argument('--machine', required=False, dest='machine', choices=['random', 'all'], default=None,
+ help='Run tests on different machines (random/all).')
+ return parser
+
+
+def preflight_check():
+
+ log.info("Checking that everything is in order before running the tests")
+
+ if not os.environ.get("BUILDDIR"):
+ log.error("BUILDDIR isn't set. Did you forget to source your build environment setup script?")
+ return False
+
+ builddir = os.environ.get("BUILDDIR")
+ if os.getcwd() != builddir:
+ log.info("Changing cwd to %s" % builddir)
+ os.chdir(builddir)
+
+ if not "meta-selftest" in get_bb_var("BBLAYERS"):
+ log.error("You don't seem to have the meta-selftest layer in BBLAYERS")
+ return False
+
+ log.info("Running bitbake -p")
+ runCmd("bitbake -p")
+
+ return True
+
+def add_include():
+ builddir = os.environ.get("BUILDDIR")
+ if "#include added by oe-selftest.py" \
+ not in ftools.read_file(os.path.join(builddir, "conf/local.conf")):
+ log.info("Adding: \"include selftest.inc\" in local.conf")
+ ftools.append_file(os.path.join(builddir, "conf/local.conf"), \
+ "\n#include added by oe-selftest.py\ninclude machine.inc\ninclude selftest.inc")
+
+ if "#include added by oe-selftest.py" \
+ not in ftools.read_file(os.path.join(builddir, "conf/bblayers.conf")):
+ log.info("Adding: \"include bblayers.inc\" in bblayers.conf")
+ ftools.append_file(os.path.join(builddir, "conf/bblayers.conf"), \
+ "\n#include added by oe-selftest.py\ninclude bblayers.inc")
+
+def remove_include():
+ builddir = os.environ.get("BUILDDIR")
+ if builddir is None:
+ return
+ if "#include added by oe-selftest.py" \
+ in ftools.read_file(os.path.join(builddir, "conf/local.conf")):
+ log.info("Removing the include from local.conf")
+ ftools.remove_from_file(os.path.join(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(builddir, "conf/bblayers.conf")):
+ log.info("Removing the include from bblayers.conf")
+ ftools.remove_from_file(os.path.join(builddir, "conf/bblayers.conf"), \
+ "\n#include added by oe-selftest.py\ninclude bblayers.inc")
+
+def remove_inc_files():
+ try:
+ os.remove(os.path.join(os.environ.get("BUILDDIR"), "conf/selftest.inc"))
+ for root, _, files in os.walk(get_test_layer()):
+ for f in files:
+ if f == 'test_recipe.inc':
+ os.remove(os.path.join(root, f))
+ except (AttributeError, OSError,) as e: # AttributeError may happen if BUILDDIR is not set
+ pass
+
+ for incl_file in ['conf/bblayers.inc', 'conf/machine.inc']:
+ try:
+ os.remove(os.path.join(os.environ.get("BUILDDIR"), incl_file))
+ except:
+ pass
+
+
+def get_tests_modules(include_hidden=False):
+ modules_list = list()
+ for modules_path in oeqa.selftest.__path__:
+ for (p, d, f) in os.walk(modules_path):
+ files = sorted([f for f in os.listdir(p) if f.endswith('.py') and not (f.startswith('_') and not include_hidden) and not f.startswith('__') and f != 'base.py'])
+ for f in files:
+ submodules = p.split("selftest")[-1]
+ module = ""
+ if submodules:
+ module = 'oeqa.selftest' + submodules.replace("/",".") + "." + f.split('.py')[0]
+ else:
+ module = 'oeqa.selftest.' + f.split('.py')[0]
+ if module not in modules_list:
+ modules_list.append(module)
+ return modules_list
+
+
+def get_tests(exclusive_modules=[], include_hidden=False):
+ test_modules = list()
+ for x in exclusive_modules:
+ test_modules.append('oeqa.selftest.' + x)
+ if not test_modules:
+ inc_hidden = include_hidden
+ test_modules = get_tests_modules(inc_hidden)
+
+ return test_modules
+
+
+class Tc:
+ def __init__(self, tcname, tcclass, tcmodule, tcid=None, tctag=None):
+ self.tcname = tcname
+ self.tcclass = tcclass
+ self.tcmodule = tcmodule
+ self.tcid = tcid
+ # A test case can have multiple tags (as tuples) otherwise str will suffice
+ self.tctag = tctag
+ self.fullpath = '.'.join(['oeqa', 'selftest', tcmodule, tcclass, tcname])
+
+
+def get_tests_from_module(tmod):
+ tlist = []
+ prefix = 'oeqa.selftest.'
+
+ try:
+ import importlib
+ modlib = importlib.import_module(tmod)
+ for mod in vars(modlib).values():
+ if isinstance(mod, type(oeSelfTest)) and issubclass(mod, oeSelfTest) and mod is not oeSelfTest:
+ for test in dir(mod):
+ if test.startswith('test_') and hasattr(vars(mod)[test], '__call__'):
+ # Get test case id and feature tag
+ # NOTE: if testcase decorator or feature tag not set will throw error
+ try:
+ tid = vars(mod)[test].test_case
+ except:
+ print 'DEBUG: tc id missing for ' + str(test)
+ tid = None
+ try:
+ ttag = vars(mod)[test].tag__feature
+ except:
+ # print 'DEBUG: feature tag missing for ' + str(test)
+ ttag = None
+
+ # NOTE: for some reason lstrip() doesn't work for mod.__module__
+ tlist.append(Tc(test, mod.__name__, mod.__module__.replace(prefix, ''), tid, ttag))
+ except:
+ pass
+
+ return tlist
+
+
+def get_all_tests():
+ # Get all the test modules (except the hidden ones)
+ testlist = []
+ tests_modules = get_tests_modules()
+ # Get all the tests from modules
+ for tmod in sorted(tests_modules):
+ testlist += get_tests_from_module(tmod)
+ return testlist
+
+
+def get_testsuite_by(criteria, keyword):
+ # Get a testsuite based on 'keyword'
+ # criteria: name, class, module, id, tag
+ # keyword: a list of tests, classes, modules, ids, tags
+
+ ts = []
+ all_tests = get_all_tests()
+
+ def get_matches(values):
+ # Get an item and return the ones that match with keyword(s)
+ # values: the list of items (names, modules, classes...)
+ result = []
+ remaining = values[:]
+ for key in keyword:
+ if key in remaining:
+ # Regular matching of exact item
+ result.append(key)
+ remaining.remove(key)
+ else:
+ # Wildcard matching
+ pattern = re.compile(fnmatch.translate(r"%s" % key))
+ added = [x for x in remaining if pattern.match(x)]
+ result.extend(added)
+ remaining = [x for x in remaining if x not in added]
+
+ return result
+
+ if criteria == 'name':
+ names = get_matches([ tc.tcname for tc in all_tests ])
+ ts = [ tc for tc in all_tests if tc.tcname in names ]
+
+ elif criteria == 'class':
+ classes = get_matches([ tc.tcclass for tc in all_tests ])
+ ts = [ tc for tc in all_tests if tc.tcclass in classes ]
+
+ elif criteria == 'module':
+ modules = get_matches([ tc.tcmodule for tc in all_tests ])
+ ts = [ tc for tc in all_tests if tc.tcmodule in modules ]
+
+ elif criteria == 'id':
+ ids = get_matches([ str(tc.tcid) for tc in all_tests ])
+ ts = [ tc for tc in all_tests if str(tc.tcid) in ids ]
+
+ elif criteria == 'tag':
+ values = set()
+ for tc in all_tests:
+ # tc can have multiple tags (as tuple) otherwise str will suffice
+ if isinstance(tc.tctag, tuple):
+ values |= { str(tag) for tag in tc.tctag }
+ else:
+ values.add(str(tc.tctag))
+
+ tags = get_matches(list(values))
+
+ for tc in all_tests:
+ for tag in tags:
+ if isinstance(tc.tctag, tuple) and tag in tc.tctag:
+ ts.append(tc)
+ elif tag == tc.tctag:
+ ts.append(tc)
+
+ # Remove duplicates from the list
+ ts = list(set(ts))
+
+ return ts
+
+
+def list_testsuite_by(criteria, keyword):
+ # Get a testsuite based on 'keyword'
+ # criteria: name, class, module, id, tag
+ # keyword: a list of tests, classes, modules, ids, tags
+
+ ts = sorted([ (tc.tcid, tc.tctag, tc.tcname, tc.tcclass, tc.tcmodule) for tc in get_testsuite_by(criteria, keyword) ])
+
+ print '%-4s\t%-20s\t%-60s\t%-25s\t%-20s' % ('id', 'tag', 'name', 'class', 'module')
+ print '_' * 150
+ for t in ts:
+ if isinstance(t[1], (tuple, list)):
+ print '%-4s\t%-20s\t%-60s\t%-25s\t%-20s' % (t[0], ', '.join(t[1]), t[2], t[3], t[4])
+ else:
+ print '%-4s\t%-20s\t%-60s\t%-25s\t%-20s' % t
+ print '_' * 150
+ print 'Filtering by:\t %s' % criteria
+ print 'Looking for:\t %s' % ', '.join(str(x) for x in keyword)
+ print 'Total found:\t %s' % len(ts)
+
+
+def list_tests():
+ # List all available oe-selftest tests
+
+ ts = get_all_tests()
+
+ print '%-4s\t%-20s\t%-60s\t%-25s\t%-20s' % ('id', 'tag', 'name', 'class', 'module')
+ print '_' * 150
+ for t in ts:
+ if isinstance(t.tctag, (tuple, list)):
+ print '%-4s\t%-20s\t%-60s\t%-25s\t%-20s' % (t.tcid, ', '.join(t.tctag), t.tcname, t.tcclass, t.tcmodule)
+ else:
+ print '%-4s\t%-20s\t%-60s\t%-25s\t%-20s' % (t.tcid, t.tctag, t.tcname, t.tcclass, t.tcmodule)
+ print '_' * 150
+ print 'Total found:\t %s' % len(ts)
+
+
+def list_tags():
+ # Get all tags set to test cases
+ # This is useful when setting tags to test cases
+ # The list of tags should be kept as minimal as possible
+ tags = set()
+ all_tests = get_all_tests()
+
+ for tc in all_tests:
+ if isinstance(tc.tctag, (tuple, list)):
+ tags.update(set(tc.tctag))
+ else:
+ tags.add(tc.tctag)
+
+ print 'Tags:\t%s' % ', '.join(str(x) for x in tags)
+
+def coverage_setup(coverage_source, coverage_include, coverage_omit):
+ """ Set up the coverage measurement for the testcases to be run """
+ import datetime
+ import subprocess
+ builddir = os.environ.get("BUILDDIR")
+ pokydir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
+ curcommit= subprocess.check_output(["git", "--git-dir", os.path.join(pokydir, ".git"), "rev-parse", "HEAD"])
+ coveragerc = "%s/.coveragerc" % builddir
+ data_file = "%s/.coverage." % builddir
+ data_file += datetime.datetime.now().strftime('%Y%m%dT%H%M%S')
+ if os.path.isfile(data_file):
+ os.remove(data_file)
+ with open(coveragerc, 'w') as cps:
+ cps.write("# Generated with command '%s'\n" % " ".join(sys.argv))
+ cps.write("# HEAD commit %s\n" % curcommit.strip())
+ cps.write("[run]\n")
+ cps.write("data_file = %s\n" % data_file)
+ cps.write("branch = True\n")
+ # Measure just BBLAYERS, scripts and bitbake folders
+ cps.write("source = \n")
+ if coverage_source:
+ for directory in coverage_source:
+ if not os.path.isdir(directory):
+ log.warn("Directory %s is not valid.", directory)
+ cps.write(" %s\n" % directory)
+ else:
+ for layer in get_bb_var('BBLAYERS').split():
+ cps.write(" %s\n" % layer)
+ cps.write(" %s\n" % os.path.dirname(os.path.realpath(__file__)))
+ cps.write(" %s\n" % os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))),'bitbake'))
+
+ if coverage_include:
+ cps.write("include = \n")
+ for pattern in coverage_include:
+ cps.write(" %s\n" % pattern)
+ if coverage_omit:
+ cps.write("omit = \n")
+ for pattern in coverage_omit:
+ cps.write(" %s\n" % pattern)
+
+ return coveragerc
+
+def coverage_report():
+ """ Loads the coverage data gathered and reports it back """
+ try:
+ # Coverage4 uses coverage.Coverage
+ from coverage import Coverage
+ except:
+ # Coverage under version 4 uses coverage.coverage
+ from coverage import coverage as Coverage
+
+ import cStringIO as StringIO
+ from coverage.misc import CoverageException
+
+ cov_output = StringIO.StringIO()
+ # Creating the coverage data with the setting from the configuration file
+ cov = Coverage(config_file = os.environ.get('COVERAGE_PROCESS_START'))
+ try:
+ # Load data from the data file specified in the configuration
+ cov.load()
+ # Store report data in a StringIO variable
+ cov.report(file = cov_output, show_missing=False)
+ log.info("\n%s" % cov_output.getvalue())
+ except CoverageException as e:
+ # Show problems with the reporting. Since Coverage4 not finding any data to report raises an exception
+ log.warn("%s" % str(e))
+ finally:
+ cov_output.close()
+
+
+def main():
+ parser = get_args_parser()
+ args = parser.parse_args()
+
+ # Add <layer>/lib to sys.path, so layers can add selftests
+ log.info("Running bitbake -e to get BBPATH")
+ bbpath = get_bb_var('BBPATH').split(':')
+ layer_libdirs = [p for p in (os.path.join(l, 'lib') for l in bbpath) if os.path.exists(p)]
+ sys.path.extend(layer_libdirs)
+ reload(oeqa.selftest)
+
+ if args.run_tests_by and len(args.run_tests_by) >= 2:
+ valid_options = ['name', 'class', 'module', 'id', 'tag']
+ if args.run_tests_by[0] not in valid_options:
+ print '--run-tests-by %s not a valid option. Choose one of <name|class|module|id|tag>.' % args.run_tests_by[0]
+ return 1
+ else:
+ criteria = args.run_tests_by[0]
+ keyword = args.run_tests_by[1:]
+ ts = sorted([ tc.fullpath for tc in get_testsuite_by(criteria, keyword) ])
+
+ if args.list_tests_by and len(args.list_tests_by) >= 2:
+ valid_options = ['name', 'class', 'module', 'id', 'tag']
+ if args.list_tests_by[0] not in valid_options:
+ print '--list-tests-by %s not a valid option. Choose one of <name|class|module|id|tag>.' % args.list_tests_by[0]
+ return 1
+ else:
+ criteria = args.list_tests_by[0]
+ keyword = args.list_tests_by[1:]
+ list_testsuite_by(criteria, keyword)
+
+ if args.list_tests:
+ list_tests()
+
+ if args.list_tags:
+ list_tags()
+
+ if args.list_allclasses:
+ args.list_modules = True
+
+ if args.list_modules:
+ log.info('Listing all available test modules:')
+ testslist = get_tests(include_hidden=True)
+ for test in testslist:
+ module = test.split('oeqa.selftest.')[-1]
+ info = ''
+ if module.startswith('_'):
+ info = ' (hidden)'
+ print module + info
+ if args.list_allclasses:
+ try:
+ import importlib
+ modlib = importlib.import_module(test)
+ for v in vars(modlib):
+ t = vars(modlib)[v]
+ if isinstance(t, type(oeSelfTest)) and issubclass(t, oeSelfTest) and t!=oeSelfTest:
+ print " --", v
+ for method in dir(t):
+ if method.startswith("test_") and callable(vars(t)[method]):
+ print " -- --", method
+
+ except (AttributeError, ImportError) as e:
+ print e
+ pass
+
+ if args.run_tests or args.run_all_tests or args.run_tests_by:
+ if not preflight_check():
+ return 1
+
+ if args.run_tests_by:
+ testslist = ts
+ else:
+ testslist = get_tests(exclusive_modules=(args.run_tests or []), include_hidden=False)
+
+ suite = unittest.TestSuite()
+ loader = unittest.TestLoader()
+ loader.sortTestMethodsUsing = None
+ runner = unittest.TextTestRunner(verbosity=2, resultclass=buildResultClass(args))
+ # we need to do this here, otherwise just loading the tests
+ # will take 2 minutes (bitbake -e calls)
+ oeSelfTest.testlayer_path = get_test_layer()
+ for test in testslist:
+ log.info("Loading tests from: %s" % test)
+ try:
+ suite.addTests(loader.loadTestsFromName(test))
+ except AttributeError as e:
+ log.error("Failed to import %s" % test)
+ log.error(e)
+ return 1
+ add_include()
+
+ if args.machine:
+ # Custom machine sets only weak default values (??=) for MACHINE in machine.inc
+ # This let test cases that require a specific MACHINE to be able to override it, using (?= or =)
+ log.info('Custom machine mode enabled. MACHINE set to %s' % args.machine)
+ if args.machine == 'random':
+ os.environ['CUSTOMMACHINE'] = 'random'
+ result = runner.run(suite)
+ else: # all
+ machines = get_available_machines()
+ for m in machines:
+ log.info('Run tests with custom MACHINE set to: %s' % m)
+ os.environ['CUSTOMMACHINE'] = m
+ result = runner.run(suite)
+ else:
+ result = runner.run(suite)
+
+ log.info("Finished")
+
+ if result.wasSuccessful():
+ return 0
+ else:
+ return 1
+
+def buildResultClass(args):
+ """Build a Result Class to use in the testcase execution"""
+ import site
+
+ class StampedResult(unittest.TextTestResult):
+ """
+ Custom TestResult that prints the time when a test starts. As oe-selftest
+ can take a long time (ie a few hours) to run, timestamps help us understand
+ what tests are taking a long time to execute.
+ If coverage is required, this class executes the coverage setup and reporting.
+ """
+ def startTest(self, test):
+ import time
+ self.stream.write(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + " - ")
+ super(StampedResult, self).startTest(test)
+
+ def startTestRun(self):
+ """ Setup coverage before running any testcase """
+
+ # variable holding the coverage configuration file allowing subprocess to be measured
+ self.coveragepth = None
+
+ # indicates the system if coverage is currently installed
+ self.coverage_installed = True
+
+ if args.coverage or args.coverage_source or args.coverage_include or args.coverage_omit:
+ try:
+ # check if user can do coverage
+ import coverage
+ except:
+ log.warn("python coverage is not installed. More info on https://pypi.python.org/pypi/coverage")
+ self.coverage_installed = False
+
+ if self.coverage_installed:
+ log.info("Coverage is enabled")
+
+ # In case the user has not set the variable COVERAGE_PROCESS_START,
+ # create a default one and export it. The COVERAGE_PROCESS_START
+ # value indicates where the coverage configuration file resides
+ # More info on https://pypi.python.org/pypi/coverage
+ if not os.environ.get('COVERAGE_PROCESS_START'):
+ os.environ['COVERAGE_PROCESS_START'] = coverage_setup(args.coverage_source, args.coverage_include, args.coverage_omit)
+
+ # Use default site.USER_SITE and write corresponding config file
+ site.ENABLE_USER_SITE = True
+ if not os.path.exists(site.USER_SITE):
+ os.makedirs(site.USER_SITE)
+ self.coveragepth = os.path.join(site.USER_SITE, "coverage.pth")
+ with open(self.coveragepth, 'w') as cps:
+ cps.write('import sys,site; sys.path.extend(site.getsitepackages()); import coverage; coverage.process_startup();')
+
+ def stopTestRun(self):
+ """ Report coverage data after the testcases are run """
+
+ if args.coverage or args.coverage_source or args.coverage_include or args.coverage_omit:
+ if self.coverage_installed:
+ with open(os.environ['COVERAGE_PROCESS_START']) as ccf:
+ log.info("Coverage configuration file (%s)" % os.environ.get('COVERAGE_PROCESS_START'))
+ log.info("===========================")
+ log.info("\n%s" % "".join(ccf.readlines()))
+
+ log.info("Coverage Report")
+ log.info("===============")
+ try:
+ coverage_report()
+ finally:
+ # remove the pth file
+ try:
+ os.remove(self.coveragepth)
+ except OSError:
+ log.warn("Expected temporal file from coverage is missing, ignoring removal.")
+
+ return StampedResult
+
+
+if __name__ == "__main__":
+ try:
+ ret = main()
+ except Exception:
+ ret = 1
+ import traceback
+ traceback.print_exc()
+ finally:
+ remove_include()
+ remove_inc_files()
+ sys.exit(ret)
diff --git a/import-layers/yocto-poky/scripts/oe-setup-builddir b/import-layers/yocto-poky/scripts/oe-setup-builddir
new file mode 100755
index 000000000..93722e08a
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/oe-setup-builddir
@@ -0,0 +1,139 @@
+#!/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
+
+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' must be a directory containing local.conf & bblayers.conf"
+ 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
+
+cat <<EOM
+
+### Shell environment set up for builds. ###
+
+You can now run 'bitbake <target>'
+
+EOM
+if [ -z "$OECORENOTESCONF" ]; then
+ OECORENOTESCONF="$OEROOT/meta/conf/conf-notes.txt"
+fi
+[ ! -r "$OECORENOTESCONF" ] || cat $OECORENOTESCONF
+unset OECORENOTESCONF
diff --git a/import-layers/yocto-poky/scripts/oe-setup-rpmrepo b/import-layers/yocto-poky/scripts/oe-setup-rpmrepo
new file mode 100755
index 000000000..917b98b98
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/oe-setup-rpmrepo
@@ -0,0 +1,97 @@
+#!/bin/bash
+#
+# This utility setup the necessary metadata for an rpm repo
+#
+# Copyright (c) 2011 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
+
+
+# Don't use TMPDIR from the external environment, it may be a distro
+# variable pointing to /tmp (e.g. within X on OpenSUSE)
+# Instead, use OE_TMPDIR for passing this in externally.
+TMPDIR="$OE_TMPDIR"
+
+function usage() {
+ echo "Usage: $0 <rpm-dir>"
+ echo " <rpm-dir>: default is $TMPDIR/deploy/rpm"
+}
+
+if [ $# -gt 1 ]; then
+ usage
+ exit 1
+fi
+
+setup_tmpdir() {
+ if [ -z "$TMPDIR" ]; then
+ # Try to get TMPDIR from bitbake
+ type -P bitbake &>/dev/null || {
+ echo "In order for this script to dynamically infer paths";
+ echo "to kernels or filesystem images, you either need";
+ echo "bitbake in your PATH or to source oe-init-build-env";
+ echo "before running this script" >&2;
+ exit 1; }
+
+ # We have bitbake in PATH, get TMPDIR from bitbake
+ TMPDIR=`bitbake -e | grep ^TMPDIR=\" | cut -d '=' -f2 | cut -d '"' -f2`
+ if [ -z "$TMPDIR" ]; then
+ echo "Error: this script needs to be run from your build directory,"
+ echo "or you need to explicitly set TMPDIR in your environment"
+ exit 1
+ fi
+ fi
+}
+
+setup_sysroot() {
+ # Toolchain installs set up $OECORE_NATIVE_SYSROOT in their
+ # environment script. If that variable isn't set, we're
+ # either in an in-tree poky scenario or the environment
+ # script wasn't source'd.
+ if [ -z "$OECORE_NATIVE_SYSROOT" ]; then
+ setup_tmpdir
+ BUILD_ARCH=`uname -m`
+ BUILD_OS=`uname | tr '[A-Z]' '[a-z]'`
+ BUILD_SYS="$BUILD_ARCH-$BUILD_OS"
+
+ OECORE_NATIVE_SYSROOT=$TMPDIR/sysroots/$BUILD_SYS
+ fi
+}
+
+setup_tmpdir
+setup_sysroot
+
+
+if [ -n "$1" ]; then
+ RPM_DIR="$1"
+else
+ RPM_DIR="$TMPDIR/deploy/rpm"
+fi
+
+if [ ! -d "$RPM_DIR" ]; then
+ echo "Error: rpm dir $RPM_DIR doesn't exist"
+ exit 1
+fi
+
+CREATEREPO=$OECORE_NATIVE_SYSROOT/usr/bin/createrepo
+if [ ! -e "$CREATEREPO" ]; then
+ echo "Error: can't find createrepo binary"
+ echo "please run bitbake createrepo-native first"
+ exit 1
+fi
+
+export PATH=${PATH}:${OECORE_NATIVE_SYSROOT}/usr/bin
+
+$CREATEREPO "$RPM_DIR"
+
+exit 0
diff --git a/import-layers/yocto-poky/scripts/oe-trim-schemas b/import-layers/yocto-poky/scripts/oe-trim-schemas
new file mode 100755
index 000000000..29fb3a1b6
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/oe-trim-schemas
@@ -0,0 +1,49 @@
+#! /usr/bin/env python
+
+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
+
+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/import-layers/yocto-poky/scripts/oepydevshell-internal.py b/import-layers/yocto-poky/scripts/oepydevshell-internal.py
new file mode 100755
index 000000000..f7b2e4e0b
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/oepydevshell-internal.py
@@ -0,0 +1,92 @@
+#!/usr/bin/env python
+
+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:
+ print("Incorrect parameters")
+ sys.exit(1)
+
+pty = open(sys.argv[1], "w+b", 0)
+parent = int(sys.argv[2])
+
+# Don't buffer output by line endings
+sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
+sys.stdin = os.fdopen(sys.stdin.fileno(), 'r', 0)
+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()) + "\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()
+ 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])
+ i = i[4096:]
+ if sys.stdin in ready:
+ echonocbreak(sys.stdin.fileno())
+ o = raw_input()
+ cbreaknoecho(sys.stdin.fileno())
+ pty.write(o + "\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/import-layers/yocto-poky/scripts/opkg-query-helper.py b/import-layers/yocto-poky/scripts/opkg-query-helper.py
new file mode 100755
index 000000000..2fb1a7897
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/opkg-query-helper.py
@@ -0,0 +1,85 @@
+#!/usr/bin/env python
+
+# 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/import-layers/yocto-poky/scripts/postinst-intercepts/postinst_intercept b/import-layers/yocto-poky/scripts/postinst-intercepts/postinst_intercept
new file mode 100755
index 000000000..b18e806d4
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/postinst-intercepts/update_font_cache b/import-layers/yocto-poky/scripts/postinst-intercepts/update_font_cache
new file mode 100644
index 000000000..bf65e19a4
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/postinst-intercepts/update_gio_module_cache b/import-layers/yocto-poky/scripts/postinst-intercepts/update_gio_module_cache
new file mode 100644
index 000000000..fe468092c
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/postinst-intercepts/update_gio_module_cache
@@ -0,0 +1,7 @@
+#!/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/
+
diff --git a/import-layers/yocto-poky/scripts/postinst-intercepts/update_icon_cache b/import-layers/yocto-poky/scripts/postinst-intercepts/update_icon_cache
new file mode 100644
index 000000000..9cf2a72a0
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/postinst-intercepts/update_pixbuf_cache b/import-layers/yocto-poky/scripts/postinst-intercepts/update_pixbuf_cache
new file mode 100644
index 000000000..5d44075fb
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/pybootchartgui/AUTHORS b/import-layers/yocto-poky/scripts/pybootchartgui/AUTHORS
new file mode 100644
index 000000000..672b7e952
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/pybootchartgui/COPYING b/import-layers/yocto-poky/scripts/pybootchartgui/COPYING
new file mode 100644
index 000000000..ed87acf94
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/pybootchartgui/MAINTAINERS b/import-layers/yocto-poky/scripts/pybootchartgui/MAINTAINERS
new file mode 100644
index 000000000..c65e1315f
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/pybootchartgui/NEWS b/import-layers/yocto-poky/scripts/pybootchartgui/NEWS
new file mode 100644
index 000000000..7c5b2fc3a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/pybootchartgui/README.pybootchart b/import-layers/yocto-poky/scripts/pybootchartgui/README.pybootchart
new file mode 100644
index 000000000..8642e6467
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui.py b/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui.py
new file mode 100755
index 000000000..7ce1a5be4
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/__init__.py b/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/__init__.py
diff --git a/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/batch.py b/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/batch.py
new file mode 100644
index 000000000..05c714e95
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/draw.py b/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/draw.py
new file mode 100644
index 000000000..8c574be50
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/draw.py
@@ -0,0 +1,894 @@
+# 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)
+
+# 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
+ # 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
+
+ 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
+ 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
+ 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 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.records['MemTotal'] - sample.records['MemFree'] 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.records['SwapTotal'] - sample.records['SwapFree'])/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.records['MemTotal'] - sample.records['MemFree']) for sample in trace.mem_stats], \
+ proc_tree, [0, mem_scale])
+ draw_chart(ctx, MEM_USED_COLOR, True, chart_rect, \
+ [(sample.time, sample.records['MemTotal'] - sample.records['MemFree'] - sample.records['Buffers']) for sample in mem_stats], \
+ proc_tree, [0, mem_scale])
+ draw_chart(ctx, MEM_CACHED_COLOR, True, chart_rect, \
+ [(sample.time, sample.records['Cached']) for sample in mem_stats], \
+ proc_tree, [0, mem_scale])
+ draw_chart(ctx, MEM_SWAP_COLOR, False, chart_rect, \
+ [(sample.time, float(sample.records['SwapTotal'] - sample.records['SwapFree'])) 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 - (curr_y+header_h) + 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;
+
+ 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;
+
+ if options.charts:
+ curr_y = render_charts (ctx, options, clip, trace, curr_y, w, h, sec_w)
+
+ # 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/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/gui.py b/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/gui.py
new file mode 100644
index 000000000..7fedd232d
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/main.py b/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/main.py
new file mode 120000
index 000000000..b45ae0a3d
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/main.py
@@ -0,0 +1 @@
+main.py.in \ No newline at end of file
diff --git a/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/main.py.in b/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/main.py.in
new file mode 100644
index 000000000..21bb0be3a
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/main.py.in
@@ -0,0 +1,187 @@
+#
+# ***********************************************************************
+# 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/>.
+
+from __future__ import print_function
+
+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
+ print(time * 10, file=f)
+ else:
+ print(file=f)
+ 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/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/parsing.py b/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/parsing.py
new file mode 100644
index 000000000..d423b9f77
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/parsing.py
@@ -0,0 +1,740 @@
+# 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/>.
+
+
+from __future__ import with_statement
+
+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 = None
+ self.ps_stats = None
+ self.taskstats = None
+ self.cpu_stats = None
+ self.cmdline = None
+ self.kernel = None
+ self.kernel_tree = None
+ self.filename = None
+ self.parent_map = None
+ self.mem_stats = None
+
+ 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())
+
+ 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_proc_disk_stat_log(file, numCpu):
+ """
+ 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 / numCpu
+ util = max(0.0, min(1.0, util))
+ disk_stats.append(DiskSample(sample2.time, readTput, writeTput, util))
+
+ return disk_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\"" % match.groups(0))
+ sample.add_value(match.group(1), int(match.group(2)))
+
+ if sample.valid():
+ mem_stats.append(sample)
+
+ return mem_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 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()
+ 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)
+ 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/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/process_tree.py b/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/process_tree.py
new file mode 100644
index 000000000..cf88110b1
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/samples.py b/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/samples.py
new file mode 100644
index 000000000..015d743aa
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/samples.py
@@ -0,0 +1,151 @@
+# 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 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/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/tests/parser_test.py b/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/tests/parser_test.py
new file mode 100644
index 000000000..00fb3bf79
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/tests/process_tree_test.py b/import-layers/yocto-poky/scripts/pybootchartgui/pybootchartgui/tests/process_tree_test.py
new file mode 100644
index 000000000..6f46a1c03
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/pythondeps b/import-layers/yocto-poky/scripts/pythondeps
new file mode 100755
index 000000000..ff92e747e
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/pythondeps
@@ -0,0 +1,250 @@
+#!/usr/bin/env python
+#
+# 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.iteritems():
+ 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/import-layers/yocto-poky/scripts/recipetool b/import-layers/yocto-poky/scripts/recipetool
new file mode 100755
index 000000000..6c6648756
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/recipetool
@@ -0,0 +1,121 @@
+#!/usr/bin/env python
+
+# 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.prepare(not parserecipes)
+ tinfoil.logger.setLevel(logger.getEffectiveLevel())
+ 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>')
+
+ 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)
+
+ scriptutils.logger_setup_color(logger, global_args.color)
+
+ tinfoil = tinfoil_init(False)
+ for path in ([scripts_path] +
+ tinfoil.config_data.getVar('BBPATH', True).split(':')):
+ 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
+
+ return ret
+
+
+if __name__ == "__main__":
+ try:
+ ret = main()
+ except Exception:
+ ret = 1
+ import traceback
+ traceback.print_exc()
+ sys.exit(ret)
diff --git a/import-layers/yocto-poky/scripts/relocate_sdk.py b/import-layers/yocto-poky/scripts/relocate_sdk.py
new file mode 100755
index 000000000..99fca86a1
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/relocate_sdk.py
@@ -0,0 +1,264 @@
+#!/usr/bin/env python
+#
+# 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 (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/import-layers/yocto-poky/scripts/rootfs_rpm-extract-postinst.awk b/import-layers/yocto-poky/scripts/rootfs_rpm-extract-postinst.awk
new file mode 100644
index 000000000..8f2836b32
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/rpm2cpio.sh b/import-layers/yocto-poky/scripts/rpm2cpio.sh
new file mode 100755
index 000000000..5df8c0f70
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/rpm2cpio.sh
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+# This comes from the RPM5 5.4.0 distribution.
+
+pkg=$1
+if [ "$pkg" = "" -o ! -e "$pkg" ]; then
+ echo "no package supplied" 1>&2
+ exit 1
+fi
+
+leadsize=96
+o=`expr $leadsize + 8`
+set `od -j $o -N 8 -t u1 $pkg`
+il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`
+dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`
+# echo "sig il: $il dl: $dl"
+
+sigsize=`expr 8 + 16 \* $il + $dl`
+o=`expr $o + $sigsize + \( 8 - \( $sigsize \% 8 \) \) \% 8 + 8`
+set `od -j $o -N 8 -t u1 $pkg`
+il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`
+dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`
+# echo "hdr il: $il dl: $dl"
+
+hdrsize=`expr 8 + 16 \* $il + $dl`
+o=`expr $o + $hdrsize`
+EXTRACTOR="dd if=$pkg ibs=$o skip=1"
+
+COMPRESSION=`($EXTRACTOR |file -) 2>/dev/null`
+if echo $COMPRESSION |grep -iq gzip; then
+ DECOMPRESSOR=gunzip
+elif echo $COMPRESSION |grep -iq bzip2; then
+ DECOMPRESSOR=bunzip2
+elif echo $COMPRESSION |grep -iq xz; then
+ DECOMPRESSOR=unxz
+elif echo $COMPRESSION |grep -iq cpio; then
+ DECOMPRESSOR=cat
+else
+ # Most versions of file don't support LZMA, therefore we assume
+ # anything not detected is LZMA
+ DECOMPRESSOR=`which unlzma 2>/dev/null`
+ case "$DECOMPRESSOR" in
+ /* ) ;;
+ * ) DECOMPRESSOR=`which lzmash 2>/dev/null`
+ case "$DECOMPRESSOR" in
+ /* ) DECOMPRESSOR="lzmash -d -c" ;;
+ * ) DECOMPRESSOR=cat ;;
+ esac
+ ;;
+ esac
+fi
+
+$EXTRACTOR 2>/dev/null | $DECOMPRESSOR
diff --git a/import-layers/yocto-poky/scripts/runqemu b/import-layers/yocto-poky/scripts/runqemu
new file mode 100755
index 000000000..d7fa941a6
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/runqemu
@@ -0,0 +1,546 @@
+#!/bin/bash
+#
+# Handle running OE images standalone with QEMU
+#
+# 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() {
+ MYNAME=`basename $0`
+cat <<_EOF
+
+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 - disables video console
+ serial - enables a serial console on /dev/ttyS0
+ kvm - enables KVM when running qemux86/qemux86-64 (VT-capable CPU required)
+ kvm-vhost - enables KVM with vhost support when running qemux86/qemux86-64 (VT-capable CPU required)
+ publicvnc - enable a VNC server open to all hosts
+ qemuparams="xyz" - specify custom parameters to QEMU
+ bootparams="xyz" - specify custom kernel parameters during boot
+
+Examples:
+ $MYNAME qemuarm
+ $MYNAME qemux86-64 core-image-sato ext4
+ $MYNAME qemux86-64 wic-image-minimal wic
+ $MYNAME path/to/bzImage-qemux86.bin path/to/nfsrootdir/ serial
+ $MYNAME qemux86 iso/hddimg/vmdk/qcow2/vdi/ramfs/cpio.gz...
+ $MYNAME qemux86 qemuparams="-m 256"
+ $MYNAME qemux86 bootparams="psplash=false"
+ $MYNAME path/to/<image>-<machine>.vmdk
+ $MYNAME path/to/<image>-<machine>.wic
+_EOF
+ exit 1
+}
+
+if [ "x$1" = "x" ]; then
+ usage
+fi
+
+error() {
+ echo "Error: "$*
+ usage
+}
+
+MACHINE=${MACHINE:=""}
+KERNEL=${KERNEL:=""}
+ROOTFS=${ROOTFS:=""}
+FSTYPE=${FSTYPE:=""}
+LAZY_ROOTFS=""
+SCRIPT_QEMU_OPT=""
+SCRIPT_QEMU_EXTRA_OPT=""
+SCRIPT_KERNEL_OPT=""
+SERIALSTDIO=""
+TCPSERIAL_PORTNUM=""
+KVM_ENABLED="no"
+KVM_ACTIVE="no"
+VHOST_ENABLED="no"
+VHOST_ACTIVE="no"
+IS_VM="false"
+
+# Determine whether the file is a kernel or QEMU image, and set the
+# appropriate variables
+process_filename() {
+ filename=$1
+
+ # Extract the filename extension
+ EXT=`echo $filename | awk -F . '{ print \$NF }'`
+ case /$EXT/ in
+ /bin/)
+ # A file ending in .bin is a kernel
+ [ -z "$KERNEL" ] && KERNEL=$filename || \
+ error "conflicting KERNEL args [$KERNEL] and [$filename]"
+ ;;
+ /ext[234]/|/jffs2/|/btrfs/)
+ # A file ending in a supportted fs type is a rootfs image
+ if [ -z "$FSTYPE" -o "$FSTYPE" = "$EXT" ]; then
+ FSTYPE=$EXT
+ ROOTFS=$filename
+ else
+ error "conflicting FSTYPE types [$FSTYPE] and [$EXT]"
+ fi
+ ;;
+ /hddimg/|/hdddirect/|/vmdk/|/wic/|/qcow2/|/vdi/)
+ FSTYPE=$EXT
+ VM=$filename
+ ROOTFS=$filename
+ IS_VM="true"
+ ;;
+ *)
+ error "unknown file arg [$filename]"
+ ;;
+ esac
+}
+
+check_fstype_conflicts() {
+ if [ -z "$FSTYPE" -o "$FSTYPE" = "$1" ]; then
+ FSTYPE=$1
+ else
+ error "conflicting FSTYPE types [$FSTYPE] and [$1]"
+ fi
+}
+# Parse command line args without requiring specific ordering. It's a
+# bit more complex, but offers a great user experience.
+while true; do
+ arg=${1}
+ case "$arg" in
+ "qemux86" | "qemux86-64" | "qemuarm" | "qemuarm64" | "qemumips" | "qemumipsel" | \
+ "qemumips64" | "qemush4" | "qemuppc" | "qemumicroblaze" | "qemuzynq")
+ [ -z "$MACHINE" -o "$MACHINE" = "$arg" ] && MACHINE=$arg || \
+ error "conflicting MACHINE types [$MACHINE] and [$arg]"
+ ;;
+ "ext"[234] | "jffs2" | "nfs" | "btrfs")
+ check_fstype_conflicts $arg
+ ;;
+ "hddimg" | "hdddirect" | "wic" | "vmdk" | "qcow2" | "vdi" | "iso")
+ check_fstype_conflicts $arg
+ IS_VM="true"
+ ;;
+ "ramfs" | "cpio.gz")
+ FSTYPE=cpio.gz
+ ;;
+ "nographic")
+ SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -nographic"
+ SCRIPT_KERNEL_OPT="$SCRIPT_KERNEL_OPT console=ttyS0"
+ ;;
+ "serial")
+ SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -serial stdio"
+ SCRIPT_KERNEL_OPT="$SCRIPT_KERNEL_OPT console=ttyS0"
+ SERIALSTDIO="1"
+ ;;
+ "tcpserial="*)
+ TCPSERIAL_PORTNUM=${arg##tcpserial=}
+ ;;
+ "biosdir="*)
+ CUSTOMBIOSDIR="${arg##biosdir=}"
+ ;;
+ "biosfilename="*)
+ SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -bios ${arg##biosfilename=}"
+ ;;
+ "qemuparams="*)
+ SCRIPT_QEMU_EXTRA_OPT="${arg##qemuparams=}"
+
+ # Warn user if they try to specify serial or kvm options
+ # to use simplified options instead
+ serial_option=`expr "$SCRIPT_QEMU_EXTRA_OPT" : '.*\(-serial\)'`
+ kvm_option=`expr "$SCRIPT_QEMU_EXTRA_OPT" : '.*\(-enable-kvm\)'`
+ vga_option=`expr "$SCRIPT_QEMU_EXTRA_OPT" : '.*\(-vga\)'`
+ [ ! -z "$serial_option" -o ! -z "$kvm_option" ] && \
+ echo "Please use simplified serial or kvm options instead"
+ ;;
+ "bootparams="*)
+ SCRIPT_KERNEL_OPT="$SCRIPT_KERNEL_OPT ${arg##bootparams=}"
+ ;;
+ "audio")
+ if [ "x$MACHINE" = "xqemux86" -o "x$MACHINE" = "xqemux86-64" ]; then
+ echo "Enabling audio in qemu."
+ echo "Please install snd_intel8x0 or snd_ens1370 driver in linux guest."
+ QEMU_AUDIO_DRV="alsa"
+ SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -soundhw ac97,es1370"
+ fi
+ ;;
+ "kvm")
+ KVM_ENABLED="yes"
+ KVM_CAPABLE=`grep -q 'vmx\|svm' /proc/cpuinfo && echo 1`
+ ;;
+ "kvm-vhost")
+ KVM_ENABLED="yes"
+ KVM_CAPABLE=`grep -q 'vmx\|svm' /proc/cpuinfo && echo 1`
+ VHOST_ENABLED="yes"
+ ;;
+ "slirp")
+ SLIRP_ENABLED="yes"
+ ;;
+ "publicvnc")
+ SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -vnc :0"
+ ;;
+ *-image*)
+ [ -z "$ROOTFS" ] || \
+ error "conflicting ROOTFS args [$ROOTFS] and [$arg]"
+ if [ -f "$arg" ]; then
+ process_filename $arg
+ elif [ -d "$arg" ]; then
+ # Handle the case where the nfsroot dir has -image-
+ # in the pathname
+ echo "Assuming $arg is an nfs rootfs"
+ FSTYPE=nfs
+ ROOTFS=$arg
+ else
+ ROOTFS=$arg
+ LAZY_ROOTFS="true"
+ fi
+ ;;
+ "") break ;;
+ *)
+ # A directory name is an nfs rootfs
+ if [ -d "$arg" ]; then
+ echo "Assuming $arg is an nfs rootfs"
+ if [ -z "$FSTYPE" -o "$FSTYPE" = "nfs" ]; then
+ FSTYPE=nfs
+ else
+ error "conflicting FSTYPE types [$arg] and nfs"
+ fi
+
+ if [ -z "$ROOTFS" ]; then
+ ROOTFS=$arg
+ else
+ error "conflicting ROOTFS args [$ROOTFS] and [$arg]"
+ fi
+ elif [ -f "$arg" ]; then
+ process_filename $arg
+ else
+ error "unable to classify arg [$arg]"
+ fi
+ ;;
+ esac
+ shift
+done
+
+if [ ! -c /dev/net/tun ] ; then
+ echo "TUN control device /dev/net/tun is unavailable; you may need to enable TUN (e.g. sudo modprobe tun)"
+ exit 1
+elif [ ! -w /dev/net/tun ] ; then
+ echo "TUN control device /dev/net/tun is not writable, please fix (e.g. sudo chmod 666 /dev/net/tun)"
+ exit 1
+fi
+
+# Report errors for missing combinations of options
+if [ -z "$MACHINE" -a -z "$KERNEL" -a -z "$VM" -a "$FSTYPE" != "wic" ]; then
+ error "you must specify at least a MACHINE or KERNEL argument"
+fi
+if [ "$FSTYPE" = "nfs" -a -z "$ROOTFS" ]; then
+ error "NFS booting without an explicit ROOTFS path is not yet supported"
+fi
+
+if [ -z "$MACHINE" ]; then
+ if [ "$IS_VM" = "true" ]; then
+ [ "x$FSTYPE" = "xwic" ] && filename=$ROOTFS || filename=$VM
+ MACHINE=`basename $filename | sed -n 's/.*\(qemux86-64\|qemux86\|qemuarm64\|qemuarm\|qemumips64\|qemumips\|qemuppc\|qemush4\).*/\1/p'`
+ if [ -z "$MACHINE" ]; then
+ error "Unable to set MACHINE from image filename [$VM]"
+ fi
+ echo "Set MACHINE to [$MACHINE] based on image [$VM]"
+ else
+ MACHINE=`basename $KERNEL | sed -n 's/.*\(qemux86-64\|qemux86\|qemuarm64\|qemuarm\|qemumips64\|qemumips\|qemuppc\|qemush4\).*/\1/p'`
+ if [ -z "$MACHINE" ]; then
+ error "Unable to set MACHINE from kernel filename [$KERNEL]"
+ fi
+ echo "Set MACHINE to [$MACHINE] based on kernel [$KERNEL]"
+ fi
+fi
+
+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"
+# Detect KVM configuration
+if [ "x$KVM_ENABLED" = "xyes" ]; then
+ if [ -z "$KVM_CAPABLE" ]; then
+ echo "You are trying to enable KVM on a cpu without VT support."
+ echo "Remove kvm from the command-line, or refer"
+ echo "$YOCTO_KVM_WIKI";
+ exit 1;
+ fi
+ if [ "x$MACHINE" != "xqemux86" -a "x$MACHINE" != "xqemux86-64" ]; then
+ echo "KVM only support x86 & x86-64. Remove kvm from the command-line";
+ exit 1;
+ fi
+ if [ ! -e /dev/kvm ]; then
+ echo "Missing KVM device. Have you inserted kvm modules?"
+ echo "For further help see:"
+ echo "$YOCTO_KVM_WIKI";
+ exit 1;
+ fi
+ if [ -w /dev/kvm -a -r /dev/kvm ]; then
+ SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -enable-kvm"
+ KVM_ACTIVE="yes"
+ else
+ echo "You have no rights on /dev/kvm."
+ echo "Please change the ownership of this file as described at:"
+ echo "$YOCTO_KVM_WIKI";
+ exit 1;
+ fi
+ if [ "x$VHOST_ENABLED" = "xyes" ]; then
+ if [ ! -e /dev/vhost-net ]; then
+ echo "Missing virtio net device. Have you inserted vhost-net module?"
+ echo "For further help see:"
+ echo "$YOCTO_PARAVIRT_KVM_WIKI";
+ exit 1;
+ fi
+
+ if [ -w /dev/vhost-net -a -r /dev/vhost-net ]; then
+ VHOST_ACTIVE="yes"
+ else
+ echo "You have no rights on /dev/vhost-net."
+ echo "Please change the ownership of this file as described at:"
+ echo "$YOCTO_KVM_WIKI";
+ exit 1;
+ fi
+ fi
+fi
+
+machine2=`echo $MACHINE | tr 'a-z' 'A-Z' | sed 's/-/_/'`
+# MACHINE is now set for all cases
+
+# Defaults used when these vars need to be inferred
+QEMUX86_DEFAULT_KERNEL=bzImage-qemux86.bin
+QEMUX86_DEFAULT_FSTYPE=ext4
+
+QEMUX86_64_DEFAULT_KERNEL=bzImage-qemux86-64.bin
+QEMUX86_64_DEFAULT_FSTYPE=ext4
+
+QEMUARM_DEFAULT_KERNEL=zImage-qemuarm.bin
+QEMUARM_DEFAULT_FSTYPE=ext4
+
+QEMUARM64_DEFAULT_KERNEL=Image-qemuarm64.bin
+QEMUARM64_DEFAULT_FSTYPE=ext4
+
+QEMUMIPS_DEFAULT_KERNEL=vmlinux-qemumips.bin
+QEMUMIPS_DEFAULT_FSTYPE=ext4
+
+QEMUMIPSEL_DEFAULT_KERNEL=vmlinux-qemumipsel.bin
+QEMUMIPSEL_DEFAULT_FSTYPE=ext4
+
+QEMUMIPS64_DEFAULT_KERNEL=vmlinux-qemumips64.bin
+QEMUMIPS64_DEFAULT_FSTYPE=ext4
+
+QEMUSH4_DEFAULT_KERNEL=vmlinux-qemumips.bin
+QEMUSH4_DEFAULT_FSTYPE=ext4
+
+QEMUPPC_DEFAULT_KERNEL=vmlinux-qemuppc.bin
+QEMUPPC_DEFAULT_FSTYPE=ext4
+
+QEMUMICROBLAZE_DEFAULT_KERNEL=linux.bin.ub
+QEMUMICROBLAZE_DEFAULT_FSTYPE=cpio
+
+QEMUZYNQ_DEFAULT_KERNEL=uImage
+QEMUZYNQ_DEFAULT_FSTYPE=cpio
+
+setup_path_vars() {
+ if [ -z "$OE_TMPDIR" ] ; then
+ PATHS_REQUIRED=true
+ elif [ "$1" = "1" -a -z "$DEPLOY_DIR_IMAGE" ] ; then
+ PATHS_REQUIRED=true
+ else
+ PATHS_REQUIRED=false
+ fi
+
+ if [ "$PATHS_REQUIRED" = "true" ]; then
+ # Try to get the variable values from bitbake
+ type -P bitbake &>/dev/null || {
+ echo "In order for this script to dynamically infer paths";
+ echo "to kernels or filesystem images, you either need";
+ echo "bitbake in your PATH or to source oe-init-build-env";
+ echo "before running this script" >&2;
+ exit 1; }
+
+ # We have bitbake in PATH, get the variable values from bitbake
+ BITBAKE_ENV_TMPFILE=`mktemp --tmpdir runqemu.XXXXXXXXXX`
+ if [ "$?" != "0" ] ; then
+ echo "Error: mktemp failed for bitbake environment output"
+ exit 1
+ fi
+
+ MACHINE=$MACHINE bitbake -e > $BITBAKE_ENV_TMPFILE
+ if [ -z "$OE_TMPDIR" ] ; then
+ OE_TMPDIR=`sed -n 's/^TMPDIR=\"\(.*\)\"/\1/p' $BITBAKE_ENV_TMPFILE`
+ fi
+ if [ -z "$DEPLOY_DIR_IMAGE" ] ; then
+ DEPLOY_DIR_IMAGE=`sed -n 's/^DEPLOY_DIR_IMAGE=\"\(.*\)\"/\1/p' $BITBAKE_ENV_TMPFILE`
+ fi
+ if [ -z "$OE_TMPDIR" ]; then
+ # Check for errors from bitbake that the user needs to know about
+ BITBAKE_OUTPUT=`cat $BITBAKE_ENV_TMPFILE | wc -l`
+ if [ "$BITBAKE_OUTPUT" -eq "0" ]; then
+ echo "Error: this script needs to be run from your build directory, or you need"
+ echo "to explicitly set OE_TMPDIR and DEPLOY_DIR_IMAGE in your environment"
+ else
+ echo "There was an error running bitbake to determine TMPDIR"
+ echo "Here is the output from 'bitbake -e':"
+ cat $BITBAKE_ENV_TMPFILE
+ fi
+ rm $BITBAKE_ENV_TMPFILE
+ exit 1
+ fi
+ rm $BITBAKE_ENV_TMPFILE
+ fi
+}
+
+setup_sysroot() {
+ # Toolchain installs set up $OECORE_NATIVE_SYSROOT in their
+ # environment script. If that variable isn't set, we're
+ # either in an in-tree build scenario or the environment
+ # script wasn't source'd.
+ if [ -z "$OECORE_NATIVE_SYSROOT" ]; then
+ setup_path_vars
+ BUILD_ARCH=`uname -m`
+ BUILD_OS=`uname | tr '[A-Z]' '[a-z]'`
+ BUILD_SYS="$BUILD_ARCH-$BUILD_OS"
+
+ OECORE_NATIVE_SYSROOT=$OE_TMPDIR/sysroots/$BUILD_SYS
+ fi
+
+ # Some recipes store the BIOS under $OE_TMPDIR/sysroots/$MACHINE,
+ # now defined as OECORE_MACHINE_SYSROOT. The latter is used when searching
+ # BIOS, VGA BIOS and keymaps.
+ if [ -z "$OECORE_MACHINE_SYSROOT" ]; then
+ OECORE_MACHINE_SYSROOT=$OE_TMPDIR/sysroots/$MACHINE
+ fi
+}
+
+# Locate a rootfs image to boot which matches our expected
+# machine and fstype.
+findimage() {
+ where=$1
+ machine=$2
+ extension=$3
+
+ # Sort rootfs candidates by modification time - the most
+ # recently created one is the one we most likely want to boot.
+ filename=`ls -t1 $where/*-image*$machine.$extension 2>/dev/null | head -n1`
+ if [ "x$filename" != "x" ]; then
+ ROOTFS=$filename
+ return
+ fi
+
+ echo "Couldn't find a $machine rootfs image in $where."
+ exit 1
+}
+
+if [ -e "$ROOTFS" -a -z "$FSTYPE" ]; then
+ # Extract the filename extension
+ EXT=`echo $ROOTFS | awk -F . '{ print \$NF }'`
+ if [ "x$EXT" = "xext2" -o "x$EXT" = "xext3" -o \
+ "x$EXT" = "xjffs2" -o "x$EXT" = "xbtrfs" -o \
+ "x$EXT" = "xext4" ]; then
+ FSTYPE=$EXT
+ else
+ echo "Note: Unable to determine filesystem extension for $ROOTFS"
+ echo "We will use the default FSTYPE for $MACHINE"
+ # ...which is done further below...
+ fi
+fi
+
+if [ -z "$KERNEL" -a "$IS_VM" = "false" ]; then \
+ setup_path_vars 1
+ eval kernel_file=\$${machine2}_DEFAULT_KERNEL
+ KERNEL=$DEPLOY_DIR_IMAGE/$kernel_file
+
+ if [ -z "$KERNEL" ]; then
+ error "Unable to determine default kernel for MACHINE [$MACHINE]"
+ fi
+fi
+# KERNEL is now set for all cases
+
+if [ -z "$FSTYPE" ]; then
+ eval FSTYPE=\$${machine2}_DEFAULT_FSTYPE
+
+ if [ -z "$FSTYPE" ]; then
+ error "Unable to determine default fstype for MACHINE [$MACHINE]"
+ fi
+fi
+
+# FSTYPE is now set for all cases
+
+# Handle cases where a ROOTFS type is given instead of a filename, e.g.
+# core-image-sato
+if [ "$LAZY_ROOTFS" = "true" ]; then
+ setup_path_vars 1
+ echo "Assuming $ROOTFS really means $DEPLOY_DIR_IMAGE/$ROOTFS-$MACHINE.$FSTYPE"
+ if [ "$IS_VM" = "true" ]; then
+ VM=$DEPLOY_DIR_IMAGE/$ROOTFS-$MACHINE.$FSTYPE
+ else
+ ROOTFS=$DEPLOY_DIR_IMAGE/$ROOTFS-$MACHINE.$FSTYPE
+ fi
+fi
+
+if [ -z "$ROOTFS" ]; then
+ setup_path_vars 1
+ T=$DEPLOY_DIR_IMAGE
+ eval rootfs_list=\$${machine2}_DEFAULT_ROOTFS
+ findimage $T $MACHINE $FSTYPE
+
+ if [ -z "$ROOTFS" ]; then
+ error "Unable to determine default rootfs for MACHINE [$MACHINE]"
+ elif [ "$IS_VM" = "true" ]; then
+ VM=$ROOTFS
+ fi
+fi
+# ROOTFS is now set for all cases, now expand it to be an absolute path, it should exist at this point
+
+ROOTFS=`readlink -f $ROOTFS`
+
+echo ""
+echo "Continuing with the following parameters:"
+if [ "$IS_VM" = "false" ]; then
+ echo "KERNEL: [$KERNEL]"
+ echo "ROOTFS: [$ROOTFS]"
+else
+ echo "VM: [$VM]"
+fi
+echo "FSTYPE: [$FSTYPE]"
+
+setup_sysroot
+# OECORE_NATIVE_SYSROOT and OECORE_MACHINE_SYSROOT are now set for all cases
+
+INTERNAL_SCRIPT="$0-internal"
+if [ ! -f "$INTERNAL_SCRIPT" -o ! -r "$INTERNAL_SCRIPT" ]; then
+INTERNAL_SCRIPT=`which runqemu-internal`
+fi
+
+# Specify directory for BIOS, VGA BIOS and keymaps
+if [ ! -z "$CUSTOMBIOSDIR" ]; then
+ if [ -d "$OECORE_NATIVE_SYSROOT/$CUSTOMBIOSDIR" ]; then
+ echo "Assuming biosdir is $OECORE_NATIVE_SYSROOT/$CUSTOMBIOSDIR"
+ SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -L $OECORE_NATIVE_SYSROOT/$CUSTOMBIOSDIR"
+ elif [ -d "$OECORE_MACHINE_SYSROOT/$CUSTOMBIOSDIR" ]; then
+ echo "Assuming biosdir is $OECORE_MACHINE_SYSROOT/$CUSTOMBIOSDIR"
+ SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -L $OECORE_MACHINE_SYSROOT/$CUSTOMBIOSDIR"
+ else
+ if [ ! -d "$CUSTOMBIOSDIR" ]; then
+ echo "Custom BIOS directory not found. Tried: $CUSTOMBIOSDIR"
+ echo "and $OECORE_NATIVE_SYSROOT/$CUSTOMBIOSDIR"
+ echo "and $OECORE_MACHINE_SYSROOT/$CUSTOMBIOSDIR"
+ exit 1;
+ fi
+ echo "Assuming biosdir is $CUSTOMBIOSDIR"
+ SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -L $CUSTOMBIOSDIR"
+ fi
+fi
+
+. $INTERNAL_SCRIPT
+exit $?
diff --git a/import-layers/yocto-poky/scripts/runqemu-addptable2image b/import-layers/yocto-poky/scripts/runqemu-addptable2image
new file mode 100755
index 000000000..f0195ad8a
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/runqemu-export-rootfs b/import-layers/yocto-poky/scripts/runqemu-export-rootfs
new file mode 100755
index 000000000..3dee13116
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/runqemu-export-rootfs
@@ -0,0 +1,163 @@
+#!/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
+
+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
+
+# rpc.mountd RPC port
+NFS_MOUNTPROG=$[ 21111 + $NFS_INSTANCE ]
+# rpc.nfsd RPC port
+NFS_NFSPROG=$[ 11111 + $NFS_INSTANCE ]
+# NFS port number
+NFS_PORT=$[ 3049 + 2 * $NFS_INSTANCE ]
+# mountd port number
+MOUNT_PORT=$[ 3048 + 2 * $NFS_INSTANCE ]
+
+## For debugging you would additionally add
+## --debug all
+UNFSD_OPTS="-p -N -i $NFSPID -e $EXPORTS -x $NFS_NFSPROG -n $NFS_PORT -y $NFS_MOUNTPROG -m $MOUNT_PORT"
+
+# Setup the exports file
+if [ "$1" = "start" ]; then
+ echo "Creating exports file..."
+ echo "$NFS_EXPORT_DIR (rw,async,no_root_squash,no_all_squash,insecure)" > $EXPORTS
+fi
+
+# 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 "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,mountprog=$MOUNTD_RPCPORT,nfsprog=$NFSD_RPCPORT,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/import-layers/yocto-poky/scripts/runqemu-extract-sdk b/import-layers/yocto-poky/scripts/runqemu-extract-sdk
new file mode 100755
index 000000000..32ddd485b
--- /dev/null
+++ b/import-layers/yocto-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
+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/import-layers/yocto-poky/scripts/runqemu-gen-tapdevs b/import-layers/yocto-poky/scripts/runqemu-gen-tapdevs
new file mode 100755
index 000000000..624deacb7
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/runqemu-gen-tapdevs
@@ -0,0 +1,100 @@
+#!/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> <native-sysroot-basedir>"
+ 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"
+ 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
+SYSROOT=$4
+
+TUNCTL=$SYSROOT/usr/bin/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
+
+# 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
+
+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 $SYSROOT 2>&1`
+ if [ $? -ne 0 ]; then
+ echo "Error running tunctl: $ifup"
+ exit 1
+ fi
+done
+
+if [ $COUNT -gt 0 ]; then
+ 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*"
+fi
+
+# 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
diff --git a/import-layers/yocto-poky/scripts/runqemu-ifdown b/import-layers/yocto-poky/scripts/runqemu-ifdown
new file mode 100755
index 000000000..8f66cfa2a
--- /dev/null
+++ b/import-layers/yocto-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
+NATIVE_SYSROOT_DIR=$2
+
+TUNCTL=$NATIVE_SYSROOT_DIR/usr/bin/tunctl
+if [ ! -e "$TUNCTL" ]; then
+ echo "Error: Unable to find tunctl binary in '$NATIVE_SYSROOT_DIR/usr/bin', 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/import-layers/yocto-poky/scripts/runqemu-ifup b/import-layers/yocto-poky/scripts/runqemu-ifup
new file mode 100755
index 000000000..d9bd89412
--- /dev/null
+++ b/import-layers/yocto-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"
+NATIVE_SYSROOT_DIR=$3
+
+TUNCTL=$NATIVE_SYSROOT_DIR/usr/bin/tunctl
+if [ ! -x "$TUNCTL" ]; then
+ echo "Error: Unable to find tunctl binary in '$NATIVE_SYSROOT_DIR/usr/bin', 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/import-layers/yocto-poky/scripts/runqemu-internal b/import-layers/yocto-poky/scripts/runqemu-internal
new file mode 100755
index 000000000..ac1c703c5
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/runqemu-internal
@@ -0,0 +1,717 @@
+#!/bin/bash -x
+
+# Handle running OE images under qemu
+#
+# 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.
+
+# Call setting:
+# QEMU_MEMORY (optional) - set the amount of memory in the emualted system.
+# SERIAL_LOGFILE (optional) - log the serial port output to a file
+#
+# Image options:
+# MACHINE - the machine to run
+# FSTYPE - the image type to run
+# KERNEL - the kernel image file to use
+# ROOTFS - the disk image file to use
+#
+
+mem_size=-1
+
+#Get rid of <> and get the contents of extra qemu running params
+SCRIPT_QEMU_EXTRA_OPT=`echo $SCRIPT_QEMU_EXTRA_OPT | sed -e 's/<//' -e 's/>//'`
+#if user set qemu memory, eg: -m 256 in qemu extra params, we need to do some
+# validation check
+mem_set=`expr "$SCRIPT_QEMU_EXTRA_OPT" : '.*\(-m[[:space:]] *[0-9]*\)'`
+if [ ! -z "$mem_set" ] ; then
+#Get memory setting size from user input
+ mem_size=`echo $mem_set | sed 's/-m[[:space:]] *//'`
+fi
+
+# 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"
+
+QEMUIFUP=`which runqemu-ifup 2> /dev/null`
+QEMUIFDOWN=`which runqemu-ifdown 2> /dev/null`
+if [ -z "$QEMUIFUP" -o ! -x "$QEMUIFUP" ]; then
+ echo "runqemu-ifup cannot be found or executed"
+ exit 1
+fi
+if [ -z "$QEMUIFDOWN" -o ! -x "$QEMUIFDOWN" ]; then
+ echo "runqemu-ifdown cannot be found or executed"
+ exit 1
+fi
+
+NFSRUNNING="false"
+
+#capture original stty values
+ORIG_STTY=$(stty -g)
+
+if [ "$SLIRP_ENABLED" = "yes" ]; then
+ KERNEL_NETWORK_CMD="ip=dhcp"
+ QEMU_TAP_CMD=""
+ QEMU_UI_OPTIONS="-show-cursor -usb -usbdevice tablet"
+ QEMU_NETWORK_CMD=""
+ DROOT="/dev/vda"
+ ROOTFS_OPTIONS="-drive file=$ROOTFS,if=virtio,format=raw"
+else
+ acquire_lock() {
+ lockfile=$1
+ if [ -z "$lockfile" ]; then
+ echo "Error: missing lockfile arg passed to acquire_lock()"
+ return 1
+ fi
+
+ touch $lockfile.lock 2>/dev/null
+ if [ $? -ne 0 ]; then
+ echo "Acquiring lockfile for $lockfile.lock failed"
+ return 1
+ fi
+ exec 8>$lockfile.lock
+ flock -n -x 8
+ if [ $? -ne 0 ]; then
+ exec 8>&-
+ return 1
+ fi
+
+ return 0
+ }
+
+ release_lock() {
+ lockfile=$1
+ if [ -z "$lockfile" ]; then
+ echo "Error: missing lockfile arg passed to release_lock()"
+ return 1
+ fi
+
+ rm -f $lockfile.lock
+ exec 8>&-
+ }
+
+ LOCKDIR="/tmp/qemu-tap-locks"
+ if [ ! -d "$LOCKDIR" ]; then
+ mkdir $LOCKDIR
+ chmod 777 $LOCKDIR
+ fi
+
+ IFCONFIG=`which ip 2> /dev/null`
+ if [ -z "$IFCONFIG" ]; then
+ IFCONFIG=/sbin/ip
+ fi
+ if [ ! -x "$IFCONFIG" ]; then
+ echo "$IFCONFIG cannot be executed"
+ exit 1
+ fi
+
+ POSSIBLE=`$IFCONFIG link | grep 'tap' | awk '{print $2}' | sed -e 's/://' -e 's/@.*//'`
+ TAP=""
+ LOCKFILE=""
+ USE_PRECONF_TAP="no"
+ for tap in $POSSIBLE; do
+ LOCKFILE="$LOCKDIR/$tap"
+ if [ -e "$LOCKFILE.skip" ]; then
+ echo "Found $LOCKFILE.skip, skipping $tap"
+ continue
+ fi
+ echo "Acquiring lockfile for $tap..."
+ acquire_lock $LOCKFILE
+ if [ $? -eq 0 ]; then
+ TAP=$tap
+ USE_PRECONF_TAP="yes"
+ break
+ fi
+ done
+
+ if [ "$TAP" = "" ]; then
+ if [ -e "$NOSUDO_FLAG" ]; then
+ echo "Error: There are no available tap devices to use for networking,"
+ echo "and I see $NOSUDO_FLAG exists, so I am not going to try creating"
+ echo "a new one with sudo."
+ exit 1
+ fi
+
+ GROUPID=`id -g`
+ USERID=`id -u`
+ echo "Setting up tap interface under sudo"
+ # Redirect stderr since we could see a LD_PRELOAD warning here if pseudo is loaded
+ # but inactive. This looks scary but is harmless
+ tap=`sudo $QEMUIFUP $USERID $GROUPID $OECORE_NATIVE_SYSROOT 2> /dev/null`
+ if [ $? -ne 0 ]; then
+ # Re-run standalone to see verbose errors
+ sudo $QEMUIFUP $USERID $GROUPID $OECORE_NATIVE_SYSROOT
+ return 1
+ fi
+ LOCKFILE="$LOCKDIR/$tap"
+ echo "Acquiring lockfile for $tap..."
+ acquire_lock $LOCKFILE
+ if [ $? -eq 0 ]; then
+ TAP=$tap
+ fi
+ else
+ echo "Using preconfigured tap device '$TAP'"
+ echo "If this is not intended, touch $LOCKFILE.skip to make runqemu skip $TAP."
+ fi
+
+ cleanup() {
+ if [ ! -e "$NOSUDO_FLAG" -a "$USE_PRECONF_TAP" = "no" ]; then
+ # Redirect stderr since we could see a LD_PRELOAD warning here if pseudo is loaded
+ # but inactive. This looks scary but is harmless
+ sudo $QEMUIFDOWN $TAP $OECORE_NATIVE_SYSROOT 2> /dev/null
+ fi
+ echo "Releasing lockfile of preconfigured tap device '$TAP'"
+ release_lock $LOCKFILE
+
+ if [ "$NFSRUNNING" = "true" ]; then
+ echo "Shutting down the userspace NFS server..."
+ echo "runqemu-export-rootfs stop $ROOTFS"
+ runqemu-export-rootfs stop $ROOTFS
+ fi
+ # If QEMU crashes or somehow tty properties are not restored
+ # after qemu exits, we need to run stty sane
+ #stty sane
+
+ #instead of using stty sane we set the original stty values
+ stty ${ORIG_STTY}
+
+ }
+
+
+ n0=$(echo $TAP | sed 's/tap//')
+
+ case $n0 in
+ ''|*[!0-9]*)
+ echo "Error Couldn't turn $TAP into an interface number?"
+ exit 1
+ ;;
+ esac
+
+ n1=$(($n0 * 2 + 1))
+ n2=$(($n1 + 1))
+
+ KERNEL_NETWORK_CMD="ip=192.168.7.$n2::192.168.7.$n1:255.255.255.0"
+ QEMU_TAP_CMD="-net tap,vlan=0,ifname=$TAP,script=no,downscript=no"
+ if [ "$VHOST_ACTIVE" = "yes" ]; then
+ QEMU_NETWORK_CMD="-net nic,model=virtio $QEMU_TAP_CMD,vhost=on"
+ else
+ QEMU_NETWORK_CMD="-net nic,model=virtio $QEMU_TAP_CMD"
+ fi
+ DROOT="/dev/vda"
+ ROOTFS_OPTIONS="-drive file=$ROOTFS,if=virtio,format=raw"
+
+ KERNCMDLINE="mem=$QEMU_MEMORY"
+ QEMU_UI_OPTIONS="-show-cursor -usb -usbdevice tablet"
+
+ NFS_INSTANCE=`echo $TAP | sed 's/tap//'`
+ export NFS_INSTANCE
+
+ SERIALOPTS=""
+ if [ "x$SERIAL_LOGFILE" != "x" ]; then
+ SERIALOPTS="-serial file:$SERIAL_LOGFILE"
+ fi
+fi
+
+if [ ! -f "$KERNEL" -a "$IS_VM" = "false" ]; then
+ echo "Error: Kernel image file $KERNEL doesn't exist"
+ cleanup
+ return 1
+fi
+
+if [ "$FSTYPE" != "nfs" -a "$IS_VM" = "false" -a ! -f "$ROOTFS" ]; then
+ echo "Error: Image file $ROOTFS doesn't exist"
+ cleanup
+ return 1
+fi
+
+if [ "$NFS_SERVER" = "" ]; then
+ NFS_SERVER="192.168.7.1"
+ if [ "$SLIRP_ENABLED" = "yes" ]; then
+ NFS_SERVER="10.0.2.2"
+ fi
+fi
+
+if [ "$FSTYPE" = "nfs" ]; then
+ NFS_DIR=`echo $ROOTFS | sed 's/^[^:]*:\(.*\)/\1/'`
+ if [ "$NFS_INSTANCE" = "" ] ; then
+ NFS_INSTANCE=0
+ fi
+ MOUNTD_RPCPORT=$[ 21111 + $NFS_INSTANCE ]
+ NFSD_RPCPORT=$[ 11111 + $NFS_INSTANCE ]
+ NFSD_PORT=$[ 3049 + 2 * $NFS_INSTANCE ]
+ MOUNTD_PORT=$[ 3048 + 2 * $NFS_INSTANCE ]
+ UNFS_OPTS="nfsvers=3,port=$NFSD_PORT,mountprog=$MOUNTD_RPCPORT,nfsprog=$NFSD_RPCPORT,udp,mountport=$MOUNTD_PORT"
+
+ PSEUDO_LOCALSTATEDIR=~/.runqemu-sdk/pseudo
+ export PSEUDO_LOCALSTATEDIR
+
+ # Start the userspace NFS server
+ echo "runqemu-export-rootfs restart $ROOTFS"
+ runqemu-export-rootfs restart $ROOTFS
+ if [ $? != 0 ]; then
+ return 1
+ fi
+ NFSRUNNING="true"
+fi
+
+
+set_mem_size() {
+ if [ ! -z "$mem_set" ] ; then
+ #Get memory setting size from user input
+ mem_size=`echo $mem_set | sed 's/-m[[:space:]] *//'`
+ else
+ mem_size=$1
+ fi
+ # QEMU_MEMORY has 'M' appended to mem_size
+ QEMU_MEMORY="$mem_size"M
+
+}
+
+config_qemuarm() {
+ set_mem_size 128
+ QEMU=qemu-system-arm
+ MACHINE_SUBTYPE=versatilepb
+ export QEMU_AUDIO_DRV="none"
+ QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS"
+ if [ "${FSTYPE:0:3}" = "ext" -o "$FSTYPE" = "btrfs" -o "$FSTYPE" = "wic" ]; then
+ KERNCMDLINE="root=$DROOT rw console=ttyAMA0,115200 console=tty $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY highres=off"
+ QEMUOPTIONS="$QEMU_NETWORK_CMD -M ${MACHINE_SUBTYPE} $ROOTFS_OPTIONS -no-reboot $QEMU_UI_OPTIONS"
+ fi
+ if [ "$FSTYPE" = "nfs" ]; then
+ if [ "$NFS_SERVER" = "192.168.7.1" -a ! -d "$NFS_DIR" ]; then
+ echo "Error: NFS mount point $ROOTFS doesn't exist"
+ cleanup
+ return 1
+ fi
+ KERNCMDLINE="root=/dev/nfs nfsroot=$NFS_SERVER:$NFS_DIR,$UNFS_OPTS rw console=ttyAMA0,115200 $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
+ QEMUOPTIONS="$QEMU_NETWORK_CMD -M ${MACHINE_SUBTYPE} --no-reboot $QEMU_UI_OPTIONS"
+ fi
+ if [ "$MACHINE" = "qemuarmv6" ]; then
+ QEMUOPTIONS="$QEMUOPTIONS -cpu arm1136"
+ fi
+ if [ "$MACHINE" = "qemuarmv7" ]; then
+ QEMUOPTIONS="$QEMUOPTIONS -cpu cortex-a8"
+ fi
+}
+
+config_qemuarm64() {
+ set_mem_size 512
+ QEMU=qemu-system-aarch64
+
+ QEMU_NETWORK_CMD="-netdev tap,id=net0,ifname=$TAP,script=no,downscript=no -device virtio-net-device,netdev=net0 "
+ DROOT="/dev/vda"
+ ROOTFS_OPTIONS="-drive id=disk0,file=$ROOTFS,if=none,format=raw -device virtio-blk-device,drive=disk0"
+
+ export QEMU_AUDIO_DRV="none"
+ if [ "x$SERIALSTDIO" = "x" ] ; then
+ QEMU_UI_OPTIONS="-nographic"
+ else
+ QEMU_UI_OPTIONS=""
+ fi
+ if [ "${FSTYPE:0:3}" = "ext" -o "$FSTYPE" = "btrfs" -o "$FSTYPE" = "wic" ]; then
+ KERNCMDLINE="root=$DROOT rw console=ttyAMA0,38400 mem=$QEMU_MEMORY highres=off $KERNEL_NETWORK_CMD"
+ # qemu-system-aarch64 only support '-machine virt -cpu cortex-a57' for now
+ QEMUOPTIONS="$QEMU_NETWORK_CMD -machine virt -cpu cortex-a57 $ROOTFS_OPTIONS $QEMU_UI_OPTIONS"
+ fi
+ if [ "$FSTYPE" = "nfs" ]; then
+ if [ "$NFS_SERVER" = "192.168.7.1" -a ! -d "$NFS_DIR" ]; then
+ echo "Error: NFS mount point $ROOTFS doesn't exist"
+ cleanup
+ return 1
+ fi
+ KERNCMDLINE="root=/dev/nfs nfsroot=$NFS_SERVER:$NFS_DIR,$UNFS_OPTS rw console=ttyAMA0,38400 mem=$QEMU_MEMORY highres=off $KERNEL_NETWORK_CMD"
+ QEMUOPTIONS="$QEMU_NETWORK_CMD -machine virt -cpu cortex-a57 $QEMU_UI_OPTIONS"
+ fi
+}
+
+config_qemux86() {
+ set_mem_size 256
+ QEMU=qemu-system-i386
+ if [ "$KVM_ACTIVE" = "yes" ]; then
+ CPU_SUBTYPE=kvm32
+ else
+ CPU_SUBTYPE=qemu32
+ fi
+ if [ ! -z "$vga_option" ]; then
+ QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS"
+ else
+ QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS -vga vmware"
+ fi
+ if [ "${FSTYPE:0:3}" = "ext" -o "$FSTYPE" = "btrfs" -o "$FSTYPE" = "wic" ]; then
+ KERNCMDLINE="vga=0 uvesafb.mode_option=640x480-32 root=$DROOT rw mem=$QEMU_MEMORY $KERNEL_NETWORK_CMD"
+ QEMUOPTIONS="$QEMU_NETWORK_CMD -cpu $CPU_SUBTYPE $ROOTFS_OPTIONS $QEMU_UI_OPTIONS"
+ fi
+ if [ "${FSTYPE:0:4}" = "cpio" ]; then
+ KERNCMDLINE="vga=0 uvesafb.mode_option=640x480-32 root=/dev/ram0 rw mem=$QEMU_MEMORY $KERNEL_NETWORK_CMD"
+ QEMUOPTIONS="$QEMU_NETWORK_CMD -cpu $CPU_SUBTYPE -initrd $ROOTFS $QEMU_UI_OPTIONS"
+ fi
+
+ if [ "$FSTYPE" = "nfs" ]; then
+ if [ "$NFS_SERVER" = "192.168.7.1" -a ! -d "$NFS_DIR" ]; then
+ echo "Error: NFS mount point $ROOTFS doesn't exist."
+ cleanup
+ return 1
+ fi
+ KERNCMDLINE="root=/dev/nfs nfsroot=$NFS_SERVER:$NFS_DIR,$UNFS_OPTS rw $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
+ QEMUOPTIONS="$QEMU_NETWORK_CMD $QEMU_UI_OPTIONS"
+ fi
+ if [ "$IS_VM" = "true" ]; then
+ QEMUOPTIONS="$QEMU_NETWORK_CMD $QEMU_UI_OPTIONS"
+ fi
+ # Currently oprofile's event based interrupt mode doesn't work(Bug #828) in
+ # qemux86 and qemux86-64. We can use timer interrupt mode for now.
+ KERNCMDLINE="$KERNCMDLINE oprofile.timer=1"
+}
+
+config_qemux86_64() {
+ set_mem_size 256
+ QEMU=qemu-system-x86_64
+ if [ "$KVM_ACTIVE" = "yes" ]; then
+ CPU_SUBTYPE=kvm64
+ else
+ CPU_SUBTYPE=core2duo
+ fi
+ if [ ! -z "$vga_option" ]; then
+ QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS"
+ else
+ QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS -vga vmware"
+ fi
+ if [ "${FSTYPE:0:3}" = "ext" -o "$FSTYPE" = "btrfs" -o "$FSTYPE" = "wic" ]; then
+ KERNCMDLINE="vga=0 uvesafb.mode_option=640x480-32 root=$DROOT rw mem=$QEMU_MEMORY $KERNEL_NETWORK_CMD"
+ QEMUOPTIONS="$QEMU_NETWORK_CMD -cpu $CPU_SUBTYPE $ROOTFS_OPTIONS $QEMU_UI_OPTIONS"
+ fi
+ if [ "$FSTYPE" = "nfs" ]; then
+ if [ "x$ROOTFS" = "x" ]; then
+ ROOTFS=/srv/nfs/qemux86-64
+ fi
+ if [ ! -d "$ROOTFS" ]; then
+ echo "Error: NFS mount point $ROOTFS doesn't exist."
+ cleanup
+ return 1
+ fi
+ KERNCMDLINE="root=/dev/nfs nfsroot=$NFS_SERVER:$NFS_DIR,$UNFS_OPTS rw $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
+ QEMUOPTIONS="$QEMU_NETWORK_CMD -cpu $CPU_SUBTYPE $QEMU_UI_OPTIONS"
+ fi
+ if [ "$IS_VM" = "true" ]; then
+ QEMUOPTIONS="$QEMU_NETWORK_CMD -cpu $CPU_SUBTYPE $QEMU_UI_OPTIONS"
+ fi
+ # Currently oprofile's event based interrupt mode doesn't work(Bug #828) in
+ # qemux86 and qemux86-64. We can use timer interrupt mode for now.
+ KERNCMDLINE="$KERNCMDLINE oprofile.timer=1"
+}
+
+config_qemumips() {
+ set_mem_size 256
+ case "$MACHINE" in
+ qemumips) QEMU=qemu-system-mips ;;
+ qemumipsel) QEMU=qemu-system-mipsel ;;
+ qemumips64) QEMU=qemu-system-mips64 ;;
+ esac
+ MACHINE_SUBTYPE=malta
+ QEMU_UI_OPTIONS="-vga cirrus $QEMU_UI_OPTIONS"
+ if [ "${FSTYPE:0:3}" = "ext" -o "$FSTYPE" = "btrfs" -o "$FSTYPE" = "wic" ]; then
+ #KERNCMDLINE="root=/dev/hda console=ttyS0 console=tty0 $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
+ KERNCMDLINE="root=$DROOT rw console=ttyS0 console=tty $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
+ QEMUOPTIONS="$QEMU_NETWORK_CMD -M $MACHINE_SUBTYPE $ROOTFS_OPTIONS -no-reboot $QEMU_UI_OPTIONS"
+ fi
+ if [ "$FSTYPE" = "nfs" ]; then
+ if [ "$NFS_SERVER" = "192.168.7.1" -a ! -d "$NFS_DIR" ]; then
+ echo "Error: NFS mount point $ROOTFS doesn't exist"
+ cleanup
+ return 1
+ fi
+ KERNCMDLINE="root=/dev/nfs console=ttyS0 console=tty nfsroot=$NFS_SERVER:$NFS_DIR,$UNFS_OPTS rw $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
+ QEMUOPTIONS="$QEMU_NETWORK_CMD -M $MACHINE_SUBTYPE -no-reboot $QEMU_UI_OPTIONS"
+ fi
+}
+
+config_qemuppc() {
+ set_mem_size 256
+ QEMU=qemu-system-ppc
+ MACHINE_SUBTYPE=mac99
+ CPU_SUBTYPE=G4
+ QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS"
+ if [ "$SLIRP_ENABLED" = "yes" ]; then
+ QEMU_NETWORK_CMD=""
+ else
+ QEMU_NETWORK_CMD="-net nic,model=pcnet $QEMU_TAP_CMD"
+ fi
+ if [ "${FSTYPE:0:3}" = "ext" -o "$FSTYPE" = "btrfs" -o "$FSTYPE" = "wic" ]; then
+ KERNCMDLINE="root=$DROOT rw console=ttyS0 console=tty $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
+ QEMUOPTIONS="$QEMU_NETWORK_CMD -cpu $CPU_SUBTYPE -M $MACHINE_SUBTYPE $ROOTFS_OPTIONS -no-reboot $QEMU_UI_OPTIONS"
+ fi
+ if [ "$FSTYPE" = "nfs" ]; then
+ if [ "$NFS_SERVER" = "192.168.7.1" -a ! -d "$NFS_DIR" ]; then
+ echo "Error: NFS mount point $ROOTFS doesn't exist"
+ cleanup
+ return 1
+ fi
+ KERNCMDLINE="root=/dev/nfs console=ttyS0 console=tty nfsroot=$NFS_SERVER:$NFS_DIR,$UNFS_OPTS rw $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
+ QEMUOPTIONS="$QEMU_NETWORK_CMD -cpu $CPU_SUBTYPE -M $MACHINE_SUBTYPE -no-reboot $QEMU_UI_OPTIONS"
+ fi
+}
+
+config_qemush4() {
+ set_mem_size 1024
+ QEMU=qemu-system-sh4
+ MACHINE_SUBTYPE=r2d
+ QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS"
+ if [ "${FSTYPE:0:3}" = "ext" -o "$FSTYPE" = "btrfs" -o "$FSTYPE" = "wic" ]; then
+ #KERNCMDLINE="root=/dev/hda console=ttyS0 console=tty0 $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
+ KERNCMDLINE="root=/dev/hda rw console=ttySC1 noiotrap earlyprintk=sh-sci.1 console=tty $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
+ QEMUOPTIONS="$QEMU_NETWORK_CMD -M $MACHINE_SUBTYPE -hda $ROOTFS -no-reboot $QEMU_UI_OPTIONS -monitor null -serial vc -serial stdio"
+ SERIALSTDIO="1"
+ fi
+ if [ "$FSTYPE" = "nfs" ]; then
+ if [ "$NFS_SERVER" = "192.168.7.1" -a ! -d "$NFS_DIR" ]; then
+ echo "Error: NFS mount point $ROOTFS doesn't exist"
+ cleanup
+ return 1
+ fi
+ KERNCMDLINE="root=/dev/nfs console=ttySC1 noiotrap earlyprintk=sh-sci.1 console=tty nfsroot=$NFS_SERVER:$NFS_DIR,$UNFS_OPTS rw $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
+ QEMUOPTIONS="$QEMU_NETWORK_CMD -M $MACHINE_SUBTYPE -no-reboot $QEMU_UI_OPTIONS -monitor null -serial vc -serial stdio"
+ SERIALSTDIO="1"
+ fi
+}
+
+config_qemuzynq() {
+ set_mem_size 1024
+ QEMU=qemu-system-arm
+ QEMU_SYSTEM_OPTIONS="$QEMU_NETWORK_CMD -M xilinx-zynq-a9 -serial null -serial mon:stdio -dtb $KERNEL-$MACHINE.dtb"
+ # zynq serial ports are named 'ttyPS0' and 'ttyPS1', fixup the default values
+ SCRIPT_KERNEL_OPT=$(echo "$SCRIPT_KERNEL_OPT" | sed 's/console=ttyS/console=ttyPS/g')
+ if [ "${FSTYPE:0:3}" = "ext" -o "${FSTYPE:0:4}" = "cpio" ]; then
+ KERNCMDLINE="earlyprintk root=/dev/ram rw $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
+ QEMUOPTIONS="$QEMU_SYSTEM_OPTIONS -initrd $ROOTFS"
+ fi
+}
+
+config_qemumicroblaze() {
+ set_mem_size 256
+ QEMU=qemu-system-microblazeel
+ QEMU_SYSTEM_OPTIONS="$QEMU_NETWORK_CMD -M petalogix-ml605 -serial mon:stdio"
+ if [ "${FSTYPE:0:3}" = "ext" -o "${FSTYPE:0:4}" = "cpio" ]; then
+ KERNCMDLINE="earlyprintk root=/dev/ram rw $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
+ QEMUOPTIONS="$QEMU_SYSTEM_OPTIONS -initrd $ROOTFS"
+ fi
+}
+
+case "$MACHINE" in
+ "qemuarm" | "qemuarmv6" | "qemuarmv7")
+ config_qemuarm
+ ;;
+ "qemuarm64")
+ config_qemuarm64
+ ;;
+ "qemux86")
+ config_qemux86
+ ;;
+ "qemux86-64")
+ config_qemux86_64
+ ;;
+ "qemumips" | "qemumipsel" | "qemumips64")
+ config_qemumips
+ ;;
+ "qemuppc")
+ config_qemuppc
+ ;;
+ "qemush4")
+ config_qemush4
+ ;;
+ "qemuzynq")
+ config_qemuzynq
+ ;;
+ "qemumicroblaze")
+ config_qemumicroblaze
+ ;;
+ *)
+ echo "Error: Unsupported machine type $MACHINE"
+ return 1
+ ;;
+esac
+
+# We need to specify -m <mem_size> to overcome a bug in qemu 0.14.0
+# https://bugs.launchpad.net/ubuntu/+source/qemu-kvm/+bug/584480
+if [ -z "$mem_set" ] ; then
+ SCRIPT_QEMU_EXTRA_OPT="$SCRIPT_QEMU_EXTRA_OPT -m $mem_size"
+fi
+
+if [ "${FSTYPE:0:3}" = "ext" ]; then
+ KERNCMDLINE="$KERNCMDLINE rootfstype=$FSTYPE"
+fi
+
+if [ "$FSTYPE" = "cpio.gz" ]; then
+ QEMUOPTIONS="-initrd $ROOTFS -nographic"
+ KERNCMDLINE="root=/dev/ram0 console=ttyS0 debugshell"
+fi
+
+if [ "$FSTYPE" = "iso" ]; then
+ QEMUOPTIONS="$QEMU_NETWORK_CMD -cdrom $ROOTFS $QEMU_UI_OPTIONS"
+fi
+
+if [ "x$QEMUOPTIONS" = "x" ]; then
+ echo "Error: Unable to support this combination of options"
+ cleanup
+ return 1
+fi
+
+if [ "$TCPSERIAL_PORTNUM" != "" ]; then
+ if [ "$MACHINE" = "qemuarm64" ]; then
+ SCRIPT_QEMU_EXTRA_OPT="$SCRIPT_QEMU_EXTRA_OPT -device virtio-serial-device -chardev socket,id=virtcon,port=$TCPSERIAL_PORTNUM,host=127.0.0.1 -device virtconsole,chardev=virtcon"
+ else
+ SCRIPT_QEMU_EXTRA_OPT="$SCRIPT_QEMU_EXTRA_OPT -serial tcp:127.0.0.1:$TCPSERIAL_PORTNUM"
+ fi
+fi
+
+PATH=$OECORE_NATIVE_SYSROOT/usr/bin:$PATH
+
+QEMUBIN=`which $QEMU 2> /dev/null`
+if [ ! -x "$QEMUBIN" ]; then
+ echo "Error: No QEMU binary '$QEMU' could be found."
+ cleanup
+ return 1
+fi
+
+NEED_GL=`ldd $QEMUBIN/$QEMU 2>&1 | grep libGLU`
+# We can't run without a libGL.so
+if [ "$NEED_GL" != "" ]; then
+ libgl='no'
+
+ [ -e /usr/lib/libGL.so -a -e /usr/lib/libGLU.so ] && libgl='yes'
+ [ -e /usr/lib64/libGL.so -a -e /usr/lib64/libGLU.so ] && libgl='yes'
+ [ -e /usr/lib/*-linux-gnu/libGL.so -a -e /usr/lib/*-linux-gnu/libGLU.so ] && libgl='yes'
+
+ if [ "$libgl" != 'yes' ]; then
+ echo "You need libGL.so and libGLU.so to exist in your library path to run the QEMU emulator.
+ Ubuntu package names are: libgl1-mesa-dev and libglu1-mesa-dev.
+ Fedora package names are: mesa-libGL-devel mesa-libGLU-devel."
+ return 1;
+ fi
+fi
+
+do_quit() {
+ cleanup
+ return 1
+}
+
+trap do_quit INT TERM QUIT
+
+# qemu got segfault if linked with nVidia's libgl
+GL_LD_PRELOAD=$LD_PRELOAD
+
+if ldd $QEMUBIN | grep -i nvidia &> /dev/null
+then
+cat << EOM
+WARNING: nVidia proprietary OpenGL libraries detected.
+nVidia's OpenGL libraries are known to have compatibility issues with qemu,
+resulting in a segfault. Please uninstall these drivers or ensure the mesa libGL
+libraries precede nvidia's via LD_PRELOAD(Already do it on Ubuntu 10).
+EOM
+
+# Automatically use Ubuntu system's mesa libGL, other distro can add its own path
+if grep -i ubuntu /etc/lsb-release &> /dev/null
+then
+ # precede nvidia's driver on Ubuntu 10
+ UBUNTU_MAIN_VERSION=`cat /etc/lsb-release |grep DISTRIB_RELEASE |cut -d= -f 2| cut -d. -f 1`
+ if [ "$UBUNTU_MAIN_VERSION" = "10" ];
+ then
+ GL_PATH=""
+ if test -e /usr/lib/libGL.so
+ then
+ GL_PATH="/usr/lib/libGL.so"
+ elif test -e /usr/lib/x86_64-linux-gnu/libGL.so
+ then
+ GL_PATH="/usr/lib/x86_64-linux-gnu/libGL.so"
+ fi
+
+ echo "Skip nVidia's libGL on Ubuntu 10!"
+ GL_LD_PRELOAD="$GL_PATH $LD_PRELOAD"
+ fi
+fi
+fi
+
+if [ "x$SERIALSTDIO" = "x1" ]; then
+ echo "Interrupt character is '^]'"
+ stty intr ^]
+fi
+
+
+# Preserve the multiplexing behavior for the monitor that would be there based
+# on whether nographic is used.
+if echo "$QEMUOPTIONS $SERIALOPTS $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT" | grep -- "-nographic"; then
+ FIRST_SERIAL_OPT="-serial mon:stdio"
+else
+ FIRST_SERIAL_OPT="-serial mon:vc"
+fi
+
+# qemuarm64 uses virtio for any additional serial ports so the normal mechanism
+# of using -serial will not work
+if [ "$MACHINE" = "qemuarm64" ]; then
+ SECOND_SERIAL_OPT="$SCRIPT_QEMU_EXTRA_OPT -device virtio-serial-device -chardev null,id=virtcon -device virtconsole,chardev=virtcon"
+else
+ SECOND_SERIAL_OPT="-serial null"
+fi
+
+# 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.
+NUM_SERIAL_OPTS=`echo $QEMUOPTIONS $SERIALOPTS $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT | sed -e 's/ /\n/g' | grep --count -- -serial`
+
+if [ "$NUM_SERIAL_OPTS" = "0" ]; then
+ SCRIPT_QEMU_EXTRA_OPT="$SCRIPT_QEMU_EXTRA_OPT $FIRST_SERIAL_OPT $SECOND_SERIAL_OPT"
+elif [ "$NUM_SERIAL_OPTS" = "1" ]; then
+ SCRIPT_QEMU_EXTRA_OPT="$SCRIPT_QEMU_EXTRA_OPT $SECOND_SERIAL_OPT"
+fi
+
+echo "Running $QEMU..."
+# -no-reboot is a mandatory option - see bug #100
+if [ "$IS_VM" = "true" ]; then
+ # Check root=/dev/sdX or root=/dev/vdX
+ [ ! -e "$VM" ] && error "VM image is not found!"
+ if grep -q 'root=/dev/sd' $VM; then
+ echo "Using scsi drive"
+ VM_DRIVE="-drive if=none,id=hd,file=$VM -device virtio-scsi-pci,id=scsi -device scsi-hd,drive=hd"
+ elif grep -q 'root=/dev/hd' $VM; then
+ echo "Using ide drive"
+ VM_DRIVE="$VM"
+ else
+ echo "Using virtio block drive"
+ VM_DRIVE="-drive if=virtio,file=$VM"
+ fi
+ QEMU_FIRE="$QEMUBIN $VM_DRIVE $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT"
+ echo $QEMU_FIRE
+ LD_PRELOAD="$GL_LD_PRELOAD" $QEMU_FIRE
+elif [ "$FSTYPE" = "iso" -o "$FSTYPE" = "wic" ]; then
+ QEMU_FIRE="$QEMUBIN $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT"
+ echo $QEMU_FIRE
+ LD_PRELOAD="$GL_LD_PRELOAD" $QEMU_FIRE
+else
+ QEMU_FIRE="$QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SLIRP_CMD $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT"
+ echo $QEMU_FIRE -append '"'$KERNCMDLINE $SCRIPT_KERNEL_OPT'"'
+ LD_PRELOAD="$GL_LD_PRELOAD" $QEMU_FIRE -append "$KERNCMDLINE $SCRIPT_KERNEL_OPT"
+fi
+ret=$?
+if [ "$SLIRP_ENABLED" != "yes" ]; then
+ cleanup
+fi
+
+#set the original stty values before exit
+stty ${ORIG_STTY}
+trap - INT TERM QUIT
+
+return $ret
diff --git a/import-layers/yocto-poky/scripts/runqemu.README b/import-layers/yocto-poky/scripts/runqemu.README
new file mode 100644
index 000000000..5908d831a
--- /dev/null
+++ b/import-layers/yocto-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.16.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/import-layers/yocto-poky/scripts/send-error-report b/import-layers/yocto-poky/scripts/send-error-report
new file mode 100755
index 000000000..a29feff32
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/send-error-report
@@ -0,0 +1,200 @@
+#!/usr/bin/env python
+
+# 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 urllib2
+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 = urllib2.Request(url, None)
+ try:
+ response = urllib2.urlopen(req)
+ except urllib2.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 = raw_input("Name (required): ")
+ email = raw_input("E-mail (not required): ")
+ return username, email
+
+def edit_content(json_file_path):
+ edit = raw_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
+
+
+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 = urllib2.Request(url, data=data, headers=headers)
+ try:
+ response = urllib2.urlopen(req)
+ except urllib2.HTTPError, 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/import-layers/yocto-poky/scripts/send-pull-request b/import-layers/yocto-poky/scripts/send-pull-request
new file mode 100755
index 000000000..575549db3
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/send-pull-request
@@ -0,0 +1,179 @@
+#!/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.
+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.
+ eval "git send-email $GIT_TO $GIT_CC $GIT_EXTRA_CC --confirm=always --no-chain-reply-to --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-chain-reply-to $GITSOBCC $PATCHES"
+if [ $? -eq 1 ]; then
+ echo "ERROR: failed to send patches."
+ exit 1
+fi
diff --git a/import-layers/yocto-poky/scripts/sstate-cache-management.sh b/import-layers/yocto-poky/scripts/sstate-cache-management.sh
new file mode 100755
index 000000000..2ab450ab5
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/sstate-diff-machines.sh b/import-layers/yocto-poky/scripts/sstate-diff-machines.sh
new file mode 100755
index 000000000..056aa0a04
--- /dev/null
+++ b/import-layers/yocto-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; s/${M}/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/import-layers/yocto-poky/scripts/sstate-sysroot-cruft.sh b/import-layers/yocto-poky/scripts/sstate-sysroot-cruft.sh
new file mode 100755
index 000000000..b7ed8ea84
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/sstate-sysroot-cruft.sh
@@ -0,0 +1,185 @@
+#!/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/.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/ \
+"
+
+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/import-layers/yocto-poky/scripts/swabber-strace-attach b/import-layers/yocto-poky/scripts/swabber-strace-attach
new file mode 100755
index 000000000..bb0391a7c
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/swabber-strace-attach
@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+import os
+import sys
+import subprocess
+
+# Detach from the controlling terminal and parent process by forking twice to daemonize ourselves,
+# then run the command passed as argv[1]. Send log data to argv[2].
+
+pid = os.fork()
+if (pid == 0):
+ os.setsid()
+ pid = os.fork()
+ if (pid != 0):
+ os._exit(0)
+else:
+ sys.exit()
+
+
+si = file(os.devnull, 'r')
+so = file(sys.argv[2], 'w')
+se = so
+
+# Replace those fds with our own
+os.dup2(si.fileno(), sys.stdin.fileno())
+os.dup2(so.fileno(), sys.stdout.fileno())
+os.dup2(se.fileno(), sys.stderr.fileno())
+
+ret = subprocess.call(sys.argv[1], shell=True)
+
+os._exit(ret)
+
diff --git a/import-layers/yocto-poky/scripts/sysroot-relativelinks.py b/import-layers/yocto-poky/scripts/sysroot-relativelinks.py
new file mode 100755
index 000000000..ac26367e7
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/sysroot-relativelinks.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+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 files:
+ filep = os.path.join(subdir, f)
+ if os.path.islink(filep):
+ #print("Considering %s" % filep)
+ handlelink(filep, subdir)
diff --git a/import-layers/yocto-poky/scripts/test-dependencies.sh b/import-layers/yocto-poky/scripts/test-dependencies.sh
new file mode 100755
index 000000000..0170947f0
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/test-dependencies.sh
@@ -0,0 +1,286 @@
+#!/bin/bash
+
+# Author: Martin Jansa <martin.jansa@gmail.com>
+#
+# Copyright (c) 2013 Martin Jansa <Martin.Jansa@gmail.com>
+
+# Used to detect missing dependencies or automagically
+# enabled dependencies which aren't explicitly enabled
+# or disabled. Using bash to have PIPESTATUS variable.
+
+# It does 3 builds of <target>
+# 1st to populate sstate-cache directory and sysroot
+# 2nd to rebuild each recipe with every possible
+# dependency found in sysroot (which stays populated
+# from 1st build
+# 3rd to rebuild each recipe only with dependencies defined
+# in DEPENDS
+# 4th (optional) repeat build like 3rd to make sure that
+# minimal versions of dependencies defined in DEPENDS
+# is also enough
+
+# Global vars
+tmpdir=
+targets=
+recipes=
+buildhistory=
+buildtype=
+default_targets="world"
+default_buildhistory="buildhistory"
+default_buildtype="1 2 3 c"
+
+usage () {
+ cat << EOF
+Welcome to utility to detect missing or autoenabled dependencies.
+WARNING: this utility will completely remove your tmpdir (make sure
+ you don't have important buildhistory or persistent dir there).
+$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).
+
+ --targets=<targets>
+ List of targets separated by space, will use the environment variable TARGETS if it is not specified.
+ It will run "bitbake <targets>" to populate sysroots.
+ Default value is "world".
+
+ --recipes=<recipes>
+ File with list of recipes we want to rebuild with minimal and maximal sysroot.
+ Will use the environment variable RECIPES if it is not specified.
+ Default value will use all packages ever recorded in buildhistory directory.
+
+ --buildhistory=<buildhistory>
+ Path to buildhistory directory, it needs to be enabled in your config,
+ because it's used to detect different dependencies and to create list
+ of recipes to rebuild when it's not specified.
+ Will use the environment variable BUILDHISTORY if it is not specified.
+ Default value is "buildhistory"
+
+ --buildtype=<buildtype>
+ There are 4 types of build:
+ 1: build to populate sstate-cache directory and sysroot
+ 2: build to rebuild each recipe with every possible dep
+ 3: build to rebuild each recipe with minimal dependencies
+ 4: build to rebuild each recipe again with minimal dependencies
+ c: compare buildhistory directories from build 2 and 3
+ Will use the environment variable BUILDTYPE if it is not specified.
+ Default value is "1 2 3 c", order is important, type 4 is optional.
+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
+ ;;
+ --targets=*)
+ targets=`echo $1 | sed -e 's#^--targets="*\([^"]*\)"*#\1#'`
+ shift
+ ;;
+ --recipes=*)
+ recipes=`echo $1 | sed -e 's#^--recipes="*\([^"]*\)"*#\1#'`
+ shift
+ ;;
+ --buildhistory=*)
+ buildhistory=`echo $1 | sed -e 's#^--buildhistory="*\([^"]*\)"*#\1#'`
+ shift
+ ;;
+ --buildtype=*)
+ buildtype=`echo $1 | sed -e 's#^--buildtype="*\([^"]*\)"*#\1#'`
+ 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 "$targets" ] || targets=$TARGETS
+[ -n "$targets" ] || targets=$default_targets
+[ -n "$recipes" ] || recipes=$RECIPES
+[ -n "$recipes" -a ! -f "$recipes" ] && echo_error "Invalid file with list of recipes to rebuild"
+[ -n "$recipes" ] || echo "All packages ever recorded in buildhistory directory will be rebuilt"
+[ -n "$buildhistory" ] || buildhistory=$BUILDHISTORY
+[ -n "$buildhistory" ] || buildhistory=$default_buildhistory
+[ -d "$buildhistory" ] || echo_error "Invalid buildhistory directory \"$buildhistory\""
+[ -n "$buildtype" ] || buildtype=$BUILDTYPE
+[ -n "$buildtype" ] || buildtype=$default_buildtype
+echo "$buildtype" | grep -v '^[1234c ]*$' && echo_error "Invalid buildtype \"$buildtype\", only some combination of 1, 2, 3, 4, c separated by space is allowed"
+
+OUTPUT_BASE=test-dependencies/`date "+%s"`
+declare -i RESULT=0
+
+build_all() {
+ echo "===== 1st build to populate sstate-cache directory and sysroot ====="
+ OUTPUT1=${OUTPUT_BASE}/${TYPE}_all
+ mkdir -p ${OUTPUT1}
+ echo "Logs will be stored in ${OUTPUT1} directory"
+ bitbake -k $targets 2>&1 | tee -a ${OUTPUT1}/complete.log
+ RESULT+=${PIPESTATUS[0]}
+ grep "ERROR: Task.*failed" ${OUTPUT1}/complete.log > ${OUTPUT1}/failed-tasks.log
+ cat ${OUTPUT1}/failed-tasks.log | sed 's@.*/@@g; s@_.*@@g; s@\.bb, .*@@g' | sort -u > ${OUTPUT1}/failed-recipes.log
+}
+
+build_every_recipe() {
+ if [ "${TYPE}" = "2" ] ; then
+ echo "===== 2nd build to rebuild each recipe with every possible dep ====="
+ OUTPUT_MAX=${OUTPUT_BASE}/${TYPE}_max
+ OUTPUTB=${OUTPUT_MAX}
+ else
+ echo "===== 3rd or 4th build to rebuild each recipe with minimal dependencies ====="
+ OUTPUT_MIN=${OUTPUT_BASE}/${TYPE}_min
+ OUTPUTB=${OUTPUT_MIN}
+ fi
+
+ mkdir -p ${OUTPUTB} ${OUTPUTB}/failed ${OUTPUTB}/ok
+ echo "Logs will be stored in ${OUTPUTB} directory"
+ if [ -z "$recipes" ]; then
+ ls -d $buildhistory/packages/*/* | xargs -n 1 basename | sort -u > ${OUTPUTB}/recipe.list
+ recipes=${OUTPUTB}/recipe.list
+ fi
+ if [ "${TYPE}" != "2" ] ; then
+ echo "!!!Removing tmpdir \"$tmpdir\"!!!"
+ rm -rf $tmpdir/deploy $tmpdir/pkgdata $tmpdir/sstate-control $tmpdir/stamps $tmpdir/sysroots $tmpdir/work $tmpdir/work-shared 2>/dev/null
+ fi
+ i=1
+ count=`cat $recipes ${OUTPUT1}/failed-recipes.log | sort -u | wc -l`
+ for recipe in `cat $recipes ${OUTPUT1}/failed-recipes.log | sort -u`; do
+ echo "Building recipe: ${recipe} ($i/$count)"
+ declare -i RECIPE_RESULT=0
+ bitbake -c cleansstate ${recipe} > ${OUTPUTB}/${recipe}.log 2>&1;
+ RECIPE_RESULT+=$?
+ bitbake ${recipe} >> ${OUTPUTB}/${recipe}.log 2>&1;
+ RECIPE_RESULT+=$?
+ if [ "${RECIPE_RESULT}" != "0" ] ; then
+ RESULT+=${RECIPE_RESULT}
+ mv ${OUTPUTB}/${recipe}.log ${OUTPUTB}/failed/
+ grep "ERROR: Task.*failed" ${OUTPUTB}/failed/${recipe}.log | tee -a ${OUTPUTB}/failed-tasks.log
+ grep "ERROR: Task.*failed" ${OUTPUTB}/failed/${recipe}.log | sed 's@.*/@@g; s@_.*@@g; s@\.bb, .*@@g' >> ${OUTPUTB}/failed-recipes.log
+ # and append also ${recipe} in case the failed task was from some dependency
+ echo ${recipe} >> ${OUTPUTB}/failed-recipes.log
+ else
+ mv ${OUTPUTB}/${recipe}.log ${OUTPUTB}/ok/
+ fi
+ if [ "${TYPE}" != "2" ] ; then
+ rm -rf $tmpdir/deploy $tmpdir/pkgdata $tmpdir/sstate-control $tmpdir/stamps $tmpdir/sysroots $tmpdir/work $tmpdir/work-shared 2>/dev/null
+ fi
+ i=`expr $i + 1`
+ done
+ echo "Copying buildhistory/packages to ${OUTPUTB}"
+ cp -ra $buildhistory/packages ${OUTPUTB}
+ # This will be usefull to see which library is pulling new dependency
+ echo "Copying do_package logs to ${OUTPUTB}/do_package/"
+ mkdir ${OUTPUTB}/do_package
+ find $tmpdir/work/ -name log.do_package 2>/dev/null| while read f; do
+ # pn is 3 levels back, but we don't know if there is just one log per pn (only one arch and version)
+ # dest=`echo $f | sed 's#^.*/\([^/]*\)/\([^/]*\)/\([^/]*\)/log.do_package#\1#g'`
+ dest=`echo $f | sed "s#$tmpdir/work/##g; s#/#_#g"`
+ cp $f ${OUTPUTB}/do_package/$dest
+ done
+}
+
+compare_deps() {
+ # you can run just compare task with command like this
+ # OUTPUT_BASE=test-dependencies/1373140172 \
+ # OUTPUT_MAX=${OUTPUT_BASE}/2_max \
+ # OUTPUT_MIN=${OUTPUT_BASE}/3_min \
+ # openembedded-core/scripts/test-dependencies.sh --tmpdir=tmp-eglibc --targets=glib-2.0 --recipes=recipe_list --buildtype=c
+ echo "===== Compare dependencies recorded in \"${OUTPUT_MAX}\" and \"${OUTPUT_MIN}\" ====="
+ [ -n "${OUTPUTC}" ] || OUTPUTC=${OUTPUT_BASE}/comp
+ mkdir -p ${OUTPUTC}
+ OUTPUT_FILE=${OUTPUTC}/dependency-changes
+ echo "Differences will be stored in ${OUTPUT_FILE}, dot is shown for every 100 of checked packages"
+ echo > ${OUTPUT_FILE}
+
+ [ -d ${OUTPUT_MAX} ] || echo_error "Directory with output from build 2 \"${OUTPUT_MAX}\" does not exist"
+ [ -d ${OUTPUT_MIN} ] || echo_error "Directory with output from build 3 \"${OUTPUT_MIN}\" does not exist"
+ [ -d ${OUTPUT_MAX}/packages/ ] || echo_error "Directory with packages from build 2 \"${OUTPUT_MAX}/packages/\" does not exist"
+ [ -d ${OUTPUT_MIN}/packages/ ] || echo_error "Directory with packages from build 3 \"${OUTPUT_MIN}/packages/\" does not exist"
+ i=0
+ find ${OUTPUT_MAX}/packages/ -name latest | sed "s#${OUTPUT_MAX}/##g" | while read pkg; do
+ max_pkg=${OUTPUT_MAX}/${pkg}
+ min_pkg=${OUTPUT_MIN}/${pkg}
+ # pkg=packages/armv5te-oe-linux-gnueabi/libungif/libungif/latest
+ recipe=`echo "${pkg}" | sed 's#packages/[^/]*/\([^/]*\)/\([^/]*\)/latest#\1#g'`
+ package=`echo "${pkg}" | sed 's#packages/[^/]*/\([^/]*\)/\([^/]*\)/latest#\2#g'`
+ if [ ! -f "${min_pkg}" ] ; then
+ echo "ERROR: ${recipe}: ${package} package isn't created when building with minimal dependencies?" | tee -a ${OUTPUT_FILE}
+ echo ${recipe} >> ${OUTPUTC}/failed-recipes.log
+ continue
+ fi
+ # strip version information in parenthesis
+ max_deps=`grep "^RDEPENDS = " ${max_pkg} | sed 's/^RDEPENDS = / /g; s/$/ /g; s/([^(]*)//g'`
+ min_deps=`grep "^RDEPENDS = " ${min_pkg} | sed 's/^RDEPENDS = / /g; s/$/ /g; s/([^(]*)//g'`
+ if [ "$i" = 100 ] ; then
+ echo -n "." # cheap progressbar
+ i=0
+ fi
+ if [ "${max_deps}" = "${min_deps}" ] ; then
+ # it's annoying long, but at least it's showing some progress, warnings are grepped at the end
+ echo "NOTE: ${recipe}: ${package} rdepends weren't changed" >> ${OUTPUT_FILE}
+ else
+ missing_deps=
+ for dep in ${max_deps}; do
+ if ! echo "${min_deps}" | grep -q " ${dep} " ; then
+ missing_deps="${missing_deps} ${dep}"
+ echo # to get rid of dots on last line
+ echo "WARN: ${recipe}: ${package} rdepends on ${dep}, but it isn't a build dependency?" | tee -a ${OUTPUT_FILE}
+ fi
+ done
+ if [ -n "${missing_deps}" ] ; then
+ echo ${recipe} >> ${OUTPUTC}/failed-recipes.log
+ fi
+ fi
+ i=`expr $i + 1`
+ done
+ echo # to get rid of dots on last line
+ echo "Found differences: "
+ grep "^WARN: " ${OUTPUT_FILE} | tee ${OUTPUT_FILE}.warn.log
+ echo "Found errors: "
+ grep "^ERROR: " ${OUTPUT_FILE} | tee ${OUTPUT_FILE}.error.log
+ RESULT+=`cat ${OUTPUT_FILE}.warn.log | wc -l`
+ RESULT+=`cat ${OUTPUT_FILE}.error.log | wc -l`
+}
+
+for TYPE in $buildtype; do
+ case ${TYPE} in
+ 1) build_all;;
+ 2) build_every_recipe;;
+ 3) build_every_recipe;;
+ 4) build_every_recipe;;
+ c) compare_deps;;
+ *) echo_error "Invalid buildtype \"$TYPE\""
+ esac
+done
+
+cat ${OUTPUT_BASE}/*/failed-recipes.log | sort -u >> ${OUTPUT_BASE}/failed-recipes.log
+
+if [ "${RESULT}" != "0" ] ; then
+ echo "ERROR: ${RESULT} issues were found in these recipes: `cat ${OUTPUT_BASE}/failed-recipes.log | xargs`"
+fi
+
+echo "INFO: Output written in: ${OUTPUT_BASE}"
+exit ${RESULT}
diff --git a/import-layers/yocto-poky/scripts/test-reexec b/import-layers/yocto-poky/scripts/test-reexec
new file mode 100755
index 000000000..9eaa96e75
--- /dev/null
+++ b/import-layers/yocto-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/import-layers/yocto-poky/scripts/test-remote-image b/import-layers/yocto-poky/scripts/test-remote-image
new file mode 100755
index 000000000..9c5b0158d
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/test-remote-image
@@ -0,0 +1,361 @@
+#!/usr/bin/env python
+
+# 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):
+ """
+ This class defines the meta profile for a specific target (MACHINE type + image type).
+ """
+
+ __metaclass__ = ABCMeta
+
+ 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):
+ """
+ This class defines the meta profile for an images repository.
+ """
+
+ __metaclass__ = ABCMeta
+
+ 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/import-layers/yocto-poky/scripts/tiny/dirsize.py b/import-layers/yocto-poky/scripts/tiny/dirsize.py
new file mode 100755
index 000000000..40ff4ab89
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/tiny/dirsize.py
@@ -0,0 +1,93 @@
+#!/usr/bin/env python
+#
+# 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 __cmp__(this, that):
+ if that is None:
+ return 1
+ if not isinstance(that, Record):
+ raise TypeError
+ if len(this.records) > 0 and len(that.records) == 0:
+ return -1
+ if len(this.records) == 0 and len(that.records) > 0:
+ return 1
+ if this.size < that.size:
+ return -1
+ if this.size > that.size:
+ return 1
+ return 0
+
+ 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/import-layers/yocto-poky/scripts/tiny/ksize.py b/import-layers/yocto-poky/scripts/tiny/ksize.py
new file mode 100755
index 000000000..4006f2f6f
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/tiny/ksize.py
@@ -0,0 +1,165 @@
+#!/usr/bin/env python
+#
+# 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 *
+from string import join
+
+
+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 " + 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 " + path + "/*.o | grep -v built-in.o",
+ shell=True, stdout=PIPE, stderr=PIPE)
+ glob = join(p.communicate()[0].splitlines())
+ oreport = Report(glob, path + "/*.o")
+ oreport.sizes.title = 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, 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 __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, 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/import-layers/yocto-poky/scripts/wic b/import-layers/yocto-poky/scripts/wic
new file mode 100755
index 000000000..2286f20a9
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/wic
@@ -0,0 +1,323 @@
+#!/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) 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 optparse
+import logging
+from distutils import spawn
+
+# External modules
+scripts_path = os.path.abspath(os.path.dirname(__file__))
+lib_path = scripts_path + '/lib'
+sys.path.insert(0, lib_path)
+
+bitbake_exe = spawn.find_executable('bitbake')
+if bitbake_exe:
+ bitbake_path = os.path.join(os.path.dirname(bitbake_exe), '../lib')
+ sys.path.insert(0, bitbake_path)
+ from bb import cookerdata
+ from bb.main import bitbake_main, BitBakeConfigParameters
+else:
+ bitbake_main = None
+
+from wic.utils.oe.misc import get_bitbake_var, BB_VARS
+from wic.utils.errors import WicError
+from wic import engine
+from wic import help as hlp
+
+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()
+
+def callback_rootfs_dir(option, opt, value, parser):
+ """
+ Build a dict using --rootfs_dir connection=dir
+ """
+ if not type(parser.values.rootfs_dir) is dict:
+ parser.values.rootfs_dir = dict()
+
+ if '=' in value:
+ (key, rootfs_dir) = value.split('=')
+ else:
+ key = 'ROOTFS_DIR'
+ rootfs_dir = value
+
+ parser.values.rootfs_dir[key] = rootfs_dir
+
+def wic_create_subcommand(args, usage_str):
+ """
+ Command-line handling for image creation. The real work is done
+ by image.engine.wic_create()
+ """
+ parser = optparse.OptionParser(usage=usage_str)
+
+ parser.add_option("-o", "--outdir", dest="outdir",
+ help="name of directory to create image in")
+ parser.add_option("-e", "--image-name", dest="image_name",
+ help="name of the image to use the artifacts from "
+ "e.g. core-image-sato")
+ parser.add_option("-r", "--rootfs-dir", dest="rootfs_dir", type="string",
+ action="callback", callback=callback_rootfs_dir,
+ help="path to the /rootfs dir to use as the "
+ ".wks rootfs source")
+ parser.add_option("-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")
+ parser.add_option("-k", "--kernel-dir", dest="kernel_dir",
+ help="path to the dir containing the kernel to use "
+ "in the .wks bootimg")
+ parser.add_option("-n", "--native-sysroot", dest="native_sysroot",
+ help="path to the native sysroot containing the tools "
+ "to use to build the image")
+ parser.add_option("-p", "--skip-build-check", dest="build_check",
+ action="store_false", default=True, help="skip the build check")
+ parser.add_option("-f", "--build-rootfs", action="store_true", help="build rootfs")
+ parser.add_option("-c", "--compress-with", choices=("gzip", "bzip2", "xz"),
+ dest='compressor',
+ help="compress image with specified compressor")
+ parser.add_option("-v", "--vars", dest='vars_dir',
+ help="directory with <image>.env files that store "
+ "bitbake variables")
+ parser.add_option("-D", "--debug", dest="debug", action="store_true",
+ default=False, help="output debug information")
+
+ (options, args) = parser.parse_args(args)
+
+ if len(args) != 1:
+ logging.error("Wrong number of arguments, exiting\n")
+ parser.print_help()
+ sys.exit(1)
+
+ if options.build_rootfs and not bitbake_main:
+ logging.error("Can't build roofs as bitbake is not in the $PATH")
+ sys.exit(1)
+
+ 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:
+ print "The following build artifacts are not specified:"
+ print " " + ", ".join(missed)
+ sys.exit(1)
+
+ 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:
+ print "Checking basic build environment..."
+ if not engine.verify_build_env():
+ print "Couldn't verify build environment, exiting\n"
+ sys.exit(1)
+ else:
+ print "Done.\n"
+
+ bootimg_dir = ""
+
+ if options.image_name:
+ if options.build_rootfs:
+ argv = ["bitbake", options.image_name]
+ if options.debug:
+ argv.append("--debug")
+
+ print "Building rootfs...\n"
+ if bitbake_main(BitBakeConfigParameters(argv),
+ cookerdata.CookerConfiguration()):
+ sys.exit(1)
+
+ rootfs_dir = get_bitbake_var("IMAGE_ROOTFS", options.image_name)
+ kernel_dir = get_bitbake_var("DEPLOY_DIR_IMAGE", options.image_name)
+ native_sysroot = get_bitbake_var("STAGING_DIR_NATIVE",
+ options.image_name)
+ else:
+ if options.build_rootfs:
+ print "Image name is not specified, exiting. (Use -e/--image-name to specify it)\n"
+ sys.exit(1)
+
+ wks_file = args[0]
+
+ if not wks_file.endswith(".wks"):
+ wks_file = engine.find_canned_image(scripts_path, wks_file)
+ if not wks_file:
+ print "No image named %s found, exiting. (Use 'wic list images' "\
+ "to list available images, or specify a fully-qualified OE "\
+ "kickstart (.wks) filename)\n" % args[0]
+ sys.exit(1)
+
+ image_output_dir = ""
+ if options.outdir:
+ image_output_dir = options.outdir
+
+ 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):
+ print "--roofs-dir (-r) not found, exiting\n"
+ sys.exit(1)
+ if not os.path.isdir(bootimg_dir):
+ print "--bootimg-dir (-b) not found, exiting\n"
+ sys.exit(1)
+ if not os.path.isdir(kernel_dir):
+ print "--kernel-dir (-k) not found, exiting\n"
+ sys.exit(1)
+ if not os.path.isdir(native_sysroot):
+ print "--native-sysroot (-n) not found, exiting\n"
+ sys.exit(1)
+ 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?"
+ print "Build artifacts not found, exiting."
+ print " (Please check that the build artifacts for the machine"
+ print " selected in local.conf actually exist and that they"
+ print " are the correct artifacts for the image (.wks file)).\n"
+ print "The artifact that couldn't be found was %s:\n %s" % \
+ (not_found, not_found_dir)
+ sys.exit(1)
+
+ 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)
+
+ print "Creating image(s)...\n"
+ engine.wic_create(wks_file, rootfs_dir, bootimg_dir, kernel_dir,
+ native_sysroot, scripts_path, image_output_dir,
+ options.compressor, options.debug)
+
+
+def wic_list_subcommand(args, usage_str):
+ """
+ Command-line handling for listing available images.
+ The real work is done by image.engine.wic_list()
+ """
+ parser = optparse.OptionParser(usage=usage_str)
+ args = parser.parse_args(args)[1]
+
+ if not engine.wic_list(args, scripts_path):
+ logging.error("Bad list arguments, exiting\n")
+ parser.print_help()
+ sys.exit(1)
+
+
+def wic_help_topic_subcommand(args, usage_str):
+ """
+ Command-line handling for help-only 'subcommands'. This is
+ essentially a dummy command that doesn nothing but allow users to
+ use the existing subcommand infrastructure to display help on a
+ particular topic not attached to any particular subcommand.
+ """
+ pass
+
+
+wic_help_topic_usage = """
+"""
+
+subcommands = {
+ "create": [wic_create_subcommand,
+ hlp.wic_create_usage,
+ hlp.wic_create_help],
+ "list": [wic_list_subcommand,
+ hlp.wic_list_usage,
+ hlp.wic_list_help],
+ "plugins": [wic_help_topic_subcommand,
+ wic_help_topic_usage,
+ hlp.get_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],
+}
+
+
+def start_logging(loglevel):
+ logging.basicConfig(filname='wic.log', filemode='w', level=loglevel)
+
+
+def main(argv):
+ parser = optparse.OptionParser(version="wic version %s" % __version__,
+ usage=hlp.wic_usage)
+
+ parser.disable_interspersed_args()
+
+ args = parser.parse_args(argv)[1]
+
+ if len(args):
+ if args[0] == "help":
+ if len(args) == 1:
+ parser.print_help()
+ sys.exit(1)
+
+ 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 >> sys.stderr, "ERROR:", err
+ sys.exit(1)
+
diff --git a/import-layers/yocto-poky/scripts/wipe-sysroot b/import-layers/yocto-poky/scripts/wipe-sysroot
new file mode 100755
index 000000000..9e067e8df
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/wipe-sysroot
@@ -0,0 +1,54 @@
+#! /bin/sh
+
+# Wipe out all of the sysroots and all of the stamps that populated it.
+# Author: Ross Burton <ross.burton@intel.com>
+#
+# 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
+
+set -e
+
+if [ $# -gt 0 ]; then
+ echo "Wipe all sysroots and sysroot-related stamps for the current build directory." >&2
+ echo "Usage: $0" >&2
+ exit 1
+fi
+
+ENVS=`mktemp --suffix -wipe-sysroot-envs`
+bitbake -p -e > $ENVS
+
+eval `grep -F SSTATE_MANIFESTS= $ENVS`
+eval `grep -F STAGING_DIR= $ENVS`
+eval `grep -F STAMPS_DIR= $ENVS`
+rm -f $ENVS
+
+if [ -z "$SSTATE_MANIFESTS" -o -z "$STAGING_DIR" -o -z "$STAMPS_DIR" ]; then
+ echo "Could not determine SSTATE_MANIFESTS/STAGING_DIR/STAMPS_DIR from bitbake, check above for errors"
+ exit 1
+fi
+
+echo "Deleting the sysroots in $STAGING_DIR, and selected stamps in $SSTATE_MANIFESTS and $STAMPS_DIR."
+
+# The sysroots themselves
+rm -rf $STAGING_DIR ${STAGING_DIR}-uninative
+
+# The stamps that said the sysroot was populated
+rm -rf $STAMPS_DIR/*/*/*.do_populate_sysroot.*
+rm -rf $STAMPS_DIR/*/*/*.do_populate_sysroot_setscene.*
+rm -rf $STAMPS_DIR/*/*/*.do_packagedata.*
+rm -rf $STAMPS_DIR/*/*/*.do_packagedata_setscene.*
+
+# The sstate manifests
+rm -rf $SSTATE_MANIFESTS/manifest-*.populate-sysroot
diff --git a/import-layers/yocto-poky/scripts/yocto-bsp b/import-layers/yocto-poky/scripts/yocto-bsp
new file mode 100755
index 000000000..82a050ebd
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/yocto-bsp
@@ -0,0 +1,156 @@
+#!/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, 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
+# 'yocto-bsp' is the Yocto BSP Tool that helps users create a new
+# Yocto BSP. Invoking it without any arguments will display help
+# screens for the 'yocto-bsp' command and list the available
+# 'yocto-bsp' 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] intel.com>
+#
+
+__version__ = "0.1.0"
+
+import os
+import sys
+import optparse
+import logging
+
+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]
+
+from bsp.help import *
+from bsp.engine import *
+
+
+def yocto_bsp_create_subcommand(args, usage_str):
+ """
+ Command-line handling for BSP creation. The real work is done by
+ bsp.engine.yocto_bsp_create()
+ """
+ parser = optparse.OptionParser(usage = usage_str)
+
+ parser.add_option("-o", "--outdir", dest = "outdir", action = "store",
+ help = "name of BSP dir to create")
+ parser.add_option("-i", "--infile", dest = "properties_file", action = "store",
+ help = "name of file containing the values for BSP properties as a JSON file")
+ parser.add_option("-c", "--codedump", dest = "codedump", action = "store_true",
+ default = False, help = "dump the generated code to bspgen.out")
+ parser.add_option("-s", "--skip-git-check", dest = "git_check", action = "store_false",
+ default = True, help = "skip the git connectivity check")
+ (options, args) = parser.parse_args(args)
+
+ if len(args) != 2:
+ logging.error("Wrong number of arguments, exiting\n")
+ parser.print_help()
+ sys.exit(1)
+
+ machine = args[0]
+ karch = args[1]
+
+ if options.outdir:
+ bsp_output_dir = options.outdir
+ else:
+ bsp_output_dir = "meta-" + machine
+
+ if options.git_check and not options.properties_file:
+ print "Checking basic git connectivity..."
+ if not verify_git_repo(GIT_CHECK_URI):
+ print "Couldn't verify git connectivity, exiting\n"
+ print "Details: couldn't access %s" % GIT_CHECK_URI
+ print " (this most likely indicates a network connectivity problem or"
+ print " a misconfigured git intallation)"
+ sys.exit(1)
+ else:
+ print "Done.\n"
+
+ yocto_bsp_create(machine, karch, scripts_path, bsp_output_dir, options.codedump, options.properties_file)
+
+
+def yocto_bsp_list_subcommand(args, usage_str):
+ """
+ Command-line handling for listing available BSP properties and
+ values. The real work is done by bsp.engine.yocto_bsp_list()
+ """
+ parser = optparse.OptionParser(usage = usage_str)
+
+ parser.add_option("-o", "--outfile", action = "store", dest = "properties_file",
+ help = "dump the possible values for BSP properties to a JSON file")
+
+ (options, args) = parser.parse_args(args)
+
+ if not yocto_bsp_list(args, scripts_path, options.properties_file):
+ logging.error("Bad list arguments, exiting\n")
+ parser.print_help()
+ sys.exit(1)
+
+
+subcommands = {
+ "create": [yocto_bsp_create_subcommand,
+ yocto_bsp_create_usage,
+ yocto_bsp_create_help],
+ "list": [yocto_bsp_list_subcommand,
+ yocto_bsp_list_usage,
+ yocto_bsp_list_help],
+}
+
+
+def start_logging(loglevel):
+ logging.basicConfig(filname = 'yocto-bsp.log', filemode = 'w', level=loglevel)
+
+
+def main():
+ parser = optparse.OptionParser(version = "yocto-bsp version %s" % __version__,
+ usage = yocto_bsp_usage)
+
+ parser.disable_interspersed_args()
+ parser.add_option("-D", "--debug", dest = "debug", action = "store_true",
+ default = False, help = "output debug information")
+
+ (options, args) = parser.parse_args()
+
+ loglevel = logging.INFO
+ if options.debug:
+ loglevel = logging.DEBUG
+ start_logging(loglevel)
+
+ if len(args):
+ if args[0] == "help":
+ if len(args) == 1:
+ parser.print_help()
+ sys.exit()
+
+ invoke_subcommand(args, parser, yocto_bsp_help_usage, subcommands)
+
+
+if __name__ == "__main__":
+ try:
+ ret = main()
+ except Exception:
+ ret = 1
+ import traceback
+ traceback.print_exc()
+ sys.exit(ret)
+
diff --git a/import-layers/yocto-poky/scripts/yocto-kernel b/import-layers/yocto-poky/scripts/yocto-kernel
new file mode 100755
index 000000000..daaad0752
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/yocto-kernel
@@ -0,0 +1,399 @@
+#!/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, 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
+# 'yocto-kernel' is the Yocto BSP Tool that helps users manage kernel
+# config options and patches for a Yocto BSP. Invoking it without any
+# arguments will display help screens for the 'yocto-kernel' command
+# and list the available 'yocto-kernel' 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] intel.com>
+#
+
+__version__ = "0.1.0"
+
+import os
+import sys
+import optparse
+import logging
+
+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]
+
+from bsp.help import *
+from bsp.kernel import *
+
+
+def yocto_kernel_config_list_subcommand(args, usage_str):
+ """
+ Command-line handling for listing BSP config options. The
+ real work is done by bsp.kernel.yocto_kernel_config_list().
+ """
+ logging.debug("yocto_kernel_config_list_subcommand")
+
+ parser = optparse.OptionParser(usage = usage_str)
+
+ (options, args) = parser.parse_args(args)
+
+ if len(args) != 1:
+ logging.error("Wrong number of arguments, exiting\n")
+ parser.print_help()
+ sys.exit(1)
+
+ yocto_kernel_config_list(scripts_path, args[0])
+
+
+def yocto_kernel_config_add_subcommand(args, usage_str):
+ """
+ Command-line handling for adding BSP config items. The real work
+ is done by bsp.kernel.yocto_kernel_config_add().
+ """
+ logging.debug("yocto_kernel_config_add_subcommand")
+
+ parser = optparse.OptionParser(usage = usage_str)
+
+ (options, args) = parser.parse_args(args)
+
+ if len(args) < 2:
+ logging.error("Wrong number of arguments, exiting\n")
+ parser.print_help()
+ sys.exit(1)
+
+ machine = args.pop(0)
+ yocto_kernel_config_add(scripts_path, machine, args)
+
+
+def yocto_kernel_config_rm_subcommand(args, usage_str):
+ """
+ Command-line handling for removing BSP config items. The real
+ work is done by bsp.kernel.yocto_kernel_config_rm().
+ """
+ logging.debug("yocto_kernel_config_rm_subcommand")
+
+ parser = optparse.OptionParser(usage = usage_str)
+
+ (options, args) = parser.parse_args(args)
+
+ if len(args) != 1:
+ logging.error("Wrong number of arguments, exiting\n")
+ parser.print_help()
+ sys.exit(1)
+
+ yocto_kernel_config_rm(scripts_path, args[0])
+
+
+def yocto_kernel_patch_list_subcommand(args, usage_str):
+ """
+ Command-line handling for listing BSP (SRC_URI patches. The real
+ work is done by bsp.kernel.yocto_kernel_patch_list().
+ """
+ logging.debug("yocto_kernel_patch_list_subcommand")
+
+ parser = optparse.OptionParser(usage = usage_str)
+
+ (options, args) = parser.parse_args(args)
+
+ if len(args) != 1:
+ logging.error("Wrong number of arguments, exiting\n")
+ parser.print_help()
+ sys.exit(1)
+
+ yocto_kernel_patch_list(scripts_path, args[0])
+
+
+def yocto_kernel_patch_add_subcommand(args, usage_str):
+ """
+ Command-line handling for adding BSP patches. The real work is
+ done by bsp.kernel.yocto_kernel_patch_add().
+ """
+ logging.debug("yocto_kernel_patch_add_subcommand")
+
+ parser = optparse.OptionParser(usage = usage_str)
+
+ (options, args) = parser.parse_args(args)
+
+ if len(args) < 2:
+ logging.error("Wrong number of arguments, exiting\n")
+ parser.print_help()
+ sys.exit(1)
+
+ machine = args.pop(0)
+ yocto_kernel_patch_add(scripts_path, machine, args)
+
+
+def yocto_kernel_patch_rm_subcommand(args, usage_str):
+ """
+ Command-line handling for removing BSP patches. The real work is
+ done by bsp.kernel.yocto_kernel_patch_rm().
+ """
+ logging.debug("yocto_kernel_patch_rm_subcommand")
+
+ parser = optparse.OptionParser(usage = usage_str)
+
+ (options, args) = parser.parse_args(args)
+
+ if len(args) != 1:
+ logging.error("Wrong number of arguments, exiting\n")
+ parser.print_help()
+ sys.exit(1)
+
+ yocto_kernel_patch_rm(scripts_path, args[0])
+
+
+def yocto_kernel_feature_list_subcommand(args, usage_str):
+ """
+ Command-line handling for listing the BSP features that are being
+ used by the BSP. The real work is done by
+ bsp.kernel.yocto_kernel_feature_list().
+ """
+ logging.debug("yocto_kernel_feature_list_subcommand")
+
+ parser = optparse.OptionParser(usage = usage_str)
+
+ (options, args) = parser.parse_args(args)
+
+ if len(args) != 1:
+ logging.error("Wrong number of arguments, exiting\n")
+ parser.print_help()
+ sys.exit(1)
+
+ yocto_kernel_feature_list(scripts_path, args[0])
+
+
+def yocto_kernel_feature_add_subcommand(args, usage_str):
+ """
+ Command-line handling for adding the use of kernel features to a
+ BSP. The real work is done by bsp.kernel.yocto_kernel_feature_add().
+ """
+ logging.debug("yocto_kernel_feature_add_subcommand")
+
+ parser = optparse.OptionParser(usage = usage_str)
+
+ (options, args) = parser.parse_args(args)
+
+ if len(args) < 2:
+ logging.error("Wrong number of arguments, exiting\n")
+ parser.print_help()
+ sys.exit(1)
+
+ machine = args.pop(0)
+ yocto_kernel_feature_add(scripts_path, machine, args)
+
+
+def yocto_kernel_feature_rm_subcommand(args, usage_str):
+ """
+ Command-line handling for removing the use of kernel features from
+ a BSP. The real work is done by bsp.kernel.yocto_kernel_feature_rm().
+ """
+ logging.debug("yocto_kernel_feature_rm_subcommand")
+
+ parser = optparse.OptionParser(usage = usage_str)
+
+ (options, args) = parser.parse_args(args)
+
+ if len(args) != 1:
+ logging.error("Wrong number of arguments, exiting\n")
+ parser.print_help()
+ sys.exit(1)
+
+ yocto_kernel_feature_rm(scripts_path, args[0])
+
+
+def yocto_kernel_available_features_list_subcommand(args, usage_str):
+ """
+ Command-line handling for listing all the kernel features
+ available for use in a BSP. This includes the features present in
+ the meta branch(es) of the pointed-to repo(s) as well as the local
+ features added in recipe-space to the current BSP as well. The
+ real work is done by bsp.kernel.yocto_kernel_available_features_list().
+ """
+ logging.debug("yocto_kernel_feature_available_features_list_subcommand")
+
+ parser = optparse.OptionParser(usage = usage_str)
+
+ (options, args) = parser.parse_args(args)
+
+ if len(args) != 1:
+ logging.error("Wrong number of arguments, exiting\n")
+ parser.print_help()
+ sys.exit(1)
+
+ yocto_kernel_available_features_list(scripts_path, args[0])
+
+
+def yocto_kernel_feature_describe_subcommand(args, usage_str):
+ """
+ Command-line handling for listing the description of a specific
+ kernel feature available for use in a BSP. This includes the
+ features present in the meta branch(es) of the pointed-to repo(s)
+ as well as the local features added in recipe-space to the current
+ BSP as well. The real work is done by
+ bsp.kernel.yocto_kernel_feature_describe().
+ """
+ logging.debug("yocto_kernel_feature_describe_subcommand")
+
+ parser = optparse.OptionParser(usage = usage_str)
+
+ (options, args) = parser.parse_args(args)
+
+ if len(args) != 2:
+ logging.error("Wrong number of arguments, exiting\n")
+ parser.print_help()
+ sys.exit(1)
+
+ yocto_kernel_feature_describe(scripts_path, args[0], args[1])
+
+
+def yocto_kernel_feature_create_subcommand(args, usage_str):
+ """
+ Command-line handling for creating a recipe-space kernel feature
+ in a BSP. The real work is done by
+ bsp.kernel.yocto_kernel_feature_create().
+ """
+ logging.debug("yocto_kernel_feature_create_subcommand")
+
+ parser = optparse.OptionParser(usage = usage_str)
+
+ (options, args) = parser.parse_args(args)
+
+ if len(args) < 4:
+ logging.error("Wrong number of arguments, exiting\n")
+ parser.print_help()
+ sys.exit(1)
+
+ machine = args.pop(0)
+ yocto_kernel_feature_create(scripts_path, machine, args)
+
+
+def yocto_kernel_feature_destroy_subcommand(args, usage_str):
+ """
+ Command-line handling for removing a recipe-space kernel feature
+ from a BSP. The real work is done by
+ bsp.kernel.yocto_kernel_feature_destroy().
+ """
+ logging.debug("yocto_kernel_feature_destroy_subcommand")
+
+ parser = optparse.OptionParser(usage = usage_str)
+
+ (options, args) = parser.parse_args(args)
+
+ if len(args) != 2:
+ logging.error("Wrong number of arguments, exiting\n")
+ parser.print_help()
+ sys.exit(1)
+
+ yocto_kernel_feature_destroy(scripts_path, args[0], args[1])
+
+
+subcommands = {
+ "config-list": [yocto_kernel_config_list_subcommand,
+ yocto_kernel_config_list_usage,
+ yocto_kernel_config_list_help],
+ "config-add": [yocto_kernel_config_add_subcommand,
+ yocto_kernel_config_add_usage,
+ yocto_kernel_config_add_help],
+ "config-rm": [yocto_kernel_config_rm_subcommand,
+ yocto_kernel_config_rm_usage,
+ yocto_kernel_config_rm_help],
+ "patch-list": [yocto_kernel_patch_list_subcommand,
+ yocto_kernel_patch_list_usage,
+ yocto_kernel_patch_list_help],
+ "patch-add": [yocto_kernel_patch_add_subcommand,
+ yocto_kernel_patch_add_usage,
+ yocto_kernel_patch_add_help],
+ "patch-rm": [yocto_kernel_patch_rm_subcommand,
+ yocto_kernel_patch_rm_usage,
+ yocto_kernel_patch_rm_help],
+ "feature-list": [yocto_kernel_feature_list_subcommand,
+ yocto_kernel_feature_list_usage,
+ yocto_kernel_feature_list_help],
+ "feature-add": [yocto_kernel_feature_add_subcommand,
+ yocto_kernel_feature_add_usage,
+ yocto_kernel_feature_add_help],
+ "feature-rm": [yocto_kernel_feature_rm_subcommand,
+ yocto_kernel_feature_rm_usage,
+ yocto_kernel_feature_rm_help],
+ "features-list": [yocto_kernel_available_features_list_subcommand,
+ yocto_kernel_available_features_list_usage,
+ yocto_kernel_available_features_list_help],
+ "feature-describe": [yocto_kernel_feature_describe_subcommand,
+ yocto_kernel_feature_describe_usage,
+ yocto_kernel_feature_describe_help],
+ "feature-create": [yocto_kernel_feature_create_subcommand,
+ yocto_kernel_feature_create_usage,
+ yocto_kernel_feature_create_help],
+ "feature-destroy": [yocto_kernel_feature_destroy_subcommand,
+ yocto_kernel_feature_destroy_usage,
+ yocto_kernel_feature_destroy_help],
+}
+
+
+def start_logging(loglevel):
+ logging.basicConfig(filname = 'yocto-kernel.log', filemode = 'w', level=loglevel)
+
+
+def main():
+ parser = optparse.OptionParser(version = "yocto-kernel version %s" % __version__,
+ usage = yocto_kernel_usage)
+
+ parser.disable_interspersed_args()
+ parser.add_option("-D", "--debug", dest = "debug", action = "store_true",
+ default = False, help = "output debug information")
+
+ (options, args) = parser.parse_args()
+
+ loglevel = logging.INFO
+ if options.debug:
+ loglevel = logging.DEBUG
+ start_logging(loglevel)
+
+ if len(args):
+ if args[0] == "help":
+ if len(args) == 1:
+ parser.print_help()
+ sys.exit(1)
+ sc = 1
+ else:
+ sc = 0
+
+ if args[sc] == "config" or args[sc] == "patch" or \
+ args[sc] == "feature" or args[sc] == "features":
+ if len(args) < 2 + sc:
+ parser.print_help()
+ sys.exit(1)
+ args[sc] += "-" + args[sc + 1]
+ args.pop(sc + 1)
+
+ invoke_subcommand(args, parser, yocto_kernel_help_usage, subcommands)
+
+
+if __name__ == "__main__":
+ try:
+ ret = main()
+ except Exception:
+ ret = 1
+ import traceback
+ traceback.print_exc()
+ sys.exit(ret)
diff --git a/import-layers/yocto-poky/scripts/yocto-layer b/import-layers/yocto-poky/scripts/yocto-layer
new file mode 100755
index 000000000..356972ece
--- /dev/null
+++ b/import-layers/yocto-poky/scripts/yocto-layer
@@ -0,0 +1,151 @@
+#!/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, 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
+# 'yocto-layer' is the Yocto Tool that helps users create a new Yocto
+# layer. Invoking it without any arguments will display help screens
+# for the 'yocto-layer' command and list the available 'yocto-layer'
+# 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] intel.com>
+#
+
+__version__ = "0.1.0"
+
+import os
+import sys
+import optparse
+import logging
+
+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]
+
+from bsp.help import *
+from bsp.engine import *
+
+
+def yocto_layer_create_subcommand(args, usage_str):
+ """
+ Command-line handling for layer creation. The real work is done by
+ bsp.engine.yocto_layer_create()
+ """
+ parser = optparse.OptionParser(usage = usage_str)
+
+ parser.add_option("-o", "--outdir", dest = "outdir", action = "store",
+ help = "name of layer dir to create")
+ parser.add_option("-i", "--infile", dest = "properties_file", action = "store",
+ help = "name of file containing the values for layer input properties as a JSON file")
+ parser.add_option("-c", "--codedump", dest = "codedump", action = "store_true",
+ default = False, help = "dump the generated code to layergen.out")
+ (options, args) = parser.parse_args(args)
+
+ if len(args) < 1 or len(args) > 2:
+ logging.error("Wrong number of arguments, exiting\n")
+ parser.print_help()
+ sys.exit(1)
+
+ layer_name = args[0]
+ properties = ""
+
+ if len(args) == 2:
+ layer_priority = args[1]
+ properties = '{"layer_priority":"' + layer_priority + '"}'
+
+ if options.outdir:
+ layer_output_dir = options.outdir
+ else:
+ prefix="meta-"
+ if not layer_name.startswith(prefix):
+ layer_output_dir="%s%s"%(prefix,layer_name)
+ else:
+ layer_output_dir=layer_name
+
+ yocto_layer_create(layer_name, scripts_path, layer_output_dir, options.codedump, options.properties_file, properties)
+
+
+def yocto_layer_list_subcommand(args, usage_str):
+ """
+ Command-line handling for listing available layer properties and
+ values. The real work is done by bsp.engine.yocto_layer_list()
+ """
+ parser = optparse.OptionParser(usage = usage_str)
+
+ parser.add_option("-o", "--outfile", action = "store", dest = "properties_file",
+ help = "dump the possible values for layer properties to a JSON file")
+
+ (options, args) = parser.parse_args(args)
+
+ if not yocto_layer_list(args, scripts_path, options.properties_file):
+ logging.error("Bad list arguments, exiting\n")
+ parser.print_help()
+ sys.exit(1)
+
+
+subcommands = {
+ "create": [yocto_layer_create_subcommand,
+ yocto_layer_create_usage,
+ yocto_layer_create_help],
+ "list": [yocto_layer_list_subcommand,
+ yocto_layer_list_usage,
+ yocto_layer_list_help],
+}
+
+
+def start_logging(loglevel):
+ logging.basicConfig(filname = 'yocto-layer.log', filemode = 'w', level=loglevel)
+
+
+def main():
+ parser = optparse.OptionParser(version = "yocto-layer version %s" % __version__,
+ usage = yocto_layer_usage)
+
+ parser.disable_interspersed_args()
+ parser.add_option("-D", "--debug", dest = "debug", action = "store_true",
+ default = False, help = "output debug information")
+
+ (options, args) = parser.parse_args()
+
+ loglevel = logging.INFO
+ if options.debug:
+ loglevel = logging.DEBUG
+ start_logging(loglevel)
+
+ if len(args):
+ if args[0] == "help":
+ if len(args) == 1:
+ parser.print_help()
+ sys.exit(1)
+
+ invoke_subcommand(args, parser, yocto_layer_help_usage, subcommands)
+
+
+if __name__ == "__main__":
+ try:
+ ret = main()
+ except Exception:
+ ret = 1
+ import traceback
+ traceback.print_exc()
+ sys.exit(ret)
+
OpenPOWER on IntegriCloud